dsh-cost-meter 1.7.42 → 1.7.44
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 +7 -7
- package/README.zh-CN.md +7 -7
- package/lib/client.js +1 -1
- package/package.json +5 -4
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 90+ model price 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
|
-
[](https://github.com/Han-1413141/dsh-cost-meter)
|
|
12
12
|
|
|
13
|
-
**v1.7.
|
|
13
|
+
**v1.7.44** fixes installation rejection and startup skipping on DSH 0.2.0-rc.1. See the [release notes](docs/release-notes/v1.7.44.md).
|
|
14
14
|
|
|
15
15
|
[](https://www.npmjs.com/package/dsh-cost-meter)
|
|
16
16
|
[](LICENSE)
|
|
@@ -317,22 +317,22 @@ On Node.js 20, use `npm install -g pnpm@10` instead. See [pnpm installation and
|
|
|
317
317
|
dsh plugin --profile web add dsh-cost-meter
|
|
318
318
|
```
|
|
319
319
|
|
|
320
|
-
**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.7.
|
|
320
|
+
**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.7.44`** — review the script before running):
|
|
321
321
|
|
|
322
322
|
```powershell
|
|
323
|
-
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.7.
|
|
323
|
+
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.7.44/install.ps1 | iex
|
|
324
324
|
```
|
|
325
325
|
|
|
326
326
|
**Or a plain command line** (the machine must already have pnpm and git; also pinned to the tag):
|
|
327
327
|
|
|
328
328
|
```sh
|
|
329
|
-
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.7.
|
|
329
|
+
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.7.44
|
|
330
330
|
```
|
|
331
331
|
|
|
332
332
|
Without git, use the GitHub tag archive:
|
|
333
333
|
|
|
334
334
|
```sh
|
|
335
|
-
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.7.
|
|
335
|
+
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.7.44.tar.gz
|
|
336
336
|
```
|
|
337
337
|
|
|
338
338
|
After installing, **restart** `dsh web` (plugin rows, the Typert manifest and the client bundle are all scanned at startup):
|
|
@@ -380,7 +380,7 @@ minimumReleaseAgeExclude:
|
|
|
380
380
|
- '<name@version from the error>'
|
|
381
381
|
```
|
|
382
382
|
|
|
383
|
-
|
|
383
|
+
DSH `0.2.0-rc.1` passes packed installation, Web startup, shared-module checks, synthetic billing, RPC and the full regression suite. Earlier host checks cover installation, startup, shared modules and removal on DSH `0.1.2-rc.1`, `0.1.3-alpha.2` and `0.1.5-alpha.1`. `0.1.3-alpha.1` remains unknown because its official npm version was unavailable during the earlier check. See the [compatibility record](docs/host-compatibility.md) for the environment and limits.
|
|
384
384
|
|
|
385
385
|
### Update / Uninstall
|
|
386
386
|
|
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 用量热图 · 多厂商多模型价格计费(内置 90+ 模型价格目录与自动匹配) · 主流 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
|
-
[](https://github.com/Han-1413141/dsh-cost-meter)
|
|
12
12
|
|
|
13
|
-
**v1.7.
|
|
13
|
+
**v1.7.44**:修复 DSH 0.2.0-rc.1 拒绝安装和启动时跳过插件的问题。详见[更新说明](docs/release-notes/v1.7.44.md)。
|
|
14
14
|
|
|
15
15
|
[](https://www.npmjs.com/package/dsh-cost-meter)
|
|
16
16
|
[](LICENSE)
|
|
@@ -317,22 +317,22 @@ Node.js 20 请改用 `npm install -g pnpm@10`。版本要求见 [pnpm 官方安
|
|
|
317
317
|
dsh plugin --profile web add dsh-cost-meter
|
|
318
318
|
```
|
|
319
319
|
|
|
320
|
-
**PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.7.
|
|
320
|
+
**PowerShell 一键脚本**(复制整行粘贴回车;自动补齐 pnpm、自动探测 git,无需克隆仓库;安装链**固定到发布 tag `v1.7.44`**,建议先下载审阅再运行):
|
|
321
321
|
|
|
322
322
|
```powershell
|
|
323
|
-
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.7.
|
|
323
|
+
irm https://raw.githubusercontent.com/Han-1413141/dsh-cost-meter/v1.7.44/install.ps1 | iex
|
|
324
324
|
```
|
|
325
325
|
|
|
326
326
|
**或直接命令行**(机器上需已有 pnpm 与 git;同样固定到 tag):
|
|
327
327
|
|
|
328
328
|
```sh
|
|
329
|
-
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.7.
|
|
329
|
+
dsh plugin --profile web add github:Han-1413141/dsh-cost-meter#v1.7.44
|
|
330
330
|
```
|
|
331
331
|
|
|
332
332
|
没有 git 时可用 GitHub tag 打包直链:
|
|
333
333
|
|
|
334
334
|
```sh
|
|
335
|
-
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.7.
|
|
335
|
+
dsh plugin --profile web add https://github.com/Han-1413141/dsh-cost-meter/archive/refs/tags/v1.7.44.tar.gz
|
|
336
336
|
```
|
|
337
337
|
|
|
338
338
|
安装后**重启** `dsh web`(插件行、Typert 清单与客户端 bundle 均在启动时扫描):
|
|
@@ -380,7 +380,7 @@ minimumReleaseAgeExclude:
|
|
|
380
380
|
- '<报错中的包名>@<版本>'
|
|
381
381
|
```
|
|
382
382
|
|
|
383
|
-
|
|
383
|
+
DSH `0.2.0-rc.1` 已通过安装包安装、Web 启动、模块复用、合成计费、RPC 和完整回归。此前宿主适配验证覆盖 DSH `0.1.2-rc.1`、`0.1.3-alpha.2`、`0.1.5-alpha.1` 的安装、启动、模块复用和卸载;`0.1.3-alpha.1` 在此前核查中无可获取的官方 npm 版本,暂标记为未知。验证环境及边界见[兼容记录](docs/host-compatibility.md)。
|
|
384
384
|
|
|
385
385
|
### 更新 / 卸载
|
|
386
386
|
|
package/lib/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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:jt=>{var Qt={exports:{}},rt=Qt.exports;Object.defineProperty(rt,Symbol.toStringTag,{value:"Module"});const Ee=jt("react"),{Tooltip:Z}=jt("@deepseek-ai/dsh-client-ui-primitives"),Ge=!1,qa='.cm-root{display:block;text-align:center;max-width:var(--dsh-chat-content-width,720px);width:100%;margin:0 auto;box-sizing:border-box;padding:4px calc(var(--dsh-composer-side-clearance,0px) + 16px) 0;font-size:12px;line-height:20px;color:var(--dsw-alias-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(--dsw-alias-bg-layer-2);font-size:12px;line-height:22px;color:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-interactive-bg-hover)}.cm-foot-rail{width:100%;justify-content:center;padding:0;font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary)}.cm-num{font-variant-numeric:tabular-nums}.cm-go-rail{font-size:11px;font-weight:700;color:var(--dsw-alias-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(--dsw-alias-label-secondary)}.cm-go-bar{flex:1;height:6px;border-radius:3px;background:var(--dsw-alias-interactive-bg-hover);overflow:hidden}.cm-go-fill{height:100%;border-radius:3px;background:var(--dsw-alias-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(--dsw-alias-label-tertiary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cm-go-time{font-size:11px;color:var(--dsw-alias-label-tertiary)}.cm-go-row.main .cm-go-label{font-weight:600;color:var(--dsw-alias-label-primary)}.cm-corner{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:6px;width:100%;max-width:var(--dsh-chat-content-width,720px);margin:2px auto 0;box-sizing:border-box;padding:0 calc(var(--dsh-composer-side-clearance,0px) + 16px)}.cm-corner-chip{display:inline-flex;align-items:center;height:20px;padding:0 8px;border-radius:6px;background:var(--dsw-alias-bg-layer-2);font-size:11px;line-height:20px;color:var(--dsw-alias-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(--dsw-alias-bg-layer-2);font-size:11px;line-height:22px;color:var(--dsw-alias-label-secondary);white-space:nowrap;font-variant-numeric:tabular-nums;cursor:default}.cm-qchip .cm-qlabel{color:var(--dsw-alias-label-primary);font-weight:600}.cm-qchip .cm-qbar{display:block;width:44px;height:4px;border-radius:2px;background:var(--dsw-alias-border-l1);overflow:hidden;flex:none}.cm-qchip .cm-qfill{display:block;height:100%;border-radius:2px;background:var(--dsw-alias-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(--dsw-alias-border-l1);flex:none}.cm-qchip .cm-qtext{color:var(--dsw-alias-label-secondary)}.cm-qchip.warn .cm-qfill{background:var(--dsw-alias-state-warn-primary)}.cm-qchip.over .cm-qfill{background:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-tertiary)}.cm-plan-tag{flex:none;margin-left:6px;padding:0 6px;border-radius:999px;border:1px solid var(--dsw-alias-border-l1);font-size:10px;line-height:16px;color:var(--dsw-alias-state-warn-primary)}.cm-plan-reset,.cm-plan-method{font-size:11px;color:var(--dsw-alias-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(--dsw-alias-border-l1);border-radius:12px;background:var(--dsw-alias-bg-layer-1);box-shadow:0 8px 28px #0000002e;padding:14px 16px;font-size:13px;color:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-tertiary);cursor:pointer;user-select:none}.cm-cards-toggle:hover{color:var(--dsw-alias-label-primary)}.cm-cards-toggle input{margin:0;cursor:pointer}.cm-card,.cm-budget{border:1px solid var(--dsw-alias-border-l1);border-radius:12px;padding:14px 16px;background:var(--dsw-alias-bg-layer-1)}.cm-card-title{font-size:12px;color:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-interactive-text-hover,var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-secondary);background:transparent;border:none;border-radius:8px;padding:6px 14px;cursor:pointer;white-space:nowrap}.cm-tab.active{background:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-label-primary-inverted);font-weight:600}.cm-tabs-row .cm-msg{padding:2px 10px}.cm-note{font-size:12px;color:var(--dsw-alias-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(--dsw-alias-border-l1);white-space:nowrap}.cm-table th{color:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-tertiary)}.cm-empty{font-size:12px;color:var(--dsw-alias-label-tertiary);padding:8px 0}.cm-scroll{max-height:320px;overflow:auto;border:1px solid var(--dsw-alias-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(--dsw-alias-label-secondary)}.cm-input{font:inherit;font-size:13px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-base);border:1px solid var(--dsw-alias-border-l1);border-radius:8px;padding:6px 10px;outline:none}.cm-input:focus{border-color:var(--dsw-alias-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(--dsw-alias-state-business-primary)}.cm-range-value{flex:none;min-width:44px;font-size:12px;color:var(--dsw-alias-label-tertiary);text-align:right}.cm-check{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--dsw-alias-label-primary);cursor:pointer}.cm-price-card{border:1px solid var(--dsw-alias-border-l1);border-radius:10px;padding:12px 14px;display:flex;flex-direction:column;gap:10px;background:var(--dsw-alias-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(--dsw-alias-label-tertiary);border:1px solid var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-primary);background:var(--dsw-alias-button-elevated-fill);border:1px solid var(--dsw-alias-border-l1);border-radius:8px;padding:6px 14px;cursor:pointer}.cm-btn.primary{background:var(--dsw-alias-state-business-primary);border-color:transparent;color:var(--dsw-alias-label-primary-inverted)}.cm-btn.primary:hover{opacity:.88;background:var(--dsw-alias-state-business-primary)}.cm-btn.danger,.cm-msg.err,.cm-bal-line.err,.cm-bal-err{color:var(--dsw-alias-state-error-primary)}.cm-btn.small{padding:3px 10px;font-size:12px}.cm-msg{font-size:12px;line-height:18px;padding:8px 12px;border-radius:8px;border:1px solid var(--dsw-alias-border-l1)}.cm-msg.ok{color:var(--dsw-alias-state-success-primary)}.cm-hint{font-size:12px;color:var(--dsw-alias-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(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-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(--dsw-alias-state-warn-primary)}.cm-peak-alert-offpeak{border-top:3px solid var(--dsw-alias-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(--dsw-alias-state-warn-primary)}.cm-peak-alert-offpeak .cm-peak-alert-badge{color:var(--dsw-alias-state-info-primary,#3b82f6)}.cm-peak-alert-title{font-size:14px;font-weight:600;color:var(--dsw-alias-label-primary)}.cm-peak-alert-body{color:var(--dsw-alias-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(--dsw-alias-bg-layer-3);overflow:hidden}.cm-budget-fill{height:100%;border-radius:999px;background:var(--dsw-alias-state-business-primary);transition:width .3s ease}.cm-ug{display:flex;flex-direction:column;gap:12px}.cm-ug-total{font-size:13px;color:var(--dsw-alias-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(--dsw-alias-label-primary) 8%,transparent);border:1px solid var(--dsw-alias-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(--dsw-alias-state-business-primary) 25%,var(--dsw-alias-bg-layer-3))}.cm-ug-cell.l2{background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 50%,var(--dsw-alias-bg-layer-3))}.cm-ug-cell.l3{background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 75%,var(--dsw-alias-bg-layer-3))}.cm-ug-cell.l4{background:var(--dsw-alias-state-business-primary)}.cm-ug-cell.today{outline:1px solid var(--dsw-alias-label-secondary);outline-offset:1px}.cm-ug-months{display:grid;grid-auto-flow:column;gap:3px;width:100%;font-size:10px;color:var(--dsw-alias-label-tertiary);margin-top:4px}.cm-ug-monthc{white-space:nowrap}.cm-budget-line{font-size:13px;color:var(--dsw-alias-label-secondary)}.cm-budget-line.over{color:var(--dsw-alias-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(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-3)}.cm-peak-segment{height:100%;flex:1}.cm-peak-high{background:#ff9800}.cm-peak-low{background:var(--dsw-alias-state-business-primary)}.cm-peak-marker{position:absolute;top:0;left:50%;width:2px;height:100%;background:var(--dsw-alias-bg-base);box-shadow:0 0 0 1px var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-bg-base);border:1.5px solid #ff9800;box-shadow:0 0 0 1px var(--dsw-alias-bg-base),0 0 0 2px var(--dsw-alias-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(--dsw-alias-state-business-primary)}.cm-peak-classic.off .cm-peak-classic-marker:after{border-top-color:var(--dsw-alias-state-business-primary)}.cm-peak-classic-chip{align-self:flex-start;font-size:11px;font-weight:600;line-height:1.4;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);border-radius:999px;padding:2px 8px;white-space:nowrap;color:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-3)}.cm-peak-rail-segment{width:100%;flex:1}.cm-peak-rail-high{background:#ff9800}.cm-peak-rail-low{background:var(--dsw-alias-state-business-primary)}.cm-peak-rail-marker{position:absolute;left:0;top:50%;width:100%;height:2px;background:var(--dsw-alias-bg-base);box-shadow:0 0 0 1px var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-border-l1);background:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-bg-base);border:1.5px solid #ff9800;box-shadow:0 0 0 1px var(--dsw-alias-bg-base),0 0 0 2px var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-tertiary);border-bottom:1px solid var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-tertiary);border-bottom:1px solid var(--dsw-alias-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(--dsw-alias-label-secondary)}.cm-vendor-display{display:inline-flex;align-items:center;gap:4px;font-weight:400;font-size:11px;color:var(--dsw-alias-label-tertiary);white-space:nowrap}.cm-catalog-family{margin:6px 0 2px;font-size:11px;font-weight:600;color:var(--dsw-alias-label-tertiary)}.cm-catalog-row{display:flex;align-items:center;gap:8px;padding:4px 0;border-top:1px solid var(--dsw-alias-border-l1);font-size:12px}.cm-catalog-mounted{display:flex;flex-direction:column;gap:4px;padding:6px 0;border-top:1px solid var(--dsw-alias-border-l1)}.cm-catalog-id{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cm-catalog-price{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-size:11px}.cm-catalog-tag{font-size:10px;padding:1px 6px;border-radius:999px;border:1px solid var(--dsw-alias-state-business-primary);color:var(--dsw-alias-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(--dsw-alias-border-l1);border-radius:999px;padding:2px 12px;font-size:12px;color:var(--dsw-alias-label-secondary);cursor:pointer}.cm-mstats-tab.active{background:var(--dsw-alias-state-business-primary);border-color:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-bg-base);font-weight:600}.cm-mstats-h{margin:10px 0 4px;font-size:12px;font-weight:600;color:var(--dsw-alias-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(--dsw-alias-label-secondary)}.cm-mstats-barbg{position:relative;height:10px;border-radius:999px;background:var(--dsw-alias-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(--dsw-alias-state-business-primary)}.cm-mstats-seg.cache{background:#ff9800}.cm-mstats-seg.out{background:#34a853}.cm-mstats-val{white-space:nowrap;color:var(--dsw-alias-label-secondary)}.cm-mstats-legend{display:flex;gap:12px;font-size:10px;color:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-border-l1);border-radius:12px;padding:8px 10px;background:var(--dsw-alias-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(--dsw-alias-state-warn-primary)}.cm-bbox.over{border-color:var(--dsw-alias-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(--dsw-alias-label-primary)}.cm-bbox.warn .cm-bbox-pct{color:var(--dsw-alias-state-warn-primary)}.cm-bbox.over .cm-bbox-pct{color:var(--dsw-alias-state-error-primary)}.cm-bbox-bar{height:6px;border-radius:999px;background:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-secondary)}.cm-dir-row .cm-input{flex:1 1 60%;width:auto}.cm-bbox-fill{height:100%;border-radius:999px;background:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-tertiary);text-decoration:none;outline:none}.cm-bal-link:hover{color:var(--dsw-alias-brand-primary);background:var(--dsw-alias-interactive-bg-hover)}.cm-bal-link:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-state-error-primary)}.cm-bbox-line{font-size:12px;color:var(--dsw-alias-label-tertiary)}.cm-bbox-rail{font-size:11px;font-weight:600;color:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-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(--dsw-alias-border-l1);margin:0}.cm-bbox.clickable,.cm-foot.clickable{cursor:pointer}.cm-bbox.clickable:hover{border-color:var(--dsw-alias-state-business-primary)}.cm-bbox.clickable:focus-visible,.cm-foot.clickable:focus-visible{outline:2px solid var(--dsw-alias-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(--dsw-alias-label-primary)}.cm-mm-reset{font-size:11px;color:var(--dsw-alias-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(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary)}.cm-gw-switcher:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.cm-gw-sub{font-size:11px;color:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-secondary)}.cm-bal-line.warn{color:var(--dsw-alias-state-warning-primary,#b45309)}:has(>.cm-footer-stack){flex-wrap:wrap}:has(>.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(--dsw-alias-border-l1);border-radius:10px;background:var(--dsw-alias-bg-layer-1)}.cm-footer-stack.simple>*{flex-shrink:0}.cm-footer-stack.simple:focus-visible{outline:2px solid var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-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(--dsw-alias-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}}',Ft="dsh-cost-meter/client.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(Ft)+"]")===null){const t=document.createElement("style");t.dataset.plugin="dsh-cost-meter",t.dataset.pluginCss=Ft,t.textContent=qa,document.head.appendChild(t)}const Te={zh:{sessionCostTitle:"本会话费用(按每次调用实际时刻精确计费)",sessionDetailTokens:"输入 {input} · 缓存 {cache} · 输出 {output}",sessionDetailCache:"缓存:读 {read} · 写 {write}(写入按命中价计费)",cost:"费用 {amount}",sessionLine:"本会话 {amount} · 命中 {hitRate} · 输入 {input} · 缓存 {cache} · 输出 {output}",quotaUnlimited:"无限制",pricingCnyHint:"当前人民币金额来自美元价格 × 汇率 {rate}。对照官方人民币账单,请选择 CNY,再同步价格;同步会更新历史费用。",balanceQueryFailed:"余额查询失败:{message}",unknownError:"未知错误",balance:"余额",queryFailed:"查询失败",balanceTitle:"DeepSeek 开放平台账户余额",reconcileLabel:"官方余额变动与本地账本交叉对账(偏差超阈时提示)",totalBalance:"总余额 {amount}",grantedToppedUp:"赠送 {granted} · 充值 {toppedUp}",updatedAt:"更新时间 {time}",budgetOf:"预算({period})",usedOf:"已用 {used} / {amount}",todayShare:"今日 {amount} · 占预算 {pct}",monthTotal:"本月 {month} · 累计 {total}",budget:"预算",todayCostTitle:"今日费用(按官方价格精确计费)",todayTokensTitle:"今日 Token 用量",tokensUnit:"tokens",callsTokens:"调用 {calls} 次 · 输入 {input} · 缓存 {cache} · 输出 {output}",monthCost:"本月 {amount}",totalCost:"累计 {amount}",today:"今日",sidebarTodayMetric:"侧边栏今日显示",sidebarTodayCost:"费用",sidebarTodayTokens:"Token 用量",periodDay:"今日",periodMonth:"本月",periodAll:"累计",periodCustomRange:"自定义区间",noHistory:"暂无历史记录。开始对话后,费用将按天汇总在这里。",colDate:"日期",colCalls:"调用",colInTok:"输入 tok",colCacheTok:"缓存 tok",colOutTok:"输出 tok",colCost:"费用",noSessionsToday:"今日暂无会话记录。",colSession:"会话",enableBudget:"启用预算",budgetAmountLabel:"预算额度(按显示币种)",budgetPeriodLabel:"预算周期",startDate:"开始日期",endDate:"结束日期(留空 = 今日)",rangeText:"统计区间:{range}",budgetDisabledNote:"启用预算后显示额度、已用金额及比例(按显示币种换算);可选今日、本月、累计或自定义周期。",budgetStatus:"{period}预算 {amount} · 已用 {used} · {pct}%",overLimit:"(已超出)",nearLimit:"(接近上限)",legacyModel:"旧模型",defaultFallback:"默认回退",remove:"移除",tierBase:"基础",tierOffPeak:"谷时",tierPeak:"峰时",balanceRefreshFailed:"余额刷新失败:{message}",balanceLine:"总余额 {total} · 赠送 {granted} · 充值 {toppedUp} · 更新于 {time}",balanceQueryFailedHint:"余额查询失败:{message}(使用 设置→模型 中配置的 API Key)",balanceNotQueried:"未查询余额",accountBalance:"官方账户余额",refreshing:"刷新中…",refreshBalance:"刷新余额",customBalanceTitle:"自定义 Provider 余额",customBalanceAdd:"添加配置",aliyunBalanceAdd:"添加千问 / 阿里云余额",aliyunBalanceNote:"查询阿里云中国站可用金。RAM AccessKey 需 bss:DescribeBillingAccount 权限。前两项必填;STS 才需 Security Token。密钥存凭据库。",customBalanceConfigNote:"extract 支持点路径、数值和 add/subtract/divide 运算;NewApi quota 除以 500000 得到美元。",customBalanceLabelZh:"中文名称",customBalanceLabelEn:"英文名称",customBalanceUrl:"请求 URL",customBalanceMethod:"请求方法",customBalanceHeaders:"请求头 (JSON)",customBalanceBody:"请求体 (JSON)",customBalanceBodyNote:"留空不发送;JSON 原文保存并发送。默认 Content-Type 为 application/json,可在请求头覆盖。",customBalanceExtract:"解析规则 (JSON)",customBalanceDisplayLabel:"自定义余额显示位置",customBalanceRefreshInterval:"刷新间隔 (分钟)",customBalanceUnitLabel:"余额原币种",customBalanceConvert:"按显示币种折算(USD 余额)",customBalanceConvertNote:"使用显示汇率与精度;余额币种保持端点原币种。其他币种及积分不折算。",balanceBarRemaining:"余额 {amount}",balanceBarToday:"当日已用 {amount}",balanceBarSpent:"已用 {amount}",balanceShowProgressBar:"余额进度条 (蓝=余额,橙=当日,灰=已用)",barDirectionsTitle:"进度条方向",barDirectionsHint:"各组进度条可独立选择填充方向:「剩余方向」满条起步、随消耗递减;「已用方向」空条起步、随消耗填满。",barDirection_balance:"余额条(官方/自定义)",barDirection_budget:"预算条",barDirection_go:"Go 额度条",barDirection_plan:"Plan / Codex 额度条",barDirectionRemaining:"剩余方向(满 → 空)",barDirectionUsed:"已用方向(空 → 满)",balanceBudgetCapLabel:"额度上限 (可选)",balanceBudgetCapHint:"留空则优先使用 API 返回的 max_budget;仍无则显示整条浅蓝",customBalanceInvalidJson:"JSON 格式无效",customBalanceHeadersVarNote:"{{VAR_NAME}} 从凭据库或环境变量读取。<ROUTE>_API_KEY 中 ROUTE 为大写 Provider ID,符号改下划线,如 openai→OPENAI_API_KEY。同名共用密钥。",customBalanceAllowedHosts:"凭据白名单 (逗号分隔)",customBalanceAllowedHostsHint:"请求头带密钥时仅放行列表内主机,留空则放行并警告,防导入他人配置外带密钥。",customBalanceCredentialsTitle:"凭据输入",customBalanceCredentialsHint:"为上方 {{VAR}} 占位符存入密钥(write-only,只写凭据库,不回显):",customBalanceNoPlaceholders:'请求头还没有 {{VAR}} 占位符:填入如 "Authorization": "Bearer {{MY_API_KEY}}" 后这里会出现凭据输入框。',enable:"启用",customBalanceLine:"剩余 {remaining} · 已用 {spend} / 额度 {maxBudget} · 更新于 {time}",customBalanceRemaining:"剩余 {amount}",refreshCustomBalance:"刷新自定义余额",goQuotaTitle:"OpenCode Go 订阅额度",goQuotaRowLabel:"Go",goWindowRolling:"滚动 5 小时",goWindowWeekly:"本周",goWindowMonthly:"本月",goResetAt:"重置:{time}",resetReached:"已到重置时间",resetDays:"剩余 {d}天{h}小时",resetHours:"剩余 {h}小时{m}分",resetMinutes:"剩余 {m}分钟",quotaUsed:"已用 {pct}%",quotaRemaining:"剩余 {pct}%",goQuotaPercent:"{percent}%",goQuotaFetchedAt:"更新于 {time}",goQuotaDisplayLabel:"Go 额度显示位置",goQuotaRefreshIntervalLabel:"Go 额度刷新间隔(分钟)",goQuotaRefreshMinutesUnit:"分钟",goQuotaKeyLabel:"OpenCode Go API Key(可选,留空自动发现)",goMainLabel:"Go 额度主档位",goDetailLabel:"Go 图框详细信息",credentialConfiguredOf:"已配置(来源:{source})",credentialNotConfigured:"未配置",credentialSave:"保存",credentialClear:"清除",credentialSaving:"保存中…",credentialInputHint:"密钥只写入 DSH 凭据库,不保存在账本里,也不会回显。",secretMigrationPending:"以下密钥仍在本地账本,未迁入凭据库。请导出对应环境变量后重启:",budgetDetailLabel:"预算图框详细信息",refreshGoQuota:"刷新额度",goQuotaNotQueried:"未查询额度",codingPlanAnthropic:"Anthropic(Claude Pro/Max)",codingPlanZai:"Z.ai / 智谱 GLM Coding Plan",codingPlanMinimax:"MiniMax Token Plan",codingPlanMinimaxTitle:"MiniMax Plan",minimaxOrigin:"查询域名(HTTPS)",minimaxOriginNote:"留空自动选择官方站点。填写后 Key 仅发往该域名;使用可信地址,不含路径。",codingPlanRemain5h:"5h",codingPlanRemain7d:"7d",balanceRechargeLink:"打开 DeepSeek 充值页(platform.deepseek.com/usage)",codexQuotaTitle:"ChatGPT (Codex) 周额度",codexQuotaEnabled:"显示 Codex 额度(需安装并登录 dsh-openai-codex)",includeSubagentCost:"本会话费用包含子代理",gatewayQuotaEmpty:"暂无额度数据",codingPlanDisplayLabel:"显示位置",codingPlanDisplayNote:"选「主页面侧边栏 / 两者」后显示额度卡片;窄栏显示百分比。",codingPlanKeyLabel:"API Key(可选,留空自动发现)",codingPlanRefreshIntervalLabel:"刷新间隔(分钟)",refreshCodingPlan:"刷新",codingPlanNotQueried:"未查询额度",gatewayQuotaTitle:"CLIProxyAPI 网关额度",gatewaySourceAdd:"添加来源",gatewaySourceLabel:"来源名称",gatewaySourceBaseURL:"Base URL",gatewaySourceDisplay:"显示位置",gatewaySourceAllowlist:"允许的 Host",gatewaySourceCredential:"Management Key(只写)",gatewaySourceStatus:"状态",gatewaySourceUnsupported:"不支持的 Provider",gatewaySourceUnknown:"未知",gatewaySourceNoAccounts:"未发现账号",gatewaySourceFetchedAt:"抓取于 {time}",gatewaySwitchAccount:"切换账号 (当前: {account})",gatewayOnlyGemini:"只显示 Gemini 额度",refresh:"刷新",quotaEnableFirst:"先勾选启用这一项",quotaRefreshReady:"启用并保存显示位置后可刷新",quotaRemove:"删除",quotaSectionNote:"勾选启用后会排到最上面;点名称可展开该项自己的配置。自定义余额最多 8 条,网关来源最多 4 条。",codingPlanDisabledNote:"未启用。开启后将按刷新间隔查询该厂商的 coding plan 额度并显示在这里。",goQuotaDisabledNote:"开启后读取 OpenCode Go 的滚动 5 小时、周、月额度,显示在侧栏、设置页及右下角;无订阅时提示原因。",cornerLabel:"右下角显示(dock)",cornerEnabledLabel:"在右下角显示 OpenCode Go 额度 / 预算",cornerGoRolling:"滚动 5 小时额度",cornerGoWeekly:"本周额度",cornerGoMonthly:"本月额度",cornerBudget:"预算已用%",goShortRolling:"5h",goShortWeekly:"周",goShortMonthly:"月",goShortDaily:"日",budgetShort:"预算",ledgerReadFailed:"账本读取失败:{message}",readingLedger:"正在读取账本…",ledgerUnavailable:"账本不可用",syncFailed:"同步失败:{message}",historyCleared:"历史记录已清除。",clearFailed:"清除失败:{message}",peakOff:"峰谷计价已关闭,按基础价格计费",peakNotEffective:"尚未生效(生效时间:{time}),当前按基础价格计费",peakActive:"当前处于峰时段,按峰时价计费",peakNotice:"当前为 DeepSeek 峰时高价时段,按峰时价计费",offPeakActive:"当前处于谷时段,按谷时价计费",weekendAllOffPeak:"周末时段——全谷价(周六及周日全天按谷时价计费)",weekendChip:"周末时段——全谷价",weekendShort:"周末全谷",holidayAllOffPeak:"法定假日——全天谷价",holidayChip:"法定假日——全谷价",holidayShort:"假日",peakHolidaysLabel:"法定假日(北京日期,逗号分隔)",weekendRuleNote:"自 2026-08-23 北京时间 00:00 起,周末和中国公众假期全天谷价;调休上班的周末仍按谷价。",peakShort:"峰时",offPeakShort:"平价",peakStyleLabel:"峰谷时段条样式",peakStyleCompact:"简洁(单行紧凑)",peakStyleClassic:"经典(分段与胶囊芯片)",peakAlertLabel:"峰/谷切换前弹窗提醒",peakAlertAheadLabel:"提前提醒(分钟,1-30)",peakAlertTargetLabel:"提醒类型",peakAlertTargetPeak:"进入峰时",peakAlertTargetOffPeak:"进入谷时",peakAlertTargetBoth:"峰和谷",peakAlertTitlePeak:"即将进入峰时",peakAlertTitleOffPeak:"即将进入谷时",peakAlertBody:"约 {time} 后计费档位切换为{phase}价,请注意本时段调用成本。",peakAlertPhasePeak:"峰时",peakAlertPhaseOffPeak:"谷时",peakAlertBtn:"知道了",peakAlertBadgePeak:"峰价提醒",peakAlertBadgeOffPeak:"谷价提醒",peakAlertPositionLabel:"弹窗位置",peakAlertPositionCorner:"右下角",peakAlertPositionCenter:"屏幕中心",peakAlertWebNotifyLabel:"同步发送系统通知",peakAlertWebNotifyHint:"开关后请在浏览器地址栏允许通知权限,才能在页面最小化/切走时收到提醒。",peakAlertPreviewLabel:"预览弹窗",peakAlertPreviewPeak:"预览 进入峰",peakAlertPreviewOffPeak:"预览 进入谷",peakAlertPreviewTag:"(预览)",peakPanelTitle:"峰谷计价与提示",peakNoticeHiddenHint:"提示已隐藏:需启用峰谷计价并开启「峰时高价时段显著提示」。",groupGeneral:"常规",groupMoney:"金额与币种",groupSidebar:"侧边栏显示",sidebarSimple:"简化侧栏显示",sidebarSimpleNote:"精简卡片,保留金额、额度和悬停详情;高度最多占屏幕 38%,超出可滚动。关闭后恢复。",sidebarSimpleTitle:"试试更轻巧的侧栏",sidebarSimpleBody:"简化显示可以为会话列表留出更多空间。要现在开启吗?之后可在「设置 → 费用 → 显示」中切换。",sidebarSimpleOn:"开启简化显示",sidebarSimpleOff:"保留当前显示",sidebarSimpleError:"设置未能保存。可重试,或关闭提示后在设置中调整。",closeGuide:"关闭提示",todayBudget:"今日 / {period}预算",sidebarStyleLabel:"侧边栏进度条样式",sidebarStyleStandard:"标准",sidebarStyleCompact:"紧凑(两列)",restorePriceMatches:"恢复已移除的模型 ({count})",removePriceMatchHint:"移除会清除手动映射并隐藏此行,可恢复;不会删除用量记录,后续按自动匹配规则计价。",groupCorner:"右下角角标",groupDetail:"图框详细信息",catalogTitle:"拓展价格表",catalogNote:"按厂商和模型分类的参考价。挂载后可编辑并计费;DeepSeek 取消挂载后用默认价。",catalogOpen:"展开拓展价格表",catalogCollapse:"收起拓展价格表",mountBtn:"挂载",unmountBtn:"取消挂载",mountedTag:"已挂载",catalogUnpriced:"未核价",catalogDeepseekNote:"DeepSeek 取消挂载后按默认价计费。",modelStatsTitle:"按模型统计(token 与费用)",modelsTitle:"侧栏模型花费",modelsCount:"{n} 模型",modelsOther:"其它",models_enabled:"显示模型花费卡片",models_defaultOpen:"默认展开",models_remember:"记住展开状态",models_tokens:"显示 Token",models_shares:"显示费用占比条",models_dock:"右下角显示 Top-1 模型",models_period:"默认周期",models_summary:"收起摘要",models_position:"卡片位置",models_topN:"模型行数(1–10)",models_refreshSeconds:"刷新间隔(10–60 秒)",modelsTotal:"周期总额与模型数",modelsTop:"Top-1 模型与金额",modelsFirst:"顶部",modelsAfter:"余额之后",modelsLast:"底部",modelStatsToday:"今日",modelStatsHistory:"近 90 天",modelStatsCostH:"费用排行",modelStatsTokensH:"Token 消耗",modelStatsHitH:"缓存命中率",modelStatsHitUnreported:"未上报?",modelStatsHitUnreportedTip:"长调用无缓存命中:代理可能移除缓存字段。金额按全未命中计,是上界;可直连核对。",modelStatsValueH:"性价比 · 每美元 token 数",modelStatsInput:"输入",modelStatsCache:"缓存",modelStatsOutput:"输出",modelStatsEmpty:"该时段暂无用量数据。",modelStatsBlended:"综合单价 {price}/M",modelStatsNote:"命中率=缓存读÷(缓存读+普通输入);「未上报?」表示缓存字段可能缺失,金额为上界。单价=费用÷token×1M;性价比=token÷费用。",modelStatsLegacy:"未分模型(早期数据 · 按当时记录计费)",sessionLineSplit:"本会话 {amount}(API)· Plan 等值 {planAmount} · 命中 {hitRate} · 输入 {input} · 缓存 {cache} · 输出 {output}",costChipPlan:"费用 {amount}(+Plan)",sessionDetailPlan:"Plan 订阅额度消耗(等值){amount}",planStatsTitle:"Token Plan 用量统计(每 1% 与满窗估算)",planStatsEmpty:"尚无 Coding Plan 额度数据;请在「额度」页开启并刷新厂商。",planStatsWindow:"窗口",planStatsPercent:"已用 %",planStatsLocal:"本周期实际(本地账本)",planStatsPer1:"每 1% 额度 ≈",planStatsFull:"满窗 100% ≈",planStatsResets:"重置 {time}",planStatsMethodSample:"采样差分",planStatsMethodLive:"当前用量折算",planStatsMethodNone:"样本不足",planStatsMethodSampleAt:"{method}(基准 {time})",planStatsConfidenceLow:"读数精度受限",planStatsCurveTitle:"Plan 用量曲线(按采样区间聚合)",planStatsDaily:"每日",planStatsWeekly:"每周",planStatsMonthly:"每月",planStatsCurveEmpty:"采样不足:至少两次成功刷新,且额度百分比发生变化。",planStatsBarTip:"{date}:满窗估计 ≈ {full}(每 1% ≈ {per1})· 实际 {tokens} / {cost} · {intervals} 个采样区间",planStatsNote:"金额是目录价等值;订阅耗额度,预算只计 API。估算仅含 dsh 调用;服务端百分比含全账号。短时样本精度有限;5h 滚动,周/月按本地日历。",billingClassLabel:"计费方式",billingClassPlan:"Plan 订阅",billingClassAuto:"自动",billingClassApi:"API 按量",catalogDisplayLabel:"在费用设置直接显示",catalogDisplayHint:"仅控制是否在费用价格表直接显示;不影响挂载和计费。隐藏的已挂载模型仍可在拓展表编辑。",priceTableDisplayHint:"可逐模型切换显示位置。DeepSeek 默认直接显示,第三方默认在拓展表。",catalogCustomModels:"手动新增模型",priceMatchLabel:"未知模型名自动匹配",priceMatchAuto:"自动(去后缀 / 前缀 / 家族相似)",priceMatchExact:"仅精确匹配",priceMatchNote:"手动指定优先;自动匹配只接受同名及日期、版本、上下文后缀。未命中的 DeepSeek 用默认价,其他渠道不计价。",unmatchedTitle:"最近出现但未命中价格的模型",unmatchedHint:"这些模型没有价格。可手动指定;「默认价」使用 DeepSeek 默认价。本地推理默认零费用。",overrideTargetDefault:"DeepSeek 默认价",overrideRemove:"移除",overrideTargetLocal:"本地模型(零消耗)",matchedTitle:"本月已命中价格的模型",matchedHint:"这些模型自动匹配价格。可改选价格或零费用;token 仍统计。保存后移入手动指定区。",matchedKeepAuto:"保持自动命中",overrideNone:"暂无手动匹配覆盖。",mountedSuffix:"已挂载(参与计费)",flatInput:"输入",flatCached:"缓存",flatOutput:"输出",deepseekMountedHeader:"DeepSeek 价格表(已挂载)",codingPlanKimi:"Kimi / Moonshot",codingPlanOpenrouter:"OpenRouter",codingPlanSiliconflow:"SiliconFlow 硅基流动",codingPlanCommandcode:"CommandCode",codingPlanScnet:"SCNet 超算互联网 Token Plan",codingPlanVolcengine:"火山方舟 Volcano Ark Coding Plan",codingPlanQwen:"千问 Qwen Token Plan",codingPlanMimo:"小米 MiMo Token Plan",mimoWindowPlan:"套餐积分",mimoWindowCompensation:"补偿积分",codingPlanWindowBalance:"余额",qwenSource:"额度来源",qwenSourceLocal:"本地估算",qwenSourceCli:"官方 CLI",qwenSourceBailian:"百炼 CLI",qwenCliNote:"CLI 模式需在 DSH 主机安装 @qianwenai/qianwen-cli,并以同一系统账号运行 qianwen auth login。",qwenBailianNote:"百炼 CLI:在 DSH 主机安装 bailian-cli 并以同一系统账号运行 bl auth login --console。",qwenPlanCreditsLabel:"月度 Credits 额度(个人版 Lite 5 万 / 标准版 50 万,以订阅页为准)",qwenPlanStartLabel:"订阅起始日(可选,格式 YYYY-MM-DD;留空按自然月)",qwenRatesLabel:"Credits 抵扣率覆盖(可选;每百万 token 抵扣的 Credits,留空用内置表)",qwenRatesModelPlaceholder:"模型名,如 qwen3.8-max-preview",qwenRatePlaceholder:"费率",qwenRate_input:"输入",qwenRate_cachedInput:"缓存读",qwenRate_output:"输出",qwenRateDraftNote:"待填齐三项正数后自动保存;全部清空恢复内置表。",qwenRatesAdd:"添加",qwenLocalNote:"Credits 本地估算,以控制台为准。只计 qwen 及 qwen/qianwen-tokenplan 订阅渠道,含 llm- 前缀;不计按量 API。表外模型需设抵扣率。",scnetPlanCreditsLabel:"本地估算月度 Credits 额度(基础 60,000 / 标准 240,000 / 高级 600,000)",scnetPlanStartLabel:"订阅起始日(可选,格式 YYYY-MM-DD;留空按自然月)",scnetLocalNote:"优先用 24 小时内的控制台快照,否则按本地账本和官方 Credits 表估算。其他工具和表外模型不计入。",volcengineAccessKeyIdLabel:"火山引擎 AccessKey ID",volcengineSecretAccessKeyLabel:"火山引擎 SecretAccessKey",volcengineNote:"火山方舟需 AK/SK、ArkReadOnlyAccess 和 BillingCenterReadOnlyAccess;可填凭据或导出 VOLC_ACCESSKEY/VOLC_SECRETKEY。只连接 open.volcengineapi.com。",volcengineAccessKeyPlaceholder:"AK...",volcengineSecretPlaceholder:"SK...",countdownHoursOnly:"{h}小时",countdownHourMinute:"{h}小时{m}分",countdownMinute:"{m}分钟",nextOffPeakIn:"{time}后进入平价",nextPeakIn:"{time}后进入高峰",peakSummary:"峰时段(UTC):{windows};生效时间:{time}。{status}",noPeakWindows:"未配置峰谷时段。{status}",unknown:"未知",cardToday:"今日费用",cardMonth:"本月费用",cardTotal:"累计费用",cardTotalSub:"自账本建立以来 · 调用 {calls} 次",externalUsage:"外部用量",combinedUsage:"DSH + 外部合计",externalStale:"外部快照超过 24 小时未更新",externalHistory:"近期每日记录",cardsFootnote:"金额取最近快照,可能比官方账单晚几分钟。tokens 含输入、输出、缓存和推理;推理并入输出计费。以金额对账。",timezoneHint:"今日/本月按宿主时区 {host},浏览器为 {browser}。时区不同会影响日界和对账;可将 dsh 改为本地时区。",todaySessions:"今日会话",historyExpandHint:"点击日期行可展开当日会话明细",historySessionsLoading:"会话明细加载中…",historyNoSessions:"该日无会话明细(早期数据或会话日志已清理)",historySessionsError:"会话明细加载失败",sessionRankTitle:"按会话统计(全部历史)",sessionRankHint:"不按日期分组,全部历史会话;排序与条数可切换",sessionRankEmpty:"暂无会话数据",sessionRankLoading:"会话排行加载中…",sessionRankError:"会话排行加载失败",sessionRankLimit:"显示条数",showSessionIdLabel:"会话列表附显会话 ID",cardsTogglePlanTotal:"金额含 Plan 总额",cardsTogglePlanTotalHint:"开启后所有金额按含 Plan 订阅等值的总费用展示;关闭(默认)仅计真金白银 API 渠道",hideOfficialBalanceLabel:"隐藏官方账户余额(开启后侧边栏与设置页不再显示官方余额)",hideTodayCostLabel:"隐藏今日消耗金额(开启后侧边栏/预算明细/概览卡片不再显示今日费用)",sessionRankSort:"排序",sessionSortCostDesc:"费用 高→低",sessionSortCostAsc:"费用 低→高",sessionSortTimeDesc:"时间 新→旧",sessionSortTimeAsc:"时间 旧→新",sessionSortRecent:"实时顺序",history:"历史记录",usageTitle:"Token 用量统计",usageTotal:"累计 {tokens} tokens · 输入 {input} · 缓存 {cache} · 输出 {output} · {calls} 次调用",usageDay:"{date}:共 {tokens} tokens(输入 {input} · 缓存 {cache} · 输出 {output})· {calls} 次调用 · {cost}",usageEmpty:"暂无历史数据,开始对话后每日用量会汇总在这里",usageSectionLabel:"用量",usagePositionLabel:"Token 用量统计位置",usagePositionCost:"费用设置",usagePositionGeneral:"通用设置",usagePositionSection:"独立分节(用量)",displaySettings:"显示设置",tabOverview:"概览",tabQuotas:"额度",tabUsage:"用量",tabPricing:"价格",tabDisplay:"显示",historyDataTitle:"历史数据",positionLabel:"会话费用显示位置",positionDock:"输入区下方",positionHeader:"会话标题栏",off:"关闭",quotaStripGroup:"输入框上方额度横条",quotaStripEnable:"启用额度横条(输入框上方一条横排显示)",quotaStripShowBudget:"横条含预算已用%",quotaStripShowGo:"横条含 Go 额度",quotaStripShowPlans:"横条含 Coding Plan 额度",quotaStripNote:"横条悬停可见各窗口重置时刻与更新时间;无可用额度数据时自动隐藏。",quotaStripGuideTitle:"新增:输入框上方额度横条",quotaStripGuideBody:"在输入框上方显示预算及 OpenCode Go/Coding Plan 额度百分比。现在开启吗?可在「设置 → 显示设置」修改。",quotaStripGuideOn:"开启横条",quotaStripGuideOff:"暂不开启",clickToRefresh:"点击立即刷新",balanceClickGuideTitle:"新增:余额图框点击刷新",balanceClickGuideBody:"点击侧边栏余额或 Coding Plan 图框即可刷新;刷新时图框闪烁,失败时保留原值并在悬停提示中说明原因。",balanceClickGuideOk:"知道了",sidebarLabel:"当日费用显示",sidebarOn:"侧边栏底部",currencyLabel:"货币单位",currencyCny:"人民币 CNY",currencyUsd:"美元 USD",currencyEur:"欧元 EUR",symbolLabel:"货币符号",rateLabel:"汇率(1 美元 = ? 目标币种)",decimalsLabel:"小数位数",balanceDisplayLabel:"余额显示位置",balanceSidebar:"主页面侧边栏",balanceSettings:"设置页",balanceBoth:"两者都显示",refreshIntervalLabel:"余额刷新间隔(分钟)",peakEnabledLabel:"启用 DeepSeek 峰谷时段价格",peakNoticeLabel:"峰时高价时段显著提示(侧边栏预算框/今日费用;设置页峰谷面板内预览)",badgeNote:"会话按调用时价格计费(含峰谷与历史档位)。输入、输出、缓存读写分开统计;独立缓存写入价与长上下文档位按配置生效。",priceTableTitle:"价格表(美元 / 1M tokens)",pricingCurrencyLabel:"官方价格币种",pricingCurrencyUsd:"美元(英文官方页)",pricingCurrencyCny:"人民币(中文官方页)",pricingCurrencyNote:"决定同步价格所用的官方页语言。切换并同步后后台重算历史;日志不全的会话保留原价。完成后提示。",priceTableNote:"按调用时间计价:Flash 自 9 月 10 日北京 12:00 用新价,V4 Pro 自 9 月 14 日同刻用 Flash 价;此前用历史价。工作日 09–12、14–18 峰价翻倍;周末及中国公众假期全天谷价。缓存写入按命中价。",datedPriceNote:"这里显示当前适用价格。手工编辑会取消此条后续预定调价,已发生的历史价格仍保留。",defaultModelId:"default(未匹配模型时回退)",newModelPlaceholder:"新模型 ID(如 deepseek-v4-pro)",addModel:"添加模型",dataSync:"数据与同步",saving:"保存中…",autoSaveFailed:"自动保存失败:{message}",autoSavedAt:"已自动保存 {time}",autoSaveHint:"配置修改后自动保存",confirmFetch:"确认用官方文档价格覆盖价格表?",apply:"应用",cancel:"取消",syncFromDocs:"从官方文档同步价格",syncScopeNote:"官方同步只更新 DeepSeek 价格(含峰谷);z-ai/Kimi/Qwen/Volcano 等第三方价格随版本更新,也可在拓展价格表或模型名匹配中调整。",confirmReset:"确认清除全部历史?",importLegacy:"导入安装前历史",confirmImportLegacy:"确认导入?将回放全部会话日志,只补账本缺失的日期与会话,不影响已有记录。",legacyImportFailed:"导入安装前历史失败:{message}",legacyImportNote:"首次启动自动导入旧记录;拷入日志后可重跑。按当前价格回推;已删除日志无法回放,跨安装时刻的会话不计此前用量。",confirmClear:"确认清除",clearAllHistory:"清除全部历史",lastSync:"最近同步:{time}",neverSynced:"从未(使用内置价格)",source:";来源:{source}",sourceOfficial:"官方文档",sourceBundled:"内置默认",languageLabel:"界面语言",localeAuto:"跟随浏览器(自动)",localeZh:"简体中文",localeEn:"English",sectionLabel:"费用",rpcFailed:"{method} 调用失败",rpcSyncFailed:"同步调用失败",rpcBalanceFailed:"余额刷新调用失败"},en:{sessionCostTitle:"Cost of this session (billed exactly at each call time)",sessionDetailTokens:"Input {input} · Cache {cache} · Output {output}",sessionDetailCache:"Cache: read {read} · write {write} (writes billed at the hit price)",cost:"Cost {amount}",sessionLine:"This session {amount} · Hit {hitRate} · Input {input} · Cache {cache} · Output {output}",quotaUnlimited:"Unlimited",pricingCnyHint:"CNY totals use USD prices × {rate}. To compare official CNY bills, select CNY, then sync prices; syncing also updates historical costs.",balanceQueryFailed:"Balance query failed: {message}",unknownError:"Unknown error",balance:"Balance",queryFailed:"Query failed",balanceTitle:"DeepSeek open-platform account balance",reconcileLabel:"Cross-check official balance changes against the local ledger (warn when they diverge)",totalBalance:"Total {amount}",grantedToppedUp:"Granted {granted} · Topped-up {toppedUp}",updatedAt:"Updated {time}",budgetOf:"Budget ({period})",usedOf:"Used {used} / {amount}",todayShare:"Today {amount} · {pct} of budget",monthTotal:"This month {month} · All time {total}",budget:"Budget",todayCostTitle:"Today's cost (billed exactly at official prices)",todayTokensTitle:"Today's token usage",tokensUnit:"tokens",callsTokens:"Calls {calls} · Input {input} · Cache {cache} · Output {output}",monthCost:"This month {amount}",totalCost:"All time {amount}",today:"Today",sidebarTodayMetric:"Sidebar today display",sidebarTodayCost:"Cost",sidebarTodayTokens:"Token usage",periodDay:"Today",periodMonth:"This month",periodAll:"All time",periodCustomRange:"Custom range",noHistory:"No history yet. Once you start chatting, costs are aggregated here per day.",colDate:"Date",colCalls:"Calls",colInTok:"In tok",colCacheTok:"Cache tok",colOutTok:"Out tok",colCost:"Cost",noSessionsToday:"No sessions recorded today.",colSession:"Session",enableBudget:"Enable budget",budgetAmountLabel:"Budget amount (in display currency)",budgetPeriodLabel:"Budget period",startDate:"Start date",endDate:"End date (empty = today)",rangeText:"Range: {range}",budgetDisabledNote:"Enable a budget to see its limit, used amount and percentage in the display currency. Choose today, month, all time or a custom range.",budgetStatus:"{period} budget {amount} · Used {used} · {pct}%",overLimit:" (over limit)",nearLimit:" (near limit)",legacyModel:"Legacy",defaultFallback:"Default fallback",remove:"Remove",tierBase:"Base",tierOffPeak:"Off-peak",tierPeak:"Peak",balanceRefreshFailed:"Balance refresh failed: {message}",balanceLine:"Total {total} · Granted {granted} · Topped-up {toppedUp} · Updated {time}",balanceQueryFailedHint:"Balance query failed: {message} (uses the API key configured in Settings → Models)",balanceNotQueried:"Balance not queried",accountBalance:"Account balance",refreshing:"Refreshing…",refreshBalance:"Refresh balance",customBalanceTitle:"Custom provider balance",customBalanceAdd:"Add entry",aliyunBalanceAdd:"Add Qianwen / Alibaba Cloud balance",aliyunBalanceNote:"Shows Alibaba Cloud China funds. RAM AccessKey needs bss:DescribeBillingAccount. The first two fields are required; Security Token is for STS. Secrets stay in the credential store.",customBalanceConfigNote:"Extract accepts paths, numbers and add/subtract/divide. Divide NewApi quota by 500000 for USD.",customBalanceLabelZh:"Chinese name",customBalanceLabelEn:"English name",customBalanceUrl:"Request URL",customBalanceMethod:"HTTP method",customBalanceHeaders:"Headers (JSON)",customBalanceBody:"Request body (JSON)",customBalanceBodyNote:"Blank sends no body; JSON text is saved and sent as entered. Content-Type defaults to application/json; headers can override it.",customBalanceExtract:"Extract rules (JSON)",customBalanceDisplayLabel:"Custom balance display",customBalanceRefreshInterval:"Refresh interval (minutes)",customBalanceUnitLabel:"Source currency",customBalanceConvert:"Convert USD balance to display currency",customBalanceConvertNote:"Uses the display rate and precision. Keep the source currency; other currencies and credits stay unchanged.",balanceBarRemaining:"Balance {amount}",balanceBarToday:"Today {amount}",balanceBarSpent:"Spent {amount}",balanceShowProgressBar:"Balance progress bar (blue=balance, orange=today, gray=spent)",barDirectionsTitle:"Progress bar direction",barDirectionsHint:'Each group of bars can independently choose its fill direction: "Remaining" starts full and drains with usage; "Used" starts empty and fills up.',barDirection_balance:"Balance bars (official/custom)",barDirection_budget:"Budget bar",barDirection_go:"Go quota bar",barDirection_plan:"Plan / Codex quota bars",barDirectionRemaining:"Remaining (full → empty)",barDirectionUsed:"Used (empty → full)",balanceBudgetCapLabel:"Budget cap (optional)",balanceBudgetCapHint:"Leave empty to use API max_budget; if still missing, show full light-blue bar",customBalanceInvalidJson:"Invalid JSON",customBalanceHeadersVarNote:"{{VAR_NAME}} reads a credential or environment variable. <ROUTE>_API_KEY uses an uppercase Provider ID with underscores, such as openai→OPENAI_API_KEY. Names can share a key.",customBalanceAllowedHosts:"Allowed hosts (comma-separated)",customBalanceAllowedHostsHint:"When headers carry credentials only listed hosts are allowed; leave empty to allow with a warning. Protects keys when importing someone else's config.",customBalanceCredentialsTitle:"Credential input",customBalanceCredentialsHint:"Store the key for each {{VAR}} placeholder above (write-only: stored in the DSH credential store, never echoed back):",customBalanceNoPlaceholders:'No {{VAR}} placeholders in the headers yet — add e.g. "Authorization": "Bearer {{MY_API_KEY}}" and a credential input will appear here.',enable:"Enable",customBalanceLine:"Remaining {remaining} · Spent {spend} / Budget {maxBudget} · Updated {time}",customBalanceRemaining:"Remaining {amount}",refreshCustomBalance:"Refresh custom balance",goQuotaTitle:"OpenCode Go subscription quota",goQuotaRowLabel:"Go",goWindowRolling:"Rolling 5h",goWindowWeekly:"Weekly",goWindowMonthly:"Monthly",goResetAt:"Resets: {time}",resetReached:"Reset time reached",resetDays:"{d}d {h}h left",resetHours:"{h}h {m}m left",resetMinutes:"{m}m left",quotaUsed:"{pct}% used",quotaRemaining:"{pct}% remaining",goQuotaPercent:"{percent}%",goQuotaFetchedAt:"Updated {time}",goQuotaDisplayLabel:"Go quota display position",goQuotaRefreshIntervalLabel:"Go quota refresh interval (minutes)",goQuotaRefreshMinutesUnit:"min",goQuotaKeyLabel:"OpenCode Go API key (optional; empty = auto-detect)",goMainLabel:"Go quota primary window",goDetailLabel:"Go box details",credentialConfiguredOf:"Configured (source: {source})",credentialNotConfigured:"Not configured",credentialSave:"Save",credentialClear:"Clear",credentialSaving:"Saving…",credentialInputHint:"The key is written to the DSH credential store only — it is never saved in the ledger and never echoed back.",secretMigrationPending:"These credentials remain in the local ledger. Export the matching environment variables and restart:",budgetDetailLabel:"Budget box details",refreshGoQuota:"Refresh quota",goQuotaNotQueried:"Quota not queried",codingPlanAnthropic:"Anthropic (Claude Pro/Max)",codingPlanZai:"Z.ai / Zhipu GLM Coding Plan",codingPlanMinimax:"MiniMax Token Plan",codingPlanMinimaxTitle:"MiniMax Plan",minimaxOrigin:"Quota origin (HTTPS)",minimaxOriginNote:"Empty: official sites. Otherwise the Key is sent only to this origin. Use a trusted address without a path.",codingPlanRemain5h:"5h",codingPlanRemain7d:"7d",balanceRechargeLink:"Open DeepSeek top-up page (platform.deepseek.com/usage)",codexQuotaTitle:"ChatGPT (Codex) weekly quota",codexQuotaEnabled:"Show Codex quota (requires signed-in dsh-openai-codex)",includeSubagentCost:"Include subagents in session cost",gatewayQuotaEmpty:"No quota data",codingPlanDisplayLabel:"Display position",codingPlanDisplayNote:"“Main sidebar / Both” shows a quota card; the narrow rail shows percentages.",codingPlanKeyLabel:"API key (optional; empty = auto-detect)",codingPlanRefreshIntervalLabel:"Refresh interval (minutes)",refreshCodingPlan:"Refresh",codingPlanNotQueried:"Quota not queried",gatewayQuotaTitle:"CLIProxyAPI gateway quotas",gatewaySourceAdd:"Add source",gatewaySourceLabel:"Source label",gatewaySourceBaseURL:"Base URL",gatewaySourceDisplay:"Display",gatewaySourceAllowlist:"Allowed hosts",gatewaySourceCredential:"Management key (write-only)",gatewaySourceStatus:"Status",gatewaySourceUnsupported:"Unsupported providers",gatewaySourceUnknown:"Unknown",gatewaySourceNoAccounts:"No accounts",gatewaySourceFetchedAt:"fetched {time}",gatewaySwitchAccount:"Switch account (current: {account})",gatewayOnlyGemini:"Gemini quota only",refresh:"Refresh",quotaEnableFirst:"Enable this item first",quotaRefreshReady:"Enable and save a display position to refresh",quotaRemove:"Remove",quotaSectionNote:"Enabled items move to the top; click a name to expand its own settings. Up to 8 custom balances and 4 gateway sources.",codingPlanDisabledNote:"Disabled. Enable it to query this vendor's coding plan quota on the refresh interval and show it here.",goQuotaDisabledNote:"Enable OpenCode Go rolling 5h, weekly and monthly quotas in the sidebar, Settings and bottom-right corner. Missing subscriptions show a reason.",cornerLabel:"Bottom-right (dock) display",cornerEnabledLabel:"Show OpenCode Go quota / budget at the bottom-right",cornerGoRolling:"Rolling-5h quota",cornerGoWeekly:"Weekly quota",cornerGoMonthly:"Monthly quota",cornerBudget:"Budget used %",goShortRolling:"5h",goShortWeekly:"Wk",goShortMonthly:"Mo",goShortDaily:"Daily",budgetShort:"Budget",ledgerReadFailed:"Ledger read failed: {message}",readingLedger:"Reading ledger…",ledgerUnavailable:"Ledger unavailable",syncFailed:"Sync failed: {message}",historyCleared:"History cleared.",clearFailed:"Clear failed: {message}",peakOff:"Peak/off-peak pricing is off; base prices are used",peakNotEffective:"Not yet effective (effective at {time}); base prices are currently used",peakActive:"Peak hour now; peak prices apply",peakNotice:"DeepSeek peak-hour pricing is active; current calls are billed at peak prices",offPeakActive:"Off-peak now; off-peak prices apply",weekendAllOffPeak:"Weekend — all off-peak (Sat & Sun billed at off-peak prices all day)",weekendChip:"Weekend — all off-peak",weekendShort:"Weekend",holidayAllOffPeak:"Chinese public holiday — off-peak all day",holidayChip:"Public holiday — all off-peak",holidayShort:"Holiday",peakHolidaysLabel:"Public holidays (Beijing dates, comma separated)",weekendRuleNote:"Since Aug 23, 2026 (Beijing time), weekends and Chinese public holidays are off-peak all day, including work-shift weekends.",peakShort:"Peak",offPeakShort:"Off-peak",peakStyleLabel:"Peak period strip style",peakStyleCompact:"Compact (one-line)",peakStyleClassic:"Classic (segments & chip)",peakAlertLabel:"Popup alert before peak/off-peak switch",peakAlertAheadLabel:"Lead time (minutes, 1-30)",peakAlertTargetLabel:"Alert type",peakAlertTargetPeak:"Entering peak",peakAlertTargetOffPeak:"Entering off-peak",peakAlertTargetBoth:"Both",peakAlertTitlePeak:"Entering peak hours soon",peakAlertTitleOffPeak:"Entering off-peak hours soon",peakAlertBody:"Billing switches to {phase} pricing in about {time}; mind your call costs in this window.",peakAlertPhasePeak:"peak",peakAlertPhaseOffPeak:"off-peak",peakAlertBtn:"Got it",peakAlertBadgePeak:"Peak alert",peakAlertBadgeOffPeak:"Off-peak alert",peakAlertPositionLabel:"Popup position",peakAlertPositionCorner:"Bottom-right",peakAlertPositionCenter:"Screen center",peakAlertWebNotifyLabel:"Also send a system notification",peakAlertWebNotifyHint:"When enabled, allow notification permission in the browser address bar so you get alerted even when the page is minimized or backgrounded.",peakAlertPreviewLabel:"Preview the popup",peakAlertPreviewPeak:"Preview entering peak",peakAlertPreviewOffPeak:"Preview entering off-peak",peakAlertPreviewTag:" (preview)",peakPanelTitle:"Peak/off-peak pricing & notice",peakNoticeHiddenHint:"Notice hidden: enable peak/off-peak pricing and the “prominent notice” toggle.",groupGeneral:"General",groupMoney:"Money & currency",groupSidebar:"Sidebar display",sidebarSimple:"Simplify the sidebar",sidebarSimpleNote:"Condense cards but keep amounts, quotas and hover details. Height is capped at 38% of the viewport with scrolling. Turn off to restore.",sidebarSimpleTitle:"A lighter sidebar",sidebarSimpleBody:"Simple display leaves more room for conversations. Enable it now? You can change it in Settings → Cost → Display anytime.",sidebarSimpleOn:"Enable simple display",sidebarSimpleOff:"Keep current display",sidebarSimpleError:"Settings could not be saved. Retry or dismiss this guide and change them later in Settings.",closeGuide:"Dismiss guide",todayBudget:"Today / {period} budget",sidebarStyleLabel:"Sidebar progress style",sidebarStyleStandard:"Standard",sidebarStyleCompact:"Compact (2 columns)",restorePriceMatches:"Restore removed models ({count})",removePriceMatchHint:"Remove clears the override and hides the row until restored. Usage records are kept; automatic price matching applies.",groupCorner:"Corner chips",groupDetail:"Box details",catalogTitle:"Extended price catalog",catalogNote:"Reference prices by vendor and model. Mount to edit and bill; unmounted DeepSeek uses its default price.",catalogOpen:"Expand extended price catalog",catalogCollapse:"Collapse extended price catalog",mountBtn:"Mount",unmountBtn:"Unmount",mountedTag:"Mounted",catalogUnpriced:"Unpriced",catalogDeepseekNote:"Unmounted DeepSeek models use the default price.",modelStatsTitle:"Per-model statistics (tokens & cost)",modelsTitle:"Sidebar model costs",modelsCount:"{n} models",modelsOther:"Other",models_enabled:"Show model cost card",models_defaultOpen:"Expand by default",models_remember:"Remember expansion",models_tokens:"Show tokens",models_shares:"Show cost shares",models_dock:"Top model in corner dock",models_period:"Default period",models_summary:"Collapsed summary",models_position:"Card position",models_topN:"Model rows (1–10)",models_refreshSeconds:"Refresh interval (10–60 seconds)",modelsTotal:"Period total and model count",modelsTop:"Top model and cost",modelsFirst:"Top",modelsAfter:"After balances",modelsLast:"Bottom",modelStatsToday:"Today",modelStatsHistory:"Last 90 days",modelStatsCostH:"Cost ranking",modelStatsTokensH:"Token usage",modelStatsHitH:"Cache hit rate",modelStatsHitUnreported:"unreported?",modelStatsHitUnreportedTip:"Zero cache hits on long calls may mean a relay removed cache fields. All-miss cost is an upper bound; check with the direct API.",modelStatsValueH:"Value · tokens per USD",modelStatsInput:"Input",modelStatsCache:"Cache",modelStatsOutput:"Output",modelStatsEmpty:"No usage data for this period.",modelStatsBlended:"blended {price}/M",modelStatsNote:"Hit rate = cache reads ÷ (reads + uncached input). “Unreported?” means cache data may be missing, so cost is an upper bound. Unit price = cost ÷ tokens × 1M; value = tokens ÷ cost.",billingClassLabel:"Billing class",billingClassPlan:"Plan subscription",billingClassAuto:"Auto",billingClassApi:"API usage",modelStatsLegacy:"Unattributed (early data · billed as recorded)",sessionLineSplit:"This session {amount} (API) · Plan equiv. {planAmount} · Hit {hitRate} · Input {input} · Cache {cache} · Output {output}",costChipPlan:"Cost {amount} (+Plan)",sessionDetailPlan:"Plan subscription quota usage (equiv.) {amount}",planStatsTitle:"Token Plan usage stats (per-1% & full-window estimates)",planStatsEmpty:"No Coding Plan quota data yet. Enable and refresh a provider under Quotas.",planStatsWindow:"Window",planStatsPercent:"Used %",planStatsLocal:"This period actual (local ledger)",planStatsPer1:"Per 1% quota ≈",planStatsFull:"Full window (100%) ≈",planStatsResets:"resets {time}",planStatsMethodSample:"sample delta",planStatsMethodLive:"current usage ratio",planStatsMethodNone:"not enough samples",planStatsMethodSampleAt:"{method} (as of {time})",planStatsConfidenceLow:"low reading precision",planStatsCurveTitle:"Plan usage curves (aggregated from sample intervals)",planStatsDaily:"Daily",planStatsWeekly:"Weekly",planStatsMonthly:"Monthly",planStatsCurveEmpty:"Not enough samples: refresh successfully twice with a quota percentage change.",planStatsBarTip:"{date}: full-window est. ≈ {full} (per 1% ≈ {per1}) · actual {tokens} / {cost} · {intervals} sample interval(s)",planStatsNote:"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/month use local dates.",catalogDisplayLabel:"Show directly in Cost settings",catalogDisplayHint:"Controls direct display in Cost settings; mounting and billing stay unchanged. Hidden models remain editable in this catalog.",priceTableDisplayHint:"Choose where each model appears. DeepSeek shows directly; other vendors default to the catalog.",catalogCustomModels:"Custom models",priceMatchLabel:"Auto-match unknown model names",priceMatchAuto:"Auto (strip suffix / prefix / family similarity)",priceMatchExact:"Exact match only",priceMatchNote:"Manual overrides take priority. Auto-match accepts only the same name or date, version and context suffixes. Unknown DeepSeek models use the default price; other providers stay unpriced.",unmatchedTitle:"Recently seen models without a price hit",unmatchedHint:"These models have no price. Assign one manually; “Default price” uses DeepSeek defaults. Local inference costs zero until assigned.",overrideTargetDefault:"DeepSeek default price",overrideRemove:"Remove",overrideTargetLocal:"Local model (zero cost)",matchedTitle:"Models matched this month",matchedHint:"These models matched automatically. Choose another price or zero cost; tokens still count. Saved overrides move to the manual list.",matchedKeepAuto:"Keep auto match",overrideNone:"No manual match overrides.",mountedSuffix:"Mounted (billed)",flatInput:"Input",flatCached:"Cached",flatOutput:"Output",deepseekMountedHeader:"DeepSeek price table (mounted)",codingPlanKimi:"Kimi / Moonshot",codingPlanOpenrouter:"OpenRouter",codingPlanSiliconflow:"SiliconFlow",codingPlanCommandcode:"CommandCode",codingPlanScnet:"SCNet Token Plan",codingPlanVolcengine:"Volcano Ark Coding Plan",codingPlanQwen:"Qwen Token Plan (qianwenai.com)",codingPlanMimo:"Xiaomi MiMo Token Plan",mimoWindowPlan:"Plan credits",mimoWindowCompensation:"Compensation",codingPlanWindowBalance:"Balance",qwenSource:"Quota source",qwenSourceLocal:"Local estimate",qwenSourceCli:"Official CLI",qwenSourceBailian:"Bailian CLI",qwenCliNote:"Install @qianwenai/qianwen-cli on the DSH host and run qianwen auth login as the same OS user.",qwenBailianNote:"Bailian CLI: install bailian-cli on the DSH host and run bl auth login --console as the same OS user.",qwenPlanCreditsLabel:"Monthly credits quota (personal Lite 50K / Standard 500K; see your plan page)",qwenPlanStartLabel:"Plan start date (optional, YYYY-MM-DD; empty = calendar month)",qwenRatesLabel:"Credits rate overrides (optional; credits deducted per 1M tokens; empty = built-in table)",qwenRatesModelPlaceholder:"Model name, e.g. qwen3.8-max-preview",qwenRatePlaceholder:"rate",qwenRate_input:"Input",qwenRate_cachedInput:"Cached input",qwenRate_output:"Output",qwenRateDraftNote:"Enter all three positive rates to save automatically; clear all to restore the built-in table.",qwenRatesAdd:"Add",qwenLocalNote:"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.",scnetPlanCreditsLabel:"Monthly credits quota for local estimates (Basic 60,000 / Standard 240,000 / Pro 600,000)",scnetPlanStartLabel:"Plan start date (optional, YYYY-MM-DD; empty = calendar month)",scnetLocalNote:"Uses console snapshots newer than 24h, then estimates from local records and official Credits rates. Other tools and unlisted models are excluded.",volcengineAccessKeyIdLabel:"Volcengine AccessKey ID",volcengineSecretAccessKeyLabel:"Volcengine SecretAccessKey",volcengineNote:"Volcano Ark needs AK/SK, ArkReadOnlyAccess and BillingCenterReadOnlyAccess. Enter credentials or export VOLC_ACCESSKEY/VOLC_SECRETKEY. Only open.volcengineapi.com is contacted.",volcengineAccessKeyPlaceholder:"AK...",volcengineSecretPlaceholder:"SK...",countdownHoursOnly:"{h}h",countdownHourMinute:"{h}h {m}m",countdownMinute:"{m}m",nextOffPeakIn:"Off-peak in {time}",nextPeakIn:"Peak in {time}",peakSummary:"Peak hours (UTC): {windows}; effective: {time}. {status}",noPeakWindows:"No peak windows configured. {status}",unknown:"unknown",cardToday:"Today",cardMonth:"This month",cardTotal:"All time",cardTotalSub:"Since the ledger was created · Calls {calls}",externalUsage:"External usage",combinedUsage:"DSH + external total",externalStale:"External snapshot has not been updated for 24 hours",externalHistory:"Recent daily records",cardsFootnote:"Amounts use the latest snapshot and may lag the official bill by minutes. Tokens include input, output, cache and reasoning; reasoning is billed with output. Reconcile by amount.",timezoneHint:"Today/month use host timezone {host}; this browser uses {browser}. Different day boundaries affect reconciliation. Set dsh to your local timezone to align.",todaySessions:"Today's sessions",historyExpandHint:"Click a date row to expand its session details",historySessionsLoading:"Loading session details…",historyNoSessions:"No session details for this day (early data or session logs cleaned)",historySessionsError:"Failed to load session details",sessionRankTitle:"By session (all history)",sessionRankHint:"All historical sessions, not grouped by date; sort and row count are switchable",sessionRankEmpty:"No session data yet",sessionRankLoading:"Loading session ranking…",sessionRankError:"Failed to load session ranking",sessionRankLimit:"Rows",showSessionIdLabel:"Show session IDs in session lists",cardsTogglePlanTotal:"Include plan totals",cardsTogglePlanTotalHint:"When on, every amount shows total equivalent cost including plan subscriptions; off (default) counts real-money API channels only",hideOfficialBalanceLabel:"Hide official account balance (balance UI removed from sidebar and settings)",hideTodayCostLabel:"Hide today's cost (today's amount removed from sidebar, budget details and overview card)",sessionRankSort:"Sort",sessionSortCostDesc:"Cost high→low",sessionSortCostAsc:"Cost low→high",sessionSortTimeDesc:"Time new→old",sessionSortTimeAsc:"Time old→new",sessionSortRecent:"Recent order",history:"History",usageTitle:"Token usage stats",usageTotal:"All-time {tokens} tokens · input {input} · cache {cache} · output {output} · {calls} calls",usageDay:"{date}: {tokens} tokens (input {input} · cache {cache} · output {output}) · {calls} calls · {cost}",usageEmpty:"No history yet — daily usage will accumulate here",usageSectionLabel:"Usage",usagePositionLabel:"Token usage stats position",usagePositionCost:"Cost settings",usagePositionGeneral:"General settings",usagePositionSection:"Own section (Usage)",displaySettings:"Display settings",tabOverview:"Overview",tabQuotas:"Quotas",tabUsage:"Usage",tabPricing:"Pricing",tabDisplay:"Display",historyDataTitle:"History data",positionLabel:"Session cost display position",positionDock:"Below the composer",positionHeader:"Session title bar",off:"Off",quotaStripGroup:"Quota strip above the input",quotaStripEnable:"Enable the quota strip (one row above the input box)",quotaStripShowBudget:"Strip includes budget used %",quotaStripShowGo:"Strip includes the Go quota",quotaStripShowPlans:"Strip includes coding plan quotas",quotaStripNote:"Hover a chip for reset times and the last refresh; the strip hides itself when there is no quota data.",quotaStripGuideTitle:"New: quota strip above the input",quotaStripGuideBody:"Show budget and OpenCode Go/coding-plan percentages above the input box. Enable now? Change it anytime in Settings → Display.",quotaStripGuideOn:"Enable the strip",quotaStripGuideOff:"Not now",clickToRefresh:"Click to refresh now",balanceClickGuideTitle:"New: click the balance box to refresh",balanceClickGuideBody:"Click a sidebar balance or plan box to refresh. It pulses while loading; on failure it keeps the old value and shows the reason on hover.",balanceClickGuideOk:"Got it",sidebarLabel:"Today cost display",sidebarOn:"Sidebar footer",currencyLabel:"Currency",currencyCny:"Chinese Yuan (CNY)",currencyUsd:"US Dollar (USD)",currencyEur:"Euro (EUR)",symbolLabel:"Currency symbol",rateLabel:"Exchange rate (1 USD = ? target currency)",decimalsLabel:"Decimal places",balanceDisplayLabel:"Balance display position",balanceSidebar:"Main sidebar",balanceSettings:"Settings page",balanceBoth:"Both",refreshIntervalLabel:"Balance refresh interval (minutes)",peakEnabledLabel:"Use DeepSeek peak-hour prices",peakNoticeLabel:"Prominent notice during peak hours (sidebar budget box, today's cost; previewed in the Settings peak panel)",badgeNote:"Session cost uses call-time prices, including peak and historical rates. Input, output, cache reads and writes are separate; configured cache-write and long-context rates apply.",priceTableTitle:"Price table (USD / 1M tokens)",pricingCurrencyLabel:"Official price currency",pricingCurrencyUsd:"USD (English official page)",pricingCurrencyCny:"CNY (Chinese official page)",pricingCurrencyNote:"Selects the official pricing-page language. Sync then recalculates history in the background; sessions without full logs keep their earlier basis.",priceTableNote:"Call-time prices: Flash changes Sep 10 04:00 UTC; V4 Pro uses Flash prices from Sep 14 04:00 UTC. Earlier calls retain history. Mon–Fri peaks 01–04 and 06–10 UTC cost 2×; weekends and Chinese public holidays are off-peak. Cache writes use hit rates.",datedPriceNote:"Current rates are shown here. Editing cancels any future scheduled change for this entry; earlier historical rates are retained.",defaultModelId:"default (fallback for unmatched models)",newModelPlaceholder:"New model ID (e.g. deepseek-v4-pro)",addModel:"Add model",dataSync:"Data & sync",saving:"Saving…",autoSaveFailed:"Auto-save failed: {message}",autoSavedAt:"Auto-saved {time}",autoSaveHint:"Settings are auto-saved",confirmFetch:"Overwrite the price table with prices from the official docs?",apply:"Apply",cancel:"Cancel",syncFromDocs:"Sync prices from official docs",syncScopeNote:"Official sync updates DeepSeek prices (including peak rates). Third-party prices (z-ai/Kimi/Qwen/Volcano) follow releases; edit in the extended catalog or model matching.",confirmReset:"Clear all history?",importLegacy:"Import pre-install history",confirmImportLegacy:"Confirm import? Replays all session logs and only fills dates/sessions missing from the ledger; existing records are untouched.",legacyImportFailed:"Failed to import pre-install history: {message}",legacyImportNote:"Pre-install history imports at first launch; rerun after copying old logs. Costs use current prices. Deleted logs cannot replay; sessions spanning installation exclude earlier usage.",confirmClear:"Confirm clear",clearAllHistory:"Clear all history",lastSync:"Last sync: {time}",neverSynced:"Never (bundled prices)",source:"; Source: {source}",sourceOfficial:"Official docs",sourceBundled:"Bundled",languageLabel:"Language",localeAuto:"Follow browser (auto)",localeZh:"Simplified Chinese",localeEn:"English",sectionLabel:"Cost",rpcFailed:"{method} call failed",rpcSyncFailed:"Sync call failed",rpcBalanceFailed:"Balance refresh call failed"}};function Ua(){return(typeof navigator<"u"&&typeof navigator.language=="string"?navigator.language:"").toLowerCase().startsWith("zh")?"zh":"en"}function _(t){return t==="zh"||t==="en"?t:Ua()}function K(t){const s=t==="zh"?Te.zh:Te.en;return(o,a)=>{let n=s[o]??Te.en[o]??o;if(a)for(const l of Object.keys(a))n=n.split("{"+l+"}").join(String(a[l]));return n}}const qe={day:"periodDay",month:"periodMonth",all:"periodAll",custom:"periodCustomRange"};function re(t,s){throw new Error("dsh-cost-meter: 服务端数据非法 ("+t+": "+s+")")}function be(t,s){return(t===null||typeof t!="object"||Array.isArray(t))&&re(s,"object"),t}function ce(t,s){return(typeof t!="number"||!Number.isFinite(t))&&re(s,"number"),t}function Ne(t,s){return typeof t!="string"&&re(s,"string"),t}const Ke=(t,s,o)=>typeof t=="string"&&s.includes(t)?t:o;function _t(t,s=!1){return t===null||typeof t!="object"||Array.isArray(t)?{}:Object.fromEntries(Object.entries(t).filter(([o,a])=>s?o.length>0&&["plan","api"].includes(a):["auto","plan","api"].includes(a)))}function Wt(t,s){return typeof t!="boolean"&&re(s,"boolean"),t}const Ye=(t,s,o)=>Object.fromEntries(s.map(a=>[a,o(t[a])]));function zt(t,s){const o={};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=i=>typeof i=="number"&&Number.isFinite(i)&&i>=0?i:0;o[a]={...Ye(n,["input","output","cacheRead","cacheWrite","reasoning","cost"],l),apiCost:n.apiCost===void 0?l(n.cost):l(n.apiCost)}}return o}function Gt(t,s){be(t,s);const o={reasoning:t.reasoning===void 0?0:ce(t.reasoning,s+".reasoning"),apiCost:t.apiCost===void 0?void 0:ce(t.apiCost,s+".apiCost"),byModel:zt(t.byModel,s+".byModel"),byProviderModel:zt(t.byProviderModel,s+".byProviderModel")};for(const a of["input","output","cacheRead","cacheWrite","calls","cost"])o[a]=ce(t[a],s+"."+a);return o}function ct(t,s){return{...Gt(t,s),id:Ne(t.id,s+".id"),provider:typeof t.provider=="string"?t.provider:"",model:typeof t.model=="string"?t.model:""}}function fe(t,s){const o={...Gt(t,s),date:Ne(t.date,s+".date"),sessions:[]};return t.sessions!==void 0&&(Array.isArray(t.sessions)||re(s+".sessions","array"),o.sessions=t.sessions.map((a,n)=>ct(a,s+".sessions["+n+"]"))),o}function dt(t,s,o=["cacheWrite","reasoning"]){const a={};for(const n of["cacheHit","cacheMiss","output"])a[n]=ce(t[n],s+"."+n);for(const n of o)t[n]!==void 0&&(a[n]=ce(t[n],s+"."+n));return a}function ut(t,s){be(t,s);const o=dt(t,s);for(const a of["offPeak","peak","legacyBase","longContext"])t[a]!==void 0&&(o[a]=dt(t[a],s+"."+a,["cacheWrite","reasoning","aboveInputTokens"]));t.cny!==void 0&&(o.cny=dt(t.cny,s+".cny")),t.legacy!==void 0&&(o.legacy=Wt(t.legacy,s+".legacy")),t.rateHistory!==void 0&&((!Array.isArray(t.rateHistory)||t.rateHistory.length>16)&&re(s+".rateHistory","price history"),o.rateHistory=t.rateHistory.map((a,n)=>((!a||typeof a.before!="string"||!Number.isFinite(Date.parse(a.before)))&&re(s+".rateHistory","dated price"),{...ut({...a,rateHistory:void 0},s+".rateHistory."+n),before:a.before})));for(const a of["billingMode","sourceUrl","checkedAt","notes"])typeof t[a]=="string"&&(o[a]=t[a]);return o}function Ha(t,s){const o=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:Ke(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"):[]};be(t,s);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]=ut(t.prices.models[n],s+".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,sidebarTodayMetric:t.sidebarTodayMetric==="tokens"?"tokens":"cost",showTotalWithPlan:t.showTotalWithPlan===!0,sidebarSimple:t.sidebarSimple===!0,sidebarSimplePromptSeen:t.sidebarSimplePromptSeen===!0,sidebarModels:Object.fromEntries(Object.entries(Rt).map(([n,l])=>[n,t.sidebarModels?.[n]??l])),codexQuotaEnabled:t.codexQuotaEnabled===!0,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:ce(t.decimals,s+".decimals"),exchangeRate:ce(t.exchangeRate,s+".exchangeRate"),peakEnabled:t.peakEnabled===!0,peakEffectiveAt:typeof t.peakEffectiveAt=="string"?t.peakEffectiveAt:"",peakWindows:Array.isArray(t.peakWindows)?t.peakWindows.map((n,l)=>({start:ce(n.start,s+".peakWindows["+l+"].start"),end:ce(n.end,s+".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,i]of Object.entries(t.priceOverrides))typeof l=="string"&&typeof i=="string"&&(n[l]=i);return n})(),priceTableDisplay:(()=>{const n={};if(t.priceTableDisplay!==null&&typeof t.priceTableDisplay=="object"&&!Array.isArray(t.priceTableDisplay))for(const[l,i]of Object.entries(t.priceTableDisplay))typeof l=="string"&&(n[l]=i===!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 i=t.codingPlans[l];i===null||typeof i!="object"||Array.isArray(i)||(n[l]={enabled:i.enabled===!0,display:i.display==="sidebar"||i.display==="both"||i.display==="off"?i.display:"settings",refreshMinutes:typeof i.refreshMinutes=="number"&&Number.isFinite(i.refreshMinutes)?i.refreshMinutes:15,apiKey:typeof i.apiKey=="string"?i.apiKey:"",...l==="minimax"?{baseUrl:typeof i.baseUrl=="string"?i.baseUrl:""}:{},...l==="qwen"?{quotaSource:["cli","bailian"].includes(i.quotaSource)?i.quotaSource:"local"}:{},...typeof i.planCredits=="number"&&Number.isFinite(i.planCredits)&&i.planCredits>0?{planCredits:i.planCredits}:{},...typeof i.planStart=="string"?{planStart:i.planStart}:{},...i.rates!==null&&typeof i.rates=="object"&&!Array.isArray(i.rates)?{rates:i.rates}:{},...typeof i.accessKeyId=="string"?{accessKeyId:i.accessKeyId}:{},...typeof i.secretAccessKey=="string"?{secretAccessKey:i.secretAccessKey}:{}})}return n})(),prices:{models:a,default:ut(t.prices?.default??{cacheHit:0,cacheMiss:0,output:0},s+".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:ce(t.historyDays,s+".historyDays"),fetchedAt:t.fetchedAt===null||t.fetchedAt===void 0?null:Ne(t.fetchedAt,s+".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:Ke(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:Ke(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:o(t.customBalance),gatewayQuotas:(()=>{const n=Array.isArray(t.gatewayQuotas)?t.gatewayQuotas:t.gatewayQuotas?.sources;return{sources:Array.isArray(n)?n.slice(0,4).filter(i=>i!==null&&typeof i=="object"&&!Array.isArray(i)).map(i=>({id:typeof i.id=="string"?i.id.slice(0,48):"",type:"cliproxyapi",label:typeof i.label=="string"?i.label.slice(0,80):"",baseURL:typeof i.baseURL=="string"?i.baseURL:"",enabled:i.enabled!==!1,display:Ke(i.display,["sidebar","settings","off"],"both"),refreshMinutes:typeof i.refreshMinutes=="number"&&Number.isFinite(i.refreshMinutes)?Math.min(1440,Math.max(1,Math.floor(i.refreshMinutes))):15,includeProviders:Array.isArray(i.includeProviders)?[...new Set(i.includeProviders.filter(r=>typeof r=="string").map(r=>r.toLowerCase()).filter(r=>bt.includes(r)))]:bt,allowedHosts:Array.isArray(i.allowedHosts)?i.allowedHosts.filter(r=>typeof r=="string").slice(0,16):[],allowInsecureHttp:i.allowInsecureHttp===!0,antigravityOnlyGemini:i.antigravityOnlyGemini===!0,keyVar:typeof i.keyVar=="string"?i.keyVar:""})):[]}})(),customBalances:(()=>{if(Array.isArray(t.customBalances))return t.customBalances.filter(l=>l!==null&&typeof l=="object").slice(0,8).map(o).filter(Boolean);const n=o(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=(i,r)=>n[i]==="remaining"||n[i]==="used"?n[i]:r;return{balance:l("balance","remaining"),budget:l("budget","used"),go:l("go","used"),plan:l("plan","used")}})(),planBilling:{providers:_t(t.planBilling?.providers),models:_t(t.planBilling?.models,!0)}}}const Ue=t=>typeof t=="number"&&Number.isFinite(t)?t:null,Se=t=>Ue(t)??0,Ia={status:"off",message:"",fetchedAt:0,currency:"",totalBalance:0,grantedBalance:0,toppedUpBalance:0},ja={status:"off",message:"",fetchedAt:0,rolling:null,weekly:null,monthly:null},Kt=(t=null)=>({status:"off",message:"",fetchedAt:0,label:"",unit:"USD",remaining:0,maxBudget:null,spend:null,index:t});function mt(t,s){return be(t,s),{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 Qa(t,s){return{...mt(t,s),currency:typeof t.currency=="string"?t.currency:"",totalBalance:Se(t.totalBalance),grantedBalance:Se(t.grantedBalance),toppedUpBalance:Se(t.toppedUpBalance)}}function pt(t,s){return t==null?null:((typeof t!="object"||Array.isArray(t))&&re(s,"object"),{percent:Se(t.percent),resetsAt:typeof t.resetsAt=="string"?t.resetsAt:""})}function Fa(t,s){return{...mt(t,s),rolling:pt(t.rolling,s+".rolling"),weekly:pt(t.weekly,s+".weekly"),monthly:pt(t.monthly,s+".monthly")}}function Yt(t,s){return{...mt(t,s),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 _a=new Set(["ok","partial","unknown","error","stale","unsupported","capability_missing"]),Wa=new Set(["off","loading","ok","partial","stale","error"]),bt=["antigravity","claude","codex","kimi","xai","workbuddy"],Vt={antigravity:"Antigravity",claude:"Claude",codex:"Codex",kimi:"Kimi",xai:"xAI",workbuddy:"WorkBuddy"};function za(t,s){be(t,s);const o=(i,r="")=>typeof i=="string"?i:r,a=i=>Ue(i),n=i=>i!==null&&typeof i=="object"&&!Array.isArray(i)?{id:o(i.id),label:o(i.label),...a(i.percent)===null?{}:{percent:a(i.percent)},resetsAt:o(i.resetsAt),periodHours:a(i.periodHours),scope:o(i.scope)}:null,l=i=>i!==null&&typeof i=="object"&&!Array.isArray(i)?{unit:o(i.unit,"credits"),used:a(i.used),remaining:a(i.remaining),limit:a(i.limit),fetchedAt:o(i.fetchedAt),packages:Array.isArray(i.packages)?i.packages.filter(r=>r!==null&&typeof r=="object"&&!Array.isArray(r)).map(r=>({id:o(r.id),label:o(r.label),used:a(r.used),remaining:a(r.remaining),limit:a(r.limit),startsAt:o(r.startsAt),resetsAt:o(r.resetsAt)})):[]}:void 0;return{id:o(t.id),type:"cliproxyapi",label:o(t.label),status:Wa.has(t.status)?t.status:"error",message:o(t.message),fetchedAt:a(t.fetchedAt)??0,attemptedAt:a(t.attemptedAt)??0,serverVersion:o(t.serverVersion),keyConfigured:t.keyConfigured===!0,keySource:o(t.keySource,"none"),accounts:Array.isArray(t.accounts)?t.accounts.filter(i=>i!==null&&typeof i=="object"&&!Array.isArray(i)).slice(0,16).map(i=>({id:o(i.id),provider:o(i.provider,"unknown"),label:o(i.label,"unknown"),status:_a.has(i.status)?i.status:"unknown",message:o(i.message),plan:o(i.plan),windows:Array.isArray(i.windows)?i.windows.map(n).filter(Boolean):[],credits:l(i.credits)})):[],unsupportedProviders:Array.isArray(t.unsupportedProviders)?t.unsupportedProviders.filter(i=>typeof i=="string").slice(0,32):[]}}function Ga(t){if(t===null||typeof t!="object"||Array.isArray(t))return null;const s={};if(t.providers!==null&&typeof t.providers=="object"&&!Array.isArray(t.providers))for(const[o,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[i,r]of Object.entries(a.windows))r===null||typeof r!="object"||Array.isArray(r)||(n[i]={...Ye(r,["percent","localTokens","localCost","sampleCount"],Se),...Ye(r,["sampleAt","per1Tokens","per1Cost","fullTokens","fullCost"],Ue),resetsAt:typeof r.resetsAt=="string"?r.resetsAt:"",method:r.method==="sample"||r.method==="live"?r.method:"none",confidence:r.confidence==="high"||r.confidence==="low"?r.confidence:null});if(a.intervals!==null&&typeof a.intervals=="object"&&!Array.isArray(a.intervals))for(const[i,r]of Object.entries(a.intervals))Array.isArray(r)&&(l[i]=r.filter(u=>u!==null&&typeof u=="object"&&!Array.isArray(u)).map(u=>Ye(u,["t0","t1","tokens","cost","pct","per1Tokens","per1Cost"],Se)));s[o]={windows:n,intervals:l}}return{generatedAt:Se(t.generatedAt),providers:s}}function Jt(t,s){return be(t,s),{today:fe(t.today,s+".today"),month:fe(t.month,s+".month"),total:fe(t.total,s+".total"),budgetUsed:typeof t.budgetUsed=="number"&&Number.isFinite(t.budgetUsed)?t.budgetUsed:void 0,balance:t.balance==null?Ia:Qa(t.balance,s+".balance"),goQuota:t.goQuota==null?ja:Fa(t.goQuota,s+".goQuota"),customBalance:t.customBalance==null?Kt():Yt(t.customBalance,s+".customBalance"),customBalances:Array.isArray(t.customBalances)?t.customBalances.filter(o=>o!==null&&typeof o=="object").map((o,a)=>Yt(o,s+".customBalances["+a+"]")):[],gatewayQuotas:Array.isArray(t.gatewayQuotas)?t.gatewayQuotas.filter(o=>o!==null&&typeof o=="object"&&!Array.isArray(o)).map((o,a)=>za(o,s+".gatewayQuotas["+a+"]")):[],customVarStatus:t.customVarStatus!==null&&typeof t.customVarStatus=="object"&&!Array.isArray(t.customVarStatus)?Object.fromEntries(Object.entries(t.customVarStatus).filter(([,o])=>o!==null&&typeof o=="object").map(([o,a])=>[o,{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:Ga(t.planStats),history:Array.isArray(t.history)?t.history.map((o,a)=>fe(o,s+".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(o=>({source:String(o.source),today:fe(o.today,s+".external.today"),month:fe(o.month,s+".external.month"),total:fe(o.total,s+".external.total"),history:(o.history??[]).map(a=>fe(a,s+".external.history"))})),combined:Object.fromEntries(["today","month","total","history"].map(o=>[o,o==="history"?(t.externalUsage.combined.history??[]).map(a=>fe(a,s+".external.history")):fe(t.externalUsage.combined[o],s+".external."+o)]))}:null,config:Ha(t.config,s+".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:{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 Ka(t,s){be(t,s);const o={ok:t.ok===!0,message:typeof t.message=="string"?t.message:""};return t.state!==void 0&&t.state!==null&&(o.state=Jt(t.state,s+".state")),o}function ne(t){return{parse:t}}const ft=ne(Jt),Ya=ne(t=>be(t,"patch")),Va=ne(Ka),Zt=ne(t=>Ne(t,"provider")),Ja=ne(t=>{if(t!=null)return(typeof t!="number"||!Number.isInteger(t)||t<0||t>7)&&re("index","0-7 integer"),t}),Za=ne(t=>Ne(t,"date")),$a=ne(t=>be(t,"day")),Xa=ne(t=>(Number.isFinite(Number(t))||re("limit","number"),Number(t))),$t=ne(t=>Ne(t,"sort")),en=ne(t=>be(t,"topSessions")),Xt=ne(t=>Ne(t,"target")),tn=ne(t=>Ne(t,"value")),Ce=(t,s)=>({mode:"strict",typeSymbol:"dsh-cost-meter#"+t,schema:s,create:()=>s}),ie=(t,s,o,a=!1)=>({name:t,wire:t,source:"json",codec:Ce(s,o),...a?{acceptsUndefined:!0}:{}}),an={package:"dsh-cost-meter",descriptors:[{method:"getState",result:Ce("CostState",ft)},{method:"updateConfig",parameters:[ie("patch","ConfigPatch",Ya)],result:Ce("CostState",ft)},{method:"fetchPrices"},{method:"refreshBalance"},{method:"refreshGoQuota"},{method:"refreshCustomBalance",parameters:[ie("index","CustomBalanceIndex",Ja,!0)]},{method:"refreshCodingPlan",parameters:[ie("provider","CodingPlanProvider",Zt)]},{method:"refreshGatewayQuota",parameters:[ie("sourceId","GatewayQuotaSourceId",ne(t=>{if(t!=null)return(typeof t!="string"||t.length>48||!/^[a-z0-9][a-z0-9_-]*$/.test(t))&&re("sourceId","gateway source id"),t}),!0)]},{method:"resetHistory",result:Ce("CostState",ft)},{method:"importLegacyHistory"},{method:"getDaySessions",parameters:[ie("date","DayKey",Za)],result:Ce("DayRecord",$a)},{method:"getSessionCost",parameters:[ie("sessionId","SessionId",Zt)],result:Ce("SessionCost",ne(t=>({own:ct(t.own,"own"),subagents:ct(t.subagents,"subagents"),found:Wt(t.found,"found"),subagentCount:ce(t.subagentCount,"subagentCount")})))},{method:"getTopSessions",parameters:[ie("limit","SessionLimit",Xa),ie("sort","SessionSort",$t,!0),ie("dir","SessionSortDir",$t,!0)],result:Ce("TopSessions",en)},{method:"setCredential",parameters:[ie("target","CredentialTarget",Xt),ie("value","CredentialValue",tn)]},{method:"clearCredential",parameters:[ie("target","CredentialTarget",Xt)]}].map(t=>({id:"dsh-cost-meter#costMeter/"+t.method,service:"costMeter",namespace:"costMeter",invocation:{kind:"direct"},parameters:[],result:Ce("FetchPricesResult",Va),...t}))};function nn(t,s){const o=s?.models??{};return typeof t=="string"&&t.length>0&&o[t]!==void 0?o[t]:s?.default??{cacheHit:0,cacheMiss:0,output:0}}function He(t){if(t===null||typeof t!="object")return;const s=i=>{const r=t[i];return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0},o=s("cacheMiss")??s("input")??0,n={cacheHit:s("cacheHit")??s("cachedInput")??s("cacheRead")??o,cacheMiss:o,output:s("output")??0},l=s("reasoning");return l!==void 0&&(n.reasoning=l),s("cacheWrite")!==void 0&&(n.cacheWrite=s("cacheWrite")),n}function sn(t){const s=He(t);if(s===void 0)return null;for(const o of["offPeak","peak","legacyBase"]){const a=He(t[o]);a!==void 0&&(s[o]=a)}return Number.isFinite(t.longContext?.aboveInputTokens)&&t.longContext.aboveInputTokens>0&&(s.longContext={...He(t.longContext),aboveInputTokens:t.longContext.aboveInputTokens}),Array.isArray(t.rateHistory)&&(s.rateHistory=t.rateHistory.slice(0,16).map(o=>{const a={...He(o),before:o.before};for(const n of["offPeak","peak"]){const l=He(o[n]);l!==void 0&&(a[n]=l)}return a})),s}function Ve(t,s=Date.now()){if(!t||!Number.isFinite(s)||!Array.isArray(t.rateHistory))return t;let o=null,a=1/0;for(const i of t.rateHistory){const r=Date.parse(i.before);s<r&&r<a&&(o=i,a=r)}if(!o)return t;const{before:n,...l}=o;return{...t,...l}}const gt=Date.parse("2026-08-22T16:00:00Z");function ea(t){if(!Number.isFinite(t)||t<gt)return null;const s=Math.floor((t+8*36e5)/864e5),o=(s+4)%7;if(o!==6&&o!==0)return null;const a=o===6?s:s-1;return{start:Math.max(a*864e5-8*36e5,gt),end:(a+2)*864e5-8*36e5}}function ta(t,s){if(!Number.isFinite(t)||t<gt||!Array.isArray(s))return null;const o=Math.floor((t+8*36e5)/864e5);return s.includes(new Date(o*864e5).toISOString().slice(0,10))?{start:o*864e5-8*36e5,end:(o+1)*864e5-8*36e5}:null}const on=(t,s)=>ta(t,s)??ea(t);function Je(t,s,o,a){if(!Array.isArray(o)||o.length===0||on(t,a)!==null||Number.isFinite(s)&&t<s)return!1;const n=new Date(t).getUTCHours();return o.some(l=>{const i=Number(l.start),r=Number(l.end);return!Number.isFinite(i)||!Number.isFinite(r)?!1:i<r?n>=i&&n<r:n>=i||n<r})}const ln=Date.parse("2026-08-16T16:00:00Z");function aa(t,s,o){const a=Ve(t,s)??{cacheHit:0,cacheMiss:0,output:0},n=i=>({cacheHit:i.cacheHit,cacheMiss:i.cacheMiss,output:i.output,reasoning:i.reasoning??0,...i.cacheWrite===void 0?{}:{cacheWrite:i.cacheWrite},...i.longContext===void 0?{}:{longContext:i.longContext}});if(Number.isFinite(s)&&s<ln){const i=a.legacyBase;return n(i===void 0?a:i)}if(o?.enabled!==!0)return n(a);const l=typeof o.effectiveAtMs=="number"&&Number.isFinite(o.effectiveAtMs)?o.effectiveAtMs:void 0;if(Je(s,l,o.windows,o.holidays)){const i=a.peak;return n(i===void 0?a:i)}if(l!==void 0&&s>=l){const i=a.offPeak;return n(i===void 0?a:i)}return n(a)}function na(t,s){const o=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),i=Math.max(0,Number(t.reasoning)||0);return s.longContext&&o+n+l>s.longContext.aboveInputTokens&&(s=s.longContext),(o*s.cacheMiss+a*s.output+n*s.cacheHit+l*(s.cacheWrite??s.cacheHit)+i*(s.reasoning??0))/1e6}function sa(t,s,o){const a=Number(t);if(!Number.isFinite(a)||a<0||a===0)return 0;if(s!=="CNY")return a;const n=Number(o);return!Number.isFinite(n)||n<=0?a:a/n}function te(t,s){const o=t?.barDirections,a=s==="balance"?"remaining":"used";if(o===null||typeof o!="object"||Array.isArray(o))return a;const n=o[s];return n==="remaining"||n==="used"?n:a}function de(t,s){if(t==null||!Number.isFinite(Number(t)))return{width:0,label:null};const o=Math.max(0,Math.min(100,Number(t))),a=s==="remaining"?Math.round((100-o)*10)/10:Math.round(o*10)/10;return{width:a,label:a}}const oa=(t,s)=>t.toFixed(s).replace(/(\.\d*?[1-9])0+$|\.0+$/,"$1");function se(t,s){const o=typeof s?.symbol=="string"&&s.symbol.length>0?s.symbol:"$",a=Number(s?.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),o+oa(t,l)}function V(t,s){const o=Number(s?.exchangeRate),a=t*(Number.isFinite(o)&&o>0?o:1);return se(a,s)}function U(t){const s=Math.max(0,Number(t)||0),o=a=>a>=100?String(Math.round(a)):String(Math.round(a*10)/10);return s<1e3?String(Math.round(s)):s>=999500?o(s/1e6)+"M":s<1e6?o(s/1e3)+"K":o(s/1e6)+"M"}function ue(t){return String(t??"").toLowerCase().replace(/\([^)]*\)/g," ").replace(/([^)]*)/g," ").replace(/[^a-z0-9]+/g,"")}function Be(t,s){if(typeof t!="string"||t.length===0)return null;const o=Array.isArray(s)?s.filter(c=>typeof c=="string"&&c.length>0):[];if(o.length===0)return null;const a=c=>String(c).toLowerCase().replace(/[-@]\d{4}-?\d{2}-?\d{2}$/,"").replace(/[-@]v\d+(\.\d+)*$/,""),n=o.find(c=>c===t);if(n!==void 0)return n;const l=ue(t);if(l.length===0)return null;const i=o.find(c=>ue(c)===l);if(i!==void 0)return i;const r=a(t),u=o.find(c=>a(c)===r);if(u!==void 0)return u;const d=/^(?:[-_./:@](?:\d{4}-?\d{2}-?\d{2}|v\d+(?:\.\d+)*|\d+k|latest))+$/;return o.filter(c=>r.startsWith(a(c))&&d.test(r.slice(a(c).length))).sort((c,m)=>m.length-c.length)[0]??null}const rn=new Set(["lmstudio","ollama","jan","gpt4all","koboldcpp","llamacpp","llama-cpp","localai","vllm","sglang","tabbyapi","lmdeploy","oobabooga","text-generation-webui","llama-server"]),cn=["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 dn(t,s){if(typeof t=="string"&&rn.has(t))return!0;const o=typeof s=="string"?s.toLowerCase():"";return cn.some(a=>o.startsWith(a))}function un(t,s,o){const a=o?.prices??{},n=o?.priceMatch==="exact"?"exact":"auto",l=o?.priceOverrides&&typeof o.priceOverrides=="object"?o.priceOverrides:{};let i=String(t??"").trim().toLowerCase();i.startsWith("llm-")&&(i=i.slice(4)),i===""&&(i="deepseek");let r=i,u=s;const d=l[i+":"+s];if(d==="__local__")return{entry:null,priced:!1,billingMode:"flat",matched:!0};if(typeof d=="string"&&d.length>0){const p=d.indexOf(":");if(p>0&&d.slice(p+1).length>0?(r=d.slice(0,p).trim().toLowerCase(),u=d.slice(p+1)):u=d,r==="deepseek"&&u==="__default__")return{entry:a.default??{cacheHit:0,cacheMiss:0,output:0},priced:!0,billingMode:"deepseek-peak",matched:!1}}if(dn(r,u))return{entry:null,priced:!1,billingMode:"flat",matched:!1};if(r==="deepseek"||r.includes("deepseek")){const p=a.models??{},b=p[u]!==void 0?u:n==="auto"?Be(u,Object.keys(p)):null;if(b!==null)return{entry:p[b],priced:!0,billingMode:"deepseek-peak",matched:!0};if(n==="auto"){let g=null,k=-1,v="flat";for(const[N,C]of Object.entries(a.providers??{})){const w=C?.models??{},f=Be(u,Object.keys(w));if(f===null||w[f]?.unpriced===!0)continue;const h=(f===u||ue(f)===ue(u)?1e3:0)+ue(f).length;h>k&&(g=w[f],k=h,v=w[f]?.billingMode==="deepseek-peak"?"deepseek-peak":"flat")}if(g!==null)return{entry:g,priced:!0,billingMode:v,matched:!0}}return{entry:a.default??{cacheHit:0,cacheMiss:0,output:0},priced:!0,billingMode:"deepseek-peak",matched:!1}}const c=a.providers?.[r]?.models??{},m=c[u]!==void 0?u:n==="auto"?Be(u,Object.keys(c)):null;if(m!==null)return{entry:c[m],priced:c[m]?.unpriced!==!0,billingMode:"flat",matched:!0};if(r==="opencode-go")return{entry:null,priced:!1,billingMode:"flat",matched:!1};if(n==="auto"){const p=a.models??{},b=Be(u,Object.keys(p));if(b!==null)return{entry:p[b],priced:!0,billingMode:"deepseek-peak",matched:!0};let g=null,k=-1,v="flat";for(const[N,C]of Object.entries(a.providers??{})){if(N===r)continue;const w=C?.models??{},f=Be(u,Object.keys(w));if(f===null||w[f]?.unpriced===!0)continue;const h=(f===u||ue(f)===ue(u)?1e3:0)+ue(f).length;h>k&&(g=w[f],k=h,v=w[f]?.billingMode==="deepseek-peak"?"deepseek-peak":"flat")}if(g!==null)return{entry:g,priced:!0,billingMode:v,matched:!0}}if(i!=="deepseek"&&!i.includes("deepseek")&&typeof d=="string"&&d.length>0&&!d.includes(":")){const p=a.models??{},b=p[d]!==void 0?d:n==="auto"?Be(d,Object.keys(p)):null;if(b!==null)return{entry:p[b],priced:!0,billingMode:"deepseek-peak",matched:!0}}return{entry:null,priced:!1,billingMode:"flat",matched:!1}}function ht(t,s,o){const a=un(t,s,o);return a.priced&&o?.prices?.currency==="CNY"&&a.entry?.cny?{...a,entry:a.entry.cny,currency:"CNY"}:{...a,currency:a.billingMode==="deepseek-peak"&&o?.prices?.currency==="CNY"?"CNY":"USD"}}function mn(t){const s=Number(t?.calls)||0,o=Number(t?.input)||0,a=Number(t?.cacheRead)||0;return s>=3&&o>=1e5&&a===0}function Ze(t,s){return!t||!s?0:typeof t.cost=="number"&&Number.isFinite(t.cost)?t.cost:ia(t,s).total}function yt(t){if(t===null||typeof t!="object")return 0;const s=Number(t.cost)||0,o=t.apiCost===void 0||t.apiCost===null?s:Number(t.apiCost);return Number.isFinite(o)&&o>=0?Math.min(o,s):s}function W(t,s){return s!==null&&typeof s=="object"&&s.showTotalWithPlan===!0?Number(t?.cost)||0:yt(t)}const pn={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"]},la=["anthropic","zai","minimax","kimi","openrouter","siliconflow","commandcode","scnet","volcengine","qwen","mimo","go"];function bn(t){const s=String(t??"").trim().toLowerCase().replace(/^llm-/,"");if(s.length===0)return null;for(const[o,a]of Object.entries(pn))if(a.includes(s))return o;return la.includes(s)?s:null}function fn(t){const s=new Set,o=t?.codingPlans;if(o!==null&&typeof o=="object")for(const a of la)a!=="go"&&o[a]?.enabled===!0&&s.add(a);return t?.goQuota?.enabled===!0&&s.add("go"),s}function gn(t,s,o){const a=String(t??"").trim().toLowerCase();if(a.length>0&&a!=="deepseek"&&!a.includes("deepseek"))return!1;const n=ue(s);if(n.length===0)return!1;const l=o?.prices,i=l?.models??{};for(const r of Object.keys(i))if(ue(r)===n)return!1;for(const r of Object.values(l?.providers??{}))for(const u of Object.keys(r?.models??{}))if(ue(u)===n)return!0;return!1}function Ie(t,s,o){let a=bn(t);a===null&&gn(t,s,o)&&(a="go");const n=o?.planBilling?.models;if(n!==null&&typeof n=="object"){const i=n[t+":"+s];if(i==="plan"||i==="api")return i;if(a!==null){const r=n[a+":"+s];if(r==="plan"||r==="api")return r}}if(a===null)return"api";const l=o?.planBilling?.providers?.[a];return l==="plan"||l==="api"?l:fn(o).has(a)?"plan":"api"}function ia(t,s){if(!t||!s)return{total:0,api:0};const o={enabled:s.peakEnabled===!0,effectiveAtMs:Date.parse(s.peakEffectiveAt||""),windows:s.peakWindows,holidays:s.peakHolidays},a=Date.now(),n=t.byProviderModel??t.byModel??{};let l=0,i=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,k=ht(b,g,s);if(k.priced){const v=na(n[m],aa(sn(k.entry),a,{...o,enabled:k.billingMode==="deepseek-peak"&&o.enabled})),N=sa(v,k.currency,s.exchangeRate);l+=N,Ie(b,g,s)==="api"&&(i+=N)}}const r={input:0,output:0,cacheRead:0,cacheWrite:0,reasoning:0};for(const m of Object.keys(n))r.input+=n[m].input??0,r.output+=n[m].output??0,r.cacheRead+=n[m].cacheRead??0,r.cacheWrite+=n[m].cacheWrite??0,r.reasoning+=n[m].reasoning??0;const u={input:Math.max(0,(t.input??0)-r.input),output:Math.max(0,(t.output??0)-r.output),cacheRead:Math.max(0,(t.cacheRead??0)-r.cacheRead),cacheWrite:Math.max(0,(t.cacheWrite??0)-r.cacheWrite),reasoning:Math.max(0,(t.reasoning??0)-r.reasoning)},d=na(u,aa(nn("default",s.prices),a,o)),c=sa(d,s.prices?.currency==="CNY"?"CNY":"USD",s.exchangeRate);return l+=c,i+=c,{total:l,api:i}}function ra(t,s){if(!t||!s)return!1;const o=t.byProviderModel??{};for(const a of Object.keys(o)){const n=a.indexOf(":"),l=n>0?a.slice(0,n):"deepseek",i=n>0?a.slice(n+1):a;if(Ie(l,i,s)==="plan")return!0}return!1}function kt(t){return(t?.input??0)+(t?.cacheRead??0)+(t?.cacheWrite??0)}function ca(t,s){if(t?.apiCost!==void 0)return yt(t);if(!ra(t,s))return Ze(t,s);let o=0;for(const[a,n]of Object.entries(t.byProviderModel??{})){if(!Number.isFinite(n.cost))return ia(t,s).api;const l=a.indexOf(":");Ie(a.slice(0,l),a.slice(l+1),s)==="plan"&&(o+=n.cost)}return Math.max(0,Ze(t,s)-o)}function wt(t){const s=Math.abs(Math.round(Number(t)||0)),o=Math.floor(s/60),a=s%60;return"UTC"+(Number(t)<0?"-":"+")+o+(a>0?":"+String(a).padStart(2,"0"):"")}function hn(t){const s=t?.meta,o=Number(s?.timezoneOffsetMinutes);if(!Number.isFinite(o))return null;const a=-new Date().getTimezoneOffset();if(a===o)return null;const n=typeof s?.timezone=="string"&&s.timezone.length>0?s.timezone:"";return{hostLabel:n?n+" ("+wt(o)+")":wt(o),browserLabel:wt(a)}}function yn(t){let s=t;const o=new Set;return{getSnapshot:()=>s,subscribe:a=>(o.add(a),()=>{o.delete(a)}),set:a=>{if(a!==s){s=a;for(const n of[...o])n()}}}}const{createElement:e,Fragment:E,useState:L,useEffect:ee,useRef:Ae}=Ee;function De({target:t,configured:s,source:o,t:a,api:n,placeholder:l,disabled:i}){const[r,u]=L(""),[d,c]=L(!1),[m,p]=L(null),b=i===!0||d,g=async()=>{const v=r.trim();if(!(v.length===0||b)){c(!0),p(null);try{const N=await n.setCredential(t,v);u(""),p({kind:"ok",text:N?.message??a("credentialSave")})}catch(N){p({kind:"err",text:String(N?.message??N)})}finally{c(!1)}}},k=async()=>{if(!b){c(!0),p(null);try{const v=await n.clearCredential(t);u(""),p({kind:"ok",text:v?.message??a("credentialClear")})}catch(v){p({kind:"err",text:String(v?.message??v)})}finally{c(!1)}}};return e("div",{className:"cm-field"},e("input",{className:"cm-input",type:"password",value:r,placeholder:typeof l=="string"?l:"",disabled:b,autoComplete:"off",onChange:v=>u(v.target.value)}),e("div",{className:"cm-buttons"},e("button",{className:"cm-btn small",onClick:g,disabled:b||r.trim().length===0},a(d?"credentialSaving":"credentialSave")),s===!0?e("button",{className:"cm-btn small",onClick:k,disabled:b},a("credentialClear")):null),e("span",{className:"cm-hint"},s===!0?a("credentialConfiguredOf",{source:typeof o=="string"&&o.length>0?o:"unknown"}):a("credentialNotConfigured")),e("span",{className:"cm-hint"},a("credentialInputHint")),Ut(m))}function kn({pending:t,t:s}){return!Array.isArray(t)||t.length===0?null:e("div",{className:"cm-msg err"},e("div",null,s("secretMigrationPending")),e("div",null,t.join("、")))}function $e({size:t=16,className:s}){return e("svg",{width:t,height:t,className:s,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 da(t,s){const o=Ae(!1),a=Ae(""),n=s!==null&&typeof s=="object"?[s.input,s.cacheRead,s.cacheWrite,s.output,s.reasoning,s.cost].map(l=>String(l??0)).join("|"):"";ee(()=>{if(!o.current){o.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 wn(t,s,o,a){const n=u=>["input","output","cacheRead","cacheWrite"].reduce((d,c)=>d+(u?.[c]??0),0),l=s?.found&&n(s.own)>=n(t)?s.own:t;if(!o||!s?.subagentCount)return l;const i=s.subagents,r={...l};for(const u of["input","output","cacheRead","cacheWrite","reasoning","cost"])r[u]=(l?.[u]??0)+(i?.[u]??0);r.apiCost=ca(l,a)+yt(i);for(const u of["byModel","byProviderModel"]){r[u]={...l?.[u]};for(const[d,c]of Object.entries(i?.[u]??{})){const m={...r[u][d]};for(const p of["input","output","cacheRead","cacheWrite","reasoning","cost"])m[p]=(m[p]??0)+(c[p]??0);delete m.apiCost,r[u][d]=m}}return r}function ua(t){const s=t.useProjection?t.useProjection("costUsage"):void 0,o=t.useCost?.(r=>r)?.state,a=o?.config,[n,l]=L(null);da(t,s),ee(()=>{if(!t.sessionId||!t.api?.getSessionCost)return;let r=!0,u=!1;const d=async()=>{if(!u){u=!0;try{const m=await t.api.getSessionCost(t.sessionId);r&&l({id:t.sessionId,include:a?.includeSubagentCost===!0,value:m})}catch{}finally{u=!1}}};d();const c=a?.includeSubagentCost===!0?setInterval(d,1e4):null;return()=>{r=!1,c!==null&&clearInterval(c)}},[t.sessionId,o?.meta?.now,s,a?.includeSubagentCost]);const i=n&&n.id===t.sessionId&&n.include===(a?.includeSubagentCost===!0)?n.value:null;return{usage:wn(s,i,a?.includeSubagentCost===!0,a),config:a}}function ma(t,s){let o=0,a=Ze(t,s);if(s.showTotalWithPlan!==!0&&(t.apiCost!==void 0||ra(t,s))){const n={total:Ze(t,s),api:ca(t,s)};o=Math.max(0,n.total-n.api),o>0&&(a=n.api)}return{cost:a,planPart:o}}function xn(t){const{usage:s,config:o}=ua(t);if(!s||!o||kt(s)+(s?.output??0)===0)return null;const a=K(_(o.locale)),{cost:n,planPart:l}=ma(s,o),i=[a("sessionCostTitle"),a("sessionDetailTokens",{input:U(s?.input??0),cache:U((s?.cacheRead??0)+(s?.cacheWrite??0)),output:U(s?.output??0)}),a("sessionDetailCache",{read:U(s?.cacheRead??0),write:U(s?.cacheWrite??0)}),a("cost",{amount:V(n,o)}),...l>0?[a("sessionDetailPlan",{amount:V(l,o)})]:[]].join("; ");return e(Z,{label:i,side:"top",delayMs:500},e("div",{className:"cm-chip"},l>0?a("costChipPlan",{amount:V(n,o)}):a("cost",{amount:V(n,o)})))}function vn(t){const{usage:s,config:o}=ua(t);if(!s||!o)return null;const a=s.input??0,n=(s.cacheRead??0)+(s.cacheWrite??0),l=s.output??0;if(a+n+l===0)return null;const i=K(_(o.locale)),{cost:r,planPart:u}=ma(s,o),d=kt(s)>0?((s.cacheRead??0)/kt(s)*100).toFixed(1)+"%":"—";return e("div",{className:"cm-root"},i(u>0?"sessionLineSplit":"sessionLine",{amount:V(r,o),planAmount:V(u,o),hitRate:d,input:U(a),cache:U(n),output:U(l)}))}const Nn={USD:"$",CNY:"¥",EUR:"€"};function we(t,s,o){const a=typeof o=="string"?o.toUpperCase():"",n=typeof s?.symbol=="string"&&s.symbol.length>0?s.symbol:"$";return se(t,{symbol:Nn[a]??n,decimals:Math.max(2,Math.min(10,Math.floor(Number(s?.decimals)||2)))})}function pa(t,s){const o=Number(t?.balance?.budgetCap);if(Number.isFinite(o)&&o>0)return o;const a=Number(s?.maxBudget);return Number.isFinite(a)&&a>0?a:null}function Sn(t){const s=t.today,o=s?.byProviderModel;if(o===null||typeof o!="object"||Object.keys(o).length===0)return Number(s?.cost)||0;let a=0;for(const[n,l]of Object.entries(o)){const i=n.indexOf(":");let r=i>=0?n.slice(0,i):n;r.startsWith("llm-")&&(r=r.slice(4)),!(r!=="deepseek"&&r!=="deepseek-official")&&(a+=Number(l?.cost)||0)}return a}function ba(t,s,o,a,n=null){const l=o==="official"?Sn(t):Number(t.today?.cost)||0;if(o==="custom"){const r=je(s,a,n);if(r==="USD")return l;if(r==="CREDITS")return 0;const u=Number(s?.exchangeRate);return l*(Number.isFinite(u)&&u>0?u:1)}const i=Number(s?.exchangeRate);return l*(Number.isFinite(i)&&i>0?i:1)}function fa({remaining:t,spend:s,todayUsed:o,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(s)||0),i=Math.max(0,Math.min(l,Number(o)||0)),r=Math.max(0,l-i),u=Math.max(0,Math.min(100,n/a*100)),d=Math.max(0,Math.min(100-u,i/a*100)),c=Math.max(0,Math.min(100-u-d,r/a*100));return{remainingPct:u,todayPct:d,spentPct:c,hasCap:!0,pastSpend:r,today:i}}function xt(t,s,o=null,a=null){const n=o??t.customBalance,l=pa(je(s,n,a)==="CREDITS"?null:s,n),i=Number(n?.remaining)||0,r=Number(n?.spend)||0,u=ba(t,s,"custom",n,a);return{cap:l,...fa({remaining:i,spend:r,todayUsed:u,cap:l})}}function Cn(t,s){const o=t.balance,a=pa(s,null),n=Number(o?.totalBalance)||0,l=ba(t,s,"official",null),i=a!==null?Math.max(0,a-n):0;return{cap:a,...fa({remaining:n,spend:i,todayUsed:l,cap:a})}}function vt(t){const{segments:s,direction:o="remaining"}=t,{remainingPct:a,todayPct:n,spentPct:l}=s,i=[];a>0&&i.push(e("div",{className:"cm-bbox-fill",style:{width:a+"%"}})),n>0&&i.push(e("div",{className:"cm-bbox-seg-today",style:{width:n+"%"}})),l>0&&i.push(e("div",{className:"cm-bbox-seg-spent",style:{width:l+"%"}})),i.length===0&&i.push(e("div",{className:"cm-bbox-fill",style:{width:"100%"}}));const r=o==="used"?[...i].reverse():i;return e("div",{className:"cm-bbox-bar segments"+(o==="used"?" rev":"")},...r)}function ga(t,s,o,a,n){const l=[t("balanceBarRemaining",{amount:a})];return o.today>0&&l.push(t("balanceBarToday",{amount:s(o.today)})),o.pastSpend>0&&l.push(t("balanceBarSpent",{amount:s(o.pastSpend)})),n!==null&&n>0&&l.push(t("balanceBudgetCapLabel")+": "+s(n)),l.join(" · ")}function Pe(t){const[s,o]=L(!1),[a,n]=L(null);return{busy:s,err:a,run:()=>{s||typeof t!="function"||(o(!0),n(null),Promise.resolve().then(t).catch(i=>{n(i?.message??String(i))}).finally(()=>{o(!1)}))}}}const me=(t,s)=>({role:"button",tabIndex:0,"aria-busy":t?"true":"false",onClick:s,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),s())}});function ge(t,s){const o=[t("clickToRefresh")];return s.busy&&o.push(t("refreshing")),s.err&&o.push("⚠ "+t("balanceRefreshFailed",{message:s.err})),o}const An="https://platform.deepseek.com/usage";function ha(t){return e("a",{className:"cm-bal-link",href:An,target:"_blank",rel:"noreferrer noopener",title:t("balanceRechargeLink"),"aria-label":t("balanceRechargeLink"),onClick:s=>s.stopPropagation(),onKeyDown:s=>s.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 Pn(t){const{state:s,wide:o,api:a}=t,n=s.balance,l=K(_(s.config?.locale)),i=Pe(a?()=>a.refreshBalance():null);if(!n||n.status==="off")return null;if(n.status==="error")return e(Z,{label:[l("balanceQueryFailed",{message:n.message||l("unknownError")}),...ge(l,i)].join("; "),side:"right",delayMs:300},e("div",{className:"cm-foot clickable"+(o?"":" cm-foot-rail")+" cm-bal-err"+(i.busy?" busy":""),...me(i.busy,i.run)},o?e(E,null,l("balance")," ",e("span",{className:"cm-num"},l("queryFailed"))):"⚠"));const r=[l("balanceTitle"),l("totalBalance",{amount:we(n.totalBalance,s.config,n.currency)}),l("grantedToppedUp",{granted:we(n.grantedBalance,s.config,n.currency),toppedUp:we(n.toppedUpBalance,s.config,n.currency)}),l("updatedAt",{time:n.fetchedAt>0?new Date(n.fetchedAt).toLocaleTimeString():"—"}),...s.reconcile?.ok===!1?["⚠ "+s.reconcile.message]:[],...ge(l,i)].join("; ");return e(Z,{label:r,side:"right",delayMs:300},e("div",{className:"cm-foot clickable"+(o?"":" cm-foot-rail")+(i.busy?" busy":""),...me(i.busy,i.run)},o?e(E,null,e("span",{className:"cm-balance-name"},l("balance"),ha(l)),e("span",{className:"cm-num cm-bal-amt"},we(n.totalBalance,s.config,n.currency)),s.reconcile?.ok===!1?" ⚠":""):e($e,{size:16})))}function Mn(t){const{state:s,wide:o,api:a}=t,n=s.config,l=s.balance,i=K(_(n?.locale)),r=Pe(a?()=>a.refreshBalance():null);if(!l||l.status!=="ok")return null;const u=Cn(s,n),d=we(l.totalBalance,n,l.currency),c=b=>we(b,n,l.currency),m=[i("balanceTitle"),ga(i,c,u,d,u.cap),i("grantedToppedUp",{granted:we(l.grantedBalance,n,l.currency),toppedUp:we(l.toppedUpBalance,n,l.currency)}),i("updatedAt",{time:l.fetchedAt>0?new Date(l.fetchedAt).toLocaleTimeString():"—"}),...s.reconcile?.ok===!1?["⚠ "+s.reconcile.message]:[],...ge(i,r)].join("; "),p=e(E,null,e("div",{className:"cm-bbox-head"},e("span",{className:"cm-balance-name"},e("span",{className:"cm-bbox-label"},i("balance")),ha(i)),e("span",{className:"cm-bbox-pct cm-num cm-bal-amt"},d)),e(vt,{segments:u,direction:te(n,"balance")}));return e(Z,{label:m,side:"right",delayMs:300},e("div",{className:"cm-bbox clickable"+(o?"":" rail")+(r.busy?" busy":""),...me(r.busy,r.run)},o?p:e("div",{className:"cm-bbox-rail cm-num"},Math.round(u.remainingPct)+"%")))}function Nt(t,s){const o=typeof t?.label=="string"?t.label:"",a=typeof t?.labelEn=="string"?t.labelEn:"";return s==="en"?a||o||"Custom balance":o||a||"自定义余额"}function je(t,s,o){if((o??t?.customBalance)?.adapter==="aliyun"&&["CNY","USD","EUR"].includes(s?.unit))return s.unit;const a=o?.unit??t?.customBalance?.unit;return["CNY","EUR","USD","CREDITS"].includes(a)?a:["CNY","EUR","CREDITS"].includes(s?.unit)?s.unit:"USD"}function Qe(t,s,o,a){const n=je(s,o,a),l=Number(t);if(!Number.isFinite(l))return"—";const i=s?.currency==="USD"?1:Number(s?.exchangeRate);if((a??s?.customBalance)?.convertToDisplayCurrency===!0&&n==="USD"&&Number.isFinite(i)&&i>0){const c=l*i;return Number.isFinite(c)?se(c,s):"—"}const r=n==="CREDITS",u=Math.max(2,Math.min(6,Math.floor(Number(s?.decimals)||4)));return(r?"":n==="CNY"?"¥":n==="EUR"?"€":"$")+oa(l,u)+(r?" Credits":"")}function St(t,s,o,a,n=null){const l=Qe(t.remaining,s,t,n),i=p=>Qe(p,s,t,n);if(a&&s.balance?.showProgressBar===!0){const p=xt(a,s,t,n);return[ga(o,i,p,l,p.cap),o("updatedAt",{time:t.fetchedAt>0?new Date(t.fetchedAt).toLocaleTimeString():"—"})].join(" · ")}const r=t.spend!==null?i(t.spend):"—",u=t.maxBudget!==null?i(t.maxBudget):"—",d=je(s,t,n)==="CREDITS"?NaN:Number(s?.balance?.budgetCap),c=Number.isFinite(d)&&d>0?o("balanceBudgetCapLabel")+": "+i(d):"",m=t.maxBudget!==null&&t.spend!==null?o("customBalanceLine",{remaining:l,spend:r,maxBudget:u,time:t.fetchedAt>0?new Date(t.fetchedAt).toLocaleTimeString():"—"}):o("customBalanceRemaining",{amount:l});return c?m+" · "+c:m}function Tn(t,s,o,a,n){const l=Nt(n??s.customBalance??{},_(s?.locale)),i=Qe(a.remaining,s,a,n),r=xt(t,s,a,n);return{level:"ok",rail:Math.round(r.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"},i)),e(vt,{segments:r,direction:te(s,"balance")}))}}function Ct(t,s){const o=s?.customBalances??[],a=Array.isArray(t?.customBalances)?t.customBalances:[],n=[];return o.forEach((l,i)=>{if(l?.enabled!==!0||l.display!=="sidebar"&&l.display!=="both")return;const r=a.find(u=>u.index===i)??(a.length===1&&o.length===1?a[0]:null);n.push({index:i,entry:l,snapshot:r})}),n.length===0&&a.length===0&&s?.customBalance?.enabled===!0&&(s.customBalance.display==="sidebar"||s.customBalance.display==="both")&&t?.customBalance?.status&&t.customBalance.status!=="off"&&n.push({index:null,entry:s.customBalance,snapshot:t.customBalance}),n}function Bn(t){const{state:s,wide:o,api:a}=t,n=s.config,l=K(_(n?.locale)),i=Ct(s,n);return i.length===0?null:e(E,null,i.map(({index:r,entry:u,snapshot:d})=>e(Dn,{key:"cb-"+r,state:s,wide:o,api:a,t:l,index:r,entry:u,snapshot:d})))}function Dn(t){const{state:s,wide:o,api:a,t:n,index:l,entry:i,snapshot:r}=t,u=s.config;if(r==null||r.status!=="ok")return null;const d=Pe(a?()=>a.refreshCustomBalance(l):null),c=Tn(s,u,n,r,i),m=[St(r,u,n,s,i),...ge(n,d)].join(" · ");return e(Z,{label:m,side:"right",delayMs:300},e("div",{className:"cm-bbox clickable"+(c.level==="ok"?"":" "+c.level)+(o?"":" rail")+(d.busy?" busy":""),...me(d.busy,d.run)},o?c.body:e("div",{className:"cm-bbox-rail cm-num"},c.rail)))}function On(t){const{state:s,wide:o,api:a}=t,n=s.config,l=K(_(n?.locale)),i=Ct(s,n);return i.length===0?null:e(E,null,i.map(({index:r,entry:u,snapshot:d})=>e(Rn,{key:"cbr-"+r,state:s,wide:o,api:a,t:l,index:r,entry:u,snapshot:d})))}function Rn(t){const{state:s,wide:o,api:a,t:n,index:l,entry:i,snapshot:r}=t,u=s.config,d=r??Kt(l);if(d.status==="off")return null;const c=Pe(a?()=>a.refreshCustomBalance(l):null),m=Nt(i??u.customBalance??{},_(u?.locale));if(d.status==="error")return e(Z,{label:[d.message||n("unknownError"),...ge(n,c)].join("; "),side:"right",delayMs:300},e("div",{className:"cm-foot clickable"+(o?"":" cm-foot-rail")+" cm-bal-err"+(c.busy?" busy":""),...me(c.busy,c.run)},o?e(E,null,e("span",{className:"cm-bal-label",title:m},m),e("span",{className:"cm-num cm-bal-amt"},n("queryFailed"))):"⚠"));const p=Qe(d.remaining,u,d,i),b=[St(d,u,n,s,i),...ge(n,c)].join(" · ");return e(Z,{label:b,side:"right",delayMs:300},e("div",{className:"cm-foot clickable"+(o?"":" cm-foot-rail")+(c.busy?" busy":""),...me(c.busy,c.run)},o?e(E,null,e("span",{className:"cm-bal-label",title:m},m),e("span",{className:"cm-num cm-bal-amt"},p)):e($e,{size:16})))}function Ln(t){const o=(t.useCost?t.useCost(g=>g):void 0)?.state;if(!o)return null;const a=o.config,n=K(_(a?.locale)),l=a.corner??{enabled:!1,goRolling:!0,goWeekly:!0,goMonthly:!0,budget:!0},i=o.goQuota,r=a?.goQuota?.enabled!==!1&&i?.status==="ok",u=g=>g!==null&&typeof g?.percent=="number"?Math.round(Math.max(0,Math.min(100,g.percent))):null,d=[];if(a.sidebarModels?.dock){const g=Pa(o,a.sidebarModels.period,n);g.length&&d.push({key:"model-top",text:e(E,null,e("span",{className:"cm-bal-label"},g[0].label),e("span",{className:"cm-bal-amt"},V(g[0].cost,a))),tip:g[0].label+" "+V(g[0].cost,a),level:"ok"})}const c=(g,k,v,N)=>{if(!l.enabled||!g||!r)return;const C=u(k);if(C===null)return;const w=typeof k.resetsAt=="string"&&k.resetsAt.length>0?n("goResetAt",{time:new Date(k.resetsAt).toLocaleString()}):"";d.push({key:v,text:n(v)+" "+C+"%",tip:n(N)+": "+C+"%"+(w?" · "+w:""),level:C>=100?"over":C>=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",i?.rolling,"goShortRolling","cornerGoRolling"]:g==="weekly"?["goWeekly",i?.weekly,"goShortWeekly","cornerGoWeekly"]:["goMonthly",i?.monthly,"goShortMonthly","cornerGoMonthly"];for(const g of p){const[k,v,N,C]=b(g);c(l[k]===!0,v,N,C)}if(l.enabled&&l.budget===!0){const g=a.budget??{enabled:!1,amount:100,period:"month"};if(g.enabled===!0){const k=Number(a.exchangeRate),N=(o.budgetUsed??(g.period==="day"?W(o.today,a):g.period==="all"?W(o.total,a):W(o.month,a)))*(Number.isFinite(k)&&k>0?k:1),C=Math.max(0,Number(g.amount)||0),w=C>0?Math.min(999,N/C*100):null;if(w!==null){const f=w>=100?"over":w>=80?"warn":"ok";d.push({key:"budget",text:n("budgetShort")+" "+w.toFixed(1)+"%",tip:n("budgetOf",{period:n(qe[g.period]??"periodMonth")})+" · "+n("usedOf",{used:se(N,a),amount:se(C,a)}),level:f})}}}return d.length===0?null:e("div",{className:"cm-corner"},d.map(g=>e(Z,{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 Xe(t,s,o){if(!Array.isArray(s)||s.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(o)?o.length:0)+7));for(let p=-l;p<=l;p+=1){n.add(a(p,16));for(const b of s){const g=Number(b?.start),k=Number(b?.end);!Number.isFinite(g)||!Number.isFinite(k)||(n.add(a(p,g)),n.add(a(k<=g?p+1:p,k)))}}const i=[...n].sort((p,b)=>p-b).flatMap(p=>{const b=Je(p-1,void 0,s,o),g=Je(p,void 0,s,o);return b===g?[]:[{at:p,intoPeak:g}]});let r=null,u=null;for(const p of i)p.at<=t&&(r===null||p.at>r.at)&&(r=p),p.at>t&&(u===null||p.at<u.at)&&(u=p);const d=ta(t,o),c=d??ea(t);return c!==null?u===null?null:{inPeak:!1,weekend:d===null,...d?{holiday:!0}:{},prevAtMs:c.start,nextAtMs:u.at,nextIntoPeak:u.intoPeak}:r===null||u===null?null:{inPeak:Je(t,void 0,s,o),weekend:!1,prevAtMs:r.at,nextAtMs:u.at,nextIntoPeak:u.intoPeak}}function et(t,s){if(!t||t.peakNotice===!1||t.peakEnabled!==!0)return null;const o=Date.parse(t.peakEffectiveAt||"");if(Number.isFinite(o)&&s<o)return null;const a=Array.isArray(t.peakWindows)?t.peakWindows:[];return Xe(s,a,t.peakHolidays)}function tt(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,s,o){const a=Math.max(0,t.nextAtMs-s),n=Math.max(1,Math.ceil(a/6e4)),l=Math.floor(n/60),i=n%60;return l>0?i>0?o("countdownHourMinute",{h:l,m:i}):o("countdownHoursOnly",{h:l}):o("countdownMinute",{m:n})}const At="cm-peak-alert-preview";let ya=0;function En(t){const s=t.useCost?t.useCost(k=>k):void 0,o=s?.state?.config,[a,n]=L(Date.now()),[l,i]=L(null),[r,u]=L(null);if(ee(()=>{const k=window.setInterval(()=>n(Date.now()),1e4);return()=>window.clearInterval(k)},[]),ee(()=>{const k=v=>{const N=v.detail?.kind==="offpeak"?"offpeak":"peak";u(N);const C=s?.state?.config;if(C?.peakAlertWebNotify===!0&&window.Notification&&Notification.permission==="granted"){const w=K(_(C.locale));try{new Notification(w(N==="peak"?"peakAlertTitlePeak":"peakAlertTitleOffPeak")+w("peakAlertPreviewTag"),{body:w("peakAlertBody",{time:w("countdownMinute",{m:2}),phase:w(N==="peak"?"peakAlertPhasePeak":"peakAlertPhaseOffPeak")})})}catch{}}};return window.addEventListener(At,k),window.__cmPeakAlertLive=!0,()=>{window.removeEventListener(At,k),window.__cmPeakAlertLive=!1}},[]),ee(()=>{if(!o||o.peakAlertEnabled!==!0||o.peakEnabled!==!0||o.peakAlertWebNotify!==!0||!window.Notification||Notification.permission!=="granted")return;const k=Xe(a,Array.isArray(o.peakWindows)?o.peakWindows:[],o.peakHolidays);if(k===null)return;const v=o.peakAlertTarget==="peak"||o.peakAlertTarget==="offpeak"?o.peakAlertTarget:"both",N=k.nextIntoPeak===!0;if(v!=="both"&&v!==(N?"peak":"offpeak"))return;const C=Number(o.peakAlertAhead),w=(Number.isFinite(C)&&C>=1?C:2)*6e4;if(a<k.nextAtMs-w||a>=k.nextAtMs||ya===k.nextAtMs)return;const f=K(_(o.locale));ya=k.nextAtMs;try{new Notification(f(N?"peakAlertTitlePeak":"peakAlertTitleOffPeak"),{body:f("peakAlertBody",{time:he(k,a,f),phase:f(N?"peakAlertPhasePeak":"peakAlertPhaseOffPeak")})})}catch{}},[a]),!o||o.peakEnabled!==!0)return null;let d=null;if(o.peakAlertEnabled===!0){const k=Date.parse(o.peakEffectiveAt||"");if(!(Number.isFinite(k)&&a<k)){const v=Xe(a,Array.isArray(o.peakWindows)?o.peakWindows:[],o.peakHolidays);if(v!==null){const N=o.peakAlertTarget==="peak"||o.peakAlertTarget==="offpeak"?o.peakAlertTarget:"both",C=Number(o.peakAlertAhead),w=(Number.isFinite(C)&&C>=1?C:2)*6e4;(N==="both"||N===(v.nextIntoPeak?"peak":"offpeak"))&&a>=v.nextAtMs-w&&a<v.nextAtMs&&l!==v.nextAtMs&&(d=v)}}}let c=null,m=!1,p=null;if(d!==null)c=d,m=d.nextIntoPeak===!0,p=()=>i(d.nextAtMs);else if(r!==null)c={nextAtMs:a+2*6e4,nextIntoPeak:r==="peak"},m=r==="peak",p=()=>u(null);else return null;const b=K(_(o.locale)),g=o.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 qn(t){const{config:s,t:o}=t,[a,n]=L(Date.now());ee(()=>{const u=window.setInterval(()=>n(Date.now()),3e4);return()=>window.clearInterval(u)},[]);const l=et(s,a);if(l===null)return null;const i=tt(l),r=l.nextIntoPeak?o("nextPeakIn",{time:he(l,a,o)}):o("nextOffPeakIn",{time:he(l,a,o)});return e(Z,{label:o(i.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"},o(i.chip)+" · "+r)))}function Un(t){const{config:s,t:o}=t,[a,n]=L(Date.now());ee(()=>{const u=window.setInterval(()=>n(Date.now()),3e4);return()=>window.clearInterval(u)},[]);const l=et(s,a);if(l===null)return null;const i=tt(l),r=l.nextIntoPeak?o("nextPeakIn",{time:he(l,a,o)}):o("nextOffPeakIn",{time:he(l,a,o)});return e(Z,{label:o(i.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"},o(i.chip)+" · "+r)))}function at(t,s,o){return e(s?.peakStyle==="classic"?Un:qn,{config:s,t:o})}function Hn(t){const{config:s,t:o}=t,[a,n]=L(Date.now());ee(()=>{const d=window.setInterval(()=>n(Date.now()),3e4);return()=>window.clearInterval(d)},[]);const l=et(s,a);if(l===null)return null;const i=tt(l),r=l.nextIntoPeak?o("nextPeakIn",{time:he(l,a,o)}):o("nextOffPeakIn",{time:he(l,a,o)}),u=[o(i.notice),r];return e(Z,{label:u,side:"right",delayMs:300},e("div",{className:"cm-peak-rail "+(l.weekend||l.holiday?"weekend":l.inPeak?"peak":"off"),"aria-label":u.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"},o(i.short))))}function In(t){const{config:s,t:o}=t,[a,n]=L(Date.now());ee(()=>{const d=window.setInterval(()=>n(Date.now()),3e4);return()=>window.clearInterval(d)},[]);const l=et(s,a);if(l===null)return null;const i=tt(l),r=l.nextIntoPeak?o("nextPeakIn",{time:he(l,a,o)}):o("nextOffPeakIn",{time:he(l,a,o)}),u=[o(i.notice),r];return e(Z,{label:u,side:"right",delayMs:300},e("div",{className:"cm-peak-rail-classic "+(l.weekend||l.holiday?"weekend":l.inPeak?"peak":"off"),"aria-label":u.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"},o(i.short))))}function jn(t,s,o){return e(s?.peakStyle==="classic"?In:Hn,{config:s,t:o})}function ka(t,s,o){const a=t.today,n=s.budget??{enabled:!1,amount:100,period:"month"},l=Number(s.exchangeRate),r=(t.budgetUsed??(n.period==="day"?W(t.today,s):n.period==="all"?W(t.total,s):W(t.month,s)))*(Number.isFinite(l)&&l>0?l:1),u=Math.max(0,Number(n.amount)||0),d=u>0?Math.min(999,r/u*100):null,c=de(d===null?null:Math.min(100,d),te(s,"budget")),m=W(a,s)*(Number.isFinite(l)&&l>0?l:1),p=u>0?Math.min(999,m/u*100):null,b=n.detail!==!1;return{level:d===null?"ok":d>=100?"over":d>=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"},o("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,s.hideTodayCost===!0?null:e("div",{className:"cm-bbox-line cm-num"},s.sidebarTodayMetric==="tokens"?o("today")+" "+Dt(a,s,o):o("todayShare",{amount:V(W(a,s),s),pct:p===null?"—":p.toFixed(1)+"%"})),e("div",{className:"cm-bbox-line cm-num"},o("usedOf",{used:se(r,s),amount:se(u,s)}))):null,at(t,s,o))}}function wa(t,s,o){const a=t.goQuota,n=s?.goQuota?.main==="weekly"||s?.goQuota?.main==="monthly"?s.goQuota.main:"rolling",l=a[n],i=l!==null&&typeof l?.percent=="number"?Math.max(0,Math.min(100,Number(l.percent)||0)):0,r=b=>b!==null&&typeof b?.percent=="number"?Math.round(Math.max(0,Math.min(100,b.percent)))+"%":"—",u=b=>o(b==="rolling"?"goShortRolling":b==="weekly"?"goShortWeekly":"goShortMonthly"),d=["rolling","weekly","monthly"].filter(b=>b!==n),c=l!==null&&typeof l?.resetsAt=="string"&&l.resetsAt.length>0?o("goResetAt",{time:new Date(l.resetsAt).toLocaleString()}):"",m=s?.goQuota?.detail!==!1,p=de(i,te(s,"go"));return{level:i>=100?"over":i>=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"},o("goQuotaRowLabel")+" "+u(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"},d.map(b=>u(b)+" "+r(a[b])).join(" · ")),c?e("div",{className:"cm-bbox-line"},c):null):null)}}function Qn(t){const{state:s,wide:o}=t,a=s.goQuota,n=K(_(s.config?.locale));if(!a||a.status!=="ok")return null;const l=s.config?.goQuota?.main==="weekly"||s.config?.goQuota?.main==="monthly"?s.config.goQuota.main:"rolling";if(a[l]===null||typeof a[l]?.percent!="number")return null;const i=wa(s,s.config,n),r=[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(Z,{label:r,side:"right",delayMs:300},e("div",{className:"cm-bbox"+(i.level==="ok"?"":" "+i.level)+(o?"":" rail")},o?i.body:e("div",{className:"cm-bbox-rail cm-num"},i.rail)))}function Fn(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 Fe(t){const s=t!==null&&typeof t=="object"?t:{};return{five:s["5h"]??null,seven:s["7d"]??s.week??s.weekly??null}}function xa(t,s,o=Date.now()){if(typeof t!="string"||!t)return"";const a=Date.parse(t);if(!Number.isFinite(a))return"";const n=a-o;if(n<=0)return s("resetReached");const l=Math.ceil(n/6e4),i=Math.floor(l/1440),r=Math.floor(l%1440/60),u=l%60;return i>0?s("resetDays",{d:i,h:r}):r>0?s("resetHours",{h:r,m:u}):s("resetMinutes",{m:u})}function _e(t,s,o=Date.now()){const a=xa(t?.resetsAt,s,o);return a?s("goResetAt",{time:new Date(t.resetsAt).toLocaleString()})+" ("+a+")":""}function nt(t,s,o){return t===null?"—":o(s==="remaining"?"quotaRemaining":"quotaUsed",{pct:t})}function st(t){const[,s]=L(0),o=()=>s(Date.now());return ee(()=>{if(!t)return;const a=setInterval(o,6e4);return()=>clearInterval(a)},[t]),{onMouseEnter:o,onFocus:o}}function We(t,s,o,a){const n=Fn(s),l=n===null?"ok":n>=100?"over":n>=80?"warn":"ok",i=de(n,o),r=s?.unlimited?"∞":i.label===null?"—":i.label+"%";return{level:l,pct:n,text:r,label:i.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:i.width+"%"}})),e("span",{className:"cm-bbox-pct cm-num"},r))}}function va(t){const{five:s,seven:o,fetchedAt:a,t:n,wide:l,refresh:i,direction:r="used"}=t,u=st(s?.resetsAt),d=xa(s?.resetsAt,n),c=We(n("codingPlanRemain5h"),s,r,n),m=We(n("codingPlanRemain7d"),o,r,n),p=c.level==="over"||m.level==="over"?"over":c.level==="warn"||m.level==="warn"?"warn":"ok",b=(N,C,w)=>{const f=C?.unlimited?n("quotaUnlimited"):nt(w.label,r,n),S=_e(C,n);return N+" "+f+(S?" · "+S:"")},g=[n("codingPlanMinimaxTitle"),b(n("codingPlanRemain5h"),s,c),b(n("codingPlanRemain7d"),o,m),a>0?n("goQuotaFetchedAt",{time:new Date(a).toLocaleTimeString()}):null,...i?ge(n,i):[]].filter(Boolean).join(`
|
|
2
|
+
window.__ModuleLoader__.load({id:"dsh-cost-meter",factory:jt=>{var Qt={exports:{}},rt=Qt.exports;Object.defineProperty(rt,Symbol.toStringTag,{value:"Module"});const Ee=jt("react"),{Tooltip:Z}=jt("@deepseek-ai/dsh-client-ui-primitives"),Ge=!1,qa='.cm-root{display:block;text-align:center;max-width:var(--dsh-chat-content-width,720px);width:100%;margin:0 auto;box-sizing:border-box;padding:4px calc(var(--dsh-composer-side-clearance,0px) + 16px) 0;font-size:12px;line-height:20px;color:var(--dsw-alias-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(--dsw-alias-bg-layer-2);font-size:12px;line-height:22px;color:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-interactive-bg-hover)}.cm-foot-rail{width:100%;justify-content:center;padding:0;font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary)}.cm-num{font-variant-numeric:tabular-nums}.cm-go-rail{font-size:11px;font-weight:700;color:var(--dsw-alias-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(--dsw-alias-label-secondary)}.cm-go-bar{flex:1;height:6px;border-radius:3px;background:var(--dsw-alias-interactive-bg-hover);overflow:hidden}.cm-go-fill{height:100%;border-radius:3px;background:var(--dsw-alias-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(--dsw-alias-label-tertiary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cm-go-time{font-size:11px;color:var(--dsw-alias-label-tertiary)}.cm-go-row.main .cm-go-label{font-weight:600;color:var(--dsw-alias-label-primary)}.cm-corner{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:6px;width:100%;max-width:var(--dsh-chat-content-width,720px);margin:2px auto 0;box-sizing:border-box;padding:0 calc(var(--dsh-composer-side-clearance,0px) + 16px)}.cm-corner-chip{display:inline-flex;align-items:center;height:20px;padding:0 8px;border-radius:6px;background:var(--dsw-alias-bg-layer-2);font-size:11px;line-height:20px;color:var(--dsw-alias-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(--dsw-alias-bg-layer-2);font-size:11px;line-height:22px;color:var(--dsw-alias-label-secondary);white-space:nowrap;font-variant-numeric:tabular-nums;cursor:default}.cm-qchip .cm-qlabel{color:var(--dsw-alias-label-primary);font-weight:600}.cm-qchip .cm-qbar{display:block;width:44px;height:4px;border-radius:2px;background:var(--dsw-alias-border-l1);overflow:hidden;flex:none}.cm-qchip .cm-qfill{display:block;height:100%;border-radius:2px;background:var(--dsw-alias-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(--dsw-alias-border-l1);flex:none}.cm-qchip .cm-qtext{color:var(--dsw-alias-label-secondary)}.cm-qchip.warn .cm-qfill{background:var(--dsw-alias-state-warn-primary)}.cm-qchip.over .cm-qfill{background:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-tertiary)}.cm-plan-tag{flex:none;margin-left:6px;padding:0 6px;border-radius:999px;border:1px solid var(--dsw-alias-border-l1);font-size:10px;line-height:16px;color:var(--dsw-alias-state-warn-primary)}.cm-plan-reset,.cm-plan-method{font-size:11px;color:var(--dsw-alias-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(--dsw-alias-border-l1);border-radius:12px;background:var(--dsw-alias-bg-layer-1);box-shadow:0 8px 28px #0000002e;padding:14px 16px;font-size:13px;color:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-tertiary);cursor:pointer;user-select:none}.cm-cards-toggle:hover{color:var(--dsw-alias-label-primary)}.cm-cards-toggle input{margin:0;cursor:pointer}.cm-card,.cm-budget{border:1px solid var(--dsw-alias-border-l1);border-radius:12px;padding:14px 16px;background:var(--dsw-alias-bg-layer-1)}.cm-card-title{font-size:12px;color:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-interactive-text-hover,var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-secondary);background:transparent;border:none;border-radius:8px;padding:6px 14px;cursor:pointer;white-space:nowrap}.cm-tab.active{background:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-label-primary-inverted);font-weight:600}.cm-tabs-row .cm-msg{padding:2px 10px}.cm-note{font-size:12px;color:var(--dsw-alias-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(--dsw-alias-border-l1);white-space:nowrap}.cm-table th{color:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-tertiary)}.cm-empty{font-size:12px;color:var(--dsw-alias-label-tertiary);padding:8px 0}.cm-scroll{max-height:320px;overflow:auto;border:1px solid var(--dsw-alias-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(--dsw-alias-label-secondary)}.cm-input{font:inherit;font-size:13px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-base);border:1px solid var(--dsw-alias-border-l1);border-radius:8px;padding:6px 10px;outline:none}.cm-input:focus{border-color:var(--dsw-alias-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(--dsw-alias-state-business-primary)}.cm-range-value{flex:none;min-width:44px;font-size:12px;color:var(--dsw-alias-label-tertiary);text-align:right}.cm-check{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--dsw-alias-label-primary);cursor:pointer}.cm-price-card{border:1px solid var(--dsw-alias-border-l1);border-radius:10px;padding:12px 14px;display:flex;flex-direction:column;gap:10px;background:var(--dsw-alias-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(--dsw-alias-label-tertiary);border:1px solid var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-primary);background:var(--dsw-alias-button-elevated-fill);border:1px solid var(--dsw-alias-border-l1);border-radius:8px;padding:6px 14px;cursor:pointer}.cm-btn.primary{background:var(--dsw-alias-state-business-primary);border-color:transparent;color:var(--dsw-alias-label-primary-inverted)}.cm-btn.primary:hover{opacity:.88;background:var(--dsw-alias-state-business-primary)}.cm-btn.danger,.cm-msg.err,.cm-bal-line.err,.cm-bal-err{color:var(--dsw-alias-state-error-primary)}.cm-btn.small{padding:3px 10px;font-size:12px}.cm-msg{font-size:12px;line-height:18px;padding:8px 12px;border-radius:8px;border:1px solid var(--dsw-alias-border-l1)}.cm-msg.ok{color:var(--dsw-alias-state-success-primary)}.cm-hint{font-size:12px;color:var(--dsw-alias-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(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-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(--dsw-alias-state-warn-primary)}.cm-peak-alert-offpeak{border-top:3px solid var(--dsw-alias-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(--dsw-alias-state-warn-primary)}.cm-peak-alert-offpeak .cm-peak-alert-badge{color:var(--dsw-alias-state-info-primary,#3b82f6)}.cm-peak-alert-title{font-size:14px;font-weight:600;color:var(--dsw-alias-label-primary)}.cm-peak-alert-body{color:var(--dsw-alias-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(--dsw-alias-bg-layer-3);overflow:hidden}.cm-budget-fill{height:100%;border-radius:999px;background:var(--dsw-alias-state-business-primary);transition:width .3s ease}.cm-ug{display:flex;flex-direction:column;gap:12px}.cm-ug-total{font-size:13px;color:var(--dsw-alias-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(--dsw-alias-label-primary) 8%,transparent);border:1px solid var(--dsw-alias-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(--dsw-alias-state-business-primary) 25%,var(--dsw-alias-bg-layer-3))}.cm-ug-cell.l2{background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 50%,var(--dsw-alias-bg-layer-3))}.cm-ug-cell.l3{background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 75%,var(--dsw-alias-bg-layer-3))}.cm-ug-cell.l4{background:var(--dsw-alias-state-business-primary)}.cm-ug-cell.today{outline:1px solid var(--dsw-alias-label-secondary);outline-offset:1px}.cm-ug-months{display:grid;grid-auto-flow:column;gap:3px;width:100%;font-size:10px;color:var(--dsw-alias-label-tertiary);margin-top:4px}.cm-ug-monthc{white-space:nowrap}.cm-budget-line{font-size:13px;color:var(--dsw-alias-label-secondary)}.cm-budget-line.over{color:var(--dsw-alias-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(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-3)}.cm-peak-segment{height:100%;flex:1}.cm-peak-high{background:#ff9800}.cm-peak-low{background:var(--dsw-alias-state-business-primary)}.cm-peak-marker{position:absolute;top:0;left:50%;width:2px;height:100%;background:var(--dsw-alias-bg-base);box-shadow:0 0 0 1px var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-bg-base);border:1.5px solid #ff9800;box-shadow:0 0 0 1px var(--dsw-alias-bg-base),0 0 0 2px var(--dsw-alias-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(--dsw-alias-state-business-primary)}.cm-peak-classic.off .cm-peak-classic-marker:after{border-top-color:var(--dsw-alias-state-business-primary)}.cm-peak-classic-chip{align-self:flex-start;font-size:11px;font-weight:600;line-height:1.4;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);border-radius:999px;padding:2px 8px;white-space:nowrap;color:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-3)}.cm-peak-rail-segment{width:100%;flex:1}.cm-peak-rail-high{background:#ff9800}.cm-peak-rail-low{background:var(--dsw-alias-state-business-primary)}.cm-peak-rail-marker{position:absolute;left:0;top:50%;width:100%;height:2px;background:var(--dsw-alias-bg-base);box-shadow:0 0 0 1px var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-border-l1);background:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-bg-base);border:1.5px solid #ff9800;box-shadow:0 0 0 1px var(--dsw-alias-bg-base),0 0 0 2px var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-tertiary);border-bottom:1px solid var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-tertiary);border-bottom:1px solid var(--dsw-alias-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(--dsw-alias-label-secondary)}.cm-vendor-display{display:inline-flex;align-items:center;gap:4px;font-weight:400;font-size:11px;color:var(--dsw-alias-label-tertiary);white-space:nowrap}.cm-catalog-family{margin:6px 0 2px;font-size:11px;font-weight:600;color:var(--dsw-alias-label-tertiary)}.cm-catalog-row{display:flex;align-items:center;gap:8px;padding:4px 0;border-top:1px solid var(--dsw-alias-border-l1);font-size:12px}.cm-catalog-mounted{display:flex;flex-direction:column;gap:4px;padding:6px 0;border-top:1px solid var(--dsw-alias-border-l1)}.cm-catalog-id{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cm-catalog-price{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-size:11px}.cm-catalog-tag{font-size:10px;padding:1px 6px;border-radius:999px;border:1px solid var(--dsw-alias-state-business-primary);color:var(--dsw-alias-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(--dsw-alias-border-l1);border-radius:999px;padding:2px 12px;font-size:12px;color:var(--dsw-alias-label-secondary);cursor:pointer}.cm-mstats-tab.active{background:var(--dsw-alias-state-business-primary);border-color:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-bg-base);font-weight:600}.cm-mstats-h{margin:10px 0 4px;font-size:12px;font-weight:600;color:var(--dsw-alias-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(--dsw-alias-label-secondary)}.cm-mstats-barbg{position:relative;height:10px;border-radius:999px;background:var(--dsw-alias-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(--dsw-alias-state-business-primary)}.cm-mstats-seg.cache{background:#ff9800}.cm-mstats-seg.out{background:#34a853}.cm-mstats-val{white-space:nowrap;color:var(--dsw-alias-label-secondary)}.cm-mstats-legend{display:flex;gap:12px;font-size:10px;color:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-border-l1);border-radius:12px;padding:8px 10px;background:var(--dsw-alias-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(--dsw-alias-state-warn-primary)}.cm-bbox.over{border-color:var(--dsw-alias-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(--dsw-alias-label-primary)}.cm-bbox.warn .cm-bbox-pct{color:var(--dsw-alias-state-warn-primary)}.cm-bbox.over .cm-bbox-pct{color:var(--dsw-alias-state-error-primary)}.cm-bbox-bar{height:6px;border-radius:999px;background:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-secondary)}.cm-dir-row .cm-input{flex:1 1 60%;width:auto}.cm-bbox-fill{height:100%;border-radius:999px;background:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-tertiary);text-decoration:none;outline:none}.cm-bal-link:hover{color:var(--dsw-alias-brand-primary);background:var(--dsw-alias-interactive-bg-hover)}.cm-bal-link:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-state-error-primary)}.cm-bbox-line{font-size:12px;color:var(--dsw-alias-label-tertiary)}.cm-bbox-rail{font-size:11px;font-weight:600;color:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-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(--dsw-alias-border-l1);margin:0}.cm-bbox.clickable,.cm-foot.clickable{cursor:pointer}.cm-bbox.clickable:hover{border-color:var(--dsw-alias-state-business-primary)}.cm-bbox.clickable:focus-visible,.cm-foot.clickable:focus-visible{outline:2px solid var(--dsw-alias-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(--dsw-alias-label-primary)}.cm-mm-reset{font-size:11px;color:var(--dsw-alias-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(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary)}.cm-gw-switcher:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.cm-gw-sub{font-size:11px;color:var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-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(--dsw-alias-label-secondary)}.cm-bal-line.warn{color:var(--dsw-alias-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(--dsw-alias-border-l1);border-radius:10px;background:var(--dsw-alias-bg-layer-1)}.cm-footer-stack.simple>*{flex-shrink:0}.cm-footer-stack.simple:focus-visible{outline:2px solid var(--dsw-alias-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(--dsw-alias-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(--dsw-alias-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(--dsw-alias-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}}',Ft="dsh-cost-meter/client.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(Ft)+"]")===null){const t=document.createElement("style");t.dataset.plugin="dsh-cost-meter",t.dataset.pluginCss=Ft,t.textContent=qa,document.head.appendChild(t)}const Te={zh:{sessionCostTitle:"本会话费用(按每次调用实际时刻精确计费)",sessionDetailTokens:"输入 {input} · 缓存 {cache} · 输出 {output}",sessionDetailCache:"缓存:读 {read} · 写 {write}(写入按命中价计费)",cost:"费用 {amount}",sessionLine:"本会话 {amount} · 命中 {hitRate} · 输入 {input} · 缓存 {cache} · 输出 {output}",quotaUnlimited:"无限制",pricingCnyHint:"当前人民币金额来自美元价格 × 汇率 {rate}。对照官方人民币账单,请选择 CNY,再同步价格;同步会更新历史费用。",balanceQueryFailed:"余额查询失败:{message}",unknownError:"未知错误",balance:"余额",queryFailed:"查询失败",balanceTitle:"DeepSeek 开放平台账户余额",reconcileLabel:"官方余额变动与本地账本交叉对账(偏差超阈时提示)",totalBalance:"总余额 {amount}",grantedToppedUp:"赠送 {granted} · 充值 {toppedUp}",updatedAt:"更新时间 {time}",budgetOf:"预算({period})",usedOf:"已用 {used} / {amount}",todayShare:"今日 {amount} · 占预算 {pct}",monthTotal:"本月 {month} · 累计 {total}",budget:"预算",todayCostTitle:"今日费用(按官方价格精确计费)",todayTokensTitle:"今日 Token 用量",tokensUnit:"tokens",callsTokens:"调用 {calls} 次 · 输入 {input} · 缓存 {cache} · 输出 {output}",monthCost:"本月 {amount}",totalCost:"累计 {amount}",today:"今日",sidebarTodayMetric:"侧边栏今日显示",sidebarTodayCost:"费用",sidebarTodayTokens:"Token 用量",periodDay:"今日",periodMonth:"本月",periodAll:"累计",periodCustomRange:"自定义区间",noHistory:"暂无历史记录。开始对话后,费用将按天汇总在这里。",colDate:"日期",colCalls:"调用",colInTok:"输入 tok",colCacheTok:"缓存 tok",colOutTok:"输出 tok",colCost:"费用",noSessionsToday:"今日暂无会话记录。",colSession:"会话",enableBudget:"启用预算",budgetAmountLabel:"预算额度(按显示币种)",budgetPeriodLabel:"预算周期",startDate:"开始日期",endDate:"结束日期(留空 = 今日)",rangeText:"统计区间:{range}",budgetDisabledNote:"启用预算后显示额度、已用金额及比例(按显示币种换算);可选今日、本月、累计或自定义周期。",budgetStatus:"{period}预算 {amount} · 已用 {used} · {pct}%",overLimit:"(已超出)",nearLimit:"(接近上限)",legacyModel:"旧模型",defaultFallback:"默认回退",remove:"移除",tierBase:"基础",tierOffPeak:"谷时",tierPeak:"峰时",balanceRefreshFailed:"余额刷新失败:{message}",balanceLine:"总余额 {total} · 赠送 {granted} · 充值 {toppedUp} · 更新于 {time}",balanceQueryFailedHint:"余额查询失败:{message}(使用 设置→模型 中配置的 API Key)",balanceNotQueried:"未查询余额",accountBalance:"官方账户余额",refreshing:"刷新中…",refreshBalance:"刷新余额",customBalanceTitle:"自定义 Provider 余额",customBalanceAdd:"添加配置",aliyunBalanceAdd:"添加千问 / 阿里云余额",aliyunBalanceNote:"查询阿里云中国站可用金。RAM AccessKey 需 bss:DescribeBillingAccount 权限。前两项必填;STS 才需 Security Token。密钥存凭据库。",customBalanceConfigNote:"extract 支持点路径、数值和 add/subtract/divide 运算;NewApi quota 除以 500000 得到美元。",customBalanceLabelZh:"中文名称",customBalanceLabelEn:"英文名称",customBalanceUrl:"请求 URL",customBalanceMethod:"请求方法",customBalanceHeaders:"请求头 (JSON)",customBalanceBody:"请求体 (JSON)",customBalanceBodyNote:"留空不发送;JSON 原文保存并发送。默认 Content-Type 为 application/json,可在请求头覆盖。",customBalanceExtract:"解析规则 (JSON)",customBalanceDisplayLabel:"自定义余额显示位置",customBalanceRefreshInterval:"刷新间隔 (分钟)",customBalanceUnitLabel:"余额原币种",customBalanceConvert:"按显示币种折算(USD 余额)",customBalanceConvertNote:"使用显示汇率与精度;余额币种保持端点原币种。其他币种及积分不折算。",balanceBarRemaining:"余额 {amount}",balanceBarToday:"当日已用 {amount}",balanceBarSpent:"已用 {amount}",balanceShowProgressBar:"余额进度条 (蓝=余额,橙=当日,灰=已用)",barDirectionsTitle:"进度条方向",barDirectionsHint:"各组进度条可独立选择填充方向:「剩余方向」满条起步、随消耗递减;「已用方向」空条起步、随消耗填满。",barDirection_balance:"余额条(官方/自定义)",barDirection_budget:"预算条",barDirection_go:"Go 额度条",barDirection_plan:"Plan / Codex 额度条",barDirectionRemaining:"剩余方向(满 → 空)",barDirectionUsed:"已用方向(空 → 满)",balanceBudgetCapLabel:"额度上限 (可选)",balanceBudgetCapHint:"留空则优先使用 API 返回的 max_budget;仍无则显示整条浅蓝",customBalanceInvalidJson:"JSON 格式无效",customBalanceHeadersVarNote:"{{VAR_NAME}} 从凭据库或环境变量读取。<ROUTE>_API_KEY 中 ROUTE 为大写 Provider ID,符号改下划线,如 openai→OPENAI_API_KEY。同名共用密钥。",customBalanceAllowedHosts:"凭据白名单 (逗号分隔)",customBalanceAllowedHostsHint:"请求头带密钥时仅放行列表内主机,留空则放行并警告,防导入他人配置外带密钥。",customBalanceCredentialsTitle:"凭据输入",customBalanceCredentialsHint:"为上方 {{VAR}} 占位符存入密钥(write-only,只写凭据库,不回显):",customBalanceNoPlaceholders:'请求头还没有 {{VAR}} 占位符:填入如 "Authorization": "Bearer {{MY_API_KEY}}" 后这里会出现凭据输入框。',enable:"启用",customBalanceLine:"剩余 {remaining} · 已用 {spend} / 额度 {maxBudget} · 更新于 {time}",customBalanceRemaining:"剩余 {amount}",refreshCustomBalance:"刷新自定义余额",goQuotaTitle:"OpenCode Go 订阅额度",goQuotaRowLabel:"Go",goWindowRolling:"滚动 5 小时",goWindowWeekly:"本周",goWindowMonthly:"本月",goResetAt:"重置:{time}",resetReached:"已到重置时间",resetDays:"剩余 {d}天{h}小时",resetHours:"剩余 {h}小时{m}分",resetMinutes:"剩余 {m}分钟",quotaUsed:"已用 {pct}%",quotaRemaining:"剩余 {pct}%",goQuotaPercent:"{percent}%",goQuotaFetchedAt:"更新于 {time}",goQuotaDisplayLabel:"Go 额度显示位置",goQuotaRefreshIntervalLabel:"Go 额度刷新间隔(分钟)",goQuotaRefreshMinutesUnit:"分钟",goQuotaKeyLabel:"OpenCode Go API Key(可选,留空自动发现)",goMainLabel:"Go 额度主档位",goDetailLabel:"Go 图框详细信息",credentialConfiguredOf:"已配置(来源:{source})",credentialNotConfigured:"未配置",credentialSave:"保存",credentialClear:"清除",credentialSaving:"保存中…",credentialInputHint:"密钥只写入 DSH 凭据库,不保存在账本里,也不会回显。",secretMigrationPending:"以下密钥仍在本地账本,未迁入凭据库。请导出对应环境变量后重启:",budgetDetailLabel:"预算图框详细信息",refreshGoQuota:"刷新额度",goQuotaNotQueried:"未查询额度",codingPlanAnthropic:"Anthropic(Claude Pro/Max)",codingPlanZai:"Z.ai / 智谱 GLM Coding Plan",codingPlanMinimax:"MiniMax Token Plan",codingPlanMinimaxTitle:"MiniMax Plan",minimaxOrigin:"查询域名(HTTPS)",minimaxOriginNote:"留空自动选择官方站点。填写后 Key 仅发往该域名;使用可信地址,不含路径。",codingPlanRemain5h:"5h",codingPlanRemain7d:"7d",balanceRechargeLink:"打开 DeepSeek 充值页(platform.deepseek.com/usage)",codexQuotaTitle:"ChatGPT (Codex) 周额度",codexQuotaEnabled:"显示 Codex 额度(需安装并登录 dsh-openai-codex)",includeSubagentCost:"本会话费用包含子代理",gatewayQuotaEmpty:"暂无额度数据",codingPlanDisplayLabel:"显示位置",codingPlanDisplayNote:"选「主页面侧边栏 / 两者」后显示额度卡片;窄栏显示百分比。",codingPlanKeyLabel:"API Key(可选,留空自动发现)",codingPlanRefreshIntervalLabel:"刷新间隔(分钟)",refreshCodingPlan:"刷新",codingPlanNotQueried:"未查询额度",gatewayQuotaTitle:"CLIProxyAPI 网关额度",gatewaySourceAdd:"添加来源",gatewaySourceLabel:"来源名称",gatewaySourceBaseURL:"Base URL",gatewaySourceDisplay:"显示位置",gatewaySourceAllowlist:"允许的 Host",gatewaySourceCredential:"Management Key(只写)",gatewaySourceStatus:"状态",gatewaySourceUnsupported:"不支持的 Provider",gatewaySourceUnknown:"未知",gatewaySourceNoAccounts:"未发现账号",gatewaySourceFetchedAt:"抓取于 {time}",gatewaySwitchAccount:"切换账号 (当前: {account})",gatewayOnlyGemini:"只显示 Gemini 额度",refresh:"刷新",quotaEnableFirst:"先勾选启用这一项",quotaRefreshReady:"启用并保存显示位置后可刷新",quotaRemove:"删除",quotaSectionNote:"勾选启用后会排到最上面;点名称可展开该项自己的配置。自定义余额最多 8 条,网关来源最多 4 条。",codingPlanDisabledNote:"未启用。开启后将按刷新间隔查询该厂商的 coding plan 额度并显示在这里。",goQuotaDisabledNote:"开启后读取 OpenCode Go 的滚动 5 小时、周、月额度,显示在侧栏、设置页及右下角;无订阅时提示原因。",cornerLabel:"右下角显示(dock)",cornerEnabledLabel:"在右下角显示 OpenCode Go 额度 / 预算",cornerGoRolling:"滚动 5 小时额度",cornerGoWeekly:"本周额度",cornerGoMonthly:"本月额度",cornerBudget:"预算已用%",goShortRolling:"5h",goShortWeekly:"周",goShortMonthly:"月",goShortDaily:"日",budgetShort:"预算",ledgerReadFailed:"账本读取失败:{message}",readingLedger:"正在读取账本…",ledgerUnavailable:"账本不可用",syncFailed:"同步失败:{message}",historyCleared:"历史记录已清除。",clearFailed:"清除失败:{message}",peakOff:"峰谷计价已关闭,按基础价格计费",peakNotEffective:"尚未生效(生效时间:{time}),当前按基础价格计费",peakActive:"当前处于峰时段,按峰时价计费",peakNotice:"当前为 DeepSeek 峰时高价时段,按峰时价计费",offPeakActive:"当前处于谷时段,按谷时价计费",weekendAllOffPeak:"周末时段——全谷价(周六及周日全天按谷时价计费)",weekendChip:"周末时段——全谷价",weekendShort:"周末全谷",holidayAllOffPeak:"法定假日——全天谷价",holidayChip:"法定假日——全谷价",holidayShort:"假日",peakHolidaysLabel:"法定假日(北京日期,逗号分隔)",weekendRuleNote:"自 2026-08-23 北京时间 00:00 起,周末和中国公众假期全天谷价;调休上班的周末仍按谷价。",peakShort:"峰时",offPeakShort:"平价",peakStyleLabel:"峰谷时段条样式",peakStyleCompact:"简洁(单行紧凑)",peakStyleClassic:"经典(分段与胶囊芯片)",peakAlertLabel:"峰/谷切换前弹窗提醒",peakAlertAheadLabel:"提前提醒(分钟,1-30)",peakAlertTargetLabel:"提醒类型",peakAlertTargetPeak:"进入峰时",peakAlertTargetOffPeak:"进入谷时",peakAlertTargetBoth:"峰和谷",peakAlertTitlePeak:"即将进入峰时",peakAlertTitleOffPeak:"即将进入谷时",peakAlertBody:"约 {time} 后计费档位切换为{phase}价,请注意本时段调用成本。",peakAlertPhasePeak:"峰时",peakAlertPhaseOffPeak:"谷时",peakAlertBtn:"知道了",peakAlertBadgePeak:"峰价提醒",peakAlertBadgeOffPeak:"谷价提醒",peakAlertPositionLabel:"弹窗位置",peakAlertPositionCorner:"右下角",peakAlertPositionCenter:"屏幕中心",peakAlertWebNotifyLabel:"同步发送系统通知",peakAlertWebNotifyHint:"开关后请在浏览器地址栏允许通知权限,才能在页面最小化/切走时收到提醒。",peakAlertPreviewLabel:"预览弹窗",peakAlertPreviewPeak:"预览 进入峰",peakAlertPreviewOffPeak:"预览 进入谷",peakAlertPreviewTag:"(预览)",peakPanelTitle:"峰谷计价与提示",peakNoticeHiddenHint:"提示已隐藏:需启用峰谷计价并开启「峰时高价时段显著提示」。",groupGeneral:"常规",groupMoney:"金额与币种",groupSidebar:"侧边栏显示",sidebarSimple:"简化侧栏显示",sidebarSimpleNote:"精简卡片,保留金额、额度和悬停详情;高度最多占屏幕 38%,超出可滚动。关闭后恢复。",sidebarSimpleTitle:"试试更轻巧的侧栏",sidebarSimpleBody:"简化显示可以为会话列表留出更多空间。要现在开启吗?之后可在「设置 → 费用 → 显示」中切换。",sidebarSimpleOn:"开启简化显示",sidebarSimpleOff:"保留当前显示",sidebarSimpleError:"设置未能保存。可重试,或关闭提示后在设置中调整。",closeGuide:"关闭提示",todayBudget:"今日 / {period}预算",sidebarStyleLabel:"侧边栏进度条样式",sidebarStyleStandard:"标准",sidebarStyleCompact:"紧凑(两列)",restorePriceMatches:"恢复已移除的模型 ({count})",removePriceMatchHint:"移除会清除手动映射并隐藏此行,可恢复;不会删除用量记录,后续按自动匹配规则计价。",groupCorner:"右下角角标",groupDetail:"图框详细信息",catalogTitle:"拓展价格表",catalogNote:"按厂商和模型分类的参考价。挂载后可编辑并计费;DeepSeek 取消挂载后用默认价。",catalogOpen:"展开拓展价格表",catalogCollapse:"收起拓展价格表",mountBtn:"挂载",unmountBtn:"取消挂载",mountedTag:"已挂载",catalogUnpriced:"未核价",catalogDeepseekNote:"DeepSeek 取消挂载后按默认价计费。",modelStatsTitle:"按模型统计(token 与费用)",modelsTitle:"侧栏模型花费",modelsCount:"{n} 模型",modelsOther:"其它",models_enabled:"显示模型花费卡片",models_defaultOpen:"默认展开",models_remember:"记住展开状态",models_tokens:"显示 Token",models_shares:"显示费用占比条",models_dock:"右下角显示 Top-1 模型",models_period:"默认周期",models_summary:"收起摘要",models_position:"卡片位置",models_topN:"模型行数(1–10)",models_refreshSeconds:"刷新间隔(10–60 秒)",modelsTotal:"周期总额与模型数",modelsTop:"Top-1 模型与金额",modelsFirst:"顶部",modelsAfter:"余额之后",modelsLast:"底部",modelStatsToday:"今日",modelStatsHistory:"近 90 天",modelStatsCostH:"费用排行",modelStatsTokensH:"Token 消耗",modelStatsHitH:"缓存命中率",modelStatsHitUnreported:"未上报?",modelStatsHitUnreportedTip:"长调用无缓存命中:代理可能移除缓存字段。金额按全未命中计,是上界;可直连核对。",modelStatsValueH:"性价比 · 每美元 token 数",modelStatsInput:"输入",modelStatsCache:"缓存",modelStatsOutput:"输出",modelStatsEmpty:"该时段暂无用量数据。",modelStatsBlended:"综合单价 {price}/M",modelStatsNote:"命中率=缓存读÷(缓存读+普通输入);「未上报?」表示缓存字段可能缺失,金额为上界。单价=费用÷token×1M;性价比=token÷费用。",modelStatsLegacy:"未分模型(早期数据 · 按当时记录计费)",sessionLineSplit:"本会话 {amount}(API)· Plan 等值 {planAmount} · 命中 {hitRate} · 输入 {input} · 缓存 {cache} · 输出 {output}",costChipPlan:"费用 {amount}(+Plan)",sessionDetailPlan:"Plan 订阅额度消耗(等值){amount}",planStatsTitle:"Token Plan 用量统计(每 1% 与满窗估算)",planStatsEmpty:"尚无 Coding Plan 额度数据;请在「额度」页开启并刷新厂商。",planStatsWindow:"窗口",planStatsPercent:"已用 %",planStatsLocal:"本周期实际(本地账本)",planStatsPer1:"每 1% 额度 ≈",planStatsFull:"满窗 100% ≈",planStatsResets:"重置 {time}",planStatsMethodSample:"采样差分",planStatsMethodLive:"当前用量折算",planStatsMethodNone:"样本不足",planStatsMethodSampleAt:"{method}(基准 {time})",planStatsConfidenceLow:"读数精度受限",planStatsCurveTitle:"Plan 用量曲线(按采样区间聚合)",planStatsDaily:"每日",planStatsWeekly:"每周",planStatsMonthly:"每月",planStatsCurveEmpty:"采样不足:至少两次成功刷新,且额度百分比发生变化。",planStatsBarTip:"{date}:满窗估计 ≈ {full}(每 1% ≈ {per1})· 实际 {tokens} / {cost} · {intervals} 个采样区间",planStatsNote:"金额是目录价等值;订阅耗额度,预算只计 API。估算仅含 dsh 调用;服务端百分比含全账号。短时样本精度有限;5h 滚动,周/月按本地日历。",billingClassLabel:"计费方式",billingClassPlan:"Plan 订阅",billingClassAuto:"自动",billingClassApi:"API 按量",catalogDisplayLabel:"在费用设置直接显示",catalogDisplayHint:"仅控制是否在费用价格表直接显示;不影响挂载和计费。隐藏的已挂载模型仍可在拓展表编辑。",priceTableDisplayHint:"可逐模型切换显示位置。DeepSeek 默认直接显示,第三方默认在拓展表。",catalogCustomModels:"手动新增模型",priceMatchLabel:"未知模型名自动匹配",priceMatchAuto:"自动(去后缀 / 前缀 / 家族相似)",priceMatchExact:"仅精确匹配",priceMatchNote:"手动指定优先;自动匹配只接受同名及日期、版本、上下文后缀。未命中的 DeepSeek 用默认价,其他渠道不计价。",unmatchedTitle:"最近出现但未命中价格的模型",unmatchedHint:"这些模型没有价格。可手动指定;「默认价」使用 DeepSeek 默认价。本地推理默认零费用。",overrideTargetDefault:"DeepSeek 默认价",overrideRemove:"移除",overrideTargetLocal:"本地模型(零消耗)",matchedTitle:"本月已命中价格的模型",matchedHint:"这些模型自动匹配价格。可改选价格或零费用;token 仍统计。保存后移入手动指定区。",matchedKeepAuto:"保持自动命中",overrideNone:"暂无手动匹配覆盖。",mountedSuffix:"已挂载(参与计费)",flatInput:"输入",flatCached:"缓存",flatOutput:"输出",deepseekMountedHeader:"DeepSeek 价格表(已挂载)",codingPlanKimi:"Kimi / Moonshot",codingPlanOpenrouter:"OpenRouter",codingPlanSiliconflow:"SiliconFlow 硅基流动",codingPlanCommandcode:"CommandCode",codingPlanScnet:"SCNet 超算互联网 Token Plan",codingPlanVolcengine:"火山方舟 Volcano Ark Coding Plan",codingPlanQwen:"千问 Qwen Token Plan",codingPlanMimo:"小米 MiMo Token Plan",mimoWindowPlan:"套餐积分",mimoWindowCompensation:"补偿积分",codingPlanWindowBalance:"余额",qwenSource:"额度来源",qwenSourceLocal:"本地估算",qwenSourceCli:"官方 CLI",qwenSourceBailian:"百炼 CLI",qwenCliNote:"CLI 模式需在 DSH 主机安装 @qianwenai/qianwen-cli,并以同一系统账号运行 qianwen auth login。",qwenBailianNote:"百炼 CLI:在 DSH 主机安装 bailian-cli 并以同一系统账号运行 bl auth login --console。",qwenPlanCreditsLabel:"月度 Credits 额度(个人版 Lite 5 万 / 标准版 50 万,以订阅页为准)",qwenPlanStartLabel:"订阅起始日(可选,格式 YYYY-MM-DD;留空按自然月)",qwenRatesLabel:"Credits 抵扣率覆盖(可选;每百万 token 抵扣的 Credits,留空用内置表)",qwenRatesModelPlaceholder:"模型名,如 qwen3.8-max-preview",qwenRatePlaceholder:"费率",qwenRate_input:"输入",qwenRate_cachedInput:"缓存读",qwenRate_output:"输出",qwenRateDraftNote:"待填齐三项正数后自动保存;全部清空恢复内置表。",qwenRatesAdd:"添加",qwenLocalNote:"Credits 本地估算,以控制台为准。只计 qwen 及 qwen/qianwen-tokenplan 订阅渠道,含 llm- 前缀;不计按量 API。表外模型需设抵扣率。",scnetPlanCreditsLabel:"本地估算月度 Credits 额度(基础 60,000 / 标准 240,000 / 高级 600,000)",scnetPlanStartLabel:"订阅起始日(可选,格式 YYYY-MM-DD;留空按自然月)",scnetLocalNote:"优先用 24 小时内的控制台快照,否则按本地账本和官方 Credits 表估算。其他工具和表外模型不计入。",volcengineAccessKeyIdLabel:"火山引擎 AccessKey ID",volcengineSecretAccessKeyLabel:"火山引擎 SecretAccessKey",volcengineNote:"火山方舟需 AK/SK、ArkReadOnlyAccess 和 BillingCenterReadOnlyAccess;可填凭据或导出 VOLC_ACCESSKEY/VOLC_SECRETKEY。只连接 open.volcengineapi.com。",volcengineAccessKeyPlaceholder:"AK...",volcengineSecretPlaceholder:"SK...",countdownHoursOnly:"{h}小时",countdownHourMinute:"{h}小时{m}分",countdownMinute:"{m}分钟",nextOffPeakIn:"{time}后进入平价",nextPeakIn:"{time}后进入高峰",peakSummary:"峰时段(UTC):{windows};生效时间:{time}。{status}",noPeakWindows:"未配置峰谷时段。{status}",unknown:"未知",cardToday:"今日费用",cardMonth:"本月费用",cardTotal:"累计费用",cardTotalSub:"自账本建立以来 · 调用 {calls} 次",externalUsage:"外部用量",combinedUsage:"DSH + 外部合计",externalStale:"外部快照超过 24 小时未更新",externalHistory:"近期每日记录",cardsFootnote:"金额取最近快照,可能比官方账单晚几分钟。tokens 含输入、输出、缓存和推理;推理并入输出计费。以金额对账。",timezoneHint:"今日/本月按宿主时区 {host},浏览器为 {browser}。时区不同会影响日界和对账;可将 dsh 改为本地时区。",todaySessions:"今日会话",historyExpandHint:"点击日期行可展开当日会话明细",historySessionsLoading:"会话明细加载中…",historyNoSessions:"该日无会话明细(早期数据或会话日志已清理)",historySessionsError:"会话明细加载失败",sessionRankTitle:"按会话统计(全部历史)",sessionRankHint:"不按日期分组,全部历史会话;排序与条数可切换",sessionRankEmpty:"暂无会话数据",sessionRankLoading:"会话排行加载中…",sessionRankError:"会话排行加载失败",sessionRankLimit:"显示条数",showSessionIdLabel:"会话列表附显会话 ID",cardsTogglePlanTotal:"金额含 Plan 总额",cardsTogglePlanTotalHint:"开启后所有金额按含 Plan 订阅等值的总费用展示;关闭(默认)仅计真金白银 API 渠道",hideOfficialBalanceLabel:"隐藏官方账户余额(开启后侧边栏与设置页不再显示官方余额)",hideTodayCostLabel:"隐藏今日消耗金额(开启后侧边栏/预算明细/概览卡片不再显示今日费用)",sessionRankSort:"排序",sessionSortCostDesc:"费用 高→低",sessionSortCostAsc:"费用 低→高",sessionSortTimeDesc:"时间 新→旧",sessionSortTimeAsc:"时间 旧→新",sessionSortRecent:"实时顺序",history:"历史记录",usageTitle:"Token 用量统计",usageTotal:"累计 {tokens} tokens · 输入 {input} · 缓存 {cache} · 输出 {output} · {calls} 次调用",usageDay:"{date}:共 {tokens} tokens(输入 {input} · 缓存 {cache} · 输出 {output})· {calls} 次调用 · {cost}",usageEmpty:"暂无历史数据,开始对话后每日用量会汇总在这里",usageSectionLabel:"用量",usagePositionLabel:"Token 用量统计位置",usagePositionCost:"费用设置",usagePositionGeneral:"通用设置",usagePositionSection:"独立分节(用量)",displaySettings:"显示设置",tabOverview:"概览",tabQuotas:"额度",tabUsage:"用量",tabPricing:"价格",tabDisplay:"显示",historyDataTitle:"历史数据",positionLabel:"会话费用显示位置",positionDock:"输入区下方",positionHeader:"会话标题栏",off:"关闭",quotaStripGroup:"输入框上方额度横条",quotaStripEnable:"启用额度横条(输入框上方一条横排显示)",quotaStripShowBudget:"横条含预算已用%",quotaStripShowGo:"横条含 Go 额度",quotaStripShowPlans:"横条含 Coding Plan 额度",quotaStripNote:"横条悬停可见各窗口重置时刻与更新时间;无可用额度数据时自动隐藏。",quotaStripGuideTitle:"新增:输入框上方额度横条",quotaStripGuideBody:"在输入框上方显示预算及 OpenCode Go/Coding Plan 额度百分比。现在开启吗?可在「设置 → 显示设置」修改。",quotaStripGuideOn:"开启横条",quotaStripGuideOff:"暂不开启",clickToRefresh:"点击立即刷新",balanceClickGuideTitle:"新增:余额图框点击刷新",balanceClickGuideBody:"点击侧边栏余额或 Coding Plan 图框即可刷新;刷新时图框闪烁,失败时保留原值并在悬停提示中说明原因。",balanceClickGuideOk:"知道了",sidebarLabel:"当日费用显示",sidebarOn:"侧边栏底部",currencyLabel:"货币单位",currencyCny:"人民币 CNY",currencyUsd:"美元 USD",currencyEur:"欧元 EUR",symbolLabel:"货币符号",rateLabel:"汇率(1 美元 = ? 目标币种)",decimalsLabel:"小数位数",balanceDisplayLabel:"余额显示位置",balanceSidebar:"主页面侧边栏",balanceSettings:"设置页",balanceBoth:"两者都显示",refreshIntervalLabel:"余额刷新间隔(分钟)",peakEnabledLabel:"启用 DeepSeek 峰谷时段价格",peakNoticeLabel:"峰时高价时段显著提示(侧边栏预算框/今日费用;设置页峰谷面板内预览)",badgeNote:"会话按调用时价格计费(含峰谷与历史档位)。输入、输出、缓存读写分开统计;独立缓存写入价与长上下文档位按配置生效。",priceTableTitle:"价格表(美元 / 1M tokens)",pricingCurrencyLabel:"官方价格币种",pricingCurrencyUsd:"美元(英文官方页)",pricingCurrencyCny:"人民币(中文官方页)",pricingCurrencyNote:"决定同步价格所用的官方页语言。切换并同步后后台重算历史;日志不全的会话保留原价。完成后提示。",priceTableNote:"按调用时间计价:Flash 自 9 月 10 日北京 12:00 用新价,V4 Pro 自 9 月 14 日同刻用 Flash 价;此前用历史价。工作日 09–12、14–18 峰价翻倍;周末及中国公众假期全天谷价。缓存写入按命中价。",datedPriceNote:"这里显示当前适用价格。手工编辑会取消此条后续预定调价,已发生的历史价格仍保留。",defaultModelId:"default(未匹配模型时回退)",newModelPlaceholder:"新模型 ID(如 deepseek-v4-pro)",addModel:"添加模型",dataSync:"数据与同步",saving:"保存中…",autoSaveFailed:"自动保存失败:{message}",autoSavedAt:"已自动保存 {time}",autoSaveHint:"配置修改后自动保存",confirmFetch:"确认用官方文档价格覆盖价格表?",apply:"应用",cancel:"取消",syncFromDocs:"从官方文档同步价格",syncScopeNote:"官方同步只更新 DeepSeek 价格(含峰谷);z-ai/Kimi/Qwen/Volcano 等第三方价格随版本更新,也可在拓展价格表或模型名匹配中调整。",confirmReset:"确认清除全部历史?",importLegacy:"导入安装前历史",confirmImportLegacy:"确认导入?将回放全部会话日志,只补账本缺失的日期与会话,不影响已有记录。",legacyImportFailed:"导入安装前历史失败:{message}",legacyImportNote:"首次启动自动导入旧记录;拷入日志后可重跑。按当前价格回推;已删除日志无法回放,跨安装时刻的会话不计此前用量。",confirmClear:"确认清除",clearAllHistory:"清除全部历史",lastSync:"最近同步:{time}",neverSynced:"从未(使用内置价格)",source:";来源:{source}",sourceOfficial:"官方文档",sourceBundled:"内置默认",languageLabel:"界面语言",localeAuto:"跟随浏览器(自动)",localeZh:"简体中文",localeEn:"English",sectionLabel:"费用",rpcFailed:"{method} 调用失败",rpcSyncFailed:"同步调用失败",rpcBalanceFailed:"余额刷新调用失败"},en:{sessionCostTitle:"Cost of this session (billed exactly at each call time)",sessionDetailTokens:"Input {input} · Cache {cache} · Output {output}",sessionDetailCache:"Cache: read {read} · write {write} (writes billed at the hit price)",cost:"Cost {amount}",sessionLine:"This session {amount} · Hit {hitRate} · Input {input} · Cache {cache} · Output {output}",quotaUnlimited:"Unlimited",pricingCnyHint:"CNY totals use USD prices × {rate}. To compare official CNY bills, select CNY, then sync prices; syncing also updates historical costs.",balanceQueryFailed:"Balance query failed: {message}",unknownError:"Unknown error",balance:"Balance",queryFailed:"Query failed",balanceTitle:"DeepSeek open-platform account balance",reconcileLabel:"Cross-check official balance changes against the local ledger (warn when they diverge)",totalBalance:"Total {amount}",grantedToppedUp:"Granted {granted} · Topped-up {toppedUp}",updatedAt:"Updated {time}",budgetOf:"Budget ({period})",usedOf:"Used {used} / {amount}",todayShare:"Today {amount} · {pct} of budget",monthTotal:"This month {month} · All time {total}",budget:"Budget",todayCostTitle:"Today's cost (billed exactly at official prices)",todayTokensTitle:"Today's token usage",tokensUnit:"tokens",callsTokens:"Calls {calls} · Input {input} · Cache {cache} · Output {output}",monthCost:"This month {amount}",totalCost:"All time {amount}",today:"Today",sidebarTodayMetric:"Sidebar today display",sidebarTodayCost:"Cost",sidebarTodayTokens:"Token usage",periodDay:"Today",periodMonth:"This month",periodAll:"All time",periodCustomRange:"Custom range",noHistory:"No history yet. Once you start chatting, costs are aggregated here per day.",colDate:"Date",colCalls:"Calls",colInTok:"In tok",colCacheTok:"Cache tok",colOutTok:"Out tok",colCost:"Cost",noSessionsToday:"No sessions recorded today.",colSession:"Session",enableBudget:"Enable budget",budgetAmountLabel:"Budget amount (in display currency)",budgetPeriodLabel:"Budget period",startDate:"Start date",endDate:"End date (empty = today)",rangeText:"Range: {range}",budgetDisabledNote:"Enable a budget to see its limit, used amount and percentage in the display currency. Choose today, month, all time or a custom range.",budgetStatus:"{period} budget {amount} · Used {used} · {pct}%",overLimit:" (over limit)",nearLimit:" (near limit)",legacyModel:"Legacy",defaultFallback:"Default fallback",remove:"Remove",tierBase:"Base",tierOffPeak:"Off-peak",tierPeak:"Peak",balanceRefreshFailed:"Balance refresh failed: {message}",balanceLine:"Total {total} · Granted {granted} · Topped-up {toppedUp} · Updated {time}",balanceQueryFailedHint:"Balance query failed: {message} (uses the API key configured in Settings → Models)",balanceNotQueried:"Balance not queried",accountBalance:"Account balance",refreshing:"Refreshing…",refreshBalance:"Refresh balance",customBalanceTitle:"Custom provider balance",customBalanceAdd:"Add entry",aliyunBalanceAdd:"Add Qianwen / Alibaba Cloud balance",aliyunBalanceNote:"Shows Alibaba Cloud China funds. RAM AccessKey needs bss:DescribeBillingAccount. The first two fields are required; Security Token is for STS. Secrets stay in the credential store.",customBalanceConfigNote:"Extract accepts paths, numbers and add/subtract/divide. Divide NewApi quota by 500000 for USD.",customBalanceLabelZh:"Chinese name",customBalanceLabelEn:"English name",customBalanceUrl:"Request URL",customBalanceMethod:"HTTP method",customBalanceHeaders:"Headers (JSON)",customBalanceBody:"Request body (JSON)",customBalanceBodyNote:"Blank sends no body; JSON text is saved and sent as entered. Content-Type defaults to application/json; headers can override it.",customBalanceExtract:"Extract rules (JSON)",customBalanceDisplayLabel:"Custom balance display",customBalanceRefreshInterval:"Refresh interval (minutes)",customBalanceUnitLabel:"Source currency",customBalanceConvert:"Convert USD balance to display currency",customBalanceConvertNote:"Uses the display rate and precision. Keep the source currency; other currencies and credits stay unchanged.",balanceBarRemaining:"Balance {amount}",balanceBarToday:"Today {amount}",balanceBarSpent:"Spent {amount}",balanceShowProgressBar:"Balance progress bar (blue=balance, orange=today, gray=spent)",barDirectionsTitle:"Progress bar direction",barDirectionsHint:'Each group of bars can independently choose its fill direction: "Remaining" starts full and drains with usage; "Used" starts empty and fills up.',barDirection_balance:"Balance bars (official/custom)",barDirection_budget:"Budget bar",barDirection_go:"Go quota bar",barDirection_plan:"Plan / Codex quota bars",barDirectionRemaining:"Remaining (full → empty)",barDirectionUsed:"Used (empty → full)",balanceBudgetCapLabel:"Budget cap (optional)",balanceBudgetCapHint:"Leave empty to use API max_budget; if still missing, show full light-blue bar",customBalanceInvalidJson:"Invalid JSON",customBalanceHeadersVarNote:"{{VAR_NAME}} reads a credential or environment variable. <ROUTE>_API_KEY uses an uppercase Provider ID with underscores, such as openai→OPENAI_API_KEY. Names can share a key.",customBalanceAllowedHosts:"Allowed hosts (comma-separated)",customBalanceAllowedHostsHint:"When headers carry credentials only listed hosts are allowed; leave empty to allow with a warning. Protects keys when importing someone else's config.",customBalanceCredentialsTitle:"Credential input",customBalanceCredentialsHint:"Store the key for each {{VAR}} placeholder above (write-only: stored in the DSH credential store, never echoed back):",customBalanceNoPlaceholders:'No {{VAR}} placeholders in the headers yet — add e.g. "Authorization": "Bearer {{MY_API_KEY}}" and a credential input will appear here.',enable:"Enable",customBalanceLine:"Remaining {remaining} · Spent {spend} / Budget {maxBudget} · Updated {time}",customBalanceRemaining:"Remaining {amount}",refreshCustomBalance:"Refresh custom balance",goQuotaTitle:"OpenCode Go subscription quota",goQuotaRowLabel:"Go",goWindowRolling:"Rolling 5h",goWindowWeekly:"Weekly",goWindowMonthly:"Monthly",goResetAt:"Resets: {time}",resetReached:"Reset time reached",resetDays:"{d}d {h}h left",resetHours:"{h}h {m}m left",resetMinutes:"{m}m left",quotaUsed:"{pct}% used",quotaRemaining:"{pct}% remaining",goQuotaPercent:"{percent}%",goQuotaFetchedAt:"Updated {time}",goQuotaDisplayLabel:"Go quota display position",goQuotaRefreshIntervalLabel:"Go quota refresh interval (minutes)",goQuotaRefreshMinutesUnit:"min",goQuotaKeyLabel:"OpenCode Go API key (optional; empty = auto-detect)",goMainLabel:"Go quota primary window",goDetailLabel:"Go box details",credentialConfiguredOf:"Configured (source: {source})",credentialNotConfigured:"Not configured",credentialSave:"Save",credentialClear:"Clear",credentialSaving:"Saving…",credentialInputHint:"The key is written to the DSH credential store only — it is never saved in the ledger and never echoed back.",secretMigrationPending:"These credentials remain in the local ledger. Export the matching environment variables and restart:",budgetDetailLabel:"Budget box details",refreshGoQuota:"Refresh quota",goQuotaNotQueried:"Quota not queried",codingPlanAnthropic:"Anthropic (Claude Pro/Max)",codingPlanZai:"Z.ai / Zhipu GLM Coding Plan",codingPlanMinimax:"MiniMax Token Plan",codingPlanMinimaxTitle:"MiniMax Plan",minimaxOrigin:"Quota origin (HTTPS)",minimaxOriginNote:"Empty: official sites. Otherwise the Key is sent only to this origin. Use a trusted address without a path.",codingPlanRemain5h:"5h",codingPlanRemain7d:"7d",balanceRechargeLink:"Open DeepSeek top-up page (platform.deepseek.com/usage)",codexQuotaTitle:"ChatGPT (Codex) weekly quota",codexQuotaEnabled:"Show Codex quota (requires signed-in dsh-openai-codex)",includeSubagentCost:"Include subagents in session cost",gatewayQuotaEmpty:"No quota data",codingPlanDisplayLabel:"Display position",codingPlanDisplayNote:"“Main sidebar / Both” shows a quota card; the narrow rail shows percentages.",codingPlanKeyLabel:"API key (optional; empty = auto-detect)",codingPlanRefreshIntervalLabel:"Refresh interval (minutes)",refreshCodingPlan:"Refresh",codingPlanNotQueried:"Quota not queried",gatewayQuotaTitle:"CLIProxyAPI gateway quotas",gatewaySourceAdd:"Add source",gatewaySourceLabel:"Source label",gatewaySourceBaseURL:"Base URL",gatewaySourceDisplay:"Display",gatewaySourceAllowlist:"Allowed hosts",gatewaySourceCredential:"Management key (write-only)",gatewaySourceStatus:"Status",gatewaySourceUnsupported:"Unsupported providers",gatewaySourceUnknown:"Unknown",gatewaySourceNoAccounts:"No accounts",gatewaySourceFetchedAt:"fetched {time}",gatewaySwitchAccount:"Switch account (current: {account})",gatewayOnlyGemini:"Gemini quota only",refresh:"Refresh",quotaEnableFirst:"Enable this item first",quotaRefreshReady:"Enable and save a display position to refresh",quotaRemove:"Remove",quotaSectionNote:"Enabled items move to the top; click a name to expand its own settings. Up to 8 custom balances and 4 gateway sources.",codingPlanDisabledNote:"Disabled. Enable it to query this vendor's coding plan quota on the refresh interval and show it here.",goQuotaDisabledNote:"Enable OpenCode Go rolling 5h, weekly and monthly quotas in the sidebar, Settings and bottom-right corner. Missing subscriptions show a reason.",cornerLabel:"Bottom-right (dock) display",cornerEnabledLabel:"Show OpenCode Go quota / budget at the bottom-right",cornerGoRolling:"Rolling-5h quota",cornerGoWeekly:"Weekly quota",cornerGoMonthly:"Monthly quota",cornerBudget:"Budget used %",goShortRolling:"5h",goShortWeekly:"Wk",goShortMonthly:"Mo",goShortDaily:"Daily",budgetShort:"Budget",ledgerReadFailed:"Ledger read failed: {message}",readingLedger:"Reading ledger…",ledgerUnavailable:"Ledger unavailable",syncFailed:"Sync failed: {message}",historyCleared:"History cleared.",clearFailed:"Clear failed: {message}",peakOff:"Peak/off-peak pricing is off; base prices are used",peakNotEffective:"Not yet effective (effective at {time}); base prices are currently used",peakActive:"Peak hour now; peak prices apply",peakNotice:"DeepSeek peak-hour pricing is active; current calls are billed at peak prices",offPeakActive:"Off-peak now; off-peak prices apply",weekendAllOffPeak:"Weekend — all off-peak (Sat & Sun billed at off-peak prices all day)",weekendChip:"Weekend — all off-peak",weekendShort:"Weekend",holidayAllOffPeak:"Chinese public holiday — off-peak all day",holidayChip:"Public holiday — all off-peak",holidayShort:"Holiday",peakHolidaysLabel:"Public holidays (Beijing dates, comma separated)",weekendRuleNote:"Since Aug 23, 2026 (Beijing time), weekends and Chinese public holidays are off-peak all day, including work-shift weekends.",peakShort:"Peak",offPeakShort:"Off-peak",peakStyleLabel:"Peak period strip style",peakStyleCompact:"Compact (one-line)",peakStyleClassic:"Classic (segments & chip)",peakAlertLabel:"Popup alert before peak/off-peak switch",peakAlertAheadLabel:"Lead time (minutes, 1-30)",peakAlertTargetLabel:"Alert type",peakAlertTargetPeak:"Entering peak",peakAlertTargetOffPeak:"Entering off-peak",peakAlertTargetBoth:"Both",peakAlertTitlePeak:"Entering peak hours soon",peakAlertTitleOffPeak:"Entering off-peak hours soon",peakAlertBody:"Billing switches to {phase} pricing in about {time}; mind your call costs in this window.",peakAlertPhasePeak:"peak",peakAlertPhaseOffPeak:"off-peak",peakAlertBtn:"Got it",peakAlertBadgePeak:"Peak alert",peakAlertBadgeOffPeak:"Off-peak alert",peakAlertPositionLabel:"Popup position",peakAlertPositionCorner:"Bottom-right",peakAlertPositionCenter:"Screen center",peakAlertWebNotifyLabel:"Also send a system notification",peakAlertWebNotifyHint:"When enabled, allow notification permission in the browser address bar so you get alerted even when the page is minimized or backgrounded.",peakAlertPreviewLabel:"Preview the popup",peakAlertPreviewPeak:"Preview entering peak",peakAlertPreviewOffPeak:"Preview entering off-peak",peakAlertPreviewTag:" (preview)",peakPanelTitle:"Peak/off-peak pricing & notice",peakNoticeHiddenHint:"Notice hidden: enable peak/off-peak pricing and the “prominent notice” toggle.",groupGeneral:"General",groupMoney:"Money & currency",groupSidebar:"Sidebar display",sidebarSimple:"Simplify the sidebar",sidebarSimpleNote:"Condense cards but keep amounts, quotas and hover details. Height is capped at 38% of the viewport with scrolling. Turn off to restore.",sidebarSimpleTitle:"A lighter sidebar",sidebarSimpleBody:"Simple display leaves more room for conversations. Enable it now? You can change it in Settings → Cost → Display anytime.",sidebarSimpleOn:"Enable simple display",sidebarSimpleOff:"Keep current display",sidebarSimpleError:"Settings could not be saved. Retry or dismiss this guide and change them later in Settings.",closeGuide:"Dismiss guide",todayBudget:"Today / {period} budget",sidebarStyleLabel:"Sidebar progress style",sidebarStyleStandard:"Standard",sidebarStyleCompact:"Compact (2 columns)",restorePriceMatches:"Restore removed models ({count})",removePriceMatchHint:"Remove clears the override and hides the row until restored. Usage records are kept; automatic price matching applies.",groupCorner:"Corner chips",groupDetail:"Box details",catalogTitle:"Extended price catalog",catalogNote:"Reference prices by vendor and model. Mount to edit and bill; unmounted DeepSeek uses its default price.",catalogOpen:"Expand extended price catalog",catalogCollapse:"Collapse extended price catalog",mountBtn:"Mount",unmountBtn:"Unmount",mountedTag:"Mounted",catalogUnpriced:"Unpriced",catalogDeepseekNote:"Unmounted DeepSeek models use the default price.",modelStatsTitle:"Per-model statistics (tokens & cost)",modelsTitle:"Sidebar model costs",modelsCount:"{n} models",modelsOther:"Other",models_enabled:"Show model cost card",models_defaultOpen:"Expand by default",models_remember:"Remember expansion",models_tokens:"Show tokens",models_shares:"Show cost shares",models_dock:"Top model in corner dock",models_period:"Default period",models_summary:"Collapsed summary",models_position:"Card position",models_topN:"Model rows (1–10)",models_refreshSeconds:"Refresh interval (10–60 seconds)",modelsTotal:"Period total and model count",modelsTop:"Top model and cost",modelsFirst:"Top",modelsAfter:"After balances",modelsLast:"Bottom",modelStatsToday:"Today",modelStatsHistory:"Last 90 days",modelStatsCostH:"Cost ranking",modelStatsTokensH:"Token usage",modelStatsHitH:"Cache hit rate",modelStatsHitUnreported:"unreported?",modelStatsHitUnreportedTip:"Zero cache hits on long calls may mean a relay removed cache fields. All-miss cost is an upper bound; check with the direct API.",modelStatsValueH:"Value · tokens per USD",modelStatsInput:"Input",modelStatsCache:"Cache",modelStatsOutput:"Output",modelStatsEmpty:"No usage data for this period.",modelStatsBlended:"blended {price}/M",modelStatsNote:"Hit rate = cache reads ÷ (reads + uncached input). “Unreported?” means cache data may be missing, so cost is an upper bound. Unit price = cost ÷ tokens × 1M; value = tokens ÷ cost.",billingClassLabel:"Billing class",billingClassPlan:"Plan subscription",billingClassAuto:"Auto",billingClassApi:"API usage",modelStatsLegacy:"Unattributed (early data · billed as recorded)",sessionLineSplit:"This session {amount} (API) · Plan equiv. {planAmount} · Hit {hitRate} · Input {input} · Cache {cache} · Output {output}",costChipPlan:"Cost {amount} (+Plan)",sessionDetailPlan:"Plan subscription quota usage (equiv.) {amount}",planStatsTitle:"Token Plan usage stats (per-1% & full-window estimates)",planStatsEmpty:"No Coding Plan quota data yet. Enable and refresh a provider under Quotas.",planStatsWindow:"Window",planStatsPercent:"Used %",planStatsLocal:"This period actual (local ledger)",planStatsPer1:"Per 1% quota ≈",planStatsFull:"Full window (100%) ≈",planStatsResets:"resets {time}",planStatsMethodSample:"sample delta",planStatsMethodLive:"current usage ratio",planStatsMethodNone:"not enough samples",planStatsMethodSampleAt:"{method} (as of {time})",planStatsConfidenceLow:"low reading precision",planStatsCurveTitle:"Plan usage curves (aggregated from sample intervals)",planStatsDaily:"Daily",planStatsWeekly:"Weekly",planStatsMonthly:"Monthly",planStatsCurveEmpty:"Not enough samples: refresh successfully twice with a quota percentage change.",planStatsBarTip:"{date}: full-window est. ≈ {full} (per 1% ≈ {per1}) · actual {tokens} / {cost} · {intervals} sample interval(s)",planStatsNote:"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/month use local dates.",catalogDisplayLabel:"Show directly in Cost settings",catalogDisplayHint:"Controls direct display in Cost settings; mounting and billing stay unchanged. Hidden models remain editable in this catalog.",priceTableDisplayHint:"Choose where each model appears. DeepSeek shows directly; other vendors default to the catalog.",catalogCustomModels:"Custom models",priceMatchLabel:"Auto-match unknown model names",priceMatchAuto:"Auto (strip suffix / prefix / family similarity)",priceMatchExact:"Exact match only",priceMatchNote:"Manual overrides take priority. Auto-match accepts only the same name or date, version and context suffixes. Unknown DeepSeek models use the default price; other providers stay unpriced.",unmatchedTitle:"Recently seen models without a price hit",unmatchedHint:"These models have no price. Assign one manually; “Default price” uses DeepSeek defaults. Local inference costs zero until assigned.",overrideTargetDefault:"DeepSeek default price",overrideRemove:"Remove",overrideTargetLocal:"Local model (zero cost)",matchedTitle:"Models matched this month",matchedHint:"These models matched automatically. Choose another price or zero cost; tokens still count. Saved overrides move to the manual list.",matchedKeepAuto:"Keep auto match",overrideNone:"No manual match overrides.",mountedSuffix:"Mounted (billed)",flatInput:"Input",flatCached:"Cached",flatOutput:"Output",deepseekMountedHeader:"DeepSeek price table (mounted)",codingPlanKimi:"Kimi / Moonshot",codingPlanOpenrouter:"OpenRouter",codingPlanSiliconflow:"SiliconFlow",codingPlanCommandcode:"CommandCode",codingPlanScnet:"SCNet Token Plan",codingPlanVolcengine:"Volcano Ark Coding Plan",codingPlanQwen:"Qwen Token Plan (qianwenai.com)",codingPlanMimo:"Xiaomi MiMo Token Plan",mimoWindowPlan:"Plan credits",mimoWindowCompensation:"Compensation",codingPlanWindowBalance:"Balance",qwenSource:"Quota source",qwenSourceLocal:"Local estimate",qwenSourceCli:"Official CLI",qwenSourceBailian:"Bailian CLI",qwenCliNote:"Install @qianwenai/qianwen-cli on the DSH host and run qianwen auth login as the same OS user.",qwenBailianNote:"Bailian CLI: install bailian-cli on the DSH host and run bl auth login --console as the same OS user.",qwenPlanCreditsLabel:"Monthly credits quota (personal Lite 50K / Standard 500K; see your plan page)",qwenPlanStartLabel:"Plan start date (optional, YYYY-MM-DD; empty = calendar month)",qwenRatesLabel:"Credits rate overrides (optional; credits deducted per 1M tokens; empty = built-in table)",qwenRatesModelPlaceholder:"Model name, e.g. qwen3.8-max-preview",qwenRatePlaceholder:"rate",qwenRate_input:"Input",qwenRate_cachedInput:"Cached input",qwenRate_output:"Output",qwenRateDraftNote:"Enter all three positive rates to save automatically; clear all to restore the built-in table.",qwenRatesAdd:"Add",qwenLocalNote:"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.",scnetPlanCreditsLabel:"Monthly credits quota for local estimates (Basic 60,000 / Standard 240,000 / Pro 600,000)",scnetPlanStartLabel:"Plan start date (optional, YYYY-MM-DD; empty = calendar month)",scnetLocalNote:"Uses console snapshots newer than 24h, then estimates from local records and official Credits rates. Other tools and unlisted models are excluded.",volcengineAccessKeyIdLabel:"Volcengine AccessKey ID",volcengineSecretAccessKeyLabel:"Volcengine SecretAccessKey",volcengineNote:"Volcano Ark needs AK/SK, ArkReadOnlyAccess and BillingCenterReadOnlyAccess. Enter credentials or export VOLC_ACCESSKEY/VOLC_SECRETKEY. Only open.volcengineapi.com is contacted.",volcengineAccessKeyPlaceholder:"AK...",volcengineSecretPlaceholder:"SK...",countdownHoursOnly:"{h}h",countdownHourMinute:"{h}h {m}m",countdownMinute:"{m}m",nextOffPeakIn:"Off-peak in {time}",nextPeakIn:"Peak in {time}",peakSummary:"Peak hours (UTC): {windows}; effective: {time}. {status}",noPeakWindows:"No peak windows configured. {status}",unknown:"unknown",cardToday:"Today",cardMonth:"This month",cardTotal:"All time",cardTotalSub:"Since the ledger was created · Calls {calls}",externalUsage:"External usage",combinedUsage:"DSH + external total",externalStale:"External snapshot has not been updated for 24 hours",externalHistory:"Recent daily records",cardsFootnote:"Amounts use the latest snapshot and may lag the official bill by minutes. Tokens include input, output, cache and reasoning; reasoning is billed with output. Reconcile by amount.",timezoneHint:"Today/month use host timezone {host}; this browser uses {browser}. Different day boundaries affect reconciliation. Set dsh to your local timezone to align.",todaySessions:"Today's sessions",historyExpandHint:"Click a date row to expand its session details",historySessionsLoading:"Loading session details…",historyNoSessions:"No session details for this day (early data or session logs cleaned)",historySessionsError:"Failed to load session details",sessionRankTitle:"By session (all history)",sessionRankHint:"All historical sessions, not grouped by date; sort and row count are switchable",sessionRankEmpty:"No session data yet",sessionRankLoading:"Loading session ranking…",sessionRankError:"Failed to load session ranking",sessionRankLimit:"Rows",showSessionIdLabel:"Show session IDs in session lists",cardsTogglePlanTotal:"Include plan totals",cardsTogglePlanTotalHint:"When on, every amount shows total equivalent cost including plan subscriptions; off (default) counts real-money API channels only",hideOfficialBalanceLabel:"Hide official account balance (balance UI removed from sidebar and settings)",hideTodayCostLabel:"Hide today's cost (today's amount removed from sidebar, budget details and overview card)",sessionRankSort:"Sort",sessionSortCostDesc:"Cost high→low",sessionSortCostAsc:"Cost low→high",sessionSortTimeDesc:"Time new→old",sessionSortTimeAsc:"Time old→new",sessionSortRecent:"Recent order",history:"History",usageTitle:"Token usage stats",usageTotal:"All-time {tokens} tokens · input {input} · cache {cache} · output {output} · {calls} calls",usageDay:"{date}: {tokens} tokens (input {input} · cache {cache} · output {output}) · {calls} calls · {cost}",usageEmpty:"No history yet — daily usage will accumulate here",usageSectionLabel:"Usage",usagePositionLabel:"Token usage stats position",usagePositionCost:"Cost settings",usagePositionGeneral:"General settings",usagePositionSection:"Own section (Usage)",displaySettings:"Display settings",tabOverview:"Overview",tabQuotas:"Quotas",tabUsage:"Usage",tabPricing:"Pricing",tabDisplay:"Display",historyDataTitle:"History data",positionLabel:"Session cost display position",positionDock:"Below the composer",positionHeader:"Session title bar",off:"Off",quotaStripGroup:"Quota strip above the input",quotaStripEnable:"Enable the quota strip (one row above the input box)",quotaStripShowBudget:"Strip includes budget used %",quotaStripShowGo:"Strip includes the Go quota",quotaStripShowPlans:"Strip includes coding plan quotas",quotaStripNote:"Hover a chip for reset times and the last refresh; the strip hides itself when there is no quota data.",quotaStripGuideTitle:"New: quota strip above the input",quotaStripGuideBody:"Show budget and OpenCode Go/coding-plan percentages above the input box. Enable now? Change it anytime in Settings → Display.",quotaStripGuideOn:"Enable the strip",quotaStripGuideOff:"Not now",clickToRefresh:"Click to refresh now",balanceClickGuideTitle:"New: click the balance box to refresh",balanceClickGuideBody:"Click a sidebar balance or plan box to refresh. It pulses while loading; on failure it keeps the old value and shows the reason on hover.",balanceClickGuideOk:"Got it",sidebarLabel:"Today cost display",sidebarOn:"Sidebar footer",currencyLabel:"Currency",currencyCny:"Chinese Yuan (CNY)",currencyUsd:"US Dollar (USD)",currencyEur:"Euro (EUR)",symbolLabel:"Currency symbol",rateLabel:"Exchange rate (1 USD = ? target currency)",decimalsLabel:"Decimal places",balanceDisplayLabel:"Balance display position",balanceSidebar:"Main sidebar",balanceSettings:"Settings page",balanceBoth:"Both",refreshIntervalLabel:"Balance refresh interval (minutes)",peakEnabledLabel:"Use DeepSeek peak-hour prices",peakNoticeLabel:"Prominent notice during peak hours (sidebar budget box, today's cost; previewed in the Settings peak panel)",badgeNote:"Session cost uses call-time prices, including peak and historical rates. Input, output, cache reads and writes are separate; configured cache-write and long-context rates apply.",priceTableTitle:"Price table (USD / 1M tokens)",pricingCurrencyLabel:"Official price currency",pricingCurrencyUsd:"USD (English official page)",pricingCurrencyCny:"CNY (Chinese official page)",pricingCurrencyNote:"Selects the official pricing-page language. Sync then recalculates history in the background; sessions without full logs keep their earlier basis.",priceTableNote:"Call-time prices: Flash changes Sep 10 04:00 UTC; V4 Pro uses Flash prices from Sep 14 04:00 UTC. Earlier calls retain history. Mon–Fri peaks 01–04 and 06–10 UTC cost 2×; weekends and Chinese public holidays are off-peak. Cache writes use hit rates.",datedPriceNote:"Current rates are shown here. Editing cancels any future scheduled change for this entry; earlier historical rates are retained.",defaultModelId:"default (fallback for unmatched models)",newModelPlaceholder:"New model ID (e.g. deepseek-v4-pro)",addModel:"Add model",dataSync:"Data & sync",saving:"Saving…",autoSaveFailed:"Auto-save failed: {message}",autoSavedAt:"Auto-saved {time}",autoSaveHint:"Settings are auto-saved",confirmFetch:"Overwrite the price table with prices from the official docs?",apply:"Apply",cancel:"Cancel",syncFromDocs:"Sync prices from official docs",syncScopeNote:"Official sync updates DeepSeek prices (including peak rates). Third-party prices (z-ai/Kimi/Qwen/Volcano) follow releases; edit in the extended catalog or model matching.",confirmReset:"Clear all history?",importLegacy:"Import pre-install history",confirmImportLegacy:"Confirm import? Replays all session logs and only fills dates/sessions missing from the ledger; existing records are untouched.",legacyImportFailed:"Failed to import pre-install history: {message}",legacyImportNote:"Pre-install history imports at first launch; rerun after copying old logs. Costs use current prices. Deleted logs cannot replay; sessions spanning installation exclude earlier usage.",confirmClear:"Confirm clear",clearAllHistory:"Clear all history",lastSync:"Last sync: {time}",neverSynced:"Never (bundled prices)",source:"; Source: {source}",sourceOfficial:"Official docs",sourceBundled:"Bundled",languageLabel:"Language",localeAuto:"Follow browser (auto)",localeZh:"Simplified Chinese",localeEn:"English",sectionLabel:"Cost",rpcFailed:"{method} call failed",rpcSyncFailed:"Sync call failed",rpcBalanceFailed:"Balance refresh call failed"}};function Ua(){return(typeof navigator<"u"&&typeof navigator.language=="string"?navigator.language:"").toLowerCase().startsWith("zh")?"zh":"en"}function _(t){return t==="zh"||t==="en"?t:Ua()}function K(t){const s=t==="zh"?Te.zh:Te.en;return(o,a)=>{let n=s[o]??Te.en[o]??o;if(a)for(const l of Object.keys(a))n=n.split("{"+l+"}").join(String(a[l]));return n}}const qe={day:"periodDay",month:"periodMonth",all:"periodAll",custom:"periodCustomRange"};function re(t,s){throw new Error("dsh-cost-meter: 服务端数据非法 ("+t+": "+s+")")}function be(t,s){return(t===null||typeof t!="object"||Array.isArray(t))&&re(s,"object"),t}function ce(t,s){return(typeof t!="number"||!Number.isFinite(t))&&re(s,"number"),t}function Ne(t,s){return typeof t!="string"&&re(s,"string"),t}const Ke=(t,s,o)=>typeof t=="string"&&s.includes(t)?t:o;function _t(t,s=!1){return t===null||typeof t!="object"||Array.isArray(t)?{}:Object.fromEntries(Object.entries(t).filter(([o,a])=>s?o.length>0&&["plan","api"].includes(a):["auto","plan","api"].includes(a)))}function Wt(t,s){return typeof t!="boolean"&&re(s,"boolean"),t}const Ye=(t,s,o)=>Object.fromEntries(s.map(a=>[a,o(t[a])]));function zt(t,s){const o={};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=i=>typeof i=="number"&&Number.isFinite(i)&&i>=0?i:0;o[a]={...Ye(n,["input","output","cacheRead","cacheWrite","reasoning","cost"],l),apiCost:n.apiCost===void 0?l(n.cost):l(n.apiCost)}}return o}function Gt(t,s){be(t,s);const o={reasoning:t.reasoning===void 0?0:ce(t.reasoning,s+".reasoning"),apiCost:t.apiCost===void 0?void 0:ce(t.apiCost,s+".apiCost"),byModel:zt(t.byModel,s+".byModel"),byProviderModel:zt(t.byProviderModel,s+".byProviderModel")};for(const a of["input","output","cacheRead","cacheWrite","calls","cost"])o[a]=ce(t[a],s+"."+a);return o}function ct(t,s){return{...Gt(t,s),id:Ne(t.id,s+".id"),provider:typeof t.provider=="string"?t.provider:"",model:typeof t.model=="string"?t.model:""}}function fe(t,s){const o={...Gt(t,s),date:Ne(t.date,s+".date"),sessions:[]};return t.sessions!==void 0&&(Array.isArray(t.sessions)||re(s+".sessions","array"),o.sessions=t.sessions.map((a,n)=>ct(a,s+".sessions["+n+"]"))),o}function dt(t,s,o=["cacheWrite","reasoning"]){const a={};for(const n of["cacheHit","cacheMiss","output"])a[n]=ce(t[n],s+"."+n);for(const n of o)t[n]!==void 0&&(a[n]=ce(t[n],s+"."+n));return a}function ut(t,s){be(t,s);const o=dt(t,s);for(const a of["offPeak","peak","legacyBase","longContext"])t[a]!==void 0&&(o[a]=dt(t[a],s+"."+a,["cacheWrite","reasoning","aboveInputTokens"]));t.cny!==void 0&&(o.cny=dt(t.cny,s+".cny")),t.legacy!==void 0&&(o.legacy=Wt(t.legacy,s+".legacy")),t.rateHistory!==void 0&&((!Array.isArray(t.rateHistory)||t.rateHistory.length>16)&&re(s+".rateHistory","price history"),o.rateHistory=t.rateHistory.map((a,n)=>((!a||typeof a.before!="string"||!Number.isFinite(Date.parse(a.before)))&&re(s+".rateHistory","dated price"),{...ut({...a,rateHistory:void 0},s+".rateHistory."+n),before:a.before})));for(const a of["billingMode","sourceUrl","checkedAt","notes"])typeof t[a]=="string"&&(o[a]=t[a]);return o}function Ha(t,s){const o=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:Ke(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"):[]};be(t,s);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]=ut(t.prices.models[n],s+".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,sidebarTodayMetric:t.sidebarTodayMetric==="tokens"?"tokens":"cost",showTotalWithPlan:t.showTotalWithPlan===!0,sidebarSimple:t.sidebarSimple===!0,sidebarSimplePromptSeen:t.sidebarSimplePromptSeen===!0,sidebarModels:Object.fromEntries(Object.entries(Rt).map(([n,l])=>[n,t.sidebarModels?.[n]??l])),codexQuotaEnabled:t.codexQuotaEnabled===!0,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:ce(t.decimals,s+".decimals"),exchangeRate:ce(t.exchangeRate,s+".exchangeRate"),peakEnabled:t.peakEnabled===!0,peakEffectiveAt:typeof t.peakEffectiveAt=="string"?t.peakEffectiveAt:"",peakWindows:Array.isArray(t.peakWindows)?t.peakWindows.map((n,l)=>({start:ce(n.start,s+".peakWindows["+l+"].start"),end:ce(n.end,s+".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,i]of Object.entries(t.priceOverrides))typeof l=="string"&&typeof i=="string"&&(n[l]=i);return n})(),priceTableDisplay:(()=>{const n={};if(t.priceTableDisplay!==null&&typeof t.priceTableDisplay=="object"&&!Array.isArray(t.priceTableDisplay))for(const[l,i]of Object.entries(t.priceTableDisplay))typeof l=="string"&&(n[l]=i===!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 i=t.codingPlans[l];i===null||typeof i!="object"||Array.isArray(i)||(n[l]={enabled:i.enabled===!0,display:i.display==="sidebar"||i.display==="both"||i.display==="off"?i.display:"settings",refreshMinutes:typeof i.refreshMinutes=="number"&&Number.isFinite(i.refreshMinutes)?i.refreshMinutes:15,apiKey:typeof i.apiKey=="string"?i.apiKey:"",...l==="minimax"?{baseUrl:typeof i.baseUrl=="string"?i.baseUrl:""}:{},...l==="qwen"?{quotaSource:["cli","bailian"].includes(i.quotaSource)?i.quotaSource:"local"}:{},...typeof i.planCredits=="number"&&Number.isFinite(i.planCredits)&&i.planCredits>0?{planCredits:i.planCredits}:{},...typeof i.planStart=="string"?{planStart:i.planStart}:{},...i.rates!==null&&typeof i.rates=="object"&&!Array.isArray(i.rates)?{rates:i.rates}:{},...typeof i.accessKeyId=="string"?{accessKeyId:i.accessKeyId}:{},...typeof i.secretAccessKey=="string"?{secretAccessKey:i.secretAccessKey}:{}})}return n})(),prices:{models:a,default:ut(t.prices?.default??{cacheHit:0,cacheMiss:0,output:0},s+".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:ce(t.historyDays,s+".historyDays"),fetchedAt:t.fetchedAt===null||t.fetchedAt===void 0?null:Ne(t.fetchedAt,s+".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:Ke(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:Ke(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:o(t.customBalance),gatewayQuotas:(()=>{const n=Array.isArray(t.gatewayQuotas)?t.gatewayQuotas:t.gatewayQuotas?.sources;return{sources:Array.isArray(n)?n.slice(0,4).filter(i=>i!==null&&typeof i=="object"&&!Array.isArray(i)).map(i=>({id:typeof i.id=="string"?i.id.slice(0,48):"",type:"cliproxyapi",label:typeof i.label=="string"?i.label.slice(0,80):"",baseURL:typeof i.baseURL=="string"?i.baseURL:"",enabled:i.enabled!==!1,display:Ke(i.display,["sidebar","settings","off"],"both"),refreshMinutes:typeof i.refreshMinutes=="number"&&Number.isFinite(i.refreshMinutes)?Math.min(1440,Math.max(1,Math.floor(i.refreshMinutes))):15,includeProviders:Array.isArray(i.includeProviders)?[...new Set(i.includeProviders.filter(r=>typeof r=="string").map(r=>r.toLowerCase()).filter(r=>bt.includes(r)))]:bt,allowedHosts:Array.isArray(i.allowedHosts)?i.allowedHosts.filter(r=>typeof r=="string").slice(0,16):[],allowInsecureHttp:i.allowInsecureHttp===!0,antigravityOnlyGemini:i.antigravityOnlyGemini===!0,keyVar:typeof i.keyVar=="string"?i.keyVar:""})):[]}})(),customBalances:(()=>{if(Array.isArray(t.customBalances))return t.customBalances.filter(l=>l!==null&&typeof l=="object").slice(0,8).map(o).filter(Boolean);const n=o(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=(i,r)=>n[i]==="remaining"||n[i]==="used"?n[i]:r;return{balance:l("balance","remaining"),budget:l("budget","used"),go:l("go","used"),plan:l("plan","used")}})(),planBilling:{providers:_t(t.planBilling?.providers),models:_t(t.planBilling?.models,!0)}}}const Ue=t=>typeof t=="number"&&Number.isFinite(t)?t:null,Se=t=>Ue(t)??0,Ia={status:"off",message:"",fetchedAt:0,currency:"",totalBalance:0,grantedBalance:0,toppedUpBalance:0},ja={status:"off",message:"",fetchedAt:0,rolling:null,weekly:null,monthly:null},Kt=(t=null)=>({status:"off",message:"",fetchedAt:0,label:"",unit:"USD",remaining:0,maxBudget:null,spend:null,index:t});function mt(t,s){return be(t,s),{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 Qa(t,s){return{...mt(t,s),currency:typeof t.currency=="string"?t.currency:"",totalBalance:Se(t.totalBalance),grantedBalance:Se(t.grantedBalance),toppedUpBalance:Se(t.toppedUpBalance)}}function pt(t,s){return t==null?null:((typeof t!="object"||Array.isArray(t))&&re(s,"object"),{percent:Se(t.percent),resetsAt:typeof t.resetsAt=="string"?t.resetsAt:""})}function Fa(t,s){return{...mt(t,s),rolling:pt(t.rolling,s+".rolling"),weekly:pt(t.weekly,s+".weekly"),monthly:pt(t.monthly,s+".monthly")}}function Yt(t,s){return{...mt(t,s),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 _a=new Set(["ok","partial","unknown","error","stale","unsupported","capability_missing"]),Wa=new Set(["off","loading","ok","partial","stale","error"]),bt=["antigravity","claude","codex","kimi","xai","workbuddy"],Vt={antigravity:"Antigravity",claude:"Claude",codex:"Codex",kimi:"Kimi",xai:"xAI",workbuddy:"WorkBuddy"};function za(t,s){be(t,s);const o=(i,r="")=>typeof i=="string"?i:r,a=i=>Ue(i),n=i=>i!==null&&typeof i=="object"&&!Array.isArray(i)?{id:o(i.id),label:o(i.label),...a(i.percent)===null?{}:{percent:a(i.percent)},resetsAt:o(i.resetsAt),periodHours:a(i.periodHours),scope:o(i.scope)}:null,l=i=>i!==null&&typeof i=="object"&&!Array.isArray(i)?{unit:o(i.unit,"credits"),used:a(i.used),remaining:a(i.remaining),limit:a(i.limit),fetchedAt:o(i.fetchedAt),packages:Array.isArray(i.packages)?i.packages.filter(r=>r!==null&&typeof r=="object"&&!Array.isArray(r)).map(r=>({id:o(r.id),label:o(r.label),used:a(r.used),remaining:a(r.remaining),limit:a(r.limit),startsAt:o(r.startsAt),resetsAt:o(r.resetsAt)})):[]}:void 0;return{id:o(t.id),type:"cliproxyapi",label:o(t.label),status:Wa.has(t.status)?t.status:"error",message:o(t.message),fetchedAt:a(t.fetchedAt)??0,attemptedAt:a(t.attemptedAt)??0,serverVersion:o(t.serverVersion),keyConfigured:t.keyConfigured===!0,keySource:o(t.keySource,"none"),accounts:Array.isArray(t.accounts)?t.accounts.filter(i=>i!==null&&typeof i=="object"&&!Array.isArray(i)).slice(0,16).map(i=>({id:o(i.id),provider:o(i.provider,"unknown"),label:o(i.label,"unknown"),status:_a.has(i.status)?i.status:"unknown",message:o(i.message),plan:o(i.plan),windows:Array.isArray(i.windows)?i.windows.map(n).filter(Boolean):[],credits:l(i.credits)})):[],unsupportedProviders:Array.isArray(t.unsupportedProviders)?t.unsupportedProviders.filter(i=>typeof i=="string").slice(0,32):[]}}function Ga(t){if(t===null||typeof t!="object"||Array.isArray(t))return null;const s={};if(t.providers!==null&&typeof t.providers=="object"&&!Array.isArray(t.providers))for(const[o,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[i,r]of Object.entries(a.windows))r===null||typeof r!="object"||Array.isArray(r)||(n[i]={...Ye(r,["percent","localTokens","localCost","sampleCount"],Se),...Ye(r,["sampleAt","per1Tokens","per1Cost","fullTokens","fullCost"],Ue),resetsAt:typeof r.resetsAt=="string"?r.resetsAt:"",method:r.method==="sample"||r.method==="live"?r.method:"none",confidence:r.confidence==="high"||r.confidence==="low"?r.confidence:null});if(a.intervals!==null&&typeof a.intervals=="object"&&!Array.isArray(a.intervals))for(const[i,r]of Object.entries(a.intervals))Array.isArray(r)&&(l[i]=r.filter(u=>u!==null&&typeof u=="object"&&!Array.isArray(u)).map(u=>Ye(u,["t0","t1","tokens","cost","pct","per1Tokens","per1Cost"],Se)));s[o]={windows:n,intervals:l}}return{generatedAt:Se(t.generatedAt),providers:s}}function Jt(t,s){return be(t,s),{today:fe(t.today,s+".today"),month:fe(t.month,s+".month"),total:fe(t.total,s+".total"),budgetUsed:typeof t.budgetUsed=="number"&&Number.isFinite(t.budgetUsed)?t.budgetUsed:void 0,balance:t.balance==null?Ia:Qa(t.balance,s+".balance"),goQuota:t.goQuota==null?ja:Fa(t.goQuota,s+".goQuota"),customBalance:t.customBalance==null?Kt():Yt(t.customBalance,s+".customBalance"),customBalances:Array.isArray(t.customBalances)?t.customBalances.filter(o=>o!==null&&typeof o=="object").map((o,a)=>Yt(o,s+".customBalances["+a+"]")):[],gatewayQuotas:Array.isArray(t.gatewayQuotas)?t.gatewayQuotas.filter(o=>o!==null&&typeof o=="object"&&!Array.isArray(o)).map((o,a)=>za(o,s+".gatewayQuotas["+a+"]")):[],customVarStatus:t.customVarStatus!==null&&typeof t.customVarStatus=="object"&&!Array.isArray(t.customVarStatus)?Object.fromEntries(Object.entries(t.customVarStatus).filter(([,o])=>o!==null&&typeof o=="object").map(([o,a])=>[o,{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:Ga(t.planStats),history:Array.isArray(t.history)?t.history.map((o,a)=>fe(o,s+".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(o=>({source:String(o.source),today:fe(o.today,s+".external.today"),month:fe(o.month,s+".external.month"),total:fe(o.total,s+".external.total"),history:(o.history??[]).map(a=>fe(a,s+".external.history"))})),combined:Object.fromEntries(["today","month","total","history"].map(o=>[o,o==="history"?(t.externalUsage.combined.history??[]).map(a=>fe(a,s+".external.history")):fe(t.externalUsage.combined[o],s+".external."+o)]))}:null,config:Ha(t.config,s+".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:{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 Ka(t,s){be(t,s);const o={ok:t.ok===!0,message:typeof t.message=="string"?t.message:""};return t.state!==void 0&&t.state!==null&&(o.state=Jt(t.state,s+".state")),o}function ne(t){return{parse:t}}const ft=ne(Jt),Ya=ne(t=>be(t,"patch")),Va=ne(Ka),Zt=ne(t=>Ne(t,"provider")),Ja=ne(t=>{if(t!=null)return(typeof t!="number"||!Number.isInteger(t)||t<0||t>7)&&re("index","0-7 integer"),t}),Za=ne(t=>Ne(t,"date")),$a=ne(t=>be(t,"day")),Xa=ne(t=>(Number.isFinite(Number(t))||re("limit","number"),Number(t))),$t=ne(t=>Ne(t,"sort")),en=ne(t=>be(t,"topSessions")),Xt=ne(t=>Ne(t,"target")),tn=ne(t=>Ne(t,"value")),Ce=(t,s)=>({mode:"strict",typeSymbol:"dsh-cost-meter#"+t,schema:s,create:()=>s}),ie=(t,s,o,a=!1)=>({name:t,wire:t,source:"json",codec:Ce(s,o),...a?{acceptsUndefined:!0}:{}}),an={package:"dsh-cost-meter",descriptors:[{method:"getState",result:Ce("CostState",ft)},{method:"updateConfig",parameters:[ie("patch","ConfigPatch",Ya)],result:Ce("CostState",ft)},{method:"fetchPrices"},{method:"refreshBalance"},{method:"refreshGoQuota"},{method:"refreshCustomBalance",parameters:[ie("index","CustomBalanceIndex",Ja,!0)]},{method:"refreshCodingPlan",parameters:[ie("provider","CodingPlanProvider",Zt)]},{method:"refreshGatewayQuota",parameters:[ie("sourceId","GatewayQuotaSourceId",ne(t=>{if(t!=null)return(typeof t!="string"||t.length>48||!/^[a-z0-9][a-z0-9_-]*$/.test(t))&&re("sourceId","gateway source id"),t}),!0)]},{method:"resetHistory",result:Ce("CostState",ft)},{method:"importLegacyHistory"},{method:"getDaySessions",parameters:[ie("date","DayKey",Za)],result:Ce("DayRecord",$a)},{method:"getSessionCost",parameters:[ie("sessionId","SessionId",Zt)],result:Ce("SessionCost",ne(t=>({own:ct(t.own,"own"),subagents:ct(t.subagents,"subagents"),found:Wt(t.found,"found"),subagentCount:ce(t.subagentCount,"subagentCount")})))},{method:"getTopSessions",parameters:[ie("limit","SessionLimit",Xa),ie("sort","SessionSort",$t,!0),ie("dir","SessionSortDir",$t,!0)],result:Ce("TopSessions",en)},{method:"setCredential",parameters:[ie("target","CredentialTarget",Xt),ie("value","CredentialValue",tn)]},{method:"clearCredential",parameters:[ie("target","CredentialTarget",Xt)]}].map(t=>({id:"dsh-cost-meter#costMeter/"+t.method,service:"costMeter",namespace:"costMeter",invocation:{kind:"direct"},parameters:[],result:Ce("FetchPricesResult",Va),...t}))};function nn(t,s){const o=s?.models??{};return typeof t=="string"&&t.length>0&&o[t]!==void 0?o[t]:s?.default??{cacheHit:0,cacheMiss:0,output:0}}function He(t){if(t===null||typeof t!="object")return;const s=i=>{const r=t[i];return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0},o=s("cacheMiss")??s("input")??0,n={cacheHit:s("cacheHit")??s("cachedInput")??s("cacheRead")??o,cacheMiss:o,output:s("output")??0},l=s("reasoning");return l!==void 0&&(n.reasoning=l),s("cacheWrite")!==void 0&&(n.cacheWrite=s("cacheWrite")),n}function sn(t){const s=He(t);if(s===void 0)return null;for(const o of["offPeak","peak","legacyBase"]){const a=He(t[o]);a!==void 0&&(s[o]=a)}return Number.isFinite(t.longContext?.aboveInputTokens)&&t.longContext.aboveInputTokens>0&&(s.longContext={...He(t.longContext),aboveInputTokens:t.longContext.aboveInputTokens}),Array.isArray(t.rateHistory)&&(s.rateHistory=t.rateHistory.slice(0,16).map(o=>{const a={...He(o),before:o.before};for(const n of["offPeak","peak"]){const l=He(o[n]);l!==void 0&&(a[n]=l)}return a})),s}function Ve(t,s=Date.now()){if(!t||!Number.isFinite(s)||!Array.isArray(t.rateHistory))return t;let o=null,a=1/0;for(const i of t.rateHistory){const r=Date.parse(i.before);s<r&&r<a&&(o=i,a=r)}if(!o)return t;const{before:n,...l}=o;return{...t,...l}}const gt=Date.parse("2026-08-22T16:00:00Z");function ea(t){if(!Number.isFinite(t)||t<gt)return null;const s=Math.floor((t+8*36e5)/864e5),o=(s+4)%7;if(o!==6&&o!==0)return null;const a=o===6?s:s-1;return{start:Math.max(a*864e5-8*36e5,gt),end:(a+2)*864e5-8*36e5}}function ta(t,s){if(!Number.isFinite(t)||t<gt||!Array.isArray(s))return null;const o=Math.floor((t+8*36e5)/864e5);return s.includes(new Date(o*864e5).toISOString().slice(0,10))?{start:o*864e5-8*36e5,end:(o+1)*864e5-8*36e5}:null}const on=(t,s)=>ta(t,s)??ea(t);function Je(t,s,o,a){if(!Array.isArray(o)||o.length===0||on(t,a)!==null||Number.isFinite(s)&&t<s)return!1;const n=new Date(t).getUTCHours();return o.some(l=>{const i=Number(l.start),r=Number(l.end);return!Number.isFinite(i)||!Number.isFinite(r)?!1:i<r?n>=i&&n<r:n>=i||n<r})}const ln=Date.parse("2026-08-16T16:00:00Z");function aa(t,s,o){const a=Ve(t,s)??{cacheHit:0,cacheMiss:0,output:0},n=i=>({cacheHit:i.cacheHit,cacheMiss:i.cacheMiss,output:i.output,reasoning:i.reasoning??0,...i.cacheWrite===void 0?{}:{cacheWrite:i.cacheWrite},...i.longContext===void 0?{}:{longContext:i.longContext}});if(Number.isFinite(s)&&s<ln){const i=a.legacyBase;return n(i===void 0?a:i)}if(o?.enabled!==!0)return n(a);const l=typeof o.effectiveAtMs=="number"&&Number.isFinite(o.effectiveAtMs)?o.effectiveAtMs:void 0;if(Je(s,l,o.windows,o.holidays)){const i=a.peak;return n(i===void 0?a:i)}if(l!==void 0&&s>=l){const i=a.offPeak;return n(i===void 0?a:i)}return n(a)}function na(t,s){const o=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),i=Math.max(0,Number(t.reasoning)||0);return s.longContext&&o+n+l>s.longContext.aboveInputTokens&&(s=s.longContext),(o*s.cacheMiss+a*s.output+n*s.cacheHit+l*(s.cacheWrite??s.cacheHit)+i*(s.reasoning??0))/1e6}function sa(t,s,o){const a=Number(t);if(!Number.isFinite(a)||a<0||a===0)return 0;if(s!=="CNY")return a;const n=Number(o);return!Number.isFinite(n)||n<=0?a:a/n}function te(t,s){const o=t?.barDirections,a=s==="balance"?"remaining":"used";if(o===null||typeof o!="object"||Array.isArray(o))return a;const n=o[s];return n==="remaining"||n==="used"?n:a}function de(t,s){if(t==null||!Number.isFinite(Number(t)))return{width:0,label:null};const o=Math.max(0,Math.min(100,Number(t))),a=s==="remaining"?Math.round((100-o)*10)/10:Math.round(o*10)/10;return{width:a,label:a}}const oa=(t,s)=>t.toFixed(s).replace(/(\.\d*?[1-9])0+$|\.0+$/,"$1");function se(t,s){const o=typeof s?.symbol=="string"&&s.symbol.length>0?s.symbol:"$",a=Number(s?.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),o+oa(t,l)}function V(t,s){const o=Number(s?.exchangeRate),a=t*(Number.isFinite(o)&&o>0?o:1);return se(a,s)}function U(t){const s=Math.max(0,Number(t)||0),o=a=>a>=100?String(Math.round(a)):String(Math.round(a*10)/10);return s<1e3?String(Math.round(s)):s>=999500?o(s/1e6)+"M":s<1e6?o(s/1e3)+"K":o(s/1e6)+"M"}function ue(t){return String(t??"").toLowerCase().replace(/\([^)]*\)/g," ").replace(/([^)]*)/g," ").replace(/[^a-z0-9]+/g,"")}function Be(t,s){if(typeof t!="string"||t.length===0)return null;const o=Array.isArray(s)?s.filter(c=>typeof c=="string"&&c.length>0):[];if(o.length===0)return null;const a=c=>String(c).toLowerCase().replace(/[-@]\d{4}-?\d{2}-?\d{2}$/,"").replace(/[-@]v\d+(\.\d+)*$/,""),n=o.find(c=>c===t);if(n!==void 0)return n;const l=ue(t);if(l.length===0)return null;const i=o.find(c=>ue(c)===l);if(i!==void 0)return i;const r=a(t),u=o.find(c=>a(c)===r);if(u!==void 0)return u;const d=/^(?:[-_./:@](?:\d{4}-?\d{2}-?\d{2}|v\d+(?:\.\d+)*|\d+k|latest))+$/;return o.filter(c=>r.startsWith(a(c))&&d.test(r.slice(a(c).length))).sort((c,m)=>m.length-c.length)[0]??null}const rn=new Set(["lmstudio","ollama","jan","gpt4all","koboldcpp","llamacpp","llama-cpp","localai","vllm","sglang","tabbyapi","lmdeploy","oobabooga","text-generation-webui","llama-server"]),cn=["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 dn(t,s){if(typeof t=="string"&&rn.has(t))return!0;const o=typeof s=="string"?s.toLowerCase():"";return cn.some(a=>o.startsWith(a))}function un(t,s,o){const a=o?.prices??{},n=o?.priceMatch==="exact"?"exact":"auto",l=o?.priceOverrides&&typeof o.priceOverrides=="object"?o.priceOverrides:{};let i=String(t??"").trim().toLowerCase();i.startsWith("llm-")&&(i=i.slice(4)),i===""&&(i="deepseek");let r=i,u=s;const d=l[i+":"+s];if(d==="__local__")return{entry:null,priced:!1,billingMode:"flat",matched:!0};if(typeof d=="string"&&d.length>0){const p=d.indexOf(":");if(p>0&&d.slice(p+1).length>0?(r=d.slice(0,p).trim().toLowerCase(),u=d.slice(p+1)):u=d,r==="deepseek"&&u==="__default__")return{entry:a.default??{cacheHit:0,cacheMiss:0,output:0},priced:!0,billingMode:"deepseek-peak",matched:!1}}if(dn(r,u))return{entry:null,priced:!1,billingMode:"flat",matched:!1};if(r==="deepseek"||r.includes("deepseek")){const p=a.models??{},b=p[u]!==void 0?u:n==="auto"?Be(u,Object.keys(p)):null;if(b!==null)return{entry:p[b],priced:!0,billingMode:"deepseek-peak",matched:!0};if(n==="auto"){let g=null,k=-1,v="flat";for(const[N,C]of Object.entries(a.providers??{})){const w=C?.models??{},f=Be(u,Object.keys(w));if(f===null||w[f]?.unpriced===!0)continue;const h=(f===u||ue(f)===ue(u)?1e3:0)+ue(f).length;h>k&&(g=w[f],k=h,v=w[f]?.billingMode==="deepseek-peak"?"deepseek-peak":"flat")}if(g!==null)return{entry:g,priced:!0,billingMode:v,matched:!0}}return{entry:a.default??{cacheHit:0,cacheMiss:0,output:0},priced:!0,billingMode:"deepseek-peak",matched:!1}}const c=a.providers?.[r]?.models??{},m=c[u]!==void 0?u:n==="auto"?Be(u,Object.keys(c)):null;if(m!==null)return{entry:c[m],priced:c[m]?.unpriced!==!0,billingMode:"flat",matched:!0};if(r==="opencode-go")return{entry:null,priced:!1,billingMode:"flat",matched:!1};if(n==="auto"){const p=a.models??{},b=Be(u,Object.keys(p));if(b!==null)return{entry:p[b],priced:!0,billingMode:"deepseek-peak",matched:!0};let g=null,k=-1,v="flat";for(const[N,C]of Object.entries(a.providers??{})){if(N===r)continue;const w=C?.models??{},f=Be(u,Object.keys(w));if(f===null||w[f]?.unpriced===!0)continue;const h=(f===u||ue(f)===ue(u)?1e3:0)+ue(f).length;h>k&&(g=w[f],k=h,v=w[f]?.billingMode==="deepseek-peak"?"deepseek-peak":"flat")}if(g!==null)return{entry:g,priced:!0,billingMode:v,matched:!0}}if(i!=="deepseek"&&!i.includes("deepseek")&&typeof d=="string"&&d.length>0&&!d.includes(":")){const p=a.models??{},b=p[d]!==void 0?d:n==="auto"?Be(d,Object.keys(p)):null;if(b!==null)return{entry:p[b],priced:!0,billingMode:"deepseek-peak",matched:!0}}return{entry:null,priced:!1,billingMode:"flat",matched:!1}}function ht(t,s,o){const a=un(t,s,o);return a.priced&&o?.prices?.currency==="CNY"&&a.entry?.cny?{...a,entry:a.entry.cny,currency:"CNY"}:{...a,currency:a.billingMode==="deepseek-peak"&&o?.prices?.currency==="CNY"?"CNY":"USD"}}function mn(t){const s=Number(t?.calls)||0,o=Number(t?.input)||0,a=Number(t?.cacheRead)||0;return s>=3&&o>=1e5&&a===0}function Ze(t,s){return!t||!s?0:typeof t.cost=="number"&&Number.isFinite(t.cost)?t.cost:ia(t,s).total}function yt(t){if(t===null||typeof t!="object")return 0;const s=Number(t.cost)||0,o=t.apiCost===void 0||t.apiCost===null?s:Number(t.apiCost);return Number.isFinite(o)&&o>=0?Math.min(o,s):s}function W(t,s){return s!==null&&typeof s=="object"&&s.showTotalWithPlan===!0?Number(t?.cost)||0:yt(t)}const pn={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"]},la=["anthropic","zai","minimax","kimi","openrouter","siliconflow","commandcode","scnet","volcengine","qwen","mimo","go"];function bn(t){const s=String(t??"").trim().toLowerCase().replace(/^llm-/,"");if(s.length===0)return null;for(const[o,a]of Object.entries(pn))if(a.includes(s))return o;return la.includes(s)?s:null}function fn(t){const s=new Set,o=t?.codingPlans;if(o!==null&&typeof o=="object")for(const a of la)a!=="go"&&o[a]?.enabled===!0&&s.add(a);return t?.goQuota?.enabled===!0&&s.add("go"),s}function gn(t,s,o){const a=String(t??"").trim().toLowerCase();if(a.length>0&&a!=="deepseek"&&!a.includes("deepseek"))return!1;const n=ue(s);if(n.length===0)return!1;const l=o?.prices,i=l?.models??{};for(const r of Object.keys(i))if(ue(r)===n)return!1;for(const r of Object.values(l?.providers??{}))for(const u of Object.keys(r?.models??{}))if(ue(u)===n)return!0;return!1}function Ie(t,s,o){let a=bn(t);a===null&&gn(t,s,o)&&(a="go");const n=o?.planBilling?.models;if(n!==null&&typeof n=="object"){const i=n[t+":"+s];if(i==="plan"||i==="api")return i;if(a!==null){const r=n[a+":"+s];if(r==="plan"||r==="api")return r}}if(a===null)return"api";const l=o?.planBilling?.providers?.[a];return l==="plan"||l==="api"?l:fn(o).has(a)?"plan":"api"}function ia(t,s){if(!t||!s)return{total:0,api:0};const o={enabled:s.peakEnabled===!0,effectiveAtMs:Date.parse(s.peakEffectiveAt||""),windows:s.peakWindows,holidays:s.peakHolidays},a=Date.now(),n=t.byProviderModel??t.byModel??{};let l=0,i=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,k=ht(b,g,s);if(k.priced){const v=na(n[m],aa(sn(k.entry),a,{...o,enabled:k.billingMode==="deepseek-peak"&&o.enabled})),N=sa(v,k.currency,s.exchangeRate);l+=N,Ie(b,g,s)==="api"&&(i+=N)}}const r={input:0,output:0,cacheRead:0,cacheWrite:0,reasoning:0};for(const m of Object.keys(n))r.input+=n[m].input??0,r.output+=n[m].output??0,r.cacheRead+=n[m].cacheRead??0,r.cacheWrite+=n[m].cacheWrite??0,r.reasoning+=n[m].reasoning??0;const u={input:Math.max(0,(t.input??0)-r.input),output:Math.max(0,(t.output??0)-r.output),cacheRead:Math.max(0,(t.cacheRead??0)-r.cacheRead),cacheWrite:Math.max(0,(t.cacheWrite??0)-r.cacheWrite),reasoning:Math.max(0,(t.reasoning??0)-r.reasoning)},d=na(u,aa(nn("default",s.prices),a,o)),c=sa(d,s.prices?.currency==="CNY"?"CNY":"USD",s.exchangeRate);return l+=c,i+=c,{total:l,api:i}}function ra(t,s){if(!t||!s)return!1;const o=t.byProviderModel??{};for(const a of Object.keys(o)){const n=a.indexOf(":"),l=n>0?a.slice(0,n):"deepseek",i=n>0?a.slice(n+1):a;if(Ie(l,i,s)==="plan")return!0}return!1}function kt(t){return(t?.input??0)+(t?.cacheRead??0)+(t?.cacheWrite??0)}function ca(t,s){if(t?.apiCost!==void 0)return yt(t);if(!ra(t,s))return Ze(t,s);let o=0;for(const[a,n]of Object.entries(t.byProviderModel??{})){if(!Number.isFinite(n.cost))return ia(t,s).api;const l=a.indexOf(":");Ie(a.slice(0,l),a.slice(l+1),s)==="plan"&&(o+=n.cost)}return Math.max(0,Ze(t,s)-o)}function wt(t){const s=Math.abs(Math.round(Number(t)||0)),o=Math.floor(s/60),a=s%60;return"UTC"+(Number(t)<0?"-":"+")+o+(a>0?":"+String(a).padStart(2,"0"):"")}function hn(t){const s=t?.meta,o=Number(s?.timezoneOffsetMinutes);if(!Number.isFinite(o))return null;const a=-new Date().getTimezoneOffset();if(a===o)return null;const n=typeof s?.timezone=="string"&&s.timezone.length>0?s.timezone:"";return{hostLabel:n?n+" ("+wt(o)+")":wt(o),browserLabel:wt(a)}}function yn(t){let s=t;const o=new Set;return{getSnapshot:()=>s,subscribe:a=>(o.add(a),()=>{o.delete(a)}),set:a=>{if(a!==s){s=a;for(const n of[...o])n()}}}}const{createElement:e,Fragment:E,useState:L,useEffect:ee,useRef:Ae}=Ee;function De({target:t,configured:s,source:o,t:a,api:n,placeholder:l,disabled:i}){const[r,u]=L(""),[d,c]=L(!1),[m,p]=L(null),b=i===!0||d,g=async()=>{const v=r.trim();if(!(v.length===0||b)){c(!0),p(null);try{const N=await n.setCredential(t,v);u(""),p({kind:"ok",text:N?.message??a("credentialSave")})}catch(N){p({kind:"err",text:String(N?.message??N)})}finally{c(!1)}}},k=async()=>{if(!b){c(!0),p(null);try{const v=await n.clearCredential(t);u(""),p({kind:"ok",text:v?.message??a("credentialClear")})}catch(v){p({kind:"err",text:String(v?.message??v)})}finally{c(!1)}}};return e("div",{className:"cm-field"},e("input",{className:"cm-input",type:"password",value:r,placeholder:typeof l=="string"?l:"",disabled:b,autoComplete:"off",onChange:v=>u(v.target.value)}),e("div",{className:"cm-buttons"},e("button",{className:"cm-btn small",onClick:g,disabled:b||r.trim().length===0},a(d?"credentialSaving":"credentialSave")),s===!0?e("button",{className:"cm-btn small",onClick:k,disabled:b},a("credentialClear")):null),e("span",{className:"cm-hint"},s===!0?a("credentialConfiguredOf",{source:typeof o=="string"&&o.length>0?o:"unknown"}):a("credentialNotConfigured")),e("span",{className:"cm-hint"},a("credentialInputHint")),Ut(m))}function kn({pending:t,t:s}){return!Array.isArray(t)||t.length===0?null:e("div",{className:"cm-msg err"},e("div",null,s("secretMigrationPending")),e("div",null,t.join("、")))}function $e({size:t=16,className:s}){return e("svg",{width:t,height:t,className:s,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 da(t,s){const o=Ae(!1),a=Ae(""),n=s!==null&&typeof s=="object"?[s.input,s.cacheRead,s.cacheWrite,s.output,s.reasoning,s.cost].map(l=>String(l??0)).join("|"):"";ee(()=>{if(!o.current){o.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 wn(t,s,o,a){const n=u=>["input","output","cacheRead","cacheWrite"].reduce((d,c)=>d+(u?.[c]??0),0),l=s?.found&&n(s.own)>=n(t)?s.own:t;if(!o||!s?.subagentCount)return l;const i=s.subagents,r={...l};for(const u of["input","output","cacheRead","cacheWrite","reasoning","cost"])r[u]=(l?.[u]??0)+(i?.[u]??0);r.apiCost=ca(l,a)+yt(i);for(const u of["byModel","byProviderModel"]){r[u]={...l?.[u]};for(const[d,c]of Object.entries(i?.[u]??{})){const m={...r[u][d]};for(const p of["input","output","cacheRead","cacheWrite","reasoning","cost"])m[p]=(m[p]??0)+(c[p]??0);delete m.apiCost,r[u][d]=m}}return r}function ua(t){const s=t.useProjection?t.useProjection("costUsage"):void 0,o=t.useCost?.(r=>r)?.state,a=o?.config,[n,l]=L(null);da(t,s),ee(()=>{if(!t.sessionId||!t.api?.getSessionCost)return;let r=!0,u=!1;const d=async()=>{if(!u){u=!0;try{const m=await t.api.getSessionCost(t.sessionId);r&&l({id:t.sessionId,include:a?.includeSubagentCost===!0,value:m})}catch{}finally{u=!1}}};d();const c=a?.includeSubagentCost===!0?setInterval(d,1e4):null;return()=>{r=!1,c!==null&&clearInterval(c)}},[t.sessionId,o?.meta?.now,s,a?.includeSubagentCost]);const i=n&&n.id===t.sessionId&&n.include===(a?.includeSubagentCost===!0)?n.value:null;return{usage:wn(s,i,a?.includeSubagentCost===!0,a),config:a}}function ma(t,s){let o=0,a=Ze(t,s);if(s.showTotalWithPlan!==!0&&(t.apiCost!==void 0||ra(t,s))){const n={total:Ze(t,s),api:ca(t,s)};o=Math.max(0,n.total-n.api),o>0&&(a=n.api)}return{cost:a,planPart:o}}function xn(t){const{usage:s,config:o}=ua(t);if(!s||!o||kt(s)+(s?.output??0)===0)return null;const a=K(_(o.locale)),{cost:n,planPart:l}=ma(s,o),i=[a("sessionCostTitle"),a("sessionDetailTokens",{input:U(s?.input??0),cache:U((s?.cacheRead??0)+(s?.cacheWrite??0)),output:U(s?.output??0)}),a("sessionDetailCache",{read:U(s?.cacheRead??0),write:U(s?.cacheWrite??0)}),a("cost",{amount:V(n,o)}),...l>0?[a("sessionDetailPlan",{amount:V(l,o)})]:[]].join("; ");return e(Z,{label:i,side:"top",delayMs:500},e("div",{className:"cm-chip"},l>0?a("costChipPlan",{amount:V(n,o)}):a("cost",{amount:V(n,o)})))}function vn(t){const{usage:s,config:o}=ua(t);if(!s||!o)return null;const a=s.input??0,n=(s.cacheRead??0)+(s.cacheWrite??0),l=s.output??0;if(a+n+l===0)return null;const i=K(_(o.locale)),{cost:r,planPart:u}=ma(s,o),d=kt(s)>0?((s.cacheRead??0)/kt(s)*100).toFixed(1)+"%":"—";return e("div",{className:"cm-root"},i(u>0?"sessionLineSplit":"sessionLine",{amount:V(r,o),planAmount:V(u,o),hitRate:d,input:U(a),cache:U(n),output:U(l)}))}const Nn={USD:"$",CNY:"¥",EUR:"€"};function we(t,s,o){const a=typeof o=="string"?o.toUpperCase():"",n=typeof s?.symbol=="string"&&s.symbol.length>0?s.symbol:"$";return se(t,{symbol:Nn[a]??n,decimals:Math.max(2,Math.min(10,Math.floor(Number(s?.decimals)||2)))})}function pa(t,s){const o=Number(t?.balance?.budgetCap);if(Number.isFinite(o)&&o>0)return o;const a=Number(s?.maxBudget);return Number.isFinite(a)&&a>0?a:null}function Sn(t){const s=t.today,o=s?.byProviderModel;if(o===null||typeof o!="object"||Object.keys(o).length===0)return Number(s?.cost)||0;let a=0;for(const[n,l]of Object.entries(o)){const i=n.indexOf(":");let r=i>=0?n.slice(0,i):n;r.startsWith("llm-")&&(r=r.slice(4)),!(r!=="deepseek"&&r!=="deepseek-official")&&(a+=Number(l?.cost)||0)}return a}function ba(t,s,o,a,n=null){const l=o==="official"?Sn(t):Number(t.today?.cost)||0;if(o==="custom"){const r=je(s,a,n);if(r==="USD")return l;if(r==="CREDITS")return 0;const u=Number(s?.exchangeRate);return l*(Number.isFinite(u)&&u>0?u:1)}const i=Number(s?.exchangeRate);return l*(Number.isFinite(i)&&i>0?i:1)}function fa({remaining:t,spend:s,todayUsed:o,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(s)||0),i=Math.max(0,Math.min(l,Number(o)||0)),r=Math.max(0,l-i),u=Math.max(0,Math.min(100,n/a*100)),d=Math.max(0,Math.min(100-u,i/a*100)),c=Math.max(0,Math.min(100-u-d,r/a*100));return{remainingPct:u,todayPct:d,spentPct:c,hasCap:!0,pastSpend:r,today:i}}function xt(t,s,o=null,a=null){const n=o??t.customBalance,l=pa(je(s,n,a)==="CREDITS"?null:s,n),i=Number(n?.remaining)||0,r=Number(n?.spend)||0,u=ba(t,s,"custom",n,a);return{cap:l,...fa({remaining:i,spend:r,todayUsed:u,cap:l})}}function Cn(t,s){const o=t.balance,a=pa(s,null),n=Number(o?.totalBalance)||0,l=ba(t,s,"official",null),i=a!==null?Math.max(0,a-n):0;return{cap:a,...fa({remaining:n,spend:i,todayUsed:l,cap:a})}}function vt(t){const{segments:s,direction:o="remaining"}=t,{remainingPct:a,todayPct:n,spentPct:l}=s,i=[];a>0&&i.push(e("div",{className:"cm-bbox-fill",style:{width:a+"%"}})),n>0&&i.push(e("div",{className:"cm-bbox-seg-today",style:{width:n+"%"}})),l>0&&i.push(e("div",{className:"cm-bbox-seg-spent",style:{width:l+"%"}})),i.length===0&&i.push(e("div",{className:"cm-bbox-fill",style:{width:"100%"}}));const r=o==="used"?[...i].reverse():i;return e("div",{className:"cm-bbox-bar segments"+(o==="used"?" rev":"")},...r)}function ga(t,s,o,a,n){const l=[t("balanceBarRemaining",{amount:a})];return o.today>0&&l.push(t("balanceBarToday",{amount:s(o.today)})),o.pastSpend>0&&l.push(t("balanceBarSpent",{amount:s(o.pastSpend)})),n!==null&&n>0&&l.push(t("balanceBudgetCapLabel")+": "+s(n)),l.join(" · ")}function Pe(t){const[s,o]=L(!1),[a,n]=L(null);return{busy:s,err:a,run:()=>{s||typeof t!="function"||(o(!0),n(null),Promise.resolve().then(t).catch(i=>{n(i?.message??String(i))}).finally(()=>{o(!1)}))}}}const me=(t,s)=>({role:"button",tabIndex:0,"aria-busy":t?"true":"false",onClick:s,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),s())}});function ge(t,s){const o=[t("clickToRefresh")];return s.busy&&o.push(t("refreshing")),s.err&&o.push("⚠ "+t("balanceRefreshFailed",{message:s.err})),o}const An="https://platform.deepseek.com/usage";function ha(t){return e("a",{className:"cm-bal-link",href:An,target:"_blank",rel:"noreferrer noopener",title:t("balanceRechargeLink"),"aria-label":t("balanceRechargeLink"),onClick:s=>s.stopPropagation(),onKeyDown:s=>s.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 Pn(t){const{state:s,wide:o,api:a}=t,n=s.balance,l=K(_(s.config?.locale)),i=Pe(a?()=>a.refreshBalance():null);if(!n||n.status==="off")return null;if(n.status==="error")return e(Z,{label:[l("balanceQueryFailed",{message:n.message||l("unknownError")}),...ge(l,i)].join("; "),side:"right",delayMs:300},e("div",{className:"cm-foot clickable"+(o?"":" cm-foot-rail")+" cm-bal-err"+(i.busy?" busy":""),...me(i.busy,i.run)},o?e(E,null,l("balance")," ",e("span",{className:"cm-num"},l("queryFailed"))):"⚠"));const r=[l("balanceTitle"),l("totalBalance",{amount:we(n.totalBalance,s.config,n.currency)}),l("grantedToppedUp",{granted:we(n.grantedBalance,s.config,n.currency),toppedUp:we(n.toppedUpBalance,s.config,n.currency)}),l("updatedAt",{time:n.fetchedAt>0?new Date(n.fetchedAt).toLocaleTimeString():"—"}),...s.reconcile?.ok===!1?["⚠ "+s.reconcile.message]:[],...ge(l,i)].join("; ");return e(Z,{label:r,side:"right",delayMs:300},e("div",{className:"cm-foot clickable"+(o?"":" cm-foot-rail")+(i.busy?" busy":""),...me(i.busy,i.run)},o?e(E,null,e("span",{className:"cm-balance-name"},l("balance"),ha(l)),e("span",{className:"cm-num cm-bal-amt"},we(n.totalBalance,s.config,n.currency)),s.reconcile?.ok===!1?" ⚠":""):e($e,{size:16})))}function Mn(t){const{state:s,wide:o,api:a}=t,n=s.config,l=s.balance,i=K(_(n?.locale)),r=Pe(a?()=>a.refreshBalance():null);if(!l||l.status!=="ok")return null;const u=Cn(s,n),d=we(l.totalBalance,n,l.currency),c=b=>we(b,n,l.currency),m=[i("balanceTitle"),ga(i,c,u,d,u.cap),i("grantedToppedUp",{granted:we(l.grantedBalance,n,l.currency),toppedUp:we(l.toppedUpBalance,n,l.currency)}),i("updatedAt",{time:l.fetchedAt>0?new Date(l.fetchedAt).toLocaleTimeString():"—"}),...s.reconcile?.ok===!1?["⚠ "+s.reconcile.message]:[],...ge(i,r)].join("; "),p=e(E,null,e("div",{className:"cm-bbox-head"},e("span",{className:"cm-balance-name"},e("span",{className:"cm-bbox-label"},i("balance")),ha(i)),e("span",{className:"cm-bbox-pct cm-num cm-bal-amt"},d)),e(vt,{segments:u,direction:te(n,"balance")}));return e(Z,{label:m,side:"right",delayMs:300},e("div",{className:"cm-bbox clickable"+(o?"":" rail")+(r.busy?" busy":""),...me(r.busy,r.run)},o?p:e("div",{className:"cm-bbox-rail cm-num"},Math.round(u.remainingPct)+"%")))}function Nt(t,s){const o=typeof t?.label=="string"?t.label:"",a=typeof t?.labelEn=="string"?t.labelEn:"";return s==="en"?a||o||"Custom balance":o||a||"自定义余额"}function je(t,s,o){if((o??t?.customBalance)?.adapter==="aliyun"&&["CNY","USD","EUR"].includes(s?.unit))return s.unit;const a=o?.unit??t?.customBalance?.unit;return["CNY","EUR","USD","CREDITS"].includes(a)?a:["CNY","EUR","CREDITS"].includes(s?.unit)?s.unit:"USD"}function Qe(t,s,o,a){const n=je(s,o,a),l=Number(t);if(!Number.isFinite(l))return"—";const i=s?.currency==="USD"?1:Number(s?.exchangeRate);if((a??s?.customBalance)?.convertToDisplayCurrency===!0&&n==="USD"&&Number.isFinite(i)&&i>0){const c=l*i;return Number.isFinite(c)?se(c,s):"—"}const r=n==="CREDITS",u=Math.max(2,Math.min(6,Math.floor(Number(s?.decimals)||4)));return(r?"":n==="CNY"?"¥":n==="EUR"?"€":"$")+oa(l,u)+(r?" Credits":"")}function St(t,s,o,a,n=null){const l=Qe(t.remaining,s,t,n),i=p=>Qe(p,s,t,n);if(a&&s.balance?.showProgressBar===!0){const p=xt(a,s,t,n);return[ga(o,i,p,l,p.cap),o("updatedAt",{time:t.fetchedAt>0?new Date(t.fetchedAt).toLocaleTimeString():"—"})].join(" · ")}const r=t.spend!==null?i(t.spend):"—",u=t.maxBudget!==null?i(t.maxBudget):"—",d=je(s,t,n)==="CREDITS"?NaN:Number(s?.balance?.budgetCap),c=Number.isFinite(d)&&d>0?o("balanceBudgetCapLabel")+": "+i(d):"",m=t.maxBudget!==null&&t.spend!==null?o("customBalanceLine",{remaining:l,spend:r,maxBudget:u,time:t.fetchedAt>0?new Date(t.fetchedAt).toLocaleTimeString():"—"}):o("customBalanceRemaining",{amount:l});return c?m+" · "+c:m}function Tn(t,s,o,a,n){const l=Nt(n??s.customBalance??{},_(s?.locale)),i=Qe(a.remaining,s,a,n),r=xt(t,s,a,n);return{level:"ok",rail:Math.round(r.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"},i)),e(vt,{segments:r,direction:te(s,"balance")}))}}function Ct(t,s){const o=s?.customBalances??[],a=Array.isArray(t?.customBalances)?t.customBalances:[],n=[];return o.forEach((l,i)=>{if(l?.enabled!==!0||l.display!=="sidebar"&&l.display!=="both")return;const r=a.find(u=>u.index===i)??(a.length===1&&o.length===1?a[0]:null);n.push({index:i,entry:l,snapshot:r})}),n.length===0&&a.length===0&&s?.customBalance?.enabled===!0&&(s.customBalance.display==="sidebar"||s.customBalance.display==="both")&&t?.customBalance?.status&&t.customBalance.status!=="off"&&n.push({index:null,entry:s.customBalance,snapshot:t.customBalance}),n}function Bn(t){const{state:s,wide:o,api:a}=t,n=s.config,l=K(_(n?.locale)),i=Ct(s,n);return i.length===0?null:e(E,null,i.map(({index:r,entry:u,snapshot:d})=>e(Dn,{key:"cb-"+r,state:s,wide:o,api:a,t:l,index:r,entry:u,snapshot:d})))}function Dn(t){const{state:s,wide:o,api:a,t:n,index:l,entry:i,snapshot:r}=t,u=s.config;if(r==null||r.status!=="ok")return null;const d=Pe(a?()=>a.refreshCustomBalance(l):null),c=Tn(s,u,n,r,i),m=[St(r,u,n,s,i),...ge(n,d)].join(" · ");return e(Z,{label:m,side:"right",delayMs:300},e("div",{className:"cm-bbox clickable"+(c.level==="ok"?"":" "+c.level)+(o?"":" rail")+(d.busy?" busy":""),...me(d.busy,d.run)},o?c.body:e("div",{className:"cm-bbox-rail cm-num"},c.rail)))}function On(t){const{state:s,wide:o,api:a}=t,n=s.config,l=K(_(n?.locale)),i=Ct(s,n);return i.length===0?null:e(E,null,i.map(({index:r,entry:u,snapshot:d})=>e(Rn,{key:"cbr-"+r,state:s,wide:o,api:a,t:l,index:r,entry:u,snapshot:d})))}function Rn(t){const{state:s,wide:o,api:a,t:n,index:l,entry:i,snapshot:r}=t,u=s.config,d=r??Kt(l);if(d.status==="off")return null;const c=Pe(a?()=>a.refreshCustomBalance(l):null),m=Nt(i??u.customBalance??{},_(u?.locale));if(d.status==="error")return e(Z,{label:[d.message||n("unknownError"),...ge(n,c)].join("; "),side:"right",delayMs:300},e("div",{className:"cm-foot clickable"+(o?"":" cm-foot-rail")+" cm-bal-err"+(c.busy?" busy":""),...me(c.busy,c.run)},o?e(E,null,e("span",{className:"cm-bal-label",title:m},m),e("span",{className:"cm-num cm-bal-amt"},n("queryFailed"))):"⚠"));const p=Qe(d.remaining,u,d,i),b=[St(d,u,n,s,i),...ge(n,c)].join(" · ");return e(Z,{label:b,side:"right",delayMs:300},e("div",{className:"cm-foot clickable"+(o?"":" cm-foot-rail")+(c.busy?" busy":""),...me(c.busy,c.run)},o?e(E,null,e("span",{className:"cm-bal-label",title:m},m),e("span",{className:"cm-num cm-bal-amt"},p)):e($e,{size:16})))}function Ln(t){const o=(t.useCost?t.useCost(g=>g):void 0)?.state;if(!o)return null;const a=o.config,n=K(_(a?.locale)),l=a.corner??{enabled:!1,goRolling:!0,goWeekly:!0,goMonthly:!0,budget:!0},i=o.goQuota,r=a?.goQuota?.enabled!==!1&&i?.status==="ok",u=g=>g!==null&&typeof g?.percent=="number"?Math.round(Math.max(0,Math.min(100,g.percent))):null,d=[];if(a.sidebarModels?.dock){const g=Pa(o,a.sidebarModels.period,n);g.length&&d.push({key:"model-top",text:e(E,null,e("span",{className:"cm-bal-label"},g[0].label),e("span",{className:"cm-bal-amt"},V(g[0].cost,a))),tip:g[0].label+" "+V(g[0].cost,a),level:"ok"})}const c=(g,k,v,N)=>{if(!l.enabled||!g||!r)return;const C=u(k);if(C===null)return;const w=typeof k.resetsAt=="string"&&k.resetsAt.length>0?n("goResetAt",{time:new Date(k.resetsAt).toLocaleString()}):"";d.push({key:v,text:n(v)+" "+C+"%",tip:n(N)+": "+C+"%"+(w?" · "+w:""),level:C>=100?"over":C>=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",i?.rolling,"goShortRolling","cornerGoRolling"]:g==="weekly"?["goWeekly",i?.weekly,"goShortWeekly","cornerGoWeekly"]:["goMonthly",i?.monthly,"goShortMonthly","cornerGoMonthly"];for(const g of p){const[k,v,N,C]=b(g);c(l[k]===!0,v,N,C)}if(l.enabled&&l.budget===!0){const g=a.budget??{enabled:!1,amount:100,period:"month"};if(g.enabled===!0){const k=Number(a.exchangeRate),N=(o.budgetUsed??(g.period==="day"?W(o.today,a):g.period==="all"?W(o.total,a):W(o.month,a)))*(Number.isFinite(k)&&k>0?k:1),C=Math.max(0,Number(g.amount)||0),w=C>0?Math.min(999,N/C*100):null;if(w!==null){const f=w>=100?"over":w>=80?"warn":"ok";d.push({key:"budget",text:n("budgetShort")+" "+w.toFixed(1)+"%",tip:n("budgetOf",{period:n(qe[g.period]??"periodMonth")})+" · "+n("usedOf",{used:se(N,a),amount:se(C,a)}),level:f})}}}return d.length===0?null:e("div",{className:"cm-corner"},d.map(g=>e(Z,{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 Xe(t,s,o){if(!Array.isArray(s)||s.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(o)?o.length:0)+7));for(let p=-l;p<=l;p+=1){n.add(a(p,16));for(const b of s){const g=Number(b?.start),k=Number(b?.end);!Number.isFinite(g)||!Number.isFinite(k)||(n.add(a(p,g)),n.add(a(k<=g?p+1:p,k)))}}const i=[...n].sort((p,b)=>p-b).flatMap(p=>{const b=Je(p-1,void 0,s,o),g=Je(p,void 0,s,o);return b===g?[]:[{at:p,intoPeak:g}]});let r=null,u=null;for(const p of i)p.at<=t&&(r===null||p.at>r.at)&&(r=p),p.at>t&&(u===null||p.at<u.at)&&(u=p);const d=ta(t,o),c=d??ea(t);return c!==null?u===null?null:{inPeak:!1,weekend:d===null,...d?{holiday:!0}:{},prevAtMs:c.start,nextAtMs:u.at,nextIntoPeak:u.intoPeak}:r===null||u===null?null:{inPeak:Je(t,void 0,s,o),weekend:!1,prevAtMs:r.at,nextAtMs:u.at,nextIntoPeak:u.intoPeak}}function et(t,s){if(!t||t.peakNotice===!1||t.peakEnabled!==!0)return null;const o=Date.parse(t.peakEffectiveAt||"");if(Number.isFinite(o)&&s<o)return null;const a=Array.isArray(t.peakWindows)?t.peakWindows:[];return Xe(s,a,t.peakHolidays)}function tt(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,s,o){const a=Math.max(0,t.nextAtMs-s),n=Math.max(1,Math.ceil(a/6e4)),l=Math.floor(n/60),i=n%60;return l>0?i>0?o("countdownHourMinute",{h:l,m:i}):o("countdownHoursOnly",{h:l}):o("countdownMinute",{m:n})}const At="cm-peak-alert-preview";let ya=0;function En(t){const s=t.useCost?t.useCost(k=>k):void 0,o=s?.state?.config,[a,n]=L(Date.now()),[l,i]=L(null),[r,u]=L(null);if(ee(()=>{const k=window.setInterval(()=>n(Date.now()),1e4);return()=>window.clearInterval(k)},[]),ee(()=>{const k=v=>{const N=v.detail?.kind==="offpeak"?"offpeak":"peak";u(N);const C=s?.state?.config;if(C?.peakAlertWebNotify===!0&&window.Notification&&Notification.permission==="granted"){const w=K(_(C.locale));try{new Notification(w(N==="peak"?"peakAlertTitlePeak":"peakAlertTitleOffPeak")+w("peakAlertPreviewTag"),{body:w("peakAlertBody",{time:w("countdownMinute",{m:2}),phase:w(N==="peak"?"peakAlertPhasePeak":"peakAlertPhaseOffPeak")})})}catch{}}};return window.addEventListener(At,k),window.__cmPeakAlertLive=!0,()=>{window.removeEventListener(At,k),window.__cmPeakAlertLive=!1}},[]),ee(()=>{if(!o||o.peakAlertEnabled!==!0||o.peakEnabled!==!0||o.peakAlertWebNotify!==!0||!window.Notification||Notification.permission!=="granted")return;const k=Xe(a,Array.isArray(o.peakWindows)?o.peakWindows:[],o.peakHolidays);if(k===null)return;const v=o.peakAlertTarget==="peak"||o.peakAlertTarget==="offpeak"?o.peakAlertTarget:"both",N=k.nextIntoPeak===!0;if(v!=="both"&&v!==(N?"peak":"offpeak"))return;const C=Number(o.peakAlertAhead),w=(Number.isFinite(C)&&C>=1?C:2)*6e4;if(a<k.nextAtMs-w||a>=k.nextAtMs||ya===k.nextAtMs)return;const f=K(_(o.locale));ya=k.nextAtMs;try{new Notification(f(N?"peakAlertTitlePeak":"peakAlertTitleOffPeak"),{body:f("peakAlertBody",{time:he(k,a,f),phase:f(N?"peakAlertPhasePeak":"peakAlertPhaseOffPeak")})})}catch{}},[a]),!o||o.peakEnabled!==!0)return null;let d=null;if(o.peakAlertEnabled===!0){const k=Date.parse(o.peakEffectiveAt||"");if(!(Number.isFinite(k)&&a<k)){const v=Xe(a,Array.isArray(o.peakWindows)?o.peakWindows:[],o.peakHolidays);if(v!==null){const N=o.peakAlertTarget==="peak"||o.peakAlertTarget==="offpeak"?o.peakAlertTarget:"both",C=Number(o.peakAlertAhead),w=(Number.isFinite(C)&&C>=1?C:2)*6e4;(N==="both"||N===(v.nextIntoPeak?"peak":"offpeak"))&&a>=v.nextAtMs-w&&a<v.nextAtMs&&l!==v.nextAtMs&&(d=v)}}}let c=null,m=!1,p=null;if(d!==null)c=d,m=d.nextIntoPeak===!0,p=()=>i(d.nextAtMs);else if(r!==null)c={nextAtMs:a+2*6e4,nextIntoPeak:r==="peak"},m=r==="peak",p=()=>u(null);else return null;const b=K(_(o.locale)),g=o.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 qn(t){const{config:s,t:o}=t,[a,n]=L(Date.now());ee(()=>{const u=window.setInterval(()=>n(Date.now()),3e4);return()=>window.clearInterval(u)},[]);const l=et(s,a);if(l===null)return null;const i=tt(l),r=l.nextIntoPeak?o("nextPeakIn",{time:he(l,a,o)}):o("nextOffPeakIn",{time:he(l,a,o)});return e(Z,{label:o(i.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"},o(i.chip)+" · "+r)))}function Un(t){const{config:s,t:o}=t,[a,n]=L(Date.now());ee(()=>{const u=window.setInterval(()=>n(Date.now()),3e4);return()=>window.clearInterval(u)},[]);const l=et(s,a);if(l===null)return null;const i=tt(l),r=l.nextIntoPeak?o("nextPeakIn",{time:he(l,a,o)}):o("nextOffPeakIn",{time:he(l,a,o)});return e(Z,{label:o(i.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"},o(i.chip)+" · "+r)))}function at(t,s,o){return e(s?.peakStyle==="classic"?Un:qn,{config:s,t:o})}function Hn(t){const{config:s,t:o}=t,[a,n]=L(Date.now());ee(()=>{const d=window.setInterval(()=>n(Date.now()),3e4);return()=>window.clearInterval(d)},[]);const l=et(s,a);if(l===null)return null;const i=tt(l),r=l.nextIntoPeak?o("nextPeakIn",{time:he(l,a,o)}):o("nextOffPeakIn",{time:he(l,a,o)}),u=[o(i.notice),r];return e(Z,{label:u,side:"right",delayMs:300},e("div",{className:"cm-peak-rail "+(l.weekend||l.holiday?"weekend":l.inPeak?"peak":"off"),"aria-label":u.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"},o(i.short))))}function In(t){const{config:s,t:o}=t,[a,n]=L(Date.now());ee(()=>{const d=window.setInterval(()=>n(Date.now()),3e4);return()=>window.clearInterval(d)},[]);const l=et(s,a);if(l===null)return null;const i=tt(l),r=l.nextIntoPeak?o("nextPeakIn",{time:he(l,a,o)}):o("nextOffPeakIn",{time:he(l,a,o)}),u=[o(i.notice),r];return e(Z,{label:u,side:"right",delayMs:300},e("div",{className:"cm-peak-rail-classic "+(l.weekend||l.holiday?"weekend":l.inPeak?"peak":"off"),"aria-label":u.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"},o(i.short))))}function jn(t,s,o){return e(s?.peakStyle==="classic"?In:Hn,{config:s,t:o})}function ka(t,s,o){const a=t.today,n=s.budget??{enabled:!1,amount:100,period:"month"},l=Number(s.exchangeRate),r=(t.budgetUsed??(n.period==="day"?W(t.today,s):n.period==="all"?W(t.total,s):W(t.month,s)))*(Number.isFinite(l)&&l>0?l:1),u=Math.max(0,Number(n.amount)||0),d=u>0?Math.min(999,r/u*100):null,c=de(d===null?null:Math.min(100,d),te(s,"budget")),m=W(a,s)*(Number.isFinite(l)&&l>0?l:1),p=u>0?Math.min(999,m/u*100):null,b=n.detail!==!1;return{level:d===null?"ok":d>=100?"over":d>=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"},o("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,s.hideTodayCost===!0?null:e("div",{className:"cm-bbox-line cm-num"},s.sidebarTodayMetric==="tokens"?o("today")+" "+Dt(a,s,o):o("todayShare",{amount:V(W(a,s),s),pct:p===null?"—":p.toFixed(1)+"%"})),e("div",{className:"cm-bbox-line cm-num"},o("usedOf",{used:se(r,s),amount:se(u,s)}))):null,at(t,s,o))}}function wa(t,s,o){const a=t.goQuota,n=s?.goQuota?.main==="weekly"||s?.goQuota?.main==="monthly"?s.goQuota.main:"rolling",l=a[n],i=l!==null&&typeof l?.percent=="number"?Math.max(0,Math.min(100,Number(l.percent)||0)):0,r=b=>b!==null&&typeof b?.percent=="number"?Math.round(Math.max(0,Math.min(100,b.percent)))+"%":"—",u=b=>o(b==="rolling"?"goShortRolling":b==="weekly"?"goShortWeekly":"goShortMonthly"),d=["rolling","weekly","monthly"].filter(b=>b!==n),c=l!==null&&typeof l?.resetsAt=="string"&&l.resetsAt.length>0?o("goResetAt",{time:new Date(l.resetsAt).toLocaleString()}):"",m=s?.goQuota?.detail!==!1,p=de(i,te(s,"go"));return{level:i>=100?"over":i>=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"},o("goQuotaRowLabel")+" "+u(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"},d.map(b=>u(b)+" "+r(a[b])).join(" · ")),c?e("div",{className:"cm-bbox-line"},c):null):null)}}function Qn(t){const{state:s,wide:o}=t,a=s.goQuota,n=K(_(s.config?.locale));if(!a||a.status!=="ok")return null;const l=s.config?.goQuota?.main==="weekly"||s.config?.goQuota?.main==="monthly"?s.config.goQuota.main:"rolling";if(a[l]===null||typeof a[l]?.percent!="number")return null;const i=wa(s,s.config,n),r=[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(Z,{label:r,side:"right",delayMs:300},e("div",{className:"cm-bbox"+(i.level==="ok"?"":" "+i.level)+(o?"":" rail")},o?i.body:e("div",{className:"cm-bbox-rail cm-num"},i.rail)))}function Fn(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 Fe(t){const s=t!==null&&typeof t=="object"?t:{};return{five:s["5h"]??null,seven:s["7d"]??s.week??s.weekly??null}}function xa(t,s,o=Date.now()){if(typeof t!="string"||!t)return"";const a=Date.parse(t);if(!Number.isFinite(a))return"";const n=a-o;if(n<=0)return s("resetReached");const l=Math.ceil(n/6e4),i=Math.floor(l/1440),r=Math.floor(l%1440/60),u=l%60;return i>0?s("resetDays",{d:i,h:r}):r>0?s("resetHours",{h:r,m:u}):s("resetMinutes",{m:u})}function _e(t,s,o=Date.now()){const a=xa(t?.resetsAt,s,o);return a?s("goResetAt",{time:new Date(t.resetsAt).toLocaleString()})+" ("+a+")":""}function nt(t,s,o){return t===null?"—":o(s==="remaining"?"quotaRemaining":"quotaUsed",{pct:t})}function st(t){const[,s]=L(0),o=()=>s(Date.now());return ee(()=>{if(!t)return;const a=setInterval(o,6e4);return()=>clearInterval(a)},[t]),{onMouseEnter:o,onFocus:o}}function We(t,s,o,a){const n=Fn(s),l=n===null?"ok":n>=100?"over":n>=80?"warn":"ok",i=de(n,o),r=s?.unlimited?"∞":i.label===null?"—":i.label+"%";return{level:l,pct:n,text:r,label:i.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:i.width+"%"}})),e("span",{className:"cm-bbox-pct cm-num"},r))}}function va(t){const{five:s,seven:o,fetchedAt:a,t:n,wide:l,refresh:i,direction:r="used"}=t,u=st(s?.resetsAt),d=xa(s?.resetsAt,n),c=We(n("codingPlanRemain5h"),s,r,n),m=We(n("codingPlanRemain7d"),o,r,n),p=c.level==="over"||m.level==="over"?"over":c.level==="warn"||m.level==="warn"?"warn":"ok",b=(N,C,w)=>{const f=C?.unlimited?n("quotaUnlimited"):nt(w.label,r,n),S=_e(C,n);return N+" "+f+(S?" · "+S:"")},g=[n("codingPlanMinimaxTitle"),b(n("codingPlanRemain5h"),s,c),b(n("codingPlanRemain7d"),o,m),a>0?n("goQuotaFetchedAt",{time:new Date(a).toLocaleTimeString()}):null,...i?ge(n,i):[]].filter(Boolean).join(`
|
|
3
3
|
`),k=e(E,null,e("div",{className:"cm-mm-title"},n("codingPlanMinimaxTitle")),c.row,m.row,d?e("div",{className:"cm-mm-reset"},"5h · "+d):null),v=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(Z,{label:e("span",{style:{whiteSpace:"pre-line"}},g),side:"right",delayMs:300},e("div",{...u,className:"cm-bbox cm-mm"+(p==="ok"?"":" "+p)+(l===!1?" rail":"")+(i?" clickable"+(i.busy?" busy":""):""),...i?me(i.busy,i.run):{}},l===!1?v:k))}function _n(t){const{state:s,wide:o,api:a}=t,n=s.codingPlans?.minimax,l=K(_(s.config?.locale)),i=Pe(a?()=>a.refreshCodingPlan("minimax"):null);if(!n||n.status!=="ok")return null;const{five:r,seven:u}=Fe(n.windows);return r==null&&u==null?null:e(va,{five:r,seven:u,fetchedAt:n.fetchedAt,t:l,wide:o,refresh:i,direction:te(s.config,"plan")})}const Wn="/plugins/dsh-openai-codex/auth/status",zn=168*3600;function Gn(t){if(t===null||typeof t!="object"||t.status!=="signed-in")return null;const s=t.usage!==null&&typeof t.usage=="object"?t.usage.rateLimits:null;if(!Array.isArray(s))return null;const o=s.find(r=>r!==null&&typeof r=="object"&&r.id==="codex");if(!o||!Array.isArray(o.windows))return null;const a=o.windows.find(r=>r!==null&&typeof r=="object"&&Number(r.windowSeconds)===zn);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),i=Number.isFinite(l)&&l>0?new Date(l*1e3).toISOString():"";return{weekly:{percent:n,resetsAt:i}}}const J={status:"idle",windows:{},fetchedAt:0,inFlight:null,listeners:[]},Kn=t=>(J.listeners.push(t),()=>{J.listeners=J.listeners.filter(s=>s!==t)}),Yn=()=>{for(const t of J.listeners)try{t()}catch{}};async function Pt(t=!1,s=!1){if(!s)return;if(J.inFlight!==null)return J.inFlight;if(!t&&J.fetchedAt>0&&Date.now()-J.fetchedAt<5*6e4)return;const o=(async()=>{try{const a=await fetch(Wn,{credentials:"same-origin",headers:{accept:"application/json"},signal:AbortSignal.timeout(8e3)});let n={};if(a.ok){const l=Gn(await a.json().catch(()=>null));l!==null&&(n=l)}J.status=Object.keys(n).length>0?"ok":"unavailable",J.windows=n}catch{J.status="unavailable"}finally{J.fetchedAt=Date.now(),J.inFlight=null,Yn()}})();return J.inFlight=o,o}function Mt(t){const[s,o]=L(()=>({status:J.status,windows:J.windows,fetchedAt:J.fetchedAt}));return ee(()=>{if(!t)return;let a=!0;const n=()=>{a&&o({status:J.status,windows:J.windows,fetchedAt:J.fetchedAt})},l=Kn(n);return n(),Pt(!1,!0),()=>{a=!1,l()}},[t]),s}function Vn(t){const s=st(),{state:o,wide:a}=t,n=K(_(o.config?.locale)),l=Mt(o.config?.codexQuotaEnabled===!0),i=Pe(()=>Pt(!0,o.config?.codexQuotaEnabled===!0));if(o.config?.codexQuotaEnabled!==!0||l.status!=="ok")return null;const r=l.windows.weekly??null;if(r===null)return null;const u=te(o.config,"plan"),d=We(n("goShortWeekly"),r,u,n),c=[n("codexQuotaTitle"),nt(d.label,u,n),_e(r,n),l.fetchedAt>0?n("goQuotaFetchedAt",{time:new Date(l.fetchedAt).toLocaleTimeString()}):null,...ge(n,i)].filter(Boolean).join(`
|
|
4
4
|
`),m=e(E,null,e("div",{className:"cm-mm-title"},n("codexQuotaTitle")),d.row),p=e("div",{className:"cm-bbox-rail cm-num"},d.label===null?"—":d.label+"%");return e(Z,{label:e("span",{style:{whiteSpace:"pre-line"}},c),side:"right",delayMs:300},e("div",{...s,className:"cm-bbox cm-mm clickable"+(d.level==="ok"?"":" "+d.level)+(a===!1?" rail":"")+(i.busy?" busy":""),...me(i.busy,i.run)},a===!1?p:m))}function Tt(t,s){return t==="fiveHour"||t==="5h"?"5h":t==="weekly"||t==="week"||t==="7d"?t==="7d"?"7d":s("goShortWeekly"):t==="monthly"||t==="month"?s("goShortMonthly"):t==="daily"||t==="day"?s("goShortDaily"):t==="plan"?s("mimoWindowPlan"):t==="compensation"?s("mimoWindowCompensation"):t==="balance"?s("codingPlanWindowBalance"):String(t).replace(/_/g," ")}function Jn(t){const s=st(),{id:o,state:a,wide:n,api:l}=t,i=a.codingPlans?.[o],r=K(_(a.config?.locale)),u=Pe(l?()=>l.refreshCodingPlan(o):null),d=Re.find(f=>f.id===o);if(!d||!i||i.status!=="ok")return null;const c=i.windows!==null&&typeof i.windows=="object"?i.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=te(a.config,"plan"),g=m.map(([f,S])=>{const h=p(S);if(h===null)return e("div",{key:f,className:"cm-mm-row wide"},e("span",{className:"cm-mm-text"},typeof S?.text=="string"?S.text:"—"));const T=h>=100?"over":h>=80?"warn":"ok",P=de(h,b);return e("div",{key:f,className:"cm-mm-row wide"+(T==="ok"?"":" "+T)},e("span",{className:"cm-bbox-label"},Tt(f,r)),e("div",{className:"cm-bbox-bar"},e("div",{className:"cm-bbox-fill",style:{width:P.width+"%"}})),e("span",{className:"cm-bbox-pct cm-num"},P.label===null?"—":P.label+"%"))}),k=m.map(([f,S])=>{const h=p(S),T=_e(S,r),P=h===null?typeof S?.text=="string"?S.text:"—":nt(de(h,b).label,b,r);return Tt(f,r)+" "+P+(T?" · "+T:"")});i.fetchedAt>0&&k.push(r("goQuotaFetchedAt",{time:new Date(i.fetchedAt).toLocaleTimeString()})),k.push(...ge(r,u));const v=[r(d.labelKey),...k].join(`
|
|
5
5
|
`),N=m.map(([,f])=>p(f)).filter(f=>f!==null),C=N.some(f=>f>=100)?"over":N.some(f=>f>=80)?"warn":"ok",w=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(Z,{label:e("span",{style:{whiteSpace:"pre-line"}},v),side:"right",delayMs:300},e("div",{...s,className:"cm-bbox cm-mm clickable"+(C==="ok"?"":" "+C)+(n===!1?" rail":"")+(u.busy?" busy":""),...me(u.busy,u.run)},n===!1?e("div",{className:"cm-bbox-rail cm-num"},w):e(E,null,e("div",{className:"cm-mm-title"},r(d.labelKey)),...g)))}const Na=t=>{try{return window.localStorage?.getItem?.("cm.gw."+t)??""}catch{return""}},Zn=(t,s)=>{try{window.localStorage?.setItem?.("cm.gw."+t,s)}catch{}};function $n(t){const s=st(),{source:o,snapshot:a,state:n,wide:l,api:i}=t,r=K(_(n.config?.locale)),[u,d]=L(()=>({source:o.id,id:Na(o.id)})),c=Pe(i?()=>i.refreshGatewayQuota(o.id):null),m=te(n.config,"plan"),p=a.accounts.length>1,b=u.source===o.id?u.id:Na(o.id),g=a.accounts.findIndex(D=>D.id===b),k=g>=0?g:Math.max(0,a.accounts.findIndex(D=>D.windows.length>0||D.credits!=null)),v=a.accounts[k]??a.accounts[0],N=v?.label||v?.id||"",C=D=>p?(Vt[D.provider]??D.provider)+" · ":"",w=p&&v?[v]:a.accounts,f=[];for(const D of w){if(f.length>=4)break;for(const G of D.windows){if(f.length>=4)break;const O=C(D)+(G.label||G.id||r("gatewaySourceUnknown"));f.push({win:G,name:O,view:We(O,G,m,r)})}D.windows.length===0&&D.credits!=null&&f.push({win:null,name:C(D)+(D.credits.unit||"credits"),text:(D.credits.used??"—")+" / "+(D.credits.limit??"—")})}f.length===0&&f.push({name:r("gatewayQuotaEmpty"),text:"—"});const S=f.some(D=>D.view?.level==="over")?"over":f.some(D=>D.view?.level==="warn")?"warn":"ok",h=f.map(D=>{if(D.text!=null)return D.name+" "+D.text;const G=_e(D.win,r);return D.name+" "+nt(D.view.label,m,r)+(G?" · "+G:"")});a.fetchedAt>0&&h.push(r("goQuotaFetchedAt",{time:new Date(a.fetchedAt).toLocaleTimeString()})),h.push(...ge(r,c));const P=[p&&N?`${o.label||o.id} (${k+1}/${a.accounts.length} · ${N})`:o.label||o.id,...h].join(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-cost-meter",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.44",
|
|
4
4
|
"description": "DeepSeek Harness 会话费用统计插件:本会话成本、当日费用、历史记录与官方价格同步,支持多厂商多模型价格计费(内置 90+ 模型价格目录与自动匹配)、主流 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 90+ model 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",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"0.1.2-rc.1": "compatible",
|
|
37
37
|
"0.1.3-alpha.1": "unknown",
|
|
38
38
|
"0.1.3-alpha.2": "compatible",
|
|
39
|
-
"0.1.5-alpha.1": "compatible"
|
|
39
|
+
"0.1.5-alpha.1": "compatible",
|
|
40
|
+
"0.2.0-rc.1": "compatible"
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
},
|
|
@@ -99,8 +100,8 @@
|
|
|
99
100
|
"zod": "4.5.1"
|
|
100
101
|
},
|
|
101
102
|
"peerDependencies": {
|
|
102
|
-
"@deepseek-ai/dsh-credentials": "^0.1.0-rc.6 || ^0.1.1-0 || ^0.1.2-0 || ^0.1.3-0 || ^0.1.5-0",
|
|
103
|
-
"@deepseek-ai/dsh-home-paths": "^0.1.0-rc.6 || ^0.1.1-0 || ^0.1.2-0 || ^0.1.3-0 || ^0.1.5-0"
|
|
103
|
+
"@deepseek-ai/dsh-credentials": "^0.1.0-rc.6 || ^0.1.1-0 || ^0.1.2-0 || ^0.1.3-0 || ^0.1.5-0 || >=0.2.0-rc.1 <0.3.0-0",
|
|
104
|
+
"@deepseek-ai/dsh-home-paths": "^0.1.0-rc.6 || ^0.1.1-0 || ^0.1.2-0 || ^0.1.3-0 || ^0.1.5-0 || >=0.2.0-rc.1 <0.3.0-0"
|
|
104
105
|
},
|
|
105
106
|
"repository": {
|
|
106
107
|
"type": "git",
|