claudedash 1.1.19 → 1.1.21

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.
Files changed (51) hide show
  1. package/README.md +49 -41
  2. package/dist/cli.js +34 -38
  3. package/dist/cli.js.map +1 -1
  4. package/dist/public/404/index.html +1 -1
  5. package/dist/public/404.html +1 -1
  6. package/dist/public/__next.__PAGE__.txt +4 -4
  7. package/dist/public/__next._full.txt +9 -9
  8. package/dist/public/__next._head.txt +3 -3
  9. package/dist/public/__next._index.txt +3 -3
  10. package/dist/public/__next._tree.txt +1 -1
  11. package/dist/public/_next/static/chunks/102f894cc892994d.js +1 -0
  12. package/dist/public/_next/static/chunks/3ecc4e803f4fe50b.js +2 -0
  13. package/dist/public/_next/static/chunks/417032eeb2cd875f.js +1 -0
  14. package/dist/public/_next/static/chunks/42d98220570fe13c.js +1 -0
  15. package/dist/public/_next/static/chunks/4e6e8f15ae4855e7.js +117 -0
  16. package/dist/public/_next/static/chunks/a5e4bfca0e003ba5.js +4 -0
  17. package/dist/public/_next/static/chunks/ca5e0a147fb6f55a.js +1 -0
  18. package/dist/public/_next/static/chunks/turbopack-b020cfa7754340f9.js +4 -0
  19. package/dist/public/_not-found/__next._full.txt +7 -7
  20. package/dist/public/_not-found/__next._head.txt +3 -3
  21. package/dist/public/_not-found/__next._index.txt +3 -3
  22. package/dist/public/_not-found/__next._not-found.__PAGE__.txt +2 -2
  23. package/dist/public/_not-found/__next._not-found.txt +3 -3
  24. package/dist/public/_not-found/__next._tree.txt +1 -1
  25. package/dist/public/_not-found/index.html +1 -1
  26. package/dist/public/_not-found/index.txt +7 -7
  27. package/dist/public/index.html +1 -1
  28. package/dist/public/index.txt +9 -9
  29. package/dist/server/routes/live.d.ts.map +1 -1
  30. package/dist/server/routes/live.js +14 -6
  31. package/dist/server/routes/live.js.map +1 -1
  32. package/dist/server/routes/observability.d.ts +2 -0
  33. package/dist/server/routes/observability.d.ts.map +1 -1
  34. package/dist/server/routes/observability.js +63 -21
  35. package/dist/server/routes/observability.js.map +1 -1
  36. package/dist/server/routes/plan.d.ts.map +1 -1
  37. package/dist/server/routes/plan.js +12 -2
  38. package/dist/server/routes/plan.js.map +1 -1
  39. package/dist/server/server.d.ts.map +1 -1
  40. package/dist/server/server.js +36 -1
  41. package/dist/server/server.js.map +1 -1
  42. package/package.json +1 -1
  43. package/dist/public/_next/static/chunks/64ee9622541d967c.js +0 -1
  44. package/dist/public/_next/static/chunks/66f59f4487e89157.js +0 -1
  45. package/dist/public/_next/static/chunks/9dc6819ec7a7f68e.js +0 -70
  46. package/dist/public/_next/static/chunks/d1f8ac52f80f9493.js +0 -5
  47. package/dist/public/_next/static/chunks/fcc461f9588a6a00.js +0 -1
  48. package/dist/public/_next/static/chunks/turbopack-87039ecabc6befeb.js +0 -4
  49. /package/dist/public/_next/static/{-yq2R_KJUG4eYkge_g-vr → w2zTveDspeTAIEShNK2C9}/_buildManifest.js +0 -0
  50. /package/dist/public/_next/static/{-yq2R_KJUG4eYkge_g-vr → w2zTveDspeTAIEShNK2C9}/_clientMiddlewareManifest.json +0 -0
  51. /package/dist/public/_next/static/{-yq2R_KJUG4eYkge_g-vr → w2zTveDspeTAIEShNK2C9}/_ssgManifest.js +0 -0
@@ -1,70 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,23733,e=>{"use strict";var t=e.i(27493),s=e.i(4);let r=(...e)=>e.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim(),a=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,s)=>s?s.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let o=(0,s.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:l="",children:i,iconNode:d,...c},m)=>(0,s.createElement)("svg",{ref:m,...n,width:t,height:t,stroke:e,strokeWidth:o?24*Number(a)/Number(t):a,className:r("lucide",l),...!i&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(c)&&{"aria-hidden":"true"},...c},[...d.map(([e,t])=>(0,s.createElement)(e,t)),...Array.isArray(i)?i:[i]])),l=(e,t)=>{let n=(0,s.forwardRef)(({className:n,...l},i)=>(0,s.createElement)(o,{ref:i,iconNode:t,className:r(`lucide-${a(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...l}));return n.displayName=a(e),n},i=l("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),d=l("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),c=l("radio",[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),m=l("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]),u=l("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]),x=l("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),h=l("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),p=l("panel-left-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]),f=l("chart-no-axes-column",[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]]),g=l("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),b=l("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),j=l("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]),v=l("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var y=e.i(4730);let N=l("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),k=l("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),w=l("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),C=l("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),S=l("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]),z=l("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);function T(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function E(...e){return t=>{let s=!1,r=e.map(e=>{let r=T(e,t);return s||"function"!=typeof r||(s=!0),r});if(s)return()=>{for(let t=0;t<r.length;t++){let s=r[t];"function"==typeof s?s():T(e[t],null)}}}}function M(...e){return s.useCallback(E(...e),e)}e.i(9854);var $=Symbol("radix.slottable");function D(e){return s.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===$}var A=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{var a,n;let o,l,i,d=(n=a=`Primitive.${r}`,(o=s.forwardRef((e,t)=>{let{children:r,...a}=e;if(s.isValidElement(r)){var n;let e,o,l=(n=r,(o=(e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?n.ref:(o=(e=Object.getOwnPropertyDescriptor(n,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?n.props.ref:n.props.ref||n.ref),i=function(e,t){let s={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?s[r]=(...e)=>{let t=n(...e);return a(...e),t}:a&&(s[r]=a):"style"===r?s[r]={...a,...n}:"className"===r&&(s[r]=[a,n].filter(Boolean).join(" "))}return{...e,...s}}(a,r.props);return r.type!==s.Fragment&&(i.ref=t?E(t,l):l),s.cloneElement(r,i)}return s.Children.count(r)>1?s.Children.only(null):null})).displayName=`${n}.SlotClone`,l=o,(i=s.forwardRef((e,r)=>{let{children:a,...n}=e,o=s.Children.toArray(a),i=o.find(D);if(i){let e=i.props.children,a=o.map(t=>t!==i?t:s.Children.count(e)>1?s.Children.only(null):s.isValidElement(e)?e.props.children:null);return(0,t.jsx)(l,{...n,ref:r,children:s.isValidElement(e)?s.cloneElement(e,void 0,a):null})}return(0,t.jsx)(l,{...n,ref:r,children:a})})).displayName=`${a}.Slot`,i),c=s.forwardRef((e,s)=>{let{asChild:a,...n}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(a?d:r,{...n,ref:s})});return c.displayName=`Primitive.${r}`,{...e,[r]:c}},{}),R=globalThis?.document?s.useLayoutEffect:()=>{},L=e=>{var t;let r,a,{present:n,children:o}=e,l=function(e){var t,r;let[a,n]=s.useState(),o=s.useRef(null),l=s.useRef(e),i=s.useRef("none"),[d,c]=(t=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},s.useReducer((e,t)=>r[e][t]??e,t));return s.useEffect(()=>{let e=O(o.current);i.current="mounted"===d?e:"none"},[d]),R(()=>{let t=o.current,s=l.current;if(s!==e){let r=i.current,a=O(t);e?c("MOUNT"):"none"===a||t?.display==="none"?c("UNMOUNT"):s&&r!==a?c("ANIMATION_OUT"):c("UNMOUNT"),l.current=e}},[e,c]),R(()=>{if(a){let e,t=a.ownerDocument.defaultView??window,s=s=>{let r=O(o.current).includes(CSS.escape(s.animationName));if(s.target===a&&r&&(c("ANIMATION_END"),!l.current)){let s=a.style.animationFillMode;a.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===a.style.animationFillMode&&(a.style.animationFillMode=s)})}},r=e=>{e.target===a&&(i.current=O(o.current))};return a.addEventListener("animationstart",r),a.addEventListener("animationcancel",s),a.addEventListener("animationend",s),()=>{t.clearTimeout(e),a.removeEventListener("animationstart",r),a.removeEventListener("animationcancel",s),a.removeEventListener("animationend",s)}}c("ANIMATION_END")},[a,c]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:s.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(n),i="function"==typeof o?o({present:l.isPresent}):s.Children.only(o),d=M(l.ref,(t=i,(a=(r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.ref:(a=(r=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof o||l.isPresent?s.cloneElement(i,{ref:d}):null};function O(e){return e?.animationName||"none"}function P(e){let t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...e)=>t.current?.(...e),[])}L.displayName="Presence";var I=s.createContext(void 0);function _(e,t,{checkForDefaultPrevented:s=!0}={}){return function(r){if(e?.(r),!1===s||!r.defaultPrevented)return t?.(r)}}"u">typeof window&&window.document&&window.document.createElement;var U="ScrollArea",[W,F]=function(e,r=[]){let a=[],n=()=>{let t=a.map(e=>s.createContext(e));return function(r){let a=r?.[e]||t;return s.useMemo(()=>({[`__scope${e}`]:{...r,[e]:a}}),[r,a])}};return n.scopeName=e,[function(r,n){let o=s.createContext(n),l=a.length;a=[...a,n];let i=r=>{let{scope:a,children:n,...i}=r,d=a?.[e]?.[l]||o,c=s.useMemo(()=>i,Object.values(i));return(0,t.jsx)(d.Provider,{value:c,children:n})};return i.displayName=r+"Provider",[i,function(t,a){let i=a?.[e]?.[l]||o,d=s.useContext(i);if(d)return d;if(void 0!==n)return n;throw Error(`\`${t}\` must be used within \`${r}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let a=r.reduce((t,{useScope:s,scopeName:r})=>{let a=s(e)[`__scope${r}`];return{...t,...a}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}(n,...r)]}(U),[H,q]=W(U),B=s.forwardRef((e,r)=>{let a,{__scopeScrollArea:n,type:o="hover",dir:l,scrollHideDelay:i=600,...d}=e,[c,m]=s.useState(null),[u,x]=s.useState(null),[h,p]=s.useState(null),[f,g]=s.useState(null),[b,j]=s.useState(null),[v,y]=s.useState(0),[N,k]=s.useState(0),[w,C]=s.useState(!1),[S,z]=s.useState(!1),T=M(r,e=>m(e)),E=(a=s.useContext(I),l||a||"ltr");return(0,t.jsx)(H,{scope:n,type:o,dir:E,scrollHideDelay:i,scrollArea:c,viewport:u,onViewportChange:x,content:h,onContentChange:p,scrollbarX:f,onScrollbarXChange:g,scrollbarXEnabled:w,onScrollbarXEnabledChange:C,scrollbarY:b,onScrollbarYChange:j,scrollbarYEnabled:S,onScrollbarYEnabledChange:z,onCornerWidthChange:y,onCornerHeightChange:k,children:(0,t.jsx)(A.div,{dir:E,...d,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":N+"px",...e.style}})})});B.displayName=U;var K="ScrollAreaViewport",V=s.forwardRef((e,r)=>{let{__scopeScrollArea:a,children:n,nonce:o,...l}=e,i=q(K,a),d=M(r,s.useRef(null),i.onViewportChange);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,t.jsx)(A.div,{"data-radix-scroll-area-viewport":"",...l,ref:d,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,t.jsx)("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});V.displayName=K;var G="ScrollAreaScrollbar",Y=s.forwardRef((e,r)=>{let{forceMount:a,...n}=e,o=q(G,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:i}=o,d="horizontal"===e.orientation;return s.useEffect(()=>(d?l(!0):i(!0),()=>{d?l(!1):i(!1)}),[d,l,i]),"hover"===o.type?(0,t.jsx)(X,{...n,ref:r,forceMount:a}):"scroll"===o.type?(0,t.jsx)(Q,{...n,ref:r,forceMount:a}):"auto"===o.type?(0,t.jsx)(J,{...n,ref:r,forceMount:a}):"always"===o.type?(0,t.jsx)(Z,{...n,ref:r}):null});Y.displayName=G;var X=s.forwardRef((e,r)=>{let{forceMount:a,...n}=e,o=q(G,e.__scopeScrollArea),[l,i]=s.useState(!1);return s.useEffect(()=>{let e=o.scrollArea,t=0;if(e){let s=()=>{window.clearTimeout(t),i(!0)},r=()=>{t=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return e.addEventListener("pointerenter",s),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",s),e.removeEventListener("pointerleave",r)}}},[o.scrollArea,o.scrollHideDelay]),(0,t.jsx)(L,{present:a||l,children:(0,t.jsx)(J,{"data-state":l?"visible":"hidden",...n,ref:r})})}),Q=s.forwardRef((e,r)=>{var a;let{forceMount:n,...o}=e,l=q(G,e.__scopeScrollArea),i="horizontal"===e.orientation,d=eg(()=>m("SCROLL_END"),100),[c,m]=(a={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},s.useReducer((e,t)=>a[e][t]??e,"hidden"));return s.useEffect(()=>{if("idle"===c){let e=window.setTimeout(()=>m("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(e)}},[c,l.scrollHideDelay,m]),s.useEffect(()=>{let e=l.viewport,t=i?"scrollLeft":"scrollTop";if(e){let s=e[t],r=()=>{let r=e[t];s!==r&&(m("SCROLL"),d()),s=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[l.viewport,i,m,d]),(0,t.jsx)(L,{present:n||"hidden"!==c,children:(0,t.jsx)(Z,{"data-state":"hidden"===c?"hidden":"visible",...o,ref:r,onPointerEnter:_(e.onPointerEnter,()=>m("POINTER_ENTER")),onPointerLeave:_(e.onPointerLeave,()=>m("POINTER_LEAVE"))})})}),J=s.forwardRef((e,r)=>{let a=q(G,e.__scopeScrollArea),{forceMount:n,...o}=e,[l,i]=s.useState(!1),d="horizontal"===e.orientation,c=eg(()=>{if(a.viewport){let e=a.viewport.offsetWidth<a.viewport.scrollWidth,t=a.viewport.offsetHeight<a.viewport.scrollHeight;i(d?e:t)}},10);return eb(a.viewport,c),eb(a.content,c),(0,t.jsx)(L,{present:n||l,children:(0,t.jsx)(Z,{"data-state":l?"visible":"hidden",...o,ref:r})})}),Z=s.forwardRef((e,r)=>{let{orientation:a="vertical",...n}=e,o=q(G,e.__scopeScrollArea),l=s.useRef(null),i=s.useRef(0),[d,c]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=eu(d.viewport,d.content),u={...n,sizes:d,onSizesChange:c,hasThumb:!!(m>0&&m<1),onThumbChange:e=>l.current=e,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:e=>i.current=e};function x(e,t){return function(e,t,s,r="ltr"){let a=ex(s),n=t||a/2,o=s.scrollbar.paddingStart+n,l=s.scrollbar.size-s.scrollbar.paddingEnd-(a-n),i=s.content-s.viewport;return ep([o,l],"ltr"===r?[0,i]:[-1*i,0])(e)}(e,i.current,d,t)}return"horizontal"===a?(0,t.jsx)(ee,{...u,ref:r,onThumbPositionChange:()=>{if(o.viewport&&l.current){let e=eh(o.viewport.scrollLeft,d,o.dir);l.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{o.viewport&&(o.viewport.scrollLeft=e)},onDragScroll:e=>{o.viewport&&(o.viewport.scrollLeft=x(e,o.dir))}}):"vertical"===a?(0,t.jsx)(et,{...u,ref:r,onThumbPositionChange:()=>{if(o.viewport&&l.current){let e=eh(o.viewport.scrollTop,d);l.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{o.viewport&&(o.viewport.scrollTop=e)},onDragScroll:e=>{o.viewport&&(o.viewport.scrollTop=x(e))}}):null}),ee=s.forwardRef((e,r)=>{let{sizes:a,onSizesChange:n,...o}=e,l=q(G,e.__scopeScrollArea),[i,d]=s.useState(),c=s.useRef(null),m=M(r,c,l.onScrollbarXChange);return s.useEffect(()=>{c.current&&d(getComputedStyle(c.current))},[c]),(0,t.jsx)(ea,{"data-orientation":"horizontal",...o,ref:m,sizes:a,style:{bottom:0,left:"rtl"===l.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===l.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ex(a)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,s)=>{if(l.viewport){var r,a;let n=l.viewport.scrollLeft+t.deltaX;e.onWheelScroll(n),r=n,a=s,r>0&&r<a&&t.preventDefault()}},onResize:()=>{c.current&&l.viewport&&i&&n({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:em(i.paddingLeft),paddingEnd:em(i.paddingRight)}})}})}),et=s.forwardRef((e,r)=>{let{sizes:a,onSizesChange:n,...o}=e,l=q(G,e.__scopeScrollArea),[i,d]=s.useState(),c=s.useRef(null),m=M(r,c,l.onScrollbarYChange);return s.useEffect(()=>{c.current&&d(getComputedStyle(c.current))},[c]),(0,t.jsx)(ea,{"data-orientation":"vertical",...o,ref:m,sizes:a,style:{top:0,right:"ltr"===l.dir?0:void 0,left:"rtl"===l.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ex(a)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,s)=>{if(l.viewport){var r,a;let n=l.viewport.scrollTop+t.deltaY;e.onWheelScroll(n),r=n,a=s,r>0&&r<a&&t.preventDefault()}},onResize:()=>{c.current&&l.viewport&&i&&n({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:em(i.paddingTop),paddingEnd:em(i.paddingBottom)}})}})}),[es,er]=W(G),ea=s.forwardRef((e,r)=>{let{__scopeScrollArea:a,sizes:n,hasThumb:o,onThumbChange:l,onThumbPointerUp:i,onThumbPointerDown:d,onThumbPositionChange:c,onDragScroll:m,onWheelScroll:u,onResize:x,...h}=e,p=q(G,a),[f,g]=s.useState(null),b=M(r,e=>g(e)),j=s.useRef(null),v=s.useRef(""),y=p.viewport,N=n.content-n.viewport,k=P(u),w=P(c),C=eg(x,10);function S(e){j.current&&m({x:e.clientX-j.current.left,y:e.clientY-j.current.top})}return s.useEffect(()=>{let e=e=>{let t=e.target;f?.contains(t)&&k(e,N)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[y,f,N,k]),s.useEffect(w,[n,w]),eb(f,C),eb(p.content,C),(0,t.jsx)(es,{scope:a,scrollbar:f,hasThumb:o,onThumbChange:P(l),onThumbPointerUp:P(i),onThumbPositionChange:w,onThumbPointerDown:P(d),children:(0,t.jsx)(A.div,{...h,ref:b,style:{position:"absolute",...h.style},onPointerDown:_(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),j.current=f.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),S(e))}),onPointerMove:_(e.onPointerMove,S),onPointerUp:_(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=""),j.current=null})})})}),en="ScrollAreaThumb",eo=s.forwardRef((e,s)=>{let{forceMount:r,...a}=e,n=er(en,e.__scopeScrollArea);return(0,t.jsx)(L,{present:r||n.hasThumb,children:(0,t.jsx)(el,{ref:s,...a})})}),el=s.forwardRef((e,r)=>{let{__scopeScrollArea:a,style:n,...o}=e,l=q(en,a),i=er(en,a),{onThumbPositionChange:d}=i,c=M(r,e=>i.onThumbChange(e)),m=s.useRef(void 0),u=eg(()=>{m.current&&(m.current(),m.current=void 0)},100);return s.useEffect(()=>{let e=l.viewport;if(e){let t=()=>{u(),m.current||(m.current=ef(e,d),d())};return d(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[l.viewport,u,d]),(0,t.jsx)(A.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:_(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),s=e.clientX-t.left,r=e.clientY-t.top;i.onThumbPointerDown({x:s,y:r})}),onPointerUp:_(e.onPointerUp,i.onThumbPointerUp)})});eo.displayName=en;var ei="ScrollAreaCorner",ed=s.forwardRef((e,s)=>{let r=q(ei,e.__scopeScrollArea),a=!!(r.scrollbarX&&r.scrollbarY);return"scroll"!==r.type&&a?(0,t.jsx)(ec,{...e,ref:s}):null});ed.displayName=ei;var ec=s.forwardRef((e,r)=>{let{__scopeScrollArea:a,...n}=e,o=q(ei,a),[l,i]=s.useState(0),[d,c]=s.useState(0),m=!!(l&&d);return eb(o.scrollbarX,()=>{let e=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(e),c(e)}),eb(o.scrollbarY,()=>{let e=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(e),i(e)}),m?(0,t.jsx)(A.div,{...n,ref:r,style:{width:l,height:d,position:"absolute",right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:0,...e.style}}):null});function em(e){return e?parseInt(e,10):0}function eu(e,t){let s=e/t;return isNaN(s)?0:s}function ex(e){let t=eu(e.viewport,e.content),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd;return Math.max((e.scrollbar.size-s)*t,18)}function eh(e,t,s="ltr"){let r=ex(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,n=t.scrollbar.size-a,o=t.content-t.viewport,l=function(e,[t,s]){return Math.min(s,Math.max(t,e))}(e,"ltr"===s?[0,o]:[-1*o,0]);return ep([0,o],[0,n-r])(l)}function ep(e,t){return s=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(s-e[0])}}var ef=(e,t=()=>{})=>{let s={left:e.scrollLeft,top:e.scrollTop},r=0;return!function a(){let n={left:e.scrollLeft,top:e.scrollTop},o=s.left!==n.left,l=s.top!==n.top;(o||l)&&t(),s=n,r=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(r)};function eg(e,t){let r=P(e),a=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(a.current),[]),s.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(r,t)},[r,t])}function eb(e,t){let s=P(t);R(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(s)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,s])}let ej=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),ev=[],ey=(e,t,s)=>{if(0==e.length-t)return s.classGroupId;let r=e[t],a=s.nextPart.get(r);if(a){let s=ey(e,t+1,a);if(s)return s}let n=s.validators;if(null===n)return;let o=0===t?e.join("-"):e.slice(t).join("-"),l=n.length;for(let e=0;e<l;e++){let t=n[e];if(t.validator(o))return t.classGroupId}},eN=(e,t)=>{let s=ej();for(let r in e)ek(e[r],s,r,t);return s},ek=(e,t,s,r)=>{let a=e.length;for(let n=0;n<a;n++)ew(e[n],t,s,r)},ew=(e,t,s,r)=>{"string"==typeof e?eC(e,t,s):"function"==typeof e?eS(e,t,s,r):ez(e,t,s,r)},eC=(e,t,s)=>{(""===e?t:eT(t,e)).classGroupId=s},eS=(e,t,s,r)=>{eE(e)?ek(e(r),t,s,r):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:s,validator:e}))},ez=(e,t,s,r)=>{let a=Object.entries(e),n=a.length;for(let e=0;e<n;e++){let[n,o]=a[e];ek(o,eT(t,n),s,r)}},eT=(e,t)=>{let s=e,r=t.split("-"),a=r.length;for(let e=0;e<a;e++){let t=r[e],a=s.nextPart.get(t);a||(a=ej(),s.nextPart.set(t,a)),s=a}return s},eE=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,eM=[],e$=(e,t,s,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:r,isExternal:a}),eD=/\s+/,eA=e=>{let t;if("string"==typeof e)return e;let s="";for(let r=0;r<e.length;r++)e[r]&&(t=eA(e[r]))&&(s&&(s+=" "),s+=t);return s},eR=[],eL=e=>{let t=t=>t[e]||eR;return t.isThemeGetter=!0,t},eO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,eP=/^\((?:(\w[\w-]*):)?(.+)\)$/i,eI=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,e_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eU=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,eW=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,eF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,eq=e=>eI.test(e),eB=e=>!!e&&!Number.isNaN(Number(e)),eK=e=>!!e&&Number.isInteger(Number(e)),eV=e=>e.endsWith("%")&&eB(e.slice(0,-1)),eG=e=>e_.test(e),eY=()=>!0,eX=e=>eU.test(e)&&!eW.test(e),eQ=()=>!1,eJ=e=>eF.test(e),eZ=e=>eH.test(e),e0=e=>!e2(e)&&!te(e),e1=e=>ti(e,tu,eQ),e2=e=>eO.test(e),e5=e=>ti(e,tx,eX),e3=e=>ti(e,th,eB),e4=e=>ti(e,tf,eY),e6=e=>ti(e,tp,eQ),e8=e=>ti(e,tc,eQ),e7=e=>ti(e,tm,eZ),e9=e=>ti(e,tg,eJ),te=e=>eP.test(e),tt=e=>td(e,tx),ts=e=>td(e,tp),tr=e=>td(e,tc),ta=e=>td(e,tu),tn=e=>td(e,tm),to=e=>td(e,tg,!0),tl=e=>td(e,tf,!0),ti=(e,t,s)=>{let r=eO.exec(e);return!!r&&(r[1]?t(r[1]):s(r[2]))},td=(e,t,s=!1)=>{let r=eP.exec(e);return!!r&&(r[1]?t(r[1]):s)},tc=e=>"position"===e||"percentage"===e,tm=e=>"image"===e||"url"===e,tu=e=>"length"===e||"size"===e||"bg-size"===e,tx=e=>"length"===e,th=e=>"number"===e,tp=e=>"family-name"===e,tf=e=>"number"===e||"weight"===e,tg=e=>"shadow"===e,tb=((e,...t)=>{let s,r,a,n,o=e=>{let t=r(e);if(t)return t;let n=((e,t)=>{let{parseClassName:s,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:n}=t,o=[],l=e.trim().split(eD),i="";for(let e=l.length-1;e>=0;e-=1){let t=l[e],{isExternal:d,modifiers:c,hasImportantModifier:m,baseClassName:u,maybePostfixModifierPosition:x}=s(t);if(d){i=t+(i.length>0?" "+i:i);continue}let h=!!x,p=r(h?u.substring(0,x):u);if(!p){if(!h||!(p=r(u))){i=t+(i.length>0?" "+i:i);continue}h=!1}let f=0===c.length?"":1===c.length?c[0]:n(c).join(":"),g=m?f+"!":f,b=g+p;if(o.indexOf(b)>-1)continue;o.push(b);let j=a(p,h);for(let e=0;e<j.length;++e){let t=j[e];o.push(g+t)}i=t+(i.length>0?" "+i:i)}return i})(e,s);return a(e,n),n};return n=l=>{var i;let d;return r=(s={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,s=Object.create(null),r=Object.create(null),a=(a,n)=>{s[a]=n,++t>e&&(t=0,r=s,s=Object.create(null))};return{get(e){let t=s[e];return void 0!==t?t:void 0!==(t=r[e])?(a(e,t),t):void 0},set(e,t){e in s?s[e]=t:a(e,t)}}})((i=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:s}=e,r=e=>{let t,s=[],r=0,a=0,n=0,o=e.length;for(let l=0;l<o;l++){let o=e[l];if(0===r&&0===a){if(":"===o){s.push(e.slice(n,l)),n=l+1;continue}if("/"===o){t=l;continue}}"["===o?r++:"]"===o?r--:"("===o?a++:")"===o&&a--}let l=0===s.length?e:e.slice(n),i=l,d=!1;return l.endsWith("!")?(i=l.slice(0,-1),d=!0):l.startsWith("!")&&(i=l.slice(1),d=!0),e$(s,d,i,t&&t>n?t-n:void 0)};if(t){let e=t+":",s=r;r=t=>t.startsWith(e)?s(t.slice(e.length)):e$(eM,!1,t,void 0,!0)}if(s){let e=r;r=t=>s({className:t,parseClassName:e})}return r})(i),sortModifiers:(d=new Map,i.orderSensitiveModifiers.forEach((e,t)=>{d.set(e,1e6+t)}),e=>{let t=[],s=[];for(let r=0;r<e.length;r++){let a=e[r],n="["===a[0],o=d.has(a);n||o?(s.length>0&&(s.sort(),t.push(...s),s=[]),t.push(a)):s.push(a)}return s.length>0&&(s.sort(),t.push(...s)),t}),...(e=>{let t=(e=>{let{theme:t,classGroups:s}=e;return eN(s,t)})(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var s;let t,r,a;return -1===(s=e).slice(1,-1).indexOf(":")?void 0:(r=(t=s.slice(1,-1)).indexOf(":"),(a=t.slice(0,r))?"arbitrary.."+a:void 0)}let r=e.split("-"),a=+(""===r[0]&&r.length>1);return ey(r,a,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],a=s[e];if(t){if(a){let e=Array(a.length+t.length);for(let t=0;t<a.length;t++)e[t]=a[t];for(let s=0;s<t.length;s++)e[a.length+s]=t[s];return e}return t}return a||ev}return s[e]||ev}}})(i)}).cache.get,a=s.cache.set,n=o,o(l)},(...e)=>n(((...e)=>{let t,s,r=0,a="";for(;r<e.length;)(t=e[r++])&&(s=eA(t))&&(a&&(a+=" "),a+=s);return a})(...e))})(()=>{let e=eL("color"),t=eL("font"),s=eL("text"),r=eL("font-weight"),a=eL("tracking"),n=eL("leading"),o=eL("breakpoint"),l=eL("container"),i=eL("spacing"),d=eL("radius"),c=eL("shadow"),m=eL("inset-shadow"),u=eL("text-shadow"),x=eL("drop-shadow"),h=eL("blur"),p=eL("perspective"),f=eL("aspect"),g=eL("ease"),b=eL("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],y=()=>[...v(),te,e2],N=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],w=()=>[te,e2,i],C=()=>[eq,"full","auto",...w()],S=()=>[eK,"none","subgrid",te,e2],z=()=>["auto",{span:["full",eK,te,e2]},eK,te,e2],T=()=>[eK,"auto",te,e2],E=()=>["auto","min","max","fr",te,e2],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...w()],A=()=>[eq,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],R=()=>[eq,"screen","full","dvw","lvw","svw","min","max","fit",...w()],L=()=>[eq,"screen","full","lh","dvh","lvh","svh","min","max","fit",...w()],O=()=>[e,te,e2],P=()=>[...v(),tr,e8,{position:[te,e2]}],I=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",ta,e1,{size:[te,e2]}],U=()=>[eV,tt,e5],W=()=>["","none","full",d,te,e2],F=()=>["",eB,tt,e5],H=()=>["solid","dashed","dotted","double"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>[eB,eV,tr,e8],K=()=>["","none",h,te,e2],V=()=>["none",eB,te,e2],G=()=>["none",eB,te,e2],Y=()=>[eB,te,e2],X=()=>[eq,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[eG],breakpoint:[eG],color:[eY],container:[eG],"drop-shadow":[eG],ease:["in","out","in-out"],font:[e0],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[eG],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[eG],shadow:[eG],spacing:["px",eB],text:[eG],"text-shadow":[eG],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",eq,e2,te,f]}],container:["container"],columns:[{columns:[eB,e2,te,l]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{"inset-s":C(),start:C()}],end:[{"inset-e":C(),end:C()}],"inset-bs":[{"inset-bs":C()}],"inset-be":[{"inset-be":C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:["visible","invisible","collapse"],z:[{z:[eK,"auto",te,e2]}],basis:[{basis:[eq,"full","auto",l,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[eB,eq,"auto","initial","none",e2]}],grow:[{grow:["",eB,te,e2]}],shrink:[{shrink:["",eB,te,e2]}],order:[{order:[eK,"first","last","none",te,e2]}],"grid-cols":[{"grid-cols":S()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":E()}],"auto-rows":[{"auto-rows":E()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],"inline-size":[{inline:["auto",...R()]}],"min-inline-size":[{"min-inline":["auto",...R()]}],"max-inline-size":[{"max-inline":["none",...R()]}],"block-size":[{block:["auto",...L()]}],"min-block-size":[{"min-block":["auto",...L()]}],"max-block-size":[{"max-block":["none",...L()]}],w:[{w:[l,"screen",...A()]}],"min-w":[{"min-w":[l,"screen","none",...A()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh",...A()]}],"font-size":[{text:["base",s,tt,e5]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,tl,e4]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",eV,e2]}],"font-family":[{font:[ts,e6,t]}],"font-features":[{"font-features":[e2]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,te,e2]}],"line-clamp":[{"line-clamp":[eB,"none",te,e3]}],leading:[{leading:[n,...w()]}],"list-image":[{"list-image":["none",te,e2]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",te,e2]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:[eB,"from-font","auto",te,e5]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[eB,"auto",te,e2]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te,e2]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",te,e2]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:I()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},eK,te,e2],radial:["",te,e2],conic:[eK,te,e2]},tn,e7]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-bs":[{"border-bs":F()}],"border-w-be":[{"border-be":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":F()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...H(),"hidden","none"]}],"divide-style":[{divide:[...H(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...H(),"none","hidden"]}],"outline-offset":[{"outline-offset":[eB,te,e2]}],"outline-w":[{outline:["",eB,tt,e5]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",c,to,e9]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",m,to,e9]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[eB,e5]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",u,to,e9]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[eB,te,e2]}],"mix-blend":[{"mix-blend":[...q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":q()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[eB]}],"mask-image-linear-from-pos":[{"mask-linear-from":B()}],"mask-image-linear-to-pos":[{"mask-linear-to":B()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":B()}],"mask-image-t-to-pos":[{"mask-t-to":B()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":B()}],"mask-image-r-to-pos":[{"mask-r-to":B()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":B()}],"mask-image-b-to-pos":[{"mask-b-to":B()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":B()}],"mask-image-l-to-pos":[{"mask-l-to":B()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":B()}],"mask-image-x-to-pos":[{"mask-x-to":B()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":B()}],"mask-image-y-to-pos":[{"mask-y-to":B()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[te,e2]}],"mask-image-radial-from-pos":[{"mask-radial-from":B()}],"mask-image-radial-to-pos":[{"mask-radial-to":B()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":v()}],"mask-image-conic-pos":[{"mask-conic":[eB]}],"mask-image-conic-from-pos":[{"mask-conic-from":B()}],"mask-image-conic-to-pos":[{"mask-conic-to":B()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:I()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",te,e2]}],filter:[{filter:["","none",te,e2]}],blur:[{blur:K()}],brightness:[{brightness:[eB,te,e2]}],contrast:[{contrast:[eB,te,e2]}],"drop-shadow":[{"drop-shadow":["","none",x,to,e9]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",eB,te,e2]}],"hue-rotate":[{"hue-rotate":[eB,te,e2]}],invert:[{invert:["",eB,te,e2]}],saturate:[{saturate:[eB,te,e2]}],sepia:[{sepia:["",eB,te,e2]}],"backdrop-filter":[{"backdrop-filter":["","none",te,e2]}],"backdrop-blur":[{"backdrop-blur":K()}],"backdrop-brightness":[{"backdrop-brightness":[eB,te,e2]}],"backdrop-contrast":[{"backdrop-contrast":[eB,te,e2]}],"backdrop-grayscale":[{"backdrop-grayscale":["",eB,te,e2]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[eB,te,e2]}],"backdrop-invert":[{"backdrop-invert":["",eB,te,e2]}],"backdrop-opacity":[{"backdrop-opacity":[eB,te,e2]}],"backdrop-saturate":[{"backdrop-saturate":[eB,te,e2]}],"backdrop-sepia":[{"backdrop-sepia":["",eB,te,e2]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",te,e2]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[eB,"initial",te,e2]}],ease:[{ease:["linear","initial",g,te,e2]}],delay:[{delay:[eB,te,e2]}],animate:[{animate:["none",b,te,e2]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,te,e2]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:V()}],"rotate-x":[{"rotate-x":V()}],"rotate-y":[{"rotate-y":V()}],"rotate-z":[{"rotate-z":V()}],scale:[{scale:G()}],"scale-x":[{"scale-x":G()}],"scale-y":[{"scale-y":G()}],"scale-z":[{"scale-z":G()}],"scale-3d":["scale-3d"],skew:[{skew:Y()}],"skew-x":[{"skew-x":Y()}],"skew-y":[{"skew-y":Y()}],transform:[{transform:[te,e2,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:X()}],"translate-x":[{"translate-x":X()}],"translate-y":[{"translate-y":X()}],"translate-z":[{"translate-z":X()}],"translate-none":["translate-none"],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",te,e2]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",te,e2]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[eB,tt,e5,e3]}],stroke:[{stroke:["none",...O()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function tj(...e){return tb(function(){for(var e,t,s=0,r="",a=arguments.length;s<a;s++)(e=arguments[s])&&(t=function e(t){var s,r,a="";if("string"==typeof t||"number"==typeof t)a+=t;else if("object"==typeof t)if(Array.isArray(t)){var n=t.length;for(s=0;s<n;s++)t[s]&&(r=e(t[s]))&&(a&&(a+=" "),a+=r)}else for(r in t)t[r]&&(a&&(a+=" "),a+=r);return a}(e))&&(r&&(r+=" "),r+=t);return r}(e))}function tv({className:e,children:s,...r}){return(0,t.jsxs)(B,{"data-slot":"scroll-area",className:tj("relative overflow-hidden",e),...r,children:[(0,t.jsx)(V,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 !overflow-y-auto [&>div]:!block",children:s}),(0,t.jsx)(ty,{}),(0,t.jsx)(ed,{})]})}function ty({className:e,orientation:s="vertical",...r}){return(0,t.jsx)(Y,{"data-slot":"scroll-area-scrollbar",orientation:s,className:tj("flex touch-none p-px transition-colors select-none","vertical"===s&&"h-full w-2.5 border-l border-l-transparent","horizontal"===s&&"h-2.5 flex-col border-t border-t-transparent",e),...r,children:(0,t.jsx)(eo,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function tN({lines:e}){let[r,a]=(0,s.useState)(0),[n,o]=(0,s.useState)(0),[l,i]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let t=e[r];if(!l&&n<t.length){let e=setTimeout(()=>o(e=>e+1),40+30*Math.random());return()=>clearTimeout(e)}if(!l&&n===t.length){let e=setTimeout(()=>i(!0),2e3);return()=>clearTimeout(e)}if(l&&n>0){let e=setTimeout(()=>o(e=>e-1),20);return()=>clearTimeout(e)}l&&0===n&&(i(!1),a(t=>(t+1)%e.length))},[n,l,r,e]),(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,t.jsx)("div",{className:"text-muted-foreground/30 text-4xl font-bold select-none",children:">_"}),(0,t.jsx)("div",{className:"h-8 flex items-center",children:(0,t.jsx)("span",{className:"text-sm text-muted-foreground/60 typing-cursor pr-1",children:e[r].slice(0,n)})})]})}function tk({wt:e,selected:s,onClick:r}){return(0,t.jsxs)("button",{onClick:r,className:`w-full text-left rounded-lg border p-3 transition-colors ${s?"bg-accent border-ring":"bg-card border-border hover:bg-accent/50"}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsx)(u,{className:"size-3.5 text-chart-4 shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground truncate font-mono",children:e.worktreeName??e.branch}),e.isClaudeManaged&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5 text-[10px] text-chart-4 bg-chart-4/10 px-1.5 py-0.5 rounded border border-chart-4/20 shrink-0 ml-auto",children:[(0,t.jsx)(z,{className:"size-2.5"}),"claude"]})]}),e.worktreeName&&(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground/50 font-mono truncate mb-0.5",children:e.branch}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground/60 font-mono truncate mb-2",children:e.path}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[e.dirty?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-chart-3 bg-chart-3/10 px-1.5 py-0.5 rounded",children:[(0,t.jsx)(w,{className:"size-2.5"}),"dirty"]}):(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-chart-2 bg-chart-2/10 px-1.5 py-0.5 rounded",children:[(0,t.jsx)(C,{className:"size-2.5"}),"clean"]}),e.aheadCount>0&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5 text-[11px] text-chart-2",children:[(0,t.jsx)(N,{className:"size-2.5"}),e.aheadCount]}),e.behindCount>0&&(0,t.jsxs)("span",{className:"flex items-center gap-0.5 text-[11px] text-chart-5",children:[(0,t.jsx)(k,{className:"size-2.5"}),e.behindCount]}),0===e.aheadCount&&0===e.behindCount&&(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground/40",children:"synced"}),(e.associatedTasks?.length??0)>0&&(0,t.jsxs)("span",{className:"ml-auto text-[11px] bg-chart-4/20 text-chart-4 px-1.5 py-0.5 rounded",children:[e.associatedTasks.length," task",1!==e.associatedTasks.length?"s":""]})]})]})}function tw({wt:e}){return(0,t.jsxs)("div",{className:"h-full flex flex-col",children:[(0,t.jsxs)("div",{className:"px-5 py-4 border-b border-border bg-sidebar/40 shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsx)(u,{className:"size-4 text-chart-4"}),(0,t.jsx)("span",{className:"text-base font-semibold text-foreground font-mono",children:e.worktreeName??e.branch}),e.isClaudeManaged&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-chart-4 bg-chart-4/10 px-2 py-0.5 rounded-full border border-chart-4/20",children:[(0,t.jsx)(z,{className:"size-3"}),"Claude-managed"]})]}),e.worktreeName&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground/50 font-mono mb-0.5",children:e.branch}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground/60 font-mono",children:e.path}),(0,t.jsxs)("div",{className:"flex items-center gap-3 mt-3 flex-wrap",children:[e.dirty?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-chart-3 bg-chart-3/10 px-2 py-0.5 rounded-full border border-chart-3/20",children:[(0,t.jsx)(w,{className:"size-3"}),"Uncommitted changes"]}):(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-chart-2 bg-chart-2/10 px-2 py-0.5 rounded-full border border-chart-2/20",children:[(0,t.jsx)(C,{className:"size-3"}),"Working tree clean"]}),e.aheadCount>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-chart-2",children:[(0,t.jsx)(N,{className:"size-3"}),e.aheadCount," ahead"]}),e.behindCount>0&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs text-chart-5",children:[(0,t.jsx)(k,{className:"size-3"}),e.behindCount," behind"]})]})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsxs)("div",{className:"p-5 space-y-5",children:[e.head&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:"HEAD Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-2 bg-card border border-border rounded px-3 py-2",children:[(0,t.jsx)(S,{className:"size-3.5 text-chart-4 shrink-0"}),(0,t.jsx)("code",{className:"text-xs text-chart-4 font-mono",children:e.head.slice(0,12)}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground font-mono",children:e.head})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:"Full Path"}),(0,t.jsx)("div",{className:"bg-card border border-border rounded px-3 py-2",children:(0,t.jsx)("code",{className:"text-xs text-muted-foreground font-mono break-all",children:e.path})})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:["Associated Tasks",(e.associatedTasks?.length??0)>0&&(0,t.jsxs)("span",{className:"ml-1.5 text-muted-foreground/40 normal-case",children:["(",e.associatedTasks.length,")"]})]}),(e.associatedTasks?.length??0)===0?(0,t.jsx)("p",{className:"text-xs text-muted-foreground/40 py-2",children:"No tasks associated with this worktree"}):(0,t.jsx)("div",{className:"space-y-2",children:e.associatedTasks.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 rounded bg-card border border-border",children:[(0,t.jsxs)("span",{className:"font-mono text-xs text-muted-foreground shrink-0",children:["#",e.taskId]}),(0,t.jsx)("span",{className:"text-xs text-foreground truncate flex-1",children:e.taskSubject}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/40 font-mono shrink-0",children:e.sessionId.slice(0,8)})]},`${e.sessionId}-${e.taskId}`))})]})]})})]})}function tC(){let[e,r]=(0,s.useState)([]),[a,n]=(0,s.useState)(!0),[o,l]=(0,s.useState)(null),[i,c]=(0,s.useState)(null),m=(0,s.useRef)(null),x=async()=>{try{let e=await fetch("/worktrees");if(!e.ok)return;let t=(await e.json()).worktrees??[];r(t),l(new Date),c(e=>e?t.find(t=>t.path===e.path)??t[0]??null:t[0]??null)}catch{}finally{n(!1)}};return(0,s.useEffect)(()=>(x(),m.current=setInterval(x,3e4),()=>{m.current&&clearInterval(m.current)}),[]),(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"bg-sidebar border-b border-sidebar-border px-4 py-2 flex items-center justify-between shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u,{className:"size-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Git Worktrees"}),e.length>0&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground/60 bg-muted px-1.5 py-0.5 rounded",children:e.length})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[o&&(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/40",children:o.toLocaleTimeString()}),(0,t.jsx)("button",{onClick:x,className:"p-1 rounded hover:bg-sidebar-accent transition-colors",title:"Refresh worktrees",children:(0,t.jsx)(d,{className:"size-3.5 text-muted-foreground"})})]})]}),a?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground/40 text-xs",children:"Loading..."}):0===e.length?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center p-8",children:(0,t.jsx)(tN,{lines:["No git worktrees detected","claude --worktree <name>","Creates .claude/worktrees/<name>/ automatically","Run parallel agents in isolated worktrees"]})}):(0,t.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,t.jsx)("div",{className:"w-72 min-w-[240px] border-r border-border flex flex-col overflow-hidden",children:(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-3 space-y-2",children:e.map(e=>(0,t.jsx)(tk,{wt:e,selected:i?.path===e.path,onClick:()=>c(e)},e.path))})})}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:i?(0,t.jsx)(tw,{wt:i}):(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground/40 text-xs",children:"Select a worktree to see details"})})]})]})}let tS=l("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),tz=l("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),tT=l("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);function tE(e){switch(e){case"critical":return"text-chart-5";case"warn":return"text-chart-3";default:return"text-chart-2"}}function tM({level:e}){let s=`size-3.5 ${tE(e)}`;return"critical"===e?(0,t.jsx)(w,{className:s}):"warn"===e?(0,t.jsx)(tT,{className:s}):(0,t.jsx)(C,{className:s})}function t$(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function tD({health:e}){if(!e)return(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/40",children:"ctx –"});let{percentage:s,warningLevel:r}=e;return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 text-[10px] font-mono ${tE(r)}`,title:`Context: ${s}% used (${r})
2
- Tokens: ${t$(e.tokensUsed)}${e.maxTokens?` / ${t$(e.maxTokens)}`:""}`,children:[(0,t.jsx)(tM,{level:r}),s,"%"]})}function tA({health:e}){if(!e)return(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground/40",children:[(0,t.jsx)("div",{className:"flex-1 bg-muted rounded-full h-1.5"}),(0,t.jsx)("span",{className:"font-mono shrink-0",children:"–"})]});let{percentage:s,warningLevel:r,tokensUsed:a,maxTokens:n}=e,o=function(e){switch(e){case"critical":return"bg-chart-5";case"warn":return"bg-chart-3";default:return"bg-chart-2"}}(r);return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex-1 bg-muted rounded-full h-1.5 overflow-hidden",title:`${s}% context used`,children:(0,t.jsx)("div",{className:`${o} h-1.5 rounded-full transition-all`,style:{width:`${Math.min(100,s)}%`}})}),(0,t.jsxs)("div",{className:`flex items-center gap-1 text-[10px] font-mono shrink-0 ${tE(r)}`,children:[(0,t.jsx)(tM,{level:r}),(0,t.jsxs)("span",{children:[s,"%"]})]})]}),"safe"!==r&&(0,t.jsxs)("div",{className:`flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded ${"critical"===r?"bg-chart-5/10 text-chart-5":"bg-chart-3/10 text-chart-3"}`,children:[(0,t.jsx)(tM,{level:r}),(0,t.jsxs)("span",{children:["critical"===r?"Context critical":"Context warn",n?` \xb7 ${t$(a)} / ${t$(n)}`:""]})]})]})}function tR(e){switch(e){case"DONE":case"completed":return"bg-chart-2/20 text-chart-2";case"FAILED":return"bg-chart-5/20 text-chart-5";case"BLOCKED":return"bg-chart-3/20 text-chart-3";case"READY":case"pending":return"bg-chart-1/20 text-chart-1";case"in_progress":return"bg-chart-4/20 text-chart-4";default:return"bg-muted text-muted-foreground"}}function tL({searchQuery:e,sidebarCollapsed:r}){let a,n,o,[l,i]=(0,s.useState)(!1),{sessions:d,selectedSession:c,setSelectedSession:m,sessionCounts:u}=function(e=!1){let[t,r]=(0,s.useState)([]),[a,n]=(0,s.useState)(null),[o,l]=(0,s.useState)(!1),[i,d]=(0,s.useState)(null),c=(0,s.useRef)(null);(0,s.useEffect)(()=>{c.current=a?.id??null},[a]);let m=(0,s.useCallback)(async()=>{try{let t=e?"/sessions?days=all":"/sessions",s=await fetch(t);if(!s.ok)return;let a=await s.json();r(a.sessions),null!=a.total&&d({total:a.total,filtered:a.filtered??a.sessions.length});let o=c.current;if(!o&&a.sessions.length>0)n(a.sessions[0]);else if(o){let e=a.sessions.find(e=>e.id===o);e&&n(e)}}catch{}},[e]);return(0,s.useEffect)(()=>{m();let e=new EventSource("/events/");return e.onopen=()=>l(!0),e.onmessage=e=>{try{let t=JSON.parse(e.data);"sessions"===t.type&&m()}catch{}},e.onerror=()=>l(!1),()=>{e.close(),l(!1)}},[m]),{sessions:t,selectedSession:a,setSelectedSession:n,connected:o,sessionCounts:i}}(l),[x,h]=(0,s.useState)(null),[p,f]=(0,s.useState)(!1),[g,b]=(0,s.useState)(!1),[j,v]=(0,s.useState)(!1),[y,N]=(0,s.useState)(null),k=(0,s.useRef)(null),[w,C]=(0,s.useState)(null),[S,z]=(0,s.useState)([]),[T,E]=(0,s.useState)([]),[M,$]=(0,s.useState)(null),[D,A]=(0,s.useState)(null),R=(0,s.useRef)(new Map);(0,s.useEffect)(()=>{let e=Date.now(),t=R.current,s=e-6e5;for(let r of d){let a=r.tokenUsage?.inputTokens??0;if(a<=0)continue;let n=t.get(r.id)??[];for(n.push({ts:e,tokens:a});n.length>1&&n[0].ts<s;)n.shift();t.set(r.id,n)}},[d]);let L=e=>{let t=R.current.get(e);if(!t||t.length<2)return null;let s=t[0],r=t[t.length-1],a=r.tokens-s.tokens,n=(r.ts-s.ts)/6e4;return n<.25||a<=0?null:a/n};(0,s.useEffect)(()=>{let e=new AbortController,{signal:t}=e;function s(){fetch("/queue",{signal:t}).then(e=>e.ok?e.json():null).then(e=>{e&&!e.errors?.length&&C(e.summary)}).catch(()=>{}),fetch("/agents",{signal:t}).then(e=>e.ok?e.json():null).then(e=>{e?.agents&&z(e.agents)}).catch(()=>{}),fetch("/hook/events",{signal:t}).then(e=>e.ok?e.json():null).then(e=>{if(!e?.events)return;let t=e.events.find(e=>"PreCompact"===e.event||"PostCompact"===e.event);t&&$({at:t.receivedAt,phase:"PreCompact"===t.event?"pre":"post"})}).catch(()=>{}),fetch("/billing-block",{signal:t}).then(e=>e.ok?e.json():null).then(e=>{e&&A(e)}).catch(()=>{}),fetch("/history",{signal:t}).then(e=>e.ok?e.json():null).then(e=>{if(!e?.prompts)return;let t=new Map;for(let s of e.prompts){let e=t.get(s.sessionId);(!e||s.timestamp>e.timestamp)&&t.set(s.sessionId,s)}E([...t.values()].sort((e,t)=>t.timestamp.localeCompare(e.timestamp)).slice(0,5).map(e=>({sessionId:e.sessionId,projectName:e.projectName,lastPrompt:e.display,updatedAt:e.timestamp})))}).catch(()=>{})}s();let r=setInterval(s,15e3);return()=>{clearInterval(r),e.abort()}},[]);let O=`You MUST use the TodoWrite tool to track your work.
3
- At the START of any multi-step task, create a todo list with all steps.
4
- Mark each task in_progress before starting, completed after finishing.`;(0,s.useEffect)(()=>{let e=d.some(e=>e.tasks.length>0);if(e){b(!1),k.current&&clearTimeout(k.current);return}return d.length>0&&!e&&(k.current&&clearTimeout(k.current),k.current=setTimeout(()=>b(!0),3e4)),()=>{k.current&&clearTimeout(k.current)}},[d]);let P=e=>{let t=`claude resume ${e}`;navigator.clipboard.writeText(t),fetch(`/sessions/${e}/resume-cmd`,{method:"POST"}).catch(()=>{}),N(t),setTimeout(()=>N(null),3e3)},I=d.filter(e=>null!=e.contextHealth),_=I.length>0?{percentage:a=Math.max(...I.map(e=>e.contextHealth.percentage)),warningLevel:a>=75?"critical":a>=65?"warn":"safe"}:null;if(0===d.length)return(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,t.jsx)(tN,{lines:["Start a Claude Code session to see tasks here","npx claudedash start → launch dashboard","Agent uses TodoWrite to track progress","Sessions appear here in real-time"]})});let U=(c?.tasks||[]).filter(t=>t.subject.toLowerCase().includes(e.toLowerCase())||t.description.toLowerCase().includes(e.toLowerCase())||t.id.toLowerCase().includes(e.toLowerCase())),W=U.filter(e=>"pending"===e.status),F=U.filter(e=>"in_progress"===e.status),H=U.filter(e=>"completed"===e.status),q=e=>e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e),B=e=>e.inputTokens+e.outputTokens+e.cacheCreationTokens+e.cacheReadTokens;return(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[y&&(0,t.jsxs)("div",{className:"bg-chart-4/10 border-b border-chart-4/30 px-4 py-2 flex items-center gap-3 text-xs shrink-0",children:[(0,t.jsx)(tS,{className:"size-3 text-chart-4 shrink-0"}),(0,t.jsx)("span",{className:"text-foreground/80",children:"Copied to clipboard:"}),(0,t.jsx)("code",{className:"font-mono text-chart-4 bg-chart-4/10 px-1.5 py-0.5 rounded",children:y}),(0,t.jsx)("button",{onClick:()=>N(null),className:"ml-auto text-muted-foreground hover:text-foreground",children:"×"})]}),g&&(0,t.jsxs)("div",{className:"bg-chart-3/10 border-b border-chart-3/30 px-4 py-2.5 flex items-start gap-3 text-xs shrink-0",children:[(0,t.jsx)("span",{className:"text-chart-3 mt-0.5 shrink-0",children:"⚠"}),(0,t.jsxs)("div",{className:"flex-1 text-foreground/80",children:[(0,t.jsx)("span",{className:"font-semibold text-foreground",children:"Agent setup missing."})," ","Sessions are visible but no tasks have appeared in 30 seconds. Add this to your project's"," ",(0,t.jsx)("code",{className:"bg-muted px-1 rounded",children:"CLAUDE.md"}),":",(0,t.jsx)("div",{className:"mt-1.5 font-mono bg-muted/60 rounded px-2 py-1 text-[10px] leading-relaxed whitespace-pre",children:O})]}),(0,t.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(O),v(!0),setTimeout(()=>v(!1),2e3)},className:"flex items-center gap-1.5 shrink-0 text-chart-3 hover:text-foreground transition-colors border border-chart-3/30 rounded px-2 py-1",children:j?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tz,{className:"size-3"}),(0,t.jsx)("span",{children:"Copied"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tS,{className:"size-3"}),(0,t.jsx)("span",{children:"Copy"})]})}),(0,t.jsx)("button",{onClick:()=>b(!1),className:"text-muted-foreground hover:text-foreground shrink-0 ml-1",children:"×"})]}),(0,t.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,t.jsxs)("div",{className:`bg-sidebar border-r border-sidebar-border flex flex-col overflow-hidden transition-all duration-300 ${r?"w-0 border-r-0":"w-[220px]"}`,children:[(0,t.jsxs)("div",{className:"p-3 border-b border-sidebar-border flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Sessions"}),u&&u.total>u.filtered&&!l&&(0,t.jsxs)("button",{onClick:()=>i(!0),className:"text-[9px] text-muted-foreground/60 hover:text-muted-foreground underline shrink-0",title:`${u.total-u.filtered} older sessions hidden`,children:["+",u.total-u.filtered," older"]}),l&&(0,t.jsx)("button",{onClick:()=>i(!1),className:"text-[9px] text-muted-foreground/60 hover:text-muted-foreground underline shrink-0",children:"7d only"})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-2 space-y-1",children:d.map(e=>{let s,r;return(0,t.jsxs)("div",{className:"relative group",children:[(0,t.jsxs)("button",{onClick:()=>{m(e),h(null)},className:`w-full text-left p-2.5 rounded-lg transition-colors ${c?.id===e.id?"bg-accent border border-ring":"hover:bg-accent/50 border border-transparent"}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[e.tasks.some(e=>"in_progress"===e.status)&&(0,t.jsxs)("span",{className:"relative flex size-2",children:[(0,t.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-chart-2 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex rounded-full size-2 bg-chart-2"})]}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground truncate",children:e.projectName||e.id.slice(0,8)})]}),e.projectName&&(0,t.jsx)("div",{className:"text-[10px] text-muted-foreground/60 font-mono truncate mb-1",children:e.id.slice(0,8)}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex-1 bg-muted rounded-full h-1.5",children:(0,t.jsx)("div",{className:"bg-chart-2 h-1.5 rounded-full transition-all",style:{width:`${0===e.tasks.length?0:Math.round(e.tasks.filter(e=>"completed"===e.status).length/e.tasks.length*100)}%`}})}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground shrink-0",children:[e.tasks.filter(e=>"completed"===e.status).length,"/",e.tasks.length]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground/60 mt-1",children:[(0,t.jsx)("span",{children:(e=>{let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`})(e.updatedAt)}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[e.tokenUsage&&(0,t.jsxs)("span",{title:`In: ${q(e.tokenUsage.inputTokens)} | Out: ${q(e.tokenUsage.outputTokens)} | Cache: ${q(e.tokenUsage.cacheReadTokens)}`,children:[q(B(e.tokenUsage))," tok"]}),(0,t.jsx)(tD,{health:e.contextHealth})]})]}),(s=L(e.id),r=(e=>{let t=L(e.id);if(!t||!e.contextHealth?.maxTokens)return null;let s=e.contextHealth.maxTokens-e.contextHealth.tokensUsed;return s<=0?0:Math.round(s/t)})(e),s?(0,t.jsxs)("div",{className:"text-[9px] text-muted-foreground/50 mt-0.5 leading-tight",children:[q(Math.round(s)),"/min",null!=r&&(0,t.jsxs)("span",{className:"ml-1 text-chart-3",children:["~",r,"min"]})]}):null),((e.linesAdded??0)>0||(e.gitCommits??0)>0)&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[10px] mt-1",children:[(e.linesAdded??0)>0&&(0,t.jsxs)("span",{className:"text-chart-2",children:["+",q(e.linesAdded)," lines"]}),(e.gitCommits??0)>0&&(0,t.jsxs)("span",{className:"text-chart-1",children:[e.gitCommits," commit",1!==e.gitCommits?"s":""]}),e.languages&&Object.keys(e.languages).slice(0,2).map(e=>(0,t.jsx)("span",{className:"text-muted-foreground/50",children:e},e))]})]}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),P(e.id)},title:`Copy 'claude resume ${e.id}' to clipboard`,className:"absolute top-2 right-2 p-1 rounded opacity-0 group-hover:opacity-100 hover:bg-accent transition-all text-muted-foreground hover:text-foreground",children:(0,t.jsx)(tS,{className:"size-2.5"})})]},e.id)})})}),T.filter(e=>!d.some(t=>t.id===e.sessionId)).length>0&&(0,t.jsxs)("div",{className:"border-t border-sidebar-border p-2 space-y-1 shrink-0",children:[(0,t.jsx)("span",{className:"text-[9px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Resume"}),T.filter(e=>!d.some(t=>t.id===e.sessionId)).slice(0,3).map(e=>(0,t.jsxs)("button",{onClick:()=>P(e.sessionId),title:`Copy: claude resume ${e.sessionId}`,className:"w-full text-left group flex items-start gap-1.5 p-1.5 rounded hover:bg-accent/50 transition-colors",children:[(0,t.jsx)(tS,{className:"size-2.5 mt-0.5 shrink-0 text-muted-foreground group-hover:text-foreground"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"text-[10px] font-medium text-foreground truncate leading-tight",children:e.projectName??e.sessionId.slice(0,8)}),(0,t.jsx)("div",{className:"text-[9px] text-muted-foreground truncate leading-tight",children:e.lastPrompt.length>40?e.lastPrompt.slice(0,40)+"…":e.lastPrompt})]})]},e.sessionId))]}),M&&(o=(n=Math.floor((Date.now()-new Date(M.at).getTime())/6e4))<1?"just now":n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`,(0,t.jsx)("div",{className:"border-t border-sidebar-border px-2 py-1.5 shrink-0",children:(0,t.jsxs)("div",{className:"text-[9px] text-muted-foreground leading-tight",children:[(0,t.jsx)("span",{className:"font-medium text-chart-4",children:"compact"})," ",o," · state saved"]})})),D?.active&&null!=D.minutesRemaining&&(0,t.jsxs)("div",{className:"border-t border-sidebar-border px-2 py-1.5 shrink-0",children:[(0,t.jsx)("span",{className:"text-[9px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Billing Block"}),(0,t.jsxs)("div",{className:"text-[9px] text-chart-3 mt-0.5 leading-tight",children:["~",D.minutesRemaining,"min left",null!=D.estimatedCostUSD&&null!=D.minutesElapsed&&D.minutesElapsed>0&&(0,t.jsxs)("span",{className:"ml-1 text-muted-foreground",children:["· est. $",(D.estimatedCostUSD*(1+D.minutesRemaining/D.minutesElapsed)).toFixed(2)]})]})]}),(w||S.length>0)&&(0,t.jsxs)("div",{className:"border-t border-sidebar-border p-2 space-y-2 shrink-0",children:[w&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-[9px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Queue"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1 text-[9px]",children:[w.ready>0&&(0,t.jsxs)("span",{className:"px-1.5 py-0.5 rounded bg-chart-2/15 text-chart-2 font-medium",children:[w.ready," READY"]}),w.done>0&&(0,t.jsxs)("span",{className:"px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:[w.done," DONE"]}),w.blocked>0&&(0,t.jsxs)("span",{className:"px-1.5 py-0.5 rounded bg-chart-5/15 text-chart-5 font-semibold",children:[w.blocked," BLOCKED"]}),w.failed>0&&(0,t.jsxs)("span",{className:"px-1.5 py-0.5 rounded bg-destructive/15 text-destructive",children:[w.failed," FAILED"]})]})]}),S.length>0&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("span",{className:"text-[9px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Agents"}),S.map(e=>(0,t.jsxs)("div",{className:`text-[9px] leading-tight ${e.isStale?"opacity-40":""}`,children:[(0,t.jsx)("span",{className:"font-medium text-foreground truncate block",children:e.name}),e.taskId&&(0,t.jsx)("span",{className:"text-muted-foreground",children:e.taskId})]},e.agentId))]})]})]}),(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[_&&"safe"!==_.warningLevel&&(0,t.jsxs)("div",{className:`px-4 py-1.5 flex items-center gap-2 text-xs border-b shrink-0 ${"critical"===_.warningLevel?"bg-chart-5/10 border-chart-5/20 text-chart-5":"bg-chart-3/10 border-chart-3/20 text-chart-3"}`,children:[(0,t.jsx)(tD,{health:{..._,tokensUsed:0}}),(0,t.jsxs)("span",{children:["Highest context across ",I.length," session",1!==I.length?"s":"",":"," ",_.percentage,"% (",_.warningLevel,")"]})]}),c?(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[c.tokenUsage&&(0,t.jsxs)("div",{className:"bg-sidebar border-b border-sidebar-border px-4 py-2 flex items-center gap-6 text-xs shrink-0",children:[(0,t.jsx)("span",{className:"text-muted-foreground font-medium",children:"Tokens:"}),(0,t.jsxs)("span",{className:"text-foreground",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"In "}),q(c.tokenUsage.inputTokens)]}),(0,t.jsxs)("span",{className:"text-foreground",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Out "}),q(c.tokenUsage.outputTokens)]}),(0,t.jsxs)("span",{className:"text-foreground",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Cache Write "}),q(c.tokenUsage.cacheCreationTokens)]}),(0,t.jsxs)("span",{className:"text-foreground",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Cache Read "}),q(c.tokenUsage.cacheReadTokens)]}),(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["Total:"," ",q(B(c.tokenUsage))]}),c.contextHealth&&(0,t.jsx)("div",{className:"ml-auto w-48",children:(0,t.jsx)(tA,{health:c.contextHealth})})]}),(0,t.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex-1 flex gap-4 p-4 overflow-x-auto",children:[(0,t.jsx)(tO,{title:"Pending",count:W.length,tasks:W,statusColor:"chart-1",selectedTask:x,setSelectedTask:h}),(0,t.jsx)(tO,{title:"In Progress",count:F.length,tasks:F,statusColor:"chart-4",selectedTask:x,setSelectedTask:h}),(0,t.jsx)(tO,{title:"Completed",count:H.length,tasks:H,statusColor:"chart-2",selectedTask:x,setSelectedTask:h})]}),x&&(0,t.jsxs)("div",{className:"w-[350px] bg-sidebar border-l border-border flex flex-col shrink-0",children:[(0,t.jsxs)("div",{className:"p-4 border-b border-border flex items-center justify-between",children:[(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded font-semibold ${tR(x.status)}`,children:function(e){switch(e){case"pending":return"PENDING";case"in_progress":return"IN PROGRESS";case"completed":return"COMPLETED";default:return e}}(x.status)}),(0,t.jsx)("button",{onClick:()=>h(null),className:"text-muted-foreground hover:text-foreground text-sm",children:"×"})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsxs)("div",{className:"p-4 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-1",children:x.subject}),"in_progress"===x.status&&x.activeForm&&(0,t.jsx)("p",{className:"text-xs text-chart-4 italic",children:x.activeForm})]}),x.description&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground uppercase mb-1",children:"Description"}),(0,t.jsx)("p",{className:"text-xs text-foreground/80 leading-relaxed whitespace-pre-wrap",children:x.description})]}),x.blockedBy.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground uppercase mb-1",children:"Blocked By"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:x.blockedBy.map(e=>(0,t.jsxs)("span",{className:"text-xs bg-chart-3/20 text-chart-3 px-2 py-0.5 rounded",children:["Task #",e]},e))})]}),x.blocks.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground uppercase mb-1",children:"Blocks"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:x.blocks.map(e=>(0,t.jsxs)("span",{className:"text-xs bg-muted text-muted-foreground px-2 py-0.5 rounded",children:["Task #",e]},e))})]}),(0,t.jsxs)("div",{className:"pt-2 border-t border-border space-y-2",children:[(0,t.jsx)("button",{onClick:()=>{var e;return e=x.id,void(navigator.clipboard.writeText(e),f(!0),setTimeout(()=>f(!1),2e3))},className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:p?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tz,{className:"size-3 text-chart-2"}),(0,t.jsx)("span",{className:"text-chart-2",children:"Copied"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tS,{className:"size-3"}),(0,t.jsxs)("span",{children:["Copy ID: ",x.id]})]})}),c&&(0,t.jsxs)("button",{onClick:()=>P(c.id),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",title:`Copy 'claude resume ${c.id}' to clipboard`,children:[(0,t.jsx)(tS,{className:"size-3"}),(0,t.jsx)("span",{children:"Resume session"})]})]})]})})]})]})]}):(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,t.jsx)("div",{className:"text-center",children:(0,t.jsx)("p",{className:"text-muted-foreground",children:"Select a session from the sidebar"})})})]})]})]})}function tO({title:e,count:s,tasks:r,statusColor:a,selectedTask:n,setSelectedTask:o}){return(0,t.jsxs)("div",{className:"flex-1 min-w-[250px] flex flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3 px-1",children:[(0,t.jsx)("div",{className:`size-2 rounded-full bg-${a}`}),(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground uppercase",children:e}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground/60 bg-muted px-1.5 py-0.5 rounded",children:s})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"space-y-2 pr-1",children:r.map(e=>(0,t.jsxs)("button",{onClick:()=>o(e),className:`w-full text-left p-3 rounded-lg border transition-colors ${n?.id===e.id?"bg-accent border-ring":"bg-card border-border hover:bg-accent/50"}`,children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-1",children:(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground font-mono",children:["#",e.id]})}),(0,t.jsx)("p",{className:"text-sm text-foreground line-clamp-2 mb-1",children:e.subject}),"in_progress"===e.status&&e.activeForm&&(0,t.jsx)("p",{className:"text-xs text-chart-4 italic truncate",children:e.activeForm}),e.blockedBy.length>0&&(0,t.jsx)("div",{className:"flex items-center gap-1 mt-1.5",children:(0,t.jsxs)("span",{className:"text-[10px] text-chart-3",children:["Blocked by #",e.blockedBy[0],e.blockedBy.length>1?` +${e.blockedBy.length-1}`:""]})})]},e.id))})})]})}let tP=l("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),tI=l("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),t_=l("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),tU=l("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]),tW=l("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),tF=l("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),tH=l("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]),tq=l("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),tB=l("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),tK=l("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);function tV({label:e,passed:s}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-[10px] font-semibold ${s?"bg-chart-2/15 text-chart-2":"bg-chart-5/15 text-chart-5"}`,children:[s?(0,t.jsx)(C,{className:"size-2.5"}):(0,t.jsx)(tK,{className:"size-2.5"}),e]})}function tG({events:e}){return 0===e.length?(0,t.jsx)("div",{className:"py-8",children:(0,t.jsx)(tN,{lines:["No quality checks logged yet",'Add "quality": {"lint": true} to meta',"Track lint, typecheck, and test results","Results appear here per task"]})}):(0,t.jsx)("div",{className:"space-y-2",children:e.map(e=>{let s=e.checks,r=Object.values(s).every(Boolean),a=Object.values(s).some(e=>!1===e);return(0,t.jsx)("div",{className:`p-3 rounded-lg border transition-colors ${a?"bg-chart-5/5 border-chart-5/20":r?"bg-chart-2/5 border-chart-2/20":"bg-card border-border"}`,children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-0.5 shrink-0",children:a?(0,t.jsx)(tK,{className:"size-3.5 text-chart-5"}):(0,t.jsx)(C,{className:"size-3.5 text-chart-2"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,t.jsx)(g,{className:"size-3 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"text-xs font-mono text-foreground truncate",children:e.file}),e.taskId&&(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:["(",e.taskId,")"]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5 mb-1.5",children:[void 0!==s.lint&&(0,t.jsx)(tV,{label:"lint",passed:s.lint}),void 0!==s.typecheck&&(0,t.jsx)(tV,{label:"typecheck",passed:s.typecheck}),void 0!==s.test&&(0,t.jsx)(tV,{label:"test",passed:s.test})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 text-[10px] text-muted-foreground/50",children:[(0,t.jsx)(tF,{className:"size-2.5"}),(0,t.jsxs)("span",{children:[function(e){try{return new Date(e).toLocaleDateString([],{month:"short",day:"numeric"})}catch{return""}}(e.timestamp)," ",function(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return e}}(e.timestamp)]})]})]})]})},`${e.timestamp}-${e.file}`)})})}let tY=[{status:"READY",label:"Ready",colorClass:"text-chart-1 border-chart-1/30 bg-chart-1/5"},{status:"IN_PROGRESS",label:"In Progress",colorClass:"text-chart-4 border-chart-4/30 bg-chart-4/5"},{status:"DONE",label:"Done",colorClass:"text-chart-2 border-chart-2/30 bg-chart-2/5"},{status:"BLOCKED",label:"Blocked",colorClass:"text-chart-3 border-chart-3/30 bg-chart-3/5"}];function tX({task:e,selected:s,onClick:r}){return(0,t.jsxs)("button",{onClick:r,className:`w-full text-left p-3 rounded-lg border transition-colors ${s?"bg-accent border-ring":"bg-card border-border hover:bg-accent/50"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-muted-foreground",children:e.id}),"string"==typeof e.lastEvent?.meta?.commit&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-chart-4/70 font-mono",children:[(0,t.jsx)(S,{className:"size-2.5"}),e.lastEvent.meta.commit.slice(0,7)]})]}),(0,t.jsx)("p",{className:"text-xs text-foreground line-clamp-2",children:e.description}),(0,t.jsx)("span",{className:"mt-1.5 inline-block text-[10px] text-muted-foreground/60",children:e.area})]})}function tQ({tasks:e,selectedTaskId:s,onSelectTask:r}){return(0,t.jsx)("div",{className:"flex-1 flex gap-3 p-3 overflow-x-auto overflow-y-hidden min-w-0",children:tY.map(({status:a,label:n,colorClass:o})=>{let l=e.filter(e=>e.status===a);return(0,t.jsxs)("div",{className:`flex flex-col rounded-lg border ${o} min-w-[200px] flex-1`,children:[(0,t.jsxs)("div",{className:`px-3 py-2 flex items-center justify-between border-b ${o} rounded-t-lg`,children:[(0,t.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wide",children:n}),(0,t.jsx)("span",{className:"text-xs opacity-60",children:l.length})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-2 space-y-2",children:0===l.length?(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground/40 text-center py-4",children:"Empty"}):l.map(e=>(0,t.jsx)(tX,{task:e,selected:s===e.id,onClick:()=>r(e)},e.id))})})]},a)})})}function tJ({task:e,snapshot:r,qualityEvents:a,onUpdateStatus:n,onClose:o,actionToast:l,onDismissToast:i}){let[d,c]=(0,s.useState)(!1),m=e=>r?.tasks.filter(t=>t.dependsOn.includes(e))??[];return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"px-4 py-3 border-b border-border bg-sidebar/50 shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-muted-foreground flex-1",children:e.id}),(0,t.jsx)("span",{className:`text-[11px] px-2 py-0.5 rounded font-semibold ${tR(e.status)}`,children:e.status}),(0,t.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(e.id),c(!0),setTimeout(()=>c(!1),2e3)},className:"p-1 rounded hover:bg-accent transition-colors",title:"Copy task ID",children:d?(0,t.jsx)(tz,{className:"size-3 text-chart-2"}):(0,t.jsx)(tS,{className:"size-3 text-muted-foreground"})}),(0,t.jsx)("button",{onClick:o,className:"p-1 rounded hover:bg-accent transition-colors",title:"Clear selection",children:(0,t.jsx)(v,{className:"size-3 text-muted-foreground"})})]}),("READY"===e.status||"BLOCKED"===e.status)&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("button",{onClick:()=>n(e.id,"DONE"),className:"flex-1 flex items-center justify-center gap-1.5 px-2 py-1 rounded bg-chart-2/10 text-chart-2 hover:bg-chart-2/20 transition-colors text-xs font-medium border border-chart-2/20",children:[(0,t.jsx)(tz,{className:"size-3"}),"Mark Done"]}),(0,t.jsxs)("button",{onClick:()=>n(e.id,"BLOCKED"),className:"flex-1 flex items-center justify-center gap-1.5 px-2 py-1 rounded bg-chart-3/10 text-chart-3 hover:bg-chart-3/20 transition-colors text-xs font-medium border border-chart-3/20",children:[(0,t.jsx)(w,{className:"size-3"}),"Block"]})]}),l&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2 text-[11px] text-chart-2 bg-chart-2/10 rounded px-2 py-1",children:[(0,t.jsx)(tz,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"flex-1",children:l}),(0,t.jsx)("button",{onClick:i,className:"text-chart-2/60 hover:text-chart-2",children:"×"})]})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsxs)("div",{className:"p-4 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Description"}),(0,t.jsx)("p",{className:"text-sm text-foreground/90 leading-relaxed",children:e.description})]}),e.acceptanceCriteria&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Acceptance Criteria"}),(0,t.jsx)("p",{className:"text-xs text-foreground/80 leading-relaxed bg-muted/40 rounded p-2",children:e.acceptanceCriteria})]}),(0,t.jsx)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:(0,t.jsxs)("span",{children:["Area: ",(0,t.jsx)("span",{className:"text-foreground",children:e.area})]})}),e.dependsOn.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Dependencies"}),(0,t.jsx)("div",{className:"space-y-1",children:e.dependsOn.map(e=>{let s=r?.tasks.find(t=>t.id===e);return(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 rounded bg-card border border-border",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-foreground",children:e}),s&&(0,t.jsx)("span",{className:`text-[11px] px-1.5 py-0.5 rounded font-semibold ${tR(s.status)}`,children:s.status})]},e)})})]}),m(e.id).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Blocks"}),(0,t.jsx)("div",{className:"space-y-1",children:m(e.id).map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between p-2 rounded bg-card border border-border",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-foreground",children:e.id}),(0,t.jsx)("span",{className:`text-[11px] px-1.5 py-0.5 rounded font-semibold ${tR(e.status)}`,children:e.status})]},e.id))})]}),e.lastEvent&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Last Execution"}),(0,t.jsxs)("div",{className:"bg-card rounded-lg p-3 space-y-2 text-sm border border-border",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-foreground",children:e.lastEvent.agent}),(0,t.jsx)("span",{className:`px-1.5 py-0.5 rounded text-[11px] font-semibold ${tR(e.lastEvent.status)}`,children:e.lastEvent.status})]}),(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:new Date(e.lastEvent.timestamp).toLocaleString()})]}),e.lastEvent.reason&&(0,t.jsx)("div",{className:"text-xs text-chart-3 bg-chart-3/10 p-2 rounded",children:e.lastEvent.reason}),e.lastEvent.meta?.duration!=null&&(0,t.jsxs)("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(tF,{className:"size-3"}),String(e.lastEvent.meta.duration),"s"]}),null!=e.lastEvent.meta.stepCount&&(0,t.jsxs)("span",{children:[String(e.lastEvent.meta.stepCount)," steps"]})]}),"string"==typeof e.lastEvent.meta?.commit&&(0,t.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 bg-background rounded",children:[(0,t.jsx)(S,{className:"size-3 text-chart-4 shrink-0"}),(0,t.jsx)("code",{className:"text-xs text-chart-4 font-mono",children:String(e.lastEvent.meta.commit).slice(0,7)}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:String(e.lastEvent.meta.commitMsg||"")})]}),Array.isArray(e.lastEvent.meta?.steps)&&(0,t.jsx)("div",{className:"pt-2 border-t border-border space-y-1",children:e.lastEvent.meta.steps.map(e=>(0,t.jsxs)("div",{className:"flex items-start gap-2 py-1 px-1.5 rounded hover:bg-background/50",children:[(0,t.jsxs)("div",{className:"mt-0.5",children:["thought"===e.type&&(0,t.jsx)(t_,{className:"size-3 text-chart-4"}),"tool_call"===e.type&&(0,t.jsx)(tU,{className:"size-3 text-chart-1"}),"observation"===e.type&&(0,t.jsx)(tW,{className:"size-3 text-chart-2"}),"error"===e.type&&(0,t.jsx)(w,{className:"size-3 text-chart-5"})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-foreground truncate",children:e.name}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground/60 shrink-0",children:[e.duration,"ms"]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/80 truncate",children:e.summary})]})]},`${e.type}-${e.name}`))}),e.lastEvent.meta&&!Array.isArray(e.lastEvent.meta.steps)&&(0,t.jsx)("div",{className:"pt-2 border-t border-border",children:(0,t.jsx)("pre",{className:"text-xs text-muted-foreground bg-background p-2 rounded overflow-auto",children:JSON.stringify(e.lastEvent.meta,null,2)})})]})]}),a.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Quality Checks"}),(0,t.jsx)(tG,{events:a})]})]})})]})}function tZ({searchQuery:e,sidebarCollapsed:r}){let{data:a,refresh:n}=function(){let[e,t]=(0,s.useState)(null),r=(0,s.useCallback)(async()=>{try{let e=await fetch("/snapshot");if(!e.ok)return;let s=await e.json();t(s)}catch{}},[]);return(0,s.useEffect)(()=>{r();let e=new EventSource("/events/");return e.onmessage=e=>{try{let t=JSON.parse(e.data);"plan"===t.type&&r()}catch{}},()=>e.close()},[r]),{data:e,refresh:r}}(),[o,l]=(0,s.useState)(null),[i,d]=(0,s.useState)(new Set),[c,m]=(0,s.useState)([]),[u,x]=(0,s.useState)(null),[h,p]=(0,s.useState)(!1),[f,g]=(0,s.useState)(""),[b,j]=(0,s.useState)(""),[y,N]=(0,s.useState)(""),[k,w]=(0,s.useState)(""),[C,z]=(0,s.useState)(!1),[T,E]=(0,s.useState)(()=>localStorage.getItem("plan-view-mode")??"list");(0,s.useEffect)(()=>{localStorage.setItem("plan-view-mode",T)},[T]);let M=async()=>{if(f.trim()){z(!0);try{let e={description:f.trim()};b.trim()&&(e.slice=b.trim()),y.trim()&&(e.area=y.trim()),k.trim()&&(e.ac=k.trim()),(await fetch("/plan/task",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(g(""),j(""),N(""),w(""),p(!1),n())}catch{}finally{z(!1)}}},$=async(e,t)=>{try{(await fetch(`/plan/task/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:t})})).ok&&(x(`Task ${e} marked ${t}`),setTimeout(()=>x(null),5e3),n())}catch{}};if((0,s.useEffect)(()=>{a?.snapshot&&d(e=>e.size>0?e:new Set(Object.keys(a.snapshot.slices)))},[a]),(0,s.useEffect)(()=>{if(!o)return void m([]);let e=new AbortController;return fetch(`/quality-timeline?taskId=${encodeURIComponent(o.id)}`,{signal:e.signal}).then(e=>e.ok?e.json():{events:[]}).then(e=>m(e.events??[])).catch(()=>m([])),()=>e.abort()},[o?.id]),!a||!a.snapshot)return(0,t.jsx)("div",{className:"flex-1 p-8",children:(0,t.jsx)("div",{className:"max-w-4xl mx-auto",children:(0,t.jsxs)("div",{className:"bg-destructive/10 border border-destructive rounded-lg p-6",children:[(0,t.jsx)("h2",{className:"text-xl font-bold text-destructive-foreground mb-4",children:a?.queueErrors?.length?"Queue Parse Errors":"Plan Mode Not Available"}),(0,t.jsx)("div",{className:"space-y-2",children:a?.queueErrors?.map(e=>(0,t.jsx)("div",{className:"text-destructive-foreground text-sm",children:e},e))||(0,t.jsx)("div",{className:"text-muted-foreground text-sm",children:'Run "claudedash init" to set up Plan mode'})})]})})});let D=a.snapshot,A=D.tasks.filter(t=>t.description.toLowerCase().includes(e.toLowerCase())||t.id.toLowerCase().includes(e.toLowerCase())),R=A.reduce((e,t)=>(e[t.slice]||(e[t.slice]=[]),e[t.slice].push(t),e),{});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:`bg-sidebar border-r border-sidebar-border flex flex-col overflow-hidden transition-all duration-300 ${r?"w-0 min-w-0 border-r-0":"w-72 min-w-[280px]"}`,children:[(0,t.jsxs)("div",{className:"px-3 py-2 border-b border-sidebar-border shrink-0 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:"Tasks"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] flex-1",children:[(0,t.jsxs)("span",{className:"text-muted-foreground/50",children:[D.summary.total,"T"]}),(0,t.jsxs)("span",{className:"text-chart-2 font-medium",children:[D.summary.done,"✓"]}),D.summary.failed>0&&(0,t.jsxs)("span",{className:"text-chart-5 font-medium",children:[D.summary.failed,"✗"]}),D.summary.blocked>0&&(0,t.jsxs)("span",{className:"text-chart-3 font-medium",children:[D.summary.blocked,"⊘"]}),(0,t.jsxs)("span",{className:"text-chart-1 font-medium",children:[D.summary.ready,"→"]})]}),(0,t.jsxs)("div",{className:"flex items-center bg-muted rounded p-0.5 gap-0.5",children:[(0,t.jsx)("button",{onClick:()=>E("list"),title:"List view",className:`p-1 rounded transition-colors ${"list"===T?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:(0,t.jsx)(tH,{className:"size-3"})}),(0,t.jsx)("button",{onClick:()=>E("kanban"),title:"Kanban view",className:`p-1 rounded transition-colors ${"kanban"===T?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:(0,t.jsx)(tq,{className:"size-3"})})]})]}),(0,t.jsx)("div",{className:"px-3 py-2 border-b border-sidebar-border shrink-0",children:h?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("textarea",{autoFocus:!0,value:f,onChange:e=>g(e.target.value),onKeyDown:e=>{"Escape"===e.key&&(p(!1),g(""),j(""),N(""),w(""))},placeholder:"Description (required)...",rows:2,className:"w-full bg-background border border-border rounded px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground focus:outline-none focus:border-ring resize-none"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("select",{value:b,onChange:e=>j(e.target.value),className:"flex-1 bg-background border border-border rounded px-2 py-1.5 text-xs text-foreground focus:outline-none focus:border-ring",children:[(0,t.jsx)("option",{value:"",children:"Slice (last)"}),Object.keys(D.slices).map(e=>(0,t.jsx)("option",{value:e,children:e},e))]}),(0,t.jsx)("input",{type:"text",value:y,onChange:e=>N(e.target.value),placeholder:"Area",className:"flex-1 bg-background border border-border rounded px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground focus:outline-none focus:border-ring"})]}),(0,t.jsx)("input",{type:"text",value:k,onChange:e=>w(e.target.value),placeholder:"Acceptance criteria (optional)",className:"w-full bg-background border border-border rounded px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground focus:outline-none focus:border-ring"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("button",{onClick:()=>void M(),disabled:!f.trim()||C,className:"flex-1 text-xs py-1 rounded bg-chart-2/10 text-chart-2 border border-chart-2/20 hover:bg-chart-2/20 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:C?"Adding…":"Add task"}),(0,t.jsx)("button",{onClick:()=>{p(!1),g(""),j(""),N(""),w("")},className:"text-xs py-1 px-2 rounded text-muted-foreground hover:text-foreground transition-colors",children:(0,t.jsx)(v,{className:"size-3"})})]})]}):(0,t.jsxs)("button",{onClick:()=>p(!0),className:"w-full flex items-center justify-center gap-1.5 text-xs text-muted-foreground hover:text-foreground py-1.5 border border-dashed border-border rounded hover:border-ring transition-colors",children:[(0,t.jsx)(tB,{className:"size-3"}),"Add task"]})}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-3 space-y-3",children:Object.entries(R).map(([e,s])=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("button",{onClick:()=>{d(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},className:"w-full flex items-center justify-between px-2 py-1.5 bg-muted rounded text-xs font-semibold text-muted-foreground hover:bg-muted/80 transition-colors",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[i.has(e)?(0,t.jsx)(tI,{className:"size-3.5"}):(0,t.jsx)(tP,{className:"size-3.5"}),(0,t.jsxs)("span",{children:[e," • ",s.length," tasks"]})]}),(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:[s.filter(e=>"DONE"===e.status).length,"/",s.length]})]}),i.has(e)&&s.map(e=>(0,t.jsxs)("button",{onClick:()=>l(e),className:`w-full text-left p-3 rounded-lg border transition-colors ${o?.id===e.id?"bg-accent border-ring":"bg-card border-border hover:bg-accent/50"}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,t.jsx)("span",{className:"text-sm font-mono text-foreground",children:e.id}),(0,t.jsx)("span",{className:`text-xs px-2 py-0.5 rounded font-semibold ${tR(e.status)}`,children:e.status})]}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground line-clamp-2",children:e.description}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground/60",children:e.area}),"string"==typeof e.lastEvent?.meta?.commit&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-chart-4/70 font-mono",children:[(0,t.jsx)(S,{className:"size-2.5"}),String(e.lastEvent.meta.commit).slice(0,7)]})]})]},e.id))]},e))})})]}),"kanban"===T&&(0,t.jsx)(tQ,{tasks:A,selectedTaskId:o?.id,onSelectTask:l}),(0,t.jsx)("div",{className:`border-l border-border flex flex-col overflow-hidden ${"kanban"===T?"w-[380px] min-w-[380px] shrink-0":"flex-1"}`,children:o?(0,t.jsx)(tJ,{task:o,snapshot:D,qualityEvents:c,onUpdateStatus:$,onClose:()=>l(null),actionToast:u,onDismissToast:()=>x(null)}):(0,t.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-muted-foreground/40",children:[(0,t.jsx)(tq,{className:"size-8 opacity-20"}),(0,t.jsx)("p",{className:"text-xs",children:"Select a task to view details"})]})})]})}let t0=`
5
- *, *::before, *::after { box-sizing: border-box; }
6
- html { color-scheme: dark; }
7
- body {
8
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
9
- background: #18181b;
10
- color: #e4e4e7;
11
- margin: 0 auto;
12
- padding: 2rem 2.5rem;
13
- line-height: 1.7;
14
- font-size: 14px;
15
- max-width: 920px;
16
- }
17
- h1 { font-size: 1.5rem; font-weight: 700; color: #fafafa; margin: 0 0 0.5rem; line-height: 1.3; }
18
- h2 { font-size: 1.125rem; font-weight: 600; color: #fafafa; margin: 2rem 0 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid #3f3f46; }
19
- h3 { font-size: 1rem; font-weight: 600; color: #e4e4e7; margin: 1.5rem 0 0.5rem; }
20
- h4, h5, h6 { font-size: 0.75rem; font-weight: 600; color: #a1a1aa; text-transform: uppercase; letter-spacing: 0.05em; margin: 1rem 0 0.25rem; }
21
- p { margin: 0.5rem 0; }
22
- a { color: #818cf8; text-decoration: none; }
23
- a:hover { color: #a5b4fc; text-decoration: underline; }
24
- strong, b { color: #fafafa; font-weight: 600; }
25
- em, i { color: #d4d4d8; }
26
- code {
27
- font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
28
- background: #27272a;
29
- padding: 0.15em 0.4em;
30
- border-radius: 3px;
31
- font-size: 0.85em;
32
- color: #e4e4e7;
33
- }
34
- pre {
35
- background: #27272a;
36
- border: 1px solid #3f3f46;
37
- border-radius: 6px;
38
- padding: 1rem 1.25rem;
39
- overflow-x: auto;
40
- margin: 1rem 0;
41
- }
42
- pre code { background: none; padding: 0; }
43
- ul, ol { padding-left: 1.5rem; margin: 0.5rem 0; }
44
- li { margin: 0.3rem 0; }
45
- hr { border: none; border-top: 1px solid #3f3f46; margin: 2rem 0; }
46
- blockquote {
47
- border-left: 3px solid #818cf8;
48
- margin: 1rem 0;
49
- padding: 0.5rem 1rem;
50
- color: #a1a1aa;
51
- background: #27272a;
52
- border-radius: 0 4px 4px 0;
53
- }
54
- table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.875rem; }
55
- th {
56
- text-align: left;
57
- padding: 0.5rem 0.75rem;
58
- border-bottom: 1px solid #52525b;
59
- color: #a1a1aa;
60
- font-weight: 600;
61
- font-size: 0.75rem;
62
- text-transform: uppercase;
63
- letter-spacing: 0.05em;
64
- }
65
- td { padding: 0.5rem 0.75rem; border-bottom: 1px solid #3f3f46; }
66
- tr:last-child td { border-bottom: none; }
67
- tr:hover td { background: #27272a; }
68
- img { max-width: 100%; border-radius: 6px; }
69
- `;function t1(){let[e,r]=(0,s.useState)(null),[a,n]=(0,s.useState)(!1),[o,l]=(0,s.useState)(!0),i=()=>{l(!0),n(!1),r(null),fetch("/claude-insights").then(e=>{if(!e.ok)return n(!0),null;let t=e.headers.get("content-type");return t?.includes("application/json")?(n(!0),null):e.text()}).then(e=>{let t;e&&r((t=`<style>${t0}</style>`,e.includes("</head>")?e.replace("</head>",`${t}</head>`):e.includes("<body")?e.replace("<body",`${t}<body`):t+e))}).catch(()=>n(!0)).finally(()=>l(!1))};return((0,s.useEffect)(()=>{i()},[]),o)?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)(x,{className:"size-10 mx-auto mb-3 text-muted-foreground animate-pulse"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Loading insights..."})]})}):(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"px-4 py-2 border-b border-border bg-sidebar/30 flex items-center justify-between shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(x,{className:"size-4 text-chart-3"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Claude Code Insights"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Usage analytics from /insight command"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("button",{onClick:i,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1",title:"Refresh report",children:[(0,t.jsx)(d,{className:"size-3"}),"Refresh"]}),(0,t.jsx)("a",{href:"/claude-insights",target:"_blank",rel:"noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Open in new tab →"})]})]}),a?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center p-8",children:(0,t.jsxs)("div",{className:"max-w-lg w-full",children:[(0,t.jsx)(x,{className:"size-12 mx-auto mb-5 text-muted-foreground"}),(0,t.jsx)(tN,{lines:["Unlock deep insights into your Claude Code usage...","Discover what's working, what's slowing you down...","See your most-used tools, friction points, and wins...","Get personalized CLAUDE.md suggestions...","Open Claude Code and run: /insight"]}),(0,t.jsxs)("div",{className:"mt-6 bg-muted/50 border border-border rounded-lg p-5",children:[(0,t.jsxs)("h3",{className:"text-sm font-semibold mb-3 flex items-center gap-2",children:[(0,t.jsx)(t_,{className:"size-4"}),"How to generate your report:"]}),(0,t.jsxs)("ol",{className:"text-xs text-muted-foreground space-y-2 list-decimal list-inside",children:[(0,t.jsx)("li",{children:"Open a Claude Code session in your terminal"}),(0,t.jsxs)("li",{children:["Type"," ",(0,t.jsx)("code",{className:"bg-background px-1.5 py-0.5 rounded font-mono text-foreground",children:"/insight"})," ","and press Enter"]}),(0,t.jsx)("li",{children:"Wait 10–30 seconds while Claude analyzes your usage"}),(0,t.jsxs)("li",{children:["Click"," ",(0,t.jsxs)("button",{onClick:i,className:"inline-flex items-center gap-1 text-primary hover:underline",children:[(0,t.jsx)(d,{className:"size-3"}),"Refresh"]})," ","above to view your report"]})]})]})]})}):(0,t.jsx)("iframe",{srcDoc:e??"",sandbox:"allow-scripts allow-same-origin",className:"flex-1 w-full border-0 bg-[#18181b]",title:"Claude Code Insights Report"})]})}let t2=l("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),t5=l("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),t3=l("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]),t4=l("award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]),t6=l("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);function t8(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function t7(e){return e.includes("opus-4-6")?"Opus 4.6":e.includes("sonnet-4-6")?"Sonnet 4.6":e.includes("haiku-4-5")?"Haiku 4.5":e.includes("opus-4-5")?"Opus 4.5":e.includes("sonnet-4-5")?"Sonnet 4.5":e.includes("3-5-sonnet")?"Sonnet 3.5":e.includes("3-5-haiku")?"Haiku 3.5":e.split("-").slice(0,3).join(" ")}function t9(e){return e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function se({label:e,value:s,sub:r,colorClass:a}){return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-4",children:[(0,t.jsx)("div",{className:`text-2xl font-bold ${a??"text-foreground"}`,children:s}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:e}),r&&(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground/60 mt-0.5",children:r})]})}function st({data:e}){if(0===e.length)return null;let s=Math.max(...e.map(e=>e.messageCount),1);return(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Last 7 Days — Messages"}),(0,t.jsx)("div",{className:"flex items-end gap-1.5 h-24",children:e.map(e=>{let r=e.messageCount/s*100,a=new Date(e.date).toLocaleDateString("en",{weekday:"short"});return(0,t.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-1 group relative",children:[(0,t.jsxs)("div",{className:"absolute bottom-full mb-1 left-1/2 -translate-x-1/2 bg-popover border border-border text-[10px] text-foreground px-2 py-1 rounded whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity z-10 pointer-events-none",children:[e.date,": ",t8(e.messageCount)," msgs · ",e.sessionCount," sessions"]}),(0,t.jsx)("div",{className:"w-full rounded-sm bg-chart-1/70 hover:bg-chart-1 transition-colors min-h-[2px]",style:{height:`${Math.max(r,2)}%`}}),(0,t.jsx)("span",{className:"text-[9px] text-muted-foreground/60",children:a})]},e.date)})})]})}function ss({hourCounts:e}){let s=Math.max(...Object.values(e),1),r=Array.from({length:24},(e,t)=>t);return(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Peak Hours"}),(0,t.jsx)("div",{className:"flex gap-0.5",children:r.map(r=>{let a=e[String(r)]??0,n=a/s;return(0,t.jsxs)("div",{className:"relative group flex-1",children:[(0,t.jsx)("div",{className:"h-6 rounded-sm bg-chart-2",style:{opacity:n<.1?.06:n<.3?.2:n<.6?.5:.85}}),(0,t.jsxs)("div",{className:"absolute bottom-full mb-1 left-1/2 -translate-x-1/2 bg-popover border border-border text-[10px] text-foreground px-1.5 py-0.5 rounded whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity z-10 pointer-events-none",children:[r,":00 · ",a]})]},r)})}),(0,t.jsxs)("div",{className:"flex justify-between text-[9px] text-muted-foreground/40 mt-1",children:[(0,t.jsx)("span",{children:"00:00"}),(0,t.jsx)("span",{children:"06:00"}),(0,t.jsx)("span",{children:"12:00"}),(0,t.jsx)("span",{children:"18:00"}),(0,t.jsx)("span",{children:"23:00"})]})]})}function sr({modelUsage:e}){let s=Object.entries(e);return 0===s.length?null:(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Model Usage"}),(0,t.jsx)("div",{className:"space-y-2",children:s.map(([e,s])=>{let r=s.inputTokens+s.outputTokens+s.cacheReadInputTokens;return(0,t.jsxs)("div",{className:"bg-sidebar/50 border border-border rounded-lg px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:t7(e)}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[t8(r)," total tokens"]})]}),(0,t.jsxs)("div",{className:"flex gap-4 text-[11px]",children:[(0,t.jsxs)("span",{className:"text-chart-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"In "}),t8(s.inputTokens)]}),(0,t.jsxs)("span",{className:"text-chart-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Out "}),t8(s.outputTokens)]}),(0,t.jsxs)("span",{className:"text-chart-4",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Cache "}),t8(s.cacheReadInputTokens)]})]})]},e)})})]})}function sa({s:e}){let[r,a]=(0,s.useState)(!1),n=Object.entries(e.languages).sort((e,t)=>t[1]-e[1]).slice(0,3).map(([e])=>e),o=Object.entries(e.toolCounts).sort((e,t)=>t[1]-e[1]).slice(0,3);return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,t.jsxs)("button",{onClick:()=>a(e=>!e),className:"w-full text-left px-4 py-3 hover:bg-accent/40 transition-colors flex items-start gap-3",children:[r?(0,t.jsx)(tI,{className:"size-3.5 text-muted-foreground mt-0.5 shrink-0"}):(0,t.jsx)(tP,{className:"size-3.5 text-muted-foreground mt-0.5 shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground truncate",children:e.projectName??e.sessionId.slice(0,8)}),n.length>0&&(0,t.jsx)("div",{className:"flex gap-1",children:n.map(e=>(0,t.jsx)("span",{className:"text-[10px] bg-muted text-muted-foreground px-1.5 py-0.5 rounded",children:e},e))})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 text-[11px] text-muted-foreground",children:[e.startTime&&(0,t.jsx)("span",{children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}(e.startTime)}),e.durationMinutes&&(0,t.jsxs)("span",{children:[(0,t.jsx)(tF,{className:"size-3 inline mr-0.5"}),e.durationMinutes,"m"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)(t5,{className:"size-3 inline mr-0.5"}),e.userMessageCount," msgs"]}),e.gitCommits>0&&(0,t.jsxs)("span",{className:"text-chart-2",children:[(0,t.jsx)(S,{className:"size-3 inline mr-0.5"}),e.gitCommits," commits"]}),e.linesAdded>0&&(0,t.jsxs)("span",{className:"text-chart-1",children:["+",t8(e.linesAdded)," lines"]})]})]})]}),r&&(0,t.jsxs)("div",{className:"border-t border-border px-4 py-3 bg-sidebar/30 space-y-3",children:[e.firstPrompt&&(0,t.jsxs)("p",{className:"text-[11px] text-muted-foreground/80 italic line-clamp-2",children:["“",e.firstPrompt.slice(0,200),e.firstPrompt.length>200?"…":"","”"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-4 text-[11px]",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Tokens in/out: "}),t8(e.inputTokens)," / ",t8(e.outputTokens)]}),(e.filesModified??0)>0&&(0,t.jsxs)("span",{children:[e.filesModified," files modified"]}),(e.linesRemoved??0)>0&&(0,t.jsxs)("span",{className:"text-chart-5",children:["-",t8(e.linesRemoved)," lines"]}),e.toolErrors>0&&(0,t.jsxs)("span",{className:"text-chart-5",children:[e.toolErrors," tool errors"]}),(e.userInterruptions??0)>0&&(0,t.jsxs)("span",{className:(e.userInterruptions??0)>3?"text-chart-3 font-medium":"text-muted-foreground",children:[e.userInterruptions," interruption",(e.userInterruptions??0)!==1?"s":"",(e.userInterruptions??0)>3?" ⚠":""]}),e.usesTaskAgent&&(0,t.jsx)("span",{className:"text-chart-2",children:"Task Agent"}),e.usesMcp&&(0,t.jsx)("span",{className:"text-chart-4",children:"MCP"}),e.usesWebSearch&&(0,t.jsx)("span",{className:"text-chart-4",children:"Web Search"}),e.durationMinutes&&e.linesAdded>0&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:[Math.round(e.linesAdded/e.durationMinutes)," lines/min"]})]}),o.length>0&&(0,t.jsx)("div",{className:"flex gap-2 flex-wrap",children:o.map(([e,s])=>(0,t.jsxs)("span",{className:"text-[10px] bg-muted text-muted-foreground px-2 py-0.5 rounded",children:[e,": ",String(s)]},e))})]})]})}function sn({label:e,value:s,max:r,colorClass:a,sub:n}){let o=r>0?s/r*100:0;return(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground w-36 shrink-0 truncate",children:e}),(0,t.jsx)("div",{className:"flex-1 bg-muted rounded-full h-1.5 relative",children:(0,t.jsx)("div",{className:`${a} h-1.5 rounded-full transition-all`,style:{width:`${o}%`}})}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground w-8 text-right shrink-0",children:s}),n&&(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/60 w-16 shrink-0",children:n})]})}function so({s:e}){var r,a;let[n,o]=(0,s.useState)(!1);return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,t.jsxs)("button",{onClick:()=>o(e=>!e),className:"w-full text-left px-4 py-3 hover:bg-accent/40 transition-colors flex items-start gap-3",children:[n?(0,t.jsx)(tI,{className:"size-3.5 text-muted-foreground mt-0.5 shrink-0"}):(0,t.jsx)(tP,{className:"size-3.5 text-muted-foreground mt-0.5 shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsx)("span",{className:`text-[10px] font-medium px-2 py-0.5 rounded-full border ${"fully_achieved"===e.outcome?"border-chart-2/40 text-chart-2 bg-chart-2/10":"mostly_achieved"===e.outcome?"border-chart-1/40 text-chart-1 bg-chart-1/10":"partially_achieved"===e.outcome?"border-chart-3/40 text-chart-3 bg-chart-3/10":"border-chart-5/40 text-chart-5 bg-chart-5/10"}`,children:t9(e.outcome)}),(0,t.jsx)("span",{className:`text-[10px] ${"essential"===(r=e.helpfulness)?"text-chart-2":"very_helpful"===r?"text-chart-1":"moderately_helpful"===r?"text-chart-3":"text-chart-5"}`,children:"essential"===(a=e.helpfulness)?"Essential":"very_helpful"===a?"Very Helpful":"moderately_helpful"===a?"Moderate":a.replace(/_/g," ")}),e.sessionType&&(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/50",children:e.sessionType.replace(/_/g," ")})]}),e.goal&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:e.goal})]})]}),n&&(0,t.jsxs)("div",{className:"border-t border-border px-4 py-3 bg-sidebar/30 space-y-2",children:[e.briefSummary&&(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground/80",children:e.briefSummary}),e.frictionDetail&&(0,t.jsxs)("p",{className:"text-[11px] text-chart-3/80 italic",children:["⚠ ",e.frictionDetail.slice(0,200),e.frictionDetail.length>200?"…":""]}),Object.keys(e.frictionCounts).length>0&&(0,t.jsx)("div",{className:"flex gap-2 flex-wrap",children:Object.entries(e.frictionCounts).map(([e,s])=>(0,t.jsxs)("span",{className:"text-[10px] bg-chart-5/10 text-chart-5 px-2 py-0.5 rounded",children:[e.replace(/_/g," "),": ",s]},e))}),e.satisfiedCount>0||e.dissatisfiedCount>0?(0,t.jsxs)("div",{className:"text-[11px] text-muted-foreground",children:["Satisfaction: ",(0,t.jsxs)("span",{className:"text-chart-2",children:[e.satisfiedCount," ✓"]}),e.dissatisfiedCount>0&&(0,t.jsxs)("span",{className:"text-chart-5 ml-2",children:[e.dissatisfiedCount," ✗"]})]}):null]})]})}function sl({data:e}){let{aggregate:s,sessions:r}=e;if(!s||0===r.length)return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 text-center",children:[(0,t.jsx)(t4,{className:"size-8 mx-auto mb-2 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No session quality data yet"}),(0,t.jsxs)("p",{className:"text-[11px] text-muted-foreground/60 mt-1",children:["Generated from ",(0,t.jsx)("code",{className:"bg-muted px-1 rounded",children:"~/.claude/usage-data/facets/"})]})]});let a=Math.max(...Object.values(s.outcomeCounts),1),n=s.topFriction[0]?.count??1,o=["fully_achieved","mostly_achieved","partially_achieved","not_achieved","unclear_from_transcript"],l=[...o.filter(e=>s.outcomeCounts[e]).map(e=>[e,s.outcomeCounts[e]]),...Object.entries(s.outcomeCounts).filter(([e])=>!o.includes(e))];return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 space-y-3",children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Outcome Distribution"}),l.map(([e,s])=>(0,t.jsx)(sn,{label:t9(e),value:s,max:a,colorClass:"fully_achieved"===e?"bg-chart-2":"mostly_achieved"===e?"bg-chart-1":"partially_achieved"===e?"bg-chart-3":"bg-chart-5"},e)),null!==s.satisfactionRate&&(0,t.jsxs)("div",{className:"pt-2 border-t border-border text-[11px] text-muted-foreground",children:["User satisfaction rate: ",(0,t.jsxs)("span",{className:"text-chart-2 font-medium",children:[s.satisfactionRate,"%"]}),(0,t.jsxs)("span",{className:"ml-2 opacity-50",children:["(",s.satisfiedTotal," satisfied, ",s.dissatisfiedTotal," dissatisfied)"]})]})]}),(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 space-y-3",children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Top Friction Points"}),s.topFriction.slice(0,6).map(({type:e,count:s})=>(0,t.jsx)(sn,{label:e.replace(/_/g," "),value:s,max:n,colorClass:"bg-chart-5/60"},e)),0===s.topFriction.length&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"No friction events recorded"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:["Analyzed Sessions (",r.length,")"]}),(0,t.jsx)("div",{className:"space-y-2",children:r.map(e=>(0,t.jsx)(so,{s:e},e.sessionId))})]})]})}function si({data:e}){let{aggregate:r,sessions:a}=e,[n,o]=(0,s.useState)(null);if(!r||0===a.length)return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 text-center",children:[(0,t.jsx)(tU,{className:"size-8 mx-auto mb-2 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No conversation data found"}),(0,t.jsxs)("p",{className:"text-[11px] text-muted-foreground/60 mt-1",children:["Parses ",(0,t.jsx)("code",{className:"bg-muted px-1 rounded",children:"~/.claude/projects/"})," JSONL files"]})]});let l=r.topTools[0]?.count??1,i=["bg-chart-1","bg-chart-2","bg-chart-3","bg-chart-4","bg-chart-5"];return(0,t.jsx)("div",{className:"space-y-4",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 space-y-3",children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:"Top Tools (All Time)"}),r.topTools.map(({name:e,count:s},a)=>{let n=Math.round(s/r.totalToolCalls*100);return(0,t.jsx)(sn,{label:e,value:s,max:l,colorClass:i[a%i.length],sub:`${n}%`},e)}),(0,t.jsxs)("div",{className:"pt-2 border-t border-border text-[11px] text-muted-foreground",children:[t8(r.totalToolCalls)," total calls ·"," ",r.totalErrors," errors ·"," ",(0,t.jsxs)("span",{className:r.errorRate>5?"text-chart-5":"text-chart-2",children:[r.errorRate.toFixed(1),"% error rate"]})]})]}),(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5",children:[(0,t.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:["Recent Conversations (",a.length,")"]}),(0,t.jsx)("div",{className:"space-y-2",children:a.slice(0,8).map(e=>(0,t.jsxs)("div",{className:"rounded border border-border overflow-hidden",children:[(0,t.jsxs)("button",{onClick:()=>o(n===e.sessionId?null:e.sessionId),className:"w-full text-left px-3 py-2 hover:bg-accent/30 transition-colors flex items-center gap-2 text-[11px]",children:[n===e.sessionId?(0,t.jsx)(tI,{className:"size-3 text-muted-foreground shrink-0"}):(0,t.jsx)(tP,{className:"size-3 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"font-medium text-foreground truncate flex-1",children:e.projectName??e.sessionId.slice(0,8)}),(0,t.jsxs)("span",{className:"text-muted-foreground shrink-0",children:[e.messageCount," msgs"]}),e.errorCount>0&&(0,t.jsxs)("span",{className:"text-chart-5 shrink-0",children:[e.errorCount," err"]})]}),n===e.sessionId&&(0,t.jsxs)("div",{className:"border-t border-border px-3 py-2 bg-sidebar/30 text-[10px] space-y-1.5",children:[e.cwd&&(0,t.jsx)("div",{className:"text-muted-foreground/60 font-mono truncate",children:e.cwd}),(0,t.jsx)("div",{className:"flex gap-2 flex-wrap",children:e.topTools.map(({name:e,count:s})=>(0,t.jsxs)("span",{className:"bg-muted text-muted-foreground px-1.5 py-0.5 rounded",children:[e,": ",s]},e))}),(0,t.jsxs)("div",{className:"text-muted-foreground",children:["R:",e.fileOps.read," W:",e.fileOps.write," E:",e.fileOps.edit," file ops"]})]})]},e.sessionId))})]})]})})}function sd({data:e}){let s=e.perModel.filter(e=>null!==e.estimatedCostUSD);return 0===s.length?null:(0,t.jsxs)("div",{className:"bg-chart-4/5 border border-chart-4/20 rounded-lg p-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(t3,{className:"size-4 text-chart-4"}),(0,t.jsx)("h4",{className:"text-sm font-semibold text-foreground",children:"Estimated Cost"})]}),(0,t.jsxs)("div",{className:"text-xl font-bold text-chart-4",children:["~$",e.totalCostUSD.toFixed(2)]})]}),(0,t.jsx)("div",{className:"space-y-2 mb-3",children:s.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between text-[11px]",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:t7(e.model)}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:[t8(e.inputTokens+e.outputTokens)," tok"]}),(0,t.jsxs)("span",{className:"font-medium text-foreground",children:["$",(e.estimatedCostUSD??0).toFixed(2)]})]})]},e.model))}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground/50",children:e.disclaimer})]})}function sc({data:e}){if(!e.active||!e.tokensUsed)return null;let s=e.minutesElapsed??0,r=Math.min(s/300*100,100),a=r>90?"text-chart-5":r>70?"text-chart-3":"text-chart-2";return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(t2,{className:`size-3.5 ${a}`}),(0,t.jsx)("span",{className:"text-xs font-semibold text-foreground",children:"Current 5h Billing Block"})]}),(0,t.jsxs)("span",{className:`text-sm font-bold ${a}`,children:["~$",(e.estimatedCostUSD??0).toFixed(2)]})]}),(0,t.jsx)("div",{className:"bg-muted rounded-full h-1.5 mb-2",children:(0,t.jsx)("div",{className:`${r>90?"bg-chart-5":r>70?"bg-chart-3":"bg-chart-2"} h-1.5 rounded-full transition-all`,style:{width:`${r}%`}})}),(0,t.jsxs)("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground",children:[(0,t.jsxs)("span",{children:[s,"m elapsed"]}),(0,t.jsxs)("span",{children:[t8(e.tokensUsed??0)," tokens"]}),(0,t.jsxs)("span",{children:[e.minutesRemaining??0,"m remaining"]})]}),e.breakdown&&(0,t.jsxs)("div",{className:"flex gap-3 mt-2 text-[10px] text-muted-foreground/60",children:[(0,t.jsxs)("span",{children:["In: ",t8(e.breakdown.input)]}),(0,t.jsxs)("span",{children:["Out: ",t8(e.breakdown.output)]}),(0,t.jsxs)("span",{children:["Cache: ",t8(e.breakdown.cacheRead)]})]})]})}function sm({data:e}){let[r,a]=(0,s.useState)(""),[n,o]=(0,s.useState)(null),l=r?e.prompts.filter(e=>e.display.toLowerCase().includes(r.toLowerCase())||(e.projectName??"").toLowerCase().includes(r.toLowerCase())):e.prompts,i=e.topProjects[0]?.count??1;return(0,t.jsxs)("div",{className:"space-y-4",children:[e.topProjects.length>0&&(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 space-y-2",children:[(0,t.jsx)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Most Active Projects"}),e.topProjects.slice(0,5).map(({path:e,name:s,count:r})=>(0,t.jsx)(sn,{label:s,value:r,max:i,colorClass:"bg-chart-4",sub:`${r} prompts`},e))]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide",children:["Recent Prompts (",e.total,")"]}),(0,t.jsx)("input",{type:"text",placeholder:"Search prompts…",value:r,onChange:e=>a(e.target.value),className:"ml-auto bg-background border border-border rounded-lg px-3 py-1 text-xs text-foreground placeholder-muted-foreground focus:outline-none focus:border-ring w-48"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[l.slice(0,30).map((e,s)=>{let r=`${e.sessionId}-${s}`,a=n===r;return(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,t.jsxs)("button",{onClick:()=>o(a?null:r),className:"w-full text-left px-3 py-2 hover:bg-accent/30 transition-colors flex items-start gap-2",children:[(0,t.jsx)(t6,{className:"size-3 text-muted-foreground shrink-0 mt-0.5"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-xs text-foreground truncate",children:e.display||"(empty)"}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-0.5 text-[10px] text-muted-foreground/60",children:[e.projectName&&(0,t.jsx)("span",{children:e.projectName}),(0,t.jsx)("span",{children:new Date(e.timestamp).toLocaleDateString("en",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]})]})]}),a&&(0,t.jsxs)("div",{className:"border-t border-border px-3 py-2 bg-sidebar/30 text-[10px] text-muted-foreground/70 space-y-1",children:[(0,t.jsx)("p",{className:"break-words",children:e.display}),(0,t.jsx)("p",{className:"font-mono opacity-50",children:e.project})]})]},r)}),0===l.length&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60 text-center py-4",children:"No matching prompts"})]})]})]})}let su={Bash:"⚡",Read:"📖",Edit:"✏️",Write:"💾",Glob:"🔍",Grep:"🔎",Task:"🤖",WebFetch:"🌐",WebSearch:"🔍",TodoWrite:"📋"};function sx({events:e,hasHooks:s}){return s?(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5",children:[(0,t.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:["Live Tool Events (",e.length,")"]}),(0,t.jsxs)("div",{className:"space-y-1 max-h-64 overflow-y-auto",children:[e.slice(0,50).map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[11px] py-0.5",children:[(0,t.jsx)("span",{className:"shrink-0",children:su[e.tool??""]??"🔧"}),(0,t.jsx)("span",{className:"font-medium text-foreground",children:e.tool??e.event}),e.session&&(0,t.jsx)("span",{className:"text-muted-foreground/50 font-mono",children:e.session.slice(0,6)}),(0,t.jsx)("span",{className:"ml-auto text-muted-foreground/40 shrink-0",children:new Date(e.receivedAt).toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]},e.receivedAt)),0===e.length&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:"Waiting for events… Run a Claude Code session."})]})]}):(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-5 text-center",children:[(0,t.jsx)(t2,{className:"size-8 mx-auto mb-2 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"No hook events yet"}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground/60 mb-3",children:"Install hooks for real-time tool event streaming:"}),(0,t.jsx)("code",{className:"text-[11px] bg-muted px-2 py-1 rounded",children:"npx claudedash hooks install"})]})}function sh(){let[e,r]=(0,s.useState)(null),[a,n]=(0,s.useState)([]),[o,l]=(0,s.useState)(null),[i,c]=(0,s.useState)(null),[m,u]=(0,s.useState)(null),[x,h]=(0,s.useState)(null),[p,g]=(0,s.useState)(null),[b,j]=(0,s.useState)([]),[v,y]=(0,s.useState)(!1),[N,k]=(0,s.useState)(!0),[w,C]=(0,s.useState)(!1),[S,z]=(0,s.useState)("overview"),T=async()=>{k(!0),C(!1);try{let[e,t,s,a,o,i,d,m]=await Promise.all([fetch("/usage"),fetch("/activity/sessions"),fetch("/facets"),fetch("/conversations"),fetch("/cost"),fetch("/history"),fetch("/billing-block"),fetch("/hook/events")]);if(e.ok&&r(await e.json()),t.ok){let e=await t.json();n(e.sessions)}if(s.ok&&l(await s.json()),a.ok&&c(await a.json()),o.ok&&u(await o.json()),i.ok&&h(await i.json()),d.ok&&g(await d.json()),m.ok){let e=await m.json();j(e.events),y(e.events.length>0)}e.ok||t.ok||C(!0)}catch{C(!0)}finally{k(!1)}};if((0,s.useEffect)(()=>{T()},[]),N)return(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)(f,{className:"size-10 mx-auto mb-3 text-muted-foreground animate-pulse"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Loading activity data…"})]})});if(w||!e)return(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center p-8",children:(0,t.jsxs)("div",{className:"text-center max-w-sm",children:[(0,t.jsx)(f,{className:"size-12 mx-auto mb-4 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"No activity data found"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground/60",children:["Start a Claude Code session to generate"," ",(0,t.jsx)("code",{className:"bg-muted px-1 rounded",children:"~/.claude/stats-cache.json"})]})]})});let E=a.reduce((e,t)=>e+(t.linesAdded??0),0),M=a.reduce((e,t)=>e+(t.gitCommits??0),0),$=o?.sessions.length??0,D=i?.sessions.length??0,A=x?.total??0,R=b.length,L=[{id:"overview",label:"Overview"},{id:"quality",label:`Quality${$>0?` (${$})`:""}`},{id:"tools",label:`Tools${D>0?` (${D})`:""}`},{id:"history",label:`History${A>0?` (${A})`:""}`},{id:"hooks",label:`Hooks${R>0?` (${R})`:""}`}];return(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"px-4 py-2 border-b border-border bg-sidebar/30 flex items-center justify-between shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(f,{className:"size-4 text-chart-1"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"Activity"}),e.lastComputedDate&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground hidden sm:inline",children:["Updated: ",e.lastComputedDate]})]}),(0,t.jsx)("div",{className:"flex items-center bg-muted rounded-lg p-0.5",children:L.map(({id:e,label:s})=>(0,t.jsx)("button",{onClick:()=>z(e),className:`px-3 py-1 rounded text-xs font-medium transition-colors ${S===e?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:s},e))})]}),(0,t.jsxs)("button",{onClick:T,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1",children:[(0,t.jsx)(d,{className:"size-3"}),"Refresh"]})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsxs)("div",{className:"p-6 space-y-8 max-w-4xl mx-auto",children:["overview"===S&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[(0,t.jsx)(se,{label:"Total Sessions",value:t8(e.totalSessions),sub:e.firstSessionDate?`Since ${new Date(e.firstSessionDate).toLocaleDateString("en",{month:"short",day:"numeric"})}`:void 0,colorClass:"text-chart-1"}),(0,t.jsx)(se,{label:"Total Messages",value:t8(e.totalMessages),colorClass:"text-chart-2"}),(0,t.jsx)(se,{label:"Lines Added",value:E>0?`+${t8(E)}`:"—",colorClass:"text-chart-4"}),(0,t.jsx)(se,{label:"Git Commits",value:M>0?t8(M):"—",colorClass:"text-chart-3"})]}),p&&(0,t.jsx)(sc,{data:p}),m&&(0,t.jsx)(sd,{data:m}),e.dailyActivity.length>0&&(0,t.jsx)("div",{className:"bg-card border border-border rounded-lg p-5",children:(0,t.jsx)(st,{data:e.dailyActivity})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[Object.keys(e.hourCounts).length>0&&(0,t.jsx)("div",{className:"bg-card border border-border rounded-lg p-5",children:(0,t.jsx)(ss,{hourCounts:e.hourCounts})}),Object.keys(e.modelUsage).length>0&&(0,t.jsx)("div",{className:"bg-card border border-border rounded-lg p-5",children:(0,t.jsx)(sr,{modelUsage:e.modelUsage})})]}),e.longestSession&&(0,t.jsxs)("div",{className:"bg-chart-4/5 border border-chart-4/20 rounded-lg px-5 py-4 flex items-center gap-4",children:[(0,t.jsx)(t2,{className:"size-5 text-chart-4 shrink-0"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-foreground",children:"Longest session: "}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.longestSession.messageCount," messages ·"," ",Math.round(e.longestSession.duration/6e4),"m ·"," ",new Date(e.longestSession.timestamp).toLocaleDateString()]})]})]}),a.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("h4",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:["Recent Sessions (",a.length,")"]}),(0,t.jsx)("div",{className:"space-y-2",children:a.map(e=>(0,t.jsx)(sa,{s:e},e.sessionId))})]})]}),"quality"===S&&o&&(0,t.jsx)(sl,{data:o}),"tools"===S&&i&&(0,t.jsx)(si,{data:i}),"history"===S&&x&&(0,t.jsx)(sm,{data:x}),"hooks"===S&&(0,t.jsx)(sx,{events:b,hasHooks:v})]})})]})}let sp=l("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);function sf({content:e}){let s=e.split("\n"),r=[],a=!1,n=[],o=0,l=()=>{n.length>0&&(r.push((0,t.jsx)("pre",{className:"bg-muted rounded-md p-3 text-[11px] font-mono overflow-x-auto mb-3 text-foreground/80",children:n.join("\n")},o++)),n=[])};for(let e of s){if(e.startsWith("```")){a?(l(),a=!1):a=!0;continue}if(a){n.push(e);continue}if(e.startsWith("# "))r.push((0,t.jsx)("h2",{className:"text-base font-bold text-foreground mt-4 mb-2",children:e.slice(2)},o++));else if(e.startsWith("## "))r.push((0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground mt-3 mb-1.5",children:e.slice(3)},o++));else if(e.startsWith("### "))r.push((0,t.jsx)("h4",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mt-2 mb-1",children:e.slice(4)},o++));else if(e.startsWith("- ")||e.startsWith("* "))r.push((0,t.jsx)("li",{className:"text-xs text-muted-foreground ml-4 mb-0.5 list-disc",children:e.slice(2)},o++));else if(e.match(/^\d+\. /)){let s=e.replace(/^\d+\. /,"");r.push((0,t.jsx)("li",{className:"text-xs text-muted-foreground ml-4 mb-0.5 list-decimal",children:s},o++))}else if(""===e.trim())r.push((0,t.jsx)("div",{className:"h-2"},o++));else{let s=e.split(/(`[^`]+`)/g);r.push((0,t.jsx)("p",{className:"text-xs text-muted-foreground mb-0.5",children:s.map(e=>e.startsWith("`")&&e.endsWith("`")?(0,t.jsx)("code",{className:"bg-muted px-1 rounded text-[11px] font-mono text-foreground",children:e.slice(1,-1)},e):e)},o++))}}return l(),(0,t.jsx)("div",{children:r})}function sg(){let[e,r]=(0,s.useState)([]),[a,n]=(0,s.useState)(null),[o,l]=(0,s.useState)(!0),i=async()=>{l(!0);try{let e=await fetch("/plans");if(e.ok){let t=await e.json();r(t.plans),t.plans.length>0&&!a&&n(t.plans[0])}}catch{}finally{l(!1)}};return((0,s.useEffect)(()=>{i()},[]),o)?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,t.jsx)(g,{className:"size-8 text-muted-foreground/30 animate-pulse"})}):0===e.length?(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center p-8",children:(0,t.jsxs)("div",{className:"text-center max-w-sm",children:[(0,t.jsx)(g,{className:"size-12 mx-auto mb-4 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"No plans yet"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground/60",children:["Use ",(0,t.jsx)("code",{className:"bg-muted px-1 rounded",children:"/plan"})," in Claude Code to generate plan documents. They are saved to ",(0,t.jsx)("code",{className:"bg-muted px-1 rounded",children:"~/.claude/plans/"})]})]})}):(0,t.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,t.jsxs)("div",{className:"w-64 border-r border-border flex flex-col shrink-0",children:[(0,t.jsxs)("div",{className:"px-4 py-2 border-b border-border bg-sidebar/30 flex items-center justify-between shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g,{className:"size-3.5 text-chart-3"}),(0,t.jsxs)("span",{className:"text-xs font-medium",children:["Plans (",e.length,")"]})]}),(0,t.jsx)("button",{onClick:i,className:"p-1 rounded hover:bg-accent/50 transition-colors",children:(0,t.jsx)(d,{className:"size-3 text-muted-foreground"})})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-2 space-y-1",children:e.map(e=>{var s;let r;return(0,t.jsxs)("button",{onClick:()=>n(e),className:`w-full text-left px-3 py-2.5 rounded-lg transition-colors flex items-start gap-2 ${a?.id===e.id?"bg-accent text-foreground":"hover:bg-accent/50 text-muted-foreground"}`,children:[(0,t.jsx)(tP,{className:"size-3 shrink-0 mt-0.5 opacity-50"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-xs font-medium truncate leading-tight",children:e.title}),(0,t.jsxs)("p",{className:"text-[10px] text-muted-foreground/60 mt-0.5 flex items-center gap-1",children:[(0,t.jsx)(sp,{className:"size-2.5"}),(s=e.createdAt,0===(r=Math.floor((Date.now()-new Date(s).getTime())/864e5))?"today":1===r?"yesterday":r<7?`${r}d ago`:r<30?`${Math.floor(r/7)}w ago`:`${Math.floor(r/30)}mo ago`)]})]})]},e.id)})})})]}),(0,t.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden",children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"px-6 py-3 border-b border-border bg-sidebar/20 shrink-0",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:a.title}),(0,t.jsxs)("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:[(0,t.jsx)(sp,{className:"size-2.5 inline mr-1"}),new Date(a.createdAt).toLocaleDateString("en",{year:"numeric",month:"long",day:"numeric"}),(0,t.jsx)("span",{className:"ml-2 font-mono opacity-50",children:a.filename})]})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-6 max-w-3xl",children:(0,t.jsx)(sf,{content:a.content})})})]}):(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:"Select a plan"})})]})}let sb=l("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);function sj(){let[e,r]=(0,s.useState)(null),[a,n]=(0,s.useState)(!0),[o,l]=(0,s.useState)("plan"),[i,c]=(0,s.useState)(""),[m,u]=(0,s.useState)(""),[x,h]=(0,s.useState)({status:"idle"}),p=(0,s.useCallback)(()=>{n(!0),fetch("/claudemd").then(e=>e.json()).then(e=>{r(e),c(e.plan.content),u(e.project.content),n(!1)}).catch(()=>n(!1))},[]);(0,s.useEffect)(()=>{p()},[p]);let f=async e=>{h({status:"saving"});let t="plan"===e?i:m;try{let s=await fetch("/claudemd",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:e,content:t})});if(s.ok)h({status:"saved"}),setTimeout(()=>h({status:"idle"}),2e3);else{let e=await s.json();h({status:"error",message:e.error??"Save failed"})}}catch{h({status:"error",message:"Network error"})}};if(a)return(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:"Loading…"});let b=[{key:"plan",label:".claudedash/CLAUDE.md",subtitle:"Plan mode instructions injected into every agent context"},{key:"project",label:"CLAUDE.md",subtitle:"Project root — global agent instructions for this repository"}],j=e?.[o],v="plan"===o?c:u;return(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"border-b border-border px-4 py-3 flex items-center justify-between shrink-0 bg-background",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(g,{className:"size-4 text-muted-foreground"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"text-sm font-medium text-foreground",children:"CLAUDE.md Editor"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Edit agent instruction files"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:["saved"===x.status&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-chart-2",children:[(0,t.jsx)(C,{className:"size-3"})," Saved"]}),"error"===x.status&&(0,t.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,t.jsx)(w,{className:"size-3"})," ",x.message]}),(0,t.jsx)("button",{onClick:p,className:"p-1.5 rounded hover:bg-muted transition-colors",title:"Reload from disk",children:(0,t.jsx)(d,{className:"size-3.5 text-muted-foreground"})}),(0,t.jsxs)("button",{onClick:()=>void f(o),disabled:"saving"===x.status||!j?.path,className:"flex items-center gap-1.5 px-3 py-1.5 rounded bg-primary text-primary-foreground text-xs font-medium hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[(0,t.jsx)(sb,{className:"size-3"}),"saving"===x.status?"Saving…":"Save"]})]})]}),(0,t.jsx)("div",{className:"border-b border-border px-4 flex items-center gap-1 shrink-0 bg-background",children:b.map(e=>(0,t.jsx)("button",{onClick:()=>l(e.key),className:`px-3 py-2 text-xs font-medium border-b-2 transition-colors ${o===e.key?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,children:e.label},e.key))}),b.find(e=>e.key===o)&&(0,t.jsxs)("div",{className:"px-4 py-2 bg-muted/30 border-b border-border shrink-0",children:[(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[b.find(e=>e.key===o)?.subtitle,j?.path&&(0,t.jsx)("span",{className:"ml-2 font-mono opacity-60",children:j.path})]}),!j?.exists&&(0,t.jsx)("p",{className:"text-xs text-amber-500 mt-0.5",children:"File does not exist yet — saving will create it."})]}),(0,t.jsx)(tv,{className:"flex-1",children:(0,t.jsx)("div",{className:"p-4 h-full",children:j?.path?(0,t.jsx)("textarea",{value:"plan"===o?i:m,onChange:e=>v(e.target.value),spellCheck:!1,className:"w-full min-h-[60vh] bg-transparent text-sm font-mono text-foreground placeholder-muted-foreground resize-none focus:outline-none leading-relaxed",placeholder:"# CLAUDE.md Start writing agent instructions..."}):(0,t.jsxs)("div",{className:"flex items-center justify-center h-48 text-muted-foreground text-sm",children:["Plan mode not configured — run ",(0,t.jsx)("code",{className:"mx-1 bg-muted px-1 rounded",children:"claudedash init"})," first."]})})})]})}function sv(e,t){"Notification"in window&&"granted"===Notification.permission&&new Notification(e,{body:t})}let sy="claudedash";function sN(e,t){"u">typeof document&&(t>0?document.title=`[⚠ ${t} failed] ${sy}`:e>0?document.title=`[⚠ ${e} blocked] ${sy}`:document.title=sy)}let sk={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"};function sw({content:e,children:s,side:r="bottom"}){return(0,t.jsxs)("div",{className:"relative group inline-flex",children:[s,(0,t.jsx)("div",{role:"tooltip",className:`absolute ${sk[r]} px-2 py-1 bg-popover border border-border text-popover-foreground text-[11px] leading-snug rounded shadow-lg whitespace-nowrap pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity duration-150 z-50`,children:e})]})}let sC=[{id:"live",icon:c,label:"Live",tooltip:"Real-time Claude Code session monitor",show:e=>e.live},{id:"plan",icon:m,label:"Queue",tooltip:"Task queue tracker — queue.md · execution.log · agent status",show:e=>e.plan},{id:"worktrees",icon:u,label:"Worktrees",tooltip:"Git worktree status across parallel branches",show:e=>e.live||e.plan},{id:"activity",icon:f,label:"Activity",tooltip:"Usage stats, session history and token breakdown",show:()=>!0},{id:"plans",icon:g,label:"Docs",tooltip:"Claude Code plan documents from ~/.claude/plans/",show:()=>!0},{id:"claudemd",icon:b,label:"Config",tooltip:"Edit CLAUDE.md agent instruction files",show:e=>e.plan}];function sS(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function sz(){let[e,r]=(0,s.useState)("live"),[a,n]=(0,s.useState)({live:!1,plan:!1}),[o,l]=(0,s.useState)(!0),[c,m]=(0,s.useState)(null),[u,g]=(0,s.useState)(""),[b,N]=(0,s.useState)(!1),[k,w]=(0,s.useState)(null),[C,S]=(0,s.useState)(!1),z=(0,s.useRef)(null),{showDeniedBanner:T,dismissDeniedBanner:E,sseConnected:M}=function(){let[e,t]=(0,s.useState)(!1),[r,a]=(0,s.useState)(!1),n=(0,s.useRef)(new Map),o=(0,s.useRef)(new Map),l=(0,s.useRef)(!1),i=(0,s.useRef)(!1),d=(0,s.useRef)(new Set);return(0,s.useEffect)(()=>{if("Notification"in window){if("denied"===Notification.permission)return void t(!0);"default"===Notification.permission&&Notification.requestPermission().then(e=>{"denied"===e&&t(!0)})}},[]),(0,s.useEffect)(()=>{let e=new EventSource("/events/");return e.onopen=()=>a(!0),e.onerror=()=>a(!1),e.onmessage=e=>{try{let t=JSON.parse(e.data);if("sessions"===t.type&&fetch("/sessions").then(e=>e.json()).then(e=>{let t=e.sessions.flatMap(e=>e.tasks);if(l.current)for(let t of function(e,t){let s=[];for(let r of t)for(let t of r.tasks){let a=e.get(t.id);a&&a!==t.status&&"completed"===t.status&&s.push({subject:t.subject,project:r.projectName??null})}return s}(n.current,e.sessions)){let e=`live:${t.subject}`;if(!d.current.has(e)){d.current.add(e);let s=t.project?`${t.subject}
70
- ${t.project}`:t.subject;sv("Task completed ✓",s)}}sN(0,0);let s=new Map;for(let e of t)s.set(e.id,e.status);n.current=s,l.current=!0}),"task-blocked"===t.type){let e=`blocked:${t.task_id}:${t.reason??""}`;if(!d.current.has(e)){d.current.add(e);let s=`Task BLOCKED: ${t.task_id??"?"}`,r=t.reason?`${t.reason}`:`Reported by ${t.agent??"agent"}`;sv(s,r)}}"plan"===t.type&&fetch("/snapshot").then(e=>e.json()).then(e=>{let t=e.snapshot?.tasks??[];if(i.current)for(let e of function(e,t){let s=[];for(let r of t){let t=e.get(r.id);t&&t!==r.status&&("DONE"===r.status||"FAILED"===r.status||"BLOCKED"===r.status)&&s.push({id:r.id,description:r.description,status:r.status})}return s}(o.current,t)){let t=`plan:${e.id}:${e.status}`;d.current.has(t)||(d.current.add(t),"DONE"===e.status?sv("Plan task done ✓",`${e.id}: ${e.description}`):"FAILED"===e.status?sv("Task failed ✗",`${e.id}: ${e.description}`):"BLOCKED"===e.status&&sv("Task blocked ⚠",`${e.id}: ${e.description}`))}let s=e.snapshot?.summary.failed??0,r=e.snapshot?.summary.blocked??0;sN(r,s);let a=new Map;for(let e of t)a.set(e.id,e.status);o.current=a,i.current=!0})}catch{}},()=>{e.close(),a(!1)}},[]),{showDeniedBanner:e,dismissDeniedBanner:()=>t(!1),sseConnected:r}}();if(!function({setMode:e,availableModes:t,setSearchFocused:r,clearSearch:a,setShowCheatsheet:n,showCheatsheet:o}){let l=(0,s.useCallback)(s=>{let l=s.target;if("INPUT"===l.tagName||"TEXTAREA"===l.tagName||l.isContentEditable){"Escape"===s.key&&(a(),l.blur());return}if(!s.metaKey&&!s.ctrlKey&&!s.altKey)switch(s.key){case"?":n(!o);break;case"Escape":o?n(!1):a();break;case"l":case"L":t.live&&e("live");break;case"q":case"Q":t.plan&&e("plan");break;case"a":case"A":e("activity");break;case"d":case"D":e("plans");break;case"w":case"W":e("worktrees");break;case"c":case"C":t.plan&&e("claudemd");break;case"/":s.preventDefault(),r()}},[e,t,r,a,n,o]);(0,s.useEffect)(()=>(document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)),[l])}({setMode:r,availableModes:a,setSearchFocused:()=>z.current?.focus(),clearSearch:()=>g(""),setShowCheatsheet:S,showCheatsheet:C}),(0,s.useEffect)(()=>{let e=new AbortController;return fetch("/usage",{signal:e.signal}).then(e=>e.ok?e.json():null).then(e=>{e&&w(e)}).catch(()=>{}),()=>e.abort()},[]),(0,s.useEffect)(()=>{let e=new AbortController;return fetch("/health",{signal:e.signal}).then(e=>e.json()).then(e=>{n(e.modes),e.modes.live?r("live"):e.modes.plan?r("plan"):r("activity"),l(!1)}).catch(()=>{m("Failed to connect to server"),l(!1)}),()=>e.abort()},[]),o)return(0,t.jsx)("div",{className:"h-screen bg-background flex items-center justify-center",children:(0,t.jsx)("div",{className:"text-muted-foreground",children:"Loading..."})});if(c)return(0,t.jsx)("div",{className:"h-screen bg-background flex items-center justify-center",children:(0,t.jsxs)("div",{className:"text-destructive-foreground",children:["Error: ",c]})});let $=k?[`${sS(k.totalMessages)} messages \xb7 ${sS(k.totalSessions)} sessions`,k.firstSessionDate?`Since ${new Date(k.firstSessionDate).toLocaleDateString()}`:null,k.lastComputedDate?`Stats date: ${k.lastComputedDate}`:null].filter(Boolean).join(" · "):"";return(0,t.jsxs)("div",{className:"h-screen bg-background flex flex-col overflow-hidden",children:[T&&(0,t.jsxs)("div",{className:"bg-destructive/10 border-b border-destructive/30 px-4 py-2 flex items-center justify-between text-xs text-destructive shrink-0",children:[(0,t.jsx)("span",{children:"Browser notifications are blocked. Enable them in your browser settings to get alerts when tasks fail or complete."}),(0,t.jsx)("button",{onClick:E,className:"ml-4 text-destructive/70 hover:text-destructive font-medium shrink-0",children:"Dismiss"})]}),(0,t.jsxs)("div",{className:"bg-sidebar border-b border-sidebar-border px-4 py-2 flex items-center justify-between shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(sw,{content:b?"Expand sidebar":"Collapse sidebar",side:"bottom",children:(0,t.jsx)("button",{onClick:()=>N(!b),className:"p-1.5 rounded hover:bg-sidebar-accent transition-colors",children:b?(0,t.jsx)(h,{className:"size-4"}):(0,t.jsx)(p,{className:"size-4"})})}),(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:"claudedash"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground bg-muted px-2 py-0.5 rounded",children:["v",y.default.version]})]}),(0,t.jsx)("div",{className:"flex items-center bg-muted rounded-lg p-0.5",children:sC.filter(e=>e.show(a)).map(({id:s,icon:a,label:n,tooltip:o})=>(0,t.jsx)(sw,{content:o,side:"bottom",children:(0,t.jsxs)("button",{onClick:()=>r(s),className:`flex items-center gap-1.5 px-3 py-1 rounded text-xs font-medium transition-colors ${e===s?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(a,{className:"size-3"}),n]})},s))})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(i,{className:"absolute left-3 top-1/2 -translate-y-1/2 size-3.5 text-muted-foreground"}),(0,t.jsx)("input",{ref:z,type:"text",placeholder:"Filter... (/)",value:u,onChange:e=>g(e.target.value),className:"bg-background border border-border rounded-lg pl-8 pr-3 py-1.5 text-xs text-foreground placeholder-muted-foreground focus:outline-none focus:border-ring w-48"})]}),k&&(0,t.jsx)(sw,{content:$,side:"bottom",children:(0,t.jsxs)("button",{onClick:()=>r("activity"),className:"flex items-center gap-1.5 px-2 py-1 rounded bg-muted/60 hover:bg-muted transition-colors text-xs text-muted-foreground cursor-pointer",children:[(0,t.jsx)(f,{className:"size-3 text-chart-1"}),(0,t.jsx)("span",{className:"font-medium text-foreground",children:sS(k.totalMessages)}),(0,t.jsx)("span",{className:"opacity-50",children:"msgs"}),(0,t.jsx)("span",{className:"opacity-30",children:"·"}),(0,t.jsx)("span",{className:"font-medium text-foreground",children:sS(k.totalSessions)}),(0,t.jsx)("span",{className:"opacity-50",children:"sessions"})]})}),(0,t.jsx)(sw,{content:M?"Live connection active · Server-Sent Events":"Connecting to server…",side:"bottom",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1.5 text-xs text-muted-foreground cursor-default",children:[(0,t.jsx)("span",{className:`size-2 rounded-full ${M?"bg-chart-2 animate-pulse":"bg-muted-foreground/40"}`}),(0,t.jsx)("span",{className:"hidden sm:inline",children:M?"live":"connecting"})]})}),(0,t.jsx)(sw,{content:"Claude Code usage analytics · Run /insight to generate",side:"bottom",children:(0,t.jsx)("button",{onClick:()=>{r(e=>"insights"===e?a.live?"live":a.plan?"plan":"activity":"insights")},className:`p-1.5 rounded transition-colors ${"insights"===e?"bg-sidebar-accent text-chart-3":"hover:bg-sidebar-accent text-muted-foreground hover:text-foreground"}`,children:(0,t.jsx)(x,{className:"size-4"})})}),(0,t.jsx)(sw,{content:"Keyboard shortcuts (?)",side:"bottom",children:(0,t.jsx)("button",{onClick:()=>S(!0),className:"p-1.5 rounded hover:bg-sidebar-accent transition-colors",children:(0,t.jsx)(j,{className:"size-3.5 text-muted-foreground"})})}),(0,t.jsx)(sw,{content:"Reload dashboard",side:"bottom",children:(0,t.jsx)("button",{className:"p-1.5 rounded hover:bg-sidebar-accent transition-colors",onClick:()=>window.location.reload(),children:(0,t.jsx)(d,{className:"size-3.5 text-muted-foreground"})})})]})]}),C&&(0,t.jsx)("div",{role:"presentation",className:"fixed inset-0 z-50 bg-black/50 flex items-center justify-center",onClick:()=>S(!1),onKeyDown:e=>{"Escape"===e.key&&S(!1)},children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":"Keyboard Shortcuts",className:"bg-background border border-border rounded-xl shadow-xl p-6 w-80 max-w-full",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("h2",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,t.jsx)(j,{className:"size-4"})," Keyboard Shortcuts"]}),(0,t.jsx)("button",{onClick:()=>S(!1),className:"text-muted-foreground hover:text-foreground",children:(0,t.jsx)(v,{className:"size-4"})})]}),(0,t.jsx)("div",{className:"space-y-1 text-xs",children:[["L","Live view",a.live],["Q","Queue view",a.plan],["A","Activity view",!0],["D","Docs view",!0],["W","Worktrees view",a.live||a.plan],["C","Config (CLAUDE.md)",a.plan],["/","Focus search",!0],["Esc","Clear search / close",!0],["?","Toggle this cheatsheet",!0]].filter(([,,e])=>e).map(([e,s])=>(0,t.jsxs)("div",{className:"flex items-center justify-between py-1 border-b border-border/40 last:border-0",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:String(s)}),(0,t.jsx)("kbd",{className:"px-2 py-0.5 bg-muted rounded text-[10px] font-mono text-foreground border border-border",children:String(e)})]},String(e)))})]})}),(0,t.jsx)("div",{className:"flex-1 flex overflow-hidden",children:"live"===e?(0,t.jsx)(tL,{searchQuery:u,sidebarCollapsed:b}):"plan"===e?(0,t.jsx)(tZ,{searchQuery:u,sidebarCollapsed:b}):"worktrees"===e?(0,t.jsx)(tC,{}):"activity"===e?(0,t.jsx)(sh,{}):"plans"===e?(0,t.jsx)(sg,{}):"claudemd"===e?(0,t.jsx)(sj,{}):(0,t.jsx)(t1,{})})]})}e.s(["default",()=>sz],23733)}]);