dsh-cost-meter 1.8.22 → 1.8.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,9 +8,9 @@
8
8
 
9
9
  Per-conversation cost · daily totals · OpenCode Go subscription quota display · budget with usage percentage · official account balance · custom provider balance · balance progress bar · history · peak/off-peak pricing hours display (peak hours UTC 01:00–04:00, 06:00–10:00; weekends and Chinese public holidays are off-peak all day, with separate labels) · pre-switch popup & system-notification alerts for peak/off-peak changes (position / lead time / alert type configurable) · one-click price sync from the official docs · Codex-style token usage heat grid · multi-vendor model pricing (built-in 170+ model-ID catalog with auto-matching) · mainstream Coding Plan quota queries & display (Anthropic / Z.ai / MiniMax / Kimi / OpenRouter / SiliconFlow / CommandCode / SCNet / Volcano Ark / Qwen / Xiaomi MiMo) plan/API dual-track billing (subscription quota vs pay-as-you-go money separated, per-1% & full-window token/equivalent-cost estimates with daily/weekly/monthly curves) · · quota strip above the input box (budget / Go / coding-plan usage in one row, toggleable)
10
10
 
11
- [![version](https://img.shields.io/badge/version-1.8.22-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
11
+ [![version](https://img.shields.io/badge/version-1.8.23-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
12
12
 
13
- **v1.8.22** fixes duplicate Context tabs and integration cleanup after repeated toggles, and restores monthly Token Plan quotas from Bailian CLI. The native conversation tab stays unchanged, and turning integration off immediately removes its cost regions. Published dsh-context 0.62.0, 0.66.0 and 0.68.1 are covered. If an older client already left duplicate tabs, reload the client or restart the host once after updating. See the [guide](docs/context-costs-design.md#english).
13
+ **v1.8.23** fixes unreadable native model dropdowns under dark skins, including dream-skin Midnight. All cost-setting options use the DSH theme background and text colors without requiring hover. Model mapping and automatic saving are preserved. See the [release notes](CHANGELOG.md).
14
14
 
15
15
  Desktop users: follow the [Desktop installation instructions](docs/install-troubleshooting.md#desktop-安装与更新) for the application's own CLI and `desktop` Profile.
16
16
 
@@ -323,22 +323,22 @@ On Node.js 20, use `npm install -g pnpm@10` instead. See [pnpm installation and
323
323
  dsh plugin --profile web add dsh-cost-meter
324
324
  ```
325
325
 
326
- **PowerShell one-click script** (copy the whole line, paste, press Enter; pnpm is provisioned automatically, git is auto-detected — no clone needed; the install chain is **pinned to the release tag `v1.8.22`** — review the script before running):
326
+ **PowerShell one-click script** (copy the whole line, paste, press Enter; pnpm is provisioned automatically, git is auto-detected — no clone needed; the install chain is **pinned to the release tag `v1.8.23`** — review the script before running):
327
327
 
328
328
  ```powershell
329
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.8.22/install.ps1 | iex
329
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.8.23/install.ps1 | iex
330
330
  ```
331
331
 
332
332
  **Or a plain command line** (the machine must already have pnpm and git; also pinned to the tag):
333
333
 
334
334
  ```sh
335
- dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.8.22
335
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.8.23
336
336
  ```
337
337
 
338
338
  Without git, use the GitHub tag archive:
339
339
 
340
340
  ```sh
341
- dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.8.22.tar.gz
341
+ dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.8.23.tar.gz
342
342
  ```
343
343
 
344
344
  After installing, **restart** `dsh web` (plugin rows, the Typert manifest and the client bundle are all scanned at startup):
package/README.zh-CN.md CHANGED
@@ -8,9 +8,9 @@
8
8
 
9
9
  本会话费用 · 当日费用 · OpenCode Go 订阅额度显示 · 预算与已用百分比 · 官方账户余额 · 自定义 Provider 余额查询(可配任意 HTTP 端点) · 余额三段进度条 · 历史记录 · 峰谷计价时段显示(UTC 01:00–04:00、06:00–10:00 为峰时段;周末与中国法定假日全天按谷价,分别标注) · 峰/谷切换前弹窗与系统通知提醒(位置/提前量/提醒类型可配) · 官方价格一键同步 · 类 Codex Token 用量热图 · 多厂商多模型价格计费(内置 170+ 模型 ID 价格目录与自动匹配) · 主流 Coding Plan 额度查询与显示(Anthropic / Z.ai / MiniMax / Kimi / OpenRouter / SiliconFlow / CommandCode / SCNet / 火山方舟 / 千问 / 小米 MiMo 十一家,含 Volcano Ark AK/SK 签名与 MiMo 控制台 Cookie 查询) · Plan/API 双轨计费(订阅额度与按量金额分离统计,每 1% 额度与满窗的 token/等值金额估算及日/周/月曲线) · 输入框上方额度横条(预算/Go/Coding Plan 用量一条横排显示,可开关)
10
10
 
11
- [![version](https://img.shields.io/badge/version-1.8.22-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
11
+ [![version](https://img.shields.io/badge/version-1.8.23-4176E6)](https://github.com/Han-1413141/dsh-cost-meter)
12
12
 
13
- **v1.8.22** 修复 dsh-context 重复页签、关闭残留,以及百炼 CLI 月额度卡片空白的问题。会话页保留原生页签,关闭联动立即移除费用区域;覆盖 0.62.0、0.66.0、0.68.1。如旧客户端已累积重复页签,更新后重新加载客户端或重启宿主一次。详见[使用说明](docs/context-costs-design.md)。
13
+ **v1.8.23** 修复深色皮肤下价格设置的模型下拉菜单看不清的问题,包括 dream-skin“午夜黑”。费用设置的选项背景与文字一起跟随 DSH 主题,无需悬停即可查看,保留模型映射和自动保存。详见[更新记录](CHANGELOG.md)。
14
14
 
15
15
  桌面端用户请按 [Desktop 安装说明](docs/install-troubleshooting.md#desktop-安装与更新),使用应用自带的 CLI 和 `desktop` Profile。
16
16
 
@@ -323,22 +323,22 @@ Node.js 20 请改用 `npm install -g pnpm@10`。版本要求见 [pnpm 官方安
323
323
  dsh plugin --profile web add dsh-cost-meter
324
324
  ```
325
325
 
326
- **PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.8.22`**,建议先下载审阅再运行):
326
+ **PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.8.23`**,建议先下载审阅再运行):
327
327
 
328
328
  ```powershell
329
- irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.8.22/install.ps1 | iex
329
+ irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.8.23/install.ps1 | iex
330
330
  ```
331
331
 
332
332
  **或直接命令行**(机器上需已有 pnpm 与 git;同样固定到 tag):
333
333
 
334
334
  ```sh
335
- dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.8.22
335
+ dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.8.23
336
336
  ```
337
337
 
338
338
  没有 git 时可用 GitHub tag 打包直链:
339
339
 
340
340
  ```sh
341
- dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.8.22.tar.gz
341
+ dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.8.23.tar.gz
342
342
  ```
343
343
 
344
344
  安装后**重启** `dsh web`(插件行、Typert 清单与客户端 bundle 均在启动时扫描):
package/lib/client.js CHANGED
@@ -1,5 +1,5 @@
1
- // This file is generated from the src/client/*.js fragments via `node scripts/build.mjs` (esbuild). Do not edit directly.
2
- window.__ModuleLoader__.load({id:"dsh-cost-meter",factory:at=>{var na={exports:{}},kt=na.exports;Object.defineProperty(kt,Symbol.toStringTag,{value:"Module"});const Oe=at("react"),{Tooltip:$}=at("@deepseek-ai/dsh-client-ui-primitives"),nt=!1,oa='@property --cm-dialog-top{syntax:"<length>";inherits:true;initial-value:0px}.cm-stat-dialog{--cm-dialog-top:var(--dsh-frame-chrome-top,var(--dsh-frame-top-clearance,var(--dsh-windows-titlebar-height,0px)));inset:var(--cm-dialog-top) 0 0 0;margin:auto;width:min(1000px,94vw);max-width:calc(100vw - 32px);max-height:calc(100vh - var(--cm-dialog-top) - 32px);overflow:hidden;box-sizing:border-box;padding:0;border-radius:16px;border:1px solid var(border-l1);color:var(label-primary);background:var(bg-layer-2,var(bg-base,#fff))}.cm-stat-dialog[open]{display:flex;flex-direction:column}.cm-loading{padding:24px;min-height:160px;display:grid;gap:18px}.cm-loading i{height:18px;border-radius:5px;background:var(bg-layer-1,#f2f3f5)}.cm-loading i:first-child{width:35%}.cm-loading i:last-child{width:65%}.cm-stat-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 24px;border-bottom:1px solid var(border-l3);flex:none}.cm-stat-dialog-head strong{font-size:15px;font-weight:500}.cm-stat-dialog-body{overflow:auto;min-height:0;padding:20px 24px;overscroll-behavior:contain}.cm-stat-dialog::backdrop{inset:var(--dsh-frame-chrome-top,var(--dsh-frame-top-clearance,var(--dsh-windows-titlebar-height,0px))) 0 0;background:#0005}[data-fullscreen] .cm-stat-dialog{--cm-dialog-top:0px}[data-fullscreen] .cm-stat-dialog::backdrop{inset:0}.cm-root{flex:0 1 auto;min-width:0;max-width:100%;text-align:center;font-size:12px;line-height:20px;color:var(label-tertiary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cm-chip{display:inline-flex;align-items:center;gap:4px;max-width:180px;padding:0 8px;height:22px;border-radius:6px;background:var(bg-layer-2);font-size:12px;line-height:22px;color:var(label-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cm-foot{display:flex;align-items:center;gap:6px;height:32px;padding:0 8px;border-radius:8px;font-size:12px;color:var(label-secondary);white-space:nowrap;overflow:hidden}.cm-foot:hover,.cm-foot-rail:hover,.cm-corner-chip:hover,.cm-qchip:hover,.cm-tab:hover,.cm-btn:hover{background:var(interactive-bg-hover)}.cm-foot-rail{width:100%;justify-content:center;padding:0;font-size:13px;font-weight:600;color:var(label-primary)}.cm-num{font-variant-numeric:tabular-nums}.cm-go-rail{font-size:11px;font-weight:700;color:var(label-primary)}.cm-go-list{display:flex;flex-direction:column;gap:10px}.cm-go-row{display:flex;align-items:center;gap:8px;font-size:12px}.cm-go-label{flex:none;width:88px;color:var(label-secondary)}.cm-go-bar{flex:1;height:6px;border-radius:3px;background:var(interactive-bg-hover);overflow:hidden}.cm-go-fill{height:100%;border-radius:3px;background:var(brand-primary)}.cm-go-num{flex:none;min-width:44px;text-align:right;font-weight:600;font-variant-numeric:tabular-nums}.cm-go-reset{flex:none;max-width:230px;font-size:11px;color:var(label-tertiary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cm-go-time{font-size:11px;color:var(label-tertiary)}.cm-go-row.main .cm-go-label{font-weight:600;color:var(label-primary)}.cm-corner{display:inline-flex;flex:0 1 auto;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;min-width:0;max-width:100%}.cm-corner-chip{display:inline-flex;align-items:center;height:20px;padding:0 8px;border-radius:6px;background:var(bg-layer-2);font-size:11px;line-height:20px;color:var(label-secondary);white-space:nowrap;font-variant-numeric:tabular-nums}.cm-qstrip{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;width:100%;max-width:var(--dsh-chat-content-width,720px);margin:0 auto;box-sizing:border-box;padding:0 calc(var(--dsh-composer-side-clearance,0px) + 16px)}.cm-qchip{display:inline-flex;align-items:center;gap:6px;height:22px;padding:0 8px;border-radius:6px;background:var(bg-layer-2);font-size:11px;line-height:22px;color:var(label-secondary);white-space:nowrap;font-variant-numeric:tabular-nums;cursor:default}.cm-qchip .cm-qlabel{color:var(label-primary);font-weight:600}.cm-qchip .cm-qbar{display:block;width:44px;height:4px;border-radius:2px;background:var(border-l1);overflow:hidden;flex:none}.cm-qchip .cm-qfill{display:block;height:100%;border-radius:2px;background:var(state-ok-primary,#3ba272)}.cm-qchip .cm-qseg{display:inline-flex;align-items:center;gap:4px}.cm-qchip .cm-qsep{width:1px;height:12px;background:var(border-l1);flex:none}.cm-qchip .cm-qtext{color:var(label-secondary)}.cm-qchip.warn .cm-qfill{background:var(state-warn-primary)}.cm-qchip.over .cm-qfill{background:var(state-error-primary)}.cm-qchip.action{cursor:pointer;user-select:none;outline:none}.cm-qchip.action:focus-visible{box-shadow:0 0 0 2px var(brand-primary)}.cm-qchip.action:active{transform:translateY(.5px)}.cm-plan-provider{display:flex;flex-direction:column;gap:8px}.cm-plan-provider+.cm-plan-provider{margin-top:14px}.cm-plan-provider-name{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600}.cm-plan-updated{font-size:11px;font-weight:400;color:var(label-tertiary)}.cm-plan-tag{flex:none;margin-left:6px;padding:0 6px;border-radius:999px;border:1px solid var(border-l1);font-size:10px;line-height:16px;color:var(state-warn-primary)}.cm-plan-reset,.cm-plan-method{font-size:11px;color:var(label-tertiary)}.cm-qguide{position:fixed;top:18px;left:50%;transform:translate(-50%);z-index:9999;max-width:440px;width:calc(100% - 32px);border:1px solid var(border-l1);border-radius:12px;background:var(bg-layer-2);box-shadow:0 8px 28px #0000002e;padding:14px 16px;font-size:13px;color:var(label-primary);display:flex;flex-direction:column;gap:8px}.cm-qguide h4{margin:0;font-size:13px;font-weight:600}.cm-qguide p{margin:0;font-size:12px;line-height:1.6;color:var(label-secondary)}.cm-qguide .cm-buttons{display:flex;gap:8px;justify-content:flex-end}.cm-section{display:flex;flex-direction:column;gap:20px;padding:4px 2px 24px;font-size:13px;color:var(label-primary)}.cm-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.cm-cards-toggle{display:flex;align-items:center;gap:6px;margin:-6px 2px 0 auto;width:fit-content;font-size:12px;color:var(label-tertiary);cursor:pointer;user-select:none}.cm-cards-toggle:hover{color:var(label-primary)}.cm-cards-toggle input{margin:0;cursor:pointer}.cm-card,.cm-budget{border:1px solid var(border-l1);border-radius:12px;padding:14px 16px;background:var(bg-layer-1)}.cm-card-title{font-size:12px;color:var(label-tertiary);margin:0 0 8px}.cm-card-value{font-size:20px;line-height:28px;font-weight:600}.cm-card-sub{font-size:12px;color:var(label-tertiary);margin-top:4px}.cm-h{font-size:13px;font-weight:600;margin:0}.cm-collapse-h{display:flex;align-items:center;gap:8px;background:none;border:none;padding:0;margin:0;cursor:pointer;color:inherit;font:inherit;text-align:left}.cm-collapse-h:hover .cm-h{color:var(interactive-text-hover,var(label-primary))}.cm-caret{flex:none;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:6px solid var(label-secondary);transform:rotate(-90deg);transition:transform .15s ease}.cm-caret.open{transform:rotate(0)}.cm-collapse-body{display:flex;flex-direction:column;gap:12px;margin-top:12px}.cm-toolbar{display:flex;justify-content:flex-end;align-items:center;gap:10px}.cm-toolbar .cm-field{flex-direction:row;align-items:center;gap:8px}.cm-toolbar .cm-field label{margin:0;font-size:12px;color:var(label-tertiary)}.cm-toolbar .cm-input{min-width:150px;padding:4px 10px}.cm-tabs-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;border-bottom:1px solid var(--dsh-alias-border-l1);padding-bottom:10px}.cm-tabs{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.cm-tab{font:inherit;font-size:13px;color:var(label-secondary);background:transparent;border:none;border-radius:8px;padding:6px 14px;cursor:pointer;white-space:nowrap}.cm-tab.active{background:var(state-business-primary);color:var(label-primary-inverted);font-weight:600}.cm-tabs-row .cm-msg{padding:2px 10px}.cm-note{font-size:12px;color:var(label-tertiary);margin:0}.cm-table{width:100%;border-collapse:collapse;font-size:12px}.cm-table th,.cm-table td{text-align:left;padding:7px 10px;border-bottom:1px solid var(border-l1);white-space:nowrap}.cm-table th{color:var(label-tertiary);font-weight:500}.cm-table td.num,.cm-table th.num{text-align:right;font-variant-numeric:tabular-nums}.cm-table tr:last-child td{border-bottom:none}.cm-table tr.cm-row-click{cursor:pointer}.cm-table tr.cm-row-click:hover td{background:var(bg-hover,rgba(127,127,127,.08))}.cm-sess-title{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cm-sess-id{font-size:11px;font-family:ui-monospace,Consolas,monospace;color:var(label-tertiary)}.cm-empty{font-size:12px;color:var(label-tertiary);padding:8px 0}.cm-scroll{max-height:320px;overflow:auto;border:1px solid var(border-l1);border-radius:10px}.cm-grid{display:grid;grid-template-columns:repeat(2,minmax(220px,1fr));gap:12px}.cm-field{display:flex;flex-direction:column;gap:6px}.cm-field label{font-size:12px;color:var(label-secondary)}.cm-input{font:inherit;font-size:13px;color:var(label-primary);background:var(bg-base);border:1px solid var(border-l1);border-radius:8px;padding:6px 10px;outline:none}.cm-input:focus{border-color:var(state-business-primary)}.cm-input.narrow{max-width:120px}.cm-range-row{display:flex;align-items:center;gap:10px}.cm-range{flex:1;min-width:0;accent-color:var(state-business-primary)}.cm-range-value{flex:none;min-width:44px;font-size:12px;color:var(label-tertiary);text-align:right}.cm-check{display:flex;align-items:center;gap:8px;font-size:13px;color:var(label-primary);cursor:pointer}.cm-price-card{border:1px solid var(border-l1);border-radius:10px;padding:12px 14px;display:flex;flex-direction:column;gap:10px;background:var(bg-layer-1)}.cm-price-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.cm-price-name{font-weight:600;font-size:13px}.cm-price-legacy{font-size:11px;color:var(label-tertiary);border:1px solid var(border-l1);border-radius:999px;padding:1px 8px}.cm-price-row{display:grid;grid-template-columns:52px 1fr 1fr 1fr;gap:8px;align-items:center}.cm-price-row span{font-size:12px;color:var(label-tertiary)}.cm-price-row input{width:100%}.cm-buttons{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.cm-btn{font:inherit;font-size:13px;color:var(label-primary);background:var(button-elevated-fill);border:1px solid var(border-l1);border-radius:8px;padding:6px 14px;cursor:pointer}.cm-btn.cm-stat-entry{font-size:12px;line-height:20px;padding:0 6px;min-width:0;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-shrink:0}@media(max-width:640px){.cm-stat-header{display:none}}.cm-btn.primary{background:var(state-business-primary);border-color:transparent;color:var(label-primary-inverted)}.cm-btn.primary:hover{opacity:.88;background:var(state-business-primary)}.cm-btn.danger,.cm-msg.err,.cm-bal-line.err,.cm-bal-err{color:var(state-error-primary)}.cm-btn.small{padding:3px 10px;font-size:12px}div:has(>[data-slot="conversation.composer.dock"] .cm-stat-entry){flex-wrap:nowrap;column-gap:6px}.cm-msg{font-size:12px;line-height:18px;padding:8px 12px;border-radius:8px;border:1px solid var(border-l1)}.cm-msg.ok{color:var(state-success-primary)}.cm-hint{font-size:12px;color:var(label-tertiary)}.cm-budget{display:flex;flex-direction:column;gap:10px}.cm-peak-alert{position:fixed;z-index:9999;width:340px;max-width:calc(100vw - 32px);padding:16px;border-radius:14px;background:var(bg-layer-2);border:1px solid var(border-l2);box-shadow:0 14px 36px #00000038;display:flex;flex-direction:column;gap:8px;font-size:12px;animation:cm-peak-alert-in .22s cubic-bezier(.2,.8,.2,1)}.cm-peak-alert.cm-peak-alert-corner{right:20px;bottom:20px}.cm-peak-alert.cm-peak-alert-center{top:50%;left:50%;transform:translate(-50%,-50%);animation-name:cm-peak-alert-in-center}.cm-peak-alert-peak{border-top:3px solid var(state-warn-primary)}.cm-peak-alert-offpeak{border-top:3px solid var(state-info-primary,#3b82f6)}.cm-peak-alert-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;letter-spacing:.4px;text-transform:uppercase}.cm-peak-alert-badge:before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor;box-shadow:0 0 0 4px color-mix(in srgb,currentColor 16%,transparent)}.cm-peak-alert-peak .cm-peak-alert-badge{color:var(state-warn-primary)}.cm-peak-alert-offpeak .cm-peak-alert-badge{color:var(state-info-primary,#3b82f6)}.cm-peak-alert-title{font-size:14px;font-weight:600;color:var(label-primary)}.cm-peak-alert-body{color:var(label-secondary);line-height:1.55}.cm-peak-alert-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:2px}.cm-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}@keyframes cm-peak-alert-in{0%{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes cm-peak-alert-in-center{0%{opacity:0;transform:translate(-50%,calc(-50% + 10px))}to{opacity:1;transform:translate(-50%,-50%)}}.cm-budget-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.cm-quota-name{flex:1;min-width:0}.cm-budget-bar{height:8px;border-radius:999px;background:var(bg-layer-3);overflow:hidden}.cm-budget-fill{height:100%;border-radius:999px;background:var(state-business-primary);transition:width .3s ease}.cm-ug{display:flex;flex-direction:column;gap:12px}.cm-ug-total{font-size:13px;color:var(label-primary)}.cm-ug-grid{display:grid;grid-auto-flow:column;grid-template-rows:repeat(7,auto);gap:3px;width:100%}.cm-ug-cell{width:100%;aspect-ratio:1/1;border-radius:3px;box-sizing:border-box;background:color-mix(in srgb,var(label-primary) 8%,transparent);border:1px solid var(border-l1)}.cm-ug-cell.l1,.cm-ug-cell.l2,.cm-ug-cell.l3,.cm-ug-cell.l4{border-color:transparent}.cm-ug-cell.l1{background:color-mix(in srgb,var(state-business-primary) 25%,var(bg-layer-3))}.cm-ug-cell.l2{background:color-mix(in srgb,var(state-business-primary) 50%,var(bg-layer-3))}.cm-ug-cell.l3{background:color-mix(in srgb,var(state-business-primary) 75%,var(bg-layer-3))}.cm-ug-cell.l4{background:var(state-business-primary)}.cm-ug-cell.today{outline:1px solid var(label-secondary);outline-offset:1px}.cm-ug-months{display:grid;grid-auto-flow:column;gap:3px;width:100%;font-size:10px;color:var(label-tertiary);margin-top:4px}.cm-ug-monthc{white-space:nowrap}.cm-budget-line{font-size:13px;color:var(label-secondary)}.cm-budget-line.over{color:var(state-error-primary)}.cm-peak-strip{display:flex;align-items:center;gap:6px;margin-top:4px;min-width:0}.cm-peak-track{position:relative;display:flex;flex:1;height:6px;min-width:0;border-radius:999px;overflow:hidden;border:1px solid var(border-l1);background:var(bg-layer-3)}.cm-peak-segment{height:100%;flex:1}.cm-peak-high{background:#ff9800}.cm-peak-low{background:var(state-business-primary)}.cm-peak-marker{position:absolute;top:0;left:50%;width:2px;height:100%;background:var(bg-base);box-shadow:0 0 0 1px var(label-tertiary);transform:translate(-50%);transition:left .4s ease;z-index:2}.cm-peak-chip{font-size:11px;font-weight:600;line-height:1.2;white-space:nowrap;color:var(label-secondary)}.cm-peak-classic{position:relative;display:flex;flex-direction:column;gap:5px;margin-top:6px;min-width:0}.cm-peak-classic .cm-peak-track{flex:none;height:8px}.cm-peak-classic-marker{position:absolute;top:0;left:50%;width:4px;height:12px;background:var(bg-base);border:1.5px solid #ff9800;box-shadow:0 0 0 1px var(bg-base),0 0 0 2px var(label-tertiary);transform:translate(-50%);transition:left .4s ease;z-index:2;border-radius:2px}.cm-peak-classic-marker:after{content:"";position:absolute;top:-7px;left:50%;transform:translate(-50%);border-left:5px solid transparent;border-right:5px solid transparent;border-top:6px solid #ff9800}.cm-peak-classic.off .cm-peak-classic-marker{border-color:var(state-business-primary)}.cm-peak-classic.off .cm-peak-classic-marker:after{border-top-color:var(state-business-primary)}.cm-peak-classic-chip{align-self:flex-start;font-size:11px;font-weight:600;line-height:1.4;background:var(bg-layer-2);border:1px solid var(border-l1);border-radius:999px;padding:2px 8px;white-space:nowrap;color:var(label-secondary)}.cm-peak-strip.peak .cm-peak-chip,.cm-peak-classic.peak .cm-peak-classic-chip,.cm-peak-rail.peak .cm-peak-rail-label,.cm-peak-rail-classic.peak .cm-peak-rail-classic-label{color:#ff9800}.cm-peak-strip.off .cm-peak-chip,.cm-peak-classic.off .cm-peak-classic-chip,.cm-peak-rail.off .cm-peak-rail-label,.cm-peak-rail-classic.off .cm-peak-rail-classic-label{color:var(state-business-primary)}.cm-peak-strip.weekend .cm-peak-chip,.cm-peak-classic.weekend .cm-peak-classic-chip,.cm-peak-rail.weekend .cm-peak-rail-label,.cm-peak-rail-classic.weekend .cm-peak-rail-classic-label{color:#34a853}.cm-peak-classic.weekend .cm-peak-classic-marker{border-color:#34a853}.cm-peak-classic.weekend .cm-peak-classic-marker:after{border-top-color:#34a853}.cm-peak-rail{display:flex;flex-direction:column;align-items:center;gap:3px;width:40px;box-sizing:border-box}.cm-peak-rail-track{position:relative;display:flex;flex-direction:column;width:6px;height:56px;border-radius:999px;overflow:hidden;border:1px solid var(border-l1);background:var(bg-layer-3)}.cm-peak-rail-segment{width:100%;flex:1}.cm-peak-rail-high{background:#ff9800}.cm-peak-rail-low{background:var(state-business-primary)}.cm-peak-rail-marker{position:absolute;left:0;top:50%;width:100%;height:2px;background:var(bg-base);box-shadow:0 0 0 1px var(label-tertiary);transform:translateY(-50%);transition:top .4s ease;z-index:2}.cm-peak-rail-label{font-size:10px;font-weight:600;line-height:1.2;white-space:nowrap;color:var(label-secondary)}.cm-peak-rail-classic{display:flex;flex-direction:column;align-items:center;gap:3px;width:40px;box-sizing:border-box}.cm-peak-rail-classic-track{position:relative;display:flex;flex-direction:column;width:14px;height:56px;border-radius:999px;border:1px solid var(border-l1);background:var(bg-layer-3)}.cm-peak-rail-classic-segment{position:relative;width:100%;flex:1;overflow:hidden}.cm-peak-rail-classic-segment.peak{background:#ff9800;border-radius:999px 999px 0 0}.cm-peak-rail-classic-segment.off{background:var(state-business-primary);border-radius:0 0 999px 999px}.cm-peak-rail-classic-marker{position:absolute;left:50%;top:50%;width:12px;height:4px;background:var(bg-base);border:1.5px solid #ff9800;box-shadow:0 0 0 1px var(bg-base),0 0 0 2px var(label-tertiary);transform:translate(-50%,-50%);transition:top .4s ease;z-index:2;border-radius:2px}.cm-peak-rail-classic.off .cm-peak-rail-classic-marker{border-color:var(state-business-primary)}.cm-peak-rail-classic-label{font-size:10px;font-weight:600;line-height:1.2;white-space:nowrap}.cm-peak-rail-classic.weekend .cm-peak-rail-classic-marker{border-color:#34a853}.cm-grid-group{grid-column:1 / -1;margin-top:8px;font-size:12px;font-weight:600;color:var(label-tertiary);border-bottom:1px solid var(border-l1);padding-bottom:4px}.cm-grid-group:first-child{margin-top:0}.cm-peak-preview{margin-top:8px}.cm-toggle-btn{background:none;border:none;padding:0;font-size:12px;font-weight:600;color:var(state-business-primary);cursor:pointer}.cm-toggle-btn:hover{text-decoration:underline}.cm-collapsed-note{margin-top:4px}.cm-catalog-vendor{margin-top:10px;font-size:12px;font-weight:600;color:var(label-tertiary);border-bottom:1px solid var(border-l1);padding-bottom:2px;display:flex;align-items:center;justify-content:space-between;gap:8px}.cm-vendor-toggle{cursor:pointer;user-select:none}.cm-vendor-toggle:hover{color:var(label-secondary)}.cm-vendor-display{display:inline-flex;align-items:center;gap:4px;font-weight:400;font-size:11px;color:var(label-tertiary);white-space:nowrap}.cm-catalog-family{margin:6px 0 2px;font-size:11px;font-weight:600;color:var(label-tertiary)}.cm-catalog-row{display:flex;align-items:center;gap:8px;padding:4px 0;border-top:1px solid var(border-l1);font-size:12px}.cm-catalog-mounted{display:flex;flex-direction:column;gap:4px;padding:6px 0;border-top:1px solid var(border-l1)}.cm-catalog-id{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cm-catalog-price{color:var(label-secondary);white-space:nowrap;font-size:11px}.cm-catalog-tag{font-size:10px;padding:1px 6px;border-radius:999px;border:1px solid var(state-business-primary);color:var(state-business-primary);white-space:nowrap}.cm-mstats-tabs{display:flex;gap:8px;margin-bottom:8px}.cm-mstats-tab{background:none;border:1px solid var(border-l1);border-radius:999px;padding:2px 12px;font-size:12px;color:var(label-secondary);cursor:pointer}.cm-mstats-tab.active{background:var(state-business-primary);border-color:var(state-business-primary);color:var(bg-base);font-weight:600}.cm-mstats-h{margin:10px 0 4px;font-size:12px;font-weight:600;color:var(label-secondary)}.cm-mstats-row{display:grid;grid-template-columns:minmax(90px,170px) 1fr auto;gap:8px;align-items:center;font-size:11px;line-height:1.7}.cm-mstats-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(label-secondary)}.cm-mstats-barbg{position:relative;height:10px;border-radius:999px;background:var(bg-layer-3);overflow:hidden;display:flex}.cm-mstats-bar{height:100%;min-width:0;border-radius:999px}.cm-mstats-bar.cost{background:#ff9800}.cm-mstats-bar.hit{background:#34a853}.cm-mstats-bar.value{background:#a142f4}.cm-mstats-seg{height:100%;min-width:0}.cm-mstats-seg.in{background:var(state-business-primary)}.cm-mstats-seg.cache{background:#ff9800}.cm-mstats-seg.out{background:#34a853}.cm-mstats-val{white-space:nowrap;color:var(label-secondary)}.cm-mstats-legend{display:flex;gap:12px;font-size:10px;color:var(label-tertiary);margin:2px 0 4px}.cm-mstats-dot{display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:3px}.cm-mstats-note{margin-top:10px;font-size:10px;line-height:1.6;color:var(label-tertiary)}.cm-match-row{display:flex;align-items:center;gap:8px;padding:3px 0;font-size:12px;flex-wrap:wrap}.cm-match-row .cm-input{flex:1;min-width:160px}.cm-budget-controls{display:grid;grid-template-columns:repeat(2,minmax(180px,1fr));gap:12px}.cm-bbox{border:1px solid var(border-l1);border-radius:12px;padding:8px 10px;background:var(bg-layer-1);display:flex;flex-direction:column;gap:6px;min-width:148px;box-sizing:border-box}.cm-bbox.rail{padding:6px;min-width:0;width:40px;align-items:center;justify-content:center;border-radius:10px}.cm-bbox.warn{border-color:var(state-warn-primary)}.cm-bbox.over{border-color:var(state-error-primary)}.cm-bbox-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.cm-bbox-label,.cm-bbox-pct{font-size:12px;font-weight:600;color:var(label-primary)}.cm-bbox.warn .cm-bbox-pct{color:var(state-warn-primary)}.cm-bbox.over .cm-bbox-pct{color:var(state-error-primary)}.cm-bbox-bar{height:6px;border-radius:999px;background:var(bg-layer-3);overflow:hidden}.cm-bbox-bar.segments{display:flex;height:8px}.cm-bbox-bar.segments .cm-bbox-fill{flex:none;border-radius:0;height:100%}.cm-bbox-bar.segments .cm-bbox-fill:first-child{border-radius:999px 0 0 999px}.cm-bbox-bar.segments .cm-bbox-seg-today{flex:none;height:100%;background:#ff9800}.cm-bbox-bar.segments .cm-bbox-seg-spent{flex:none;height:100%;background:var(interactive-bg-hover);border-radius:0 999px 999px 0}.cm-bbox-bar.segments.rev .cm-bbox-fill:first-child,.cm-bbox-bar.segments.rev .cm-bbox-seg-today:first-child{border-radius:999px 0 0 999px}.cm-bbox-bar.segments.rev .cm-bbox-fill,.cm-bbox-bar.segments.rev .cm-bbox-fill:last-child,.cm-bbox-bar.segments.rev .cm-bbox-seg-today:last-child,.cm-bbox-bar.segments.rev .cm-bbox-seg-spent:last-child{border-radius:0 999px 999px 0}.cm-bbox-bar.segments.rev .cm-bbox-seg-spent{border-radius:0}.cm-dir-row{display:flex;align-items:center;gap:8px;margin-top:6px}.cm-dir-label{flex:1 1 40%;font-size:12px;color:var(label-secondary)}.cm-dir-row .cm-input{flex:1 1 60%;width:auto}.cm-bbox-fill{height:100%;border-radius:999px;background:var(state-business-primary)}.cm-balance-name{display:inline-flex;align-items:center;gap:4px;min-width:0}.cm-model-costs{font-size:12px}.cm-model-costs .cm-bal-label{white-space:nowrap}.cm-model-top{gap:4px;max-width:180px;overflow:hidden;text-overflow:ellipsis}.cm-model-costs .cm-collapse-h{min-width:0;width:100%;white-space:nowrap}.cm-model-costs .cm-bbox-bar{margin-top:3px}.cm-bal-label{min-width:0;overflow:hidden;text-overflow:ellipsis}.cm-bal-amt{margin-left:auto;text-align:right;flex-shrink:0}.cm-bbox-pct.cm-bal-amt{color:var(state-business-primary)}.cm-bal-link{flex:none;display:inline-flex;align-items:center;justify-content:center;padding:2px;border-radius:4px;font-size:12px;line-height:16px;color:var(label-tertiary);text-decoration:none;outline:none}.cm-bal-link:hover{color:var(brand-primary);background:var(interactive-bg-hover)}.cm-bal-link:focus-visible{box-shadow:0 0 0 2px var(brand-primary)}.cm-bbox.warn .cm-bbox-fill,.cm-bbox .cm-bbox-section.warn .cm-bbox-fill,.cm-bbox .cm-mm-row.warn .cm-bbox-fill,.cm-budget-fill.warn{background:var(state-warn-primary)}.cm-bbox.over .cm-bbox-fill,.cm-bbox-section.over .cm-bbox-fill,.cm-mm-row.over .cm-bbox-fill,.cm-budget-fill.over{background:var(state-error-primary)}.cm-bbox-line{font-size:12px;color:var(label-tertiary)}.cm-bbox-rail{font-size:11px;font-weight:600;color:var(label-primary)}.cm-bbox.warn .cm-bbox-pct,.cm-bbox.warn .cm-bbox-rail,.cm-bbox .cm-bbox-section.warn .cm-bbox-pct,.cm-bbox .cm-mm-row.warn .cm-bbox-pct,.cm-mm-row.warn .cm-bbox-label,.cm-corner-chip.warn,.cm-qchip.warn,.cm-simple-summary.warn{color:var(state-warn-primary)}.cm-bbox.over .cm-bbox-pct,.cm-bbox.over .cm-bbox-rail,.cm-bbox-section.over .cm-bbox-pct,.cm-mm-row.over .cm-bbox-pct,.cm-mm-row.over .cm-bbox-label,.cm-corner-chip.over,.cm-qchip.over,.cm-simple-summary.over{color:var(state-error-primary)}.cm-bbox-pair{display:flex;flex-direction:column;gap:0;padding:2px 10px}.cm-bbox-pair .cm-bbox-section{display:flex;flex-direction:column;gap:4px;padding:4px 0}.cm-bbox-pair .cm-bbox-bar{height:4px}.cm-bbox-divider{height:1px;background:var(border-l1);margin:0}.cm-bbox.clickable,.cm-foot.clickable{cursor:pointer}.cm-bbox.clickable:hover{border-color:var(state-business-primary)}.cm-bbox.clickable:focus-visible,.cm-foot.clickable:focus-visible{outline:2px solid var(state-business-primary);outline-offset:1px}@keyframes cm-click-refresh-pulse{0%,to{opacity:.55}50%{opacity:1}}.cm-bbox.clickable.busy,.cm-foot.clickable.busy{animation:cm-click-refresh-pulse 1.1s ease-in-out infinite}.cm-mm{padding:8px 10px;gap:4px}.cm-mm-title{font-size:12px;font-weight:600;color:var(label-primary)}.cm-mm-reset{font-size:11px;color:var(label-tertiary);grid-column:1/-1}.cm-gw-switcher{cursor:pointer;user-select:none;font-size:11px;padding:1px 6px;border-radius:999px;border:1px solid var(border-l1);background:var(bg-layer-2);color:var(label-secondary)}.cm-gw-switcher:hover{background:var(interactive-bg-hover);color:var(label-primary)}.cm-gw-sub{font-size:11px;color:var(label-tertiary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cm-mm-row{display:flex;align-items:center;gap:8px;padding:2px 0}.cm-mm-row .cm-bbox-label{flex:none;width:auto;min-width:22px;max-width:115px;font-weight:400;color:var(label-secondary);font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;word-break:keep-all}.cm-mm-row .cm-bbox-bar{flex:1;min-width:40px;height:6px}.cm-mm-row .cm-bbox-pct{flex:none;min-width:2.4em;text-align:right;font-variant-numeric:tabular-nums}.cm-mm-row.wide .cm-bbox-label{width:auto;max-width:64px;flex:0 1 auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cm-mm-row.wide .cm-mm-text{flex:1;min-width:0;font-size:12px;color:var(label-secondary);text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cm-bal-line{font-size:13px;color:var(label-secondary)}.cm-bal-line.warn{color:var(state-warning-primary,#b45309)}:has(>.cm-footer-stack),:has(>[data-slot="sidebar.footer.action"]>.cm-footer-stack){flex-wrap:wrap}:has(>.cm-footer-stack.rail),:has(>[data-slot="sidebar.footer.action"]>.cm-footer-stack.rail){flex-direction:column;flex-wrap:nowrap;align-items:center;gap:6px}.cm-footer-stack{display:flex;flex:none;order:-1;flex-direction:column;gap:6px;width:100%;min-width:0;max-width:100%;align-items:stretch;box-sizing:border-box}.cm-footer-stack.rail{align-items:center;order:1}.cm-footer-stack .cm-bbox{width:100%;min-width:0}.cm-footer-stack .cm-foot{width:100%;box-sizing:border-box}.cm-footer-stack.compact .cm-bbox{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:12px;row-gap:2px;align-items:center}.cm-footer-stack.compact .cm-bbox>*{grid-column:1/-1}.cm-footer-stack.compact .cm-bbox>.cm-mm-row{grid-column:auto}.cm-footer-stack.compact .cm-mm-row{min-width:0;gap:4px;flex-wrap:nowrap}.cm-footer-stack.compact .cm-mm-row .cm-bbox-label{flex:0 1 auto;min-width:0;max-width:45%;width:auto}.cm-footer-stack.compact .cm-mm-row .cm-bbox-bar{min-width:0;flex:1 1 0}.cm-footer-stack.simple{gap:0;max-height:38vh;max-height:min(38dvh,320px);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;border:1px solid var(border-l1);border-radius:10px;background:var(bg-layer-1)}.cm-footer-stack.simple>*{flex-shrink:0}.cm-footer-stack.simple:focus-visible{outline:2px solid var(state-business-primary);outline-offset:2px}.cm-footer-stack.simple .cm-bbox{border:0;border-radius:0;padding:4px 8px;gap:2px;background:transparent;box-shadow:inset 0 -1px var(border-l1)}.cm-footer-stack.simple .cm-mm-title{font-size:11px;line-height:16px;margin:0}.cm-footer-stack.simple .cm-mm-row{gap:6px;min-height:16px;line-height:16px;margin:0;padding:0}.cm-footer-stack.simple .cm-mm-text{font-size:11px}.cm-footer-stack.simple>.cm-peak-strip,.cm-footer-stack.simple>.cm-peak-classic{margin:0;padding:4px 8px}.cm-simple-summary>span{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cm-footer-stack.simple .cm-bbox-pct{font-size:12px;line-height:18px}.cm-footer-stack.simple .cm-bbox-bar{height:4px}.cm-footer-stack.simple .cm-bbox-line{display:none}.cm-footer-stack.simple .cm-foot{height:26px;padding:0 8px}.cm-footer-stack.simple .cm-peak-classic{margin-top:2px;gap:2px}.cm-footer-stack.simple .cm-peak-classic-chip{padding:0 4px;border:0;background:transparent}.cm-simple-summary{position:sticky;top:0;z-index:1;background:var(bg-layer-1);display:flex;justify-content:space-between;align-items:center;gap:8px;padding:5px 8px;font-size:12px;font-weight:600;border-bottom:1px solid var(border-l1)}.cm-footer-stack.simple.rail{border:0;background:transparent}.cm-footer-stack.simple.rail .cm-bbox{padding:4px 2px}.cm-footer-stack.simple .cm-peak-rail-track,.cm-footer-stack.simple .cm-peak-rail-classic-track{height:28px}@media(max-width:640px){.cm-cards,.cm-grid,.cm-budget-controls{grid-template-columns:1fr}}'.replaceAll("","--dsw-alias-"),sa="dsh-cost-meter/client.css";if(typeof document<"u"&&document.head!==void 0){const t=document.querySelector("style[data-plugin-css="+JSON.stringify(sa)+"]");if(t?.textContent!==oa){const o=t??document.createElement("style");o.dataset.plugin="dsh-cost-meter",o.dataset.pluginCss=sa,o.textContent=oa,t===null&&document.head.appendChild(o)}}const en="sessionCostTitle|sessionDetailTokens|sessionDetailCache|cost|sessionLine|sessionLineCompact|sessionCostCompact|quotaUnlimited|pricingCnyHint|balanceQueryFailed|unknownError|balance|queryFailed|balanceTitle|reconcileLabel|totalBalance|grantedToppedUp|updatedAt|budgetOf|usedOf|todayShare|monthTotal|budget|todayCostTitle|todayTokensTitle|tokensUnit|callsTokens|monthCost|totalCost|today|sidebarTodayMetric|sidebarTodayCost|sidebarTodayTokens|periodDay|periodMonth|periodAll|periodCustomRange|noHistory|colDate|colCalls|colInTok|colCacheTok|colOutTok|colCost|noSessionsToday|colSession|enableBudget|budgetAmountLabel|budgetPeriodLabel|startDate|endDate|rangeText|budgetDisabledNote|budgetStatus|overLimit|nearLimit|legacyModel|defaultFallback|remove|tierBase|tierOffPeak|tierPeak|balanceApiKey|balanceKeyHint|balanceLine|balanceQueryFailedHint|balanceNotQueried|accountBalance|refreshing|refreshBalance|customBalanceTitle|customBalanceAdd|aliyunBalanceAdd|aliyunBalanceNote|customBalanceConfigNote|customBalanceLabelZh|customBalanceLabelEn|customBalanceUrl|customBalanceMethod|customBalanceHeaders|customBalanceBody|customBalanceBodyNote|customBalanceExtract|customBalanceDisplayLabel|customBalanceRefreshInterval|customBalanceUnitLabel|customBalanceConvert|customBalanceConvertNote|balanceBarRemaining|balanceBarToday|balanceBarSpent|balanceShowProgressBar|barDirectionsTitle|barDirectionsHint|barDirection_balance|barDirection_budget|barDirection_go|barDirection_plan|barDirectionRemaining|barDirectionUsed|balanceBudgetCapLabel|balanceBudgetCapHint|customBalanceInvalidJson|customBalanceHeadersVarNote|customBalanceAllowedHosts|customBalanceAllowedHostsHint|customBalanceCredentialsTitle|customBalanceCredentialsHint|customBalanceNoPlaceholders|enable|customBalanceLine|customBalanceRemaining|refreshCustomBalance|goQuotaTitle|goQuotaRowLabel|goWindowRolling|goWindowWeekly|goWindowMonthly|goResetAt|resetReached|resetDays|resetHours|resetMinutes|quotaUsed|quotaRemaining|goQuotaPercent|goQuotaFetchedAt|goQuotaDisplayLabel|goQuotaRefreshIntervalLabel|goQuotaRefreshMinutesUnit|goQuotaKeyLabel|goMainLabel|goDetailLabel|credentialConfiguredOf|credentialNotConfigured|credentialSave|credentialEdit|credentialClear|credentialSaving|credentialInputHint|secretMigrationPending|budgetDetailLabel|refreshGoQuota|goQuotaNotQueried|codingPlanAnthropic|codingPlanZai|codingPlanMinimax|codingPlanMinimaxTitle|minimaxOrigin|minimaxOriginNote|codingPlanRemain5h|codingPlanRemain7d|balanceRechargeLink|codexQuotaTitle|codexQuotaEnabled|codexQuotaSidebar|includeSubagentCost|gatewayQuotaEmpty|codingPlanDisplayLabel|codingPlanDisplayNote|codingPlanKeyLabel|codingPlanRefreshIntervalLabel|refreshCodingPlan|loginCodingPlan|loggingIn|codingPlanNotQueried|gatewayQuotaTitle|gatewaySourceAdd|gatewaySourceLabel|gatewaySourceBaseURL|gatewaySourceDisplay|gatewaySourceRefreshInterval|gatewaySourceAllowlist|gatewaySourceCredential|gatewaySourceStatus|gatewaySourceUnsupported|gatewaySourceUnknown|gatewaySourceNoAccounts|gatewaySourceFetchedAt|gatewaySwitchAccount|gatewayOnlyGemini|refresh|quotaEnableFirst|quotaRefreshReady|quotaRemove|quotaSectionNote|codingPlanDisabledNote|goQuotaDisabledNote|cornerLabel|cornerEnabledLabel|cornerGoRolling|cornerGoWeekly|cornerGoMonthly|cornerBudget|goShortRolling|goShortWeekly|goShortMonthly|goShortDaily|budgetShort|ledgerReadFailed|readingLedger|ledgerUnavailable|syncFailed|historyCleared|clearFailed|peakOff|peakNotEffective|peakActive|peakNotice|offPeakActive|weekendAllOffPeak|weekendChip|weekendShort|holidayAllOffPeak|holidayChip|holidayShort|peakHolidaysLabel|weekendRuleNote|peakShort|offPeakShort|peakStyleLabel|peakStyleCompact|peakStyleClassic|peakAlertLabel|peakAlertAheadLabel|peakAlertTargetLabel|peakAlertTargetPeak|peakAlertTargetOffPeak|peakAlertTargetBoth|peakAlertTitlePeak|peakAlertTitleOffPeak|peakAlertBody|peakAlertPhasePeak|peakAlertPhaseOffPeak|peakAlertBtn|peakAlertBadgePeak|peakAlertBadgeOffPeak|peakAlertPositionLabel|peakAlertPositionCorner|peakAlertPositionCenter|peakAlertWebNotifyLabel|peakAlertWebNotifyHint|peakAlertPreviewLabel|peakAlertPreviewPeak|peakAlertPreviewOffPeak|peakAlertPreviewTag|peakPanelTitle|peakNoticeHiddenHint|groupGeneral|groupMoney|groupSidebar|sidebarSimple|sidebarSimpleNote|sidebarSimpleTitle|sidebarSimpleBody|sidebarSimpleOn|sidebarSimpleOff|sidebarSimpleError|closeGuide|todayBudget|sidebarStyleLabel|sidebarStyleStandard|sidebarStyleCompact|restorePriceMatches|removePriceMatchHint|groupCorner|groupDetail|catalogTitle|catalogNote|catalogOpen|catalogCollapse|mountBtn|unmountBtn|mountedTag|catalogUnpriced|catalogDeepseekNote|modelStatsTitle|modelsTitle|modelsCount|modelsOther|models_enabled|models_defaultOpen|models_remember|models_tokens|models_shares|models_dock|models_period|models_summary|models_position|models_topN|models_refreshSeconds|modelsTotal|modelsTop|modelsFirst|modelsAfter|modelsLast|modelStatsToday|modelStatsHistory|modelStatsCostH|modelStatsTokensH|modelStatsHitH|modelStatsHitUnreported|modelStatsHitUnreportedTip|modelStatsValueH|modelStatsInput|modelStatsCache|modelStatsOutput|modelStatsEmpty|modelStatsBlended|modelStatsNote|modelStatsLegacy|sessionLineSplit|sessionLineSplitCompact|costChipPlan|sessionDetailPlan|planStatsTitle|planStatsEmpty|planStatsWindow|planStatsPercent|planStatsLocal|planStatsPer1|planStatsFull|planStatsResets|planStatsMethodSample|planStatsMethodLive|planStatsMethodNone|planStatsMethodSampleAt|planStatsConfidenceLow|planStatsCurveTitle|planStatsDaily|planStatsWeekly|planStatsMonthly|planStatsCurveEmpty|planStatsBarTip|planStatsNote|billingClassLabel|billingClassPlan|billingClassAuto|billingClassApi|catalogDisplayLabel|catalogDisplayHint|priceTableDisplayHint|catalogCustomModels|priceMatchLabel|priceMatchAuto|priceMatchExact|priceMatchNote|unmatchedTitle|unmatchedHint|overrideTargetDefault|overrideRemove|overrideTargetLocal|matchedTitle|matchedHint|matchedKeepAuto|overrideNone|mountedSuffix|flatInput|flatCached|flatOutput|deepseekMountedHeader|codingPlanKimi|codingPlanOpenrouter|codingPlanSiliconflow|codingPlanCommandcode|codingPlanScnet|codingPlanVolcengine|codingPlanQwen|codingPlanMimo|mimoWindowPlan|mimoWindowCompensation|codingPlanWindowBalance|qwenSource|qwenSourceLocal|qwenSourceCli|qwenSourceBailian|qwenCliNote|qwenBailianNote|qwenPlanCreditsLabel|qwenPlanStartLabel|qwenRatesLabel|qwenRatesModelPlaceholder|qwenRatePlaceholder|qwenRate_input|qwenRate_cachedInput|qwenRate_output|qwenRateDraftNote|qwenRatesAdd|qwenLocalNote|scnetPlanCreditsLabel|scnetPlanStartLabel|scnetLocalNote|volcengineAccessKeyIdLabel|volcengineSecretAccessKeyLabel|volcengineNote|volcengineAccessKeyPlaceholder|volcengineSecretPlaceholder|countdownHoursOnly|countdownHourMinute|countdownMinute|nextOffPeakIn|nextPeakIn|peakSummary|noPeakWindows|unknown|cardToday|cardMonth|cardTotal|cardTotalSub|externalUsage|combinedUsage|externalStale|externalHistory|cardsFootnote|timezoneHint|todaySessions|historyExpandHint|historySessionsLoading|historyNoSessions|historySessionsError|sessionRankTitle|sessionRankHint|sessionRankEmpty|sessionRankLoading|sessionRankError|sessionRankLimit|showSessionIdLabel|cardsTogglePlanTotal|cardsTogglePlanTotalHint|hideOfficialBalanceLabel|hideTodayCostLabel|hideSessionCostHeader|hideSessionCostDock|hideTurnCost|sessionRankSort|sessionSortCostDesc|sessionSortCostAsc|sessionSortTimeDesc|sessionSortTimeAsc|sessionSortRecent|history|statisticsUpgrade|usageTitle|usageTotal|usageDay|usageEmpty|usageSectionLabel|usagePositionLabel|usagePositionCost|usagePositionGeneral|usagePositionSection|displaySettings|tabOverview|tabQuotas|tabUsage|tabPricing|tabDisplay|historyDataTitle|positionLabel|positionDock|positionHeader|off|quotaStripGroup|quotaStripEnable|quotaStripShowBudget|quotaStripShowGo|quotaStripShowPlans|quotaStripNote|quotaStripGuideTitle|quotaStripGuideBody|quotaStripGuideOn|quotaStripGuideOff|clickToRefresh|balanceClickGuideTitle|balanceClickGuideBody|balanceClickGuideOk|sidebarLabel|sidebarOn|currencyLabel|currencyCny|currencyUsd|currencyEur|symbolLabel|rateLabel|decimalsLabel|balanceDisplayLabel|balanceSidebar|balanceSettings|balanceBoth|refreshIntervalLabel|peakEnabledLabel|peakNoticeLabel|badgeNote|priceTableTitle|pricingCurrencyLabel|pricingCurrencyUsd|pricingCurrencyCny|pricingCurrencyNote|priceTableNote|datedPriceNote|defaultModelId|newModelPlaceholder|addModel|dataSync|saving|autoSaveFailed|autoSavedAt|autoSaveHint|confirmFetch|apply|cancel|syncFromDocs|syncScopeNote|confirmReset|importLegacy|confirmImportLegacy|legacyImportFailed|legacyImportNote|confirmClear|clearAllHistory|lastSync|neverSynced|source|sourceOfficial|sourceBundled|languageLabel|localeAuto|localeZh|localeEn|sectionLabel|rpcFailed|rpcSyncFailed|rpcBalanceFailed".split("|"),tn="weekends and Chinese public holidays are off-peak|OpenCode Go|Coding Plan|Token Plan|显示位置|DeepSeek models use the default price|刷新间隔|Refresh interval|display position|中国公众假期全天谷价|峰时高价时段显著提示|above the input|session details|拓展价格表|输入框上方|以同一系统账号运行|图框详细信息|default price|official account balance|the DSH credential store|display currency|off-peak pricing|refresh interval|This session|cost is an upper bound|extended price catalog|今日费用|会话明细|时价计费|本地账本|自动保存|自动匹配|右下角显示|按显示币种|自定义余额|Monthly credits quota|命中价格的模型|导入安装前历史|按基础价格计费|Balance query failed|Go quota|Strip includes|Token usage|removed from sidebar|as the same OS user|pre-install history|Cost settings|DeepSeek peak-hour|This month|auth login|subscription quota|to refresh|主页面侧边栏|会话排行加载|余额查询失败|写入按命中价|官方账户余额|开启后侧边栏|清除全部历史|留空按自然月|留空自动发现|费用明细入口|Clear all history|Entering off-peak|Quota not queried|all off-peak|billed exactly at|local ledger|never echoed back|the official|会话费用|历史记录|取消挂载|同步价格|官方文档|峰谷时段|峰谷计价|手动指定|本地估算|法定假日|用量统计|直接显示|调用失败|额度数据|额度横条|Preview entering|Show Codex quota|historical rates|Volcano Ark|all history|call failed|coding plan|in Settings|prices from|Plan start date|base prices are|off-peak prices|on the DSH host|session ranking|后显示额度|开始对话后|未查询额度|汇总在这里|现在开启吗|订阅起始日|输入区下方|额度百分比|All time|Failed to load|No history yet|Security Token|built-in table|calendar month|enough samples|including peak|quota data|stay unchanged|the ledger|Alibaba Cloud|Allowed hosts|Entering peak|RAM AccessKey|official page|to expand its|billed at|AccessKey ID|Main sidebar|MiniMax Plan|NewApi quota|Session cost|These models|a credential|cost details|session logs|the composer|today's cost|不再显示|主机安装|优先使用|会话列表|会话日志|侧栏显示|关闭提示|凭据输入|剩余方向|勾选启用|即将进入|历史数据|启用预算|周末时段|在拓展表|官方价格|官方余额|已用方向|开放平台|当前处于|悬停可见|按调用时|文官方页|早期数据|显示设置|暂无会话|更新时间|模型花费|火山引擎|火山方舟|环境变量|生效时间|用默认价|简化显示|精确计费|累计费用|缓存命中|缓存字段|表外模型|订阅额度|费用设置|这些模型|逗号分隔|采样区间|预算已用|M tokens|Provider ID|box details|cache reads|for this|move to the|peak prices|price table|quota strip|records are|the sidebar|Claude Pro|Enable and|Enable the|No session|Plan equiv|early data|hours soon|in session|to restore|Enable it|Top model|and model|month use|without a|zero cost|Base URL|empty to|on hover".split("|"),Me=Object.fromEntries([["zh",'本dž(按每次调用实际时刻Ȫ)|输入 {input} · 缓存 {cache} · 输出 {output}|缓存:读 {read} · 写 {write}(Ʒ计费)|费用 {amount}|本会话 {amount} · 命中 {hitRate} · 输入 {input} · 缓存 {cache} · 输出 {output}|本会话 {amount}|ǩ只显示金额(Ȝ完整分项)|无限制|当前人民币金额来自美元价格 × 汇率 {rate}。对照官方人民币账单,请选择 CNY,再lj;同步会更新历史费用。|ƶ:{message}|未知错误|余额|查询失败|DeepSeek Ț账户余额|Ș变动与Ɲ交叉对账(偏差超阈时提示)|总余额 {amount}|赠送 {granted} · 充值 {toppedUp}|Ȣ {time}|预算({period})|已用 {used} / {amount}|今日 {amount} · 占预算 {pct}|本月 {month} · 累计 {total}|预算|ƚ(按ȗȪ)|今日 Token 用量|tokens|调用 {calls} 次 · 输入 {input} · 缓存 {cache} · 输出 {output}|本月 {amount}|累计 {amount}|今日|侧边栏今日显示|费用|Token 用量|今日|本月|累计|自定义区间|暂无LJ。Ǥ,费用将按天Ǧ。|日期|调用|输入 tok|缓存 tok|输出 tok|费用|今日ȡ记录。|会话|Ȕ|预算额度(ơ)|预算周期|开始日期|结束日期(留空 = 今日)|统计区间:{range}|Ȕǣ、已用金额及比例(ơ换算);可选今日、本月、累计或自定义周期。|{period}预算 {amount} · 已用 {used} · {pct}%|(已超出)|(接近上限)|旧模型|默认回退|移除|基础|谷时|峰时|余额专用 API Key|Ȋ此Ț Key;未配置时读取已登录官方账号余额,其次沿用模型凭据。|总余额 {total} · 赠送 {granted} · 充值 {toppedUp} · 更新于 {time}|ƶ:{message}|未查询余额|Ƹ|刷新中…|刷新余额|自定义 Provider 余额|添加配置|添加千问 / 阿里云余额|查询阿里云中国站可用金。ǹ 需 bss:DescribeBillingAccount 权限。前两项必填;STS 才需 Ǯ。密钥存凭据库。|extract 支持点路径、数值和 add/subtract/divide 运算;Ȁ 除以 500000 得到美元。|中文名称|英文名称|请求 URL|请求方法|请求头 (JSON)|请求体 (JSON)|留空不发送;JSON 原文保存并发送。默认 Content-Type 为 application/json,可在请求头覆盖。|解析规则 (JSON)|ƢƄ|Ɔ (分钟)|余额原币种|ơ折算(USD 余额)|使用显示汇率与精度;余额币种保持端点原币种。其他币种及积分不折算。|余额 {amount}|当日已用 {amount}|已用 {amount}|余额进度条 (蓝=余额,橙=当日,灰=已用)|进度条方向|各组进度条可独立选择填充方向:「Ȑ」满条起步、随消耗递减;「ș」空条起步、随消耗填满。|余额条(官方/自定义)|预算条|Go 额度条|Plan / Codex 额度条|Ȑ(满 → 空)|ș(空 → 满)|额度上限 (可选)|留空则Ȋ API 返回的 max_budget;仍无则显示整条浅蓝|JSON 格式无效|{{VAR_NAME}} 从凭据库或Ȧ读取。<ROUTE>_API_KEY 中 ROUTE 为大写 ȶ,符号改下划线,如 openai→OPENAI_API_KEY。同名共用密钥。|凭据白名单 (Ȳ)|请求头带密钥时仅放行列表内主机,留空则放行并警告,防导入他人配置外带密钥。|ȏ|为上方 {{VAR}} 占位符存入密钥(write-only,只写凭据库,不回显):|请求头还没有 {{VAR}} 占位符:填入如 "Authorization": "Bearer {{MY_API_KEY}}" 后这里会出现ȏ框。|启用|剩余 {remaining} · 已用 {spend} / 额度 {maxBudget} · 更新于 {time}|剩余 {amount}|刷新Ƣ|Ɓ ȯ|Go|滚动 5 小时|本周|本月|重置:{time}|已到重置时间|剩余 {d}天{h}小时|剩余 {h}小时{m}分|剩余 {m}分钟|已用 {pct}%|剩余 {pct}%|{percent}%|更新于 {time}|Go 额度Ƅ|Go 额度Ɔ(分钟)|分钟|Ɓ API Key(可选,Ƽ)|Go 额度主档位|Go Ɛ|已配置(来源:{source})|未配置|保存|编辑凭据|清除|保存中…|密钥只写入 DSH 凭据库,不保存在账本里,也不会回显。|以下密钥仍在Ɲ,未迁入凭据库。请导出对应Ȧ后重启:|预算Ɛ|刷新额度|ǥ|Anthropic(ɀ/Max)|Z.ai / 智谱 GLM Ƃ|MiniMax ƃ|ǿ|查询域名(HTTPS)|留空自动选择官方站点。填写后 Key 仅发往该域名;使用可信地址,不含路径。|5h|7d|打开 DeepSeek 充值页(platform.deepseek.com/usage)|ChatGPT (Codex) 周额度|显示 Codex 额度(需安装并登录 dsh-openai-codex)|在ȍ Codex 额度(关闭后仍保留会话额度条)|本dž包含子代理|暂无Ǔ|Ƅ|选「ƴ / 两者」ǣ卡片;窄栏显示百分比。|API Key(可选,Ƽ)|Ɔ(分钟)|刷新|登录|登录中…|ǥ|CLIProxyAPI 网关额度|添加来源|来源名称|ɏ|Ƅ|Ɔ(分钟)|允许的 Host|Management Key(只写)|状态|不支持的 Provider|未知|未发现账号|抓取于 {time}|切换账号 (当前: {account})|只显示 Gemini 额度|刷新|先ȑ这一项|启用并保存Ƅ后可刷新|删除|ȑ后会排到最上面;点名称可展开该项自己的配置。Ƣ最多 8 条,网关来源最多 4 条。|未启用。开启后将按Ɔ查询该厂商的 Ǜ 额度并显示在这里。|开启后读取 Ɓ 的滚动 5 小时、周、月额度,显示在侧栏、设置页及右下角;无订阅时提示原因。|Ơ(dock)|在Ơ Ɓ 额度 / 预算|滚动 5 小时额度|本周额度|本月额度|ȴ%|5h|周|月|日|预算|账本读取失败:{message}|正在读取账本…|账本不可用|同步失败:{message}|LJ已清除。|清除失败:{message}|nj已关闭,Ʀ|尚未生效(ȧ:{time}),当前Ʀ|ț峰时段,按峰Ɯ|当前为 DeepSeek 峰时高价时段,按峰Ɯ|ț谷时段,按谷Ɯ|ȕ——全谷价(周六及周日全天按谷Ɯ)|ȕ——全谷价|周末全谷|Ǐ——全天谷价|Ǐ——全谷价|假日|Ǐ(北京日期,Ȳ)|自 2026-08-23 北京时间 00:00 起,周末和Ɖ;调休上班的周末仍按谷价。|峰时|平价|Nj条样式|简洁(单行紧凑)|经典(分段与胶囊芯片)|峰/谷切换前弹窗提醒|提前提醒(分钟,1-30)|提醒类型|进入峰时|进入谷时|峰和谷|Ȓ峰时|Ȓ谷时|约 {time} 后计费档位切换为{phase}价,请注意本时段调用成本。|峰时|谷时|知道了|峰价提醒|谷价提醒|弹窗位置|右下角|屏幕中心|同步发送系统通知|开关后请在浏览器地址栏允许通知权限,才能在页面最小化/切走时收到提醒。|预览弹窗|预览 进入峰|预览 进入谷|(预览)|nj与提示|提示已隐藏:需启用nj并开启「Ɗ」。|常规|金额与币种|侧边栏显示|简化ȍ|精简卡片,保留金额、额度和悬停详情;高度最多占屏幕 38%,超出可滚动。关闭后恢复。|试试更轻巧的侧栏|ȩ可以为ȋ留出更多空间。要ǧ?之后可在「设置 → 费用 → 显示」中切换。|开启ȩ|保留当前显示|设置未能保存。可重试,或Ȏ后在设置中调整。|Ȏ|今日 / {period}预算|侧边栏进度条样式|标准|紧凑(两列)|恢复已移除的模型 ({count})|移除会清除手动映射并隐藏此行,可恢复;不会删除用量记录,后续按Ɵ规则计价。|右下角角标|Ɛ|ƍ|按厂商和模型分类的参考价。挂载后可编辑并计费;DeepSeek Lj后Ȩ。|展开ƍ|收起ƍ|挂载|Lj|已挂载|未核价|DeepSeek Lj后按默认价计费。|按模型统计(token 与费用)|侧栏ȣ|{n} 模型|其它|显示ȣ卡片|默认展开|记住展开状态|显示 Token|显示费用占比条|Ơ Top-1 模型|默认周期|收起摘要|卡片位置|模型行数(1–10)|Ɔ(10–60 秒)|周期总额与模型数|Top-1 模型与金额|顶部|余额之后|底部|今日|近 90 天|费用排行|Token 消耗|Ȭ率|未上报?|长调用无Ȭ:代理可能移除ȭ。金额按全未命中计,是上界;可直连核对。|性价比 · 每美元 token 数|输入|缓存|输出|该时段暂无用量数据。|综合单价 {price}/M|命中率=缓存读÷(缓存读+普通输入);「未上报?」表示ȭ可能缺失,金额为上界。单价=费用÷token×1M;性价比=token÷费用。|未分模型(ȟ · 按当时记录计费)|本会话 {amount}(API)· Plan 等值 {planAmount} · 命中 {hitRate} · 输入 {input} · 缓存 {cache} · 输出 {output}|本会话 {amount}(API)· Plan 等值 {planAmount}|费用 {amount}(+Plan)|Plan ȯ消耗(等值){amount}|ƃ ǐ(每 1% 与满窗估算)|尚无 Ƃ Ǔ;请在「额度」页开启并刷新厂商。|窗口|已用 %|本周期实际(Ɲ)|每 1% 额度 ≈|满窗 100% ≈|重置 {time}|采样差分|当前用量折算|样本不足|{method}(基准 {time})|读数精度受限|Plan 用量曲线(按ȳ聚合)|每日|每周|每月|采样不足:至少两次成功刷新,且Ǫ发生变化。|{date}:满窗估计 ≈ {full}(每 1% ≈ {per1})· 实际 {tokens} / {cost} · {intervals} 个ȳ|金额是目录价等值;订阅耗额度,预算只计 API。估算仅含 dsh 调用;服务端百分比含全账号。短时样本精度有限;5h 滚动,周/月按本地日历。|计费方式|Plan 订阅|自动|API 按量|在ȰǑ|仅控制是否在费用价格表Ǒ;不影响挂载和计费。隐藏的已挂载模型仍可Ȗ编辑。|可逐模型切换Ƅ。DeepSeek 默认Ǒ,第三方默认Ȗ。|手动新增模型|未知模型名Ɵ|自动(去后缀 / 前缀 / 家族相似)|仅精确匹配|Ǎ优先;Ɵ只接受同名及日期、版本、上下文后缀。未命中的 DeepSeek Ȩ,其他渠道不计价。|最近出现但未Ƥ|ȱ没有价格。可Ǎ;「默认价」使用 DeepSeek 默认价。本地推理默认零费用。|DeepSeek 默认价|移除|本地模型(零消耗)|本月已Ƥ|ȱƟ价格。可改选价格或零费用;token 仍统计。保存后移入Ǎ区。|保持自动命中|暂无手动匹配覆盖。|已挂载(参与计费)|输入|缓存|输出|DeepSeek 价格表(已挂载)|Kimi / Moonshot|OpenRouter|SiliconFlow 硅基流动|CommandCode|SCNet 超算互联网 ƃ|ȥ ǘ Ƃ|千问 Qwen ƃ|小米 MiMo ƃ|套餐积分|补偿积分|余额|额度来源|ǎ|官方 CLI|百炼 CLI|CLI 模式需在 DSH ȉ @qianwenai/qianwen-cli,并Ə qianwen Ʊ。|百炼 CLI:在 DSH ȉ bailian-cli。登录按钮会在该主机打开授权浏览器;远程或无界面主机请Ə bl Ʊ --console。|月度 Credits 额度(个人版 Lite 5 万 / 标准版 50 万,以订阅页为准)|Ǩ(可选,格式 YYYY-MM-DD;ƻ)|Credits 抵扣率覆盖(可选;每百万 token 抵扣的 Credits,留空用内置表)|模型名,如 qwen3.8-max-preview|费率|输入|缓存读|输出|待填齐三项正数后ƞ;全部清空恢复内置表。|添加|Credits ǎ,以控制台为准。只计 qwen 及 qwen/qianwen-tokenplan 订阅渠道,含 llm- 前缀;不计按量 API。Ȯ需设抵扣率。|ǎ月度 Credits 额度(基础 60,000 / 标准 240,000 / 高级 600,000)|Ǩ(可选,格式 YYYY-MM-DD;ƻ)|优先用 24 小时内的控制台快照,否则按Ɲ和官方 Credits 表估算。其他工具和Ȯ不计入。|Ȥ ǽ|Ȥ SecretAccessKey|ȥ需 AK/SK、ArkReadOnlyAccess 和 BillingCenterReadOnlyAccess;可填凭据或导出 VOLC_ACCESSKEY/VOLC_SECRETKEY。只连接 open.volcengineapi.com。|AK...|SK...|{h}小时|{h}小时{m}分|{m}分钟|{time}后进入平价|{time}后进入高峰|峰时段(UTC):{windows};ȧ:{time}。{status}|未配置Nj。{status}|未知|ƚ|本月费用|ȫ|自账本建立以来 · 调用 {calls} 次|外部用量|DSH + 外部合计|外部快照超过 24 小时未更新|近期每日记录|金额取最近快照,可能比官方账单晚几分钟。tokens 含输入、输出、缓存和推理;推理并入输出计费。以金额对账。|今日/本月按宿主时区 {host},浏览器为 {browser}。时区不同会影响日界和对账;可将 dsh 改为本地时区。|今日会话|点击日期行可展开当日ƛ|ƛ加载中…|该日无ƛ(ȟ或Ȍ已清理)|ƛ加载失败|按会话统计(全部历史)|跨天合并,子代理按开关归并。仅列选定条数,ȫ包含全部对话。|ȡ数据|Ƶ中…|Ƶ失败|显示条数|ȋ附显会话 ID|金额含 Plan 总额|开启后所有金额按含 Plan 订阅等值的总费用展示;关闭(默认)仅计真金白银 API 渠道|隐藏Ƹ(ƹ与设置页ȈȘ)|隐藏今日消耗金额(ƹ/预算明细/概览卡片Ȉƚ)|隐藏标题栏ƽ|隐藏输入框下方ƽ|隐藏每轮回复后的本轮费用|排序|费用 高→低|费用 低→高|时间 新→旧|时间 旧→新|实时顺序|LJ|计费统计需要 DSH 0.2.0-rc.2 或更新版本的模块加载器。|Token ǐ|累计 {tokens} tokens · 输入 {input} · 缓存 {cache} · 输出 {output} · {calls} 次调用|{date}:共 {tokens} tokens(输入 {input} · 缓存 {cache} · 输出 {output})· {calls} 次调用 · {cost}|暂无ȓ,Ǥ每日用量会Ǧ|用量|Token ǐ位置|Ȱ|通用设置|独立分节(用量)|Ƞ|概览|额度|用量|价格|显示|ȓ|džƄ|ǩ|会话标题栏|关闭|Ǝǔ|启用ǔ(Ǝ一条横排显示)|横条含ȴ%|横条含 Go 额度|横条含 Ƃ 额度|横条Ȝ各窗口重置时刻与Ȣ;无可用Ǔ时自动隐藏。|新增:Ǝǔ|在Ǝ显示预算及 Ɓ/Ƃ Ǫ。ǧ?可在「设置 → Ƞ」修改。|开启横条|暂不开启|点击立即刷新|新增:余额图框点击刷新|点击侧边栏余额或 Ƃ 图框即可刷新;刷新时图框闪烁,失败时保留原值并在悬停提示中说明原因。|知道了|当日费用显示|侧边栏底部|货币单位|人民币 CNY|美元 USD|欧元 EUR|货币符号|汇率(1 美元 = ? 目标币种)|小数位数|余额Ƅ|ƴ|设置页|两者都显示|余额Ɔ(分钟)|启用 DeepSeek Nj价格|Ɗ(侧边栏预算框/ƚ;设置页峰谷面板内预览)|会话ȝ价格计费(含峰谷与历史档位)。输入、输出、缓存读写分开统计;独立缓存写入价与长上下文档位按配置生效。|价格表(美元 / 1ȵ)|ȗ币种|美元(英Ȟ)|人民币(中Ȟ)|决定lj所用的官方页语言。切换并同步后后台重算历史;日志不全的会话保留原价。完成后提示。|ȝ间计价:Flash 自 9 月 10 日北京 12:00 用新价,V4 Pro 自 9 月 14 日同刻用 Flash 价;此前用历史价。工作日 09–12、14–18 峰价翻倍;周末及Ɖ。缓存Ʒ。|这里显示当前适用价格。手工编辑会取消此条后续预定调价,已发生的历史价格仍保留。|default(未匹配模型时回退)|新模型 ID(如 deepseek-v4-pro)|添加模型|数据与同步|保存中…|ƞ失败:{message}|已ƞ {time}|配置修改后ƞ|确认用NJ价格覆盖价格表?|应用|取消|从NJlj|官方同步只更新 DeepSeek 价格(含峰谷);z-ai/Kimi/Qwen/Volcano 等第三方价格随版本更新,也可在ƍ或模型名匹配中调整。|确认ƺ?|ƥ|确认导入?将回放全部Ȍ,只补账本缺失的日期与会话,不影响已有记录。|ƥ失败:{message}|首次启动自动导入旧记录;拷入日志后可重跑。按当前价格回推;已删除日志无法回放,跨安装时刻的会话不计此前用量。|确认清除|ƺ|最近同步:{time}|从未(使用内置价格)|;来源:{source}|NJ|内置默认|界面语言|跟随 DSH(自动)|简体中文|English|费用|{method} ǒ|同步ǒ|余额刷新ǒ'],["en",`Cost of this session (ǂ each call time)|Input {input} · Cache {cache} · Output {output}|Cache: read {read} · write {write} (writes Ǽ the hit price)|Cost {amount}|Ɨ {amount} · Hit {hitRate} · Input {input} · Cache {cache} · Output {output}|Ɨ {amount}|Amount only below Ȇ (full split ɑ)|Unlimited|CNY totals use USD prices × {rate}. To compare official CNY bills, select CNY, then sync prices; syncing also updates historical costs.|Ƨ: {message}|Unknown error|Balance|Query failed|DeepSeek open-platform account balance|Cross-check official balance changes against the ǃ (warn when they diverge)|Total {amount}|Granted {granted} · Topped-up {toppedUp}|Updated {time}|Budget ({period})|Used {used} / {amount}|Today {amount} · {pct} of budget|ư {month} · ǫ {total}|Budget|Today's cost (ǂ official prices)|Today's token usage|tokens|Calls {calls} · Input {input} · Cache {cache} · Output {output}|ư {amount}|ǫ {amount}|Today|Sidebar today display|Cost|ƪ|Today|ư|ǫ|Custom range|ǭ. Once you start chatting, costs are aggregated here per day.|Date|Calls|In tok|Cache tok|Out tok|Cost|Ƀs recorded today.|Session|Enable budget|Budget amount (in Ɣ)|Budget period|Start date|End date (empty = today)|Range: {range}|Enable a budget to see its limit, used amount and percentage in the Ɣ. Choose today, month, all time or a custom range.|{period} budget {amount} · Used {used} · {pct}%| (over limit)| (near limit)|Legacy|Default fallback|Remove|Base|Off-peak|Peak|Balance API key|This Open Platform key takes priority; otherwise the signed-in ƒ is read, then model credentials.|Total {total} · Granted {granted} · Topped-up {toppedUp} · Updated {time}|Ƨ: {message}|Balance not queried|Account balance|Refreshing…|Refresh balance|Custom provider balance|Add entry|Add Qianwen / Ƕ balance|Shows Ƕ China funds. ǹ needs bss:DescribeBillingAccount. The first two fields are required; Ǯ is for STS. Secrets stay in the credential store.|Extract accepts paths, numbers and add/subtract/divide. Divide Ȁ by 500000 for USD.|Chinese name|English name|Request URL|HTTP method|Headers (JSON)|Request body (JSON)|Blank sends no body; JSON text is saved and sent as entered. Content-Type defaults to application/json; headers can override it.|Extract rules (JSON)|Custom balance display|Ƈ (minutes)|Source currency|Convert USD balance to Ɣ|Uses the display rate and precision. Keep the source currency; other currencies and credits Ǵ.|Balance {amount}|Today {amount}|Spent {amount}|Balance progress bar (blue=balance, orange=today, gray=spent)|Progress bar direction|Each group of bars can independently choose its fill direction: "Remaining" starts full and drains with usage; "Used" starts empty and fills up.|Balance bars (official/custom)|Budget bar|ƨ bar|Plan / Codex quota bars|Remaining (full → empty)|Used (empty → full)|Budget cap (optional)|Leave ɐ use API max_budget; if still missing, show full light-blue bar|Invalid JSON|{{VAR_NAME}} reads ȃ or environment variable. <ROUTE>_API_KEY uses an uppercase ȶ with underscores, such as openai→OPENAI_API_KEY. Names can share a key.|Ƿ (comma-separated)|When headers carry credentials only listed hosts are allowed; leave ɐ allow with a warning. Protects keys when importing someone else's config.|Credential input|Store the key for each {{VAR}} placeholder above (write-only: stored in Ɠ, DŽ):|No {{VAR}} placeholders in the headers yet — add e.g. "Authorization": "Bearer {{MY_API_KEY}}" and ȃ input will appear here.|Enable|Remaining {remaining} · Spent {spend} / Budget {maxBudget} · Updated {time}|Remaining {amount}|Refresh custom balance|Ɓ Ʋ|Go|Rolling 5h|Weekly|Monthly|Resets: {time}|Reset time reached|{d}d {h}h left|{h}h {m}m left|{m}m left|{pct}% used|{pct}% remaining|{percent}%|Updated {time}|ƨ ƈ|ƨ Ɩ (minutes)|min|Ɓ API key (optional; empty = auto-detect)|ƨ primary window|Go ȷ|Configured (source: {source})|Not configured|Save|Edit credential|Clear|Saving…|The key is written to Ɠ only — it is never saved in ǵ and DŽ.|These credentials remain in the ǃ. Export the matching environment variables and restart:|Budget ȷ|Refresh quota|ǀ|Anthropic (ɀ/Max)|Z.ai / Zhipu GLM Ƃ|MiniMax ƃ|ǿ|Quota origin (HTTPS)|Empty: official sites. Otherwise the Key is sent only to this origin. Use a trusted address ɍ path.|5h|7d|Open DeepSeek top-up page (platform.deepseek.com/usage)|ChatGPT (Codex) weekly quota|ǖ (requires signed-in dsh-openai-codex)|ǖ in sidebar (keep the conversation strip when hidden)|Include subagents ɇ cost|No dz|Display position|“Ǿ / Both” shows a quota card; the narrow rail shows percentages.|API key (optional; empty = auto-detect)|Ƈ (minutes)|Refresh|Login|Signing in…|ǀ|CLIProxyAPI gateway quotas|Add source|Source label|ɏ|Display|Ƈ (minutes)|Ƿ|Management key (write-only)|Status|Unsupported providers|Unknown|No accounts|fetched {time}|Switch account (current: {account})|Gemini quota only|Refresh|Enable this item first|Ɂ save a ƈ Ƴ|Remove|Enabled items Ⱥ top; click a name ǻ own settings. Up to 8 custom balances and 4 gateway sources.|Disabled. ɉ to query this vendor's Ǜ quota on the Ɩ and show it here.|Enable Ɓ rolling 5h, weekly and monthly quotas in ȿ, Settings and bottom-right corner. Missing subscriptions show a reason.|Bottom-right (dock) display|Show Ɓ quota / budget at the bottom-right|Rolling-5h quota|Weekly quota|Monthly quota|Budget used %|5h|Wk|Mo|Daily|Budget|Ledger read failed: {message}|Reading ledger…|Ledger unavailable|Sync failed: {message}|History cleared.|Clear failed: {message}|Peak/ƕ is off; ǟ used|Not yet effective (effective at {time}); ǟ currently used|Peak hour now; Ȼ apply|Ư pricing is active; current calls are Ǽ Ȼ|Off-peak now; Ǡ apply|Weekend — ǁ (Sat & Sun Ǽ Ǡ all day)|Weekend — ǁ|Weekend|Chinese public holiday — off-peak all day|Public holiday — ǁ|Holiday|Public holidays (Beijing dates, comma separated)|Since Aug 23, 2026 (Beijing time), ƀ all day, including work-shift weekends.|Peak|Off-peak|Peak period strip style|Compact (one-line)|Classic (segments & chip)|Popup alert before peak/off-peak switch|Lead time (minutes, 1-30)|Alert type|Ǹ|ƿ|Both|Ǹ Ɇ|ƿ Ɇ|Billing switches to {phase} pricing in about {time}; mind your call costs in this window.|peak|off-peak|Got it|Peak alert|Off-peak alert|Popup position|Bottom-right|Screen center|Also send a system notification|When enabled, allow notification permission in the browser address bar so you get alerted even when the page is minimized or backgrounded.|Preview the popup|Ǖ peak|Ǖ off-peak| (preview)|Peak/ƕ & notice|Notice hidden: enable peak/ƕ and the “prominent notice” toggle.|General|Money & currency|Sidebar display|Simplify ȿ|Condense cards but keep amounts, quotas and hover details. Height is capped at 38% of the viewport with scrolling. Turn off Ɉ.|A lighter sidebar|Simple display leaves more room for conversations. ɉ now? You can change it ǜ → Cost → Display anytime.|Enable simple display|Keep current display|Settings could not be saved. Retry or dismiss this guide and change them later ǜ.|Dismiss guide|Today / {period} budget|Sidebar progress style|Standard|Compact (2 columns)|Restore removed models ({count})|Remove clears the override and hides the row until restored. Usage Ⱦ kept; automatic price matching applies.|Corner chips|Box details|Extended price catalog|Reference prices by vendor ɋ. Mount to edit and bill; unmounted DeepSeek uses its Ƒ.|Expand ƙ|Collapse ƙ|Mount|Unmount|Mounted|Unpriced|Unmounted ƅ.|Per-model statistics (tokens & cost)|Sidebar model costs|{n} models|Other|Show model cost card|Expand by default|Remember expansion|Show tokens|Show cost shares|Ɋ in corner dock|Default period|Collapsed summary|Card position|Model rows (1–10)|Ƈ (10–60 seconds)|Period total ɋ count|Ɋ and cost|Top|After balances|Bottom|Today|Last 90 days|Cost ranking|ƪ|Cache hit rate|unreported?|Zero cache hits on long calls may mean a relay removed cache fields. All-miss Ƙ; check with the direct API.|Value · tokens per USD|Input|Cache|Output|No usage data ȹ period.|blended {price}/M|Hit rate = ȸ ÷ (reads + uncached input). “Unreported?” means cache data may be missing, so Ƙ. Unit price = cost ÷ tokens × 1M; value = tokens ÷ cost.|Unattributed (Ʌ · billed as recorded)|Ɨ {amount} (API) · Ʉ. {planAmount} · Hit {hitRate} · Input {input} · Cache {cache} · Output {output}|Ɨ {amount} (API) · Ʉ. {planAmount}|Cost {amount} (+Plan)|Plan Ʋ usage (equiv.) {amount}|ƃ usage stats (per-1% & full-window estimates)|No Ƃ dz yet. Ɂ refresh a provider under Quotas.|Window|Used %|This period actual (ǃ)|Per 1% quota ≈|Full window (100%) ≈|resets {time}|sample delta|current usage ratio|not DZ|{method} (as of {time})|low reading precision|Plan usage curves (aggregated from sample intervals)|Daily|Weekly|Monthly|Not DZ: refresh successfully twice with a quota percentage change.|{date}: full-window est. ≈ {full} (per 1% ≈ {per1}) · actual {tokens} / {cost} · {intervals} sample interval(s)|Amounts are catalog-price equivalents. Plans use quota; budgets count API only. Estimates cover dsh calls, while server percentages cover the account. Short samples are less precise. 5h rolls; week/Ɍ local dates.|Billing class|Plan subscription|Auto|API usage|Show directly in Ʈ|Controls direct display in Ʈ; mounting and billing Ǵ. Hidden models remain editable in this catalog.|Choose where each model appears. DeepSeek shows directly; other vendors default to the catalog.|Custom models|Auto-match unknown model names|Auto (strip suffix / prefix / family similarity)|Exact match only|Manual overrides take priority. Auto-match accepts only the same name or date, version and context suffixes. Unknown ƅ; other providers stay unpriced.|Recently seen models ɍ price hit|Ȃ have no price. Assign one manually; “Default price” uses DeepSeek defaults. Local inference costs zero until assigned.|DeepSeek Ƒ|Remove|Local model (Ɏ)|Models matched this month|Ȃ matched automatically. Choose another price or Ɏ; tokens still count. Saved overrides Ⱥ manual list.|Keep auto match|No manual match overrides.|Mounted (billed)|Input|Cached|Output|DeepSeek ȼ (mounted)|Kimi / Moonshot|OpenRouter|SiliconFlow|CommandCode|SCNet ƃ|ǘ Ƃ|Qwen ƃ (qianwenai.com)|Xiaomi MiMo ƃ|Plan credits|Compensation|Balance|Quota source|Local estimate|Official CLI|Bailian CLI|Install @qianwenai/qianwen-cli ǡ and run qianwen Ʊ Ƭ.|Install bailian-cli ǡ. Login opens that host’s browser; for a remote or headless host, run bl Ʊ --console Ƭ.|ƣ (personal Lite 50K / Standard 500K; see your plan page)|Ǟ (optional, YYYY-MM-DD; empty = ǰ)|Credits rate overrides (optional; credits deducted per 1ȵ; empty = ǯ)|Model name, e.g. qwen3.8-max-preview|rate|Input|Cached input|Output|Enter all three positive rates to save automatically; clear all Ɉ the ǯ.|Add|Local Credits estimate; console is authoritative. Counts qwen and qwen/qianwen-tokenplan subscription routes, including llm- prefix. Excludes pay-as-you-go API. Add rates for other models.|ƣ for local estimates (Basic 60,000 / Standard 240,000 / Pro 600,000)|Ǟ (optional, YYYY-MM-DD; empty = ǰ)|Uses console snapshots newer than 24h, then estimates from local records and official Credits rates. Other tools and unlisted models are excluded.|Volcengine ǽ|Volcengine SecretAccessKey|ǘ needs AK/SK, ArkReadOnlyAccess and BillingCenterReadOnlyAccess. Enter credentials or export VOLC_ACCESSKEY/VOLC_SECRETKEY. Only open.volcengineapi.com is contacted.|AK...|SK...|{h}h|{h}h {m}m|{m}m|Off-peak in {time}|Peak in {time}|Peak hours (UTC): {windows}; effective: {time}. {status}|No peak windows configured. {status}|unknown|Today|ư|ǫ|Since ǵ was created · Calls {calls}|External usage|DSH + external total|External snapshot has not been updated for 24 hours|Recent daily records|Amounts use the latest snapshot and may lag Dž bill by minutes. Tokens include input, output, cache and reasoning; reasoning is billed with output. Reconcile by amount.|Today/Ɍ host timezone {host}; this browser uses {browser}. Different day boundaries affect reconciliation. Set dsh to your local timezone to align.|Today's sessions|Click a date row ǻ ƌ|Loading ƌ…|No ƌ ȹ day (Ʌ or ȅ cleaned)|Ǭ ƌ|By session (Ǚ)|Days combined; subagents follow settings. Selected rows shown; cumulative costs include every conversation.|Ƀ data yet|Loading Ǣ…|Ǭ Ǣ|Rows|Show session IDs ɇ lists|Include plan totals|When on, every amount shows total equivalent cost including plan subscriptions; off (default) counts real-money API channels only|Hide ƒ (balance UI ƫ and settings)|Hide ȇ (today's amount ƫ, budget details and overview card)|Hide header Ȅ|Hide composer Ȅ|Hide turn cost summaries|Sort|Cost high→low|Cost low→high|Time new→old|Time old→new|Recent order|History|Cost statistics requires the module loader from DSH 0.2.0-rc.2 or newer.|ƪ stats|All-time {tokens} tokens · input {input} · cache {cache} · output {output} · {calls} calls|{date}: {tokens} tokens (input {input} · cache {cache} · output {output}) · {calls} calls · {cost}|ǭ — daily usage will accumulate here|Usage|ƪ stats position|Ʈ|General settings|Own section (Usage)|Display settings|Overview|Quotas|Usage|Pricing|Display|History data|ȁ ƈ|Below Ȇ|Session title bar|Off|Quota strip Ƌ|ɂ Ƚ (one row Ƌ box)|Ʃ budget used %|Ʃ the ƨ|Ʃ Ǜ quotas|Hover a chip for reset times and the last refresh; the strip hides itself when there is no dz.|New: Ƚ Ƌ|Show budget and Ɓ/coding-plan percentages Ƌ box. Enable now? Change it anytime ǜ → Display.|ɂ strip|Not now|Click Ƴ now|New: click the balance box Ƴ|Click a sidebar balance or plan box Ƴ. It pulses while loading; on failure it keeps the old value and shows the reason ɑ.|Got it|Today cost display|Sidebar footer|Currency|Chinese Yuan (CNY)|US Dollar (USD)|Euro (EUR)|Currency symbol|Exchange rate (1 USD = ? target currency)|Decimal places|Balance ƈ|Ǿ|Settings page|Both|Balance Ɩ (minutes)|Use Ư prices|Prominent notice during peak hours (sidebar budget box, ȇ; previewed in the Settings peak panel)|ȁ uses call-time prices, Dz and Ǘ. Input, output, ȸ and writes are separate; configured cache-write and long-context rates apply.|Price table (USD / 1ȵ)|Official price currency|USD (English Ǻ)|CNY (Chinese Ǻ)|Selects Dž pricing-page language. Sync then recalculates history in the background; sessions without full logs keep their earlier basis.|Call-time prices: Flash changes Sep 10 04:00 UTC; V4 Pro uses Flash ǝ Sep 14 04:00 UTC. Earlier calls retain history. Mon–Fri peaks 01–04 and 06–10 UTC cost 2×; ƀ. Cache writes use hit rates.|Current rates are shown here. Editing cancels any future scheduled change ȹ entry; earlier Ǘ are retained.|default (fallback for unmatched models)|New model ID (e.g. deepseek-v4-pro)|Add model|Data & sync|Saving…|Auto-save failed: {message}|Auto-saved {time}|Settings are auto-saved|Overwrite the ȼ with ǝ Dž docs?|Apply|Cancel|Sync ǝ official docs|Official sync updates DeepSeek prices (Dz rates). Third-party prices (z-ai/Kimi/Qwen/Volcano) follow releases; edit in the extended catalog or model matching.|ƾ?|Import ƭ|Confirm import? Replays all ȅ and only fills dates/sessions missing from ǵ; existing Ⱦ untouched.|Failed to import ƭ: {message}|Pre-instǙ imports at first launch; rerun after copying old logs. Costs use current prices. Deleted logs cannot replay; sessions spanning installation exclude earlier usage.|Confirm clear|ƾ|Last sync: {time}|Never (bundled prices)|; Source: {source}|Official docs|Bundled|Language|Follow DSH (auto)|Simplified Chinese|English|Cost|{method} ǚ|Sync ǚ|Balance refresh ǚ`]].map(([t,o])=>{const s=o.replace(/[ƀ-ɿ]/g,a=>tn[a.charCodeAt(0)-384]).split("|");return[t,Object.fromEntries(en.map((a,n)=>[a,s[n]]).filter(([,a])=>a!=="\0"))]}));function la(){return(typeof navigator<"u"&&typeof navigator.language=="string"?navigator.language:"").toLowerCase().startsWith("zh")?"zh":"en"}function Ie(t){const o=typeof t=="string"?t.toLowerCase().split(/[-_]/)[0]:"";return o==="zh"||o==="en"?o:null}function F(t){const o=typeof t=="string"?t:t?.locale;return o==="zh"||o==="en"?o:Ie(t?.activeLocale)||la()}function z(t){const o=t==="zh"?Me.zh:Me.en;return(s,a)=>{let n=o[s]??Me.en[s]??s;if(a)for(const l of Object.keys(a))n=n.split("{"+l+"}").join(String(a[l]));return n}}const je={day:"periodDay",month:"periodMonth",all:"periodAll",custom:"periodCustomRange"};function ie(t,o){throw new Error("dsh-cost-meter: 服务端数据非法 ("+t+": "+o+")")}function pe(t,o){return(t===null||typeof t!="object"||Array.isArray(t))&&ie(o,"object"),t}function ae(t,o){return(typeof t!="number"||!Number.isFinite(t))&&ie(o,"number"),t}function se(t,o){return typeof t!="string"&&ie(o,"string"),t}const ot=(t,o,s)=>typeof t=="string"&&o.includes(t)?t:s;function ra(t,o=!1){return t===null||typeof t!="object"||Array.isArray(t)?{}:Object.fromEntries(Object.entries(t).filter(([s,a])=>o?s.length>0&&["plan","api"].includes(a):["auto","plan","api"].includes(a)))}function Ne(t,o){return typeof t!="boolean"&&ie(o,"boolean"),t}const qe=(t,o,s)=>Object.fromEntries(o.map(a=>[a,s(t[a])]));function ia(t,o){const s={};if(t!==null&&typeof t=="object"&&!Array.isArray(t))for(const a of Object.keys(t)){const n=t[a];if(n===null||typeof n!="object"||Array.isArray(n))continue;const l=r=>typeof r=="number"&&Number.isFinite(r)&&r>=0?r:0;s[a]={...qe(n,["input","output","cacheRead","cacheWrite","reasoning","cost"],l),apiCost:n.apiCost===void 0?l(n.cost):l(n.apiCost)}}return s}function ca(t,o){pe(t,o);const s={reasoning:t.reasoning===void 0?0:ae(t.reasoning,o+".reasoning"),apiCost:t.apiCost===void 0?void 0:ae(t.apiCost,o+".apiCost"),byModel:ia(t.byModel,o+".byModel"),byProviderModel:ia(t.byProviderModel,o+".byProviderModel")};for(const a of["input","output","cacheRead","cacheWrite","calls","cost"])s[a]=ae(t[a],o+"."+a);return s}function ua(t){return(Array.isArray(t)?t:ie("rows","array")).map(o=>({provider:se(o.provider,"provider"),model:se(o.model,"model"),bucket:se(o.bucket,"bucket"),tokens:ae(o.tokens,"tokens"),rate:ae(o.rate,"rate"),cost:ae(o.cost,"cost"),priced:Ne(o.priced,"priced"),plan:Ne(o.plan,"plan")}))}function wt(t,o){return{...ca(t,o),id:se(t.id,o+".id"),provider:typeof t.provider=="string"?t.provider:"",model:typeof t.model=="string"?t.model:""}}function fe(t,o){const s={...ca(t,o),date:se(t.date,o+".date"),sessions:[]};return t.sessions!==void 0&&(Array.isArray(t.sessions)||ie(o+".sessions","array"),s.sessions=t.sessions.map((a,n)=>wt(a,o+".sessions["+n+"]"))),s}function xt(t,o,s=["cacheWrite","reasoning"]){const a={};for(const n of["cacheHit","cacheMiss","output"])a[n]=ae(t[n],o+"."+n);for(const n of s)t[n]!==void 0&&(a[n]=ae(t[n],o+"."+n));return a}function vt(t,o){pe(t,o);const s=xt(t,o);for(const a of["offPeak","peak","legacyBase","longContext"])t[a]!==void 0&&(s[a]=xt(t[a],o+"."+a,["cacheWrite","reasoning","aboveInputTokens"]));t.cny!==void 0&&(s.cny=xt(t.cny,o+".cny")),t.legacy!==void 0&&(s.legacy=Ne(t.legacy,o+".legacy")),t.rateHistory!==void 0&&((!Array.isArray(t.rateHistory)||t.rateHistory.length>16)&&ie(o+".rateHistory","price history"),s.rateHistory=t.rateHistory.map((a,n)=>((!a||typeof a.before!="string"||!Number.isFinite(Date.parse(a.before)))&&ie(o+".rateHistory","dated price"),{...vt({...a,rateHistory:void 0},o+".rateHistory."+n),before:a.before})));for(const a of["billingMode","sourceUrl","checkedAt","notes"])typeof t[a]=="string"&&(s[a]=t[a]);return s}function an(t,o){const s=n=>n==null?void 0:{...n.adapter==="aliyun"?{adapter:"aliyun"}:{},enabled:n.enabled===!0,label:typeof n.label=="string"?n.label:"",labelEn:typeof n.labelEn=="string"?n.labelEn:"",display:ot(n.display,["sidebar","settings","off"],"both"),unit:["CNY","EUR","CREDITS"].includes(n.unit)?n.unit:"USD",convertToDisplayCurrency:n.convertToDisplayCurrency===!0,refreshMinutes:typeof n.refreshMinutes=="number"&&Number.isFinite(n.refreshMinutes)?n.refreshMinutes:15,request:n.request&&typeof n.request=="object"?n.request:{url:""},extract:n.extract&&typeof n.extract=="object"?n.extract:{},allowedHosts:Array.isArray(n?.allowedHosts)?n.allowedHosts.filter(l=>typeof l=="string"):[]};pe(t,o);const a={};if(t.prices!==null&&typeof t.prices=="object"&&t.prices.models!==null&&typeof t.prices.models=="object")for(const n of Object.keys(t.prices.models))a[n]=vt(t.prices.models[n],o+".prices.models."+n);return{locale:t.locale==="zh"||t.locale==="en"||t.locale==="auto"?t.locale:"auto",position:t.position==="header"||t.position==="off"?t.position:"dock",sidebar:t.sidebar!==!1,showSessionId:t.showSessionId===!0,hideOfficialBalance:t.hideOfficialBalance===!0,hideTodayCost:t.hideTodayCost===!0,...qe(t,["hideSessionCostHeader","hideSessionCostDock","hideTurnCost"],n=>n===!0),sessionCostCompact:t.sessionCostCompact===!0,contextCostsEnabled:t.contextCostsEnabled===!0,contextCostsPromptSeen:t.contextCostsPromptSeen===!0,sidebarTodayMetric:t.sidebarTodayMetric==="tokens"?"tokens":"cost",statisticsBasis:t.statisticsBasis,showTotalWithPlan:t.showTotalWithPlan===!0,sidebarSimple:t.sidebarSimple===!0,sidebarSimplePromptSeen:t.sidebarSimplePromptSeen===!0,sidebarModels:Object.fromEntries(Object.entries(Yt).map(([n,l])=>[n,t.sidebarModels?.[n]??l])),codexQuotaEnabled:t.codexQuotaEnabled===!0,codexQuotaSidebar:t.codexQuotaSidebar!==!1,includeSubagentCost:t.includeSubagentCost===!0,sidebarStyle:t.sidebarStyle==="compact"?"compact":"standard",priceMatchDismissed:Array.isArray(t.priceMatchDismissed)?t.priceMatchDismissed.filter(n=>typeof n=="string"):[],pricingCurrency:t.pricingCurrency==="CNY"?"CNY":"USD",currency:typeof t.currency=="string"?t.currency:"CNY",symbol:typeof t.symbol=="string"?t.symbol:"¥",decimals:ae(t.decimals,o+".decimals"),exchangeRate:ae(t.exchangeRate,o+".exchangeRate"),peakEnabled:t.peakEnabled===!0,peakEffectiveAt:typeof t.peakEffectiveAt=="string"?t.peakEffectiveAt:"",peakWindows:Array.isArray(t.peakWindows)?t.peakWindows.map((n,l)=>({start:ae(n.start,o+".peakWindows["+l+"].start"),end:ae(n.end,o+".peakWindows["+l+"].end")})):[],peakHolidays:Array.isArray(t.peakHolidays)?t.peakHolidays.filter(n=>typeof n=="string"):[],peakNotice:t.peakNotice!==!1,peakAlertEnabled:t.peakAlertEnabled!==!1,peakAlertAhead:Number.isFinite(t.peakAlertAhead)&&t.peakAlertAhead>=1&&t.peakAlertAhead<=30?t.peakAlertAhead:2,peakAlertTarget:t.peakAlertTarget==="peak"||t.peakAlertTarget==="offpeak"?t.peakAlertTarget:"both",peakAlertPosition:t.peakAlertPosition==="center"?"center":"corner",peakAlertWebNotify:t.peakAlertWebNotify===!0,peakStyle:t.peakStyle==="classic"?"classic":"compact",priceMatch:t.priceMatch==="exact"?"exact":"auto",priceOverrides:(()=>{const n={};if(t.priceOverrides!==null&&typeof t.priceOverrides=="object"&&!Array.isArray(t.priceOverrides))for(const[l,r]of Object.entries(t.priceOverrides))typeof l=="string"&&typeof r=="string"&&(n[l]=r);return n})(),priceTableDisplay:(()=>{const n={};if(t.priceTableDisplay!==null&&typeof t.priceTableDisplay=="object"&&!Array.isArray(t.priceTableDisplay))for(const[l,r]of Object.entries(t.priceTableDisplay))typeof l=="string"&&(n[l]=r===!0);return n})(),codingPlans:(()=>{const n={};if(t.codingPlans!==null&&typeof t.codingPlans=="object"&&!Array.isArray(t.codingPlans))for(const l of Object.keys(t.codingPlans)){const r=t.codingPlans[l];r===null||typeof r!="object"||Array.isArray(r)||(n[l]={enabled:r.enabled===!0,display:r.display==="sidebar"||r.display==="both"||r.display==="off"?r.display:"settings",refreshMinutes:typeof r.refreshMinutes=="number"&&Number.isFinite(r.refreshMinutes)?r.refreshMinutes:15,apiKey:typeof r.apiKey=="string"?r.apiKey:"",...l==="minimax"?{baseUrl:typeof r.baseUrl=="string"?r.baseUrl:""}:{},...l==="qwen"?{quotaSource:["cli","bailian"].includes(r.quotaSource)?r.quotaSource:"local"}:{},...typeof r.planCredits=="number"&&Number.isFinite(r.planCredits)&&r.planCredits>0?{planCredits:r.planCredits}:{},...typeof r.planStart=="string"?{planStart:r.planStart}:{},...r.rates!==null&&typeof r.rates=="object"&&!Array.isArray(r.rates)?{rates:r.rates}:{},...typeof r.accessKeyId=="string"?{accessKeyId:r.accessKeyId}:{},...typeof r.secretAccessKey=="string"?{secretAccessKey:r.secretAccessKey}:{}})}return n})(),prices:{models:a,default:vt(t.prices?.default??{cacheHit:0,cacheMiss:0,output:0},o+".prices.default"),providers:t.prices?.providers&&typeof t.prices.providers=="object"?t.prices.providers:{},currency:typeof t.prices?.currency=="string"&&t.prices.currency.length>0?t.prices.currency:void 0},historyDays:ae(t.historyDays,o+".historyDays"),fetchedAt:t.fetchedAt===null||t.fetchedAt===void 0?null:se(t.fetchedAt,o+".fetchedAt"),priceSource:typeof t.priceSource=="string"?t.priceSource:"bundled",budget:{enabled:t.budget?.enabled===!0,amount:typeof t.budget?.amount=="number"&&Number.isFinite(t.budget.amount)?t.budget.amount:100,period:t.budget?.period==="day"||t.budget?.period==="all"||t.budget?.period==="custom"?t.budget.period:"month",customStart:typeof t.budget?.customStart=="string"?t.budget.customStart:null,customEnd:typeof t.budget?.customEnd=="string"?t.budget.customEnd:null,detail:t.budget?.detail!==!1},balance:{display:ot(t.balance?.display,["sidebar","settings","off"],"both"),refreshMinutes:typeof t.balance?.refreshMinutes=="number"&&Number.isFinite(t.balance.refreshMinutes)?t.balance.refreshMinutes:5,showProgressBar:t.balance?.showProgressBar===!0,budgetCap:typeof t.balance?.budgetCap=="number"&&Number.isFinite(t.balance.budgetCap)&&t.balance.budgetCap>0?t.balance.budgetCap:null,clickHintSeen:t.balance?.clickHintSeen===!0},goQuota:{enabled:t.goQuota?.enabled!==!1,display:ot(t.goQuota?.display,["sidebar","settings","off"],"both"),refreshMinutes:typeof t.goQuota?.refreshMinutes=="number"&&Number.isFinite(t.goQuota.refreshMinutes)?t.goQuota.refreshMinutes:15,apiKey:typeof t.goQuota?.apiKey=="string"?t.goQuota.apiKey:"",main:t.goQuota?.main==="weekly"||t.goQuota?.main==="monthly"?t.goQuota.main:"rolling",detail:t.goQuota?.detail!==!1},customBalance:s(t.customBalance),gatewayQuotas:(()=>{const n=Array.isArray(t.gatewayQuotas)?t.gatewayQuotas:t.gatewayQuotas?.sources;return{sources:Array.isArray(n)?n.slice(0,4).filter(r=>r!==null&&typeof r=="object"&&!Array.isArray(r)).map(r=>({id:typeof r.id=="string"?r.id.slice(0,48):"",type:"cliproxyapi",label:typeof r.label=="string"?r.label.slice(0,80):"",baseURL:typeof r.baseURL=="string"?r.baseURL:"",enabled:r.enabled!==!1,display:ot(r.display,["sidebar","settings","off"],"both"),refreshMinutes:typeof r.refreshMinutes=="number"&&Number.isFinite(r.refreshMinutes)?Math.min(1440,Math.max(1,Math.floor(r.refreshMinutes))):15,includeProviders:Array.isArray(r.includeProviders)?[...new Set(r.includeProviders.filter(i=>typeof i=="string").map(i=>i.toLowerCase()).filter(i=>Ct.includes(i)))]:Ct,allowedHosts:Array.isArray(r.allowedHosts)?r.allowedHosts.filter(i=>typeof i=="string").slice(0,16):[],allowInsecureHttp:r.allowInsecureHttp===!0,antigravityOnlyGemini:r.antigravityOnlyGemini===!0,keyVar:typeof r.keyVar=="string"?r.keyVar:""})):[]}})(),customBalances:(()=>{if(Array.isArray(t.customBalances))return t.customBalances.filter(l=>l!==null&&typeof l=="object").slice(0,8).map(s).filter(Boolean);const n=s(t.customBalance);return n?[n]:[]})(),corner:{enabled:t.corner?.enabled===!0,goRolling:t.corner?.goRolling!==!1,goWeekly:t.corner?.goWeekly!==!1,goMonthly:t.corner?.goMonthly!==!1,budget:t.corner?.budget!==!1},quotaStrip:{enabled:t.quotaStrip?.enabled===!0,budget:t.quotaStrip?.budget!==!1,go:t.quotaStrip?.go!==!1,plans:t.quotaStrip?.plans!==!1,promptSeen:t.quotaStrip?.promptSeen===!0},usage:{position:t.usage?.position==="general"||t.usage?.position==="section"?t.usage.position:"cost"},barDirections:(()=>{const n=t.barDirections!==null&&typeof t.barDirections=="object"&&!Array.isArray(t.barDirections)?t.barDirections:{},l=(r,i)=>n[r]==="remaining"||n[r]==="used"?n[r]:i;return{balance:l("balance","remaining"),budget:l("budget","used"),go:l("go","used"),plan:l("plan","used")}})(),planBilling:{providers:ra(t.planBilling?.providers),models:ra(t.planBilling?.models,!0)}}}const Ue=t=>typeof t=="number"&&Number.isFinite(t)?t:null,Se=t=>Ue(t)??0,nn={status:"off",message:"",fetchedAt:0,currency:"",totalBalance:0,grantedBalance:0,toppedUpBalance:0},on={status:"off",message:"",fetchedAt:0,rolling:null,weekly:null,monthly:null},da=(t=null)=>({status:"off",message:"",fetchedAt:0,label:"",unit:"USD",remaining:0,maxBudget:null,spend:null,index:t});function Nt(t,o){return pe(t,o),{status:t.status==="ok"||t.status==="error"?t.status:"off",message:typeof t.message=="string"?t.message:"",fetchedAt:typeof t.fetchedAt=="number"?t.fetchedAt:0}}function sn(t,o){return{...Nt(t,o),keyConfigured:t.keyConfigured===!0,keySource:typeof t.keySource=="string"?t.keySource:"",currency:typeof t.currency=="string"?t.currency:"",totalBalance:Se(t.totalBalance),grantedBalance:Se(t.grantedBalance),toppedUpBalance:Se(t.toppedUpBalance)}}function St(t,o){return t==null?null:((typeof t!="object"||Array.isArray(t))&&ie(o,"object"),{percent:Se(t.percent),resetsAt:typeof t.resetsAt=="string"?t.resetsAt:""})}function ln(t,o){return{...Nt(t,o),rolling:St(t.rolling,o+".rolling"),weekly:St(t.weekly,o+".weekly"),monthly:St(t.monthly,o+".monthly")}}function ma(t,o){return{...Nt(t,o),label:typeof t.label=="string"?t.label:"",unit:typeof t.unit=="string"?t.unit:"USD",remaining:Se(t.remaining),maxBudget:Ue(t.maxBudget),spend:Ue(t.spend),index:typeof t.index=="number"&&Number.isFinite(t.index)&&t.index>=0?Math.floor(t.index):null}}const rn=new Set(["ok","partial","unknown","error","stale","unsupported","capability_missing"]),cn=new Set(["off","loading","ok","partial","stale","error"]),Ct=["antigravity","claude","codex","kimi","xai","workbuddy"],pa={antigravity:"Antigravity",claude:"Claude",codex:"Codex",kimi:"Kimi",xai:"xAI",workbuddy:"WorkBuddy"};function un(t,o){pe(t,o);const s=(r,i="")=>typeof r=="string"?r:i,a=r=>Ue(r),n=r=>r!==null&&typeof r=="object"&&!Array.isArray(r)?{id:s(r.id),label:s(r.label),...a(r.percent)===null?{}:{percent:a(r.percent)},resetsAt:s(r.resetsAt),periodHours:a(r.periodHours),scope:s(r.scope)}:null,l=r=>r!==null&&typeof r=="object"&&!Array.isArray(r)?{unit:s(r.unit,"credits"),used:a(r.used),remaining:a(r.remaining),limit:a(r.limit),fetchedAt:s(r.fetchedAt),packages:Array.isArray(r.packages)?r.packages.filter(i=>i!==null&&typeof i=="object"&&!Array.isArray(i)).map(i=>({id:s(i.id),label:s(i.label),used:a(i.used),remaining:a(i.remaining),limit:a(i.limit),startsAt:s(i.startsAt),resetsAt:s(i.resetsAt)})):[]}:void 0;return{id:s(t.id),type:"cliproxyapi",label:s(t.label),status:cn.has(t.status)?t.status:"error",message:s(t.message),fetchedAt:a(t.fetchedAt)??0,attemptedAt:a(t.attemptedAt)??0,serverVersion:s(t.serverVersion),keyConfigured:t.keyConfigured===!0,keySource:s(t.keySource,"none"),accounts:Array.isArray(t.accounts)?t.accounts.filter(r=>r!==null&&typeof r=="object"&&!Array.isArray(r)).slice(0,16).map(r=>({id:s(r.id),provider:s(r.provider,"unknown"),label:s(r.label,"unknown"),status:rn.has(r.status)?r.status:"unknown",message:s(r.message),plan:s(r.plan),windows:Array.isArray(r.windows)?r.windows.map(n).filter(Boolean):[],credits:l(r.credits)})):[],unsupportedProviders:Array.isArray(t.unsupportedProviders)?t.unsupportedProviders.filter(r=>typeof r=="string").slice(0,32):[]}}function dn(t){if(t===null||typeof t!="object"||Array.isArray(t))return null;const o={};if(t.providers!==null&&typeof t.providers=="object"&&!Array.isArray(t.providers))for(const[s,a]of Object.entries(t.providers)){if(a===null||typeof a!="object"||Array.isArray(a))continue;const n={},l={};if(a.windows!==null&&typeof a.windows=="object"&&!Array.isArray(a.windows))for(const[r,i]of Object.entries(a.windows))i===null||typeof i!="object"||Array.isArray(i)||(n[r]={...qe(i,["percent","localTokens","localCost","sampleCount"],Se),...qe(i,["sampleAt","per1Tokens","per1Cost","fullTokens","fullCost"],Ue),resetsAt:typeof i.resetsAt=="string"?i.resetsAt:"",method:i.method==="sample"||i.method==="live"?i.method:"none",confidence:i.confidence==="high"||i.confidence==="low"?i.confidence:null});if(a.intervals!==null&&typeof a.intervals=="object"&&!Array.isArray(a.intervals))for(const[r,i]of Object.entries(a.intervals))Array.isArray(i)&&(l[r]=i.filter(d=>d!==null&&typeof d=="object"&&!Array.isArray(d)).map(d=>qe(d,["t0","t1","tokens","cost","pct","per1Tokens","per1Cost"],Se)));o[s]={windows:n,intervals:l}}return{generatedAt:Se(t.generatedAt),providers:o}}function fa(t,o){return pe(t,o),{today:fe(t.today,o+".today"),month:fe(t.month,o+".month"),total:fe(t.total,o+".total"),budgetUsed:typeof t.budgetUsed=="number"&&Number.isFinite(t.budgetUsed)?t.budgetUsed:void 0,balance:t.balance==null?nn:sn(t.balance,o+".balance"),goQuota:t.goQuota==null?on:ln(t.goQuota,o+".goQuota"),customBalance:t.customBalance==null?da():ma(t.customBalance,o+".customBalance"),customBalances:Array.isArray(t.customBalances)?t.customBalances.filter(s=>s!==null&&typeof s=="object").map((s,a)=>ma(s,o+".customBalances["+a+"]")):[],gatewayQuotas:Array.isArray(t.gatewayQuotas)?t.gatewayQuotas.filter(s=>s!==null&&typeof s=="object"&&!Array.isArray(s)).map((s,a)=>un(s,o+".gatewayQuotas["+a+"]")):[],customVarStatus:t.customVarStatus!==null&&typeof t.customVarStatus=="object"&&!Array.isArray(t.customVarStatus)?Object.fromEntries(Object.entries(t.customVarStatus).filter(([,s])=>s!==null&&typeof s=="object").map(([s,a])=>[s,{configured:a.configured===!0,source:typeof a.source=="string"?a.source:""}])):{},codingPlans:t.codingPlans!==null&&typeof t.codingPlans=="object"&&!Array.isArray(t.codingPlans)?t.codingPlans:{},planStats:dn(t.planStats),history:Array.isArray(t.history)?t.history.map((s,a)=>fe(s,o+".history["+a+"]")):[],externalUsage:t.externalUsage&&Array.isArray(t.externalUsage.sources)?{fetchedAt:Number(t.externalUsage.fetchedAt)||0,stale:t.externalUsage.stale===!0,sources:t.externalUsage.sources.map(s=>({source:String(s.source),today:fe(s.today,o+".external.today"),month:fe(s.month,o+".external.month"),total:fe(s.total,o+".external.total"),history:(s.history??[]).map(a=>fe(a,o+".external.history"))})),combined:Object.fromEntries(["today","month","total","history"].map(s=>[s,s==="history"?(t.externalUsage.combined.history??[]).map(a=>fe(a,o+".external.history")):fe(t.externalUsage.combined[s],o+".external."+s)]))}:null,config:an(t.config,o+".config"),reconcile:t.reconcile===null||t.reconcile===void 0?void 0:{ok:t.reconcile.ok===!0,message:typeof t.reconcile.message=="string"?t.reconcile.message:""},priceCatalog:t.priceCatalog!==null&&typeof t.priceCatalog=="object"&&!Array.isArray(t.priceCatalog)?t.priceCatalog:null,meta:{...Ie(t.meta?.locale)?{locale:Ie(t.meta.locale)}:{},now:typeof t.meta?.now=="number"?t.meta.now:Date.now(),timezoneOffsetMinutes:typeof t.meta?.timezoneOffsetMinutes=="number"?t.meta.timezoneOffsetMinutes:0,timezone:typeof t.meta?.timezone=="string"?t.meta.timezone:"",dayKey:typeof t.meta?.dayKey=="string"?t.meta.dayKey:"",monthKey:typeof t.meta?.monthKey=="string"?t.meta.monthKey:""}}}function mn(t,o){pe(t,o);const s={ok:t.ok===!0,message:typeof t.message=="string"?t.message:""};return t.state!==void 0&&t.state!==null&&(s.state=fa(t.state,o+".state")),s}function ne(t){return{parse:t}}const At=ne(fa),pn=ne(t=>pe(t,"patch")),fn=ne(mn),Mt=ne(t=>se(t,"provider")),bn=ne(t=>{if(t!=null)return(typeof t!="number"||!Number.isInteger(t)||t<0||t>7)&&ie("index","0-7 integer"),t}),gn=ne(t=>se(t,"date")),hn=ne(t=>pe(t,"day")),yn=ne(t=>(Number.isFinite(Number(t))||ie("limit","number"),Number(t))),ba=ne(t=>se(t,"sort")),kn=ne(t=>pe(t,"topSessions")),ga=ne(t=>se(t,"target")),wn=ne(t=>se(t,"value")),ye=(t,o)=>({mode:"strict",typeSymbol:"dsh-cost-meter#"+t,schema:o,create:()=>o}),le=(t,o,s,a=!1)=>({name:t,wire:t,source:"json",codec:ye(o,s),...a?{acceptsUndefined:!0}:{}}),xn={package:"dsh-cost-meter",descriptors:[...["getState","getLocalState"].map(t=>({method:t,result:ye("CostState",At)})),{method:"updateConfig",parameters:[le("patch","ConfigPatch",pn)],result:ye("CostState",At)},{method:"fetchPrices"},{method:"refreshBalance"},{method:"refreshGoQuota"},{method:"refreshCustomBalance",parameters:[le("index","CustomBalanceIndex",bn,!0)]},{method:"refreshCodingPlan",parameters:[le("provider","CodingPlanProvider",Mt)]},{method:"loginCodingPlan",parameters:[le("provider","CodingPlanProvider",Mt)]},{method:"refreshGatewayQuota",parameters:[le("sourceId","GatewayQuotaSourceId",ne(t=>{if(t!=null)return(typeof t!="string"||t.length>48||!/^[a-z0-9][a-z0-9_-]*$/.test(t))&&ie("sourceId","gateway source id"),t}),!0)]},{method:"resetHistory",result:ye("CostState",At)},{method:"importLegacyHistory"},{method:"getDaySessions",parameters:[le("date","DayKey",gn)],result:ye("DayRecord",hn)},{method:"getSessionCost",parameters:[le("sessionId","SessionId",Mt)],result:ye("SessionCost",ne(t=>({own:wt(t.own,"own"),subagents:wt(t.subagents,"subagents"),found:Ne(t.found,"found"),subagentCount:ae(t.subagentCount,"subagentCount")})))},{id:"dsh-cost-meter#costMeter/getTurnCost",service:"costMeter",namespace:"costMeter",method:"getTurnCost",invocation:{kind:"direct"},parameters:[le("sessionId","SessionId",ne(t=>se(t,"sessionId"))),...["startSeq","endSeq"].map(t=>le(t,"TurnSeq",ne(o=>((!Number.isSafeInteger(o)||o<0)&&ie(t,"nonnegative integer"),o))))],result:ye("TurnCost",ne(t=>({found:Ne(t.found,"found"),cost:ae(t.cost,"cost"),apiCost:ae(t.apiCost,"apiCost"),rows:ua(t.rows),calls:(Array.isArray(t.calls)?t.calls:ie("calls","array")).map(o=>({kind:se(o.kind,"kind"),provider:se(o.provider,"provider"),model:se(o.model,"model"),atMs:ae(o.atMs,"atMs"),cost:ae(o.cost,"cost"),apiCost:ae(o.apiCost,"apiCost"),plan:Ne(o.plan,"plan"),priced:Ne(o.priced,"priced"),longContext:Ne(o.longContext,"longContext"),rows:ua(o.rows)}))})))},{method:"getTopSessions",parameters:[le("limit","SessionLimit",yn),le("sort","SessionSort",ba,!0),le("dir","SessionSortDir",ba,!0)],result:ye("TopSessions",kn)},{method:"setCredential",parameters:[le("target","CredentialTarget",ga),le("value","CredentialValue",wn)]},{method:"clearCredential",parameters:[le("target","CredentialTarget",ga)]}].map(t=>({id:"dsh-cost-meter#costMeter/"+t.method,service:"costMeter",namespace:"costMeter",invocation:{kind:"direct"},parameters:[],result:ye("FetchPricesResult",fn),...t}))};function vn(t,o){const s=o?.models??{};return typeof t=="string"&&t.length>0&&s[t]!==void 0?s[t]:o?.default??{cacheHit:0,cacheMiss:0,output:0}}function He(t){if(t===null||typeof t!="object")return;const o=r=>{const i=t[r];return typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0},s=o("cacheMiss")??o("input")??0,n={cacheHit:o("cacheHit")??o("cachedInput")??o("cacheRead")??s,cacheMiss:s,output:o("output")??0},l=o("reasoning");return l!==void 0&&(n.reasoning=l),o("cacheWrite")!==void 0&&(n.cacheWrite=o("cacheWrite")),n}function Nn(t){const o=He(t);if(o===void 0)return null;t.billingMode==="utc-peak"&&(o.billingMode="utc-peak");for(const s of["offPeak","peak","legacyBase"]){const a=He(t[s]);a!==void 0&&(o[s]=a)}return Number.isFinite(t.longContext?.aboveInputTokens)&&t.longContext.aboveInputTokens>0&&(o.longContext={...He(t.longContext),aboveInputTokens:t.longContext.aboveInputTokens}),Array.isArray(t.rateHistory)&&(o.rateHistory=t.rateHistory.slice(0,16).map(s=>{const a={...He(s),before:s.before};for(const n of["offPeak","peak"]){const l=He(s[n]);l!==void 0&&(a[n]=l)}return a})),o}function st(t,o=Date.now()){if(!t||!Number.isFinite(o)||!Array.isArray(t.rateHistory))return t;let s=null,a=1/0;for(const r of t.rateHistory){const i=Date.parse(r.before);o<i&&i<a&&(s=r,a=i)}if(!s)return t;const{before:n,...l}=s;return{...t,...l}}const Pt=Date.parse("2026-08-22T16:00:00Z");function ha(t){if(!Number.isFinite(t)||t<Pt)return null;const o=Math.floor((t+8*36e5)/864e5),s=(o+4)%7;if(s!==6&&s!==0)return null;const a=s===6?o:o-1;return{start:Math.max(a*864e5-8*36e5,Pt),end:(a+2)*864e5-8*36e5}}function ya(t,o){if(!Number.isFinite(t)||t<Pt||!Array.isArray(o))return null;const s=Math.floor((t+8*36e5)/864e5);return o.includes(new Date(s*864e5).toISOString().slice(0,10))?{start:s*864e5-8*36e5,end:(s+1)*864e5-8*36e5}:null}const Sn=(t,o)=>ya(t,o)??ha(t);function lt(t,o,s,a){if(!Array.isArray(s)||s.length===0||Sn(t,a)!==null||Number.isFinite(o)&&t<o)return!1;const n=new Date(t).getUTCHours();return s.some(l=>{const r=Number(l.start),i=Number(l.end);return!Number.isFinite(r)||!Number.isFinite(i)?!1:r<i?n>=r&&n<i:n>=r||n<i})}const Cn=Date.parse("2026-08-16T16:00:00Z");function ka(t,o,s){const a=st(t,o)??{cacheHit:0,cacheMiss:0,output:0},n=r=>({cacheHit:r.cacheHit,cacheMiss:r.cacheMiss,output:r.output,reasoning:r.reasoning??0,...r.cacheWrite===void 0?{}:{cacheWrite:r.cacheWrite},...r.longContext===void 0?{}:{longContext:r.longContext}});if(a.billingMode==="utc-peak"){if(s?.enabled!==!0||!Number.isFinite(o))return n(a);const r=new Date(o),i=r.getUTCDay(),d=r.getUTCHours(),u=i>0&&i<6&&(d>=1&&d<4||d>=6&&d<10);return n((u?a.peak:a.offPeak)??a)}if(Number.isFinite(o)&&o<Cn){const r=a.legacyBase;return n(r===void 0?a:r)}if(s?.enabled!==!0)return n(a);const l=typeof s.effectiveAtMs=="number"&&Number.isFinite(s.effectiveAtMs)?s.effectiveAtMs:void 0;if(lt(o,l,s.windows,s.holidays)){const r=a.peak;return n(r===void 0?a:r)}if(l!==void 0&&o>=l){const r=a.offPeak;return n(r===void 0?a:r)}return n(a)}function wa(t,o){const s=Math.max(0,Number(t.input)||0),a=Math.max(0,Number(t.output)||0),n=Math.max(0,Number(t.cacheRead)||0),l=Math.max(0,Number(t.cacheWrite)||0),r=Math.max(0,Number(t.reasoning)||0);return o.longContext&&s+n+l>o.longContext.aboveInputTokens&&(o=o.longContext),(s*o.cacheMiss+a*o.output+n*o.cacheHit+l*(o.cacheWrite??o.cacheHit)+r*(o.reasoning??0))/1e6}function xa(t,o,s){const a=Number(t);if(!Number.isFinite(a)||a<0||a===0)return 0;if(o!=="CNY")return a;const n=Number(s);return!Number.isFinite(n)||n<=0?a:a/n}function oe(t,o){const s=t?.barDirections,a=o==="balance"?"remaining":"used";if(s===null||typeof s!="object"||Array.isArray(s))return a;const n=s[o];return n==="remaining"||n==="used"?n:a}function de(t,o){if(t==null||!Number.isFinite(Number(t)))return{width:0,label:null};const s=Math.max(0,Math.min(100,Number(t))),a=o==="remaining"?Math.round((100-s)*10)/10:Math.round(s*10)/10;return{width:a,label:a}}const va=(t,o)=>t.toFixed(o).replace(/(\.\d*?[1-9])0+$|\.0+$/,"$1");function ce(t,o){const s=typeof o?.symbol=="string"&&o.symbol.length>0?o.symbol:"$",a=Number(o?.decimals),n=Math.max(0,Math.min(10,Number.isFinite(a)?Math.floor(a):2));let l=n;return t>0&&t<Math.pow(10,-n)&&(l=n+2),s+va(t,l)}function K(t,o){const s=Number(o?.exchangeRate),a=t*(Number.isFinite(s)&&s>0?s:1);return ce(a,o)}function j(t){const o=Math.max(0,Number(t)||0),s=a=>a>=100?String(Math.round(a)):String(Math.round(a*10)/10);return o<1e3?String(Math.round(o)):o>=999500?s(o/1e6)+"M":o<1e6?s(o/1e3)+"K":s(o/1e6)+"M"}function Tt(t){return String(t??"").normalize("NFKC").toLowerCase().replace(/[((]\s*(?:go|zen)\s*[))]/g," ").trim()}function be(t){return Tt(t).replace(/[^\p{L}\p{N}]+/gu,"")}function An(t){return Tt(t).replace(/[-_./:@](?:\d{4}-?\d{2}-?\d{2}|v\d+(?:\.\d+)*|\d+k|latest)$/,"")}function Ot(t,o,s=t){if(typeof t!="string"||t.length===0)return null;const a=Array.isArray(o)?o.filter(r=>typeof r=="string"&&r.length>0):[],n=a.find(r=>r===s);if(n!==void 0)return n;let l=t.normalize("NFKC").trim();if(/[:((]\s*(?:free|online)\b/i.test(l))return null;for(;;){const r=be(l);if(r.length===0)return null;const i=a.filter(u=>be(u)===r);if(i.length>0)return i.length===1?i[0]:null;const d=An(l);if(d===l.toLowerCase())return null;l=d}}const Dt=new Set(["openrouter","opencode-zen","opencode-go","zen","opencode"]),rt={openai:/^(?:gpt|o\d|codex)/i,anthropic:/^claude/i,google:/^gemini/i,deepseek:/^deepseek/i,moonshot:/^kimi/i,"z-ai":/^glm/i,xai:/^grok/i,alibaba:/^qwen/i,minimax:/^minimax/i,tencent:/^(?:hunyuan|hy\d)/i,xiaomi:/^mimo/i,upstage:/^solar/i,nvidia:/^nemotron/i,mistral:/^mistral/i,meta:/^(?:muse|llama)/i,meituan:/^longcat/i};function Bt(t){return["deepseek-peak","utc-peak"].includes(t?.billingMode)?t.billingMode:"flat"}function Qe(t,o,s,a,n){if(typeof t!="string")return null;if(Object.hasOwn(o,t))return t;if(a!=="auto")return null;let l=t.normalize("NFKC").trim().replace(/^models\/(?=gemini)/i,"google/");const r=l.search(/[/:]/);if(r>0){const i=l.slice(0,r).trim().toLowerCase(),d=l.slice(r+1).trim();if(Object.hasOwn(rt,i)&&(i===s||(s==="opencode-zen"||s==="opencode-go")&&(rt[i].test(d)||Ot(d,Object.keys(i==="deepseek"?n?.models??{}:n?.providers?.[i]?.models??{}))!==null)))l=d;else if(Object.hasOwn(rt,i))return null}return Ot(l,Object.keys(o),t)}const Mn=new Set(["local","lmstudio","ollama","jan","gpt4all","koboldcpp","llamacpp","llama-cpp","localai","vllm","sglang","tabbyapi","lmdeploy","oobabooga","text-generation-webui","llama-server"]),Pn=["lmstudio:","lmstudio/","ollama:","ollama/","jan:","jan/","gpt4all:","gpt4all/","koboldcpp:","koboldcpp/","llamacpp:","llamacpp/","llama-cpp:","llama-cpp/","localai:","localai/","vllm:","vllm/","sglang:","sglang/","tabbyapi:","tabbyapi/","lmdeploy:","oobabooga/","text-generation-webui/","llama-server:","gguf:","local:"];function Tn(t,o){if(typeof t=="string"&&Mn.has(t))return!0;const s=typeof o=="string"?Tt(o):"";return Pn.some(a=>s.startsWith(a))}function On(t,o,s,a){if(t!=="deepseek"&&!t.includes("deepseek")&&typeof o=="string"&&o.length>0&&o!=="__local__"&&!o.includes(":")){const n=s.models??{},l=Object.hasOwn(n,o)?o:a==="auto"?Ot(o,Object.keys(n)):null;if(l!==null&&n[l]?.unpriced!==!0)return{entry:n[l],priced:!0,billingMode:"deepseek-peak",matched:!0}}return null}function Dn(t,o,s){const a=s?.prices??{},n=s?.priceMatch==="exact"?"exact":"auto",l=s?.priceOverrides&&typeof s.priceOverrides=="object"?s.priceOverrides:{};let r=String(t??"").trim().toLowerCase();r.startsWith("llm-")&&(r=r.slice(4)),r===""&&(r="deepseek");let i=r,d=o;const u=l[r+":"+o];if(u==="__local__")return{entry:null,priced:!1,billingMode:"flat",matched:!0};if(typeof u=="string"&&u.length>0){const p=u.indexOf(":");if(p>0&&u.slice(p+1).length>0?(i=u.slice(0,p).trim().toLowerCase(),d=u.slice(p+1)):d=u,i==="deepseek"&&d==="__default__")return{entry:a.default??{cacheHit:0,cacheMiss:0,output:0},priced:a.default?.unpriced!==!0,billingMode:"deepseek-peak",matched:!1}}if(["zen","opencode"].includes(i)){const p=Qe(d,a.providers?.[i]?.models??{},"opencode-go",n,a);p===null?i="opencode-go":d=p}if(Tn(i,d))return{entry:null,priced:!1,billingMode:"flat",matched:!1};if(i==="openrouter"){const p=a.providers?.openrouter?.models??{},b=Object.hasOwn(p,d)?p[d]:null;return{entry:b,priced:b!==null&&b.unpriced!==!0,billingMode:"flat",matched:b!==null}}if(i==="deepseek"||i.includes("deepseek")){const p=a.models??{},b=Qe(d,p,"deepseek",n,a);if(b!==null)return p[b]?.unpriced===!0?{entry:null,priced:!1,billingMode:"flat",matched:!0}:{entry:p[b],priced:!0,billingMode:"deepseek-peak",matched:!0};if(n==="auto"){let g=null,h=-1,x=!1,N="flat";for(const[T,v]of Object.entries(a.providers??{})){if(Dt.has(T))continue;const f=v?.models??{},S=Qe(d,f,T,n,a);if(S===null)continue;const y=+(S===d||be(S)===be(d));y>h?(g=f[S],h=y,x=!1,N=Bt(f[S])):y===h&&(x=!0)}if(x)return{entry:null,priced:!1,billingMode:"flat",matched:!1};if(g!==null)return{entry:g,priced:g.unpriced!==!0,billingMode:N,matched:!0}}return{entry:a.default??{cacheHit:0,cacheMiss:0,output:0},priced:a.default?.unpriced!==!0,billingMode:"deepseek-peak",matched:!1}}const c=a.providers?.[i]?.models??{},m=Qe(d,c,i,n,a);if(m!==null)return{entry:c[m],priced:c[m]?.unpriced!==!0,billingMode:Bt(c[m]),matched:!0};if(Dt.has(i))return{entry:null,priced:!1,billingMode:"flat",matched:!1};if(Object.hasOwn(rt,i))return{entry:null,priced:!1,billingMode:"flat",matched:!1};if(n==="auto"){let p=null,b=-1,g=!1,h="flat";for(const[x,N]of[["deepseek",{models:a.models??{}}],...Object.entries(a.providers??{})]){if(x===i||Dt.has(x))continue;const T=N?.models??{},v=Qe(d,T,x,n,a);if(v===null)continue;const f=+(v===d||be(v)===be(d));f>b?(p=T[v],b=f,g=!1,h=x==="deepseek"?"deepseek-peak":Bt(T[v])):f===b&&(g=!0)}if(g)return{entry:null,priced:!1,billingMode:"flat",matched:!1};if(p!==null)return{entry:p,priced:p.unpriced!==!0,billingMode:h,matched:!0}}return{entry:null,priced:!1,billingMode:"flat",matched:!1}}function Rt(t,o,s){let a=Dn(t,o,s);if(!a.priced){const n=String(t??"").trim().toLowerCase().replace(/^llm-/,"")||"deepseek";a=On(n,s?.priceOverrides?.[n+":"+o],s?.prices??{},s?.priceMatch==="exact"?"exact":"auto")??a}return a.priced&&s?.prices?.currency==="CNY"&&a.entry?.cny?{...a,entry:a.entry.cny,currency:"CNY"}:{...a,currency:a.priced&&a.billingMode==="deepseek-peak"&&s?.prices?.currency==="CNY"?"CNY":"USD"}}function Bn(t){const o=Number(t?.calls)||0,s=Number(t?.input)||0,a=Number(t?.cacheRead)||0;return o>=3&&s>=1e5&&a===0}function it(t,o){return!t||!o?0:typeof t.cost=="number"&&Number.isFinite(t.cost)?t.cost:Sa(t,o).total}function Fe(t){if(t===null||typeof t!="object")return 0;const o=Number(t.cost)||0,s=t.apiCost===void 0||t.apiCost===null?o:Number(t.apiCost);return Number.isFinite(s)&&s>=0?Math.min(s,o):o}function W(t,o){return o!==null&&typeof o=="object"&&o.showTotalWithPlan===!0?Number(t?.cost)||0:Fe(t)}const Rn={go:["go","zen","opencode","opencode-go"],qwen:["qwen","qwen-tokenplan","qianwen-tokenplan","qwen-token-plan","qianwen-token-plan"],scnet:["scnet","scnet-tokenplan","scnet-token-plan"],mimo:["mimo","xiaomimimo","mimo-token-plan","xiaomi-token-plan","xiaomi-token-plan-cn","xiaomi-token-plan-sgp","xiaomi-token-plan-ams"]},Na=["anthropic","zai","minimax","kimi","openrouter","siliconflow","commandcode","scnet","volcengine","qwen","mimo","go"];function Ln(t){const o=String(t??"").trim().toLowerCase().replace(/^llm-/,"");if(o.length===0)return null;for(const[s,a]of Object.entries(Rn))if(a.includes(o))return s;return Na.includes(o)?o:null}function En(t){const o=new Set,s=t?.codingPlans;if(s!==null&&typeof s=="object")for(const a of Na)a!=="go"&&s[a]?.enabled===!0&&o.add(a);return t?.goQuota?.enabled===!0&&o.add("go"),o}const In=new Set(["grok-4.5","glm-5.3","glm-5.3-flash","glm-5.2","glm-5.1","gpt-5.6-luna","kimi-k3","kimi-k2.7-code","kimi-k2.6","mimo-v2.6-flash","mimo-v2.6-pro","mimo-v2.5","mimo-v2.5-pro","minimax-m3","minimax-m2.7","qwen3.8-max","qwen3.7-max","qwen3.7-plus","qwen3.6-plus","hy3","longcat-2.0","muse-spark-1.2-contributor"].map(be));function jn(t,o,s){const a=String(t??"").trim().toLowerCase();if(a.length>0&&a!=="deepseek"&&!a.includes("deepseek"))return!1;const n=be(o);if(n.length===0||!In.has(n))return!1;const l=s?.prices,r=l?.models??{};for(const i of Object.keys(r))if(be(i)===n)return!1;for(const i of Object.keys(l?.providers?.["opencode-go"]?.models??{}))if(be(i)===n)return!0;return!1}function _e(t,o,s){let a=Ln(t);a===null&&jn(t,o,s)&&(a="go");const n=s?.planBilling?.models;if(n!==null&&typeof n=="object"){const r=n[t+":"+o];if(r==="plan"||r==="api")return r;if(a!==null){const i=n[a+":"+o];if(i==="plan"||i==="api")return i}}if(a===null)return"api";const l=s?.planBilling?.providers?.[a];return l==="plan"||l==="api"?l:En(s).has(a)?"plan":"api"}function Sa(t,o){if(!t||!o)return{total:0,api:0};const s={enabled:o.peakEnabled===!0,effectiveAtMs:Date.parse(o.peakEffectiveAt||""),windows:o.peakWindows,holidays:o.peakHolidays},a=Date.now(),n=t.byProviderModel??t.byModel??{};let l=0,r=0;for(const m of Object.keys(n)){const p=m.indexOf(":"),b=p>0?m.slice(0,p):"deepseek",g=p>0?m.slice(p+1):m,h=Rt(b,g,o);if(h.priced){const x=wa(n[m],ka(Nn(h.entry),a,{...s,enabled:["deepseek-peak","utc-peak"].includes(h.billingMode)&&s.enabled})),N=xa(x,h.currency,o.exchangeRate);l+=N,_e(b,g,o)==="api"&&(r+=N)}}const i={input:0,output:0,cacheRead:0,cacheWrite:0,reasoning:0};for(const m of Object.keys(n))i.input+=n[m].input??0,i.output+=n[m].output??0,i.cacheRead+=n[m].cacheRead??0,i.cacheWrite+=n[m].cacheWrite??0,i.reasoning+=n[m].reasoning??0;const d={input:Math.max(0,(t.input??0)-i.input),output:Math.max(0,(t.output??0)-i.output),cacheRead:Math.max(0,(t.cacheRead??0)-i.cacheRead),cacheWrite:Math.max(0,(t.cacheWrite??0)-i.cacheWrite),reasoning:Math.max(0,(t.reasoning??0)-i.reasoning)},u=wa(d,ka(vn("default",o.prices),a,s)),c=xa(u,o.prices?.currency==="CNY"?"CNY":"USD",o.exchangeRate);return l+=c,r+=c,{total:l,api:r}}function Ca(t,o){if(!t||!o)return!1;const s=t.byProviderModel??{};for(const a of Object.keys(s)){const n=a.indexOf(":"),l=n>0?a.slice(0,n):"deepseek",r=n>0?a.slice(n+1):a;if(_e(l,r,o)==="plan")return!0}return!1}function Lt(t){return(t?.input??0)+(t?.cacheRead??0)+(t?.cacheWrite??0)}function Aa(t,o){if(t?.apiCost!==void 0)return Fe(t);if(!Ca(t,o))return it(t,o);let s=0;for(const[a,n]of Object.entries(t.byProviderModel??{})){if(!Number.isFinite(n.cost))return Sa(t,o).api;const l=a.indexOf(":");_e(a.slice(0,l),a.slice(l+1),o)==="plan"&&(s+=n.cost)}return Math.max(0,it(t,o)-s)}function Et(t){const o=Math.abs(Math.round(Number(t)||0)),s=Math.floor(o/60),a=o%60;return"UTC"+(Number(t)<0?"-":"+")+s+(a>0?":"+String(a).padStart(2,"0"):"")}function qn(t){const o=t?.meta,s=Number(o?.timezoneOffsetMinutes);if(!Number.isFinite(s))return null;const a=-new Date().getTimezoneOffset();if(a===s)return null;const n=typeof o?.timezone=="string"&&o.timezone.length>0?o.timezone:"";return{hostLabel:n?n+" ("+Et(s)+")":Et(s),browserLabel:Et(a)}}function Un(t,o=s=>s){let s=o(t);const a=new Set;return{getSnapshot:()=>s,subscribe:n=>(a.add(n),()=>{a.delete(n)}),set:n=>{if(n=o(n),n!==s){s=n;for(const l of[...a])l()}}}}const{createElement:e,Fragment:E,useState:L,useEffect:X,useRef:ke}=Oe;function Pe({target:t,configured:o,source:s,t:a,api:n,placeholder:l,disabled:r}){const[i,d]=L(""),[u,c]=L(!1),[m,p]=L(!1),[b,g]=L(null),h=ke(!1),x=r===!0||m,N=async()=>{const f=i.trim();if(!(f.length===0||x||h.current)){h.current=!0,p(!0),g(null);try{const S=await n.setCredential(t,f);d(""),c(!1),g({kind:"ok",text:S?.message??a("credentialSave")})}catch(S){g({kind:"err",text:String(S?.message??S)})}finally{h.current=!1,p(!1)}}},T=async()=>{if(!(x||h.current)){h.current=!0,p(!0),g(null);try{const f=await n.clearCredential(t);d(""),c(!1),g({kind:"ok",text:f?.message??a("credentialClear")})}catch(f){g({kind:"err",text:String(f?.message??f)})}finally{h.current=!1,p(!1)}}},v=()=>{d(""),c(!1)};return e("div",{className:"cm-field"},u?e("form",{className:"cm-field",autoComplete:"off",onSubmit:f=>{f.preventDefault(),N()}},e("input",{className:"cm-input",type:"password",name:"cm-credential-"+t,autoFocus:!0,value:i,placeholder:typeof l=="string"?l:"",disabled:x,autoComplete:"new-password","data-lpignore":"true","data-1p-ignore":"true","data-bwignore":"true","aria-label":a("credentialInputHint"),onChange:f=>d(f.target.value)}),e("div",{className:"cm-buttons"},e("button",{className:"cm-btn small",type:"submit",disabled:x||i.trim().length===0},a(m?"credentialSaving":"credentialSave")),e("button",{className:"cm-btn small",type:"button",onClick:v,disabled:m},a("cancel")))):e("button",{className:"cm-btn small",type:"button",onClick:()=>c(!0),disabled:x},a("credentialEdit")),o===!0?e("button",{className:"cm-btn small",type:"button",onClick:T,disabled:x},a("credentialClear")):null,e("span",{className:"cm-hint"},o===!0?a("credentialConfiguredOf",{source:typeof s=="string"&&s.length>0?s:"unknown"}):a("credentialNotConfigured")),e("span",{className:"cm-hint"},a("credentialInputHint")),ea(b))}function Hn({pending:t,t:o}){return!Array.isArray(t)||t.length===0?null:e("div",{className:"cm-msg err"},e("div",null,o("secretMigrationPending")),e("div",null,t.join("、")))}function ct({size:t=16,className:o}){return e("svg",{width:t,height:t,className:o,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M4 4H12A2 2 0 0 1 14 6V11.5A2 2 0 0 1 12 13.5H4A2 2 0 0 1 2 11.5V6A2 2 0 0 1 4 4ZM4 5.3H12A0.7 0.7 0 0 1 12.7 6V11.5A0.7 0.7 0 0 1 12 12.2H4A0.7 0.7 0 0 1 3.3 11.5V6A0.7 0.7 0 0 1 4 5.3Z",fill:"currentColor",fillRule:"evenodd"}),e("path",{d:"M3.3 5.3H12.7V7.1H3.3Z",fill:"currentColor"}),e("path",{d:"M8 2.8A1.3 1.3 0 1 0 8 5.4A1.3 1.3 0 1 0 8 2.8Z",fill:"currentColor"}))}function Ma(t,o){const s=ke(!1),a=ke(""),n=o!==null&&typeof o=="object"?[o.input,o.cacheRead,o.cacheWrite,o.output,o.reasoning,o.cost].map(l=>String(l??0)).join("|"):"";X(()=>{if(!s.current){s.current=!0,a.current=n;return}if(n===""||n===a.current)return;a.current=n;const l=setTimeout(()=>{t.api?.reload?.()},800);return()=>clearTimeout(l)},[n])}function Qn(t,o,s,a){const n=o?o.own:t;if(!s||!o?.subagentCount)return n;const l=o.subagents,r={...n};for(const i of["input","output","cacheRead","cacheWrite","reasoning","calls","cost"])r[i]=(n?.[i]??0)+(l?.[i]??0);r.apiCost=Aa(n,a)+Fe(l);for(const i of["byModel","byProviderModel"]){r[i]={...n?.[i]};for(const[d,u]of Object.entries(l?.[i]??{})){const c={...r[i][d]};c.apiCost=Fe(c)+Fe(u);for(const m of["input","output","cacheRead","cacheWrite","reasoning","calls","cost"])c[m]=(c[m]??0)+(u[m]??0);r[i][d]=c}}return r}function Pa(t){const o=t.useProjection?t.useProjection("costUsage"):void 0,s=t.useCost?.(i=>i)?.state,a=s?.config,[n,l]=L(null);Ma(t,o),X(()=>{if(!t.sessionId||!t.api?.getSessionCost)return;let i=!0,d=!1;const u=async()=>{if(!d){d=!0;try{const m=await t.api.getSessionCost(t.sessionId);i&&l({id:t.sessionId,include:a?.includeSubagentCost===!0,value:m})}catch{}finally{d=!1}}};u();const c=a?.includeSubagentCost===!0?setInterval(u,1e4):null;return()=>{i=!1,c!==null&&clearInterval(c)}},[t.sessionId,s?.meta?.now,o,a?.includeSubagentCost]);const r=n&&n.id===t.sessionId&&n.include===(a?.includeSubagentCost===!0)?n.value:null;return{usage:Qn(o,r,a?.includeSubagentCost===!0,a),config:a}}function Ta(t,o){let s=0,a=it(t,o);if(o.showTotalWithPlan!==!0&&(t.apiCost!==void 0||Ca(t,o))){const n={total:it(t,o),api:Aa(t,o)};s=Math.max(0,n.total-n.api),s>0&&(a=n.api)}return{cost:a,planPart:s}}function Oa(t,o){return Object.entries(t?.byProviderModel??{}).filter(([,s])=>s.input||s.output||s.cacheRead||s.cacheWrite||s.reasoning).map(([s,a])=>s+" "+K(a.cost,o)).join("; ")}function Fn(t){const o=t.useCost?.(h=>h)?.state?.config,[s,a]=L(null),[n,l]=L(""),r=t.turn?.start?.seq,i=t.turn?.end?.seq,d=t.sessionId,u=JSON.stringify([o?.prices,o?.priceOverrides,o?.priceMatch,o?.planBilling,o?.codingPlans,o?.goQuota?.enabled,o?.peakEnabled,o?.peakEffectiveAt,o?.peakWindows,o?.peakHolidays,o?.exchangeRate]);if(X(()=>{let h=!0;if(a(null),l(""),!(o?.hideTurnCost||!d||r==null||i==null))return t.api.getTurnCost(d,r,i).then(x=>{h&&a(x)},x=>{h&&l(String(x.message??x))}),()=>{h=!1}},[d,r,i,u,o?.hideTurnCost]),!o||o.hideTurnCost||r==null||i==null)return null;const c=F(o)==="en",m=c?{input:"Input",output:"Output",cacheRead:"Cache read",cacheWrite:"Cache write",reasoning:"Reasoning"}:{input:"输入",output:"输出",cacheRead:"缓存读取",cacheWrite:"缓存写入",reasoning:"推理"},p=h=>K(h,{...o,decimals:Math.max(8,o.decimals??2)}),b=c?{model:"Model call",compaction:"Context compaction",search:"Native search"}:{model:"模型调用",compaction:"上下文压缩",search:"原生搜索"},g=(h,x)=>e("div",{key:x,style:{marginBottom:4,overflowWrap:"anywhere"}},h.provider+":"+h.model+" · "+m[h.bucket]+(h.plan?" (Plan)":"")+": "+h.tokens.toLocaleString()+" × "+(h.priced?p(h.rate):"?")+" / 1,000,000 ≈ "+(h.priced?p(h.cost):"?"),h.priced?h.bucket==="reasoning"&&h.rate===0?c?" (no separate charge)":"(不单独收费)":"":c?" (price unavailable)":"(未配置价格)");return e("details",{className:"cm-note",style:{fontSize:12,marginTop:6}},e("summary",{style:{cursor:"pointer"}},c?"Turn cost":"本轮费用",s?.found?" ≈ "+p(o.showTotalWithPlan?s.cost:s.apiCost)+(s.rows.some(h=>!h.priced)?c?" + unpriced usage":" + 未定价用量":""):n?" ⚠":""),n?e("div",{role:"alert"},n):s?s.found?e(E,null,e("p",null,c?"Estimated from recorded usage and configured prices; rates per 1M tokens.":"按已记录用量和配置价格估算;单价单位为每百万 Token。"),e("p",null,"API ≈ "+p(s.apiCost)+" · Plan ≈ "+p(s.cost-s.apiCost)+(c?" (equivalent)":"(等值)")),s.rows.map(g),e("details",null,e("summary",{style:{cursor:"pointer"}},(c?"Individual calls":"逐次调用明细")+" ("+s.calls.length+")"),s.calls.map((h,x)=>e("details",{key:x,style:{margin:"6px 0"}},e("summary",{style:{cursor:"pointer",overflowWrap:"anywhere"}},"#"+(x+1)+" "+b[h.kind]+" · "+h.provider+":"+h.model+" · "+new Date(h.atMs).toLocaleTimeString()+" · "+(h.plan?"Plan ":"API ")+(h.priced?"≈ "+p(h.cost):c?"price unavailable":"未配置价格")+(h.longContext?c?" · long context":" · 长上下文价格":"")),h.rows.map(g))))):c?"Complete usage records unavailable":"没有完整用量记录":c?"Loading…":"加载中…")}function _n(t){const{usage:o,config:s}=Pa(t);if(!o||!s||Lt(o)+(o?.output??0)===0)return null;const a=z(F(s)),{cost:n,planPart:l}=Ta(o,s),r=[a("sessionCostTitle"),a("sessionDetailTokens",{input:j(o?.input??0),cache:j((o?.cacheRead??0)+(o?.cacheWrite??0)),output:j(o?.output??0)}),a("sessionDetailCache",{read:j(o?.cacheRead??0),write:j(o?.cacheWrite??0)}),a("cost",{amount:K(n,s)}),...l>0?[a("sessionDetailPlan",{amount:K(l,s)})]:[],Oa(o,s)].filter(Boolean).join("; ");return e($,{label:r,side:"top",delayMs:500},e("div",{className:"cm-chip"},l>0?a("costChipPlan",{amount:K(n,s)}):a("cost",{amount:K(n,s)})))}function Wn(t){const{usage:o,config:s}=Pa(t);if(!o||!s)return null;const a=o.input??0,n=(o.cacheRead??0)+(o.cacheWrite??0),l=o.output??0;if(a+n+l===0)return null;const r=z(F(s)),{cost:i,planPart:d}=Ta(o,s),u=Lt(o)>0?((o.cacheRead??0)/Lt(o)*100).toFixed(1)+"%":"—",c={amount:K(i,s),planAmount:K(d,s),hitRate:u,input:j(a),cache:j(n),output:j(l)},m=r(d>0?"sessionLineSplit":"sessionLine",c),p=Oa(o,s),b=s.sessionCostCompact===!0;return e("div",{className:"cm-root",title:b?[m,p].filter(Boolean).join("; "):p},b?r(d>0?"sessionLineSplitCompact":"sessionLineCompact",c):m)}const zn={USD:"$",CNY:"¥",EUR:"€"};function we(t,o,s){const a=typeof s=="string"?s.toUpperCase():"",n=typeof o?.symbol=="string"&&o.symbol.length>0?o.symbol:"$";return ce(t,{symbol:zn[a]??n,decimals:Math.max(2,Math.min(10,Math.floor(Number(o?.decimals)||2)))})}function Da(t,o){const s=Number(t?.balance?.budgetCap);if(Number.isFinite(s)&&s>0)return s;const a=Number(o?.maxBudget);return Number.isFinite(a)&&a>0?a:null}function Kn(t){const o=t.today,s=o?.byProviderModel;if(s===null||typeof s!="object"||Object.keys(s).length===0)return Number(o?.cost)||0;let a=0;for(const[n,l]of Object.entries(s)){const r=n.indexOf(":");let i=r>=0?n.slice(0,r):n;i.startsWith("llm-")&&(i=i.slice(4)),/^deepseek(?:-official|-account)?$/.test(i)&&(a+=Number(l?.cost)||0)}return a}function Ba(t,o,s,a,n=null){const l=s==="official"?Kn(t):Number(t.today?.cost)||0,r=s==="custom"?We(o,a,n):t.balance?.currency;if(r==="USD")return l;if(r==="CREDITS")return 0;const i=Number(o?.exchangeRate);return l*(Number.isFinite(i)&&i>0?i:1)}function Ra({remaining:t,spend:o,todayUsed:s,cap:a}){if(a===null||a<=0)return{remainingPct:100,todayPct:0,spentPct:0,hasCap:!1,pastSpend:0,today:0};const n=Math.max(0,Number(t)||0),l=Math.max(0,Number(o)||0),r=Math.max(0,Math.min(l,Number(s)||0)),i=Math.max(0,l-r),d=Math.max(0,Math.min(100,n/a*100)),u=Math.max(0,Math.min(100-d,r/a*100)),c=Math.max(0,Math.min(100-d-u,i/a*100));return{remainingPct:d,todayPct:u,spentPct:c,hasCap:!0,pastSpend:i,today:r}}function It(t,o,s=null,a=null){const n=s??t.customBalance,l=Da(We(o,n,a)==="CREDITS"?null:o,n),r=Number(n?.remaining)||0,i=Number(n?.spend)||0,d=Ba(t,o,"custom",n,a);return{cap:l,...Ra({remaining:r,spend:i,todayUsed:d,cap:l})}}function Gn(t,o){const s=t.balance,a=Da(o,null),n=Number(s?.totalBalance)||0,l=Ba(t,o,"official",null),r=a!==null?Math.max(0,a-n):0;return{cap:a,...Ra({remaining:n,spend:r,todayUsed:l,cap:a})}}function jt(t){const{segments:o,direction:s="remaining"}=t,{remainingPct:a,todayPct:n,spentPct:l}=o,r=[];a>0&&r.push(e("div",{className:"cm-bbox-fill",style:{width:a+"%"}})),n>0&&r.push(e("div",{className:"cm-bbox-seg-today",style:{width:n+"%"}})),l>0&&r.push(e("div",{className:"cm-bbox-seg-spent",style:{width:l+"%"}})),r.length===0&&r.push(e("div",{className:"cm-bbox-fill",style:{width:"100%"}}));const i=s==="used"?[...r].reverse():r;return e("div",{className:"cm-bbox-bar segments"+(s==="used"?" rev":"")},...i)}function La(t,o,s,a,n){const l=[t("balanceBarRemaining",{amount:a})];return s.today>0&&l.push(t("balanceBarToday",{amount:o(s.today)})),s.pastSpend>0&&l.push(t("balanceBarSpent",{amount:o(s.pastSpend)})),n!==null&&n>0&&l.push(t("balanceBudgetCapLabel")+": "+o(n)),l.join(" · ")}function Ce(t){const[o,s]=L(!1),[a,n]=L(null);return{busy:o,err:a,run:()=>{o||typeof t!="function"||(s(!0),n(null),Promise.resolve().then(t).catch(r=>{n(r?.message??String(r))}).finally(()=>{s(!1)}))}}}const me=(t,o)=>({role:"button",tabIndex:0,"aria-busy":t?"true":"false",onClick:o,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),o())}});function ge(t,o){const s=[t("clickToRefresh")];return o.busy&&s.push(t("refreshing")),o.err&&s.push("⚠ "+t("balanceRefreshFailed",{message:o.err})),s}const Yn="https://platform.deepseek.com/usage";function Ea(t){return e("a",{className:"cm-bal-link",href:Yn,target:"_blank",rel:"noreferrer noopener",title:t("balanceRechargeLink"),"aria-label":t("balanceRechargeLink"),onClick:o=>o.stopPropagation(),onKeyDown:o=>o.stopPropagation()},e("svg",{width:14,height:14,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e("path",{d:"M8 4H4a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-4M11 3h6v6M9 11l8-8"})))}function Vn(t){const{state:o,wide:s,api:a}=t,n=o.balance,l=z(F(o.config)),r=Ce(a?()=>a.refreshBalance():null);if(!n||n.status==="off")return null;if(n.status==="error")return e($,{label:[l("balanceQueryFailed",{message:n.message||l("unknownError")}),...ge(l,r)].join("; "),side:"right",delayMs:300},e("div",{className:"cm-foot clickable"+(s?"":" cm-foot-rail")+" cm-bal-err"+(r.busy?" busy":""),...me(r.busy,r.run)},s?e(E,null,l("balance")," ",e("span",{className:"cm-num"},l("queryFailed"))):"⚠"));const i=[l("balanceTitle"),l("totalBalance",{amount:we(n.totalBalance,o.config,n.currency)}),l("grantedToppedUp",{granted:we(n.grantedBalance,o.config,n.currency),toppedUp:we(n.toppedUpBalance,o.config,n.currency)}),l("updatedAt",{time:n.fetchedAt>0?new Date(n.fetchedAt).toLocaleTimeString():"—"}),...o.reconcile?.ok===!1?["⚠ "+o.reconcile.message]:[],...ge(l,r)].join("; ");return e($,{label:i,side:"right",delayMs:300},e("div",{className:"cm-foot clickable"+(s?"":" cm-foot-rail")+(r.busy?" busy":""),...me(r.busy,r.run)},s?e(E,null,e("span",{className:"cm-balance-name"},l("balance"),Ea(l)),e("span",{className:"cm-num cm-bal-amt"},we(n.totalBalance,o.config,n.currency)),o.reconcile?.ok===!1?" ⚠":""):e(ct,{size:16})))}function Jn(t){const{state:o,wide:s,api:a}=t,n=o.config,l=o.balance,r=z(F(n)),i=Ce(a?()=>a.refreshBalance():null);if(!l||l.status!=="ok")return null;const d=Gn(o,n),u=we(l.totalBalance,n,l.currency),c=b=>we(b,n,l.currency),m=[r("balanceTitle"),La(r,c,d,u,d.cap),r("grantedToppedUp",{granted:we(l.grantedBalance,n,l.currency),toppedUp:we(l.toppedUpBalance,n,l.currency)}),r("updatedAt",{time:l.fetchedAt>0?new Date(l.fetchedAt).toLocaleTimeString():"—"}),...o.reconcile?.ok===!1?["⚠ "+o.reconcile.message]:[],...ge(r,i)].join("; "),p=e(E,null,e("div",{className:"cm-bbox-head"},e("span",{className:"cm-balance-name"},e("span",{className:"cm-bbox-label"},r("balance")),Ea(r)),e("span",{className:"cm-bbox-pct cm-num cm-bal-amt"},u)),e(jt,{segments:d,direction:oe(n,"balance")}));return e($,{label:m,side:"right",delayMs:300},e("div",{className:"cm-bbox clickable"+(s?"":" rail")+(i.busy?" busy":""),...me(i.busy,i.run)},s?p:e("div",{className:"cm-bbox-rail cm-num"},Math.round(d.remainingPct)+"%")))}function qt(t,o){const s=typeof t?.label=="string"?t.label:"",a=typeof t?.labelEn=="string"?t.labelEn:"";return o==="en"?a||s||"Custom balance":s||a||"自定义余额"}function We(t,o,s){if((s??t?.customBalance)?.adapter==="aliyun"&&["CNY","USD","EUR"].includes(o?.unit))return o.unit;const a=s?.unit??t?.customBalance?.unit;return["CNY","EUR","USD","CREDITS"].includes(a)?a:["CNY","EUR","CREDITS"].includes(o?.unit)?o.unit:"USD"}function ze(t,o,s,a){const n=We(o,s,a),l=Number(t);if(!Number.isFinite(l))return"—";const r=o?.currency==="USD"?1:Number(o?.exchangeRate);if((a??o?.customBalance)?.convertToDisplayCurrency===!0&&n==="USD"&&Number.isFinite(r)&&r>0){const c=l*r;return Number.isFinite(c)?ce(c,o):"—"}const i=n==="CREDITS",d=Math.max(2,Math.min(6,Math.floor(Number(o?.decimals)||4)));return(i?"":n==="CNY"?"¥":n==="EUR"?"€":"$")+va(l,d)+(i?" Credits":"")}function Ut(t,o,s,a,n=null){const l=ze(t.remaining,o,t,n),r=p=>ze(p,o,t,n);if(a&&o.balance?.showProgressBar===!0){const p=It(a,o,t,n);return[La(s,r,p,l,p.cap),s("updatedAt",{time:t.fetchedAt>0?new Date(t.fetchedAt).toLocaleTimeString():"—"})].join(" · ")}const i=t.spend!==null?r(t.spend):"—",d=t.maxBudget!==null?r(t.maxBudget):"—",u=We(o,t,n)==="CREDITS"?NaN:Number(o?.balance?.budgetCap),c=Number.isFinite(u)&&u>0?s("balanceBudgetCapLabel")+": "+r(u):"",m=t.maxBudget!==null&&t.spend!==null?s("customBalanceLine",{remaining:l,spend:i,maxBudget:d,time:t.fetchedAt>0?new Date(t.fetchedAt).toLocaleTimeString():"—"}):s("customBalanceRemaining",{amount:l});return c?m+" · "+c:m}function Zn(t,o,s,a,n){const l=qt(n??o.customBalance??{},F(o)),r=ze(a.remaining,o,a,n),i=It(t,o,a,n);return{level:"ok",rail:Math.round(i.remainingPct)+"%",body:e(E,null,e("div",{className:"cm-bbox-head"},e("span",{className:"cm-bbox-label"},l),e("span",{className:"cm-bbox-pct cm-num cm-bal-amt"},r)),e(jt,{segments:i,direction:oe(o,"balance")}))}}function Ht(t,o){const s=o?.customBalances??[],a=Array.isArray(t?.customBalances)?t.customBalances:[],n=[];return s.forEach((l,r)=>{if(l?.enabled!==!0||l.display!=="sidebar"&&l.display!=="both")return;const i=a.find(d=>d.index===r)??(a.length===1&&s.length===1?a[0]:null);n.push({index:r,entry:l,snapshot:i})}),n.length===0&&a.length===0&&o?.customBalance?.enabled===!0&&(o.customBalance.display==="sidebar"||o.customBalance.display==="both")&&t?.customBalance?.status&&t.customBalance.status!=="off"&&n.push({index:null,entry:o.customBalance,snapshot:t.customBalance}),n}function $n(t){const{state:o,wide:s,api:a}=t,n=o.config,l=z(F(n)),r=Ht(o,n);return r.length===0?null:e(E,null,r.map(({index:i,entry:d,snapshot:u})=>e(Xn,{key:"cb-"+i,state:o,wide:s,api:a,t:l,index:i,entry:d,snapshot:u})))}function Xn(t){const{state:o,wide:s,api:a,t:n,index:l,entry:r,snapshot:i}=t,d=o.config;if(i==null||i.status!=="ok")return null;const u=Ce(a?()=>a.refreshCustomBalance(l):null),c=Zn(o,d,n,i,r),m=[Ut(i,d,n,o,r),...ge(n,u)].join(" · ");return e($,{label:m,side:"right",delayMs:300},e("div",{className:"cm-bbox clickable"+(c.level==="ok"?"":" "+c.level)+(s?"":" rail")+(u.busy?" busy":""),...me(u.busy,u.run)},s?c.body:e("div",{className:"cm-bbox-rail cm-num"},c.rail)))}function eo(t){const{state:o,wide:s,api:a}=t,n=o.config,l=z(F(n)),r=Ht(o,n);return r.length===0?null:e(E,null,r.map(({index:i,entry:d,snapshot:u})=>e(to,{key:"cbr-"+i,state:o,wide:s,api:a,t:l,index:i,entry:d,snapshot:u})))}function to(t){const{state:o,wide:s,api:a,t:n,index:l,entry:r,snapshot:i}=t,d=o.config,u=i??da(l);if(u.status==="off")return null;const c=Ce(a?()=>a.refreshCustomBalance(l):null),m=qt(r??d.customBalance??{},F(d));if(u.status==="error")return e($,{label:[u.message||n("unknownError"),...ge(n,c)].join("; "),side:"right",delayMs:300},e("div",{className:"cm-foot clickable"+(s?"":" cm-foot-rail")+" cm-bal-err"+(c.busy?" busy":""),...me(c.busy,c.run)},s?e(E,null,e("span",{className:"cm-bal-label",title:m},m),e("span",{className:"cm-num cm-bal-amt"},n("queryFailed"))):"⚠"));const p=ze(u.remaining,d,u,r),b=[Ut(u,d,n,o,r),...ge(n,c)].join(" · ");return e($,{label:b,side:"right",delayMs:300},e("div",{className:"cm-foot clickable"+(s?"":" cm-foot-rail")+(c.busy?" busy":""),...me(c.busy,c.run)},s?e(E,null,e("span",{className:"cm-bal-label",title:m},m),e("span",{className:"cm-num cm-bal-amt"},p)):e(ct,{size:16})))}function ao(t){const s=(t.useCost?t.useCost(g=>g):void 0)?.state;if(!s)return null;const a=s.config,n=z(F(a)),l=a.corner??{enabled:!1,goRolling:!0,goWeekly:!0,goMonthly:!0,budget:!0},r=s.goQuota,i=a?.goQuota?.enabled!==!1&&r?.status==="ok",d=g=>g!==null&&typeof g?.percent=="number"?Math.round(Math.max(0,Math.min(100,g.percent))):null,u=[];if(a.sidebarModels?.dock){const g=za(s,a.sidebarModels.period,n);g.length&&u.push({key:"model-top",text:e(E,null,e("span",{className:"cm-bal-label"},g[0].label),e("span",{className:"cm-bal-amt"},K(g[0].cost,a))),tip:g[0].label+" "+K(g[0].cost,a),level:"ok"})}const c=(g,h,x,N)=>{if(!l.enabled||!g||!i)return;const T=d(h);if(T===null)return;const v=typeof h.resetsAt=="string"&&h.resetsAt.length>0?n("goResetAt",{time:new Date(h.resetsAt).toLocaleString()}):"";u.push({key:x,text:n(x)+" "+T+"%",tip:n(N)+": "+T+"%"+(v?" · "+v:""),level:T>=100?"over":T>=80?"warn":"ok"})},m=a?.goQuota?.main==="weekly"||a?.goQuota?.main==="monthly"?a.goQuota.main:"rolling",p=[m,...["rolling","weekly","monthly"].filter(g=>g!==m)],b=g=>g==="rolling"?["goRolling",r?.rolling,"goShortRolling","cornerGoRolling"]:g==="weekly"?["goWeekly",r?.weekly,"goShortWeekly","cornerGoWeekly"]:["goMonthly",r?.monthly,"goShortMonthly","cornerGoMonthly"];for(const g of p){const[h,x,N,T]=b(g);c(l[h]===!0,x,N,T)}if(l.enabled&&l.budget===!0){const g=a.budget??{enabled:!1,amount:100,period:"month"};if(g.enabled===!0){const h=Number(a.exchangeRate),N=(s.budgetUsed??(g.period==="day"?W(s.today,a):g.period==="all"?W(s.total,a):W(s.month,a)))*(Number.isFinite(h)&&h>0?h:1),T=Math.max(0,Number(g.amount)||0),v=T>0?Math.min(999,N/T*100):null;if(v!==null){const f=v>=100?"over":v>=80?"warn":"ok";u.push({key:"budget",text:n("budgetShort")+" "+v.toFixed(1)+"%",tip:n("budgetOf",{period:n(je[g.period]??"periodMonth")})+" · "+n("usedOf",{used:ce(N,a),amount:ce(T,a)}),level:f})}}}return u.length===0?null:e("div",{className:"cm-corner"},u.map(g=>e($,{key:g.key,label:g.tip,side:"top",delayMs:500},e("span",{className:"cm-corner-chip"+(g.key==="model-top"?" cm-model-top":"")+(g.level==="ok"?"":" "+g.level)},g.text))))}function ut(t,o,s){if(!Array.isArray(o)||o.length===0||!Number.isFinite(t))return null;const a=(p,b)=>{const g=new Date(t);return g.setUTCDate(g.getUTCDate()+p),g.setUTCHours(b,0,0,0),g.getTime()},n=new Set,l=Math.max(12,Math.min(380,(Array.isArray(s)?s.length:0)+7));for(let p=-l;p<=l;p+=1){n.add(a(p,16));for(const b of o){const g=Number(b?.start),h=Number(b?.end);!Number.isFinite(g)||!Number.isFinite(h)||(n.add(a(p,g)),n.add(a(h<=g?p+1:p,h)))}}const r=[...n].sort((p,b)=>p-b).flatMap(p=>{const b=lt(p-1,void 0,o,s),g=lt(p,void 0,o,s);return b===g?[]:[{at:p,intoPeak:g}]});let i=null,d=null;for(const p of r)p.at<=t&&(i===null||p.at>i.at)&&(i=p),p.at>t&&(d===null||p.at<d.at)&&(d=p);const u=ya(t,s),c=u??ha(t);return c!==null?d===null?null:{inPeak:!1,weekend:u===null,...u?{holiday:!0}:{},prevAtMs:c.start,nextAtMs:d.at,nextIntoPeak:d.intoPeak}:i===null||d===null?null:{inPeak:lt(t,void 0,o,s),weekend:!1,prevAtMs:i.at,nextAtMs:d.at,nextIntoPeak:d.intoPeak}}function dt(t,o){if(!t||t.peakNotice===!1||t.peakEnabled!==!0)return null;const s=Date.parse(t.peakEffectiveAt||"");if(Number.isFinite(s)&&o<s)return null;const a=Array.isArray(t.peakWindows)?t.peakWindows:[];return ut(o,a,t.peakHolidays)}function mt(t){return t.holiday===!0?{short:"holidayShort",chip:"holidayChip",notice:"holidayAllOffPeak"}:t.weekend===!0?{short:"weekendShort",chip:"weekendChip",notice:"weekendAllOffPeak"}:t.inPeak?{short:"peakShort",chip:"peakShort",notice:"peakNotice"}:{short:"offPeakShort",chip:"offPeakShort",notice:"offPeakActive"}}function he(t,o,s){const a=Math.max(0,t.nextAtMs-o),n=Math.max(1,Math.ceil(a/6e4)),l=Math.floor(n/60),r=n%60;return l>0?r>0?s("countdownHourMinute",{h:l,m:r}):s("countdownHoursOnly",{h:l}):s("countdownMinute",{m:n})}const Qt="cm-peak-alert-preview";let Ia=0;function no(t){const o=t.useCost?t.useCost(h=>h):void 0,s=o?.state?.config,[a,n]=L(Date.now()),[l,r]=L(null),[i,d]=L(null);if(X(()=>{const h=window.setInterval(()=>n(Date.now()),1e4);return()=>window.clearInterval(h)},[]),X(()=>{const h=x=>{const N=x.detail?.kind==="offpeak"?"offpeak":"peak";d(N);const T=o?.state?.config;if(T?.peakAlertWebNotify===!0&&window.Notification&&Notification.permission==="granted"){const v=z(F(T));try{new Notification(v(N==="peak"?"peakAlertTitlePeak":"peakAlertTitleOffPeak")+v("peakAlertPreviewTag"),{body:v("peakAlertBody",{time:v("countdownMinute",{m:2}),phase:v(N==="peak"?"peakAlertPhasePeak":"peakAlertPhaseOffPeak")})})}catch{}}};return window.addEventListener(Qt,h),window.__cmPeakAlertLive=!0,()=>{window.removeEventListener(Qt,h),window.__cmPeakAlertLive=!1}},[]),X(()=>{if(!s||s.peakAlertEnabled!==!0||s.peakEnabled!==!0||s.peakAlertWebNotify!==!0||!window.Notification||Notification.permission!=="granted")return;const h=ut(a,Array.isArray(s.peakWindows)?s.peakWindows:[],s.peakHolidays);if(h===null)return;const x=s.peakAlertTarget==="peak"||s.peakAlertTarget==="offpeak"?s.peakAlertTarget:"both",N=h.nextIntoPeak===!0;if(x!=="both"&&x!==(N?"peak":"offpeak"))return;const T=Number(s.peakAlertAhead),v=(Number.isFinite(T)&&T>=1?T:2)*6e4;if(a<h.nextAtMs-v||a>=h.nextAtMs||Ia===h.nextAtMs)return;const f=z(F(s));Ia=h.nextAtMs;try{new Notification(f(N?"peakAlertTitlePeak":"peakAlertTitleOffPeak"),{body:f("peakAlertBody",{time:he(h,a,f),phase:f(N?"peakAlertPhasePeak":"peakAlertPhaseOffPeak")})})}catch{}},[a]),!s||s.peakEnabled!==!0)return null;let u=null;if(s.peakAlertEnabled===!0){const h=Date.parse(s.peakEffectiveAt||"");if(!(Number.isFinite(h)&&a<h)){const x=ut(a,Array.isArray(s.peakWindows)?s.peakWindows:[],s.peakHolidays);if(x!==null){const N=s.peakAlertTarget==="peak"||s.peakAlertTarget==="offpeak"?s.peakAlertTarget:"both",T=Number(s.peakAlertAhead),v=(Number.isFinite(T)&&T>=1?T:2)*6e4;(N==="both"||N===(x.nextIntoPeak?"peak":"offpeak"))&&a>=x.nextAtMs-v&&a<x.nextAtMs&&l!==x.nextAtMs&&(u=x)}}}let c=null,m=!1,p=null;if(u!==null)c=u,m=u.nextIntoPeak===!0,p=()=>r(u.nextAtMs);else if(i!==null)c={nextAtMs:a+2*6e4,nextIntoPeak:i==="peak"},m=i==="peak",p=()=>d(null);else return null;const b=z(F(s)),g=s.peakAlertPosition==="center"?"cm-peak-alert-center":"cm-peak-alert-corner";return e("div",{className:"cm-peak-alert "+g+" "+(m?"cm-peak-alert-peak":"cm-peak-alert-offpeak"),role:"alert"},e("div",{className:"cm-peak-alert-badge"},b(m?"peakAlertBadgePeak":"peakAlertBadgeOffPeak")),e("div",{className:"cm-peak-alert-title"},b(m?"peakAlertTitlePeak":"peakAlertTitleOffPeak")),e("div",{className:"cm-peak-alert-body"},b("peakAlertBody",{time:he(c,a,b),phase:b(m?"peakAlertPhasePeak":"peakAlertPhaseOffPeak")})),e("div",{className:"cm-peak-alert-actions"},e("button",{className:"cm-btn",onClick:p},b("peakAlertBtn"))))}function oo(t){const{config:o,t:s}=t,[a,n]=L(Date.now());X(()=>{const d=window.setInterval(()=>n(Date.now()),3e4);return()=>window.clearInterval(d)},[]);const l=dt(o,a);if(l===null)return null;const r=mt(l),i=l.nextIntoPeak?s("nextPeakIn",{time:he(l,a,s)}):s("nextOffPeakIn",{time:he(l,a,s)});return e($,{label:s(r.notice),side:"right",delayMs:300},e("div",{className:"cm-peak-strip "+(l.weekend||l.holiday?"weekend":l.inPeak?"peak":"off")},e("div",{className:"cm-peak-track"},e("div",{className:"cm-peak-segment cm-peak-high"}),e("div",{className:"cm-peak-segment cm-peak-low"}),e("div",{className:"cm-peak-marker",style:{left:l.weekend||l.holiday?"50%":l.inPeak?"25%":"75%"}})),e("span",{className:"cm-peak-chip"},s(r.chip)+" · "+i)))}function so(t){const{config:o,t:s}=t,[a,n]=L(Date.now());X(()=>{const d=window.setInterval(()=>n(Date.now()),3e4);return()=>window.clearInterval(d)},[]);const l=dt(o,a);if(l===null)return null;const r=mt(l),i=l.nextIntoPeak?s("nextPeakIn",{time:he(l,a,s)}):s("nextOffPeakIn",{time:he(l,a,s)});return e($,{label:s(r.notice),side:"right",delayMs:300},e("div",{className:"cm-peak-classic "+(l.weekend||l.holiday?"weekend":l.inPeak?"peak":"off")},e("div",{className:"cm-peak-classic-marker",style:{left:l.weekend||l.holiday?"50%":l.inPeak?"25%":"75%"}}),e("div",{className:"cm-peak-track"},e("div",{className:"cm-peak-segment cm-peak-high"}),e("div",{className:"cm-peak-segment cm-peak-low"})),e("span",{className:"cm-peak-classic-chip"},s(r.chip)+" · "+i)))}function pt(t,o,s){return e(o?.peakStyle==="classic"?so:oo,{config:o,t:s})}function lo(t){const{config:o,t:s}=t,[a,n]=L(Date.now());X(()=>{const u=window.setInterval(()=>n(Date.now()),3e4);return()=>window.clearInterval(u)},[]);const l=dt(o,a);if(l===null)return null;const r=mt(l),i=l.nextIntoPeak?s("nextPeakIn",{time:he(l,a,s)}):s("nextOffPeakIn",{time:he(l,a,s)}),d=[s(r.notice),i];return e($,{label:d,side:"right",delayMs:300},e("div",{className:"cm-peak-rail "+(l.weekend||l.holiday?"weekend":l.inPeak?"peak":"off"),"aria-label":d.join("; ")},e("div",{className:"cm-peak-rail-track"},e("div",{className:"cm-peak-rail-segment cm-peak-rail-high"}),e("div",{className:"cm-peak-rail-segment cm-peak-rail-low"}),e("div",{className:"cm-peak-rail-marker",style:{top:l.weekend||l.holiday?"50%":l.inPeak?"25%":"75%"}})),e("span",{className:"cm-peak-rail-label"},s(r.short))))}function ro(t){const{config:o,t:s}=t,[a,n]=L(Date.now());X(()=>{const u=window.setInterval(()=>n(Date.now()),3e4);return()=>window.clearInterval(u)},[]);const l=dt(o,a);if(l===null)return null;const r=mt(l),i=l.nextIntoPeak?s("nextPeakIn",{time:he(l,a,s)}):s("nextOffPeakIn",{time:he(l,a,s)}),d=[s(r.notice),i];return e($,{label:d,side:"right",delayMs:300},e("div",{className:"cm-peak-rail-classic "+(l.weekend||l.holiday?"weekend":l.inPeak?"peak":"off"),"aria-label":d.join("; ")},e("div",{className:"cm-peak-rail-classic-track"},e("div",{className:"cm-peak-rail-classic-segment peak"}),e("div",{className:"cm-peak-rail-classic-segment off"}),e("div",{className:"cm-peak-rail-classic-marker",style:{top:l.weekend||l.holiday?"50%":l.inPeak?"25%":"75%"}})),e("span",{className:"cm-peak-rail-classic-label"},s(r.short))))}function io(t,o,s){return e(o?.peakStyle==="classic"?ro:lo,{config:o,t:s})}function ja(t,o,s){const a=t.today,n=o.budget??{enabled:!1,amount:100,period:"month"},l=Number(o.exchangeRate),i=(t.budgetUsed??(n.period==="day"?W(t.today,o):n.period==="all"?W(t.total,o):W(t.month,o)))*(Number.isFinite(l)&&l>0?l:1),d=Math.max(0,Number(n.amount)||0),u=d>0?Math.min(999,i/d*100):null,c=de(u===null?null:Math.min(100,u),oe(o,"budget")),m=W(a,o)*(Number.isFinite(l)&&l>0?l:1),p=d>0?Math.min(999,m/d*100):null,b=n.detail!==!1;return{level:u===null?"ok":u>=100?"over":u>=80?"warn":"ok",rail:c.label===null?"—":Math.round(c.label)+"%",body:e(E,null,e("div",{className:"cm-bbox-head"},e("span",{className:"cm-bbox-label"},s("budget")),e("span",{className:"cm-bbox-pct cm-num"},c.label===null?"—":c.label.toFixed(1)+"%")),e("div",{className:"cm-bbox-bar"},e("div",{className:"cm-bbox-fill",style:{width:c.width+"%"}})),b?e(E,null,o.hideTodayCost===!0?null:e("div",{className:"cm-bbox-line cm-num"},o.sidebarTodayMetric==="tokens"?s("today")+" "+Kt(a,o,s):s("todayShare",{amount:K(W(a,o),o),pct:p===null?"—":p.toFixed(1)+"%"})),e("div",{className:"cm-bbox-line cm-num"},s("usedOf",{used:ce(i,o),amount:ce(d,o)}))):null,pt(t,o,s))}}function qa(t,o,s){const a=t.goQuota,n=o?.goQuota?.main==="weekly"||o?.goQuota?.main==="monthly"?o.goQuota.main:"rolling",l=a[n],r=l!==null&&typeof l?.percent=="number"?Math.max(0,Math.min(100,Number(l.percent)||0)):0,i=b=>b!==null&&typeof b?.percent=="number"?Math.round(Math.max(0,Math.min(100,b.percent)))+"%":"—",d=b=>s(b==="rolling"?"goShortRolling":b==="weekly"?"goShortWeekly":"goShortMonthly"),u=["rolling","weekly","monthly"].filter(b=>b!==n),c=l!==null&&typeof l?.resetsAt=="string"&&l.resetsAt.length>0?s("goResetAt",{time:new Date(l.resetsAt).toLocaleString()}):"",m=o?.goQuota?.detail!==!1,p=de(r,oe(o,"go"));return{level:r>=100?"over":r>=80?"warn":"ok",rail:p.label===null?"—":Math.round(p.label)+"%",body:e(E,null,e("div",{className:"cm-bbox-head"},e("span",{className:"cm-bbox-label"},s("goQuotaRowLabel")+" "+d(n)),e("span",{className:"cm-bbox-pct cm-num"},p.label===null?"—":Math.round(p.label)+"%")),e("div",{className:"cm-bbox-bar"},e("div",{className:"cm-bbox-fill",style:{width:p.width+"%"}})),m?e(E,null,e("div",{className:"cm-bbox-line cm-num"},u.map(b=>d(b)+" "+i(a[b])).join(" · ")),c?e("div",{className:"cm-bbox-line"},c):null):null)}}function co(t){const{state:o,wide:s}=t,a=o.goQuota,n=z(F(o.config));if(!a||a.status!=="ok")return null;const l=o.config?.goQuota?.main==="weekly"||o.config?.goQuota?.main==="monthly"?o.config.goQuota.main:"rolling";if(a[l]===null||typeof a[l]?.percent!="number")return null;const r=qa(o,o.config,n),i=[n("goQuotaTitle"),n("goWindowRolling")+": "+(a.rolling===null?"—":Math.round(a.rolling.percent)+"%"),n("goWindowWeekly")+": "+(a.weekly===null?"—":Math.round(a.weekly.percent)+"%"),n("goWindowMonthly")+": "+(a.monthly===null?"—":Math.round(a.monthly.percent)+"%"+(a.monthly!==null&&typeof a.monthly.resetsAt=="string"&&a.monthly.resetsAt.length>0?" · "+n("goResetAt",{time:new Date(a.monthly.resetsAt).toLocaleString()}):"")),n("goQuotaFetchedAt",{time:a.fetchedAt>0?new Date(a.fetchedAt).toLocaleTimeString():"—"})].join("; ");return e($,{label:i,side:"right",delayMs:300},e("div",{className:"cm-bbox"+(r.level==="ok"?"":" "+r.level)+(s?"":" rail")},s?r.body:e("div",{className:"cm-bbox-rail cm-num"},r.rail)))}function uo(t){return t===null||typeof t!="object"||t.unlimited||typeof t.percent!="number"?null:Math.max(0,Math.min(100,Math.round(Number(t.percent)||0)))}function Ke(t){const o=t!==null&&typeof t=="object"?t:{};return{five:o["5h"]??null,seven:o["7d"]??o.week??o.weekly??null}}function Ua(t,o,s=Date.now()){if(typeof t!="string"||!t)return"";const a=Date.parse(t);if(!Number.isFinite(a))return"";const n=a-s;if(n<=0)return o("resetReached");const l=Math.ceil(n/6e4),r=Math.floor(l/1440),i=Math.floor(l%1440/60),d=l%60;return r>0?o("resetDays",{d:r,h:i}):i>0?o("resetHours",{h:i,m:d}):o("resetMinutes",{m:d})}function Ge(t,o,s=Date.now()){const a=Ua(t?.resetsAt,o,s);return a?o("goResetAt",{time:new Date(t.resetsAt).toLocaleString()})+" ("+a+")":""}function ft(t,o,s){return t===null?"—":s(o==="remaining"?"quotaRemaining":"quotaUsed",{pct:t})}function bt(t){const[,o]=L(0),s=()=>o(Date.now());return X(()=>{if(!t)return;const a=setInterval(s,6e4);return()=>clearInterval(a)},[t]),{onMouseEnter:s,onFocus:s}}function Ye(t,o,s,a){const n=uo(o),l=n===null?"ok":n>=100?"over":n>=80?"warn":"ok",r=de(n,s),i=o?.unlimited?"∞":r.label===null?"—":r.label+"%";return{level:l,pct:n,text:i,label:r.label,row:e("div",{className:"cm-mm-row"+(l==="ok"?"":" "+l)},e("span",{className:"cm-bbox-label"},t),e("div",{className:"cm-bbox-bar"},e("div",{className:"cm-bbox-fill",style:{width:r.width+"%"}})),e("span",{className:"cm-bbox-pct cm-num"},i))}}function Ha(t){const{five:o,seven:s,fetchedAt:a,t:n,wide:l,refresh:r,direction:i="used"}=t,d=bt(o?.resetsAt),u=Ua(o?.resetsAt,n),c=Ye(n("codingPlanRemain5h"),o,i,n),m=Ye(n("codingPlanRemain7d"),s,i,n),p=c.level==="over"||m.level==="over"?"over":c.level==="warn"||m.level==="warn"?"warn":"ok",b=(N,T,v)=>{const f=T?.unlimited?n("quotaUnlimited"):ft(v.label,i,n),S=Ge(T,n);return N+" "+f+(S?" · "+S:"")},g=[n("codingPlanMinimaxTitle"),b(n("codingPlanRemain5h"),o,c),b(n("codingPlanRemain7d"),s,m),a>0?n("goQuotaFetchedAt",{time:new Date(a).toLocaleTimeString()}):null,...r?ge(n,r):[]].filter(Boolean).join(`
1
+ // Generated from src/client/*.js by node scripts/build.mjs; do not edit.
2
+ window.__ModuleLoader__.load({id:"dsh-cost-meter",factory:at=>{var na={exports:{}},kt=na.exports;Object.defineProperty(kt,Symbol.toStringTag,{value:"Module"});const Oe=at("react"),{Tooltip:$}=at("@deepseek-ai/dsh-client-ui-primitives"),nt=!1,oa='@property --cm-dialog-top{syntax:"<length>";inherits:true;initial-value:0px}.cm-stat-dialog{--cm-dialog-top:var(--dsh-frame-chrome-top,var(--dsh-frame-top-clearance,var(--dsh-windows-titlebar-height,0px)));inset:var(--cm-dialog-top) 0 0 0;margin:auto;width:min(1000px,94vw);max-width:calc(100vw - 32px);max-height:calc(100vh - var(--cm-dialog-top) - 32px);overflow:hidden;box-sizing:border-box;padding:0;border-radius:16px;border:1px solid var(border-l1);color:var(label-primary);background:var(bg-layer-2,var(bg-base,#fff))}.cm-stat-dialog[open]{display:flex;flex-direction:column}.cm-loading{padding:24px;min-height:160px;display:grid;gap:18px}.cm-loading i{height:18px;border-radius:5px;background:var(bg-layer-1,#f2f3f5)}.cm-loading i:first-child{width:35%}.cm-loading i:last-child{width:65%}.cm-stat-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 24px;border-bottom:1px solid var(border-l3);flex:none}.cm-stat-dialog-head strong{font-size:15px;font-weight:500}.cm-stat-dialog-body{overflow:auto;min-height:0;padding:20px 24px;overscroll-behavior:contain}.cm-stat-dialog::backdrop{inset:var(--dsh-frame-chrome-top,var(--dsh-frame-top-clearance,var(--dsh-windows-titlebar-height,0px))) 0 0;background:#0005}[data-fullscreen] .cm-stat-dialog{--cm-dialog-top:0px}[data-fullscreen] .cm-stat-dialog::backdrop{inset:0}.cm-root{flex:0 1 auto;min-width:0;max-width:100%;text-align:center;font-size:12px;line-height:20px;color:var(label-tertiary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cm-chip{display:inline-flex;align-items:center;gap:4px;max-width:180px;padding:0 8px;height:22px;border-radius:6px;background:var(bg-layer-2);font-size:12px;line-height:22px;color:var(label-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cm-foot{display:flex;align-items:center;gap:6px;height:32px;padding:0 8px;border-radius:8px;font-size:12px;color:var(label-secondary);white-space:nowrap;overflow:hidden}.cm-foot:hover,.cm-foot-rail:hover,.cm-corner-chip:hover,.cm-qchip:hover,.cm-tab:hover,.cm-btn:hover{background:var(interactive-bg-hover)}.cm-foot-rail{width:100%;justify-content:center;padding:0;font-size:13px;font-weight:600;color:var(label-primary)}.cm-num{font-variant-numeric:tabular-nums}.cm-go-rail{font-size:11px;font-weight:700;color:var(label-primary)}.cm-go-list{display:flex;flex-direction:column;gap:10px}.cm-go-row{display:flex;align-items:center;gap:8px;font-size:12px}.cm-go-label{flex:none;width:88px;color:var(label-secondary)}.cm-go-bar{flex:1;height:6px;border-radius:3px;background:var(interactive-bg-hover);overflow:hidden}.cm-go-fill{height:100%;border-radius:3px;background:var(brand-primary)}.cm-go-num{flex:none;min-width:44px;text-align:right;font-weight:600;font-variant-numeric:tabular-nums}.cm-go-reset{flex:none;max-width:230px;font-size:11px;color:var(label-tertiary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cm-go-time{font-size:11px;color:var(label-tertiary)}.cm-go-row.main .cm-go-label{font-weight:600;color:var(label-primary)}.cm-corner{display:inline-flex;flex:0 1 auto;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;min-width:0;max-width:100%}.cm-corner-chip{display:inline-flex;align-items:center;height:20px;padding:0 8px;border-radius:6px;background:var(bg-layer-2);font-size:11px;line-height:20px;color:var(label-secondary);white-space:nowrap;font-variant-numeric:tabular-nums}.cm-qstrip{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;width:100%;max-width:var(--dsh-chat-content-width,720px);margin:0 auto;box-sizing:border-box;padding:0 calc(var(--dsh-composer-side-clearance,0px) + 16px)}.cm-qchip{display:inline-flex;align-items:center;gap:6px;height:22px;padding:0 8px;border-radius:6px;background:var(bg-layer-2);font-size:11px;line-height:22px;color:var(label-secondary);white-space:nowrap;font-variant-numeric:tabular-nums;cursor:default}.cm-qchip .cm-qlabel{color:var(label-primary);font-weight:600}.cm-qchip .cm-qbar{display:block;width:44px;height:4px;border-radius:2px;background:var(border-l1);overflow:hidden;flex:none}.cm-qchip .cm-qfill{display:block;height:100%;border-radius:2px;background:var(state-ok-primary,#3ba272)}.cm-qchip .cm-qseg{display:inline-flex;align-items:center;gap:4px}.cm-qchip .cm-qsep{width:1px;height:12px;background:var(border-l1);flex:none}.cm-qchip .cm-qtext{color:var(label-secondary)}.cm-qchip.warn .cm-qfill{background:var(state-warn-primary)}.cm-qchip.over .cm-qfill{background:var(state-error-primary)}.cm-qchip.action{cursor:pointer;user-select:none;outline:none}.cm-qchip.action:focus-visible{box-shadow:0 0 0 2px var(brand-primary)}.cm-qchip.action:active{transform:translateY(.5px)}.cm-plan-provider{display:flex;flex-direction:column;gap:8px}.cm-plan-provider+.cm-plan-provider{margin-top:14px}.cm-plan-provider-name{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600}.cm-plan-updated{font-size:11px;font-weight:400;color:var(label-tertiary)}.cm-plan-tag{flex:none;margin-left:6px;padding:0 6px;border-radius:999px;border:1px solid var(border-l1);font-size:10px;line-height:16px;color:var(state-warn-primary)}.cm-plan-reset,.cm-plan-method{font-size:11px;color:var(label-tertiary)}.cm-qguide{position:fixed;top:18px;left:50%;transform:translate(-50%);z-index:9999;max-width:440px;width:calc(100% - 32px);border:1px solid var(border-l1);border-radius:12px;background:var(bg-layer-2);box-shadow:0 8px 28px #0000002e;padding:14px 16px;font-size:13px;color:var(label-primary);display:flex;flex-direction:column;gap:8px}.cm-qguide h4{margin:0;font-size:13px;font-weight:600}.cm-qguide p{margin:0;font-size:12px;line-height:1.6;color:var(label-secondary)}.cm-qguide .cm-buttons{display:flex;gap:8px;justify-content:flex-end}.cm-section{display:flex;flex-direction:column;gap:20px;padding:4px 2px 24px;font-size:13px;color:var(label-primary)}.cm-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.cm-cards-toggle{display:flex;align-items:center;gap:6px;margin:-6px 2px 0 auto;width:fit-content;font-size:12px;color:var(label-tertiary);cursor:pointer;user-select:none}.cm-cards-toggle:hover{color:var(label-primary)}.cm-cards-toggle input{margin:0;cursor:pointer}.cm-card,.cm-budget{border:1px solid var(border-l1);border-radius:12px;padding:14px 16px;background:var(bg-layer-1)}.cm-card-title{font-size:12px;color:var(label-tertiary);margin:0 0 8px}.cm-card-value{font-size:20px;line-height:28px;font-weight:600}.cm-card-sub{font-size:12px;color:var(label-tertiary);margin-top:4px}.cm-h{font-size:13px;font-weight:600;margin:0}.cm-collapse-h{display:flex;align-items:center;gap:8px;background:none;border:none;padding:0;margin:0;cursor:pointer;color:inherit;font:inherit;text-align:left}.cm-collapse-h:hover .cm-h{color:var(interactive-text-hover,var(label-primary))}.cm-caret{flex:none;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:6px solid var(label-secondary);transform:rotate(-90deg);transition:transform .15s ease}.cm-caret.open{transform:rotate(0)}.cm-collapse-body{display:flex;flex-direction:column;gap:12px;margin-top:12px}.cm-toolbar{display:flex;justify-content:flex-end;align-items:center;gap:10px}.cm-toolbar .cm-field{flex-direction:row;align-items:center;gap:8px}.cm-toolbar .cm-field label{margin:0;font-size:12px;color:var(label-tertiary)}.cm-toolbar .cm-input{min-width:150px;padding:4px 10px}.cm-tabs-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;border-bottom:1px solid var(--dsh-alias-border-l1);padding-bottom:10px}.cm-tabs{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.cm-tab{font:inherit;font-size:13px;color:var(label-secondary);background:transparent;border:none;border-radius:8px;padding:6px 14px;cursor:pointer;white-space:nowrap}.cm-tab.active{background:var(state-business-primary);color:var(label-primary-inverted);font-weight:600}.cm-tabs-row .cm-msg{padding:2px 10px}.cm-note{font-size:12px;color:var(label-tertiary);margin:0}.cm-table{width:100%;border-collapse:collapse;font-size:12px}.cm-table th,.cm-table td{text-align:left;padding:7px 10px;border-bottom:1px solid var(border-l1);white-space:nowrap}.cm-table th{color:var(label-tertiary);font-weight:500}.cm-table td.num,.cm-table th.num{text-align:right;font-variant-numeric:tabular-nums}.cm-table tr:last-child td{border-bottom:none}.cm-table tr.cm-row-click{cursor:pointer}.cm-table tr.cm-row-click:hover td{background:var(bg-hover,rgba(127,127,127,.08))}.cm-sess-title{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cm-sess-id{font-size:11px;font-family:ui-monospace,Consolas,monospace;color:var(label-tertiary)}.cm-empty{font-size:12px;color:var(label-tertiary);padding:8px 0}.cm-scroll{max-height:320px;overflow:auto;border:1px solid var(border-l1);border-radius:10px}.cm-grid{display:grid;grid-template-columns:repeat(2,minmax(220px,1fr));gap:12px}.cm-field{display:flex;flex-direction:column;gap:6px}.cm-field label{font-size:12px;color:var(label-secondary)}.cm-input,.cm-input option{color:var(label-primary);background:var(bg-base)}.cm-input{font:inherit;font-size:13px;border:1px solid var(border-l1);border-radius:8px;padding:6px 10px;outline:none}.cm-input:focus{border-color:var(state-business-primary)}.cm-input.narrow{max-width:120px}.cm-range-row{display:flex;align-items:center;gap:10px}.cm-range{flex:1;min-width:0;accent-color:var(state-business-primary)}.cm-range-value{flex:none;min-width:44px;font-size:12px;color:var(label-tertiary);text-align:right}.cm-check{display:flex;align-items:center;gap:8px;font-size:13px;color:var(label-primary);cursor:pointer}.cm-price-card{border:1px solid var(border-l1);border-radius:10px;padding:12px 14px;display:flex;flex-direction:column;gap:10px;background:var(bg-layer-1)}.cm-price-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.cm-price-name{font-weight:600;font-size:13px}.cm-price-legacy{font-size:11px;color:var(label-tertiary);border:1px solid var(border-l1);border-radius:999px;padding:1px 8px}.cm-price-row{display:grid;grid-template-columns:52px 1fr 1fr 1fr;gap:8px;align-items:center}.cm-price-row span{font-size:12px;color:var(label-tertiary)}.cm-price-row input{width:100%}.cm-buttons{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.cm-btn{font:inherit;font-size:13px;color:var(label-primary);background:var(button-elevated-fill);border:1px solid var(border-l1);border-radius:8px;padding:6px 14px;cursor:pointer}.cm-btn.cm-stat-entry{font-size:12px;line-height:20px;padding:0 6px;min-width:0;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-shrink:0}@media(max-width:640px){.cm-stat-header{display:none}}.cm-btn.primary{background:var(state-business-primary);border-color:transparent;color:var(label-primary-inverted)}.cm-btn.primary:hover{opacity:.88;background:var(state-business-primary)}.cm-btn.danger,.cm-msg.err,.cm-bal-line.err,.cm-bal-err{color:var(state-error-primary)}.cm-btn.small{padding:3px 10px;font-size:12px}div:has(>[data-slot="conversation.composer.dock"] .cm-stat-entry){flex-wrap:nowrap;column-gap:6px}.cm-msg{font-size:12px;line-height:18px;padding:8px 12px;border-radius:8px;border:1px solid var(border-l1)}.cm-msg.ok{color:var(state-success-primary)}.cm-hint{font-size:12px;color:var(label-tertiary)}.cm-budget{display:flex;flex-direction:column;gap:10px}.cm-peak-alert{position:fixed;z-index:9999;width:340px;max-width:calc(100vw - 32px);padding:16px;border-radius:14px;background:var(bg-layer-2);border:1px solid var(border-l2);box-shadow:0 14px 36px #00000038;display:flex;flex-direction:column;gap:8px;font-size:12px;animation:cm-peak-alert-in .22s cubic-bezier(.2,.8,.2,1)}.cm-peak-alert.cm-peak-alert-corner{right:20px;bottom:20px}.cm-peak-alert.cm-peak-alert-center{top:50%;left:50%;transform:translate(-50%,-50%);animation-name:cm-peak-alert-in-center}.cm-peak-alert-peak{border-top:3px solid var(state-warn-primary)}.cm-peak-alert-offpeak{border-top:3px solid var(state-info-primary,#3b82f6)}.cm-peak-alert-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;letter-spacing:.4px;text-transform:uppercase}.cm-peak-alert-badge:before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor;box-shadow:0 0 0 4px color-mix(in srgb,currentColor 16%,transparent)}.cm-peak-alert-peak .cm-peak-alert-badge{color:var(state-warn-primary)}.cm-peak-alert-offpeak .cm-peak-alert-badge{color:var(state-info-primary,#3b82f6)}.cm-peak-alert-title{font-size:14px;font-weight:600;color:var(label-primary)}.cm-peak-alert-body{color:var(label-secondary);line-height:1.55}.cm-peak-alert-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:2px}.cm-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}@keyframes cm-peak-alert-in{0%{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes cm-peak-alert-in-center{0%{opacity:0;transform:translate(-50%,calc(-50% + 10px))}to{opacity:1;transform:translate(-50%,-50%)}}.cm-budget-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.cm-quota-name{flex:1;min-width:0}.cm-budget-bar{height:8px;border-radius:999px;background:var(bg-layer-3);overflow:hidden}.cm-budget-fill{height:100%;border-radius:999px;background:var(state-business-primary);transition:width .3s ease}.cm-ug{display:flex;flex-direction:column;gap:12px}.cm-ug-total{font-size:13px;color:var(label-primary)}.cm-ug-grid{display:grid;grid-auto-flow:column;grid-template-rows:repeat(7,auto);gap:3px;width:100%}.cm-ug-cell{width:100%;aspect-ratio:1/1;border-radius:3px;box-sizing:border-box;background:color-mix(in srgb,var(label-primary) 8%,transparent);border:1px solid var(border-l1)}.cm-ug-cell.l1,.cm-ug-cell.l2,.cm-ug-cell.l3,.cm-ug-cell.l4{border-color:transparent}.cm-ug-cell.l1{background:color-mix(in srgb,var(state-business-primary) 25%,var(bg-layer-3))}.cm-ug-cell.l2{background:color-mix(in srgb,var(state-business-primary) 50%,var(bg-layer-3))}.cm-ug-cell.l3{background:color-mix(in srgb,var(state-business-primary) 75%,var(bg-layer-3))}.cm-ug-cell.l4{background:var(state-business-primary)}.cm-ug-cell.today{outline:1px solid var(label-secondary);outline-offset:1px}.cm-ug-months{display:grid;grid-auto-flow:column;gap:3px;width:100%;font-size:10px;color:var(label-tertiary);margin-top:4px}.cm-ug-monthc{white-space:nowrap}.cm-budget-line{font-size:13px;color:var(label-secondary)}.cm-budget-line.over{color:var(state-error-primary)}.cm-peak-strip{display:flex;align-items:center;gap:6px;margin-top:4px;min-width:0}.cm-peak-track{position:relative;display:flex;flex:1;height:6px;min-width:0;border-radius:999px;overflow:hidden;border:1px solid var(border-l1);background:var(bg-layer-3)}.cm-peak-segment{height:100%;flex:1}.cm-peak-high{background:#ff9800}.cm-peak-low{background:var(state-business-primary)}.cm-peak-marker{position:absolute;top:0;left:50%;width:2px;height:100%;background:var(bg-base);box-shadow:0 0 0 1px var(label-tertiary);transform:translate(-50%);transition:left .4s ease;z-index:2}.cm-peak-chip{font-size:11px;font-weight:600;line-height:1.2;white-space:nowrap;color:var(label-secondary)}.cm-peak-classic{position:relative;display:flex;flex-direction:column;gap:5px;margin-top:6px;min-width:0}.cm-peak-classic .cm-peak-track{flex:none;height:8px}.cm-peak-classic-marker{position:absolute;top:0;left:50%;width:4px;height:12px;background:var(bg-base);border:1.5px solid #ff9800;box-shadow:0 0 0 1px var(bg-base),0 0 0 2px var(label-tertiary);transform:translate(-50%);transition:left .4s ease;z-index:2;border-radius:2px}.cm-peak-classic-marker:after{content:"";position:absolute;top:-7px;left:50%;transform:translate(-50%);border-left:5px solid transparent;border-right:5px solid transparent;border-top:6px solid #ff9800}.cm-peak-classic.off .cm-peak-classic-marker{border-color:var(state-business-primary)}.cm-peak-classic.off .cm-peak-classic-marker:after{border-top-color:var(state-business-primary)}.cm-peak-classic-chip{align-self:flex-start;font-size:11px;font-weight:600;line-height:1.4;background:var(bg-layer-2);border:1px solid var(border-l1);border-radius:999px;padding:2px 8px;white-space:nowrap;color:var(label-secondary)}.cm-peak-strip.peak .cm-peak-chip,.cm-peak-classic.peak .cm-peak-classic-chip,.cm-peak-rail.peak .cm-peak-rail-label,.cm-peak-rail-classic.peak .cm-peak-rail-classic-label{color:#ff9800}.cm-peak-strip.off .cm-peak-chip,.cm-peak-classic.off .cm-peak-classic-chip,.cm-peak-rail.off .cm-peak-rail-label,.cm-peak-rail-classic.off .cm-peak-rail-classic-label{color:var(state-business-primary)}.cm-peak-strip.weekend .cm-peak-chip,.cm-peak-classic.weekend .cm-peak-classic-chip,.cm-peak-rail.weekend .cm-peak-rail-label,.cm-peak-rail-classic.weekend .cm-peak-rail-classic-label{color:#34a853}.cm-peak-classic.weekend .cm-peak-classic-marker{border-color:#34a853}.cm-peak-classic.weekend .cm-peak-classic-marker:after{border-top-color:#34a853}.cm-peak-rail{display:flex;flex-direction:column;align-items:center;gap:3px;width:40px;box-sizing:border-box}.cm-peak-rail-track{position:relative;display:flex;flex-direction:column;width:6px;height:56px;border-radius:999px;overflow:hidden;border:1px solid var(border-l1);background:var(bg-layer-3)}.cm-peak-rail-segment{width:100%;flex:1}.cm-peak-rail-high{background:#ff9800}.cm-peak-rail-low{background:var(state-business-primary)}.cm-peak-rail-marker{position:absolute;left:0;top:50%;width:100%;height:2px;background:var(bg-base);box-shadow:0 0 0 1px var(label-tertiary);transform:translateY(-50%);transition:top .4s ease;z-index:2}.cm-peak-rail-label{font-size:10px;font-weight:600;line-height:1.2;white-space:nowrap;color:var(label-secondary)}.cm-peak-rail-classic{display:flex;flex-direction:column;align-items:center;gap:3px;width:40px;box-sizing:border-box}.cm-peak-rail-classic-track{position:relative;display:flex;flex-direction:column;width:14px;height:56px;border-radius:999px;border:1px solid var(border-l1);background:var(bg-layer-3)}.cm-peak-rail-classic-segment{position:relative;width:100%;flex:1;overflow:hidden}.cm-peak-rail-classic-segment.peak{background:#ff9800;border-radius:999px 999px 0 0}.cm-peak-rail-classic-segment.off{background:var(state-business-primary);border-radius:0 0 999px 999px}.cm-peak-rail-classic-marker{position:absolute;left:50%;top:50%;width:12px;height:4px;background:var(bg-base);border:1.5px solid #ff9800;box-shadow:0 0 0 1px var(bg-base),0 0 0 2px var(label-tertiary);transform:translate(-50%,-50%);transition:top .4s ease;z-index:2;border-radius:2px}.cm-peak-rail-classic.off .cm-peak-rail-classic-marker{border-color:var(state-business-primary)}.cm-peak-rail-classic-label{font-size:10px;font-weight:600;line-height:1.2;white-space:nowrap}.cm-peak-rail-classic.weekend .cm-peak-rail-classic-marker{border-color:#34a853}.cm-grid-group{grid-column:1 / -1;margin-top:8px;font-size:12px;font-weight:600;color:var(label-tertiary);border-bottom:1px solid var(border-l1);padding-bottom:4px}.cm-grid-group:first-child{margin-top:0}.cm-peak-preview{margin-top:8px}.cm-toggle-btn{background:none;border:none;padding:0;font-size:12px;font-weight:600;color:var(state-business-primary);cursor:pointer}.cm-toggle-btn:hover{text-decoration:underline}.cm-collapsed-note{margin-top:4px}.cm-catalog-vendor{margin-top:10px;font-size:12px;font-weight:600;color:var(label-tertiary);border-bottom:1px solid var(border-l1);padding-bottom:2px;display:flex;align-items:center;justify-content:space-between;gap:8px}.cm-vendor-toggle{cursor:pointer;user-select:none}.cm-vendor-toggle:hover{color:var(label-secondary)}.cm-vendor-display{display:inline-flex;align-items:center;gap:4px;font-weight:400;font-size:11px;color:var(label-tertiary);white-space:nowrap}.cm-catalog-family{margin:6px 0 2px;font-size:11px;font-weight:600;color:var(label-tertiary)}.cm-catalog-row{display:flex;align-items:center;gap:8px;padding:4px 0;border-top:1px solid var(border-l1);font-size:12px}.cm-catalog-mounted{display:flex;flex-direction:column;gap:4px;padding:6px 0;border-top:1px solid var(border-l1)}.cm-catalog-id{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cm-catalog-price{color:var(label-secondary);white-space:nowrap;font-size:11px}.cm-catalog-tag{font-size:10px;padding:1px 6px;border-radius:999px;border:1px solid var(state-business-primary);color:var(state-business-primary);white-space:nowrap}.cm-mstats-tabs{display:flex;gap:8px;margin-bottom:8px}.cm-mstats-tab{background:none;border:1px solid var(border-l1);border-radius:999px;padding:2px 12px;font-size:12px;color:var(label-secondary);cursor:pointer}.cm-mstats-tab.active{background:var(state-business-primary);border-color:var(state-business-primary);color:var(bg-base);font-weight:600}.cm-mstats-h{margin:10px 0 4px;font-size:12px;font-weight:600;color:var(label-secondary)}.cm-mstats-row{display:grid;grid-template-columns:minmax(90px,170px) 1fr auto;gap:8px;align-items:center;font-size:11px;line-height:1.7}.cm-mstats-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(label-secondary)}.cm-mstats-barbg{position:relative;height:10px;border-radius:999px;background:var(bg-layer-3);overflow:hidden;display:flex}.cm-mstats-bar{height:100%;min-width:0;border-radius:999px}.cm-mstats-bar.cost{background:#ff9800}.cm-mstats-bar.hit{background:#34a853}.cm-mstats-bar.value{background:#a142f4}.cm-mstats-seg{height:100%;min-width:0}.cm-mstats-seg.in{background:var(state-business-primary)}.cm-mstats-seg.cache{background:#ff9800}.cm-mstats-seg.out{background:#34a853}.cm-mstats-val{white-space:nowrap;color:var(label-secondary)}.cm-mstats-legend{display:flex;gap:12px;font-size:10px;color:var(label-tertiary);margin:2px 0 4px}.cm-mstats-dot{display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:3px}.cm-mstats-note{margin-top:10px;font-size:10px;line-height:1.6;color:var(label-tertiary)}.cm-match-row{display:flex;align-items:center;gap:8px;padding:3px 0;font-size:12px;flex-wrap:wrap}.cm-match-row .cm-input{flex:1;min-width:160px}.cm-budget-controls{display:grid;grid-template-columns:repeat(2,minmax(180px,1fr));gap:12px}.cm-bbox{border:1px solid var(border-l1);border-radius:12px;padding:8px 10px;background:var(bg-layer-1);display:flex;flex-direction:column;gap:6px;min-width:148px;box-sizing:border-box}.cm-bbox.rail{padding:6px;min-width:0;width:40px;align-items:center;justify-content:center;border-radius:10px}.cm-bbox.warn{border-color:var(state-warn-primary)}.cm-bbox.over{border-color:var(state-error-primary)}.cm-bbox-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.cm-bbox-label,.cm-bbox-pct{font-size:12px;font-weight:600;color:var(label-primary)}.cm-bbox.warn .cm-bbox-pct{color:var(state-warn-primary)}.cm-bbox.over .cm-bbox-pct{color:var(state-error-primary)}.cm-bbox-bar{height:6px;border-radius:999px;background:var(bg-layer-3);overflow:hidden}.cm-bbox-bar.segments{display:flex;height:8px}.cm-bbox-bar.segments .cm-bbox-fill{flex:none;border-radius:0;height:100%}.cm-bbox-bar.segments .cm-bbox-fill:first-child{border-radius:999px 0 0 999px}.cm-bbox-bar.segments .cm-bbox-seg-today{flex:none;height:100%;background:#ff9800}.cm-bbox-bar.segments .cm-bbox-seg-spent{flex:none;height:100%;background:var(interactive-bg-hover);border-radius:0 999px 999px 0}.cm-bbox-bar.segments.rev .cm-bbox-fill:first-child,.cm-bbox-bar.segments.rev .cm-bbox-seg-today:first-child{border-radius:999px 0 0 999px}.cm-bbox-bar.segments.rev .cm-bbox-fill,.cm-bbox-bar.segments.rev .cm-bbox-fill:last-child,.cm-bbox-bar.segments.rev .cm-bbox-seg-today:last-child,.cm-bbox-bar.segments.rev .cm-bbox-seg-spent:last-child{border-radius:0 999px 999px 0}.cm-bbox-bar.segments.rev .cm-bbox-seg-spent{border-radius:0}.cm-dir-row{display:flex;align-items:center;gap:8px;margin-top:6px}.cm-dir-label{flex:1 1 40%;font-size:12px;color:var(label-secondary)}.cm-dir-row .cm-input{flex:1 1 60%;width:auto}.cm-bbox-fill{height:100%;border-radius:999px;background:var(state-business-primary)}.cm-balance-name{display:inline-flex;align-items:center;gap:4px;min-width:0}.cm-model-costs{font-size:12px}.cm-model-costs .cm-bal-label{white-space:nowrap}.cm-model-top{gap:4px;max-width:180px;overflow:hidden;text-overflow:ellipsis}.cm-model-costs .cm-collapse-h{min-width:0;width:100%;white-space:nowrap}.cm-model-costs .cm-bbox-bar{margin-top:3px}.cm-bal-label{min-width:0;overflow:hidden;text-overflow:ellipsis}.cm-bal-amt{margin-left:auto;text-align:right;flex-shrink:0}.cm-bbox-pct.cm-bal-amt{color:var(state-business-primary)}.cm-bal-link{flex:none;display:inline-flex;align-items:center;justify-content:center;padding:2px;border-radius:4px;font-size:12px;line-height:16px;color:var(label-tertiary);text-decoration:none;outline:none}.cm-bal-link:hover{color:var(brand-primary);background:var(interactive-bg-hover)}.cm-bal-link:focus-visible{box-shadow:0 0 0 2px var(brand-primary)}.cm-bbox.warn .cm-bbox-fill,.cm-bbox .cm-bbox-section.warn .cm-bbox-fill,.cm-bbox .cm-mm-row.warn .cm-bbox-fill,.cm-budget-fill.warn{background:var(state-warn-primary)}.cm-bbox.over .cm-bbox-fill,.cm-bbox-section.over .cm-bbox-fill,.cm-mm-row.over .cm-bbox-fill,.cm-budget-fill.over{background:var(state-error-primary)}.cm-bbox-line{font-size:12px;color:var(label-tertiary)}.cm-bbox-rail{font-size:11px;font-weight:600;color:var(label-primary)}.cm-bbox.warn .cm-bbox-pct,.cm-bbox.warn .cm-bbox-rail,.cm-bbox .cm-bbox-section.warn .cm-bbox-pct,.cm-bbox .cm-mm-row.warn .cm-bbox-pct,.cm-mm-row.warn .cm-bbox-label,.cm-corner-chip.warn,.cm-qchip.warn,.cm-simple-summary.warn{color:var(state-warn-primary)}.cm-bbox.over .cm-bbox-pct,.cm-bbox.over .cm-bbox-rail,.cm-bbox-section.over .cm-bbox-pct,.cm-mm-row.over .cm-bbox-pct,.cm-mm-row.over .cm-bbox-label,.cm-corner-chip.over,.cm-qchip.over,.cm-simple-summary.over{color:var(state-error-primary)}.cm-bbox-pair{display:flex;flex-direction:column;gap:0;padding:2px 10px}.cm-bbox-pair .cm-bbox-section{display:flex;flex-direction:column;gap:4px;padding:4px 0}.cm-bbox-pair .cm-bbox-bar{height:4px}.cm-bbox-divider{height:1px;background:var(border-l1);margin:0}.cm-bbox.clickable,.cm-foot.clickable{cursor:pointer}.cm-bbox.clickable:hover{border-color:var(state-business-primary)}.cm-bbox.clickable:focus-visible,.cm-foot.clickable:focus-visible{outline:2px solid var(state-business-primary);outline-offset:1px}@keyframes cm-click-refresh-pulse{0%,to{opacity:.55}50%{opacity:1}}.cm-bbox.clickable.busy,.cm-foot.clickable.busy{animation:cm-click-refresh-pulse 1.1s ease-in-out infinite}.cm-mm{padding:8px 10px;gap:4px}.cm-mm-title{font-size:12px;font-weight:600;color:var(label-primary)}.cm-mm-reset{font-size:11px;color:var(label-tertiary);grid-column:1/-1}.cm-gw-switcher{cursor:pointer;user-select:none;font-size:11px;padding:1px 6px;border-radius:999px;border:1px solid var(border-l1);background:var(bg-layer-2);color:var(label-secondary)}.cm-gw-switcher:hover{background:var(interactive-bg-hover);color:var(label-primary)}.cm-gw-sub{font-size:11px;color:var(label-tertiary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cm-mm-row{display:flex;align-items:center;gap:8px;padding:2px 0}.cm-mm-row .cm-bbox-label{flex:none;width:auto;min-width:22px;max-width:115px;font-weight:400;color:var(label-secondary);font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;word-break:keep-all}.cm-mm-row .cm-bbox-bar{flex:1;min-width:40px;height:6px}.cm-mm-row .cm-bbox-pct{flex:none;min-width:2.4em;text-align:right;font-variant-numeric:tabular-nums}.cm-mm-row.wide .cm-bbox-label{width:auto;max-width:64px;flex:0 1 auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cm-mm-row.wide .cm-mm-text{flex:1;min-width:0;font-size:12px;color:var(label-secondary);text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cm-bal-line{font-size:13px;color:var(label-secondary)}.cm-bal-line.warn{color:var(state-warning-primary,#b45309)}:has(>.cm-footer-stack),:has(>[data-slot="sidebar.footer.action"]>.cm-footer-stack){flex-wrap:wrap}:has(>.cm-footer-stack.rail),:has(>[data-slot="sidebar.footer.action"]>.cm-footer-stack.rail){flex-direction:column;flex-wrap:nowrap;align-items:center;gap:6px}.cm-footer-stack{display:flex;flex:none;order:-1;flex-direction:column;gap:6px;width:100%;min-width:0;max-width:100%;align-items:stretch;box-sizing:border-box}.cm-footer-stack.rail{align-items:center;order:1}.cm-footer-stack .cm-bbox{width:100%;min-width:0}.cm-footer-stack .cm-foot{width:100%;box-sizing:border-box}.cm-footer-stack.compact .cm-bbox{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:12px;row-gap:2px;align-items:center}.cm-footer-stack.compact .cm-bbox>*{grid-column:1/-1}.cm-footer-stack.compact .cm-bbox>.cm-mm-row{grid-column:auto}.cm-footer-stack.compact .cm-mm-row{min-width:0;gap:4px;flex-wrap:nowrap}.cm-footer-stack.compact .cm-mm-row .cm-bbox-label{flex:0 1 auto;min-width:0;max-width:45%;width:auto}.cm-footer-stack.compact .cm-mm-row .cm-bbox-bar{min-width:0;flex:1 1 0}.cm-footer-stack.simple{gap:0;max-height:38vh;max-height:min(38dvh,320px);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;border:1px solid var(border-l1);border-radius:10px;background:var(bg-layer-1)}.cm-footer-stack.simple>*{flex-shrink:0}.cm-footer-stack.simple:focus-visible{outline:2px solid var(state-business-primary);outline-offset:2px}.cm-footer-stack.simple .cm-bbox{border:0;border-radius:0;padding:4px 8px;gap:2px;background:transparent;box-shadow:inset 0 -1px var(border-l1)}.cm-footer-stack.simple .cm-mm-title{font-size:11px;line-height:16px;margin:0}.cm-footer-stack.simple .cm-mm-row{gap:6px;min-height:16px;line-height:16px;margin:0;padding:0}.cm-footer-stack.simple .cm-mm-text{font-size:11px}.cm-footer-stack.simple>.cm-peak-strip,.cm-footer-stack.simple>.cm-peak-classic{margin:0;padding:4px 8px}.cm-simple-summary>span{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cm-footer-stack.simple .cm-bbox-pct{font-size:12px;line-height:18px}.cm-footer-stack.simple .cm-bbox-bar{height:4px}.cm-footer-stack.simple .cm-bbox-line{display:none}.cm-footer-stack.simple .cm-foot{height:26px;padding:0 8px}.cm-footer-stack.simple .cm-peak-classic{margin-top:2px;gap:2px}.cm-footer-stack.simple .cm-peak-classic-chip{padding:0 4px;border:0;background:transparent}.cm-simple-summary{position:sticky;top:0;z-index:1;background:var(bg-layer-1);display:flex;justify-content:space-between;align-items:center;gap:8px;padding:5px 8px;font-size:12px;font-weight:600;border-bottom:1px solid var(border-l1)}.cm-footer-stack.simple.rail{border:0;background:transparent}.cm-footer-stack.simple.rail .cm-bbox{padding:4px 2px}.cm-footer-stack.simple .cm-peak-rail-track,.cm-footer-stack.simple .cm-peak-rail-classic-track{height:28px}@media(max-width:640px){.cm-cards,.cm-grid,.cm-budget-controls{grid-template-columns:1fr}}'.replaceAll("","--dsw-alias-"),sa="dsh-cost-meter/client.css";if(typeof document<"u"&&document.head!==void 0){const t=document.querySelector("style[data-plugin-css="+JSON.stringify(sa)+"]");if(t?.textContent!==oa){const o=t??document.createElement("style");o.dataset.plugin="dsh-cost-meter",o.dataset.pluginCss=sa,o.textContent=oa,t===null&&document.head.appendChild(o)}}const en="sessionCostTitle|sessionDetailTokens|sessionDetailCache|cost|sessionLine|sessionLineCompact|sessionCostCompact|quotaUnlimited|pricingCnyHint|balanceQueryFailed|unknownError|balance|queryFailed|balanceTitle|reconcileLabel|totalBalance|grantedToppedUp|updatedAt|budgetOf|usedOf|todayShare|monthTotal|budget|todayCostTitle|todayTokensTitle|tokensUnit|callsTokens|monthCost|totalCost|today|sidebarTodayMetric|sidebarTodayCost|sidebarTodayTokens|periodDay|periodMonth|periodAll|periodCustomRange|noHistory|colDate|colCalls|colInTok|colCacheTok|colOutTok|colCost|noSessionsToday|colSession|enableBudget|budgetAmountLabel|budgetPeriodLabel|startDate|endDate|rangeText|budgetDisabledNote|budgetStatus|overLimit|nearLimit|legacyModel|defaultFallback|remove|tierBase|tierOffPeak|tierPeak|balanceApiKey|balanceKeyHint|balanceLine|balanceQueryFailedHint|balanceNotQueried|accountBalance|refreshing|refreshBalance|customBalanceTitle|customBalanceAdd|aliyunBalanceAdd|aliyunBalanceNote|customBalanceConfigNote|customBalanceLabelZh|customBalanceLabelEn|customBalanceUrl|customBalanceMethod|customBalanceHeaders|customBalanceBody|customBalanceBodyNote|customBalanceExtract|customBalanceDisplayLabel|customBalanceRefreshInterval|customBalanceUnitLabel|customBalanceConvert|customBalanceConvertNote|balanceBarRemaining|balanceBarToday|balanceBarSpent|balanceShowProgressBar|barDirectionsTitle|barDirectionsHint|barDirection_balance|barDirection_budget|barDirection_go|barDirection_plan|barDirectionRemaining|barDirectionUsed|balanceBudgetCapLabel|balanceBudgetCapHint|customBalanceInvalidJson|customBalanceHeadersVarNote|customBalanceAllowedHosts|customBalanceAllowedHostsHint|customBalanceCredentialsTitle|customBalanceCredentialsHint|customBalanceNoPlaceholders|enable|customBalanceLine|customBalanceRemaining|refreshCustomBalance|goQuotaTitle|goQuotaRowLabel|goWindowRolling|goWindowWeekly|goWindowMonthly|goResetAt|resetReached|resetDays|resetHours|resetMinutes|quotaUsed|quotaRemaining|goQuotaPercent|goQuotaFetchedAt|goQuotaDisplayLabel|goQuotaRefreshIntervalLabel|goQuotaRefreshMinutesUnit|goQuotaKeyLabel|goMainLabel|goDetailLabel|credentialConfiguredOf|credentialNotConfigured|credentialSave|credentialEdit|credentialClear|credentialSaving|credentialInputHint|secretMigrationPending|budgetDetailLabel|refreshGoQuota|goQuotaNotQueried|codingPlanAnthropic|codingPlanZai|codingPlanMinimax|codingPlanMinimaxTitle|minimaxOrigin|minimaxOriginNote|codingPlanRemain5h|codingPlanRemain7d|balanceRechargeLink|codexQuotaTitle|codexQuotaEnabled|codexQuotaSidebar|includeSubagentCost|gatewayQuotaEmpty|codingPlanDisplayLabel|codingPlanDisplayNote|codingPlanKeyLabel|codingPlanRefreshIntervalLabel|refreshCodingPlan|loginCodingPlan|loggingIn|codingPlanNotQueried|gatewayQuotaTitle|gatewaySourceAdd|gatewaySourceLabel|gatewaySourceBaseURL|gatewaySourceDisplay|gatewaySourceRefreshInterval|gatewaySourceAllowlist|gatewaySourceCredential|gatewaySourceStatus|gatewaySourceUnsupported|gatewaySourceUnknown|gatewaySourceNoAccounts|gatewaySourceFetchedAt|gatewaySwitchAccount|gatewayOnlyGemini|refresh|quotaEnableFirst|quotaRefreshReady|quotaRemove|quotaSectionNote|codingPlanDisabledNote|goQuotaDisabledNote|cornerLabel|cornerEnabledLabel|cornerGoRolling|cornerGoWeekly|cornerGoMonthly|cornerBudget|goShortRolling|goShortWeekly|goShortMonthly|goShortDaily|budgetShort|ledgerReadFailed|readingLedger|ledgerUnavailable|syncFailed|historyCleared|clearFailed|peakOff|peakNotEffective|peakActive|peakNotice|offPeakActive|weekendAllOffPeak|weekendChip|weekendShort|holidayAllOffPeak|holidayChip|holidayShort|peakHolidaysLabel|weekendRuleNote|peakShort|offPeakShort|peakStyleLabel|peakStyleCompact|peakStyleClassic|peakAlertLabel|peakAlertAheadLabel|peakAlertTargetLabel|peakAlertTargetPeak|peakAlertTargetOffPeak|peakAlertTargetBoth|peakAlertTitlePeak|peakAlertTitleOffPeak|peakAlertBody|peakAlertPhasePeak|peakAlertPhaseOffPeak|peakAlertBtn|peakAlertBadgePeak|peakAlertBadgeOffPeak|peakAlertPositionLabel|peakAlertPositionCorner|peakAlertPositionCenter|peakAlertWebNotifyLabel|peakAlertWebNotifyHint|peakAlertPreviewLabel|peakAlertPreviewPeak|peakAlertPreviewOffPeak|peakAlertPreviewTag|peakPanelTitle|peakNoticeHiddenHint|groupGeneral|groupMoney|groupSidebar|sidebarSimple|sidebarSimpleNote|sidebarSimpleTitle|sidebarSimpleBody|sidebarSimpleOn|sidebarSimpleOff|sidebarSimpleError|closeGuide|todayBudget|sidebarStyleLabel|sidebarStyleStandard|sidebarStyleCompact|restorePriceMatches|removePriceMatchHint|groupCorner|groupDetail|catalogTitle|catalogNote|catalogOpen|catalogCollapse|mountBtn|unmountBtn|mountedTag|catalogUnpriced|catalogDeepseekNote|modelStatsTitle|modelsTitle|modelsCount|modelsOther|models_enabled|models_defaultOpen|models_remember|models_tokens|models_shares|models_dock|models_period|models_summary|models_position|models_topN|models_refreshSeconds|modelsTotal|modelsTop|modelsFirst|modelsAfter|modelsLast|modelStatsToday|modelStatsHistory|modelStatsCostH|modelStatsTokensH|modelStatsHitH|modelStatsHitUnreported|modelStatsHitUnreportedTip|modelStatsValueH|modelStatsInput|modelStatsCache|modelStatsOutput|modelStatsEmpty|modelStatsBlended|modelStatsNote|modelStatsLegacy|sessionLineSplit|sessionLineSplitCompact|costChipPlan|sessionDetailPlan|planStatsTitle|planStatsEmpty|planStatsWindow|planStatsPercent|planStatsLocal|planStatsPer1|planStatsFull|planStatsResets|planStatsMethodSample|planStatsMethodLive|planStatsMethodNone|planStatsMethodSampleAt|planStatsConfidenceLow|planStatsCurveTitle|planStatsDaily|planStatsWeekly|planStatsMonthly|planStatsCurveEmpty|planStatsBarTip|planStatsNote|billingClassLabel|billingClassPlan|billingClassAuto|billingClassApi|catalogDisplayLabel|catalogDisplayHint|priceTableDisplayHint|catalogCustomModels|priceMatchLabel|priceMatchAuto|priceMatchExact|priceMatchNote|unmatchedTitle|unmatchedHint|overrideTargetDefault|overrideRemove|overrideTargetLocal|matchedTitle|matchedHint|matchedKeepAuto|overrideNone|mountedSuffix|flatInput|flatCached|flatOutput|deepseekMountedHeader|codingPlanKimi|codingPlanOpenrouter|codingPlanSiliconflow|codingPlanCommandcode|codingPlanScnet|codingPlanVolcengine|codingPlanQwen|codingPlanMimo|mimoWindowPlan|mimoWindowCompensation|codingPlanWindowBalance|qwenSource|qwenSourceLocal|qwenSourceCli|qwenSourceBailian|qwenCliNote|qwenBailianNote|qwenPlanCreditsLabel|qwenPlanStartLabel|qwenRatesLabel|qwenRatesModelPlaceholder|qwenRatePlaceholder|qwenRate_input|qwenRate_cachedInput|qwenRate_output|qwenRateDraftNote|qwenRatesAdd|qwenLocalNote|scnetPlanCreditsLabel|scnetPlanStartLabel|scnetLocalNote|volcengineAccessKeyIdLabel|volcengineSecretAccessKeyLabel|volcengineNote|volcengineAccessKeyPlaceholder|volcengineSecretPlaceholder|countdownHoursOnly|countdownHourMinute|countdownMinute|nextOffPeakIn|nextPeakIn|peakSummary|noPeakWindows|unknown|cardToday|cardMonth|cardTotal|cardTotalSub|externalUsage|combinedUsage|externalStale|externalHistory|cardsFootnote|timezoneHint|todaySessions|historyExpandHint|historySessionsLoading|historyNoSessions|historySessionsError|sessionRankTitle|sessionRankHint|sessionRankEmpty|sessionRankLoading|sessionRankError|sessionRankLimit|showSessionIdLabel|cardsTogglePlanTotal|cardsTogglePlanTotalHint|hideOfficialBalanceLabel|hideTodayCostLabel|hideSessionCostHeader|hideSessionCostDock|hideTurnCost|sessionRankSort|sessionSortCostDesc|sessionSortCostAsc|sessionSortTimeDesc|sessionSortTimeAsc|sessionSortRecent|history|statisticsUpgrade|usageTitle|usageTotal|usageDay|usageEmpty|usageSectionLabel|usagePositionLabel|usagePositionCost|usagePositionGeneral|usagePositionSection|displaySettings|tabOverview|tabQuotas|tabUsage|tabPricing|tabDisplay|historyDataTitle|positionLabel|positionDock|positionHeader|off|quotaStripGroup|quotaStripEnable|quotaStripShowBudget|quotaStripShowGo|quotaStripShowPlans|quotaStripNote|quotaStripGuideTitle|quotaStripGuideBody|quotaStripGuideOn|quotaStripGuideOff|clickToRefresh|balanceClickGuideTitle|balanceClickGuideBody|balanceClickGuideOk|sidebarLabel|sidebarOn|currencyLabel|currencyCny|currencyUsd|currencyEur|symbolLabel|rateLabel|decimalsLabel|balanceDisplayLabel|balanceSidebar|balanceSettings|balanceBoth|refreshIntervalLabel|peakEnabledLabel|peakNoticeLabel|badgeNote|priceTableTitle|pricingCurrencyLabel|pricingCurrencyUsd|pricingCurrencyCny|pricingCurrencyNote|priceTableNote|datedPriceNote|defaultModelId|newModelPlaceholder|addModel|dataSync|saving|autoSaveFailed|autoSavedAt|autoSaveHint|confirmFetch|apply|cancel|syncFromDocs|syncScopeNote|confirmReset|importLegacy|confirmImportLegacy|legacyImportFailed|legacyImportNote|confirmClear|clearAllHistory|lastSync|neverSynced|source|sourceOfficial|sourceBundled|languageLabel|localeAuto|localeZh|localeEn|sectionLabel|rpcFailed|rpcSyncFailed|rpcBalanceFailed".split("|"),tn="weekends and Chinese public holidays are off-peak|OpenCode Go|Coding Plan|Token Plan|显示位置|DeepSeek models use the default price|刷新间隔|Refresh interval|display position|中国公众假期全天谷价|峰时高价时段显著提示|above the input|session details|拓展价格表|输入框上方|以同一系统账号运行|图框详细信息|default price|official account balance|the DSH credential store|display currency|off-peak pricing|refresh interval|This session|cost is an upper bound|extended price catalog|今日费用|会话明细|时价计费|本地账本|自动保存|自动匹配|右下角显示|按显示币种|自定义余额|Monthly credits quota|命中价格的模型|导入安装前历史|按基础价格计费|Balance query failed|Go quota|Strip includes|Token usage|removed from sidebar|as the same OS user|pre-install history|Cost settings|DeepSeek peak-hour|This month|auth login|subscription quota|to refresh|主页面侧边栏|会话排行加载|余额查询失败|写入按命中价|官方账户余额|开启后侧边栏|清除全部历史|留空按自然月|留空自动发现|费用明细入口|Clear all history|Entering off-peak|Quota not queried|all off-peak|billed exactly at|local ledger|never echoed back|the official|会话费用|历史记录|取消挂载|同步价格|官方文档|峰谷时段|峰谷计价|手动指定|本地估算|法定假日|用量统计|直接显示|调用失败|额度数据|额度横条|Preview entering|Show Codex quota|historical rates|Volcano Ark|all history|call failed|coding plan|in Settings|prices from|Plan start date|base prices are|off-peak prices|on the DSH host|session ranking|后显示额度|开始对话后|未查询额度|汇总在这里|现在开启吗|订阅起始日|输入区下方|额度百分比|All time|Failed to load|No history yet|Security Token|built-in table|calendar month|enough samples|including peak|quota data|stay unchanged|the ledger|Alibaba Cloud|Allowed hosts|Entering peak|RAM AccessKey|official page|to expand its|billed at|AccessKey ID|Main sidebar|MiniMax Plan|NewApi quota|Session cost|These models|a credential|cost details|session logs|the composer|today's cost|不再显示|主机安装|优先使用|会话列表|会话日志|侧栏显示|关闭提示|凭据输入|剩余方向|勾选启用|即将进入|历史数据|启用预算|周末时段|在拓展表|官方价格|官方余额|已用方向|开放平台|当前处于|悬停可见|按调用时|文官方页|早期数据|显示设置|暂无会话|更新时间|模型花费|火山引擎|火山方舟|环境变量|生效时间|用默认价|简化显示|精确计费|累计费用|缓存命中|缓存字段|表外模型|订阅额度|费用设置|这些模型|逗号分隔|采样区间|预算已用|M tokens|Provider ID|box details|cache reads|for this|move to the|peak prices|price table|quota strip|records are|the sidebar|Claude Pro|Enable and|Enable the|No session|Plan equiv|early data|hours soon|in session|to restore|Enable it|Top model|and model|month use|without a|zero cost|Base URL|empty to|on hover".split("|"),Me=Object.fromEntries([["zh",'本dž(按每次调用实际时刻Ȫ)|输入 {input} · 缓存 {cache} · 输出 {output}|缓存:读 {read} · 写 {write}(Ʒ计费)|费用 {amount}|本会话 {amount} · 命中 {hitRate} · 输入 {input} · 缓存 {cache} · 输出 {output}|本会话 {amount}|ǩ只显示金额(Ȝ完整分项)|无限制|当前人民币金额来自美元价格 × 汇率 {rate}。对照官方人民币账单,请选择 CNY,再lj;同步会更新历史费用。|ƶ:{message}|未知错误|余额|查询失败|DeepSeek Ț账户余额|Ș变动与Ɲ交叉对账(偏差超阈时提示)|总余额 {amount}|赠送 {granted} · 充值 {toppedUp}|Ȣ {time}|预算({period})|已用 {used} / {amount}|今日 {amount} · 占预算 {pct}|本月 {month} · 累计 {total}|预算|ƚ(按ȗȪ)|今日 Token 用量|tokens|调用 {calls} 次 · 输入 {input} · 缓存 {cache} · 输出 {output}|本月 {amount}|累计 {amount}|今日|侧边栏今日显示|费用|Token 用量|今日|本月|累计|自定义区间|暂无LJ。Ǥ,费用将按天Ǧ。|日期|调用|输入 tok|缓存 tok|输出 tok|费用|今日ȡ记录。|会话|Ȕ|预算额度(ơ)|预算周期|开始日期|结束日期(留空 = 今日)|统计区间:{range}|Ȕǣ、已用金额及比例(ơ换算);可选今日、本月、累计或自定义周期。|{period}预算 {amount} · 已用 {used} · {pct}%|(已超出)|(接近上限)|旧模型|默认回退|移除|基础|谷时|峰时|余额专用 API Key|Ȋ此Ț Key;未配置时读取已登录官方账号余额,其次沿用模型凭据。|总余额 {total} · 赠送 {granted} · 充值 {toppedUp} · 更新于 {time}|ƶ:{message}|未查询余额|Ƹ|刷新中…|刷新余额|自定义 Provider 余额|添加配置|添加千问 / 阿里云余额|查询阿里云中国站可用金。ǹ 需 bss:DescribeBillingAccount 权限。前两项必填;STS 才需 Ǯ。密钥存凭据库。|extract 支持点路径、数值和 add/subtract/divide 运算;Ȁ 除以 500000 得到美元。|中文名称|英文名称|请求 URL|请求方法|请求头 (JSON)|请求体 (JSON)|留空不发送;JSON 原文保存并发送。默认 Content-Type 为 application/json,可在请求头覆盖。|解析规则 (JSON)|ƢƄ|Ɔ (分钟)|余额原币种|ơ折算(USD 余额)|使用显示汇率与精度;余额币种保持端点原币种。其他币种及积分不折算。|余额 {amount}|当日已用 {amount}|已用 {amount}|余额进度条 (蓝=余额,橙=当日,灰=已用)|进度条方向|各组进度条可独立选择填充方向:「Ȑ」满条起步、随消耗递减;「ș」空条起步、随消耗填满。|余额条(官方/自定义)|预算条|Go 额度条|Plan / Codex 额度条|Ȑ(满 → 空)|ș(空 → 满)|额度上限 (可选)|留空则Ȋ API 返回的 max_budget;仍无则显示整条浅蓝|JSON 格式无效|{{VAR_NAME}} 从凭据库或Ȧ读取。<ROUTE>_API_KEY 中 ROUTE 为大写 ȶ,符号改下划线,如 openai→OPENAI_API_KEY。同名共用密钥。|凭据白名单 (Ȳ)|请求头带密钥时仅放行列表内主机,留空则放行并警告,防导入他人配置外带密钥。|ȏ|为上方 {{VAR}} 占位符存入密钥(write-only,只写凭据库,不回显):|请求头还没有 {{VAR}} 占位符:填入如 "Authorization": "Bearer {{MY_API_KEY}}" 后这里会出现ȏ框。|启用|剩余 {remaining} · 已用 {spend} / 额度 {maxBudget} · 更新于 {time}|剩余 {amount}|刷新Ƣ|Ɓ ȯ|Go|滚动 5 小时|本周|本月|重置:{time}|已到重置时间|剩余 {d}天{h}小时|剩余 {h}小时{m}分|剩余 {m}分钟|已用 {pct}%|剩余 {pct}%|{percent}%|更新于 {time}|Go 额度Ƅ|Go 额度Ɔ(分钟)|分钟|Ɓ API Key(可选,Ƽ)|Go 额度主档位|Go Ɛ|已配置(来源:{source})|未配置|保存|编辑凭据|清除|保存中…|密钥只写入 DSH 凭据库,不保存在账本里,也不会回显。|以下密钥仍在Ɲ,未迁入凭据库。请导出对应Ȧ后重启:|预算Ɛ|刷新额度|ǥ|Anthropic(ɀ/Max)|Z.ai / 智谱 GLM Ƃ|MiniMax ƃ|ǿ|查询域名(HTTPS)|留空自动选择官方站点。填写后 Key 仅发往该域名;使用可信地址,不含路径。|5h|7d|打开 DeepSeek 充值页(platform.deepseek.com/usage)|ChatGPT (Codex) 周额度|显示 Codex 额度(需安装并登录 dsh-openai-codex)|在ȍ Codex 额度(关闭后仍保留会话额度条)|本dž包含子代理|暂无Ǔ|Ƅ|选「ƴ / 两者」ǣ卡片;窄栏显示百分比。|API Key(可选,Ƽ)|Ɔ(分钟)|刷新|登录|登录中…|ǥ|CLIProxyAPI 网关额度|添加来源|来源名称|ɏ|Ƅ|Ɔ(分钟)|允许的 Host|Management Key(只写)|状态|不支持的 Provider|未知|未发现账号|抓取于 {time}|切换账号 (当前: {account})|只显示 Gemini 额度|刷新|先ȑ这一项|启用并保存Ƅ后可刷新|删除|ȑ后会排到最上面;点名称可展开该项自己的配置。Ƣ最多 8 条,网关来源最多 4 条。|未启用。开启后将按Ɔ查询该厂商的 Ǜ 额度并显示在这里。|开启后读取 Ɓ 的滚动 5 小时、周、月额度,显示在侧栏、设置页及右下角;无订阅时提示原因。|Ơ(dock)|在Ơ Ɓ 额度 / 预算|滚动 5 小时额度|本周额度|本月额度|ȴ%|5h|周|月|日|预算|账本读取失败:{message}|正在读取账本…|账本不可用|同步失败:{message}|LJ已清除。|清除失败:{message}|nj已关闭,Ʀ|尚未生效(ȧ:{time}),当前Ʀ|ț峰时段,按峰Ɯ|当前为 DeepSeek 峰时高价时段,按峰Ɯ|ț谷时段,按谷Ɯ|ȕ——全谷价(周六及周日全天按谷Ɯ)|ȕ——全谷价|周末全谷|Ǐ——全天谷价|Ǐ——全谷价|假日|Ǐ(北京日期,Ȳ)|自 2026-08-23 北京时间 00:00 起,周末和Ɖ;调休上班的周末仍按谷价。|峰时|平价|Nj条样式|简洁(单行紧凑)|经典(分段与胶囊芯片)|峰/谷切换前弹窗提醒|提前提醒(分钟,1-30)|提醒类型|进入峰时|进入谷时|峰和谷|Ȓ峰时|Ȓ谷时|约 {time} 后计费档位切换为{phase}价,请注意本时段调用成本。|峰时|谷时|知道了|峰价提醒|谷价提醒|弹窗位置|右下角|屏幕中心|同步发送系统通知|开关后请在浏览器地址栏允许通知权限,才能在页面最小化/切走时收到提醒。|预览弹窗|预览 进入峰|预览 进入谷|(预览)|nj与提示|提示已隐藏:需启用nj并开启「Ɗ」。|常规|金额与币种|侧边栏显示|简化ȍ|精简卡片,保留金额、额度和悬停详情;高度最多占屏幕 38%,超出可滚动。关闭后恢复。|试试更轻巧的侧栏|ȩ可以为ȋ留出更多空间。要ǧ?之后可在「设置 → 费用 → 显示」中切换。|开启ȩ|保留当前显示|设置未能保存。可重试,或Ȏ后在设置中调整。|Ȏ|今日 / {period}预算|侧边栏进度条样式|标准|紧凑(两列)|恢复已移除的模型 ({count})|移除会清除手动映射并隐藏此行,可恢复;不会删除用量记录,后续按Ɵ规则计价。|右下角角标|Ɛ|ƍ|按厂商和模型分类的参考价。挂载后可编辑并计费;DeepSeek Lj后Ȩ。|展开ƍ|收起ƍ|挂载|Lj|已挂载|未核价|DeepSeek Lj后按默认价计费。|按模型统计(token 与费用)|侧栏ȣ|{n} 模型|其它|显示ȣ卡片|默认展开|记住展开状态|显示 Token|显示费用占比条|Ơ Top-1 模型|默认周期|收起摘要|卡片位置|模型行数(1–10)|Ɔ(10–60 秒)|周期总额与模型数|Top-1 模型与金额|顶部|余额之后|底部|今日|近 90 天|费用排行|Token 消耗|Ȭ率|未上报?|长调用无Ȭ:代理可能移除ȭ。金额按全未命中计,是上界;可直连核对。|性价比 · 每美元 token 数|输入|缓存|输出|该时段暂无用量数据。|综合单价 {price}/M|命中率=缓存读÷(缓存读+普通输入);「未上报?」表示ȭ可能缺失,金额为上界。单价=费用÷token×1M;性价比=token÷费用。|未分模型(ȟ · 按当时记录计费)|本会话 {amount}(API)· Plan 等值 {planAmount} · 命中 {hitRate} · 输入 {input} · 缓存 {cache} · 输出 {output}|本会话 {amount}(API)· Plan 等值 {planAmount}|费用 {amount}(+Plan)|Plan ȯ消耗(等值){amount}|ƃ ǐ(每 1% 与满窗估算)|尚无 Ƃ Ǔ;请在「额度」页开启并刷新厂商。|窗口|已用 %|本周期实际(Ɲ)|每 1% 额度 ≈|满窗 100% ≈|重置 {time}|采样差分|当前用量折算|样本不足|{method}(基准 {time})|读数精度受限|Plan 用量曲线(按ȳ聚合)|每日|每周|每月|采样不足:至少两次成功刷新,且Ǫ发生变化。|{date}:满窗估计 ≈ {full}(每 1% ≈ {per1})· 实际 {tokens} / {cost} · {intervals} 个ȳ|金额是目录价等值;订阅耗额度,预算只计 API。估算仅含 dsh 调用;服务端百分比含全账号。短时样本精度有限;5h 滚动,周/月按本地日历。|计费方式|Plan 订阅|自动|API 按量|在ȰǑ|仅控制是否在费用价格表Ǒ;不影响挂载和计费。隐藏的已挂载模型仍可Ȗ编辑。|可逐模型切换Ƅ。DeepSeek 默认Ǒ,第三方默认Ȗ。|手动新增模型|未知模型名Ɵ|自动(去后缀 / 前缀 / 家族相似)|仅精确匹配|Ǎ优先;Ɵ只接受同名及日期、版本、上下文后缀。未命中的 DeepSeek Ȩ,其他渠道不计价。|最近出现但未Ƥ|ȱ没有价格。可Ǎ;「默认价」使用 DeepSeek 默认价。本地推理默认零费用。|DeepSeek 默认价|移除|本地模型(零消耗)|本月已Ƥ|ȱƟ价格。可改选价格或零费用;token 仍统计。保存后移入Ǎ区。|保持自动命中|暂无手动匹配覆盖。|已挂载(参与计费)|输入|缓存|输出|DeepSeek 价格表(已挂载)|Kimi / Moonshot|OpenRouter|SiliconFlow 硅基流动|CommandCode|SCNet 超算互联网 ƃ|ȥ ǘ Ƃ|千问 Qwen ƃ|小米 MiMo ƃ|套餐积分|补偿积分|余额|额度来源|ǎ|官方 CLI|百炼 CLI|CLI 模式需在 DSH ȉ @qianwenai/qianwen-cli,并Ə qianwen Ʊ。|百炼 CLI:在 DSH ȉ bailian-cli。登录按钮会在该主机打开授权浏览器;远程或无界面主机请Ə bl Ʊ --console。|月度 Credits 额度(个人版 Lite 5 万 / 标准版 50 万,以订阅页为准)|Ǩ(可选,格式 YYYY-MM-DD;ƻ)|Credits 抵扣率覆盖(可选;每百万 token 抵扣的 Credits,留空用内置表)|模型名,如 qwen3.8-max-preview|费率|输入|缓存读|输出|待填齐三项正数后ƞ;全部清空恢复内置表。|添加|Credits ǎ,以控制台为准。只计 qwen 及 qwen/qianwen-tokenplan 订阅渠道,含 llm- 前缀;不计按量 API。Ȯ需设抵扣率。|ǎ月度 Credits 额度(基础 60,000 / 标准 240,000 / 高级 600,000)|Ǩ(可选,格式 YYYY-MM-DD;ƻ)|优先用 24 小时内的控制台快照,否则按Ɲ和官方 Credits 表估算。其他工具和Ȯ不计入。|Ȥ ǽ|Ȥ SecretAccessKey|ȥ需 AK/SK、ArkReadOnlyAccess 和 BillingCenterReadOnlyAccess;可填凭据或导出 VOLC_ACCESSKEY/VOLC_SECRETKEY。只连接 open.volcengineapi.com。|AK...|SK...|{h}小时|{h}小时{m}分|{m}分钟|{time}后进入平价|{time}后进入高峰|峰时段(UTC):{windows};ȧ:{time}。{status}|未配置Nj。{status}|未知|ƚ|本月费用|ȫ|自账本建立以来 · 调用 {calls} 次|外部用量|DSH + 外部合计|外部快照超过 24 小时未更新|近期每日记录|金额取最近快照,可能比官方账单晚几分钟。tokens 含输入、输出、缓存和推理;推理并入输出计费。以金额对账。|今日/本月按宿主时区 {host},浏览器为 {browser}。时区不同会影响日界和对账;可将 dsh 改为本地时区。|今日会话|点击日期行可展开当日ƛ|ƛ加载中…|该日无ƛ(ȟ或Ȍ已清理)|ƛ加载失败|按会话统计(全部历史)|跨天合并,子代理按开关归并。仅列选定条数,ȫ包含全部对话。|ȡ数据|Ƶ中…|Ƶ失败|显示条数|ȋ附显会话 ID|金额含 Plan 总额|开启后所有金额按含 Plan 订阅等值的总费用展示;关闭(默认)仅计真金白银 API 渠道|隐藏Ƹ(ƹ与设置页ȈȘ)|隐藏今日消耗金额(ƹ/预算明细/概览卡片Ȉƚ)|隐藏标题栏ƽ|隐藏输入框下方ƽ|隐藏每轮回复后的本轮费用|排序|费用 高→低|费用 低→高|时间 新→旧|时间 旧→新|实时顺序|LJ|计费统计需要 DSH 0.2.0-rc.2 或更新版本的模块加载器。|Token ǐ|累计 {tokens} tokens · 输入 {input} · 缓存 {cache} · 输出 {output} · {calls} 次调用|{date}:共 {tokens} tokens(输入 {input} · 缓存 {cache} · 输出 {output})· {calls} 次调用 · {cost}|暂无ȓ,Ǥ每日用量会Ǧ|用量|Token ǐ位置|Ȱ|通用设置|独立分节(用量)|Ƞ|概览|额度|用量|价格|显示|ȓ|džƄ|ǩ|会话标题栏|关闭|Ǝǔ|启用ǔ(Ǝ一条横排显示)|横条含ȴ%|横条含 Go 额度|横条含 Ƃ 额度|横条Ȝ各窗口重置时刻与Ȣ;无可用Ǔ时自动隐藏。|新增:Ǝǔ|在Ǝ显示预算及 Ɓ/Ƃ Ǫ。ǧ?可在「设置 → Ƞ」修改。|开启横条|暂不开启|点击立即刷新|新增:余额图框点击刷新|点击侧边栏余额或 Ƃ 图框即可刷新;刷新时图框闪烁,失败时保留原值并在悬停提示中说明原因。|知道了|当日费用显示|侧边栏底部|货币单位|人民币 CNY|美元 USD|欧元 EUR|货币符号|汇率(1 美元 = ? 目标币种)|小数位数|余额Ƅ|ƴ|设置页|两者都显示|余额Ɔ(分钟)|启用 DeepSeek Nj价格|Ɗ(侧边栏预算框/ƚ;设置页峰谷面板内预览)|会话ȝ价格计费(含峰谷与历史档位)。输入、输出、缓存读写分开统计;独立缓存写入价与长上下文档位按配置生效。|价格表(美元 / 1ȵ)|ȗ币种|美元(英Ȟ)|人民币(中Ȟ)|决定lj所用的官方页语言。切换并同步后后台重算历史;日志不全的会话保留原价。完成后提示。|ȝ间计价:Flash 自 9 月 10 日北京 12:00 用新价,V4 Pro 自 9 月 14 日同刻用 Flash 价;此前用历史价。工作日 09–12、14–18 峰价翻倍;周末及Ɖ。缓存Ʒ。|这里显示当前适用价格。手工编辑会取消此条后续预定调价,已发生的历史价格仍保留。|default(未匹配模型时回退)|新模型 ID(如 deepseek-v4-pro)|添加模型|数据与同步|保存中…|ƞ失败:{message}|已ƞ {time}|配置修改后ƞ|确认用NJ价格覆盖价格表?|应用|取消|从NJlj|官方同步只更新 DeepSeek 价格(含峰谷);z-ai/Kimi/Qwen/Volcano 等第三方价格随版本更新,也可在ƍ或模型名匹配中调整。|确认ƺ?|ƥ|确认导入?将回放全部Ȍ,只补账本缺失的日期与会话,不影响已有记录。|ƥ失败:{message}|首次启动自动导入旧记录;拷入日志后可重跑。按当前价格回推;已删除日志无法回放,跨安装时刻的会话不计此前用量。|确认清除|ƺ|最近同步:{time}|从未(使用内置价格)|;来源:{source}|NJ|内置默认|界面语言|跟随 DSH(自动)|简体中文|English|费用|{method} ǒ|同步ǒ|余额刷新ǒ'],["en",`Cost of this session (ǂ each call time)|Input {input} · Cache {cache} · Output {output}|Cache: read {read} · write {write} (writes Ǽ the hit price)|Cost {amount}|Ɨ {amount} · Hit {hitRate} · Input {input} · Cache {cache} · Output {output}|Ɨ {amount}|Amount only below Ȇ (full split ɑ)|Unlimited|CNY totals use USD prices × {rate}. To compare official CNY bills, select CNY, then sync prices; syncing also updates historical costs.|Ƨ: {message}|Unknown error|Balance|Query failed|DeepSeek open-platform account balance|Cross-check official balance changes against the ǃ (warn when they diverge)|Total {amount}|Granted {granted} · Topped-up {toppedUp}|Updated {time}|Budget ({period})|Used {used} / {amount}|Today {amount} · {pct} of budget|ư {month} · ǫ {total}|Budget|Today's cost (ǂ official prices)|Today's token usage|tokens|Calls {calls} · Input {input} · Cache {cache} · Output {output}|ư {amount}|ǫ {amount}|Today|Sidebar today display|Cost|ƪ|Today|ư|ǫ|Custom range|ǭ. Once you start chatting, costs are aggregated here per day.|Date|Calls|In tok|Cache tok|Out tok|Cost|Ƀs recorded today.|Session|Enable budget|Budget amount (in Ɣ)|Budget period|Start date|End date (empty = today)|Range: {range}|Enable a budget to see its limit, used amount and percentage in the Ɣ. Choose today, month, all time or a custom range.|{period} budget {amount} · Used {used} · {pct}%| (over limit)| (near limit)|Legacy|Default fallback|Remove|Base|Off-peak|Peak|Balance API key|This Open Platform key takes priority; otherwise the signed-in ƒ is read, then model credentials.|Total {total} · Granted {granted} · Topped-up {toppedUp} · Updated {time}|Ƨ: {message}|Balance not queried|Account balance|Refreshing…|Refresh balance|Custom provider balance|Add entry|Add Qianwen / Ƕ balance|Shows Ƕ China funds. ǹ needs bss:DescribeBillingAccount. The first two fields are required; Ǯ is for STS. Secrets stay in the credential store.|Extract accepts paths, numbers and add/subtract/divide. Divide Ȁ by 500000 for USD.|Chinese name|English name|Request URL|HTTP method|Headers (JSON)|Request body (JSON)|Blank sends no body; JSON text is saved and sent as entered. Content-Type defaults to application/json; headers can override it.|Extract rules (JSON)|Custom balance display|Ƈ (minutes)|Source currency|Convert USD balance to Ɣ|Uses the display rate and precision. Keep the source currency; other currencies and credits Ǵ.|Balance {amount}|Today {amount}|Spent {amount}|Balance progress bar (blue=balance, orange=today, gray=spent)|Progress bar direction|Each group of bars can independently choose its fill direction: "Remaining" starts full and drains with usage; "Used" starts empty and fills up.|Balance bars (official/custom)|Budget bar|ƨ bar|Plan / Codex quota bars|Remaining (full → empty)|Used (empty → full)|Budget cap (optional)|Leave ɐ use API max_budget; if still missing, show full light-blue bar|Invalid JSON|{{VAR_NAME}} reads ȃ or environment variable. <ROUTE>_API_KEY uses an uppercase ȶ with underscores, such as openai→OPENAI_API_KEY. Names can share a key.|Ƿ (comma-separated)|When headers carry credentials only listed hosts are allowed; leave ɐ allow with a warning. Protects keys when importing someone else's config.|Credential input|Store the key for each {{VAR}} placeholder above (write-only: stored in Ɠ, DŽ):|No {{VAR}} placeholders in the headers yet — add e.g. "Authorization": "Bearer {{MY_API_KEY}}" and ȃ input will appear here.|Enable|Remaining {remaining} · Spent {spend} / Budget {maxBudget} · Updated {time}|Remaining {amount}|Refresh custom balance|Ɓ Ʋ|Go|Rolling 5h|Weekly|Monthly|Resets: {time}|Reset time reached|{d}d {h}h left|{h}h {m}m left|{m}m left|{pct}% used|{pct}% remaining|{percent}%|Updated {time}|ƨ ƈ|ƨ Ɩ (minutes)|min|Ɓ API key (optional; empty = auto-detect)|ƨ primary window|Go ȷ|Configured (source: {source})|Not configured|Save|Edit credential|Clear|Saving…|The key is written to Ɠ only — it is never saved in ǵ and DŽ.|These credentials remain in the ǃ. Export the matching environment variables and restart:|Budget ȷ|Refresh quota|ǀ|Anthropic (ɀ/Max)|Z.ai / Zhipu GLM Ƃ|MiniMax ƃ|ǿ|Quota origin (HTTPS)|Empty: official sites. Otherwise the Key is sent only to this origin. Use a trusted address ɍ path.|5h|7d|Open DeepSeek top-up page (platform.deepseek.com/usage)|ChatGPT (Codex) weekly quota|ǖ (requires signed-in dsh-openai-codex)|ǖ in sidebar (keep the conversation strip when hidden)|Include subagents ɇ cost|No dz|Display position|“Ǿ / Both” shows a quota card; the narrow rail shows percentages.|API key (optional; empty = auto-detect)|Ƈ (minutes)|Refresh|Login|Signing in…|ǀ|CLIProxyAPI gateway quotas|Add source|Source label|ɏ|Display|Ƈ (minutes)|Ƿ|Management key (write-only)|Status|Unsupported providers|Unknown|No accounts|fetched {time}|Switch account (current: {account})|Gemini quota only|Refresh|Enable this item first|Ɂ save a ƈ Ƴ|Remove|Enabled items Ⱥ top; click a name ǻ own settings. Up to 8 custom balances and 4 gateway sources.|Disabled. ɉ to query this vendor's Ǜ quota on the Ɩ and show it here.|Enable Ɓ rolling 5h, weekly and monthly quotas in ȿ, Settings and bottom-right corner. Missing subscriptions show a reason.|Bottom-right (dock) display|Show Ɓ quota / budget at the bottom-right|Rolling-5h quota|Weekly quota|Monthly quota|Budget used %|5h|Wk|Mo|Daily|Budget|Ledger read failed: {message}|Reading ledger…|Ledger unavailable|Sync failed: {message}|History cleared.|Clear failed: {message}|Peak/ƕ is off; ǟ used|Not yet effective (effective at {time}); ǟ currently used|Peak hour now; Ȼ apply|Ư pricing is active; current calls are Ǽ Ȼ|Off-peak now; Ǡ apply|Weekend — ǁ (Sat & Sun Ǽ Ǡ all day)|Weekend — ǁ|Weekend|Chinese public holiday — off-peak all day|Public holiday — ǁ|Holiday|Public holidays (Beijing dates, comma separated)|Since Aug 23, 2026 (Beijing time), ƀ all day, including work-shift weekends.|Peak|Off-peak|Peak period strip style|Compact (one-line)|Classic (segments & chip)|Popup alert before peak/off-peak switch|Lead time (minutes, 1-30)|Alert type|Ǹ|ƿ|Both|Ǹ Ɇ|ƿ Ɇ|Billing switches to {phase} pricing in about {time}; mind your call costs in this window.|peak|off-peak|Got it|Peak alert|Off-peak alert|Popup position|Bottom-right|Screen center|Also send a system notification|When enabled, allow notification permission in the browser address bar so you get alerted even when the page is minimized or backgrounded.|Preview the popup|Ǖ peak|Ǖ off-peak| (preview)|Peak/ƕ & notice|Notice hidden: enable peak/ƕ and the “prominent notice” toggle.|General|Money & currency|Sidebar display|Simplify ȿ|Condense cards but keep amounts, quotas and hover details. Height is capped at 38% of the viewport with scrolling. Turn off Ɉ.|A lighter sidebar|Simple display leaves more room for conversations. ɉ now? You can change it ǜ → Cost → Display anytime.|Enable simple display|Keep current display|Settings could not be saved. Retry or dismiss this guide and change them later ǜ.|Dismiss guide|Today / {period} budget|Sidebar progress style|Standard|Compact (2 columns)|Restore removed models ({count})|Remove clears the override and hides the row until restored. Usage Ⱦ kept; automatic price matching applies.|Corner chips|Box details|Extended price catalog|Reference prices by vendor ɋ. Mount to edit and bill; unmounted DeepSeek uses its Ƒ.|Expand ƙ|Collapse ƙ|Mount|Unmount|Mounted|Unpriced|Unmounted ƅ.|Per-model statistics (tokens & cost)|Sidebar model costs|{n} models|Other|Show model cost card|Expand by default|Remember expansion|Show tokens|Show cost shares|Ɋ in corner dock|Default period|Collapsed summary|Card position|Model rows (1–10)|Ƈ (10–60 seconds)|Period total ɋ count|Ɋ and cost|Top|After balances|Bottom|Today|Last 90 days|Cost ranking|ƪ|Cache hit rate|unreported?|Zero cache hits on long calls may mean a relay removed cache fields. All-miss Ƙ; check with the direct API.|Value · tokens per USD|Input|Cache|Output|No usage data ȹ period.|blended {price}/M|Hit rate = ȸ ÷ (reads + uncached input). “Unreported?” means cache data may be missing, so Ƙ. Unit price = cost ÷ tokens × 1M; value = tokens ÷ cost.|Unattributed (Ʌ · billed as recorded)|Ɨ {amount} (API) · Ʉ. {planAmount} · Hit {hitRate} · Input {input} · Cache {cache} · Output {output}|Ɨ {amount} (API) · Ʉ. {planAmount}|Cost {amount} (+Plan)|Plan Ʋ usage (equiv.) {amount}|ƃ usage stats (per-1% & full-window estimates)|No Ƃ dz yet. Ɂ refresh a provider under Quotas.|Window|Used %|This period actual (ǃ)|Per 1% quota ≈|Full window (100%) ≈|resets {time}|sample delta|current usage ratio|not DZ|{method} (as of {time})|low reading precision|Plan usage curves (aggregated from sample intervals)|Daily|Weekly|Monthly|Not DZ: refresh successfully twice with a quota percentage change.|{date}: full-window est. ≈ {full} (per 1% ≈ {per1}) · actual {tokens} / {cost} · {intervals} sample interval(s)|Amounts are catalog-price equivalents. Plans use quota; budgets count API only. Estimates cover dsh calls, while server percentages cover the account. Short samples are less precise. 5h rolls; week/Ɍ local dates.|Billing class|Plan subscription|Auto|API usage|Show directly in Ʈ|Controls direct display in Ʈ; mounting and billing Ǵ. Hidden models remain editable in this catalog.|Choose where each model appears. DeepSeek shows directly; other vendors default to the catalog.|Custom models|Auto-match unknown model names|Auto (strip suffix / prefix / family similarity)|Exact match only|Manual overrides take priority. Auto-match accepts only the same name or date, version and context suffixes. Unknown ƅ; other providers stay unpriced.|Recently seen models ɍ price hit|Ȃ have no price. Assign one manually; “Default price” uses DeepSeek defaults. Local inference costs zero until assigned.|DeepSeek Ƒ|Remove|Local model (Ɏ)|Models matched this month|Ȃ matched automatically. Choose another price or Ɏ; tokens still count. Saved overrides Ⱥ manual list.|Keep auto match|No manual match overrides.|Mounted (billed)|Input|Cached|Output|DeepSeek ȼ (mounted)|Kimi / Moonshot|OpenRouter|SiliconFlow|CommandCode|SCNet ƃ|ǘ Ƃ|Qwen ƃ (qianwenai.com)|Xiaomi MiMo ƃ|Plan credits|Compensation|Balance|Quota source|Local estimate|Official CLI|Bailian CLI|Install @qianwenai/qianwen-cli ǡ and run qianwen Ʊ Ƭ.|Install bailian-cli ǡ. Login opens that host’s browser; for a remote or headless host, run bl Ʊ --console Ƭ.|ƣ (personal Lite 50K / Standard 500K; see your plan page)|Ǟ (optional, YYYY-MM-DD; empty = ǰ)|Credits rate overrides (optional; credits deducted per 1ȵ; empty = ǯ)|Model name, e.g. qwen3.8-max-preview|rate|Input|Cached input|Output|Enter all three positive rates to save automatically; clear all Ɉ the ǯ.|Add|Local Credits estimate; console is authoritative. Counts qwen and qwen/qianwen-tokenplan subscription routes, including llm- prefix. Excludes pay-as-you-go API. Add rates for other models.|ƣ for local estimates (Basic 60,000 / Standard 240,000 / Pro 600,000)|Ǟ (optional, YYYY-MM-DD; empty = ǰ)|Uses console snapshots newer than 24h, then estimates from local records and official Credits rates. Other tools and unlisted models are excluded.|Volcengine ǽ|Volcengine SecretAccessKey|ǘ needs AK/SK, ArkReadOnlyAccess and BillingCenterReadOnlyAccess. Enter credentials or export VOLC_ACCESSKEY/VOLC_SECRETKEY. Only open.volcengineapi.com is contacted.|AK...|SK...|{h}h|{h}h {m}m|{m}m|Off-peak in {time}|Peak in {time}|Peak hours (UTC): {windows}; effective: {time}. {status}|No peak windows configured. {status}|unknown|Today|ư|ǫ|Since ǵ was created · Calls {calls}|External usage|DSH + external total|External snapshot has not been updated for 24 hours|Recent daily records|Amounts use the latest snapshot and may lag Dž bill by minutes. Tokens include input, output, cache and reasoning; reasoning is billed with output. Reconcile by amount.|Today/Ɍ host timezone {host}; this browser uses {browser}. Different day boundaries affect reconciliation. Set dsh to your local timezone to align.|Today's sessions|Click a date row ǻ ƌ|Loading ƌ…|No ƌ ȹ day (Ʌ or ȅ cleaned)|Ǭ ƌ|By session (Ǚ)|Days combined; subagents follow settings. Selected rows shown; cumulative costs include every conversation.|Ƀ data yet|Loading Ǣ…|Ǭ Ǣ|Rows|Show session IDs ɇ lists|Include plan totals|When on, every amount shows total equivalent cost including plan subscriptions; off (default) counts real-money API channels only|Hide ƒ (balance UI ƫ and settings)|Hide ȇ (today's amount ƫ, budget details and overview card)|Hide header Ȅ|Hide composer Ȅ|Hide turn cost summaries|Sort|Cost high→low|Cost low→high|Time new→old|Time old→new|Recent order|History|Cost statistics requires the module loader from DSH 0.2.0-rc.2 or newer.|ƪ stats|All-time {tokens} tokens · input {input} · cache {cache} · output {output} · {calls} calls|{date}: {tokens} tokens (input {input} · cache {cache} · output {output}) · {calls} calls · {cost}|ǭ — daily usage will accumulate here|Usage|ƪ stats position|Ʈ|General settings|Own section (Usage)|Display settings|Overview|Quotas|Usage|Pricing|Display|History data|ȁ ƈ|Below Ȇ|Session title bar|Off|Quota strip Ƌ|ɂ Ƚ (one row Ƌ box)|Ʃ budget used %|Ʃ the ƨ|Ʃ Ǜ quotas|Hover a chip for reset times and the last refresh; the strip hides itself when there is no dz.|New: Ƚ Ƌ|Show budget and Ɓ/coding-plan percentages Ƌ box. Enable now? Change it anytime ǜ → Display.|ɂ strip|Not now|Click Ƴ now|New: click the balance box Ƴ|Click a sidebar balance or plan box Ƴ. It pulses while loading; on failure it keeps the old value and shows the reason ɑ.|Got it|Today cost display|Sidebar footer|Currency|Chinese Yuan (CNY)|US Dollar (USD)|Euro (EUR)|Currency symbol|Exchange rate (1 USD = ? target currency)|Decimal places|Balance ƈ|Ǿ|Settings page|Both|Balance Ɩ (minutes)|Use Ư prices|Prominent notice during peak hours (sidebar budget box, ȇ; previewed in the Settings peak panel)|ȁ uses call-time prices, Dz and Ǘ. Input, output, ȸ and writes are separate; configured cache-write and long-context rates apply.|Price table (USD / 1ȵ)|Official price currency|USD (English Ǻ)|CNY (Chinese Ǻ)|Selects Dž pricing-page language. Sync then recalculates history in the background; sessions without full logs keep their earlier basis.|Call-time prices: Flash changes Sep 10 04:00 UTC; V4 Pro uses Flash ǝ Sep 14 04:00 UTC. Earlier calls retain history. Mon–Fri peaks 01–04 and 06–10 UTC cost 2×; ƀ. Cache writes use hit rates.|Current rates are shown here. Editing cancels any future scheduled change ȹ entry; earlier Ǘ are retained.|default (fallback for unmatched models)|New model ID (e.g. deepseek-v4-pro)|Add model|Data & sync|Saving…|Auto-save failed: {message}|Auto-saved {time}|Settings are auto-saved|Overwrite the ȼ with ǝ Dž docs?|Apply|Cancel|Sync ǝ official docs|Official sync updates DeepSeek prices (Dz rates). Third-party prices (z-ai/Kimi/Qwen/Volcano) follow releases; edit in the extended catalog or model matching.|ƾ?|Import ƭ|Confirm import? Replays all ȅ and only fills dates/sessions missing from ǵ; existing Ⱦ untouched.|Failed to import ƭ: {message}|Pre-instǙ imports at first launch; rerun after copying old logs. Costs use current prices. Deleted logs cannot replay; sessions spanning installation exclude earlier usage.|Confirm clear|ƾ|Last sync: {time}|Never (bundled prices)|; Source: {source}|Official docs|Bundled|Language|Follow DSH (auto)|Simplified Chinese|English|Cost|{method} ǚ|Sync ǚ|Balance refresh ǚ`]].map(([t,o])=>{const s=o.replace(/[ƀ-ɿ]/g,a=>tn[a.charCodeAt(0)-384]).split("|");return[t,Object.fromEntries(en.map((a,n)=>[a,s[n]]).filter(([,a])=>a!=="\0"))]}));function la(){return(typeof navigator<"u"&&typeof navigator.language=="string"?navigator.language:"").toLowerCase().startsWith("zh")?"zh":"en"}function Ie(t){const o=typeof t=="string"?t.toLowerCase().split(/[-_]/)[0]:"";return o==="zh"||o==="en"?o:null}function F(t){const o=typeof t=="string"?t:t?.locale;return o==="zh"||o==="en"?o:Ie(t?.activeLocale)||la()}function z(t){const o=t==="zh"?Me.zh:Me.en;return(s,a)=>{let n=o[s]??Me.en[s]??s;if(a)for(const l of Object.keys(a))n=n.split("{"+l+"}").join(String(a[l]));return n}}const je={day:"periodDay",month:"periodMonth",all:"periodAll",custom:"periodCustomRange"};function ie(t,o){throw new Error("dsh-cost-meter: 服务端数据非法 ("+t+": "+o+")")}function pe(t,o){return(t===null||typeof t!="object"||Array.isArray(t))&&ie(o,"object"),t}function ae(t,o){return(typeof t!="number"||!Number.isFinite(t))&&ie(o,"number"),t}function se(t,o){return typeof t!="string"&&ie(o,"string"),t}const ot=(t,o,s)=>typeof t=="string"&&o.includes(t)?t:s;function ra(t,o=!1){return t===null||typeof t!="object"||Array.isArray(t)?{}:Object.fromEntries(Object.entries(t).filter(([s,a])=>o?s.length>0&&["plan","api"].includes(a):["auto","plan","api"].includes(a)))}function Ne(t,o){return typeof t!="boolean"&&ie(o,"boolean"),t}const qe=(t,o,s)=>Object.fromEntries(o.map(a=>[a,s(t[a])]));function ia(t,o){const s={};if(t!==null&&typeof t=="object"&&!Array.isArray(t))for(const a of Object.keys(t)){const n=t[a];if(n===null||typeof n!="object"||Array.isArray(n))continue;const l=r=>typeof r=="number"&&Number.isFinite(r)&&r>=0?r:0;s[a]={...qe(n,["input","output","cacheRead","cacheWrite","reasoning","cost"],l),apiCost:n.apiCost===void 0?l(n.cost):l(n.apiCost)}}return s}function ca(t,o){pe(t,o);const s={reasoning:t.reasoning===void 0?0:ae(t.reasoning,o+".reasoning"),apiCost:t.apiCost===void 0?void 0:ae(t.apiCost,o+".apiCost"),byModel:ia(t.byModel,o+".byModel"),byProviderModel:ia(t.byProviderModel,o+".byProviderModel")};for(const a of["input","output","cacheRead","cacheWrite","calls","cost"])s[a]=ae(t[a],o+"."+a);return s}function ua(t){return(Array.isArray(t)?t:ie("rows","array")).map(o=>({provider:se(o.provider,"provider"),model:se(o.model,"model"),bucket:se(o.bucket,"bucket"),tokens:ae(o.tokens,"tokens"),rate:ae(o.rate,"rate"),cost:ae(o.cost,"cost"),priced:Ne(o.priced,"priced"),plan:Ne(o.plan,"plan")}))}function wt(t,o){return{...ca(t,o),id:se(t.id,o+".id"),provider:typeof t.provider=="string"?t.provider:"",model:typeof t.model=="string"?t.model:""}}function fe(t,o){const s={...ca(t,o),date:se(t.date,o+".date"),sessions:[]};return t.sessions!==void 0&&(Array.isArray(t.sessions)||ie(o+".sessions","array"),s.sessions=t.sessions.map((a,n)=>wt(a,o+".sessions["+n+"]"))),s}function xt(t,o,s=["cacheWrite","reasoning"]){const a={};for(const n of["cacheHit","cacheMiss","output"])a[n]=ae(t[n],o+"."+n);for(const n of s)t[n]!==void 0&&(a[n]=ae(t[n],o+"."+n));return a}function vt(t,o){pe(t,o);const s=xt(t,o);for(const a of["offPeak","peak","legacyBase","longContext"])t[a]!==void 0&&(s[a]=xt(t[a],o+"."+a,["cacheWrite","reasoning","aboveInputTokens"]));t.cny!==void 0&&(s.cny=xt(t.cny,o+".cny")),t.legacy!==void 0&&(s.legacy=Ne(t.legacy,o+".legacy")),t.rateHistory!==void 0&&((!Array.isArray(t.rateHistory)||t.rateHistory.length>16)&&ie(o+".rateHistory","price history"),s.rateHistory=t.rateHistory.map((a,n)=>((!a||typeof a.before!="string"||!Number.isFinite(Date.parse(a.before)))&&ie(o+".rateHistory","dated price"),{...vt({...a,rateHistory:void 0},o+".rateHistory."+n),before:a.before})));for(const a of["billingMode","sourceUrl","checkedAt","notes"])typeof t[a]=="string"&&(s[a]=t[a]);return s}function an(t,o){const s=n=>n==null?void 0:{...n.adapter==="aliyun"?{adapter:"aliyun"}:{},enabled:n.enabled===!0,label:typeof n.label=="string"?n.label:"",labelEn:typeof n.labelEn=="string"?n.labelEn:"",display:ot(n.display,["sidebar","settings","off"],"both"),unit:["CNY","EUR","CREDITS"].includes(n.unit)?n.unit:"USD",convertToDisplayCurrency:n.convertToDisplayCurrency===!0,refreshMinutes:typeof n.refreshMinutes=="number"&&Number.isFinite(n.refreshMinutes)?n.refreshMinutes:15,request:n.request&&typeof n.request=="object"?n.request:{url:""},extract:n.extract&&typeof n.extract=="object"?n.extract:{},allowedHosts:Array.isArray(n?.allowedHosts)?n.allowedHosts.filter(l=>typeof l=="string"):[]};pe(t,o);const a={};if(t.prices!==null&&typeof t.prices=="object"&&t.prices.models!==null&&typeof t.prices.models=="object")for(const n of Object.keys(t.prices.models))a[n]=vt(t.prices.models[n],o+".prices.models."+n);return{locale:t.locale==="zh"||t.locale==="en"||t.locale==="auto"?t.locale:"auto",position:t.position==="header"||t.position==="off"?t.position:"dock",sidebar:t.sidebar!==!1,showSessionId:t.showSessionId===!0,hideOfficialBalance:t.hideOfficialBalance===!0,hideTodayCost:t.hideTodayCost===!0,...qe(t,["hideSessionCostHeader","hideSessionCostDock","hideTurnCost"],n=>n===!0),sessionCostCompact:t.sessionCostCompact===!0,contextCostsEnabled:t.contextCostsEnabled===!0,contextCostsPromptSeen:t.contextCostsPromptSeen===!0,sidebarTodayMetric:t.sidebarTodayMetric==="tokens"?"tokens":"cost",statisticsBasis:t.statisticsBasis,showTotalWithPlan:t.showTotalWithPlan===!0,sidebarSimple:t.sidebarSimple===!0,sidebarSimplePromptSeen:t.sidebarSimplePromptSeen===!0,sidebarModels:Object.fromEntries(Object.entries(Yt).map(([n,l])=>[n,t.sidebarModels?.[n]??l])),codexQuotaEnabled:t.codexQuotaEnabled===!0,codexQuotaSidebar:t.codexQuotaSidebar!==!1,includeSubagentCost:t.includeSubagentCost===!0,sidebarStyle:t.sidebarStyle==="compact"?"compact":"standard",priceMatchDismissed:Array.isArray(t.priceMatchDismissed)?t.priceMatchDismissed.filter(n=>typeof n=="string"):[],pricingCurrency:t.pricingCurrency==="CNY"?"CNY":"USD",currency:typeof t.currency=="string"?t.currency:"CNY",symbol:typeof t.symbol=="string"?t.symbol:"¥",decimals:ae(t.decimals,o+".decimals"),exchangeRate:ae(t.exchangeRate,o+".exchangeRate"),peakEnabled:t.peakEnabled===!0,peakEffectiveAt:typeof t.peakEffectiveAt=="string"?t.peakEffectiveAt:"",peakWindows:Array.isArray(t.peakWindows)?t.peakWindows.map((n,l)=>({start:ae(n.start,o+".peakWindows["+l+"].start"),end:ae(n.end,o+".peakWindows["+l+"].end")})):[],peakHolidays:Array.isArray(t.peakHolidays)?t.peakHolidays.filter(n=>typeof n=="string"):[],peakNotice:t.peakNotice!==!1,peakAlertEnabled:t.peakAlertEnabled!==!1,peakAlertAhead:Number.isFinite(t.peakAlertAhead)&&t.peakAlertAhead>=1&&t.peakAlertAhead<=30?t.peakAlertAhead:2,peakAlertTarget:t.peakAlertTarget==="peak"||t.peakAlertTarget==="offpeak"?t.peakAlertTarget:"both",peakAlertPosition:t.peakAlertPosition==="center"?"center":"corner",peakAlertWebNotify:t.peakAlertWebNotify===!0,peakStyle:t.peakStyle==="classic"?"classic":"compact",priceMatch:t.priceMatch==="exact"?"exact":"auto",priceOverrides:(()=>{const n={};if(t.priceOverrides!==null&&typeof t.priceOverrides=="object"&&!Array.isArray(t.priceOverrides))for(const[l,r]of Object.entries(t.priceOverrides))typeof l=="string"&&typeof r=="string"&&(n[l]=r);return n})(),priceTableDisplay:(()=>{const n={};if(t.priceTableDisplay!==null&&typeof t.priceTableDisplay=="object"&&!Array.isArray(t.priceTableDisplay))for(const[l,r]of Object.entries(t.priceTableDisplay))typeof l=="string"&&(n[l]=r===!0);return n})(),codingPlans:(()=>{const n={};if(t.codingPlans!==null&&typeof t.codingPlans=="object"&&!Array.isArray(t.codingPlans))for(const l of Object.keys(t.codingPlans)){const r=t.codingPlans[l];r===null||typeof r!="object"||Array.isArray(r)||(n[l]={enabled:r.enabled===!0,display:r.display==="sidebar"||r.display==="both"||r.display==="off"?r.display:"settings",refreshMinutes:typeof r.refreshMinutes=="number"&&Number.isFinite(r.refreshMinutes)?r.refreshMinutes:15,apiKey:typeof r.apiKey=="string"?r.apiKey:"",...l==="minimax"?{baseUrl:typeof r.baseUrl=="string"?r.baseUrl:""}:{},...l==="qwen"?{quotaSource:["cli","bailian"].includes(r.quotaSource)?r.quotaSource:"local"}:{},...typeof r.planCredits=="number"&&Number.isFinite(r.planCredits)&&r.planCredits>0?{planCredits:r.planCredits}:{},...typeof r.planStart=="string"?{planStart:r.planStart}:{},...r.rates!==null&&typeof r.rates=="object"&&!Array.isArray(r.rates)?{rates:r.rates}:{},...typeof r.accessKeyId=="string"?{accessKeyId:r.accessKeyId}:{},...typeof r.secretAccessKey=="string"?{secretAccessKey:r.secretAccessKey}:{}})}return n})(),prices:{models:a,default:vt(t.prices?.default??{cacheHit:0,cacheMiss:0,output:0},o+".prices.default"),providers:t.prices?.providers&&typeof t.prices.providers=="object"?t.prices.providers:{},currency:typeof t.prices?.currency=="string"&&t.prices.currency.length>0?t.prices.currency:void 0},historyDays:ae(t.historyDays,o+".historyDays"),fetchedAt:t.fetchedAt===null||t.fetchedAt===void 0?null:se(t.fetchedAt,o+".fetchedAt"),priceSource:typeof t.priceSource=="string"?t.priceSource:"bundled",budget:{enabled:t.budget?.enabled===!0,amount:typeof t.budget?.amount=="number"&&Number.isFinite(t.budget.amount)?t.budget.amount:100,period:t.budget?.period==="day"||t.budget?.period==="all"||t.budget?.period==="custom"?t.budget.period:"month",customStart:typeof t.budget?.customStart=="string"?t.budget.customStart:null,customEnd:typeof t.budget?.customEnd=="string"?t.budget.customEnd:null,detail:t.budget?.detail!==!1},balance:{display:ot(t.balance?.display,["sidebar","settings","off"],"both"),refreshMinutes:typeof t.balance?.refreshMinutes=="number"&&Number.isFinite(t.balance.refreshMinutes)?t.balance.refreshMinutes:5,showProgressBar:t.balance?.showProgressBar===!0,budgetCap:typeof t.balance?.budgetCap=="number"&&Number.isFinite(t.balance.budgetCap)&&t.balance.budgetCap>0?t.balance.budgetCap:null,clickHintSeen:t.balance?.clickHintSeen===!0},goQuota:{enabled:t.goQuota?.enabled!==!1,display:ot(t.goQuota?.display,["sidebar","settings","off"],"both"),refreshMinutes:typeof t.goQuota?.refreshMinutes=="number"&&Number.isFinite(t.goQuota.refreshMinutes)?t.goQuota.refreshMinutes:15,apiKey:typeof t.goQuota?.apiKey=="string"?t.goQuota.apiKey:"",main:t.goQuota?.main==="weekly"||t.goQuota?.main==="monthly"?t.goQuota.main:"rolling",detail:t.goQuota?.detail!==!1},customBalance:s(t.customBalance),gatewayQuotas:(()=>{const n=Array.isArray(t.gatewayQuotas)?t.gatewayQuotas:t.gatewayQuotas?.sources;return{sources:Array.isArray(n)?n.slice(0,4).filter(r=>r!==null&&typeof r=="object"&&!Array.isArray(r)).map(r=>({id:typeof r.id=="string"?r.id.slice(0,48):"",type:"cliproxyapi",label:typeof r.label=="string"?r.label.slice(0,80):"",baseURL:typeof r.baseURL=="string"?r.baseURL:"",enabled:r.enabled!==!1,display:ot(r.display,["sidebar","settings","off"],"both"),refreshMinutes:typeof r.refreshMinutes=="number"&&Number.isFinite(r.refreshMinutes)?Math.min(1440,Math.max(1,Math.floor(r.refreshMinutes))):15,includeProviders:Array.isArray(r.includeProviders)?[...new Set(r.includeProviders.filter(i=>typeof i=="string").map(i=>i.toLowerCase()).filter(i=>Ct.includes(i)))]:Ct,allowedHosts:Array.isArray(r.allowedHosts)?r.allowedHosts.filter(i=>typeof i=="string").slice(0,16):[],allowInsecureHttp:r.allowInsecureHttp===!0,antigravityOnlyGemini:r.antigravityOnlyGemini===!0,keyVar:typeof r.keyVar=="string"?r.keyVar:""})):[]}})(),customBalances:(()=>{if(Array.isArray(t.customBalances))return t.customBalances.filter(l=>l!==null&&typeof l=="object").slice(0,8).map(s).filter(Boolean);const n=s(t.customBalance);return n?[n]:[]})(),corner:{enabled:t.corner?.enabled===!0,goRolling:t.corner?.goRolling!==!1,goWeekly:t.corner?.goWeekly!==!1,goMonthly:t.corner?.goMonthly!==!1,budget:t.corner?.budget!==!1},quotaStrip:{enabled:t.quotaStrip?.enabled===!0,budget:t.quotaStrip?.budget!==!1,go:t.quotaStrip?.go!==!1,plans:t.quotaStrip?.plans!==!1,promptSeen:t.quotaStrip?.promptSeen===!0},usage:{position:t.usage?.position==="general"||t.usage?.position==="section"?t.usage.position:"cost"},barDirections:(()=>{const n=t.barDirections!==null&&typeof t.barDirections=="object"&&!Array.isArray(t.barDirections)?t.barDirections:{},l=(r,i)=>n[r]==="remaining"||n[r]==="used"?n[r]:i;return{balance:l("balance","remaining"),budget:l("budget","used"),go:l("go","used"),plan:l("plan","used")}})(),planBilling:{providers:ra(t.planBilling?.providers),models:ra(t.planBilling?.models,!0)}}}const Ue=t=>typeof t=="number"&&Number.isFinite(t)?t:null,Se=t=>Ue(t)??0,nn={status:"off",message:"",fetchedAt:0,currency:"",totalBalance:0,grantedBalance:0,toppedUpBalance:0},on={status:"off",message:"",fetchedAt:0,rolling:null,weekly:null,monthly:null},da=(t=null)=>({status:"off",message:"",fetchedAt:0,label:"",unit:"USD",remaining:0,maxBudget:null,spend:null,index:t});function Nt(t,o){return pe(t,o),{status:t.status==="ok"||t.status==="error"?t.status:"off",message:typeof t.message=="string"?t.message:"",fetchedAt:typeof t.fetchedAt=="number"?t.fetchedAt:0}}function sn(t,o){return{...Nt(t,o),keyConfigured:t.keyConfigured===!0,keySource:typeof t.keySource=="string"?t.keySource:"",currency:typeof t.currency=="string"?t.currency:"",totalBalance:Se(t.totalBalance),grantedBalance:Se(t.grantedBalance),toppedUpBalance:Se(t.toppedUpBalance)}}function St(t,o){return t==null?null:((typeof t!="object"||Array.isArray(t))&&ie(o,"object"),{percent:Se(t.percent),resetsAt:typeof t.resetsAt=="string"?t.resetsAt:""})}function ln(t,o){return{...Nt(t,o),rolling:St(t.rolling,o+".rolling"),weekly:St(t.weekly,o+".weekly"),monthly:St(t.monthly,o+".monthly")}}function ma(t,o){return{...Nt(t,o),label:typeof t.label=="string"?t.label:"",unit:typeof t.unit=="string"?t.unit:"USD",remaining:Se(t.remaining),maxBudget:Ue(t.maxBudget),spend:Ue(t.spend),index:typeof t.index=="number"&&Number.isFinite(t.index)&&t.index>=0?Math.floor(t.index):null}}const rn=new Set(["ok","partial","unknown","error","stale","unsupported","capability_missing"]),cn=new Set(["off","loading","ok","partial","stale","error"]),Ct=["antigravity","claude","codex","kimi","xai","workbuddy"],pa={antigravity:"Antigravity",claude:"Claude",codex:"Codex",kimi:"Kimi",xai:"xAI",workbuddy:"WorkBuddy"};function un(t,o){pe(t,o);const s=(r,i="")=>typeof r=="string"?r:i,a=r=>Ue(r),n=r=>r!==null&&typeof r=="object"&&!Array.isArray(r)?{id:s(r.id),label:s(r.label),...a(r.percent)===null?{}:{percent:a(r.percent)},resetsAt:s(r.resetsAt),periodHours:a(r.periodHours),scope:s(r.scope)}:null,l=r=>r!==null&&typeof r=="object"&&!Array.isArray(r)?{unit:s(r.unit,"credits"),used:a(r.used),remaining:a(r.remaining),limit:a(r.limit),fetchedAt:s(r.fetchedAt),packages:Array.isArray(r.packages)?r.packages.filter(i=>i!==null&&typeof i=="object"&&!Array.isArray(i)).map(i=>({id:s(i.id),label:s(i.label),used:a(i.used),remaining:a(i.remaining),limit:a(i.limit),startsAt:s(i.startsAt),resetsAt:s(i.resetsAt)})):[]}:void 0;return{id:s(t.id),type:"cliproxyapi",label:s(t.label),status:cn.has(t.status)?t.status:"error",message:s(t.message),fetchedAt:a(t.fetchedAt)??0,attemptedAt:a(t.attemptedAt)??0,serverVersion:s(t.serverVersion),keyConfigured:t.keyConfigured===!0,keySource:s(t.keySource,"none"),accounts:Array.isArray(t.accounts)?t.accounts.filter(r=>r!==null&&typeof r=="object"&&!Array.isArray(r)).slice(0,16).map(r=>({id:s(r.id),provider:s(r.provider,"unknown"),label:s(r.label,"unknown"),status:rn.has(r.status)?r.status:"unknown",message:s(r.message),plan:s(r.plan),windows:Array.isArray(r.windows)?r.windows.map(n).filter(Boolean):[],credits:l(r.credits)})):[],unsupportedProviders:Array.isArray(t.unsupportedProviders)?t.unsupportedProviders.filter(r=>typeof r=="string").slice(0,32):[]}}function dn(t){if(t===null||typeof t!="object"||Array.isArray(t))return null;const o={};if(t.providers!==null&&typeof t.providers=="object"&&!Array.isArray(t.providers))for(const[s,a]of Object.entries(t.providers)){if(a===null||typeof a!="object"||Array.isArray(a))continue;const n={},l={};if(a.windows!==null&&typeof a.windows=="object"&&!Array.isArray(a.windows))for(const[r,i]of Object.entries(a.windows))i===null||typeof i!="object"||Array.isArray(i)||(n[r]={...qe(i,["percent","localTokens","localCost","sampleCount"],Se),...qe(i,["sampleAt","per1Tokens","per1Cost","fullTokens","fullCost"],Ue),resetsAt:typeof i.resetsAt=="string"?i.resetsAt:"",method:i.method==="sample"||i.method==="live"?i.method:"none",confidence:i.confidence==="high"||i.confidence==="low"?i.confidence:null});if(a.intervals!==null&&typeof a.intervals=="object"&&!Array.isArray(a.intervals))for(const[r,i]of Object.entries(a.intervals))Array.isArray(i)&&(l[r]=i.filter(d=>d!==null&&typeof d=="object"&&!Array.isArray(d)).map(d=>qe(d,["t0","t1","tokens","cost","pct","per1Tokens","per1Cost"],Se)));o[s]={windows:n,intervals:l}}return{generatedAt:Se(t.generatedAt),providers:o}}function fa(t,o){return pe(t,o),{today:fe(t.today,o+".today"),month:fe(t.month,o+".month"),total:fe(t.total,o+".total"),budgetUsed:typeof t.budgetUsed=="number"&&Number.isFinite(t.budgetUsed)?t.budgetUsed:void 0,balance:t.balance==null?nn:sn(t.balance,o+".balance"),goQuota:t.goQuota==null?on:ln(t.goQuota,o+".goQuota"),customBalance:t.customBalance==null?da():ma(t.customBalance,o+".customBalance"),customBalances:Array.isArray(t.customBalances)?t.customBalances.filter(s=>s!==null&&typeof s=="object").map((s,a)=>ma(s,o+".customBalances["+a+"]")):[],gatewayQuotas:Array.isArray(t.gatewayQuotas)?t.gatewayQuotas.filter(s=>s!==null&&typeof s=="object"&&!Array.isArray(s)).map((s,a)=>un(s,o+".gatewayQuotas["+a+"]")):[],customVarStatus:t.customVarStatus!==null&&typeof t.customVarStatus=="object"&&!Array.isArray(t.customVarStatus)?Object.fromEntries(Object.entries(t.customVarStatus).filter(([,s])=>s!==null&&typeof s=="object").map(([s,a])=>[s,{configured:a.configured===!0,source:typeof a.source=="string"?a.source:""}])):{},codingPlans:t.codingPlans!==null&&typeof t.codingPlans=="object"&&!Array.isArray(t.codingPlans)?t.codingPlans:{},planStats:dn(t.planStats),history:Array.isArray(t.history)?t.history.map((s,a)=>fe(s,o+".history["+a+"]")):[],externalUsage:t.externalUsage&&Array.isArray(t.externalUsage.sources)?{fetchedAt:Number(t.externalUsage.fetchedAt)||0,stale:t.externalUsage.stale===!0,sources:t.externalUsage.sources.map(s=>({source:String(s.source),today:fe(s.today,o+".external.today"),month:fe(s.month,o+".external.month"),total:fe(s.total,o+".external.total"),history:(s.history??[]).map(a=>fe(a,o+".external.history"))})),combined:Object.fromEntries(["today","month","total","history"].map(s=>[s,s==="history"?(t.externalUsage.combined.history??[]).map(a=>fe(a,o+".external.history")):fe(t.externalUsage.combined[s],o+".external."+s)]))}:null,config:an(t.config,o+".config"),reconcile:t.reconcile===null||t.reconcile===void 0?void 0:{ok:t.reconcile.ok===!0,message:typeof t.reconcile.message=="string"?t.reconcile.message:""},priceCatalog:t.priceCatalog!==null&&typeof t.priceCatalog=="object"&&!Array.isArray(t.priceCatalog)?t.priceCatalog:null,meta:{...Ie(t.meta?.locale)?{locale:Ie(t.meta.locale)}:{},now:typeof t.meta?.now=="number"?t.meta.now:Date.now(),timezoneOffsetMinutes:typeof t.meta?.timezoneOffsetMinutes=="number"?t.meta.timezoneOffsetMinutes:0,timezone:typeof t.meta?.timezone=="string"?t.meta.timezone:"",dayKey:typeof t.meta?.dayKey=="string"?t.meta.dayKey:"",monthKey:typeof t.meta?.monthKey=="string"?t.meta.monthKey:""}}}function mn(t,o){pe(t,o);const s={ok:t.ok===!0,message:typeof t.message=="string"?t.message:""};return t.state!==void 0&&t.state!==null&&(s.state=fa(t.state,o+".state")),s}function ne(t){return{parse:t}}const At=ne(fa),pn=ne(t=>pe(t,"patch")),fn=ne(mn),Mt=ne(t=>se(t,"provider")),bn=ne(t=>{if(t!=null)return(typeof t!="number"||!Number.isInteger(t)||t<0||t>7)&&ie("index","0-7 integer"),t}),gn=ne(t=>se(t,"date")),hn=ne(t=>pe(t,"day")),yn=ne(t=>(Number.isFinite(Number(t))||ie("limit","number"),Number(t))),ba=ne(t=>se(t,"sort")),kn=ne(t=>pe(t,"topSessions")),ga=ne(t=>se(t,"target")),wn=ne(t=>se(t,"value")),ye=(t,o)=>({mode:"strict",typeSymbol:"dsh-cost-meter#"+t,schema:o,create:()=>o}),le=(t,o,s,a=!1)=>({name:t,wire:t,source:"json",codec:ye(o,s),...a?{acceptsUndefined:!0}:{}}),xn={package:"dsh-cost-meter",descriptors:[...["getState","getLocalState"].map(t=>({method:t,result:ye("CostState",At)})),{method:"updateConfig",parameters:[le("patch","ConfigPatch",pn)],result:ye("CostState",At)},{method:"fetchPrices"},{method:"refreshBalance"},{method:"refreshGoQuota"},{method:"refreshCustomBalance",parameters:[le("index","CustomBalanceIndex",bn,!0)]},{method:"refreshCodingPlan",parameters:[le("provider","CodingPlanProvider",Mt)]},{method:"loginCodingPlan",parameters:[le("provider","CodingPlanProvider",Mt)]},{method:"refreshGatewayQuota",parameters:[le("sourceId","GatewayQuotaSourceId",ne(t=>{if(t!=null)return(typeof t!="string"||t.length>48||!/^[a-z0-9][a-z0-9_-]*$/.test(t))&&ie("sourceId","gateway source id"),t}),!0)]},{method:"resetHistory",result:ye("CostState",At)},{method:"importLegacyHistory"},{method:"getDaySessions",parameters:[le("date","DayKey",gn)],result:ye("DayRecord",hn)},{method:"getSessionCost",parameters:[le("sessionId","SessionId",Mt)],result:ye("SessionCost",ne(t=>({own:wt(t.own,"own"),subagents:wt(t.subagents,"subagents"),found:Ne(t.found,"found"),subagentCount:ae(t.subagentCount,"subagentCount")})))},{id:"dsh-cost-meter#costMeter/getTurnCost",service:"costMeter",namespace:"costMeter",method:"getTurnCost",invocation:{kind:"direct"},parameters:[le("sessionId","SessionId",ne(t=>se(t,"sessionId"))),...["startSeq","endSeq"].map(t=>le(t,"TurnSeq",ne(o=>((!Number.isSafeInteger(o)||o<0)&&ie(t,"nonnegative integer"),o))))],result:ye("TurnCost",ne(t=>({found:Ne(t.found,"found"),cost:ae(t.cost,"cost"),apiCost:ae(t.apiCost,"apiCost"),rows:ua(t.rows),calls:(Array.isArray(t.calls)?t.calls:ie("calls","array")).map(o=>({kind:se(o.kind,"kind"),provider:se(o.provider,"provider"),model:se(o.model,"model"),atMs:ae(o.atMs,"atMs"),cost:ae(o.cost,"cost"),apiCost:ae(o.apiCost,"apiCost"),plan:Ne(o.plan,"plan"),priced:Ne(o.priced,"priced"),longContext:Ne(o.longContext,"longContext"),rows:ua(o.rows)}))})))},{method:"getTopSessions",parameters:[le("limit","SessionLimit",yn),le("sort","SessionSort",ba,!0),le("dir","SessionSortDir",ba,!0)],result:ye("TopSessions",kn)},{method:"setCredential",parameters:[le("target","CredentialTarget",ga),le("value","CredentialValue",wn)]},{method:"clearCredential",parameters:[le("target","CredentialTarget",ga)]}].map(t=>({id:"dsh-cost-meter#costMeter/"+t.method,service:"costMeter",namespace:"costMeter",invocation:{kind:"direct"},parameters:[],result:ye("FetchPricesResult",fn),...t}))};function vn(t,o){const s=o?.models??{};return typeof t=="string"&&t.length>0&&s[t]!==void 0?s[t]:o?.default??{cacheHit:0,cacheMiss:0,output:0}}function He(t){if(t===null||typeof t!="object")return;const o=r=>{const i=t[r];return typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0},s=o("cacheMiss")??o("input")??0,n={cacheHit:o("cacheHit")??o("cachedInput")??o("cacheRead")??s,cacheMiss:s,output:o("output")??0},l=o("reasoning");return l!==void 0&&(n.reasoning=l),o("cacheWrite")!==void 0&&(n.cacheWrite=o("cacheWrite")),n}function Nn(t){const o=He(t);if(o===void 0)return null;t.billingMode==="utc-peak"&&(o.billingMode="utc-peak");for(const s of["offPeak","peak","legacyBase"]){const a=He(t[s]);a!==void 0&&(o[s]=a)}return Number.isFinite(t.longContext?.aboveInputTokens)&&t.longContext.aboveInputTokens>0&&(o.longContext={...He(t.longContext),aboveInputTokens:t.longContext.aboveInputTokens}),Array.isArray(t.rateHistory)&&(o.rateHistory=t.rateHistory.slice(0,16).map(s=>{const a={...He(s),before:s.before};for(const n of["offPeak","peak"]){const l=He(s[n]);l!==void 0&&(a[n]=l)}return a})),o}function st(t,o=Date.now()){if(!t||!Number.isFinite(o)||!Array.isArray(t.rateHistory))return t;let s=null,a=1/0;for(const r of t.rateHistory){const i=Date.parse(r.before);o<i&&i<a&&(s=r,a=i)}if(!s)return t;const{before:n,...l}=s;return{...t,...l}}const Pt=Date.parse("2026-08-22T16:00:00Z");function ha(t){if(!Number.isFinite(t)||t<Pt)return null;const o=Math.floor((t+8*36e5)/864e5),s=(o+4)%7;if(s!==6&&s!==0)return null;const a=s===6?o:o-1;return{start:Math.max(a*864e5-8*36e5,Pt),end:(a+2)*864e5-8*36e5}}function ya(t,o){if(!Number.isFinite(t)||t<Pt||!Array.isArray(o))return null;const s=Math.floor((t+8*36e5)/864e5);return o.includes(new Date(s*864e5).toISOString().slice(0,10))?{start:s*864e5-8*36e5,end:(s+1)*864e5-8*36e5}:null}const Sn=(t,o)=>ya(t,o)??ha(t);function lt(t,o,s,a){if(!Array.isArray(s)||s.length===0||Sn(t,a)!==null||Number.isFinite(o)&&t<o)return!1;const n=new Date(t).getUTCHours();return s.some(l=>{const r=Number(l.start),i=Number(l.end);return!Number.isFinite(r)||!Number.isFinite(i)?!1:r<i?n>=r&&n<i:n>=r||n<i})}const Cn=Date.parse("2026-08-16T16:00:00Z");function ka(t,o,s){const a=st(t,o)??{cacheHit:0,cacheMiss:0,output:0},n=r=>({cacheHit:r.cacheHit,cacheMiss:r.cacheMiss,output:r.output,reasoning:r.reasoning??0,...r.cacheWrite===void 0?{}:{cacheWrite:r.cacheWrite},...r.longContext===void 0?{}:{longContext:r.longContext}});if(a.billingMode==="utc-peak"){if(s?.enabled!==!0||!Number.isFinite(o))return n(a);const r=new Date(o),i=r.getUTCDay(),d=r.getUTCHours(),u=i>0&&i<6&&(d>=1&&d<4||d>=6&&d<10);return n((u?a.peak:a.offPeak)??a)}if(Number.isFinite(o)&&o<Cn){const r=a.legacyBase;return n(r===void 0?a:r)}if(s?.enabled!==!0)return n(a);const l=typeof s.effectiveAtMs=="number"&&Number.isFinite(s.effectiveAtMs)?s.effectiveAtMs:void 0;if(lt(o,l,s.windows,s.holidays)){const r=a.peak;return n(r===void 0?a:r)}if(l!==void 0&&o>=l){const r=a.offPeak;return n(r===void 0?a:r)}return n(a)}function wa(t,o){const s=Math.max(0,Number(t.input)||0),a=Math.max(0,Number(t.output)||0),n=Math.max(0,Number(t.cacheRead)||0),l=Math.max(0,Number(t.cacheWrite)||0),r=Math.max(0,Number(t.reasoning)||0);return o.longContext&&s+n+l>o.longContext.aboveInputTokens&&(o=o.longContext),(s*o.cacheMiss+a*o.output+n*o.cacheHit+l*(o.cacheWrite??o.cacheHit)+r*(o.reasoning??0))/1e6}function xa(t,o,s){const a=Number(t);if(!Number.isFinite(a)||a<0||a===0)return 0;if(o!=="CNY")return a;const n=Number(s);return!Number.isFinite(n)||n<=0?a:a/n}function oe(t,o){const s=t?.barDirections,a=o==="balance"?"remaining":"used";if(s===null||typeof s!="object"||Array.isArray(s))return a;const n=s[o];return n==="remaining"||n==="used"?n:a}function de(t,o){if(t==null||!Number.isFinite(Number(t)))return{width:0,label:null};const s=Math.max(0,Math.min(100,Number(t))),a=o==="remaining"?Math.round((100-s)*10)/10:Math.round(s*10)/10;return{width:a,label:a}}const va=(t,o)=>t.toFixed(o).replace(/(\.\d*?[1-9])0+$|\.0+$/,"$1");function ce(t,o){const s=typeof o?.symbol=="string"&&o.symbol.length>0?o.symbol:"$",a=Number(o?.decimals),n=Math.max(0,Math.min(10,Number.isFinite(a)?Math.floor(a):2));let l=n;return t>0&&t<Math.pow(10,-n)&&(l=n+2),s+va(t,l)}function K(t,o){const s=Number(o?.exchangeRate),a=t*(Number.isFinite(s)&&s>0?s:1);return ce(a,o)}function j(t){const o=Math.max(0,Number(t)||0),s=a=>a>=100?String(Math.round(a)):String(Math.round(a*10)/10);return o<1e3?String(Math.round(o)):o>=999500?s(o/1e6)+"M":o<1e6?s(o/1e3)+"K":s(o/1e6)+"M"}function Tt(t){return String(t??"").normalize("NFKC").toLowerCase().replace(/[((]\s*(?:go|zen)\s*[))]/g," ").trim()}function be(t){return Tt(t).replace(/[^\p{L}\p{N}]+/gu,"")}function An(t){return Tt(t).replace(/[-_./:@](?:\d{4}-?\d{2}-?\d{2}|v\d+(?:\.\d+)*|\d+k|latest)$/,"")}function Ot(t,o,s=t){if(typeof t!="string"||t.length===0)return null;const a=Array.isArray(o)?o.filter(r=>typeof r=="string"&&r.length>0):[],n=a.find(r=>r===s);if(n!==void 0)return n;let l=t.normalize("NFKC").trim();if(/[:((]\s*(?:free|online)\b/i.test(l))return null;for(;;){const r=be(l);if(r.length===0)return null;const i=a.filter(u=>be(u)===r);if(i.length>0)return i.length===1?i[0]:null;const d=An(l);if(d===l.toLowerCase())return null;l=d}}const Dt=new Set(["openrouter","opencode-zen","opencode-go","zen","opencode"]),rt={openai:/^(?:gpt|o\d|codex)/i,anthropic:/^claude/i,google:/^gemini/i,deepseek:/^deepseek/i,moonshot:/^kimi/i,"z-ai":/^glm/i,xai:/^grok/i,alibaba:/^qwen/i,minimax:/^minimax/i,tencent:/^(?:hunyuan|hy\d)/i,xiaomi:/^mimo/i,upstage:/^solar/i,nvidia:/^nemotron/i,mistral:/^mistral/i,meta:/^(?:muse|llama)/i,meituan:/^longcat/i};function Bt(t){return["deepseek-peak","utc-peak"].includes(t?.billingMode)?t.billingMode:"flat"}function Qe(t,o,s,a,n){if(typeof t!="string")return null;if(Object.hasOwn(o,t))return t;if(a!=="auto")return null;let l=t.normalize("NFKC").trim().replace(/^models\/(?=gemini)/i,"google/");const r=l.search(/[/:]/);if(r>0){const i=l.slice(0,r).trim().toLowerCase(),d=l.slice(r+1).trim();if(Object.hasOwn(rt,i)&&(i===s||(s==="opencode-zen"||s==="opencode-go")&&(rt[i].test(d)||Ot(d,Object.keys(i==="deepseek"?n?.models??{}:n?.providers?.[i]?.models??{}))!==null)))l=d;else if(Object.hasOwn(rt,i))return null}return Ot(l,Object.keys(o),t)}const Mn=new Set(["local","lmstudio","ollama","jan","gpt4all","koboldcpp","llamacpp","llama-cpp","localai","vllm","sglang","tabbyapi","lmdeploy","oobabooga","text-generation-webui","llama-server"]),Pn=["lmstudio:","lmstudio/","ollama:","ollama/","jan:","jan/","gpt4all:","gpt4all/","koboldcpp:","koboldcpp/","llamacpp:","llamacpp/","llama-cpp:","llama-cpp/","localai:","localai/","vllm:","vllm/","sglang:","sglang/","tabbyapi:","tabbyapi/","lmdeploy:","oobabooga/","text-generation-webui/","llama-server:","gguf:","local:"];function Tn(t,o){if(typeof t=="string"&&Mn.has(t))return!0;const s=typeof o=="string"?Tt(o):"";return Pn.some(a=>s.startsWith(a))}function On(t,o,s,a){if(t!=="deepseek"&&!t.includes("deepseek")&&typeof o=="string"&&o.length>0&&o!=="__local__"&&!o.includes(":")){const n=s.models??{},l=Object.hasOwn(n,o)?o:a==="auto"?Ot(o,Object.keys(n)):null;if(l!==null&&n[l]?.unpriced!==!0)return{entry:n[l],priced:!0,billingMode:"deepseek-peak",matched:!0}}return null}function Dn(t,o,s){const a=s?.prices??{},n=s?.priceMatch==="exact"?"exact":"auto",l=s?.priceOverrides&&typeof s.priceOverrides=="object"?s.priceOverrides:{};let r=String(t??"").trim().toLowerCase();r.startsWith("llm-")&&(r=r.slice(4)),r===""&&(r="deepseek");let i=r,d=o;const u=l[r+":"+o];if(u==="__local__")return{entry:null,priced:!1,billingMode:"flat",matched:!0};if(typeof u=="string"&&u.length>0){const p=u.indexOf(":");if(p>0&&u.slice(p+1).length>0?(i=u.slice(0,p).trim().toLowerCase(),d=u.slice(p+1)):d=u,i==="deepseek"&&d==="__default__")return{entry:a.default??{cacheHit:0,cacheMiss:0,output:0},priced:a.default?.unpriced!==!0,billingMode:"deepseek-peak",matched:!1}}if(["zen","opencode"].includes(i)){const p=Qe(d,a.providers?.[i]?.models??{},"opencode-go",n,a);p===null?i="opencode-go":d=p}if(Tn(i,d))return{entry:null,priced:!1,billingMode:"flat",matched:!1};if(i==="openrouter"){const p=a.providers?.openrouter?.models??{},b=Object.hasOwn(p,d)?p[d]:null;return{entry:b,priced:b!==null&&b.unpriced!==!0,billingMode:"flat",matched:b!==null}}if(i==="deepseek"||i.includes("deepseek")){const p=a.models??{},b=Qe(d,p,"deepseek",n,a);if(b!==null)return p[b]?.unpriced===!0?{entry:null,priced:!1,billingMode:"flat",matched:!0}:{entry:p[b],priced:!0,billingMode:"deepseek-peak",matched:!0};if(n==="auto"){let g=null,h=-1,x=!1,N="flat";for(const[T,v]of Object.entries(a.providers??{})){if(Dt.has(T))continue;const f=v?.models??{},S=Qe(d,f,T,n,a);if(S===null)continue;const y=+(S===d||be(S)===be(d));y>h?(g=f[S],h=y,x=!1,N=Bt(f[S])):y===h&&(x=!0)}if(x)return{entry:null,priced:!1,billingMode:"flat",matched:!1};if(g!==null)return{entry:g,priced:g.unpriced!==!0,billingMode:N,matched:!0}}return{entry:a.default??{cacheHit:0,cacheMiss:0,output:0},priced:a.default?.unpriced!==!0,billingMode:"deepseek-peak",matched:!1}}const c=a.providers?.[i]?.models??{},m=Qe(d,c,i,n,a);if(m!==null)return{entry:c[m],priced:c[m]?.unpriced!==!0,billingMode:Bt(c[m]),matched:!0};if(Dt.has(i))return{entry:null,priced:!1,billingMode:"flat",matched:!1};if(Object.hasOwn(rt,i))return{entry:null,priced:!1,billingMode:"flat",matched:!1};if(n==="auto"){let p=null,b=-1,g=!1,h="flat";for(const[x,N]of[["deepseek",{models:a.models??{}}],...Object.entries(a.providers??{})]){if(x===i||Dt.has(x))continue;const T=N?.models??{},v=Qe(d,T,x,n,a);if(v===null)continue;const f=+(v===d||be(v)===be(d));f>b?(p=T[v],b=f,g=!1,h=x==="deepseek"?"deepseek-peak":Bt(T[v])):f===b&&(g=!0)}if(g)return{entry:null,priced:!1,billingMode:"flat",matched:!1};if(p!==null)return{entry:p,priced:p.unpriced!==!0,billingMode:h,matched:!0}}return{entry:null,priced:!1,billingMode:"flat",matched:!1}}function Rt(t,o,s){let a=Dn(t,o,s);if(!a.priced){const n=String(t??"").trim().toLowerCase().replace(/^llm-/,"")||"deepseek";a=On(n,s?.priceOverrides?.[n+":"+o],s?.prices??{},s?.priceMatch==="exact"?"exact":"auto")??a}return a.priced&&s?.prices?.currency==="CNY"&&a.entry?.cny?{...a,entry:a.entry.cny,currency:"CNY"}:{...a,currency:a.priced&&a.billingMode==="deepseek-peak"&&s?.prices?.currency==="CNY"?"CNY":"USD"}}function Bn(t){const o=Number(t?.calls)||0,s=Number(t?.input)||0,a=Number(t?.cacheRead)||0;return o>=3&&s>=1e5&&a===0}function it(t,o){return!t||!o?0:typeof t.cost=="number"&&Number.isFinite(t.cost)?t.cost:Sa(t,o).total}function Fe(t){if(t===null||typeof t!="object")return 0;const o=Number(t.cost)||0,s=t.apiCost===void 0||t.apiCost===null?o:Number(t.apiCost);return Number.isFinite(s)&&s>=0?Math.min(s,o):o}function W(t,o){return o!==null&&typeof o=="object"&&o.showTotalWithPlan===!0?Number(t?.cost)||0:Fe(t)}const Rn={go:["go","zen","opencode","opencode-go"],qwen:["qwen","qwen-tokenplan","qianwen-tokenplan","qwen-token-plan","qianwen-token-plan"],scnet:["scnet","scnet-tokenplan","scnet-token-plan"],mimo:["mimo","xiaomimimo","mimo-token-plan","xiaomi-token-plan","xiaomi-token-plan-cn","xiaomi-token-plan-sgp","xiaomi-token-plan-ams"]},Na=["anthropic","zai","minimax","kimi","openrouter","siliconflow","commandcode","scnet","volcengine","qwen","mimo","go"];function Ln(t){const o=String(t??"").trim().toLowerCase().replace(/^llm-/,"");if(o.length===0)return null;for(const[s,a]of Object.entries(Rn))if(a.includes(o))return s;return Na.includes(o)?o:null}function En(t){const o=new Set,s=t?.codingPlans;if(s!==null&&typeof s=="object")for(const a of Na)a!=="go"&&s[a]?.enabled===!0&&o.add(a);return t?.goQuota?.enabled===!0&&o.add("go"),o}const In=new Set(["grok-4.5","glm-5.3","glm-5.3-flash","glm-5.2","glm-5.1","gpt-5.6-luna","kimi-k3","kimi-k2.7-code","kimi-k2.6","mimo-v2.6-flash","mimo-v2.6-pro","mimo-v2.5","mimo-v2.5-pro","minimax-m3","minimax-m2.7","qwen3.8-max","qwen3.7-max","qwen3.7-plus","qwen3.6-plus","hy3","longcat-2.0","muse-spark-1.2-contributor"].map(be));function jn(t,o,s){const a=String(t??"").trim().toLowerCase();if(a.length>0&&a!=="deepseek"&&!a.includes("deepseek"))return!1;const n=be(o);if(n.length===0||!In.has(n))return!1;const l=s?.prices,r=l?.models??{};for(const i of Object.keys(r))if(be(i)===n)return!1;for(const i of Object.keys(l?.providers?.["opencode-go"]?.models??{}))if(be(i)===n)return!0;return!1}function _e(t,o,s){let a=Ln(t);a===null&&jn(t,o,s)&&(a="go");const n=s?.planBilling?.models;if(n!==null&&typeof n=="object"){const r=n[t+":"+o];if(r==="plan"||r==="api")return r;if(a!==null){const i=n[a+":"+o];if(i==="plan"||i==="api")return i}}if(a===null)return"api";const l=s?.planBilling?.providers?.[a];return l==="plan"||l==="api"?l:En(s).has(a)?"plan":"api"}function Sa(t,o){if(!t||!o)return{total:0,api:0};const s={enabled:o.peakEnabled===!0,effectiveAtMs:Date.parse(o.peakEffectiveAt||""),windows:o.peakWindows,holidays:o.peakHolidays},a=Date.now(),n=t.byProviderModel??t.byModel??{};let l=0,r=0;for(const m of Object.keys(n)){const p=m.indexOf(":"),b=p>0?m.slice(0,p):"deepseek",g=p>0?m.slice(p+1):m,h=Rt(b,g,o);if(h.priced){const x=wa(n[m],ka(Nn(h.entry),a,{...s,enabled:["deepseek-peak","utc-peak"].includes(h.billingMode)&&s.enabled})),N=xa(x,h.currency,o.exchangeRate);l+=N,_e(b,g,o)==="api"&&(r+=N)}}const i={input:0,output:0,cacheRead:0,cacheWrite:0,reasoning:0};for(const m of Object.keys(n))i.input+=n[m].input??0,i.output+=n[m].output??0,i.cacheRead+=n[m].cacheRead??0,i.cacheWrite+=n[m].cacheWrite??0,i.reasoning+=n[m].reasoning??0;const d={input:Math.max(0,(t.input??0)-i.input),output:Math.max(0,(t.output??0)-i.output),cacheRead:Math.max(0,(t.cacheRead??0)-i.cacheRead),cacheWrite:Math.max(0,(t.cacheWrite??0)-i.cacheWrite),reasoning:Math.max(0,(t.reasoning??0)-i.reasoning)},u=wa(d,ka(vn("default",o.prices),a,s)),c=xa(u,o.prices?.currency==="CNY"?"CNY":"USD",o.exchangeRate);return l+=c,r+=c,{total:l,api:r}}function Ca(t,o){if(!t||!o)return!1;const s=t.byProviderModel??{};for(const a of Object.keys(s)){const n=a.indexOf(":"),l=n>0?a.slice(0,n):"deepseek",r=n>0?a.slice(n+1):a;if(_e(l,r,o)==="plan")return!0}return!1}function Lt(t){return(t?.input??0)+(t?.cacheRead??0)+(t?.cacheWrite??0)}function Aa(t,o){if(t?.apiCost!==void 0)return Fe(t);if(!Ca(t,o))return it(t,o);let s=0;for(const[a,n]of Object.entries(t.byProviderModel??{})){if(!Number.isFinite(n.cost))return Sa(t,o).api;const l=a.indexOf(":");_e(a.slice(0,l),a.slice(l+1),o)==="plan"&&(s+=n.cost)}return Math.max(0,it(t,o)-s)}function Et(t){const o=Math.abs(Math.round(Number(t)||0)),s=Math.floor(o/60),a=o%60;return"UTC"+(Number(t)<0?"-":"+")+s+(a>0?":"+String(a).padStart(2,"0"):"")}function qn(t){const o=t?.meta,s=Number(o?.timezoneOffsetMinutes);if(!Number.isFinite(s))return null;const a=-new Date().getTimezoneOffset();if(a===s)return null;const n=typeof o?.timezone=="string"&&o.timezone.length>0?o.timezone:"";return{hostLabel:n?n+" ("+Et(s)+")":Et(s),browserLabel:Et(a)}}function Un(t,o=s=>s){let s=o(t);const a=new Set;return{getSnapshot:()=>s,subscribe:n=>(a.add(n),()=>{a.delete(n)}),set:n=>{if(n=o(n),n!==s){s=n;for(const l of[...a])l()}}}}const{createElement:e,Fragment:E,useState:L,useEffect:X,useRef:ke}=Oe;function Pe({target:t,configured:o,source:s,t:a,api:n,placeholder:l,disabled:r}){const[i,d]=L(""),[u,c]=L(!1),[m,p]=L(!1),[b,g]=L(null),h=ke(!1),x=r===!0||m,N=async()=>{const f=i.trim();if(!(f.length===0||x||h.current)){h.current=!0,p(!0),g(null);try{const S=await n.setCredential(t,f);d(""),c(!1),g({kind:"ok",text:S?.message??a("credentialSave")})}catch(S){g({kind:"err",text:String(S?.message??S)})}finally{h.current=!1,p(!1)}}},T=async()=>{if(!(x||h.current)){h.current=!0,p(!0),g(null);try{const f=await n.clearCredential(t);d(""),c(!1),g({kind:"ok",text:f?.message??a("credentialClear")})}catch(f){g({kind:"err",text:String(f?.message??f)})}finally{h.current=!1,p(!1)}}},v=()=>{d(""),c(!1)};return e("div",{className:"cm-field"},u?e("form",{className:"cm-field",autoComplete:"off",onSubmit:f=>{f.preventDefault(),N()}},e("input",{className:"cm-input",type:"password",name:"cm-credential-"+t,autoFocus:!0,value:i,placeholder:typeof l=="string"?l:"",disabled:x,autoComplete:"new-password","data-lpignore":"true","data-1p-ignore":"true","data-bwignore":"true","aria-label":a("credentialInputHint"),onChange:f=>d(f.target.value)}),e("div",{className:"cm-buttons"},e("button",{className:"cm-btn small",type:"submit",disabled:x||i.trim().length===0},a(m?"credentialSaving":"credentialSave")),e("button",{className:"cm-btn small",type:"button",onClick:v,disabled:m},a("cancel")))):e("button",{className:"cm-btn small",type:"button",onClick:()=>c(!0),disabled:x},a("credentialEdit")),o===!0?e("button",{className:"cm-btn small",type:"button",onClick:T,disabled:x},a("credentialClear")):null,e("span",{className:"cm-hint"},o===!0?a("credentialConfiguredOf",{source:typeof s=="string"&&s.length>0?s:"unknown"}):a("credentialNotConfigured")),e("span",{className:"cm-hint"},a("credentialInputHint")),ea(b))}function Hn({pending:t,t:o}){return!Array.isArray(t)||t.length===0?null:e("div",{className:"cm-msg err"},e("div",null,o("secretMigrationPending")),e("div",null,t.join("、")))}function ct({size:t=16,className:o}){return e("svg",{width:t,height:t,className:o,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M4 4H12A2 2 0 0 1 14 6V11.5A2 2 0 0 1 12 13.5H4A2 2 0 0 1 2 11.5V6A2 2 0 0 1 4 4ZM4 5.3H12A0.7 0.7 0 0 1 12.7 6V11.5A0.7 0.7 0 0 1 12 12.2H4A0.7 0.7 0 0 1 3.3 11.5V6A0.7 0.7 0 0 1 4 5.3Z",fill:"currentColor",fillRule:"evenodd"}),e("path",{d:"M3.3 5.3H12.7V7.1H3.3Z",fill:"currentColor"}),e("path",{d:"M8 2.8A1.3 1.3 0 1 0 8 5.4A1.3 1.3 0 1 0 8 2.8Z",fill:"currentColor"}))}function Ma(t,o){const s=ke(!1),a=ke(""),n=o!==null&&typeof o=="object"?[o.input,o.cacheRead,o.cacheWrite,o.output,o.reasoning,o.cost].map(l=>String(l??0)).join("|"):"";X(()=>{if(!s.current){s.current=!0,a.current=n;return}if(n===""||n===a.current)return;a.current=n;const l=setTimeout(()=>{t.api?.reload?.()},800);return()=>clearTimeout(l)},[n])}function Qn(t,o,s,a){const n=o?o.own:t;if(!s||!o?.subagentCount)return n;const l=o.subagents,r={...n};for(const i of["input","output","cacheRead","cacheWrite","reasoning","calls","cost"])r[i]=(n?.[i]??0)+(l?.[i]??0);r.apiCost=Aa(n,a)+Fe(l);for(const i of["byModel","byProviderModel"]){r[i]={...n?.[i]};for(const[d,u]of Object.entries(l?.[i]??{})){const c={...r[i][d]};c.apiCost=Fe(c)+Fe(u);for(const m of["input","output","cacheRead","cacheWrite","reasoning","calls","cost"])c[m]=(c[m]??0)+(u[m]??0);r[i][d]=c}}return r}function Pa(t){const o=t.useProjection?t.useProjection("costUsage"):void 0,s=t.useCost?.(i=>i)?.state,a=s?.config,[n,l]=L(null);Ma(t,o),X(()=>{if(!t.sessionId||!t.api?.getSessionCost)return;let i=!0,d=!1;const u=async()=>{if(!d){d=!0;try{const m=await t.api.getSessionCost(t.sessionId);i&&l({id:t.sessionId,include:a?.includeSubagentCost===!0,value:m})}catch{}finally{d=!1}}};u();const c=a?.includeSubagentCost===!0?setInterval(u,1e4):null;return()=>{i=!1,c!==null&&clearInterval(c)}},[t.sessionId,s?.meta?.now,o,a?.includeSubagentCost]);const r=n&&n.id===t.sessionId&&n.include===(a?.includeSubagentCost===!0)?n.value:null;return{usage:Qn(o,r,a?.includeSubagentCost===!0,a),config:a}}function Ta(t,o){let s=0,a=it(t,o);if(o.showTotalWithPlan!==!0&&(t.apiCost!==void 0||Ca(t,o))){const n={total:it(t,o),api:Aa(t,o)};s=Math.max(0,n.total-n.api),s>0&&(a=n.api)}return{cost:a,planPart:s}}function Oa(t,o){return Object.entries(t?.byProviderModel??{}).filter(([,s])=>s.input||s.output||s.cacheRead||s.cacheWrite||s.reasoning).map(([s,a])=>s+" "+K(a.cost,o)).join("; ")}function Fn(t){const o=t.useCost?.(h=>h)?.state?.config,[s,a]=L(null),[n,l]=L(""),r=t.turn?.start?.seq,i=t.turn?.end?.seq,d=t.sessionId,u=JSON.stringify([o?.prices,o?.priceOverrides,o?.priceMatch,o?.planBilling,o?.codingPlans,o?.goQuota?.enabled,o?.peakEnabled,o?.peakEffectiveAt,o?.peakWindows,o?.peakHolidays,o?.exchangeRate]);if(X(()=>{let h=!0;if(a(null),l(""),!(o?.hideTurnCost||!d||r==null||i==null))return t.api.getTurnCost(d,r,i).then(x=>{h&&a(x)},x=>{h&&l(String(x.message??x))}),()=>{h=!1}},[d,r,i,u,o?.hideTurnCost]),!o||o.hideTurnCost||r==null||i==null)return null;const c=F(o)==="en",m=c?{input:"Input",output:"Output",cacheRead:"Cache read",cacheWrite:"Cache write",reasoning:"Reasoning"}:{input:"输入",output:"输出",cacheRead:"缓存读取",cacheWrite:"缓存写入",reasoning:"推理"},p=h=>K(h,{...o,decimals:Math.max(8,o.decimals??2)}),b=c?{model:"Model call",compaction:"Context compaction",search:"Native search"}:{model:"模型调用",compaction:"上下文压缩",search:"原生搜索"},g=(h,x)=>e("div",{key:x,style:{marginBottom:4,overflowWrap:"anywhere"}},h.provider+":"+h.model+" · "+m[h.bucket]+(h.plan?" (Plan)":"")+": "+h.tokens.toLocaleString()+" × "+(h.priced?p(h.rate):"?")+" / 1,000,000 ≈ "+(h.priced?p(h.cost):"?"),h.priced?h.bucket==="reasoning"&&h.rate===0?c?" (no separate charge)":"(不单独收费)":"":c?" (price unavailable)":"(未配置价格)");return e("details",{className:"cm-note",style:{fontSize:12,marginTop:6}},e("summary",{style:{cursor:"pointer"}},c?"Turn cost":"本轮费用",s?.found?" ≈ "+p(o.showTotalWithPlan?s.cost:s.apiCost)+(s.rows.some(h=>!h.priced)?c?" + unpriced usage":" + 未定价用量":""):n?" ⚠":""),n?e("div",{role:"alert"},n):s?s.found?e(E,null,e("p",null,c?"Estimated from recorded usage and configured prices; rates per 1M tokens.":"按已记录用量和配置价格估算;单价单位为每百万 Token。"),e("p",null,"API ≈ "+p(s.apiCost)+" · Plan ≈ "+p(s.cost-s.apiCost)+(c?" (equivalent)":"(等值)")),s.rows.map(g),e("details",null,e("summary",{style:{cursor:"pointer"}},(c?"Individual calls":"逐次调用明细")+" ("+s.calls.length+")"),s.calls.map((h,x)=>e("details",{key:x,style:{margin:"6px 0"}},e("summary",{style:{cursor:"pointer",overflowWrap:"anywhere"}},"#"+(x+1)+" "+b[h.kind]+" · "+h.provider+":"+h.model+" · "+new Date(h.atMs).toLocaleTimeString()+" · "+(h.plan?"Plan ":"API ")+(h.priced?"≈ "+p(h.cost):c?"price unavailable":"未配置价格")+(h.longContext?c?" · long context":" · 长上下文价格":"")),h.rows.map(g))))):c?"Complete usage records unavailable":"没有完整用量记录":c?"Loading…":"加载中…")}function _n(t){const{usage:o,config:s}=Pa(t);if(!o||!s||Lt(o)+(o?.output??0)===0)return null;const a=z(F(s)),{cost:n,planPart:l}=Ta(o,s),r=[a("sessionCostTitle"),a("sessionDetailTokens",{input:j(o?.input??0),cache:j((o?.cacheRead??0)+(o?.cacheWrite??0)),output:j(o?.output??0)}),a("sessionDetailCache",{read:j(o?.cacheRead??0),write:j(o?.cacheWrite??0)}),a("cost",{amount:K(n,s)}),...l>0?[a("sessionDetailPlan",{amount:K(l,s)})]:[],Oa(o,s)].filter(Boolean).join("; ");return e($,{label:r,side:"top",delayMs:500},e("div",{className:"cm-chip"},l>0?a("costChipPlan",{amount:K(n,s)}):a("cost",{amount:K(n,s)})))}function Wn(t){const{usage:o,config:s}=Pa(t);if(!o||!s)return null;const a=o.input??0,n=(o.cacheRead??0)+(o.cacheWrite??0),l=o.output??0;if(a+n+l===0)return null;const r=z(F(s)),{cost:i,planPart:d}=Ta(o,s),u=Lt(o)>0?((o.cacheRead??0)/Lt(o)*100).toFixed(1)+"%":"—",c={amount:K(i,s),planAmount:K(d,s),hitRate:u,input:j(a),cache:j(n),output:j(l)},m=r(d>0?"sessionLineSplit":"sessionLine",c),p=Oa(o,s),b=s.sessionCostCompact===!0;return e("div",{className:"cm-root",title:b?[m,p].filter(Boolean).join("; "):p},b?r(d>0?"sessionLineSplitCompact":"sessionLineCompact",c):m)}const zn={USD:"$",CNY:"¥",EUR:"€"};function we(t,o,s){const a=typeof s=="string"?s.toUpperCase():"",n=typeof o?.symbol=="string"&&o.symbol.length>0?o.symbol:"$";return ce(t,{symbol:zn[a]??n,decimals:Math.max(2,Math.min(10,Math.floor(Number(o?.decimals)||2)))})}function Da(t,o){const s=Number(t?.balance?.budgetCap);if(Number.isFinite(s)&&s>0)return s;const a=Number(o?.maxBudget);return Number.isFinite(a)&&a>0?a:null}function Kn(t){const o=t.today,s=o?.byProviderModel;if(s===null||typeof s!="object"||Object.keys(s).length===0)return Number(o?.cost)||0;let a=0;for(const[n,l]of Object.entries(s)){const r=n.indexOf(":");let i=r>=0?n.slice(0,r):n;i.startsWith("llm-")&&(i=i.slice(4)),/^deepseek(?:-official|-account)?$/.test(i)&&(a+=Number(l?.cost)||0)}return a}function Ba(t,o,s,a,n=null){const l=s==="official"?Kn(t):Number(t.today?.cost)||0,r=s==="custom"?We(o,a,n):t.balance?.currency;if(r==="USD")return l;if(r==="CREDITS")return 0;const i=Number(o?.exchangeRate);return l*(Number.isFinite(i)&&i>0?i:1)}function Ra({remaining:t,spend:o,todayUsed:s,cap:a}){if(a===null||a<=0)return{remainingPct:100,todayPct:0,spentPct:0,hasCap:!1,pastSpend:0,today:0};const n=Math.max(0,Number(t)||0),l=Math.max(0,Number(o)||0),r=Math.max(0,Math.min(l,Number(s)||0)),i=Math.max(0,l-r),d=Math.max(0,Math.min(100,n/a*100)),u=Math.max(0,Math.min(100-d,r/a*100)),c=Math.max(0,Math.min(100-d-u,i/a*100));return{remainingPct:d,todayPct:u,spentPct:c,hasCap:!0,pastSpend:i,today:r}}function It(t,o,s=null,a=null){const n=s??t.customBalance,l=Da(We(o,n,a)==="CREDITS"?null:o,n),r=Number(n?.remaining)||0,i=Number(n?.spend)||0,d=Ba(t,o,"custom",n,a);return{cap:l,...Ra({remaining:r,spend:i,todayUsed:d,cap:l})}}function Gn(t,o){const s=t.balance,a=Da(o,null),n=Number(s?.totalBalance)||0,l=Ba(t,o,"official",null),r=a!==null?Math.max(0,a-n):0;return{cap:a,...Ra({remaining:n,spend:r,todayUsed:l,cap:a})}}function jt(t){const{segments:o,direction:s="remaining"}=t,{remainingPct:a,todayPct:n,spentPct:l}=o,r=[];a>0&&r.push(e("div",{className:"cm-bbox-fill",style:{width:a+"%"}})),n>0&&r.push(e("div",{className:"cm-bbox-seg-today",style:{width:n+"%"}})),l>0&&r.push(e("div",{className:"cm-bbox-seg-spent",style:{width:l+"%"}})),r.length===0&&r.push(e("div",{className:"cm-bbox-fill",style:{width:"100%"}}));const i=s==="used"?[...r].reverse():r;return e("div",{className:"cm-bbox-bar segments"+(s==="used"?" rev":"")},...i)}function La(t,o,s,a,n){const l=[t("balanceBarRemaining",{amount:a})];return s.today>0&&l.push(t("balanceBarToday",{amount:o(s.today)})),s.pastSpend>0&&l.push(t("balanceBarSpent",{amount:o(s.pastSpend)})),n!==null&&n>0&&l.push(t("balanceBudgetCapLabel")+": "+o(n)),l.join(" · ")}function Ce(t){const[o,s]=L(!1),[a,n]=L(null);return{busy:o,err:a,run:()=>{o||typeof t!="function"||(s(!0),n(null),Promise.resolve().then(t).catch(r=>{n(r?.message??String(r))}).finally(()=>{s(!1)}))}}}const me=(t,o)=>({role:"button",tabIndex:0,"aria-busy":t?"true":"false",onClick:o,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),o())}});function ge(t,o){const s=[t("clickToRefresh")];return o.busy&&s.push(t("refreshing")),o.err&&s.push("⚠ "+t("balanceRefreshFailed",{message:o.err})),s}const Yn="https://platform.deepseek.com/usage";function Ea(t){return e("a",{className:"cm-bal-link",href:Yn,target:"_blank",rel:"noreferrer noopener",title:t("balanceRechargeLink"),"aria-label":t("balanceRechargeLink"),onClick:o=>o.stopPropagation(),onKeyDown:o=>o.stopPropagation()},e("svg",{width:14,height:14,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},e("path",{d:"M8 4H4a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-4M11 3h6v6M9 11l8-8"})))}function Vn(t){const{state:o,wide:s,api:a}=t,n=o.balance,l=z(F(o.config)),r=Ce(a?()=>a.refreshBalance():null);if(!n||n.status==="off")return null;if(n.status==="error")return e($,{label:[l("balanceQueryFailed",{message:n.message||l("unknownError")}),...ge(l,r)].join("; "),side:"right",delayMs:300},e("div",{className:"cm-foot clickable"+(s?"":" cm-foot-rail")+" cm-bal-err"+(r.busy?" busy":""),...me(r.busy,r.run)},s?e(E,null,l("balance")," ",e("span",{className:"cm-num"},l("queryFailed"))):"⚠"));const i=[l("balanceTitle"),l("totalBalance",{amount:we(n.totalBalance,o.config,n.currency)}),l("grantedToppedUp",{granted:we(n.grantedBalance,o.config,n.currency),toppedUp:we(n.toppedUpBalance,o.config,n.currency)}),l("updatedAt",{time:n.fetchedAt>0?new Date(n.fetchedAt).toLocaleTimeString():"—"}),...o.reconcile?.ok===!1?["⚠ "+o.reconcile.message]:[],...ge(l,r)].join("; ");return e($,{label:i,side:"right",delayMs:300},e("div",{className:"cm-foot clickable"+(s?"":" cm-foot-rail")+(r.busy?" busy":""),...me(r.busy,r.run)},s?e(E,null,e("span",{className:"cm-balance-name"},l("balance"),Ea(l)),e("span",{className:"cm-num cm-bal-amt"},we(n.totalBalance,o.config,n.currency)),o.reconcile?.ok===!1?" ⚠":""):e(ct,{size:16})))}function Jn(t){const{state:o,wide:s,api:a}=t,n=o.config,l=o.balance,r=z(F(n)),i=Ce(a?()=>a.refreshBalance():null);if(!l||l.status!=="ok")return null;const d=Gn(o,n),u=we(l.totalBalance,n,l.currency),c=b=>we(b,n,l.currency),m=[r("balanceTitle"),La(r,c,d,u,d.cap),r("grantedToppedUp",{granted:we(l.grantedBalance,n,l.currency),toppedUp:we(l.toppedUpBalance,n,l.currency)}),r("updatedAt",{time:l.fetchedAt>0?new Date(l.fetchedAt).toLocaleTimeString():"—"}),...o.reconcile?.ok===!1?["⚠ "+o.reconcile.message]:[],...ge(r,i)].join("; "),p=e(E,null,e("div",{className:"cm-bbox-head"},e("span",{className:"cm-balance-name"},e("span",{className:"cm-bbox-label"},r("balance")),Ea(r)),e("span",{className:"cm-bbox-pct cm-num cm-bal-amt"},u)),e(jt,{segments:d,direction:oe(n,"balance")}));return e($,{label:m,side:"right",delayMs:300},e("div",{className:"cm-bbox clickable"+(s?"":" rail")+(i.busy?" busy":""),...me(i.busy,i.run)},s?p:e("div",{className:"cm-bbox-rail cm-num"},Math.round(d.remainingPct)+"%")))}function qt(t,o){const s=typeof t?.label=="string"?t.label:"",a=typeof t?.labelEn=="string"?t.labelEn:"";return o==="en"?a||s||"Custom balance":s||a||"自定义余额"}function We(t,o,s){if((s??t?.customBalance)?.adapter==="aliyun"&&["CNY","USD","EUR"].includes(o?.unit))return o.unit;const a=s?.unit??t?.customBalance?.unit;return["CNY","EUR","USD","CREDITS"].includes(a)?a:["CNY","EUR","CREDITS"].includes(o?.unit)?o.unit:"USD"}function ze(t,o,s,a){const n=We(o,s,a),l=Number(t);if(!Number.isFinite(l))return"—";const r=o?.currency==="USD"?1:Number(o?.exchangeRate);if((a??o?.customBalance)?.convertToDisplayCurrency===!0&&n==="USD"&&Number.isFinite(r)&&r>0){const c=l*r;return Number.isFinite(c)?ce(c,o):"—"}const i=n==="CREDITS",d=Math.max(2,Math.min(6,Math.floor(Number(o?.decimals)||4)));return(i?"":n==="CNY"?"¥":n==="EUR"?"€":"$")+va(l,d)+(i?" Credits":"")}function Ut(t,o,s,a,n=null){const l=ze(t.remaining,o,t,n),r=p=>ze(p,o,t,n);if(a&&o.balance?.showProgressBar===!0){const p=It(a,o,t,n);return[La(s,r,p,l,p.cap),s("updatedAt",{time:t.fetchedAt>0?new Date(t.fetchedAt).toLocaleTimeString():"—"})].join(" · ")}const i=t.spend!==null?r(t.spend):"—",d=t.maxBudget!==null?r(t.maxBudget):"—",u=We(o,t,n)==="CREDITS"?NaN:Number(o?.balance?.budgetCap),c=Number.isFinite(u)&&u>0?s("balanceBudgetCapLabel")+": "+r(u):"",m=t.maxBudget!==null&&t.spend!==null?s("customBalanceLine",{remaining:l,spend:i,maxBudget:d,time:t.fetchedAt>0?new Date(t.fetchedAt).toLocaleTimeString():"—"}):s("customBalanceRemaining",{amount:l});return c?m+" · "+c:m}function Zn(t,o,s,a,n){const l=qt(n??o.customBalance??{},F(o)),r=ze(a.remaining,o,a,n),i=It(t,o,a,n);return{level:"ok",rail:Math.round(i.remainingPct)+"%",body:e(E,null,e("div",{className:"cm-bbox-head"},e("span",{className:"cm-bbox-label"},l),e("span",{className:"cm-bbox-pct cm-num cm-bal-amt"},r)),e(jt,{segments:i,direction:oe(o,"balance")}))}}function Ht(t,o){const s=o?.customBalances??[],a=Array.isArray(t?.customBalances)?t.customBalances:[],n=[];return s.forEach((l,r)=>{if(l?.enabled!==!0||l.display!=="sidebar"&&l.display!=="both")return;const i=a.find(d=>d.index===r)??(a.length===1&&s.length===1?a[0]:null);n.push({index:r,entry:l,snapshot:i})}),n.length===0&&a.length===0&&o?.customBalance?.enabled===!0&&(o.customBalance.display==="sidebar"||o.customBalance.display==="both")&&t?.customBalance?.status&&t.customBalance.status!=="off"&&n.push({index:null,entry:o.customBalance,snapshot:t.customBalance}),n}function $n(t){const{state:o,wide:s,api:a}=t,n=o.config,l=z(F(n)),r=Ht(o,n);return r.length===0?null:e(E,null,r.map(({index:i,entry:d,snapshot:u})=>e(Xn,{key:"cb-"+i,state:o,wide:s,api:a,t:l,index:i,entry:d,snapshot:u})))}function Xn(t){const{state:o,wide:s,api:a,t:n,index:l,entry:r,snapshot:i}=t,d=o.config;if(i==null||i.status!=="ok")return null;const u=Ce(a?()=>a.refreshCustomBalance(l):null),c=Zn(o,d,n,i,r),m=[Ut(i,d,n,o,r),...ge(n,u)].join(" · ");return e($,{label:m,side:"right",delayMs:300},e("div",{className:"cm-bbox clickable"+(c.level==="ok"?"":" "+c.level)+(s?"":" rail")+(u.busy?" busy":""),...me(u.busy,u.run)},s?c.body:e("div",{className:"cm-bbox-rail cm-num"},c.rail)))}function eo(t){const{state:o,wide:s,api:a}=t,n=o.config,l=z(F(n)),r=Ht(o,n);return r.length===0?null:e(E,null,r.map(({index:i,entry:d,snapshot:u})=>e(to,{key:"cbr-"+i,state:o,wide:s,api:a,t:l,index:i,entry:d,snapshot:u})))}function to(t){const{state:o,wide:s,api:a,t:n,index:l,entry:r,snapshot:i}=t,d=o.config,u=i??da(l);if(u.status==="off")return null;const c=Ce(a?()=>a.refreshCustomBalance(l):null),m=qt(r??d.customBalance??{},F(d));if(u.status==="error")return e($,{label:[u.message||n("unknownError"),...ge(n,c)].join("; "),side:"right",delayMs:300},e("div",{className:"cm-foot clickable"+(s?"":" cm-foot-rail")+" cm-bal-err"+(c.busy?" busy":""),...me(c.busy,c.run)},s?e(E,null,e("span",{className:"cm-bal-label",title:m},m),e("span",{className:"cm-num cm-bal-amt"},n("queryFailed"))):"⚠"));const p=ze(u.remaining,d,u,r),b=[Ut(u,d,n,o,r),...ge(n,c)].join(" · ");return e($,{label:b,side:"right",delayMs:300},e("div",{className:"cm-foot clickable"+(s?"":" cm-foot-rail")+(c.busy?" busy":""),...me(c.busy,c.run)},s?e(E,null,e("span",{className:"cm-bal-label",title:m},m),e("span",{className:"cm-num cm-bal-amt"},p)):e(ct,{size:16})))}function ao(t){const s=(t.useCost?t.useCost(g=>g):void 0)?.state;if(!s)return null;const a=s.config,n=z(F(a)),l=a.corner??{enabled:!1,goRolling:!0,goWeekly:!0,goMonthly:!0,budget:!0},r=s.goQuota,i=a?.goQuota?.enabled!==!1&&r?.status==="ok",d=g=>g!==null&&typeof g?.percent=="number"?Math.round(Math.max(0,Math.min(100,g.percent))):null,u=[];if(a.sidebarModels?.dock){const g=za(s,a.sidebarModels.period,n);g.length&&u.push({key:"model-top",text:e(E,null,e("span",{className:"cm-bal-label"},g[0].label),e("span",{className:"cm-bal-amt"},K(g[0].cost,a))),tip:g[0].label+" "+K(g[0].cost,a),level:"ok"})}const c=(g,h,x,N)=>{if(!l.enabled||!g||!i)return;const T=d(h);if(T===null)return;const v=typeof h.resetsAt=="string"&&h.resetsAt.length>0?n("goResetAt",{time:new Date(h.resetsAt).toLocaleString()}):"";u.push({key:x,text:n(x)+" "+T+"%",tip:n(N)+": "+T+"%"+(v?" · "+v:""),level:T>=100?"over":T>=80?"warn":"ok"})},m=a?.goQuota?.main==="weekly"||a?.goQuota?.main==="monthly"?a.goQuota.main:"rolling",p=[m,...["rolling","weekly","monthly"].filter(g=>g!==m)],b=g=>g==="rolling"?["goRolling",r?.rolling,"goShortRolling","cornerGoRolling"]:g==="weekly"?["goWeekly",r?.weekly,"goShortWeekly","cornerGoWeekly"]:["goMonthly",r?.monthly,"goShortMonthly","cornerGoMonthly"];for(const g of p){const[h,x,N,T]=b(g);c(l[h]===!0,x,N,T)}if(l.enabled&&l.budget===!0){const g=a.budget??{enabled:!1,amount:100,period:"month"};if(g.enabled===!0){const h=Number(a.exchangeRate),N=(s.budgetUsed??(g.period==="day"?W(s.today,a):g.period==="all"?W(s.total,a):W(s.month,a)))*(Number.isFinite(h)&&h>0?h:1),T=Math.max(0,Number(g.amount)||0),v=T>0?Math.min(999,N/T*100):null;if(v!==null){const f=v>=100?"over":v>=80?"warn":"ok";u.push({key:"budget",text:n("budgetShort")+" "+v.toFixed(1)+"%",tip:n("budgetOf",{period:n(je[g.period]??"periodMonth")})+" · "+n("usedOf",{used:ce(N,a),amount:ce(T,a)}),level:f})}}}return u.length===0?null:e("div",{className:"cm-corner"},u.map(g=>e($,{key:g.key,label:g.tip,side:"top",delayMs:500},e("span",{className:"cm-corner-chip"+(g.key==="model-top"?" cm-model-top":"")+(g.level==="ok"?"":" "+g.level)},g.text))))}function ut(t,o,s){if(!Array.isArray(o)||o.length===0||!Number.isFinite(t))return null;const a=(p,b)=>{const g=new Date(t);return g.setUTCDate(g.getUTCDate()+p),g.setUTCHours(b,0,0,0),g.getTime()},n=new Set,l=Math.max(12,Math.min(380,(Array.isArray(s)?s.length:0)+7));for(let p=-l;p<=l;p+=1){n.add(a(p,16));for(const b of o){const g=Number(b?.start),h=Number(b?.end);!Number.isFinite(g)||!Number.isFinite(h)||(n.add(a(p,g)),n.add(a(h<=g?p+1:p,h)))}}const r=[...n].sort((p,b)=>p-b).flatMap(p=>{const b=lt(p-1,void 0,o,s),g=lt(p,void 0,o,s);return b===g?[]:[{at:p,intoPeak:g}]});let i=null,d=null;for(const p of r)p.at<=t&&(i===null||p.at>i.at)&&(i=p),p.at>t&&(d===null||p.at<d.at)&&(d=p);const u=ya(t,s),c=u??ha(t);return c!==null?d===null?null:{inPeak:!1,weekend:u===null,...u?{holiday:!0}:{},prevAtMs:c.start,nextAtMs:d.at,nextIntoPeak:d.intoPeak}:i===null||d===null?null:{inPeak:lt(t,void 0,o,s),weekend:!1,prevAtMs:i.at,nextAtMs:d.at,nextIntoPeak:d.intoPeak}}function dt(t,o){if(!t||t.peakNotice===!1||t.peakEnabled!==!0)return null;const s=Date.parse(t.peakEffectiveAt||"");if(Number.isFinite(s)&&o<s)return null;const a=Array.isArray(t.peakWindows)?t.peakWindows:[];return ut(o,a,t.peakHolidays)}function mt(t){return t.holiday===!0?{short:"holidayShort",chip:"holidayChip",notice:"holidayAllOffPeak"}:t.weekend===!0?{short:"weekendShort",chip:"weekendChip",notice:"weekendAllOffPeak"}:t.inPeak?{short:"peakShort",chip:"peakShort",notice:"peakNotice"}:{short:"offPeakShort",chip:"offPeakShort",notice:"offPeakActive"}}function he(t,o,s){const a=Math.max(0,t.nextAtMs-o),n=Math.max(1,Math.ceil(a/6e4)),l=Math.floor(n/60),r=n%60;return l>0?r>0?s("countdownHourMinute",{h:l,m:r}):s("countdownHoursOnly",{h:l}):s("countdownMinute",{m:n})}const Qt="cm-peak-alert-preview";let Ia=0;function no(t){const o=t.useCost?t.useCost(h=>h):void 0,s=o?.state?.config,[a,n]=L(Date.now()),[l,r]=L(null),[i,d]=L(null);if(X(()=>{const h=window.setInterval(()=>n(Date.now()),1e4);return()=>window.clearInterval(h)},[]),X(()=>{const h=x=>{const N=x.detail?.kind==="offpeak"?"offpeak":"peak";d(N);const T=o?.state?.config;if(T?.peakAlertWebNotify===!0&&window.Notification&&Notification.permission==="granted"){const v=z(F(T));try{new Notification(v(N==="peak"?"peakAlertTitlePeak":"peakAlertTitleOffPeak")+v("peakAlertPreviewTag"),{body:v("peakAlertBody",{time:v("countdownMinute",{m:2}),phase:v(N==="peak"?"peakAlertPhasePeak":"peakAlertPhaseOffPeak")})})}catch{}}};return window.addEventListener(Qt,h),window.__cmPeakAlertLive=!0,()=>{window.removeEventListener(Qt,h),window.__cmPeakAlertLive=!1}},[]),X(()=>{if(!s||s.peakAlertEnabled!==!0||s.peakEnabled!==!0||s.peakAlertWebNotify!==!0||!window.Notification||Notification.permission!=="granted")return;const h=ut(a,Array.isArray(s.peakWindows)?s.peakWindows:[],s.peakHolidays);if(h===null)return;const x=s.peakAlertTarget==="peak"||s.peakAlertTarget==="offpeak"?s.peakAlertTarget:"both",N=h.nextIntoPeak===!0;if(x!=="both"&&x!==(N?"peak":"offpeak"))return;const T=Number(s.peakAlertAhead),v=(Number.isFinite(T)&&T>=1?T:2)*6e4;if(a<h.nextAtMs-v||a>=h.nextAtMs||Ia===h.nextAtMs)return;const f=z(F(s));Ia=h.nextAtMs;try{new Notification(f(N?"peakAlertTitlePeak":"peakAlertTitleOffPeak"),{body:f("peakAlertBody",{time:he(h,a,f),phase:f(N?"peakAlertPhasePeak":"peakAlertPhaseOffPeak")})})}catch{}},[a]),!s||s.peakEnabled!==!0)return null;let u=null;if(s.peakAlertEnabled===!0){const h=Date.parse(s.peakEffectiveAt||"");if(!(Number.isFinite(h)&&a<h)){const x=ut(a,Array.isArray(s.peakWindows)?s.peakWindows:[],s.peakHolidays);if(x!==null){const N=s.peakAlertTarget==="peak"||s.peakAlertTarget==="offpeak"?s.peakAlertTarget:"both",T=Number(s.peakAlertAhead),v=(Number.isFinite(T)&&T>=1?T:2)*6e4;(N==="both"||N===(x.nextIntoPeak?"peak":"offpeak"))&&a>=x.nextAtMs-v&&a<x.nextAtMs&&l!==x.nextAtMs&&(u=x)}}}let c=null,m=!1,p=null;if(u!==null)c=u,m=u.nextIntoPeak===!0,p=()=>r(u.nextAtMs);else if(i!==null)c={nextAtMs:a+2*6e4,nextIntoPeak:i==="peak"},m=i==="peak",p=()=>d(null);else return null;const b=z(F(s)),g=s.peakAlertPosition==="center"?"cm-peak-alert-center":"cm-peak-alert-corner";return e("div",{className:"cm-peak-alert "+g+" "+(m?"cm-peak-alert-peak":"cm-peak-alert-offpeak"),role:"alert"},e("div",{className:"cm-peak-alert-badge"},b(m?"peakAlertBadgePeak":"peakAlertBadgeOffPeak")),e("div",{className:"cm-peak-alert-title"},b(m?"peakAlertTitlePeak":"peakAlertTitleOffPeak")),e("div",{className:"cm-peak-alert-body"},b("peakAlertBody",{time:he(c,a,b),phase:b(m?"peakAlertPhasePeak":"peakAlertPhaseOffPeak")})),e("div",{className:"cm-peak-alert-actions"},e("button",{className:"cm-btn",onClick:p},b("peakAlertBtn"))))}function oo(t){const{config:o,t:s}=t,[a,n]=L(Date.now());X(()=>{const d=window.setInterval(()=>n(Date.now()),3e4);return()=>window.clearInterval(d)},[]);const l=dt(o,a);if(l===null)return null;const r=mt(l),i=l.nextIntoPeak?s("nextPeakIn",{time:he(l,a,s)}):s("nextOffPeakIn",{time:he(l,a,s)});return e($,{label:s(r.notice),side:"right",delayMs:300},e("div",{className:"cm-peak-strip "+(l.weekend||l.holiday?"weekend":l.inPeak?"peak":"off")},e("div",{className:"cm-peak-track"},e("div",{className:"cm-peak-segment cm-peak-high"}),e("div",{className:"cm-peak-segment cm-peak-low"}),e("div",{className:"cm-peak-marker",style:{left:l.weekend||l.holiday?"50%":l.inPeak?"25%":"75%"}})),e("span",{className:"cm-peak-chip"},s(r.chip)+" · "+i)))}function so(t){const{config:o,t:s}=t,[a,n]=L(Date.now());X(()=>{const d=window.setInterval(()=>n(Date.now()),3e4);return()=>window.clearInterval(d)},[]);const l=dt(o,a);if(l===null)return null;const r=mt(l),i=l.nextIntoPeak?s("nextPeakIn",{time:he(l,a,s)}):s("nextOffPeakIn",{time:he(l,a,s)});return e($,{label:s(r.notice),side:"right",delayMs:300},e("div",{className:"cm-peak-classic "+(l.weekend||l.holiday?"weekend":l.inPeak?"peak":"off")},e("div",{className:"cm-peak-classic-marker",style:{left:l.weekend||l.holiday?"50%":l.inPeak?"25%":"75%"}}),e("div",{className:"cm-peak-track"},e("div",{className:"cm-peak-segment cm-peak-high"}),e("div",{className:"cm-peak-segment cm-peak-low"})),e("span",{className:"cm-peak-classic-chip"},s(r.chip)+" · "+i)))}function pt(t,o,s){return e(o?.peakStyle==="classic"?so:oo,{config:o,t:s})}function lo(t){const{config:o,t:s}=t,[a,n]=L(Date.now());X(()=>{const u=window.setInterval(()=>n(Date.now()),3e4);return()=>window.clearInterval(u)},[]);const l=dt(o,a);if(l===null)return null;const r=mt(l),i=l.nextIntoPeak?s("nextPeakIn",{time:he(l,a,s)}):s("nextOffPeakIn",{time:he(l,a,s)}),d=[s(r.notice),i];return e($,{label:d,side:"right",delayMs:300},e("div",{className:"cm-peak-rail "+(l.weekend||l.holiday?"weekend":l.inPeak?"peak":"off"),"aria-label":d.join("; ")},e("div",{className:"cm-peak-rail-track"},e("div",{className:"cm-peak-rail-segment cm-peak-rail-high"}),e("div",{className:"cm-peak-rail-segment cm-peak-rail-low"}),e("div",{className:"cm-peak-rail-marker",style:{top:l.weekend||l.holiday?"50%":l.inPeak?"25%":"75%"}})),e("span",{className:"cm-peak-rail-label"},s(r.short))))}function ro(t){const{config:o,t:s}=t,[a,n]=L(Date.now());X(()=>{const u=window.setInterval(()=>n(Date.now()),3e4);return()=>window.clearInterval(u)},[]);const l=dt(o,a);if(l===null)return null;const r=mt(l),i=l.nextIntoPeak?s("nextPeakIn",{time:he(l,a,s)}):s("nextOffPeakIn",{time:he(l,a,s)}),d=[s(r.notice),i];return e($,{label:d,side:"right",delayMs:300},e("div",{className:"cm-peak-rail-classic "+(l.weekend||l.holiday?"weekend":l.inPeak?"peak":"off"),"aria-label":d.join("; ")},e("div",{className:"cm-peak-rail-classic-track"},e("div",{className:"cm-peak-rail-classic-segment peak"}),e("div",{className:"cm-peak-rail-classic-segment off"}),e("div",{className:"cm-peak-rail-classic-marker",style:{top:l.weekend||l.holiday?"50%":l.inPeak?"25%":"75%"}})),e("span",{className:"cm-peak-rail-classic-label"},s(r.short))))}function io(t,o,s){return e(o?.peakStyle==="classic"?ro:lo,{config:o,t:s})}function ja(t,o,s){const a=t.today,n=o.budget??{enabled:!1,amount:100,period:"month"},l=Number(o.exchangeRate),i=(t.budgetUsed??(n.period==="day"?W(t.today,o):n.period==="all"?W(t.total,o):W(t.month,o)))*(Number.isFinite(l)&&l>0?l:1),d=Math.max(0,Number(n.amount)||0),u=d>0?Math.min(999,i/d*100):null,c=de(u===null?null:Math.min(100,u),oe(o,"budget")),m=W(a,o)*(Number.isFinite(l)&&l>0?l:1),p=d>0?Math.min(999,m/d*100):null,b=n.detail!==!1;return{level:u===null?"ok":u>=100?"over":u>=80?"warn":"ok",rail:c.label===null?"—":Math.round(c.label)+"%",body:e(E,null,e("div",{className:"cm-bbox-head"},e("span",{className:"cm-bbox-label"},s("budget")),e("span",{className:"cm-bbox-pct cm-num"},c.label===null?"—":c.label.toFixed(1)+"%")),e("div",{className:"cm-bbox-bar"},e("div",{className:"cm-bbox-fill",style:{width:c.width+"%"}})),b?e(E,null,o.hideTodayCost===!0?null:e("div",{className:"cm-bbox-line cm-num"},o.sidebarTodayMetric==="tokens"?s("today")+" "+Kt(a,o,s):s("todayShare",{amount:K(W(a,o),o),pct:p===null?"—":p.toFixed(1)+"%"})),e("div",{className:"cm-bbox-line cm-num"},s("usedOf",{used:ce(i,o),amount:ce(d,o)}))):null,pt(t,o,s))}}function qa(t,o,s){const a=t.goQuota,n=o?.goQuota?.main==="weekly"||o?.goQuota?.main==="monthly"?o.goQuota.main:"rolling",l=a[n],r=l!==null&&typeof l?.percent=="number"?Math.max(0,Math.min(100,Number(l.percent)||0)):0,i=b=>b!==null&&typeof b?.percent=="number"?Math.round(Math.max(0,Math.min(100,b.percent)))+"%":"—",d=b=>s(b==="rolling"?"goShortRolling":b==="weekly"?"goShortWeekly":"goShortMonthly"),u=["rolling","weekly","monthly"].filter(b=>b!==n),c=l!==null&&typeof l?.resetsAt=="string"&&l.resetsAt.length>0?s("goResetAt",{time:new Date(l.resetsAt).toLocaleString()}):"",m=o?.goQuota?.detail!==!1,p=de(r,oe(o,"go"));return{level:r>=100?"over":r>=80?"warn":"ok",rail:p.label===null?"—":Math.round(p.label)+"%",body:e(E,null,e("div",{className:"cm-bbox-head"},e("span",{className:"cm-bbox-label"},s("goQuotaRowLabel")+" "+d(n)),e("span",{className:"cm-bbox-pct cm-num"},p.label===null?"—":Math.round(p.label)+"%")),e("div",{className:"cm-bbox-bar"},e("div",{className:"cm-bbox-fill",style:{width:p.width+"%"}})),m?e(E,null,e("div",{className:"cm-bbox-line cm-num"},u.map(b=>d(b)+" "+i(a[b])).join(" · ")),c?e("div",{className:"cm-bbox-line"},c):null):null)}}function co(t){const{state:o,wide:s}=t,a=o.goQuota,n=z(F(o.config));if(!a||a.status!=="ok")return null;const l=o.config?.goQuota?.main==="weekly"||o.config?.goQuota?.main==="monthly"?o.config.goQuota.main:"rolling";if(a[l]===null||typeof a[l]?.percent!="number")return null;const r=qa(o,o.config,n),i=[n("goQuotaTitle"),n("goWindowRolling")+": "+(a.rolling===null?"—":Math.round(a.rolling.percent)+"%"),n("goWindowWeekly")+": "+(a.weekly===null?"—":Math.round(a.weekly.percent)+"%"),n("goWindowMonthly")+": "+(a.monthly===null?"—":Math.round(a.monthly.percent)+"%"+(a.monthly!==null&&typeof a.monthly.resetsAt=="string"&&a.monthly.resetsAt.length>0?" · "+n("goResetAt",{time:new Date(a.monthly.resetsAt).toLocaleString()}):"")),n("goQuotaFetchedAt",{time:a.fetchedAt>0?new Date(a.fetchedAt).toLocaleTimeString():"—"})].join("; ");return e($,{label:i,side:"right",delayMs:300},e("div",{className:"cm-bbox"+(r.level==="ok"?"":" "+r.level)+(s?"":" rail")},s?r.body:e("div",{className:"cm-bbox-rail cm-num"},r.rail)))}function uo(t){return t===null||typeof t!="object"||t.unlimited||typeof t.percent!="number"?null:Math.max(0,Math.min(100,Math.round(Number(t.percent)||0)))}function Ke(t){const o=t!==null&&typeof t=="object"?t:{};return{five:o["5h"]??null,seven:o["7d"]??o.week??o.weekly??null}}function Ua(t,o,s=Date.now()){if(typeof t!="string"||!t)return"";const a=Date.parse(t);if(!Number.isFinite(a))return"";const n=a-s;if(n<=0)return o("resetReached");const l=Math.ceil(n/6e4),r=Math.floor(l/1440),i=Math.floor(l%1440/60),d=l%60;return r>0?o("resetDays",{d:r,h:i}):i>0?o("resetHours",{h:i,m:d}):o("resetMinutes",{m:d})}function Ge(t,o,s=Date.now()){const a=Ua(t?.resetsAt,o,s);return a?o("goResetAt",{time:new Date(t.resetsAt).toLocaleString()})+" ("+a+")":""}function ft(t,o,s){return t===null?"—":s(o==="remaining"?"quotaRemaining":"quotaUsed",{pct:t})}function bt(t){const[,o]=L(0),s=()=>o(Date.now());return X(()=>{if(!t)return;const a=setInterval(s,6e4);return()=>clearInterval(a)},[t]),{onMouseEnter:s,onFocus:s}}function Ye(t,o,s,a){const n=uo(o),l=n===null?"ok":n>=100?"over":n>=80?"warn":"ok",r=de(n,s),i=o?.unlimited?"∞":r.label===null?"—":r.label+"%";return{level:l,pct:n,text:i,label:r.label,row:e("div",{className:"cm-mm-row"+(l==="ok"?"":" "+l)},e("span",{className:"cm-bbox-label"},t),e("div",{className:"cm-bbox-bar"},e("div",{className:"cm-bbox-fill",style:{width:r.width+"%"}})),e("span",{className:"cm-bbox-pct cm-num"},i))}}function Ha(t){const{five:o,seven:s,fetchedAt:a,t:n,wide:l,refresh:r,direction:i="used"}=t,d=bt(o?.resetsAt),u=Ua(o?.resetsAt,n),c=Ye(n("codingPlanRemain5h"),o,i,n),m=Ye(n("codingPlanRemain7d"),s,i,n),p=c.level==="over"||m.level==="over"?"over":c.level==="warn"||m.level==="warn"?"warn":"ok",b=(N,T,v)=>{const f=T?.unlimited?n("quotaUnlimited"):ft(v.label,i,n),S=Ge(T,n);return N+" "+f+(S?" · "+S:"")},g=[n("codingPlanMinimaxTitle"),b(n("codingPlanRemain5h"),o,c),b(n("codingPlanRemain7d"),s,m),a>0?n("goQuotaFetchedAt",{time:new Date(a).toLocaleTimeString()}):null,...r?ge(n,r):[]].filter(Boolean).join(`
3
3
  `),h=e(E,null,e("div",{className:"cm-mm-title"},n("codingPlanMinimaxTitle")),c.row,m.row,u?e("div",{className:"cm-mm-reset"},"5h · "+u):null),x=e(E,null,e("div",{className:"cm-bbox-rail cm-num"},c.text),e("div",{className:"cm-bbox-rail cm-num"},m.text));return e($,{label:e("span",{style:{whiteSpace:"pre-line"}},g),side:"right",delayMs:300},e("div",{...d,className:"cm-bbox cm-mm"+(p==="ok"?"":" "+p)+(l===!1?" rail":"")+(r?" clickable"+(r.busy?" busy":""):""),...r?me(r.busy,r.run):{}},l===!1?x:h))}function mo(t){const{state:o,wide:s,api:a}=t,n=o.codingPlans?.minimax,l=z(F(o.config)),r=Ce(a?()=>a.refreshCodingPlan("minimax"):null);if(!n||n.status!=="ok")return null;const{five:i,seven:d}=Ke(n.windows);return i==null&&d==null?null:e(Ha,{five:i,seven:d,fetchedAt:n.fetchedAt,t:l,wide:s,refresh:r,direction:oe(o.config,"plan")})}const po="/plugins/dsh-openai-codex/auth/status",fo=168*3600;function bo(t){if(t===null||typeof t!="object"||t.status!=="signed-in")return null;const o=t.usage!==null&&typeof t.usage=="object"?t.usage.rateLimits:null;if(!Array.isArray(o))return null;const s=o.find(i=>i!==null&&typeof i=="object"&&i.id==="codex");if(!s||!Array.isArray(s.windows))return null;const a=s.windows.find(i=>i!==null&&typeof i=="object"&&Number(i.windowSeconds)===fo);if(!a||typeof a.remainingPercent!="number"||!Number.isFinite(Number(a.remainingPercent)))return null;const n=Math.max(0,Math.min(100,Math.round((100-Number(a.remainingPercent))*10)/10)),l=Number(a.resetAt),r=Number.isFinite(l)&&l>0?new Date(l*1e3).toISOString():"";return{weekly:{percent:n,resetsAt:r}}}const Z={status:"idle",windows:{},fetchedAt:0,inFlight:null,listeners:[]},go=t=>(Z.listeners.push(t),()=>{Z.listeners=Z.listeners.filter(o=>o!==t)}),ho=()=>{for(const t of Z.listeners)try{t()}catch{}};async function Ft(t=!1,o=!1){if(!o)return;if(Z.inFlight!==null)return Z.inFlight;if(!t&&Z.fetchedAt>0&&Date.now()-Z.fetchedAt<5*6e4)return;const s=(async()=>{try{const a=await fetch(po,{credentials:"same-origin",headers:{accept:"application/json"},signal:AbortSignal.timeout(8e3)});let n={};if(a.ok){const l=bo(await a.json().catch(()=>null));l!==null&&(n=l)}Z.status=Object.keys(n).length>0?"ok":"unavailable",Z.windows=n}catch{Z.status="unavailable"}finally{Z.fetchedAt=Date.now(),Z.inFlight=null,ho()}})();return Z.inFlight=s,s}function _t(t){const[o,s]=L(()=>({status:Z.status,windows:Z.windows,fetchedAt:Z.fetchedAt}));return X(()=>{if(!t)return;let a=!0;const n=()=>{a&&s({status:Z.status,windows:Z.windows,fetchedAt:Z.fetchedAt})},l=go(n);return n(),Ft(!1,!0),()=>{a=!1,l()}},[t]),o}function yo(t){const o=bt(),{state:s,wide:a}=t,n=z(F(s.config)),l=s.config?.codexQuotaEnabled===!0&&s.config?.codexQuotaSidebar!==!1,r=_t(l),i=Ce(()=>Ft(!0,l));if(!l||r.status!=="ok")return null;const d=r.windows.weekly??null;if(d===null)return null;const u=oe(s.config,"plan"),c=Ye(n("goShortWeekly"),d,u,n),m=[n("codexQuotaTitle"),ft(c.label,u,n),Ge(d,n),r.fetchedAt>0?n("goQuotaFetchedAt",{time:new Date(r.fetchedAt).toLocaleTimeString()}):null,...ge(n,i)].filter(Boolean).join(`
4
4
  `),p=e(E,null,e("div",{className:"cm-mm-title"},n("codexQuotaTitle")),c.row),b=e("div",{className:"cm-bbox-rail cm-num"},c.label===null?"—":c.label+"%");return e($,{label:e("span",{style:{whiteSpace:"pre-line"}},m),side:"right",delayMs:300},e("div",{...o,className:"cm-bbox cm-mm clickable"+(c.level==="ok"?"":" "+c.level)+(a===!1?" rail":"")+(i.busy?" busy":""),...me(i.busy,i.run)},a===!1?b:p))}function Wt(t,o){return t==="fiveHour"||t==="5h"?"5h":t==="weekly"||t==="week"||t==="7d"?t==="7d"?"7d":o("goShortWeekly"):t==="monthly"||t==="month"?o("goShortMonthly"):t==="daily"||t==="day"?o("goShortDaily"):t==="plan"?o("mimoWindowPlan"):t==="compensation"?o("mimoWindowCompensation"):t==="balance"?o("codingPlanWindowBalance"):String(t).replace(/_/g," ")}function ko(t){const o=bt(),{id:s,state:a,wide:n,api:l}=t,r=a.codingPlans?.[s],i=z(F(a.config)),d=Ce(l?()=>l.refreshCodingPlan(s):null),u=Be.find(f=>f.id===s);if(!u||!r||r.status!=="ok")return null;const c=r.windows!==null&&typeof r.windows=="object"?r.windows:{},m=Object.entries(c);if(m.length===0)return null;const p=f=>f!==null&&typeof f=="object"&&typeof f.percent=="number"?Math.max(0,Math.min(100,Math.round(Number(f.percent)||0))):null,b=oe(a.config,"plan"),g=m.map(([f,S])=>{const y=p(S);if(y===null)return e("div",{key:f,className:"cm-mm-row wide"},e("span",{className:"cm-mm-text"},typeof S?.text=="string"?S.text:"—"));const O=y>=100?"over":y>=80?"warn":"ok",A=de(y,b);return e("div",{key:f,className:"cm-mm-row wide"+(O==="ok"?"":" "+O)},e("span",{className:"cm-bbox-label"},Wt(f,i)),e("div",{className:"cm-bbox-bar"},e("div",{className:"cm-bbox-fill",style:{width:A.width+"%"}})),e("span",{className:"cm-bbox-pct cm-num"},A.label===null?"—":A.label+"%"))}),h=m.map(([f,S])=>{const y=p(S),O=Ge(S,i),A=y===null?typeof S?.text=="string"?S.text:"—":ft(de(y,b).label,b,i);return Wt(f,i)+" "+A+(O?" · "+O:"")});r.fetchedAt>0&&h.push(i("goQuotaFetchedAt",{time:new Date(r.fetchedAt).toLocaleTimeString()})),h.push(...ge(i,d));const x=[i(u.labelKey),...h].join(`
5
5
  `),N=m.map(([,f])=>p(f)).filter(f=>f!==null),T=N.some(f=>f>=100)?"over":N.some(f=>f>=80)?"warn":"ok",v=N.length>0?N.slice(0,2).map(f=>de(f,b).label+"%").join(" "):typeof m[0][1]?.text=="string"?m[0][1].text:"—";return e($,{label:e("span",{style:{whiteSpace:"pre-line"}},x),side:"right",delayMs:300},e("div",{...o,className:"cm-bbox cm-mm clickable"+(T==="ok"?"":" "+T)+(n===!1?" rail":"")+(d.busy?" busy":""),...me(d.busy,d.run)},n===!1?e("div",{className:"cm-bbox-rail cm-num"},v):e(E,null,e("div",{className:"cm-mm-title"},i(u.labelKey)),...g)))}const Qa=t=>{try{return window.localStorage?.getItem?.("cm.gw."+t)??""}catch{return""}},wo=(t,o)=>{try{window.localStorage?.setItem?.("cm.gw."+t,o)}catch{}};function xo(t){const o=bt(),{source:s,snapshot:a,state:n,wide:l,api:r}=t,i=z(F(n.config)),[d,u]=L(()=>({source:s.id,id:Qa(s.id)})),c=Ce(r?()=>r.refreshGatewayQuota(s.id):null),m=oe(n.config,"plan"),p=a.accounts.length>1,b=d.source===s.id?d.id:Qa(s.id),g=a.accounts.findIndex(P=>P.id===b),h=g>=0?g:Math.max(0,a.accounts.findIndex(P=>P.windows.length>0||P.credits!=null)),x=a.accounts[h]??a.accounts[0],N=x?.label||x?.id||"",T=P=>p?(pa[P.provider]??P.provider)+" · ":"",v=p&&x?[x]:a.accounts,f=[];for(const P of v){if(f.length>=4)break;for(const Q of P.windows){if(f.length>=4)break;const R=T(P)+(Q.label||Q.id||i("gatewaySourceUnknown"));f.push({win:Q,name:R,view:Ye(R,Q,m,i)})}P.windows.length===0&&P.credits!=null&&f.push({win:null,name:T(P)+(P.credits.unit||"credits"),text:(P.credits.used??"—")+" / "+(P.credits.limit??"—")})}f.length===0&&f.push({name:i("gatewayQuotaEmpty"),text:"—"});const S=f.some(P=>P.view?.level==="over")?"over":f.some(P=>P.view?.level==="warn")?"warn":"ok",y=f.map(P=>{if(P.text!=null)return P.name+" "+P.text;const Q=Ge(P.win,i);return P.name+" "+ft(P.view.label,m,i)+(Q?" · "+Q:"")});a.fetchedAt>0&&y.push(i("goQuotaFetchedAt",{time:new Date(a.fetchedAt).toLocaleTimeString()})),y.push(...ge(i,c));const A=[p&&N?`${s.label||s.id} (${h+1}/${a.accounts.length} · ${N})`:s.label||s.id,...y].join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cost-meter",
3
- "version": "1.8.22",
3
+ "version": "1.8.23",
4
4
  "description": "DeepSeek Harness 会话费用统计插件:本会话成本、当日费用、历史记录与官方价格同步,支持多厂商多模型价格计费(内置 170+ 模型 ID 价格目录与自动匹配)、主流 Coding Plan 订阅额度查询与显示(11 家,含小米 MiMo Token Plan 控制台 Cookie 查询、SCNet Token Plan 本地 Credits 计量与火山方舟 Volcano Ark Coding Plan AK/SK 签名查询)、自定义 Provider 余额查询(可配任意 HTTP 端点)与余额进度条、峰谷计价时段显示与切换前弹窗/系统通知提醒(位置/提前量/类型可配),界面中英双语。Session cost tracking plugin for DeepSeek Harness: per-conversation cost, daily totals, history and official price sync, with multi-vendor model pricing (built-in 170+ model-ID catalog with auto-matching), Coding Plan quota queries & display for 11 vendors (incl. Xiaomi MiMo Token Plan via console cookie, local credits metering for the SCNet Token Plan and Volcano Ark Coding Plan via AK/SK signature), plan/API dual-track billing with per-1% & full-window Token Plan usage estimates, custom provider balance lookup (configurable HTTP endpoint) and balance progress bar, plus peak/off-peak pricing display with pre-switch popup & system-notification alerts (position / lead time / type configurable), in a bilingual (Chinese/English) UI.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",