claude-session-dashboard 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +156 -14
- package/dist/client/assets/_dashboard-C-1YOzkf.js +1 -0
- package/dist/client/assets/_sessionId-C4jQeEqE.js +12 -0
- package/dist/client/assets/app-DNBe9Acr.css +1 -0
- package/dist/client/assets/{createServerFn-B0pEGqTk.js → createServerFn-B5mibSc4.js} +1 -1
- package/dist/client/assets/index-C83jHUdL.js +1 -0
- package/dist/client/assets/{main-CM5g2n-_.js → main-CkUc_xJ0.js} +7 -7
- package/dist/client/assets/{sessions.queries-AUVV0tJj.js → sessions.queries-C-HTNzuR.js} +1 -1
- package/dist/client/assets/settings-D56cUmNH.js +1 -0
- package/dist/client/assets/{settings.types-BRNIMHGJ.js → settings.types-l5MKKuAK.js} +1 -1
- package/dist/client/assets/stats-BunIdzj_.js +4 -0
- package/dist/client/assets/{useSessionCost-DgFKglaG.js → useSessionCost-BDldLkTA.js} +1 -1
- package/dist/client/favicon.svg +3 -0
- package/dist/server/assets/_dashboard-TUzgwLqB.js +112 -0
- package/dist/server/assets/{_sessionId-BZf2Aqy5.js → _sessionId-BvDwvNyA.js} +162 -145
- package/dist/server/assets/_tanstack-start-manifest_v-CVdzOaof.js +4 -0
- package/dist/server/assets/{claude-path-BdwflgZ1.js → claude-path-B2oho3NT.js} +2 -2
- package/dist/server/assets/{index-Do0HxVmM.js → index-Biupny11.js} +22 -21
- package/dist/server/assets/{project-analytics.server-BkWSd6a8.js → project-analytics.server-t1bM6wAa.js} +3 -3
- package/dist/server/assets/{router-ChxlsPNU.js → router-kB-tCwY9.js} +55 -29
- package/dist/server/assets/{session-detail.server-DLXl-Pn-.js → session-detail.server-IUw67jz-.js} +2 -2
- package/dist/server/assets/{session-parser-CAEXxF1D.js → session-parser-CIucKYBT.js} +67 -0
- package/dist/server/assets/{session-scanner-CLfls9u-.js → session-scanner-1h9TTTAV.js} +2 -2
- package/dist/server/assets/{sessions.server-CUhasKW2.js → sessions.server-Cpffr3MU.js} +3 -3
- package/dist/server/assets/{settings-ko61yfVs.js → settings-jxAA3KAS.js} +66 -20
- package/dist/server/assets/{stats-C9cZXTP5.js → stats-CzGBAoxT.js} +261 -24
- package/dist/server/assets/{stats.server-52mNk2Yw.js → stats.server-DXJiLqey.js} +62 -3
- package/dist/server/server.js +17 -17
- package/package.json +7 -1
- package/dist/client/assets/_dashboard-Bxw4OxIS.js +0 -1
- package/dist/client/assets/_sessionId-CNR4Ln7m.js +0 -12
- package/dist/client/assets/app-u2nTs9ny.css +0 -1
- package/dist/client/assets/index-BbdJ1jMA.js +0 -1
- package/dist/client/assets/settings-CIwZDakc.js +0 -1
- package/dist/client/assets/stats-CjWSMX3y.js +0 -4
- package/dist/server/assets/_dashboard-CAO6-qAS.js +0 -116
- package/dist/server/assets/_tanstack-start-manifest_v-C5hwNzs-.js +0 -4
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{c as K,r as M,j as e,L as E,f as X,u as Z}from"./main-CM5g2n-_.js";import{c as J,q as V,u as O}from"./createServerFn-B0pEGqTk.js";import{f as S,d as P,b as T,i as G,g as U}from"./format-Bsprb3az.js";import{R as ee,V as te,Y as se,U as ae,a5 as B,W as ne,a6 as le,a7 as re,_ as z,$ as oe,a0 as ie,a8 as ce}from"./useSessionCost-DgFKglaG.js";import{s as de}from"./settings.types-BRNIMHGJ.js";import{a as xe}from"./sessions.queries-AUVV0tJj.js";const me=J({method:"GET"}).handler(K("ff8a3161afdfa175e9c519e4146a56ab5bce6e80745e99cfc2191ebbb7a859bb"));function pe(t,s,a){return V({queryKey:["session","detail",t],queryFn:()=>me({data:{sessionId:t,projectPath:s}}),staleTime:a?2e3:3e4,refetchInterval:a?5e3:void 0})}function ue(t,s,a,n){const l=[];for(const c of t)if(c.timestamp){const p=new Date(c.timestamp).getTime();isNaN(p)||l.push(p)}for(const c of s)if(c.timestamp){const p=new Date(c.timestamp).getTime();isNaN(p)||l.push(p)}for(const c of a)if(c.timestamp){const p=new Date(c.timestamp).getTime();isNaN(p)||l.push(p)}if(l.length===0)return{startMs:0,endMs:0,durationMs:0,mainLane:[],agentLanes:[],skillMarkers:[],errorMarkers:[]};const r=Math.min(...l),y=Math.max(...l),u=Math.max(y-r,1);function m(c){return(c-r)/u}const f=new Set(s.map(c=>c.toolUseId)),o=new Set(a.map(c=>c.toolUseId)),d=[];for(const c of t){if(c.type!=="assistant"||c.toolCalls.length===0)continue;const p=new Date(c.timestamp).getTime();if(!isNaN(p))for(const i of c.toolCalls)f.has(i.toolUseId)||o.has(i.toolUseId)||d.push({timestampMs:p,toolName:i.toolName,toolUseId:i.toolUseId,relativeX:m(p)})}const g=s.map(c=>{const p=new Date(c.timestamp).getTime(),i=c.durationMs?p+c.durationMs:p+u*.02,N=[];if(c.toolCalls){const x=Object.entries(c.toolCalls).sort(([,w],[,R])=>R-w),b=x.reduce((w,[,R])=>w+R,0);let h=0;for(const[w,R]of x)for(let _=0;_<R;_++){const q=b>1?h/(b-1):.5,Q=p+(i-p)*q;N.push({toolName:w,count:1,relativeX:m(Q)}),h++}}return{subagentType:c.subagentType,description:c.description,startMs:p,endMs:i,startX:m(p),endX:m(i),durationMs:c.durationMs??null,totalTokens:c.totalTokens??null,totalToolUseCount:c.totalToolUseCount??null,toolDots:N}}),j=a.map(c=>{const p=new Date(c.timestamp).getTime();return isNaN(p)?null:{skill:c.skill,args:c.args,timestampMs:p,relativeX:m(p)}}).filter(c=>c!==null),k=n.map(c=>{const p=new Date(c.timestamp).getTime();return isNaN(p)?null:{message:c.message,type:c.type,timestampMs:p,relativeX:m(p)}}).filter(c=>c!==null);return{startMs:r,endMs:y,durationMs:u,mainLane:d,agentLanes:g,skillMarkers:j,errorMarkers:k}}function W(t){const s=t.match(/^mcp__[^_]+_[^_]+_[^_]+__(.+)$/);return s?s[1]:t}const ge={Read:"#60a5fa",Grep:"#60a5fa",Glob:"#60a5fa",Write:"#34d399",Edit:"#34d399",NotebookEdit:"#34d399",Bash:"#fbbf24",Task:"#818cf8",TaskCreate:"#c084fc",TaskUpdate:"#c084fc",TaskList:"#c084fc",TaskGet:"#c084fc",Skill:"#fcd34d",WebSearch:"#22d3ee",WebFetch:"#22d3ee",EnterPlanMode:"#f472b6",ExitPlanMode:"#f472b6",AskUserQuestion:"#a78bfa"},he="#9ca3af";function F(t){return ge[t]??he}const C=90,$=16,D=24,v=32,A=8,Y=4;function fe(t,s,a){const n=s-t;if(n<=0)return[];const l=Math.max(3,Math.round(a/120)),r=n/l,y=[5e3,1e4,15e3,3e4,6e4,2*6e4,5*6e4,10*6e4,15*6e4,30*6e4,60*6e4,120*6e4],u=y.find(g=>g>=r)??y[y.length-1],f=n<5*6e4?"HH:mm:ss":"HH:mm",o=Math.ceil(t/u)*u,d=[];for(let g=o;g<=s;g+=u){const j=(g-t)/n;d.push({ms:g,label:S(new Date(g),f),x:C+j*(a-C-$)})}return d}function ye({data:t,width:s,onHover:a}){const n=M.useRef(null),l=s,r=l-C-$,y=t.skillMarkers.length>0,u=t.errorMarkers.length>0;let m=D;const f=m;m+=v;const o=[];for(let i=0;i<t.agentLanes.length;i++)m+=A,o.push(m),m+=v;let d=0;y&&(m+=A,d=m,m+=v);let g=0;u&&(m+=A,g=m,m+=v);const j=Math.max(m+8,80);function k(i){return C+i*r}const c=M.useCallback(i=>{if(!n.current)return{x:0,y:0};const N=n.current.getBoundingClientRect();return{x:i.clientX-N.left,y:i.clientY-N.top}},[]),p=fe(t.startMs,t.endMs,l);return e.jsxs("svg",{ref:n,width:l,height:j,className:"select-none",role:"img","aria-label":"Session timeline showing tool calls, agent runs, and skill invocations",onMouseLeave:()=>a(null,{x:0,y:0}),children:[e.jsx("line",{x1:C,y1:D-4,x2:l-$,y2:D-4,stroke:"#374151",strokeWidth:1}),p.map(i=>e.jsxs("g",{children:[e.jsx("line",{x1:i.x,y1:D-8,x2:i.x,y2:D-4,stroke:"#4b5563",strokeWidth:1}),e.jsx("text",{x:i.x,y:D-12,textAnchor:"middle",className:"fill-gray-500 text-[10px]",children:i.label})]},i.ms)),e.jsx("text",{x:4,y:f+v/2+4,className:"fill-gray-500 text-[11px] font-medium",children:"Main"}),e.jsx("line",{x1:C,y1:f+v/2,x2:l-$,y2:f+v/2,stroke:"#1f2937",strokeWidth:1,strokeDasharray:"2,4"}),t.mainLane.map(i=>e.jsx("circle",{cx:k(i.relativeX),cy:f+v/2,r:Y,fill:F(i.toolName),opacity:.85,className:"cursor-pointer transition-transform hover:opacity-100",onMouseEnter:N=>a({kind:"tool",toolName:i.toolName,timestamp:new Date(i.timestampMs).toISOString(),toolUseId:i.toolUseId},c(N)),onMouseLeave:()=>a(null,{x:0,y:0}),children:e.jsx("title",{children:i.toolName})},i.toolUseId)),t.agentLanes.map((i,N)=>e.jsx(be,{lane:i,y:o[N],toX:k,laneHeight:v,leftMargin:C,onHover:a,getPosition:c},`${i.subagentType}-${N}`)),y&&e.jsxs(e.Fragment,{children:[e.jsx("text",{x:4,y:d+v/2+4,className:"fill-amber-400/70 text-[11px] font-medium",children:"Skills"}),e.jsx("line",{x1:C,y1:d+v/2,x2:l-$,y2:d+v/2,stroke:"#1f2937",strokeWidth:1,strokeDasharray:"2,4"}),t.skillMarkers.map((i,N)=>{const x=k(i.relativeX),b=d+v/2,h=5;return e.jsx("polygon",{points:`${x},${b-h} ${x+h},${b} ${x},${b+h} ${x-h},${b}`,fill:"#fbbf24",opacity:.85,className:"cursor-pointer hover:opacity-100",onMouseEnter:w=>a({kind:"skill",skill:i.skill,args:i.args,timestamp:new Date(i.timestampMs).toISOString()},c(w)),onMouseLeave:()=>a(null,{x:0,y:0}),children:e.jsxs("title",{children:["/",i.skill]})},`${i.skill}-${N}`)})]}),u&&e.jsxs(e.Fragment,{children:[e.jsx("text",{x:4,y:g+v/2+4,className:"fill-red-400/70 text-[11px] font-medium",children:"Errors"}),e.jsx("line",{x1:C,y1:g+v/2,x2:l-$,y2:g+v/2,stroke:"#1f2937",strokeWidth:1,strokeDasharray:"2,4"}),t.errorMarkers.map((i,N)=>{const x=k(i.relativeX),b=g+v/2,h=5;return e.jsxs("g",{className:"cursor-pointer hover:opacity-100",opacity:.85,onMouseEnter:w=>a({kind:"error",message:i.message,type:i.type,timestamp:new Date(i.timestampMs).toISOString()},c(w)),onMouseLeave:()=>a(null,{x:0,y:0}),children:[e.jsx("line",{x1:x-h,y1:b-h,x2:x+h,y2:b+h,stroke:"#f87171",strokeWidth:2,strokeLinecap:"round"}),e.jsx("line",{x1:x+h,y1:b-h,x2:x-h,y2:b+h,stroke:"#f87171",strokeWidth:2,strokeLinecap:"round"}),e.jsxs("title",{children:[i.type,": ",i.message]})]},`err-${N}`)})]})]})}function be({lane:t,y:s,toX:a,laneHeight:n,leftMargin:l,onHover:r,getPosition:y}){const u=a(t.startX),m=Math.max(a(t.endX)-u,8),f=s+n/2,o=t.subagentType.length>10?t.subagentType.slice(0,10)+"...":t.subagentType;return e.jsxs("g",{children:[e.jsx("text",{x:4,y:f+4,className:"fill-indigo-400/70 text-[11px] font-medium",children:o}),e.jsx("rect",{x:u,y:s+2,width:m,height:n-4,rx:6,fill:"rgba(99, 102, 241, 0.08)",stroke:"rgba(99, 102, 241, 0.2)",strokeWidth:1,className:"cursor-pointer hover:fill-indigo-500/15",onMouseEnter:d=>r({kind:"agent",agent:t},y(d)),onMouseLeave:()=>r(null,{x:0,y:0}),children:e.jsxs("title",{children:[t.subagentType,": ",t.description]})}),e.jsx("line",{x1:u+4,y1:f,x2:u+m-4,y2:f,stroke:"rgba(99, 102, 241, 0.15)",strokeWidth:1}),t.toolDots.map((d,g)=>e.jsx("circle",{cx:a(d.relativeX),cy:f,r:Y-.5,fill:F(d.toolName),opacity:.75,className:"cursor-pointer hover:opacity-100",onMouseEnter:j=>r({kind:"tool",toolName:d.toolName,timestamp:new Date(t.startMs+(d.relativeX-t.startX)/(t.endX-t.startX)*(t.endMs-t.startMs)).toISOString(),toolUseId:`${t.subagentType}-${d.toolName}-${g}`},y(j)),onMouseLeave:()=>r(null,{x:0,y:0}),children:e.jsxs("title",{children:[d.toolName," (",t.subagentType,")"]})},`${d.toolName}-${g}`))]})}function je({item:t,position:s}){return e.jsxs("div",{className:"pointer-events-none absolute z-50 rounded-lg border border-gray-700 bg-gray-900 px-3 py-2 text-xs shadow-xl",style:{left:s.x,top:s.y,transform:"translate(-50%, -100%) translateY(-8px)"},children:[t.kind==="tool"&&e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-gray-100",children:W(t.toolName)}),e.jsx("div",{className:"text-gray-400",children:S(new Date(t.timestamp),"HH:mm:ss")}),e.jsxs("div",{className:"font-mono text-[10px] text-gray-600",children:[t.toolUseId.slice(0,16),"..."]})]}),t.kind==="agent"&&e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-indigo-300",children:t.agent.subagentType}),e.jsx("div",{className:"max-w-48 truncate text-gray-400",children:t.agent.description}),e.jsx("div",{className:"mt-1 flex items-center gap-2 text-gray-500",children:t.agent.durationMs!=null&&e.jsxs("span",{children:[S(new Date(t.agent.startMs),"HH:mm")," -"," ",S(new Date(t.agent.endMs),"HH:mm")," (",P(t.agent.durationMs),")"]})}),e.jsxs("div",{className:"flex items-center gap-2 text-gray-500",children:[t.agent.totalTokens!=null&&e.jsxs("span",{children:[T(t.agent.totalTokens)," tokens"]}),t.agent.totalToolUseCount!=null&&e.jsxs("span",{children:[t.agent.totalToolUseCount," tools"]})]})]}),t.kind==="skill"&&e.jsxs("div",{children:[e.jsxs("div",{className:"font-semibold text-amber-300",children:["/",t.skill]}),t.args&&e.jsx("div",{className:"text-gray-400",children:t.args}),e.jsx("div",{className:"text-gray-500",children:S(new Date(t.timestamp),"HH:mm:ss")})]}),t.kind==="error"&&e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-red-400",children:t.type}),e.jsx("div",{className:"max-w-48 truncate text-gray-400",children:t.message}),e.jsx("div",{className:"text-gray-500",children:S(new Date(t.timestamp),"HH:mm:ss")})]})]})}function Ne({toolNames:t}){const s=[...new Set(t)].slice(0,12);return s.length===0?null:e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 px-1 text-[10px] text-gray-500",children:[s.map(a=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{backgroundColor:F(a)}}),e.jsx("span",{children:W(a)})]},a)),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block h-2 w-2 rotate-45 bg-amber-400"}),e.jsx("span",{children:"Skill"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-red-400 font-bold leading-none",children:"×"}),e.jsx("span",{children:"Error"})]})]})}function ve({turns:t,agents:s,skills:a,errors:n}){const l=M.useRef(null),[r,y]=M.useState(0),[u,m]=M.useState(1),[f,o]=M.useState(null);M.useEffect(()=>{if(!l.current)return;const x=new ResizeObserver(b=>{const h=b[0];h&&y(h.contentRect.width)});return x.observe(l.current),()=>x.disconnect()},[]);const d=M.useMemo(()=>ue(t,s,a,n),[t,s,a,n]),g=M.useMemo(()=>{const x=d.mainLane.map(h=>h.toolName);for(const h of d.agentLanes)for(const w of h.toolDots)x.push(w.toolName);const b={};for(const h of x)b[h]=(b[h]??0)+1;return Object.entries(b).sort(([,h],[,w])=>w-h).map(([h])=>h)},[d]),j=(x,b)=>{o(x?{item:x,position:b}:null)};if(t.length===0)return e.jsx("div",{className:"py-8 text-center text-sm text-gray-500",children:"No timeline data available"});const k=new Set(s.map(x=>x.toolUseId)),c=new Set(a.map(x=>x.toolUseId));let p=0,i=0,N=0;for(const x of t)if(x.type==="user"&&x.message?.trim()&&p++,x.type==="assistant"){i++;for(const b of x.toolCalls)!k.has(b.toolUseId)&&!c.has(b.toolUseId)&&N++}return e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-4",children:[e.jsx(I,{label:"User commands",value:p,color:"blue"}),e.jsx(I,{label:"AI responses",value:i,color:"purple"}),N>0&&e.jsx(I,{label:"Tool calls",value:N,color:"gray"}),s.length>0&&e.jsx(I,{label:"Agents",value:s.length,color:"indigo"}),a.length>0&&e.jsx(I,{label:"Skills",value:a.length,color:"amber"}),n.length>0&&e.jsx(I,{label:"Errors",value:n.length,color:"red"})]}),e.jsxs("div",{className:"mb-3 flex items-start justify-between gap-2",children:[e.jsx("div",{className:"flex-1",children:g.length>0&&e.jsx(Ne,{toolNames:g})}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[e.jsx("button",{type:"button",onClick:()=>m(x=>Math.max(1,x-.5)),disabled:u<=1,className:"rounded bg-gray-800 px-2 py-0.5 text-xs text-gray-300 transition-colors hover:bg-gray-700 disabled:opacity-30",title:"Zoom out",children:"−"}),e.jsx("span",{className:"min-w-[3rem] text-center text-[10px] tabular-nums text-gray-500",children:u===1?"Fit":`${u.toFixed(1)}x`}),e.jsx("button",{type:"button",onClick:()=>m(x=>Math.min(8,x+.5)),disabled:u>=8,className:"rounded bg-gray-800 px-2 py-0.5 text-xs text-gray-300 transition-colors hover:bg-gray-700 disabled:opacity-30",title:"Zoom in",children:"+"}),u>1&&e.jsx("button",{type:"button",onClick:()=>m(1),className:"ml-1 rounded bg-gray-800 px-2 py-0.5 text-[10px] text-gray-400 transition-colors hover:bg-gray-700",title:"Reset zoom",children:"Reset"})]})]}),e.jsx("div",{ref:l,className:"relative overflow-x-auto",children:r>0&&e.jsxs(e.Fragment,{children:[e.jsx(ye,{data:d,width:Math.max(r*u,400),onHover:j}),f&&e.jsx(je,{item:f.item,position:f.position})]})})]})}function I({label:t,value:s,color:a}){const n={blue:"bg-blue-500/15 text-blue-400",purple:"bg-purple-500/15 text-purple-400",gray:"bg-gray-800 text-gray-300",indigo:"bg-indigo-500/15 text-indigo-400",amber:"bg-amber-500/15 text-amber-400",red:"bg-red-500/15 text-red-400"};return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`rounded-md px-2 py-1 text-sm font-bold tabular-nums ${n[a]}`,children:s}),e.jsx("span",{className:"text-[11px] text-gray-500",children:t})]})}function ke({contextWindow:t,tokens:s}){const[a,n]=M.useState(!1);if(!t)return e.jsx(we,{tokens:s});const{contextLimit:l,modelName:r,systemOverhead:y,currentContextSize:u,messagesEstimate:m,freeSpace:f,autocompactBuffer:o,usagePercent:d,snapshots:g}=t,j=y/l*100,k=m/l*100,c=o/l*100,p=Math.max(0,100-j-k),i=r.replace(/^claude-/,"").split("-202")[0],N=g.map(x=>({turn:x.turnIndex,context:x.contextSize}));return e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Context Window"}),e.jsx("span",{className:"rounded bg-gray-800 px-1.5 py-0.5 text-[10px] font-mono text-gray-400",children:i})]}),e.jsxs("div",{className:"mt-1 flex items-baseline gap-1",children:[e.jsx("span",{className:"text-2xl font-bold text-white",children:T(u)}),e.jsxs("span",{className:"text-sm text-gray-500",children:["/ ",T(l)]}),e.jsxs("span",{className:"text-sm text-gray-400",children:["(",d,"%)"]})]}),e.jsx("p",{className:"text-[10px] text-gray-500",children:"~estimated from token usage"}),e.jsxs("div",{className:"mt-3 flex h-3 overflow-hidden rounded-full bg-gray-800",children:[e.jsx("div",{className:"bg-purple-500",style:{width:`${j}%`},title:`System: ~${T(y)}`}),e.jsx("div",{className:"bg-blue-500",style:{width:`${k}%`},title:`Messages: ~${T(m)}`}),p>0&&e.jsx(e.Fragment,{children:p>c?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bg-gray-700",style:{width:`${p-c}%`}}),e.jsx("div",{className:"autocompact-stripe",style:{width:`${Math.min(c,p)}%`}})]}):e.jsx("div",{className:"autocompact-stripe",style:{width:`${p}%`}})})]}),e.jsxs("div",{className:"mt-1 flex gap-3 text-[10px] text-gray-500",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-purple-500"}),"system"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-blue-500"}),"messages"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-gray-700"}),"free"]})]}),e.jsxs("div",{className:"mt-3 space-y-1.5",children:[e.jsx(L,{label:"System overhead",value:y,total:l,color:"bg-purple-500",prefix:"~"}),e.jsx(L,{label:"Messages",value:m,total:l,color:"bg-blue-500",prefix:"~"}),e.jsx(L,{label:"Autocompact buffer",value:o,total:l,color:"bg-amber-500"}),e.jsx(L,{label:"Free space",value:f,total:l,color:"bg-gray-600"})]}),N.length>1&&e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"mb-1 text-[10px] text-gray-500",children:"Context growth"}),e.jsx(ee,{width:"100%",height:96,children:e.jsxs(te,{data:N,children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"contextGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:.3}),e.jsx("stop",{offset:"100%",stopColor:"#3b82f6",stopOpacity:.05})]})}),e.jsx(se,{domain:[0,l],hide:!0}),e.jsx(ae,{contentStyle:{background:"#1f2937",border:"1px solid #374151",borderRadius:"8px",fontSize:"11px"},labelFormatter:x=>`Turn ${x}`,formatter:x=>[T(x),"Context"]}),e.jsx(B,{y:l,stroke:"#ef4444",strokeDasharray:"4 4",strokeOpacity:.5}),e.jsx(B,{y:l-o,stroke:"#f59e0b",strokeDasharray:"2 4",strokeOpacity:.3}),e.jsx(ne,{type:"stepAfter",dataKey:"context",stroke:"#3b82f6",fill:"url(#contextGrad)",strokeWidth:1.5,dot:!1})]})})]}),e.jsxs("button",{onClick:()=>n(!a),className:"mt-3 flex w-full items-center gap-1 text-xs text-gray-400 hover:text-gray-300 transition-colors",children:[e.jsx("span",{className:"text-[10px]",children:a?"▾":"▸"}),"Token Details"]}),a&&e.jsx(Te,{tokens:s}),e.jsx("style",{children:`
|
|
2
|
-
.autocompact-stripe {
|
|
3
|
-
background: repeating-linear-gradient(
|
|
4
|
-
-45deg,
|
|
5
|
-
#78716c,
|
|
6
|
-
#78716c 2px,
|
|
7
|
-
#f59e0b 2px,
|
|
8
|
-
#f59e0b 4px
|
|
9
|
-
);
|
|
10
|
-
opacity: 0.4;
|
|
11
|
-
}
|
|
12
|
-
`})]})}function L({label:t,value:s,total:a,color:n,prefix:l=""}){const r=Math.max(0,Math.min(100,s/a*100));return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-32 text-xs text-gray-400 shrink-0",children:t}),e.jsxs("span",{className:"w-16 text-right text-xs font-mono text-gray-300 shrink-0",children:[l,T(s)]}),e.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-gray-800 overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${n}`,style:{width:`${r}%`,opacity:.7}})})]})}function Te({tokens:t}){const s=t.inputTokens+t.outputTokens+t.cacheReadInputTokens+t.cacheCreationInputTokens,a=[{label:"Input",value:t.inputTokens,color:"bg-blue-400"},{label:"Output",value:t.outputTokens,color:"bg-emerald-400"},{label:"Cache Read",value:t.cacheReadInputTokens,color:"bg-amber-400"},{label:"Cache Create",value:t.cacheCreationInputTokens,color:"bg-purple-400"}];return e.jsxs("div",{className:"mt-2 space-y-1.5",children:[a.map(n=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-gray-400",children:n.label}),e.jsx("span",{className:"text-xs font-mono text-gray-300",children:T(n.value)})]},n.label)),s>0&&e.jsx("div",{className:"flex h-2 overflow-hidden rounded-full bg-gray-800",children:a.filter(n=>n.value>0).map(n=>e.jsx("div",{className:`${n.color} opacity-60`,style:{width:`${n.value/s*100}%`}},n.label))})]})}function we({tokens:t}){const s=t.inputTokens+t.outputTokens,a=s+t.cacheReadInputTokens+t.cacheCreationInputTokens,n=[{label:"Input",value:t.inputTokens,color:"text-blue-400"},{label:"Output",value:t.outputTokens,color:"text-emerald-400"},{label:"Cache Read",value:t.cacheReadInputTokens,color:"text-amber-400"},{label:"Cache Create",value:t.cacheCreationInputTokens,color:"text-purple-400"}];return e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Token Usage"}),e.jsx("p",{className:"mt-1 text-2xl font-bold text-white",children:T(s)}),e.jsxs("p",{className:"text-[10px] text-gray-500",children:["input + output (",T(a)," incl. cache)"]}),e.jsx("div",{className:"mt-3 space-y-2",children:n.map(l=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-gray-400",children:l.label}),e.jsx("span",{className:`text-xs font-mono ${l.color}`,children:T(l.value)})]},l.label))}),a>0&&e.jsx("div",{className:"mt-3 flex h-2 overflow-hidden rounded-full bg-gray-800",children:n.filter(l=>l.value>0).map(l=>e.jsx("div",{className:`${l.color.replace("text-","bg-")} opacity-60`,style:{width:`${l.value/a*100}%`}},l.label))})]})}function Me({toolFrequency:t}){const s=Object.entries(t).sort(([,n],[,l])=>l-n),a=s[0]?.[1]??1;return s.length===0?e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Tool Usage"}),e.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"No tools used"})]}):e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Tool Usage"}),e.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[s.length," tools, ",s.reduce((n,[,l])=>n+l,0)," calls"]}),e.jsx("div",{className:"mt-3 space-y-1.5",children:s.slice(0,15).map(([n,l])=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-32 shrink-0 truncate text-xs font-mono text-gray-400",title:n,children:W(n)}),e.jsx("div",{className:"flex-1",children:e.jsx("div",{className:"h-4 rounded bg-blue-500/20",style:{width:`${l/a*100}%`},children:e.jsx("span",{className:"px-1.5 text-xs text-blue-300",children:l})})})]},n))})]})}function Ce({errors:t}){return t.length===0?null:e.jsxs("div",{className:"rounded-xl border border-red-900/50 bg-red-950/20 p-4",children:[e.jsxs("h3",{className:"text-sm font-semibold text-red-400",children:["Errors (",t.length,")"]}),e.jsx("div",{className:"mt-3 space-y-2",children:t.map((s,a)=>e.jsxs("div",{className:"rounded-lg bg-red-950/30 p-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-mono text-red-300",children:s.type}),s.timestamp&&e.jsx("span",{className:"text-xs text-gray-500",children:G(s.timestamp)})]}),e.jsx("p",{className:"mt-1 text-xs text-red-200/80",children:s.message})]},a))})]})}function Se({agents:t,skills:s}){const{data:a}=O(de),{agentCosts:n,totalAgentCost:l}=M.useMemo(()=>{if(!a)return{agentCosts:new Map,totalAgentCost:0};const o=le(a),d=new Map;let g=0;for(let j=0;j<t.length;j++){const k=t[j];if(!k.tokens)continue;const p={[k.model??"claude-sonnet-4"]:k.tokens},i=re(p,o);d.set(j,i.totalUSD),g+=i.totalUSD}return{agentCosts:d,totalAgentCost:g}},[a,t]);if(t.length===0&&s.length===0)return null;const r=new Map;for(const o of t)r.set(o.subagentType,(r.get(o.subagentType)??0)+1);const y=[...r.entries()].sort(([,o],[,d])=>d-o),u=t.reduce((o,d)=>o+(d.totalTokens??H(d)??0),0),m=new Map;for(const o of s)m.set(o.skill,(m.get(o.skill)??0)+1);const f=[...m.entries()].sort(([,o],[,d])=>d-o);return e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Agents & Skills"}),e.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[t.length," agent dispatch",t.length!==1?"es":"",u>0&&e.jsxs("span",{className:"ml-1 text-indigo-400",children:["(",T(u)," tokens",l>0&&` · ~${U(l)}`,")"]}),s.length>0&&`, ${s.length} skill invocation${s.length!==1?"s":""}`]}),y.length>0&&e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"mb-1.5 text-[10px] font-semibold uppercase tracking-wider text-gray-500",children:"Agent Types"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:y.map(([o,d])=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-indigo-500/15 px-2 py-0.5 text-xs text-indigo-300",children:[o,d>1&&e.jsxs("span",{className:"text-indigo-400/60",children:["×",d]})]},o))})]}),f.length>0&&e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"mb-1.5 text-[10px] font-semibold uppercase tracking-wider text-gray-500",children:"Skills"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:f.map(([o,d])=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-amber-500/15 px-2 py-0.5 text-xs text-amber-300",children:["/",o,d>1&&e.jsxs("span",{className:"text-amber-400/60",children:["×",d]})]},o))})]}),t.length>0&&e.jsxs("div",{className:"mt-3 space-y-1",children:[e.jsx("p",{className:"mb-1.5 text-[10px] font-semibold uppercase tracking-wider text-gray-500",children:"Agent Dispatches"}),t.map((o,d)=>{const g=o.totalTokens??H(o),j=n.get(d);return e.jsxs("div",{className:"flex items-start gap-2 rounded bg-gray-950/40 px-2 py-1.5",children:[e.jsx("span",{className:"shrink-0 rounded bg-indigo-500/20 px-1.5 py-0.5 text-[10px] font-semibold text-indigo-300",children:o.subagentType}),o.model&&e.jsx("span",{className:"shrink-0 rounded bg-gray-800 px-1.5 py-0.5 text-[10px] font-mono text-gray-400",children:o.model.replace(/^claude-/,"").replace(/-\d{8}$/,"")}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-gray-400",children:o.description}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[g!=null&&g>0&&e.jsx("span",{className:"text-[10px] font-mono text-indigo-400/80",children:T(g)}),j!=null&&j>0&&e.jsxs("span",{className:"text-[10px] font-mono text-emerald-400/80",children:["~",U(j)]}),o.totalToolUseCount!=null&&e.jsxs("span",{className:"text-[10px] text-gray-500",children:[o.totalToolUseCount," tools"]}),o.durationMs!=null&&e.jsx("span",{className:"text-[10px] text-gray-600",children:P(o.durationMs)}),o.timestamp&&e.jsx("span",{className:"text-[10px] text-gray-600",children:S(new Date(o.timestamp),"HH:mm:ss")})]})]},`a-${d}`)})]}),s.length>0&&e.jsxs("div",{className:"mt-3 space-y-1",children:[e.jsx("p",{className:"mb-1.5 text-[10px] font-semibold uppercase tracking-wider text-gray-500",children:"Skill Invocations"}),s.map((o,d)=>e.jsxs("div",{className:"flex items-start gap-2 rounded bg-gray-950/40 px-2 py-1.5",children:[e.jsxs("span",{className:"shrink-0 rounded bg-amber-500/20 px-1.5 py-0.5 text-[10px] font-semibold text-amber-300",children:["/",o.skill]}),o.args&&e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-mono text-gray-500",children:o.args}),o.timestamp&&e.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-gray-600",children:S(new Date(o.timestamp),"HH:mm:ss")})]},`s-${d}`))]})]})}function H(t){if(t.tokens)return t.tokens.inputTokens+t.tokens.outputTokens}const De={pending:{label:"Pending",bg:"bg-gray-500/20",text:"text-gray-400"},in_progress:{label:"In Progress",bg:"bg-blue-500/20",text:"text-blue-400"},completed:{label:"Done",bg:"bg-emerald-500/20",text:"text-emerald-400"},deleted:{label:"Deleted",bg:"bg-red-500/20",text:"text-red-400"}};function Ie({tasks:t}){if(t.length===0)return null;const s=t.filter(n=>n.status==="completed").length,a=t.filter(n=>n.status!=="deleted").length;return e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Tasks"}),e.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[s,"/",a," completed"]}),e.jsx("div",{className:"mt-3 space-y-1",children:t.map((n,l)=>{const r=De[n.status];return e.jsxs("div",{className:"flex items-start gap-2 rounded bg-gray-950/40 px-2 py-1.5",children:[e.jsx("span",{className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold ${r.bg} ${r.text}`,children:r.label}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"text-xs text-gray-300",children:n.subject}),n.description&&e.jsx("p",{className:"mt-0.5 truncate text-[10px] text-gray-500",children:n.description})]}),n.taskId&&e.jsxs("span",{className:"shrink-0 text-[10px] font-mono text-gray-600",children:["#",n.taskId]}),n.timestamp&&e.jsx("span",{className:"shrink-0 text-[10px] text-gray-600",children:S(new Date(n.timestamp),"HH:mm:ss")})]},n.taskId||l)})})]})}function $e({tokensByModel:t}){const{cost:s,isLoading:a}=z(t);return a?e.jsx("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:e.jsx("div",{className:"h-6 w-32 animate-pulse rounded bg-gray-800"})}):!s||s.totalUSD===0?e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Cost Estimation"}),e.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"No token data available"})]}):e.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Cost Estimation"}),e.jsxs("span",{className:"font-mono text-lg font-bold text-white",children:["~",U(s.totalUSD)]})]}),e.jsxs("div",{className:"mt-4",children:[e.jsx("p",{className:"text-xs font-medium text-gray-400",children:"By Category"}),e.jsx(Ue,{cost:s}),e.jsx(Re,{cost:s})]}),e.jsxs("div",{className:"mt-4",children:[e.jsx("p",{className:"text-xs font-medium text-gray-400",children:"By Model"}),e.jsx(Le,{cost:s})]}),e.jsxs("div",{className:"mt-3 flex items-center justify-between border-t border-gray-800 pt-3",children:[e.jsx("p",{className:"text-[10px] text-gray-600",children:"Estimated based on API pricing. Actual costs may vary."}),e.jsx(E,{to:"/settings",className:"text-[10px] text-gray-500 hover:text-gray-300",children:"Configure pricing"})]})]})}function Ue({cost:t}){const s=[{label:"Input tokens",value:t.byCategory.input,color:"text-blue-400"},{label:"Output tokens",value:t.byCategory.output,color:"text-emerald-400"},{label:"Cache read",value:t.byCategory.cacheRead,color:"text-amber-400"},{label:"Cache write",value:t.byCategory.cacheWrite,color:"text-purple-400"}];return e.jsx("div",{className:"mt-2 space-y-1",children:s.map(a=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-gray-400",children:a.label}),e.jsx("span",{className:`font-mono text-xs ${a.color}`,children:U(a.value)})]},a.label))})}function Re({cost:t}){if(t.totalUSD===0)return null;const s=[{key:"input",value:t.byCategory.input,color:"bg-blue-400"},{key:"output",value:t.byCategory.output,color:"bg-emerald-400"},{key:"cacheRead",value:t.byCategory.cacheRead,color:"bg-amber-400"},{key:"cacheWrite",value:t.byCategory.cacheWrite,color:"bg-purple-400"}];return e.jsx("div",{className:"mt-2 flex h-2 overflow-hidden rounded-full bg-gray-800",children:s.map(a=>{const n=a.value/t.totalUSD*100;return n<.5?null:e.jsx("div",{className:`${a.color} opacity-60`,style:{width:`${n}%`}},a.key)})})}function Le({cost:t}){const s=Object.values(t.byModel).sort((a,n)=>n.totalCost-a.totalCost);return s.length===0?null:e.jsx("div",{className:"mt-2 space-y-1",children:s.map(a=>{const n=t.totalUSD>0?Math.round(a.totalCost/t.totalUSD*100):0;return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-mono text-xs text-gray-300",children:a.displayName}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-mono text-xs text-gray-300",children:U(a.totalCost)}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["(",n,"%)"]}),e.jsxs("span",{className:"text-[10px] text-gray-600",children:[T(a.tokens.inputTokens+a.tokens.outputTokens+a.tokens.cacheReadInputTokens+a.tokens.cacheCreationInputTokens)," ","tok"]})]})]},a.modelId)})})}function Ae({tokensByModel:t}){const{cost:s,isLoading:a}=z(t);return a||!s||s.totalUSD===0?null:e.jsxs("span",{className:"font-mono text-xs text-emerald-400",title:"Estimated cost based on API pricing",children:["~",U(s.totalUSD)]})}function Ee(){return e.jsxs("div",{className:"mb-4 flex items-center gap-2 rounded-lg border border-green-800 bg-green-900/30 px-4 py-2 text-sm text-green-300",children:[e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-green-400 opacity-75"}),e.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-green-500"})]}),"This session is currently active. Data refreshes automatically."]})}function Oe(t){const{data:s}=O(xe);return s?.some(a=>a.sessionId===t)??!1}function He(){const{sessionId:t}=X.useParams(),{project:s=""}=X.useSearch(),{privacyMode:a,anonymizeProjectName:n}=Z(),l=Oe(t),{data:r,isLoading:y,error:u}=O(pe(t,s,l));if(y)return e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"h-8 w-48 animate-pulse rounded bg-gray-800"}),e.jsx("div",{className:"h-64 animate-pulse rounded-xl bg-gray-900/50"})]});if(u||!r)return e.jsxs("div",{className:"py-12 text-center",children:[e.jsxs("p",{className:"text-sm text-red-400",children:["Failed to load session: ",u?.message??"Not found"]}),e.jsx(E,{to:"/sessions",className:"mt-2 inline-block text-sm text-blue-400 hover:underline",children:"Back to sessions"})]});const m=r.turns[0]?.timestamp,f=r.turns[r.turns.length-1]?.timestamp,o=m&&f?new Date(f).getTime()-new Date(m).getTime():0;return e.jsxs("div",{children:[l&&e.jsx(Ee,{}),e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx(E,{to:"/sessions",className:"text-xs text-gray-500 hover:text-gray-300",children:"← Sessions"}),e.jsx("h1",{className:"mt-1 text-xl font-bold text-white",children:a?n(r.projectName):r.projectName}),e.jsxs("div",{className:"mt-1 flex items-center gap-3 text-xs text-gray-400",children:[r.branch&&e.jsx("span",{className:"font-mono",children:r.branch}),m&&e.jsx("span",{children:G(m)}),e.jsx("span",{children:P(o)}),e.jsxs("span",{children:[r.turns.length," turns"]}),e.jsx(Ae,{tokensByModel:r.tokensByModel})]}),r.models.length>0&&e.jsx("div",{className:"mt-1 flex gap-1",children:r.models.map(d=>e.jsx("span",{className:"rounded bg-gray-800 px-1.5 py-0.5 text-[10px] font-mono text-gray-400",children:d.replace(/^claude-/,"").split("-202")[0]},d))})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(oe,{options:[{label:"Export Session (JSON)",onClick:()=>ie(ce(r),`session-${t.slice(0,8)}.json`,"application/json")}]}),e.jsx("span",{className:"font-mono text-xs text-gray-600",children:t.slice(0,8)})]})]}),e.jsxs("div",{className:"mt-6 grid grid-cols-1 gap-4 md:grid-cols-2",children:[e.jsx(ke,{contextWindow:r.contextWindow,tokens:r.totalTokens}),e.jsx(Me,{toolFrequency:r.toolFrequency})]}),e.jsx("div",{className:"mt-4",children:e.jsx($e,{tokensByModel:r.tokensByModel})}),(r.agents.length>0||r.skills.length>0)&&e.jsx("div",{className:"mt-4",children:e.jsx(Se,{agents:r.agents,skills:r.skills})}),r.tasks.length>0&&e.jsx("div",{className:"mt-4",children:e.jsx(Ie,{tasks:r.tasks})}),e.jsx(Ce,{errors:r.errors}),e.jsxs("div",{className:"mt-6",children:[e.jsx("h2",{className:"mb-3 text-sm font-semibold text-gray-300",children:"Timeline"}),e.jsx(ve,{turns:r.turns,agents:r.agents,skills:r.skills,errors:r.errors})]})]})}export{He as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-800:oklch(44.8% .119 151.328);--color-green-900:oklch(39.3% .095 152.535);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-cyan-400:oklch(78.9% .154 211.53);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-900:oklch(35.9% .144 278.697);--color-indigo-950:oklch(25.7% .09 281.288);--color-violet-400:oklch(70.2% .183 293.541);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-pink-400:oklch(71.8% .202 349.761);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-gray-950:oklch(13% .028 261.692);--color-white:#fff;--spacing:.25rem;--container-5xl:64rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wider:.05em;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-ping:ping 1s cubic-bezier(0,0,.2,1)infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.static{position:static}.-top-8{top:calc(var(--spacing)*-8)}.right-0{right:calc(var(--spacing)*0)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-1\/2{left:50%}.z-10{z-index:10}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-6{margin-top:calc(var(--spacing)*6)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-6{height:calc(var(--spacing)*6)}.h-8{height:calc(var(--spacing)*8)}.h-14{height:calc(var(--spacing)*14)}.h-20{height:calc(var(--spacing)*20)}.h-28{height:calc(var(--spacing)*28)}.h-64{height:calc(var(--spacing)*64)}.h-72{height:calc(var(--spacing)*72)}.h-full{height:100%}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-32{width:calc(var(--spacing)*32)}.w-48{width:calc(var(--spacing)*48)}.w-56{width:calc(var(--spacing)*56)}.w-full{width:100%}.max-w-5xl{max-width:var(--container-5xl)}.max-w-48{max-width:calc(var(--spacing)*48)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[2rem\]{min-width:2rem}.min-w-\[3rem\]{min-width:3rem}.min-w-\[200px\]{min-width:200px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-45{rotate:45deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing)*3)}.gap-y-1{row-gap:calc(var(--spacing)*1)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-l-lg{border-top-left-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-lg)}.rounded-r-lg{border-top-right-radius:var(--radius-lg);border-bottom-right-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-blue-500{border-color:var(--color-blue-500)}.border-blue-500\/50{border-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/50{border-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.border-gray-700{border-color:var(--color-gray-700)}.border-gray-800{border-color:var(--color-gray-800)}.border-gray-800\/50{border-color:#1e293980}@supports (color:color-mix(in lab,red,red)){.border-gray-800\/50{border-color:color-mix(in oklab,var(--color-gray-800)50%,transparent)}}.border-green-800{border-color:var(--color-green-800)}.border-indigo-500\/10{border-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/10{border-color:color-mix(in oklab,var(--color-indigo-500)10%,transparent)}}.border-indigo-500\/20{border-color:#625fff33}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/20{border-color:color-mix(in oklab,var(--color-indigo-500)20%,transparent)}}.border-red-900\/50{border-color:#82181a80}@supports (color:color-mix(in lab,red,red)){.border-red-900\/50{border-color:color-mix(in oklab,var(--color-red-900)50%,transparent)}}.border-transparent{border-color:#0000}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/15{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/15{background-color:color-mix(in oklab,var(--color-amber-500)15%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-blue-400{background-color:var(--color-blue-400)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\/15{background-color:#3080ff26}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/15{background-color:color-mix(in oklab,var(--color-blue-500)15%,transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500)15%,transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500)20%,transparent)}}.bg-gray-500{background-color:var(--color-gray-500)}.bg-gray-500\/15{background-color:#6a728226}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/15{background-color:color-mix(in oklab,var(--color-gray-500)15%,transparent)}}.bg-gray-500\/20{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/20{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.bg-gray-600{background-color:var(--color-gray-600)}.bg-gray-700{background-color:var(--color-gray-700)}.bg-gray-800{background-color:var(--color-gray-800)}.bg-gray-800\/50{background-color:#1e293980}@supports (color:color-mix(in lab,red,red)){.bg-gray-800\/50{background-color:color-mix(in oklab,var(--color-gray-800)50%,transparent)}}.bg-gray-900{background-color:var(--color-gray-900)}.bg-gray-900\/50{background-color:#10182880}@supports (color:color-mix(in lab,red,red)){.bg-gray-900\/50{background-color:color-mix(in oklab,var(--color-gray-900)50%,transparent)}}.bg-gray-950{background-color:var(--color-gray-950)}.bg-gray-950\/40{background-color:#03071266}@supports (color:color-mix(in lab,red,red)){.bg-gray-950\/40{background-color:color-mix(in oklab,var(--color-gray-950)40%,transparent)}}.bg-green-400{background-color:var(--color-green-400)}.bg-green-500{background-color:var(--color-green-500)}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.bg-green-900\/30{background-color:#0d542b4d}@supports (color:color-mix(in lab,red,red)){.bg-green-900\/30{background-color:color-mix(in oklab,var(--color-green-900)30%,transparent)}}.bg-indigo-500\/15{background-color:#625fff26}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/15{background-color:color-mix(in oklab,var(--color-indigo-500)15%,transparent)}}.bg-indigo-500\/20{background-color:#625fff33}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/20{background-color:color-mix(in oklab,var(--color-indigo-500)20%,transparent)}}.bg-indigo-900\/30{background-color:#312c854d}@supports (color:color-mix(in lab,red,red)){.bg-indigo-900\/30{background-color:color-mix(in oklab,var(--color-indigo-900)30%,transparent)}}.bg-indigo-950\/15{background-color:#1e1a4d26}@supports (color:color-mix(in lab,red,red)){.bg-indigo-950\/15{background-color:color-mix(in oklab,var(--color-indigo-950)15%,transparent)}}.bg-purple-400{background-color:var(--color-purple-400)}.bg-purple-500{background-color:var(--color-purple-500)}.bg-purple-500\/15{background-color:#ac4bff26}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/15{background-color:color-mix(in oklab,var(--color-purple-500)15%,transparent)}}.bg-red-500\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/15{background-color:color-mix(in oklab,var(--color-red-500)15%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-red-950\/20{background-color:#46080933}@supports (color:color-mix(in lab,red,red)){.bg-red-950\/20{background-color:color-mix(in oklab,var(--color-red-950)20%,transparent)}}.bg-red-950\/30{background-color:#4608094d}@supports (color:color-mix(in lab,red,red)){.bg-red-950\/30{background-color:color-mix(in oklab,var(--color-red-950)30%,transparent)}}.fill-amber-400\/70{fill:#fcbb00b3}@supports (color:color-mix(in lab,red,red)){.fill-amber-400\/70{fill:color-mix(in oklab,var(--color-amber-400)70%,transparent)}}.fill-gray-500{fill:var(--color-gray-500)}.fill-indigo-400\/70{fill:#7d87ffb3}@supports (color:color-mix(in lab,red,red)){.fill-indigo-400\/70{fill:color-mix(in oklab,var(--color-indigo-400)70%,transparent)}}.fill-red-400\/70{fill:#ff6568b3}@supports (color:color-mix(in lab,red,red)){.fill-red-400\/70{fill:color-mix(in oklab,var(--color-red-400)70%,transparent)}}.p-2\.5{padding:calc(var(--spacing)*2.5)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.px-1{padding-inline:calc(var(--spacing)*1)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-12{padding-block:calc(var(--spacing)*12)}.pt-1\.5{padding-top:calc(var(--spacing)*1.5)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.whitespace-nowrap{white-space:nowrap}.text-amber-300{color:var(--color-amber-300)}.text-amber-400{color:var(--color-amber-400)}.text-amber-400\/60{color:#fcbb0099}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/60{color:color-mix(in oklab,var(--color-amber-400)60%,transparent)}}.text-blue-300{color:var(--color-blue-300)}.text-blue-400{color:var(--color-blue-400)}.text-cyan-400{color:var(--color-cyan-400)}.text-emerald-400{color:var(--color-emerald-400)}.text-emerald-400\/80{color:#00d294cc}@supports (color:color-mix(in lab,red,red)){.text-emerald-400\/80{color:color-mix(in oklab,var(--color-emerald-400)80%,transparent)}}.text-gray-100{color:var(--color-gray-100)}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-green-300{color:var(--color-green-300)}.text-green-400{color:var(--color-green-400)}.text-indigo-300{color:var(--color-indigo-300)}.text-indigo-300\/70{color:#a4b3ffb3}@supports (color:color-mix(in lab,red,red)){.text-indigo-300\/70{color:color-mix(in oklab,var(--color-indigo-300)70%,transparent)}}.text-indigo-400{color:var(--color-indigo-400)}.text-indigo-400\/50{color:#7d87ff80}@supports (color:color-mix(in lab,red,red)){.text-indigo-400\/50{color:color-mix(in oklab,var(--color-indigo-400)50%,transparent)}}.text-indigo-400\/60{color:#7d87ff99}@supports (color:color-mix(in lab,red,red)){.text-indigo-400\/60{color:color-mix(in oklab,var(--color-indigo-400)60%,transparent)}}.text-indigo-400\/80{color:#7d87ffcc}@supports (color:color-mix(in lab,red,red)){.text-indigo-400\/80{color:color-mix(in oklab,var(--color-indigo-400)80%,transparent)}}.text-pink-400{color:var(--color-pink-400)}.text-purple-400{color:var(--color-purple-400)}.text-red-200\/80{color:#ffcacacc}@supports (color:color-mix(in lab,red,red)){.text-red-200\/80{color:color-mix(in oklab,var(--color-red-200)80%,transparent)}}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-violet-400{color:var(--color-violet-400)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.placeholder-gray-500::placeholder{color:var(--color-gray-500)}.opacity-60{opacity:.6}.opacity-75{opacity:.75}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:block:is(:where(.group):hover *){display:block}.hover\:border-gray-600:hover{border-color:var(--color-gray-600)}.hover\:border-gray-700:hover{border-color:var(--color-gray-700)}.hover\:bg-blue-500:hover{background-color:var(--color-blue-500)}.hover\:bg-gray-700:hover{background-color:var(--color-gray-700)}.hover\:bg-gray-800\/30:hover{background-color:#1e29394d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-800\/30:hover{background-color:color-mix(in oklab,var(--color-gray-800)30%,transparent)}}.hover\:bg-gray-800\/50:hover{background-color:#1e293980}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-800\/50:hover{background-color:color-mix(in oklab,var(--color-gray-800)50%,transparent)}}.hover\:bg-gray-900:hover{background-color:var(--color-gray-900)}.hover\:bg-indigo-950\/30:hover{background-color:#1e1a4d4d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-indigo-950\/30:hover{background-color:color-mix(in oklab,var(--color-indigo-950)30%,transparent)}}.hover\:fill-indigo-500\/15:hover{fill:#625fff26}@supports (color:color-mix(in lab,red,red)){.hover\:fill-indigo-500\/15:hover{fill:color-mix(in oklab,var(--color-indigo-500)15%,transparent)}}.hover\:text-gray-200:hover{color:var(--color-gray-200)}.hover\:text-gray-300:hover{color:var(--color-gray-300)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:border-blue-500:focus{border-color:var(--color-blue-500)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-blue-500:focus{--tw-ring-color:var(--color-blue-500)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}@media(hover:hover){.disabled\:hover\:bg-gray-800:disabled:hover{background-color:var(--color-gray-800)}.disabled\:hover\:text-gray-400:disabled:hover{color:var(--color-gray-400)}}@media(min-width:40rem){.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:justify-between{justify-content:space-between}}@media(min-width:48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media(min-width:64rem){.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,r as x,u as S,L as T,d as w,e as C}from"./main-CM5g2n-_.js";import{u as j}from"./createServerFn-B0pEGqTk.js";import{p as k,a as D}from"./sessions.queries-AUVV0tJj.js";import{d as P,e as R,h as L}from"./format-Bsprb3az.js";function M({isActive:s}){return s?e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-emerald-500/15 px-2.5 py-0.5 text-xs font-medium text-emerald-400",children:[e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75"}),e.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-emerald-500"})]}),"Active"]}):e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-gray-500/15 px-2.5 py-0.5 text-xs font-medium text-gray-400",children:[e.jsx("span",{className:"h-2 w-2 rounded-full bg-gray-500"}),"Completed"]})}function $({startedAt:s}){const[l,n]=x.useState(()=>Date.now()-new Date(s).getTime());return x.useEffect(()=>{const t=setInterval(()=>{n(Date.now()-new Date(s).getTime())},1e3);return()=>clearInterval(t)},[s]),e.jsx("span",{className:"text-emerald-400",children:P(l)})}function _({session:s}){const{privacyMode:l,anonymizePath:n,anonymizeProjectName:t}=S(),c=l?t(s.projectName):s.projectName,a=s.cwd?l?n(s.cwd):s.cwd:null;return e.jsxs(T,{to:"/sessions/$sessionId",params:{sessionId:s.sessionId},search:{project:s.projectPath},className:"group block rounded-xl border border-gray-800 bg-gray-900/50 p-4 transition-all hover:border-gray-700 hover:bg-gray-900",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"truncate text-sm font-semibold text-white",children:c}),e.jsx(M,{isActive:s.isActive})]}),s.branch&&e.jsx("p",{className:"mt-1 truncate text-xs text-gray-500",children:e.jsx("span",{className:"font-mono",children:s.branch})})]}),e.jsx("span",{className:"shrink-0 text-xs text-gray-500",children:R(s.lastActiveAt)})]}),e.jsxs("div",{className:"mt-3 flex items-center gap-4 text-xs text-gray-400",children:[e.jsx("span",{title:"Duration",children:s.isActive?e.jsx($,{startedAt:s.startedAt}):P(s.durationMs)}),e.jsxs("span",{title:"Messages",children:[s.messageCount," msgs"]}),s.model&&e.jsx("span",{title:"Model",className:"truncate font-mono text-gray-500",children:s.model.replace(/^claude-/,"").split("-202")[0]}),e.jsx("span",{title:"File size",className:"text-gray-500",children:L(s.fileSizeBytes)})]}),a&&e.jsx("p",{className:"mt-2 truncate text-xs font-mono text-gray-600",children:a})]})}function B({projects:s,activeCount:l}){const n=w(),{search:t,status:c,project:a}=C.useSearch(),{privacyMode:i,anonymizeProjectName:f}=S(),[h,d]=x.useState(t),o=x.useRef(null);x.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),x.useEffect(()=>{d(t)},[t]);function p(r){d(r),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{n({to:"/sessions",search:m=>({...m,search:r,page:1})})},300)}function y(r){n({to:"/sessions",search:m=>({...m,status:r,page:1})})}function b(r){n({to:"/sessions",search:m=>({...m,project:r,page:1})})}return e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{type:"text",placeholder:"Search sessions...",value:h,onChange:r=>p(r.target.value),className:"rounded-lg border border-gray-700 bg-gray-800/50 px-3 py-1.5 text-sm text-gray-200 placeholder-gray-500 outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500"}),e.jsx("div",{className:"flex rounded-lg border border-gray-700 text-xs",children:["all","active","completed"].map(r=>e.jsxs("button",{onClick:()=>y(r),className:`px-3 py-1.5 capitalize transition-colors ${c===r?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-200"} ${r==="all"?"rounded-l-lg":""} ${r==="completed"?"rounded-r-lg":""}`,children:[r,r==="active"&&l>0&&e.jsxs("span",{className:"ml-1 text-emerald-400",children:["(",l,")"]})]},r))}),s.length>1&&e.jsxs("select",{value:a,onChange:r=>b(r.target.value),className:"rounded-lg border border-gray-700 bg-gray-800/50 px-3 py-1.5 text-sm text-gray-200 outline-none focus:border-blue-500",children:[e.jsx("option",{value:"",children:"All projects"}),s.map(r=>e.jsx("option",{value:r,children:i?f(r):r},r))]})]})}const v="claude-dashboard:page-size",A=[5,10,25,50];function N(s){return A.includes(s)}function Q(){const[s,l]=x.useState(null);x.useEffect(()=>{try{const t=localStorage.getItem(v);if(t!==null){const c=Number(t);N(c)&&l(c)}}catch{}},[]);const n=x.useCallback(t=>{if(N(t))try{localStorage.setItem(v,String(t)),l(t)}catch{}},[]);return{storedPageSize:s,setPageSize:n}}function F({page:s,totalPages:l,totalCount:n,pageSize:t,onPageChange:c,onPageSizeChange:a}){if(n===0)return null;const i=(s-1)*t+1,f=Math.min(s*t,n),h=l>1,d=h?V(s,l):[];return e.jsxs("div",{className:"flex flex-col items-center gap-3 sm:flex-row sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("select",{value:t,onChange:o=>a(Number(o.target.value)),className:"rounded-lg border border-gray-700 bg-gray-800/50 px-2 py-1 text-xs text-gray-200 outline-none focus:border-blue-500",children:A.map(o=>e.jsxs("option",{value:o,children:[o," / page"]},o))}),e.jsxs("p",{className:"text-xs text-gray-400",children:["Showing"," ",e.jsxs("span",{className:"font-mono text-gray-300",children:[i,"-",f]})," ","of"," ",e.jsx("span",{className:"font-mono text-gray-300",children:n})," sessions"]})]}),h&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>c(s-1),disabled:s<=1,className:"rounded-lg border border-gray-700 bg-gray-800 px-2.5 py-1.5 text-xs text-gray-400 transition-colors hover:bg-gray-700 hover:text-gray-200 disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-gray-800 disabled:hover:text-gray-400",children:"Previous"}),d.map((o,p)=>o==="ellipsis"?e.jsx("span",{className:"px-1.5 text-xs text-gray-500",children:"..."},`ellipsis-${p}`):e.jsx("button",{onClick:()=>c(o),className:`min-w-[2rem] rounded-lg px-2 py-1.5 text-xs font-mono transition-colors ${o===s?"bg-blue-600 text-white":"border border-gray-700 bg-gray-800 text-gray-400 hover:bg-gray-700 hover:text-gray-200"}`,children:o},o)),e.jsx("button",{onClick:()=>c(s+1),disabled:s>=l,className:"rounded-lg border border-gray-700 bg-gray-800 px-2.5 py-1.5 text-xs text-gray-400 transition-colors hover:bg-gray-700 hover:text-gray-200 disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-gray-800 disabled:hover:text-gray-400",children:"Next"})]})]})}function V(s,l){if(l<=7)return Array.from({length:l},(a,i)=>i+1);const n=new Set;n.add(1),n.add(l);for(let a=s-2;a<=s+2;a++)a>=1&&a<=l&&n.add(a);const t=Array.from(n).sort((a,i)=>a-i),c=[];for(let a=0;a<t.length;a++)a>0&&t[a]-t[a-1]>1&&c.push("ellipsis"),c.push(t[a]);return c}function G(){const s=w(),{page:l,pageSize:n,search:t,status:c,project:a}=C.useSearch(),{storedPageSize:i,setPageSize:f}=Q(),h=x.useRef(!1);x.useEffect(()=>{i!==null&&!h.current&&i!==n&&(h.current=!0,s({to:"/sessions",search:u=>({...u,pageSize:i,page:1}),replace:!0}))},[i,n,s]);const{data:d,isLoading:o}=j(k({page:l,pageSize:n,search:t,status:c,project:a})),{data:p=[]}=j(D),y=x.useMemo(()=>{if(!d)return[];const u=new Set(p.map(g=>g.sessionId));return d.sessions.map(g=>({...g,isActive:u.has(g.sessionId)||g.isActive}))},[d,p]);function b(u){s({to:"/sessions",search:g=>({...g,page:u})})}function r(u){f(u),s({to:"/sessions",search:g=>({...g,pageSize:u,page:1})})}if(o)return e.jsx("div",{className:"space-y-3",children:Array.from({length:n}).map((u,g)=>e.jsx("div",{className:"h-28 animate-pulse rounded-xl border border-gray-800 bg-gray-900/50"},g))});const m=d?.totalCount??0,I=d?.totalPages??1,z=d?.projects??[],E=p.length;return e.jsxs("div",{children:[e.jsx(B,{projects:z,activeCount:E}),e.jsx("div",{className:"mt-4 space-y-2",children:y.length===0?e.jsx("div",{className:"py-12 text-center text-sm text-gray-500",children:m===0&&!t&&c==="all"&&!a?"No sessions found in ~/.claude":"No sessions match your filters"}):y.map(u=>e.jsx(_,{session:u},u.sessionId))}),e.jsx("div",{className:"mt-4",children:e.jsx(F,{page:d?.page??l,totalPages:I,totalCount:m,pageSize:n,onPageChange:b,onPageSizeChange:r})})]})}function q(){return e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"Sessions"}),e.jsx("p",{className:"mt-1 text-sm text-gray-400",children:"All Claude Code sessions from ~/.claude"}),e.jsx("div",{className:"mt-6",children:e.jsx(G,{})})]})}export{q as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,r as g}from"./main-CM5g2n-_.js";import{u as f}from"./createServerFn-B0pEGqTk.js";import{S as j,D as p,u as v,a as b,s as N}from"./settings.types-BRNIMHGJ.js";function k({value:o,onChange:u}){return e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",children:j.map(r=>{const d=o===r.id;return e.jsxs("button",{type:"button",onClick:()=>u(r.id),className:`rounded-lg border px-3 py-2 text-left transition-colors ${d?"border-blue-500 bg-blue-500/10 text-white":"border-gray-800 bg-gray-900/50 text-gray-400 hover:border-gray-700 hover:text-gray-300"}`,children:[e.jsx("div",{className:"text-sm font-medium",children:r.displayName}),e.jsx("div",{className:"mt-0.5 font-mono text-[10px] text-gray-500",children:r.monthlyUSD!==null?`$${r.monthlyUSD}/mo`:"Custom"})]},r.id)})})}const y=[{key:"inputPerMTok",label:"Input"},{key:"outputPerMTok",label:"Output"},{key:"cacheReadPerMTok",label:"Cache Read"},{key:"cacheWritePerMTok",label:"Cache Write"}];function T({overrides:o,onChange:u}){function r(t,s,i){const n=parseFloat(i);if(!Number.isFinite(n)||n<0||n>1e6)return;const a=p.find(l=>l.modelId===t);if(!a)return;const c=o[t]?{...o[t]}:{inputPerMTok:a.inputPerMTok,outputPerMTok:a.outputPerMTok,cacheReadPerMTok:a.cacheReadPerMTok,cacheWritePerMTok:a.cacheWritePerMTok};c[s]=n;const h=c.inputPerMTok===a.inputPerMTok&&c.outputPerMTok===a.outputPerMTok&&c.cacheReadPerMTok===a.cacheReadPerMTok&&c.cacheWritePerMTok===a.cacheWritePerMTok,m={...o};h?delete m[t]:m[t]=c,u(m)}function d(t,s){const i=o[t.modelId];return i?i[s]:t[s]}function x(t,s){const i=o[t];if(!i)return!1;const n=p.find(a=>a.modelId===t);return n?i[s]!==n[s]:!1}return e.jsxs("div",{className:"overflow-x-auto",children:[e.jsxs("table",{className:"w-full text-left text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-800",children:[e.jsx("th",{className:"pb-2 pr-4 text-gray-400 font-medium",children:"Model"}),y.map(t=>e.jsx("th",{className:"pb-2 px-2 text-right text-gray-400 font-medium",children:t.label},t.key))]})}),e.jsx("tbody",{children:p.map(t=>e.jsxs("tr",{className:"border-b border-gray-800/50",children:[e.jsx("td",{className:"py-2 pr-4 font-mono text-gray-300",children:t.displayName}),y.map(s=>{const i=d(t,s.key),n=x(t.modelId,s.key);return e.jsx("td",{className:"px-1 py-1.5",children:e.jsx("input",{type:"number",step:"0.01",min:"0",value:i,onChange:a=>r(t.modelId,s.key,a.target.value),className:`w-20 rounded border px-2 py-1 text-right font-mono text-xs ${n?"border-blue-500/50 bg-blue-500/10 text-blue-400":"border-gray-700 bg-gray-800 text-gray-300"} focus:border-blue-500 focus:outline-none`})},s.key)})]},t.modelId))})]}),e.jsx("p",{className:"mt-2 text-[10px] text-gray-600",children:"Prices in USD per million tokens. Overridden values shown in blue."})]})}function P(){const{data:o,isLoading:u}=f(N),r=v(),[d,x]=g.useState("pro"),[t,s]=g.useState({}),[i,n]=g.useState(!1);g.useEffect(()=>{o&&(x(o.subscriptionTier),s(o.pricingOverrides),n(!1))},[o]);function a(l){x(l),n(!0)}function c(l){s(l),n(!0)}function h(){x(b.subscriptionTier),s(b.pricingOverrides),n(!0)}function m(){const l={version:1,subscriptionTier:d,pricingOverrides:t};r.mutate(l,{onSuccess:()=>{n(!1)}})}return u?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"h-8 w-48 animate-pulse rounded bg-gray-800"}),e.jsx("div",{className:"h-64 animate-pulse rounded-xl bg-gray-900/50"})]}):e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-white",children:"Settings"}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Configure your subscription tier and API pricing for cost estimation."}),e.jsxs("div",{className:"mt-6",children:[e.jsx("h2",{className:"text-sm font-semibold text-gray-300",children:"Subscription Tier"}),e.jsx("p",{className:"mt-1 text-[10px] text-gray-500",children:"Select your Claude subscription plan. This is informational only and does not affect cost calculations."}),e.jsx("div",{className:"mt-3",children:e.jsx(k,{value:d,onChange:a})})]}),e.jsxs("div",{className:"mt-6",children:[e.jsx("h2",{className:"text-sm font-semibold text-gray-300",children:"API Pricing (per million tokens)"}),e.jsx("p",{className:"mt-1 text-[10px] text-gray-500",children:"Default prices from Anthropic. Override any value to match your negotiated rates."}),e.jsx("div",{className:"mt-3 rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:e.jsx(T,{overrides:t,onChange:c})})]}),e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsx("button",{type:"button",onClick:h,className:"rounded-lg border border-gray-700 px-3 py-1.5 text-xs text-gray-400 transition-colors hover:border-gray-600 hover:text-gray-300",children:"Reset to Defaults"}),e.jsxs("div",{className:"flex items-center gap-3",children:[r.isSuccess&&!i&&e.jsx("span",{className:"text-xs text-emerald-400",children:"Saved"}),r.isError&&e.jsxs("span",{className:"text-xs text-red-400",children:["Failed to save: ",r.error?.message??"Unknown error"]}),e.jsx("button",{type:"button",onClick:m,disabled:!i||r.isPending,className:`rounded-lg px-4 py-1.5 text-xs font-medium transition-colors ${i&&!r.isPending?"bg-blue-600 text-white hover:bg-blue-500":"cursor-not-allowed bg-gray-800 text-gray-500"}`,children:r.isPending?"Saving...":"Save"})]})]})]})}function R(){return e.jsx(P,{})}export{R as component};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{c as lt,R as f,g as ct,r as $,j as o,L as Rt,b as Ue}from"./main-CM5g2n-_.js";import{c as ut,q as dt,u as ft}from"./createServerFn-B0pEGqTk.js";import{t as Ve,c as Lt,m as ht,a as mt,f as pe,b as ie,s as Mt,d as Ee,e as zt,g as We}from"./format-Bsprb3az.js";import{c as K,f as A,r as pt,a as Ft,b as yt,d as Kt,i as I,T as Ce,p as M,L as D,g as vt,e as De,h as gt,D as Bt,C as Ut,j as J,k as H,S as Vt,A as Wt,l as Gt,m as Ge,n as qt,o as S,q as Ht,u as Yt,G as Zt,s as fe,t as Jt,v as xt,w as Qt,x as oe,y as ye,z as Xt,B as er,E as tr,F as rr,H as nr,I as bt,J as jt,K as At,M as kt,N as Ot,O as he,X as $e,Y as Ie,P as ar,Q as ir,R as Re,U as Le,V as sr,W as or,Z as lr,_ as cr,$ as ur,a0 as le,a1 as dr,a2 as fr,a3 as hr,a4 as mr}from"./useSessionCost-DgFKglaG.js";import"./settings.types-BRNIMHGJ.js";const pr=ut({method:"GET"}).handler(lt("4b9a58c176f487b49800a372100037cdf33cf048f3592a449f115c7e3f5ea799")),yr=dt({queryKey:["stats"],queryFn:()=>pr(),refetchInterval:6e4});var vr=["points","className","baseLinePoints","connectNulls"];function Y(){return Y=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Y.apply(this,arguments)}function gr(t,e){if(t==null)return{};var n=xr(t,e),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function xr(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function qe(t){return kr(t)||Ar(t)||jr(t)||br()}function br(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jr(t,e){if(t){if(typeof t=="string")return we(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return we(t,e)}}function Ar(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function kr(t){if(Array.isArray(t))return we(t)}function we(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var He=function(e){return e&&e.x===+e.x&&e.y===+e.y},Or=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return e.forEach(function(r){He(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),He(e[0])&&n[n.length-1].push(e[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},ne=function(e,n){var r=Or(e);n&&(r=[r.reduce(function(i,s){return[].concat(qe(i),qe(s))},[])]);var a=r.map(function(i){return i.reduce(function(s,c,l){return"".concat(s).concat(l===0?"M":"L").concat(c.x,",").concat(c.y)},"")}).join("");return r.length===1?"".concat(a,"Z"):a},Pr=function(e,n,r){var a=ne(e,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(ne(n.reverse(),r).slice(1))},Sr=function(e){var n=e.points,r=e.className,a=e.baseLinePoints,i=e.connectNulls,s=gr(e,vr);if(!n||!n.length)return null;var c=K("recharts-polygon",r);if(a&&a.length){var l=s.stroke&&s.stroke!=="none",u=Pr(n,a,i);return f.createElement("g",{className:c},f.createElement("path",Y({},A(s,!0),{fill:u.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:u})),l?f.createElement("path",Y({},A(s,!0),{fill:"none",d:ne(n,i)})):null,l?f.createElement("path",Y({},A(s,!0),{fill:"none",d:ne(a,i)})):null)}var d=ne(n,i);return f.createElement("path",Y({},A(s,!0),{fill:d.slice(-1)==="Z"?s.fill:"none",className:c,d}))},Oe,Ye;function wr(){if(Ye)return Oe;Ye=1;var t=pt(),e=Ft(),n=yt();function r(a,i){return a&&a.length?t(a,n(i,2),e):void 0}return Oe=r,Oe}var Nr=wr();const Tr=ct(Nr);var Pe,Ze;function _r(){if(Ze)return Pe;Ze=1;var t=pt(),e=yt(),n=Kt();function r(a,i){return a&&a.length?t(a,e(i,2),n):void 0}return Pe=r,Pe}var Er=_r();const Cr=ct(Er);var Dr=["cx","cy","angle","ticks","axisLine"],$r=["ticks","tick","angle","tickFormatter","stroke"];function Q(t){"@babel/helpers - typeof";return Q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q(t)}function ae(){return ae=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ae.apply(this,arguments)}function Je(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,r)}return n}function B(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Je(Object(n),!0).forEach(function(r){be(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Je(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Qe(t,e){if(t==null)return{};var n=Ir(t,e),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Ir(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Rr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,St(r.key),r)}}function Lr(t,e,n){return e&&Xe(t.prototype,e),n&&Xe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Mr(t,e,n){return e=ve(e),zr(t,Pt()?Reflect.construct(e,n||[],ve(t).constructor):e.apply(t,n))}function zr(t,e){if(e&&(Q(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fr(t)}function Fr(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Pt=function(){return!!t})()}function ve(t){return ve=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ve(t)}function Kr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ne(t,e)}function Ne(t,e){return Ne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Ne(t,e)}function be(t,e,n){return e=St(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function St(t){var e=Br(t,"string");return Q(e)=="symbol"?e:e+""}function Br(t,e){if(Q(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Q(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var je=(function(t){function e(){return Rr(this,e),Mr(this,e,arguments)}return Kr(e,t),Lr(e,[{key:"getTickValueCoord",value:function(r){var a=r.coordinate,i=this.props,s=i.angle,c=i.cx,l=i.cy;return M(c,l,a,s)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,a;switch(r){case"left":a="end";break;case"right":a="start";break;default:a="middle";break}return a}},{key:"getViewBox",value:function(){var r=this.props,a=r.cx,i=r.cy,s=r.angle,c=r.ticks,l=Tr(c,function(d){return d.coordinate||0}),u=Cr(c,function(d){return d.coordinate||0});return{cx:a,cy:i,startAngle:s,endAngle:s,innerRadius:u.coordinate||0,outerRadius:l.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,s=r.angle,c=r.ticks,l=r.axisLine,u=Qe(r,Dr),d=c.reduce(function(y,h){return[Math.min(y[0],h.coordinate),Math.max(y[1],h.coordinate)]},[1/0,-1/0]),m=M(a,i,d[0],s),p=M(a,i,d[1],s),v=B(B(B({},A(u,!1)),{},{fill:"none"},A(l,!1)),{},{x1:m.x,y1:m.y,x2:p.x,y2:p.y});return f.createElement("line",ae({className:"recharts-polar-radius-axis-line"},v))}},{key:"renderTicks",value:function(){var r=this,a=this.props,i=a.ticks,s=a.tick,c=a.angle,l=a.tickFormatter,u=a.stroke,d=Qe(a,$r),m=this.getTickTextAnchor(),p=A(d,!1),v=A(s,!1),y=i.map(function(h,g){var b=r.getTickValueCoord(h),j=B(B(B(B({textAnchor:m,transform:"rotate(".concat(90-c,", ").concat(b.x,", ").concat(b.y,")")},p),{},{stroke:"none",fill:u},v),{},{index:g},b),{},{payload:h});return f.createElement(D,ae({className:K("recharts-polar-radius-axis-tick",vt(s)),key:"tick-".concat(h.coordinate)},De(r.props,h,g)),e.renderTickItem(s,j,l?l(h.value,g):h.value))});return f.createElement(D,{className:"recharts-polar-radius-axis-ticks"},y)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.axisLine,s=r.tick;return!a||!a.length?null:f.createElement(D,{className:K("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),s&&this.renderTicks(),gt.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,a,i){var s;return f.isValidElement(r)?s=f.cloneElement(r,a):I(r)?s=r(a):s=f.createElement(Ce,ae({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),s}}])})($.PureComponent);be(je,"displayName","PolarRadiusAxis");be(je,"axisType","radiusAxis");be(je,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function X(t){"@babel/helpers - typeof";return X=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},X(t)}function V(){return V=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},V.apply(this,arguments)}function et(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,r)}return n}function U(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?et(Object(n),!0).forEach(function(r){Ae(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):et(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ur(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Nt(r.key),r)}}function Vr(t,e,n){return e&&tt(t.prototype,e),n&&tt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Wr(t,e,n){return e=ge(e),Gr(t,wt()?Reflect.construct(e,n||[],ge(t).constructor):e.apply(t,n))}function Gr(t,e){if(e&&(X(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qr(t)}function qr(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wt=function(){return!!t})()}function ge(t){return ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ge(t)}function Hr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Te(t,e)}function Te(t,e){return Te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Te(t,e)}function Ae(t,e,n){return e=Nt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nt(t){var e=Yr(t,"string");return X(e)=="symbol"?e:e+""}function Yr(t,e){if(X(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(X(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Zr=Math.PI/180,rt=1e-5,ke=(function(t){function e(){return Ur(this,e),Wr(this,e,arguments)}return Hr(e,t),Vr(e,[{key:"getTickLineCoord",value:function(r){var a=this.props,i=a.cx,s=a.cy,c=a.radius,l=a.orientation,u=a.tickSize,d=u||8,m=M(i,s,c,r.coordinate),p=M(i,s,c+(l==="inner"?-1:1)*d,r.coordinate);return{x1:m.x,y1:m.y,x2:p.x,y2:p.y}}},{key:"getTickTextAnchor",value:function(r){var a=this.props.orientation,i=Math.cos(-r.coordinate*Zr),s;return i>rt?s=a==="outer"?"start":"end":i<-rt?s=a==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,s=r.radius,c=r.axisLine,l=r.axisLineType,u=U(U({},A(this.props,!1)),{},{fill:"none"},A(c,!1));if(l==="circle")return f.createElement(Bt,V({className:"recharts-polar-angle-axis-line"},u,{cx:a,cy:i,r:s}));var d=this.props.ticks,m=d.map(function(p){return M(a,i,s,p.coordinate)});return f.createElement(Sr,V({className:"recharts-polar-angle-axis-line"},u,{points:m}))}},{key:"renderTicks",value:function(){var r=this,a=this.props,i=a.ticks,s=a.tick,c=a.tickLine,l=a.tickFormatter,u=a.stroke,d=A(this.props,!1),m=A(s,!1),p=U(U({},d),{},{fill:"none"},A(c,!1)),v=i.map(function(y,h){var g=r.getTickLineCoord(y),b=r.getTickTextAnchor(y),j=U(U(U({textAnchor:b},d),{},{stroke:"none",fill:u},m),{},{index:h,payload:y,x:g.x2,y:g.y2});return f.createElement(D,V({className:K("recharts-polar-angle-axis-tick",vt(s)),key:"tick-".concat(y.coordinate)},De(r.props,y,h)),c&&f.createElement("line",V({className:"recharts-polar-angle-axis-tick-line"},p,g)),s&&e.renderTickItem(s,j,l?l(y.value,h):y.value))});return f.createElement(D,{className:"recharts-polar-angle-axis-ticks"},v)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.radius,s=r.axisLine;return i<=0||!a||!a.length?null:f.createElement(D,{className:K("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,i){var s;return f.isValidElement(r)?s=f.cloneElement(r,a):I(r)?s=r(a):s=f.createElement(Ce,V({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),s}}])})($.PureComponent);Ae(ke,"displayName","PolarAngleAxis");Ae(ke,"axisType","angleAxis");Ae(ke,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var me;function ee(t){"@babel/helpers - typeof";return ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ee(t)}function Z(){return Z=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Z.apply(this,arguments)}function nt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,r)}return n}function x(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?nt(Object(n),!0).forEach(function(r){_(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nt(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Jr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function at(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_t(r.key),r)}}function Qr(t,e,n){return e&&at(t.prototype,e),n&&at(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Xr(t,e,n){return e=xe(e),en(t,Tt()?Reflect.construct(e,n||[],xe(t).constructor):e.apply(t,n))}function en(t,e){if(e&&(ee(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tn(t)}function tn(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Tt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Tt=function(){return!!t})()}function xe(t){return xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},xe(t)}function rn(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_e(t,e)}function _e(t,e){return _e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},_e(t,e)}function _(t,e,n){return e=_t(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _t(t){var e=nn(t,"string");return ee(e)=="symbol"?e:e+""}function nn(t,e){if(ee(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(ee(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var z=(function(t){function e(n){var r;return Jr(this,e),r=Xr(this,e,[n]),_(r,"pieRef",null),_(r,"sectorRefs",[]),_(r,"id",Yt("recharts-pie-")),_(r,"handleAnimationEnd",function(){var a=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),I(a)&&a()}),_(r,"handleAnimationStart",function(){var a=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),I(a)&&a()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return rn(e,t),Qr(e,[{key:"isActiveIndex",value:function(r){var a=this.props.activeIndex;return Array.isArray(a)?a.indexOf(r)!==-1:r===a}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var i=this.props,s=i.label,c=i.labelLine,l=i.dataKey,u=i.valueKey,d=A(this.props,!1),m=A(s,!1),p=A(c,!1),v=s&&s.offsetRadius||20,y=r.map(function(h,g){var b=(h.startAngle+h.endAngle)/2,j=M(h.cx,h.cy,h.outerRadius+v,b),k=x(x(x(x({},d),h),{},{stroke:"none"},m),{},{index:g,textAnchor:e.getTextAnchor(j.x,h.cx)},j),R=x(x(x(x({},d),h),{},{fill:"none",stroke:h.fill},p),{},{index:g,points:[M(h.cx,h.cy,h.outerRadius,b),j]}),w=l;return J(l)&&J(u)?w="value":J(l)&&(w=u),f.createElement(D,{key:"label-".concat(h.startAngle,"-").concat(h.endAngle,"-").concat(h.midAngle,"-").concat(g)},c&&e.renderLabelLineItem(c,R,"line"),e.renderLabelItem(s,k,H(h,w)))});return f.createElement(D,{className:"recharts-pie-labels"},y)}},{key:"renderSectorsStatically",value:function(r){var a=this,i=this.props,s=i.activeShape,c=i.blendStroke,l=i.inactiveShape;return r.map(function(u,d){if(u?.startAngle===0&&u?.endAngle===0&&r.length!==1)return null;var m=a.isActiveIndex(d),p=l&&a.hasActiveIndex()?l:null,v=m?s:p,y=x(x({},u),{},{stroke:c?u.fill:u.stroke,tabIndex:-1});return f.createElement(D,Z({ref:function(g){g&&!a.sectorRefs.includes(g)&&a.sectorRefs.push(g)},tabIndex:-1,className:"recharts-pie-sector"},De(a.props,u,d),{key:"sector-".concat(u?.startAngle,"-").concat(u?.endAngle,"-").concat(u.midAngle,"-").concat(d)}),f.createElement(Vt,Z({option:v,isActive:m,shapeType:"sector"},y)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,a=this.props,i=a.sectors,s=a.isAnimationActive,c=a.animationBegin,l=a.animationDuration,u=a.animationEasing,d=a.animationId,m=this.state,p=m.prevSectors,v=m.prevIsAnimationActive;return f.createElement(Wt,{begin:c,duration:l,isActive:s,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d,"-").concat(v),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(y){var h=y.t,g=[],b=i&&i[0],j=b.startAngle;return i.forEach(function(k,R){var w=p&&p[R],N=R>0?Gt(k,"paddingAngle",0):0;if(w){var E=Ge(w.endAngle-w.startAngle,k.endAngle-k.startAngle),O=x(x({},k),{},{startAngle:j+N,endAngle:j+E(h)+N});g.push(O),j=O.endAngle}else{var C=k.endAngle,T=k.startAngle,L=Ge(0,C-T),se=L(h),F=x(x({},k),{},{startAngle:j+N,endAngle:j+se+N});g.push(F),j=F.endAngle}}),f.createElement(D,null,r.renderSectorsStatically(g))})}},{key:"attachKeyboardHandlers",value:function(r){var a=this;r.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var s=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[s].focus(),a.setState({sectorToFocus:s});break}case"ArrowRight":{var c=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[c].focus(),a.setState({sectorToFocus:c});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,a=r.sectors,i=r.isAnimationActive,s=this.state.prevSectors;return i&&a&&a.length&&(!s||!qt(s,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,a=this.props,i=a.hide,s=a.sectors,c=a.className,l=a.label,u=a.cx,d=a.cy,m=a.innerRadius,p=a.outerRadius,v=a.isAnimationActive,y=this.state.isAnimationFinished;if(i||!s||!s.length||!S(u)||!S(d)||!S(m)||!S(p))return null;var h=K("recharts-pie",c);return f.createElement(D,{tabIndex:this.props.rootTabIndex,className:h,ref:function(b){r.pieRef=b}},this.renderSectors(),l&&this.renderLabels(s),gt.renderCallByParent(this.props,null,!1),(!v||y)&&Ht.renderCallByParent(this.props,s,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return a.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:r.sectors!==a.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,a){return r>a?"start":r<a?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,a,i){if(f.isValidElement(r))return f.cloneElement(r,a);if(I(r))return r(a);var s=K("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return f.createElement(Ut,Z({},a,{key:i,type:"linear",className:s}))}},{key:"renderLabelItem",value:function(r,a,i){if(f.isValidElement(r))return f.cloneElement(r,a);var s=i;if(I(r)&&(s=r(a),f.isValidElement(s)))return s;var c=K("recharts-pie-label-text",typeof r!="boolean"&&!I(r)?r.className:"");return f.createElement(Ce,Z({},a,{alignmentBaseline:"middle",className:c}),s)}}])})($.PureComponent);me=z;_(z,"displayName","Pie");_(z,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!Zt.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});_(z,"parseDeltaAngle",function(t,e){var n=fe(e-t),r=Math.min(Math.abs(e-t),360);return n*r});_(z,"getRealPieData",function(t){var e=t.data,n=t.children,r=A(t,!1),a=Jt(n,xt);return e&&e.length?e.map(function(i,s){return x(x(x({payload:i},r),i),a&&a[s]&&a[s].props)}):a&&a.length?a.map(function(i){return x(x({},r),i.props)}):[]});_(z,"parseCoordinateOfPie",function(t,e){var n=e.top,r=e.left,a=e.width,i=e.height,s=Qt(a,i),c=r+oe(t.cx,a,a/2),l=n+oe(t.cy,i,i/2),u=oe(t.innerRadius,s,0),d=oe(t.outerRadius,s,s*.8),m=t.maxRadius||Math.sqrt(a*a+i*i)/2;return{cx:c,cy:l,innerRadius:u,outerRadius:d,maxRadius:m}});_(z,"getComposedData",function(t){var e=t.item,n=t.offset,r=e.type.defaultProps!==void 0?x(x({},e.type.defaultProps),e.props):e.props,a=me.getRealPieData(r);if(!a||!a.length)return null;var i=r.cornerRadius,s=r.startAngle,c=r.endAngle,l=r.paddingAngle,u=r.dataKey,d=r.nameKey,m=r.valueKey,p=r.tooltipType,v=Math.abs(r.minAngle),y=me.parseCoordinateOfPie(r,n),h=me.parseDeltaAngle(s,c),g=Math.abs(h),b=u;J(u)&&J(m)?(ye(!1,`Use "dataKey" to specify the value of pie,
|
|
3
|
-
the props "valueKey" will be deprecated in 1.1.0`),b="value"):J(u)&&(ye(!1,`Use "dataKey" to specify the value of pie,
|
|
4
|
-
the props "valueKey" will be deprecated in 1.1.0`),b=m);var j=a.filter(function(O){return H(O,b,0)!==0}).length,k=(g>=360?j:j-1)*l,R=g-j*v-k,w=a.reduce(function(O,C){var T=H(C,b,0);return O+(S(T)?T:0)},0),N;if(w>0){var E;N=a.map(function(O,C){var T=H(O,b,0),L=H(O,d,C),se=(S(T)?T:0)/w,F;C?F=E.endAngle+fe(h)*l*(T!==0?1:0):F=s;var Fe=F+fe(h)*((T!==0?v:0)+se*R),Ke=(F+Fe)/2,Be=(y.innerRadius+y.outerRadius)/2,$t=[{name:L,value:T,payload:O,dataKey:b,type:p}],It=M(y.cx,y.cy,Be,Ke);return E=x(x(x({percent:se,cornerRadius:i,name:L,tooltipPayload:$t,midAngle:Ke,middleRadius:Be,tooltipPosition:It},O),y),{},{value:H(O,b),startAngle:F,endAngle:Fe,payload:O,paddingAngle:fe(h)*l}),E})}return x(x({},y),{},{sectors:N,data:a})});var an=["x1","y1","x2","y2","key"],sn=["offset"];function G(t){"@babel/helpers - typeof";return G=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},G(t)}function it(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,r)}return n}function P(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?it(Object(n),!0).forEach(function(r){on(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):it(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function on(t,e,n){return e=ln(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ln(t){var e=cn(t,"string");return G(e)=="symbol"?e:e+""}function cn(t,e){if(G(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(G(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function W(){return W=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},W.apply(this,arguments)}function st(t,e){if(t==null)return{};var n=un(t,e),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)r=i[a],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function un(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}var dn=function(e){var n=e.fill;if(!n||n==="none")return null;var r=e.fillOpacity,a=e.x,i=e.y,s=e.width,c=e.height,l=e.ry;return f.createElement("rect",{x:a,y:i,ry:l,width:s,height:c,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Et(t,e){var n;if(f.isValidElement(t))n=f.cloneElement(t,e);else if(I(t))n=t(e);else{var r=e.x1,a=e.y1,i=e.x2,s=e.y2,c=e.key,l=st(e,an),u=A(l,!1);u.offset;var d=st(u,sn);n=f.createElement("line",W({},d,{x1:r,y1:a,x2:i,y2:s,fill:"none",key:c}))}return n}function fn(t){var e=t.x,n=t.width,r=t.horizontal,a=r===void 0?!0:r,i=t.horizontalPoints;if(!a||!i||!i.length)return null;var s=i.map(function(c,l){var u=P(P({},t),{},{x1:e,y1:c,x2:e+n,y2:c,key:"line-".concat(l),index:l});return Et(a,u)});return f.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function hn(t){var e=t.y,n=t.height,r=t.vertical,a=r===void 0?!0:r,i=t.verticalPoints;if(!a||!i||!i.length)return null;var s=i.map(function(c,l){var u=P(P({},t),{},{x1:c,y1:e,x2:c,y2:e+n,key:"line-".concat(l),index:l});return Et(a,u)});return f.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function mn(t){var e=t.horizontalFill,n=t.fillOpacity,r=t.x,a=t.y,i=t.width,s=t.height,c=t.horizontalPoints,l=t.horizontal,u=l===void 0?!0:l;if(!u||!e||!e.length)return null;var d=c.map(function(p){return Math.round(p+a-a)}).sort(function(p,v){return p-v});a!==d[0]&&d.unshift(0);var m=d.map(function(p,v){var y=!d[v+1],h=y?a+s-p:d[v+1]-p;if(h<=0)return null;var g=v%e.length;return f.createElement("rect",{key:"react-".concat(v),y:p,x:r,height:h,width:i,stroke:"none",fill:e[g],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return f.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},m)}function pn(t){var e=t.vertical,n=e===void 0?!0:e,r=t.verticalFill,a=t.fillOpacity,i=t.x,s=t.y,c=t.width,l=t.height,u=t.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(p){return Math.round(p+i-i)}).sort(function(p,v){return p-v});i!==d[0]&&d.unshift(0);var m=d.map(function(p,v){var y=!d[v+1],h=y?i+c-p:d[v+1]-p;if(h<=0)return null;var g=v%r.length;return f.createElement("rect",{key:"react-".concat(v),x:p,y:s,width:h,height:l,stroke:"none",fill:r[g],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return f.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},m)}var yn=function(e,n){var r=e.xAxis,a=e.width,i=e.height,s=e.offset;return bt(jt(P(P(P({},kt.defaultProps),r),{},{ticks:At(r,!0),viewBox:{x:0,y:0,width:a,height:i}})),s.left,s.left+s.width,n)},vn=function(e,n){var r=e.yAxis,a=e.width,i=e.height,s=e.offset;return bt(jt(P(P(P({},kt.defaultProps),r),{},{ticks:At(r,!0),viewBox:{x:0,y:0,width:a,height:i}})),s.top,s.top+s.height,n)},q={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Me(t){var e,n,r,a,i,s,c=Xt(),l=er(),u=tr(),d=P(P({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:q.stroke,fill:(n=t.fill)!==null&&n!==void 0?n:q.fill,horizontal:(r=t.horizontal)!==null&&r!==void 0?r:q.horizontal,horizontalFill:(a=t.horizontalFill)!==null&&a!==void 0?a:q.horizontalFill,vertical:(i=t.vertical)!==null&&i!==void 0?i:q.vertical,verticalFill:(s=t.verticalFill)!==null&&s!==void 0?s:q.verticalFill,x:S(t.x)?t.x:u.left,y:S(t.y)?t.y:u.top,width:S(t.width)?t.width:u.width,height:S(t.height)?t.height:u.height}),m=d.x,p=d.y,v=d.width,y=d.height,h=d.syncWithTicks,g=d.horizontalValues,b=d.verticalValues,j=rr(),k=nr();if(!S(v)||v<=0||!S(y)||y<=0||!S(m)||m!==+m||!S(p)||p!==+p)return null;var R=d.verticalCoordinatesGenerator||yn,w=d.horizontalCoordinatesGenerator||vn,N=d.horizontalPoints,E=d.verticalPoints;if((!N||!N.length)&&I(w)){var O=g&&g.length,C=w({yAxis:k?P(P({},k),{},{ticks:O?g:k.ticks}):void 0,width:c,height:l,offset:u},O?!0:h);ye(Array.isArray(C),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(G(C),"]")),Array.isArray(C)&&(N=C)}if((!E||!E.length)&&I(R)){var T=b&&b.length,L=R({xAxis:j?P(P({},j),{},{ticks:T?b:j.ticks}):void 0,width:c,height:l,offset:u},T?!0:h);ye(Array.isArray(L),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(G(L),"]")),Array.isArray(L)&&(E=L)}return f.createElement("g",{className:"recharts-cartesian-grid"},f.createElement(dn,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),f.createElement(fn,W({},d,{offset:u,horizontalPoints:N,xAxis:j,yAxis:k})),f.createElement(hn,W({},d,{offset:u,verticalPoints:E,xAxis:j,yAxis:k})),f.createElement(mn,W({},d,{horizontalPoints:N})),f.createElement(pn,W({},d,{verticalPoints:E})))}Me.displayName="CartesianGrid";var gn=Ot({chartName:"BarChart",GraphicalChild:he,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:$e},{axisType:"yAxis",AxisComp:Ie}],formatAxisMap:ar}),xn=Ot({chartName:"PieChart",GraphicalChild:z,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:ke},{axisType:"radiusAxis",AxisComp:je}],formatAxisMap:ir,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});function Ct(t,e){const n=()=>Lt(e?.in,NaN),a=kn(t);let i;if(a.date){const u=On(a.date,2);i=Pn(u.restDateString,u.year)}if(!i||isNaN(+i))return n();const s=+i;let c=0,l;if(a.time&&(c=Sn(a.time),isNaN(c)))return n();if(a.timezone){if(l=wn(a.timezone),isNaN(l))return n()}else{const u=new Date(s+c),d=Ve(0,e?.in);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return Ve(s+c+l,e?.in)}const ce={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},bn=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,jn=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,An=/^([+-])(\d{2})(?::?(\d{2}))?$/;function kn(t){const e={},n=t.split(ce.dateTimeDelimiter);let r;if(n.length>2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],ce.timeZoneDelimiter.test(e.date)&&(e.date=t.split(ce.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){const a=ce.timezone.exec(r);a?(e.time=r.replace(a[1],""),e.timezone=a[1]):e.time=r}return e}function On(t,e){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function Pn(t,e){if(e===null)return new Date(NaN);const n=t.match(bn);if(!n)return new Date(NaN);const r=!!n[4],a=te(n[1]),i=te(n[2])-1,s=te(n[3]),c=te(n[4]),l=te(n[5])-1;if(r)return Cn(e,c,l)?Nn(e,c,l):new Date(NaN);{const u=new Date(0);return!_n(e,i,s)||!En(e,a)?new Date(NaN):(u.setUTCFullYear(e,i,Math.max(a,s)),u)}}function te(t){return t?parseInt(t):1}function Sn(t){const e=t.match(jn);if(!e)return NaN;const n=Se(e[1]),r=Se(e[2]),a=Se(e[3]);return Dn(n,r,a)?n*ht+r*mt+a*1e3:NaN}function Se(t){return t&&parseFloat(t.replace(",","."))||0}function wn(t){if(t==="Z")return 0;const e=t.match(An);if(!e)return 0;const n=e[1]==="+"?-1:1,r=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return $n(r,a)?n*(r*ht+a*mt):NaN}function Nn(t,e,n){const r=new Date(0);r.setUTCFullYear(t,0,4);const a=r.getUTCDay()||7,i=(e-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const Tn=[31,null,31,30,31,30,31,31,30,31,30,31];function Dt(t){return t%400===0||t%4===0&&t%100!==0}function _n(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(Tn[e]||(Dt(t)?29:28))}function En(t,e){return e>=1&&e<=(Dt(t)?366:365)}function Cn(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function Dn(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function $n(t,e){return e>=0&&e<=59}function In({data:t}){const e=t.map(n=>({...n,dateLabel:pe(new Date(n.date),"MMM d")}));return o.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[o.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Daily Activity"}),o.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Messages, sessions, and tool calls per day"}),o.jsx("div",{className:"mt-4 h-64",children:o.jsx(Re,{width:"100%",height:"100%",children:o.jsxs(gn,{data:e,children:[o.jsx(Me,{strokeDasharray:"3 3",stroke:"#1f2937"}),o.jsx($e,{dataKey:"dateLabel",tick:{fill:"#6b7280",fontSize:10},tickLine:!1}),o.jsx(Ie,{tick:{fill:"#6b7280",fontSize:10},tickLine:!1,axisLine:!1}),o.jsx(Le,{contentStyle:{backgroundColor:"#111827",border:"1px solid #374151",borderRadius:"8px",fontSize:"12px"}}),o.jsx(he,{dataKey:"messageCount",name:"Messages",fill:"#3b82f6",radius:[2,2,0,0]}),o.jsx(he,{dataKey:"toolCallCount",name:"Tool Calls",fill:"#8b5cf6",radius:[2,2,0,0]}),o.jsx(he,{dataKey:"sessionCount",name:"Sessions",fill:"#10b981",radius:[2,2,0,0]})]})})})]})}const ue=["#3b82f6","#8b5cf6","#10b981","#f59e0b","#ef4444","#6366f1"];function ze(t){return t.replace(/^claude-/,"").split("-202")[0]}function Rn(t,e){const n={};for(const s of t)for(const[c,l]of Object.entries(s.tokensByModel)){const u=ze(c);n[u]=(n[u]??0)+l}const r=Object.entries(n).sort((s,c)=>c[1]-s[1]),a=r.slice(0,e).map(([s])=>s),i=r.length>e;return{topModels:a,hasOther:i}}function Ln(t,e,n){return t.map(r=>{const a={dateLabel:pe(Ct(r.date),"MMM d"),sortKey:r.date};for(const i of e)a[i]=0;n&&(a.Other=0);for(const[i,s]of Object.entries(r.tokensByModel)){const c=ze(i);e.includes(c)?a[c]=a[c]+s:n&&(a.Other=a.Other+s)}return a})}function Mn(t,e,n){const r=new Map;for(const a of t){const i=Mt(Ct(a.date)),s=pe(i,"yyyy-MM-dd");if(!r.has(s)){const l={dateLabel:`Week of ${pe(i,"MMM d")}`,sortKey:s};for(const u of e)l[u]=0;n&&(l.Other=0),r.set(s,l)}const c=r.get(s);for(const[l,u]of Object.entries(a.tokensByModel)){const d=ze(l);e.includes(d)?c[d]=c[d]+u:n&&(c.Other=c.Other+u)}}return Array.from(r.values()).sort((a,i)=>a.sortKey.localeCompare(i.sortKey))}function zn({active:t,payload:e,label:n}){if(!t||!e||e.length===0)return null;const r=e.reduce((a,i)=>a+i.value,0);return o.jsxs("div",{className:"rounded-lg border border-gray-700 bg-gray-800 p-3 text-xs shadow-lg",children:[o.jsx("p",{className:"mb-2 font-medium text-gray-300",children:n}),e.filter(a=>a.value>0).sort((a,i)=>i.value-a.value).map(a=>o.jsxs("div",{className:"flex items-center justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:a.color}}),o.jsx("span",{className:"text-gray-400",children:a.name})]}),o.jsx("span",{className:"font-mono text-gray-300",children:ie(a.value)})]},a.name)),o.jsxs("div",{className:"mt-1.5 border-t border-gray-700 pt-1.5 flex justify-between",children:[o.jsx("span",{className:"text-gray-400",children:"Total"}),o.jsx("span",{className:"font-mono font-medium text-white",children:ie(r)})]})]})}function Fn({data:t}){const[e,n]=$.useState("daily"),{topModels:r,hasOther:a}=$.useMemo(()=>Rn(t,5),[t]),i=$.useMemo(()=>{const c=[...r];return a&&c.push("Other"),c},[r,a]),s=$.useMemo(()=>e==="weekly"?Mn(t,r,a):Ln(t,r,a),[t,r,a,e]);return t.length===0?o.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[o.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Token Usage Over Time"}),o.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Total tokens by model per day"}),o.jsx("div",{className:"flex h-64 items-center justify-center",children:o.jsx("p",{className:"text-sm text-gray-500",children:"No data available"})})]}):o.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Token Usage Over Time"}),o.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Total tokens by model per day"})]}),o.jsxs("div",{className:"flex rounded-lg border border-gray-700 text-xs",children:[o.jsx("button",{type:"button",onClick:()=>n("daily"),className:`rounded-l-lg px-3 py-1 ${e==="daily"?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:"Daily"}),o.jsx("button",{type:"button",onClick:()=>n("weekly"),className:`rounded-r-lg px-3 py-1 ${e==="weekly"?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:"Weekly"})]})]}),o.jsx("div",{className:"mt-4 h-72",children:o.jsx(Re,{width:"100%",height:"100%",children:o.jsxs(sr,{data:s,children:[o.jsx(Me,{strokeDasharray:"3 3",stroke:"#1f2937"}),o.jsx($e,{dataKey:"dateLabel",tick:{fill:"#6b7280",fontSize:10},tickLine:!1}),o.jsx(Ie,{tick:{fill:"#6b7280",fontSize:10},tickLine:!1,axisLine:!1,tickFormatter:c=>ie(c)}),o.jsx(Le,{content:o.jsx(zn,{})}),i.map((c,l)=>o.jsx(or,{type:"monotone",dataKey:c,stackId:"1",stroke:ue[l%ue.length],fill:ue[l%ue.length],fillOpacity:.6},c))]})})})]})}const ot=["#3b82f6","#8b5cf6","#10b981","#f59e0b","#ef4444","#6366f1"];function Kn({data:t}){const e=Object.entries(t).map(([n,r])=>({name:n.replace(/^claude-/,"").split("-202")[0],fullName:n,totalTokens:r.inputTokens+r.outputTokens,outputTokens:r.outputTokens}));return e.sort((n,r)=>r.totalTokens-n.totalTokens),o.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[o.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Model Usage"}),o.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Token usage by model"}),o.jsx("div",{className:"mt-4 h-64",children:o.jsx(Re,{width:"100%",height:"100%",children:o.jsxs(xn,{children:[o.jsx(z,{data:e,cx:"50%",cy:"50%",innerRadius:50,outerRadius:80,dataKey:"totalTokens",nameKey:"name",strokeWidth:0,children:e.map((n,r)=>o.jsx(xt,{fill:ot[r%ot.length],opacity:.8},r))}),o.jsx(Le,{formatter:n=>ie(n),contentStyle:{backgroundColor:"#111827",border:"1px solid #374151",borderRadius:"8px",fontSize:"12px"}}),o.jsx(lr,{wrapperStyle:{fontSize:"11px"}})]})})})]})}function Bn({hourCounts:t}){const e=Array.from({length:24},(r,a)=>({hour:a,label:`${a.toString().padStart(2,"0")}:00`,count:t[String(a)]??0})),n=Math.max(...e.map(r=>r.count),1);return o.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[o.jsx("h3",{className:"text-sm font-semibold text-gray-300",children:"Hourly Distribution"}),o.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Session starts by hour of day"}),o.jsx("div",{className:"mt-4 flex items-end gap-0.5",style:{height:"120px"},children:e.map(r=>{const a=r.count>0?Math.max(r.count/n*100,4):0,i=r.count/n;return o.jsxs("div",{className:"group relative flex-1",style:{height:"100%"},children:[o.jsx("div",{className:"absolute bottom-0 w-full rounded-t transition-colors",style:{height:`${a}%`,backgroundColor:`rgba(59, 130, 246, ${.2+i*.6})`}}),o.jsxs("div",{className:"absolute -top-8 left-1/2 hidden -translate-x-1/2 whitespace-nowrap rounded bg-gray-800 px-1.5 py-0.5 text-[10px] text-gray-300 group-hover:block",children:[r.label,": ",r.count]})]},r.hour)})}),o.jsxs("div",{className:"mt-1 flex justify-between text-[10px] text-gray-600",children:[o.jsx("span",{children:"00:00"}),o.jsx("span",{children:"06:00"}),o.jsx("span",{children:"12:00"}),o.jsx("span",{children:"18:00"}),o.jsx("span",{children:"23:00"})]})]})}const Un=ut({method:"GET"}).handler(lt("64052f224a1d6696436e5d3deeee2b798f0742e1292ffabd038c3a7bf75e6fcb")),Vn=dt({queryKey:["projects","analytics"],queryFn:()=>Un(),refetchInterval:6e4}),Wn=[{key:"projectName",label:"Project"},{key:"totalSessions",label:"Sessions",align:"right"},{key:"totalMessages",label:"Messages",align:"right"},{key:"totalDurationMs",label:"Duration",align:"right"},{key:"lastSessionAt",label:"Last Active",align:"right"}];function Gn({projects:t}){const[e,n]=$.useState("lastSessionAt"),[r,a]=$.useState("desc"),i=$.useMemo(()=>{const l=[...t];return l.sort((u,d)=>{let m=0;switch(e){case"projectName":m=u.projectName.localeCompare(d.projectName);break;case"totalSessions":m=u.totalSessions-d.totalSessions;break;case"totalMessages":m=u.totalMessages-d.totalMessages;break;case"totalDurationMs":m=u.totalDurationMs-d.totalDurationMs;break;case"lastSessionAt":m=u.lastSessionAt.localeCompare(d.lastSessionAt);break}return r==="asc"?m:-m}),l},[t,e,r]);function s(l){l===e?a(u=>u==="asc"?"desc":"asc"):(n(l),a("desc"))}function c(l){return l!==e?null:o.jsx("span",{className:"ml-1",children:r==="asc"?"▲":"▼"})}return o.jsx("div",{className:"overflow-x-auto rounded-xl border border-gray-800 bg-gray-900/50",children:o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{children:o.jsx("tr",{className:"border-b border-gray-800",children:Wn.map(l=>o.jsxs("th",{onClick:()=>s(l.key),className:`cursor-pointer px-4 py-3 text-xs font-medium text-gray-400 hover:text-gray-200 ${l.align==="right"?"text-right":"text-left"}`,children:[l.label,c(l.key)]},l.key))})}),o.jsx("tbody",{children:i.map(l=>o.jsxs("tr",{className:"border-b border-gray-800/50 transition-colors hover:bg-gray-800/30",children:[o.jsxs("td",{className:"px-4 py-3",children:[o.jsx(Rt,{to:"/sessions",search:{project:l.projectName},className:"text-sm text-blue-400 hover:underline",children:l.projectName}),l.activeSessions>0&&o.jsxs("span",{className:"ml-2 rounded-full bg-green-500/20 px-1.5 py-0.5 text-[10px] font-medium text-green-400",children:[l.activeSessions," active"]})]}),o.jsx("td",{className:"px-4 py-3 text-right font-mono text-sm text-gray-300",children:l.totalSessions}),o.jsx("td",{className:"px-4 py-3 text-right font-mono text-sm text-gray-300",children:l.totalMessages.toLocaleString()}),o.jsx("td",{className:"px-4 py-3 text-right font-mono text-sm text-gray-300",children:Ee(l.totalDurationMs)}),o.jsx("td",{className:"px-4 py-3 text-right text-sm text-gray-400",children:zt(l.lastSessionAt)})]},l.projectPath))})]})})}function qn(){const{data:t,isLoading:e}=ft(Vn);if(e)return o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-3",children:Array.from({length:3}).map((s,c)=>o.jsx("div",{className:"h-20 animate-pulse rounded-xl bg-gray-900/50"},c))}),o.jsx("div",{className:"h-64 animate-pulse rounded-xl bg-gray-900/50"})]});const n=t?.projects??[];if(n.length===0)return o.jsx("div",{className:"py-12 text-center text-sm text-gray-500",children:"No projects found. Sessions will appear here once scanned."});const r=n.reduce((s,c)=>s+c.totalSessions,0),a=n.reduce((s,c)=>s+c.totalDurationMs,0),i=n.reduce((s,c)=>c.totalSessions>s.totalSessions?c:s);return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-4",children:[o.jsx(de,{label:"Total Projects",value:String(n.length)}),o.jsx(de,{label:"Total Sessions",value:r.toLocaleString()}),o.jsx(de,{label:"Total Duration",value:Ee(a)}),o.jsx(de,{label:"Most Active",value:i.projectName,sub:`${i.totalSessions} sessions`})]}),o.jsx(Gn,{projects:n})]})}function de({label:t,value:e,sub:n}){return o.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[o.jsx("p",{className:"text-xs text-gray-400",children:t}),o.jsx("p",{className:"mt-1 truncate text-xl font-bold text-white",children:e}),n&&o.jsx("p",{className:"mt-0.5 text-xs text-gray-500",children:n})]})}const Hn={};function ta(){const{tab:t}=Ue.useSearch(),e=Ue.useNavigate(),{data:n,isLoading:r}=ft(yr),a=$.useMemo(()=>{if(!n)return Hn;const s={};for(const[c,l]of Object.entries(n.modelUsage))s[c]={inputTokens:l.inputTokens,outputTokens:l.outputTokens,cacheReadInputTokens:l.cacheReadInputTokens,cacheCreationInputTokens:l.cacheCreationInputTokens};return s},[n]),{cost:i}=cr(a);return o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"text-2xl font-bold text-white",children:"Stats"}),o.jsx("p",{className:"mt-1 text-sm text-gray-400",children:"Usage analytics and project insights"})]}),t==="overview"&&n&&o.jsx(ur,{options:[{label:"Daily Activity (CSV)",onClick:()=>le(dr(n),"daily-activity.csv","text/csv")},{label:"Token Usage (CSV)",onClick:()=>le(fr(n),"daily-tokens.csv","text/csv")},{label:"Model Usage (CSV)",onClick:()=>le(hr(n),"model-usage.csv","text/csv")},{label:"Full Stats (JSON)",onClick:()=>le(mr(n),"stats.json","application/json")}]})]}),o.jsxs("div",{className:"mt-4 flex gap-1 border-b border-gray-800",children:[o.jsx("button",{onClick:()=>e({search:{tab:"overview"}}),className:`px-4 py-2 text-sm border-b-2 transition-colors ${t==="overview"?"border-blue-500 text-white":"border-transparent text-gray-400 hover:text-gray-200"}`,children:"Overview"}),o.jsx("button",{onClick:()=>e({search:{tab:"projects"}}),className:`px-4 py-2 text-sm border-b-2 transition-colors ${t==="projects"?"border-blue-500 text-white":"border-transparent text-gray-400 hover:text-gray-200"}`,children:"Projects"})]}),t==="overview"?o.jsx(Yn,{stats:n,isLoading:r,cost:i}):o.jsx("div",{className:"mt-6",children:o.jsx(qn,{})})]})}function Yn({stats:t,isLoading:e,cost:n}){if(e)return o.jsxs("div",{className:"mt-6 space-y-4",children:[o.jsx("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-5",children:Array.from({length:5}).map((a,i)=>o.jsx("div",{className:"h-20 animate-pulse rounded-xl bg-gray-900/50"},i))}),Array.from({length:3}).map((a,i)=>o.jsx("div",{className:"h-64 animate-pulse rounded-xl bg-gray-900/50"},i))]});if(!t)return o.jsx("div",{className:"py-12 text-center text-sm text-gray-500",children:"No stats data found. Check ~/.claude/stats-cache.json"});const r=Object.values(t.modelUsage).reduce((a,i)=>a+i.inputTokens+i.outputTokens,0);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"mt-6 grid grid-cols-2 gap-3 md:grid-cols-5",children:[o.jsx(re,{label:"Total Sessions",value:String(t.totalSessions)}),o.jsx(re,{label:"Total Messages",value:t.totalMessages.toLocaleString()}),o.jsx(re,{label:"Total Tokens",value:ie(r),sub:n?`~${We(n.totalUSD)}`:void 0}),o.jsx(re,{label:"Total Estimated Cost",value:n?`~${We(n.totalUSD)}`:"N/A"}),o.jsx(re,{label:"Longest Session",value:Ee(t.longestSession.duration),sub:`${t.longestSession.messageCount} messages`})]}),o.jsx("div",{className:"mt-6",children:o.jsx(In,{data:t.dailyActivity})}),o.jsx("div",{className:"mt-4",children:o.jsx(Fn,{data:t.dailyModelTokens})}),o.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-4 md:grid-cols-2",children:[o.jsx(Kn,{data:t.modelUsage}),o.jsx(Bn,{hourCounts:t.hourCounts})]})]})}function re({label:t,value:e,sub:n}){return o.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900/50 p-4",children:[o.jsx("p",{className:"text-xs text-gray-400",children:t}),o.jsx("p",{className:"mt-1 text-xl font-bold text-white",children:e}),n&&o.jsx("p",{className:"mt-0.5 text-xs text-gray-500",children:n})]})}export{ta as component};
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMatches, Link, Outlet } from "@tanstack/react-router";
|
|
3
|
-
import { u as usePrivacy } from "./router-ChxlsPNU.js";
|
|
4
|
-
import { useQuery } from "@tanstack/react-query";
|
|
5
|
-
import { a as activeSessionsQuery } from "./sessions.queries-B5ZBiVJy.js";
|
|
6
|
-
import "react";
|
|
7
|
-
import "zod";
|
|
8
|
-
import "./createSsrRpc-CVg2UDl0.js";
|
|
9
|
-
import "../server.js";
|
|
10
|
-
import "@tanstack/history";
|
|
11
|
-
import "@tanstack/router-core/ssr/client";
|
|
12
|
-
import "@tanstack/router-core";
|
|
13
|
-
import "node:async_hooks";
|
|
14
|
-
import "@tanstack/router-core/ssr/server";
|
|
15
|
-
import "h3-v2";
|
|
16
|
-
import "tiny-invariant";
|
|
17
|
-
import "seroval";
|
|
18
|
-
import "@tanstack/react-router/ssr/server";
|
|
19
|
-
function PrivacyToggle() {
|
|
20
|
-
const { privacyMode, togglePrivacyMode } = usePrivacy();
|
|
21
|
-
return /* @__PURE__ */ jsxs(
|
|
22
|
-
"button",
|
|
23
|
-
{
|
|
24
|
-
type: "button",
|
|
25
|
-
onClick: togglePrivacyMode,
|
|
26
|
-
title: privacyMode ? "Privacy mode on" : "Privacy mode off",
|
|
27
|
-
className: `flex items-center gap-2 rounded-lg px-3 py-1.5 text-xs transition-colors ${privacyMode ? "bg-blue-600 text-white" : "bg-gray-800 text-gray-400 hover:text-gray-200"}`,
|
|
28
|
-
children: [
|
|
29
|
-
/* @__PURE__ */ jsxs(
|
|
30
|
-
"svg",
|
|
31
|
-
{
|
|
32
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
33
|
-
viewBox: "0 0 20 20",
|
|
34
|
-
fill: "currentColor",
|
|
35
|
-
className: "h-3.5 w-3.5",
|
|
36
|
-
children: [
|
|
37
|
-
privacyMode ? (
|
|
38
|
-
// Eye-off icon
|
|
39
|
-
/* @__PURE__ */ jsx(
|
|
40
|
-
"path",
|
|
41
|
-
{
|
|
42
|
-
fillRule: "evenodd",
|
|
43
|
-
d: "M3.28 2.22a.75.75 0 00-1.06 1.06l14.5 14.5a.75.75 0 101.06-1.06l-1.745-1.745a10.029 10.029 0 003.3-4.38 1.651 1.651 0 000-1.185A10.004 10.004 0 009.999 3a9.956 9.956 0 00-4.744 1.194L3.28 2.22zM7.752 6.69l1.092 1.092a2.5 2.5 0 013.374 3.373l1.092 1.092a4 4 0 00-5.558-5.558z",
|
|
44
|
-
clipRule: "evenodd"
|
|
45
|
-
}
|
|
46
|
-
)
|
|
47
|
-
) : (
|
|
48
|
-
// Eye icon
|
|
49
|
-
/* @__PURE__ */ jsx("path", { d: "M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z" })
|
|
50
|
-
),
|
|
51
|
-
privacyMode ? /* @__PURE__ */ jsx("path", { d: "M10.748 13.93l2.523 2.523a9.987 9.987 0 01-3.27.547c-4.258 0-7.894-2.66-9.337-6.41a1.651 1.651 0 010-1.186A10.007 10.007 0 012.839 6.02L6.07 9.252a4 4 0 004.678 4.678z" }) : /* @__PURE__ */ jsx(
|
|
52
|
-
"path",
|
|
53
|
-
{
|
|
54
|
-
fillRule: "evenodd",
|
|
55
|
-
d: "M.458 10a9.996 9.996 0 019.542-6c4.258 0 7.894 2.66 9.337 6.41a1.651 1.651 0 010 1.186A10.004 10.004 0 0110 17.5c-4.258 0-7.894-2.66-9.337-6.41a1.651 1.651 0 010-1.186L.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z",
|
|
56
|
-
clipRule: "evenodd"
|
|
57
|
-
}
|
|
58
|
-
)
|
|
59
|
-
]
|
|
60
|
-
}
|
|
61
|
-
),
|
|
62
|
-
"Privacy"
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
function ActiveSessionsBadge() {
|
|
68
|
-
const { data: activeSessions } = useQuery(activeSessionsQuery);
|
|
69
|
-
const count = activeSessions?.length ?? 0;
|
|
70
|
-
if (count === 0) return null;
|
|
71
|
-
return /* @__PURE__ */ jsx("span", { className: "ml-auto rounded-full bg-green-500/20 px-1.5 py-0.5 text-[10px] font-medium text-green-400", children: count });
|
|
72
|
-
}
|
|
73
|
-
const NAV_ITEMS = [
|
|
74
|
-
{ to: "/sessions", label: "Sessions", icon: ">" },
|
|
75
|
-
{ to: "/stats", label: "Stats", icon: "#" },
|
|
76
|
-
{ to: "/settings", label: "Settings", icon: "*" }
|
|
77
|
-
];
|
|
78
|
-
function AppShell({ children }) {
|
|
79
|
-
const matches = useMatches();
|
|
80
|
-
const currentPath = matches[matches.length - 1]?.pathname ?? "";
|
|
81
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex min-h-screen", children: [
|
|
82
|
-
/* @__PURE__ */ jsxs("aside", { className: "flex w-56 shrink-0 flex-col border-r border-gray-800 bg-gray-950", children: [
|
|
83
|
-
/* @__PURE__ */ jsx("div", { className: "flex h-14 items-center border-b border-gray-800 px-4", children: /* @__PURE__ */ jsxs(Link, { to: "/sessions", className: "text-sm font-bold text-white", children: [
|
|
84
|
-
/* @__PURE__ */ jsx("span", { className: "text-blue-400", children: "Claude" }),
|
|
85
|
-
" Dashboard"
|
|
86
|
-
] }) }),
|
|
87
|
-
/* @__PURE__ */ jsx("nav", { className: "flex-1 p-3", children: NAV_ITEMS.map((item) => {
|
|
88
|
-
const isActive = currentPath.startsWith(item.to);
|
|
89
|
-
return /* @__PURE__ */ jsxs(
|
|
90
|
-
Link,
|
|
91
|
-
{
|
|
92
|
-
to: item.to,
|
|
93
|
-
className: `flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm transition-colors ${isActive ? "bg-gray-800 text-white" : "text-gray-400 hover:bg-gray-800/50 hover:text-gray-200"}`,
|
|
94
|
-
children: [
|
|
95
|
-
/* @__PURE__ */ jsx("span", { className: "font-mono text-xs text-gray-500", children: item.icon }),
|
|
96
|
-
item.label,
|
|
97
|
-
item.to === "/sessions" && /* @__PURE__ */ jsx(ActiveSessionsBadge, {})
|
|
98
|
-
]
|
|
99
|
-
},
|
|
100
|
-
item.to
|
|
101
|
-
);
|
|
102
|
-
}) }),
|
|
103
|
-
/* @__PURE__ */ jsxs("div", { className: "border-t border-gray-800 p-3", children: [
|
|
104
|
-
/* @__PURE__ */ jsx(PrivacyToggle, {}),
|
|
105
|
-
/* @__PURE__ */ jsx("p", { className: "mt-2 text-xs text-gray-600", children: "Read-only observer" })
|
|
106
|
-
] })
|
|
107
|
-
] }),
|
|
108
|
-
/* @__PURE__ */ jsx("main", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ jsx("div", { className: "mx-auto max-w-5xl px-6 py-6", children }) })
|
|
109
|
-
] });
|
|
110
|
-
}
|
|
111
|
-
function DashboardLayout() {
|
|
112
|
-
return /* @__PURE__ */ jsx(AppShell, { children: /* @__PURE__ */ jsx(Outlet, {}) });
|
|
113
|
-
}
|
|
114
|
-
export {
|
|
115
|
-
DashboardLayout as component
|
|
116
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const tsrStartManifest = () => ({ "routes": { "__root__": { "filePath": "/Users/dmytro.lupiak/Documents/GitHub/claude-session-dashboard/apps/web/src/routes/__root.tsx", "children": ["/", "/_dashboard"], "preloads": ["/assets/main-CM5g2n-_.js"], "assets": [] }, "/": { "filePath": "/Users/dmytro.lupiak/Documents/GitHub/claude-session-dashboard/apps/web/src/routes/index.tsx" }, "/_dashboard": { "filePath": "/Users/dmytro.lupiak/Documents/GitHub/claude-session-dashboard/apps/web/src/routes/_dashboard.tsx", "children": ["/_dashboard/settings", "/_dashboard/stats", "/_dashboard/sessions/$sessionId", "/_dashboard/sessions/"], "assets": [], "preloads": ["/assets/_dashboard-Bxw4OxIS.js", "/assets/createServerFn-B0pEGqTk.js", "/assets/sessions.queries-AUVV0tJj.js"] }, "/_dashboard/settings": { "filePath": "/Users/dmytro.lupiak/Documents/GitHub/claude-session-dashboard/apps/web/src/routes/_dashboard/settings.tsx", "assets": [], "preloads": ["/assets/settings-CIwZDakc.js", "/assets/settings.types-BRNIMHGJ.js"] }, "/_dashboard/stats": { "filePath": "/Users/dmytro.lupiak/Documents/GitHub/claude-session-dashboard/apps/web/src/routes/_dashboard/stats.tsx", "assets": [], "preloads": ["/assets/stats-CjWSMX3y.js", "/assets/format-Bsprb3az.js", "/assets/useSessionCost-DgFKglaG.js", "/assets/settings.types-BRNIMHGJ.js"] }, "/_dashboard/sessions/$sessionId": { "filePath": "/Users/dmytro.lupiak/Documents/GitHub/claude-session-dashboard/apps/web/src/routes/_dashboard/sessions/$sessionId.tsx", "assets": [], "preloads": ["/assets/_sessionId-CNR4Ln7m.js", "/assets/format-Bsprb3az.js", "/assets/useSessionCost-DgFKglaG.js", "/assets/settings.types-BRNIMHGJ.js"] }, "/_dashboard/sessions/": { "filePath": "/Users/dmytro.lupiak/Documents/GitHub/claude-session-dashboard/apps/web/src/routes/_dashboard/sessions/index.tsx", "assets": [], "preloads": ["/assets/index-BbdJ1jMA.js", "/assets/format-Bsprb3az.js"] } }, "clientEntry": "/assets/main-CM5g2n-_.js" });
|
|
2
|
-
export {
|
|
3
|
-
tsrStartManifest
|
|
4
|
-
};
|