dsh-all-usage 1.2.2 → 1.2.4
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/CHANGELOG.md +40 -0
- package/README.de.md +316 -0
- package/README.en.md +52 -14
- package/README.es.md +316 -0
- package/README.fr.md +316 -0
- package/README.ja.md +316 -0
- package/README.md +55 -17
- package/README.pt.md +316 -0
- package/README.ru.md +316 -0
- package/assets/cover-en.png +0 -0
- package/assets/cover-zh.png +0 -0
- package/assets/readme-architecture-en.svg +95 -95
- package/assets/readme-architecture-zh.svg +95 -95
- package/assets/readme-sync-en.svg +81 -81
- package/assets/readme-sync-zh.svg +81 -81
- package/assets/screenshots/en/01-overview.png +0 -0
- package/assets/screenshots/en/02-trend-bars.png +0 -0
- package/assets/screenshots/en/02-trend.png +0 -0
- package/assets/screenshots/en/03-heatmap.png +0 -0
- package/assets/screenshots/en/04-model-stats.png +0 -0
- package/assets/screenshots/en/05-request-logs.png +0 -0
- package/assets/screenshots/en/06-cost-settings.png +0 -0
- package/assets/screenshots/en/07-maintenance.png +0 -0
- package/assets/screenshots/zh/01-overview.png +0 -0
- package/assets/screenshots/zh/02-trend-bars.png +0 -0
- package/assets/screenshots/zh/02-trend.png +0 -0
- package/assets/screenshots/zh/03-heatmap.png +0 -0
- package/assets/screenshots/zh/04-model-stats.png +0 -0
- package/assets/screenshots/zh/05-request-logs.png +0 -0
- package/assets/screenshots/zh/06-cost-settings.png +0 -0
- package/assets/screenshots/zh/07-maintenance.png +0 -0
- package/lib/archive.js +399 -0
- package/lib/client.js +1 -1
- package/lib/http.js +27 -1
- package/lib/ledger.js +362 -54
- package/package.json +10 -1
- package/screenshots.json +7 -9
- package/scripts/archive-ledger.mjs +156 -0
- package/assets/screenshots/en/04-model-usage.png +0 -0
- package/assets/screenshots/zh/04-model-usage.png +0 -0
package/lib/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
window.__ModuleLoader__.load({id:"dsh-all-usage",factory:e=>{var t={},a=t;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"});const n=e("react");let r=null;try{r=e("react-dom")||null}catch(e){r=null}const i="1.2.2";function l(e){return String(e).padStart(2,"0")}let o="none";function s(){o="none";try{const e="undefined"==typeof localStorage?null:localStorage.getItem("dsh-all-usage:topInset");if(null!==e&&""!==e){const t=Number(e);if(Number.isFinite(t)&&t>=0)return o="stored",Math.round(t)}}catch(e){}try{const e="undefined"==typeof document?null:document.documentElement;if(null!==e&&e.hasAttribute("data-windows-titlebar")){const t=Number.parseFloat(window.getComputedStyle(e).getPropertyValue("--dsh-windows-titlebar-height"));return o="titlebar-marker",Number.isFinite(t)&&t>0?Math.round(t):40}}catch(e){}try{const e="undefined"==typeof navigator?void 0:navigator.windowControlsOverlay;if(null!=e&&!0===e.visible){const t=e.getTitlebarAreaRect();if(null!=t&&Number.isFinite(t.height)&&t.height>0)return o="overlay",Math.round(t.height)}}catch(e){}const e="undefined"==typeof navigator?"":String(navigator.userAgent||"");return/Electron/i.test(e)?(o="electron-ua",40):/QtWebEngine/i.test(e)?(o="qtwebengine-ua",40):0}function c(){try{const e="undefined"==typeof navigator?void 0:navigator.windowControlsOverlay;let t="none";null!=e&&(t=!0===e.visible?String((e.getTitlebarAreaRect()||{}).height):"hidden");const a="undefined"==typeof navigator?"":String(navigator.userAgent||"").slice(0,180),n=e=>{try{const t=document.querySelector(e);if(null===t)return"none";const a=t.getBoundingClientRect();return[a.top,a.left,a.width,a.height].map(e=>Math.round(e)).join("/")}catch(e){return"none"}},r="undefined"==typeof document?null:document.documentElement,i=null!==r&&r.hasAttribute("data-windows-titlebar")?String(window.getComputedStyle(r).getPropertyValue("--dsh-windows-titlebar-height")).trim()||"set":"none",l="undefined"==typeof window?"":Math.round(window.innerWidth)+"x"+Math.round(window.innerHeight),c="ua="+encodeURIComponent(a)+"&wco="+encodeURIComponent(t)+"&inset="+String(s())+"&src="+encodeURIComponent(o)+"&tb="+encodeURIComponent(i)+"&vp="+encodeURIComponent(l)+"&modal="+encodeURIComponent(n(".uh-side-modal"))+"&dlg="+encodeURIComponent(n(".uh-side-dialog"))+"&head="+encodeURIComponent(n(".uh-side-dialog-head"))+"&close="+encodeURIComponent(n(".uh-close-button"));fetch("/api/all-usage/client-env?"+c,{headers:{accept:"application/json"}}).catch(()=>{})}catch(e){}}function u(e,t){const a=t?e.getUTCFullYear():e.getFullYear(),n=t?e.getUTCMonth():e.getMonth(),r=t?e.getUTCDate():e.getDate();return a+"-"+l(n+1)+"-"+l(r)}function d(e,t,a){return a?new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+t)):new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)}function p(e,t){if("string"!=typeof e||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;const a=Number(e.slice(0,4)),n=Number(e.slice(5,7)),r=Number(e.slice(8,10)),i=t?new Date(Date.UTC(a,n-1,r)):new Date(a,n-1,r);return Number.isFinite(i.getTime())&&u(i,t)===e}function m(e,t){if(null===e||"object"!=typeof e)return null;const a=e.start,n=e.end;return!p(a,t)||!p(n,t)||a>n?null:{start:a,end:n}}function h(e,t){let a=t;if(Array.isArray(e))for(const n of e)n&&p(n.date,!0)&&n.date<=t&&n.date<a&&(a=n.date);return{min:a,max:t}}function g(){let e=0;return{next:()=>(e+=1,e),isCurrent:t=>t===e}}function b(e){if(null===e||"object"!=typeof e)return null;const t="string"==typeof e.instanceId?e.instanceId:"",a="number"==typeof e.revision&&Number.isFinite(e.revision)?e.revision:null;return""===t||null===a?null:t+":"+a}function f(e,t,a){const n=e&&"object"==typeof e?e[t]:void 0;return"number"==typeof n&&Number.isFinite(n)?n:a}function y(e){return null!==e&&"object"==typeof e&&["dataRevision","metadataRevision","scanRevision","pricingRevision"].every(t=>null!==f(e,t,null))}function x(e){if(null===e||"object"!=typeof e||"string"!=typeof e.instanceId||""===e.instanceId)return null;if("string"==typeof e.queryRevision&&""!==e.queryRevision)return e.instanceId+":"+e.queryRevision;const t=f(e,"dataRevision",f(e,"revision",null)),a=f(e,"pricingRevision",0);return null===t?null:e.instanceId+":"+t+":"+a}function v(e){return String(Math.round(10*e)/10)}function w(e){return"number"==typeof e&&Number.isFinite(e)?e<1e3?String(e):e<1e6?v(e/1e3)+"k":e<1e9?v(e/1e6)+"M":v(e/1e9)+"B":"0"}function k(e,t){return"number"==typeof e&&Number.isFinite(e)?Math.round(e).toLocaleString("en"===t?"en-US":"zh-CN"):"0"}function E(e,t){const a=e+t;return a<=0?0:t/a*100}c();const N={edit:{path:"M12.2 3.4l2.4 2.4M4 16l2.8-.6L15 7.2a1.7 1.7 0 0 0-2.4-2.4L4.4 13z"},export:{path:"M12 3v11M8 7l4-4 4 4M5 13v5h14v-5"},refresh:{path:"M19 9a7 7 0 1 0 1.1 5.2M19 4v5h-5"},close:{path:"M6 6l12 12M18 6L6 18"},chart:{path:"M4 19V5M4 19h16M7 15l3-4 3 2 5-7"},list:{path:"M6 6h12M6 12h12M6 18h12",circle:{cx:3.5,cy:6,r:1.2}},cache:{path:"M12 4l7 4-7 4-7-4 7-4zM5 12l7 4 7-4M5 16l7 4 7-4"},wallet:{path:"M4 7.5A2.5 2.5 0 0 1 6.5 5H18v14H6.5A2.5 2.5 0 0 1 4 16.5zM4 8h14M14 13h.01"},clock:{path:"M12 6v6l4 2M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0z"},folder:{path:"M3.5 7.5h6l2 2h9v8.5a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2z"},language:{path:"M4 12h16M12 4c2.1 2.2 3.2 4.9 3.2 8S14.1 17.8 12 20M12 4C9.9 6.2 8.8 8.9 8.8 12s1.1 5.8 3.2 8",circle:{cx:12,cy:12,r:8}},chevron:{path:"M7 10l5 5 5-5"},check:{path:"M5 12.5l4.2 4.1L19 7.3"},plus:{path:"M12 5v14M5 12h14"},calendar:{path:"M6 4v3M18 4v3M4 9h16M5 6h14a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z"}};function C(e){const t=e.size||16,a={fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"},r=void 0===e.name?"chart":e.name,i=void 0===N[r]?N.chart:N[r],l=[];return void 0!==i.path&&l.push(n.createElement("path",{key:"p",d:i.path,...a})),void 0!==i.circle&&l.push(n.createElement("circle",{key:"c",cx:i.circle.cx,cy:i.circle.cy,r:i.circle.r,...a})),n.createElement("svg",{className:"uh-line-icon "+(e.className||""),width:t,height:t,viewBox:"0 0 24 24","aria-hidden":!0},l)}const M=[{key:"deepseek",label:"DeepSeek",providers:["deepseek","deepseek-official"],prefixes:["deepseek-","deepseek"],exact:[],href:"/api/all-usage/icon?key=deepseek&v=1.2.2"},{key:"openai",label:"OpenAI",providers:["openai","azure-openai"],prefixes:["gpt-","o1-","o3-","o4-","o5-","codex-","gpt"],exact:["o1","o3","o4","o5"],href:"/api/all-usage/icon?key=openai&v=1.2.2"},{key:"claude",label:"Anthropic Claude",providers:["anthropic"],prefixes:["claude-","claude"],exact:[],href:"/api/all-usage/icon?key=claude&v=1.2.2"},{key:"gemini",label:"Google Gemini",providers:["google","google-vertex","vertex"],prefixes:["gemini-","gemma-","gemma","gemini"],exact:[],href:"/api/all-usage/icon?key=gemini&v=1.2.2"},{key:"meta",label:"Meta Llama",providers:["meta","meta-llama"],prefixes:["llama-","meta-llama","llama"],exact:[],href:"/api/all-usage/icon?key=meta&v=1.2.2"},{key:"zhipu",label:"Zhipu GLM",providers:["zhipu","zhipuai","zai","bigmodel"],prefixes:["glm-","chatglm-","glm","chatglm"],exact:[],href:"/api/all-usage/icon?key=zhipu&v=1.2.2"},{key:"grok",label:"xAI Grok",providers:["xai"],prefixes:["grok-","grok"],exact:["grok"],href:"/api/all-usage/icon?key=grok&v=1.2.2"},{key:"qwen",label:"Qwen",providers:["qwen","alibaba","dashscope","bailian"],prefixes:["qwen","qwq-","qvq-"],exact:[],href:"/api/all-usage/icon?key=qwen&v=1.2.2"},{key:"doubao",label:"Doubao",providers:["doubao","bytedance","volcengine","ark"],prefixes:["doubao-","doubao"],exact:[],href:"/api/all-usage/icon?key=doubao&v=1.2.2"},{key:"kimi",label:"Moonshot Kimi",providers:["moonshot","moonshotai"],prefixes:["kimi-","moonshot-","kimi","moonshot"],exact:["kimi"],href:"/api/all-usage/icon?key=kimi&v=1.2.2"},{key:"minimax",label:"MiniMax",providers:["minimax"],prefixes:["minimax-","abab","minimax"],exact:[],href:"/api/all-usage/icon?key=minimax&v=1.2.2"},{key:"mistral",label:"Mistral",providers:["mistral","mistralai"],prefixes:["mistral-","mistralai-","magistral-","codestral-","devstral-","ministral-","pixtral-","mixtral-","open-mistral-","open-mixtral-"],exact:[],href:"/api/all-usage/icon?key=mistral&v=1.2.2"},{key:"nemotron",label:"NVIDIA",providers:["nvidia","nvidia-nim"],prefixes:["nemotron"],exact:[],href:"/api/all-usage/icon?key=nemotron&v=1.2.2"},{key:"cohere",label:"Cohere",providers:["cohere"],prefixes:["command-","north-","c4ai-"],exact:[],href:"/api/all-usage/icon?key=cohere&v=1.2.2"},{key:"nova",label:"Amazon Nova",providers:["amazon","amazon-bedrock","bedrock","aws-bedrock"],prefixes:["nova-","amazon.nova-"],exact:[],href:"/api/all-usage/icon?key=nova&v=1.2.2"},{key:"phi",label:"Microsoft",providers:["microsoft","azure","azure-ai","azure-cognitive-services"],prefixes:["phi-","microsoft/"],exact:[],href:"/api/all-usage/icon?key=phi&v=1.2.2"},{key:"sonar",label:"Perplexity",providers:["perplexity","perplexity-ai"],prefixes:["sonar"],exact:[],href:"/api/all-usage/icon?key=sonar&v=1.2.2"},{key:"ernie",label:"Baidu ERNIE",providers:["baidu","qianfan","baiducloud"],prefixes:["ernie-","wenxin"],exact:[],href:"/api/all-usage/icon?key=ernie&v=1.2.2"},{key:"hunyuan",label:"Tencent Hunyuan",providers:["hunyuan"],prefixes:["hunyuan-","hy3","hy4"],exact:[],href:"/api/all-usage/icon?key=hunyuan&v=1.2.2"},{key:"tencent",label:"Tencent",providers:["tencent","tencentcloud","tencent-hunyuan"],prefixes:[],exact:[],href:"/api/all-usage/icon?key=tencent&v=1.2.2"},{key:"stepfun",label:"StepFun",providers:["stepfun","step"],prefixes:["step-","stepfun-"],exact:[],href:"/api/all-usage/icon?key=stepfun&v=1.2.2"},{key:"baichuan",label:"Baichuan",providers:["baichuan"],prefixes:["baichuan"],exact:[],href:"/api/all-usage/icon?key=baichuan&v=1.2.2"},{key:"sensenova",label:"SenseNova",providers:["sensenova","sensetime"],prefixes:["sensenova","sensechat"],exact:[],href:"/api/all-usage/icon?key=sensenova&v=1.2.2"},{key:"internlm",label:"InternLM",providers:["internlm","shanghai-ai-lab"],prefixes:["internlm","intern-lm"],exact:[],href:"/api/all-usage/icon?key=internlm&v=1.2.2"},{key:"longcat",label:"LongCat",providers:["longcat","meituan"],prefixes:["longcat"],exact:[],href:"/api/all-usage/icon?key=longcat&v=1.2.2"},{key:"jamba",label:"AI21",providers:["ai21","ai21-labs"],prefixes:["jamba"],exact:[],href:"/api/all-usage/icon?key=jamba&v=1.2.2"},{key:"granite",label:"IBM Granite",providers:["ibm","ibm-granite","watsonx"],prefixes:["granite-"],exact:[],href:"/api/all-usage/icon?key=granite&v=1.2.2"},{key:"solar",label:"Upstage",providers:["upstage"],prefixes:["solar-"],exact:[],href:"/api/all-usage/icon?key=solar&v=1.2.2"},{key:"lfm",label:"Liquid AI",providers:["liquid","liquid-ai"],prefixes:["lfm-"],exact:[],href:"/api/all-usage/icon?key=lfm&v=1.2.2"},{key:"olmo",label:"Ai2",providers:["ai2","allenai"],prefixes:["olmo","molmo"],exact:[],href:"/api/all-usage/icon?key=olmo&v=1.2.2"},{key:"bge",label:"BAAI",providers:["baai","bge"],prefixes:["bge-"],exact:[],href:"/api/all-usage/icon?key=bge&v=1.2.2"},{key:"voyage",label:"Voyage AI",providers:["voyage","voyageai"],prefixes:["voyage-"],exact:[],href:"/api/all-usage/icon?key=voyage&v=1.2.2"},{key:"bytedance",label:"ByteDance Seed",providers:["bytedance","seed","volcengine","ark"],prefixes:["seed-","seed1-","seed2-"],exact:[],href:"/api/all-usage/icon?key=bytedance&v=1.2.2"},{key:"kling",label:"Kling",providers:["kling","kuaishou"],prefixes:["kling"],exact:[],href:"/api/all-usage/icon?key=kling&v=1.2.2"},{key:"skywork",label:"Skywork",providers:["skywork"],prefixes:["skywork"],exact:[],href:"/api/all-usage/icon?key=skywork&v=1.2.2"},{key:"mimo",label:"Xiaomi MiMo",providers:["xiaomimimo","xiaomi","mimo"],prefixes:["mimo-"],exact:[],href:"/api/all-usage/icon?key=mimo&v=1.2.2"},{key:"aion",label:"Aion Labs",providers:["aion-labs","aionlabs"],prefixes:["aion-"],exact:[],href:"/api/all-usage/icon?key=aion&v=1.2.2"},{key:"nous",label:"Nous Research",providers:["nousresearch","nous","nous-research"],prefixes:["nous-","hermes-3","hermes-4"],exact:[],href:"/api/all-usage/icon?key=nous&v=1.2.2"},{key:"falcon",label:"TII Falcon",providers:["tii","falcon","tii-uae"],prefixes:["falcon-"],exact:[],href:"/api/all-usage/icon?key=falcon&v=1.2.2"},{key:"aleph",label:"Aleph Alpha",providers:["aleph-alpha","alephalpha"],prefixes:["aleph-","pharia-"],exact:[],href:"/api/all-usage/icon?key=aleph&v=1.2.2"},{key:"yandex",label:"Yandex",providers:["yandex","yandex-cloud"],prefixes:["yandex-","yandexgpt"],exact:[],href:"/api/all-usage/icon?key=yandex&v=1.2.2"},{key:"arctic",label:"Snowflake",providers:["snowflake"],prefixes:["snowflake-","arctic-"],exact:[],href:"/api/all-usage/icon?key=arctic&v=1.2.2"},{key:"iflytek",label:"iFlytek Spark",providers:["iflytek","iflytekcloud","spark"],prefixes:["spark-","generalv"],exact:[],href:"/api/all-usage/icon?key=iflytek&v=1.2.2"}],S=Array.isArray(M)?M:[],A=new Map(S.map(e=>[e.key,e])),z=new Map;function T(e){const t=String(e??"").trim(),a=t.lastIndexOf("/");if(a<=0||a>=t.length-1)return t;const n=t.slice(0,a);if(!/^[a-z0-9][a-z0-9._-]*$/i.test(n))return t;const r=t.slice(a+1).trim();return""===r?t:r}function R(e){const t="string"==typeof e?e.trim().toLowerCase():"";if(""===t)return null;for(const e of S)if(e.providers.includes(t))return e;return null}function I(e,t){if(""===t||!e.startsWith(t))return!1;if(e.length===t.length)return!0;if(/[-_.:\/]$/.test(t))return!0;const a=e.charAt(t.length);return"-"===a||"_"===a||"."===a||":"===a||"/"===a||/[a-z]$/.test(t)&&/[0-9]/.test(a)}const j=["openai","google","anthropic","databricks","azure","azure-ai","microsoft","amazon","cohere","mistral","deepseek","qwen","moonshot","zhipu","bytedance","nvidia","ibm","ai21","upstage","voyage","baai","ai2","liquid","sensenova","internlm","longcat","stepfun","baichuan","tencent","kling","skywork","duo-chat","bedrock","vertex"];function D(e){for(const t of S)if(t.exact.includes(e))return t;let t=null,a=0;for(const n of S)for(const r of n.prefixes)I(e,r)&&r.length>a&&(t=n,a=r.length);return t}function F(e){const t=function(e){if("string"!=typeof e)return"";let t=e.trim().toLowerCase();const a=t.lastIndexOf("/");return a>=0&&(t=t.slice(a+1)),t.split(":")[0].replace(/@/g,"-").trim()}(e);if(""===t)return null;for(const e of function(e){const t=[e];let a=e.indexOf(".");for(;a>0&&a<e.length-3;){const n=e.slice(a+1);n.length>=3&&t.push(n),a=e.indexOf(".",a+1)}for(const a of j){if(!e.startsWith(a+"-"))continue;const n=e.slice(a.length+1).replace(/^[-_.]+/,"");n.length>=3&&t.push(n)}return t}(t)){const t=D(e);if(null!==t)return t}return null}function U(e){if(0===S.length||null===e||"object"!=typeof e)return null;const t="string"==typeof e.actualModel?e.actualModel:"",a="string"==typeof e.requestedModel?e.requestedModel:"",n="string"==typeof e.model?e.model:"",r="string"==typeof e.provider?e.provider:"",i=t+"\0"+a+"\0"+n+"\0"+r;if(z.has(i))return z.get(i);const l=n.includes(" / ")?n.slice(n.indexOf(" / ")+3):n;let o=F(""!==t?t:a);if(null===o&&""===t&&""===a){const e=R(r),t=F(l);o=null===e||null!==t&&t!==e?t:e}return z.size>=2e3&&z.clear(),z.set(i,o),o}function W(e){if(!Array.isArray(e)||0===e.length)return null;let t=null;for(const a of e){const e=U(a);if(null===e)return null;if(null===t)t=e;else if(t!==e)return null}return t}function O(e,t){if("en"===t||"number"!=typeof e||!Number.isFinite(e)||e<1e4)return"";const a=e>=1e8?e/1e8:e/1e4,n=Math.round(1e3*a)/1e3;return String(n)+(e>=1e8?"亿":"万")}function L(e,t,a){const r=O(t,a);return n.createElement(n.Fragment,null,e,r?n.createElement("span",{className:"uh-unit"},r):null)}function P(e,t,a,n){if(null==t)return"—";const r="CNY"===e?"¥":"USD"===e?"$":e+" ",i=Number.isFinite(n)?n:4;return r+t.toLocaleString("en"===a?"en-US":"zh-CN",{minimumFractionDigits:i,maximumFractionDigits:i})}function K(e){const t=("number"==typeof e?String(e):"string"==typeof e?e.trim().toLowerCase():"").match(/^(\d+)(?:\.(\d+))?(?:e([+-]?\d+))?$/);if(!t)return{digits:0n,scale:0};let a=(t[1]||"")+(t[2]||""),n=(t[2]||"").length-(t[3]?Number(t[3]):0);for(n<0&&(a+="0".repeat(-n),n=0),n>a.length&&(a="0".repeat(n-a.length+1)+a);n>0&&a.length>1&&a.endsWith("0");)a=a.slice(0,-1),n-=1;return{digits:BigInt(a.replace(/^0+(?=\d)/,"")||"0"),scale:n}}function q(e){const t=K(e);if(0n===t.digits)return"0";const a=t.digits.toString();if(0===t.scale)return a;const n=a.padStart(t.scale+1,"0"),r=n.length-t.scale;return n.slice(0,r)+"."+n.slice(r)}function B(e,t){const a=K(e),n=K(t),r=Math.max(a.scale,n.scale);return q((a.digits*10n**BigInt(r-a.scale)+n.digits*10n**BigInt(r-n.scale)).toString()+(r>0?"e-"+r:""))}function H(){return{currency:"USD",input:"0",output:"0",cacheRead:"0",cacheWrite:"0",baseTotal:"0",total:"0",pricedCalls:0,unpricedCalls:0,ambiguousCalls:0,unsupportedCalls:0}}function Y(e){const t=e&&e.cost&&"object"==typeof e.cost?e.cost:e&&"object"==typeof e?e:{},a={currency:"USD",input:"0",output:"0",cacheRead:"0",cacheWrite:"0",baseTotal:"0",total:"0",pricedCalls:0,unpricedCalls:0,ambiguousCalls:0,unsupportedCalls:0};if(a.currency="string"==typeof t.currency&&""!==t.currency?t.currency:"USD",t.breakdown&&"object"==typeof t.breakdown)return"priced"===t.status?(a.input=q(t.breakdown.input),a.output=q(t.breakdown.output),a.cacheRead=q(t.breakdown.cacheRead),a.cacheWrite=q(t.breakdown.cacheWrite),a.baseTotal=q(t.baseTotal),a.total=q(t.total),a.pricedCalls=1):"ambiguous"===t.status?a.ambiguousCalls=1:"unsupported"===t.status?a.unsupportedCalls=1:a.unpricedCalls=1,a;for(const e of["input","output","cacheRead","cacheWrite","baseTotal","total"])a[e]=q(t[e]);for(const e of["pricedCalls","unpricedCalls","ambiguousCalls","unsupportedCalls"])a[e]=Number.isFinite(t[e])?t[e]:0;return a}function V(e,t){const a=Y(t);for(const t of["input","output","cacheRead","cacheWrite","baseTotal","total"])e[t]=B(e[t],a[t]);return e.pricedCalls+=a.pricedCalls,e.unpricedCalls+=a.unpricedCalls,e.ambiguousCalls+=a.ambiguousCalls,e.unsupportedCalls+=a.unsupportedCalls,e}function G(e,t){const a=Y(e);if(a.pricedCalls<=0)return"—";const n=Number(a.total);return Number.isFinite(n)?P(a.currency,n,t):a.currency+" "+a.total}function J(e,t){const a=e&&e.cost&&"object"==typeof e.cost?e.cost:{},n=[];return a.pricingPolicyId&&n.push(a.pricingPolicyId),"UTC"===a.pricingTimezone&&Number.isFinite(a.pricingAt)&&n.push(("en"===t?"at ":"计费时刻 ")+new Date(a.pricingAt).toISOString().slice(0,16).replace("T"," ")+" UTC"),n.length>0?n.join(" · "):null}function _(e){const t=e&&e.config&&"object"==typeof e.config?e.config:{},a=t.sync&&"object"==typeof t.sync?t.sync:{};return{sync:{autoEnabled:!0===a.autoEnabled,intervalMs:Number.isFinite(a.intervalMs)?a.intervalMs:216e5},providerAliases:t.providerAliases&&"object"==typeof t.providerAliases?Object.assign({},t.providerAliases):{},mappings:Array.isArray(t.mappings)?t.mappings.map(e=>Object.assign({},e)):[],overrides:Array.isArray(t.overrides)?t.overrides.map(e=>Object.assign({},e,{tiers:Array.isArray(e.tiers)?e.tiers.map(e=>Object.assign({},e)):[]})):[]}}function $(e){const t=new Map,a=e&&Array.isArray(e.tierSchedules)?e.tierSchedules:[];for(const e of a)e&&"string"==typeof e.id&&Array.isArray(e.tiers)&&t.set(e.id,e.tiers);return e&&Array.isArray(e.usedModels)?e.usedModels.map(e=>{const a=e&&"string"==typeof e.tierScheduleId?t.get(e.tierScheduleId):null,n=Array.isArray(a)?a:e&&Array.isArray(e.tiers)?e.tiers:[];return Object.assign({},e,{tiers:n.map(e=>Object.assign({},e))})}):[]}function X(e,t){const a=_(t);if(null===e||"object"!=typeof e)return a;const n=_({config:e});return Object.assign({},a,{providerAliases:n.providerAliases,mappings:n.mappings,overrides:n.overrides})}function Z(e,t){const a={priced:["已计价","priced"],unpriced:["未计价","unpriced"],ambiguous:["待确认","ambiguous"],unsupported:["不支持","unsupported"]},n=a[e]||a.unpriced;return"en"===t?n[1]:n[0]}function Q(e,t){const a={fresh:["Fresh:输入 + 缓存读写","Fresh: input + cache read/write"],total:["Total:输入已含缓存","Total: input already includes cache"],legacy:["Legacy:输入 + 缓存写","Legacy: input + cache write"]},n=a[e]||a.fresh;return"en"===t?n[1]:n[0]}function ee(e,t,a){const n=Array.isArray(e)?e:[];if(t<0)return n.length>0?"≤ "+k(n[0].size,a):"en"===a?"All contexts":"全部上下文";const r=n[t];if(!r)return"";const i="> "+k(r.size,a),l=n[t+1];return l?i+("en"===a?" and ≤ ":" 且 ≤ ")+k(l.size,a):i}function te(e){const t=String(e??"").trim().toLowerCase();if(""===t||t.length>128)return!1;const a=t.match(/^(\d+)(?:\.(\d+))?(?:e([+-]?\d+))?$/);if(!a)return!1;const n=a[3]?Number(a[3]):0;if(!Number.isSafeInteger(n)||Math.abs(n)>24)return!1;let r=(a[1]||"")+(a[2]||""),i=(a[2]||"").length-n;return r=r.replace(/^0+(?=\d)/,""),i<0&&(r+="0".repeat(-i),i=0),i>r.length&&(r="0".repeat(i-r.length+1)+r),r.length<=40}function ae(e,t){const a=Number(e&&e.size);return!(!e||"context"!==e.type||!Number.isSafeInteger(a)||a<=t||a>1e9)&&["input","output","cacheRead","cacheWrite"].every(t=>te(e[t]))}function ne(e){return null==e||""===e?"0":String(e)}function re(e,t){const a={input:["输入 / 1M","Input / 1M"],output:["输出 / 1M","Output / 1M"],cacheRead:["缓存读 / 1M","Cache read / 1M"],cacheWrite:["缓存写 / 1M","Cache write / 1M"]},n=a[e]||a.input;return"en"===t?n[1]:n[0]}function ie(e){const t=null!==e&&"object"==typeof e?e:{};return String(t.providerId||"").trim().toLowerCase()+"|"+String(t.modelId||"").trim().toLowerCase()}function le(e,t){const a=Array.isArray(e)?e:[],n=ie(t);for(let e=0;e<a.length;e+=1){const t=a[e];if(null!==t&&"object"==typeof t&&ie({providerId:t.providerId,modelId:t.modelId})===n)return e}return-1}function oe(e,t){const a=Array.isArray(e)?e:[],n=String(t||"").trim();if(""===n)return-1;for(let e=0;e<a.length;e+=1){const t=a[e];if(null!==t&&"object"==typeof t&&String(t.identityKey||t.usageIdentityKey||"").trim()===n)return e}return-1}const se=new WeakMap;function ce(e,t,a){const n=null!==e&&"object"==typeof e?e:{sync:{},mappings:[],overrides:[]},r=Array.isArray(n.overrides)?n.overrides.map(e=>Object.assign({},e)):[];let i=le(r,t.basis);if(i<0){const e=null!==t.rates&&"object"==typeof t.rates?t.rates:{},a=Array.isArray(t.tiers)?t.tiers.map(e=>Object.assign({},e)):[];r.push({providerId:t.basis.providerId||"",modelId:t.basis.modelId,displayName:t.model||t.basis.modelId,input:ne(e.input),output:ne(e.output),cacheRead:ne(e.cacheRead),cacheWrite:ne(e.cacheWrite),tiered:a.length>0,tiers:a}),i=r.length-1}return r[i]=Object.assign({},r[i],a),Object.assign({},n,{overrides:r})}function ue(e){const t=String(e??"").trim().match(/^([0-9]{1,2}):([0-9]{1,2})$/);if(null===t)return null;const a=Number(t[1]),n=Number(t[2]);if(!Number.isInteger(a)||!Number.isInteger(n)||n<0||n>59)return null;const r=60*a+n;return r<0||r>1440?null:r}function de(e){const t=Number(e);return!Number.isFinite(t)||t<0||t>1440?"":String(Math.floor(t/60)).padStart(2,"0")+":"+String(t%60).padStart(2,"0")}function pe(e){return"en"===e?0:480}function me(e,t){const a=Number.isFinite(t)?Math.trunc(t):0;if(0===a||!Array.isArray(e))return e;const n=[];for(const t of e){const e=new Map;for(const n of t.windows){const r=n.endMinute+a;let i=n.startMinute+a;for(;i<r;){const a=Math.floor(i/1440),n=i-1440*a,l=Math.min(r-1440*a,1440),o=t.weekdays.map(e=>((e+a)%7+7)%7).sort((e,t)=>e-t),s=o.join(",");let c=e.get(s);void 0===c&&(c={weekdays:o,windows:[]},e.set(s,c)),c.windows.push({startMinute:n,endMinute:l}),i+=l-n}}let r=0;for(const a of e.values())a.windows.sort((e,t)=>e.startMinute-t.startMinute),n.push({id:1===e.size?t.id:t.id+"-"+(r+1),weekdays:a.weekdays,windows:a.windows,rates:t.rates}),r+=1}return n}function he(e,t=0){const a=String(e??"").trim();if(""===a)return 0;const n=a.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/);if(null===n)return null;const r=Number(n[1]),i=Number(n[2]),l=Number(n[3]),o=Date.UTC(r,i-1,l),s=new Date(o);return s.getUTCFullYear()!==r||s.getUTCMonth()!==i-1||s.getUTCDate()!==l?null:o-6e4*(Number.isFinite(t)?Math.trunc(t):0)}function ge(e,t=0){const a=Number(e);if(!Number.isFinite(a)||a<=0)return"";const n=Number.isFinite(t)?Math.trunc(t):0;return new Date(a+6e4*n).toISOString().slice(0,10)}function be(e){const t=String(e??""),a=[],n=new Set;for(const e of t.split("\n")){const t=e.trim();if(""===t)continue;const r=t.split("..");if(r.length>2)return null;const i=r[0].trim(),l=2===r.length?r[1].trim():i;if(""===i||""===l)return null;const o=he(i),s=he(l);if(null===o||null===s||o>s)return null;const c=Math.round((s-o)/864e5)+1;if(c>366||n.size+c>400)return null;for(let e=0;e<c;e+=1){const t=new Date(o+864e5*e).toISOString().slice(0,10);n.has(t)||(n.add(t),a.push(t))}}return a.sort(),a}function fe(e,t=0){const a=null!=e&&Array.isArray(e.policies)?e.policies:[],n=a.length>0&&null!==a[0]&&"object"==typeof a[0]?a[0]:null;if(null===n)return null;const r=me(Array.isArray(n.rules)?n.rules:[],t);return 0===r.length?null:{policyId:"string"==typeof n.policyId&&""!==n.policyId?n.policyId:"custom-peak",effectiveFromText:ge(n.effectiveFrom,t),holidaysEnabled:Array.isArray(n.holidays)&&n.holidays.length>0,holidaysText:Array.isArray(n.holidays)?n.holidays.join("\n"):"",holidaysSourceText:"string"==typeof n.holidaysSource?n.holidaysSource:"",rules:r.map((e,t)=>({id:"string"==typeof e.id&&""!==e.id?e.id:"peak-"+(t+1),weekdays:Array.isArray(e.weekdays)?e.weekdays.slice().sort((e,t)=>e-t):[],windows:(Array.isArray(e.windows)?e.windows:[]).map(e=>({start:de(e.startMinute),end:de(e.endMinute)})),rates:{input:ne(null!==e.rates&&void 0!==e.rates?e.rates.input:""),output:ne(null!==e.rates&&void 0!==e.rates?e.rates.output:""),cacheRead:ne(null!==e.rates&&void 0!==e.rates?e.rates.cacheRead:""),cacheWrite:ne(null!==e.rates&&void 0!==e.rates?e.rates.cacheWrite:"")}}))}}function ye(e,t=0){const a=null!==e&&"object"==typeof e?e:{},n=Number.isFinite(t)?Math.trunc(t):0;return{policyId:"custom-peak",effectiveFromText:"",holidaysEnabled:!1,holidaysText:"",holidaysSourceText:"",rules:[{id:"peak-1",weekdays:[1,2,3,4,5],windows:[{start:de(60+n),end:de(240+n)}],rates:{input:ne(a.input),output:ne(a.output),cacheRead:ne(a.cacheRead),cacheWrite:ne(a.cacheWrite)}}]}}function xe(e){return null===e||"object"!=typeof e?null:{policyId:String(void 0===e.policyId?"":e.policyId),effectiveFromText:String(void 0===e.effectiveFromText?"":e.effectiveFromText),holidaysEnabled:!0===e.holidaysEnabled,holidaysText:String(void 0===e.holidaysText||null===e.holidaysText?"":e.holidaysText),holidaysSourceText:String(void 0===e.holidaysSourceText||null===e.holidaysSourceText?"":e.holidaysSourceText),rules:(Array.isArray(e.rules)?e.rules:[]).map((e,t)=>({id:"string"==typeof e.id&&""!==e.id?e.id:"peak-"+(t+1),weekdays:(Array.isArray(e.weekdays)?e.weekdays:[]).map(Number),windows:(Array.isArray(e.windows)?e.windows:[]).map(e=>({start:String(void 0===e.start?"":e.start),end:String(void 0===e.end?"":e.end)})),rates:{input:String(void 0===e.rates||null===e.rates||void 0===e.rates.input?"":e.rates.input),output:String(void 0===e.rates||null===e.rates||void 0===e.rates.output?"":e.rates.output),cacheRead:String(void 0===e.rates||null===e.rates||void 0===e.rates.cacheRead?"":e.rates.cacheRead),cacheWrite:String(void 0===e.rates||null===e.rates||void 0===e.rates.cacheWrite?"":e.rates.cacheWrite)}}))}}function ve(e,t,a){const n=xe(e);return null===n||void 0===n.rules[t]||(n.rules[t]=Object.assign({},n.rules[t],a)),n}function we(e,t,a){return ve(e,t,{windows:a})}function ke(e,t=0){const a=he(null!==e&&"object"==typeof e?e.effectiveFromText:"",t),n=me((null!==e&&"object"==typeof e&&Array.isArray(e.rules)?e.rules:[]).map((e,t)=>({id:"string"==typeof e.id&&""!==e.id?e.id:"peak-"+(t+1),weekdays:(Array.isArray(e.weekdays)?e.weekdays:[]).slice().sort((e,t)=>e-t),windows:(Array.isArray(e.windows)?e.windows:[]).map(e=>({startMinute:ue(e.start),endMinute:ue(e.end)})),rates:{input:ne(null!==e.rates&&void 0!==e.rates?e.rates.input:""),output:ne(null!==e.rates&&void 0!==e.rates?e.rates.output:""),cacheRead:ne(null!==e.rates&&void 0!==e.rates?e.rates.cacheRead:""),cacheWrite:ne(null!==e.rates&&void 0!==e.rates?e.rates.cacheWrite:"")}})),-t);return{policies:[{policyId:String(null!==e&&"object"==typeof e&&void 0!==e.policyId?e.policyId:"").trim(),timezone:"UTC",effectiveFrom:null===a?0:a,effectiveUntil:null,defaultPlan:null,holidays:null!==e&&"object"==typeof e&&!0===e.holidaysEnabled&&be(e.holidaysText)||[],holidaysSource:null!==e&&"object"==typeof e?String(void 0===e.holidaysSourceText||null===e.holidaysSourceText?"":e.holidaysSourceText).trim().slice(0,512):"",rules:n}]}}function Ee(e){if(null===e||"object"!=typeof e)return"temporal";const t=String(void 0===e.policyId?"":e.policyId).trim();if(""===t||t.length>128)return"temporal";if(null===he(e.effectiveFromText))return"temporal";if(!0===e.holidaysEnabled&&null===be(e.holidaysText))return"temporal";const a=Array.isArray(e.rules)?e.rules:[];if(0===a.length||a.length>16)return"temporal";const n=new Map;for(const e of a){const t=Array.isArray(e.weekdays)?e.weekdays.map(Number):[];if(0===t.length||t.some(e=>!Number.isInteger(e)||e<0||e>6))return"temporal";const a=Array.isArray(e.windows)?e.windows:[];if(0===a.length||a.length>16)return"temporal";for(const e of a){const a=ue(e.start),r=ue(e.end);if(null===a||null===r||r<=a)return"temporal";for(const e of t){const t=void 0===n.get(e)?[]:n.get(e);t.push({start:a,end:r}),n.set(e,t)}}if(!["input","output","cacheRead","cacheWrite"].every(t=>te(null!==e.rates&&void 0!==e.rates?e.rates[t]:"")))return"temporal"}for(const e of n.values()){e.sort((e,t)=>e.start-t.start);for(let t=1;t<e.length;t+=1)if(e[t].start<e[t-1].end)return"temporal"}return""}function Ne(e){const t=String(e||"").trim();return t.includes(" / ")?t:function(e){return String(e||"").trim().toLowerCase().replace(/^.*\//,"").split(":")[0]}(t)}function Ce(e,t){const a=e.split("-"),n="en"===t,r=n?new Date(Date.UTC(Number(a[0]),Number(a[1])-1,Number(a[2]))):new Date(Number(a[0]),Number(a[1])-1,Number(a[2])),i=n?r.getUTCMonth():r.getMonth(),l=n?r.getUTCDay():r.getDay();if("en"===t){const e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][l];return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][i]+" "+Number(a[2])+", "+a[0]+" ("+e+", UTC)"}const o=["周日","周一","周二","周三","周四","周五","周六"][l];return a[0]+"年"+Number(a[1])+"月"+Number(a[2])+"日 "+o}function Me(e){if(null==e)return null;const t=Number(e.input||0)+Number(e.output||0)+Number(e.cacheRead||0)+Number(e.cacheWrite||0)+Number(e.reasoning||0);return Number.isFinite(t)?t:null}function Se(e,t,a){if("en"===a){const a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][t];return 0===t?e+" "+a:a}return 0===t?e+"年1月":t+1+"月"}function Ae(e){return e>=10?4:e>=6?3:e>=3?2:e>=1?1:0}const ze=[20,45,70,96];function Te(e){return e<=0?"var(--dsw-alias-bg-layer-2)":"color-mix(in srgb, #0969da "+ze[e-1]+"%, var(--dsw-alias-bg-layer-2))"}function Re(e){return"hsl("+137*e%360+", 70%, 55%)"}const Ie={"30d":5,"90d":13,"12m":53},je=["30d","90d","12m"],De="12m";function Fe(e){return je.includes(e)?e:De}const Ue="https://github.com/ParticleLight/dsh-all-usage";function We(e,t,a,n){const r=a&&Array.isArray(e&&e.byDayUtc)?e.byDayUtc:Array.isArray(e&&e.byDay)?e.byDay:[],i=u(new Date,a);if("custom"===t){const e=m(n,a);return null===e?null:{start:e.start,end:e.end}}if("today"===t)return{start:i,end:i};if("7d"===t)return{start:u(d(new Date,-6,a),a),end:i};if("30d"===t)return{start:u(d(new Date,-29,a),a),end:i};if("90d"===t)return{start:u(d(new Date,-89,a),a),end:i};const l=h(r,i);return{start:l.min,end:l.max}}function Oe(e){return null===e?"":JSON.stringify({start:e.start,end:e.end,utc:!0===e.utc,workspaceId:e.workspaceId||null,provider:e.provider||null,modelKey:e.modelKey||null})}function Le(e){const t=e&&e.tokens&&"object"==typeof e.tokens?e.tokens:e||{};return{input:Number.isFinite(t.input)?t.input:0,output:Number.isFinite(t.output)?t.output:0,cacheRead:Number.isFinite(t.cacheRead)?t.cacheRead:0,cacheWrite:Number.isFinite(t.cacheWrite)?t.cacheWrite:0,reasoning:Number.isFinite(t.reasoning)?t.reasoning:0}}function Pe(e,t,a){const n=e.split("-").map(Number);return u(a?new Date(Date.UTC(n[0],n[1]-1,n[2]+t)):new Date(n[0],n[1]-1,n[2]+t),a)}const Ke=[{days:3,unit:"static"},{days:4,unit:"static"},{days:7,unit:"week",stride:1},{days:10,unit:"static"},{days:14,unit:"week",stride:2},{days:21,unit:"week",stride:3},{days:30,unit:"static"},{days:61,unit:"static"},{days:91,unit:"static"},{days:182,unit:"static"},{days:365,unit:"static"}];function qe(e,t,a){return e&&Number.isFinite(e.time)?function(e,t,a){const n=a?{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}:{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1};return"en"===t&&(n.timeZone="UTC"),new Date(e).toLocaleString("en"===t?"en-US":"zh-CN",n)}(e.time,t,a):e&&"string"==typeof e.date?a?Ce(e.date,t):e.date.slice(5):""}function Be(e){const t=e&&e.bucket&&"object"==typeof e.bucket?e.bucket:null;return null!==t&&t.days>1&&"string"==typeof t.end}function He(e,t){return e&&Number.isFinite(e.time)?String(e.time):e&&"string"==typeof e.date?e.date:String(t)}function Ye(e){return e&&"string"==typeof e.date?e.date:""}function Ve(e){const t=null!=e?e:{},a=void 0===t.stats?null:t.stats,n=void 0===t.queryScope?null:t.queryScope,r=void 0===t.queryResult?null:t.queryResult,i=!0===t.useUtc,l=!0===t.queryReady,o=Array.isArray(t.activeDayRows)?t.activeDayRows:[],s=null!==n?{start:n.start,end:n.end}:We(a,t.range,i,t.activeCustomRange),c=l&&null!==r&&Array.isArray(r.daily)?r.daily:null,d=null!==n&&n.start===n.end&&l&&null!==r&&Array.isArray(r.hourly)&&r.hourly.length>0?function(e,t,a,n,r){const i=Array.isArray(t)?t.find(e=>null!==e&&"object"==typeof e&&e.date===n):void 0,l=(null==a?[]:!0===r?Array.isArray(a.byDayUtc)?a.byDayUtc:[]:Array.isArray(a.byDay)?a.byDay:[]).find(e=>null!==e&&"object"==typeof e&&e.date===n),o=void 0!==i?i:l,s=void 0===o?null:Me(o.tokens);if(null===s)return[];let c=0;for(const t of e)c+=Me(t.tokens)||0;return c<=0?[]:Math.abs(c-s)<=Math.max(.05*s,2e5)?e:[]}(r.hourly,c,a,n.start,i):[],p=d.length>0?function(e,t){const a=[];for(const n of Array.isArray(e)?e:[]){if(null===n||"object"!=typeof n)continue;const e=Number.isFinite(n.time)?n.time:"string"==typeof n.date?Date.parse(n.date):NaN;if(!Number.isFinite(e))continue;const r=Le(n);a.push({date:u(new Date(e),t),time:e,turns:Number.isFinite(n.turns)?n.turns:0,calls:Number.isFinite(n.calls)?n.calls:0,sessions:Number.isFinite(n.sessions)?n.sessions:0,tokens:r,cost:Y(n),total:r.input+r.output+r.cacheRead+r.cacheWrite+r.reasoning})}return a.sort((e,t)=>e.time-t.time)}(d,i):[];return p.length>0?p:function(e,t,a,n){if(null===t||"object"!=typeof t)return[];const r=n&&Number.isFinite(n.maxPoints)?n.maxPoints:180,i=new Map((Array.isArray(e)?e:[]).filter(e=>e&&"string"==typeof e.date).map(e=>[e.date,e])),l=t.start.split("-").map(Number),o=t.end.split("-").map(Number),s=a?new Date(Date.UTC(l[0],l[1]-1,l[2])):new Date(l[0],l[1]-1,l[2]),c=a?new Date(Date.UTC(o[0],o[1]-1,o[2])):new Date(o[0],o[1]-1,o[2]),d=function(e,t){if(!Number.isFinite(e)||e<=t)return null;const a=Ke[Ke.length-1];for(let a=0;a<Ke.length-1;a+=1)if(Math.ceil(e/Ke[a].days)<=t)return Ke[a];return a}(Math.round((c.getTime()-s.getTime())/864e5),r);if(null===d){const e=[];for(;s.getTime()<=c.getTime();){const t=u(s,a),n=i.get(t),r=Le(n);e.push({date:t,turns:n&&Number.isFinite(n.turns)?n.turns:0,calls:n&&Number.isFinite(n.calls)?n.calls:0,sessions:n&&Number.isFinite(n.sessions)?n.sessions:0,tokens:r,cost:Y(n),total:r.input+r.output+r.cacheRead+r.cacheWrite+r.reasoning,bucket:{start:t,end:t,days:1,granularity:"day"}}),a?s.setUTCDate(s.getUTCDate()+1):s.setDate(s.getDate()+1)}return e}return function(e,t,a,n,r){const i=[];let l=t;for(;l<=a;){let t;if("week"===r.unit){const e=l.split("-").map(Number),a=n?new Date(Date.UTC(e[0],e[1]-1,e[2])).getUTCDay():new Date(e[0],e[1]-1,e[2]).getDay();t=Pe(l,7*r.stride-(1===a?0:(a+6)%7),n)}else t=Pe(l,r.days,n);const o=Pe(t,-1,n),s=o>a?a:o,c={input:0,output:0,cacheRead:0,cacheWrite:0,reasoning:0},u=H();let d=0,p=0,m=0,h=0,g=0,b=l;for(;b<=s;){const t=e.get(b),a=Le(t);d+=t&&Number.isFinite(t.turns)?t.turns:0,p+=t&&Number.isFinite(t.calls)?t.calls:0,m+=t&&Number.isFinite(t.sessions)?t.sessions:0,c.input+=a.input,c.output+=a.output,c.cacheRead+=a.cacheRead,c.cacheWrite+=a.cacheWrite,c.reasoning+=a.reasoning,h+=a.input+a.output+a.cacheRead+a.cacheWrite+a.reasoning,V(u,t),g+=1,b=Pe(b,1,n)}if(i.push({date:l,turns:d,calls:p,sessions:m,tokens:c,cost:u,total:h,bucket:{start:l,end:s,days:g,granularity:"week"===r.unit?"week":"static"}}),s>=a)break;l=Pe(s,1,n)}return i}(i,t.start,t.end,a,d)}(null!==c?c:o,s,i)}function Ge(e,t,a=900,n=250){const r=Array.isArray(t)&&t.length>0?t:["total"],i={left:46,right:14,top:14,bottom:30},l=Math.max(1,a-i.left-i.right),o=Math.max(1,n-i.top-i.bottom),s=(Array.isArray(e)?e:[]).flatMap(e=>r.map(t=>"total"===t?e.total:e.tokens[t]||0)),c=Math.max(1,...s),u={};for(const t of r)u[t]=(Array.isArray(e)?e:[]).map((a,n)=>({x:i.left+(e.length>1?n*l/(e.length-1):l/2),y:i.top+o-("total"===t?a.total:a.tokens[t]||0)/c*o,value:"total"===t?a.total:a.tokens[t]||0}));return{width:a,height:n,padding:i,max:c,points:u}}function Je(e,t,a){const n="string"==typeof e.actualModel&&""!==e.actualModel?e.actualModel:"string"==typeof e.requestedModel&&""!==e.requestedModel?e.requestedModel:"",r="string"==typeof e.model&&""!==e.model?e.model:a,i=r.indexOf(" / "),l=("string"==typeof e.provider&&""!==e.provider?e.provider:"")||(i>0?r.slice(0,i):t),o=l!==t?l+" / ":"",s=""!==n?r:""!==o&&r.startsWith(o)?r.slice(o.length):i>0?r.slice(i+3):r;return{provider:l,model:Ne(n||s)||a}}function _e(e,t){const[a,r]=n.useState({value:0,done:!1});return n.useEffect(()=>{if("number"!=typeof e||!Number.isFinite(e)||e<=0)return void r({value:0,done:!1});if(a.done)return void r({value:e,done:!0});const n=Date.now(),i=t.interval(()=>{const t=Math.min(1,(Date.now()-n)/700),a=1-Math.pow(1-t,3);t>=1?(i(),r({value:e,done:!0})):r({value:Math.round(e*a),done:!1})},32);return i},[e]),a.value}function $e(e){if(!Array.isArray(e)||0===e.length)return"";if(1===e.length)return"M"+e[0].x.toFixed(2)+" "+e[0].y.toFixed(2);const t=[];for(let a=0;a<e.length-1;a+=1){const n=e[a+1].x-e[a].x;t.push(0===n?0:(e[a+1].y-e[a].y)/n)}const a=new Array(e.length).fill(0);a[0]=t[0],a[e.length-1]=t[t.length-1];for(let n=1;n<e.length-1;n+=1){const e=t[n-1],r=t[n];a[n]=e*r<=0?0:(e+r)/2}for(let e=0;e<t.length;e+=1){if(0===t[e]){a[e]=0,a[e+1]=0;continue}const n=a[e]/t[e],r=a[e+1]/t[e],i=n*n+r*r;if(i>9){const l=3/Math.sqrt(i);a[e]=l*n*t[e],a[e+1]=l*r*t[e]}}let n="M"+e[0].x.toFixed(2)+" "+e[0].y.toFixed(2);for(let t=0;t<e.length-1;t+=1){const r=e[t+1].x-e[t].x,i=e[t].x+r/3,l=e[t].y+a[t]*r/3,o=e[t+1].x-r/3,s=e[t+1].y-a[t+1]*r/3;n+=" C"+i.toFixed(2)+" "+l.toFixed(2)+" "+o.toFixed(2)+" "+s.toFixed(2)+" "+e[t+1].x.toFixed(2)+" "+e[t+1].y.toFixed(2)}return n}function Xe(e){if(!Array.isArray(e)||e.length<2)return 1;let t=0;for(let a=1;a<e.length;a+=1){const n=e[a].x-e[a-1].x,r=e[a].y-e[a-1].y;t+=Math.sqrt(n*n+r*r)}return Math.max(1,Math.ceil(1.35*t+2))}const Ze=["#0a84ff","#30d158","#bf5af2","#ff9f0a","#ff375f","#64d2ff"],Qe={total:"#f4c542",input:"#5aa9ff",cacheRead:"#44d483",cacheWrite:"#d98bff",output:"#ff8c66",reasoning:"#aab4c4"},et={total:.2,input:.16,cacheRead:.18,cacheWrite:.14,output:.16,reasoning:.1};function tt(e,t){const a=O(e,t);return""!==a?a:w(e)}function at(e,t){return tt(e,t)+("en"===t?" tokens":" Token")}function nt(e,t,a,n,r){const i=Math.max(0,r-n),l=n=>({x:e+a*Math.cos(n),y:t+a*Math.sin(n)}),o=l(n);if(i>=2*Math.PI-1e-4){const e=l(n+Math.PI);return"M"+o.x.toFixed(2)+" "+o.y.toFixed(2)+" A"+a+" "+a+" 0 1 1 "+e.x.toFixed(2)+" "+e.y.toFixed(2)+" A"+a+" "+a+" 0 1 1 "+o.x.toFixed(2)+" "+o.y.toFixed(2)}const s=l(r);return"M"+o.x.toFixed(2)+" "+o.y.toFixed(2)+" A"+a+" "+a+" 0 "+(i>Math.PI?1:0)+" 1 "+s.x.toFixed(2)+" "+s.y.toFixed(2)}const rt=n.memo(function(e){const t="en"===e.language?"en":"zh",[a,r]=n.useState(null),i=n.useRef(null),l=n.useRef(null),o=n.useRef(null),s=n.useRef(null),c=n.useMemo(()=>function(e,t,a=5){const n=Math.max(1,Number.isInteger(a)?a:5),r=(Array.isArray(e)?e:[]).map((e,t)=>({label:e&&void 0!==e.label?String(e.label):"",value:Number(e&&e.value),color:e&&"string"==typeof e.color&&""!==e.color?e.color:Ze[t%Ze.length],iconKey:e&&void 0!==e.iconKey?e.iconKey:void 0,cost:Y(e)})).filter(e=>""!==e.label&&Number.isFinite(e.value)&&e.value>0).sort((e,t)=>t.value-e.value),i=r.reduce((e,t)=>e+t.value,0);if(i<=0)return{total:0,segments:[]};const l=r.slice(0,n),o=r.slice(n),s=o.reduce((e,t)=>e+t.value,0);if(s>0){const e={currency:"USD",input:"0",output:"0",cacheRead:"0",cacheWrite:"0",baseTotal:"0",total:"0",pricedCalls:0,unpricedCalls:0,ambiguousCalls:0,unsupportedCalls:0};for(const t of o)V(e,t.cost);l.push({label:t+" ("+(r.length-n)+")",value:s,color:"#b8c2cf",iconKey:null,cost:e,other:!0})}let c=-Math.PI/2;return{total:i,segments:l.map((e,t)=>{const a=e.value/i*Math.PI*2,n=l.length>1?Math.min(.018,a/3):0,r=c+n,o=c+a-n;return c+=a,{...e,index:t,percentage:e.value/i*100,startAngle:o<=r?c-a:r,endAngle:o<=r?c:o}})}}(e.items,"en"===t?"Other":"其他"),[e.items,t]),u=null===a?null:c.segments[a]||null,d=e=>(e>=10?Math.round(e):Math.round(10*e)/10)+"%",p=n.useCallback(()=>{o.current=null,null!==s.current&&(window.clearTimeout(s.current),s.current=null);const e=i.current,t=l.current;if(null!==e&&null!==t){if(t.fixed)e.style.left=t.left+"px",e.style.top=t.top+"px";else{const a=t.visual?.getBoundingClientRect();if(!a)return;const n=198,r=82;e.style.left=Math.max(8,Math.min(Math.max(8,a.width-n),t.x-a.left+14))+"px",e.style.top=Math.max(8,Math.min(Math.max(8,a.height-r),t.y-a.top+14))+"px"}e.style.visibility="visible"}},[]),m=n.useCallback(e=>{l.current=e,null===o.current&&(o.current=window.requestAnimationFrame(p),s.current=window.setTimeout(()=>{null!==o.current&&(window.cancelAnimationFrame(o.current),p())},80))},[p]),h=n.useCallback(e=>{m({x:e.clientX,y:e.clientY,visual:e.currentTarget.ownerSVGElement?.parentElement})},[m]),g=n.useCallback(()=>{r(null),l.current=null},[]);return n.useEffect(()=>()=>{null!==o.current&&window.cancelAnimationFrame(o.current),null!==s.current&&window.clearTimeout(s.current)},[]),n.useEffect(()=>{null!==a&&null!==l.current&&null===o.current&&(o.current=window.requestAnimationFrame(p))},[a,p]),c.total<=0?null:n.createElement("div",{className:"uh-donut-chart","aria-label":e.title},n.createElement("div",{className:"uh-donut-title"},n.createElement(C,{name:e.icon||"chart",size:16}),e.title),n.createElement("div",{className:"uh-donut-layout"},n.createElement("div",{className:"uh-donut-visual"},n.createElement("svg",{className:"uh-donut-svg",viewBox:"0 0 260 260",role:"img","aria-label":e.title+" "+at(c.total,t)},n.createElement("circle",{cx:130,cy:130,r:77.5,className:"uh-donut-track",fill:"none",stroke:"var(--dsw-alias-bg-layer-2)",strokeWidth:33}),c.segments.map(e=>n.createElement("path",{key:"donut-"+e.index,d:nt(130,130,77.5,e.startAngle,e.endAngle),className:"uh-donut-segment"+(a===e.index?" uh-active":""),fill:"none",stroke:e.color,strokeWidth:33,strokeLinecap:"butt",strokeLinejoin:"round",pathLength:1,style:{animationDelay:90*e.index+"ms"},tabIndex:0,"aria-label":e.label+" "+at(e.value,t)+" "+d(e.percentage)+" "+G(e.cost,t),onMouseEnter:t=>{r(e.index),h(t)},onMouseMove:h,onMouseLeave:g,onFocus:()=>{r(e.index),m({fixed:!0,left:12,top:12})},onBlur:g}))),u?n.createElement("div",{ref:i,className:"uh-donut-tooltip",style:{visibility:"hidden"}},n.createElement("span",{className:"uh-donut-dot",style:{background:u.color}}),void 0===u.iconKey||null===u.iconKey?null:n.createElement(pt,{iconKey:u.iconKey,size:15}),n.createElement("div",{},n.createElement("strong",{},u.label),n.createElement("span",{},at(u.value,t)+" · "+d(u.percentage)),n.createElement("span",{className:"uh-donut-tooltip-cost"},G(u.cost,t)))):null,n.createElement("div",{className:"uh-donut-center"},n.createElement("strong",{},tt(c.total,t)),n.createElement("span",{},"en"===t?"tokens":"Token"))),n.createElement("div",{className:"uh-donut-legend",role:"list"},c.segments.map(e=>n.createElement("div",{key:"legend-"+e.index,className:"uh-donut-legend-row",role:"listitem"},n.createElement("span",{className:"uh-donut-legend-mark"},n.createElement("span",{className:"uh-donut-dot",style:{background:e.color}}),void 0===e.iconKey||null===e.iconKey?null:n.createElement(pt,{iconKey:e.iconKey,size:16,showTitle:!0})),n.createElement("div",{className:"uh-donut-legend-copy"},n.createElement("strong",{title:e.label},e.label)),n.createElement("div",{className:"uh-donut-legend-metrics"},n.createElement("span",{},at(e.value,t)),n.createElement("span",{className:"uh-donut-cost"},G(e.cost,t))),n.createElement("strong",{className:"uh-donut-percent"},d(e.percentage)))))))});function it(e,t){return{total:"en"===t?"Total":"总处理",input:"en"===t?"Input":"输入",cacheRead:"en"===t?"Cache hits":"缓存命中",cacheWrite:"en"===t?"Cache writes":"缓存写入",output:"en"===t?"Output":"输出",reasoning:"en"===t?"Reasoning":"推理"}[e]||e}const lt=n.memo(function(e){const t="en"===e.language?"en":"zh",a=(e,a)=>"en"===t?a:e,r=Array.isArray(e.rows)?e.rows:[],i=Array.isArray(e.visible)&&e.visible.length>0?e.visible:["total"],[l,o]=n.useState(null),[s,c]=n.useState(null),[u,d]=n.useState(()=>"bar"===St().trendChart?"bar":"line"),p=900,m=280,h=n.useMemo(()=>Ge(r,i,p,m),[r,i]),g=Qe,b=et,f=m-h.padding.bottom,y=n.useMemo(()=>"bar"!==u||e.loading||e.error?[]:function(e,t,a=900,n=250){const r=Array.isArray(e)?e:[],i=Array.isArray(t)?t:[],l=i.filter(e=>"total"!==e),o=Ge(r,["total"],a,n),s=Math.max(1,n-o.padding.top-o.padding.bottom),c=Math.max(1,a-o.padding.left-o.padding.right),u=n-o.padding.bottom,d=r.length>1?c/(r.length-1):c/2,p=Math.max(2,Math.min(.62*d,26)),m=e=>Number.isFinite(e)&&e>0?e/o.max*s:0,h=0===l.length||i.includes("total");return r.map((e,t)=>{const a=o.padding.left+(r.length>1?t*c/(r.length-1):c/2),n=e&&e.tokens?e.tokens:{},i=[];let s=u,d=0;for(const e of l){const t=Number.isFinite(n[e])?n[e]:0;d+=t;const a=m(t);a<=0||(i.push({key:e,y:s-a,height:a}),s-=a)}const g=e&&Number.isFinite(e.total)?e.total:d;if(h){const e=g-d,t=e>0?m(e):0;t>0&&i.push({key:"total",y:s-t,height:t})}return{x:a-p/2,width:p,segments:i}})}(r,i,p,m),[u,r,i,p,m,e.loading,e.error]),x=n.useMemo(()=>{const e={};for(const t of i){const a=h.points[t]||[],n=$e(a);e[t]={line:n,area:0===a.length?"":n+" L"+a[a.length-1].x.toFixed(2)+" "+f+" L"+a[0].x.toFixed(2)+" "+f+" Z",length:Xe(a)}}return e},[h,i,f]),v=n.useMemo(()=>r.length<=1?[0]:Array.from(new Set([0,Math.floor((r.length-1)/4),Math.floor((r.length-1)/2),Math.floor(3*(r.length-1)/4),r.length-1])),[r]),k=!e.loading&&!e.error&&r.length>0,E=r.length>0&&Number.isFinite(r[0].time),N=!E&&r.length>0&&Be(r[0]),M=N&&"day"!==r[0].bucket.granularity?function(e,t){const a=e&&e[0]&&e[0].bucket?e[0].bucket:null;if(null===a)return"";const n=function(e){const t=new Map;for(const a of Array.isArray(e)?e:[]){const e=a&&a.bucket&&Number.isFinite(a.bucket.days)?a.bucket.days:0;e<=0||t.set(e,(t.get(e)||0)+1)}let a=0,n=0;for(const[e,r]of t)(r>n||r===n&&e>a)&&(a=e,n=r);return a}(e);if("week"===a.granularity){const e=Math.max(1,Math.round(n/7));return e<=1?"en"===t?"Weekly":"按周汇总":"en"===t?"Every "+e+" weeks":"每 "+e+" 周汇总"}return n<=1?"en"===t?"Daily":"按天汇总":n<28?("en"===t?"Every ":"每 ")+n+("en"===t?" days":" 天汇总"):n<300?"en"===t?"Monthly":"按月汇总":"en"===t?"Yearly":"按年汇总"}(r,t):"",S=n.useCallback((e,a)=>Be(e)?function(e,t,a){const n=qe(e,t,a);return a?n+" – "+Ce(e.bucket.end,t):n}(e,t,a):qe(e,t,a),[t]),A=E?a("每小时 Token 使用趋势,选择小时查看当天请求日志","Hourly Token usage trend; select an hour to view request logs"):a("每日 Token 使用趋势,选择日期查看请求日志","Daily Token usage trend; select a date to view request logs"),z=(null===l||r[l],null===l?null:(h.points[i[0]]||[])[l]||null),T=null===s?null:r[s]||null,R=null===s?null:(h.points[i[0]]||[])[s]||null,I=null!==l&&null!==T&&null!==R,j=null!==R&&R.x>612?" uh-left":" uh-right",D=null===R?void 0:{left:(R.x/p*100).toFixed(2)+"%",top:Math.max(23,Math.min(77,R.y/m*100)).toFixed(2)+"%"},F=e=>{o(e),c(e)},U=e.loading?n.createElement("div",{className:"uh-trend-stage uh-trend-loading",role:"status","aria-label":a("正在加载趋势","Loading trend")},n.createElement("span",{className:"uh-trend-spinner","aria-hidden":!0})):e.error?n.createElement("div",{className:"uh-trend-stage uh-trend-message",role:"alert"},e.error):0===r.length?n.createElement("div",{className:"uh-trend-stage uh-trend-message"},a("该范围内暂无趋势数据","No trend data in this range")):n.createElement("div",{className:"uh-trend-chart-wrap"},n.createElement("svg",{className:"uh-trend-svg",viewBox:"0 0 900 "+m,role:"group","aria-label":A},[0,.5,1].map(e=>n.createElement(n.Fragment,{key:e},n.createElement("line",{x1:h.padding.left,x2:p-h.padding.right,y1:h.padding.top+(m-h.padding.top-h.padding.bottom)*e,y2:h.padding.top+(m-h.padding.top-h.padding.bottom)*e,className:"uh-trend-grid"}),n.createElement("text",{x:h.padding.left-7,y:h.padding.top+(m-h.padding.top-h.padding.bottom)*e+4,className:"uh-trend-axis-label",textAnchor:"end"},w(Math.round(h.max*(1-e)))))),n.createElement("defs",{},i.map(e=>n.createElement("linearGradient",{key:e,id:"uh-trend-gradient-"+e,x1:"0",y1:"0",x2:"0",y2:"1"},n.createElement("stop",{offset:"4%",stopColor:g[e]||"#9aa4b2",stopOpacity:b[e]||.12}),n.createElement("stop",{offset:"96%",stopColor:g[e]||"#9aa4b2",stopOpacity:0})))),"bar"===u?y.map((e,t)=>n.createElement("g",{key:"bar-"+t,className:"uh-trend-bar-group",style:{animationDelay:Math.min(16*t,260)+"ms"}},e.segments.map((a,r)=>n.createElement("rect",{key:"bar-"+t+"-"+r,x:e.x,y:a.y,width:e.width,height:a.height,className:"uh-trend-bar","data-series":a.key,fill:g[a.key]||"#9aa4b2"})))):[i.map((e,t)=>{const a=x[e]?x[e].area:"";return""===a?null:n.createElement("path",{key:"area-"+e,d:a,className:"uh-trend-area","data-series":e,fill:"url(#uh-trend-gradient-"+e+")",style:{animationDelay:80+80*t+"ms"}})}),i.map(e=>n.createElement("path",{key:"line-base-"+e,d:x[e]?x[e].line:"",className:"uh-trend-line","data-series":e,stroke:g[e]||"#9aa4b2"})),i.map((e,t)=>{h.points[e];const a=x[e]?x[e].length:0;return n.createElement("path",{key:"line-draw-"+e,d:x[e]?x[e].line:"",className:"uh-trend-line-draw","data-series":e,stroke:g[e]||"#9aa4b2",style:{"--uh-draw-length":a+"px",animationDelay:90*t+"ms"}})}),i.map(e=>{const t=h.points[e]||[];if(1!==t.length)return null;const a=t[0];return n.createElement("circle",{key:"single-point-"+e,cx:a.x,cy:a.y,r:4,className:"uh-trend-point",fill:g[e]||"#9aa4b2"})})],null!==l&&z?n.createElement(n.Fragment,{key:"hover-"+l},n.createElement("line",{x1:z.x,x2:z.x,y1:h.padding.top,y2:f,className:"uh-trend-cursor"}),"bar"===u?null:i.map(e=>{const t=(h.points[e]||[])[l];return t?n.createElement("circle",{key:e,cx:t.x,cy:t.y,r:4,className:"uh-trend-point",fill:g[e]||"#9aa4b2"}):null})):null,r.map((a,r)=>{const l=(h.points[i[0]]||[])[r];if(!l)return null;const s=(h.points[i[0]]||[])[r+1],c=s?Math.max(8,s.x-l.x):r>0?Math.max(8,l.x-(h.points[i[0]]||[])[r-1].x):24;return n.createElement("rect",{key:He(a,r),x:Math.max(h.padding.left,l.x-c/2),y:h.padding.top,width:c,height:m-h.padding.top-h.padding.bottom,className:"uh-trend-hit",tabIndex:N?-1:0,role:N?"img":"button","aria-label":S(a,!0)+" "+it("total",t)+" "+w(a.total),onMouseEnter:()=>F(r),onMouseLeave:()=>o(null),onFocus:()=>F(r),onBlur:()=>o(null),onKeyDown:t=>{N||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),"function"==typeof e.onPointClick&&e.onPointClick(Ye(a)))},onClick:()=>{N||"function"==typeof e.onPointClick&&e.onPointClick(Ye(a))}})}),v.map(e=>{const t=(h.points[i[0]]||[])[e],a=r[e];return t&&a?n.createElement("text",{key:He(a,e),x:t.x,y:272,className:"uh-trend-axis-label",textAnchor:0===e?"start":e===r.length-1?"end":"middle"},S(a,!1)):null})),T&&R?n.createElement("div",{className:"uh-trend-tooltip"+j+(I?" uh-visible":""),style:D,"aria-hidden":!I},n.createElement("strong",{className:"uh-trend-tooltip-title"},S(T,!0)),i.map(e=>n.createElement("div",{key:e,className:"uh-trend-tooltip-row",style:{color:g[e]||"#9aa4b2"}},n.createElement("span",{className:"uh-trend-dot",style:{background:g[e]||"#9aa4b2"}}),n.createElement("span",{className:"uh-trend-tooltip-label"},it(e,t)),n.createElement("strong",{className:"uh-trend-tooltip-value"},w(function(e,t){return"total"===t?e.total:e.tokens&&Number.isFinite(e.tokens[t])?e.tokens[t]:0}(T,e)))))):null);return n.createElement("div",{className:"uh-panel uh-trend-panel"},n.createElement("div",{className:"uh-trend-head"},n.createElement("div",{},n.createElement("h3",{className:"uh-tbl-title uh-title-with-icon"},n.createElement(C,{name:"chart",size:16}),a("Token 使用趋势","Token Usage Trend")),n.createElement("div",{className:"uh-note"},(e.rangeLabel||"")+(N?(e.rangeLabel?" · ":"")+M:""))),k?n.createElement("div",{className:"uh-trend-head-side"},n.createElement("div",{className:"uh-note"},N?a("区间较长,每点为一个周期","Long range summarised: one point per period"):a("点击数据点查看当日明细","Click a point to inspect that day")),n.createElement("div",{className:"uh-range",role:"group","aria-label":a("图表类型","Chart type")},[["line",a("折线","Line")],["bar",a("柱状","Bars")]].map(e=>n.createElement("button",{key:e[0],type:"button",className:u===e[0]?"uh-on":"","aria-pressed":u===e[0],onClick:()=>{return t=e[0],d(t),void At({trendChart:t});var t}},e[1])))):null),U,k?n.createElement("div",{className:"uh-trend-legend"},["total","input","cacheRead","cacheWrite","output","reasoning"].map(a=>n.createElement("button",{key:a,type:"button",className:"uh-trend-legend-item"+(i.includes(a)?" uh-on":""),onClick:()=>(t=>{"function"==typeof e.onToggle&&e.onToggle(t)})(a),"aria-pressed":i.includes(a)},n.createElement("span",{className:"uh-trend-dot",style:{background:g[a]||"#9aa4b2"}}),it(a,t)))):null)}),ot=n.memo(function(e){const t="en"===e.language?"en":"zh",a=e.day,r=n.useMemo(()=>(a&&Array.isArray(a.perWorkspace)?a.perWorkspace:[]).slice().sort((e,t)=>t.turns-e.turns),[a]),i=void 0===a?null:Le(a),l=null!==i&&i.input+i.output+i.cacheRead>0?"en"===t?"Tokens: Input "+w(i.input)+" · Cache hits "+w(i.cacheRead)+" · Output "+w(i.output):"Token:输入 "+w(i.input)+" · 缓存命中 "+w(i.cacheRead)+" · 输出 "+w(i.output):"";return n.createElement("div",{ref:e.tooltipRef,className:"uh-tip",style:{left:0,top:0,visibility:"hidden"}},n.createElement("div",{className:"uh-tip-date"},Ce(e.date,t)),void 0!==a&&a.turns>0?r.map(a=>n.createElement("div",{key:a.workspaceId,className:"uh-tip-row",onClick:()=>e.onWorkspaceSelect(a.workspaceId)},n.createElement("span",{className:"uh-dot",style:{background:Re(e.workspaceIndexes.get(a.workspaceId)||0)}}),n.createElement("span",{},e.workspaceTitles.get(a.workspaceId)||("en"===t?"Unknown workspace":"未知工作区")),n.createElement("span",{className:"uh-n"},"en"===t?a.turns+" uses":a.turns+" 次"))):n.createElement("div",{className:"uh-empty",style:{padding:"6px 0"}},"en"===t?"No usage records for this day":"这一天没有使用记录"),""!==l?n.createElement("div",{className:"uh-tip-tokens"},l):null)}),st=n.memo(function(e){const t="en"===e.language?"en":"zh",a=(e,a)=>"en"===t?a:e,r=Array.isArray(e.workspaces)?e.workspaces:[],i=Array.isArray(e.rows)?e.rows:[],l=e.workspaceId||null,[o,s]=n.useState(null),c=n.useRef(null),p=n.useRef(null),m=n.useRef({x:0,y:0}),h=n.useRef(null),g=n.useRef(null),b=n.useRef(e.onDateClick),f=n.useRef(e.onWorkspaceSelect);b.current=e.onDateClick,f.current=e.onWorkspaceSelect;const y=(x=e.span,Ie[Fe(x)]);var x;const v=y<Ie[De]?34*y+3*(y-1)+"px":null,w={minWidth:13*y+"px"},k={gridTemplateColumns:"repeat("+y+", minmax(10px, 1fr))",minWidth:13*y+"px"};null!==v&&(w.maxWidth=v,k.maxWidth=v);const E=n.useMemo(()=>function(e,t,a,n){const r=Number.isSafeInteger(n)&&n>0&&n<=53?n:Ie[De],i=String(e||"").split("-").map(Number),l=t?new Date(Date.UTC(i[0],i[1]-1,i[2])):new Date(i[0],i[1]-1,i[2]),o=t?l.getUTCDay():l.getDay(),s=d(l,-o,t),c=d(s,7*-(r-1),t),p=[];for(let e=0;e<7*r;e+=1){const a=d(c,e,t);p.push({date:u(a,t),month:t?a.getUTCMonth():a.getMonth(),year:t?a.getUTCFullYear():a.getFullYear()})}const m=[];for(let e=0;e<r;e+=1){const t=p[7*e],n=e>0?p[7*(e-1)]:null;null!==n&&t.month===n.month||m.push({left:100*e/r+"%",text:Se(t.year,t.month,a)})}return{cells:p,months:m,weekdays:"en"===a?["","Mon","","Wed","","Fri",""]:["","周一","","周三","","周五",""]}}(e.todayKey,!0===e.utc,t,y),[e.todayKey,e.utc,t,y]),N=n.useMemo(()=>{const e=new Map;for(const t of i)t&&"string"==typeof t.date&&e.set(t.date,t);return e},[i]),M=n.useMemo(()=>{const t=new Map,n=new Map,i=e.aliases&&"object"==typeof e.aliases?e.aliases:{};return r.forEach((e,r)=>{const l=i[e.id],o=!0===e.retiredBucket,s=o?a("已删除","Deleted"):"string"==typeof l&&""!==l?l:e.title||a("未知工作区","Unknown workspace");t.set(e.id,!0!==e.deleted||o?s:s+a("(已删除)"," (deleted)")),n.set(e.id,r)}),{titles:t,indexes:n}},[r,e.aliases,t]),S=n.useCallback(()=>{h.current=null,null!==g.current&&(window.clearTimeout(g.current),g.current=null);const e=p.current;if(null===e)return;const t=m.current,a="undefined"==typeof window?1280:window.innerWidth;e.style.left=t.x+14+"px",e.style.top=t.y+12+"px",e.style.transform=t.x>.65*a?"translateX(calc(-100% - 28px))":"none",e.style.visibility="visible"},[]),A=n.useCallback((e,t)=>{m.current={x:e,y:t},null===h.current&&(h.current=window.requestAnimationFrame(S),g.current=window.setTimeout(()=>{null!==h.current&&(window.cancelAnimationFrame(h.current),S())},80))},[S]);n.useEffect(()=>()=>{null!==h.current&&window.cancelAnimationFrame(h.current),null!==g.current&&window.clearTimeout(g.current)},[]),n.useEffect(()=>{null!==o&&null===h.current&&(h.current=window.requestAnimationFrame(S))},[o,S]);const z=n.useCallback((e,t)=>{c.current!==e&&(c.current=e,s(e)),A(t.clientX,t.clientY)},[A]),T=n.useRef([]),R=n.useCallback(e=>{const t=T.current,a=null==t?void 0:t[e];if(null!=a&&"function"==typeof a.focus){for(const e of t)null!=e&&(e.tabIndex=-1);a.tabIndex=0,a.focus()}},[]),I=n.useCallback((e,t)=>{const a=null==t||"function"!=typeof t.getBoundingClientRect?null:t.getBoundingClientRect();z(e,{clientX:null===a?0:a.left+a.width/2,clientY:null===a?0:a.top})},[z]),j=n.useCallback((e,t,a)=>{const n=e.key;if("Enter"===n||" "===n||"Spacebar"===n){e.preventDefault();const t=null===e.currentTarget?"":e.currentTarget.getAttribute("data-date");return void("function"==typeof b.current&&"string"==typeof t&&b.current(t))}const r="ArrowRight"===n?t+1:"ArrowLeft"===n?t-1:"ArrowDown"===n?t+7:"ArrowUp"===n?t-7:"Home"===n?0:"End"===n?a-1:null;null!==r&&(e.preventDefault(),r<0||r>=a||R(r))},[R]),D=n.useCallback(e=>{A(e.clientX,e.clientY)},[A]),F=n.useCallback(()=>{c.current=null,s(null)},[]),U=n.useCallback(e=>{"function"==typeof f.current&&f.current(e),F()},[F]),W=n.useMemo(()=>{const t=E.cells.map(e=>e.date);if(t.indexOf(e.todayKey)>=0)return e.todayKey;for(let e=t.length-1;e>=0;e-=1)if(N.has(t[e]))return t[e];return t.length>0?t[0]:null},[E.cells,N,e.todayKey]),O=E.cells.length,L=n.useMemo(()=>E.cells.map((a,r)=>{const i=N.get(a.date);let o=0;if(void 0!==i)if(!0===e.queryUsable||null===l)o=i.turns;else{const e=Array.isArray(i.perWorkspace)?i.perWorkspace.find(e=>e.workspaceId===l):void 0;void 0!==e&&(o=e.turns)}const s=null!==l&&void 0!==i&&i.turns>0&&0===o,c=function(e,t,a){const n=Ce(e,a),r=Number.isFinite(t)&&t>0?t:0;return"en"===a?n+": "+(r>0?r+" uses":"no usage"):n+":"+(r>0?r+" 次使用":"无使用记录")}(a.date,o,t),u={background:Te(Ae(o)),opacity:s?.22:1,animationDelay:r%25*6+"ms"},d=a.date===e.todayKey?"uh-cell uh-today":"uh-cell";return n.createElement("div",{key:a.date,className:d,style:u,role:"button","data-date":a.date,"aria-label":c,tabIndex:a.date===W?0:-1,ref:e=>{T.current[r]=e},onMouseEnter:e=>z(a.date,e),onMouseMove:D,onMouseLeave:F,onFocus:e=>I(a.date,e.currentTarget),onBlur:F,onKeyDown:e=>j(e,r,O),onClick:()=>{"function"==typeof b.current&&b.current(a.date)}})}),[E.cells,N,e.queryUsable,e.todayKey,l,z,D,F,I,j,W,O,t]),P=null===o?void 0:N.get(o);return n.createElement("div",{className:"uh-panel"},n.createElement("div",{className:"uh-section-title"},n.createElement(C,{name:"calendar",size:16}),a("使用热力图","Usage Heatmap")),n.createElement("div",{className:"uh-hm-head"},n.createElement("div",{className:"uh-chips"},r.map((e,t)=>n.createElement("button",{key:e.id,className:"uh-chip"+(l===e.id?" uh-on":""),onClick:()=>U(e.id),title:e.path||(!0===e.retiredBucket?a("已删除","Deleted"):"")},n.createElement("span",{className:"uh-dot",style:{background:Re(t)}}),n.createElement("span",{className:"uh-chip-title"},M.titles.get(e.id))))),n.createElement("div",{className:"uh-hm-tools"},n.createElement("div",{className:"uh-range uh-heatmap-spans",role:"group","aria-label":a("热力图范围","Heatmap span")},je.map(t=>n.createElement("button",{key:t,type:"button",className:Fe(e.span)===t?"uh-on":"","aria-pressed":Fe(e.span)===t,title:"30d"===t?a("最近 30 天(格子更大)","Last 30 days (larger cells)"):"90d"===t?a("最近 90 天","Last 90 days"):a("最近 12 个月","Last 12 months"),onClick:()=>{"function"==typeof e.onSpanChange&&e.onSpanChange(t)}},"30d"===t?a("30 天","30 days"):"90d"===t?a("90 天","90 days"):a("12 个月","12 months")))),n.createElement("div",{className:"uh-legend","aria-hidden":!0},n.createElement("span",{},a("少","Less")),[0,1,2,3,4].map(e=>n.createElement("span",{key:e,className:"uh-cell",style:{background:Te(e)}})),n.createElement("span",{},a("多","More"))))),n.createElement("div",{className:"uh-hm-scroll"},n.createElement("div",{className:"uh-months",style:w},E.months.map((e,t)=>n.createElement("span",{key:t,style:{left:e.left}},e.text))),n.createElement("div",{className:"uh-hm-body"},n.createElement("div",{className:"uh-wdays"},E.weekdays.map((e,t)=>n.createElement("span",{key:t},e))),n.createElement("div",{className:"uh-grid",style:k,role:"group","aria-label":a("使用热力图日历:方向键浏览,回车查看当日明细","Usage heatmap calendar: arrow keys to browse, Enter for the day detail")},L))),n.createElement("div",{className:"uh-note",style:{marginTop:10}},a("口径:每完成一个回合点亮一次(含子代理会话);悬停查看按工作区明细,点击工作区可筛选热力图与明细表;键盘可用方向键浏览、回车查看当日明细。日期按本地时区。","Methodology: one cell lights up for each completed turn, including subagent sessions. Hover to view workspace details; click a workspace to filter the heatmap and detail tables. English dates and day boundaries use UTC.")),null!==o?n.createElement(ot,{date:o,day:P,language:t,tooltipRef:p,workspaceTitles:M.titles,workspaceIndexes:M.indexes,onWorkspaceSelect:U}):null)});function ct(e,t){return Number(e&&e.values&&e.values[t])||0}const ut=n.memo(function(e){return e.render()},(e,t)=>e.revision===t.revision),dt=n.memo(function(e){return e.render(e.view)},function(e,t){return e===t||e.busy===t.busy&&e.language===t.language&&e.openSection===t.openSection&&e.searchText===t.searchText&&e.searchOpen===t.searchOpen&&e.searchOptions===t.searchOptions&&e.temporalDraft===t.temporalDraft&&e.temporalPlan===t.temporalPlan&&e.holidayStatus===t.holidayStatus&&e.holidayLoading===t.holidayLoading&&(a=e.view,n=t.view,a===n||null!=a&&null!=n&&a.key===n.key&&a.model===n.model&&a.status===n.status&&a.reason===n.reason&&a.source===n.source&&a.mapped===n.mapped&&a.usageBacked===n.usageBacked&&a.mappable===n.mappable&&a.pricingModel===n.pricingModel&&a.providerId===n.providerId&&a.tiered===n.tiered&&a.tierCount===n.tierCount&&a.tieredInvalid===n.tieredInvalid&&a.multiplier===n.multiplier&&a.inputTokenSemantics===n.inputTokenSemantics&&a.temporalExplicit===n.temporalExplicit&&a.temporalBuiltin===n.temporalBuiltin&&a.temporalConfigInvalid===n.temporalConfigInvalid&&a.temporalRulesUnavailable===n.temporalRulesUnavailable&&a.temporalPolicyId===n.temporalPolicyId&&a.temporalRuleCount===n.temporalRuleCount&&a.overrideIndex===n.overrideIndex&&a.mappingIndex===n.mappingIndex&&function(e,t){return e===t||null!=e&&null!=t&&e.input===t.input&&e.output===t.output&&e.cacheRead===t.cacheRead&&e.cacheWrite===t.cacheWrite}(a.rates,n.rates)&&function(e,t){if(e===t)return!0;const a=Array.isArray(e)?e:[],n=Array.isArray(t)?t:[];if(a.length!==n.length)return!1;for(let e=0;e<a.length;e+=1){const t=a[e],r=n[e];if(t!==r){if(null==t||null==r)return!1;if(t.size!==r.size||t.input!==r.input||t.output!==r.output||t.cacheRead!==r.cacheRead||t.cacheWrite!==r.cacheWrite)return!1}}return!0}(a.tiers,n.tiers)&&ie(a.basis)===ie(n.basis));var a,n}),pt=n.memo(function(e){const t=Number.isFinite(e.size)?e.size:18,a=null===e.iconKey?null:void 0!==e.iconKey?A.get(e.iconKey)||null:U(e.row),r=null===a?"":a.key+"\0"+a.href,[i,l]=n.useState(null),o={width:t,height:t,minWidth:t};if(null===a||null!==i&&i===r)return n.createElement("span",{className:"uh-model-icon uh-model-icon-fallback"+(e.className?" "+e.className:""),style:o,"aria-hidden":!0},n.createElement(C,{name:"cache",size:t}));const s=!0===e.showTitle;return n.createElement("span",{className:"uh-model-icon"+(e.className?" "+e.className:""),style:o,...s?{}:{"aria-hidden":!0}},n.createElement("img",{key:r,src:a.href,alt:s?a.label:"",title:s?a.label:void 0,width:t,height:t,loading:"lazy",decoding:"async",draggable:!1,onError:()=>l(r)}))}),mt=n.memo(function(e){const t="en"===e.language?"en":"zh",a=(e,a)=>"en"===t?a:e,r=Array.isArray(e.rows)?e.rows:[],i=n.useMemo(()=>r.find(t=>t.id===e.selectedId)||r[0]||null,[r,e.selectedId]),l=n.useRef(null),o=()=>{!0!==e.hasMore||e.loading||"function"==typeof e.onLoadMore&&e.onLoadMore()};n.useEffect(()=>{const t=l.current;null!==t&&(!0!==e.hasMore||e.loading||t.scrollHeight<=t.clientHeight+4&&o())},[r,e.hasMore,e.loading]);const s=e=>e&&"ledger-recovery"===e.materialization?a("账本恢复","Ledger recovery"):e&&"ledger-reuse"===e.materialization?a("账本复用","Ledger reuse"):e&&"scan"===e.materialization?a("扫描","Scan"):e&&"live"===e.materialization?a("实时","Live"):a("未知","Unknown"),c=(e,a)=>e&&Number.isFinite(e.time)?new Date(e.time).toLocaleString("en"===t?"en-US":"zh-CN","en"===t?a?{timeZone:"UTC"}:{timeZone:"UTC",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}:a?void 0:{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"—",u=t=>{"function"==typeof e.onSelect&&e.onSelect(t)};return n.createElement("div",{className:"uh-panel uh-records-panel",ref:e.panelRef,style:{display:e.visible?"block":"none"}},n.createElement("div",{className:"uh-records-head"},n.createElement("div",{},n.createElement("h3",{className:"uh-tbl-title uh-title-with-icon"},n.createElement(C,{name:"list",size:16}),a("请求日志","Request Logs")),n.createElement("div",{className:"uh-note"},e.scopeLabel+(e.scopeUtc?" · UTC":""))),n.createElement("div",{className:"uh-actions"},e.loading?n.createElement("span",{className:"uh-query-note"},a("同步中…","Refreshing…")):null,n.createElement("button",{type:"button",className:"uh-refresh",title:a("导出当前日志","Export current logs"),onClick:e.onExport,disabled:e.exporting||!e.scopeAvailable},n.createElement(C,{name:"export",size:13}),e.exporting?a("导出中…","Exporting…"):a("导出日志","Export logs")))),""!==e.error?n.createElement("div",{className:"uh-records-error",role:"alert"},"stale"===e.error?a("数据已更新,正在重新加载日志…","Data changed; reloading logs…"):"audit-export"===e.error?a("日志导出失败","Unable to export logs"):a("日志加载失败,请重试","Unable to load logs")):null,n.createElement("div",{className:"uh-records-note"},a("按时间倒序显示可审计的 Token 调用;选择一行查看 turn / step 和完整 Token 分桶。","Token calls are newest first; select a row to inspect its turn / step and token buckets.")),0!==r.length||e.loading?n.createElement("div",{className:"uh-records-scroll",ref:l,onScroll:e=>{const t=e.currentTarget;t.scrollTop+t.clientHeight>=t.scrollHeight-120&&o()}},n.createElement("div",{className:"uh-record-grid uh-record-header"},n.createElement("div",{},a("时间","Time")),n.createElement("div",{},a("Provider / 模型","Provider / Model")),n.createElement("div",{className:"uh-record-num"},"turn / step"),n.createElement("div",{className:"uh-record-num"},a("输入","Input")),n.createElement("div",{className:"uh-record-num"},a("缓存命中","Cache read")),n.createElement("div",{className:"uh-record-num"},a("缓存写入","Cache write")),n.createElement("div",{className:"uh-record-num"},a("输出","Output")),n.createElement("div",{className:"uh-record-num"},a("成本","Cost")),n.createElement("div",{},a("来源","Source"))),r.map(e=>n.createElement("div",{key:e.id,className:"uh-record-grid uh-record-row"+(i&&i.id===e.id?" uh-on":""),role:"button",tabIndex:0,"aria-pressed":i&&i.id===e.id,onClick:()=>u(e.id),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),u(e.id))}},n.createElement("div",{className:"uh-record-time"},c(e,!1)),n.createElement("div",{className:"uh-record-model",title:e.model||""},n.createElement("span",{className:"uh-model-label"},n.createElement(pt,{row:e,size:16}),n.createElement("span",{className:"uh-model-text"},e.model||a("未知模型","Unknown model"))),e.requestedModel&&e.actualModel&&e.requestedModel!==e.actualModel?n.createElement("small",{},e.requestedModel+" → "+e.actualModel):null),n.createElement("div",{className:"uh-record-num"},(null===e.turn||void 0===e.turn?"—":e.turn)+" / "+(null===e.step||void 0===e.step?"—":e.step)),n.createElement("div",{className:"uh-record-num"},w(ct(e,"input"))),n.createElement("div",{className:"uh-record-num"},w(ct(e,"cacheRead"))),n.createElement("div",{className:"uh-record-num"},w(ct(e,"cacheWrite"))),n.createElement("div",{className:"uh-record-num"},w(ct(e,"output"))),n.createElement("div",{className:"uh-record-num uh-cost-num"},G(e,t),!e.cost||"peak"!==e.cost.pricingBand&&"off-peak"!==e.cost.pricingBand?null:n.createElement("small",{className:"uh-record-band-badge"},"peak"===e.cost.pricingBand?"en"===t?"Peak":"峰":"en"===t?"OFF":"谷")),n.createElement("div",{className:"uh-record-source"},s(e))))):n.createElement("div",{className:"uh-empty"},a("当前范围没有可审计的 Token 调用","No auditable Token calls in this scope")),n.createElement("div",{className:"uh-records-footer"},n.createElement("span",{className:"uh-note"},r.length>0?e.hasMore?a("已显示 "+r.length+" 条,继续加载可查看更多",r.length+" shown; load more for additional records"):a("共显示 "+r.length+" 条",r.length+" records shown"):""),e.hasMore?n.createElement("button",{type:"button",className:"uh-refresh",onClick:e.onLoadMore,disabled:e.loading},e.loading?a("加载中…","Loading…"):a("加载更多","Load more")):null),i?n.createElement("div",{className:"uh-record-detail"},n.createElement("div",{className:"uh-record-detail-head"},n.createElement("strong",{},a("选中调用","Selected call")),n.createElement("span",{className:"uh-note"},c(i,!0))),n.createElement("div",{className:"uh-record-detail-meta"},n.createElement("span",{className:"uh-model-label"},n.createElement(pt,{row:i,size:16,showTitle:!0}),n.createElement("span",{},(i.provider||a("未知供应商","Unknown provider"))+" / "+(i.actualModel||i.requestedModel||i.model||a("未知模型","Unknown model")))),n.createElement("span",{},"turn "+(null===i.turn||void 0===i.turn?"—":i.turn)+" · step "+(null===i.step||void 0===i.step?"—":i.step)),n.createElement("span",{},a("来源:","Source: ")+s(i)),n.createElement("span",{},a("计价模型:","Pricing model: ")+(i.cost&&i.cost.pricingModel?i.cost.pricingModel:a("未计价","unpriced"))),n.createElement("span",{className:"uh-record-band "+(i.cost&&i.cost.pricingBand?"uh-record-band-"+i.cost.pricingBand:"")},a("计费档位:","Billing band: ")+function(e,t){const a=e&&e.cost&&"object"==typeof e.cost?e.cost:{};return"peak"===a.pricingBand?"en"===t?"Peak":"峰时":"off-peak"===a.pricingBand?!0===a.pricingHoliday?"en"===t?"Holiday off-peak":"节假日谷时":"en"===t?"Off-peak":"谷时":"route-not-official"===a.temporalExemptReason?"en"===t?"static (non-first-party)":"静态价(非官方直连)":"no-temporal-profile"===a.temporalExemptReason?"en"===t?"static (no band plan)":"静态价(无峰谷计划)":"—"}(i,t)),null!==J(i,t)?n.createElement("span",{className:"uh-record-band",title:i.cost&&i.cost.pricingPolicyHash||""},a("计费计划:","Plan: ")+J(i,t)):null),n.createElement("div",{className:"uh-record-token-strip"},["input","cacheRead","cacheWrite","output","reasoning"].map(e=>n.createElement("div",{key:e},n.createElement("span",{},"cacheRead"===e?a("缓存命中","Cache read"):"cacheWrite"===e?a("缓存写入","Cache write"):"reasoning"===e?a("推理","Reasoning"):"input"===e?a("输入","Input"):a("输出","Output")),n.createElement("strong",{},w(ct(i,e))))),n.createElement("div",{className:"uh-record-token-total"},n.createElement("span",{},a("总处理","Total")),n.createElement("strong",{},w(ct(d=i,"input")+ct(d,"cacheRead")+ct(d,"cacheWrite")+ct(d,"output")+ct(d,"reasoning")))),n.createElement("div",{className:"uh-record-token-total"},n.createElement("span",{},a("成本","Cost")),n.createElement("strong",{},G(i,t))))):null);var d},function(e,t){return e.visible===t.visible&&e.scopeLabel===t.scopeLabel&&e.scopeUtc===t.scopeUtc&&e.scopeAvailable===t.scopeAvailable&&e.loading===t.loading&&e.exporting===t.exporting&&e.error===t.error&&e.rows===t.rows&&e.selectedId===t.selectedId&&e.hasMore===t.hasMore&&e.language===t.language&&e.actionKey===t.actionKey}),ht=n.memo(function(e){const t=Array.isArray(e.options)?e.options:[],a=void 0===e.value||null===e.value?"":String(e.value),r=t.find(e=>String(e.value)===a),[i,l]=n.useState(!1),o=n.useRef(null),s=n.useRef(null);n.useEffect(()=>{i&&null!==s.current&&"function"==typeof s.current.scrollIntoView&&s.current.scrollIntoView({block:"nearest",inline:"nearest"})},[i]),n.useEffect(()=>{if(!i||"undefined"==typeof document)return;const e=e=>{o.current&&!o.current.contains(e.target)&&l(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[i]);const c=t=>{const a=null==t||void 0===t.iconKey||null===t.iconKey?null:t.iconKey;return null===a?n.createElement(C,{name:e.icon||"chart",size:14}):n.createElement(pt,{iconKey:a,size:14})};return n.createElement("div",{className:"uh-language-menu uh-filter-menu"+(e.className?" "+e.className:"")+(i?" uh-open":""),ref:o,onKeyDown:e=>{"Escape"===e.key&&i&&(e.preventDefault(),e.stopPropagation(),l(!1))}},n.createElement("button",{type:"button",className:"uh-language-trigger uh-filter-trigger"+(i?" uh-open":""),title:r?r.label:e.label,"aria-label":e.ariaLabel||e.label,"aria-haspopup":"listbox","aria-expanded":i,onClick:()=>l(e=>!e)},c(r),n.createElement("span",{className:"uh-filter-label"},r?r.label:e.label),n.createElement(C,{name:"chevron",size:13,className:"uh-language-caret"})),i?n.createElement("div",{className:"uh-language-options uh-filter-options",role:"listbox","aria-label":e.ariaLabel||e.label},t.map(t=>{const r=String(t.value),i=r===a;return n.createElement("button",{key:r,type:"button",role:"option","aria-selected":i,ref:i?s:void 0,className:"uh-language-option"+(i?" uh-on":""),onClick:()=>{return t=r,"function"==typeof e.onChange&&e.onChange(t),void l(!1);var t}},c(t),n.createElement("span",{className:"uh-filter-option-label"},t.label),i?n.createElement(C,{name:"check",size:14,className:"uh-language-option-check"}):null)})):null)}),gt="dsh-all-usage/styles.css";if("undefined"!=typeof document){let e=document.querySelector("style[data-plugin-css="+JSON.stringify(gt)+"]");null===e&&(e=document.createElement("style"),e.dataset.plugin="dsh-all-usage",e.dataset.pluginCss=gt,document.head.appendChild(e)),e.textContent='\n.uh-page { display:flex; flex-direction:column; gap:14px; padding:2px 2px 28px; font-family:inherit; }\n.uh-head { position:relative; z-index:20; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }\n.uh-title { margin:0; font-size:15px; font-weight:600; color:var(--dsw-alias-label-primary); }\n.uh-title-wrap { display:flex; align-items:center; gap:10px; flex-wrap:wrap; min-width:0; }\n/* Version chip: the running version plus the registry verdict, clickable to the repo. */\n.uh-version { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--dsw-alias-border-l1); background:transparent; color:var(--dsw-alias-label-secondary); border-radius:999px; padding:2px 9px; font:inherit; font-size:12px; cursor:pointer; transition:background-color .15s ease, border-color .15s ease, color .15s ease; }\n.uh-version:hover { background:var(--dsw-alias-bg-layer-1); color:var(--dsw-alias-label-primary); }\n.uh-version-number { font-variant-numeric:tabular-nums; }\n.uh-version-status { color:var(--dsw-alias-label-tertiary, var(--dsw-alias-label-secondary)); }\n.uh-version-outdated { border-color:color-mix(in srgb, var(--dsw-alias-brand-primary) 55%, transparent); color:var(--dsw-alias-brand-primary); }\n.uh-version-outdated .uh-version-status { color:inherit; font-weight:600; }\n.uh-gh { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--dsw-alias-border-l1); background:transparent; color:var(--dsw-alias-label-secondary); border-radius:999px; padding:2px 9px; font:inherit; font-size:11px; line-height:1.6; cursor:pointer; }\n.uh-gh:hover { background:var(--dsw-alias-bg-layer-1); color:var(--dsw-alias-label-primary); }\n.uh-gh-star { flex:none; fill:#f5c542; }\n.uh-gh-mark { flex:none; fill:var(--dsw-alias-label-primary); }\n.uh-gh-label { color:var(--dsw-alias-label-primary); font-weight:600; letter-spacing:0; }\n.uh-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }\n.uh-language-menu, .uh-filter-menu { position:relative; z-index:12; }\n.uh-filter-menu { flex:0 1 auto; min-width:0; }\n.uh-filter-workspace { width:180px; }\n.uh-filter-provider { width:180px; }\n.uh-filter-model { width:260px; }\n.uh-filter-menu.uh-open { z-index:14; }\n.uh-language-trigger { display:inline-flex; align-items:center; gap:6px; min-height:30px; padding:4px 9px 4px 10px; border:1px solid transparent; border-radius:15px; background:color-mix(in srgb, var(--dsw-alias-label-primary) 7%, var(--dsw-alias-bg-layer-1)); color:var(--dsw-alias-label-primary); font:inherit; font-size:12px; font-weight:600; line-height:1; cursor:pointer; transition:border-color .15s ease, background-color .15s ease, transform .1s ease; }\n.uh-filter-trigger { width:100%; min-width:0; justify-content:flex-start; }\n.uh-language-trigger:hover, .uh-language-trigger.uh-open { border-color:color-mix(in srgb, var(--dsw-alias-brand-primary) 58%, var(--dsw-alias-border-l2)); background:color-mix(in srgb, var(--dsw-alias-brand-primary) 13%, var(--dsw-alias-bg-layer-1)); }\n.uh-language-trigger:active { transform:scale(.96); }\n.uh-language-label { min-width:26px; text-align:left; }\n.uh-filter-label { min-width:0; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:left; }\n.uh-language-caret { color:var(--dsw-alias-label-secondary); transition:transform .18s ease; }\n.uh-language-trigger.uh-open .uh-language-caret { transform:rotate(180deg); }\n.uh-language-menu.uh-open { z-index:30; }\n.uh-language-options { position:absolute; top:calc(100% + 7px); right:0; min-width:142px; padding:5px; border:1px solid var(--dsw-alias-border-l2); border-radius:12px; background:var(--dsw-alias-bg-layer-1); box-shadow:0 14px 28px color-mix(in srgb, #000 24%, transparent); animation:uh-menu-in .16s ease both; }\n.uh-filter-options { left:0; right:auto; min-width:100%; max-width:300px; }\n.uh-language-option { display:flex; align-items:center; gap:8px; width:100%; min-height:32px; padding:6px 8px; border:0; border-radius:8px; background:transparent; color:var(--dsw-alias-label-primary); font:inherit; font-size:12px; text-align:left; cursor:pointer; transition:background-color .14s ease, color .14s ease; }\n.uh-filter-option-label { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.uh-language-option:hover, .uh-language-option:focus-visible { background:color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, var(--dsw-alias-bg-layer-2)); outline:0; }\n.uh-language-option.uh-on { background:color-mix(in srgb, var(--dsw-alias-brand-primary) 19%, var(--dsw-alias-bg-layer-2)); color:var(--dsw-alias-label-primary); font-weight:600; }\n.uh-language-option-check { margin-left:auto; color:var(--dsw-alias-brand-primary); }\n/* Provider and model lists grow with the ledger; the menu scrolls inside itself\n instead of running past the bottom of the window. */\n.uh-filter-options { max-height:min(60vh, 420px); overflow-y:auto; overscroll-behavior:contain; }\n.uh-range { display:inline-flex; border:1px solid var(--dsw-alias-border-l2); border-radius:8px; overflow:hidden; }\n.uh-range button { border:0; background:transparent; color:var(--dsw-alias-label-secondary); padding:4px 12px; font-size:12px; cursor:pointer; font-family:inherit; transition:background-color .15s ease, color .15s ease; }\n.uh-range button + button { border-left:1px solid var(--dsw-alias-border-l2); }\n.uh-range button.uh-on { background:color-mix(in srgb, var(--dsw-alias-brand-primary) 20%, var(--dsw-alias-bg-layer-2)); color:var(--dsw-alias-label-primary); font-weight:600; }\n.uh-custom-range { display:grid; grid-template-columns:minmax(180px, 1fr) auto auto; gap:10px 14px; align-items:end; padding:12px; border:1px solid var(--dsw-alias-border-l1); border-radius:10px; background:var(--dsw-alias-bg-layer-1); }\n.uh-custom-range-meta { min-width:0; }\n.uh-custom-range-title { display:flex; align-items:center; gap:7px; color:var(--dsw-alias-label-primary); font-size:13px; font-weight:600; }\n.uh-custom-range-note { margin-top:3px; color:var(--dsw-alias-label-secondary); font-size:11px; line-height:1.45; }\n.uh-custom-range-fields { display:grid; grid-template-columns:repeat(2, minmax(136px, 1fr)); gap:8px; }\n.uh-custom-range-field { display:flex; flex-direction:column; gap:4px; color:var(--dsw-alias-label-secondary); font-size:11px; }\n.uh-custom-range-field input { min-width:0; min-height:30px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:3px 7px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:12px; outline:none; }\n.uh-custom-range-field input:focus { border-color:var(--dsw-alias-brand-primary); }\n.uh-custom-range-actions { display:flex; gap:6px; }\n.uh-custom-range-cancel, .uh-custom-range-apply { min-height:30px; border-radius:6px; padding:4px 10px; font:inherit; font-size:12px; cursor:pointer; }\n.uh-custom-range-cancel { border:1px solid var(--dsw-alias-border-l2); background:transparent; color:var(--dsw-alias-label-primary); }\n.uh-custom-range-apply { border:1px solid var(--dsw-alias-brand-primary); background:color-mix(in srgb, var(--dsw-alias-brand-primary) 16%, transparent); color:var(--dsw-alias-label-primary); }\n.uh-custom-range-apply:disabled { opacity:.48; cursor:not-allowed; }\n.uh-custom-range-error { grid-column:1 / -1; color:#d92d20; font-size:12px; }\n.uh-refresh { border:1px solid var(--dsw-alias-border-l2); background:var(--dsw-alias-bg-layer-1); color:var(--dsw-alias-label-primary); border-radius:8px; padding:4px 12px; font-size:12px; cursor:pointer; font-family:inherit; transition:border-color .15s ease, color .15s ease, transform .1s ease; }\n.uh-refresh:hover { border-color:var(--dsw-alias-brand-primary); }\n.uh-refresh:active, .uh-chip:active, .uh-range button:active { transform:scale(.96); }\n.uh-alias-panel-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; font-size:13px; font-weight:600; color:var(--dsw-alias-label-primary); }\n.uh-alias-close { border:0; background:transparent; color:var(--dsw-alias-label-secondary); font-size:12px; cursor:pointer; font-family:inherit; padding:0; transition:color .15s ease; }\n.uh-alias-close:hover { color:var(--dsw-alias-brand-primary); }\n.uh-alias-list { display:grid; grid-template-columns:repeat(auto-fill, minmax(250px, 1fr)); gap:8px 16px; max-height:240px; overflow-y:auto; }\n.uh-alias-item { display:flex; align-items:center; gap:8px; min-width:0; }\n.uh-alias-folder { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; color:var(--dsw-alias-label-secondary); }\n.uh-alias-input { flex:none; width:150px; border:1px solid var(--dsw-alias-border-l2); background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); border-radius:6px; padding:3px 8px; font-size:12px; font-family:inherit; outline:none; transition:border-color .15s ease; }\n.uh-alias-input:focus { border-color:var(--dsw-alias-brand-primary); }\n.uh-alias-panel-foot { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:10px; padding-top:10px; border-top:1px solid var(--dsw-alias-border-l1); }\n.uh-alias-ok { border:1px solid var(--dsw-alias-brand-primary); background:color-mix(in srgb, var(--dsw-alias-brand-primary) 16%, transparent); color:var(--dsw-alias-label-primary); border-radius:6px; font-size:12px; padding:3px 12px; cursor:pointer; font-family:inherit; flex:none; transition:transform .1s ease; }\n.uh-alias-ok:active { transform:scale(.96); }\n.uh-anim-panel { animation:uh-panel-in .28s ease both; }\n.uh-pricing-panel { display:flex; flex-direction:column; gap:12px; }\n.uh-pricing-head, .uh-pricing-toolbar, .uh-pricing-foot { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }\n.uh-pricing-note { color:var(--dsw-alias-label-secondary); font-size:12px; line-height:1.55; }\n.uh-pricing-toolbar { padding:10px 0; border-top:1px solid var(--dsw-alias-border-l1); border-bottom:1px solid var(--dsw-alias-border-l1); }\n.uh-pricing-switch { display:inline-flex; align-items:center; gap:7px; color:var(--dsw-alias-label-primary); font-size:12px; }\n.uh-pricing-section { display:flex; flex-direction:column; gap:8px; }\n.uh-pricing-table-wrap { max-height:392px; overflow-x:hidden; overflow-y:scroll; scrollbar-gutter:stable; scrollbar-width:auto; scrollbar-color:#707780 #1d1f22; border:1px solid var(--dsw-alias-border-l1); border-radius:8px; background:var(--dsw-alias-bg-layer-2); }\n.uh-pricing-model-table { width:100%; min-width:1080px; border-collapse:collapse; table-layout:fixed; font-size:11px; }\n.uh-pricing-model-table th, .uh-pricing-model-table td { min-width:0; padding:8px 9px; border-bottom:1px solid var(--dsw-alias-border-l1); text-align:left; vertical-align:middle; }\n.uh-pricing-model-table th { position:sticky; top:0; z-index:40; color:var(--dsw-alias-label-secondary); background:var(--dsw-alias-bg-layer-2); font-weight:650; white-space:nowrap; }\n.uh-pricing-model-table th:nth-child(1) { width:24%; }\n.uh-pricing-model-table th:nth-child(2) { width:84px; }\n.uh-pricing-model-table th:nth-child(3) { width:20%; }\n.uh-pricing-model-table th:nth-child(4) { width:96px; }\n.uh-pricing-model-table th:nth-child(n+5) { width:100px; text-align:right; }\n.uh-pricing-model-table td:nth-child(n+5) { text-align:right; }\n.uh-pricing-model-table tbody tr:last-child td { border-bottom:0; }\n.uh-pricing-model-table tbody tr:not(.uh-pricing-tier-row):hover { background:color-mix(in srgb, var(--dsw-alias-bg-layer-1) 65%, transparent); }\n.uh-pricing-model-name, .uh-pricing-model-target { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--dsw-alias-label-primary); }\n.uh-pricing-model-rate { color:var(--dsw-alias-label-secondary); font-variant-numeric:tabular-nums; white-space:nowrap; }\n.uh-pricing-status, .uh-pricing-tier-badge { display:inline-flex; justify-content:center; padding:3px 6px; border-radius:6px; font-size:10px; font-weight:650; white-space:nowrap; }\n.uh-pricing-status-priced { color:#157347; background:color-mix(in srgb, #30d158 22%, transparent); }\n.uh-pricing-status-unpriced, .uh-pricing-status-ambiguous, .uh-pricing-status-unsupported { color:#9a5b00; background:color-mix(in srgb, #ff9f0a 20%, transparent); }\n.uh-pricing-tier-badge { color:var(--dsw-alias-brand-primary); background:color-mix(in srgb, var(--dsw-alias-brand-primary) 15%, transparent); }\n.uh-pricing-tier-badge.uh-flat { color:var(--dsw-alias-label-secondary); background:var(--dsw-alias-bg-layer-1); }\n.uh-pricing-tier-row > td { padding:0 9px 8px; background:color-mix(in srgb, var(--dsw-alias-bg-layer-1) 36%, transparent); }\n.uh-pricing-tier-details > summary { display:inline-flex; align-items:center; gap:6px; min-height:28px; color:var(--dsw-alias-label-secondary); cursor:pointer; list-style:none; font-size:11px; }\n.uh-pricing-tier-details > summary::-webkit-details-marker { display:none; }\n.uh-pricing-tier-caret { transition:transform .15s ease; }\n.uh-pricing-tier-details[open] .uh-pricing-tier-caret { transform:rotate(180deg); }\n.uh-pricing-tier-context { margin-left:6px; color:var(--dsw-alias-label-tertiary, var(--dsw-alias-label-secondary)); }\n.uh-pricing-tier-table { width:100%; margin:2px 0 5px; border:1px solid var(--dsw-alias-border-l1); border-radius:6px; border-collapse:separate; border-spacing:0; overflow:hidden; table-layout:fixed; background:var(--dsw-alias-bg-base); }\n.uh-pricing-tier-table th, .uh-pricing-tier-table td { position:static; width:auto !important; padding:6px 8px; border-bottom:1px solid var(--dsw-alias-border-l1); text-align:right !important; background:transparent; font-size:10px; }\n.uh-pricing-tier-table th:first-child, .uh-pricing-tier-table td:first-child { width:30% !important; text-align:left !important; }\n.uh-pricing-tier-table tbody tr:last-child td { border-bottom:0; }\n.uh-pricing-tier-table tbody tr:hover { background:color-mix(in srgb, var(--dsw-alias-brand-primary) 6%, transparent); }\n.uh-pricing-model-search { position:relative; z-index:2; min-width:0; display:flex; align-items:center; gap:6px; }\n.uh-pricing-model-search .uh-pricing-model-search-input { flex:1 1 auto; width:auto; }\n.uh-pricing-clear-mapping { flex:none; white-space:nowrap; }\n.uh-pricing-model-search:focus-within { z-index:30; }\n.uh-pricing-model-search-input { box-sizing:border-box; width:100%; min-width:0; min-height:30px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:4px 7px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:11px; outline:none; }\n.uh-pricing-model-search-input:focus { border-color:var(--dsw-alias-brand-primary); }\n.uh-pricing-model-options { top:calc(100% + 7px); left:0; right:auto; width:100%; min-width:280px; max-height:240px; overflow-y:auto; z-index:40; }\n.uh-pricing-model-option { align-items:flex-start; }\n.uh-pricing-model-option-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.uh-pricing-model-option-id { margin-left:auto; padding-left:10px; color:var(--dsw-alias-label-secondary); font-size:10px; white-space:nowrap; }\n.uh-pricing-edit-row { display:grid; grid-template-columns:minmax(240px,1.2fr) minmax(260px,1.3fr) minmax(78px,.45fr) 32px; gap:10px; align-items:center; min-width:650px; }\n.uh-pricing-price-row { grid-template-columns:repeat(5,minmax(108px,1fr)) 32px; min-width:650px; }\n.uh-pricing-price-head { display:grid; grid-template-columns:repeat(5,minmax(108px,1fr)) 32px; gap:10px; align-items:center; min-width:650px; color:var(--dsw-alias-label-secondary); font-size:10px; }\n.uh-pricing-price-head span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.uh-pricing-edit-row input, .uh-pricing-tier-edit-row input { box-sizing:border-box; min-width:0; min-height:30px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:4px 7px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:11px; outline:none; }\n.uh-pricing-edit-row input:focus, .uh-pricing-tier-edit-row input:focus { border-color:var(--dsw-alias-brand-primary); }\n.uh-pricing-edit-row .uh-refresh, .uh-pricing-tier-edit-row .uh-refresh { min-height:30px; padding:0; }\n.uh-pricing-overrides { display:flex; flex-direction:column; min-width:760px; }\n.uh-pricing-override { display:flex; flex-direction:column; gap:8px; padding:10px 0; border-bottom:1px solid var(--dsw-alias-border-l1); }\n.uh-pricing-override:last-child { border-bottom:0; }\n.uh-pricing-tier-editor { margin-left:10px; padding-left:12px; border-left:2px solid color-mix(in srgb, var(--dsw-alias-brand-primary) 34%, var(--dsw-alias-border-l1)); }\n.uh-pricing-tier-editor-head { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:30px; }\n.uh-pricing-tier-editor-title { display:flex; align-items:baseline; gap:8px; min-width:0; }\n.uh-pricing-tier-editor-title strong { font-size:11px; }\n.uh-pricing-tier-editor-title span { color:var(--dsw-alias-label-secondary); font-size:10px; }\n.uh-pricing-tier-edit-head, .uh-pricing-tier-edit-row { display:grid; grid-template-columns:minmax(120px,.85fr) repeat(4,minmax(72px,1fr)) 30px; gap:10px; align-items:center; min-width:0; }\n.uh-pricing-tier-edit-head { margin:5px 0; color:var(--dsw-alias-label-secondary); font-size:10px; }\n.uh-pricing-tier-edit-row { margin-top:7px; }\n.uh-pricing-tier-edit-row.uh-invalid input { border-color:var(--dsw-alias-warning, #a55b00); }\n.uh-pricing-tier-empty { padding:5px 0; color:var(--dsw-alias-label-secondary); font-size:10px; }\n.uh-pricing-error { color:var(--dsw-alias-warning, #a55b00); font-size:12px; line-height:1.45; }\n.uh-pricing-foot { padding-top:4px; }\n\n.uh-pricing-table-note { color:var(--dsw-alias-label-secondary); font-size:11px; line-height:1.5; }\n.uh-pricing-price-table { width:100%; min-width:0; }\n.uh-pricing-price-table th:nth-child(1) { width:20%; }\n.uh-pricing-price-table th:nth-child(2) { width:24%; }\n.uh-pricing-price-table th:nth-child(3), .uh-pricing-price-table th:nth-child(4), .uh-pricing-price-table th:nth-child(5), .uh-pricing-price-table th:nth-child(6) { width:11%; }\n.uh-pricing-price-table th:nth-child(7) { width:12%; }\n.uh-pricing-table-wrap .uh-pricing-price-table th, .uh-pricing-table-wrap .uh-pricing-price-table td { text-align:left; }\n.uh-pricing-price-table th, .uh-pricing-price-table td { padding:8px 8px; }\n.uh-pricing-price-table td { vertical-align:top; }\n.uh-pricing-row-flags { display:flex; align-items:center; flex-wrap:wrap; gap:4px; margin-top:5px; }\n.uh-pricing-flag { padding:2px 6px; border-radius:999px; background:var(--dsw-alias-bg-layer-1); color:var(--dsw-alias-label-secondary); font-size:10px; white-space:nowrap; }\n.uh-pricing-configured-row { background:color-mix(in srgb, var(--dsw-alias-bg-layer-1) 42%, transparent); }\n/* Unknown usage (the host did not label the row) is not the same verdict as\n "no ledger usage", so it must not read like one. */\n.uh-pricing-unknown-row { background:color-mix(in srgb, var(--dsw-alias-bg-layer-1) 24%, transparent); }\n.uh-pricing-flag-unknown { border-style:dashed; opacity:.75; }\n.uh-pricing-rate-input { box-sizing:border-box; width:100%; min-width:0; min-height:30px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:4px 7px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:11px; font-variant-numeric:tabular-nums; outline:none; }\n.uh-pricing-rate-input:focus { border-color:var(--dsw-alias-brand-primary); }\n.uh-pricing-map-cell { display:flex; flex-direction:column; gap:6px; }\n.uh-pricing-map-sub { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }\n.uh-pricing-map-field { display:inline-flex; align-items:center; gap:5px; color:var(--dsw-alias-label-secondary); font-size:10px; }\n.uh-pricing-map-field input, .uh-pricing-map-field select { box-sizing:border-box; min-height:26px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:2px 6px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:11px; outline:none; }\n.uh-pricing-map-field input { width:70px; }\n.uh-pricing-link { border:0; background:transparent; color:var(--dsw-alias-brand-primary); font:inherit; font-size:11px; cursor:pointer; padding:2px 0; text-decoration:underline; }\n.uh-pricing-link:disabled { color:var(--dsw-alias-label-secondary); cursor:default; text-decoration:none; }\n.uh-pricing-chip { min-height:28px; padding:3px 9px; border:1px solid var(--dsw-alias-border-l2); border-radius:999px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-secondary); font:inherit; font-size:10px; cursor:pointer; white-space:nowrap; }\n.uh-pricing-chip.uh-on, .uh-pricing-chip.uh-strong { border-color:var(--dsw-alias-brand-primary); color:var(--dsw-alias-label-primary); background:color-mix(in srgb, var(--dsw-alias-brand-primary) 12%, transparent); }\n.uh-pricing-row-actions { display:flex; align-items:center; flex-wrap:wrap; gap:5px; white-space:nowrap; }\n.uh-pricing-editor-row > td { padding:0 9px 10px; background:color-mix(in srgb, var(--dsw-alias-bg-layer-1) 36%, transparent); }\n.uh-pricing-editor { display:flex; flex-direction:column; gap:10px; min-width:0; overflow-x:auto; }\n.uh-pricing-editor-foot { display:flex; justify-content:flex-end; }\n.uh-pricing-temporal-fields { display:flex; align-items:flex-end; flex-wrap:wrap; gap:10px; margin-top:6px; }\n.uh-pricing-temporal-fields label { display:inline-flex; flex-direction:column; gap:4px; color:var(--dsw-alias-label-secondary); font-size:10px; }\n.uh-pricing-temporal-fields input { box-sizing:border-box; min-height:28px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:3px 7px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:11px; outline:none; }\n.uh-pricing-temporal-fields input:focus { border-color:var(--dsw-alias-brand-primary); }\n.uh-pricing-temporal-rule { margin-top:8px; padding:8px 10px; border:1px solid var(--dsw-alias-border-l1); border-radius:8px; background:var(--dsw-alias-bg-base); }\n.uh-pricing-temporal-rule-head { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }\n.uh-pricing-temporal-rule-name { color:var(--dsw-alias-label-secondary); font-size:10px; font-variant-numeric:tabular-nums; }\n.uh-pricing-weekdays { display:inline-flex; gap:3px; }\n.uh-pricing-weekday { width:26px; height:26px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-secondary); font:inherit; font-size:10px; cursor:pointer; }\n.uh-pricing-weekday.uh-on { border-color:var(--dsw-alias-brand-primary); color:var(--dsw-alias-label-primary); background:color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, transparent); }\n.uh-pricing-temporal-windows { display:flex; align-items:center; flex-wrap:wrap; gap:7px; margin-top:7px; }\n.uh-pricing-temporal-window { display:inline-flex; align-items:center; gap:5px; }\n.uh-pricing-time-input { box-sizing:border-box; width:66px; min-height:28px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:3px 6px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:11px; font-variant-numeric:tabular-nums; text-align:center; outline:none; }\n.uh-pricing-time-input:focus { border-color:var(--dsw-alias-brand-primary); }\n.uh-pricing-time-sep { color:var(--dsw-alias-label-secondary); }\n.uh-pricing-temporal-rates { display:flex; flex-wrap:wrap; gap:9px; margin-top:8px; }\n.uh-pricing-temporal-rate { display:inline-flex; align-items:center; gap:5px; color:var(--dsw-alias-label-secondary); font-size:10px; }\n.uh-pricing-temporal-rate input { box-sizing:border-box; width:86px; min-height:28px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:3px 7px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:11px; font-variant-numeric:tabular-nums; outline:none; }\n.uh-pricing-temporal-foot { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:8px; }\n.uh-pricing-temporal-holidays { display:flex; flex-direction:column; gap:6px; margin-top:8px; padding:8px 10px; border:1px solid var(--dsw-alias-border-l1); border-radius:8px; background:var(--dsw-alias-bg-base); }\n.uh-pricing-holiday-load { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }\n.uh-pricing-holiday-load input[type=\'number\'] { box-sizing:border-box; width:82px; min-height:28px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:3px 7px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:11px; outline:none; }\n.uh-pricing-holiday-input { box-sizing:border-box; width:100%; min-height:74px; resize:vertical; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:6px 8px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:11px; font-variant-numeric:tabular-nums; outline:none; }\n.uh-pricing-holiday-input:focus { border-color:var(--dsw-alias-brand-primary); }\n.uh-pricing-warning { margin-top:7px; padding:7px 9px; border-radius:7px; border:1px solid color-mix(in srgb, var(--dsw-alias-warning, #d9822b) 40%, var(--dsw-alias-border-l1)); color:var(--dsw-alias-warning, #a55b00); font-size:11px; line-height:1.45; }\n@media (max-width:640px) {\n .uh-pricing-table-wrap { overflow-x:auto; }\n .uh-pricing-price-table { min-width:820px; }\n .uh-pricing-map-cell { min-width:170px; }\n}\n\n.uh-cost-num { color:var(--dsw-alias-label-primary); }\n.uh-progress { font-size:12px; color:var(--dsw-alias-label-secondary); display:flex; align-items:center; gap:10px; }\n.uh-sync-health { margin-top:8px; padding:8px 12px; display:flex; align-items:center; flex-wrap:wrap; gap:6px; border:1px solid var(--dsw-alias-border-l1); border-radius:10px; color:var(--dsw-alias-label-secondary); background:var(--dsw-alias-bg-layer-1); font-size:11px; line-height:1.45; }\n.uh-sync-health.uh-stale { color:var(--dsw-alias-warning, #a55b00); border-color:color-mix(in srgb, var(--dsw-alias-warning, #d9822b) 45%, var(--dsw-alias-border-l1)); }\n.uh-sync-retry { border:0; background:transparent; color:inherit; font:inherit; text-decoration:underline; cursor:pointer; padding:0 2px; }\n.uh-trend-panel { min-height:300px; animation:uh-panel-in .38s ease both; }\n.uh-trend-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:10px; }\n.uh-trend-head-side { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }\n.uh-trend-chart-wrap { position:relative; min-height:250px; width:100%; overflow:hidden; }\n.uh-trend-stage { display:grid; place-items:center; min-height:250px; width:100%; }\n.uh-trend-message { color:var(--dsw-alias-label-secondary); font-size:12px; }\n.uh-trend-spinner { width:24px; height:24px; border:2px solid color-mix(in srgb, var(--dsw-alias-brand-primary) 22%, var(--dsw-alias-border-l2)); border-top-color:var(--dsw-alias-brand-primary); border-radius:50%; animation:uh-spinner-turn .78s linear infinite; }\n.uh-trend-svg { display:block; width:100%; height:auto; min-height:220px; }\n.uh-trend-grid { stroke:var(--dsw-alias-border-l1); stroke-width:1; stroke-dasharray:3 4; opacity:.8; }\n.uh-trend-cursor { stroke:var(--dsw-alias-label-secondary); stroke-width:1; stroke-dasharray:3 4; opacity:.65; pointer-events:none; }\n.uh-trend-point { stroke:var(--dsw-alias-bg-layer-1); stroke-width:2; vector-effect:non-scaling-stroke; pointer-events:none; }\n.uh-trend-axis-label { fill:var(--dsw-alias-label-secondary); font-size:11px; font-family:inherit; }\n.uh-trend-line { fill:none; stroke-width:2.2; vector-effect:non-scaling-stroke; stroke-linecap:round; stroke-linejoin:round; opacity:.22; }\n.uh-trend-line-draw { fill:none; stroke-width:2.2; vector-effect:non-scaling-stroke; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:var(--uh-draw-length); stroke-dashoffset:var(--uh-draw-length); opacity:.96; pointer-events:none; animation:uh-trend-draw .95s cubic-bezier(.22,.61,.36,1) both; }\n.uh-trend-area { opacity:1; animation:uh-trend-fill .8s ease; }\n.uh-trend-bar { pointer-events:none; }\n@keyframes uh-trend-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }\n.uh-trend-bar-group { transform-box: fill-box; transform-origin: 50% 100%; animation:uh-trend-grow .5s cubic-bezier(.22,.61,.36,1) both; }\n@media (prefers-reduced-motion: reduce) { .uh-trend-bar-group { animation:none; } }\n.uh-trend-hit { fill:transparent; cursor:crosshair; outline:none; }\n.uh-trend-hit:focus { fill:color-mix(in srgb, var(--dsw-alias-brand-primary) 10%, transparent); outline:1px solid var(--dsw-alias-brand-primary); outline-offset:2px; }\n.uh-trend-tooltip { position:absolute; z-index:4; min-width:166px; padding:10px 11px; border:1px solid color-mix(in srgb, var(--dsw-alias-border-l2) 88%, transparent); border-radius:8px; background:color-mix(in srgb, var(--dsw-alias-bg-layer-1) 94%, transparent); box-shadow:0 10px 24px rgba(0,0,0,.22); color:var(--dsw-alias-label-primary); font-size:12px; line-height:1.45; pointer-events:none; opacity:0; visibility:hidden; transform:translate(14px,-50%) scale(.985); transform-origin:left center; transition:left .16s cubic-bezier(.22,.61,.36,1), top .16s cubic-bezier(.22,.61,.36,1), opacity .12s ease, transform .16s cubic-bezier(.22,.61,.36,1), visibility 0s linear .16s; }\n.uh-trend-tooltip.uh-left { transform:translate(calc(-100% - 14px),-50%) scale(.985); transform-origin:right center; }\n.uh-trend-tooltip.uh-visible { opacity:1; visibility:visible; transform:translate(14px,-50%) scale(1); transition-delay:0s; }\n.uh-trend-tooltip.uh-left.uh-visible { transform:translate(calc(-100% - 14px),-50%) scale(1); }\n.uh-trend-tooltip-title { display:block; margin-bottom:6px; color:var(--dsw-alias-label-primary); font-size:12px; font-weight:650; }\n.uh-trend-tooltip-row { display:grid; grid-template-columns:8px minmax(0,1fr) auto; align-items:center; gap:7px; min-width:0; margin-top:3px; font-size:11px; }\n.uh-trend-tooltip-row .uh-trend-dot { width:8px; height:8px; margin:0; }\n.uh-trend-tooltip-label { overflow:hidden; font-weight:600; text-overflow:ellipsis; white-space:nowrap; }\n.uh-trend-tooltip-value { color:inherit; font-weight:600; font-variant-numeric:tabular-nums; white-space:nowrap; }\n.uh-trend-dot { display:inline-block; width:7px; height:7px; margin-right:5px; border-radius:50%; vertical-align:1px; }\n.uh-trend-legend { display:flex; flex-wrap:wrap; gap:5px 8px; margin-top:5px; }\n.uh-trend-legend-item { display:inline-flex; align-items:center; gap:3px; border:0; border-radius:7px; padding:3px 6px; background:transparent; color:var(--dsw-alias-label-secondary); font:inherit; font-size:11px; cursor:pointer; transition:color .15s ease; }\n.uh-trend-legend-item:hover { background:var(--dsw-alias-bg-layer-2); color:var(--dsw-alias-label-primary); }\n.uh-trend-legend-item.uh-on { background:var(--dsw-alias-interactive-bg-hover); color:var(--dsw-alias-label-primary); }\n.uh-filter-bar { position:relative; z-index:10; display:flex; align-items:center; flex-wrap:wrap; gap:7px; }\n.uh-filter-clear { border:0; background:transparent; color:var(--dsw-alias-label-secondary); font:inherit; font-size:11px; cursor:pointer; text-decoration:underline; }\n.uh-query-note { color:var(--dsw-alias-label-secondary); font-size:11px; }\n.uh-detail-tabs { display:flex; align-items:center; flex-wrap:wrap; gap:4px; padding:4px; border:1px solid var(--dsw-alias-border-l1); border-radius:9px; background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 58%, transparent); }\n.uh-detail-tab { display:inline-flex; align-items:center; gap:6px; min-height:32px; padding:5px 11px; border:0; border-radius:7px; background:transparent; color:var(--dsw-alias-label-secondary); font:inherit; font-size:12px; cursor:pointer; transition:background-color .15s ease, color .15s ease, transform .12s ease; }\n.uh-detail-tab:hover { color:var(--dsw-alias-label-primary); background:var(--dsw-alias-bg-layer-2); }\n.uh-detail-tab.uh-on { color:var(--dsw-alias-label-primary); background:var(--dsw-alias-bg-layer-1); box-shadow:0 1px 3px rgba(0,0,0,.14); }\n.uh-records-panel { animation:uh-panel-in .28s ease both; }\n.uh-records-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:7px; }\n.uh-records-note { margin:8px 0 10px; color:var(--dsw-alias-label-secondary); font-size:11px; line-height:1.45; }\n.uh-records-error { margin:7px 0; color:var(--dsw-alias-warning, #a55b00); font-size:11px; }\n/* The log scrolls inside its own box (and pulls the next page as it nears the end),\n so a long history never pushes the rest of the panel off the screen. */\n.uh-records-scroll { max-height:min(62vh, 560px); overflow:auto; overscroll-behavior:contain; border:1px solid var(--dsw-alias-border-l1); border-radius:8px; }\n.uh-record-grid { display:grid; grid-template-columns:112px minmax(190px,1.45fr) 78px repeat(4,minmax(76px,.72fr)) 96px 82px; gap:0; min-width:900px; align-items:center; }\n.uh-record-grid > div { min-width:0; padding:8px 7px; border-bottom:1px solid var(--dsw-alias-border-l1); font-size:11px; }\n.uh-record-header { color:var(--dsw-alias-label-secondary); background:var(--dsw-alias-bg-layer-2); font-weight:600; }\n.uh-record-header > div { white-space:nowrap; }\n.uh-record-row { color:var(--dsw-alias-label-primary); cursor:pointer; outline:none; transition:background-color .14s ease, box-shadow .14s ease; }\n.uh-record-row:hover { background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 68%, transparent); }\n.uh-record-row.uh-on { background:color-mix(in srgb, var(--dsw-alias-brand-primary) 10%, var(--dsw-alias-bg-layer-1)); box-shadow:inset 3px 0 var(--dsw-alias-brand-primary); }\n.uh-record-row:focus-visible { box-shadow:inset 0 0 0 1px var(--dsw-alias-brand-primary); }\n.uh-record-row:last-child > div { border-bottom:0; }\n.uh-record-time, .uh-record-num { color:var(--dsw-alias-label-secondary); font-variant-numeric:tabular-nums; white-space:nowrap; }\n.uh-record-num { text-align:right; }\n.uh-model-icon { display:inline-flex; align-items:center; justify-content:center; flex:none; vertical-align:middle; }\n.uh-model-icon img { display:block; width:100%; height:100%; object-fit:contain; }\n.uh-model-icon-fallback { color:var(--dsw-alias-label-tertiary, var(--dsw-alias-label-secondary)); opacity:.85; }\n.uh-model-label { display:flex; align-items:center; gap:7px; min-width:0; }\n.uh-model-label .uh-model-text { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }\n.uh-record-model { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:550; }\n.uh-record-model small { display:block; overflow:hidden; color:var(--dsw-alias-label-secondary); font-size:10px; font-weight:400; text-overflow:ellipsis; white-space:nowrap; }\n.uh-record-source { color:var(--dsw-alias-label-secondary); white-space:nowrap; }\n.uh-record-band { white-space:nowrap; }\n.uh-record-band-badge { margin-left:6px; color:var(--dsw-alias-label-secondary); font-size:10px; }\n.uh-record-band-peak { color:var(--dsw-alias-warning, #a55b00); font-weight:600; }\n.uh-record-band-off-peak { color:#2e7d32; }\n.uh-records-footer { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:9px; }\n.uh-record-detail { margin-top:12px; padding:10px 11px; border-top:1px solid var(--dsw-alias-border-l2); background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 42%, transparent); animation:uh-detail-in .24s ease both; }\n.uh-record-detail-head, .uh-record-detail-meta { display:flex; align-items:center; flex-wrap:wrap; gap:7px 14px; }\n.uh-record-detail-head { justify-content:space-between; margin-bottom:5px; color:var(--dsw-alias-label-primary); font-size:12px; }\n.uh-record-detail-meta { color:var(--dsw-alias-label-secondary); font-size:11px; }\n.uh-record-token-strip { display:grid; grid-template-columns:repeat(5,minmax(72px,1fr)) repeat(2,minmax(82px,1.1fr)); gap:6px; margin-top:9px; }\n.uh-record-token-strip > div { display:flex; flex-direction:column; gap:2px; min-width:0; padding:6px 7px; border-radius:6px; background:var(--dsw-alias-bg-layer-2); }\n.uh-record-token-strip span { color:var(--dsw-alias-label-secondary); font-size:10px; }\n.uh-record-token-strip strong { color:var(--dsw-alias-label-primary); font-size:12px; font-variant-numeric:tabular-nums; }\n.uh-record-token-total { border:1px solid color-mix(in srgb, var(--dsw-alias-brand-primary) 38%, var(--dsw-alias-border-l1)) !important; }\n@keyframes uh-detail-in { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }\n@media (max-width:640px) {\n .uh-trend-head { flex-direction:column; }\n .uh-filter-menu { flex:1 1 130px; width:auto; }\n .uh-filter-trigger { max-width:100%; }\n .uh-trend-tooltip { min-width:116px; }\n .uh-records-head { flex-direction:column; }\n .uh-record-token-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }\n .uh-record-token-total { grid-column:1 / -1; }\n .uh-pricing-head { align-items:flex-start; }\n .uh-pricing-toolbar { align-items:flex-start; }\n .uh-pricing-edit-row { grid-template-columns:minmax(0,1fr) 36px; min-width:0; width:100%; }\n .uh-pricing-edit-row > .uh-pricing-model-search,\n .uh-pricing-price-row > input { grid-column:1 / -1; }\n .uh-pricing-edit-row > input[type=\'number\'] { grid-column:1; }\n .uh-pricing-edit-row > .uh-icon-button { grid-column:2; }\n .uh-pricing-price-head { display:none; }\n .uh-pricing-overrides { min-width:0; width:100%; }\n .uh-pricing-override { min-width:0; }\n .uh-pricing-price-row { grid-template-columns:minmax(0,1fr) 36px; min-width:0; }\n .uh-pricing-price-row > input[type=\'number\'] { grid-column:1 / -1; }\n .uh-pricing-tier-editor { margin-left:0; padding-left:0; border-left:0; }\n .uh-pricing-tier-editor-head { align-items:flex-start; flex-wrap:wrap; }\n .uh-pricing-tier-editor-title { flex-direction:column; gap:2px; }\n .uh-pricing-tier-edit-head { display:none; }\n .uh-pricing-tier-edit-row { grid-template-columns:minmax(0,1fr) 36px; min-width:0; padding:8px; border:1px solid var(--dsw-alias-border-l1); border-radius:6px; }\n .uh-pricing-tier-edit-row > input { grid-column:1 / -1; }\n .uh-pricing-tier-edit-row > .uh-icon-button { grid-column:2; }\n .uh-pricing-tier-context { display:block; margin:2px 0 0; }\n}\n.uh-bar { flex:1; height:6px; border-radius:3px; background:var(--dsw-alias-bg-layer-2); overflow:hidden; max-width:340px; }\n.uh-fill { height:100%; background:var(--dsw-alias-brand-primary); border-radius:3px; transition:width .3s ease; }\n.uh-cards { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:10px; }\n.uh-card { background:var(--dsw-alias-bg-layer-1); border:1px solid var(--dsw-alias-border-l1); border-radius:12px; padding:12px 14px; display:flex; flex-direction:column; gap:6px; min-height:86px; animation:uh-card-in .45s ease both; transition:transform .18s ease, border-color .18s ease, box-shadow .18s ease; }\n.uh-card:hover { transform:translateY(-2px); border-color:var(--dsw-alias-border-l2); box-shadow:0 6px 18px rgba(0,0,0,.10); }\n.uh-card-label { font-size:12px; color:var(--dsw-alias-label-secondary); }\n.uh-card-value { font-size:20px; font-weight:650; color:var(--dsw-alias-label-primary); line-height:1.2; }\n.uh-card-sub { font-size:11px; color:var(--dsw-alias-label-secondary); line-height:1.55; }\n.uh-wsbars { display:flex; flex-direction:column; gap:3px; margin-top:2px; }\n.uh-wsbar { display:flex; flex-direction:column; gap:1px; cursor:pointer; padding:1px 6px; margin:0 -6px; border-radius:8px; transition:background-color .15s ease; }\n.uh-wsbar:hover { background:var(--dsw-alias-bg-layer-2); }\n.uh-wsbar.uh-sel { outline:1px solid var(--dsw-alias-brand-primary); }\n.uh-wsbar-top { display:flex; align-items:center; gap:6px; min-width:0; }\n.uh-wsbar-title { font-size:12px; color:var(--dsw-alias-label-primary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; min-width:0; }\n.uh-wsbar-num { font-size:11px; font-variant-numeric:tabular-nums; color:var(--dsw-alias-label-secondary); flex:none; }\n.uh-panel { background:var(--dsw-alias-bg-layer-1); border:1px solid var(--dsw-alias-border-l1); border-radius:12px; padding:14px; }\n.uh-hm-head { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:10px; }\n.uh-chips { display:flex; flex-wrap:wrap; gap:6px; }\n.uh-hm-tools { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }\n.uh-heatmap-spans button { white-space:nowrap; }\n.uh-chip { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--dsw-alias-border-l2); background:transparent; color:var(--dsw-alias-label-primary); border-radius:999px; padding:2px 10px; font-size:11px; cursor:pointer; font-family:inherit; max-width:190px; transition:border-color .15s ease, background-color .15s ease, color .15s ease, transform .1s ease; }\n.uh-chip .uh-chip-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.uh-chip.uh-on { border-color:var(--dsw-alias-brand-primary); background:color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, transparent); }\n.uh-dot { width:8px; height:8px; border-radius:50%; flex:none; }\n.uh-legend { display:flex; align-items:center; gap:4px; font-size:11px; color:var(--dsw-alias-label-secondary); }\n.uh-legend .uh-cell { width:10px; height:10px; border-radius:2px; animation:none; }\n.uh-hm-scroll { overflow-x:auto; padding-bottom:2px; }\n.uh-months { position:relative; height:16px; margin-left:30px; width:calc(100% - 30px); min-width:686px; font-size:10px; color:var(--dsw-alias-label-secondary); }\n.uh-months span { position:absolute; top:0; }\n.uh-hm-body { display:flex; gap:6px; min-width:0; }\n.uh-wdays { display:grid; grid-template-rows:repeat(7,10px); gap:3px; font-size:10px; color:var(--dsw-alias-label-secondary); text-align:right; width:24px; }\n.uh-wdays span { line-height:10px; }\n.uh-grid { flex:1 1 auto; min-width:686px; display:grid; grid-auto-flow:column; grid-template-columns:repeat(53,minmax(10px,1fr)); grid-template-rows:repeat(7,minmax(10px,auto)); gap:3px; }\n.uh-cell { width:100%; height:auto; min-width:10px; aspect-ratio:1; border-radius:2px; background:var(--dsw-alias-bg-layer-2); animation:uh-cell-in .45s ease both; transition:transform .12s ease, box-shadow .12s ease; }\n.uh-cell:hover { transform:scale(1.35); box-shadow:0 1px 6px rgba(0,0,0,.28); position:relative; z-index:2; }\n.uh-cell.uh-today { box-shadow:0 0 0 2px rgba(9,105,218,.5); }\n.uh-tip { position:fixed; z-index:1200; background:var(--dsw-alias-bg-overlay); border:1px solid var(--dsw-alias-border-l2); border-radius:10px; padding:10px 12px; box-shadow:0 8px 24px rgba(0,0,0,.18); pointer-events:auto; min-width:200px; max-width:290px; animation:uh-tip-in .16s ease both; }\n.uh-tip-date { font-size:12px; font-weight:600; color:var(--dsw-alias-label-primary); margin-bottom:6px; }\n.uh-tip-row { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--dsw-alias-label-primary); padding:3px 6px; margin:0 -6px; border-radius:6px; cursor:pointer; transition:background-color .12s ease; }\n.uh-tip-row:hover { background:color-mix(in srgb, var(--dsw-alias-brand-primary) 12%, transparent); }\n.uh-tip-row .uh-n { margin-left:auto; font-variant-numeric:tabular-nums; color:var(--dsw-alias-label-secondary); }\n.uh-tip-tokens { font-size:11px; color:var(--dsw-alias-label-secondary); margin-top:6px; border-top:1px solid var(--dsw-alias-border-l1); padding-top:6px; }\n.uh-tbl-title { font-size:13px; font-weight:600; color:var(--dsw-alias-label-primary); margin:0 0 10px; }\n.uh-tbl-scroll { overflow-x:auto; }\n.uh-hrow, .uh-row { display:grid; grid-template-columns:minmax(160px,2.2fr) .7fr .9fr .9fr .9fr .9fr 1.1fr .9fr .8fr 1fr; gap:8px; align-items:center; min-width:900px; padding:7px 10px; border-radius:8px; font-size:12px; }\n.uh-model-hrow, .uh-model-row { display:grid; grid-template-columns:minmax(190px,2.2fr) .7fr .9fr .9fr .9fr .9fr 1.1fr .9fr .8fr; gap:8px; align-items:center; min-width:860px; padding:7px 10px; border-radius:8px; font-size:12px; }\n.uh-hrow { color:var(--dsw-alias-label-secondary); font-size:11px; }\n.uh-row { cursor:pointer; border:1px solid transparent; transition:background-color .15s ease, border-color .15s ease; }\n.uh-row:hover { background:var(--dsw-alias-bg-layer-2); }\n.uh-row.uh-sel { border-color:var(--dsw-alias-brand-primary); }\n.uh-num { text-align:right; font-variant-numeric:tabular-nums; color:var(--dsw-alias-label-primary); }\n.uh-hrow .uh-num { color:var(--dsw-alias-label-secondary); }\n.uh-ws-title { color:var(--dsw-alias-label-primary); font-weight:550; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.uh-row-title-wrap { min-width:0; }\n.uh-ws-path { color:var(--dsw-alias-label-secondary); font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.uh-barwrap { height:5px; border-radius:3px; background:var(--dsw-alias-bg-layer-2); overflow:hidden; margin-top:3px; }\n.uh-barwrap.uh-bar-thin { height:3px; margin-top:1px; }\n.uh-barfill { height:100%; border-radius:3px; transform-origin:left center; animation:uh-bar-grow .7s cubic-bezier(.22,.61,.36,1) both; transition:width .5s cubic-bezier(.22,.61,.36,1); }\n.uh-empty { color:var(--dsw-alias-label-secondary); font-size:12px; text-align:center; padding:26px 0; }\n.uh-note { font-size:11px; color:var(--dsw-alias-label-secondary); line-height:1.6; }\n.uh-side-entry { width:100%; border:0; background:transparent; color:var(--dsw-alias-label-secondary); border-radius:8px; min-height:36px; padding:7px 10px; display:flex; align-items:center; gap:9px; font:inherit; font-size:13px; cursor:pointer; text-align:left; }\n.uh-side-entry:hover { background:var(--dsw-alias-interactive-bg-hover); color:var(--dsw-alias-label-primary); }\n.uh-side-entry-icon { width:18px; text-align:center; flex:none; font-size:15px; }\n.uh-side-entry-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.uh-boundary-fallback { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; min-height:360px; padding:24px; border:1px solid var(--dsw-alias-border-l1); border-radius:12px; background:var(--dsw-alias-bg-layer-1); text-align:center; }\n.uh-boundary-title { color:var(--dsw-alias-label-primary); font-size:15px; font-weight:650; }\n.uh-boundary-note { max-width:420px; color:var(--dsw-alias-label-secondary); font-size:12px; line-height:1.6; }\n.uh-side-modal { position:fixed; inset:var(--uh-top-inset, 0px) 0 0 0; z-index:1100; background:color-mix(in srgb, #000 44%, transparent); display:flex; align-items:stretch; justify-content:center; padding:26px; }\n.uh-side-dialog { width:min(1120px, 100%); overflow-x:hidden; overflow-y:scroll; scrollbar-gutter:stable; scrollbar-width:auto; scrollbar-color:#707780 #1d1f22; background:var(--dsw-alias-bg-layer-1, #1a1c20); border:1px solid var(--dsw-alias-border-l2); border-radius:14px; box-shadow:0 18px 52px rgba(0,0,0,.35); padding:18px; }\n.uh-side-dialog::-webkit-scrollbar, .uh-pricing-table-wrap::-webkit-scrollbar { width:12px; height:12px; }\n.uh-side-dialog::-webkit-scrollbar-track, .uh-pricing-table-wrap::-webkit-scrollbar-track { background:#1d1f22; border-left:1px solid #363a40; }\n.uh-side-dialog::-webkit-scrollbar-thumb, .uh-pricing-table-wrap::-webkit-scrollbar-thumb { background:#707780; border:3px solid #1d1f22; border-radius:6px; }\n.uh-side-dialog::-webkit-scrollbar-thumb:hover, .uh-pricing-table-wrap::-webkit-scrollbar-thumb:hover { background:#9aa1aa; }\n.uh-side-dialog-head { display:flex; justify-content:flex-end; margin-bottom:8px; }\n@media (max-width: 640px) { .uh-side-modal { padding:0; } .uh-side-dialog { border-radius:0; border:0; padding:14px; } }\n/* iOS-style dashboard: grouped surfaces, tactile controls, and an elevated sheet. */\n.uh-page { gap:18px; max-width:1160px; margin:0 auto; padding:12px 2px 34px; font-family:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif; }\n.uh-head { position:sticky; top:-18px; z-index:20; margin:0 -2px; padding:18px 2px 14px; background:linear-gradient(color-mix(in srgb, var(--dsw-alias-bg-base) 88%, transparent), color-mix(in srgb, var(--dsw-alias-bg-base) 88%, transparent)), var(--dsw-alias-bg-layer-1, #1a1c20); border-bottom:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 76%, transparent); }\n.uh-title { font-size:22px; line-height:1.2; font-weight:700; letter-spacing:0; }\n.uh-actions { gap:8px; }\n.uh-range { padding:2px; gap:2px; border:0; border-radius:9px; background:color-mix(in srgb, var(--dsw-alias-label-primary) 10%, transparent); overflow:visible; }\n.uh-range button, .uh-range button + button { min-height:28px; border:0; border-radius:7px; padding:4px 10px; }\n.uh-range button.uh-on { background:var(--dsw-alias-bg-layer-1); box-shadow:0 1px 3px rgba(0,0,0,.16); }\n.uh-refresh { min-height:30px; border:0; border-radius:15px; padding:5px 12px; display:inline-flex; align-items:center; justify-content:center; gap:6px; background:color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, var(--dsw-alias-bg-layer-1)); color:var(--dsw-alias-brand-primary); font-weight:600; }\n.uh-line-icon { flex:none; }\n.uh-icon-button { width:30px; padding:0; }\n.uh-refresh:hover { border:0; background:color-mix(in srgb, var(--dsw-alias-brand-primary) 22%, var(--dsw-alias-bg-layer-1)); }\n.uh-progress { padding:10px 12px; background:color-mix(in srgb, var(--dsw-alias-brand-primary) 9%, var(--dsw-alias-bg-layer-1)); border:0; border-radius:12px; }\n.uh-cards { grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:10px; border:0; border-radius:0; overflow:visible; background:transparent; }\n.uh-card { min-height:84px; padding:12px 14px; gap:4px; border:0; border-radius:18px; background:var(--dsw-alias-bg-layer-1); box-shadow:0 1px 2px rgba(0,0,0,.07), 0 8px 22px rgba(0,0,0,.05); animation:none; }\n.uh-card:first-child { border:0; background:color-mix(in srgb, #0a84ff 15%, var(--dsw-alias-bg-layer-1)); }\n.uh-card:nth-child(2) { background:color-mix(in srgb, #30d158 13%, var(--dsw-alias-bg-layer-1)); }\n.uh-card:nth-child(3) { background:color-mix(in srgb, #ff9f0a 14%, var(--dsw-alias-bg-layer-1)); }\n.uh-card:hover { transform:translateY(-2px); box-shadow:0 12px 28px rgba(0,0,0,.12); }\n.uh-card-label { display:flex; align-items:center; gap:6px; font-size:12px; font-weight:600; letter-spacing:0; }\n.uh-ios-summary-label, .uh-section-title, .uh-title-with-icon { display:flex; align-items:center; gap:7px; }\n.uh-section-title { margin-bottom:12px; color:var(--dsw-alias-label-primary); font-size:14px; font-weight:650; }\n/* Raise the complete reading scale without changing the data grid geometry. */\n.uh-page { font-size:14px; }\n.uh-range button, .uh-refresh { font-size:13px; }\n.uh-card-label, .uh-ios-summary-label { font-size:13px; }\n.uh-card-sub, .uh-ios-summary-caption, .uh-note { font-size:12px; }\n.uh-hrow, .uh-row, .uh-model-hrow, .uh-model-row { font-size:13px; }\n.uh-tbl-title { font-size:15px; }\n.uh-num { font-variant-numeric:tabular-nums; }\n.uh-card-value { font-size:23px; font-weight:700; letter-spacing:0; }\n.uh-card-sub { font-size:11px; line-height:1.25; }\n.uh-panel { padding:16px; border:0; border-radius:18px; background:var(--dsw-alias-bg-layer-1); box-shadow:0 1px 2px rgba(0,0,0,.06), 0 6px 18px rgba(0,0,0,.04); }\n.uh-hm-head { margin-bottom:12px; }\n.uh-chip { border:0; border-radius:14px; padding:5px 10px; background:color-mix(in srgb, var(--dsw-alias-label-primary) 7%, transparent); }\n.uh-chip.uh-on { border:0; background:color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent); color:var(--dsw-alias-brand-primary); }\n.uh-hrow, .uh-row, .uh-model-hrow, .uh-model-row { border-radius:10px; }\n.uh-hrow, .uh-model-hrow { position:sticky; top:66px; z-index:2; background:var(--dsw-alias-bg-layer-1); border-bottom:1px solid var(--dsw-alias-border-l1); }\n.uh-row, .uh-model-row { padding-top:9px; padding-bottom:9px; }\n.uh-row:nth-child(even) { background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 52%, transparent); }\n/* The sidebar entry follows the host\'s row style (transparent at rest, hover from\n the host token) instead of a permanent brand tint: a painted resting background\n reads as "already hovered" next to the other sidebar rows. */\n.uh-side-modal { align-items:flex-end; padding:0; background:rgba(0,0,0,.34); backdrop-filter:blur(8px); }\n.uh-side-dialog { width:min(1260px, 100%); max-height:calc(100vh - var(--uh-top-inset, 0px) - 44px); border:0; border-radius:24px 24px 0 0; padding:22px 24px 28px; background:linear-gradient(color-mix(in srgb, var(--dsw-alias-bg-base) 94%, transparent), color-mix(in srgb, var(--dsw-alias-bg-base) 94%, transparent)), var(--dsw-alias-bg-layer-1, #1a1c20); box-shadow:0 -10px 44px rgba(0,0,0,.25); }\n.uh-side-dialog-head { position:sticky; top:-22px; z-index:8; justify-content:center; height:22px; margin:-22px -24px 8px; padding:8px 24px; background:linear-gradient(color-mix(in srgb, var(--dsw-alias-bg-base) 94%, transparent), color-mix(in srgb, var(--dsw-alias-bg-base) 94%, transparent)), var(--dsw-alias-bg-layer-1, #1a1c20); border:0; }\n.uh-side-dialog-head::before { content:""; width:36px; height:5px; border-radius:3px; background:color-mix(in srgb, var(--dsw-alias-label-primary) 24%, transparent); }\n.uh-side-dialog-head .uh-refresh { position:absolute; right:20px; top:7px; min-height:28px; background:transparent; }\n.uh-close-button { width:30px; padding:0; font-size:22px; line-height:1; color:var(--dsw-alias-label-secondary); }\n.uh-close-button:hover { color:var(--dsw-alias-label-primary); background:color-mix(in srgb, var(--dsw-alias-label-primary) 10%, transparent); }\n@media (max-width:640px) { .uh-page { gap:14px; padding-bottom:20px; } .uh-head { position:static; padding:4px 0 10px; } .uh-title { font-size:20px; } .uh-custom-range { grid-template-columns:1fr; align-items:stretch; } .uh-custom-range-fields { grid-template-columns:repeat(2, minmax(0, 1fr)); } .uh-custom-range-actions { justify-content:flex-end; } .uh-side-dialog { max-height:calc(100vh - 8px); border-radius:20px 20px 0 0; padding:18px 14px 24px; } .uh-side-dialog-head { top:-18px; margin:-18px -14px 8px; padding:7px 14px; } .uh-card-value { font-size:22px; } }\n/* Navigation separates the dashboard into three focused iOS-style surfaces. */\n.uh-ios-tabs { display:grid; grid-template-columns:repeat(3, 1fr); gap:4px; padding:4px; border-radius:14px; background:color-mix(in srgb, var(--dsw-alias-label-primary) 9%, transparent); }\n.uh-ios-tab { min-height:32px; border:0; border-radius:10px; background:transparent; color:var(--dsw-alias-label-secondary); font:inherit; font-size:13px; font-weight:600; cursor:pointer; }\n.uh-ios-tab.uh-on { color:var(--dsw-alias-label-primary); background:var(--dsw-alias-bg-layer-1); box-shadow:0 1px 4px rgba(0,0,0,.16); }\n.uh-ios-summary { display:flex; flex-direction:column; gap:12px; background:transparent; box-shadow:none; }\n.uh-ios-summary-hero { display:grid; grid-template-columns:minmax(0,1fr) minmax(320px,.48fr); min-height:142px; padding:20px 22px; border:1px solid var(--dsw-alias-border-l1); border-radius:18px; background:var(--dsw-alias-bg-layer-1); box-shadow:0 1px 2px rgba(0,0,0,.06), 0 8px 22px rgba(0,0,0,.06); }\n.uh-ios-summary-total { min-width:0; min-height:0; padding:0; border-radius:0; display:flex; align-items:center; justify-content:flex-start; gap:16px; background:transparent; box-shadow:none; }\n.uh-ios-summary-total-icon { display:grid; place-items:center; flex:none; width:54px; height:54px; border-radius:16px; background:color-mix(in srgb,#0a84ff 18%,var(--dsw-alias-bg-layer-2)); color:#0a84ff; }\n.uh-ios-summary-total-copy { min-width:0; }\n.uh-ios-summary-label { font-size:13px; font-weight:600; color:var(--dsw-alias-label-secondary); }\n.uh-ios-summary-total .uh-ios-summary-label { font-size:14px; }\n.uh-ios-summary-value { margin-top:7px; font-size:40px; line-height:1; font-weight:750; letter-spacing:0; color:var(--dsw-alias-label-primary); }\n.uh-unit { margin-left:6px; color:var(--dsw-alias-label-secondary); font-size:.4em; font-weight:650; white-space:nowrap; vertical-align:baseline; }\n.uh-wsbar-num .uh-unit { font-size:.78em; margin-left:3px; }\n.uh-ios-summary-caption { margin-top:8px; font-size:12px; color:var(--dsw-alias-label-secondary); }\n.uh-ios-summary-meta { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:center; min-width:0; gap:0; padding:0 0 0 22px; border-left:1px solid var(--dsw-alias-border-l1); background:transparent; font-size:12px; color:var(--dsw-alias-label-secondary); }\n.uh-ios-summary-meta-stat { min-width:0; padding:4px 22px; }\n.uh-ios-summary-meta-stat + .uh-ios-summary-meta-stat { border-left:1px solid var(--dsw-alias-border-l1); }\n.uh-ios-summary-meta-label { display:flex; align-items:center; gap:7px; color:var(--dsw-alias-label-secondary); font-size:12px; font-weight:600; white-space:nowrap; }\n.uh-ios-summary-meta-value { margin-top:7px; color:var(--dsw-alias-label-primary); font-size:24px; line-height:1; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }\n.uh-ios-summary-meta-cost .uh-ios-summary-meta-value { color:#30d158; }\n.uh-ios-summary-meta-caption { margin-top:7px; color:var(--dsw-alias-label-secondary); font-size:11px; white-space:nowrap; }\n.uh-ios-metrics { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }\n.uh-ios-metric { min-width:0; min-height:80px; padding:10px 13px; border:1px solid var(--dsw-alias-border-l1); border-radius:14px; display:flex; flex-direction:column; justify-content:center; gap:6px; background:var(--dsw-alias-bg-layer-1); box-shadow:0 1px 2px rgba(0,0,0,.06), 0 8px 20px rgba(0,0,0,.05); animation:uh-card-in .35s ease both; }\n.uh-ios-metrics > .uh-card { min-width:0; min-height:96px; padding:9px 13px; gap:2px; border:0; border-radius:14px; }\n.uh-ios-metrics > .uh-card .uh-card-value { min-width:0; font-size:20px; line-height:1.2; font-weight:700; white-space:nowrap; }\n.uh-ios-metrics > .uh-card .uh-card-sub { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.uh-ios-metrics > .uh-card:nth-child(-n+3) { justify-content:center; }\n.uh-ios-metric-label { display:flex; align-items:center; gap:8px; min-width:0; color:var(--dsw-alias-label-secondary); font-size:13px; font-weight:600; white-space:nowrap; }\n.uh-ios-metric-label .uh-line-icon { flex:none; }\n.uh-ios-metric-value { min-width:0; color:var(--dsw-alias-label-primary); font-size:22px; line-height:1.05; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }\n.uh-ios-metric-input { background:color-mix(in srgb,#0a84ff 11%,var(--dsw-alias-bg-layer-1)); }\n.uh-ios-metric-input .uh-line-icon { color:#0a84ff; }\n.uh-ios-metric-output { background:color-mix(in srgb,#bf5af2 10%,var(--dsw-alias-bg-layer-1)); }\n.uh-ios-metric-output .uh-line-icon { color:#bf5af2; }\n.uh-ios-metric-write { background:color-mix(in srgb,#ff9f0a 11%,var(--dsw-alias-bg-layer-1)); }\n.uh-ios-metric-write .uh-line-icon { color:#ff9f0a; }\n.uh-ios-metric-read { background:color-mix(in srgb,#30d158 11%,var(--dsw-alias-bg-layer-1)); }\n.uh-ios-metric-read .uh-line-icon { color:#30d158; }\n.uh-ios-metric-rate { background:var(--dsw-alias-bg-layer-1); }\n.uh-ios-metric-rate .uh-line-icon { color:#30d158; }\n.uh-ios-metric-rate-head { display:flex; align-items:baseline; justify-content:space-between; gap:8px; min-width:0; }\n.uh-ios-metric-rate-value { flex:none; color:#30d158; font-size:20px; line-height:1; font-weight:700; font-variant-numeric:tabular-nums; }\n.uh-ios-metric-rate-detail { min-width:0; overflow:hidden; color:var(--dsw-alias-label-secondary); font-size:12px; line-height:1.2; font-weight:600; font-variant-numeric:tabular-nums; text-overflow:ellipsis; white-space:nowrap; }\n.uh-ios-metric-bar { height:5px; border-radius:3px; background:var(--dsw-alias-bg-layer-2); overflow:hidden; }\n.uh-ios-metric-fill { height:100%; border-radius:inherit; background:#30d158; transition:width .35s ease; }\n.uh-token-semantics { display:flex; align-items:flex-start; gap:8px; padding:10px 12px; border-radius:12px; background:color-mix(in srgb, var(--dsw-alias-brand-primary) 8%, var(--dsw-alias-bg-layer-1)); color:var(--dsw-alias-label-secondary); font-size:12px; line-height:1.55; }\n.uh-token-semantics .uh-line-icon { margin-top:1px; color:var(--dsw-alias-brand-primary); }\n.uh-ios-list-panel { min-height:360px; }\n.uh-donut-chart { margin:0 0 18px; }\n.uh-donut-title { display:flex; align-items:center; gap:7px; margin-bottom:12px; color:var(--dsw-alias-label-primary); font-size:14px; font-weight:650; }\n.uh-donut-layout { display:grid; grid-template-columns:minmax(220px,300px) minmax(0,1fr); gap:24px; align-items:center; }\n.uh-donut-visual { position:relative; width:min(100%,280px); aspect-ratio:1; margin:0 auto; }\n.uh-donut-svg { display:block; width:100%; height:100%; overflow:visible; }\n.uh-donut-track { opacity:.78; }\n.uh-donut-segment { fill:none; stroke-dasharray:1; stroke-dashoffset:1; animation:uh-donut-draw .95s cubic-bezier(.22,.61,.36,1) both; cursor:pointer; outline:none; transition:filter .15s ease, opacity .15s ease; }\n.uh-donut-segment:hover, .uh-donut-segment:focus-visible, .uh-donut-segment.uh-active { filter:brightness(1.12); }\n.uh-donut-tooltip { position:absolute; top:0; left:0; z-index:3; display:flex; align-items:flex-start; gap:8px; max-width:190px; padding:9px 10px; border:1px solid var(--dsw-alias-border-l2); border-radius:8px; background:linear-gradient(color-mix(in srgb, var(--dsw-alias-bg-base) 94%, transparent), color-mix(in srgb, var(--dsw-alias-bg-base) 94%, transparent)), var(--dsw-alias-bg-layer-1, #1a1c20); box-shadow:0 10px 24px rgba(0,0,0,.22); color:var(--dsw-alias-label-primary); pointer-events:none; font-size:12px; line-height:1.4; transition:left .12s cubic-bezier(.22,.61,.36,1), top .12s cubic-bezier(.22,.61,.36,1); }\n.uh-donut-tooltip > div { min-width:0; display:flex; flex-direction:column; gap:4px; }\n.uh-donut-tooltip strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }\n.uh-donut-tooltip span:not(.uh-donut-dot):not(.uh-model-icon) { color:var(--dsw-alias-label-secondary); font-size:11px; }\n.uh-donut-tooltip-cost { color:var(--dsw-alias-label-primary) !important; font-variant-numeric:tabular-nums; }\n.uh-donut-center { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; pointer-events:none; }\n.uh-donut-center strong { color:var(--dsw-alias-label-primary); font-size:28px; line-height:1; font-weight:750; font-variant-numeric:tabular-nums; }\n.uh-donut-center span { margin-top:5px; color:var(--dsw-alias-label-secondary); font-size:13px; }\n.uh-donut-legend { min-width:0; }\n.uh-donut-legend-row { display:grid; grid-template-columns:36px minmax(180px,1fr) minmax(250px,.8fr) 54px; gap:10px; align-items:center; min-height:58px; padding:8px 0; border-bottom:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 78%, transparent); }\n.uh-donut-legend-row:last-child { border-bottom:0; }\n.uh-donut-dot { width:12px; height:12px; border-radius:50%; }\n.uh-donut-legend-mark { display:flex; align-items:center; gap:8px; min-width:0; }\n.uh-donut-legend-copy { min-width:0; display:flex; flex-direction:column; gap:5px; }\n.uh-donut-legend-copy strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--dsw-alias-label-primary); font-size:13px; font-weight:650; }\n.uh-donut-legend-metrics { display:grid; grid-template-columns:minmax(120px,1fr) minmax(92px,auto); align-items:center; gap:14px; min-width:0; }\n.uh-donut-legend-metrics span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--dsw-alias-label-secondary); font-size:12px; font-variant-numeric:tabular-nums; text-align:right; }\n.uh-donut-legend-metrics .uh-donut-cost { color:var(--dsw-alias-label-secondary); font-size:12px; }\n.uh-donut-percent { min-width:48px; color:var(--dsw-alias-label-secondary); font-size:12px; font-variant-numeric:tabular-nums; text-align:right; }\n/* Each detail table owns its scrolling and sticky header; sections must not overlap in the page scroll. */\n.uh-tbl-scroll { max-height:360px; overflow:auto; border-radius:12px; background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 55%, transparent); }\n.uh-hrow, .uh-model-hrow { position:sticky; top:0; z-index:3; border-bottom:1px solid var(--dsw-alias-border-l1); box-shadow:0 1px 0 color-mix(in srgb, var(--dsw-alias-bg-base) 70%, transparent); }\n.uh-row, .uh-model-row { min-height:48px; border-bottom:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 72%, transparent); }\n.uh-row:last-child, .uh-model-row:last-child { border-bottom:0; }\n@media (max-width:640px) { .uh-tbl-scroll { max-height:300px; border-radius:10px; } }\n@media (max-width:640px) { .uh-hm-body { min-width:720px; } .uh-donut-legend-row { grid-template-columns:36px minmax(0,1fr) 48px; gap:8px; } .uh-donut-legend-copy { grid-column:2; grid-row:1; } .uh-donut-legend-metrics { grid-column:2 / -1; grid-row:2; grid-template-columns:minmax(0,1fr) minmax(0,auto); gap:8px; } .uh-donut-percent { grid-column:3; grid-row:1; } .uh-ios-summary-hero { grid-template-columns:1fr; min-height:0; gap:18px; padding:18px; } .uh-ios-summary-total { align-items:flex-start; } .uh-ios-summary-meta { grid-template-columns:repeat(2,minmax(0,1fr)); padding:16px 0 0; border-left:0; border-top:1px solid var(--dsw-alias-border-l1); } .uh-ios-summary-meta-stat { padding:0 12px; } .uh-ios-summary-meta-stat:first-child { padding-left:0; } .uh-ios-summary-meta-stat:last-child { padding-right:0; } .uh-ios-summary-value { font-size:31px; } .uh-ios-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } .uh-ios-metric:last-child { grid-column:1 / -1; } .uh-ios-metric-value { font-size:24px; } .uh-donut-layout { grid-template-columns:1fr; gap:12px; } .uh-donut-visual { width:min(100%,250px); } }\n@keyframes uh-cell-in { from { opacity:0; transform:scale(.4); } to { opacity:1; transform:scale(1); } }\n@keyframes uh-card-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }\n@keyframes uh-bar-grow { from { transform:scaleX(0); } to { transform:scaleX(1); } }\n@keyframes uh-panel-in { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }\n@keyframes uh-trend-draw { from { stroke-dashoffset:var(--uh-draw-length); opacity:.2; } to { stroke-dashoffset:0; opacity:1; } }\n@keyframes uh-trend-fill { from { opacity:0; } to { opacity:1; } }\n@keyframes uh-donut-draw { from { stroke-dashoffset:1; opacity:.25; } to { stroke-dashoffset:0; opacity:1; } }\n@keyframes uh-spinner-turn { to { transform:rotate(360deg); } }\n@keyframes uh-menu-in { from { opacity:0; transform:translateY(-4px) scale(.97); } to { opacity:1; transform:translateY(0) scale(1); } }\n@keyframes uh-tip-in { from { opacity:0; } to { opacity:1; } }\n@media (prefers-reduced-motion: reduce) {\n .uh-cell, .uh-card, .uh-ios-metric, .uh-barfill, .uh-anim-panel, .uh-trend-panel, .uh-trend-line-draw, .uh-trend-area, .uh-trend-point, .uh-trend-spinner, .uh-donut-segment, .uh-records-panel, .uh-record-detail, .uh-tip, .uh-language-options { animation:none !important; stroke-dashoffset:0 !important; opacity:1 !important; }\n .uh-card, .uh-cell, .uh-ios-metric-fill, .uh-barfill, .uh-fill, .uh-refresh, .uh-chip, .uh-row, .uh-tip-row, .uh-trend-tooltip, .uh-language-trigger, .uh-language-caret, .uh-language-option { transition:none !important; }\n}\n'}const bt=()=>fetch("/api/all-usage"+(()=>{try{return"en"===Ct()?"?utc=1":"?utc=0"}catch(e){return""}})(),{headers:{accept:"application/json"}}).then(e=>{if(!e.ok)throw new Error("HTTP "+e.status);return e.json()}),ft=e=>fetch("/api/all-usage/version"+(!0===e?"?force=1":""),{headers:{accept:"application/json"}}).then(e=>{if(!e.ok){const t=new Error("HTTP "+e.status);throw t.status=e.status,t}return e.json()}),yt=(e,t,a)=>{const n=new URLSearchParams({start:e.start,end:e.end,utc:e.utc?"1":"0",limit:String(a||100)});return e.workspaceId&&n.set("workspaceId",e.workspaceId),e.provider&&n.set("provider",e.provider),e.modelKey&&n.set("modelKey",e.modelKey),t&&n.set("cursor",t),fetch("/api/all-usage/records?"+n.toString(),{headers:{accept:"application/json"}}).then(e=>{if(!e.ok){const t=new Error("HTTP "+e.status);throw t.status=e.status,t}return e.json()})},xt=()=>fetch("/api/all-usage/pricing",{headers:{accept:"application/json"}}).then(e=>{if(!e.ok)throw new Error("HTTP "+e.status);return e.json()}),vt=(e,t,a)=>fetch("/api/all-usage/pricing",{method:"POST",headers:{"content-type":"application/json","x-all-usage-request-token":a},body:JSON.stringify({pricing:e,backfill:!0===t})}).then(e=>{if(!e.ok){const t=new Error("HTTP "+e.status);throw t.status=e.status,t}return e.json()}),wt="dsh-all-usage.language",kt="dsh-all-usage.language.chosen";let Et,Nt=null;function Ct(){const e=function(){try{if("1"!==window.localStorage.getItem(kt))return null;const e=window.localStorage.getItem(wt);return"en"===e?"en":"zh"===e?"zh":null}catch(e){return null}}();return null!==e?e:function(){if(void 0!==Et)return Et;Et=null;try{const e=null!==Nt&&"function"==typeof Nt.get?Nt.get("locale"):void 0;if(null!=e){const t="function"==typeof e.getLocale?e.getLocale():"function"==typeof e.getSnapshot?e.getSnapshot():null;Et=function(e){const t=String(e??"").toLowerCase();return""===t?null:0===t.indexOf("zh")?"zh":"en"}(null!==t&&"object"==typeof t?t.active:void 0)}}catch(e){}return Et}()??function(){try{const e="undefined"==typeof navigator?"":String(navigator.language||"");if(/^zh/i.test(e))return"zh";if(/^en/i.test(e))return"en"}catch(e){}return"en"}()}const Mt="dsh-all-usage.ui-state";function St(){try{const e=window.localStorage.getItem(Mt),t=e?JSON.parse(e):{};if(null===t||"object"!=typeof t||Array.isArray(t))return{};const a={};return["logs","model","workspace"].includes(t.detailView)&&(a.detailView=t.detailView),["route","model","provider"].includes(t.modelView)&&(a.modelView=t.modelView),["today","7d","30d","90d","all"].includes(t.range)&&(a.range=t.range),je.includes(t.heatmapSpan)&&(a.heatmapSpan=t.heatmapSpan),"bar"!==t.trendChart&&"line"!==t.trendChart||(a.trendChart=t.trendChart),"boolean"==typeof t.pricingAutoSync&&(a.pricingAutoSync=t.pricingAutoSync),a}catch(e){return{}}}function At(e){try{const t=St();window.localStorage.setItem(Mt,JSON.stringify(Object.assign({},t,e)))}catch(e){}}function zt(e){const t=e.timerCtx,a="en"===e.language?"en":"zh",r=(e,t)=>"en"===a?t:e,l="en"===a,o=n.useRef(null);null===o.current&&(o.current=St());const s=o.current,c=new Date,f=u(c,l),[v,N]=n.useState(null),[M,S]=n.useState(null),[A,z]=n.useState(""),[I,j]=n.useState(0),[D,F]=n.useState(null),[O,K]=n.useState(()=>s.range||"today"),[q,B]=n.useState(()=>Fe(s.heatmapSpan)),[J,ue]=n.useState(null),[de,me]=n.useState(""),[ge,Ne]=n.useState({start:"",end:""}),[Ce,Se]=n.useState({start:"",end:""}),[Ae,ze]=n.useState(!1),[Te,Ie]=n.useState(()=>s.modelView||"route"),[je,De]=n.useState(null),[Le,Pe]=n.useState(null),[Ke,qe]=n.useState(null),[Be,He]=n.useState(null),[Ye,Ge]=n.useState(""),[$e,Xe]=n.useState(!1),[Qe,et]=n.useState(""),[tt,at]=n.useState(["total","input","cacheRead","output"]),[nt,it]=n.useState(()=>s.detailView||"logs"),[ot,gt]=n.useState(null),[wt,kt]=n.useState(null),[Et,Nt]=n.useState([]),[Ct,Mt]=n.useState(null),[zt,Tt]=n.useState(!1),[Rt,It]=n.useState(0),[jt,Dt]=n.useState(!1),[Ft,Ut]=n.useState(!1),[Wt,Ot]=n.useState(""),[Lt,Pt]=n.useState(!1),[Kt,qt]=n.useState({}),[Bt,Ht]=n.useState(!1),[Yt,Vt]=n.useState(null),[Gt,Jt]=n.useState(null),[_t,$t]=n.useState(!1),[Xt,Zt]=n.useState(!1),[Qt,ea]=n.useState(!1),[ta,aa]=n.useState(!1),[na,ra]=n.useState(""),[ia,la]=n.useState({}),[oa,sa]=n.useState({}),[ca,ua]=n.useState(null),[da,pa]=n.useState({}),[ma,ha]=n.useState(null),[ga,ba]=n.useState({});n.useEffect(()=>{ba({})},[a]);const[fa,ya]=n.useState(()=>(new Date).getFullYear()),[xa,va]=n.useState(!1),[wa,ka]=n.useState(""),Ea=n.useRef({}),Na=n.useRef(0),Ca=n.useRef({}),Ma=n.useRef(!1),Sa=n.useRef(()=>{}),Aa=n.useRef(()=>{}),za=()=>{Na.current+=1;const e=Ca.current;for(const t of Object.keys(e))clearTimeout(e[t]);Ca.current={},Ea.current={},la({}),sa({})},[Ta,Ra]=n.useState(!1),Ia=n.useRef(null),ja=n.useRef(null),Da=n.useRef(null);null===Da.current&&(Da.current=g());const Fa=n.useRef(null);null===Fa.current&&(Fa.current=g());const Ua=n.useRef(null);null===Ua.current&&(Ua.current=g());const Wa=n.useRef(null);null===Wa.current&&(Wa.current=g());const Oa=n.useRef(null);null===Oa.current&&(Oa.current=g());const La=n.useRef(null);null===La.current&&(La.current=g());const Pa=Da.current,Ka=Fa.current,qa=Ua.current,Ba=Wa.current,Ha=Oa.current,Ya=La.current,Va=n.useRef(()=>{}),Ga=n.useRef(()=>{}),Ja=n.useRef(""),_a=n.useCallback(()=>{if(!Ma.current||Xt||Qt||ta)return;const e=Ya.next();$t(!0),xt().then(t=>{if(Ya.isCurrent(e)){if(!t||"object"!=typeof t||!t.config)return ra("load"),void $t(!1);za(),Vt(t),Jt(e=>X(e,t)),ra(""),$t(!1)}},()=>{Ya.isCurrent(e)&&(ra("load"),$t(!1))})},[Xt,Qt,ta]);n.useEffect(()=>{Sa.current=_a});n.useEffect(()=>{At({detailView:nt})},[nt]),n.useEffect(()=>{At({modelView:Te})},[Te]),n.useEffect(()=>{"custom"!==O&&At({range:O})},[O]),n.useEffect(()=>{At({heatmapSpan:q})},[q]),n.useEffect(()=>{let e=!0;const t=t=>ft(t).then(t=>{e&&(ue(t),me(""))},t=>{e&&me(!t||401!==t.status&&404!==t.status?"failed":"endpoint")});return Aa.current=()=>t(!1),t(!1),()=>{e=!1,Aa.current=()=>{}}},[]);const $a=n.useMemo(()=>null===v?null:function(e,t,a,n,r,i,l){const o=We(e,t,a,n);return null===o?null:{start:o.start,end:o.end,utc:!0===a,workspaceId:r||null,provider:i||null,modelKey:l||null}}(v,O,l,ge,je,Le,Ke),[v,O,l,ge.start,ge.end,je,Le,Ke]),Xa=Oe($a),Za=x(null!==M&&"object"==typeof M?M:v),Qa=null!==ot&&ot.baseKey===Xa?ot.scope:$a,en=Oe(Qa),tn=n.useRef(Xa);n.useEffect(()=>{tn.current!==Xa&&(tn.current=Xa,gt(null),kt(null))},[Xa]),n.useEffect(()=>{let e=!0,a=!1,n="",r=null,i="",l=0,o=0,s=null;const c=()=>{null!==s&&(clearTimeout(s),s=null)},u=t=>{if(""===n)return;const a=qa.next();((e,t)=>fetch("/api/all-usage/balance"+(e?"?force=1":""),{headers:{accept:"application/json","x-all-usage-request-token":t}}).then(e=>{if(!e.ok)throw new Error("HTTP "+e.status);return e.json()}))(!0===t,n).then(t=>{e&&qa.isCurrent(a)&&t&&F(t)},()=>{})},d=t=>{if(!e||null!==s)return;const a="full"===t?l+=1:o+=1;s=setTimeout(()=>{s=null,e&&("full"===t?p():m())},function(e){const t=Math.max(1,Math.min(4,"number"==typeof e&&Number.isFinite(e)?e:1));return 5e3*Math.pow(2,t-1)}(a))},p=()=>{Ka.next();const t=Pa.next();bt().then(o=>{if(!e||!Pa.isCurrent(t))return;if(null===o||"object"!=typeof o)return z("full"),void d("full");const s=null!==r&&"string"==typeof r.pluginVersion?r.pluginVersion:"";r=o,o.scan&&(a=!!o.scan.done);const p="string"==typeof o.pluginVersion?o.pluginVersion:"";""!==p&&p!==s&&Aa.current();const m="string"==typeof o.requestToken?o.requestToken:"",h=""!==m&&m!==n;n=m,""!==m&&(Ja.current=m),l=0,c(),z(""),j(Date.now()),S(o),i=JSON.stringify(o),N(o),h&&u(!1)},()=>{e&&Pa.isCurrent(t)&&(z("full"),d("full"))})},m=()=>{if(null===r)return void p();const t=Ka.next();fetch("/api/all-usage/status",{headers:{accept:"application/json"}}).then(e=>{if(!e.ok)throw new Error("HTTP "+e.status);return e.json()}).then(n=>{if(!e||!Ka.isCurrent(t))return;if(null===n||"object"!=typeof n)return z("status"),void d("status");o=0;const l=function(e,t){if(null===e||"object"!=typeof e||null===t||"object"!=typeof t)return"full";if("string"!=typeof e.instanceId||"string"!=typeof t.instanceId||""===e.instanceId||e.instanceId!==t.instanceId)return"full";const a="string"==typeof e.capabilityId?e.capabilityId:"",n="string"==typeof t.capabilityId?t.capabilityId:"";if(""!==a&&a!==n)return"full";if(y(e)&&y(t)){if(e.metadataRevision!==t.metadataRevision)return"full";if(e.pricingRevision!==t.pricingRevision)return"full";if(e.dataRevision!==t.dataRevision)return"query";const a=e.scan,n=t.scan;return e.scanRevision!==t.scanRevision||a&&n&&!!a.done!=!!n.done?"status":"none"}const r=b(e),i=b(t);if(null===r||null===i||r!==i)return"full";const l=e.scan,o=t.scan;return l&&o&&!!l.done!=!!o.done?"full":"none"}(n,r);if(n.scan&&(a=!!n.scan.done),"full"===l)return"number"==typeof n.pricingRevision&&"number"==typeof r.pricingRevision&&n.pricingRevision!==r.pricingRevision&&Sa.current(),void p();r=Object.assign({},r,n);const s=JSON.stringify(n);s!==i&&(i=s,S(n)),c(),z("")},()=>{e&&Ka.isCurrent(t)&&(z("status"),d("status"))})};p();const h=t.interval(()=>{a||null!==s||m()},2e3),g=t.interval(()=>{a&&null===s&&m()},15e3),f=t.interval(()=>{u(!1)},6e4);return Va.current=()=>{c(),l=0,o=0,p(),u(!0)},Ga.current=p,()=>{e=!1,c(),h(),g(),f();for(const e of Object.values(Ca.current))clearTimeout(e);Ca.current={}}},[]);const an=n.useRef(l);n.useEffect(()=>{an.current!==l&&(an.current=l,Ga.current())},[l]),n.useEffect(()=>{if(!Ta||"undefined"==typeof document)return;const e=e=>{Ia.current&&!Ia.current.contains(e.target)&&Ra(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[Ta]),n.useEffect(()=>{if(null===$a||""===Xa)return;const e=Ba.next();let t=!0,a=0;const n=(r,i)=>{(e=>{const t=new URLSearchParams({start:e.start,end:e.end,utc:e.utc?"1":"0"});return e.workspaceId&&t.set("workspaceId",e.workspaceId),e.provider&&t.set("provider",e.provider),e.modelKey&&t.set("modelKey",e.modelKey),fetch("/api/all-usage/query?"+t.toString(),{headers:{accept:"application/json"}}).then(e=>{if(!e.ok)throw new Error("HTTP "+e.status);return e.json()})})($a).then(l=>{if(!t||!Ba.isCurrent(e))return;const o=null===l||"object"!=typeof l?null:x(l);if(null===r||null===o||o!==r)return null!==o&&i<2&&a<2?(a+=1,1===a&&Ga.current(),void n(o,i+1)):(et("stale"),void Xe(!1));He(l),Ge(Xa),Xe(!1),et("")},()=>{t&&Ba.isCurrent(e)&&(Xe(!1),et("query"))})};return Xe(!0),et(""),n(Za,0),()=>{t=!1}},[Xa,Za]);const nn=n.useCallback(e=>{null!==e&&""!==Xa&&(gt({baseKey:Xa,scope:{...e}}),it("logs"),kt(null),Ot(""))},[Xa]),rn=n.useRef(null);rn.current=$a;const ln=n.useCallback(e=>{const t=rn.current;null!==t&&"string"==typeof e&&nn({...t,start:e,end:e})},[nn]),on="logs"===nt&&null!==Qa&&""!==en;n.useEffect(()=>{if(!on)return Ha.next(),void Dt(!1);const e=Ha.next(),t=Za;return Dt(!0),Ot(""),Mt(null),Tt(!1),yt(Qa,null,20).then(a=>{if(Ha.isCurrent(e)){if(null===a||"object"!=typeof a||!Array.isArray(a.items))return Ot("audit"),void Dt(!1);if(null===t||x(a)!==t)return Ot("stale"),void Dt(!1);Nt(a.items),kt(e=>a.items.some(t=>t&&t.id===e)?e:a.items[0]?a.items[0].id:null),Mt(a.nextCursor||null),Tt(!0===a.hasMore),Dt(!1),Ot("")}},t=>{if(Ha.isCurrent(e)){if(t&&409===t.status)return Dt(!1),Ot("stale"),void It(e=>e+1);Dt(!1),Ot("audit")}}),()=>{Ha.next()}},[en,nt,Za,Rt]),n.useEffect(()=>{null!==ot&&"logs"===nt&&null!==ja.current&&ja.current.scrollIntoView({behavior:"smooth",block:"start"})},[ot&&Oe(ot.scope),nt]);const sn=n.useCallback(()=>{Va.current(),ft(!0).then(e=>{e&&(ue(e),me(""))},e=>me(!e||401!==e.status&&404!==e.status?"failed":"endpoint"))},[]),cn=n.useCallback(e=>{De(t=>t===e?null:e)},[]),un=n.useCallback(()=>{De(null),Pe(null),qe(null)},[]),dn=n.useCallback(e=>{Pe(e||null)},[]),pn=n.useCallback(e=>{qe(e||null)},[]),mn=n.useMemo(()=>l&&Array.isArray(v&&v.byDayUtc)?v.byDayUtc:Array.isArray(v&&v.byDay)?v.byDay:[],[v,l]),hn=h(mn,f).min,gn=m(ge,l),bn=function(e,t,a,n){return null!==e&&"object"==typeof e&&p(e.start,n)&&p(e.end,n)?e.start>e.end?"order":e.start<t||e.end>a?"bounds":"":"invalid"}(Ce,hn,f,l),fn=n.useCallback(e=>{B(Fe(e))},[]),yn=null!==Be&&Ye===Xa,xn=yn&&null!==Za&&x(Be)===Za,vn=yn&&(xn||""===Qe),wn=null===gn?"":gn.start+":"+gn.end,kn=n.useMemo(()=>function(e,t,a,n){const r={totals:{turns:0,calls:0,sessions:0,input:0,output:0,cacheRead:0,cacheWrite:0,reasoning:0,cost:{currency:"USD",input:"0",output:"0",cacheRead:"0",cacheWrite:"0",baseTotal:"0",total:"0",pricedCalls:0,unpricedCalls:0,ambiguousCalls:0,unsupportedCalls:0}},perWs:[],perModel:[]};if(null===e)return r;if("all"===t)return{totals:e.totals,perWs:e.perWorkspace,perModel:e.perModel||[]};const i=a&&Array.isArray(e.byDayUtc)?e.byDayUtc:Array.isArray(e.byDay)?e.byDay:[];let l,o=null;if("custom"===t){const e=m(n,a);if(null===e)return r;l=e.start,o=e.end}else l=u("today"===t?new Date:d(new Date,"7d"===t?-6:"30d"===t?-29:-89,a),a);const s={turns:0,calls:0,sessions:0,input:0,output:0,cacheRead:0,cacheWrite:0,reasoning:0,cost:{currency:"USD",input:"0",output:"0",cacheRead:"0",cacheWrite:"0",baseTotal:"0",total:"0",pricedCalls:0,unpricedCalls:0,ambiguousCalls:0,unsupportedCalls:0}},c=new Map,p=new Map,h=new Set;for(const e of i){if(e.date<l||null!==o&&e.date>o)continue;const t=Array.isArray(e.sessionIds)?e.sessionIds:[];for(const e of t)h.add(e);s.turns+=e.turns,s.input+=e.tokens.input,s.output+=e.tokens.output,s.cacheRead+=e.tokens.cacheRead,s.cacheWrite+=e.tokens.cacheWrite,s.reasoning+=e.tokens.reasoning,V(s.cost,e.cost);for(const t of e.byWorkspace){let e=c.get(t.workspaceId);void 0===e&&(e={workspaceId:t.workspaceId,turns:0,input:0,output:0,cacheRead:0,cacheWrite:0,reasoning:0,cost:H()},c.set(t.workspaceId,e)),e.input+=t.input,e.output+=t.output,e.cacheRead+=t.cacheRead,e.cacheWrite+=t.cacheWrite,e.reasoning+=t.reasoning,V(e.cost,t.cost)}for(const t of e.perWorkspace){let e=c.get(t.workspaceId);void 0===e&&(e={workspaceId:t.workspaceId,turns:0,input:0,output:0,cacheRead:0,cacheWrite:0,reasoning:0,cost:H()},c.set(t.workspaceId,e)),e.turns+=t.turns}for(const t of e.byModel||[]){const e=t.identityKey||t.model;let a=p.get(e);void 0===a&&(a={...t,calls:0,input:0,output:0,cacheRead:0,cacheWrite:0,reasoning:0,cost:H()},p.set(e,a)),a.calls+=t.calls,a.input+=t.input,a.output+=t.output,a.cacheRead+=t.cacheRead,a.cacheWrite+=t.cacheWrite,a.reasoning+=t.reasoning,s.calls+=Number.isFinite(t.calls)?t.calls:0,V(a.cost,t.cost)}}return s.sessions=h.size,{totals:s,perWs:Array.from(c.values()),perModel:Array.from(p.values())}}(v,O,l,gn),[v,O,l,wn]),En=n.useMemo(()=>function(e,t,a){if(!0===a)return!0;if(null==e||null==t)return!0;const n=Me(e.totals),r=Me(t.totals);return null===n||null===r||(0===r?0===n:Math.abs(n-r)<=Math.max(.05*r,2e5))}(xn?Be:null,kn,null!==je||null!==Le||null!==Ke),[xn,Be,kn,je,Le,Ke]),Nn=vn&&En,Cn=Nn&&Array.isArray(Be.daily)?Be.daily:mn,Mn=Nn&&Array.isArray(Be.heatmap)?Be.heatmap:mn,Sn=n.useMemo(()=>Nn?{totals:Be.totals,perWs:Be.perWorkspace||[],perModel:Be.perModel||[]}:kn,[Nn,Be,kn]),An=_e(Sn.totals.input+Sn.totals.output+Sn.totals.cacheRead+Sn.totals.cacheWrite+Sn.totals.reasoning,t),zn=(_e(Math.round(10*E(Sn.totals.input,Sn.totals.cacheRead)),t),null!==Le||null!==Ke),Tn=function(e){if(null==e)return 0;const t=Number(e.pricedCalls||0)+Number(e.unpricedCalls||0)+Number(e.ambiguousCalls||0)+Number(e.unsupportedCalls||0);return Number.isFinite(t)&&t>0?t:0}(Sn.totals.cost),Rn=Tn>0?Tn:Number.isFinite(Sn.totals.calls)&&Sn.totals.calls>0?Sn.totals.calls:Sn.totals.turns,In=_e(zn?Rn:Sn.totals.turns,t),jn=_e(Rn,t),Dn=e=>e.input+e.output+e.cacheRead+e.cacheWrite+e.reasoning,Fn=n.useMemo(()=>(Array.isArray(Sn.perWs)?Sn.perWs:[]).slice().sort((e,t)=>Dn(t)-Dn(e)),[Sn.perWs]),Un=n.useMemo(()=>function(e,t,a,n){if("route"===t)return e.slice();const r=new Map,i=new Map;for(const l of e){const e=Je(l,a,n),o="model"===t?e.model:e.provider;let s=r.get(o);void 0===s&&(s={model:o,provider:"provider"===t?o:e.provider,calls:0,input:0,output:0,cacheRead:0,cacheWrite:0,reasoning:0,cost:H()},r.set(o,s),i.set(o,[])),i.get(o).push(l),s.calls+=l.calls,s.input+=l.input,s.output+=l.output,s.cacheRead+=l.cacheRead,s.cacheWrite+=l.cacheWrite,s.reasoning+=l.reasoning,V(s.cost,l.cost)}for(const[e,a]of r){const n="provider"===t?R(e):W(i.get(e));a.iconKey=null===n?null:n.key}return Array.from(r.values())}(Sn.perModel||[],Te,r("未知供应商","Unknown provider"),r("未知模型","Unknown model")).sort((e,t)=>Dn(t)-Dn(e)),[Sn.perModel,Te,a]),Wn=v&&Array.isArray(v.workspaces)?v.workspaces:[],On=v&&v.aliases&&"object"==typeof v.aliases?v.aliases:{},Ln=n.useMemo(()=>{const e=Array.isArray(kn.perModel)?kn.perModel.filter(e=>e&&"object"==typeof e):[],t=Array.from(new Set(e.map(e=>"string"==typeof e.provider&&""!==e.provider?e.provider:null).filter(e=>null!==e))).sort(),n=e=>{const n="string"==typeof e.actualModel&&""!==e.actualModel?e.actualModel:"string"==typeof e.requestedModel&&""!==e.requestedModel?e.requestedModel:null;if(null!==n)return T(n);const r="string"==typeof e.model&&""!==e.model?e.model:"en"===a?"Unknown model":"未知模型",i=r.indexOf(" / "),l=i>0?r.slice(0,i):"";return T(i>0&&t.includes(l)?r.slice(i+3):r)},r=new Map;for(const t of e.map(n)){if(""===t)continue;const e=t.toLowerCase();r.has(e)?t===t.toLowerCase()&&r.set(e,t):r.set(e,t)}const i=Array.from(r.values()).sort((e,t)=>e.localeCompare(t)).map(e=>({value:e,label:T(e)})),l=new Map((Array.isArray(kn.perWs)?kn.perWs:[]).map(e=>[e.workspaceId,e])),o=Wn.filter(e=>{return void 0!==(t=l.get(e.id))&&(Number(t.turns)>0||Number(t.calls)>0||Number(t.input)>0||Number(t.output)>0||Number(t.cacheRead)>0||Number(t.cacheWrite)>0||Number(t.reasoning)>0);var t});return{providerOptions:t,modelOptions:i,rangeWorkspaceOptions:o,rangeWorkspaceIds:new Set(o.map(e=>e.id))}},[kn.perModel,kn.perWs,Wn,a]),{providerOptions:Pn,modelOptions:Kn,rangeWorkspaceOptions:qn,rangeWorkspaceIds:Bn}=Ln,Hn=n.useMemo(()=>{const e=new Map,t=new Map;return Wn.forEach((a,n)=>{e.set(a.id,a),t.set(a.id,n)}),{byId:e,indexes:t}},[Wn]),Yn=Hn.byId,Vn=Hn.indexes,Gn=n.useCallback(e=>{const t=On[e],n=Yn.get(e);if(void 0!==n&&!0===n.retiredBucket)return"en"===a?"Deleted":"已删除";const r="string"==typeof t&&""!==t?t:n&&n.title?n.title:"en"===a?"Unknown workspace":"未知工作区";return void 0!==n&&!0===n.deleted?r+("en"===a?" (deleted)":"(已删除)"):r},[On,Yn,a]),Jn=n.useMemo(()=>[{value:"",label:"en"===a?"All workspaces":"全部工作区"}].concat(qn.map(e=>({value:e.id,label:Gn(e.id)}))),[qn,Gn,a]),_n=n.useMemo(()=>[{value:"",label:"en"===a?"All providers":"全部供应商"}].concat(Pn.map(e=>({value:e,label:e}))),[Pn,a]),$n=n.useMemo(()=>[{value:"",label:"en"===a?"All models":"全部模型"}].concat(Kn.map(e=>({value:e.value,label:e.label,iconKey:(()=>{const t=U({actualModel:e.value,requestedModel:e.value});return null===t?null:t.key})()}))),[Kn,a]),Xn=n.useMemo(()=>{const e=new Map;for(const t of mn)e.set(t.date,t);return e},[mn]),Zn=n.useMemo(()=>function(e,t){const a=new Date;let n=0;for(let r=0;r<371;r++){const i=d(a,-r,t),l=e.get(u(i,t));if(void 0!==l&&l.turns>0)n+=1;else if(r>0)break}let r=0,i=0;for(let n=0;n<371;n++){const l=d(a,-n,t),o=e.get(u(l,t));void 0!==o&&o.turns>0?(i+=1,i>r&&(r=i)):i=0}return{streak:n,best:r}}(Xn,l),[Xn,l,f]),Qn=v&&v.pricing&&"object"==typeof v.pricing?v.pricing:{},er=Yt&&"object"==typeof Yt?Yt:Qn,tr=n.useMemo(()=>Bt?function(e,t,a){const n=null!==e&&"object"==typeof e?e:{},r=function(e){if(null===e||"object"!=typeof e)return $(e);const t=se.get(e);if(void 0!==t)return t;const a=$(e);return se.set(e,a),a}(n),i=new Map;for(const e of Array.isArray(n.temporalSchedules)?n.temporalSchedules:[])null!==e&&"object"==typeof e&&"string"==typeof e.id&&Array.isArray(e.policies)&&i.set(e.id,e.policies);const l=null!==t&&"object"==typeof t&&Array.isArray(t.mappings)?t.mappings:[],o=null!==t&&"object"==typeof t&&Array.isArray(t.overrides)?t.overrides:[],s=null!==a&&"object"==typeof a?a:{},c=new Map;for(let e=0;e<l.length;e+=1){const t=l[e];if(null===t||"object"!=typeof t)continue;const a=String(t.identityKey||t.usageIdentityKey||"").trim();""===a||c.has(a)||c.set(a,e)}const u=new Map;for(let e=0;e<o.length;e+=1){const t=o[e];if(null===t||"object"!=typeof t)continue;const a=ie({providerId:t.providerId,modelId:t.modelId});u.has(a)||u.set(a,e)}return r.map(e=>{const t=function(e){if(null===e||"object"!=typeof e)return"";const t="string"==typeof e.identityKey?e.identityKey.trim():"";if(""!==t)return t;const a=e.pricingModel||e.actualModel||e.requestedModel||e.model||"";return"price|"+String(e.providerId||"").trim().toLowerCase()+"|"+String(a).trim().toLowerCase()}(e),a="string"==typeof e.identityKey?e.identityKey.trim():"",n=""!==a&&c.has(a)?c.get(a):-1,r=n>=0?l[n]:null,d=null!==r&&""!==String(r.catalogModelId||"").trim(),p=function(e,t){const a=null!==t&&"object"==typeof t&&"string"==typeof t.catalogModelId?t.catalogModelId.trim():"";if(""!==a)return{providerId:String(t.catalogProviderId||"").trim().toLowerCase(),modelId:a};const n=null!==e&&"object"==typeof e&&"priced"===e.status&&"string"==typeof e.pricingModel&&""!==e.pricingModel.trim(),r=n?e.pricingModel:null!==e&&"object"==typeof e?e.actualModel||e.requestedModel||e.pricingModel||e.model:"";return{providerId:n?String(e.providerId||"").trim().toLowerCase():"",modelId:String(r||"").trim()}}(e,r),m=ie(p),h=u.has(m)?u.get(m):-1,g=h>=0?o[h]:null,b=d&&null!==s[t]&&"object"==typeof s[t]?s[t]:null,f=null!==b&&null!==b.rates&&"object"==typeof b.rates?b:null,y=null!=g?{input:g.input,output:g.output,cacheRead:g.cacheRead,cacheWrite:g.cacheWrite}:null!==f?{input:f.rates.input,output:f.rates.output,cacheRead:f.rates.cacheRead,cacheWrite:f.rates.cacheWrite}:null!==e.rates&&"object"==typeof e.rates?{input:e.rates.input,output:e.rates.output,cacheRead:e.rates.cacheRead,cacheWrite:e.rates.cacheWrite}:null,x=Array.isArray(e.tiers)?e.tiers.map(e=>Object.assign({},e)):[],v=null!=g&&Array.isArray(g.tiers)?g.tiers.map(e=>Object.assign({},e)):null!==f?[]:x,w=null!=g?!0===g.tiered&&v.length>0:null!==f?!0===f.tiered:!0===e.tiered,k=null!=g?v.length:null!==f?Number.isFinite(Number(f.tierCount))?Number(f.tierCount):0:Number.isFinite(Number(e.tierCount))?Number(e.tierCount):v.length,E="string"==typeof e.temporalScheduleId?i.get(e.temporalScheduleId):null,N=null!=g&&void 0!==g.temporalPricing?g.temporalPricing:Array.isArray(E)?{policies:E}:null,C=null!=N&&Array.isArray(N.policies)?N.policies.reduce((e,t)=>e+(null!==t&&Array.isArray(t.rules)?t.rules.length:0),0):0,M=null!=g&&void 0!==g.temporalPricing,S="string"==typeof e.temporalPolicyId?e.temporalPolicyId:"",A="official"===e.temporalRoute||"mapped"===e.temporalRoute,z=null===N&&A&&""!==S;return{key:t,row:e,identityKey:"string"==typeof e.identityKey?e.identityKey:"",usageBacked:!0===e.usageBacked||!1!==e.usageBacked&&null,model:"string"==typeof e.model?e.model:"",status:"string"==typeof e.status?e.status:"unpriced",reason:"string"==typeof e.reason?e.reason:"",mapped:d,mapping:r,mappingIndex:n,basis:p,overrideIndex:h,override:g,source:null!=g?"manual":"string"==typeof e.source?e.source:"none",rates:y,tiers:v,tiered:w,tierCount:k,tieredInvalid:!0===e.tieredInvalid,multiplier:null!==r&&void 0!==r.multiplier?String(r.multiplier):"1",inputTokenSemantics:null!==r&&"string"==typeof r.inputTokenSemantics?r.inputTokenSemantics:"fresh",pricingModel:d?String(r.catalogModelId):"string"==typeof e.pricingModel?e.pricingModel:"",providerId:p.providerId,temporalPlan:void 0===N?null:N,temporalRuleCount:C,temporalPolicyId:S,temporalRoute:"string"==typeof e.temporalRoute?e.temporalRoute:"",temporalRulesUnavailable:z,temporalExplicit:!!M||!0===e.temporalExplicit,temporalBuiltin:!M&&(z||!0===e.temporalBuiltin),temporalConfigInvalid:!0===e.temporalConfigInvalid||null!=g&&!0===g.temporalPricingInvalid,targetPreview:b,mappable:"string"==typeof e.identityKey&&""!==e.identityKey.trim()}})}(er,Gt,da):[],[Bt,er,Gt,da]),ar=n.useMemo(()=>Ve({stats:v,queryScope:$a,queryResult:Be,queryReady:xn,activeDayRows:mn,range:O,useUtc:l,activeCustomRange:gn}),[$a,xn,Be,mn,v,O,l,wn]),nr=Nn&&Be?Xa+":"+(x(Be)||"query"):Xa,rr=n.useMemo(()=>({}),[Bt,Gt,_t,Xt,Qt,ta,na,er,Qn,tr,ma,ga,oa,ca,ia,v,a]),ir=n.useMemo(()=>Un.map((e,t)=>({label:e.model,value:Dn(e),cost:e.cost,color:Ze[t%Ze.length],iconKey:"route"===Te?(()=>{const t=U(e);return null===t?null:t.key})():void 0===e.iconKey?null:e.iconKey})),[Un,Te]),lr=n.useMemo(()=>Fn.map((e,t)=>({label:Gn(e.workspaceId),value:Dn(e),cost:e.cost,color:Ze[t%Ze.length]})),[Fn,Gn]),or=n.useCallback(e=>{at(t=>t.includes(e)?t.length<=1?t:t.filter(t=>t!==e):t.concat(e))},[]);if(n.useEffect(()=>{null===je||Bn.has(je)||De(null),null===Le||Pn.includes(Le)||Pe(null),null===Ke||Kn.some(e=>e.value===Ke)||qe(null)},[je,Le,Ke,Bn,Pn,Kn]),null===v){const e=""!==A;return n.createElement("div",{className:"uh-page"},n.createElement("div",{className:"uh-panel"},n.createElement("div",{className:"uh-empty"},e?r("无法加载用量统计。请重试。","Unable to load usage statistics. Please retry."):r("正在加载用量统计…","Loading usage statistics…")),e?n.createElement("div",{style:{textAlign:"center"}},n.createElement("button",{className:"uh-refresh",onClick:sn},n.createElement(C,{name:"refresh",size:14}),r("重试","Retry"))):null))}const sr=null!==M&&"object"==typeof M?M:v,cr=sr&&sr.scan?sr.scan:v.scan||{done:!0,started:!0,scanned:0,total:0,failed:0},ur=sr&&sr.sync?sr.sync:v.sync||{},dr=Cn,pr=(e,t,a)=>{const n=Ja.current;return""===n?(a(null),Promise.resolve()):e(n).then(t,r=>null===r||"object"!=typeof r||403!==r.status?(a(r),Promise.resolve()):bt().then(i=>{const l=null!==i&&"object"==typeof i&&"string"==typeof i.requestToken?i.requestToken:"";if(""!==l&&l!==n)return Ja.current=l,e(l).then(t,()=>{a(r)});a(r)},()=>{a(r)}))},mr=(e,t)=>{""!==Ja.current&&pr(a=>{return n=e,r=String(void 0===t?"":t).trim(),fetch("/api/all-usage/alias",{method:"POST",headers:{"content-type":"application/json","x-all-usage-request-token":a},body:JSON.stringify({workspaceId:n,alias:r})}).then(e=>{if(!e.ok)throw new Error("HTTP "+e.status);return e.json()});var n,r},e=>{e&&e.ok&&e.aliases&&N(t=>null===t?t:Object.assign({},t,{aliases:e.aliases}))},()=>{})},hr=()=>{la({}),sa({}),ua(null),pa({}),ha(null),ba({}),ka("")},gr=()=>{Xt||Qt||ta||(za(),Ya.next(),$t(!1),Ht(!1),Ma.current=!1,hr(),ra(""))},br=()=>{const e=Ya.next();Vt(null),Jt(null),$t(!0),hr(),za(),ra(""),Ht(!0),Ma.current=!0,Pt(!1),xt().then(t=>{if(!Ya.isCurrent(e))return;if(!t||"object"!=typeof t||!t.config)return void ra("load");const a=_(t);Vt(t),Jt(a)},()=>{Ya.isCurrent(e)&&ra("load")}).finally(()=>{Ya.isCurrent(e)&&$t(!1)})},fr=e=>{if(null===Gt||Xt||Qt||ta)return;const t=function(e,t){const a=e&&Array.isArray(e.mappings)?e.mappings:[];for(const e of a){if(!e||""===String(e.identityKey||e.usageIdentityKey||e.model||"").trim()||""===String(e.catalogModelId||"").trim())return"mapping";if(!["fresh","total","legacy"].includes(e.inputTokenSemantics||"fresh")||!te(void 0===e.multiplier?"1":e.multiplier))return"mapping"}const n=e&&Array.isArray(e.overrides)?e.overrides:[];for(const e of n){if(!e||""===String(e.modelId||"").trim())return"override";if(!["input","output","cacheRead","cacheWrite"].every(t=>te(e[t])))return"override";let t=0;const a=Array.isArray(e.tiers)?e.tiers:[];if(a.length>32)return"tier";for(const e of a){if(!ae(e,t))return"tier";t=Number(e.size)}if(!0===e.tiered&&0===a.length)return"tier"}const r=null!=t&&"object"==typeof t?t:{};for(const e of Object.keys(r))if(""!==Ee(r[e]))return"temporal";return""}(Gt,ga);if(""!==t)return void ra(t);if(function(e){try{return JSON.stringify({pricing:e}).length>204800}catch(e){return!0}}(Gt))return void ra("too-large");if(""===Ja.current)return void ra("token");const a=Ya.next();Zt(!0),ra(""),pr(t=>vt(Gt,e,t),e=>{Ya.isCurrent(a)&&(e&&!0===e.ok&&e.pricing?(N(t=>null===t?t:Object.assign({},t,{pricing:e.pricing})),Vt(e.pricing),Jt(_(e.pricing)),hr(),gr(),Va.current()):ra("save"))},e=>{Ya.isCurrent(a)&&ra(e&&403===e.status?"stale":"save")}).finally(()=>Zt(!1))},yr=()=>{Xt||Qt||ta||(""!==Ja.current?(ea(!0),ra(""),pr(e=>fetch("/api/all-usage/pricing/sync",{method:"POST",headers:{"content-type":"application/json","x-all-usage-request-token":e},body:"{}"}).then(e=>{if(!e.ok){const t=new Error("HTTP "+e.status);throw t.status=e.status,t}return e.json()}),e=>{e&&!0===e.ok&&e.pricing?(za(),N(t=>null===t?t:Object.assign({},t,{pricing:e.pricing})),Vt(e.pricing),Jt(t=>X(t,e.pricing)),la({}),sa({}),ua(null),pa({}),ba({}),Va.current()):ra("sync")},e=>{ra(e&&403===e.status?"stale":"sync")}).finally(()=>ea(!1))):ra("token"))},xr=(e,t,a)=>{Jt(n=>null===n?n:function(e,t,a,n){if(null===e||"object"!=typeof e)return e;const r=oe(e.mappings,t.identityKey);if(r<0)return e;const i=e.mappings.slice(),l={};return l[a]=n,i[r]=Object.assign({},i[r],l),Object.assign({},e,{mappings:i})}(n,e,t,a)),ra("")},vr=(e,t,a,n)=>{const r=function(e,t,a,n){const r=Array.isArray(e)?e.map(e=>Object.assign({},e)):[];if(void 0===r[t])return r;const i={};return i[a]=n,r[t]=Object.assign({},r[t],i),r}(e.tiers,t,a,n);Jt(t=>null===t?t:ce(t,e,{tiered:r.length>0,tiers:r})),ra("")},wr=(e,t)=>{ba(a=>Object.assign({},a,{[e.key]:t})),""===Ee(t)&&Jt(n=>null===n?n:ce(n,e,{temporalPricing:ke(t,pe(a)),temporalPricingInvalid:void 0})),ra("")},kr=e=>{const t=fe(e.temporalPlan,pe(a))||ye(e.rates,pe(a));wr(e,t)},Er=(e,t)=>{const n=e.key+"|"+t;ha(e=>e===n?null:n),"temporal"===t&&ba(t=>{if(void 0!==t[e.key])return t;const n=fe(e.temporalPlan,pe(a));return null===n?t:Object.assign({},t,{[e.key]:n})}),ra("")},Nr=()=>ha(null),Cr=Sn.totals.input+Sn.totals.output+Sn.totals.cacheRead+Sn.totals.cacheWrite+Sn.totals.reasoning,Mr=E(Sn.totals.input,Sn.totals.cacheRead),Sr=(Y(Sn.totals),G(Sn.totals,a)),Ar=function(e,t){const a=Y(e);if(a.pricedCalls>0&&0===a.unpricedCalls&&0===a.ambiguousCalls&&0===a.unsupportedCalls)return"en"===t?a.pricedCalls+" priced":a.pricedCalls+" 次已计价";const n=a.unpricedCalls+a.ambiguousCalls+a.unsupportedCalls;return n>0?"en"===t?n+" unpriced":n+" 次未计价":"en"===t?"No pricing":"暂无价格"}(Sn.totals,a);let zr="—",Tr=r("查询中…","Checking…");if(null!=D)if("missing-key"===D.status)zr=r("未配置","Not configured"),Tr=r("在 设置 → 模型 中填写 DeepSeek API Key 后可见","Available after you enter a DeepSeek API key in Settings → Models");else if("unavailable"===D.status)zr=r("不可用","Unavailable"),Tr=D.message||r("DeepSeek 接口返回余额不可用","The DeepSeek API reported that balance information is unavailable");else if("error"===D.status){zr=r("查询失败","Lookup failed");const e=D.detail?"en"===a?" ("+String(D.detail).slice(0,90)+")":"("+String(D.detail).slice(0,90)+")":"";Tr=(D.message||"")+e+r(" 点“刷新”重试"," Click Refresh to try again")}else if("ok"===D.status&&Array.isArray(D.currencies)&&D.currencies.length>0){const e=D.currencies,t=e.find(e=>"CNY"===e.currency)||e[0],n=e.filter(e=>e!==t);zr=P(t.currency,t.total,a,2);let i=null!==t.total?r("赠送 ","Granted ")+P(t.currency,t.granted,a,2)+" · "+r("充值 ","Top-up ")+P(t.currency,t.toppedUp,a,2):"";n.length>0&&(i+=(i?" | ":"")+n.map(e=>P(e.currency,e.total,a)).join(" ")),Tr=i}else zr=r("无数据","No data"),Tr="";const Rr=(e,t,a,r,i,l)=>n.createElement("div",{className:"uh-card",style:{animationDelay:70*r+"ms"}},n.createElement("div",{className:"uh-card-label"},l?n.createElement(pt,{iconKey:l,size:15,showTitle:!0}):i?n.createElement(C,{name:i,size:14}):null,e),n.createElement("div",{className:"uh-card-value"},t),n.createElement("div",{className:"uh-card-sub"},a)),Ir=n.createElement("div",{className:"uh-ios-metric uh-ios-metric-rate",style:{animationDelay:"280ms"}},n.createElement("div",{className:"uh-ios-metric-rate-head"},n.createElement("div",{className:"uh-ios-metric-label"},n.createElement(C,{name:"cache",size:18}),r("缓存命中率","Cache Hit Rate")),n.createElement("div",{className:"uh-ios-metric-rate-value"},Mr.toFixed(1)+"%")),n.createElement("div",{className:"uh-ios-metric-bar"},n.createElement("div",{className:"uh-ios-metric-fill",style:{width:Math.max(0,Math.min(100,Mr))+"%"}})),n.createElement("div",{className:"uh-ios-metric-rate-detail"},"en"===a?"Context reused "+w(Sn.totals.cacheRead)+" tokens":"复用上下文 "+w(Sn.totals.cacheRead)+" Token")),jr=Fn.length>0?Dn(Fn[0]):0,Dr=Fn.slice(0,2).map(e=>{const t=Dn(e),r=Vn.get(e.workspaceId),i=Re(void 0===r?0:r),l=je===e.workspaceId;return n.createElement("div",{key:e.workspaceId,className:"uh-wsbar"+(l?" uh-sel":""),onClick:()=>cn(e.workspaceId)},n.createElement("div",{className:"uh-wsbar-top"},n.createElement("span",{className:"uh-dot",style:{background:i}}),n.createElement("span",{className:"uh-wsbar-title"},Gn(e.workspaceId)),n.createElement("span",{className:"uh-wsbar-num"},L(w(t),t,a))),n.createElement("div",{className:"uh-barwrap uh-bar-thin"},n.createElement("div",{className:"uh-barfill",style:{width:jr>0?Math.max(2,t/jr*100)+"%":"0%",background:i}})))}),Fr=n.createElement("div",{className:"uh-card",style:{animationDelay:"210ms"}},n.createElement("div",{className:"uh-card-label"},n.createElement(C,{name:"folder",size:14}),r("各工作区总处理量","Total Tokens Processed by Workspace")),0===Fn.length?n.createElement("div",{className:"uh-empty",style:{padding:"8px 0"}},r("暂无数据","No data yet")):n.createElement("div",{className:"uh-wsbars"},Dr,Fn.length>2?n.createElement("div",{className:"uh-card-sub"},"en"===a?"See the details table for the other "+(Fn.length-2)+" workspaces":"其余 "+(Fn.length-2)+" 个工作区见明细表"):null)),Ur=Fn.map(e=>{const t=Yn.get(e.workspaceId),i="string"==typeof On[e.workspaceId]?On[e.workspaceId]:"",l=t?t.title:r("未知工作区","Unknown workspace"),o=t?t.path:"",s=""!==i?i:l,c=""!==i?l+" · "+o:o,u=Dn(e),d=E(e.input,e.cacheRead),p=Vn.get(e.workspaceId),m=Re(void 0===p?0:p),h=je===e.workspaceId;return n.createElement("div",{key:e.workspaceId,className:"uh-row"+(h?" uh-sel":""),onClick:()=>cn(e.workspaceId)},n.createElement("div",{className:"uh-row-title-wrap"},n.createElement("div",{className:"uh-ws-title"},s),n.createElement("div",{className:"uh-ws-path"},c)),n.createElement("div",{className:"uh-num"},w(e.turns)),n.createElement("div",{className:"uh-num"},w(e.input)),n.createElement("div",{className:"uh-num"},w(e.cacheRead)),n.createElement("div",{className:"uh-num"},w(e.output)),n.createElement("div",{className:"uh-num"},w(e.reasoning)),n.createElement("div",{},n.createElement("div",{className:"uh-num"},w(u)),n.createElement("div",{className:"uh-barwrap"},n.createElement("div",{className:"uh-barfill",style:{width:jr>0?Math.max(2,u/jr*100)+"%":"0%",background:m}}))),n.createElement("div",{className:"uh-num uh-cost-num"},G(e,a)),n.createElement("div",{className:"uh-num"},d.toFixed(1)+"%"),n.createElement("div",{className:"uh-num"},jr>0?(u/jr*100).toFixed(0)+"%":"0%"))}),Wr="route"===Te?r("混合查看","Combined View"):"model"===Te?r("按模型合并","Grouped by Model"):r("按供应商汇总","Grouped by Provider"),Or="route"===Te?r("供应商 / 模型","Provider / Model"):"model"===Te?r("模型","Model"):r("供应商","Provider"),Lr="model"!==nt||0===Un.length?null:n.createElement(rt,{key:"model-donut-"+nt+":"+Xa+":"+(Za||"query")+":"+Te,title:"provider"===Te?r("供应商用量","Provider Usage"):r("模型用量","Model Usage"),icon:"chart",language:a,items:ir}),Pr="workspace"!==nt||0===Fn.length?null:n.createElement(rt,{key:"workspace-donut-"+nt+":"+Xa+":"+(Za||"query"),title:r("工作区用量","Workspace Usage"),icon:"folder",language:a,items:lr}),Kr="model"===nt?Un.map(e=>{const t=Dn(e),r=E(e.input,e.cacheRead);return n.createElement("div",{key:e.identityKey||e.model,className:"uh-model-row uh-row"},n.createElement("div",{className:"uh-row-title-wrap"},n.createElement("div",{className:"uh-ws-title uh-model-label",title:e.model},n.createElement(pt,{iconKey:e.iconKey,row:e,size:18,showTitle:!0}),n.createElement("span",{className:"uh-model-text"},e.model))),n.createElement("div",{className:"uh-num"},w(e.calls)),n.createElement("div",{className:"uh-num"},w(e.input)),n.createElement("div",{className:"uh-num"},w(e.cacheRead)),n.createElement("div",{className:"uh-num"},w(e.output)),n.createElement("div",{className:"uh-num"},w(e.reasoning)),n.createElement("div",{className:"uh-num"},w(t)),n.createElement("div",{className:"uh-num uh-cost-num"},G(e,a)),n.createElement("div",{className:"uh-num"},r.toFixed(1)+"%"))}):[],qr=Lt?n.createElement("div",{className:"uh-panel uh-anim-panel"},n.createElement("div",{className:"uh-alias-panel-head"},n.createElement("span",{},r("工作区别名","Workspace Aliases")),n.createElement("button",{className:"uh-alias-close",onClick:()=>Pt(!1)},r("关闭","Close"))),0===Wn.length?n.createElement("div",{className:"uh-empty",style:{padding:"10px 0"}},r("暂无工作区","No workspaces yet")):n.createElement("div",{className:"uh-alias-list"},Wn.map((e,t)=>n.createElement("div",{key:e.id,className:"uh-alias-item"},n.createElement("span",{className:"uh-dot",style:{background:Re(t)}}),n.createElement("span",{className:"uh-alias-folder",title:e.path||e.id},(!0===e.retiredBucket?r("已删除","Deleted"):e.title||e.path||e.id)+(!0===e.deleted&&!0!==e.retiredBucket?r("(已删除)"," (deleted)"):"")),n.createElement("input",{className:"uh-alias-input",value:void 0!==Kt[e.id]?Kt[e.id]:"",placeholder:r("项目别名","Project alias"),onChange:t=>qt(a=>Object.assign({},a,{[e.id]:t.target.value})),onKeyDown:t=>{"Enter"===t.key&&mr(e.id,t.target.value)}})))),n.createElement("div",{className:"uh-alias-panel-foot"},n.createElement("span",{className:"uh-note"},r("回车保存单个;清空别名还原文件夹名","Press Enter to save one; clear an alias to restore the folder name")),n.createElement("button",{className:"uh-alias-ok",onClick:()=>{for(const e of Object.keys(Kt)){const t="string"==typeof On[e]?On[e]:"";Kt[e]!==t&&mr(e,Kt[e])}Pt(!1)}},r("全部保存","Save All")))):null,Br=er.sync&&"object"==typeof er.sync?er.sync:{},Hr=Xt||Qt||ta,Yr="en"===a?["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]:["日","一","二","三","四","五","六"],Vr=tr.filter(e=>!1===e.usageBacked).length,Gr=tr.filter(e=>null===e.usageBacked).length,Jr="string"==typeof sr.pluginVersion?sr.pluginVersion:"",_r=""!==Jr&&Jr!==i,$r=!Array.isArray(er.usedModels),Xr=e=>{if(!0===e.temporalConfigInvalid)return r("时段异常","Peak invalid");if(!0===e.temporalRulesUnavailable)return r("峰谷计划 ","peak plan ")+e.temporalPolicyId;const t=!0===e.temporalExplicit?e.temporalRuleCount>0?r("自定义 ","custom ")+e.temporalRuleCount+r(" 条规则"," rules"):r("自定义规则","custom rules"):!0===e.temporalBuiltin?r("内置 DeepSeek 峰谷表","built-in DeepSeek peak table"):null;return null===t?r("未启用","not enabled"):"official"!==e.temporalRoute&&"mapped"!==e.temporalRoute?t+r("(该行非官方直连,暂按静态价;映射到官方条目后生效)"," (reseller route: static pricing until this row is mapped to the official entry)"):t},Zr=(e,t)=>n.createElement("td",{className:"uh-pricing-rate-cell"},((e,t)=>n.createElement("input",{type:"number",min:"0",step:"any",className:"uh-pricing-rate-input","aria-label":re(t,a)+" · "+(e.model||e.pricingModel||""),title:r("价格单位为 USD / 1M Token","Price per 1M tokens in USD"),value:null!==e.rates&&void 0!==e.rates[t]?e.rates[t]:"",disabled:Hr,onChange:a=>((e,t,a)=>{Jt(n=>null===n?n:function(e,t,a,n){const r={};return r[a]=n,ce(e,t,r)}(n,e,t,a)),ra("")})(e,t,a.target.value)}))(e,t)),Qr=e=>{const t=void 0!==ga[e.key]?ga[e.key]:fe(e.temporalPlan,pe(a)),i=null==t?"":Ee(t),l=n.createElement("div",{className:"uh-pricing-tier-editor-head"},n.createElement("div",{className:"uh-pricing-tier-editor-title"},n.createElement("strong",{},r("分时段计费(北京时间 UTC+8)","Time-of-day pricing (UTC)")),n.createElement("span",{},!0===e.temporalExplicit?r("自定义规则","Custom rules"):!0===e.temporalRulesUnavailable?r("峰谷计划 ","Peak plan ")+e.temporalPolicyId:!0===e.temporalBuiltin?r("当前使用内置 DeepSeek 峰谷表","Using the built-in DeepSeek peak table"):r("未启用时段规则","No time-of-day rules"))),n.createElement("div",{className:"uh-actions"},!0===e.temporalBuiltin&&!0!==e.temporalExplicit?n.createElement("button",{type:"button",className:"uh-refresh",disabled:Hr,onClick:()=>kr(e)},!0===e.temporalRulesUnavailable?r("改为自定义规则","Replace with custom rules"):r("复制内置表并自定义","Copy built-in table")):null,!0===e.temporalExplicit?n.createElement("button",{type:"button",className:"uh-refresh",disabled:Hr,onClick:()=>(e=>{ba(t=>{const a=Object.assign({},t);return delete a[e.key],a}),e.overrideIndex<0||(Jt(t=>null===t?t:ce(t,e,{temporalPricing:void 0,temporalPricingInvalid:void 0})),ra(""))})(e)},!0===e.temporalBuiltin?r("恢复内置","Restore built-in"):r("清除时段规则","Remove rules")):null,!0!==e.temporalBuiltin&&!0!==e.temporalExplicit?n.createElement("button",{type:"button",className:"uh-refresh",disabled:Hr,onClick:()=>kr(e)},n.createElement(C,{name:"plus",size:13}),r("启用分时计费","Enable time-of-day pricing")):null));if(null==t)return n.createElement("div",{className:"uh-pricing-tier-editor uh-pricing-temporal-editor"},l,n.createElement("div",{className:"uh-pricing-tier-empty"},!0===e.temporalRulesUnavailable?r("该行已启用峰谷计划(","This row already uses a peak plan (")+e.temporalPolicyId+r("),但运行中的宿主尚未提供规则内容;重启 DSH 后即可查看与编辑。","), but the running host does not expose its rules yet; restart DSH to view and edit them."):r("未启用时段规则:所有请求都使用该行基础价。","No time-of-day rules: every request uses the row base rates.")));const o=he(t.effectiveFromText,pe(a)),s=!0===t.holidaysEnabled?be(t.holidaysText):null,c=t.rules.map((i,l)=>{const o=i.windows.map((a,o)=>n.createElement("div",{key:o,className:"uh-pricing-temporal-window"},n.createElement("input",{type:"text",className:"uh-pricing-time-input",placeholder:"HH:MM","aria-label":r("开始时间","Start time"),value:a.start,disabled:Hr,onChange:a=>wr(e,we(t,l,i.windows.map((e,t)=>t===o?{start:a.target.value,end:e.end}:e)))}),n.createElement("span",{className:"uh-pricing-time-sep"},"–"),n.createElement("input",{type:"text",className:"uh-pricing-time-input",placeholder:"HH:MM","aria-label":r("结束时间","End time"),value:a.end,disabled:Hr,onChange:a=>wr(e,we(t,l,i.windows.map((e,t)=>t===o?{start:e.start,end:a.target.value}:e)))}),i.windows.length>1?n.createElement("button",{type:"button",className:"uh-refresh uh-icon-button",title:r("删除时段","Remove window"),"aria-label":r("删除时段","Remove window"),disabled:Hr,onClick:()=>wr(e,we(t,l,i.windows.filter((e,t)=>t!==o)))},n.createElement(C,{name:"close",size:13})):null));return n.createElement("div",{key:i.id+":"+l,className:"uh-pricing-temporal-rule"},n.createElement("div",{className:"uh-pricing-temporal-rule-head"},n.createElement("span",{className:"uh-pricing-temporal-rule-name"},i.id),n.createElement("div",{className:"uh-pricing-weekdays"},Yr.map((a,r)=>n.createElement("button",{key:r,type:"button",className:"uh-pricing-weekday"+(i.weekdays.includes(r)?" uh-on":""),"aria-pressed":i.weekdays.includes(r),disabled:Hr,onClick:()=>wr(e,function(e,t,a){const n=xe(e);if(null===n||void 0===n.rules[t])return n;const r=n.rules[t],i=Number(a);return r.weekdays=(r.weekdays.includes(i)?r.weekdays.filter(e=>e!==i):r.weekdays.concat([i])).sort((e,t)=>e-t),n}(t,l,r))},a))),n.createElement("button",{type:"button",className:"uh-refresh uh-icon-button",disabled:Hr||t.rules.length<=1,title:r("删除规则","Remove rule"),"aria-label":r("删除规则","Remove rule"),onClick:()=>wr(e,function(e,t){const a=xe(e);return null===a||a.rules.length<=1||(a.rules=a.rules.filter((e,a)=>a!==t)),a}(t,l))},n.createElement(C,{name:"close",size:14}))),n.createElement("div",{className:"uh-pricing-temporal-windows"},o,i.windows.length<16?n.createElement("button",{type:"button",className:"uh-pricing-link",disabled:Hr,onClick:()=>wr(e,we(t,l,i.windows.concat([{start:"06:00",end:"10:00"}])))},r("添加时段","Add window")):null),n.createElement("div",{className:"uh-pricing-temporal-rates"},["input","output","cacheRead","cacheWrite"].map(o=>n.createElement("label",{key:o,className:"uh-pricing-temporal-rate"},n.createElement("span",{},r("峰时·","Peak ·")+re(o,a).split(" / ")[0]),n.createElement("input",{type:"number",min:"0",step:"any",value:i.rates[o],disabled:Hr,onChange:a=>wr(e,function(e,t,a){return ve(e,t,{rates:a})}(t,l,Object.assign({},i.rates,{[o]:a.target.value})))})))))});return n.createElement("div",{className:"uh-pricing-tier-editor uh-pricing-temporal-editor"},l,n.createElement("div",{className:"uh-pricing-tier-empty"},r("谷时段(未命中规则)使用该行基础价,峰时段使用规则费率;周几与时间均为 UTC。","Off-peak (no rule match) uses the row base rates, peak uses the rule rates. Weekdays and times are UTC.")),n.createElement("div",{className:"uh-pricing-temporal-fields"},n.createElement("label",{},n.createElement("span",{},r("策略 ID","Policy ID")),n.createElement("input",{type:"text",value:t.policyId,disabled:Hr,onChange:a=>wr(e,Object.assign(xe(t),{policyId:a.target.value}))})),n.createElement("label",{},n.createElement("span",{},r("生效起点(北京时间,留空 = 全部历史)","Effective from (UTC, empty = all history)")),n.createElement("input",{type:"date",value:t.effectiveFromText,disabled:Hr,onChange:a=>wr(e,Object.assign(xe(t),{effectiveFromText:a.target.value}))}))),null!==o&&o>0?n.createElement("div",{className:"uh-pricing-warning"},r("该时刻之前的用量没有可用档位,会失败关闭为未计价。","Usage before this instant has no applicable band and fails closed as unpriced.")):null,n.createElement("div",{className:"uh-pricing-temporal-holidays"},n.createElement("label",{className:"uh-pricing-switch"},n.createElement("input",{type:"checkbox",checked:!0===t.holidaysEnabled,disabled:Hr,onChange:a=>wr(e,Object.assign(xe(t),{holidaysEnabled:a.target.checked}))}),n.createElement("span",{},r("中国法定节假日全天按谷时计价","Chinese statutory holidays price as off-peak all day"))),!0===t.holidaysEnabled?n.createElement(n.Fragment,null,n.createElement("div",{className:"uh-pricing-tier-empty"},r("每行一个日期(YYYY-MM-DD),支持区间写法 2026-10-01..2026-10-07。按北京时间(UTC+8)日历日判定;调休上班日不会被自动识别,需要你自己从列表里去掉。","One date per line (YYYY-MM-DD); ranges such as 2026-10-01..2026-10-07 are expanded. Days follow the China Standard Time (UTC+8) calendar; swapped-in working weekends are not detected, so remove them yourself.")),n.createElement("textarea",{className:"uh-pricing-holiday-input",rows:4,spellCheck:!1,disabled:Hr,placeholder:"2026-10-01\n2026-10-02","aria-label":r("法定节假日日期","Statutory holiday dates"),value:t.holidaysText,onChange:a=>wr(e,Object.assign(xe(t),{holidaysText:a.target.value}))}),null===s?n.createElement("span",{className:"uh-pricing-error"},r("日期格式无效:请使用 YYYY-MM-DD,或 start..end 区间","Invalid dates: use YYYY-MM-DD, or a start..end range")):n.createElement("span",{className:"uh-pricing-tier-empty"},r("已解析 ","parsed ")+s.length+r(" 天节假日"," holiday days")),n.createElement("div",{className:"uh-pricing-holiday-load"},n.createElement("label",{className:"uh-pricing-map-field"},n.createElement("span",{},r("年份","Year")),n.createElement("input",{type:"number",min:"2000",max:"2100",step:"1",value:fa,disabled:Hr||xa,"aria-label":r("要载入的年份","Year to load"),onChange:e=>ya(Number(e.target.value))})),n.createElement("button",{type:"button",className:"uh-refresh",disabled:Hr||xa,onClick:()=>(e=>{if(!0===xa)return;if(""===Ja.current)return void ka(r("当前进程令牌不可用,请刷新看板","The process capability is unavailable; refresh the dashboard"));const t=Number(fa);!Number.isSafeInteger(t)||t<2e3||t>2100?ka(r("年份无效(2000–2100)","Invalid year (2000-2100)")):(va(!0),ka(""),pr(e=>((e,t)=>fetch("/api/all-usage/pricing/holidays",{method:"POST",headers:{"content-type":"application/json","x-all-usage-request-token":t},body:JSON.stringify({year:e,backfill:!1})}).then(e=>e.json().catch(()=>({ok:!1,message:"bad-response"})).then(t=>null!==t&&"object"==typeof t?t:{ok:!1,message:"HTTP "+e.status})))(t,e),t=>{if(null===t||"object"!=typeof t||!0!==t.ok||!Array.isArray(t.dates)){const e=t&&"object"==typeof t&&"string"==typeof t.message&&""!==t.message?t.message:"unavailable";return void ka(r("抓取失败:","Fetch failed: ")+e)}const n=void 0!==ga[e.key]?ga[e.key]:fe(e.temporalPlan,pe(a))||ye(e.rates,pe(a)),i=function(e,t){const a=be(e),n=null===a?[]:a.slice(),r=new Set(n);for(const e of Array.isArray(t)?t:[]){const t=String(e??"").trim();""===t||r.has(t)||(r.add(t),n.push(t))}return n.sort(),0===n.length?"":n.join("\n")}(n.holidaysText,t.dates),l=Number(t.fetchedAt),o="string"==typeof t.paperUrl&&""!==t.paperUrl?t.paperUrl:String(t.sourceUrl||""),s=Number.isFinite(l)&&l>0?new Date(l).toISOString().slice(0,16).replace("T"," "):"",c=Object.assign(xe(n),{holidaysEnabled:!0,holidaysText:i,holidaysSourceText:(o+(""===s?"":" · "+s)+(!0===t.cached?" · cached":"")).slice(0,512)});ka(r("已载入 ","Loaded ")+t.dates.length+r(" 天"," days")+(!0===t.cached?r("(缓存)"," (cached)"):"")),wr(e,c)},()=>{ka(r("抓取失败:网络不可用","Fetch failed: network unavailable"))}).finally(()=>va(!1)))})(e)},n.createElement(C,{name:"refresh",size:13}),xa?r("抓取中…","Fetching…"):r("从公开日历载入","Load from public calendar")),""!==wa?n.createElement("span",{className:"uh-pricing-tier-empty"},wa):null),""!==t.holidaysSourceText?n.createElement("span",{className:"uh-pricing-tier-empty",title:t.holidaysSourceText},r("来源:","Source: ")+t.holidaysSourceText):null):null),c,n.createElement("div",{className:"uh-pricing-temporal-foot"},t.rules.length<16?n.createElement("button",{type:"button",className:"uh-refresh",disabled:Hr,onClick:()=>wr(e,function(e){const t=xe(e);if(null===t||t.rules.length>=16)return t;const a=t.rules.length>0?t.rules[t.rules.length-1]:null;return t.rules.push({id:"peak-"+(t.rules.length+1),weekdays:null!==a?a.weekdays.slice(0,1):[1,2,3,4,5],windows:[{start:"06:00",end:"10:00"}],rates:null!==a?Object.assign({},a.rates):{input:"",output:"",cacheRead:"",cacheWrite:""}}),t}(t))},n.createElement(C,{name:"plus",size:13}),r("添加规则","Add rule")):null,""!==i?n.createElement("span",{className:"uh-pricing-error"},r("时段规则尚未完成,保存前需修正。","The rules are incomplete; fix them before saving.")):null))},ei=e=>{const t=null!==ma&&0===ma.indexOf(e.key+"|")?ma.slice(e.key.length+1):"";return n.createElement("div",{className:"uh-pricing-editor"},"tiers"===t?(e=>{const t=e.tiers;let i=0;const l=t.map((l,o)=>{const s=ae(l,i),c=Number(null!=l&&void 0!==l.size?l.size:NaN);return Number.isSafeInteger(c)&&(i=c),n.createElement("div",{key:o,className:"uh-pricing-tier-edit-row"+(s?"":" uh-invalid")},n.createElement("input",{type:"number",min:"1",max:"1000000000",step:"1",placeholder:r("阈值 Token","Token threshold"),title:r("本档覆盖范围:","This band covers ")+ee(t,o,a),"aria-label":r("上下文阈值 Token","Context threshold tokens"),value:null==l||void 0===l.size?"":l.size,disabled:Hr,onChange:t=>vr(e,o,"size",t.target.value)}),["input","output","cacheRead","cacheWrite"].map(t=>n.createElement("input",{key:t,type:"number",min:"0",step:"any",placeholder:re(t,a),"aria-label":r("档位","Band")+" "+re(t,a),value:null==l||void 0===l[t]?"":l[t],disabled:Hr,onChange:a=>vr(e,o,t,a.target.value)})),n.createElement("button",{type:"button",className:"uh-refresh uh-icon-button",title:r("删除费率档位","Remove rate band"),"aria-label":r("删除费率档位","Remove rate band"),disabled:Hr,onClick:()=>((e,t)=>{const a=function(e,t){return(Array.isArray(e)?e:[]).filter((e,a)=>a!==t).map(e=>Object.assign({},e))}(e.tiers,t);Jt(t=>null===t?t:ce(t,e,{tiered:a.length>0,tiers:a})),ra("")})(e,o)},n.createElement(C,{name:"close",size:14})))});return n.createElement("div",{className:"uh-pricing-tier-editor"},n.createElement("div",{className:"uh-pricing-tier-editor-head"},n.createElement("div",{className:"uh-pricing-tier-editor-title"},n.createElement("strong",{},r("上下文费率档位","Context rate bands")),n.createElement("span",{},r("输入上下文超过阈值后,整次请求使用该档四项费率","Above a threshold, all four rates apply to the whole request"))),n.createElement("button",{type:"button",className:"uh-refresh",disabled:Hr||t.length>=32,title:t.length>=32?r("每个模型最多 32 个档位","Maximum 32 bands per model"):r("添加上下文费率档位","Add context rate band"),onClick:()=>(e=>{const t=function(e,t){const a=Array.isArray(e)?e.map(e=>Object.assign({},e)):[];if(a.length>=32)return a;const n=a.length>0?a[a.length-1]:null,r=null!==n&&Number.isFinite(Number(n.size))?Number(n.size):1e5,i=null!==n?n:null!==t&&"object"==typeof t?t:{};return a.push({type:"context",size:Math.min(1e9,r+1e5),input:ne(i.input),output:ne(i.output),cacheRead:ne(i.cacheRead),cacheWrite:ne(i.cacheWrite)}),a}(e.tiers,e.rates);Jt(a=>null===a?a:ce(a,e,{tiered:t.length>0,tiers:t})),ra("")})(e)},n.createElement(C,{name:"plus",size:13}),r("添加档位","Add band"))),0===t.length?n.createElement("div",{className:"uh-pricing-tier-empty"},r("未配置档位,所有上下文使用基础费率。","No bands configured; base rates apply to every context.")):n.createElement(n.Fragment,null,n.createElement("div",{className:"uh-pricing-tier-edit-head"},n.createElement("span",{},r("超过 Token","Above tokens")),n.createElement("span",{},r("输入 / 1M","Input / 1M")),n.createElement("span",{},r("输出 / 1M","Output / 1M")),n.createElement("span",{},r("缓存读 / 1M","Cache read / 1M")),n.createElement("span",{},r("缓存写 / 1M","Cache write / 1M")),n.createElement("span",{},"")),l))})(e):null,"temporal"===t?Qr(e):null,n.createElement("div",{className:"uh-pricing-editor-foot"},n.createElement("button",{type:"button",className:"uh-pricing-link",onClick:Nr},r("收起","Collapse"))))},ti=e=>oa[e.key],ai=e=>{const t=null!==ma&&0===ma.indexOf(e.key+"|")?ma:null,i=ti(e),l=Array.isArray(ia[e.key])?ia[e.key]:[];return n.createElement(n.Fragment,{key:e.key},n.createElement("tr",{className:"uh-pricing-model-row"+(!0===e.usageBacked?"":!1===e.usageBacked?" uh-pricing-configured-row":" uh-pricing-unknown-row")},n.createElement("td",{className:"uh-pricing-model-name"},n.createElement("span",{className:"uh-model-label",title:e.model},n.createElement(pt,{row:e.row,size:16}),n.createElement("span",{className:"uh-model-text"},e.model||r("未知模型","Unknown model"))),n.createElement("div",{className:"uh-pricing-row-flags"},n.createElement("span",{className:"uh-pricing-status uh-pricing-status-"+e.status,title:e.reason||""},Z(e.status,a)),n.createElement("span",{className:"uh-pricing-tier-badge uh-flat"},(e=>!0===e.temporalConfigInvalid?r("时段配置异常","Peak plan invalid"):!0===e.tieredInvalid?r("档位异常","Bands invalid"):"manual"===e.source?r("手工价","Manual"):!0===e.temporalExplicit?r("自定义峰谷","Custom peak"):!0===e.temporalBuiltin?r("内置峰谷","Built-in peak"):"priced"===e.status?r("目录价","Catalog"):Z(e.status,a))(e)),e.mapped?n.createElement("span",{className:"uh-pricing-flag"},r("已映射","Mapped")):null,!0===e.usageBacked?null:!1===e.usageBacked?n.createElement("span",{className:"uh-pricing-flag"},r("账本无用量","No ledger usage")):n.createElement("span",{className:"uh-pricing-flag uh-pricing-flag-unknown",title:r("宿主未在模型清单里标注账本用量(通常是宿主插件版本较旧);这不代表没有用量","The host did not label ledger usage for this row (usually an older host plugin); it does not mean the row has none")},r("用量未知","Usage unknown")))),n.createElement("td",{className:"uh-pricing-map-cell"},n.createElement("div",{className:"uh-pricing-model-search"},n.createElement("input",{type:"text",className:"uh-pricing-model-search-input",placeholder:!0===e.mappable?r("输入官方模型 ID 检索","Type an official model ID"):r("该行不是账本路线","Not a ledger route"),value:void 0!==i?i:e.pricingModel||"",disabled:Hr||!0!==e.mappable,"aria-label":r("官方模型 ID","Official model ID"),"aria-autocomplete":"list",onFocus:t=>{if(!0!==e.mappable||!0===Hr)return;ua(e.key);const a=t.target;if(null!=a&&"function"==typeof a.select){try{a.select()}catch(e){}"function"==typeof requestAnimationFrame&&requestAnimationFrame(()=>{try{a.select()}catch(e){}})}},onBlur:()=>setTimeout(()=>{ua(t=>t===e.key?null:t),sa(t=>{const a=Object.assign({},t);return delete a[e.key],a})},140),onKeyDown:e=>{"Escape"===e.key&&ua(null)},onChange:t=>((e,t)=>{const a=e.key,n=Na.current;sa(e=>Object.assign({},e,{[a]:t})),ua(a);const r=Ca.current[a];void 0!==r&&(clearTimeout(r),delete Ca.current[a]);const i=(Ea.current[a]||0)+1;if(Ea.current[a]=i,""===String(t||"").trim())return void la(e=>Object.assign({},e,{[a]:[]}));const l=setTimeout(()=>{delete Ca.current[a],(e=>{const t=new URLSearchParams({q:String(e||"").slice(0,120),limit:"30"});return fetch("/api/all-usage/pricing/models?"+t.toString(),{headers:{accept:"application/json"}}).then(e=>{if(!e.ok)throw new Error("HTTP "+e.status);return e.json()})})(t).then(e=>{Na.current===n&&Ea.current[a]===i&&la(t=>Object.assign({},t,{[a]:Array.isArray(e&&e.items)?e.items:[]}))},()=>{Na.current===n&&Ea.current[a]===i&&la(e=>Object.assign({},e,{[a]:[]}))})},180);Ca.current[a]=l})(e,t.target.value)}),ca===e.key&&l.length>0?n.createElement("div",{className:"uh-language-options uh-pricing-model-options",role:"listbox","aria-label":r("官方模型匹配结果","Official model matches")},l.map(t=>n.createElement("button",{key:t.value,type:"button",role:"option",className:"uh-language-option uh-pricing-model-option",onMouseDown:e=>e.preventDefault(),onClick:()=>((e,t)=>{if(!t||"string"!=typeof t.value)return;const a=Ca.current[e.key];void 0!==a&&(clearTimeout(a),delete Ca.current[e.key]),Ea.current[e.key]=(Ea.current[e.key]||0)+1,Jt(a=>null===a?a:function(e,t,a){const n=null!==e&&"object"==typeof e?e:{sync:{},mappings:[],overrides:[]};if(!0!==t.mappable||null==a||"string"!=typeof a.value)return n;const r=Array.isArray(n.mappings)?n.mappings.map(e=>Object.assign({},e)):[],i=oe(r,t.identityKey),l={identityKey:t.identityKey,provider:null!==t.row&&"object"==typeof t.row&&"string"==typeof t.row.provider?t.row.provider:"",model:null!==t.row&&"object"==typeof t.row&&(t.row.actualModel||t.row.requestedModel)||"",catalogProviderId:"string"==typeof a.providerId?a.providerId:"",catalogModelId:a.value};return i<0?r.push(Object.assign({inputTokenSemantics:"fresh",multiplier:"1"},l)):r[i]=Object.assign({},r[i],l),Object.assign({},n,{mappings:r})}(a,e,t)),pa(a=>Object.assign({},a,{[e.key]:t})),sa(a=>Object.assign({},a,{[e.key]:t.label||t.value})),ua(null),ra("")})(e,t)},n.createElement(C,{name:"list",size:14}),n.createElement("span",{className:"uh-pricing-model-option-name"},t.label||t.value),n.createElement("span",{className:"uh-pricing-model-option-id"},t.value+(!0===t.tiered?" · "+r("分层 ","tiered ")+t.tierCount:"")+(!0===t.builtinTemporal?" · "+r("峰谷","peak"):""))))):null,e.mapped?n.createElement("button",{type:"button",className:"uh-pricing-link uh-pricing-clear-mapping",disabled:Hr,title:r("删除该行的官方模型映射,回到按模型自动匹配","Remove this row mapping and fall back to automatic model matching"),onClick:()=>(e=>{Jt(t=>null===t?t:function(e,t){if(null===e||"object"!=typeof e)return e;const a=oe(e.mappings,t);if(a<0)return e;const n=e.mappings.slice();return n.splice(a,1),Object.assign({},e,{mappings:n})}(t,e.identityKey)),pa(t=>{const a=Object.assign({},t);return delete a[e.key],a}),sa(t=>{const a=Object.assign({},t);return delete a[e.key],a}),ra("")})(e)},r("清除映射","Clear mapping")):null),n.createElement("div",{className:"uh-pricing-map-sub"},n.createElement("label",{className:"uh-pricing-map-field"},n.createElement("span",{},r("倍率","Multiplier")),n.createElement("input",{type:"number",min:"0",step:"any",value:e.multiplier,disabled:Hr||!0!==e.mapped,title:!0===e.mapped?r("成本倍率,只作用于最终总价","Cost multiplier; applied to the final total only"):r("设置映射后生效","Effective after a mapping is set"),"aria-label":r("成本倍率","Cost multiplier"),onChange:t=>xr(e,"multiplier",t.target.value)})),n.createElement("label",{className:"uh-pricing-map-field"},n.createElement("span",{},r("输入口径","Input semantics")),n.createElement("select",{value:e.inputTokenSemantics,disabled:Hr||!0!==e.mapped,"aria-label":r("输入口径","Input semantics"),title:Q(e.inputTokenSemantics,a),onChange:t=>xr(e,"inputTokenSemantics",t.target.value)},n.createElement("option",{value:"fresh"},"Fresh"),n.createElement("option",{value:"total"},"Total"),n.createElement("option",{value:"legacy"},"Legacy"))))),Zr(e,"input"),Zr(e,"output"),Zr(e,"cacheRead"),Zr(e,"cacheWrite"),n.createElement("td",{className:"uh-pricing-row-actions"},n.createElement("button",{type:"button",className:"uh-pricing-chip"+(null!==t&&"tiers"===t.slice(e.key.length+1)?" uh-on":"")+(e.tierCount>0?" uh-strong":""),disabled:Hr,title:e.tierCount>0?r("上下文分层:已配置 ","Context tiers: ")+e.tierCount+r(" 个档位"," bands"):r("上下文分层:未配置,所有上下文使用基础费率","Context tiers: none, base rates apply to every context"),onClick:()=>Er(e,"tiers")},r("上下文分层","Context tiers")),n.createElement("button",{type:"button",className:"uh-pricing-chip"+(null!==t&&"temporal"===t.slice(e.key.length+1)?" uh-on":"")+(!0===e.temporalBuiltin||!0===e.temporalExplicit?" uh-strong":""),disabled:Hr,title:r("时间分层:","Time tiers: ")+Xr(e),onClick:()=>Er(e,"temporal")},r("时间分层","Time tiers")),"manual"===e.source?n.createElement("button",{type:"button",className:"uh-pricing-link",disabled:Hr,title:r("删除手工价,回落到目录价或内置峰谷","Remove the manual price and fall back to the catalog or the built-in peak table"),onClick:()=>(e=>{Jt(t=>null===t?t:function(e,t){if(null===e||"object"!=typeof e)return e;const a=le(e.overrides,t);if(a<0)return e;const n=e.overrides.slice();return n.splice(a,1),Object.assign({},e,{overrides:n})}(t,e.basis)),ba(t=>{const a=Object.assign({},t);return delete a[e.key],a}),ra("")})(e)},r("恢复默认","Reset")):null)),null===t?null:n.createElement("tr",{className:"uh-pricing-editor-row"},n.createElement("td",{colSpan:7},ei(e))))},ni=Bt?n.createElement(ut,{revision:rr,render:()=>{return null!==Gt?n.createElement("div",{className:"uh-panel uh-pricing-panel uh-anim-panel"},n.createElement("div",{className:"uh-pricing-head"},n.createElement("div",{className:"uh-title-with-icon"},n.createElement(C,{name:"wallet",size:16}),n.createElement("strong",{},r("成本统计设置","Cost Statistics"))),n.createElement("button",{type:"button",className:"uh-refresh uh-icon-button",title:r("关闭成本设置","Close cost settings"),"aria-label":r("关闭成本设置","Close cost settings"),disabled:Hr,onClick:gr},n.createElement(C,{name:"close",size:16}))),n.createElement("div",{className:"uh-pricing-note"},r("价格单位为 USD / 1M Token。直接改价格框即创建或更新手工价(同一官方模型的所有行共享同一价格);「官方模型」列选定映射后该行自动改用官方目录价;「档位」配置上下文费率档,「分时计费」配置 UTC 峰谷规则。","Prices are USD per 1M tokens. Editing a price box creates or updates a manual price (every row priced from the same official model shares it). Picking an official model in the mapping column switches the row to the catalog price. Bands add context-dependent rates; Time-of-day adds UTC peak rules.")),n.createElement("div",{className:"uh-pricing-toolbar"},n.createElement("label",{className:"uh-pricing-switch"},n.createElement("input",{type:"checkbox",checked:!0===Gt.sync.autoEnabled,disabled:Hr,onChange:e=>(e=>{if(null===Gt||ta||Xt||Qt)return;const t=!0===e,a=Gt.sync&&!0===Gt.sync.autoEnabled;if(Jt(e=>null===e?e:Object.assign({},e,{sync:Object.assign({},e.sync,{autoEnabled:t})})),At({pricingAutoSync:t}),""===Ja.current)return Jt(e=>null===e?e:Object.assign({},e,{sync:Object.assign({},e.sync,{autoEnabled:a})})),At({pricingAutoSync:a}),void ra("token");const n=e=>{Jt(e=>null===e?e:Object.assign({},e,{sync:Object.assign({},e.sync,{autoEnabled:a})})),At({pricingAutoSync:a}),ra(e)};aa(!0),ra(""),pr(e=>vt({sync:{autoEnabled:t}},!1,e),e=>{if(!e||!0!==e.ok||!e.pricing)return void n("save");const t=e.pricing.sync&&!0===e.pricing.sync.autoEnabled;N(t=>null===t?t:Object.assign({},t,{pricing:e.pricing})),Vt(e.pricing),Jt(a=>null===a?a:Object.assign({},a,{sync:Object.assign({},a.sync,{autoEnabled:t,intervalMs:e.pricing.sync&&e.pricing.sync.intervalMs})})),At({pricingAutoSync:t})},e=>n(e&&403===e.status?"stale":"save")).finally(()=>aa(!1))})(e.target.checked)}),n.createElement("span",{},r("启用 6 小时自动同步","Enable 6-hour automatic sync"))),n.createElement("span",{className:"uh-note"},ta?r("保存中…","Saving…"):Br.lastSuccessAt>0?r("上次成功:","Last success: ")+new Date(Br.lastSuccessAt).toLocaleString():r("尚未同步","Not synced yet")),n.createElement("button",{type:"button",className:"uh-refresh",onClick:yr,disabled:Hr},n.createElement(C,{name:"refresh",size:14}),Qt?r("同步中…","Syncing…"):r("立即同步","Sync now"))),Br.lastError?n.createElement("div",{className:"uh-pricing-error",role:"alert"},r("上次同步失败:","Last sync failed: ")+Br.lastError):null,_r?n.createElement("div",{className:"uh-pricing-error",role:"status"},r("宿主插件 v","Host plugin v")+Jr+r(" 与当前页面 v"," and this page v")+i+r(" 不一致:DSH 只在启动时加载插件,请重启 DSH 让新版本生效(本面板正按旧宿主的数据降级显示)"," differ: DSH imports the plugin only at startup, so restart DSH for the new version (this panel is showing the older host payload)")):null,$r?n.createElement("div",{className:"uh-pricing-error",role:"status"},r("宿主未提供模型清单(插件版本较旧):无法列出账本模型;请重启 DSH 后重新打开本面板","The host sent no model list (older plugin): the ledger models cannot be listed; restart DSH and reopen this panel")):null,n.createElement("div",{className:"uh-pricing-table-note"},r("共 ","")+tr.length+r(" 个模型"," models")+(Vr>0?r("("," (")+Vr+r(" 项仅存在于配置中,账本暂无用量)"," configured rows have no ledger usage)"):"")+(Gr>0?r("(其中 "," (")+Gr+r(" 项用量未知:宿主未标注账本用量)"," rows have unknown usage: the host did not label ledger usage)"):"")+(tr.length>=500?r(" · 已达 500 行上限"," · capped at 500 rows"):"")),n.createElement("div",{className:"uh-pricing-table-wrap"},n.createElement("table",{className:"uh-pricing-model-table uh-pricing-price-table"},n.createElement("thead",{},n.createElement("tr",{},n.createElement("th",{scope:"col"},r("模型","Model")),n.createElement("th",{scope:"col"},r("官方模型 / 映射","Official model / mapping")),n.createElement("th",{scope:"col"},r("输入 / 1M","Input / 1M")),n.createElement("th",{scope:"col"},r("输出 / 1M","Output / 1M")),n.createElement("th",{scope:"col"},r("缓存读 / 1M","Cache read / 1M")),n.createElement("th",{scope:"col"},r("缓存写 / 1M","Cache write / 1M")),n.createElement("th",{scope:"col"},r("操作","Actions")))),n.createElement("tbody",{},0===tr.length?n.createElement("tr",{},n.createElement("td",{colSpan:7},n.createElement("div",{className:"uh-empty",style:{padding:"12px 0"}},r("暂无模型用量","No model usage yet")))):tr.map(e=>n.createElement(dt,{key:e.key,view:e,busy:Hr,language:a,openSection:null!==ma&&0===ma.indexOf(e.key+"|")?ma:null,searchText:void 0===ti(e)?null:ti(e),searchOpen:ca===e.key,searchOptions:Array.isArray(ia[e.key])?ia[e.key]:null,temporalDraft:void 0===ga[e.key]?null:ga[e.key],temporalPlan:e.temporalPlan,holidayStatus:wa,holidayLoading:xa,render:ai}))))),""!==na?n.createElement("div",{className:"uh-pricing-error",role:"alert"},"stale"===(e=na)?r("写入被拒绝:进程令牌已失效,自动重取令牌后仍失败,请刷新看板","Write rejected: the process capability had rotated and the automatic retry still failed; refresh the dashboard"):"forbidden"===e?r("写入被拒绝:权限校验未通过(也可能是进程令牌已失效),请刷新看板后重试","Write rejected: the permission check failed (a stale process capability is also possible); refresh the dashboard and retry"):"token"===e?r("当前进程令牌不可用,请刷新看板","The process capability is unavailable; refresh the dashboard"):"load"===e?r("完整费率设置加载失败","Full pricing settings could not be loaded"):"sync"===e?r("models.dev 同步失败,已保留上次成功目录和未保存编辑","models.dev sync failed; the last good catalog and unsaved edits were kept"):"mapping"===e?r("模型映射无效:请选择官方模型并填写有效倍率","Invalid mapping: pick an official model and enter a valid multiplier"):"tier"===e?r("费率档位无效:最多 32 档;阈值必须为递增的正整数,四项费率必须完整且非负","Invalid rate bands: maximum 32; thresholds must be increasing positive integers and all four rates must be complete and non-negative"):"temporal"===e?r("分时计费无效:需要策略 ID,每规则至少一个周几与一个时段,时间格式 HH:MM 且结束大于开始,同周几的时段不得重叠,四项费率必须完整","Invalid time-of-day rules: a policy ID, at least one weekday and window per rule, HH:MM times with the end after the start, no overlapping windows on the same weekday, and all four rates filled in"):"override"===e?r("价格无效:请填写完整的非负基础费率","Invalid price: enter all non-negative base rates"):"too-large"===e?r("成本设置过大,无法保存:请精简档位或时段规则","The cost settings are too large to save: trim bands or peak rules"):r("成本设置保存失败,请检查输入","Cost settings could not be saved; check the inputs")):null,n.createElement("div",{className:"uh-pricing-foot"},n.createElement("span",{className:"uh-note"},r("保存只影响未计价调用与之后的调用,已有正成本不会重算;改动时段规则会按新政策重新对账该模型历史。","Saving affects unpriced and future calls only; existing positive costs are never recalculated. Changing a peak plan reconciles that model history against the new rules.")),n.createElement("div",{className:"uh-actions"},n.createElement("button",{type:"button",className:"uh-refresh",disabled:Hr,onClick:gr},r("取消","Cancel")),n.createElement("button",{type:"button",className:"uh-refresh",disabled:Hr,onClick:()=>fr(!1)},Xt?r("保存中…","Saving…"):r("保存","Save")),n.createElement("button",{type:"button",className:"uh-refresh uh-pricing-backfill",disabled:Hr,onClick:()=>fr(!0)},r("保存并回填","Save and backfill"))))):n.createElement("div",{className:"uh-panel uh-pricing-panel uh-anim-panel"},n.createElement("div",{className:"uh-pricing-head"},n.createElement("div",{className:"uh-title-with-icon"},n.createElement(C,{name:"wallet",size:16}),n.createElement("strong",{},r("成本统计设置","Cost Statistics"))),n.createElement("button",{type:"button",className:"uh-refresh uh-icon-button",title:r("关闭成本设置","Close cost settings"),"aria-label":r("关闭成本设置","Close cost settings"),disabled:Hr,onClick:gr},n.createElement(C,{name:"close",size:16}))),_t?n.createElement("div",{className:"uh-empty",role:"status",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:10}},n.createElement("span",{className:"uh-trend-spinner","aria-hidden":!0}),n.createElement("span",{},r("正在加载完整费率设置…","Loading full pricing settings…"))):n.createElement("div",{className:"uh-empty",role:"alert"},n.createElement("div",{},r("完整费率设置加载失败","Full pricing settings could not be loaded")),n.createElement("button",{type:"button",className:"uh-refresh",style:{marginTop:10},onClick:br},n.createElement(C,{name:"refresh",size:14}),r("重试","Retry"))));var e}}):null,ri=function(e,t){const a=null!==t&&"object"==typeof t?t:{},n="string"==typeof a.current&&""!==a.current?a.current:"string"==typeof e?e:"",r="string"==typeof a.latest&&""!==a.latest?a.latest:null,i="outdated"===a.status||"latest"===a.status?a.status:"unknown",l=Number(a.checkedAt);return{current:n,latest:r,status:null===r?"unknown":i,checkedAt:Number.isFinite(l)&&l>0?l:null,sourceUrl:"string"==typeof a.sourceUrl?a.sourceUrl:"",error:"string"==typeof a.error?a.error:""}}(null!==v&&"string"==typeof v.pluginVersion?v.pluginVersion:i,J),ii="latest"===ri.status?r("已是最新","Up to date"):"outdated"===ri.status&&null!==ri.latest?r("最新 v","Latest v")+ri.latest:"",li=r("当前版本 v","Running version v")+ri.current+("latest"===ri.status?r("\n已是最新版本","\nThis is the newest release"):"")+("outdated"===ri.status&&null!==ri.latest?r("\n最新版本 v","\nNewest release v")+ri.latest:"")+("unknown"===ri.status&&"endpoint"===de?r("\n宿主尚未提供版本检查(运行中的插件较早):重启 DSH 后可用","\nThe host does not provide the version check yet (an older plugin is running): restart DSH"):"unknown"===ri.status?r("\n尚未确认是否有新版本","\nWhether a newer release exists is not confirmed"):"")+(null!==ri.checkedAt?r("\n检查时间:","\nChecked: ")+new Date(ri.checkedAt).toLocaleString():"")+(""!==ri.error?r("\n版本检查失败:","\nVersion check failed: ")+ri.error:"")+r("\n点击打开 GitHub 仓库","\nClick to open the GitHub repository"),oi=n.createElement("button",{type:"button",className:"uh-version"+("outdated"===ri.status?" uh-version-outdated":""),title:li,"aria-label":li,onClick:()=>{try{window.open(Ue,"_blank","noopener,noreferrer")}catch(e){}}},n.createElement("span",{className:"uh-version-number"},"v"+ri.current),""===ii?null:n.createElement("span",{className:"uh-version-status"},ii)),si=n.createElement("button",{type:"button",className:"uh-gh",title:r("在 GitHub 上给项目点个星","Star this plugin on GitHub"),"aria-label":r("在 GitHub 上给项目点个星","Star this plugin on GitHub"),onClick:()=>{try{window.open(Ue,"_blank","noopener,noreferrer")}catch(e){}}},n.createElement("svg",{className:"uh-gh-star",width:12,height:12,viewBox:"0 0 16 16","aria-hidden":!0},n.createElement("path",{d:"M8 1.1l2.02 4.1 4.52.66-3.27 3.19.77 4.5L8 11.42l-4.04 2.13.77-4.5L1.46 5.86l4.52-.66L8 1.1z"})),n.createElement("svg",{className:"uh-gh-mark",width:14,height:14,viewBox:"0 0 16 16","aria-hidden":!0},n.createElement("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})),n.createElement("span",{className:"uh-gh-label"},"GitHub")),ci="custom"===O&&null!==gn?"en"===a?gn.start+" to "+gn.end+" (UTC)":gn.start+" 至 "+gn.end:"today"===O?r("今日","Today"):"7d"===O?r("近 7 天","Last 7 Days"):"30d"===O?r("近 30 天","Last 30 Days"):"90d"===O?r("近 90 天","Last 90 Days"):r("全部","All Time"),ui=function(e,t,a){if("custom"!==e)return e;const n=m(t,a);return null===n?"custom":"custom-"+n.start+"-to-"+n.end}(O,gn,l),di="invalid"===bn?r("请选择有效的开始日期和结束日期","Choose valid start and end dates"):"order"===bn?r("结束日期不能早于开始日期","End date must be on or after the start date"):"bounds"===bn?r("可选范围为 "+hn+" 至 "+f,"Choose a date from "+hn+" to "+f):"",pi=Ae?n.createElement("div",{className:"uh-custom-range",role:"group","aria-label":r("自定义时间范围","Custom date range")},n.createElement("div",{className:"uh-custom-range-meta"},n.createElement("div",{className:"uh-custom-range-title"},n.createElement(C,{name:"calendar",size:15}),r("自定义时间范围","Custom date range")),n.createElement("div",{className:"uh-custom-range-note"},r("可查看全部可扫描历史日数据;中文按本地日期,English 按 UTC。热力图可切换最近 30 天 / 90 天 / 12 个月。","All available historical daily data can be selected. Chinese uses local dates; English uses UTC. The heatmap switches between the last 30 days, 90 days and 12 months."))),n.createElement("div",{className:"uh-custom-range-fields"},n.createElement("label",{className:"uh-custom-range-field"},n.createElement("span",{},r("开始日期","Start date")),n.createElement("input",{type:"date",value:Ce.start,min:hn,max:f,onChange:e=>Se(t=>Object.assign({},t,{start:e.target.value}))})),n.createElement("label",{className:"uh-custom-range-field"},n.createElement("span",{},r("结束日期","End date")),n.createElement("input",{type:"date",value:Ce.end,min:hn,max:f,onChange:e=>Se(t=>Object.assign({},t,{end:e.target.value}))}))),n.createElement("div",{className:"uh-custom-range-actions"},n.createElement("button",{type:"button",className:"uh-custom-range-cancel",onClick:()=>ze(!1)},r("取消","Cancel")),n.createElement("button",{type:"button",className:"uh-custom-range-apply",disabled:""!==bn,onClick:()=>{if(""!==bn)return;const e=m(Ce,l);null!==e&&(Ne(e),K("custom"),ze(!1))}},r("应用","Apply"))),""!==di?n.createElement("div",{className:"uh-custom-range-error",role:"alert"},di):null):null,mi=n.createElement(lt,{key:nr,rows:ar,visible:tt,language:a,rangeLabel:ci,loading:$e&&!xn,error:""===Qe||"stale"===Qe||Nn?"":r("趋势数据加载失败","Trend data unavailable"),onToggle:or,onPointClick:ln}),hi=null===Qa?ci:Qa.start===Qa.end?Qa.start:Qa.start+" → "+Qa.end,gi=n.createElement(mt,{visible:"logs"===nt,panelRef:ja,scopeLabel:hi,scopeUtc:!(!Qa||!Qa.utc),scopeAvailable:null!==Qa,loading:jt,exporting:Ft,error:Wt,rows:Et,selectedId:wt,hasMore:zt,language:a,actionKey:en+":"+(Za||"")+":"+(Ct||""),onExport:async()=>{if("logs"!==nt||null===Qa||Ft)return;const e=Za;Ut(!0),Ot("");try{let t=null;const a=[];for(let n=0;n<50;n+=1){const n=await yt(Qa,t,200);if(null===n||"object"!=typeof n||!Array.isArray(n.items)||null===e||x(n)!==e)throw new Error("audit export stale");if(a.push(...n.items),!n.hasMore||!n.nextCursor)break;t=n.nextCursor}const n=e=>'"'+String(e??"").replace(/"/g,'""')+'"',i=e=>e.map(n).join(","),l=[r("时间","Time"),r("日期","Date"),r("Provider","Provider"),r("请求模型","Requested model"),r("实际模型","Actual model"),r("显示模型","Display model"),"turn","step","seq",r("输入","Input"),r("缓存命中","Cache read"),r("缓存写入","Cache write"),r("输出","Output"),r("推理","Reasoning"),r("成本","Cost"),r("计价状态","Cost status"),r("计价模型","Pricing model"),r("计费档位","Billing band"),r("计费时刻(UTC)","Billing time (UTC)"),r("计费时间来源","Billing time source"),r("计费策略","Billing policy"),r("策略哈希","Policy hash"),r("来源","Source")],o=[i([r("DSH 用量明细导出","DSH Usage Audit Export")]),i([r("范围","Scope"),Qa.start+" → "+Qa.end]),i([r("时区","Timezone"),Qa.utc?"UTC":r("本地","Local")]),i(l)];for(const e of a)o.push(i([e.time,e.date,e.provider,e.requestedModel,e.actualModel,e.model,e.turn,e.step,e.seq,ct(e,"input"),ct(e,"cacheRead"),ct(e,"cacheWrite"),ct(e,"output"),ct(e,"reasoning"),e.cost&&"priced"===e.cost.status?e.cost.total:"",e.cost&&e.cost.status?e.cost.status:"unpriced",e.cost&&e.cost.pricingModel?e.cost.pricingModel:"",e.cost&&e.cost.pricingBand?e.cost.pricingBand:"",e.cost&&Number.isFinite(e.cost.pricingAt)?new Date(e.cost.pricingAt).toISOString():"",e.cost&&e.cost.pricingTimeSource?e.cost.pricingTimeSource:"",e.cost&&e.cost.pricingPolicyId?e.cost.pricingPolicyId:"",e.cost&&e.cost.pricingPolicyHash?e.cost.pricingPolicyHash:"",e.materialization||"unknown"]));const s=new Blob(["\ufeff"+o.join("\r\n")],{type:"text/csv;charset=utf-8"}),c=URL.createObjectURL(s),u=document.createElement("a");u.href=c,u.download="dsh-all-usage-audit-"+Qa.start+"-to-"+Qa.end+".csv",document.body.appendChild(u),u.click(),u.remove(),URL.revokeObjectURL(c)}catch(e){Ot("audit-export")}finally{Ut(!1)}},onLoadMore:()=>{if("logs"!==nt||null===Qa||null===Ct||jt)return;const e=Ha.next(),t=Za;Dt(!0),yt(Qa,Ct,20).then(a=>{if(Ha.isCurrent(e)){if(null===a||"object"!=typeof a||!Array.isArray(a.items)||null===t||x(a)!==t)return Ot("stale"),Dt(!1),void It(e=>e+1);Nt(e=>e.concat(a.items)),Mt(a.nextCursor||null),Tt(!0===a.hasMore&&a.items.length>0),Dt(!1),Ot("")}},t=>{if(Ha.isCurrent(e)){if(t&&409===t.status)return Dt(!1),Mt(null),Tt(!1),Ot("stale"),void It(e=>e+1);Dt(!1),Ot("audit")}})},onSelect:kt}),bi=!cr.done,fi=cr.total>0?Math.min(100,Math.round(cr.scanned/cr.total*100)):40,yi=cr.done&&0===dr.length&&0===Sn.totals.turns&&0===Sn.totals.calls,xi="number"==typeof ur.lastCompletedAt&&ur.lastCompletedAt>0?new Date(ur.lastCompletedAt).toLocaleString("en"===a?"en-US":"zh-CN"):"",vi=I>0?new Date(I).toLocaleString("en"===a?"en-US":"zh-CN"):"",wi=""===xi?void 0:"en"===a?"Historical scan completed "+xi:"历史扫描完成于 "+xi,ki="en"===a?(""!==vi?"Updated "+vi:bi?"Refreshing data":"Update state pending")+" · "+(ur.sessionsSkippedByRevision||0)+" revision reused · "+(ur.sessionsRead||0)+" read"+((ur.sessionsRestoredFromLedger||0)>0?" · "+ur.sessionsRestoredFromLedger+" ledger restored":"")+((ur.sessionsFailed||0)>0?" · "+ur.sessionsFailed+" failed":"")+" · "+(!0===ur.persistenceSnapshotsAvailable?"revision optimization on":"full-read fallback"):(""!==vi?"已更新 "+vi:bi?"正在更新数据":"数据更新准备中")+" · revision 复用 "+(ur.sessionsSkippedByRevision||0)+" · 实际读取 "+(ur.sessionsRead||0)+((ur.sessionsRestoredFromLedger||0)>0?" · 账本恢复 "+ur.sessionsRestoredFromLedger:"")+((ur.sessionsFailed||0)>0?" · 失败 "+ur.sessionsFailed:"")+" · "+(!0===ur.persistenceSnapshotsAvailable?"免读优化已启用":"全量读取回退"),Ei=""===A?"":"en"===a?"Usage data may be stale"+(""!==vi?"; last full update "+vi:""):"用量数据可能已过期"+(""!==vi?";上次完整更新 "+vi:"");return n.createElement("div",{className:"uh-page"},n.createElement("div",{className:"uh-head"},n.createElement("div",{className:"uh-title-wrap"},n.createElement("h2",{className:"uh-title"},r("用量统计","Usage Statistics")),oi,si),n.createElement("div",{className:"uh-actions"},n.createElement("button",{className:"uh-refresh",title:r("管理工作区别名","Manage workspace aliases"),onClick:()=>{Lt?Pt(!1):(()=>{const e={};Wn.forEach(t=>{e[t.id]="string"==typeof On[t.id]?On[t.id]:""}),qt(e),Pt(!0)})()}},n.createElement(C,{name:"edit",size:14}),r("工作区别名","Workspace Aliases")),n.createElement("button",{className:"uh-refresh",title:r("配置模型价格与同步","Configure model prices and sync"),disabled:Xt||Qt||ta,onClick:()=>{Bt?gr():br()}},n.createElement(C,{name:"wallet",size:14}),r("成本设置","Cost Settings")),n.createElement("div",{className:"uh-language-menu"+(Ta?" uh-open":""),ref:Ia,onKeyDown:e=>{"Escape"===e.key&&(e.preventDefault(),Ra(!1))}},n.createElement("button",{type:"button",className:"uh-language-trigger"+(Ta?" uh-open":""),title:r("切换界面语言","Change interface language"),"aria-label":r("界面语言","Interface language"),"aria-haspopup":"menu","aria-expanded":Ta,onClick:()=>Ra(e=>!e)},n.createElement(C,{name:"language",size:14}),n.createElement("span",{className:"uh-language-label"},"en"===a?"English":"中文"),n.createElement(C,{name:"chevron",size:13,className:"uh-language-caret"})),Ta?n.createElement("div",{className:"uh-language-options",role:"menu","aria-label":r("界面语言","Interface language")},[["zh","中文"],["en","English"]].map(t=>n.createElement("button",{key:t[0],type:"button",role:"menuitemradio","aria-checked":a===t[0],className:"uh-language-option"+(a===t[0]?" uh-on":""),onClick:()=>((t=>{"function"==typeof e.onLanguageChange&&e.onLanguageChange("en"===t?"en":"zh")})(t[0]),void Ra(!1))},n.createElement(C,{name:"language",size:14}),n.createElement("span",{},t[1]),a===t[0]?n.createElement(C,{name:"check",size:14,className:"uh-language-option-check"}):null))):null),n.createElement("div",{className:"uh-range"},["today","7d","30d","90d","all","custom"].map(e=>n.createElement("button",{key:e,type:"button",className:O===e?"uh-on":"",title:"custom"===e&&"custom"===O?ci:void 0,onClick:()=>{"custom"===e?(()=>{const e=m(ge,l),t=u(d(c,-89,l),l);Se(e||{start:t<hn?hn:t,end:f}),ze(!0)})():(K(e),ze(!1))}},"today"===e?r("今日","Today"):"7d"===e?r("近 7 天","Last 7 Days"):"30d"===e?r("近 30 天","Last 30 Days"):"90d"===e?r("近 90 天","Last 90 Days"):"all"===e?r("全部","All Time"):r("自定义","Custom")))),n.createElement("button",{className:"uh-refresh",title:r("导出当前时间范围与模型查看模式的 CSV 数据","Export CSV data for the current time range and model view"),onClick:()=>{const e=e=>'"'+String(e??"").replace(/"/g,'""')+'"',t=t=>t.map(e).join(","),n=e=>e.input+e.output+e.cacheRead+e.cacheWrite+e.reasoning,i=[r("输入 Token","Input Tokens"),r("缓存命中 Token","Cache-Hit Tokens"),r("缓存写入 Token","Cache-Write Tokens"),r("输出 Token","Output Tokens"),r("推理 Token","Reasoning Tokens"),r("总处理 Token","Total Tokens Processed"),r("成本","Cost"),r("缓存命中率","Cache Hit Rate")],o=[t([r("DSH 用量统计导出","DSH Usage Statistics Export")]),t([r("导出时间","Exported At"),l?(new Date).toLocaleString("en-US",{timeZone:"UTC",timeZoneName:"short"}):(new Date).toLocaleString("zh-CN")]),t([r("时间范围","Time Range"),ci]),t([r("时区","Timezone"),l?"UTC":r("本地","Local")]),t([r("工作区筛选","Workspace Filter"),je||r("全部","All")]),t([r("供应商筛选","Provider Filter"),Le||r("全部","All")]),t([r("模型筛选","Model Filter"),null===Ke?r("全部","All"):T(Ke)]),t([r("统计 revision","Stats Revision"),v.revision||""]),t([r("模型查看模式","Model View Mode"),Wr]),"",t([r("汇总","Summary")]),t([r("回合","Turns"),r("会话","Sessions"),...i]),t([Sn.totals.turns,Sn.totals.sessions,Sn.totals.input,Sn.totals.cacheRead,Sn.totals.cacheWrite,Sn.totals.output,Sn.totals.reasoning,n(Sn.totals),G(Sn.totals,a),E(Sn.totals.input,Sn.totals.cacheRead).toFixed(2)+"%"]),"",t([r("模型用量明细","Model Usage Details")]),t([Or,r("调用","Calls"),...i]),...Un.map(e=>t([e.model,e.calls,e.input,e.cacheRead,e.cacheWrite,e.output,e.reasoning,n(e),G(e,a),E(e.input,e.cacheRead).toFixed(2)+"%"])),"",t([r("工作区明细","Workspace Details")]),t([r("工作区","Workspace"),r("路径","Path"),r("回合","Turns"),...i]),...Fn.map(e=>{const r=Yn.get(e.workspaceId);return t([Gn(e.workspaceId),r?r.path:"",e.turns,e.input,e.cacheRead,e.cacheWrite,e.output,e.reasoning,n(e),G(e,a),E(e.input,e.cacheRead).toFixed(2)+"%"])})],s=new Blob(["\ufeff"+o.join("\r\n")],{type:"text/csv;charset=utf-8"}),c=URL.createObjectURL(s),d=document.createElement("a");d.href=c,d.download="dsh-all-usage-"+ui+"-"+Te+"-"+u(new Date,l)+".csv",document.body.appendChild(d),d.click(),d.remove(),URL.revokeObjectURL(c)}},n.createElement(C,{name:"export",size:14}),r("导出数据","Export Data")),n.createElement("button",{className:"uh-refresh uh-icon-button",title:r("刷新统计数据","Refresh usage statistics"),"aria-label":r("刷新统计数据","Refresh usage statistics"),onClick:sn},n.createElement(C,{name:"refresh",size:16})))),n.createElement("div",{className:"uh-filter-bar",role:"group","aria-label":r("统一筛选","Unified filters")},n.createElement(ht,{label:r("全部工作区","All workspaces"),ariaLabel:r("工作区筛选","Workspace filter"),className:"uh-filter-workspace",icon:"folder",value:je||"",options:Jn,onChange:e=>De(e||null)}),n.createElement(ht,{label:r("全部供应商","All providers"),ariaLabel:r("供应商筛选","Provider filter"),className:"uh-filter-provider",icon:"chart",value:Le||"",options:_n,onChange:e=>dn(e)}),n.createElement(ht,{label:r("全部模型","All models"),ariaLabel:r("模型筛选","Model filter"),className:"uh-filter-model",icon:"cache",value:Ke||"",options:$n,onChange:e=>pn(e)}),null!==je||null!==Le||null!==Ke?n.createElement("button",{type:"button",className:"uh-filter-clear",onClick:un},r("清除筛选","Clear filters")):null,$e?n.createElement("span",{className:"uh-query-note"},r("正在更新筛选结果…","Updating filtered data…")):null,""!==Qe&&"stale"!==Qe?n.createElement("span",{className:"uh-query-note",role:"alert"},r("筛选结果加载失败","Filtered data unavailable")):null),Lt?qr:null,ni,pi,bi?n.createElement("div",{className:"uh-progress"},n.createElement("span",{},"en"===a?"Scanning historical sessions: "+cr.scanned+" / "+cr.total+(cr.failed>0?" ("+cr.failed+" failed to read)":""):"正在统计历史会话 "+cr.scanned+" / "+cr.total+(cr.failed>0?"("+cr.failed+" 个读取失败)":"")),n.createElement("div",{className:"uh-bar"},n.createElement("div",{className:"uh-fill",style:{width:fi+"%"}}))):null,n.createElement("div",{className:"uh-sync-health"+(""!==Ei?" uh-stale":""),title:""!==Ei?void 0:wi},n.createElement(C,{name:""!==Ei?"refresh":"clock",size:14}),n.createElement("span",{},""!==Ei?Ei:ki),""!==Ei?n.createElement("button",{className:"uh-sync-retry",onClick:sn},r("重试","Retry")):null),yi?n.createElement("div",{className:"uh-panel"},n.createElement("div",{className:"uh-empty"},r("还没有使用记录。开始对话后,这里会点亮。","No usage recorded yet. This area will light up after you start a conversation."))):n.createElement(n.Fragment,null,n.createElement(n.Fragment,null,n.createElement("div",{className:"uh-ios-summary"},n.createElement("div",{className:"uh-ios-summary-hero"},n.createElement("div",{className:"uh-ios-summary-total"},n.createElement("div",{className:"uh-ios-summary-total-icon"},n.createElement(C,{name:"chart",size:24})),n.createElement("div",{className:"uh-ios-summary-total-copy"},n.createElement("div",{className:"uh-ios-summary-label"},r("总处理 Token","Total Tokens Processed")),n.createElement("div",{className:"uh-ios-summary-value"},L(w(An),Cr,a)),n.createElement("div",{className:"uh-ios-summary-caption"},"en"===a?ci+" · "+w(In)+(zn?" calls":" uses")+" · includes cache reads/writes and reasoning":ci+" · "+w(In)+(zn?" 次调用":" 次使用")+" · 含缓存读写与推理"))),n.createElement("div",{className:"uh-ios-summary-meta"},n.createElement("div",{className:"uh-ios-summary-meta-stat"},n.createElement("div",{className:"uh-ios-summary-meta-label"},n.createElement(C,{name:"chart",size:16}),r("总请求数","Total Requests")),n.createElement("div",{className:"uh-ios-summary-meta-value"},k(jn,a))),n.createElement("div",{className:"uh-ios-summary-meta-stat uh-ios-summary-meta-cost"},n.createElement("div",{className:"uh-ios-summary-meta-label"},n.createElement(C,{name:"wallet",size:16}),r("估算成本","Estimated Cost")),n.createElement("div",{className:"uh-ios-summary-meta-value"},Sr),n.createElement("div",{className:"uh-ios-summary-meta-caption"},Ar)))),n.createElement("div",{className:"uh-ios-metrics"},Rr(r("DeepSeek 账户余额","DeepSeek Account Balance"),zr,Tr,0,"wallet","deepseek"),Rr(zn?r("匹配调用次数","Matching Calls"):r("总使用次数","Total Uses"),w(In),"all"!==O||zn?"en"===a?(zn?"Calls in ":"Turns in ")+ci:ci+(zn?"内的调用数":"内的回合数"):"en"===a?Sn.totals.sessions+" sessions":Sn.totals.sessions+" 个会话",1,"chart"),Rr(r("连续使用","Current Streak"),"en"===a?Zn.streak+" days":Zn.streak+" 天","en"===a?"Longest streak: "+Zn.best+" days":"最长连续 "+Zn.best+" 天",2,"clock"),Fr,Ir)),n.createElement("div",{className:"uh-token-semantics"},n.createElement(C,{name:"cache",size:16}),r("总处理 Token = 输入 + 输出 + 缓存读写 + 推理。缓存命中代表复用上下文,不等于新生成 Token 或实际费用。成本按事件发生时刻与官方价目估算,不等同于供应商账单。","Total tokens processed = input + output + cache reads/writes + reasoning. Cache hits represent reused context; they are not newly generated tokens or actual cost. Costs are estimated at event time from official price lists and do not equal the provider invoice.")),mi,n.createElement(st,{rows:Mn,workspaces:Wn,aliases:On,workspaceId:je,queryUsable:Nn,todayKey:f,utc:l,language:a,span:q,onSpanChange:fn,onWorkspaceSelect:cn,onDateClick:ln}),n.createElement("div",{className:"uh-detail-tabs",role:"tablist","aria-label":r("用量明细视图","Usage detail views")},[["logs",r("请求日志","Request Logs"),"list"],["model",r("模型统计","Model Stats"),"chart"],["workspace",r("工作区统计","Workspace Stats"),"folder"]].map(e=>n.createElement("button",{key:e[0],type:"button",role:"tab","aria-selected":nt===e[0],className:"uh-detail-tab"+(nt===e[0]?" uh-on":""),onClick:()=>it(e[0])},n.createElement(C,{name:e[2],size:14}),e[1]))),gi),"model"===nt?n.createElement("div",{className:"uh-panel uh-ios-list-panel"},n.createElement("div",{className:"uh-hm-head"},n.createElement("h3",{className:"uh-tbl-title uh-title-with-icon",style:{margin:0}},n.createElement(C,{name:"chart",size:16}),"en"===a?"Model Usage Details ("+ci+")":"模型用量明细("+ci+")"),n.createElement("div",{className:"uh-range"},[["route",r("混合查看","Combined View")],["model",r("按模型","By Model")],["provider",r("按供应商","By Provider")]].map(e=>n.createElement("button",{key:e[0],className:Te===e[0]?"uh-on":"",onClick:()=>Ie(e[0])},e[1])))),0===Un.length?n.createElement("div",{className:"uh-empty"},r("尚无带模型路由信息的用量记录","No usage records with model-routing information yet")):n.createElement(n.Fragment,null,Lr,n.createElement("div",{className:"uh-tbl-scroll"},n.createElement("div",{className:"uh-model-hrow uh-hrow"},n.createElement("div",{},Or),n.createElement("div",{className:"uh-num"},r("调用","Calls")),n.createElement("div",{className:"uh-num"},r("输入","Input")),n.createElement("div",{className:"uh-num"},r("缓存命中","Cache Hits")),n.createElement("div",{className:"uh-num"},r("输出","Output")),n.createElement("div",{className:"uh-num"},r("推理","Reasoning")),n.createElement("div",{className:"uh-num"},r("总处理","Total Processed")),n.createElement("div",{className:"uh-num"},r("成本","Cost")),n.createElement("div",{className:"uh-num"},r("命中率","Hit Rate"))),Kr)),n.createElement("div",{className:"uh-note",style:{marginTop:10}},"en"===a?Wr+": Combined View distinguishes “Provider / Model”; By Model merges identically named models across providers; By Provider aggregates all of a provider’s models. Historical records without routing information are grouped as “Unknown.”":Wr+":混合查看按“供应商 / 模型”区分;按模型会跨供应商合并同名模型;按供应商则汇总其全部模型。缺少路由信息的历史记录会归为“未知”。")):null,"workspace"===nt?n.createElement("div",{className:"uh-panel uh-ios-list-panel"},n.createElement("h3",{className:"uh-tbl-title uh-title-with-icon"},n.createElement(C,{name:"folder",size:16}),"en"===a?"Workspace Details ("+ci+")":"工作区明细("+ci+")"),0===Fn.length?n.createElement("div",{className:"uh-empty"},r("该时间范围内没有使用记录","No usage records in this time range")):n.createElement(n.Fragment,null,Pr,n.createElement("div",{className:"uh-tbl-scroll"},n.createElement("div",{className:"uh-hrow"},n.createElement("div",{},r("工作区","Workspace")),n.createElement("div",{className:"uh-num"},r("回合","Turns")),n.createElement("div",{className:"uh-num"},r("输入","Input")),n.createElement("div",{className:"uh-num"},r("缓存命中","Cache Hits")),n.createElement("div",{className:"uh-num"},r("输出","Output")),n.createElement("div",{className:"uh-num"},r("推理","Reasoning")),n.createElement("div",{className:"uh-num"},r("总处理","Total Processed")),n.createElement("div",{className:"uh-num"},r("成本","Cost")),n.createElement("div",{className:"uh-num"},r("命中率","Hit Rate")),n.createElement("div",{className:"uh-num"},r("占比","Share"))),Ur))):null))}class Tt extends n.Component{constructor(e){super(e),this.state={error:null,resetKey:e.resetKey}}static getDerivedStateFromError(e){return{error:e}}componentDidUpdate(e){e.resetKey!==this.props.resetKey&&null!==this.state.error&&this.setState({error:null,resetKey:this.props.resetKey})}render(){return null!==this.state.error?this.props.fallback(this.state.error):this.props.children}}function Rt(e){const[t,a]=n.useState(!1),[i,l]=n.useState(0),[o,u]=n.useState(Ct),d=(e,t)=>"en"===o?t:e,p=s();n.useEffect(()=>{if(!t)return;c();const e=e=>{"Escape"===e.key&&a(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t]);const m=null!=r&&"function"==typeof r.createPortal&&"undefined"!=typeof document&&null!==document&&null!==document.body&&void 0!==document.body?document.body:null,h=t?n.createElement("div",{className:"uh-side-modal",role:"presentation",style:p>0?{"--uh-top-inset":p+"px"}:void 0,onMouseDown:e=>{e.target===e.currentTarget&&a(!1)}},n.createElement("div",{className:"uh-side-dialog",role:"dialog","aria-modal":!0,"aria-label":d("用量统计","Usage Statistics")},n.createElement("div",{className:"uh-side-dialog-head"},n.createElement("button",{className:"uh-refresh uh-close-button",type:"button",title:d("关闭用量统计","Close Usage Statistics"),"aria-label":d("关闭用量统计","Close Usage Statistics"),onClick:()=>a(!1)},n.createElement(C,{name:"close",size:18}))),n.createElement(Tt,{resetKey:i,fallback:()=>n.createElement("div",{className:"uh-boundary-fallback",role:"alert"},n.createElement("div",{className:"uh-boundary-title"},d("用量统计暂时无法显示","Usage statistics is temporarily unavailable")),n.createElement("div",{className:"uh-boundary-note"},d("当前范围加载失败,入口仍然可用。","The selected range failed to render; the sidebar entry is still available.")),n.createElement("div",{className:"uh-actions"},n.createElement("button",{type:"button",className:"uh-refresh",onClick:()=>l(e=>e+1)},n.createElement(C,{name:"refresh",size:14}),d("重试","Retry")),n.createElement("button",{type:"button",className:"uh-refresh",onClick:()=>a(!1)},n.createElement(C,{name:"close",size:14}),d("关闭","Close"))))},n.createElement(zt,{timerCtx:e.timerCtx,language:o,onLanguageChange:e=>{const t="en"===e?"en":"zh";u(t),function(e){try{window.localStorage.setItem(wt,e),window.localStorage.setItem(kt,"1")}catch(e){}}(t)}})))):null;return n.createElement(n.Fragment,null,n.createElement("button",{type:"button",className:"uh-side-entry",title:d("用量统计","Usage Statistics"),"aria-label":d("用量统计","Usage Statistics"),onClick:()=>a(!0)},n.createElement("span",{className:"uh-side-entry-icon"},n.createElement(C,{name:"chart",size:17})),e.wide?n.createElement("span",{className:"uh-side-entry-label"},d("用量统计","Usage Statistics")):null),null===h||null===m?h:r.createPortal(h,m))}return a.inject=["timer","slots"],a.apply=e=>{const t=e.get("slots"),a=e.get("timer");void 0!==t&&void 0!==a&&(Nt=e,t.inject("sidebar.footer.action",()=>t.register({name:"sidebar.footer.action",id:"all-usage",order:10},e=>n.createElement(Rt,{wide:e.wide,timerCtx:a}))))},t}});
|
|
1
|
+
window.__ModuleLoader__.load({id:"dsh-all-usage",factory:e=>{var a={},t=a;Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=e("react");let r=null;try{r=e("react-dom")||null}catch(e){r=null}const i=[["zh","中文"],["en","English"],["ja","日本語"],["es","Español"],["fr","Français"],["de","Deutsch"],["ru","Русский"],["pt","Português"]],o=i.map(e=>e[0]),s=new Map(i),l={ja:{"\nChecked: ":"\n確認日時:","\nClick to open the GitHub repository":"\nクリックで GitHub リポジトリを開く","\nNewest release v":"\n最新リリース v","\nThe host does not provide the version check yet (an older plugin is running): restart DSH":"\nホストはまだバージョンチェックに対応していません(古いプラグインが動作中):DSH を再起動してください","\nThis is the newest release":"\n最新リリースです","\nVersion check failed: ":"\nバージョンチェックに失敗:","\nWhether a newer release exists is not confirmed":"\n新しいリリースの有無は未確認です"," (cached)":"(キャッシュ)"," (deleted)":"(削除済み)"," (reseller route: static pricing until this row is mapped to the official entry)":"(リセラー経由:この行を公式エントリにマッピングするまで固定価格)"," ({count} configured rows have no ledger usage)":" ({count} 件は設定のみで台帳に使用量なし)"," ({count} failed to read)":" ({count} 件読み取り失敗)"," ({count} rows have unknown usage: the host did not label ledger usage)":" ({count} 件は使用量不明:ホストが台帳使用量を示していません)"," ({detail})":" ({detail})"," Click Refresh to try again":" 「更新」をクリックして再試行してください"," and this page v":" とこのページ v"," and ≤ ":" かつ ≤ "," bands":" レート帯"," calls":" 回呼び出し"," days":" 日"," differ: DSH imports the plugin only at startup, so restart DSH for the new version (this panel is showing the older host payload)":" が一致しません:DSH は起動時にのみプラグインを読み込むため、新しいバージョンには DSH の再起動が必要です(このパネルは古いホストのデータで表示されています)"," holiday days":" 日分の休日"," rules":" 件のルール"," tokens":" Token"," uses":" 回使用"," · capped at 500 rows":" · 500 行が上限"," · {count} failed":" · 失敗 {count}"," · {count} ledger restored":" · 台帳復元 {count}","), but the running host does not expose its rules yet; restart DSH to view and edit them.":")が、実行中のホストはまだルールを公開していません。DSH を再起動すると表示・編集できます。","12 months":"12 か月","30 days":"30 日","90 days":"90 日","Above a threshold, all four rates apply to the whole request":"しきい値を超えると、4 つのレートがリクエスト全体に適用されます","Above tokens":"Token 超過",Actions:"操作","Actual model":"実際のモデル","Add band":"レート帯を追加","Add context rate band":"コンテキストレート帯を追加","Add rule":"ルールを追加","Add window":"時間帯を追加",All:"すべて","All Time":"全期間","All available historical daily data can be selected. Dates follow this machine's time zone ({zone}). The heatmap switches between the last 30 days, 90 days and 12 months.":"取得可能な全期間の日次データを選択できます。日付はこのマシンのタイムゾーン({zone})に従います。ヒートマップは過去 30 日 / 90 日 / 12 か月を切り替えられます。","All contexts":"全コンテキスト","All models":"すべてのモデル","All providers":"すべてのプロバイダー","All workspaces":"すべてのワークスペース",Apply:"適用","Available after you enter a DeepSeek API key in Settings → Models":"設定 → モデルで DeepSeek API キーを入力すると表示されます",Band:"レート帯","Bands invalid":"レート帯が無効",Bars:"棒","Billing band":"請求レート帯","Billing band: ":"請求レート帯:","Billing policy":"請求ポリシー","Billing time (UTC)":"請求時刻(UTC)","Billing time source":"請求時刻のソース","Built-in peak":"組み込みピーク","By Model":"モデル別","By Provider":"プロバイダー別","Cache Hit Rate":"キャッシュヒット率","Cache Hits":"キャッシュヒット","Cache hits":"キャッシュヒット","Cache read":"キャッシュ読み込み","Cache read / 1M":"キャッシュ読み込み / 1M","Cache write":"キャッシュ書き込み","Cache write / 1M":"キャッシュ書き込み / 1M","Cache writes":"キャッシュ書き込み","Cache-Hit Tokens":"キャッシュヒット Token","Cache-Write Tokens":"キャッシュ書き込み Token",Calls:"呼び出し","Calls in {range}":"{range}の呼び出し数",Cancel:"キャンセル",Catalog:"カタログ価格","Change interface language":"表示言語を変更","Chart type":"グラフの種類","Checking…":"確認中…","Chinese statutory holidays price as off-peak all day":"中国の法定休日は終日オフピークとして計算","Choose a date from {from} to {to}":"{from} から {to} までの日付を選択してください","Choose valid start and end dates":"有効な開始日と終了日を選択してください","Clear filters":"フィルターを解除","Clear mapping":"マッピングを解除","Click a point to inspect that day":"点をクリックすると当日の内訳を表示",Close:"閉じる","Close Usage Statistics":"使用量統計を閉じる","Close cost settings":"コスト設定を閉じる",Collapse:"折りたたむ","Combined View":"統合表示","Configure model prices and sync":"モデル価格と同期を設定","Context rate bands":"コンテキストレート帯","Context reused {count} tokens":"コンテキスト再利用 {count} Token","Context threshold tokens":"コンテキストしきい値 Token","Context tiers":"コンテキスト段階","Context tiers: ":"コンテキスト段階:","Context tiers: none, base rates apply to every context":"コンテキスト段階:なし、すべてのコンテキストに基本レート","Copy built-in table":"組み込み表をコピー",Cost:"コスト","Cost Settings":"コスト設定","Cost Statistics":"コスト統計","Cost multiplier":"コスト倍率","Cost multiplier; applied to the final total only":"コスト倍率。最終合計にのみ適用されます","Cost settings could not be saved; check the inputs":"コスト設定を保存できませんでした。入力を確認してください","Cost status":"コスト状態","Current Streak":"現在の連続記録",Custom:"カスタム","Custom date range":"カスタム期間","Custom peak":"カスタムピーク","Custom rules":"カスタムルール","DSH Usage Audit Export":"DSH 使用量監査エクスポート","DSH Usage Statistics Export":"DSH 使用量統計エクスポート",Daily:"日次","Daily Token usage trend; select a date to view request logs":"日ごとの Token 使用量推移。日付を選択するとリクエストログを表示します","Data changed; reloading logs…":"データが更新されたため、ログを再読み込み中…",Date:"日付","DeepSeek Account Balance":"DeepSeek アカウント残高",Deleted:"削除済み","Display model":"表示モデル","Effective after a mapping is set":"マッピング設定後に有効","Effective from (UTC, empty = all history)":"有効開始(UTC、空欄 = 全履歴)","Enable 6-hour automatic sync":"6 時間ごとの自動同期を有効にする","Enable time-of-day pricing":"時間帯別料金を有効にする","End date":"終了日","End date must be on or after the start date":"終了日は開始日以降にしてください","End time":"終了時刻","Estimated Cost":"推定コスト","Every ":"間隔 ","Every {count} weeks":"{count} 週ごと","Export CSV data for the current time range and model view":"現在の期間とモデル表示の CSV データをエクスポート","Export Data":"データをエクスポート","Export current logs":"現在のログをエクスポート","Export logs":"ログをエクスポート","Exported At":"エクスポート日時","Exporting…":"エクスポート中…","Fetch failed: ":"取得に失敗:","Fetch failed: network unavailable":"取得に失敗:ネットワークを利用できません","Fetching…":"取得中…","Filtered data unavailable":"絞り込みデータを取得できません","Fresh: input + cache read/write":"Fresh:入力 + キャッシュ読み書き","Full pricing settings could not be loaded":"料金設定の全体を読み込めませんでした","Granted ":"付与 ","Grouped by Model":"モデル別に集約","Grouped by Provider":"プロバイダー別に集約","Heatmap span":"ヒートマップの期間","Historical scan completed {time}":"履歴スキャン完了:{time}","Hit Rate":"ヒット率","Holiday off-peak":"休日オフピーク","Host plugin v":"ホストプラグイン v","Hourly Token usage trend; select an hour to view request logs":"1 時間ごとの Token 使用量推移。時刻を選択するとリクエストログを表示します",Input:"入力","Input / 1M":"入力 / 1M","Input Tokens":"入力 Token","Input semantics":"入力の扱い","Interface language":"表示言語","Invalid dates: use YYYY-MM-DD, or a start..end range":"日付が無効です:YYYY-MM-DD または start..end の範囲で入力してください","Invalid mapping: pick an official model and enter a valid multiplier":"マッピングが無効です:公式モデルを選択し、有効な倍率を入力してください","Invalid price: enter all non-negative base rates":"価格が無効です:非負の基本レートをすべて入力してください","Invalid rate bands: maximum 32; thresholds must be increasing positive integers and all four rates must be complete and non-negative":"レート帯が無効です:最大 32 件、しきい値は増加する正の整数で、4 つのレートすべてを非負で入力してください","Invalid time-of-day rules: a policy ID, at least one weekday and window per rule, HH:MM times with the end after the start, no overlapping windows on the same weekday, and all four rates filled in":"時間帯別料金が無効です:ポリシー ID、各ルールに 1 つ以上の曜日と時間帯、開始より後の終了時刻(HH:MM)、同じ曜日で重複しない時間帯、4 つのレートすべての入力が必要です","Invalid year (2000-2100)":"年が無効です(2000–2100)","Last 12 months":"過去 12 か月","Last 30 Days":"過去 30 日","Last 30 days (larger cells)":"過去 30 日(セル拡大)","Last 7 Days":"過去 7 日","Last 90 Days":"過去 90 日","Last 90 days":"過去 90 日","Last success: ":"最終成功:","Last sync failed: ":"前回の同期に失敗:","Latest v":"最新 v","Ledger recovery":"台帳復元","Ledger reuse":"台帳再利用","Legacy: input + cache write":"Legacy:入力 + キャッシュ書き込み",Less:"少",Line:"折れ線",Live:"ライブ","Load from public calendar":"公開カレンダーから読み込む","Load more":"さらに読み込む","Loaded ":"読み込み済み ","Loading full pricing settings…":"料金設定の全体を読み込み中…","Loading trend":"推移を読み込み中","Loading usage statistics…":"使用量統計を読み込み中…","Loading…":"読み込み中…",Local:"ローカル","Long range summarised: one point per period":"期間が長いため集約:1 点が 1 期間","Longest streak: {count} days":"最長連続 {count} 日","Lookup failed":"照会に失敗","Manage workspace aliases":"ワークスペースの別名を管理",Manual:"手動価格",Mapped:"マッピング済み","Matching Calls":"一致した呼び出し数","Maximum 32 bands per model":"モデルごとに最大 32 件のレート帯","Methodology: one cell lights up for each completed turn, including subagent sessions. Hover to view workspace details; click a workspace to filter the heatmap and detail tables. Dates and day boundaries follow this machine's time zone.":"集計方法:完了したターンごとに 1 マス点灯(サブエージェントのセッションを含む)。ホバーでワークスペース別の内訳、ワークスペースをクリックするとヒートマップと明細表を絞り込めます。日付と日付の区切りはこのマシンのタイムゾーンに従います。",Model:"モデル","Model Filter":"モデルフィルター","Model Stats":"モデル統計","Model Usage":"モデル別使用量","Model Usage Details":"モデル別使用量の明細","Model Usage Details ({range})":"モデル別使用量の明細({range})","Model View Mode":"モデル表示モード","Model filter":"モデルフィルター",Monthly:"月次",More:"多",Multiplier:"倍率","No auditable Token calls in this scope":"この範囲に監査可能な Token 呼び出しはありません","No bands configured; base rates apply to every context.":"レート帯が未設定です。すべてのコンテキストに基本レートが適用されます。","No data":"データなし","No data yet":"データはまだありません","No ledger usage":"台帳に使用量なし","No model usage yet":"モデル使用量はまだありません","No pricing":"価格なし","No time-of-day rules":"時間帯ルールなし","No time-of-day rules: every request uses the row base rates.":"時間帯ルールなし:すべてのリクエストにこの行の基本レートが適用されます。","No trend data in this range":"この範囲に推移データはありません","No usage recorded yet. This area will light up after you start a conversation.":"まだ使用記録がありません。会話を始めるとここが点灯します。","No usage records for this day":"この日の使用記録はありません","No usage records in this time range":"この期間の使用記録はありません","No usage records with model-routing information yet":"モデルルーティング情報を含む使用記録はまだありません","No workspaces yet":"ワークスペースはまだありません","Not a ledger route":"台帳ルートではありません","Not configured":"未設定","Not synced yet":"未同期",OFF:"オフ","Off-peak":"オフピーク","Off-peak (no rule match) uses the row base rates, peak uses the rule rates. Weekdays and times are UTC.":"オフピーク(ルール未一致)はこの行の基本レート、ピークはルールのレートを使用します。曜日と時刻は UTC です。","Official model / mapping":"公式モデル / マッピング","Official model ID":"公式モデル ID","Official model matches":"公式モデルの候補","One date per line (YYYY-MM-DD); ranges such as 2026-10-01..2026-10-07 are expanded. Days follow the China Standard Time (UTC+8) calendar; swapped-in working weekends are not detected, so remove them yourself.":"1 行に 1 日付(YYYY-MM-DD)。2026-10-01..2026-10-07 のような範囲も展開されます。日付は中国標準時(UTC+8)の暦で判定します。振替出勤日は自動検出されないため、手動で削除してください。",Other:"その他",Output:"出力","Output / 1M":"出力 / 1M","Output Tokens":"出力 Token",Path:"パス",Peak:"ピーク","Peak invalid":"ピークが無効","Peak plan ":"ピークプラン ","Peak plan invalid":"ピークプランが無効","Peak ·":"ピーク ·","Plan: ":"プラン:","Policy ID":"ポリシー ID","Policy hash":"ポリシーハッシュ","Press Enter to save one; clear an alias to restore the folder name":"Enter で保存、別名を空にするとフォルダー名に戻ります","Price per 1M tokens in USD":"価格の単位は USD / 1M Token","Prices are USD per 1M tokens. Editing a price box creates or updates a manual price (every row priced from the same official model shares it). Picking an official model in the mapping column switches the row to the catalog price. Bands add context-dependent rates; Time-of-day adds UTC peak rules.":"価格は USD / 1M Token です。価格欄を編集すると手動価格が作成または更新されます(同じ公式モデルを使う行はすべて同じ価格を共有)。マッピング列で公式モデルを選ぶと、その行はカタログ価格に切り替わります。レート帯はコンテキスト依存のレートを、時間帯別料金は UTC のピークルールを追加します。","Pricing model":"料金モデル","Pricing model: ":"料金モデル:","Project alias":"プロジェクト別名",Provider:"プロバイダー","Provider / Model":"プロバイダー / モデル","Provider Filter":"プロバイダーフィルター","Provider Usage":"プロバイダー別使用量","Provider filter":"プロバイダーフィルター",Reasoning:"推論","Reasoning Tokens":"推論 Token","Refresh usage statistics":"統計を更新","Refreshing data":"データを更新中","Refreshing…":"更新中…","Remove rate band":"レート帯を削除","Remove rule":"ルールを削除","Remove rules":"ルールを削除","Remove the manual price and fall back to the catalog or the built-in peak table":"手動価格を削除し、カタログ価格または組み込みピーク表に戻します","Remove this row mapping and fall back to automatic model matching":"この行のマッピングを削除し、モデルによる自動マッチングに戻します","Remove window":"時間帯を削除","Replace with custom rules":"カスタムルールに置き換え","Request Logs":"リクエストログ","Requested model":"リクエストモデル",Reset:"リセット","Restore built-in":"組み込みに戻す",Retry:"再試行","Running version v":"実行中のバージョン v",Save:"保存","Save All":"すべて保存","Save and backfill":"保存して過去分に適用","Saving affects unpriced and future calls only; existing positive costs are never recalculated. Changing a peak plan reconciles that model history against the new rules.":"保存は未計価の呼び出しと今後の呼び出しにのみ影響します。既存の正のコストは再計算されません。ピークプランを変更すると、そのモデルの履歴が新しいルールで再照合されます。","Saving…":"保存中…",Scan:"スキャン","Scanning historical sessions: {scanned} / {total}{failed}":"履歴セッションをスキャン中:{scanned} / {total}{failed}",Scope:"範囲","See the details table for the other {count} workspaces":"ほか {count} ワークスペースは明細表を参照","Selected call":"選択中の呼び出し",Sessions:"セッション",Share:"割合",Source:"ソース","Source: ":"ソース:","Star this plugin on GitHub":"GitHub でこのプラグインにスターを付ける","Start date":"開始日","Start time":"開始時刻","Stats Revision":"統計リビジョン","Statutory holiday dates":"法定休日の日付",Summary:"概要","Sync now":"今すぐ同期","Syncing…":"同期中…","The DeepSeek API reported that balance information is unavailable":"DeepSeek API が残高情報を利用できないと応答しました","The cost settings are too large to save: trim bands or peak rules":"コスト設定が大きすぎて保存できません:レート帯またはピークルールを減らしてください","The host did not label ledger usage for this row (usually an older host plugin); it does not mean the row has none":"ホストがこの行の台帳使用量を示していません(多くの場合ホストプラグインが古いため)。使用量がないという意味ではありません","The host sent no model list (older plugin): the ledger models cannot be listed; restart DSH and reopen this panel":"ホストがモデル一覧を送信していません(プラグインが古いため):台帳のモデルを一覧表示できません。DSH を再起動してこのパネルを開き直してください","The process capability is unavailable; refresh the dashboard":"プロセスのケーパビリティを利用できません。ダッシュボードを更新してください","The rules are incomplete; fix them before saving.":"ルールが未完成です。保存前に修正してください。","The selected range failed to render; the sidebar entry is still available.":"選択した範囲を表示できませんでした。サイドバーの項目は引き続き利用できます。","This band covers ":"このレート帯の対象:","This row already uses a peak plan (":"この行はすでにピークプランを使用しています(",Time:"時刻","Time Range":"期間","Time tiers":"時間段階","Time tiers: ":"時間段階:","Time-of-day pricing (UTC)":"時間帯別料金(UTC)",Timezone:"タイムゾーン",Today:"今日","Token Usage Trend":"Token 使用量推移","Token calls are newest first; select a row to inspect its turn / step and token buckets.":"Token 呼び出しは新しい順。行を選択するとターン / ステップと Token バケットを確認できます。","Token threshold":"Token しきい値","Tokens: Input {input} · Cache hits {cache} · Output {output}":"Token:入力 {input} · キャッシュヒット {cache} · 出力 {output}","Top-up ":"トップアップ ",Total:"合計","Total Processed":"総処理","Total Requests":"総リクエスト数","Total Tokens Processed":"総処理 Token","Total Tokens Processed by Workspace":"ワークスペース別の総処理 Token","Total Uses":"総使用回数","Total tokens processed = input + output + cache reads/writes + reasoning. Cache hits represent reused context; they are not newly generated tokens or actual cost. Costs are estimated at event time from official price lists and do not equal the provider invoice.":"総処理 Token = 入力 + 出力 + キャッシュ読み込み / 書き込み + 推論。キャッシュヒットはコンテキストの再利用であり、新たに生成された Token や実費ではありません。コストはイベント発生時点の公式価格表で推定したもので、プロバイダーの請求額とは一致しません。","Total: input already includes cache":"Total:入力はキャッシュ込み","Trend data unavailable":"推移データを取得できません",Turns:"ターン","Turns in {range}":"{range}のターン数","Type an official model ID":"公式モデル ID を入力して検索","Unable to export logs":"ログをエクスポートできません","Unable to load logs":"ログを読み込めません","Unable to load usage statistics. Please retry.":"使用量統計を読み込めません。再試行してください。",Unavailable:"利用不可","Unified filters":"共通フィルター",Unknown:"不明","Unknown model":"不明なモデル","Unknown provider":"不明なプロバイダー","Unknown workspace":"不明なワークスペース","Up to date":"最新","Update state pending":"更新待機中","Updated {time}":"更新済み {time}","Updating filtered data…":"絞り込みデータを更新中…","Usage Heatmap":"使用量ヒートマップ","Usage Statistics":"使用量統計","Usage before this instant has no applicable band and fails closed as unpriced.":"この時刻より前の使用量には適用できるレート帯がなく、未計価として扱われます。","Usage data may be stale":"使用量データが古い可能性があります","Usage data may be stale; last full update {time}":"使用量データが古い可能性があります。最終完全更新:{time}","Usage detail views":"使用量明細ビュー","Usage heatmap calendar: arrow keys to browse, Enter for the day detail":"使用量ヒートマップのカレンダー:矢印キーで移動、Enter で当日の内訳","Usage statistics is temporarily unavailable":"使用量統計を一時的に表示できません","Usage unknown":"使用量不明","Using the built-in DeepSeek peak table":"DeepSeek の組み込みピーク表を使用中",Weekly:"週次",Workspace:"ワークスペース","Workspace Aliases":"ワークスペースの別名","Workspace Details":"ワークスペース別明細","Workspace Details ({range})":"ワークスペース別明細({range})","Workspace Filter":"ワークスペースフィルター","Workspace Stats":"ワークスペース統計","Workspace Usage":"ワークスペース別使用量","Workspace filter":"ワークスペースフィルター","Write rejected: the permission check failed (a stale process capability is also possible); refresh the dashboard and retry":"書き込みが拒否されました:権限チェックに失敗しました(プロセスのケーパビリティが古い可能性もあります)。ダッシュボードを更新して再試行してください","Write rejected: the process capability had rotated and the automatic retry still failed; refresh the dashboard":"書き込みが拒否されました:プロセスのケーパビリティが更新され、自動再試行も失敗しました。ダッシュボードを更新してください",Year:"年","Year to load":"読み込む年",Yearly:"年次",ambiguous:"要確認","at ":"請求時刻 ","built-in DeepSeek peak table":"DeepSeek 組み込みピーク表","custom ":"カスタム ","custom rules":"カスタムルール","full-read fallback":"全読み取りフォールバック","models.dev sync failed; the last good catalog and unsaved edits were kept":"models.dev の同期に失敗しました。前回成功したカタログと未保存の編集は保持されています","no usage":"使用記録なし","not enabled":"未有効","parsed ":"解析済み ",peak:"ピーク","peak plan ":"ピークプラン ",priced:"計価済み","revision optimization on":"revision 最適化有効","static (no band plan)":"固定価格(ピークプランなし)","static (non-first-party)":"固定価格(非公式経由)","tiered ":"段階 ",tokens:"Token",unpriced:"未計価",unsupported:"非対応","{count} days":"{count} 日","{count} models":"{count} モデル","{count} priced":"{count} 件計価済み","{count} records shown":"{count} 件を表示中","{count} sessions":"{count} セッション","{count} shown; load more for additional records":"{count} 件を表示中。さらに読み込むと続きを表示します","{count} unpriced":"{count} 件未計価","{count} uses":"{count} 回使用","{date}: {amount}":"{date}:{amount}","{label}: Combined View distinguishes “Provider / Model”; By Model merges identically named models across providers; By Provider aggregates all of a provider’s models. Historical records without routing information are grouped as “Unknown.”":"{label}:統合表示は「プロバイダー / モデル」で区別します。モデル別はプロバイダーをまたいで同名モデルを統合し、プロバイダー別はそのプロバイダーの全モデルを集約します。ルーティング情報のない履歴は「不明」にまとめられます。","{range} · {count}{kind} · includes cache reads/writes and reasoning":"{range} · {count}{kind} · キャッシュ読み書きと推論を含む","{start} to {end} (UTC)":"{start}〜{end}(UTC)","{state} · {reused} revision reused · {read} read{ledger}{failed} · {optimization}":"{state} · revision 再利用 {reused} · 読み取り {read}{ledger}{failed} · {optimization}","No records are old enough to archive":"アーカイブできるほど古い記録はありません","Archive {count} records ({size}) across {months} months: {list}":"{count} 件の記録({size})を {months} か月分まとめてアーカイブします:{list}",", ":"、","Archived {count} records: {compressed} on disk (was {size})":"{count} 件の記録をアーカイブしました:ディスク上は {compressed}(元は {size})","Some months could not be archived: {list}":"一部の月をアーカイブできませんでした:{list}","Another DSH process is maintaining the ledger; try again in a moment":"別の DSH プロセスが台帳をメンテナンス中です。しばらくしてから再試行してください","This storage does not support archiving":"このストレージはアーカイブに対応していません","The ledger is not ready yet; try again in a moment":"台帳の準備ができていません。しばらくしてから再試行してください","Enter a number of days between 1 and 3650":"1〜3650 の範囲で日数を入力してください","Archiving failed; try again.":"アーカイブに失敗しました。再試行してください",Maintenance:"データメンテナンス","Close maintenance":"データメンテナンスを閉じる","Sessions that have not changed for a while are folded into monthly compressed files. Totals, detail and filters stay the same, and archived records remain readable.":"しばらく更新のないセッションは、月ごとの圧縮ファイルにまとめられます。パネルの合計・明細・フィルターは変わらず、アーカイブした記録も引き続き閲覧できます。","Archive records older than":"これより古い記録をアーカイブ",Days:"日","days without updates":"日間更新のない記録","Planning…":"プレビューを作成中…",Preview:"プレビュー","Start archiving":"アーカイブを開始","Archive {count} records? They stay readable in the panel, but this cannot be undone.":"{count} 件の記録をアーカイブしますか?パネルでは引き続き閲覧できますが、この操作は元に戻せません。","Yes, archive":"はい、アーカイブする","Archive old records":"古い記録をアーカイブ","Note: archived records stay readable and countable, but the first read of a month unpacks the whole month file, so the first start is slower; afterwards it stays in memory.":"注意:アーカイブした記録は引き続き閲覧・集計できますが、ある月を最初に読むときに月ファイル全体が解凍されるため、初回の起動が遅くなります。その後はメモリに残ります。","This Month":"今月"},es:{"\nChecked: ":"\nComprobado: ","\nClick to open the GitHub repository":"\nHaz clic para abrir el repositorio de GitHub","\nNewest release v":"\nVersión más reciente v","\nThe host does not provide the version check yet (an older plugin is running): restart DSH":"\nEl host aún no ofrece la comprobación de versión (hay un plugin más antiguo en ejecución): reinicia DSH","\nThis is the newest release":"\nEsta es la versión más reciente","\nVersion check failed: ":"\nError al comprobar la versión: ","\nWhether a newer release exists is not confirmed":"\nNo se ha confirmado si existe una versión más reciente"," (cached)":" (en caché)"," (deleted)":" (eliminado)"," (reseller route: static pricing until this row is mapped to the official entry)":" (ruta de revendedor: precio estático hasta que esta fila se asigne a la entrada oficial)"," ({count} configured rows have no ledger usage)":" ({count} filas configuradas sin uso en el registro)"," ({count} failed to read)":" ({count} con error de lectura)"," ({count} rows have unknown usage: the host did not label ledger usage)":" ({count} filas con uso desconocido: el host no indicó el uso del registro)"," ({detail})":" ({detail})"," Click Refresh to try again":" Pulsa Actualizar para reintentar"," and this page v":" y esta página v"," and ≤ ":" y ≤ "," bands":" tramos"," calls":" llamadas"," days":" días"," differ: DSH imports the plugin only at startup, so restart DSH for the new version (this panel is showing the older host payload)":" no coinciden: DSH solo importa el plugin al iniciar, así que reinicia DSH para la nueva versión (este panel muestra los datos del host antiguo)"," holiday days":" días festivos"," rules":" reglas personalizadas"," tokens":" tokens"," uses":" usos"," · capped at 500 rows":" · limitado a 500 filas"," · {count} failed":" · {count} fallidas"," · {count} ledger restored":" · {count} restauradas del registro","), but the running host does not expose its rules yet; restart DSH to view and edit them.":"), pero el host en ejecución aún no expone sus reglas; reinicia DSH para verlas y editarlas.","12 months":"12 meses","30 days":"30 días","90 days":"90 días","Above a threshold, all four rates apply to the whole request":"Por encima de un umbral, las cuatro tarifas se aplican a toda la solicitud","Above tokens":"Tokens superiores a",Actions:"Acciones","Actual model":"Modelo real","Add band":"Añadir tramo","Add context rate band":"Añadir tramo de tarifa por contexto","Add rule":"Añadir regla","Add window":"Añadir franja",All:"Todos","All Time":"Todo el tiempo","All available historical daily data can be selected. Dates follow this machine's time zone ({zone}). The heatmap switches between the last 30 days, 90 days and 12 months.":"Se pueden seleccionar todos los datos diarios históricos disponibles. Las fechas siguen la zona horaria de este equipo ({zone}). El mapa de calor alterna entre los últimos 30 días, 90 días y 12 meses.","All contexts":"Todos los contextos","All models":"Todos los modelos","All providers":"Todos los proveedores","All workspaces":"Todos los espacios de trabajo",Apply:"Aplicar","Available after you enter a DeepSeek API key in Settings → Models":"Disponible al introducir una clave de API de DeepSeek en Ajustes → Modelos",Band:"Tramo","Bands invalid":"Tramos no válidos",Bars:"Barras","Billing band":"Tramo de facturación","Billing band: ":"Tramo de facturación: ","Billing policy":"Política de facturación","Billing time (UTC)":"Hora de facturación (UTC)","Billing time source":"Origen de la hora de facturación","Built-in peak":"Pico integrado","By Model":"Por modelo","By Provider":"Por proveedor","Cache Hit Rate":"Tasa de acierto de caché","Cache Hits":"Aciertos de caché","Cache hits":"Aciertos de caché","Cache read":"Lectura de caché","Cache read / 1M":"Lectura de caché / 1M","Cache write":"Escritura de caché","Cache write / 1M":"Escritura de caché / 1M","Cache writes":"Escrituras de caché","Cache-Hit Tokens":"Tokens de acierto de caché","Cache-Write Tokens":"Tokens de escritura de caché",Calls:"Llamadas","Calls in {range}":"Llamadas: {range}",Cancel:"Cancelar",Catalog:"Catálogo","Change interface language":"Cambiar el idioma de la interfaz","Chart type":"Tipo de gráfico","Checking…":"Comprobando…","Chinese statutory holidays price as off-peak all day":"Los festivos oficiales chinos se tarifan como fuera de pico todo el día","Choose a date from {from} to {to}":"Elige una fecha entre {from} y {to}","Choose valid start and end dates":"Elige fechas de inicio y fin válidas","Clear filters":"Borrar filtros","Clear mapping":"Borrar asignación","Click a point to inspect that day":"Haz clic en un punto para ver ese día",Close:"Cerrar","Close Usage Statistics":"Cerrar las estadísticas de uso","Close cost settings":"Cerrar los ajustes de coste",Collapse:"Contraer","Combined View":"Vista combinada","Configure model prices and sync":"Configurar precios de modelos y sincronización","Context rate bands":"Tramos de tarifa por contexto","Context reused {count} tokens":"Contexto reutilizado: {count} tokens","Context threshold tokens":"Umbral de contexto en Token","Context tiers":"Niveles de contexto","Context tiers: ":"Niveles de contexto: ","Context tiers: none, base rates apply to every context":"Niveles de contexto: ninguno, las tarifas base se aplican a cualquier contexto","Copy built-in table":"Copiar la tabla integrada",Cost:"Coste","Cost Settings":"Ajustes de coste","Cost Statistics":"Estadísticas de coste","Cost multiplier":"Multiplicador de coste","Cost multiplier; applied to the final total only":"Multiplicador de coste; se aplica solo al total final","Cost settings could not be saved; check the inputs":"No se pudieron guardar los ajustes de coste; revisa los valores","Cost status":"Estado de coste","Current Streak":"Racha actual",Custom:"Personalizado","Custom date range":"Intervalo de fechas personalizado","Custom peak":"Pico personalizado","Custom rules":"Reglas personalizadas","DSH Usage Audit Export":"Exportación de auditoría de uso de DSH","DSH Usage Statistics Export":"Exportación de estadísticas de uso de DSH",Daily:"Diario","Daily Token usage trend; select a date to view request logs":"Tendencia de uso de Token por día; selecciona una fecha para ver los registros de solicitudes","Data changed; reloading logs…":"Los datos han cambiado; recargando los registros…",Date:"Fecha","DeepSeek Account Balance":"Saldo de la cuenta de DeepSeek",Deleted:"Eliminado","Display model":"Modelo mostrado","Effective after a mapping is set":"Se aplica tras definir una asignación","Effective from (UTC, empty = all history)":"Vigente desde (UTC, vacío = todo el historial)","Enable 6-hour automatic sync":"Habilitar la sincronización automática cada 6 horas","Enable time-of-day pricing":"Habilitar los precios por franja horaria","End date":"Fecha de fin","End date must be on or after the start date":"La fecha de fin debe ser igual o posterior a la fecha de inicio","End time":"Hora de fin","Estimated Cost":"Coste estimado","Every ":"Cada ","Every {count} weeks":"Cada {count} semanas","Export CSV data for the current time range and model view":"Exportar los datos CSV del intervalo actual y de la vista de modelos actual","Export Data":"Exportar datos","Export current logs":"Exportar los registros actuales","Export logs":"Exportar registros","Exported At":"Fecha de exportación","Exporting…":"Exportando…","Fetch failed: ":"Error al obtener: ","Fetch failed: network unavailable":"Error al obtener: red no disponible","Fetching…":"Obteniendo…","Filtered data unavailable":"Datos filtrados no disponibles","Fresh: input + cache read/write":"Fresh: entrada + lectura/escritura de caché","Full pricing settings could not be loaded":"No se pudieron cargar los ajustes completos de precios","Granted ":"Regalo ","Grouped by Model":"Agrupado por modelo","Grouped by Provider":"Agrupado por proveedor","Heatmap span":"Intervalo del mapa de calor","Historical scan completed {time}":"Escaneo histórico completado: {time}","Hit Rate":"Tasa de acierto","Holiday off-peak":"Festivo fuera de pico","Host plugin v":"Plugin de host v","Hourly Token usage trend; select an hour to view request logs":"Tendencia de uso de Token por hora; selecciona una hora para ver los registros de solicitudes",Input:"Entrada","Input / 1M":"Entrada / 1M","Input Tokens":"Tokens de entrada","Input semantics":"Semántica de entrada","Interface language":"Idioma de la interfaz","Invalid dates: use YYYY-MM-DD, or a start..end range":"Fechas no válidas: usa YYYY-MM-DD o un intervalo inicio..fin","Invalid mapping: pick an official model and enter a valid multiplier":"Asignación no válida: elige un modelo oficial e introduce un multiplicador válido","Invalid price: enter all non-negative base rates":"Precio no válido: introduce todas las tarifas base no negativas","Invalid rate bands: maximum 32; thresholds must be increasing positive integers and all four rates must be complete and non-negative":"Tramos de tarifa no válidos: máximo 32; los umbrales deben ser enteros positivos crecientes y las cuatro tarifas deben estar completas y no ser negativas","Invalid time-of-day rules: a policy ID, at least one weekday and window per rule, HH:MM times with the end after the start, no overlapping windows on the same weekday, and all four rates filled in":"Reglas por franja horaria no válidas: se requiere un ID de política, al menos un día de la semana y una franja por regla, horas HH:MM con el fin después del inicio, sin franjas solapadas el mismo día y las cuatro tarifas completas","Invalid year (2000-2100)":"Año no válido (2000-2100)","Last 12 months":"Últimos 12 meses","Last 30 Days":"Últimos 30 días","Last 30 days (larger cells)":"Últimos 30 días (celdas más grandes)","Last 7 Days":"Últimos 7 días","Last 90 Days":"Últimos 90 días","Last 90 days":"Últimos 90 días","Last success: ":"Último éxito: ","Last sync failed: ":"Última sincronización fallida: ","Latest v":"Última versión v","Ledger recovery":"Recuperación del registro","Ledger reuse":"Reutilización del registro","Legacy: input + cache write":"Legacy: entrada + escritura de caché",Less:"Menos",Line:"Línea",Live:"En vivo","Load from public calendar":"Cargar desde el calendario público","Load more":"Cargar más","Loaded ":"Cargados: ","Loading full pricing settings…":"Cargando los ajustes completos de precios…","Loading trend":"Cargando tendencia","Loading usage statistics…":"Cargando estadísticas de uso…","Loading…":"Cargando…",Local:"Local","Long range summarised: one point per period":"Intervalo largo resumido: un punto por periodo","Longest streak: {count} days":"Racha más larga: {count} días","Lookup failed":"Error en la consulta","Manage workspace aliases":"Gestionar alias de espacios de trabajo",Manual:"Manual",Mapped:"Asignado","Matching Calls":"Llamadas coincidentes","Maximum 32 bands per model":"Máximo 32 tramos por modelo","Methodology: one cell lights up for each completed turn, including subagent sessions. Hover to view workspace details; click a workspace to filter the heatmap and detail tables. Dates and day boundaries follow this machine's time zone.":"Metodología: se ilumina una celda por cada turno completado, incluidas las sesiones de subagentes. Pasa el cursor para ver el detalle por espacio de trabajo; haz clic en un espacio de trabajo para filtrar el mapa de calor y las tablas de detalle. Las fechas y los límites de día siguen la zona horaria de este equipo.",Model:"Modelo","Model Filter":"Filtro de modelo","Model Stats":"Estadísticas de modelos","Model Usage":"Uso por modelo","Model Usage Details":"Detalle de uso por modelo","Model Usage Details ({range})":"Detalle de uso por modelo ({range})","Model View Mode":"Modo de vista de modelos","Model filter":"Filtro de modelo",Monthly:"Mensual",More:"Más",Multiplier:"Multiplicador","No auditable Token calls in this scope":"No hay llamadas de Token auditables en este ámbito","No bands configured; base rates apply to every context.":"No hay tramos configurados; las tarifas base se aplican a cualquier contexto.","No data":"Sin datos","No data yet":"Aún no hay datos","No ledger usage":"Sin uso en el registro","No model usage yet":"Aún no hay uso por modelo","No pricing":"Sin precio","No time-of-day rules":"Sin reglas por franja horaria","No time-of-day rules: every request uses the row base rates.":"Sin reglas por franja horaria: todas las solicitudes usan las tarifas base de la fila.","No trend data in this range":"No hay datos de tendencia en este intervalo","No usage recorded yet. This area will light up after you start a conversation.":"Aún no hay uso registrado. Esta zona se iluminará cuando inicies una conversación.","No usage records for this day":"No hay registros de uso este día","No usage records in this time range":"No hay registros de uso en este intervalo","No usage records with model-routing information yet":"Aún no hay registros de uso con información de enrutamiento de modelos","No workspaces yet":"Aún no hay espacios de trabajo","Not a ledger route":"No es una ruta del registro","Not configured":"Sin configurar","Not synced yet":"Aún sin sincronizar",OFF:"Valle","Off-peak":"Fuera de pico","Off-peak (no rule match) uses the row base rates, peak uses the rule rates. Weekdays and times are UTC.":"Fuera de pico (sin regla aplicable) se usan las tarifas base de la fila; en pico, las tarifas de la regla. Los días y las horas son UTC.","Official model / mapping":"Modelo oficial / asignación","Official model ID":"ID de modelo oficial","Official model matches":"Coincidencias de modelo oficial","One date per line (YYYY-MM-DD); ranges such as 2026-10-01..2026-10-07 are expanded. Days follow the China Standard Time (UTC+8) calendar; swapped-in working weekends are not detected, so remove them yourself.":"Una fecha por línea (YYYY-MM-DD); los intervalos como 2026-10-01..2026-10-07 se expanden. Los días siguen el calendario de China Standard Time (UTC+8); los fines de semana laborables de compensación no se detectan, así que elimínalos tú.",Other:"Otros",Output:"Salida","Output / 1M":"Salida / 1M","Output Tokens":"Tokens de salida",Path:"Ruta",Peak:"Pico","Peak invalid":"Pico no válido","Peak plan ":"Plan de pico y valle ","Peak plan invalid":"Plan de pico y valle no válido","Peak ·":"Pico ·","Plan: ":"Plan de tarifa: ","Policy ID":"ID de política","Policy hash":"Hash de política","Press Enter to save one; clear an alias to restore the folder name":"Pulsa Intro para guardar; borra un alias para restaurar el nombre de la carpeta","Price per 1M tokens in USD":"Precio por 1M de tokens en USD","Prices are USD per 1M tokens. Editing a price box creates or updates a manual price (every row priced from the same official model shares it). Picking an official model in the mapping column switches the row to the catalog price. Bands add context-dependent rates; Time-of-day adds UTC peak rules.":"Los precios son USD por 1M de tokens. Editar un campo de precio crea o actualiza un precio manual (lo comparten todas las filas con el mismo modelo oficial). Elegir un modelo oficial en la columna de asignación pasa la fila al precio del catálogo. Los tramos añaden tarifas según el contexto; las franjas horarias añaden reglas de pico en UTC.","Pricing model":"Modelo de precios","Pricing model: ":"Modelo de precios: ","Project alias":"Alias del proyecto",Provider:"Proveedor","Provider / Model":"Proveedor / Modelo","Provider Filter":"Filtro de proveedor","Provider Usage":"Uso por proveedor","Provider filter":"Filtro de proveedor",Reasoning:"Razonamiento","Reasoning Tokens":"Tokens de razonamiento","Refresh usage statistics":"Actualizar estadísticas de uso","Refreshing data":"Actualizando datos","Refreshing…":"Actualizando…","Remove rate band":"Eliminar tramo de tarifa","Remove rule":"Eliminar regla","Remove rules":"Quitar reglas","Remove the manual price and fall back to the catalog or the built-in peak table":"Quitar el precio manual y volver al catálogo o a la tabla de picos integrada","Remove this row mapping and fall back to automatic model matching":"Quitar la asignación de esta fila y volver a la coincidencia automática de modelos","Remove window":"Eliminar franja","Replace with custom rules":"Sustituir por reglas personalizadas","Request Logs":"Registros de solicitudes","Requested model":"Modelo solicitado",Reset:"Restablecer","Restore built-in":"Restaurar la tabla integrada",Retry:"Reintentar","Running version v":"Versión en ejecución v",Save:"Guardar","Save All":"Guardar todo","Save and backfill":"Guardar y rellenar","Saving affects unpriced and future calls only; existing positive costs are never recalculated. Changing a peak plan reconciles that model history against the new rules.":"Guardar solo afecta a las llamadas sin precio y a las futuras; los costes positivos existentes nunca se recalculan. Cambiar un plan de pico y valle reconcilia el historial de ese modelo con las nuevas reglas.","Saving…":"Guardando…",Scan:"Escaneo","Scanning historical sessions: {scanned} / {total}{failed}":"Escaneando sesiones históricas: {scanned} / {total}{failed}",Scope:"Ámbito","See the details table for the other {count} workspaces":"Consulta la tabla de detalle para los otros {count} espacios de trabajo","Selected call":"Llamada seleccionada",Sessions:"Sesiones",Share:"Cuota",Source:"Origen","Source: ":"Origen: ","Star this plugin on GitHub":"Dale una estrella a este plugin en GitHub","Start date":"Fecha de inicio","Start time":"Hora de inicio","Stats Revision":"Revisión de estadísticas","Statutory holiday dates":"Fechas de festivos oficiales",Summary:"Resumen","Sync now":"Sincronizar ahora","Syncing…":"Sincronizando…","The DeepSeek API reported that balance information is unavailable":"La API de DeepSeek informa de que la información de saldo no está disponible","The cost settings are too large to save: trim bands or peak rules":"Los ajustes de coste son demasiado grandes para guardar: reduce tramos o reglas de pico","The host did not label ledger usage for this row (usually an older host plugin); it does not mean the row has none":"El host no indicó el uso del registro para esta fila (normalmente un plugin de host más antiguo); no significa que la fila no tenga uso","The host sent no model list (older plugin): the ledger models cannot be listed; restart DSH and reopen this panel":"El host no envió una lista de modelos (plugin más antiguo): no se pueden listar los modelos del registro; reinicia DSH y vuelve a abrir este panel","The process capability is unavailable; refresh the dashboard":"La credencial del proceso no está disponible; actualiza el panel","The rules are incomplete; fix them before saving.":"Las reglas están incompletas; corrígelas antes de guardar.","The selected range failed to render; the sidebar entry is still available.":"No se pudo mostrar el intervalo seleccionado; la entrada de la barra lateral sigue disponible.","This band covers ":"Este tramo cubre ","This row already uses a peak plan (":"Esta fila ya usa un plan de pico y valle (",Time:"Hora","Time Range":"Intervalo de tiempo","Time tiers":"Niveles horarios","Time tiers: ":"Niveles horarios: ","Time-of-day pricing (UTC)":"Precios por franja horaria (UTC)",Timezone:"Zona horaria",Today:"Hoy","Token Usage Trend":"Tendencia de uso de Token","Token calls are newest first; select a row to inspect its turn / step and token buckets.":"Las llamadas de Token van de la más reciente a la más antigua; selecciona una fila para ver su turno / paso y el desglose de tokens.","Token threshold":"Umbral de Token","Tokens: Input {input} · Cache hits {cache} · Output {output}":"Tokens: Entrada {input} · Aciertos de caché {cache} · Salida {output}","Top-up ":"Recarga ",Total:"Total procesado","Total Processed":"Total procesado","Total Requests":"Solicitudes totales","Total Tokens Processed":"Tokens totales procesados","Total Tokens Processed by Workspace":"Tokens totales procesados por espacio de trabajo","Total Uses":"Usos totales","Total tokens processed = input + output + cache reads/writes + reasoning. Cache hits represent reused context; they are not newly generated tokens or actual cost. Costs are estimated at event time from official price lists and do not equal the provider invoice.":"Los tokens totales procesados = entrada + salida + lecturas/escrituras de caché + razonamiento. Los aciertos de caché representan contexto reutilizado; no son tokens recién generados ni coste real. Los costes se estiman en el momento del evento con las listas de precios oficiales y no equivalen a la factura del proveedor.","Total: input already includes cache":"Total: la entrada ya incluye la caché","Trend data unavailable":"Datos de tendencia no disponibles",Turns:"Turnos","Turns in {range}":"Turnos: {range}","Type an official model ID":"Escribe un ID de modelo oficial","Unable to export logs":"No se pudieron exportar los registros","Unable to load logs":"No se pudieron cargar los registros","Unable to load usage statistics. Please retry.":"No se pudieron cargar las estadísticas de uso. Inténtalo de nuevo.",Unavailable:"No disponible","Unified filters":"Filtros unificados",Unknown:"Desconocido","Unknown model":"Modelo desconocido","Unknown provider":"Proveedor desconocido","Unknown workspace":"Espacio de trabajo desconocido","Up to date":"Al día","Update state pending":"Actualización pendiente","Updated {time}":"Actualizado: {time}","Updating filtered data…":"Actualizando los datos filtrados…","Usage Heatmap":"Mapa de calor de uso","Usage Statistics":"Estadísticas de uso","Usage before this instant has no applicable band and fails closed as unpriced.":"El uso anterior a este instante no tiene tramo aplicable y se marca como sin precio.","Usage data may be stale":"Los datos de uso pueden estar desactualizados","Usage data may be stale; last full update {time}":"Los datos de uso pueden estar desactualizados; última actualización completa: {time}","Usage detail views":"Vistas de detalle de uso","Usage heatmap calendar: arrow keys to browse, Enter for the day detail":"Calendario del mapa de calor de uso: flechas para navegar, Intro para ver el detalle del día","Usage statistics is temporarily unavailable":"Las estadísticas de uso no están disponibles temporalmente","Usage unknown":"Uso desconocido","Using the built-in DeepSeek peak table":"Se usa la tabla de picos integrada de DeepSeek",Weekly:"Semanal",Workspace:"Espacio de trabajo","Workspace Aliases":"Alias de espacios de trabajo","Workspace Details":"Detalle por espacio de trabajo","Workspace Details ({range})":"Detalle por espacio de trabajo ({range})","Workspace Filter":"Filtro de espacio de trabajo","Workspace Stats":"Estadísticas de espacios de trabajo","Workspace Usage":"Uso por espacio de trabajo","Workspace filter":"Filtro de espacio de trabajo","Write rejected: the permission check failed (a stale process capability is also possible); refresh the dashboard and retry":"Escritura rechazada: la comprobación de permisos falló (también puede ser que la credencial del proceso ya no sea válida); actualiza el panel y vuelve a intentarlo","Write rejected: the process capability had rotated and the automatic retry still failed; refresh the dashboard":"Escritura rechazada: la credencial del proceso se había renovado y el reintento automático volvió a fallar; actualiza el panel",Year:"Año","Year to load":"Año a cargar",Yearly:"Anual",ambiguous:"ambiguo","at ":"el ","built-in DeepSeek peak table":"tabla de picos integrada de DeepSeek","custom ":"con ","custom rules":"Reglas personalizadas","full-read fallback":"lectura completa de reserva","models.dev sync failed; the last good catalog and unsaved edits were kept":"Error al sincronizar models.dev; se conservaron el último catálogo válido y los cambios sin guardar","no usage":"sin uso","not enabled":"no habilitado","parsed ":"Analizados: ",peak:"pico","peak plan ":"plan de pico y valle ",priced:"con precio","revision optimization on":"optimización por revisión activa","static (no band plan)":"estático (sin plan de pico y valle)","static (non-first-party)":"estático (ruta no oficial)","tiered ":"niveles ",tokens:"tokens",unpriced:"sin precio",unsupported:"sin soporte","{count} days":"{count} días","{count} models":"Modelos: {count}","{count} priced":"{count} con precio","{count} records shown":"Registros mostrados: {count}","{count} sessions":"{count} sesiones","{count} shown; load more for additional records":"Mostrados {count}; carga más para ver los siguientes registros","{count} unpriced":"{count} sin precio","{count} uses":"{count} usos","{date}: {amount}":"{date}: {amount}","{label}: Combined View distinguishes “Provider / Model”; By Model merges identically named models across providers; By Provider aggregates all of a provider’s models. Historical records without routing information are grouped as “Unknown.”":"{label}: la vista combinada distingue «Proveedor / Modelo»; por modelo se fusionan los modelos con el mismo nombre de distintos proveedores; por proveedor se agrupan todos los modelos de un proveedor. Los registros históricos sin información de enrutamiento se agrupan como «Desconocido».","{range} · {count}{kind} · includes cache reads/writes and reasoning":"{range} · {count}{kind} · incluye lecturas/escrituras de caché y razonamiento","{start} to {end} (UTC)":"{start} a {end} (UTC)","{state} · {reused} revision reused · {read} read{ledger}{failed} · {optimization}":"{state} · {reused} reutilizadas por revisión · {read} leídas{ledger}{failed} · {optimization}","No records are old enough to archive":"No hay registros lo bastante antiguos para archivar","Archive {count} records ({size}) across {months} months: {list}":"Archivar {count} registros ({size}) de {months} meses: {list}",", ":", ","Archived {count} records: {compressed} on disk (was {size})":"Se archivaron {count} registros: {compressed} en disco (antes {size})","Some months could not be archived: {list}":"Algunos meses no se pudieron archivar: {list}","Another DSH process is maintaining the ledger; try again in a moment":"Otro proceso de DSH está manteniendo el registro; inténtalo de nuevo en un momento","This storage does not support archiving":"Este almacenamiento no permite archivar","The ledger is not ready yet; try again in a moment":"El registro aún no está listo; inténtalo de nuevo en un momento","Enter a number of days between 1 and 3650":"Introduce un número de días entre 1 y 3650","Archiving failed; try again.":"No se pudo archivar; inténtalo de nuevo.",Maintenance:"Mantenimiento","Close maintenance":"Cerrar mantenimiento","Sessions that have not changed for a while are folded into monthly compressed files. Totals, detail and filters stay the same, and archived records remain readable.":"Las sesiones sin cambios durante un tiempo se agrupan en archivos comprimidos mensuales. Los totales, el detalle y los filtros no cambian, y los registros archivados siguen siendo legibles.","Archive records older than":"Archivar registros anteriores a",Days:"Días","days without updates":"días sin actualizaciones","Planning…":"Planificando…",Preview:"Vista previa","Start archiving":"Iniciar archivado","Archive {count} records? They stay readable in the panel, but this cannot be undone.":"¿Archivar {count} registros? Seguirán siendo legibles en el panel, pero esto no se puede deshacer.","Yes, archive":"Sí, archivar","Archive old records":"Archivar registros antiguos","Note: archived records stay readable and countable, but the first read of a month unpacks the whole month file, so the first start is slower; afterwards it stays in memory.":"Nota: los registros archivados se pueden leer y contar, pero la primera lectura de un mes descomprime todo el archivo mensual, así que el primer arranque es más lento; después permanece en memoria.","This Month":"Este mes"},fr:{"\nChecked: ":"\nVérifié : ","\nClick to open the GitHub repository":"\nCliquer pour ouvrir le dépôt GitHub","\nNewest release v":"\nDernière version v","\nThe host does not provide the version check yet (an older plugin is running): restart DSH":"\nL'hôte ne fournit pas encore la vérification de version (un plugin plus ancien est en cours) : redémarrez DSH","\nThis is the newest release":"\nCeci est la dernière version","\nVersion check failed: ":"\nÉchec de la vérification de version : ","\nWhether a newer release exists is not confirmed":"\nLa présence d'une version plus récente n'est pas confirmée"," (cached)":" (cache)"," (deleted)":" (supprimé)"," (reseller route: static pricing until this row is mapped to the official entry)":" (route revendeur : tarif statique jusqu'à ce que cette ligne soit mappée à l'entrée officielle)"," ({count} configured rows have no ledger usage)":" ({count} lignes configurées sans utilisation dans le registre)"," ({count} failed to read)":" ({count} illisibles)"," ({count} rows have unknown usage: the host did not label ledger usage)":" ({count} lignes à utilisation inconnue : l'hôte n'a pas indiqué l'utilisation du registre)"," ({detail})":" ({detail})"," Click Refresh to try again":" Cliquez sur Actualiser pour réessayer"," and this page v":" et cette page v"," and ≤ ":" et ≤ "," bands":" paliers"," calls":" appels"," days":" jours"," differ: DSH imports the plugin only at startup, so restart DSH for the new version (this panel is showing the older host payload)":" diffèrent : DSH ne charge le plugin qu'au démarrage, redémarrez DSH pour la nouvelle version (ce panneau affiche encore la version de l'ancien hôte)"," holiday days":" jours fériés"," rules":" règles"," tokens":" Tokens"," uses":" utilisations"," · capped at 500 rows":" · limité à 500 lignes"," · {count} failed":" · {count} en échec"," · {count} ledger restored":" · {count} restaurées du registre","), but the running host does not expose its rules yet; restart DSH to view and edit them.":"), mais l'hôte en cours ne fournit pas encore ses règles ; redémarrez DSH pour les consulter et les modifier.","12 months":"12 mois","30 days":"30 jours","90 days":"90 jours","Above a threshold, all four rates apply to the whole request":"Au-delà d'un seuil, les quatre tarifs s'appliquent à toute la requête","Above tokens":"Au-delà de (Tokens)",Actions:"Opérations","Actual model":"Modèle réel","Add band":"Ajouter un palier","Add context rate band":"Ajouter un palier de contexte","Add rule":"Ajouter une règle","Add window":"Ajouter une plage",All:"Tous","All Time":"Depuis le début","All available historical daily data can be selected. Dates follow this machine's time zone ({zone}). The heatmap switches between the last 30 days, 90 days and 12 months.":"Toutes les données journalières historiques disponibles sont sélectionnables. Les dates suivent le fuseau horaire de cette machine ({zone}). La carte de chaleur bascule entre 30 jours, 90 jours et 12 mois.","All contexts":"Tous les contextes","All models":"Tous les modèles","All providers":"Tous les fournisseurs","All workspaces":"Tous les espaces de travail",Apply:"Appliquer","Available after you enter a DeepSeek API key in Settings → Models":"Visible après avoir saisi une clé API DeepSeek dans Réglages → Modèles",Band:"Palier","Bands invalid":"Paliers invalides",Bars:"Barres","Billing band":"Palier de facturation","Billing band: ":"Palier de facturation : ","Billing policy":"Politique de facturation","Billing time (UTC)":"Heure de facturation (UTC)","Billing time source":"Source de l'heure de facturation","Built-in peak":"Horaire intégré","By Model":"Par modèle","By Provider":"Par fournisseur","Cache Hit Rate":"Taux de hit de cache","Cache Hits":"Hits de cache","Cache hits":"Hits de cache","Cache read":"Lecture de cache","Cache read / 1M":"Lecture cache / 1M","Cache write":"Écriture de cache","Cache write / 1M":"Écriture cache / 1M","Cache writes":"Écritures de cache","Cache-Hit Tokens":"Tokens lus en cache","Cache-Write Tokens":"Tokens écrits en cache",Calls:"Appels","Calls in {range}":"Appels : {range}",Cancel:"Annuler",Catalog:"Catalogue","Change interface language":"Changer la langue de l'interface","Chart type":"Type de graphique","Checking…":"Vérification…","Chinese statutory holidays price as off-peak all day":"Les jours fériés légaux chinois sont facturés en heures creuses toute la journée","Choose a date from {from} to {to}":"Choisissez une date entre le {from} et le {to}","Choose valid start and end dates":"Choisissez des dates de début et de fin valides","Clear filters":"Effacer les filtres","Clear mapping":"Effacer le mappage","Click a point to inspect that day":"Cliquez sur un point pour voir le détail du jour",Close:"Fermer","Close Usage Statistics":"Fermer les statistiques d'utilisation","Close cost settings":"Fermer les paramètres de coût",Collapse:"Réduire","Combined View":"Vue combinée","Configure model prices and sync":"Configurer les prix des modèles et la synchronisation","Context rate bands":"Paliers tarifaires par contexte","Context reused {count} tokens":"Contexte réutilisé {count} Tokens","Context threshold tokens":"Seuil de contexte en Tokens","Context tiers":"Paliers de contexte","Context tiers: ":"Paliers de contexte : ","Context tiers: none, base rates apply to every context":"Paliers de contexte : aucun, les tarifs de base s'appliquent à tout contexte","Copy built-in table":"Copier la table intégrée",Cost:"Coût","Cost Settings":"Paramètres de coût","Cost Statistics":"Statistiques de coût","Cost multiplier":"Multiplicateur de coût","Cost multiplier; applied to the final total only":"Multiplicateur de coût ; appliqué au total final uniquement","Cost settings could not be saved; check the inputs":"Impossible d'enregistrer les paramètres de coût ; vérifiez les saisies","Cost status":"État du coût","Current Streak":"Série actuelle",Custom:"Personnalisé","Custom date range":"Plage de dates personnalisée","Custom peak":"Horaire personnalisé","Custom rules":"Règles personnalisées","DSH Usage Audit Export":"Export d'audit d'utilisation DSH","DSH Usage Statistics Export":"Export des statistiques d'utilisation DSH",Daily:"Par jour","Daily Token usage trend; select a date to view request logs":"Tendance journalière d'utilisation des Tokens ; sélectionnez une date pour voir les journaux de requêtes","Data changed; reloading logs…":"Données modifiées ; rechargement des journaux…",Date:"Date","DeepSeek Account Balance":"Solde du compte DeepSeek",Deleted:"Supprimé","Display model":"Modèle affiché","Effective after a mapping is set":"Effectif après définition d'un mappage","Effective from (UTC, empty = all history)":"Entrée en vigueur (UTC, vide = tout l'historique)","Enable 6-hour automatic sync":"Synchronisation auto toutes les 6 h","Enable time-of-day pricing":"Activer la tarification horaire","End date":"Date de fin","End date must be on or after the start date":"La date de fin doit être égale ou postérieure à la date de début","End time":"Heure de fin","Estimated Cost":"Coût estimé","Every ":"Tous les ","Every {count} weeks":"Toutes les {count} semaines","Export CSV data for the current time range and model view":"Exporter les données CSV de la période et de la vue de modèles actuelles","Export Data":"Exporter les données","Export current logs":"Exporter les journaux actuels","Export logs":"Exporter les journaux","Exported At":"Exporté le","Exporting…":"Exportation…","Fetch failed: ":"Échec de la récupération : ","Fetch failed: network unavailable":"Échec de la récupération : réseau indisponible","Fetching…":"Récupération…","Filtered data unavailable":"Données filtrées indisponibles","Fresh: input + cache read/write":"Fresh : entrée + lecture/écriture de cache","Full pricing settings could not be loaded":"Impossible de charger les paramètres tarifaires complets","Granted ":"Offert ","Grouped by Model":"Regroupé par modèle","Grouped by Provider":"Regroupé par fournisseur","Heatmap span":"Période de la carte de chaleur","Historical scan completed {time}":"Analyse de l'historique terminée le {time}","Hit Rate":"Taux de hit","Holiday off-peak":"Heures creuses fériées","Host plugin v":"Plugin hôte v","Hourly Token usage trend; select an hour to view request logs":"Tendance horaire d'utilisation des Tokens ; sélectionnez une heure pour voir les journaux de requêtes",Input:"Entrée","Input / 1M":"Entrée / 1M","Input Tokens":"Tokens d'entrée","Input semantics":"Sémantique d'entrée","Interface language":"Langue de l'interface","Invalid dates: use YYYY-MM-DD, or a start..end range":"Dates invalides : utilisez YYYY-MM-DD ou une plage début..fin","Invalid mapping: pick an official model and enter a valid multiplier":"Mappage invalide : choisissez un modèle officiel et saisissez un multiplicateur valide","Invalid price: enter all non-negative base rates":"Prix invalide : saisissez tous les tarifs de base non négatifs","Invalid rate bands: maximum 32; thresholds must be increasing positive integers and all four rates must be complete and non-negative":"Paliers tarifaires invalides : 32 au maximum ; les seuils doivent être des entiers positifs croissants et les quatre tarifs doivent être renseignés et non négatifs","Invalid time-of-day rules: a policy ID, at least one weekday and window per rule, HH:MM times with the end after the start, no overlapping windows on the same weekday, and all four rates filled in":"Règles horaires invalides : un ID de politique, au moins un jour de semaine et une plage par règle, des heures HH:MM dont la fin suit le début, aucun chevauchement de plages le même jour, et les quatre tarifs renseignés","Invalid year (2000-2100)":"Année invalide (2000-2100)","Last 12 months":"12 derniers mois","Last 30 Days":"30 derniers jours","Last 30 days (larger cells)":"30 derniers jours (cellules plus grandes)","Last 7 Days":"7 derniers jours","Last 90 Days":"90 derniers jours","Last 90 days":"90 derniers jours","Last success: ":"Dernier succès : ","Last sync failed: ":"Échec de la dernière synchronisation : ","Latest v":"Dernière v","Ledger recovery":"Récupération du registre","Ledger reuse":"Réutilisation du registre","Legacy: input + cache write":"Legacy : entrée + écriture de cache",Less:"Moins",Line:"Ligne",Live:"Direct","Load from public calendar":"Charger depuis le calendrier public","Load more":"Charger plus","Loaded ":"Chargé : ","Loading full pricing settings…":"Chargement des paramètres tarifaires complets…","Loading trend":"Chargement de la tendance","Loading usage statistics…":"Chargement des statistiques d'utilisation…","Loading…":"Chargement…",Local:"Heure locale","Long range summarised: one point per period":"Période longue résumée : un point par période","Longest streak: {count} days":"Plus longue série : {count} jours","Lookup failed":"Échec de la consultation","Manage workspace aliases":"Gérer les alias d'espaces de travail",Manual:"Manuel",Mapped:"Mappé","Matching Calls":"Appels correspondants","Maximum 32 bands per model":"32 paliers maximum par modèle","Methodology: one cell lights up for each completed turn, including subagent sessions. Hover to view workspace details; click a workspace to filter the heatmap and detail tables. Dates and day boundaries follow this machine's time zone.":"Méthodologie : une cellule s'allume pour chaque tour terminé, y compris les sessions de sous-agents. Survolez pour voir le détail par espace de travail ; cliquez sur un espace de travail pour filtrer la carte de chaleur et les tableaux de détail. Les dates et les limites de jour suivent le fuseau horaire de cette machine.",Model:"Modèle","Model Filter":"Filtre de modèle","Model Stats":"Stats par modèle","Model Usage":"Utilisation par modèle","Model Usage Details":"Détail d'utilisation par modèle","Model Usage Details ({range})":"Détail d'utilisation par modèle ({range})","Model View Mode":"Mode d'affichage des modèles","Model filter":"Filtre de modèle",Monthly:"Par mois",More:"Plus",Multiplier:"Multiplicateur","No auditable Token calls in this scope":"Aucun appel Token auditable dans ce périmètre","No bands configured; base rates apply to every context.":"Aucun palier configuré ; les tarifs de base s'appliquent à tout contexte.","No data":"Aucune donnée","No data yet":"Aucune donnée pour l'instant","No ledger usage":"Aucune utilisation dans le registre","No model usage yet":"Aucune utilisation de modèle","No pricing":"Aucun tarif","No time-of-day rules":"Aucune règle horaire","No time-of-day rules: every request uses the row base rates.":"Aucune règle horaire : chaque requête utilise les tarifs de base de la ligne.","No trend data in this range":"Aucune donnée de tendance sur cette période","No usage recorded yet. This area will light up after you start a conversation.":"Aucune utilisation enregistrée. Cette zone s'illuminera dès que vous aurez démarré une conversation.","No usage records for this day":"Aucun enregistrement d'utilisation ce jour-là","No usage records in this time range":"Aucun enregistrement d'utilisation sur cette période","No usage records with model-routing information yet":"Aucun enregistrement d'utilisation avec information de routage de modèle","No workspaces yet":"Aucun espace de travail","Not a ledger route":"Pas une route du registre","Not configured":"Non configuré","Not synced yet":"Pas encore synchronisé",OFF:"creux","Off-peak":"Heures creuses","Off-peak (no rule match) uses the row base rates, peak uses the rule rates. Weekdays and times are UTC.":"Les heures creuses (aucune règle applicable) utilisent les tarifs de base de la ligne ; la pointe utilise les tarifs des règles. Jours et heures sont en UTC.","Official model / mapping":"Modèle officiel / mappage","Official model ID":"ID de modèle officiel","Official model matches":"Correspondances de modèles officiels","One date per line (YYYY-MM-DD); ranges such as 2026-10-01..2026-10-07 are expanded. Days follow the China Standard Time (UTC+8) calendar; swapped-in working weekends are not detected, so remove them yourself.":"Une date par ligne (YYYY-MM-DD) ; les plages comme 2026-10-01..2026-10-07 sont développées. Les jours suivent le calendrier de Chine (UTC+8) ; les week-ends travaillés de rattrapage ne sont pas détectés, retirez-les vous-même.",Other:"Autre",Output:"Sortie","Output / 1M":"Sortie / 1M","Output Tokens":"Tokens de sortie",Path:"Chemin",Peak:"Pointe","Peak invalid":"Horaire invalide","Peak plan ":"Plan horaire ","Peak plan invalid":"Plan horaire invalide","Peak ·":"Pointe ·","Plan: ":"Formule : ","Policy ID":"ID de politique","Policy hash":"Hash de politique","Press Enter to save one; clear an alias to restore the folder name":"Entrée pour enregistrer ; videz un alias pour restaurer le nom du dossier","Price per 1M tokens in USD":"Prix en USD pour 1M de Tokens","Prices are USD per 1M tokens. Editing a price box creates or updates a manual price (every row priced from the same official model shares it). Picking an official model in the mapping column switches the row to the catalog price. Bands add context-dependent rates; Time-of-day adds UTC peak rules.":"Les prix sont en USD pour 1M de Tokens. Modifier un champ de prix crée ou met à jour un prix manuel (toutes les lignes tarifées à partir du même modèle officiel le partagent). Choisir un modèle officiel dans la colonne de mappage fait passer la ligne au prix du catalogue. Les paliers ajoutent des tarifs selon le contexte ; la tarification horaire ajoute des règles de pointe en UTC.","Pricing model":"Modèle tarifaire","Pricing model: ":"Modèle tarifaire : ","Project alias":"Alias du projet",Provider:"Fournisseur","Provider / Model":"Fournisseur / modèle","Provider Filter":"Filtre de fournisseur","Provider Usage":"Utilisation par fournisseur","Provider filter":"Filtre de fournisseur",Reasoning:"Raisonnement","Reasoning Tokens":"Tokens de raisonnement","Refresh usage statistics":"Actualiser les statistiques d'utilisation","Refreshing data":"Actualisation des données","Refreshing…":"Actualisation…","Remove rate band":"Supprimer le palier tarifaire","Remove rule":"Supprimer la règle","Remove rules":"Supprimer les règles","Remove the manual price and fall back to the catalog or the built-in peak table":"Supprimer le prix manuel et revenir au catalogue ou à la table horaire intégrée","Remove this row mapping and fall back to automatic model matching":"Supprimer le mappage de cette ligne et revenir à la correspondance automatique par modèle","Remove window":"Supprimer la plage","Replace with custom rules":"Remplacer par des règles personnalisées","Request Logs":"Journaux de requêtes","Requested model":"Modèle demandé",Reset:"Réinitialiser","Restore built-in":"Rétablir la table intégrée",Retry:"Réessayer","Running version v":"Version en cours v",Save:"Enregistrer","Save All":"Tout enregistrer","Save and backfill":"Enregistrer et appliquer à l'historique","Saving affects unpriced and future calls only; existing positive costs are never recalculated. Changing a peak plan reconciles that model history against the new rules.":"L'enregistrement ne touche que les appels non tarifés et les appels à venir ; les coûts positifs existants ne sont jamais recalculés. Modifier un plan horaire réconcilie l'historique de ce modèle avec les nouvelles règles.","Saving…":"Enregistrement…",Scan:"Analyse","Scanning historical sessions: {scanned} / {total}{failed}":"Analyse des sessions historiques : {scanned} / {total}{failed}",Scope:"Périmètre","See the details table for the other {count} workspaces":"Voir le tableau de détail pour les {count} autres espaces de travail","Selected call":"Appel sélectionné",Sessions:"Sessions",Share:"Part",Source:"Provenance","Source: ":"Provenance : ","Star this plugin on GitHub":"Ajouter une étoile à ce plugin sur GitHub","Start date":"Date de début","Start time":"Heure de début","Stats Revision":"Révision des statistiques","Statutory holiday dates":"Dates des jours fériés légaux",Summary:"Résumé","Sync now":"Synchroniser","Syncing…":"Synchronisation…","The DeepSeek API reported that balance information is unavailable":"L'API DeepSeek indique que les informations de solde sont indisponibles","The cost settings are too large to save: trim bands or peak rules":"Les paramètres de coût sont trop volumineux pour être enregistrés : réduisez les paliers ou les règles horaires","The host did not label ledger usage for this row (usually an older host plugin); it does not mean the row has none":"L'hôte n'a pas indiqué l'utilisation du registre pour cette ligne (souvent un plugin hôte plus ancien) ; cela ne signifie pas qu'elle n'en a aucune","The host sent no model list (older plugin): the ledger models cannot be listed; restart DSH and reopen this panel":"L'hôte n'a envoyé aucune liste de modèles (plugin plus ancien) : impossible de lister les modèles du registre ; redémarrez DSH et rouvrez ce panneau","The process capability is unavailable; refresh the dashboard":"Le jeton de processus est indisponible ; actualisez le tableau de bord","The rules are incomplete; fix them before saving.":"Les règles sont incomplètes ; corrigez-les avant d'enregistrer.","The selected range failed to render; the sidebar entry is still available.":"La période sélectionnée n'a pas pu s'afficher ; l'entrée de la barre latérale reste disponible.","This band covers ":"Ce palier couvre ","This row already uses a peak plan (":"Cette ligne utilise déjà un plan horaire (",Time:"Heure","Time Range":"Période","Time tiers":"Paliers horaires","Time tiers: ":"Paliers horaires : ","Time-of-day pricing (UTC)":"Tarification horaire (UTC)",Timezone:"Fuseau horaire",Today:"Aujourd'hui","Token Usage Trend":"Tendance d'utilisation des Tokens","Token calls are newest first; select a row to inspect its turn / step and token buckets.":"Les appels Token sont triés du plus récent au plus ancien ; sélectionnez une ligne pour voir son tour / étape et les répartitions de Tokens.","Token threshold":"Seuil de Tokens","Tokens: Input {input} · Cache hits {cache} · Output {output}":"Tokens : Entrée {input} · Hits de cache {cache} · Sortie {output}","Top-up ":"Rechargé ",Total:"Total traité","Total Processed":"Total traité","Total Requests":"Requêtes au total","Total Tokens Processed":"Tokens traités au total","Total Tokens Processed by Workspace":"Tokens traités au total par espace de travail","Total Uses":"Utilisations totales","Total tokens processed = input + output + cache reads/writes + reasoning. Cache hits represent reused context; they are not newly generated tokens or actual cost. Costs are estimated at event time from official price lists and do not equal the provider invoice.":"Tokens traités au total = entrée + sortie + lectures/écritures de cache + raisonnement. Les hits de cache représentent du contexte réutilisé : ce ne sont pas des Tokens nouvellement générés ni un coût réel. Les coûts sont estimés à l'heure de l'événement d'après les tarifs officiels et ne correspondent pas à la facture du fournisseur.","Total: input already includes cache":"Total : l'entrée inclut déjà le cache","Trend data unavailable":"Données de tendance indisponibles",Turns:"Tours","Turns in {range}":"Tours : {range}","Type an official model ID":"Saisir un ID de modèle officiel","Unable to export logs":"Impossible d'exporter les journaux","Unable to load logs":"Impossible de charger les journaux","Unable to load usage statistics. Please retry.":"Impossible de charger les statistiques d'utilisation. Veuillez réessayer.",Unavailable:"Indisponible","Unified filters":"Filtres unifiés",Unknown:"Inconnu","Unknown model":"Modèle inconnu","Unknown provider":"Fournisseur inconnu","Unknown workspace":"Espace de travail inconnu","Up to date":"À jour","Update state pending":"Actualisation en attente","Updated {time}":"Mis à jour le {time}","Updating filtered data…":"Mise à jour des données filtrées…","Usage Heatmap":"Carte de chaleur d'utilisation","Usage Statistics":"Statistiques d'utilisation","Usage before this instant has no applicable band and fails closed as unpriced.":"L'utilisation antérieure à cet instant n'a aucun palier applicable et est considérée comme non tarifée (repli sécurisé).","Usage data may be stale":"Les données d'utilisation peuvent être obsolètes","Usage data may be stale; last full update {time}":"Les données d'utilisation peuvent être obsolètes ; dernière mise à jour complète le {time}","Usage detail views":"Vues de détail d'utilisation","Usage heatmap calendar: arrow keys to browse, Enter for the day detail":"Calendrier de la carte de chaleur : flèches pour parcourir, Entrée pour le détail du jour","Usage statistics is temporarily unavailable":"Les statistiques d'utilisation sont temporairement indisponibles","Usage unknown":"Utilisation inconnue","Using the built-in DeepSeek peak table":"Utilise la table horaire DeepSeek intégrée",Weekly:"Par semaine",Workspace:"Espace de travail","Workspace Aliases":"Alias d'espaces de travail","Workspace Details":"Détail par espace de travail","Workspace Details ({range})":"Détail par espace de travail ({range})","Workspace Filter":"Filtre d'espace de travail","Workspace Stats":"Stats par espace de travail","Workspace Usage":"Utilisation par espace de travail","Workspace filter":"Filtre d'espace de travail","Write rejected: the permission check failed (a stale process capability is also possible); refresh the dashboard and retry":"Écriture refusée : le contrôle des permissions a échoué (un jeton de processus périmé est aussi possible) ; actualisez le tableau de bord et réessayez","Write rejected: the process capability had rotated and the automatic retry still failed; refresh the dashboard":"Écriture refusée : le jeton de processus a été renouvelé et la nouvelle tentative automatique a encore échoué ; actualisez le tableau de bord",Year:"Année","Year to load":"Année à charger",Yearly:"Par an",ambiguous:"ambigu","at ":"à ","built-in DeepSeek peak table":"table horaire DeepSeek intégrée","custom ":"avec ","custom rules":"règles personnalisées","full-read fallback":"repli en lecture complète","models.dev sync failed; the last good catalog and unsaved edits were kept":"Échec de la synchronisation models.dev ; le dernier catalogue valide et les modifications non enregistrées sont conservés","no usage":"aucune utilisation","not enabled":"non activé","parsed ":"Analysé : ",peak:"pointe","peak plan ":"plan horaire ",priced:"tarifé","revision optimization on":"optimisation sans relecture activée","static (no band plan)":"statique (sans plan horaire)","static (non-first-party)":"statique (route non officielle)","tiered ":"paliers : ",tokens:"Tokens",unpriced:"non tarifé",unsupported:"non supporté","{count} days":"{count} jours","{count} models":"Modèles : {count}","{count} priced":"{count} tarifés","{count} records shown":"{count} enregistrements affichés","{count} sessions":"{count} sessions","{count} shown; load more for additional records":"{count} affichés ; chargez la suite pour plus d'enregistrements","{count} unpriced":"{count} non tarifés","{count} uses":"{count} utilisations","{date}: {amount}":"{date} : {amount}","{label}: Combined View distinguishes “Provider / Model”; By Model merges identically named models across providers; By Provider aggregates all of a provider’s models. Historical records without routing information are grouped as “Unknown.”":"{label} : la vue combinée distingue « Fournisseur / modèle » ; par modèle, les modèles de même nom sont fusionnés entre fournisseurs ; par fournisseur, tous ses modèles sont agrégés. Les enregistrements historiques sans information de routage sont regroupés sous « Inconnu ».","{range} · {count}{kind} · includes cache reads/writes and reasoning":"{range} · {count}{kind} · inclut lectures/écritures de cache et raisonnement","{start} to {end} (UTC)":"Du {start} au {end} (UTC)","{state} · {reused} revision reused · {read} read{ledger}{failed} · {optimization}":"{state} · {reused} révisions réutilisées · {read} lues{ledger}{failed} · {optimization}","No records are old enough to archive":"Aucun enregistrement n'est assez ancien pour être archivé","Archive {count} records ({size}) across {months} months: {list}":"Archiver {count} enregistrements ({size}) sur {months} mois : {list}",", ":", ","Archived {count} records: {compressed} on disk (was {size})":"{count} enregistrements archivés : {compressed} sur le disque (auparavant {size})","Some months could not be archived: {list}":"Certains mois n'ont pas pu être archivés : {list}","Another DSH process is maintaining the ledger; try again in a moment":"Un autre processus DSH met à jour le registre ; réessayez dans un instant","This storage does not support archiving":"Ce stockage ne prend pas en charge l'archivage","The ledger is not ready yet; try again in a moment":"Le registre n'est pas encore prêt ; réessayez dans un instant","Enter a number of days between 1 and 3650":"Saisissez un nombre de jours compris entre 1 et 3650","Archiving failed; try again.":"L'archivage a échoué ; réessayez.",Maintenance:"Maintenance","Close maintenance":"Fermer la maintenance","Sessions that have not changed for a while are folded into monthly compressed files. Totals, detail and filters stay the same, and archived records remain readable.":"Les sessions inchangées depuis un moment sont regroupées dans des fichiers compressés mensuels. Les totaux, le détail et les filtres restent identiques, et les enregistrements archivés restent consultables.","Archive records older than":"Archiver les enregistrements plus anciens que",Days:"Jours","days without updates":"jours sans mise à jour","Planning…":"Planification…",Preview:"Aperçu","Start archiving":"Lancer l'archivage","Archive {count} records? They stay readable in the panel, but this cannot be undone.":"Archiver {count} enregistrements ? Ils restent consultables dans le panneau, mais cette action est irréversible.","Yes, archive":"Oui, archiver","Archive old records":"Archiver les anciens enregistrements","Note: archived records stay readable and countable, but the first read of a month unpacks the whole month file, so the first start is slower; afterwards it stays in memory.":"Remarque : les enregistrements archivés restent lisibles et dénombrables, mais la première lecture d'un mois décompresse tout le fichier mensuel, ce qui ralentit le premier démarrage ; ensuite, il reste en mémoire.","This Month":"Ce mois-ci"},de:{"\nChecked: ":"\nGeprüft: ","\nClick to open the GitHub repository":"\nKlicken, um das GitHub-Repository zu öffnen","\nNewest release v":"\nNeueste Version v","\nThe host does not provide the version check yet (an older plugin is running): restart DSH":"\nDer Host bietet die Versionsprüfung noch nicht (ein älteres Plugin läuft): DSH neu starten","\nThis is the newest release":"\nDies ist die neueste Version","\nVersion check failed: ":"\nVersionsprüfung fehlgeschlagen: ","\nWhether a newer release exists is not confirmed":"\nOb eine neuere Version existiert, ist nicht bestätigt"," (cached)":" (Cache)"," (deleted)":" (gelöscht)"," (reseller route: static pricing until this row is mapped to the official entry)":" (Reseller-Route: statischer Preis, bis diese Zeile dem offiziellen Eintrag zugeordnet ist)"," ({count} configured rows have no ledger usage)":" ({count} konfigurierte Zeilen ohne Ledger-Nutzung)"," ({count} failed to read)":" ({count} Lesefehler)"," ({count} rows have unknown usage: the host did not label ledger usage)":" ({count} Zeilen mit unbekannter Nutzung: Der Host hat die Ledger-Nutzung nicht gekennzeichnet)"," ({detail})":" ({detail})"," Click Refresh to try again":" Zum erneuten Versuch aktualisieren"," and this page v":" und diese Seite v"," and ≤ ":" und ≤ "," bands":" Stufen"," calls":" Aufrufe"," days":" Tage"," differ: DSH imports the plugin only at startup, so restart DSH for the new version (this panel is showing the older host payload)":" stimmen nicht überein: DSH lädt das Plugin nur beim Start; für die neue Version DSH neu starten (dieses Panel zeigt noch die Daten des älteren Hosts)"," holiday days":" Feiertage"," rules":" Regeln"," tokens":" Token"," uses":" Nutzungen"," · capped at 500 rows":" · begrenzt auf 500 Zeilen"," · {count} failed":" · {count} fehlgeschlagen"," · {count} ledger restored":" · {count} Ledger wiederhergestellt","), but the running host does not expose its rules yet; restart DSH to view and edit them.":"), aber der laufende Host stellt die Regeln noch nicht bereit; DSH neu starten, um sie anzuzeigen und zu bearbeiten.","12 months":"12 Monate","30 days":"30 Tage","90 days":"90 Tage","Above a threshold, all four rates apply to the whole request":"Ab einer Schwelle gelten alle vier Raten für die gesamte Anfrage","Above tokens":"Ab Token",Actions:"Aktionen","Actual model":"Tatsächliches Modell","Add band":"Stufe hinzufügen","Add context rate band":"Kontext-Tarifstufe hinzufügen","Add rule":"Regel hinzufügen","Add window":"Zeitfenster hinzufügen",All:"Alle","All Time":"Gesamter Zeitraum","All available historical daily data can be selected. Dates follow this machine's time zone ({zone}). The heatmap switches between the last 30 days, 90 days and 12 months.":"Alle verfügbaren täglichen Verlaufsdaten sind wählbar. Datumsangaben folgen der Zeitzone dieses Rechners ({zone}); die Heatmap wechselt zwischen den letzten 30 Tagen, 90 Tagen und 12 Monaten.","All contexts":"Alle Kontexte","All models":"Alle Modelle","All providers":"Alle Anbieter","All workspaces":"Alle Arbeitsbereiche",Apply:"Anwenden","Available after you enter a DeepSeek API key in Settings → Models":"Sichtbar, sobald unter Einstellungen → Modelle ein DeepSeek-API-Schlüssel hinterlegt ist",Band:"Stufe","Bands invalid":"Stufen ungültig",Bars:"Balken","Billing band":"Abrechnungsstufe","Billing band: ":"Abrechnungsstufe: ","Billing policy":"Abrechnungsrichtlinie","Billing time (UTC)":"Abrechnungszeit (UTC)","Billing time source":"Quelle der Abrechnungszeit","Built-in peak":"Integrierter Peak-Plan","By Model":"Nach Modell","By Provider":"Nach Anbieter","Cache Hit Rate":"Cache-Trefferrate","Cache Hits":"Cache-Treffer","Cache hits":"Cache-Treffer","Cache read":"Cache-Lesen","Cache read / 1M":"Cache-Lesen / 1M","Cache write":"Cache-Schreiben","Cache write / 1M":"Cache-Schreiben / 1M","Cache writes":"Cache-Schreiben","Cache-Hit Tokens":"Cache-Treffer-Token","Cache-Write Tokens":"Cache-Schreib-Token",Calls:"Aufrufe","Calls in {range}":"Aufrufe: {range}",Cancel:"Abbrechen",Catalog:"Katalog","Change interface language":"Oberflächensprache ändern","Chart type":"Diagrammtyp","Checking…":"Wird geprüft…","Chinese statutory holidays price as off-peak all day":"Chinesische gesetzliche Feiertage werden ganztägig als Off-Peak berechnet","Choose a date from {from} to {to}":"Datum zwischen {from} und {to} wählen","Choose valid start and end dates":"Gültiges Start- und Enddatum wählen","Clear filters":"Filter zurücksetzen","Clear mapping":"Zuordnung löschen","Click a point to inspect that day":"Auf einen Punkt klicken, um den Tag anzuzeigen",Close:"Schließen","Close Usage Statistics":"Nutzungsstatistik schließen","Close cost settings":"Kosteneinstellungen schließen",Collapse:"Einklappen","Combined View":"Kombinierte Ansicht","Configure model prices and sync":"Modellpreise konfigurieren und synchronisieren","Context rate bands":"Kontext-Tarifstufen","Context reused {count} tokens":"Kontext wiederverwendet: {count} Token","Context threshold tokens":"Kontextschwelle (Token)","Context tiers":"Kontext-Stufen","Context tiers: ":"Kontext-Stufen: ","Context tiers: none, base rates apply to every context":"Kontext-Stufen: keine, Basisraten gelten für jeden Kontext","Copy built-in table":"Integrierte Tabelle kopieren",Cost:"Kosten","Cost Settings":"Kosteneinstellungen","Cost Statistics":"Kostenstatistik","Cost multiplier":"Kostenmultiplikator","Cost multiplier; applied to the final total only":"Kostenmultiplikator; wirkt nur auf die Endsumme","Cost settings could not be saved; check the inputs":"Kosteneinstellungen konnten nicht gespeichert werden; Eingaben prüfen","Cost status":"Kostenstatus","Current Streak":"Aktuelle Serie",Custom:"Benutzerdefiniert","Custom date range":"Benutzerdefinierter Zeitraum","Custom peak":"Eigener Peak-Plan","Custom rules":"Benutzerdefinierte Regeln","DSH Usage Audit Export":"DSH-Export der Nutzungsdetails","DSH Usage Statistics Export":"DSH-Export der Nutzungsstatistik",Daily:"Täglich","Daily Token usage trend; select a date to view request logs":"Täglicher Token-Nutzungstrend; Datum auswählen, um die Anfrage-Logs anzuzeigen","Data changed; reloading logs…":"Daten geändert; Logs werden neu geladen…",Date:"Datum","DeepSeek Account Balance":"DeepSeek-Kontoguthaben",Deleted:"Gelöscht","Display model":"Angezeigtes Modell","Effective after a mapping is set":"Wirksam, sobald eine Zuordnung gesetzt ist","Effective from (UTC, empty = all history)":"Gültig ab (UTC, leer = gesamter Verlauf)","Enable 6-hour automatic sync":"Automatische Synchronisierung alle 6 Stunden aktivieren","Enable time-of-day pricing":"Zeitabhängige Tarife aktivieren","End date":"Enddatum","End date must be on or after the start date":"Das Enddatum darf nicht vor dem Startdatum liegen","End time":"Endzeit","Estimated Cost":"Geschätzte Kosten","Every ":"Alle ","Every {count} weeks":"Alle {count} Wochen","Export CSV data for the current time range and model view":"CSV-Daten für den aktuellen Zeitraum und die aktuelle Modellansicht exportieren","Export Data":"Daten exportieren","Export current logs":"Aktuelle Logs exportieren","Export logs":"Logs exportieren","Exported At":"Exportiert am","Exporting…":"Wird exportiert…","Fetch failed: ":"Abruf fehlgeschlagen: ","Fetch failed: network unavailable":"Abruf fehlgeschlagen: Netzwerk nicht verfügbar","Fetching…":"Wird abgerufen…","Filtered data unavailable":"Gefilterte Daten nicht verfügbar","Fresh: input + cache read/write":"Fresh: Eingabe + Cache-Lesen/-Schreiben","Full pricing settings could not be loaded":"Vollständige Tarifeinstellungen konnten nicht geladen werden","Granted ":"Gutschrift ","Grouped by Model":"Nach Modell gruppiert","Grouped by Provider":"Nach Anbieter gruppiert","Heatmap span":"Heatmap-Zeitraum","Historical scan completed {time}":"Verlaufsscan abgeschlossen: {time}","Hit Rate":"Trefferrate","Holiday off-peak":"Feiertags-Off-Peak","Host plugin v":"Host-Plugin v","Hourly Token usage trend; select an hour to view request logs":"Stündlicher Token-Nutzungstrend; Stunde auswählen, um die Anfrage-Logs anzuzeigen",Input:"Eingabe","Input / 1M":"Eingabe / 1M","Input Tokens":"Eingabe-Token","Input semantics":"Eingabe-Semantik","Interface language":"Oberflächensprache","Invalid dates: use YYYY-MM-DD, or a start..end range":"Ungültige Daten: YYYY-MM-DD oder einen Bereich start..end verwenden","Invalid mapping: pick an official model and enter a valid multiplier":"Ungültige Zuordnung: ein offizielles Modell auswählen und einen gültigen Multiplikator eingeben","Invalid price: enter all non-negative base rates":"Ungültiger Preis: alle Basisraten als nicht negative Werte eingeben","Invalid rate bands: maximum 32; thresholds must be increasing positive integers and all four rates must be complete and non-negative":"Ungültige Tarifstufen: maximal 32; Schwellen müssen aufsteigende positive Ganzzahlen sein, und alle vier Raten müssen vollständig und nicht negativ sein","Invalid time-of-day rules: a policy ID, at least one weekday and window per rule, HH:MM times with the end after the start, no overlapping windows on the same weekday, and all four rates filled in":"Ungültige Zeitregeln: je Regel eine Policy-ID, mindestens ein Wochentag und ein Zeitfenster, HH:MM-Zeiten mit Ende nach Beginn, keine überlappenden Fenster am selben Wochentag und alle vier Raten ausgefüllt","Invalid year (2000-2100)":"Ungültiges Jahr (2000–2100)","Last 12 months":"Letzte 12 Monate","Last 30 Days":"Letzte 30 Tage","Last 30 days (larger cells)":"Letzte 30 Tage (größere Zellen)","Last 7 Days":"Letzte 7 Tage","Last 90 Days":"Letzte 90 Tage","Last 90 days":"Letzte 90 Tage","Last success: ":"Letzter Erfolg: ","Last sync failed: ":"Letzte Synchronisierung fehlgeschlagen: ","Latest v":"Neueste Version v","Ledger recovery":"Ledger-Wiederherstellung","Ledger reuse":"Ledger-Wiederverwendung","Legacy: input + cache write":"Legacy: Eingabe + Cache-Schreiben",Less:"Weniger",Line:"Linie",Live:"Echtzeit","Load from public calendar":"Aus öffentlichem Kalender laden","Load more":"Mehr laden","Loaded ":"Geladen ","Loading full pricing settings…":"Vollständige Tarifeinstellungen werden geladen…","Loading trend":"Trend wird geladen","Loading usage statistics…":"Nutzungsstatistik wird geladen…","Loading…":"Wird geladen…",Local:"Lokal","Long range summarised: one point per period":"Langer Zeitraum zusammengefasst: ein Punkt pro Periode","Longest streak: {count} days":"Längste Serie: {count} Tage","Lookup failed":"Abfrage fehlgeschlagen","Manage workspace aliases":"Arbeitsbereich-Aliase verwalten",Manual:"Manuell",Mapped:"Zugeordnet","Matching Calls":"Passende Aufrufe","Maximum 32 bands per model":"Maximal 32 Stufen je Modell","Methodology: one cell lights up for each completed turn, including subagent sessions. Hover to view workspace details; click a workspace to filter the heatmap and detail tables. Dates and day boundaries follow this machine's time zone.":"Methodik: Ein Kästchen leuchtet für jeden abgeschlossenen Turn auf, einschließlich Subagenten-Sitzungen. Für Arbeitsbereich-Details darüberfahren; auf einen Arbeitsbereich klicken, um Heatmap und Detailtabellen zu filtern. Datumsangaben und Tagesgrenzen folgen der Zeitzone dieses Rechners.",Model:"Modell","Model Filter":"Modellfilter","Model Stats":"Modellstatistik","Model Usage":"Modellnutzung","Model Usage Details":"Details zur Modellnutzung","Model Usage Details ({range})":"Details zur Modellnutzung ({range})","Model View Mode":"Modellansichtsmodus","Model filter":"Modellfilter",Monthly:"Monatlich",More:"Mehr",Multiplier:"Multiplikator","No auditable Token calls in this scope":"Keine prüfbaren Token-Aufrufe in diesem Bereich","No bands configured; base rates apply to every context.":"Keine Stufen konfiguriert; für jeden Kontext gelten die Basisraten.","No data":"Keine Daten","No data yet":"Noch keine Daten","No ledger usage":"Keine Ledger-Nutzung","No model usage yet":"Noch keine Modellnutzung","No pricing":"Kein Preis","No time-of-day rules":"Keine Zeitregeln","No time-of-day rules: every request uses the row base rates.":"Keine Zeitregeln: Jede Anfrage verwendet die Basisraten dieser Zeile.","No trend data in this range":"Keine Trenddaten in diesem Zeitraum","No usage recorded yet. This area will light up after you start a conversation.":"Noch keine Nutzung erfasst. Dieser Bereich leuchtet auf, sobald eine Unterhaltung beginnt.","No usage records for this day":"Keine Nutzungsdaten für diesen Tag","No usage records in this time range":"Keine Nutzungsdaten in diesem Zeitraum","No usage records with model-routing information yet":"Noch keine Nutzungsdaten mit Modell-Routing-Informationen","No workspaces yet":"Noch keine Arbeitsbereiche","Not a ledger route":"Keine Ledger-Route","Not configured":"Nicht konfiguriert","Not synced yet":"Noch nicht synchronisiert",OFF:"Off","Off-peak":"Off-Peak","Off-peak (no rule match) uses the row base rates, peak uses the rule rates. Weekdays and times are UTC.":"Off-Peak (keine Regelübereinstimmung) verwendet die Basisraten der Zeile, Peak die Raten der Regel. Wochentage und Zeiten sind UTC.","Official model / mapping":"Offizielles Modell / Zuordnung","Official model ID":"Offizielle Modell-ID","Official model matches":"Treffer für offizielle Modelle","One date per line (YYYY-MM-DD); ranges such as 2026-10-01..2026-10-07 are expanded. Days follow the China Standard Time (UTC+8) calendar; swapped-in working weekends are not detected, so remove them yourself.":"Ein Datum pro Zeile (YYYY-MM-DD); Bereiche wie 2026-10-01..2026-10-07 werden erweitert. Tage folgen dem Kalender der China Standard Time (UTC+8); eingetauschte Arbeitswochenenden werden nicht erkannt und müssen selbst entfernt werden.",Other:"Andere",Output:"Ausgabe","Output / 1M":"Ausgabe / 1M","Output Tokens":"Ausgabe-Token",Path:"Pfad",Peak:"Peak","Peak invalid":"Peak ungültig","Peak plan ":"Peak-Plan ","Peak plan invalid":"Peak-Plan ungültig","Peak ·":"Peak-Zeit ·","Plan: ":"Tarif: ","Policy ID":"Policy-ID","Policy hash":"Policy-Hash","Press Enter to save one; clear an alias to restore the folder name":"Enter speichert den einzelnen Alias; Alias leeren, um den Ordnernamen wiederherzustellen","Price per 1M tokens in USD":"Preis pro 1 Mio. Token in USD","Prices are USD per 1M tokens. Editing a price box creates or updates a manual price (every row priced from the same official model shares it). Picking an official model in the mapping column switches the row to the catalog price. Bands add context-dependent rates; Time-of-day adds UTC peak rules.":"Preise sind USD pro 1 Mio. Token. Eine Änderung im Preisfeld erstellt oder aktualisiert einen manuellen Preis (alle Zeilen mit demselben offiziellen Modell teilen ihn). Die Auswahl eines offiziellen Modells in der Zuordnungsspalte stellt die Zeile auf den Katalogpreis um. Stufen ergänzen kontextabhängige Raten; zeitabhängige Tarife ergänzen UTC-Peak-Regeln.","Pricing model":"Preismodell","Pricing model: ":"Preismodell: ","Project alias":"Projekt-Alias",Provider:"Anbieter","Provider / Model":"Anbieter / Modell","Provider Filter":"Anbieterfilter","Provider Usage":"Anbieternutzung","Provider filter":"Anbieterfilter",Reasoning:"Reasoning","Reasoning Tokens":"Reasoning-Token","Refresh usage statistics":"Nutzungsstatistik aktualisieren","Refreshing data":"Daten werden aktualisiert","Refreshing…":"Wird aktualisiert…","Remove rate band":"Tarifstufe entfernen","Remove rule":"Regel entfernen","Remove rules":"Regeln entfernen","Remove the manual price and fall back to the catalog or the built-in peak table":"Manuellen Preis entfernen und auf den Katalog oder die integrierte Peak-Tabelle zurückfallen","Remove this row mapping and fall back to automatic model matching":"Zuordnung dieser Zeile entfernen und zur automatischen Modellzuordnung zurückkehren","Remove window":"Zeitfenster entfernen","Replace with custom rules":"Durch benutzerdefinierte Regeln ersetzen","Request Logs":"Anfrage-Logs","Requested model":"Angefragtes Modell",Reset:"Zurücksetzen","Restore built-in":"Integrierte Tabelle wiederherstellen",Retry:"Erneut versuchen","Running version v":"Laufende Version v",Save:"Speichern","Save All":"Alle speichern","Save and backfill":"Speichern und nachtragen","Saving affects unpriced and future calls only; existing positive costs are never recalculated. Changing a peak plan reconciles that model history against the new rules.":"Speichern betrifft nur noch nicht bepreiste und künftige Aufrufe; vorhandene positive Kosten werden nie neu berechnet. Eine Änderung des Peak-Plans gleicht den Verlauf dieses Modells mit den neuen Regeln ab.","Saving…":"Wird gespeichert…",Scan:"Scan","Scanning historical sessions: {scanned} / {total}{failed}":"Verlaufssitzungen werden gescannt: {scanned} / {total}{failed}",Scope:"Umfang","See the details table for the other {count} workspaces":"Weitere {count} Arbeitsbereiche siehe Detailtabelle","Selected call":"Ausgewählter Aufruf",Sessions:"Sitzungen",Share:"Anteil",Source:"Quelle","Source: ":"Quelle: ","Star this plugin on GitHub":"Diesem Plugin auf GitHub einen Stern geben","Start date":"Startdatum","Start time":"Startzeit","Stats Revision":"Statistik-Revision","Statutory holiday dates":"Daten gesetzlicher Feiertage",Summary:"Zusammenfassung","Sync now":"Jetzt synchronisieren","Syncing…":"Wird synchronisiert…","The DeepSeek API reported that balance information is unavailable":"Die DeepSeek-API meldet, dass die Guthabeninformation nicht verfügbar ist","The cost settings are too large to save: trim bands or peak rules":"Die Kosteneinstellungen sind zu groß zum Speichern: Stufen oder Peak-Regeln reduzieren","The host did not label ledger usage for this row (usually an older host plugin); it does not mean the row has none":"Der Host hat die Ledger-Nutzung für diese Zeile nicht gekennzeichnet (meist ein älteres Host-Plugin); das bedeutet nicht, dass keine Nutzung vorliegt","The host sent no model list (older plugin): the ledger models cannot be listed; restart DSH and reopen this panel":"Der Host hat keine Modellliste geliefert (älteres Plugin): Die Ledger-Modelle können nicht aufgelistet werden; DSH neu starten und dieses Panel erneut öffnen","The process capability is unavailable; refresh the dashboard":"Die Prozessberechtigung ist nicht verfügbar; Dashboard aktualisieren","The rules are incomplete; fix them before saving.":"Die Regeln sind unvollständig; vor dem Speichern korrigieren.","The selected range failed to render; the sidebar entry is still available.":"Der ausgewählte Zeitraum konnte nicht dargestellt werden; der Eintrag in der Seitenleiste bleibt verfügbar.","This band covers ":"Diese Stufe umfasst ","This row already uses a peak plan (":"Diese Zeile verwendet bereits einen Peak-Plan (",Time:"Zeit","Time Range":"Zeitraum","Time tiers":"Zeit-Stufen","Time tiers: ":"Zeit-Stufen: ","Time-of-day pricing (UTC)":"Zeitabhängige Tarife (UTC)",Timezone:"Zeitzone",Today:"Heute","Token Usage Trend":"Token-Nutzungstrend","Token calls are newest first; select a row to inspect its turn / step and token buckets.":"Token-Aufrufe neueste zuerst; Zeile auswählen, um Turn / Step und Token-Buckets einzusehen.","Token threshold":"Token-Schwelle","Tokens: Input {input} · Cache hits {cache} · Output {output}":"Token: Eingabe {input} · Cache-Treffer {cache} · Ausgabe {output}","Top-up ":"Aufladung ",Total:"Gesamt","Total Processed":"Gesamt verarbeitet","Total Requests":"Anfragen gesamt","Total Tokens Processed":"Verarbeitete Token gesamt","Total Tokens Processed by Workspace":"Verarbeitete Token je Arbeitsbereich","Total Uses":"Nutzungen gesamt","Total tokens processed = input + output + cache reads/writes + reasoning. Cache hits represent reused context; they are not newly generated tokens or actual cost. Costs are estimated at event time from official price lists and do not equal the provider invoice.":"Verarbeitete Token gesamt = Eingabe + Ausgabe + Cache-Lesen/-Schreiben + Reasoning. Cache-Treffer stehen für wiederverwendeten Kontext und sind keine neu erzeugten Token oder tatsächlichen Kosten. Kosten werden zum Ereigniszeitpunkt anhand offizieller Preislisten geschätzt und entsprechen nicht der Anbieterrechnung.","Total: input already includes cache":"Total: Eingabe enthält bereits Cache","Trend data unavailable":"Trenddaten nicht verfügbar",Turns:"Turns","Turns in {range}":"Turns: {range}","Type an official model ID":"Offizielle Modell-ID eingeben","Unable to export logs":"Logs konnten nicht exportiert werden","Unable to load logs":"Logs konnten nicht geladen werden","Unable to load usage statistics. Please retry.":"Nutzungsstatistik konnte nicht geladen werden. Bitte erneut versuchen.",Unavailable:"Nicht verfügbar","Unified filters":"Einheitliche Filter",Unknown:"Unbekannt","Unknown model":"Unbekanntes Modell","Unknown provider":"Unbekannter Anbieter","Unknown workspace":"Unbekannter Arbeitsbereich","Up to date":"Aktuell","Update state pending":"Aktualisierung ausstehend","Updated {time}":"Aktualisiert: {time}","Updating filtered data…":"Gefilterte Daten werden aktualisiert…","Usage Heatmap":"Nutzungs-Heatmap","Usage Statistics":"Nutzungsstatistik","Usage before this instant has no applicable band and fails closed as unpriced.":"Nutzung vor diesem Zeitpunkt hat keine passende Stufe und wird dann ohne Preis behandelt.","Usage data may be stale":"Nutzungsdaten sind möglicherweise veraltet","Usage data may be stale; last full update {time}":"Nutzungsdaten sind möglicherweise veraltet; letzte vollständige Aktualisierung: {time}","Usage detail views":"Nutzungsdetailansichten","Usage heatmap calendar: arrow keys to browse, Enter for the day detail":"Nutzungs-Heatmap-Kalender: Pfeiltasten zum Blättern, Enter für die Tagesdetails","Usage statistics is temporarily unavailable":"Die Nutzungsstatistik ist vorübergehend nicht verfügbar","Usage unknown":"Nutzung unbekannt","Using the built-in DeepSeek peak table":"Integrierte DeepSeek-Peak-Tabelle wird verwendet",Weekly:"Wöchentlich",Workspace:"Arbeitsbereich","Workspace Aliases":"Arbeitsbereich-Aliase","Workspace Details":"Arbeitsbereich-Details","Workspace Details ({range})":"Arbeitsbereich-Details ({range})","Workspace Filter":"Arbeitsbereichsfilter","Workspace Stats":"Arbeitsbereichsstatistik","Workspace Usage":"Arbeitsbereichsnutzung","Workspace filter":"Arbeitsbereichsfilter","Write rejected: the permission check failed (a stale process capability is also possible); refresh the dashboard and retry":"Schreiben abgelehnt: Die Berechtigungsprüfung ist fehlgeschlagen (möglicherweise ist die Prozessberechtigung veraltet); Dashboard aktualisieren und erneut versuchen","Write rejected: the process capability had rotated and the automatic retry still failed; refresh the dashboard":"Schreiben abgelehnt: Die Prozessberechtigung wurde rotiert und der automatische Neuversuch ist ebenfalls fehlgeschlagen; Dashboard aktualisieren",Year:"Jahr","Year to load":"Zu ladendes Jahr",Yearly:"Jährlich",ambiguous:"unklar","at ":"um ","built-in DeepSeek peak table":"integrierte DeepSeek-Peak-Tabelle","custom ":"benutzerdefiniert, ","custom rules":"Benutzerdefinierte Regeln","full-read fallback":"Voll-Lese-Fallback","models.dev sync failed; the last good catalog and unsaved edits were kept":"Synchronisierung mit models.dev fehlgeschlagen; der letzte gültige Katalog und nicht gespeicherte Änderungen wurden beibehalten","no usage":"keine Nutzung","not enabled":"nicht aktiviert","parsed ":"Erkannt ",peak:"Peak","peak plan ":"Peak-Plan ",priced:"bepreist","revision optimization on":"Revisionsoptimierung aktiv","static (no band plan)":"statisch (kein Peak-Plan)","static (non-first-party)":"statisch (Drittanbieter)","tiered ":"Stufen: ",tokens:"Token",unpriced:"ohne Preis",unsupported:"nicht unterstützt","{count} days":"{count} Tage","{count} models":"Modelle: {count}","{count} priced":"{count} bepreist","{count} records shown":"{count} Datensätze angezeigt","{count} sessions":"{count} Sitzungen","{count} shown; load more for additional records":"{count} angezeigt; weitere Datensätze nachladen","{count} unpriced":"{count} ohne Preis","{count} uses":"{count} Nutzungen","{date}: {amount}":"{date}: {amount}","{label}: Combined View distinguishes “Provider / Model”; By Model merges identically named models across providers; By Provider aggregates all of a provider’s models. Historical records without routing information are grouped as “Unknown.”":"{label}: Die kombinierte Ansicht unterscheidet „Anbieter / Modell“; „Nach Modell“ führt gleichnamige Modelle über Anbieter hinweg zusammen; „Nach Anbieter“ summiert alle Modelle eines Anbieters. Historische Datensätze ohne Routing-Informationen werden als „Unbekannt“ gruppiert.","{range} · {count}{kind} · includes cache reads/writes and reasoning":"{range} · {count}{kind} · inkl. Cache-Lesen/-Schreiben und Reasoning","{start} to {end} (UTC)":"{start} bis {end} (UTC)","{state} · {reused} revision reused · {read} read{ledger}{failed} · {optimization}":"{state} · {reused} Revisionen wiederverwendet · {read} gelesen{ledger}{failed} · {optimization}","No records are old enough to archive":"Keine Datensätze sind alt genug für die Archivierung","Archive {count} records ({size}) across {months} months: {list}":"{count} Datensätze ({size}) über {months} Monate archivieren: {list}",", ":", ","Archived {count} records: {compressed} on disk (was {size})":"{count} Datensätze archiviert: {compressed} auf der Platte (vorher {size})","Some months could not be archived: {list}":"Einige Monate konnten nicht archiviert werden: {list}","Another DSH process is maintaining the ledger; try again in a moment":"Ein anderer DSH-Prozess wartet gerade das Ledger; bitte in einem Moment erneut versuchen","This storage does not support archiving":"Dieser Speicher unterstützt keine Archivierung","The ledger is not ready yet; try again in a moment":"Das Ledger ist noch nicht bereit; bitte in einem Moment erneut versuchen","Enter a number of days between 1 and 3650":"Bitte eine Anzahl Tage zwischen 1 und 3650 eingeben","Archiving failed; try again.":"Archivierung fehlgeschlagen; bitte erneut versuchen.",Maintenance:"Wartung","Close maintenance":"Wartung schließen","Sessions that have not changed for a while are folded into monthly compressed files. Totals, detail and filters stay the same, and archived records remain readable.":"Sitzungen, die längere Zeit unverändert sind, werden in monatliche komprimierte Dateien überführt. Summen, Details und Filter bleiben unverändert, und archivierte Datensätze bleiben lesbar.","Archive records older than":"Datensätze archivieren, die älter sind als",Days:"Tage","days without updates":"Tage ohne Aktualisierung","Planning…":"Planung läuft…",Preview:"Vorschau","Start archiving":"Archivierung starten","Archive {count} records? They stay readable in the panel, but this cannot be undone.":"{count} Datensätze archivieren? Sie bleiben im Panel lesbar, aber das lässt sich nicht rückgängig machen.","Yes, archive":"Ja, archivieren","Archive old records":"Alte Datensätze archivieren","Note: archived records stay readable and countable, but the first read of a month unpacks the whole month file, so the first start is slower; afterwards it stays in memory.":"Hinweis: Archivierte Datensätze bleiben lesbar und zählbar, aber beim ersten Lesen eines Monats wird die gesamte Monatsdatei entpackt, weshalb der erste Start länger dauert; danach bleibt sie im Speicher.","This Month":"Dieser Monat"},ru:{"\nChecked: ":"\nПроверено: ","\nClick to open the GitHub repository":"\nНажмите, чтобы открыть репозиторий на GitHub","\nNewest release v":"\nПоследняя версия v","\nThe host does not provide the version check yet (an older plugin is running): restart DSH":"\nХост ещё не предоставляет проверку версий (запущен старый плагин): перезапустите DSH","\nThis is the newest release":"\nЭто последняя версия","\nVersion check failed: ":"\nПроверка версии не удалась: ","\nWhether a newer release exists is not confirmed":"\nНаличие более новой версии не подтверждено"," (cached)":" (из кэша)"," (deleted)":" (удалено)"," (reseller route: static pricing until this row is mapped to the official entry)":" (маршрут реселлера: статичная цена, пока строка не сопоставлена с официальной записью)"," ({count} configured rows have no ledger usage)":" ({count} из них настроены, но без использования в реестре)"," ({count} failed to read)":" ({count} не удалось прочитать)"," ({count} rows have unknown usage: the host did not label ledger usage)":" ({count} из них с неизвестным использованием: хост не отметил использование в реестре)"," ({detail})":" («{detail}»)"," Click Refresh to try again":" Нажмите кнопку обновления, чтобы повторить"," and this page v":" и эта страница v"," and ≤ ":" и ≤ "," bands":" шт."," calls":" вызов."," days":" дн."," differ: DSH imports the plugin only at startup, so restart DSH for the new version (this panel is showing the older host payload)":" отличаются: DSH загружает плагин только при запуске, поэтому перезапустите DSH для новой версии (панель показывает данные старого хоста)"," holiday days":" дн. праздников"," rules":" шт."," tokens":" Token"," uses":" исп."," · capped at 500 rows":" · не более 500 строк"," · {count} failed":" · ошибок: {count}"," · {count} ledger restored":" · из реестра: {count}","), but the running host does not expose its rules yet; restart DSH to view and edit them.":"), но запущенный хост пока не отдаёт его правила; перезапустите DSH, чтобы просмотреть и изменить их.","12 months":"12 месяцев","30 days":"30 дней","90 days":"90 дней","Above a threshold, all four rates apply to the whole request":"Выше порога все четыре ставки применяются ко всему запросу","Above tokens":"Свыше Token",Actions:"Действия","Actual model":"Фактическая модель","Add band":"Добавить уровень","Add context rate band":"Добавить уровень тарификации контекста","Add rule":"Добавить правило","Add window":"Добавить окно",All:"Все","All Time":"Всё время","All available historical daily data can be selected. Dates follow this machine's time zone ({zone}). The heatmap switches between the last 30 days, 90 days and 12 months.":"Доступны все исторические данные по дням. Даты следуют часовому поясу этого компьютера ({zone}). Тепловая карта переключается между последними 30 днями, 90 днями и 12 месяцами.","All contexts":"Все контексты","All models":"Все модели","All providers":"Все провайдеры","All workspaces":"Все рабочие пространства",Apply:"Применить","Available after you enter a DeepSeek API key in Settings → Models":"Доступно после ввода ключа DeepSeek API в разделе Настройки → Модели",Band:"Уровень","Bands invalid":"Уровни некорректны",Bars:"Столбцы","Billing band":"Уровень тарификации","Billing band: ":"Уровень тарификации: ","Billing policy":"Политика тарификации","Billing time (UTC)":"Время тарификации (UTC)","Billing time source":"Источник времени тарификации","Built-in peak":"Встроенные пики","By Model":"По модели","By Provider":"По провайдеру","Cache Hit Rate":"Доля попаданий в кэш","Cache Hits":"Попадания в кэш","Cache hits":"Попадания в кэш","Cache read":"Чтение кэша","Cache read / 1M":"Чтение кэша / 1M","Cache write":"Запись кэша","Cache write / 1M":"Запись кэша / 1M","Cache writes":"Запись кэша","Cache-Hit Tokens":"Token попаданий в кэш","Cache-Write Tokens":"Token записи кэша",Calls:"Вызовы","Calls in {range}":"Вызовы: {range}",Cancel:"Отмена",Catalog:"Каталог","Change interface language":"Сменить язык интерфейса","Chart type":"Тип диаграммы","Checking…":"Проверка…","Chinese statutory holidays price as off-peak all day":"Государственные праздники Китая весь день тарифицируются как вне пика","Choose a date from {from} to {to}":"Выберите дату с {from} по {to}","Choose valid start and end dates":"Выберите корректные даты начала и окончания","Clear filters":"Сбросить фильтры","Clear mapping":"Очистить сопоставление","Click a point to inspect that day":"Нажмите точку, чтобы открыть день",Close:"Закрыть","Close Usage Statistics":"Закрыть статистику использования","Close cost settings":"Закрыть настройки стоимости",Collapse:"Свернуть","Combined View":"Сводный вид","Configure model prices and sync":"Настроить цены моделей и синхронизацию","Context rate bands":"Уровни тарификации контекста","Context reused {count} tokens":"Повторно использовано {count} Token","Context threshold tokens":"Порог контекста, Token","Context tiers":"Уровни контекста","Context tiers: ":"Уровни контекста: ","Context tiers: none, base rates apply to every context":"Уровни контекста: нет, для любого контекста действуют базовые ставки","Copy built-in table":"Скопировать встроенную таблицу",Cost:"Стоимость","Cost Settings":"Настройки стоимости","Cost Statistics":"Статистика стоимости","Cost multiplier":"Множитель стоимости","Cost multiplier; applied to the final total only":"Множитель стоимости; применяется только к итоговой сумме","Cost settings could not be saved; check the inputs":"Не удалось сохранить настройки стоимости; проверьте введённые данные","Cost status":"Статус стоимости","Current Streak":"Текущая серия",Custom:"Свой период","Custom date range":"Свой диапазон дат","Custom peak":"Свои пики","Custom rules":"Свои правила","DSH Usage Audit Export":"Экспорт аудита использования DSH","DSH Usage Statistics Export":"Экспорт статистики использования DSH",Daily:"По дням","Daily Token usage trend; select a date to view request logs":"Динамика использования Token по дням; выберите дату для журнала запросов","Data changed; reloading logs…":"Данные изменились, журнал перезагружается…",Date:"Дата","DeepSeek Account Balance":"Баланс аккаунта DeepSeek",Deleted:"Удалено","Display model":"Отображаемая модель","Effective after a mapping is set":"Действует после настройки сопоставления","Effective from (UTC, empty = all history)":"Действует с (UTC, пусто = вся история)","Enable 6-hour automatic sync":"Включить автосинхронизацию каждые 6 часов","Enable time-of-day pricing":"Включить тарификацию по времени суток","End date":"Дата окончания","End date must be on or after the start date":"Дата окончания не может быть раньше даты начала","End time":"Время окончания","Estimated Cost":"Оценка стоимости","Every ":"Каждые ","Every {count} weeks":"Каждые {count} нед.","Export CSV data for the current time range and model view":"Экспортировать данные CSV для текущего диапазона и режима просмотра моделей","Export Data":"Экспорт данных","Export current logs":"Экспорт текущего журнала","Export logs":"Экспорт журнала","Exported At":"Время экспорта","Exporting…":"Экспорт…","Fetch failed: ":"Ошибка получения: ","Fetch failed: network unavailable":"Ошибка получения: сеть недоступна","Fetching…":"Получение…","Filtered data unavailable":"Отфильтрованные данные недоступны","Fresh: input + cache read/write":"Fresh: вход + чтение/запись кэша","Full pricing settings could not be loaded":"Не удалось загрузить полные настройки тарифов","Granted ":"Подарено ","Grouped by Model":"С группировкой по модели","Grouped by Provider":"С группировкой по провайдеру","Heatmap span":"Диапазон тепловой карты","Historical scan completed {time}":"Сканирование истории завершено: {time}","Hit Rate":"Доля попаданий","Holiday off-peak":"Вне пика (праздник)","Host plugin v":"Плагин хоста v","Hourly Token usage trend; select an hour to view request logs":"Динамика использования Token по часам; выберите час для журнала запросов",Input:"Вход","Input / 1M":"Вход / 1M","Input Tokens":"Входные Token","Input semantics":"Семантика входа","Interface language":"Язык интерфейса","Invalid dates: use YYYY-MM-DD, or a start..end range":"Некорректные даты: используйте YYYY-MM-DD или диапазон start..end","Invalid mapping: pick an official model and enter a valid multiplier":"Некорректное сопоставление: выберите официальную модель и укажите допустимый множитель","Invalid price: enter all non-negative base rates":"Некорректная цена: укажите все неотрицательные базовые ставки","Invalid rate bands: maximum 32; thresholds must be increasing positive integers and all four rates must be complete and non-negative":"Некорректные уровни тарификации: максимум 32; пороги должны быть возрастающими положительными целыми числами, а все четыре ставки — заполнены и неотрицательны","Invalid time-of-day rules: a policy ID, at least one weekday and window per rule, HH:MM times with the end after the start, no overlapping windows on the same weekday, and all four rates filled in":"Некорректные правила по времени суток: нужен ID политики, в каждом правиле — хотя бы один день недели и одно окно, время в формате HH:MM с концом позже начала, окна в пределах одного дня недели не должны пересекаться, а все четыре ставки заполнены","Invalid year (2000-2100)":"Некорректный год (2000–2100)","Last 12 months":"Последние 12 месяцев","Last 30 Days":"Последние 30 дней","Last 30 days (larger cells)":"Последние 30 дней (крупные ячейки)","Last 7 Days":"Последние 7 дней","Last 90 Days":"Последние 90 дней","Last 90 days":"Последние 90 дней","Last success: ":"Последняя успешная: ","Last sync failed: ":"Последняя синхронизация не удалась: ","Latest v":"Последняя v","Ledger recovery":"Восстановление реестра","Ledger reuse":"Повторное использование реестра","Legacy: input + cache write":"Legacy: вход + запись кэша",Less:"Меньше",Line:"Линия",Live:"Онлайн","Load from public calendar":"Загрузить из публичного календаря","Load more":"Загрузить ещё","Loaded ":"Загружено ","Loading full pricing settings…":"Загрузка полных настроек тарифов…","Loading trend":"Загрузка динамики","Loading usage statistics…":"Загрузка статистики использования…","Loading…":"Загрузка…",Local:"Местный","Long range summarised: one point per period":"Длинный диапазон свёрнут: одна точка на период","Longest streak: {count} days":"Лучшая серия: {count} дн.","Lookup failed":"Ошибка запроса","Manage workspace aliases":"Управление псевдонимами рабочих пространств",Manual:"Ручная",Mapped:"Сопоставлено","Matching Calls":"Совпадающие вызовы","Maximum 32 bands per model":"Не более 32 уровней на модель","Methodology: one cell lights up for each completed turn, including subagent sessions. Hover to view workspace details; click a workspace to filter the heatmap and detail tables. Dates and day boundaries follow this machine's time zone.":"Методика: одна ячейка загорается за каждый завершённый ход, включая сессии субагентов. Наведите курсор, чтобы увидеть детали по рабочим пространствам; нажмите на пространство, чтобы отфильтровать тепловую карту и таблицы деталей. Даты и границы дней считаются по часовому поясу этого компьютера.",Model:"Модель","Model Filter":"Фильтр моделей","Model Stats":"Статистика по моделям","Model Usage":"Использование по моделям","Model Usage Details":"Детали использования по моделям","Model Usage Details ({range})":"Детали использования по моделям ({range})","Model View Mode":"Режим просмотра моделей","Model filter":"Фильтр моделей",Monthly:"По месяцам",More:"Больше",Multiplier:"Множитель","No auditable Token calls in this scope":"В этой области нет проверяемых вызовов Token","No bands configured; base rates apply to every context.":"Уровни не настроены; для любого контекста действуют базовые ставки.","No data":"Нет данных","No data yet":"Пока нет данных","No ledger usage":"В реестре нет использования","No model usage yet":"Пока нет использования по моделям","No pricing":"Нет цены","No time-of-day rules":"Нет правил по времени суток","No time-of-day rules: every request uses the row base rates.":"Правила по времени суток не заданы: для всех запросов действуют базовые ставки строки.","No trend data in this range":"В этом диапазоне нет данных о динамике","No usage recorded yet. This area will light up after you start a conversation.":"Использование пока не записано. Эта область загорится, когда вы начнёте разговор.","No usage records for this day":"Нет записей за этот день","No usage records in this time range":"В этом диапазоне нет записей об использовании","No usage records with model-routing information yet":"Пока нет записей об использовании с данными о маршрутизации модели","No workspaces yet":"Пока нет рабочих пространств","Not a ledger route":"Не из реестра","Not configured":"Не настроено","Not synced yet":"Ещё не синхронизировано",OFF:"Вне пика","Off-peak":"Вне пика","Off-peak (no rule match) uses the row base rates, peak uses the rule rates. Weekdays and times are UTC.":"Вне пика (нет совпадения с правилом) действуют базовые ставки строки, в пик — ставки правила. Дни недели и время — по UTC.","Official model / mapping":"Официальная модель / сопоставление","Official model ID":"ID официальной модели","Official model matches":"Совпадения официальных моделей","One date per line (YYYY-MM-DD); ranges such as 2026-10-01..2026-10-07 are expanded. Days follow the China Standard Time (UTC+8) calendar; swapped-in working weekends are not detected, so remove them yourself.":"По одной дате в строке (YYYY-MM-DD); диапазоны вида 2026-10-01..2026-10-07 раскрываются. Дни считаются по календарю China Standard Time (UTC+8); перенесённые рабочие выходные не распознаются — уберите их вручную.",Other:"Другое",Output:"Выход","Output / 1M":"Выход / 1M","Output Tokens":"Выходные Token",Path:"Путь",Peak:"Пик","Peak invalid":"Пики некорректны","Peak plan ":"План пиковых тарифов ","Peak plan invalid":"План пиковых тарифов некорректен","Peak ·":"Пик ·","Plan: ":"План: ","Policy ID":"ID политики","Policy hash":"Хеш политики","Press Enter to save one; clear an alias to restore the folder name":"Нажмите Enter, чтобы сохранить; очистите псевдоним, чтобы вернуть имя папки","Price per 1M tokens in USD":"Цена за 1M Token в USD","Prices are USD per 1M tokens. Editing a price box creates or updates a manual price (every row priced from the same official model shares it). Picking an official model in the mapping column switches the row to the catalog price. Bands add context-dependent rates; Time-of-day adds UTC peak rules.":"Цены указаны в USD за 1M Token. Изменение поля цены создаёт или обновляет ручную цену (её используют все строки, оценённые по той же официальной модели). Выбор официальной модели в столбце сопоставления переключает строку на цену из каталога. Уровни задают ставки в зависимости от контекста; тарификация по времени суток добавляет правила пиков по UTC.","Pricing model":"Модель тарификации","Pricing model: ":"Модель тарификации: ","Project alias":"Псевдоним проекта",Provider:"Провайдер","Provider / Model":"Провайдер / модель","Provider Filter":"Фильтр провайдеров","Provider Usage":"Использование по провайдерам","Provider filter":"Фильтр провайдеров",Reasoning:"Рассуждения","Reasoning Tokens":"Token рассуждений","Refresh usage statistics":"Обновить статистику использования","Refreshing data":"Обновление данных","Refreshing…":"Обновление…","Remove rate band":"Удалить уровень тарификации","Remove rule":"Удалить правило","Remove rules":"Удалить правила","Remove the manual price and fall back to the catalog or the built-in peak table":"Удалить ручную цену и вернуться к каталогу или встроенной таблице пиков","Remove this row mapping and fall back to automatic model matching":"Удалить сопоставление этой строки и вернуться к автоматическому подбору модели","Remove window":"Удалить окно","Replace with custom rules":"Заменить своими правилами","Request Logs":"Журнал запросов","Requested model":"Запрошенная модель",Reset:"Сбросить","Restore built-in":"Восстановить встроенную",Retry:"Повторить","Running version v":"Текущая версия v",Save:"Сохранить","Save All":"Сохранить все","Save and backfill":"Сохранить и дозаполнить","Saving affects unpriced and future calls only; existing positive costs are never recalculated. Changing a peak plan reconciles that model history against the new rules.":"Сохранение влияет только на неоценённые и будущие вызовы; уже рассчитанная положительная стоимость никогда не пересчитывается. Изменение плана пиковых тарифов сверяет историю этой модели с новыми правилами.","Saving…":"Сохранение…",Scan:"Сканирование","Scanning historical sessions: {scanned} / {total}{failed}":"Сканирование исторических сессий: {scanned} / {total}{failed}",Scope:"Область","See the details table for the other {count} workspaces":"Прочие рабочие пространства в таблице деталей: {count}","Selected call":"Выбранный вызов",Sessions:"Сессии",Share:"Доля",Source:"Источник","Source: ":"Источник: ","Star this plugin on GitHub":"Поставить звезду плагину на GitHub","Start date":"Дата начала","Start time":"Время начала","Stats Revision":"Версия статистики","Statutory holiday dates":"Даты государственных праздников",Summary:"Сводка","Sync now":"Синхронизировать","Syncing…":"Синхронизация…","The DeepSeek API reported that balance information is unavailable":"DeepSeek API сообщил, что информация о балансе недоступна","The cost settings are too large to save: trim bands or peak rules":"Настройки стоимости слишком велики для сохранения: сократите уровни или правила пиков","The host did not label ledger usage for this row (usually an older host plugin); it does not mean the row has none":"Хост не отметил использование в реестре для этой строки (обычно из-за старой версии плагина хоста); это не значит, что его нет","The host sent no model list (older plugin): the ledger models cannot be listed; restart DSH and reopen this panel":"Хост не передал список моделей (старая версия плагина): модели реестра недоступны; перезапустите DSH и откройте панель снова","The process capability is unavailable; refresh the dashboard":"Токен процесса недоступен; обновите панель","The rules are incomplete; fix them before saving.":"Правила заполнены не полностью; исправьте их перед сохранением.","The selected range failed to render; the sidebar entry is still available.":"Выбранный диапазон не удалось отобразить; запись в боковой панели остаётся доступной.","This band covers ":"Уровень охватывает ","This row already uses a peak plan (":"В этой строке уже используется план пиковых тарифов (",Time:"Время","Time Range":"Диапазон времени","Time tiers":"Уровни времени","Time tiers: ":"Уровни времени: ","Time-of-day pricing (UTC)":"Тарификация по времени суток (UTC)",Timezone:"Часовой пояс",Today:"Сегодня","Token Usage Trend":"Динамика использования Token","Token calls are newest first; select a row to inspect its turn / step and token buckets.":"Вызовы Token — сначала новые; выберите строку, чтобы увидеть ход / шаг и разбивку Token.","Token threshold":"Порог Token","Tokens: Input {input} · Cache hits {cache} · Output {output}":"Token: вход {input} · попадания в кэш {cache} · выход {output}","Top-up ":"Пополнено ",Total:"Всего","Total Processed":"Всего обработано","Total Requests":"Всего запросов","Total Tokens Processed":"Всего обработано Token","Total Tokens Processed by Workspace":"Всего обработано Token по рабочим пространствам","Total Uses":"Всего использований","Total tokens processed = input + output + cache reads/writes + reasoning. Cache hits represent reused context; they are not newly generated tokens or actual cost. Costs are estimated at event time from official price lists and do not equal the provider invoice.":"Всего обработано Token = вход + выход + чтение/запись кэша + рассуждения. Попадания в кэш — это повторно использованный контекст, а не новые Token и не фактическая стоимость. Стоимость оценивается на момент события по официальным прайс-листам и не равна счёту провайдера.","Total: input already includes cache":"Total: вход уже включает кэш","Trend data unavailable":"Данные о динамике недоступны",Turns:"Ходы","Turns in {range}":"Ходы: {range}","Type an official model ID":"Введите ID официальной модели","Unable to export logs":"Не удалось экспортировать журнал","Unable to load logs":"Не удалось загрузить журнал","Unable to load usage statistics. Please retry.":"Не удалось загрузить статистику использования. Повторите попытку.",Unavailable:"Недоступно","Unified filters":"Единые фильтры",Unknown:"Неизвестно","Unknown model":"Неизвестная модель","Unknown provider":"Неизвестный провайдер","Unknown workspace":"Неизвестное рабочее пространство","Up to date":"Актуально","Update state pending":"Ожидание обновления","Updated {time}":"Обновлено {time}","Updating filtered data…":"Обновление отфильтрованных данных…","Usage Heatmap":"Тепловая карта использования","Usage Statistics":"Статистика использования","Usage before this instant has no applicable band and fails closed as unpriced.":"Для использования до этого момента нет применимого уровня — оно остаётся без цены.","Usage data may be stale":"Данные об использовании могли устареть","Usage data may be stale; last full update {time}":"Данные об использовании могли устареть; последнее полное обновление: {time}","Usage detail views":"Детальные представления использования","Usage heatmap calendar: arrow keys to browse, Enter for the day detail":"Календарь тепловой карты: стрелки для навигации, Enter для деталей дня","Usage statistics is temporarily unavailable":"Статистика использования временно недоступна","Usage unknown":"Использование неизвестно","Using the built-in DeepSeek peak table":"Используется встроенная таблица пиков DeepSeek",Weekly:"По неделям",Workspace:"Рабочее пространство","Workspace Aliases":"Псевдонимы рабочих пространств","Workspace Details":"Детали по рабочим пространствам","Workspace Details ({range})":"Детали по рабочим пространствам ({range})","Workspace Filter":"Фильтр рабочих пространств","Workspace Stats":"Статистика по рабочим пространствам","Workspace Usage":"Использование по рабочим пространствам","Workspace filter":"Фильтр рабочих пространств","Write rejected: the permission check failed (a stale process capability is also possible); refresh the dashboard and retry":"Запись отклонена: проверка прав не пройдена (возможно, токен процесса устарел); обновите панель и повторите","Write rejected: the process capability had rotated and the automatic retry still failed; refresh the dashboard":"Запись отклонена: токен процесса обновился, и автоматический повтор не удался; обновите панель",Year:"Год","Year to load":"Год для загрузки",Yearly:"По годам",ambiguous:"неоднозначно","at ":"в ","built-in DeepSeek peak table":"встроенная таблица пиков DeepSeek","custom ":"Свои правила: ","custom rules":"свои правила","full-read fallback":"откат на полное чтение","models.dev sync failed; the last good catalog and unsaved edits were kept":"Синхронизация с models.dev не удалась; сохранены последний удачный каталог и несохранённые правки","no usage":"нет использования","not enabled":"не включено","parsed ":"распознано ",peak:"пик","peak plan ":"План пиковых тарифов ",priced:"с ценой","revision optimization on":"оптимизация версий вкл.","static (no band plan)":"статичная цена (без плана пиков)","static (non-first-party)":"статичная цена (не прямой канал)","tiered ":"уровней: ",tokens:"Token",unpriced:"без цены",unsupported:"не поддерживается","{count} days":"{count} дн.","{count} models":"моделей: {count}","{count} priced":"{count} с ценой","{count} records shown":"Показано записей: {count}","{count} sessions":"Сессий: {count}","{count} shown; load more for additional records":"Показано {count}; загрузите ещё, чтобы увидеть остальные","{count} unpriced":"{count} без цены","{count} uses":"{count} исп.","{date}: {amount}":"{date} — {amount}","{label}: Combined View distinguishes “Provider / Model”; By Model merges identically named models across providers; By Provider aggregates all of a provider’s models. Historical records without routing information are grouped as “Unknown.”":"{label}: «Сводный вид» различает «провайдер / модель»; «По модели» объединяет одноимённые модели разных провайдеров; «По провайдеру» агрегирует все модели провайдера. Исторические записи без данных о маршрутизации группируются как «Неизвестно».","{range} · {count}{kind} · includes cache reads/writes and reasoning":"{range} · {count}{kind} · включая чтение/запись кэша и рассуждения","{start} to {end} (UTC)":"с {start} по {end} (UTC)","{state} · {reused} revision reused · {read} read{ledger}{failed} · {optimization}":"{state} · переиспользовано версий: {reused} · прочитано: {read}{ledger}{failed} · {optimization}","No records are old enough to archive":"Нет записей, достаточно старых для архивации","Archive {count} records ({size}) across {months} months: {list}":"Архивировать {count} записей ({size}) за {months} мес.: {list}",", ":", ","Archived {count} records: {compressed} on disk (was {size})":"Архивировано {count} записей: {compressed} на диске (было {size})","Some months could not be archived: {list}":"Некоторые месяцы не удалось архивировать: {list}","Another DSH process is maintaining the ledger; try again in a moment":"Другой процесс DSH обслуживает реестр; повторите попытку через минуту","This storage does not support archiving":"Это хранилище не поддерживает архивацию","The ledger is not ready yet; try again in a moment":"Реестр ещё не готов; повторите попытку через минуту","Enter a number of days between 1 and 3650":"Введите число дней от 1 до 3650","Archiving failed; try again.":"Не удалось архивировать; повторите попытку.",Maintenance:"Обслуживание","Close maintenance":"Закрыть обслуживание","Sessions that have not changed for a while are folded into monthly compressed files. Totals, detail and filters stay the same, and archived records remain readable.":"Сессии, которые давно не менялись, сворачиваются в помесячные сжатые файлы. Итоги, детализация и фильтры не меняются, а архивные записи остаются доступными для просмотра.","Archive records older than":"Архивировать записи старше",Days:"Дней","days without updates":"дней без обновлений","Planning…":"Планирование…",Preview:"Предпросмотр","Start archiving":"Начать архивацию","Archive {count} records? They stay readable in the panel, but this cannot be undone.":"Архивировать {count} записей? Они останутся доступными в панели, но это действие нельзя отменить.","Yes, archive":"Да, архивировать","Archive old records":"Архивировать старые записи","Note: archived records stay readable and countable, but the first read of a month unpacks the whole month file, so the first start is slower; afterwards it stays in memory.":"Примечание: архивные записи остаются доступными для чтения и подсчёта, но при первом чтении месяца распаковывается весь файл месяца, поэтому первый запуск идёт медленнее; затем он остаётся в памяти.","This Month":"Этот месяц"},pt:{"\nChecked: ":"\nVerificado em: ","\nClick to open the GitHub repository":"\nClique para abrir o repositório no GitHub","\nNewest release v":"\nVersão mais recente v","\nThe host does not provide the version check yet (an older plugin is running): restart DSH":"\nO host ainda não fornece a verificação de versão (plugin mais antigo em execução): reinicie o DSH","\nThis is the newest release":"\nEsta é a versão mais recente","\nVersion check failed: ":"\nFalha na verificação de versão: ","\nWhether a newer release exists is not confirmed":"\nNão está confirmado se existe uma versão mais recente"," (cached)":" (em cache)"," (deleted)":" (excluído)"," (reseller route: static pricing until this row is mapped to the official entry)":" (rota de revenda: preço estático até que esta linha seja mapeada para a entrada oficial)"," ({count} configured rows have no ledger usage)":" ({count} linhas configuradas sem uso no registro)"," ({count} failed to read)":" ({count} falhas de leitura)"," ({count} rows have unknown usage: the host did not label ledger usage)":" ({count} linhas com uso desconhecido: o host não marcou o uso no registro)"," ({detail})":" ({detail})"," Click Refresh to try again":" Clique em Atualizar para tentar novamente"," and this page v":" e esta página v"," and ≤ ":" e ≤ "," bands":" faixas"," calls":" chamadas"," days":" dias"," differ: DSH imports the plugin only at startup, so restart DSH for the new version (this panel is showing the older host payload)":" diferem: o DSH importa o plugin apenas na inicialização, então reinicie o DSH para a nova versão (este painel está mostrando os dados do host antigo)"," holiday days":" dias de feriado"," rules":" regras"," tokens":" Tokens"," uses":" usos"," · capped at 500 rows":" · limitado a 500 linhas"," · {count} failed":" · {count} com falha"," · {count} ledger restored":" · {count} restauradas do registro","), but the running host does not expose its rules yet; restart DSH to view and edit them.":"), mas o host em execução ainda não expõe suas regras; reinicie o DSH para vê-las e editá-las.","12 months":"12 meses","30 days":"30 dias","90 days":"90 dias","Above a threshold, all four rates apply to the whole request":"Acima de um limiar, as quatro tarifas se aplicam à requisição inteira","Above tokens":"Limiar de Tokens",Actions:"Ações","Actual model":"Modelo real","Add band":"Adicionar faixa","Add context rate band":"Adicionar faixa de tarifa por contexto","Add rule":"Adicionar regra","Add window":"Adicionar janela",All:"Todos","All Time":"Todo o período","All available historical daily data can be selected. Dates follow this machine's time zone ({zone}). The heatmap switches between the last 30 days, 90 days and 12 months.":"Todos os dados diários históricos disponíveis podem ser selecionados. As datas seguem o fuso horário deste computador ({zone}). O mapa de calor alterna entre os últimos 30 dias, 90 dias e 12 meses.","All contexts":"Todos os contextos","All models":"Todos os modelos","All providers":"Todos os provedores","All workspaces":"Todas as áreas de trabalho",Apply:"Aplicar","Available after you enter a DeepSeek API key in Settings → Models":"Disponível após inserir uma chave de API da DeepSeek em Configurações → Modelos",Band:"Faixa","Bands invalid":"Faixas inválidas",Bars:"Barras","Billing band":"Faixa de cobrança","Billing band: ":"Faixa de cobrança: ","Billing policy":"Política de cobrança","Billing time (UTC)":"Hora de cobrança (UTC)","Billing time source":"Origem da hora de cobrança","Built-in peak":"Pico integrado","By Model":"Por modelo","By Provider":"Por provedor","Cache Hit Rate":"Taxa de acerto de cache","Cache Hits":"Acertos de cache","Cache hits":"Acertos de cache","Cache read":"Leitura de cache","Cache read / 1M":"Leitura de cache / 1M","Cache write":"Gravação de cache","Cache write / 1M":"Gravação de cache / 1M","Cache writes":"Gravações de cache","Cache-Hit Tokens":"Tokens de acerto de cache","Cache-Write Tokens":"Tokens de gravação de cache",Calls:"Chamadas","Calls in {range}":"Chamadas: {range}",Cancel:"Cancelar",Catalog:"Catálogo","Change interface language":"Alterar o idioma da interface","Chart type":"Tipo de gráfico","Checking…":"Verificando…","Chinese statutory holidays price as off-peak all day":"Feriados nacionais chineses são cobrados como fora de pico o dia todo","Choose a date from {from} to {to}":"Escolha uma data de {from} a {to}","Choose valid start and end dates":"Escolha datas de início e término válidas","Clear filters":"Limpar filtros","Clear mapping":"Limpar mapeamento","Click a point to inspect that day":"Clique em um ponto para inspecionar esse dia",Close:"Fechar","Close Usage Statistics":"Fechar estatísticas de uso","Close cost settings":"Fechar configurações de custo",Collapse:"Recolher","Combined View":"Visão combinada","Configure model prices and sync":"Configurar preços dos modelos e sincronização","Context rate bands":"Faixas de tarifa por contexto","Context reused {count} tokens":"Contexto reutilizado {count} Tokens","Context threshold tokens":"Tokens do limiar de contexto","Context tiers":"Níveis de contexto","Context tiers: ":"Níveis de contexto: ","Context tiers: none, base rates apply to every context":"Níveis de contexto: nenhum, as tarifas base se aplicam a todos os contextos","Copy built-in table":"Copiar tabela integrada",Cost:"Custo","Cost Settings":"Configurações de custo","Cost Statistics":"Estatísticas de custo","Cost multiplier":"Multiplicador de custo","Cost multiplier; applied to the final total only":"Multiplicador de custo; aplicado apenas ao total final","Cost settings could not be saved; check the inputs":"Não foi possível salvar as configurações de custo; verifique os campos","Cost status":"Status de custo","Current Streak":"Sequência atual",Custom:"Personalizado","Custom date range":"Intervalo de datas personalizado","Custom peak":"Pico personalizado","Custom rules":"Regras personalizadas","DSH Usage Audit Export":"Exportação de auditoria de uso do DSH","DSH Usage Statistics Export":"Exportação de estatísticas de uso do DSH",Daily:"Diário","Daily Token usage trend; select a date to view request logs":"Tendência de uso de Tokens por dia; selecione uma data para ver os logs de requisições","Data changed; reloading logs…":"Dados alterados; recarregando logs…",Date:"Data","DeepSeek Account Balance":"Saldo da conta DeepSeek",Deleted:"Excluído","Display model":"Modelo exibido","Effective after a mapping is set":"Válido após definir um mapeamento","Effective from (UTC, empty = all history)":"Válido a partir de (UTC, vazio = todo o histórico)","Enable 6-hour automatic sync":"Ativar sincronização automática a cada 6 horas","Enable time-of-day pricing":"Ativar precificação por horário","End date":"Data de término","End date must be on or after the start date":"A data de término deve ser igual ou posterior à data de início","End time":"Hora de término","Estimated Cost":"Custo estimado","Every ":"A cada ","Every {count} weeks":"A cada {count} semanas","Export CSV data for the current time range and model view":"Exportar dados CSV do intervalo de tempo e do modo de visualização de modelos atuais","Export Data":"Exportar dados","Export current logs":"Exportar logs atuais","Export logs":"Exportar logs","Exported At":"Exportado em","Exporting…":"Exportando…","Fetch failed: ":"Falha ao buscar: ","Fetch failed: network unavailable":"Falha ao buscar: rede indisponível","Fetching…":"Buscando…","Filtered data unavailable":"Dados filtrados indisponíveis","Fresh: input + cache read/write":"Fresh: entrada + leitura/gravação de cache","Full pricing settings could not be loaded":"Não foi possível carregar as configurações completas de preços","Granted ":"Concedido ","Grouped by Model":"Agrupado por modelo","Grouped by Provider":"Agrupado por provedor","Heatmap span":"Intervalo do mapa de calor","Historical scan completed {time}":"Varredura histórica concluída em {time}","Hit Rate":"Taxa de acerto","Holiday off-peak":"Feriado fora de pico","Host plugin v":"Plugin do host v","Hourly Token usage trend; select an hour to view request logs":"Tendência de uso de Tokens por hora; selecione uma hora para ver os logs de requisições",Input:"Entrada","Input / 1M":"Entrada / 1M","Input Tokens":"Tokens de entrada","Input semantics":"Semântica de entrada","Interface language":"Idioma da interface","Invalid dates: use YYYY-MM-DD, or a start..end range":"Datas inválidas: use YYYY-MM-DD ou um intervalo início..fim","Invalid mapping: pick an official model and enter a valid multiplier":"Mapeamento inválido: selecione um modelo oficial e informe um multiplicador válido","Invalid price: enter all non-negative base rates":"Preço inválido: informe todas as tarifas base não negativas","Invalid rate bands: maximum 32; thresholds must be increasing positive integers and all four rates must be complete and non-negative":"Faixas de tarifa inválidas: máximo de 32; os limiares devem ser inteiros positivos crescentes e as quatro tarifas devem estar completas e não negativas","Invalid time-of-day rules: a policy ID, at least one weekday and window per rule, HH:MM times with the end after the start, no overlapping windows on the same weekday, and all four rates filled in":"Regras de horário inválidas: um ID de política, ao menos um dia da semana e uma janela por regra, horários HH:MM com o término depois do início, sem janelas sobrepostas no mesmo dia da semana e as quatro tarifas preenchidas","Invalid year (2000-2100)":"Ano inválido (2000-2100)","Last 12 months":"Últimos 12 meses","Last 30 Days":"Últimos 30 dias","Last 30 days (larger cells)":"Últimos 30 dias (células maiores)","Last 7 Days":"Últimos 7 dias","Last 90 Days":"Últimos 90 dias","Last 90 days":"Últimos 90 dias","Last success: ":"Último sucesso: ","Last sync failed: ":"Falha na última sincronização: ","Latest v":"Mais recente v","Ledger recovery":"Recuperação do registro","Ledger reuse":"Reutilização do registro","Legacy: input + cache write":"Legacy: entrada + gravação de cache",Less:"Menos",Line:"Linha",Live:"Ao vivo","Load from public calendar":"Carregar do calendário público","Load more":"Carregar mais","Loaded ":"Carregados ","Loading full pricing settings…":"Carregando configurações completas de preços…","Loading trend":"Carregando tendência","Loading usage statistics…":"Carregando estatísticas de uso…","Loading…":"Carregando…",Local:"Local","Long range summarised: one point per period":"Intervalo longo resumido: um ponto por período","Longest streak: {count} days":"Maior sequência: {count} dias","Lookup failed":"Falha na consulta","Manage workspace aliases":"Gerenciar aliases de áreas de trabalho",Manual:"Manual",Mapped:"Mapeado","Matching Calls":"Chamadas correspondentes","Maximum 32 bands per model":"Máximo de 32 faixas por modelo","Methodology: one cell lights up for each completed turn, including subagent sessions. Hover to view workspace details; click a workspace to filter the heatmap and detail tables. Dates and day boundaries follow this machine's time zone.":"Critério: uma célula se acende a cada turno concluído, incluindo sessões de subagentes. Passe o mouse para ver os detalhes por área de trabalho; clique em uma área de trabalho para filtrar o mapa de calor e as tabelas de detalhes. As datas e os limites de dia seguem o fuso horário deste computador.",Model:"Modelo","Model Filter":"Filtro de modelo","Model Stats":"Estatísticas por modelo","Model Usage":"Uso por modelo","Model Usage Details":"Detalhes de uso por modelo","Model Usage Details ({range})":"Detalhes de uso por modelo ({range})","Model View Mode":"Modo de visualização de modelos","Model filter":"Filtro de modelo",Monthly:"Mensal",More:"Mais",Multiplier:"Multiplicador","No auditable Token calls in this scope":"Nenhuma chamada de Tokens auditável neste escopo","No bands configured; base rates apply to every context.":"Nenhuma faixa configurada; as tarifas base se aplicam a todos os contextos.","No data":"Sem dados","No data yet":"Ainda sem dados","No ledger usage":"Sem uso no registro","No model usage yet":"Ainda sem uso por modelo","No pricing":"Sem preço","No time-of-day rules":"Sem regras de horário","No time-of-day rules: every request uses the row base rates.":"Sem regras de horário: todas as requisições usam as tarifas base da linha.","No trend data in this range":"Nenhum dado de tendência neste intervalo","No usage recorded yet. This area will light up after you start a conversation.":"Ainda não há uso registrado. Esta área vai se acender quando você iniciar uma conversa.","No usage records for this day":"Nenhum registro de uso neste dia","No usage records in this time range":"Nenhum registro de uso neste intervalo de tempo","No usage records with model-routing information yet":"Ainda não há registros de uso com informações de roteamento de modelos","No workspaces yet":"Ainda sem áreas de trabalho","Not a ledger route":"Não é uma rota do registro","Not configured":"Não configurado","Not synced yet":"Ainda não sincronizado",OFF:"FORA","Off-peak":"Fora de pico","Off-peak (no rule match) uses the row base rates, peak uses the rule rates. Weekdays and times are UTC.":"Fora de pico (sem regra correspondente) usa as tarifas base da linha; pico usa as tarifas da regra. Dias da semana e horários são em UTC.","Official model / mapping":"Modelo oficial / mapeamento","Official model ID":"ID do modelo oficial","Official model matches":"Correspondências de modelo oficial","One date per line (YYYY-MM-DD); ranges such as 2026-10-01..2026-10-07 are expanded. Days follow the China Standard Time (UTC+8) calendar; swapped-in working weekends are not detected, so remove them yourself.":"Uma data por linha (YYYY-MM-DD); intervalos como 2026-10-01..2026-10-07 são expandidos. Os dias seguem o calendário do Horário Padrão da China (UTC+8); fins de semana compensatórios de trabalho não são detectados, então remova-os manualmente.",Other:"Outro",Output:"Saída","Output / 1M":"Saída / 1M","Output Tokens":"Tokens de saída",Path:"Caminho",Peak:"Pico","Peak invalid":"Pico inválido","Peak plan ":"Plano de pico ","Peak plan invalid":"Plano de pico inválido","Peak ·":"Pico ·","Plan: ":"Plano: ","Policy ID":"ID da política","Policy hash":"Hash da política","Press Enter to save one; clear an alias to restore the folder name":"Pressione Enter para salvar cada alias; limpe um alias para restaurar o nome da pasta","Price per 1M tokens in USD":"Preço por 1M de Tokens em USD","Prices are USD per 1M tokens. Editing a price box creates or updates a manual price (every row priced from the same official model shares it). Picking an official model in the mapping column switches the row to the catalog price. Bands add context-dependent rates; Time-of-day adds UTC peak rules.":"Os preços são em USD por 1M de Tokens. Editar um campo de preço cria ou atualiza um preço manual (todas as linhas com o mesmo modelo oficial o compartilham). Escolher um modelo oficial na coluna de mapeamento muda a linha para o preço do catálogo. As faixas adicionam tarifas por contexto; a precificação por horário adiciona regras de pico em UTC.","Pricing model":"Modelo de preço","Pricing model: ":"Modelo de preço: ","Project alias":"Alias do projeto",Provider:"Provedor","Provider / Model":"Provedor / Modelo","Provider Filter":"Filtro de provedor","Provider Usage":"Uso por provedor","Provider filter":"Filtro de provedor",Reasoning:"Raciocínio","Reasoning Tokens":"Tokens de raciocínio","Refresh usage statistics":"Atualizar estatísticas de uso","Refreshing data":"Atualizando dados","Refreshing…":"Atualizando…","Remove rate band":"Remover faixa de tarifa","Remove rule":"Remover regra","Remove rules":"Remover regras","Remove the manual price and fall back to the catalog or the built-in peak table":"Remover o preço manual e voltar ao catálogo ou à tabela de pico integrada","Remove this row mapping and fall back to automatic model matching":"Remove o mapeamento desta linha e volta à correspondência automática de modelos","Remove window":"Remover janela","Replace with custom rules":"Substituir por regras personalizadas","Request Logs":"Logs de requisições","Requested model":"Modelo solicitado",Reset:"Redefinir","Restore built-in":"Restaurar tabela integrada",Retry:"Tentar novamente","Running version v":"Versão em execução v",Save:"Salvar","Save All":"Salvar tudo","Save and backfill":"Salvar e preencher retroativamente","Saving affects unpriced and future calls only; existing positive costs are never recalculated. Changing a peak plan reconciles that model history against the new rules.":"Salvar afeta apenas chamadas sem preço e chamadas futuras; custos positivos existentes nunca são recalculados. Alterar um plano de pico reconcilia o histórico desse modelo com as novas regras.","Saving…":"Salvando…",Scan:"Varredura","Scanning historical sessions: {scanned} / {total}{failed}":"Varrendo sessões históricas: {scanned} / {total}{failed}",Scope:"Escopo","See the details table for the other {count} workspaces":"Demais {count} áreas de trabalho na tabela de detalhes","Selected call":"Chamada selecionada",Sessions:"Sessões",Share:"Participação",Source:"Origem","Source: ":"Origem: ","Star this plugin on GitHub":"Dar uma estrela a este plugin no GitHub","Start date":"Data de início","Start time":"Hora de início","Stats Revision":"Revisão das estatísticas","Statutory holiday dates":"Datas de feriados nacionais",Summary:"Resumo","Sync now":"Sincronizar agora","Syncing…":"Sincronizando…","The DeepSeek API reported that balance information is unavailable":"A API da DeepSeek informou que as informações de saldo não estão disponíveis","The cost settings are too large to save: trim bands or peak rules":"As configurações de custo são grandes demais para salvar: reduza faixas ou regras de pico","The host did not label ledger usage for this row (usually an older host plugin); it does not mean the row has none":"O host não marcou o uso no registro desta linha (normalmente um plugin de host mais antigo); isso não significa que a linha não tenha uso","The host sent no model list (older plugin): the ledger models cannot be listed; restart DSH and reopen this panel":"O host não enviou a lista de modelos (plugin mais antigo): não é possível listar os modelos do registro; reinicie o DSH e reabra este painel","The process capability is unavailable; refresh the dashboard":"A capacidade do processo não está disponível; atualize o painel","The rules are incomplete; fix them before saving.":"As regras estão incompletas; corrija-as antes de salvar.","The selected range failed to render; the sidebar entry is still available.":"Falha ao renderizar o intervalo selecionado; a entrada na barra lateral continua disponível.","This band covers ":"Esta faixa cobre ","This row already uses a peak plan (":"Esta linha já usa um plano de pico (",Time:"Hora","Time Range":"Intervalo de tempo","Time tiers":"Níveis de horário","Time tiers: ":"Níveis de horário: ","Time-of-day pricing (UTC)":"Precificação por horário (UTC)",Timezone:"Fuso horário",Today:"Hoje","Token Usage Trend":"Tendência de uso de Tokens","Token calls are newest first; select a row to inspect its turn / step and token buckets.":"As chamadas de Tokens vêm da mais recente para a mais antiga; selecione uma linha para ver seu turno / etapa e os grupos de Tokens.","Token threshold":"Limiar de Tokens","Tokens: Input {input} · Cache hits {cache} · Output {output}":"Tokens: entrada {input} · acertos de cache {cache} · saída {output}","Top-up ":"Recarga ",Total:"Total","Total Processed":"Total processado","Total Requests":"Total de requisições","Total Tokens Processed":"Total de Tokens processados","Total Tokens Processed by Workspace":"Total de Tokens processados por área de trabalho","Total Uses":"Total de usos","Total tokens processed = input + output + cache reads/writes + reasoning. Cache hits represent reused context; they are not newly generated tokens or actual cost. Costs are estimated at event time from official price lists and do not equal the provider invoice.":"Total de Tokens processados = entrada + saída + leituras/gravações de cache + raciocínio. Os acertos de cache representam contexto reutilizado; não são Tokens recém-gerados nem custo real. Os custos são estimados no momento do evento com base nas listas de preços oficiais e não equivalem à fatura do provedor.","Total: input already includes cache":"Total: a entrada já inclui o cache","Trend data unavailable":"Dados de tendência indisponíveis",Turns:"Turnos","Turns in {range}":"Turnos: {range}","Type an official model ID":"Digite um ID de modelo oficial","Unable to export logs":"Não foi possível exportar os logs","Unable to load logs":"Não foi possível carregar os logs","Unable to load usage statistics. Please retry.":"Não foi possível carregar as estatísticas de uso. Tente novamente.",Unavailable:"Indisponível","Unified filters":"Filtros unificados",Unknown:"Desconhecido","Unknown model":"Modelo desconhecido","Unknown provider":"Provedor desconhecido","Unknown workspace":"Área de trabalho desconhecida","Up to date":"Atualizado","Update state pending":"Atualização pendente","Updated {time}":"Atualizado em {time}","Updating filtered data…":"Atualizando dados filtrados…","Usage Heatmap":"Mapa de calor de uso","Usage Statistics":"Estatísticas de uso","Usage before this instant has no applicable band and fails closed as unpriced.":"O uso anterior a este momento não tem faixa aplicável e falha fechado como sem preço.","Usage data may be stale":"Os dados de uso podem estar desatualizados","Usage data may be stale; last full update {time}":"Os dados de uso podem estar desatualizados; última atualização completa em {time}","Usage detail views":"Visualizações de detalhes de uso","Usage heatmap calendar: arrow keys to browse, Enter for the day detail":"Calendário do mapa de calor de uso: setas para navegar, Enter para o detalhe do dia","Usage statistics is temporarily unavailable":"As estatísticas de uso estão temporariamente indisponíveis","Usage unknown":"Uso desconhecido","Using the built-in DeepSeek peak table":"Usando a tabela de pico integrada da DeepSeek",Weekly:"Semanal",Workspace:"Área de trabalho","Workspace Aliases":"Aliases de áreas de trabalho","Workspace Details":"Detalhes por área de trabalho","Workspace Details ({range})":"Detalhes por área de trabalho ({range})","Workspace Filter":"Filtro de área de trabalho","Workspace Stats":"Estatísticas por área de trabalho","Workspace Usage":"Uso por área de trabalho","Workspace filter":"Filtro de área de trabalho","Write rejected: the permission check failed (a stale process capability is also possible); refresh the dashboard and retry":"Gravação recusada: a verificação de permissão falhou (também pode ser uma capacidade do processo desatualizada); atualize o painel e tente novamente","Write rejected: the process capability had rotated and the automatic retry still failed; refresh the dashboard":"Gravação recusada: a capacidade do processo foi renovada e a nova tentativa automática também falhou; atualize o painel",Year:"Ano","Year to load":"Ano a carregar",Yearly:"Anual",ambiguous:"ambíguo","at ":"cobrado em ","built-in DeepSeek peak table":"tabela de pico integrada da DeepSeek","custom ":"personalizado: ","custom rules":"regras personalizadas","full-read fallback":"fallback de leitura completa","models.dev sync failed; the last good catalog and unsaved edits were kept":"Falha na sincronização com models.dev; o último catálogo válido e as edições não salvas foram mantidos","no usage":"sem uso","not enabled":"não habilitado","parsed ":"Analisados ",peak:"pico","peak plan ":"plano de pico ",priced:"com preço","revision optimization on":"otimização por revisão ativa","static (no band plan)":"estático (sem plano de faixas)","static (non-first-party)":"estático (rota não oficial)","tiered ":"níveis: ",tokens:"Tokens",unpriced:"sem preço",unsupported:"sem suporte","{count} days":"{count} dias","{count} models":"Modelos: {count}","{count} priced":"{count} com preço","{count} records shown":"{count} registros exibidos","{count} sessions":"{count} sessões","{count} shown; load more for additional records":"{count} exibidos; carregue mais para ver registros adicionais","{count} unpriced":"{count} sem preço","{count} uses":"{count} usos","{date}: {amount}":"{date}: {amount}","{label}: Combined View distinguishes “Provider / Model”; By Model merges identically named models across providers; By Provider aggregates all of a provider’s models. Historical records without routing information are grouped as “Unknown.”":"{label}: Visão combinada distingue “Provedor / Modelo”; Por modelo mescla modelos de mesmo nome entre provedores; Por provedor agrega todos os modelos de um provedor. Registros históricos sem informação de roteamento são agrupados como “Desconhecido”.","{range} · {count}{kind} · includes cache reads/writes and reasoning":"{range} · {count}{kind} · inclui leituras/gravações de cache e raciocínio","{start} to {end} (UTC)":"{start} a {end} (UTC)","{state} · {reused} revision reused · {read} read{ledger}{failed} · {optimization}":"{state} · {reused} revisões reutilizadas · {read} lidas{ledger}{failed} · {optimization}","No records are old enough to archive":"Nenhum registro é antigo o bastante para arquivar","Archive {count} records ({size}) across {months} months: {list}":"Arquivar {count} registros ({size}) em {months} meses: {list}",", ":", ","Archived {count} records: {compressed} on disk (was {size})":"{count} registros arquivados: {compressed} em disco (antes {size})","Some months could not be archived: {list}":"Alguns meses não puderam ser arquivados: {list}","Another DSH process is maintaining the ledger; try again in a moment":"Outro processo do DSH está mantendo o registro; tente novamente em instantes","This storage does not support archiving":"Este armazenamento não é compatível com arquivamento","The ledger is not ready yet; try again in a moment":"O registro ainda não está pronto; tente novamente em instantes","Enter a number of days between 1 and 3650":"Informe um número de dias entre 1 e 3650","Archiving failed; try again.":"Falha ao arquivar; tente novamente.",Maintenance:"Manutenção","Close maintenance":"Fechar manutenção","Sessions that have not changed for a while are folded into monthly compressed files. Totals, detail and filters stay the same, and archived records remain readable.":"Sessões sem alterações há algum tempo são reunidas em arquivos comprimidos mensais. Os totais, os detalhes e os filtros continuam iguais, e os registros arquivados seguem legíveis.","Archive records older than":"Arquivar registros anteriores a",Days:"Dias","days without updates":"dias sem atualizações","Planning…":"Planejando…",Preview:"Pré-visualizar","Start archiving":"Iniciar arquivamento","Archive {count} records? They stay readable in the panel, but this cannot be undone.":"Arquivar {count} registros? Eles continuam legíveis no painel, mas isso não pode ser desfeito.","Yes, archive":"Sim, arquivar","Archive old records":"Arquivar registros antigos","Note: archived records stay readable and countable, but the first read of a month unpacks the whole month file, so the first start is slower; afterwards it stays in memory.":"Observação: os registros arquivados continuam legíveis e contáveis, mas a primeira leitura de um mês descompacta o arquivo mensal inteiro, então a primeira inicialização fica mais lenta; depois ele permanece na memória.","This Month":"Este mês"}},d={zh:"zh-CN",en:"en-US",ja:"ja-JP",es:"es-ES",fr:"fr-FR",de:"de-DE",ru:"ru-RU",pt:"pt-BR"};function c(e){const a=String(e??"").trim().toLowerCase().replace(/_/g,"-");if(""===a)return null;const t=a.split("-")[0];return o.includes(t)?t:null}function u(e){return d[e]||d.en}function p(e,a,t){return"zh"===e?a:"en"===e?t:function(e,a){const t=l[e];if(null==t)return null;const n=t[a];return"string"==typeof n&&""!==n?n:null}(e,t)??t}function h(e,a,t,n){return function(e,a){return null==a?e:String(e).replace(/\{([a-z]+)\}/g,(e,t)=>{const n=a[t];return null==n?e:String(n)})}(p(e,a,t),n)}const m="1.2.4";function g(e){return String(e).padStart(2,"0")}let f="none";function b(){f="none";try{const e="undefined"==typeof localStorage?null:localStorage.getItem("dsh-all-usage:topInset");if(null!==e&&""!==e){const a=Number(e);if(Number.isFinite(a)&&a>=0)return f="stored",Math.round(a)}}catch(e){}try{const e="undefined"==typeof document?null:document.documentElement;if(null!==e&&e.hasAttribute("data-windows-titlebar")){const a=Number.parseFloat(window.getComputedStyle(e).getPropertyValue("--dsh-windows-titlebar-height"));return f="titlebar-marker",Number.isFinite(a)&&a>0?Math.round(a):40}}catch(e){}try{const e="undefined"==typeof navigator?void 0:navigator.windowControlsOverlay;if(null!=e&&!0===e.visible){const a=e.getTitlebarAreaRect();if(null!=a&&Number.isFinite(a.height)&&a.height>0)return f="overlay",Math.round(a.height)}}catch(e){}const e="undefined"==typeof navigator?"":String(navigator.userAgent||"");return/Electron/i.test(e)?(f="electron-ua",40):/QtWebEngine/i.test(e)?(f="qtwebengine-ua",40):0}function y(){try{const e="undefined"==typeof navigator?void 0:navigator.windowControlsOverlay;let a="none";null!=e&&(a=!0===e.visible?String((e.getTitlebarAreaRect()||{}).height):"hidden");const t="undefined"==typeof navigator?"":String(navigator.userAgent||"").slice(0,180),n=e=>{try{const a=document.querySelector(e);if(null===a)return"none";const t=a.getBoundingClientRect();return[t.top,t.left,t.width,t.height].map(e=>Math.round(e)).join("/")}catch(e){return"none"}},r="undefined"==typeof document?null:document.documentElement,i=null!==r&&r.hasAttribute("data-windows-titlebar")?String(window.getComputedStyle(r).getPropertyValue("--dsh-windows-titlebar-height")).trim()||"set":"none",o="undefined"==typeof window?"":Math.round(window.innerWidth)+"x"+Math.round(window.innerHeight),s="ua="+encodeURIComponent(t)+"&wco="+encodeURIComponent(a)+"&inset="+String(b())+"&src="+encodeURIComponent(f)+"&tb="+encodeURIComponent(i)+"&vp="+encodeURIComponent(o)+"&modal="+encodeURIComponent(n(".uh-side-modal"))+"&dlg="+encodeURIComponent(n(".uh-side-dialog"))+"&head="+encodeURIComponent(n(".uh-side-dialog-head"))+"&close="+encodeURIComponent(n(".uh-close-button"));fetch("/api/all-usage/client-env?"+s,{headers:{accept:"application/json"}}).catch(()=>{})}catch(e){}}function v(e,a){const t=a?e.getUTCFullYear():e.getFullYear(),n=a?e.getUTCMonth():e.getMonth(),r=a?e.getUTCDate():e.getDate();return t+"-"+g(n+1)+"-"+g(r)}y();const w=(()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch(e){return""}})();function x(e){const a=-(e instanceof Date&&Number.isFinite(e.getTime())?e:new Date).getTimezoneOffset();if(0===a)return"UTC";const t=Math.abs(a);return"UTC"+(a<0?"-":"+")+g(Math.floor(t/60))+":"+g(t%60)}function k(){return w||x(null)}function E(e,a,t){return t?new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+a)):new Date(e.getFullYear(),e.getMonth(),e.getDate()+a)}function C(e,a){const t=e instanceof Date?e:new Date;return a?new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),1)):new Date(t.getFullYear(),t.getMonth(),1)}function T(e,a){if("string"!=typeof e||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;const t=Number(e.slice(0,4)),n=Number(e.slice(5,7)),r=Number(e.slice(8,10)),i=a?new Date(Date.UTC(t,n-1,r)):new Date(t,n-1,r);return Number.isFinite(i.getTime())&&v(i,a)===e}function S(e,a){if(null===e||"object"!=typeof e)return null;const t=e.start,n=e.end;return!T(t,a)||!T(n,a)||t>n?null:{start:t,end:n}}function N(e,a){let t=a;if(Array.isArray(e))for(const n of e)n&&T(n.date,!0)&&n.date<=a&&n.date<t&&(t=n.date);return{min:t,max:a}}function M(){let e=0;return{next:()=>(e+=1,e),isCurrent:a=>a===e}}function A(e){if(null===e||"object"!=typeof e)return null;const a="string"==typeof e.instanceId?e.instanceId:"",t="number"==typeof e.revision&&Number.isFinite(e.revision)?e.revision:null;return""===a||null===t?null:a+":"+t}function D(e,a,t){const n=e&&"object"==typeof e?e[a]:void 0;return"number"==typeof n&&Number.isFinite(n)?n:t}function z(e){return null!==e&&"object"==typeof e&&["dataRevision","metadataRevision","scanRevision","pricingRevision"].every(a=>null!==D(e,a,null))}function U(e){if(null===e||"object"!=typeof e||"string"!=typeof e.instanceId||""===e.instanceId)return null;if("string"==typeof e.queryRevision&&""!==e.queryRevision)return e.instanceId+":"+e.queryRevision;const a=D(e,"dataRevision",D(e,"revision",null)),t=D(e,"pricingRevision",0);return null===a?null:e.instanceId+":"+a+":"+t}function P(e){return String(Math.round(10*e)/10)}function R(e){return"number"==typeof e&&Number.isFinite(e)?e<1e3?String(e):e<1e6?P(e/1e3)+"k":e<1e9?P(e/1e6)+"M":P(e/1e9)+"B":"0"}function I(e,a){return"number"==typeof e&&Number.isFinite(e)?Math.round(e).toLocaleString(u(a)):"0"}function L(e,a){const t=e+a;return t<=0?0:a/t*100}const j={edit:{path:"M12.2 3.4l2.4 2.4M4 16l2.8-.6L15 7.2a1.7 1.7 0 0 0-2.4-2.4L4.4 13z"},export:{path:"M12 3v11M8 7l4-4 4 4M5 13v5h14v-5"},refresh:{path:"M19 9a7 7 0 1 0 1.1 5.2M19 4v5h-5"},close:{path:"M6 6l12 12M18 6L6 18"},chart:{path:"M4 19V5M4 19h16M7 15l3-4 3 2 5-7"},list:{path:"M6 6h12M6 12h12M6 18h12",circle:{cx:3.5,cy:6,r:1.2}},cache:{path:"M12 4l7 4-7 4-7-4 7-4zM5 12l7 4 7-4M5 16l7 4 7-4"},wallet:{path:"M4 7.5A2.5 2.5 0 0 1 6.5 5H18v14H6.5A2.5 2.5 0 0 1 4 16.5zM4 8h14M14 13h.01"},clock:{path:"M12 6v6l4 2M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0z"},folder:{path:"M3.5 7.5h6l2 2h9v8.5a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2z"},language:{path:"M4 12h16M12 4c2.1 2.2 3.2 4.9 3.2 8S14.1 17.8 12 20M12 4C9.9 6.2 8.8 8.9 8.8 12s1.1 5.8 3.2 8",circle:{cx:12,cy:12,r:8}},chevron:{path:"M7 10l5 5 5-5"},check:{path:"M5 12.5l4.2 4.1L19 7.3"},plus:{path:"M12 5v14M5 12h14"},calendar:{path:"M6 4v3M18 4v3M4 9h16M5 6h14a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z"}};function H(e){const a=e.size||16,t={fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"},r=void 0===e.name?"chart":e.name,i=void 0===j[r]?j.chart:j[r],o=[];return void 0!==i.path&&o.push(n.createElement("path",{key:"p",d:i.path,...t})),void 0!==i.circle&&o.push(n.createElement("circle",{key:"c",cx:i.circle.cx,cy:i.circle.cy,r:i.circle.r,...t})),n.createElement("svg",{className:"uh-line-icon "+(e.className||""),width:a,height:a,viewBox:"0 0 24 24","aria-hidden":!0},o)}const F=[{key:"deepseek",label:"DeepSeek",providers:["deepseek","deepseek-official"],prefixes:["deepseek-","deepseek"],exact:[],href:"/api/all-usage/icon?key=deepseek&v=1.2.4"},{key:"openai",label:"OpenAI",providers:["openai","azure-openai"],prefixes:["gpt-","o1-","o3-","o4-","o5-","codex-","gpt"],exact:["o1","o3","o4","o5"],href:"/api/all-usage/icon?key=openai&v=1.2.4"},{key:"claude",label:"Anthropic Claude",providers:["anthropic"],prefixes:["claude-","claude"],exact:[],href:"/api/all-usage/icon?key=claude&v=1.2.4"},{key:"gemini",label:"Google Gemini",providers:["google","google-vertex","vertex"],prefixes:["gemini-","gemma-","gemma","gemini"],exact:[],href:"/api/all-usage/icon?key=gemini&v=1.2.4"},{key:"meta",label:"Meta Llama",providers:["meta","meta-llama"],prefixes:["llama-","meta-llama","llama"],exact:[],href:"/api/all-usage/icon?key=meta&v=1.2.4"},{key:"zhipu",label:"Zhipu GLM",providers:["zhipu","zhipuai","zai","bigmodel"],prefixes:["glm-","chatglm-","glm","chatglm"],exact:[],href:"/api/all-usage/icon?key=zhipu&v=1.2.4"},{key:"grok",label:"xAI Grok",providers:["xai"],prefixes:["grok-","grok"],exact:["grok"],href:"/api/all-usage/icon?key=grok&v=1.2.4"},{key:"qwen",label:"Qwen",providers:["qwen","alibaba","dashscope","bailian"],prefixes:["qwen","qwq-","qvq-"],exact:[],href:"/api/all-usage/icon?key=qwen&v=1.2.4"},{key:"doubao",label:"Doubao",providers:["doubao","bytedance","volcengine","ark"],prefixes:["doubao-","doubao"],exact:[],href:"/api/all-usage/icon?key=doubao&v=1.2.4"},{key:"kimi",label:"Moonshot Kimi",providers:["moonshot","moonshotai"],prefixes:["kimi-","moonshot-","kimi","moonshot"],exact:["kimi"],href:"/api/all-usage/icon?key=kimi&v=1.2.4"},{key:"minimax",label:"MiniMax",providers:["minimax"],prefixes:["minimax-","abab","minimax"],exact:[],href:"/api/all-usage/icon?key=minimax&v=1.2.4"},{key:"mistral",label:"Mistral",providers:["mistral","mistralai"],prefixes:["mistral-","mistralai-","magistral-","codestral-","devstral-","ministral-","pixtral-","mixtral-","open-mistral-","open-mixtral-"],exact:[],href:"/api/all-usage/icon?key=mistral&v=1.2.4"},{key:"nemotron",label:"NVIDIA",providers:["nvidia","nvidia-nim"],prefixes:["nemotron"],exact:[],href:"/api/all-usage/icon?key=nemotron&v=1.2.4"},{key:"cohere",label:"Cohere",providers:["cohere"],prefixes:["command-","north-","c4ai-"],exact:[],href:"/api/all-usage/icon?key=cohere&v=1.2.4"},{key:"nova",label:"Amazon Nova",providers:["amazon","amazon-bedrock","bedrock","aws-bedrock"],prefixes:["nova-","amazon.nova-"],exact:[],href:"/api/all-usage/icon?key=nova&v=1.2.4"},{key:"phi",label:"Microsoft",providers:["microsoft","azure","azure-ai","azure-cognitive-services"],prefixes:["phi-","microsoft/"],exact:[],href:"/api/all-usage/icon?key=phi&v=1.2.4"},{key:"sonar",label:"Perplexity",providers:["perplexity","perplexity-ai"],prefixes:["sonar"],exact:[],href:"/api/all-usage/icon?key=sonar&v=1.2.4"},{key:"ernie",label:"Baidu ERNIE",providers:["baidu","qianfan","baiducloud"],prefixes:["ernie-","wenxin"],exact:[],href:"/api/all-usage/icon?key=ernie&v=1.2.4"},{key:"hunyuan",label:"Tencent Hunyuan",providers:["hunyuan"],prefixes:["hunyuan-","hy3","hy4"],exact:[],href:"/api/all-usage/icon?key=hunyuan&v=1.2.4"},{key:"tencent",label:"Tencent",providers:["tencent","tencentcloud","tencent-hunyuan"],prefixes:[],exact:[],href:"/api/all-usage/icon?key=tencent&v=1.2.4"},{key:"stepfun",label:"StepFun",providers:["stepfun","step"],prefixes:["step-","stepfun-"],exact:[],href:"/api/all-usage/icon?key=stepfun&v=1.2.4"},{key:"baichuan",label:"Baichuan",providers:["baichuan"],prefixes:["baichuan"],exact:[],href:"/api/all-usage/icon?key=baichuan&v=1.2.4"},{key:"sensenova",label:"SenseNova",providers:["sensenova","sensetime"],prefixes:["sensenova","sensechat"],exact:[],href:"/api/all-usage/icon?key=sensenova&v=1.2.4"},{key:"internlm",label:"InternLM",providers:["internlm","shanghai-ai-lab"],prefixes:["internlm","intern-lm"],exact:[],href:"/api/all-usage/icon?key=internlm&v=1.2.4"},{key:"longcat",label:"LongCat",providers:["longcat","meituan"],prefixes:["longcat"],exact:[],href:"/api/all-usage/icon?key=longcat&v=1.2.4"},{key:"jamba",label:"AI21",providers:["ai21","ai21-labs"],prefixes:["jamba"],exact:[],href:"/api/all-usage/icon?key=jamba&v=1.2.4"},{key:"granite",label:"IBM Granite",providers:["ibm","ibm-granite","watsonx"],prefixes:["granite-"],exact:[],href:"/api/all-usage/icon?key=granite&v=1.2.4"},{key:"solar",label:"Upstage",providers:["upstage"],prefixes:["solar-"],exact:[],href:"/api/all-usage/icon?key=solar&v=1.2.4"},{key:"lfm",label:"Liquid AI",providers:["liquid","liquid-ai"],prefixes:["lfm-"],exact:[],href:"/api/all-usage/icon?key=lfm&v=1.2.4"},{key:"olmo",label:"Ai2",providers:["ai2","allenai"],prefixes:["olmo","molmo"],exact:[],href:"/api/all-usage/icon?key=olmo&v=1.2.4"},{key:"bge",label:"BAAI",providers:["baai","bge"],prefixes:["bge-"],exact:[],href:"/api/all-usage/icon?key=bge&v=1.2.4"},{key:"voyage",label:"Voyage AI",providers:["voyage","voyageai"],prefixes:["voyage-"],exact:[],href:"/api/all-usage/icon?key=voyage&v=1.2.4"},{key:"bytedance",label:"ByteDance Seed",providers:["bytedance","seed","volcengine","ark"],prefixes:["seed-","seed1-","seed2-"],exact:[],href:"/api/all-usage/icon?key=bytedance&v=1.2.4"},{key:"kling",label:"Kling",providers:["kling","kuaishou"],prefixes:["kling"],exact:[],href:"/api/all-usage/icon?key=kling&v=1.2.4"},{key:"skywork",label:"Skywork",providers:["skywork"],prefixes:["skywork"],exact:[],href:"/api/all-usage/icon?key=skywork&v=1.2.4"},{key:"mimo",label:"Xiaomi MiMo",providers:["xiaomimimo","xiaomi","mimo"],prefixes:["mimo-"],exact:[],href:"/api/all-usage/icon?key=mimo&v=1.2.4"},{key:"aion",label:"Aion Labs",providers:["aion-labs","aionlabs"],prefixes:["aion-"],exact:[],href:"/api/all-usage/icon?key=aion&v=1.2.4"},{key:"nous",label:"Nous Research",providers:["nousresearch","nous","nous-research"],prefixes:["nous-","hermes-3","hermes-4"],exact:[],href:"/api/all-usage/icon?key=nous&v=1.2.4"},{key:"falcon",label:"TII Falcon",providers:["tii","falcon","tii-uae"],prefixes:["falcon-"],exact:[],href:"/api/all-usage/icon?key=falcon&v=1.2.4"},{key:"aleph",label:"Aleph Alpha",providers:["aleph-alpha","alephalpha"],prefixes:["aleph-","pharia-"],exact:[],href:"/api/all-usage/icon?key=aleph&v=1.2.4"},{key:"yandex",label:"Yandex",providers:["yandex","yandex-cloud"],prefixes:["yandex-","yandexgpt"],exact:[],href:"/api/all-usage/icon?key=yandex&v=1.2.4"},{key:"arctic",label:"Snowflake",providers:["snowflake"],prefixes:["snowflake-","arctic-"],exact:[],href:"/api/all-usage/icon?key=arctic&v=1.2.4"},{key:"iflytek",label:"iFlytek Spark",providers:["iflytek","iflytekcloud","spark"],prefixes:["spark-","generalv"],exact:[],href:"/api/all-usage/icon?key=iflytek&v=1.2.4"}],O=Array.isArray(F)?F:[],W=new Map(O.map(e=>[e.key,e])),q=new Map;function B(e){const a=String(e??"").trim(),t=a.lastIndexOf("/");if(t<=0||t>=a.length-1)return a;const n=a.slice(0,t);if(!/^[a-z0-9][a-z0-9._-]*$/i.test(n))return a;const r=a.slice(t+1).trim();return""===r?a:r}function Y(e){const a="string"==typeof e?e.trim().toLowerCase():"";if(""===a)return null;for(const e of O)if(e.providers.includes(a))return e;return null}function K(e,a){if(""===a||!e.startsWith(a))return!1;if(e.length===a.length)return!0;if(/[-_.:\/]$/.test(a))return!0;const t=e.charAt(a.length);return"-"===t||"_"===t||"."===t||":"===t||"/"===t||/[a-z]$/.test(a)&&/[0-9]/.test(t)}const V=["openai","google","anthropic","databricks","azure","azure-ai","microsoft","amazon","cohere","mistral","deepseek","qwen","moonshot","zhipu","bytedance","nvidia","ibm","ai21","upstage","voyage","baai","ai2","liquid","sensenova","internlm","longcat","stepfun","baichuan","tencent","kling","skywork","duo-chat","bedrock","vertex"];function G(e){for(const a of O)if(a.exact.includes(e))return a;let a=null,t=0;for(const n of O)for(const r of n.prefixes)K(e,r)&&r.length>t&&(a=n,t=r.length);return a}function Z(e){const a=function(e){if("string"!=typeof e)return"";let a=e.trim().toLowerCase();const t=a.lastIndexOf("/");return t>=0&&(a=a.slice(t+1)),a.split(":")[0].replace(/@/g,"-").trim()}(e);if(""===a)return null;for(const e of function(e){const a=[e];let t=e.indexOf(".");for(;t>0&&t<e.length-3;){const n=e.slice(t+1);n.length>=3&&a.push(n),t=e.indexOf(".",t+1)}for(const t of V){if(!e.startsWith(t+"-"))continue;const n=e.slice(t.length+1).replace(/^[-_.]+/,"");n.length>=3&&a.push(n)}return a}(a)){const a=G(e);if(null!==a)return a}return null}function J(e){if(0===O.length||null===e||"object"!=typeof e)return null;const a="string"==typeof e.actualModel?e.actualModel:"",t="string"==typeof e.requestedModel?e.requestedModel:"",n="string"==typeof e.model?e.model:"",r="string"==typeof e.provider?e.provider:"",i=a+"\0"+t+"\0"+n+"\0"+r;if(q.has(i))return q.get(i);const o=n.includes(" / ")?n.slice(n.indexOf(" / ")+3):n;let s=Z(""!==a?a:t);if(null===s&&""===a&&""===t){const e=Y(r),a=Z(o);s=null===e||null!==a&&a!==e?a:e}return q.size>=2e3&&q.clear(),q.set(i,s),s}function _(e){if(!Array.isArray(e)||0===e.length)return null;let a=null;for(const t of e){const e=J(t);if(null===e)return null;if(null===a)a=e;else if(a!==e)return null}return a}function $(e,a){if("zh"!==a||"number"!=typeof e||!Number.isFinite(e)||e<1e4)return"";const t=e>=1e8?e/1e8:e/1e4,n=Math.round(1e3*t)/1e3;return String(n)+(e>=1e8?"亿":"万")}function Q(e,a,t){const r=$(a,t);return n.createElement(n.Fragment,null,e,r?n.createElement("span",{className:"uh-unit"},r):null)}function X(e,a,t,n){if(null==a)return"—";const r="CNY"===e?"¥":"USD"===e?"$":e+" ",i=Number.isFinite(n)?n:4;return r+a.toLocaleString(u(t),{minimumFractionDigits:i,maximumFractionDigits:i})}function ee(e){const a=("number"==typeof e?String(e):"string"==typeof e?e.trim().toLowerCase():"").match(/^(\d+)(?:\.(\d+))?(?:e([+-]?\d+))?$/);if(!a)return{digits:0n,scale:0};let t=(a[1]||"")+(a[2]||""),n=(a[2]||"").length-(a[3]?Number(a[3]):0);for(n<0&&(t+="0".repeat(-n),n=0),n>t.length&&(t="0".repeat(n-t.length+1)+t);n>0&&t.length>1&&t.endsWith("0");)t=t.slice(0,-1),n-=1;return{digits:BigInt(t.replace(/^0+(?=\d)/,"")||"0"),scale:n}}function ae(e){const a=ee(e);if(0n===a.digits)return"0";const t=a.digits.toString();if(0===a.scale)return t;const n=t.padStart(a.scale+1,"0"),r=n.length-a.scale;return n.slice(0,r)+"."+n.slice(r)}function te(e,a){const t=ee(e),n=ee(a),r=Math.max(t.scale,n.scale);return ae((t.digits*10n**BigInt(r-t.scale)+n.digits*10n**BigInt(r-n.scale)).toString()+(r>0?"e-"+r:""))}function ne(){return{currency:"USD",input:"0",output:"0",cacheRead:"0",cacheWrite:"0",baseTotal:"0",total:"0",pricedCalls:0,unpricedCalls:0,ambiguousCalls:0,unsupportedCalls:0}}function re(e){const a=e&&e.cost&&"object"==typeof e.cost?e.cost:e&&"object"==typeof e?e:{},t={currency:"USD",input:"0",output:"0",cacheRead:"0",cacheWrite:"0",baseTotal:"0",total:"0",pricedCalls:0,unpricedCalls:0,ambiguousCalls:0,unsupportedCalls:0};if(t.currency="string"==typeof a.currency&&""!==a.currency?a.currency:"USD",a.breakdown&&"object"==typeof a.breakdown)return"priced"===a.status?(t.input=ae(a.breakdown.input),t.output=ae(a.breakdown.output),t.cacheRead=ae(a.breakdown.cacheRead),t.cacheWrite=ae(a.breakdown.cacheWrite),t.baseTotal=ae(a.baseTotal),t.total=ae(a.total),t.pricedCalls=1):"ambiguous"===a.status?t.ambiguousCalls=1:"unsupported"===a.status?t.unsupportedCalls=1:t.unpricedCalls=1,t;for(const e of["input","output","cacheRead","cacheWrite","baseTotal","total"])t[e]=ae(a[e]);for(const e of["pricedCalls","unpricedCalls","ambiguousCalls","unsupportedCalls"])t[e]=Number.isFinite(a[e])?a[e]:0;return t}function ie(e,a){const t=re(a);for(const a of["input","output","cacheRead","cacheWrite","baseTotal","total"])e[a]=te(e[a],t[a]);return e.pricedCalls+=t.pricedCalls,e.unpricedCalls+=t.unpricedCalls,e.ambiguousCalls+=t.ambiguousCalls,e.unsupportedCalls+=t.unsupportedCalls,e}function oe(e,a){const t=re(e);if(t.pricedCalls<=0)return"—";const n=Number(t.total);return Number.isFinite(n)?X(t.currency,n,a):t.currency+" "+t.total}function se(e,a){const t=e&&e.cost&&"object"==typeof e.cost?e.cost:{},n=[];return t.pricingPolicyId&&n.push(t.pricingPolicyId),"UTC"===t.pricingTimezone&&Number.isFinite(t.pricingAt)&&n.push(p(a,"计费时刻 ","at ")+new Date(t.pricingAt).toISOString().slice(0,16).replace("T"," ")+" UTC"),n.length>0?n.join(" · "):null}function le(e){const a=e&&e.config&&"object"==typeof e.config?e.config:{},t=a.sync&&"object"==typeof a.sync?a.sync:{};return{sync:{autoEnabled:!0===t.autoEnabled,intervalMs:Number.isFinite(t.intervalMs)?t.intervalMs:216e5},providerAliases:a.providerAliases&&"object"==typeof a.providerAliases?Object.assign({},a.providerAliases):{},mappings:Array.isArray(a.mappings)?a.mappings.map(e=>Object.assign({},e)):[],overrides:Array.isArray(a.overrides)?a.overrides.map(e=>Object.assign({},e,{tiers:Array.isArray(e.tiers)?e.tiers.map(e=>Object.assign({},e)):[]})):[]}}function de(e){const a=new Map,t=e&&Array.isArray(e.tierSchedules)?e.tierSchedules:[];for(const e of t)e&&"string"==typeof e.id&&Array.isArray(e.tiers)&&a.set(e.id,e.tiers);return e&&Array.isArray(e.usedModels)?e.usedModels.map(e=>{const t=e&&"string"==typeof e.tierScheduleId?a.get(e.tierScheduleId):null,n=Array.isArray(t)?t:e&&Array.isArray(e.tiers)?e.tiers:[];return Object.assign({},e,{tiers:n.map(e=>Object.assign({},e))})}):[]}function ce(e,a){const t=le(a);if(null===e||"object"!=typeof e)return t;const n=le({config:e});return Object.assign({},t,{providerAliases:n.providerAliases,mappings:n.mappings,overrides:n.overrides})}function ue(e,a){return"priced"===e?p(a,"已计价","priced"):"ambiguous"===e?p(a,"待确认","ambiguous"):"unsupported"===e?p(a,"不支持","unsupported"):p(a,"未计价","unpriced")}function pe(e,a){return"total"===e?p(a,"Total:输入已含缓存","Total: input already includes cache"):"legacy"===e?p(a,"Legacy:输入 + 缓存写","Legacy: input + cache write"):p(a,"Fresh:输入 + 缓存读写","Fresh: input + cache read/write")}function he(e,a,t){const n=Array.isArray(e)?e:[];if(a<0)return n.length>0?"≤ "+I(n[0].size,t):p(t,"全部上下文","All contexts");const r=n[a];if(!r)return"";const i="> "+I(r.size,t),o=n[a+1];return o?i+p(t," 且 ≤ "," and ≤ ")+I(o.size,t):i}function me(e){const a=String(e??"").trim().toLowerCase();if(""===a||a.length>128)return!1;const t=a.match(/^(\d+)(?:\.(\d+))?(?:e([+-]?\d+))?$/);if(!t)return!1;const n=t[3]?Number(t[3]):0;if(!Number.isSafeInteger(n)||Math.abs(n)>24)return!1;let r=(t[1]||"")+(t[2]||""),i=(t[2]||"").length-n;return r=r.replace(/^0+(?=\d)/,""),i<0&&(r+="0".repeat(-i),i=0),i>r.length&&(r="0".repeat(i-r.length+1)+r),r.length<=40}function ge(e,a){const t=Number(e&&e.size);return!(!e||"context"!==e.type||!Number.isSafeInteger(t)||t<=a||t>1e9)&&["input","output","cacheRead","cacheWrite"].every(a=>me(e[a]))}function fe(e){return null==e||""===e?"0":String(e)}function be(e,a){return"output"===e?p(a,"输出 / 1M","Output / 1M"):"cacheRead"===e?p(a,"缓存读 / 1M","Cache read / 1M"):"cacheWrite"===e?p(a,"缓存写 / 1M","Cache write / 1M"):p(a,"输入 / 1M","Input / 1M")}function ye(e){const a=null!==e&&"object"==typeof e?e:{};return String(a.providerId||"").trim().toLowerCase()+"|"+String(a.modelId||"").trim().toLowerCase()}function ve(e,a){const t=Array.isArray(e)?e:[],n=ye(a);for(let e=0;e<t.length;e+=1){const a=t[e];if(null!==a&&"object"==typeof a&&ye({providerId:a.providerId,modelId:a.modelId})===n)return e}return-1}function we(e,a){const t=Array.isArray(e)?e:[],n=String(a||"").trim();if(""===n)return-1;for(let e=0;e<t.length;e+=1){const a=t[e];if(null!==a&&"object"==typeof a&&String(a.identityKey||a.usageIdentityKey||"").trim()===n)return e}return-1}const xe=new WeakMap;function ke(e,a,t){const n=null!==e&&"object"==typeof e?e:{sync:{},mappings:[],overrides:[]},r=Array.isArray(n.overrides)?n.overrides.map(e=>Object.assign({},e)):[];let i=ve(r,a.basis);if(i<0){const e=null!==a.rates&&"object"==typeof a.rates?a.rates:{},t=Array.isArray(a.tiers)?a.tiers.map(e=>Object.assign({},e)):[];r.push({providerId:a.basis.providerId||"",modelId:a.basis.modelId,displayName:a.model||a.basis.modelId,input:fe(e.input),output:fe(e.output),cacheRead:fe(e.cacheRead),cacheWrite:fe(e.cacheWrite),tiered:t.length>0,tiers:t}),i=r.length-1}return r[i]=Object.assign({},r[i],t),Object.assign({},n,{overrides:r})}function Ee(e){const a=String(e??"").trim().match(/^([0-9]{1,2}):([0-9]{1,2})$/);if(null===a)return null;const t=Number(a[1]),n=Number(a[2]);if(!Number.isInteger(t)||!Number.isInteger(n)||n<0||n>59)return null;const r=60*t+n;return r<0||r>1440?null:r}function Ce(e){const a=Number(e);return!Number.isFinite(a)||a<0||a>1440?"":String(Math.floor(a/60)).padStart(2,"0")+":"+String(a%60).padStart(2,"0")}function Te(e){return"zh"!==e?0:480}function Se(e,a){const t=Number.isFinite(a)?Math.trunc(a):0;if(0===t||!Array.isArray(e))return e;const n=[];for(const a of e){const e=new Map;for(const n of a.windows){const r=n.endMinute+t;let i=n.startMinute+t;for(;i<r;){const t=Math.floor(i/1440),n=i-1440*t,o=Math.min(r-1440*t,1440),s=a.weekdays.map(e=>((e+t)%7+7)%7).sort((e,a)=>e-a),l=s.join(",");let d=e.get(l);void 0===d&&(d={weekdays:s,windows:[]},e.set(l,d)),d.windows.push({startMinute:n,endMinute:o}),i+=o-n}}let r=0;for(const t of e.values())t.windows.sort((e,a)=>e.startMinute-a.startMinute),n.push({id:1===e.size?a.id:a.id+"-"+(r+1),weekdays:t.weekdays,windows:t.windows,rates:a.rates}),r+=1}return n}function Ne(e,a=0){const t=String(e??"").trim();if(""===t)return 0;const n=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/);if(null===n)return null;const r=Number(n[1]),i=Number(n[2]),o=Number(n[3]),s=Date.UTC(r,i-1,o),l=new Date(s);return l.getUTCFullYear()!==r||l.getUTCMonth()!==i-1||l.getUTCDate()!==o?null:s-6e4*(Number.isFinite(a)?Math.trunc(a):0)}function Me(e,a=0){const t=Number(e);if(!Number.isFinite(t)||t<=0)return"";const n=Number.isFinite(a)?Math.trunc(a):0;return new Date(t+6e4*n).toISOString().slice(0,10)}function Ae(e){const a=String(e??""),t=[],n=new Set;for(const e of a.split("\n")){const a=e.trim();if(""===a)continue;const r=a.split("..");if(r.length>2)return null;const i=r[0].trim(),o=2===r.length?r[1].trim():i;if(""===i||""===o)return null;const s=Ne(i),l=Ne(o);if(null===s||null===l||s>l)return null;const d=Math.round((l-s)/864e5)+1;if(d>366||n.size+d>400)return null;for(let e=0;e<d;e+=1){const a=new Date(s+864e5*e).toISOString().slice(0,10);n.has(a)||(n.add(a),t.push(a))}}return t.sort(),t}function De(e,a=0){const t=null!=e&&Array.isArray(e.policies)?e.policies:[],n=t.length>0&&null!==t[0]&&"object"==typeof t[0]?t[0]:null;if(null===n)return null;const r=Se(Array.isArray(n.rules)?n.rules:[],a);return 0===r.length?null:{policyId:"string"==typeof n.policyId&&""!==n.policyId?n.policyId:"custom-peak",effectiveFromText:Me(n.effectiveFrom,a),holidaysEnabled:Array.isArray(n.holidays)&&n.holidays.length>0,holidaysText:Array.isArray(n.holidays)?n.holidays.join("\n"):"",holidaysSourceText:"string"==typeof n.holidaysSource?n.holidaysSource:"",rules:r.map((e,a)=>({id:"string"==typeof e.id&&""!==e.id?e.id:"peak-"+(a+1),weekdays:Array.isArray(e.weekdays)?e.weekdays.slice().sort((e,a)=>e-a):[],windows:(Array.isArray(e.windows)?e.windows:[]).map(e=>({start:Ce(e.startMinute),end:Ce(e.endMinute)})),rates:{input:fe(null!==e.rates&&void 0!==e.rates?e.rates.input:""),output:fe(null!==e.rates&&void 0!==e.rates?e.rates.output:""),cacheRead:fe(null!==e.rates&&void 0!==e.rates?e.rates.cacheRead:""),cacheWrite:fe(null!==e.rates&&void 0!==e.rates?e.rates.cacheWrite:"")}}))}}function ze(e,a=0){const t=null!==e&&"object"==typeof e?e:{},n=Number.isFinite(a)?Math.trunc(a):0;return{policyId:"custom-peak",effectiveFromText:"",holidaysEnabled:!1,holidaysText:"",holidaysSourceText:"",rules:[{id:"peak-1",weekdays:[1,2,3,4,5],windows:[{start:Ce(60+n),end:Ce(240+n)}],rates:{input:fe(t.input),output:fe(t.output),cacheRead:fe(t.cacheRead),cacheWrite:fe(t.cacheWrite)}}]}}function Ue(e){return null===e||"object"!=typeof e?null:{policyId:String(void 0===e.policyId?"":e.policyId),effectiveFromText:String(void 0===e.effectiveFromText?"":e.effectiveFromText),holidaysEnabled:!0===e.holidaysEnabled,holidaysText:String(void 0===e.holidaysText||null===e.holidaysText?"":e.holidaysText),holidaysSourceText:String(void 0===e.holidaysSourceText||null===e.holidaysSourceText?"":e.holidaysSourceText),rules:(Array.isArray(e.rules)?e.rules:[]).map((e,a)=>({id:"string"==typeof e.id&&""!==e.id?e.id:"peak-"+(a+1),weekdays:(Array.isArray(e.weekdays)?e.weekdays:[]).map(Number),windows:(Array.isArray(e.windows)?e.windows:[]).map(e=>({start:String(void 0===e.start?"":e.start),end:String(void 0===e.end?"":e.end)})),rates:{input:String(void 0===e.rates||null===e.rates||void 0===e.rates.input?"":e.rates.input),output:String(void 0===e.rates||null===e.rates||void 0===e.rates.output?"":e.rates.output),cacheRead:String(void 0===e.rates||null===e.rates||void 0===e.rates.cacheRead?"":e.rates.cacheRead),cacheWrite:String(void 0===e.rates||null===e.rates||void 0===e.rates.cacheWrite?"":e.rates.cacheWrite)}}))}}function Pe(e,a,t){const n=Ue(e);return null===n||void 0===n.rules[a]||(n.rules[a]=Object.assign({},n.rules[a],t)),n}function Re(e,a,t){return Pe(e,a,{windows:t})}function Ie(e,a=0){const t=Ne(null!==e&&"object"==typeof e?e.effectiveFromText:"",a),n=Se((null!==e&&"object"==typeof e&&Array.isArray(e.rules)?e.rules:[]).map((e,a)=>({id:"string"==typeof e.id&&""!==e.id?e.id:"peak-"+(a+1),weekdays:(Array.isArray(e.weekdays)?e.weekdays:[]).slice().sort((e,a)=>e-a),windows:(Array.isArray(e.windows)?e.windows:[]).map(e=>({startMinute:Ee(e.start),endMinute:Ee(e.end)})),rates:{input:fe(null!==e.rates&&void 0!==e.rates?e.rates.input:""),output:fe(null!==e.rates&&void 0!==e.rates?e.rates.output:""),cacheRead:fe(null!==e.rates&&void 0!==e.rates?e.rates.cacheRead:""),cacheWrite:fe(null!==e.rates&&void 0!==e.rates?e.rates.cacheWrite:"")}})),-a);return{policies:[{policyId:String(null!==e&&"object"==typeof e&&void 0!==e.policyId?e.policyId:"").trim(),timezone:"UTC",effectiveFrom:null===t?0:t,effectiveUntil:null,defaultPlan:null,holidays:null!==e&&"object"==typeof e&&!0===e.holidaysEnabled&&Ae(e.holidaysText)||[],holidaysSource:null!==e&&"object"==typeof e?String(void 0===e.holidaysSourceText||null===e.holidaysSourceText?"":e.holidaysSourceText).trim().slice(0,512):"",rules:n}]}}function Le(e){if(null===e||"object"!=typeof e)return"temporal";const a=String(void 0===e.policyId?"":e.policyId).trim();if(""===a||a.length>128)return"temporal";if(null===Ne(e.effectiveFromText))return"temporal";if(!0===e.holidaysEnabled&&null===Ae(e.holidaysText))return"temporal";const t=Array.isArray(e.rules)?e.rules:[];if(0===t.length||t.length>16)return"temporal";const n=new Map;for(const e of t){const a=Array.isArray(e.weekdays)?e.weekdays.map(Number):[];if(0===a.length||a.some(e=>!Number.isInteger(e)||e<0||e>6))return"temporal";const t=Array.isArray(e.windows)?e.windows:[];if(0===t.length||t.length>16)return"temporal";for(const e of t){const t=Ee(e.start),r=Ee(e.end);if(null===t||null===r||r<=t)return"temporal";for(const e of a){const a=void 0===n.get(e)?[]:n.get(e);a.push({start:t,end:r}),n.set(e,a)}}if(!["input","output","cacheRead","cacheWrite"].every(a=>me(null!==e.rates&&void 0!==e.rates?e.rates[a]:"")))return"temporal"}for(const e of n.values()){e.sort((e,a)=>e.start-a.start);for(let a=1;a<e.length;a+=1)if(e[a].start<e[a-1].end)return"temporal"}return""}function je(e){const a=String(e||"").trim();return a.includes(" / ")?a:function(e){return String(e||"").trim().toLowerCase().replace(/^.*\//,"").split(":")[0]}(a)}function He(e,a){if("zh"===e)return a?["日","一","二","三","四","五","六"]:["周日","周一","周二","周三","周四","周五","周六"];const t=new Intl.DateTimeFormat(u(e),{timeZone:"UTC",weekday:a?"narrow":"short"}),n=Date.UTC(2024,0,7);return Array.from({length:7},(e,a)=>t.format(new Date(n+864e5*a)))}function Fe(e,a){const t=e.split("-"),n=new Date(Number(t[0]),Number(t[1])-1,Number(t[2])),r=n.getMonth(),i=n.getDay(),o=x(n);if("en"===a){const e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][i];return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][r]+" "+Number(t[2])+", "+t[0]+" ("+e+", "+o+")"}if("zh"!==a)return new Intl.DateTimeFormat(u(a),{year:"numeric",month:"short",day:"numeric"}).format(n)+" · "+He(a,!1)[i]+" · "+o;const s=["周日","周一","周二","周三","周四","周五","周六"][i];return t[0]+"年"+Number(t[1])+"月"+Number(t[2])+"日 "+s+"("+o+")"}function Oe(e){if(null==e)return null;const a=Number(e.input||0)+Number(e.output||0)+Number(e.cacheRead||0)+Number(e.cacheWrite||0)+Number(e.reasoning||0);return Number.isFinite(a)?a:null}function We(e,a,t){if("en"===t){const t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a];return 0===a?e+" "+t:t}if("zh"!==t){const n=new Intl.DateTimeFormat(u(t),{timeZone:"UTC",month:"short"}).format(new Date(Date.UTC(e,a,1)));return 0===a?String(e)+" "+n:n}return 0===a?e+"年1月":a+1+"月"}function qe(e){return e>=10?4:e>=6?3:e>=3?2:e>=1?1:0}const Be=[20,45,70,96];function Ye(e){return e<=0?"var(--uh-cell-empty)":"color-mix(in srgb, var(--uh-heat) "+Be[e-1]+"%, var(--uh-cell-empty))"}function Ke(e){return"hsl("+137*e%360+" 70% var(--uh-workspace-lightness, 55%))"}const Ve={"30d":5,"90d":13,"12m":53},Ge=["30d","90d","12m"],Ze="12m";function Je(e){return Ge.includes(e)?e:Ze}const _e="https://github.com/ParticleLight/dsh-all-usage";function $e(e,a,t,n){const r=t&&Array.isArray(e&&e.byDayUtc)?e.byDayUtc:Array.isArray(e&&e.byDay)?e.byDay:[],i=v(new Date,t);if("custom"===a){const e=S(n,t);return null===e?null:{start:e.start,end:e.end}}if("today"===a)return{start:i,end:i};if("7d"===a)return{start:v(E(new Date,-6,t),t),end:i};if("30d"===a)return{start:v(E(new Date,-29,t),t),end:i};if("90d"===a)return{start:v(E(new Date,-89,t),t),end:i};if("month"===a)return{start:v(C(new Date,t),t),end:i};const o=N(r,i);return{start:o.min,end:o.max}}function Qe(e){return null===e?"":JSON.stringify({start:e.start,end:e.end,utc:!0===e.utc,workspaceId:e.workspaceId||null,provider:e.provider||null,modelKey:e.modelKey||null})}function Xe(e){const a=e&&e.tokens&&"object"==typeof e.tokens?e.tokens:e||{};return{input:Number.isFinite(a.input)?a.input:0,output:Number.isFinite(a.output)?a.output:0,cacheRead:Number.isFinite(a.cacheRead)?a.cacheRead:0,cacheWrite:Number.isFinite(a.cacheWrite)?a.cacheWrite:0,reasoning:Number.isFinite(a.reasoning)?a.reasoning:0}}function ea(e,a,t){const n=e.split("-").map(Number);return v(t?new Date(Date.UTC(n[0],n[1]-1,n[2]+a)):new Date(n[0],n[1]-1,n[2]+a),t)}const aa=[{days:3,unit:"static"},{days:4,unit:"static"},{days:7,unit:"week",stride:1},{days:10,unit:"static"},{days:14,unit:"week",stride:2},{days:21,unit:"week",stride:3},{days:30,unit:"static"},{days:61,unit:"static"},{days:91,unit:"static"},{days:182,unit:"static"},{days:365,unit:"static"}];function ta(e,a,t){return e&&Number.isFinite(e.time)?function(e,a,t){const n=t?{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}:{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1};return new Date(e).toLocaleString(u(a),n)}(e.time,a,t):e&&"string"==typeof e.date?t?Fe(e.date,a):e.date.slice(5):""}function na(e){const a=e&&e.bucket&&"object"==typeof e.bucket?e.bucket:null;return null!==a&&a.days>1&&"string"==typeof a.end}function ra(e,a){return e&&Number.isFinite(e.time)?String(e.time):e&&"string"==typeof e.date?e.date:String(a)}function ia(e){return e&&"string"==typeof e.date?e.date:""}function oa(e){const a=null!=e?e:{},t=void 0===a.stats?null:a.stats,n=void 0===a.queryScope?null:a.queryScope,r=void 0===a.queryResult?null:a.queryResult,i=!0===a.useUtc,o=!0===a.queryReady,s=Array.isArray(a.activeDayRows)?a.activeDayRows:[],l=null!==n?{start:n.start,end:n.end}:$e(t,a.range,i,a.activeCustomRange),d=o&&null!==r&&Array.isArray(r.daily)?r.daily:null,c=null!==n&&n.start===n.end&&o&&null!==r&&Array.isArray(r.hourly)&&r.hourly.length>0?function(e,a,t,n,r){const i=Array.isArray(a)?a.find(e=>null!==e&&"object"==typeof e&&e.date===n):void 0,o=(null==t?[]:!0===r?Array.isArray(t.byDayUtc)?t.byDayUtc:[]:Array.isArray(t.byDay)?t.byDay:[]).find(e=>null!==e&&"object"==typeof e&&e.date===n),s=void 0!==i?i:o,l=void 0===s?null:Oe(s.tokens);if(null===l)return[];let d=0;for(const a of e)d+=Oe(a.tokens)||0;return d<=0?[]:Math.abs(d-l)<=Math.max(.05*l,2e5)?e:[]}(r.hourly,d,t,n.start,i):[],u=c.length>0?function(e,a){const t=[];for(const n of Array.isArray(e)?e:[]){if(null===n||"object"!=typeof n)continue;const e=Number.isFinite(n.time)?n.time:"string"==typeof n.date?Date.parse(n.date):NaN;if(!Number.isFinite(e))continue;const r=Xe(n);t.push({date:v(new Date(e),a),time:e,turns:Number.isFinite(n.turns)?n.turns:0,calls:Number.isFinite(n.calls)?n.calls:0,sessions:Number.isFinite(n.sessions)?n.sessions:0,tokens:r,cost:re(n),total:r.input+r.output+r.cacheRead+r.cacheWrite+r.reasoning})}return t.sort((e,a)=>e.time-a.time)}(c,i):[];return u.length>0?u:function(e,a,t,n){if(null===a||"object"!=typeof a)return[];const r=n&&Number.isFinite(n.maxPoints)?n.maxPoints:180,i=new Map((Array.isArray(e)?e:[]).filter(e=>e&&"string"==typeof e.date).map(e=>[e.date,e])),o=a.start.split("-").map(Number),s=a.end.split("-").map(Number),l=t?new Date(Date.UTC(o[0],o[1]-1,o[2])):new Date(o[0],o[1]-1,o[2]),d=t?new Date(Date.UTC(s[0],s[1]-1,s[2])):new Date(s[0],s[1]-1,s[2]),c=function(e,a){if(!Number.isFinite(e)||e<=a)return null;const t=aa[aa.length-1];for(let t=0;t<aa.length-1;t+=1)if(Math.ceil(e/aa[t].days)<=a)return aa[t];return t}(Math.round((d.getTime()-l.getTime())/864e5),r);if(null===c){const e=[];for(;l.getTime()<=d.getTime();){const a=v(l,t),n=i.get(a),r=Xe(n);e.push({date:a,turns:n&&Number.isFinite(n.turns)?n.turns:0,calls:n&&Number.isFinite(n.calls)?n.calls:0,sessions:n&&Number.isFinite(n.sessions)?n.sessions:0,tokens:r,cost:re(n),total:r.input+r.output+r.cacheRead+r.cacheWrite+r.reasoning,bucket:{start:a,end:a,days:1,granularity:"day"}}),t?l.setUTCDate(l.getUTCDate()+1):l.setDate(l.getDate()+1)}return e}return function(e,a,t,n,r){const i=[];let o=a;for(;o<=t;){let a;if("week"===r.unit){const e=o.split("-").map(Number),t=n?new Date(Date.UTC(e[0],e[1]-1,e[2])).getUTCDay():new Date(e[0],e[1]-1,e[2]).getDay();a=ea(o,7*r.stride-(1===t?0:(t+6)%7),n)}else a=ea(o,r.days,n);const s=ea(a,-1,n),l=s>t?t:s,d={input:0,output:0,cacheRead:0,cacheWrite:0,reasoning:0},c=ne();let u=0,p=0,h=0,m=0,g=0,f=o;for(;f<=l;){const a=e.get(f),t=Xe(a);u+=a&&Number.isFinite(a.turns)?a.turns:0,p+=a&&Number.isFinite(a.calls)?a.calls:0,h+=a&&Number.isFinite(a.sessions)?a.sessions:0,d.input+=t.input,d.output+=t.output,d.cacheRead+=t.cacheRead,d.cacheWrite+=t.cacheWrite,d.reasoning+=t.reasoning,m+=t.input+t.output+t.cacheRead+t.cacheWrite+t.reasoning,ie(c,a),g+=1,f=ea(f,1,n)}if(i.push({date:o,turns:u,calls:p,sessions:h,tokens:d,cost:c,total:m,bucket:{start:o,end:l,days:g,granularity:"week"===r.unit?"week":"static"}}),l>=t)break;o=ea(l,1,n)}return i}(i,a.start,a.end,t,c)}(null!==d?d:s,l,i)}function sa(e,a,t=900,n=250,r=null){const i=Array.isArray(a)&&a.length>0?a:["total"],o={left:46,right:14,top:14,bottom:30},s=Math.max(1,t-o.left-o.right),l=Math.max(1,n-o.top-o.bottom),d=Array.isArray(e)?e.length:0,c="bar"===r?function(e,a){const t=e>1?a/(e-1):a/2;return Math.max(2,Math.min(.62*t,26))}(d,s):null,u=null===c?0:c/2,p=(Array.isArray(e)?e:[]).flatMap(e=>i.map(a=>"total"===a?e.total:e.tokens[a]||0)),h=Math.max(1,...p),m={};for(const a of i)m[a]=(Array.isArray(e)?e:[]).map((e,t)=>({x:o.left+(d>1?u+t*(s-2*u)/(d-1):s/2),y:o.top+l-("total"===a?e.total:e.tokens[a]||0)/h*l,value:"total"===a?e.total:e.tokens[a]||0}));return{width:t,height:n,padding:o,max:h,barWidth:c,points:m}}function la(e,a,t){const n="string"==typeof e.actualModel&&""!==e.actualModel?e.actualModel:"string"==typeof e.requestedModel&&""!==e.requestedModel?e.requestedModel:"",r="string"==typeof e.model&&""!==e.model?e.model:t,i=r.indexOf(" / "),o=("string"==typeof e.provider&&""!==e.provider?e.provider:"")||(i>0?r.slice(0,i):a),s=o!==a?o+" / ":"",l=""!==n?r:""!==s&&r.startsWith(s)?r.slice(s.length):i>0?r.slice(i+3):r;return{provider:o,model:je(n||l)||t}}function da(e,a){const[t,r]=n.useState({value:0,done:!1});return n.useEffect(()=>{if("number"!=typeof e||!Number.isFinite(e)||e<=0)return void r({value:0,done:!1});if(t.done)return void r({value:e,done:!0});const n=Date.now(),i=a.interval(()=>{const a=Math.min(1,(Date.now()-n)/700),t=1-Math.pow(1-a,3);a>=1?(i(),r({value:e,done:!0})):r({value:Math.round(e*t),done:!1})},32);return i},[e]),t.value}function ca(e){if(!Array.isArray(e)||0===e.length)return"";if(1===e.length)return"M"+e[0].x.toFixed(2)+" "+e[0].y.toFixed(2);const a=[];for(let t=0;t<e.length-1;t+=1){const n=e[t+1].x-e[t].x;a.push(0===n?0:(e[t+1].y-e[t].y)/n)}const t=new Array(e.length).fill(0);t[0]=a[0],t[e.length-1]=a[a.length-1];for(let n=1;n<e.length-1;n+=1){const e=a[n-1],r=a[n];t[n]=e*r<=0?0:(e+r)/2}for(let e=0;e<a.length;e+=1){if(0===a[e]){t[e]=0,t[e+1]=0;continue}const n=t[e]/a[e],r=t[e+1]/a[e],i=n*n+r*r;if(i>9){const o=3/Math.sqrt(i);t[e]=o*n*a[e],t[e+1]=o*r*a[e]}}let n="M"+e[0].x.toFixed(2)+" "+e[0].y.toFixed(2);for(let a=0;a<e.length-1;a+=1){const r=e[a+1].x-e[a].x,i=e[a].x+r/3,o=e[a].y+t[a]*r/3,s=e[a+1].x-r/3,l=e[a+1].y-t[a+1]*r/3;n+=" C"+i.toFixed(2)+" "+o.toFixed(2)+" "+s.toFixed(2)+" "+l.toFixed(2)+" "+e[a+1].x.toFixed(2)+" "+e[a+1].y.toFixed(2)}return n}function ua(e){if(!Array.isArray(e)||e.length<2)return 1;let a=0;for(let t=1;t<e.length;t+=1){const n=e[t].x-e[t-1].x,r=e[t].y-e[t-1].y;a+=Math.sqrt(n*n+r*r)}return Math.max(1,Math.ceil(1.35*a+2))}const pa=["var(--uh-donut-1)","var(--uh-donut-2)","var(--uh-donut-3)","var(--uh-donut-4)","var(--uh-donut-5)","var(--uh-donut-6)"],ha={total:"var(--uh-series-total)",input:"var(--uh-series-input)",cacheRead:"var(--uh-series-cache-read)",cacheWrite:"var(--uh-series-cache-write)",output:"var(--uh-series-output)",reasoning:"var(--uh-series-reasoning)"},ma="var(--uh-series-reasoning)",ga={total:.2,input:.16,cacheRead:.18,cacheWrite:.14,output:.16,reasoning:.1};function fa(e,a){const t=$(e,a);return""!==t?t:R(e)}function ba(e,a){return fa(e,a)+p(a," Token"," tokens")}function ya(e,a,t,n,r){const i=Math.max(0,r-n),o=n=>({x:e+t*Math.cos(n),y:a+t*Math.sin(n)}),s=o(n);if(i>=2*Math.PI-1e-4){const e=o(n+Math.PI);return"M"+s.x.toFixed(2)+" "+s.y.toFixed(2)+" A"+t+" "+t+" 0 1 1 "+e.x.toFixed(2)+" "+e.y.toFixed(2)+" A"+t+" "+t+" 0 1 1 "+s.x.toFixed(2)+" "+s.y.toFixed(2)}const l=o(r);return"M"+s.x.toFixed(2)+" "+s.y.toFixed(2)+" A"+t+" "+t+" 0 "+(i>Math.PI?1:0)+" 1 "+l.x.toFixed(2)+" "+l.y.toFixed(2)}const va=n.memo(function(e){const a=c(e.language)||"en",[t,r]=n.useState(null),i=n.useRef(null),o=n.useRef(null),s=n.useRef(null),l=n.useRef(null),d=n.useMemo(()=>function(e,a,t=5){const n=Math.max(1,Number.isInteger(t)?t:5),r=(Array.isArray(e)?e:[]).map((e,a)=>({label:e&&void 0!==e.label?String(e.label):"",value:Number(e&&e.value),color:e&&"string"==typeof e.color&&""!==e.color?e.color:pa[a%pa.length],iconKey:e&&void 0!==e.iconKey?e.iconKey:void 0,cost:re(e)})).filter(e=>""!==e.label&&Number.isFinite(e.value)&&e.value>0).sort((e,a)=>a.value-e.value),i=r.reduce((e,a)=>e+a.value,0);if(i<=0)return{total:0,segments:[]};const o=r.slice(0,n),s=r.slice(n),l=s.reduce((e,a)=>e+a.value,0);if(l>0){const e={currency:"USD",input:"0",output:"0",cacheRead:"0",cacheWrite:"0",baseTotal:"0",total:"0",pricedCalls:0,unpricedCalls:0,ambiguousCalls:0,unsupportedCalls:0};for(const a of s)ie(e,a.cost);o.push({label:a+" ("+(r.length-n)+")",value:l,color:"var(--uh-series-other)",iconKey:null,cost:e,other:!0})}let d=-Math.PI/2;return{total:i,segments:o.map((e,a)=>{const t=e.value/i*Math.PI*2,n=o.length>1?Math.min(.018,t/3):0,r=d+n,s=d+t-n;return d+=t,{...e,index:a,percentage:e.value/i*100,startAngle:s<=r?d-t:r,endAngle:s<=r?d:s}})}}(e.items,p(a,"其他","Other")),[e.items,a]),u=null===t?null:d.segments[t]||null,h=e=>(e>=10?Math.round(e):Math.round(10*e)/10)+"%",m=n.useCallback(()=>{s.current=null,null!==l.current&&(window.clearTimeout(l.current),l.current=null);const e=i.current,a=o.current;if(null!==e&&null!==a){if(a.fixed)e.style.left=a.left+"px",e.style.top=a.top+"px";else{const t=a.visual?.getBoundingClientRect();if(!t)return;const n=198,r=82;e.style.left=Math.max(8,Math.min(Math.max(8,t.width-n),a.x-t.left+14))+"px",e.style.top=Math.max(8,Math.min(Math.max(8,t.height-r),a.y-t.top+14))+"px"}e.style.visibility="visible"}},[]),g=n.useCallback(e=>{o.current=e,null===s.current&&(s.current=window.requestAnimationFrame(m),l.current=window.setTimeout(()=>{null!==s.current&&(window.cancelAnimationFrame(s.current),m())},80))},[m]),f=n.useCallback(e=>{g({x:e.clientX,y:e.clientY,visual:e.currentTarget.ownerSVGElement?.parentElement})},[g]),b=n.useCallback(()=>{r(null),o.current=null},[]);return n.useEffect(()=>()=>{null!==s.current&&window.cancelAnimationFrame(s.current),null!==l.current&&window.clearTimeout(l.current)},[]),n.useEffect(()=>{null!==t&&null!==o.current&&null===s.current&&(s.current=window.requestAnimationFrame(m))},[t,m]),d.total<=0?null:n.createElement("div",{className:"uh-donut-chart","aria-label":e.title},n.createElement("div",{className:"uh-donut-title"},n.createElement(H,{name:e.icon||"chart",size:16}),e.title),n.createElement("div",{className:"uh-donut-layout"},n.createElement("div",{className:"uh-donut-visual"},n.createElement("svg",{className:"uh-donut-svg",viewBox:"0 0 260 260",role:"img","aria-label":e.title+" "+ba(d.total,a)},n.createElement("circle",{cx:130,cy:130,r:77.5,className:"uh-donut-track",fill:"none",strokeWidth:33,style:{stroke:"var(--uh-donut-track)"}}),d.segments.map(e=>n.createElement("path",{key:"donut-"+e.index,d:ya(130,130,77.5,e.startAngle,e.endAngle),className:"uh-donut-segment"+(t===e.index?" uh-active":""),fill:"none",strokeWidth:33,strokeLinecap:"butt",strokeLinejoin:"round",pathLength:1,style:{animationDelay:90*e.index+"ms",stroke:e.color},tabIndex:0,"aria-label":e.label+" "+ba(e.value,a)+" "+h(e.percentage)+" "+oe(e.cost,a),onMouseEnter:a=>{r(e.index),f(a)},onMouseMove:f,onMouseLeave:b,onFocus:()=>{r(e.index),g({fixed:!0,left:12,top:12})},onBlur:b}))),u?n.createElement("div",{ref:i,className:"uh-donut-tooltip",style:{visibility:"hidden"}},n.createElement("span",{className:"uh-donut-dot",style:{background:u.color}}),void 0===u.iconKey||null===u.iconKey?null:n.createElement(Na,{iconKey:u.iconKey,size:15}),n.createElement("div",{},n.createElement("strong",{},u.label),n.createElement("span",{},ba(u.value,a)+" · "+h(u.percentage)),n.createElement("span",{className:"uh-donut-tooltip-cost"},oe(u.cost,a)))):null,n.createElement("div",{className:"uh-donut-center"},n.createElement("strong",{},fa(d.total,a)),n.createElement("span",{},p(a,"Token","tokens")))),n.createElement("div",{className:"uh-donut-legend",role:"list"},d.segments.map(e=>n.createElement("div",{key:"legend-"+e.index,className:"uh-donut-legend-row",role:"listitem"},n.createElement("span",{className:"uh-donut-legend-mark"},n.createElement("span",{className:"uh-donut-dot",style:{background:e.color}}),void 0===e.iconKey||null===e.iconKey?null:n.createElement(Na,{iconKey:e.iconKey,size:16,showTitle:!0})),n.createElement("div",{className:"uh-donut-legend-copy"},n.createElement("strong",{title:e.label},e.label)),n.createElement("div",{className:"uh-donut-legend-metrics"},n.createElement("span",{},ba(e.value,a)),n.createElement("span",{className:"uh-donut-cost"},oe(e.cost,a))),n.createElement("strong",{className:"uh-donut-percent"},h(e.percentage)))))))});function wa(e,a){return{total:p(a,"总处理","Total"),input:p(a,"输入","Input"),cacheRead:p(a,"缓存命中","Cache hits"),cacheWrite:p(a,"缓存写入","Cache writes"),output:p(a,"输出","Output"),reasoning:p(a,"推理","Reasoning")}[e]||e}const xa=n.memo(function(e){const a=c(e.language)||"en",t=(e,t)=>p(a,e,t),r=Array.isArray(e.rows)?e.rows:[],i=Array.isArray(e.visible)&&e.visible.length>0?e.visible:["total"],[o,s]=n.useState(null),[l,d]=n.useState(null),[u,m]=n.useState(()=>"bar"===Za().trendChart?"bar":"line"),g=900,f=280,b=n.useMemo(()=>sa(r,i,g,f,"bar"===u?"bar":null),[r,i,u]),y=ha,v=ga,w=f-b.padding.bottom,x=n.useMemo(()=>"bar"!==u||e.loading||e.error?[]:function(e,a,t=900,n=250){const r=Array.isArray(e)?e:[],i=Array.isArray(a)?a:[],o=i.filter(e=>"total"!==e),s=sa(r,["total"],t,n,"bar"),l=Math.max(1,n-s.padding.top-s.padding.bottom),d=n-s.padding.bottom,c=s.barWidth,u=e=>Number.isFinite(e)&&e>0?e/s.max*l:0,p=0===o.length||i.includes("total");return r.map((e,a)=>{const t=s.points.total[a].x,n=e&&e.tokens?e.tokens:{},r=[];let i=d,l=0;for(const e of o){const a=Number.isFinite(n[e])?n[e]:0;l+=a;const t=u(a);t<=0||(r.push({key:e,y:i-t,height:t}),i-=t)}const h=e&&Number.isFinite(e.total)?e.total:l;if(p){const e=h-l,a=e>0?u(e):0;a>0&&r.push({key:"total",y:i-a,height:a})}return{x:t-c/2,width:c,segments:r}})}(r,i,g,f),[u,r,i,g,f,e.loading,e.error]),k=n.useMemo(()=>{const e={};for(const a of i){const t=b.points[a]||[],n=ca(t);e[a]={line:n,area:0===t.length?"":n+" L"+t[t.length-1].x.toFixed(2)+" "+w+" L"+t[0].x.toFixed(2)+" "+w+" Z",length:ua(t)}}return e},[b,i,w]),E=n.useMemo(()=>r.length<=1?[0]:Array.from(new Set([0,Math.floor((r.length-1)/4),Math.floor((r.length-1)/2),Math.floor(3*(r.length-1)/4),r.length-1])),[r]),C=!e.loading&&!e.error&&r.length>0,T=r.length>0&&Number.isFinite(r[0].time),S=!T&&r.length>0&&na(r[0]),N=S&&"day"!==r[0].bucket.granularity?function(e,a){const t=e&&e[0]&&e[0].bucket?e[0].bucket:null;if(null===t)return"";const n=function(e){const a=new Map;for(const t of Array.isArray(e)?e:[]){const e=t&&t.bucket&&Number.isFinite(t.bucket.days)?t.bucket.days:0;e<=0||a.set(e,(a.get(e)||0)+1)}let t=0,n=0;for(const[e,r]of a)(r>n||r===n&&e>t)&&(t=e,n=r);return t}(e);if("week"===t.granularity){const e=Math.max(1,Math.round(n/7));return e<=1?p(a,"按周汇总","Weekly"):h(a,"每 {count} 周汇总","Every {count} weeks",{count:e})}return n<=1?p(a,"按天汇总","Daily"):n<28?p(a,"每 ","Every ")+n+p(a," 天汇总"," days"):n<300?p(a,"按月汇总","Monthly"):p(a,"按年汇总","Yearly")}(r,a):"",M=n.useCallback((e,t)=>na(e)?function(e,a,t){const n=ta(e,a,t);return t?n+" – "+Fe(e.bucket.end,a):n}(e,a,t):ta(e,a,t),[a]),A=T?t("每小时 Token 使用趋势,选择小时查看当天请求日志","Hourly Token usage trend; select an hour to view request logs"):t("每日 Token 使用趋势,选择日期查看请求日志","Daily Token usage trend; select a date to view request logs"),D=(null===o||r[o],null===o?null:(b.points[i[0]]||[])[o]||null),z=null===l?null:r[l]||null,U=null===l?null:(b.points[i[0]]||[])[l]||null,P=null!==o&&null!==z&&null!==U,I=null!==U&&U.x>612?" uh-left":" uh-right",L=null===U?void 0:{left:(U.x/g*100).toFixed(2)+"%",top:Math.max(23,Math.min(77,U.y/f*100)).toFixed(2)+"%"},j=e=>{s(e),d(e)},F=e.loading?n.createElement("div",{className:"uh-trend-stage uh-trend-loading",role:"status","aria-label":t("正在加载趋势","Loading trend")},n.createElement("span",{className:"uh-trend-spinner","aria-hidden":!0})):e.error?n.createElement("div",{className:"uh-trend-stage uh-trend-message",role:"alert"},e.error):0===r.length?n.createElement("div",{className:"uh-trend-stage uh-trend-message"},t("该范围内暂无趋势数据","No trend data in this range")):n.createElement("div",{className:"uh-trend-chart-wrap"},n.createElement("svg",{className:"uh-trend-svg",viewBox:"0 0 900 "+f,role:"group","aria-label":A},[0,.5,1].map(e=>n.createElement(n.Fragment,{key:e},n.createElement("line",{x1:b.padding.left,x2:g-b.padding.right,y1:b.padding.top+(f-b.padding.top-b.padding.bottom)*e,y2:b.padding.top+(f-b.padding.top-b.padding.bottom)*e,className:"uh-trend-grid"}),n.createElement("text",{x:b.padding.left-7,y:b.padding.top+(f-b.padding.top-b.padding.bottom)*e+4,className:"uh-trend-axis-label",textAnchor:"end"},R(Math.round(b.max*(1-e)))))),n.createElement("defs",{},i.map(e=>n.createElement("linearGradient",{key:e,id:"uh-trend-gradient-"+e,x1:"0",y1:"0",x2:"0",y2:"1"},n.createElement("stop",{offset:"4%",stopOpacity:v[e]||.12,style:{stopColor:y[e]||ma}}),n.createElement("stop",{offset:"96%",stopOpacity:0,style:{stopColor:y[e]||ma}})))),"bar"===u?x.map((e,a)=>n.createElement("g",{key:"bar-"+a,className:"uh-trend-bar-group",style:{animationDelay:Math.min(16*a,260)+"ms"}},e.segments.map((t,r)=>n.createElement("rect",{key:"bar-"+a+"-"+r,x:e.x,y:t.y,width:e.width,height:t.height,className:"uh-trend-bar","data-series":t.key,style:{fill:y[t.key]||ma}})))):[i.map((e,a)=>{const t=k[e]?k[e].area:"";return""===t?null:n.createElement("path",{key:"area-"+e,d:t,className:"uh-trend-area","data-series":e,fill:"url(#uh-trend-gradient-"+e+")",style:{animationDelay:80+80*a+"ms"}})}),i.map(e=>n.createElement("path",{key:"line-base-"+e,d:k[e]?k[e].line:"",className:"uh-trend-line","data-series":e,style:{stroke:y[e]||ma}})),i.map((e,a)=>{b.points[e];const t=k[e]?k[e].length:0;return n.createElement("path",{key:"line-draw-"+e,d:k[e]?k[e].line:"",className:"uh-trend-line-draw","data-series":e,style:{"--uh-draw-length":t+"px",animationDelay:90*a+"ms",stroke:y[e]||ma}})}),i.map(e=>{const a=b.points[e]||[];if(1!==a.length)return null;const t=a[0];return n.createElement("circle",{key:"single-point-"+e,cx:t.x,cy:t.y,r:4,className:"uh-trend-point",style:{fill:y[e]||ma}})})],null!==o&&D?n.createElement(n.Fragment,{key:"hover-"+o},n.createElement("line",{x1:D.x,x2:D.x,y1:b.padding.top,y2:w,className:"uh-trend-cursor"}),"bar"===u?null:i.map(e=>{const a=(b.points[e]||[])[o];return a?n.createElement("circle",{key:e,cx:a.x,cy:a.y,r:4,className:"uh-trend-point",style:{fill:y[e]||ma}}):null})):null,r.map((t,r)=>{const o=(b.points[i[0]]||[])[r];if(!o)return null;const l=(b.points[i[0]]||[])[r+1],d=l?Math.max(8,l.x-o.x):r>0?Math.max(8,o.x-(b.points[i[0]]||[])[r-1].x):24;return n.createElement("rect",{key:ra(t,r),x:Math.max(b.padding.left,o.x-d/2),y:b.padding.top,width:d,height:f-b.padding.top-b.padding.bottom,className:"uh-trend-hit",tabIndex:S?-1:0,role:S?"img":"button","aria-label":M(t,!0)+" "+wa("total",a)+" "+R(t.total),onMouseEnter:()=>j(r),onMouseLeave:()=>s(null),onFocus:()=>j(r),onBlur:()=>s(null),onKeyDown:a=>{S||"Enter"!==a.key&&" "!==a.key||(a.preventDefault(),"function"==typeof e.onPointClick&&e.onPointClick(ia(t)))},onClick:()=>{S||"function"==typeof e.onPointClick&&e.onPointClick(ia(t))}})}),E.map(e=>{const a=(b.points[i[0]]||[])[e],t=r[e];return a&&t?n.createElement("text",{key:ra(t,e),x:a.x,y:272,className:"uh-trend-axis-label",textAnchor:0===e?"start":e===r.length-1?"end":"middle"},M(t,!1)):null})),z&&U?n.createElement("div",{className:"uh-trend-tooltip"+I+(P?" uh-visible":""),style:L,"aria-hidden":!P},n.createElement("strong",{className:"uh-trend-tooltip-title"},M(z,!0)),i.map(e=>n.createElement("div",{key:e,className:"uh-trend-tooltip-row",style:{color:y[e]||ma}},n.createElement("span",{className:"uh-trend-dot",style:{background:y[e]||ma}}),n.createElement("span",{className:"uh-trend-tooltip-label"},wa(e,a)),n.createElement("strong",{className:"uh-trend-tooltip-value"},R(function(e,a){return"total"===a?e.total:e.tokens&&Number.isFinite(e.tokens[a])?e.tokens[a]:0}(z,e)))))):null);return n.createElement("div",{className:"uh-panel uh-trend-panel"},n.createElement("div",{className:"uh-trend-head"},n.createElement("div",{},n.createElement("h3",{className:"uh-tbl-title uh-title-with-icon"},n.createElement(H,{name:"chart",size:16}),t("Token 使用趋势","Token Usage Trend")),n.createElement("div",{className:"uh-note"},(e.rangeLabel||"")+(S?(e.rangeLabel?" · ":"")+N:""))),C?n.createElement("div",{className:"uh-trend-head-side"},n.createElement("div",{className:"uh-note"},S?t("区间较长,每点为一个周期","Long range summarised: one point per period"):t("点击数据点查看当日明细","Click a point to inspect that day")),n.createElement("div",{className:"uh-range",role:"group","aria-label":t("图表类型","Chart type")},[["line",t("折线","Line")],["bar",t("柱状","Bars")]].map(e=>n.createElement("button",{key:e[0],type:"button",className:u===e[0]?"uh-on":"","aria-pressed":u===e[0],onClick:()=>{return a=e[0],m(a),void Ja({trendChart:a});var a}},e[1])))):null),F,C?n.createElement("div",{className:"uh-trend-legend"},["total","input","cacheRead","cacheWrite","output","reasoning"].map(t=>n.createElement("button",{key:t,type:"button",className:"uh-trend-legend-item"+(i.includes(t)?" uh-on":""),onClick:()=>(a=>{"function"==typeof e.onToggle&&e.onToggle(a)})(t),"aria-pressed":i.includes(t)},n.createElement("span",{className:"uh-trend-dot",style:{background:y[t]||ma}}),wa(t,a)))):null)}),ka=n.memo(function(e){const a=c(e.language)||"en",t=e.day,r=n.useMemo(()=>(t&&Array.isArray(t.perWorkspace)?t.perWorkspace:[]).slice().sort((e,a)=>a.turns-e.turns),[t]),i=void 0===t?null:Xe(t),o=null!==i&&i.input+i.output+i.cacheRead>0?h(a,"Token:输入 {input} · 缓存命中 {cache} · 输出 {output}","Tokens: Input {input} · Cache hits {cache} · Output {output}",{input:R(i.input),cache:R(i.cacheRead),output:R(i.output)}):"";return n.createElement("div",{ref:e.tooltipRef,className:"uh-tip",style:{left:0,top:0,visibility:"hidden"}},n.createElement("div",{className:"uh-tip-date"},Fe(e.date,a)),void 0!==t&&t.turns>0?r.map(t=>n.createElement("div",{key:t.workspaceId,className:"uh-tip-row",onClick:()=>e.onWorkspaceSelect(t.workspaceId)},n.createElement("span",{className:"uh-dot",style:{background:Ke(e.workspaceIndexes.get(t.workspaceId)||0)}}),n.createElement("span",{},e.workspaceTitles.get(t.workspaceId)||p(a,"未知工作区","Unknown workspace")),n.createElement("span",{className:"uh-n"},h(a,"{count} 次","{count} uses",{count:t.turns})))):n.createElement("div",{className:"uh-empty",style:{padding:"6px 0"}},p(a,"这一天没有使用记录","No usage records for this day")),""!==o?n.createElement("div",{className:"uh-tip-tokens"},o):null)}),Ea=n.memo(function(e){const a=c(e.language)||"en",t=(e,t)=>p(a,e,t),i=Array.isArray(e.workspaces)?e.workspaces:[],o=Array.isArray(e.rows)?e.rows:[],s=e.workspaceId||null,[l,d]=n.useState(null),u=n.useRef(null),m=n.useRef(null),g=n.useRef({x:0,y:0}),f=n.useRef(null),b=n.useRef(null),y=n.useRef(e.onDateClick),w=n.useRef(e.onWorkspaceSelect);y.current=e.onDateClick,w.current=e.onWorkspaceSelect;const x=(k=e.span,Ve[Je(k)]);var k;const C=x<Ve[Ze]?34*x+3*(x-1)+"px":null,T={minWidth:13*x+"px"},S={gridTemplateColumns:"repeat("+x+", minmax(10px, 1fr))",minWidth:13*x+"px"};null!==C&&(T.maxWidth=C,S.maxWidth=C);const N=n.useMemo(()=>function(e,a,t,n){const r=Number.isSafeInteger(n)&&n>0&&n<=53?n:Ve[Ze],i=String(e||"").split("-").map(Number),o=a?new Date(Date.UTC(i[0],i[1]-1,i[2])):new Date(i[0],i[1]-1,i[2]),s=a?o.getUTCDay():o.getDay(),l=E(o,-s,a),d=E(l,7*-(r-1),a),c=[];for(let e=0;e<7*r;e+=1){const t=E(d,e,a);c.push({date:v(t,a),month:a?t.getUTCMonth():t.getMonth(),year:a?t.getUTCFullYear():t.getFullYear()})}const u=[];for(let e=0;e<r;e+=1){const a=c[7*e],n=e>0?c[7*(e-1)]:null;null!==n&&a.month===n.month||u.push({left:100*e/r+"%",text:We(a.year,a.month,t)})}return{cells:c,months:u,weekdays:He(t,!1).map((e,a)=>a%2==1?e:"")}}(e.todayKey,!0===e.utc,a,x),[e.todayKey,e.utc,a,x]),M=n.useMemo(()=>{const e=new Map;for(const a of o)a&&"string"==typeof a.date&&e.set(a.date,a);return e},[o]),A=n.useMemo(()=>{const a=new Map,n=new Map,r=e.aliases&&"object"==typeof e.aliases?e.aliases:{};return i.forEach((e,i)=>{const o=r[e.id],s=!0===e.retiredBucket,l=s?t("已删除","Deleted"):"string"==typeof o&&""!==o?o:e.title||t("未知工作区","Unknown workspace");a.set(e.id,!0!==e.deleted||s?l:l+t("(已删除)"," (deleted)")),n.set(e.id,i)}),{titles:a,indexes:n}},[i,e.aliases,a]),D=n.useCallback(()=>{f.current=null,null!==b.current&&(window.clearTimeout(b.current),b.current=null);const e=m.current;if(null===e)return;const a=g.current,t="undefined"==typeof window?1280:window.innerWidth;e.style.left=a.x+14+"px",e.style.top=a.y+12+"px",e.style.transform=a.x>.65*t?"translateX(calc(-100% - 28px))":"none",e.style.visibility="visible"},[]),z=n.useCallback((e,a)=>{g.current={x:e,y:a},null===f.current&&(f.current=window.requestAnimationFrame(D),b.current=window.setTimeout(()=>{null!==f.current&&(window.cancelAnimationFrame(f.current),D())},80))},[D]);n.useEffect(()=>()=>{null!==f.current&&window.cancelAnimationFrame(f.current),null!==b.current&&window.clearTimeout(b.current)},[]),n.useEffect(()=>{null!==l&&null===f.current&&(f.current=window.requestAnimationFrame(D))},[l,D]);const U=n.useCallback((e,a)=>{u.current!==e&&(u.current=e,d(e)),z(a.clientX,a.clientY)},[z]),P=n.useRef([]),R=n.useCallback(e=>{const a=P.current,t=null==a?void 0:a[e];if(null!=t&&"function"==typeof t.focus){for(const e of a)null!=e&&(e.tabIndex=-1);t.tabIndex=0,t.focus()}},[]),I=n.useCallback((e,a)=>{const t=null==a||"function"!=typeof a.getBoundingClientRect?null:a.getBoundingClientRect();U(e,{clientX:null===t?0:t.left+t.width/2,clientY:null===t?0:t.top})},[U]),L=n.useCallback((e,a,t)=>{const n=e.key;if("Enter"===n||" "===n||"Spacebar"===n){e.preventDefault();const a=null===e.currentTarget?"":e.currentTarget.getAttribute("data-date");return void("function"==typeof y.current&&"string"==typeof a&&y.current(a))}const r="ArrowRight"===n?a+1:"ArrowLeft"===n?a-1:"ArrowDown"===n?a+7:"ArrowUp"===n?a-7:"Home"===n?0:"End"===n?t-1:null;null!==r&&(e.preventDefault(),r<0||r>=t||R(r))},[R]),j=n.useCallback(e=>{z(e.clientX,e.clientY)},[z]),F=n.useCallback(()=>{u.current=null,d(null)},[]),O=n.useCallback(e=>{"function"==typeof w.current&&w.current(e),F()},[F]),W=n.useMemo(()=>{const a=N.cells.map(e=>e.date);if(a.indexOf(e.todayKey)>=0)return e.todayKey;for(let e=a.length-1;e>=0;e-=1)if(M.has(a[e]))return a[e];return a.length>0?a[0]:null},[N.cells,M,e.todayKey]),q=N.cells.length,B=n.useMemo(()=>N.cells.map((t,r)=>{const i=M.get(t.date);let o=0;if(void 0!==i)if(!0===e.queryUsable||null===s)o=i.turns;else{const e=Array.isArray(i.perWorkspace)?i.perWorkspace.find(e=>e.workspaceId===s):void 0;void 0!==e&&(o=e.turns)}const l=null!==s&&void 0!==i&&i.turns>0&&0===o,d=function(e,a,t){const n=Fe(e,t),r=Number.isFinite(a)&&a>0?a:0,i=r>0?h(t,"{count} 次使用","{count} uses",{count:r}):p(t,"无使用记录","no usage");return h(t,"{date}:{amount}","{date}: {amount}",{date:n,amount:i})}(t.date,o,a),c={background:Ye(qe(o)),opacity:l?.22:1,animationDelay:r%25*6+"ms"},u=t.date===e.todayKey?"uh-cell uh-today":"uh-cell";return n.createElement("div",{key:t.date,className:u,style:c,role:"button","data-date":t.date,"aria-label":d,tabIndex:t.date===W?0:-1,ref:e=>{P.current[r]=e},onMouseEnter:e=>U(t.date,e),onMouseMove:j,onMouseLeave:F,onFocus:e=>I(t.date,e.currentTarget),onBlur:F,onKeyDown:e=>L(e,r,q),onClick:()=>{"function"==typeof y.current&&y.current(t.date)}})}),[N.cells,M,e.queryUsable,e.todayKey,s,U,j,F,I,L,W,q,a]),Y=null===l?void 0:M.get(l);return n.createElement("div",{className:"uh-panel"},n.createElement("div",{className:"uh-section-title"},n.createElement(H,{name:"calendar",size:16}),t("使用热力图","Usage Heatmap")),n.createElement("div",{className:"uh-hm-head"},n.createElement("div",{className:"uh-chips"},i.map((e,a)=>n.createElement("button",{key:e.id,className:"uh-chip"+(s===e.id?" uh-on":""),onClick:()=>O(e.id),title:e.path||(!0===e.retiredBucket?t("已删除","Deleted"):"")},n.createElement("span",{className:"uh-dot",style:{background:Ke(a)}}),n.createElement("span",{className:"uh-chip-title"},A.titles.get(e.id))))),n.createElement("div",{className:"uh-hm-tools"},n.createElement("div",{className:"uh-range uh-heatmap-spans",role:"group","aria-label":t("热力图范围","Heatmap span")},Ge.map(a=>n.createElement("button",{key:a,type:"button",className:Je(e.span)===a?"uh-on":"","aria-pressed":Je(e.span)===a,title:"30d"===a?t("最近 30 天(格子更大)","Last 30 days (larger cells)"):"90d"===a?t("最近 90 天","Last 90 days"):t("最近 12 个月","Last 12 months"),onClick:()=>{"function"==typeof e.onSpanChange&&e.onSpanChange(a)}},"30d"===a?t("30 天","30 days"):"90d"===a?t("90 天","90 days"):t("12 个月","12 months")))),n.createElement("div",{className:"uh-legend","aria-hidden":!0},n.createElement("span",{},t("少","Less")),[0,1,2,3,4].map(e=>n.createElement("span",{key:e,className:"uh-cell",style:{background:Ye(e)}})),n.createElement("span",{},t("多","More"))))),n.createElement("div",{className:"uh-hm-scroll"},n.createElement("div",{className:"uh-months",style:T},N.months.map((e,a)=>n.createElement("span",{key:a,style:{left:e.left}},e.text))),n.createElement("div",{className:"uh-hm-body"},n.createElement("div",{className:"uh-wdays"},N.weekdays.map((e,a)=>n.createElement("span",{key:a},e))),n.createElement("div",{className:"uh-grid",style:S,role:"group","aria-label":t("使用热力图日历:方向键浏览,回车查看当日明细","Usage heatmap calendar: arrow keys to browse, Enter for the day detail")},B))),n.createElement("div",{className:"uh-note",style:{marginTop:10}},t("口径:每完成一个回合点亮一次(含子代理会话);悬停查看按工作区明细,点击工作区可筛选热力图与明细表;键盘可用方向键浏览、回车查看当日明细。日期按本机时区。","Methodology: one cell lights up for each completed turn, including subagent sessions. Hover to view workspace details; click a workspace to filter the heatmap and detail tables. Dates and day boundaries follow this machine's time zone.")),null!==l?null==(K=n.createElement(ka,{date:l,day:Y,language:a,tooltipRef:m,workspaceTitles:A.titles,workspaceIndexes:A.indexes,onWorkspaceSelect:O}))||null===r||"function"!=typeof r.createPortal||"undefined"==typeof document||null===document||null===document.body||void 0===document.body?K:r.createPortal(K,document.body):null);var K});function Ca(e,a){return Number(e&&e.values&&e.values[a])||0}const Ta=n.memo(function(e){return e.render()},(e,a)=>e.revision===a.revision),Sa=n.memo(function(e){return e.render(e.view)},function(e,a){return e===a||e.busy===a.busy&&e.language===a.language&&e.openSection===a.openSection&&e.searchText===a.searchText&&e.searchOpen===a.searchOpen&&e.searchOptions===a.searchOptions&&e.temporalDraft===a.temporalDraft&&e.temporalPlan===a.temporalPlan&&e.holidayStatus===a.holidayStatus&&e.holidayLoading===a.holidayLoading&&(t=e.view,n=a.view,t===n||null!=t&&null!=n&&t.key===n.key&&t.model===n.model&&t.status===n.status&&t.reason===n.reason&&t.source===n.source&&t.mapped===n.mapped&&t.usageBacked===n.usageBacked&&t.mappable===n.mappable&&t.pricingModel===n.pricingModel&&t.providerId===n.providerId&&t.tiered===n.tiered&&t.tierCount===n.tierCount&&t.tieredInvalid===n.tieredInvalid&&t.multiplier===n.multiplier&&t.inputTokenSemantics===n.inputTokenSemantics&&t.temporalExplicit===n.temporalExplicit&&t.temporalBuiltin===n.temporalBuiltin&&t.temporalConfigInvalid===n.temporalConfigInvalid&&t.temporalRulesUnavailable===n.temporalRulesUnavailable&&t.temporalPolicyId===n.temporalPolicyId&&t.temporalRuleCount===n.temporalRuleCount&&t.overrideIndex===n.overrideIndex&&t.mappingIndex===n.mappingIndex&&function(e,a){return e===a||null!=e&&null!=a&&e.input===a.input&&e.output===a.output&&e.cacheRead===a.cacheRead&&e.cacheWrite===a.cacheWrite}(t.rates,n.rates)&&function(e,a){if(e===a)return!0;const t=Array.isArray(e)?e:[],n=Array.isArray(a)?a:[];if(t.length!==n.length)return!1;for(let e=0;e<t.length;e+=1){const a=t[e],r=n[e];if(a!==r){if(null==a||null==r)return!1;if(a.size!==r.size||a.input!==r.input||a.output!==r.output||a.cacheRead!==r.cacheRead||a.cacheWrite!==r.cacheWrite)return!1}}return!0}(t.tiers,n.tiers)&&ye(t.basis)===ye(n.basis));var t,n}),Na=n.memo(function(e){const a=Number.isFinite(e.size)?e.size:18,t=null===e.iconKey?null:void 0!==e.iconKey?W.get(e.iconKey)||null:J(e.row),r=null===t?"":t.key+"\0"+t.href,[i,o]=n.useState(null),s={width:a,height:a,minWidth:a};if(null===t||null!==i&&i===r)return n.createElement("span",{className:"uh-model-icon uh-model-icon-fallback"+(e.className?" "+e.className:""),style:s,"aria-hidden":!0},n.createElement(H,{name:"cache",size:a}));const l=!0===e.showTitle;return n.createElement("span",{className:"uh-model-icon"+(e.className?" "+e.className:""),style:s,...l?{}:{"aria-hidden":!0}},n.createElement("img",{key:r,src:t.href,alt:l?t.label:"",title:l?t.label:void 0,width:a,height:a,loading:"lazy",decoding:"async",draggable:!1,onError:()=>o(r)}))}),Ma=n.memo(function(e){const a=c(e.language)||"en",t=(e,t)=>p(a,e,t),r=Array.isArray(e.rows)?e.rows:[],i=n.useMemo(()=>r.find(a=>a.id===e.selectedId)||r[0]||null,[r,e.selectedId]),o=n.useRef(null),s=()=>{!0!==e.hasMore||e.loading||"function"==typeof e.onLoadMore&&e.onLoadMore()};n.useEffect(()=>{const a=o.current;null!==a&&(!0!==e.hasMore||e.loading||a.scrollHeight<=a.clientHeight+4&&s())},[r,e.hasMore,e.loading]);const l=e=>e&&"ledger-recovery"===e.materialization?t("账本恢复","Ledger recovery"):e&&"ledger-reuse"===e.materialization?t("账本复用","Ledger reuse"):e&&"scan"===e.materialization?t("扫描","Scan"):e&&"live"===e.materialization?t("实时","Live"):t("未知","Unknown"),d=(e,t)=>e&&Number.isFinite(e.time)?new Date(e.time).toLocaleString(u(a),t?void 0:{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"—",m=a=>{"function"==typeof e.onSelect&&e.onSelect(a)};return n.createElement("div",{className:"uh-panel uh-records-panel",ref:e.panelRef,style:{display:e.visible?"block":"none"}},n.createElement("div",{className:"uh-records-head"},n.createElement("div",{},n.createElement("h3",{className:"uh-tbl-title uh-title-with-icon"},n.createElement(H,{name:"list",size:16}),t("请求日志","Request Logs")),n.createElement("div",{className:"uh-note"},e.scopeLabel+(e.scopeUtc?" · UTC":""))),n.createElement("div",{className:"uh-actions"},e.loading?n.createElement("span",{className:"uh-query-note"},t("同步中…","Refreshing…")):null,n.createElement("button",{type:"button",className:"uh-refresh",title:t("导出当前日志","Export current logs"),onClick:e.onExport,disabled:e.exporting||!e.scopeAvailable},n.createElement(H,{name:"export",size:13}),e.exporting?t("导出中…","Exporting…"):t("导出日志","Export logs")))),""!==e.error?n.createElement("div",{className:"uh-records-error",role:"alert"},"stale"===e.error?t("数据已更新,正在重新加载日志…","Data changed; reloading logs…"):"audit-export"===e.error?t("日志导出失败","Unable to export logs"):t("日志加载失败,请重试","Unable to load logs")):null,n.createElement("div",{className:"uh-records-note"},t("按时间倒序显示可审计的 Token 调用;选择一行查看 turn / step 和完整 Token 分桶。","Token calls are newest first; select a row to inspect its turn / step and token buckets.")),0!==r.length||e.loading?n.createElement("div",{className:"uh-records-scroll",ref:o,onScroll:e=>{const a=e.currentTarget;a.scrollTop+a.clientHeight>=a.scrollHeight-120&&s()}},n.createElement("div",{className:"uh-record-grid uh-record-header"},n.createElement("div",{},t("时间","Time")),n.createElement("div",{},t("Provider / 模型","Provider / Model")),n.createElement("div",{className:"uh-record-num"},"turn / step"),n.createElement("div",{className:"uh-record-num"},t("输入","Input")),n.createElement("div",{className:"uh-record-num"},t("缓存命中","Cache read")),n.createElement("div",{className:"uh-record-num"},t("缓存写入","Cache write")),n.createElement("div",{className:"uh-record-num"},t("输出","Output")),n.createElement("div",{className:"uh-record-num"},t("成本","Cost")),n.createElement("div",{},t("来源","Source"))),r.map(e=>n.createElement("div",{key:e.id,className:"uh-record-grid uh-record-row"+(i&&i.id===e.id?" uh-on":""),role:"button",tabIndex:0,"aria-pressed":i&&i.id===e.id,onClick:()=>m(e.id),onKeyDown:a=>{"Enter"!==a.key&&" "!==a.key||(a.preventDefault(),m(e.id))}},n.createElement("div",{className:"uh-record-time"},d(e,!1)),n.createElement("div",{className:"uh-record-model",title:e.model||""},n.createElement("span",{className:"uh-model-label"},n.createElement(Na,{row:e,size:16}),n.createElement("span",{className:"uh-model-text"},e.model||t("未知模型","Unknown model"))),e.requestedModel&&e.actualModel&&e.requestedModel!==e.actualModel?n.createElement("small",{},e.requestedModel+" → "+e.actualModel):null),n.createElement("div",{className:"uh-record-num"},(null===e.turn||void 0===e.turn?"—":e.turn)+" / "+(null===e.step||void 0===e.step?"—":e.step)),n.createElement("div",{className:"uh-record-num"},R(Ca(e,"input"))),n.createElement("div",{className:"uh-record-num"},R(Ca(e,"cacheRead"))),n.createElement("div",{className:"uh-record-num"},R(Ca(e,"cacheWrite"))),n.createElement("div",{className:"uh-record-num"},R(Ca(e,"output"))),n.createElement("div",{className:"uh-record-num uh-cost-num"},oe(e,a),!e.cost||"peak"!==e.cost.pricingBand&&"off-peak"!==e.cost.pricingBand?null:n.createElement("small",{className:"uh-record-band-badge"},"peak"===e.cost.pricingBand?p(a,"峰","Peak"):p(a,"谷","OFF"))),n.createElement("div",{className:"uh-record-source"},l(e))))):n.createElement("div",{className:"uh-empty"},t("当前范围没有可审计的 Token 调用","No auditable Token calls in this scope")),n.createElement("div",{className:"uh-records-footer"},n.createElement("span",{className:"uh-note"},r.length>0?e.hasMore?h(a,"已显示 {count} 条,继续加载可查看更多","{count} shown; load more for additional records",{count:r.length}):h(a,"共显示 {count} 条","{count} records shown",{count:r.length}):""),e.hasMore?n.createElement("button",{type:"button",className:"uh-refresh",onClick:e.onLoadMore,disabled:e.loading},e.loading?t("加载中…","Loading…"):t("加载更多","Load more")):null),i?n.createElement("div",{className:"uh-record-detail"},n.createElement("div",{className:"uh-record-detail-head"},n.createElement("strong",{},t("选中调用","Selected call")),n.createElement("span",{className:"uh-note"},d(i,!0))),n.createElement("div",{className:"uh-record-detail-meta"},n.createElement("span",{className:"uh-model-label"},n.createElement(Na,{row:i,size:16,showTitle:!0}),n.createElement("span",{},(i.provider||t("未知供应商","Unknown provider"))+" / "+(i.actualModel||i.requestedModel||i.model||t("未知模型","Unknown model")))),n.createElement("span",{},"turn "+(null===i.turn||void 0===i.turn?"—":i.turn)+" · step "+(null===i.step||void 0===i.step?"—":i.step)),n.createElement("span",{},t("来源:","Source: ")+l(i)),n.createElement("span",{},t("计价模型:","Pricing model: ")+(i.cost&&i.cost.pricingModel?i.cost.pricingModel:t("未计价","unpriced"))),n.createElement("span",{className:"uh-record-band "+(i.cost&&i.cost.pricingBand?"uh-record-band-"+i.cost.pricingBand:"")},t("计费档位:","Billing band: ")+function(e,a){const t=e&&e.cost&&"object"==typeof e.cost?e.cost:{};return"peak"===t.pricingBand?p(a,"峰时","Peak"):"off-peak"===t.pricingBand?!0===t.pricingHoliday?p(a,"节假日谷时","Holiday off-peak"):p(a,"谷时","Off-peak"):"route-not-official"===t.temporalExemptReason?p(a,"静态价(非官方直连)","static (non-first-party)"):"no-temporal-profile"===t.temporalExemptReason?p(a,"静态价(无峰谷计划)","static (no band plan)"):"—"}(i,a)),null!==se(i,a)?n.createElement("span",{className:"uh-record-band",title:i.cost&&i.cost.pricingPolicyHash||""},t("计费计划:","Plan: ")+se(i,a)):null),n.createElement("div",{className:"uh-record-token-strip"},["input","cacheRead","cacheWrite","output","reasoning"].map(e=>n.createElement("div",{key:e},n.createElement("span",{},"cacheRead"===e?t("缓存命中","Cache read"):"cacheWrite"===e?t("缓存写入","Cache write"):"reasoning"===e?t("推理","Reasoning"):"input"===e?t("输入","Input"):t("输出","Output")),n.createElement("strong",{},R(Ca(i,e))))),n.createElement("div",{className:"uh-record-token-total"},n.createElement("span",{},t("总处理","Total")),n.createElement("strong",{},R(Ca(g=i,"input")+Ca(g,"cacheRead")+Ca(g,"cacheWrite")+Ca(g,"output")+Ca(g,"reasoning")))),n.createElement("div",{className:"uh-record-token-total"},n.createElement("span",{},t("成本","Cost")),n.createElement("strong",{},oe(i,a))))):null);var g},function(e,a){return e.visible===a.visible&&e.scopeLabel===a.scopeLabel&&e.scopeUtc===a.scopeUtc&&e.scopeAvailable===a.scopeAvailable&&e.loading===a.loading&&e.exporting===a.exporting&&e.error===a.error&&e.rows===a.rows&&e.selectedId===a.selectedId&&e.hasMore===a.hasMore&&e.language===a.language&&e.actionKey===a.actionKey}),Aa=n.memo(function(e){const a=Array.isArray(e.options)?e.options:[],t=void 0===e.value||null===e.value?"":String(e.value),r=a.find(e=>String(e.value)===t),[i,o]=n.useState(!1),s=n.useRef(null),l=n.useRef(null);n.useEffect(()=>{i&&null!==l.current&&"function"==typeof l.current.scrollIntoView&&l.current.scrollIntoView({block:"nearest",inline:"nearest"})},[i]),n.useEffect(()=>{if(!i||"undefined"==typeof document)return;const e=e=>{s.current&&!s.current.contains(e.target)&&o(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[i]);const d=a=>{const t=null==a||void 0===a.iconKey||null===a.iconKey?null:a.iconKey;return null===t?n.createElement(H,{name:e.icon||"chart",size:14}):n.createElement(Na,{iconKey:t,size:14})};return n.createElement("div",{className:"uh-language-menu uh-filter-menu"+(e.className?" "+e.className:"")+(i?" uh-open":""),ref:s,onKeyDown:e=>{"Escape"===e.key&&i&&(e.preventDefault(),e.stopPropagation(),o(!1))}},n.createElement("button",{type:"button",className:"uh-language-trigger uh-filter-trigger"+(i?" uh-open":""),title:r?r.label:e.label,"aria-label":e.ariaLabel||e.label,"aria-haspopup":"listbox","aria-expanded":i,onClick:()=>o(e=>!e)},d(r),n.createElement("span",{className:"uh-filter-label"},r?r.label:e.label),n.createElement(H,{name:"chevron",size:13,className:"uh-language-caret"})),i?n.createElement("div",{className:"uh-language-options uh-filter-options",role:"listbox","aria-label":e.ariaLabel||e.label},a.map(a=>{const r=String(a.value),i=r===t;return n.createElement("button",{key:r,type:"button",role:"option","aria-selected":i,ref:i?l:void 0,className:"uh-language-option"+(i?" uh-on":""),onClick:()=>{return a=r,"function"==typeof e.onChange&&e.onChange(a),void o(!1);var a}},d(a),n.createElement("span",{className:"uh-filter-option-label"},a.label),i?n.createElement(H,{name:"check",size:14,className:"uh-language-option-check"}):null)})):null)}),Da="dsh-all-usage/styles.css";if("undefined"!=typeof document){let e=document.querySelector("style[data-plugin-css="+JSON.stringify(Da)+"]");null===e&&(e=document.createElement("style"),e.dataset.plugin="dsh-all-usage",e.dataset.pluginCss=Da,document.head.appendChild(e)),e.textContent='\n/* Theme tokens: the panel now paints on both host palettes. The host toggles\n the data-ds-dark-theme attribute on <body>, so the light values are the defaults; the dark\n block repeats exactly the colours the panel used before (dark stays a no-op).\n Data colours live here because JS paints them too, and var() does not resolve in\n SVG presentation attributes - the call sites move those into style. The sheet\n itself (the modal scrim) needs the tokens as well, because custom properties only\n inherit downwards and .uh-side-modal is the parent of .uh-side-dialog. */\n.uh-side-modal, .uh-side-dialog, .uh-panel, .uh-tip, .uh-donut-tooltip, .uh-trend-tooltip {\n --uh-series-total:#8a5a00;\n --uh-series-input:#0b5cad;\n --uh-series-cache-read:#17703a;\n --uh-series-cache-write:#6d2fb8;\n --uh-series-output:#a8451c;\n --uh-series-reasoning:#55606f;\n --uh-series-other:#6b7280;\n --uh-donut-1:#0a63c9;\n --uh-donut-2:#1a7a3c;\n --uh-donut-3:#7a34c9;\n --uh-donut-4:#a8620a;\n --uh-donut-5:#bf2439;\n --uh-donut-6:#0d7b93;\n --uh-donut-track:color-mix(in srgb, var(--dsw-alias-label-primary) 9%, var(--dsw-alias-bg-layer-2));\n --uh-heat:#0969da;\n --uh-today:#17703a;\n --uh-cell-empty:color-mix(in srgb, var(--dsw-alias-label-primary) 7%, var(--dsw-alias-bg-layer-2));\n --uh-scrim:var(--dsw-alias-bg-mask-1, rgba(0,0,0,.24));\n --uh-dialog-shadow:0 -10px 44px rgba(0,0,0,.12);\n --uh-scrollbar-thumb:#c2c7cf;\n --uh-scrollbar-track:transparent;\n --uh-scrollbar-track-border:transparent;\n --uh-workspace-lightness:42%;\n}\nbody[data-ds-dark-theme] .uh-side-modal, body[data-ds-dark-theme] .uh-side-dialog, body[data-ds-dark-theme] .uh-panel, body[data-ds-dark-theme] .uh-tip, body[data-ds-dark-theme] .uh-donut-tooltip, body[data-ds-dark-theme] .uh-trend-tooltip {\n --uh-series-total:#f4c542;\n --uh-series-input:#5aa9ff;\n --uh-series-cache-read:#44d483;\n --uh-series-cache-write:#d98bff;\n --uh-series-output:#ff8c66;\n --uh-series-reasoning:#aab4c4;\n --uh-series-other:#b8c2cf;\n --uh-donut-1:#0a84ff;\n --uh-donut-2:#30d158;\n --uh-donut-3:#bf5af2;\n --uh-donut-4:#ff9f0a;\n --uh-donut-5:#ff375f;\n --uh-donut-6:#64d2ff;\n --uh-donut-track:var(--dsw-alias-bg-layer-2);\n --uh-heat:#0969da;\n --uh-today:#44d483;\n --uh-cell-empty:var(--dsw-alias-bg-layer-2);\n --uh-scrim:rgba(0,0,0,.34);\n --uh-dialog-shadow:0 -10px 44px rgba(0,0,0,.25);\n --uh-scrollbar-thumb:#707780;\n --uh-scrollbar-track:#1d1f22;\n --uh-scrollbar-track-border:#363a40;\n --uh-workspace-lightness:55%;\n}\n.uh-page { display:flex; flex-direction:column; gap:14px; padding:2px 2px 28px; font-family:inherit; }\n.uh-head { position:relative; z-index:20; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }\n.uh-title { margin:0; font-size:15px; font-weight:600; color:var(--dsw-alias-label-primary); }\n.uh-title-wrap { display:flex; align-items:center; gap:10px; flex-wrap:wrap; min-width:0; }\n/* Version chip: the running version plus the registry verdict, clickable to the repo. */\n.uh-version { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--dsw-alias-border-l1); background:transparent; color:var(--dsw-alias-label-secondary); border-radius:999px; padding:2px 9px; font:inherit; font-size:12px; cursor:pointer; transition:background-color .15s ease, border-color .15s ease, color .15s ease; }\n.uh-version:hover { background:var(--dsw-alias-bg-layer-1); color:var(--dsw-alias-label-primary); }\n.uh-version-number { font-variant-numeric:tabular-nums; }\n.uh-version-status { color:var(--dsw-alias-label-tertiary, var(--dsw-alias-label-secondary)); }\n.uh-version-outdated { border-color:color-mix(in srgb, var(--dsw-alias-brand-primary) 55%, transparent); color:var(--dsw-alias-brand-primary); }\n.uh-version-outdated .uh-version-status { color:inherit; font-weight:600; }\n.uh-gh { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--dsw-alias-border-l1); background:transparent; color:var(--dsw-alias-label-secondary); border-radius:999px; padding:2px 9px; font:inherit; font-size:11px; line-height:1.6; cursor:pointer; }\n.uh-gh:hover { background:var(--dsw-alias-bg-layer-1); color:var(--dsw-alias-label-primary); }\n.uh-gh-star { flex:none; fill:#f5c542; }\n.uh-gh-mark { flex:none; fill:var(--dsw-alias-label-primary); }\n.uh-gh-label { color:var(--dsw-alias-label-primary); font-weight:600; letter-spacing:0; }\n.uh-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }\n/* When the toolbar wraps, the action row lands on a line of its own; without this the\n row starts at the left edge and the buttons look detached from the right side. */\n.uh-head > .uh-actions { margin-left:auto; }\n.uh-language-menu, .uh-filter-menu { position:relative; z-index:12; }\n.uh-filter-menu { flex:0 1 auto; min-width:0; }\n.uh-filter-workspace { width:180px; }\n.uh-filter-provider { width:180px; }\n.uh-filter-model { width:260px; }\n.uh-filter-menu.uh-open { z-index:14; }\n.uh-language-trigger { display:inline-flex; align-items:center; gap:6px; min-height:30px; padding:4px 9px 4px 10px; border:1px solid transparent; border-radius:15px; background:color-mix(in srgb, var(--dsw-alias-label-primary) 7%, var(--dsw-alias-bg-layer-1)); color:var(--dsw-alias-label-primary); font:inherit; font-size:12px; font-weight:600; line-height:1; cursor:pointer; transition:border-color .15s ease, background-color .15s ease, transform .1s ease; }\n.uh-filter-trigger { width:100%; min-width:0; justify-content:flex-start; }\n.uh-language-trigger:hover, .uh-language-trigger.uh-open { border-color:color-mix(in srgb, var(--dsw-alias-brand-primary) 58%, var(--dsw-alias-border-l2)); background:color-mix(in srgb, var(--dsw-alias-brand-primary) 13%, var(--dsw-alias-bg-layer-1)); }\n.uh-language-trigger:active { transform:scale(.96); }\n.uh-language-label { min-width:26px; text-align:left; }\n.uh-filter-label { min-width:0; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:left; }\n.uh-language-caret { color:var(--dsw-alias-label-secondary); transition:transform .18s ease; }\n.uh-language-trigger.uh-open .uh-language-caret { transform:rotate(180deg); }\n.uh-language-menu.uh-open { z-index:30; }\n.uh-language-options { position:absolute; top:calc(100% + 7px); right:0; min-width:142px; max-height:min(320px, calc(100vh - 140px)); overflow-y:auto; padding:5px; border:1px solid var(--dsw-alias-border-l2); border-radius:12px; background:var(--dsw-alias-bg-layer-1); box-shadow:0 14px 28px color-mix(in srgb, #000 24%, transparent); animation:uh-menu-in .16s ease both; }\n.uh-filter-options { left:0; right:auto; min-width:100%; max-width:300px; }\n.uh-language-option { display:flex; align-items:center; gap:8px; width:100%; min-height:32px; padding:6px 8px; border:0; border-radius:8px; background:transparent; color:var(--dsw-alias-label-primary); font:inherit; font-size:12px; text-align:left; cursor:pointer; transition:background-color .14s ease, color .14s ease; }\n.uh-filter-option-label { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.uh-language-option:hover, .uh-language-option:focus-visible { background:color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, var(--dsw-alias-bg-layer-2)); outline:0; }\n.uh-language-option.uh-on { background:color-mix(in srgb, var(--dsw-alias-brand-primary) 19%, var(--dsw-alias-bg-layer-2)); color:var(--dsw-alias-label-primary); font-weight:600; }\n.uh-language-option-check { margin-left:auto; color:var(--dsw-alias-brand-primary); }\n/* Provider and model lists grow with the ledger; the menu scrolls inside itself\n instead of running past the bottom of the window. */\n.uh-filter-options { max-height:min(60vh, 420px); overflow-y:auto; overscroll-behavior:contain; }\n.uh-range { display:inline-flex; border:1px solid var(--dsw-alias-border-l2); border-radius:8px; overflow:hidden; }\n.uh-range button { border:0; background:transparent; color:var(--dsw-alias-label-secondary); padding:4px 12px; font-size:12px; cursor:pointer; font-family:inherit; transition:background-color .15s ease, color .15s ease; }\n.uh-range button + button { border-left:1px solid var(--dsw-alias-border-l2); }\n.uh-range button.uh-on { background:color-mix(in srgb, var(--dsw-alias-brand-primary) 20%, var(--dsw-alias-bg-layer-2)); color:var(--dsw-alias-label-primary); font-weight:600; }\n.uh-custom-range { display:grid; grid-template-columns:minmax(180px, 1fr) auto auto; gap:10px 14px; align-items:end; padding:12px; border:1px solid var(--dsw-alias-border-l1); border-radius:10px; background:var(--dsw-alias-bg-layer-1); }\n.uh-custom-range-meta { min-width:0; }\n.uh-custom-range-title { display:flex; align-items:center; gap:7px; color:var(--dsw-alias-label-primary); font-size:13px; font-weight:600; }\n.uh-custom-range-note { margin-top:3px; color:var(--dsw-alias-label-secondary); font-size:11px; line-height:1.45; }\n.uh-custom-range-fields { display:grid; grid-template-columns:repeat(2, minmax(136px, 1fr)); gap:8px; }\n.uh-custom-range-field { display:flex; flex-direction:column; gap:4px; color:var(--dsw-alias-label-secondary); font-size:11px; }\n.uh-custom-range-field input { min-width:0; min-height:30px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:3px 7px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:12px; outline:none; }\n.uh-custom-range-field input:focus { border-color:var(--dsw-alias-brand-primary); }\n.uh-custom-range-actions { display:flex; gap:6px; }\n.uh-custom-range-cancel, .uh-custom-range-apply { min-height:30px; border-radius:6px; padding:4px 10px; font:inherit; font-size:12px; cursor:pointer; }\n.uh-custom-range-cancel { border:1px solid var(--dsw-alias-border-l2); background:transparent; color:var(--dsw-alias-label-primary); }\n.uh-custom-range-apply { border:1px solid var(--dsw-alias-brand-primary); background:color-mix(in srgb, var(--dsw-alias-brand-primary) 16%, transparent); color:var(--dsw-alias-label-primary); }\n.uh-custom-range-apply:disabled { opacity:.48; cursor:not-allowed; }\n.uh-custom-range-error { grid-column:1 / -1; color:#d92d20; font-size:12px; }\n.uh-refresh { border:1px solid var(--dsw-alias-border-l2); background:var(--dsw-alias-bg-layer-1); color:var(--dsw-alias-label-primary); border-radius:8px; padding:4px 12px; font-size:12px; cursor:pointer; font-family:inherit; transition:border-color .15s ease, color .15s ease, transform .1s ease; }\n.uh-refresh:hover { border-color:var(--dsw-alias-brand-primary); }\n.uh-refresh:active, .uh-chip:active, .uh-range button:active { transform:scale(.96); }\n.uh-alias-panel-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; font-size:13px; font-weight:600; color:var(--dsw-alias-label-primary); }\n.uh-alias-close { border:0; background:transparent; color:var(--dsw-alias-label-secondary); font-size:12px; cursor:pointer; font-family:inherit; padding:0; transition:color .15s ease; }\n.uh-alias-close:hover { color:var(--dsw-alias-brand-primary); }\n.uh-alias-list { display:grid; grid-template-columns:repeat(auto-fill, minmax(250px, 1fr)); gap:8px 16px; max-height:240px; overflow-y:auto; }\n.uh-alias-item { display:flex; align-items:center; gap:8px; min-width:0; }\n.uh-alias-folder { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; color:var(--dsw-alias-label-secondary); }\n.uh-alias-input { flex:none; width:150px; border:1px solid var(--dsw-alias-border-l2); background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); border-radius:6px; padding:3px 8px; font-size:12px; font-family:inherit; outline:none; transition:border-color .15s ease; }\n.uh-alias-input:focus { border-color:var(--dsw-alias-brand-primary); }\n.uh-alias-panel-foot { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:10px; padding-top:10px; border-top:1px solid var(--dsw-alias-border-l1); }\n.uh-alias-ok { border:1px solid var(--dsw-alias-brand-primary); background:color-mix(in srgb, var(--dsw-alias-brand-primary) 16%, transparent); color:var(--dsw-alias-label-primary); border-radius:6px; font-size:12px; padding:3px 12px; cursor:pointer; font-family:inherit; flex:none; transition:transform .1s ease; }\n.uh-alias-ok:active { transform:scale(.96); }\n.uh-anim-panel { animation:uh-panel-in .28s ease both; }\n.uh-pricing-panel { display:flex; flex-direction:column; gap:12px; }\n.uh-pricing-head, .uh-pricing-toolbar, .uh-pricing-foot { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }\n.uh-pricing-note { color:var(--dsw-alias-label-secondary); font-size:12px; line-height:1.55; }\n.uh-pricing-toolbar { padding:10px 0; border-top:1px solid var(--dsw-alias-border-l1); border-bottom:1px solid var(--dsw-alias-border-l1); }\n.uh-pricing-switch { display:inline-flex; align-items:center; gap:7px; color:var(--dsw-alias-label-primary); font-size:12px; }\n.uh-pricing-section { display:flex; flex-direction:column; gap:8px; }\n.uh-pricing-table-wrap { max-height:392px; overflow-x:hidden; overflow-y:scroll; scrollbar-gutter:stable; scrollbar-width:auto; scrollbar-color:var(--uh-scrollbar-thumb) var(--uh-scrollbar-track); border:1px solid var(--dsw-alias-border-l1); border-radius:8px; background:var(--dsw-alias-bg-layer-2); }\n.uh-pricing-model-table { width:100%; min-width:1080px; border-collapse:collapse; table-layout:fixed; font-size:11px; }\n.uh-pricing-model-table th, .uh-pricing-model-table td { min-width:0; padding:8px 9px; border-bottom:1px solid var(--dsw-alias-border-l1); text-align:left; vertical-align:middle; }\n.uh-pricing-model-table th { position:sticky; top:0; z-index:40; color:var(--dsw-alias-label-secondary); background:var(--dsw-alias-bg-layer-2); font-weight:650; white-space:nowrap; }\n.uh-pricing-model-table th:nth-child(1) { width:24%; }\n.uh-pricing-model-table th:nth-child(2) { width:84px; }\n.uh-pricing-model-table th:nth-child(3) { width:20%; }\n.uh-pricing-model-table th:nth-child(4) { width:96px; }\n.uh-pricing-model-table th:nth-child(n+5) { width:100px; text-align:right; }\n.uh-pricing-model-table td:nth-child(n+5) { text-align:right; }\n.uh-pricing-model-table tbody tr:last-child td { border-bottom:0; }\n.uh-pricing-model-table tbody tr:not(.uh-pricing-tier-row):hover { background:color-mix(in srgb, var(--dsw-alias-bg-layer-1) 65%, transparent); }\n.uh-pricing-model-name, .uh-pricing-model-target { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--dsw-alias-label-primary); }\n.uh-pricing-model-rate { color:var(--dsw-alias-label-secondary); font-variant-numeric:tabular-nums; white-space:nowrap; }\n.uh-pricing-status, .uh-pricing-tier-badge { display:inline-flex; justify-content:center; padding:3px 6px; border-radius:6px; font-size:10px; font-weight:650; white-space:nowrap; }\n.uh-pricing-status-priced { color:#157347; background:color-mix(in srgb, var(--uh-donut-2) 22%, transparent); }\n.uh-pricing-status-unpriced, .uh-pricing-status-ambiguous, .uh-pricing-status-unsupported { color:#9a5b00; background:color-mix(in srgb, var(--uh-donut-4) 20%, transparent); }\n.uh-pricing-tier-badge { color:var(--dsw-alias-brand-primary); background:color-mix(in srgb, var(--dsw-alias-brand-primary) 15%, transparent); }\n.uh-pricing-tier-badge.uh-flat { color:var(--dsw-alias-label-secondary); background:var(--dsw-alias-bg-layer-1); }\n.uh-pricing-tier-row > td { padding:0 9px 8px; background:color-mix(in srgb, var(--dsw-alias-bg-layer-1) 36%, transparent); }\n.uh-pricing-tier-details > summary { display:inline-flex; align-items:center; gap:6px; min-height:28px; color:var(--dsw-alias-label-secondary); cursor:pointer; list-style:none; font-size:11px; }\n.uh-pricing-tier-details > summary::-webkit-details-marker { display:none; }\n.uh-pricing-tier-caret { transition:transform .15s ease; }\n.uh-pricing-tier-details[open] .uh-pricing-tier-caret { transform:rotate(180deg); }\n.uh-pricing-tier-context { margin-left:6px; color:var(--dsw-alias-label-tertiary, var(--dsw-alias-label-secondary)); }\n.uh-pricing-tier-table { width:100%; margin:2px 0 5px; border:1px solid var(--dsw-alias-border-l1); border-radius:6px; border-collapse:separate; border-spacing:0; overflow:hidden; table-layout:fixed; background:var(--dsw-alias-bg-base); }\n.uh-pricing-tier-table th, .uh-pricing-tier-table td { position:static; width:auto !important; padding:6px 8px; border-bottom:1px solid var(--dsw-alias-border-l1); text-align:right !important; background:transparent; font-size:10px; }\n.uh-pricing-tier-table th:first-child, .uh-pricing-tier-table td:first-child { width:30% !important; text-align:left !important; }\n.uh-pricing-tier-table tbody tr:last-child td { border-bottom:0; }\n.uh-pricing-tier-table tbody tr:hover { background:color-mix(in srgb, var(--dsw-alias-brand-primary) 6%, transparent); }\n.uh-pricing-model-search { position:relative; z-index:2; min-width:0; display:flex; align-items:center; gap:6px; }\n.uh-pricing-model-search .uh-pricing-model-search-input { flex:1 1 auto; width:auto; }\n.uh-pricing-clear-mapping { flex:none; white-space:nowrap; }\n.uh-pricing-model-search:focus-within { z-index:30; }\n.uh-pricing-model-search-input { box-sizing:border-box; width:100%; min-width:0; min-height:30px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:4px 7px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:11px; outline:none; }\n.uh-pricing-model-search-input:focus { border-color:var(--dsw-alias-brand-primary); }\n.uh-pricing-model-options { top:calc(100% + 7px); left:0; right:auto; width:100%; min-width:280px; max-height:240px; overflow-y:auto; z-index:40; }\n.uh-pricing-model-option { align-items:flex-start; }\n.uh-pricing-model-option-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.uh-pricing-model-option-id { margin-left:auto; padding-left:10px; color:var(--dsw-alias-label-secondary); font-size:10px; white-space:nowrap; }\n.uh-pricing-edit-row { display:grid; grid-template-columns:minmax(240px,1.2fr) minmax(260px,1.3fr) minmax(78px,.45fr) 32px; gap:10px; align-items:center; min-width:650px; }\n.uh-pricing-price-row { grid-template-columns:repeat(5,minmax(108px,1fr)) 32px; min-width:650px; }\n.uh-pricing-price-head { display:grid; grid-template-columns:repeat(5,minmax(108px,1fr)) 32px; gap:10px; align-items:center; min-width:650px; color:var(--dsw-alias-label-secondary); font-size:10px; }\n.uh-pricing-price-head span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.uh-pricing-edit-row input, .uh-pricing-tier-edit-row input { box-sizing:border-box; min-width:0; min-height:30px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:4px 7px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:11px; outline:none; }\n.uh-pricing-edit-row input:focus, .uh-pricing-tier-edit-row input:focus { border-color:var(--dsw-alias-brand-primary); }\n.uh-pricing-edit-row .uh-refresh, .uh-pricing-tier-edit-row .uh-refresh { min-height:30px; padding:0; }\n.uh-pricing-overrides { display:flex; flex-direction:column; min-width:760px; }\n.uh-pricing-override { display:flex; flex-direction:column; gap:8px; padding:10px 0; border-bottom:1px solid var(--dsw-alias-border-l1); }\n.uh-pricing-override:last-child { border-bottom:0; }\n.uh-pricing-tier-editor { margin-left:10px; padding-left:12px; border-left:2px solid color-mix(in srgb, var(--dsw-alias-brand-primary) 34%, var(--dsw-alias-border-l1)); }\n.uh-pricing-tier-editor-head { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:30px; }\n.uh-pricing-tier-editor-title { display:flex; align-items:baseline; gap:8px; min-width:0; }\n.uh-pricing-tier-editor-title strong { font-size:11px; }\n.uh-pricing-tier-editor-title span { color:var(--dsw-alias-label-secondary); font-size:10px; }\n.uh-pricing-tier-edit-head, .uh-pricing-tier-edit-row { display:grid; grid-template-columns:minmax(120px,.85fr) repeat(4,minmax(72px,1fr)) 30px; gap:10px; align-items:center; min-width:0; }\n.uh-pricing-tier-edit-head { margin:5px 0; color:var(--dsw-alias-label-secondary); font-size:10px; }\n.uh-pricing-tier-edit-row { margin-top:7px; }\n.uh-pricing-tier-edit-row.uh-invalid input { border-color:var(--dsw-alias-warning, #a55b00); }\n.uh-pricing-tier-empty { padding:5px 0; color:var(--dsw-alias-label-secondary); font-size:10px; }\n.uh-pricing-error { color:var(--dsw-alias-warning, #a55b00); font-size:12px; line-height:1.45; }\n.uh-pricing-foot { padding-top:4px; }\n.uh-archive-panel { display:flex; flex-direction:column; gap:10px; }\n.uh-archive-head { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }\n.uh-archive-head .uh-title-with-icon { color:var(--dsw-alias-label-primary); font-size:13px; font-weight:600; }\n.uh-archive-note { color:var(--dsw-alias-label-secondary); font-size:12px; line-height:1.55; }\n.uh-archive-controls { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 10px; padding:10px 0; border-top:1px solid var(--dsw-alias-border-l1); border-bottom:1px solid var(--dsw-alias-border-l1); }\n.uh-archive-days { display:inline-flex; align-items:center; flex-wrap:wrap; gap:4px 6px; min-width:0; color:var(--dsw-alias-label-primary); font-size:12px; }\n.uh-archive-days-input { flex:none; width:78px; min-height:30px; box-sizing:border-box; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:3px 7px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:12px; font-variant-numeric:tabular-nums; outline:none; transition:border-color .15s ease; }\n.uh-archive-days-input:focus { border-color:var(--dsw-alias-brand-primary); }\n.uh-archive-plan { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 10px; }\n.uh-archive-plan-text { flex:1 1 220px; min-width:0; color:var(--dsw-alias-label-primary); font-size:12px; line-height:1.5; }\n.uh-archive-apply { border-color:var(--dsw-alias-brand-primary); background:color-mix(in srgb, var(--dsw-alias-brand-primary) 16%, transparent); }\n.uh-archive-confirm { display:flex; flex-direction:column; gap:8px; padding:10px; border:1px solid var(--dsw-alias-border-l2); border-radius:8px; background:color-mix(in srgb, var(--dsw-alias-bg-layer-1) 60%, transparent); color:var(--dsw-alias-label-primary); font-size:12px; line-height:1.5; }\n.uh-archive-actions { display:flex; flex-wrap:wrap; gap:8px; }\n.uh-archive-result { color:var(--dsw-alias-label-secondary); font-size:12px; line-height:1.45; }\n.uh-archive-error { color:var(--dsw-alias-warning, #a55b00); font-size:12px; line-height:1.45; }\n.uh-archive-caution { color:var(--dsw-alias-label-secondary); font-size:11px; line-height:1.55; }\n\n.uh-pricing-table-note { color:var(--dsw-alias-label-secondary); font-size:11px; line-height:1.5; }\n.uh-pricing-price-table { width:100%; min-width:0; }\n.uh-pricing-price-table th:nth-child(1) { width:20%; }\n.uh-pricing-price-table th:nth-child(2) { width:24%; }\n.uh-pricing-price-table th:nth-child(3), .uh-pricing-price-table th:nth-child(4), .uh-pricing-price-table th:nth-child(5), .uh-pricing-price-table th:nth-child(6) { width:11%; }\n.uh-pricing-price-table th:nth-child(7) { width:12%; }\n.uh-pricing-table-wrap .uh-pricing-price-table th, .uh-pricing-table-wrap .uh-pricing-price-table td { text-align:left; }\n.uh-pricing-price-table th, .uh-pricing-price-table td { padding:8px 8px; }\n.uh-pricing-price-table td { vertical-align:top; }\n.uh-pricing-row-flags { display:flex; align-items:center; flex-wrap:wrap; gap:4px; margin-top:5px; }\n.uh-pricing-flag { padding:2px 6px; border-radius:999px; background:var(--dsw-alias-bg-layer-1); color:var(--dsw-alias-label-secondary); font-size:10px; white-space:nowrap; }\n.uh-pricing-configured-row { background:color-mix(in srgb, var(--dsw-alias-bg-layer-1) 42%, transparent); }\n/* Unknown usage (the host did not label the row) is not the same verdict as\n "no ledger usage", so it must not read like one. */\n.uh-pricing-unknown-row { background:color-mix(in srgb, var(--dsw-alias-bg-layer-1) 24%, transparent); }\n.uh-pricing-flag-unknown { border-style:dashed; opacity:.75; }\n.uh-pricing-rate-input { box-sizing:border-box; width:100%; min-width:0; min-height:30px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:4px 7px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:11px; font-variant-numeric:tabular-nums; outline:none; }\n.uh-pricing-rate-input:focus { border-color:var(--dsw-alias-brand-primary); }\n.uh-pricing-map-cell { display:flex; flex-direction:column; gap:6px; }\n.uh-pricing-map-sub { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }\n.uh-pricing-map-field { display:inline-flex; align-items:center; gap:5px; color:var(--dsw-alias-label-secondary); font-size:10px; }\n.uh-pricing-map-field input, .uh-pricing-map-field select { box-sizing:border-box; min-height:26px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:2px 6px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:11px; outline:none; }\n.uh-pricing-map-field input { width:70px; }\n.uh-pricing-link { border:0; background:transparent; color:var(--dsw-alias-brand-primary); font:inherit; font-size:11px; cursor:pointer; padding:2px 0; text-decoration:underline; }\n.uh-pricing-link:disabled { color:var(--dsw-alias-label-secondary); cursor:default; text-decoration:none; }\n.uh-pricing-chip { min-height:28px; padding:3px 9px; border:1px solid var(--dsw-alias-border-l2); border-radius:999px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-secondary); font:inherit; font-size:10px; cursor:pointer; white-space:nowrap; }\n.uh-pricing-chip.uh-on, .uh-pricing-chip.uh-strong { border-color:var(--dsw-alias-brand-primary); color:var(--dsw-alias-label-primary); background:color-mix(in srgb, var(--dsw-alias-brand-primary) 12%, transparent); }\n.uh-pricing-row-actions { display:flex; align-items:center; flex-wrap:wrap; gap:5px; white-space:nowrap; }\n.uh-pricing-editor-row > td { padding:0 9px 10px; background:color-mix(in srgb, var(--dsw-alias-bg-layer-1) 36%, transparent); }\n.uh-pricing-editor { display:flex; flex-direction:column; gap:10px; min-width:0; overflow-x:auto; }\n.uh-pricing-editor-foot { display:flex; justify-content:flex-end; }\n.uh-pricing-temporal-fields { display:flex; align-items:flex-end; flex-wrap:wrap; gap:10px; margin-top:6px; }\n.uh-pricing-temporal-fields label { display:inline-flex; flex-direction:column; gap:4px; color:var(--dsw-alias-label-secondary); font-size:10px; }\n.uh-pricing-temporal-fields input { box-sizing:border-box; min-height:28px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:3px 7px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:11px; outline:none; }\n.uh-pricing-temporal-fields input:focus { border-color:var(--dsw-alias-brand-primary); }\n.uh-pricing-temporal-rule { margin-top:8px; padding:8px 10px; border:1px solid var(--dsw-alias-border-l1); border-radius:8px; background:var(--dsw-alias-bg-base); }\n.uh-pricing-temporal-rule-head { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }\n.uh-pricing-temporal-rule-name { color:var(--dsw-alias-label-secondary); font-size:10px; font-variant-numeric:tabular-nums; }\n.uh-pricing-weekdays { display:inline-flex; gap:3px; }\n.uh-pricing-weekday { width:26px; height:26px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-secondary); font:inherit; font-size:10px; cursor:pointer; }\n.uh-pricing-weekday.uh-on { border-color:var(--dsw-alias-brand-primary); color:var(--dsw-alias-label-primary); background:color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, transparent); }\n.uh-pricing-temporal-windows { display:flex; align-items:center; flex-wrap:wrap; gap:7px; margin-top:7px; }\n.uh-pricing-temporal-window { display:inline-flex; align-items:center; gap:5px; }\n.uh-pricing-time-input { box-sizing:border-box; width:66px; min-height:28px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:3px 6px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:11px; font-variant-numeric:tabular-nums; text-align:center; outline:none; }\n.uh-pricing-time-input:focus { border-color:var(--dsw-alias-brand-primary); }\n.uh-pricing-time-sep { color:var(--dsw-alias-label-secondary); }\n.uh-pricing-temporal-rates { display:flex; flex-wrap:wrap; gap:9px; margin-top:8px; }\n.uh-pricing-temporal-rate { display:inline-flex; align-items:center; gap:5px; color:var(--dsw-alias-label-secondary); font-size:10px; }\n.uh-pricing-temporal-rate input { box-sizing:border-box; width:86px; min-height:28px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:3px 7px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:11px; font-variant-numeric:tabular-nums; outline:none; }\n.uh-pricing-temporal-foot { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:8px; }\n.uh-pricing-temporal-holidays { display:flex; flex-direction:column; gap:6px; margin-top:8px; padding:8px 10px; border:1px solid var(--dsw-alias-border-l1); border-radius:8px; background:var(--dsw-alias-bg-base); }\n.uh-pricing-holiday-load { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }\n.uh-pricing-holiday-load input[type=\'number\'] { box-sizing:border-box; width:82px; min-height:28px; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:3px 7px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:11px; outline:none; }\n.uh-pricing-holiday-input { box-sizing:border-box; width:100%; min-height:74px; resize:vertical; border:1px solid var(--dsw-alias-border-l2); border-radius:6px; padding:6px 8px; background:var(--dsw-alias-bg-base); color:var(--dsw-alias-label-primary); font:inherit; font-size:11px; font-variant-numeric:tabular-nums; outline:none; }\n.uh-pricing-holiday-input:focus { border-color:var(--dsw-alias-brand-primary); }\n.uh-pricing-warning { margin-top:7px; padding:7px 9px; border-radius:7px; border:1px solid color-mix(in srgb, var(--dsw-alias-warning, #d9822b) 40%, var(--dsw-alias-border-l1)); color:var(--dsw-alias-warning, #a55b00); font-size:11px; line-height:1.45; }\n@media (max-width:640px) {\n .uh-pricing-table-wrap { overflow-x:auto; }\n .uh-pricing-price-table { min-width:820px; }\n .uh-pricing-map-cell { min-width:170px; }\n}\n\n.uh-cost-num { color:var(--dsw-alias-label-primary); }\n.uh-progress { font-size:12px; color:var(--dsw-alias-label-secondary); display:flex; align-items:center; gap:10px; }\n.uh-sync-health { margin-top:8px; padding:8px 12px; display:flex; align-items:center; flex-wrap:wrap; gap:6px; border:1px solid var(--dsw-alias-border-l1); border-radius:10px; color:var(--dsw-alias-label-secondary); background:var(--dsw-alias-bg-layer-1); font-size:11px; line-height:1.45; }\n.uh-sync-health.uh-stale { color:var(--dsw-alias-warning, #a55b00); border-color:color-mix(in srgb, var(--dsw-alias-warning, #d9822b) 45%, var(--dsw-alias-border-l1)); }\n.uh-sync-retry { border:0; background:transparent; color:inherit; font:inherit; text-decoration:underline; cursor:pointer; padding:0 2px; }\n.uh-trend-panel { min-height:300px; animation:uh-panel-in .38s ease both; }\n.uh-trend-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:10px; }\n.uh-trend-head-side { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }\n.uh-trend-chart-wrap { position:relative; min-height:250px; width:100%; overflow:hidden; }\n.uh-trend-stage { display:grid; place-items:center; min-height:250px; width:100%; }\n.uh-trend-message { color:var(--dsw-alias-label-secondary); font-size:12px; }\n.uh-trend-spinner { width:24px; height:24px; border:2px solid color-mix(in srgb, var(--dsw-alias-brand-primary) 22%, var(--dsw-alias-border-l2)); border-top-color:var(--dsw-alias-brand-primary); border-radius:50%; animation:uh-spinner-turn .78s linear infinite; }\n.uh-trend-svg { display:block; width:100%; height:auto; min-height:220px; }\n.uh-trend-grid { stroke:var(--dsw-alias-border-l1); stroke-width:1; stroke-dasharray:3 4; opacity:.8; }\n.uh-trend-cursor { stroke:var(--dsw-alias-label-secondary); stroke-width:1; stroke-dasharray:3 4; opacity:.65; pointer-events:none; }\n.uh-trend-point { stroke:var(--dsw-alias-bg-layer-1); stroke-width:2; vector-effect:non-scaling-stroke; pointer-events:none; }\n.uh-trend-axis-label { fill:var(--dsw-alias-label-secondary); font-size:11px; font-family:inherit; }\n.uh-trend-line { fill:none; stroke-width:2.2; vector-effect:non-scaling-stroke; stroke-linecap:round; stroke-linejoin:round; opacity:.22; }\n.uh-trend-line-draw { fill:none; stroke-width:2.2; vector-effect:non-scaling-stroke; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:var(--uh-draw-length); stroke-dashoffset:var(--uh-draw-length); opacity:.96; pointer-events:none; animation:uh-trend-draw .95s cubic-bezier(.22,.61,.36,1) both; }\n.uh-trend-area { opacity:1; animation:uh-trend-fill .8s ease; }\n.uh-trend-bar { pointer-events:none; }\n@keyframes uh-trend-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }\n.uh-trend-bar-group { transform-box: fill-box; transform-origin: 50% 100%; animation:uh-trend-grow .5s cubic-bezier(.22,.61,.36,1) both; }\n@media (prefers-reduced-motion: reduce) { .uh-trend-bar-group { animation:none; } }\n.uh-trend-hit { fill:transparent; cursor:crosshair; outline:none; }\n.uh-trend-hit:focus { fill:color-mix(in srgb, var(--dsw-alias-brand-primary) 10%, transparent); outline:1px solid var(--dsw-alias-brand-primary); outline-offset:2px; }\n.uh-trend-tooltip { position:absolute; z-index:4; min-width:166px; padding:10px 11px; border:1px solid color-mix(in srgb, var(--dsw-alias-border-l2) 88%, transparent); border-radius:8px; background:color-mix(in srgb, var(--dsw-alias-bg-layer-1) 94%, transparent); box-shadow:0 10px 24px rgba(0,0,0,.22); color:var(--dsw-alias-label-primary); font-size:12px; line-height:1.45; pointer-events:none; opacity:0; visibility:hidden; transform:translate(14px,-50%) scale(.985); transform-origin:left center; transition:left .16s cubic-bezier(.22,.61,.36,1), top .16s cubic-bezier(.22,.61,.36,1), opacity .12s ease, transform .16s cubic-bezier(.22,.61,.36,1), visibility 0s linear .16s; }\n.uh-trend-tooltip.uh-left { transform:translate(calc(-100% - 14px),-50%) scale(.985); transform-origin:right center; }\n.uh-trend-tooltip.uh-visible { opacity:1; visibility:visible; transform:translate(14px,-50%) scale(1); transition-delay:0s; }\n.uh-trend-tooltip.uh-left.uh-visible { transform:translate(calc(-100% - 14px),-50%) scale(1); }\n.uh-trend-tooltip-title { display:block; margin-bottom:6px; color:var(--dsw-alias-label-primary); font-size:12px; font-weight:650; }\n.uh-trend-tooltip-row { display:grid; grid-template-columns:8px minmax(0,1fr) auto; align-items:center; gap:7px; min-width:0; margin-top:3px; font-size:11px; }\n.uh-trend-tooltip-row .uh-trend-dot { width:8px; height:8px; margin:0; }\n.uh-trend-tooltip-label { overflow:hidden; font-weight:600; text-overflow:ellipsis; white-space:nowrap; }\n.uh-trend-tooltip-value { color:inherit; font-weight:600; font-variant-numeric:tabular-nums; white-space:nowrap; }\n.uh-trend-dot { display:inline-block; width:7px; height:7px; margin-right:5px; border-radius:50%; vertical-align:1px; }\n.uh-trend-legend { display:flex; flex-wrap:wrap; gap:5px 8px; margin-top:5px; }\n.uh-trend-legend-item { display:inline-flex; align-items:center; gap:3px; border:0; border-radius:7px; padding:3px 6px; background:transparent; color:var(--dsw-alias-label-secondary); font:inherit; font-size:11px; cursor:pointer; transition:color .15s ease; }\n.uh-trend-legend-item:hover { background:var(--dsw-alias-bg-layer-2); color:var(--dsw-alias-label-primary); }\n.uh-trend-legend-item.uh-on { background:var(--dsw-alias-interactive-bg-hover); color:var(--dsw-alias-label-primary); }\n.uh-filter-bar { position:relative; z-index:10; display:flex; align-items:center; flex-wrap:wrap; gap:7px; }\n.uh-filter-clear { border:0; background:transparent; color:var(--dsw-alias-label-secondary); font:inherit; font-size:11px; cursor:pointer; text-decoration:underline; }\n.uh-query-note { color:var(--dsw-alias-label-secondary); font-size:11px; }\n.uh-detail-tabs { display:flex; align-items:center; flex-wrap:wrap; gap:4px; padding:4px; border:1px solid var(--dsw-alias-border-l1); border-radius:9px; background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 58%, transparent); }\n.uh-detail-tab { display:inline-flex; align-items:center; gap:6px; min-height:32px; padding:5px 11px; border:0; border-radius:7px; background:transparent; color:var(--dsw-alias-label-secondary); font:inherit; font-size:12px; cursor:pointer; transition:background-color .15s ease, color .15s ease, transform .12s ease; }\n.uh-detail-tab:hover { color:var(--dsw-alias-label-primary); background:var(--dsw-alias-bg-layer-2); }\n.uh-detail-tab.uh-on { color:var(--dsw-alias-label-primary); background:var(--dsw-alias-bg-layer-1); box-shadow:0 1px 3px rgba(0,0,0,.14); }\n.uh-records-panel { animation:uh-panel-in .28s ease both; }\n.uh-records-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:7px; }\n.uh-records-note { margin:8px 0 10px; color:var(--dsw-alias-label-secondary); font-size:11px; line-height:1.45; }\n.uh-records-error { margin:7px 0; color:var(--dsw-alias-warning, #a55b00); font-size:11px; }\n/* The log scrolls inside its own box (and pulls the next page as it nears the end),\n so a long history never pushes the rest of the panel off the screen. */\n.uh-records-scroll { max-height:min(62vh, 560px); overflow:auto; overscroll-behavior:contain; border:1px solid var(--dsw-alias-border-l1); border-radius:8px; }\n.uh-record-grid { display:grid; grid-template-columns:112px minmax(190px,1.45fr) 78px repeat(4,minmax(76px,.72fr)) 96px 82px; gap:0; min-width:900px; align-items:center; }\n.uh-record-grid > div { min-width:0; padding:8px 7px; border-bottom:1px solid var(--dsw-alias-border-l1); font-size:11px; }\n.uh-record-header { color:var(--dsw-alias-label-secondary); background:var(--dsw-alias-bg-layer-2); font-weight:600; }\n.uh-record-header > div { white-space:nowrap; }\n.uh-record-row { color:var(--dsw-alias-label-primary); cursor:pointer; outline:none; transition:background-color .14s ease, box-shadow .14s ease; }\n.uh-record-row:hover { background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 68%, transparent); }\n.uh-record-row.uh-on { background:color-mix(in srgb, var(--dsw-alias-brand-primary) 10%, var(--dsw-alias-bg-layer-1)); box-shadow:inset 3px 0 var(--dsw-alias-brand-primary); }\n.uh-record-row:focus-visible { box-shadow:inset 0 0 0 1px var(--dsw-alias-brand-primary); }\n.uh-record-row:last-child > div { border-bottom:0; }\n.uh-record-time, .uh-record-num { color:var(--dsw-alias-label-secondary); font-variant-numeric:tabular-nums; white-space:nowrap; }\n.uh-record-num { text-align:right; }\n.uh-model-icon { display:inline-flex; align-items:center; justify-content:center; flex:none; vertical-align:middle; }\n.uh-model-icon img { display:block; width:100%; height:100%; object-fit:contain; }\n.uh-model-icon-fallback { color:var(--dsw-alias-label-tertiary, var(--dsw-alias-label-secondary)); opacity:.85; }\n.uh-model-label { display:flex; align-items:center; gap:7px; min-width:0; }\n.uh-model-label .uh-model-text { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }\n.uh-record-model { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:550; }\n.uh-record-model small { display:block; overflow:hidden; color:var(--dsw-alias-label-secondary); font-size:10px; font-weight:400; text-overflow:ellipsis; white-space:nowrap; }\n.uh-record-source { color:var(--dsw-alias-label-secondary); white-space:nowrap; }\n.uh-record-band { white-space:nowrap; }\n.uh-record-band-badge { margin-left:6px; color:var(--dsw-alias-label-secondary); font-size:10px; }\n.uh-record-band-peak { color:var(--dsw-alias-warning, #a55b00); font-weight:600; }\n.uh-record-band-off-peak { color:#2e7d32; }\n.uh-records-footer { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:9px; }\n.uh-record-detail { margin-top:12px; padding:10px 11px; border-top:1px solid var(--dsw-alias-border-l2); background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 42%, transparent); animation:uh-detail-in .24s ease both; }\n.uh-record-detail-head, .uh-record-detail-meta { display:flex; align-items:center; flex-wrap:wrap; gap:7px 14px; }\n.uh-record-detail-head { justify-content:space-between; margin-bottom:5px; color:var(--dsw-alias-label-primary); font-size:12px; }\n.uh-record-detail-meta { color:var(--dsw-alias-label-secondary); font-size:11px; }\n.uh-record-token-strip { display:grid; grid-template-columns:repeat(5,minmax(72px,1fr)) repeat(2,minmax(82px,1.1fr)); gap:6px; margin-top:9px; }\n.uh-record-token-strip > div { display:flex; flex-direction:column; gap:2px; min-width:0; padding:6px 7px; border-radius:6px; background:var(--dsw-alias-bg-layer-2); }\n.uh-record-token-strip span { color:var(--dsw-alias-label-secondary); font-size:10px; }\n.uh-record-token-strip strong { color:var(--dsw-alias-label-primary); font-size:12px; font-variant-numeric:tabular-nums; }\n.uh-record-token-total { border:1px solid color-mix(in srgb, var(--dsw-alias-brand-primary) 38%, var(--dsw-alias-border-l1)) !important; }\n@keyframes uh-detail-in { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }\n@media (max-width:640px) {\n .uh-trend-head { flex-direction:column; }\n .uh-filter-menu { flex:1 1 130px; width:auto; }\n .uh-filter-trigger { max-width:100%; }\n .uh-trend-tooltip { min-width:116px; }\n .uh-records-head { flex-direction:column; }\n .uh-record-token-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }\n .uh-record-token-total { grid-column:1 / -1; }\n .uh-pricing-head { align-items:flex-start; }\n .uh-pricing-toolbar { align-items:flex-start; }\n .uh-pricing-edit-row { grid-template-columns:minmax(0,1fr) 36px; min-width:0; width:100%; }\n .uh-pricing-edit-row > .uh-pricing-model-search,\n .uh-pricing-price-row > input { grid-column:1 / -1; }\n .uh-pricing-edit-row > input[type=\'number\'] { grid-column:1; }\n .uh-pricing-edit-row > .uh-icon-button { grid-column:2; }\n .uh-pricing-price-head { display:none; }\n .uh-pricing-overrides { min-width:0; width:100%; }\n .uh-pricing-override { min-width:0; }\n .uh-pricing-price-row { grid-template-columns:minmax(0,1fr) 36px; min-width:0; }\n .uh-pricing-price-row > input[type=\'number\'] { grid-column:1 / -1; }\n .uh-pricing-tier-editor { margin-left:0; padding-left:0; border-left:0; }\n .uh-pricing-tier-editor-head { align-items:flex-start; flex-wrap:wrap; }\n .uh-pricing-tier-editor-title { flex-direction:column; gap:2px; }\n .uh-pricing-tier-edit-head { display:none; }\n .uh-pricing-tier-edit-row { grid-template-columns:minmax(0,1fr) 36px; min-width:0; padding:8px; border:1px solid var(--dsw-alias-border-l1); border-radius:6px; }\n .uh-pricing-tier-edit-row > input { grid-column:1 / -1; }\n .uh-pricing-tier-edit-row > .uh-icon-button { grid-column:2; }\n .uh-pricing-tier-context { display:block; margin:2px 0 0; }\n}\n.uh-bar { flex:1; height:6px; border-radius:3px; background:var(--dsw-alias-bg-layer-2); overflow:hidden; max-width:340px; }\n.uh-fill { height:100%; background:var(--dsw-alias-brand-primary); border-radius:3px; transition:width .3s ease; }\n.uh-cards { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:10px; }\n.uh-card { background:var(--dsw-alias-bg-layer-1); border:1px solid var(--dsw-alias-border-l1); border-radius:12px; padding:12px 14px; display:flex; flex-direction:column; gap:6px; min-height:86px; animation:uh-card-in .45s ease both; transition:transform .18s ease, border-color .18s ease, box-shadow .18s ease; }\n.uh-card:hover { transform:translateY(-2px); border-color:var(--dsw-alias-border-l2); box-shadow:0 6px 18px rgba(0,0,0,.10); }\n.uh-card-label { font-size:12px; color:var(--dsw-alias-label-secondary); }\n.uh-card-value { font-size:20px; font-weight:650; color:var(--dsw-alias-label-primary); line-height:1.2; }\n.uh-card-sub { font-size:11px; color:var(--dsw-alias-label-secondary); line-height:1.55; }\n.uh-wsbars { display:flex; flex-direction:column; gap:3px; margin-top:2px; }\n.uh-wsbar { display:flex; flex-direction:column; gap:1px; cursor:pointer; padding:1px 6px; margin:0 -6px; border-radius:8px; transition:background-color .15s ease; }\n.uh-wsbar:hover { background:var(--dsw-alias-bg-layer-2); }\n.uh-wsbar.uh-sel { outline:1px solid var(--dsw-alias-brand-primary); }\n.uh-wsbar-top { display:flex; align-items:center; gap:6px; min-width:0; }\n.uh-wsbar-title { font-size:12px; color:var(--dsw-alias-label-primary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; min-width:0; }\n.uh-wsbar-num { font-size:11px; font-variant-numeric:tabular-nums; color:var(--dsw-alias-label-secondary); flex:none; }\n.uh-panel { background:var(--dsw-alias-bg-layer-1); border:1px solid var(--dsw-alias-border-l1); border-radius:12px; padding:14px; }\n.uh-hm-head { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:10px; }\n.uh-chips { display:flex; flex-wrap:wrap; gap:6px; }\n.uh-hm-tools { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }\n.uh-heatmap-spans button { white-space:nowrap; }\n.uh-chip { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--dsw-alias-border-l2); background:transparent; color:var(--dsw-alias-label-primary); border-radius:999px; padding:2px 10px; font-size:11px; cursor:pointer; font-family:inherit; max-width:190px; transition:border-color .15s ease, background-color .15s ease, color .15s ease, transform .1s ease; }\n.uh-chip .uh-chip-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.uh-chip.uh-on { border-color:var(--dsw-alias-brand-primary); background:color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, transparent); }\n.uh-dot { width:8px; height:8px; border-radius:50%; flex:none; }\n.uh-legend { display:flex; align-items:center; gap:4px; font-size:11px; color:var(--dsw-alias-label-secondary); }\n.uh-legend .uh-cell { width:10px; height:10px; border-radius:2px; animation:none; }\n.uh-hm-scroll { overflow-x:auto; padding-top:2px; padding-right:2px; padding-bottom:3px; padding-left:2px; }\n.uh-months { position:relative; height:16px; margin-left:30px; width:calc(100% - 30px); min-width:686px; font-size:10px; color:var(--dsw-alias-label-secondary); }\n.uh-months span { position:absolute; top:0; }\n.uh-hm-body { display:flex; gap:6px; min-width:0; align-items:stretch; }\n.uh-wdays { display:grid; grid-template-rows:repeat(7,minmax(10px,1fr)); gap:3px; font-size:10px; color:var(--dsw-alias-label-secondary); text-align:right; width:24px; align-items:center; }\n.uh-wdays span { display:flex; align-items:center; justify-content:flex-end; min-height:10px; line-height:1; }\n.uh-grid { flex:1 1 auto; min-width:686px; display:grid; grid-auto-flow:column; grid-template-columns:repeat(53,minmax(10px,1fr)); grid-template-rows:repeat(7,minmax(10px,auto)); gap:3px; }\n.uh-cell { width:100%; height:auto; min-width:10px; aspect-ratio:1; border-radius:2px; background:var(--dsw-alias-bg-layer-2); animation:uh-cell-in .45s ease both; transition:transform .12s ease, box-shadow .12s ease; }\n.uh-cell:hover { transform:scale(1.35); box-shadow:0 1px 6px rgba(0,0,0,.28); position:relative; z-index:2; }\n.uh-cell.uh-today { box-shadow:0 0 0 2px var(--uh-today); }\n.uh-tip { position:fixed; z-index:1200; background:var(--dsw-alias-bg-overlay); border:1px solid var(--dsw-alias-border-l2); border-radius:10px; padding:10px 12px; box-shadow:0 8px 24px rgba(0,0,0,.18); pointer-events:auto; min-width:200px; max-width:290px; animation:uh-tip-in .16s ease both; }\n.uh-tip-date { font-size:12px; font-weight:600; color:var(--dsw-alias-label-primary); margin-bottom:6px; }\n.uh-tip-row { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--dsw-alias-label-primary); padding:3px 6px; margin:0 -6px; border-radius:6px; cursor:pointer; transition:background-color .12s ease; }\n.uh-tip-row:hover { background:color-mix(in srgb, var(--dsw-alias-brand-primary) 12%, transparent); }\n.uh-tip-row .uh-n { margin-left:auto; font-variant-numeric:tabular-nums; color:var(--dsw-alias-label-secondary); }\n.uh-tip-tokens { font-size:11px; color:var(--dsw-alias-label-secondary); margin-top:6px; border-top:1px solid var(--dsw-alias-border-l1); padding-top:6px; }\n.uh-tbl-title { font-size:13px; font-weight:600; color:var(--dsw-alias-label-primary); margin:0 0 10px; }\n.uh-tbl-scroll { overflow-x:auto; }\n.uh-hrow, .uh-row { display:grid; grid-template-columns:minmax(160px,2.2fr) .7fr .9fr .9fr .9fr .9fr 1.1fr .9fr .8fr 1fr; gap:8px; align-items:center; min-width:900px; padding:7px 10px; border-radius:8px; font-size:12px; }\n.uh-model-hrow, .uh-model-row { display:grid; grid-template-columns:minmax(190px,2.2fr) .7fr .9fr .9fr .9fr .9fr 1.1fr .9fr .8fr; gap:8px; align-items:center; min-width:860px; padding:7px 10px; border-radius:8px; font-size:12px; }\n.uh-hrow { color:var(--dsw-alias-label-secondary); font-size:11px; }\n.uh-row { cursor:pointer; border:1px solid transparent; transition:background-color .15s ease, border-color .15s ease; }\n.uh-row:hover { background:var(--dsw-alias-bg-layer-2); }\n.uh-row.uh-sel { border-color:var(--dsw-alias-brand-primary); }\n.uh-num { text-align:right; font-variant-numeric:tabular-nums; color:var(--dsw-alias-label-primary); }\n.uh-hrow .uh-num { color:var(--dsw-alias-label-secondary); }\n.uh-ws-title { color:var(--dsw-alias-label-primary); font-weight:550; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.uh-row-title-wrap { min-width:0; }\n.uh-ws-path { color:var(--dsw-alias-label-secondary); font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.uh-barwrap { height:5px; border-radius:3px; background:var(--dsw-alias-bg-layer-2); overflow:hidden; margin-top:3px; }\n.uh-barwrap.uh-bar-thin { height:3px; margin-top:1px; }\n.uh-barfill { height:100%; border-radius:3px; transform-origin:left center; animation:uh-bar-grow .7s cubic-bezier(.22,.61,.36,1) both; transition:width .5s cubic-bezier(.22,.61,.36,1); }\n.uh-empty { color:var(--dsw-alias-label-secondary); font-size:12px; text-align:center; padding:26px 0; }\n.uh-note { font-size:11px; color:var(--dsw-alias-label-secondary); line-height:1.6; }\n.uh-side-entry { width:100%; border:0; background:transparent; color:var(--dsw-alias-label-secondary); border-radius:8px; min-height:36px; padding:7px 10px; display:flex; align-items:center; gap:9px; font:inherit; font-size:13px; cursor:pointer; text-align:left; }\n.uh-side-entry:hover { background:var(--dsw-alias-interactive-bg-hover); color:var(--dsw-alias-label-primary); }\n.uh-side-entry-icon { width:18px; text-align:center; flex:none; font-size:15px; }\n.uh-side-entry-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.uh-boundary-fallback { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; min-height:360px; padding:24px; border:1px solid var(--dsw-alias-border-l1); border-radius:12px; background:var(--dsw-alias-bg-layer-1); text-align:center; }\n.uh-boundary-title { color:var(--dsw-alias-label-primary); font-size:15px; font-weight:650; }\n.uh-boundary-note { max-width:420px; color:var(--dsw-alias-label-secondary); font-size:12px; line-height:1.6; }\n.uh-side-modal { position:fixed; inset:var(--uh-top-inset, 0px) 0 0 0; z-index:1100; background:var(--uh-scrim); display:flex; align-items:stretch; justify-content:center; padding:26px; }\n.uh-side-dialog { width:min(1120px, 100%); overflow-x:hidden; overflow-y:scroll; scrollbar-gutter:stable; scrollbar-width:auto; scrollbar-color:var(--uh-scrollbar-thumb) var(--uh-scrollbar-track); background:var(--dsw-alias-bg-layer-1, #1a1c20); border:1px solid var(--dsw-alias-border-l2); border-radius:14px; box-shadow:var(--uh-dialog-shadow); padding:18px; }\n.uh-side-dialog::-webkit-scrollbar, .uh-pricing-table-wrap::-webkit-scrollbar { width:12px; height:12px; }\n.uh-side-dialog::-webkit-scrollbar-track, .uh-pricing-table-wrap::-webkit-scrollbar-track { background:var(--uh-scrollbar-track); border-left:1px solid var(--uh-scrollbar-track-border); }\n.uh-side-dialog::-webkit-scrollbar-thumb, .uh-pricing-table-wrap::-webkit-scrollbar-thumb { background:var(--uh-scrollbar-thumb); border:3px solid var(--uh-scrollbar-track); border-radius:6px; }\n.uh-side-dialog::-webkit-scrollbar-thumb:hover, .uh-pricing-table-wrap::-webkit-scrollbar-thumb:hover { background:#9aa1aa; }\n.uh-side-dialog-head { display:flex; justify-content:flex-end; margin-bottom:8px; }\n@media (max-width: 640px) { .uh-side-modal { padding:0; } .uh-side-dialog { border-radius:0; border:0; padding:14px; } }\n/* iOS-style dashboard: grouped surfaces, tactile controls, and an elevated sheet. */\n.uh-page { gap:18px; max-width:1160px; margin:0 auto; padding:12px 2px 34px; font-family:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif; }\n/* The toolbar is a rounded card of its own: as a full-bleed rectangle with a hard bottom\n border it read as a square white block sitting inside the rounded sheet. */\n.uh-head { position:sticky; top:16px; z-index:20; margin:0 -2px; padding:14px 12px; border:0; border-radius:18px; background:linear-gradient(color-mix(in srgb, var(--dsw-alias-bg-base) 88%, transparent), color-mix(in srgb, var(--dsw-alias-bg-base) 88%, transparent)), var(--dsw-alias-bg-layer-1, #1a1c20); box-shadow:0 1px 2px rgba(0,0,0,.06), 0 12px 26px -18px rgba(0,0,0,.32); }\n.uh-title { font-size:22px; line-height:1.2; font-weight:700; letter-spacing:0; }\n.uh-actions { gap:8px; }\n.uh-range { padding:2px; gap:2px; border:0; border-radius:9px; background:color-mix(in srgb, var(--dsw-alias-label-primary) 10%, transparent); overflow:visible; }\n.uh-range button, .uh-range button + button { min-height:28px; border:0; border-radius:7px; padding:4px 10px; }\n.uh-range button.uh-on { background:var(--dsw-alias-bg-layer-1); box-shadow:0 1px 3px rgba(0,0,0,.16); }\n.uh-refresh { min-height:30px; border:0; border-radius:15px; padding:5px 12px; display:inline-flex; align-items:center; justify-content:center; gap:6px; background:color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, var(--dsw-alias-bg-layer-1)); color:var(--dsw-alias-brand-primary); font-weight:600; }\n.uh-line-icon { flex:none; }\n.uh-icon-button { width:30px; padding:0; }\n.uh-refresh:hover { border:0; background:color-mix(in srgb, var(--dsw-alias-brand-primary) 22%, var(--dsw-alias-bg-layer-1)); }\n.uh-progress { padding:10px 12px; background:color-mix(in srgb, var(--dsw-alias-brand-primary) 9%, var(--dsw-alias-bg-layer-1)); border:0; border-radius:12px; }\n.uh-cards { grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:10px; border:0; border-radius:0; overflow:visible; background:transparent; }\n.uh-card { min-height:84px; padding:12px 14px; gap:4px; border:0; border-radius:18px; background:var(--dsw-alias-bg-layer-1); box-shadow:0 1px 2px rgba(0,0,0,.07), 0 8px 22px rgba(0,0,0,.05); animation:none; }\n.uh-card:first-child { border:0; background:color-mix(in srgb, var(--uh-donut-1) 15%, var(--dsw-alias-bg-layer-1)); }\n.uh-card:nth-child(2) { background:color-mix(in srgb, var(--uh-donut-2) 13%, var(--dsw-alias-bg-layer-1)); }\n.uh-card:nth-child(3) { background:color-mix(in srgb, var(--uh-donut-4) 14%, var(--dsw-alias-bg-layer-1)); }\n.uh-card:hover { transform:translateY(-2px); box-shadow:0 12px 28px rgba(0,0,0,.12); }\n.uh-card-label { display:flex; align-items:center; gap:6px; font-size:12px; font-weight:600; letter-spacing:0; }\n.uh-ios-summary-label, .uh-section-title, .uh-title-with-icon { display:flex; align-items:center; gap:7px; }\n.uh-section-title { margin-bottom:12px; color:var(--dsw-alias-label-primary); font-size:14px; font-weight:650; }\n/* Raise the complete reading scale without changing the data grid geometry. */\n.uh-page { font-size:14px; }\n.uh-range button, .uh-refresh { font-size:13px; }\n.uh-card-label, .uh-ios-summary-label { font-size:13px; }\n.uh-card-sub, .uh-ios-summary-caption, .uh-note { font-size:12px; }\n.uh-hrow, .uh-row, .uh-model-hrow, .uh-model-row { font-size:13px; }\n.uh-tbl-title { font-size:15px; }\n.uh-num { font-variant-numeric:tabular-nums; }\n.uh-card-value { font-size:23px; font-weight:700; letter-spacing:0; }\n.uh-card-sub { font-size:11px; line-height:1.25; }\n.uh-panel { padding:16px; border:0; border-radius:18px; background:var(--dsw-alias-bg-layer-1); box-shadow:0 1px 2px rgba(0,0,0,.06), 0 6px 18px rgba(0,0,0,.04); }\n.uh-hm-head { margin-bottom:12px; }\n.uh-chip { border:0; border-radius:14px; padding:5px 10px; background:color-mix(in srgb, var(--dsw-alias-label-primary) 7%, transparent); }\n.uh-chip.uh-on { border:0; background:color-mix(in srgb, var(--dsw-alias-brand-primary) 18%, transparent); color:var(--dsw-alias-brand-primary); }\n.uh-hrow, .uh-row, .uh-model-hrow, .uh-model-row { border-radius:10px; }\n.uh-hrow, .uh-model-hrow { position:sticky; top:66px; z-index:2; background:var(--dsw-alias-bg-layer-1); border-bottom:1px solid var(--dsw-alias-border-l1); }\n.uh-row, .uh-model-row { padding-top:9px; padding-bottom:9px; }\n.uh-row:nth-child(even) { background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 52%, transparent); }\n/* The sidebar entry follows the host\'s row style (transparent at rest, hover from\n the host token) instead of a permanent brand tint: a painted resting background\n reads as "already hovered" next to the other sidebar rows. */\n.uh-side-modal { align-items:flex-end; padding:14px 16px 16px; background:var(--uh-scrim); backdrop-filter:blur(8px); }\n/* Two classes on purpose: the host skin ships "[data-dsh-float] [role=dialog] { border-radius:14px }"\n (specificity 0,2,0), which outranks a lone .uh-side-dialog and squares the floating card off.\n border-box keeps the 22/28px padding inside max-height, so the sheet cannot grow past the viewport. */\n.uh-side-modal .uh-side-dialog { width:min(1260px, 100%); max-height:calc(100vh - var(--uh-top-inset, 0px) - 56px); box-sizing:border-box; border:0; border-radius:24px; padding:22px 24px 28px; background:linear-gradient(color-mix(in srgb, var(--dsw-alias-bg-base) 94%, transparent), color-mix(in srgb, var(--dsw-alias-bg-base) 94%, transparent)), var(--dsw-alias-bg-layer-1, #1a1c20); box-shadow:var(--uh-dialog-shadow); }\n.uh-side-dialog-head { position:sticky; top:-22px; z-index:8; justify-content:center; height:22px; margin:-22px -24px 8px; padding:8px 24px; background:linear-gradient(color-mix(in srgb, var(--dsw-alias-bg-base) 94%, transparent), color-mix(in srgb, var(--dsw-alias-bg-base) 94%, transparent)), var(--dsw-alias-bg-layer-1, #1a1c20); border:0; }\n.uh-side-dialog-head::before { content:""; width:36px; height:5px; border-radius:3px; background:color-mix(in srgb, var(--dsw-alias-label-primary) 24%, transparent); }\n.uh-side-dialog-head .uh-refresh { position:absolute; right:20px; top:7px; min-height:28px; background:transparent; }\n.uh-close-button { width:30px; padding:0; font-size:22px; line-height:1; color:var(--dsw-alias-label-secondary); }\n.uh-close-button:hover { color:var(--dsw-alias-label-primary); background:color-mix(in srgb, var(--dsw-alias-label-primary) 10%, transparent); }\n@media (max-width:640px) { .uh-page { gap:14px; padding-bottom:20px; } .uh-head { position:static; padding:10px 12px; } .uh-title { font-size:20px; } .uh-custom-range { grid-template-columns:1fr; align-items:stretch; } .uh-custom-range-fields { grid-template-columns:repeat(2, minmax(0, 1fr)); } .uh-custom-range-actions { justify-content:flex-end; } .uh-side-modal { padding:8px; } .uh-side-modal .uh-side-dialog { max-height:calc(100vh - 16px); border-radius:20px; padding:18px 14px 24px; } .uh-side-dialog-head { top:-18px; margin:-18px -14px 8px; padding:7px 14px; } .uh-card-value { font-size:22px; } }\n/* Navigation separates the dashboard into three focused iOS-style surfaces. */\n.uh-ios-tabs { display:grid; grid-template-columns:repeat(3, 1fr); gap:4px; padding:4px; border-radius:14px; background:color-mix(in srgb, var(--dsw-alias-label-primary) 9%, transparent); }\n.uh-ios-tab { min-height:32px; border:0; border-radius:10px; background:transparent; color:var(--dsw-alias-label-secondary); font:inherit; font-size:13px; font-weight:600; cursor:pointer; }\n.uh-ios-tab.uh-on { color:var(--dsw-alias-label-primary); background:var(--dsw-alias-bg-layer-1); box-shadow:0 1px 4px rgba(0,0,0,.16); }\n.uh-ios-summary { display:flex; flex-direction:column; gap:12px; background:transparent; box-shadow:none; }\n.uh-ios-summary-hero { display:grid; grid-template-columns:minmax(0,1fr) minmax(320px,.48fr); min-height:142px; padding:20px 22px; border:1px solid var(--dsw-alias-border-l1); border-radius:18px; background:var(--dsw-alias-bg-layer-1); box-shadow:0 1px 2px rgba(0,0,0,.06), 0 8px 22px rgba(0,0,0,.06); }\n.uh-ios-summary-total { min-width:0; min-height:0; padding:0; border-radius:0; display:flex; align-items:center; justify-content:flex-start; gap:16px; background:transparent; box-shadow:none; }\n.uh-ios-summary-total-icon { display:grid; place-items:center; flex:none; width:54px; height:54px; border-radius:16px; background:color-mix(in srgb,var(--uh-donut-1) 18%,var(--dsw-alias-bg-layer-2)); color:var(--uh-donut-1); }\n.uh-ios-summary-total-copy { min-width:0; }\n.uh-ios-summary-label { font-size:13px; font-weight:600; color:var(--dsw-alias-label-secondary); }\n.uh-ios-summary-total .uh-ios-summary-label { font-size:14px; }\n.uh-ios-summary-value { margin-top:7px; font-size:40px; line-height:1; font-weight:750; letter-spacing:0; color:var(--dsw-alias-label-primary); }\n.uh-unit { margin-left:6px; color:var(--dsw-alias-label-secondary); font-size:.4em; font-weight:650; white-space:nowrap; vertical-align:baseline; }\n.uh-wsbar-num .uh-unit { font-size:.78em; margin-left:3px; }\n.uh-ios-summary-caption { margin-top:8px; font-size:12px; color:var(--dsw-alias-label-secondary); }\n.uh-ios-summary-meta { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:center; min-width:0; gap:0; padding:0 0 0 22px; border-left:1px solid var(--dsw-alias-border-l1); background:transparent; font-size:12px; color:var(--dsw-alias-label-secondary); }\n.uh-ios-summary-meta-stat { min-width:0; padding:4px 22px; }\n.uh-ios-summary-meta-stat + .uh-ios-summary-meta-stat { border-left:1px solid var(--dsw-alias-border-l1); }\n.uh-ios-summary-meta-label { display:flex; align-items:center; gap:7px; color:var(--dsw-alias-label-secondary); font-size:12px; font-weight:600; white-space:nowrap; }\n.uh-ios-summary-meta-value { margin-top:7px; color:var(--dsw-alias-label-primary); font-size:24px; line-height:1; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }\n.uh-ios-summary-meta-cost .uh-ios-summary-meta-value { color:var(--uh-donut-2); }\n.uh-ios-summary-meta-caption { margin-top:7px; color:var(--dsw-alias-label-secondary); font-size:11px; white-space:nowrap; }\n.uh-ios-metrics { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }\n.uh-ios-metric { min-width:0; min-height:80px; padding:10px 13px; border:1px solid var(--dsw-alias-border-l1); border-radius:14px; display:flex; flex-direction:column; justify-content:center; gap:6px; background:var(--dsw-alias-bg-layer-1); box-shadow:0 1px 2px rgba(0,0,0,.06), 0 8px 20px rgba(0,0,0,.05); animation:uh-card-in .35s ease both; }\n.uh-ios-metrics > .uh-card { min-width:0; min-height:96px; padding:9px 13px; gap:2px; border:0; border-radius:14px; }\n.uh-ios-metrics > .uh-card .uh-card-value { min-width:0; font-size:20px; line-height:1.2; font-weight:700; white-space:nowrap; }\n.uh-ios-metrics > .uh-card .uh-card-sub { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }\n.uh-ios-metrics > .uh-card:nth-child(-n+3) { justify-content:center; }\n.uh-ios-metric-label { display:flex; align-items:center; gap:8px; min-width:0; color:var(--dsw-alias-label-secondary); font-size:13px; font-weight:600; white-space:nowrap; }\n.uh-ios-metric-label .uh-line-icon { flex:none; }\n.uh-ios-metric-value { min-width:0; color:var(--dsw-alias-label-primary); font-size:22px; line-height:1.05; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }\n.uh-ios-metric-input { background:color-mix(in srgb,var(--uh-donut-1) 11%,var(--dsw-alias-bg-layer-1)); }\n.uh-ios-metric-input .uh-line-icon { color:var(--uh-donut-1); }\n.uh-ios-metric-output { background:color-mix(in srgb,var(--uh-donut-3) 10%,var(--dsw-alias-bg-layer-1)); }\n.uh-ios-metric-output .uh-line-icon { color:var(--uh-donut-3); }\n.uh-ios-metric-write { background:color-mix(in srgb,var(--uh-donut-4) 11%,var(--dsw-alias-bg-layer-1)); }\n.uh-ios-metric-write .uh-line-icon { color:var(--uh-donut-4); }\n.uh-ios-metric-read { background:color-mix(in srgb,var(--uh-donut-2) 11%,var(--dsw-alias-bg-layer-1)); }\n.uh-ios-metric-read .uh-line-icon { color:var(--uh-donut-2); }\n.uh-ios-metric-rate { background:var(--dsw-alias-bg-layer-1); }\n.uh-ios-metric-rate .uh-line-icon { color:var(--uh-donut-2); }\n.uh-ios-metric-rate-head { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:baseline; gap:8px; min-width:0; }\n.uh-ios-metric-rate .uh-ios-metric-label { white-space:normal; overflow-wrap:anywhere; line-height:1.25; }\n.uh-ios-metric-rate-value { flex:none; color:var(--uh-donut-2); font-size:20px; line-height:1; font-weight:700; font-variant-numeric:tabular-nums; }\n.uh-ios-metric-rate-detail { min-width:0; overflow:hidden; color:var(--dsw-alias-label-secondary); font-size:12px; line-height:1.2; font-weight:600; font-variant-numeric:tabular-nums; text-overflow:ellipsis; white-space:nowrap; }\n.uh-ios-metric-bar { height:5px; border-radius:3px; background:var(--dsw-alias-bg-layer-2); overflow:hidden; }\n.uh-ios-metric-fill { height:100%; border-radius:inherit; background:var(--uh-donut-2); transition:width .35s ease; }\n.uh-token-semantics { display:flex; align-items:flex-start; gap:8px; padding:10px 12px; border-radius:12px; background:color-mix(in srgb, var(--dsw-alias-brand-primary) 8%, var(--dsw-alias-bg-layer-1)); color:var(--dsw-alias-label-secondary); font-size:12px; line-height:1.55; }\n.uh-token-semantics .uh-line-icon { margin-top:1px; color:var(--dsw-alias-brand-primary); }\n.uh-ios-list-panel { min-height:360px; }\n.uh-donut-chart { margin:0 0 18px; }\n.uh-donut-title { display:flex; align-items:center; gap:7px; margin-bottom:12px; color:var(--dsw-alias-label-primary); font-size:14px; font-weight:650; }\n.uh-donut-layout { display:grid; grid-template-columns:minmax(220px,300px) minmax(0,1fr); gap:24px; align-items:center; }\n.uh-donut-visual { position:relative; width:min(100%,280px); aspect-ratio:1; margin:0 auto; }\n.uh-donut-svg { display:block; width:100%; height:100%; overflow:visible; }\n.uh-donut-track { opacity:.78; }\n.uh-donut-segment { fill:none; stroke-dasharray:1; stroke-dashoffset:1; animation:uh-donut-draw .95s cubic-bezier(.22,.61,.36,1) both; cursor:pointer; outline:none; transition:filter .15s ease, opacity .15s ease; }\n.uh-donut-segment:hover, .uh-donut-segment:focus-visible, .uh-donut-segment.uh-active { filter:brightness(1.12); }\n.uh-donut-tooltip { position:absolute; top:0; left:0; z-index:3; display:flex; align-items:flex-start; gap:8px; max-width:190px; padding:9px 10px; border:1px solid var(--dsw-alias-border-l2); border-radius:8px; background:linear-gradient(color-mix(in srgb, var(--dsw-alias-bg-base) 94%, transparent), color-mix(in srgb, var(--dsw-alias-bg-base) 94%, transparent)), var(--dsw-alias-bg-layer-1, #1a1c20); box-shadow:0 10px 24px rgba(0,0,0,.22); color:var(--dsw-alias-label-primary); pointer-events:none; font-size:12px; line-height:1.4; transition:left .12s cubic-bezier(.22,.61,.36,1), top .12s cubic-bezier(.22,.61,.36,1); }\n.uh-donut-tooltip > div { min-width:0; display:flex; flex-direction:column; gap:4px; }\n.uh-donut-tooltip strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }\n.uh-donut-tooltip span:not(.uh-donut-dot):not(.uh-model-icon) { color:var(--dsw-alias-label-secondary); font-size:11px; }\n.uh-donut-tooltip-cost { color:var(--dsw-alias-label-primary) !important; font-variant-numeric:tabular-nums; }\n.uh-donut-center { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; pointer-events:none; }\n.uh-donut-center strong { color:var(--dsw-alias-label-primary); font-size:28px; line-height:1; font-weight:750; font-variant-numeric:tabular-nums; }\n.uh-donut-center span { margin-top:5px; color:var(--dsw-alias-label-secondary); font-size:13px; }\n.uh-donut-legend { min-width:0; }\n.uh-donut-legend-row { display:grid; grid-template-columns:36px minmax(180px,1fr) minmax(250px,.8fr) 54px; gap:10px; align-items:center; min-height:58px; padding:8px 0; border-bottom:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 78%, transparent); }\n.uh-donut-legend-row:last-child { border-bottom:0; }\n.uh-donut-dot { width:12px; height:12px; border-radius:50%; }\n.uh-donut-legend-mark { display:flex; align-items:center; gap:8px; min-width:0; }\n.uh-donut-legend-copy { min-width:0; display:flex; flex-direction:column; gap:5px; }\n.uh-donut-legend-copy strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--dsw-alias-label-primary); font-size:13px; font-weight:650; }\n.uh-donut-legend-metrics { display:grid; grid-template-columns:minmax(120px,1fr) minmax(92px,auto); align-items:center; gap:14px; min-width:0; }\n.uh-donut-legend-metrics span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--dsw-alias-label-secondary); font-size:12px; font-variant-numeric:tabular-nums; text-align:right; }\n.uh-donut-legend-metrics .uh-donut-cost { color:var(--dsw-alias-label-secondary); font-size:12px; }\n.uh-donut-percent { min-width:48px; color:var(--dsw-alias-label-secondary); font-size:12px; font-variant-numeric:tabular-nums; text-align:right; }\n/* Each detail table owns its scrolling and sticky header; sections must not overlap in the page scroll. */\n.uh-tbl-scroll { max-height:360px; overflow:auto; border-radius:12px; background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 55%, transparent); }\n.uh-hrow, .uh-model-hrow { position:sticky; top:0; z-index:3; border-bottom:1px solid var(--dsw-alias-border-l1); box-shadow:0 1px 0 color-mix(in srgb, var(--dsw-alias-bg-base) 70%, transparent); }\n.uh-row, .uh-model-row { min-height:48px; border-bottom:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 72%, transparent); }\n.uh-row:last-child, .uh-model-row:last-child { border-bottom:0; }\n@media (max-width:640px) { .uh-tbl-scroll { max-height:300px; border-radius:10px; } }\n@media (max-width:640px) { .uh-hm-body { min-width:720px; } .uh-donut-legend-row { grid-template-columns:36px minmax(0,1fr) 48px; gap:8px; } .uh-donut-legend-copy { grid-column:2; grid-row:1; } .uh-donut-legend-metrics { grid-column:2 / -1; grid-row:2; grid-template-columns:minmax(0,1fr) minmax(0,auto); gap:8px; } .uh-donut-percent { grid-column:3; grid-row:1; } .uh-ios-summary-hero { grid-template-columns:1fr; min-height:0; gap:18px; padding:18px; } .uh-ios-summary-total { align-items:flex-start; } .uh-ios-summary-meta { grid-template-columns:repeat(2,minmax(0,1fr)); padding:16px 0 0; border-left:0; border-top:1px solid var(--dsw-alias-border-l1); } .uh-ios-summary-meta-stat { padding:0 12px; } .uh-ios-summary-meta-stat:first-child { padding-left:0; } .uh-ios-summary-meta-stat:last-child { padding-right:0; } .uh-ios-summary-value { font-size:31px; } .uh-ios-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } .uh-ios-metric:last-child { grid-column:1 / -1; } .uh-ios-metric-value { font-size:24px; } .uh-donut-layout { grid-template-columns:1fr; gap:12px; } .uh-donut-visual { width:min(100%,250px); } }\n@keyframes uh-cell-in { from { opacity:0; transform:scale(.4); } to { opacity:1; transform:scale(1); } }\n@keyframes uh-card-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }\n@keyframes uh-bar-grow { from { transform:scaleX(0); } to { transform:scaleX(1); } }\n@keyframes uh-panel-in { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }\n@keyframes uh-trend-draw { from { stroke-dashoffset:var(--uh-draw-length); opacity:.2; } to { stroke-dashoffset:0; opacity:1; } }\n@keyframes uh-trend-fill { from { opacity:0; } to { opacity:1; } }\n@keyframes uh-donut-draw { from { stroke-dashoffset:1; opacity:.25; } to { stroke-dashoffset:0; opacity:1; } }\n@keyframes uh-spinner-turn { to { transform:rotate(360deg); } }\n@keyframes uh-menu-in { from { opacity:0; transform:translateY(-4px) scale(.97); } to { opacity:1; transform:translateY(0) scale(1); } }\n@keyframes uh-tip-in { from { opacity:0; } to { opacity:1; } }\n@media (prefers-reduced-motion: reduce) {\n .uh-cell, .uh-card, .uh-ios-metric, .uh-barfill, .uh-anim-panel, .uh-trend-panel, .uh-trend-line-draw, .uh-trend-area, .uh-trend-point, .uh-trend-spinner, .uh-donut-segment, .uh-records-panel, .uh-record-detail, .uh-tip, .uh-language-options { animation:none !important; stroke-dashoffset:0 !important; opacity:1 !important; }\n .uh-card, .uh-cell, .uh-ios-metric-fill, .uh-barfill, .uh-fill, .uh-refresh, .uh-chip, .uh-row, .uh-tip-row, .uh-trend-tooltip, .uh-language-trigger, .uh-language-caret, .uh-language-option { transition:none !important; }\n}\n'}const za=()=>fetch("/api/all-usage?utc=0",{headers:{accept:"application/json"}}).then(e=>{if(!e.ok)throw new Error("HTTP "+e.status);return e.json()}),Ua=e=>fetch("/api/all-usage/version"+(!0===e?"?force=1":""),{headers:{accept:"application/json"}}).then(e=>{if(!e.ok){const a=new Error("HTTP "+e.status);throw a.status=e.status,a}return e.json()}),Pa=(e,a,t)=>{const n=new URLSearchParams({start:e.start,end:e.end,utc:e.utc?"1":"0",limit:String(t||100)});return e.workspaceId&&n.set("workspaceId",e.workspaceId),e.provider&&n.set("provider",e.provider),e.modelKey&&n.set("modelKey",e.modelKey),a&&n.set("cursor",a),fetch("/api/all-usage/records?"+n.toString(),{headers:{accept:"application/json"}}).then(e=>{if(!e.ok){const a=new Error("HTTP "+e.status);throw a.status=e.status,a}return e.json()})},Ra=()=>fetch("/api/all-usage/pricing",{headers:{accept:"application/json"}}).then(e=>{if(!e.ok)throw new Error("HTTP "+e.status);return e.json()}),Ia=(e,a,t)=>fetch("/api/all-usage/pricing",{method:"POST",headers:{"content-type":"application/json","x-all-usage-request-token":t},body:JSON.stringify({pricing:e,backfill:!0===a})}).then(e=>{if(!e.ok){const a=new Error("HTTP "+e.status);throw a.status=e.status,a}return e.json()});function La(e){if("number"==typeof e)return Number.isSafeInteger(e)&&e>=1&&e<=3650?e:null;if("string"!=typeof e)return null;const a=e.trim();if(!/^[0-9]+$/.test(a))return null;const t=Number(a);return t>=1&&t<=3650?t:null}function ja(e,a){return{days:e,dryRun:!0===a}}function Ha(e){const a="number"==typeof e&&Number.isFinite(e)&&e>0?e:0;return a<1024?Math.round(a)+" B":a<1048576?(a/1024).toFixed(1)+" KB":a<1073741824?(a/1048576).toFixed(1)+" MB":(a/1073741824).toFixed(1)+" GB"}function Fa(e,a){const t=null!==e&&"object"==typeof e?e:{},n="number"==typeof t.archived&&Number.isFinite(t.archived)?t.archived:0,r=Array.isArray(t.months)?t.months.filter(e=>"string"==typeof e&&""!==e).sort():[],i=Ha("number"==typeof t.bytes?t.bytes:0),o=0===n?p(a,"没有需要归档的旧记录","No records are old enough to archive"):h(a,"将归档 {count} 条记录({size}),涉及 {months} 个月份:{list}","Archive {count} records ({size}) across {months} months: {list}",{count:n,size:i,months:r.length,list:r.join(p(a,"、",", "))});return{records:n,size:i,months:r,text:o}}function Oa(e){return null==e?"token":"object"!=typeof e?"archive-failed":"string"==typeof e.code&&""!==e.code?e.code:403===e.status?"forbidden":409===e.status?"busy":503===e.status?"ledger-unavailable":"archive-failed"}const Wa=(e,a,t)=>fetch("/api/all-usage/archive",{method:"POST",headers:{"content-type":"application/json","x-all-usage-request-token":t},body:JSON.stringify(ja(e,a))}).then(e=>e.json().catch(()=>({ok:!1})).then(a=>{if(null!==a&&"object"==typeof a&&!0===a.ok)return a;const t=new Error("archive");throw t.status=e.status,t.code=null!==a&&"object"==typeof a&&"string"==typeof a.message?a.message:"",t})),qa="dsh-all-usage.language",Ba="dsh-all-usage.language.chosen";let Ya,Ka=null;function Va(){const e=function(){try{return"1"!==window.localStorage.getItem(Ba)?null:c(window.localStorage.getItem(qa))}catch(e){return null}}();return null!==e?e:function(){if(void 0!==Ya)return Ya;Ya=null;try{const a=null!==Ka&&"function"==typeof Ka.get?Ka.get("locale"):void 0;if(null!=a){const t="function"==typeof a.getLocale?a.getLocale():"function"==typeof a.getSnapshot?a.getSnapshot():null;e=null!==t&&"object"==typeof t?t.active:void 0,Ya="string"!=typeof e||""===e?null:c(e)??"en"}}catch(e){}var e;return Ya}()??function(){try{const e="undefined"==typeof navigator?[]:navigator.languages,a=Array.isArray(e)&&e.length>0?e:["undefined"==typeof navigator?"":navigator.language];for(const e of a){const a=c(e);if(null!==a)return a}}catch(e){}return"en"}()}const Ga="dsh-all-usage.ui-state";function Za(){try{const e=window.localStorage.getItem(Ga),a=e?JSON.parse(e):{};if(null===a||"object"!=typeof a||Array.isArray(a))return{};const t={};return["logs","model","workspace"].includes(a.detailView)&&(t.detailView=a.detailView),["route","model","provider"].includes(a.modelView)&&(t.modelView=a.modelView),["today","7d","30d","90d","month","all"].includes(a.range)&&(t.range=a.range),Ge.includes(a.heatmapSpan)&&(t.heatmapSpan=a.heatmapSpan),"bar"!==a.trendChart&&"line"!==a.trendChart||(t.trendChart=a.trendChart),"boolean"==typeof a.pricingAutoSync&&(t.pricingAutoSync=a.pricingAutoSync),t}catch(e){return{}}}function Ja(e){try{const a=Za();window.localStorage.setItem(Ga,JSON.stringify(Object.assign({},a,e)))}catch(e){}}function _a(e){const a=e.timerCtx,t=c(e.language)||"en",r=(e,a)=>p(t,e,a),o=!1,l=n.useRef(null);null===l.current&&(l.current=Za());const d=l.current,g=new Date,f=v(g,o),[b,y]=n.useState(null),[w,x]=n.useState(null),[D,P]=n.useState(""),[j,F]=n.useState(0),[O,W]=n.useState(null),[q,K]=n.useState(()=>d.range||"today"),[V,G]=n.useState(()=>Je(d.heatmapSpan)),[Z,$]=n.useState(null),[ee,ae]=n.useState(""),[te,se]=n.useState({start:"",end:""}),[Ee,Ce]=n.useState({start:"",end:""}),[Se,Me]=n.useState(!1),[je,Fe]=n.useState(()=>d.modelView||"route"),[We,qe]=n.useState(null),[Be,Ye]=n.useState(null),[Ve,Ge]=n.useState(null),[Ze,Xe]=n.useState(null),[ea,aa]=n.useState(""),[ta,na]=n.useState(!1),[ra,ia]=n.useState(""),[sa,ca]=n.useState(["total","input","cacheRead","output"]),[ua,ha]=n.useState(()=>d.detailView||"logs"),[ma,ga]=n.useState(null),[fa,ba]=n.useState(null),[ya,wa]=n.useState([]),[ka,Da]=n.useState(null),[ja,qa]=n.useState(!1),[Ba,Ya]=n.useState(0),[Ka,Va]=n.useState(!1),[Ga,_a]=n.useState(!1),[$a,Qa]=n.useState(""),[Xa,et]=n.useState(!1),[at,tt]=n.useState({}),[nt,rt]=n.useState(!1),[it,ot]=n.useState(!1),[st,lt]=n.useState("90"),[dt,ct]=n.useState(null),[ut,pt]=n.useState(!1),[ht,mt]=n.useState(""),[gt,ft]=n.useState(null),[bt,yt]=n.useState(!1),[vt,wt]=n.useState(null),[xt,kt]=n.useState(null),[Et,Ct]=n.useState(!1),[Tt,St]=n.useState(!1),[Nt,Mt]=n.useState(!1),[At,Dt]=n.useState(!1),[zt,Ut]=n.useState(""),[Pt,Rt]=n.useState({}),[It,Lt]=n.useState({}),[jt,Ht]=n.useState(null),[Ft,Ot]=n.useState({}),[Wt,qt]=n.useState(null),[Bt,Yt]=n.useState({});n.useEffect(()=>{Yt({})},[t]);const[Kt,Vt]=n.useState(()=>(new Date).getFullYear()),[Gt,Zt]=n.useState(!1),[Jt,_t]=n.useState(""),$t=n.useRef({}),Qt=n.useRef(0),Xt=n.useRef({}),en=n.useRef(!1),an=n.useRef(()=>{}),tn=n.useRef(()=>{}),nn=()=>{Qt.current+=1;const e=Xt.current;for(const a of Object.keys(e))clearTimeout(e[a]);Xt.current={},$t.current={},Rt({}),Lt({})},[rn,on]=n.useState(!1),sn=n.useRef(null),ln=n.useRef(null),dn=n.useRef(null);null===dn.current&&(dn.current=M());const cn=n.useRef(null);null===cn.current&&(cn.current=M());const un=n.useRef(null);null===un.current&&(un.current=M());const pn=n.useRef(null);null===pn.current&&(pn.current=M());const hn=n.useRef(null);null===hn.current&&(hn.current=M());const mn=n.useRef(null);null===mn.current&&(mn.current=M());const gn=dn.current,fn=cn.current,bn=un.current,yn=pn.current,vn=hn.current,wn=mn.current,xn=n.useRef(()=>{}),kn=n.useRef(()=>{}),En=n.useRef(""),Cn=n.useCallback(()=>{if(!en.current||Tt||Nt||At)return;const e=wn.next();Ct(!0),Ra().then(a=>{if(wn.isCurrent(e)){if(!a||"object"!=typeof a||!a.config)return Ut("load"),void Ct(!1);nn(),wt(a),kt(e=>ce(e,a)),Ut(""),Ct(!1)}},()=>{wn.isCurrent(e)&&(Ut("load"),Ct(!1))})},[Tt,Nt,At]);n.useEffect(()=>{an.current=Cn});n.useEffect(()=>{Ja({detailView:ua})},[ua]),n.useEffect(()=>{Ja({modelView:je})},[je]),n.useEffect(()=>{"custom"!==q&&Ja({range:q})},[q]),n.useEffect(()=>{Ja({heatmapSpan:V})},[V]),n.useEffect(()=>{let e=!0;const a=a=>Ua(a).then(a=>{e&&($(a),ae(""))},a=>{e&&ae(!a||401!==a.status&&404!==a.status?"failed":"endpoint")});return tn.current=()=>a(!1),a(!1),()=>{e=!1,tn.current=()=>{}}},[]);const Tn=n.useMemo(()=>null===b?null:function(e,a,t,n,r,i,o){const s=$e(e,a,t,n);return null===s?null:{start:s.start,end:s.end,utc:!1,workspaceId:r||null,provider:i||null,modelKey:o||null}}(b,q,o,te,We,Be,Ve),[b,q,o,te.start,te.end,We,Be,Ve]),Sn=Qe(Tn),Nn=U(null!==w&&"object"==typeof w?w:b),Mn=null!==ma&&ma.baseKey===Sn?ma.scope:Tn,An=Qe(Mn),Dn=n.useRef(Sn);n.useEffect(()=>{Dn.current!==Sn&&(Dn.current=Sn,ga(null),ba(null))},[Sn]),n.useEffect(()=>{let e=!0,t=!1,n="",r=null,i="",o=0,s=0,l=null;const d=()=>{null!==l&&(clearTimeout(l),l=null)},c=a=>{if(""===n)return;const t=bn.next();((e,a)=>fetch("/api/all-usage/balance"+(e?"?force=1":""),{headers:{accept:"application/json","x-all-usage-request-token":a}}).then(e=>{if(!e.ok)throw new Error("HTTP "+e.status);return e.json()}))(!0===a,n).then(a=>{e&&bn.isCurrent(t)&&a&&W(a)},()=>{})},u=a=>{if(!e||null!==l)return;const t="full"===a?o+=1:s+=1;l=setTimeout(()=>{l=null,e&&("full"===a?p():h())},function(e){const a=Math.max(1,Math.min(4,"number"==typeof e&&Number.isFinite(e)?e:1));return 5e3*Math.pow(2,a-1)}(t))},p=()=>{fn.next();const a=gn.next();za().then(s=>{if(!e||!gn.isCurrent(a))return;if(null===s||"object"!=typeof s)return P("full"),void u("full");const l=null!==r&&"string"==typeof r.pluginVersion?r.pluginVersion:"";r=s,s.scan&&(t=!!s.scan.done);const p="string"==typeof s.pluginVersion?s.pluginVersion:"";""!==p&&p!==l&&tn.current();const h="string"==typeof s.requestToken?s.requestToken:"",m=""!==h&&h!==n;n=h,""!==h&&(En.current=h),o=0,d(),P(""),F(Date.now()),x(s),i=JSON.stringify(s),y(s),m&&c(!1)},()=>{e&&gn.isCurrent(a)&&(P("full"),u("full"))})},h=()=>{if(null===r)return void p();const a=fn.next();fetch("/api/all-usage/status",{headers:{accept:"application/json"}}).then(e=>{if(!e.ok)throw new Error("HTTP "+e.status);return e.json()}).then(n=>{if(!e||!fn.isCurrent(a))return;if(null===n||"object"!=typeof n)return P("status"),void u("status");s=0;const o=function(e,a){if(null===e||"object"!=typeof e||null===a||"object"!=typeof a)return"full";if("string"!=typeof e.instanceId||"string"!=typeof a.instanceId||""===e.instanceId||e.instanceId!==a.instanceId)return"full";const t="string"==typeof e.capabilityId?e.capabilityId:"",n="string"==typeof a.capabilityId?a.capabilityId:"";if(""!==t&&t!==n)return"full";if(z(e)&&z(a)){if(e.metadataRevision!==a.metadataRevision)return"full";if(e.pricingRevision!==a.pricingRevision)return"full";if(e.dataRevision!==a.dataRevision)return"query";const t=e.scan,n=a.scan;return e.scanRevision!==a.scanRevision||t&&n&&!!t.done!=!!n.done?"status":"none"}const r=A(e),i=A(a);if(null===r||null===i||r!==i)return"full";const o=e.scan,s=a.scan;return o&&s&&!!o.done!=!!s.done?"full":"none"}(n,r);if(n.scan&&(t=!!n.scan.done),"full"===o)return"number"==typeof n.pricingRevision&&"number"==typeof r.pricingRevision&&n.pricingRevision!==r.pricingRevision&&an.current(),void p();r=Object.assign({},r,n);const l=JSON.stringify(n);l!==i&&(i=l,x(n)),d(),P("")},()=>{e&&fn.isCurrent(a)&&(P("status"),u("status"))})};p();const m=a.interval(()=>{t||null!==l||h()},2e3),g=a.interval(()=>{t&&null===l&&h()},15e3),f=a.interval(()=>{c(!1)},6e4);return xn.current=()=>{d(),o=0,s=0,p(),c(!0)},kn.current=p,()=>{e=!1,d(),m(),g(),f();for(const e of Object.values(Xt.current))clearTimeout(e);Xt.current={}}},[]);const zn=n.useRef(o);n.useEffect(()=>{zn.current!==o&&(zn.current=o,kn.current())},[o]),n.useEffect(()=>{if(!rn||"undefined"==typeof document)return;const e=e=>{sn.current&&!sn.current.contains(e.target)&&on(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[rn]),n.useEffect(()=>{if(null===Tn||""===Sn)return;const e=yn.next();let a=!0,t=0;const n=(r,i)=>{(e=>{const a=new URLSearchParams({start:e.start,end:e.end,utc:e.utc?"1":"0"});return e.workspaceId&&a.set("workspaceId",e.workspaceId),e.provider&&a.set("provider",e.provider),e.modelKey&&a.set("modelKey",e.modelKey),fetch("/api/all-usage/query?"+a.toString(),{headers:{accept:"application/json"}}).then(e=>{if(!e.ok)throw new Error("HTTP "+e.status);return e.json()})})(Tn).then(o=>{if(!a||!yn.isCurrent(e))return;const s=null===o||"object"!=typeof o?null:U(o);if(null===r||null===s||s!==r)return null!==s&&i<2&&t<2?(t+=1,1===t&&kn.current(),void n(s,i+1)):(ia("stale"),void na(!1));Xe(o),aa(Sn),na(!1),ia("")},()=>{a&&yn.isCurrent(e)&&(na(!1),ia("query"))})};return na(!0),ia(""),n(Nn,0),()=>{a=!1}},[Sn,Nn]);const Un=n.useCallback(e=>{null!==e&&""!==Sn&&(ga({baseKey:Sn,scope:{...e}}),ha("logs"),ba(null),Qa(""))},[Sn]),Pn=n.useRef(null);Pn.current=Tn;const Rn=n.useCallback(e=>{const a=Pn.current;null!==a&&"string"==typeof e&&Un({...a,start:e,end:e})},[Un]),In="logs"===ua&&null!==Mn&&""!==An;n.useEffect(()=>{if(!In)return vn.next(),void Va(!1);const e=vn.next(),a=Nn;return Va(!0),Qa(""),Da(null),qa(!1),Pa(Mn,null,20).then(t=>{if(vn.isCurrent(e)){if(null===t||"object"!=typeof t||!Array.isArray(t.items))return Qa("audit"),void Va(!1);if(null===a||U(t)!==a)return Qa("stale"),void Va(!1);wa(t.items),ba(e=>t.items.some(a=>a&&a.id===e)?e:t.items[0]?t.items[0].id:null),Da(t.nextCursor||null),qa(!0===t.hasMore),Va(!1),Qa("")}},a=>{if(vn.isCurrent(e)){if(a&&409===a.status)return Va(!1),Qa("stale"),void Ya(e=>e+1);Va(!1),Qa("audit")}}),()=>{vn.next()}},[An,ua,Nn,Ba]),n.useEffect(()=>{null!==ma&&"logs"===ua&&null!==ln.current&&ln.current.scrollIntoView({behavior:"smooth",block:"start"})},[ma&&Qe(ma.scope),ua]);const Ln=n.useCallback(()=>{xn.current(),Ua(!0).then(e=>{e&&($(e),ae(""))},e=>ae(!e||401!==e.status&&404!==e.status?"failed":"endpoint"))},[]),jn=n.useCallback(e=>{qe(a=>a===e?null:e)},[]),Hn=n.useCallback(()=>{qe(null),Ye(null),Ge(null)},[]),Fn=n.useCallback(e=>{Ye(e||null)},[]),On=n.useCallback(e=>{Ge(e||null)},[]),Wn=n.useMemo(()=>Array.isArray(b&&b.byDay)?b.byDay:[],[b,o]),qn=N(Wn,f).min,Bn=S(te,o),Yn=function(e,a,t,n){return null!==e&&"object"==typeof e&&T(e.start,n)&&T(e.end,n)?e.start>e.end?"order":e.start<a||e.end>t?"bounds":"":"invalid"}(Ee,qn,f,o),Kn=n.useCallback(e=>{G(Je(e))},[]),Vn=null!==Ze&&ea===Sn,Gn=Vn&&null!==Nn&&U(Ze)===Nn,Zn=Vn&&(Gn||""===ra),Jn=null===Bn?"":Bn.start+":"+Bn.end,_n=n.useMemo(()=>function(e,a,t,n){const r={totals:{turns:0,calls:0,sessions:0,input:0,output:0,cacheRead:0,cacheWrite:0,reasoning:0,cost:{currency:"USD",input:"0",output:"0",cacheRead:"0",cacheWrite:"0",baseTotal:"0",total:"0",pricedCalls:0,unpricedCalls:0,ambiguousCalls:0,unsupportedCalls:0}},perWs:[],perModel:[]};if(null===e)return r;if("all"===a)return{totals:e.totals,perWs:e.perWorkspace,perModel:e.perModel||[]};const i=Array.isArray(e.byDay)?e.byDay:[];let o,s=null;if("custom"===a){const e=S(n,t);if(null===e)return r;o=e.start,s=e.end}else o=v("today"===a?new Date:"7d"===a?E(new Date,-6,t):"30d"===a?E(new Date,-29,t):"month"===a?C(new Date,t):E(new Date,-89,t),t);const l={turns:0,calls:0,sessions:0,input:0,output:0,cacheRead:0,cacheWrite:0,reasoning:0,cost:{currency:"USD",input:"0",output:"0",cacheRead:"0",cacheWrite:"0",baseTotal:"0",total:"0",pricedCalls:0,unpricedCalls:0,ambiguousCalls:0,unsupportedCalls:0}},d=new Map,c=new Map,u=new Set;for(const e of i){if(e.date<o||null!==s&&e.date>s)continue;const a=Array.isArray(e.sessionIds)?e.sessionIds:[];for(const e of a)u.add(e);l.turns+=e.turns,l.input+=e.tokens.input,l.output+=e.tokens.output,l.cacheRead+=e.tokens.cacheRead,l.cacheWrite+=e.tokens.cacheWrite,l.reasoning+=e.tokens.reasoning,ie(l.cost,e.cost);for(const a of e.byWorkspace){let e=d.get(a.workspaceId);void 0===e&&(e={workspaceId:a.workspaceId,turns:0,input:0,output:0,cacheRead:0,cacheWrite:0,reasoning:0,cost:ne()},d.set(a.workspaceId,e)),e.input+=a.input,e.output+=a.output,e.cacheRead+=a.cacheRead,e.cacheWrite+=a.cacheWrite,e.reasoning+=a.reasoning,ie(e.cost,a.cost)}for(const a of e.perWorkspace){let e=d.get(a.workspaceId);void 0===e&&(e={workspaceId:a.workspaceId,turns:0,input:0,output:0,cacheRead:0,cacheWrite:0,reasoning:0,cost:ne()},d.set(a.workspaceId,e)),e.turns+=a.turns}for(const a of e.byModel||[]){const e=a.identityKey||a.model;let t=c.get(e);void 0===t&&(t={...a,calls:0,input:0,output:0,cacheRead:0,cacheWrite:0,reasoning:0,cost:ne()},c.set(e,t)),t.calls+=a.calls,t.input+=a.input,t.output+=a.output,t.cacheRead+=a.cacheRead,t.cacheWrite+=a.cacheWrite,t.reasoning+=a.reasoning,l.calls+=Number.isFinite(a.calls)?a.calls:0,ie(t.cost,a.cost)}}return l.sessions=u.size,{totals:l,perWs:Array.from(d.values()),perModel:Array.from(c.values())}}(b,q,o,Bn),[b,q,o,Jn]),$n=n.useMemo(()=>function(e,a,t){if(!0===t)return!0;if(null==e||null==a)return!0;const n=Oe(e.totals),r=Oe(a.totals);return null===n||null===r||(0===r?0===n:Math.abs(n-r)<=Math.max(.05*r,2e5))}(Gn?Ze:null,_n,null!==We||null!==Be||null!==Ve),[Gn,Ze,_n,We,Be,Ve]),Qn=Zn&&$n,Xn=Qn&&Array.isArray(Ze.daily)?Ze.daily:Wn,er=Qn&&Array.isArray(Ze.heatmap)?Ze.heatmap:Wn,ar=n.useMemo(()=>Qn?{totals:Ze.totals,perWs:Ze.perWorkspace||[],perModel:Ze.perModel||[]}:_n,[Qn,Ze,_n]),tr=da(ar.totals.input+ar.totals.output+ar.totals.cacheRead+ar.totals.cacheWrite+ar.totals.reasoning,a),nr=(da(Math.round(10*L(ar.totals.input,ar.totals.cacheRead)),a),null!==Be||null!==Ve),rr=function(e){if(null==e)return 0;const a=Number(e.pricedCalls||0)+Number(e.unpricedCalls||0)+Number(e.ambiguousCalls||0)+Number(e.unsupportedCalls||0);return Number.isFinite(a)&&a>0?a:0}(ar.totals.cost),ir=rr>0?rr:Number.isFinite(ar.totals.calls)&&ar.totals.calls>0?ar.totals.calls:ar.totals.turns,or=da(nr?ir:ar.totals.turns,a),sr=da(ir,a),lr=e=>e.input+e.output+e.cacheRead+e.cacheWrite+e.reasoning,dr=n.useMemo(()=>(Array.isArray(ar.perWs)?ar.perWs:[]).slice().sort((e,a)=>lr(a)-lr(e)),[ar.perWs]),cr=n.useMemo(()=>function(e,a,t,n){if("route"===a)return e.slice();const r=new Map,i=new Map;for(const o of e){const e=la(o,t,n),s="model"===a?e.model:e.provider;let l=r.get(s);void 0===l&&(l={model:s,provider:"provider"===a?s:e.provider,calls:0,input:0,output:0,cacheRead:0,cacheWrite:0,reasoning:0,cost:ne()},r.set(s,l),i.set(s,[])),i.get(s).push(o),l.calls+=o.calls,l.input+=o.input,l.output+=o.output,l.cacheRead+=o.cacheRead,l.cacheWrite+=o.cacheWrite,l.reasoning+=o.reasoning,ie(l.cost,o.cost)}for(const[e,t]of r){const n="provider"===a?Y(e):_(i.get(e));t.iconKey=null===n?null:n.key}return Array.from(r.values())}(ar.perModel||[],je,r("未知供应商","Unknown provider"),r("未知模型","Unknown model")).sort((e,a)=>lr(a)-lr(e)),[ar.perModel,je,t]),ur=b&&Array.isArray(b.workspaces)?b.workspaces:[],pr=b&&b.aliases&&"object"==typeof b.aliases?b.aliases:{},hr=n.useMemo(()=>{const e=Array.isArray(_n.perModel)?_n.perModel.filter(e=>e&&"object"==typeof e):[],a=Array.from(new Set(e.map(e=>"string"==typeof e.provider&&""!==e.provider?e.provider:null).filter(e=>null!==e))).sort(),n=e=>{const n="string"==typeof e.actualModel&&""!==e.actualModel?e.actualModel:"string"==typeof e.requestedModel&&""!==e.requestedModel?e.requestedModel:null;if(null!==n)return B(n);const r="string"==typeof e.model&&""!==e.model?e.model:p(t,"未知模型","Unknown model"),i=r.indexOf(" / "),o=i>0?r.slice(0,i):"";return B(i>0&&a.includes(o)?r.slice(i+3):r)},r=new Map;for(const a of e.map(n)){if(""===a)continue;const e=a.toLowerCase();r.has(e)?a===a.toLowerCase()&&r.set(e,a):r.set(e,a)}const i=Array.from(r.values()).sort((e,a)=>e.localeCompare(a)).map(e=>({value:e,label:B(e)})),o=new Map((Array.isArray(_n.perWs)?_n.perWs:[]).map(e=>[e.workspaceId,e])),s=ur.filter(e=>{return void 0!==(a=o.get(e.id))&&(Number(a.turns)>0||Number(a.calls)>0||Number(a.input)>0||Number(a.output)>0||Number(a.cacheRead)>0||Number(a.cacheWrite)>0||Number(a.reasoning)>0);var a});return{providerOptions:a,modelOptions:i,rangeWorkspaceOptions:s,rangeWorkspaceIds:new Set(s.map(e=>e.id))}},[_n.perModel,_n.perWs,ur,t]),{providerOptions:mr,modelOptions:gr,rangeWorkspaceOptions:fr,rangeWorkspaceIds:br}=hr,yr=n.useMemo(()=>{const e=new Map,a=new Map;return ur.forEach((t,n)=>{e.set(t.id,t),a.set(t.id,n)}),{byId:e,indexes:a}},[ur]),vr=yr.byId,wr=yr.indexes,xr=n.useCallback(e=>{const a=pr[e],n=vr.get(e);if(void 0!==n&&!0===n.retiredBucket)return p(t,"已删除","Deleted");const r="string"==typeof a&&""!==a?a:n&&n.title?n.title:p(t,"未知工作区","Unknown workspace");return void 0!==n&&!0===n.deleted?r+p(t,"(已删除)"," (deleted)"):r},[pr,vr,t]),kr=n.useMemo(()=>[{value:"",label:p(t,"全部工作区","All workspaces")}].concat(fr.map(e=>({value:e.id,label:xr(e.id)}))),[fr,xr,t]),Er=n.useMemo(()=>[{value:"",label:p(t,"全部供应商","All providers")}].concat(mr.map(e=>({value:e,label:e}))),[mr,t]),Cr=n.useMemo(()=>[{value:"",label:p(t,"全部模型","All models")}].concat(gr.map(e=>({value:e.value,label:e.label,iconKey:(()=>{const a=J({actualModel:e.value,requestedModel:e.value});return null===a?null:a.key})()}))),[gr,t]),Tr=n.useMemo(()=>{const e=new Map;for(const a of Wn)e.set(a.date,a);return e},[Wn]),Sr=n.useMemo(()=>function(e,a){const t=new Date;let n=0;for(let r=0;r<371;r++){const i=E(t,-r,a),o=e.get(v(i,a));if(void 0!==o&&o.turns>0)n+=1;else if(r>0)break}let r=0,i=0;for(let n=0;n<371;n++){const o=E(t,-n,a),s=e.get(v(o,a));void 0!==s&&s.turns>0?(i+=1,i>r&&(r=i)):i=0}return{streak:n,best:r}}(Tr,o),[Tr,o,f]),Nr=b&&b.pricing&&"object"==typeof b.pricing?b.pricing:{},Mr=vt&&"object"==typeof vt?vt:Nr,Ar=n.useMemo(()=>nt?function(e,a,t){const n=null!==e&&"object"==typeof e?e:{},r=function(e){if(null===e||"object"!=typeof e)return de(e);const a=xe.get(e);if(void 0!==a)return a;const t=de(e);return xe.set(e,t),t}(n),i=new Map;for(const e of Array.isArray(n.temporalSchedules)?n.temporalSchedules:[])null!==e&&"object"==typeof e&&"string"==typeof e.id&&Array.isArray(e.policies)&&i.set(e.id,e.policies);const o=null!==a&&"object"==typeof a&&Array.isArray(a.mappings)?a.mappings:[],s=null!==a&&"object"==typeof a&&Array.isArray(a.overrides)?a.overrides:[],l=null!==t&&"object"==typeof t?t:{},d=new Map;for(let e=0;e<o.length;e+=1){const a=o[e];if(null===a||"object"!=typeof a)continue;const t=String(a.identityKey||a.usageIdentityKey||"").trim();""===t||d.has(t)||d.set(t,e)}const c=new Map;for(let e=0;e<s.length;e+=1){const a=s[e];if(null===a||"object"!=typeof a)continue;const t=ye({providerId:a.providerId,modelId:a.modelId});c.has(t)||c.set(t,e)}return r.map(e=>{const a=function(e){if(null===e||"object"!=typeof e)return"";const a="string"==typeof e.identityKey?e.identityKey.trim():"";if(""!==a)return a;const t=e.pricingModel||e.actualModel||e.requestedModel||e.model||"";return"price|"+String(e.providerId||"").trim().toLowerCase()+"|"+String(t).trim().toLowerCase()}(e),t="string"==typeof e.identityKey?e.identityKey.trim():"",n=""!==t&&d.has(t)?d.get(t):-1,r=n>=0?o[n]:null,u=null!==r&&""!==String(r.catalogModelId||"").trim(),p=function(e,a){const t=null!==a&&"object"==typeof a&&"string"==typeof a.catalogModelId?a.catalogModelId.trim():"";if(""!==t)return{providerId:String(a.catalogProviderId||"").trim().toLowerCase(),modelId:t};const n=null!==e&&"object"==typeof e&&"priced"===e.status&&"string"==typeof e.pricingModel&&""!==e.pricingModel.trim(),r=n?e.pricingModel:null!==e&&"object"==typeof e?e.actualModel||e.requestedModel||e.pricingModel||e.model:"";return{providerId:n?String(e.providerId||"").trim().toLowerCase():"",modelId:String(r||"").trim()}}(e,r),h=ye(p),m=c.has(h)?c.get(h):-1,g=m>=0?s[m]:null,f=u&&null!==l[a]&&"object"==typeof l[a]?l[a]:null,b=null!==f&&null!==f.rates&&"object"==typeof f.rates?f:null,y=null!=g?{input:g.input,output:g.output,cacheRead:g.cacheRead,cacheWrite:g.cacheWrite}:null!==b?{input:b.rates.input,output:b.rates.output,cacheRead:b.rates.cacheRead,cacheWrite:b.rates.cacheWrite}:null!==e.rates&&"object"==typeof e.rates?{input:e.rates.input,output:e.rates.output,cacheRead:e.rates.cacheRead,cacheWrite:e.rates.cacheWrite}:null,v=Array.isArray(e.tiers)?e.tiers.map(e=>Object.assign({},e)):[],w=null!=g&&Array.isArray(g.tiers)?g.tiers.map(e=>Object.assign({},e)):null!==b?[]:v,x=null!=g?!0===g.tiered&&w.length>0:null!==b?!0===b.tiered:!0===e.tiered,k=null!=g?w.length:null!==b?Number.isFinite(Number(b.tierCount))?Number(b.tierCount):0:Number.isFinite(Number(e.tierCount))?Number(e.tierCount):w.length,E="string"==typeof e.temporalScheduleId?i.get(e.temporalScheduleId):null,C=null!=g&&void 0!==g.temporalPricing?g.temporalPricing:Array.isArray(E)?{policies:E}:null,T=null!=C&&Array.isArray(C.policies)?C.policies.reduce((e,a)=>e+(null!==a&&Array.isArray(a.rules)?a.rules.length:0),0):0,S=null!=g&&void 0!==g.temporalPricing,N="string"==typeof e.temporalPolicyId?e.temporalPolicyId:"",M="official"===e.temporalRoute||"mapped"===e.temporalRoute,A=null===C&&M&&""!==N;return{key:a,row:e,identityKey:"string"==typeof e.identityKey?e.identityKey:"",usageBacked:!0===e.usageBacked||!1!==e.usageBacked&&null,model:"string"==typeof e.model?e.model:"",status:"string"==typeof e.status?e.status:"unpriced",reason:"string"==typeof e.reason?e.reason:"",mapped:u,mapping:r,mappingIndex:n,basis:p,overrideIndex:m,override:g,source:null!=g?"manual":"string"==typeof e.source?e.source:"none",rates:y,tiers:w,tiered:x,tierCount:k,tieredInvalid:!0===e.tieredInvalid,multiplier:null!==r&&void 0!==r.multiplier?String(r.multiplier):"1",inputTokenSemantics:null!==r&&"string"==typeof r.inputTokenSemantics?r.inputTokenSemantics:"fresh",pricingModel:u?String(r.catalogModelId):"string"==typeof e.pricingModel?e.pricingModel:"",providerId:p.providerId,temporalPlan:void 0===C?null:C,temporalRuleCount:T,temporalPolicyId:N,temporalRoute:"string"==typeof e.temporalRoute?e.temporalRoute:"",temporalRulesUnavailable:A,temporalExplicit:!!S||!0===e.temporalExplicit,temporalBuiltin:!S&&(A||!0===e.temporalBuiltin),temporalConfigInvalid:!0===e.temporalConfigInvalid||null!=g&&!0===g.temporalPricingInvalid,targetPreview:f,mappable:"string"==typeof e.identityKey&&""!==e.identityKey.trim()}})}(Mr,xt,Ft):[],[nt,Mr,xt,Ft]),Dr=n.useMemo(()=>oa({stats:b,queryScope:Tn,queryResult:Ze,queryReady:Gn,activeDayRows:Wn,range:q,useUtc:o,activeCustomRange:Bn}),[Tn,Gn,Ze,Wn,b,q,o,Jn]),zr=Qn&&Ze?Sn+":"+(U(Ze)||"query"):Sn,Ur=n.useMemo(()=>({}),[nt,xt,Et,Tt,Nt,At,zt,Mr,Nr,Ar,Wt,Bt,It,jt,Pt,b,t]),Pr=n.useMemo(()=>cr.map((e,a)=>({label:e.model,value:lr(e),cost:e.cost,color:pa[a%pa.length],iconKey:"route"===je?(()=>{const a=J(e);return null===a?null:a.key})():void 0===e.iconKey?null:e.iconKey})),[cr,je]),Rr=n.useMemo(()=>dr.map((e,a)=>({label:xr(e.workspaceId),value:lr(e),cost:e.cost,color:pa[a%pa.length]})),[dr,xr]),Ir=n.useCallback(e=>{ca(a=>a.includes(e)?a.length<=1?a:a.filter(a=>a!==e):a.concat(e))},[]);if(n.useEffect(()=>{null===We||br.has(We)||qe(null),null===Be||mr.includes(Be)||Ye(null),null===Ve||gr.some(e=>e.value===Ve)||Ge(null)},[We,Be,Ve,br,mr,gr]),null===b){const e=""!==D;return n.createElement("div",{className:"uh-page"},n.createElement("div",{className:"uh-panel"},n.createElement("div",{className:"uh-empty"},e?r("无法加载用量统计。请重试。","Unable to load usage statistics. Please retry."):r("正在加载用量统计…","Loading usage statistics…")),e?n.createElement("div",{style:{textAlign:"center"}},n.createElement("button",{className:"uh-refresh",onClick:Ln},n.createElement(H,{name:"refresh",size:14}),r("重试","Retry"))):null))}const Lr=null!==w&&"object"==typeof w?w:b,jr=Lr&&Lr.scan?Lr.scan:b.scan||{done:!0,started:!0,scanned:0,total:0,failed:0},Hr=Lr&&Lr.sync?Lr.sync:b.sync||{},Fr=Xn,Or=(e,a,t)=>{const n=En.current;return""===n?(t(null),Promise.resolve()):e(n).then(a,r=>null===r||"object"!=typeof r||403!==r.status?(t(r),Promise.resolve()):za().then(i=>{const o=null!==i&&"object"==typeof i&&"string"==typeof i.requestToken?i.requestToken:"";if(""!==o&&o!==n)return En.current=o,e(o).then(a,()=>{t(r)});t(r)},()=>{t(r)}))},Wr=(e,a)=>{""!==En.current&&Or(t=>{return n=e,r=String(void 0===a?"":a).trim(),fetch("/api/all-usage/alias",{method:"POST",headers:{"content-type":"application/json","x-all-usage-request-token":t},body:JSON.stringify({workspaceId:n,alias:r})}).then(e=>{if(!e.ok)throw new Error("HTTP "+e.status);return e.json()});var n,r},e=>{e&&e.ok&&e.aliases&&y(a=>null===a?a:Object.assign({},a,{aliases:e.aliases}))},()=>{})},qr=()=>{Rt({}),Lt({}),Ht(null),Ot({}),qt(null),Yt({}),_t("")},Br=()=>{Tt||Nt||At||(nn(),wn.next(),Ct(!1),rt(!1),en.current=!1,qr(),Ut(""))},Yr=()=>{if(ut)return;ei();const e=wn.next();wt(null),kt(null),Ct(!0),qr(),nn(),Ut(""),rt(!0),en.current=!0,et(!1),Ra().then(a=>{if(!wn.isCurrent(e))return;if(!a||"object"!=typeof a||!a.config)return void Ut("load");const t=le(a);wt(a),kt(t)},()=>{wn.isCurrent(e)&&Ut("load")}).finally(()=>{wn.isCurrent(e)&&Ct(!1)})},Kr=e=>{if(null===xt||Tt||Nt||At)return;const a=function(e,a){const t=e&&Array.isArray(e.mappings)?e.mappings:[];for(const e of t){if(!e||""===String(e.identityKey||e.usageIdentityKey||e.model||"").trim()||""===String(e.catalogModelId||"").trim())return"mapping";if(!["fresh","total","legacy"].includes(e.inputTokenSemantics||"fresh")||!me(void 0===e.multiplier?"1":e.multiplier))return"mapping"}const n=e&&Array.isArray(e.overrides)?e.overrides:[];for(const e of n){if(!e||""===String(e.modelId||"").trim())return"override";if(!["input","output","cacheRead","cacheWrite"].every(a=>me(e[a])))return"override";let a=0;const t=Array.isArray(e.tiers)?e.tiers:[];if(t.length>32)return"tier";for(const e of t){if(!ge(e,a))return"tier";a=Number(e.size)}if(!0===e.tiered&&0===t.length)return"tier"}const r=null!=a&&"object"==typeof a?a:{};for(const e of Object.keys(r))if(""!==Le(r[e]))return"temporal";return""}(xt,Bt);if(""!==a)return void Ut(a);if(function(e){try{return JSON.stringify({pricing:e}).length>204800}catch(e){return!0}}(xt))return void Ut("too-large");if(""===En.current)return void Ut("token");const t=wn.next();St(!0),Ut(""),Or(a=>Ia(xt,e,a),e=>{wn.isCurrent(t)&&(e&&!0===e.ok&&e.pricing?(y(a=>null===a?a:Object.assign({},a,{pricing:e.pricing})),wt(e.pricing),kt(le(e.pricing)),qr(),Br(),xn.current()):Ut("save"))},e=>{wn.isCurrent(t)&&Ut(e&&403===e.status?"stale":"save")}).finally(()=>St(!1))},Vr=()=>{Tt||Nt||At||(""!==En.current?(Mt(!0),Ut(""),Or(e=>fetch("/api/all-usage/pricing/sync",{method:"POST",headers:{"content-type":"application/json","x-all-usage-request-token":e},body:"{}"}).then(e=>{if(!e.ok){const a=new Error("HTTP "+e.status);throw a.status=e.status,a}return e.json()}),e=>{e&&!0===e.ok&&e.pricing?(nn(),y(a=>null===a?a:Object.assign({},a,{pricing:e.pricing})),wt(e.pricing),kt(a=>ce(a,e.pricing)),Rt({}),Lt({}),Ht(null),Ot({}),Yt({}),xn.current()):Ut("sync")},e=>{Ut(e&&403===e.status?"stale":"sync")}).finally(()=>Mt(!1))):Ut("token"))},Gr=(e,a,t)=>{kt(n=>null===n?n:function(e,a,t,n){if(null===e||"object"!=typeof e)return e;const r=we(e.mappings,a.identityKey);if(r<0)return e;const i=e.mappings.slice(),o={};return o[t]=n,i[r]=Object.assign({},i[r],o),Object.assign({},e,{mappings:i})}(n,e,a,t)),Ut("")},Zr=(e,a,t,n)=>{const r=function(e,a,t,n){const r=Array.isArray(e)?e.map(e=>Object.assign({},e)):[];if(void 0===r[a])return r;const i={};return i[t]=n,r[a]=Object.assign({},r[a],i),r}(e.tiers,a,t,n);kt(a=>null===a?a:ke(a,e,{tiered:r.length>0,tiers:r})),Ut("")},Jr=(e,a)=>{Yt(t=>Object.assign({},t,{[e.key]:a})),""===Le(a)&&kt(n=>null===n?n:ke(n,e,{temporalPricing:Ie(a,Te(t)),temporalPricingInvalid:void 0})),Ut("")},_r=e=>{const a=De(e.temporalPlan,Te(t))||ze(e.rates,Te(t));Jr(e,a)},$r=(e,a)=>{const n=e.key+"|"+a;qt(e=>e===n?null:n),"temporal"===a&&Yt(a=>{if(void 0!==a[e.key])return a;const n=De(e.temporalPlan,Te(t));return null===n?a:Object.assign({},a,{[e.key]:n})}),Ut("")},Qr=()=>qt(null),Xr=()=>{ct(null),ft(null),mt(""),yt(!1)},ei=()=>{ut||(ot(!1),Xr())},ai=ar.totals.input+ar.totals.output+ar.totals.cacheRead+ar.totals.cacheWrite+ar.totals.reasoning,ti=L(ar.totals.input,ar.totals.cacheRead),ni=(re(ar.totals),oe(ar.totals,t)),ri=function(e,a){const t=re(e);if(t.pricedCalls>0&&0===t.unpricedCalls&&0===t.ambiguousCalls&&0===t.unsupportedCalls)return h(a,"{count} 次已计价","{count} priced",{count:t.pricedCalls});const n=t.unpricedCalls+t.ambiguousCalls+t.unsupportedCalls;return n>0?h(a,"{count} 次未计价","{count} unpriced",{count:n}):p(a,"暂无价格","No pricing")}(ar.totals,t);let ii="—",oi=r("查询中…","Checking…");if(null!=O)if("missing-key"===O.status)ii=r("未配置","Not configured"),oi=r("在 设置 → 模型 中填写 DeepSeek API Key 后可见","Available after you enter a DeepSeek API key in Settings → Models");else if("unavailable"===O.status)ii=r("不可用","Unavailable"),oi=O.message||r("DeepSeek 接口返回余额不可用","The DeepSeek API reported that balance information is unavailable");else if("error"===O.status){ii=r("查询失败","Lookup failed");const e=O.detail?h(t,"({detail})"," ({detail})",{detail:String(O.detail).slice(0,90)}):"";oi=(O.message||"")+e+r(" 点“刷新”重试"," Click Refresh to try again")}else if("ok"===O.status&&Array.isArray(O.currencies)&&O.currencies.length>0){const e=O.currencies,a=e.find(e=>"CNY"===e.currency)||e[0],n=e.filter(e=>e!==a);ii=X(a.currency,a.total,t,2);let i=null!==a.total?r("赠送 ","Granted ")+X(a.currency,a.granted,t,2)+" · "+r("充值 ","Top-up ")+X(a.currency,a.toppedUp,t,2):"";n.length>0&&(i+=(i?" | ":"")+n.map(e=>X(e.currency,e.total,t)).join(" ")),oi=i}else ii=r("无数据","No data"),oi="";const si=(e,a,t,r,i,o)=>n.createElement("div",{className:"uh-card",style:{animationDelay:70*r+"ms"}},n.createElement("div",{className:"uh-card-label"},o?n.createElement(Na,{iconKey:o,size:15,showTitle:!0}):i?n.createElement(H,{name:i,size:14}):null,e),n.createElement("div",{className:"uh-card-value"},a),n.createElement("div",{className:"uh-card-sub"},t)),li=n.createElement("div",{className:"uh-ios-metric uh-ios-metric-rate",style:{animationDelay:"280ms"}},n.createElement("div",{className:"uh-ios-metric-rate-head"},n.createElement("div",{className:"uh-ios-metric-label"},n.createElement(H,{name:"cache",size:18}),r("缓存命中率","Cache Hit Rate")),n.createElement("div",{className:"uh-ios-metric-rate-value"},ti.toFixed(1)+"%")),n.createElement("div",{className:"uh-ios-metric-bar"},n.createElement("div",{className:"uh-ios-metric-fill",style:{width:Math.max(0,Math.min(100,ti))+"%"}})),n.createElement("div",{className:"uh-ios-metric-rate-detail"},h(t,"复用上下文 {count} Token","Context reused {count} tokens",{count:R(ar.totals.cacheRead)}))),di=dr.length>0?lr(dr[0]):0,ci=dr.slice(0,2).map(e=>{const a=lr(e),r=wr.get(e.workspaceId),i=Ke(void 0===r?0:r),o=We===e.workspaceId;return n.createElement("div",{key:e.workspaceId,className:"uh-wsbar"+(o?" uh-sel":""),onClick:()=>jn(e.workspaceId)},n.createElement("div",{className:"uh-wsbar-top"},n.createElement("span",{className:"uh-dot",style:{background:i}}),n.createElement("span",{className:"uh-wsbar-title"},xr(e.workspaceId)),n.createElement("span",{className:"uh-wsbar-num"},Q(R(a),a,t))),n.createElement("div",{className:"uh-barwrap uh-bar-thin"},n.createElement("div",{className:"uh-barfill",style:{width:di>0?Math.max(2,a/di*100)+"%":"0%",background:i}})))}),ui=n.createElement("div",{className:"uh-card",style:{animationDelay:"210ms"}},n.createElement("div",{className:"uh-card-label"},n.createElement(H,{name:"folder",size:14}),r("各工作区总处理量","Total Tokens Processed by Workspace")),0===dr.length?n.createElement("div",{className:"uh-empty",style:{padding:"8px 0"}},r("暂无数据","No data yet")):n.createElement("div",{className:"uh-wsbars"},ci,dr.length>2?n.createElement("div",{className:"uh-card-sub"},h(t,"其余 {count} 个工作区见明细表","See the details table for the other {count} workspaces",{count:dr.length-2})):null)),pi=dr.map(e=>{const a=vr.get(e.workspaceId),i="string"==typeof pr[e.workspaceId]?pr[e.workspaceId]:"",o=a?a.title:r("未知工作区","Unknown workspace"),s=a?a.path:"",l=""!==i?i:o,d=""!==i?o+" · "+s:s,c=lr(e),u=L(e.input,e.cacheRead),p=wr.get(e.workspaceId),h=Ke(void 0===p?0:p),m=We===e.workspaceId;return n.createElement("div",{key:e.workspaceId,className:"uh-row"+(m?" uh-sel":""),onClick:()=>jn(e.workspaceId)},n.createElement("div",{className:"uh-row-title-wrap"},n.createElement("div",{className:"uh-ws-title"},l),n.createElement("div",{className:"uh-ws-path"},d)),n.createElement("div",{className:"uh-num"},R(e.turns)),n.createElement("div",{className:"uh-num"},R(e.input)),n.createElement("div",{className:"uh-num"},R(e.cacheRead)),n.createElement("div",{className:"uh-num"},R(e.output)),n.createElement("div",{className:"uh-num"},R(e.reasoning)),n.createElement("div",{},n.createElement("div",{className:"uh-num"},R(c)),n.createElement("div",{className:"uh-barwrap"},n.createElement("div",{className:"uh-barfill",style:{width:di>0?Math.max(2,c/di*100)+"%":"0%",background:h}}))),n.createElement("div",{className:"uh-num uh-cost-num"},oe(e,t)),n.createElement("div",{className:"uh-num"},u.toFixed(1)+"%"),n.createElement("div",{className:"uh-num"},di>0?(c/di*100).toFixed(0)+"%":"0%"))}),hi="route"===je?r("混合查看","Combined View"):"model"===je?r("按模型合并","Grouped by Model"):r("按供应商汇总","Grouped by Provider"),mi="route"===je?r("供应商 / 模型","Provider / Model"):"model"===je?r("模型","Model"):r("供应商","Provider"),gi="model"!==ua||0===cr.length?null:n.createElement(va,{key:"model-donut-"+ua+":"+Sn+":"+(Nn||"query")+":"+je,title:"provider"===je?r("供应商用量","Provider Usage"):r("模型用量","Model Usage"),icon:"chart",language:t,items:Pr}),fi="workspace"!==ua||0===dr.length?null:n.createElement(va,{key:"workspace-donut-"+ua+":"+Sn+":"+(Nn||"query"),title:r("工作区用量","Workspace Usage"),icon:"folder",language:t,items:Rr}),bi="model"===ua?cr.map(e=>{const a=lr(e),r=L(e.input,e.cacheRead);return n.createElement("div",{key:e.identityKey||e.model,className:"uh-model-row uh-row"},n.createElement("div",{className:"uh-row-title-wrap"},n.createElement("div",{className:"uh-ws-title uh-model-label",title:e.model},n.createElement(Na,{iconKey:e.iconKey,row:e,size:18,showTitle:!0}),n.createElement("span",{className:"uh-model-text"},e.model))),n.createElement("div",{className:"uh-num"},R(e.calls)),n.createElement("div",{className:"uh-num"},R(e.input)),n.createElement("div",{className:"uh-num"},R(e.cacheRead)),n.createElement("div",{className:"uh-num"},R(e.output)),n.createElement("div",{className:"uh-num"},R(e.reasoning)),n.createElement("div",{className:"uh-num"},R(a)),n.createElement("div",{className:"uh-num uh-cost-num"},oe(e,t)),n.createElement("div",{className:"uh-num"},r.toFixed(1)+"%"))}):[],yi=Xa?n.createElement("div",{className:"uh-panel uh-anim-panel"},n.createElement("div",{className:"uh-alias-panel-head"},n.createElement("span",{},r("工作区别名","Workspace Aliases")),n.createElement("button",{className:"uh-alias-close",onClick:()=>et(!1)},r("关闭","Close"))),0===ur.length?n.createElement("div",{className:"uh-empty",style:{padding:"10px 0"}},r("暂无工作区","No workspaces yet")):n.createElement("div",{className:"uh-alias-list"},ur.map((e,a)=>n.createElement("div",{key:e.id,className:"uh-alias-item"},n.createElement("span",{className:"uh-dot",style:{background:Ke(a)}}),n.createElement("span",{className:"uh-alias-folder",title:e.path||e.id},(!0===e.retiredBucket?r("已删除","Deleted"):e.title||e.path||e.id)+(!0===e.deleted&&!0!==e.retiredBucket?r("(已删除)"," (deleted)"):"")),n.createElement("input",{className:"uh-alias-input",value:void 0!==at[e.id]?at[e.id]:"",placeholder:r("项目别名","Project alias"),onChange:a=>tt(t=>Object.assign({},t,{[e.id]:a.target.value})),onKeyDown:a=>{"Enter"===a.key&&Wr(e.id,a.target.value)}})))),n.createElement("div",{className:"uh-alias-panel-foot"},n.createElement("span",{className:"uh-note"},r("回车保存单个;清空别名还原文件夹名","Press Enter to save one; clear an alias to restore the folder name")),n.createElement("button",{className:"uh-alias-ok",onClick:()=>{for(const e of Object.keys(at)){const a="string"==typeof pr[e]?pr[e]:"";at[e]!==a&&Wr(e,at[e])}et(!1)}},r("全部保存","Save All")))):null,vi=Mr.sync&&"object"==typeof Mr.sync?Mr.sync:{},wi=Tt||Nt||At,xi=He(t,"zh"===t),ki=Ar.filter(e=>!1===e.usageBacked).length,Ei=Ar.filter(e=>null===e.usageBacked).length,Ci="string"==typeof Lr.pluginVersion?Lr.pluginVersion:"",Ti=""!==Ci&&Ci!==m,Si=!Array.isArray(Mr.usedModels),Ni=e=>{if(!0===e.temporalConfigInvalid)return r("时段异常","Peak invalid");if(!0===e.temporalRulesUnavailable)return r("峰谷计划 ","peak plan ")+e.temporalPolicyId;const a=!0===e.temporalExplicit?e.temporalRuleCount>0?r("自定义 ","custom ")+e.temporalRuleCount+r(" 条规则"," rules"):r("自定义规则","custom rules"):!0===e.temporalBuiltin?r("内置 DeepSeek 峰谷表","built-in DeepSeek peak table"):null;return null===a?r("未启用","not enabled"):"official"!==e.temporalRoute&&"mapped"!==e.temporalRoute?a+r("(该行非官方直连,暂按静态价;映射到官方条目后生效)"," (reseller route: static pricing until this row is mapped to the official entry)"):a},Mi=(e,a)=>n.createElement("td",{className:"uh-pricing-rate-cell"},((e,a)=>n.createElement("input",{type:"number",min:"0",step:"any",className:"uh-pricing-rate-input","aria-label":be(a,t)+" · "+(e.model||e.pricingModel||""),title:r("价格单位为 USD / 1M Token","Price per 1M tokens in USD"),value:null!==e.rates&&void 0!==e.rates[a]?e.rates[a]:"",disabled:wi,onChange:t=>((e,a,t)=>{kt(n=>null===n?n:function(e,a,t,n){const r={};return r[t]=n,ke(e,a,r)}(n,e,a,t)),Ut("")})(e,a,t.target.value)}))(e,a)),Ai=e=>{const a=void 0!==Bt[e.key]?Bt[e.key]:De(e.temporalPlan,Te(t)),i=null==a?"":Le(a),o=n.createElement("div",{className:"uh-pricing-tier-editor-head"},n.createElement("div",{className:"uh-pricing-tier-editor-title"},n.createElement("strong",{},r("分时段计费(北京时间 UTC+8)","Time-of-day pricing (UTC)")),n.createElement("span",{},!0===e.temporalExplicit?r("自定义规则","Custom rules"):!0===e.temporalRulesUnavailable?r("峰谷计划 ","Peak plan ")+e.temporalPolicyId:!0===e.temporalBuiltin?r("当前使用内置 DeepSeek 峰谷表","Using the built-in DeepSeek peak table"):r("未启用时段规则","No time-of-day rules"))),n.createElement("div",{className:"uh-actions"},!0===e.temporalBuiltin&&!0!==e.temporalExplicit?n.createElement("button",{type:"button",className:"uh-refresh",disabled:wi,onClick:()=>_r(e)},!0===e.temporalRulesUnavailable?r("改为自定义规则","Replace with custom rules"):r("复制内置表并自定义","Copy built-in table")):null,!0===e.temporalExplicit?n.createElement("button",{type:"button",className:"uh-refresh",disabled:wi,onClick:()=>(e=>{Yt(a=>{const t=Object.assign({},a);return delete t[e.key],t}),e.overrideIndex<0||(kt(a=>null===a?a:ke(a,e,{temporalPricing:void 0,temporalPricingInvalid:void 0})),Ut(""))})(e)},!0===e.temporalBuiltin?r("恢复内置","Restore built-in"):r("清除时段规则","Remove rules")):null,!0!==e.temporalBuiltin&&!0!==e.temporalExplicit?n.createElement("button",{type:"button",className:"uh-refresh",disabled:wi,onClick:()=>_r(e)},n.createElement(H,{name:"plus",size:13}),r("启用分时计费","Enable time-of-day pricing")):null));if(null==a)return n.createElement("div",{className:"uh-pricing-tier-editor uh-pricing-temporal-editor"},o,n.createElement("div",{className:"uh-pricing-tier-empty"},!0===e.temporalRulesUnavailable?r("该行已启用峰谷计划(","This row already uses a peak plan (")+e.temporalPolicyId+r("),但运行中的宿主尚未提供规则内容;重启 DSH 后即可查看与编辑。","), but the running host does not expose its rules yet; restart DSH to view and edit them."):r("未启用时段规则:所有请求都使用该行基础价。","No time-of-day rules: every request uses the row base rates.")));const s=Ne(a.effectiveFromText,Te(t)),l=!0===a.holidaysEnabled?Ae(a.holidaysText):null,d=a.rules.map((i,o)=>{const s=i.windows.map((t,s)=>n.createElement("div",{key:s,className:"uh-pricing-temporal-window"},n.createElement("input",{type:"text",className:"uh-pricing-time-input",placeholder:"HH:MM","aria-label":r("开始时间","Start time"),value:t.start,disabled:wi,onChange:t=>Jr(e,Re(a,o,i.windows.map((e,a)=>a===s?{start:t.target.value,end:e.end}:e)))}),n.createElement("span",{className:"uh-pricing-time-sep"},"–"),n.createElement("input",{type:"text",className:"uh-pricing-time-input",placeholder:"HH:MM","aria-label":r("结束时间","End time"),value:t.end,disabled:wi,onChange:t=>Jr(e,Re(a,o,i.windows.map((e,a)=>a===s?{start:e.start,end:t.target.value}:e)))}),i.windows.length>1?n.createElement("button",{type:"button",className:"uh-refresh uh-icon-button",title:r("删除时段","Remove window"),"aria-label":r("删除时段","Remove window"),disabled:wi,onClick:()=>Jr(e,Re(a,o,i.windows.filter((e,a)=>a!==s)))},n.createElement(H,{name:"close",size:13})):null));return n.createElement("div",{key:i.id+":"+o,className:"uh-pricing-temporal-rule"},n.createElement("div",{className:"uh-pricing-temporal-rule-head"},n.createElement("span",{className:"uh-pricing-temporal-rule-name"},i.id),n.createElement("div",{className:"uh-pricing-weekdays"},xi.map((t,r)=>n.createElement("button",{key:r,type:"button",className:"uh-pricing-weekday"+(i.weekdays.includes(r)?" uh-on":""),"aria-pressed":i.weekdays.includes(r),disabled:wi,onClick:()=>Jr(e,function(e,a,t){const n=Ue(e);if(null===n||void 0===n.rules[a])return n;const r=n.rules[a],i=Number(t);return r.weekdays=(r.weekdays.includes(i)?r.weekdays.filter(e=>e!==i):r.weekdays.concat([i])).sort((e,a)=>e-a),n}(a,o,r))},t))),n.createElement("button",{type:"button",className:"uh-refresh uh-icon-button",disabled:wi||a.rules.length<=1,title:r("删除规则","Remove rule"),"aria-label":r("删除规则","Remove rule"),onClick:()=>Jr(e,function(e,a){const t=Ue(e);return null===t||t.rules.length<=1||(t.rules=t.rules.filter((e,t)=>t!==a)),t}(a,o))},n.createElement(H,{name:"close",size:14}))),n.createElement("div",{className:"uh-pricing-temporal-windows"},s,i.windows.length<16?n.createElement("button",{type:"button",className:"uh-pricing-link",disabled:wi,onClick:()=>Jr(e,Re(a,o,i.windows.concat([{start:"06:00",end:"10:00"}])))},r("添加时段","Add window")):null),n.createElement("div",{className:"uh-pricing-temporal-rates"},["input","output","cacheRead","cacheWrite"].map(s=>n.createElement("label",{key:s,className:"uh-pricing-temporal-rate"},n.createElement("span",{},r("峰时·","Peak ·")+be(s,t).split(" / ")[0]),n.createElement("input",{type:"number",min:"0",step:"any",value:i.rates[s],disabled:wi,onChange:t=>Jr(e,function(e,a,t){return Pe(e,a,{rates:t})}(a,o,Object.assign({},i.rates,{[s]:t.target.value})))})))))});return n.createElement("div",{className:"uh-pricing-tier-editor uh-pricing-temporal-editor"},o,n.createElement("div",{className:"uh-pricing-tier-empty"},r("谷时段(未命中规则)使用该行基础价,峰时段使用规则费率;周几与时间均为 UTC。","Off-peak (no rule match) uses the row base rates, peak uses the rule rates. Weekdays and times are UTC.")),n.createElement("div",{className:"uh-pricing-temporal-fields"},n.createElement("label",{},n.createElement("span",{},r("策略 ID","Policy ID")),n.createElement("input",{type:"text",value:a.policyId,disabled:wi,onChange:t=>Jr(e,Object.assign(Ue(a),{policyId:t.target.value}))})),n.createElement("label",{},n.createElement("span",{},r("生效起点(北京时间,留空 = 全部历史)","Effective from (UTC, empty = all history)")),n.createElement("input",{type:"date",value:a.effectiveFromText,disabled:wi,onChange:t=>Jr(e,Object.assign(Ue(a),{effectiveFromText:t.target.value}))}))),null!==s&&s>0?n.createElement("div",{className:"uh-pricing-warning"},r("该时刻之前的用量没有可用档位,会失败关闭为未计价。","Usage before this instant has no applicable band and fails closed as unpriced.")):null,n.createElement("div",{className:"uh-pricing-temporal-holidays"},n.createElement("label",{className:"uh-pricing-switch"},n.createElement("input",{type:"checkbox",checked:!0===a.holidaysEnabled,disabled:wi,onChange:t=>Jr(e,Object.assign(Ue(a),{holidaysEnabled:t.target.checked}))}),n.createElement("span",{},r("中国法定节假日全天按谷时计价","Chinese statutory holidays price as off-peak all day"))),!0===a.holidaysEnabled?n.createElement(n.Fragment,null,n.createElement("div",{className:"uh-pricing-tier-empty"},r("每行一个日期(YYYY-MM-DD),支持区间写法 2026-10-01..2026-10-07。按北京时间(UTC+8)日历日判定;调休上班日不会被自动识别,需要你自己从列表里去掉。","One date per line (YYYY-MM-DD); ranges such as 2026-10-01..2026-10-07 are expanded. Days follow the China Standard Time (UTC+8) calendar; swapped-in working weekends are not detected, so remove them yourself.")),n.createElement("textarea",{className:"uh-pricing-holiday-input",rows:4,spellCheck:!1,disabled:wi,placeholder:"2026-10-01\n2026-10-02","aria-label":r("法定节假日日期","Statutory holiday dates"),value:a.holidaysText,onChange:t=>Jr(e,Object.assign(Ue(a),{holidaysText:t.target.value}))}),null===l?n.createElement("span",{className:"uh-pricing-error"},r("日期格式无效:请使用 YYYY-MM-DD,或 start..end 区间","Invalid dates: use YYYY-MM-DD, or a start..end range")):n.createElement("span",{className:"uh-pricing-tier-empty"},r("已解析 ","parsed ")+l.length+r(" 天节假日"," holiday days")),n.createElement("div",{className:"uh-pricing-holiday-load"},n.createElement("label",{className:"uh-pricing-map-field"},n.createElement("span",{},r("年份","Year")),n.createElement("input",{type:"number",min:"2000",max:"2100",step:"1",value:Kt,disabled:wi||Gt,"aria-label":r("要载入的年份","Year to load"),onChange:e=>Vt(Number(e.target.value))})),n.createElement("button",{type:"button",className:"uh-refresh",disabled:wi||Gt,onClick:()=>(e=>{if(!0===Gt)return;if(""===En.current)return void _t(r("当前进程令牌不可用,请刷新看板","The process capability is unavailable; refresh the dashboard"));const a=Number(Kt);!Number.isSafeInteger(a)||a<2e3||a>2100?_t(r("年份无效(2000–2100)","Invalid year (2000-2100)")):(Zt(!0),_t(""),Or(e=>((e,a)=>fetch("/api/all-usage/pricing/holidays",{method:"POST",headers:{"content-type":"application/json","x-all-usage-request-token":a},body:JSON.stringify({year:e,backfill:!1})}).then(e=>e.json().catch(()=>({ok:!1,message:"bad-response"})).then(a=>null!==a&&"object"==typeof a?a:{ok:!1,message:"HTTP "+e.status})))(a,e),a=>{if(null===a||"object"!=typeof a||!0!==a.ok||!Array.isArray(a.dates)){const e=a&&"object"==typeof a&&"string"==typeof a.message&&""!==a.message?a.message:"unavailable";return void _t(r("抓取失败:","Fetch failed: ")+e)}const n=void 0!==Bt[e.key]?Bt[e.key]:De(e.temporalPlan,Te(t))||ze(e.rates,Te(t)),i=function(e,a){const t=Ae(e),n=null===t?[]:t.slice(),r=new Set(n);for(const e of Array.isArray(a)?a:[]){const a=String(e??"").trim();""===a||r.has(a)||(r.add(a),n.push(a))}return n.sort(),0===n.length?"":n.join("\n")}(n.holidaysText,a.dates),o=Number(a.fetchedAt),s="string"==typeof a.paperUrl&&""!==a.paperUrl?a.paperUrl:String(a.sourceUrl||""),l=Number.isFinite(o)&&o>0?new Date(o).toISOString().slice(0,16).replace("T"," "):"",d=Object.assign(Ue(n),{holidaysEnabled:!0,holidaysText:i,holidaysSourceText:(s+(""===l?"":" · "+l)+(!0===a.cached?" · cached":"")).slice(0,512)});_t(r("已载入 ","Loaded ")+a.dates.length+r(" 天"," days")+(!0===a.cached?r("(缓存)"," (cached)"):"")),Jr(e,d)},()=>{_t(r("抓取失败:网络不可用","Fetch failed: network unavailable"))}).finally(()=>Zt(!1)))})(e)},n.createElement(H,{name:"refresh",size:13}),Gt?r("抓取中…","Fetching…"):r("从公开日历载入","Load from public calendar")),""!==Jt?n.createElement("span",{className:"uh-pricing-tier-empty"},Jt):null),""!==a.holidaysSourceText?n.createElement("span",{className:"uh-pricing-tier-empty",title:a.holidaysSourceText},r("来源:","Source: ")+a.holidaysSourceText):null):null),d,n.createElement("div",{className:"uh-pricing-temporal-foot"},a.rules.length<16?n.createElement("button",{type:"button",className:"uh-refresh",disabled:wi,onClick:()=>Jr(e,function(e){const a=Ue(e);if(null===a||a.rules.length>=16)return a;const t=a.rules.length>0?a.rules[a.rules.length-1]:null;return a.rules.push({id:"peak-"+(a.rules.length+1),weekdays:null!==t?t.weekdays.slice(0,1):[1,2,3,4,5],windows:[{start:"06:00",end:"10:00"}],rates:null!==t?Object.assign({},t.rates):{input:"",output:"",cacheRead:"",cacheWrite:""}}),a}(a))},n.createElement(H,{name:"plus",size:13}),r("添加规则","Add rule")):null,""!==i?n.createElement("span",{className:"uh-pricing-error"},r("时段规则尚未完成,保存前需修正。","The rules are incomplete; fix them before saving.")):null))},Di=e=>{const a=null!==Wt&&0===Wt.indexOf(e.key+"|")?Wt.slice(e.key.length+1):"";return n.createElement("div",{className:"uh-pricing-editor"},"tiers"===a?(e=>{const a=e.tiers;let i=0;const o=a.map((o,s)=>{const l=ge(o,i),d=Number(null!=o&&void 0!==o.size?o.size:NaN);return Number.isSafeInteger(d)&&(i=d),n.createElement("div",{key:s,className:"uh-pricing-tier-edit-row"+(l?"":" uh-invalid")},n.createElement("input",{type:"number",min:"1",max:"1000000000",step:"1",placeholder:r("阈值 Token","Token threshold"),title:r("本档覆盖范围:","This band covers ")+he(a,s,t),"aria-label":r("上下文阈值 Token","Context threshold tokens"),value:null==o||void 0===o.size?"":o.size,disabled:wi,onChange:a=>Zr(e,s,"size",a.target.value)}),["input","output","cacheRead","cacheWrite"].map(a=>n.createElement("input",{key:a,type:"number",min:"0",step:"any",placeholder:be(a,t),"aria-label":r("档位","Band")+" "+be(a,t),value:null==o||void 0===o[a]?"":o[a],disabled:wi,onChange:t=>Zr(e,s,a,t.target.value)})),n.createElement("button",{type:"button",className:"uh-refresh uh-icon-button",title:r("删除费率档位","Remove rate band"),"aria-label":r("删除费率档位","Remove rate band"),disabled:wi,onClick:()=>((e,a)=>{const t=function(e,a){return(Array.isArray(e)?e:[]).filter((e,t)=>t!==a).map(e=>Object.assign({},e))}(e.tiers,a);kt(a=>null===a?a:ke(a,e,{tiered:t.length>0,tiers:t})),Ut("")})(e,s)},n.createElement(H,{name:"close",size:14})))});return n.createElement("div",{className:"uh-pricing-tier-editor"},n.createElement("div",{className:"uh-pricing-tier-editor-head"},n.createElement("div",{className:"uh-pricing-tier-editor-title"},n.createElement("strong",{},r("上下文费率档位","Context rate bands")),n.createElement("span",{},r("输入上下文超过阈值后,整次请求使用该档四项费率","Above a threshold, all four rates apply to the whole request"))),n.createElement("button",{type:"button",className:"uh-refresh",disabled:wi||a.length>=32,title:a.length>=32?r("每个模型最多 32 个档位","Maximum 32 bands per model"):r("添加上下文费率档位","Add context rate band"),onClick:()=>(e=>{const a=function(e,a){const t=Array.isArray(e)?e.map(e=>Object.assign({},e)):[];if(t.length>=32)return t;const n=t.length>0?t[t.length-1]:null,r=null!==n&&Number.isFinite(Number(n.size))?Number(n.size):1e5,i=null!==n?n:null!==a&&"object"==typeof a?a:{};return t.push({type:"context",size:Math.min(1e9,r+1e5),input:fe(i.input),output:fe(i.output),cacheRead:fe(i.cacheRead),cacheWrite:fe(i.cacheWrite)}),t}(e.tiers,e.rates);kt(t=>null===t?t:ke(t,e,{tiered:a.length>0,tiers:a})),Ut("")})(e)},n.createElement(H,{name:"plus",size:13}),r("添加档位","Add band"))),0===a.length?n.createElement("div",{className:"uh-pricing-tier-empty"},r("未配置档位,所有上下文使用基础费率。","No bands configured; base rates apply to every context.")):n.createElement(n.Fragment,null,n.createElement("div",{className:"uh-pricing-tier-edit-head"},n.createElement("span",{},r("超过 Token","Above tokens")),n.createElement("span",{},r("输入 / 1M","Input / 1M")),n.createElement("span",{},r("输出 / 1M","Output / 1M")),n.createElement("span",{},r("缓存读 / 1M","Cache read / 1M")),n.createElement("span",{},r("缓存写 / 1M","Cache write / 1M")),n.createElement("span",{},"")),o))})(e):null,"temporal"===a?Ai(e):null,n.createElement("div",{className:"uh-pricing-editor-foot"},n.createElement("button",{type:"button",className:"uh-pricing-link",onClick:Qr},r("收起","Collapse"))))},zi=e=>It[e.key],Ui=e=>{const a=null!==Wt&&0===Wt.indexOf(e.key+"|")?Wt:null,i=zi(e),o=Array.isArray(Pt[e.key])?Pt[e.key]:[];return n.createElement(n.Fragment,{key:e.key},n.createElement("tr",{className:"uh-pricing-model-row"+(!0===e.usageBacked?"":!1===e.usageBacked?" uh-pricing-configured-row":" uh-pricing-unknown-row")},n.createElement("td",{className:"uh-pricing-model-name"},n.createElement("span",{className:"uh-model-label",title:e.model},n.createElement(Na,{row:e.row,size:16}),n.createElement("span",{className:"uh-model-text"},e.model||r("未知模型","Unknown model"))),n.createElement("div",{className:"uh-pricing-row-flags"},n.createElement("span",{className:"uh-pricing-status uh-pricing-status-"+e.status,title:e.reason||""},ue(e.status,t)),n.createElement("span",{className:"uh-pricing-tier-badge uh-flat"},(e=>!0===e.temporalConfigInvalid?r("时段配置异常","Peak plan invalid"):!0===e.tieredInvalid?r("档位异常","Bands invalid"):"manual"===e.source?r("手工价","Manual"):!0===e.temporalExplicit?r("自定义峰谷","Custom peak"):!0===e.temporalBuiltin?r("内置峰谷","Built-in peak"):"priced"===e.status?r("目录价","Catalog"):ue(e.status,t))(e)),e.mapped?n.createElement("span",{className:"uh-pricing-flag"},r("已映射","Mapped")):null,!0===e.usageBacked?null:!1===e.usageBacked?n.createElement("span",{className:"uh-pricing-flag"},r("账本无用量","No ledger usage")):n.createElement("span",{className:"uh-pricing-flag uh-pricing-flag-unknown",title:r("宿主未在模型清单里标注账本用量(通常是宿主插件版本较旧);这不代表没有用量","The host did not label ledger usage for this row (usually an older host plugin); it does not mean the row has none")},r("用量未知","Usage unknown")))),n.createElement("td",{className:"uh-pricing-map-cell"},n.createElement("div",{className:"uh-pricing-model-search"},n.createElement("input",{type:"text",className:"uh-pricing-model-search-input",placeholder:!0===e.mappable?r("输入官方模型 ID 检索","Type an official model ID"):r("该行不是账本路线","Not a ledger route"),value:void 0!==i?i:e.pricingModel||"",disabled:wi||!0!==e.mappable,"aria-label":r("官方模型 ID","Official model ID"),"aria-autocomplete":"list",onFocus:a=>{if(!0!==e.mappable||!0===wi)return;Ht(e.key);const t=a.target;if(null!=t&&"function"==typeof t.select){try{t.select()}catch(e){}"function"==typeof requestAnimationFrame&&requestAnimationFrame(()=>{try{t.select()}catch(e){}})}},onBlur:()=>setTimeout(()=>{Ht(a=>a===e.key?null:a),Lt(a=>{const t=Object.assign({},a);return delete t[e.key],t})},140),onKeyDown:e=>{"Escape"===e.key&&Ht(null)},onChange:a=>((e,a)=>{const t=e.key,n=Qt.current;Lt(e=>Object.assign({},e,{[t]:a})),Ht(t);const r=Xt.current[t];void 0!==r&&(clearTimeout(r),delete Xt.current[t]);const i=($t.current[t]||0)+1;if($t.current[t]=i,""===String(a||"").trim())return void Rt(e=>Object.assign({},e,{[t]:[]}));const o=setTimeout(()=>{delete Xt.current[t],(e=>{const a=new URLSearchParams({q:String(e||"").slice(0,120),limit:"30"});return fetch("/api/all-usage/pricing/models?"+a.toString(),{headers:{accept:"application/json"}}).then(e=>{if(!e.ok)throw new Error("HTTP "+e.status);return e.json()})})(a).then(e=>{Qt.current===n&&$t.current[t]===i&&Rt(a=>Object.assign({},a,{[t]:Array.isArray(e&&e.items)?e.items:[]}))},()=>{Qt.current===n&&$t.current[t]===i&&Rt(e=>Object.assign({},e,{[t]:[]}))})},180);Xt.current[t]=o})(e,a.target.value)}),jt===e.key&&o.length>0?n.createElement("div",{className:"uh-language-options uh-pricing-model-options",role:"listbox","aria-label":r("官方模型匹配结果","Official model matches")},o.map(a=>n.createElement("button",{key:a.value,type:"button",role:"option",className:"uh-language-option uh-pricing-model-option",onMouseDown:e=>e.preventDefault(),onClick:()=>((e,a)=>{if(!a||"string"!=typeof a.value)return;const t=Xt.current[e.key];void 0!==t&&(clearTimeout(t),delete Xt.current[e.key]),$t.current[e.key]=($t.current[e.key]||0)+1,kt(t=>null===t?t:function(e,a,t){const n=null!==e&&"object"==typeof e?e:{sync:{},mappings:[],overrides:[]};if(!0!==a.mappable||null==t||"string"!=typeof t.value)return n;const r=Array.isArray(n.mappings)?n.mappings.map(e=>Object.assign({},e)):[],i=we(r,a.identityKey),o={identityKey:a.identityKey,provider:null!==a.row&&"object"==typeof a.row&&"string"==typeof a.row.provider?a.row.provider:"",model:null!==a.row&&"object"==typeof a.row&&(a.row.actualModel||a.row.requestedModel)||"",catalogProviderId:"string"==typeof t.providerId?t.providerId:"",catalogModelId:t.value};return i<0?r.push(Object.assign({inputTokenSemantics:"fresh",multiplier:"1"},o)):r[i]=Object.assign({},r[i],o),Object.assign({},n,{mappings:r})}(t,e,a)),Ot(t=>Object.assign({},t,{[e.key]:a})),Lt(t=>Object.assign({},t,{[e.key]:a.label||a.value})),Ht(null),Ut("")})(e,a)},n.createElement(H,{name:"list",size:14}),n.createElement("span",{className:"uh-pricing-model-option-name"},a.label||a.value),n.createElement("span",{className:"uh-pricing-model-option-id"},a.value+(!0===a.tiered?" · "+r("分层 ","tiered ")+a.tierCount:"")+(!0===a.builtinTemporal?" · "+r("峰谷","peak"):""))))):null,e.mapped?n.createElement("button",{type:"button",className:"uh-pricing-link uh-pricing-clear-mapping",disabled:wi,title:r("删除该行的官方模型映射,回到按模型自动匹配","Remove this row mapping and fall back to automatic model matching"),onClick:()=>(e=>{kt(a=>null===a?a:function(e,a){if(null===e||"object"!=typeof e)return e;const t=we(e.mappings,a);if(t<0)return e;const n=e.mappings.slice();return n.splice(t,1),Object.assign({},e,{mappings:n})}(a,e.identityKey)),Ot(a=>{const t=Object.assign({},a);return delete t[e.key],t}),Lt(a=>{const t=Object.assign({},a);return delete t[e.key],t}),Ut("")})(e)},r("清除映射","Clear mapping")):null),n.createElement("div",{className:"uh-pricing-map-sub"},n.createElement("label",{className:"uh-pricing-map-field"},n.createElement("span",{},r("倍率","Multiplier")),n.createElement("input",{type:"number",min:"0",step:"any",value:e.multiplier,disabled:wi||!0!==e.mapped,title:!0===e.mapped?r("成本倍率,只作用于最终总价","Cost multiplier; applied to the final total only"):r("设置映射后生效","Effective after a mapping is set"),"aria-label":r("成本倍率","Cost multiplier"),onChange:a=>Gr(e,"multiplier",a.target.value)})),n.createElement("label",{className:"uh-pricing-map-field"},n.createElement("span",{},r("输入口径","Input semantics")),n.createElement("select",{value:e.inputTokenSemantics,disabled:wi||!0!==e.mapped,"aria-label":r("输入口径","Input semantics"),title:pe(e.inputTokenSemantics,t),onChange:a=>Gr(e,"inputTokenSemantics",a.target.value)},n.createElement("option",{value:"fresh"},"Fresh"),n.createElement("option",{value:"total"},"Total"),n.createElement("option",{value:"legacy"},"Legacy"))))),Mi(e,"input"),Mi(e,"output"),Mi(e,"cacheRead"),Mi(e,"cacheWrite"),n.createElement("td",{className:"uh-pricing-row-actions"},n.createElement("button",{type:"button",className:"uh-pricing-chip"+(null!==a&&"tiers"===a.slice(e.key.length+1)?" uh-on":"")+(e.tierCount>0?" uh-strong":""),disabled:wi,title:e.tierCount>0?r("上下文分层:已配置 ","Context tiers: ")+e.tierCount+r(" 个档位"," bands"):r("上下文分层:未配置,所有上下文使用基础费率","Context tiers: none, base rates apply to every context"),onClick:()=>$r(e,"tiers")},r("上下文分层","Context tiers")),n.createElement("button",{type:"button",className:"uh-pricing-chip"+(null!==a&&"temporal"===a.slice(e.key.length+1)?" uh-on":"")+(!0===e.temporalBuiltin||!0===e.temporalExplicit?" uh-strong":""),disabled:wi,title:r("时间分层:","Time tiers: ")+Ni(e),onClick:()=>$r(e,"temporal")},r("时间分层","Time tiers")),"manual"===e.source?n.createElement("button",{type:"button",className:"uh-pricing-link",disabled:wi,title:r("删除手工价,回落到目录价或内置峰谷","Remove the manual price and fall back to the catalog or the built-in peak table"),onClick:()=>(e=>{kt(a=>null===a?a:function(e,a){if(null===e||"object"!=typeof e)return e;const t=ve(e.overrides,a);if(t<0)return e;const n=e.overrides.slice();return n.splice(t,1),Object.assign({},e,{overrides:n})}(a,e.basis)),Yt(a=>{const t=Object.assign({},a);return delete t[e.key],t}),Ut("")})(e)},r("恢复默认","Reset")):null)),null===a?null:n.createElement("tr",{className:"uh-pricing-editor-row"},n.createElement("td",{colSpan:7},Di(e))))},Pi=nt?n.createElement(Ta,{revision:Ur,render:()=>{return null!==xt?n.createElement("div",{className:"uh-panel uh-pricing-panel uh-anim-panel"},n.createElement("div",{className:"uh-pricing-head"},n.createElement("div",{className:"uh-title-with-icon"},n.createElement(H,{name:"wallet",size:16}),n.createElement("strong",{},r("成本统计设置","Cost Statistics"))),n.createElement("button",{type:"button",className:"uh-refresh uh-icon-button",title:r("关闭成本设置","Close cost settings"),"aria-label":r("关闭成本设置","Close cost settings"),disabled:wi,onClick:Br},n.createElement(H,{name:"close",size:16}))),n.createElement("div",{className:"uh-pricing-note"},r("价格单位为 USD / 1M Token。直接改价格框即创建或更新手工价(同一官方模型的所有行共享同一价格);「官方模型」列选定映射后该行自动改用官方目录价;「档位」配置上下文费率档,「分时计费」配置 UTC 峰谷规则。","Prices are USD per 1M tokens. Editing a price box creates or updates a manual price (every row priced from the same official model shares it). Picking an official model in the mapping column switches the row to the catalog price. Bands add context-dependent rates; Time-of-day adds UTC peak rules.")),n.createElement("div",{className:"uh-pricing-toolbar"},n.createElement("label",{className:"uh-pricing-switch"},n.createElement("input",{type:"checkbox",checked:!0===xt.sync.autoEnabled,disabled:wi,onChange:e=>(e=>{if(null===xt||At||Tt||Nt)return;const a=!0===e,t=xt.sync&&!0===xt.sync.autoEnabled;if(kt(e=>null===e?e:Object.assign({},e,{sync:Object.assign({},e.sync,{autoEnabled:a})})),Ja({pricingAutoSync:a}),""===En.current)return kt(e=>null===e?e:Object.assign({},e,{sync:Object.assign({},e.sync,{autoEnabled:t})})),Ja({pricingAutoSync:t}),void Ut("token");const n=e=>{kt(e=>null===e?e:Object.assign({},e,{sync:Object.assign({},e.sync,{autoEnabled:t})})),Ja({pricingAutoSync:t}),Ut(e)};Dt(!0),Ut(""),Or(e=>Ia({sync:{autoEnabled:a}},!1,e),e=>{if(!e||!0!==e.ok||!e.pricing)return void n("save");const a=e.pricing.sync&&!0===e.pricing.sync.autoEnabled;y(a=>null===a?a:Object.assign({},a,{pricing:e.pricing})),wt(e.pricing),kt(t=>null===t?t:Object.assign({},t,{sync:Object.assign({},t.sync,{autoEnabled:a,intervalMs:e.pricing.sync&&e.pricing.sync.intervalMs})})),Ja({pricingAutoSync:a})},e=>n(e&&403===e.status?"stale":"save")).finally(()=>Dt(!1))})(e.target.checked)}),n.createElement("span",{},r("启用 6 小时自动同步","Enable 6-hour automatic sync"))),n.createElement("span",{className:"uh-note"},At?r("保存中…","Saving…"):vi.lastSuccessAt>0?r("上次成功:","Last success: ")+new Date(vi.lastSuccessAt).toLocaleString(u(t)):r("尚未同步","Not synced yet")),n.createElement("button",{type:"button",className:"uh-refresh",onClick:Vr,disabled:wi},n.createElement(H,{name:"refresh",size:14}),Nt?r("同步中…","Syncing…"):r("立即同步","Sync now"))),vi.lastError?n.createElement("div",{className:"uh-pricing-error",role:"alert"},r("上次同步失败:","Last sync failed: ")+vi.lastError):null,Ti?n.createElement("div",{className:"uh-pricing-error",role:"status"},r("宿主插件 v","Host plugin v")+Ci+r(" 与当前页面 v"," and this page v")+m+r(" 不一致:DSH 只在启动时加载插件,请重启 DSH 让新版本生效(本面板正按旧宿主的数据降级显示)"," differ: DSH imports the plugin only at startup, so restart DSH for the new version (this panel is showing the older host payload)")):null,Si?n.createElement("div",{className:"uh-pricing-error",role:"status"},r("宿主未提供模型清单(插件版本较旧):无法列出账本模型;请重启 DSH 后重新打开本面板","The host sent no model list (older plugin): the ledger models cannot be listed; restart DSH and reopen this panel")):null,n.createElement("div",{className:"uh-pricing-table-note"},h(t,"共 {count} 个模型","{count} models",{count:Ar.length})+(ki>0?h(t,"({count} 项仅存在于配置中,账本暂无用量)"," ({count} configured rows have no ledger usage)",{count:ki}):"")+(Ei>0?h(t,"(其中 {count} 项用量未知:宿主未标注账本用量)"," ({count} rows have unknown usage: the host did not label ledger usage)",{count:Ei}):"")+(Ar.length>=500?p(t," · 已达 500 行上限"," · capped at 500 rows"):"")),n.createElement("div",{className:"uh-pricing-table-wrap"},n.createElement("table",{className:"uh-pricing-model-table uh-pricing-price-table"},n.createElement("thead",{},n.createElement("tr",{},n.createElement("th",{scope:"col"},r("模型","Model")),n.createElement("th",{scope:"col"},r("官方模型 / 映射","Official model / mapping")),n.createElement("th",{scope:"col"},r("输入 / 1M","Input / 1M")),n.createElement("th",{scope:"col"},r("输出 / 1M","Output / 1M")),n.createElement("th",{scope:"col"},r("缓存读 / 1M","Cache read / 1M")),n.createElement("th",{scope:"col"},r("缓存写 / 1M","Cache write / 1M")),n.createElement("th",{scope:"col"},r("操作","Actions")))),n.createElement("tbody",{},0===Ar.length?n.createElement("tr",{},n.createElement("td",{colSpan:7},n.createElement("div",{className:"uh-empty",style:{padding:"12px 0"}},r("暂无模型用量","No model usage yet")))):Ar.map(e=>n.createElement(Sa,{key:e.key,view:e,busy:wi,language:t,openSection:null!==Wt&&0===Wt.indexOf(e.key+"|")?Wt:null,searchText:void 0===zi(e)?null:zi(e),searchOpen:jt===e.key,searchOptions:Array.isArray(Pt[e.key])?Pt[e.key]:null,temporalDraft:void 0===Bt[e.key]?null:Bt[e.key],temporalPlan:e.temporalPlan,holidayStatus:Jt,holidayLoading:Gt,render:Ui}))))),""!==zt?n.createElement("div",{className:"uh-pricing-error",role:"alert"},"stale"===(e=zt)?r("写入被拒绝:进程令牌已失效,自动重取令牌后仍失败,请刷新看板","Write rejected: the process capability had rotated and the automatic retry still failed; refresh the dashboard"):"forbidden"===e?r("写入被拒绝:权限校验未通过(也可能是进程令牌已失效),请刷新看板后重试","Write rejected: the permission check failed (a stale process capability is also possible); refresh the dashboard and retry"):"token"===e?r("当前进程令牌不可用,请刷新看板","The process capability is unavailable; refresh the dashboard"):"load"===e?r("完整费率设置加载失败","Full pricing settings could not be loaded"):"sync"===e?r("models.dev 同步失败,已保留上次成功目录和未保存编辑","models.dev sync failed; the last good catalog and unsaved edits were kept"):"mapping"===e?r("模型映射无效:请选择官方模型并填写有效倍率","Invalid mapping: pick an official model and enter a valid multiplier"):"tier"===e?r("费率档位无效:最多 32 档;阈值必须为递增的正整数,四项费率必须完整且非负","Invalid rate bands: maximum 32; thresholds must be increasing positive integers and all four rates must be complete and non-negative"):"temporal"===e?r("分时计费无效:需要策略 ID,每规则至少一个周几与一个时段,时间格式 HH:MM 且结束大于开始,同周几的时段不得重叠,四项费率必须完整","Invalid time-of-day rules: a policy ID, at least one weekday and window per rule, HH:MM times with the end after the start, no overlapping windows on the same weekday, and all four rates filled in"):"override"===e?r("价格无效:请填写完整的非负基础费率","Invalid price: enter all non-negative base rates"):"too-large"===e?r("成本设置过大,无法保存:请精简档位或时段规则","The cost settings are too large to save: trim bands or peak rules"):r("成本设置保存失败,请检查输入","Cost settings could not be saved; check the inputs")):null,n.createElement("div",{className:"uh-pricing-foot"},n.createElement("span",{className:"uh-note"},r("保存只影响未计价调用与之后的调用,已有正成本不会重算;改动时段规则会按新政策重新对账该模型历史。","Saving affects unpriced and future calls only; existing positive costs are never recalculated. Changing a peak plan reconciles that model history against the new rules.")),n.createElement("div",{className:"uh-actions"},n.createElement("button",{type:"button",className:"uh-refresh",disabled:wi,onClick:Br},r("取消","Cancel")),n.createElement("button",{type:"button",className:"uh-refresh",disabled:wi,onClick:()=>Kr(!1)},Tt?r("保存中…","Saving…"):r("保存","Save")),n.createElement("button",{type:"button",className:"uh-refresh uh-pricing-backfill",disabled:wi,onClick:()=>Kr(!0)},r("保存并回填","Save and backfill"))))):n.createElement("div",{className:"uh-panel uh-pricing-panel uh-anim-panel"},n.createElement("div",{className:"uh-pricing-head"},n.createElement("div",{className:"uh-title-with-icon"},n.createElement(H,{name:"wallet",size:16}),n.createElement("strong",{},r("成本统计设置","Cost Statistics"))),n.createElement("button",{type:"button",className:"uh-refresh uh-icon-button",title:r("关闭成本设置","Close cost settings"),"aria-label":r("关闭成本设置","Close cost settings"),disabled:wi,onClick:Br},n.createElement(H,{name:"close",size:16}))),Et?n.createElement("div",{className:"uh-empty",role:"status",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:10}},n.createElement("span",{className:"uh-trend-spinner","aria-hidden":!0}),n.createElement("span",{},r("正在加载完整费率设置…","Loading full pricing settings…"))):n.createElement("div",{className:"uh-empty",role:"alert"},n.createElement("div",{},r("完整费率设置加载失败","Full pricing settings could not be loaded")),n.createElement("button",{type:"button",className:"uh-refresh",style:{marginTop:10},onClick:Yr},n.createElement(H,{name:"refresh",size:14}),r("重试","Retry"))));var e}}):null,Ri=null===dt?null:Fa(dt,t),Ii=null===Ri?0:Ri.records,Li=it?n.createElement("div",{className:"uh-panel uh-archive-panel uh-anim-panel"},n.createElement("div",{className:"uh-archive-head"},n.createElement("div",{className:"uh-title-with-icon"},n.createElement(H,{name:"cache",size:16}),n.createElement("strong",{},r("数据维护","Maintenance"))),n.createElement("button",{type:"button",className:"uh-refresh uh-icon-button",title:r("关闭数据维护","Close maintenance"),"aria-label":r("关闭数据维护","Close maintenance"),disabled:ut,onClick:ei},n.createElement(H,{name:"close",size:16}))),n.createElement("div",{className:"uh-archive-note"},r("把久未更新的会话记录压成按月的压缩包。面板里的总量、明细与筛选都不变,归档后的记录仍然可以查看。","Sessions that have not changed for a while are folded into monthly compressed files. Totals, detail and filters stay the same, and archived records remain readable.")),n.createElement("div",{className:"uh-archive-caution"},r("注意:归档后的记录仍能查看与统计,但一个月的记录第一次被读时要解压整月文件,首次启动变慢,之后常驻内存。","Note: archived records stay readable and countable, but the first read of a month unpacks the whole month file, so the first start is slower; afterwards it stays in memory.")),n.createElement("div",{className:"uh-archive-controls"},n.createElement("label",{className:"uh-archive-days"},n.createElement("span",{},r("归档超过","Archive records older than")),n.createElement("input",{className:"uh-archive-days-input",type:"number",min:1,max:3650,step:1,value:st,disabled:ut,"aria-label":r("天数","Days"),onChange:e=>{return a=e.target.value,lt(a),ct(null),yt(!1),void mt("");var a}}),n.createElement("span",{},r("天未更新的记录","days without updates"))),n.createElement("button",{type:"button",className:"uh-refresh",disabled:ut,onClick:()=>{if(ut)return;const e=La(st);null!==e?""!==En.current?(pt(!0),mt(""),yt(!1),ct(null),ft(null),Or(a=>Wa(e,!0,a),e=>ct(e),e=>mt(Oa(e))).finally(()=>pt(!1))):mt("token"):mt("days")}},n.createElement(H,{name:"refresh",size:14}),ut?r("预览中…","Planning…"):r("预览","Preview"))),null===Ri?null:n.createElement("div",{className:"uh-archive-plan"},n.createElement("span",{className:"uh-archive-plan-text"},Ri.text),Ii>0&&!bt?n.createElement("button",{type:"button",className:"uh-refresh uh-archive-apply",onClick:()=>{ut||bt||Fa(dt,t).records<=0||(mt(""),yt(!0))}},r("开始归档","Start archiving")):null),bt?n.createElement("div",{className:"uh-archive-confirm"},n.createElement("div",{},h(t,"确认归档 {count} 条记录?归档后仍可在面板查看,但这一步无法撤销。","Archive {count} records? They stay readable in the panel, but this cannot be undone.",{count:Ii})),n.createElement("div",{className:"uh-archive-actions"},n.createElement("button",{type:"button",className:"uh-refresh",disabled:ut,onClick:()=>yt(!1)},r("取消","Cancel")),n.createElement("button",{type:"button",className:"uh-refresh uh-archive-apply",disabled:ut,onClick:()=>{if(ut)return;const e=La(st);null!==e?""!==En.current?(pt(!0),mt(""),ft(null),Or(a=>Wa(e,!1,a),e=>{ft(e),ct(null),yt(!1),xn.current()},e=>mt(Oa(e))).finally(()=>pt(!1))):mt("token"):mt("days")}},r("确认归档","Yes, archive")))):null,null===gt?null:n.createElement("div",{className:"uh-archive-result",role:"status"},function(e,a){const t=null!==e&&"object"==typeof e?e:{},n="number"==typeof t.archived&&Number.isFinite(t.archived)?t.archived:0,r=Ha("number"==typeof t.bytes?t.bytes:0),i=Ha("number"==typeof t.compressed?t.compressed:0),o=Array.isArray(t.errors)?t.errors.filter(e=>null!==e&&"object"==typeof e):[],s=h(a,"已归档 {count} 条记录,压缩后 {compressed}(原 {size})","Archived {count} records: {compressed} on disk (was {size})",{count:n,compressed:i,size:r});return 0===o.length?s:s+" · "+h(a,"部分月份归档失败:{list}","Some months could not be archived: {list}",{list:o.map(e=>e.month||e.key||"?").join(p(a,"、",", "))})}(gt,t)),""===ht?null:n.createElement("div",{className:"uh-archive-error",role:"alert"},function(e,a){return"busy"===e?p(a,"另一个 DSH 进程正在维护账本,请稍后再试","Another DSH process is maintaining the ledger; try again in a moment"):"no-root"===e?p(a,"当前存储不支持归档","This storage does not support archiving"):"ledger-unavailable"===e?p(a,"账本尚未就绪,请稍后再试","The ledger is not ready yet; try again in a moment"):"days"===e?p(a,"请输入 1 到 3650 之间的天数","Enter a number of days between 1 and 3650"):"token"===e?p(a,"当前进程令牌不可用,请刷新看板","The process capability is unavailable; refresh the dashboard"):"forbidden"===e?p(a,"写入被拒绝:权限校验未通过(也可能是进程令牌已失效),请刷新看板后重试","Write rejected: the permission check failed (a stale process capability is also possible); refresh the dashboard and retry"):p(a,"归档失败,请重试","Archiving failed; try again.")}(ht,t))):null,ji=function(e,a){const t=null!==a&&"object"==typeof a?a:{},n="string"==typeof t.current&&""!==t.current?t.current:"string"==typeof e?e:"",r="string"==typeof t.latest&&""!==t.latest?t.latest:null,i="outdated"===t.status||"latest"===t.status?t.status:"unknown",o=Number(t.checkedAt);return{current:n,latest:r,status:null===r?"unknown":i,checkedAt:Number.isFinite(o)&&o>0?o:null,sourceUrl:"string"==typeof t.sourceUrl?t.sourceUrl:"",error:"string"==typeof t.error?t.error:""}}(null!==b&&"string"==typeof b.pluginVersion?b.pluginVersion:m,Z),Hi="latest"===ji.status?r("已是最新","Up to date"):"outdated"===ji.status&&null!==ji.latest?r("最新 v","Latest v")+ji.latest:"",Fi=r("当前版本 v","Running version v")+ji.current+("latest"===ji.status?r("\n已是最新版本","\nThis is the newest release"):"")+("outdated"===ji.status&&null!==ji.latest?r("\n最新版本 v","\nNewest release v")+ji.latest:"")+("unknown"===ji.status&&"endpoint"===ee?r("\n宿主尚未提供版本检查(运行中的插件较早):重启 DSH 后可用","\nThe host does not provide the version check yet (an older plugin is running): restart DSH"):"unknown"===ji.status?r("\n尚未确认是否有新版本","\nWhether a newer release exists is not confirmed"):"")+(null!==ji.checkedAt?r("\n检查时间:","\nChecked: ")+new Date(ji.checkedAt).toLocaleString(u(t)):"")+(""!==ji.error?r("\n版本检查失败:","\nVersion check failed: ")+ji.error:"")+r("\n点击打开 GitHub 仓库","\nClick to open the GitHub repository"),Oi=n.createElement("button",{type:"button",className:"uh-version"+("outdated"===ji.status?" uh-version-outdated":""),title:Fi,"aria-label":Fi,onClick:()=>{try{window.open(_e,"_blank","noopener,noreferrer")}catch(e){}}},n.createElement("span",{className:"uh-version-number"},"v"+ji.current),""===Hi?null:n.createElement("span",{className:"uh-version-status"},Hi)),Wi=n.createElement("button",{type:"button",className:"uh-gh",title:r("在 GitHub 上给项目点个星","Star this plugin on GitHub"),"aria-label":r("在 GitHub 上给项目点个星","Star this plugin on GitHub"),onClick:()=>{try{window.open(_e,"_blank","noopener,noreferrer")}catch(e){}}},n.createElement("svg",{className:"uh-gh-star",width:12,height:12,viewBox:"0 0 16 16","aria-hidden":!0},n.createElement("path",{d:"M8 1.1l2.02 4.1 4.52.66-3.27 3.19.77 4.5L8 11.42l-4.04 2.13.77-4.5L1.46 5.86l4.52-.66L8 1.1z"})),n.createElement("svg",{className:"uh-gh-mark",width:14,height:14,viewBox:"0 0 16 16","aria-hidden":!0},n.createElement("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"})),n.createElement("span",{className:"uh-gh-label"},"GitHub")),qi="custom"===q&&null!==Bn?h(t,"{start} 至 {end}","{start} to {end} (UTC)",{start:Bn.start,end:Bn.end}):"today"===q?r("今日","Today"):"7d"===q?r("近 7 天","Last 7 Days"):"30d"===q?r("近 30 天","Last 30 Days"):"90d"===q?r("近 90 天","Last 90 Days"):"month"===q?r("当月","This Month"):r("全部","All Time"),Bi=function(e,a){if("custom"!==e)return e;const t=S(a,false);return null===t?"custom":"custom-"+t.start+"-to-"+t.end}(q,Bn),Yi="invalid"===Yn?r("请选择有效的开始日期和结束日期","Choose valid start and end dates"):"order"===Yn?r("结束日期不能早于开始日期","End date must be on or after the start date"):"bounds"===Yn?h(t,"可选范围为 {from} 至 {to}","Choose a date from {from} to {to}",{from:qn,to:f}):"",Ki=Se?n.createElement("div",{className:"uh-custom-range",role:"group","aria-label":r("自定义时间范围","Custom date range")},n.createElement("div",{className:"uh-custom-range-meta"},n.createElement("div",{className:"uh-custom-range-title"},n.createElement(H,{name:"calendar",size:15}),r("自定义时间范围","Custom date range")),n.createElement("div",{className:"uh-custom-range-note"},h(t,"可查看全部可扫描历史日数据;日期一律按本机时区({zone})。热力图可切换最近 30 天 / 90 天 / 12 个月。","All available historical daily data can be selected. Dates follow this machine's time zone ({zone}). The heatmap switches between the last 30 days, 90 days and 12 months.",{zone:k()}))),n.createElement("div",{className:"uh-custom-range-fields"},n.createElement("label",{className:"uh-custom-range-field"},n.createElement("span",{},r("开始日期","Start date")),n.createElement("input",{type:"date",value:Ee.start,min:qn,max:f,onChange:e=>Ce(a=>Object.assign({},a,{start:e.target.value}))})),n.createElement("label",{className:"uh-custom-range-field"},n.createElement("span",{},r("结束日期","End date")),n.createElement("input",{type:"date",value:Ee.end,min:qn,max:f,onChange:e=>Ce(a=>Object.assign({},a,{end:e.target.value}))}))),n.createElement("div",{className:"uh-custom-range-actions"},n.createElement("button",{type:"button",className:"uh-custom-range-cancel",onClick:()=>Me(!1)},r("取消","Cancel")),n.createElement("button",{type:"button",className:"uh-custom-range-apply",disabled:""!==Yn,onClick:()=>{if(""!==Yn)return;const e=S(Ee,o);null!==e&&(se(e),K("custom"),Me(!1))}},r("应用","Apply"))),""!==Yi?n.createElement("div",{className:"uh-custom-range-error",role:"alert"},Yi):null):null,Vi=n.createElement(xa,{key:zr,rows:Dr,visible:sa,language:t,rangeLabel:qi,loading:ta&&!Gn,error:""===ra||"stale"===ra||Qn?"":r("趋势数据加载失败","Trend data unavailable"),onToggle:Ir,onPointClick:Rn}),Gi=null===Mn?qi:Mn.start===Mn.end?Mn.start:Mn.start+" → "+Mn.end,Zi=n.createElement(Ma,{visible:"logs"===ua,panelRef:ln,scopeLabel:Gi,scopeUtc:!(!Mn||!Mn.utc),scopeAvailable:null!==Mn,loading:Ka,exporting:Ga,error:$a,rows:ya,selectedId:fa,hasMore:ja,language:t,actionKey:An+":"+(Nn||"")+":"+(ka||""),onExport:async()=>{if("logs"!==ua||null===Mn||Ga)return;const e=Nn;_a(!0),Qa("");try{let a=null;const t=[];for(let n=0;n<50;n+=1){const n=await Pa(Mn,a,200);if(null===n||"object"!=typeof n||!Array.isArray(n.items)||null===e||U(n)!==e)throw new Error("audit export stale");if(t.push(...n.items),!n.hasMore||!n.nextCursor)break;a=n.nextCursor}const n=e=>'"'+String(e??"").replace(/"/g,'""')+'"',i=e=>e.map(n).join(","),o=[r("时间","Time"),r("日期","Date"),r("Provider","Provider"),r("请求模型","Requested model"),r("实际模型","Actual model"),r("显示模型","Display model"),"turn","step","seq",r("输入","Input"),r("缓存命中","Cache read"),r("缓存写入","Cache write"),r("输出","Output"),r("推理","Reasoning"),r("成本","Cost"),r("计价状态","Cost status"),r("计价模型","Pricing model"),r("计费档位","Billing band"),r("计费时刻(UTC)","Billing time (UTC)"),r("计费时间来源","Billing time source"),r("计费策略","Billing policy"),r("策略哈希","Policy hash"),r("来源","Source")],s=[i([r("DSH 用量明细导出","DSH Usage Audit Export")]),i([r("范围","Scope"),Mn.start+" → "+Mn.end]),i([r("时区","Timezone"),Mn.utc?"UTC":r("本地","Local")]),i(o)];for(const e of t)s.push(i([e.time,e.date,e.provider,e.requestedModel,e.actualModel,e.model,e.turn,e.step,e.seq,Ca(e,"input"),Ca(e,"cacheRead"),Ca(e,"cacheWrite"),Ca(e,"output"),Ca(e,"reasoning"),e.cost&&"priced"===e.cost.status?e.cost.total:"",e.cost&&e.cost.status?e.cost.status:"unpriced",e.cost&&e.cost.pricingModel?e.cost.pricingModel:"",e.cost&&e.cost.pricingBand?e.cost.pricingBand:"",e.cost&&Number.isFinite(e.cost.pricingAt)?new Date(e.cost.pricingAt).toISOString():"",e.cost&&e.cost.pricingTimeSource?e.cost.pricingTimeSource:"",e.cost&&e.cost.pricingPolicyId?e.cost.pricingPolicyId:"",e.cost&&e.cost.pricingPolicyHash?e.cost.pricingPolicyHash:"",e.materialization||"unknown"]));const l=new Blob(["\ufeff"+s.join("\r\n")],{type:"text/csv;charset=utf-8"}),d=URL.createObjectURL(l),c=document.createElement("a");c.href=d,c.download="dsh-all-usage-audit-"+Mn.start+"-to-"+Mn.end+".csv",document.body.appendChild(c),c.click(),c.remove(),URL.revokeObjectURL(d)}catch(e){Qa("audit-export")}finally{_a(!1)}},onLoadMore:()=>{if("logs"!==ua||null===Mn||null===ka||Ka)return;const e=vn.next(),a=Nn;Va(!0),Pa(Mn,ka,20).then(t=>{if(vn.isCurrent(e)){if(null===t||"object"!=typeof t||!Array.isArray(t.items)||null===a||U(t)!==a)return Qa("stale"),Va(!1),void Ya(e=>e+1);wa(e=>e.concat(t.items)),Da(t.nextCursor||null),qa(!0===t.hasMore&&t.items.length>0),Va(!1),Qa("")}},a=>{if(vn.isCurrent(e)){if(a&&409===a.status)return Va(!1),Da(null),qa(!1),Qa("stale"),void Ya(e=>e+1);Va(!1),Qa("audit")}})},onSelect:ba}),Ji=!jr.done,_i=jr.total>0?Math.min(100,Math.round(jr.scanned/jr.total*100)):40,$i=jr.done&&0===Fr.length&&0===ar.totals.turns&&0===ar.totals.calls,Qi="number"==typeof Hr.lastCompletedAt&&Hr.lastCompletedAt>0?new Date(Hr.lastCompletedAt).toLocaleString(u(t)):"",Xi=j>0?new Date(j).toLocaleString(u(t)):"",eo=""===Qi?void 0:h(t,"历史扫描完成于 {time}","Historical scan completed {time}",{time:Qi}),ao=""!==Xi?h(t,"已更新 {time}","Updated {time}",{time:Xi}):p(t,Ji?"正在更新数据":"数据更新准备中",Ji?"Refreshing data":"Update state pending"),to=h(t,"{state} · revision 复用 {reused} · 实际读取 {read}{ledger}{failed} · {optimization}","{state} · {reused} revision reused · {read} read{ledger}{failed} · {optimization}",{state:ao,reused:Hr.sessionsSkippedByRevision||0,read:Hr.sessionsRead||0,ledger:(Hr.sessionsRestoredFromLedger||0)>0?h(t," · 账本恢复 {count}"," · {count} ledger restored",{count:Hr.sessionsRestoredFromLedger}):"",failed:(Hr.sessionsFailed||0)>0?h(t," · 失败 {count}"," · {count} failed",{count:Hr.sessionsFailed}):"",optimization:!0===Hr.persistenceSnapshotsAvailable?p(t,"免读优化已启用","revision optimization on"):p(t,"全量读取回退","full-read fallback")}),no=""===D?"":h(t,""===Xi?"用量数据可能已过期":"用量数据可能已过期;上次完整更新 {time}",""===Xi?"Usage data may be stale":"Usage data may be stale; last full update {time}",{time:Xi});return n.createElement("div",{className:"uh-page"},n.createElement("div",{className:"uh-head"},n.createElement("div",{className:"uh-title-wrap"},n.createElement("h2",{className:"uh-title"},r("用量统计","Usage Statistics")),Oi,Wi),n.createElement("div",{className:"uh-actions"},n.createElement("button",{className:"uh-refresh",title:r("管理工作区别名","Manage workspace aliases"),onClick:()=>{Xa?et(!1):(()=>{const e={};ur.forEach(a=>{e[a.id]="string"==typeof pr[a.id]?pr[a.id]:""}),tt(e),et(!0)})()}},n.createElement(H,{name:"edit",size:14}),r("工作区别名","Workspace Aliases")),n.createElement("button",{className:"uh-refresh",title:r("配置模型价格与同步","Configure model prices and sync"),disabled:Tt||Nt||At||ut,onClick:()=>{nt?Br():Yr()}},n.createElement(H,{name:"wallet",size:14}),r("成本设置","Cost Settings")),n.createElement("button",{className:"uh-refresh",title:r("压缩归档旧记录","Archive old records"),disabled:ut||Tt||Nt||At,onClick:()=>{it?ei():Tt||Nt||At||(Br(),et(!1),Xr(),ot(!0))}},n.createElement(H,{name:"cache",size:14}),r("数据维护","Maintenance")),n.createElement("div",{className:"uh-language-menu"+(rn?" uh-open":""),ref:sn,onKeyDown:e=>{"Escape"===e.key&&(e.preventDefault(),on(!1))}},n.createElement("button",{type:"button",className:"uh-language-trigger"+(rn?" uh-open":""),title:r("切换界面语言","Change interface language"),"aria-label":r("界面语言","Interface language"),"aria-haspopup":"menu","aria-expanded":rn,onClick:()=>on(e=>!e)},n.createElement(H,{name:"language",size:14}),n.createElement("span",{className:"uh-language-label"},s.get(t)),n.createElement(H,{name:"chevron",size:13,className:"uh-language-caret"})),rn?n.createElement("div",{className:"uh-language-options",role:"menu","aria-label":r("界面语言","Interface language")},i.map(a=>n.createElement("button",{key:a[0],type:"button",role:"menuitemradio","aria-checked":t===a[0],className:"uh-language-option"+(t===a[0]?" uh-on":""),onClick:()=>((a=>{"function"==typeof e.onLanguageChange&&e.onLanguageChange(c(a)??"zh")})(a[0]),void on(!1))},n.createElement(H,{name:"language",size:14}),n.createElement("span",{},a[1]),t===a[0]?n.createElement(H,{name:"check",size:14,className:"uh-language-option-check"}):null))):null),n.createElement("div",{className:"uh-range"},["today","7d","30d","90d","month","all","custom"].map(e=>n.createElement("button",{key:e,type:"button",className:q===e?"uh-on":"",title:"custom"===e&&"custom"===q?qi:void 0,onClick:()=>{"custom"===e?(()=>{const e=S(te,o),a=v(E(g,-89,o),o);Ce(e||{start:a<qn?qn:a,end:f}),Me(!0)})():(K(e),Me(!1))}},"today"===e?r("今日","Today"):"7d"===e?r("近 7 天","Last 7 Days"):"30d"===e?r("近 30 天","Last 30 Days"):"90d"===e?r("近 90 天","Last 90 Days"):"month"===e?r("当月","This Month"):"all"===e?r("全部","All Time"):r("自定义","Custom")))),n.createElement("button",{className:"uh-refresh",title:r("导出当前时间范围与模型查看模式的 CSV 数据","Export CSV data for the current time range and model view"),onClick:()=>{const e=e=>'"'+String(e??"").replace(/"/g,'""')+'"',a=a=>a.map(e).join(","),n=e=>e.input+e.output+e.cacheRead+e.cacheWrite+e.reasoning,i=[r("输入 Token","Input Tokens"),r("缓存命中 Token","Cache-Hit Tokens"),r("缓存写入 Token","Cache-Write Tokens"),r("输出 Token","Output Tokens"),r("推理 Token","Reasoning Tokens"),r("总处理 Token","Total Tokens Processed"),r("成本","Cost"),r("缓存命中率","Cache Hit Rate")],s=[a([r("DSH 用量统计导出","DSH Usage Statistics Export")]),a([r("导出时间","Exported At"),(new Date).toLocaleString(u(t),{timeZoneName:"short"})]),a([r("时间范围","Time Range"),qi]),a([r("时区","Timezone"),k()]),a([r("工作区筛选","Workspace Filter"),We||r("全部","All")]),a([r("供应商筛选","Provider Filter"),Be||r("全部","All")]),a([r("模型筛选","Model Filter"),null===Ve?r("全部","All"):B(Ve)]),a([r("统计 revision","Stats Revision"),b.revision||""]),a([r("模型查看模式","Model View Mode"),hi]),"",a([r("汇总","Summary")]),a([r("回合","Turns"),r("会话","Sessions"),...i]),a([ar.totals.turns,ar.totals.sessions,ar.totals.input,ar.totals.cacheRead,ar.totals.cacheWrite,ar.totals.output,ar.totals.reasoning,n(ar.totals),oe(ar.totals,t),L(ar.totals.input,ar.totals.cacheRead).toFixed(2)+"%"]),"",a([r("模型用量明细","Model Usage Details")]),a([mi,r("调用","Calls"),...i]),...cr.map(e=>a([e.model,e.calls,e.input,e.cacheRead,e.cacheWrite,e.output,e.reasoning,n(e),oe(e,t),L(e.input,e.cacheRead).toFixed(2)+"%"])),"",a([r("工作区明细","Workspace Details")]),a([r("工作区","Workspace"),r("路径","Path"),r("回合","Turns"),...i]),...dr.map(e=>{const r=vr.get(e.workspaceId);return a([xr(e.workspaceId),r?r.path:"",e.turns,e.input,e.cacheRead,e.cacheWrite,e.output,e.reasoning,n(e),oe(e,t),L(e.input,e.cacheRead).toFixed(2)+"%"])})],l=new Blob(["\ufeff"+s.join("\r\n")],{type:"text/csv;charset=utf-8"}),d=URL.createObjectURL(l),c=document.createElement("a");c.href=d,c.download="dsh-all-usage-"+Bi+"-"+je+"-"+v(new Date,o)+".csv",document.body.appendChild(c),c.click(),c.remove(),URL.revokeObjectURL(d)}},n.createElement(H,{name:"export",size:14}),r("导出数据","Export Data")),n.createElement("button",{className:"uh-refresh uh-icon-button",title:r("刷新统计数据","Refresh usage statistics"),"aria-label":r("刷新统计数据","Refresh usage statistics"),onClick:Ln},n.createElement(H,{name:"refresh",size:16})))),n.createElement("div",{className:"uh-filter-bar",role:"group","aria-label":r("统一筛选","Unified filters")},n.createElement(Aa,{label:r("全部工作区","All workspaces"),ariaLabel:r("工作区筛选","Workspace filter"),className:"uh-filter-workspace",icon:"folder",value:We||"",options:kr,onChange:e=>qe(e||null)}),n.createElement(Aa,{label:r("全部供应商","All providers"),ariaLabel:r("供应商筛选","Provider filter"),className:"uh-filter-provider",icon:"chart",value:Be||"",options:Er,onChange:e=>Fn(e)}),n.createElement(Aa,{label:r("全部模型","All models"),ariaLabel:r("模型筛选","Model filter"),className:"uh-filter-model",icon:"cache",value:Ve||"",options:Cr,onChange:e=>On(e)}),null!==We||null!==Be||null!==Ve?n.createElement("button",{type:"button",className:"uh-filter-clear",onClick:Hn},r("清除筛选","Clear filters")):null,ta?n.createElement("span",{className:"uh-query-note"},r("正在更新筛选结果…","Updating filtered data…")):null,""!==ra&&"stale"!==ra?n.createElement("span",{className:"uh-query-note",role:"alert"},r("筛选结果加载失败","Filtered data unavailable")):null),Xa?yi:null,Pi,Li,Ki,Ji?n.createElement("div",{className:"uh-progress"},n.createElement("span",{},h(t,"正在统计历史会话 {scanned} / {total}{failed}","Scanning historical sessions: {scanned} / {total}{failed}",{scanned:jr.scanned,total:jr.total,failed:jr.failed>0?h(t,"({count} 个读取失败)"," ({count} failed to read)",{count:jr.failed}):""})),n.createElement("div",{className:"uh-bar"},n.createElement("div",{className:"uh-fill",style:{width:_i+"%"}}))):null,n.createElement("div",{className:"uh-sync-health"+(""!==no?" uh-stale":""),title:""!==no?void 0:eo},n.createElement(H,{name:""!==no?"refresh":"clock",size:14}),n.createElement("span",{},""!==no?no:to),""!==no?n.createElement("button",{className:"uh-sync-retry",onClick:Ln},r("重试","Retry")):null),$i?n.createElement("div",{className:"uh-panel"},n.createElement("div",{className:"uh-empty"},r("还没有使用记录。开始对话后,这里会点亮。","No usage recorded yet. This area will light up after you start a conversation."))):n.createElement(n.Fragment,null,n.createElement(n.Fragment,null,n.createElement("div",{className:"uh-ios-summary"},n.createElement("div",{className:"uh-ios-summary-hero"},n.createElement("div",{className:"uh-ios-summary-total"},n.createElement("div",{className:"uh-ios-summary-total-icon"},n.createElement(H,{name:"chart",size:24})),n.createElement("div",{className:"uh-ios-summary-total-copy"},n.createElement("div",{className:"uh-ios-summary-label"},r("总处理 Token","Total Tokens Processed")),n.createElement("div",{className:"uh-ios-summary-value"},Q(R(tr),ai,t)),n.createElement("div",{className:"uh-ios-summary-caption"},h(t,"{range} · {count}{kind} · 含缓存读写与推理","{range} · {count}{kind} · includes cache reads/writes and reasoning",{range:qi,count:R(or),kind:nr?p(t," 次调用"," calls"):p(t," 次使用"," uses")})))),n.createElement("div",{className:"uh-ios-summary-meta"},n.createElement("div",{className:"uh-ios-summary-meta-stat"},n.createElement("div",{className:"uh-ios-summary-meta-label"},n.createElement(H,{name:"chart",size:16}),r("总请求数","Total Requests")),n.createElement("div",{className:"uh-ios-summary-meta-value"},I(sr,t))),n.createElement("div",{className:"uh-ios-summary-meta-stat uh-ios-summary-meta-cost"},n.createElement("div",{className:"uh-ios-summary-meta-label"},n.createElement(H,{name:"wallet",size:16}),r("估算成本","Estimated Cost")),n.createElement("div",{className:"uh-ios-summary-meta-value"},ni),n.createElement("div",{className:"uh-ios-summary-meta-caption"},ri)))),n.createElement("div",{className:"uh-ios-metrics"},si(r("DeepSeek 账户余额","DeepSeek Account Balance"),ii,oi,0,"wallet","deepseek"),si(nr?r("匹配调用次数","Matching Calls"):r("总使用次数","Total Uses"),R(or),"all"!==q||nr?h(t,nr?"{range}内的调用数":"{range}内的回合数",nr?"Calls in {range}":"Turns in {range}",{range:qi}):h(t,"{count} 个会话","{count} sessions",{count:ar.totals.sessions}),1,"chart"),si(r("连续使用","Current Streak"),h(t,"{count} 天","{count} days",{count:Sr.streak}),h(t,"最长连续 {count} 天","Longest streak: {count} days",{count:Sr.best}),2,"clock"),ui,li)),n.createElement("div",{className:"uh-token-semantics"},n.createElement(H,{name:"cache",size:16}),r("总处理 Token = 输入 + 输出 + 缓存读写 + 推理。缓存命中代表复用上下文,不等于新生成 Token 或实际费用。成本按事件发生时刻与官方价目估算,不等同于供应商账单。","Total tokens processed = input + output + cache reads/writes + reasoning. Cache hits represent reused context; they are not newly generated tokens or actual cost. Costs are estimated at event time from official price lists and do not equal the provider invoice.")),Vi,n.createElement(Ea,{rows:er,workspaces:ur,aliases:pr,workspaceId:We,queryUsable:Qn,todayKey:f,utc:o,language:t,span:V,onSpanChange:Kn,onWorkspaceSelect:jn,onDateClick:Rn}),n.createElement("div",{className:"uh-detail-tabs",role:"tablist","aria-label":r("用量明细视图","Usage detail views")},[["logs",r("请求日志","Request Logs"),"list"],["model",r("模型统计","Model Stats"),"chart"],["workspace",r("工作区统计","Workspace Stats"),"folder"]].map(e=>n.createElement("button",{key:e[0],type:"button",role:"tab","aria-selected":ua===e[0],className:"uh-detail-tab"+(ua===e[0]?" uh-on":""),onClick:()=>ha(e[0])},n.createElement(H,{name:e[2],size:14}),e[1]))),Zi),"model"===ua?n.createElement("div",{className:"uh-panel uh-ios-list-panel"},n.createElement("div",{className:"uh-hm-head"},n.createElement("h3",{className:"uh-tbl-title uh-title-with-icon",style:{margin:0}},n.createElement(H,{name:"chart",size:16}),h(t,"模型用量明细({range})","Model Usage Details ({range})",{range:qi})),n.createElement("div",{className:"uh-range"},[["route",r("混合查看","Combined View")],["model",r("按模型","By Model")],["provider",r("按供应商","By Provider")]].map(e=>n.createElement("button",{key:e[0],className:je===e[0]?"uh-on":"",onClick:()=>Fe(e[0])},e[1])))),0===cr.length?n.createElement("div",{className:"uh-empty"},r("尚无带模型路由信息的用量记录","No usage records with model-routing information yet")):n.createElement(n.Fragment,null,gi,n.createElement("div",{className:"uh-tbl-scroll"},n.createElement("div",{className:"uh-model-hrow uh-hrow"},n.createElement("div",{},mi),n.createElement("div",{className:"uh-num"},r("调用","Calls")),n.createElement("div",{className:"uh-num"},r("输入","Input")),n.createElement("div",{className:"uh-num"},r("缓存命中","Cache Hits")),n.createElement("div",{className:"uh-num"},r("输出","Output")),n.createElement("div",{className:"uh-num"},r("推理","Reasoning")),n.createElement("div",{className:"uh-num"},r("总处理","Total Processed")),n.createElement("div",{className:"uh-num"},r("成本","Cost")),n.createElement("div",{className:"uh-num"},r("命中率","Hit Rate"))),bi)),n.createElement("div",{className:"uh-note",style:{marginTop:10}},h(t,"{label}:混合查看按“供应商 / 模型”区分;按模型会跨供应商合并同名模型;按供应商则汇总其全部模型。缺少路由信息的历史记录会归为“未知”。","{label}: Combined View distinguishes “Provider / Model”; By Model merges identically named models across providers; By Provider aggregates all of a provider’s models. Historical records without routing information are grouped as “Unknown.”",{label:hi}))):null,"workspace"===ua?n.createElement("div",{className:"uh-panel uh-ios-list-panel"},n.createElement("h3",{className:"uh-tbl-title uh-title-with-icon"},n.createElement(H,{name:"folder",size:16}),h(t,"工作区明细({range})","Workspace Details ({range})",{range:qi})),0===dr.length?n.createElement("div",{className:"uh-empty"},r("该时间范围内没有使用记录","No usage records in this time range")):n.createElement(n.Fragment,null,fi,n.createElement("div",{className:"uh-tbl-scroll"},n.createElement("div",{className:"uh-hrow"},n.createElement("div",{},r("工作区","Workspace")),n.createElement("div",{className:"uh-num"},r("回合","Turns")),n.createElement("div",{className:"uh-num"},r("输入","Input")),n.createElement("div",{className:"uh-num"},r("缓存命中","Cache Hits")),n.createElement("div",{className:"uh-num"},r("输出","Output")),n.createElement("div",{className:"uh-num"},r("推理","Reasoning")),n.createElement("div",{className:"uh-num"},r("总处理","Total Processed")),n.createElement("div",{className:"uh-num"},r("成本","Cost")),n.createElement("div",{className:"uh-num"},r("命中率","Hit Rate")),n.createElement("div",{className:"uh-num"},r("占比","Share"))),pi))):null))}class $a extends n.Component{constructor(e){super(e),this.state={error:null,resetKey:e.resetKey}}static getDerivedStateFromError(e){return{error:e}}componentDidUpdate(e){e.resetKey!==this.props.resetKey&&null!==this.state.error&&this.setState({error:null,resetKey:this.props.resetKey})}render(){return null!==this.state.error?this.props.fallback(this.state.error):this.props.children}}function Qa(e){const[a,t]=n.useState(!1),[i,o]=n.useState(0),[s,l]=n.useState(Va),d=(e,a)=>p(s,e,a),u=b();n.useEffect(()=>{if(!a)return;y();const e=e=>{"Escape"===e.key&&t(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[a]);const h=null!=r&&"function"==typeof r.createPortal&&"undefined"!=typeof document&&null!==document&&null!==document.body&&void 0!==document.body?document.body:null,m=a?n.createElement("div",{className:"uh-side-modal",role:"presentation",style:u>0?{"--uh-top-inset":u+"px"}:void 0,onMouseDown:e=>{e.target===e.currentTarget&&t(!1)}},n.createElement("div",{className:"uh-side-dialog",role:"dialog","aria-modal":!0,"aria-label":d("用量统计","Usage Statistics")},n.createElement("div",{className:"uh-side-dialog-head"},n.createElement("button",{className:"uh-refresh uh-close-button",type:"button",title:d("关闭用量统计","Close Usage Statistics"),"aria-label":d("关闭用量统计","Close Usage Statistics"),onClick:()=>t(!1)},n.createElement(H,{name:"close",size:18}))),n.createElement($a,{resetKey:i,fallback:()=>n.createElement("div",{className:"uh-boundary-fallback",role:"alert"},n.createElement("div",{className:"uh-boundary-title"},d("用量统计暂时无法显示","Usage statistics is temporarily unavailable")),n.createElement("div",{className:"uh-boundary-note"},d("当前范围加载失败,入口仍然可用。","The selected range failed to render; the sidebar entry is still available.")),n.createElement("div",{className:"uh-actions"},n.createElement("button",{type:"button",className:"uh-refresh",onClick:()=>o(e=>e+1)},n.createElement(H,{name:"refresh",size:14}),d("重试","Retry")),n.createElement("button",{type:"button",className:"uh-refresh",onClick:()=>t(!1)},n.createElement(H,{name:"close",size:14}),d("关闭","Close"))))},n.createElement(_a,{timerCtx:e.timerCtx,language:s,onLanguageChange:e=>{const a=c(e)??"zh";l(a),function(e){try{window.localStorage.setItem(qa,e),window.localStorage.setItem(Ba,"1")}catch(e){}}(a)}})))):null;return n.createElement(n.Fragment,null,n.createElement("button",{type:"button",className:"uh-side-entry",title:d("用量统计","Usage Statistics"),"aria-label":d("用量统计","Usage Statistics"),onClick:()=>t(!0)},n.createElement("span",{className:"uh-side-entry-icon"},n.createElement(H,{name:"chart",size:17})),e.wide?n.createElement("span",{className:"uh-side-entry-label"},d("用量统计","Usage Statistics")):null),null===m||null===h?m:r.createPortal(m,h))}return t.inject=["timer","slots"],t.apply=e=>{const a=e.get("slots"),t=e.get("timer");void 0!==a&&void 0!==t&&(Ka=e,a.inject("sidebar.footer.action",()=>a.register({name:"sidebar.footer.action",id:"all-usage",order:10},e=>n.createElement(Qa,{wide:e.wide,timerCtx:t}))))},a}});
|