@kenz1117/dsh-ui-usage-billing 1.8.1 → 1.8.2-alpha.2

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/lib/client.js CHANGED
@@ -1,6 +1,6 @@
1
- window.__ModuleLoader__.load({id:`@kenz1117/dsh-ui-usage-billing`,factory:e=>{var t={exports:{}},n=t.exports;Object.defineProperty(n,Symbol.toStringTag,{value:`Module`});var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var s=o(t),l=0,u=s.length,d;l<u;l++)d=s[l],!c.call(e,d)&&d!==n&&i(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=a(t,d))||r.enumerable});return e},u=(e,t,n)=>(n=e==null?{}:r(s(e)),l(t||!e||!e.__esModule||!c.call(e,`default`)?i(n,`default`,{value:e,enumerable:!0}):n,e));let d=e("react"),f=e("react-dom"),p=e("@deepseek-ai/dsh-client-ui-primitives");p=u(p,1);let m=e("react/jsx-runtime"),h=e("@deepseek-ai/dsh-client-store");function g(e){return e}function _(e){return g(e)}function v(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=v(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function y(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=v(e))&&(r&&(r+=` `),r+=t);return r}let b=new Map;function x(e,t){let n=Date.now(),r=b.get(e);if(!(r!==void 0&&n-r<3e5)){if(b.set(e,n),t===void 0){console.info(`[usage-billing] swallowed: ${e}`);return}console.info(`[usage-billing] swallowed: ${e}`,t instanceof Error?t.message:t)}}function S(e,t){try{localStorage.setItem(e,t)}catch{x(`display-pref-write-failed`)}}function C(e){try{return localStorage.getItem(e)??void 0}catch{return}}function w(e){let t=C(e);if(t!==void 0)try{return JSON.parse(t)}catch{return}}let T={mode:`combined`,targets:[]},E=`dsh.ui-usage-billing.float`;function ee(){let e=()=>({...T,targets:[...T.targets]}),t=w(E);if(typeof t!=`object`||!t)return e();let n=t;return{mode:n.mode===`subscription`?`subscription`:`combined`,targets:Array.isArray(n.targets)?n.targets.filter(e=>typeof e==`string`):[]}}function D(e){S(E,JSON.stringify(e))}let O={mode:`full`,metric:`money`,span:`day`,showDelta:!0},te=`dsh.ui-usage-billing.card`,k=`dsh.ui-usage-billing.card-changed`;function A(){let e=w(te);if(typeof e!=`object`||!e)return{...O};let t=e;return{mode:t.mode===`compact`||t.mode===`hidden`?t.mode:`full`,metric:t.metric===`tokens`?`tokens`:`money`,span:t.span===`week`||t.span===`month`?t.span:`day`,showDelta:t.showDelta!==!1}}function j(e){S(te,JSON.stringify(e))}function ne(e){let t=t=>{t.key===`dsh.ui-usage-billing.card`&&e()};return window.addEventListener(k,e),window.addEventListener(`storage`,t),()=>{window.removeEventListener(k,e),window.removeEventListener(`storage`,t)}}function re(e,t){return e===`hidden`&&!t?`compact`:e}let M=`dsh.ui-usage-billing.kpi-range`,ie=`dsh.ui-usage-billing.kpi-custom-range`;function ae(){let e=C(M);return e===`today`||e===`7d`||e===`week`||e===`month`||e===`all`||e===`custom`?e:`all`}function oe(e){S(M,e)}function se(){let e=new Date;e.setDate(e.getDate()-1);let t=e=>String(e).padStart(2,`0`),n=`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`;return{start:n,end:n}}function ce(e){if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let t=Number(e.slice(0,4)),n=Number(e.slice(5,7)),r=Number(e.slice(8,10));return t<1e3||n<1||n>12||r<1?!1:r<=new Date(t,n,0).getDate()}function le(){let e=w(ie);if(typeof e==`object`&&e){let t=e;if(ce(t.start)&&ce(t.end)&&t.start<=t.end)return{start:t.start,end:t.end}}return se()}function ue(e){S(ie,JSON.stringify(e))}let de={hideUnidentified:!0},fe=`dsh.ui-usage-billing.sites`;function pe(){let e=w(fe);return typeof e!=`object`||!e?{...de}:{hideUnidentified:e.hideUnidentified!==!1}}function me(e){S(fe,JSON.stringify(e))}let he={show:!0,position:`toolbar`},ge=`dsh.ui-usage-billing.livecost`,_e=`dsh.ui-usage-billing.livecost-pref`;function ve(){let e=w(ge);if(typeof e!=`object`||!e)return{...he};let t=e;return{show:t.show!==!1,position:t.position===`above`||t.position===`toolbar`||t.position===`below`?t.position:he.position}}function ye(e){S(ge,JSON.stringify(e))}let be=`dsh.ui-usage-billing.currency`,xe=`dsh.ui-usage-billing.currency-pref`;function Se(){let e=C(be);return e===`usd`||e===`cny`||e===`eur`?e:`cny`}function Ce(e){S(be,e)}let N=`dsh.ui-usage-billing.pinned`,P=`dsh.ui-usage-billing.pinned-pref`;function we(){let e=w(N);return Array.isArray(e)?e.filter(e=>typeof e==`string`&&e!==``):[]}function Te(e){S(N,JSON.stringify(e))}let Ee=`dsh.ui-usage-billing.provider-expanded`;function De(){let e=w(Ee);return Array.isArray(e)?e.filter(e=>typeof e==`string`&&/^(ch|sub|bal):/.test(e)):[]}function Oe(e){S(Ee,JSON.stringify(e))}let ke=`dsh.ui-usage-billing.providers-today`;function Ae(){return C(ke)===`1`}function F(e){S(ke,e?`1`:`0`)}let je=`dsh.ui-usage-billing.language`;function Me(){let e=C(je);if(e===`en`||e===`zh`)return e;let t=Se()===`usd`?`en`:`zh`;return Ne(t),t}function Ne(e){S(je,e)}function I(e){let t=we(),n=t.includes(e)?t.filter(t=>t!==e):[...t,e];return Te(n),n}let Pe=`dsh.ui-usage-billing.prices`;function Fe(){let e=w(Pe);if(e==null)return[];let t=[],n=(e,n)=>{if(typeof n!=`object`||!n)return;let r=n,i=Number(r.input),a=Number(r.cacheHit),o=Number(r.output);if(![i,a,o].every(e=>Number.isFinite(e)&&e>=0))return;let s=r.offPeak,c;if(typeof s==`object`&&s){let e=s,t=Number(e.input),n=Number(e.cacheHit),r=Number(e.output);[t,n,r].every(e=>Number.isFinite(e)&&e>=0)&&(c={input:t,cacheHit:n,output:r})}t.push({key:e,...typeof r.origin==`string`&&r.origin!==``?{origin:r.origin}:{},input:i,cacheHit:a,output:o,...c===void 0?{}:{offPeak:c},...r.currency===`USD`?{currency:`USD`}:{}})};if(Array.isArray(e))for(let t of e){if(typeof t!=`object`||!t)continue;let e=t;typeof e.key==`string`&&e.key!==``&&n(e.key,t)}else if(typeof e==`object`)for(let[t,r]of Object.entries(e))n(t,r);return t}function Ie(e){S(Pe,JSON.stringify(e))}let Le={metric:`ttft`},Re=`dsh.ui-usage-billing.perf`;function ze(){let e=w(Re);if(typeof e!=`object`||!e)return{...Le};let t=e;return{metric:t.metric===`tps`?`tps`:`ttft`,...Array.isArray(t.models)?{models:t.models.filter(e=>typeof e==`string`)}:{}}}function L(e){S(Re,JSON.stringify(e))}let Be=`dsh.ui-usage-billing.density`,Ve=`dsh.ui-usage-billing.density-pref`;function He(){let e=C(Be);return e===`compact`||e===`comfortable`?e:`default`}function R(e){S(Be,e),typeof window<`u`&&typeof CustomEvent<`u`&&window.dispatchEvent(new CustomEvent(Ve,{detail:{density:e}}))}let Ue=`dsh.ui-usage-billing.motion`,We=`dsh.ui-usage-billing.motion-pref`;function Ge(){let e=C(Ue);return e===`off`||e===`subtle`?e:`rich`}function Ke(e){S(Ue,e),typeof window<`u`&&typeof CustomEvent<`u`&&window.dispatchEvent(new CustomEvent(We,{detail:{motion:e}}))}let qe={enabled:!1,clearAfterEnqueue:!1},Je=`dsh.ui-usage-billing.quick-queue`,Ye=`dsh.ui-usage-billing.quick-queue-pref`;function Xe(){let e=w(Je);if(typeof e!=`object`||!e)return{...qe};let t=e;return{enabled:t.enabled===!0,clearAfterEnqueue:t.clearAfterEnqueue===!0}}function Ze(e){S(Je,JSON.stringify(e)),typeof window<`u`&&typeof CustomEvent<`u`&&window.dispatchEvent(new CustomEvent(Ye))}let Qe=`@kenz1117/dsh-ui-usage-billing/UsageBilling.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Qe)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@kenz1117/dsh-ui-usage-billing`,e.dataset.pluginCss=Qe,e.textContent=`:root{--ds-blue:#4f8cff;--ds-cyan:#2dd4bf;--ds-green:#34d399;--ds-amber:#f59e0b;--ds-red:#ef4444;--ds-violet:#a78bfa;--ds-violet-soft:color-mix(in srgb, var(--ds-violet) 14%, transparent);--ds-violet-bg:color-mix(in srgb, var(--ds-violet) 8%, transparent);--ds-violet-strong:color-mix(in srgb, var(--ds-violet) 60%, transparent);--font-num:"JetBrains Mono", "SF Mono", "Menlo", "Consolas", ui-monospace, monospace;--mono:var(--font-num)}body{--dsb:var(--dsw-alias-bg-layer-1);--dsb-2:var(--dsw-alias-bg-layer-2);--dsb-3:var(--dsw-alias-bg-layer-3);--dsb-glass:color-mix(in srgb,var(--dsw-alias-bg-layer-2) 78%,transparent);--dsb-glass-strong:color-mix(in srgb,var(--dsw-alias-bg-layer-3) 88%,transparent);--ds-border:var(--dsw-alias-border-l1);--ds-border-strong:var(--dsw-alias-border-l2);--ds-hi-top:#ffffff0b;--ds-shadow-1:0 1px 0 #ffffff0a inset,0 8px 24px #00000059;--ds-shadow-2:0 1px 0 #ffffff0d inset,0 18px 48px #00000080;--ds-t-1:var(--dsw-alias-label-primary);--ds-t-2:var(--dsw-alias-label-secondary);--ds-t-3:var(--dsw-alias-label-tertiary);--ds-t-4:var(--dsw-alias-label-dimmed);--ds-c-1:#4f8cff;--ds-c-2:#2dd4bf;--ds-c-3:#a78bfa;--ds-c-4:#f59e0b;--ds-c-5:#f472b6;--ds-c-6:#fbbf24;--ds-c-7:#38bdf8;--ds-r-1:8px;--ds-r-2:12px;--ds-r-3:16px;--ds-t-fast:.16s cubic-bezier(.2,.8,.2,1);--ds-t-enter:.24s cubic-bezier(.2,.8,.2,1);--ds-t-pulse:1.2s cubic-bezier(.2,.8,.2,1);--ds-t-countup:.4s cubic-bezier(.22,1,.36,1);--ds-t-scan:.9s cubic-bezier(.2,.8,.2,1);--ds-density-pad-y:10px;--ds-density-pad-x:14px;--ds-density-row-h:32px;--ds-density-font:12px}[data-density=compact]{--ds-density-pad-y:6px;--ds-density-pad-x:10px;--ds-density-row-h:26px;--ds-density-font:11.5px}[data-density=comfortable]{--ds-density-pad-y:14px;--ds-density-pad-x:18px;--ds-density-row-h:40px;--ds-density-font:13px}[data-density=compact] .KFXqYa_panel{padding:8px 10px}[data-density=compact] .KFXqYa_kpiTile{padding:10px 12px}[data-density=compact] .KFXqYa_setCard{padding:10px 12px}[data-density=compact] .KFXqYa_ubCard{padding:10px 12px}[data-density=compact] .KFXqYa_providerGroup{padding:8px 10px}[data-density=compact] .KFXqYa_providerStatRow{gap:8px;padding:6px 8px}[data-density=compact] .KFXqYa_modelTable th,[data-density=compact] .KFXqYa_modelTable td{padding:6px 8px}[data-density=compact] .KFXqYa_ubTable th,[data-density=compact] .KFXqYa_ubTable td{padding:4px 7px}[data-density=compact] .KFXqYa_dashboardBody{gap:10px;padding:12px 16px 16px}[data-density=compact] .KFXqYa_tabNav{margin:10px 16px 0}[data-density=compact] .KFXqYa_hero{gap:8px;padding:12px 14px}[data-density=compact] .KFXqYa_heroValue{font-size:42px;line-height:46px}[data-density=comfortable] .KFXqYa_panel{padding:16px 18px}[data-density=comfortable] .KFXqYa_kpiTile{padding:18px 20px}[data-density=comfortable] .KFXqYa_setCard{padding:20px 22px}[data-density=comfortable] .KFXqYa_ubCard{padding:20px 22px}[data-density=comfortable] .KFXqYa_providerGroup{padding:16px 18px}[data-density=comfortable] .KFXqYa_providerStatRow{gap:14px;padding:14px 16px}[data-density=comfortable] .KFXqYa_modelTable th,[data-density=comfortable] .KFXqYa_modelTable td{padding:13px 14px}[data-density=comfortable] .KFXqYa_ubTable th,[data-density=comfortable] .KFXqYa_ubTable td{padding:10px 12px}[data-density=comfortable] .KFXqYa_dashboardBody{gap:18px;padding:20px 28px 28px}[data-density=comfortable] .KFXqYa_hero{gap:16px;padding:22px 24px}[data-density=comfortable] .KFXqYa_heroValue{font-size:56px;line-height:60px}.KFXqYa_railButton{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);background:var(--dsb-2);width:36px;height:36px;color:var(--ds-t-2);cursor:pointer;transition:border-color var(--ds-t-fast), color var(--ds-t-fast);flex:none;justify-content:center;align-items:center;padding:0;display:flex}.KFXqYa_railButton:hover,.KFXqYa_railButton:focus-visible{border-color:var(--ds-blue);color:var(--ds-blue);outline:none}.KFXqYa_railButton svg{width:26px;height:26px}.KFXqYa_triggerBudgetPulse{border-color:color-mix(in srgb, var(--ds-red) 55%, transparent);animation:2s ease-in-out infinite KFXqYa_budgetPulse}.KFXqYa_triggerBudgetOver{animation-duration:1.2s}@keyframes KFXqYa_budgetPulse{0%,to{box-shadow:0 1px 2px #0000000a,0 0 #ef444400}50%{box-shadow:0 1px 2px #0000000a,0 0 0 3px #ef444429}}.KFXqYa_trigger{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);background:var(--dsb-glass);-webkit-backdrop-filter:blur(14px)saturate(1.2);width:100%;min-width:0;color:var(--ds-t-1);cursor:pointer;text-align:left;transition:border-color var(--ds-t-fast), transform var(--ds-t-fast), box-shadow var(--ds-t-fast);align-items:center;gap:12px;padding:10px 14px;display:flex;position:relative;overflow:hidden;box-shadow:0 1px 2px #0000000a}.KFXqYa_trigger:hover,.KFXqYa_trigger:focus-visible{border-color:var(--ds-border-strong);box-shadow:0 6px 18px -8px color-mix(in srgb, var(--ds-blue) 45%, transparent);outline:none;transform:translateY(-1px)}.KFXqYa_trigger:before{content:"";background:linear-gradient(180deg, var(--ds-hi-top), transparent);pointer-events:none;height:1px;position:absolute;top:0;left:0;right:0}.KFXqYa_trigger:after{content:"";background:linear-gradient(105deg, transparent 42%, color-mix(in srgb, var(--ds-blue) 9%, transparent) 50%, transparent 58%);opacity:0;pointer-events:none;position:absolute;inset:0;transform:translate(-110%)}.KFXqYa_trigger:hover:after,.KFXqYa_trigger:focus-visible:after{animation:.9s ease-out KFXqYa_triggerScan}@keyframes KFXqYa_triggerScan{0%{opacity:0;transform:translate(-110%)}25%{opacity:1}to{opacity:0;transform:translate(110%)}}@media (prefers-reduced-motion:reduce){.KFXqYa_triggerSparkBar,.KFXqYa_trigger:hover:after,.KFXqYa_trigger:focus-visible:after{animation:none}.KFXqYa_triggerGaugeNeedle,.KFXqYa_triggerGaugeArc{transition:none}.KFXqYa_triggerBudgetPulse,.KFXqYa_dashboardModal,.KFXqYa_tabPanel,.KFXqYa_peakAlertPop{animation:none}.KFXqYa_kpiTile,.KFXqYa_heroGaugeArc,.KFXqYa_chartLine,.KFXqYa_chartArea{transition:none;animation:none}}[data-motion=off] *,[data-motion=off] :before,[data-motion=off] :after{transition:none!important;animation:none!important}[data-motion=subtle] *,[data-motion=subtle] :before,[data-motion=subtle] :after{animation-duration:.001ms!important;animation-iteration-count:1!important}.KFXqYa_triggerIcon{width:32px;height:32px;color:var(--ds-blue);flex:none;justify-content:center;align-items:center;display:inline-flex}.KFXqYa_triggerIcon svg{width:30px;height:30px}.KFXqYa_triggerGaugeNeedle{transition:transform 1.1s cubic-bezier(.22,1,.36,1)}.KFXqYa_triggerGaugeArc{transition:stroke-dasharray 1.1s cubic-bezier(.22,1,.36,1)}.KFXqYa_triggerBudgetHot{color:var(--ds-red)}.KFXqYa_triggerMain{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.KFXqYa_triggerPrimary{flex-direction:column;gap:1px;min-width:0;display:flex}.KFXqYa_triggerValueRow{align-items:baseline;gap:2px;min-width:0;display:flex}.KFXqYa_triggerLabel{color:var(--ds-t-3);white-space:nowrap;text-overflow:ellipsis;min-width:0;font-size:11px;line-height:15px;overflow:hidden}.KFXqYa_triggerYen{color:var(--ds-t-3);font-variant-numeric:tabular-nums;font-size:12px;font-weight:600;line-height:16px}.KFXqYa_triggerMetric{color:var(--ds-t-1);font-size:22px;font-weight:600;line-height:26px;font-family:var(--font-num);font-variant-numeric:tabular-nums;white-space:nowrap;text-overflow:ellipsis;min-width:0;overflow:hidden}.KFXqYa_triggerDelta{font-size:10px;font-weight:600;font-family:var(--font-num);font-variant-numeric:tabular-nums;border-radius:999px;flex:none;align-self:flex-start;align-items:center;gap:1px;padding:1px 5px;display:inline-flex}.KFXqYa_triggerDeltaUp{color:var(--ds-green);background:color-mix(in srgb, var(--ds-green) 14%, transparent)}.KFXqYa_triggerDeltaDown{color:var(--ds-red);background:color-mix(in srgb, var(--ds-red) 14%, transparent)}.KFXqYa_triggerGlow{background:linear-gradient(90deg, transparent, color-mix(in srgb, var(--ds-blue) 40%, transparent), transparent);opacity:0;height:1px;animation:KFXqYa_triggerGlowPulse var(--ds-t-pulse) ease-out 1;position:absolute;bottom:4px;left:0;right:0}@keyframes KFXqYa_triggerGlowPulse{0%{opacity:0;transform:translate(-30%)}30%{opacity:1}to{opacity:0;transform:translate(30%)}}.KFXqYa_triggerSpark{flex:none;align-items:flex-end;gap:2px;height:20px;display:flex}.KFXqYa_triggerSparkBar,.KFXqYa_triggerSparkHot{background:var(--ds-blue);opacity:.6;border-radius:1px 1px 0 0;width:3px}.KFXqYa_triggerSparkHot{opacity:1}.KFXqYa_triggerSparkBar{animation:3.6s ease-in-out infinite KFXqYa_triggerSparkBreath}.KFXqYa_triggerSparkBar:nth-child(2n){animation-delay:-1.2s}.KFXqYa_triggerSparkBar:nth-child(3n){animation-delay:-2.4s}@keyframes KFXqYa_triggerSparkBreath{0%,to{opacity:.6}50%{opacity:.34}}.KFXqYa_triggerWrap{flex:auto;width:100%;min-width:96px;max-width:100%;display:block;position:relative;container:KFXqYa_billing-trigger/inline-size}@container KFXqYa_billing-trigger (width<=210px){.KFXqYa_trigger{box-shadow:none;-webkit-backdrop-filter:none;background:0 0;border:none;border-radius:12px;padding:7px 8px}.KFXqYa_trigger:before,.KFXqYa_trigger:after{display:none}.KFXqYa_trigger:hover,.KFXqYa_trigger:focus-visible{background:var(--dsw-alias-interactive-bg-hover);box-shadow:none;border-color:#0000;transform:none}.KFXqYa_triggerSpark,.KFXqYa_triggerLabel{display:none}}@container KFXqYa_billing-trigger (width<=140px){.KFXqYa_triggerMain{display:none}}.KFXqYa_triggerPop{box-sizing:border-box;border:1px solid var(--ds-border-strong);border-radius:var(--ds-r-3);background:var(--dsb-glass-strong);-webkit-backdrop-filter:blur(14px)saturate(1.2);width:256px;box-shadow:var(--ds-shadow-2);opacity:0;visibility:hidden;pointer-events:none;transition:opacity var(--ds-t-fast), transform var(--ds-t-fast), visibility 0s linear .16s;z-index:2000;flex-direction:column;gap:5px;padding:10px 12px;display:flex;position:fixed;top:0;left:0;overflow:hidden;transform:translateY(calc(4px - 100%))}.KFXqYa_triggerPop,.KFXqYa_triggerPop *{box-sizing:border-box}.KFXqYa_triggerPop:before{content:"";background:linear-gradient(90deg, transparent 10%, var(--ds-amber) 50%, transparent 90%);opacity:.65;pointer-events:none;height:1.5px;position:absolute;top:0;left:0;right:0}.KFXqYa_triggerPopShown{opacity:1;visibility:visible;transition:opacity var(--ds-t-fast), transform var(--ds-t-fast), visibility 0s linear 0s;transform:translateY(-100%)}.KFXqYa_popHead{justify-content:space-between;align-items:baseline;gap:8px;display:flex}.KFXqYa_popTitle{letter-spacing:.06em;text-transform:uppercase;color:var(--ds-t-3);font-size:12px;font-weight:700;line-height:18px}.KFXqYa_metricGrid{grid-template-columns:repeat(3,1fr);gap:10px 12px;display:grid}.KFXqYa_metricCell{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_metricLabel{color:var(--ds-t-3);font-size:11px;line-height:14px}.KFXqYa_metricValue{color:var(--ds-t-1);font-size:13px;font-weight:700;line-height:16px;font-family:var(--font-num);font-variant-numeric:tabular-nums;white-space:nowrap}.KFXqYa_metricValueSuccess{color:var(--ds-green)}.KFXqYa_popModel{border-top:1px dashed var(--ds-border);flex-direction:column;gap:6px;margin-top:9px;padding-top:10px;display:flex}.KFXqYa_popModelLabel{color:var(--ds-t-3);font-size:10px;line-height:14px}.KFXqYa_popModelRow{align-items:center;gap:8px;min-width:0;display:flex}.KFXqYa_popDot{border-radius:999px;flex:none;width:6px;height:6px}.KFXqYa_popDotDirect{background:var(--ds-green)}.KFXqYa_popDotSub{background:var(--ds-amber)}.KFXqYa_popDotNeutral{background:var(--ds-t-3)}.KFXqYa_popTagPrimary,.KFXqYa_popTagSub{white-space:nowrap;border-radius:5px;flex:none;align-items:center;height:18px;padding:0 6px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_popTagPrimary{background:color-mix(in srgb, var(--ds-blue) 14%, transparent);color:var(--ds-blue)}.KFXqYa_popTagSub{background:color-mix(in srgb, var(--ds-amber) 18%, transparent);color:var(--ds-amber)}.KFXqYa_popModelName{color:var(--ds-t-2);text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:500;line-height:16px;overflow:hidden}.KFXqYa_popModelStatus{color:var(--ds-t-1);font-variant-numeric:tabular-nums;white-space:nowrap;margin-left:auto;font-size:11px;font-weight:600;line-height:16px}.KFXqYa_popModelStatusLow{color:var(--ds-red)}.KFXqYa_dashboardModal{border:1px solid var(--ds-border-strong);border-radius:var(--ds-r-3);background:var(--dsb-2);width:min(760px,100vw - 48px);height:min(760px,88vh);box-shadow:var(--ds-shadow-2);animation:.16s ease-out KFXqYa_dashboardIn}@keyframes KFXqYa_dashboardIn{0%{opacity:0;transform:translateY(4px)scale(.98)}to{opacity:1;transform:none}}div[role=presentation]:has(>.dsh-billing-modal)>div[aria-hidden=true]:first-child{backdrop-filter:blur(8px)saturate(1.25)}.KFXqYa_dashboard{flex-direction:column;width:100%;height:100%;min-height:0;display:flex}.KFXqYa_dashboardHead{border-bottom:1px solid var(--ds-border);border-bottom:1px solid var(--ds-border);justify-content:space-between;align-items:center;gap:12px;padding:12px 18px;display:flex}.KFXqYa_dashboardTitle{color:var(--ds-t-1);margin:0;font-size:14px;font-weight:600;line-height:20px}.KFXqYa_dashboardSubtitle{color:var(--ds-t-3);margin:2px 0 0;font-size:11px;line-height:16px}.KFXqYa_closeButton{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);width:32px;height:32px;color:var(--ds-t-2);cursor:pointer;transition:background-color var(--ds-t-fast), color var(--ds-t-fast);background:0 0;flex:none;justify-content:center;align-items:center;display:inline-flex}.KFXqYa_closeButton:hover{background:var(--dsb-3);color:var(--ds-t-1)}.KFXqYa_closeButton svg{stroke-width:2px;width:16px;height:16px}.KFXqYa_dashboardBody{flex-direction:column;flex:auto;gap:14px;min-height:0;padding:16px 24px 24px;display:flex;overflow-y:auto}.KFXqYa_nativeSettingsRoot{width:100%;min-width:0}.KFXqYa_nativeSettingsDashboard{height:auto}.KFXqYa_dashboardBody.KFXqYa_nativeSettingsBody{flex:none;padding:0;overflow:visible}.KFXqYa_settingsLayout.KFXqYa_nativeSettingsLayout{grid-template-columns:minmax(0,1fr)}.KFXqYa_modalFooter{border-top:1px solid var(--ds-border);color:var(--ds-t-3);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:16px;padding:8px 18px;font-size:11px;line-height:16px;display:flex}.KFXqYa_tabRail{background:var(--dsb);border:1px solid var(--ds-border);border-radius:var(--ds-r-2);flex-direction:column;align-self:start;gap:2px;max-height:min(720px,88vh - 80px);padding:6px;display:flex;position:sticky;top:0;overflow-y:auto}.KFXqYa_tabNav{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);background:var(--dsb);align-items:center;gap:4px;margin:14px 24px 0;padding:4px;display:flex}.KFXqYa_tabButton{color:var(--ds-t-3);cursor:pointer;transition:background-color var(--ds-t-fast), color var(--ds-t-fast), box-shadow var(--ds-t-fast);background:0 0;border:none;border-radius:6px;align-items:center;gap:6px;padding:6px 10px 6px 12px;font-size:12px;font-weight:500;line-height:16px;display:flex}.KFXqYa_tabButton:hover{color:var(--ds-t-2)}.KFXqYa_tabButton:focus-visible{box-shadow:0 0 0 1px var(--ds-border-strong);color:var(--ds-t-2);outline:none}.KFXqYa_tabButtonActive,.KFXqYa_tabButtonActive:hover,.KFXqYa_tabButtonActive:focus-visible{background:var(--dsb-3);color:var(--ds-t-1);box-shadow:0 0 0 1px var(--ds-border-strong) inset;font-weight:600}.KFXqYa_tabButton>.KFXqYa_tabRailIcon,.KFXqYa_tabButton>.KFXqYa_tabRailIcon svg{width:12px;height:12px}.KFXqYa_tabNavLabel{line-height:16px}.KFXqYa_tabRailItem{color:var(--ds-t-2);cursor:pointer;text-align:left;transition:background-color var(--ds-t-fast), color var(--ds-t-fast);background:0 0;border:0;border-radius:8px;align-items:center;gap:10px;padding:9px 12px;font-family:inherit;font-size:12.5px;display:flex;position:relative}.KFXqYa_tabRailItem:hover{background:var(--dsb-3);color:var(--ds-t-1)}.KFXqYa_tabRailItem:focus-visible{box-shadow:0 0 0 1.5px var(--ds-border-strong);outline:none}.KFXqYa_tabRailItemActive,.KFXqYa_tabRailItemActive:hover{background:color-mix(in srgb, var(--ds-blue) 14%, transparent);color:var(--ds-t-1);font-weight:600}.KFXqYa_tabRailItemActive:before{content:"";background:var(--ds-blue);border-radius:0 2px 2px 0;width:2px;position:absolute;top:8px;bottom:8px;left:0}.KFXqYa_tabRailIcon{width:14px;height:14px;color:var(--ds-t-3);flex:none;justify-content:center;align-items:center;display:inline-flex}.KFXqYa_tabRailItemActive .KFXqYa_tabRailIcon{color:var(--ds-blue)}.KFXqYa_tabRailIcon svg{width:14px;height:14px}.KFXqYa_tabRailLabel{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.KFXqYa_tabBadge{background:var(--dsb-3);color:var(--ds-t-3)}.KFXqYa_tabBadgeWarn{background:color-mix(in srgb, var(--ds-amber) 18%, transparent);color:var(--ds-amber)}.KFXqYa_tabBadgeHot{background:color-mix(in srgb, var(--ds-red) 18%, transparent);color:var(--ds-red)}.KFXqYa_tabBadgeViolet{background:var(--ds-violet-soft);color:var(--ds-violet)}.KFXqYa_tabPanel{flex-direction:column;gap:14px;animation:.14s ease-out KFXqYa_tabPanelIn;display:flex}.KFXqYa_dashboardBody>*,.KFXqYa_tabPanel>*,.KFXqYa_agentSummary,.KFXqYa_agentRow{flex-shrink:0}@keyframes KFXqYa_tabPanelIn{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.KFXqYa_reconcileNotice{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 78%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 62%, transparent);color:var(--dsw-alias-label-secondary);border-radius:10px;align-items:flex-start;gap:10px;padding:10px 12px;font-size:12px;line-height:1.55;display:flex}.KFXqYa_reconcileIcon{color:var(--dsw-alias-label-tertiary);flex:none;margin-top:1px;display:inline-flex}.KFXqYa_reconcileText{flex:1}.KFXqYa_reconcileDismiss{color:var(--dsw-alias-label-tertiary);cursor:pointer;white-space:nowrap;background:0 0;border:none;border-radius:6px;flex:none;padding:2px 8px;font-size:12px;line-height:1.4;transition:color .15s,background-color .15s}.KFXqYa_reconcileDismiss:hover{color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-alias-label-primary) 8%, transparent)}.KFXqYa_hero{border:1px solid var(--ds-border);border-radius:var(--ds-r-3);background:var(--dsb-glass-strong);flex-direction:column;gap:12px;padding:18px 20px;display:flex;position:relative;overflow:hidden}.KFXqYa_hero:after{content:"";background:linear-gradient(90deg, transparent 10%, var(--ds-amber) 50%, transparent 90%);opacity:.65;pointer-events:none;height:1.5px;position:absolute;top:0;left:0;right:0}.KFXqYa_heroTop{justify-content:space-between;align-items:center;gap:24px;display:flex}.KFXqYa_heroMain{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_heroLabel{color:var(--ds-t-3);text-transform:uppercase;letter-spacing:.06em;white-space:nowrap;font-size:11px;font-weight:500;line-height:15px}.KFXqYa_heroReadout{align-items:baseline;gap:4px;display:flex}.KFXqYa_heroCurrency{font-family:var(--font-num);letter-spacing:-.01em;color:var(--ds-t-2);font-variant-numeric:tabular-nums;font-size:22px;font-weight:600;line-height:26px}.KFXqYa_heroValue{font-family:var(--font-num);letter-spacing:-.03em;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--ds-t-1);font-size:52px;font-weight:600;line-height:56px}.KFXqYa_heroMeta{color:var(--ds-t-2);white-space:nowrap;margin-top:2px;font-size:12px;line-height:16px}.KFXqYa_heroGauge{flex-direction:column;flex:none;align-items:center;gap:4px;width:96px;display:flex}.KFXqYa_heroGaugeDial{flex:none;width:96px;height:96px;position:relative}.KFXqYa_heroGaugeSvg{width:100%;height:100%;display:block;transform:rotate(-90deg)}.KFXqYa_heroGaugeTrack{fill:none;stroke:var(--dsb-3);stroke-width:7px}.KFXqYa_heroGaugeArc{fill:none;stroke:var(--ds-blue);stroke-width:7px;stroke-linecap:round;transition:stroke-dasharray var(--ds-t-fast)}.KFXqYa_heroGaugeArcOver{stroke:var(--ds-red)}.KFXqYa_heroPred{color:var(--ds-t-3);font-size:11px;font-family:var(--font-num);margin-left:8px}.KFXqYa_heroGaugeCenter{flex-direction:column;justify-content:center;align-items:center;gap:1px;display:flex;position:absolute;inset:0}.KFXqYa_heroGaugeRemain{font-family:var(--font-num);letter-spacing:-.02em;font-variant-numeric:tabular-nums;color:var(--ds-t-1);font-size:16px;font-weight:600;line-height:18px}.KFXqYa_heroGaugeRemainOver{color:var(--ds-red)}.KFXqYa_heroGaugeLabel{color:var(--ds-t-3);font-size:11px;line-height:13px}.KFXqYa_heroGaugeSub{font-family:var(--font-num);font-variant-numeric:tabular-nums;color:var(--ds-t-2);white-space:nowrap;font-size:10px;line-height:12px}.KFXqYa_heroSide{border-top:1px solid var(--ds-border);align-items:stretch;padding-top:12px;display:flex}.KFXqYa_heroSideItem{border-left:1px solid var(--ds-border);flex-direction:column;flex:1;gap:2px;min-width:0;padding-left:14px;display:flex}.KFXqYa_heroSideItem:first-child{border-left:none;padding-left:0}.KFXqYa_heroSideLabel{color:var(--ds-t-3);text-transform:uppercase;letter-spacing:.06em;white-space:nowrap;font-size:10px;font-weight:500;line-height:13px}.KFXqYa_heroSideValue{font-family:var(--font-num);color:var(--ds-t-1);font-variant-numeric:tabular-nums;letter-spacing:-.01em;white-space:nowrap;align-items:baseline;gap:6px;font-size:15px;font-weight:600;line-height:20px;display:inline-flex}.KFXqYa_heroSideSpacer{flex:1;display:block}.KFXqYa_delta{font-variant-numeric:tabular-nums;border-radius:999px;align-items:center;gap:2px;margin-left:6px;padding:1px 7px;font-size:10.5px;font-weight:600;line-height:16px;display:inline-flex}.KFXqYa_deltaUp{color:var(--ds-green);background:color-mix(in srgb, var(--ds-green) 12%, transparent)}.KFXqYa_deltaDown{color:var(--ds-red);background:color-mix(in srgb, var(--ds-red) 12%, transparent)}.KFXqYa_unpricedHint{border:1px solid color-mix(in srgb, var(--ds-amber) 30%, transparent);background:color-mix(in srgb, var(--ds-amber) 8%, transparent);color:var(--ds-amber);border-radius:8px;align-items:center;gap:8px;padding:8px 12px;font-size:11.5px;font-weight:500;line-height:17px;display:flex}.KFXqYa_unpricedHintBody{flex:1;min-width:0}.KFXqYa_noticeDismiss{width:18px;height:18px;color:inherit;opacity:.55;cursor:pointer;transition:opacity var(--ds-t-fast), background-color var(--ds-t-fast);background:0 0;border:0;border-radius:999px;flex:none;justify-content:center;align-items:center;padding:0;font-size:14px;line-height:1;display:inline-flex}.KFXqYa_noticeDismiss:hover,.KFXqYa_noticeDismiss:focus-visible{opacity:1;background:color-mix(in srgb, currentColor 14%, transparent);outline:none}.KFXqYa_kpiZone{flex-direction:column;gap:8px;display:flex}.KFXqYa_kpiZoneHead{justify-content:flex-end;align-items:center;gap:8px;display:flex}.KFXqYa_kpiZoneLabel{color:var(--ds-t-3);font-size:11px;line-height:14px}.KFXqYa_kpiCustomRange{flex-wrap:wrap;flex-shrink:0;justify-content:flex-end;align-items:center;gap:8px;display:flex}.KFXqYa_kpiCustomRange label{color:var(--ds-t-3);align-items:center;gap:6px;font-size:11px;line-height:14px;display:inline-flex}.KFXqYa_kpiCustomRange input{border:1px solid var(--ds-border);background:var(--dsb-glass);min-height:28px;color:var(--ds-t-1);color-scheme:light dark;font:inherit;font-family:var(--font-num);border-radius:6px;padding:3px 7px;font-size:11px}.KFXqYa_kpiCustomRange input:focus-visible{outline:2px solid var(--ds-blue);outline-offset:2px}.KFXqYa_kpiGrid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;display:grid}.KFXqYa_kpiTile{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);background:var(--dsb-glass);transition:border-color var(--ds-t-fast);flex-direction:column;gap:2px;padding:14px 16px;display:flex;position:relative;overflow:hidden}.KFXqYa_kpiTile:hover{border-color:var(--ds-border-strong)}.KFXqYa_kpiLabel{color:var(--ds-t-3);text-transform:uppercase;letter-spacing:.04em;font-size:11px;font-weight:500;line-height:14px}.KFXqYa_kpiValue{font-family:var(--font-num);color:var(--ds-t-1);font-variant-numeric:tabular-nums;letter-spacing:-.01em;margin-top:6px;font-size:22px;font-weight:600;line-height:26px}.KFXqYa_kpiGreen{color:var(--ds-green)}.KFXqYa_kpiDetail{font-family:var(--font-num);color:var(--ds-t-3);white-space:nowrap;text-overflow:ellipsis;font-size:11px;line-height:15px;overflow:hidden}.KFXqYa_kpiLabelRow{justify-content:space-between;align-items:center;gap:6px;display:flex}.KFXqYa_kpiDelta{font-size:10px;font-weight:600;font-family:var(--font-num);font-variant-numeric:tabular-nums;border-radius:999px;flex:none;align-items:center;gap:2px;padding:1px 5px;display:inline-flex}.KFXqYa_kpiDeltaUp{color:var(--ds-green);background:color-mix(in srgb, var(--ds-green) 14%, transparent)}.KFXqYa_kpiDeltaDown{color:var(--ds-red);background:color-mix(in srgb, var(--ds-red) 14%, transparent)}.KFXqYa_kpiDeltaFlat{color:var(--ds-t-3);background:var(--dsb-3)}.KFXqYa_kpiSpark{height:12px;margin-top:4px}.KFXqYa_panel{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);background:var(--dsb-glass);transition:border-color var(--ds-t-fast);flex-direction:column;gap:8px;padding:12px 14px;display:flex}.KFXqYa_panelHead{justify-content:space-between;align-items:baseline;gap:10px;display:flex}.KFXqYa_panelHeadControls{align-items:center;gap:8px;display:inline-flex}.KFXqYa_panelTitle{letter-spacing:-.005em;color:var(--ds-t-1);margin:0;font-size:13px;font-weight:600;line-height:20px}.KFXqYa_panelHint{color:var(--ds-t-3);white-space:nowrap;font-size:11px;line-height:16px}.KFXqYa_rangeToggle{border:1px solid var(--ds-border);background:var(--dsb-3);border-radius:8px;gap:2px;padding:2px;display:inline-flex}.KFXqYa_rangeButton{color:var(--ds-t-3);cursor:pointer;transition:background-color var(--ds-t-fast), color var(--ds-t-fast);background:0 0;border:none;border-radius:6px;padding:2px 8px;font-size:11px;line-height:16px}.KFXqYa_rangeButtonActive{background:var(--dsb-2);color:var(--ds-t-1);box-shadow:0 0 0 1px var(--ds-border-strong);font-weight:600}.KFXqYa_exportBar{justify-content:flex-end;align-items:center;gap:8px;display:flex}.KFXqYa_exportLabel{color:var(--ds-t-3);font-size:11px;line-height:16px}.KFXqYa_exportButton{border:1px solid var(--ds-border);color:var(--ds-t-2);cursor:pointer;transition:border-color var(--ds-t-fast), color var(--ds-t-fast), background-color var(--ds-t-fast);background:0 0;border-radius:999px;padding:4px 12px;font-size:11.5px;line-height:16px}.KFXqYa_exportButton:hover,.KFXqYa_exportButton:focus-visible{border-color:var(--ds-border-strong);color:var(--ds-t-1);outline:none}.KFXqYa_exportButton:disabled{opacity:.45;cursor:not-allowed}.KFXqYa_exportButton:disabled:hover{border-color:var(--ds-border);color:var(--ds-t-2)}.KFXqYa_shareTrack{background:var(--dsb-3);border-radius:4px;height:8px;display:flex;overflow:hidden}.KFXqYa_shareSeg{height:100%;transition:width var(--ds-t-fast)}.KFXqYa_shareSegPeak{background:var(--ds-blue)}.KFXqYa_shareSegOff{background:color-mix(in srgb, var(--ds-blue) 30%, var(--dsb-3))}.KFXqYa_shareSegUser{background:var(--ds-blue)}.KFXqYa_shareSegAssistant{background:var(--ds-green)}.KFXqYa_shareSegTool{background:var(--ds-amber)}.KFXqYa_shareLegend{align-items:center;gap:16px;display:flex}.KFXqYa_shareItem{color:var(--ds-t-2);align-items:baseline;gap:6px;font-size:11px;line-height:17px;display:inline-flex}.KFXqYa_bucketCost{font-variant-numeric:tabular-nums;align-items:baseline;gap:3px;display:inline-flex}.KFXqYa_bucketOfficial{color:var(--ds-blue);font-weight:600}.KFXqYa_bucketSep{color:var(--ds-t-4)}.KFXqYa_bucketThird{color:var(--ds-t-2)}.KFXqYa_shareDot{border-radius:2px;flex:none;align-self:center;width:8px;height:8px}.KFXqYa_shareValue{color:var(--ds-t-1);font-variant-numeric:tabular-nums;font-weight:600}.KFXqYa_budgetInput{width:64px;color:var(--ds-t-1);font-variant-numeric:tabular-nums;text-align:right;background:0 0;border:none;padding:0;font-size:12px;line-height:16px}.KFXqYa_budgetInput:focus-visible{outline:none}.KFXqYa_switch{border:1px solid var(--ds-border-strong);background:color-mix(in srgb, var(--ds-t-1) 10%, var(--dsb-3));cursor:pointer;width:32px;height:18px;transition:background-color var(--ds-t-fast), border-color var(--ds-t-fast);border-radius:999px;flex:none;padding:0;position:relative}.KFXqYa_switchOn{background:var(--ds-blue);border-color:#0000}.KFXqYa_switchKnob{width:12px;height:12px;box-shadow:0 0 0 1px var(--ds-border-strong);transition:transform var(--ds-t-fast);background:#fff;border-radius:50%;position:absolute;top:2px;left:2px}.KFXqYa_switchOn .KFXqYa_switchKnob{transform:translate(14px)}.KFXqYa_budgetFillWarn{background:var(--ds-amber)}.KFXqYa_budgetFillOver{background:var(--ds-red)}.KFXqYa_chartWrap{width:100%;position:relative}.KFXqYa_chartSvg{width:100%;height:auto;display:block}.KFXqYa_chartEmpty{height:140px;color:var(--ds-t-3);justify-content:center;align-items:center;font-size:13px;display:flex}.KFXqYa_emptyRow{text-align:center;color:var(--ds-t-3);padding:28px 0;font-size:13px}.KFXqYa_emptyState{border:1px dashed var(--ds-border);border-radius:var(--ds-r-2);background:color-mix(in srgb, var(--dsb-2) 50%, transparent);text-align:center;flex-direction:column;align-items:center;gap:10px;padding:32px 24px;display:flex}.KFXqYa_emptyIll{width:96px;height:64px;display:inline-block;position:relative}.KFXqYa_emptyIll svg{width:100%;height:100%;display:block}.KFXqYa_emptyIllDot{background:var(--ds-blue);border-radius:50%;width:6px;height:6px;animation:2s ease-in-out infinite KFXqYa_emptyDotPulse;position:absolute;bottom:8px;right:14px}@keyframes KFXqYa_emptyDotPulse{0%,to{box-shadow:0 0 0 4px color-mix(in srgb, var(--ds-blue) 20%, transparent)}50%{box-shadow:0 0 0 10px color-mix(in srgb, var(--ds-blue) 0%, transparent)}}.KFXqYa_emptyTitle{color:var(--ds-t-1);font-size:13px;font-weight:500}.KFXqYa_emptyDesc{color:var(--ds-t-3);max-width:320px;font-size:11.5px;line-height:1.5}.KFXqYa_chartGrid{stroke:var(--ds-border);stroke-width:1px}.KFXqYa_chartAxisLabel{fill:var(--ds-t-3);font-size:10px}.KFXqYa_chartBar{fill:var(--ds-blue);opacity:.7}.KFXqYa_chartBar:hover{opacity:1}.KFXqYa_chartStack{stroke:var(--dsb);stroke-width:.75px}.KFXqYa_chartStack:hover{opacity:.9}.KFXqYa_chartLine{stroke:var(--ds-blue);stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.KFXqYa_chartCrosshair{stroke:var(--ds-t-4);stroke-width:1px;stroke-dasharray:3 3}.KFXqYa_chartTooltip{pointer-events:none;z-index:2;border:1px solid var(--ds-border-strong);background:var(--dsb-2);box-shadow:var(--ds-shadow-1);white-space:nowrap;border-radius:8px;padding:8px 10px;position:absolute;transform:translate(-50%,calc(-100% - 10px))}.KFXqYa_chartTooltipAlignRight{transform:translate(calc(-100% - 8px),calc(-100% - 10px))}.KFXqYa_chartTooltipAlignLeft{transform:translate(8px,calc(-100% - 10px))}.KFXqYa_chartTooltipDate{color:var(--ds-t-1);margin-bottom:3px;font-size:11px;font-weight:600}.KFXqYa_chartTooltipRow{color:var(--ds-t-2);align-items:center;gap:5px;font-size:11px;line-height:17px;display:flex}.KFXqYa_chartTooltipRow strong{color:var(--ds-t-1);font-variant-numeric:tabular-nums;font-weight:600}.KFXqYa_chartTooltipHead{justify-content:space-between;align-items:baseline;gap:14px;margin-bottom:3px;display:flex}.KFXqYa_chartTooltipHead .KFXqYa_chartTooltipDate{margin-bottom:0}.KFXqYa_chartTooltipHead strong{color:var(--ds-t-1);font-variant-numeric:tabular-nums;font-size:11px;font-weight:600}.KFXqYa_chartTooltipSplit{justify-content:space-between;gap:14px}.KFXqYa_chartTooltipLabel{align-items:center;gap:5px;display:flex}.KFXqYa_chartTooltipModelDetail{color:var(--ds-t-3);font-variant-numeric:tabular-nums;margin:-2px 0 4px 13px;font-size:10.5px;line-height:14px}.KFXqYa_chartBarPlaceholder{fill:color-mix(in srgb, var(--ds-t-2) 30%, transparent)}.KFXqYa_chartLegendLine{background:var(--ds-blue);border-radius:2px;width:10px;height:3px;display:inline-block}.KFXqYa_chartLegendBar{background:var(--ds-blue);opacity:.5;border-radius:2px;width:7px;height:7px;display:inline-block}.KFXqYa_chartTooltipSwatch{border-radius:2px;flex:none;width:8px;height:8px;display:inline-block}.KFXqYa_chartLegend{color:var(--ds-t-2);justify-content:flex-end;gap:14px;margin-top:2px;font-size:11px;display:flex}.KFXqYa_chartLegend span{align-items:center;gap:5px;display:inline-flex}.KFXqYa_chartLegendItem{font:inherit;color:inherit;cursor:pointer;background:0 0;border:none;align-items:center;gap:5px;padding:0;transition:color .12s;display:inline-flex}.KFXqYa_chartLegendItem:hover{color:var(--ds-t-1)}.KFXqYa_chartLegendItemActive{color:var(--ds-t-1);font-weight:600}.KFXqYa_perfHero{grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:12px;display:grid;container:KFXqYa_billing-perf/inline-size}.KFXqYa_perfHeroCell{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);background:var(--dsb-glass);padding:12px 14px}.KFXqYa_perfHeroLbl{color:var(--ds-t-3);text-transform:uppercase;letter-spacing:.04em;font-size:10.5px;font-weight:500}.KFXqYa_perfHeroVal{font-family:var(--font-num);color:var(--ds-t-1);font-variant-numeric:tabular-nums;letter-spacing:-.01em;margin-top:4px;font-size:22px;font-weight:600;line-height:1.15}.KFXqYa_perfHeroUnit{color:var(--ds-t-3);margin-left:3px;font-size:11px;font-weight:500}.KFXqYa_perfHeroBar{background:var(--dsb-3);border-radius:2px;height:4px;margin-top:6px;position:relative;overflow:hidden}.KFXqYa_perfHeroBar i{height:100%;transition:width var(--ds-t-fast);border-radius:2px;display:block}@container KFXqYa_billing-perf (width<=480px){.KFXqYa_perfHero{grid-template-columns:1fr 1fr}}.KFXqYa_perfCompareList{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);background:var(--dsb-glass);margin-top:10px;overflow:hidden}.KFXqYa_perfCompareRow{border-bottom:1px solid var(--ds-border);grid-template-columns:1fr 80px 56px 56px;align-items:center;gap:12px;padding:8px 12px;font-size:12px;display:grid}.KFXqYa_perfCompareRow:last-child{border-bottom:0}.KFXqYa_perfCompareName{text-overflow:ellipsis;white-space:nowrap;align-items:center;gap:8px;min-width:0;font-weight:500;display:inline-flex;overflow:hidden}.KFXqYa_perfCompareDot{border-radius:2px;flex:none;width:8px;height:8px}.KFXqYa_perfCompareBar{background:var(--dsb-3);border-radius:3px;height:6px;position:relative;overflow:hidden}.KFXqYa_perfCompareBar i{height:100%;transition:width var(--ds-t-fast);border-radius:3px;display:block}.KFXqYa_perfCompareNum{font-family:var(--font-num);color:var(--ds-t-1);font-variant-numeric:tabular-nums;text-align:right;font-size:11.5px;font-weight:600}.KFXqYa_perfBar{align-items:center;margin:10px 0 2px;display:flex}.KFXqYa_perfChips{flex-wrap:wrap;gap:6px;margin:6px 0 2px;display:flex}.KFXqYa_perfChip{border:1px solid var(--ds-border);background:var(--dsb-3);color:var(--ds-t-2);cursor:pointer;transition:border-color var(--ds-t-fast), color var(--ds-t-fast), opacity var(--ds-t-fast);border-radius:999px;align-items:center;gap:5px;padding:2px 9px;font-size:11px;line-height:16px;display:inline-flex}.KFXqYa_perfChip:hover{color:var(--ds-t-1)}.KFXqYa_perfChipOff{opacity:.45}.KFXqYa_perfChipDot{border-radius:2px;flex:none;width:8px;height:8px;display:inline-block}.KFXqYa_chartHoverDot{stroke:var(--dsb-2);stroke-width:1.5px}.KFXqYa_tableScroll{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);overflow:auto}.KFXqYa_ubAlert{border:1px solid color-mix(in srgb, var(--ds-blue) 30%, transparent);border-radius:var(--ds-r-1);background:color-mix(in srgb, var(--ds-blue) 8%, transparent);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;padding:10px 14px;font-size:12px;line-height:17px;display:flex}.KFXqYa_ubAlertLeft{align-items:center;gap:8px;display:inline-flex}.KFXqYa_ubRate{color:var(--ds-t-1);font-variant-numeric:tabular-nums;font-weight:600}.KFXqYa_ubAlertNote{color:var(--ds-t-2);margin:0}.KFXqYa_ubTag,.KFXqYa_ubTagSuccess,.KFXqYa_ubTagNeutral,.KFXqYa_ubTagAlert,.KFXqYa_ubTagPromo{border:1px solid var(--ds-border-strong);white-space:nowrap;border-radius:999px;align-items:center;gap:4px;padding:1px 5px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_ubTag{color:var(--ds-t-2);background:var(--dsb-2)}.KFXqYa_ubTagSuccess{color:var(--ds-green);border-color:color-mix(in srgb, var(--ds-green) 36%, transparent);background:color-mix(in srgb, var(--ds-green) 12%, transparent)}.KFXqYa_ubTagNeutral{color:var(--ds-t-2);background:var(--dsb-2)}.KFXqYa_ubTagAlert{color:var(--ds-amber);border-color:color-mix(in srgb, var(--ds-amber) 36%, transparent);background:color-mix(in srgb, var(--ds-amber) 12%, transparent)}.KFXqYa_ubTagPromo{color:var(--ds-red);border-color:color-mix(in srgb, var(--ds-red) 36%, transparent);background:color-mix(in srgb, var(--ds-red) 12%, transparent);cursor:help}.KFXqYa_ubExtraRow td{opacity:.72;padding-top:2px;padding-bottom:2px;font-size:12px}.KFXqYa_ubExtraName{color:var(--ds-t-2);margin-left:26px}.KFXqYa_ubExtraNote{color:var(--ds-t-3);margin-left:8px;font-size:10px}.KFXqYa_ubCard{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);background:var(--dsb-glass);flex-direction:column;gap:12px;padding:16px 18px;display:flex}.KFXqYa_ubCardHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.KFXqYa_ubCardTitle{color:var(--ds-t-1);margin:0;font-size:13px;font-weight:600;line-height:18px}.KFXqYa_ubCardSub{color:var(--ds-t-3);font-size:11px;line-height:16px}.KFXqYa_ubTablewrap{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);overflow:auto}.KFXqYa_ubTable{border-collapse:collapse;white-space:nowrap;width:100%;font-size:12px}.KFXqYa_ubTable th,.KFXqYa_ubTable td{border-bottom:1px solid var(--ds-border);text-align:left;color:var(--ds-t-1);padding:7px 9px}.KFXqYa_ubSearch{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);width:200px;max-width:45%;color:var(--ds-t-1);background:0 0;outline:none;align-self:center;margin-left:auto;padding:5px 9px;font-size:12px;line-height:18px}.KFXqYa_bandDots{flex:none;align-items:center;gap:5px;display:inline-flex}.KFXqYa_bandDot{cursor:pointer;background:0 0;border:1.5px solid;border-radius:999px;flex:none;width:9px;height:9px;padding:0}.KFXqYa_bandDotOn{background:currentColor}.KFXqYa_offPeak{color:var(--ds-blue)}.KFXqYa_soon{color:var(--ds-amber)}.KFXqYa_peak{color:var(--ds-red)}span.KFXqYa_bandDot{cursor:default}.KFXqYa_ubTable th,.KFXqYa_ubTable td:first-child{white-space:normal}.KFXqYa_ubTable tbody tr:last-child td{border-bottom:0}.KFXqYa_ubTable thead th,.KFXqYa_ubTable thead th.KFXqYa_numCol{color:var(--ds-t-3);text-transform:uppercase;letter-spacing:.04em;text-align:center;padding:6px 9px;font-size:11px;font-weight:500}.KFXqYa_ubModel{align-items:center;gap:6px;display:inline-flex}.KFXqYa_ubModelName{color:var(--ds-t-1);align-items:center;gap:4px;font-weight:500;display:inline-flex}.KFXqYa_ubChipPeak,.KFXqYa_ubChipOff{font-variant-numeric:tabular-nums;border-radius:999px;align-items:center;gap:4px;height:18px;padding:0 6px;font-size:11px;line-height:16px;display:inline-flex}.KFXqYa_ubChipLabel{font-size:10px;font-weight:600}.KFXqYa_ubChipPeak{background:color-mix(in srgb, var(--ds-blue) 12%, transparent);border:1px solid color-mix(in srgb, var(--ds-blue) 36%, transparent);color:var(--ds-blue)}.KFXqYa_ubChipOff{background:color-mix(in srgb, var(--ds-green) 12%, transparent);border:1px solid color-mix(in srgb, var(--ds-green) 36%, transparent);color:var(--ds-green)}.KFXqYa_ubNotes{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.KFXqYa_ubNotesItem{align-items:baseline;gap:10px;display:flex}.KFXqYa_ubNotesTerm{color:var(--ds-t-1);flex:0 0 72px;font-size:12px;font-weight:500}.KFXqYa_ubNotesDesc{min-width:0;color:var(--ds-t-2);flex:1;font-size:12px;line-height:17px}.KFXqYa_ubCardControlGroup{flex-wrap:wrap;align-items:center;gap:8px;display:inline-flex}.KFXqYa_ubTagError{white-space:nowrap;background:color-mix(in srgb, var(--ds-red) 12%, transparent);border:1px solid color-mix(in srgb, var(--ds-red) 36%, transparent);height:18px;color:var(--ds-red);border-radius:999px;align-items:center;padding:0 7px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_modelTable{border-collapse:collapse;table-layout:fixed;width:100%;min-width:640px;font-size:12px}.KFXqYa_modelTable th:first-child{width:26%}.KFXqYa_modelTable th,.KFXqYa_modelTable td{border-bottom:1px solid var(--ds-border);text-align:left;white-space:nowrap;color:var(--ds-t-1);padding:10px 12px}.KFXqYa_modelTable tbody tr:last-child td{border-bottom:0}.KFXqYa_sessionGroupRow{cursor:pointer}.KFXqYa_sessionGroupRow .KFXqYa_modelName:before{content:"›";color:var(--ds-t-3);margin-right:6px;display:inline-block}.KFXqYa_sessionGroupRow[aria-expanded=true] .KFXqYa_modelName:before{transform:rotate(90deg)}.KFXqYa_sessionGroupRow:focus-visible{outline:2px solid var(--ds-border-strong);outline-offset:-2px}.KFXqYa_sessionChildRow td:first-child{padding-left:30px}.KFXqYa_sessionSubDeepRow td:first-child{padding-left:46px}.KFXqYa_modelTable thead th{color:var(--ds-t-3);text-transform:uppercase;letter-spacing:.04em;background:0 0;padding:8px 12px;font-size:11px;font-weight:500}.KFXqYa_modelTable tbody tr{transition:background-color .12s}.KFXqYa_modelTable tbody tr:hover{background:0 0}.KFXqYa_modelTable tbody tr.KFXqYa_modelRowFocusable{cursor:pointer}.KFXqYa_modelTable tbody tr.KFXqYa_modelRowActive,.KFXqYa_modelTable tbody tr.KFXqYa_modelRowActive:hover{background:color-mix(in srgb, var(--ds-blue) 10%, transparent)}.KFXqYa_numCol{text-align:right;font-family:var(--mono);font-variant-numeric:tabular-nums}.KFXqYa_modelTable .KFXqYa_numCol,.KFXqYa_ubTable .KFXqYa_numCol{text-align:right}.KFXqYa_na{color:var(--ds-t-4)}.KFXqYa_unknownHint{color:var(--ds-t-4);margin:0 0 8px;font-size:12px;line-height:18px}.KFXqYa_modelCell{align-items:center;gap:8px;display:inline-flex}.KFXqYa_modelDot{border-radius:2px;flex:none;width:8px;height:8px}.KFXqYa_modelName{color:var(--ds-t-1);font-weight:500;line-height:16px;display:block}.KFXqYa_modelProvider{color:var(--ds-t-3);font-size:10.5px;line-height:14px;display:block}.KFXqYa_siteRow{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);background:var(--dsb-2);justify-content:space-between;align-items:center;gap:12px;padding:8px 10px;display:flex}.KFXqYa_siteRowName{align-items:center;gap:8px;min-width:0;display:inline-flex}.KFXqYa_siteKindTag{white-space:nowrap;border:1px solid #0000;border-radius:999px;flex:none;align-items:center;padding:2px 7px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_siteKindSite{color:var(--ds-blue);border-color:color-mix(in srgb, var(--ds-blue) 36%, transparent);background:color-mix(in srgb, var(--ds-blue) 12%, transparent)}.KFXqYa_siteKindDirect{color:var(--ds-green);border-color:color-mix(in srgb, var(--ds-green) 36%, transparent);background:color-mix(in srgb, var(--ds-green) 12%, transparent)}.KFXqYa_siteKindUnknown{color:var(--ds-red);border-color:color-mix(in srgb, var(--ds-red) 36%, transparent);background:color-mix(in srgb, var(--ds-red) 12%, transparent)}.KFXqYa_siteRowTitle{color:var(--ds-t-1);text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;line-height:18px;overflow:hidden}.KFXqYa_siteRowMeta{flex:none;align-items:center;gap:10px;display:inline-flex}.KFXqYa_siteRowCost{color:var(--ds-t-1);font-variant-numeric:tabular-nums;font-size:12.5px;font-weight:600;line-height:18px}.KFXqYa_siteRowCalls{color:var(--ds-t-2);font-variant-numeric:tabular-nums;font-size:11.5px;line-height:17px}.KFXqYa_siteRowCallsLow{color:var(--ds-red)}.KFXqYa_flatTag{color:var(--ds-t-3);font-size:10.5px;line-height:14px}.KFXqYa_healthDot{border-radius:50%;flex:none;width:6px;height:6px;display:inline-block}.KFXqYa_healthOk{background:var(--ds-green);box-shadow:0 0 0 3px color-mix(in srgb, var(--ds-green) 18%, transparent)}.KFXqYa_healthBad{background:var(--ds-red);box-shadow:0 0 0 3px color-mix(in srgb, var(--ds-red) 18%, transparent), 0 0 0 1px var(--ds-red) inset}.KFXqYa_healthIdle{border:1.5px solid var(--ds-t-4);background:0 0}.KFXqYa_dashboardRight{align-items:center;gap:8px;min-width:0;display:flex}.KFXqYa_healthBadge{white-space:nowrap;border-radius:999px;align-items:center;gap:6px;padding:3px 9px;font-size:11px;line-height:16px;display:inline-flex}.KFXqYa_healthBadgeOk{color:var(--ds-green);background:var(--dsb-2)}.KFXqYa_healthBadgeBad{color:var(--ds-red);background:var(--dsb-2)}.KFXqYa_planTag{color:var(--ds-green);white-space:nowrap;align-items:center;gap:4px;font-size:10px;font-weight:500;line-height:14px;display:inline-flex}.KFXqYa_planTagBadge{background:color-mix(in srgb, var(--ds-green) 20%, transparent);border-radius:4px;padding:0 4px;font-size:9px;line-height:12px}.KFXqYa_uncataloguedTag{border:1px solid color-mix(in srgb, var(--ds-amber) 36%, transparent);vertical-align:1px;color:var(--ds-amber);background:color-mix(in srgb, var(--ds-amber) 12%, transparent);border-radius:999px;margin-left:6px;padding:0 6px;font-size:10px;font-weight:600;line-height:16px;display:inline-block}.KFXqYa_estimatedTag{border:1px solid color-mix(in srgb, var(--ds-blue) 36%, transparent);vertical-align:1px;color:var(--ds-blue);background:color-mix(in srgb, var(--ds-blue) 12%, transparent);border-radius:999px;margin-left:6px;padding:0 6px;font-size:10px;font-weight:600;line-height:16px;display:inline-block}.KFXqYa_feeBar{border:1px solid var(--ds-border-strong);background:var(--dsb-glass-strong);backdrop-filter:blur(14px)saturate(1.3);color:var(--ds-t-2);font-size:11px;line-height:16px;font-family:var(--font-num);font-variant-numeric:tabular-nums;border-radius:999px;flex-wrap:wrap;align-items:center;gap:8px;padding:6px 12px;display:inline-flex}.KFXqYa_feeBarAbove{align-self:center}.KFXqYa_feeInline{font-variant-numeric:tabular-nums;white-space:nowrap;cursor:default;border-radius:999px;align-self:center;align-items:center;gap:5px;height:22px;padding:0 4px;font-size:11px;line-height:16px;display:inline-flex}.KFXqYa_feeInline .KFXqYa_feeChipPrimary,.KFXqYa_feeInline .KFXqYa_feeChipOff{height:18px;padding:0 7px}.KFXqYa_feeInlineNum{color:var(--ds-t-1);padding-right:6px;font-weight:600}.KFXqYa_feeInlineAlert{background:color-mix(in srgb, var(--ds-amber) 12%, transparent)}.KFXqYa_feeInlineAlert .KFXqYa_feeInlineNum{color:var(--ds-amber)}.KFXqYa_feeInlineError{background:color-mix(in srgb, var(--ds-red) 12%, transparent)}.KFXqYa_feeInlineError .KFXqYa_feeInlineNum{color:var(--ds-red)}.KFXqYa_feeBar .KFXqYa_feeSep{color:var(--ds-t-4)}.KFXqYa_feeCount{color:var(--ds-t-1);font-weight:600}.KFXqYa_feeSuffix{color:var(--ds-t-3)}.KFXqYa_feeItem{color:var(--ds-t-2);white-space:nowrap}.KFXqYa_feeNum{color:var(--ds-t-1);font-weight:600}.KFXqYa_feeNum[data-tick]{animation:KFXqYa_feeTickFlash var(--ds-t-pulse) ease-out 1}@keyframes KFXqYa_feeTickFlash{0%{text-shadow:0 0 0 color-mix(in srgb, var(--ds-blue) 0%, transparent)}30%{text-shadow:0 0 8px color-mix(in srgb, var(--ds-blue) 60%, transparent)}to{text-shadow:0 0 0 color-mix(in srgb, var(--ds-blue) 0%, transparent)}}.KFXqYa_feeSep{color:var(--ds-t-4)}.KFXqYa_feeChipPrimary,.KFXqYa_feeChipOff,.KFXqYa_feeChipAlert,.KFXqYa_feeChipError{border:1px solid var(--ds-border);background:var(--dsb-3);font-variant-numeric:tabular-nums;white-space:nowrap;border-radius:999px;align-items:center;height:20px;padding:0 8px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_feeChipPrimary{color:var(--ds-blue);border-color:color-mix(in srgb, var(--ds-blue) 30%, transparent)}.KFXqYa_feeChipOff{color:var(--ds-cyan);border-color:color-mix(in srgb, var(--ds-cyan) 30%, transparent)}.KFXqYa_feeChipAlert{color:var(--ds-amber);border-color:color-mix(in srgb, var(--ds-amber) 30%, transparent)}.KFXqYa_feeChipError{color:var(--ds-red);border-color:color-mix(in srgb, var(--ds-red) 30%, transparent)}.KFXqYa_balanceCell{align-items:center;gap:6px;display:inline-flex;position:relative}.KFXqYa_providerGroupRecharge{border:1px solid color-mix(in srgb, var(--ds-c-1) 38%, transparent);background:color-mix(in srgb, var(--ds-c-1) 8%, transparent);color:var(--ds-c-1);white-space:nowrap;border-radius:999px;justify-content:center;align-items:center;min-width:48px;padding:1px 8px;font-size:10.5px;font-weight:600;line-height:16px;text-decoration:none;display:inline-flex}.KFXqYa_providerGroupRecharge:empty{background:0 0;border-color:#0000}.KFXqYa_providerGroupRecharge:hover{background:color-mix(in srgb, var(--ds-c-1) 15%, transparent);border-color:color-mix(in srgb, var(--ds-c-1) 60%, transparent)}.KFXqYa_balanceDaysBadge{border:1px solid var(--ds-border-strong);background:var(--dsb-2);min-width:16px;height:16px;color:var(--ds-t-2);cursor:pointer;border-radius:8px;justify-content:center;align-items:center;padding:0 4px;font-size:10px;font-weight:600;line-height:1;display:inline-flex}.KFXqYa_balanceDaysBadge:hover{border-color:var(--ds-t-3);color:var(--ds-t-1)}.KFXqYa_balanceDaysBadgeLow{color:var(--ds-red);border-color:color-mix(in srgb, var(--ds-red) 36%, transparent);background:color-mix(in srgb, var(--ds-red) 12%, transparent)}.KFXqYa_balanceDetailPop{z-index:20;background:var(--dsb-2);border:1px solid var(--ds-border-strong);min-width:180px;box-shadow:var(--ds-shadow-1);white-space:nowrap;border-radius:8px;flex-direction:column;gap:6px;padding:8px 10px;display:inline-flex;position:absolute;top:calc(100% + 6px);right:0}.KFXqYa_balanceDetailHead{justify-content:space-between;align-items:center;gap:12px;display:flex}.KFXqYa_balanceDetailTitle{color:var(--ds-t-1);font-size:12px;font-weight:600}.KFXqYa_balanceDetailClose{cursor:pointer;color:var(--ds-t-3);background:0 0;border:none;font-size:14px;line-height:1}.KFXqYa_balanceDetailClose:hover{color:var(--ds-t-1)}.KFXqYa_balanceDetailGrid{flex-direction:column;gap:4px;display:inline-flex}.KFXqYa_balanceDetailRow{color:var(--ds-t-2);font-variant-numeric:tabular-nums;justify-content:space-between;gap:16px;font-size:11px;line-height:15px;display:flex}.KFXqYa_balanceDetailLabel{color:var(--ds-t-3)}.KFXqYa_balanceDetailValue{color:var(--ds-t-1);font-weight:500}.KFXqYa_currencyToggle{background:var(--dsw-alias-bg-layer-3);border:none;border-radius:8px;align-items:center;gap:2px;margin-right:8px;padding:2px;display:inline-flex}.KFXqYa_currencyButton{color:var(--dsw-alias-label-secondary);white-space:nowrap;cursor:pointer;background:0 0;border:0;border-radius:6px;padding:4px 8px;font-size:11px;font-weight:700;line-height:1}.KFXqYa_currencyButtonActive{background:var(--dsb-2);color:var(--dsw-alias-label-primary);box-shadow:0 0 0 1px var(--ds-border-strong)}.KFXqYa_subscriptionGrid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px;margin-top:10px;display:grid}.KFXqYa_subscriptionCard{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);background:var(--dsb-glass);-webkit-backdrop-filter:blur(12px)saturate(1.3);transition:border-color var(--ds-t-fast);padding:14px 16px;position:relative;overflow:hidden}.KFXqYa_subscriptionCardUpgraded{border-color:color-mix(in srgb, var(--ds-blue) 30%, transparent);border-radius:var(--ds-r-3);background:linear-gradient(135deg, color-mix(in srgb, var(--ds-blue) 8%, transparent), transparent 60%), var(--dsb-glass);-webkit-backdrop-filter:blur(12px)saturate(1.4);padding:16px 18px}.KFXqYa_subscriptionCardUpgraded:after{content:"";background:linear-gradient(90deg, transparent 10%, var(--ds-blue) 50%, transparent 90%);opacity:.7;pointer-events:none;height:1.5px;position:absolute;top:0;left:0;right:0}.KFXqYa_subscriptionCardUpgraded .KFXqYa_subscriptionPct{font-size:18px;font-weight:600}.KFXqYa_subscriptionHead{flex-wrap:wrap;align-items:baseline;gap:6px;margin-bottom:8px;display:flex}.KFXqYa_subscriptionName{color:var(--ds-t-1);font-size:13px;font-weight:600}.KFXqYa_subscriptionPlan{color:var(--ds-t-2);font-size:11px}.KFXqYa_subscriptionPlan[data-kind=code],.KFXqYa_subscriptionPlan[data-kind=token]{color:var(--ds-t-2);background:var(--dsb-3);border-radius:999px;padding:1px 8px;font-weight:500}.KFXqYa_subscriptionTier{color:var(--ds-t-3);margin-left:6px}.KFXqYa_subscriptionAuto{border:1px solid color-mix(in srgb, var(--ds-blue) 36%, transparent);color:var(--ds-blue);background:color-mix(in srgb, var(--ds-blue) 12%, transparent);border-radius:999px;margin-left:6px;padding:1px 6px;font-size:10px}.KFXqYa_subscriptionStatus{color:var(--ds-t-2);margin-bottom:6px;font-size:11px}.KFXqYa_subscriptionWindow{align-items:center;gap:10px;margin-top:8px;font-size:11px;display:flex}.KFXqYa_subscriptionWindowLabel{color:var(--ds-t-3);flex:0 0 44px}.KFXqYa_subscriptionTrack{background:var(--dsb-3);height:6px;box-shadow:inset 0 0 0 1px var(--ds-border);border-radius:3px;flex:1;overflow:hidden}.KFXqYa_subscriptionFill{background:var(--ds-blue);height:calc(100% - 2px);transition:width var(--ds-t-fast);border-radius:2px;margin:1px;display:block}.KFXqYa_subscriptionFillWarn{background:var(--ds-amber)}.KFXqYa_subscriptionFillOver{background:var(--ds-red)}.KFXqYa_subscriptionMeta{flex-direction:column;flex:none;align-items:flex-end;gap:2px;display:flex}.KFXqYa_subscriptionPct{text-align:right;min-width:52px;font-family:var(--mono);font-variant-numeric:tabular-nums;color:var(--ds-t-1);flex:none}.KFXqYa_subscriptionExhausted{color:var(--ds-red);min-width:52px;font-weight:600}.KFXqYa_subscriptionReset{color:var(--ds-t-3);white-space:nowrap;flex:none;font-size:10px}.KFXqYa_providerGroupList{flex-direction:column;gap:10px;display:flex}.KFXqYa_providerGroup{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);background:var(--dsb-glass);padding:12px 14px;container:KFXqYa_billing-pg/inline-size}.KFXqYa_providerStatRow{border-radius:var(--ds-r-1);background:var(--dsb-2);border:1px solid var(--ds-border);grid-template-columns:repeat(4,1fr);gap:10px;margin-top:10px;padding:10px 12px;display:grid}.KFXqYa_providerStatCell{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_providerStatLbl{color:var(--ds-t-3);text-transform:uppercase;letter-spacing:.04em;font-size:10.5px;font-weight:500}.KFXqYa_providerStatVal{font-family:var(--font-num);color:var(--ds-t-1);font-variant-numeric:tabular-nums;letter-spacing:-.01em;white-space:nowrap;text-overflow:ellipsis;font-size:16px;font-weight:600;overflow:hidden}.KFXqYa_providerStatSub{font-family:var(--font-num);color:var(--ds-t-3);font-size:10.5px}@container KFXqYa_billing-pg (width<=480px){.KFXqYa_providerStatRow{grid-template-columns:1fr 1fr}}.KFXqYa_providerGroupHead{justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:10px;display:flex}.KFXqYa_providerGroupCollapsible{cursor:pointer}.KFXqYa_providerGroupCollapsible .KFXqYa_providerGroupTitle:before{content:"›";color:var(--ds-t-3);margin-right:6px;display:inline-block}.KFXqYa_providerGroupCollapsible[aria-expanded=true] .KFXqYa_providerGroupTitle:before{transform:rotate(90deg)}.KFXqYa_providerGroupCollapsible:focus-visible{outline:2px solid var(--ds-border-strong);outline-offset:2px;border-radius:6px}.KFXqYa_providerCtlRow{align-items:center;gap:12px;margin-bottom:10px;display:flex}.KFXqYa_providerTodayToggle{color:var(--ds-t-3);align-items:center;gap:7px;font-size:11px;display:inline-flex}.KFXqYa_providerGroupTitle{align-items:center;gap:7px;min-width:0;display:inline-flex}.KFXqYa_kindBadge{border:1px solid color-mix(in srgb, var(--ds-c-1) 32%, transparent);background:color-mix(in srgb, var(--ds-c-1) 10%, transparent);color:var(--ds-c-1);border-radius:4px;flex:none;padding:1px 6px;font-size:10px;font-weight:600;line-height:15px}.KFXqYa_kindBadgeRelay{border-color:color-mix(in srgb, var(--ds-c-2) 32%, transparent);background:color-mix(in srgb, var(--ds-c-2) 10%, transparent);color:var(--ds-c-2)}.KFXqYa_kindBadgeUnknown{border-color:var(--ds-border);background:color-mix(in srgb, var(--ds-t-3) 12%, transparent);color:var(--ds-t-3)}.KFXqYa_providerGroupName{color:var(--ds-t-1);font-size:13px;font-weight:600;line-height:18px}.KFXqYa_providerGroupMeta{flex:none;align-items:center;gap:10px;display:inline-flex}.KFXqYa_providerGroupBadge{border:1px solid color-mix(in srgb, var(--ds-green) 36%, transparent);color:var(--ds-green);background:color-mix(in srgb, var(--ds-green) 12%, transparent);border-radius:999px;justify-content:center;align-items:center;padding:1px 8px;font-size:10px;font-weight:500;line-height:16px;display:inline-flex}.KFXqYa_providerGroupBalance,.KFXqYa_providerGroupCost{color:var(--ds-t-2);font-variant-numeric:tabular-nums;white-space:nowrap;justify-content:flex-end;align-items:baseline;gap:6px;min-width:118px;font-size:12px;line-height:17px;display:inline-flex}.KFXqYa_providerGroupCostLabel{font-size:11px}.KFXqYa_providerGroupCostValue{color:var(--ds-t-1);text-align:right;min-width:56px;font-weight:600}.KFXqYa_providerGroupBalanceLabel{color:var(--ds-t-3);font-size:11px;line-height:17px}.KFXqYa_rounds{margin-top:10px}.KFXqYa_roundsBars{align-items:flex-end;gap:3px;height:124px;padding:16px 2px 0;display:flex;overflow-x:auto}.KFXqYa_roundsBarCol{border-radius:5px 5px 0 0;flex-direction:column;flex:1 0 28px;justify-content:flex-end;align-items:stretch;height:100%;display:flex;position:relative}.KFXqYa_roundsBarColPeak{background:color-mix(in srgb, var(--ds-amber) 16%, transparent)}.KFXqYa_roundsBarColOff{background:var(--dsb-3)}.KFXqYa_roundsBarLabel{text-align:center;color:var(--ds-t-2);white-space:nowrap;text-overflow:ellipsis;max-width:100%;font-size:9px;line-height:1.2;position:absolute;bottom:0;left:0;right:0;overflow:hidden;transform:translateY(-100%)}.KFXqYa_roundsBarWrap{flex:1;align-items:flex-end;min-height:0;display:flex}.KFXqYa_roundsBar{background:var(--ds-blue);border-radius:2px 2px 0 0;width:100%;min-height:2px;position:relative}.KFXqYa_roundsBarFlagged{background:var(--ds-red);border-radius:2px 2px 0 0;width:100%;min-height:2px;position:relative}.KFXqYa_roundsFlagMark{background:var(--ds-red);border-radius:50%;width:7px;height:7px;position:absolute;top:-3px;right:-3px}.KFXqYa_roundsAxis{color:var(--ds-t-3);justify-content:space-between;margin-top:6px;font-size:10px;display:flex}.KFXqYa_roundsEmpty{color:var(--ds-t-2);margin-top:10px;font-size:12px}.KFXqYa_heatmap{margin-top:10px}.KFXqYa_heatmapGrid{grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;display:grid}.KFXqYa_heatmapCellEmpty{box-sizing:border-box;border:1px dashed var(--ds-border);height:30px;color:var(--ds-t-4);font-variant-numeric:tabular-nums;background:0 0;border-radius:2px;justify-content:center;align-items:center;font-size:11px;display:flex}.KFXqYa_heatmapCell{font-variant-numeric:tabular-nums;cursor:pointer;border:0;border-radius:2px;justify-content:center;align-items:center;height:30px;padding:0;font-size:11px;display:flex}.KFXqYa_heatmapCell[data-level="0"],.KFXqYa_heatmapCell[data-level="1"],.KFXqYa_heatmapCell[data-level="2"]{color:var(--dsw-alias-label-primary)}.KFXqYa_heatmapCell[data-level="3"],.KFXqYa_heatmapCell[data-level="4"]{color:var(--dsw-static-neutral-bluish-00)}.KFXqYa_heatmapCell[data-today=true],.KFXqYa_heatmapYearCell[data-today=true]{outline:1.5px solid color-mix(in srgb, var(--ds-amber) 70%, transparent);outline-offset:1px;z-index:1}.KFXqYa_heatmapFooter{color:var(--dsw-alias-label-secondary);align-items:center;gap:8px;margin-top:10px;font-size:10px;display:flex}.KFXqYa_heatmapLegend{gap:3px;display:inline-flex}.KFXqYa_heatmapLegend i{border-radius:2px;width:14px;height:14px;display:block}.KFXqYa_heatmapHover{font-family:var(--font-num);font-variant-numeric:tabular-nums;margin-left:auto}.KFXqYa_heatmapRangeSwitch{gap:4px;margin-left:auto;display:inline-flex}.KFXqYa_heatmapRangeButton{border:1px solid var(--ds-border);color:var(--ds-t-2);cursor:pointer;background:0 0;border-radius:6px;padding:2px 8px;font-size:11px;line-height:1.4}.KFXqYa_heatmapRangeButtonActive{background:var(--dsb-2);border-color:var(--ds-border-strong);color:var(--ds-t-1);box-shadow:0 0 0 1px var(--ds-border-strong);font-weight:600}.KFXqYa_heatmapYear{flex-direction:column;gap:6px;display:flex}.KFXqYa_heatmapYearBody{align-items:flex-start;gap:6px;display:flex}.KFXqYa_heatmapYearWeekdays{color:var(--ds-t-3);flex:none;grid-template-rows:repeat(7,11px);gap:3px;padding-top:12px;font-size:9px;line-height:11px;display:grid}.KFXqYa_heatmapYearWeekday{white-space:nowrap;text-align:right;height:11px}.KFXqYa_heatmapYearMonths{min-width:max-content;color:var(--ds-t-3);grid-template-columns:repeat(52,11px);gap:3px;font-size:9px;line-height:12px;display:grid;overflow:visible}.KFXqYa_heatmapYearMonth{white-space:nowrap;overflow:visible}.KFXqYa_heatmapYearScroll{padding-bottom:2px;overflow-x:auto}.KFXqYa_heatmapYearGrid{grid-template-rows:repeat(7,11px);grid-auto-flow:column;gap:3px;min-width:max-content;display:grid}.KFXqYa_heatmapYearCell{cursor:pointer;border:0;border-radius:2px;width:11px;height:11px;padding:0}.KFXqYa_heatmapHalf .KFXqYa_heatmapYearWeekdays{grid-template-rows:repeat(7,16px);line-height:16px}.KFXqYa_heatmapHalf .KFXqYa_heatmapYearWeekday{height:16px}.KFXqYa_heatmapHalf .KFXqYa_heatmapYearMonths{grid-template-columns:repeat(26,16px)}.KFXqYa_heatmapHalf .KFXqYa_heatmapYearGrid{grid-template-rows:repeat(7,16px)}.KFXqYa_heatmapHalf .KFXqYa_heatmapYearCell{border-radius:3px;width:16px;height:16px}.KFXqYa_floatSub{flex-direction:column;gap:6px;min-width:0;display:flex}.KFXqYa_floatSubHead{flex-wrap:wrap;align-items:baseline;gap:6px;min-width:0;display:flex}.KFXqYa_floatSubName{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:700}.KFXqYa_floatSubPlan{color:var(--dsw-alias-label-secondary);font-size:10px}.KFXqYa_floatSub .KFXqYa_subscriptionWindow{flex-wrap:wrap;gap:4px 10px}.KFXqYa_floatSub .KFXqYa_subscriptionWindowLabel{flex:none}.KFXqYa_floatSub .KFXqYa_subscriptionMeta{min-width:0;max-width:100%}.KFXqYa_floatSub .KFXqYa_subscriptionPct{min-width:0}.KFXqYa_floatSub .KFXqYa_subscriptionReset{white-space:normal;overflow-wrap:anywhere}.KFXqYa_triggerPopEmpty{color:var(--dsw-alias-label-tertiary);padding:2px 0;font-size:11px;line-height:1.5}.KFXqYa_triggerPopSwitcher{justify-content:flex-end;align-items:center;gap:8px;margin-top:2px;display:flex}.KFXqYa_triggerPopSwitchCount{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:10px}.KFXqYa_floatModeBtn{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 75%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 60%, transparent);color:var(--dsw-alias-label-secondary);white-space:nowrap;cursor:pointer;border-radius:10px;flex:1;padding:7px 10px;font-size:12px}.KFXqYa_floatModeBtnOn{border-color:var(--ds-blue);color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--ds-blue) 16%, transparent)}.KFXqYa_floatModeBtn:disabled{opacity:.45;cursor:not-allowed}.KFXqYa_rdoRow{justify-content:space-between;align-items:center;gap:8px;margin-top:10px;display:flex}.KFXqYa_rdoLabel{color:var(--dsw-alias-label-secondary);font-size:12px}.KFXqYa_rdoSelect{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 75%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 60%, transparent);color:var(--dsw-alias-label-primary);white-space:nowrap;cursor:pointer;border-radius:10px;align-items:center;gap:5px;padding:5px 8px 5px 10px;font-size:12px;display:inline-flex}.KFXqYa_rdoSelect:hover{background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 85%, transparent)}.KFXqYa_rdoSelect:focus-visible{border-color:var(--ds-blue);outline:none}.KFXqYa_rdoChevron{color:var(--dsw-alias-label-tertiary);transition:transform .15s;display:inline-flex}.KFXqYa_rdoChevronOpen{transform:rotate(180deg)}.KFXqYa_floatTarget{color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:5px;font-size:12px;display:inline-flex}.KFXqYa_floatTargetLabel{color:var(--dsw-alias-label-secondary)}.KFXqYa_staleNotice{color:var(--ds-amber);background:color-mix(in srgb, var(--ds-amber) 12%, transparent);border:1px solid color-mix(in srgb, var(--ds-amber) 30%, transparent);border-radius:10px;align-items:center;gap:6px;margin:0 0 10px;padding:8px 10px;font-size:11px;display:flex}.KFXqYa_staleNoticeBody{flex:1;min-width:0}.KFXqYa_staleNoticeSub{margin-top:4px;display:block}.KFXqYa_plgHead{align-items:flex-start;gap:12px;display:flex}.KFXqYa_plgIcon{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);width:40px;height:40px;color:var(--dsw-alias-label-secondary);border-radius:10px;flex:none;justify-content:center;align-items:center;display:inline-flex}.KFXqYa_plgTitle{flex-direction:column;gap:4px;min-width:0;display:flex}.KFXqYa_plgNameRow{align-items:center;gap:8px;display:flex}.KFXqYa_plgName{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.KFXqYa_plgTag{height:18px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-3);white-space:nowrap;border-radius:5px;align-items:center;padding:0 6px;font-size:10px;font-weight:600;display:inline-flex}.KFXqYa_plgDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:11px;line-height:16px}.KFXqYa_plgGrid{border-top:1px solid var(--dsw-alias-border-l1);grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding-top:12px;display:grid}.KFXqYa_plgItem{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_plgLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.KFXqYa_plgVal{color:var(--dsw-alias-label-primary);word-break:break-all;font-size:12px;line-height:17px}.KFXqYa_plgLink{color:var(--ds-blue);word-break:break-all;font-size:12px;line-height:17px;text-decoration:none}.KFXqYa_plgLink:hover{text-decoration:underline}.KFXqYa_tokenPanel{flex-direction:column;gap:14px;display:flex}.KFXqYa_tokenModelBar{background:var(--dsw-alias-bg-layer-2);border-radius:999px;height:8px;overflow:hidden}.KFXqYa_tokenModelParts{height:100%;display:flex}.KFXqYa_tokenModelPartIn{background:var(--ds-blue)}.KFXqYa_tokenModelPartOut{background:var(--ds-amber)}.KFXqYa_tokenModelShareRow{align-items:center;gap:6px;display:inline-flex}@media (width<=640px){.KFXqYa_kpiGrid{grid-template-columns:repeat(2,minmax(0,1fr))}.KFXqYa_hero{gap:14px}.KFXqYa_heroTop{flex-direction:column;align-items:flex-start;gap:12px}.KFXqYa_heroGauge{width:72px;height:72px}.KFXqYa_heroSide{gap:12px}.KFXqYa_heroSideSpacer{display:none}}.KFXqYa_peakCard{z-index:2000;border-radius:var(--ds-r-2);border:1px solid var(--ds-border-strong);background:var(--dsb-glass-strong);-webkit-backdrop-filter:blur(14px)saturate(1.2);min-width:280px;max-width:380px;box-shadow:var(--ds-shadow-2);animation:KFXqYa_peakAlertIn var(--ds-t-fast);flex-direction:column;gap:12px;padding:14px 16px;display:flex;position:fixed}.KFXqYa_peakCardCorner{bottom:18px;right:18px}.KFXqYa_peakCardCenter{top:20%;left:50%;transform:translate(-50%)}.KFXqYa_peakCardPeak{color:var(--ds-blue)}.KFXqYa_peakCardOff{color:var(--ds-cyan)}.KFXqYa_peakHead{justify-content:space-between;align-items:center;gap:8px;display:flex}.KFXqYa_peakTag{white-space:nowrap;border-radius:6px;align-items:center;gap:6px;height:20px;padding:0 8px;font-size:11px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_peakTagPrimary{background:var(--dsw-alias-bg-layer-3);color:var(--ds-blue)}.KFXqYa_peakTagSuccess{background:var(--dsw-alias-bg-layer-3);color:var(--ds-cyan)}.KFXqYa_peakDot{border-radius:999px;flex:none;width:6px;height:6px}.KFXqYa_peakDotPrimary{background:var(--ds-blue)}.KFXqYa_peakDotSuccess{background:var(--ds-cyan)}.KFXqYa_peakClose{width:24px;height:24px;color:var(--ds-t-3);cursor:pointer;transition:background-color var(--ds-t-fast), color var(--ds-t-fast);background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;font-size:15px;line-height:1;display:inline-flex}.KFXqYa_peakClose:hover{color:var(--ds-t-1);background:var(--dsw-alias-bg-layer-2)}.KFXqYa_peakCount{font-family:var(--font-num);font-variant-numeric:tabular-nums;font-size:28px;font-weight:600;line-height:1}.KFXqYa_peakCountPrimary{color:var(--ds-blue)}.KFXqYa_peakCountSuccess{color:var(--ds-cyan)}.KFXqYa_peakDesc{color:var(--ds-t-1);margin:4px 0 0;font-size:12px;line-height:18px}@keyframes KFXqYa_peakAlertIn{0%{opacity:0}to{opacity:1}}.KFXqYa_settingsLayout{grid-template-columns:120px 1fr;gap:14px;display:grid;container:KFXqYa_billing-settings/inline-size}.KFXqYa_settingsNav{border-right:1px solid var(--ds-border);flex-direction:column;align-self:start;gap:2px;max-height:min(720px,88vh - 80px);padding-right:14px;display:flex;position:sticky;top:0;overflow-y:auto}.KFXqYa_settingsNavItem{color:var(--ds-t-2);cursor:pointer;text-align:left;transition:background-color var(--ds-t-fast), color var(--ds-t-fast);background:0 0;border:0;border-radius:6px;align-items:center;gap:6px;padding:6px 8px;font-family:inherit;font-size:11.5px;display:flex}.KFXqYa_settingsNavItem:hover{background:var(--dsb-3);color:var(--ds-t-1)}.KFXqYa_settingsNavItem:focus-visible{box-shadow:0 0 0 1.5px var(--ds-border-strong);outline:none}.KFXqYa_settingsNavItemActive{background:color-mix(in srgb, var(--ds-blue) 14%, transparent);color:var(--ds-t-1);font-weight:600}.KFXqYa_settingsNavIcon{width:12px;height:12px;color:var(--ds-t-3);justify-content:center;align-items:center;display:inline-flex}.KFXqYa_settingsNavItemActive .KFXqYa_settingsNavIcon{color:var(--ds-blue)}.KFXqYa_settingsNavIcon svg{width:12px;height:12px}.KFXqYa_settingsNavItemAdvanced .KFXqYa_settingsNavIcon{color:var(--ds-violet)}.KFXqYa_settingsPane{flex-direction:column;gap:12px;min-width:0;display:flex}@container KFXqYa_billing-settings (width<=540px){.KFXqYa_settingsLayout{grid-template-columns:1fr}.KFXqYa_settingsNav{border-right:none;border-bottom:1px solid var(--ds-border);flex-flow:wrap;max-height:none;padding-bottom:10px;padding-right:0;position:static}}.KFXqYa_densityRow{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);background:var(--dsb-2);justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}.KFXqYa_densityRow+.KFXqYa_densityRow{margin-top:8px}.KFXqYa_densityLeft{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_densityLeft strong{font-size:12.5px;font-weight:500}.KFXqYa_densityLeft span{color:var(--ds-t-3);font-size:11px}.KFXqYa_densityButtons{border:1px solid var(--ds-border);background:var(--dsb-3);border-radius:8px;align-items:center;gap:4px;padding:2px;display:inline-flex}.KFXqYa_densityButton{color:var(--ds-t-2);cursor:pointer;transition:background-color var(--ds-t-fast), color var(--ds-t-fast);background:0 0;border:0;border-radius:6px;padding:4px 10px;font-family:inherit;font-size:11px}.KFXqYa_densityButton:hover{color:var(--ds-t-1)}.KFXqYa_densityButtonActive{background:var(--dsb-2);color:var(--ds-t-1);box-shadow:0 0 0 1px var(--ds-border-strong);font-weight:600}.KFXqYa_densityButtonComfortable.KFXqYa_densityButtonActive{background:var(--ds-violet-bg);color:var(--ds-violet);box-shadow:0 0 0 1px var(--ds-violet-strong)}.KFXqYa_setCard{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);background:var(--dsb-glass);flex-direction:column;gap:12px;padding:16px 18px;display:flex}.KFXqYa_setGrid3,.KFXqYa_setGrid2{gap:10px;display:grid}.KFXqYa_setGrid3{grid-template-columns:repeat(3,minmax(0,1fr))}.KFXqYa_setGrid2{grid-template-columns:repeat(2,minmax(0,1fr))}@media (width<=720px){.KFXqYa_setGrid3,.KFXqYa_setGrid2{grid-template-columns:1fr}}.KFXqYa_setCell{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);flex-direction:column;gap:8px;min-width:0;padding:12px 14px;display:flex}.KFXqYa_setCardHead{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.KFXqYa_setCardMeta{flex-direction:column;gap:4px;min-width:0;display:flex}.KFXqYa_setCardTitle{color:var(--ds-t-1);margin:0;font-size:13px;font-weight:600;line-height:18px}.KFXqYa_setCardDesc{color:var(--ds-t-3);margin:0;font-size:11px;line-height:16px}.KFXqYa_ctlCol{flex-direction:column;gap:10px;padding-top:2px;display:flex}.KFXqYa_ctlRow{align-items:center;gap:12px;min-height:28px;display:flex}.KFXqYa_ctlRowStretch{display:flex}.KFXqYa_ctlLabel{color:var(--ds-t-3);flex:0 0 96px;font-size:11px;line-height:16px}.KFXqYa_ctlGroup{flex-wrap:wrap;align-items:center;gap:8px;display:inline-flex}.KFXqYa_userPriceRow{border-bottom:1px solid var(--ds-border);align-items:center;gap:10px;padding:8px 0;display:flex}.KFXqYa_userPriceCheck{width:14px;height:14px;accent-color:var(--ds-blue);flex:none;margin:0}.KFXqYa_userPriceBody{flex-direction:column;flex:1;gap:8px;min-width:0;display:flex}.KFXqYa_userPriceLineMeta{grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) auto;align-items:end;gap:8px 10px;display:grid}@media (width<=720px){.KFXqYa_userPriceLineMeta{grid-template-columns:repeat(2,minmax(0,1fr))}}.KFXqYa_userPriceLineMeta .KFXqYa_userPriceInput{box-sizing:border-box;width:100%;min-width:0;max-width:none}.KFXqYa_userPriceBody .KFXqYa_ctlGroup{flex-wrap:nowrap}.KFXqYa_userPriceLineMeta .KFXqYa_userPriceField .KFXqYa_ctlLabel{align-items:flex-end;min-height:30px;display:flex}.KFXqYa_userPricePriceLine{border-left:2px solid var(--ds-amber);flex-wrap:wrap;align-items:center;gap:10px;width:calc(100% - 22px);margin-left:10px;padding:2px 0 6px 12px;display:flex}.KFXqYa_userPricePriceLine>.KFXqYa_ctlLabel{color:var(--ds-t-3);flex:0 0 44px;font-size:11px}.KFXqYa_userPricePriceLine .KFXqYa_userPriceInputNum{box-sizing:border-box;flex:1 1 0;width:auto;min-width:120px;max-width:240px}.KFXqYa_userPriceField{flex-direction:column;gap:4px;min-width:0;display:flex}.KFXqYa_userPriceField .KFXqYa_ctlLabel{flex:none;font-size:11px}.KFXqYa_userPriceInput,.KFXqYa_userPriceInputNum{border:1px solid var(--ds-border);background:var(--dsb-3);min-width:96px;max-width:160px;color:var(--ds-t-1);border-radius:6px;padding:4px 8px;font-size:12px;line-height:16px}.KFXqYa_userPriceInputNum{min-width:72px;max-width:88px}.KFXqYa_rdo{color:var(--ds-t-2);cursor:pointer;white-space:nowrap;align-items:center;gap:6px;font-size:12px;line-height:16px;display:inline-flex}.KFXqYa_rdo input{opacity:0;pointer-events:none;position:absolute}.KFXqYa_rdoDot{border:1px solid var(--ds-border-strong);background:var(--dsb-3);border-radius:50%;flex:none;width:14px;height:14px;position:relative}.KFXqYa_rdo input:checked+.KFXqYa_rdoDot{border-color:var(--ds-blue)}.KFXqYa_rdo input:checked+.KFXqYa_rdoDot:after{content:"";background:var(--ds-blue);border-radius:50%;position:absolute;inset:3px}.KFXqYa_inp{border:1px solid var(--ds-border);background:var(--dsb-3);border-radius:6px;align-items:center;gap:4px;padding:2px 6px;display:inline-flex}.KFXqYa_affix{color:var(--ds-t-3);font-size:11px;line-height:16px}.KFXqYa_prog{background:var(--dsb-3);min-width:0;height:6px;box-shadow:inset 0 0 0 1px var(--ds-border);border-radius:3px;flex:1;overflow:hidden}.KFXqYa_progFill{background:var(--ds-blue);height:calc(100% - 2px);transition:width var(--ds-t-fast);border-radius:2px;margin:1px}.KFXqYa_btn{border:1px solid var(--ds-border);height:28px;color:var(--ds-t-2);cursor:pointer;transition:border-color var(--ds-t-fast), color var(--ds-t-fast), background-color var(--ds-t-fast);background:0 0;border-radius:999px;align-items:center;gap:6px;padding:0 12px;font-size:12px;line-height:16px;display:inline-flex}.KFXqYa_btn:hover{border-color:var(--ds-blue);color:var(--ds-t-1);background:color-mix(in srgb, var(--ds-blue) 12%, transparent)}.KFXqYa_modelTable tbody td:not(:first-child) tbody td:not(:first-child){text-align:right;font-family:var(--mono);font-variant-numeric:tabular-nums;color:var(--ds-t-1)}.KFXqYa_sessionViewer{z-index:30;background:var(--dsb-2);flex-direction:column;gap:10px;padding:20px;display:flex;position:fixed;inset:0;overflow:hidden}.KFXqYa_sessionViewerHead{align-items:center;gap:10px;display:flex}.KFXqYa_sessionViewerTitle{margin:0;font-size:15px;font-weight:600}.KFXqYa_sessionViewerHead .KFXqYa_ubSearch{width:260px;max-width:55%;margin-left:auto}.KFXqYa_sessionViewerList{border:1px solid var(--ds-border);border-radius:var(--ds-r-2,8px);flex:1;min-height:0;overflow:auto}.KFXqYa_dashboard button:focus-visible,.KFXqYa_dashboard input:focus-visible,.KFXqYa_dashboard select:focus-visible,.KFXqYa_dashboard [role=button]:focus-visible,.KFXqYa_dashboard tr[tabindex]:focus-visible,.KFXqYa_trigger:focus-visible,.KFXqYa_railButton:focus-visible{outline:2px solid var(--ds-blue);outline-offset:1px}.KFXqYa_dashboard [hidden]{display:none!important}.KFXqYa_settingsSearch{align-self:stretch;width:100%;max-width:none;margin:0 0 12px}.KFXqYa_modelBudgetList{flex-direction:column;gap:8px;display:flex}.KFXqYa_modelBudgetTitle{color:var(--ds-t-3);font-size:11px;line-height:16px}.KFXqYa_modelBudgetHint{color:var(--ds-t-3);margin:0;font-size:11px;line-height:16px}.KFXqYa_modelBudgetRow{grid-template-columns:minmax(0,1fr) 56px 84px;align-items:center;gap:8px;display:grid}.KFXqYa_modelBudgetName{text-overflow:ellipsis;white-space:nowrap;color:var(--ds-t-2);font-size:12px;line-height:18px;overflow:hidden}.KFXqYa_modelBudgetCost{text-align:right;color:var(--ds-t-3);font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.KFXqYa_helpTip{border:1px solid var(--ds-border);width:14px;height:14px;color:var(--ds-t-3);cursor:help;vertical-align:1px;border-radius:50%;flex:none;justify-content:center;align-items:center;margin-left:6px;font-size:10px;line-height:1;display:inline-flex}.KFXqYa_moreWorkList{flex-direction:column;gap:8px;display:flex}.KFXqYa_moreWorkRow{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);background:var(--dsb-3);color:inherit;transition:border-color var(--ds-t-fast), background-color var(--ds-t-fast);flex-direction:column;gap:2px;padding:10px 12px;text-decoration:none;display:flex}.KFXqYa_moreWorkRow:hover{border-color:var(--ds-border-strong);background:var(--dsb-2)}.KFXqYa_moreWorkName{color:var(--ds-t-1);font-size:12px;font-weight:600;line-height:18px}.KFXqYa_moreWorkRow:hover .KFXqYa_moreWorkName{color:var(--ds-blue)}.KFXqYa_moreWorkDesc{color:var(--ds-t-3);font-size:11px;line-height:16px}.KFXqYa_contextEmpty{color:var(--ds-t-3);margin:8px 0;font-size:12px}.KFXqYa_agentSummary{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);background:var(--dsb-2);flex-wrap:wrap;gap:8px 20px;margin-bottom:10px;padding:10px 12px;display:flex}.KFXqYa_agentSummaryItem{align-items:baseline;gap:5px;display:inline-flex}.KFXqYa_agentSummaryValue{color:var(--ds-t-1);font-variant-numeric:tabular-nums;font-size:15px;font-weight:600}.KFXqYa_agentSummaryLabel{color:var(--ds-t-3);font-size:11px}.KFXqYa_agentTree{flex-direction:column;gap:2px;display:flex}.KFXqYa_agentNode{flex-direction:column;display:flex}.KFXqYa_agentRow{border-radius:var(--ds-r-1);background:var(--dsb-2);align-items:center;gap:8px;padding:5px 8px;display:flex}.KFXqYa_agentKind{color:var(--ds-t-4);flex:none;font-size:10px}.KFXqYa_agentTitle{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--ds-t-1);flex:auto;font-size:12px;overflow:hidden}.KFXqYa_agentCalls{color:var(--ds-t-3);font-variant-numeric:tabular-nums;flex:none;font-size:11px}.KFXqYa_agentCost{color:var(--ds-t-2);font-variant-numeric:tabular-nums;flex:none;font-size:11.5px}.KFXqYa_sessionLink{width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:none;padding:0;display:block}.KFXqYa_sessionLink:hover{color:var(--ds-blue);text-decoration:underline}.KFXqYa_sessionLink:focus-visible{outline:2px solid var(--ds-blue);outline-offset:2px;border-radius:3px}`,document.head.appendChild(e)}var z={affix:`KFXqYa_affix`,agentCalls:`KFXqYa_agentCalls`,agentCost:`KFXqYa_agentCost`,agentKind:`KFXqYa_agentKind`,agentNode:`KFXqYa_agentNode`,agentRow:`KFXqYa_agentRow`,agentSummary:`KFXqYa_agentSummary`,agentSummaryItem:`KFXqYa_agentSummaryItem`,agentSummaryLabel:`KFXqYa_agentSummaryLabel`,agentSummaryValue:`KFXqYa_agentSummaryValue`,agentTitle:`KFXqYa_agentTitle`,agentTree:`KFXqYa_agentTree`,balanceCell:`KFXqYa_balanceCell`,balanceDaysBadge:`KFXqYa_balanceDaysBadge`,balanceDaysBadgeLow:`KFXqYa_balanceDaysBadgeLow`,balanceDetailClose:`KFXqYa_balanceDetailClose`,balanceDetailGrid:`KFXqYa_balanceDetailGrid`,balanceDetailHead:`KFXqYa_balanceDetailHead`,balanceDetailLabel:`KFXqYa_balanceDetailLabel`,balanceDetailPop:`KFXqYa_balanceDetailPop`,balanceDetailRow:`KFXqYa_balanceDetailRow`,balanceDetailTitle:`KFXqYa_balanceDetailTitle`,balanceDetailValue:`KFXqYa_balanceDetailValue`,bandDot:`KFXqYa_bandDot`,bandDotOn:`KFXqYa_bandDotOn`,bandDots:`KFXqYa_bandDots`,"billing-perf":`KFXqYa_billing-perf`,"billing-pg":`KFXqYa_billing-pg`,"billing-settings":`KFXqYa_billing-settings`,"billing-trigger":`KFXqYa_billing-trigger`,btn:`KFXqYa_btn`,bucketCost:`KFXqYa_bucketCost`,bucketOfficial:`KFXqYa_bucketOfficial`,bucketSep:`KFXqYa_bucketSep`,bucketThird:`KFXqYa_bucketThird`,budgetFillOver:`KFXqYa_budgetFillOver`,budgetFillWarn:`KFXqYa_budgetFillWarn`,budgetInput:`KFXqYa_budgetInput`,budgetPulse:`KFXqYa_budgetPulse`,chartArea:`KFXqYa_chartArea`,chartAxisLabel:`KFXqYa_chartAxisLabel`,chartBar:`KFXqYa_chartBar`,chartBarPlaceholder:`KFXqYa_chartBarPlaceholder`,chartCrosshair:`KFXqYa_chartCrosshair`,chartEmpty:`KFXqYa_chartEmpty`,chartGrid:`KFXqYa_chartGrid`,chartHoverDot:`KFXqYa_chartHoverDot`,chartLegend:`KFXqYa_chartLegend`,chartLegendBar:`KFXqYa_chartLegendBar`,chartLegendItem:`KFXqYa_chartLegendItem`,chartLegendItemActive:`KFXqYa_chartLegendItemActive`,chartLegendLine:`KFXqYa_chartLegendLine`,chartLine:`KFXqYa_chartLine`,chartStack:`KFXqYa_chartStack`,chartSvg:`KFXqYa_chartSvg`,chartTooltip:`KFXqYa_chartTooltip`,chartTooltipAlignLeft:`KFXqYa_chartTooltipAlignLeft`,chartTooltipAlignRight:`KFXqYa_chartTooltipAlignRight`,chartTooltipDate:`KFXqYa_chartTooltipDate`,chartTooltipHead:`KFXqYa_chartTooltipHead`,chartTooltipLabel:`KFXqYa_chartTooltipLabel`,chartTooltipModelDetail:`KFXqYa_chartTooltipModelDetail`,chartTooltipRow:`KFXqYa_chartTooltipRow`,chartTooltipSplit:`KFXqYa_chartTooltipSplit`,chartTooltipSwatch:`KFXqYa_chartTooltipSwatch`,chartWrap:`KFXqYa_chartWrap`,closeButton:`KFXqYa_closeButton`,contextEmpty:`KFXqYa_contextEmpty`,ctlCol:`KFXqYa_ctlCol`,ctlGroup:`KFXqYa_ctlGroup`,ctlLabel:`KFXqYa_ctlLabel`,ctlRow:`KFXqYa_ctlRow`,ctlRowStretch:`KFXqYa_ctlRowStretch`,currencyButton:`KFXqYa_currencyButton`,currencyButtonActive:`KFXqYa_currencyButtonActive`,currencyToggle:`KFXqYa_currencyToggle`,dashboard:`KFXqYa_dashboard`,dashboardBody:`KFXqYa_dashboardBody`,dashboardHead:`KFXqYa_dashboardHead`,dashboardIn:`KFXqYa_dashboardIn`,dashboardModal:`KFXqYa_dashboardModal`,dashboardRight:`KFXqYa_dashboardRight`,dashboardSubtitle:`KFXqYa_dashboardSubtitle`,dashboardTitle:`KFXqYa_dashboardTitle`,delta:`KFXqYa_delta`,deltaDown:`KFXqYa_deltaDown`,deltaUp:`KFXqYa_deltaUp`,densityButton:`KFXqYa_densityButton`,densityButtonActive:`KFXqYa_densityButtonActive`,densityButtonComfortable:`KFXqYa_densityButtonComfortable`,densityButtons:`KFXqYa_densityButtons`,densityLeft:`KFXqYa_densityLeft`,densityRow:`KFXqYa_densityRow`,emptyDesc:`KFXqYa_emptyDesc`,emptyDotPulse:`KFXqYa_emptyDotPulse`,emptyIll:`KFXqYa_emptyIll`,emptyIllDot:`KFXqYa_emptyIllDot`,emptyRow:`KFXqYa_emptyRow`,emptyState:`KFXqYa_emptyState`,emptyTitle:`KFXqYa_emptyTitle`,estimatedTag:`KFXqYa_estimatedTag`,exportBar:`KFXqYa_exportBar`,exportButton:`KFXqYa_exportButton`,exportLabel:`KFXqYa_exportLabel`,feeBar:`KFXqYa_feeBar`,feeBarAbove:`KFXqYa_feeBarAbove`,feeChipAlert:`KFXqYa_feeChipAlert`,feeChipError:`KFXqYa_feeChipError`,feeChipOff:`KFXqYa_feeChipOff`,feeChipPrimary:`KFXqYa_feeChipPrimary`,feeCount:`KFXqYa_feeCount`,feeInline:`KFXqYa_feeInline`,feeInlineAlert:`KFXqYa_feeInlineAlert`,feeInlineError:`KFXqYa_feeInlineError`,feeInlineNum:`KFXqYa_feeInlineNum`,feeItem:`KFXqYa_feeItem`,feeNum:`KFXqYa_feeNum`,feeSep:`KFXqYa_feeSep`,feeSuffix:`KFXqYa_feeSuffix`,feeTickFlash:`KFXqYa_feeTickFlash`,flatTag:`KFXqYa_flatTag`,floatModeBtn:`KFXqYa_floatModeBtn`,floatModeBtnOn:`KFXqYa_floatModeBtnOn`,floatSub:`KFXqYa_floatSub`,floatSubHead:`KFXqYa_floatSubHead`,floatSubName:`KFXqYa_floatSubName`,floatSubPlan:`KFXqYa_floatSubPlan`,floatTarget:`KFXqYa_floatTarget`,floatTargetLabel:`KFXqYa_floatTargetLabel`,healthBad:`KFXqYa_healthBad`,healthBadge:`KFXqYa_healthBadge`,healthBadgeBad:`KFXqYa_healthBadgeBad`,healthBadgeOk:`KFXqYa_healthBadgeOk`,healthDot:`KFXqYa_healthDot`,healthIdle:`KFXqYa_healthIdle`,healthOk:`KFXqYa_healthOk`,heatmap:`KFXqYa_heatmap`,heatmapCell:`KFXqYa_heatmapCell`,heatmapCellEmpty:`KFXqYa_heatmapCellEmpty`,heatmapFooter:`KFXqYa_heatmapFooter`,heatmapGrid:`KFXqYa_heatmapGrid`,heatmapHalf:`KFXqYa_heatmapHalf`,heatmapHover:`KFXqYa_heatmapHover`,heatmapLegend:`KFXqYa_heatmapLegend`,heatmapRangeButton:`KFXqYa_heatmapRangeButton`,heatmapRangeButtonActive:`KFXqYa_heatmapRangeButtonActive`,heatmapRangeSwitch:`KFXqYa_heatmapRangeSwitch`,heatmapYear:`KFXqYa_heatmapYear`,heatmapYearBody:`KFXqYa_heatmapYearBody`,heatmapYearCell:`KFXqYa_heatmapYearCell`,heatmapYearGrid:`KFXqYa_heatmapYearGrid`,heatmapYearMonth:`KFXqYa_heatmapYearMonth`,heatmapYearMonths:`KFXqYa_heatmapYearMonths`,heatmapYearScroll:`KFXqYa_heatmapYearScroll`,heatmapYearWeekday:`KFXqYa_heatmapYearWeekday`,heatmapYearWeekdays:`KFXqYa_heatmapYearWeekdays`,helpTip:`KFXqYa_helpTip`,hero:`KFXqYa_hero`,heroCurrency:`KFXqYa_heroCurrency`,heroGauge:`KFXqYa_heroGauge`,heroGaugeArc:`KFXqYa_heroGaugeArc`,heroGaugeArcOver:`KFXqYa_heroGaugeArcOver`,heroGaugeCenter:`KFXqYa_heroGaugeCenter`,heroGaugeDial:`KFXqYa_heroGaugeDial`,heroGaugeLabel:`KFXqYa_heroGaugeLabel`,heroGaugeRemain:`KFXqYa_heroGaugeRemain`,heroGaugeRemainOver:`KFXqYa_heroGaugeRemainOver`,heroGaugeSub:`KFXqYa_heroGaugeSub`,heroGaugeSvg:`KFXqYa_heroGaugeSvg`,heroGaugeTrack:`KFXqYa_heroGaugeTrack`,heroLabel:`KFXqYa_heroLabel`,heroMain:`KFXqYa_heroMain`,heroMeta:`KFXqYa_heroMeta`,heroPred:`KFXqYa_heroPred`,heroReadout:`KFXqYa_heroReadout`,heroSide:`KFXqYa_heroSide`,heroSideItem:`KFXqYa_heroSideItem`,heroSideLabel:`KFXqYa_heroSideLabel`,heroSideSpacer:`KFXqYa_heroSideSpacer`,heroSideValue:`KFXqYa_heroSideValue`,heroTop:`KFXqYa_heroTop`,heroValue:`KFXqYa_heroValue`,inp:`KFXqYa_inp`,kindBadge:`KFXqYa_kindBadge`,kindBadgeRelay:`KFXqYa_kindBadgeRelay`,kindBadgeUnknown:`KFXqYa_kindBadgeUnknown`,kpiCustomRange:`KFXqYa_kpiCustomRange`,kpiDelta:`KFXqYa_kpiDelta`,kpiDeltaDown:`KFXqYa_kpiDeltaDown`,kpiDeltaFlat:`KFXqYa_kpiDeltaFlat`,kpiDeltaUp:`KFXqYa_kpiDeltaUp`,kpiDetail:`KFXqYa_kpiDetail`,kpiGreen:`KFXqYa_kpiGreen`,kpiGrid:`KFXqYa_kpiGrid`,kpiLabel:`KFXqYa_kpiLabel`,kpiLabelRow:`KFXqYa_kpiLabelRow`,kpiSpark:`KFXqYa_kpiSpark`,kpiTile:`KFXqYa_kpiTile`,kpiValue:`KFXqYa_kpiValue`,kpiZone:`KFXqYa_kpiZone`,kpiZoneHead:`KFXqYa_kpiZoneHead`,kpiZoneLabel:`KFXqYa_kpiZoneLabel`,metricCell:`KFXqYa_metricCell`,metricGrid:`KFXqYa_metricGrid`,metricLabel:`KFXqYa_metricLabel`,metricValue:`KFXqYa_metricValue`,metricValueSuccess:`KFXqYa_metricValueSuccess`,modalFooter:`KFXqYa_modalFooter`,modelBudgetCost:`KFXqYa_modelBudgetCost`,modelBudgetHint:`KFXqYa_modelBudgetHint`,modelBudgetList:`KFXqYa_modelBudgetList`,modelBudgetName:`KFXqYa_modelBudgetName`,modelBudgetRow:`KFXqYa_modelBudgetRow`,modelBudgetTitle:`KFXqYa_modelBudgetTitle`,modelCell:`KFXqYa_modelCell`,modelDot:`KFXqYa_modelDot`,modelName:`KFXqYa_modelName`,modelProvider:`KFXqYa_modelProvider`,modelRowActive:`KFXqYa_modelRowActive`,modelRowFocusable:`KFXqYa_modelRowFocusable`,modelTable:`KFXqYa_modelTable`,moreWorkDesc:`KFXqYa_moreWorkDesc`,moreWorkList:`KFXqYa_moreWorkList`,moreWorkName:`KFXqYa_moreWorkName`,moreWorkRow:`KFXqYa_moreWorkRow`,na:`KFXqYa_na`,nativeSettingsBody:`KFXqYa_nativeSettingsBody`,nativeSettingsDashboard:`KFXqYa_nativeSettingsDashboard`,nativeSettingsLayout:`KFXqYa_nativeSettingsLayout`,nativeSettingsRoot:`KFXqYa_nativeSettingsRoot`,noticeDismiss:`KFXqYa_noticeDismiss`,numCol:`KFXqYa_numCol`,offPeak:`KFXqYa_offPeak`,panel:`KFXqYa_panel`,panelHead:`KFXqYa_panelHead`,panelHeadControls:`KFXqYa_panelHeadControls`,panelHint:`KFXqYa_panelHint`,panelTitle:`KFXqYa_panelTitle`,peak:`KFXqYa_peak`,peakAlertIn:`KFXqYa_peakAlertIn`,peakAlertPop:`KFXqYa_peakAlertPop`,peakCard:`KFXqYa_peakCard`,peakCardCenter:`KFXqYa_peakCardCenter`,peakCardCorner:`KFXqYa_peakCardCorner`,peakCardOff:`KFXqYa_peakCardOff`,peakCardPeak:`KFXqYa_peakCardPeak`,peakClose:`KFXqYa_peakClose`,peakCount:`KFXqYa_peakCount`,peakCountPrimary:`KFXqYa_peakCountPrimary`,peakCountSuccess:`KFXqYa_peakCountSuccess`,peakDesc:`KFXqYa_peakDesc`,peakDot:`KFXqYa_peakDot`,peakDotPrimary:`KFXqYa_peakDotPrimary`,peakDotSuccess:`KFXqYa_peakDotSuccess`,peakHead:`KFXqYa_peakHead`,peakTag:`KFXqYa_peakTag`,peakTagPrimary:`KFXqYa_peakTagPrimary`,peakTagSuccess:`KFXqYa_peakTagSuccess`,perfBar:`KFXqYa_perfBar`,perfChip:`KFXqYa_perfChip`,perfChipDot:`KFXqYa_perfChipDot`,perfChipOff:`KFXqYa_perfChipOff`,perfChips:`KFXqYa_perfChips`,perfCompareBar:`KFXqYa_perfCompareBar`,perfCompareDot:`KFXqYa_perfCompareDot`,perfCompareList:`KFXqYa_perfCompareList`,perfCompareName:`KFXqYa_perfCompareName`,perfCompareNum:`KFXqYa_perfCompareNum`,perfCompareRow:`KFXqYa_perfCompareRow`,perfHero:`KFXqYa_perfHero`,perfHeroBar:`KFXqYa_perfHeroBar`,perfHeroCell:`KFXqYa_perfHeroCell`,perfHeroLbl:`KFXqYa_perfHeroLbl`,perfHeroUnit:`KFXqYa_perfHeroUnit`,perfHeroVal:`KFXqYa_perfHeroVal`,planTag:`KFXqYa_planTag`,planTagBadge:`KFXqYa_planTagBadge`,plgDesc:`KFXqYa_plgDesc`,plgGrid:`KFXqYa_plgGrid`,plgHead:`KFXqYa_plgHead`,plgIcon:`KFXqYa_plgIcon`,plgItem:`KFXqYa_plgItem`,plgLabel:`KFXqYa_plgLabel`,plgLink:`KFXqYa_plgLink`,plgName:`KFXqYa_plgName`,plgNameRow:`KFXqYa_plgNameRow`,plgTag:`KFXqYa_plgTag`,plgTitle:`KFXqYa_plgTitle`,plgVal:`KFXqYa_plgVal`,popDot:`KFXqYa_popDot`,popDotDirect:`KFXqYa_popDotDirect`,popDotNeutral:`KFXqYa_popDotNeutral`,popDotSub:`KFXqYa_popDotSub`,popHead:`KFXqYa_popHead`,popModel:`KFXqYa_popModel`,popModelLabel:`KFXqYa_popModelLabel`,popModelName:`KFXqYa_popModelName`,popModelRow:`KFXqYa_popModelRow`,popModelStatus:`KFXqYa_popModelStatus`,popModelStatusLow:`KFXqYa_popModelStatusLow`,popTagPrimary:`KFXqYa_popTagPrimary`,popTagSub:`KFXqYa_popTagSub`,popTitle:`KFXqYa_popTitle`,prog:`KFXqYa_prog`,progFill:`KFXqYa_progFill`,providerCtlRow:`KFXqYa_providerCtlRow`,providerGroup:`KFXqYa_providerGroup`,providerGroupBadge:`KFXqYa_providerGroupBadge`,providerGroupBalance:`KFXqYa_providerGroupBalance`,providerGroupBalanceLabel:`KFXqYa_providerGroupBalanceLabel`,providerGroupCollapsible:`KFXqYa_providerGroupCollapsible`,providerGroupCost:`KFXqYa_providerGroupCost`,providerGroupCostLabel:`KFXqYa_providerGroupCostLabel`,providerGroupCostValue:`KFXqYa_providerGroupCostValue`,providerGroupHead:`KFXqYa_providerGroupHead`,providerGroupList:`KFXqYa_providerGroupList`,providerGroupMeta:`KFXqYa_providerGroupMeta`,providerGroupName:`KFXqYa_providerGroupName`,providerGroupRecharge:`KFXqYa_providerGroupRecharge`,providerGroupTitle:`KFXqYa_providerGroupTitle`,providerStatCell:`KFXqYa_providerStatCell`,providerStatLbl:`KFXqYa_providerStatLbl`,providerStatRow:`KFXqYa_providerStatRow`,providerStatSub:`KFXqYa_providerStatSub`,providerStatVal:`KFXqYa_providerStatVal`,providerTodayToggle:`KFXqYa_providerTodayToggle`,railButton:`KFXqYa_railButton`,rangeButton:`KFXqYa_rangeButton`,rangeButtonActive:`KFXqYa_rangeButtonActive`,rangeToggle:`KFXqYa_rangeToggle`,rdo:`KFXqYa_rdo`,rdoChevron:`KFXqYa_rdoChevron`,rdoChevronOpen:`KFXqYa_rdoChevronOpen`,rdoDot:`KFXqYa_rdoDot`,rdoLabel:`KFXqYa_rdoLabel`,rdoRow:`KFXqYa_rdoRow`,rdoSelect:`KFXqYa_rdoSelect`,reconcileDismiss:`KFXqYa_reconcileDismiss`,reconcileIcon:`KFXqYa_reconcileIcon`,reconcileNotice:`KFXqYa_reconcileNotice`,reconcileText:`KFXqYa_reconcileText`,rounds:`KFXqYa_rounds`,roundsAxis:`KFXqYa_roundsAxis`,roundsBar:`KFXqYa_roundsBar`,roundsBarCol:`KFXqYa_roundsBarCol`,roundsBarColOff:`KFXqYa_roundsBarColOff`,roundsBarColPeak:`KFXqYa_roundsBarColPeak`,roundsBarFlagged:`KFXqYa_roundsBarFlagged`,roundsBarLabel:`KFXqYa_roundsBarLabel`,roundsBarWrap:`KFXqYa_roundsBarWrap`,roundsBars:`KFXqYa_roundsBars`,roundsEmpty:`KFXqYa_roundsEmpty`,roundsFlagMark:`KFXqYa_roundsFlagMark`,sessionChildRow:`KFXqYa_sessionChildRow`,sessionGroupRow:`KFXqYa_sessionGroupRow`,sessionLink:`KFXqYa_sessionLink`,sessionSubDeepRow:`KFXqYa_sessionSubDeepRow`,sessionViewer:`KFXqYa_sessionViewer`,sessionViewerHead:`KFXqYa_sessionViewerHead`,sessionViewerList:`KFXqYa_sessionViewerList`,sessionViewerTitle:`KFXqYa_sessionViewerTitle`,setCard:`KFXqYa_setCard`,setCardDesc:`KFXqYa_setCardDesc`,setCardHead:`KFXqYa_setCardHead`,setCardMeta:`KFXqYa_setCardMeta`,setCardTitle:`KFXqYa_setCardTitle`,setCell:`KFXqYa_setCell`,setGrid2:`KFXqYa_setGrid2`,setGrid3:`KFXqYa_setGrid3`,settingsLayout:`KFXqYa_settingsLayout`,settingsNav:`KFXqYa_settingsNav`,settingsNavIcon:`KFXqYa_settingsNavIcon`,settingsNavItem:`KFXqYa_settingsNavItem`,settingsNavItemActive:`KFXqYa_settingsNavItemActive`,settingsNavItemAdvanced:`KFXqYa_settingsNavItemAdvanced`,settingsPane:`KFXqYa_settingsPane`,settingsSearch:`KFXqYa_settingsSearch`,shareDot:`KFXqYa_shareDot`,shareItem:`KFXqYa_shareItem`,shareLegend:`KFXqYa_shareLegend`,shareSeg:`KFXqYa_shareSeg`,shareSegAssistant:`KFXqYa_shareSegAssistant`,shareSegOff:`KFXqYa_shareSegOff`,shareSegPeak:`KFXqYa_shareSegPeak`,shareSegTool:`KFXqYa_shareSegTool`,shareSegUser:`KFXqYa_shareSegUser`,shareTrack:`KFXqYa_shareTrack`,shareValue:`KFXqYa_shareValue`,siteKindDirect:`KFXqYa_siteKindDirect`,siteKindSite:`KFXqYa_siteKindSite`,siteKindTag:`KFXqYa_siteKindTag`,siteKindUnknown:`KFXqYa_siteKindUnknown`,siteRow:`KFXqYa_siteRow`,siteRowCalls:`KFXqYa_siteRowCalls`,siteRowCallsLow:`KFXqYa_siteRowCallsLow`,siteRowCost:`KFXqYa_siteRowCost`,siteRowMeta:`KFXqYa_siteRowMeta`,siteRowName:`KFXqYa_siteRowName`,siteRowTitle:`KFXqYa_siteRowTitle`,soon:`KFXqYa_soon`,staleNotice:`KFXqYa_staleNotice`,staleNoticeBody:`KFXqYa_staleNoticeBody`,staleNoticeSub:`KFXqYa_staleNoticeSub`,subscriptionAuto:`KFXqYa_subscriptionAuto`,subscriptionCard:`KFXqYa_subscriptionCard`,subscriptionCardUpgraded:`KFXqYa_subscriptionCardUpgraded`,subscriptionExhausted:`KFXqYa_subscriptionExhausted`,subscriptionFill:`KFXqYa_subscriptionFill`,subscriptionFillOver:`KFXqYa_subscriptionFillOver`,subscriptionFillWarn:`KFXqYa_subscriptionFillWarn`,subscriptionGrid:`KFXqYa_subscriptionGrid`,subscriptionHead:`KFXqYa_subscriptionHead`,subscriptionMeta:`KFXqYa_subscriptionMeta`,subscriptionName:`KFXqYa_subscriptionName`,subscriptionPct:`KFXqYa_subscriptionPct`,subscriptionPlan:`KFXqYa_subscriptionPlan`,subscriptionReset:`KFXqYa_subscriptionReset`,subscriptionStatus:`KFXqYa_subscriptionStatus`,subscriptionTier:`KFXqYa_subscriptionTier`,subscriptionTrack:`KFXqYa_subscriptionTrack`,subscriptionWindow:`KFXqYa_subscriptionWindow`,subscriptionWindowLabel:`KFXqYa_subscriptionWindowLabel`,switch:`KFXqYa_switch`,switchKnob:`KFXqYa_switchKnob`,switchOn:`KFXqYa_switchOn`,tabBadge:`KFXqYa_tabBadge`,tabBadgeHot:`KFXqYa_tabBadgeHot`,tabBadgeViolet:`KFXqYa_tabBadgeViolet`,tabBadgeWarn:`KFXqYa_tabBadgeWarn`,tabButton:`KFXqYa_tabButton`,tabButtonActive:`KFXqYa_tabButtonActive`,tabNav:`KFXqYa_tabNav`,tabNavLabel:`KFXqYa_tabNavLabel`,tabPanel:`KFXqYa_tabPanel`,tabPanelIn:`KFXqYa_tabPanelIn`,tabRail:`KFXqYa_tabRail`,tabRailIcon:`KFXqYa_tabRailIcon`,tabRailItem:`KFXqYa_tabRailItem`,tabRailItemActive:`KFXqYa_tabRailItemActive`,tabRailLabel:`KFXqYa_tabRailLabel`,tableScroll:`KFXqYa_tableScroll`,tokenModelBar:`KFXqYa_tokenModelBar`,tokenModelPartIn:`KFXqYa_tokenModelPartIn`,tokenModelPartOut:`KFXqYa_tokenModelPartOut`,tokenModelParts:`KFXqYa_tokenModelParts`,tokenModelShareRow:`KFXqYa_tokenModelShareRow`,tokenPanel:`KFXqYa_tokenPanel`,trigger:`KFXqYa_trigger`,triggerBudgetHot:`KFXqYa_triggerBudgetHot`,triggerBudgetOver:`KFXqYa_triggerBudgetOver`,triggerBudgetPulse:`KFXqYa_triggerBudgetPulse`,triggerDelta:`KFXqYa_triggerDelta`,triggerDeltaDown:`KFXqYa_triggerDeltaDown`,triggerDeltaUp:`KFXqYa_triggerDeltaUp`,triggerGaugeArc:`KFXqYa_triggerGaugeArc`,triggerGaugeNeedle:`KFXqYa_triggerGaugeNeedle`,triggerGlow:`KFXqYa_triggerGlow`,triggerGlowPulse:`KFXqYa_triggerGlowPulse`,triggerIcon:`KFXqYa_triggerIcon`,triggerLabel:`KFXqYa_triggerLabel`,triggerMain:`KFXqYa_triggerMain`,triggerMetric:`KFXqYa_triggerMetric`,triggerPop:`KFXqYa_triggerPop`,triggerPopEmpty:`KFXqYa_triggerPopEmpty`,triggerPopShown:`KFXqYa_triggerPopShown`,triggerPopSwitchCount:`KFXqYa_triggerPopSwitchCount`,triggerPopSwitcher:`KFXqYa_triggerPopSwitcher`,triggerPrimary:`KFXqYa_triggerPrimary`,triggerScan:`KFXqYa_triggerScan`,triggerSpark:`KFXqYa_triggerSpark`,triggerSparkBar:`KFXqYa_triggerSparkBar`,triggerSparkBreath:`KFXqYa_triggerSparkBreath`,triggerSparkHot:`KFXqYa_triggerSparkHot`,triggerValueRow:`KFXqYa_triggerValueRow`,triggerWrap:`KFXqYa_triggerWrap`,triggerYen:`KFXqYa_triggerYen`,ubAlert:`KFXqYa_ubAlert`,ubAlertLeft:`KFXqYa_ubAlertLeft`,ubAlertNote:`KFXqYa_ubAlertNote`,ubCard:`KFXqYa_ubCard`,ubCardControlGroup:`KFXqYa_ubCardControlGroup`,ubCardHead:`KFXqYa_ubCardHead`,ubCardSub:`KFXqYa_ubCardSub`,ubCardTitle:`KFXqYa_ubCardTitle`,ubChipLabel:`KFXqYa_ubChipLabel`,ubChipOff:`KFXqYa_ubChipOff`,ubChipPeak:`KFXqYa_ubChipPeak`,ubExtraName:`KFXqYa_ubExtraName`,ubExtraNote:`KFXqYa_ubExtraNote`,ubExtraRow:`KFXqYa_ubExtraRow`,ubModel:`KFXqYa_ubModel`,ubModelName:`KFXqYa_ubModelName`,ubNotes:`KFXqYa_ubNotes`,ubNotesDesc:`KFXqYa_ubNotesDesc`,ubNotesItem:`KFXqYa_ubNotesItem`,ubNotesTerm:`KFXqYa_ubNotesTerm`,ubRate:`KFXqYa_ubRate`,ubSearch:`KFXqYa_ubSearch`,ubTable:`KFXqYa_ubTable`,ubTablewrap:`KFXqYa_ubTablewrap`,ubTag:`KFXqYa_ubTag`,ubTagAlert:`KFXqYa_ubTagAlert`,ubTagError:`KFXqYa_ubTagError`,ubTagNeutral:`KFXqYa_ubTagNeutral`,ubTagPromo:`KFXqYa_ubTagPromo`,ubTagSuccess:`KFXqYa_ubTagSuccess`,uncataloguedTag:`KFXqYa_uncataloguedTag`,unknownHint:`KFXqYa_unknownHint`,unpricedHint:`KFXqYa_unpricedHint`,unpricedHintBody:`KFXqYa_unpricedHintBody`,userPriceBody:`KFXqYa_userPriceBody`,userPriceCheck:`KFXqYa_userPriceCheck`,userPriceField:`KFXqYa_userPriceField`,userPriceInput:`KFXqYa_userPriceInput`,userPriceInputNum:`KFXqYa_userPriceInputNum`,userPriceLineMeta:`KFXqYa_userPriceLineMeta`,userPricePriceLine:`KFXqYa_userPricePriceLine`,userPriceRow:`KFXqYa_userPriceRow`};let B=`usageBilling`,V={title:`使用统计`,cost:`费用`,todayCost:`今日费用`,monthCost:`本月费用`,yearCost:`本年费用`,monthProjected:`本月预计`,monthProjectedHint:`本月已发生 + 近 7 天节奏 × 剩余天数`,liveTurn:`本轮`,liveSession:`会话`,liveSessionSub:`含子 {cost}`,calls:`调用`,cacheHitRate:`缓存命中率`,tokens:`Token`,inputTokens:`输入`,outputTokens:`输出`,avgCost:`平均成本`,kpiRange:`统计范围`,avgRangeToday:`今日`,avgRange7d:`近7天`,avgRangeWeek:`本周`,avgRangeMonth:`本月`,avgRangeAll:`累计`,avgRangeCustom:`自定义`,customRangeStart:`开始日期`,customRangeEnd:`结束日期`,trend:`每日费用与调用趋势`,trend7d:`7 天`,trend30d:`30 天`,trendMetric:`趋势指标`,trendMetricCost:`费用`,trendMetricTokens:`Token`,pricingSearch:`搜索模型 / 厂商`,bandPinHint:`点击固定到输入框`,trendEmpty:`暂无趋势数据`,trendTotal:`总计`,roundsUnit:`轮`,healthModelsLive:`{n} 模型可用`,healthVendorsDown:`{n} 厂商失效`,healthVendorsUnavailable:`{n} 厂商不可用`,budget:`本月预算`,budgetRemain:`剩余预算`,budgetAmount:`预算金额`,budgetSummary:`本月已用 {used} / {total};达到 80% 时提醒,达到 100% 时红色脉冲警示`,sessions:`会话明细`,sessionTitle:`标题`,lastActive:`最后活跃`,sessionOverflow:`仅显示花费前 {limit} 个,共 {total} 个会话`,budgetTierBody:`本月花费 {cost} 已达预算 {budget} 的 {pct}%`,models:`模型计费明细`,providerBilling:`提供商计费与订阅`,channelUnknown:`未知路由`,directTag:`直连`,relayTag:`中转`,unknownTag:`未知`,unknownChannelHint:`通道未在插件配置中注册,支出主体无法核实,费用不计入口径,仅统计用量。`,planCountUnit:`套餐`,actual:`实际`,pricing:`模型单价表`,input:`输入`,output:`输出`,cacheHit:`缓存命中`,peak:`高峰`,offPeak:`低谷`,flat:`全天统一`,band:`时段`,close:`关闭`,footer:`每 30s 自动轮询 · 仅统计本机 dsh 会话`,footerCredit:`dsh-ui-usage-billing {version} · MIT`,lastUpdated:`数据更新于`,noData:`暂无计费数据`,todayRate:`今日汇率`,rateLive:`实时`,rateBuiltin:`内置`,pricingSyncedAt:`上次同步`,pricingSyncNow:`立即同步`,pricingSyncing:`同步中…`,promoBadge:`促`,promoUntil:`促销价至 {date},之后自动恢复刊例价`,promoOpenEnded:`厂商未公布截止时间,当前按折扣计价;公告截止后自动恢复刊例价`,pricingTip:`DeepSeek 现行刊例:V4.1 Flash 谷档 未命中 ¥1 / 缓存命中 ¥0.02 / 输出 ¥4;V4 Pro 谷档 未命中 ¥4.5 / 缓存命中 ¥0.15 / 输出 ¥13.5;峰价均为谷价 × 2。工作日 9-12 / 14-18 为高峰价,其余时段(含周末全天)为低谷价;费用按调用时刻计。`,pricingUnit:`单位:人民币 / 每百万 Token`,pricingNotes:`计价说明`,ubPeak:`峰`,ubOff:`谷`,ubStd:`标准`,peakBand:`峰谷分带`,pricingSource:`数据来源`,noteCache:`命中部分按缓存价计费,显著降低成本。`,noteBand:`高峰与空闲时段单价不同,空闲约半价。`,noteSource:`价格来自实时汇率 + 模型定价目录,未收录模型按 0 计并提示。`,balance:`余额`,recharge:`充值`,rechargeHint:`打开该厂商官方平台的充值页`,balanceUnconfigured:`未配置`,balanceUnauthorized:`密钥无效`,balanceUnreachable:`查询失败`,uncatalogued:`未收录`,estimatedPricing:`估算价`,balanceDays:`约可撑 {days} 天`,balanceLowBody:`{name} 余额 {balance},约可撑 {days} 天,请及时充值`,reconcileDrift:`系统监控到{provider}官方余额变动 {spent},本面板记录 {today},差额通常由其它工具或 API 的消耗所致`,reconcileDismiss:`知道了`,subscriptionNotConfigured:`未配置密钥`,subscriptionUnauthorized:`密钥无效`,subscriptionUnavailable:`查询失败`,subscriptionInvalid:`响应异常`,subscriptionRateLimited:`触发限流`,subscriptionSession:`本次`,subscriptionWeekly:`本周`,subscriptionMonthly:`本月`,subscriptionBilling:`计费周期`,subscriptionRemaining:`剩余 {pct}%`,subscriptionExhausted:`已用尽`,subscriptionReset:`{date} 重置`,subscriptionNoApi:`该厂商暂未提供用量查询接口`,floatWindow:`模型用量悬浮窗`,floatModeCombined:`综合`,floatModeSubscription:`订阅卡`,floatMode:`展示模式`,floatTargets:`订阅目标`,floatWindowHint:`悬浮在左下角计费卡上的用量速览;综合=当前样式,订阅卡=每次展示一张订阅额度卡(可切换)。`,floatPrimaryToday:`今日`,floatPrimaryWeek:`本周`,floatPrimaryMonth:`本月`,cardDisplay:`计费卡显示`,cardDisplayHint:`选择侧栏入口的占用方式,并切换主指标与统计范围;完全隐藏后可从宿主设置或 /usage 恢复。隐藏不会停止统计或提醒。`,cardMode:`侧栏入口`,cardModeFull:`完整卡片`,cardModeCompact:`紧凑图标`,cardModeHidden:`完全隐藏`,cardModeHiddenHint:`恢复显示:打开宿主设置 → 用量与费用 → 完整卡片;也可通过 /usage 打开仪表盘后恢复。`,cardModeFallback:`当前宿主没有原生设置页或 /usage 入口,完全隐藏已降级为紧凑图标,避免仪表盘无法打开。`,nativeSettingsNav:`用量与费用`,nativeSettingsIntro:`管理侧栏计费入口的显示方式。修改即时生效,并与仪表盘内的设置同步。`,nativeSettingsHiddenHint:`侧栏入口当前已隐藏。选择「完整卡片」或「紧凑图标」即可恢复;统计与提醒一直保持运行。`,cardMetric:`主指标`,cardMetricMoney:`金额`,cardMetricTokens:`Token`,cardSpan:`统计范围`,cardSpanDay:`日`,cardSpanWeek:`周`,cardSpanMonth:`月`,cardDeltaBadge:`今日环比徽章`,cardDeltaShow:`显示`,cardDeltaHide:`隐藏`,floatNoTargets:`未指定订阅通道,请在设置中勾选要展示的订阅。`,floatNoTargetsHint:`暂无可选的订阅通道。`,subscriptionsStale:`订阅额度刷新失败,以下为缓存数据`,balanceStaleNotice:`余额刷新较慢,以下为上一次查询结果`,staleLedgerNotice:`{count} 个会话出自旧版算法存档(日志已删,无法重算),模型归属可能有误差`,staleSnapshotNotice:`用量正在重算,以下数据来自上一次计算(可能不是最新,会话标题等以工作区为准)`,unreadableNotice:`{count} 个会话的用量未完整计入(原始日志未动,不会丢失)`,unreadableNoLedgerNotice:`其中 {count} 个无历史存档,用量完全未计入`,unreadableFormatNotice:`其中 {count} 个因会话格式不受当前宿主支持:过新格式升级宿主后自动恢复,过旧格式(如 v0/v3)需先迁移`,tokenCacheWrite:`写入`,toolRank:`工具排行`,toolName:`工具`,userPrices:`自定义单价`,userPricesHint:`为未收录或变价模型填入实付单价,总览与日趋势按此重估;模型可用下拉候选(目录键或模型 id);来源留空=该模型默认价,填入中转站域名=仅该来源的同名模型用此价(协议可省);低谷价三栏填后按峰/谷混合估算,留空=平档`,userPriceSave:`保存`,userPriceModel:`模型`,userPriceSource:`来源(中转站域名)`,userPriceSourceHint:`留空=默认价,或 https://api.中转站.com`,userPriceOffPeak:`低谷价`,userPriceNormal:`标准价`,userPriceCurrency:`币种`,userPriceAdd:`新增`,userPriceRemoveSelected:`删除所选`,userPriceSelect:`选择此行`,sessionStaleBadge:`旧版统计`,sessionUntitled:`未命名会话`,sessionSubCost:`含子智能体 {cost}`,sessionSubCalls:`含子智能体 {calls} 次调用`,sessionSubRow:`子智能体`,heatmapLess:`少`,heatmapMore:`多`,currency:`币种`,currencyCny:`人民币`,currencyUsd:`美元`,currencyEur:`欧元`,language:`界面语言`,heatmap:`用量热力图`,rounds:`每轮费用`,roundsHint:`最近 {count} 轮 · 柱顶为金额 · 底色为峰谷时段`,anomaly:`成本突增`,model:`模型`,thModel:`模型名称`,thInputMiss:`输入缓存未命中`,thInputHit:`输入缓存命中`,costAbbr:`费用`,tabOverview:`概览`,tabTrends:`趋势`,tabProviders:`账单`,tabPricing:`费率`,tabSettings:`设置`,budgetHint:`设置月度上限,用于本月预计与超支分段提醒`,peakAlertHint:`在切档前弹窗提醒,可选同步系统通知`,peakAlertDescPeak:`即将进入高峰时段,价格将上调,请提前安排长任务`,peakAlertDescOff:`即将进入平价时段,价格减半,适合运行大批量任务`,peakAlertDescPeakZhipu:`即将进入高峰时段(工作日 14:00–18:00),Coding Plan 额度将按基础积分全额抵扣`,peakAlertDescOffZhipu:`即将进入非高峰时段,Coding Plan 额度按基础积分 5 折抵扣`,peakAlertQueuePeak:`{count} 个排队任务将等待下一低谷;已开始任务继续执行`,peakAlertQueueOff:`{count} 个排队任务将按顺序启动`,export:`导出`,exportCsvDay:`按日 CSV`,exportCsvSession:`按会话 CSV`,exportJson:`全量 JSON`,peakShare:`峰谷时段占比`,peakSharePerCall:`按调用时刻精确判档`,offPeakSavings:`挪谷可省约 {amount}`,perfMax:`最大 TTFT`,weekCost:`本周消耗金额`,roleCost:`费用构成`,roleUser:`用户输入`,roleAssistant:`助手输出`,roleTool:`工具结果`,roleHint:`估算:输出按实测计价,输入按消息长度摊分`,tierPeak:`峰时`,tierOff:`平价`,tierToPeak:`后转峰时`,tierToOff:`后转平价`,tierAlertEnterPeak:`{minutes} 分钟后进入峰时(DeepSeek 高峰价 ×2),不急的调用可稍等`,tierAlertEnterOff:`{minutes} 分钟后进入平价(价格减半)`,tierAlertEnterPeakZhipu:`{minutes} 分钟后进入智谱高峰时段,Coding Plan 额度将全额抵扣`,tierAlertEnterOffZhipu:`{minutes} 分钟后进入智谱非高峰时段,额度按基础积分 5 折抵扣`,peakAlertTitlePeak:`即将进入高峰价`,peakAlertTitleOff:`即将进入平价`,peakAlert:`峰谷切换提醒`,peakAlertLeadMin:`提前量(分钟)`,peakAlertPos:`位置`,peakAlertMode:`提醒模式`,peakAlertPosCorner:`右下角`,peakAlertPosCenter:`屏幕居中`,peakAlertModePeak:`仅进入峰时`,peakAlertModeOff:`仅进入平价`,peakAlertModeBoth:`峰与谷都提醒`,peakAlertWebNotify:`同时发系统通知`,peakAlertPreview:`预览提醒`,planTypeCode:`订阅制`,planTypeToken:`按量`,subscriptionFeePerMonth:`{amount}/月`,triggerToday:`今日消耗金额`,triggerMonth:`当月消耗金额`,triggerMonthTokens:`当月消耗 Token`,triggerTodayTokens:`今日消耗 Token`,triggerWeekTokens:`本周消耗 Token`,subscriptionTag:`订阅`,cellEstimateHint:`本行无按量扣费记录(订阅通道不逐次计费),金额按目录价估算`,free:`免费`,perfSamples:`样本`,perfTtft:`首字延时`,perfP50:`P50`,perfP90:`P90`,perfTps:`生成速度`,perfLatency:`总延迟`,perfEstimated:`估算样本`,perfEmpty:`暂无性能数据`,perfTpsUnit:`tok/s`,perfTitle:`性能`,perfHint:`按模型与按小时聚合;估算样本为工具续写步骤`,perfAll:`全选`,perfChartEmpty:`未选择模型或该指标暂无数据`,heatmapYear:`年`,heatmapHalf:`半年`,heatmapMonth:`月`,metricCost:`费用`,metricTokens:`Token`,heatmapTotal:`合计`,activeDays:`活跃天数`,streakDays:`连续使用`,subscriptionAutoDetect:`自动识别`,pluginAuthor:`作者`,pluginRepository:`仓库`,pluginNpm:`npm`,pluginLicense:`许可证`,tabToken:`用量`,tokenExport:`导出 Token`,tokenExportCsv:`按日 Token CSV`,tokenReasoningShare:`思考占比`,tokenReasoningShort:`思考`,tokenIo:`输入/输出比`,tokenPeak:`峰值日`,tokenDaily:`每日 Token`,tokenByModel:`模型 Token`,tokenMiss:`输入(缓存未命中)`,tokenHit:`输入(缓存命中)`,tokenOutput:`输出`,densityLabel:`显示密度`,densityHint:`紧凑减小行高与留白,舒适加大;切换即时生效`,densityCompact:`紧凑`,densityDefault:`默认`,densityComfortable:`舒适`,motionLabel:`动效强度`,motionHint:`关闭后所有入场与数据更新动画静止,保留基础交互反馈`,motionOff:`关闭`,motionSubtle:`克制`,motionRich:`丰富`,settingsNavDisplayPref:`偏好`,settingsNavBudget:`预算`,settingsNavAlert:`提醒`,settingsNavDisplay:`显示`,settingsNavAdvanced:`高级`,settingsNavAbout:`关于`,settingsSearchPlaceholder:`搜索设置…(如:预算、峰谷、单价)`,settingsSearchEmpty:`没有匹配「{query}」的设置项`,sessionsViewAll:`查看全部 {count} 个会话`,sessionViewerSearch:`搜索会话…(标题 / 项目 / id)`,modelBudgetTitle:`按模型预算`,modelBudgetHint:`为单个模型设本月上限(人民币元);跨 80% / 100% 各提醒一次,留空 = 不限。`,modelBudgetBody:`「{model}」本月已 {cost}(预算 {budget} 的 {pct}%)`,modelBudgetPlaceholder:`上限`,moreWorksTitle:`更多作品`,adEngramName:`DSH Engram · 记忆宫殿`,adEngramDesc:`跨会话长期记忆:记忆图谱 · 混合检索 · 知识飞轮`,adRainbowName:`RainbowSpeak · 虹语`,adRainbowDesc:`聊天输入框的彩虹流光边框,持续流动的渐变光环`,kpiDescCacheHit:`缓存命中 token ÷ 总输入 token。命中率越高,输入费用越低(缓存读单价约为未命中的 1/10)。`,kpiDescTokens:`总处理 token = 输入 + 输出。缓存读/写已含在输入内,不重复计数(issue #85 口径)。`,kpiDescAvgCost:`统计范围内总费用 ÷ 总调用次数,单次调用的平均开销。`,kpiDescCalls:`统计范围内的 LLM 调用次数(联网搜索估算不含在内)。`,kpiDescReasoning:`思考(reasoning)token ÷ 输出 token。推理模型的思考部分已计费、含在输出内。`,kpiDescIo:`输入 token ÷ 输出 token。比值高通常意味着长上下文 / 多轮复用。`,kpiDescPeak:`统计范围内单日处理 token(输入+输出)最多的一天。`,healthDotLive:`厂商在线`,healthDotFailed:`厂商探活失败`,healthDotUnknown:`厂商状态未知`,settingsSectionDisplay:`显示偏好`,emptyHint:`运行第一次对话后,这里会自动出现按厂商的用量与费用明细`,tokenViewStructure:`按结构`,tokenViewModel:`按模型`,tokenHitShort:`命中`,tokenMissShort:`未命中`,tokenTotal:`总 Token`,tokenShare:`占比`,usageStatsTool:`注入用量查询`,usageStatsToolHint:`让模型可在对话中查询用量/费用;会占用模型每次请求的上下文,coding 场景建议关闭(切换即时生效)`,balanceGranted:`赠金余额`,balanceTopped:`充值余额`,balanceDaily:`日均消耗`,balanceDaysLong:`约可撑`,balanceDaysUnit:`天`,popTodayModel:`主力消耗模型余额`,popTitle:`用量速览`,popNoConsumption:`暂无消耗`,popDirectLead:`直联`,popSubLead:`订阅`,unpricedHint:`{count} 个模型未收录计价,费用已按 0 计`,searchEstimateHint:`含 {count} 次联网搜索请求的估算费用(每次约 {each};日志无用量事件,按次估算,可在配置 searchCallEstimateCny 调整或关闭)`,siteListDisplay:`中转站列表`,siteListDisplayHint:`隐藏「未识别」占位条目与「未知路由」分组,净化列表`,liveCostBar:`平价消耗胶囊`,liveCostBarHint:`输入框旁的即时代费条,悬浮可看详情`,liveCostBarPosition:`位置`,liveCostBarPosBelow:`输入框下方`,liveCostBarPosAbove:`输入框上方`,liveCostBarPosToolbar:`输入框内部`,exportCsvSite:`按站点 CSV`,panelRelayQuota:`中转站额度`,relayBalance:`余额`,relayNoQuota:`未读出额度`,relayWindowUsed:`已用`,relayKindNewApi:`New API`,relayKindSub2Api:`Sub2API`,relayKindUnknown:`未识别`,expandAll:`全部展开`,collapseAll:`全部收起`,todayOnly:`仅看今日`,todayNoConsumption:`今日暂无消耗`,commandUsageLabel:`打开计费仪表盘`,commandUsageDescription:`查看今日/本月费用、用量明细与费率`,sessionOpen:`打开会话`,sessionOpenFailed:`无法打开该会话(可能已被删除或不在当前会话列表)`,sessionOpenUnavailable:`当前宿主不支持会话跳转`,tabAgents:`智能体`,agentsSummary:`智能体网络`,agentsCount:`智能体`,agentsDelegations:`委派`,agentsRoots:`对话`,agentsMostExpensive:`最贵的一支`,agentsChainTotal:`链合计`,agentsNoData:`暂无子智能体委派记录`,agentsSubagent:`子智能体`,agentsRoot:`对话`,tabQueue:`队列`,queueSubtitle:`非紧急任务只在 DeepSeek 官方低谷启动,按入队顺序串行执行`,queueUntilPeak:`距高峰`,queueUntilOffPeak:`距低谷`,queueUnsupportedTitle:`当前宿主不支持任务队列`,queueUnsupportedBody:`任务队列需要新版宿主的会话创建、Prompt 提交与结果订阅能力。当前宿主会保持只读降级;用量、费用和峰谷提醒不受影响,也不会创建只排队却无法执行的任务。`,queueSafety:`安全边界:任务开始后即使进入高峰也会继续,不会强行暂停;失败或结果无法确认时不自动重试。每个任务在独立会话执行,并按宿主现有权限使用工具。`,queueWorkspace:`工作区`,queueModel:`官方峰谷模型`,queueNoOptions:`未发现可用工作区或内置 DeepSeek 官方峰谷模型,请先完成宿主配置。中转站同名模型不参与。`,queuePromptLabel:`任务 Prompt`,queuePromptPlaceholder:`描述一个非紧急、可无人值守完成的任务。入队即授权宿主在下一低谷创建会话并执行。`,queuePrivacy:`队列文件仅当前用户可读;执行后 Prompt 也会进入宿主会话日志。请勿填入密码或密钥。`,queueEnqueue:`加入低谷队列`,queueImport:`导入 JSON`,queueImportHint:`JSON 数组项可为 Prompt 字符串或 { prompt, cwd?, provider?, model? };缺省沿用当前工作区与模型,整批校验后一次入队。`,queueImported:`已导入 {count} 个任务`,queueImportFormat:`导入文件须为非空 JSON 数组,每项是 Prompt 字符串或任务对象`,queueImportTooLarge:`导入文件超过 10 MiB,未读取或写入任何任务`,queueActive:`任务与历史`,queueClearFinished:`清除已结束`,queueEmpty:`队列是空的。加入一个非紧急任务,下一低谷自动开始。`,queueLoading:`正在读取队列…`,queueOpenSession:`查看会话`,queueRemoveQueued:`移出队列`,queueRemoveHistory:`删除记录`,queueStatusQueued:`等待低谷`,queueStatusStarting:`正在启动`,queueStatusRunning:`执行中`,queueStatusCompleted:`已完成`,queueStatusFailed:`需核对`,quickQueueToggle:`低谷队列`,quickQueueEnqueue:`入队`,quickQueueEnqueueing:`入队中…`,quickQueueWaiting:`{count} 个等待任务`,quickQueueClear:`入队后清稿`,quickQueueEnqueued:`已加入低谷队列,将按队列规则调度`,quickQueueEmpty:`草稿为空,请先输入任务`,quickQueueBusy:`当前草稿正在提交,请稍后再入队`,quickQueueAttachments:`含附件或引用的草稿暂不支持入队,请改用纯文本`,quickQueueContext:`无法读取当前工作区或模型,请在新版宿主中重试`,quickQueueRoute:`当前工作区或模型不支持低谷队列,请选择官方峰谷模型`,quickQueueDraftChanged:`已入队;草稿已变化,未清空`,quickQueueUnsupported:`当前宿主不支持草稿入队,请升级宿主`,quickQueueFailed:`入队失败:{message}`},$e={title:`Usage`,cost:`Cost`,todayCost:`Today`,monthCost:`This month`,yearCost:`This year`,monthProjected:`Projected`,monthProjectedHint:`Month-to-date + last-7-day pace × days left`,liveTurn:`Turn`,liveSession:`Session`,liveSessionSub:`incl. sub {cost}`,calls:`Calls`,cacheHitRate:`Cache Hit`,tokens:`Tokens`,inputTokens:`Input`,outputTokens:`Output`,avgCost:`Avg cost`,kpiRange:`Range`,avgRangeToday:`Today`,avgRange7d:`7d`,avgRangeWeek:`Week`,avgRangeMonth:`Month`,avgRangeAll:`All`,avgRangeCustom:`Custom`,customRangeStart:`Start date`,customRangeEnd:`End date`,trend:`Daily cost & calls`,trend7d:`7D`,trend30d:`30D`,trendMetric:`Trend metric`,trendMetricCost:`Cost`,trendMetricTokens:`Tokens`,pricingSearch:`Search model or vendor`,bandPinHint:`click to pin to the composer`,trendEmpty:`No trend data yet`,trendTotal:`Total`,roundsUnit:`turns`,healthModelsLive:`{n} models live`,healthVendorsDown:`{n} vendors down`,healthVendorsUnavailable:`{n} vendors unavailable`,budget:`Monthly budget`,budgetRemain:`Remaining`,budgetAmount:`Budget amount`,budgetSummary:`Used {used} / {total} this month; warn at 80%, pulse red at 100%`,sessions:`Sessions`,sessionTitle:`Title`,lastActive:`Last active`,sessionOverflow:`Top {limit} of {total} sessions by cost`,budgetTierBody:`This month {cost} reached {pct}% of the budget {budget}`,models:`Model billing`,providerBilling:`Provider billing & subscriptions`,channelUnknown:`Unknown routes`,directTag:`Direct`,relayTag:`Relay`,unknownTag:`Unknown`,unknownChannelHint:`Channel is not registered in the plugin config; the spending party cannot be verified, so cost stays out of the totals while usage is still counted.`,planCountUnit:`plan(s)`,actual:`Actual`,pricing:`Model pricing`,input:`Input`,output:`Output`,cacheHit:`Cache hit`,peak:`Peak`,offPeak:`Off-peak`,flat:`Flat`,band:`Band`,close:`Close`,footer:`Polls every 30s · local dsh sessions only`,footerCredit:`dsh-ui-usage-billing {version} · MIT`,lastUpdated:`Updated`,noData:`No billing data yet`,todayRate:`Today rate`,rateLive:`Live`,rateBuiltin:`Built-in`,pricingSyncedAt:`Synced`,pricingSyncNow:`Sync now`,pricingSyncing:`Syncing…`,promoBadge:`Promo`,promoUntil:`Promo price until {date}, then list price resumes automatically`,promoOpenEnded:`End date not announced; billed at the discounted rate until further notice, then list price resumes`,pricingTip:`DeepSeek list rates: V4.1 Flash off-peak ¥1 miss / ¥0.02 cache-hit / ¥4 output; V4 Pro off-peak ¥4.5 miss / ¥0.15 cache-hit / ¥13.5 output; peak = 2× off-peak. Weekday 9-12 / 14-18 bills at peak, all other times (weekends included) at off-peak; billed at call time.`,pricingUnit:`Unit: CNY / per 1M tokens`,pricingNotes:`Pricing notes`,ubPeak:`Peak`,ubOff:`Off`,ubStd:`Std`,peakBand:`Peak/off-peak band`,pricingSource:`Data source`,noteCache:`Cache hits are billed at the cache rate, cutting cost.`,noteBand:`Peak and off-peak prices differ; off-peak is roughly half price.`,noteSource:`Prices come from the live rate + model catalog; unlisted models count as 0 and are flagged.`,balance:`Balance`,recharge:`Top up`,rechargeHint:`Open the vendor's official top-up page`,balanceUnconfigured:`Not set`,balanceUnauthorized:`Bad key`,balanceUnreachable:`Unavailable`,uncatalogued:`Not catalogued`,estimatedPricing:`Estimated`,balanceDays:`~{days} days left`,balanceLowBody:`{name} balance {balance}, ~{days} days left, please top up`,reconcileDrift:`Detected {provider} official balance moved {spent}, this panel recorded {today}; the gap usually comes from other tools or APIs consuming too`,reconcileDismiss:`Got it`,subscriptionNotConfigured:`Key not set`,subscriptionUnauthorized:`Bad key`,subscriptionUnavailable:`Unavailable`,subscriptionInvalid:`Bad response`,subscriptionRateLimited:`Rate limited`,subscriptionSession:`Current`,subscriptionWeekly:`Weekly`,subscriptionMonthly:`Monthly`,subscriptionBilling:`Billing`,subscriptionRemaining:`{pct}% left`,subscriptionExhausted:`Exhausted`,subscriptionReset:`Resets {date}`,subscriptionNoApi:`Provider does not offer a usage API`,floatWindow:`Model usage popover`,floatModeCombined:`Combined`,floatModeSubscription:`Subscription card`,floatMode:`Display mode`,floatTargets:`Targets`,floatWindowHint:`Usage summary floating on the footer card; Combined=current style, Subscription cards=one quota card at a time (switchable).`,floatPrimaryToday:`Today`,floatPrimaryWeek:`Week`,floatPrimaryMonth:`Month`,cardDisplay:`Billing card`,cardDisplayHint:`Choose how much space the sidebar entry uses, then set its metric and range. Restore a hidden entry from native Settings or /usage. Tracking and alerts stay active.`,cardMode:`Sidebar entry`,cardModeFull:`Full card`,cardModeCompact:`Compact icon`,cardModeHidden:`Hidden`,cardModeHiddenHint:`Restore: open native Settings → Usage & billing → Full card, or open the dashboard with /usage and return to Settings.`,cardModeFallback:`This host has neither native Settings nor /usage, so Hidden falls back to the compact icon to keep the dashboard reachable.`,nativeSettingsNav:`Usage & billing`,nativeSettingsIntro:`Choose how the sidebar billing entry appears. Changes apply immediately and stay in sync with the dashboard settings.`,nativeSettingsHiddenHint:`The sidebar entry is hidden. Choose Full card or Compact icon to restore it; tracking and alerts remain active.`,cardMetric:`Main metric`,cardMetricMoney:`Cost`,cardMetricTokens:`Tokens`,cardSpan:`Range`,cardSpanDay:`Day`,cardSpanWeek:`Week`,cardSpanMonth:`Month`,cardDeltaBadge:`Day-over-day badge`,cardDeltaShow:`Show`,cardDeltaHide:`Hide`,floatNoTargets:`No subscription selected — pick some in Settings.`,floatNoTargetsHint:`No subscription channel available.`,subscriptionsStale:`Subscription refresh failed — showing cached data`,balanceStaleNotice:`Balance refresh is slow — the figures below come from the last completed query`,staleLedgerNotice:`{count} sessions use legacy-algorithm archives (logs deleted); attribution may be off`,staleSnapshotNotice:`Usage is being recomputed; the figures below come from the last completed calculation (session titles may lag the workspace)`,unreadableNotice:`Usage from {count} sessions is not fully counted (raw logs untouched; no data lost)`,unreadableNoLedgerNotice:`{count} of them have no archived history and are not counted at all`,unreadableFormatNotice:`{count} of them use a session format this host cannot read: newer formats recover after a host upgrade; legacy formats (e.g. v0/v3) need a one-time migration`,tokenCacheWrite:`written`,toolRank:`Tool calls`,toolName:`Tool`,userPrices:`Custom prices`,userPricesHint:`Enter actual per-1M-token prices; main views are re-costed. Pick a model key from the dropdown candidates. Leave source empty for the model default, or enter a relay origin (protocol optional) to price only that source. Fill all three off-peak fields for peak/off-peak estimation; leave them empty for flat pricing.`,userPriceSave:`Save`,userPriceModel:`Model`,userPriceSource:`Source (relay origin)`,userPriceSourceHint:`Empty = default; e.g. https://api.relay.com`,userPriceOffPeak:`Off-peak price`,userPriceNormal:`Standard price`,userPriceCurrency:`Currency`,userPriceAdd:`Add`,userPriceRemoveSelected:`Remove selected`,userPriceSelect:`Select this row`,sessionStaleBadge:`legacy`,sessionUntitled:`Untitled session`,sessionSubCost:`incl. subagents {cost}`,sessionSubCalls:`incl. subagents, {calls} calls`,sessionSubRow:`Subagent`,heatmapLess:`Less`,heatmapMore:`More`,currency:`Currency`,currencyCny:`CNY`,currencyUsd:`USD`,currencyEur:`EUR`,language:`Interface language`,heatmap:`Usage heatmap`,rounds:`Cost per turn`,roundsHint:`Last {count} rounds · bar tops show amount · fill = peak/off-peak`,anomaly:`Cost spike`,model:`Model`,thModel:`Model name`,thInputMiss:`Input (cache miss)`,thInputHit:`Input (cache hit)`,costAbbr:`cost`,tabOverview:`Overview`,tabTrends:`Trends`,tabProviders:`Bills`,tabPricing:`Rates`,tabSettings:`Settings`,budgetHint:`Set a monthly cap for projections and tier alerts`,peakAlertHint:`Alert before a tier switch, optionally via system notification`,peakAlertDescPeak:`About to enter peak hours — prices rise, plan long tasks ahead`,peakAlertDescOff:`About to enter off-peak hours — price halves, ideal for large batches`,peakAlertDescPeakZhipu:`Peak hours soon (weekdays 14:00–18:00) — Coding Plan credits will be deducted at full rate`,peakAlertDescOffZhipu:`Off-peak soon — Coding Plan credits will be deducted at 50% of base credits`,peakAlertQueuePeak:`{count} queued tasks will wait for the next off-peak window; admitted tasks keep running`,peakAlertQueueOff:`{count} queued tasks will start in order`,export:`Export`,exportCsvDay:`Daily CSV`,exportCsvSession:`Sessions CSV`,exportJson:`Full JSON`,peakShare:`Peak vs off-peak`,peakSharePerCall:`per-call attribution, full history`,offPeakSavings:`Shift peak to off-peak: save ~{amount}`,perfMax:`Max TTFT`,weekCost:`This week's spend`,roleCost:`Cost breakdown`,roleUser:`User input`,roleAssistant:`Assistant output`,roleTool:`Tool results`,roleHint:`Estimated: output priced exactly, input split by message size`,tierPeak:`Peak`,tierOff:`Off-peak`,tierToPeak:`until peak`,tierToOff:`until off-peak`,tierAlertEnterPeak:`Peak pricing (2x) starts in {minutes} min — non-urgent calls can wait`,tierAlertEnterOff:`Off-peak pricing (50% off) starts in {minutes} min`,tierAlertEnterPeakZhipu:`Zhipu peak hours in {minutes} min — Coding Plan credits burn at full rate`,tierAlertEnterOffZhipu:`Zhipu off-peak in {minutes} min — credit burn drops to 50%`,peakAlertTitlePeak:`Peak pricing incoming`,peakAlertTitleOff:`Off-peak incoming`,peakAlert:`Peak/off-peak alert`,peakAlertLeadMin:`Lead time (min)`,peakAlertPos:`Position`,peakAlertMode:`Remind mode`,peakAlertPosCorner:`Bottom-right`,peakAlertPosCenter:`Center`,peakAlertModePeak:`Entering peak only`,peakAlertModeOff:`Entering off-peak only`,peakAlertModeBoth:`Both`,peakAlertWebNotify:`Also send system notification`,peakAlertPreview:`Preview alert`,planTypeCode:`Subscription`,planTypeToken:`Usage`,subscriptionFeePerMonth:`{amount}/mo`,triggerToday:`Today's spend`,triggerMonth:`This month's spend`,triggerMonthTokens:`This month's tokens`,triggerTodayTokens:`Today's tokens`,triggerWeekTokens:`This week's tokens`,subscriptionTag:`Plan`,cellEstimateHint:`No pay-as-you-go charge recorded for this row (subscription routes are not billed per call); amount is a catalog-price estimate`,free:`Free`,perfSamples:`Samples`,perfTtft:`TTFT`,perfP50:`P50`,perfP90:`P90`,perfTps:`Speed`,perfLatency:`Total latency`,perfEstimated:`Estimated`,perfEmpty:`No performance data yet`,perfTpsUnit:`tok/s`,perfTitle:`Performance`,perfHint:`Per model & per hour; estimated samples are tool-continuation steps`,perfAll:`All`,perfChartEmpty:`No model selected or no data for this metric`,heatmapYear:`Year`,heatmapHalf:`Half`,heatmapMonth:`Month`,metricCost:`Cost`,metricTokens:`Tokens`,heatmapTotal:`Total`,activeDays:`Active days`,streakDays:`Streak`,subscriptionAutoDetect:`Auto`,pluginAuthor:`Author`,pluginRepository:`Repository`,pluginNpm:`npm`,pluginLicense:`License`,tabToken:`Usage`,tokenExport:`Export tokens`,tokenExportCsv:`Daily token CSV`,tokenReasoningShare:`Reasoning share`,tokenReasoningShort:`reasoning`,tokenIo:`In/out ratio`,tokenPeak:`Peak day`,tokenDaily:`Daily tokens`,tokenByModel:`Tokens by model`,tokenMiss:`Input (cache miss)`,densityLabel:`Display density`,densityHint:`Compact shrinks row height and padding, comfortable adds room; applies instantly`,densityCompact:`Compact`,densityDefault:`Default`,densityComfortable:`Comfortable`,motionLabel:`Motion strength`,motionHint:`Off freezes all entrance and data-update animations; basic interaction feedback remains`,motionOff:`Off`,motionSubtle:`Subtle`,motionRich:`Rich`,settingsNavDisplayPref:`Preferences`,settingsNavBudget:`Budget`,settingsNavAlert:`Alerts`,settingsNavDisplay:`Display`,settingsNavAdvanced:`Advanced`,settingsNavAbout:`About`,settingsSearchPlaceholder:`Search settings… (e.g. budget, peak, price)`,settingsSearchEmpty:`No settings match "{query}"`,sessionsViewAll:`View all {count} sessions`,sessionViewerSearch:`Search sessions… (title / project / id)`,modelBudgetTitle:`Per-model budget`,modelBudgetHint:`Set a monthly cap per model (CNY); alerts fire once each at 80% / 100%. Empty = unlimited.`,modelBudgetBody:`"{model}" has spent {cost} this month ({pct}% of {budget})`,modelBudgetPlaceholder:`Cap`,moreWorksTitle:`More plugins`,adEngramName:`DSH Engram · Memory Palace`,adEngramDesc:`Cross-session long-term memory: graph · hybrid retrieval · flywheel`,adRainbowName:`RainbowSpeak`,adRainbowDesc:`A flowing rainbow marquee border for the chat composer`,kpiDescCacheHit:`Cache-hit tokens ÷ total input tokens. Higher hit rate means lower input cost (cache reads are ~1/10 the miss price).`,kpiDescTokens:`Total tokens = input + output. Cache reads/writes are already part of input and are not double-counted (issue #85).`,kpiDescAvgCost:`Total cost ÷ total calls within the selected range — the average cost per call.`,kpiDescCalls:`LLM calls within the selected range (web-search estimates excluded).`,kpiDescReasoning:`Reasoning tokens ÷ output tokens. A reasoning model's thinking is billed and included in output.`,kpiDescIo:`Input tokens ÷ output tokens. A high ratio usually means long context / multi-turn reuse.`,kpiDescPeak:`The day with the most processed tokens (input + output) in the range.`,healthDotLive:`Vendor online`,healthDotFailed:`Vendor probe failed`,healthDotUnknown:`Vendor status unknown`,settingsSectionDisplay:`Display preferences`,emptyHint:`Run your first conversation and per-provider usage and cost breakdown will appear here automatically`,tokenHit:`Input (cache hit)`,tokenOutput:`Output`,tokenViewStructure:`Structure`,tokenViewModel:`By model`,tokenHitShort:`Hit`,tokenMissShort:`Miss`,tokenTotal:`Total tokens`,tokenShare:`Share`,usageStatsTool:`Inject usage-stats tool`,usageStatsToolHint:`Lets the model query usage/cost inside a conversation; it consumes context per request, so keep it off for coding (takes effect immediately)`,balanceGranted:`Granted`,balanceTopped:`Topped up`,balanceDaily:`Daily burn`,balanceDaysLong:`~days left`,balanceDaysUnit:`days`,popTodayModel:`Main model balance`,popTitle:`Usage overview`,popNoConsumption:`No usage yet`,popDirectLead:`Direct`,popSubLead:`Subscription`,unpricedHint:`{count} models not priced; their cost counts as 0`,searchEstimateHint:`Includes estimated cost of {count} web-search requests (~{each} each; no usage events logged, per-call estimate; tune via searchCallEstimateCny)`,siteListDisplay:`Relay lists`,siteListDisplayHint:`Hide "unidentified" placeholder rows in the relay quota list`,liveCostBar:`Live cost capsule`,liveCostBarHint:`Live cost bar beside the composer; hover for details`,liveCostBarPosition:`Position`,liveCostBarPosBelow:`Below composer`,liveCostBarPosAbove:`Above composer`,liveCostBarPosToolbar:`Inside composer`,exportCsvSite:`By site CSV`,panelRelayQuota:`Relay quotas`,relayBalance:`Balance`,relayNoQuota:`No quota`,relayWindowUsed:`used`,relayKindNewApi:`New API`,relayKindSub2Api:`Sub2API`,relayKindUnknown:`Unknown`,expandAll:`Expand all`,collapseAll:`Collapse all`,todayOnly:`Today only`,todayNoConsumption:`No usage today`,commandUsageLabel:`Open the billing dashboard`,commandUsageDescription:`See today/month spend, usage breakdown and rates`,sessionOpen:`Open session`,sessionOpenFailed:`Could not open this session (it may be deleted or absent from the current list)`,sessionOpenUnavailable:`This host does not support session navigation`,tabAgents:`Agents`,agentsSummary:`Agent network`,agentsCount:`agents`,agentsDelegations:`delegations`,agentsRoots:`conversations`,agentsMostExpensive:`costliest chain`,agentsChainTotal:`chain total`,agentsNoData:`No sub-agent delegation records yet`,agentsSubagent:`sub-agent`,agentsRoot:`conversation`,tabQueue:`Queue`,queueSubtitle:`Non-urgent tasks start only during DeepSeek official off-peak hours, one at a time`,queueUntilPeak:`Peak in`,queueUntilOffPeak:`Off-peak in`,queueUnsupportedTitle:`This host does not support the task queue`,queueUnsupportedBody:`The queue requires Session creation, Prompt admission and result streaming from a newer host. This host stays in read-only fallback: usage, billing and band alerts keep working, and no non-executing placeholder tasks are created.`,queueSafety:`Safety: an admitted task continues if peak pricing begins; it is never forcibly paused. Failures and unknown outcomes never auto-retry. Each task runs in its own Session with the host’s existing tool permissions.`,queueWorkspace:`Workspace`,queueModel:`Official time-of-day model`,queueNoOptions:`No workspace or built-in DeepSeek official time-of-day model is available. Relay mirrors are not eligible.`,queuePromptLabel:`Task Prompt`,queuePromptPlaceholder:`Describe a non-urgent task that can run unattended. Enqueuing authorizes the host to create a Session and run it at the next off-peak window.`,queuePrivacy:`The queue file is owner-only; executed Prompts also enter host Session logs. Do not enter passwords or secrets.`,queueEnqueue:`Enqueue for off-peak`,queueImport:`Import JSON`,queueImportHint:`A JSON array of Prompt strings or { prompt, cwd?, provider?, model? } objects; omitted fields use the current selection. The whole batch is validated before one atomic enqueue.`,queueImported:`Imported {count} tasks`,queueImportFormat:`The import must be a non-empty JSON array of Prompt strings or task objects`,queueImportTooLarge:`The import exceeds 10 MiB; no tasks were read or enqueued`,queueActive:`Tasks & history`,queueClearFinished:`Clear finished`,queueEmpty:`The queue is empty. Add a non-urgent task to start it at the next off-peak window.`,queueLoading:`Loading queue…`,queueOpenSession:`Open Session`,queueRemoveQueued:`Remove`,queueRemoveHistory:`Delete record`,queueStatusQueued:`Waiting`,queueStatusStarting:`Starting`,queueStatusRunning:`Running`,queueStatusCompleted:`Completed`,queueStatusFailed:`Needs review`,quickQueueToggle:`Off-peak queue`,quickQueueEnqueue:`Enqueue`,quickQueueEnqueueing:`Enqueuing…`,quickQueueWaiting:`{count} waiting tasks`,quickQueueClear:`Clear after enqueue`,quickQueueEnqueued:`Added to the off-peak queue; scheduling follows the queue rules`,quickQueueEmpty:`The draft is empty; enter a task first`,quickQueueBusy:`This draft is being submitted; try enqueueing later`,quickQueueAttachments:`Drafts with attachments or references cannot be queued; use plain text`,quickQueueContext:`Cannot read the current workspace or model; retry on a newer host`,quickQueueRoute:`This workspace or model is not eligible; select an official time-of-day model`,quickQueueDraftChanged:`Enqueued; the draft changed, so it was not cleared`,quickQueueUnsupported:`This host does not support draft enqueueing; upgrade the host`,quickQueueFailed:`Enqueue failed: {message}`},et={"opencode-go":{type:`code`,subscription:{amount:10,currency:`USD`,period:`month`},tier:{amount:10,currency:`USD`,periodDays:7,label:`周额度 $30`}},opencode:{type:`code`,subscription:{amount:10,currency:`USD`,period:`month`},tier:{amount:10,currency:`USD`,periodDays:7,label:`周额度 $30`}},"kimi-coding":{type:`code`},"zai-coding-cn":{type:`code`},"zai-coding":{type:`code`},commandcode:{type:`code`},"qwen-token-plan":{type:`code`},"qwen-token-plan-cn":{type:`code`},"xiaomi-token-plan-ams":{type:`code`},"xiaomi-token-plan-cn":{type:`code`},"xiaomi-token-plan-sgp":{type:`code`},"volcengine-token-plan":{type:`code`},"ark-token-plan":{type:`code`},"doubao-token-plan":{type:`code`},minimax:{type:`code`},"minimax-cn":{type:`code`},"minimax-token-plan":{type:`code`},"minimax-token-plan-cn":{type:`code`},"hunyuan-token-plan":{type:`code`},"tencent-token-plan":{type:`code`},"hy-token-plan":{type:`code`},"xinghuo-token-plan":{type:`code`},"xfyun-coding":{type:`code`},"spark-coding":{type:`code`},"huawei-token-plan":{type:`code`},"pangu-token-plan":{type:`code`},"huawei-maas-token-plan":{type:`code`},"volcengine-agent-plan":{type:`code`},"ark-agent-plan":{type:`code`},"baidu-token-plan":{type:`code`},"ernie-token-plan":{type:`code`},"wenxin-token-plan":{type:`code`}},tt={glm:`zai-coding-cn`,bigmodel:`zai-coding-cn`,zhipu:`zai-coding-cn`,zhipuai:`zai-coding-cn`,zai:`zai-coding`,ark:`volcengine-token-plan`,volcengine:`volcengine-token-plan`,doubao:`doubao-token-plan`,moonshot:`kimi-coding`,kimi:`kimi-coding`,xiaomi:`xiaomi-token-plan-cn`,opencode:`opencode-go`};function H(e){return e===``?e:tt[e]??e}function nt(e){let t=et[H(e)];return t?.type===`code`?t.tier:void 0}let rt=[{key:`deepseek-v4-flash`,input:.14,cacheHit:.0028,output:.28},{key:`deepseek-v4-pro`,input:.435,cacheHit:.003625,output:.87},{key:`gpt-5.6-sol`,input:5,cacheHit:.5,output:30},{key:`gpt-5.6-terra`,input:2,cacheHit:.2,output:12},{key:`gpt-5.6-luna`,input:.2,cacheHit:.02,output:1.2},{key:`glm-5.2`,input:1.4,cacheHit:.26,output:4.4},{key:`qwen3.8-max`,input:2,cacheHit:.21,output:6},{key:`kimi-k3`,input:2.82,cacheHit:.28,output:14.08},{key:`grok-4.6`,input:2,cacheHit:.5,output:6},{key:`gemini-2.5-pro`,input:1.25,cacheHit:.125,output:10}],U,it,at,ot,st,ct;function lt(e){let t=/:\/\//.test(e)?e:`https://${e}`;try{return new URL(t).origin}catch{return e.trim().toLowerCase().replace(/\/+$/,``)}}function ut(e,t){return lt(e)===lt(t)}function dt(e){ct=e.length>0?e:void 0}function ft(){return ct}function pt(e){return en(e)}function mt(e,t){let n=ht(e,t);if(n!==void 0)return{input:n.input,cacheHit:n.cacheHit,output:n.output,...n.currency===void 0?{}:{currency:n.currency},...n.offPeak===void 0?{}:{offPeak:n.offPeak}}}function ht(e,t){if(ct===void 0)return;let n=pt(e),r=Ut(n),i=e=>pt(e.key)===n||Ut(e.key)===r;if(t!==void 0){for(let e of ct)if(e.origin!==void 0&&e.origin!==``&&i(e)&&ut(e.origin,t))return e}for(let e of ct)if((e.origin===void 0||e.origin===``)&&i(e))return e}function gt(e){if(ct===void 0)return;let t=pt(e),n=Ut(t);return ct.find(e=>e.origin!==void 0&&e.origin!==``&&(pt(e.key)===t||Ut(e.key)===n))}function _t(e){U=typeof e.rate==`number`&&Number.isFinite(e.rate)&&e.rate>0?e.rate:void 0,it=typeof e.rateEur==`number`&&Number.isFinite(e.rateEur)&&e.rateEur>0?e.rateEur:void 0,at=e.prices,ot=e.extraModels}function vt(e){st=e}function yt(){return U??6.79}function bt(){return it??7.71}function xt(){return{rate:yt(),live:U!==void 0}}function St(){return{rate:bt(),live:it!==void 0}}let Ct=.5;function wt(e){return e==null||!Number.isFinite(e)?`peak`:Tt(e,kt,!0)}function Tt(e,t,n=!1){if(Et(e)||n&&Ot(e))return`offPeak`;let r=Math.floor(jt(e)/6e4);for(let e=0;e+1<t.length;e+=2){let n=t[e]??0,i=t[e+1]??0;if(r>=n&&r<i)return`peak`}return`offPeak`}function Et(e){let t=new Date(e+288e5).getUTCDay();return t===0||t===6}function Dt(e){return new Date(e+288e5).toISOString().slice(0,10).replace(/-/g,``)}function Ot(e){return`20260925 20260926 20260927 20261001 20261002 20261003 20261004 20261005 20261006 20261007`.includes(Dt(e))}let kt=[540,720,840,1080],At=[840,1080];function jt(e){return((e+288e5)%864e5+864e5)%864e5}function Mt(e,t,n=!1){let r=Tt(e,t,n),i=jt(e);for(let a=0;a<10;a++){let o=a*864e5-i;for(let i of t){let a=o+i*6e4;if(!(a<=0)&&Tt(e+a,t,n)!==r)return{tier:r,nextSwitchInMs:a}}}let a=t[0]??0;return{tier:r,nextSwitchInMs:864e5-i+a*6e4}}function Nt(e,t,n,r=!1){let{nextSwitchInMs:i}=Mt(e,t,r);if(i>n)return null;let a=e+i;return{entering:Tt(a,t,r),atMs:a}}function Pt(e,t){if(e===void 0||e===``)return`none`;let n=en(e),r=Bt().find(e=>e.key===n)?.provider;return r===`DeepSeek`?`deepseek-metered`:t&&r===`智谱 AI`?`zhipu-coding-plan`:`none`}function Ft(e,t){switch(t){case`deepseek-metered`:return Mt(e,kt,!0);case`zhipu-coding-plan`:return Mt(e,At);case`none`:return null}}function It(e,t,n){switch(t){case`deepseek-metered`:return Nt(e,kt,n,!0);case`zhipu-coding-plan`:return Nt(e,At,n);case`none`:return null}}function Lt(e){let t=Math.max(1,Math.ceil(e/6e4)),n=Math.floor(t/60),r=t%60;return n>0?`${n}h${String(r).padStart(2,`0`)}m`:`${r}m`}let W=[],Rt={};function zt(e,t){W=e,Rt=t,Wt=void 0}function Bt(){return W}function Vt(){return Rt}let Ht={key:`other`,name:`其他模型`,provider:`Custom`,colorVar:`dsw-static-neutral-bluish-500`,price:{currency:`CNY`,input:0,cacheHit:0,cacheMiss:0,output:0}};function Ut(e){return String(e).toLowerCase().replace(/\([^)]*\)/g,``).replace(/[^a-z0-9]+/g,``)}let Wt;function Gt(){if(Wt!==void 0)return Wt;let e=new Map,t=(t,n)=>{let r=Ut(t);r!==``&&!e.has(r)&&e.set(r,n)};for(let e of W)t(e.key,e.key);for(let[e,n]of Object.entries(Rt))t(e,n);for(let e of rt)t(e.key,e.key);return Wt=e,e}let Kt,qt,Jt;function Yt(){if(Kt===ot)return;let e=new Map,t=new Map;for(let n of ot??[]){t.has(n.key)||t.set(n.key,n);let r=Ut(n.key);r!==``&&!e.has(r)&&e.set(r,n)}Kt=ot,qt=e,Jt=t}function Xt(){return Yt(),qt??new Map}function Zt(){return Yt(),Jt??new Map}function Qt(e){let t=[],n=e=>{e!==``&&!t.includes(e)&&t.push(e)},r=e=>{let t=e;for(;;){let e=t.replace(/[-_]\d{3,}$/u,``);if(e===t||e===``)return;t=e,n(t)}},i=e.lastIndexOf(`/`);if(i>0&&i<e.length-1){let t=e.slice(i+1);n(t),r(t)}return r(e),t}function $t(e){let t=Vt()[e];if(t!==void 0)return t;let n=Ut(e);if(n===``)return;let r=Gt().get(n);return r===void 0?Xt().get(n)?.key:r}function en(e){let t=Vt()[e]??e;if(t===e){let t=Ut(e);if(t!==``){let e=Gt().get(t);if(e!==void 0)return e;let n=Xt().get(t);if(n!==void 0)return n.key}for(let t of Qt(e)){let e=$t(t);if(e!==void 0)return e}}return t}function tn(e){let t=en(e),n=at?.[t];if(n!==void 0)return n;let r=rt.find(e=>e.key.toLowerCase()===t.toLowerCase());if(r!==void 0)return{input:r.input,cacheHit:r.cacheHit,output:r.output}}function nn(e){let t=en(e),n=Bt().find(e=>e.key===t),r=Zt().get(t),i=n??(r===void 0?Bt().find(e=>e.key===`other`)??Ht:rn(r)),a=mt(t);if(a!==void 0)return{...i,userPriced:!0,price:{currency:a.currency??`CNY`,input:a.input,cacheHit:a.cacheHit,output:a.output,...a.offPeak===void 0?{}:{offPeak:a.offPeak}}};let o=tn(t);return o===void 0||i.price.offPeak!==void 0?i:{...i,price:{currency:`USD`,input:o.input,cacheHit:o.cacheHit,output:o.output}}}function rn(e){return{key:e.key,name:e.name,provider:e.provider,colorVar:`dsw-static-neutral-400`,price:{currency:`USD`,input:e.price.input,cacheHit:e.price.cacheHit,output:e.price.output}}}function an(e,t){let n=e.endsAtMs!==void 0&&t>=e.endsAtMs;return Number.isFinite(t)&&!n&&e.factor>=0&&e.factor<1}function on(e,t){let{promo:n}=e;if(n===void 0||!an(n,t))return e;let r=e=>{let t=n.factors?.[e];return t!==void 0&&t>=0&&t<1?t:n.factor},i=e=>({input:e.input*r(`input`),cacheHit:e.cacheHit*r(`cacheHit`),...e.cacheMiss===void 0?{}:{cacheMiss:e.cacheMiss*r(`cacheMiss`)},output:e.output*r(`output`)});return{...e,price:{...i(e.price),currency:e.price.currency,...e.price.offPeak===void 0?{}:{offPeak:i(e.price.offPeak)}}}}function sn(e=Date.now()){let t=[...Bt().filter(e=>e.retired!==!0).map(t=>on(t,e))],n=new Set(t.map(e=>e.key.toLowerCase())),r=new Set(t.map(e=>Ut(e.key)));for(let e of st??[]){let i=e.id.toLowerCase();if((()=>{let t=en(e.id);return Bt().find(e=>e.key===t)})()!==void 0)continue;let a=Ut(e.id);if(n.has(i)||a!==``&&r.has(a))continue;let o=Xt().get(a),s;if(o!==void 0)s=rn(o),e.name!==void 0&&e.name!==``&&(s={...s,name:e.name});else{let t=tn(i);s=t===void 0?{key:en(e.id),name:e.name??e.id,provider:e.provider,colorVar:`dsw-static-neutral-400`,price:{currency:`USD`,input:0,cacheHit:0,output:0},uncatalogued:!0}:{key:i,name:e.name??e.id,provider:e.provider,colorVar:`dsw-static-neutral-400`,price:{currency:`USD`,input:t.input,cacheHit:t.cacheHit,output:t.output}}}n.add(s.key.toLowerCase()),a!==``&&r.add(a),t.push(s)}return t.map(e=>{let t=mt(e.key);return t===void 0?e:{...e,userPriced:!0,price:{currency:t.currency??`CNY`,input:t.input,cacheHit:t.cacheHit,output:t.output}}})}function cn(e,t,n){let r=t.cacheMiss>0?t.cacheMiss:Math.max(0,t.input-t.cacheHit),i=Math.min(t.cacheHit,t.input),a=(r*(e.cacheMiss??e.input)+i*e.cacheHit+t.output*e.output)/1e6;return n===`USD`?a*yt():a}function ln(e,t,n=Ct,r=Date.now()){let i=on(e,r),a=cn(i.price,t,i.price.currency),o=i.price.offPeak===void 0?a:cn(i.price.offPeak,t,i.price.currency);return a*n+o*(1-n)}function un(e){let t=yt();return t>0?e/t:e}function dn(e,t){if(t===`usd`)return un(e);if(t===`eur`){let t=bt();return t>0?e/t:e}return e}function fn(e,t=`cny`){let n=Number(e),r=t===`usd`?`$`:t===`eur`?`€`:`¥`;return!Number.isFinite(n)||n<=0?`${r}0`:n>=1e3?`${r}${n.toFixed(0)}`:n>=10?`${r}${n.toFixed(1)}`:n>=.1?`${r}${n.toFixed(2)}`:`${r}${n.toFixed(3)}`}function pn(e,t=`CNY`){return`${t===`USD`?`$`:t===`EUR`?`€`:`¥`}${e.toFixed(e>=10?1:2)}`}function mn(e,t,n,r){if(r<=0||!Number.isFinite(r))return e;let i=t===`USD`?e*r:e;if(n===`cny`)return i;if(n===`usd`)return i/r;let a=St().rate;return a>0?i/a:i}function G(e=Date.now()){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}function K(e){return e>=1e9?`${(e/1e9).toFixed(2)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function hn(e){let t=Number(e);return Number.isFinite(t)?`${t.toFixed(1)}%`:`0.0%`}function gn(e){return/[",\r\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function _n(e){return/^[=+\-@\t\r]/.test(e)?`'${e}`:e}function vn(e){return e.toFixed(2)}function yn(e){return[`date,calls,input,output,cache_hit,cache_miss,cost_cny`,...Object.keys(e).sort().map(t=>{let n=e[t];return n===void 0?``:[t,n.calls,n.input,n.output,n.cacheHit,n.cacheMiss,vn(n.cost)].join(`,`)})].join(`
2
- `)}function bn(e){return[`site,kind,calls,cost_cny`,...Object.entries(e).map(([e,t])=>{let n=e.startsWith(`site:`)?e.slice(5):e.startsWith(`direct:`)?e.slice(7):`unknown`,r=e.startsWith(`site:`)?`site`:e.startsWith(`direct:`)?`direct`:`unknown`;return[gn(_n(n)),r,t.calls,vn(t.cost)].join(`,`)})].join(`
3
- `)}function xn(e){return e===void 0?``:e.split(/[\\/]/).filter(Boolean).pop()??e}function Sn(e){return[`session_id,title,project,calls,cost_cny,last_active,parent_id,sub_calls,sub_cost_cny`,...e.map(e=>[gn(_n(e.id)),gn(_n(e.title??``)),gn(_n(xn(e.cwd))),e.calls,vn(e.cost),e.lastActive>0?new Date(e.lastActive).toISOString():``,e.parentId??``,e.subCalls??``,e.subCost===void 0?``:vn(e.subCost)].join(`,`))].join(`
4
- `)}function Cn(e,t,n){let r=[...n].sort(),i=r[0],a=r.at(-1);return`${e}${i!==void 0&&a!==void 0?`-${i}_${a}`:``}.${t}`}function wn(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:n})),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),setTimeout(()=>URL.revokeObjectURL(r),0)}function Tn(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(Math.round(e))}let q={top:14,right:18,bottom:22,left:46},En=`var(--ds-blue)`,Dn=`var(--ds-cyan)`,On=`var(--ds-amber)`;function kn(e,t,n,r){return JSON.stringify({days:e,models:t,dayModels:n,total:r},null,2)}function An(e){let{stats:t,trendDays:n,onTrendDays:r,t:i}=e,a=e.money,o=e.models??[],{byDay:s,byModel:c,total:l}=t,[u,f]=(0,d.useState)(null),[p,h]=(0,d.useState)(`structure`),[g,_]=(0,d.useState)(null),v=t.byDayModels!==void 0,b=e=>{h(e),_(null)},x=(0,d.useMemo)(()=>{let e=t.byRole;if(e===void 0)return[];let n=e.user+e.assistant+e.tool;return n<=0?[]:[{label:i(`roleUser`),value:e.user,seg:z.shareSegUser},{label:i(`roleAssistant`),value:e.assistant,seg:z.shareSegAssistant},{label:i(`roleTool`),value:e.tool,seg:z.shareSegTool}].map(e=>({...e,pct:e.value/n*100}))},[t.byRole,i]),S=(0,d.useMemo)(()=>{let e=[];for(let t=n-1;t>=0;--t){let n=new Date;n.setDate(n.getDate()-t);let r=G(n.getTime()),i=s[r];e.push({date:r,miss:i?.cacheMiss??0,hit:i?.cacheHit??0,output:i?.output??0,reasoning:i?.reasoning??0})}return e},[s,n]),C=(0,d.useMemo)(()=>{let e=[];for(let r=n-1;r>=0;--r){let n=new Date;n.setDate(n.getDate()-r);let i=G(n.getTime()),a=t.byDayModels?.[i],o={},s=0;if(a!==void 0)for(let[e,t]of Object.entries(a)){let n=t.cacheHit??0,r=t.cacheMiss??0,i=t.output??0,a=n+r+i;a<=0||(o[e]={hit:n,miss:r,output:i,total:a},s+=a)}e.push({date:i,models:o,total:s})}return e},[t.byDayModels,n]),w=(0,d.useMemo)(()=>{let e=new Map;for(let t of C)for(let[n,r]of Object.entries(t.models))e.set(n,(e.get(n)??0)+r.total);return[...e.entries()].sort((e,t)=>t[1]-e[1]).map(([e])=>({key:e,name:o.find(t=>t.key===e)?.name??nn(e).name,color:o.find(t=>t.key===e)?.color??`#8b95a3`}))},[C,o]),T=g!==null&&w.some(e=>e.key===g)?g:null,E=e=>{if(v){if(p!==`model`){h(`model`),_(e);return}_(t=>t===e?null:e)}},ee=(0,d.useMemo)(()=>{let e=0;return Object.entries(c).filter(([,e])=>e.calls>0).map(([t,n])=>{let r=n.input+n.output;e+=r;let i=n.cacheHit+n.cacheMiss;return{key:t,name:nn(t).name,input:n.input,output:n.output,reasoning:n.reasoning??0,calls:n.calls,cacheHit:n.cacheHit,cacheMiss:n.cacheMiss,cacheHitRate:i>0?n.cacheHit/i*100:0,total:r,share:0}}).sort((e,t)=>t.total-e.total).map(t=>({...t,share:e>0?t.total/e:0}))},[c]),D=(0,d.useMemo)(()=>{let e=Object.entries(t.byTool??{}),n=e.slice(0,8),r=e.slice(8).reduce((e,[,t])=>e+t,0),i=e.reduce((e,[,t])=>e+t,0);return{top:n,rest:r>0?[[`…`,r]]:[],totalCalls:i}},[t.byTool]),O=(0,d.useMemo)(()=>{let e=S.length;if(e===0)return null;let t=680-q.left-q.right,n=200-q.top-q.bottom,r=Math.max(...p===`model`?C.map(e=>e.total):S.map(e=>e.miss+e.hit+e.output),1),i=e=>q.top+n-e/r*n,a=t/e,o=Math.min(20,a*.6),s=n=>e===1?q.left+t/2:q.left+t*n/(e-1),c=Math.max(1,Math.ceil(e/8)),l=[];for(let t=0;t<e;t+=c)l.push(t);return e>0&&l[l.length-1]!==e-1&&l.push(e-1),{n:e,plotW:t,plotH:n,max:r,y:i,barW:o,inner:s,indices:l,groupW:a}},[S,C,p]),te=()=>{wn(`token-daily-${G()}.csv`,jn(S),`text/csv`)},k=()=>{wn(`token-${G()}.json`,kn(S,ee,C,l),`application/json`)},A=u===null?void 0:S[u],j=u===null?void 0:C[u],ne=O===null?0:Math.ceil(80/Math.max(O.groupW,1)),re=u===null||O===null?void 0:u>=O.n-ne?z.chartTooltipAlignRight:u<ne?z.chartTooltipAlignLeft:void 0;return(0,m.jsxs)(`div`,{className:z.tokenPanel,"data-testid":`billing-token-panel`,children:[(0,m.jsxs)(`div`,{className:z.exportBar,role:`group`,"aria-label":i(`tokenExport`),children:[(0,m.jsx)(`span`,{className:z.exportLabel,children:i(`export`)}),(0,m.jsx)(`button`,{type:`button`,className:z.exportButton,"data-testid":`billing-token-export-csv`,onClick:te,children:i(`tokenExportCsv`)}),(0,m.jsx)(`button`,{type:`button`,className:z.exportButton,"data-testid":`billing-token-export-json`,onClick:k,children:i(`exportJson`)})]}),(0,m.jsxs)(`section`,{className:z.panel,"data-testid":`billing-token-daily`,children:[(0,m.jsxs)(`div`,{className:z.panelHead,children:[(0,m.jsx)(`h3`,{className:z.panelTitle,children:i(`tokenDaily`)}),(0,m.jsxs)(`span`,{className:z.panelHeadControls,children:[v&&(0,m.jsx)(`span`,{className:z.rangeToggle,role:`group`,"aria-label":i(`tokenDaily`),children:[`structure`,`model`].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(z.rangeButton,p===e&&z.rangeButtonActive),"aria-pressed":p===e,onClick:()=>{b(e)},"data-testid":`billing-token-view-${e}`,children:i(e===`structure`?`tokenViewStructure`:`tokenViewModel`)},e))}),(0,m.jsx)(`span`,{className:z.rangeToggle,role:`group`,"aria-label":i(`tokenDaily`),children:[7,30].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(z.rangeButton,n===e&&z.rangeButtonActive),"aria-pressed":n===e,onClick:()=>{r(e)},"data-testid":`billing-token-${e}d`,children:i(e===7?`trend7d`:`trend30d`)},e))})]})]}),O===null||p===`model`&&w.length===0?(0,m.jsx)(`div`,{className:z.chartEmpty,children:i(`trendEmpty`)}):(0,m.jsxs)(`div`,{className:z.chartWrap,children:[(0,m.jsxs)(`svg`,{viewBox:`0 0 680 200`,className:z.chartSvg,role:`img`,"aria-label":i(`tokenDaily`),onMouseLeave:()=>{f(null)},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),n=((e.clientX-t.left)/t.width*680-q.left)/O.plotW,r=Math.round(n*(O.n-1));f(Math.min(Math.max(r,0),O.n-1))},children:[[0,.5,1].map(e=>{let t=O.max*e,n=O.y(t);return(0,m.jsxs)(`g`,{children:[(0,m.jsx)(`line`,{x1:q.left,x2:680-q.right,y1:n,y2:n,className:z.chartGrid}),(0,m.jsx)(`text`,{x:q.left-8,y:n+3,textAnchor:`end`,className:z.chartAxisLabel,children:Tn(t)})]},e)}),p===`structure`?S.map((e,t)=>{let n=O.inner(t)-O.barW/2,r=O.y(0),i=O.y(e.miss),a=O.y(e.miss+e.hit),o=O.y(e.miss+e.hit+e.output);return(0,m.jsxs)(`g`,{children:[(0,m.jsx)(`rect`,{x:n,y:i,width:O.barW,height:r-i,fill:En}),(0,m.jsx)(`rect`,{x:n,y:a,width:O.barW,height:i-a,fill:Dn}),(0,m.jsx)(`rect`,{x:n,y:o,width:O.barW,height:a-o,fill:On})]},e.date)}):C.map((e,t)=>{let n=O.inner(t)-O.barW/2,r=0;return(0,m.jsx)(`g`,{children:w.map(t=>{let i=e.models[t.key];if(i===void 0)return null;let a=O.y(r);r+=i.total;let o=O.y(r),s=T!==null&&t.key!==T;return(0,m.jsx)(`rect`,{x:n,y:o,width:O.barW,height:a-o,fill:t.color,opacity:s?.15:1},t.key)})},e.date)}),O.indices.map(e=>{let t=S[e];return t===void 0?null:(0,m.jsx)(`text`,{x:O.inner(e),y:194,textAnchor:`middle`,className:z.chartAxisLabel,children:t.date.slice(5)},t.date)}),u!==null&&(0,m.jsx)(`line`,{x1:O.inner(u),x2:O.inner(u),y1:q.top,y2:q.top+O.plotH,className:z.chartCrosshair})]}),u!==null&&p===`structure`&&A!==void 0&&(0,m.jsxs)(`div`,{className:y(z.chartTooltip,re),"data-testid":`billing-token-tooltip`,style:{left:`${O.inner(u)/680*100}%`,top:`${O.y(A.miss+A.hit+A.output)/200*100}%`},children:[(0,m.jsxs)(`div`,{className:z.chartTooltipHead,children:[(0,m.jsx)(`span`,{className:z.chartTooltipDate,children:A.date}),(0,m.jsx)(`strong`,{children:(A.miss+A.hit+A.output).toLocaleString()})]}),(0,m.jsxs)(`div`,{className:y(z.chartTooltipRow,z.chartTooltipSplit),children:[(0,m.jsxs)(`span`,{className:z.chartTooltipLabel,children:[(0,m.jsx)(`span`,{className:z.chartTooltipSwatch,style:{background:Dn}}),i(`tokenHit`)]}),(0,m.jsx)(`strong`,{children:A.hit.toLocaleString()})]}),(0,m.jsxs)(`div`,{className:y(z.chartTooltipRow,z.chartTooltipSplit),children:[(0,m.jsxs)(`span`,{className:z.chartTooltipLabel,children:[(0,m.jsx)(`span`,{className:z.chartTooltipSwatch,style:{background:En}}),i(`tokenMiss`)]}),(0,m.jsx)(`strong`,{children:A.miss.toLocaleString()})]}),(0,m.jsxs)(`div`,{className:y(z.chartTooltipRow,z.chartTooltipSplit),children:[(0,m.jsxs)(`span`,{className:z.chartTooltipLabel,children:[(0,m.jsx)(`span`,{className:z.chartTooltipSwatch,style:{background:On}}),i(`tokenOutput`)]}),(0,m.jsx)(`strong`,{children:A.output.toLocaleString()})]})]}),u!==null&&p===`model`&&j!==void 0&&(0,m.jsxs)(`div`,{className:y(z.chartTooltip,re),"data-testid":`billing-token-tooltip`,style:{left:`${O.inner(u)/680*100}%`,top:`${O.y(j.total)/200*100}%`},children:[(0,m.jsxs)(`div`,{className:z.chartTooltipHead,children:[(0,m.jsx)(`span`,{className:z.chartTooltipDate,children:j.date}),(0,m.jsx)(`strong`,{children:j.total.toLocaleString()})]}),w.map(e=>{let t=j.models[e.key];return t===void 0?null:(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`div`,{className:y(z.chartTooltipRow,z.chartTooltipSplit),children:[(0,m.jsxs)(`span`,{className:z.chartTooltipLabel,children:[(0,m.jsx)(`span`,{className:z.chartTooltipSwatch,style:{background:e.color}}),e.name]}),(0,m.jsx)(`strong`,{children:t.total.toLocaleString()})]}),(0,m.jsxs)(`div`,{className:z.chartTooltipModelDetail,children:[i(`tokenHitShort`),` `,t.hit.toLocaleString(),` · `,i(`tokenMissShort`),` `,t.miss.toLocaleString(),` · `,i(`tokenOutput`),` `,t.output.toLocaleString()]})]},e.key)})]}),(0,m.jsx)(`div`,{className:z.chartLegend,children:p===`structure`?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:z.chartTooltipSwatch,style:{background:En}}),i(`tokenMiss`)]}),(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:z.chartTooltipSwatch,style:{background:Dn}}),i(`tokenHit`)]}),(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:z.chartTooltipSwatch,style:{background:On}}),i(`tokenOutput`)]})]}):w.map(e=>(0,m.jsxs)(`button`,{type:`button`,className:y(z.chartLegendItem,T===e.key&&z.chartLegendItemActive),"aria-pressed":T===e.key,"data-testid":`billing-token-legend-${e.key}`,onClick:()=>{E(e.key)},children:[(0,m.jsx)(`span`,{className:z.chartTooltipSwatch,style:{background:e.color}}),e.name]},e.key))})]})]}),(0,m.jsxs)(`section`,{className:z.panel,"data-testid":`billing-token-models`,children:[(0,m.jsx)(`div`,{className:z.panelHead,children:(0,m.jsx)(`h3`,{className:z.panelTitle,children:i(`tokenByModel`)})}),ee.length===0?(0,m.jsx)(`div`,{className:z.emptyRow,children:i(`noData`)}):(0,m.jsx)(`div`,{className:z.tableScroll,children:(0,m.jsxs)(`table`,{className:z.modelTable,"data-testid":`billing-token-model-table`,children:[(0,m.jsx)(`thead`,{children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{children:i(`model`)}),(0,m.jsx)(`th`,{className:z.numCol,children:i(`inputTokens`)}),(0,m.jsx)(`th`,{className:z.numCol,children:i(`outputTokens`)}),(0,m.jsx)(`th`,{className:z.numCol,children:i(`tokenReasoningShort`)}),(0,m.jsx)(`th`,{className:z.numCol,children:i(`cacheHitRate`)}),(0,m.jsx)(`th`,{className:z.numCol,children:i(`tokenTotal`)}),(0,m.jsx)(`th`,{className:z.numCol,children:i(`tokenShare`)}),(0,m.jsx)(`th`,{className:z.numCol,children:i(`calls`)})]})}),(0,m.jsx)(`tbody`,{children:ee.map(e=>(0,m.jsxs)(`tr`,{"data-testid":`billing-token-model`,className:y(v&&z.modelRowFocusable,T===e.key&&z.modelRowActive),"aria-selected":v?T===e.key:void 0,onClick:v?()=>{E(e.key)}:void 0,tabIndex:v?0:void 0,onKeyDown:v?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),E(e.key))}:void 0,children:[(0,m.jsx)(`td`,{children:(0,m.jsx)(`span`,{className:z.modelName,children:e.name})}),(0,m.jsx)(`td`,{className:z.numCol,children:K(e.input)}),(0,m.jsx)(`td`,{className:z.numCol,children:K(e.output)}),(0,m.jsx)(`td`,{className:z.numCol,children:e.reasoning>0?K(e.reasoning):(0,m.jsx)(`span`,{className:z.na,children:`—`})}),(0,m.jsxs)(`td`,{className:z.numCol,children:[e.cacheHitRate.toFixed(1),`%`]}),(0,m.jsx)(`td`,{className:z.numCol,children:K(e.total)}),(0,m.jsx)(`td`,{className:z.numCol,children:(0,m.jsxs)(`span`,{className:z.tokenModelShareRow,children:[(0,m.jsx)(`span`,{className:z.tokenModelBar,children:(0,m.jsxs)(`span`,{className:z.tokenModelParts,style:{width:`${(e.share*100).toFixed(2)}%`},children:[(0,m.jsx)(`span`,{className:z.tokenModelPartIn,style:{width:`${e.total>0?e.input/e.total*100:0}%`}}),(0,m.jsx)(`span`,{className:z.tokenModelPartOut,style:{width:`${e.total>0?e.output/e.total*100:0}%`}})]})}),(e.share*100).toFixed(1),`%`]})}),(0,m.jsx)(`td`,{className:z.numCol,children:e.calls.toLocaleString()})]},e.key))})]})})]}),D.totalCalls>0&&(0,m.jsxs)(`section`,{className:z.panel,"data-testid":`billing-token-tools`,children:[(0,m.jsx)(`div`,{className:z.panelHead,children:(0,m.jsx)(`h3`,{className:z.panelTitle,children:i(`toolRank`)})}),(0,m.jsx)(`div`,{className:z.tableScroll,children:(0,m.jsxs)(`table`,{className:z.modelTable,"data-testid":`billing-tool-table`,children:[(0,m.jsx)(`thead`,{children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{children:i(`toolName`)}),(0,m.jsx)(`th`,{className:z.numCol,children:i(`calls`)}),(0,m.jsx)(`th`,{className:z.numCol,children:i(`tokenShare`)})]})}),(0,m.jsx)(`tbody`,{children:[...D.top,...D.rest].map(([e,t])=>(0,m.jsxs)(`tr`,{"data-testid":`billing-tool-row`,children:[(0,m.jsx)(`td`,{children:(0,m.jsx)(`span`,{className:z.modelName,children:e})}),(0,m.jsx)(`td`,{className:z.numCol,children:t.toLocaleString()}),(0,m.jsxs)(`td`,{className:z.numCol,children:[(t/D.totalCalls*100).toFixed(1),`%`]})]},e))})]})})]}),x.length>0&&(0,m.jsxs)(`section`,{className:z.panel,"data-testid":`billing-panel-roles`,children:[(0,m.jsxs)(`div`,{className:z.panelHead,children:[(0,m.jsx)(`h3`,{className:z.panelTitle,children:i(`roleCost`)}),(0,m.jsx)(`span`,{className:z.panelHint,children:i(`roleHint`)})]}),(0,m.jsx)(`div`,{className:z.shareTrack,"data-testid":`billing-role-track`,children:x.map(e=>(0,m.jsx)(`div`,{className:y(z.shareSeg,e.seg),style:{width:`${e.pct}%`}},e.label))}),(0,m.jsx)(`div`,{className:z.shareLegend,children:x.map(e=>(0,m.jsxs)(`span`,{className:z.shareItem,children:[(0,m.jsx)(`span`,{className:y(z.shareDot,e.seg)}),e.label,(0,m.jsxs)(`span`,{className:z.shareValue,children:[a(e.value),` · `,e.pct.toFixed(1),`%`]})]},e.label))})]})]})}function jn(e){return[`date,missInput,cacheHit,output,reasoning,total`,...e.map(e=>`${e.date},${e.miss},${e.hit},${e.output},${e.reasoning},${e.miss+e.hit+e.output}`)].join(`
5
- `)}function Mn(){let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}let J={top:18,right:40,bottom:26,left:46};function Nn(e){let[,t,n]=e.split(`-`);return`${Number(t)}/${Number(n)}`}function Pn(e,t){let n=[];for(let r=0;r<e;r+=t)n.push(r);return e>0&&n[n.length-1]!==e-1&&n.push(e-1),n}let Fn={key:`__total__`,name:``,color:``};function In({data:e,models:t=[],currency:n=`cny`,metric:r=`cost`,t:i}){let a=i??(e=>V[e]),[o,s]=(0,d.useState)(null),c=e=>fn(dn(e,n),n),l=e=>r===`tokens`?Tn(e):c(e),u=e=>r===`tokens`?e.tokens??0:e.cost,f=(0,d.useMemo)(()=>{let n=e.length;if(n===0)return null;let i=680-J.left-J.right,a=220-J.top-J.bottom,o=e=>n===1?J.left+i/2:J.left+i*e/(n-1),s=Math.max(...r===`tokens`?e.map(e=>e.tokens??0):e.map(e=>Math.max(e.cost,Object.values(e.byModel??{}).reduce((e,t)=>e+t,0))),1e-4),c=e=>J.top+a-e/s*a,l=Math.max(...e.map(e=>e.calls),1),d=e=>J.top+a-e/l*a,f=i/n,p=Math.min(18,f*.6);return{n,plotW:i,plotH:a,inner:o,yCost:c,yCalls:d,barW:p,bars:e.flatMap((e,n)=>{let i=o(n)-p/2;if(t.length===0||r===`tokens`)return[{date:e.date,model:Fn,x:i,base:0,value:u(e),topRounded:!0}];let a=null;for(let n of t)(e.byModel?.[n.key]??0)>0&&(a=n.key);let s=0;return t.map(t=>{let n=e.byModel?.[t.key]??0,r={date:e.date,model:t,x:i,base:s,value:n,topRounded:t.key===a};return s+=n,r})}),costTicks:[0,.25,.5,.75,1].map(e=>s*e).reverse(),callsTicks:[0,.25,.5,.75,1].map(e=>l*e).reverse(),linePath:e.map((e,t)=>{let n=d(e.calls);return`${t===0?`M`:`L`}${o(t)} ${n}`}).join(` `)}},[e,t,r]);if(f===null)return(0,m.jsx)(`div`,{className:z.chartEmpty,children:a(`trendEmpty`)});let{n:p,plotW:h,plotH:g,inner:_,yCost:v,yCalls:y,barW:b,bars:x,costTicks:S,callsTicks:C,linePath:w}=f,T=o===null?void 0:e[o],E=Pn(p,Math.max(1,Math.ceil(p/8)));return(0,m.jsxs)(`div`,{className:z.chartWrap,children:[(0,m.jsxs)(`svg`,{viewBox:`0 0 680 220`,className:z.chartSvg,role:`img`,"aria-label":`Daily cost by model and total calls`,onMouseLeave:()=>{s(null)},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),n=((e.clientX-t.left)/t.width*680-J.left)/h,r=Math.round(n*(p-1));s(Math.min(Math.max(r,0),p-1))},children:[S.map((e,t)=>{let n=v(e);return(0,m.jsxs)(`g`,{children:[(0,m.jsx)(`line`,{x1:J.left,x2:680-J.right,y1:n,y2:n,className:z.chartGrid}),(0,m.jsx)(`text`,{x:J.left-8,y:n+3,textAnchor:`end`,className:z.chartAxisLabel,children:l(e)})]},`cost-${t}`)}),x.map(t=>{if(t.value>0)return(0,m.jsx)(`rect`,{x:t.x,y:v(t.base+t.value),width:b,height:v(t.base)-v(t.base+t.value),rx:t.topRounded?2:0,className:t.model.color===``?z.chartBar:z.chartStack,style:t.model.color===``?void 0:{fill:t.model.color}},`${t.date}-${t.model.key}`);let n=e.find(e=>e.date===t.date);return n!==void 0&&n.calls>0&&t.base===0?(0,m.jsx)(`rect`,{x:t.x,y:v(0)-1,width:b,height:1,rx:0,className:z.chartBarPlaceholder},`${t.date}-${t.model.key}-placeholder`):null}),(0,m.jsx)(`path`,{d:w,fill:`none`,className:z.chartLine}),(()=>{let t=Mn(),n=e.findIndex(e=>e.date===t);return n>=0?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`defs`,{children:(0,m.jsxs)(`linearGradient`,{id:`chartAreaGrad`,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`,children:[(0,m.jsx)(`stop`,{offset:`0%`,stopColor:`var(--ds-blue)`,stopOpacity:`0.35`}),(0,m.jsx)(`stop`,{offset:`100%`,stopColor:`var(--ds-blue)`,stopOpacity:`0`})]})}),(0,m.jsx)(`path`,{d:`${w} L ${_(e.length-1)} ${y(0)} L ${_(0)} ${y(0)} Z`,fill:`url(#chartAreaGrad)`}),(0,m.jsx)(`line`,{x1:_(n),x2:_(n),y1:J.top,y2:J.top+g,stroke:`var(--ds-amber)`,strokeWidth:`1`,strokeDasharray:`3 3`,opacity:`0.6`}),(0,m.jsx)(`text`,{x:_(n)+4,y:J.top-6,fill:`var(--ds-amber)`,fontSize:`10`,fontFamily:`var(--font-num)`,children:Nn(t)})]}):null})(),C.map((e,t)=>{let n=y(e);return(0,m.jsx)(`text`,{x:680-J.right+8,y:n+3,textAnchor:`start`,className:z.chartAxisLabel,children:Tn(e)},`calls-${t}`)}),E.map(t=>{let n=e[t];return n===void 0?null:(0,m.jsx)(`text`,{x:_(t),y:214,textAnchor:`middle`,className:z.chartAxisLabel,children:Nn(n.date)},n.date)}),o!==null&&(0,m.jsx)(`line`,{x1:_(o),x2:_(o),y1:J.top,y2:J.top+g,className:z.chartCrosshair})]}),T!==void 0&&o!==null&&(0,m.jsxs)(`div`,{className:z.chartTooltip,style:{left:`${_(o)/680*100}%`,top:`${v(T.cost)/220*100}%`},children:[(0,m.jsx)(`div`,{className:z.chartTooltipDate,children:T.date}),r!==`tokens`&&t.filter(e=>(T.byModel?.[e.key]??0)>0).map(e=>(0,m.jsxs)(`div`,{className:z.chartTooltipRow,children:[(0,m.jsx)(`span`,{className:z.chartTooltipSwatch,style:{background:e.color}}),e.name,` `,(0,m.jsx)(`strong`,{children:c(T.byModel?.[e.key]??0)})]},e.key)),(0,m.jsxs)(`div`,{className:z.chartTooltipRow,children:[(0,m.jsx)(`span`,{className:z.chartLegendBar}),a(`trendTotal`),` `,(0,m.jsx)(`strong`,{children:r===`tokens`?Tn(T.tokens??0):c(T.cost)})]}),(0,m.jsxs)(`div`,{className:z.chartTooltipRow,children:[(0,m.jsx)(`span`,{className:z.chartLegendLine}),a(`calls`),` `,(0,m.jsx)(`strong`,{children:T.calls.toLocaleString()})]})]}),t.length>0&&r!==`tokens`&&(0,m.jsxs)(`div`,{className:z.chartLegend,children:[t.map(e=>(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:z.chartTooltipSwatch,style:{background:e.color}}),e.name]},e.key)),(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:z.chartLegendLine}),a(`calls`)]})]})]})}let Y={top:14,right:42,bottom:22,left:46};function Ln(e){return e.slice(5,13).replace(`T`,` `)}function Rn(e){return String(e>=100?Math.round(e):Number(e.toFixed(1)))}function zn(e){return e<1e4?`${Math.round(e)} ms`:e<6e4?`${(e/1e3).toFixed(1)} s`:`${(e/6e4).toFixed(1)} min`}function Bn(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toFixed(1)}function Vn(e,t,n){return t===`ttft`?`${Math.round(e)} ms`:`${e.toFixed(1)} ${n(`perfTpsUnit`)}`}function Hn({perf:e,models:t,t:n}){let[r,i]=(0,d.useState)(()=>ze()),[a,o]=(0,d.useState)(null),s=e=>{i(e),L(e)},c=e=>t.find(t=>t.key===e)?.color??`#8b95a3`,l=(0,d.useMemo)(()=>e===void 0?[]:Object.entries(e.byModel).map(([e,n])=>({key:e,name:t.find(t=>t.key===e)?.name??e,color:c(e),samples:n.samples,ttftAvg:n.ttftAvg,ttftP50:n.ttftP50,ttftP90:n.ttftP90,...n.ttftMax===void 0?{}:{ttftMax:n.ttftMax},...n.ttftSpikes===void 0?{}:{ttftSpikes:n.ttftSpikes},...n.tpsAvg===void 0?{}:{tpsAvg:n.tpsAvg},latencyAvg:n.latencyAvg,estimatedSamples:n.estimatedSamples})).sort((e,t)=>t.samples-e.samples||t.ttftP90-e.ttftP90),[e,t]),u=(0,d.useMemo)(()=>{if(e===void 0)return[];if(r.models!==void 0){let t=new Set(Object.keys(e.byModel));return r.models.filter(e=>t.has(e))}return l.slice(0,5).map(e=>e.key)},[e,l,r.models]),f=(0,d.useMemo)(()=>{if(e===void 0)return null;let t=Object.keys(e.byHourModel).sort().slice(-48);if(t.length===0)return null;let n=t.length,i=680-Y.left-Y.right,a=180-Y.top-Y.bottom,o=e=>n===1?Y.left+i/2:Y.left+i*e/(n-1),s=new Set(u),c=e=>r.metric===`ttft`?e?.ttftAvg:e?.tpsAvg,d=[],f=0;for(let r of l){if(!s.has(r.key))continue;let i=[];for(let a=0;a<n;a++){let n=t[a];if(n===void 0)continue;let s=c(e.byHourModel[n]?.[r.key]);s===void 0||!Number.isFinite(s)||(i.push({i:a,x:o(a),y:0,v:s}),s>f&&(f=s))}d.push({key:r.key,name:r.name,color:r.color,segments:[],points:i})}let p=d.reduce((e,t)=>e+t.points.length,0);f=Math.max(f,1);let m=e=>Y.top+a-e/f*a;for(let e of d){let t=``,n=-2;for(let r of e.points)r.y=m(r.v),t!==``&&r.i!==n+1&&(e.segments.push(t),t=``),t+=`${t===``?`M`:`L`}${r.x} ${r.y} `,n=r.i;t!==``&&e.segments.push(t)}let h=Math.max(1,Math.ceil(n/8)),g=[];for(let e=0;e<n;e+=h)g.push(e);return g[g.length-1]!==n-1&&g.push(n-1),{hourKeys:t,n,plotW:i,plotH:a,inner:o,yOf:m,series:d,ticks:[0,.5,1].map(e=>f*e).reverse(),xTicks:g,totalPoints:p}},[e,l,u,r.metric]);if(e===void 0||l.length===0)return(0,m.jsx)(`div`,{className:z.chartEmpty,"data-testid":`billing-perf-empty`,children:n(`perfEmpty`)});let p=e=>{let t=u.includes(e)?u.filter(t=>t!==e):[...u,e];s({metric:r.metric,models:t})},h=e=>{s({metric:e,...r.models===void 0?{}:{models:r.models}})},g=a===null||f===null?[]:f.series.flatMap(e=>{let t=e.points.find(e=>e.i===a);return t===void 0?[]:[{key:e.key,name:e.name,color:e.color,v:t.v}]});return(0,m.jsxs)(`div`,{"data-testid":`billing-perf-panel`,children:[l.length>0&&(()=>{let e=Math.max(...l.map(e=>e.ttftAvg),1),t=Math.max(...l.filter(e=>e.tpsAvg!==void 0).map(e=>e.tpsAvg??0),1),r=Math.max(...l.map(e=>e.latencyAvg),1),i=l.reduce((e,t)=>e+t.samples,0),a=l.length>0?l.reduce((e,t)=>e+t.ttftAvg,0)/l.length:0,o=l.map(e=>e.tpsAvg).filter(e=>e!==void 0),s=o.length>0?o.reduce((e,t)=>e+t,0)/o.length:0,c=l.length>0?l.reduce((e,t)=>e+t.latencyAvg,0)/l.length:0,u=[{lbl:n(`perfSamples`),val:i.toLocaleString(),unit:``,pct:65,color:`var(--ds-blue)`},{lbl:n(`perfTtft`),val:zn(a),unit:``,pct:a/e*100,color:`var(--ds-green)`},{lbl:n(`perfTps`),val:o.length>0?Bn(s):`—`,unit:``,pct:s/t*100,color:`var(--ds-blue)`},{lbl:n(`perfLatency`),val:zn(c),unit:``,pct:c/r*100,color:`var(--ds-amber)`}];return(0,m.jsx)(`div`,{className:z.perfHero,"data-testid":`billing-perf-hero`,children:u.map((e,t)=>(0,m.jsxs)(`div`,{className:z.perfHeroCell,children:[(0,m.jsx)(`div`,{className:z.perfHeroLbl,children:e.lbl}),(0,m.jsxs)(`div`,{className:z.perfHeroVal,children:[e.val,e.unit!==``&&(0,m.jsx)(`span`,{className:z.perfHeroUnit,children:e.unit})]}),(0,m.jsx)(`div`,{className:z.perfHeroBar,children:(0,m.jsx)(`i`,{style:{width:`${Math.min(100,e.pct)}%`,background:e.color}})})]},t))})})(),(0,m.jsx)(`div`,{className:z.tableScroll,"data-testid":`billing-perf-table`,children:(0,m.jsxs)(`table`,{className:z.modelTable,children:[(0,m.jsx)(`thead`,{children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{children:n(`model`)}),(0,m.jsx)(`th`,{className:z.numCol,children:n(`perfSamples`)}),(0,m.jsx)(`th`,{className:z.numCol,children:n(`perfTtft`)}),(0,m.jsx)(`th`,{className:z.numCol,children:n(`perfP50`)}),(0,m.jsx)(`th`,{className:z.numCol,children:n(`perfP90`)}),(0,m.jsx)(`th`,{className:z.numCol,children:n(`perfMax`)}),(0,m.jsx)(`th`,{className:z.numCol,children:n(`perfTps`)}),(0,m.jsx)(`th`,{className:z.numCol,children:n(`perfLatency`)}),(0,m.jsx)(`th`,{className:z.numCol,children:n(`perfEstimated`)})]})}),(0,m.jsx)(`tbody`,{children:l.map(e=>(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`td`,{children:(0,m.jsxs)(`span`,{className:z.modelCell,children:[(0,m.jsx)(`span`,{className:z.modelDot,style:{background:e.color}}),(0,m.jsx)(`span`,{className:z.modelName,children:e.name})]})}),(0,m.jsx)(`td`,{className:z.numCol,children:e.samples.toLocaleString()}),(0,m.jsx)(`td`,{className:z.numCol,children:zn(e.ttftAvg)}),(0,m.jsx)(`td`,{className:z.numCol,children:zn(e.ttftP50)}),(0,m.jsx)(`td`,{className:z.numCol,children:zn(e.ttftP90)}),(0,m.jsx)(`td`,{className:z.numCol,children:e.ttftMax===void 0?(0,m.jsx)(`span`,{className:z.na,children:`—`}):(0,m.jsxs)(`span`,{children:[zn(e.ttftMax),e.ttftSpikes!==void 0&&e.ttftSpikes>0?` (${e.ttftSpikes}↑)`:``]})}),(0,m.jsx)(`td`,{className:z.numCol,children:e.tpsAvg===void 0?(0,m.jsx)(`span`,{className:z.na,children:`—`}):Bn(e.tpsAvg)}),(0,m.jsx)(`td`,{className:z.numCol,children:zn(e.latencyAvg)}),(0,m.jsx)(`td`,{className:z.numCol,children:e.estimatedSamples>0?e.estimatedSamples:(0,m.jsx)(`span`,{className:z.na,children:`—`})})]},e.key))})]})}),l.length>0&&(()=>{let e=Math.max(...l.map(e=>e.ttftP50),1),t=e=>e<.8?`var(--ds-green)`:e<2?`var(--ds-amber)`:`var(--ds-red)`;return(0,m.jsx)(`div`,{className:z.perfCompareList,"data-testid":`billing-perf-compare`,children:l.map(n=>(0,m.jsxs)(`div`,{className:z.perfCompareRow,children:[(0,m.jsxs)(`div`,{className:z.perfCompareName,children:[(0,m.jsx)(`span`,{className:z.perfCompareDot,style:{background:n.color}}),(0,m.jsx)(`span`,{children:n.name})]}),(0,m.jsx)(`div`,{className:z.perfCompareBar,children:(0,m.jsx)(`i`,{style:{width:`${n.ttftP50/e*100}%`,background:t(n.ttftP50)}})}),(0,m.jsx)(`div`,{className:z.perfCompareNum,children:zn(n.ttftP50)}),(0,m.jsx)(`div`,{className:z.perfCompareNum,children:n.tpsAvg===void 0?`—`:Bn(n.tpsAvg)})]},n.key))})})(),f!==null&&(0,m.jsxs)(`div`,{"data-testid":`billing-perf-hour`,children:[(0,m.jsx)(`div`,{className:z.perfBar,children:(0,m.jsx)(`span`,{className:z.rangeToggle,role:`group`,"aria-label":n(`perfTitle`),children:[`ttft`,`tps`].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(z.rangeButton,r.metric===e&&z.rangeButtonActive),"aria-pressed":r.metric===e,"data-testid":`billing-perf-tab-${e}`,onClick:()=>{h(e)},children:e===`ttft`?`${n(`perfTtft`)} (ms)`:`${n(`perfTps`)} (${n(`perfTpsUnit`)})`},e))})}),(0,m.jsxs)(`div`,{className:z.perfChips,role:`group`,"aria-label":n(`model`),children:[(0,m.jsx)(`button`,{type:`button`,className:z.perfChip,"data-testid":`billing-perf-chip-all`,onClick:()=>{s({metric:r.metric,models:l.map(e=>e.key)})},children:n(`perfAll`)}),l.map(e=>{let t=u.includes(e.key);return(0,m.jsxs)(`button`,{type:`button`,className:y(z.perfChip,!t&&z.perfChipOff),style:t?{color:e.color,borderColor:`color-mix(in srgb, ${e.color} 45%, transparent)`}:void 0,"aria-pressed":t,"data-testid":`billing-perf-chip-${e.key}`,onClick:()=>{p(e.key)},children:[(0,m.jsx)(`span`,{className:z.perfChipDot,style:{background:t?e.color:`var(--dsw-alias-label-dimmed)`}}),e.name]},e.key)})]}),f.totalPoints>0?(0,m.jsxs)(`div`,{className:z.chartWrap,children:[(0,m.jsxs)(`svg`,{viewBox:`0 0 680 180`,className:z.chartSvg,role:`img`,"aria-label":`Hourly perf comparison by model`,onMouseLeave:()=>{o(null)},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),n=((e.clientX-t.left)/t.width*680-Y.left)/f.plotW,r=Math.round(n*(f.n-1));o(Math.min(Math.max(r,0),f.n-1))},children:[f.ticks.map((e,t)=>{let n=f.yOf(e);return(0,m.jsxs)(`g`,{children:[(0,m.jsx)(`line`,{x1:Y.left,x2:680-Y.right,y1:n,y2:n,className:z.chartGrid}),(0,m.jsx)(`text`,{x:Y.left-8,y:n+3,textAnchor:`end`,className:z.chartAxisLabel,children:Rn(e)})]},`tick-${t}`)}),f.series.map(e=>e.segments.map((t,n)=>(0,m.jsx)(`path`,{d:t,fill:`none`,className:z.chartLine,style:{stroke:e.color}},`${e.key}-${n}`))),f.xTicks.map(e=>{let t=f.hourKeys[e];return t===void 0?null:(0,m.jsx)(`text`,{x:f.inner(e),y:174,textAnchor:`middle`,className:z.chartAxisLabel,children:Ln(t)},t)}),a!==null&&(0,m.jsx)(`line`,{x1:f.inner(a),x2:f.inner(a),y1:Y.top,y2:Y.top+f.plotH,className:z.chartCrosshair}),a!==null&&f.series.map(e=>{let t=e.points.find(e=>e.i===a);return t===void 0?null:(0,m.jsx)(`circle`,{cx:t.x,cy:t.y,r:3.5,fill:e.color,className:z.chartHoverDot},`${e.key}-dot`)})]}),a!==null&&g.length>0&&(0,m.jsxs)(`div`,{className:z.chartTooltip,"data-testid":`billing-perf-tooltip`,style:{left:`${f.inner(a)/680*100}%`,top:`${(Y.top+f.plotH/2)/180*100}%`},children:[(0,m.jsx)(`div`,{className:z.chartTooltipDate,children:Ln(f.hourKeys[a]??``)}),g.map(e=>(0,m.jsxs)(`div`,{className:z.chartTooltipRow,children:[(0,m.jsx)(`span`,{className:z.chartTooltipSwatch,style:{background:e.color}}),e.name,` `,(0,m.jsx)(`strong`,{children:Vn(e.v,r.metric,n)})]},e.key))]})]}):(0,m.jsx)(`div`,{className:z.chartEmpty,"data-testid":`billing-perf-chart-empty`,children:n(`perfChartEmpty`)})]}),f===null&&(0,m.jsx)(`div`,{className:z.chartEmpty,"data-testid":`billing-perf-chart-empty`,children:n(`perfChartEmpty`)})]})}let Un=`@kenz1117/dsh-ui-usage-billing`,Wn=`kenz1117`;function Gn({t:e,version:t}){return(0,m.jsxs)(`section`,{className:z.setCard,"data-testid":`billing-plugin-info`,children:[(0,m.jsxs)(`div`,{className:z.plgHead,children:[(0,m.jsx)(`span`,{className:z.plgIcon,"aria-hidden":`true`,children:(0,m.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,m.jsx)(`path`,{d:`M10 3a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a2 2 0 0 0 4 0V4a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v1a2 2 0 0 0 4 0 1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-1a2 2 0 0 0 0 4h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-1a2 2 0 0 0-4 0v1a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a2 2 0 0 0-4 0v1a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1v-1a2 2 0 0 0-4 0 1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1a2 2 0 0 0 0-4H3a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1a2 2 0 0 0 4 0z`})})}),(0,m.jsxs)(`div`,{className:z.plgTitle,children:[(0,m.jsxs)(`div`,{className:z.plgNameRow,children:[(0,m.jsx)(`h3`,{className:z.plgName,children:Un}),(0,m.jsx)(`span`,{className:z.plgTag,children:t===void 0?`—`:`v${t}`})]}),(0,m.jsx)(`p`,{className:z.plgDesc,children:`Usage billing dashboard for DeepSeek Harness`})]})]}),(0,m.jsxs)(`div`,{className:z.plgGrid,children:[(0,m.jsxs)(`div`,{className:z.plgItem,children:[(0,m.jsx)(`span`,{className:z.plgLabel,children:e(`pluginAuthor`)}),(0,m.jsxs)(`a`,{className:z.plgLink,href:`https://github.com/${Wn}`,target:`_blank`,rel:`noreferrer`,children:[`KenZ`,` (`,Wn,`)`]})]}),(0,m.jsxs)(`div`,{className:z.plgItem,children:[(0,m.jsx)(`span`,{className:z.plgLabel,children:e(`pluginRepository`)}),(0,m.jsx)(`a`,{className:z.plgLink,href:`https://github.com/kenz1117/dsh-ui-usage-billing`,target:`_blank`,rel:`noreferrer`,children:`GitHub`})]}),(0,m.jsxs)(`div`,{className:z.plgItem,children:[(0,m.jsx)(`span`,{className:z.plgLabel,children:e(`pluginNpm`)}),(0,m.jsx)(`a`,{className:z.plgLink,href:`https://www.npmjs.com/package/@kenz1117/dsh-ui-usage-billing`,target:`_blank`,rel:`noreferrer`,children:Un})]}),(0,m.jsxs)(`div`,{className:z.plgItem,children:[(0,m.jsx)(`span`,{className:z.plgLabel,children:e(`pluginLicense`)}),(0,m.jsx)(`span`,{className:z.plgVal,children:`MIT`})]})]})]})}function Kn(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}`}function X(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function qn(e){let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m${String(t%60).padStart(2,`0`)}s`}function Jn({rounds:e,flags:t,currency:n,t:r}){let i=(0,d.useMemo)(()=>e.slice(-40),[e]),a=(0,d.useMemo)(()=>new Set(t.map(e=>`${e.sessionId}:${e.turn}`)),[t]),o=(0,d.useMemo)(()=>Math.max(1e-4,...i.map(e=>e.cost)),[i]);if(i.length===0)return(0,m.jsxs)(`div`,{className:z.roundsEmpty,children:[r(`model`),` —`]});let s=e=>fn(dn(e,n),n);return(0,m.jsxs)(`div`,{className:z.rounds,children:[(0,m.jsx)(`div`,{className:z.roundsBars,role:`img`,"aria-label":`cost per turn`,children:i.map(e=>{let t=a.has(`${e.sessionId}:${e.turn}`),n=Math.max(1,e.cost/o*100),i=Pt(e.model,!1)===`deepseek-metered`&&wt(e.startedAt)===`peak`;return(0,m.jsxs)(`div`,{className:y(z.roundsBarCol,i?z.roundsBarColPeak:z.roundsBarColOff),children:[(0,m.jsx)(`span`,{className:z.roundsBarLabel,style:{bottom:`${n}%`},children:s(e.cost)}),(0,m.jsx)(`div`,{className:z.roundsBarWrap,children:(0,m.jsx)(`div`,{className:t?z.roundsBarFlagged:z.roundsBar,style:{height:`${n}%`},"data-testid":`round-bar`,title:`${r(`model`)} ${e.model} · ${s(e.cost)} · ${X(e.startedAt)}${e.endedAt===void 0?``:` → ${Kn(e.endedAt)} (${qn(e.endedAt-e.startedAt)})`}`,children:t&&(0,m.jsx)(`span`,{className:z.roundsFlagMark,"aria-hidden":`true`})})})]},`${e.sessionId}:${e.turn}`)})}),(0,m.jsxs)(`div`,{className:z.roundsAxis,children:[(0,m.jsxs)(`span`,{children:[r(`costAbbr`),` `,s(o)]}),(0,m.jsxs)(`span`,{children:[i.length,` `,r(`roundsUnit`)]})]})]})}let Yn=[`color-mix(in srgb, var(--dsb-3) 70%, transparent)`,`color-mix(in srgb, var(--ds-cyan) 30%, var(--dsb-3))`,`color-mix(in srgb, var(--ds-blue) 60%, var(--dsb-3))`,`var(--ds-blue)`,`var(--ds-amber)`],Xn=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Zn=e=>G(e.getTime());function Qn(e,t){let n=new Map;for(let t of e)n.set(t.date,t.value);let r=0;for(let e of n.values())e>r&&(r=e);let i=t.getFullYear(),a=t.getMonth(),o=t.getDate(),s=new Date(i,a+1,0).getDate(),c=new Date(i,a,1).getDay(),l=c+s,u=Math.ceil(l/7),d=[];for(let e=0;e<u;e+=1){let t=[];for(let l=0;l<7;l+=1){let u=e*7+l-c+1;if(u<1){let e=new Date(i,a,u);t.push({date:Zn(e),dayNum:e.getDate(),value:0,level:0,placeholder:!0});continue}if(u>s){let e=new Date(i,a+1,u-s);t.push({date:Zn(e),dayNum:e.getDate(),value:0,level:0,placeholder:!0});continue}let d=new Date(i,a,u),f=Zn(d),p=n.get(f)??0,m=0;if(p>0&&r>0){let e=Math.ceil(p/r*4);m=Math.min(4,Math.max(1,e))}let h=u>o;t.push({date:f,dayNum:u,value:h?0:p,level:h?0:m,placeholder:h})}d.push(t)}return d}function $n(e,t,n=52){let r=new Map;for(let t of e)r.set(t.date,t.value);let i=0;for(let e of r.values())e>i&&(i=e);let a=Zn(t),o=new Date(t);o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay());let s=new Date(o);s.setDate(o.getDate()-(n-1)*7);let c=[];for(let e=0;e<n;e+=1){let t=[];for(let n=0;n<7;n+=1){let o=new Date(s);o.setDate(s.getDate()+e*7+n);let c=Zn(o),l=c>a,u=l?0:r.get(c)??0,d=0;if(!l&&u>0&&i>0){let e=Math.ceil(u/i*4);d=Math.min(4,Math.max(1,e))}t.push({date:c,dayNum:o.getDate(),value:u,level:d,placeholder:l})}c.push(t)}return c}function er({days:e,currency:t,now:n,t:r,range:i=`month`,unit:a=`cost`}){let[o,s]=(0,d.useState)(null),c=e=>fn(dn(e,t),t),l=e=>a===`tokens`?K(e):c(e),u=(0,d.useMemo)(()=>Qn(e,n??new Date),[e,n]),f=Zn(n??new Date);if(i!==`month`){let t=$n(e,n??new Date,i===`half`?26:52),a=[],o=-1;return t.forEach((e,t)=>{let n=Number(e[0]?.date.slice(5,7)??0);n!==o&&(a.push({index:t,label:Xn[n-1]??``}),o=n)}),(0,m.jsxs)(`div`,{className:z.heatmapYear+(i===`half`?` `+z.heatmapHalf:``),"data-testid":i===`half`?`heatmap-half`:`heatmap-year`,children:[(0,m.jsxs)(`div`,{className:z.heatmapYearBody,children:[(0,m.jsx)(`div`,{className:z.heatmapYearWeekdays,"aria-hidden":`true`,children:[{label:`Mon`,row:1},{label:`Wed`,row:3},{label:`Fri`,row:5}].map(e=>(0,m.jsx)(`span`,{className:z.heatmapYearWeekday,style:{gridRow:e.row},children:e.label},e.label))}),(0,m.jsxs)(`div`,{className:z.heatmapYearScroll,children:[(0,m.jsx)(`div`,{className:z.heatmapYearMonths,"aria-hidden":`true`,"data-testid":`heatmap-year-months`,children:a.map(e=>(0,m.jsx)(`span`,{className:z.heatmapYearMonth,style:{gridColumn:e.index+1},children:e.label},e.index))}),(0,m.jsx)(`div`,{className:z.heatmapYearGrid,role:`img`,"aria-label":`yearly cost heatmap`,"data-testid":`heatmap-year-grid`,children:t.flat().map(e=>(0,m.jsx)(`button`,{type:`button`,className:z.heatmapYearCell,"data-testid":`heatmap-year-cell`,"data-level":e.level,"data-today":e.date===f?`true`:void 0,style:{background:Yn[e.level]},title:`${e.date} · ${l(e.value)}`,"aria-label":`${e.date}: ${l(e.value)}`,tabIndex:-1},e.date))})]})]}),(0,m.jsxs)(`div`,{className:z.heatmapFooter,children:[(0,m.jsx)(`span`,{children:r(`heatmapLess`)}),(0,m.jsx)(`span`,{className:z.heatmapLegend,children:Yn.map((e,t)=>(0,m.jsx)(`i`,{style:{background:e}},t))}),(0,m.jsx)(`span`,{children:r(`heatmapMore`)})]})]})}return(0,m.jsxs)(`div`,{className:z.heatmap,children:[(0,m.jsx)(`div`,{className:z.heatmapGrid,role:`img`,"aria-label":`daily cost heatmap`,children:u.map(e=>e.map(e=>e.placeholder?(0,m.jsx)(`div`,{className:z.heatmapCellEmpty,children:e.dayNum},e.date):(0,m.jsx)(`button`,{type:`button`,className:z.heatmapCell,"data-testid":`heatmap-cell`,"data-level":e.level,"data-today":e.date===f?`true`:void 0,style:{background:Yn[e.level]},title:`${e.date} · ${l(e.value)}`,"aria-label":`${e.date}: ${l(e.value)}`,onMouseEnter:()=>{s(e)},onMouseLeave:()=>{s(null)},onFocus:()=>{s(e)},onBlur:()=>{s(null)},children:e.dayNum},e.date)))}),(0,m.jsxs)(`div`,{className:z.heatmapFooter,children:[(0,m.jsx)(`span`,{children:r(`heatmapLess`)}),(0,m.jsx)(`span`,{className:z.heatmapLegend,children:Yn.map((e,t)=>(0,m.jsx)(`i`,{style:{background:e}},t))}),(0,m.jsx)(`span`,{children:r(`heatmapMore`)}),o!==null&&(0,m.jsxs)(`span`,{className:z.heatmapHover,"data-testid":`heatmap-hover`,children:[o.date,` · `,l(o.value)]})]})]})}let tr={window:6,threshold:2,reasonFactor:1.8,reasonHitDropPp:15};function nr(e){if(e.length===0)return null;let t=0;for(let n of e)t+=n;return t/e.length}function rr(e){let t=e.cacheHit+e.cacheMiss;return t<=0?null:e.cacheHit/t*100}function ir(e,t){let n=t?.window??tr.window,r=t?.threshold??tr.threshold,i=t?.reasonFactor??tr.reasonFactor,a=t?.reasonHitDropPp??tr.reasonHitDropPp,o=[];if(n<=0||r<=0)return o;let s=[],c=[],l=[],u=[];for(let t of e){if(t.cost<=0)continue;let e=t.output,d=t.input,f=rr(t),p=nr(s),m=[];if(p!==null&&p>0&&t.cost>p*r){let n=nr(c),r=nr(l),s=nr(u);n!==null&&n>0&&e>n*i&&m.push(`output-growth`),r!==null&&r>0&&d>r*i&&m.push(`context-bloat`),s!==null&&f!==null&&f<s-a&&m.push(`cache-hit-drop`),o.push({sessionId:t.sessionId,turn:t.turn,cost:t.cost,reasons:m})}for(s.push(t.cost),c.push(e),l.push(d),f!==null&&u.push(f);s.length>n;)s.shift();for(;c.length>n;)c.shift();for(;l.length>n;)l.shift();for(;u.length>n;)u.shift()}return o}let ar={},or={};function sr(){return(0,h.defineStore)({init:()=>({enabled:!1,amount:0,tierAlertDays:{},lastBalanceAlertDay:``,lastTierSwitchAt:0,modelBudgets:{},modelTierAlertDays:{}}),persist:`dsh.ui-usage-billing.budget`,actions:{setEnabled:(e,t)=>{e.enabled=t},setAmount:(e,t)=>{e.amount=Number.isFinite(t)&&t>0?t:0},markTierAlerted:(e,t,n)=>{e.tierAlertDays??={};for(let r of t)e.tierAlertDays[String(r)]=n},markBalanceAlerted:(e,t)=>{e.lastBalanceAlertDay=t},markTierSwitchAlerted:(e,t)=>{e.lastTierSwitchAt=t},setModelBudget:(e,t,n)=>{e.modelBudgets??={},Number.isFinite(n)&&n>0?e.modelBudgets[t]=n:delete e.modelBudgets[t]},markModelTierAlerted:(e,t,n)=>{e.modelTierAlertDays??={};for(let r of t)e.modelTierAlertDays[r]=n}}})}function cr(e,t){return e==null?null:Number.isFinite(e.nextSwitchInMs)&&e.nextSwitchInMs<=t?`soon`:e.tier===`peak`?`peak`:`offPeak`}let lr={显式缓存创建:`Explicit cache write`,显式缓存命中:`Explicit cache hit`,长期半价:`Half price`,与标准价一致:`Same as standard`,"限时 5 折":`Limited-time 50% off`};function ur(e,t){return e===void 0||t!==`en`?e:lr[e]??e}function dr(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>e.key.toLowerCase().includes(n)||(e.name??``).toLowerCase().includes(n)||(e.provider??``).toLowerCase().includes(n))}let fr={"智谱 AI":`Zhipu AI`,阿里通义:`Alibaba Qwen`,字节豆包:`ByteDance Doubao`,月之暗面:`Moonshot AI`,小米:`Xiaomi`,百度文心:`Baidu ERNIE`,腾讯混元:`Tencent Hunyuan`,零一万物:`01.AI`,阶跃星辰:`StepFun`,科大讯飞:`iFlytek Spark`,商汤:`SenseNova`,百川智能:`Baichuan`,"小米 Token Plan(海外)":`Xiaomi Token Plan (Global)`,"小米 Token Plan(国内)":`Xiaomi Token Plan (CN)`,"小米 Token Plan(新加坡)":`Xiaomi Token Plan (SG)`,"火山引擎 Token Plan":`Volcengine Token Plan`,"火山方舟 Token Plan":`Volcengine Ark Token Plan`,"豆包 Token Plan":`Doubao Token Plan`,"百度文心 Plan":`Baidu ERNIE Plan`,"MiniMax Token Plan(国内)":`MiniMax Token Plan (CN)`};function pr(e,t){return t===`en`?fr[e]??e:e}let mr={workbuddy:`WorkBuddy`,"workbuddy-ai":`WorkBuddy AI`},hr={"https://tokenhub.tencentmaas.com":`腾讯云 TokenHub`,"https://api.lkeap.cloud.tencent.com":`腾讯云 Token Plan`,"https://api.deepseek.com":`DeepSeek 官方`},gr={"腾讯云 TokenHub":`Tencent Cloud TokenHub`,"腾讯云 Token Plan":`Tencent Cloud Token Plan`,"DeepSeek 官方":`DeepSeek Official`};function _r(e){try{return new URL(e).host}catch{return e}}function vr(e,t=`zh`){if(e.startsWith(`site:`)){let n=e.slice(5),r=hr[n];return r===void 0?_r(n):t===`en`?gr[r]??r:r}if(e.startsWith(`direct:`)){let n=e.slice(7);if(/^deepseek(?:-[a-z0-9-]+)?$/i.test(n))return t===`en`?`DeepSeek Official`:`DeepSeek 官方`;let r=mr[n.trim().toLowerCase()];return r===void 0?`${t===`en`?`Direct`:`直连`} · ${n}`:`${t===`en`?`Direct`:`直连`} · ${r}`}}let yr=[`直连 · `,`Direct · `];function br(e){for(let t of yr)if(e.startsWith(t))return e.slice(t.length)}let xr=`dsh-billing-peak-alert-v1`,Sr={enabled:!1,leadMin:2,position:`bottom-right`,webNotify:!0,mode:`both`};function Cr(e,t,n){return t===null||n<=0?e:e===null?{...t,queueCount:n}:e.atMs===t.atMs&&e.entering===t.entering?{...e,queueCount:n}:e}function wr(e,t){if(e===null||e.queueCount===void 0)return e;if(t>0)return e.queueCount===t?e:{...e,queueCount:t};let{queueCount:n,...r}=e;return r}function Tr(){try{let e=localStorage.getItem(xr);if(e===null)return{...Sr};let t=JSON.parse(e),n=t.mode===`peak`||t.mode===`offPeak`?t.mode:Sr.mode,r=t.position===`center`?`center`:`bottom-right`;return{enabled:t.enabled===!0,leadMin:typeof t.leadMin==`number`&&Number.isFinite(t.leadMin)?Math.min(30,Math.max(1,Math.round(t.leadMin))):Sr.leadMin,position:r,webNotify:t.webNotify!==!1,mode:n}}catch{return{...Sr}}}function Er(e){try{localStorage.setItem(xr,JSON.stringify(e))}catch{x(`peak-config-storage-unavailable`)}}function Dr(e,t,n,r){if(!t.enabled)return null;let i=It(e,r,t.leadMin*6e4);return i===null||t.mode===`peak`&&i.entering!==`peak`||t.mode===`offPeak`&&i.entering!==`offPeak`||i.atMs===n?null:{...i,channel:r}}function Or({hit:e,config:t,t:n,onDismiss:r}){let[i,a]=(0,d.useState)(()=>Date.now());if((0,d.useEffect)(()=>{let e=setInterval(()=>a(Date.now()),3e4);return()=>clearInterval(e)},[]),(0,d.useEffect)(()=>{i>=e.atMs&&r()},[i,e.atMs,r]),i>=e.atMs)return null;let o=Math.max(1,Math.round((e.atMs-i)/6e4)),s=e.entering,c=n(s===`peak`?`tierPeak`:`tierOff`),l=n(e.channel===`zhipu-coding-plan`?s===`peak`?`peakAlertDescPeakZhipu`:`peakAlertDescOffZhipu`:s===`peak`?`peakAlertDescPeak`:`peakAlertDescOff`),u=s===`peak`;return(0,m.jsxs)(`div`,{className:y(z.peakCard,u?z.peakCardPeak:z.peakCardOff,t.position===`center`?z.peakCardCenter:z.peakCardCorner),"data-testid":`billing-peak-alert`,role:`alert`,children:[(0,m.jsxs)(`div`,{className:z.peakHead,children:[(0,m.jsxs)(`span`,{className:y(z.peakTag,u?z.peakTagPrimary:z.peakTagSuccess),children:[(0,m.jsx)(`span`,{className:y(z.peakDot,u?z.peakDotPrimary:z.peakDotSuccess),"aria-hidden":`true`}),c]}),(0,m.jsx)(`button`,{type:`button`,className:z.peakClose,onClick:r,"aria-label":n(`close`),children:`×`})]}),(0,m.jsxs)(`div`,{className:y(z.peakCount,u?z.peakCountPrimary:z.peakCountSuccess),children:[o,`min`]}),(0,m.jsx)(`p`,{className:z.peakDesc,children:l}),e.queueCount!==void 0&&e.queueCount>0&&(0,m.jsx)(`p`,{className:z.peakDesc,"data-testid":`billing-peak-queue-note`,children:n(s===`peak`?`peakAlertQueuePeak`:`peakAlertQueueOff`,{count:e.queueCount})})]})}let kr=[50,80,100],Ar=3e4,jr={total:{calls:0,input:0,output:0,cacheHit:0,cacheMiss:0,cost:0,reasoning:0},byModel:{},byDay:{},byDayModels:{}},Mr=[`#4f8cff`,`#2dd4bf`,`#a78bfa`,`#f59e0b`,`#f472b6`,`#fbbf24`,`#38bdf8`,`#6366f1`,`#f97316`,`#14b8a6`],Nr={checked:!1,available:!1,models:0,failures:0,okProviders:[],badProviders:[]},Pr=[{id:`overview`,labelKey:`tabOverview`},{id:`queue`,labelKey:`tabQueue`},{id:`providers`,labelKey:`tabProviders`},{id:`token`,labelKey:`tabToken`},{id:`trends`,labelKey:`tabTrends`},{id:`agents`,labelKey:`tabAgents`},{id:`pricing`,labelKey:`tabPricing`},{id:`settings`,labelKey:`tabSettings`}],Fr={fill:`none`,"aria-hidden":!0,stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`},Ir={overview:(0,m.jsx)(`svg`,{viewBox:`0 0 16 16`,...Fr,children:(0,m.jsx)(`path`,{d:`M2 13V3M2 13H14M4 10l4-3 2 2 4-5`})}),queue:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,...Fr,children:[(0,m.jsx)(`path`,{d:`M3 4h10M3 8h10M3 12h6`}),(0,m.jsx)(`path`,{d:`M12 10v4m-2-2h4`})]}),agents:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,...Fr,children:[(0,m.jsx)(`circle`,{cx:`8`,cy:`3.5`,r:`2`}),(0,m.jsx)(`circle`,{cx:`3.5`,cy:`12.5`,r:`2`}),(0,m.jsx)(`circle`,{cx:`12.5`,cy:`12.5`,r:`2`}),(0,m.jsx)(`path`,{d:`M8 5.5v2.5M6.5 10.5L5 11.5M9.5 10.5L11 11.5`})]}),providers:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,...Fr,children:[(0,m.jsx)(`rect`,{x:`2`,y:`3`,width:`12`,height:`10`,rx:`1.5`}),(0,m.jsx)(`path`,{d:`M5 7l2 2 4-4`})]}),token:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,...Fr,children:[(0,m.jsx)(`circle`,{cx:`6`,cy:`6`,r:`3`}),(0,m.jsx)(`circle`,{cx:`11`,cy:`11`,r:`3`})]}),trends:(0,m.jsx)(`svg`,{viewBox:`0 0 16 16`,...Fr,children:(0,m.jsx)(`path`,{d:`M2 4l4 4 3-3 5 5M11 10h3V7`})}),pricing:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,...Fr,children:[(0,m.jsx)(`path`,{d:`M8 2l6 3v6l-6 3-6-3V5z`}),(0,m.jsx)(`path`,{d:`M8 2v12M2 5h12`})]}),settings:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,...Fr,children:[(0,m.jsx)(`circle`,{cx:`8`,cy:`8`,r:`2.5`}),(0,m.jsx)(`path`,{d:`M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2`})]})},Lr=p,Rr=Lr.IconChevronDownOutlineMedium??Lr.IconChevronDownOutline14;function zr(e,t){let n=Object.keys(e).filter(e=>e<=t).sort().slice(-7);return n.length===0?0:n.reduce((t,n)=>t+(e[n]?.cost??0),0)/n.length}function Br(e,t){let n=t.split(`-`),r=new Date(Number(n[0]),Number(n[1])-1,Number(n[2])),i=0;for(let t=0;t<7;t+=1){let t=`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,`0`)}-${String(r.getDate()).padStart(2,`0`)}`;i+=e[t]?.cost??0,r.setDate(r.getDate()-1)}return i/7}function Vr(e,t,n){let r=Object.keys(e).filter(e=>e.startsWith(t)).reduce((t,n)=>t+(e[n]?.cost??0),0),i=t.split(`-`),a=new Date(Number(i[0]),Number(i[1]),0).getDate(),o=n.startsWith(t)?Number(n.slice(8,10)):a,s=Math.max(0,a-o);return r<=0?zr(e,n)*s:r+Br(e,n)*s}function Hr(e){return Object.keys(e).length}function Ur(e,t=Date.now()){let n=0,r=new Date(t);for(;G(r.getTime())in e;)n+=1,r.setDate(r.getDate()-1);return n}function Wr(e){return e.input+e.output}function Gr(e){let t=[];for(let n=6;n>=0;--n){let r=new Date;r.setDate(r.getDate()-n);let i=G(r.getTime());t.push({date:i,cost:e[i]?.cost??0})}return t}function Kr(e,t,n=e=>e.cost){let r=new Date(`${t}T00:00:00`),i=(r.getDay()+6)%7,a=0;for(let t=0;t<=i;t+=1){let i=new Date(r);i.setDate(i.getDate()-t);let o=e[G(i.getTime())];o!==void 0&&(a+=n(o))}return a}function qr(e,t,n){let r=new Date(`${t}T00:00:00`),i=(r.getDay()+6)%7,a=new Date(r);a.setDate(a.getDate()-i);let o=G(a.getTime()),s=new Date(r);s.setDate(s.getDate()-6);let c=G(s.getTime());return Yr(e,e=>n===`today`?e===t:n===`7d`?e>=c&&e<=t:n===`week`?e>=o&&e<=t:e.startsWith(t.slice(0,7)))}function Jr(e,t,n){return Yr(e,e=>e>=t&&e<=n)}function Yr(e,t){let n=0,r=0,i=0,a=0,o=0,s=0,c=0,l=0,u,d=0;for(let[f,p]of Object.entries(e)){if(!t(f))continue;n+=p.cost,r+=p.calls,i+=p.input,a+=p.output,o+=p.cacheHit,s+=p.cacheMiss,c+=p.cacheWrite??0,l+=p.reasoning??0;let e=Wr(p);e>d&&(d=e,u=f)}return{cost:n,calls:r,input:i,output:a,cacheHit:o,cacheMiss:s,cacheWrite:c,reasoning:l,peakDay:u,peakTokens:d}}function Xr(e,t){let n={};if(e===void 0)return n;for(let[r,i]of Object.entries(e))if(r.startsWith(t))for(let[e,t]of Object.entries(i))n[e]=(n[e]??0)+t.cost;return n}let Zr=[80,100];function Qr(e,t){if(!(t>0)||!(e>0))return[];let n=e/t*100;return Zr.filter(e=>n>=e)}let $r={DeepSeek:[`deepseek`],"智谱 AI":[`zhipu`,`glm`,`z.ai`],阿里通义:[`qwen`,`tongyi`,`dashscope`,`aliyun`],字节豆包:[`doubao`,`volcengine`,`ark`],月之暗面:[`moonshot`,`kimi`],小米:[`xiaomi`,`mi`,`mimo`],MiniMax:[`minimax`],百度文心:[`ernie`,`wenxin`,`qianfan`,`baidu`],腾讯混元:[`hunyuan`,`tencent`],零一万物:[`01.ai`,`lingyi`,`yi`],阶跃星辰:[`step`,`stepfun`,`step-3.7`],科大讯飞:[`spark`,`xfyun`,`iflytek`],商汤:[`sensenova`,`sensetime`],百川智能:[`baichuan`],OpenAI:[`openai`],Google:[`google`,`gemini`],xAI:[`xai`,`grok`],Meta:[`meta`,`llama`],Anthropic:[`claude`,`anthropic`],"Mistral AI":[`mistral`,`ministral`,`devstral`],Cohere:[`cohere`,`command`],美团:[`longcat`,`meituan`],面壁智能:[`minicpm`,`modelbest`],小红书:[`dots`,`rednote`,`xiaohongshu`],云知声:[`unisound`,`u2`]};function Z(e){return e.trim().toLowerCase().replace(/[\s_/-]+/g,``)}function ei(e,t){if(e.length===0||t.length===0)return!1;if(e===t)return!0;let[n,r]=e.length<=t.length?[e,t]:[t,e];return n.length>=3&&r.includes(n)}function ti(e,t){let n=Z(e),r=Z(t);if(ei(n,r))return!0;let i=$r[e];return i!==void 0&&i.some(e=>ei(Z(e),r))}function ni(e){let t=e.trim().toLowerCase(),n=t.replace(/[\s_/-]+/g,``);if(n.length!==0){for(let[e,n]of Object.entries($r))for(let r of n){let n=Z(r);if(n.length!==0&&(t===n||t.startsWith(`${n}-`)||t.startsWith(`${n}/`)||t.startsWith(`${n}_`)||t.includes(`${n}-`)||t.includes(`${n}/`)||t.includes(`${n}_`)))return e}for(let[e,t]of Object.entries($r))for(let r of t){let t=Z(r);if(!(t.length<4)&&n.includes(t))return e}}}let ri={"kimi-coding":`月之暗面`,"zai-coding-cn":`智谱 AI`,"zai-coding":`智谱 AI`,"qwen-token-plan":`阿里通义`,"qwen-token-plan-cn":`阿里通义`,"xiaomi-token-plan-ams":`小米`,"xiaomi-token-plan-cn":`小米`,"xiaomi-token-plan-sgp":`小米`,"volcengine-token-plan":`字节豆包`,"ark-token-plan":`字节豆包`,"doubao-token-plan":`字节豆包`,ernie:`百度文心`,baidu:`百度文心`,wenxin:`百度文心`,minimax:`MiniMax`,"minimax-cn":`MiniMax`,"minimax-token-plan":`MiniMax`,"minimax-token-plan-cn":`MiniMax`,"hunyuan-token-plan":`腾讯混元`,"tencent-token-plan":`腾讯混元`,"hy-token-plan":`腾讯混元`,"xinghuo-token-plan":`讯飞星火`,"xfyun-coding":`讯飞星火`,"spark-coding":`讯飞星火`,"huawei-token-plan":`华为云`,"pangu-token-plan":`华为云`,"huawei-maas-token-plan":`华为云`,"volcengine-agent-plan":`字节豆包`,"ark-agent-plan":`字节豆包`,"baidu-token-plan":`百度文心`,"ernie-token-plan":`百度文心`,"wenxin-token-plan":`百度文心`,opencode:`OpenCode`,"opencode-go":`OpenCode`};function ii(e){let t=ri[e];return t===void 0?ni(e)??e:t}let ai=`https://platform.kimi.com/console/pay`,oi=`https://open.bigmodel.cn/finance-center/finance/pay`,si=`https://bailian.console.aliyun.com/`,ci=`https://console.volcengine.com/ark`,li=`https://console.anthropic.com/settings/billing`,ui=`https://console.cloud.google.com/billing`,di=`https://console.x.ai/`,fi=`https://platform.xiaomimimo.com/console/balance`,pi=`https://console.cloud.tencent.com/expense/recharge`,mi={deepseek:`https://platform.deepseek.com/top_up`,minimax:`https://platform.minimax.cn/console/recharge-records`,moonshot:ai,kimi:ai,zhipu:oi,bigmodel:oi,qwen:si,dashscope:si,doubao:ci,volcengine:ci,ark:ci,openai:`https://platform.openai.com/settings/organization/billing`,anthropic:li,claude:li,google:ui,gemini:ui,xai:di,grok:di,siliconflow:`https://cloud.siliconflow.cn/account/charge`,hunyuan:pi,tencent:pi,腾讯云:pi,xiaomi:fi,mimo:fi,mi:fi,qianfan:`https://console.bce.baidu.com/qianfan/overview`};function hi(e){let t=mi[e];if(t!==void 0)return t;let n=Object.keys(mi).find(t=>e.startsWith(t));return n===void 0?void 0:mi[n]}function gi(e){let t=Z(e),n=hi(t);if(n!==void 0)return n;for(let[e,n]of Object.entries($r))if(ei(Z(e),t))for(let e of n){let t=hi(Z(e));if(t!==void 0)return t}}function _i(e){let t=ft();if(t===void 0||e.byDayModels===void 0)return e;let n=xt().rate,r=e.byDayModelsSite!==void 0,i={},a={},o=new Map,s=0,c=e=>t.some(t=>t.origin!==void 0&&t.origin!==``&&(t.key===e||Ut(t.key)===Ut(e))),l=(e,t,r)=>{if(e===void 0)return r;let i=Math.min(t.cacheHit,t.cacheMiss+t.cacheHit),a=r=>{let a=(t.cacheMiss*r.input+i*r.cacheHit+t.output*r.output)/1e6;return e.currency===`USD`?a*n:a};return e.offPeak===void 0?a(e):a(e)*Ct+a(e.offPeak)*.5};for(let[t,n]of Object.entries(e.byDayModels)){let u=0,d={};for(let[i,a]of Object.entries(n)){let n=mt(i)??gt(i),s=r&&c(i),f;if(s&&e.byDayModelsSite?.[t]?.[i]!==void 0){let r=0;for(let[a,o]of Object.entries(e.byDayModelsSite[t][i])){let e=a.startsWith(`site:`)?a.slice(5):void 0,t=e===void 0?void 0:mt(i,e);r+=l(t??n,o,o.cost)}f=r}else f=l(n,a,a.cost);u+=f,d[i]={...a,cost:f},o.set(i,(o.get(i)??0)+f)}let f=e.byDay[t];f!==void 0&&(i[t]={...f,cost:u}),a[t]=d,s+=u}return{...e,total:{...e.total,cost:s},byDay:i,byDayModels:a,byModel:Object.fromEntries(Object.entries(e.byModel).map(([e,t])=>{let n=o.get(e);return[e,n===void 0?t:{...t,cost:n}]})),unpricedModels:(e.unpricedModels??[]).filter(e=>!mt(e)&&!gt(e))}}async function Q(e,t={}){let{timeoutMs:n=12e3,signal:r,...i}=t,a=new AbortController,o=setTimeout(()=>{a.abort()},n),s=()=>{a.abort()};r!=null&&(r.aborted?a.abort():r.addEventListener(`abort`,s,{once:!0}));try{return await fetch(e,{...i,signal:a.signal})}finally{clearTimeout(o),r?.removeEventListener(`abort`,s)}}let vi=new Set;function yi(){return typeof Notification<`u`&&Notification.permission===`granted`}function bi(e,t){vi.has(e)||(vi.add(e),Q(`/api/billing/notify-claim`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({key:e})}).then(e=>e.json()).then(e=>{e.claimed!==!1&&t()}).catch(()=>t()))}function xi(e){let t=new Map,n=[];for(let r of e){if(r.title===void 0||r.title===``){n.push(r);continue}let e=t.get(r.title);if(e===void 0){let e={...r,mergedCount:1};t.set(r.title,e),n.push(e);continue}e.children===void 0&&(e.children=[{...e}]),e.children.push({...r}),e.calls+=r.calls,e.cost+=r.cost,e.lastActive=Math.max(e.lastActive,r.lastActive),r.stale===!0&&(e.stale=!0),e.mergedCount=(e.mergedCount??1)+1}return n.sort((e,t)=>t.cost-e.cost||t.lastActive-e.lastActive)}function Si(e){let t=new Map(e.map(e=>[e.id,e])),n=xi(e.filter(e=>e.parentId===void 0)),r=new Map;for(let e of n){r.set(e.id,e);for(let t of e.children??[])r.set(t.id,e)}let i=new Set,a=new Map,o=(e,t)=>{e.subs===void 0?e.subs=[t]:e.subs.push(t),i.add(t.id),a.set(t.id,e.id)};for(let n of e){if(n.parentId===void 0)continue;let e=t.get(n.parentId);if(e!==void 0&&e.parentId!==void 0&&e.id!==n.id){let t=e.id,r=new Set,i=!1;for(;t!==void 0&&!r.has(t);){if(r.add(t),t===n.id){i=!0;break}t=a.get(t)}if(!i){o(e,n);continue}}let s=new Set,c=n.parentId;for(;c!==void 0&&!s.has(c);){s.add(c);let e=r.get(c);if(e!==void 0){i.has(n.id)||o(e,n);break}c=t.get(c)?.parentId}}let s=e=>e.cost+(e.subCost??0),c=e=>{e.subs?.sort((e,t)=>s(t)-s(e)||t.lastActive-e.lastActive);for(let t of e.subs??[])c(t)};for(let e of n)c(e);let l=e.filter(e=>e.parentId!==void 0&&!i.has(e.id));for(let e of l)c(e);return[...n,...l].sort((e,t)=>t.cost-e.cost||t.lastActive-e.lastActive)}function Ci(e){let t=new Map;for(let n of e)t.has(n.id)||t.set(n.id,n);let n=new Map,r=[];for(let i of e){let e=i.parentId;if(e===void 0||!t.has(e)||wi(t,i.id)){r.push(i);continue}let a=n.get(e);a===void 0?n.set(e,[i]):a.push(i)}let i=(e,t,r)=>{let a=new Set(r);a.add(e.id);let o=(n.get(e.id)??[]).filter(e=>!r.has(e.id)).map(e=>i(e,t+1,a)).sort((e,t)=>t.chainCost-e.chainCost),s={id:e.id,...e.title===void 0?{}:{title:e.title},...e.cwd===void 0?{}:{cwd:e.cwd},calls:e.calls,cost:e.cost,lastActive:e.lastActive,chainCost:e.cost,chainCalls:e.calls,children:o,depth:t};for(let e of o)s.chainCost+=e.chainCost,s.chainCalls+=e.chainCalls;return s};return r.map(e=>i(e,0,new Set)).sort((e,t)=>t.chainCost-e.chainCost)}function wi(e,t){let n=new Set([t]),r=e.get(t)?.parentId;for(;r!==void 0;){if(n.has(r))return!0;n.add(r),r=e.get(r)?.parentId}return!1}function Ti(e){let t=0,n=0,r,i=e=>{t+=1,n+=e.children.length,(r===void 0||e.chainCost>r.chainCost)&&(r=e);for(let t of e.children)i(t)};for(let t of e)i(t);return{agents:t,delegations:n,roots:e.length,...r===void 0?{}:{costliest:r}}}function Ei(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>(e.title??``).toLowerCase().includes(n)||(e.cwd??``).toLowerCase().includes(n)||e.id.toLowerCase().includes(n))}function Di(e,t){let n=e.trim().toLowerCase();return n!==``&&!t.some(e=>e.toLowerCase().includes(n))}function Oi(e,t){return e.checked?e.okProviders.some(e=>ti(t,e))?z.healthOk:e.badProviders.some(e=>ti(t,e))?z.healthBad:z.healthIdle:z.healthIdle}function ki(e,t){switch(e){case`ok`:return``;case`not-configured`:return t(`subscriptionNotConfigured`);case`unauthorized`:return t(`subscriptionUnauthorized`);case`rate-limited`:return t(`subscriptionRateLimited`);case`invalid-response`:return t(`subscriptionInvalid`);default:return t(`subscriptionUnavailable`)}}function Ai(e,t){switch(e){case`session`:return t(`subscriptionSession`);case`weekly`:return t(`subscriptionWeekly`);case`monthly`:return t(`subscriptionMonthly`);case`billing`:return t(`subscriptionBilling`)}}function ji(e,t){switch(e){case`new-api`:return t(`relayKindNewApi`);case`sub2api`:return t(`relayKindSub2Api`);default:return t(`relayKindUnknown`)}}let Mi={"new-api":z.siteKindSite,sub2api:z.siteKindDirect,unknown:z.siteKindUnknown},Ni=e=>e.models.reduce((e,t)=>e+(t.actual??(t.plan===!0?0:t.estimated)),0);function Pi(e){return e.children===void 0?{cost:e.subCost??0,calls:e.subCalls??0}:(e.children??[]).reduce((e,t)=>({cost:e.cost+(t.subCost??0),calls:e.calls+(t.subCalls??0)}),{cost:0,calls:0})}function Fi(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}async function Ii(){try{let e=await Q(`/api/billing/usage-stats`);if(!e.ok)return null;let t=await e.text(),n=JSON.parse(t);if(typeof n!=`object`||!n||!(`total`in n))return null;let r=n,i=e=>typeof e==`object`&&!!e;return{total:r.total??jr.total,byModel:r.byModel??{},byDay:r.byDay??{},...r.byDayModels===void 0?{}:{byDayModels:r.byDayModels},...i(r.byDayModelsSite)?{byDayModelsSite:r.byDayModelsSite}:{},...r.updatedAt===void 0?{}:{updatedAt:r.updatedAt},...r.staleSnapshot===!0?{staleSnapshot:!0}:{},...typeof r.budget==`number`?{budget:r.budget}:{},...typeof r.lowBalanceThreshold==`number`?{lowBalanceThreshold:r.lowBalanceThreshold}:{},...Array.isArray(r.bySession)?{bySession:r.bySession}:{},...Array.isArray(r.byTurn)?{byTurn:r.byTurn}:{},...Array.isArray(r.byWorkspace)?{byWorkspace:r.byWorkspace}:{},...i(r.bySite)?{bySite:r.bySite}:{},...i(r.byTier)?{byTier:r.byTier}:{},...i(r.byTool)?{byTool:r.byTool}:{},...Array.isArray(r.unpricedModels)?{unpricedModels:r.unpricedModels}:{},...typeof r.staleLedgerSessions==`number`?{staleLedgerSessions:r.staleLedgerSessions}:{},...typeof r.unreadableSessions==`number`?{unreadableSessions:r.unreadableSessions}:{},...typeof r.unreadableFormatSessions==`number`?{unreadableFormatSessions:r.unreadableFormatSessions}:{},...typeof r.unreadableNoLedgerSessions==`number`?{unreadableNoLedgerSessions:r.unreadableNoLedgerSessions}:{},...typeof r.searchCallEstimateCny==`number`?{searchCallEstimateCny:r.searchCallEstimateCny}:{},...r.byRole!==null&&typeof r.byRole==`object`?{byRole:r.byRole}:{},...r.perf!==null&&typeof r.perf==`object`&&r.perf.byModel!==null&&typeof r.perf.byModel==`object`&&r.perf.byHourModel!==null&&typeof r.perf.byHourModel==`object`?{perf:r.perf}:{},...typeof r.pluginVersion==`string`?{pluginVersion:r.pluginVersion}:{}}}catch{return null}}async function Li(){try{let e=await Q(`/api/billing/balance`);if(!e.ok)return{balances:[]};let t=await e.text(),n=JSON.parse(t);if(typeof n!=`object`||!n)return{balances:[]};let r=n;return{balances:Array.isArray(r.balances)?r.balances:[],...r.reconcile===void 0?{}:{reconcile:r.reconcile},...r.stale===!0?{stale:!0}:{}}}catch{return{balances:[]}}}async function Ri(){let e=await Q(`/api/billing/subscriptions`);if(!e.ok)throw Error(`subscriptions HTTP ${String(e.status)}`);let t=await e.text(),n=JSON.parse(t);if(typeof n==`object`&&n&&`quotas`in n){let e=n;return{quotas:e.quotas,...e.stale===!0?{stale:!0}:{}}}throw Error(`subscriptions: invalid response`)}async function zi(){let e=await Q(`/api/billing/relay-quotas`);if(!e.ok)throw Error(`relay-quotas HTTP ${String(e.status)}`);let t=await e.text(),n=JSON.parse(t);if(typeof n==`object`&&n&&`quotas`in n)return n.quotas;throw Error(`relay-quotas: invalid response`)}async function Bi(){try{let e=await Q(`/api/billing/usage-tool`);if(!e.ok)return;let t=JSON.parse(await e.text());return typeof t.enabled==`boolean`?t.enabled:void 0}catch{return}}async function Vi(e){try{let t=await Q(`/api/billing/usage-tool`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({enabled:e})});return t.ok?JSON.parse(await t.text()).ok===!0:!1}catch{return!1}}let Hi=!1,Ui=0;async function Wi(e=0){try{let t=await Q(`/api/billing/pricing`);if(!t.ok){Hi=!1;return}let n=await t.text(),r=JSON.parse(n);if(typeof r!=`object`||!r||!(`source`in r)){Hi=!1;return}let i=r;Array.isArray(i.catalog)&&i.catalog.length>0&&i.aliases!==null&&typeof i.aliases==`object`&&zt(i.catalog,i.aliases);let a=r;if(a.source===`builtin`&&e<3){if(e===0){if(Hi)return;Hi=!0}setTimeout(()=>{Wi(e+1)},2e3);return}Hi=!1,Ui=a.syncedAt??0,_t(a)}catch{Hi=!1}}async function Gi(){try{return(await Q(`/api/billing/pricing/refresh`,{method:`POST`,headers:{"content-type":`application/json`},body:`{}`,timeoutMs:3e4})).ok?(await Wi(),!0):!1}catch{return!1}}async function Ki(e){try{let t=JSON.parse(await e.text());return typeof t.error==`string`?t.error:`HTTP ${e.status}`}catch{return`HTTP ${e.status}`}}async function qi(e=!1){let t=await Q(`/api/billing/task-queue${e?`?refresh=1`:``}`);if(!t.ok)throw Error(await Ki(t));return await t.json()}async function Ji(){let e=await Q(`/api/billing/task-queue-summary`);if(!e.ok)throw Error(await Ki(e));return await e.json()}async function Yi(e){let t=await Q(`/api/billing/task-queue`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Ki(t));return(await t.json()).snapshot}let Xi=`@kenz1117/dsh-ui-usage-billing/TaskQueuePanel.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Xi)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@kenz1117/dsh-ui-usage-billing`,e.dataset.pluginCss=Xi,e.textContent=`.cQSERa_queuePanel{color:var(--ds-t-1);flex-direction:column;flex-shrink:0;gap:12px;display:flex}.cQSERa_queuePanel *{box-sizing:border-box}.cQSERa_queueHero,.cQSERa_queueComposer,.cQSERa_queueListSection,.cQSERa_queueUnsupported{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);background:var(--dsb-2);flex-shrink:0}.cQSERa_queueHero{justify-content:space-between;align-items:center;gap:16px;padding:16px;display:flex}.cQSERa_queueTitleRow{align-items:center;gap:8px;display:flex}.cQSERa_queueTitle,.cQSERa_queueListHead h3,.cQSERa_queueUnsupported h3{margin:0;font-size:15px;font-weight:650}.cQSERa_queuePreview{background:var(--ds-violet-soft);color:var(--ds-violet);text-transform:uppercase;border-radius:5px;padding:2px 6px;font-size:10px;font-weight:700}.cQSERa_queueSubtitle{color:var(--ds-t-2);margin:5px 0 0;font-size:12px;line-height:1.6}.cQSERa_queueBand{color:var(--ds-t-2);flex-direction:column;flex-shrink:0;align-items:flex-end;gap:3px;font-size:11px;display:flex}.cQSERa_queueBand strong{font-size:13px}.cQSERa_queueBandOff strong{color:var(--ds-green)}.cQSERa_queueBandPeak strong{color:var(--ds-amber)}.cQSERa_queueComposer{flex-direction:column;gap:12px;padding:14px;display:flex}.cQSERa_queueSafety{border-radius:var(--ds-r-1);background:color-mix(in srgb, var(--ds-amber) 8%, transparent);color:var(--ds-t-2);padding:9px 11px;font-size:11px;line-height:1.65}.cQSERa_queueSelectors{grid-template-columns:1fr 1fr;gap:10px;display:grid}.cQSERa_queueField,.cQSERa_queuePromptField{color:var(--ds-t-2);flex-direction:column;gap:6px;font-size:11px;display:flex}.cQSERa_queueField select,.cQSERa_queuePromptField textarea{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);background:var(--dsb);width:100%;color:var(--ds-t-1);font:inherit}.cQSERa_queueField select{height:34px;padding:0 9px}.cQSERa_queuePromptField textarea{resize:vertical;min-height:112px;padding:10px;line-height:1.55}.cQSERa_queueField select:focus,.cQSERa_queuePromptField textarea:focus{outline:2px solid color-mix(in srgb, var(--ds-blue) 35%, transparent);border-color:var(--ds-blue)}.cQSERa_queueField select:disabled,.cQSERa_queuePromptField textarea:disabled{opacity:.55}.cQSERa_queueComposerFooter{color:var(--ds-t-3);justify-content:space-between;align-items:center;gap:12px;font-size:10px;line-height:1.5;display:flex}.cQSERa_queueComposerActions{flex-shrink:0;align-items:center;gap:8px;display:flex}.cQSERa_queueFileInput{display:none}.cQSERa_queuePrimary,.cQSERa_queueSecondary{border-radius:var(--ds-r-1);cursor:pointer;flex-shrink:0;min-height:34px;padding:0 16px;font-weight:600}.cQSERa_queuePrimary{background:var(--ds-blue);color:#fff;border:0}.cQSERa_queueSecondary{border:1px solid var(--ds-border);background:var(--dsb);color:var(--ds-t-1)}.cQSERa_queuePrimary:disabled,.cQSERa_queueSecondary:disabled{opacity:.45;cursor:not-allowed}.cQSERa_queueListSection{padding:12px 14px}.cQSERa_queueListHead{justify-content:space-between;align-items:center;margin-bottom:8px;display:flex}.cQSERa_queueListHead h3 span{color:var(--ds-t-3);margin-left:4px;font-size:11px;font-weight:500}.cQSERa_queueList{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.cQSERa_queueTask{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);background:var(--dsb);padding:10px}.cQSERa_queueTaskHead{align-items:center;gap:8px;min-width:0;display:flex}.cQSERa_queueStatus{background:var(--dsb-3);color:var(--ds-t-2);border-radius:5px;flex-shrink:0;padding:2px 6px;font-size:10px;font-weight:650}.cQSERa_queueStatus_running,.cQSERa_queueStatus_starting{color:var(--ds-blue);background:color-mix(in srgb, var(--ds-blue) 12%, transparent)}.cQSERa_queueStatus_completed{color:var(--ds-green);background:color-mix(in srgb, var(--ds-green) 12%, transparent)}.cQSERa_queueStatus_failed{color:var(--ds-red);background:color-mix(in srgb, var(--ds-red) 10%, transparent)}.cQSERa_queueTaskMeta{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--ds-t-2);font-size:11px;overflow:hidden}.cQSERa_queueTaskTime{color:var(--ds-t-3);flex-shrink:0;margin-left:auto;font-size:10px}.cQSERa_queuePrompt{color:var(--ds-t-1);margin-top:8px;font-size:12px;line-height:1.55}.cQSERa_queuePrompt summary{text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden}.cQSERa_queuePrompt pre{background:var(--dsb-2);white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;font-family:var(--mono);border-radius:6px;margin:8px 0 0;padding:9px;font-size:11px;line-height:1.55;overflow:auto}.cQSERa_queueTaskError{color:var(--ds-red);overflow-wrap:anywhere;margin-top:8px;font-size:11px;line-height:1.5}.cQSERa_queueTaskActions{justify-content:flex-end;gap:10px;margin-top:5px;display:flex}.cQSERa_queueLinkButton{color:var(--ds-blue);cursor:pointer;background:0 0;border:0;padding:2px 0;font-size:11px}.cQSERa_queueLinkButton:disabled{opacity:.45;cursor:not-allowed}.cQSERa_queueEmpty{color:var(--ds-t-3);text-align:center;padding:26px 12px;font-size:12px}.cQSERa_queueUnsupported{padding:22px}.cQSERa_queueUnsupported p{color:var(--ds-t-2);margin:8px 0 0;font-size:12px;line-height:1.7}.cQSERa_queueNotice,.cQSERa_queueNoticeError{border-radius:var(--ds-r-1);overflow-wrap:anywhere;flex-shrink:0;padding:9px 11px;font-size:11px;line-height:1.5}.cQSERa_queueNotice{background:var(--dsb-2);color:var(--ds-t-2)}.cQSERa_queueNoticeError{background:color-mix(in srgb, var(--ds-red) 10%, transparent);color:var(--ds-red)}@media (width<=640px){.cQSERa_queueHero{align-items:flex-start}.cQSERa_queueSelectors{grid-template-columns:1fr}.cQSERa_queueComposerFooter{flex-direction:column;align-items:stretch}.cQSERa_queueComposerActions{flex-wrap:wrap;justify-content:flex-end}.cQSERa_queueTaskTime{display:none}}`,document.head.appendChild(e)}var $={queueBand:`cQSERa_queueBand`,queueBandOff:`cQSERa_queueBandOff`,queueBandPeak:`cQSERa_queueBandPeak`,queueComposer:`cQSERa_queueComposer`,queueComposerActions:`cQSERa_queueComposerActions`,queueComposerFooter:`cQSERa_queueComposerFooter`,queueEmpty:`cQSERa_queueEmpty`,queueField:`cQSERa_queueField`,queueFileInput:`cQSERa_queueFileInput`,queueHero:`cQSERa_queueHero`,queueLinkButton:`cQSERa_queueLinkButton`,queueList:`cQSERa_queueList`,queueListHead:`cQSERa_queueListHead`,queueListSection:`cQSERa_queueListSection`,queueNotice:`cQSERa_queueNotice`,queueNoticeError:`cQSERa_queueNoticeError`,queuePanel:`cQSERa_queuePanel`,queuePreview:`cQSERa_queuePreview`,queuePrimary:`cQSERa_queuePrimary`,queuePrompt:`cQSERa_queuePrompt`,queuePromptField:`cQSERa_queuePromptField`,queueSafety:`cQSERa_queueSafety`,queueSecondary:`cQSERa_queueSecondary`,queueSelectors:`cQSERa_queueSelectors`,queueStatus:`cQSERa_queueStatus`,queueStatus_completed:`cQSERa_queueStatus_completed`,queueStatus_failed:`cQSERa_queueStatus_failed`,queueStatus_running:`cQSERa_queueStatus_running`,queueStatus_starting:`cQSERa_queueStatus_starting`,queueSubtitle:`cQSERa_queueSubtitle`,queueTask:`cQSERa_queueTask`,queueTaskActions:`cQSERa_queueTaskActions`,queueTaskError:`cQSERa_queueTaskError`,queueTaskHead:`cQSERa_queueTaskHead`,queueTaskMeta:`cQSERa_queueTaskMeta`,queueTaskTime:`cQSERa_queueTaskTime`,queueTitle:`cQSERa_queueTitle`,queueTitleRow:`cQSERa_queueTitleRow`,queueUnsupported:`cQSERa_queueUnsupported`};let Zi={queued:`queueStatusQueued`,starting:`queueStatusStarting`,running:`queueStatusRunning`,completed:`queueStatusCompleted`,failed:`queueStatusFailed`};function Qi(e){return e.status===`completed`||e.status===`failed`}function $i(e,t){return JSON.stringify([e,t])}function ea(e,t){let n;try{n=JSON.parse(e)}catch{throw Error(`invalid task import`)}if(!Array.isArray(n)||n.length===0)throw Error(`invalid task import`);return n.map(e=>{if(typeof e==`string`)return{prompt:e,...t};if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`invalid task import`);let n=e;return{prompt:n.prompt,cwd:n.cwd??t.cwd,provider:n.provider??t.provider,model:n.model??t.model}})}function ta({t:e,language:t,navigateToSession:n}){let[r,i]=(0,d.useState)(),[a,o]=(0,d.useState)(``),[s,c]=(0,d.useState)(``),[l,u]=(0,d.useState)(``),[f,p]=(0,d.useState)(!1),[h,g]=(0,d.useState)(),[_,v]=(0,d.useState)(),b=(0,d.useRef)(!0),x=(0,d.useRef)(!1),S=(0,d.useRef)(!1),C=(0,d.useRef)(null),w=(0,d.useCallback)(async()=>{if(!x.current){x.current=!0;try{let e=await qi();b.current&&(i(e),g(void 0))}catch(e){b.current&&g(e instanceof Error?e.message:String(e))}finally{x.current=!1}}},[]);(0,d.useEffect)(()=>{b.current=!0,w();let e=setInterval(()=>{w()},5e3);return()=>{b.current=!1,clearInterval(e)}},[w]),(0,d.useEffect)(()=>{r!==void 0&&(r.workspaces.some(e=>e.path===s)||c(r.workspaces[0]?.path??``),r.models.some(e=>$i(e.provider,e.id)===l)||u(r.models[0]===void 0?``:$i(r.models[0].provider,r.models[0].id)))},[r,s,l]);let T=(0,d.useCallback)(async(e,t=!1)=>{if(f||S.current)return!1;S.current=!0,p(!0),g(void 0),v(void 0);try{let n=await Yi(e);return b.current?(i(n),t&&o(``),!0):!1}catch(e){return b.current&&g(e instanceof Error?e.message:String(e)),!1}finally{S.current=!1,b.current&&p(!1)}},[f]),E=(0,d.useMemo)(()=>r?.tasks.filter(e=>!Qi(e))??[],[r]),ee=(0,d.useMemo)(()=>r?.tasks.filter(Qi).slice().reverse()??[],[r]),D=r!==void 0&&r.supported&&r.workspaces.length>0&&r.models.length>0,O=e=>new Date(e).toLocaleString(t===`en`?`en-US`:`zh-CN`),te=()=>{if(a.trim()===``||s===``||l===``)return;let[e,t]=JSON.parse(l);T({action:`enqueue`,prompt:a,cwd:s,provider:e,model:t},!0)},k=async t=>{if(!(t===void 0||!D||f||l===``)){g(void 0),v(void 0);try{if(t.size>10485760){g(e(`queueImportTooLarge`));return}let[n,r]=JSON.parse(l),i=ea(await t.text(),{cwd:s,provider:n,model:r});await T({action:`enqueueMany`,tasks:i})&&b.current&&v(e(`queueImported`,{count:i.length}))}catch{b.current&&g(e(`queueImportFormat`))}}},A=t=>{let r=n(t);v(r===`opened`?void 0:e(r===`unavailable`?`sessionOpenUnavailable`:`sessionOpenFailed`))},j=t=>{let n=r?.workspaces.find(e=>e.path===t.cwd);return(0,m.jsxs)(`li`,{className:$.queueTask,"data-testid":`queue-task-${t.id}`,children:[(0,m.jsxs)(`div`,{className:$.queueTaskHead,children:[(0,m.jsx)(`span`,{className:y($.queueStatus,$[`queueStatus_${t.status}`]),children:e(Zi[t.status])}),(0,m.jsxs)(`span`,{className:$.queueTaskMeta,children:[n?.title??t.cwd,` · `,t.model]}),(0,m.jsx)(`time`,{className:$.queueTaskTime,dateTime:new Date(t.createdAt).toISOString(),children:O(t.createdAt)})]}),(0,m.jsxs)(`details`,{className:$.queuePrompt,children:[(0,m.jsx)(`summary`,{children:t.prompt.trim().slice(0,180)||t.prompt.slice(0,180)}),(0,m.jsx)(`pre`,{children:t.prompt})]}),t.error!==void 0&&(0,m.jsx)(`div`,{className:$.queueTaskError,role:`note`,children:t.error}),(0,m.jsxs)(`div`,{className:$.queueTaskActions,children:[t.sessionId!==void 0&&(0,m.jsx)(`button`,{type:`button`,className:$.queueLinkButton,onClick:()=>{A(t.sessionId)},children:e(`queueOpenSession`)}),(t.status===`queued`||Qi(t))&&(0,m.jsx)(`button`,{type:`button`,className:$.queueLinkButton,disabled:f,onClick:()=>{T({action:`remove`,id:t.id})},children:e(t.status===`queued`?`queueRemoveQueued`:`queueRemoveHistory`)})]})]},t.id)};return(0,m.jsxs)(`div`,{className:$.queuePanel,"data-testid":`billing-tab-panel-queue`,children:[(0,m.jsxs)(`section`,{className:$.queueHero,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`div`,{className:$.queueTitleRow,children:[(0,m.jsx)(`h2`,{className:$.queueTitle,children:e(`tabQueue`)}),(0,m.jsx)(`span`,{className:$.queuePreview,children:`Preview`})]}),(0,m.jsx)(`p`,{className:$.queueSubtitle,children:e(`queueSubtitle`)})]}),r?.supported&&(0,m.jsxs)(`div`,{className:y($.queueBand,r.tier===`offPeak`?$.queueBandOff:$.queueBandPeak),children:[(0,m.jsx)(`strong`,{children:e(r.tier===`offPeak`?`offPeak`:`peak`)}),(0,m.jsxs)(`span`,{children:[e(r.tier===`offPeak`?`queueUntilPeak`:`queueUntilOffPeak`),` `,Lt(r.nextSwitchInMs)]})]})]}),h!==void 0&&(0,m.jsx)(`div`,{className:$.queueNoticeError,role:`alert`,children:h}),_!==void 0&&(0,m.jsx)(`div`,{className:$.queueNotice,role:`status`,children:_}),r===void 0?(0,m.jsx)(`div`,{className:$.queueEmpty,children:e(`queueLoading`)}):r.supported?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`section`,{className:$.queueComposer,children:[(0,m.jsx)(`div`,{className:$.queueSafety,children:e(`queueSafety`)}),(0,m.jsxs)(`div`,{className:$.queueSelectors,children:[(0,m.jsxs)(`label`,{className:$.queueField,children:[(0,m.jsx)(`span`,{children:e(`queueWorkspace`)}),(0,m.jsx)(`select`,{value:s,disabled:!D||f,onChange:e=>{c(e.target.value)},children:r.workspaces.map(e=>(0,m.jsx)(`option`,{value:e.path,children:e.title},e.path))})]}),(0,m.jsxs)(`label`,{className:$.queueField,children:[(0,m.jsx)(`span`,{children:e(`queueModel`)}),(0,m.jsx)(`select`,{value:l,disabled:!D||f,onChange:e=>{u(e.target.value)},children:r.models.map(e=>(0,m.jsxs)(`option`,{value:$i(e.provider,e.id),children:[e.providerName,` / `,e.name]},$i(e.provider,e.id)))})]})]}),!D&&(0,m.jsx)(`div`,{className:$.queueNotice,children:r.optionsError??e(`queueNoOptions`)}),(0,m.jsxs)(`label`,{className:$.queuePromptField,children:[(0,m.jsx)(`span`,{children:e(`queuePromptLabel`)}),(0,m.jsx)(`textarea`,{value:a,disabled:!D||f,maxLength:32e3,rows:5,placeholder:e(`queuePromptPlaceholder`),onChange:e=>{o(e.target.value)}})]}),(0,m.jsxs)(`div`,{className:$.queueComposerFooter,children:[(0,m.jsx)(`span`,{children:e(`queuePrivacy`)}),(0,m.jsxs)(`div`,{className:$.queueComposerActions,children:[(0,m.jsx)(`input`,{ref:C,className:$.queueFileInput,"data-testid":`queue-import-file`,type:`file`,accept:`application/json,.json`,disabled:!D||f,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,k(t)}}),(0,m.jsx)(`button`,{type:`button`,className:$.queueSecondary,title:e(`queueImportHint`),disabled:!D||f,onClick:()=>{C.current?.click()},children:e(`queueImport`)}),(0,m.jsx)(`button`,{type:`button`,className:$.queuePrimary,disabled:!D||f||a.trim()===``,onClick:te,children:e(`queueEnqueue`)})]})]})]}),(0,m.jsxs)(`section`,{className:$.queueListSection,children:[(0,m.jsxs)(`div`,{className:$.queueListHead,children:[(0,m.jsxs)(`h3`,{children:[e(`queueActive`),` `,(0,m.jsx)(`span`,{children:E.length})]}),ee.length>0&&(0,m.jsx)(`button`,{type:`button`,className:$.queueLinkButton,disabled:f,onClick:()=>{T({action:`clearFinished`})},children:e(`queueClearFinished`)})]}),E.length===0&&ee.length===0?(0,m.jsx)(`div`,{className:$.queueEmpty,children:e(`queueEmpty`)}):(0,m.jsxs)(`ul`,{className:$.queueList,children:[E.map(j),ee.map(j)]})]})]}):(0,m.jsxs)(`section`,{className:$.queueUnsupported,"data-testid":`queue-unsupported`,children:[(0,m.jsx)(`h3`,{children:e(`queueUnsupportedTitle`)}),(0,m.jsx)(`p`,{children:e(`queueUnsupportedBody`)})]})]})}function na({window:e,t}){let n=Math.min(100,Math.max(0,e.usedPercent)),r=Math.min(100,Math.max(0,e.remainingPercent))<=0;return(0,m.jsxs)(`div`,{className:z.subscriptionWindow,children:[(0,m.jsx)(`span`,{className:z.subscriptionWindowLabel,children:Ai(e.kind,t)}),(0,m.jsx)(`span`,{className:z.subscriptionTrack,"aria-hidden":`true`,children:(0,m.jsx)(`span`,{className:y(z.subscriptionFill,n>=100&&z.subscriptionFillOver,n>=80&&n<100&&z.subscriptionFillWarn),style:{width:`${n}%`}})}),(0,m.jsxs)(`span`,{className:z.subscriptionMeta,children:[(0,m.jsx)(`span`,{className:y(z.subscriptionPct,r&&z.subscriptionExhausted),children:r?t(`subscriptionExhausted`):t(`subscriptionRemaining`).replace(`{pct}`,String(e.remainingPercent))}),e.resetsAt!==void 0&&(0,m.jsx)(`span`,{className:z.subscriptionReset,children:t(`subscriptionReset`).replace(`{date}`,`${G(new Date(e.resetsAt).getTime())} ${Fi(new Date(e.resetsAt).getTime())}`)})]})]})}function ra({label:e,t}){return(0,m.jsx)(p.Tooltip,{label:e,side:`top`,maxWidth:280,children:(0,m.jsx)(`span`,{className:z.helpTip,role:`note`,"aria-label":e,children:`?`})})}function ia(e,t){return e===z.healthOk?t(`healthDotLive`):e===z.healthBad?t(`healthDotFailed`):t(`healthDotUnknown`)}function aa(e){let t=t=>fn(dn(t,e.currency),e.currency),{wide:n,t:r,onOpen:i,monthCost:a,todayCost:o,weekCost:s,days:c,vendorStatus:l,dash:u,floatPrefs:p,subscriptions:h,cardPrefs:g,monthTokens:_,todayTokens:v,weekTokens:b,budgetPressure:x,deltaPct:S=0}=e,C=(0,d.useMemo)(()=>p.targets.map(e=>h.find(t=>t.provider===e)).filter(e=>e!==void 0),[p.targets,h]),[w,T]=(0,d.useState)(0),E=C.length===0?0:Math.min(w,C.length-1),ee=C[E],D=(0,d.useRef)(null),[O,te]=(0,d.useState)(!1),[k,A]=(0,d.useState)({left:0,top:0});(0,d.useEffect)(()=>{if(!O||p.mode!==`subscription`||C.length<2)return;let e=setInterval(()=>T(e=>(e+1)%C.length),1500);return()=>clearInterval(e)},[O,p.mode,C.length]);let j=(0,d.useRef)(void 0),ne=(0,d.useCallback)(()=>{window.clearTimeout(j.current),te(!0)},[]),re=(0,d.useCallback)(()=>{window.clearTimeout(j.current),j.current=window.setTimeout(()=>te(!1),120)},[]);(0,d.useEffect)(()=>()=>window.clearTimeout(j.current),[]);let M=(0,d.useCallback)(()=>{let e=D.current?.getBoundingClientRect();e!==void 0&&A({left:e.left,top:e.top-8})},[]);(0,d.useEffect)(()=>{if(!O)return;let e=()=>M();return window.addEventListener(`scroll`,e,{capture:!0,passive:!0}),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,{capture:!0}),window.removeEventListener(`resize`,e)}},[O,M]);let ie=c.length>0?c.reduce((e,t)=>e+t.cost,0)/c.length:0,ae=ie>0?Math.max(0,Math.min(1,o/ie)):0,oe=-80+ae*160,se=(0,m.jsxs)(`svg`,{viewBox:`3.5 10 34 22`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,m.jsx)(`path`,{d:`M5.23 26.4A15 15 0 0 1 34.77 26.4`,strokeWidth:3,opacity:.16}),(0,m.jsx)(`path`,{d:`M5.23 26.4A15 15 0 0 1 34.77 26.4`,strokeWidth:3,strokeDasharray:`${(41.9*ae).toFixed(2)} 41.9`,className:z.triggerGaugeArc}),(0,m.jsx)(`path`,{d:`M5.23 26.4 8.18 26.92M10.36 17.51 12.29 19.81M20 14v3M27.71 19.81 29.64 17.51M31.82 26.92 34.77 26.4`,strokeWidth:1.6,opacity:.7}),(0,m.jsx)(`path`,{d:`M7.01 21.5 8.31 22.25M14.87 14.91 15.38 16.31M24.62 16.31 25.13 14.91M31.69 22.25 32.99 21.5`,strokeWidth:1.2,opacity:.38}),(0,m.jsx)(`line`,{x1:`20`,y1:`29`,x2:`20`,y2:`19.5`,strokeWidth:2,className:z.triggerGaugeNeedle,style:{transform:`rotate(${oe}deg)`,transformOrigin:`20px 29px`}}),(0,m.jsx)(`circle`,{cx:`20`,cy:`29`,r:`1.5`,fill:`currentColor`,stroke:`none`})]});if(g.mode===`hidden`)return null;if(!n||g.mode===`compact`)return(0,m.jsx)(`button`,{type:`button`,className:y(z.railButton,x!==`none`&&z.triggerBudgetPulse,x===`over`&&z.triggerBudgetOver),"data-testid":`billing-rail-button`,onClick:i,title:`${r(`title`)} · ${t(g.span===`day`?o:g.span===`week`?s:a)}`,children:se});let ce=g.metric===`tokens`,le=c.map(e=>ce?e.tokens:e.cost),ue=Math.max(...le,0),de=le.map(e=>ue>0?4+e/ue*12:4);return(0,m.jsxs)(`span`,{ref:D,className:z.triggerWrap,onMouseEnter:()=>{M(),ne()},onMouseLeave:re,onFocusCapture:()=>{M(),ne()},onBlurCapture:()=>te(!1),children:[(0,m.jsxs)(`button`,{type:`button`,className:y(z.trigger,x!==`none`&&z.triggerBudgetPulse,x===`over`&&z.triggerBudgetOver),"data-testid":`billing-trigger`,onClick:i,title:`${r(`title`)} · ${t(g.span===`day`?o:g.span===`week`?s:a)}`,children:[(0,m.jsx)(`span`,{className:y(z.triggerIcon,x!==`none`&&z.triggerBudgetHot),"data-testid":`billing-trigger-icon`,children:se}),(0,m.jsx)(`span`,{className:z.triggerMain,children:(0,m.jsxs)(`span`,{className:z.triggerPrimary,children:[(0,m.jsx)(`span`,{className:z.triggerLabel,children:ce?g.span===`day`?r(`triggerTodayTokens`):g.span===`week`?r(`triggerWeekTokens`):r(`triggerMonthTokens`):g.span===`day`?r(`triggerToday`):g.span===`week`?r(`weekCost`):r(`triggerMonth`)}),(()=>{let e=g.span===`day`?ce?v:o:g.span===`week`?ce?b:s:ce?_:a,n=g.span===`day`?S:0;return ce?(0,m.jsx)(`span`,{className:z.triggerMetric,"data-testid":`billing-trigger-span-tokens`,children:K(e)}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`span`,{className:z.triggerValueRow,children:[(0,m.jsx)(`span`,{className:z.triggerYen,"aria-hidden":`true`,children:t(e).charAt(0)}),(0,m.jsx)(`span`,{className:z.triggerMetric,"data-testid":`billing-trigger-span-money`,children:t(e).slice(1)})]}),g.showDelta&&n!==0&&(0,m.jsxs)(`span`,{className:y(z.triggerDelta,n>0?z.triggerDeltaUp:z.triggerDeltaDown),"data-testid":`billing-trigger-delta`,children:[n>0?`▲`:`▼`,` `,Math.abs(n).toFixed(1),`%`]}),(0,m.jsx)(`span`,{className:z.triggerGlow,"aria-hidden":`true`})]})})()]})}),(0,m.jsx)(`span`,{className:z.triggerSpark,"data-testid":`billing-trigger-spark`,"aria-hidden":`true`,children:de.map((e,t)=>(0,m.jsx)(`span`,{className:t===de.length-1?z.triggerSparkHot:z.triggerSparkBar,style:{height:`${e}px`}},c[t]?.date??String(t)))})]}),(0,f.createPortal)((0,m.jsx)(`span`,{className:y(z.triggerPop,O&&z.triggerPopShown),style:{left:`${k.left}px`,top:`${k.top}px`},"data-testid":`billing-trigger-pop`,"aria-hidden":!O,onMouseEnter:ne,onMouseLeave:re,children:p.mode===`subscription`?(0,m.jsx)(m.Fragment,{children:C.length===0?(0,m.jsx)(`span`,{className:z.triggerPopEmpty,children:r(`floatNoTargets`)}):(0,m.jsxs)(m.Fragment,{children:[ee!==void 0&&(0,m.jsxs)(`div`,{className:z.floatSub,"data-testid":`billing-float-subscription`,children:[(0,m.jsxs)(`div`,{className:z.floatSubHead,children:[(0,m.jsx)(`span`,{className:z.floatSubName,children:ee.displayName}),ee.plan!==void 0&&(0,m.jsx)(`span`,{className:z.floatSubPlan,children:ee.plan})]}),ee.windows.map(e=>(0,m.jsx)(na,{window:e,t:r},e.kind))]}),C.length>1&&(0,m.jsx)(`span`,{className:z.triggerPopSwitcher,"data-testid":`billing-float-switcher`,children:(0,m.jsxs)(`span`,{className:z.triggerPopSwitchCount,children:[E+1,`/`,C.length]})})]})}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:z.popHead,children:(0,m.jsx)(`span`,{className:z.popTitle,children:r(`popTitle`)})}),(0,m.jsxs)(`span`,{className:z.metricGrid,children:[(0,m.jsxs)(`span`,{className:z.metricCell,children:[(0,m.jsx)(`span`,{className:z.metricLabel,children:r(`floatPrimaryToday`)}),(0,m.jsx)(`span`,{className:z.metricValue,children:t(o)})]}),(0,m.jsxs)(`span`,{className:z.metricCell,children:[(0,m.jsx)(`span`,{className:z.metricLabel,children:r(`floatPrimaryWeek`)}),(0,m.jsx)(`span`,{className:z.metricValue,children:t(s)})]}),(0,m.jsxs)(`span`,{className:z.metricCell,children:[(0,m.jsx)(`span`,{className:z.metricLabel,children:r(`floatPrimaryMonth`)}),(0,m.jsx)(`span`,{className:z.metricValue,children:t(a)})]}),(0,m.jsxs)(`span`,{className:z.metricCell,children:[(0,m.jsx)(`span`,{className:z.metricLabel,children:r(`input`)}),(0,m.jsx)(`span`,{className:z.metricValue,children:K(u.input)})]}),(0,m.jsxs)(`span`,{className:z.metricCell,children:[(0,m.jsx)(`span`,{className:z.metricLabel,children:r(`output`)}),(0,m.jsx)(`span`,{className:z.metricValue,children:K(u.output)})]}),(0,m.jsxs)(`span`,{className:z.metricCell,children:[(0,m.jsx)(`span`,{className:z.metricLabel,children:r(`cacheHit`)}),(0,m.jsx)(`span`,{className:y(z.metricValue,z.metricValueSuccess),children:hn(u.cacheRead+u.cacheMiss>0?u.cacheRead/(u.cacheRead+u.cacheMiss)*100:0)})]})]}),(0,m.jsxs)(`span`,{className:z.popModel,children:[(0,m.jsx)(`span`,{className:z.popModelLabel,children:r(`popTodayModel`)}),l.direct!==void 0||l.sub!==void 0?(0,m.jsxs)(m.Fragment,{children:[l.direct!==void 0&&(0,m.jsxs)(`span`,{className:z.popModelRow,children:[(0,m.jsx)(`span`,{className:y(z.popDot,z.popDotDirect),"aria-hidden":`true`}),(0,m.jsx)(`span`,{className:z.popTagPrimary,children:r(`popDirectLead`)}),(0,m.jsx)(`span`,{className:z.popModelName,children:l.direct.name}),(0,m.jsx)(`span`,{className:y(z.popModelStatus,l.direct.low&&z.popModelStatusLow),children:l.direct.text})]}),l.sub!==void 0&&(0,m.jsxs)(`span`,{className:z.popModelRow,children:[(0,m.jsx)(`span`,{className:y(z.popDot,z.popDotSub),"aria-hidden":`true`}),(0,m.jsx)(`span`,{className:z.popTagSub,children:r(`popSubLead`)}),(0,m.jsx)(`span`,{className:z.popModelName,children:l.sub.name}),(0,m.jsx)(`span`,{className:y(z.popModelStatus,l.sub.low&&z.popModelStatusLow),children:l.sub.text})]})]}):(0,m.jsxs)(`span`,{className:z.popModelRow,children:[(0,m.jsx)(`span`,{className:y(z.popDot,z.popDotNeutral),"aria-hidden":`true`}),(0,m.jsx)(`span`,{className:z.popModelStatus,children:r(`popNoConsumption`)})]})]})]})}),document.body)]})}function oa({balance:e,days:t,dailyBurn:n,money:r,t:i,onClose:a}){let o=t=>t===void 0?void 0:e.currency===`USD`?`$${t.toFixed(2)}`:r(t),s=o(e.totalBalance),c=o(e.grantedBalance),l=o(e.toppedUpBalance);return(0,m.jsxs)(`span`,{className:z.balanceDetailPop,"data-testid":`billing-balance-detail-pop`,onClick:e=>{e.stopPropagation()},children:[(0,m.jsxs)(`span`,{className:z.balanceDetailHead,children:[(0,m.jsx)(`span`,{className:z.balanceDetailTitle,children:e.displayName}),(0,m.jsx)(`button`,{type:`button`,className:z.balanceDetailClose,"aria-label":i(`close`),onClick:a,children:`×`})]}),(0,m.jsxs)(`span`,{className:z.balanceDetailGrid,children:[s!==void 0&&(0,m.jsx)(sa,{label:i(`balance`),value:s}),c!==void 0&&(0,m.jsx)(sa,{label:i(`balanceGranted`),value:c}),l!==void 0&&(0,m.jsx)(sa,{label:i(`balanceTopped`),value:l}),(0,m.jsx)(sa,{label:i(`balanceDaily`),value:r(n)}),(0,m.jsx)(sa,{label:i(`balanceDaysLong`),value:`${t} ${i(`balanceDaysUnit`)}`})]})]})}function sa({label:e,value:t}){return(0,m.jsxs)(`span`,{className:z.balanceDetailRow,children:[(0,m.jsx)(`span`,{className:z.balanceDetailLabel,children:e}),(0,m.jsx)(`span`,{className:z.balanceDetailValue,children:t})]})}function ca({userPrices:e,onUserPrices:t,t:n}){let[r,i]=(0,d.useState)(()=>[...e]),[a,o]=(0,d.useState)(new Set),s=e=>o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),c=()=>{i(e=>e.filter((e,t)=>!a.has(t))),o(new Set)},l=(e,t)=>i(n=>n.map((n,r)=>r===e?{...n,...t}:n)),u=()=>i(e=>[...e,{key:``,input:0,cacheHit:0,output:0}]),f=e=>{let t=r[e]?.offPeak;return{input:t===void 0?``:String(t.input),cacheHit:t===void 0?``:String(t.cacheHit),output:t===void 0?``:String(t.output)}},p=(e,t,n)=>i(r=>r.map((r,i)=>{if(i!==e)return r;let a=r.offPeak,o={input:a===void 0?``:String(a.input),cacheHit:a===void 0?``:String(a.cacheHit),output:a===void 0?``:String(a.output),[t]:n},s=[o.input,o.cacheHit,o.output].some(e=>e.trim()!==``),c=[o.input,o.cacheHit,o.output].map(e=>Number(e)),l=s&&c.every(e=>Number.isFinite(e)&&e>=0)&&c.some(e=>e>0),{offPeak:u,...d}=r;return l?{...d,offPeak:{input:c[0]??0,cacheHit:c[1]??0,output:c[2]??0}}:d})),h=()=>t(r.filter(e=>e.key.trim()!==``).map(e=>({...e,key:e.key.trim(),...e.origin===void 0||e.origin.trim()===``?{}:{origin:lt(e.origin.trim())}}))),g=sn().map(e=>e.key),_=(e,t)=>i(n=>n.map((n,r)=>{if(r!==e)return n;let{currency:i,...a}=n;return t===`USD`?{...a,currency:`USD`}:a})),[v,b]=(0,d.useState)({}),x=(e,t,n)=>`${e}:${t}:${n}`,S=(e,t,n)=>b(r=>{let i=x(e,t,n);if(r[i]===void 0)return r;let a={...r};return delete a[i],a}),C=e=>Number.isFinite(e)&&e!==0?String(e):``,w=(e,t,n)=>{if(b(r=>({...r,[x(e,`main`,t)]:n})),n===``){l(e,{[t]:0});return}let r=Number(n);Number.isFinite(r)&&r>=0&&l(e,{[t]:r})};return(0,m.jsxs)(`section`,{className:z.setCard,"data-testid":`billing-user-prices`,children:[(0,m.jsx)(`div`,{className:z.setCardHead,children:(0,m.jsx)(`div`,{className:z.setCardMeta,children:(0,m.jsxs)(`h3`,{className:z.setCardTitle,children:[n(`userPrices`),(0,m.jsx)(ra,{label:n(`userPricesHint`),t:n})]})})}),(0,m.jsxs)(`div`,{className:z.ctlCol,children:[(0,m.jsx)(`datalist`,{id:`billing-price-model-keys`,children:g.map(e=>(0,m.jsx)(`option`,{value:e},e))}),r.map((e,t)=>(0,m.jsxs)(`div`,{className:z.userPriceRow,"data-testid":`billing-user-price-row`,children:[(0,m.jsx)(`input`,{type:`checkbox`,className:z.userPriceCheck,"data-testid":`billing-user-price-select`,checked:a.has(t),"aria-label":n(`userPriceSelect`),onChange:()=>s(t)}),(0,m.jsxs)(`div`,{className:z.userPriceBody,children:[(0,m.jsxs)(`div`,{className:z.userPriceLineMeta,children:[(0,m.jsxs)(`div`,{className:z.userPriceField,children:[(0,m.jsx)(`span`,{className:z.ctlLabel,children:n(`userPriceModel`)}),(0,m.jsx)(`input`,{className:z.userPriceInput,"data-testid":`billing-user-price-model`,type:`text`,list:`billing-price-model-keys`,value:e.key,placeholder:`flash`,"aria-label":n(`userPriceModel`),onChange:e=>l(t,{key:e.target.value})})]}),(0,m.jsxs)(`div`,{className:z.userPriceField,children:[(0,m.jsx)(`span`,{className:z.ctlLabel,children:n(`userPriceSource`)}),(0,m.jsx)(`input`,{className:z.userPriceInput,"data-testid":`billing-user-price-origin`,type:`text`,value:e.origin??``,placeholder:n(`userPriceSourceHint`),"aria-label":n(`userPriceSource`),onChange:e=>l(t,{origin:e.target.value.trim()})})]}),(0,m.jsxs)(`div`,{className:z.userPriceField,children:[(0,m.jsx)(`span`,{className:z.ctlLabel,children:n(`userPriceCurrency`)}),(0,m.jsxs)(`div`,{className:z.ctlGroup,children:[(0,m.jsx)(`button`,{type:`button`,className:y(z.floatModeBtn,e.currency!==`USD`&&z.floatModeBtnOn),onClick:()=>_(t,`CNY`),children:`CNY`}),(0,m.jsx)(`button`,{type:`button`,className:y(z.floatModeBtn,e.currency===`USD`&&z.floatModeBtnOn),onClick:()=>_(t,`USD`),children:`USD`})]})]})]}),[{scope:`main`,label:n(`userPriceNormal`),testid:`billing-user-price-normal`,valueOf:n=>v[x(t,`main`,n)]??C(e[n]),onChange:(e,n)=>w(t,e,n)},{scope:`off`,label:n(`userPriceOffPeak`),testid:`billing-user-price-offpeak`,valueOf:e=>v[x(t,`off`,e)]??f(t)[e],onChange:(e,n)=>{b(r=>({...r,[x(t,`off`,e)]:n})),p(t,e,n)}}].map(e=>(0,m.jsxs)(`div`,{className:z.userPricePriceLine,"data-testid":e.testid,children:[(0,m.jsx)(`span`,{className:z.ctlLabel,children:e.label}),[`input`,`cacheHit`,`output`].map(r=>{let i=n(r===`input`?`tokenMiss`:r===`cacheHit`?`tokenHit`:`tokenOutput`);return(0,m.jsx)(`input`,{className:z.userPriceInputNum,type:`number`,min:0,step:.01,placeholder:i,"aria-label":`${e.label} ${i}`,value:e.valueOf(r),onChange:t=>e.onChange(r,t.target.value),onBlur:()=>S(t,e.scope,r)},r)})]},e.testid))]})]},t)),(0,m.jsxs)(`div`,{className:z.ctlRow,children:[(0,m.jsx)(`button`,{type:`button`,className:z.exportButton,"data-testid":`billing-user-price-add`,onClick:u,children:n(`userPriceAdd`)}),(0,m.jsxs)(`button`,{type:`button`,className:z.exportButton,"data-testid":`billing-user-price-remove-selected`,disabled:a.size===0,onClick:c,children:[n(`userPriceRemoveSelected`),a.size>0?` (${a.size})`:``]}),(0,m.jsx)(`button`,{type:`button`,className:z.exportButton,"data-testid":`billing-user-price-save`,onClick:h,children:n(`userPriceSave`)})]})]})]})}function la({stats:e,t,onClose:n,embeddedSettings:r=!1,userPrices:i,onUserPrices:a,health:o,balances:s,reconcile:c,quotas:l,relayQuotas:u,currency:f,onCurrency:h,language:g,onLanguage:_,turns:v,renderSlot:b,budgetEnabled:x,budgetAmount:S,onToggleBudget:C,onBudgetAmount:w,modelBudgets:T,monthModelCost:E,onModelBudget:ee,peakConfig:D,onPeakConfig:O,onPreviewPeak:te,floatPrefs:k,onFloatPrefs:A,cardPrefs:j,onCardPrefs:ne,recoveryEntryAvailable:re,sitePrefs:M,onSitePrefs:ie,liveCostPrefs:se,onLiveCostPrefs:ce,quotasStale:de,balanceStale:fe,navigateToSession:pe}){let me=(0,d.useRef)(null),he=(0,d.useMemo)(()=>Ci(e.bySession??[]),[e.bySession]),ge=(0,d.useMemo)(()=>Ti(he),[he]),[_e,ve]=(0,d.useState)(void 0),ye=(0,d.useCallback)(e=>{let n=pe(e);if(n===`opened`){ve(void 0);return}ve(t(n===`unavailable`?`sessionOpenUnavailable`:`sessionOpenFailed`))},[pe,t]),[be,xe]=(0,d.useState)(`cost`),{total:Se,byModel:Ce,byDay:N}=e,[P,Te]=(0,d.useState)(r?`settings`:`overview`),[Ee,ke]=(0,d.useState)(7),[je,Me]=(0,d.useState)(()=>{try{return window.localStorage.getItem(`dsh-billing:reconcile-dismissed`)??``}catch{return``}}),Ne=()=>{let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`},Pe=(0,d.useCallback)(()=>{let e=Ne();Me(e);try{window.localStorage.setItem(`dsh-billing:reconcile-dismissed`,e)}catch{}},[]),[Fe,Ie]=(0,d.useState)(()=>{let e=[`unpriced`,`search-estimate`,`unreadable`],t=new Set,n=new Date,r=e=>String(e).padStart(2,`0`),i=`${n.getFullYear()}-${r(n.getMonth()+1)}-${r(n.getDate())}`;try{for(let n of e)window.localStorage.getItem(`dsh-billing:notice-${n}-dismissed`)===i&&t.add(n)}catch{}return t}),Le=(0,d.useCallback)(e=>{let t=Ne();Ie(t=>new Set(t).add(e));try{window.localStorage.setItem(`dsh-billing:notice-${e}-dismissed`,t)}catch{}},[]),[Re,ze]=(0,d.useState)(`month`),[L,Be]=(0,d.useState)(`cost`),[Ue,qe]=(0,d.useState)(He),[Je,Ye]=(0,d.useState)(Ge),[Xe,Ze]=(0,d.useState)(`budget`),[Qe,B]=(0,d.useState)(``),V=e=>Di(Qe,e);(0,d.useEffect)(()=>{let e=me.current;if(P!==`settings`||e===null||typeof IntersectionObserver>`u`)return;let t=Array.from(e.querySelectorAll(`[id^="settings-"]`)).filter(e=>!e.closest(`[hidden]`));if(t.length===0)return;let n=new IntersectionObserver(e=>{let t,n=1/0;for(let r of e){if(!r.isIntersecting)continue;let e=r.boundingClientRect.top;e<n&&(n=e,t=r.target.id)}t!==void 0&&Ze(t.slice(9))},{rootMargin:`-80px 0px -55% 0px`});for(let e of t)n.observe(e);return()=>{n.disconnect()}},[P]);let $e=(0,d.useCallback)(e=>{Ze(e);let t=me.current?.querySelector(`[id="settings-${e}"]`);if(t==null)return;if(r){t.scrollIntoView({block:`start`,behavior:`smooth`});return}let n=t.closest(`.${z.dashboardBody}`);if(n===null)return;let i=t.getBoundingClientRect().top-n.getBoundingClientRect().top;n.scrollTo({top:n.scrollTop+i,behavior:`smooth`})},[r]),et=(0,d.useCallback)(e=>{qe(e),R(e)},[]),tt=(0,d.useCallback)(e=>{Ye(e),Ke(e)},[]);(0,d.useEffect)(()=>{typeof document>`u`||(document.documentElement.dataset.density=Ue,document.documentElement.dataset.motion=Je)},[Ue,Je]),(0,d.useEffect)(()=>{if(typeof window>`u`)return;let e=e=>{let t=e.detail;t?.density!==void 0&&qe(t.density)},t=e=>{let t=e.detail;t?.motion!==void 0&&Ye(t.motion)};return window.addEventListener(Ve,e),window.addEventListener(We,t),()=>{window.removeEventListener(Ve,e),window.removeEventListener(We,t)}},[]);let[H,rt]=(0,d.useState)(ae),[U,it]=(0,d.useState)(le),at=e=>{let t={...U,...e};t.start!==``&&t.end!==``&&(t.start>t.end&&(e.start===void 0?t.start=t.end:t.end=t.start),it(t),ue(t))},ot=(0,d.useMemo)(()=>l.filter(e=>e.status===`ok`&&e.windows.length>0).map(e=>({id:e.provider,label:e.displayName})),[l]),[st,ct]=(0,d.useState)(),[lt,ut]=(0,d.useState)(new Set),[dt,ft]=(0,d.useState)(!1),[pt,mt]=(0,d.useState)(``),ht=(0,d.useCallback)(e=>{ut(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),gt=(0,d.useMemo)(()=>Si(e.bySession??[]),[e.bySession]),_t=e=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`td`,{className:z.numCol,children:e.calls.toLocaleString()}),(0,m.jsx)(`td`,{className:z.numCol,children:W(e.cost)}),(0,m.jsx)(`td`,{className:z.numCol,children:e.lastActive>0?`${G(e.lastActive)} ${Fi(e.lastActive)}`:`—`})]}),vt=(e,n)=>(0,m.jsxs)(d.Fragment,{children:[(0,m.jsxs)(`tr`,{className:y(z.sessionChildRow,n>0&&z.sessionSubDeepRow),"data-testid":`billing-session-sub-row`,children:[(0,m.jsxs)(`td`,{children:[(0,m.jsx)(`span`,{className:y(z.ubTag,z.ubTagNeutral),children:t(`sessionSubRow`)}),(e.subCalls??0)>0&&(0,m.jsx)(`span`,{className:y(z.ubTag,z.ubTagNeutral),"data-testid":`billing-session-sub-chain`,children:e.subCost!==void 0&&e.subCost>0?t(`sessionSubCost`).replace(`{cost}`,W(e.subCost)):t(`sessionSubCalls`).replace(`{calls}`,(e.subCalls??0).toLocaleString())}),(0,m.jsx)(`span`,{className:z.modelProvider,children:e.title??e.id.slice(0,8)})]}),_t(e)]}),e.subs?.map(e=>vt(e,n+1))]},e.id),yt=(0,d.useMemo)(()=>Ei(e.bySession??[],pt),[e.bySession,pt]),bt=(0,d.useMemo)(()=>[...new Set([...Object.keys(E),...Object.keys(T)])].map(e=>{let t=nn(e);return{key:e,name:t.key===`other`?void 0:t.name,cost:E[e]??0}}).sort((e,t)=>t.cost-e.cost),[E,T]),[St,Ct]=(0,d.useState)(()=>new Set(De())),wt=(0,d.useCallback)(e=>{Ct(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),Oe([...n]),n})},[]),[Tt,Et]=(0,d.useState)(()=>Ae()),Dt=(0,d.useCallback)(()=>{Et(e=>{let t=!e;return F(t),t})},[]),[Ot,kt]=(0,d.useState)(!1);(0,d.useEffect)(()=>{let e=!0;return Bi().then(t=>{e&&t!==void 0&&kt(t)}),()=>{e=!1}},[]);let At=(0,d.useCallback)(()=>{let e=!Ot;kt(e),Vi(e).then(t=>{t||kt(!e)})},[Ot]),jt=xt(),[Mt,Nt]=(0,d.useState)(!1),It=(0,d.useCallback)(()=>{Mt||(Nt(!0),Gi().finally(()=>{Nt(!1)}))},[Mt]),Lt=Ui,W=e=>fn(dn(e,f),f),Rt=f===`usd`?`$`:f===`eur`?`€`:`¥`,zt=g,Bt=e=>pr(e,zt),[Vt,Ht]=(0,d.useState)(``),[Ut,Wt]=(0,d.useState)(()=>we()),[Gt,Kt]=(0,d.useState)(()=>Date.now());(0,d.useEffect)(()=>{let e=setInterval(()=>{Kt(Date.now())},3e4);return()=>{clearInterval(e)}},[]);let qt=l.some(e=>e.displayName===`Z.ai Coding Plan`&&e.status===`ok`),Jt=D.leadMin*6e4,Yt=(e,n)=>e===0?t(`free`):pn(mn(e,n,f,jt.rate),f===`usd`?`USD`:f===`eur`?`EUR`:`CNY`),Xt=(0,d.useMemo)(()=>ir([...v].reverse()),[v]),Zt={peak:e.byTier?.peak.cost??0,offPeak:e.byTier?.offPeak.cost??0},Qt=Zt.peak/2,$t=zr(N,G()),en=e=>s.find(t=>Z(t.provider)===Z(e)),tn=e=>e.balance?.error===`unconfigured`&&e.models.length>0&&e.models.every(e=>e.plan),rn=e=>{if(e===void 0)return(0,m.jsx)(`span`,{className:z.na,children:`—`});if(e.error===`unconfigured`)return t(`balanceUnconfigured`);if(e.error===`unauthorized`)return t(`balanceUnauthorized`);if(e.error===`unreachable`)return t(`balanceUnreachable`);if(e.totalBalance===void 0)return(0,m.jsx)(`span`,{className:z.na,children:`—`});let n=e.currency===`USD`?`$${e.totalBalance.toFixed(2)}`:W(e.totalBalance),r=e.currency===`USD`?e.totalBalance*jt.rate:e.totalBalance,i=$t>0?Math.floor(r/$t):void 0;return(0,m.jsxs)(`span`,{className:z.balanceCell,children:[(0,m.jsx)(`span`,{children:n}),i!==void 0&&i>=0&&(0,m.jsx)(`button`,{type:`button`,className:y(z.balanceDaysBadge,i<=3&&z.balanceDaysBadgeLow),"data-testid":`billing-balance-days-badge`,title:t(`balanceDays`).replace(`{days}`,String(i)),"aria-label":`${e.displayName} ${t(`balanceDays`).replace(`{days}`,String(i))}`,onClick:t=>{t.stopPropagation(),ct(st===e.provider?void 0:e.provider)},children:`?`}),st===e.provider&&(0,m.jsx)(oa,{balance:e,days:i??0,dailyBurn:$t,money:W,t,onClose:()=>{ct(void 0)}})]})},on=Object.keys(N).sort(),cn=G(),un=N[cn]?.cost??0,gn=cn.slice(0,7),_n=cn.slice(0,4),vn=on.reduce((e,t)=>e+(t.startsWith(gn)?N[t]?.cost??0:0),0),xn=on.reduce((e,t)=>e+(t.startsWith(_n)?N[t]?.cost??0:0),0),q=(0,d.useMemo)(()=>Vr(N,gn,cn)+l.reduce((e,t)=>e+(t.planType===`code`?t.subscriptionAmount??0:0),0),[N,gn,cn,l]),En=(0,d.useMemo)(()=>{if(!(x&&S>0))return null;let e=S-vn;return{over:e<=0,remainRatio:Math.max(0,Math.min(1,e/S)),remainCny:Math.max(0,e)}},[x,S,vn]),Dn=(0,d.useMemo)(()=>{let e=[];for(let t=Ee-1;t>=0;--t){let n=new Date;n.setDate(n.getDate()-t),e.push(G(n.getTime()))}return e},[Ee]),On=Dn.at(-1)??cn,kn=(0,d.useMemo)(()=>Object.entries(N).map(([e,t])=>({date:e,value:L===`tokens`?Wr(t):t.cost})),[N,L]),jn=(0,d.useMemo)(()=>kn.reduce((e,t)=>e+t.value,0),[kn]),Mn=Hr(N),J=Ur(N),Nn=(0,d.useMemo)(()=>Dn.map(t=>{let n={},r=e.byDayModels?.[t];if(r!==void 0)for(let[e,t]of Object.entries(r))t.cost>0&&(n[e]=t.cost);let i=N[t];return{date:t,cost:i?.cost??0,calls:i?.calls??0,byModel:n,tokens:i===void 0?0:Wr(i)}}),[Dn,N,e.byDayModels]),Pn=(0,d.useMemo)(()=>Object.entries(Ce).filter(([,e])=>e.calls>0).map(([e,t])=>{let n=nn(e),r=n.key===`other`,i=r?ni(e):void 0,a={input:t.input,cacheHit:t.cacheHit,cacheMiss:t.cacheMiss,output:t.output};return{key:e,name:r?e:n.name,provider:i??n.provider,calls:t.calls,input:t.input,output:t.output,cacheHitRate:t.cacheHit+t.cacheMiss>0?t.cacheHit/(t.cacheHit+t.cacheMiss)*100:0,estimated:ln(n,a),plan:t.plan===!0,...t.cost>0?{actual:t.cost}:{},uncatalogued:r,estimatedPricing:n.estimated===!0,officialCalls:t.officialCalls??0,officialCost:t.officialCost??0}}).sort((e,t)=>(t.actual??t.estimated)-(e.actual??e.estimated)).map((e,t)=>({...e,color:Mr[t%Mr.length]??`#8b95a3`})),[Ce]),Fn=(0,d.useMemo)(()=>M.hideUnidentified?u.filter(e=>e.kind!==`unknown`):u,[u,M.hideUnidentified]),Y=(0,d.useMemo)(()=>{let n=e.byDayModelsSite;if(Tt){let t=G();n={[t]:e.byDayModelsSite?.[t]??{}}}let r=new Map;for(let t of Object.values(n??{}))for(let[n,i]of Object.entries(t))for(let[t,a]of Object.entries(i)){let i=r.get(t);i===void 0&&(i=new Map,r.set(t,i));let o=i.get(n)??{calls:0,input:0,output:0,cacheHit:0,cacheMiss:0,cost:0,allPlan:!0};o.calls+=a.calls,o.input+=a.input,o.output+=a.output,o.cacheHit+=a.cacheHit,o.cacheMiss+=a.cacheMiss,o.cost+=a.cost,o.allPlan=o.allPlan&&(a.plan??e.byModel?.[n]?.plan===!0),i.set(n,o)}let i=new Map;for(let[e,t]of r){let n=!e.startsWith(`direct:`)&&!e.startsWith(`site:`),r=[...t.entries()].filter(([,e])=>e.calls>0).map(([e,t],r)=>{let i=nn(e),a=i.key===`other`,o=a?ni(e)??i.provider:i.provider;return{key:e,name:a?e:i.name,provider:o,color:Mr[r%Mr.length]??`#8b95a3`,calls:t.calls,input:t.input,output:t.output,cacheHitRate:t.cacheHit+t.cacheMiss>0?t.cacheHit/(t.cacheHit+t.cacheMiss)*100:0,estimated:n?0:ln(i,{input:t.input,cacheHit:t.cacheHit,cacheMiss:t.cacheMiss,output:t.output}),plan:t.allPlan,...t.cost>0?{actual:t.cost}:{},uncatalogued:a,estimatedPricing:i.estimated===!0,officialCalls:0,officialCost:0}}).sort((e,t)=>(t.actual??t.estimated)-(e.actual??e.estimated));r.length>0&&i.set(e,r)}let a=e=>vr(e,zt)??t(`channelUnknown`),c=new Map,u=new Map,d=new Map,f=e=>e.startsWith(`direct:`)?`direct`:e.startsWith(`site:`)?`site`:`unknown`,p={direct:2,site:1,unknown:0,vendor:0};for(let[e,t]of i){let n=a(e),r=c.get(n);if(r===void 0)c.set(n,[...t]),u.set(n,f(e)),d.set(n,e);else{r.push(...t),r.sort((e,t)=>(t.actual??t.estimated)-(e.actual??e.estimated));let i=u.get(n)??`unknown`,a=f(e);p[a]>p[i]&&(u.set(n,a),d.set(n,e))}}let m=new Map,h=new Map;for(let e of l){if(e.status===`not-configured`)continue;let t=e.displayName??ii(e.provider),n=a(`direct:${e.provider}`),r=c.has(t)?t:c.has(n)?n:void 0,i=r??`sub:${ii(e.provider)}`;h.set(i,r??ii(e.provider));let o=m.get(i);o===void 0?m.set(i,[e]):o.push(e)}let g=e=>e===a(`direct:deepseek`)||e===a(`site:https://api.deepseek.com`)?en(`deepseek`)??en(e):en(e),_=[];for(let[e,t]of c)_.push({id:`ch:${d.get(e)??e}`,name:e,models:t,subscriptions:m.get(e)??[],balance:g(e),dot:Oi(o,t[0]?.provider??``),channelKind:u.get(e)??`unknown`});for(let[e,t]of h)c.has(e)||_.push({id:e,name:t,models:[],subscriptions:m.get(e)??[],balance:en(t),dot:Oi(o,t),channelKind:`vendor`});let v=new Set(_.flatMap(e=>[Z(e.name),...e.balance===void 0?[]:[Z(e.balance.provider)]]));for(let e of s)v.has(Z(e.provider))||(e.error===void 0||e.provider.startsWith(`custom:`))&&_.push({id:`bal:${e.provider}`,name:e.displayName,models:[],subscriptions:[],balance:e,dot:Oi(o,e.displayName),channelKind:`vendor`});return _.filter(e=>M.hideUnidentified&&e.channelKind===`unknown`?!1:!Tt||e.models.length>0).sort((e,t)=>{let n=Ni(t)-Ni(e);return n===0?e.models.length===0&&t.models.length===0?0:t.models.length===0?-1:e.models.length===0?1:e.name.localeCompare(t.name,`zh`):n})},[e.byDayModelsSite,e.byModel,l,s,o,zt,t,Tt,M.hideUnidentified]),Ln=(0,d.useMemo)(()=>Y.filter(e=>e.models.length>0||e.subscriptions.length>0).map(e=>e.id),[Y]),Rn=Ln.length>0&&Ln.every(e=>St.has(e)),zn=()=>{let e=new Set(Rn?[]:Ln);Ct(e),Oe([...e])},Bn=(0,m.jsx)(`thead`,{children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{children:t(`model`)}),(0,m.jsx)(`th`,{className:z.numCol,children:t(`calls`)}),(0,m.jsx)(`th`,{className:z.numCol,children:t(`inputTokens`)}),(0,m.jsx)(`th`,{className:z.numCol,children:t(`outputTokens`)}),(0,m.jsx)(`th`,{className:z.numCol,children:t(`cacheHitRate`)}),(0,m.jsx)(`th`,{className:z.numCol,children:t(`actual`)})]})}),Vn=e=>(0,m.jsx)(`span`,{className:z.modelCell,children:(0,m.jsxs)(`span`,{children:[(0,m.jsxs)(`span`,{className:z.modelName,children:[e.name,e.uncatalogued&&(0,m.jsx)(`span`,{className:z.uncataloguedTag,"data-testid":`billing-uncatalogued-tag`,children:t(`uncatalogued`)}),e.estimatedPricing&&(0,m.jsx)(`span`,{className:z.estimatedTag,"data-testid":`billing-estimated-tag`,children:t(`estimatedPricing`)})]}),(0,m.jsx)(`span`,{className:z.modelProvider,children:Bt(e.provider)})]})}),Un=e.bySite?.unknown?.calls??0,Wn=Pn.reduce((e,t)=>e+t.estimated,0),Kn=Se.cost>0||Un>0?Se.cost:Wn,X=(0,d.useMemo)(()=>{if(H===`all`){let e,t=0;for(let[n,r]of Object.entries(N)){let i=Wr(r);i>t&&(t=i,e=n)}return{cost:Kn,calls:Se.calls,input:Se.input,output:Se.output,cacheHit:Se.cacheHit,cacheMiss:Se.cacheMiss,cacheWrite:Se.cacheWrite??0,reasoning:Se.reasoning??0,peakDay:e,peakTokens:t}}return H===`custom`?Jr(N,U.start,U.end):qr(N,G(),H)},[H,U,Kn,Se,N]),qn=H===`custom`?U.start===U.end?U.start:`${U.start} – ${U.end}`:t({today:`avgRangeToday`,"7d":`avgRange7d`,week:`avgRangeWeek`,month:`avgRangeMonth`,all:`avgRangeAll`}[H]),Yn=(0,d.useMemo)(()=>Pn.map(e=>({key:e.key,name:e.name,color:e.color})),[Pn]),Xn=Nn.length>=2?Nn.at(-2)?.cost??0:0,Zn=Xn>0?(un-Xn)/Xn*100:0,Qn=(0,m.jsxs)(`div`,{ref:me,className:y(z.dashboard,r&&z.nativeSettingsDashboard),"data-testid":r?`native-billing-settings-dashboard`:`billing-dashboard`,children:[!r&&(0,m.jsxs)(`div`,{className:z.dashboardHead,"data-testid":`billing-dashboard-head`,children:[(0,m.jsxs)(`div`,{children:[b(`billing.dashboard.decor`,{position:`head`}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h2`,{className:z.dashboardTitle,children:t(`title`)}),b(`billing.dashboard.decor`,{position:`headTitle`})]}),(0,m.jsxs)(`p`,{className:z.dashboardSubtitle,children:[t(`lastUpdated`),` `,On,e.timezone===void 0?null:` · ${e.timezone.name} (${e.timezone.offset})`]})]}),(0,m.jsxs)(`div`,{className:z.dashboardRight,children:[(0,m.jsx)(`span`,{className:z.currencyToggle,role:`group`,"aria-label":t(`language`),children:[`en`,`zh`].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(z.currencyButton,g===e&&z.currencyButtonActive),"aria-pressed":g===e,"data-testid":`billing-language-${e}`,onClick:()=>{_(e)},children:e===`en`?`EN`:`中`},e))}),(0,m.jsx)(`span`,{className:z.currencyToggle,role:`group`,"aria-label":t(`currency`),children:[`cny`,`usd`,`eur`].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(z.currencyButton,f===e&&z.currencyButtonActive),"aria-pressed":f===e,"data-testid":`billing-currency-${e}`,title:t(e===`cny`?`currencyCny`:e===`usd`?`currencyUsd`:`currencyEur`),onClick:()=>{h(e)},children:e===`cny`?`¥ CNY`:e===`usd`?`$ USD`:`€ EUR`},e))}),o.checked&&(0,m.jsxs)(`span`,{className:y(z.healthBadge,o.available?z.healthBadgeOk:z.healthBadgeBad),children:[(0,m.jsx)(`span`,{className:y(z.healthDot,o.available?z.healthOk:z.healthBad),role:`img`,"aria-label":o.available?t(`healthDotLive`):t(`healthDotFailed`),title:o.available?t(`healthDotLive`):t(`healthDotFailed`)}),o.available?`${t(`healthModelsLive`).replace(`{n}`,String(o.models))}${o.failures>0?` · ${t(`healthVendorsDown`).replace(`{n}`,String(o.failures))}`:``}`:t(`healthVendorsUnavailable`).replace(`{n}`,String(o.failures))]}),(0,m.jsx)(`button`,{type:`button`,className:z.closeButton,"aria-label":t(`close`),"data-testid":`billing-close`,onClick:n,children:(0,m.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"aria-hidden":`true`,children:[(0,m.jsx)(`path`,{d:`M18 6 6 18`}),(0,m.jsx)(`path`,{d:`m6 6 12 12`})]})})]})]}),!r&&e.staleSnapshot===!0&&(0,m.jsx)(`div`,{className:z.staleNotice,"data-testid":`billing-stale-snapshot`,children:t(`staleSnapshotNotice`)}),!r&&(0,m.jsx)(`nav`,{className:z.tabNav,"data-testid":`billing-tab-nav`,role:`tablist`,"aria-label":t(`title`),children:Pr.map(e=>(0,m.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":P===e.id,"aria-controls":`billing-tab-panel-${e.id}`,className:y(z.tabButton,P===e.id&&z.tabButtonActive),"data-testid":`billing-tab-${e.id}`,onClick:()=>{Te(e.id)},children:[(0,m.jsx)(`span`,{className:z.tabRailIcon,"aria-hidden":`true`,children:Ir[e.id]}),(0,m.jsx)(`span`,{className:z.tabNavLabel,children:t(e.labelKey)})]},e.id))}),(0,m.jsxs)(`div`,{className:y(z.dashboardBody,r&&z.nativeSettingsBody),children:[P===`queue`&&(0,m.jsx)(ta,{t,language:g,navigateToSession:pe}),P===`overview`&&(0,m.jsxs)(`div`,{className:z.tabPanel,"data-testid":`billing-tab-panel-overview`,children:[c?.kind===`drift`&&c.spent!==void 0&&je!==Ne()&&(0,m.jsxs)(`div`,{className:z.reconcileNotice,"data-testid":`billing-reconcile-notice`,role:`note`,children:[(0,m.jsx)(`span`,{className:z.reconcileIcon,"aria-hidden":`true`,children:(0,m.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,m.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,m.jsx)(`line`,{x1:`12`,y1:`10`,x2:`12`,y2:`16`}),(0,m.jsx)(`line`,{x1:`12`,y1:`7.5`,x2:`12.01`,y2:`7.5`})]})}),(0,m.jsx)(`span`,{className:z.reconcileText,children:t(`reconcileDrift`).replace(`{provider}`,c.provider??``).replace(`{spent}`,W(c.spent)).replace(`{today}`,W(c.todayOfficialCost??0))}),(0,m.jsx)(`button`,{type:`button`,className:z.reconcileDismiss,"data-testid":`billing-reconcile-dismiss`,onClick:Pe,children:t(`reconcileDismiss`)})]}),fe===!0&&(0,m.jsx)(`div`,{className:z.staleNotice,"data-testid":`billing-balance-stale`,children:t(`balanceStaleNotice`)}),(0,m.jsxs)(`section`,{className:z.hero,"data-testid":`billing-hero`,children:[b(`billing.dashboard.decor`,{position:`hero`}),(0,m.jsxs)(`div`,{className:z.heroTop,children:[(0,m.jsxs)(`div`,{className:z.heroMain,children:[(0,m.jsx)(`span`,{className:z.heroLabel,"data-testid":`billing-hero-range-label`,children:qn}),(0,m.jsxs)(`div`,{className:z.heroReadout,children:[(0,m.jsx)(`span`,{className:z.heroCurrency,"aria-hidden":`true`,children:Rt}),(0,m.jsx)(`span`,{className:z.heroValue,"data-testid":`billing-hero-range-value`,children:W(X.cost).slice(1)})]}),(0,m.jsxs)(`span`,{className:z.heroMeta,children:[X.calls.toLocaleString(),` `,t(`calls`),H===`month`&&q>0&&(0,m.jsxs)(`span`,{className:z.heroPred,children:[` `,t(`monthProjected`),` `,W(q)]})]})]}),En!==null&&(0,m.jsxs)(`div`,{className:z.heroGauge,"data-testid":`billing-hero-gauge`,children:[(0,m.jsxs)(`div`,{className:z.heroGaugeDial,children:[(0,m.jsxs)(`svg`,{className:z.heroGaugeSvg,viewBox:`0 0 120 120`,"aria-hidden":`true`,children:[(0,m.jsx)(`defs`,{children:(0,m.jsxs)(`linearGradient`,{id:`heroRingGrad`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`100%`,children:[(0,m.jsx)(`stop`,{offset:`0%`,stopColor:`var(--ds-cyan)`}),(0,m.jsx)(`stop`,{offset:`55%`,stopColor:`var(--ds-blue)`}),(0,m.jsx)(`stop`,{offset:`100%`,stopColor:`var(--ds-amber)`})]})}),(0,m.jsx)(`circle`,{className:z.heroGaugeTrack,cx:`60`,cy:`60`,r:`52`}),(0,m.jsx)(`circle`,{className:y(z.heroGaugeArc,En.over&&z.heroGaugeArcOver),cx:`60`,cy:`60`,r:`52`,style:{strokeDasharray:`${En.remainRatio*326.7} 326.7`},stroke:En.over?void 0:`url(#heroRingGrad)`})]}),(0,m.jsxs)(`span`,{className:z.heroGaugeCenter,children:[(0,m.jsxs)(`span`,{className:y(z.heroGaugeRemain,En.over&&z.heroGaugeRemainOver),children:[Rt,dn(En.remainCny,f).toFixed(2)]}),(0,m.jsx)(`span`,{className:z.heroGaugeLabel,children:t(`budgetRemain`)})]})]}),(0,m.jsxs)(`span`,{className:z.heroGaugeSub,children:[W(vn),` / `,W(S)]})]})]}),(0,m.jsxs)(`div`,{className:z.heroSide,children:[(0,m.jsxs)(`div`,{className:z.heroSideItem,children:[(0,m.jsx)(`span`,{className:z.heroSideLabel,children:t(`yearCost`)}),(0,m.jsx)(`span`,{className:z.heroSideValue,children:W(xn)})]}),(0,m.jsxs)(`div`,{className:z.heroSideItem,children:[(0,m.jsx)(`span`,{className:z.heroSideLabel,children:t(`todayCost`)}),(0,m.jsxs)(`span`,{className:z.heroSideValue,children:[W(un),(0,m.jsxs)(`span`,{className:y(z.delta,Zn>=0?z.deltaUp:z.deltaDown),children:[Zn>=0?`▲`:`▼`,` `,Math.abs(Zn).toFixed(1),`%`]})]})]}),q>0&&(0,m.jsxs)(`div`,{className:z.heroSideItem,title:t(`monthProjectedHint`),children:[(0,m.jsx)(`span`,{className:z.heroSideLabel,children:t(`monthProjected`)}),(0,m.jsx)(`span`,{className:z.heroSideValue,children:W(q)})]}),q<=0&&(0,m.jsx)(`span`,{className:z.heroSideSpacer,"aria-hidden":`true`})]})]}),(e.unpricedModels?.length??0)>0&&!Fe.has(`unpriced`)&&(0,m.jsxs)(`div`,{className:z.unpricedHint,"data-testid":`billing-unpriced-hint`,children:[(0,m.jsx)(`span`,{className:z.unpricedHintBody,children:t(`unpricedHint`).replace(`{count}`,String(e.unpricedModels?.length??0))}),(0,m.jsx)(`button`,{type:`button`,className:z.noticeDismiss,"data-testid":`billing-unpriced-dismiss`,"aria-label":t(`close`),onClick:()=>{Le(`unpriced`)},children:`×`})]}),(e.total.searchCalls??0)>0&&!Fe.has(`search-estimate`)&&(0,m.jsxs)(`div`,{className:z.unpricedHint,"data-testid":`billing-search-estimate-hint`,children:[(0,m.jsx)(`span`,{className:z.unpricedHintBody,children:t(`searchEstimateHint`).replace(`{count}`,String(e.total.searchCalls??0)).replace(`{each}`,W(e.searchCallEstimateCny??0))}),(0,m.jsx)(`button`,{type:`button`,className:z.noticeDismiss,"data-testid":`billing-search-estimate-dismiss`,"aria-label":t(`close`),onClick:()=>{Le(`search-estimate`)},children:`×`})]}),(e.unreadableSessions??0)>0&&!Fe.has(`unreadable`)&&(0,m.jsxs)(`div`,{className:z.staleNotice,"data-testid":`billing-sessions-unreadable`,children:[(0,m.jsxs)(`div`,{className:z.staleNoticeBody,children:[t(`unreadableNotice`).replace(`{count}`,String(e.unreadableSessions)),(e.unreadableNoLedgerSessions??0)>0&&(0,m.jsx)(`div`,{className:z.staleNoticeSub,"data-testid":`billing-sessions-no-ledger`,children:t(`unreadableNoLedgerNotice`).replace(`{count}`,String(e.unreadableNoLedgerSessions))}),(e.unreadableFormatSessions??0)>0&&(0,m.jsx)(`div`,{className:z.staleNoticeSub,"data-testid":`billing-sessions-format-unsupported`,children:t(`unreadableFormatNotice`).replace(`{count}`,String(e.unreadableFormatSessions))})]}),(0,m.jsx)(`button`,{type:`button`,className:z.noticeDismiss,"data-testid":`billing-unreadable-dismiss`,"aria-label":t(`close`),onClick:()=>{Le(`unreadable`)},children:`×`})]}),(0,m.jsxs)(`div`,{className:z.kpiZone,children:[(0,m.jsxs)(`div`,{className:z.kpiZoneHead,children:[(0,m.jsx)(`span`,{className:z.kpiZoneLabel,children:t(`kpiRange`)}),(0,m.jsx)(`div`,{className:z.heatmapRangeSwitch,"data-testid":`billing-kpi-range`,role:`group`,"aria-label":t(`kpiRange`),children:[[`today`,`avgRangeToday`],[`7d`,`avgRange7d`],[`week`,`avgRangeWeek`],[`month`,`avgRangeMonth`],[`all`,`avgRangeAll`],[`custom`,`avgRangeCustom`]].map(([e,n])=>(0,m.jsx)(`button`,{type:`button`,className:y(z.heatmapRangeButton,H===e&&z.heatmapRangeButtonActive),"data-testid":`billing-kpi-range-${e}`,"aria-pressed":H===e,onClick:()=>{rt(e),oe(e)},children:t(n)},e))})]}),H===`custom`&&(0,m.jsxs)(`div`,{className:z.kpiCustomRange,"data-testid":`billing-kpi-custom-range`,children:[(0,m.jsxs)(`label`,{children:[t(`customRangeStart`),(0,m.jsx)(`input`,{type:`date`,value:U.start,max:G(),"data-testid":`billing-kpi-custom-start`,onChange:e=>{at({start:e.target.value})}})]}),(0,m.jsxs)(`label`,{children:[t(`customRangeEnd`),(0,m.jsx)(`input`,{type:`date`,value:U.end,max:G(),"data-testid":`billing-kpi-custom-end`,onChange:e=>{at({end:e.target.value})}})]})]}),(0,m.jsx)(`section`,{className:z.kpiGrid,"data-testid":`billing-kpi-grid`,children:(()=>{let e=Object.keys(N).sort().slice(-7),n=G(),r=e.indexOf(n),i=(e,t)=>e[t]??0,a=e.map(e=>N[e]?.cost??0),o=e.map(e=>N[e]?.calls??0),s=e.map(e=>{let t=N[e];return t===void 0?0:Wr(t)}),c=e.map(e=>{let t=N[e];return t!==void 0&&t.cacheHit+t.cacheMiss>0?t.cacheHit/(t.cacheHit+t.cacheMiss)*100:0}),l=r>0&&i(a,r-1)>0?(i(a,r)-i(a,r-1))/i(a,r-1)*100:0,u=r>0&&i(o,r-1)>0?(i(o,r)-i(o,r-1))/i(o,r-1)*100:0,d=r>0&&i(s,r-1)>0?(i(s,r)-i(s,r-1))/i(s,r-1)*100:0,f=r>0&&i(c,r-1)>0?i(c,r)-i(c,r-1):0,h=(e,t)=>H===`custom`?null:(0,m.jsx)(`svg`,{viewBox:`0 0 28 12`,preserveAspectRatio:`none`,style:{display:`block`,width:`100%`,height:`12px`},children:e.map((n,r)=>{let i=n/Math.max(...e,1)*10,a=r*4;return(0,m.jsx)(`rect`,{x:a,y:12-i,width:`2.5`,height:i,fill:t,opacity:r===e.length-1?1:.6},r)})}),g=e=>H===`custom`?null:(0,m.jsxs)(`span`,{className:y(z.kpiDelta,e>0?z.kpiDeltaUp:e<0?z.kpiDeltaDown:z.kpiDeltaFlat),children:[e>0?`▲`:e<0?`▼`:``,` `,Math.abs(e).toFixed(1),`%`]});return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:z.kpiTile,"data-testid":`billing-kpi-tile`,children:[(0,m.jsxs)(`div`,{className:z.kpiLabelRow,children:[(0,m.jsx)(p.Tooltip,{label:t(`kpiDescCacheHit`),side:`top`,maxWidth:280,children:(0,m.jsx)(`span`,{className:z.kpiLabel,children:t(`cacheHitRate`)})}),g(f)]}),(0,m.jsx)(`span`,{className:y(z.kpiValue,z.kpiGreen),children:hn(X.cacheHit+X.cacheMiss>0?X.cacheHit/(X.cacheHit+X.cacheMiss)*100:0)}),(0,m.jsx)(`div`,{className:z.kpiSpark,children:h(c,`var(--ds-cyan)`)}),(0,m.jsxs)(`span`,{className:z.kpiDetail,children:[K(X.cacheHit),` / `,K(X.cacheHit+X.cacheMiss),X.cacheWrite>0?` · ${t(`tokenCacheWrite`)} ${K(X.cacheWrite)}`:``]})]}),(0,m.jsxs)(`div`,{className:z.kpiTile,children:[(0,m.jsxs)(`div`,{className:z.kpiLabelRow,children:[(0,m.jsx)(p.Tooltip,{label:t(`kpiDescTokens`),side:`top`,maxWidth:280,children:(0,m.jsx)(`span`,{className:z.kpiLabel,children:t(`tokens`)})}),g(d)]}),(0,m.jsx)(`span`,{className:z.kpiValue,children:K(X.input+X.output)}),(0,m.jsx)(`div`,{className:z.kpiSpark,children:h(s,`var(--ds-blue)`)}),(0,m.jsxs)(`span`,{className:z.kpiDetail,children:[t(`inputTokens`),` `,K(X.input),` · `,t(`outputTokens`),` `,K(X.output)]})]}),(0,m.jsxs)(`div`,{className:z.kpiTile,"data-testid":`billing-kpi-avg`,children:[(0,m.jsxs)(`div`,{className:z.kpiLabelRow,children:[(0,m.jsx)(p.Tooltip,{label:t(`kpiDescAvgCost`),side:`top`,maxWidth:280,children:(0,m.jsx)(`span`,{className:z.kpiLabel,children:t(`avgCost`)})}),g(l)]}),(0,m.jsx)(`span`,{className:z.kpiValue,children:W(X.calls>0?X.cost/X.calls:0)}),(0,m.jsx)(`div`,{className:z.kpiSpark,children:h(a,`var(--ds-blue)`)}),(0,m.jsxs)(`span`,{className:z.kpiDetail,children:[t(`calls`),` `,X.calls.toLocaleString()]})]}),(0,m.jsxs)(`div`,{className:z.kpiTile,children:[(0,m.jsxs)(`div`,{className:z.kpiLabelRow,children:[(0,m.jsx)(p.Tooltip,{label:t(`kpiDescCalls`),side:`top`,maxWidth:280,children:(0,m.jsx)(`span`,{className:z.kpiLabel,children:t(`calls`)})}),g(u)]}),(0,m.jsx)(`span`,{className:z.kpiValue,children:X.calls.toLocaleString()}),(0,m.jsx)(`div`,{className:z.kpiSpark,children:h(o,`var(--ds-blue)`)}),(0,m.jsxs)(`span`,{className:z.kpiDetail,children:[Pn.length,` `,t(`models`)]})]}),(0,m.jsxs)(`div`,{className:z.kpiTile,"data-testid":`billing-kpi-think`,children:[(0,m.jsx)(`div`,{className:z.kpiLabelRow,children:(0,m.jsx)(p.Tooltip,{label:t(`kpiDescReasoning`),side:`top`,maxWidth:280,children:(0,m.jsx)(`span`,{className:z.kpiLabel,children:t(`tokenReasoningShare`)})})}),(0,m.jsx)(`span`,{className:y(z.kpiValue,z.kpiGreen),children:hn(X.output>0?X.reasoning/X.output*100:0)}),(0,m.jsx)(`span`,{className:z.kpiDetail,children:K(X.reasoning)})]}),(0,m.jsxs)(`div`,{className:z.kpiTile,"data-testid":`billing-kpi-io`,children:[(0,m.jsx)(`div`,{className:z.kpiLabelRow,children:(0,m.jsx)(p.Tooltip,{label:t(`kpiDescIo`),side:`top`,maxWidth:280,children:(0,m.jsx)(`span`,{className:z.kpiLabel,children:t(`tokenIo`)})})}),(0,m.jsx)(`span`,{className:z.kpiValue,children:(X.output>0?X.input/X.output:0).toFixed(2)}),(0,m.jsxs)(`span`,{className:z.kpiDetail,children:[K(X.input),` / `,K(X.output)]})]}),(0,m.jsxs)(`div`,{className:z.kpiTile,"data-testid":`billing-kpi-peak`,children:[(0,m.jsx)(`div`,{className:z.kpiLabelRow,children:(0,m.jsx)(p.Tooltip,{label:t(`kpiDescPeak`),side:`top`,maxWidth:280,children:(0,m.jsx)(`span`,{className:z.kpiLabel,children:t(`tokenPeak`)})})}),(0,m.jsx)(`span`,{className:z.kpiValue,children:X.peakTokens>0?Tn(X.peakTokens):`—`}),(0,m.jsx)(`span`,{className:z.kpiDetail,children:X.peakDay??`—`})]})]})})()})]}),(0,m.jsxs)(`section`,{className:z.panel,"data-testid":`billing-panel-heatmap`,children:[(0,m.jsxs)(`div`,{className:z.panelHead,children:[(0,m.jsx)(`h3`,{className:z.panelTitle,children:t(`heatmap`)}),(0,m.jsx)(`div`,{className:z.heatmapRangeSwitch,"data-testid":`billing-heatmap-metric`,role:`group`,"aria-label":t(`heatmap`),children:[`cost`,`tokens`].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(z.heatmapRangeButton,L===e&&z.heatmapRangeButtonActive),"data-testid":`billing-heatmap-metric-${e}`,"aria-pressed":L===e,onClick:()=>{Be(e)},children:t(e===`cost`?`metricCost`:`metricTokens`)},e))}),(0,m.jsx)(`div`,{className:z.heatmapRangeSwitch,"data-testid":`billing-heatmap-range`,role:`group`,"aria-label":t(`heatmap`),children:[`month`,`half`,`year`].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(z.heatmapRangeButton,Re===e&&z.heatmapRangeButtonActive),"data-testid":`billing-heatmap-range-${e}`,"aria-pressed":Re===e,onClick:()=>{ze(e)},children:t(e===`month`?`heatmapMonth`:e===`half`?`heatmapHalf`:`heatmapYear`)},e))}),(0,m.jsxs)(`span`,{className:z.panelHint,"data-testid":`billing-heatmap-summary`,children:[t(`heatmapTotal`),` `,L===`tokens`?K(jn):W(jn),` · `,t(`activeDays`),` `,Mn,` · `,t(`streakDays`),` `,J]})]}),(0,m.jsx)(er,{days:kn,currency:f,t,range:Re,unit:L})]})]}),P===`agents`&&(0,m.jsxs)(`div`,{className:z.tabPanel,"data-testid":`billing-tab-panel-agents`,children:[(0,m.jsxs)(`section`,{className:z.agentSummary,"data-testid":`billing-agent-summary`,children:[(0,m.jsxs)(`span`,{className:z.agentSummaryItem,children:[(0,m.jsx)(`span`,{className:z.agentSummaryValue,children:String(ge.agents)}),(0,m.jsx)(`span`,{className:z.agentSummaryLabel,children:t(`agentsCount`)})]}),(0,m.jsxs)(`span`,{className:z.agentSummaryItem,children:[(0,m.jsx)(`span`,{className:z.agentSummaryValue,children:String(ge.delegations)}),(0,m.jsx)(`span`,{className:z.agentSummaryLabel,children:t(`agentsDelegations`)})]}),(0,m.jsxs)(`span`,{className:z.agentSummaryItem,children:[(0,m.jsx)(`span`,{className:z.agentSummaryValue,children:String(ge.roots)}),(0,m.jsx)(`span`,{className:z.agentSummaryLabel,children:t(`agentsRoots`)})]}),ge.costliest!==void 0&&ge.costliest.chainCost>0&&(0,m.jsxs)(`span`,{className:z.agentSummaryItem,children:[(0,m.jsx)(`span`,{className:z.agentSummaryValue,children:W(ge.costliest.chainCost)}),(0,m.jsx)(`span`,{className:z.agentSummaryLabel,children:t(`agentsMostExpensive`)})]})]}),he.length===0||ge.delegations===0?(0,m.jsx)(`p`,{className:z.contextEmpty,"data-testid":`billing-agents-empty`,children:t(`agentsNoData`)}):(0,m.jsx)(`div`,{className:z.agentTree,"data-testid":`billing-agent-tree`,children:(()=>{let e=n=>(0,m.jsxs)(`div`,{className:z.agentNode,children:[(0,m.jsxs)(`div`,{className:z.agentRow,style:{paddingLeft:`${String(n.depth*16)}px`},children:[(0,m.jsx)(`span`,{className:z.agentKind,children:n.depth===0?t(`agentsRoot`):t(`agentsSubagent`)}),(0,m.jsx)(`span`,{className:z.agentTitle,children:n.title??`${t(`sessionUntitled`)} · ${n.id.slice(0,8)}`}),(0,m.jsx)(`span`,{className:z.agentCalls,children:n.calls.toLocaleString()}),(0,m.jsx)(`span`,{className:z.agentCost,children:W(n.cost)}),n.children.length>0&&(0,m.jsxs)(`span`,{className:y(z.ubTag,z.ubTagNeutral),"data-testid":`billing-agent-chain`,children:[t(`agentsChainTotal`),` `,W(n.chainCost)]})]}),n.children.map(e)]},n.id);return he.map(e)})()})]}),P===`settings`&&(0,m.jsx)(`div`,{className:z.tabPanel,"data-testid":`billing-tab-panel-settings`,children:(0,m.jsxs)(`div`,{className:y(z.settingsLayout,r&&z.nativeSettingsLayout),children:[!r&&(0,m.jsx)(`aside`,{className:z.settingsNav,"data-testid":`billing-settings-nav`,role:`navigation`,"aria-label":`settings`,children:[{id:`display-pref`,icon:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:[(0,m.jsx)(`path`,{d:`M5 3v10M11 3v10`}),(0,m.jsx)(`circle`,{cx:`5`,cy:`6.5`,r:`1.8`}),(0,m.jsx)(`circle`,{cx:`11`,cy:`9.5`,r:`1.8`})]}),label:t(`settingsNavDisplayPref`)},{id:`budget`,icon:(0,m.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:(0,m.jsx)(`path`,{d:`M5 3l3 4 3-4M8 7v6M5.5 9.5h5M5.5 12h5`})}),label:t(`settingsNavBudget`)},{id:`alert`,icon:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,m.jsx)(`path`,{d:`M8 2a4 4 0 0 1 4 4v3l1.5 2.5h-11L4 9V6a4 4 0 0 1 4-4z`}),(0,m.jsx)(`path`,{d:`M6.5 13.5a1.5 1.5 0 0 0 3 0`})]}),label:t(`settingsNavAlert`)},{id:`display`,icon:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,m.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`}),(0,m.jsx)(`path`,{d:`M8 2a6 6 0 0 1 0 12z`,fill:`currentColor`,stroke:`none`})]}),label:t(`settingsNavDisplay`)},{id:`advanced`,icon:(0,m.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:(0,m.jsx)(`path`,{d:`M8 2v12M2.8 5l10.4 6M13.2 5L2.8 11`})}),label:t(`settingsNavAdvanced`),advanced:!0},{id:`about`,icon:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:[(0,m.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`}),(0,m.jsx)(`path`,{d:`M8 7.5V11`}),(0,m.jsx)(`circle`,{cx:`8`,cy:`5.2`,r:`0.9`,fill:`currentColor`,stroke:`none`})]}),label:t(`settingsNavAbout`)}].map(e=>(0,m.jsxs)(`button`,{type:`button`,className:y(z.settingsNavItem,Xe===e.id&&z.settingsNavItemActive,e.advanced&&z.settingsNavItemAdvanced),"data-testid":`billing-settings-nav-${e.id}`,onClick:()=>{$e(e.id)},children:[(0,m.jsx)(`span`,{className:z.settingsNavIcon,"aria-hidden":`true`,children:e.icon}),e.label]},e.id))}),(0,m.jsxs)(`div`,{className:z.settingsPane,children:[(0,m.jsx)(`input`,{className:y(z.ubSearch,z.settingsSearch),type:`search`,value:Qe,placeholder:t(`settingsSearchPlaceholder`),"aria-label":t(`settingsSearchPlaceholder`),"data-testid":`billing-settings-search`,onChange:e=>{B(e.target.value)}}),Qe.trim()!==``&&fa(Qe)&&(0,m.jsx)(`p`,{className:z.setCardDesc,"data-testid":`billing-settings-search-empty`,children:t(`settingsSearchEmpty`).replace(`{query}`,Qe.trim())}),(0,m.jsxs)(`div`,{hidden:V(da.display),className:z.setCard,id:`settings-display-pref`,"data-testid":`billing-density-motion-card`,children:[(0,m.jsx)(`div`,{className:z.setCardHead,children:(0,m.jsx)(`div`,{className:z.setCardMeta,children:(0,m.jsx)(`h3`,{className:z.setCardTitle,children:t(`settingsSectionDisplay`)})})}),(0,m.jsxs)(`div`,{className:z.densityRow,children:[(0,m.jsxs)(`div`,{className:z.densityLeft,children:[(0,m.jsx)(`strong`,{children:t(`densityLabel`)}),(0,m.jsx)(`span`,{children:t(`densityHint`)})]}),(0,m.jsx)(`div`,{className:z.densityButtons,"data-testid":`billing-density-buttons`,children:[`compact`,`default`,`comfortable`].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(z.densityButton,Ue===e&&z.densityButtonActive,e===`comfortable`&&z.densityButtonComfortable),"data-testid":`billing-density-${e}`,onClick:()=>{et(e)},children:t(e===`compact`?`densityCompact`:e==="default"?`densityDefault`:`densityComfortable`)},e))})]}),(0,m.jsxs)(`div`,{className:z.densityRow,children:[(0,m.jsxs)(`div`,{className:z.densityLeft,children:[(0,m.jsx)(`strong`,{children:t(`motionLabel`)}),(0,m.jsx)(`span`,{children:t(`motionHint`)})]}),(0,m.jsx)(`div`,{className:z.densityButtons,"data-testid":`billing-motion-buttons`,children:[`off`,`subtle`,`rich`].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(z.densityButton,Je===e&&z.densityButtonActive),"data-testid":`billing-motion-${e}`,onClick:()=>{tt(e)},children:t(e===`off`?`motionOff`:e===`subtle`?`motionSubtle`:`motionRich`)},e))})]})]}),(0,m.jsxs)(`section`,{hidden:V(da.budget),className:z.setCard,"data-testid":`billing-budget`,id:`settings-budget`,children:[(0,m.jsxs)(`div`,{className:z.setCardHead,children:[(0,m.jsx)(`div`,{className:z.setCardMeta,children:(0,m.jsxs)(`h3`,{className:z.setCardTitle,children:[t(`budget`),(0,m.jsx)(ra,{label:t(`budgetHint`),t})]})}),(0,m.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":x,"aria-label":t(`budget`),"data-testid":`billing-budget-toggle`,className:y(z.switch,x&&z.switchOn),onClick:C,children:(0,m.jsx)(`span`,{className:z.switchKnob})})]}),x&&(0,m.jsxs)(`div`,{className:z.ctlCol,children:[(0,m.jsxs)(`div`,{className:z.ctlRow,children:[(0,m.jsx)(`span`,{className:z.ctlLabel,children:t(`budgetAmount`)}),(0,m.jsxs)(`span`,{className:z.inp,"data-testid":`billing-budget-input-wrap`,children:[(0,m.jsx)(`span`,{className:z.affix,"aria-hidden":`true`,children:`¥`}),(0,m.jsx)(`input`,{className:z.budgetInput,"data-testid":`billing-budget-input`,type:`number`,min:0,step:1,value:S===0?``:S,placeholder:e.budget===void 0?`0`:String(e.budget),"aria-label":`${t(`budget`)}(${f===`usd`?`USD`:f===`eur`?`EUR`:`CNY`})`,title:`${t(`budget`)}(${f===`usd`?`USD`:f===`eur`?`EUR`:`CNY`})`,onChange:e=>{w(e.target.valueAsNumber)}})]})]}),S>0&&(()=>{let e=vn/S*100;return(0,m.jsx)(`div`,{className:z.ctlRowStretch,children:(0,m.jsx)(`div`,{className:z.prog,role:`progressbar`,"aria-valuenow":Math.min(e,100),"aria-valuemin":0,"aria-valuemax":100,"aria-label":t(`budget`),"data-testid":`billing-budget-track`,children:(0,m.jsx)(`div`,{className:y(z.progFill,e>=100&&z.budgetFillOver,e>=80&&e<100&&z.budgetFillWarn),style:{width:`${Math.min(e,100)}%`}})})})})(),S>0&&(0,m.jsx)(`p`,{className:z.setCardDesc,"data-testid":`billing-budget-value`,children:t(`budgetSummary`).replace(`{used}`,W(vn)).replace(`{total}`,W(S))})]}),(0,m.jsxs)(`div`,{className:z.ctlCol,"data-testid":`billing-model-budgets`,children:[(0,m.jsxs)(`span`,{className:z.modelBudgetTitle,children:[t(`modelBudgetTitle`),(0,m.jsx)(ra,{label:t(`modelBudgetHint`),t})]}),bt.length===0&&(0,m.jsx)(`p`,{className:z.modelBudgetHint,children:t(`emptyHint`)}),(0,m.jsx)(`div`,{className:z.modelBudgetList,children:bt.map(e=>(0,m.jsxs)(`div`,{className:z.modelBudgetRow,children:[(0,m.jsx)(`span`,{className:z.modelBudgetName,title:e.name??e.key,children:e.name??e.key}),(0,m.jsx)(`span`,{className:z.modelBudgetCost,"data-testid":`billing-model-budget-cost-${e.key}`,children:W(e.cost)}),(0,m.jsxs)(`span`,{className:z.inp,children:[(0,m.jsx)(`span`,{className:z.affix,"aria-hidden":`true`,children:`¥`}),(0,m.jsx)(`input`,{className:z.budgetInput,type:`number`,min:0,step:1,value:T[e.key]??``,placeholder:t(`modelBudgetPlaceholder`),"aria-label":`${t(`modelBudgetTitle`)} · ${e.name??e.key}`,"data-testid":`billing-model-budget-${e.key}`,onChange:t=>{ee(e.key,t.target.valueAsNumber)}})]})]},e.key))})]})]}),(0,m.jsxs)(`section`,{hidden:V(da.alert),className:z.setCard,"data-testid":`billing-peak-alert-settings`,id:`settings-alert`,children:[(0,m.jsxs)(`div`,{className:z.setCardHead,children:[(0,m.jsx)(`div`,{className:z.setCardMeta,children:(0,m.jsxs)(`h3`,{className:z.setCardTitle,children:[t(`peakAlert`),(0,m.jsx)(ra,{label:t(`peakAlertHint`),t})]})}),(0,m.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":D.enabled,"aria-label":t(`peakAlert`),"data-testid":`billing-peak-alert-toggle`,className:y(z.switch,D.enabled&&z.switchOn),onClick:()=>{O({...D,enabled:!D.enabled})},children:(0,m.jsx)(`span`,{className:z.switchKnob})})]}),D.enabled&&(0,m.jsxs)(`div`,{className:z.ctlCol,children:[(0,m.jsxs)(`label`,{className:z.ctlRow,children:[(0,m.jsx)(`span`,{className:z.ctlLabel,children:t(`peakAlertLeadMin`)}),(0,m.jsx)(`span`,{className:z.inp,children:(0,m.jsx)(`input`,{type:`number`,min:1,max:30,step:1,value:D.leadMin,className:z.budgetInput,"aria-label":t(`peakAlertLeadMin`),onChange:e=>{let t=Number(e.target.valueAsNumber);O({...D,leadMin:Number.isFinite(t)?Math.min(30,Math.max(1,Math.round(t))):D.leadMin})}})})]}),(0,m.jsxs)(`div`,{className:z.ctlRow,children:[(0,m.jsx)(`span`,{className:z.ctlLabel,children:t(`peakAlertPos`)}),(0,m.jsx)(`div`,{className:z.ctlGroup,role:`radiogroup`,"aria-label":t(`peakAlertPos`),children:[`bottom-right`,`center`].map(e=>(0,m.jsxs)(`label`,{className:z.rdo,children:[(0,m.jsx)(`input`,{type:`radio`,name:`peak-pos`,checked:D.position===e,onChange:()=>O({...D,position:e})}),(0,m.jsx)(`span`,{className:z.rdoDot,"aria-hidden":`true`}),t(e===`bottom-right`?`peakAlertPosCorner`:`peakAlertPosCenter`)]},e))})]}),(0,m.jsxs)(`div`,{className:z.ctlRow,children:[(0,m.jsx)(`span`,{className:z.ctlLabel,children:t(`peakAlertMode`)}),(0,m.jsx)(`div`,{className:z.ctlGroup,role:`radiogroup`,"aria-label":t(`peakAlertMode`),children:[`both`,`peak`,`offPeak`].map(e=>(0,m.jsxs)(`label`,{className:z.rdo,children:[(0,m.jsx)(`input`,{type:`radio`,name:`peak-mode`,checked:D.mode===e,onChange:()=>O({...D,mode:e})}),(0,m.jsx)(`span`,{className:z.rdoDot,"aria-hidden":`true`}),t(e===`both`?`peakAlertModeBoth`:e===`peak`?`peakAlertModePeak`:`peakAlertModeOff`)]},e))})]}),(0,m.jsxs)(`label`,{className:z.ctlRow,children:[(0,m.jsx)(`span`,{className:z.ctlLabel,children:t(`peakAlertWebNotify`)}),(0,m.jsx)(`input`,{type:`checkbox`,checked:D.webNotify,"aria-label":t(`peakAlertWebNotify`),onChange:e=>{O({...D,webNotify:e.target.checked})}})]}),(0,m.jsx)(`div`,{className:z.ctlRow,children:(0,m.jsx)(`button`,{type:`button`,className:z.btn,onClick:te,children:t(`peakAlertPreview`)})})]})]}),(0,m.jsx)(`section`,{hidden:V(da.toggles),className:z.setCard,"data-testid":`billing-toggle-setting`,id:`settings-display`,children:(0,m.jsxs)(`div`,{className:z.setGrid3,children:[(0,m.jsx)(`div`,{className:z.setCell,"data-testid":`billing-usage-stats-tool-setting`,children:(0,m.jsxs)(`div`,{className:z.setCardHead,children:[(0,m.jsx)(`div`,{className:z.setCardMeta,children:(0,m.jsxs)(`h3`,{className:z.setCardTitle,children:[t(`usageStatsTool`),(0,m.jsx)(ra,{label:t(`usageStatsToolHint`),t})]})}),(0,m.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":Ot,"aria-label":t(`usageStatsTool`),"data-testid":`billing-usage-stats-tool-toggle`,className:y(z.switch,Ot&&z.switchOn),onClick:At,children:(0,m.jsx)(`span`,{className:z.switchKnob})})]})}),(0,m.jsxs)(`div`,{className:z.setCell,"data-testid":`billing-livecost-setting`,children:[(0,m.jsxs)(`div`,{className:z.setCardHead,children:[(0,m.jsx)(`div`,{className:z.setCardMeta,children:(0,m.jsxs)(`h3`,{className:z.setCardTitle,children:[t(`liveCostBar`),(0,m.jsx)(ra,{label:t(`liveCostBarHint`),t})]})}),(0,m.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":se.show,"aria-label":t(`liveCostBar`),"data-testid":`billing-livecost-toggle`,className:y(z.switch,se.show&&z.switchOn),onClick:()=>ce({...se,show:!se.show}),children:(0,m.jsx)(`span`,{className:z.switchKnob})})]}),se.show&&(0,m.jsxs)(`div`,{className:z.rdoRow,"data-testid":`billing-livecost-position`,children:[(0,m.jsx)(`span`,{className:z.rdoLabel,children:t(`liveCostBarPosition`)}),(0,m.jsx)(ma,{liveCostPrefs:se,onLiveCostPrefs:ce,t})]})]}),(0,m.jsx)(`div`,{className:z.setCell,"data-testid":`billing-site-list-setting`,children:(0,m.jsxs)(`div`,{className:z.setCardHead,children:[(0,m.jsx)(`div`,{className:z.setCardMeta,children:(0,m.jsxs)(`h3`,{className:z.setCardTitle,children:[t(`siteListDisplay`),(0,m.jsx)(ra,{label:t(`siteListDisplayHint`),t})]})}),(0,m.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":M.hideUnidentified,"aria-label":t(`siteListDisplay`),"data-testid":`billing-site-hide-unidentified`,className:y(z.switch,M.hideUnidentified&&z.switchOn),onClick:()=>ie({hideUnidentified:!M.hideUnidentified}),children:(0,m.jsx)(`span`,{className:z.switchKnob})})]})})]})}),(0,m.jsx)(`section`,{hidden:V(da.displayExtra),className:z.setCard,"data-testid":`billing-display-setting`,id:`settings-display-extra`,children:(0,m.jsxs)(`div`,{className:z.setGrid2,children:[(0,m.jsxs)(`div`,{className:z.setCell,"data-testid":`billing-float-setting`,children:[(0,m.jsx)(`div`,{className:z.setCardHead,children:(0,m.jsx)(`div`,{className:z.setCardMeta,children:(0,m.jsxs)(`h3`,{className:z.setCardTitle,children:[t(`floatWindow`),(0,m.jsx)(ra,{label:t(`floatWindowHint`),t})]})})}),(0,m.jsxs)(`div`,{className:z.ctlCol,children:[(0,m.jsxs)(`div`,{className:z.ctlRow,children:[(0,m.jsx)(`span`,{className:z.ctlLabel,children:t(`cardMode`)}),(0,m.jsx)(`div`,{className:z.ctlGroup,"data-testid":`billing-card-mode`,children:[[`full`,`cardModeFull`],[`compact`,`cardModeCompact`],[`hidden`,`cardModeHidden`]].map(([e,n])=>(0,m.jsx)(`button`,{type:`button`,className:y(z.floatModeBtn,j.mode===e&&z.floatModeBtnOn),"data-testid":`billing-card-mode-${e}`,"aria-pressed":j.mode===e,disabled:e===`hidden`&&!re,title:e===`hidden`&&!re?t(`cardModeFallback`):void 0,onClick:()=>ne({...j,mode:e}),children:t(n)},e))})]}),!re&&(0,m.jsx)(`p`,{className:z.setCardDesc,"data-testid":`billing-card-mode-fallback`,children:t(`cardModeFallback`)}),re&&j.mode===`hidden`&&(0,m.jsx)(`p`,{className:z.setCardDesc,"data-testid":`billing-card-mode-hidden-hint`,children:t(`cardModeHiddenHint`)}),(0,m.jsxs)(`div`,{className:z.ctlRow,children:[(0,m.jsx)(`span`,{className:z.ctlLabel,children:t(`floatMode`)}),(0,m.jsxs)(`div`,{className:z.ctlGroup,"data-testid":`billing-float-mode`,children:[(0,m.jsx)(`button`,{type:`button`,className:y(z.floatModeBtn,k.mode===`combined`&&z.floatModeBtnOn),"data-testid":`billing-float-mode-combined`,onClick:()=>A({mode:`combined`,targets:k.targets}),children:t(`floatModeCombined`)}),(0,m.jsx)(`button`,{type:`button`,className:y(z.floatModeBtn,k.mode===`subscription`&&z.floatModeBtnOn),"data-testid":`billing-float-mode-subscription`,onClick:()=>A({mode:`subscription`,targets:k.targets}),children:t(`floatModeSubscription`)})]})]}),k.mode===`subscription`&&(0,m.jsxs)(`div`,{className:z.ctlRow,children:[(0,m.jsx)(`span`,{className:z.ctlLabel,children:t(`floatTargets`)}),(0,m.jsxs)(`span`,{className:z.ctlGroup,"data-testid":`billing-float-targets`,children:[ot.map(e=>{let t=k.targets.includes(e.id);return(0,m.jsxs)(`label`,{className:z.floatTarget,children:[(0,m.jsx)(`input`,{type:`checkbox`,checked:t,"data-testid":`billing-float-target-${e.id}`,onChange:()=>A({mode:`subscription`,targets:t?k.targets.filter(t=>t!==e.id):[...k.targets,e.id]})}),(0,m.jsx)(`span`,{className:z.floatTargetLabel,children:e.label})]},e.id)}),ot.length===0&&(0,m.jsx)(`span`,{className:z.setCardDesc,children:t(`floatNoTargetsHint`)})]})]})]})]}),(0,m.jsxs)(`div`,{className:z.setCell,"data-testid":`billing-card-setting`,children:[(0,m.jsx)(`div`,{className:z.setCardHead,children:(0,m.jsx)(`div`,{className:z.setCardMeta,children:(0,m.jsxs)(`h3`,{className:z.setCardTitle,children:[t(`cardDisplay`),(0,m.jsx)(ra,{label:t(`cardDisplayHint`),t})]})})}),(0,m.jsxs)(`div`,{className:z.ctlCol,children:[(0,m.jsxs)(`div`,{className:z.ctlRow,children:[(0,m.jsx)(`span`,{className:z.ctlLabel,children:t(`cardMetric`)}),(0,m.jsxs)(`div`,{className:z.ctlGroup,"data-testid":`billing-card-metric`,children:[(0,m.jsx)(`button`,{type:`button`,className:y(z.floatModeBtn,j.metric===`money`&&z.floatModeBtnOn),"data-testid":`billing-card-money`,onClick:()=>ne({...j,metric:`money`}),children:t(`cardMetricMoney`)}),(0,m.jsx)(`button`,{type:`button`,className:y(z.floatModeBtn,j.metric===`tokens`&&z.floatModeBtnOn),"data-testid":`billing-card-tokens`,onClick:()=>ne({...j,metric:`tokens`}),children:t(`cardMetricTokens`)})]})]}),(0,m.jsxs)(`div`,{className:z.ctlRow,children:[(0,m.jsx)(`span`,{className:z.ctlLabel,children:t(`cardSpan`)}),(0,m.jsx)(`div`,{className:z.ctlGroup,"data-testid":`billing-card-span`,children:[[`day`,`cardSpanDay`],[`week`,`cardSpanWeek`],[`month`,`cardSpanMonth`]].map(([e,n])=>(0,m.jsx)(`button`,{type:`button`,className:y(z.floatModeBtn,j.span===e&&z.floatModeBtnOn),"data-testid":`billing-card-span-${e}`,"aria-pressed":j.span===e,onClick:()=>ne({...j,span:e}),children:t(n)},e))})]}),(0,m.jsxs)(`div`,{className:z.ctlRow,children:[(0,m.jsx)(`span`,{className:z.ctlLabel,children:t(`cardDeltaBadge`)}),(0,m.jsxs)(`div`,{className:z.ctlGroup,"data-testid":`billing-card-delta`,children:[(0,m.jsx)(`button`,{type:`button`,className:y(z.floatModeBtn,j.showDelta&&z.floatModeBtnOn),"data-testid":`billing-card-delta-show`,"aria-pressed":j.showDelta,onClick:()=>ne({...j,showDelta:!0}),children:t(`cardDeltaShow`)}),(0,m.jsx)(`button`,{type:`button`,className:y(z.floatModeBtn,!j.showDelta&&z.floatModeBtnOn),"data-testid":`billing-card-delta-hide`,"aria-pressed":!j.showDelta,onClick:()=>ne({...j,showDelta:!1}),children:t(`cardDeltaHide`)})]})]})]})]})]})}),(0,m.jsx)(`div`,{hidden:V(da.advanced),id:`settings-advanced`,children:(0,m.jsx)(ca,{userPrices:i,onUserPrices:a,t})}),(0,m.jsx)(`div`,{hidden:V(da.about),id:`settings-about`,children:(0,m.jsx)(Gn,{t,version:e.pluginVersion})}),(0,m.jsxs)(`section`,{hidden:V(da.about),className:z.setCard,"data-testid":`billing-more-works`,children:[(0,m.jsx)(`div`,{className:z.setCardHead,children:(0,m.jsx)(`div`,{className:z.setCardMeta,children:(0,m.jsx)(`h3`,{className:z.setCardTitle,children:t(`moreWorksTitle`)})})}),(0,m.jsxs)(`div`,{className:z.moreWorkList,children:[(0,m.jsxs)(`a`,{className:z.moreWorkRow,href:`https://github.com/kenz1117/dsh-engram`,target:`_blank`,rel:`noreferrer`,"data-testid":`billing-ad-engram`,children:[(0,m.jsx)(`span`,{className:z.moreWorkName,children:t(`adEngramName`)}),(0,m.jsx)(`span`,{className:z.moreWorkDesc,children:t(`adEngramDesc`)})]}),(0,m.jsxs)(`a`,{className:z.moreWorkRow,href:`https://github.com/kenz1117/dsh-ui-rainbowspeak`,target:`_blank`,rel:`noreferrer`,"data-testid":`billing-ad-rainbowspeak`,children:[(0,m.jsx)(`span`,{className:z.moreWorkName,children:t(`adRainbowName`)}),(0,m.jsx)(`span`,{className:z.moreWorkDesc,children:t(`adRainbowDesc`)})]})]})]})]})]})}),P===`trends`&&(0,m.jsxs)(`div`,{className:z.tabPanel,"data-testid":`billing-tab-panel-trends`,children:[(0,m.jsxs)(`section`,{className:z.ubCard,"data-testid":`billing-panel-trend`,children:[(0,m.jsxs)(`div`,{className:z.ubCardHead,children:[(0,m.jsx)(`h3`,{className:z.ubCardTitle,children:t(`trend`)}),b(`billing.dashboard.decor`,{position:`trend`}),(0,m.jsxs)(`span`,{className:z.ubCardControlGroup,children:[(0,m.jsx)(`span`,{className:z.rangeToggle,role:`group`,"aria-label":t(`trend`),children:[7,30].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(z.rangeButton,Ee===e&&z.rangeButtonActive),"aria-pressed":Ee===e,"data-testid":`billing-trend-${e}d`,onClick:()=>{ke(e)},children:t(e===7?`trend7d`:`trend30d`)},e))}),(0,m.jsx)(`span`,{className:z.rangeToggle,role:`group`,"aria-label":t(`trendMetric`),children:[`cost`,`tokens`].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(z.rangeButton,be===e&&z.rangeButtonActive),"aria-pressed":be===e,"data-testid":`billing-trend-metric-${e}`,onClick:()=>{xe(e)},children:t(e===`cost`?`trendMetricCost`:`trendMetricTokens`)},e))})]}),(0,m.jsx)(`span`,{className:z.ubCardSub,children:On})]}),(0,m.jsx)(In,{data:Nn,models:Yn,currency:f,metric:be,t})]}),v.length>0&&(0,m.jsxs)(`section`,{className:z.ubCard,"data-testid":`billing-panel-rounds`,children:[(0,m.jsxs)(`div`,{className:z.ubCardHead,children:[(0,m.jsx)(`h3`,{className:z.ubCardTitle,children:t(`rounds`)}),Xt.length>0&&(0,m.jsxs)(`span`,{className:z.ubTagError,"data-testid":`billing-rounds-flag-count`,children:[Xt.length,` `,t(`anomaly`)]})]}),(0,m.jsx)(`p`,{className:z.ubCardSub,children:t(`roundsHint`).replace(`{count}`,String(v.length))}),(0,m.jsx)(Jn,{rounds:v,flags:Xt,currency:f,t})]}),e.byTier!==void 0&&(()=>{let e=Zt.peak+Zt.offPeak;if(e<=0)return null;let n=Zt.peak/e*100;return(0,m.jsxs)(`section`,{className:z.ubCard,"data-testid":`billing-panel-share`,children:[(0,m.jsxs)(`div`,{className:z.ubCardHead,children:[(0,m.jsx)(`h3`,{className:z.ubCardTitle,children:t(`peakShare`)}),(0,m.jsx)(`span`,{className:z.ubCardSub,children:t(`peakSharePerCall`)})]}),(0,m.jsxs)(`div`,{className:z.shareTrack,"data-testid":`billing-share-track`,children:[(0,m.jsx)(`div`,{className:y(z.shareSeg,z.shareSegPeak),style:{width:`${n}%`}}),(0,m.jsx)(`div`,{className:y(z.shareSeg,z.shareSegOff),style:{width:`${100-n}%`}})]}),(0,m.jsxs)(`div`,{className:z.shareLegend,children:[(0,m.jsxs)(`span`,{className:z.shareItem,children:[(0,m.jsx)(`span`,{className:z.shareDot,style:{background:`var(--ds-blue)`}}),t(`peak`),(0,m.jsxs)(`span`,{className:z.shareValue,"data-testid":`billing-share-peak`,children:[W(Zt.peak),` · `,n.toFixed(1),`%`]})]}),(0,m.jsxs)(`span`,{className:z.shareItem,children:[(0,m.jsx)(`span`,{className:z.shareDot,style:{background:`color-mix(in srgb, var(--ds-blue) 30%, var(--dsb-3))`}}),t(`offPeak`),(0,m.jsxs)(`span`,{className:z.shareValue,"data-testid":`billing-share-offpeak`,children:[W(Zt.offPeak),` · `,(100-n).toFixed(1),`%`]})]})]}),Qt>0&&(0,m.jsx)(`div`,{className:z.staleNotice,"data-testid":`billing-share-savings`,children:t(`offPeakSavings`).replace(`{amount}`,W(Qt))})]})})()]}),P===`providers`&&(0,m.jsxs)(`div`,{className:z.tabPanel,"data-testid":`billing-tab-panel-providers`,children:[Fn.length>0&&(0,m.jsxs)(`section`,{className:z.panel,"data-testid":`billing-panel-relay-quota`,children:[(0,m.jsx)(`div`,{className:z.panelHead,children:(0,m.jsx)(`h3`,{className:z.panelTitle,children:t(`panelRelayQuota`)})}),(0,m.jsx)(`div`,{className:z.providerGroupList,"data-testid":`billing-relay-quotas`,children:Fn.map(e=>(0,m.jsxs)(`div`,{className:z.siteRow,"data-testid":`billing-relay-quota`,children:[(0,m.jsxs)(`span`,{className:z.siteRowName,children:[(0,m.jsx)(`span`,{className:y(z.siteKindTag,Mi[e.kind]),children:ji(e.kind,t)}),(0,m.jsx)(`span`,{className:z.siteRowTitle,children:e.origin})]}),(0,m.jsxs)(`span`,{className:z.siteRowMeta,children:[e.balance!==void 0&&(0,m.jsxs)(`span`,{className:z.siteRowCost,children:[t(`relayBalance`),` `,e.balance.toFixed(2)]}),(e.windows?.length??0)>0?e.windows?.map(e=>{let n=e.remainingPercent<20;return(0,m.jsxs)(`span`,{className:y(z.siteRowCalls,n&&z.siteRowCallsLow),children:[t(`relayWindowUsed`),` `,e.usedPercent,`%`]},e.kind)}):(0,m.jsx)(`span`,{className:z.siteRowCalls,children:t(`relayNoQuota`)})]})]},e.route))})]}),(0,m.jsxs)(`section`,{className:z.panel,"data-testid":`billing-panel-providers`,children:[(0,m.jsxs)(`div`,{className:z.panelHead,children:[(0,m.jsx)(`h3`,{className:z.panelTitle,children:t(`providerBilling`)}),b(`billing.dashboard.decor`,{position:`models`}),(0,m.jsx)(`span`,{className:z.panelHint,children:e.updatedAt===void 0?``:`${t(`lastUpdated`)} ${Fi(e.updatedAt)}`})]}),de&&(0,m.jsx)(`div`,{className:z.staleNotice,"data-testid":`billing-subscriptions-stale`,children:t(`subscriptionsStale`)}),(0,m.jsxs)(`div`,{className:z.providerCtlRow,"data-testid":`billing-provider-controls`,children:[(0,m.jsx)(`button`,{type:`button`,className:z.exportButton,disabled:Ln.length===0,onClick:zn,children:t(Rn?`collapseAll`:`expandAll`)}),(0,m.jsxs)(`span`,{className:z.providerTodayToggle,children:[(0,m.jsx)(`span`,{children:t(`todayOnly`)}),(0,m.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":Tt,"data-testid":`billing-provider-today-toggle`,className:y(z.switch,Tt&&z.switchOn),onClick:Dt,children:(0,m.jsx)(`span`,{className:z.switchKnob})})]})]}),Y.length===0?(0,m.jsxs)(`div`,{className:z.emptyState,"data-testid":`billing-provider-empty`,children:[(0,m.jsxs)(`span`,{className:z.emptyIll,"aria-hidden":`true`,children:[(0,m.jsxs)(`svg`,{viewBox:`0 0 96 64`,fill:`none`,children:[(0,m.jsx)(`line`,{x1:`6`,y1:`58`,x2:`90`,y2:`58`,stroke:`var(--ds-border-strong)`,strokeWidth:`1`}),(0,m.jsx)(`line`,{x1:`6`,y1:`6`,x2:`6`,y2:`58`,stroke:`var(--ds-border-strong)`,strokeWidth:`1`}),(0,m.jsx)(`path`,{d:`M14 50 L28 40 L42 44 L56 26 L70 30 L82 14`,stroke:`var(--ds-border-strong)`,strokeWidth:`1.5`,strokeLinecap:`round`,fill:`none`,strokeDasharray:`3 3`})]}),(0,m.jsx)(`span`,{className:z.emptyIllDot})]}),(0,m.jsx)(`span`,{className:z.emptyTitle,children:t(Tt?`todayNoConsumption`:`noData`)}),(0,m.jsx)(`span`,{className:z.emptyDesc,children:t(`emptyHint`)})]}):(0,m.jsx)(`div`,{className:z.providerGroupList,"data-testid":`billing-provider-groups`,children:Y.map(e=>{let n=e.models.length>0||e.subscriptions.length>0,r=n&&St.has(e.id);return(0,m.jsxs)(`div`,{className:z.providerGroup,"data-testid":`billing-provider-group`,children:[(0,m.jsxs)(`div`,{className:y(z.providerGroupHead,n&&z.providerGroupCollapsible),"data-testid":`billing-provider-group-head`,"aria-expanded":n?r:void 0,role:n?`button`:void 0,tabIndex:n?0:void 0,onClick:n?()=>{wt(e.id)}:void 0,onKeyDown:n?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),wt(e.id))}:void 0,children:[(0,m.jsxs)(`span`,{className:z.providerGroupTitle,children:[(0,m.jsx)(`span`,{className:y(z.healthDot,e.dot),role:`img`,"aria-label":ia(e.dot,t),title:ia(e.dot,t)}),(()=>{let n=Bt(e.name),r=e.channelKind===`direct`?br(n):void 0,i=e.channelKind===`direct`?t(`directTag`):e.channelKind===`site`?t(`relayTag`):e.channelKind===`unknown`?t(`unknownTag`):void 0;return(0,m.jsxs)(m.Fragment,{children:[i!==void 0&&(0,m.jsx)(`span`,{className:y(z.kindBadge,e.channelKind===`site`&&z.kindBadgeRelay,e.channelKind===`unknown`&&z.kindBadgeUnknown),"data-testid":`billing-kind-badge`,children:i}),e.channelKind!==`unknown`&&(0,m.jsx)(`span`,{className:z.providerGroupName,children:r??n})]})})(),e.subscriptions.length>0&&(0,m.jsxs)(`span`,{className:z.providerGroupBadge,"data-testid":`billing-provider-sub-count`,children:[e.subscriptions.length,` `,t(`planCountUnit`)]})]}),(0,m.jsxs)(`span`,{className:z.providerGroupMeta,children:[(0,m.jsxs)(`span`,{className:z.providerGroupCost,"data-testid":`billing-provider-cost`,children:[(0,m.jsx)(`span`,{className:z.providerGroupCostLabel,children:t(`cost`)}),e.channelKind===`unknown`?(0,m.jsx)(`span`,{className:z.na,children:`—`}):(0,m.jsx)(`span`,{className:z.providerGroupCostValue,children:W(Ni(e))})]}),!tn(e)&&e.balance!==void 0?(0,m.jsxs)(`span`,{className:z.providerGroupBalance,"data-testid":`billing-provider-balance`,children:[(0,m.jsx)(`span`,{className:z.providerGroupBalanceLabel,children:t(`balance`)}),rn(e.balance)]}):(0,m.jsx)(`span`,{className:z.providerGroupBalance,"aria-hidden":`true`}),gi(e.name)===void 0?(0,m.jsx)(`span`,{className:z.providerGroupRecharge,"aria-hidden":`true`}):(0,m.jsx)(`a`,{className:z.providerGroupRecharge,"data-testid":`billing-group-recharge`,href:gi(e.name),target:`_blank`,rel:`noreferrer`,title:t(`rechargeHint`),"aria-label":`${Bt(e.name)} ${t(`recharge`)}`,onClick:e=>{e.stopPropagation()},children:t(`recharge`)})]})]}),e.models.length>0&&(0,m.jsx)(`div`,{className:z.providerStatRow,"data-testid":`billing-provider-stat-row`,children:(()=>{let n=e.models.reduce((e,t)=>({calls:e.calls+t.calls,input:e.input+t.input,output:e.output+t.output}),{calls:0,input:0,output:0}),r=n.input>0?e.models.reduce((e,t)=>e+t.cacheHitRate,0)/e.models.length:0;return[{lbl:t(`calls`),val:n.calls.toLocaleString(),sub:``},{lbl:t(`inputTokens`),val:K(n.input),sub:r>0?`${t(`cacheHitRate`)} ${r.toFixed(0)}%`:``},{lbl:t(`outputTokens`),val:K(n.output),sub:``},{lbl:t(`cost`),val:W(Ni(e)),sub:e.models.length===1?``:`${e.models.length} ${t(`models`)}`}].map((e,t)=>(0,m.jsxs)(`div`,{className:z.providerStatCell,children:[(0,m.jsx)(`div`,{className:z.providerStatLbl,children:e.lbl}),(0,m.jsx)(`div`,{className:z.providerStatVal,children:e.val}),e.sub!==``&&(0,m.jsx)(`div`,{className:z.providerStatSub,children:e.sub})]},t))})()}),r&&(0,m.jsxs)(m.Fragment,{children:[e.channelKind===`unknown`&&(0,m.jsx)(`p`,{className:z.unknownHint,"data-testid":`billing-unknown-hint`,children:t(`unknownChannelHint`)}),e.models.length>0&&(0,m.jsx)(`div`,{className:z.tableScroll,"data-testid":`billing-table-scroll`,children:(0,m.jsxs)(`table`,{className:z.modelTable,children:[Bn,(0,m.jsx)(`tbody`,{children:e.models.map(e=>(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`td`,{children:Vn(e)}),(0,m.jsx)(`td`,{className:z.numCol,children:e.calls.toLocaleString()}),(0,m.jsx)(`td`,{className:z.numCol,children:K(e.input)}),(0,m.jsx)(`td`,{className:z.numCol,children:K(e.output)}),(0,m.jsx)(`td`,{className:z.numCol,children:hn(e.cacheHitRate)}),(0,m.jsx)(`td`,{className:z.numCol,children:e.plan?(0,m.jsxs)(`span`,{className:z.planTag,children:[e.estimated>0?(0,m.jsxs)(`span`,{children:[`≈`,W(e.estimated)]}):null,(0,m.jsx)(`span`,{className:z.planTagBadge,"data-testid":`billing-plan-badge`,children:t(`subscriptionTag`)})]}):e.actual===void 0?e.estimated>0?(0,m.jsxs)(`span`,{title:t(`cellEstimateHint`),children:[`≈`,W(e.estimated)]}):(0,m.jsx)(`span`,{className:z.na,children:`—`}):(()=>{let t=e.officialCost,n=e.actual-t;return t>0&&n>0?(0,m.jsxs)(`span`,{className:z.bucketCost,children:[(0,m.jsx)(`span`,{className:z.bucketOfficial,children:W(t)}),(0,m.jsx)(`span`,{className:z.bucketSep,children:`/`}),(0,m.jsx)(`span`,{className:z.bucketThird,children:W(n)})]}):W(e.actual)})()})]},e.key))})]})}),e.subscriptions.length>0&&(0,m.jsx)(`div`,{className:z.subscriptionGrid,"data-testid":`billing-subscriptions-grid`,children:e.subscriptions.map(e=>{let n=ki(e.status,t);return(0,m.jsxs)(`div`,{className:y(z.subscriptionCard,z.subscriptionCardUpgraded),"data-testid":`billing-subscription-card`,children:[(0,m.jsxs)(`div`,{className:z.subscriptionHead,children:[(0,m.jsx)(`span`,{className:z.subscriptionName,children:Bt(e.displayName)}),e.planType===`code`&&(()=>{let n=nt(e.provider),r=n===void 0?void 0:t(`subscriptionFeePerMonth`).replace(`{amount}`,n.currency===`USD`?`$${n.amount}`:`¥${n.amount}`);return(0,m.jsxs)(`span`,{className:z.subscriptionPlan,"data-kind":`code`,children:[r??(e.subscriptionAmount!==void 0&&e.subscriptionAmount>0?t(`subscriptionFeePerMonth`).replace(`{amount}`,W(e.subscriptionAmount)):t(`planTypeCode`)),n?.label!==void 0&&(0,m.jsx)(`span`,{className:z.subscriptionTier,"data-testid":`billing-tier-${e.provider}`,children:n.label}),n!==void 0&&(0,m.jsx)(`span`,{className:z.subscriptionAuto,"data-testid":`billing-auto-${e.provider}`,children:t(`subscriptionAutoDetect`)})]})})(),e.planType===`token`&&(0,m.jsx)(`span`,{className:z.subscriptionPlan,"data-kind":`token`,children:t(`planTypeToken`)}),e.plan!==void 0&&(0,m.jsx)(`span`,{className:z.subscriptionPlan,children:e.plan})]}),n!==``&&(0,m.jsx)(`div`,{className:z.subscriptionStatus,children:n}),e.windows.length===0&&n===``&&(0,m.jsx)(`div`,{className:z.subscriptionStatus,children:t(`subscriptionNoApi`)}),e.windows.map(e=>(0,m.jsx)(na,{window:e,t},e.kind))]},e.provider)})})]})]},e.id)})})]}),(0,m.jsxs)(`div`,{className:z.exportBar,"data-testid":`billing-export-bar`,role:`group`,"aria-label":t(`export`),children:[(0,m.jsx)(`span`,{className:z.exportLabel,children:t(`export`)}),(0,m.jsx)(`button`,{type:`button`,className:z.exportButton,"data-testid":`billing-export-day`,onClick:()=>{wn(Cn(`usage-daily`,`csv`,Object.keys(N)),yn(N),`text/csv`)},children:t(`exportCsvDay`)}),e.bySession!==void 0&&(0,m.jsx)(`button`,{type:`button`,className:z.exportButton,"data-testid":`billing-export-sessions`,onClick:()=>{wn(Cn(`usage-sessions`,`csv`,Object.keys(N)),Sn(e.bySession??[]),`text/csv`)},children:t(`exportCsvSession`)}),e.bySite!==void 0&&(0,m.jsx)(`button`,{type:`button`,className:z.exportButton,"data-testid":`billing-export-sites`,onClick:()=>{wn(Cn(`usage-sites`,`csv`,Object.keys(N)),bn(e.bySite??{}),`text/csv`)},children:t(`exportCsvSite`)}),(0,m.jsx)(`button`,{type:`button`,className:z.exportButton,"data-testid":`billing-export-json`,onClick:()=>{wn(Cn(`usage-stats`,`json`,Object.keys(N)),JSON.stringify(e,null,2),`application/json`)},children:t(`exportJson`)})]}),e.bySession!==void 0&&(0,m.jsxs)(`section`,{className:z.ubCard,"data-testid":`billing-panel-sessions`,children:[(0,m.jsxs)(`div`,{className:z.ubCardHead,children:[(0,m.jsx)(`h3`,{className:z.ubCardTitle,children:t(`sessions`)}),(0,m.jsx)(`span`,{className:z.ubCardSub,children:e.bySession.length>20?t(`sessionOverflow`).replace(`{limit}`,`20`).replace(`{total}`,String(e.bySession.length)):`${e.bySession.length}`}),e.bySession.length>0&&(0,m.jsx)(`button`,{type:`button`,className:z.exportButton,"data-testid":`billing-sessions-view-all`,onClick:()=>{ft(!0)},children:t(`sessionsViewAll`).replace(`{count}`,String(e.bySession.length))})]}),(e.staleLedgerSessions??0)>0&&(0,m.jsx)(`div`,{className:z.staleNotice,"data-testid":`billing-sessions-stale`,children:t(`staleLedgerNotice`).replace(`{count}`,String(e.staleLedgerSessions))}),(0,m.jsxs)(`div`,{className:z.ubTablewrap,"data-testid":`billing-sessions-table`,children:[_e!==void 0&&(0,m.jsx)(`div`,{className:z.staleNotice,"data-testid":`billing-session-nav-notice`,role:`note`,children:_e}),(0,m.jsxs)(`table`,{className:z.ubTable,children:[(0,m.jsx)(`thead`,{children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{children:t(`sessionTitle`)}),(0,m.jsx)(`th`,{className:z.numCol,children:t(`calls`)}),(0,m.jsx)(`th`,{className:z.numCol,children:t(`actual`)}),(0,m.jsx)(`th`,{className:z.numCol,children:t(`lastActive`)})]})}),(0,m.jsxs)(`tbody`,{children:[gt.length===0&&(0,m.jsx)(`tr`,{children:(0,m.jsx)(`td`,{colSpan:4,className:z.emptyRow,children:t(`noData`)})}),gt.slice(0,20).map(e=>{let n=e.children!==void 0||e.subs!==void 0,r=n&&lt.has(e.id),i=Pi(e);return(0,m.jsxs)(d.Fragment,{children:[(0,m.jsxs)(`tr`,{className:n?z.sessionGroupRow:void 0,"aria-expanded":n?r:void 0,tabIndex:n?0:void 0,onClick:n?()=>{ht(e.id)}:void 0,onKeyDown:n?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),ht(e.id))}:void 0,children:[(0,m.jsxs)(`td`,{children:[(0,m.jsx)(`span`,{className:z.modelName,children:(0,m.jsxs)(`button`,{type:`button`,className:z.sessionLink,"data-testid":`billing-session-open`,title:t(`sessionOpen`),onClick:t=>{t.stopPropagation(),ye(e.id)},children:[e.title??`${t(`sessionUntitled`)} · ${e.id.slice(0,8)}`,(e.mergedCount??1)>1?` ×${e.mergedCount}`:``]})}),e.stale===!0&&(0,m.jsx)(`span`,{className:y(z.ubTag,z.ubTagNeutral),"data-testid":`billing-session-stale`,children:t(`sessionStaleBadge`)}),(i.calls>0||i.cost>0)&&(0,m.jsx)(`span`,{className:y(z.ubTag,z.ubTagNeutral),"data-testid":`billing-session-sub`,children:i.cost>0?t(`sessionSubCost`).replace(`{cost}`,W(i.cost)):t(`sessionSubCalls`).replace(`{calls}`,i.calls.toLocaleString())})]}),_t(e)]}),r&&e.children?.map(e=>(0,m.jsxs)(`tr`,{className:z.sessionChildRow,children:[(0,m.jsx)(`td`,{children:(0,m.jsx)(`button`,{type:`button`,className:z.sessionLink,"data-testid":`billing-session-open`,title:t(`sessionOpen`),onClick:t=>{t.stopPropagation(),ye(e.id)},children:(0,m.jsx)(`span`,{className:z.modelProvider,children:e.id.slice(0,8)})})}),_t(e)]},e.id)),r&&e.subs?.map(e=>vt(e,0))]},e.id)})]})]})]}),dt&&(0,m.jsxs)(`div`,{className:z.sessionViewer,"data-testid":`billing-session-viewer`,children:[(0,m.jsxs)(`div`,{className:z.sessionViewerHead,children:[(0,m.jsx)(`h3`,{className:z.sessionViewerTitle,children:t(`sessions`)}),(0,m.jsx)(`input`,{className:z.ubSearch,type:`search`,value:pt,placeholder:t(`sessionViewerSearch`),"aria-label":t(`sessionViewerSearch`),"data-testid":`billing-session-viewer-search`,onChange:e=>{mt(e.target.value)}}),(0,m.jsx)(`button`,{type:`button`,className:z.exportButton,"data-testid":`billing-session-viewer-close`,onClick:()=>{ft(!1),mt(``)},children:t(`close`)})]}),(0,m.jsx)(`div`,{className:z.sessionViewerList,"data-testid":`billing-session-viewer-list`,children:(0,m.jsxs)(`table`,{className:z.ubTable,children:[(0,m.jsx)(`thead`,{children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{children:t(`sessionTitle`)}),(0,m.jsx)(`th`,{className:z.numCol,children:t(`calls`)}),(0,m.jsx)(`th`,{className:z.numCol,children:t(`actual`)}),(0,m.jsx)(`th`,{className:z.numCol,children:t(`lastActive`)})]})}),(0,m.jsxs)(`tbody`,{children:[yt.length===0&&(0,m.jsx)(`tr`,{children:(0,m.jsx)(`td`,{colSpan:4,className:z.emptyRow,children:t(`noData`)})}),yt.map(e=>(0,m.jsxs)(`tr`,{children:[(0,m.jsxs)(`td`,{children:[(0,m.jsxs)(`span`,{className:z.modelName,children:[e.title??`${t(`sessionUntitled`)} · ${e.id.slice(0,8)}`,(e.mergedCount??1)>1?` ×${e.mergedCount}`:``]}),e.cwd!==void 0&&(0,m.jsx)(`span`,{className:z.modelProvider,children:ua(e.cwd)}),e.stale===!0&&(0,m.jsx)(`span`,{className:y(z.ubTag,z.ubTagNeutral),children:t(`sessionStaleBadge`)})]}),(0,m.jsx)(`td`,{className:z.numCol,children:e.calls.toLocaleString()}),(0,m.jsx)(`td`,{className:z.numCol,children:W(e.cost)}),(0,m.jsx)(`td`,{className:z.numCol,children:e.lastActive>0?`${G(e.lastActive)} ${Fi(e.lastActive)}`:`—`})]},e.id))]})]})})]})]})]}),P===`token`&&(0,m.jsxs)(`div`,{className:z.tabPanel,"data-testid":`billing-tab-panel-token`,children:[(0,m.jsx)(An,{stats:e,trendDays:Ee,onTrendDays:ke,models:Yn,money:W,t}),e.perf!==void 0&&(0,m.jsxs)(`section`,{className:z.panel,"data-testid":`billing-panel-perf`,children:[(0,m.jsxs)(`div`,{className:z.panelHead,children:[(0,m.jsx)(`h3`,{className:z.panelTitle,children:t(`perfTitle`)}),(0,m.jsx)(`span`,{className:z.panelHint,children:t(`perfHint`)})]}),(0,m.jsx)(Hn,{perf:e.perf,models:Yn,t})]})]}),P===`pricing`&&(0,m.jsxs)(`div`,{className:z.tabPanel,"data-testid":`billing-tab-panel-pricing`,children:[(0,m.jsxs)(`div`,{className:z.ubAlert,role:`note`,children:[(0,m.jsxs)(`div`,{className:z.ubAlertLeft,children:[(0,m.jsxs)(`span`,{className:z.ubRate,"data-testid":`billing-rate`,children:[t(`todayRate`),` 1 USD = `,fn(jt.rate)]}),(0,m.jsx)(`span`,{className:y(z.ubTag,jt.live?z.ubTagSuccess:z.ubTagNeutral),children:jt.live?t(`rateLive`):t(`rateBuiltin`)}),Lt>0&&(0,m.jsxs)(`span`,{className:z.ubTag,"data-testid":`billing-pricing-synced`,children:[t(`pricingSyncedAt`),` `,new Date(Lt).toLocaleTimeString(zt===`zh`?`zh-CN`:`en-US`,{hour:`2-digit`,minute:`2-digit`})]}),(0,m.jsx)(`button`,{type:`button`,className:z.heatmapRangeButton,"data-testid":`billing-pricing-sync`,disabled:Mt,onClick:It,children:t(Mt?`pricingSyncing`:`pricingSyncNow`)})]}),(0,m.jsx)(`p`,{className:z.ubAlertNote,children:t(`pricingTip`)})]}),(0,m.jsxs)(`section`,{className:z.ubCard,"data-testid":`billing-panel-pricing`,children:[(0,m.jsxs)(`div`,{className:z.ubCardHead,children:[(0,m.jsx)(`h3`,{className:z.ubCardTitle,children:t(`pricing`)}),(0,m.jsx)(`span`,{className:z.ubCardSub,children:t(`pricingUnit`)}),(0,m.jsx)(`input`,{className:z.ubSearch,type:`search`,value:Vt,placeholder:t(`pricingSearch`),"aria-label":t(`pricingSearch`),"data-testid":`billing-pricing-search`,onChange:e=>{Ht(e.target.value)}})]}),(0,m.jsx)(`div`,{className:z.ubTablewrap,children:(0,m.jsxs)(`table`,{className:z.ubTable,children:[(0,m.jsx)(`thead`,{children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{children:t(`thModel`)}),(0,m.jsx)(`th`,{className:z.numCol,children:t(`thInputMiss`)}),(0,m.jsx)(`th`,{className:z.numCol,children:t(`thInputHit`)}),(0,m.jsx)(`th`,{className:z.numCol,children:t(`output`)}),(0,m.jsx)(`th`,{className:z.numCol,colSpan:2,children:t(`band`)})]})}),(0,m.jsx)(`tbody`,{children:dr(sn(),Vt).map(e=>{let n=e.price.input>0||e.price.output>0;return(0,m.jsxs)(d.Fragment,{children:[(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`td`,{children:(0,m.jsxs)(`span`,{className:z.ubModel,children:[(()=>{let n=cr(Ft(Gt,Pt(e.key,qt)),Jt);if(n===null)return null;let r=Ut.includes(e.key),i=`${e.name} · ${t(n===`peak`?`peak`:`offPeak`)} · ${t(`bandPinHint`)}`;return(0,m.jsx)(`button`,{type:`button`,className:y(z.bandDot,z[n],r&&z.bandDotOn),"data-testid":`billing-band-dot`,"aria-pressed":r,"aria-label":i,title:i,onClick:()=>{Wt(I(e.key)),window.dispatchEvent(new CustomEvent(`dsh.ui-usage-billing.pinned-pref`))}})})(),(0,m.jsxs)(`span`,{className:z.ubModelName,children:[e.name,e.uncatalogued&&(0,m.jsx)(`span`,{className:z.ubTagAlert,"data-testid":`billing-price-uncatalogued`,children:t(`uncatalogued`)}),e.promo!==void 0&&an(e.promo,Date.now())&&(0,m.jsx)(p.Tooltip,{label:[e.promo.note,e.promo.endsAtMs===void 0?t(`promoOpenEnded`):t(`promoUntil`,{date:new Date(e.promo.endsAtMs).toLocaleDateString()})].filter(Boolean).join(` · `),side:`top`,maxWidth:280,children:(0,m.jsx)(`span`,{className:z.ubTagPromo,"data-testid":`billing-price-promo`,children:t(`promoBadge`)})})]})]})}),(0,m.jsx)(`td`,{className:z.numCol,children:n?Yt(e.price.input,e.price.currency):(0,m.jsx)(`span`,{className:z.na,children:`—`})}),(0,m.jsx)(`td`,{className:z.numCol,children:n?Yt(e.price.cacheHit,e.price.currency):(0,m.jsx)(`span`,{className:z.na,children:`—`})}),(0,m.jsx)(`td`,{className:z.numCol,children:n?Yt(e.price.output,e.price.currency):(0,m.jsx)(`span`,{className:z.na,children:`—`})}),n&&e.price.offPeak!==void 0&&e.peakHours!==void 0?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`td`,{className:z.numCol,children:(0,m.jsxs)(`span`,{className:z.ubChipPeak,children:[(0,m.jsx)(`span`,{className:z.ubChipLabel,children:e.tierSemantics===`latency`?t(`ubStd`):t(`ubPeak`)}),(0,m.jsxs)(`span`,{children:[Yt(e.price.input,e.price.currency),`/`,Yt(e.price.output,e.price.currency)]})]})}),(0,m.jsx)(`td`,{className:z.numCol,children:(0,m.jsxs)(`span`,{className:z.ubChipOff,children:[(0,m.jsx)(`span`,{className:z.ubChipLabel,children:e.tierSemantics===`latency`?`Flex`:t(`ubOff`)}),(0,m.jsxs)(`span`,{children:[Yt(e.price.offPeak.input,e.price.currency),` / `,Yt(e.price.offPeak.output,e.price.currency)]})]})})]}):(0,m.jsx)(`td`,{className:z.numCol,colSpan:2,children:n?(0,m.jsx)(`span`,{className:z.flatTag,children:t(`flat`)}):(0,m.jsx)(`span`,{className:z.na,children:`—`})})]}),(e.extraRows??[]).map(t=>(0,m.jsxs)(`tr`,{className:z.ubExtraRow,children:[(0,m.jsxs)(`td`,{children:[(0,m.jsx)(`span`,{className:z.ubExtraName,children:ur(t.label,zt)}),t.note!==void 0&&(0,m.jsx)(`span`,{className:z.ubExtraNote,children:ur(t.note,zt)})]}),(0,m.jsx)(`td`,{className:z.numCol,children:t.input===void 0?(0,m.jsx)(`span`,{className:z.na,children:`—`}):Yt(t.input,e.price.currency)}),(0,m.jsx)(`td`,{className:z.numCol,children:(0,m.jsx)(`span`,{className:z.na,children:`—`})}),(0,m.jsx)(`td`,{className:z.numCol,children:t.output===void 0?(0,m.jsx)(`span`,{className:z.na,children:`—`}):Yt(t.output,e.price.currency)}),(0,m.jsx)(`td`,{className:z.numCol,colSpan:2,children:(0,m.jsx)(`span`,{className:z.na,children:`—`})})]},`${e.key}:${t.label}`))]},e.key)})})]})})]}),(0,m.jsxs)(`section`,{className:z.ubCard,children:[(0,m.jsx)(`div`,{className:z.ubCardHead,children:(0,m.jsx)(`h3`,{className:z.ubCardTitle,children:t(`pricingNotes`)})}),(0,m.jsxs)(`ul`,{className:z.ubNotes,children:[(0,m.jsxs)(`li`,{className:z.ubNotesItem,children:[(0,m.jsx)(`span`,{className:z.ubNotesTerm,children:t(`cacheHit`)}),(0,m.jsx)(`span`,{className:z.ubNotesDesc,children:t(`noteCache`)})]}),(0,m.jsxs)(`li`,{className:z.ubNotesItem,children:[(0,m.jsx)(`span`,{className:z.ubNotesTerm,children:t(`peakBand`)}),(0,m.jsx)(`span`,{className:z.ubNotesDesc,children:t(`noteBand`)})]}),(0,m.jsxs)(`li`,{className:z.ubNotesItem,children:[(0,m.jsx)(`span`,{className:z.ubNotesTerm,children:t(`pricingSource`)}),(0,m.jsx)(`span`,{className:z.ubNotesDesc,children:t(`noteSource`)})]})]})]})]}),!r&&b(`billing.dashboard.decor`,{position:`footer`})]}),!r&&(0,m.jsxs)(`footer`,{className:z.modalFooter,"data-testid":`billing-footer`,children:[(0,m.jsx)(`span`,{children:t(`footer`)}),(0,m.jsx)(`span`,{children:t(`footerCredit`).replace(`{version}`,e.pluginVersion===void 0?`—`:`v${e.pluginVersion}`)})]})]});return r?Qn:(0,m.jsx)(p.Modal,{open:!0,onClose:n,title:t(`title`),headless:!0,className:y(z.dashboardModal,`dsh-billing-modal`),children:Qn})}function ua(e){return e.split(/[\\/]/).filter(Boolean).at(-1)??`—`}let da={display:[`显示`,`密度`,`动效`,`紧凑`,`舒适`,`克制`,`丰富`,`display`,`density`,`motion`,`compact`,`comfortable`],budget:[`预算`,`金额`,`本月`,`花费`,`进度`,`budget`,`amount`,`spend`,`progress`],alert:[`峰谷`,`峰`,`谷`,`提醒`,`通知`,`预览`,`切换`,`peak`,`off-peak`,`alert`,`notify`,`preview`],toggles:[`usage_stats`,`工具`,`即时代费`,`胶囊`,`中转站`,`站点`,`隐藏`,`relay`,`site`,`live`,`cost`,`hide`],displayExtra:[`悬浮`,`订阅`,`计费卡`,`指标`,`环比`,`主数字`,`侧栏`,`入口`,`隐藏`,`float`,`subscription`,`card`,`metric`,`delta`,`sidebar`,`trigger`,`hidden`],advanced:[`自定义`,`单价`,`价格`,`低谷`,`custom`,`price`],about:[`关于`,`版本`,`作者`,`许可`,`仓库`,`about`,`version`,`author`,`license`,`repo`]};function fa(e){return Object.values(da).every(t=>Di(e,t))}let pa=[`below`,`above`,`toolbar`];function ma({liveCostPrefs:e,onLiveCostPrefs:t,t:n}){let[r,i]=(0,d.useState)(!1),a={below:n(`liveCostBarPosBelow`),above:n(`liveCostBarPosAbove`),toolbar:n(`liveCostBarPosToolbar`)},o=pa.map(e=>({id:e,label:a[e]}));return(0,m.jsx)(p.Menu,{open:r,align:`end`,portal:!0,compact:!0,items:o,selectedId:e.position,onSelect:n=>{i(!1);let r=pa.find(e=>e===n);r!==void 0&&t({...e,position:r})},onClose:()=>{i(!1)},anchor:(0,m.jsxs)(`button`,{type:`button`,className:z.rdoSelect,"data-testid":`billing-livecost-position-select`,"aria-haspopup":`menu`,"aria-expanded":r,onClick:()=>{i(!r)},children:[(0,m.jsx)(`span`,{children:a[e.position]}),(0,m.jsx)(`span`,{className:y(z.rdoChevron,r&&z.rdoChevronOpen),"aria-hidden":!0,children:Rr?(0,m.jsx)(Rr,{}):null})]})})}function ha(e){let{t,checkModels:n,publishCosts:r,registerOpen:i,navigateToSession:a,renderSlot:o,useStore:s,actions:c,embeddedSettings:l=!1}=e,[u,f]=(0,d.useState)(jr),[p,h]=(0,d.useState)(Nr),[g,_]=(0,d.useState)([]),[v,y]=(0,d.useState)(void 0),[b,x]=(0,d.useState)(!1),[S,C]=(0,d.useState)([]),[w,T]=(0,d.useState)(!1),[E,O]=(0,d.useState)([]),[te,M]=(0,d.useState)(()=>Se()),[ie,ae]=(0,d.useState)(()=>Me()),oe=(0,d.useCallback)(e=>{ae(e),Ne(e),window.dispatchEvent(new CustomEvent(`dsh.ui-usage-billing.language-pref`))},[]),se=(0,d.useCallback)(e=>{M(e),Ce(e),window.dispatchEvent(new CustomEvent(xe))},[]),[ce,le]=(0,d.useState)(()=>ee()),ue=(0,d.useCallback)(e=>{le(e),D(e)},[]),[de,fe]=(0,d.useState)(()=>pe()),he=(0,d.useCallback)(e=>{fe(e),me(e)},[]),[ge,be]=(0,d.useState)(()=>ve()),N=(0,d.useCallback)(e=>{be(e),ye(e),window.dispatchEvent(new CustomEvent(_e))},[]),[P,we]=(0,d.useState)(()=>A());(0,d.useEffect)(()=>ne(()=>{we(A())}),[]);let Te=e.recoveryEntryAvailable,Ee=(0,d.useMemo)(()=>({...P,mode:re(P.mode,Te)}),[P,Te]),De=(0,d.useCallback)(e=>{let t={...e,mode:re(e.mode,Te)};we(t),j(t),window.dispatchEvent(new CustomEvent(k))},[Te]),[Oe,ke]=(0,d.useState)(()=>{let e=Fe();return dt(e),e}),Ae=(0,d.useCallback)(e=>{ke(e),dt(e),Ie(e)},[]),F=(0,d.useMemo)(()=>_i(u),[u,Oe]),je=ie,I=(0,d.useCallback)((e,n)=>{let r=(je===`en`?$e:V)[e]??t(e);if(n===void 0)return r;let i=r;for(let[e,t]of Object.entries(n))i=i.replaceAll(`{${e}}`,String(t));return i},[je,t]),[Pe,Le]=(0,d.useState)(!1),Re=(0,d.useCallback)(()=>{Le(!1)},[]),ze=(0,d.useRef)(!1),L=(0,d.useCallback)((e=!1)=>{ze.current&&!e||(ze.current=!0,Promise.all([Ii().then(e=>{e!==null&&f(e)}),Li().then(({balances:e,reconcile:t,stale:n})=>{e.length>0&&_(e),y(t),x(n===!0)}),Ri().then(({quotas:e,stale:t})=>{e.length>0?(C(e),T(t===!0)):T(!1)}).catch(()=>{T(!0)}),zi().then(e=>{O(e)}).catch(()=>{})]).catch(()=>{}).finally(()=>{ze.current=!1}))},[]),Be=(0,d.useCallback)(()=>{L(!0),Wi(),Le(!0)},[L]);(0,d.useEffect)(()=>{L(),Wi()},[L]);let[Ve,He]=(0,d.useState)(()=>typeof document>`u`||!document.hidden);(0,d.useEffect)(()=>{if(typeof document>`u`)return;let e=()=>{He(!document.hidden),document.hidden||(L(!0),Wi())};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}},[L]),(0,d.useEffect)(()=>{if(!Ve)return;let e=setInterval(()=>{L(),Wi()},Pe?Ar:3e5);return()=>{clearInterval(e)}},[L,Pe,Ve]),(0,d.useEffect)(()=>{let e=!0;return n().then(t=>{e&&(h(t),vt(t.catalog??[]))}),()=>{e=!1}},[n]);let R=G(),Ue=Object.entries(F.byDay).filter(([e])=>e.startsWith(R.slice(0,7))).reduce((e,[,t])=>e+t.cost,0),We=F.byDay[R]?.cost??0,Ge=new Date;Ge.setDate(Ge.getDate()-1);let Ke=`${Ge.getFullYear()}-${String(Ge.getMonth()+1).padStart(2,`0`)}-${String(Ge.getDate()).padStart(2,`0`)}`,qe=F.byDay[Ke]?.cost??0,Je=qe>0?(We-qe)/qe*100:0,Ye=Kr(F.byDay,R),Xe=(0,d.useMemo)(()=>Gr(F.byDay).map(e=>{let t=F.byDay[e.date];return{date:e.date,cost:e.cost,tokens:t===void 0?0:Wr(t)}}),[F.byDay]),Ze=Object.entries(F.byDay).filter(([e])=>e.startsWith(R.slice(0,7))).reduce((e,[,t])=>e+Wr(t),0),Qe=(()=>{let e=F.byDay[R];return e===void 0?0:Wr(e)})(),z=Kr(F.byDay,R,Wr),B=s(e=>e.enabled),et=s(e=>e.amount),tt=s(e=>e.tierAlertDays),H=s(e=>e.lastTierSwitchAt),[nt,rt]=(0,d.useState)(()=>Tr()),[U,it]=(0,d.useState)(null),[at,ot]=(0,d.useState)(null),[st,ct]=(0,d.useState)(0),[lt,ut]=(0,d.useState)(!1);(0,d.useEffect)(()=>{if(!nt.enabled){ct(0),ut(!1);return}let e=!1,t=!1;ut(!1);let n=()=>{t||(t=!0,Ji().then(t=>{e||ct(t.supported?t.queuedCount:0)}).catch(()=>{e||ct(0)}).finally(()=>{t=!1,e||ut(!0)}))};n();let r=setInterval(n,Ar);return()=>{e=!0,clearInterval(r)}},[nt.enabled]),(0,d.useEffect)(()=>{it(e=>wr(e,st))},[st]);let[ft,pt]=(0,d.useState)(()=>Date.now());(0,d.useEffect)(()=>{if(!nt.enabled)return;let e=setInterval(()=>pt(Date.now()),Ar);return()=>{clearInterval(e)}},[nt.enabled]);let mt=(0,d.useCallback)(e=>{rt(e),Er(e)},[]),ht=S.some(e=>e.displayName===`Z.ai Coding Plan`&&e.status===`ok`),gt=Pt(u.byTurn?.[0]?.model,ht),_t=(0,d.useCallback)(()=>{ot({entering:wt(Date.now())===`peak`?`offPeak`:`peak`,atMs:Date.now()+18e4,channel:gt})},[gt]),yt=et>0?et:u.budget??0,bt=B&&yt>0?Ue/yt>=1?`over`:Ue/yt>=.8?`warn`:`none`:`none`,St=(0,d.useCallback)(()=>{let e=!B;c.setEnabled(e),e&&typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission()},[c,B]);(0,d.useEffect)(()=>{if(!B||yt<=0)return;let e=Ue/yt*100,t=kr.filter(t=>e>=t&&tt?.[String(t)]!==R);if(t.length===0)return;let n=t[t.length-1]??100;if(c.markTierAlerted(t,R),!yi())return;let r=I(`budgetTierBody`).replace(`{cost}`,fn(Ue)).replace(`{budget}`,fn(yt)).replace(`{pct}`,String(n));bi(`budget:${n}:${R}`,()=>{new Notification(I(`budget`),{body:r})})},[B,yt,Ue,tt,R,c,I]),(0,d.useEffect)(()=>{if(nt.enabled&&!lt)return;let e=Cr(Dr(ft,nt,H,gt),st>0?Dr(ft,nt,H,`deepseek-metered`):null,st);if(e===null||(c.markTierSwitchAlerted(e.atMs),it(e),!nt.webNotify||!yi()))return;let t=Math.max(1,Math.round((e.atMs-ft)/6e4)),n=I(e.entering===`peak`?`peakAlertTitlePeak`:`peakAlertTitleOff`),r=I(e.channel===`zhipu-coding-plan`?e.entering===`peak`?`tierAlertEnterPeakZhipu`:`tierAlertEnterOffZhipu`:e.entering===`peak`?`tierAlertEnterPeak`:`tierAlertEnterOff`).replace(`{minutes}`,String(t)),i=e.queueCount===void 0?``:` ${I(e.entering===`peak`?`peakAlertQueuePeak`:`peakAlertQueueOff`,{count:e.queueCount})}`;bi(`peak:${e.atMs}`,()=>{new Notification(n,{body:`${r}${i}`})})},[ft,H,nt,gt,st,lt,c,I]);let Ct=s(e=>e.lastBalanceAlertDay),Tt=s(e=>e.modelBudgets??ar),Et=s(e=>e.modelTierAlertDays??or),Dt=(0,d.useMemo)(()=>Xr(F.byDayModels,R.slice(0,7)),[F.byDayModels,R]),Ot=F.lowBalanceThreshold??50,kt=(0,d.useMemo)(()=>{if(g.length===0)return;let e=zr(F.byDay,R),t=xt().rate;for(let n of g){if(n.totalBalance===void 0||n.error!==void 0)continue;let r=n.currency===`USD`?n.totalBalance*t:n.totalBalance;if(r>=Ot)continue;let i=e>0?Math.floor(r/e):void 0;return{name:n.displayName,cny:r,days:i}}},[g,F.lowBalanceThreshold,F.byDay,R]);(0,d.useEffect)(()=>{if(kt===void 0||Ct===R||(c.markBalanceAlerted(R),!yi()))return;let e=I(`balanceLowBody`).replace(`{name}`,kt.name).replace(`{balance}`,fn(kt.cny)).replace(`{days}`,kt.days===void 0?`—`:String(kt.days));bi(`balance:${R}`,()=>{new Notification(I(`balance`),{body:e})})},[kt,Ct,R,c,I]),(0,d.useEffect)(()=>{let e=[],t;for(let[n,r]of Object.entries(Tt)){if(!(r>0))continue;let i=Dt[n]??0;for(let a of Qr(i,r)){let o=`${n}:${a}`;Et[o]!==R&&(e.push(o),(t===void 0||a>t.tier)&&(t={model:n,tier:a,cost:i,budget:r}))}}if(e.length===0||t===void 0||(c.markModelTierAlerted(e,R),!yi()))return;let n=I(`modelBudgetBody`).replace(`{model}`,t.model).replace(`{cost}`,fn(t.cost)).replace(`{budget}`,fn(t.budget)).replace(`{pct}`,String(t.tier));bi(`model-budget:${t.model}:${t.tier}:${R}`,()=>{new Notification(I(`modelBudgetTitle`),{body:n})})},[Tt,Dt,Et,R,c,I]);let At=(0,d.useMemo)(()=>{let e=R.slice(0,7),t=new Map;for(let[n,r]of Object.entries(F.byDayModels??{}))if(n.startsWith(e))for(let[e,n]of Object.entries(r)){if(n.cost<=0)continue;let r=nn(e).provider,i=F.byModel?.[e]?.plan===!0,a=t.get(r)??{cost:0,plan:i};a.cost+=n.cost,i||(a.plan=!1),t.set(r,a)}let n,r;for(let e of t){let t=e[1].plan?r:n;(t===void 0||e[1].cost>t[1].cost)&&(e[1].plan?r=e:n=e)}let i=e=>{let t=g.find(t=>Z(t.provider)===Z(e));if(t===void 0||t.totalBalance===void 0){if(e===`Custom`){let e=g.filter(e=>e.totalBalance!==void 0&&e.error===void 0),t=e[0];return t!==void 0&&e.length===1?i(t.provider):void 0}return{text:t?.error===`unauthorized`?I(`balanceUnauthorized`):t?.error===`unreachable`||t?.error===`invalid`?I(`balanceUnreachable`):I(`balanceUnconfigured`),low:!1}}let n=t.currency===`USD`?`$${t.totalBalance.toFixed(2)}`:fn(t.totalBalance),r=xt().rate;return{text:n,low:(t.currency===`USD`?t.totalBalance*r:t.totalBalance)<Ot}},a=e=>{let t=S.find(t=>t.displayName===e||ii(t.provider)===e);if(t===void 0||t.windows.length===0)return{text:I(`subscriptionNoApi`),low:!1};let n=t.windows.reduce((e,t)=>Math.min(e,t.remainingPercent),100);return{text:n<=0?I(`subscriptionExhausted`):I(`subscriptionRemaining`).replace(`{pct}`,String(n)),low:n<20}},o=n===void 0?void 0:i(n[0]);return{direct:n===void 0||o===void 0?void 0:{name:n[0],...o},sub:r===void 0?void 0:{name:r[0],...a(r[0])}}},[F.byDayModels,F.byModel,F.lowBalanceThreshold,g,S,R,I]),jt=(0,d.useMemo)(()=>{let e=F.total;return{input:e.input,output:e.output,cacheRead:e.cacheHit,cacheMiss:e.cacheMiss,calls:e.calls}},[F]);(0,d.useEffect)(()=>{r({todayCost:We,monthCost:Ue})},[We,Ue,r]),(0,d.useEffect)(()=>{if(!l)return i(Be)},[l,i,Be]);let Mt=(0,d.useMemo)(()=>u.byTurn??[],[u.byTurn]);return(0,m.jsxs)(m.Fragment,{children:[!l&&(0,m.jsx)(aa,{...e,t:I,currency:te,onOpen:Be,monthCost:Ue,todayCost:We,weekCost:Ye,days:Xe,vendorStatus:At,dash:jt,cardPrefs:Ee,monthTokens:Ze,todayTokens:Qe,weekTokens:z,floatPrefs:ce,subscriptions:S,budgetPressure:bt,deltaPct:Je}),(l||Pe)&&(0,m.jsx)(la,{stats:F,t:I,onClose:Re,embeddedSettings:l,navigateToSession:a,userPrices:Oe,onUserPrices:Ae,health:p,balances:g,...v===void 0?{}:{reconcile:v},quotas:S,relayQuotas:E,currency:te,onCurrency:se,language:ie,onLanguage:oe,turns:Mt,renderSlot:o,budgetEnabled:B,budgetAmount:yt,modelBudgets:Tt,monthModelCost:Dt,onModelBudget:c.setModelBudget,onToggleBudget:St,onBudgetAmount:c.setAmount,peakConfig:nt,onPeakConfig:mt,onPreviewPeak:_t,floatPrefs:ce,onFloatPrefs:ue,cardPrefs:Ee,onCardPrefs:De,recoveryEntryAvailable:Te,sitePrefs:de,onSitePrefs:he,liveCostPrefs:ge,onLiveCostPrefs:N,quotasStale:w,balanceStale:b}),(U!==null||at!==null)&&(0,m.jsx)(Or,{hit:U??at,config:nt,t:I,onDismiss:()=>{it(null),ot(null)}})]})}function ga(e){return(0,m.jsx)(`div`,{className:z.nativeSettingsRoot,"data-testid":`native-billing-settings`,children:(0,m.jsx)(ha,{...e,renderSlot:()=>null,wide:!0,embeddedSettings:!0})})}function _a(e,t){if(t===void 0||e?.bySession===void 0)return 0;let n=e.bySession.find(e=>e.id===t);return(n?.cost??0)+(n?.subCost??0)}function va(e,t){return t===void 0||e?.bySession===void 0?0:e.bySession.find(e=>e.id===t)?.subCost??0}function ya(e,t){if(t===void 0||e?.byTurn===void 0)return 0;let n=0,r=-1;for(let i of e.byTurn)i.sessionId===t&&(r===-1||i.turn>r)&&(r=i.turn,n=i.cost);return n}function ba(e,t=20){let n=[];for(let r of e)if(r.status===`ok`)for(let e of r.windows)e.remainingPercent>t||n.push({name:r.displayName,kind:e.kind,pct:e.remainingPercent});return n.sort((e,t)=>e.pct-t.pct).slice(0,3)}function xa(e,t){if(t===void 0||e?.byTurn===void 0)return;let n=-1,r;for(let i of e.byTurn)i.sessionId===t&&(n===-1||i.turn>n)&&(n=i.turn,r=i.model);return r}async function Sa(){try{let e=await Q(`/api/billing/usage-stats`);if(!e.ok)return null;let t=await e.text(),n=JSON.parse(t);if(typeof n!=`object`||!n)return null;let r=n;return{...Array.isArray(r.bySession)?{bySession:r.bySession}:{},...Array.isArray(r.byTurn)?{byTurn:r.byTurn}:{}}}catch{return null}}async function Ca(){try{let e=await Q(`/api/billing/subscriptions`);if(!e.ok)return[];let t=JSON.parse(await e.text());if(typeof t!=`object`||!t||!(`quotas`in t))return[];let n=t.quotas;return Array.isArray(n)?n:[]}catch{return[]}}function wa(e){switch(e){case`session`:return`subscriptionSession`;case`weekly`:return`subscriptionWeekly`;case`monthly`:return`subscriptionMonthly`;default:return`subscriptionBilling`}}function Ta(e){return!e.running&&!e.promptAttempted&&(e.blank||e.awaitingFirstTurn)}function Ea({hasBandPlan:e}){let[t,n]=(0,d.useState)(()=>we()),[r,i]=(0,d.useState)(()=>Date.now());if((0,d.useEffect)(()=>{let e=()=>{n(we())};window.addEventListener(P,e),window.addEventListener(`storage`,e);let t=setInterval(()=>{i(Date.now())},3e4);return()=>{window.removeEventListener(P,e),window.removeEventListener(`storage`,e),clearInterval(t)}},[]),t.length===0)return null;let a=Tr().leadMin*6e4,o=t.map(t=>({key:t,state:cr(Ft(r,Pt(t,e)),a)})).filter(e=>e.state!==null);return o.length===0?null:(0,m.jsx)(`span`,{className:z.bandDots,"data-testid":`billing-pinned-dots`,children:o.map(e=>(0,m.jsx)(`span`,{className:y(z.bandDot,z.bandDotOn,z[e.state]),role:`img`,"aria-label":e.key,title:e.key},e.key))})}function Da(){let[e,t]=(0,d.useState)(()=>Se());return(0,d.useEffect)(()=>{let e=()=>{t(Se())};return window.addEventListener(xe,e),window.addEventListener(`storage`,e),()=>{window.removeEventListener(xe,e),window.removeEventListener(`storage`,e)}},[]),e}function Oa(){let[e,t]=(0,d.useState)(()=>ve().show),[n,r]=(0,d.useState)(()=>ve().position);return(0,d.useEffect)(()=>{let e=()=>{t(ve().show),r(ve().position)};return window.addEventListener(_e,e),window.addEventListener(`storage`,e),()=>{window.removeEventListener(_e,e),window.removeEventListener(`storage`,e)}},[]),{visible:e,position:n}}function ka(e,t){let[n,r]=(0,d.useState)(null),[i,a]=(0,d.useState)([]),[o,s]=(0,d.useState)(()=>Date.now()),[c,l]=(0,d.useState)(()=>typeof document>`u`||!document.hidden);(0,d.useEffect)(()=>{if(typeof document>`u`)return;let e=()=>{l(!document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}},[]),(0,d.useEffect)(()=>{if(!c||!t)return;let e=!1,n=!1,i=()=>{n||(n=!0,e||s(Date.now()),Promise.all([Sa(),Ca()]).then(([t,n])=>{e||(t!==null&&r(t),a(n))}).catch(()=>{}).finally(()=>{n=!1}))};i();let o=setInterval(i,3e4);return()=>{e=!0,clearInterval(o)}},[e,c,t]);let u=(0,d.useMemo)(()=>_a(n,e),[n,e]),f=(0,d.useMemo)(()=>va(n,e),[n,e]),p=(0,d.useMemo)(()=>ya(n,e),[n,e]),m=(0,d.useMemo)(()=>ba(i),[i]),h=(0,d.useMemo)(()=>Pt(xa(n,e),i.some(e=>e.displayName===`Z.ai Coding Plan`&&e.status===`ok`)),[n,e,i]);return{sessionCost:u,subCost:f,turnCost:p,tier:(0,d.useMemo)(()=>Ft(o,h),[o,h]),chips:m,hasBandPlan:i.some(e=>e.displayName===`Z.ai Coding Plan`&&e.status===`ok`)}}function Aa({sessionId:e,t,seat:n,session:r}){let{visible:i,position:a}=Oa(),o=i&&a===n&&!(n===`above`&&r!==void 0&&Ta(r)),{sessionCost:s,subCost:c,turnCost:l,tier:u,chips:d,hasBandPlan:f}=ka(e,o),p=Da(),h=e=>fn(dn(e,p),p),g=s>0||l>0,_=u?.tier===`peak`;return o?(0,m.jsxs)(`span`,{className:n===`above`?y(z.feeBar,z.feeBarAbove):z.feeBar,"data-testid":`billing-live-cost-bar`,"data-seat":n,children:[(0,m.jsx)(Ea,{hasBandPlan:f}),u!==null&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:_?z.feeChipPrimary:z.feeChipOff,"data-testid":`billing-live-tier`,children:t(_?`tierPeak`:`tierOff`)}),(0,m.jsx)(`span`,{className:z.feeCount,children:Lt(u.nextSwitchInMs)}),(0,m.jsx)(`span`,{className:z.feeSuffix,children:t(_?`tierToOff`:`tierToPeak`)})]}),g&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:z.feeSep,"aria-hidden":`true`,children:`·`}),(0,m.jsxs)(`span`,{className:z.feeItem,"data-testid":`billing-live-turn`,children:[t(`liveTurn`),` `,(0,m.jsx)(`span`,{className:z.feeNum,"data-tick":`turn`,children:h(l)})]}),(0,m.jsx)(`span`,{className:z.feeSep,"aria-hidden":`true`,children:`·`}),(0,m.jsxs)(`span`,{className:z.feeItem,"data-testid":`billing-live-session`,children:[t(`liveSession`),` `,(0,m.jsx)(`span`,{className:z.feeNum,"data-tick":`session`,children:h(s)}),c>0&&(0,m.jsx)(`span`,{className:z.feeSuffix,"data-testid":`billing-live-session-sub`,children:t(`liveSessionSub`).replace(`{cost}`,h(c))})]})]}),d.map(e=>(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:z.feeSep,"aria-hidden":`true`,children:`·`}),(0,m.jsxs)(`span`,{className:e.pct<=10?z.feeChipError:z.feeChipAlert,"data-testid":`billing-live-quota`,children:[e.name,` `,t(wa(e.kind)),` `,e.pct,`%`]})]},`${e.name}:${e.kind}`))]}):null}function ja({sessionId:e,t}){let n=Da(),r=e=>fn(dn(e,n),n),{visible:i,position:a}=Oa(),{sessionCost:o,subCost:s,turnCost:c,tier:l,chips:u,hasBandPlan:d}=ka(e,i&&a===`toolbar`);if(!i||a!==`toolbar`)return null;let f=l?.tier===`peak`,h=u.reduce((e,t)=>Math.min(e,t.pct),100),g=h<=10?z.feeInlineError:h<=20?z.feeInlineAlert:void 0,_=y(z.feeInline,g),v=[...l===null?[]:[`${Lt(l.nextSwitchInMs)} ${t(f?`tierToOff`:`tierToPeak`)}`],`${t(`liveTurn`)} ${r(c)}`,`${t(`liveSession`)} ${r(o)}`,...s>0?[t(`liveSessionSub`).replace(`{cost}`,r(s))]:[],...u.map(e=>`${e.name} ${t(wa(e.kind))} ${e.pct}%`)].join(` · `);return(0,m.jsx)(p.Tooltip,{label:v,side:`top`,delayMs:500,children:(0,m.jsxs)(`span`,{className:_,"data-testid":`billing-live-cost-chip`,role:`note`,"aria-label":v,children:[(0,m.jsx)(Ea,{hasBandPlan:d}),l!==null&&(0,m.jsx)(`span`,{className:f?z.feeChipPrimary:z.feeChipOff,"data-testid":`billing-live-tier`,children:t(f?`tierPeak`:`tierOff`)}),o>0&&(0,m.jsx)(`span`,{className:z.feeInlineNum,children:r(o)})]})})}let Ma=`@kenz1117/dsh-ui-usage-billing/TaskQueueQuick.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Ma)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@kenz1117/dsh-ui-usage-billing`,e.dataset.pluginCss=Ma,e.textContent=`.HRJ8EG_quickQueue{white-space:nowrap;flex-shrink:0;align-self:center;align-items:center;gap:6px;display:inline-flex;position:relative}.HRJ8EG_quickQueueToggle,.HRJ8EG_quickQueueButton{border:1px solid var(--dsw-alias-border-l1);min-height:24px;color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;border-radius:999px;justify-content:center;align-items:center;gap:5px;padding:0 8px;font-size:11px;line-height:18px;display:inline-flex}.HRJ8EG_quickQueueToggle:hover,.HRJ8EG_quickQueueButton:hover:not(:disabled){border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary)}.HRJ8EG_quickQueueToggle[aria-checked=true]{border-color:color-mix(in srgb, var(--ds-blue) 45%, transparent);background:color-mix(in srgb, var(--ds-blue) 10%, transparent);color:var(--ds-blue)}.HRJ8EG_quickQueueButton:focus-visible,.HRJ8EG_quickQueueToggle:focus-visible,.HRJ8EG_quickQueueClear input:focus-visible{outline:2px solid var(--ds-blue);outline-offset:2px}.HRJ8EG_quickQueueButton:disabled{cursor:wait;opacity:.65}.HRJ8EG_quickQueueClear{color:var(--dsw-alias-label-tertiary);cursor:pointer;align-items:center;gap:4px;font-size:11px;display:inline-flex}.HRJ8EG_quickQueueClear input{width:13px;height:13px;accent-color:var(--ds-blue);margin:0}.HRJ8EG_quickQueueCount{background:color-mix(in srgb, var(--ds-blue) 14%, transparent);min-width:16px;height:16px;color:var(--ds-blue);font-variant-numeric:tabular-nums;border-radius:999px;justify-content:center;align-items:center;padding:0 4px;font-size:10px;display:inline-flex}.HRJ8EG_quickQueueNotice{z-index:30;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-3);width:max-content;max-width:min(320px,75vw);color:var(--dsw-alias-label-primary);white-space:normal;pointer-events:none;border-radius:8px;padding:7px 10px;font-size:12px;line-height:18px;position:absolute;bottom:calc(100% + 8px);right:0;box-shadow:0 8px 24px #00000038}.HRJ8EG_quickQueueNotice[data-kind=error]{border-color:color-mix(in srgb, var(--ds-red) 45%, transparent);color:var(--ds-red)}`,document.head.appendChild(e)}var Na={quickQueue:`HRJ8EG_quickQueue`,quickQueueButton:`HRJ8EG_quickQueueButton`,quickQueueClear:`HRJ8EG_quickQueueClear`,quickQueueCount:`HRJ8EG_quickQueueCount`,quickQueueNotice:`HRJ8EG_quickQueueNotice`,quickQueueToggle:`HRJ8EG_quickQueueToggle`};let Pa=()=>void 0,Fa=()=>void 0;function Ia(e){return e.tasks.filter(e=>e.status===`queued`).length}function La(){let[e,t]=(0,d.useState)(()=>Xe());return(0,d.useEffect)(()=>{let e=()=>{t(Xe())};return window.addEventListener(Ye,e),window.addEventListener(`storage`,e),()=>{window.removeEventListener(Ye,e),window.removeEventListener(`storage`,e)}},[]),e}function Ra(e){let[t,n]=(0,d.useState)(null),[r,i]=(0,d.useState)(()=>typeof document>`u`||!document.hidden),a=(0,d.useRef)(0),o=(0,d.useCallback)(e=>{a.current+=1,n(Ia(e))},[]);return(0,d.useEffect)(()=>{if(typeof document>`u`)return;let e=()=>{i(!document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}},[]),(0,d.useEffect)(()=>{if(!e||!r){n(null);return}let t=!1,i=!1,o=()=>{if(i)return;i=!0;let e=a.current;Ji().then(r=>{t||e!==a.current||n(r.supported?r.queuedCount:null)}).catch(()=>{}).finally(()=>{i=!1})};o();let s=window.setInterval(o,3e4);return()=>{t=!0,window.clearInterval(s)}},[e,r]),{count:t,applySnapshot:o}}function za({t:e}){let t=La();return(0,m.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t.enabled,"aria-label":e(`quickQueueToggle`),className:Na.quickQueueToggle,"data-testid":`quick-queue-toggle`,onClick:()=>{Ze({...t,enabled:!t.enabled})},children:e(`quickQueueToggle`)})}function Ba(e,t){let n=e(t),r=(0,d.useCallback)(e=>n?.subscribe(e)??(()=>{}),[n]),i=(0,d.useCallback)(()=>n?.getSnapshot(),[n]);return(0,d.useSyncExternalStore)(r,i,i)}function Va({sessionId:e,t,useInput:n,inputActions:r,projectionFaceOf:i}){let a=La(),o=(n??Pa)(e=>e),s=Ba(i??Fa,`workingDirectory`),c=Ba(i??Fa,`modelSelection`)?.next,{count:l,applySnapshot:u}=Ra(a.enabled),[f,p]=(0,d.useState)(!1),[h,g]=(0,d.useState)(null),_=(0,d.useRef)(!1),v=(0,d.useRef)(!0),y=(0,d.useRef)({sessionId:e,input:o});if(y.current={sessionId:e,input:o},(0,d.useEffect)(()=>(v.current=!0,()=>{v.current=!1}),[]),(0,d.useEffect)(()=>{if(h?.kind!==`success`)return;let e=window.setTimeout(()=>{g(null)},4e3);return()=>{window.clearTimeout(e)}},[h]),!a.enabled)return null;let b=e=>{g({kind:`error`,text:e})},x=async()=>{if(_.current)return;if(g(null),o===void 0){b(t(`quickQueueUnsupported`));return}let n=o.draft;if(n.trim()===``){b(t(`quickQueueEmpty`));return}if(o.phase!==`plain`){b(t(`quickQueueBusy`));return}if(o.attachmentIds.length>0||o.occurrences.length>0){b(t(`quickQueueAttachments`));return}if(typeof s!=`string`||s===``){b(t(`quickQueueContext`));return}let i=a.clearAfterEnqueue;if(i&&r===void 0){b(t(`quickQueueUnsupported`));return}let l={sessionId:e,prompt:n,draftRev:o.draftRev,cwd:s,clearAfterEnqueue:i};_.current=!0,p(!0);try{let e=await qi(!0);if(!e.supported){b(t(`quickQueueUnsupported`));return}let n=c??e.defaultModel;if(n==null){b(t(`quickQueueContext`));return}let i=e.workspaces.some(e=>e.path===l.cwd),a=e.models.some(e=>e.provider===n.provider&&e.id===n.model);if(!i||!a){b(t(`quickQueueRoute`));return}let o=await Yi({action:`enqueue`,prompt:l.prompt,cwd:l.cwd,provider:n.provider,model:n.model});u(o);let s=t(`quickQueueEnqueued`);if(l.clearAfterEnqueue&&r!==void 0){let e=y.current;if(v.current&&e.sessionId===l.sessionId&&e.input?.draft===l.prompt&&e.input.draftRev===l.draftRev&&e.input.phase===`plain`&&e.input.attachmentIds.length===0&&e.input.occurrences.length===0)try{r.setDraft(``)}catch{s=t(`quickQueueDraftChanged`)}else s=t(`quickQueueDraftChanged`)}v.current&&g({kind:`success`,text:s})}catch(e){if(!v.current)return;let n=e instanceof Error?e.message:String(e);b(t(`quickQueueFailed`).replace(`{message}`,n))}finally{_.current=!1,v.current&&p(!1)}};return(0,m.jsxs)(`span`,{className:Na.quickQueue,"data-testid":`quick-queue-controls`,children:[(0,m.jsxs)(`label`,{className:Na.quickQueueClear,children:[(0,m.jsx)(`input`,{type:`checkbox`,checked:a.clearAfterEnqueue,disabled:f,onChange:e=>{Ze({...a,clearAfterEnqueue:e.target.checked})}}),t(`quickQueueClear`)]}),(0,m.jsxs)(`button`,{type:`button`,className:Na.quickQueueButton,"aria-label":t(`quickQueueEnqueue`),"aria-busy":f,disabled:f,"data-testid":`quick-queue-enqueue`,onClick:()=>{x()},children:[t(f?`quickQueueEnqueueing`:`quickQueueEnqueue`),l!==null&&l>0&&(0,m.jsx)(`span`,{className:Na.quickQueueCount,"data-testid":`quick-queue-count`,"aria-label":t(`quickQueueWaiting`).replace(`{count}`,String(l)),children:l})]}),h!==null&&(0,m.jsx)(`span`,{className:Na.quickQueueNotice,"data-kind":h.kind,role:h.kind===`error`?`alert`:`status`,children:h.text})]})}function Ha(){let e,t,n=new Set;return{readCosts:()=>e,subscribeCosts:t=>(t(e),n.add(t),()=>{n.delete(t)}),openDashboard:()=>{t?.()},publishCosts:t=>{e=t;for(let e of n)try{e(t)}catch{x(`billing-costs-listener-threw`)}},registerOpen:e=>(t=e,()=>{t===e&&(t=void 0)})}}let Ua={enabled:!1,timeout:0};function Wa(){try{let e=localStorage.getItem(`dsh-billing-completion-notify-v1`);if(e===null)return{...Ua};let t=JSON.parse(e);return{enabled:t.enabled===!0,timeout:typeof t.timeout==`number`?t.timeout:0}}catch{return{...Ua}}}function Ga(e){return e.completed===!0||e.running===!1}function Ka(e,t){let n=new Set,r=new Set,i,a=e.getSnapshot();for(let e of a.ids){let t=a.byId[e];t!==void 0&&(r.add(String(e)),Ga(t)&&n.add(String(e)))}let o=e=>{let{enabled:n,timeout:r}=t();if(n&&!(typeof Notification>`u`)&&Notification.permission===`granted`)try{let t=new Notification(e,{body:e,tag:`dsh-billing-completion`,requireInteraction:r===0});r>0&&(i!==void 0&&clearTimeout(i),i=setTimeout(()=>t.close(),r*1e3))}catch{x(`notification-constructor-failed`)}},s=e.subscribe(()=>{let t=e.getSnapshot(),i=[];for(let e of t.ids){let a=t.byId[e];if(a===void 0)continue;let o=String(e),s=Ga(a),c=!r.has(o);c&&r.add(o),s&&!c&&!n.has(o)&&i.push(a.title??a.id??o),s?n.add(o):n.delete(o)}if(i.length>0){let e=i.length===1?i[0]:`${i.length} 个会话已完成`;e!==void 0&&o(e)}});return()=>{s(),i!==void 0&&clearTimeout(i)}}function qa(e){let t=e.get(`uiWorkspace`);if(t!==void 0&&typeof t.openSession==`function`)return t}function Ja(e){let t=e.sessions,n=t?.open;return typeof n==`function`?n.bind(t):void 0}function Ya(e){return{available:()=>qa(e)!==void 0||Ja(e)!==void 0,open:t=>{let n=_(t),r=qa(e);if(r!==void 0)try{return r.openSession(n),`opened`}catch(e){return x(`session-navigation-open-failed`,e),`failed`}let i=Ja(e);if(i!==void 0)try{return i(n),`opened`}catch(e){return x(`session-navigation-legacy-open-failed`,e),`failed`}return`unavailable`}}}function Xa(e,t){let n=e.get(`commandUi`);if(n===void 0||typeof n.register!=`function`)return!1;let r={name:`usage`,label:t.label,description:t.description,available:()=>!0,ui:{kind:`action`,run:()=>{t.openDashboard()}}};try{n.register(r)}catch(e){return x(`usage-command-register-failed`,e),!1}return!0}let Za=[`slots`,`locale`,`remote`,`sessions`];function Qa(e){let t=Ha();e.provide(`billingMetrics`,t);let n=sr();e.effect(()=>e.locale.register(B,{zh:V,en:$e}),`ui-usage-billing: dictionaries`);let r=Ya(e),i=Xa(e,{openDashboard:()=>{t.openDashboard()},label:()=>Me()===`en`?$e.commandUsageLabel:V.commandUsageLabel,description:()=>Me()===`en`?$e.commandUsageDescription:V.commandUsageDescription}),a=!1,o={store:n,inject:()=>({checkModels:async()=>{try{let[t,n]=await Promise.all([e.remote.llm.listProviders(),e.remote.llm.listConfigurableProviders()]);if(!t.ok||!n.ok)return{checked:!0,available:!1,models:0,failures:0,okProviders:[],badProviders:[]};let r=new Map(n.value.map(e=>[e.provider,e])),i=await Promise.all(t.value.map(async t=>{let n=r.get(t.id);if(n===void 0)return{provider:t,models:[]};let i=await e.remote.llm.discoverModels(n.settingsNs,{provider:t.id});return i.ok?{provider:t,models:i.value}:{provider:t,failed:!0}})),a=[],o=[],s=[],c=0;for(let e of i){if(`failed`in e){s.push(e.provider.name);continue}o.push(e.provider.name),c+=e.models.length;for(let t of e.models)a.push({id:t.id,...typeof t.name==`string`&&t.name!==``?{name:t.name}:{},provider:e.provider.name})}return{checked:!0,available:o.length>0,models:c,failures:s.length,okProviders:o,badProviders:s,catalog:a}}catch{return{checked:!1,available:!1,models:0,failures:0,okProviders:[],badProviders:[]}}},publishCosts:e=>{t.publishCosts(e)},registerOpen:e=>t.registerOpen(e),recoveryEntryAvailable:i||a,navigateToSession:e=>r.open(e)})};e.slots.inject(`settings.section`,()=>{a=!0;let t=e.slots.register({name:`settings.section`,id:`usage-billing`,order:30,label:()=>Me()===`en`?$e.nativeSettingsNav:V.nativeSettingsNav,locale:B,...o},ga);return()=>{a=!1,t()}}),e.slots.inject(`sidebar.footer.action`,()=>e.slots.register({name:`sidebar.footer.action`,id:`usage-billing`,order:-10,locale:B,...o,children:{"billing.dashboard.decor":{kind:`list`,scope:`root`}}},ha)),e.slots.inject(`conversation.composer.dock`,()=>e.slots.register({name:`conversation.composer.dock`,id:`usage-billing-cost`,order:0,locale:B,inject:e=>({sessionId:_(e),seat:`below`})},Aa)),e.slots.inject(`conversation.input.dock`,()=>e.slots.register({name:`conversation.input.dock`,id:`usage-billing-cost-above`,order:100,locale:B,inject:e=>({sessionId:_(e),seat:`above`})},Aa)),e.slots.inject(`conversation.input.right`,()=>e.slots.register({name:`conversation.input.right`,id:`usage-billing-cost-chip`,order:0,locale:B,inject:e=>({sessionId:_(e)})},ja)),e.slots.inject(`conversation.input.left`,()=>e.slots.register({name:`conversation.input.left`,id:`usage-billing-quick-queue-toggle`,order:20,locale:B},za)),e.slots.inject(`conversation.input.right`,()=>e.slots.register({name:`conversation.input.right`,id:`usage-billing-quick-queue-enqueue`,order:20,locale:B,inject:t=>({sessionId:_(t),projectionFaceOf:n=>{try{return e.sessions.binding?.(_(t))?.session.projections.faceOf(n)}catch{return}}})},Va)),e.effect(()=>Ka(e.sessions.list,Wa),`ui-usage-billing: completion notifier`)}return n.UsageBilling=ha,n.apply=Qa,n.inject=Za,t.exports}});
1
+ window.__ModuleLoader__.load({id:`@kenz1117/dsh-ui-usage-billing`,factory:e=>{var t={exports:{}},n=t.exports;Object.defineProperty(n,Symbol.toStringTag,{value:`Module`});var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var s=o(t),l=0,u=s.length,d;l<u;l++)d=s[l],!c.call(e,d)&&d!==n&&i(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=a(t,d))||r.enumerable});return e},u=(e,t,n)=>(n=e==null?{}:r(s(e)),l(t||!e||!e.__esModule||!c.call(e,`default`)?i(n,`default`,{value:e,enumerable:!0}):n,e));let d=e("react"),f=e("react-dom"),p=e("@deepseek-ai/dsh-client-ui-primitives");p=u(p,1);let m=e("react/jsx-runtime"),h=e("@deepseek-ai/dsh-client-store");function g(e){return e}function _(e){return g(e)}function v(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=v(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function y(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=v(e))&&(r&&(r+=` `),r+=t);return r}let b=new Map;function x(e,t){let n=Date.now(),r=b.get(e);if(!(r!==void 0&&n-r<3e5)){if(b.set(e,n),t===void 0){console.info(`[usage-billing] swallowed: ${e}`);return}console.info(`[usage-billing] swallowed: ${e}`,t instanceof Error?t.message:t)}}function S(e,t){try{localStorage.setItem(e,t)}catch{x(`display-pref-write-failed`)}}function C(e){try{return localStorage.getItem(e)??void 0}catch{return}}function w(e){let t=C(e);if(t!==void 0)try{return JSON.parse(t)}catch{return}}let T={mode:`combined`,targets:[]},ee=`dsh.ui-usage-billing.float`;function E(){let e=()=>({...T,targets:[...T.targets]}),t=w(ee);if(typeof t!=`object`||!t)return e();let n=t;return{mode:n.mode===`subscription`?`subscription`:`combined`,targets:Array.isArray(n.targets)?n.targets.filter(e=>typeof e==`string`):[]}}function D(e){S(ee,JSON.stringify(e))}let O={mode:`full`,metric:`money`,span:`day`,showDelta:!0},k=`dsh.ui-usage-billing.card`,A=`dsh.ui-usage-billing.card-changed`;function j(){let e=w(k);if(typeof e!=`object`||!e)return{...O};let t=e;return{mode:t.mode===`compact`||t.mode===`hidden`?t.mode:`full`,metric:t.metric===`tokens`?`tokens`:`money`,span:t.span===`week`||t.span===`month`?t.span:`day`,showDelta:t.showDelta!==!1}}function M(e){S(k,JSON.stringify(e))}function te(e){let t=t=>{t.key===`dsh.ui-usage-billing.card`&&e()};return window.addEventListener(A,e),window.addEventListener(`storage`,t),()=>{window.removeEventListener(A,e),window.removeEventListener(`storage`,t)}}function ne(e,t){return e===`hidden`&&!t?`compact`:e}let N=`dsh.ui-usage-billing.kpi-range`,re=`dsh.ui-usage-billing.kpi-custom-range`;function ie(){let e=C(N);return e===`today`||e===`7d`||e===`week`||e===`month`||e===`all`||e===`custom`?e:`all`}function ae(e){S(N,e)}function oe(){let e=new Date;e.setDate(e.getDate()-1);let t=e=>String(e).padStart(2,`0`),n=`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`;return{start:n,end:n}}function se(e){if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}$/.test(e))return!1;let t=Number(e.slice(0,4)),n=Number(e.slice(5,7)),r=Number(e.slice(8,10));return t<1e3||n<1||n>12||r<1?!1:r<=new Date(t,n,0).getDate()}function ce(){let e=w(re);if(typeof e==`object`&&e){let t=e;if(se(t.start)&&se(t.end)&&t.start<=t.end)return{start:t.start,end:t.end}}return oe()}function le(e){S(re,JSON.stringify(e))}let ue={hideUnidentified:!0},de=`dsh.ui-usage-billing.sites`;function fe(){let e=w(de);return typeof e!=`object`||!e?{...ue}:{hideUnidentified:e.hideUnidentified!==!1}}function pe(e){S(de,JSON.stringify(e))}let me={show:!0,position:`toolbar`},he=`dsh.ui-usage-billing.livecost`,ge=`dsh.ui-usage-billing.livecost-pref`;function _e(){let e=w(he);if(typeof e!=`object`||!e)return{...me};let t=e;return{show:t.show!==!1,position:t.position===`above`||t.position===`toolbar`||t.position===`below`?t.position:me.position}}function ve(e){S(he,JSON.stringify(e))}let ye=`dsh.ui-usage-billing.currency`,be=`dsh.ui-usage-billing.currency-pref`;function xe(){let e=C(ye);return e===`usd`||e===`cny`||e===`eur`?e:`cny`}function Se(e){S(ye,e)}let P=`dsh.ui-usage-billing.pinned`,F=`dsh.ui-usage-billing.pinned-pref`;function Ce(){let e=w(P);return Array.isArray(e)?e.filter(e=>typeof e==`string`&&e!==``):[]}function we(e){S(P,JSON.stringify(e))}let Te=`dsh.ui-usage-billing.provider-expanded`;function Ee(){let e=w(Te);return Array.isArray(e)?e.filter(e=>typeof e==`string`&&/^(ch|sub|bal):/.test(e)):[]}function De(e){S(Te,JSON.stringify(e))}let Oe=`dsh.ui-usage-billing.providers-today`;function ke(){return C(Oe)===`1`}function I(e){S(Oe,e?`1`:`0`)}let Ae=`dsh.ui-usage-billing.language`;function je(){let e=C(Ae);if(e===`en`||e===`zh`)return e;let t=xe()===`usd`?`en`:`zh`;return Me(t),t}function Me(e){S(Ae,e)}function L(e){let t=Ce(),n=t.includes(e)?t.filter(t=>t!==e):[...t,e];return we(n),n}let Ne=`dsh.ui-usage-billing.prices`;function Pe(){let e=w(Ne);if(e==null)return[];let t=[],n=(e,n)=>{if(typeof n!=`object`||!n)return;let r=n,i=Number(r.input),a=Number(r.cacheHit),o=Number(r.output);if(![i,a,o].every(e=>Number.isFinite(e)&&e>=0))return;let s=r.offPeak,c;if(typeof s==`object`&&s){let e=s,t=Number(e.input),n=Number(e.cacheHit),r=Number(e.output);[t,n,r].every(e=>Number.isFinite(e)&&e>=0)&&(c={input:t,cacheHit:n,output:r})}t.push({key:e,...typeof r.origin==`string`&&r.origin!==``?{origin:r.origin}:{},input:i,cacheHit:a,output:o,...c===void 0?{}:{offPeak:c},...r.currency===`USD`?{currency:`USD`}:{}})};if(Array.isArray(e))for(let t of e){if(typeof t!=`object`||!t)continue;let e=t;typeof e.key==`string`&&e.key!==``&&n(e.key,t)}else if(typeof e==`object`)for(let[t,r]of Object.entries(e))n(t,r);return t}function Fe(e){S(Ne,JSON.stringify(e))}let Ie={metric:`ttft`},Le=`dsh.ui-usage-billing.perf`;function Re(){let e=w(Le);if(typeof e!=`object`||!e)return{...Ie};let t=e;return{metric:t.metric===`tps`?`tps`:`ttft`,...Array.isArray(t.models)?{models:t.models.filter(e=>typeof e==`string`)}:{}}}function R(e){S(Le,JSON.stringify(e))}let ze=`dsh.ui-usage-billing.density`,Be=`dsh.ui-usage-billing.density-pref`;function Ve(){let e=C(ze);return e===`compact`||e===`comfortable`?e:`default`}function z(e){S(ze,e),typeof window<`u`&&typeof CustomEvent<`u`&&window.dispatchEvent(new CustomEvent(Be,{detail:{density:e}}))}let He=`dsh.ui-usage-billing.motion`,Ue=`dsh.ui-usage-billing.motion-pref`;function We(){let e=C(He);return e===`off`||e===`subtle`?e:`rich`}function Ge(e){S(He,e),typeof window<`u`&&typeof CustomEvent<`u`&&window.dispatchEvent(new CustomEvent(Ue,{detail:{motion:e}}))}let Ke={enabled:!1,clearAfterEnqueue:!1},qe=`dsh.ui-usage-billing.quick-queue`,Je=`dsh.ui-usage-billing.quick-queue-pref`;function Ye(){let e=w(qe);if(typeof e!=`object`||!e)return{...Ke};let t=e;return{enabled:t.enabled===!0,clearAfterEnqueue:t.clearAfterEnqueue===!0}}function Xe(e){S(qe,JSON.stringify(e)),typeof window<`u`&&typeof CustomEvent<`u`&&window.dispatchEvent(new CustomEvent(Je))}let Ze=`@kenz1117/dsh-ui-usage-billing/UsageBilling.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Ze)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@kenz1117/dsh-ui-usage-billing`,e.dataset.pluginCss=Ze,e.textContent=`:root{--ds-blue:#4f8cff;--ds-cyan:#2dd4bf;--ds-green:#34d399;--ds-amber:#f59e0b;--ds-red:#ef4444;--ds-violet:#a78bfa;--ds-violet-soft:color-mix(in srgb, var(--ds-violet) 14%, transparent);--ds-violet-bg:color-mix(in srgb, var(--ds-violet) 8%, transparent);--ds-violet-strong:color-mix(in srgb, var(--ds-violet) 60%, transparent);--font-num:"JetBrains Mono", "SF Mono", "Menlo", "Consolas", ui-monospace, monospace;--mono:var(--font-num)}body{--dsb:var(--dsw-alias-bg-layer-1);--dsb-2:var(--dsw-alias-bg-layer-2);--dsb-3:var(--dsw-alias-bg-layer-3);--dsb-glass:color-mix(in srgb,var(--dsw-alias-bg-layer-2) 78%,transparent);--dsb-glass-strong:color-mix(in srgb,var(--dsw-alias-bg-layer-3) 88%,transparent);--ds-border:var(--dsw-alias-border-l1);--ds-border-strong:var(--dsw-alias-border-l2);--ds-hi-top:#ffffff0b;--ds-shadow-1:0 1px 0 #ffffff0a inset,0 8px 24px #00000059;--ds-shadow-2:0 1px 0 #ffffff0d inset,0 18px 48px #00000080;--ds-t-1:var(--dsw-alias-label-primary);--ds-t-2:var(--dsw-alias-label-secondary);--ds-t-3:var(--dsw-alias-label-tertiary);--ds-t-4:var(--dsw-alias-label-dimmed);--ds-c-1:#4f8cff;--ds-c-2:#2dd4bf;--ds-c-3:#a78bfa;--ds-c-4:#f59e0b;--ds-c-5:#f472b6;--ds-c-6:#fbbf24;--ds-c-7:#38bdf8;--ds-r-1:8px;--ds-r-2:12px;--ds-r-3:16px;--ds-t-fast:.16s cubic-bezier(.2,.8,.2,1);--ds-t-enter:.24s cubic-bezier(.2,.8,.2,1);--ds-t-pulse:1.2s cubic-bezier(.2,.8,.2,1);--ds-t-countup:.4s cubic-bezier(.22,1,.36,1);--ds-t-scan:.9s cubic-bezier(.2,.8,.2,1);--ds-density-pad-y:10px;--ds-density-pad-x:14px;--ds-density-row-h:32px;--ds-density-font:12px}[data-density=compact]{--ds-density-pad-y:6px;--ds-density-pad-x:10px;--ds-density-row-h:26px;--ds-density-font:11.5px}[data-density=comfortable]{--ds-density-pad-y:14px;--ds-density-pad-x:18px;--ds-density-row-h:40px;--ds-density-font:13px}[data-density=compact] .KFXqYa_panel{padding:8px 10px}[data-density=compact] .KFXqYa_kpiTile{padding:10px 12px}[data-density=compact] .KFXqYa_setCard{padding:10px 12px}[data-density=compact] .KFXqYa_ubCard{padding:10px 12px}[data-density=compact] .KFXqYa_providerGroup{padding:8px 10px}[data-density=compact] .KFXqYa_providerStatRow{gap:8px;padding:6px 8px}[data-density=compact] .KFXqYa_modelTable th,[data-density=compact] .KFXqYa_modelTable td{padding:6px 8px}[data-density=compact] .KFXqYa_ubTable th,[data-density=compact] .KFXqYa_ubTable td{padding:4px 7px}[data-density=compact] .KFXqYa_dashboardBody{gap:10px;padding:12px 16px 16px}[data-density=compact] .KFXqYa_tabNav{margin:10px 16px 0}[data-density=compact] .KFXqYa_hero{gap:8px;padding:12px 14px}[data-density=compact] .KFXqYa_heroValue{font-size:42px;line-height:46px}[data-density=comfortable] .KFXqYa_panel{padding:16px 18px}[data-density=comfortable] .KFXqYa_kpiTile{padding:18px 20px}[data-density=comfortable] .KFXqYa_setCard{padding:20px 22px}[data-density=comfortable] .KFXqYa_ubCard{padding:20px 22px}[data-density=comfortable] .KFXqYa_providerGroup{padding:16px 18px}[data-density=comfortable] .KFXqYa_providerStatRow{gap:14px;padding:14px 16px}[data-density=comfortable] .KFXqYa_modelTable th,[data-density=comfortable] .KFXqYa_modelTable td{padding:13px 14px}[data-density=comfortable] .KFXqYa_ubTable th,[data-density=comfortable] .KFXqYa_ubTable td{padding:10px 12px}[data-density=comfortable] .KFXqYa_dashboardBody{gap:18px;padding:20px 28px 28px}[data-density=comfortable] .KFXqYa_hero{gap:16px;padding:22px 24px}[data-density=comfortable] .KFXqYa_heroValue{font-size:56px;line-height:60px}.KFXqYa_railButton{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);background:var(--dsb-2);width:36px;height:36px;color:var(--ds-t-2);cursor:pointer;transition:border-color var(--ds-t-fast), color var(--ds-t-fast);flex:none;justify-content:center;align-items:center;padding:0;display:flex}.KFXqYa_railButton:hover,.KFXqYa_railButton:focus-visible{border-color:var(--ds-blue);color:var(--ds-blue);outline:none}.KFXqYa_railButton svg{width:26px;height:26px}.KFXqYa_triggerBudgetPulse{border-color:color-mix(in srgb, var(--ds-red) 55%, transparent);animation:2s ease-in-out infinite KFXqYa_budgetPulse}.KFXqYa_triggerBudgetOver{animation-duration:1.2s}@keyframes KFXqYa_budgetPulse{0%,to{box-shadow:0 1px 2px #0000000a,0 0 #ef444400}50%{box-shadow:0 1px 2px #0000000a,0 0 0 3px #ef444429}}.KFXqYa_trigger{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);background:var(--dsb-glass);-webkit-backdrop-filter:blur(14px)saturate(1.2);width:100%;min-width:0;color:var(--ds-t-1);cursor:pointer;text-align:left;transition:border-color var(--ds-t-fast), transform var(--ds-t-fast), box-shadow var(--ds-t-fast);align-items:center;gap:12px;padding:10px 14px;display:flex;position:relative;overflow:hidden;box-shadow:0 1px 2px #0000000a}.KFXqYa_trigger:hover,.KFXqYa_trigger:focus-visible{border-color:var(--ds-border-strong);box-shadow:0 6px 18px -8px color-mix(in srgb, var(--ds-blue) 45%, transparent);outline:none;transform:translateY(-1px)}.KFXqYa_trigger:before{content:"";background:linear-gradient(180deg, var(--ds-hi-top), transparent);pointer-events:none;height:1px;position:absolute;top:0;left:0;right:0}.KFXqYa_trigger:after{content:"";background:linear-gradient(105deg, transparent 42%, color-mix(in srgb, var(--ds-blue) 9%, transparent) 50%, transparent 58%);opacity:0;pointer-events:none;position:absolute;inset:0;transform:translate(-110%)}.KFXqYa_trigger:hover:after,.KFXqYa_trigger:focus-visible:after{animation:.9s ease-out KFXqYa_triggerScan}@keyframes KFXqYa_triggerScan{0%{opacity:0;transform:translate(-110%)}25%{opacity:1}to{opacity:0;transform:translate(110%)}}@media (prefers-reduced-motion:reduce){.KFXqYa_triggerSparkBar,.KFXqYa_trigger:hover:after,.KFXqYa_trigger:focus-visible:after{animation:none}.KFXqYa_triggerGaugeNeedle,.KFXqYa_triggerGaugeArc{transition:none}.KFXqYa_triggerBudgetPulse,.KFXqYa_dashboardModal,.KFXqYa_tabPanel,.KFXqYa_peakAlertPop{animation:none}.KFXqYa_kpiTile,.KFXqYa_heroGaugeArc,.KFXqYa_chartLine,.KFXqYa_chartArea{transition:none;animation:none}}[data-motion=off] *,[data-motion=off] :before,[data-motion=off] :after{transition:none!important;animation:none!important}[data-motion=subtle] *,[data-motion=subtle] :before,[data-motion=subtle] :after{animation-duration:.001ms!important;animation-iteration-count:1!important}.KFXqYa_triggerIcon{width:32px;height:32px;color:var(--ds-blue);flex:none;justify-content:center;align-items:center;display:inline-flex}.KFXqYa_triggerIcon svg{width:30px;height:30px}.KFXqYa_triggerGaugeNeedle{transition:transform 1.1s cubic-bezier(.22,1,.36,1)}.KFXqYa_triggerGaugeArc{transition:stroke-dasharray 1.1s cubic-bezier(.22,1,.36,1)}.KFXqYa_triggerBudgetHot{color:var(--ds-red)}.KFXqYa_triggerMain{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.KFXqYa_triggerPrimary{flex-direction:column;gap:1px;min-width:0;display:flex}.KFXqYa_triggerValueRow{align-items:baseline;gap:2px;min-width:0;display:flex}.KFXqYa_triggerLabel{color:var(--ds-t-3);white-space:nowrap;text-overflow:ellipsis;min-width:0;font-size:11px;line-height:15px;overflow:hidden}.KFXqYa_triggerYen{color:var(--ds-t-3);font-variant-numeric:tabular-nums;font-size:12px;font-weight:600;line-height:16px}.KFXqYa_triggerMetric{color:var(--ds-t-1);font-size:22px;font-weight:600;line-height:26px;font-family:var(--font-num);font-variant-numeric:tabular-nums;white-space:nowrap;text-overflow:ellipsis;min-width:0;overflow:hidden}.KFXqYa_triggerDelta{font-size:10px;font-weight:600;font-family:var(--font-num);font-variant-numeric:tabular-nums;border-radius:999px;flex:none;align-self:flex-start;align-items:center;gap:1px;padding:1px 5px;display:inline-flex}.KFXqYa_triggerDeltaUp{color:var(--ds-green);background:color-mix(in srgb, var(--ds-green) 14%, transparent)}.KFXqYa_triggerDeltaDown{color:var(--ds-red);background:color-mix(in srgb, var(--ds-red) 14%, transparent)}.KFXqYa_triggerGlow{background:linear-gradient(90deg, transparent, color-mix(in srgb, var(--ds-blue) 40%, transparent), transparent);opacity:0;height:1px;animation:KFXqYa_triggerGlowPulse var(--ds-t-pulse) ease-out 1;position:absolute;bottom:4px;left:0;right:0}@keyframes KFXqYa_triggerGlowPulse{0%{opacity:0;transform:translate(-30%)}30%{opacity:1}to{opacity:0;transform:translate(30%)}}.KFXqYa_triggerSpark{flex:none;align-items:flex-end;gap:2px;height:20px;display:flex}.KFXqYa_triggerSparkBar,.KFXqYa_triggerSparkHot{background:var(--ds-blue);opacity:.6;border-radius:1px 1px 0 0;width:3px}.KFXqYa_triggerSparkHot{opacity:1}.KFXqYa_triggerSparkBar{animation:3.6s ease-in-out infinite KFXqYa_triggerSparkBreath}.KFXqYa_triggerSparkBar:nth-child(2n){animation-delay:-1.2s}.KFXqYa_triggerSparkBar:nth-child(3n){animation-delay:-2.4s}@keyframes KFXqYa_triggerSparkBreath{0%,to{opacity:.6}50%{opacity:.34}}.KFXqYa_triggerWrap{flex:auto;width:100%;min-width:96px;max-width:100%;display:block;position:relative;container:KFXqYa_billing-trigger/inline-size}@container KFXqYa_billing-trigger (width<=210px){.KFXqYa_trigger{box-shadow:none;-webkit-backdrop-filter:none;background:0 0;border:none;border-radius:12px;padding:7px 8px}.KFXqYa_trigger:before,.KFXqYa_trigger:after{display:none}.KFXqYa_trigger:hover,.KFXqYa_trigger:focus-visible{background:var(--dsw-alias-interactive-bg-hover);box-shadow:none;border-color:#0000;transform:none}.KFXqYa_triggerSpark,.KFXqYa_triggerLabel{display:none}}@container KFXqYa_billing-trigger (width<=140px){.KFXqYa_triggerMain{display:none}}.KFXqYa_triggerPop{box-sizing:border-box;border:1px solid var(--ds-border-strong);border-radius:var(--ds-r-3);background:var(--dsb-glass-strong);-webkit-backdrop-filter:blur(14px)saturate(1.2);width:256px;box-shadow:var(--ds-shadow-2);opacity:0;visibility:hidden;pointer-events:none;transition:opacity var(--ds-t-fast), transform var(--ds-t-fast), visibility 0s linear .16s;z-index:2000;flex-direction:column;gap:5px;padding:10px 12px;display:flex;position:fixed;top:0;left:0;overflow:hidden;transform:translateY(calc(4px - 100%))}.KFXqYa_triggerPop,.KFXqYa_triggerPop *{box-sizing:border-box}.KFXqYa_triggerPop:before{content:"";background:linear-gradient(90deg, transparent 10%, var(--ds-amber) 50%, transparent 90%);opacity:.65;pointer-events:none;height:1.5px;position:absolute;top:0;left:0;right:0}.KFXqYa_triggerPopShown{opacity:1;visibility:visible;transition:opacity var(--ds-t-fast), transform var(--ds-t-fast), visibility 0s linear 0s;transform:translateY(-100%)}.KFXqYa_popHead{justify-content:space-between;align-items:baseline;gap:8px;display:flex}.KFXqYa_popTitle{letter-spacing:.06em;text-transform:uppercase;color:var(--ds-t-3);font-size:12px;font-weight:700;line-height:18px}.KFXqYa_metricGrid{grid-template-columns:repeat(3,1fr);gap:10px 12px;display:grid}.KFXqYa_metricCell{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_metricLabel{color:var(--ds-t-3);font-size:11px;line-height:14px}.KFXqYa_metricValue{color:var(--ds-t-1);font-size:13px;font-weight:700;line-height:16px;font-family:var(--font-num);font-variant-numeric:tabular-nums;white-space:nowrap}.KFXqYa_metricValueSuccess{color:var(--ds-green)}.KFXqYa_popModel{border-top:1px dashed var(--ds-border);flex-direction:column;gap:6px;margin-top:9px;padding-top:10px;display:flex}.KFXqYa_popModelLabel{color:var(--ds-t-3);font-size:10px;line-height:14px}.KFXqYa_popModelRow{align-items:center;gap:8px;min-width:0;display:flex}.KFXqYa_popDot{border-radius:999px;flex:none;width:6px;height:6px}.KFXqYa_popDotDirect{background:var(--ds-green)}.KFXqYa_popDotSub{background:var(--ds-amber)}.KFXqYa_popDotNeutral{background:var(--ds-t-3)}.KFXqYa_popTagPrimary,.KFXqYa_popTagSub{white-space:nowrap;border-radius:5px;flex:none;align-items:center;height:18px;padding:0 6px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_popTagPrimary{background:color-mix(in srgb, var(--ds-blue) 14%, transparent);color:var(--ds-blue)}.KFXqYa_popTagSub{background:color-mix(in srgb, var(--ds-amber) 18%, transparent);color:var(--ds-amber)}.KFXqYa_popModelName{color:var(--ds-t-2);text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:500;line-height:16px;overflow:hidden}.KFXqYa_popModelStatus{color:var(--ds-t-1);font-variant-numeric:tabular-nums;white-space:nowrap;margin-left:auto;font-size:11px;font-weight:600;line-height:16px}.KFXqYa_popModelStatusLow{color:var(--ds-red)}.KFXqYa_dashboardModal{border:1px solid var(--ds-border-strong);border-radius:var(--ds-r-3);background:var(--dsb-2);width:min(760px,100vw - 48px);height:min(760px,88vh);box-shadow:var(--ds-shadow-2);animation:.16s ease-out KFXqYa_dashboardIn}@keyframes KFXqYa_dashboardIn{0%{opacity:0;transform:translateY(4px)scale(.98)}to{opacity:1;transform:none}}div[role=presentation]:has(>.dsh-billing-modal)>div[aria-hidden=true]:first-child{backdrop-filter:blur(8px)saturate(1.25)}.KFXqYa_dashboard{flex-direction:column;width:100%;height:100%;min-height:0;display:flex}.KFXqYa_dashboardHead{border-bottom:1px solid var(--ds-border);border-bottom:1px solid var(--ds-border);justify-content:space-between;align-items:center;gap:12px;padding:12px 18px;display:flex}.KFXqYa_dashboardTitle{color:var(--ds-t-1);margin:0;font-size:14px;font-weight:600;line-height:20px}.KFXqYa_dashboardSubtitle{color:var(--ds-t-3);margin:2px 0 0;font-size:11px;line-height:16px}.KFXqYa_closeButton{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);width:32px;height:32px;color:var(--ds-t-2);cursor:pointer;transition:background-color var(--ds-t-fast), color var(--ds-t-fast);background:0 0;flex:none;justify-content:center;align-items:center;display:inline-flex}.KFXqYa_closeButton:hover{background:var(--dsb-3);color:var(--ds-t-1)}.KFXqYa_closeButton svg{stroke-width:2px;width:16px;height:16px}.KFXqYa_dashboardBody{flex-direction:column;flex:auto;gap:14px;min-height:0;padding:16px 24px 24px;display:flex;overflow-y:auto}.KFXqYa_nativeSettingsRoot{width:100%;min-width:0}.KFXqYa_nativeSettingsDashboard{height:auto}.KFXqYa_dashboardBody.KFXqYa_nativeSettingsBody{flex:none;padding:0;overflow:visible}.KFXqYa_settingsLayout.KFXqYa_nativeSettingsLayout{grid-template-columns:minmax(0,1fr)}.KFXqYa_modalFooter{border-top:1px solid var(--ds-border);color:var(--ds-t-3);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:16px;padding:8px 18px;font-size:11px;line-height:16px;display:flex}.KFXqYa_tabRail{background:var(--dsb);border:1px solid var(--ds-border);border-radius:var(--ds-r-2);flex-direction:column;align-self:start;gap:2px;max-height:min(720px,88vh - 80px);padding:6px;display:flex;position:sticky;top:0;overflow-y:auto}.KFXqYa_tabNav{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);background:var(--dsb);align-items:center;gap:4px;margin:14px 24px 0;padding:4px;display:flex}.KFXqYa_tabButton{color:var(--ds-t-3);cursor:pointer;transition:background-color var(--ds-t-fast), color var(--ds-t-fast), box-shadow var(--ds-t-fast);background:0 0;border:none;border-radius:6px;align-items:center;gap:6px;padding:6px 10px 6px 12px;font-size:12px;font-weight:500;line-height:16px;display:flex}.KFXqYa_tabButton:hover{color:var(--ds-t-2)}.KFXqYa_tabButton:focus-visible{box-shadow:0 0 0 1px var(--ds-border-strong);color:var(--ds-t-2);outline:none}.KFXqYa_tabButtonActive,.KFXqYa_tabButtonActive:hover,.KFXqYa_tabButtonActive:focus-visible{background:var(--dsb-3);color:var(--ds-t-1);box-shadow:0 0 0 1px var(--ds-border-strong) inset;font-weight:600}.KFXqYa_tabButton>.KFXqYa_tabRailIcon,.KFXqYa_tabButton>.KFXqYa_tabRailIcon svg{width:12px;height:12px}.KFXqYa_tabNavLabel{line-height:16px}.KFXqYa_tabRailItem{color:var(--ds-t-2);cursor:pointer;text-align:left;transition:background-color var(--ds-t-fast), color var(--ds-t-fast);background:0 0;border:0;border-radius:8px;align-items:center;gap:10px;padding:9px 12px;font-family:inherit;font-size:12.5px;display:flex;position:relative}.KFXqYa_tabRailItem:hover{background:var(--dsb-3);color:var(--ds-t-1)}.KFXqYa_tabRailItem:focus-visible{box-shadow:0 0 0 1.5px var(--ds-border-strong);outline:none}.KFXqYa_tabRailItemActive,.KFXqYa_tabRailItemActive:hover{background:color-mix(in srgb, var(--ds-blue) 14%, transparent);color:var(--ds-t-1);font-weight:600}.KFXqYa_tabRailItemActive:before{content:"";background:var(--ds-blue);border-radius:0 2px 2px 0;width:2px;position:absolute;top:8px;bottom:8px;left:0}.KFXqYa_tabRailIcon{width:14px;height:14px;color:var(--ds-t-3);flex:none;justify-content:center;align-items:center;display:inline-flex}.KFXqYa_tabRailItemActive .KFXqYa_tabRailIcon{color:var(--ds-blue)}.KFXqYa_tabRailIcon svg{width:14px;height:14px}.KFXqYa_tabRailLabel{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.KFXqYa_tabBadge{background:var(--dsb-3);color:var(--ds-t-3)}.KFXqYa_tabBadgeWarn{background:color-mix(in srgb, var(--ds-amber) 18%, transparent);color:var(--ds-amber)}.KFXqYa_tabBadgeHot{background:color-mix(in srgb, var(--ds-red) 18%, transparent);color:var(--ds-red)}.KFXqYa_tabBadgeViolet{background:var(--ds-violet-soft);color:var(--ds-violet)}.KFXqYa_tabPanel{flex-direction:column;gap:14px;animation:.14s ease-out KFXqYa_tabPanelIn;display:flex}.KFXqYa_dashboardBody>*,.KFXqYa_tabPanel>*,.KFXqYa_agentSummary,.KFXqYa_agentRow{flex-shrink:0}@keyframes KFXqYa_tabPanelIn{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.KFXqYa_reconcileNotice{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 78%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 62%, transparent);color:var(--dsw-alias-label-secondary);border-radius:10px;align-items:flex-start;gap:10px;padding:10px 12px;font-size:12px;line-height:1.55;display:flex}.KFXqYa_reconcileIcon{color:var(--dsw-alias-label-tertiary);flex:none;margin-top:1px;display:inline-flex}.KFXqYa_reconcileText{flex:1}.KFXqYa_reconcileDismiss{color:var(--dsw-alias-label-tertiary);cursor:pointer;white-space:nowrap;background:0 0;border:none;border-radius:6px;flex:none;padding:2px 8px;font-size:12px;line-height:1.4;transition:color .15s,background-color .15s}.KFXqYa_reconcileDismiss:hover{color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--dsw-alias-label-primary) 8%, transparent)}.KFXqYa_hero{border:1px solid var(--ds-border);border-radius:var(--ds-r-3);background:var(--dsb-glass-strong);flex-direction:column;gap:12px;padding:18px 20px;display:flex;position:relative;overflow:hidden}.KFXqYa_hero:after{content:"";background:linear-gradient(90deg, transparent 10%, var(--ds-amber) 50%, transparent 90%);opacity:.65;pointer-events:none;height:1.5px;position:absolute;top:0;left:0;right:0}.KFXqYa_heroTop{justify-content:space-between;align-items:center;gap:24px;display:flex}.KFXqYa_heroMain{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_heroLabel{color:var(--ds-t-3);text-transform:uppercase;letter-spacing:.06em;white-space:nowrap;font-size:11px;font-weight:500;line-height:15px}.KFXqYa_heroReadout{align-items:baseline;gap:4px;display:flex}.KFXqYa_heroCurrency{font-family:var(--font-num);letter-spacing:-.01em;color:var(--ds-t-2);font-variant-numeric:tabular-nums;font-size:22px;font-weight:600;line-height:26px}.KFXqYa_heroValue{font-family:var(--font-num);letter-spacing:-.03em;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--ds-t-1);font-size:52px;font-weight:600;line-height:56px}.KFXqYa_heroMeta{color:var(--ds-t-2);white-space:nowrap;margin-top:2px;font-size:12px;line-height:16px}.KFXqYa_heroGauge{flex-direction:column;flex:none;align-items:center;gap:4px;width:96px;display:flex}.KFXqYa_heroGaugeDial{flex:none;width:96px;height:96px;position:relative}.KFXqYa_heroGaugeSvg{width:100%;height:100%;display:block;transform:rotate(-90deg)}.KFXqYa_heroGaugeTrack{fill:none;stroke:var(--dsb-3);stroke-width:7px}.KFXqYa_heroGaugeArc{fill:none;stroke:var(--ds-blue);stroke-width:7px;stroke-linecap:round;transition:stroke-dasharray var(--ds-t-fast)}.KFXqYa_heroGaugeArcOver{stroke:var(--ds-red)}.KFXqYa_heroPred{color:var(--ds-t-3);font-size:11px;font-family:var(--font-num);margin-left:8px}.KFXqYa_heroGaugeCenter{flex-direction:column;justify-content:center;align-items:center;gap:1px;display:flex;position:absolute;inset:0}.KFXqYa_heroGaugeRemain{font-family:var(--font-num);letter-spacing:-.02em;font-variant-numeric:tabular-nums;color:var(--ds-t-1);font-size:16px;font-weight:600;line-height:18px}.KFXqYa_heroGaugeRemainOver{color:var(--ds-red)}.KFXqYa_heroGaugeLabel{color:var(--ds-t-3);font-size:11px;line-height:13px}.KFXqYa_heroGaugeSub{font-family:var(--font-num);font-variant-numeric:tabular-nums;color:var(--ds-t-2);white-space:nowrap;font-size:10px;line-height:12px}.KFXqYa_heroSide{border-top:1px solid var(--ds-border);align-items:stretch;padding-top:12px;display:flex}.KFXqYa_heroSideItem{border-left:1px solid var(--ds-border);flex-direction:column;flex:1;gap:2px;min-width:0;padding-left:14px;display:flex}.KFXqYa_heroSideItem:first-child{border-left:none;padding-left:0}.KFXqYa_heroSideLabel{color:var(--ds-t-3);text-transform:uppercase;letter-spacing:.06em;white-space:nowrap;font-size:10px;font-weight:500;line-height:13px}.KFXqYa_heroSideValue{font-family:var(--font-num);color:var(--ds-t-1);font-variant-numeric:tabular-nums;letter-spacing:-.01em;white-space:nowrap;align-items:baseline;gap:6px;font-size:15px;font-weight:600;line-height:20px;display:inline-flex}.KFXqYa_heroSideSpacer{flex:1;display:block}.KFXqYa_delta{font-variant-numeric:tabular-nums;border-radius:999px;align-items:center;gap:2px;margin-left:6px;padding:1px 7px;font-size:10.5px;font-weight:600;line-height:16px;display:inline-flex}.KFXqYa_deltaUp{color:var(--ds-green);background:color-mix(in srgb, var(--ds-green) 12%, transparent)}.KFXqYa_deltaDown{color:var(--ds-red);background:color-mix(in srgb, var(--ds-red) 12%, transparent)}.KFXqYa_unpricedHint{border:1px solid color-mix(in srgb, var(--ds-amber) 30%, transparent);background:color-mix(in srgb, var(--ds-amber) 8%, transparent);color:var(--ds-amber);border-radius:8px;align-items:center;gap:8px;padding:8px 12px;font-size:11.5px;font-weight:500;line-height:17px;display:flex}.KFXqYa_unpricedHintBody{flex:1;min-width:0}.KFXqYa_noticeDismiss{width:18px;height:18px;color:inherit;opacity:.55;cursor:pointer;transition:opacity var(--ds-t-fast), background-color var(--ds-t-fast);background:0 0;border:0;border-radius:999px;flex:none;justify-content:center;align-items:center;padding:0;font-size:14px;line-height:1;display:inline-flex}.KFXqYa_noticeDismiss:hover,.KFXqYa_noticeDismiss:focus-visible{opacity:1;background:color-mix(in srgb, currentColor 14%, transparent);outline:none}.KFXqYa_kpiZone{flex-direction:column;gap:8px;display:flex}.KFXqYa_kpiZoneHead{justify-content:flex-end;align-items:center;gap:8px;display:flex}.KFXqYa_kpiZoneLabel{color:var(--ds-t-3);font-size:11px;line-height:14px}.KFXqYa_kpiCustomRange{flex-wrap:wrap;flex-shrink:0;justify-content:flex-end;align-items:center;gap:8px;display:flex}.KFXqYa_kpiCustomRange label{color:var(--ds-t-3);align-items:center;gap:6px;font-size:11px;line-height:14px;display:inline-flex}.KFXqYa_kpiCustomRange input{border:1px solid var(--ds-border);background:var(--dsb-glass);min-height:28px;color:var(--ds-t-1);color-scheme:light dark;font:inherit;font-family:var(--font-num);border-radius:6px;padding:3px 7px;font-size:11px}.KFXqYa_kpiCustomRange input:focus-visible{outline:2px solid var(--ds-blue);outline-offset:2px}.KFXqYa_kpiGrid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;display:grid}.KFXqYa_kpiTile{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);background:var(--dsb-glass);transition:border-color var(--ds-t-fast);flex-direction:column;gap:2px;padding:14px 16px;display:flex;position:relative;overflow:hidden}.KFXqYa_kpiTile:hover{border-color:var(--ds-border-strong)}.KFXqYa_kpiLabel{color:var(--ds-t-3);text-transform:uppercase;letter-spacing:.04em;font-size:11px;font-weight:500;line-height:14px}.KFXqYa_kpiValue{font-family:var(--font-num);color:var(--ds-t-1);font-variant-numeric:tabular-nums;letter-spacing:-.01em;margin-top:6px;font-size:22px;font-weight:600;line-height:26px}.KFXqYa_kpiGreen{color:var(--ds-green)}.KFXqYa_kpiDetail{font-family:var(--font-num);color:var(--ds-t-3);white-space:nowrap;text-overflow:ellipsis;font-size:11px;line-height:15px;overflow:hidden}.KFXqYa_kpiLabelRow{justify-content:space-between;align-items:center;gap:6px;display:flex}.KFXqYa_kpiDelta{font-size:10px;font-weight:600;font-family:var(--font-num);font-variant-numeric:tabular-nums;border-radius:999px;flex:none;align-items:center;gap:2px;padding:1px 5px;display:inline-flex}.KFXqYa_kpiDeltaUp{color:var(--ds-green);background:color-mix(in srgb, var(--ds-green) 14%, transparent)}.KFXqYa_kpiDeltaDown{color:var(--ds-red);background:color-mix(in srgb, var(--ds-red) 14%, transparent)}.KFXqYa_kpiDeltaFlat{color:var(--ds-t-3);background:var(--dsb-3)}.KFXqYa_kpiSpark{height:12px;margin-top:4px}.KFXqYa_panel{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);background:var(--dsb-glass);transition:border-color var(--ds-t-fast);flex-direction:column;gap:8px;padding:12px 14px;display:flex}.KFXqYa_panelHead{justify-content:space-between;align-items:baseline;gap:10px;display:flex}.KFXqYa_panelHeadControls{align-items:center;gap:8px;display:inline-flex}.KFXqYa_panelTitle{letter-spacing:-.005em;color:var(--ds-t-1);margin:0;font-size:13px;font-weight:600;line-height:20px}.KFXqYa_panelHint{color:var(--ds-t-3);white-space:nowrap;font-size:11px;line-height:16px}.KFXqYa_rangeToggle{border:1px solid var(--ds-border);background:var(--dsb-3);border-radius:8px;gap:2px;padding:2px;display:inline-flex}.KFXqYa_rangeButton{color:var(--ds-t-3);cursor:pointer;transition:background-color var(--ds-t-fast), color var(--ds-t-fast);background:0 0;border:none;border-radius:6px;padding:2px 8px;font-size:11px;line-height:16px}.KFXqYa_rangeButtonActive{background:var(--dsb-2);color:var(--ds-t-1);box-shadow:0 0 0 1px var(--ds-border-strong);font-weight:600}.KFXqYa_exportBar{justify-content:flex-end;align-items:center;gap:8px;display:flex}.KFXqYa_exportLabel{color:var(--ds-t-3);font-size:11px;line-height:16px}.KFXqYa_exportButton{border:1px solid var(--ds-border);color:var(--ds-t-2);cursor:pointer;transition:border-color var(--ds-t-fast), color var(--ds-t-fast), background-color var(--ds-t-fast);background:0 0;border-radius:999px;padding:4px 12px;font-size:11.5px;line-height:16px}.KFXqYa_exportButton:hover,.KFXqYa_exportButton:focus-visible{border-color:var(--ds-border-strong);color:var(--ds-t-1);outline:none}.KFXqYa_exportButton:disabled{opacity:.45;cursor:not-allowed}.KFXqYa_exportButton:disabled:hover{border-color:var(--ds-border);color:var(--ds-t-2)}.KFXqYa_shareTrack{background:var(--dsb-3);border-radius:4px;height:8px;display:flex;overflow:hidden}.KFXqYa_shareSeg{height:100%;transition:width var(--ds-t-fast)}.KFXqYa_shareSegPeak{background:var(--ds-blue)}.KFXqYa_shareSegOff{background:color-mix(in srgb, var(--ds-blue) 30%, var(--dsb-3))}.KFXqYa_shareSegUser{background:var(--ds-blue)}.KFXqYa_shareSegAssistant{background:var(--ds-green)}.KFXqYa_shareSegTool{background:var(--ds-amber)}.KFXqYa_shareLegend{align-items:center;gap:16px;display:flex}.KFXqYa_shareItem{color:var(--ds-t-2);align-items:baseline;gap:6px;font-size:11px;line-height:17px;display:inline-flex}.KFXqYa_bucketCost{font-variant-numeric:tabular-nums;align-items:baseline;gap:3px;display:inline-flex}.KFXqYa_bucketOfficial{color:var(--ds-blue);font-weight:600}.KFXqYa_bucketSep{color:var(--ds-t-4)}.KFXqYa_bucketThird{color:var(--ds-t-2)}.KFXqYa_shareDot{border-radius:2px;flex:none;align-self:center;width:8px;height:8px}.KFXqYa_shareValue{color:var(--ds-t-1);font-variant-numeric:tabular-nums;font-weight:600}.KFXqYa_budgetInput{width:64px;color:var(--ds-t-1);font-variant-numeric:tabular-nums;text-align:right;background:0 0;border:none;padding:0;font-size:12px;line-height:16px}.KFXqYa_budgetInput:focus-visible{outline:none}.KFXqYa_switch{border:1px solid var(--ds-border-strong);background:color-mix(in srgb, var(--ds-t-1) 10%, var(--dsb-3));cursor:pointer;width:32px;height:18px;transition:background-color var(--ds-t-fast), border-color var(--ds-t-fast);border-radius:999px;flex:none;padding:0;position:relative}.KFXqYa_switchOn{background:var(--ds-blue);border-color:#0000}.KFXqYa_switchKnob{width:12px;height:12px;box-shadow:0 0 0 1px var(--ds-border-strong);transition:transform var(--ds-t-fast);background:#fff;border-radius:50%;position:absolute;top:2px;left:2px}.KFXqYa_switchOn .KFXqYa_switchKnob{transform:translate(14px)}.KFXqYa_budgetFillWarn{background:var(--ds-amber)}.KFXqYa_budgetFillOver{background:var(--ds-red)}.KFXqYa_chartWrap{width:100%;position:relative}.KFXqYa_chartSvg{width:100%;height:auto;display:block}.KFXqYa_chartEmpty{height:140px;color:var(--ds-t-3);justify-content:center;align-items:center;font-size:13px;display:flex}.KFXqYa_emptyRow{text-align:center;color:var(--ds-t-3);padding:28px 0;font-size:13px}.KFXqYa_emptyState{border:1px dashed var(--ds-border);border-radius:var(--ds-r-2);background:color-mix(in srgb, var(--dsb-2) 50%, transparent);text-align:center;flex-direction:column;align-items:center;gap:10px;padding:32px 24px;display:flex}.KFXqYa_emptyIll{width:96px;height:64px;display:inline-block;position:relative}.KFXqYa_emptyIll svg{width:100%;height:100%;display:block}.KFXqYa_emptyIllDot{background:var(--ds-blue);border-radius:50%;width:6px;height:6px;animation:2s ease-in-out infinite KFXqYa_emptyDotPulse;position:absolute;bottom:8px;right:14px}@keyframes KFXqYa_emptyDotPulse{0%,to{box-shadow:0 0 0 4px color-mix(in srgb, var(--ds-blue) 20%, transparent)}50%{box-shadow:0 0 0 10px color-mix(in srgb, var(--ds-blue) 0%, transparent)}}.KFXqYa_emptyTitle{color:var(--ds-t-1);font-size:13px;font-weight:500}.KFXqYa_emptyDesc{color:var(--ds-t-3);max-width:320px;font-size:11.5px;line-height:1.5}.KFXqYa_chartGrid{stroke:var(--ds-border);stroke-width:1px}.KFXqYa_chartAxisLabel{fill:var(--ds-t-3);font-size:10px}.KFXqYa_chartBar{fill:var(--ds-blue);opacity:.7}.KFXqYa_chartBar:hover{opacity:1}.KFXqYa_chartStack{stroke:var(--dsb);stroke-width:.75px}.KFXqYa_chartStack:hover{opacity:.9}.KFXqYa_chartLine{stroke:var(--ds-blue);stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.KFXqYa_chartCrosshair{stroke:var(--ds-t-4);stroke-width:1px;stroke-dasharray:3 3}.KFXqYa_chartTooltip{pointer-events:none;z-index:2;border:1px solid var(--ds-border-strong);background:var(--dsb-2);box-shadow:var(--ds-shadow-1);white-space:nowrap;border-radius:8px;padding:8px 10px;position:absolute;transform:translate(-50%,calc(-100% - 10px))}.KFXqYa_chartTooltipAlignRight{transform:translate(calc(-100% - 8px),calc(-100% - 10px))}.KFXqYa_chartTooltipAlignLeft{transform:translate(8px,calc(-100% - 10px))}.KFXqYa_chartTooltipDate{color:var(--ds-t-1);margin-bottom:3px;font-size:11px;font-weight:600}.KFXqYa_chartTooltipRow{color:var(--ds-t-2);align-items:center;gap:5px;font-size:11px;line-height:17px;display:flex}.KFXqYa_chartTooltipRow strong{color:var(--ds-t-1);font-variant-numeric:tabular-nums;font-weight:600}.KFXqYa_chartTooltipHead{justify-content:space-between;align-items:baseline;gap:14px;margin-bottom:3px;display:flex}.KFXqYa_chartTooltipHead .KFXqYa_chartTooltipDate{margin-bottom:0}.KFXqYa_chartTooltipHead strong{color:var(--ds-t-1);font-variant-numeric:tabular-nums;font-size:11px;font-weight:600}.KFXqYa_chartTooltipSplit{justify-content:space-between;gap:14px}.KFXqYa_chartTooltipLabel{align-items:center;gap:5px;display:flex}.KFXqYa_chartTooltipModelDetail{color:var(--ds-t-3);font-variant-numeric:tabular-nums;margin:-2px 0 4px 13px;font-size:10.5px;line-height:14px}.KFXqYa_chartBarPlaceholder{fill:color-mix(in srgb, var(--ds-t-2) 30%, transparent)}.KFXqYa_chartLegendLine{background:var(--ds-blue);border-radius:2px;width:10px;height:3px;display:inline-block}.KFXqYa_chartLegendBar{background:var(--ds-blue);opacity:.5;border-radius:2px;width:7px;height:7px;display:inline-block}.KFXqYa_chartTooltipSwatch{border-radius:2px;flex:none;width:8px;height:8px;display:inline-block}.KFXqYa_chartLegend{color:var(--ds-t-2);justify-content:flex-end;gap:14px;margin-top:2px;font-size:11px;display:flex}.KFXqYa_chartLegend span{align-items:center;gap:5px;display:inline-flex}.KFXqYa_chartLegendItem{font:inherit;color:inherit;cursor:pointer;background:0 0;border:none;align-items:center;gap:5px;padding:0;transition:color .12s;display:inline-flex}.KFXqYa_chartLegendItem:hover{color:var(--ds-t-1)}.KFXqYa_chartLegendItemActive{color:var(--ds-t-1);font-weight:600}.KFXqYa_perfHero{grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:12px;display:grid;container:KFXqYa_billing-perf/inline-size}.KFXqYa_perfHeroCell{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);background:var(--dsb-glass);padding:12px 14px}.KFXqYa_perfHeroLbl{color:var(--ds-t-3);text-transform:uppercase;letter-spacing:.04em;font-size:10.5px;font-weight:500}.KFXqYa_perfHeroVal{font-family:var(--font-num);color:var(--ds-t-1);font-variant-numeric:tabular-nums;letter-spacing:-.01em;margin-top:4px;font-size:22px;font-weight:600;line-height:1.15}.KFXqYa_perfHeroUnit{color:var(--ds-t-3);margin-left:3px;font-size:11px;font-weight:500}.KFXqYa_perfHeroBar{background:var(--dsb-3);border-radius:2px;height:4px;margin-top:6px;position:relative;overflow:hidden}.KFXqYa_perfHeroBar i{height:100%;transition:width var(--ds-t-fast);border-radius:2px;display:block}@container KFXqYa_billing-perf (width<=480px){.KFXqYa_perfHero{grid-template-columns:1fr 1fr}}.KFXqYa_perfCompareList{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);background:var(--dsb-glass);margin-top:10px;overflow:hidden}.KFXqYa_perfCompareRow{border-bottom:1px solid var(--ds-border);grid-template-columns:1fr 80px 56px 56px;align-items:center;gap:12px;padding:8px 12px;font-size:12px;display:grid}.KFXqYa_perfCompareRow:last-child{border-bottom:0}.KFXqYa_perfCompareName{text-overflow:ellipsis;white-space:nowrap;align-items:center;gap:8px;min-width:0;font-weight:500;display:inline-flex;overflow:hidden}.KFXqYa_perfCompareDot{border-radius:2px;flex:none;width:8px;height:8px}.KFXqYa_perfCompareBar{background:var(--dsb-3);border-radius:3px;height:6px;position:relative;overflow:hidden}.KFXqYa_perfCompareBar i{height:100%;transition:width var(--ds-t-fast);border-radius:3px;display:block}.KFXqYa_perfCompareNum{font-family:var(--font-num);color:var(--ds-t-1);font-variant-numeric:tabular-nums;text-align:right;font-size:11.5px;font-weight:600}.KFXqYa_perfBar{align-items:center;margin:10px 0 2px;display:flex}.KFXqYa_perfChips{flex-wrap:wrap;gap:6px;margin:6px 0 2px;display:flex}.KFXqYa_perfChip{border:1px solid var(--ds-border);background:var(--dsb-3);color:var(--ds-t-2);cursor:pointer;transition:border-color var(--ds-t-fast), color var(--ds-t-fast), opacity var(--ds-t-fast);border-radius:999px;align-items:center;gap:5px;padding:2px 9px;font-size:11px;line-height:16px;display:inline-flex}.KFXqYa_perfChip:hover{color:var(--ds-t-1)}.KFXqYa_perfChipOff{opacity:.45}.KFXqYa_perfChipDot{border-radius:2px;flex:none;width:8px;height:8px;display:inline-block}.KFXqYa_chartHoverDot{stroke:var(--dsb-2);stroke-width:1.5px}.KFXqYa_tableScroll{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);overflow:auto}.KFXqYa_ubAlert{border:1px solid color-mix(in srgb, var(--ds-blue) 30%, transparent);border-radius:var(--ds-r-1);background:color-mix(in srgb, var(--ds-blue) 8%, transparent);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;padding:10px 14px;font-size:12px;line-height:17px;display:flex}.KFXqYa_ubAlertLeft{align-items:center;gap:8px;display:inline-flex}.KFXqYa_ubRate{color:var(--ds-t-1);font-variant-numeric:tabular-nums;font-weight:600}.KFXqYa_ubAlertNote{color:var(--ds-t-2);margin:0}.KFXqYa_ubTag,.KFXqYa_ubTagSuccess,.KFXqYa_ubTagNeutral,.KFXqYa_ubTagAlert,.KFXqYa_ubTagPromo{border:1px solid var(--ds-border-strong);white-space:nowrap;border-radius:999px;align-items:center;gap:4px;padding:1px 5px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_ubTag{color:var(--ds-t-2);background:var(--dsb-2)}.KFXqYa_ubTagSuccess{color:var(--ds-green);border-color:color-mix(in srgb, var(--ds-green) 36%, transparent);background:color-mix(in srgb, var(--ds-green) 12%, transparent)}.KFXqYa_ubTagNeutral{color:var(--ds-t-2);background:var(--dsb-2)}.KFXqYa_ubTagAlert{color:var(--ds-amber);border-color:color-mix(in srgb, var(--ds-amber) 36%, transparent);background:color-mix(in srgb, var(--ds-amber) 12%, transparent)}.KFXqYa_ubTagPromo{color:var(--ds-red);border-color:color-mix(in srgb, var(--ds-red) 36%, transparent);background:color-mix(in srgb, var(--ds-red) 12%, transparent);cursor:help}.KFXqYa_ubExtraRow td{opacity:.72;padding-top:2px;padding-bottom:2px;font-size:12px}.KFXqYa_ubExtraName{color:var(--ds-t-2);margin-left:26px}.KFXqYa_ubExtraNote{color:var(--ds-t-3);margin-left:8px;font-size:10px}.KFXqYa_ubCard{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);background:var(--dsb-glass);flex-direction:column;gap:12px;padding:16px 18px;display:flex}.KFXqYa_ubCardHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.KFXqYa_ubCardTitle{color:var(--ds-t-1);margin:0;font-size:13px;font-weight:600;line-height:18px}.KFXqYa_ubCardSub{color:var(--ds-t-3);font-size:11px;line-height:16px}.KFXqYa_ubTablewrap{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);overflow:auto}.KFXqYa_ubTablewrapPricing{overscroll-behavior:contain;max-height:min(56vh,520px)}.KFXqYa_ubTablewrapPricing .KFXqYa_ubTable thead th{z-index:1;background:var(--dsb-3);box-shadow:inset 0 -1px 0 var(--ds-border);position:sticky;top:0}.KFXqYa_ubTable{border-collapse:collapse;white-space:nowrap;width:100%;font-size:12px}.KFXqYa_ubTable th,.KFXqYa_ubTable td{border-bottom:1px solid var(--ds-border);text-align:left;color:var(--ds-t-1);padding:7px 9px}.KFXqYa_ubSearch{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);width:200px;max-width:45%;color:var(--ds-t-1);background:0 0;outline:none;align-self:center;margin-left:auto;padding:5px 9px;font-size:12px;line-height:18px}.KFXqYa_bandDots{flex:none;align-items:center;gap:5px;display:inline-flex}.KFXqYa_bandDot{cursor:pointer;background:0 0;border:1.5px solid;border-radius:999px;flex:none;width:9px;height:9px;padding:0}.KFXqYa_bandDotOn{background:currentColor}.KFXqYa_offPeak{color:var(--ds-blue)}.KFXqYa_soon{color:var(--ds-amber)}.KFXqYa_peak{color:var(--ds-red)}span.KFXqYa_bandDot{cursor:default}.KFXqYa_ubTable th,.KFXqYa_ubTable td:first-child{white-space:normal}.KFXqYa_ubTable tbody tr:last-child td{border-bottom:0}.KFXqYa_ubTable thead th,.KFXqYa_ubTable thead th.KFXqYa_numCol{color:var(--ds-t-3);text-transform:uppercase;letter-spacing:.04em;text-align:center;padding:6px 9px;font-size:11px;font-weight:500}.KFXqYa_ubModel{align-items:center;gap:6px;display:inline-flex}.KFXqYa_ubModelName{color:var(--ds-t-1);align-items:center;gap:4px;font-weight:500;display:inline-flex}.KFXqYa_ubChipPeak,.KFXqYa_ubChipOff{font-variant-numeric:tabular-nums;border-radius:999px;align-items:center;gap:4px;height:18px;padding:0 6px;font-size:11px;line-height:16px;display:inline-flex}.KFXqYa_ubChipLabel{font-size:10px;font-weight:600}.KFXqYa_ubChipPeak{background:color-mix(in srgb, var(--ds-blue) 12%, transparent);border:1px solid color-mix(in srgb, var(--ds-blue) 36%, transparent);color:var(--ds-blue)}.KFXqYa_ubChipOff{background:color-mix(in srgb, var(--ds-green) 12%, transparent);border:1px solid color-mix(in srgb, var(--ds-green) 36%, transparent);color:var(--ds-green)}.KFXqYa_ubNotes{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.KFXqYa_ubNotesItem{align-items:baseline;gap:10px;display:flex}.KFXqYa_ubNotesTerm{color:var(--ds-t-1);flex:0 0 72px;font-size:12px;font-weight:500}.KFXqYa_ubNotesDesc{min-width:0;color:var(--ds-t-2);flex:1;font-size:12px;line-height:17px}.KFXqYa_ubCardControlGroup{flex-wrap:wrap;align-items:center;gap:8px;display:inline-flex}.KFXqYa_ubTagError{white-space:nowrap;background:color-mix(in srgb, var(--ds-red) 12%, transparent);border:1px solid color-mix(in srgb, var(--ds-red) 36%, transparent);height:18px;color:var(--ds-red);border-radius:999px;align-items:center;padding:0 7px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_modelTable{border-collapse:collapse;table-layout:fixed;width:100%;min-width:640px;font-size:12px}.KFXqYa_modelTable th:first-child{width:26%}.KFXqYa_modelTable th,.KFXqYa_modelTable td{border-bottom:1px solid var(--ds-border);text-align:left;white-space:nowrap;color:var(--ds-t-1);padding:10px 12px}.KFXqYa_modelTable tbody tr:last-child td{border-bottom:0}.KFXqYa_sessionGroupRow{cursor:pointer}.KFXqYa_sessionGroupRow .KFXqYa_modelName:before{content:"›";color:var(--ds-t-3);margin-right:6px;display:inline-block}.KFXqYa_sessionGroupRow[aria-expanded=true] .KFXqYa_modelName:before{transform:rotate(90deg)}.KFXqYa_sessionGroupRow:focus-visible{outline:2px solid var(--ds-border-strong);outline-offset:-2px}.KFXqYa_sessionChildRow td:first-child{padding-left:30px}.KFXqYa_sessionSubDeepRow td:first-child{padding-left:46px}.KFXqYa_modelTable thead th{color:var(--ds-t-3);text-transform:uppercase;letter-spacing:.04em;background:0 0;padding:8px 12px;font-size:11px;font-weight:500}.KFXqYa_modelTable tbody tr{transition:background-color .12s}.KFXqYa_modelTable tbody tr:hover{background:0 0}.KFXqYa_modelTable tbody tr.KFXqYa_modelRowFocusable{cursor:pointer}.KFXqYa_modelTable tbody tr.KFXqYa_modelRowActive,.KFXqYa_modelTable tbody tr.KFXqYa_modelRowActive:hover{background:color-mix(in srgb, var(--ds-blue) 10%, transparent)}.KFXqYa_numCol{text-align:right;font-family:var(--mono);font-variant-numeric:tabular-nums}.KFXqYa_modelTable .KFXqYa_numCol,.KFXqYa_ubTable .KFXqYa_numCol{text-align:right}.KFXqYa_na{color:var(--ds-t-4)}.KFXqYa_unknownHint{color:var(--ds-t-4);margin:0 0 8px;font-size:12px;line-height:18px}.KFXqYa_modelCell{align-items:center;gap:8px;display:inline-flex}.KFXqYa_modelDot{border-radius:2px;flex:none;width:8px;height:8px}.KFXqYa_modelName{color:var(--ds-t-1);font-weight:500;line-height:16px;display:block}.KFXqYa_modelProvider{color:var(--ds-t-3);font-size:10.5px;line-height:14px;display:block}.KFXqYa_siteRow{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);background:var(--dsb-2);justify-content:space-between;align-items:center;gap:12px;padding:8px 10px;display:flex}.KFXqYa_siteRowName{align-items:center;gap:8px;min-width:0;display:inline-flex}.KFXqYa_siteKindTag{white-space:nowrap;border:1px solid #0000;border-radius:999px;flex:none;align-items:center;padding:2px 7px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_siteKindSite{color:var(--ds-blue);border-color:color-mix(in srgb, var(--ds-blue) 36%, transparent);background:color-mix(in srgb, var(--ds-blue) 12%, transparent)}.KFXqYa_siteKindDirect{color:var(--ds-green);border-color:color-mix(in srgb, var(--ds-green) 36%, transparent);background:color-mix(in srgb, var(--ds-green) 12%, transparent)}.KFXqYa_siteKindUnknown{color:var(--ds-red);border-color:color-mix(in srgb, var(--ds-red) 36%, transparent);background:color-mix(in srgb, var(--ds-red) 12%, transparent)}.KFXqYa_siteRowTitle{color:var(--ds-t-1);text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;line-height:18px;overflow:hidden}.KFXqYa_siteRowMeta{flex:none;align-items:center;gap:10px;display:inline-flex}.KFXqYa_siteRowCost{color:var(--ds-t-1);font-variant-numeric:tabular-nums;font-size:12.5px;font-weight:600;line-height:18px}.KFXqYa_siteRowCalls{color:var(--ds-t-2);font-variant-numeric:tabular-nums;font-size:11.5px;line-height:17px}.KFXqYa_siteRowCallsLow{color:var(--ds-red)}.KFXqYa_flatTag{color:var(--ds-t-3);font-size:10.5px;line-height:14px}.KFXqYa_healthDot{border-radius:50%;flex:none;width:6px;height:6px;display:inline-block}.KFXqYa_healthOk{background:var(--ds-green);box-shadow:0 0 0 3px color-mix(in srgb, var(--ds-green) 18%, transparent)}.KFXqYa_healthBad{background:var(--ds-red);box-shadow:0 0 0 3px color-mix(in srgb, var(--ds-red) 18%, transparent), 0 0 0 1px var(--ds-red) inset}.KFXqYa_healthIdle{border:1.5px solid var(--ds-t-4);background:0 0}.KFXqYa_dashboardRight{align-items:center;gap:8px;min-width:0;display:flex}.KFXqYa_healthBadge{white-space:nowrap;border-radius:999px;align-items:center;gap:6px;padding:3px 9px;font-size:11px;line-height:16px;display:inline-flex}.KFXqYa_healthBadgeOk{color:var(--ds-green);background:var(--dsb-2)}.KFXqYa_healthBadgeBad{color:var(--ds-red);background:var(--dsb-2)}.KFXqYa_planTag{color:var(--ds-green);white-space:nowrap;align-items:center;gap:4px;font-size:10px;font-weight:500;line-height:14px;display:inline-flex}.KFXqYa_planTagBadge{background:color-mix(in srgb, var(--ds-green) 20%, transparent);border-radius:4px;padding:0 4px;font-size:9px;line-height:12px}.KFXqYa_uncataloguedTag{border:1px solid color-mix(in srgb, var(--ds-amber) 36%, transparent);vertical-align:1px;color:var(--ds-amber);background:color-mix(in srgb, var(--ds-amber) 12%, transparent);border-radius:999px;margin-left:6px;padding:0 6px;font-size:10px;font-weight:600;line-height:16px;display:inline-block}.KFXqYa_estimatedTag{border:1px solid color-mix(in srgb, var(--ds-blue) 36%, transparent);vertical-align:1px;color:var(--ds-blue);background:color-mix(in srgb, var(--ds-blue) 12%, transparent);border-radius:999px;margin-left:6px;padding:0 6px;font-size:10px;font-weight:600;line-height:16px;display:inline-block}.KFXqYa_feeBar{border:1px solid var(--ds-border-strong);background:var(--dsb-glass-strong);backdrop-filter:blur(14px)saturate(1.3);color:var(--ds-t-2);font-size:11px;line-height:16px;font-family:var(--font-num);font-variant-numeric:tabular-nums;border-radius:999px;flex-wrap:wrap;align-items:center;gap:8px;padding:6px 12px;display:inline-flex}.KFXqYa_feeBarAbove{align-self:center}.KFXqYa_feeInline{font-variant-numeric:tabular-nums;white-space:nowrap;cursor:default;border-radius:999px;align-self:center;align-items:center;gap:5px;height:22px;padding:0 4px;font-size:11px;line-height:16px;display:inline-flex}.KFXqYa_feeInline .KFXqYa_feeChipPrimary,.KFXqYa_feeInline .KFXqYa_feeChipOff{height:18px;padding:0 7px}.KFXqYa_feeInlineNum{color:var(--ds-t-1);padding-right:6px;font-weight:600}.KFXqYa_feeInlineAlert{background:color-mix(in srgb, var(--ds-amber) 12%, transparent)}.KFXqYa_feeInlineAlert .KFXqYa_feeInlineNum{color:var(--ds-amber)}.KFXqYa_feeInlineError{background:color-mix(in srgb, var(--ds-red) 12%, transparent)}.KFXqYa_feeInlineError .KFXqYa_feeInlineNum{color:var(--ds-red)}.KFXqYa_feeBar .KFXqYa_feeSep{color:var(--ds-t-4)}.KFXqYa_feeCount{color:var(--ds-t-1);font-weight:600}.KFXqYa_feeSuffix{color:var(--ds-t-3)}.KFXqYa_feeItem{color:var(--ds-t-2);white-space:nowrap}.KFXqYa_feeNum{color:var(--ds-t-1);font-weight:600}.KFXqYa_feeNum[data-tick]{animation:KFXqYa_feeTickFlash var(--ds-t-pulse) ease-out 1}@keyframes KFXqYa_feeTickFlash{0%{text-shadow:0 0 0 color-mix(in srgb, var(--ds-blue) 0%, transparent)}30%{text-shadow:0 0 8px color-mix(in srgb, var(--ds-blue) 60%, transparent)}to{text-shadow:0 0 0 color-mix(in srgb, var(--ds-blue) 0%, transparent)}}.KFXqYa_feeSep{color:var(--ds-t-4)}.KFXqYa_feeChipPrimary,.KFXqYa_feeChipOff,.KFXqYa_feeChipAlert,.KFXqYa_feeChipError{border:1px solid var(--ds-border);background:var(--dsb-3);font-variant-numeric:tabular-nums;white-space:nowrap;border-radius:999px;align-items:center;height:20px;padding:0 8px;font-size:10px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_feeChipPrimary{color:var(--ds-blue);border-color:color-mix(in srgb, var(--ds-blue) 30%, transparent)}.KFXqYa_feeChipOff{color:var(--ds-cyan);border-color:color-mix(in srgb, var(--ds-cyan) 30%, transparent)}.KFXqYa_feeChipAlert{color:var(--ds-amber);border-color:color-mix(in srgb, var(--ds-amber) 30%, transparent)}.KFXqYa_feeChipError{color:var(--ds-red);border-color:color-mix(in srgb, var(--ds-red) 30%, transparent)}.KFXqYa_balanceCell{align-items:center;gap:6px;display:inline-flex;position:relative}.KFXqYa_providerGroupRecharge{border:1px solid color-mix(in srgb, var(--ds-c-1) 38%, transparent);background:color-mix(in srgb, var(--ds-c-1) 8%, transparent);color:var(--ds-c-1);white-space:nowrap;border-radius:999px;justify-content:center;align-items:center;min-width:48px;padding:1px 8px;font-size:10.5px;font-weight:600;line-height:16px;text-decoration:none;display:inline-flex}.KFXqYa_providerGroupRecharge:empty{background:0 0;border-color:#0000}.KFXqYa_providerGroupRecharge:hover{background:color-mix(in srgb, var(--ds-c-1) 15%, transparent);border-color:color-mix(in srgb, var(--ds-c-1) 60%, transparent)}.KFXqYa_balanceDaysBadge{border:1px solid var(--ds-border-strong);background:var(--dsb-2);min-width:16px;height:16px;color:var(--ds-t-2);cursor:pointer;border-radius:8px;justify-content:center;align-items:center;padding:0 4px;font-size:10px;font-weight:600;line-height:1;display:inline-flex}.KFXqYa_balanceDaysBadge:hover{border-color:var(--ds-t-3);color:var(--ds-t-1)}.KFXqYa_balanceDaysBadgeLow{color:var(--ds-red);border-color:color-mix(in srgb, var(--ds-red) 36%, transparent);background:color-mix(in srgb, var(--ds-red) 12%, transparent)}.KFXqYa_balanceDetailPop{z-index:20;background:var(--dsb-2);border:1px solid var(--ds-border-strong);min-width:180px;box-shadow:var(--ds-shadow-1);white-space:nowrap;border-radius:8px;flex-direction:column;gap:6px;padding:8px 10px;display:inline-flex;position:absolute;top:calc(100% + 6px);right:0}.KFXqYa_balanceDetailHead{justify-content:space-between;align-items:center;gap:12px;display:flex}.KFXqYa_balanceDetailTitle{color:var(--ds-t-1);font-size:12px;font-weight:600}.KFXqYa_balanceDetailClose{cursor:pointer;color:var(--ds-t-3);background:0 0;border:none;font-size:14px;line-height:1}.KFXqYa_balanceDetailClose:hover{color:var(--ds-t-1)}.KFXqYa_balanceDetailGrid{flex-direction:column;gap:4px;display:inline-flex}.KFXqYa_balanceDetailRow{color:var(--ds-t-2);font-variant-numeric:tabular-nums;justify-content:space-between;gap:16px;font-size:11px;line-height:15px;display:flex}.KFXqYa_balanceDetailLabel{color:var(--ds-t-3)}.KFXqYa_balanceDetailValue{color:var(--ds-t-1);font-weight:500}.KFXqYa_currencyToggle{background:var(--dsw-alias-bg-layer-3);border:none;border-radius:8px;align-items:center;gap:2px;margin-right:8px;padding:2px;display:inline-flex}.KFXqYa_currencyButton{color:var(--dsw-alias-label-secondary);white-space:nowrap;cursor:pointer;background:0 0;border:0;border-radius:6px;padding:4px 8px;font-size:11px;font-weight:700;line-height:1}.KFXqYa_currencyButtonActive{background:var(--dsb-2);color:var(--dsw-alias-label-primary);box-shadow:0 0 0 1px var(--ds-border-strong)}.KFXqYa_subscriptionGrid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px;margin-top:10px;display:grid}.KFXqYa_subscriptionCard{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);background:var(--dsb-glass);-webkit-backdrop-filter:blur(12px)saturate(1.3);transition:border-color var(--ds-t-fast);padding:14px 16px;position:relative;overflow:hidden}.KFXqYa_subscriptionCardUpgraded{border-color:color-mix(in srgb, var(--ds-blue) 30%, transparent);border-radius:var(--ds-r-3);background:linear-gradient(135deg, color-mix(in srgb, var(--ds-blue) 8%, transparent), transparent 60%), var(--dsb-glass);-webkit-backdrop-filter:blur(12px)saturate(1.4);padding:16px 18px}.KFXqYa_subscriptionCardUpgraded:after{content:"";background:linear-gradient(90deg, transparent 10%, var(--ds-blue) 50%, transparent 90%);opacity:.7;pointer-events:none;height:1.5px;position:absolute;top:0;left:0;right:0}.KFXqYa_subscriptionCardUpgraded .KFXqYa_subscriptionPct{font-size:18px;font-weight:600}.KFXqYa_subscriptionHead{flex-wrap:wrap;align-items:baseline;gap:6px;margin-bottom:8px;display:flex}.KFXqYa_subscriptionName{color:var(--ds-t-1);font-size:13px;font-weight:600}.KFXqYa_subscriptionPlan{color:var(--ds-t-2);font-size:11px}.KFXqYa_subscriptionPlan[data-kind=code],.KFXqYa_subscriptionPlan[data-kind=token]{color:var(--ds-t-2);background:var(--dsb-3);border-radius:999px;padding:1px 8px;font-weight:500}.KFXqYa_subscriptionTier{color:var(--ds-t-3);margin-left:6px}.KFXqYa_subscriptionAuto{border:1px solid color-mix(in srgb, var(--ds-blue) 36%, transparent);color:var(--ds-blue);background:color-mix(in srgb, var(--ds-blue) 12%, transparent);border-radius:999px;margin-left:6px;padding:1px 6px;font-size:10px}.KFXqYa_subscriptionStatus{color:var(--ds-t-2);margin-bottom:6px;font-size:11px}.KFXqYa_subscriptionWindow{align-items:center;gap:10px;margin-top:8px;font-size:11px;display:flex}.KFXqYa_subscriptionWindowLabel{color:var(--ds-t-3);flex:0 0 44px}.KFXqYa_subscriptionTrack{background:var(--dsb-3);height:6px;box-shadow:inset 0 0 0 1px var(--ds-border);border-radius:3px;flex:1;overflow:hidden}.KFXqYa_subscriptionFill{background:var(--ds-blue);height:calc(100% - 2px);transition:width var(--ds-t-fast);border-radius:2px;margin:1px;display:block}.KFXqYa_subscriptionFillWarn{background:var(--ds-amber)}.KFXqYa_subscriptionFillOver{background:var(--ds-red)}.KFXqYa_subscriptionMeta{flex-direction:column;flex:none;align-items:flex-end;gap:2px;display:flex}.KFXqYa_subscriptionPct{text-align:right;min-width:52px;font-family:var(--mono);font-variant-numeric:tabular-nums;color:var(--ds-t-1);flex:none}.KFXqYa_subscriptionExhausted{color:var(--ds-red);min-width:52px;font-weight:600}.KFXqYa_subscriptionReset{color:var(--ds-t-3);white-space:nowrap;flex:none;font-size:10px}.KFXqYa_providerGroupList{flex-direction:column;gap:10px;display:flex}.KFXqYa_providerGroup{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);background:var(--dsb-glass);padding:12px 14px;container:KFXqYa_billing-pg/inline-size}.KFXqYa_providerStatRow{border-radius:var(--ds-r-1);background:var(--dsb-2);border:1px solid var(--ds-border);grid-template-columns:repeat(4,1fr);gap:10px;margin-top:10px;padding:10px 12px;display:grid}.KFXqYa_providerStatCell{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_providerStatLbl{color:var(--ds-t-3);text-transform:uppercase;letter-spacing:.04em;font-size:10.5px;font-weight:500}.KFXqYa_providerStatVal{font-family:var(--font-num);color:var(--ds-t-1);font-variant-numeric:tabular-nums;letter-spacing:-.01em;white-space:nowrap;text-overflow:ellipsis;font-size:16px;font-weight:600;overflow:hidden}.KFXqYa_providerStatSub{font-family:var(--font-num);color:var(--ds-t-3);font-size:10.5px}@container KFXqYa_billing-pg (width<=480px){.KFXqYa_providerStatRow{grid-template-columns:1fr 1fr}}.KFXqYa_providerGroupHead{justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:10px;display:flex}.KFXqYa_providerGroupCollapsible{cursor:pointer}.KFXqYa_providerGroupCollapsible .KFXqYa_providerGroupTitle:before{content:"›";color:var(--ds-t-3);margin-right:6px;display:inline-block}.KFXqYa_providerGroupCollapsible[aria-expanded=true] .KFXqYa_providerGroupTitle:before{transform:rotate(90deg)}.KFXqYa_providerGroupCollapsible:focus-visible{outline:2px solid var(--ds-border-strong);outline-offset:2px;border-radius:6px}.KFXqYa_providerCtlRow{align-items:center;gap:12px;margin-bottom:10px;display:flex}.KFXqYa_providerTodayToggle{color:var(--ds-t-3);align-items:center;gap:7px;font-size:11px;display:inline-flex}.KFXqYa_providerGroupTitle{align-items:center;gap:7px;min-width:0;display:inline-flex}.KFXqYa_kindBadge{border:1px solid color-mix(in srgb, var(--ds-c-1) 32%, transparent);background:color-mix(in srgb, var(--ds-c-1) 10%, transparent);color:var(--ds-c-1);border-radius:4px;flex:none;padding:1px 6px;font-size:10px;font-weight:600;line-height:15px}.KFXqYa_kindBadgeRelay{border-color:color-mix(in srgb, var(--ds-c-2) 32%, transparent);background:color-mix(in srgb, var(--ds-c-2) 10%, transparent);color:var(--ds-c-2)}.KFXqYa_kindBadgeUnknown{border-color:var(--ds-border);background:color-mix(in srgb, var(--ds-t-3) 12%, transparent);color:var(--ds-t-3)}.KFXqYa_providerGroupName{color:var(--ds-t-1);font-size:13px;font-weight:600;line-height:18px}.KFXqYa_providerGroupMeta{flex:none;align-items:center;gap:10px;display:inline-flex}.KFXqYa_providerGroupBadge{border:1px solid color-mix(in srgb, var(--ds-green) 36%, transparent);color:var(--ds-green);background:color-mix(in srgb, var(--ds-green) 12%, transparent);border-radius:999px;justify-content:center;align-items:center;padding:1px 8px;font-size:10px;font-weight:500;line-height:16px;display:inline-flex}.KFXqYa_providerGroupBalance,.KFXqYa_providerGroupCost{color:var(--ds-t-2);font-variant-numeric:tabular-nums;white-space:nowrap;justify-content:flex-end;align-items:baseline;gap:6px;min-width:118px;font-size:12px;line-height:17px;display:inline-flex}.KFXqYa_providerGroupCostLabel{font-size:11px}.KFXqYa_providerGroupCostValue{color:var(--ds-t-1);text-align:right;min-width:56px;font-weight:600}.KFXqYa_providerGroupBalanceLabel{color:var(--ds-t-3);font-size:11px;line-height:17px}.KFXqYa_rounds{margin-top:10px}.KFXqYa_roundsBars{align-items:flex-end;gap:3px;height:124px;padding:16px 2px 0;display:flex;overflow-x:auto}.KFXqYa_roundsBarCol{border-radius:5px 5px 0 0;flex-direction:column;flex:1 0 28px;justify-content:flex-end;align-items:stretch;height:100%;display:flex;position:relative}.KFXqYa_roundsBarColPeak{background:color-mix(in srgb, var(--ds-amber) 16%, transparent)}.KFXqYa_roundsBarColOff{background:var(--dsb-3)}.KFXqYa_roundsBarLabel{text-align:center;color:var(--ds-t-2);white-space:nowrap;text-overflow:ellipsis;max-width:100%;font-size:9px;line-height:1.2;position:absolute;bottom:0;left:0;right:0;overflow:hidden;transform:translateY(-100%)}.KFXqYa_roundsBarWrap{flex:1;align-items:flex-end;min-height:0;display:flex}.KFXqYa_roundsBar{background:var(--ds-blue);border-radius:2px 2px 0 0;width:100%;min-height:2px;position:relative}.KFXqYa_roundsBarFlagged{background:var(--ds-red);border-radius:2px 2px 0 0;width:100%;min-height:2px;position:relative}.KFXqYa_roundsFlagMark{background:var(--ds-red);border-radius:50%;width:7px;height:7px;position:absolute;top:-3px;right:-3px}.KFXqYa_roundsAxis{color:var(--ds-t-3);justify-content:space-between;margin-top:6px;font-size:10px;display:flex}.KFXqYa_roundsEmpty{color:var(--ds-t-2);margin-top:10px;font-size:12px}.KFXqYa_heatmap{margin-top:10px}.KFXqYa_heatmapGrid{grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;display:grid}.KFXqYa_heatmapCellEmpty{box-sizing:border-box;border:1px dashed var(--ds-border);height:30px;color:var(--ds-t-4);font-variant-numeric:tabular-nums;background:0 0;border-radius:2px;justify-content:center;align-items:center;font-size:11px;display:flex}.KFXqYa_heatmapCell{font-variant-numeric:tabular-nums;cursor:pointer;border:0;border-radius:2px;justify-content:center;align-items:center;height:30px;padding:0;font-size:11px;display:flex}.KFXqYa_heatmapCell[data-level="0"],.KFXqYa_heatmapCell[data-level="1"],.KFXqYa_heatmapCell[data-level="2"]{color:var(--dsw-alias-label-primary)}.KFXqYa_heatmapCell[data-level="3"],.KFXqYa_heatmapCell[data-level="4"]{color:var(--dsw-static-neutral-bluish-00)}.KFXqYa_heatmapCell[data-today=true],.KFXqYa_heatmapYearCell[data-today=true]{outline:1.5px solid color-mix(in srgb, var(--ds-amber) 70%, transparent);outline-offset:1px;z-index:1}.KFXqYa_heatmapFooter{color:var(--dsw-alias-label-secondary);align-items:center;gap:8px;margin-top:10px;font-size:10px;display:flex}.KFXqYa_heatmapLegend{gap:3px;display:inline-flex}.KFXqYa_heatmapLegend i{border-radius:2px;width:14px;height:14px;display:block}.KFXqYa_heatmapHover{font-family:var(--font-num);font-variant-numeric:tabular-nums;margin-left:auto}.KFXqYa_heatmapRangeSwitch{gap:4px;margin-left:auto;display:inline-flex}.KFXqYa_heatmapRangeButton{border:1px solid var(--ds-border);color:var(--ds-t-2);cursor:pointer;background:0 0;border-radius:6px;padding:2px 8px;font-size:11px;line-height:1.4}.KFXqYa_heatmapRangeButtonActive{background:var(--dsb-2);border-color:var(--ds-border-strong);color:var(--ds-t-1);box-shadow:0 0 0 1px var(--ds-border-strong);font-weight:600}.KFXqYa_heatmapYear{flex-direction:column;gap:6px;display:flex}.KFXqYa_heatmapYearBody{align-items:flex-start;gap:6px;display:flex}.KFXqYa_heatmapYearWeekdays{color:var(--ds-t-3);flex:none;grid-template-rows:repeat(7,11px);gap:3px;padding-top:12px;font-size:9px;line-height:11px;display:grid}.KFXqYa_heatmapYearWeekday{white-space:nowrap;text-align:right;height:11px}.KFXqYa_heatmapYearMonths{min-width:max-content;color:var(--ds-t-3);grid-template-columns:repeat(52,11px);gap:3px;font-size:9px;line-height:12px;display:grid;overflow:visible}.KFXqYa_heatmapYearMonth{white-space:nowrap;overflow:visible}.KFXqYa_heatmapYearScroll{padding-bottom:2px;overflow-x:auto}.KFXqYa_heatmapYearGrid{grid-template-rows:repeat(7,11px);grid-auto-flow:column;gap:3px;min-width:max-content;display:grid}.KFXqYa_heatmapYearCell{cursor:pointer;border:0;border-radius:2px;width:11px;height:11px;padding:0}.KFXqYa_heatmapHalf .KFXqYa_heatmapYearWeekdays{grid-template-rows:repeat(7,16px);line-height:16px}.KFXqYa_heatmapHalf .KFXqYa_heatmapYearWeekday{height:16px}.KFXqYa_heatmapHalf .KFXqYa_heatmapYearMonths{grid-template-columns:repeat(26,16px)}.KFXqYa_heatmapHalf .KFXqYa_heatmapYearGrid{grid-template-rows:repeat(7,16px)}.KFXqYa_heatmapHalf .KFXqYa_heatmapYearCell{border-radius:3px;width:16px;height:16px}.KFXqYa_floatSub{flex-direction:column;gap:6px;min-width:0;display:flex}.KFXqYa_floatSubHead{flex-wrap:wrap;align-items:baseline;gap:6px;min-width:0;display:flex}.KFXqYa_floatSubName{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:700}.KFXqYa_floatSubPlan{color:var(--dsw-alias-label-secondary);font-size:10px}.KFXqYa_floatSub .KFXqYa_subscriptionWindow{flex-wrap:wrap;gap:4px 10px}.KFXqYa_floatSub .KFXqYa_subscriptionWindowLabel{flex:none}.KFXqYa_floatSub .KFXqYa_subscriptionMeta{min-width:0;max-width:100%}.KFXqYa_floatSub .KFXqYa_subscriptionPct{min-width:0}.KFXqYa_floatSub .KFXqYa_subscriptionReset{white-space:normal;overflow-wrap:anywhere}.KFXqYa_triggerPopEmpty{color:var(--dsw-alias-label-tertiary);padding:2px 0;font-size:11px;line-height:1.5}.KFXqYa_triggerPopSwitcher{justify-content:flex-end;align-items:center;gap:8px;margin-top:2px;display:flex}.KFXqYa_triggerPopSwitchCount{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:10px}.KFXqYa_floatModeBtn{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 75%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 60%, transparent);color:var(--dsw-alias-label-secondary);white-space:nowrap;cursor:pointer;border-radius:10px;flex:1;padding:7px 10px;font-size:12px}.KFXqYa_floatModeBtnOn{border-color:var(--ds-blue);color:var(--dsw-alias-label-primary);background:color-mix(in srgb, var(--ds-blue) 16%, transparent)}.KFXqYa_floatModeBtn:disabled{opacity:.45;cursor:not-allowed}.KFXqYa_rdoRow{justify-content:space-between;align-items:center;gap:8px;margin-top:10px;display:flex}.KFXqYa_rdoLabel{color:var(--dsw-alias-label-secondary);font-size:12px}.KFXqYa_rdoSelect{border:1px solid color-mix(in srgb, var(--dsw-alias-border-l1) 75%, transparent);background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 60%, transparent);color:var(--dsw-alias-label-primary);white-space:nowrap;cursor:pointer;border-radius:10px;align-items:center;gap:5px;padding:5px 8px 5px 10px;font-size:12px;display:inline-flex}.KFXqYa_rdoSelect:hover{background:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 85%, transparent)}.KFXqYa_rdoSelect:focus-visible{border-color:var(--ds-blue);outline:none}.KFXqYa_rdoChevron{color:var(--dsw-alias-label-tertiary);transition:transform .15s;display:inline-flex}.KFXqYa_rdoChevronOpen{transform:rotate(180deg)}.KFXqYa_floatTarget{color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:5px;font-size:12px;display:inline-flex}.KFXqYa_floatTargetLabel{color:var(--dsw-alias-label-secondary)}.KFXqYa_staleNotice{color:var(--ds-amber);background:color-mix(in srgb, var(--ds-amber) 12%, transparent);border:1px solid color-mix(in srgb, var(--ds-amber) 30%, transparent);border-radius:10px;align-items:center;gap:6px;margin:0 0 10px;padding:8px 10px;font-size:11px;display:flex}.KFXqYa_staleNoticeBody{flex:1;min-width:0}.KFXqYa_staleNoticeSub{margin-top:4px;display:block}.KFXqYa_plgHead{align-items:flex-start;gap:12px;display:flex}.KFXqYa_plgIcon{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);width:40px;height:40px;color:var(--dsw-alias-label-secondary);border-radius:10px;flex:none;justify-content:center;align-items:center;display:inline-flex}.KFXqYa_plgTitle{flex-direction:column;gap:4px;min-width:0;display:flex}.KFXqYa_plgNameRow{align-items:center;gap:8px;display:flex}.KFXqYa_plgName{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:600;line-height:18px}.KFXqYa_plgTag{height:18px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-3);white-space:nowrap;border-radius:5px;align-items:center;padding:0 6px;font-size:10px;font-weight:600;display:inline-flex}.KFXqYa_plgDesc{color:var(--dsw-alias-label-secondary);margin:0;font-size:11px;line-height:16px}.KFXqYa_plgGrid{border-top:1px solid var(--dsw-alias-border-l1);grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding-top:12px;display:grid}.KFXqYa_plgItem{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_plgLabel{color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:14px}.KFXqYa_plgVal{color:var(--dsw-alias-label-primary);word-break:break-all;font-size:12px;line-height:17px}.KFXqYa_plgLink{color:var(--ds-blue);word-break:break-all;font-size:12px;line-height:17px;text-decoration:none}.KFXqYa_plgLink:hover{text-decoration:underline}.KFXqYa_tokenPanel{flex-direction:column;gap:14px;display:flex}.KFXqYa_tokenModelBar{background:var(--dsw-alias-bg-layer-2);border-radius:999px;height:8px;overflow:hidden}.KFXqYa_tokenModelParts{height:100%;display:flex}.KFXqYa_tokenModelPartIn{background:var(--ds-blue)}.KFXqYa_tokenModelPartOut{background:var(--ds-amber)}.KFXqYa_tokenModelShareRow{align-items:center;gap:6px;display:inline-flex}@media (width<=640px){.KFXqYa_kpiGrid{grid-template-columns:repeat(2,minmax(0,1fr))}.KFXqYa_hero{gap:14px}.KFXqYa_heroTop{flex-direction:column;align-items:flex-start;gap:12px}.KFXqYa_heroGauge{width:72px;height:72px}.KFXqYa_heroSide{gap:12px}.KFXqYa_heroSideSpacer{display:none}}.KFXqYa_peakCard{z-index:2000;border-radius:var(--ds-r-2);border:1px solid var(--ds-border-strong);background:var(--dsb-glass-strong);-webkit-backdrop-filter:blur(14px)saturate(1.2);min-width:280px;max-width:380px;box-shadow:var(--ds-shadow-2);animation:KFXqYa_peakAlertIn var(--ds-t-fast);flex-direction:column;gap:12px;padding:14px 16px;display:flex;position:fixed}.KFXqYa_peakCardCorner{bottom:18px;right:18px}.KFXqYa_peakCardCenter{top:20%;left:50%;transform:translate(-50%)}.KFXqYa_peakCardPeak{color:var(--ds-blue)}.KFXqYa_peakCardOff{color:var(--ds-cyan)}.KFXqYa_peakHead{justify-content:space-between;align-items:center;gap:8px;display:flex}.KFXqYa_peakTag{white-space:nowrap;border-radius:6px;align-items:center;gap:6px;height:20px;padding:0 8px;font-size:11px;font-weight:600;line-height:14px;display:inline-flex}.KFXqYa_peakTagPrimary{background:var(--dsw-alias-bg-layer-3);color:var(--ds-blue)}.KFXqYa_peakTagSuccess{background:var(--dsw-alias-bg-layer-3);color:var(--ds-cyan)}.KFXqYa_peakDot{border-radius:999px;flex:none;width:6px;height:6px}.KFXqYa_peakDotPrimary{background:var(--ds-blue)}.KFXqYa_peakDotSuccess{background:var(--ds-cyan)}.KFXqYa_peakClose{width:24px;height:24px;color:var(--ds-t-3);cursor:pointer;transition:background-color var(--ds-t-fast), color var(--ds-t-fast);background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;font-size:15px;line-height:1;display:inline-flex}.KFXqYa_peakClose:hover{color:var(--ds-t-1);background:var(--dsw-alias-bg-layer-2)}.KFXqYa_peakCount{font-family:var(--font-num);font-variant-numeric:tabular-nums;font-size:28px;font-weight:600;line-height:1}.KFXqYa_peakCountPrimary{color:var(--ds-blue)}.KFXqYa_peakCountSuccess{color:var(--ds-cyan)}.KFXqYa_peakDesc{color:var(--ds-t-1);margin:4px 0 0;font-size:12px;line-height:18px}@keyframes KFXqYa_peakAlertIn{0%{opacity:0}to{opacity:1}}.KFXqYa_settingsLayout{grid-template-columns:120px 1fr;gap:14px;display:grid;container:KFXqYa_billing-settings/inline-size}.KFXqYa_settingsNav{border-right:1px solid var(--ds-border);flex-direction:column;align-self:start;gap:2px;max-height:min(720px,88vh - 80px);padding-right:14px;display:flex;position:sticky;top:0;overflow-y:auto}.KFXqYa_settingsNavItem{color:var(--ds-t-2);cursor:pointer;text-align:left;transition:background-color var(--ds-t-fast), color var(--ds-t-fast);background:0 0;border:0;border-radius:6px;align-items:center;gap:6px;padding:6px 8px;font-family:inherit;font-size:11.5px;display:flex}.KFXqYa_settingsNavItem:hover{background:var(--dsb-3);color:var(--ds-t-1)}.KFXqYa_settingsNavItem:focus-visible{box-shadow:0 0 0 1.5px var(--ds-border-strong);outline:none}.KFXqYa_settingsNavItemActive{background:color-mix(in srgb, var(--ds-blue) 14%, transparent);color:var(--ds-t-1);font-weight:600}.KFXqYa_settingsNavIcon{width:12px;height:12px;color:var(--ds-t-3);justify-content:center;align-items:center;display:inline-flex}.KFXqYa_settingsNavItemActive .KFXqYa_settingsNavIcon{color:var(--ds-blue)}.KFXqYa_settingsNavIcon svg{width:12px;height:12px}.KFXqYa_settingsNavItemAdvanced .KFXqYa_settingsNavIcon{color:var(--ds-violet)}.KFXqYa_settingsPane{flex-direction:column;gap:12px;min-width:0;display:flex}@container KFXqYa_billing-settings (width<=540px){.KFXqYa_settingsLayout{grid-template-columns:1fr}.KFXqYa_settingsNav{border-right:none;border-bottom:1px solid var(--ds-border);flex-flow:wrap;max-height:none;padding-bottom:10px;padding-right:0;position:static}}.KFXqYa_densityRow{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);background:var(--dsb-2);justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}.KFXqYa_densityRow+.KFXqYa_densityRow{margin-top:8px}.KFXqYa_densityLeft{flex-direction:column;gap:2px;min-width:0;display:flex}.KFXqYa_densityLeft strong{font-size:12.5px;font-weight:500}.KFXqYa_densityLeft span{color:var(--ds-t-3);font-size:11px}.KFXqYa_densityButtons{border:1px solid var(--ds-border);background:var(--dsb-3);border-radius:8px;align-items:center;gap:4px;padding:2px;display:inline-flex}.KFXqYa_densityButton{color:var(--ds-t-2);cursor:pointer;transition:background-color var(--ds-t-fast), color var(--ds-t-fast);background:0 0;border:0;border-radius:6px;padding:4px 10px;font-family:inherit;font-size:11px}.KFXqYa_densityButton:hover{color:var(--ds-t-1)}.KFXqYa_densityButtonActive{background:var(--dsb-2);color:var(--ds-t-1);box-shadow:0 0 0 1px var(--ds-border-strong);font-weight:600}.KFXqYa_densityButtonComfortable.KFXqYa_densityButtonActive{background:var(--ds-violet-bg);color:var(--ds-violet);box-shadow:0 0 0 1px var(--ds-violet-strong)}.KFXqYa_setCard{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);background:var(--dsb-glass);flex-direction:column;gap:12px;padding:16px 18px;display:flex}.KFXqYa_setGrid3,.KFXqYa_setGrid2{gap:10px;display:grid}.KFXqYa_setGrid3{grid-template-columns:repeat(3,minmax(0,1fr))}.KFXqYa_setGrid2{grid-template-columns:repeat(2,minmax(0,1fr))}@media (width<=720px){.KFXqYa_setGrid3,.KFXqYa_setGrid2{grid-template-columns:1fr}}.KFXqYa_setCell{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);flex-direction:column;gap:8px;min-width:0;padding:12px 14px;display:flex}.KFXqYa_setCardHead{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.KFXqYa_setCardMeta{flex-direction:column;gap:4px;min-width:0;display:flex}.KFXqYa_setCardTitle{color:var(--ds-t-1);margin:0;font-size:13px;font-weight:600;line-height:18px}.KFXqYa_setCardDesc{color:var(--ds-t-3);margin:0;font-size:11px;line-height:16px}.KFXqYa_ctlCol{flex-direction:column;gap:10px;padding-top:2px;display:flex}.KFXqYa_ctlRow{align-items:center;gap:12px;min-height:28px;display:flex}.KFXqYa_ctlRowStretch{display:flex}.KFXqYa_ctlLabel{color:var(--ds-t-3);flex:0 0 96px;font-size:11px;line-height:16px}.KFXqYa_ctlGroup{flex-wrap:wrap;align-items:center;gap:8px;display:inline-flex}.KFXqYa_userPriceRow{border-bottom:1px solid var(--ds-border);align-items:center;gap:10px;padding:8px 0;display:flex}.KFXqYa_userPriceCheck{width:14px;height:14px;accent-color:var(--ds-blue);flex:none;margin:0}.KFXqYa_userPriceBody{flex-direction:column;flex:1;gap:8px;min-width:0;display:flex}.KFXqYa_userPriceLineMeta{grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) auto;align-items:end;gap:8px 10px;display:grid}@media (width<=720px){.KFXqYa_userPriceLineMeta{grid-template-columns:repeat(2,minmax(0,1fr))}}.KFXqYa_userPriceLineMeta .KFXqYa_userPriceInput{box-sizing:border-box;width:100%;min-width:0;max-width:none}.KFXqYa_userPriceBody .KFXqYa_ctlGroup{flex-wrap:nowrap}.KFXqYa_userPriceLineMeta .KFXqYa_userPriceField .KFXqYa_ctlLabel{align-items:flex-end;min-height:30px;display:flex}.KFXqYa_userPricePriceLine{border-left:2px solid var(--ds-amber);flex-wrap:wrap;align-items:center;gap:10px;width:calc(100% - 22px);margin-left:10px;padding:2px 0 6px 12px;display:flex}.KFXqYa_userPricePriceLine>.KFXqYa_ctlLabel{color:var(--ds-t-3);flex:0 0 44px;font-size:11px}.KFXqYa_userPricePriceLine .KFXqYa_userPriceInputNum{box-sizing:border-box;flex:1 1 0;width:auto;min-width:120px;max-width:240px}.KFXqYa_userPriceField{flex-direction:column;gap:4px;min-width:0;display:flex}.KFXqYa_userPriceField .KFXqYa_ctlLabel{flex:none;font-size:11px}.KFXqYa_userPriceInput,.KFXqYa_userPriceInputNum{border:1px solid var(--ds-border);background:var(--dsb-3);min-width:96px;max-width:160px;color:var(--ds-t-1);border-radius:6px;padding:4px 8px;font-size:12px;line-height:16px}.KFXqYa_userPriceInputNum{min-width:72px;max-width:88px}.KFXqYa_rdo{color:var(--ds-t-2);cursor:pointer;white-space:nowrap;align-items:center;gap:6px;font-size:12px;line-height:16px;display:inline-flex}.KFXqYa_rdo input{opacity:0;pointer-events:none;position:absolute}.KFXqYa_rdoDot{border:1px solid var(--ds-border-strong);background:var(--dsb-3);border-radius:50%;flex:none;width:14px;height:14px;position:relative}.KFXqYa_rdo input:checked+.KFXqYa_rdoDot{border-color:var(--ds-blue)}.KFXqYa_rdo input:checked+.KFXqYa_rdoDot:after{content:"";background:var(--ds-blue);border-radius:50%;position:absolute;inset:3px}.KFXqYa_inp{border:1px solid var(--ds-border);background:var(--dsb-3);border-radius:6px;align-items:center;gap:4px;padding:2px 6px;display:inline-flex}.KFXqYa_affix{color:var(--ds-t-3);font-size:11px;line-height:16px}.KFXqYa_prog{background:var(--dsb-3);min-width:0;height:6px;box-shadow:inset 0 0 0 1px var(--ds-border);border-radius:3px;flex:1;overflow:hidden}.KFXqYa_progFill{background:var(--ds-blue);height:calc(100% - 2px);transition:width var(--ds-t-fast);border-radius:2px;margin:1px}.KFXqYa_btn{border:1px solid var(--ds-border);height:28px;color:var(--ds-t-2);cursor:pointer;transition:border-color var(--ds-t-fast), color var(--ds-t-fast), background-color var(--ds-t-fast);background:0 0;border-radius:999px;align-items:center;gap:6px;padding:0 12px;font-size:12px;line-height:16px;display:inline-flex}.KFXqYa_btn:hover{border-color:var(--ds-blue);color:var(--ds-t-1);background:color-mix(in srgb, var(--ds-blue) 12%, transparent)}.KFXqYa_modelTable tbody td:not(:first-child) tbody td:not(:first-child){text-align:right;font-family:var(--mono);font-variant-numeric:tabular-nums;color:var(--ds-t-1)}.KFXqYa_sessionViewer{z-index:30;background:var(--dsb-2);flex-direction:column;gap:10px;padding:20px;display:flex;position:fixed;inset:0;overflow:hidden}.KFXqYa_sessionViewerHead{align-items:center;gap:10px;display:flex}.KFXqYa_sessionViewerTitle{margin:0;font-size:15px;font-weight:600}.KFXqYa_sessionViewerHead .KFXqYa_ubSearch{width:260px;max-width:55%;margin-left:auto}.KFXqYa_sessionViewerList{border:1px solid var(--ds-border);border-radius:var(--ds-r-2,8px);flex:1;min-height:0;overflow:auto}.KFXqYa_dashboard button:focus-visible,.KFXqYa_dashboard input:focus-visible,.KFXqYa_dashboard select:focus-visible,.KFXqYa_dashboard [role=button]:focus-visible,.KFXqYa_dashboard tr[tabindex]:focus-visible,.KFXqYa_trigger:focus-visible,.KFXqYa_railButton:focus-visible{outline:2px solid var(--ds-blue);outline-offset:1px}.KFXqYa_dashboard [hidden]{display:none!important}.KFXqYa_settingsSearch{align-self:stretch;width:100%;max-width:none;margin:0 0 12px}.KFXqYa_modelBudgetList{flex-direction:column;gap:8px;display:flex}.KFXqYa_modelBudgetTitle{color:var(--ds-t-3);font-size:11px;line-height:16px}.KFXqYa_modelBudgetHint{color:var(--ds-t-3);margin:0;font-size:11px;line-height:16px}.KFXqYa_modelBudgetRow{grid-template-columns:minmax(0,1fr) 56px 84px;align-items:center;gap:8px;display:grid}.KFXqYa_modelBudgetName{text-overflow:ellipsis;white-space:nowrap;color:var(--ds-t-2);font-size:12px;line-height:18px;overflow:hidden}.KFXqYa_modelBudgetCost{text-align:right;color:var(--ds-t-3);font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.KFXqYa_helpTip{border:1px solid var(--ds-border);width:14px;height:14px;color:var(--ds-t-3);cursor:help;vertical-align:1px;border-radius:50%;flex:none;justify-content:center;align-items:center;margin-left:6px;font-size:10px;line-height:1;display:inline-flex}.KFXqYa_moreWorkList{flex-direction:column;gap:8px;display:flex}.KFXqYa_moreWorkRow{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);background:var(--dsb-3);color:inherit;transition:border-color var(--ds-t-fast), background-color var(--ds-t-fast);flex-direction:column;gap:2px;padding:10px 12px;text-decoration:none;display:flex}.KFXqYa_moreWorkRow:hover{border-color:var(--ds-border-strong);background:var(--dsb-2)}.KFXqYa_moreWorkName{color:var(--ds-t-1);font-size:12px;font-weight:600;line-height:18px}.KFXqYa_moreWorkRow:hover .KFXqYa_moreWorkName{color:var(--ds-blue)}.KFXqYa_moreWorkDesc{color:var(--ds-t-3);font-size:11px;line-height:16px}.KFXqYa_contextEmpty{color:var(--ds-t-3);margin:8px 0;font-size:12px}.KFXqYa_agentSummary{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);background:var(--dsb-2);flex-wrap:wrap;gap:8px 20px;margin-bottom:10px;padding:10px 12px;display:flex}.KFXqYa_agentSummaryItem{align-items:baseline;gap:5px;display:inline-flex}.KFXqYa_agentSummaryValue{color:var(--ds-t-1);font-variant-numeric:tabular-nums;font-size:15px;font-weight:600}.KFXqYa_agentSummaryLabel{color:var(--ds-t-3);font-size:11px}.KFXqYa_agentTree{flex-direction:column;gap:2px;display:flex}.KFXqYa_agentNode{flex-direction:column;display:flex}.KFXqYa_agentRow{border-radius:var(--ds-r-1);background:var(--dsb-2);align-items:center;gap:8px;padding:5px 8px;display:flex}.KFXqYa_agentKind{color:var(--ds-t-4);flex:none;font-size:10px}.KFXqYa_agentTitle{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--ds-t-1);flex:auto;font-size:12px;overflow:hidden}.KFXqYa_agentCalls{color:var(--ds-t-3);font-variant-numeric:tabular-nums;flex:none;font-size:11px}.KFXqYa_agentCost{color:var(--ds-t-2);font-variant-numeric:tabular-nums;flex:none;font-size:11.5px}.KFXqYa_sessionLink{width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:none;padding:0;display:block}.KFXqYa_sessionLink:hover{color:var(--ds-blue);text-decoration:underline}.KFXqYa_sessionLink:focus-visible{outline:2px solid var(--ds-blue);outline-offset:2px;border-radius:3px}`,document.head.appendChild(e)}var B={affix:`KFXqYa_affix`,agentCalls:`KFXqYa_agentCalls`,agentCost:`KFXqYa_agentCost`,agentKind:`KFXqYa_agentKind`,agentNode:`KFXqYa_agentNode`,agentRow:`KFXqYa_agentRow`,agentSummary:`KFXqYa_agentSummary`,agentSummaryItem:`KFXqYa_agentSummaryItem`,agentSummaryLabel:`KFXqYa_agentSummaryLabel`,agentSummaryValue:`KFXqYa_agentSummaryValue`,agentTitle:`KFXqYa_agentTitle`,agentTree:`KFXqYa_agentTree`,balanceCell:`KFXqYa_balanceCell`,balanceDaysBadge:`KFXqYa_balanceDaysBadge`,balanceDaysBadgeLow:`KFXqYa_balanceDaysBadgeLow`,balanceDetailClose:`KFXqYa_balanceDetailClose`,balanceDetailGrid:`KFXqYa_balanceDetailGrid`,balanceDetailHead:`KFXqYa_balanceDetailHead`,balanceDetailLabel:`KFXqYa_balanceDetailLabel`,balanceDetailPop:`KFXqYa_balanceDetailPop`,balanceDetailRow:`KFXqYa_balanceDetailRow`,balanceDetailTitle:`KFXqYa_balanceDetailTitle`,balanceDetailValue:`KFXqYa_balanceDetailValue`,bandDot:`KFXqYa_bandDot`,bandDotOn:`KFXqYa_bandDotOn`,bandDots:`KFXqYa_bandDots`,"billing-perf":`KFXqYa_billing-perf`,"billing-pg":`KFXqYa_billing-pg`,"billing-settings":`KFXqYa_billing-settings`,"billing-trigger":`KFXqYa_billing-trigger`,btn:`KFXqYa_btn`,bucketCost:`KFXqYa_bucketCost`,bucketOfficial:`KFXqYa_bucketOfficial`,bucketSep:`KFXqYa_bucketSep`,bucketThird:`KFXqYa_bucketThird`,budgetFillOver:`KFXqYa_budgetFillOver`,budgetFillWarn:`KFXqYa_budgetFillWarn`,budgetInput:`KFXqYa_budgetInput`,budgetPulse:`KFXqYa_budgetPulse`,chartArea:`KFXqYa_chartArea`,chartAxisLabel:`KFXqYa_chartAxisLabel`,chartBar:`KFXqYa_chartBar`,chartBarPlaceholder:`KFXqYa_chartBarPlaceholder`,chartCrosshair:`KFXqYa_chartCrosshair`,chartEmpty:`KFXqYa_chartEmpty`,chartGrid:`KFXqYa_chartGrid`,chartHoverDot:`KFXqYa_chartHoverDot`,chartLegend:`KFXqYa_chartLegend`,chartLegendBar:`KFXqYa_chartLegendBar`,chartLegendItem:`KFXqYa_chartLegendItem`,chartLegendItemActive:`KFXqYa_chartLegendItemActive`,chartLegendLine:`KFXqYa_chartLegendLine`,chartLine:`KFXqYa_chartLine`,chartStack:`KFXqYa_chartStack`,chartSvg:`KFXqYa_chartSvg`,chartTooltip:`KFXqYa_chartTooltip`,chartTooltipAlignLeft:`KFXqYa_chartTooltipAlignLeft`,chartTooltipAlignRight:`KFXqYa_chartTooltipAlignRight`,chartTooltipDate:`KFXqYa_chartTooltipDate`,chartTooltipHead:`KFXqYa_chartTooltipHead`,chartTooltipLabel:`KFXqYa_chartTooltipLabel`,chartTooltipModelDetail:`KFXqYa_chartTooltipModelDetail`,chartTooltipRow:`KFXqYa_chartTooltipRow`,chartTooltipSplit:`KFXqYa_chartTooltipSplit`,chartTooltipSwatch:`KFXqYa_chartTooltipSwatch`,chartWrap:`KFXqYa_chartWrap`,closeButton:`KFXqYa_closeButton`,contextEmpty:`KFXqYa_contextEmpty`,ctlCol:`KFXqYa_ctlCol`,ctlGroup:`KFXqYa_ctlGroup`,ctlLabel:`KFXqYa_ctlLabel`,ctlRow:`KFXqYa_ctlRow`,ctlRowStretch:`KFXqYa_ctlRowStretch`,currencyButton:`KFXqYa_currencyButton`,currencyButtonActive:`KFXqYa_currencyButtonActive`,currencyToggle:`KFXqYa_currencyToggle`,dashboard:`KFXqYa_dashboard`,dashboardBody:`KFXqYa_dashboardBody`,dashboardHead:`KFXqYa_dashboardHead`,dashboardIn:`KFXqYa_dashboardIn`,dashboardModal:`KFXqYa_dashboardModal`,dashboardRight:`KFXqYa_dashboardRight`,dashboardSubtitle:`KFXqYa_dashboardSubtitle`,dashboardTitle:`KFXqYa_dashboardTitle`,delta:`KFXqYa_delta`,deltaDown:`KFXqYa_deltaDown`,deltaUp:`KFXqYa_deltaUp`,densityButton:`KFXqYa_densityButton`,densityButtonActive:`KFXqYa_densityButtonActive`,densityButtonComfortable:`KFXqYa_densityButtonComfortable`,densityButtons:`KFXqYa_densityButtons`,densityLeft:`KFXqYa_densityLeft`,densityRow:`KFXqYa_densityRow`,emptyDesc:`KFXqYa_emptyDesc`,emptyDotPulse:`KFXqYa_emptyDotPulse`,emptyIll:`KFXqYa_emptyIll`,emptyIllDot:`KFXqYa_emptyIllDot`,emptyRow:`KFXqYa_emptyRow`,emptyState:`KFXqYa_emptyState`,emptyTitle:`KFXqYa_emptyTitle`,estimatedTag:`KFXqYa_estimatedTag`,exportBar:`KFXqYa_exportBar`,exportButton:`KFXqYa_exportButton`,exportLabel:`KFXqYa_exportLabel`,feeBar:`KFXqYa_feeBar`,feeBarAbove:`KFXqYa_feeBarAbove`,feeChipAlert:`KFXqYa_feeChipAlert`,feeChipError:`KFXqYa_feeChipError`,feeChipOff:`KFXqYa_feeChipOff`,feeChipPrimary:`KFXqYa_feeChipPrimary`,feeCount:`KFXqYa_feeCount`,feeInline:`KFXqYa_feeInline`,feeInlineAlert:`KFXqYa_feeInlineAlert`,feeInlineError:`KFXqYa_feeInlineError`,feeInlineNum:`KFXqYa_feeInlineNum`,feeItem:`KFXqYa_feeItem`,feeNum:`KFXqYa_feeNum`,feeSep:`KFXqYa_feeSep`,feeSuffix:`KFXqYa_feeSuffix`,feeTickFlash:`KFXqYa_feeTickFlash`,flatTag:`KFXqYa_flatTag`,floatModeBtn:`KFXqYa_floatModeBtn`,floatModeBtnOn:`KFXqYa_floatModeBtnOn`,floatSub:`KFXqYa_floatSub`,floatSubHead:`KFXqYa_floatSubHead`,floatSubName:`KFXqYa_floatSubName`,floatSubPlan:`KFXqYa_floatSubPlan`,floatTarget:`KFXqYa_floatTarget`,floatTargetLabel:`KFXqYa_floatTargetLabel`,healthBad:`KFXqYa_healthBad`,healthBadge:`KFXqYa_healthBadge`,healthBadgeBad:`KFXqYa_healthBadgeBad`,healthBadgeOk:`KFXqYa_healthBadgeOk`,healthDot:`KFXqYa_healthDot`,healthIdle:`KFXqYa_healthIdle`,healthOk:`KFXqYa_healthOk`,heatmap:`KFXqYa_heatmap`,heatmapCell:`KFXqYa_heatmapCell`,heatmapCellEmpty:`KFXqYa_heatmapCellEmpty`,heatmapFooter:`KFXqYa_heatmapFooter`,heatmapGrid:`KFXqYa_heatmapGrid`,heatmapHalf:`KFXqYa_heatmapHalf`,heatmapHover:`KFXqYa_heatmapHover`,heatmapLegend:`KFXqYa_heatmapLegend`,heatmapRangeButton:`KFXqYa_heatmapRangeButton`,heatmapRangeButtonActive:`KFXqYa_heatmapRangeButtonActive`,heatmapRangeSwitch:`KFXqYa_heatmapRangeSwitch`,heatmapYear:`KFXqYa_heatmapYear`,heatmapYearBody:`KFXqYa_heatmapYearBody`,heatmapYearCell:`KFXqYa_heatmapYearCell`,heatmapYearGrid:`KFXqYa_heatmapYearGrid`,heatmapYearMonth:`KFXqYa_heatmapYearMonth`,heatmapYearMonths:`KFXqYa_heatmapYearMonths`,heatmapYearScroll:`KFXqYa_heatmapYearScroll`,heatmapYearWeekday:`KFXqYa_heatmapYearWeekday`,heatmapYearWeekdays:`KFXqYa_heatmapYearWeekdays`,helpTip:`KFXqYa_helpTip`,hero:`KFXqYa_hero`,heroCurrency:`KFXqYa_heroCurrency`,heroGauge:`KFXqYa_heroGauge`,heroGaugeArc:`KFXqYa_heroGaugeArc`,heroGaugeArcOver:`KFXqYa_heroGaugeArcOver`,heroGaugeCenter:`KFXqYa_heroGaugeCenter`,heroGaugeDial:`KFXqYa_heroGaugeDial`,heroGaugeLabel:`KFXqYa_heroGaugeLabel`,heroGaugeRemain:`KFXqYa_heroGaugeRemain`,heroGaugeRemainOver:`KFXqYa_heroGaugeRemainOver`,heroGaugeSub:`KFXqYa_heroGaugeSub`,heroGaugeSvg:`KFXqYa_heroGaugeSvg`,heroGaugeTrack:`KFXqYa_heroGaugeTrack`,heroLabel:`KFXqYa_heroLabel`,heroMain:`KFXqYa_heroMain`,heroMeta:`KFXqYa_heroMeta`,heroPred:`KFXqYa_heroPred`,heroReadout:`KFXqYa_heroReadout`,heroSide:`KFXqYa_heroSide`,heroSideItem:`KFXqYa_heroSideItem`,heroSideLabel:`KFXqYa_heroSideLabel`,heroSideSpacer:`KFXqYa_heroSideSpacer`,heroSideValue:`KFXqYa_heroSideValue`,heroTop:`KFXqYa_heroTop`,heroValue:`KFXqYa_heroValue`,inp:`KFXqYa_inp`,kindBadge:`KFXqYa_kindBadge`,kindBadgeRelay:`KFXqYa_kindBadgeRelay`,kindBadgeUnknown:`KFXqYa_kindBadgeUnknown`,kpiCustomRange:`KFXqYa_kpiCustomRange`,kpiDelta:`KFXqYa_kpiDelta`,kpiDeltaDown:`KFXqYa_kpiDeltaDown`,kpiDeltaFlat:`KFXqYa_kpiDeltaFlat`,kpiDeltaUp:`KFXqYa_kpiDeltaUp`,kpiDetail:`KFXqYa_kpiDetail`,kpiGreen:`KFXqYa_kpiGreen`,kpiGrid:`KFXqYa_kpiGrid`,kpiLabel:`KFXqYa_kpiLabel`,kpiLabelRow:`KFXqYa_kpiLabelRow`,kpiSpark:`KFXqYa_kpiSpark`,kpiTile:`KFXqYa_kpiTile`,kpiValue:`KFXqYa_kpiValue`,kpiZone:`KFXqYa_kpiZone`,kpiZoneHead:`KFXqYa_kpiZoneHead`,kpiZoneLabel:`KFXqYa_kpiZoneLabel`,metricCell:`KFXqYa_metricCell`,metricGrid:`KFXqYa_metricGrid`,metricLabel:`KFXqYa_metricLabel`,metricValue:`KFXqYa_metricValue`,metricValueSuccess:`KFXqYa_metricValueSuccess`,modalFooter:`KFXqYa_modalFooter`,modelBudgetCost:`KFXqYa_modelBudgetCost`,modelBudgetHint:`KFXqYa_modelBudgetHint`,modelBudgetList:`KFXqYa_modelBudgetList`,modelBudgetName:`KFXqYa_modelBudgetName`,modelBudgetRow:`KFXqYa_modelBudgetRow`,modelBudgetTitle:`KFXqYa_modelBudgetTitle`,modelCell:`KFXqYa_modelCell`,modelDot:`KFXqYa_modelDot`,modelName:`KFXqYa_modelName`,modelProvider:`KFXqYa_modelProvider`,modelRowActive:`KFXqYa_modelRowActive`,modelRowFocusable:`KFXqYa_modelRowFocusable`,modelTable:`KFXqYa_modelTable`,moreWorkDesc:`KFXqYa_moreWorkDesc`,moreWorkList:`KFXqYa_moreWorkList`,moreWorkName:`KFXqYa_moreWorkName`,moreWorkRow:`KFXqYa_moreWorkRow`,na:`KFXqYa_na`,nativeSettingsBody:`KFXqYa_nativeSettingsBody`,nativeSettingsDashboard:`KFXqYa_nativeSettingsDashboard`,nativeSettingsLayout:`KFXqYa_nativeSettingsLayout`,nativeSettingsRoot:`KFXqYa_nativeSettingsRoot`,noticeDismiss:`KFXqYa_noticeDismiss`,numCol:`KFXqYa_numCol`,offPeak:`KFXqYa_offPeak`,panel:`KFXqYa_panel`,panelHead:`KFXqYa_panelHead`,panelHeadControls:`KFXqYa_panelHeadControls`,panelHint:`KFXqYa_panelHint`,panelTitle:`KFXqYa_panelTitle`,peak:`KFXqYa_peak`,peakAlertIn:`KFXqYa_peakAlertIn`,peakAlertPop:`KFXqYa_peakAlertPop`,peakCard:`KFXqYa_peakCard`,peakCardCenter:`KFXqYa_peakCardCenter`,peakCardCorner:`KFXqYa_peakCardCorner`,peakCardOff:`KFXqYa_peakCardOff`,peakCardPeak:`KFXqYa_peakCardPeak`,peakClose:`KFXqYa_peakClose`,peakCount:`KFXqYa_peakCount`,peakCountPrimary:`KFXqYa_peakCountPrimary`,peakCountSuccess:`KFXqYa_peakCountSuccess`,peakDesc:`KFXqYa_peakDesc`,peakDot:`KFXqYa_peakDot`,peakDotPrimary:`KFXqYa_peakDotPrimary`,peakDotSuccess:`KFXqYa_peakDotSuccess`,peakHead:`KFXqYa_peakHead`,peakTag:`KFXqYa_peakTag`,peakTagPrimary:`KFXqYa_peakTagPrimary`,peakTagSuccess:`KFXqYa_peakTagSuccess`,perfBar:`KFXqYa_perfBar`,perfChip:`KFXqYa_perfChip`,perfChipDot:`KFXqYa_perfChipDot`,perfChipOff:`KFXqYa_perfChipOff`,perfChips:`KFXqYa_perfChips`,perfCompareBar:`KFXqYa_perfCompareBar`,perfCompareDot:`KFXqYa_perfCompareDot`,perfCompareList:`KFXqYa_perfCompareList`,perfCompareName:`KFXqYa_perfCompareName`,perfCompareNum:`KFXqYa_perfCompareNum`,perfCompareRow:`KFXqYa_perfCompareRow`,perfHero:`KFXqYa_perfHero`,perfHeroBar:`KFXqYa_perfHeroBar`,perfHeroCell:`KFXqYa_perfHeroCell`,perfHeroLbl:`KFXqYa_perfHeroLbl`,perfHeroUnit:`KFXqYa_perfHeroUnit`,perfHeroVal:`KFXqYa_perfHeroVal`,planTag:`KFXqYa_planTag`,planTagBadge:`KFXqYa_planTagBadge`,plgDesc:`KFXqYa_plgDesc`,plgGrid:`KFXqYa_plgGrid`,plgHead:`KFXqYa_plgHead`,plgIcon:`KFXqYa_plgIcon`,plgItem:`KFXqYa_plgItem`,plgLabel:`KFXqYa_plgLabel`,plgLink:`KFXqYa_plgLink`,plgName:`KFXqYa_plgName`,plgNameRow:`KFXqYa_plgNameRow`,plgTag:`KFXqYa_plgTag`,plgTitle:`KFXqYa_plgTitle`,plgVal:`KFXqYa_plgVal`,popDot:`KFXqYa_popDot`,popDotDirect:`KFXqYa_popDotDirect`,popDotNeutral:`KFXqYa_popDotNeutral`,popDotSub:`KFXqYa_popDotSub`,popHead:`KFXqYa_popHead`,popModel:`KFXqYa_popModel`,popModelLabel:`KFXqYa_popModelLabel`,popModelName:`KFXqYa_popModelName`,popModelRow:`KFXqYa_popModelRow`,popModelStatus:`KFXqYa_popModelStatus`,popModelStatusLow:`KFXqYa_popModelStatusLow`,popTagPrimary:`KFXqYa_popTagPrimary`,popTagSub:`KFXqYa_popTagSub`,popTitle:`KFXqYa_popTitle`,prog:`KFXqYa_prog`,progFill:`KFXqYa_progFill`,providerCtlRow:`KFXqYa_providerCtlRow`,providerGroup:`KFXqYa_providerGroup`,providerGroupBadge:`KFXqYa_providerGroupBadge`,providerGroupBalance:`KFXqYa_providerGroupBalance`,providerGroupBalanceLabel:`KFXqYa_providerGroupBalanceLabel`,providerGroupCollapsible:`KFXqYa_providerGroupCollapsible`,providerGroupCost:`KFXqYa_providerGroupCost`,providerGroupCostLabel:`KFXqYa_providerGroupCostLabel`,providerGroupCostValue:`KFXqYa_providerGroupCostValue`,providerGroupHead:`KFXqYa_providerGroupHead`,providerGroupList:`KFXqYa_providerGroupList`,providerGroupMeta:`KFXqYa_providerGroupMeta`,providerGroupName:`KFXqYa_providerGroupName`,providerGroupRecharge:`KFXqYa_providerGroupRecharge`,providerGroupTitle:`KFXqYa_providerGroupTitle`,providerStatCell:`KFXqYa_providerStatCell`,providerStatLbl:`KFXqYa_providerStatLbl`,providerStatRow:`KFXqYa_providerStatRow`,providerStatSub:`KFXqYa_providerStatSub`,providerStatVal:`KFXqYa_providerStatVal`,providerTodayToggle:`KFXqYa_providerTodayToggle`,railButton:`KFXqYa_railButton`,rangeButton:`KFXqYa_rangeButton`,rangeButtonActive:`KFXqYa_rangeButtonActive`,rangeToggle:`KFXqYa_rangeToggle`,rdo:`KFXqYa_rdo`,rdoChevron:`KFXqYa_rdoChevron`,rdoChevronOpen:`KFXqYa_rdoChevronOpen`,rdoDot:`KFXqYa_rdoDot`,rdoLabel:`KFXqYa_rdoLabel`,rdoRow:`KFXqYa_rdoRow`,rdoSelect:`KFXqYa_rdoSelect`,reconcileDismiss:`KFXqYa_reconcileDismiss`,reconcileIcon:`KFXqYa_reconcileIcon`,reconcileNotice:`KFXqYa_reconcileNotice`,reconcileText:`KFXqYa_reconcileText`,rounds:`KFXqYa_rounds`,roundsAxis:`KFXqYa_roundsAxis`,roundsBar:`KFXqYa_roundsBar`,roundsBarCol:`KFXqYa_roundsBarCol`,roundsBarColOff:`KFXqYa_roundsBarColOff`,roundsBarColPeak:`KFXqYa_roundsBarColPeak`,roundsBarFlagged:`KFXqYa_roundsBarFlagged`,roundsBarLabel:`KFXqYa_roundsBarLabel`,roundsBarWrap:`KFXqYa_roundsBarWrap`,roundsBars:`KFXqYa_roundsBars`,roundsEmpty:`KFXqYa_roundsEmpty`,roundsFlagMark:`KFXqYa_roundsFlagMark`,sessionChildRow:`KFXqYa_sessionChildRow`,sessionGroupRow:`KFXqYa_sessionGroupRow`,sessionLink:`KFXqYa_sessionLink`,sessionSubDeepRow:`KFXqYa_sessionSubDeepRow`,sessionViewer:`KFXqYa_sessionViewer`,sessionViewerHead:`KFXqYa_sessionViewerHead`,sessionViewerList:`KFXqYa_sessionViewerList`,sessionViewerTitle:`KFXqYa_sessionViewerTitle`,setCard:`KFXqYa_setCard`,setCardDesc:`KFXqYa_setCardDesc`,setCardHead:`KFXqYa_setCardHead`,setCardMeta:`KFXqYa_setCardMeta`,setCardTitle:`KFXqYa_setCardTitle`,setCell:`KFXqYa_setCell`,setGrid2:`KFXqYa_setGrid2`,setGrid3:`KFXqYa_setGrid3`,settingsLayout:`KFXqYa_settingsLayout`,settingsNav:`KFXqYa_settingsNav`,settingsNavIcon:`KFXqYa_settingsNavIcon`,settingsNavItem:`KFXqYa_settingsNavItem`,settingsNavItemActive:`KFXqYa_settingsNavItemActive`,settingsNavItemAdvanced:`KFXqYa_settingsNavItemAdvanced`,settingsPane:`KFXqYa_settingsPane`,settingsSearch:`KFXqYa_settingsSearch`,shareDot:`KFXqYa_shareDot`,shareItem:`KFXqYa_shareItem`,shareLegend:`KFXqYa_shareLegend`,shareSeg:`KFXqYa_shareSeg`,shareSegAssistant:`KFXqYa_shareSegAssistant`,shareSegOff:`KFXqYa_shareSegOff`,shareSegPeak:`KFXqYa_shareSegPeak`,shareSegTool:`KFXqYa_shareSegTool`,shareSegUser:`KFXqYa_shareSegUser`,shareTrack:`KFXqYa_shareTrack`,shareValue:`KFXqYa_shareValue`,siteKindDirect:`KFXqYa_siteKindDirect`,siteKindSite:`KFXqYa_siteKindSite`,siteKindTag:`KFXqYa_siteKindTag`,siteKindUnknown:`KFXqYa_siteKindUnknown`,siteRow:`KFXqYa_siteRow`,siteRowCalls:`KFXqYa_siteRowCalls`,siteRowCallsLow:`KFXqYa_siteRowCallsLow`,siteRowCost:`KFXqYa_siteRowCost`,siteRowMeta:`KFXqYa_siteRowMeta`,siteRowName:`KFXqYa_siteRowName`,siteRowTitle:`KFXqYa_siteRowTitle`,soon:`KFXqYa_soon`,staleNotice:`KFXqYa_staleNotice`,staleNoticeBody:`KFXqYa_staleNoticeBody`,staleNoticeSub:`KFXqYa_staleNoticeSub`,subscriptionAuto:`KFXqYa_subscriptionAuto`,subscriptionCard:`KFXqYa_subscriptionCard`,subscriptionCardUpgraded:`KFXqYa_subscriptionCardUpgraded`,subscriptionExhausted:`KFXqYa_subscriptionExhausted`,subscriptionFill:`KFXqYa_subscriptionFill`,subscriptionFillOver:`KFXqYa_subscriptionFillOver`,subscriptionFillWarn:`KFXqYa_subscriptionFillWarn`,subscriptionGrid:`KFXqYa_subscriptionGrid`,subscriptionHead:`KFXqYa_subscriptionHead`,subscriptionMeta:`KFXqYa_subscriptionMeta`,subscriptionName:`KFXqYa_subscriptionName`,subscriptionPct:`KFXqYa_subscriptionPct`,subscriptionPlan:`KFXqYa_subscriptionPlan`,subscriptionReset:`KFXqYa_subscriptionReset`,subscriptionStatus:`KFXqYa_subscriptionStatus`,subscriptionTier:`KFXqYa_subscriptionTier`,subscriptionTrack:`KFXqYa_subscriptionTrack`,subscriptionWindow:`KFXqYa_subscriptionWindow`,subscriptionWindowLabel:`KFXqYa_subscriptionWindowLabel`,switch:`KFXqYa_switch`,switchKnob:`KFXqYa_switchKnob`,switchOn:`KFXqYa_switchOn`,tabBadge:`KFXqYa_tabBadge`,tabBadgeHot:`KFXqYa_tabBadgeHot`,tabBadgeViolet:`KFXqYa_tabBadgeViolet`,tabBadgeWarn:`KFXqYa_tabBadgeWarn`,tabButton:`KFXqYa_tabButton`,tabButtonActive:`KFXqYa_tabButtonActive`,tabNav:`KFXqYa_tabNav`,tabNavLabel:`KFXqYa_tabNavLabel`,tabPanel:`KFXqYa_tabPanel`,tabPanelIn:`KFXqYa_tabPanelIn`,tabRail:`KFXqYa_tabRail`,tabRailIcon:`KFXqYa_tabRailIcon`,tabRailItem:`KFXqYa_tabRailItem`,tabRailItemActive:`KFXqYa_tabRailItemActive`,tabRailLabel:`KFXqYa_tabRailLabel`,tableScroll:`KFXqYa_tableScroll`,tokenModelBar:`KFXqYa_tokenModelBar`,tokenModelPartIn:`KFXqYa_tokenModelPartIn`,tokenModelPartOut:`KFXqYa_tokenModelPartOut`,tokenModelParts:`KFXqYa_tokenModelParts`,tokenModelShareRow:`KFXqYa_tokenModelShareRow`,tokenPanel:`KFXqYa_tokenPanel`,trigger:`KFXqYa_trigger`,triggerBudgetHot:`KFXqYa_triggerBudgetHot`,triggerBudgetOver:`KFXqYa_triggerBudgetOver`,triggerBudgetPulse:`KFXqYa_triggerBudgetPulse`,triggerDelta:`KFXqYa_triggerDelta`,triggerDeltaDown:`KFXqYa_triggerDeltaDown`,triggerDeltaUp:`KFXqYa_triggerDeltaUp`,triggerGaugeArc:`KFXqYa_triggerGaugeArc`,triggerGaugeNeedle:`KFXqYa_triggerGaugeNeedle`,triggerGlow:`KFXqYa_triggerGlow`,triggerGlowPulse:`KFXqYa_triggerGlowPulse`,triggerIcon:`KFXqYa_triggerIcon`,triggerLabel:`KFXqYa_triggerLabel`,triggerMain:`KFXqYa_triggerMain`,triggerMetric:`KFXqYa_triggerMetric`,triggerPop:`KFXqYa_triggerPop`,triggerPopEmpty:`KFXqYa_triggerPopEmpty`,triggerPopShown:`KFXqYa_triggerPopShown`,triggerPopSwitchCount:`KFXqYa_triggerPopSwitchCount`,triggerPopSwitcher:`KFXqYa_triggerPopSwitcher`,triggerPrimary:`KFXqYa_triggerPrimary`,triggerScan:`KFXqYa_triggerScan`,triggerSpark:`KFXqYa_triggerSpark`,triggerSparkBar:`KFXqYa_triggerSparkBar`,triggerSparkBreath:`KFXqYa_triggerSparkBreath`,triggerSparkHot:`KFXqYa_triggerSparkHot`,triggerValueRow:`KFXqYa_triggerValueRow`,triggerWrap:`KFXqYa_triggerWrap`,triggerYen:`KFXqYa_triggerYen`,ubAlert:`KFXqYa_ubAlert`,ubAlertLeft:`KFXqYa_ubAlertLeft`,ubAlertNote:`KFXqYa_ubAlertNote`,ubCard:`KFXqYa_ubCard`,ubCardControlGroup:`KFXqYa_ubCardControlGroup`,ubCardHead:`KFXqYa_ubCardHead`,ubCardSub:`KFXqYa_ubCardSub`,ubCardTitle:`KFXqYa_ubCardTitle`,ubChipLabel:`KFXqYa_ubChipLabel`,ubChipOff:`KFXqYa_ubChipOff`,ubChipPeak:`KFXqYa_ubChipPeak`,ubExtraName:`KFXqYa_ubExtraName`,ubExtraNote:`KFXqYa_ubExtraNote`,ubExtraRow:`KFXqYa_ubExtraRow`,ubModel:`KFXqYa_ubModel`,ubModelName:`KFXqYa_ubModelName`,ubNotes:`KFXqYa_ubNotes`,ubNotesDesc:`KFXqYa_ubNotesDesc`,ubNotesItem:`KFXqYa_ubNotesItem`,ubNotesTerm:`KFXqYa_ubNotesTerm`,ubRate:`KFXqYa_ubRate`,ubSearch:`KFXqYa_ubSearch`,ubTable:`KFXqYa_ubTable`,ubTablewrap:`KFXqYa_ubTablewrap`,ubTablewrapPricing:`KFXqYa_ubTablewrapPricing`,ubTag:`KFXqYa_ubTag`,ubTagAlert:`KFXqYa_ubTagAlert`,ubTagError:`KFXqYa_ubTagError`,ubTagNeutral:`KFXqYa_ubTagNeutral`,ubTagPromo:`KFXqYa_ubTagPromo`,ubTagSuccess:`KFXqYa_ubTagSuccess`,uncataloguedTag:`KFXqYa_uncataloguedTag`,unknownHint:`KFXqYa_unknownHint`,unpricedHint:`KFXqYa_unpricedHint`,unpricedHintBody:`KFXqYa_unpricedHintBody`,userPriceBody:`KFXqYa_userPriceBody`,userPriceCheck:`KFXqYa_userPriceCheck`,userPriceField:`KFXqYa_userPriceField`,userPriceInput:`KFXqYa_userPriceInput`,userPriceInputNum:`KFXqYa_userPriceInputNum`,userPriceLineMeta:`KFXqYa_userPriceLineMeta`,userPricePriceLine:`KFXqYa_userPricePriceLine`,userPriceRow:`KFXqYa_userPriceRow`};let V=`usageBilling`,H={title:`使用统计`,cost:`费用`,todayCost:`今日费用`,monthCost:`本月费用`,yearCost:`本年费用`,monthProjected:`本月预计`,monthProjectedHint:`本月已发生 + 近 7 天节奏 × 剩余天数`,liveTurn:`本轮`,liveSession:`会话`,liveSessionSub:`含子 {cost}`,calls:`调用`,cacheHitRate:`缓存命中率`,tokens:`Token`,inputTokens:`输入`,outputTokens:`输出`,avgCost:`平均成本`,kpiRange:`统计范围`,avgRangeToday:`今日`,avgRange7d:`近7天`,avgRangeWeek:`本周`,avgRangeMonth:`本月`,avgRangeAll:`累计`,avgRangeCustom:`自定义`,customRangeStart:`开始日期`,customRangeEnd:`结束日期`,trend:`每日费用与调用趋势`,trend7d:`7 天`,trend30d:`30 天`,trendMetric:`趋势指标`,trendMetricCost:`费用`,trendMetricTokens:`Token`,pricingSearch:`搜索模型 / 厂商`,bandPinHint:`点击固定到输入框`,trendEmpty:`暂无趋势数据`,trendTotal:`总计`,roundsUnit:`轮`,healthModelsLive:`{n} 模型可用`,healthVendorsDown:`{n} 厂商失效`,healthVendorsUnavailable:`{n} 厂商不可用`,budget:`本月预算`,budgetRemain:`剩余预算`,budgetAmount:`预算金额`,budgetSummary:`本月已用 {used} / {total};达到 80% 时提醒,达到 100% 时红色脉冲警示`,sessions:`会话明细`,sessionTitle:`标题`,lastActive:`最后活跃`,sessionOverflow:`仅显示花费前 {limit} 个,共 {total} 个会话`,budgetTierBody:`本月花费 {cost} 已达预算 {budget} 的 {pct}%`,models:`模型计费明细`,providerBilling:`提供商计费与订阅`,channelUnknown:`未知路由`,directTag:`直连`,relayTag:`中转`,unknownTag:`未知`,unknownChannelHint:`通道未在插件配置中注册,支出主体无法核实,费用不计入口径,仅统计用量。`,planCountUnit:`套餐`,actual:`实际`,pricing:`模型单价表`,input:`输入`,output:`输出`,cacheHit:`缓存命中`,peak:`高峰`,offPeak:`低谷`,flat:`全天统一`,band:`时段`,close:`关闭`,footer:`每 30s 自动轮询 · 仅统计本机 dsh 会话`,footerCredit:`dsh-ui-usage-billing {version} · MIT`,lastUpdated:`数据更新于`,noData:`暂无计费数据`,todayRate:`今日汇率`,rateLive:`实时`,rateBuiltin:`内置`,pricingSyncedAt:`上次同步`,pricingSyncNow:`立即同步`,pricingSyncing:`同步中…`,promoBadge:`促`,promoUntil:`促销价至 {date},之后自动恢复刊例价`,promoOpenEnded:`厂商未公布截止时间,当前按折扣计价;公告截止后自动恢复刊例价`,pricingTip:`DeepSeek 现行刊例:V4.1 Flash 谷档 未命中 ¥1 / 缓存命中 ¥0.02 / 输出 ¥4;V4 Pro 谷档 未命中 ¥4.5 / 缓存命中 ¥0.15 / 输出 ¥13.5;峰价均为谷价 × 2。工作日 9-12 / 14-18 为高峰价,其余时段(含周末全天)为低谷价;费用按调用时刻计。`,pricingUnit:`单位:人民币 / 每百万 Token`,pricingNotes:`计价说明`,ubPeak:`峰`,ubOff:`谷`,ubStd:`标准`,peakBand:`峰谷分带`,pricingSource:`数据来源`,noteCache:`命中部分按缓存价计费,显著降低成本。`,noteBand:`高峰与空闲时段单价不同,空闲约半价。`,noteSource:`价格来自实时汇率 + 模型定价目录,未收录模型按 0 计并提示。`,balance:`余额`,recharge:`充值`,rechargeHint:`打开该厂商官方平台的充值页`,balanceUnconfigured:`未配置`,balanceUnauthorized:`密钥无效`,balanceUnreachable:`查询失败`,uncatalogued:`未收录`,estimatedPricing:`估算价`,balanceDays:`约可撑 {days} 天`,balanceLowBody:`{name} 余额 {balance},约可撑 {days} 天,请及时充值`,reconcileDrift:`系统监控到{provider}官方余额变动 {spent},本面板记录 {today},差额通常由其它工具或 API 的消耗所致`,reconcileDismiss:`知道了`,subscriptionNotConfigured:`未配置密钥`,subscriptionUnauthorized:`密钥无效`,subscriptionUnavailable:`查询失败`,subscriptionInvalid:`响应异常`,subscriptionRateLimited:`触发限流`,subscriptionSession:`本次`,subscriptionWeekly:`本周`,subscriptionMonthly:`本月`,subscriptionBilling:`计费周期`,subscriptionRemaining:`剩余 {pct}%`,subscriptionExhausted:`已用尽`,subscriptionReset:`{date} 重置`,subscriptionNoApi:`该厂商暂未提供用量查询接口`,floatWindow:`模型用量悬浮窗`,floatModeCombined:`综合`,floatModeSubscription:`订阅卡`,floatMode:`展示模式`,floatTargets:`订阅目标`,floatWindowHint:`悬浮在左下角计费卡上的用量速览;综合=当前样式,订阅卡=每次展示一张订阅额度卡(可切换)。`,floatPrimaryToday:`今日`,floatPrimaryWeek:`本周`,floatPrimaryMonth:`本月`,cardDisplay:`计费卡显示`,cardDisplayHint:`选择侧栏入口的占用方式,并切换主指标与统计范围;完全隐藏后可从宿主设置或 /usage 恢复。隐藏不会停止统计或提醒。`,cardMode:`侧栏入口`,cardModeFull:`完整卡片`,cardModeCompact:`紧凑图标`,cardModeHidden:`完全隐藏`,cardModeHiddenHint:`恢复显示:打开宿主设置 → 用量与费用 → 完整卡片;也可通过 /usage 打开仪表盘后恢复。`,cardModeFallback:`当前宿主没有原生设置页或 /usage 入口,完全隐藏已降级为紧凑图标,避免仪表盘无法打开。`,nativeSettingsNav:`用量与费用`,nativeSettingsIntro:`管理侧栏计费入口的显示方式。修改即时生效,并与仪表盘内的设置同步。`,nativeSettingsHiddenHint:`侧栏入口当前已隐藏。选择「完整卡片」或「紧凑图标」即可恢复;统计与提醒一直保持运行。`,cardMetric:`主指标`,cardMetricMoney:`金额`,cardMetricTokens:`Token`,cardSpan:`统计范围`,cardSpanDay:`日`,cardSpanWeek:`周`,cardSpanMonth:`月`,cardDeltaBadge:`今日环比徽章`,cardDeltaShow:`显示`,cardDeltaHide:`隐藏`,floatNoTargets:`未指定订阅通道,请在设置中勾选要展示的订阅。`,floatNoTargetsHint:`暂无可选的订阅通道。`,subscriptionsStale:`订阅额度刷新失败,以下为缓存数据`,balanceStaleNotice:`余额刷新较慢,以下为上一次查询结果`,staleLedgerNotice:`{count} 个会话出自旧版算法存档(日志已删,无法重算),模型归属可能有误差`,staleSnapshotNotice:`用量正在重算,以下数据来自上一次计算(可能不是最新,会话标题等以工作区为准)`,unreadableNotice:`{count} 个会话的用量未完整计入(原始日志未动,不会丢失)`,unreadableNoLedgerNotice:`其中 {count} 个无历史存档,用量完全未计入`,unreadableFormatNotice:`其中 {count} 个因会话格式不受当前宿主支持:过新格式升级宿主后自动恢复,过旧格式(如 v0/v3)需先迁移`,tokenCacheWrite:`写入`,toolRank:`工具排行`,toolName:`工具`,userPrices:`自定义单价`,userPricesHint:`为未收录或变价模型填入实付单价,总览与日趋势按此重估;模型可用下拉候选(目录键或模型 id);来源留空=该模型默认价,填入中转站域名=仅该来源的同名模型用此价(协议可省);低谷价三栏填后按峰/谷混合估算,留空=平档`,userPriceSave:`保存`,userPriceModel:`模型`,userPriceSource:`来源(中转站域名)`,userPriceSourceHint:`留空=默认价,或 https://api.中转站.com`,userPriceOffPeak:`低谷价`,userPriceNormal:`标准价`,userPriceCurrency:`币种`,userPriceAdd:`新增`,userPriceRemoveSelected:`删除所选`,userPriceSelect:`选择此行`,sessionStaleBadge:`旧版统计`,sessionUntitled:`未命名会话`,sessionSubCost:`含子智能体 {cost}`,sessionSubCalls:`含子智能体 {calls} 次调用`,sessionSubRow:`子智能体`,heatmapLess:`少`,heatmapMore:`多`,currency:`币种`,currencyCny:`人民币`,currencyUsd:`美元`,currencyEur:`欧元`,language:`界面语言`,heatmap:`用量热力图`,rounds:`每轮费用`,roundsHint:`最近 {count} 轮 · 柱顶为金额 · 底色为峰谷时段`,anomaly:`成本突增`,model:`模型`,thModel:`模型名称`,thInputMiss:`输入缓存未命中`,thInputHit:`输入缓存命中`,costAbbr:`费用`,tabOverview:`概览`,tabTrends:`趋势`,tabProviders:`账单`,tabPricing:`费率`,tabSettings:`设置`,budgetHint:`设置月度上限,用于本月预计与超支分段提醒`,peakAlertHint:`在切档前弹窗提醒,可选同步系统通知`,peakAlertDescPeak:`即将进入高峰时段,价格将上调,请提前安排长任务`,peakAlertDescOff:`即将进入平价时段,价格减半,适合运行大批量任务`,peakAlertDescPeakZhipu:`即将进入高峰时段(工作日 14:00–18:00),Coding Plan 额度将按基础积分全额抵扣`,peakAlertDescOffZhipu:`即将进入非高峰时段,Coding Plan 额度按基础积分 5 折抵扣`,peakAlertQueuePeak:`{count} 个排队任务将等待下一低谷;已开始任务继续执行`,peakAlertQueueOff:`{count} 个排队任务将按顺序启动`,export:`导出`,exportCsvDay:`按日 CSV`,exportCsvSession:`按会话 CSV`,exportJson:`全量 JSON`,peakShare:`峰谷时段占比`,peakSharePerCall:`按调用时刻精确判档`,offPeakSavings:`挪谷可省约 {amount}`,perfMax:`最大 TTFT`,weekCost:`本周消耗金额`,roleCost:`费用构成`,roleUser:`用户输入`,roleAssistant:`助手输出`,roleTool:`工具结果`,roleHint:`估算:输出按实测计价,输入按消息长度摊分`,tierPeak:`峰时`,tierOff:`平价`,tierToPeak:`后转峰时`,tierToOff:`后转平价`,tierAlertEnterPeak:`{minutes} 分钟后进入峰时(DeepSeek 高峰价 ×2),不急的调用可稍等`,tierAlertEnterOff:`{minutes} 分钟后进入平价(价格减半)`,tierAlertEnterPeakZhipu:`{minutes} 分钟后进入智谱高峰时段,Coding Plan 额度将全额抵扣`,tierAlertEnterOffZhipu:`{minutes} 分钟后进入智谱非高峰时段,额度按基础积分 5 折抵扣`,peakAlertTitlePeak:`即将进入高峰价`,peakAlertTitleOff:`即将进入平价`,peakAlert:`峰谷切换提醒`,peakAlertLeadMin:`提前量(分钟)`,peakAlertPos:`位置`,peakAlertMode:`提醒模式`,peakAlertPosCorner:`右下角`,peakAlertPosCenter:`屏幕居中`,peakAlertModePeak:`仅进入峰时`,peakAlertModeOff:`仅进入平价`,peakAlertModeBoth:`峰与谷都提醒`,peakAlertWebNotify:`同时发系统通知`,peakAlertPreview:`预览提醒`,planTypeCode:`订阅制`,planTypeToken:`按量`,subscriptionFeePerMonth:`{amount}/月`,triggerToday:`今日消耗金额`,triggerMonth:`当月消耗金额`,triggerMonthTokens:`当月消耗 Token`,triggerTodayTokens:`今日消耗 Token`,triggerWeekTokens:`本周消耗 Token`,subscriptionTag:`订阅`,cellEstimateHint:`本行无按量扣费记录(订阅通道不逐次计费),金额按目录价估算`,free:`免费`,perfSamples:`样本`,perfTtft:`首字延时`,perfP50:`P50`,perfP90:`P90`,perfTps:`生成速度`,perfLatency:`总延迟`,perfEstimated:`估算样本`,perfEmpty:`暂无性能数据`,perfTpsUnit:`tok/s`,perfTitle:`性能`,perfHint:`按模型与按小时聚合;估算样本为工具续写步骤`,perfAll:`全选`,perfChartEmpty:`未选择模型或该指标暂无数据`,heatmapYear:`年`,heatmapHalf:`半年`,heatmapMonth:`月`,metricCost:`费用`,metricTokens:`Token`,heatmapTotal:`合计`,activeDays:`活跃天数`,streakDays:`连续使用`,subscriptionAutoDetect:`自动识别`,pluginAuthor:`作者`,pluginRepository:`仓库`,pluginNpm:`npm`,pluginLicense:`许可证`,tabToken:`用量`,tokenExport:`导出 Token`,tokenExportCsv:`按日 Token CSV`,tokenReasoningShare:`思考占比`,tokenReasoningShort:`思考`,tokenIo:`输入/输出比`,tokenPeak:`峰值日`,tokenDaily:`每日 Token`,tokenByModel:`模型 Token`,tokenMiss:`输入(缓存未命中)`,tokenHit:`输入(缓存命中)`,tokenOutput:`输出`,densityLabel:`显示密度`,densityHint:`紧凑减小行高与留白,舒适加大;切换即时生效`,densityCompact:`紧凑`,densityDefault:`默认`,densityComfortable:`舒适`,motionLabel:`动效强度`,motionHint:`关闭后所有入场与数据更新动画静止,保留基础交互反馈`,motionOff:`关闭`,motionSubtle:`克制`,motionRich:`丰富`,settingsNavDisplayPref:`偏好`,settingsNavBudget:`预算`,settingsNavAlert:`提醒`,settingsNavDisplay:`显示`,settingsNavAdvanced:`高级`,settingsNavAbout:`关于`,settingsSearchPlaceholder:`搜索设置…(如:预算、峰谷、单价)`,settingsSearchEmpty:`没有匹配「{query}」的设置项`,sessionsViewAll:`查看全部 {count} 个会话`,sessionViewerSearch:`搜索会话…(标题 / 项目 / id)`,modelBudgetTitle:`按模型预算`,modelBudgetHint:`为单个模型设本月上限(人民币元);跨 80% / 100% 各提醒一次,留空 = 不限。`,modelBudgetBody:`「{model}」本月已 {cost}(预算 {budget} 的 {pct}%)`,modelBudgetPlaceholder:`上限`,moreWorksTitle:`更多作品`,adEngramName:`DSH Engram · 记忆宫殿`,adEngramDesc:`跨会话长期记忆:记忆图谱 · 混合检索 · 知识飞轮`,adRainbowName:`RainbowSpeak · 虹语`,adRainbowDesc:`聊天输入框的彩虹流光边框,持续流动的渐变光环`,kpiDescCacheHit:`缓存命中 token ÷ 总输入 token。命中率越高,输入费用越低(缓存读单价约为未命中的 1/10)。`,kpiDescTokens:`总处理 token = 输入 + 输出。缓存读/写已含在输入内,不重复计数(issue #85 口径)。`,kpiDescAvgCost:`统计范围内总费用 ÷ 总调用次数,单次调用的平均开销。`,kpiDescCalls:`统计范围内的 LLM 调用次数(联网搜索估算不含在内)。`,kpiDescReasoning:`思考(reasoning)token ÷ 输出 token。推理模型的思考部分已计费、含在输出内。`,kpiDescIo:`输入 token ÷ 输出 token。比值高通常意味着长上下文 / 多轮复用。`,kpiDescPeak:`统计范围内单日处理 token(输入+输出)最多的一天。`,healthDotLive:`厂商在线`,healthDotFailed:`厂商探活失败`,healthDotUnknown:`厂商状态未知`,settingsSectionDisplay:`显示偏好`,emptyHint:`运行第一次对话后,这里会自动出现按厂商的用量与费用明细`,tokenViewStructure:`按结构`,tokenViewModel:`按模型`,tokenHitShort:`命中`,tokenMissShort:`未命中`,tokenTotal:`总 Token`,tokenShare:`占比`,usageStatsTool:`注入用量查询`,usageStatsToolHint:`让模型可在对话中查询用量/费用;会占用模型每次请求的上下文,coding 场景建议关闭(切换即时生效)`,balanceGranted:`赠金余额`,balanceTopped:`充值余额`,balanceDaily:`日均消耗`,balanceDaysLong:`约可撑`,balanceDaysUnit:`天`,popTodayModel:`主力消耗模型余额`,popTitle:`用量速览`,popNoConsumption:`暂无消耗`,popDirectLead:`直联`,popSubLead:`订阅`,unpricedHint:`{count} 个模型未收录计价,费用已按 0 计`,searchEstimateHint:`含 {count} 次联网搜索请求的估算费用(每次约 {each};日志无用量事件,按次估算,可在配置 searchCallEstimateCny 调整或关闭)`,siteListDisplay:`中转站列表`,siteListDisplayHint:`隐藏「未识别」占位条目与「未知路由」分组,净化列表`,liveCostBar:`平价消耗胶囊`,liveCostBarHint:`输入框旁的即时代费条,悬浮可看详情`,liveCostBarPosition:`位置`,liveCostBarPosBelow:`输入框下方`,liveCostBarPosAbove:`输入框上方`,liveCostBarPosToolbar:`输入框内部`,exportCsvSite:`按站点 CSV`,panelRelayQuota:`中转站额度`,relayBalance:`余额`,relayNoQuota:`未读出额度`,relayWindowUsed:`已用`,relayKindNewApi:`New API`,relayKindSub2Api:`Sub2API`,relayKindUnknown:`未识别`,expandAll:`全部展开`,collapseAll:`全部收起`,todayOnly:`仅看今日`,todayNoConsumption:`今日暂无消耗`,commandUsageLabel:`打开计费仪表盘`,commandUsageDescription:`查看今日/本月费用、用量明细与费率`,sessionOpen:`打开会话`,sessionOpenFailed:`无法打开该会话(可能已被删除或不在当前会话列表)`,sessionOpenUnavailable:`当前宿主不支持会话跳转`,tabAgents:`智能体`,agentsSummary:`智能体网络`,agentsCount:`智能体`,agentsDelegations:`委派`,agentsRoots:`对话`,agentsMostExpensive:`最贵的一支`,agentsChainTotal:`链合计`,agentsNoData:`暂无子智能体委派记录`,agentsSubagent:`子智能体`,agentsRoot:`对话`,tabQueue:`队列`,queueSubtitle:`非紧急任务只在 DeepSeek 官方低谷启动,按入队顺序串行执行`,queueUntilPeak:`距高峰`,queueUntilOffPeak:`距低谷`,queueUnsupportedTitle:`当前宿主不支持任务队列`,queueUnsupportedBody:`任务队列需要新版宿主的会话创建、Prompt 提交与结果订阅能力。当前宿主会保持只读降级;用量、费用和峰谷提醒不受影响,也不会创建只排队却无法执行的任务。`,queueSafety:`安全边界:任务开始后即使进入高峰也会继续,不会强行暂停;失败或结果无法确认时不自动重试。每个任务在独立会话执行,并按宿主现有权限使用工具。`,queueWorkspace:`工作区`,queueModel:`官方峰谷模型`,queueNoOptions:`未发现可用工作区或内置 DeepSeek 官方峰谷模型,请先完成宿主配置。中转站同名模型不参与。`,queuePromptLabel:`任务 Prompt`,queuePromptPlaceholder:`描述一个非紧急、可无人值守完成的任务。入队即授权宿主在下一低谷创建会话并执行。`,queuePrivacy:`队列文件仅当前用户可读;执行后 Prompt 也会进入宿主会话日志。请勿填入密码或密钥。`,queueEnqueue:`加入低谷队列`,queueImport:`导入 JSON`,queueImportHint:`JSON 数组项可为 Prompt 字符串或 { prompt, cwd?, provider?, model? };缺省沿用当前工作区与模型,整批校验后一次入队。`,queueImported:`已导入 {count} 个任务`,queueImportFormat:`导入文件须为非空 JSON 数组,每项是 Prompt 字符串或任务对象`,queueImportTooLarge:`导入文件超过 10 MiB,未读取或写入任何任务`,queueActive:`任务与历史`,queueClearFinished:`清除已结束`,queueEmpty:`队列是空的。加入一个非紧急任务,下一低谷自动开始。`,queueLoading:`正在读取队列…`,queueOpenSession:`查看会话`,queueRemoveQueued:`移出队列`,queueRemoveHistory:`删除记录`,queueStatusQueued:`等待低谷`,queueStatusStarting:`正在启动`,queueStatusRunning:`执行中`,queueStatusCompleted:`已完成`,queueStatusFailed:`需核对`,quickQueueToggle:`低谷队列`,quickQueueEnqueue:`入队`,quickQueueEnqueueing:`入队中…`,quickQueueWaiting:`{count} 个等待任务`,quickQueueClear:`入队后清稿`,quickQueueEnqueued:`已加入低谷队列,将按队列规则调度`,quickQueueEmpty:`草稿为空,请先输入任务`,quickQueueBusy:`当前草稿正在提交,请稍后再入队`,quickQueueAttachments:`含附件或引用的草稿暂不支持入队,请改用纯文本`,quickQueueContext:`无法读取当前工作区或模型,请在新版宿主中重试`,quickQueueRoute:`当前工作区或模型不支持低谷队列,请选择官方峰谷模型`,quickQueueDraftChanged:`已入队;草稿已变化,未清空`,quickQueueUnsupported:`当前宿主不支持草稿入队,请升级宿主`,quickQueueFailed:`入队失败:{message}`},Qe={title:`Usage`,cost:`Cost`,todayCost:`Today`,monthCost:`This month`,yearCost:`This year`,monthProjected:`Projected`,monthProjectedHint:`Month-to-date + last-7-day pace × days left`,liveTurn:`Turn`,liveSession:`Session`,liveSessionSub:`incl. sub {cost}`,calls:`Calls`,cacheHitRate:`Cache Hit`,tokens:`Tokens`,inputTokens:`Input`,outputTokens:`Output`,avgCost:`Avg cost`,kpiRange:`Range`,avgRangeToday:`Today`,avgRange7d:`7d`,avgRangeWeek:`Week`,avgRangeMonth:`Month`,avgRangeAll:`All`,avgRangeCustom:`Custom`,customRangeStart:`Start date`,customRangeEnd:`End date`,trend:`Daily cost & calls`,trend7d:`7D`,trend30d:`30D`,trendMetric:`Trend metric`,trendMetricCost:`Cost`,trendMetricTokens:`Tokens`,pricingSearch:`Search model or vendor`,bandPinHint:`click to pin to the composer`,trendEmpty:`No trend data yet`,trendTotal:`Total`,roundsUnit:`turns`,healthModelsLive:`{n} models live`,healthVendorsDown:`{n} vendors down`,healthVendorsUnavailable:`{n} vendors unavailable`,budget:`Monthly budget`,budgetRemain:`Remaining`,budgetAmount:`Budget amount`,budgetSummary:`Used {used} / {total} this month; warn at 80%, pulse red at 100%`,sessions:`Sessions`,sessionTitle:`Title`,lastActive:`Last active`,sessionOverflow:`Top {limit} of {total} sessions by cost`,budgetTierBody:`This month {cost} reached {pct}% of the budget {budget}`,models:`Model billing`,providerBilling:`Provider billing & subscriptions`,channelUnknown:`Unknown routes`,directTag:`Direct`,relayTag:`Relay`,unknownTag:`Unknown`,unknownChannelHint:`Channel is not registered in the plugin config; the spending party cannot be verified, so cost stays out of the totals while usage is still counted.`,planCountUnit:`plan(s)`,actual:`Actual`,pricing:`Model pricing`,input:`Input`,output:`Output`,cacheHit:`Cache hit`,peak:`Peak`,offPeak:`Off-peak`,flat:`Flat`,band:`Band`,close:`Close`,footer:`Polls every 30s · local dsh sessions only`,footerCredit:`dsh-ui-usage-billing {version} · MIT`,lastUpdated:`Updated`,noData:`No billing data yet`,todayRate:`Today rate`,rateLive:`Live`,rateBuiltin:`Built-in`,pricingSyncedAt:`Synced`,pricingSyncNow:`Sync now`,pricingSyncing:`Syncing…`,promoBadge:`Promo`,promoUntil:`Promo price until {date}, then list price resumes automatically`,promoOpenEnded:`End date not announced; billed at the discounted rate until further notice, then list price resumes`,pricingTip:`DeepSeek list rates: V4.1 Flash off-peak ¥1 miss / ¥0.02 cache-hit / ¥4 output; V4 Pro off-peak ¥4.5 miss / ¥0.15 cache-hit / ¥13.5 output; peak = 2× off-peak. Weekday 9-12 / 14-18 bills at peak, all other times (weekends included) at off-peak; billed at call time.`,pricingUnit:`Unit: CNY / per 1M tokens`,pricingNotes:`Pricing notes`,ubPeak:`Peak`,ubOff:`Off`,ubStd:`Std`,peakBand:`Peak/off-peak band`,pricingSource:`Data source`,noteCache:`Cache hits are billed at the cache rate, cutting cost.`,noteBand:`Peak and off-peak prices differ; off-peak is roughly half price.`,noteSource:`Prices come from the live rate + model catalog; unlisted models count as 0 and are flagged.`,balance:`Balance`,recharge:`Top up`,rechargeHint:`Open the vendor's official top-up page`,balanceUnconfigured:`Not set`,balanceUnauthorized:`Bad key`,balanceUnreachable:`Unavailable`,uncatalogued:`Not catalogued`,estimatedPricing:`Estimated`,balanceDays:`~{days} days left`,balanceLowBody:`{name} balance {balance}, ~{days} days left, please top up`,reconcileDrift:`Detected {provider} official balance moved {spent}, this panel recorded {today}; the gap usually comes from other tools or APIs consuming too`,reconcileDismiss:`Got it`,subscriptionNotConfigured:`Key not set`,subscriptionUnauthorized:`Bad key`,subscriptionUnavailable:`Unavailable`,subscriptionInvalid:`Bad response`,subscriptionRateLimited:`Rate limited`,subscriptionSession:`Current`,subscriptionWeekly:`Weekly`,subscriptionMonthly:`Monthly`,subscriptionBilling:`Billing`,subscriptionRemaining:`{pct}% left`,subscriptionExhausted:`Exhausted`,subscriptionReset:`Resets {date}`,subscriptionNoApi:`Provider does not offer a usage API`,floatWindow:`Model usage popover`,floatModeCombined:`Combined`,floatModeSubscription:`Subscription card`,floatMode:`Display mode`,floatTargets:`Targets`,floatWindowHint:`Usage summary floating on the footer card; Combined=current style, Subscription cards=one quota card at a time (switchable).`,floatPrimaryToday:`Today`,floatPrimaryWeek:`Week`,floatPrimaryMonth:`Month`,cardDisplay:`Billing card`,cardDisplayHint:`Choose how much space the sidebar entry uses, then set its metric and range. Restore a hidden entry from native Settings or /usage. Tracking and alerts stay active.`,cardMode:`Sidebar entry`,cardModeFull:`Full card`,cardModeCompact:`Compact icon`,cardModeHidden:`Hidden`,cardModeHiddenHint:`Restore: open native Settings → Usage & billing → Full card, or open the dashboard with /usage and return to Settings.`,cardModeFallback:`This host has neither native Settings nor /usage, so Hidden falls back to the compact icon to keep the dashboard reachable.`,nativeSettingsNav:`Usage & billing`,nativeSettingsIntro:`Choose how the sidebar billing entry appears. Changes apply immediately and stay in sync with the dashboard settings.`,nativeSettingsHiddenHint:`The sidebar entry is hidden. Choose Full card or Compact icon to restore it; tracking and alerts remain active.`,cardMetric:`Main metric`,cardMetricMoney:`Cost`,cardMetricTokens:`Tokens`,cardSpan:`Range`,cardSpanDay:`Day`,cardSpanWeek:`Week`,cardSpanMonth:`Month`,cardDeltaBadge:`Day-over-day badge`,cardDeltaShow:`Show`,cardDeltaHide:`Hide`,floatNoTargets:`No subscription selected — pick some in Settings.`,floatNoTargetsHint:`No subscription channel available.`,subscriptionsStale:`Subscription refresh failed — showing cached data`,balanceStaleNotice:`Balance refresh is slow — the figures below come from the last completed query`,staleLedgerNotice:`{count} sessions use legacy-algorithm archives (logs deleted); attribution may be off`,staleSnapshotNotice:`Usage is being recomputed; the figures below come from the last completed calculation (session titles may lag the workspace)`,unreadableNotice:`Usage from {count} sessions is not fully counted (raw logs untouched; no data lost)`,unreadableNoLedgerNotice:`{count} of them have no archived history and are not counted at all`,unreadableFormatNotice:`{count} of them use a session format this host cannot read: newer formats recover after a host upgrade; legacy formats (e.g. v0/v3) need a one-time migration`,tokenCacheWrite:`written`,toolRank:`Tool calls`,toolName:`Tool`,userPrices:`Custom prices`,userPricesHint:`Enter actual per-1M-token prices; main views are re-costed. Pick a model key from the dropdown candidates. Leave source empty for the model default, or enter a relay origin (protocol optional) to price only that source. Fill all three off-peak fields for peak/off-peak estimation; leave them empty for flat pricing.`,userPriceSave:`Save`,userPriceModel:`Model`,userPriceSource:`Source (relay origin)`,userPriceSourceHint:`Empty = default; e.g. https://api.relay.com`,userPriceOffPeak:`Off-peak price`,userPriceNormal:`Standard price`,userPriceCurrency:`Currency`,userPriceAdd:`Add`,userPriceRemoveSelected:`Remove selected`,userPriceSelect:`Select this row`,sessionStaleBadge:`legacy`,sessionUntitled:`Untitled session`,sessionSubCost:`incl. subagents {cost}`,sessionSubCalls:`incl. subagents, {calls} calls`,sessionSubRow:`Subagent`,heatmapLess:`Less`,heatmapMore:`More`,currency:`Currency`,currencyCny:`CNY`,currencyUsd:`USD`,currencyEur:`EUR`,language:`Interface language`,heatmap:`Usage heatmap`,rounds:`Cost per turn`,roundsHint:`Last {count} rounds · bar tops show amount · fill = peak/off-peak`,anomaly:`Cost spike`,model:`Model`,thModel:`Model name`,thInputMiss:`Input (cache miss)`,thInputHit:`Input (cache hit)`,costAbbr:`cost`,tabOverview:`Overview`,tabTrends:`Trends`,tabProviders:`Bills`,tabPricing:`Rates`,tabSettings:`Settings`,budgetHint:`Set a monthly cap for projections and tier alerts`,peakAlertHint:`Alert before a tier switch, optionally via system notification`,peakAlertDescPeak:`About to enter peak hours — prices rise, plan long tasks ahead`,peakAlertDescOff:`About to enter off-peak hours — price halves, ideal for large batches`,peakAlertDescPeakZhipu:`Peak hours soon (weekdays 14:00–18:00) — Coding Plan credits will be deducted at full rate`,peakAlertDescOffZhipu:`Off-peak soon — Coding Plan credits will be deducted at 50% of base credits`,peakAlertQueuePeak:`{count} queued tasks will wait for the next off-peak window; admitted tasks keep running`,peakAlertQueueOff:`{count} queued tasks will start in order`,export:`Export`,exportCsvDay:`Daily CSV`,exportCsvSession:`Sessions CSV`,exportJson:`Full JSON`,peakShare:`Peak vs off-peak`,peakSharePerCall:`per-call attribution, full history`,offPeakSavings:`Shift peak to off-peak: save ~{amount}`,perfMax:`Max TTFT`,weekCost:`This week's spend`,roleCost:`Cost breakdown`,roleUser:`User input`,roleAssistant:`Assistant output`,roleTool:`Tool results`,roleHint:`Estimated: output priced exactly, input split by message size`,tierPeak:`Peak`,tierOff:`Off-peak`,tierToPeak:`until peak`,tierToOff:`until off-peak`,tierAlertEnterPeak:`Peak pricing (2x) starts in {minutes} min — non-urgent calls can wait`,tierAlertEnterOff:`Off-peak pricing (50% off) starts in {minutes} min`,tierAlertEnterPeakZhipu:`Zhipu peak hours in {minutes} min — Coding Plan credits burn at full rate`,tierAlertEnterOffZhipu:`Zhipu off-peak in {minutes} min — credit burn drops to 50%`,peakAlertTitlePeak:`Peak pricing incoming`,peakAlertTitleOff:`Off-peak incoming`,peakAlert:`Peak/off-peak alert`,peakAlertLeadMin:`Lead time (min)`,peakAlertPos:`Position`,peakAlertMode:`Remind mode`,peakAlertPosCorner:`Bottom-right`,peakAlertPosCenter:`Center`,peakAlertModePeak:`Entering peak only`,peakAlertModeOff:`Entering off-peak only`,peakAlertModeBoth:`Both`,peakAlertWebNotify:`Also send system notification`,peakAlertPreview:`Preview alert`,planTypeCode:`Subscription`,planTypeToken:`Usage`,subscriptionFeePerMonth:`{amount}/mo`,triggerToday:`Today's spend`,triggerMonth:`This month's spend`,triggerMonthTokens:`This month's tokens`,triggerTodayTokens:`Today's tokens`,triggerWeekTokens:`This week's tokens`,subscriptionTag:`Plan`,cellEstimateHint:`No pay-as-you-go charge recorded for this row (subscription routes are not billed per call); amount is a catalog-price estimate`,free:`Free`,perfSamples:`Samples`,perfTtft:`TTFT`,perfP50:`P50`,perfP90:`P90`,perfTps:`Speed`,perfLatency:`Total latency`,perfEstimated:`Estimated`,perfEmpty:`No performance data yet`,perfTpsUnit:`tok/s`,perfTitle:`Performance`,perfHint:`Per model & per hour; estimated samples are tool-continuation steps`,perfAll:`All`,perfChartEmpty:`No model selected or no data for this metric`,heatmapYear:`Year`,heatmapHalf:`Half`,heatmapMonth:`Month`,metricCost:`Cost`,metricTokens:`Tokens`,heatmapTotal:`Total`,activeDays:`Active days`,streakDays:`Streak`,subscriptionAutoDetect:`Auto`,pluginAuthor:`Author`,pluginRepository:`Repository`,pluginNpm:`npm`,pluginLicense:`License`,tabToken:`Usage`,tokenExport:`Export tokens`,tokenExportCsv:`Daily token CSV`,tokenReasoningShare:`Reasoning share`,tokenReasoningShort:`reasoning`,tokenIo:`In/out ratio`,tokenPeak:`Peak day`,tokenDaily:`Daily tokens`,tokenByModel:`Tokens by model`,tokenMiss:`Input (cache miss)`,densityLabel:`Display density`,densityHint:`Compact shrinks row height and padding, comfortable adds room; applies instantly`,densityCompact:`Compact`,densityDefault:`Default`,densityComfortable:`Comfortable`,motionLabel:`Motion strength`,motionHint:`Off freezes all entrance and data-update animations; basic interaction feedback remains`,motionOff:`Off`,motionSubtle:`Subtle`,motionRich:`Rich`,settingsNavDisplayPref:`Preferences`,settingsNavBudget:`Budget`,settingsNavAlert:`Alerts`,settingsNavDisplay:`Display`,settingsNavAdvanced:`Advanced`,settingsNavAbout:`About`,settingsSearchPlaceholder:`Search settings… (e.g. budget, peak, price)`,settingsSearchEmpty:`No settings match "{query}"`,sessionsViewAll:`View all {count} sessions`,sessionViewerSearch:`Search sessions… (title / project / id)`,modelBudgetTitle:`Per-model budget`,modelBudgetHint:`Set a monthly cap per model (CNY); alerts fire once each at 80% / 100%. Empty = unlimited.`,modelBudgetBody:`"{model}" has spent {cost} this month ({pct}% of {budget})`,modelBudgetPlaceholder:`Cap`,moreWorksTitle:`More plugins`,adEngramName:`DSH Engram · Memory Palace`,adEngramDesc:`Cross-session long-term memory: graph · hybrid retrieval · flywheel`,adRainbowName:`RainbowSpeak`,adRainbowDesc:`A flowing rainbow marquee border for the chat composer`,kpiDescCacheHit:`Cache-hit tokens ÷ total input tokens. Higher hit rate means lower input cost (cache reads are ~1/10 the miss price).`,kpiDescTokens:`Total tokens = input + output. Cache reads/writes are already part of input and are not double-counted (issue #85).`,kpiDescAvgCost:`Total cost ÷ total calls within the selected range — the average cost per call.`,kpiDescCalls:`LLM calls within the selected range (web-search estimates excluded).`,kpiDescReasoning:`Reasoning tokens ÷ output tokens. A reasoning model's thinking is billed and included in output.`,kpiDescIo:`Input tokens ÷ output tokens. A high ratio usually means long context / multi-turn reuse.`,kpiDescPeak:`The day with the most processed tokens (input + output) in the range.`,healthDotLive:`Vendor online`,healthDotFailed:`Vendor probe failed`,healthDotUnknown:`Vendor status unknown`,settingsSectionDisplay:`Display preferences`,emptyHint:`Run your first conversation and per-provider usage and cost breakdown will appear here automatically`,tokenHit:`Input (cache hit)`,tokenOutput:`Output`,tokenViewStructure:`Structure`,tokenViewModel:`By model`,tokenHitShort:`Hit`,tokenMissShort:`Miss`,tokenTotal:`Total tokens`,tokenShare:`Share`,usageStatsTool:`Inject usage-stats tool`,usageStatsToolHint:`Lets the model query usage/cost inside a conversation; it consumes context per request, so keep it off for coding (takes effect immediately)`,balanceGranted:`Granted`,balanceTopped:`Topped up`,balanceDaily:`Daily burn`,balanceDaysLong:`~days left`,balanceDaysUnit:`days`,popTodayModel:`Main model balance`,popTitle:`Usage overview`,popNoConsumption:`No usage yet`,popDirectLead:`Direct`,popSubLead:`Subscription`,unpricedHint:`{count} models not priced; their cost counts as 0`,searchEstimateHint:`Includes estimated cost of {count} web-search requests (~{each} each; no usage events logged, per-call estimate; tune via searchCallEstimateCny)`,siteListDisplay:`Relay lists`,siteListDisplayHint:`Hide "unidentified" placeholder rows in the relay quota list`,liveCostBar:`Live cost capsule`,liveCostBarHint:`Live cost bar beside the composer; hover for details`,liveCostBarPosition:`Position`,liveCostBarPosBelow:`Below composer`,liveCostBarPosAbove:`Above composer`,liveCostBarPosToolbar:`Inside composer`,exportCsvSite:`By site CSV`,panelRelayQuota:`Relay quotas`,relayBalance:`Balance`,relayNoQuota:`No quota`,relayWindowUsed:`used`,relayKindNewApi:`New API`,relayKindSub2Api:`Sub2API`,relayKindUnknown:`Unknown`,expandAll:`Expand all`,collapseAll:`Collapse all`,todayOnly:`Today only`,todayNoConsumption:`No usage today`,commandUsageLabel:`Open the billing dashboard`,commandUsageDescription:`See today/month spend, usage breakdown and rates`,sessionOpen:`Open session`,sessionOpenFailed:`Could not open this session (it may be deleted or absent from the current list)`,sessionOpenUnavailable:`This host does not support session navigation`,tabAgents:`Agents`,agentsSummary:`Agent network`,agentsCount:`agents`,agentsDelegations:`delegations`,agentsRoots:`conversations`,agentsMostExpensive:`costliest chain`,agentsChainTotal:`chain total`,agentsNoData:`No sub-agent delegation records yet`,agentsSubagent:`sub-agent`,agentsRoot:`conversation`,tabQueue:`Queue`,queueSubtitle:`Non-urgent tasks start only during DeepSeek official off-peak hours, one at a time`,queueUntilPeak:`Peak in`,queueUntilOffPeak:`Off-peak in`,queueUnsupportedTitle:`This host does not support the task queue`,queueUnsupportedBody:`The queue requires Session creation, Prompt admission and result streaming from a newer host. This host stays in read-only fallback: usage, billing and band alerts keep working, and no non-executing placeholder tasks are created.`,queueSafety:`Safety: an admitted task continues if peak pricing begins; it is never forcibly paused. Failures and unknown outcomes never auto-retry. Each task runs in its own Session with the host’s existing tool permissions.`,queueWorkspace:`Workspace`,queueModel:`Official time-of-day model`,queueNoOptions:`No workspace or built-in DeepSeek official time-of-day model is available. Relay mirrors are not eligible.`,queuePromptLabel:`Task Prompt`,queuePromptPlaceholder:`Describe a non-urgent task that can run unattended. Enqueuing authorizes the host to create a Session and run it at the next off-peak window.`,queuePrivacy:`The queue file is owner-only; executed Prompts also enter host Session logs. Do not enter passwords or secrets.`,queueEnqueue:`Enqueue for off-peak`,queueImport:`Import JSON`,queueImportHint:`A JSON array of Prompt strings or { prompt, cwd?, provider?, model? } objects; omitted fields use the current selection. The whole batch is validated before one atomic enqueue.`,queueImported:`Imported {count} tasks`,queueImportFormat:`The import must be a non-empty JSON array of Prompt strings or task objects`,queueImportTooLarge:`The import exceeds 10 MiB; no tasks were read or enqueued`,queueActive:`Tasks & history`,queueClearFinished:`Clear finished`,queueEmpty:`The queue is empty. Add a non-urgent task to start it at the next off-peak window.`,queueLoading:`Loading queue…`,queueOpenSession:`Open Session`,queueRemoveQueued:`Remove`,queueRemoveHistory:`Delete record`,queueStatusQueued:`Waiting`,queueStatusStarting:`Starting`,queueStatusRunning:`Running`,queueStatusCompleted:`Completed`,queueStatusFailed:`Needs review`,quickQueueToggle:`Off-peak queue`,quickQueueEnqueue:`Enqueue`,quickQueueEnqueueing:`Enqueuing…`,quickQueueWaiting:`{count} waiting tasks`,quickQueueClear:`Clear after enqueue`,quickQueueEnqueued:`Added to the off-peak queue; scheduling follows the queue rules`,quickQueueEmpty:`The draft is empty; enter a task first`,quickQueueBusy:`This draft is being submitted; try enqueueing later`,quickQueueAttachments:`Drafts with attachments or references cannot be queued; use plain text`,quickQueueContext:`Cannot read the current workspace or model; retry on a newer host`,quickQueueRoute:`This workspace or model is not eligible; select an official time-of-day model`,quickQueueDraftChanged:`Enqueued; the draft changed, so it was not cleared`,quickQueueUnsupported:`This host does not support draft enqueueing; upgrade the host`,quickQueueFailed:`Enqueue failed: {message}`},$e={"opencode-go":{type:`code`,subscription:{amount:10,currency:`USD`,period:`month`},tier:{amount:10,currency:`USD`,periodDays:7,label:`周额度 $30`}},opencode:{type:`code`,subscription:{amount:10,currency:`USD`,period:`month`},tier:{amount:10,currency:`USD`,periodDays:7,label:`周额度 $30`}},"kimi-coding":{type:`code`},"zai-coding-cn":{type:`code`},"zai-coding":{type:`code`},commandcode:{type:`code`},"qwen-token-plan":{type:`code`},"qwen-token-plan-cn":{type:`code`},"xiaomi-token-plan-ams":{type:`code`},"xiaomi-token-plan-cn":{type:`code`},"xiaomi-token-plan-sgp":{type:`code`},"volcengine-token-plan":{type:`code`},"ark-token-plan":{type:`code`},"doubao-token-plan":{type:`code`},minimax:{type:`code`},"minimax-cn":{type:`code`},"minimax-token-plan":{type:`code`},"minimax-token-plan-cn":{type:`code`},"hunyuan-token-plan":{type:`code`},"tencent-token-plan":{type:`code`},"hy-token-plan":{type:`code`},"xinghuo-token-plan":{type:`code`},"xfyun-coding":{type:`code`},"spark-coding":{type:`code`},"huawei-token-plan":{type:`code`},"pangu-token-plan":{type:`code`},"huawei-maas-token-plan":{type:`code`},"volcengine-agent-plan":{type:`code`},"ark-agent-plan":{type:`code`},"baidu-token-plan":{type:`code`},"ernie-token-plan":{type:`code`},"wenxin-token-plan":{type:`code`}},et={glm:`zai-coding-cn`,bigmodel:`zai-coding-cn`,zhipu:`zai-coding-cn`,zhipuai:`zai-coding-cn`,zai:`zai-coding`,ark:`volcengine-token-plan`,volcengine:`volcengine-token-plan`,doubao:`doubao-token-plan`,moonshot:`kimi-coding`,kimi:`kimi-coding`,xiaomi:`xiaomi-token-plan-cn`,opencode:`opencode-go`};function U(e){return e===``?e:et[e]??e}function tt(e){let t=$e[U(e)];return t?.type===`code`?t.tier:void 0}let nt=[{key:`deepseek-v4-flash`,input:.14,cacheHit:.0028,output:.28},{key:`deepseek-v4-pro`,input:.435,cacheHit:.003625,output:.87},{key:`gpt-5.6-sol`,input:5,cacheHit:.5,output:30},{key:`gpt-5.6-terra`,input:2,cacheHit:.2,output:12},{key:`gpt-5.6-luna`,input:.2,cacheHit:.02,output:1.2},{key:`glm-5.2`,input:1.4,cacheHit:.26,output:4.4},{key:`qwen3.8-max`,input:2,cacheHit:.21,output:6},{key:`kimi-k3`,input:2.82,cacheHit:.28,output:14.08},{key:`grok-4.6`,input:2,cacheHit:.5,output:6},{key:`gemini-2.5-pro`,input:1.25,cacheHit:.125,output:10}],W,rt,it,at,ot,st;function ct(e){let t=/:\/\//.test(e)?e:`https://${e}`;try{return new URL(t).origin}catch{return e.trim().toLowerCase().replace(/\/+$/,``)}}function lt(e,t){return ct(e)===ct(t)}function ut(e){st=e.length>0?e:void 0}function dt(){return st}function ft(e){return $t(e)}function pt(e,t){let n=mt(e,t);if(n!==void 0)return{input:n.input,cacheHit:n.cacheHit,output:n.output,...n.currency===void 0?{}:{currency:n.currency},...n.offPeak===void 0?{}:{offPeak:n.offPeak}}}function mt(e,t){if(st===void 0)return;let n=ft(e),r=Ht(n),i=e=>ft(e.key)===n||Ht(e.key)===r;if(t!==void 0){for(let e of st)if(e.origin!==void 0&&e.origin!==``&&i(e)&&lt(e.origin,t))return e}for(let e of st)if((e.origin===void 0||e.origin===``)&&i(e))return e}function ht(e){if(st===void 0)return;let t=ft(e),n=Ht(t);return st.find(e=>e.origin!==void 0&&e.origin!==``&&(ft(e.key)===t||Ht(e.key)===n))}function gt(e){W=typeof e.rate==`number`&&Number.isFinite(e.rate)&&e.rate>0?e.rate:void 0,rt=typeof e.rateEur==`number`&&Number.isFinite(e.rateEur)&&e.rateEur>0?e.rateEur:void 0,it=e.prices,at=e.extraModels}function _t(e){ot=e}function vt(){return W??6.79}function yt(){return rt??7.71}function bt(){return{rate:vt(),live:W!==void 0}}function xt(){return{rate:yt(),live:rt!==void 0}}let St=.5;function Ct(e){return e==null||!Number.isFinite(e)?`peak`:wt(e,Ot,!0)}function wt(e,t,n=!1){if(Tt(e)||n&&Dt(e))return`offPeak`;let r=Math.floor(At(e)/6e4);for(let e=0;e+1<t.length;e+=2){let n=t[e]??0,i=t[e+1]??0;if(r>=n&&r<i)return`peak`}return`offPeak`}function Tt(e){let t=new Date(e+288e5).getUTCDay();return t===0||t===6}function Et(e){return new Date(e+288e5).toISOString().slice(0,10).replace(/-/g,``)}function Dt(e){return`20260925 20260926 20260927 20261001 20261002 20261003 20261004 20261005 20261006 20261007`.includes(Et(e))}let Ot=[540,720,840,1080],kt=[840,1080];function At(e){return((e+288e5)%864e5+864e5)%864e5}function jt(e,t,n=!1){let r=wt(e,t,n),i=At(e);for(let a=0;a<10;a++){let o=a*864e5-i;for(let i of t){let a=o+i*6e4;if(!(a<=0)&&wt(e+a,t,n)!==r)return{tier:r,nextSwitchInMs:a}}}let a=t[0]??0;return{tier:r,nextSwitchInMs:864e5-i+a*6e4}}function Mt(e,t,n,r=!1){let{nextSwitchInMs:i}=jt(e,t,r);if(i>n)return null;let a=e+i;return{entering:wt(a,t,r),atMs:a}}function Nt(e,t){if(e===void 0||e===``)return`none`;let n=$t(e),r=zt().find(e=>e.key===n)?.provider;return r===`DeepSeek`?`deepseek-metered`:t&&r===`智谱 AI`?`zhipu-coding-plan`:`none`}function Pt(e,t){switch(t){case`deepseek-metered`:return jt(e,Ot,!0);case`zhipu-coding-plan`:return jt(e,kt);case`none`:return null}}function Ft(e,t,n){switch(t){case`deepseek-metered`:return Mt(e,Ot,n,!0);case`zhipu-coding-plan`:return Mt(e,kt,n);case`none`:return null}}function It(e){let t=Math.max(1,Math.ceil(e/6e4)),n=Math.floor(t/60),r=t%60;return n>0?`${n}h${String(r).padStart(2,`0`)}m`:`${r}m`}let G=[],Lt={};function Rt(e,t){G=e,Lt=t,Ut=void 0}function zt(){return G}function Bt(){return Lt}let Vt={key:`other`,name:`其他模型`,provider:`Custom`,colorVar:`dsw-static-neutral-bluish-500`,price:{currency:`CNY`,input:0,cacheHit:0,cacheMiss:0,output:0}};function Ht(e){return String(e).toLowerCase().replace(/\([^)]*\)/g,``).replace(/[^a-z0-9]+/g,``)}let Ut;function Wt(){if(Ut!==void 0)return Ut;let e=new Map,t=(t,n)=>{let r=Ht(t);r!==``&&!e.has(r)&&e.set(r,n)};for(let e of G)t(e.key,e.key);for(let[e,n]of Object.entries(Lt))t(e,n);for(let e of nt)t(e.key,e.key);return Ut=e,e}let Gt,Kt,qt;function Jt(){if(Gt===at)return;let e=new Map,t=new Map;for(let n of at??[]){t.has(n.key)||t.set(n.key,n);let r=Ht(n.key);r!==``&&!e.has(r)&&e.set(r,n)}Gt=at,Kt=e,qt=t}function Yt(){return Jt(),Kt??new Map}function Xt(){return Jt(),qt??new Map}function Zt(e){let t=[],n=e=>{e!==``&&!t.includes(e)&&t.push(e)},r=e=>{let t=e;for(;;){let e=t.replace(/[-_]\d{3,}$/u,``);if(e===t||e===``)return;t=e,n(t)}},i=e.lastIndexOf(`/`);if(i>0&&i<e.length-1){let t=e.slice(i+1);n(t),r(t)}return r(e),t}function Qt(e){let t=Bt()[e];if(t!==void 0)return t;let n=Ht(e);if(n===``)return;let r=Wt().get(n);return r===void 0?Yt().get(n)?.key:r}function $t(e){let t=Bt()[e]??e;if(t===e){let t=Ht(e);if(t!==``){let e=Wt().get(t);if(e!==void 0)return e;let n=Yt().get(t);if(n!==void 0)return n.key}for(let t of Zt(e)){let e=Qt(t);if(e!==void 0)return e}}return t}function en(e){let t=$t(e),n=it?.[t];if(n!==void 0)return n;let r=nt.find(e=>e.key.toLowerCase()===t.toLowerCase());if(r!==void 0)return{input:r.input,cacheHit:r.cacheHit,output:r.output}}function tn(e){let t=$t(e),n=zt().find(e=>e.key===t),r=Xt().get(t),i=n??(r===void 0?zt().find(e=>e.key===`other`)??Vt:nn(r)),a=pt(t);if(a!==void 0)return{...i,userPriced:!0,price:{currency:a.currency??`CNY`,input:a.input,cacheHit:a.cacheHit,output:a.output,...a.offPeak===void 0?{}:{offPeak:a.offPeak}}};let o=en(t);return o===void 0||i.price.offPeak!==void 0?i:{...i,price:{currency:`USD`,input:o.input,cacheHit:o.cacheHit,output:o.output}}}function nn(e){return{key:e.key,name:e.name,provider:e.provider,colorVar:`dsw-static-neutral-400`,price:{currency:`USD`,input:e.price.input,cacheHit:e.price.cacheHit,output:e.price.output}}}function rn(e,t){let n=e.endsAtMs!==void 0&&t>=e.endsAtMs;return Number.isFinite(t)&&!n&&e.factor>=0&&e.factor<1}function an(e,t){let{promo:n}=e;if(n===void 0||!rn(n,t))return e;let r=e=>{let t=n.factors?.[e];return t!==void 0&&t>=0&&t<1?t:n.factor},i=e=>({input:e.input*r(`input`),cacheHit:e.cacheHit*r(`cacheHit`),...e.cacheMiss===void 0?{}:{cacheMiss:e.cacheMiss*r(`cacheMiss`)},output:e.output*r(`output`)});return{...e,price:{...i(e.price),currency:e.price.currency,...e.price.offPeak===void 0?{}:{offPeak:i(e.price.offPeak)}}}}function on(e=Date.now()){let t=[...zt().filter(e=>e.retired!==!0).map(t=>an(t,e))],n=new Set(t.map(e=>e.key.toLowerCase())),r=new Set(t.map(e=>Ht(e.key)));for(let e of ot??[]){let i=e.id.toLowerCase();if((()=>{let t=$t(e.id);return zt().find(e=>e.key===t)})()!==void 0)continue;let a=Ht(e.id);if(n.has(i)||a!==``&&r.has(a))continue;let o=Yt().get(a),s;if(o!==void 0)s=nn(o),e.name!==void 0&&e.name!==``&&(s={...s,name:e.name});else{let t=en(i);s=t===void 0?{key:$t(e.id),name:e.name??e.id,provider:e.provider,colorVar:`dsw-static-neutral-400`,price:{currency:`USD`,input:0,cacheHit:0,output:0},uncatalogued:!0}:{key:i,name:e.name??e.id,provider:e.provider,colorVar:`dsw-static-neutral-400`,price:{currency:`USD`,input:t.input,cacheHit:t.cacheHit,output:t.output}}}n.add(s.key.toLowerCase()),a!==``&&r.add(a),t.push(s)}return t.map(e=>{let t=pt(e.key);return t===void 0?e:{...e,userPriced:!0,price:{currency:t.currency??`CNY`,input:t.input,cacheHit:t.cacheHit,output:t.output}}})}function sn(e,t,n){let r=t.cacheMiss>0?t.cacheMiss:Math.max(0,t.input-t.cacheHit),i=Math.min(t.cacheHit,t.input),a=(r*(e.cacheMiss??e.input)+i*e.cacheHit+t.output*e.output)/1e6;return n===`USD`?a*vt():a}function cn(e,t,n=St,r=Date.now()){let i=an(e,r),a=sn(i.price,t,i.price.currency),o=i.price.offPeak===void 0?a:sn(i.price.offPeak,t,i.price.currency);return a*n+o*(1-n)}function ln(e){let t=vt();return t>0?e/t:e}function un(e,t){if(t===`usd`)return ln(e);if(t===`eur`){let t=yt();return t>0?e/t:e}return e}function dn(e,t=`cny`){let n=Number(e),r=t===`usd`?`$`:t===`eur`?`€`:`¥`;return!Number.isFinite(n)||n<=0?`${r}0`:n>=1e3?`${r}${n.toFixed(0)}`:n>=10?`${r}${n.toFixed(1)}`:n>=.1?`${r}${n.toFixed(2)}`:`${r}${n.toFixed(3)}`}function fn(e,t=`CNY`){return`${t===`USD`?`$`:t===`EUR`?`€`:`¥`}${e.toFixed(e>=10?1:2)}`}function pn(e,t,n,r){if(r<=0||!Number.isFinite(r))return e;let i=t===`USD`?e*r:e;if(n===`cny`)return i;if(n===`usd`)return i/r;let a=xt().rate;return a>0?i/a:i}function K(e=Date.now()){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}`}function q(e){return e>=1e9?`${(e/1e9).toFixed(2)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function mn(e){let t=Number(e);return Number.isFinite(t)?`${t.toFixed(1)}%`:`0.0%`}function hn(e){return/[",\r\n]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function gn(e){return/^[=+\-@\t\r]/.test(e)?`'${e}`:e}function _n(e){return e.toFixed(2)}function vn(e){return[`date,calls,input,output,cache_hit,cache_miss,cost_cny`,...Object.keys(e).sort().map(t=>{let n=e[t];return n===void 0?``:[t,n.calls,n.input,n.output,n.cacheHit,n.cacheMiss,_n(n.cost)].join(`,`)})].join(`
2
+ `)}function yn(e){return[`site,kind,calls,cost_cny`,...Object.entries(e).map(([e,t])=>{let n=e.startsWith(`site:`)?e.slice(5):e.startsWith(`direct:`)?e.slice(7):`unknown`,r=e.startsWith(`site:`)?`site`:e.startsWith(`direct:`)?`direct`:`unknown`;return[hn(gn(n)),r,t.calls,_n(t.cost)].join(`,`)})].join(`
3
+ `)}function bn(e){return e===void 0?``:e.split(/[\\/]/).filter(Boolean).pop()??e}function xn(e){return[`session_id,title,project,calls,cost_cny,last_active,parent_id,sub_calls,sub_cost_cny`,...e.map(e=>[hn(gn(e.id)),hn(gn(e.title??``)),hn(gn(bn(e.cwd))),e.calls,_n(e.cost),e.lastActive>0?new Date(e.lastActive).toISOString():``,e.parentId??``,e.subCalls??``,e.subCost===void 0?``:_n(e.subCost)].join(`,`))].join(`
4
+ `)}function Sn(e,t,n){let r=[...n].sort(),i=r[0],a=r.at(-1);return`${e}${i!==void 0&&a!==void 0?`-${i}_${a}`:``}.${t}`}function Cn(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:n})),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),setTimeout(()=>URL.revokeObjectURL(r),0)}function wn(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(Math.round(e))}let J={top:14,right:18,bottom:22,left:46},Tn=`var(--ds-blue)`,En=`var(--ds-cyan)`,Dn=`var(--ds-amber)`;function On(e,t,n,r){return JSON.stringify({days:e,models:t,dayModels:n,total:r},null,2)}function kn(e){let{stats:t,trendDays:n,onTrendDays:r,t:i}=e,a=e.money,o=e.models??[],{byDay:s,byModel:c,total:l}=t,[u,f]=(0,d.useState)(null),[p,h]=(0,d.useState)(`structure`),[g,_]=(0,d.useState)(null),v=t.byDayModels!==void 0,b=e=>{h(e),_(null)},x=(0,d.useMemo)(()=>{let e=t.byRole;if(e===void 0)return[];let n=e.user+e.assistant+e.tool;return n<=0?[]:[{label:i(`roleUser`),value:e.user,seg:B.shareSegUser},{label:i(`roleAssistant`),value:e.assistant,seg:B.shareSegAssistant},{label:i(`roleTool`),value:e.tool,seg:B.shareSegTool}].map(e=>({...e,pct:e.value/n*100}))},[t.byRole,i]),S=(0,d.useMemo)(()=>{let e=[];for(let t=n-1;t>=0;--t){let n=new Date;n.setDate(n.getDate()-t);let r=K(n.getTime()),i=s[r];e.push({date:r,miss:i?.cacheMiss??0,hit:i?.cacheHit??0,output:i?.output??0,reasoning:i?.reasoning??0})}return e},[s,n]),C=(0,d.useMemo)(()=>{let e=[];for(let r=n-1;r>=0;--r){let n=new Date;n.setDate(n.getDate()-r);let i=K(n.getTime()),a=t.byDayModels?.[i],o={},s=0;if(a!==void 0)for(let[e,t]of Object.entries(a)){let n=t.cacheHit??0,r=t.cacheMiss??0,i=t.output??0,a=n+r+i;a<=0||(o[e]={hit:n,miss:r,output:i,total:a},s+=a)}e.push({date:i,models:o,total:s})}return e},[t.byDayModels,n]),w=(0,d.useMemo)(()=>{let e=new Map;for(let t of C)for(let[n,r]of Object.entries(t.models))e.set(n,(e.get(n)??0)+r.total);return[...e.entries()].sort((e,t)=>t[1]-e[1]).map(([e])=>({key:e,name:o.find(t=>t.key===e)?.name??tn(e).name,color:o.find(t=>t.key===e)?.color??`#8b95a3`}))},[C,o]),T=g!==null&&w.some(e=>e.key===g)?g:null,ee=e=>{if(v){if(p!==`model`){h(`model`),_(e);return}_(t=>t===e?null:e)}},E=(0,d.useMemo)(()=>{let e=0;return Object.entries(c).filter(([,e])=>e.calls>0).map(([t,n])=>{let r=n.input+n.output;e+=r;let i=n.cacheHit+n.cacheMiss;return{key:t,name:tn(t).name,input:n.input,output:n.output,reasoning:n.reasoning??0,calls:n.calls,cacheHit:n.cacheHit,cacheMiss:n.cacheMiss,cacheHitRate:i>0?n.cacheHit/i*100:0,total:r,share:0}}).sort((e,t)=>t.total-e.total).map(t=>({...t,share:e>0?t.total/e:0}))},[c]),D=(0,d.useMemo)(()=>{let e=Object.entries(t.byTool??{}),n=e.slice(0,8),r=e.slice(8).reduce((e,[,t])=>e+t,0),i=e.reduce((e,[,t])=>e+t,0);return{top:n,rest:r>0?[[`…`,r]]:[],totalCalls:i}},[t.byTool]),O=(0,d.useMemo)(()=>{let e=S.length;if(e===0)return null;let t=680-J.left-J.right,n=200-J.top-J.bottom,r=Math.max(...p===`model`?C.map(e=>e.total):S.map(e=>e.miss+e.hit+e.output),1),i=e=>J.top+n-e/r*n,a=t/e,o=Math.min(20,a*.6),s=n=>e===1?J.left+t/2:J.left+t*n/(e-1),c=Math.max(1,Math.ceil(e/8)),l=[];for(let t=0;t<e;t+=c)l.push(t);return e>0&&l[l.length-1]!==e-1&&l.push(e-1),{n:e,plotW:t,plotH:n,max:r,y:i,barW:o,inner:s,indices:l,groupW:a}},[S,C,p]),k=()=>{Cn(`token-daily-${K()}.csv`,An(S),`text/csv`)},A=()=>{Cn(`token-${K()}.json`,On(S,E,C,l),`application/json`)},j=u===null?void 0:S[u],M=u===null?void 0:C[u],te=O===null?0:Math.ceil(80/Math.max(O.groupW,1)),ne=u===null||O===null?void 0:u>=O.n-te?B.chartTooltipAlignRight:u<te?B.chartTooltipAlignLeft:void 0;return(0,m.jsxs)(`div`,{className:B.tokenPanel,"data-testid":`billing-token-panel`,children:[(0,m.jsxs)(`div`,{className:B.exportBar,role:`group`,"aria-label":i(`tokenExport`),children:[(0,m.jsx)(`span`,{className:B.exportLabel,children:i(`export`)}),(0,m.jsx)(`button`,{type:`button`,className:B.exportButton,"data-testid":`billing-token-export-csv`,onClick:k,children:i(`tokenExportCsv`)}),(0,m.jsx)(`button`,{type:`button`,className:B.exportButton,"data-testid":`billing-token-export-json`,onClick:A,children:i(`exportJson`)})]}),(0,m.jsxs)(`section`,{className:B.panel,"data-testid":`billing-token-daily`,children:[(0,m.jsxs)(`div`,{className:B.panelHead,children:[(0,m.jsx)(`h3`,{className:B.panelTitle,children:i(`tokenDaily`)}),(0,m.jsxs)(`span`,{className:B.panelHeadControls,children:[v&&(0,m.jsx)(`span`,{className:B.rangeToggle,role:`group`,"aria-label":i(`tokenDaily`),children:[`structure`,`model`].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(B.rangeButton,p===e&&B.rangeButtonActive),"aria-pressed":p===e,onClick:()=>{b(e)},"data-testid":`billing-token-view-${e}`,children:i(e===`structure`?`tokenViewStructure`:`tokenViewModel`)},e))}),(0,m.jsx)(`span`,{className:B.rangeToggle,role:`group`,"aria-label":i(`tokenDaily`),children:[7,30].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(B.rangeButton,n===e&&B.rangeButtonActive),"aria-pressed":n===e,onClick:()=>{r(e)},"data-testid":`billing-token-${e}d`,children:i(e===7?`trend7d`:`trend30d`)},e))})]})]}),O===null||p===`model`&&w.length===0?(0,m.jsx)(`div`,{className:B.chartEmpty,children:i(`trendEmpty`)}):(0,m.jsxs)(`div`,{className:B.chartWrap,children:[(0,m.jsxs)(`svg`,{viewBox:`0 0 680 200`,className:B.chartSvg,role:`img`,"aria-label":i(`tokenDaily`),onMouseLeave:()=>{f(null)},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),n=((e.clientX-t.left)/t.width*680-J.left)/O.plotW,r=Math.round(n*(O.n-1));f(Math.min(Math.max(r,0),O.n-1))},children:[[0,.5,1].map(e=>{let t=O.max*e,n=O.y(t);return(0,m.jsxs)(`g`,{children:[(0,m.jsx)(`line`,{x1:J.left,x2:680-J.right,y1:n,y2:n,className:B.chartGrid}),(0,m.jsx)(`text`,{x:J.left-8,y:n+3,textAnchor:`end`,className:B.chartAxisLabel,children:wn(t)})]},e)}),p===`structure`?S.map((e,t)=>{let n=O.inner(t)-O.barW/2,r=O.y(0),i=O.y(e.miss),a=O.y(e.miss+e.hit),o=O.y(e.miss+e.hit+e.output);return(0,m.jsxs)(`g`,{children:[(0,m.jsx)(`rect`,{x:n,y:i,width:O.barW,height:r-i,fill:Tn}),(0,m.jsx)(`rect`,{x:n,y:a,width:O.barW,height:i-a,fill:En}),(0,m.jsx)(`rect`,{x:n,y:o,width:O.barW,height:a-o,fill:Dn})]},e.date)}):C.map((e,t)=>{let n=O.inner(t)-O.barW/2,r=0;return(0,m.jsx)(`g`,{children:w.map(t=>{let i=e.models[t.key];if(i===void 0)return null;let a=O.y(r);r+=i.total;let o=O.y(r),s=T!==null&&t.key!==T;return(0,m.jsx)(`rect`,{x:n,y:o,width:O.barW,height:a-o,fill:t.color,opacity:s?.15:1},t.key)})},e.date)}),O.indices.map(e=>{let t=S[e];return t===void 0?null:(0,m.jsx)(`text`,{x:O.inner(e),y:194,textAnchor:`middle`,className:B.chartAxisLabel,children:t.date.slice(5)},t.date)}),u!==null&&(0,m.jsx)(`line`,{x1:O.inner(u),x2:O.inner(u),y1:J.top,y2:J.top+O.plotH,className:B.chartCrosshair})]}),u!==null&&p===`structure`&&j!==void 0&&(0,m.jsxs)(`div`,{className:y(B.chartTooltip,ne),"data-testid":`billing-token-tooltip`,style:{left:`${O.inner(u)/680*100}%`,top:`${O.y(j.miss+j.hit+j.output)/200*100}%`},children:[(0,m.jsxs)(`div`,{className:B.chartTooltipHead,children:[(0,m.jsx)(`span`,{className:B.chartTooltipDate,children:j.date}),(0,m.jsx)(`strong`,{children:(j.miss+j.hit+j.output).toLocaleString()})]}),(0,m.jsxs)(`div`,{className:y(B.chartTooltipRow,B.chartTooltipSplit),children:[(0,m.jsxs)(`span`,{className:B.chartTooltipLabel,children:[(0,m.jsx)(`span`,{className:B.chartTooltipSwatch,style:{background:En}}),i(`tokenHit`)]}),(0,m.jsx)(`strong`,{children:j.hit.toLocaleString()})]}),(0,m.jsxs)(`div`,{className:y(B.chartTooltipRow,B.chartTooltipSplit),children:[(0,m.jsxs)(`span`,{className:B.chartTooltipLabel,children:[(0,m.jsx)(`span`,{className:B.chartTooltipSwatch,style:{background:Tn}}),i(`tokenMiss`)]}),(0,m.jsx)(`strong`,{children:j.miss.toLocaleString()})]}),(0,m.jsxs)(`div`,{className:y(B.chartTooltipRow,B.chartTooltipSplit),children:[(0,m.jsxs)(`span`,{className:B.chartTooltipLabel,children:[(0,m.jsx)(`span`,{className:B.chartTooltipSwatch,style:{background:Dn}}),i(`tokenOutput`)]}),(0,m.jsx)(`strong`,{children:j.output.toLocaleString()})]})]}),u!==null&&p===`model`&&M!==void 0&&(0,m.jsxs)(`div`,{className:y(B.chartTooltip,ne),"data-testid":`billing-token-tooltip`,style:{left:`${O.inner(u)/680*100}%`,top:`${O.y(M.total)/200*100}%`},children:[(0,m.jsxs)(`div`,{className:B.chartTooltipHead,children:[(0,m.jsx)(`span`,{className:B.chartTooltipDate,children:M.date}),(0,m.jsx)(`strong`,{children:M.total.toLocaleString()})]}),w.map(e=>{let t=M.models[e.key];return t===void 0?null:(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`div`,{className:y(B.chartTooltipRow,B.chartTooltipSplit),children:[(0,m.jsxs)(`span`,{className:B.chartTooltipLabel,children:[(0,m.jsx)(`span`,{className:B.chartTooltipSwatch,style:{background:e.color}}),e.name]}),(0,m.jsx)(`strong`,{children:t.total.toLocaleString()})]}),(0,m.jsxs)(`div`,{className:B.chartTooltipModelDetail,children:[i(`tokenHitShort`),` `,t.hit.toLocaleString(),` · `,i(`tokenMissShort`),` `,t.miss.toLocaleString(),` · `,i(`tokenOutput`),` `,t.output.toLocaleString()]})]},e.key)})]}),(0,m.jsx)(`div`,{className:B.chartLegend,children:p===`structure`?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:B.chartTooltipSwatch,style:{background:Tn}}),i(`tokenMiss`)]}),(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:B.chartTooltipSwatch,style:{background:En}}),i(`tokenHit`)]}),(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:B.chartTooltipSwatch,style:{background:Dn}}),i(`tokenOutput`)]})]}):w.map(e=>(0,m.jsxs)(`button`,{type:`button`,className:y(B.chartLegendItem,T===e.key&&B.chartLegendItemActive),"aria-pressed":T===e.key,"data-testid":`billing-token-legend-${e.key}`,onClick:()=>{ee(e.key)},children:[(0,m.jsx)(`span`,{className:B.chartTooltipSwatch,style:{background:e.color}}),e.name]},e.key))})]})]}),(0,m.jsxs)(`section`,{className:B.panel,"data-testid":`billing-token-models`,children:[(0,m.jsx)(`div`,{className:B.panelHead,children:(0,m.jsx)(`h3`,{className:B.panelTitle,children:i(`tokenByModel`)})}),E.length===0?(0,m.jsx)(`div`,{className:B.emptyRow,children:i(`noData`)}):(0,m.jsx)(`div`,{className:B.tableScroll,children:(0,m.jsxs)(`table`,{className:B.modelTable,"data-testid":`billing-token-model-table`,children:[(0,m.jsx)(`thead`,{children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{children:i(`model`)}),(0,m.jsx)(`th`,{className:B.numCol,children:i(`inputTokens`)}),(0,m.jsx)(`th`,{className:B.numCol,children:i(`outputTokens`)}),(0,m.jsx)(`th`,{className:B.numCol,children:i(`tokenReasoningShort`)}),(0,m.jsx)(`th`,{className:B.numCol,children:i(`cacheHitRate`)}),(0,m.jsx)(`th`,{className:B.numCol,children:i(`tokenTotal`)}),(0,m.jsx)(`th`,{className:B.numCol,children:i(`tokenShare`)}),(0,m.jsx)(`th`,{className:B.numCol,children:i(`calls`)})]})}),(0,m.jsx)(`tbody`,{children:E.map(e=>(0,m.jsxs)(`tr`,{"data-testid":`billing-token-model`,className:y(v&&B.modelRowFocusable,T===e.key&&B.modelRowActive),"aria-selected":v?T===e.key:void 0,onClick:v?()=>{ee(e.key)}:void 0,tabIndex:v?0:void 0,onKeyDown:v?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),ee(e.key))}:void 0,children:[(0,m.jsx)(`td`,{children:(0,m.jsx)(`span`,{className:B.modelName,children:e.name})}),(0,m.jsx)(`td`,{className:B.numCol,children:q(e.input)}),(0,m.jsx)(`td`,{className:B.numCol,children:q(e.output)}),(0,m.jsx)(`td`,{className:B.numCol,children:e.reasoning>0?q(e.reasoning):(0,m.jsx)(`span`,{className:B.na,children:`—`})}),(0,m.jsxs)(`td`,{className:B.numCol,children:[e.cacheHitRate.toFixed(1),`%`]}),(0,m.jsx)(`td`,{className:B.numCol,children:q(e.total)}),(0,m.jsx)(`td`,{className:B.numCol,children:(0,m.jsxs)(`span`,{className:B.tokenModelShareRow,children:[(0,m.jsx)(`span`,{className:B.tokenModelBar,children:(0,m.jsxs)(`span`,{className:B.tokenModelParts,style:{width:`${(e.share*100).toFixed(2)}%`},children:[(0,m.jsx)(`span`,{className:B.tokenModelPartIn,style:{width:`${e.total>0?e.input/e.total*100:0}%`}}),(0,m.jsx)(`span`,{className:B.tokenModelPartOut,style:{width:`${e.total>0?e.output/e.total*100:0}%`}})]})}),(e.share*100).toFixed(1),`%`]})}),(0,m.jsx)(`td`,{className:B.numCol,children:e.calls.toLocaleString()})]},e.key))})]})})]}),D.totalCalls>0&&(0,m.jsxs)(`section`,{className:B.panel,"data-testid":`billing-token-tools`,children:[(0,m.jsx)(`div`,{className:B.panelHead,children:(0,m.jsx)(`h3`,{className:B.panelTitle,children:i(`toolRank`)})}),(0,m.jsx)(`div`,{className:B.tableScroll,children:(0,m.jsxs)(`table`,{className:B.modelTable,"data-testid":`billing-tool-table`,children:[(0,m.jsx)(`thead`,{children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{children:i(`toolName`)}),(0,m.jsx)(`th`,{className:B.numCol,children:i(`calls`)}),(0,m.jsx)(`th`,{className:B.numCol,children:i(`tokenShare`)})]})}),(0,m.jsx)(`tbody`,{children:[...D.top,...D.rest].map(([e,t])=>(0,m.jsxs)(`tr`,{"data-testid":`billing-tool-row`,children:[(0,m.jsx)(`td`,{children:(0,m.jsx)(`span`,{className:B.modelName,children:e})}),(0,m.jsx)(`td`,{className:B.numCol,children:t.toLocaleString()}),(0,m.jsxs)(`td`,{className:B.numCol,children:[(t/D.totalCalls*100).toFixed(1),`%`]})]},e))})]})})]}),x.length>0&&(0,m.jsxs)(`section`,{className:B.panel,"data-testid":`billing-panel-roles`,children:[(0,m.jsxs)(`div`,{className:B.panelHead,children:[(0,m.jsx)(`h3`,{className:B.panelTitle,children:i(`roleCost`)}),(0,m.jsx)(`span`,{className:B.panelHint,children:i(`roleHint`)})]}),(0,m.jsx)(`div`,{className:B.shareTrack,"data-testid":`billing-role-track`,children:x.map(e=>(0,m.jsx)(`div`,{className:y(B.shareSeg,e.seg),style:{width:`${e.pct}%`}},e.label))}),(0,m.jsx)(`div`,{className:B.shareLegend,children:x.map(e=>(0,m.jsxs)(`span`,{className:B.shareItem,children:[(0,m.jsx)(`span`,{className:y(B.shareDot,e.seg)}),e.label,(0,m.jsxs)(`span`,{className:B.shareValue,children:[a(e.value),` · `,e.pct.toFixed(1),`%`]})]},e.label))})]})]})}function An(e){return[`date,missInput,cacheHit,output,reasoning,total`,...e.map(e=>`${e.date},${e.miss},${e.hit},${e.output},${e.reasoning},${e.miss+e.hit+e.output}`)].join(`
5
+ `)}function jn(){let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}let Y={top:18,right:40,bottom:26,left:46};function Mn(e){let[,t,n]=e.split(`-`);return`${Number(t)}/${Number(n)}`}function Nn(e,t){let n=[];for(let r=0;r<e;r+=t)n.push(r);return e>0&&n[n.length-1]!==e-1&&n.push(e-1),n}let Pn={key:`__total__`,name:``,color:``};function Fn({data:e,models:t=[],currency:n=`cny`,metric:r=`cost`,t:i}){let a=i??(e=>H[e]),[o,s]=(0,d.useState)(null),c=e=>dn(un(e,n),n),l=e=>r===`tokens`?wn(e):c(e),u=e=>r===`tokens`?e.tokens??0:e.cost,f=(0,d.useMemo)(()=>{let n=e.length;if(n===0)return null;let i=680-Y.left-Y.right,a=220-Y.top-Y.bottom,o=e=>n===1?Y.left+i/2:Y.left+i*e/(n-1),s=Math.max(...r===`tokens`?e.map(e=>e.tokens??0):e.map(e=>Math.max(e.cost,Object.values(e.byModel??{}).reduce((e,t)=>e+t,0))),1e-4),c=e=>Y.top+a-e/s*a,l=Math.max(...e.map(e=>e.calls),1),d=e=>Y.top+a-e/l*a,f=i/n,p=Math.min(18,f*.6);return{n,plotW:i,plotH:a,inner:o,yCost:c,yCalls:d,barW:p,bars:e.flatMap((e,n)=>{let i=o(n)-p/2;if(t.length===0||r===`tokens`)return[{date:e.date,model:Pn,x:i,base:0,value:u(e),topRounded:!0}];let a=null;for(let n of t)(e.byModel?.[n.key]??0)>0&&(a=n.key);let s=0;return t.map(t=>{let n=e.byModel?.[t.key]??0,r={date:e.date,model:t,x:i,base:s,value:n,topRounded:t.key===a};return s+=n,r})}),costTicks:[0,.25,.5,.75,1].map(e=>s*e).reverse(),callsTicks:[0,.25,.5,.75,1].map(e=>l*e).reverse(),linePath:e.map((e,t)=>{let n=d(e.calls);return`${t===0?`M`:`L`}${o(t)} ${n}`}).join(` `)}},[e,t,r]);if(f===null)return(0,m.jsx)(`div`,{className:B.chartEmpty,children:a(`trendEmpty`)});let{n:p,plotW:h,plotH:g,inner:_,yCost:v,yCalls:y,barW:b,bars:x,costTicks:S,callsTicks:C,linePath:w}=f,T=o===null?void 0:e[o],ee=Nn(p,Math.max(1,Math.ceil(p/8)));return(0,m.jsxs)(`div`,{className:B.chartWrap,children:[(0,m.jsxs)(`svg`,{viewBox:`0 0 680 220`,className:B.chartSvg,role:`img`,"aria-label":`Daily cost by model and total calls`,onMouseLeave:()=>{s(null)},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),n=((e.clientX-t.left)/t.width*680-Y.left)/h,r=Math.round(n*(p-1));s(Math.min(Math.max(r,0),p-1))},children:[S.map((e,t)=>{let n=v(e);return(0,m.jsxs)(`g`,{children:[(0,m.jsx)(`line`,{x1:Y.left,x2:680-Y.right,y1:n,y2:n,className:B.chartGrid}),(0,m.jsx)(`text`,{x:Y.left-8,y:n+3,textAnchor:`end`,className:B.chartAxisLabel,children:l(e)})]},`cost-${t}`)}),x.map(t=>{if(t.value>0)return(0,m.jsx)(`rect`,{x:t.x,y:v(t.base+t.value),width:b,height:v(t.base)-v(t.base+t.value),rx:t.topRounded?2:0,className:t.model.color===``?B.chartBar:B.chartStack,style:t.model.color===``?void 0:{fill:t.model.color}},`${t.date}-${t.model.key}`);let n=e.find(e=>e.date===t.date);return n!==void 0&&n.calls>0&&t.base===0?(0,m.jsx)(`rect`,{x:t.x,y:v(0)-1,width:b,height:1,rx:0,className:B.chartBarPlaceholder},`${t.date}-${t.model.key}-placeholder`):null}),(0,m.jsx)(`path`,{d:w,fill:`none`,className:B.chartLine}),(()=>{let t=jn(),n=e.findIndex(e=>e.date===t);return n>=0?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`defs`,{children:(0,m.jsxs)(`linearGradient`,{id:`chartAreaGrad`,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`,children:[(0,m.jsx)(`stop`,{offset:`0%`,stopColor:`var(--ds-blue)`,stopOpacity:`0.35`}),(0,m.jsx)(`stop`,{offset:`100%`,stopColor:`var(--ds-blue)`,stopOpacity:`0`})]})}),(0,m.jsx)(`path`,{d:`${w} L ${_(e.length-1)} ${y(0)} L ${_(0)} ${y(0)} Z`,fill:`url(#chartAreaGrad)`}),(0,m.jsx)(`line`,{x1:_(n),x2:_(n),y1:Y.top,y2:Y.top+g,stroke:`var(--ds-amber)`,strokeWidth:`1`,strokeDasharray:`3 3`,opacity:`0.6`}),(0,m.jsx)(`text`,{x:_(n)+4,y:Y.top-6,fill:`var(--ds-amber)`,fontSize:`10`,fontFamily:`var(--font-num)`,children:Mn(t)})]}):null})(),C.map((e,t)=>{let n=y(e);return(0,m.jsx)(`text`,{x:680-Y.right+8,y:n+3,textAnchor:`start`,className:B.chartAxisLabel,children:wn(e)},`calls-${t}`)}),ee.map(t=>{let n=e[t];return n===void 0?null:(0,m.jsx)(`text`,{x:_(t),y:214,textAnchor:`middle`,className:B.chartAxisLabel,children:Mn(n.date)},n.date)}),o!==null&&(0,m.jsx)(`line`,{x1:_(o),x2:_(o),y1:Y.top,y2:Y.top+g,className:B.chartCrosshair})]}),T!==void 0&&o!==null&&(0,m.jsxs)(`div`,{className:B.chartTooltip,style:{left:`${_(o)/680*100}%`,top:`${v(T.cost)/220*100}%`},children:[(0,m.jsx)(`div`,{className:B.chartTooltipDate,children:T.date}),r!==`tokens`&&t.filter(e=>(T.byModel?.[e.key]??0)>0).map(e=>(0,m.jsxs)(`div`,{className:B.chartTooltipRow,children:[(0,m.jsx)(`span`,{className:B.chartTooltipSwatch,style:{background:e.color}}),e.name,` `,(0,m.jsx)(`strong`,{children:c(T.byModel?.[e.key]??0)})]},e.key)),(0,m.jsxs)(`div`,{className:B.chartTooltipRow,children:[(0,m.jsx)(`span`,{className:B.chartLegendBar}),a(`trendTotal`),` `,(0,m.jsx)(`strong`,{children:r===`tokens`?wn(T.tokens??0):c(T.cost)})]}),(0,m.jsxs)(`div`,{className:B.chartTooltipRow,children:[(0,m.jsx)(`span`,{className:B.chartLegendLine}),a(`calls`),` `,(0,m.jsx)(`strong`,{children:T.calls.toLocaleString()})]})]}),t.length>0&&r!==`tokens`&&(0,m.jsxs)(`div`,{className:B.chartLegend,children:[t.map(e=>(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:B.chartTooltipSwatch,style:{background:e.color}}),e.name]},e.key)),(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:B.chartLegendLine}),a(`calls`)]})]})]})}let X={top:14,right:42,bottom:22,left:46};function In(e){return e.slice(5,13).replace(`T`,` `)}function Ln(e){return String(e>=100?Math.round(e):Number(e.toFixed(1)))}function Rn(e){return e<1e4?`${Math.round(e)} ms`:e<6e4?`${(e/1e3).toFixed(1)} s`:`${(e/6e4).toFixed(1)} min`}function zn(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toFixed(1)}function Bn(e,t,n){return t===`ttft`?`${Math.round(e)} ms`:`${e.toFixed(1)} ${n(`perfTpsUnit`)}`}function Vn({perf:e,models:t,t:n}){let[r,i]=(0,d.useState)(()=>Re()),[a,o]=(0,d.useState)(null),s=e=>{i(e),R(e)},c=e=>t.find(t=>t.key===e)?.color??`#8b95a3`,l=(0,d.useMemo)(()=>e===void 0?[]:Object.entries(e.byModel).map(([e,n])=>({key:e,name:t.find(t=>t.key===e)?.name??e,color:c(e),samples:n.samples,ttftAvg:n.ttftAvg,ttftP50:n.ttftP50,ttftP90:n.ttftP90,...n.ttftMax===void 0?{}:{ttftMax:n.ttftMax},...n.ttftSpikes===void 0?{}:{ttftSpikes:n.ttftSpikes},...n.tpsAvg===void 0?{}:{tpsAvg:n.tpsAvg},latencyAvg:n.latencyAvg,estimatedSamples:n.estimatedSamples})).sort((e,t)=>t.samples-e.samples||t.ttftP90-e.ttftP90),[e,t]),u=(0,d.useMemo)(()=>{if(e===void 0)return[];if(r.models!==void 0){let t=new Set(Object.keys(e.byModel));return r.models.filter(e=>t.has(e))}return l.slice(0,5).map(e=>e.key)},[e,l,r.models]),f=(0,d.useMemo)(()=>{if(e===void 0)return null;let t=Object.keys(e.byHourModel).sort().slice(-48);if(t.length===0)return null;let n=t.length,i=680-X.left-X.right,a=180-X.top-X.bottom,o=e=>n===1?X.left+i/2:X.left+i*e/(n-1),s=new Set(u),c=e=>r.metric===`ttft`?e?.ttftAvg:e?.tpsAvg,d=[],f=0;for(let r of l){if(!s.has(r.key))continue;let i=[];for(let a=0;a<n;a++){let n=t[a];if(n===void 0)continue;let s=c(e.byHourModel[n]?.[r.key]);s===void 0||!Number.isFinite(s)||(i.push({i:a,x:o(a),y:0,v:s}),s>f&&(f=s))}d.push({key:r.key,name:r.name,color:r.color,segments:[],points:i})}let p=d.reduce((e,t)=>e+t.points.length,0);f=Math.max(f,1);let m=e=>X.top+a-e/f*a;for(let e of d){let t=``,n=-2;for(let r of e.points)r.y=m(r.v),t!==``&&r.i!==n+1&&(e.segments.push(t),t=``),t+=`${t===``?`M`:`L`}${r.x} ${r.y} `,n=r.i;t!==``&&e.segments.push(t)}let h=Math.max(1,Math.ceil(n/8)),g=[];for(let e=0;e<n;e+=h)g.push(e);return g[g.length-1]!==n-1&&g.push(n-1),{hourKeys:t,n,plotW:i,plotH:a,inner:o,yOf:m,series:d,ticks:[0,.5,1].map(e=>f*e).reverse(),xTicks:g,totalPoints:p}},[e,l,u,r.metric]);if(e===void 0||l.length===0)return(0,m.jsx)(`div`,{className:B.chartEmpty,"data-testid":`billing-perf-empty`,children:n(`perfEmpty`)});let p=e=>{let t=u.includes(e)?u.filter(t=>t!==e):[...u,e];s({metric:r.metric,models:t})},h=e=>{s({metric:e,...r.models===void 0?{}:{models:r.models}})},g=a===null||f===null?[]:f.series.flatMap(e=>{let t=e.points.find(e=>e.i===a);return t===void 0?[]:[{key:e.key,name:e.name,color:e.color,v:t.v}]});return(0,m.jsxs)(`div`,{"data-testid":`billing-perf-panel`,children:[l.length>0&&(()=>{let e=Math.max(...l.map(e=>e.ttftAvg),1),t=Math.max(...l.filter(e=>e.tpsAvg!==void 0).map(e=>e.tpsAvg??0),1),r=Math.max(...l.map(e=>e.latencyAvg),1),i=l.reduce((e,t)=>e+t.samples,0),a=l.length>0?l.reduce((e,t)=>e+t.ttftAvg,0)/l.length:0,o=l.map(e=>e.tpsAvg).filter(e=>e!==void 0),s=o.length>0?o.reduce((e,t)=>e+t,0)/o.length:0,c=l.length>0?l.reduce((e,t)=>e+t.latencyAvg,0)/l.length:0,u=[{lbl:n(`perfSamples`),val:i.toLocaleString(),unit:``,pct:65,color:`var(--ds-blue)`},{lbl:n(`perfTtft`),val:Rn(a),unit:``,pct:a/e*100,color:`var(--ds-green)`},{lbl:n(`perfTps`),val:o.length>0?zn(s):`—`,unit:``,pct:s/t*100,color:`var(--ds-blue)`},{lbl:n(`perfLatency`),val:Rn(c),unit:``,pct:c/r*100,color:`var(--ds-amber)`}];return(0,m.jsx)(`div`,{className:B.perfHero,"data-testid":`billing-perf-hero`,children:u.map((e,t)=>(0,m.jsxs)(`div`,{className:B.perfHeroCell,children:[(0,m.jsx)(`div`,{className:B.perfHeroLbl,children:e.lbl}),(0,m.jsxs)(`div`,{className:B.perfHeroVal,children:[e.val,e.unit!==``&&(0,m.jsx)(`span`,{className:B.perfHeroUnit,children:e.unit})]}),(0,m.jsx)(`div`,{className:B.perfHeroBar,children:(0,m.jsx)(`i`,{style:{width:`${Math.min(100,e.pct)}%`,background:e.color}})})]},t))})})(),(0,m.jsx)(`div`,{className:B.tableScroll,"data-testid":`billing-perf-table`,children:(0,m.jsxs)(`table`,{className:B.modelTable,children:[(0,m.jsx)(`thead`,{children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{children:n(`model`)}),(0,m.jsx)(`th`,{className:B.numCol,children:n(`perfSamples`)}),(0,m.jsx)(`th`,{className:B.numCol,children:n(`perfTtft`)}),(0,m.jsx)(`th`,{className:B.numCol,children:n(`perfP50`)}),(0,m.jsx)(`th`,{className:B.numCol,children:n(`perfP90`)}),(0,m.jsx)(`th`,{className:B.numCol,children:n(`perfMax`)}),(0,m.jsx)(`th`,{className:B.numCol,children:n(`perfTps`)}),(0,m.jsx)(`th`,{className:B.numCol,children:n(`perfLatency`)}),(0,m.jsx)(`th`,{className:B.numCol,children:n(`perfEstimated`)})]})}),(0,m.jsx)(`tbody`,{children:l.map(e=>(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`td`,{children:(0,m.jsxs)(`span`,{className:B.modelCell,children:[(0,m.jsx)(`span`,{className:B.modelDot,style:{background:e.color}}),(0,m.jsx)(`span`,{className:B.modelName,children:e.name})]})}),(0,m.jsx)(`td`,{className:B.numCol,children:e.samples.toLocaleString()}),(0,m.jsx)(`td`,{className:B.numCol,children:Rn(e.ttftAvg)}),(0,m.jsx)(`td`,{className:B.numCol,children:Rn(e.ttftP50)}),(0,m.jsx)(`td`,{className:B.numCol,children:Rn(e.ttftP90)}),(0,m.jsx)(`td`,{className:B.numCol,children:e.ttftMax===void 0?(0,m.jsx)(`span`,{className:B.na,children:`—`}):(0,m.jsxs)(`span`,{children:[Rn(e.ttftMax),e.ttftSpikes!==void 0&&e.ttftSpikes>0?` (${e.ttftSpikes}↑)`:``]})}),(0,m.jsx)(`td`,{className:B.numCol,children:e.tpsAvg===void 0?(0,m.jsx)(`span`,{className:B.na,children:`—`}):zn(e.tpsAvg)}),(0,m.jsx)(`td`,{className:B.numCol,children:Rn(e.latencyAvg)}),(0,m.jsx)(`td`,{className:B.numCol,children:e.estimatedSamples>0?e.estimatedSamples:(0,m.jsx)(`span`,{className:B.na,children:`—`})})]},e.key))})]})}),l.length>0&&(()=>{let e=Math.max(...l.map(e=>e.ttftP50),1),t=e=>e<.8?`var(--ds-green)`:e<2?`var(--ds-amber)`:`var(--ds-red)`;return(0,m.jsx)(`div`,{className:B.perfCompareList,"data-testid":`billing-perf-compare`,children:l.map(n=>(0,m.jsxs)(`div`,{className:B.perfCompareRow,children:[(0,m.jsxs)(`div`,{className:B.perfCompareName,children:[(0,m.jsx)(`span`,{className:B.perfCompareDot,style:{background:n.color}}),(0,m.jsx)(`span`,{children:n.name})]}),(0,m.jsx)(`div`,{className:B.perfCompareBar,children:(0,m.jsx)(`i`,{style:{width:`${n.ttftP50/e*100}%`,background:t(n.ttftP50)}})}),(0,m.jsx)(`div`,{className:B.perfCompareNum,children:Rn(n.ttftP50)}),(0,m.jsx)(`div`,{className:B.perfCompareNum,children:n.tpsAvg===void 0?`—`:zn(n.tpsAvg)})]},n.key))})})(),f!==null&&(0,m.jsxs)(`div`,{"data-testid":`billing-perf-hour`,children:[(0,m.jsx)(`div`,{className:B.perfBar,children:(0,m.jsx)(`span`,{className:B.rangeToggle,role:`group`,"aria-label":n(`perfTitle`),children:[`ttft`,`tps`].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(B.rangeButton,r.metric===e&&B.rangeButtonActive),"aria-pressed":r.metric===e,"data-testid":`billing-perf-tab-${e}`,onClick:()=>{h(e)},children:e===`ttft`?`${n(`perfTtft`)} (ms)`:`${n(`perfTps`)} (${n(`perfTpsUnit`)})`},e))})}),(0,m.jsxs)(`div`,{className:B.perfChips,role:`group`,"aria-label":n(`model`),children:[(0,m.jsx)(`button`,{type:`button`,className:B.perfChip,"data-testid":`billing-perf-chip-all`,onClick:()=>{s({metric:r.metric,models:l.map(e=>e.key)})},children:n(`perfAll`)}),l.map(e=>{let t=u.includes(e.key);return(0,m.jsxs)(`button`,{type:`button`,className:y(B.perfChip,!t&&B.perfChipOff),style:t?{color:e.color,borderColor:`color-mix(in srgb, ${e.color} 45%, transparent)`}:void 0,"aria-pressed":t,"data-testid":`billing-perf-chip-${e.key}`,onClick:()=>{p(e.key)},children:[(0,m.jsx)(`span`,{className:B.perfChipDot,style:{background:t?e.color:`var(--dsw-alias-label-dimmed)`}}),e.name]},e.key)})]}),f.totalPoints>0?(0,m.jsxs)(`div`,{className:B.chartWrap,children:[(0,m.jsxs)(`svg`,{viewBox:`0 0 680 180`,className:B.chartSvg,role:`img`,"aria-label":`Hourly perf comparison by model`,onMouseLeave:()=>{o(null)},onMouseMove:e=>{let t=e.currentTarget.getBoundingClientRect(),n=((e.clientX-t.left)/t.width*680-X.left)/f.plotW,r=Math.round(n*(f.n-1));o(Math.min(Math.max(r,0),f.n-1))},children:[f.ticks.map((e,t)=>{let n=f.yOf(e);return(0,m.jsxs)(`g`,{children:[(0,m.jsx)(`line`,{x1:X.left,x2:680-X.right,y1:n,y2:n,className:B.chartGrid}),(0,m.jsx)(`text`,{x:X.left-8,y:n+3,textAnchor:`end`,className:B.chartAxisLabel,children:Ln(e)})]},`tick-${t}`)}),f.series.map(e=>e.segments.map((t,n)=>(0,m.jsx)(`path`,{d:t,fill:`none`,className:B.chartLine,style:{stroke:e.color}},`${e.key}-${n}`))),f.xTicks.map(e=>{let t=f.hourKeys[e];return t===void 0?null:(0,m.jsx)(`text`,{x:f.inner(e),y:174,textAnchor:`middle`,className:B.chartAxisLabel,children:In(t)},t)}),a!==null&&(0,m.jsx)(`line`,{x1:f.inner(a),x2:f.inner(a),y1:X.top,y2:X.top+f.plotH,className:B.chartCrosshair}),a!==null&&f.series.map(e=>{let t=e.points.find(e=>e.i===a);return t===void 0?null:(0,m.jsx)(`circle`,{cx:t.x,cy:t.y,r:3.5,fill:e.color,className:B.chartHoverDot},`${e.key}-dot`)})]}),a!==null&&g.length>0&&(0,m.jsxs)(`div`,{className:B.chartTooltip,"data-testid":`billing-perf-tooltip`,style:{left:`${f.inner(a)/680*100}%`,top:`${(X.top+f.plotH/2)/180*100}%`},children:[(0,m.jsx)(`div`,{className:B.chartTooltipDate,children:In(f.hourKeys[a]??``)}),g.map(e=>(0,m.jsxs)(`div`,{className:B.chartTooltipRow,children:[(0,m.jsx)(`span`,{className:B.chartTooltipSwatch,style:{background:e.color}}),e.name,` `,(0,m.jsx)(`strong`,{children:Bn(e.v,r.metric,n)})]},e.key))]})]}):(0,m.jsx)(`div`,{className:B.chartEmpty,"data-testid":`billing-perf-chart-empty`,children:n(`perfChartEmpty`)})]}),f===null&&(0,m.jsx)(`div`,{className:B.chartEmpty,"data-testid":`billing-perf-chart-empty`,children:n(`perfChartEmpty`)})]})}let Hn=`@kenz1117/dsh-ui-usage-billing`,Un=`kenz1117`;function Wn({t:e,version:t}){return(0,m.jsxs)(`section`,{className:B.setCard,"data-testid":`billing-plugin-info`,children:[(0,m.jsxs)(`div`,{className:B.plgHead,children:[(0,m.jsx)(`span`,{className:B.plgIcon,"aria-hidden":`true`,children:(0,m.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,m.jsx)(`path`,{d:`M10 3a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a2 2 0 0 0 4 0V4a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v1a2 2 0 0 0 4 0 1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-1a2 2 0 0 0 0 4h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-1a2 2 0 0 0-4 0v1a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a2 2 0 0 0-4 0v1a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1v-1a2 2 0 0 0-4 0 1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1a2 2 0 0 0 0-4H3a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1a2 2 0 0 0 4 0z`})})}),(0,m.jsxs)(`div`,{className:B.plgTitle,children:[(0,m.jsxs)(`div`,{className:B.plgNameRow,children:[(0,m.jsx)(`h3`,{className:B.plgName,children:Hn}),(0,m.jsx)(`span`,{className:B.plgTag,children:t===void 0?`—`:`v${t}`})]}),(0,m.jsx)(`p`,{className:B.plgDesc,children:`Usage billing dashboard for DeepSeek Harness`})]})]}),(0,m.jsxs)(`div`,{className:B.plgGrid,children:[(0,m.jsxs)(`div`,{className:B.plgItem,children:[(0,m.jsx)(`span`,{className:B.plgLabel,children:e(`pluginAuthor`)}),(0,m.jsxs)(`a`,{className:B.plgLink,href:`https://github.com/${Un}`,target:`_blank`,rel:`noreferrer`,children:[`KenZ`,` (`,Un,`)`]})]}),(0,m.jsxs)(`div`,{className:B.plgItem,children:[(0,m.jsx)(`span`,{className:B.plgLabel,children:e(`pluginRepository`)}),(0,m.jsx)(`a`,{className:B.plgLink,href:`https://github.com/kenz1117/dsh-ui-usage-billing`,target:`_blank`,rel:`noreferrer`,children:`GitHub`})]}),(0,m.jsxs)(`div`,{className:B.plgItem,children:[(0,m.jsx)(`span`,{className:B.plgLabel,children:e(`pluginNpm`)}),(0,m.jsx)(`a`,{className:B.plgLink,href:`https://www.npmjs.com/package/@kenz1117/dsh-ui-usage-billing`,target:`_blank`,rel:`noreferrer`,children:Hn})]}),(0,m.jsxs)(`div`,{className:B.plgItem,children:[(0,m.jsx)(`span`,{className:B.plgLabel,children:e(`pluginLicense`)}),(0,m.jsx)(`span`,{className:B.plgVal,children:`MIT`})]})]})]})}function Gn(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}`}function Z(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function Kn(e){let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m${String(t%60).padStart(2,`0`)}s`}function qn({rounds:e,flags:t,currency:n,t:r}){let i=(0,d.useMemo)(()=>e.slice(-40),[e]),a=(0,d.useMemo)(()=>new Set(t.map(e=>`${e.sessionId}:${e.turn}`)),[t]),o=(0,d.useMemo)(()=>Math.max(1e-4,...i.map(e=>e.cost)),[i]);if(i.length===0)return(0,m.jsxs)(`div`,{className:B.roundsEmpty,children:[r(`model`),` —`]});let s=e=>dn(un(e,n),n);return(0,m.jsxs)(`div`,{className:B.rounds,children:[(0,m.jsx)(`div`,{className:B.roundsBars,role:`img`,"aria-label":`cost per turn`,children:i.map(e=>{let t=a.has(`${e.sessionId}:${e.turn}`),n=Math.max(1,e.cost/o*100),i=Nt(e.model,!1)===`deepseek-metered`&&Ct(e.startedAt)===`peak`;return(0,m.jsxs)(`div`,{className:y(B.roundsBarCol,i?B.roundsBarColPeak:B.roundsBarColOff),children:[(0,m.jsx)(`span`,{className:B.roundsBarLabel,style:{bottom:`${n}%`},children:s(e.cost)}),(0,m.jsx)(`div`,{className:B.roundsBarWrap,children:(0,m.jsx)(`div`,{className:t?B.roundsBarFlagged:B.roundsBar,style:{height:`${n}%`},"data-testid":`round-bar`,title:`${r(`model`)} ${e.model} · ${s(e.cost)} · ${Z(e.startedAt)}${e.endedAt===void 0?``:` → ${Gn(e.endedAt)} (${Kn(e.endedAt-e.startedAt)})`}`,children:t&&(0,m.jsx)(`span`,{className:B.roundsFlagMark,"aria-hidden":`true`})})})]},`${e.sessionId}:${e.turn}`)})}),(0,m.jsxs)(`div`,{className:B.roundsAxis,children:[(0,m.jsxs)(`span`,{children:[r(`costAbbr`),` `,s(o)]}),(0,m.jsxs)(`span`,{children:[i.length,` `,r(`roundsUnit`)]})]})]})}let Jn=[`color-mix(in srgb, var(--dsb-3) 70%, transparent)`,`color-mix(in srgb, var(--ds-cyan) 30%, var(--dsb-3))`,`color-mix(in srgb, var(--ds-blue) 60%, var(--dsb-3))`,`var(--ds-blue)`,`var(--ds-amber)`],Yn=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Xn=e=>K(e.getTime());function Zn(e,t){let n=new Map;for(let t of e)n.set(t.date,t.value);let r=0;for(let e of n.values())e>r&&(r=e);let i=t.getFullYear(),a=t.getMonth(),o=t.getDate(),s=new Date(i,a+1,0).getDate(),c=new Date(i,a,1).getDay(),l=c+s,u=Math.ceil(l/7),d=[];for(let e=0;e<u;e+=1){let t=[];for(let l=0;l<7;l+=1){let u=e*7+l-c+1;if(u<1){let e=new Date(i,a,u);t.push({date:Xn(e),dayNum:e.getDate(),value:0,level:0,placeholder:!0});continue}if(u>s){let e=new Date(i,a+1,u-s);t.push({date:Xn(e),dayNum:e.getDate(),value:0,level:0,placeholder:!0});continue}let d=new Date(i,a,u),f=Xn(d),p=n.get(f)??0,m=0;if(p>0&&r>0){let e=Math.ceil(p/r*4);m=Math.min(4,Math.max(1,e))}let h=u>o;t.push({date:f,dayNum:u,value:h?0:p,level:h?0:m,placeholder:h})}d.push(t)}return d}function Qn(e,t,n=52){let r=new Map;for(let t of e)r.set(t.date,t.value);let i=0;for(let e of r.values())e>i&&(i=e);let a=Xn(t),o=new Date(t);o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay());let s=new Date(o);s.setDate(o.getDate()-(n-1)*7);let c=[];for(let e=0;e<n;e+=1){let t=[];for(let n=0;n<7;n+=1){let o=new Date(s);o.setDate(s.getDate()+e*7+n);let c=Xn(o),l=c>a,u=l?0:r.get(c)??0,d=0;if(!l&&u>0&&i>0){let e=Math.ceil(u/i*4);d=Math.min(4,Math.max(1,e))}t.push({date:c,dayNum:o.getDate(),value:u,level:d,placeholder:l})}c.push(t)}return c}function $n({days:e,currency:t,now:n,t:r,range:i=`month`,unit:a=`cost`}){let[o,s]=(0,d.useState)(null),c=e=>dn(un(e,t),t),l=e=>a===`tokens`?q(e):c(e),u=(0,d.useMemo)(()=>Zn(e,n??new Date),[e,n]),f=Xn(n??new Date);if(i!==`month`){let t=Qn(e,n??new Date,i===`half`?26:52),a=[],o=-1;return t.forEach((e,t)=>{let n=Number(e[0]?.date.slice(5,7)??0);n!==o&&(a.push({index:t,label:Yn[n-1]??``}),o=n)}),(0,m.jsxs)(`div`,{className:B.heatmapYear+(i===`half`?` `+B.heatmapHalf:``),"data-testid":i===`half`?`heatmap-half`:`heatmap-year`,children:[(0,m.jsxs)(`div`,{className:B.heatmapYearBody,children:[(0,m.jsx)(`div`,{className:B.heatmapYearWeekdays,"aria-hidden":`true`,children:[{label:`Mon`,row:1},{label:`Wed`,row:3},{label:`Fri`,row:5}].map(e=>(0,m.jsx)(`span`,{className:B.heatmapYearWeekday,style:{gridRow:e.row},children:e.label},e.label))}),(0,m.jsxs)(`div`,{className:B.heatmapYearScroll,children:[(0,m.jsx)(`div`,{className:B.heatmapYearMonths,"aria-hidden":`true`,"data-testid":`heatmap-year-months`,children:a.map(e=>(0,m.jsx)(`span`,{className:B.heatmapYearMonth,style:{gridColumn:e.index+1},children:e.label},e.index))}),(0,m.jsx)(`div`,{className:B.heatmapYearGrid,role:`img`,"aria-label":`yearly cost heatmap`,"data-testid":`heatmap-year-grid`,children:t.flat().map(e=>(0,m.jsx)(`button`,{type:`button`,className:B.heatmapYearCell,"data-testid":`heatmap-year-cell`,"data-level":e.level,"data-today":e.date===f?`true`:void 0,style:{background:Jn[e.level]},title:`${e.date} · ${l(e.value)}`,"aria-label":`${e.date}: ${l(e.value)}`,tabIndex:-1},e.date))})]})]}),(0,m.jsxs)(`div`,{className:B.heatmapFooter,children:[(0,m.jsx)(`span`,{children:r(`heatmapLess`)}),(0,m.jsx)(`span`,{className:B.heatmapLegend,children:Jn.map((e,t)=>(0,m.jsx)(`i`,{style:{background:e}},t))}),(0,m.jsx)(`span`,{children:r(`heatmapMore`)})]})]})}return(0,m.jsxs)(`div`,{className:B.heatmap,children:[(0,m.jsx)(`div`,{className:B.heatmapGrid,role:`img`,"aria-label":`daily cost heatmap`,children:u.map(e=>e.map(e=>e.placeholder?(0,m.jsx)(`div`,{className:B.heatmapCellEmpty,children:e.dayNum},e.date):(0,m.jsx)(`button`,{type:`button`,className:B.heatmapCell,"data-testid":`heatmap-cell`,"data-level":e.level,"data-today":e.date===f?`true`:void 0,style:{background:Jn[e.level]},title:`${e.date} · ${l(e.value)}`,"aria-label":`${e.date}: ${l(e.value)}`,onMouseEnter:()=>{s(e)},onMouseLeave:()=>{s(null)},onFocus:()=>{s(e)},onBlur:()=>{s(null)},children:e.dayNum},e.date)))}),(0,m.jsxs)(`div`,{className:B.heatmapFooter,children:[(0,m.jsx)(`span`,{children:r(`heatmapLess`)}),(0,m.jsx)(`span`,{className:B.heatmapLegend,children:Jn.map((e,t)=>(0,m.jsx)(`i`,{style:{background:e}},t))}),(0,m.jsx)(`span`,{children:r(`heatmapMore`)}),o!==null&&(0,m.jsxs)(`span`,{className:B.heatmapHover,"data-testid":`heatmap-hover`,children:[o.date,` · `,l(o.value)]})]})]})}let er={window:6,threshold:2,reasonFactor:1.8,reasonHitDropPp:15};function tr(e){if(e.length===0)return null;let t=0;for(let n of e)t+=n;return t/e.length}function nr(e){let t=e.cacheHit+e.cacheMiss;return t<=0?null:e.cacheHit/t*100}function rr(e,t){let n=t?.window??er.window,r=t?.threshold??er.threshold,i=t?.reasonFactor??er.reasonFactor,a=t?.reasonHitDropPp??er.reasonHitDropPp,o=[];if(n<=0||r<=0)return o;let s=[],c=[],l=[],u=[];for(let t of e){if(t.cost<=0)continue;let e=t.output,d=t.input,f=nr(t),p=tr(s),m=[];if(p!==null&&p>0&&t.cost>p*r){let n=tr(c),r=tr(l),s=tr(u);n!==null&&n>0&&e>n*i&&m.push(`output-growth`),r!==null&&r>0&&d>r*i&&m.push(`context-bloat`),s!==null&&f!==null&&f<s-a&&m.push(`cache-hit-drop`),o.push({sessionId:t.sessionId,turn:t.turn,cost:t.cost,reasons:m})}for(s.push(t.cost),c.push(e),l.push(d),f!==null&&u.push(f);s.length>n;)s.shift();for(;c.length>n;)c.shift();for(;l.length>n;)l.shift();for(;u.length>n;)u.shift()}return o}let ir={},ar={};function or(){return(0,h.defineStore)({init:()=>({enabled:!1,amount:0,tierAlertDays:{},lastBalanceAlertDay:``,lastTierSwitchAt:0,modelBudgets:{},modelTierAlertDays:{}}),persist:`dsh.ui-usage-billing.budget`,actions:{setEnabled:(e,t)=>{e.enabled=t},setAmount:(e,t)=>{e.amount=Number.isFinite(t)&&t>0?t:0},markTierAlerted:(e,t,n)=>{e.tierAlertDays??={};for(let r of t)e.tierAlertDays[String(r)]=n},markBalanceAlerted:(e,t)=>{e.lastBalanceAlertDay=t},markTierSwitchAlerted:(e,t)=>{e.lastTierSwitchAt=t},setModelBudget:(e,t,n)=>{e.modelBudgets??={},Number.isFinite(n)&&n>0?e.modelBudgets[t]=n:delete e.modelBudgets[t]},markModelTierAlerted:(e,t,n)=>{e.modelTierAlertDays??={};for(let r of t)e.modelTierAlertDays[r]=n}}})}function sr(e,t){return e==null?null:Number.isFinite(e.nextSwitchInMs)&&e.nextSwitchInMs<=t?`soon`:e.tier===`peak`?`peak`:`offPeak`}let cr={显式缓存创建:`Explicit cache write`,显式缓存命中:`Explicit cache hit`,长期半价:`Half price`,与标准价一致:`Same as standard`,"限时 5 折":`Limited-time 50% off`};function lr(e,t){return e===void 0||t!==`en`?e:cr[e]??e}function ur(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>e.key.toLowerCase().includes(n)||(e.name??``).toLowerCase().includes(n)||(e.provider??``).toLowerCase().includes(n))}let dr={"智谱 AI":`Zhipu AI`,阿里通义:`Alibaba Qwen`,字节豆包:`ByteDance Doubao`,月之暗面:`Moonshot AI`,小米:`Xiaomi`,百度文心:`Baidu ERNIE`,腾讯混元:`Tencent Hunyuan`,零一万物:`01.AI`,阶跃星辰:`StepFun`,科大讯飞:`iFlytek Spark`,商汤:`SenseNova`,百川智能:`Baichuan`,"小米 Token Plan(海外)":`Xiaomi Token Plan (Global)`,"小米 Token Plan(国内)":`Xiaomi Token Plan (CN)`,"小米 Token Plan(新加坡)":`Xiaomi Token Plan (SG)`,"火山引擎 Token Plan":`Volcengine Token Plan`,"火山方舟 Token Plan":`Volcengine Ark Token Plan`,"豆包 Token Plan":`Doubao Token Plan`,"百度文心 Plan":`Baidu ERNIE Plan`,"MiniMax Token Plan(国内)":`MiniMax Token Plan (CN)`};function fr(e,t){return t===`en`?dr[e]??e:e}let pr={workbuddy:`WorkBuddy`,"workbuddy-ai":`WorkBuddy AI`},mr={"https://tokenhub.tencentmaas.com":`腾讯云 TokenHub`,"https://api.lkeap.cloud.tencent.com":`腾讯云 Token Plan`,"https://api.deepseek.com":`DeepSeek 官方`},hr={"腾讯云 TokenHub":`Tencent Cloud TokenHub`,"腾讯云 Token Plan":`Tencent Cloud Token Plan`,"DeepSeek 官方":`DeepSeek Official`};function gr(e){try{return new URL(e).host}catch{return e}}function _r(e,t=`zh`){if(e.startsWith(`site:`)){let n=e.slice(5),r=mr[n];return r===void 0?gr(n):t===`en`?hr[r]??r:r}if(e.startsWith(`direct:`)){let n=e.slice(7);if(/^deepseek(?:-[a-z0-9-]+)?$/i.test(n))return t===`en`?`DeepSeek Official`:`DeepSeek 官方`;let r=pr[n.trim().toLowerCase()];return r===void 0?`${t===`en`?`Direct`:`直连`} · ${n}`:`${t===`en`?`Direct`:`直连`} · ${r}`}}let vr=[`直连 · `,`Direct · `];function yr(e){for(let t of vr)if(e.startsWith(t))return e.slice(t.length)}let br=`dsh-billing-peak-alert-v1`,xr={enabled:!1,leadMin:2,position:`bottom-right`,webNotify:!0,mode:`both`};function Sr(e,t,n){return t===null||n<=0?e:e===null?{...t,queueCount:n}:e.atMs===t.atMs&&e.entering===t.entering?{...e,queueCount:n}:e}function Cr(e,t){if(e===null||e.queueCount===void 0)return e;if(t>0)return e.queueCount===t?e:{...e,queueCount:t};let{queueCount:n,...r}=e;return r}function wr(){try{let e=localStorage.getItem(br);if(e===null)return{...xr};let t=JSON.parse(e),n=t.mode===`peak`||t.mode===`offPeak`?t.mode:xr.mode,r=t.position===`center`?`center`:`bottom-right`;return{enabled:t.enabled===!0,leadMin:typeof t.leadMin==`number`&&Number.isFinite(t.leadMin)?Math.min(30,Math.max(1,Math.round(t.leadMin))):xr.leadMin,position:r,webNotify:t.webNotify!==!1,mode:n}}catch{return{...xr}}}function Tr(e){try{localStorage.setItem(br,JSON.stringify(e))}catch{x(`peak-config-storage-unavailable`)}}function Er(e,t,n,r){if(!t.enabled)return null;let i=Ft(e,r,t.leadMin*6e4);return i===null||t.mode===`peak`&&i.entering!==`peak`||t.mode===`offPeak`&&i.entering!==`offPeak`||i.atMs===n?null:{...i,channel:r}}function Dr({hit:e,config:t,t:n,onDismiss:r}){let[i,a]=(0,d.useState)(()=>Date.now());if((0,d.useEffect)(()=>{let e=setInterval(()=>a(Date.now()),3e4);return()=>clearInterval(e)},[]),(0,d.useEffect)(()=>{i>=e.atMs&&r()},[i,e.atMs,r]),i>=e.atMs)return null;let o=Math.max(1,Math.round((e.atMs-i)/6e4)),s=e.entering,c=n(s===`peak`?`tierPeak`:`tierOff`),l=n(e.channel===`zhipu-coding-plan`?s===`peak`?`peakAlertDescPeakZhipu`:`peakAlertDescOffZhipu`:s===`peak`?`peakAlertDescPeak`:`peakAlertDescOff`),u=s===`peak`;return(0,m.jsxs)(`div`,{className:y(B.peakCard,u?B.peakCardPeak:B.peakCardOff,t.position===`center`?B.peakCardCenter:B.peakCardCorner),"data-testid":`billing-peak-alert`,role:`alert`,children:[(0,m.jsxs)(`div`,{className:B.peakHead,children:[(0,m.jsxs)(`span`,{className:y(B.peakTag,u?B.peakTagPrimary:B.peakTagSuccess),children:[(0,m.jsx)(`span`,{className:y(B.peakDot,u?B.peakDotPrimary:B.peakDotSuccess),"aria-hidden":`true`}),c]}),(0,m.jsx)(`button`,{type:`button`,className:B.peakClose,onClick:r,"aria-label":n(`close`),children:`×`})]}),(0,m.jsxs)(`div`,{className:y(B.peakCount,u?B.peakCountPrimary:B.peakCountSuccess),children:[o,`min`]}),(0,m.jsx)(`p`,{className:B.peakDesc,children:l}),e.queueCount!==void 0&&e.queueCount>0&&(0,m.jsx)(`p`,{className:B.peakDesc,"data-testid":`billing-peak-queue-note`,children:n(s===`peak`?`peakAlertQueuePeak`:`peakAlertQueueOff`,{count:e.queueCount})})]})}let Or=[50,80,100],kr=3e4,Ar={total:{calls:0,input:0,output:0,cacheHit:0,cacheMiss:0,cost:0,reasoning:0},byModel:{},byDay:{},byDayModels:{}},jr=[`#4f8cff`,`#2dd4bf`,`#a78bfa`,`#f59e0b`,`#f472b6`,`#fbbf24`,`#38bdf8`,`#6366f1`,`#f97316`,`#14b8a6`],Mr={checked:!1,available:!1,models:0,failures:0,okProviders:[],badProviders:[]},Nr=[{id:`overview`,labelKey:`tabOverview`},{id:`queue`,labelKey:`tabQueue`},{id:`providers`,labelKey:`tabProviders`},{id:`token`,labelKey:`tabToken`},{id:`trends`,labelKey:`tabTrends`},{id:`agents`,labelKey:`tabAgents`},{id:`pricing`,labelKey:`tabPricing`},{id:`settings`,labelKey:`tabSettings`}],Pr={fill:`none`,"aria-hidden":!0,stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`},Fr={overview:(0,m.jsx)(`svg`,{viewBox:`0 0 16 16`,...Pr,children:(0,m.jsx)(`path`,{d:`M2 13V3M2 13H14M4 10l4-3 2 2 4-5`})}),queue:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,...Pr,children:[(0,m.jsx)(`path`,{d:`M3 4h10M3 8h10M3 12h6`}),(0,m.jsx)(`path`,{d:`M12 10v4m-2-2h4`})]}),agents:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,...Pr,children:[(0,m.jsx)(`circle`,{cx:`8`,cy:`3.5`,r:`2`}),(0,m.jsx)(`circle`,{cx:`3.5`,cy:`12.5`,r:`2`}),(0,m.jsx)(`circle`,{cx:`12.5`,cy:`12.5`,r:`2`}),(0,m.jsx)(`path`,{d:`M8 5.5v2.5M6.5 10.5L5 11.5M9.5 10.5L11 11.5`})]}),providers:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,...Pr,children:[(0,m.jsx)(`rect`,{x:`2`,y:`3`,width:`12`,height:`10`,rx:`1.5`}),(0,m.jsx)(`path`,{d:`M5 7l2 2 4-4`})]}),token:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,...Pr,children:[(0,m.jsx)(`circle`,{cx:`6`,cy:`6`,r:`3`}),(0,m.jsx)(`circle`,{cx:`11`,cy:`11`,r:`3`})]}),trends:(0,m.jsx)(`svg`,{viewBox:`0 0 16 16`,...Pr,children:(0,m.jsx)(`path`,{d:`M2 4l4 4 3-3 5 5M11 10h3V7`})}),pricing:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,...Pr,children:[(0,m.jsx)(`path`,{d:`M8 2l6 3v6l-6 3-6-3V5z`}),(0,m.jsx)(`path`,{d:`M8 2v12M2 5h12`})]}),settings:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,...Pr,children:[(0,m.jsx)(`circle`,{cx:`8`,cy:`8`,r:`2.5`}),(0,m.jsx)(`path`,{d:`M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2`})]})},Ir=p,Lr=Ir.IconChevronDownOutlineMedium??Ir.IconChevronDownOutline14;function Rr(e,t){let n=Object.keys(e).filter(e=>e<=t).sort().slice(-7);return n.length===0?0:n.reduce((t,n)=>t+(e[n]?.cost??0),0)/n.length}function zr(e,t){let n=t.split(`-`),r=new Date(Number(n[0]),Number(n[1])-1,Number(n[2])),i=0;for(let t=0;t<7;t+=1){let t=`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,`0`)}-${String(r.getDate()).padStart(2,`0`)}`;i+=e[t]?.cost??0,r.setDate(r.getDate()-1)}return i/7}function Br(e,t,n){let r=Object.keys(e).filter(e=>e.startsWith(t)).reduce((t,n)=>t+(e[n]?.cost??0),0),i=t.split(`-`),a=new Date(Number(i[0]),Number(i[1]),0).getDate(),o=n.startsWith(t)?Number(n.slice(8,10)):a,s=Math.max(0,a-o);return r<=0?Rr(e,n)*s:r+zr(e,n)*s}function Vr(e){return Object.keys(e).length}function Hr(e,t=Date.now()){let n=0,r=new Date(t);for(;K(r.getTime())in e;)n+=1,r.setDate(r.getDate()-1);return n}function Ur(e){return e.input+e.output}function Wr(e){let t=[];for(let n=6;n>=0;--n){let r=new Date;r.setDate(r.getDate()-n);let i=K(r.getTime());t.push({date:i,cost:e[i]?.cost??0})}return t}function Gr(e,t,n=e=>e.cost){let r=new Date(`${t}T00:00:00`),i=(r.getDay()+6)%7,a=0;for(let t=0;t<=i;t+=1){let i=new Date(r);i.setDate(i.getDate()-t);let o=e[K(i.getTime())];o!==void 0&&(a+=n(o))}return a}function Kr(e,t,n){let r=new Date(`${t}T00:00:00`),i=(r.getDay()+6)%7,a=new Date(r);a.setDate(a.getDate()-i);let o=K(a.getTime()),s=new Date(r);s.setDate(s.getDate()-6);let c=K(s.getTime());return Jr(e,e=>n===`today`?e===t:n===`7d`?e>=c&&e<=t:n===`week`?e>=o&&e<=t:e.startsWith(t.slice(0,7)))}function qr(e,t,n){return Jr(e,e=>e>=t&&e<=n)}function Jr(e,t){let n=0,r=0,i=0,a=0,o=0,s=0,c=0,l=0,u,d=0;for(let[f,p]of Object.entries(e)){if(!t(f))continue;n+=p.cost,r+=p.calls,i+=p.input,a+=p.output,o+=p.cacheHit,s+=p.cacheMiss,c+=p.cacheWrite??0,l+=p.reasoning??0;let e=Ur(p);e>d&&(d=e,u=f)}return{cost:n,calls:r,input:i,output:a,cacheHit:o,cacheMiss:s,cacheWrite:c,reasoning:l,peakDay:u,peakTokens:d}}function Yr(e,t){let n={};if(e===void 0)return n;for(let[r,i]of Object.entries(e))if(r.startsWith(t))for(let[e,t]of Object.entries(i))n[e]=(n[e]??0)+t.cost;return n}let Xr=[80,100];function Zr(e,t){if(!(t>0)||!(e>0))return[];let n=e/t*100;return Xr.filter(e=>n>=e)}let Qr={DeepSeek:[`deepseek`],"智谱 AI":[`zhipu`,`glm`,`z.ai`],阿里通义:[`qwen`,`tongyi`,`dashscope`,`aliyun`],字节豆包:[`doubao`,`volcengine`,`ark`],月之暗面:[`moonshot`,`kimi`],小米:[`xiaomi`,`mi`,`mimo`],MiniMax:[`minimax`],百度文心:[`ernie`,`wenxin`,`qianfan`,`baidu`],腾讯混元:[`hunyuan`,`tencent`],零一万物:[`01.ai`,`lingyi`,`yi`],阶跃星辰:[`step`,`stepfun`,`step-3.7`],科大讯飞:[`spark`,`xfyun`,`iflytek`],商汤:[`sensenova`,`sensetime`],百川智能:[`baichuan`],OpenAI:[`openai`],Google:[`google`,`gemini`],xAI:[`xai`,`grok`],Meta:[`meta`,`llama`],Anthropic:[`claude`,`anthropic`],"Mistral AI":[`mistral`,`ministral`,`devstral`],Cohere:[`cohere`,`command`],美团:[`longcat`,`meituan`],面壁智能:[`minicpm`,`modelbest`],小红书:[`dots`,`rednote`,`xiaohongshu`],云知声:[`unisound`,`u2`]};function Q(e){return e.trim().toLowerCase().replace(/[\s_/-]+/g,``)}function $r(e,t){if(e.length===0||t.length===0)return!1;if(e===t)return!0;let[n,r]=e.length<=t.length?[e,t]:[t,e];return n.length>=3&&r.includes(n)}function ei(e,t){let n=Q(e),r=Q(t);if($r(n,r))return!0;let i=Qr[e];return i!==void 0&&i.some(e=>$r(Q(e),r))}function ti(e){let t=e.trim().toLowerCase(),n=t.replace(/[\s_/-]+/g,``);if(n.length!==0){for(let[e,n]of Object.entries(Qr))for(let r of n){let n=Q(r);if(n.length!==0&&(t===n||t.startsWith(`${n}-`)||t.startsWith(`${n}/`)||t.startsWith(`${n}_`)||t.includes(`${n}-`)||t.includes(`${n}/`)||t.includes(`${n}_`)))return e}for(let[e,t]of Object.entries(Qr))for(let r of t){let t=Q(r);if(!(t.length<4)&&n.includes(t))return e}}}let ni={"kimi-coding":`月之暗面`,"zai-coding-cn":`智谱 AI`,"zai-coding":`智谱 AI`,"qwen-token-plan":`阿里通义`,"qwen-token-plan-cn":`阿里通义`,"xiaomi-token-plan-ams":`小米`,"xiaomi-token-plan-cn":`小米`,"xiaomi-token-plan-sgp":`小米`,"volcengine-token-plan":`字节豆包`,"ark-token-plan":`字节豆包`,"doubao-token-plan":`字节豆包`,ernie:`百度文心`,baidu:`百度文心`,wenxin:`百度文心`,minimax:`MiniMax`,"minimax-cn":`MiniMax`,"minimax-token-plan":`MiniMax`,"minimax-token-plan-cn":`MiniMax`,"hunyuan-token-plan":`腾讯混元`,"tencent-token-plan":`腾讯混元`,"hy-token-plan":`腾讯混元`,"xinghuo-token-plan":`讯飞星火`,"xfyun-coding":`讯飞星火`,"spark-coding":`讯飞星火`,"huawei-token-plan":`华为云`,"pangu-token-plan":`华为云`,"huawei-maas-token-plan":`华为云`,"volcengine-agent-plan":`字节豆包`,"ark-agent-plan":`字节豆包`,"baidu-token-plan":`百度文心`,"ernie-token-plan":`百度文心`,"wenxin-token-plan":`百度文心`,opencode:`OpenCode`,"opencode-go":`OpenCode`};function ri(e){let t=ni[e];return t===void 0?ti(e)??e:t}let ii=`https://platform.kimi.com/console/pay`,ai=`https://open.bigmodel.cn/finance-center/finance/pay`,oi=`https://bailian.console.aliyun.com/`,si=`https://console.volcengine.com/ark`,ci=`https://console.anthropic.com/settings/billing`,li=`https://console.cloud.google.com/billing`,ui=`https://console.x.ai/`,di=`https://platform.xiaomimimo.com/console/balance`,fi=`https://console.cloud.tencent.com/expense/recharge`,pi={deepseek:`https://platform.deepseek.com/top_up`,minimax:`https://platform.minimax.cn/console/recharge-records`,moonshot:ii,kimi:ii,zhipu:ai,bigmodel:ai,qwen:oi,dashscope:oi,doubao:si,volcengine:si,ark:si,openai:`https://platform.openai.com/settings/organization/billing`,anthropic:ci,claude:ci,google:li,gemini:li,xai:ui,grok:ui,siliconflow:`https://cloud.siliconflow.cn/account/charge`,hunyuan:fi,tencent:fi,腾讯云:fi,xiaomi:di,mimo:di,mi:di,qianfan:`https://console.bce.baidu.com/qianfan/overview`};function mi(e){let t=pi[e];if(t!==void 0)return t;let n=Object.keys(pi).find(t=>e.startsWith(t));return n===void 0?void 0:pi[n]}function hi(e){let t=Q(e),n=mi(t);if(n!==void 0)return n;for(let[e,n]of Object.entries(Qr))if($r(Q(e),t))for(let e of n){let t=mi(Q(e));if(t!==void 0)return t}}function gi(e){let t=dt();if(t===void 0||e.byDayModels===void 0)return e;let n=bt().rate,r=e.byDayModelsSite!==void 0,i={},a={},o=new Map,s=0,c=e=>t.some(t=>t.origin!==void 0&&t.origin!==``&&(t.key===e||Ht(t.key)===Ht(e))),l=(e,t,r)=>{if(e===void 0)return r;let i=Math.min(t.cacheHit,t.cacheMiss+t.cacheHit),a=r=>{let a=(t.cacheMiss*r.input+i*r.cacheHit+t.output*r.output)/1e6;return e.currency===`USD`?a*n:a};return e.offPeak===void 0?a(e):a(e)*St+a(e.offPeak)*.5};for(let[t,n]of Object.entries(e.byDayModels)){let u=0,d={};for(let[i,a]of Object.entries(n)){let n=pt(i)??ht(i),s=r&&c(i),f;if(s&&e.byDayModelsSite?.[t]?.[i]!==void 0){let r=0;for(let[a,o]of Object.entries(e.byDayModelsSite[t][i])){let e=a.startsWith(`site:`)?a.slice(5):void 0,t=e===void 0?void 0:pt(i,e);r+=l(t??n,o,o.cost)}f=r}else f=l(n,a,a.cost);u+=f,d[i]={...a,cost:f},o.set(i,(o.get(i)??0)+f)}let f=e.byDay[t];f!==void 0&&(i[t]={...f,cost:u}),a[t]=d,s+=u}return{...e,total:{...e.total,cost:s},byDay:i,byDayModels:a,byModel:Object.fromEntries(Object.entries(e.byModel).map(([e,t])=>{let n=o.get(e);return[e,n===void 0?t:{...t,cost:n}]})),unpricedModels:(e.unpricedModels??[]).filter(e=>!pt(e)&&!ht(e))}}async function _i(e,t={}){let{timeoutMs:n=12e3,signal:r,...i}=t,a=new AbortController,o=setTimeout(()=>{a.abort()},n),s=()=>{a.abort()};r!=null&&(r.aborted?a.abort():r.addEventListener(`abort`,s,{once:!0}));try{return await fetch(e,{...i,signal:a.signal})}finally{clearTimeout(o),r?.removeEventListener(`abort`,s)}}let vi=new Set;function yi(){return typeof Notification<`u`&&Notification.permission===`granted`}function bi(e,t){vi.has(e)||(vi.add(e),_i(`/api/billing/notify-claim`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({key:e})}).then(e=>e.json()).then(e=>{e.claimed!==!1&&t()}).catch(()=>t()))}function xi(e){let t=new Map,n=[];for(let r of e){if(r.title===void 0||r.title===``){n.push(r);continue}let e=t.get(r.title);if(e===void 0){let e={...r,mergedCount:1};t.set(r.title,e),n.push(e);continue}e.children===void 0&&(e.children=[{...e}]),e.children.push({...r}),e.calls+=r.calls,e.cost+=r.cost,e.lastActive=Math.max(e.lastActive,r.lastActive),r.stale===!0&&(e.stale=!0),e.mergedCount=(e.mergedCount??1)+1}return n.sort((e,t)=>t.cost-e.cost||t.lastActive-e.lastActive)}function Si(e){let t=new Map(e.map(e=>[e.id,e])),n=xi(e.filter(e=>e.parentId===void 0)),r=new Map;for(let e of n){r.set(e.id,e);for(let t of e.children??[])r.set(t.id,e)}let i=new Set,a=new Map,o=(e,t)=>{e.subs===void 0?e.subs=[t]:e.subs.push(t),i.add(t.id),a.set(t.id,e.id)};for(let n of e){if(n.parentId===void 0)continue;let e=t.get(n.parentId);if(e!==void 0&&e.parentId!==void 0&&e.id!==n.id){let t=e.id,r=new Set,i=!1;for(;t!==void 0&&!r.has(t);){if(r.add(t),t===n.id){i=!0;break}t=a.get(t)}if(!i){o(e,n);continue}}let s=new Set,c=n.parentId;for(;c!==void 0&&!s.has(c);){s.add(c);let e=r.get(c);if(e!==void 0){i.has(n.id)||o(e,n);break}c=t.get(c)?.parentId}}let s=e=>e.cost+(e.subCost??0),c=e=>{e.subs?.sort((e,t)=>s(t)-s(e)||t.lastActive-e.lastActive);for(let t of e.subs??[])c(t)};for(let e of n)c(e);let l=e.filter(e=>e.parentId!==void 0&&!i.has(e.id));for(let e of l)c(e);return[...n,...l].sort((e,t)=>t.cost-e.cost||t.lastActive-e.lastActive)}function Ci(e){let t=new Map;for(let n of e)t.has(n.id)||t.set(n.id,n);let n=new Map,r=[];for(let i of e){let e=i.parentId;if(e===void 0||!t.has(e)||wi(t,i.id)){r.push(i);continue}let a=n.get(e);a===void 0?n.set(e,[i]):a.push(i)}let i=(e,t,r)=>{let a=new Set(r);a.add(e.id);let o=(n.get(e.id)??[]).filter(e=>!r.has(e.id)).map(e=>i(e,t+1,a)).sort((e,t)=>t.chainCost-e.chainCost),s={id:e.id,...e.title===void 0?{}:{title:e.title},...e.cwd===void 0?{}:{cwd:e.cwd},calls:e.calls,cost:e.cost,lastActive:e.lastActive,chainCost:e.cost,chainCalls:e.calls,children:o,depth:t};for(let e of o)s.chainCost+=e.chainCost,s.chainCalls+=e.chainCalls;return s};return r.map(e=>i(e,0,new Set)).sort((e,t)=>t.chainCost-e.chainCost)}function wi(e,t){let n=new Set([t]),r=e.get(t)?.parentId;for(;r!==void 0;){if(n.has(r))return!0;n.add(r),r=e.get(r)?.parentId}return!1}function Ti(e){let t=0,n=0,r,i=e=>{t+=1,n+=e.children.length,(r===void 0||e.chainCost>r.chainCost)&&(r=e);for(let t of e.children)i(t)};for(let t of e)i(t);return{agents:t,delegations:n,roots:e.length,...r===void 0?{}:{costliest:r}}}function Ei(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>(e.title??``).toLowerCase().includes(n)||(e.cwd??``).toLowerCase().includes(n)||e.id.toLowerCase().includes(n))}function Di(e,t){let n=e.trim().toLowerCase();return n!==``&&!t.some(e=>e.toLowerCase().includes(n))}function Oi(e,t){return e.checked?e.okProviders.some(e=>ei(t,e))?B.healthOk:e.badProviders.some(e=>ei(t,e))?B.healthBad:B.healthIdle:B.healthIdle}function ki(e,t){switch(e){case`ok`:return``;case`not-configured`:return t(`subscriptionNotConfigured`);case`unauthorized`:return t(`subscriptionUnauthorized`);case`rate-limited`:return t(`subscriptionRateLimited`);case`invalid-response`:return t(`subscriptionInvalid`);default:return t(`subscriptionUnavailable`)}}function Ai(e,t){switch(e){case`session`:return t(`subscriptionSession`);case`weekly`:return t(`subscriptionWeekly`);case`monthly`:return t(`subscriptionMonthly`);case`billing`:return t(`subscriptionBilling`)}}function ji(e,t){switch(e){case`new-api`:return t(`relayKindNewApi`);case`sub2api`:return t(`relayKindSub2Api`);default:return t(`relayKindUnknown`)}}let Mi={"new-api":B.siteKindSite,sub2api:B.siteKindDirect,unknown:B.siteKindUnknown},Ni=e=>e.models.reduce((e,t)=>e+(t.actual??(t.plan===!0?0:t.estimated)),0);function Pi(e){return e.children===void 0?{cost:e.subCost??0,calls:e.subCalls??0}:(e.children??[]).reduce((e,t)=>({cost:e.cost+(t.subCost??0),calls:e.calls+(t.subCalls??0)}),{cost:0,calls:0})}function Fi(e){let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}async function Ii(){try{let e=await _i(`/api/billing/usage-stats`);if(!e.ok)return null;let t=await e.text(),n=JSON.parse(t);if(typeof n!=`object`||!n||!(`total`in n))return null;let r=n,i=e=>typeof e==`object`&&!!e;return{total:r.total??Ar.total,byModel:r.byModel??{},byDay:r.byDay??{},...r.byDayModels===void 0?{}:{byDayModels:r.byDayModels},...i(r.byDayModelsSite)?{byDayModelsSite:r.byDayModelsSite}:{},...r.updatedAt===void 0?{}:{updatedAt:r.updatedAt},...r.staleSnapshot===!0?{staleSnapshot:!0}:{},...typeof r.budget==`number`?{budget:r.budget}:{},...typeof r.lowBalanceThreshold==`number`?{lowBalanceThreshold:r.lowBalanceThreshold}:{},...Array.isArray(r.bySession)?{bySession:r.bySession}:{},...Array.isArray(r.byTurn)?{byTurn:r.byTurn}:{},...Array.isArray(r.byWorkspace)?{byWorkspace:r.byWorkspace}:{},...i(r.bySite)?{bySite:r.bySite}:{},...i(r.byTier)?{byTier:r.byTier}:{},...i(r.byTool)?{byTool:r.byTool}:{},...Array.isArray(r.unpricedModels)?{unpricedModels:r.unpricedModels}:{},...typeof r.staleLedgerSessions==`number`?{staleLedgerSessions:r.staleLedgerSessions}:{},...typeof r.unreadableSessions==`number`?{unreadableSessions:r.unreadableSessions}:{},...typeof r.unreadableFormatSessions==`number`?{unreadableFormatSessions:r.unreadableFormatSessions}:{},...typeof r.unreadableNoLedgerSessions==`number`?{unreadableNoLedgerSessions:r.unreadableNoLedgerSessions}:{},...typeof r.searchCallEstimateCny==`number`?{searchCallEstimateCny:r.searchCallEstimateCny}:{},...r.byRole!==null&&typeof r.byRole==`object`?{byRole:r.byRole}:{},...r.perf!==null&&typeof r.perf==`object`&&r.perf.byModel!==null&&typeof r.perf.byModel==`object`&&r.perf.byHourModel!==null&&typeof r.perf.byHourModel==`object`?{perf:r.perf}:{},...typeof r.pluginVersion==`string`?{pluginVersion:r.pluginVersion}:{}}}catch{return null}}async function Li(){try{let e=await _i(`/api/billing/balance`);if(!e.ok)return{balances:[]};let t=await e.text(),n=JSON.parse(t);if(typeof n!=`object`||!n)return{balances:[]};let r=n;return{balances:Array.isArray(r.balances)?r.balances:[],...r.reconcile===void 0?{}:{reconcile:r.reconcile},...r.stale===!0?{stale:!0}:{}}}catch{return{balances:[]}}}async function Ri(){let e=await _i(`/api/billing/subscriptions`);if(!e.ok)throw Error(`subscriptions HTTP ${String(e.status)}`);let t=await e.text(),n=JSON.parse(t);if(typeof n==`object`&&n&&`quotas`in n){let e=n;return{quotas:e.quotas,...e.stale===!0?{stale:!0}:{}}}throw Error(`subscriptions: invalid response`)}async function zi(){let e=await _i(`/api/billing/relay-quotas`);if(!e.ok)throw Error(`relay-quotas HTTP ${String(e.status)}`);let t=await e.text(),n=JSON.parse(t);if(typeof n==`object`&&n&&`quotas`in n)return n.quotas;throw Error(`relay-quotas: invalid response`)}async function Bi(){try{let e=await _i(`/api/billing/usage-tool`);if(!e.ok)return;let t=JSON.parse(await e.text());return typeof t.enabled==`boolean`?t.enabled:void 0}catch{return}}async function Vi(e){try{let t=await _i(`/api/billing/usage-tool`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({enabled:e})});return t.ok?JSON.parse(await t.text()).ok===!0:!1}catch{return!1}}let Hi=!1,Ui=0;async function Wi(e=0){try{let t=await _i(`/api/billing/pricing`);if(!t.ok){Hi=!1;return}let n=await t.text(),r=JSON.parse(n);if(typeof r!=`object`||!r||!(`source`in r)){Hi=!1;return}let i=r;Array.isArray(i.catalog)&&i.catalog.length>0&&i.aliases!==null&&typeof i.aliases==`object`&&Rt(i.catalog,i.aliases);let a=r;if(a.source===`builtin`&&e<3){if(e===0){if(Hi)return;Hi=!0}setTimeout(()=>{Wi(e+1)},2e3);return}Hi=!1,Ui=a.syncedAt??0,gt(a)}catch{Hi=!1}}async function Gi(){try{return(await _i(`/api/billing/pricing/refresh`,{method:`POST`,headers:{"content-type":`application/json`},body:`{}`,timeoutMs:3e4})).ok?(await Wi(),!0):!1}catch{return!1}}async function Ki(e){try{let t=JSON.parse(await e.text());return typeof t.error==`string`?t.error:`HTTP ${e.status}`}catch{return`HTTP ${e.status}`}}async function qi(e=!1){let t=await _i(`/api/billing/task-queue${e?`?refresh=1`:``}`);if(!t.ok)throw Error(await Ki(t));return await t.json()}async function Ji(){let e=await _i(`/api/billing/task-queue-summary`);if(!e.ok)throw Error(await Ki(e));return await e.json()}async function Yi(e){let t=await _i(`/api/billing/task-queue`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Ki(t));return(await t.json()).snapshot}let Xi=`@kenz1117/dsh-ui-usage-billing/TaskQueuePanel.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Xi)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@kenz1117/dsh-ui-usage-billing`,e.dataset.pluginCss=Xi,e.textContent=`.cQSERa_queuePanel{color:var(--ds-t-1);flex-direction:column;flex-shrink:0;gap:12px;display:flex}.cQSERa_queuePanel *{box-sizing:border-box}.cQSERa_queueHero,.cQSERa_queueComposer,.cQSERa_queueListSection,.cQSERa_queueUnsupported{border:1px solid var(--ds-border);border-radius:var(--ds-r-2);background:var(--dsb-2);flex-shrink:0}.cQSERa_queueHero{justify-content:space-between;align-items:center;gap:16px;padding:16px;display:flex}.cQSERa_queueTitleRow{align-items:center;gap:8px;display:flex}.cQSERa_queueTitle,.cQSERa_queueListHead h3,.cQSERa_queueUnsupported h3{margin:0;font-size:15px;font-weight:650}.cQSERa_queuePreview{background:var(--ds-violet-soft);color:var(--ds-violet);text-transform:uppercase;border-radius:5px;padding:2px 6px;font-size:10px;font-weight:700}.cQSERa_queueSubtitle{color:var(--ds-t-2);margin:5px 0 0;font-size:12px;line-height:1.6}.cQSERa_queueBand{color:var(--ds-t-2);flex-direction:column;flex-shrink:0;align-items:flex-end;gap:3px;font-size:11px;display:flex}.cQSERa_queueBand strong{font-size:13px}.cQSERa_queueBandOff strong{color:var(--ds-green)}.cQSERa_queueBandPeak strong{color:var(--ds-amber)}.cQSERa_queueComposer{flex-direction:column;gap:12px;padding:14px;display:flex}.cQSERa_queueSafety{border-radius:var(--ds-r-1);background:color-mix(in srgb, var(--ds-amber) 8%, transparent);color:var(--ds-t-2);padding:9px 11px;font-size:11px;line-height:1.65}.cQSERa_queueSelectors{grid-template-columns:1fr 1fr;gap:10px;display:grid}.cQSERa_queueField,.cQSERa_queuePromptField{color:var(--ds-t-2);flex-direction:column;gap:6px;font-size:11px;display:flex}.cQSERa_queueField select,.cQSERa_queuePromptField textarea{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);background:var(--dsb);width:100%;color:var(--ds-t-1);font:inherit}.cQSERa_queueField select{height:34px;padding:0 9px}.cQSERa_queuePromptField textarea{resize:vertical;min-height:112px;padding:10px;line-height:1.55}.cQSERa_queueField select:focus,.cQSERa_queuePromptField textarea:focus{outline:2px solid color-mix(in srgb, var(--ds-blue) 35%, transparent);border-color:var(--ds-blue)}.cQSERa_queueField select:disabled,.cQSERa_queuePromptField textarea:disabled{opacity:.55}.cQSERa_queueComposerFooter{color:var(--ds-t-3);justify-content:space-between;align-items:center;gap:12px;font-size:10px;line-height:1.5;display:flex}.cQSERa_queueComposerActions{flex-shrink:0;align-items:center;gap:8px;display:flex}.cQSERa_queueFileInput{display:none}.cQSERa_queuePrimary,.cQSERa_queueSecondary{border-radius:var(--ds-r-1);cursor:pointer;flex-shrink:0;min-height:34px;padding:0 16px;font-weight:600}.cQSERa_queuePrimary{background:var(--ds-blue);color:#fff;border:0}.cQSERa_queueSecondary{border:1px solid var(--ds-border);background:var(--dsb);color:var(--ds-t-1)}.cQSERa_queuePrimary:disabled,.cQSERa_queueSecondary:disabled{opacity:.45;cursor:not-allowed}.cQSERa_queueListSection{padding:12px 14px}.cQSERa_queueListHead{justify-content:space-between;align-items:center;margin-bottom:8px;display:flex}.cQSERa_queueListHead h3 span{color:var(--ds-t-3);margin-left:4px;font-size:11px;font-weight:500}.cQSERa_queueList{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.cQSERa_queueTask{border:1px solid var(--ds-border);border-radius:var(--ds-r-1);background:var(--dsb);padding:10px}.cQSERa_queueTaskHead{align-items:center;gap:8px;min-width:0;display:flex}.cQSERa_queueStatus{background:var(--dsb-3);color:var(--ds-t-2);border-radius:5px;flex-shrink:0;padding:2px 6px;font-size:10px;font-weight:650}.cQSERa_queueStatus_running,.cQSERa_queueStatus_starting{color:var(--ds-blue);background:color-mix(in srgb, var(--ds-blue) 12%, transparent)}.cQSERa_queueStatus_completed{color:var(--ds-green);background:color-mix(in srgb, var(--ds-green) 12%, transparent)}.cQSERa_queueStatus_failed{color:var(--ds-red);background:color-mix(in srgb, var(--ds-red) 10%, transparent)}.cQSERa_queueTaskMeta{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--ds-t-2);font-size:11px;overflow:hidden}.cQSERa_queueTaskTime{color:var(--ds-t-3);flex-shrink:0;margin-left:auto;font-size:10px}.cQSERa_queuePrompt{color:var(--ds-t-1);margin-top:8px;font-size:12px;line-height:1.55}.cQSERa_queuePrompt summary{text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden}.cQSERa_queuePrompt pre{background:var(--dsb-2);white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;font-family:var(--mono);border-radius:6px;margin:8px 0 0;padding:9px;font-size:11px;line-height:1.55;overflow:auto}.cQSERa_queueTaskError{color:var(--ds-red);overflow-wrap:anywhere;margin-top:8px;font-size:11px;line-height:1.5}.cQSERa_queueTaskActions{justify-content:flex-end;gap:10px;margin-top:5px;display:flex}.cQSERa_queueLinkButton{color:var(--ds-blue);cursor:pointer;background:0 0;border:0;padding:2px 0;font-size:11px}.cQSERa_queueLinkButton:disabled{opacity:.45;cursor:not-allowed}.cQSERa_queueEmpty{color:var(--ds-t-3);text-align:center;padding:26px 12px;font-size:12px}.cQSERa_queueUnsupported{padding:22px}.cQSERa_queueUnsupported p{color:var(--ds-t-2);margin:8px 0 0;font-size:12px;line-height:1.7}.cQSERa_queueNotice,.cQSERa_queueNoticeError{border-radius:var(--ds-r-1);overflow-wrap:anywhere;flex-shrink:0;padding:9px 11px;font-size:11px;line-height:1.5}.cQSERa_queueNotice{background:var(--dsb-2);color:var(--ds-t-2)}.cQSERa_queueNoticeError{background:color-mix(in srgb, var(--ds-red) 10%, transparent);color:var(--ds-red)}@media (width<=640px){.cQSERa_queueHero{align-items:flex-start}.cQSERa_queueSelectors{grid-template-columns:1fr}.cQSERa_queueComposerFooter{flex-direction:column;align-items:stretch}.cQSERa_queueComposerActions{flex-wrap:wrap;justify-content:flex-end}.cQSERa_queueTaskTime{display:none}}`,document.head.appendChild(e)}var $={queueBand:`cQSERa_queueBand`,queueBandOff:`cQSERa_queueBandOff`,queueBandPeak:`cQSERa_queueBandPeak`,queueComposer:`cQSERa_queueComposer`,queueComposerActions:`cQSERa_queueComposerActions`,queueComposerFooter:`cQSERa_queueComposerFooter`,queueEmpty:`cQSERa_queueEmpty`,queueField:`cQSERa_queueField`,queueFileInput:`cQSERa_queueFileInput`,queueHero:`cQSERa_queueHero`,queueLinkButton:`cQSERa_queueLinkButton`,queueList:`cQSERa_queueList`,queueListHead:`cQSERa_queueListHead`,queueListSection:`cQSERa_queueListSection`,queueNotice:`cQSERa_queueNotice`,queueNoticeError:`cQSERa_queueNoticeError`,queuePanel:`cQSERa_queuePanel`,queuePreview:`cQSERa_queuePreview`,queuePrimary:`cQSERa_queuePrimary`,queuePrompt:`cQSERa_queuePrompt`,queuePromptField:`cQSERa_queuePromptField`,queueSafety:`cQSERa_queueSafety`,queueSecondary:`cQSERa_queueSecondary`,queueSelectors:`cQSERa_queueSelectors`,queueStatus:`cQSERa_queueStatus`,queueStatus_completed:`cQSERa_queueStatus_completed`,queueStatus_failed:`cQSERa_queueStatus_failed`,queueStatus_running:`cQSERa_queueStatus_running`,queueStatus_starting:`cQSERa_queueStatus_starting`,queueSubtitle:`cQSERa_queueSubtitle`,queueTask:`cQSERa_queueTask`,queueTaskActions:`cQSERa_queueTaskActions`,queueTaskError:`cQSERa_queueTaskError`,queueTaskHead:`cQSERa_queueTaskHead`,queueTaskMeta:`cQSERa_queueTaskMeta`,queueTaskTime:`cQSERa_queueTaskTime`,queueTitle:`cQSERa_queueTitle`,queueTitleRow:`cQSERa_queueTitleRow`,queueUnsupported:`cQSERa_queueUnsupported`};let Zi={queued:`queueStatusQueued`,starting:`queueStatusStarting`,running:`queueStatusRunning`,completed:`queueStatusCompleted`,failed:`queueStatusFailed`};function Qi(e){return e.status===`completed`||e.status===`failed`}function $i(e,t){return JSON.stringify([e,t])}function ea(e,t){let n;try{n=JSON.parse(e)}catch{throw Error(`invalid task import`)}if(!Array.isArray(n)||n.length===0)throw Error(`invalid task import`);return n.map(e=>{if(typeof e==`string`)return{prompt:e,...t};if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`invalid task import`);let n=e;return{prompt:n.prompt,cwd:n.cwd??t.cwd,provider:n.provider??t.provider,model:n.model??t.model}})}function ta({t:e,language:t,navigateToSession:n}){let[r,i]=(0,d.useState)(),[a,o]=(0,d.useState)(``),[s,c]=(0,d.useState)(``),[l,u]=(0,d.useState)(``),[f,p]=(0,d.useState)(!1),[h,g]=(0,d.useState)(),[_,v]=(0,d.useState)(),b=(0,d.useRef)(!0),x=(0,d.useRef)(!1),S=(0,d.useRef)(!1),C=(0,d.useRef)(null),w=(0,d.useCallback)(async()=>{if(!x.current){x.current=!0;try{let e=await qi();b.current&&i(e)}catch(e){b.current&&g(e instanceof Error?e.message:String(e))}finally{x.current=!1}}},[]),[T,ee]=(0,d.useState)(()=>typeof document>`u`||!document.hidden);(0,d.useEffect)(()=>{if(typeof document>`u`)return;let e=()=>{ee(!document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}},[]),(0,d.useEffect)(()=>{if(b.current=!0,!T)return;w();let e=setInterval(()=>{w()},5e3);return()=>{b.current=!1,clearInterval(e)}},[w,T]),(0,d.useEffect)(()=>{if(h===void 0)return;let e=window.setTimeout(()=>{g(void 0)},8e3);return()=>{window.clearTimeout(e)}},[h]),(0,d.useEffect)(()=>{if(_===void 0)return;let e=window.setTimeout(()=>{v(void 0)},4e3);return()=>{window.clearTimeout(e)}},[_]),(0,d.useEffect)(()=>{r!==void 0&&(r.workspaces.some(e=>e.path===s)||c(r.workspaces[0]?.path??``),r.models.some(e=>$i(e.provider,e.id)===l)||u(r.models[0]===void 0?``:$i(r.models[0].provider,r.models[0].id)))},[r,s,l]);let E=(0,d.useCallback)(async(e,t=!1)=>{if(f||S.current)return!1;S.current=!0,p(!0),g(void 0),v(void 0);try{let n=await Yi(e);return b.current?(i(n),t&&o(``),!0):!1}catch(e){return b.current&&g(e instanceof Error?e.message:String(e)),!1}finally{S.current=!1,p(!1)}},[f]),D=(0,d.useMemo)(()=>r?.tasks.filter(e=>!Qi(e))??[],[r]),O=(0,d.useMemo)(()=>r?.tasks.filter(Qi).slice().reverse()??[],[r]),k=r!==void 0&&r.supported&&r.workspaces.length>0&&r.models.length>0,A=e=>new Date(e).toLocaleString(t===`en`?`en-US`:`zh-CN`),j=()=>{if(a.trim()===``||s===``||l===``)return;let[e,t]=JSON.parse(l);E({action:`enqueue`,prompt:a,cwd:s,provider:e,model:t},!0)},M=async t=>{if(!(t===void 0||!k||f||l===``)){g(void 0),v(void 0);try{if(t.size>10485760){g(e(`queueImportTooLarge`));return}let[n,r]=JSON.parse(l),i=ea(await t.text(),{cwd:s,provider:n,model:r});await E({action:`enqueueMany`,tasks:i})&&b.current&&v(e(`queueImported`,{count:i.length}))}catch{b.current&&g(e(`queueImportFormat`))}}},te=t=>{let r=n(t);v(r===`opened`?void 0:e(r===`unavailable`?`sessionOpenUnavailable`:`sessionOpenFailed`))},ne=t=>{let n=r?.workspaces.find(e=>e.path===t.cwd);return(0,m.jsxs)(`li`,{className:$.queueTask,"data-testid":`queue-task-${t.id}`,children:[(0,m.jsxs)(`div`,{className:$.queueTaskHead,children:[(0,m.jsx)(`span`,{className:y($.queueStatus,$[`queueStatus_${t.status}`]),children:e(Zi[t.status])}),(0,m.jsxs)(`span`,{className:$.queueTaskMeta,children:[n?.title??t.cwd,` · `,t.model]}),(0,m.jsx)(`time`,{className:$.queueTaskTime,dateTime:new Date(t.createdAt).toISOString(),children:A(t.createdAt)})]}),(0,m.jsxs)(`details`,{className:$.queuePrompt,children:[(0,m.jsx)(`summary`,{children:t.prompt.trim().slice(0,180)||t.prompt.slice(0,180)}),(0,m.jsx)(`pre`,{children:t.prompt})]}),t.error!==void 0&&(0,m.jsx)(`div`,{className:$.queueTaskError,role:`note`,children:t.error}),(0,m.jsxs)(`div`,{className:$.queueTaskActions,children:[t.sessionId!==void 0&&(0,m.jsx)(`button`,{type:`button`,className:$.queueLinkButton,onClick:()=>{te(t.sessionId)},children:e(`queueOpenSession`)}),(t.status===`queued`||Qi(t))&&(0,m.jsx)(`button`,{type:`button`,className:$.queueLinkButton,disabled:f,onClick:()=>{E({action:`remove`,id:t.id})},children:e(t.status===`queued`?`queueRemoveQueued`:`queueRemoveHistory`)})]})]},t.id)};return(0,m.jsxs)(`div`,{className:$.queuePanel,"data-testid":`billing-tab-panel-queue`,children:[(0,m.jsxs)(`section`,{className:$.queueHero,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsxs)(`div`,{className:$.queueTitleRow,children:[(0,m.jsx)(`h2`,{className:$.queueTitle,children:e(`tabQueue`)}),(0,m.jsx)(`span`,{className:$.queuePreview,children:`Preview`})]}),(0,m.jsx)(`p`,{className:$.queueSubtitle,children:e(`queueSubtitle`)})]}),r?.supported&&(0,m.jsxs)(`div`,{className:y($.queueBand,r.tier===`offPeak`?$.queueBandOff:$.queueBandPeak),children:[(0,m.jsx)(`strong`,{children:e(r.tier===`offPeak`?`offPeak`:`peak`)}),(0,m.jsxs)(`span`,{children:[e(r.tier===`offPeak`?`queueUntilPeak`:`queueUntilOffPeak`),` `,It(r.nextSwitchInMs)]})]})]}),h!==void 0&&(0,m.jsx)(`div`,{className:$.queueNoticeError,role:`alert`,children:h}),_!==void 0&&(0,m.jsx)(`div`,{className:$.queueNotice,role:`status`,children:_}),r===void 0?(0,m.jsx)(`div`,{className:$.queueEmpty,children:e(`queueLoading`)}):r.supported?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`section`,{className:$.queueComposer,children:[(0,m.jsx)(`div`,{className:$.queueSafety,children:e(`queueSafety`)}),(0,m.jsxs)(`div`,{className:$.queueSelectors,children:[(0,m.jsxs)(`label`,{className:$.queueField,children:[(0,m.jsx)(`span`,{children:e(`queueWorkspace`)}),(0,m.jsx)(`select`,{value:s,disabled:!k||f,onChange:e=>{c(e.target.value)},children:r.workspaces.map(e=>(0,m.jsx)(`option`,{value:e.path,children:e.title},e.path))})]}),(0,m.jsxs)(`label`,{className:$.queueField,children:[(0,m.jsx)(`span`,{children:e(`queueModel`)}),(0,m.jsx)(`select`,{value:l,disabled:!k||f,onChange:e=>{u(e.target.value)},children:r.models.map(e=>(0,m.jsxs)(`option`,{value:$i(e.provider,e.id),children:[e.providerName,` / `,e.name]},$i(e.provider,e.id)))})]})]}),!k&&(0,m.jsx)(`div`,{className:$.queueNotice,children:r.optionsError??e(`queueNoOptions`)}),(0,m.jsxs)(`label`,{className:$.queuePromptField,children:[(0,m.jsx)(`span`,{children:e(`queuePromptLabel`)}),(0,m.jsx)(`textarea`,{value:a,disabled:!k||f,maxLength:32e3,rows:5,placeholder:e(`queuePromptPlaceholder`),onChange:e=>{o(e.target.value)}})]}),(0,m.jsxs)(`div`,{className:$.queueComposerFooter,children:[(0,m.jsx)(`span`,{children:e(`queuePrivacy`)}),(0,m.jsxs)(`div`,{className:$.queueComposerActions,children:[(0,m.jsx)(`input`,{ref:C,className:$.queueFileInput,"data-testid":`queue-import-file`,type:`file`,accept:`application/json,.json`,disabled:!k||f,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,M(t)}}),(0,m.jsx)(`button`,{type:`button`,className:$.queueSecondary,title:e(`queueImportHint`),disabled:!k||f,onClick:()=>{C.current?.click()},children:e(`queueImport`)}),(0,m.jsx)(`button`,{type:`button`,className:$.queuePrimary,disabled:!k||f||a.trim()===``,onClick:j,children:e(`queueEnqueue`)})]})]})]}),(0,m.jsxs)(`section`,{className:$.queueListSection,children:[(0,m.jsxs)(`div`,{className:$.queueListHead,children:[(0,m.jsxs)(`h3`,{children:[e(`queueActive`),` `,(0,m.jsx)(`span`,{children:D.length})]}),O.length>0&&(0,m.jsx)(`button`,{type:`button`,className:$.queueLinkButton,disabled:f,onClick:()=>{E({action:`clearFinished`})},children:e(`queueClearFinished`)})]}),D.length===0&&O.length===0?(0,m.jsx)(`div`,{className:$.queueEmpty,children:e(`queueEmpty`)}):(0,m.jsxs)(`ul`,{className:$.queueList,children:[D.map(ne),O.map(ne)]})]})]}):(0,m.jsxs)(`section`,{className:$.queueUnsupported,"data-testid":`queue-unsupported`,children:[(0,m.jsx)(`h3`,{children:e(`queueUnsupportedTitle`)}),(0,m.jsx)(`p`,{children:e(`queueUnsupportedBody`)})]})]})}function na({window:e,t}){let n=Math.min(100,Math.max(0,e.usedPercent)),r=Math.min(100,Math.max(0,e.remainingPercent))<=0;return(0,m.jsxs)(`div`,{className:B.subscriptionWindow,children:[(0,m.jsx)(`span`,{className:B.subscriptionWindowLabel,children:Ai(e.kind,t)}),(0,m.jsx)(`span`,{className:B.subscriptionTrack,"aria-hidden":`true`,children:(0,m.jsx)(`span`,{className:y(B.subscriptionFill,n>=100&&B.subscriptionFillOver,n>=80&&n<100&&B.subscriptionFillWarn),style:{width:`${n}%`}})}),(0,m.jsxs)(`span`,{className:B.subscriptionMeta,children:[(0,m.jsx)(`span`,{className:y(B.subscriptionPct,r&&B.subscriptionExhausted),children:r?t(`subscriptionExhausted`):t(`subscriptionRemaining`).replace(`{pct}`,String(e.remainingPercent))}),e.resetsAt!==void 0&&(0,m.jsx)(`span`,{className:B.subscriptionReset,children:t(`subscriptionReset`).replace(`{date}`,`${K(new Date(e.resetsAt).getTime())} ${Fi(new Date(e.resetsAt).getTime())}`)})]})]})}function ra({label:e,t}){return(0,m.jsx)(p.Tooltip,{label:e,side:`top`,maxWidth:280,children:(0,m.jsx)(`span`,{className:B.helpTip,role:`note`,"aria-label":e,children:`?`})})}function ia(e,t){return e===B.healthOk?t(`healthDotLive`):e===B.healthBad?t(`healthDotFailed`):t(`healthDotUnknown`)}function aa(e){let t=t=>dn(un(t,e.currency),e.currency),{wide:n,t:r,onOpen:i,monthCost:a,todayCost:o,weekCost:s,days:c,vendorStatus:l,dash:u,floatPrefs:p,subscriptions:h,cardPrefs:g,monthTokens:_,todayTokens:v,weekTokens:b,budgetPressure:x,deltaPct:S=0}=e,C=(0,d.useMemo)(()=>p.targets.map(e=>h.find(t=>t.provider===e)).filter(e=>e!==void 0),[p.targets,h]),[w,T]=(0,d.useState)(0),ee=C.length===0?0:Math.min(w,C.length-1),E=C[ee],D=(0,d.useRef)(null),[O,k]=(0,d.useState)(!1),[A,j]=(0,d.useState)({left:0,top:0});(0,d.useEffect)(()=>{if(!O||p.mode!==`subscription`||C.length<2)return;let e=setInterval(()=>T(e=>(e+1)%C.length),1500);return()=>clearInterval(e)},[O,p.mode,C.length]);let M=(0,d.useRef)(void 0),te=(0,d.useCallback)(()=>{window.clearTimeout(M.current),k(!0)},[]),ne=(0,d.useCallback)(()=>{window.clearTimeout(M.current),M.current=window.setTimeout(()=>k(!1),120)},[]);(0,d.useEffect)(()=>()=>window.clearTimeout(M.current),[]);let N=(0,d.useCallback)(()=>{let e=D.current?.getBoundingClientRect();e!==void 0&&j({left:e.left,top:e.top-8})},[]);(0,d.useEffect)(()=>{if(!O)return;let e=()=>N();return window.addEventListener(`scroll`,e,{capture:!0,passive:!0}),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,{capture:!0}),window.removeEventListener(`resize`,e)}},[O,N]);let re=c.length>0?c.reduce((e,t)=>e+t.cost,0)/c.length:0,ie=re>0?Math.max(0,Math.min(1,o/re)):0,ae=-80+ie*160,oe=(0,m.jsxs)(`svg`,{viewBox:`3.5 10 34 22`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,m.jsx)(`path`,{d:`M5.23 26.4A15 15 0 0 1 34.77 26.4`,strokeWidth:3,opacity:.16}),(0,m.jsx)(`path`,{d:`M5.23 26.4A15 15 0 0 1 34.77 26.4`,strokeWidth:3,strokeDasharray:`${(41.9*ie).toFixed(2)} 41.9`,className:B.triggerGaugeArc}),(0,m.jsx)(`path`,{d:`M5.23 26.4 8.18 26.92M10.36 17.51 12.29 19.81M20 14v3M27.71 19.81 29.64 17.51M31.82 26.92 34.77 26.4`,strokeWidth:1.6,opacity:.7}),(0,m.jsx)(`path`,{d:`M7.01 21.5 8.31 22.25M14.87 14.91 15.38 16.31M24.62 16.31 25.13 14.91M31.69 22.25 32.99 21.5`,strokeWidth:1.2,opacity:.38}),(0,m.jsx)(`line`,{x1:`20`,y1:`29`,x2:`20`,y2:`19.5`,strokeWidth:2,className:B.triggerGaugeNeedle,style:{transform:`rotate(${ae}deg)`,transformOrigin:`20px 29px`}}),(0,m.jsx)(`circle`,{cx:`20`,cy:`29`,r:`1.5`,fill:`currentColor`,stroke:`none`})]});if(g.mode===`hidden`)return null;if(!n||g.mode===`compact`)return(0,m.jsx)(`button`,{type:`button`,className:y(B.railButton,x!==`none`&&B.triggerBudgetPulse,x===`over`&&B.triggerBudgetOver),"data-testid":`billing-rail-button`,onClick:i,title:`${r(`title`)} · ${t(g.span===`day`?o:g.span===`week`?s:a)}`,children:oe});let se=g.metric===`tokens`,ce=c.map(e=>se?e.tokens:e.cost),le=Math.max(...ce,0),ue=ce.map(e=>le>0?4+e/le*12:4);return(0,m.jsxs)(`span`,{ref:D,className:B.triggerWrap,onMouseEnter:()=>{N(),te()},onMouseLeave:ne,onFocusCapture:()=>{N(),te()},onBlurCapture:()=>k(!1),children:[(0,m.jsxs)(`button`,{type:`button`,className:y(B.trigger,x!==`none`&&B.triggerBudgetPulse,x===`over`&&B.triggerBudgetOver),"data-testid":`billing-trigger`,onClick:i,title:`${r(`title`)} · ${t(g.span===`day`?o:g.span===`week`?s:a)}`,children:[(0,m.jsx)(`span`,{className:y(B.triggerIcon,x!==`none`&&B.triggerBudgetHot),"data-testid":`billing-trigger-icon`,children:oe}),(0,m.jsx)(`span`,{className:B.triggerMain,children:(0,m.jsxs)(`span`,{className:B.triggerPrimary,children:[(0,m.jsx)(`span`,{className:B.triggerLabel,children:se?g.span===`day`?r(`triggerTodayTokens`):g.span===`week`?r(`triggerWeekTokens`):r(`triggerMonthTokens`):g.span===`day`?r(`triggerToday`):g.span===`week`?r(`weekCost`):r(`triggerMonth`)}),(()=>{let e=g.span===`day`?se?v:o:g.span===`week`?se?b:s:se?_:a,n=g.span===`day`?S:0;return se?(0,m.jsx)(`span`,{className:B.triggerMetric,"data-testid":`billing-trigger-span-tokens`,children:q(e)}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`span`,{className:B.triggerValueRow,children:[(0,m.jsx)(`span`,{className:B.triggerYen,"aria-hidden":`true`,children:t(e).charAt(0)}),(0,m.jsx)(`span`,{className:B.triggerMetric,"data-testid":`billing-trigger-span-money`,children:t(e).slice(1)})]}),g.showDelta&&n!==0&&(0,m.jsxs)(`span`,{className:y(B.triggerDelta,n>0?B.triggerDeltaUp:B.triggerDeltaDown),"data-testid":`billing-trigger-delta`,children:[n>0?`▲`:`▼`,` `,Math.abs(n).toFixed(1),`%`]}),(0,m.jsx)(`span`,{className:B.triggerGlow,"aria-hidden":`true`})]})})()]})}),(0,m.jsx)(`span`,{className:B.triggerSpark,"data-testid":`billing-trigger-spark`,"aria-hidden":`true`,children:ue.map((e,t)=>(0,m.jsx)(`span`,{className:t===ue.length-1?B.triggerSparkHot:B.triggerSparkBar,style:{height:`${e}px`}},c[t]?.date??String(t)))})]}),(0,f.createPortal)((0,m.jsx)(`span`,{className:y(B.triggerPop,O&&B.triggerPopShown),style:{left:`${A.left}px`,top:`${A.top}px`},"data-testid":`billing-trigger-pop`,"aria-hidden":!O,onMouseEnter:te,onMouseLeave:ne,children:p.mode===`subscription`?(0,m.jsx)(m.Fragment,{children:C.length===0?(0,m.jsx)(`span`,{className:B.triggerPopEmpty,children:r(`floatNoTargets`)}):(0,m.jsxs)(m.Fragment,{children:[E!==void 0&&(0,m.jsxs)(`div`,{className:B.floatSub,"data-testid":`billing-float-subscription`,children:[(0,m.jsxs)(`div`,{className:B.floatSubHead,children:[(0,m.jsx)(`span`,{className:B.floatSubName,children:E.displayName}),E.plan!==void 0&&(0,m.jsx)(`span`,{className:B.floatSubPlan,children:E.plan})]}),E.windows.map(e=>(0,m.jsx)(na,{window:e,t:r},e.kind))]}),C.length>1&&(0,m.jsx)(`span`,{className:B.triggerPopSwitcher,"data-testid":`billing-float-switcher`,children:(0,m.jsxs)(`span`,{className:B.triggerPopSwitchCount,children:[ee+1,`/`,C.length]})})]})}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:B.popHead,children:(0,m.jsx)(`span`,{className:B.popTitle,children:r(`popTitle`)})}),(0,m.jsxs)(`span`,{className:B.metricGrid,children:[(0,m.jsxs)(`span`,{className:B.metricCell,children:[(0,m.jsx)(`span`,{className:B.metricLabel,children:r(`floatPrimaryToday`)}),(0,m.jsx)(`span`,{className:B.metricValue,children:t(o)})]}),(0,m.jsxs)(`span`,{className:B.metricCell,children:[(0,m.jsx)(`span`,{className:B.metricLabel,children:r(`floatPrimaryWeek`)}),(0,m.jsx)(`span`,{className:B.metricValue,children:t(s)})]}),(0,m.jsxs)(`span`,{className:B.metricCell,children:[(0,m.jsx)(`span`,{className:B.metricLabel,children:r(`floatPrimaryMonth`)}),(0,m.jsx)(`span`,{className:B.metricValue,children:t(a)})]}),(0,m.jsxs)(`span`,{className:B.metricCell,children:[(0,m.jsx)(`span`,{className:B.metricLabel,children:r(`input`)}),(0,m.jsx)(`span`,{className:B.metricValue,children:q(u.input)})]}),(0,m.jsxs)(`span`,{className:B.metricCell,children:[(0,m.jsx)(`span`,{className:B.metricLabel,children:r(`output`)}),(0,m.jsx)(`span`,{className:B.metricValue,children:q(u.output)})]}),(0,m.jsxs)(`span`,{className:B.metricCell,children:[(0,m.jsx)(`span`,{className:B.metricLabel,children:r(`cacheHit`)}),(0,m.jsx)(`span`,{className:y(B.metricValue,B.metricValueSuccess),children:mn(u.cacheRead+u.cacheMiss>0?u.cacheRead/(u.cacheRead+u.cacheMiss)*100:0)})]})]}),(0,m.jsxs)(`span`,{className:B.popModel,children:[(0,m.jsx)(`span`,{className:B.popModelLabel,children:r(`popTodayModel`)}),l.direct!==void 0||l.sub!==void 0?(0,m.jsxs)(m.Fragment,{children:[l.direct!==void 0&&(0,m.jsxs)(`span`,{className:B.popModelRow,children:[(0,m.jsx)(`span`,{className:y(B.popDot,B.popDotDirect),"aria-hidden":`true`}),(0,m.jsx)(`span`,{className:B.popTagPrimary,children:r(`popDirectLead`)}),(0,m.jsx)(`span`,{className:B.popModelName,children:l.direct.name}),(0,m.jsx)(`span`,{className:y(B.popModelStatus,l.direct.low&&B.popModelStatusLow),children:l.direct.text})]}),l.sub!==void 0&&(0,m.jsxs)(`span`,{className:B.popModelRow,children:[(0,m.jsx)(`span`,{className:y(B.popDot,B.popDotSub),"aria-hidden":`true`}),(0,m.jsx)(`span`,{className:B.popTagSub,children:r(`popSubLead`)}),(0,m.jsx)(`span`,{className:B.popModelName,children:l.sub.name}),(0,m.jsx)(`span`,{className:y(B.popModelStatus,l.sub.low&&B.popModelStatusLow),children:l.sub.text})]})]}):(0,m.jsxs)(`span`,{className:B.popModelRow,children:[(0,m.jsx)(`span`,{className:y(B.popDot,B.popDotNeutral),"aria-hidden":`true`}),(0,m.jsx)(`span`,{className:B.popModelStatus,children:r(`popNoConsumption`)})]})]})]})}),document.body)]})}function oa({balance:e,days:t,dailyBurn:n,money:r,t:i,onClose:a}){let o=t=>t===void 0?void 0:e.currency===`USD`?`$${t.toFixed(2)}`:r(t),s=o(e.totalBalance),c=o(e.grantedBalance),l=o(e.toppedUpBalance);return(0,m.jsxs)(`span`,{className:B.balanceDetailPop,"data-testid":`billing-balance-detail-pop`,onClick:e=>{e.stopPropagation()},children:[(0,m.jsxs)(`span`,{className:B.balanceDetailHead,children:[(0,m.jsx)(`span`,{className:B.balanceDetailTitle,children:e.displayName}),(0,m.jsx)(`button`,{type:`button`,className:B.balanceDetailClose,"aria-label":i(`close`),onClick:a,children:`×`})]}),(0,m.jsxs)(`span`,{className:B.balanceDetailGrid,children:[s!==void 0&&(0,m.jsx)(sa,{label:i(`balance`),value:s}),c!==void 0&&(0,m.jsx)(sa,{label:i(`balanceGranted`),value:c}),l!==void 0&&(0,m.jsx)(sa,{label:i(`balanceTopped`),value:l}),(0,m.jsx)(sa,{label:i(`balanceDaily`),value:r(n)}),(0,m.jsx)(sa,{label:i(`balanceDaysLong`),value:`${t} ${i(`balanceDaysUnit`)}`})]})]})}function sa({label:e,value:t}){return(0,m.jsxs)(`span`,{className:B.balanceDetailRow,children:[(0,m.jsx)(`span`,{className:B.balanceDetailLabel,children:e}),(0,m.jsx)(`span`,{className:B.balanceDetailValue,children:t})]})}function ca({userPrices:e,onUserPrices:t,t:n}){let[r,i]=(0,d.useState)(()=>[...e]),[a,o]=(0,d.useState)(new Set),s=e=>o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),c=()=>{i(e=>e.filter((e,t)=>!a.has(t))),o(new Set)},l=(e,t)=>i(n=>n.map((n,r)=>r===e?{...n,...t}:n)),u=()=>i(e=>[...e,{key:``,input:0,cacheHit:0,output:0}]),f=e=>{let t=r[e]?.offPeak;return{input:t===void 0?``:String(t.input),cacheHit:t===void 0?``:String(t.cacheHit),output:t===void 0?``:String(t.output)}},p=(e,t,n)=>i(r=>r.map((r,i)=>{if(i!==e)return r;let a=r.offPeak,o={input:a===void 0?``:String(a.input),cacheHit:a===void 0?``:String(a.cacheHit),output:a===void 0?``:String(a.output),[t]:n},s=[o.input,o.cacheHit,o.output].some(e=>e.trim()!==``),c=[o.input,o.cacheHit,o.output].map(e=>Number(e)),l=s&&c.every(e=>Number.isFinite(e)&&e>=0)&&c.some(e=>e>0),{offPeak:u,...d}=r;return l?{...d,offPeak:{input:c[0]??0,cacheHit:c[1]??0,output:c[2]??0}}:d})),h=()=>t(r.filter(e=>e.key.trim()!==``).map(e=>({...e,key:e.key.trim(),...e.origin===void 0||e.origin.trim()===``?{}:{origin:ct(e.origin.trim())}}))),g=on().map(e=>e.key),_=(e,t)=>i(n=>n.map((n,r)=>{if(r!==e)return n;let{currency:i,...a}=n;return t===`USD`?{...a,currency:`USD`}:a})),[v,b]=(0,d.useState)({}),x=(e,t,n)=>`${e}:${t}:${n}`,S=(e,t,n)=>b(r=>{let i=x(e,t,n);if(r[i]===void 0)return r;let a={...r};return delete a[i],a}),C=e=>Number.isFinite(e)&&e!==0?String(e):``,w=(e,t,n)=>{if(b(r=>({...r,[x(e,`main`,t)]:n})),n===``){l(e,{[t]:0});return}let r=Number(n);Number.isFinite(r)&&r>=0&&l(e,{[t]:r})};return(0,m.jsxs)(`section`,{className:B.setCard,"data-testid":`billing-user-prices`,children:[(0,m.jsx)(`div`,{className:B.setCardHead,children:(0,m.jsx)(`div`,{className:B.setCardMeta,children:(0,m.jsxs)(`h3`,{className:B.setCardTitle,children:[n(`userPrices`),(0,m.jsx)(ra,{label:n(`userPricesHint`),t:n})]})})}),(0,m.jsxs)(`div`,{className:B.ctlCol,children:[(0,m.jsx)(`datalist`,{id:`billing-price-model-keys`,children:g.map(e=>(0,m.jsx)(`option`,{value:e},e))}),r.map((e,t)=>(0,m.jsxs)(`div`,{className:B.userPriceRow,"data-testid":`billing-user-price-row`,children:[(0,m.jsx)(`input`,{type:`checkbox`,className:B.userPriceCheck,"data-testid":`billing-user-price-select`,checked:a.has(t),"aria-label":n(`userPriceSelect`),onChange:()=>s(t)}),(0,m.jsxs)(`div`,{className:B.userPriceBody,children:[(0,m.jsxs)(`div`,{className:B.userPriceLineMeta,children:[(0,m.jsxs)(`div`,{className:B.userPriceField,children:[(0,m.jsx)(`span`,{className:B.ctlLabel,children:n(`userPriceModel`)}),(0,m.jsx)(`input`,{className:B.userPriceInput,"data-testid":`billing-user-price-model`,type:`text`,list:`billing-price-model-keys`,value:e.key,placeholder:`flash`,"aria-label":n(`userPriceModel`),onChange:e=>l(t,{key:e.target.value})})]}),(0,m.jsxs)(`div`,{className:B.userPriceField,children:[(0,m.jsx)(`span`,{className:B.ctlLabel,children:n(`userPriceSource`)}),(0,m.jsx)(`input`,{className:B.userPriceInput,"data-testid":`billing-user-price-origin`,type:`text`,value:e.origin??``,placeholder:n(`userPriceSourceHint`),"aria-label":n(`userPriceSource`),onChange:e=>l(t,{origin:e.target.value.trim()})})]}),(0,m.jsxs)(`div`,{className:B.userPriceField,children:[(0,m.jsx)(`span`,{className:B.ctlLabel,children:n(`userPriceCurrency`)}),(0,m.jsxs)(`div`,{className:B.ctlGroup,children:[(0,m.jsx)(`button`,{type:`button`,className:y(B.floatModeBtn,e.currency!==`USD`&&B.floatModeBtnOn),onClick:()=>_(t,`CNY`),children:`CNY`}),(0,m.jsx)(`button`,{type:`button`,className:y(B.floatModeBtn,e.currency===`USD`&&B.floatModeBtnOn),onClick:()=>_(t,`USD`),children:`USD`})]})]})]}),[{scope:`main`,label:n(`userPriceNormal`),testid:`billing-user-price-normal`,valueOf:n=>v[x(t,`main`,n)]??C(e[n]),onChange:(e,n)=>w(t,e,n)},{scope:`off`,label:n(`userPriceOffPeak`),testid:`billing-user-price-offpeak`,valueOf:e=>v[x(t,`off`,e)]??f(t)[e],onChange:(e,n)=>{b(r=>({...r,[x(t,`off`,e)]:n})),p(t,e,n)}}].map(e=>(0,m.jsxs)(`div`,{className:B.userPricePriceLine,"data-testid":e.testid,children:[(0,m.jsx)(`span`,{className:B.ctlLabel,children:e.label}),[`input`,`cacheHit`,`output`].map(r=>{let i=n(r===`input`?`tokenMiss`:r===`cacheHit`?`tokenHit`:`tokenOutput`);return(0,m.jsx)(`input`,{className:B.userPriceInputNum,type:`number`,min:0,step:.01,placeholder:i,"aria-label":`${e.label} ${i}`,value:e.valueOf(r),onChange:t=>e.onChange(r,t.target.value),onBlur:()=>S(t,e.scope,r)},r)})]},e.testid))]})]},t)),(0,m.jsxs)(`div`,{className:B.ctlRow,children:[(0,m.jsx)(`button`,{type:`button`,className:B.exportButton,"data-testid":`billing-user-price-add`,onClick:u,children:n(`userPriceAdd`)}),(0,m.jsxs)(`button`,{type:`button`,className:B.exportButton,"data-testid":`billing-user-price-remove-selected`,disabled:a.size===0,onClick:c,children:[n(`userPriceRemoveSelected`),a.size>0?` (${a.size})`:``]}),(0,m.jsx)(`button`,{type:`button`,className:B.exportButton,"data-testid":`billing-user-price-save`,onClick:h,children:n(`userPriceSave`)})]})]})]})}function la({stats:e,t,onClose:n,embeddedSettings:r=!1,userPrices:i,onUserPrices:a,health:o,balances:s,reconcile:c,quotas:l,relayQuotas:u,currency:f,onCurrency:h,language:g,onLanguage:_,turns:v,renderSlot:b,budgetEnabled:x,budgetAmount:S,onToggleBudget:C,onBudgetAmount:w,modelBudgets:T,monthModelCost:ee,onModelBudget:E,peakConfig:D,onPeakConfig:O,onPreviewPeak:k,floatPrefs:A,onFloatPrefs:j,cardPrefs:M,onCardPrefs:te,recoveryEntryAvailable:ne,sitePrefs:N,onSitePrefs:re,liveCostPrefs:oe,onLiveCostPrefs:se,quotasStale:ue,balanceStale:de,navigateToSession:fe}){let pe=(0,d.useRef)(null),me=(0,d.useMemo)(()=>Ci(e.bySession??[]),[e.bySession]),he=(0,d.useMemo)(()=>Ti(me),[me]),[ge,_e]=(0,d.useState)(void 0),ve=(0,d.useCallback)(e=>{let n=fe(e);if(n===`opened`){_e(void 0);return}_e(t(n===`unavailable`?`sessionOpenUnavailable`:`sessionOpenFailed`))},[fe,t]),[ye,be]=(0,d.useState)(`cost`),{total:xe,byModel:Se,byDay:P}=e,[F,we]=(0,d.useState)(r?`settings`:`overview`),[Te,Oe]=(0,d.useState)(7),[Ae,je]=(0,d.useState)(()=>{try{return window.localStorage.getItem(`dsh-billing:reconcile-dismissed`)??``}catch{return``}}),Me=()=>{let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`},Ne=(0,d.useCallback)(()=>{let e=Me();je(e);try{window.localStorage.setItem(`dsh-billing:reconcile-dismissed`,e)}catch{}},[]),[Pe,Fe]=(0,d.useState)(()=>{let e=[`unpriced`,`search-estimate`,`unreadable`],t=new Set,n=new Date,r=e=>String(e).padStart(2,`0`),i=`${n.getFullYear()}-${r(n.getMonth()+1)}-${r(n.getDate())}`;try{for(let n of e)window.localStorage.getItem(`dsh-billing:notice-${n}-dismissed`)===i&&t.add(n)}catch{}return t}),Ie=(0,d.useCallback)(e=>{let t=Me();Fe(t=>new Set(t).add(e));try{window.localStorage.setItem(`dsh-billing:notice-${e}-dismissed`,t)}catch{}},[]),[Le,Re]=(0,d.useState)(`month`),[R,ze]=(0,d.useState)(`cost`),[He,Ke]=(0,d.useState)(Ve),[qe,Je]=(0,d.useState)(We),[Ye,Xe]=(0,d.useState)(`budget`),[Ze,V]=(0,d.useState)(``),H=e=>Di(Ze,e);(0,d.useEffect)(()=>{let e=pe.current;if(F!==`settings`||e===null||typeof IntersectionObserver>`u`)return;let t=Array.from(e.querySelectorAll(`[id^="settings-"]`)).filter(e=>!e.closest(`[hidden]`));if(t.length===0)return;let n=new IntersectionObserver(e=>{let t,n=1/0;for(let r of e){if(!r.isIntersecting)continue;let e=r.boundingClientRect.top;e<n&&(n=e,t=r.target.id)}t!==void 0&&Xe(t.slice(9))},{rootMargin:`-80px 0px -55% 0px`});for(let e of t)n.observe(e);return()=>{n.disconnect()}},[F]);let Qe=(0,d.useCallback)(e=>{Xe(e);let t=pe.current?.querySelector(`[id="settings-${e}"]`);if(t==null)return;if(r){t.scrollIntoView({block:`start`,behavior:`smooth`});return}let n=t.closest(`.${B.dashboardBody}`);if(n===null)return;let i=t.getBoundingClientRect().top-n.getBoundingClientRect().top;n.scrollTo({top:n.scrollTop+i,behavior:`smooth`})},[r]),$e=(0,d.useCallback)(e=>{Ke(e),z(e)},[]),et=(0,d.useCallback)(e=>{Je(e),Ge(e)},[]);(0,d.useEffect)(()=>{typeof document>`u`||(document.documentElement.dataset.density=He,document.documentElement.dataset.motion=qe)},[He,qe]),(0,d.useEffect)(()=>{if(typeof window>`u`)return;let e=e=>{let t=e.detail;t?.density!==void 0&&Ke(t.density)},t=e=>{let t=e.detail;t?.motion!==void 0&&Je(t.motion)};return window.addEventListener(Be,e),window.addEventListener(Ue,t),()=>{window.removeEventListener(Be,e),window.removeEventListener(Ue,t)}},[]);let[U,nt]=(0,d.useState)(ie),[W,rt]=(0,d.useState)(ce),it=e=>{let t={...W,...e};t.start!==``&&t.end!==``&&(t.start>t.end&&(e.start===void 0?t.start=t.end:t.end=t.start),rt(t),le(t))},at=(0,d.useMemo)(()=>l.filter(e=>e.status===`ok`&&e.windows.length>0).map(e=>({id:e.provider,label:e.displayName})),[l]),[ot,st]=(0,d.useState)(),[ct,lt]=(0,d.useState)(new Set),[ut,dt]=(0,d.useState)(!1),[ft,pt]=(0,d.useState)(``),mt=(0,d.useCallback)(e=>{lt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),ht=(0,d.useMemo)(()=>Si(e.bySession??[]),[e.bySession]),gt=e=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`td`,{className:B.numCol,children:e.calls.toLocaleString()}),(0,m.jsx)(`td`,{className:B.numCol,children:G(e.cost)}),(0,m.jsx)(`td`,{className:B.numCol,children:e.lastActive>0?`${K(e.lastActive)} ${Fi(e.lastActive)}`:`—`})]}),_t=(e,n)=>(0,m.jsxs)(d.Fragment,{children:[(0,m.jsxs)(`tr`,{className:y(B.sessionChildRow,n>0&&B.sessionSubDeepRow),"data-testid":`billing-session-sub-row`,children:[(0,m.jsxs)(`td`,{children:[(0,m.jsx)(`span`,{className:y(B.ubTag,B.ubTagNeutral),children:t(`sessionSubRow`)}),(e.subCalls??0)>0&&(0,m.jsx)(`span`,{className:y(B.ubTag,B.ubTagNeutral),"data-testid":`billing-session-sub-chain`,children:e.subCost!==void 0&&e.subCost>0?t(`sessionSubCost`).replace(`{cost}`,G(e.subCost)):t(`sessionSubCalls`).replace(`{calls}`,(e.subCalls??0).toLocaleString())}),(0,m.jsx)(`span`,{className:B.modelProvider,children:e.title??e.id.slice(0,8)})]}),gt(e)]}),e.subs?.map(e=>_t(e,n+1))]},e.id),vt=(0,d.useMemo)(()=>Ei(e.bySession??[],ft),[e.bySession,ft]),yt=(0,d.useMemo)(()=>[...new Set([...Object.keys(ee),...Object.keys(T)])].map(e=>{let t=tn(e);return{key:e,name:t.key===`other`?void 0:t.name,cost:ee[e]??0}}).sort((e,t)=>t.cost-e.cost),[ee,T]),[xt,St]=(0,d.useState)(()=>new Set(Ee())),Ct=(0,d.useCallback)(e=>{St(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),De([...n]),n})},[]),[wt,Tt]=(0,d.useState)(()=>ke()),Et=(0,d.useCallback)(()=>{Tt(e=>{let t=!e;return I(t),t})},[]),[Dt,Ot]=(0,d.useState)(!1);(0,d.useEffect)(()=>{let e=!0;return Bi().then(t=>{e&&t!==void 0&&Ot(t)}),()=>{e=!1}},[]);let kt=(0,d.useCallback)(()=>{let e=!Dt;Ot(e),Vi(e).then(t=>{t||Ot(!e)})},[Dt]),At=bt(),[jt,Mt]=(0,d.useState)(!1),Ft=(0,d.useCallback)(()=>{jt||(Mt(!0),Gi().finally(()=>{Mt(!1)}))},[jt]),It=Ui,G=e=>dn(un(e,f),f),Lt=f===`usd`?`$`:f===`eur`?`€`:`¥`,Rt=g,zt=e=>fr(e,Rt),[Bt,Vt]=(0,d.useState)(``),[Ht,Ut]=(0,d.useState)(()=>Ce()),[Wt,Gt]=(0,d.useState)(()=>Date.now());(0,d.useEffect)(()=>{let e=setInterval(()=>{Gt(Date.now())},3e4);return()=>{clearInterval(e)}},[]);let Kt=l.some(e=>e.displayName===`Z.ai Coding Plan`&&e.status===`ok`),qt=D.leadMin*6e4,Jt=(e,n)=>e===0?t(`free`):fn(pn(e,n,f,At.rate),f===`usd`?`USD`:f===`eur`?`EUR`:`CNY`),Yt=(0,d.useMemo)(()=>rr([...v].reverse()),[v]),Xt={peak:e.byTier?.peak.cost??0,offPeak:e.byTier?.offPeak.cost??0},Zt=Xt.peak/2,Qt=Rr(P,K()),$t=e=>s.find(t=>Q(t.provider)===Q(e)),en=e=>e.balance?.error===`unconfigured`&&e.models.length>0&&e.models.every(e=>e.plan),nn=e=>{if(e===void 0)return(0,m.jsx)(`span`,{className:B.na,children:`—`});if(e.error===`unconfigured`)return t(`balanceUnconfigured`);if(e.error===`unauthorized`)return t(`balanceUnauthorized`);if(e.error===`unreachable`)return t(`balanceUnreachable`);if(e.totalBalance===void 0)return(0,m.jsx)(`span`,{className:B.na,children:`—`});let n=e.currency===`USD`?`$${e.totalBalance.toFixed(2)}`:G(e.totalBalance),r=e.currency===`USD`?e.totalBalance*At.rate:e.totalBalance,i=Qt>0?Math.floor(r/Qt):void 0;return(0,m.jsxs)(`span`,{className:B.balanceCell,children:[(0,m.jsx)(`span`,{children:n}),i!==void 0&&i>=0&&(0,m.jsx)(`button`,{type:`button`,className:y(B.balanceDaysBadge,i<=3&&B.balanceDaysBadgeLow),"data-testid":`billing-balance-days-badge`,title:t(`balanceDays`).replace(`{days}`,String(i)),"aria-label":`${e.displayName} ${t(`balanceDays`).replace(`{days}`,String(i))}`,onClick:t=>{t.stopPropagation(),st(ot===e.provider?void 0:e.provider)},children:`?`}),ot===e.provider&&(0,m.jsx)(oa,{balance:e,days:i??0,dailyBurn:Qt,money:G,t,onClose:()=>{st(void 0)}})]})},an=Object.keys(P).sort(),sn=K(),ln=P[sn]?.cost??0,hn=sn.slice(0,7),gn=sn.slice(0,4),_n=an.reduce((e,t)=>e+(t.startsWith(hn)?P[t]?.cost??0:0),0),bn=an.reduce((e,t)=>e+(t.startsWith(gn)?P[t]?.cost??0:0),0),J=(0,d.useMemo)(()=>Br(P,hn,sn)+l.reduce((e,t)=>e+(t.planType===`code`?t.subscriptionAmount??0:0),0),[P,hn,sn,l]),Tn=(0,d.useMemo)(()=>{if(!(x&&S>0))return null;let e=S-_n;return{over:e<=0,remainRatio:Math.max(0,Math.min(1,e/S)),remainCny:Math.max(0,e)}},[x,S,_n]),En=(0,d.useMemo)(()=>{let e=[];for(let t=Te-1;t>=0;--t){let n=new Date;n.setDate(n.getDate()-t),e.push(K(n.getTime()))}return e},[Te]),Dn=En.at(-1)??sn,On=(0,d.useMemo)(()=>Object.entries(P).map(([e,t])=>({date:e,value:R===`tokens`?Ur(t):t.cost})),[P,R]),An=(0,d.useMemo)(()=>On.reduce((e,t)=>e+t.value,0),[On]),jn=Vr(P),Y=Hr(P),Mn=(0,d.useMemo)(()=>En.map(t=>{let n={},r=e.byDayModels?.[t];if(r!==void 0)for(let[e,t]of Object.entries(r))t.cost>0&&(n[e]=t.cost);let i=P[t];return{date:t,cost:i?.cost??0,calls:i?.calls??0,byModel:n,tokens:i===void 0?0:Ur(i)}}),[En,P,e.byDayModels]),Nn=(0,d.useMemo)(()=>Object.entries(Se).filter(([,e])=>e.calls>0).map(([e,t])=>{let n=tn(e),r=n.key===`other`,i=r?ti(e):void 0,a={input:t.input,cacheHit:t.cacheHit,cacheMiss:t.cacheMiss,output:t.output};return{key:e,name:r?e:n.name,provider:i??n.provider,calls:t.calls,input:t.input,output:t.output,cacheHitRate:t.cacheHit+t.cacheMiss>0?t.cacheHit/(t.cacheHit+t.cacheMiss)*100:0,estimated:cn(n,a),plan:t.plan===!0,...t.cost>0?{actual:t.cost}:{},uncatalogued:r,estimatedPricing:n.estimated===!0,officialCalls:t.officialCalls??0,officialCost:t.officialCost??0}}).sort((e,t)=>(t.actual??t.estimated)-(e.actual??e.estimated)).map((e,t)=>({...e,color:jr[t%jr.length]??`#8b95a3`})),[Se]),Pn=(0,d.useMemo)(()=>N.hideUnidentified?u.filter(e=>e.kind!==`unknown`):u,[u,N.hideUnidentified]),X=(0,d.useMemo)(()=>{let n=e.byDayModelsSite;if(wt){let t=K();n={[t]:e.byDayModelsSite?.[t]??{}}}let r=new Map;for(let t of Object.values(n??{}))for(let[n,i]of Object.entries(t))for(let[t,a]of Object.entries(i)){let i=r.get(t);i===void 0&&(i=new Map,r.set(t,i));let o=i.get(n)??{calls:0,input:0,output:0,cacheHit:0,cacheMiss:0,cost:0,allPlan:!0};o.calls+=a.calls,o.input+=a.input,o.output+=a.output,o.cacheHit+=a.cacheHit,o.cacheMiss+=a.cacheMiss,o.cost+=a.cost,o.allPlan=o.allPlan&&(a.plan??e.byModel?.[n]?.plan===!0),i.set(n,o)}let i=new Map;for(let[e,t]of r){let n=!e.startsWith(`direct:`)&&!e.startsWith(`site:`),r=[...t.entries()].filter(([,e])=>e.calls>0).map(([e,t],r)=>{let i=tn(e),a=i.key===`other`,o=a?ti(e)??i.provider:i.provider;return{key:e,name:a?e:i.name,provider:o,color:jr[r%jr.length]??`#8b95a3`,calls:t.calls,input:t.input,output:t.output,cacheHitRate:t.cacheHit+t.cacheMiss>0?t.cacheHit/(t.cacheHit+t.cacheMiss)*100:0,estimated:n?0:cn(i,{input:t.input,cacheHit:t.cacheHit,cacheMiss:t.cacheMiss,output:t.output}),plan:t.allPlan,...t.cost>0?{actual:t.cost}:{},uncatalogued:a,estimatedPricing:i.estimated===!0,officialCalls:0,officialCost:0}}).sort((e,t)=>(t.actual??t.estimated)-(e.actual??e.estimated));r.length>0&&i.set(e,r)}let a=e=>_r(e,Rt)??t(`channelUnknown`),c=new Map,u=new Map,d=new Map,f=e=>e.startsWith(`direct:`)?`direct`:e.startsWith(`site:`)?`site`:`unknown`,p={direct:2,site:1,unknown:0,vendor:0};for(let[e,t]of i){let n=a(e),r=c.get(n);if(r===void 0)c.set(n,[...t]),u.set(n,f(e)),d.set(n,e);else{r.push(...t),r.sort((e,t)=>(t.actual??t.estimated)-(e.actual??e.estimated));let i=u.get(n)??`unknown`,a=f(e);p[a]>p[i]&&(u.set(n,a),d.set(n,e))}}let m=new Map,h=new Map;for(let e of l){if(e.status===`not-configured`)continue;let t=e.displayName??ri(e.provider),n=a(`direct:${e.provider}`),r=c.has(t)?t:c.has(n)?n:void 0,i=r??`sub:${ri(e.provider)}`;h.set(i,r??ri(e.provider));let o=m.get(i);o===void 0?m.set(i,[e]):o.push(e)}let g=e=>e===a(`direct:deepseek`)||e===a(`site:https://api.deepseek.com`)?$t(`deepseek`)??$t(e):$t(e),_=[];for(let[e,t]of c)_.push({id:`ch:${d.get(e)??e}`,name:e,models:t,subscriptions:m.get(e)??[],balance:g(e),dot:Oi(o,t[0]?.provider??``),channelKind:u.get(e)??`unknown`});for(let[e,t]of h)c.has(e)||_.push({id:e,name:t,models:[],subscriptions:m.get(e)??[],balance:$t(t),dot:Oi(o,t),channelKind:`vendor`});let v=new Set(_.flatMap(e=>[Q(e.name),...e.balance===void 0?[]:[Q(e.balance.provider)]]));for(let e of s)v.has(Q(e.provider))||(e.error===void 0||e.provider.startsWith(`custom:`))&&_.push({id:`bal:${e.provider}`,name:e.displayName,models:[],subscriptions:[],balance:e,dot:Oi(o,e.displayName),channelKind:`vendor`});return _.filter(e=>N.hideUnidentified&&e.channelKind===`unknown`?!1:!wt||e.models.length>0).sort((e,t)=>{let n=Ni(t)-Ni(e);return n===0?e.models.length===0&&t.models.length===0?0:t.models.length===0?-1:e.models.length===0?1:e.name.localeCompare(t.name,`zh`):n})},[e.byDayModelsSite,e.byModel,l,s,o,Rt,t,wt,N.hideUnidentified]),In=(0,d.useMemo)(()=>X.filter(e=>e.models.length>0||e.subscriptions.length>0).map(e=>e.id),[X]),Ln=In.length>0&&In.every(e=>xt.has(e)),Rn=()=>{let e=new Set(Ln?[]:In);St(e),De([...e])},zn=(0,m.jsx)(`thead`,{children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{children:t(`model`)}),(0,m.jsx)(`th`,{className:B.numCol,children:t(`calls`)}),(0,m.jsx)(`th`,{className:B.numCol,children:t(`inputTokens`)}),(0,m.jsx)(`th`,{className:B.numCol,children:t(`outputTokens`)}),(0,m.jsx)(`th`,{className:B.numCol,children:t(`cacheHitRate`)}),(0,m.jsx)(`th`,{className:B.numCol,children:t(`actual`)})]})}),Bn=e=>(0,m.jsx)(`span`,{className:B.modelCell,children:(0,m.jsxs)(`span`,{children:[(0,m.jsxs)(`span`,{className:B.modelName,children:[e.name,e.uncatalogued&&(0,m.jsx)(`span`,{className:B.uncataloguedTag,"data-testid":`billing-uncatalogued-tag`,children:t(`uncatalogued`)}),e.estimatedPricing&&(0,m.jsx)(`span`,{className:B.estimatedTag,"data-testid":`billing-estimated-tag`,children:t(`estimatedPricing`)})]}),(0,m.jsx)(`span`,{className:B.modelProvider,children:zt(e.provider)})]})}),Hn=e.bySite?.unknown?.calls??0,Un=Nn.reduce((e,t)=>e+t.estimated,0),Gn=xe.cost>0||Hn>0?xe.cost:Un,Z=(0,d.useMemo)(()=>{if(U===`all`){let e,t=0;for(let[n,r]of Object.entries(P)){let i=Ur(r);i>t&&(t=i,e=n)}return{cost:Gn,calls:xe.calls,input:xe.input,output:xe.output,cacheHit:xe.cacheHit,cacheMiss:xe.cacheMiss,cacheWrite:xe.cacheWrite??0,reasoning:xe.reasoning??0,peakDay:e,peakTokens:t}}return U===`custom`?qr(P,W.start,W.end):Kr(P,K(),U)},[U,W,Gn,xe,P]),Kn=U===`custom`?W.start===W.end?W.start:`${W.start} – ${W.end}`:t({today:`avgRangeToday`,"7d":`avgRange7d`,week:`avgRangeWeek`,month:`avgRangeMonth`,all:`avgRangeAll`}[U]),Jn=(0,d.useMemo)(()=>Nn.map(e=>({key:e.key,name:e.name,color:e.color})),[Nn]),Yn=Mn.length>=2?Mn.at(-2)?.cost??0:0,Xn=Yn>0?(ln-Yn)/Yn*100:0,Zn=(0,m.jsxs)(`div`,{ref:pe,className:y(B.dashboard,r&&B.nativeSettingsDashboard),"data-testid":r?`native-billing-settings-dashboard`:`billing-dashboard`,children:[!r&&(0,m.jsxs)(`div`,{className:B.dashboardHead,"data-testid":`billing-dashboard-head`,children:[(0,m.jsxs)(`div`,{children:[b(`billing.dashboard.decor`,{position:`head`}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h2`,{className:B.dashboardTitle,children:t(`title`)}),b(`billing.dashboard.decor`,{position:`headTitle`})]}),(0,m.jsxs)(`p`,{className:B.dashboardSubtitle,children:[t(`lastUpdated`),` `,Dn,e.timezone===void 0?null:` · ${e.timezone.name} (${e.timezone.offset})`]})]}),(0,m.jsxs)(`div`,{className:B.dashboardRight,children:[(0,m.jsx)(`span`,{className:B.currencyToggle,role:`group`,"aria-label":t(`language`),children:[`en`,`zh`].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(B.currencyButton,g===e&&B.currencyButtonActive),"aria-pressed":g===e,"data-testid":`billing-language-${e}`,onClick:()=>{_(e)},children:e===`en`?`EN`:`中`},e))}),(0,m.jsx)(`span`,{className:B.currencyToggle,role:`group`,"aria-label":t(`currency`),children:[`cny`,`usd`,`eur`].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(B.currencyButton,f===e&&B.currencyButtonActive),"aria-pressed":f===e,"data-testid":`billing-currency-${e}`,title:t(e===`cny`?`currencyCny`:e===`usd`?`currencyUsd`:`currencyEur`),onClick:()=>{h(e)},children:e===`cny`?`¥ CNY`:e===`usd`?`$ USD`:`€ EUR`},e))}),o.checked&&(0,m.jsxs)(`span`,{className:y(B.healthBadge,o.available?B.healthBadgeOk:B.healthBadgeBad),children:[(0,m.jsx)(`span`,{className:y(B.healthDot,o.available?B.healthOk:B.healthBad),role:`img`,"aria-label":o.available?t(`healthDotLive`):t(`healthDotFailed`),title:o.available?t(`healthDotLive`):t(`healthDotFailed`)}),o.available?`${t(`healthModelsLive`).replace(`{n}`,String(o.models))}${o.failures>0?` · ${t(`healthVendorsDown`).replace(`{n}`,String(o.failures))}`:``}`:t(`healthVendorsUnavailable`).replace(`{n}`,String(o.failures))]}),(0,m.jsx)(`button`,{type:`button`,className:B.closeButton,"aria-label":t(`close`),"data-testid":`billing-close`,onClick:n,children:(0,m.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"aria-hidden":`true`,children:[(0,m.jsx)(`path`,{d:`M18 6 6 18`}),(0,m.jsx)(`path`,{d:`m6 6 12 12`})]})})]})]}),!r&&e.staleSnapshot===!0&&(0,m.jsx)(`div`,{className:B.staleNotice,"data-testid":`billing-stale-snapshot`,children:t(`staleSnapshotNotice`)}),!r&&(0,m.jsx)(`nav`,{className:B.tabNav,"data-testid":`billing-tab-nav`,role:`tablist`,"aria-label":t(`title`),children:Nr.map(e=>(0,m.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":F===e.id,"aria-controls":`billing-tab-panel-${e.id}`,className:y(B.tabButton,F===e.id&&B.tabButtonActive),"data-testid":`billing-tab-${e.id}`,onClick:()=>{we(e.id)},children:[(0,m.jsx)(`span`,{className:B.tabRailIcon,"aria-hidden":`true`,children:Fr[e.id]}),(0,m.jsx)(`span`,{className:B.tabNavLabel,children:t(e.labelKey)})]},e.id))}),(0,m.jsxs)(`div`,{className:y(B.dashboardBody,r&&B.nativeSettingsBody),children:[F===`queue`&&(0,m.jsx)(ta,{t,language:g,navigateToSession:fe}),F===`overview`&&(0,m.jsxs)(`div`,{className:B.tabPanel,"data-testid":`billing-tab-panel-overview`,children:[c?.kind===`drift`&&c.spent!==void 0&&Ae!==Me()&&(0,m.jsxs)(`div`,{className:B.reconcileNotice,"data-testid":`billing-reconcile-notice`,role:`note`,children:[(0,m.jsx)(`span`,{className:B.reconcileIcon,"aria-hidden":`true`,children:(0,m.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,m.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,m.jsx)(`line`,{x1:`12`,y1:`10`,x2:`12`,y2:`16`}),(0,m.jsx)(`line`,{x1:`12`,y1:`7.5`,x2:`12.01`,y2:`7.5`})]})}),(0,m.jsx)(`span`,{className:B.reconcileText,children:t(`reconcileDrift`).replace(`{provider}`,c.provider??``).replace(`{spent}`,G(c.spent)).replace(`{today}`,G(c.todayOfficialCost??0))}),(0,m.jsx)(`button`,{type:`button`,className:B.reconcileDismiss,"data-testid":`billing-reconcile-dismiss`,onClick:Ne,children:t(`reconcileDismiss`)})]}),de===!0&&(0,m.jsx)(`div`,{className:B.staleNotice,"data-testid":`billing-balance-stale`,children:t(`balanceStaleNotice`)}),(0,m.jsxs)(`section`,{className:B.hero,"data-testid":`billing-hero`,children:[b(`billing.dashboard.decor`,{position:`hero`}),(0,m.jsxs)(`div`,{className:B.heroTop,children:[(0,m.jsxs)(`div`,{className:B.heroMain,children:[(0,m.jsx)(`span`,{className:B.heroLabel,"data-testid":`billing-hero-range-label`,children:Kn}),(0,m.jsxs)(`div`,{className:B.heroReadout,children:[(0,m.jsx)(`span`,{className:B.heroCurrency,"aria-hidden":`true`,children:Lt}),(0,m.jsx)(`span`,{className:B.heroValue,"data-testid":`billing-hero-range-value`,children:G(Z.cost).slice(1)})]}),(0,m.jsxs)(`span`,{className:B.heroMeta,children:[Z.calls.toLocaleString(),` `,t(`calls`),U===`month`&&J>0&&(0,m.jsxs)(`span`,{className:B.heroPred,children:[` `,t(`monthProjected`),` `,G(J)]})]})]}),Tn!==null&&(0,m.jsxs)(`div`,{className:B.heroGauge,"data-testid":`billing-hero-gauge`,children:[(0,m.jsxs)(`div`,{className:B.heroGaugeDial,children:[(0,m.jsxs)(`svg`,{className:B.heroGaugeSvg,viewBox:`0 0 120 120`,"aria-hidden":`true`,children:[(0,m.jsx)(`defs`,{children:(0,m.jsxs)(`linearGradient`,{id:`heroRingGrad`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`100%`,children:[(0,m.jsx)(`stop`,{offset:`0%`,stopColor:`var(--ds-cyan)`}),(0,m.jsx)(`stop`,{offset:`55%`,stopColor:`var(--ds-blue)`}),(0,m.jsx)(`stop`,{offset:`100%`,stopColor:`var(--ds-amber)`})]})}),(0,m.jsx)(`circle`,{className:B.heroGaugeTrack,cx:`60`,cy:`60`,r:`52`}),(0,m.jsx)(`circle`,{className:y(B.heroGaugeArc,Tn.over&&B.heroGaugeArcOver),cx:`60`,cy:`60`,r:`52`,style:{strokeDasharray:`${Tn.remainRatio*326.7} 326.7`},stroke:Tn.over?void 0:`url(#heroRingGrad)`})]}),(0,m.jsxs)(`span`,{className:B.heroGaugeCenter,children:[(0,m.jsxs)(`span`,{className:y(B.heroGaugeRemain,Tn.over&&B.heroGaugeRemainOver),children:[Lt,un(Tn.remainCny,f).toFixed(2)]}),(0,m.jsx)(`span`,{className:B.heroGaugeLabel,children:t(`budgetRemain`)})]})]}),(0,m.jsxs)(`span`,{className:B.heroGaugeSub,children:[G(_n),` / `,G(S)]})]})]}),(0,m.jsxs)(`div`,{className:B.heroSide,children:[(0,m.jsxs)(`div`,{className:B.heroSideItem,children:[(0,m.jsx)(`span`,{className:B.heroSideLabel,children:t(`yearCost`)}),(0,m.jsx)(`span`,{className:B.heroSideValue,children:G(bn)})]}),(0,m.jsxs)(`div`,{className:B.heroSideItem,children:[(0,m.jsx)(`span`,{className:B.heroSideLabel,children:t(`todayCost`)}),(0,m.jsxs)(`span`,{className:B.heroSideValue,children:[G(ln),(0,m.jsxs)(`span`,{className:y(B.delta,Xn>=0?B.deltaUp:B.deltaDown),children:[Xn>=0?`▲`:`▼`,` `,Math.abs(Xn).toFixed(1),`%`]})]})]}),J>0&&(0,m.jsxs)(`div`,{className:B.heroSideItem,title:t(`monthProjectedHint`),children:[(0,m.jsx)(`span`,{className:B.heroSideLabel,children:t(`monthProjected`)}),(0,m.jsx)(`span`,{className:B.heroSideValue,children:G(J)})]}),J<=0&&(0,m.jsx)(`span`,{className:B.heroSideSpacer,"aria-hidden":`true`})]})]}),(e.unpricedModels?.length??0)>0&&!Pe.has(`unpriced`)&&(0,m.jsxs)(`div`,{className:B.unpricedHint,"data-testid":`billing-unpriced-hint`,children:[(0,m.jsx)(`span`,{className:B.unpricedHintBody,children:t(`unpricedHint`).replace(`{count}`,String(e.unpricedModels?.length??0))}),(0,m.jsx)(`button`,{type:`button`,className:B.noticeDismiss,"data-testid":`billing-unpriced-dismiss`,"aria-label":t(`close`),onClick:()=>{Ie(`unpriced`)},children:`×`})]}),(e.total.searchCalls??0)>0&&!Pe.has(`search-estimate`)&&(0,m.jsxs)(`div`,{className:B.unpricedHint,"data-testid":`billing-search-estimate-hint`,children:[(0,m.jsx)(`span`,{className:B.unpricedHintBody,children:t(`searchEstimateHint`).replace(`{count}`,String(e.total.searchCalls??0)).replace(`{each}`,G(e.searchCallEstimateCny??0))}),(0,m.jsx)(`button`,{type:`button`,className:B.noticeDismiss,"data-testid":`billing-search-estimate-dismiss`,"aria-label":t(`close`),onClick:()=>{Ie(`search-estimate`)},children:`×`})]}),(e.unreadableSessions??0)>0&&!Pe.has(`unreadable`)&&(0,m.jsxs)(`div`,{className:B.staleNotice,"data-testid":`billing-sessions-unreadable`,children:[(0,m.jsxs)(`div`,{className:B.staleNoticeBody,children:[t(`unreadableNotice`).replace(`{count}`,String(e.unreadableSessions)),(e.unreadableNoLedgerSessions??0)>0&&(0,m.jsx)(`div`,{className:B.staleNoticeSub,"data-testid":`billing-sessions-no-ledger`,children:t(`unreadableNoLedgerNotice`).replace(`{count}`,String(e.unreadableNoLedgerSessions))}),(e.unreadableFormatSessions??0)>0&&(0,m.jsx)(`div`,{className:B.staleNoticeSub,"data-testid":`billing-sessions-format-unsupported`,children:t(`unreadableFormatNotice`).replace(`{count}`,String(e.unreadableFormatSessions))})]}),(0,m.jsx)(`button`,{type:`button`,className:B.noticeDismiss,"data-testid":`billing-unreadable-dismiss`,"aria-label":t(`close`),onClick:()=>{Ie(`unreadable`)},children:`×`})]}),(0,m.jsxs)(`div`,{className:B.kpiZone,children:[(0,m.jsxs)(`div`,{className:B.kpiZoneHead,children:[(0,m.jsx)(`span`,{className:B.kpiZoneLabel,children:t(`kpiRange`)}),(0,m.jsx)(`div`,{className:B.heatmapRangeSwitch,"data-testid":`billing-kpi-range`,role:`group`,"aria-label":t(`kpiRange`),children:[[`today`,`avgRangeToday`],[`7d`,`avgRange7d`],[`week`,`avgRangeWeek`],[`month`,`avgRangeMonth`],[`all`,`avgRangeAll`],[`custom`,`avgRangeCustom`]].map(([e,n])=>(0,m.jsx)(`button`,{type:`button`,className:y(B.heatmapRangeButton,U===e&&B.heatmapRangeButtonActive),"data-testid":`billing-kpi-range-${e}`,"aria-pressed":U===e,onClick:()=>{nt(e),ae(e)},children:t(n)},e))})]}),U===`custom`&&(0,m.jsxs)(`div`,{className:B.kpiCustomRange,"data-testid":`billing-kpi-custom-range`,children:[(0,m.jsxs)(`label`,{children:[t(`customRangeStart`),(0,m.jsx)(`input`,{type:`date`,value:W.start,max:K(),"data-testid":`billing-kpi-custom-start`,onChange:e=>{it({start:e.target.value})}})]}),(0,m.jsxs)(`label`,{children:[t(`customRangeEnd`),(0,m.jsx)(`input`,{type:`date`,value:W.end,max:K(),"data-testid":`billing-kpi-custom-end`,onChange:e=>{it({end:e.target.value})}})]})]}),(0,m.jsx)(`section`,{className:B.kpiGrid,"data-testid":`billing-kpi-grid`,children:(()=>{let e=Object.keys(P).sort().slice(-7),n=K(),r=e.indexOf(n),i=(e,t)=>e[t]??0,a=e.map(e=>P[e]?.cost??0),o=e.map(e=>P[e]?.calls??0),s=e.map(e=>{let t=P[e];return t===void 0?0:Ur(t)}),c=e.map(e=>{let t=P[e];return t!==void 0&&t.cacheHit+t.cacheMiss>0?t.cacheHit/(t.cacheHit+t.cacheMiss)*100:0}),l=r>0&&i(a,r-1)>0?(i(a,r)-i(a,r-1))/i(a,r-1)*100:0,u=r>0&&i(o,r-1)>0?(i(o,r)-i(o,r-1))/i(o,r-1)*100:0,d=r>0&&i(s,r-1)>0?(i(s,r)-i(s,r-1))/i(s,r-1)*100:0,f=r>0&&i(c,r-1)>0?i(c,r)-i(c,r-1):0,h=(e,t)=>U===`custom`?null:(0,m.jsx)(`svg`,{viewBox:`0 0 28 12`,preserveAspectRatio:`none`,style:{display:`block`,width:`100%`,height:`12px`},children:e.map((n,r)=>{let i=n/Math.max(...e,1)*10,a=r*4;return(0,m.jsx)(`rect`,{x:a,y:12-i,width:`2.5`,height:i,fill:t,opacity:r===e.length-1?1:.6},r)})}),g=e=>U===`custom`?null:(0,m.jsxs)(`span`,{className:y(B.kpiDelta,e>0?B.kpiDeltaUp:e<0?B.kpiDeltaDown:B.kpiDeltaFlat),children:[e>0?`▲`:e<0?`▼`:``,` `,Math.abs(e).toFixed(1),`%`]});return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:B.kpiTile,"data-testid":`billing-kpi-tile`,children:[(0,m.jsxs)(`div`,{className:B.kpiLabelRow,children:[(0,m.jsx)(p.Tooltip,{label:t(`kpiDescCacheHit`),side:`top`,maxWidth:280,children:(0,m.jsx)(`span`,{className:B.kpiLabel,children:t(`cacheHitRate`)})}),g(f)]}),(0,m.jsx)(`span`,{className:y(B.kpiValue,B.kpiGreen),children:mn(Z.cacheHit+Z.cacheMiss>0?Z.cacheHit/(Z.cacheHit+Z.cacheMiss)*100:0)}),(0,m.jsx)(`div`,{className:B.kpiSpark,children:h(c,`var(--ds-cyan)`)}),(0,m.jsxs)(`span`,{className:B.kpiDetail,children:[q(Z.cacheHit),` / `,q(Z.cacheHit+Z.cacheMiss),Z.cacheWrite>0?` · ${t(`tokenCacheWrite`)} ${q(Z.cacheWrite)}`:``]})]}),(0,m.jsxs)(`div`,{className:B.kpiTile,children:[(0,m.jsxs)(`div`,{className:B.kpiLabelRow,children:[(0,m.jsx)(p.Tooltip,{label:t(`kpiDescTokens`),side:`top`,maxWidth:280,children:(0,m.jsx)(`span`,{className:B.kpiLabel,children:t(`tokens`)})}),g(d)]}),(0,m.jsx)(`span`,{className:B.kpiValue,children:q(Z.input+Z.output)}),(0,m.jsx)(`div`,{className:B.kpiSpark,children:h(s,`var(--ds-blue)`)}),(0,m.jsxs)(`span`,{className:B.kpiDetail,children:[t(`inputTokens`),` `,q(Z.input),` · `,t(`outputTokens`),` `,q(Z.output)]})]}),(0,m.jsxs)(`div`,{className:B.kpiTile,"data-testid":`billing-kpi-avg`,children:[(0,m.jsxs)(`div`,{className:B.kpiLabelRow,children:[(0,m.jsx)(p.Tooltip,{label:t(`kpiDescAvgCost`),side:`top`,maxWidth:280,children:(0,m.jsx)(`span`,{className:B.kpiLabel,children:t(`avgCost`)})}),g(l)]}),(0,m.jsx)(`span`,{className:B.kpiValue,children:G(Z.calls>0?Z.cost/Z.calls:0)}),(0,m.jsx)(`div`,{className:B.kpiSpark,children:h(a,`var(--ds-blue)`)}),(0,m.jsxs)(`span`,{className:B.kpiDetail,children:[t(`calls`),` `,Z.calls.toLocaleString()]})]}),(0,m.jsxs)(`div`,{className:B.kpiTile,children:[(0,m.jsxs)(`div`,{className:B.kpiLabelRow,children:[(0,m.jsx)(p.Tooltip,{label:t(`kpiDescCalls`),side:`top`,maxWidth:280,children:(0,m.jsx)(`span`,{className:B.kpiLabel,children:t(`calls`)})}),g(u)]}),(0,m.jsx)(`span`,{className:B.kpiValue,children:Z.calls.toLocaleString()}),(0,m.jsx)(`div`,{className:B.kpiSpark,children:h(o,`var(--ds-blue)`)}),(0,m.jsxs)(`span`,{className:B.kpiDetail,children:[Nn.length,` `,t(`models`)]})]}),(0,m.jsxs)(`div`,{className:B.kpiTile,"data-testid":`billing-kpi-think`,children:[(0,m.jsx)(`div`,{className:B.kpiLabelRow,children:(0,m.jsx)(p.Tooltip,{label:t(`kpiDescReasoning`),side:`top`,maxWidth:280,children:(0,m.jsx)(`span`,{className:B.kpiLabel,children:t(`tokenReasoningShare`)})})}),(0,m.jsx)(`span`,{className:y(B.kpiValue,B.kpiGreen),children:mn(Z.output>0?Z.reasoning/Z.output*100:0)}),(0,m.jsx)(`span`,{className:B.kpiDetail,children:q(Z.reasoning)})]}),(0,m.jsxs)(`div`,{className:B.kpiTile,"data-testid":`billing-kpi-io`,children:[(0,m.jsx)(`div`,{className:B.kpiLabelRow,children:(0,m.jsx)(p.Tooltip,{label:t(`kpiDescIo`),side:`top`,maxWidth:280,children:(0,m.jsx)(`span`,{className:B.kpiLabel,children:t(`tokenIo`)})})}),(0,m.jsx)(`span`,{className:B.kpiValue,children:(Z.output>0?Z.input/Z.output:0).toFixed(2)}),(0,m.jsxs)(`span`,{className:B.kpiDetail,children:[q(Z.input),` / `,q(Z.output)]})]}),(0,m.jsxs)(`div`,{className:B.kpiTile,"data-testid":`billing-kpi-peak`,children:[(0,m.jsx)(`div`,{className:B.kpiLabelRow,children:(0,m.jsx)(p.Tooltip,{label:t(`kpiDescPeak`),side:`top`,maxWidth:280,children:(0,m.jsx)(`span`,{className:B.kpiLabel,children:t(`tokenPeak`)})})}),(0,m.jsx)(`span`,{className:B.kpiValue,children:Z.peakTokens>0?wn(Z.peakTokens):`—`}),(0,m.jsx)(`span`,{className:B.kpiDetail,children:Z.peakDay??`—`})]})]})})()})]}),(0,m.jsxs)(`section`,{className:B.panel,"data-testid":`billing-panel-heatmap`,children:[(0,m.jsxs)(`div`,{className:B.panelHead,children:[(0,m.jsx)(`h3`,{className:B.panelTitle,children:t(`heatmap`)}),(0,m.jsx)(`div`,{className:B.heatmapRangeSwitch,"data-testid":`billing-heatmap-metric`,role:`group`,"aria-label":t(`heatmap`),children:[`cost`,`tokens`].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(B.heatmapRangeButton,R===e&&B.heatmapRangeButtonActive),"data-testid":`billing-heatmap-metric-${e}`,"aria-pressed":R===e,onClick:()=>{ze(e)},children:t(e===`cost`?`metricCost`:`metricTokens`)},e))}),(0,m.jsx)(`div`,{className:B.heatmapRangeSwitch,"data-testid":`billing-heatmap-range`,role:`group`,"aria-label":t(`heatmap`),children:[`month`,`half`,`year`].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(B.heatmapRangeButton,Le===e&&B.heatmapRangeButtonActive),"data-testid":`billing-heatmap-range-${e}`,"aria-pressed":Le===e,onClick:()=>{Re(e)},children:t(e===`month`?`heatmapMonth`:e===`half`?`heatmapHalf`:`heatmapYear`)},e))}),(0,m.jsxs)(`span`,{className:B.panelHint,"data-testid":`billing-heatmap-summary`,children:[t(`heatmapTotal`),` `,R===`tokens`?q(An):G(An),` · `,t(`activeDays`),` `,jn,` · `,t(`streakDays`),` `,Y]})]}),(0,m.jsx)($n,{days:On,currency:f,t,range:Le,unit:R})]})]}),F===`agents`&&(0,m.jsxs)(`div`,{className:B.tabPanel,"data-testid":`billing-tab-panel-agents`,children:[(0,m.jsxs)(`section`,{className:B.agentSummary,"data-testid":`billing-agent-summary`,children:[(0,m.jsxs)(`span`,{className:B.agentSummaryItem,children:[(0,m.jsx)(`span`,{className:B.agentSummaryValue,children:String(he.agents)}),(0,m.jsx)(`span`,{className:B.agentSummaryLabel,children:t(`agentsCount`)})]}),(0,m.jsxs)(`span`,{className:B.agentSummaryItem,children:[(0,m.jsx)(`span`,{className:B.agentSummaryValue,children:String(he.delegations)}),(0,m.jsx)(`span`,{className:B.agentSummaryLabel,children:t(`agentsDelegations`)})]}),(0,m.jsxs)(`span`,{className:B.agentSummaryItem,children:[(0,m.jsx)(`span`,{className:B.agentSummaryValue,children:String(he.roots)}),(0,m.jsx)(`span`,{className:B.agentSummaryLabel,children:t(`agentsRoots`)})]}),he.costliest!==void 0&&he.costliest.chainCost>0&&(0,m.jsxs)(`span`,{className:B.agentSummaryItem,children:[(0,m.jsx)(`span`,{className:B.agentSummaryValue,children:G(he.costliest.chainCost)}),(0,m.jsx)(`span`,{className:B.agentSummaryLabel,children:t(`agentsMostExpensive`)})]})]}),me.length===0||he.delegations===0?(0,m.jsx)(`p`,{className:B.contextEmpty,"data-testid":`billing-agents-empty`,children:t(`agentsNoData`)}):(0,m.jsx)(`div`,{className:B.agentTree,"data-testid":`billing-agent-tree`,children:(()=>{let e=n=>(0,m.jsxs)(`div`,{className:B.agentNode,children:[(0,m.jsxs)(`div`,{className:B.agentRow,style:{paddingLeft:`${String(n.depth*16)}px`},children:[(0,m.jsx)(`span`,{className:B.agentKind,children:n.depth===0?t(`agentsRoot`):t(`agentsSubagent`)}),(0,m.jsx)(`span`,{className:B.agentTitle,children:n.title??`${t(`sessionUntitled`)} · ${n.id.slice(0,8)}`}),(0,m.jsx)(`span`,{className:B.agentCalls,children:n.calls.toLocaleString()}),(0,m.jsx)(`span`,{className:B.agentCost,children:G(n.cost)}),n.children.length>0&&(0,m.jsxs)(`span`,{className:y(B.ubTag,B.ubTagNeutral),"data-testid":`billing-agent-chain`,children:[t(`agentsChainTotal`),` `,G(n.chainCost)]})]}),n.children.map(e)]},n.id);return me.map(e)})()})]}),F===`settings`&&(0,m.jsx)(`div`,{className:B.tabPanel,"data-testid":`billing-tab-panel-settings`,children:(0,m.jsxs)(`div`,{className:y(B.settingsLayout,r&&B.nativeSettingsLayout),children:[!r&&(0,m.jsx)(`aside`,{className:B.settingsNav,"data-testid":`billing-settings-nav`,role:`navigation`,"aria-label":`settings`,children:[{id:`display-pref`,icon:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:[(0,m.jsx)(`path`,{d:`M5 3v10M11 3v10`}),(0,m.jsx)(`circle`,{cx:`5`,cy:`6.5`,r:`1.8`}),(0,m.jsx)(`circle`,{cx:`11`,cy:`9.5`,r:`1.8`})]}),label:t(`settingsNavDisplayPref`)},{id:`budget`,icon:(0,m.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:(0,m.jsx)(`path`,{d:`M5 3l3 4 3-4M8 7v6M5.5 9.5h5M5.5 12h5`})}),label:t(`settingsNavBudget`)},{id:`alert`,icon:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,m.jsx)(`path`,{d:`M8 2a4 4 0 0 1 4 4v3l1.5 2.5h-11L4 9V6a4 4 0 0 1 4-4z`}),(0,m.jsx)(`path`,{d:`M6.5 13.5a1.5 1.5 0 0 0 3 0`})]}),label:t(`settingsNavAlert`)},{id:`display`,icon:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,stroke:`currentColor`,strokeWidth:`1.5`,children:[(0,m.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`}),(0,m.jsx)(`path`,{d:`M8 2a6 6 0 0 1 0 12z`,fill:`currentColor`,stroke:`none`})]}),label:t(`settingsNavDisplay`)},{id:`advanced`,icon:(0,m.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:(0,m.jsx)(`path`,{d:`M8 2v12M2.8 5l10.4 6M13.2 5L2.8 11`})}),label:t(`settingsNavAdvanced`),advanced:!0},{id:`about`,icon:(0,m.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,children:[(0,m.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`}),(0,m.jsx)(`path`,{d:`M8 7.5V11`}),(0,m.jsx)(`circle`,{cx:`8`,cy:`5.2`,r:`0.9`,fill:`currentColor`,stroke:`none`})]}),label:t(`settingsNavAbout`)}].map(e=>(0,m.jsxs)(`button`,{type:`button`,className:y(B.settingsNavItem,Ye===e.id&&B.settingsNavItemActive,e.advanced&&B.settingsNavItemAdvanced),"data-testid":`billing-settings-nav-${e.id}`,onClick:()=>{Qe(e.id)},children:[(0,m.jsx)(`span`,{className:B.settingsNavIcon,"aria-hidden":`true`,children:e.icon}),e.label]},e.id))}),(0,m.jsxs)(`div`,{className:B.settingsPane,children:[(0,m.jsx)(`input`,{className:y(B.ubSearch,B.settingsSearch),type:`search`,value:Ze,placeholder:t(`settingsSearchPlaceholder`),"aria-label":t(`settingsSearchPlaceholder`),"data-testid":`billing-settings-search`,onChange:e=>{V(e.target.value)}}),Ze.trim()!==``&&fa(Ze)&&(0,m.jsx)(`p`,{className:B.setCardDesc,"data-testid":`billing-settings-search-empty`,children:t(`settingsSearchEmpty`).replace(`{query}`,Ze.trim())}),(0,m.jsxs)(`div`,{hidden:H(da.display),className:B.setCard,id:`settings-display-pref`,"data-testid":`billing-density-motion-card`,children:[(0,m.jsx)(`div`,{className:B.setCardHead,children:(0,m.jsx)(`div`,{className:B.setCardMeta,children:(0,m.jsx)(`h3`,{className:B.setCardTitle,children:t(`settingsSectionDisplay`)})})}),(0,m.jsxs)(`div`,{className:B.densityRow,children:[(0,m.jsxs)(`div`,{className:B.densityLeft,children:[(0,m.jsx)(`strong`,{children:t(`densityLabel`)}),(0,m.jsx)(`span`,{children:t(`densityHint`)})]}),(0,m.jsx)(`div`,{className:B.densityButtons,"data-testid":`billing-density-buttons`,children:[`compact`,`default`,`comfortable`].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(B.densityButton,He===e&&B.densityButtonActive,e===`comfortable`&&B.densityButtonComfortable),"data-testid":`billing-density-${e}`,onClick:()=>{$e(e)},children:t(e===`compact`?`densityCompact`:e==="default"?`densityDefault`:`densityComfortable`)},e))})]}),(0,m.jsxs)(`div`,{className:B.densityRow,children:[(0,m.jsxs)(`div`,{className:B.densityLeft,children:[(0,m.jsx)(`strong`,{children:t(`motionLabel`)}),(0,m.jsx)(`span`,{children:t(`motionHint`)})]}),(0,m.jsx)(`div`,{className:B.densityButtons,"data-testid":`billing-motion-buttons`,children:[`off`,`subtle`,`rich`].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(B.densityButton,qe===e&&B.densityButtonActive),"data-testid":`billing-motion-${e}`,onClick:()=>{et(e)},children:t(e===`off`?`motionOff`:e===`subtle`?`motionSubtle`:`motionRich`)},e))})]})]}),(0,m.jsxs)(`section`,{hidden:H(da.budget),className:B.setCard,"data-testid":`billing-budget`,id:`settings-budget`,children:[(0,m.jsxs)(`div`,{className:B.setCardHead,children:[(0,m.jsx)(`div`,{className:B.setCardMeta,children:(0,m.jsxs)(`h3`,{className:B.setCardTitle,children:[t(`budget`),(0,m.jsx)(ra,{label:t(`budgetHint`),t})]})}),(0,m.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":x,"aria-label":t(`budget`),"data-testid":`billing-budget-toggle`,className:y(B.switch,x&&B.switchOn),onClick:C,children:(0,m.jsx)(`span`,{className:B.switchKnob})})]}),x&&(0,m.jsxs)(`div`,{className:B.ctlCol,children:[(0,m.jsxs)(`div`,{className:B.ctlRow,children:[(0,m.jsx)(`span`,{className:B.ctlLabel,children:t(`budgetAmount`)}),(0,m.jsxs)(`span`,{className:B.inp,"data-testid":`billing-budget-input-wrap`,children:[(0,m.jsx)(`span`,{className:B.affix,"aria-hidden":`true`,children:`¥`}),(0,m.jsx)(`input`,{className:B.budgetInput,"data-testid":`billing-budget-input`,type:`number`,min:0,step:1,value:S===0?``:S,placeholder:e.budget===void 0?`0`:String(e.budget),"aria-label":`${t(`budget`)}(${f===`usd`?`USD`:f===`eur`?`EUR`:`CNY`})`,title:`${t(`budget`)}(${f===`usd`?`USD`:f===`eur`?`EUR`:`CNY`})`,onChange:e=>{w(e.target.valueAsNumber)}})]})]}),S>0&&(()=>{let e=_n/S*100;return(0,m.jsx)(`div`,{className:B.ctlRowStretch,children:(0,m.jsx)(`div`,{className:B.prog,role:`progressbar`,"aria-valuenow":Math.min(e,100),"aria-valuemin":0,"aria-valuemax":100,"aria-label":t(`budget`),"data-testid":`billing-budget-track`,children:(0,m.jsx)(`div`,{className:y(B.progFill,e>=100&&B.budgetFillOver,e>=80&&e<100&&B.budgetFillWarn),style:{width:`${Math.min(e,100)}%`}})})})})(),S>0&&(0,m.jsx)(`p`,{className:B.setCardDesc,"data-testid":`billing-budget-value`,children:t(`budgetSummary`).replace(`{used}`,G(_n)).replace(`{total}`,G(S))})]}),(0,m.jsxs)(`div`,{className:B.ctlCol,"data-testid":`billing-model-budgets`,children:[(0,m.jsxs)(`span`,{className:B.modelBudgetTitle,children:[t(`modelBudgetTitle`),(0,m.jsx)(ra,{label:t(`modelBudgetHint`),t})]}),yt.length===0&&(0,m.jsx)(`p`,{className:B.modelBudgetHint,children:t(`emptyHint`)}),(0,m.jsx)(`div`,{className:B.modelBudgetList,children:yt.map(e=>(0,m.jsxs)(`div`,{className:B.modelBudgetRow,children:[(0,m.jsx)(`span`,{className:B.modelBudgetName,title:e.name??e.key,children:e.name??e.key}),(0,m.jsx)(`span`,{className:B.modelBudgetCost,"data-testid":`billing-model-budget-cost-${e.key}`,children:G(e.cost)}),(0,m.jsxs)(`span`,{className:B.inp,children:[(0,m.jsx)(`span`,{className:B.affix,"aria-hidden":`true`,children:`¥`}),(0,m.jsx)(`input`,{className:B.budgetInput,type:`number`,min:0,step:1,value:T[e.key]??``,placeholder:t(`modelBudgetPlaceholder`),"aria-label":`${t(`modelBudgetTitle`)} · ${e.name??e.key}`,"data-testid":`billing-model-budget-${e.key}`,onChange:t=>{E(e.key,t.target.valueAsNumber)}})]})]},e.key))})]})]}),(0,m.jsxs)(`section`,{hidden:H(da.alert),className:B.setCard,"data-testid":`billing-peak-alert-settings`,id:`settings-alert`,children:[(0,m.jsxs)(`div`,{className:B.setCardHead,children:[(0,m.jsx)(`div`,{className:B.setCardMeta,children:(0,m.jsxs)(`h3`,{className:B.setCardTitle,children:[t(`peakAlert`),(0,m.jsx)(ra,{label:t(`peakAlertHint`),t})]})}),(0,m.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":D.enabled,"aria-label":t(`peakAlert`),"data-testid":`billing-peak-alert-toggle`,className:y(B.switch,D.enabled&&B.switchOn),onClick:()=>{O({...D,enabled:!D.enabled})},children:(0,m.jsx)(`span`,{className:B.switchKnob})})]}),D.enabled&&(0,m.jsxs)(`div`,{className:B.ctlCol,children:[(0,m.jsxs)(`label`,{className:B.ctlRow,children:[(0,m.jsx)(`span`,{className:B.ctlLabel,children:t(`peakAlertLeadMin`)}),(0,m.jsx)(`span`,{className:B.inp,children:(0,m.jsx)(`input`,{type:`number`,min:1,max:30,step:1,value:D.leadMin,className:B.budgetInput,"aria-label":t(`peakAlertLeadMin`),onChange:e=>{let t=Number(e.target.valueAsNumber);O({...D,leadMin:Number.isFinite(t)?Math.min(30,Math.max(1,Math.round(t))):D.leadMin})}})})]}),(0,m.jsxs)(`div`,{className:B.ctlRow,children:[(0,m.jsx)(`span`,{className:B.ctlLabel,children:t(`peakAlertPos`)}),(0,m.jsx)(`div`,{className:B.ctlGroup,role:`radiogroup`,"aria-label":t(`peakAlertPos`),children:[`bottom-right`,`center`].map(e=>(0,m.jsxs)(`label`,{className:B.rdo,children:[(0,m.jsx)(`input`,{type:`radio`,name:`peak-pos`,checked:D.position===e,onChange:()=>O({...D,position:e})}),(0,m.jsx)(`span`,{className:B.rdoDot,"aria-hidden":`true`}),t(e===`bottom-right`?`peakAlertPosCorner`:`peakAlertPosCenter`)]},e))})]}),(0,m.jsxs)(`div`,{className:B.ctlRow,children:[(0,m.jsx)(`span`,{className:B.ctlLabel,children:t(`peakAlertMode`)}),(0,m.jsx)(`div`,{className:B.ctlGroup,role:`radiogroup`,"aria-label":t(`peakAlertMode`),children:[`both`,`peak`,`offPeak`].map(e=>(0,m.jsxs)(`label`,{className:B.rdo,children:[(0,m.jsx)(`input`,{type:`radio`,name:`peak-mode`,checked:D.mode===e,onChange:()=>O({...D,mode:e})}),(0,m.jsx)(`span`,{className:B.rdoDot,"aria-hidden":`true`}),t(e===`both`?`peakAlertModeBoth`:e===`peak`?`peakAlertModePeak`:`peakAlertModeOff`)]},e))})]}),(0,m.jsxs)(`label`,{className:B.ctlRow,children:[(0,m.jsx)(`span`,{className:B.ctlLabel,children:t(`peakAlertWebNotify`)}),(0,m.jsx)(`input`,{type:`checkbox`,checked:D.webNotify,"aria-label":t(`peakAlertWebNotify`),onChange:e=>{O({...D,webNotify:e.target.checked})}})]}),(0,m.jsx)(`div`,{className:B.ctlRow,children:(0,m.jsx)(`button`,{type:`button`,className:B.btn,onClick:k,children:t(`peakAlertPreview`)})})]})]}),(0,m.jsx)(`section`,{hidden:H(da.toggles),className:B.setCard,"data-testid":`billing-toggle-setting`,id:`settings-display`,children:(0,m.jsxs)(`div`,{className:B.setGrid3,children:[(0,m.jsx)(`div`,{className:B.setCell,"data-testid":`billing-usage-stats-tool-setting`,children:(0,m.jsxs)(`div`,{className:B.setCardHead,children:[(0,m.jsx)(`div`,{className:B.setCardMeta,children:(0,m.jsxs)(`h3`,{className:B.setCardTitle,children:[t(`usageStatsTool`),(0,m.jsx)(ra,{label:t(`usageStatsToolHint`),t})]})}),(0,m.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":Dt,"aria-label":t(`usageStatsTool`),"data-testid":`billing-usage-stats-tool-toggle`,className:y(B.switch,Dt&&B.switchOn),onClick:kt,children:(0,m.jsx)(`span`,{className:B.switchKnob})})]})}),(0,m.jsxs)(`div`,{className:B.setCell,"data-testid":`billing-livecost-setting`,children:[(0,m.jsxs)(`div`,{className:B.setCardHead,children:[(0,m.jsx)(`div`,{className:B.setCardMeta,children:(0,m.jsxs)(`h3`,{className:B.setCardTitle,children:[t(`liveCostBar`),(0,m.jsx)(ra,{label:t(`liveCostBarHint`),t})]})}),(0,m.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":oe.show,"aria-label":t(`liveCostBar`),"data-testid":`billing-livecost-toggle`,className:y(B.switch,oe.show&&B.switchOn),onClick:()=>se({...oe,show:!oe.show}),children:(0,m.jsx)(`span`,{className:B.switchKnob})})]}),oe.show&&(0,m.jsxs)(`div`,{className:B.rdoRow,"data-testid":`billing-livecost-position`,children:[(0,m.jsx)(`span`,{className:B.rdoLabel,children:t(`liveCostBarPosition`)}),(0,m.jsx)(ma,{liveCostPrefs:oe,onLiveCostPrefs:se,t})]})]}),(0,m.jsx)(`div`,{className:B.setCell,"data-testid":`billing-site-list-setting`,children:(0,m.jsxs)(`div`,{className:B.setCardHead,children:[(0,m.jsx)(`div`,{className:B.setCardMeta,children:(0,m.jsxs)(`h3`,{className:B.setCardTitle,children:[t(`siteListDisplay`),(0,m.jsx)(ra,{label:t(`siteListDisplayHint`),t})]})}),(0,m.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":N.hideUnidentified,"aria-label":t(`siteListDisplay`),"data-testid":`billing-site-hide-unidentified`,className:y(B.switch,N.hideUnidentified&&B.switchOn),onClick:()=>re({hideUnidentified:!N.hideUnidentified}),children:(0,m.jsx)(`span`,{className:B.switchKnob})})]})})]})}),(0,m.jsx)(`section`,{hidden:H(da.displayExtra),className:B.setCard,"data-testid":`billing-display-setting`,id:`settings-display-extra`,children:(0,m.jsxs)(`div`,{className:B.setGrid2,children:[(0,m.jsxs)(`div`,{className:B.setCell,"data-testid":`billing-float-setting`,children:[(0,m.jsx)(`div`,{className:B.setCardHead,children:(0,m.jsx)(`div`,{className:B.setCardMeta,children:(0,m.jsxs)(`h3`,{className:B.setCardTitle,children:[t(`floatWindow`),(0,m.jsx)(ra,{label:t(`floatWindowHint`),t})]})})}),(0,m.jsxs)(`div`,{className:B.ctlCol,children:[(0,m.jsxs)(`div`,{className:B.ctlRow,children:[(0,m.jsx)(`span`,{className:B.ctlLabel,children:t(`cardMode`)}),(0,m.jsx)(`div`,{className:B.ctlGroup,"data-testid":`billing-card-mode`,children:[[`full`,`cardModeFull`],[`compact`,`cardModeCompact`],[`hidden`,`cardModeHidden`]].map(([e,n])=>(0,m.jsx)(`button`,{type:`button`,className:y(B.floatModeBtn,M.mode===e&&B.floatModeBtnOn),"data-testid":`billing-card-mode-${e}`,"aria-pressed":M.mode===e,disabled:e===`hidden`&&!ne,title:e===`hidden`&&!ne?t(`cardModeFallback`):void 0,onClick:()=>te({...M,mode:e}),children:t(n)},e))})]}),!ne&&(0,m.jsx)(`p`,{className:B.setCardDesc,"data-testid":`billing-card-mode-fallback`,children:t(`cardModeFallback`)}),ne&&M.mode===`hidden`&&(0,m.jsx)(`p`,{className:B.setCardDesc,"data-testid":`billing-card-mode-hidden-hint`,children:t(`cardModeHiddenHint`)}),(0,m.jsxs)(`div`,{className:B.ctlRow,children:[(0,m.jsx)(`span`,{className:B.ctlLabel,children:t(`floatMode`)}),(0,m.jsxs)(`div`,{className:B.ctlGroup,"data-testid":`billing-float-mode`,children:[(0,m.jsx)(`button`,{type:`button`,className:y(B.floatModeBtn,A.mode===`combined`&&B.floatModeBtnOn),"data-testid":`billing-float-mode-combined`,onClick:()=>j({mode:`combined`,targets:A.targets}),children:t(`floatModeCombined`)}),(0,m.jsx)(`button`,{type:`button`,className:y(B.floatModeBtn,A.mode===`subscription`&&B.floatModeBtnOn),"data-testid":`billing-float-mode-subscription`,onClick:()=>j({mode:`subscription`,targets:A.targets}),children:t(`floatModeSubscription`)})]})]}),A.mode===`subscription`&&(0,m.jsxs)(`div`,{className:B.ctlRow,children:[(0,m.jsx)(`span`,{className:B.ctlLabel,children:t(`floatTargets`)}),(0,m.jsxs)(`span`,{className:B.ctlGroup,"data-testid":`billing-float-targets`,children:[at.map(e=>{let t=A.targets.includes(e.id);return(0,m.jsxs)(`label`,{className:B.floatTarget,children:[(0,m.jsx)(`input`,{type:`checkbox`,checked:t,"data-testid":`billing-float-target-${e.id}`,onChange:()=>j({mode:`subscription`,targets:t?A.targets.filter(t=>t!==e.id):[...A.targets,e.id]})}),(0,m.jsx)(`span`,{className:B.floatTargetLabel,children:e.label})]},e.id)}),at.length===0&&(0,m.jsx)(`span`,{className:B.setCardDesc,children:t(`floatNoTargetsHint`)})]})]})]})]}),(0,m.jsxs)(`div`,{className:B.setCell,"data-testid":`billing-card-setting`,children:[(0,m.jsx)(`div`,{className:B.setCardHead,children:(0,m.jsx)(`div`,{className:B.setCardMeta,children:(0,m.jsxs)(`h3`,{className:B.setCardTitle,children:[t(`cardDisplay`),(0,m.jsx)(ra,{label:t(`cardDisplayHint`),t})]})})}),(0,m.jsxs)(`div`,{className:B.ctlCol,children:[(0,m.jsxs)(`div`,{className:B.ctlRow,children:[(0,m.jsx)(`span`,{className:B.ctlLabel,children:t(`cardMetric`)}),(0,m.jsxs)(`div`,{className:B.ctlGroup,"data-testid":`billing-card-metric`,children:[(0,m.jsx)(`button`,{type:`button`,className:y(B.floatModeBtn,M.metric===`money`&&B.floatModeBtnOn),"data-testid":`billing-card-money`,onClick:()=>te({...M,metric:`money`}),children:t(`cardMetricMoney`)}),(0,m.jsx)(`button`,{type:`button`,className:y(B.floatModeBtn,M.metric===`tokens`&&B.floatModeBtnOn),"data-testid":`billing-card-tokens`,onClick:()=>te({...M,metric:`tokens`}),children:t(`cardMetricTokens`)})]})]}),(0,m.jsxs)(`div`,{className:B.ctlRow,children:[(0,m.jsx)(`span`,{className:B.ctlLabel,children:t(`cardSpan`)}),(0,m.jsx)(`div`,{className:B.ctlGroup,"data-testid":`billing-card-span`,children:[[`day`,`cardSpanDay`],[`week`,`cardSpanWeek`],[`month`,`cardSpanMonth`]].map(([e,n])=>(0,m.jsx)(`button`,{type:`button`,className:y(B.floatModeBtn,M.span===e&&B.floatModeBtnOn),"data-testid":`billing-card-span-${e}`,"aria-pressed":M.span===e,onClick:()=>te({...M,span:e}),children:t(n)},e))})]}),(0,m.jsxs)(`div`,{className:B.ctlRow,children:[(0,m.jsx)(`span`,{className:B.ctlLabel,children:t(`cardDeltaBadge`)}),(0,m.jsxs)(`div`,{className:B.ctlGroup,"data-testid":`billing-card-delta`,children:[(0,m.jsx)(`button`,{type:`button`,className:y(B.floatModeBtn,M.showDelta&&B.floatModeBtnOn),"data-testid":`billing-card-delta-show`,"aria-pressed":M.showDelta,onClick:()=>te({...M,showDelta:!0}),children:t(`cardDeltaShow`)}),(0,m.jsx)(`button`,{type:`button`,className:y(B.floatModeBtn,!M.showDelta&&B.floatModeBtnOn),"data-testid":`billing-card-delta-hide`,"aria-pressed":!M.showDelta,onClick:()=>te({...M,showDelta:!1}),children:t(`cardDeltaHide`)})]})]})]})]})]})}),(0,m.jsx)(`div`,{hidden:H(da.advanced),id:`settings-advanced`,children:(0,m.jsx)(ca,{userPrices:i,onUserPrices:a,t})}),(0,m.jsx)(`div`,{hidden:H(da.about),id:`settings-about`,children:(0,m.jsx)(Wn,{t,version:e.pluginVersion})}),(0,m.jsxs)(`section`,{hidden:H(da.about),className:B.setCard,"data-testid":`billing-more-works`,children:[(0,m.jsx)(`div`,{className:B.setCardHead,children:(0,m.jsx)(`div`,{className:B.setCardMeta,children:(0,m.jsx)(`h3`,{className:B.setCardTitle,children:t(`moreWorksTitle`)})})}),(0,m.jsxs)(`div`,{className:B.moreWorkList,children:[(0,m.jsxs)(`a`,{className:B.moreWorkRow,href:`https://github.com/kenz1117/dsh-engram`,target:`_blank`,rel:`noreferrer`,"data-testid":`billing-ad-engram`,children:[(0,m.jsx)(`span`,{className:B.moreWorkName,children:t(`adEngramName`)}),(0,m.jsx)(`span`,{className:B.moreWorkDesc,children:t(`adEngramDesc`)})]}),(0,m.jsxs)(`a`,{className:B.moreWorkRow,href:`https://github.com/kenz1117/dsh-ui-rainbowspeak`,target:`_blank`,rel:`noreferrer`,"data-testid":`billing-ad-rainbowspeak`,children:[(0,m.jsx)(`span`,{className:B.moreWorkName,children:t(`adRainbowName`)}),(0,m.jsx)(`span`,{className:B.moreWorkDesc,children:t(`adRainbowDesc`)})]})]})]})]})]})}),F===`trends`&&(0,m.jsxs)(`div`,{className:B.tabPanel,"data-testid":`billing-tab-panel-trends`,children:[(0,m.jsxs)(`section`,{className:B.ubCard,"data-testid":`billing-panel-trend`,children:[(0,m.jsxs)(`div`,{className:B.ubCardHead,children:[(0,m.jsx)(`h3`,{className:B.ubCardTitle,children:t(`trend`)}),b(`billing.dashboard.decor`,{position:`trend`}),(0,m.jsxs)(`span`,{className:B.ubCardControlGroup,children:[(0,m.jsx)(`span`,{className:B.rangeToggle,role:`group`,"aria-label":t(`trend`),children:[7,30].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(B.rangeButton,Te===e&&B.rangeButtonActive),"aria-pressed":Te===e,"data-testid":`billing-trend-${e}d`,onClick:()=>{Oe(e)},children:t(e===7?`trend7d`:`trend30d`)},e))}),(0,m.jsx)(`span`,{className:B.rangeToggle,role:`group`,"aria-label":t(`trendMetric`),children:[`cost`,`tokens`].map(e=>(0,m.jsx)(`button`,{type:`button`,className:y(B.rangeButton,ye===e&&B.rangeButtonActive),"aria-pressed":ye===e,"data-testid":`billing-trend-metric-${e}`,onClick:()=>{be(e)},children:t(e===`cost`?`trendMetricCost`:`trendMetricTokens`)},e))})]}),(0,m.jsx)(`span`,{className:B.ubCardSub,children:Dn})]}),(0,m.jsx)(Fn,{data:Mn,models:Jn,currency:f,metric:ye,t})]}),v.length>0&&(0,m.jsxs)(`section`,{className:B.ubCard,"data-testid":`billing-panel-rounds`,children:[(0,m.jsxs)(`div`,{className:B.ubCardHead,children:[(0,m.jsx)(`h3`,{className:B.ubCardTitle,children:t(`rounds`)}),Yt.length>0&&(0,m.jsxs)(`span`,{className:B.ubTagError,"data-testid":`billing-rounds-flag-count`,children:[Yt.length,` `,t(`anomaly`)]})]}),(0,m.jsx)(`p`,{className:B.ubCardSub,children:t(`roundsHint`).replace(`{count}`,String(v.length))}),(0,m.jsx)(qn,{rounds:v,flags:Yt,currency:f,t})]}),e.byTier!==void 0&&(()=>{let e=Xt.peak+Xt.offPeak;if(e<=0)return null;let n=Xt.peak/e*100;return(0,m.jsxs)(`section`,{className:B.ubCard,"data-testid":`billing-panel-share`,children:[(0,m.jsxs)(`div`,{className:B.ubCardHead,children:[(0,m.jsx)(`h3`,{className:B.ubCardTitle,children:t(`peakShare`)}),(0,m.jsx)(`span`,{className:B.ubCardSub,children:t(`peakSharePerCall`)})]}),(0,m.jsxs)(`div`,{className:B.shareTrack,"data-testid":`billing-share-track`,children:[(0,m.jsx)(`div`,{className:y(B.shareSeg,B.shareSegPeak),style:{width:`${n}%`}}),(0,m.jsx)(`div`,{className:y(B.shareSeg,B.shareSegOff),style:{width:`${100-n}%`}})]}),(0,m.jsxs)(`div`,{className:B.shareLegend,children:[(0,m.jsxs)(`span`,{className:B.shareItem,children:[(0,m.jsx)(`span`,{className:B.shareDot,style:{background:`var(--ds-blue)`}}),t(`peak`),(0,m.jsxs)(`span`,{className:B.shareValue,"data-testid":`billing-share-peak`,children:[G(Xt.peak),` · `,n.toFixed(1),`%`]})]}),(0,m.jsxs)(`span`,{className:B.shareItem,children:[(0,m.jsx)(`span`,{className:B.shareDot,style:{background:`color-mix(in srgb, var(--ds-blue) 30%, var(--dsb-3))`}}),t(`offPeak`),(0,m.jsxs)(`span`,{className:B.shareValue,"data-testid":`billing-share-offpeak`,children:[G(Xt.offPeak),` · `,(100-n).toFixed(1),`%`]})]})]}),Zt>0&&(0,m.jsx)(`div`,{className:B.staleNotice,"data-testid":`billing-share-savings`,children:t(`offPeakSavings`).replace(`{amount}`,G(Zt))})]})})()]}),F===`providers`&&(0,m.jsxs)(`div`,{className:B.tabPanel,"data-testid":`billing-tab-panel-providers`,children:[Pn.length>0&&(0,m.jsxs)(`section`,{className:B.panel,"data-testid":`billing-panel-relay-quota`,children:[(0,m.jsx)(`div`,{className:B.panelHead,children:(0,m.jsx)(`h3`,{className:B.panelTitle,children:t(`panelRelayQuota`)})}),(0,m.jsx)(`div`,{className:B.providerGroupList,"data-testid":`billing-relay-quotas`,children:Pn.map(e=>(0,m.jsxs)(`div`,{className:B.siteRow,"data-testid":`billing-relay-quota`,children:[(0,m.jsxs)(`span`,{className:B.siteRowName,children:[(0,m.jsx)(`span`,{className:y(B.siteKindTag,Mi[e.kind]),children:ji(e.kind,t)}),(0,m.jsx)(`span`,{className:B.siteRowTitle,children:e.origin})]}),(0,m.jsxs)(`span`,{className:B.siteRowMeta,children:[e.balance!==void 0&&(0,m.jsxs)(`span`,{className:B.siteRowCost,children:[t(`relayBalance`),` `,e.balance.toFixed(2)]}),(e.windows?.length??0)>0?e.windows?.map(e=>{let n=e.remainingPercent<20;return(0,m.jsxs)(`span`,{className:y(B.siteRowCalls,n&&B.siteRowCallsLow),children:[t(`relayWindowUsed`),` `,e.usedPercent,`%`]},e.kind)}):(0,m.jsx)(`span`,{className:B.siteRowCalls,children:t(`relayNoQuota`)})]})]},e.route))})]}),(0,m.jsxs)(`section`,{className:B.panel,"data-testid":`billing-panel-providers`,children:[(0,m.jsxs)(`div`,{className:B.panelHead,children:[(0,m.jsx)(`h3`,{className:B.panelTitle,children:t(`providerBilling`)}),b(`billing.dashboard.decor`,{position:`models`}),(0,m.jsx)(`span`,{className:B.panelHint,children:e.updatedAt===void 0?``:`${t(`lastUpdated`)} ${Fi(e.updatedAt)}`})]}),ue&&(0,m.jsx)(`div`,{className:B.staleNotice,"data-testid":`billing-subscriptions-stale`,children:t(`subscriptionsStale`)}),(0,m.jsxs)(`div`,{className:B.providerCtlRow,"data-testid":`billing-provider-controls`,children:[(0,m.jsx)(`button`,{type:`button`,className:B.exportButton,disabled:In.length===0,onClick:Rn,children:t(Ln?`collapseAll`:`expandAll`)}),(0,m.jsxs)(`span`,{className:B.providerTodayToggle,children:[(0,m.jsx)(`span`,{children:t(`todayOnly`)}),(0,m.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":wt,"data-testid":`billing-provider-today-toggle`,className:y(B.switch,wt&&B.switchOn),onClick:Et,children:(0,m.jsx)(`span`,{className:B.switchKnob})})]})]}),X.length===0?(0,m.jsxs)(`div`,{className:B.emptyState,"data-testid":`billing-provider-empty`,children:[(0,m.jsxs)(`span`,{className:B.emptyIll,"aria-hidden":`true`,children:[(0,m.jsxs)(`svg`,{viewBox:`0 0 96 64`,fill:`none`,children:[(0,m.jsx)(`line`,{x1:`6`,y1:`58`,x2:`90`,y2:`58`,stroke:`var(--ds-border-strong)`,strokeWidth:`1`}),(0,m.jsx)(`line`,{x1:`6`,y1:`6`,x2:`6`,y2:`58`,stroke:`var(--ds-border-strong)`,strokeWidth:`1`}),(0,m.jsx)(`path`,{d:`M14 50 L28 40 L42 44 L56 26 L70 30 L82 14`,stroke:`var(--ds-border-strong)`,strokeWidth:`1.5`,strokeLinecap:`round`,fill:`none`,strokeDasharray:`3 3`})]}),(0,m.jsx)(`span`,{className:B.emptyIllDot})]}),(0,m.jsx)(`span`,{className:B.emptyTitle,children:t(wt?`todayNoConsumption`:`noData`)}),(0,m.jsx)(`span`,{className:B.emptyDesc,children:t(`emptyHint`)})]}):(0,m.jsx)(`div`,{className:B.providerGroupList,"data-testid":`billing-provider-groups`,children:X.map(e=>{let n=e.models.length>0||e.subscriptions.length>0,r=n&&xt.has(e.id);return(0,m.jsxs)(`div`,{className:B.providerGroup,"data-testid":`billing-provider-group`,children:[(0,m.jsxs)(`div`,{className:y(B.providerGroupHead,n&&B.providerGroupCollapsible),"data-testid":`billing-provider-group-head`,"aria-expanded":n?r:void 0,role:n?`button`:void 0,tabIndex:n?0:void 0,onClick:n?()=>{Ct(e.id)}:void 0,onKeyDown:n?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),Ct(e.id))}:void 0,children:[(0,m.jsxs)(`span`,{className:B.providerGroupTitle,children:[(0,m.jsx)(`span`,{className:y(B.healthDot,e.dot),role:`img`,"aria-label":ia(e.dot,t),title:ia(e.dot,t)}),(()=>{let n=zt(e.name),r=e.channelKind===`direct`?yr(n):void 0,i=e.channelKind===`direct`?t(`directTag`):e.channelKind===`site`?t(`relayTag`):e.channelKind===`unknown`?t(`unknownTag`):void 0;return(0,m.jsxs)(m.Fragment,{children:[i!==void 0&&(0,m.jsx)(`span`,{className:y(B.kindBadge,e.channelKind===`site`&&B.kindBadgeRelay,e.channelKind===`unknown`&&B.kindBadgeUnknown),"data-testid":`billing-kind-badge`,children:i}),e.channelKind!==`unknown`&&(0,m.jsx)(`span`,{className:B.providerGroupName,children:r??n})]})})(),e.subscriptions.length>0&&(0,m.jsxs)(`span`,{className:B.providerGroupBadge,"data-testid":`billing-provider-sub-count`,children:[e.subscriptions.length,` `,t(`planCountUnit`)]})]}),(0,m.jsxs)(`span`,{className:B.providerGroupMeta,children:[(0,m.jsxs)(`span`,{className:B.providerGroupCost,"data-testid":`billing-provider-cost`,children:[(0,m.jsx)(`span`,{className:B.providerGroupCostLabel,children:t(`cost`)}),e.channelKind===`unknown`?(0,m.jsx)(`span`,{className:B.na,children:`—`}):(0,m.jsx)(`span`,{className:B.providerGroupCostValue,children:G(Ni(e))})]}),!en(e)&&e.balance!==void 0?(0,m.jsxs)(`span`,{className:B.providerGroupBalance,"data-testid":`billing-provider-balance`,children:[(0,m.jsx)(`span`,{className:B.providerGroupBalanceLabel,children:t(`balance`)}),nn(e.balance)]}):(0,m.jsx)(`span`,{className:B.providerGroupBalance,"aria-hidden":`true`}),hi(e.name)===void 0?(0,m.jsx)(`span`,{className:B.providerGroupRecharge,"aria-hidden":`true`}):(0,m.jsx)(`a`,{className:B.providerGroupRecharge,"data-testid":`billing-group-recharge`,href:hi(e.name),target:`_blank`,rel:`noreferrer`,title:t(`rechargeHint`),"aria-label":`${zt(e.name)} ${t(`recharge`)}`,onClick:e=>{e.stopPropagation()},children:t(`recharge`)})]})]}),e.models.length>0&&(0,m.jsx)(`div`,{className:B.providerStatRow,"data-testid":`billing-provider-stat-row`,children:(()=>{let n=e.models.reduce((e,t)=>({calls:e.calls+t.calls,input:e.input+t.input,output:e.output+t.output}),{calls:0,input:0,output:0}),r=n.input>0?e.models.reduce((e,t)=>e+t.cacheHitRate,0)/e.models.length:0;return[{lbl:t(`calls`),val:n.calls.toLocaleString(),sub:``},{lbl:t(`inputTokens`),val:q(n.input),sub:r>0?`${t(`cacheHitRate`)} ${r.toFixed(0)}%`:``},{lbl:t(`outputTokens`),val:q(n.output),sub:``},{lbl:t(`cost`),val:G(Ni(e)),sub:e.models.length===1?``:`${e.models.length} ${t(`models`)}`}].map((e,t)=>(0,m.jsxs)(`div`,{className:B.providerStatCell,children:[(0,m.jsx)(`div`,{className:B.providerStatLbl,children:e.lbl}),(0,m.jsx)(`div`,{className:B.providerStatVal,children:e.val}),e.sub!==``&&(0,m.jsx)(`div`,{className:B.providerStatSub,children:e.sub})]},t))})()}),r&&(0,m.jsxs)(m.Fragment,{children:[e.channelKind===`unknown`&&(0,m.jsx)(`p`,{className:B.unknownHint,"data-testid":`billing-unknown-hint`,children:t(`unknownChannelHint`)}),e.models.length>0&&(0,m.jsx)(`div`,{className:B.tableScroll,"data-testid":`billing-table-scroll`,children:(0,m.jsxs)(`table`,{className:B.modelTable,children:[zn,(0,m.jsx)(`tbody`,{children:e.models.map(e=>(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`td`,{children:Bn(e)}),(0,m.jsx)(`td`,{className:B.numCol,children:e.calls.toLocaleString()}),(0,m.jsx)(`td`,{className:B.numCol,children:q(e.input)}),(0,m.jsx)(`td`,{className:B.numCol,children:q(e.output)}),(0,m.jsx)(`td`,{className:B.numCol,children:mn(e.cacheHitRate)}),(0,m.jsx)(`td`,{className:B.numCol,children:e.plan?(0,m.jsxs)(`span`,{className:B.planTag,children:[e.estimated>0?(0,m.jsxs)(`span`,{children:[`≈`,G(e.estimated)]}):null,(0,m.jsx)(`span`,{className:B.planTagBadge,"data-testid":`billing-plan-badge`,children:t(`subscriptionTag`)})]}):e.actual===void 0?e.estimated>0?(0,m.jsxs)(`span`,{title:t(`cellEstimateHint`),children:[`≈`,G(e.estimated)]}):(0,m.jsx)(`span`,{className:B.na,children:`—`}):(()=>{let t=e.officialCost,n=e.actual-t;return t>0&&n>0?(0,m.jsxs)(`span`,{className:B.bucketCost,children:[(0,m.jsx)(`span`,{className:B.bucketOfficial,children:G(t)}),(0,m.jsx)(`span`,{className:B.bucketSep,children:`/`}),(0,m.jsx)(`span`,{className:B.bucketThird,children:G(n)})]}):G(e.actual)})()})]},e.key))})]})}),e.subscriptions.length>0&&(0,m.jsx)(`div`,{className:B.subscriptionGrid,"data-testid":`billing-subscriptions-grid`,children:e.subscriptions.map(e=>{let n=ki(e.status,t);return(0,m.jsxs)(`div`,{className:y(B.subscriptionCard,B.subscriptionCardUpgraded),"data-testid":`billing-subscription-card`,children:[(0,m.jsxs)(`div`,{className:B.subscriptionHead,children:[(0,m.jsx)(`span`,{className:B.subscriptionName,children:zt(e.displayName)}),e.planType===`code`&&(()=>{let n=tt(e.provider),r=n===void 0?void 0:t(`subscriptionFeePerMonth`).replace(`{amount}`,n.currency===`USD`?`$${n.amount}`:`¥${n.amount}`);return(0,m.jsxs)(`span`,{className:B.subscriptionPlan,"data-kind":`code`,children:[r??(e.subscriptionAmount!==void 0&&e.subscriptionAmount>0?t(`subscriptionFeePerMonth`).replace(`{amount}`,G(e.subscriptionAmount)):t(`planTypeCode`)),n?.label!==void 0&&(0,m.jsx)(`span`,{className:B.subscriptionTier,"data-testid":`billing-tier-${e.provider}`,children:n.label}),n!==void 0&&(0,m.jsx)(`span`,{className:B.subscriptionAuto,"data-testid":`billing-auto-${e.provider}`,children:t(`subscriptionAutoDetect`)})]})})(),e.planType===`token`&&(0,m.jsx)(`span`,{className:B.subscriptionPlan,"data-kind":`token`,children:t(`planTypeToken`)}),e.plan!==void 0&&(0,m.jsx)(`span`,{className:B.subscriptionPlan,children:e.plan})]}),n!==``&&(0,m.jsx)(`div`,{className:B.subscriptionStatus,children:n}),e.windows.length===0&&n===``&&(0,m.jsx)(`div`,{className:B.subscriptionStatus,children:t(`subscriptionNoApi`)}),e.windows.map(e=>(0,m.jsx)(na,{window:e,t},e.kind))]},e.provider)})})]})]},e.id)})})]}),(0,m.jsxs)(`div`,{className:B.exportBar,"data-testid":`billing-export-bar`,role:`group`,"aria-label":t(`export`),children:[(0,m.jsx)(`span`,{className:B.exportLabel,children:t(`export`)}),(0,m.jsx)(`button`,{type:`button`,className:B.exportButton,"data-testid":`billing-export-day`,onClick:()=>{Cn(Sn(`usage-daily`,`csv`,Object.keys(P)),vn(P),`text/csv`)},children:t(`exportCsvDay`)}),e.bySession!==void 0&&(0,m.jsx)(`button`,{type:`button`,className:B.exportButton,"data-testid":`billing-export-sessions`,onClick:()=>{Cn(Sn(`usage-sessions`,`csv`,Object.keys(P)),xn(e.bySession??[]),`text/csv`)},children:t(`exportCsvSession`)}),e.bySite!==void 0&&(0,m.jsx)(`button`,{type:`button`,className:B.exportButton,"data-testid":`billing-export-sites`,onClick:()=>{Cn(Sn(`usage-sites`,`csv`,Object.keys(P)),yn(e.bySite??{}),`text/csv`)},children:t(`exportCsvSite`)}),(0,m.jsx)(`button`,{type:`button`,className:B.exportButton,"data-testid":`billing-export-json`,onClick:()=>{Cn(Sn(`usage-stats`,`json`,Object.keys(P)),JSON.stringify(e,null,2),`application/json`)},children:t(`exportJson`)})]}),e.bySession!==void 0&&(0,m.jsxs)(`section`,{className:B.ubCard,"data-testid":`billing-panel-sessions`,children:[(0,m.jsxs)(`div`,{className:B.ubCardHead,children:[(0,m.jsx)(`h3`,{className:B.ubCardTitle,children:t(`sessions`)}),(0,m.jsx)(`span`,{className:B.ubCardSub,children:e.bySession.length>20?t(`sessionOverflow`).replace(`{limit}`,`20`).replace(`{total}`,String(e.bySession.length)):`${e.bySession.length}`}),e.bySession.length>0&&(0,m.jsx)(`button`,{type:`button`,className:B.exportButton,"data-testid":`billing-sessions-view-all`,onClick:()=>{dt(!0)},children:t(`sessionsViewAll`).replace(`{count}`,String(e.bySession.length))})]}),(e.staleLedgerSessions??0)>0&&(0,m.jsx)(`div`,{className:B.staleNotice,"data-testid":`billing-sessions-stale`,children:t(`staleLedgerNotice`).replace(`{count}`,String(e.staleLedgerSessions))}),(0,m.jsxs)(`div`,{className:B.ubTablewrap,"data-testid":`billing-sessions-table`,children:[ge!==void 0&&(0,m.jsx)(`div`,{className:B.staleNotice,"data-testid":`billing-session-nav-notice`,role:`note`,children:ge}),(0,m.jsxs)(`table`,{className:B.ubTable,children:[(0,m.jsx)(`thead`,{children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{children:t(`sessionTitle`)}),(0,m.jsx)(`th`,{className:B.numCol,children:t(`calls`)}),(0,m.jsx)(`th`,{className:B.numCol,children:t(`actual`)}),(0,m.jsx)(`th`,{className:B.numCol,children:t(`lastActive`)})]})}),(0,m.jsxs)(`tbody`,{children:[ht.length===0&&(0,m.jsx)(`tr`,{children:(0,m.jsx)(`td`,{colSpan:4,className:B.emptyRow,children:t(`noData`)})}),ht.slice(0,20).map(e=>{let n=e.children!==void 0||e.subs!==void 0,r=n&&ct.has(e.id),i=Pi(e);return(0,m.jsxs)(d.Fragment,{children:[(0,m.jsxs)(`tr`,{className:n?B.sessionGroupRow:void 0,"aria-expanded":n?r:void 0,tabIndex:n?0:void 0,onClick:n?()=>{mt(e.id)}:void 0,onKeyDown:n?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),mt(e.id))}:void 0,children:[(0,m.jsxs)(`td`,{children:[(0,m.jsx)(`span`,{className:B.modelName,children:(0,m.jsxs)(`button`,{type:`button`,className:B.sessionLink,"data-testid":`billing-session-open`,title:t(`sessionOpen`),onClick:t=>{t.stopPropagation(),ve(e.id)},children:[e.title??`${t(`sessionUntitled`)} · ${e.id.slice(0,8)}`,(e.mergedCount??1)>1?` ×${e.mergedCount}`:``]})}),e.stale===!0&&(0,m.jsx)(`span`,{className:y(B.ubTag,B.ubTagNeutral),"data-testid":`billing-session-stale`,children:t(`sessionStaleBadge`)}),(i.calls>0||i.cost>0)&&(0,m.jsx)(`span`,{className:y(B.ubTag,B.ubTagNeutral),"data-testid":`billing-session-sub`,children:i.cost>0?t(`sessionSubCost`).replace(`{cost}`,G(i.cost)):t(`sessionSubCalls`).replace(`{calls}`,i.calls.toLocaleString())})]}),gt(e)]}),r&&e.children?.map(e=>(0,m.jsxs)(`tr`,{className:B.sessionChildRow,children:[(0,m.jsx)(`td`,{children:(0,m.jsx)(`button`,{type:`button`,className:B.sessionLink,"data-testid":`billing-session-open`,title:t(`sessionOpen`),onClick:t=>{t.stopPropagation(),ve(e.id)},children:(0,m.jsx)(`span`,{className:B.modelProvider,children:e.id.slice(0,8)})})}),gt(e)]},e.id)),r&&e.subs?.map(e=>_t(e,0))]},e.id)})]})]})]}),ut&&(0,m.jsxs)(`div`,{className:B.sessionViewer,"data-testid":`billing-session-viewer`,children:[(0,m.jsxs)(`div`,{className:B.sessionViewerHead,children:[(0,m.jsx)(`h3`,{className:B.sessionViewerTitle,children:t(`sessions`)}),(0,m.jsx)(`input`,{className:B.ubSearch,type:`search`,value:ft,placeholder:t(`sessionViewerSearch`),"aria-label":t(`sessionViewerSearch`),"data-testid":`billing-session-viewer-search`,onChange:e=>{pt(e.target.value)}}),(0,m.jsx)(`button`,{type:`button`,className:B.exportButton,"data-testid":`billing-session-viewer-close`,onClick:()=>{dt(!1),pt(``)},children:t(`close`)})]}),(0,m.jsx)(`div`,{className:B.sessionViewerList,"data-testid":`billing-session-viewer-list`,children:(0,m.jsxs)(`table`,{className:B.ubTable,children:[(0,m.jsx)(`thead`,{children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{children:t(`sessionTitle`)}),(0,m.jsx)(`th`,{className:B.numCol,children:t(`calls`)}),(0,m.jsx)(`th`,{className:B.numCol,children:t(`actual`)}),(0,m.jsx)(`th`,{className:B.numCol,children:t(`lastActive`)})]})}),(0,m.jsxs)(`tbody`,{children:[vt.length===0&&(0,m.jsx)(`tr`,{children:(0,m.jsx)(`td`,{colSpan:4,className:B.emptyRow,children:t(`noData`)})}),vt.map(e=>(0,m.jsxs)(`tr`,{children:[(0,m.jsxs)(`td`,{children:[(0,m.jsxs)(`span`,{className:B.modelName,children:[e.title??`${t(`sessionUntitled`)} · ${e.id.slice(0,8)}`,(e.mergedCount??1)>1?` ×${e.mergedCount}`:``]}),e.cwd!==void 0&&(0,m.jsx)(`span`,{className:B.modelProvider,children:ua(e.cwd)}),e.stale===!0&&(0,m.jsx)(`span`,{className:y(B.ubTag,B.ubTagNeutral),children:t(`sessionStaleBadge`)})]}),(0,m.jsx)(`td`,{className:B.numCol,children:e.calls.toLocaleString()}),(0,m.jsx)(`td`,{className:B.numCol,children:G(e.cost)}),(0,m.jsx)(`td`,{className:B.numCol,children:e.lastActive>0?`${K(e.lastActive)} ${Fi(e.lastActive)}`:`—`})]},e.id))]})]})})]})]})]}),F===`token`&&(0,m.jsxs)(`div`,{className:B.tabPanel,"data-testid":`billing-tab-panel-token`,children:[(0,m.jsx)(kn,{stats:e,trendDays:Te,onTrendDays:Oe,models:Jn,money:G,t}),e.perf!==void 0&&(0,m.jsxs)(`section`,{className:B.panel,"data-testid":`billing-panel-perf`,children:[(0,m.jsxs)(`div`,{className:B.panelHead,children:[(0,m.jsx)(`h3`,{className:B.panelTitle,children:t(`perfTitle`)}),(0,m.jsx)(`span`,{className:B.panelHint,children:t(`perfHint`)})]}),(0,m.jsx)(Vn,{perf:e.perf,models:Jn,t})]})]}),F===`pricing`&&(0,m.jsxs)(`div`,{className:B.tabPanel,"data-testid":`billing-tab-panel-pricing`,children:[(0,m.jsxs)(`div`,{className:B.ubAlert,role:`note`,children:[(0,m.jsxs)(`div`,{className:B.ubAlertLeft,children:[(0,m.jsxs)(`span`,{className:B.ubRate,"data-testid":`billing-rate`,children:[t(`todayRate`),` 1 USD = `,dn(At.rate)]}),(0,m.jsx)(`span`,{className:y(B.ubTag,At.live?B.ubTagSuccess:B.ubTagNeutral),children:At.live?t(`rateLive`):t(`rateBuiltin`)}),It>0&&(0,m.jsxs)(`span`,{className:B.ubTag,"data-testid":`billing-pricing-synced`,children:[t(`pricingSyncedAt`),` `,new Date(It).toLocaleTimeString(Rt===`zh`?`zh-CN`:`en-US`,{hour:`2-digit`,minute:`2-digit`})]}),(0,m.jsx)(`button`,{type:`button`,className:B.heatmapRangeButton,"data-testid":`billing-pricing-sync`,disabled:jt,onClick:Ft,children:t(jt?`pricingSyncing`:`pricingSyncNow`)})]}),(0,m.jsx)(`p`,{className:B.ubAlertNote,children:t(`pricingTip`)})]}),(0,m.jsxs)(`section`,{className:B.ubCard,"data-testid":`billing-panel-pricing`,children:[(0,m.jsxs)(`div`,{className:B.ubCardHead,children:[(0,m.jsx)(`h3`,{className:B.ubCardTitle,children:t(`pricing`)}),(0,m.jsx)(`span`,{className:B.ubCardSub,children:t(`pricingUnit`)}),(0,m.jsx)(`input`,{className:B.ubSearch,type:`search`,value:Bt,placeholder:t(`pricingSearch`),"aria-label":t(`pricingSearch`),"data-testid":`billing-pricing-search`,onChange:e=>{Vt(e.target.value)}})]}),(0,m.jsx)(`div`,{className:y(B.ubTablewrap,B.ubTablewrapPricing),"data-testid":`billing-pricing-table`,children:(0,m.jsxs)(`table`,{className:B.ubTable,children:[(0,m.jsx)(`thead`,{children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{children:t(`thModel`)}),(0,m.jsx)(`th`,{className:B.numCol,children:t(`thInputMiss`)}),(0,m.jsx)(`th`,{className:B.numCol,children:t(`thInputHit`)}),(0,m.jsx)(`th`,{className:B.numCol,children:t(`output`)}),(0,m.jsx)(`th`,{className:B.numCol,colSpan:2,children:t(`band`)})]})}),(0,m.jsx)(`tbody`,{children:ur(on(),Bt).map(e=>{let n=e.price.input>0||e.price.output>0;return(0,m.jsxs)(d.Fragment,{children:[(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`td`,{children:(0,m.jsxs)(`span`,{className:B.ubModel,children:[(()=>{let n=sr(Pt(Wt,Nt(e.key,Kt)),qt);if(n===null)return null;let r=Ht.includes(e.key),i=`${e.name} · ${t(n===`peak`?`peak`:`offPeak`)} · ${t(`bandPinHint`)}`;return(0,m.jsx)(`button`,{type:`button`,className:y(B.bandDot,B[n],r&&B.bandDotOn),"data-testid":`billing-band-dot`,"aria-pressed":r,"aria-label":i,title:i,onClick:()=>{Ut(L(e.key)),window.dispatchEvent(new CustomEvent(`dsh.ui-usage-billing.pinned-pref`))}})})(),(0,m.jsxs)(`span`,{className:B.ubModelName,children:[e.name,e.uncatalogued&&(0,m.jsx)(`span`,{className:B.ubTagAlert,"data-testid":`billing-price-uncatalogued`,children:t(`uncatalogued`)}),e.promo!==void 0&&rn(e.promo,Date.now())&&(0,m.jsx)(p.Tooltip,{label:[e.promo.note,e.promo.endsAtMs===void 0?t(`promoOpenEnded`):t(`promoUntil`,{date:new Date(e.promo.endsAtMs).toLocaleDateString()})].filter(Boolean).join(` · `),side:`top`,maxWidth:280,children:(0,m.jsx)(`span`,{className:B.ubTagPromo,"data-testid":`billing-price-promo`,children:t(`promoBadge`)})})]})]})}),(0,m.jsx)(`td`,{className:B.numCol,children:n?Jt(e.price.input,e.price.currency):(0,m.jsx)(`span`,{className:B.na,children:`—`})}),(0,m.jsx)(`td`,{className:B.numCol,children:n?Jt(e.price.cacheHit,e.price.currency):(0,m.jsx)(`span`,{className:B.na,children:`—`})}),(0,m.jsx)(`td`,{className:B.numCol,children:n?Jt(e.price.output,e.price.currency):(0,m.jsx)(`span`,{className:B.na,children:`—`})}),n&&e.price.offPeak!==void 0&&e.peakHours!==void 0?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`td`,{className:B.numCol,children:(0,m.jsxs)(`span`,{className:B.ubChipPeak,children:[(0,m.jsx)(`span`,{className:B.ubChipLabel,children:e.tierSemantics===`latency`?t(`ubStd`):t(`ubPeak`)}),(0,m.jsxs)(`span`,{children:[Jt(e.price.input,e.price.currency),`/`,Jt(e.price.output,e.price.currency)]})]})}),(0,m.jsx)(`td`,{className:B.numCol,children:(0,m.jsxs)(`span`,{className:B.ubChipOff,children:[(0,m.jsx)(`span`,{className:B.ubChipLabel,children:e.tierSemantics===`latency`?`Flex`:t(`ubOff`)}),(0,m.jsxs)(`span`,{children:[Jt(e.price.offPeak.input,e.price.currency),` / `,Jt(e.price.offPeak.output,e.price.currency)]})]})})]}):(0,m.jsx)(`td`,{className:B.numCol,colSpan:2,children:n?(0,m.jsx)(`span`,{className:B.flatTag,children:t(`flat`)}):(0,m.jsx)(`span`,{className:B.na,children:`—`})})]}),(e.extraRows??[]).map(t=>(0,m.jsxs)(`tr`,{className:B.ubExtraRow,children:[(0,m.jsxs)(`td`,{children:[(0,m.jsx)(`span`,{className:B.ubExtraName,children:lr(t.label,Rt)}),t.note!==void 0&&(0,m.jsx)(`span`,{className:B.ubExtraNote,children:lr(t.note,Rt)})]}),(0,m.jsx)(`td`,{className:B.numCol,children:t.input===void 0?(0,m.jsx)(`span`,{className:B.na,children:`—`}):Jt(t.input,e.price.currency)}),(0,m.jsx)(`td`,{className:B.numCol,children:(0,m.jsx)(`span`,{className:B.na,children:`—`})}),(0,m.jsx)(`td`,{className:B.numCol,children:t.output===void 0?(0,m.jsx)(`span`,{className:B.na,children:`—`}):Jt(t.output,e.price.currency)}),(0,m.jsx)(`td`,{className:B.numCol,colSpan:2,children:(0,m.jsx)(`span`,{className:B.na,children:`—`})})]},`${e.key}:${t.label}`))]},e.key)})})]})})]}),(0,m.jsxs)(`section`,{className:B.ubCard,children:[(0,m.jsx)(`div`,{className:B.ubCardHead,children:(0,m.jsx)(`h3`,{className:B.ubCardTitle,children:t(`pricingNotes`)})}),(0,m.jsxs)(`ul`,{className:B.ubNotes,children:[(0,m.jsxs)(`li`,{className:B.ubNotesItem,children:[(0,m.jsx)(`span`,{className:B.ubNotesTerm,children:t(`cacheHit`)}),(0,m.jsx)(`span`,{className:B.ubNotesDesc,children:t(`noteCache`)})]}),(0,m.jsxs)(`li`,{className:B.ubNotesItem,children:[(0,m.jsx)(`span`,{className:B.ubNotesTerm,children:t(`peakBand`)}),(0,m.jsx)(`span`,{className:B.ubNotesDesc,children:t(`noteBand`)})]}),(0,m.jsxs)(`li`,{className:B.ubNotesItem,children:[(0,m.jsx)(`span`,{className:B.ubNotesTerm,children:t(`pricingSource`)}),(0,m.jsx)(`span`,{className:B.ubNotesDesc,children:t(`noteSource`)})]})]})]})]}),!r&&b(`billing.dashboard.decor`,{position:`footer`})]}),!r&&(0,m.jsxs)(`footer`,{className:B.modalFooter,"data-testid":`billing-footer`,children:[(0,m.jsx)(`span`,{children:t(`footer`)}),(0,m.jsx)(`span`,{children:t(`footerCredit`).replace(`{version}`,e.pluginVersion===void 0?`—`:`v${e.pluginVersion}`)})]})]});return r?Zn:(0,m.jsx)(p.Modal,{open:!0,onClose:n,title:t(`title`),headless:!0,className:y(B.dashboardModal,`dsh-billing-modal`),children:Zn})}function ua(e){return e.split(/[\\/]/).filter(Boolean).at(-1)??`—`}let da={display:[`显示`,`密度`,`动效`,`紧凑`,`舒适`,`克制`,`丰富`,`display`,`density`,`motion`,`compact`,`comfortable`],budget:[`预算`,`金额`,`本月`,`花费`,`进度`,`budget`,`amount`,`spend`,`progress`],alert:[`峰谷`,`峰`,`谷`,`提醒`,`通知`,`预览`,`切换`,`peak`,`off-peak`,`alert`,`notify`,`preview`],toggles:[`usage_stats`,`工具`,`即时代费`,`胶囊`,`中转站`,`站点`,`隐藏`,`relay`,`site`,`live`,`cost`,`hide`],displayExtra:[`悬浮`,`订阅`,`计费卡`,`指标`,`环比`,`主数字`,`侧栏`,`入口`,`隐藏`,`float`,`subscription`,`card`,`metric`,`delta`,`sidebar`,`trigger`,`hidden`],advanced:[`自定义`,`单价`,`价格`,`低谷`,`custom`,`price`],about:[`关于`,`版本`,`作者`,`许可`,`仓库`,`about`,`version`,`author`,`license`,`repo`]};function fa(e){return Object.values(da).every(t=>Di(e,t))}let pa=[`below`,`above`,`toolbar`];function ma({liveCostPrefs:e,onLiveCostPrefs:t,t:n}){let[r,i]=(0,d.useState)(!1),a={below:n(`liveCostBarPosBelow`),above:n(`liveCostBarPosAbove`),toolbar:n(`liveCostBarPosToolbar`)},o=pa.map(e=>({id:e,label:a[e]}));return(0,m.jsx)(p.Menu,{open:r,align:`end`,portal:!0,compact:!0,items:o,selectedId:e.position,onSelect:n=>{i(!1);let r=pa.find(e=>e===n);r!==void 0&&t({...e,position:r})},onClose:()=>{i(!1)},anchor:(0,m.jsxs)(`button`,{type:`button`,className:B.rdoSelect,"data-testid":`billing-livecost-position-select`,"aria-haspopup":`menu`,"aria-expanded":r,onClick:()=>{i(!r)},children:[(0,m.jsx)(`span`,{children:a[e.position]}),(0,m.jsx)(`span`,{className:y(B.rdoChevron,r&&B.rdoChevronOpen),"aria-hidden":!0,children:Lr?(0,m.jsx)(Lr,{}):null})]})})}function ha(e){let{t,checkModels:n,publishCosts:r,registerOpen:i,navigateToSession:a,renderSlot:o,useStore:s,actions:c,embeddedSettings:l=!1}=e,[u,f]=(0,d.useState)(Ar),[p,h]=(0,d.useState)(Mr),[g,_]=(0,d.useState)([]),[v,y]=(0,d.useState)(void 0),[b,x]=(0,d.useState)(!1),[S,C]=(0,d.useState)([]),[w,T]=(0,d.useState)(!1),[ee,O]=(0,d.useState)([]),[k,N]=(0,d.useState)(()=>xe()),[re,ie]=(0,d.useState)(()=>je()),ae=(0,d.useCallback)(e=>{ie(e),Me(e),window.dispatchEvent(new CustomEvent(`dsh.ui-usage-billing.language-pref`))},[]),oe=(0,d.useCallback)(e=>{N(e),Se(e),window.dispatchEvent(new CustomEvent(be))},[]),[se,ce]=(0,d.useState)(()=>E()),le=(0,d.useCallback)(e=>{ce(e),D(e)},[]),[ue,de]=(0,d.useState)(()=>fe()),me=(0,d.useCallback)(e=>{de(e),pe(e)},[]),[he,ye]=(0,d.useState)(()=>_e()),P=(0,d.useCallback)(e=>{ye(e),ve(e),window.dispatchEvent(new CustomEvent(ge))},[]),[F,Ce]=(0,d.useState)(()=>j());(0,d.useEffect)(()=>te(()=>{Ce(j())}),[]);let we=e.recoveryEntryAvailable,Te=(0,d.useMemo)(()=>({...F,mode:ne(F.mode,we)}),[F,we]),Ee=(0,d.useCallback)(e=>{let t={...e,mode:ne(e.mode,we)};Ce(t),M(t),window.dispatchEvent(new CustomEvent(A))},[we]),[De,Oe]=(0,d.useState)(()=>{let e=Pe();return ut(e),e}),ke=(0,d.useCallback)(e=>{Oe(e),ut(e),Fe(e)},[]),I=(0,d.useMemo)(()=>gi(u),[u,De]),Ae=re,L=(0,d.useCallback)((e,n)=>{let r=(Ae===`en`?Qe:H)[e]??t(e);if(n===void 0)return r;let i=r;for(let[e,t]of Object.entries(n))i=i.replaceAll(`{${e}}`,String(t));return i},[Ae,t]),[Ne,Ie]=(0,d.useState)(!1),Le=(0,d.useCallback)(()=>{Ie(!1)},[]),Re=(0,d.useRef)(!1),R=(0,d.useCallback)((e=!1)=>{Re.current&&!e||(Re.current=!0,Promise.all([Ii().then(e=>{e!==null&&f(e)}),Li().then(({balances:e,reconcile:t,stale:n})=>{e.length>0&&_(e),y(t),x(n===!0)}),Ri().then(({quotas:e,stale:t})=>{e.length>0?(C(e),T(t===!0)):T(!1)}).catch(()=>{T(!0)}),zi().then(e=>{O(e)}).catch(()=>{})]).catch(()=>{}).finally(()=>{Re.current=!1}))},[]),ze=(0,d.useCallback)(()=>{R(!0),Wi(),Ie(!0)},[R]);(0,d.useEffect)(()=>{R(),Wi()},[R]);let[Be,Ve]=(0,d.useState)(()=>typeof document>`u`||!document.hidden);(0,d.useEffect)(()=>{if(typeof document>`u`)return;let e=()=>{Ve(!document.hidden),document.hidden||(R(!0),Wi())};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}},[R]),(0,d.useEffect)(()=>{if(!Be)return;let e=setInterval(()=>{R(),Wi()},Ne?kr:3e5);return()=>{clearInterval(e)}},[R,Ne,Be]),(0,d.useEffect)(()=>{let e=!0;return n().then(t=>{e&&(h(t),_t(t.catalog??[]))}),()=>{e=!1}},[n]);let z=K(),He=Object.entries(I.byDay).filter(([e])=>e.startsWith(z.slice(0,7))).reduce((e,[,t])=>e+t.cost,0),Ue=I.byDay[z]?.cost??0,We=new Date;We.setDate(We.getDate()-1);let Ge=`${We.getFullYear()}-${String(We.getMonth()+1).padStart(2,`0`)}-${String(We.getDate()).padStart(2,`0`)}`,Ke=I.byDay[Ge]?.cost??0,qe=Ke>0?(Ue-Ke)/Ke*100:0,Je=Gr(I.byDay,z),Ye=(0,d.useMemo)(()=>Wr(I.byDay).map(e=>{let t=I.byDay[e.date];return{date:e.date,cost:e.cost,tokens:t===void 0?0:Ur(t)}}),[I.byDay]),Xe=Object.entries(I.byDay).filter(([e])=>e.startsWith(z.slice(0,7))).reduce((e,[,t])=>e+Ur(t),0),Ze=(()=>{let e=I.byDay[z];return e===void 0?0:Ur(e)})(),B=Gr(I.byDay,z,Ur),V=s(e=>e.enabled),$e=s(e=>e.amount),et=s(e=>e.tierAlertDays),U=s(e=>e.lastTierSwitchAt),[tt,nt]=(0,d.useState)(()=>wr()),[W,rt]=(0,d.useState)(null),[it,at]=(0,d.useState)(null),[ot,st]=(0,d.useState)(0),[ct,lt]=(0,d.useState)(!1);(0,d.useEffect)(()=>{if(!tt.enabled){st(0),lt(!1);return}let e=!1,t=!1;lt(!1);let n=()=>{t||(t=!0,Ji().then(t=>{e||st(t.supported?t.queuedCount:0)}).catch(()=>{e||st(0)}).finally(()=>{t=!1,e||lt(!0)}))};n();let r=setInterval(n,kr);return()=>{e=!0,clearInterval(r)}},[tt.enabled]),(0,d.useEffect)(()=>{rt(e=>Cr(e,ot))},[ot]);let[dt,ft]=(0,d.useState)(()=>Date.now());(0,d.useEffect)(()=>{if(!tt.enabled)return;let e=setInterval(()=>ft(Date.now()),kr);return()=>{clearInterval(e)}},[tt.enabled]);let pt=(0,d.useCallback)(e=>{nt(e),Tr(e)},[]),mt=S.some(e=>e.displayName===`Z.ai Coding Plan`&&e.status===`ok`),ht=Nt(u.byTurn?.[0]?.model,mt),gt=(0,d.useCallback)(()=>{at({entering:Ct(Date.now())===`peak`?`offPeak`:`peak`,atMs:Date.now()+18e4,channel:ht})},[ht]),vt=$e>0?$e:u.budget??0,yt=V&&vt>0?He/vt>=1?`over`:He/vt>=.8?`warn`:`none`:`none`,xt=(0,d.useCallback)(()=>{let e=!V;c.setEnabled(e),e&&typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission()},[c,V]);(0,d.useEffect)(()=>{if(!V||vt<=0)return;let e=He/vt*100,t=Or.filter(t=>e>=t&&et?.[String(t)]!==z);if(t.length===0)return;let n=t[t.length-1]??100;if(c.markTierAlerted(t,z),!yi())return;let r=L(`budgetTierBody`).replace(`{cost}`,dn(He)).replace(`{budget}`,dn(vt)).replace(`{pct}`,String(n));bi(`budget:${n}:${z}`,()=>{new Notification(L(`budget`),{body:r})})},[V,vt,He,et,z,c,L]),(0,d.useEffect)(()=>{if(tt.enabled&&!ct)return;let e=Sr(Er(dt,tt,U,ht),ot>0?Er(dt,tt,U,`deepseek-metered`):null,ot);if(e===null||(c.markTierSwitchAlerted(e.atMs),rt(e),!tt.webNotify||!yi()))return;let t=Math.max(1,Math.round((e.atMs-dt)/6e4)),n=L(e.entering===`peak`?`peakAlertTitlePeak`:`peakAlertTitleOff`),r=L(e.channel===`zhipu-coding-plan`?e.entering===`peak`?`tierAlertEnterPeakZhipu`:`tierAlertEnterOffZhipu`:e.entering===`peak`?`tierAlertEnterPeak`:`tierAlertEnterOff`).replace(`{minutes}`,String(t)),i=e.queueCount===void 0?``:` ${L(e.entering===`peak`?`peakAlertQueuePeak`:`peakAlertQueueOff`,{count:e.queueCount})}`;bi(`peak:${e.atMs}`,()=>{new Notification(n,{body:`${r}${i}`})})},[dt,U,tt,ht,ot,ct,c,L]);let St=s(e=>e.lastBalanceAlertDay),wt=s(e=>e.modelBudgets??ir),Tt=s(e=>e.modelTierAlertDays??ar),Et=(0,d.useMemo)(()=>Yr(I.byDayModels,z.slice(0,7)),[I.byDayModels,z]),Dt=I.lowBalanceThreshold??50,Ot=(0,d.useMemo)(()=>{if(g.length===0)return;let e=Rr(I.byDay,z),t=bt().rate;for(let n of g){if(n.totalBalance===void 0||n.error!==void 0)continue;let r=n.currency===`USD`?n.totalBalance*t:n.totalBalance;if(r>=Dt)continue;let i=e>0?Math.floor(r/e):void 0;return{name:n.displayName,cny:r,days:i}}},[g,I.lowBalanceThreshold,I.byDay,z]);(0,d.useEffect)(()=>{if(Ot===void 0||St===z||(c.markBalanceAlerted(z),!yi()))return;let e=L(`balanceLowBody`).replace(`{name}`,Ot.name).replace(`{balance}`,dn(Ot.cny)).replace(`{days}`,Ot.days===void 0?`—`:String(Ot.days));bi(`balance:${z}`,()=>{new Notification(L(`balance`),{body:e})})},[Ot,St,z,c,L]),(0,d.useEffect)(()=>{let e=[],t;for(let[n,r]of Object.entries(wt)){if(!(r>0))continue;let i=Et[n]??0;for(let a of Zr(i,r)){let o=`${n}:${a}`;Tt[o]!==z&&(e.push(o),(t===void 0||a>t.tier)&&(t={model:n,tier:a,cost:i,budget:r}))}}if(e.length===0||t===void 0||(c.markModelTierAlerted(e,z),!yi()))return;let n=L(`modelBudgetBody`).replace(`{model}`,t.model).replace(`{cost}`,dn(t.cost)).replace(`{budget}`,dn(t.budget)).replace(`{pct}`,String(t.tier));bi(`model-budget:${t.model}:${t.tier}:${z}`,()=>{new Notification(L(`modelBudgetTitle`),{body:n})})},[wt,Et,Tt,z,c,L]);let kt=(0,d.useMemo)(()=>{let e=z.slice(0,7),t=new Map;for(let[n,r]of Object.entries(I.byDayModels??{}))if(n.startsWith(e))for(let[e,n]of Object.entries(r)){if(n.cost<=0)continue;let r=tn(e).provider,i=I.byModel?.[e]?.plan===!0,a=t.get(r)??{cost:0,plan:i};a.cost+=n.cost,i||(a.plan=!1),t.set(r,a)}let n,r;for(let e of t){let t=e[1].plan?r:n;(t===void 0||e[1].cost>t[1].cost)&&(e[1].plan?r=e:n=e)}let i=e=>{let t=g.find(t=>Q(t.provider)===Q(e));if(t===void 0||t.totalBalance===void 0){if(e===`Custom`){let e=g.filter(e=>e.totalBalance!==void 0&&e.error===void 0),t=e[0];return t!==void 0&&e.length===1?i(t.provider):void 0}return{text:t?.error===`unauthorized`?L(`balanceUnauthorized`):t?.error===`unreachable`||t?.error===`invalid`?L(`balanceUnreachable`):L(`balanceUnconfigured`),low:!1}}let n=t.currency===`USD`?`$${t.totalBalance.toFixed(2)}`:dn(t.totalBalance),r=bt().rate;return{text:n,low:(t.currency===`USD`?t.totalBalance*r:t.totalBalance)<Dt}},a=e=>{let t=S.find(t=>t.displayName===e||ri(t.provider)===e);if(t===void 0||t.windows.length===0)return{text:L(`subscriptionNoApi`),low:!1};let n=t.windows.reduce((e,t)=>Math.min(e,t.remainingPercent),100);return{text:n<=0?L(`subscriptionExhausted`):L(`subscriptionRemaining`).replace(`{pct}`,String(n)),low:n<20}},o=n===void 0?void 0:i(n[0]);return{direct:n===void 0||o===void 0?void 0:{name:n[0],...o},sub:r===void 0?void 0:{name:r[0],...a(r[0])}}},[I.byDayModels,I.byModel,I.lowBalanceThreshold,g,S,z,L]),At=(0,d.useMemo)(()=>{let e=I.total;return{input:e.input,output:e.output,cacheRead:e.cacheHit,cacheMiss:e.cacheMiss,calls:e.calls}},[I]);(0,d.useEffect)(()=>{r({todayCost:Ue,monthCost:He})},[Ue,He,r]),(0,d.useEffect)(()=>{if(!l)return i(ze)},[l,i,ze]);let jt=(0,d.useMemo)(()=>u.byTurn??[],[u.byTurn]);return(0,m.jsxs)(m.Fragment,{children:[!l&&(0,m.jsx)(aa,{...e,t:L,currency:k,onOpen:ze,monthCost:He,todayCost:Ue,weekCost:Je,days:Ye,vendorStatus:kt,dash:At,cardPrefs:Te,monthTokens:Xe,todayTokens:Ze,weekTokens:B,floatPrefs:se,subscriptions:S,budgetPressure:yt,deltaPct:qe}),(l||Ne)&&(0,m.jsx)(la,{stats:I,t:L,onClose:Le,embeddedSettings:l,navigateToSession:a,userPrices:De,onUserPrices:ke,health:p,balances:g,...v===void 0?{}:{reconcile:v},quotas:S,relayQuotas:ee,currency:k,onCurrency:oe,language:re,onLanguage:ae,turns:jt,renderSlot:o,budgetEnabled:V,budgetAmount:vt,modelBudgets:wt,monthModelCost:Et,onModelBudget:c.setModelBudget,onToggleBudget:xt,onBudgetAmount:c.setAmount,peakConfig:tt,onPeakConfig:pt,onPreviewPeak:gt,floatPrefs:se,onFloatPrefs:le,cardPrefs:Te,onCardPrefs:Ee,recoveryEntryAvailable:we,sitePrefs:ue,onSitePrefs:me,liveCostPrefs:he,onLiveCostPrefs:P,quotasStale:w,balanceStale:b}),(W!==null||it!==null)&&(0,m.jsx)(Dr,{hit:W??it,config:tt,t:L,onDismiss:()=>{rt(null),at(null)}})]})}function ga(e){return(0,m.jsx)(`div`,{className:B.nativeSettingsRoot,"data-testid":`native-billing-settings`,children:(0,m.jsx)(ha,{...e,renderSlot:()=>null,wide:!0,embeddedSettings:!0})})}function _a(e,t){if(t===void 0||e?.bySession===void 0)return 0;let n=e.bySession.find(e=>e.id===t);return(n?.cost??0)+(n?.subCost??0)}function va(e,t){return t===void 0||e?.bySession===void 0?0:e.bySession.find(e=>e.id===t)?.subCost??0}function ya(e,t){if(t===void 0||e?.byTurn===void 0)return 0;let n=0,r=-1;for(let i of e.byTurn)i.sessionId===t&&(r===-1||i.turn>r)&&(r=i.turn,n=i.cost);return n}function ba(e,t=20){let n=[];for(let r of e)if(r.status===`ok`)for(let e of r.windows)e.remainingPercent>t||n.push({name:r.displayName,kind:e.kind,pct:e.remainingPercent});return n.sort((e,t)=>e.pct-t.pct).slice(0,3)}function xa(e,t){if(t===void 0||e?.byTurn===void 0)return;let n=-1,r;for(let i of e.byTurn)i.sessionId===t&&(n===-1||i.turn>n)&&(n=i.turn,r=i.model);return r}async function Sa(){try{let e=await _i(`/api/billing/usage-stats`);if(!e.ok)return null;let t=await e.text(),n=JSON.parse(t);if(typeof n!=`object`||!n)return null;let r=n;return{...Array.isArray(r.bySession)?{bySession:r.bySession}:{},...Array.isArray(r.byTurn)?{byTurn:r.byTurn}:{}}}catch{return null}}async function Ca(){try{let e=await _i(`/api/billing/subscriptions`);if(!e.ok)return[];let t=JSON.parse(await e.text());if(typeof t!=`object`||!t||!(`quotas`in t))return[];let n=t.quotas;return Array.isArray(n)?n:[]}catch{return[]}}function wa(e){switch(e){case`session`:return`subscriptionSession`;case`weekly`:return`subscriptionWeekly`;case`monthly`:return`subscriptionMonthly`;default:return`subscriptionBilling`}}function Ta(e){return!e.running&&!e.promptAttempted&&(e.blank||e.awaitingFirstTurn)}function Ea({hasBandPlan:e}){let[t,n]=(0,d.useState)(()=>Ce()),[r,i]=(0,d.useState)(()=>Date.now());if((0,d.useEffect)(()=>{let e=()=>{n(Ce())};window.addEventListener(F,e),window.addEventListener(`storage`,e);let t=setInterval(()=>{i(Date.now())},3e4);return()=>{window.removeEventListener(F,e),window.removeEventListener(`storage`,e),clearInterval(t)}},[]),t.length===0)return null;let a=wr().leadMin*6e4,o=t.map(t=>({key:t,state:sr(Pt(r,Nt(t,e)),a)})).filter(e=>e.state!==null);return o.length===0?null:(0,m.jsx)(`span`,{className:B.bandDots,"data-testid":`billing-pinned-dots`,children:o.map(e=>(0,m.jsx)(`span`,{className:y(B.bandDot,B.bandDotOn,B[e.state]),role:`img`,"aria-label":e.key,title:e.key},e.key))})}function Da(){let[e,t]=(0,d.useState)(()=>xe());return(0,d.useEffect)(()=>{let e=()=>{t(xe())};return window.addEventListener(be,e),window.addEventListener(`storage`,e),()=>{window.removeEventListener(be,e),window.removeEventListener(`storage`,e)}},[]),e}function Oa(){let[e,t]=(0,d.useState)(()=>_e().show),[n,r]=(0,d.useState)(()=>_e().position);return(0,d.useEffect)(()=>{let e=()=>{t(_e().show),r(_e().position)};return window.addEventListener(ge,e),window.addEventListener(`storage`,e),()=>{window.removeEventListener(ge,e),window.removeEventListener(`storage`,e)}},[]),{visible:e,position:n}}function ka(e,t){let[n,r]=(0,d.useState)(null),[i,a]=(0,d.useState)([]),[o,s]=(0,d.useState)(()=>Date.now()),[c,l]=(0,d.useState)(()=>typeof document>`u`||!document.hidden);(0,d.useEffect)(()=>{if(typeof document>`u`)return;let e=()=>{l(!document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}},[]),(0,d.useEffect)(()=>{if(!c||!t)return;let e=!1,n=!1,i=()=>{n||(n=!0,e||s(Date.now()),Promise.all([Sa(),Ca()]).then(([t,n])=>{e||(t!==null&&r(t),a(n))}).catch(()=>{}).finally(()=>{n=!1}))};i();let o=setInterval(i,3e4);return()=>{e=!0,clearInterval(o)}},[e,c,t]);let u=(0,d.useMemo)(()=>_a(n,e),[n,e]),f=(0,d.useMemo)(()=>va(n,e),[n,e]),p=(0,d.useMemo)(()=>ya(n,e),[n,e]),m=(0,d.useMemo)(()=>ba(i),[i]),h=(0,d.useMemo)(()=>Nt(xa(n,e),i.some(e=>e.displayName===`Z.ai Coding Plan`&&e.status===`ok`)),[n,e,i]);return{sessionCost:u,subCost:f,turnCost:p,tier:(0,d.useMemo)(()=>Pt(o,h),[o,h]),chips:m,hasBandPlan:i.some(e=>e.displayName===`Z.ai Coding Plan`&&e.status===`ok`)}}function Aa({sessionId:e,t,seat:n,session:r}){let{visible:i,position:a}=Oa(),o=i&&a===n&&!(n===`above`&&r!==void 0&&Ta(r)),{sessionCost:s,subCost:c,turnCost:l,tier:u,chips:d,hasBandPlan:f}=ka(e,o),p=Da(),h=e=>dn(un(e,p),p),g=s>0||l>0,_=u?.tier===`peak`;return o?(0,m.jsxs)(`span`,{className:n===`above`?y(B.feeBar,B.feeBarAbove):B.feeBar,"data-testid":`billing-live-cost-bar`,"data-seat":n,children:[(0,m.jsx)(Ea,{hasBandPlan:f}),u!==null&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:_?B.feeChipPrimary:B.feeChipOff,"data-testid":`billing-live-tier`,children:t(_?`tierPeak`:`tierOff`)}),(0,m.jsx)(`span`,{className:B.feeCount,children:It(u.nextSwitchInMs)}),(0,m.jsx)(`span`,{className:B.feeSuffix,children:t(_?`tierToOff`:`tierToPeak`)})]}),g&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:B.feeSep,"aria-hidden":`true`,children:`·`}),(0,m.jsxs)(`span`,{className:B.feeItem,"data-testid":`billing-live-turn`,children:[t(`liveTurn`),` `,(0,m.jsx)(`span`,{className:B.feeNum,"data-tick":`turn`,children:h(l)})]}),(0,m.jsx)(`span`,{className:B.feeSep,"aria-hidden":`true`,children:`·`}),(0,m.jsxs)(`span`,{className:B.feeItem,"data-testid":`billing-live-session`,children:[t(`liveSession`),` `,(0,m.jsx)(`span`,{className:B.feeNum,"data-tick":`session`,children:h(s)}),c>0&&(0,m.jsx)(`span`,{className:B.feeSuffix,"data-testid":`billing-live-session-sub`,children:t(`liveSessionSub`).replace(`{cost}`,h(c))})]})]}),d.map(e=>(0,m.jsxs)(`span`,{children:[(0,m.jsx)(`span`,{className:B.feeSep,"aria-hidden":`true`,children:`·`}),(0,m.jsxs)(`span`,{className:e.pct<=10?B.feeChipError:B.feeChipAlert,"data-testid":`billing-live-quota`,children:[e.name,` `,t(wa(e.kind)),` `,e.pct,`%`]})]},`${e.name}:${e.kind}`))]}):null}function ja({sessionId:e,t}){let n=Da(),r=e=>dn(un(e,n),n),{visible:i,position:a}=Oa(),{sessionCost:o,subCost:s,turnCost:c,tier:l,chips:u,hasBandPlan:d}=ka(e,i&&a===`toolbar`);if(!i||a!==`toolbar`)return null;let f=l?.tier===`peak`,h=u.reduce((e,t)=>Math.min(e,t.pct),100),g=h<=10?B.feeInlineError:h<=20?B.feeInlineAlert:void 0,_=y(B.feeInline,g),v=[...l===null?[]:[`${It(l.nextSwitchInMs)} ${t(f?`tierToOff`:`tierToPeak`)}`],`${t(`liveTurn`)} ${r(c)}`,`${t(`liveSession`)} ${r(o)}`,...s>0?[t(`liveSessionSub`).replace(`{cost}`,r(s))]:[],...u.map(e=>`${e.name} ${t(wa(e.kind))} ${e.pct}%`)].join(` · `);return(0,m.jsx)(p.Tooltip,{label:v,side:`top`,delayMs:500,children:(0,m.jsxs)(`span`,{className:_,"data-testid":`billing-live-cost-chip`,role:`note`,"aria-label":v,children:[(0,m.jsx)(Ea,{hasBandPlan:d}),l!==null&&(0,m.jsx)(`span`,{className:f?B.feeChipPrimary:B.feeChipOff,"data-testid":`billing-live-tier`,children:t(f?`tierPeak`:`tierOff`)}),o>0&&(0,m.jsx)(`span`,{className:B.feeInlineNum,children:r(o)})]})})}let Ma=`@kenz1117/dsh-ui-usage-billing/TaskQueueQuick.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(Ma)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@kenz1117/dsh-ui-usage-billing`,e.dataset.pluginCss=Ma,e.textContent=`.HRJ8EG_quickQueue{white-space:nowrap;flex-shrink:0;align-self:center;align-items:center;gap:6px;display:inline-flex;position:relative}.HRJ8EG_quickQueueToggle,.HRJ8EG_quickQueueButton{border:1px solid var(--dsw-alias-border-l1);min-height:24px;color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;background:0 0;border-radius:999px;justify-content:center;align-items:center;gap:5px;padding:0 8px;font-size:11px;line-height:18px;display:inline-flex}.HRJ8EG_quickQueueToggle:hover,.HRJ8EG_quickQueueButton:hover:not(:disabled){border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary)}.HRJ8EG_quickQueueToggle[aria-checked=true]{border-color:color-mix(in srgb, var(--ds-blue) 45%, transparent);background:color-mix(in srgb, var(--ds-blue) 10%, transparent);color:var(--ds-blue)}.HRJ8EG_quickQueueButton:focus-visible,.HRJ8EG_quickQueueToggle:focus-visible,.HRJ8EG_quickQueueClear input:focus-visible{outline:2px solid var(--ds-blue);outline-offset:2px}.HRJ8EG_quickQueueButton:disabled{cursor:wait;opacity:.65}.HRJ8EG_quickQueueClear{color:var(--dsw-alias-label-tertiary);cursor:pointer;align-items:center;gap:4px;font-size:11px;display:inline-flex}.HRJ8EG_quickQueueClear input{width:13px;height:13px;accent-color:var(--ds-blue);margin:0}.HRJ8EG_quickQueueCount{background:color-mix(in srgb, var(--ds-blue) 14%, transparent);min-width:16px;height:16px;color:var(--ds-blue);font-variant-numeric:tabular-nums;border-radius:999px;justify-content:center;align-items:center;padding:0 4px;font-size:10px;display:inline-flex}.HRJ8EG_quickQueueNotice{z-index:30;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-3);width:max-content;max-width:min(320px,75vw);color:var(--dsw-alias-label-primary);white-space:normal;pointer-events:none;border-radius:8px;padding:7px 10px;font-size:12px;line-height:18px;position:absolute;bottom:calc(100% + 8px);right:0;box-shadow:0 8px 24px #00000038}.HRJ8EG_quickQueueNotice[data-kind=error]{border-color:color-mix(in srgb, var(--ds-red) 45%, transparent);color:var(--ds-red)}`,document.head.appendChild(e)}var Na={quickQueue:`HRJ8EG_quickQueue`,quickQueueButton:`HRJ8EG_quickQueueButton`,quickQueueClear:`HRJ8EG_quickQueueClear`,quickQueueCount:`HRJ8EG_quickQueueCount`,quickQueueNotice:`HRJ8EG_quickQueueNotice`,quickQueueToggle:`HRJ8EG_quickQueueToggle`};let Pa=()=>void 0,Fa=()=>void 0;function Ia(e){return e.tasks.filter(e=>e.status===`queued`).length}function La(){let[e,t]=(0,d.useState)(()=>Ye());return(0,d.useEffect)(()=>{let e=()=>{t(Ye())};return window.addEventListener(Je,e),window.addEventListener(`storage`,e),()=>{window.removeEventListener(Je,e),window.removeEventListener(`storage`,e)}},[]),e}function Ra(e){let[t,n]=(0,d.useState)(null),[r,i]=(0,d.useState)(()=>typeof document>`u`||!document.hidden),a=(0,d.useRef)(0),o=(0,d.useCallback)(e=>{a.current+=1,n(Ia(e))},[]);return(0,d.useEffect)(()=>{if(typeof document>`u`)return;let e=()=>{i(!document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e)}},[]),(0,d.useEffect)(()=>{if(!e||!r){n(null);return}let t=!1,i=!1,o=()=>{if(i)return;i=!0;let e=a.current;Ji().then(r=>{t||e!==a.current||n(r.supported?r.queuedCount:null)}).catch(()=>{}).finally(()=>{i=!1})};o();let s=window.setInterval(o,3e4);return()=>{t=!0,window.clearInterval(s)}},[e,r]),{count:t,applySnapshot:o}}function za({t:e}){let t=La();return(0,m.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t.enabled,"aria-label":e(`quickQueueToggle`),className:Na.quickQueueToggle,"data-testid":`quick-queue-toggle`,onClick:()=>{Xe({...t,enabled:!t.enabled})},children:e(`quickQueueToggle`)})}function Ba(e,t){let n=e(t),r=(0,d.useCallback)(e=>n?.subscribe(e)??(()=>{}),[n]),i=(0,d.useCallback)(()=>n?.getSnapshot(),[n]);return(0,d.useSyncExternalStore)(r,i,i)}function Va({sessionId:e,t,useInput:n,inputActions:r,projectionFaceOf:i}){let a=La(),o=(n??Pa)(e=>e),s=Ba(i??Fa,`workingDirectory`),c=Ba(i??Fa,`modelSelection`)?.next,{count:l,applySnapshot:u}=Ra(a.enabled),[f,p]=(0,d.useState)(!1),[h,g]=(0,d.useState)(null),_=(0,d.useRef)(!1),v=(0,d.useRef)(!0),y=(0,d.useRef)({sessionId:e,input:o});if(y.current={sessionId:e,input:o},(0,d.useEffect)(()=>(v.current=!0,()=>{v.current=!1}),[]),(0,d.useEffect)(()=>{if(h===null)return;let e=h.kind===`success`?4e3:8e3,t=window.setTimeout(()=>{g(null)},e);return()=>{window.clearTimeout(t)}},[h]),!a.enabled)return null;let b=e=>{g({kind:`error`,text:e})},x=async()=>{if(_.current)return;if(g(null),o===void 0){b(t(`quickQueueUnsupported`));return}let n=o.draft;if(n.trim()===``){b(t(`quickQueueEmpty`));return}if(o.phase!==`plain`){b(t(`quickQueueBusy`));return}if(o.attachmentIds.length>0||o.occurrences.length>0){b(t(`quickQueueAttachments`));return}if(typeof s!=`string`||s===``){b(t(`quickQueueContext`));return}let i=a.clearAfterEnqueue;if(i&&r===void 0){b(t(`quickQueueUnsupported`));return}let l={sessionId:e,prompt:n,draftRev:o.draftRev,cwd:s,clearAfterEnqueue:i};_.current=!0,p(!0);try{let e=await qi(!0);if(!e.supported){b(t(`quickQueueUnsupported`));return}let n=c??e.defaultModel;if(n==null){b(t(`quickQueueContext`));return}let i=e.workspaces.some(e=>e.path===l.cwd),a=e.models.some(e=>e.provider===n.provider&&e.id===n.model);if(!i||!a){b(t(`quickQueueRoute`));return}let o=await Yi({action:`enqueue`,prompt:l.prompt,cwd:l.cwd,provider:n.provider,model:n.model});u(o);let s=t(`quickQueueEnqueued`);if(l.clearAfterEnqueue&&r!==void 0){let e=y.current;if(v.current&&e.sessionId===l.sessionId&&e.input?.draft===l.prompt&&e.input.draftRev===l.draftRev&&e.input.phase===`plain`&&e.input.attachmentIds.length===0&&e.input.occurrences.length===0)try{r.setDraft(``)}catch{s=t(`quickQueueDraftChanged`)}else s=t(`quickQueueDraftChanged`)}v.current&&g({kind:`success`,text:s})}catch(e){if(!v.current)return;let n=e instanceof Error?e.message:String(e);b(t(`quickQueueFailed`).replace(`{message}`,n))}finally{_.current=!1,v.current&&p(!1)}};return(0,m.jsxs)(`span`,{className:Na.quickQueue,"data-testid":`quick-queue-controls`,children:[(0,m.jsxs)(`label`,{className:Na.quickQueueClear,children:[(0,m.jsx)(`input`,{type:`checkbox`,checked:a.clearAfterEnqueue,disabled:f,onChange:e=>{Xe({...a,clearAfterEnqueue:e.target.checked})}}),t(`quickQueueClear`)]}),(0,m.jsxs)(`button`,{type:`button`,className:Na.quickQueueButton,"aria-label":t(`quickQueueEnqueue`),"aria-busy":f,disabled:f,"data-testid":`quick-queue-enqueue`,onClick:()=>{x()},children:[t(f?`quickQueueEnqueueing`:`quickQueueEnqueue`),l!==null&&l>0&&(0,m.jsx)(`span`,{className:Na.quickQueueCount,"data-testid":`quick-queue-count`,"aria-label":t(`quickQueueWaiting`).replace(`{count}`,String(l)),children:l})]}),h!==null&&(0,m.jsx)(`span`,{className:Na.quickQueueNotice,"data-kind":h.kind,role:h.kind===`error`?`alert`:`status`,children:h.text})]})}function Ha(){let e,t,n=new Set;return{readCosts:()=>e,subscribeCosts:t=>(t(e),n.add(t),()=>{n.delete(t)}),openDashboard:()=>{t?.()},publishCosts:t=>{e=t;for(let e of n)try{e(t)}catch{x(`billing-costs-listener-threw`)}},registerOpen:e=>(t=e,()=>{t===e&&(t=void 0)})}}let Ua={enabled:!1,timeout:0};function Wa(){try{let e=localStorage.getItem(`dsh-billing-completion-notify-v1`);if(e===null)return{...Ua};let t=JSON.parse(e);return{enabled:t.enabled===!0,timeout:typeof t.timeout==`number`?t.timeout:0}}catch{return{...Ua}}}function Ga(e){return e.completed===!0||e.running===!1}function Ka(e,t){let n=new Set,r=new Set,i,a=e.getSnapshot();for(let e of a.ids){let t=a.byId[e];t!==void 0&&(r.add(String(e)),Ga(t)&&n.add(String(e)))}let o=e=>{let{enabled:n,timeout:r}=t();if(n&&!(typeof Notification>`u`)&&Notification.permission===`granted`)try{let t=new Notification(e,{body:e,tag:`dsh-billing-completion`,requireInteraction:r===0});r>0&&(i!==void 0&&clearTimeout(i),i=setTimeout(()=>t.close(),r*1e3))}catch{x(`notification-constructor-failed`)}},s=e.subscribe(()=>{let t=e.getSnapshot(),i=[];for(let e of t.ids){let a=t.byId[e];if(a===void 0)continue;let o=String(e),s=Ga(a),c=!r.has(o);c&&r.add(o),s&&!c&&!n.has(o)&&i.push(a.title??a.id??o),s?n.add(o):n.delete(o)}if(i.length>0){let e=i.length===1?i[0]:`${i.length} 个会话已完成`;e!==void 0&&o(e)}});return()=>{s(),i!==void 0&&clearTimeout(i)}}function qa(e){let t=e.get(`uiWorkspace`);if(t!==void 0&&typeof t.openSession==`function`)return t}function Ja(e){let t=e.sessions,n=t?.open;return typeof n==`function`?n.bind(t):void 0}function Ya(e){return{available:()=>qa(e)!==void 0||Ja(e)!==void 0,open:t=>{let n=_(t),r=qa(e);if(r!==void 0)try{return r.openSession(n),`opened`}catch(e){return x(`session-navigation-open-failed`,e),`failed`}let i=Ja(e);if(i!==void 0)try{return i(n),`opened`}catch(e){return x(`session-navigation-legacy-open-failed`,e),`failed`}return`unavailable`}}}function Xa(e,t){let n=e.get(`commandUi`);if(n===void 0||typeof n.register!=`function`)return!1;let r={name:`usage`,label:t.label,description:t.description,available:()=>!0,ui:{kind:`action`,run:()=>{t.openDashboard()}}};try{n.register(r)}catch(e){return x(`usage-command-register-failed`,e),!1}return!0}let Za=[`slots`,`locale`,`remote`,`sessions`];function Qa(e){let t=Ha();e.provide(`billingMetrics`,t);let n=or();e.effect(()=>e.locale.register(V,{zh:H,en:Qe}),`ui-usage-billing: dictionaries`);let r=Ya(e),i=Xa(e,{openDashboard:()=>{t.openDashboard()},label:()=>je()===`en`?Qe.commandUsageLabel:H.commandUsageLabel,description:()=>je()===`en`?Qe.commandUsageDescription:H.commandUsageDescription}),a=!1,o={store:n,inject:()=>({checkModels:async()=>{try{let[t,n]=await Promise.all([e.remote.llm.listProviders(),e.remote.llm.listConfigurableProviders()]);if(!t.ok||!n.ok)return{checked:!0,available:!1,models:0,failures:0,okProviders:[],badProviders:[]};let r=new Map(n.value.map(e=>[e.provider,e])),i=await Promise.all(t.value.map(async t=>{let n=r.get(t.id);if(n===void 0)return{provider:t,models:[]};let i=await e.remote.llm.discoverModels(n.settingsNs,{provider:t.id});return i.ok?{provider:t,models:i.value}:{provider:t,failed:!0}})),a=[],o=[],s=[],c=0;for(let e of i){if(`failed`in e){s.push(e.provider.name);continue}o.push(e.provider.name),c+=e.models.length;for(let t of e.models)a.push({id:t.id,...typeof t.name==`string`&&t.name!==``?{name:t.name}:{},provider:e.provider.name})}return{checked:!0,available:o.length>0,models:c,failures:s.length,okProviders:o,badProviders:s,catalog:a}}catch{return{checked:!1,available:!1,models:0,failures:0,okProviders:[],badProviders:[]}}},publishCosts:e=>{t.publishCosts(e)},registerOpen:e=>t.registerOpen(e),recoveryEntryAvailable:i||a,navigateToSession:e=>r.open(e)})};e.slots.inject(`settings.section`,()=>{a=!0;let t=e.slots.register({name:`settings.section`,id:`usage-billing`,order:30,label:()=>je()===`en`?Qe.nativeSettingsNav:H.nativeSettingsNav,locale:V,...o},ga);return()=>{a=!1,t()}}),e.slots.inject(`sidebar.footer.action`,()=>e.slots.register({name:`sidebar.footer.action`,id:`usage-billing`,order:-10,locale:V,...o,children:{"billing.dashboard.decor":{kind:`list`,scope:`root`}}},ha)),e.slots.inject(`conversation.composer.dock`,()=>e.slots.register({name:`conversation.composer.dock`,id:`usage-billing-cost`,order:0,locale:V,inject:e=>({sessionId:_(e),seat:`below`})},Aa)),e.slots.inject(`conversation.input.dock`,()=>e.slots.register({name:`conversation.input.dock`,id:`usage-billing-cost-above`,order:100,locale:V,inject:e=>({sessionId:_(e),seat:`above`})},Aa)),e.slots.inject(`conversation.input.right`,()=>e.slots.register({name:`conversation.input.right`,id:`usage-billing-cost-chip`,order:0,locale:V,inject:e=>({sessionId:_(e)})},ja)),e.slots.inject(`conversation.input.left`,()=>e.slots.register({name:`conversation.input.left`,id:`usage-billing-quick-queue-toggle`,order:20,locale:V},za)),e.slots.inject(`conversation.input.right`,()=>e.slots.register({name:`conversation.input.right`,id:`usage-billing-quick-queue-enqueue`,order:20,locale:V,inject:t=>({sessionId:_(t),projectionFaceOf:n=>{try{return e.sessions.binding?.(_(t))?.session.projections.faceOf(n)}catch{return}}})},Va)),e.effect(()=>Ka(e.sessions.list,Wa),`ui-usage-billing: completion notifier`)}return n.UsageBilling=ha,n.apply=Qa,n.inject=Za,t.exports}});
6
6
  //# sourceMappingURL=client.js.map