@roastcodes/ttdash 6.2.1 → 6.2.3
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/dist/assets/AnimatedBarFill-DFAXO-3i.js +1 -0
- package/dist/assets/{AnomalyDetection-BdGl1xvC.js → AnomalyDetection-DKM--5-J.js} +1 -1
- package/dist/assets/{AutoImportModal-bokip1Pn.js → AutoImportModal-Cqefa6n_.js} +1 -1
- package/dist/assets/CacheROI-BLADEjtP.js +1 -0
- package/dist/assets/ChartCard-DxxB4rGm.js +2 -0
- package/dist/assets/ChartLegend-Vpk95i3r.js +1 -0
- package/dist/assets/CorrelationAnalysis-CI9eGa8R.js +1 -0
- package/dist/assets/CostByModelOverTime-BDvnsdLO.js +1 -0
- package/dist/assets/{CostByWeekday-X20qjGNA.js → CostByWeekday-BPU1qW5f.js} +1 -1
- package/dist/assets/CostForecast-fwd7SRIn.js +1 -0
- package/dist/assets/CumulativeCost-CwiklwFD.js +1 -0
- package/dist/assets/{CustomTooltip-CBVU1pyK.js → CustomTooltip-CfoUDPbT.js} +1 -1
- package/dist/assets/DistributionAnalysis-B8pjQMNj.js +1 -0
- package/dist/assets/{DrillDownModal-BXf7B9B8.js → DrillDownModal-kczVCwfa.js} +1 -1
- package/dist/assets/{HelpPanel-HNxQElT5.js → HelpPanel-D4zNwrI2.js} +1 -1
- package/dist/assets/{InfoButton-CTgLGzb9.js → InfoButton-BGjUQfHz.js} +1 -1
- package/dist/assets/InfoHeading-BxLyydv8.js +1 -0
- package/dist/assets/{MetricCard-Drluz0b9.js → MetricCard-r_uhdKDU.js} +1 -1
- package/dist/assets/{ModelEfficiency-CZ4ZzDtA.js → ModelEfficiency-Di3fDAn7.js} +1 -1
- package/dist/assets/{ModelMix-TDHxSk5H.js → ModelMix-BgCzWf9V.js} +1 -1
- package/dist/assets/{PeriodComparison-B9WuoaCr.js → PeriodComparison-BIoF7n2v.js} +1 -1
- package/dist/assets/{ProviderEfficiency-DpDIYr_l.js → ProviderEfficiency-BFUYfBkW.js} +1 -1
- package/dist/assets/ProviderLimitsSection-BxaczEFO.js +1 -0
- package/dist/assets/RecentDays-Bac6HOtv.js +1 -0
- package/dist/assets/RequestCacheHitRateByModel-DD2j4dXY.js +1 -0
- package/dist/assets/RequestQuality-CUy5BQzj.js +1 -0
- package/dist/assets/RequestsOverTime-Bv3riiRF.js +1 -0
- package/dist/assets/SettingsModal-4uENZ87D.js +1 -0
- package/dist/assets/TokenEfficiency-6dfn-4_1.js +1 -0
- package/dist/assets/TokenTypes-Dx67irJb.js +1 -0
- package/dist/assets/TokensOverTime-C1858Oi-.js +1 -0
- package/dist/assets/{app-settings-C3i52ycx.js → app-settings-BInClAwB.js} +1 -1
- package/dist/assets/button-CRvPoJg9.js +1 -0
- package/dist/assets/card-B4CVYJDH.js +1 -0
- package/dist/assets/chart-theme-BdE8bEiN.js +1 -0
- package/dist/assets/{constants-jyhBMReu.js → constants-BDzjWFuU.js} +1 -1
- package/dist/assets/{dialog-C0AeNKs8.js → dialog-Djogwk0C.js} +1 -1
- package/dist/assets/{formatted-value-rO0EpKbc.js → formatted-value-CpLoDrYF.js} +1 -1
- package/dist/assets/{formatters-yKppUXb3.js → formatters-C7EouP6y.js} +1 -1
- package/dist/assets/help-content-B2N8SHIE.js +1 -0
- package/dist/assets/i18n-BS3-GJaA.js +1 -0
- package/dist/assets/index-8kk0H-lQ.css +2 -0
- package/dist/assets/index-C59tb1_V.js +3 -0
- package/dist/assets/motion-vendor-BNVN-Ktr.js +9 -0
- package/dist/assets/{section-header-DbV45zH5.js → section-header-Dz0QIE6e.js} +1 -1
- package/dist/assets/{ui-vendor-BolBXLiD.js → ui-vendor-C_SJC6eX.js} +1 -1
- package/dist/assets/useTranslation-0ThAx3Gl.js +1 -0
- package/dist/index.html +25 -24
- package/package.json +1 -1
- package/server.js +7 -0
- package/src/locales/de/common.json +10 -0
- package/src/locales/en/common.json +10 -0
- package/dist/assets/CacheROI-IyVKLGZu.js +0 -1
- package/dist/assets/ChartCard-CBUnItl-.js +0 -2
- package/dist/assets/ChartLegend-B64cJdDI.js +0 -1
- package/dist/assets/CorrelationAnalysis-Dnd0YUCO.js +0 -1
- package/dist/assets/CostByModelOverTime-C10Hr2xR.js +0 -1
- package/dist/assets/CostForecast-C--EIZ4B.js +0 -1
- package/dist/assets/CumulativeCost-D9v6GDcr.js +0 -1
- package/dist/assets/DistributionAnalysis-Cdly0pAu.js +0 -1
- package/dist/assets/InfoHeading-oi90uCR7.js +0 -1
- package/dist/assets/ProviderLimitsSection-CSuisho_.js +0 -1
- package/dist/assets/RecentDays-Cz4Yd_-Q.js +0 -1
- package/dist/assets/RequestCacheHitRateByModel-5bkvg7Hx.js +0 -1
- package/dist/assets/RequestQuality-iUIOJrpr.js +0 -1
- package/dist/assets/RequestsOverTime-D10OssgN.js +0 -1
- package/dist/assets/SettingsModal-D9-T5heB.js +0 -1
- package/dist/assets/TokenEfficiency-CGeyr8Zq.js +0 -1
- package/dist/assets/TokenTypes-BiRBF9VP.js +0 -1
- package/dist/assets/TokensOverTime-DeT3D-aC.js +0 -1
- package/dist/assets/button-D--hHeVj.js +0 -1
- package/dist/assets/card-h-Z9EWBl.js +0 -1
- package/dist/assets/chart-theme-D5iCFDJg.js +0 -1
- package/dist/assets/help-content-Bt5KCpWS.js +0 -1
- package/dist/assets/i18n-C88wS2Uy.js +0 -1
- package/dist/assets/index-DjMakAzD.js +0 -3
- package/dist/assets/index-DuoM1Ukq.css +0 -2
- package/dist/assets/motion-vendor-vKc6gXHZ.js +0 -1
- package/dist/assets/useTranslation-BSl7t2D6.js +0 -1
- /package/dist/assets/{calculations-GOdNqKo6.js → calculations-BJw_4KdI.js} +0 -0
- /package/dist/assets/{provider-limits-5e1fUwPl.js → provider-limits-BgKrr7k7.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{w as t}from"./charts-vendor-CiBqdKXh.js";import{a as n}from"./motion-vendor-BNVN-Ktr.js";import{o as r,t as i}from"./useTranslation-0ThAx3Gl.js";import{h as a,i as o,l as s,n as c,u as l}from"./formatters-C7EouP6y.js";import{tt as u}from"./icons-vendor-CIvT_-Pb.js";import{t as d}from"./button-CRvPoJg9.js";import{c as f,i as p,n as m,r as h,t as g}from"./model-utils-BIvGAFGz.js";import{a as _,i as v,n as y,t as b}from"./card-B4CVYJDH.js";import{t as x}from"./formatted-value-CpLoDrYF.js";import{n as S}from"./help-content-B2N8SHIE.js";import{t as C}from"./InfoHeading-BxLyydv8.js";import{t as w}from"./AnimatedBarFill-DFAXO-3i.js";var T=e(t()),E=n(),D=30,O=120;function k(e){return Math.min(D+O,e)}function A(e,t,n){let r=k(e);if(t(r),r>=e)return null;let i=()=>{t(t=>{if(t>=e)return t;let r=Math.min(t+O,e);return r<e&&n(i),r})};return n(i)}function j(e){return e.modelBreakdowns.map(e=>({name:f(e.modelName),provider:h(e.modelName)})).filter((e,t,n)=>n.findIndex(t=>t.name===e.name&&t.provider===e.provider)===t)}function M(e){let t=new Map,n=0,r=0;for(let i=0;i<e.length;i+=1){let a=e[i];if(!a)continue;if(i>7){let t=e[i-8];t&&(n-=t.totalCost,r-=t.requestCount)}if(i>0){let t=e[i-1];t&&(n+=t.totalCost,r+=t.requestCount)}let o=i>0?e[i-1]:null,s=Math.min(i,7),c=o&&o.totalCost>0?(a.totalCost-o.totalCost)/o.totalCost*100:null;t.set(a.date,{...c===null?{}:{prevCostDelta:c},...s>0?{avgCost7:n/s}:{},...s>0?{avgRequests7:r/s}:{}})}return t}function N(e,t){if(e)return{contentVisibility:`auto`,containIntrinsicSize:t}}function P({data:e,onClickDay:t,viewMode:n=`daily`}){let{t:f}=i(),[h,O]=(0,T.useState)(!1),[k,P]=(0,T.useState)(`date`),[F,I]=(0,T.useState)(!1),[L,R]=(0,T.useState)(D),[,z]=(0,T.useTransition)(),B=(0,T.useMemo)(()=>{let t=[...e];return t.sort((e,t)=>{switch(k){case`date`:return F?e.date.localeCompare(t.date):t.date.localeCompare(e.date);case`cost`:return F?e.totalCost-t.totalCost:t.totalCost-e.totalCost;case`tokens`:return F?e.totalTokens-t.totalTokens:t.totalTokens-e.totalTokens;case`costPerM`:{let n=e.totalTokens>0?e.totalCost/(e.totalTokens/1e6):0,r=t.totalTokens>0?t.totalCost/(t.totalTokens/1e6):0;return F?n-r:r-n}}}),t},[e,k,F]);(0,T.useEffect)(()=>{if(!h){R(D);return}if(typeof window>`u`){R(B.length);return}let e=A(B.length,R,window.requestAnimationFrame);return()=>{e!==null&&window.cancelAnimationFrame(e)}},[h,B.length]);let V=(0,T.useMemo)(()=>h?B.slice(0,L):B.slice(0,D),[h,B,L]),H=(0,T.useMemo)(()=>[...e].sort((e,t)=>e.date.localeCompare(t.date)),[e]),U=(0,T.useMemo)(()=>M(H),[H]),W=(0,T.useMemo)(()=>Math.max(...e.map(e=>e.totalCost),0),[e]),G=(0,T.useMemo)(()=>{if(e.length===0)return null;let t=0,n=0,r=0,i=0,a=null;for(let o of e)t+=o.totalCost,n+=o.totalTokens,r+=o.requestCount,i+=o.cacheReadTokens,(!a||o.totalCost>a.totalCost)&&(a=o);let o=n>0?i/n*100:0;return{totalCost:t,totalTokens:n,totalRequests:r,cacheShare:o,top:a}},[e]),K=(0,T.useMemo)(()=>V.map(e=>({day:e,benchmark:U.get(e.date),costPerM:e.totalTokens>0?e.totalCost/(e.totalTokens/1e6):0,uniqueModels:j(e)})),[U,V]),q=e=>{z(()=>{e===k?I(!F):(P(e),I(!1))})},J=e=>k===e?F?`ascending`:`descending`:`none`,Y=(0,T.useCallback)((e,n)=>{t&&(e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),t(n)))},[t]);return(0,E.jsxs)(b,{children:[(0,E.jsxs)(v,{className:`flex flex-row items-center justify-between`,children:[(0,E.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,E.jsx)(C,{info:S.recentDays,children:(0,E.jsx)(_,{className:`text-sm font-medium text-muted-foreground`,children:f(n===`monthly`?`tables.recentDays.monthsDetail`:n===`yearly`?`tables.recentDays.yearsDetail`:`tables.recentDays.daysDetail`)})}),(0,E.jsx)(`span`,{className:`text-xs text-muted-foreground/70`,children:f(`tables.recentDays.showing`,{shown:V.length,total:B.length,unit:a(n,!0)})})]}),B.length>D&&(0,E.jsx)(d,{variant:`ghost`,size:`sm`,onClick:()=>z(()=>{O(e=>!e)}),children:f(h?`tables.recentDays.showLess`:`tables.recentDays.showAll`)})]}),(0,E.jsxs)(y,{children:[G&&(0,E.jsxs)(`div`,{className:`mb-3 grid grid-cols-2 gap-2 lg:grid-cols-5`,children:[(0,E.jsxs)(`div`,{className:`rounded-lg border border-border/50 bg-muted/15 px-3 py-2`,children:[(0,E.jsx)(`div`,{className:`text-[10px] tracking-[0.14em] text-muted-foreground uppercase`,children:f(`tables.recentDays.totalCost`)}),(0,E.jsx)(`div`,{className:`mt-1 text-sm font-medium`,children:(0,E.jsx)(x,{value:G.totalCost,type:`currency`})})]}),(0,E.jsxs)(`div`,{className:`rounded-lg border border-border/50 bg-muted/15 px-3 py-2`,children:[(0,E.jsx)(`div`,{className:`text-[10px] tracking-[0.14em] text-muted-foreground uppercase`,children:f(`tables.recentDays.totalTokens`)}),(0,E.jsx)(`div`,{className:`mt-1 text-sm font-medium`,children:(0,E.jsx)(x,{value:G.totalTokens,type:`tokens`})})]}),(0,E.jsxs)(`div`,{className:`rounded-lg border border-border/50 bg-muted/15 px-3 py-2`,children:[(0,E.jsx)(`div`,{className:`text-[10px] tracking-[0.14em] text-muted-foreground uppercase`,children:f(`tables.recentDays.requests`)}),(0,E.jsx)(`div`,{className:`mt-1 text-sm font-medium`,children:(0,E.jsx)(x,{value:G.totalRequests,type:`number`})})]}),(0,E.jsxs)(`div`,{className:`rounded-lg border border-border/50 bg-muted/15 px-3 py-2`,children:[(0,E.jsx)(`div`,{className:`text-[10px] tracking-[0.14em] text-muted-foreground uppercase`,children:f(`tables.recentDays.cacheReadShare`)}),(0,E.jsx)(`div`,{className:`mt-1 text-sm font-medium`,children:l(G.cacheShare,1)})]}),(0,E.jsxs)(`div`,{className:`rounded-lg border border-border/50 bg-muted/15 px-3 py-2`,children:[(0,E.jsx)(`div`,{className:`text-[10px] tracking-[0.14em] text-muted-foreground uppercase`,children:f(`tables.recentDays.peak`)}),(0,E.jsx)(`div`,{className:`mt-1 text-sm font-medium`,children:G.top?o(G.top.date):`–`}),(0,E.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:G.top?c(G.top.totalCost):`–`})]})]}),h&&L<B.length&&(0,E.jsx)(`div`,{className:`mb-3 text-xs text-muted-foreground`,children:f(`tables.recentDays.showing`,{shown:L,total:B.length,unit:a(n,!0)})}),(0,E.jsx)(`div`,{className:`grid gap-2 md:hidden`,children:K.map(({day:e,benchmark:i,costPerM:a,uniqueModels:l})=>(0,E.jsxs)(`button`,{onClick:()=>t?.(e.date),className:`rounded-xl border border-border/50 bg-muted/10 p-3 text-left`,style:N(h,`220px`),children:[(0,E.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`font-medium`,children:o(e.date,`long`)}),(0,E.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[s(e.requestCount),` `,f(`common.requests`)]})]}),(0,E.jsxs)(`div`,{className:`text-right`,children:[(0,E.jsx)(`div`,{className:`font-mono font-semibold`,children:(0,E.jsx)(x,{value:e.totalCost,type:`currency`,interactive:!1})}),(0,E.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:(0,E.jsx)(x,{value:e.totalTokens,type:`tokens`,interactive:!1})}),n===`daily`&&i?.prevCostDelta!==void 0&&(0,E.jsxs)(`div`,{className:`mt-1 text-[10px] text-muted-foreground`,children:[f(`tables.recentDays.previousDay`),` `,i.prevCostDelta>=0?`↑`:`↓`,Math.abs(i.prevCostDelta).toFixed(0),`%`]})]})]}),(0,E.jsxs)(`div`,{className:`mt-3 grid grid-cols-3 gap-2 text-xs`,children:[(0,E.jsxs)(`div`,{className:`rounded-lg bg-muted/20 px-2.5 py-2`,children:[(0,E.jsx)(`div`,{className:`text-muted-foreground`,children:f(`common.input`)}),(0,E.jsx)(`div`,{className:`mt-1 font-mono`,children:(0,E.jsx)(x,{value:e.inputTokens,type:`tokens`,interactive:!1})})]}),(0,E.jsxs)(`div`,{className:`rounded-lg bg-muted/20 px-2.5 py-2`,children:[(0,E.jsx)(`div`,{className:`text-muted-foreground`,children:f(`common.output`)}),(0,E.jsx)(`div`,{className:`mt-1 font-mono`,children:(0,E.jsx)(x,{value:e.outputTokens,type:`tokens`,interactive:!1})})]}),(0,E.jsxs)(`div`,{className:`rounded-lg bg-muted/20 px-2.5 py-2`,children:[(0,E.jsx)(`div`,{className:`text-muted-foreground`,children:`$/1M`}),(0,E.jsx)(`div`,{className:`mt-1 font-mono`,children:(0,E.jsx)(x,{value:a,type:`currency`,interactive:!1})})]})]}),(0,E.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-1.5`,children:[l.slice(0,4).map(({name:e,provider:t})=>(0,E.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] leading-tight font-medium`,style:{backgroundColor:m(e,.16),color:g(e)},children:[(0,E.jsx)(`span`,{children:e}),(0,E.jsx)(`span`,{className:r(`inline-flex items-center rounded-full border px-1 py-0.5 text-[9px] leading-none`,p(t)),children:t})]},`${e}-${t}`)),l.length>4&&(0,E.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-border/50 px-2 py-0.5 text-[10px] text-muted-foreground`,children:f(`tables.modelEfficiency.more`,{count:l.length-4})})]}),n===`daily`&&i?.avgCost7!==void 0&&(0,E.jsxs)(`div`,{className:`mt-3 text-[10px] text-muted-foreground`,children:[f(`tables.recentDays.avg7d`),` `,c(i.avgCost7),` ·`,` `,f(`tables.recentDays.reqAvg`),` `,i.avgRequests7?.toFixed(0)??`–`]})]},e.date))}),(0,E.jsx)(`div`,{className:`hidden overflow-x-auto md:block`,children:(0,E.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,E.jsx)(`thead`,{className:`sticky top-0 z-10 bg-card`,children:(0,E.jsxs)(`tr`,{className:`border-b border-border`,children:[(0,E.jsx)(`th`,{"aria-sort":J(`date`),className:r(`px-2 py-2 text-left text-xs font-medium`,k===`date`?`text-foreground`:`text-muted-foreground`),children:(0,E.jsxs)(`button`,{type:`button`,onClick:()=>q(`date`),className:`inline-flex items-center gap-1 rounded-sm transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,children:[f(`tables.recentDays.date`),` `,(0,E.jsx)(u,{"aria-hidden":`true`,className:r(`h-3 w-3`,k===`date`&&`text-primary`)})]})}),(0,E.jsx)(`th`,{"aria-sort":J(`cost`),className:r(`px-2 py-2 text-right text-xs font-medium`,k===`cost`?`text-foreground`:`text-muted-foreground`),children:(0,E.jsxs)(`button`,{type:`button`,onClick:()=>q(`cost`),className:`inline-flex items-center gap-1 rounded-sm transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,children:[f(`tables.recentDays.cost`),` `,(0,E.jsx)(u,{"aria-hidden":`true`,className:r(`h-3 w-3`,k===`cost`&&`text-primary`)})]})}),(0,E.jsx)(`th`,{"aria-sort":J(`tokens`),className:r(`px-2 py-2 text-right text-xs font-medium`,k===`tokens`?`text-foreground`:`text-muted-foreground`),children:(0,E.jsxs)(`button`,{type:`button`,onClick:()=>q(`tokens`),className:`inline-flex items-center gap-1 rounded-sm transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,children:[f(`tables.recentDays.tokens`),` `,(0,E.jsx)(u,{"aria-hidden":`true`,className:r(`h-3 w-3`,k===`tokens`&&`text-primary`)})]})}),(0,E.jsx)(`th`,{className:`hidden px-2 py-2 text-right text-xs font-medium text-muted-foreground md:table-cell`,children:f(`common.input`)}),(0,E.jsx)(`th`,{className:`hidden px-2 py-2 text-right text-xs font-medium text-muted-foreground md:table-cell`,children:f(`common.output`)}),(0,E.jsx)(`th`,{className:`hidden px-2 py-2 text-right text-xs font-medium text-muted-foreground lg:table-cell`,children:f(`common.cacheWrite`)}),(0,E.jsx)(`th`,{className:`hidden px-2 py-2 text-right text-xs font-medium text-muted-foreground lg:table-cell`,children:f(`common.cacheRead`)}),(0,E.jsx)(`th`,{className:`hidden px-2 py-2 text-right text-xs font-medium text-muted-foreground xl:table-cell`,children:f(`common.thinking`)}),(0,E.jsx)(`th`,{className:`hidden px-2 py-2 text-right text-xs font-medium text-muted-foreground xl:table-cell`,children:f(`common.requestsShort`)}),(0,E.jsx)(`th`,{"aria-sort":J(`costPerM`),className:r(`px-2 py-2 text-right text-xs font-medium`,k===`costPerM`?`text-foreground`:`text-muted-foreground`),children:(0,E.jsxs)(`button`,{type:`button`,onClick:()=>q(`costPerM`),className:`inline-flex items-center gap-1 rounded-sm transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none`,children:[`$/1M`,` `,(0,E.jsx)(u,{"aria-hidden":`true`,className:r(`h-3 w-3`,k===`costPerM`&&`text-primary`)})]})}),(0,E.jsx)(`th`,{className:`px-2 py-2 text-left text-xs font-medium text-muted-foreground`,children:f(`tables.recentDays.models`)})]})}),(0,E.jsx)(`tbody`,{children:K.map(({day:e,benchmark:i,costPerM:a,uniqueModels:s})=>(0,E.jsxs)(`tr`,{className:`cursor-pointer border-b border-l-[3px] border-border/50 transition-colors hover:bg-muted/10 focus-visible:bg-muted/10 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset active:bg-muted/20`,style:{borderLeftColor:`hsla(215, 70%, 55%, ${.2+(W>0?e.totalCost/W:0)*.8})`,...N(h,`52px`)},onClick:()=>t?.(e.date),onKeyDown:t=>Y(t,e.date),role:t?`button`:void 0,tabIndex:t?0:void 0,children:[(0,E.jsx)(`td`,{className:`px-2 py-2.5 whitespace-nowrap`,children:o(e.date,`long`)}),(0,E.jsxs)(`td`,{className:`relative px-2 py-2.5 text-right font-mono tabular-nums`,children:[(0,E.jsx)(w,{className:`absolute inset-y-1 left-0 rounded-sm bg-primary/8`,width:`${W>0?e.totalCost/W*100:0}%`,delayMs:140,durationMs:520}),(0,E.jsx)(`span`,{className:`relative`,children:(0,E.jsx)(x,{value:e.totalCost,type:`currency`})})]}),(0,E.jsx)(`td`,{className:`px-2 py-2.5 text-right font-mono tabular-nums`,children:(0,E.jsx)(x,{value:e.totalTokens,type:`tokens`})}),(0,E.jsx)(`td`,{className:`hidden px-2 py-2.5 text-right font-mono tabular-nums md:table-cell`,children:(0,E.jsx)(x,{value:e.inputTokens,type:`tokens`})}),(0,E.jsx)(`td`,{className:`hidden px-2 py-2.5 text-right font-mono tabular-nums md:table-cell`,children:(0,E.jsx)(x,{value:e.outputTokens,type:`tokens`})}),(0,E.jsx)(`td`,{className:`hidden px-2 py-2.5 text-right font-mono tabular-nums lg:table-cell`,children:(0,E.jsx)(x,{value:e.cacheCreationTokens,type:`tokens`})}),(0,E.jsx)(`td`,{className:`hidden px-2 py-2.5 text-right font-mono tabular-nums lg:table-cell`,children:(0,E.jsx)(x,{value:e.cacheReadTokens,type:`tokens`})}),(0,E.jsx)(`td`,{className:`hidden px-2 py-2.5 text-right font-mono tabular-nums xl:table-cell`,children:(0,E.jsx)(x,{value:e.thinkingTokens,type:`tokens`})}),(0,E.jsx)(`td`,{className:`hidden px-2 py-2.5 text-right font-mono tabular-nums xl:table-cell`,children:(0,E.jsx)(x,{value:e.requestCount,type:`number`})}),(0,E.jsx)(`td`,{className:`px-2 py-2.5 text-right font-mono tabular-nums`,children:(0,E.jsx)(x,{value:a,type:`currency`})}),(0,E.jsxs)(`td`,{className:`px-2 py-2.5`,children:[(0,E.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:s.map(({name:e,provider:t})=>(0,E.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] leading-tight font-medium`,style:{backgroundColor:m(e,.16),color:g(e)},children:[(0,E.jsx)(`span`,{children:e}),(0,E.jsx)(`span`,{className:r(`inline-flex items-center rounded-full border px-1 py-0.5 text-[9px] leading-none`,p(t)),children:t})]},`${e}-${t}`))}),n===`daily`&&i?.avgCost7!==void 0&&(0,E.jsxs)(`div`,{className:`mt-1 text-[10px] text-muted-foreground`,children:[f(`tables.recentDays.previousDay`),` `,i.prevCostDelta===void 0?`–`:`${i.prevCostDelta>=0?`↑`:`↓`}${Math.abs(i.prevCostDelta).toFixed(0)}%`,` `,`· `,f(`tables.recentDays.avg7d`),` `,c(i.avgCost7)]})]})]},e.date))})]})})]})]})}export{P as RecentDays};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{_ as t,a as n,b as r,c as i,d as a,f as o,l as s,m as c,p as l,t as u,v as d,w as f,y as p}from"./charts-vendor-CiBqdKXh.js";import{a as m}from"./motion-vendor-BNVN-Ktr.js";import{t as h}from"./useTranslation-0ThAx3Gl.js";import{a as g,g as _,u as v}from"./formatters-C7EouP6y.js";import{c as y,t as b}from"./model-utils-BIvGAFGz.js";import{t as x}from"./help-content-B2N8SHIE.js";import{a as S,i as C,n as w,o as T,r as E}from"./chart-theme-BdE8bEiN.js";import{n as D,r as O,t as k}from"./ChartCard-DxxB4rGm.js";import{t as A}from"./ChartLegend-Vpk95i3r.js";import{t as j}from"./CustomTooltip-CfoUDPbT.js";import{n as M,o as N}from"./calculations-BJw_4KdI.js";var P=e(f()),F=m();function I(e){return v(e,1)}function L(e,t,n,r,i){let a=e+t+n+r+i;return a>0?r/a*100:0}function R({timelineData:e,summaryData:f,viewMode:m}){let{t:v}=h(),R=(0,P.useId)().replace(/:/g,``),z=v(`charts.requestCacheHitRate.total`),B=`trailing7Rate`,V=v(m===`daily`?`charts.requestCacheHitRate.trailing7Rate`:`charts.requestCacheHitRate.trendRate`),H=(0,P.useMemo)(()=>M(f).map(e=>({...e,model:e.model===`Total`?z:e.model})),[f,z]),U=(0,P.useMemo)(()=>{if(H.length===0)return null;let e=H[0];return e?{total:e,topModel:H.slice(1).sort((e,t)=>t.totalRate-e.totalRate)[0]??null,dominantModel:H.slice(1).sort((e,t)=>t.totalBaseTokens-e.totalBaseTokens)[0]??null,models:Math.max(H.length-1,0)}:null},[H]),W=(0,P.useMemo)(()=>{if(e.length===0)return[];let t=H.slice(1).map(e=>e.model),n=[...e].sort((e,t)=>e.date.localeCompare(t.date)),r=n.map(e=>L(e.inputTokens,e.outputTokens,e.cacheCreationTokens,e.cacheReadTokens,e.thinkingTokens)),i=N(r,Math.min(7,n.length)),a={};for(let e of t)a[e]=[];for(let e of n){let n=new Map;for(let r of e.modelBreakdowns){let e=y(r.modelName);if(!t.includes(e))continue;let i=n.get(e)??{input:0,output:0,cacheCreate:0,cacheRead:0,thinking:0};i.input+=r.inputTokens,i.output+=r.outputTokens,i.cacheCreate+=r.cacheCreationTokens,i.cacheRead+=r.cacheReadTokens,i.thinking+=r.thinkingTokens,n.set(e,i)}for(let e of t){let t=n.get(e),r=a[e];r&&r.push(t?L(t.input,t.output,t.cacheCreate,t.cacheRead,t.thinking):0)}}return n.map((e,n)=>{let o={date:e.date,totalRate:r[n],totalRate_ma7:i[n]};for(let e of t)o[e]=a[e]?.[n]??0;return o})},[e,H]);if(!U||W.length===0)return null;let G=Math.max(220,Math.min(310,H.length*28+48)),K=Math.max(280,Math.min(420,H.length*34+56)),q=m===`daily`?280:250,J=m===`daily`?360:320,Y=Object.keys(W[0]??{}).filter(e=>e!==`date`&&e!==`totalRate`&&e!==`totalRate_ma7`),X=(0,F.jsx)(`div`,{className:`mt-6 grid grid-cols-1 gap-4 xl:grid-cols-3`,children:H.slice(0,6).map(e=>(0,F.jsxs)(`div`,{className:`rounded-lg border border-border/50 bg-muted/10 p-3`,children:[(0,F.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.model}),(0,F.jsxs)(`div`,{className:`mt-2 flex items-end gap-3`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-[10px] tracking-wider text-muted-foreground uppercase`,children:v(`charts.requestCacheHitRate.totalRate`)}),(0,F.jsx)(`div`,{className:`text-lg font-semibold tabular-nums`,children:I(e.totalRate)})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`text-[10px] tracking-wider text-muted-foreground uppercase`,children:V}),(0,F.jsx)(`div`,{className:`text-lg font-semibold tabular-nums`,children:I(e[B])})]})]})]},e.model))});return(0,F.jsx)(D,{title:v(`charts.requestCacheHitRate.title`),subtitle:v(`charts.requestCacheHitRate.subtitle`,{total:I(U.total.totalRate),trailing:I(U.total[B])}),info:x.requestCacheHitRate,chartData:H,valueKey:`totalRate`,valueFormatter:I,expandedExtra:X,children:e=>{let f=e?8:6;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`mb-3 grid grid-cols-2 gap-2 text-center md:grid-cols-4`,children:[(0,F.jsxs)(`div`,{className:`rounded-lg bg-muted/20 p-2`,children:[(0,F.jsx)(`div`,{className:`text-[9px] tracking-wider text-muted-foreground uppercase`,children:v(`charts.requestCacheHitRate.totalRate`)}),(0,F.jsx)(`div`,{className:`text-sm font-semibold tabular-nums`,children:I(U.total.totalRate)})]}),(0,F.jsxs)(`div`,{className:`rounded-lg bg-muted/20 p-2`,children:[(0,F.jsx)(`div`,{className:`text-[9px] tracking-wider text-muted-foreground uppercase`,children:V}),(0,F.jsx)(`div`,{className:`text-sm font-semibold tabular-nums`,children:I(U.total[B])})]}),(0,F.jsxs)(`div`,{className:`rounded-lg bg-muted/20 p-2`,children:[(0,F.jsx)(`div`,{className:`text-[9px] tracking-wider text-muted-foreground uppercase`,children:v(`charts.requestCacheHitRate.topModel`)}),(0,F.jsx)(`div`,{className:`truncate text-sm font-semibold`,children:U.topModel?.model??`–`})]}),(0,F.jsxs)(`div`,{className:`rounded-lg bg-muted/20 p-2`,children:[(0,F.jsx)(`div`,{className:`text-[9px] tracking-wider text-muted-foreground uppercase`,children:v(`charts.requestCacheHitRate.models`)}),(0,F.jsx)(`div`,{className:`text-sm font-semibold tabular-nums`,children:U.models})]})]}),(0,F.jsxs)(`div`,{className:`grid gap-4 ${e?`grid-cols-1 xl:grid-cols-[2fr_1fr]`:`grid-cols-1 lg:grid-cols-[2fr_1fr]`}`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`mb-2 text-[10px] tracking-wider text-muted-foreground uppercase`,children:v(`charts.requestCacheHitRate.timelineHeading`,{unit:_(m)})}),(0,F.jsx)(k,{children:t=>(0,F.jsx)(O,{variant:`line`,children:(0,F.jsx)(r,{width:`100%`,height:e?J:q,children:(0,F.jsxs)(u,{data:W,margin:E,children:[(0,F.jsx)(`defs`,{children:(0,F.jsxs)(`linearGradient`,{id:`${R}-total-rate`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:w.cost,stopOpacity:.24}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:w.cost,stopOpacity:0})]})}),(0,F.jsx)(c,{strokeDasharray:`3 3`,stroke:w.grid,opacity:.3}),(0,F.jsx)(s,{dataKey:`date`,tickFormatter:g,stroke:w.axis,fontSize:11,tickLine:!1}),(0,F.jsx)(i,{type:`number`,domain:[0,100],tickFormatter:I,stroke:w.axis,fontSize:11,tickLine:!1,axisLine:!1}),(0,F.jsx)(d,{content:(0,F.jsx)(j,{formatter:e=>I(e),pinnedEntryNames:[v(`charts.requestCacheHitRate.totalRate`)],showComputedTotal:!1,hideZeroValues:!0}),cursor:{fill:`hsl(var(--muted))`,opacity:.12}}),(0,F.jsx)(p,{content:(0,F.jsx)(A,{})}),(0,F.jsx)(o,{type:`monotone`,dataKey:`totalRate`,stroke:w.cost,fill:`url(#${R}-total-rate)`,name:v(`charts.requestCacheHitRate.totalRate`),strokeWidth:2,dot:!1,activeDot:{r:5,strokeWidth:2,stroke:w.cost,fill:`hsl(var(--background))`},...C(t)}),(0,F.jsx)(l,{type:`monotone`,dataKey:`totalRate_ma7`,stroke:w.ma7,name:V,dot:!1,strokeWidth:2,strokeDasharray:`5 5`,connectNulls:!0,...T(t,{role:`secondary`})}),Y.map((e,n)=>(0,F.jsx)(l,{type:`monotone`,dataKey:e,stroke:b(e),name:e,dot:!1,strokeWidth:1.8,connectNulls:!0,...T(t,{order:n+2,role:`secondary`})},e))]})})})})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`div`,{className:`mb-2 text-[10px] tracking-wider text-muted-foreground uppercase`,children:v(`charts.requestCacheHitRate.modelBreakdownHeading`)}),(0,F.jsx)(k,{children:o=>(0,F.jsx)(O,{variant:`line`,children:(0,F.jsx)(r,{width:`100%`,height:e?K:G,children:(0,F.jsxs)(n,{data:H,layout:`vertical`,margin:{...E,left:e?30:20,right:8},barCategoryGap:e?14:10,barSize:f,maxBarSize:f,children:[(0,F.jsx)(c,{strokeDasharray:`3 3`,stroke:w.grid,opacity:.22,horizontal:!1}),(0,F.jsx)(s,{type:`number`,domain:[0,100],tickFormatter:I,stroke:w.axis,fontSize:10,tickLine:!1,axisLine:!1}),(0,F.jsx)(i,{type:`category`,dataKey:`model`,stroke:w.axis,fontSize:10,tickLine:!1,axisLine:!1,width:e?126:108}),(0,F.jsx)(d,{content:(0,F.jsx)(j,{formatter:e=>I(e),pinnedEntryNames:[v(`charts.requestCacheHitRate.totalRate`),V],showComputedTotal:!1}),cursor:{fill:`hsl(var(--muted))`,opacity:.12}}),(0,F.jsx)(p,{content:(0,F.jsx)(A,{})}),(0,F.jsx)(a,{dataKey:`totalRate`,name:v(`charts.requestCacheHitRate.totalRate`),radius:[0,4,4,0],fill:w.cacheRead,...S(o),children:H.map(e=>(0,F.jsx)(t,{fill:e.model===z?w.cost:w.cacheRead,fillOpacity:e.model===z?.95:.82},`${e.model}-total`))}),(0,F.jsx)(a,{dataKey:B,name:V,radius:[0,4,4,0],fill:w.ma7,...S(o,1),children:H.map(e=>(0,F.jsx)(t,{fill:e.model===z?w.cumulative:w.ma7,fillOpacity:e.model===z?.95:.8},`${e.model}-recent`))})]})})})})]})]})]})}})}export{R as RequestCacheHitRateByModel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./motion-vendor-BNVN-Ktr.js";import{t}from"./useTranslation-0ThAx3Gl.js";import{d as n,l as r,n as i,u as a}from"./formatters-C7EouP6y.js";import{a as o,i as s,n as c,t as l}from"./card-B4CVYJDH.js";import{n as u}from"./help-content-B2N8SHIE.js";import{t as d}from"./InfoHeading-BxLyydv8.js";import{t as f}from"./AnimatedBarFill-DFAXO-3i.js";var p=e();function m({metrics:e,viewMode:m}){let{t:h}=t(),g=e.totalRequests>0?e.totalCacheRead/e.totalRequests:0,_=e.totalRequests>0?e.totalThinking/e.totalRequests:0,v=e.totalOutput>0?e.totalInput/e.totalOutput:0,y=e.activeDays>0?e.totalRequests/e.activeDays:0,b=[{label:h(`requestQuality.tokensPerRequest`),value:e.hasRequestData?n(e.avgTokensPerRequest):h(`common.notAvailable`),accent:`var(--chart-2)`,hint:h(`requestQuality.tokensHint`),progress:Math.min(e.avgTokensPerRequest/2e5,1)},{label:h(`requestQuality.costPerRequest`),value:e.hasRequestData?i(e.avgCostPerRequest):h(`common.notAvailable`),accent:`var(--chart-4)`,hint:h(`requestQuality.costHint`),progress:Math.min(e.avgCostPerRequest/.25,1)},{label:h(`requestQuality.cachePerRequest`),value:e.hasRequestData?n(g):h(`common.notAvailable`),accent:`var(--chart-1)`,hint:h(`requestQuality.cacheHint`),progress:Math.min(g/2e5,1)},{label:h(`requestQuality.thinkingPerRequest`),value:e.hasRequestData?n(_):h(`common.notAvailable`),accent:`var(--chart-5)`,hint:h(`requestQuality.thinkingHint`),progress:Math.min(_/1e4,1)}];return(0,p.jsxs)(l,{className:`overflow-visible`,children:[(0,p.jsx)(s,{children:(0,p.jsx)(d,{info:u.requestQuality,children:(0,p.jsx)(o,{className:`text-sm font-medium text-muted-foreground`,children:h(`requestQuality.title`)})})}),(0,p.jsxs)(c,{className:`space-y-4`,children:[(0,p.jsx)(`div`,{className:`grid grid-cols-2 gap-3 xl:grid-cols-4`,children:b.map((t,n)=>(0,p.jsxs)(`div`,{className:`rounded-xl border border-border/50 bg-muted/15 p-3`,children:[(0,p.jsx)(`div`,{className:`text-[10px] tracking-[0.14em] text-muted-foreground uppercase`,children:t.label}),(0,p.jsx)(`div`,{className:`mt-1 text-lg font-semibold tabular-nums`,children:t.value}),(0,p.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:t.hint}),(0,p.jsx)(`div`,{className:`mt-3 h-1.5 overflow-hidden rounded-full bg-muted/40`,children:(0,p.jsx)(f,{className:`h-full rounded-full`,order:n,style:{backgroundColor:`hsl(${t.accent})`},width:e.hasRequestData&&t.progress>0?`${Math.max(t.progress*100,6)}%`:`0%`})})]},t.label))}),(0,p.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-4`,children:[(0,p.jsxs)(`div`,{className:`rounded-xl border border-border/50 bg-gradient-to-br from-primary/[0.12] via-transparent to-transparent p-4`,children:[(0,p.jsx)(`div`,{className:`text-[10px] tracking-[0.14em] text-muted-foreground uppercase`,children:h(`requestQuality.requestDensity`)}),(0,p.jsx)(`div`,{className:`mt-1 text-xl font-semibold tabular-nums`,children:r(Math.round(y))}),(0,p.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:h(`requestQuality.averagePerActiveUnit`,{unit:h(m===`yearly`?`periods.year`:m===`monthly`?`periods.month`:`periods.day`)})})]}),(0,p.jsxs)(`div`,{className:`rounded-xl border border-border/50 bg-gradient-to-br from-chart-3/[0.12] via-transparent to-transparent p-4`,children:[(0,p.jsx)(`div`,{className:`text-[10px] tracking-[0.14em] text-muted-foreground uppercase`,children:h(`requestQuality.cacheHitRate`)}),(0,p.jsx)(`div`,{className:`mt-1 text-xl font-semibold tabular-nums`,children:a(e.cacheHitRate,1)}),(0,p.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:h(`requestQuality.cacheHitHint`)})]}),(0,p.jsxs)(`div`,{className:`rounded-xl border border-border/50 bg-gradient-to-br from-chart-4/[0.12] via-transparent to-transparent p-4`,children:[(0,p.jsx)(`div`,{className:`text-[10px] tracking-[0.14em] text-muted-foreground uppercase`,children:h(`requestQuality.inputOutput`)}),(0,p.jsxs)(`div`,{className:`mt-1 text-xl font-semibold tabular-nums`,children:[v.toFixed(2),`:1`]}),(0,p.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:h(`requestQuality.inputOutputHint`)})]}),(0,p.jsxs)(`div`,{className:`rounded-xl border border-border/50 bg-gradient-to-br from-chart-5/[0.12] via-transparent to-transparent p-4`,children:[(0,p.jsx)(`div`,{className:`text-[10px] tracking-[0.14em] text-muted-foreground uppercase`,children:h(`requestQuality.topRequestModel`)}),(0,p.jsx)(`div`,{className:`mt-1 truncate text-lg font-semibold`,children:e.topRequestModel?.name??`–`}),(0,p.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.topRequestModel?`${r(e.topRequestModel.requests)} ${h(`common.requests`)}`:h(`requestQuality.noRequestLeader`)})]})]})]})]})}export{m as RequestQuality};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{_ as t,b as n,c as r,f as i,g as a,i as o,l as s,m as c,p as l,t as u,v as d,w as f,y as p}from"./charts-vendor-CiBqdKXh.js";import{a as m}from"./motion-vendor-BNVN-Ktr.js";import{t as h}from"./useTranslation-0ThAx3Gl.js";import{a as g,g as _}from"./formatters-C7EouP6y.js";import{r as v}from"./i18n-BS3-GJaA.js";import{t as y}from"./model-utils-BIvGAFGz.js";import{t as b}from"./formatted-value-CpLoDrYF.js";import{t as x}from"./help-content-B2N8SHIE.js";import{i as S,n as C,o as w,r as T,s as E}from"./chart-theme-BdE8bEiN.js";import{n as D,r as O,t as k}from"./ChartCard-DxxB4rGm.js";import{t as A}from"./ChartLegend-Vpk95i3r.js";import{t as j}from"./CustomTooltip-CfoUDPbT.js";var M=e(f()),N=m();function P(e){return new Intl.NumberFormat(v(),{notation:e>=1e4?`compact`:`standard`,maximumFractionDigits:+(e>=1e4)}).format(e)}function F({viewBox:e,total:t}){let{t:n}=h();if(!e)return null;let{cx:r,cy:i}=e;return(0,N.jsxs)(`g`,{children:[(0,N.jsx)(`text`,{x:r,y:i-6,textAnchor:`middle`,className:`fill-muted-foreground`,fontSize:11,children:n(`charts.requestsOverTime.total`)}),(0,N.jsx)(`text`,{x:r,y:i+14,textAnchor:`middle`,className:`fill-foreground`,fontSize:16,fontWeight:600,children:t})]})}function I({data:e,viewMode:f=`daily`,onClickDay:m}){let{t:v}=h(),I=(0,M.useId)().replace(/:/g,``),L=v(`charts.requestsOverTime.averagePerUnit`,{unit:_(f)}),R=v(f===`daily`?`charts.requestsOverTime.movingAverage`:`charts.requestsOverTime.trend`),z=v(f===`daily`?`charts.requestsOverTime.movingAverageHeading`:`charts.requestsOverTime.trendHeading`),B=(0,M.useMemo)(()=>{if(e.length===0)return null;let t=new Map;for(let n of e)for(let[e,r]of Object.entries(n))e===`date`||e===`totalRequests`||e===`totalRequestsMA7`||e===`totalRequestsPrev`||e.endsWith(`_ma7`)||e.endsWith(`Prev`)||typeof r==`number`&&t.set(e,(t.get(e)??0)+r);let n=Array.from(t.entries()).sort((e,t)=>t[1]-e[1]),r=e.reduce((e,t)=>e+t.totalRequests,0),i=[...e].sort((e,t)=>t.totalRequests-e.totalRequests)[0];return i?{totalRequests:r,peak:i,topModels:n}:null},[e]),V=(0,M.useMemo)(()=>(B?.topModels??[]).slice(0,5).map(([e])=>e),[B]),H=(0,M.useMemo)(()=>(B?.topModels??[]).map(([e,t])=>({name:e,value:t})),[B]),U=e=>{let t=e;t?.activePayload?.[0]?.payload?.date&&m&&m(t.activePayload[0].payload.date)},W=(0,N.jsx)(k,{children:t=>(0,N.jsxs)(`div`,{className:`mt-6 space-y-5`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`mb-2 text-[10px] tracking-wider text-muted-foreground uppercase`,children:z}),(0,N.jsx)(O,{variant:`line`,children:(0,N.jsx)(n,{width:`100%`,height:360,children:(0,N.jsxs)(u,{data:e,margin:T,children:[(0,N.jsx)(c,{strokeDasharray:`3 3`,stroke:C.grid,opacity:.3}),(0,N.jsx)(s,{dataKey:`date`,tickFormatter:g,stroke:C.axis,fontSize:11,tickLine:!1}),(0,N.jsx)(r,{tickFormatter:P,stroke:C.axis,fontSize:11,tickLine:!1,axisLine:!1}),(0,N.jsx)(d,{content:(0,N.jsx)(j,{formatter:e=>P(e)}),cursor:{stroke:`hsl(var(--muted))`,strokeWidth:1}}),(0,N.jsx)(p,{content:(0,N.jsx)(A,{})}),(0,N.jsx)(l,{type:`monotone`,dataKey:`totalRequestsMA7`,stroke:C.ma7,name:v(`charts.requestsOverTime.totalMovingAverage`,{label:R}),dot:!1,strokeWidth:2.5,strokeDasharray:`6 4`,connectNulls:!0,...w(t,{role:`secondary`})}),(B?.topModels??[]).map(([e],n)=>(0,N.jsx)(l,{type:`monotone`,dataKey:`${e}_ma7`,stroke:y(e),name:`${e} ${R}`,dot:!1,strokeWidth:2,strokeDasharray:`5 4`,connectNulls:!0,...w(t,{order:n%6,role:`secondary`})},`${e}_ma7`))]})})})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`mb-2 text-[10px] tracking-wider text-muted-foreground uppercase`,children:v(`charts.requestsOverTime.requestsByModelTotal`)}),(0,N.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3`,children:(B?.topModels??[]).map(([e,t])=>{let n=B&&B.totalRequests>0?t/B.totalRequests*100:0;return(0,N.jsxs)(`div`,{className:`rounded-lg border border-border/50 bg-muted/10 p-3`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,N.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,N.jsx)(`span`,{className:`h-2.5 w-2.5 shrink-0 rounded-full`,style:{backgroundColor:y(e)}}),(0,N.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e})]}),(0,N.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[n.toFixed(1),`%`]})]}),(0,N.jsx)(`div`,{className:`mt-2 text-lg font-semibold tabular-nums`,children:P(t)}),(0,N.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:v(`charts.requestsOverTime.requestsInRange`)})]},e)})})]})]})});return(0,N.jsx)(D,{title:v(`charts.requestsOverTime.title`),subtitle:B?v(`charts.requestsOverTime.summary`,{total:P(B.totalRequests),peak:P(B.peak.totalRequests),date:g(B.peak.date)}):v(`charts.requestsOverTime.subtitle`),info:x.requestsOverTime,summary:B?(0,N.jsx)(b,{value:B.totalRequests,type:`number`}):void 0,chartData:e,valueKey:`totalRequests`,valueFormatter:P,expandedExtra:W,children:f=>{let m=f?420:320,h=f?440:340,_=f?70:54,b=f?112:82,x=f?`48%`:`46%`;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`div`,{className:`mb-3 grid grid-cols-2 gap-2 text-center md:grid-cols-4`,children:[(0,N.jsxs)(`div`,{className:`rounded-lg bg-muted/20 p-2`,children:[(0,N.jsx)(`div`,{className:`text-[9px] tracking-wider text-muted-foreground uppercase`,children:v(`charts.requestsOverTime.total`)}),(0,N.jsx)(`div`,{className:`text-sm font-semibold tabular-nums`,children:B?P(B.totalRequests):`0`})]}),(0,N.jsxs)(`div`,{className:`rounded-lg bg-muted/20 p-2`,children:[(0,N.jsx)(`div`,{className:`text-[9px] tracking-wider text-muted-foreground uppercase`,children:L}),(0,N.jsx)(`div`,{className:`text-sm font-semibold tabular-nums`,children:B&&e.length>0?P(B.totalRequests/e.length):`0`})]}),(0,N.jsxs)(`div`,{className:`rounded-lg bg-muted/20 p-2`,children:[(0,N.jsx)(`div`,{className:`text-[9px] tracking-wider text-muted-foreground uppercase`,children:v(`charts.requestsOverTime.topModel`)}),(0,N.jsx)(`div`,{className:`truncate text-sm font-semibold`,children:B?.topModels[0]?.[0]??`–`})]}),(0,N.jsxs)(`div`,{className:`rounded-lg bg-muted/20 p-2`,children:[(0,N.jsx)(`div`,{className:`text-[9px] tracking-wider text-muted-foreground uppercase`,children:v(`charts.requestsOverTime.topShare`)}),(0,N.jsx)(`div`,{className:`text-sm font-semibold tabular-nums`,children:B&&B.totalRequests>0&&B.topModels[0]?`${(B.topModels[0][1]/B.totalRequests*100).toFixed(1)}%`:`–`})]})]}),(0,N.jsxs)(`div`,{className:`grid gap-4 ${f?`grid-cols-1 xl:grid-cols-3`:`grid-cols-1 lg:grid-cols-3`}`,children:[(0,N.jsx)(`div`,{className:f?`xl:col-span-2`:`lg:col-span-2`,children:(0,N.jsx)(k,{children:t=>(0,N.jsx)(O,{variant:`line`,children:(0,N.jsx)(n,{width:`100%`,height:m,children:(0,N.jsxs)(u,{data:e,margin:T,onClick:U,children:[(0,N.jsx)(`defs`,{children:(0,N.jsxs)(`linearGradient`,{id:`${I}-requests`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,N.jsx)(`stop`,{offset:`0%`,stopColor:C.cumulative,stopOpacity:.28}),(0,N.jsx)(`stop`,{offset:`100%`,stopColor:C.cumulative,stopOpacity:0})]})}),(0,N.jsx)(c,{strokeDasharray:`3 3`,stroke:C.grid,opacity:.3}),(0,N.jsx)(s,{dataKey:`date`,tickFormatter:g,stroke:C.axis,fontSize:11,tickLine:!1}),(0,N.jsx)(r,{tickFormatter:P,stroke:C.axis,fontSize:11,tickLine:!1,axisLine:!1}),(0,N.jsx)(d,{content:(0,N.jsx)(j,{formatter:e=>P(e),pinnedEntryNames:[v(`charts.requestsOverTime.totalRequestsSeries`)],showComputedTotal:!1}),cursor:{fill:`hsl(var(--muted))`,opacity:.12}}),(0,N.jsx)(p,{content:(0,N.jsx)(A,{})}),(0,N.jsx)(i,{type:`monotone`,dataKey:`totalRequests`,stroke:C.cumulative,fill:`url(#${I}-requests)`,name:v(`charts.requestsOverTime.totalRequestsSeries`),strokeWidth:1.8,dot:!1,activeDot:{r:5,strokeWidth:2,stroke:C.cumulative,fill:`hsl(var(--background))`},...S(t)}),(0,N.jsx)(l,{type:`monotone`,dataKey:`totalRequestsMA7`,stroke:C.ma7,name:R,dot:!1,strokeWidth:2.2,strokeDasharray:`5 5`,connectNulls:!0,...w(t,{role:`secondary`})}),V.map((e,n)=>(0,N.jsx)(l,{type:`monotone`,dataKey:e,stroke:y(e),name:e,dot:!1,strokeWidth:1.6,...w(t,{order:n%5+1})},e))]})})})})}),(0,N.jsx)(`div`,{className:`min-w-0 pt-1`,children:(0,N.jsx)(k,{children:e=>(0,N.jsx)(O,{variant:`radial`,children:(0,N.jsx)(n,{width:`100%`,height:h,children:(0,N.jsxs)(o,{children:[(0,N.jsxs)(a,{data:H,cx:`50%`,cy:x,innerRadius:_,outerRadius:b,paddingAngle:2,dataKey:`value`,nameKey:`name`,...E(e),children:[H.map(e=>(0,N.jsx)(t,{fill:y(e.name)},e.name)),(0,N.jsx)(F,{total:B?P(B.totalRequests):`0`})]}),(0,N.jsx)(d,{content:(0,N.jsx)(j,{formatter:e=>P(e)})}),(0,N.jsx)(p,{content:(0,N.jsx)(A,{className:f?`pt-[18px]`:`pt-2`,renderLabel:e=>{let t=String(e.value??``),n=H.find(e=>e.name===t);return`${t} (${n?P(n.value):``})`}})})]})})})})})]})]})}})}export{I as RequestsOverTime};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{w as t}from"./charts-vendor-CiBqdKXh.js";import{a as n}from"./motion-vendor-BNVN-Ktr.js";import{o as r,t as i}from"./useTranslation-0ThAx3Gl.js";import{s as a}from"./formatters-C7EouP6y.js";import{t as o}from"./i18n-BS3-GJaA.js";import{I as s,N as ee,O as te,P as c,S as ne,et as re,h as l,k as ie,r as u,rt as ae,w as oe}from"./icons-vendor-CIvT_-Pb.js";import{t as d}from"./button-CRvPoJg9.js";import{i as f}from"./model-utils-BIvGAFGz.js";import{a as se,i as ce,n as le,r as ue,t as de}from"./dialog-Djogwk0C.js";import{a as fe,c as p,i as pe,l as m,o as me,s as h,t as g}from"./app-settings-BInClAwB.js";import{n as he}from"./help-content-B2N8SHIE.js";import{t as ge}from"./InfoHeading-BxLyydv8.js";import{a as _,t as v}from"./provider-limits-BgKrr7k7.js";var y=e(t()),b=n();function x(e){let t=e.replace(`,`,`.`).trim();if(!t)return 0;let n=Number.parseFloat(t);return Number.isFinite(n)?Math.max(0,Number(n.toFixed(2))):0}function S(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function C(e){return[...new Set(e.map(e=>e.trim()).filter(Boolean))].sort((e,t)=>e.localeCompare(t))}function _e(e,t){let n={};for(let r of e)n[r]=t[r]??{...v};return n}function w(e,t,n){let r=e.indexOf(t),i=r+n;if(r<0||i<0||i>=e.length)return e;let a=[...e],[o]=a.splice(r,1);return o?(a.splice(i,0,o),a):e}function ve(e,t,n){if(t===n)return e;let r=e.indexOf(t),i=e.indexOf(n);if(r<0||i<0)return e;let a=[...e],[o]=a.splice(r,1);if(!o)return e;let s=r<i?i-1:i;return a.splice(s,0,o),a}function T({open:e,onOpenChange:t,language:n,reducedMotionPreference:T,limitProviders:E,filterProviders:ye,models:be,limits:D,defaultFilters:O,sectionVisibility:k,sectionOrder:A,lastLoadedAt:j,lastLoadSource:M,cliAutoLoadActive:xe=!1,hasData:Se,onSaveSettings:Ce,onExportSettings:we,onImportSettings:Te,onExportData:Ee,onImportData:De,settingsBusy:N=!1,dataBusy:P=!1}){let{t:F}=i(),[I,L]=(0,y.useState)(n),[R,z]=(0,y.useState)(T),[B,V]=(0,y.useState)(()=>_(E,D)),[H,U]=(0,y.useState)(O),[W,G]=(0,y.useState)(k),[K,q]=(0,y.useState)(A),[J,Y]=(0,y.useState)(null),[X,Z]=(0,y.useState)(null),Oe=(0,y.useRef)(null);(0,y.useEffect)(()=>{e&&(L(n),z(T),V(_(E,D)),U(O),G(k),q(A),Y(null),Z(null))},[e,n,T,E,D,O,k,A]);let ke=(0,y.useMemo)(()=>C([...ye,...H.providers]),[ye,H.providers]),Ae=(0,y.useMemo)(()=>C([...be,...H.models]),[be,H.models]),Q=(e,t)=>{V(n=>({...n,[e]:{...n[e]??v,...t}}))},je=async()=>{await Ce({language:I,reducedMotionPreference:R,providerLimits:_e(E,B),defaultFilters:{...H,providers:C(H.providers),models:C(H.models)},sectionVisibility:W,sectionOrder:K}),t(!1)},Me=()=>{L(g.language),z(g.reducedMotionPreference),V(_(E,{})),U(h),G(m()),q(p()),Y(null),Z(null)},Ne=()=>{U(h)},Pe=()=>{G(m()),q(p())},Fe=()=>{V(_(E,{}))},Ie=F(M?`settings.modal.sources.${M}`:`settings.modal.sources.unknown`),$=(0,y.useMemo)(()=>K.map(e=>fe[e]).filter(e=>e!==void 0),[K]);return(0,b.jsx)(de,{open:e,onOpenChange:t,children:(0,b.jsxs)(le,{className:`max-h-[88vh] max-w-5xl overflow-x-visible overflow-y-auto`,onOpenAutoFocus:e=>{e.preventDefault(),Oe.current?.focus()},children:[(0,b.jsxs)(ce,{className:`overflow-visible`,children:[(0,b.jsx)(ge,{info:he.providerLimits,children:(0,b.jsx)(se,{ref:Oe,tabIndex:-1,className:`focus:outline-none`,children:F(`settings.modal.title`)})}),(0,b.jsx)(ue,{children:F(`settings.modal.description`)})]}),(0,b.jsxs)(`div`,{className:`rounded-2xl border border-border/50 bg-muted/20 px-4 py-3`,children:[(0,b.jsx)(`div`,{className:`text-[11px] font-medium tracking-[0.14em] text-muted-foreground uppercase`,children:F(`settings.modal.dataStatus`)}),(0,b.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-3`,children:[(0,b.jsxs)(`div`,{className:`space-y-1`,children:[(0,b.jsx)(`div`,{className:`text-[11px] tracking-[0.12em] text-muted-foreground uppercase`,children:F(`settings.modal.lastLoaded`)}),(0,b.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:j?a(j):F(`common.notAvailable`)})]}),(0,b.jsxs)(`div`,{className:`space-y-1`,children:[(0,b.jsx)(`div`,{className:`text-[11px] tracking-[0.12em] text-muted-foreground uppercase`,children:F(`settings.modal.loadedVia`)}),(0,b.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:Ie})]}),(0,b.jsxs)(`div`,{className:`space-y-1`,children:[(0,b.jsx)(`div`,{className:`text-[11px] tracking-[0.12em] text-muted-foreground uppercase`,children:F(`settings.modal.cliAutoLoad`)}),(0,b.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:F(xe?`common.enabled`:`common.disabled`)})]})]})]}),(0,b.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,b.jsxs)(`div`,{className:`rounded-2xl border border-border/50 bg-card/60 p-4 backdrop-blur-xl`,children:[(0,b.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,b.jsx)(`span`,{className:`mt-0.5 inline-flex h-9 w-9 items-center justify-center rounded-xl border border-border/60 bg-muted/20 text-muted-foreground`,children:(0,b.jsx)(oe,{className:`h-4 w-4`})}),(0,b.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,b.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:F(`settings.modal.languageTitle`)}),(0,b.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:F(`settings.modal.languageDescription`)})]})]}),(0,b.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:o.map(e=>(0,b.jsx)(d,{type:`button`,"data-testid":`settings-language-${e}`,"aria-pressed":I===e,variant:I===e?`default`:`outline`,onClick:()=>L(e),children:F(`app.languages.${e}`)},e))})]}),(0,b.jsxs)(`div`,{className:`rounded-2xl border border-border/50 bg-card/60 p-4 backdrop-blur-xl`,children:[(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,b.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,b.jsx)(`span`,{className:`mt-0.5 inline-flex h-9 w-9 items-center justify-center rounded-xl border border-border/60 bg-muted/20 text-muted-foreground`,children:(0,b.jsx)(ie,{className:`h-4 w-4`})}),(0,b.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,b.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:F(`settings.modal.defaultFiltersTitle`)}),(0,b.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:F(`settings.modal.defaultFiltersDescription`)})]})]}),(0,b.jsx)(d,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`reset-default-filters`,onClick:Ne,disabled:N,children:F(`common.reset`)})]}),(0,b.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,b.jsxs)(`div`,{className:`space-y-2`,children:[(0,b.jsx)(`div`,{className:`text-[11px] font-medium tracking-[0.14em] text-muted-foreground uppercase`,children:F(`settings.modal.defaultViewMode`)}),(0,b.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:me.map(e=>(0,b.jsx)(d,{type:`button`,"aria-pressed":H.viewMode===e,variant:H.viewMode===e?`default`:`outline`,onClick:()=>U(t=>({...t,viewMode:e})),children:F(`settings.modal.viewModes.${e}`)},e))})]}),(0,b.jsxs)(`div`,{className:`space-y-2`,children:[(0,b.jsx)(`div`,{className:`text-[11px] font-medium tracking-[0.14em] text-muted-foreground uppercase`,children:F(`settings.modal.defaultDateRange`)}),(0,b.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:pe.map(e=>(0,b.jsx)(d,{type:`button`,"aria-pressed":H.datePreset===e,variant:H.datePreset===e?`default`:`outline`,onClick:()=>U(t=>({...t,datePreset:e})),children:F(`settings.modal.datePresets.${e}`)},e))})]}),(0,b.jsxs)(`div`,{className:`space-y-2`,children:[(0,b.jsx)(`div`,{className:`text-[11px] font-medium tracking-[0.14em] text-muted-foreground uppercase`,children:F(`settings.modal.filterProviders`)}),ke.length===0?(0,b.jsx)(`div`,{className:`rounded-xl border border-dashed border-border/60 bg-muted/10 px-3 py-4 text-sm text-muted-foreground`,children:F(`settings.modal.noProviders`)}):(0,b.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:ke.map(e=>{let t=H.providers.includes(e);return(0,b.jsx)(`button`,{type:`button`,"aria-pressed":t,onClick:()=>U(t=>({...t,providers:S(t.providers,e)})),className:r(`inline-flex items-center rounded-full border px-3 py-1.5 text-xs font-medium transition-colors`,t?`border-primary/30 bg-primary text-primary-foreground`:f(e)),children:e},e)})})]}),(0,b.jsxs)(`div`,{className:`space-y-2`,children:[(0,b.jsx)(`div`,{className:`text-[11px] font-medium tracking-[0.14em] text-muted-foreground uppercase`,children:F(`settings.modal.filterModels`)}),Ae.length===0?(0,b.jsx)(`div`,{className:`rounded-xl border border-dashed border-border/60 bg-muted/10 px-3 py-4 text-sm text-muted-foreground`,children:F(`settings.modal.noModels`)}):(0,b.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Ae.map(e=>{let t=H.models.includes(e);return(0,b.jsx)(`button`,{type:`button`,"aria-pressed":t,onClick:()=>U(t=>({...t,models:S(t.models,e)})),className:r(`inline-flex items-center rounded-full border px-3 py-1.5 text-xs font-medium transition-colors`,t?`border-primary/30 bg-primary text-primary-foreground`:`border-border bg-muted/20 text-muted-foreground hover:bg-accent hover:text-foreground`),children:e},e)})})]})]})]}),(0,b.jsxs)(`div`,{className:`rounded-2xl border border-border/50 bg-card/60 p-4 backdrop-blur-xl`,children:[(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,b.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,b.jsx)(`span`,{className:`mt-0.5 inline-flex h-9 w-9 items-center justify-center rounded-xl border border-border/60 bg-muted/20 text-muted-foreground`,children:(0,b.jsx)(ee,{className:`h-4 w-4`})}),(0,b.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,b.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:F(`settings.modal.sectionVisibilityTitle`)}),(0,b.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:F(`settings.modal.sectionVisibilityDescription`)})]})]}),(0,b.jsx)(d,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`reset-section-visibility`,onClick:Pe,disabled:N,children:F(`common.reset`)})]}),(0,b.jsx)(`div`,{className:`mt-3 text-xs text-muted-foreground`,children:F(`settings.modal.sectionOrderHint`)}),(0,b.jsx)(`div`,{className:`mt-4 space-y-2`,children:$.map((e,t)=>{let n=W[e.id];return(0,b.jsxs)(`div`,{"data-section-id":e.id,draggable:!0,onDragStart:t=>{t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,e.id),Y(e.id),Z(e.id)},onDragOver:t=>{t.preventDefault(),X!==e.id&&Z(e.id)},onDragLeave:()=>{X===e.id&&Z(null)},onDrop:t=>{t.preventDefault();let n=t.dataTransfer.getData(`text/plain`)||J;n&&(q(t=>ve(t,n,e.id)),Y(null),Z(null))},onDragEnd:()=>{Y(null),Z(null)},className:r(`flex items-center gap-2 rounded-xl border px-3 py-2 text-sm transition-colors`,X===e.id?`border-primary/40 bg-primary/10`:`border-border/70 bg-muted/10`,J===e.id&&`opacity-70`),children:[(0,b.jsx)(`span`,{className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-border/60 bg-background/40 text-muted-foreground`,children:(0,b.jsx)(te,{className:`h-4 w-4`})}),(0,b.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,b.jsx)(`div`,{className:`truncate font-medium text-foreground`,children:F(e.labelKey)}),(0,b.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:F(`settings.modal.positionLabel`,{position:t+1,total:$.length})})]}),(0,b.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,b.jsx)(d,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8`,"data-testid":`move-section-up-${e.id}`,onClick:()=>q(t=>w(t,e.id,-1)),disabled:t===0,"aria-label":F(`settings.modal.moveSectionUp`,{section:F(e.labelKey)}),children:(0,b.jsx)(re,{className:`h-4 w-4`})}),(0,b.jsx)(d,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8`,"data-testid":`move-section-down-${e.id}`,onClick:()=>q(t=>w(t,e.id,1)),disabled:t===$.length-1,"aria-label":F(`settings.modal.moveSectionDown`,{section:F(e.labelKey)}),children:(0,b.jsx)(ae,{className:`h-4 w-4`})}),(0,b.jsx)(`button`,{type:`button`,"data-testid":`toggle-section-visibility-${e.id}`,"aria-pressed":n,onClick:()=>G(t=>({...t,[e.id]:!t[e.id]})),className:r(`inline-flex min-w-[88px] items-center justify-center rounded-full border px-3 py-1.5 text-xs font-medium tracking-[0.12em] uppercase transition-colors`,n?`border-emerald-500/30 bg-emerald-500/10 text-foreground`:`border-border bg-muted/20 text-muted-foreground hover:bg-accent hover:text-foreground`),children:F(n?`common.visible`:`common.hidden`)})]})]},e.id)})})]}),(0,b.jsxs)(`div`,{className:`rounded-2xl border border-border/50 bg-card/60 p-4 backdrop-blur-xl`,children:[(0,b.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,b.jsx)(`span`,{className:`mt-0.5 inline-flex h-9 w-9 items-center justify-center rounded-xl border border-border/60 bg-muted/20 text-muted-foreground`,children:(0,b.jsx)(l,{className:`h-4 w-4`})}),(0,b.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,b.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:F(`settings.modal.dashboardSettingsTitle`)}),(0,b.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:F(`settings.modal.dashboardSettingsDescription`)})]})]}),(0,b.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,b.jsx)(`div`,{className:`text-[11px] font-medium tracking-[0.14em] text-muted-foreground uppercase`,children:F(`settings.modal.reducedMotionTitle`)}),(0,b.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:F(`settings.modal.reducedMotionDescription`)}),(0,b.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:[[`system`,`settings.modal.reducedMotionOptions.system`],[`always`,`settings.modal.reducedMotionOptions.always`],[`never`,`settings.modal.reducedMotionOptions.never`]].map(([e,t])=>(0,b.jsx)(d,{type:`button`,"data-testid":`settings-reduced-motion-${e}`,"aria-pressed":R===e,variant:R===e?`default`:`outline`,onClick:()=>z(e),children:F(t)},e))})]})]})]}),(0,b.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,b.jsxs)(`div`,{className:`rounded-2xl border border-border/50 bg-card/60 p-4 backdrop-blur-xl`,children:[(0,b.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,b.jsx)(`span`,{className:`mt-0.5 inline-flex h-9 w-9 items-center justify-center rounded-xl border border-border/60 bg-muted/20 text-muted-foreground`,children:(0,b.jsx)(l,{className:`h-4 w-4`})}),(0,b.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,b.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:F(`settings.modal.settingsBackupTitle`)}),(0,b.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:F(`settings.modal.settingsBackupDescription`)})]})]}),(0,b.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,b.jsxs)(d,{variant:`outline`,onClick:we,disabled:N,className:`gap-2`,children:[(0,b.jsx)(c,{className:`h-4 w-4`}),F(`settings.modal.exportSettings`)]}),(0,b.jsxs)(d,{variant:`outline`,onClick:Te,disabled:N,className:`gap-2`,children:[(0,b.jsx)(u,{className:`h-4 w-4`}),F(`settings.modal.importSettings`)]})]})]}),(0,b.jsxs)(`div`,{className:`rounded-2xl border border-border/50 bg-card/60 p-4 backdrop-blur-xl`,children:[(0,b.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,b.jsx)(`span`,{className:`mt-0.5 inline-flex h-9 w-9 items-center justify-center rounded-xl border border-border/60 bg-muted/20 text-muted-foreground`,children:(0,b.jsx)(s,{className:`h-4 w-4`})}),(0,b.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,b.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:F(`settings.modal.dataBackupTitle`)}),(0,b.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:F(`settings.modal.dataBackupDescription`)})]})]}),(0,b.jsx)(`p`,{className:`mt-3 rounded-xl border border-amber-500/20 bg-amber-500/8 px-3 py-2 text-xs leading-relaxed text-amber-200/90`,children:F(`settings.modal.dataImportPolicy`)}),(0,b.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-muted-foreground`,children:F(`settings.modal.dataImportReplaceHint`)}),(0,b.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,b.jsxs)(d,{variant:`outline`,onClick:Ee,disabled:!Se||P,className:`gap-2`,children:[(0,b.jsx)(c,{className:`h-4 w-4`}),F(`settings.modal.exportData`)]}),(0,b.jsxs)(d,{variant:`outline`,onClick:De,disabled:P,className:`gap-2`,children:[(0,b.jsx)(u,{className:`h-4 w-4`}),F(`settings.modal.importData`)]})]})]})]}),(0,b.jsxs)(`div`,{className:`rounded-2xl border border-border/50 bg-card/60 p-4 backdrop-blur-xl`,children:[(0,b.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,b.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,b.jsx)(`span`,{className:`mt-0.5 inline-flex h-9 w-9 items-center justify-center rounded-xl border border-border/60 bg-muted/20 text-muted-foreground`,children:(0,b.jsx)(ne,{className:`h-4 w-4`})}),(0,b.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,b.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:F(`settings.modal.providerLimitsTitle`)}),(0,b.jsx)(`p`,{className:`text-sm leading-relaxed text-muted-foreground`,children:F(`settings.modal.providerLimitsDescription`)})]})]}),(0,b.jsx)(d,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`reset-provider-limits`,onClick:Fe,disabled:N,children:F(`common.reset`)})]}),(0,b.jsx)(`div`,{className:`mt-4`,children:E.length===0?(0,b.jsx)(`div`,{className:`rounded-xl border border-dashed border-border/60 bg-muted/10 px-4 py-8 text-center text-sm text-muted-foreground`,children:F(`settings.modal.noProviders`)}):(0,b.jsx)(`div`,{className:`space-y-3`,children:E.map(e=>{let t=B[e]??v;return(0,b.jsx)(`div`,{"data-provider-id":e,className:`rounded-2xl border border-border/50 bg-background/40 p-4`,children:(0,b.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between`,children:[(0,b.jsx)(`div`,{className:`min-w-0`,children:(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,b.jsx)(`span`,{className:r(`inline-flex items-center rounded-full border px-2.5 py-1 text-xs font-medium`,f(e)),children:e}),(0,b.jsx)(`button`,{type:`button`,onClick:()=>Q(e,{hasSubscription:!t.hasSubscription}),className:r(`inline-flex items-center rounded-full border px-2.5 py-1 text-xs font-medium transition-colors`,t.hasSubscription?`border-emerald-500/30 bg-emerald-500/10 text-emerald-300`:`border-border bg-muted/20 text-muted-foreground hover:bg-accent`),children:t.hasSubscription?F(`common.enabled`):F(`limits.statuses.noSubscription`)})]})}),(0,b.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:w-[420px]`,children:[(0,b.jsxs)(`label`,{className:`space-y-1.5`,children:[(0,b.jsx)(`span`,{className:`text-[11px] font-medium tracking-[0.14em] text-muted-foreground uppercase`,children:F(`limits.modal.subscriptionPerMonth`)}),(0,b.jsx)(`input`,{type:`number`,min:`0`,step:`0.01`,value:t.subscriptionPrice,disabled:!t.hasSubscription,onChange:t=>Q(e,{subscriptionPrice:x(t.target.value)}),className:`h-10 w-full rounded-md border border-border bg-background px-3 text-sm disabled:cursor-not-allowed disabled:opacity-50`})]}),(0,b.jsxs)(`label`,{className:`space-y-1.5`,children:[(0,b.jsx)(`span`,{className:`text-[11px] font-medium tracking-[0.14em] text-muted-foreground uppercase`,children:F(`limits.modal.monthlyLimit`)}),(0,b.jsx)(`input`,{type:`number`,min:`0`,step:`0.01`,value:t.monthlyLimit,onChange:t=>Q(e,{monthlyLimit:x(t.target.value)}),className:`h-10 w-full rounded-md border border-border bg-background px-3 text-sm`})]})]})]})},e)})})})]}),(0,b.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-border/50 pt-4`,children:[(0,b.jsx)(d,{variant:`ghost`,onClick:Me,disabled:N,"data-testid":`reset-all-settings-drafts`,children:F(`common.reset`)}),(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(d,{variant:`ghost`,onClick:()=>t(!1),disabled:N,children:F(`settings.modal.close`)}),(0,b.jsx)(d,{onClick:()=>void je(),disabled:N,children:F(`settings.modal.save`)})]})]})]})})}export{T as SettingsModal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{b as t,c as n,f as r,h as i,l as a,m as o,p as s,t as c,v as l,w as u}from"./charts-vendor-CiBqdKXh.js";import{a as d}from"./motion-vendor-BNVN-Ktr.js";import{t as f}from"./useTranslation-0ThAx3Gl.js";import{a as p,n as m,t as h}from"./formatters-C7EouP6y.js";import{t as g}from"./help-content-B2N8SHIE.js";import{i as _,n as v,o as y,r as b}from"./chart-theme-BdE8bEiN.js";import{n as x,r as S,t as C}from"./ChartCard-DxxB4rGm.js";import{t as w}from"./CustomTooltip-CfoUDPbT.js";import{o as T}from"./calculations-BJw_4KdI.js";var E=e(u()),D=d();function O({data:e}){let{t:u}=f(),d=(0,E.useId)().replace(/:/g,``),{chartData:O,avg:k}=(0,E.useMemo)(()=>{let t=[...e].sort((e,t)=>e.date.localeCompare(t.date)),n=t.map(e=>e.totalTokens>0?e.totalCost/(e.totalTokens/1e6):0),r=T(n),i=n.length>0?n.reduce((e,t)=>e+t,0)/n.length:0;return{chartData:t.map((e,t)=>({date:e.date,efficiency:n[t],effMA7:r[t]})),avg:i}},[e]);return O.length<3?null:(0,D.jsx)(x,{title:u(`charts.tokenEfficiency.title`),subtitle:u(`charts.tokenEfficiency.subtitle`,{value:m(k)}),info:g.tokenEfficiency,chartData:O,valueKey:`efficiency`,valueFormatter:m,children:(0,D.jsx)(C,{children:e=>(0,D.jsx)(S,{variant:`line`,children:(0,D.jsx)(t,{width:`100%`,height:250,children:(0,D.jsxs)(c,{data:O,margin:b,children:[(0,D.jsx)(`defs`,{children:(0,D.jsxs)(`linearGradient`,{id:`${d}-effGrad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,D.jsx)(`stop`,{offset:`0%`,stopColor:v.input,stopOpacity:.2}),(0,D.jsx)(`stop`,{offset:`100%`,stopColor:v.input,stopOpacity:0})]})}),(0,D.jsx)(o,{strokeDasharray:`3 3`,stroke:v.grid,opacity:.3}),(0,D.jsx)(a,{dataKey:`date`,tickFormatter:p,stroke:v.axis,fontSize:11,tickLine:!1}),(0,D.jsx)(n,{tickFormatter:e=>{let t=h(e);return t===null?``:m(t)},stroke:v.axis,fontSize:11,tickLine:!1,axisLine:!1}),(0,D.jsx)(l,{content:(0,D.jsx)(w,{formatter:e=>m(e)}),cursor:{fill:`hsl(var(--muted))`,opacity:.15}}),(0,D.jsx)(i,{y:k,stroke:v.axis,strokeDasharray:`3 3`,strokeOpacity:.5}),(0,D.jsx)(r,{type:`monotone`,dataKey:`efficiency`,stroke:v.input,fill:`url(#${d}-effGrad)`,strokeWidth:1.5,name:u(`charts.tokenEfficiency.series`),dot:!1,..._(e)}),(0,D.jsx)(s,{type:`monotone`,dataKey:`effMA7`,stroke:v.ma7,strokeWidth:2,strokeDasharray:`5 5`,dot:!1,connectNulls:!0,name:u(`charts.tokenEfficiency.movingAverage`),...y(e,{role:`secondary`})})]})})})})})}export{O as TokenEfficiency};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,b as t,g as n,i as r,v as i,y as a}from"./charts-vendor-CiBqdKXh.js";import{a as o}from"./motion-vendor-BNVN-Ktr.js";import{t as s}from"./useTranslation-0ThAx3Gl.js";import{d as c}from"./formatters-C7EouP6y.js";import{t as l}from"./help-content-B2N8SHIE.js";import{n as u,s as d}from"./chart-theme-BdE8bEiN.js";import{n as f,r as p,t as m}from"./ChartCard-DxxB4rGm.js";import{t as h}from"./ChartLegend-Vpk95i3r.js";import{t as g}from"./CustomTooltip-CfoUDPbT.js";var _=o(),v={Input:u.input,Output:u.output,"Cache Write":u.cacheWrite,"Cache Read":u.cacheRead,Thinking:u.cost};function y({viewBox:e,total:t}){let{t:n}=s();if(!e)return null;let{cx:r,cy:i}=e;return(0,_.jsxs)(`g`,{children:[(0,_.jsx)(`text`,{x:r,y:i-6,textAnchor:`middle`,className:`fill-muted-foreground`,fontSize:11,children:n(`charts.tokenTypes.total`)}),(0,_.jsx)(`text`,{x:r,y:i+14,textAnchor:`middle`,className:`fill-foreground`,fontSize:16,fontWeight:600,children:t})]})}function b({data:o}){let{t:b}=s(),x=o.reduce((e,t)=>e+t.value,0);return(0,_.jsx)(f,{title:b(`charts.tokenTypes.title`),subtitle:b(`charts.tokenTypes.subtitle`),info:l.tokenTypes,chartData:o,valueKey:`value`,valueFormatter:c,children:s=>{let l=s?560:320,f=s?`66%`:`57%`,b=s?84:58,S=s?134:92;return(0,_.jsx)(m,{children:m=>(0,_.jsx)(p,{variant:`radial`,children:(0,_.jsx)(t,{width:`100%`,height:l,children:(0,_.jsxs)(r,{children:[(0,_.jsxs)(n,{data:o,cx:`50%`,cy:f,innerRadius:b,outerRadius:S,paddingAngle:2,dataKey:`value`,nameKey:`name`,...d(m),children:[o.map(t=>(0,_.jsx)(e,{fill:v[t.name]??u.cost},t.name)),(0,_.jsx)(y,{total:c(x)})]}),(0,_.jsx)(i,{content:(0,_.jsx)(g,{formatter:e=>c(e)})}),(0,_.jsx)(a,{content:(0,_.jsx)(h,{className:s?`pt-[22px]`:`pt-2`,renderLabel:e=>{let t=String(e.value??``),n=o.find(e=>e.name===t);return`${t} (${n?c(n.value):``})`}})})]})})})})}})}export{b as TokenTypes};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{b as t,c as n,f as r,l as i,m as a,p as o,t as s,v as c,w as l}from"./charts-vendor-CiBqdKXh.js";import{a as u}from"./motion-vendor-BNVN-Ktr.js";import{t as d}from"./useTranslation-0ThAx3Gl.js";import{a as f,d as p}from"./formatters-C7EouP6y.js";import{t as m}from"./formatted-value-CpLoDrYF.js";import{t as h}from"./help-content-B2N8SHIE.js";import{i as g,n as _,o as v,r as y}from"./chart-theme-BdE8bEiN.js";import{n as b,r as x,t as S}from"./ChartCard-DxxB4rGm.js";import{t as C}from"./CustomTooltip-CfoUDPbT.js";var w=e(l()),T=u();function E({data:e,onClickDay:l}){let{t:u}=d(),E=(0,w.useId)(),D=e=>`${E}-${e}`.replace(/:/g,``),O=(0,w.useMemo)(()=>{let t=0,n=0,r=0,i=0,a=0;for(let o of e)t+=o[`Cache Read`],n+=o[`Cache Write`],r+=o.Input,i+=o.Output,a+=o.Thinking;return{cacheRead:t,cacheWrite:n,input:r,output:i,thinking:a,total:t+n+r+i+a}},[e]),k=(0,w.useMemo)(()=>e.map((t,n)=>({date:t.date,total:t.Input+t.Output+t[`Cache Write`]+t[`Cache Read`]+t.Thinking,totalPrev:(()=>{let t=n>0?e[n-1]:void 0;return t?t.Input+t.Output+t[`Cache Write`]+t[`Cache Read`]+t.Thinking:void 0})(),tokenMA7:t.tokenMA7})),[e]),A=e=>{let t=e;t?.activePayload?.[0]?.payload?.date&&l&&l(t.activePayload[0].payload.date)},j=(0,T.jsx)(S,{children:e=>(0,T.jsxs)(`div`,{className:`mt-4`,children:[(0,T.jsx)(`div`,{className:`mb-1 text-[10px] tracking-wider text-muted-foreground uppercase`,children:u(`charts.tokensOverTime.allTypes`)}),(0,T.jsx)(x,{variant:`line`,children:(0,T.jsx)(t,{width:`100%`,height:180,children:(0,T.jsxs)(s,{data:k,margin:y,children:[(0,T.jsx)(`defs`,{children:(0,T.jsxs)(`linearGradient`,{id:D(`total`),x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,T.jsx)(`stop`,{offset:`0%`,stopColor:_.cost,stopOpacity:.25}),(0,T.jsx)(`stop`,{offset:`100%`,stopColor:_.cost,stopOpacity:0})]})}),(0,T.jsx)(a,{strokeDasharray:`3 3`,stroke:_.grid,opacity:.3}),(0,T.jsx)(i,{dataKey:`date`,tickFormatter:f,stroke:_.axis,fontSize:10,tickLine:!1}),(0,T.jsx)(n,{tickFormatter:p,stroke:_.axis,fontSize:10,tickLine:!1,axisLine:!1,width:55}),(0,T.jsx)(c,{content:(0,T.jsx)(C,{formatter:p}),cursor:{fill:`hsl(var(--muted))`,opacity:.15}}),(0,T.jsx)(r,{type:`monotone`,dataKey:`total`,stroke:_.cost,fill:`url(#${D(`total`)})`,strokeWidth:1.5,name:u(`charts.tokensOverTime.totalTokens`),...g(e)}),(0,T.jsx)(o,{type:`monotone`,dataKey:`tokenMA7`,stroke:_.ma7,strokeWidth:2,strokeDasharray:`5 5`,dot:!1,connectNulls:!0,name:u(`charts.tokensOverTime.movingAverage`),...v(e,{role:`secondary`})})]})})})]})});return(0,T.jsxs)(b,{title:u(`charts.tokensOverTime.title`),subtitle:u(`charts.tokensOverTime.subtitle`),info:h.tokensOverTime,summary:(0,T.jsx)(m,{value:O.total,type:`tokens`}),className:`lg:col-span-2`,chartData:e,valueKey:`Cache Read`,valueFormatter:p,expandedExtra:j,children:[(0,T.jsx)(`div`,{className:`mb-3 grid grid-cols-2 gap-2 text-center md:grid-cols-5`,children:[{label:`Cache Read`,value:O.cacheRead,color:_.cacheRead},{label:`Cache Write`,value:O.cacheWrite,color:_.cacheWrite},{label:`Output`,value:O.output,color:_.output},{label:`Input`,value:O.input,color:_.input},{label:`Thinking`,value:O.thinking,color:_.cost}].map(e=>(0,T.jsxs)(`div`,{className:`rounded-lg bg-muted/20 p-1.5`,children:[(0,T.jsx)(`div`,{className:`text-[9px] tracking-wider text-muted-foreground uppercase`,children:e.label}),(0,T.jsx)(`div`,{className:`font-mono text-xs font-semibold`,style:{color:e.color},children:p(e.value)}),(0,T.jsx)(`div`,{className:`font-mono text-[9px] text-muted-foreground/60`,children:O.total>0?`${(e.value/O.total*100).toFixed(1)}%`:`–`})]},e.label))}),(0,T.jsxs)(`div`,{className:`mb-2`,children:[(0,T.jsx)(`div`,{className:`mb-1 text-[10px] tracking-wider text-muted-foreground uppercase`,children:u(`charts.tokensOverTime.cacheTokens`)}),(0,T.jsx)(S,{children:l=>(0,T.jsx)(x,{variant:`line`,children:(0,T.jsx)(t,{width:`100%`,height:150,children:(0,T.jsxs)(s,{data:e,margin:{...y,bottom:0},onClick:A,children:[(0,T.jsxs)(`defs`,{children:[(0,T.jsxs)(`linearGradient`,{id:D(`cacheRead`),x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,T.jsx)(`stop`,{offset:`0%`,stopColor:_.cacheRead,stopOpacity:.25}),(0,T.jsx)(`stop`,{offset:`100%`,stopColor:_.cacheRead,stopOpacity:0})]}),(0,T.jsxs)(`linearGradient`,{id:D(`cacheWrite`),x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,T.jsx)(`stop`,{offset:`0%`,stopColor:_.cacheWrite,stopOpacity:.25}),(0,T.jsx)(`stop`,{offset:`100%`,stopColor:_.cacheWrite,stopOpacity:0})]})]}),(0,T.jsx)(a,{strokeDasharray:`3 3`,stroke:_.grid,opacity:.3}),(0,T.jsx)(i,{dataKey:`date`,tickFormatter:f,stroke:_.axis,fontSize:10,tickLine:!1,hide:!0}),(0,T.jsx)(n,{tickFormatter:p,stroke:_.axis,fontSize:10,tickLine:!1,axisLine:!1,width:55}),(0,T.jsx)(c,{content:(0,T.jsx)(C,{formatter:p}),cursor:{fill:`hsl(var(--muted))`,opacity:.15}}),(0,T.jsx)(r,{type:`monotone`,dataKey:`Cache Read`,stroke:_.cacheRead,fill:`url(#${D(`cacheRead`)})`,strokeWidth:1.5,name:`Cache Read`,...g(l)}),(0,T.jsx)(r,{type:`monotone`,dataKey:`Cache Write`,stroke:_.cacheWrite,fill:`url(#${D(`cacheWrite`)})`,strokeWidth:1.5,name:`Cache Write`,...g(l,{order:1,role:`stacked`})}),(0,T.jsx)(o,{type:`monotone`,dataKey:`cacheReadMA7`,stroke:_.cacheRead,strokeWidth:2,strokeDasharray:`5 5`,dot:!1,connectNulls:!0,name:`Cache Read ${u(`charts.tokensOverTime.averageSuffix`)}`,...v(l,{role:`secondary`})}),(0,T.jsx)(o,{type:`monotone`,dataKey:`cacheWriteMA7`,stroke:_.cacheWrite,strokeWidth:2,strokeDasharray:`5 5`,dot:!1,connectNulls:!0,name:`Cache Write ${u(`charts.tokensOverTime.averageSuffix`)}`,...v(l,{order:1,role:`secondary`})})]})})})})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`div`,{className:`mb-1 text-[10px] tracking-wider text-muted-foreground uppercase`,children:u(`charts.tokensOverTime.inputOutputTokens`)}),(0,T.jsx)(S,{children:l=>(0,T.jsx)(x,{variant:`line`,children:(0,T.jsx)(t,{width:`100%`,height:150,children:(0,T.jsxs)(s,{data:e,margin:y,onClick:A,children:[(0,T.jsxs)(`defs`,{children:[(0,T.jsxs)(`linearGradient`,{id:D(`output`),x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,T.jsx)(`stop`,{offset:`0%`,stopColor:_.output,stopOpacity:.25}),(0,T.jsx)(`stop`,{offset:`100%`,stopColor:_.output,stopOpacity:0})]}),(0,T.jsxs)(`linearGradient`,{id:D(`input`),x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,T.jsx)(`stop`,{offset:`0%`,stopColor:_.input,stopOpacity:.25}),(0,T.jsx)(`stop`,{offset:`100%`,stopColor:_.input,stopOpacity:0})]})]}),(0,T.jsx)(a,{strokeDasharray:`3 3`,stroke:_.grid,opacity:.3}),(0,T.jsx)(i,{dataKey:`date`,tickFormatter:f,stroke:_.axis,fontSize:10,tickLine:!1}),(0,T.jsx)(n,{tickFormatter:p,stroke:_.axis,fontSize:10,tickLine:!1,axisLine:!1,width:55}),(0,T.jsx)(c,{content:(0,T.jsx)(C,{formatter:p}),cursor:{fill:`hsl(var(--muted))`,opacity:.15}}),(0,T.jsx)(r,{type:`monotone`,dataKey:`Output`,stroke:_.output,fill:`url(#${D(`output`)})`,strokeWidth:1.5,name:`Output`,...g(l)}),(0,T.jsx)(r,{type:`monotone`,dataKey:`Input`,stroke:_.input,fill:`url(#${D(`input`)})`,strokeWidth:1.5,name:`Input`,...g(l,{order:1,role:`stacked`})}),(0,T.jsx)(o,{type:`monotone`,dataKey:`outputMA7`,stroke:_.output,strokeWidth:2,strokeDasharray:`5 5`,dot:!1,connectNulls:!0,name:`Output ${u(`charts.tokensOverTime.averageSuffix`)}`,...v(l,{role:`secondary`})}),(0,T.jsx)(o,{type:`monotone`,dataKey:`inputMA7`,stroke:_.input,strokeWidth:2,strokeDasharray:`5 5`,dot:!1,connectNulls:!0,name:`Input ${u(`charts.tokensOverTime.averageSuffix`)}`,...v(l,{order:1,role:`secondary`})})]})})})})]}),(0,T.jsxs)(`div`,{className:`mt-3`,children:[(0,T.jsx)(`div`,{className:`mb-1 text-[10px] tracking-wider text-muted-foreground uppercase`,children:u(`charts.tokensOverTime.thinkingTokens`)}),(0,T.jsx)(S,{children:l=>(0,T.jsx)(x,{variant:`line`,children:(0,T.jsx)(t,{width:`100%`,height:110,children:(0,T.jsxs)(s,{data:e,margin:y,onClick:A,children:[(0,T.jsx)(`defs`,{children:(0,T.jsxs)(`linearGradient`,{id:D(`thinking`),x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,T.jsx)(`stop`,{offset:`0%`,stopColor:_.cost,stopOpacity:.25}),(0,T.jsx)(`stop`,{offset:`100%`,stopColor:_.cost,stopOpacity:0})]})}),(0,T.jsx)(a,{strokeDasharray:`3 3`,stroke:_.grid,opacity:.3}),(0,T.jsx)(i,{dataKey:`date`,tickFormatter:f,stroke:_.axis,fontSize:10,tickLine:!1,hide:!0}),(0,T.jsx)(n,{tickFormatter:p,stroke:_.axis,fontSize:10,tickLine:!1,axisLine:!1,width:55}),(0,T.jsx)(c,{content:(0,T.jsx)(C,{formatter:p}),cursor:{fill:`hsl(var(--muted))`,opacity:.15}}),(0,T.jsx)(r,{type:`monotone`,dataKey:`Thinking`,stroke:_.cost,fill:`url(#${D(`thinking`)})`,strokeWidth:1.5,name:`Thinking`,...g(l)}),(0,T.jsx)(o,{type:`monotone`,dataKey:`thinkingMA7`,stroke:_.cost,strokeWidth:2,strokeDasharray:`5 5`,dot:!1,connectNulls:!0,name:`Thinking ${u(`charts.tokensOverTime.averageSuffix`)}`,...v(l,{role:`secondary`})})]})})})})]})]})}export{E as TokensOverTime};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./provider-limits-
|
|
1
|
+
import{i as e}from"./provider-limits-BgKrr7k7.js";var t={datePresets:[`all`,`7d`,`30d`,`month`,`year`],viewModes:[`daily`,`monthly`,`yearly`],sectionDefinitions:[{id:`insights`,domId:`insights`,labelKey:`helpPanel.sectionLabels.insights`},{id:`metrics`,domId:`metrics`,labelKey:`helpPanel.sectionLabels.metrics`},{id:`today`,domId:`today`,labelKey:`helpPanel.sectionLabels.today`},{id:`currentMonth`,domId:`current-month`,labelKey:`helpPanel.sectionLabels.currentMonth`},{id:`activity`,domId:`activity`,labelKey:`helpPanel.sectionLabels.activity`},{id:`forecastCache`,domId:`forecast-cache`,labelKey:`helpPanel.sectionLabels.forecastCache`},{id:`limits`,domId:`limits`,labelKey:`helpPanel.sectionLabels.limits`},{id:`costAnalysis`,domId:`charts`,labelKey:`helpPanel.sectionLabels.costAnalysis`},{id:`tokenAnalysis`,domId:`token-analysis`,labelKey:`helpPanel.sectionLabels.tokenAnalysis`},{id:`requestAnalysis`,domId:`request-analysis`,labelKey:`helpPanel.sectionLabels.requestAnalysis`},{id:`advancedAnalysis`,domId:`advanced-analysis`,labelKey:`helpPanel.sectionLabels.advancedAnalysis`},{id:`comparisons`,domId:`comparisons`,labelKey:`helpPanel.sectionLabels.comparisons`},{id:`tables`,domId:`tables`,labelKey:`helpPanel.sectionLabels.tables`}]},n=[`all`,`7d`,`30d`,`month`,`year`],r=[`daily`,`monthly`,`yearly`],i=[`insights`,`metrics`,`today`,`currentMonth`,`activity`,`forecastCache`,`limits`,`costAnalysis`,`tokenAnalysis`,`requestAnalysis`,`advancedAnalysis`,`comparisons`,`tables`];function a(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function o(e,t,n){if(!Array.isArray(e))throw Error(`Invalid dashboard preferences: "${n}" must be an array.`);let r=e;if(r.find(e=>typeof e!=`string`||!t.includes(e))!==void 0)throw Error(`Invalid dashboard preferences: "${n}" contains unsupported values.`);return r.map(e=>e)}function s(e){if(!Array.isArray(e))throw Error(`Invalid dashboard preferences: "sectionDefinitions" must be an array.`);return e.map(e=>{if(!a(e))throw Error(`Invalid dashboard preferences: each "sectionDefinitions" entry must be an object.`);let{id:t,domId:n,labelKey:r}=e;if(typeof t!=`string`||!i.includes(t))throw Error(`Invalid dashboard preferences: sectionDefinitions contain an unknown id.`);if(typeof n!=`string`||!n.trim())throw Error(`Invalid dashboard preferences: sectionDefinitions require a domId.`);if(typeof r!=`string`||!r.trim())throw Error(`Invalid dashboard preferences: sectionDefinitions require a labelKey.`);return{id:t,domId:n,labelKey:r}})}function c(e){if(!a(e))throw Error(`Invalid dashboard preferences: expected an object.`);return{datePresets:o(e.datePresets,n,`datePresets`),viewModes:o(e.viewModes,r,`viewModes`),sectionDefinitions:s(e.sectionDefinitions)}}var l=c(t),u=l.datePresets,d=l.viewModes,f=l.sectionDefinitions,p=Object.fromEntries(f.map(e=>[e.id,e])),m={viewMode:`daily`,datePreset:`all`,providers:[],models:[]};function h(){return f.reduce((e,t)=>({...e,[t.id]:!0}),{})}function g(){return f.map(e=>e.id)}function _(e){return Array.isArray(e)?[...new Set(e.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(Boolean))]:[]}function v(e){return u.includes(e)?e:`all`}function y(e){return d.includes(e)?e:`daily`}function b(e){let t=e&&typeof e==`object`?e:{};return{viewMode:y(t.viewMode),datePreset:v(t.datePreset),providers:_(t.providers),models:_(t.models)}}function x(e){let t=e&&typeof e==`object`?e:{},n=h();return f.reduce((e,r)=>({...e,[r.id]:typeof t[r.id]==`boolean`?!!t[r.id]:n[r.id]}),{})}function S(e){let t=g();if(!Array.isArray(e))return t;let n=e.filter(e=>typeof e==`string`&&t.includes(e)),r=[...new Set(n)],i=t.filter(e=>!r.includes(e));return[...r,...i]}var C={language:`de`,theme:`dark`,reducedMotionPreference:`system`,providerLimits:{},defaultFilters:m,sectionVisibility:h(),sectionOrder:g(),lastLoadedAt:null,lastLoadSource:null,cliAutoLoadActive:!1};function w(e){return e===`en`?`en`:`de`}function T(e){return e===`light`?`light`:`dark`}function E(e){return e===`always`||e===`never`?e:`system`}function D(t){if(!t||typeof t!=`object`)return{};let n={};for(let[r,i]of Object.entries(t))n[r]=e(i);return n}function O(e){return e===`file`||e===`auto-import`||e===`cli-auto-load`?e:null}function k(e){if(typeof e!=`string`)return null;let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toISOString():null}function A(e){let t=e&&typeof e==`object`?e:{};return{language:w(t.language),theme:T(t.theme),reducedMotionPreference:E(t.reducedMotionPreference),providerLimits:D(t.providerLimits),defaultFilters:b(t.defaultFilters),sectionVisibility:x(t.sectionVisibility),sectionOrder:S(t.sectionOrder),lastLoadedAt:k(t.lastLoadedAt),lastLoadSource:O(t.lastLoadSource),cliAutoLoadActive:!!t.cliAutoLoadActive}}function j(e){typeof document>`u`||document.documentElement.classList.toggle(`dark`,e===`dark`)}export{p as a,g as c,u as i,h as l,j as n,d as o,A as r,m as s,C as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{S as t,w as n}from"./charts-vendor-CiBqdKXh.js";import{a as r}from"./motion-vendor-BNVN-Ktr.js";import{y as i}from"./ui-vendor-C_SJC6eX.js";import{o as a}from"./useTranslation-0ThAx3Gl.js";var o=e(n()),s=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,c=t,l=(e,t)=>n=>{if(t?.variants==null)return c(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=s(t)||s(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return c(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},u=r(),d=l(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 cursor-pointer`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,outline:`border border-border bg-transparent hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2`,sm:`h-8 rounded-md px-3 text-xs`,lg:`h-10 rounded-md px-8`,icon:`h-9 w-9`}},defaultVariants:{variant:`default`,size:`default`}}),f=o.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>(0,u.jsx)(r?i:`button`,{className:a(d({variant:t,size:n,className:e})),ref:s,...o}));f.displayName=`Button`;export{f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{w as t}from"./charts-vendor-CiBqdKXh.js";import{a as n,i as r,n as i}from"./motion-vendor-BNVN-Ktr.js";import{a,o}from"./useTranslation-0ThAx3Gl.js";var s=e(t()),c=n(),l={sectionPreloadMargin:`0px 0px 45% 0px`,sectionRevealAmount:.14,sectionRevealOffset:12,sectionRevealDuration:.6,sectionRevealEase:[.22,1,.36,1],placeholderFadeDuration:.34,itemRevealAmount:.24,itemRevealOffset:8,itemRevealDuration:.42,itemStaggerMs:105,chartStartDelayMs:285,meterStartDelayMs:375,meterDurationMs:960},u=(0,s.createContext)(null);function d(){return(0,s.useContext)(u)}function f(e,t){let[n,r]=(0,s.useState)(typeof IntersectionObserver>`u`);return(0,s.useEffect)(()=>{if(typeof IntersectionObserver>`u`){r(!0);return}if(n)return;let i=e.current;if(!i)return;let a=new IntersectionObserver(e=>{e[0]?.isIntersecting&&(r(!0),a.disconnect())},{threshold:t});return a.observe(i),()=>{a.disconnect()}},[t,n,e]),n}function p(e,{amount:t=l.itemRevealAmount,kind:n=`item`,order:r=0,delayMs:i}={}){let o=d(),c=a(),u=typeof IntersectionObserver>`u`,p=f(e,t),m=(o?.sectionVisible??!0)&&(u?!0:p),[h,g]=(0,s.useState)(0),_=(0,s.useRef)(!1);(0,s.useEffect)(()=>{m&&!_.current&&g(e=>e+1),_.current=m},[m]);let v=i??(n===`meter`?o?.meterStartDelayMs??l.meterStartDelayMs:o?.chartStartDelayMs??l.chartStartDelayMs);return{active:c?!0:m,runKey:h,delayMs:v+r*l.itemStaggerMs,shouldReduceMotion:c}}function m({children:e,className:t,order:n=0,delayMs:r,amount:a,"data-testid":o}){let u=(0,s.useRef)(null),d=p(u,{kind:`item`,order:n,...r===void 0?{}:{delayMs:r},...a===void 0?{}:{amount:a}});return(0,s.useEffect)(()=>{let e=u.current;e&&e.querySelectorAll(`a[href], button, input, select, textarea, [tabindex]`).forEach(e=>{if(!d.active){e.hasAttribute(`data-dashboard-motion-tabindex`)||e.setAttribute(`data-dashboard-motion-tabindex`,e.getAttribute(`tabindex`)??``),e.tabIndex=-1;return}if(!e.hasAttribute(`data-dashboard-motion-tabindex`))return;let t=e.getAttribute(`data-dashboard-motion-tabindex`);t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`),e.removeAttribute(`data-dashboard-motion-tabindex`)})},[d.active]),d.shouldReduceMotion?(0,c.jsx)(`div`,{ref:u,className:t,"data-testid":o,children:e}):(0,c.jsx)(i.div,{ref:u,className:t,"data-testid":o,"aria-hidden":!d.active,...d.active?{}:{style:{pointerEvents:`none`}},initial:!1,animate:d.active?{opacity:1,y:0}:{opacity:0,y:l.itemRevealOffset},transition:{duration:l.itemRevealDuration,delay:d.active?d.delayMs/1e3:0,ease:l.sectionRevealEase},children:e})}function h({id:e,children:t,className:n,contentClassName:d,placeholderClassName:f,eager:p=!1,onPreload:m}){let h=(0,s.useRef)(null),g=(0,s.useRef)(!1),_=(0,s.useRef)(null),v=(0,s.useRef)(!0),y=a(),[b,x]=(0,s.useState)(p),[S,C]=(0,s.useState)(p);(0,s.useEffect)(()=>()=>{v.current=!1},[]);let w=(0,s.useCallback)(()=>{if(g.current)return _.current;if(g.current=!0,!m){x(!0);let e=Promise.resolve();return _.current=e,e}let e=Promise.resolve().then(()=>m()).catch(()=>void 0).finally(()=>{v.current&&x(!0)});return _.current=e,e},[m]);(0,s.useEffect)(()=>{if(p){w(),C(!0);return}let e=h.current;if(!e||typeof IntersectionObserver>`u`){w(),C(!0);return}let t=new IntersectionObserver(e=>{e[0]?.isIntersecting&&(w(),t.disconnect())},{rootMargin:l.sectionPreloadMargin,threshold:0}),n=new IntersectionObserver(e=>{e[0]?.isIntersecting&&(w(),C(!0),n.disconnect())},{threshold:l.sectionRevealAmount});return t.observe(e),n.observe(e),()=>{t.disconnect(),n.disconnect()}},[p,w]);let T=p||b,E=!S,D={opacity:0,pointerEvents:`none`},O={pointerEvents:`none`},k=(0,s.useMemo)(()=>({sectionVisible:S,chartStartDelayMs:l.chartStartDelayMs,meterStartDelayMs:l.meterStartDelayMs,shouldReduceMotion:y}),[S,y]);return(0,c.jsx)(`section`,{id:e,ref:h,className:o(`relative`,n),"data-section-mounted":T?`true`:`false`,"data-section-visible":S?`true`:`false`,children:T?(0,c.jsx)(u.Provider,{value:k,children:(0,c.jsxs)(`div`,{className:`relative`,children:[y?(0,c.jsx)(`div`,{...S?{}:{inert:!0},className:d,style:S?void 0:D,children:t}):(0,c.jsx)(i.div,{...S?{}:{inert:!0},...S?{}:{style:O},initial:{opacity:0,y:l.sectionRevealOffset},animate:S?{opacity:1,y:0}:{opacity:0,y:l.sectionRevealOffset},transition:{duration:l.sectionRevealDuration,ease:l.sectionRevealEase},className:d,children:t}),(0,c.jsx)(r,{initial:!1,children:E&&(y?(0,c.jsx)(`div`,{"aria-hidden":`true`,className:o(`pointer-events-none absolute inset-0 rounded-2xl border border-border/40 bg-card/50 backdrop-blur-xl`,f??`min-h-[320px]`)}):(0,c.jsx)(i.div,{"aria-hidden":`true`,initial:{opacity:1},animate:{opacity:1},exit:{opacity:0},transition:{duration:l.placeholderFadeDuration},className:o(`pointer-events-none absolute inset-0 rounded-2xl border border-border/40 bg-card/50 backdrop-blur-xl`,f??`min-h-[320px]`)},`section-placeholder`))})]})}):(0,c.jsx)(`div`,{"aria-hidden":`true`,className:o(`rounded-2xl border border-border/40 bg-card/50 backdrop-blur-xl`,f??`min-h-[320px]`)})})}var g=s.forwardRef(({className:e,...t},n)=>{let r=a(),s=d(),l=r||s?{initial:!1,animate:{opacity:1,y:0},transition:{duration:0}}:{initial:{opacity:0,y:14},whileInView:{opacity:1,y:0},viewport:{once:!0,amount:.15},transition:{duration:.35,ease:`easeOut`}};return(0,c.jsx)(i.div,{ref:n,...t,...l,className:o(`relative rounded-xl border border-border/50 bg-card/80 text-card-foreground shadow-[var(--shadow-card)] backdrop-blur-xl transition-all duration-300 hover:border-border/80 hover:shadow-[var(--shadow-card-hover)] motion-reduce:transition-none`,e)})});g.displayName=`Card`;var _=s.forwardRef(({className:e,...t},n)=>(0,c.jsx)(`div`,{ref:n,className:o(`flex flex-col space-y-1.5 p-4`,e),...t}));_.displayName=`CardHeader`;var v=s.forwardRef(({children:e,className:t,...n},r)=>(0,c.jsx)(`h3`,{ref:r,className:o(`leading-none font-semibold tracking-tight`,t),...n,children:e}));v.displayName=`CardTitle`;var y=s.forwardRef(({className:e,...t},n)=>(0,c.jsx)(`div`,{ref:n,className:o(`p-4 pt-0`,e),...t}));y.displayName=`CardContent`;var b=s.forwardRef(({className:e,...t},n)=>(0,c.jsx)(`p`,{ref:n,className:o(`text-xs text-muted-foreground`,e),...t}));b.displayName=`CardDescription`;export{v as a,m as c,_ as i,p as l,y as n,h as o,b as r,l as s,g as t,d as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={cost:`hsl(var(--chart-1))`,ma7:`hsl(var(--chart-2))`,cumulative:`hsl(var(--chart-3))`,input:`hsl(var(--chart-5))`,output:`hsl(var(--chart-4))`,cacheWrite:`hsl(var(--chart-2))`,cacheRead:`hsl(var(--chart-3))`,grid:`hsl(var(--border))`,axis:`hsl(var(--muted-foreground))`,tooltipBg:`hsl(var(--popover))`,tooltipBorder:`hsl(var(--border))`},t={top:5,right:10,left:10,bottom:5},n={duration:1290,easing:`ease-out`,stagger:120,slowDuration:1560,chartStartDelay:285,barDuration:930,radialDuration:1230,revealDuration:780};function r(e,{order:t=0,role:r=`primary`}={}){let i=r===`secondary`?140+t*n.stagger:t*n.stagger;return{isAnimationActive:e,animationBegin:n.chartStartDelay+i,animationDuration:r===`secondary`?n.slowDuration:n.duration,animationEasing:n.easing}}function i(e,{order:t=0,role:n=`primary`}={}){return{...r(e,{order:t,role:n})}}function a(e,t=0){return{isAnimationActive:e,animationBegin:n.chartStartDelay+t*90,animationDuration:n.barDuration,animationEasing:n.easing}}function o(e,t=0){return{isAnimationActive:e,animationBegin:n.chartStartDelay+20+t*80,animationDuration:n.radialDuration,animationEasing:n.easing}}function s(e,t=0){return{isAnimationActive:e,animationBegin:n.chartStartDelay+t,animationDuration:n.revealDuration,animationEasing:n.easing}}export{a,s as c,i,e as n,r as o,t as r,o as s,n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`6.2.
|
|
1
|
+
var e=`6.2.3`,t=`https://github.com/roastcodes/ttdash`,n=`https://github.com/roastcodes/ttdash/issues`,r=`https://www.npmjs.com/package/@roastcodes/ttdash/v/${e}`,i={"Opus 4.6":{input:15,output:75,cacheRead:1.5,cacheWrite:18.75},"Opus 4.5":{input:15,output:75,cacheRead:1.5,cacheWrite:18.75},"Sonnet 4.6":{input:3,output:15,cacheRead:.3,cacheWrite:3.75},"Sonnet 4.5":{input:3,output:15,cacheRead:.3,cacheWrite:3.75},"Haiku 4.5":{input:.8,output:4,cacheRead:.08,cacheWrite:1},"GPT-5.4":{input:0,output:0,cacheRead:0,cacheWrite:0},"GPT-5":{input:0,output:0,cacheRead:0,cacheWrite:0},"Gemini 3 Flash Preview":{input:0,output:0,cacheRead:0,cacheWrite:0},Gemini:{input:0,output:0,cacheRead:0,cacheWrite:0},OpenCode:{input:0,output:0,cacheRead:0,cacheWrite:0}};export{e as a,r as i,t as n,i as r,n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{w as t}from"./charts-vendor-CiBqdKXh.js";import{a as n}from"./motion-vendor-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{w as t}from"./charts-vendor-CiBqdKXh.js";import{a as n}from"./motion-vendor-BNVN-Ktr.js";import{a as r,c as i,i as a,n as o,o as s,r as c,s as l}from"./ui-vendor-C_SJC6eX.js";import{a as u,i as d,o as f,t as p}from"./useTranslation-0ThAx3Gl.js";import{n as m}from"./icons-vendor-CIvT_-Pb.js";var h=e(t()),g=n(),_=l,v=h.forwardRef(({className:e,...t},n)=>{let i=u();return(0,g.jsx)(r,{ref:n,className:f(`fixed inset-0 z-50 bg-black/60 backdrop-blur-sm`,d(i,`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`),e),...t})});v.displayName=`DialogOverlay`;var y=h.forwardRef(({className:e,children:t,...n},r)=>{let{t:i}=p(),a=u();return(0,g.jsxs)(s,{children:[(0,g.jsx)(v,{}),(0,g.jsxs)(c,{ref:r,className:f(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border border-border bg-card p-6 shadow-lg duration-200`,d(a,`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]`),e),...n,children:[t,(0,g.jsx)(o,{"aria-label":i(`common.close`),title:i(`common.close`),className:`absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:outline-none`,children:(0,g.jsx)(m,{className:`h-4 w-4`})})]})]})});y.displayName=`DialogContent`;var b=({className:e,...t})=>(0,g.jsx)(`div`,{className:f(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t}),x=h.forwardRef(({className:e,...t},n)=>(0,g.jsx)(i,{ref:n,className:f(`text-lg leading-none font-semibold tracking-tight`,e),...t}));x.displayName=`DialogTitle`;var S=h.forwardRef(({className:e,...t},n)=>(0,g.jsx)(a,{ref:n,className:f(`text-sm text-muted-foreground`,e),...t}));S.displayName=`DialogDescription`;export{x as a,b as i,y as n,S as r,_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./motion-vendor-
|
|
1
|
+
import{a as e}from"./motion-vendor-BNVN-Ktr.js";import{o as t}from"./useTranslation-0ThAx3Gl.js";import{d as n,f as r,l as i,n as a,r as o,u as s,v as c,x as l,y as u}from"./formatters-C7EouP6y.js";var d=e(),f={currency:e=>a(e),tokens:e=>n(e),number:e=>i(e),percent:(e,t)=>s(e,t)},p={currency:e=>o(e),tokens:e=>r(e),number:e=>i(e),percent:e=>s(e,4)};function m({value:e,type:n,className:r,decimals:i,label:a,insight:o,interactive:s=!0}){let m=f[n](e,i),h=p[n](e);if(m===h)return(0,d.jsx)(`span`,{className:r,children:m});let g=a?`${a}: ${h}`:h;return s?(0,d.jsxs)(c,{children:[(0,d.jsx)(l,{asChild:!0,children:(0,d.jsx)(`button`,{type:`button`,"aria-label":g,className:t(`inline cursor-help rounded-sm border-0 bg-transparent p-0 text-inherit underline decoration-muted-foreground/40 decoration-dotted underline-offset-4 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:outline-none`,r),children:m})}),(0,d.jsx)(u,{className:`max-w-[260px]`,children:(0,d.jsxs)(`div`,{className:`space-y-1`,children:[a&&(0,d.jsx)(`div`,{className:`text-[10px] tracking-[0.14em] text-muted-foreground uppercase`,children:a}),(0,d.jsx)(`div`,{className:`font-mono text-xs`,children:h}),o&&(0,d.jsx)(`div`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:o})]})})]}):(0,d.jsxs)(`span`,{className:t(`cursor-help underline decoration-muted-foreground/40 decoration-dotted underline-offset-4`,r),title:o?`${h} — ${o}`:h,children:[(0,d.jsx)(`span`,{"aria-hidden":`true`,children:m}),(0,d.jsxs)(`span`,{className:`sr-only`,children:[g,o?`. ${o}`:``]})]})}export{m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{w as t}from"./charts-vendor-CiBqdKXh.js";import{a as n}from"./motion-vendor-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{w as t}from"./charts-vendor-CiBqdKXh.js";import{a as n}from"./motion-vendor-BNVN-Ktr.js";import{C as r,S as i,b as a,x as o}from"./ui-vendor-C_SJC6eX.js";import{a as s,i as c,o as l}from"./useTranslation-0ThAx3Gl.js";import{i as u,r as d}from"./i18n-BS3-GJaA.js";var f=e(t()),p=n(),m=o,h=i,g=r,_=f.forwardRef(({className:e,sideOffset:t=4,...n},r)=>{let i=s();return(0,p.jsx)(a,{ref:r,sideOffset:t,className:l(`z-50 overflow-hidden rounded-lg border border-border/50 bg-popover/90 px-3 py-1.5 text-xs text-popover-foreground shadow-lg shadow-black/10 backdrop-blur-xl duration-200`,c(i,`animate-in fade-in-0 zoom-in-95`),e),...n})});_.displayName=`TooltipContent`;function v(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function y(){return v(new Date)}function b(){return y().slice(0,7)}function x(e){if(typeof e==`number`)return Number.isFinite(e)?e:null;if(typeof e==`string`){let t=Number(e);return Number.isFinite(t)?t:null}return null}function S(e){return e>=1e3?`$${(e/1e3).toFixed(1)}k`:e>=100?`$${Math.round(e)}`:e>=10?`$${e.toFixed(1)}`:`$${e.toFixed(2)}`}function C(e){return`$${e.toLocaleString(d(),{minimumFractionDigits:2,maximumFractionDigits:2})}`}function w(e){return Number.isFinite(e)?e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e>=100?e.toFixed(0):e>=10?e.toFixed(1):e>=1?e.toFixed(2):e===0?`0`:e.toFixed(3):`0`}function T(e){return e.toLocaleString(d())}function E(e){return`${e.toLocaleString(d())} ${u.t(`common.tokens`)}`}function D(e,t=1){return`${e.toFixed(t)}%`}function O(e,t=`short`){if(/^\d{4}$/.test(e))return e;if(/^\d{4}-\d{2}$/.test(e)){let[n=`0`,r=`1`]=e.split(`-`),i=new Date(parseInt(n,10),parseInt(r,10)-1);return t===`short`?i.toLocaleDateString(d(),{month:`short`,year:`2-digit`}):i.toLocaleDateString(d(),{month:`long`,year:`numeric`})}let n=new Date(e+`T00:00:00`);return t===`long`?n.toLocaleDateString(d(),{weekday:`short`,day:`2-digit`,month:`2-digit`,year:`numeric`}):t===`weekday`?n.toLocaleDateString(d(),{weekday:`short`}):n.toLocaleDateString(d(),{day:`2-digit`,month:`2-digit`})}function k(e){if(/^\d{4}$/.test(e))return e;if(/^\d{4}-\d{2}$/.test(e)){let[t=`0`,n=`1`]=e.split(`-`);return new Date(parseInt(t,10),parseInt(n,10)-1).toLocaleDateString(d(),{month:`short`,year:`2-digit`})}return new Date(e+`T00:00:00`).toLocaleDateString(d(),{day:`2-digit`,month:`2-digit`})}function A(e,t=!1){return e===`monthly`?u.t(t?`periods.months`:`periods.month`):e===`yearly`?u.t(t?`periods.years`:`periods.year`):u.t(t?`periods.days`:`periods.day`)}function j(e){return e===`monthly`?u.t(`periods.unitMonth`):e===`yearly`?u.t(`periods.unitYear`):u.t(`periods.unitDay`)}function M(e){if(!/^\d{4}-\d{2}$/.test(e))return``;let[t=``,n=``]=e.split(`-`),r=Number.parseInt(t,10),i=Number.parseInt(n,10);return!Number.isInteger(r)||!Number.isInteger(i)||i<1||i>12?``:new Date(r,i-1).toLocaleDateString(d(),{month:`long`,year:`numeric`})}function N(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleString(d(),{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}function P(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleString(d(),{day:`2-digit`,month:`2-digit`,year:`numeric`,hour:`2-digit`,minute:`2-digit`})}export{v as _,k as a,m as b,M as c,w as d,E as f,j as g,A as h,O as i,T as l,y as m,S as n,N as o,b as p,C as r,P as s,x as t,D as u,h as v,g as x,_ as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./i18n-BS3-GJaA.js";var t={de:{keyboardShortcuts:[{keys:`⌘ K`,description:`Command Palette öffnen`},{keys:`ESC`,description:`Dialog / Zoom schliessen`}],metric:{totalCost:`Zeigt die Gesamtkosten aller API-Aufrufe im gewählten Zeitraum. Die Berechnung basiert auf den hinterlegten Token-Preisen pro Modell.`,totalTokens:`Zeigt die Summe aller verarbeiteten Tokens aus Input, Output und Cache. Ein Token entspricht grob vier Zeichen Text.`,activeDays:`Zeigt, an wie vielen Tagen im gewählten Zeitraum mindestens ein API-Aufruf vorhanden war.`,topModel:`Zeigt das Modell mit den höchsten Gesamtkosten im aktuellen Ausschnitt.`,cacheHitRate:`Zeigt den Anteil der Tokens, die aus dem Cache gelesen wurden. Höhere Werte sprechen meist für bessere Kosteneffizienz.`,costPerMillion:`Zeigt die durchschnittlichen Kosten pro 1 Million verarbeiteter Tokens. Niedrigere Werte sprechen für effizientere Nutzung.`,mostExpensiveDay:`Zeigt den Zeitraumspunkt mit den höchsten API-Kosten im aktuellen Ausschnitt.`,mostExpensiveMonth:`Zeigt den Monat mit den höchsten API-Kosten im aktuellen Ausschnitt.`,mostExpensiveYear:`Zeigt das Jahr mit den höchsten API-Kosten im aktuellen Ausschnitt.`,cheapestDay:`Zeigt den Zeitraumspunkt mit den niedrigsten API-Kosten im aktuellen Ausschnitt.`,avgCostPerDay:`Zeigt die durchschnittlichen Kosten pro aktivem Zeitraumspunkt.`,peak7Days:`Zeigt das teuerste rollierende 7-Tage-Fenster im aktuellen Ausschnitt und macht kurzfristige Lastspitzen sichtbar.`,avgCostPerMonth:`Zeigt die durchschnittlichen Kosten pro aktivem Monat im aktuellen Ausschnitt.`,avgCostPerYear:`Zeigt die durchschnittlichen Kosten pro aktivem Jahr im aktuellen Ausschnitt.`,outputTokens:`Zeigt die Menge der generierten Output-Tokens. Diese sind meist teurer als reine Input-Tokens.`},chart:{costOverTime:`Zeigt die API-Kosten im Zeitverlauf zusammen mit einem gleitenden 7-Tage-Durchschnitt. Klick auf einen Punkt öffnet den Drilldown.`,costByModel:`Zeigt die Kostenverteilung nach Modell als Donut. So wird sichtbar, welche Modelle den grössten Kostenanteil tragen.`,costByModelOverTime:`Zeigt, wie sich die Kosten je Modell über die Zeit entwickeln. Gut geeignet, um Treiber und Verschiebungen im Modellmix zu erkennen.`,cumulativeCost:`Zeigt die kumulierten Gesamtkosten über den gewählten Zeitraum. Falls möglich, wird zusätzlich die Monatsend-Projektion eingeblendet.`,costByWeekday:`Zeigt die durchschnittlichen Kosten pro Wochentag. So werden wiederkehrende Lastmuster über die Woche sichtbar.`,tokensOverTime:`Zeigt den Token-Verbrauch über die Zeit, getrennt nach Input, Output, Cache Write, Cache Read und Thinking.`,requestsOverTime:`Zeigt Anfragen im Zeitverlauf mit Gesamtlinie, Modelllinien und Trendlinie. Klick auf einen Punkt öffnet den Drilldown.`,requestCacheHitRate:`Zeigt die Cache-Hit-Rate pro Modell zusammen mit dem gefilterten Gesamtwert und dem gleitenden 7-Tage-Durchschnitt auf Basis des gewählten Tagesbereichs.`,tokenTypes:`Zeigt die Verteilung der Token-Typen als Donut. So wird sichtbar, welcher Anteil auf Input, Output, Cache oder Thinking entfällt.`,tokenEfficiency:`Zeigt die Kosten pro 1 Million Tokens im Zeitverlauf. So lässt sich erkennen, ob Modellmix und Cache-Nutzung effizienter oder teurer werden.`,modelMix:`Zeigt den prozentualen Kostenanteil der Modelle je Zeitraumspunkt. So werden Modellwechsel und Konzentration sichtbar.`,distributionAnalysis:`Zeigt Histogramme für Kosten, Anfragen und Tokens pro Anfrage. So wird die Streuung sichtbar, nicht nur der Durchschnitt.`,correlationAnalysis:`Zeigt Punktdiagramme für mögliche Zusammenhänge, etwa Anfragen zu Kosten oder Cache-Rate zu Kosten pro Anfrage. Die Korrelation ist ein Signal, aber kein Beweis für Kausalität.`,heatmap:`Zeigt eine Kalender-Heatmap der täglichen Kosten. Dunklere Felder stehen für höhere Werte.`,requestHeatmap:`Zeigt eine Kalender-Heatmap der Anfragen pro Tag. So werden Lastmuster unabhängig von Kosten sichtbar.`,tokenHeatmap:`Zeigt eine Kalender-Heatmap des Tokenvolumens pro Tag. So lassen sich volumenstarke und kostenstarke Tage besser unterscheiden.`,forecast:`Zeigt die Kostenprognose für den laufenden Monat auf Basis geglätteter Kalendertageskosten. Ergänzt wird sie durch Trend und Unsicherheitsband.`,cacheROI:`Zeigt den Effekt der Cache-Nutzung, indem hypothetische Kosten ohne Cache mit den tatsächlichen Kosten verglichen werden.`,providerLimitProgress:`Zeigt pro Anbieter, wie stark das konfigurierte Monatslimit bereits verbraucht ist. Überschreitungen werden separat markiert.`,providerSubscriptionMix:`Vergleicht pro Anbieter die fixen Abo-Kosten mit den variablen API-Kosten und blendet optional das gesetzte Monatslimit ein.`,providerLimitTimeline:`Zeigt im Monatsverlauf die Summe der aktuellen Anbieterkosten gegen die Summe aller konfigurierten Limits. So werden Engpässe früh sichtbar.`,periodComparison:`Zeigt den Vergleich zweier Zeiträume, etwa Woche gegen Vorwoche oder Monat gegen Vormonat, anhand zentraler Kennzahlen.`,anomalyDetection:`Zeigt auffällige Zeitraumspunkte mit ungewöhnlich hohen oder niedrigen Kosten. Grundlage ist die Abweichung vom Mittelwert in Standardabweichungen.`},section:{insights:`Zeigt verdichtete Aussagen zu Konzentration, Anfrage-Ökonomie, Nutzungsmuster und Peak-Fenstern. Diese Sektion ist als schneller Einstieg vor dem Detailblick gedacht.`,metrics:`Zeigt die wichtigsten Kennzahlen auf einen Blick. Hover über abgekürzte Werte zeigt den exakten Zahlenwert.`,today:`Zeigt die KPIs des aktuellen Tages im Datensatz. So wird sichtbar, wie stark der Tageswert vom Zeitraumdurchschnitt abweicht.`,currentMonth:`Zeigt die KPIs des laufenden Monats. So werden Fortschritt, Abdeckung und der Vergleich mit dem Vormonat sichtbar.`,activity:`Zeigt Kalenderansichten für Kosten, Anfragen und Tokens. So werden Lastspitzen, Lücken und saisonale Muster sichtbar.`,forecastCache:`Zeigt Monatsprognose, Cache-Ersparnis und operative Anfragequalität in einem Block. So entsteht ein gemeinsamer Blick auf Ausblick und Effizienz.`,limits:`Zeigt pro Anbieter konfigurierte Abos und Monatslimits. Die Sektion macht sichtbar, wie weit Kostenbudgets im aktuellen Ausschnitt ausgereizt sind.`,costAnalysis:`Zeigt Kostenverlauf und Kostenverteilung nach Modell. So wird sichtbar, wo Geld ausgegeben wurde und welche Modelle die Haupttreiber sind.`,tokenAnalysis:`Zeigt Tokenvolumen, Token-Typen, Wochentagsmuster und Effizienz. So lässt sich besser einordnen, ob Kosten eher aus Menge oder Preisniveau entstehen.`,requestAnalysis:`Zeigt Anfragen gesamt, nach Modell und im Verlauf. Im Zoom kommen zusätzliche Trends und Verteilungen hinzu.`,advancedAnalysis:`Zeigt Verteilungen, Korrelationen und Konzentrationsrisiken. So wird sichtbar, wie stabil, konzentriert oder ungewöhnlich die Nutzung ist.`,comparisons:`Zeigt Veränderungen zwischen Perioden und markiert Ausreisser. So lassen sich Verschiebungen schneller einordnen.`,tables:`Zeigt detaillierte Tabellen mit Sortierung und Drilldown. So lassen sich einzelne Modelle, Anbieter und Tage gezielt prüfen.`},feature:{requestQuality:`Zeigt verdichtete Anfragesignale wie Tokens pro Anfrage, Kosten pro Anfrage sowie Cache- und Thinking-Anteil. So lässt sich die operative Anfragequalität schneller einordnen.`,providerLimits:`Hier werden fixe Abo-Kosten und variable Monatslimits pro Anbieter gepflegt. Die Eingaben bleiben lokal im Browser gespeichert und gelten nur für Anbieter, die im geladenen Report vorkommen.`,concentrationRisk:`Zeigt die Abhängigkeit von einzelnen Modellen und Anbietern. Hohe Werte bedeuten, dass wenige Akteure einen grossen Teil der Kosten tragen.`,providerEfficiency:`Zeigt den Vergleich der Anbieter nach Kosten, Anfragen, Tokens und Effizienzkennzahlen wie Kosten pro Anfrage oder Kosten pro 1 Mio. Tokens.`,modelEfficiency:`Zeigt den Vergleich der Modelle nach Kosten, Volumen und Effizienz. So lassen sich teure oder ineffiziente Kandidaten schnell erkennen.`,recentDays:`Zeigt die Detailtabelle pro Tag, Monat oder Jahr mit Drilldown und Benchmarks gegen Vortag und 7-Tage-Mittel.`}},en:{keyboardShortcuts:[{keys:`⌘ K`,description:`Open command palette`},{keys:`ESC`,description:`Close dialog / zoom view`}],metric:{totalCost:`Shows total API cost across the selected range. The calculation is based on configured per-model token prices.`,totalTokens:`Shows the sum of all processed tokens across input, output, and cache. One token is roughly four text characters.`,activeDays:`Shows how many days in the selected range contain at least one API call.`,topModel:`Shows the model with the highest total cost in the current slice.`,cacheHitRate:`Shows the share of tokens served from cache. Higher values usually indicate better cost efficiency.`,costPerMillion:`Shows average cost per 1 million processed tokens. Lower values indicate more efficient usage.`,mostExpensiveDay:`Shows the period point with the highest API cost in the current slice.`,mostExpensiveMonth:`Shows the month with the highest API cost in the current slice.`,mostExpensiveYear:`Shows the year with the highest API cost in the current slice.`,cheapestDay:`Shows the period point with the lowest API cost in the current slice.`,avgCostPerDay:`Shows the average cost per active period point.`,peak7Days:`Shows the highest-cost rolling 7-day window in the current slice to highlight short-term peaks.`,avgCostPerMonth:`Shows the average cost per active month in the current slice.`,avgCostPerYear:`Shows the average cost per active year in the current slice.`,outputTokens:`Shows the volume of generated output tokens. These are usually more expensive than pure input tokens.`},chart:{costOverTime:`Shows API cost over time together with a rolling 7-day average. Clicking a point opens the drilldown.`,costByModel:`Shows cost distribution by model as a donut chart. This makes the main cost drivers visible.`,costByModelOverTime:`Shows how cost per model evolves over time. Useful for spotting shifts in the model mix.`,cumulativeCost:`Shows cumulative total cost over the selected range. When possible, a month-end projection is added.`,costByWeekday:`Shows average cost by weekday, making recurring weekly load patterns visible.`,tokensOverTime:`Shows token usage over time split by input, output, cache write, cache read, and thinking.`,requestsOverTime:`Shows requests over time with total line, per-model lines, and a trend line. Clicking a point opens the drilldown.`,requestCacheHitRate:`Shows cache hit rate per model together with the filtered overall total and the trailing 7-day average based on the selected daily range.`,tokenTypes:`Shows the distribution of token types as a donut chart so input, output, cache, and thinking shares become visible.`,tokenEfficiency:`Shows cost per 1 million tokens over time. This helps spot whether model mix and cache usage are becoming more or less efficient.`,modelMix:`Shows the percentage cost share of models at each period point. This makes model shifts and concentration visible.`,distributionAnalysis:`Shows histograms for costs, requests, and tokens per request. This highlights spread, not just averages.`,correlationAnalysis:`Shows scatter plots for potential relationships such as requests to cost or cache rate to cost per request. Correlation is a signal, not proof of causality.`,heatmap:`Shows a calendar heatmap of daily cost. Darker cells indicate higher values.`,requestHeatmap:`Shows a calendar heatmap of requests per day. This reveals load patterns independently of cost.`,tokenHeatmap:`Shows a calendar heatmap of token volume per day. This helps distinguish high-volume days from high-cost days.`,forecast:`Shows cost forecast for the current month based on smoothed calendar-day costs, complemented by trend and uncertainty band.`,cacheROI:`Shows the impact of cache usage by comparing hypothetical no-cache costs with actual costs.`,providerLimitProgress:`Shows how much of each configured monthly provider limit has already been used. Overruns are marked separately.`,providerSubscriptionMix:`Compares fixed subscription cost with variable API cost per provider and can optionally include the configured monthly limit.`,providerLimitTimeline:`Shows monthly provider cost against total configured limits over time so bottlenecks become visible early.`,periodComparison:`Shows the comparison of two periods, such as week-over-week or month-over-month, using central metrics.`,anomalyDetection:`Shows unusual period points with unusually high or low cost based on deviation from the mean in standard deviations.`},section:{insights:`Shows condensed statements about concentration, request economics, usage patterns, and peak windows. This section is meant as a fast entry point before deeper analysis.`,metrics:`Shows the most important KPIs at a glance. Hover abbreviated values to see exact numbers.`,today:`Shows the KPIs of the current day in the dataset. This makes it easy to compare the day against the period average.`,currentMonth:`Shows the KPIs of the current month, including progress, coverage, and comparison to the previous month.`,activity:`Shows calendar views for cost, requests, and tokens, making spikes, gaps, and seasonal patterns visible.`,forecastCache:`Shows month forecast, cache savings, and operational request quality in one block for a combined outlook on efficiency.`,limits:`Shows configured subscriptions and monthly limits per provider. This section makes it visible how far budgets are stretched in the current slice.`,costAnalysis:`Shows cost trend and cost distribution by model so it is clear where spend happened and which models dominate.`,tokenAnalysis:`Shows token volume, token types, weekday patterns, and efficiency so you can judge whether cost comes from volume or pricing level.`,requestAnalysis:`Shows requests overall, by model, and over time. The expanded views add extra trends and distributions.`,advancedAnalysis:`Shows distributions, correlations, and concentration risk so usage stability, concentration, and unusual behavior become visible.`,comparisons:`Shows changes between periods and marks outliers so shifts can be understood faster.`,tables:`Shows detailed tables with sorting and drilldown so individual models, providers, and days can be inspected directly.`},feature:{requestQuality:`Shows condensed request signals such as tokens per request, cost per request, and cache and thinking shares. This helps assess operational request quality faster.`,providerLimits:`This is where fixed subscription cost and variable monthly limits are maintained per provider. Values are stored in the local app settings and only apply to providers present in the loaded report.`,concentrationRisk:`Shows dependency on individual models and providers. Higher values mean that a small number of actors carries a large share of cost.`,providerEfficiency:`Shows the provider comparison by cost, requests, tokens, and efficiency metrics such as $/req or $/1M tokens.`,modelEfficiency:`Shows the model comparison by cost, volume, and efficiency so expensive or inefficient candidates are easy to spot.`,recentDays:`Shows the detailed table per day, month, or year with drilldown and benchmarks against the previous day and 7-day average.`}}};function n(){return t[e()]}function r(e){return new Proxy({},{get:(t,n)=>{let r=e();if(Object.prototype.hasOwnProperty.call(r,n))return Reflect.get(r,n)},has:(t,n)=>{let r=e();return Object.prototype.hasOwnProperty.call(r,n)},ownKeys:()=>Reflect.ownKeys(e()),getOwnPropertyDescriptor:(t,n)=>{let r=e();if(Object.prototype.hasOwnProperty.call(r,n))return{value:Reflect.get(r,n),enumerable:!0,configurable:!0}}})}function i(){return n().keyboardShortcuts}var a=r(()=>n().metric),o=r(()=>n().chart),s=r(()=>n().section),c=r(()=>n().feature);export{i as a,s as i,c as n,a as r,o as t};
|