ai-agent-session-center 2.10.0 → 2.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ ._container_1hp2u_6{display:flex;flex-direction:column;height:100%;overflow:hidden}._filterBar_1hp2u_15{display:flex;align-items:center;gap:10px;padding:14px 24px;border-bottom:1px solid var(--border-subtle);flex-shrink:0;flex-wrap:wrap}._filterBar_1hp2u_15 select{background:var(--bg-primary, #0a0a1a);border:1px solid var(--border-subtle);border-radius:6px;color:var(--text-primary);font-size:12px;font-family:var(--font-mono);padding:6px 10px;outline:none;cursor:pointer;min-width:100px}._filterBar_1hp2u_15 select:focus{border-color:var(--accent-cyan)}._toggleLabel_1hp2u_42{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--text-secondary);font-family:var(--font-mono);cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap}._toggleLabel_1hp2u_42 input[type=checkbox]{accent-color:var(--accent-cyan);cursor:pointer}._taskList_1hp2u_61{flex:1;overflow-y:auto;padding:12px 24px}._groupHeader_1hp2u_69{display:flex;align-items:center;gap:8px;padding:8px 0 6px;cursor:pointer;-webkit-user-select:none;user-select:none}._groupChevron_1hp2u_78{width:10px;height:10px;flex-shrink:0;transition:transform .15s ease;color:var(--text-dim)}._groupChevron_1hp2u_78._collapsed_1hp2u_86{transform:rotate(-90deg)}._groupLabel_1hp2u_90{font-size:11px;letter-spacing:1.5px;color:var(--text-dim);text-transform:uppercase;font-family:var(--font-mono);flex:1}._groupCount_1hp2u_99{font-size:10px;color:var(--text-dim);font-family:var(--font-mono)}._taskCard_1hp2u_107{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;border:1px solid var(--border-subtle);border-radius:6px;margin-bottom:6px;background:transparent;transition:background .15s ease,border-color .15s ease,box-shadow .15s ease}._taskCard_1hp2u_107:hover{background:var(--bg-subtle);border-color:#ffffff1a}._completed_1hp2u_124{opacity:.5}._completed_1hp2u_124 ._taskTitle_1hp2u_128{text-decoration:line-through;color:var(--text-dim)}._overdue_1hp2u_133{border-color:var(--accent-red);box-shadow:0 0 8px color-mix(in srgb,var(--accent-red) 30%,transparent)}._dueToday_1hp2u_138{border-color:var(--accent-yellow);box-shadow:0 0 8px color-mix(in srgb,var(--accent-yellow) 20%,transparent)}._checkbox_1hp2u_145{width:18px;height:18px;flex-shrink:0;margin-top:1px;accent-color:var(--accent-cyan);cursor:pointer}._checkbox_1hp2u_145:checked{filter:drop-shadow(0 0 4px var(--accent-cyan))}._taskContent_1hp2u_160{flex:1;min-width:0}._taskHeader_1hp2u_165{display:flex;align-items:center;gap:8px;margin-bottom:2px}._taskTitle_1hp2u_128{font-size:13px;color:var(--text-primary);font-family:var(--font-mono);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;line-height:1.4}._taskTitle_1hp2u_128:hover{color:var(--accent-cyan)}._taskTitleInput_1hp2u_189{width:100%;background:var(--bg-subtle);border:1px solid var(--accent-cyan);border-radius:3px;color:var(--text-primary);font-size:13px;font-family:var(--font-mono);padding:1px 6px;outline:none;line-height:1.4}._priorityBadge_1hp2u_204{font-size:9px;font-weight:600;letter-spacing:.5px;text-transform:uppercase;padding:1px 6px;border-radius:3px;flex-shrink:0;line-height:1.6;transition:filter .15s ease,transform .15s ease}._priorityBadge_1hp2u_204:hover{filter:brightness(1.3);transform:scale(1.05)}._priorityUrgent_1hp2u_221{background:color-mix(in srgb,var(--accent-red) 20%,transparent);color:var(--accent-red);border:1px solid color-mix(in srgb,var(--accent-red) 40%,transparent)}._priorityHigh_1hp2u_227{background:color-mix(in srgb,var(--accent-orange) 20%,transparent);color:var(--accent-orange);border:1px solid color-mix(in srgb,var(--accent-orange) 40%,transparent)}._priorityMedium_1hp2u_233{background:color-mix(in srgb,var(--accent-yellow) 20%,transparent);color:var(--accent-yellow);border:1px solid color-mix(in srgb,var(--accent-yellow) 40%,transparent)}._priorityLow_1hp2u_239{background:color-mix(in srgb,var(--accent-green) 20%,transparent);color:var(--accent-green);border:1px solid color-mix(in srgb,var(--accent-green) 40%,transparent)}._taskMeta_1hp2u_247{display:flex;align-items:center;gap:8px;margin-top:4px;flex-wrap:wrap}._dueDate_1hp2u_255{font-size:10px;font-family:var(--font-mono);color:var(--text-dim)}._dueDateOverdue_1hp2u_261{color:var(--accent-red)}._dueDateToday_1hp2u_265{color:var(--accent-yellow)}._tag_1hp2u_269{font-size:9px;color:var(--accent-cyan);background:color-mix(in srgb,var(--accent-cyan) 10%,transparent);border:1px solid color-mix(in srgb,var(--accent-cyan) 25%,transparent);padding:0 5px;border-radius:3px;line-height:1.7}._tag_1hp2u_269:hover{background:color-mix(in srgb,var(--accent-cyan) 20%,transparent);border-color:var(--accent-cyan)}._tagInput_1hp2u_284{font-size:10px;font-family:var(--font-mono);color:var(--text-primary);background:var(--bg-subtle);border:1px solid var(--accent-cyan);border-radius:3px;padding:1px 6px;outline:none;min-width:120px;line-height:1.5}._addTagBtn_1hp2u_297{font-size:10px;color:var(--text-dim);background:none;border:1px dashed color-mix(in srgb,var(--text-dim) 40%,transparent);border-radius:3px;padding:0 5px;cursor:pointer;font-family:var(--font-mono);line-height:1.6;transition:all .15s ease}._addTagBtn_1hp2u_297:hover{color:var(--accent-cyan);border-color:var(--accent-cyan)}._description_1hp2u_317{margin-top:6px;font-size:11px;color:var(--text-secondary);font-family:var(--font-mono);line-height:1.5;white-space:pre-wrap;word-break:break-word}._descriptionToggle_1hp2u_327{font-size:10px;color:var(--text-dim);cursor:pointer;background:none;border:none;padding:0;font-family:var(--font-mono);margin-top:4px}._descriptionToggle_1hp2u_327:hover{color:var(--accent-cyan)}._deleteBtn_1hp2u_344{flex-shrink:0;background:none;border:none;color:var(--text-dim);cursor:pointer;padding:4px;border-radius:3px;transition:color .15s ease,background .15s ease;display:flex;align-items:center;justify-content:center}._deleteBtn_1hp2u_344:hover{color:var(--accent-red);background:color-mix(in srgb,var(--accent-red) 15%,transparent)}._addForm_1hp2u_365{display:flex;align-items:flex-end;gap:8px;padding:12px 24px 16px;border-top:1px solid var(--border-subtle);flex-shrink:0;flex-wrap:wrap}._addForm_1hp2u_365 input[type=text],._addForm_1hp2u_365 input[type=date]{background:var(--bg-primary, #0a0a1a);border:1px solid var(--border-subtle);border-radius:6px;color:var(--text-primary);font-size:12px;font-family:var(--font-mono);padding:7px 10px;outline:none}._addForm_1hp2u_365 input[type=text]:focus,._addForm_1hp2u_365 input[type=date]:focus{border-color:var(--accent-cyan)}._addForm_1hp2u_365 select{background:var(--bg-primary, #0a0a1a);border:1px solid var(--border-subtle);border-radius:6px;color:var(--text-primary);font-size:12px;font-family:var(--font-mono);padding:7px 10px;outline:none;cursor:pointer}._addForm_1hp2u_365 select:focus{border-color:var(--accent-cyan)}._titleInput_1hp2u_408{flex:1;min-width:180px}._tagsInput_1hp2u_413{min-width:120px;width:140px}._addBtn_1hp2u_418{background:color-mix(in srgb,var(--accent-cyan) 15%,transparent);border:1px solid var(--accent-cyan);border-radius:6px;color:var(--accent-cyan);font-size:11px;font-family:var(--font-mono);font-weight:600;letter-spacing:1px;padding:7px 16px;cursor:pointer;transition:background .15s ease;white-space:nowrap}._addBtn_1hp2u_418:hover:not(:disabled){background:color-mix(in srgb,var(--accent-cyan) 25%,transparent)}._addBtn_1hp2u_418:disabled{opacity:.4;cursor:not-allowed}._emptyState_1hp2u_444{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 24px;color:var(--text-dim);font-size:13px;font-family:var(--font-mono);text-align:center;gap:8px}._emptyState_1hp2u_444 span{font-size:11px;color:var(--text-dim);opacity:.6}._loading_1hp2u_465{display:flex;align-items:center;justify-content:center;padding:60px 24px;color:var(--text-dim);font-size:12px;font-family:var(--font-mono);letter-spacing:1px}._stats_1hp2u_478{padding:6px 24px;font-size:11px;color:var(--text-secondary);font-family:var(--font-mono);display:flex;gap:6px;flex-shrink:0}._statsSep_1hp2u_488{color:var(--text-dim)}._confirmOverlay_1hp2u_494{display:flex;align-items:center;gap:6px;font-size:10px;font-family:var(--font-mono);color:var(--accent-red)}._confirmBtn_1hp2u_503{background:color-mix(in srgb,var(--accent-red) 15%,transparent);border:1px solid var(--accent-red);border-radius:3px;color:var(--accent-red);font-size:10px;font-family:var(--font-mono);padding:2px 8px;cursor:pointer}._confirmBtn_1hp2u_503:hover{background:color-mix(in srgb,var(--accent-red) 30%,transparent)}._cancelBtn_1hp2u_518{background:none;border:1px solid var(--border-subtle);border-radius:3px;color:var(--text-secondary);font-size:10px;font-family:var(--font-mono);padding:2px 8px;cursor:pointer}._cancelBtn_1hp2u_518:hover{border-color:var(--text-dim)}
@@ -0,0 +1 @@
1
+ import{y as f,h as i,k as e,o as F}from"./index-DMLiHQ-O.js";const $="_container_1hp2u_6",U="_filterBar_1hp2u_15",Y="_toggleLabel_1hp2u_42",G="_taskList_1hp2u_61",V="_groupHeader_1hp2u_69",W="_groupChevron_1hp2u_78",q="_collapsed_1hp2u_86",K="_groupLabel_1hp2u_90",z="_groupCount_1hp2u_99",J="_taskCard_1hp2u_107",Q="_completed_1hp2u_124",X="_taskTitle_1hp2u_128",Z="_overdue_1hp2u_133",ee="_dueToday_1hp2u_138",te="_checkbox_1hp2u_145",se="_taskContent_1hp2u_160",ae="_taskHeader_1hp2u_165",ne="_taskTitleInput_1hp2u_189",oe="_priorityBadge_1hp2u_204",ie="_priorityUrgent_1hp2u_221",le="_priorityHigh_1hp2u_227",re="_priorityMedium_1hp2u_233",ce="_priorityLow_1hp2u_239",de="_taskMeta_1hp2u_247",ue="_dueDate_1hp2u_255",pe="_dueDateOverdue_1hp2u_261",he="_dueDateToday_1hp2u_265",ge="_tag_1hp2u_269",me="_tagInput_1hp2u_284",_e="_addTagBtn_1hp2u_297",fe="_description_1hp2u_317",ye="_descriptionToggle_1hp2u_327",xe="_deleteBtn_1hp2u_344",ve="_addForm_1hp2u_365",je="_titleInput_1hp2u_408",Te="_tagsInput_1hp2u_413",Ce="_addBtn_1hp2u_418",ke="_emptyState_1hp2u_444",De="_loading_1hp2u_465",be="_stats_1hp2u_478",we="_statsSep_1hp2u_488",Se="_confirmOverlay_1hp2u_494",Ne="_confirmBtn_1hp2u_503",Be="_cancelBtn_1hp2u_518",s={container:$,filterBar:U,toggleLabel:Y,taskList:G,groupHeader:V,groupChevron:W,collapsed:q,groupLabel:K,groupCount:z,taskCard:J,completed:Q,taskTitle:X,overdue:Z,dueToday:ee,checkbox:te,taskContent:se,taskHeader:ae,taskTitleInput:ne,priorityBadge:oe,priorityUrgent:ie,priorityHigh:le,priorityMedium:re,priorityLow:ce,taskMeta:de,dueDate:ue,dueDateOverdue:pe,dueDateToday:he,tag:ge,tagInput:me,addTagBtn:_e,description:fe,descriptionToggle:ye,deleteBtn:xe,addForm:ve,titleInput:je,tagsInput:Te,addBtn:Ce,emptyState:ke,loading:De,stats:be,statsSep:we,confirmOverlay:Se,confirmBtn:Ne,cancelBtn:Be},Ie=[{value:"all",label:"All priorities"},{value:"urgent",label:"Urgent"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}],Le=[{value:"priority",label:"Priority"},{value:"dueDate",label:"Due date"},{value:"createdAt",label:"Created"}];function Oe(){const t=f(l=>l.filter),o=f(l=>l.setFilter),n=i.useCallback(l=>o({search:l}),[o]),c=i.useCallback(l=>o({priority:l.target.value}),[o]),d=i.useCallback(l=>o({sortBy:l.target.value}),[o]),p=i.useCallback(()=>o({showCompleted:!t.showCompleted}),[o,t.showCompleted]);return e.jsxs("div",{className:s.filterBar,children:[e.jsx(F,{value:t.search,onChange:n,placeholder:"Search tasks...",debounceMs:200}),e.jsx("select",{value:t.priority,onChange:c,children:Ie.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))}),e.jsx("select",{value:t.sortBy,onChange:d,children:Le.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))}),e.jsxs("label",{className:s.toggleLabel,children:[e.jsx("input",{type:"checkbox",checked:t.showCompleted,onChange:p}),"Show completed"]})]})}const Re={urgent:s.priorityUrgent,high:s.priorityHigh,medium:s.priorityMedium,low:s.priorityLow},B=["low","medium","high","urgent"];function Ee(t){if(!t)return null;const o=new Date;o.setHours(0,0,0,0);const n=new Date(t+"T00:00:00");return n<o?"overdue":n.getTime()===o.getTime()?"today":"future"}function He(t){return new Date(t+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric"})}function L({task:t}){const o=f(a=>a.toggleTask),n=f(a=>a.updateTask),c=f(a=>a.deleteTask),[d,p]=i.useState(!1),[l,m]=i.useState(t.title),[_,x]=i.useState(!1),[u,j]=i.useState(""),[T,r]=i.useState(!1),[y,g]=i.useState(!1),C=i.useRef(null),b=i.useRef(null);i.useEffect(()=>{d&&(C.current?.focus(),C.current?.select())},[d]),i.useEffect(()=>{_&&b.current?.focus()},[_]),i.useEffect(()=>{d||m(t.title)},[t.title,d]);const k=i.useCallback(()=>{p(!1);const a=l.trim();a&&a!==t.title?n(t.id,{title:a}):m(t.title)},[l,t.id,t.title,n]),w=i.useCallback(()=>{o(t.id)},[o,t.id]),h=i.useCallback(()=>{c(t.id),g(!1)},[c,t.id]),v=i.useCallback(()=>{j(t.tags.join(", ")),x(!0)},[t.tags]),M=i.useCallback(()=>{const a=B.indexOf(t.priority),N=B[(a+1)%B.length];n(t.id,{priority:N})},[t.id,t.priority,n]),I=i.useCallback(()=>{x(!1);const a=u.split(",").map(P=>P.trim()).filter(Boolean),N=t.tags.join(","),A=a.join(",");N!==A&&n(t.id,{tags:a})},[u,t.id,t.tags,n]),D=Ee(t.dueDate),S=[s.taskCard];return t.completed&&S.push(s.completed),!t.completed&&D==="overdue"&&S.push(s.overdue),!t.completed&&D==="today"&&S.push(s.dueToday),e.jsxs("div",{className:S.join(" "),children:[e.jsx("input",{type:"checkbox",className:s.checkbox,checked:t.completed,onChange:w,"aria-label":`Mark "${t.title}" as ${t.completed?"incomplete":"complete"}`}),e.jsxs("div",{className:s.taskContent,children:[e.jsxs("div",{className:s.taskHeader,children:[d?e.jsx("input",{ref:C,className:s.taskTitleInput,value:l,onChange:a=>m(a.target.value),onBlur:k,onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),k()),a.key==="Escape"&&(m(t.title),p(!1))},onClick:a=>a.stopPropagation()}):e.jsx("span",{className:s.taskTitle,onClick:()=>{m(t.title),p(!0)},title:"Click to edit",children:t.title}),e.jsx("span",{className:`${s.priorityBadge} ${Re[t.priority]}`,onClick:a=>{a.stopPropagation(),M()},title:"Click to change priority",style:{cursor:"pointer"},children:t.priority})]}),e.jsxs("div",{className:s.taskMeta,children:[t.dueDate&&e.jsxs("span",{className:`${s.dueDate} ${D==="overdue"?s.dueDateOverdue:""} ${D==="today"?s.dueDateToday:""}`,children:[D==="overdue"&&"Overdue: ",D==="today"&&"Today: ",He(t.dueDate)]}),_?e.jsx("input",{ref:b,className:s.tagInput,value:u,onChange:a=>j(a.target.value),onBlur:I,onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),I()),a.key==="Escape"&&x(!1)},onClick:a=>a.stopPropagation(),placeholder:"tag1, tag2, ..."}):e.jsxs(e.Fragment,{children:[t.tags.map(a=>e.jsx("span",{className:s.tag,onClick:v,title:"Click to edit tags",style:{cursor:"pointer"},children:a},a)),e.jsx("button",{className:s.addTagBtn,onClick:v,title:"Add / edit tags",children:"+"})]})]}),t.description&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:s.descriptionToggle,onClick:()=>r(a=>!a),children:T?"- Hide details":"+ Show details"}),T&&e.jsx("div",{className:s.description,children:t.description})]})]}),y?e.jsxs("div",{className:s.confirmOverlay,children:[e.jsx("span",{children:"Delete?"}),e.jsx("button",{className:s.confirmBtn,onClick:h,children:"Yes"}),e.jsx("button",{className:s.cancelBtn,onClick:()=>g(!1),children:"No"})]}):e.jsx("button",{className:s.deleteBtn,onClick:()=>g(!0),"aria-label":`Delete "${t.title}"`,title:"Delete task",children:e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"3 6 5 6 21 6"}),e.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})}function Me(){const t=f(u=>u.createTask),[o,n]=i.useState(""),[c,d]=i.useState("medium"),[p,l]=i.useState(""),[m,_]=i.useState(""),x=i.useCallback(u=>{u.preventDefault();const j=o.trim();if(!j)return;const T=m.split(",").map(r=>r.trim()).filter(Boolean);t({title:j,priority:c,tags:T,dueDate:p||void 0}),n(""),d("medium"),l(""),_("")},[o,c,p,m,t]);return e.jsxs("form",{className:s.addForm,onSubmit:x,children:[e.jsx("input",{type:"text",className:s.titleInput,placeholder:"New task title...",value:o,onChange:u=>n(u.target.value),required:!0}),e.jsxs("select",{value:c,onChange:u=>d(u.target.value),children:[e.jsx("option",{value:"urgent",children:"Urgent"}),e.jsx("option",{value:"high",children:"High"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"low",children:"Low"})]}),e.jsx("input",{type:"date",value:p,onChange:u=>l(u.target.value),title:"Due date (optional)"}),e.jsx("input",{type:"text",className:s.tagsInput,placeholder:"Tags (comma-sep)",value:m,onChange:u=>_(u.target.value)}),e.jsx("button",{type:"submit",className:s.addBtn,disabled:!o.trim(),children:"ADD"})]})}const O=["urgent","high","medium","low"],R={urgent:0,high:1,medium:2,low:3},Ae={urgent:"Urgent",high:"High",medium:"Medium",low:"Low"};function Pe(t,o,n,c){if(n!=="all"&&t.priority!==n||c!=="all"&&!t.tags.includes(c))return!1;if(o){const d=o.toLowerCase(),p=t.title.toLowerCase().includes(d),l=(t.description??"").toLowerCase().includes(d);if(!p&&!l)return!1}return!0}function E(t,o){return[...t].sort((n,c)=>{if(o==="priority"){const d=R[n.priority],p=R[c.priority];return d!==p?d-p:new Date(c.createdAt).getTime()-new Date(n.createdAt).getTime()}return o==="dueDate"?!n.dueDate&&!c.dueDate?0:n.dueDate?c.dueDate?n.dueDate.localeCompare(c.dueDate):-1:1:new Date(c.createdAt).getTime()-new Date(n.createdAt).getTime()})}function H({label:t,count:o,collapsed:n,onToggle:c}){return e.jsxs("div",{className:s.groupHeader,onClick:c,children:[e.jsx("svg",{className:`${s.groupChevron} ${n?s.collapsed:""}`,width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})}),e.jsx("span",{className:s.groupLabel,children:t}),e.jsx("span",{className:s.groupCount,children:o})]})}function $e(){const t=f(r=>r.tasks),o=f(r=>r.loading),n=f(r=>r.filter),c=f(r=>r.fetchTasks),[d,p]=i.useState(new Set);i.useEffect(()=>{c()},[c]);const l=i.useCallback(r=>{p(y=>{const g=new Set(y);return g.has(r)?g.delete(r):g.add(r),g})},[]),{groups:m,completedTasks:_,totalIncomplete:x,totalCompleted:u}=i.useMemo(()=>{const y=[...t.values()].filter(h=>Pe(h,n.search,n.priority,n.tag)),g=y.filter(h=>!h.completed),C=y.filter(h=>h.completed),b=E(g,n.sortBy),k=new Map;for(const h of O)k.set(h,[]);for(const h of b){const v=k.get(h.priority);v&&v.push(h)}const w=[];for(const h of O){const v=k.get(h)??[];v.length>0&&w.push({id:h,label:Ae[h],tasks:v})}return{groups:w,completedTasks:E(C,n.sortBy),totalIncomplete:g.length,totalCompleted:C.length}},[t,n]);if(o)return e.jsx("div",{className:s.container,children:e.jsx("div",{className:s.loading,children:"Loading tasks..."})});const j=m.length===0&&_.length===0,T=t.size===0;return e.jsxs("div",{className:s.container,"data-testid":"agenda-view",children:[e.jsx(Oe,{}),e.jsxs("div",{className:s.stats,children:[e.jsxs("span",{children:[x," task",x!==1?"s":""]}),e.jsx("span",{className:s.statsSep,children:"|"}),e.jsxs("span",{children:[u," completed"]})]}),e.jsx("div",{className:s.taskList,children:T?e.jsxs("div",{className:s.emptyState,children:[e.jsx("div",{children:"No tasks yet"}),e.jsx("span",{children:"Add your first task below"})]}):j?e.jsxs("div",{className:s.emptyState,children:[e.jsx("div",{children:"No tasks match the current filter"}),e.jsx("span",{children:"Try adjusting your search or filter criteria"})]}):e.jsxs(e.Fragment,{children:[m.map(r=>{const y=d.has(r.id);return e.jsxs("div",{children:[e.jsx(H,{label:r.label,count:r.tasks.length,collapsed:y,onToggle:()=>l(r.id)}),!y&&r.tasks.map(g=>e.jsx(L,{task:g},g.id))]},r.id)}),n.showCompleted&&_.length>0&&e.jsxs("div",{children:[e.jsx(H,{label:"Completed",count:_.length,collapsed:d.has("__completed__"),onToggle:()=>l("__completed__")}),!d.has("__completed__")&&_.map(r=>e.jsx(L,{task:r},r.id))]})]})}),e.jsx(Me,{})]})}export{$e as default};
@@ -1,4 +1,4 @@
1
- import{U as _r,B as Mm,N as xr,C as Yl,V as wn,D as Ot,F as Ff,M as ki,E as ft,R as Tm,G as Yt,H as Vt,I as Uu,J as Rl,W as Du,K as Hr,L as tn,O as fo,Q as ci,T as Sr,X as dr,Y as mo,Z as xo,_ as F_,$ as Ta,a0 as Iu,a1 as ym,a2 as br,a3 as va,a4 as Xt,a5 as Am,a6 as kt,a7 as si,a8 as Cm,a9 as vl,aa as Dr,ab as ma,ac as ba,ad as go,ae as Bi,af as ps,ag as O_,ah as Rm,ai as vo,aj as Vn,ak as wl,al as pa,am as hs,an as wm,ao as Pm,ap as co,aq as Lm,ar as Um,as as Dm,at as Im,au as Nm,av as Fm,aw as Om,ax as km,ay as Bm,az as Gm,aA as zm,aB as Hm,aC as Vm,aD as Wm,aE as jm,aF as Xm,aG as Ym,aH as _l,aI as os,aJ as qm,aK as Fi,aL as Km,aM as Zm,aN as ql,aO as Qm,aP as Kl,aQ as Jm,aR as $m,aS as eg,aT as Of,aU as Ut,aV as kf,aW as Bf,aX as ui,aY as _a,aZ as po,a_ as ho,a$ as li,b0 as ga,b1 as oi,b2 as Gf,b3 as tg,b4 as zf,b5 as Hf,b6 as Vf,b7 as ms,b8 as Wf,b9 as jf,ba as Xf,bb as bo,bc as ng,bd as rg,be as ig,bf as ag,bg as Yf,bh as og,bi as sg,bj as lg,bk as Sl,bl as xl,bm as bl,bn as El,bo as Nu,bp as Fu,bq as Ou,br as ku,bs as Bu,bt as Gu,bu as zu,bv as Hu,bw as Vu,bx as Wu,by as ju,bz as Xu,bA as Yu,bB as qu,bC as Ku,bD as Zu,bE as Qu,bF as Ju,bG as $u,bH as ef,bI as tf,bJ as nf,bK as rf,bL as af,bM as of,bN as sf,bO as lf,bP as cf,bQ as uf,bR as ff,bS as df,bT as pf,bU as Pl,bV as Ll,bW as Ul,bX as Dl,bY as Il,bZ as Nl,b_ as Fl,b$ as cg,c0 as hf,c1 as ug,c2 as cs,c3 as fg,c4 as mf,c5 as gf,c6 as Ol,c7 as kl,c8 as Bl,c9 as qf,ca as Kf,cb as _s,cc as dg,cd as pg,ce as hg,cf as Zf,cg as ph,ch as Qf,ci as Jf,cj as $f,ck as ed,cl as Ss,cm as td,cn as nd,co as rd,cp as hh,cq as id,cr as _o,cs as Ea,ct as ad,cu as mg,cv as gg,cw as k_,cx as vf,cy as Kn,cz as Gl,cA as vg,cB as _g,cC as B_,cD as Sg,cE as xg,cF as bg,cG as od,cH as Eg,cI as Mg,cJ as G_,cK as z_,cL as H_,cM as V_,cN as W_,cO as j_,cP as X_,cQ as Y_,cR as q_,cS as K_,cT as Z_,cU as Q_,cV as J_,cW as $_,cX as eS,cY as tS,cZ as nS,c_ as rS,c$ as iS,d0 as Tg,d1 as aS,d2 as oS,d3 as sS,d4 as lS,d5 as sd,d6 as cS,d7 as uS,d8 as fS,d9 as dS,da as pS,db as hS,dc as mS,dd as gS,de as vS,df as _S,dg as yg,dh as SS,di as xS,dj as bS,dk as ES,dl as MS,dm as TS,dn as yS,dp as AS,dq as CS,dr as RS,ds as wS,dt as PS,du as LS,dv as US,dw as DS,dx as IS,dy as NS,dz as FS,dA as OS,dB as kS,dC as BS,dD as GS,dE as zS,dF as HS,dG as VS,dH as WS,dI as jS,dJ as XS,dK as YS,dL as qS,dM as ua,dN as KS,dO as ZS,dP as QS,dQ as JS,dR as $S,dS as ex,dT as _f,dU as tx,dV as nx,dW as rx,dX as ix,dY as ax,dZ as ox,d_ as sx,d$ as lx,e0 as cx,e1 as ux,e2 as fx,e3 as dx,e4 as px,e5 as hx,e6 as mx,e7 as gx,e8 as Ag,e9 as Cg,ea as vx,eb as _x,ec as Sx,ed as xx,ee as bx,ef as Ex,eg as Mx,eh as Tx,ei as yx,ej as Ax,ek as Cx,el as Rx,em as wx,en as Px,eo as Lx,ep as Ux,eq as Dx,er as Ix,es as Nx,et as Fx,eu as Ox,ev as kx,ew as Rg,ex as Bx,ey as Gx,ez as zx,eA as Hx,eB as wg,eC as Vx,eD as Wx,eE as jx,eF as Xx,eG as Yx,eH as qx,eI as Kx,eJ as Zx,eK as Qx,eL as Jx,eM as $x,eN as fa,eO as eb,eP as tb,eQ as Sf,eR as nb,eS as rb,eT as ib,eU as ab,eV as ob,eW as sb,eX as fr,eY as lb,eZ as cb,e_ as ub,e$ as fb,f0 as db,f1 as pb,f2 as hb,f3 as mb,f4 as gb,f5 as vb,f6 as _b,f7 as Sb,f8 as xb,f9 as bb,fa as Eb,fb as Mb,fc as Tb,fd as yb,fe as Pg,ff as Ab,fg as Cb,fh as Rb,fi as wb,fj as Pb,fk as Lb,fl as Ub,fm as zl,fn as Db,fo as Ib,fp as Lg,fq as Nb,fr as Fb,fs as Ob,ft as Ug,fu as Dg,fv as kb,fw as Bb,fx as Gb,fy as zb,fz as Hb,fA as Ig,fB as Vb,fC as Wb,fD as jb,fE as Xb,fF as Yb,fG as qb,fH as Kb,fI as Zb,fJ as Qb,fK as Ng,fL as Jb,fM as xf,fN as $b,fO as eE,fP as tE,fQ as nE,fR as rE,fS as iE,fT as aE,fU as oE,fV as sE,fW as lE,fX as cE,fY as uE,fZ as fE,f_ as dE,f$ as da,g0 as pE,g1 as hE,g2 as mE,g3 as gE,g4 as vE,g5 as _E,g6 as SE,g7 as xE,g8 as bE,g9 as EE,ga as ME,gb as TE,gc as yE,gd as AE,ge as CE,gf as RE,gg as wE,gh as PE,gi as LE,gj as UE,gk as DE,gl as IE,gm as NE,gn as FE,go as OE,gp as kE,gq as BE,gr as GE,gs as zE,gt as HE,gu as VE,gv as WE,gw as Fg,gx as jE,gy as Og,gz as XE,h as oe,k as Q,gA as ld,gB as YE,gC as qE,gD as fi,gE as oa,gF as kg,gG as KE,gH as ol,gI as mh,gJ as ZE,gK as QE,gL as JE,gM as $E,gN as Zl,gO as sl,gP as Ml,gQ as kn,gR as es,gS as gh,gT as bf,gU as du,gV as e1,gW as t1,gX as n1,gY as r1,gZ as Hl,w as vh,g_ as i1,g$ as a1,h0 as o1,h1 as s1,h2 as l1,h3 as c1,h4 as u1,h5 as f1,h6 as d1}from"./index-CGTrscK-.js";function Bg(){let n=null,r=!1,s=null,l=null;function a(i,f){s(i,f),l=n.requestAnimationFrame(a)}return{start:function(){r!==!0&&s!==null&&(l=n.requestAnimationFrame(a),r=!0)},stop:function(){n.cancelAnimationFrame(l),r=!1},setAnimationLoop:function(i){s=i},setContext:function(i){n=i}}}function p1(n){const r=new WeakMap;function s(u,d){const p=u.array,h=u.usage,v=p.byteLength,S=n.createBuffer();n.bindBuffer(d,S),n.bufferData(d,p,h),u.onUploadCallback();let b;if(p instanceof Float32Array)b=n.FLOAT;else if(typeof Float16Array<"u"&&p instanceof Float16Array)b=n.HALF_FLOAT;else if(p instanceof Uint16Array)u.isFloat16BufferAttribute?b=n.HALF_FLOAT:b=n.UNSIGNED_SHORT;else if(p instanceof Int16Array)b=n.SHORT;else if(p instanceof Uint32Array)b=n.UNSIGNED_INT;else if(p instanceof Int32Array)b=n.INT;else if(p instanceof Int8Array)b=n.BYTE;else if(p instanceof Uint8Array)b=n.UNSIGNED_BYTE;else if(p instanceof Uint8ClampedArray)b=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+p);return{buffer:S,type:b,bytesPerElement:p.BYTES_PER_ELEMENT,version:u.version,size:v}}function l(u,d,p){const h=d.array,v=d.updateRanges;if(n.bindBuffer(p,u),v.length===0)n.bufferSubData(p,0,h);else{v.sort((b,A)=>b.start-A.start);let S=0;for(let b=1;b<v.length;b++){const A=v[S],P=v[b];P.start<=A.start+A.count+1?A.count=Math.max(A.count,P.start+P.count-A.start):(++S,v[S]=P)}v.length=S+1;for(let b=0,A=v.length;b<A;b++){const P=v[b];n.bufferSubData(p,P.start*h.BYTES_PER_ELEMENT,h,P.start,P.count)}d.clearUpdateRanges()}d.onUploadCallback()}function a(u){return u.isInterleavedBufferAttribute&&(u=u.data),r.get(u)}function i(u){u.isInterleavedBufferAttribute&&(u=u.data);const d=r.get(u);d&&(n.deleteBuffer(d.buffer),r.delete(u))}function f(u,d){if(u.isInterleavedBufferAttribute&&(u=u.data),u.isGLBufferAttribute){const h=r.get(u);(!h||h.version<u.version)&&r.set(u,{buffer:u.buffer,type:u.type,bytesPerElement:u.elementSize,version:u.version});return}const p=r.get(u);if(p===void 0)r.set(u,s(u,d));else if(p.version<u.version){if(p.size!==u.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");l(p.buffer,u,d),p.version=u.version}}return{get:a,remove:i,update:f}}var h1=`#ifdef USE_ALPHAHASH
1
+ import{U as _r,B as Mm,N as xr,C as Yl,V as wn,D as Ot,F as Ff,M as ki,E as ft,R as Tm,G as Yt,H as Vt,I as Uu,J as Rl,W as Du,K as Hr,L as tn,O as fo,Q as ci,T as Sr,X as dr,Y as mo,Z as xo,_ as F_,$ as Ta,a0 as Iu,a1 as ym,a2 as br,a3 as va,a4 as Xt,a5 as Am,a6 as kt,a7 as si,a8 as Cm,a9 as vl,aa as Dr,ab as ma,ac as ba,ad as go,ae as Bi,af as ps,ag as O_,ah as Rm,ai as vo,aj as Vn,ak as wl,al as pa,am as hs,an as wm,ao as Pm,ap as co,aq as Lm,ar as Um,as as Dm,at as Im,au as Nm,av as Fm,aw as Om,ax as km,ay as Bm,az as Gm,aA as zm,aB as Hm,aC as Vm,aD as Wm,aE as jm,aF as Xm,aG as Ym,aH as _l,aI as os,aJ as qm,aK as Fi,aL as Km,aM as Zm,aN as ql,aO as Qm,aP as Kl,aQ as Jm,aR as $m,aS as eg,aT as Of,aU as Ut,aV as kf,aW as Bf,aX as ui,aY as _a,aZ as po,a_ as ho,a$ as li,b0 as ga,b1 as oi,b2 as Gf,b3 as tg,b4 as zf,b5 as Hf,b6 as Vf,b7 as ms,b8 as Wf,b9 as jf,ba as Xf,bb as bo,bc as ng,bd as rg,be as ig,bf as ag,bg as Yf,bh as og,bi as sg,bj as lg,bk as Sl,bl as xl,bm as bl,bn as El,bo as Nu,bp as Fu,bq as Ou,br as ku,bs as Bu,bt as Gu,bu as zu,bv as Hu,bw as Vu,bx as Wu,by as ju,bz as Xu,bA as Yu,bB as qu,bC as Ku,bD as Zu,bE as Qu,bF as Ju,bG as $u,bH as ef,bI as tf,bJ as nf,bK as rf,bL as af,bM as of,bN as sf,bO as lf,bP as cf,bQ as uf,bR as ff,bS as df,bT as pf,bU as Pl,bV as Ll,bW as Ul,bX as Dl,bY as Il,bZ as Nl,b_ as Fl,b$ as cg,c0 as hf,c1 as ug,c2 as cs,c3 as fg,c4 as mf,c5 as gf,c6 as Ol,c7 as kl,c8 as Bl,c9 as qf,ca as Kf,cb as _s,cc as dg,cd as pg,ce as hg,cf as Zf,cg as ph,ch as Qf,ci as Jf,cj as $f,ck as ed,cl as Ss,cm as td,cn as nd,co as rd,cp as hh,cq as id,cr as _o,cs as Ea,ct as ad,cu as mg,cv as gg,cw as k_,cx as vf,cy as Kn,cz as Gl,cA as vg,cB as _g,cC as B_,cD as Sg,cE as xg,cF as bg,cG as od,cH as Eg,cI as Mg,cJ as G_,cK as z_,cL as H_,cM as V_,cN as W_,cO as j_,cP as X_,cQ as Y_,cR as q_,cS as K_,cT as Z_,cU as Q_,cV as J_,cW as $_,cX as eS,cY as tS,cZ as nS,c_ as rS,c$ as iS,d0 as Tg,d1 as aS,d2 as oS,d3 as sS,d4 as lS,d5 as sd,d6 as cS,d7 as uS,d8 as fS,d9 as dS,da as pS,db as hS,dc as mS,dd as gS,de as vS,df as _S,dg as yg,dh as SS,di as xS,dj as bS,dk as ES,dl as MS,dm as TS,dn as yS,dp as AS,dq as CS,dr as RS,ds as wS,dt as PS,du as LS,dv as US,dw as DS,dx as IS,dy as NS,dz as FS,dA as OS,dB as kS,dC as BS,dD as GS,dE as zS,dF as HS,dG as VS,dH as WS,dI as jS,dJ as XS,dK as YS,dL as qS,dM as ua,dN as KS,dO as ZS,dP as QS,dQ as JS,dR as $S,dS as ex,dT as _f,dU as tx,dV as nx,dW as rx,dX as ix,dY as ax,dZ as ox,d_ as sx,d$ as lx,e0 as cx,e1 as ux,e2 as fx,e3 as dx,e4 as px,e5 as hx,e6 as mx,e7 as gx,e8 as Ag,e9 as Cg,ea as vx,eb as _x,ec as Sx,ed as xx,ee as bx,ef as Ex,eg as Mx,eh as Tx,ei as yx,ej as Ax,ek as Cx,el as Rx,em as wx,en as Px,eo as Lx,ep as Ux,eq as Dx,er as Ix,es as Nx,et as Fx,eu as Ox,ev as kx,ew as Rg,ex as Bx,ey as Gx,ez as zx,eA as Hx,eB as wg,eC as Vx,eD as Wx,eE as jx,eF as Xx,eG as Yx,eH as qx,eI as Kx,eJ as Zx,eK as Qx,eL as Jx,eM as $x,eN as fa,eO as eb,eP as tb,eQ as Sf,eR as nb,eS as rb,eT as ib,eU as ab,eV as ob,eW as sb,eX as fr,eY as lb,eZ as cb,e_ as ub,e$ as fb,f0 as db,f1 as pb,f2 as hb,f3 as mb,f4 as gb,f5 as vb,f6 as _b,f7 as Sb,f8 as xb,f9 as bb,fa as Eb,fb as Mb,fc as Tb,fd as yb,fe as Pg,ff as Ab,fg as Cb,fh as Rb,fi as wb,fj as Pb,fk as Lb,fl as Ub,fm as zl,fn as Db,fo as Ib,fp as Lg,fq as Nb,fr as Fb,fs as Ob,ft as Ug,fu as Dg,fv as kb,fw as Bb,fx as Gb,fy as zb,fz as Hb,fA as Ig,fB as Vb,fC as Wb,fD as jb,fE as Xb,fF as Yb,fG as qb,fH as Kb,fI as Zb,fJ as Qb,fK as Ng,fL as Jb,fM as xf,fN as $b,fO as eE,fP as tE,fQ as nE,fR as rE,fS as iE,fT as aE,fU as oE,fV as sE,fW as lE,fX as cE,fY as uE,fZ as fE,f_ as dE,f$ as da,g0 as pE,g1 as hE,g2 as mE,g3 as gE,g4 as vE,g5 as _E,g6 as SE,g7 as xE,g8 as bE,g9 as EE,ga as ME,gb as TE,gc as yE,gd as AE,ge as CE,gf as RE,gg as wE,gh as PE,gi as LE,gj as UE,gk as DE,gl as IE,gm as NE,gn as FE,go as OE,gp as kE,gq as BE,gr as GE,gs as zE,gt as HE,gu as VE,gv as WE,gw as Fg,gx as jE,gy as Og,gz as XE,h as oe,k as Q,gA as ld,gB as YE,gC as qE,gD as fi,gE as oa,gF as kg,gG as KE,gH as ol,gI as mh,gJ as ZE,gK as QE,gL as JE,gM as $E,gN as Zl,gO as sl,gP as Ml,gQ as kn,gR as es,gS as gh,gT as bf,gU as du,gV as e1,gW as t1,gX as n1,gY as r1,gZ as Hl,w as vh,g_ as i1,g$ as a1,h0 as o1,h1 as s1,h2 as l1,h3 as c1,h4 as u1,h5 as f1,h6 as d1}from"./index-DMLiHQ-O.js";function Bg(){let n=null,r=!1,s=null,l=null;function a(i,f){s(i,f),l=n.requestAnimationFrame(a)}return{start:function(){r!==!0&&s!==null&&(l=n.requestAnimationFrame(a),r=!0)},stop:function(){n.cancelAnimationFrame(l),r=!1},setAnimationLoop:function(i){s=i},setContext:function(i){n=i}}}function p1(n){const r=new WeakMap;function s(u,d){const p=u.array,h=u.usage,v=p.byteLength,S=n.createBuffer();n.bindBuffer(d,S),n.bufferData(d,p,h),u.onUploadCallback();let b;if(p instanceof Float32Array)b=n.FLOAT;else if(typeof Float16Array<"u"&&p instanceof Float16Array)b=n.HALF_FLOAT;else if(p instanceof Uint16Array)u.isFloat16BufferAttribute?b=n.HALF_FLOAT:b=n.UNSIGNED_SHORT;else if(p instanceof Int16Array)b=n.SHORT;else if(p instanceof Uint32Array)b=n.UNSIGNED_INT;else if(p instanceof Int32Array)b=n.INT;else if(p instanceof Int8Array)b=n.BYTE;else if(p instanceof Uint8Array)b=n.UNSIGNED_BYTE;else if(p instanceof Uint8ClampedArray)b=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+p);return{buffer:S,type:b,bytesPerElement:p.BYTES_PER_ELEMENT,version:u.version,size:v}}function l(u,d,p){const h=d.array,v=d.updateRanges;if(n.bindBuffer(p,u),v.length===0)n.bufferSubData(p,0,h);else{v.sort((b,A)=>b.start-A.start);let S=0;for(let b=1;b<v.length;b++){const A=v[S],P=v[b];P.start<=A.start+A.count+1?A.count=Math.max(A.count,P.start+P.count-A.start):(++S,v[S]=P)}v.length=S+1;for(let b=0,A=v.length;b<A;b++){const P=v[b];n.bufferSubData(p,P.start*h.BYTES_PER_ELEMENT,h,P.start,P.count)}d.clearUpdateRanges()}d.onUploadCallback()}function a(u){return u.isInterleavedBufferAttribute&&(u=u.data),r.get(u)}function i(u){u.isInterleavedBufferAttribute&&(u=u.data);const d=r.get(u);d&&(n.deleteBuffer(d.buffer),r.delete(u))}function f(u,d){if(u.isInterleavedBufferAttribute&&(u=u.data),u.isGLBufferAttribute){const h=r.get(u);(!h||h.version<u.version)&&r.set(u,{buffer:u.buffer,type:u.type,bytesPerElement:u.elementSize,version:u.version});return}const p=r.get(u);if(p===void 0)r.set(u,s(u,d));else if(p.version<u.version){if(p.size!==u.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");l(p.buffer,u,d),p.version=u.version}}return{get:a,remove:i,update:f}}var h1=`#ifdef USE_ALPHAHASH
2
2
  if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
3
3
  #endif`,m1=`#ifdef USE_ALPHAHASH
4
4
  const float ALPHA_HASH_SCALE = 0.05;
@@ -1 +1 @@
1
- import{S as ae,p as G,r as g,s as F,a as R,n as U,i as Q,b as W,t as ie,c as D,f as ne,d as re,e as z,g as X,h as v,j as Y,u as ee,k as s,l as C,m as M,o as oe,q as k}from"./index-CGTrscK-.js";var le=class extends ae{constructor(e,t){super(),this.options=t,this.#s=e,this.#i=null,this.#a=G(),this.bindMethods(),this.setOptions(t)}#s;#e=void 0;#m=void 0;#t=void 0;#r;#d;#a;#i;#f;#u;#h;#o;#l;#n;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),K(this.#e,this.options)?this.#c():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return L(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return L(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#g(),this.#x(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,a=this.#e;if(this.options=this.#s.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof g(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#e.setOptions(this.options),t._defaulted&&!F(this.options,t)&&this.#s.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&V(this.#e,a,this.options,t)&&this.#c(),this.updateResult(),r&&(this.#e!==a||g(this.options.enabled,this.#e)!==g(t.enabled,this.#e)||R(this.options.staleTime,this.#e)!==R(t.staleTime,this.#e))&&this.#v();const n=this.#_();r&&(this.#e!==a||g(this.options.enabled,this.#e)!==g(t.enabled,this.#e)||n!==this.#n)&&this.#y(n)}getOptimisticResult(e){const t=this.#s.getQueryCache().build(this.#s,e),a=this.createResult(t,e);return de(this,a)&&(this.#t=a,this.#d=this.options,this.#r=this.#e.state),a}getCurrentResult(){return this.#t}trackResult(e,t){return new Proxy(e,{get:(a,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#s.defaultQueryOptions(e),a=this.#s.getQueryCache().build(this.#s,t);return a.fetch().then(()=>this.createResult(a,t))}fetch(e){return this.#c({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#t))}#c(e){this.#j();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(U)),t}#v(){this.#g();const e=R(this.options.staleTime,this.#e);if(Q||this.#t.isStale||!W(e))return;const a=ie(this.#t.dataUpdatedAt,e)+1;this.#o=D.setTimeout(()=>{this.#t.isStale||this.updateResult()},a)}#_(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#n=e,!(Q||g(this.options.enabled,this.#e)===!1||!W(this.#n)||this.#n===0)&&(this.#l=D.setInterval(()=>{(this.options.refetchIntervalInBackground||ne.isFocused())&&this.#c()},this.#n))}#b(){this.#v(),this.#y(this.#_())}#g(){this.#o&&(D.clearTimeout(this.#o),this.#o=void 0)}#x(){this.#l&&(D.clearInterval(this.#l),this.#l=void 0)}createResult(e,t){const a=this.#e,r=this.options,n=this.#t,h=this.#r,o=this.#d,f=e!==a?e.state:this.#m,{state:d}=e;let u={...d},x=!1,p;if(t._optimisticResults){const b=this.hasListeners(),w=!b&&K(e,t),E=b&&V(e,a,t,r);(w||E)&&(u={...u,...re(d.data,e.options)}),t._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:c,errorUpdatedAt:_,status:l}=u;p=u.data;let y=!1;if(t.placeholderData!==void 0&&p===void 0&&l==="pending"){let b;n?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(b=n.data,y=!0):b=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,b!==void 0&&(l="success",p=z(n?.data,b,t),x=!0)}if(t.select&&p!==void 0&&!y)if(n&&p===h?.data&&t.select===this.#f)p=this.#u;else try{this.#f=t.select,p=t.select(p),p=z(n?.data,p,t),this.#u=p,this.#i=null}catch(b){this.#i=b}this.#i&&(c=this.#i,p=this.#u,_=Date.now(),l="error");const j=u.fetchStatus==="fetching",T=l==="pending",I=l==="error",$=T&&j,H=p!==void 0,S={status:l,fetchStatus:u.fetchStatus,isPending:T,isSuccess:l==="success",isError:I,isInitialLoading:$,isLoading:$,data:p,dataUpdatedAt:u.dataUpdatedAt,error:c,errorUpdatedAt:_,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>f.dataUpdateCount||u.errorUpdateCount>f.errorUpdateCount,isFetching:j,isRefetching:j&&!T,isLoadingError:I&&!H,isPaused:u.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:I&&H,isStale:A(e,t),refetch:this.refetch,promise:this.#a,isEnabled:g(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const b=S.data!==void 0,w=S.status==="error"&&!b,E=B=>{w?B.reject(S.error):b&&B.resolve(S.data)},q=()=>{const B=this.#a=S.promise=G();E(B)},N=this.#a;switch(N.status){case"pending":e.queryHash===a.queryHash&&E(N);break;case"fulfilled":(w||S.data!==N.value)&&q();break;case"rejected":(!w||S.error!==N.reason)&&q();break}}return S}updateResult(){const e=this.#t,t=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#d=this.options,this.#r.data!==void 0&&(this.#h=this.#e),F(t,e))return;this.#t=t;const a=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,n=typeof r=="function"?r():r;if(n==="all"||!n&&!this.#p.size)return!0;const h=new Set(n??this.#p);return this.options.throwOnError&&h.add("error"),Object.keys(this.#t).some(o=>{const m=o;return this.#t[m]!==e[m]&&h.has(m)})};this.#S({listeners:a()})}#j(){const e=this.#s.getQueryCache().build(this.#s,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#m=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#S(e){X.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#t)}),this.#s.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function ce(e,t){return g(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function K(e,t){return ce(e,t)||e.state.data!==void 0&&L(e,t,t.refetchOnMount)}function L(e,t,a){if(g(t.enabled,e)!==!1&&R(t.staleTime,e)!=="static"){const r=typeof a=="function"?a(e):a;return r==="always"||r!==!1&&A(e,t)}return!1}function V(e,t,a,r){return(e!==t||g(r.enabled,e)===!1)&&(!a.suspense||e.state.status!=="error")&&A(e,a)}function A(e,t){return g(t.enabled,e)!==!1&&e.isStaleByTime(R(t.staleTime,e))}function de(e,t){return!F(e.getCurrentResult(),t)}var te=v.createContext(!1),ue=()=>v.useContext(te);te.Provider;function he(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var pe=v.createContext(he()),me=()=>v.useContext(pe),fe=(e,t,a)=>{const r=a?.state.error&&typeof e.throwOnError=="function"?Y(e.throwOnError,[a.state.error,a]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},ve=e=>{v.useEffect(()=>{e.clearReset()},[e])},_e=({result:e,errorResetBoundary:t,throwOnError:a,query:r,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(n&&e.data===void 0||Y(a,[e.error,r])),ye=e=>{if(e.suspense){const a=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>a(r(...n)):a(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},be=(e,t)=>e.isLoading&&e.isFetching&&!t,ge=(e,t)=>e?.suspense&&t.isPending,Z=(e,t,a)=>t.fetchOptimistic(e).catch(()=>{a.clearReset()});function xe(e,t,a){const r=ue(),n=me(),h=ee(),o=h.defaultQueryOptions(e);h.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const m=h.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",ye(o),fe(o,n,m),ve(n);const f=!h.getQueryCache().get(o.queryHash),[d]=v.useState(()=>new t(h,o)),u=d.getOptimisticResult(o),x=!r&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(p=>{const c=x?d.subscribe(X.batchCalls(p)):U;return d.updateResult(),c},[d,x]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),v.useEffect(()=>{d.setOptions(o)},[o,d]),ge(o,u))throw Z(o,d,n);if(_e({result:u,errorResetBoundary:n,throwOnError:o.throwOnError,query:m,suspense:o.suspense}))throw u.error;return h.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!Q&&be(u,r)&&(f?Z(o,d,n):m?.promise)?.catch(U).finally(()=>{d.updateResult()}),o.notifyOnChangeProps?u:d.trackResult(u)}function P(e,t){return xe(e,le)}function je({tabs:e,activeTab:t,onTabChange:a,containerClassName:r,panelClassName:n,tabListClassName:h,tabClassName:o,activeTabClassName:m}){return s.jsxs("div",{className:r,children:[s.jsx("div",{role:"tablist",className:h,style:h?void 0:{display:"flex",gap:"2px",borderBottom:"1px solid var(--border-subtle, rgba(255,255,255,0.06))",marginBottom:"12px"},children:e.map(f=>{const d=t===f.id,u=[o,d&&m].filter(Boolean).join(" ");return s.jsx("button",{role:"tab","aria-selected":d,onClick:()=>a(f.id),className:u||void 0,style:u?void 0:{padding:"8px 16px",background:d?"var(--bg-accent, rgba(0,229,255,0.1))":"transparent",border:"none",borderBottom:d?"2px solid var(--accent-cyan, #00e5ff)":"2px solid transparent",color:d?"var(--accent-cyan, #00e5ff)":"var(--text-secondary, #8888aa)",cursor:"pointer",fontSize:"0.85rem",fontFamily:"var(--font-mono, monospace)",transition:"color 0.15s, background 0.15s"},children:f.label},f.id)})}),s.jsx("div",{role:"tabpanel",className:n,children:e.find(f=>f.id===t)?.content})]})}const Se="_container_1uen7_5",Te="_filters_1uen7_15",we="_filterGroup_1uen7_22",Ce="_filterLabel_1uen7_28",Re="_filterInput_1uen7_36",Ee="_sortToggle_1uen7_54",Ne="_results_1uen7_72",Be="_emptyState_1uen7_80",De="_row_1uen7_89",Oe="_rowTitle_1uen7_107",Ie="_rowProject_1uen7_115",Me="_rowDate_1uen7_123",ke="_rowDuration_1uen7_129",Pe="_rowStatus_1uen7_135",Fe="_rowMeta_1uen7_165",Ue="_resumeBtn_1uen7_171",Qe="_deleteBtn_1uen7_189",Le="_pagination_1uen7_207",Ae="_pageBtn_1uen7_215",$e="_pageBtnActive_1uen7_236",He="_pageEllipsis_1uen7_242",qe="_detailOverlay_1uen7_249",Ge="_detailCard_1uen7_259",We="_detailTabs_1uen7_273",ze="_detailTabPanel_1uen7_281",Ke="_detailHeader_1uen7_289",Ve="_detailTitle_1uen7_296",Ze="_detailMeta_1uen7_302",Je="_detailCloseBtn_1uen7_309",Xe="_detailBody_1uen7_322",Ye="_convoEntry_1uen7_327",et="_convoEntryHeader_1uen7_335",tt="_copyBtn_1uen7_342",st="_convoPrompt_1uen7_364",at="_convoResponse_1uen7_369",it="_convoTime_1uen7_374",nt="_convoText_1uen7_380",rt="_activityEntry_1uen7_387",ot="_activityTime_1uen7_395",lt="_activityBadge_1uen7_401",ct="_activityBadgeTool_1uen7_410",dt="_activityBadgeEvent_1uen7_415",ut="_activityDetail_1uen7_420",i={container:Se,filters:Te,filterGroup:we,filterLabel:Ce,filterInput:Re,sortToggle:Ee,results:Ne,emptyState:Be,row:De,rowTitle:Oe,rowProject:Ie,rowDate:Me,rowDuration:ke,rowStatus:Pe,rowMeta:Fe,resumeBtn:Ue,deleteBtn:Qe,pagination:Le,pageBtn:Ae,pageBtnActive:$e,pageEllipsis:He,detailOverlay:qe,detailCard:Ge,detailTabs:We,detailTabPanel:ze,detailHeader:Ke,detailTitle:Ve,detailMeta:Ze,detailCloseBtn:Je,detailBody:Xe,convoEntry:Ye,convoEntryHeader:et,copyBtn:tt,convoPrompt:st,convoResponse:at,convoTime:it,convoText:nt,activityEntry:rt,activityTime:ot,activityBadge:lt,activityBadgeTool:ct,activityBadgeEvent:dt,activityDetail:ut},se=50;function O(e){if(e<1e3)return"<1s";const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const a=Math.floor(t/60);return a<60?`${a}m ${t%60}s`:`${Math.floor(a/60)}h ${a%60}m`}function ht(e){return e?new Date(e).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}):"--"}function J(e){return new Date(e).toLocaleTimeString("en-US",{hour12:!1})}function pt(e){const t=new URLSearchParams;e.query&&t.set("query",e.query),e.project&&t.set("project",e.project),e.status==="archived"?t.set("archived","true"):e.status&&t.set("status",e.status),e.dateFrom&&t.set("dateFrom",String(new Date(e.dateFrom).getTime())),e.dateTo&&t.set("dateTo",String(new Date(e.dateTo+"T23:59:59").getTime()));const a={date:"started_at",duration:"last_activity_at",prompts:"started_at",tools:"started_at"};return t.set("sortBy",a[e.sortBy]||"started_at"),t.set("sortDir",e.sortDir),t.set("page",String(e.page)),t.set("pageSize",String(se)),t.toString()}function xt(){const e=ee(),[t,a]=v.useState({query:"",project:"",status:"",dateFrom:"",dateTo:"",sortBy:"date",sortDir:"desc",page:1}),[r,n]=v.useState(null),{data:h}=P({queryKey:["db-projects"],queryFn:async()=>{const l=await C("/api/db/projects");if(!l.ok)throw new Error("Failed to load projects");return l.json()},staleTime:6e4}),{data:o,isLoading:m}=P({queryKey:["db-sessions",t],queryFn:async()=>{const l=await C(`/api/db/sessions?${pt(t)}`);if(!l.ok)throw new Error("Failed to load sessions");return l.json()}}),{data:f}=P({queryKey:["db-session-detail",r],queryFn:async()=>{if(!r)return null;const l=await C(`/api/db/sessions/${encodeURIComponent(r)}`);if(!l.ok)throw new Error("Failed to load session detail");return l.json()},enabled:!!r}),d=v.useCallback((l,y)=>{a(j=>({...j,[l]:y,page:l==="page"?y:1}))},[]),u=v.useCallback(async(l,y)=>{l.stopPropagation(),window.confirm("Delete this session from history? This cannot be undone.")&&(await C(`/api/db/sessions/${encodeURIComponent(y)}`,{method:"DELETE"}),e.invalidateQueries({queryKey:["db-sessions"]}))},[e]),x=v.useCallback(async(l,y)=>{l.stopPropagation();try{const T=await(await C(`/api/sessions/${encodeURIComponent(y)}/resume`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();T.ok?M("Resuming Claude session in terminal","success"):M(T.error||"Resume failed","error")}catch(j){M(j.message,"error")}},[]),p=o?.sessions??[],c=o?.total??0,_=Math.ceil(c/se);return s.jsxs("div",{className:i.container,"data-testid":"history-view",children:[s.jsxs("div",{className:i.filters,children:[s.jsx(oe,{value:t.query,onChange:l=>d("query",l),placeholder:"Search prompts..."}),s.jsxs("div",{className:i.filterGroup,children:[s.jsx("span",{className:i.filterLabel,children:"Project"}),s.jsx(k,{value:t.project,onChange:l=>d("project",l),options:[{value:"",label:"All"},...h?.map(l=>({value:l.project_path,label:l.project_name}))??[]]})]}),s.jsxs("div",{className:i.filterGroup,children:[s.jsx("span",{className:i.filterLabel,children:"Status"}),s.jsx(k,{value:t.status,onChange:l=>d("status",l),options:[{value:"",label:"All"},{value:"idle",label:"Idle"},{value:"working",label:"Working"},{value:"waiting",label:"Waiting"},{value:"ended",label:"Ended"},{value:"archived",label:"Archived"}]})]}),s.jsxs("div",{className:i.filterGroup,children:[s.jsx("span",{className:i.filterLabel,children:"From"}),s.jsx("input",{type:"date",className:i.filterInput,value:t.dateFrom,onChange:l=>d("dateFrom",l.target.value)})]}),s.jsxs("div",{className:i.filterGroup,children:[s.jsx("span",{className:i.filterLabel,children:"To"}),s.jsx("input",{type:"date",className:i.filterInput,value:t.dateTo,onChange:l=>d("dateTo",l.target.value)})]}),s.jsxs("div",{className:i.filterGroup,children:[s.jsx("span",{className:i.filterLabel,children:"Sort"}),s.jsx(k,{value:t.sortBy,onChange:l=>d("sortBy",l),options:[{value:"date",label:"Date"},{value:"duration",label:"Activity"},{value:"prompts",label:"Prompts"},{value:"tools",label:"Tools"}]}),s.jsx("button",{className:i.sortToggle,onClick:()=>d("sortDir",t.sortDir==="desc"?"asc":"desc"),children:t.sortDir.toUpperCase()})]})]}),s.jsxs("div",{className:i.results,children:[m&&s.jsx("div",{className:i.emptyState,children:"Loading..."}),!m&&p.length===0&&s.jsx("div",{className:i.emptyState,children:"No sessions found"}),p.map(l=>s.jsx(ft,{session:l,onClick:()=>n(l.id),onResume:y=>x(y,l.id),onDelete:y=>u(y,l.id)},l.id))]}),_>1&&s.jsx(vt,{currentPage:t.page,totalPages:_,onPageChange:l=>d("page",l)}),r&&f&&s.jsx(yt,{detail:f,onClose:()=>n(null)})]})}function mt(){return s.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("polyline",{points:"1 4 1 10 7 10"}),s.jsx("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]})}function ft({session:e,onClick:t,onResume:a,onDelete:r}){const n=e.ended_at&&e.started_at?O(e.ended_at-e.started_at):e.started_at?O(Date.now()-e.started_at):"--";return s.jsxs("div",{className:i.row,onClick:t,children:[s.jsx("span",{className:i.rowTitle,children:e.title||e.project_name||e.id}),s.jsx("span",{className:i.rowProject,children:e.project_name}),s.jsx("span",{className:i.rowDate,children:ht(e.started_at)}),s.jsx("span",{className:i.rowDuration,children:n}),s.jsx("span",{className:i.rowStatus,"data-status":e.status,children:e.status.toUpperCase()}),s.jsxs("span",{className:i.rowMeta,children:[e.total_prompts," prompts"]}),s.jsxs("span",{className:i.rowMeta,children:[e.total_tool_calls," tools"]}),s.jsx("button",{className:i.resumeBtn,onClick:a,title:"Resume session","aria-label":"Resume session",children:s.jsx(mt,{})}),s.jsx("button",{className:i.deleteBtn,onClick:r,title:"Delete session","aria-label":"Delete session",children:"x"})]})}function vt({currentPage:e,totalPages:t,onPageChange:a}){const r=[];for(let o=1;o<=t;o++)(o===1||o===t||o>=e-2&&o<=e+2)&&r.push(o);const n=[];let h=0;for(const o of r)typeof o=="number"&&(h&&o-h>1&&n.push("ellipsis"),n.push(o),h=o);return s.jsxs("div",{className:i.pagination,children:[s.jsx("button",{className:i.pageBtn,disabled:e<=1,onClick:()=>a(e-1),children:"Prev"}),n.map((o,m)=>o==="ellipsis"?s.jsx("span",{className:i.pageEllipsis,children:"..."},`e-${m}`):s.jsx("button",{className:`${i.pageBtn} ${o===e?i.pageBtnActive:""}`,onClick:()=>a(o),children:o},o)),s.jsx("button",{className:i.pageBtn,disabled:e>=t,onClick:()=>a(e+1),children:"Next"})]})}function _t({text:e}){const[t,a]=v.useState(!1),r=n=>{n.stopPropagation(),navigator.clipboard.writeText(e).then(()=>{a(!0),setTimeout(()=>a(!1),1500)})};return s.jsx("button",{className:i.copyBtn,onClick:r,"aria-label":"Copy to clipboard",title:"Copy to clipboard",children:t?"✓":"⎘"})}function yt({detail:e,onClose:t}){const[a,r]=v.useState("conversation"),{session:n,prompts:h,responses:o,tool_calls:m,events:f}=e,d=[...h.map(c=>({type:"prompt",timestamp:c.timestamp,text:c.text})),...o.map(c=>({type:"response",timestamp:c.timestamp,text:c.text_excerpt}))].sort((c,_)=>c.timestamp-_.timestamp),u=[...m.map(c=>({kind:"tool",label:c.tool_name,detail:c.tool_input_summary,timestamp:c.timestamp})),...f.map(c=>({kind:"event",label:c.event_type,detail:c.detail,timestamp:c.timestamp}))].sort((c,_)=>_.timestamp-c.timestamp),x=n.ended_at&&n.started_at?O(n.ended_at-n.started_at):n.started_at?O(Date.now()-n.started_at):"--",p=[{id:"conversation",label:`Conversation (${d.length})`,content:s.jsxs("div",{className:i.detailBody,children:[d.length===0&&s.jsx("div",{className:i.emptyState,children:"No conversation recorded"}),d.map((c,_)=>s.jsxs("div",{className:`${i.convoEntry} ${c.type==="prompt"?i.convoPrompt:i.convoResponse}`,children:[s.jsxs("div",{className:i.convoEntryHeader,children:[s.jsx("div",{className:i.convoTime,children:J(c.timestamp)}),s.jsx(_t,{text:c.text})]}),s.jsx("div",{className:i.convoText,children:c.text})]},_))]})},{id:"activity",label:`Activity (${u.length})`,content:s.jsxs("div",{className:i.detailBody,children:[u.length===0&&s.jsx("div",{className:i.emptyState,children:"No activity recorded"}),u.map((c,_)=>s.jsxs("div",{className:i.activityEntry,children:[s.jsx("span",{className:i.activityTime,children:J(c.timestamp)}),s.jsx("span",{className:`${i.activityBadge} ${c.kind==="tool"?i.activityBadgeTool:i.activityBadgeEvent}`,children:c.label}),s.jsx("span",{className:i.activityDetail,children:c.detail})]},_))]})}];return s.jsx("div",{className:i.detailOverlay,onClick:t,children:s.jsxs("div",{className:i.detailCard,onClick:c=>c.stopPropagation(),children:[s.jsxs("div",{className:i.detailHeader,children:[s.jsxs("div",{children:[s.jsx("h2",{className:i.detailTitle,children:n.project_name||n.id}),s.jsxs("div",{className:i.detailMeta,children:[s.jsxs("span",{children:["Status: ",n.status.toUpperCase()]}),s.jsxs("span",{children:["Model: ",n.model||"--"]}),s.jsxs("span",{children:["Duration: ",x]}),s.jsxs("span",{children:[n.total_prompts," prompts / ",n.total_tool_calls," tools"]})]})]}),s.jsx("button",{className:i.detailCloseBtn,onClick:t,"aria-label":"Close",children:"x"})]}),s.jsx(je,{tabs:p,activeTab:a,onTabChange:r,containerClassName:i.detailTabs,panelClassName:i.detailTabPanel})]})})}export{xt as default};
1
+ import{S as ae,p as G,r as g,s as F,a as R,n as U,i as Q,b as W,t as ie,c as D,f as ne,d as re,e as z,g as X,h as v,j as Y,u as ee,k as s,l as C,m as M,o as oe,q as k}from"./index-DMLiHQ-O.js";var le=class extends ae{constructor(e,t){super(),this.options=t,this.#s=e,this.#i=null,this.#a=G(),this.bindMethods(),this.setOptions(t)}#s;#e=void 0;#m=void 0;#t=void 0;#r;#d;#a;#i;#f;#u;#h;#o;#l;#n;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),K(this.#e,this.options)?this.#c():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return L(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return L(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#g(),this.#x(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,a=this.#e;if(this.options=this.#s.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof g(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#e.setOptions(this.options),t._defaulted&&!F(this.options,t)&&this.#s.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&V(this.#e,a,this.options,t)&&this.#c(),this.updateResult(),r&&(this.#e!==a||g(this.options.enabled,this.#e)!==g(t.enabled,this.#e)||R(this.options.staleTime,this.#e)!==R(t.staleTime,this.#e))&&this.#v();const n=this.#_();r&&(this.#e!==a||g(this.options.enabled,this.#e)!==g(t.enabled,this.#e)||n!==this.#n)&&this.#y(n)}getOptimisticResult(e){const t=this.#s.getQueryCache().build(this.#s,e),a=this.createResult(t,e);return de(this,a)&&(this.#t=a,this.#d=this.options,this.#r=this.#e.state),a}getCurrentResult(){return this.#t}trackResult(e,t){return new Proxy(e,{get:(a,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#s.defaultQueryOptions(e),a=this.#s.getQueryCache().build(this.#s,t);return a.fetch().then(()=>this.createResult(a,t))}fetch(e){return this.#c({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#t))}#c(e){this.#j();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(U)),t}#v(){this.#g();const e=R(this.options.staleTime,this.#e);if(Q||this.#t.isStale||!W(e))return;const a=ie(this.#t.dataUpdatedAt,e)+1;this.#o=D.setTimeout(()=>{this.#t.isStale||this.updateResult()},a)}#_(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#n=e,!(Q||g(this.options.enabled,this.#e)===!1||!W(this.#n)||this.#n===0)&&(this.#l=D.setInterval(()=>{(this.options.refetchIntervalInBackground||ne.isFocused())&&this.#c()},this.#n))}#b(){this.#v(),this.#y(this.#_())}#g(){this.#o&&(D.clearTimeout(this.#o),this.#o=void 0)}#x(){this.#l&&(D.clearInterval(this.#l),this.#l=void 0)}createResult(e,t){const a=this.#e,r=this.options,n=this.#t,h=this.#r,o=this.#d,f=e!==a?e.state:this.#m,{state:d}=e;let u={...d},x=!1,p;if(t._optimisticResults){const b=this.hasListeners(),w=!b&&K(e,t),E=b&&V(e,a,t,r);(w||E)&&(u={...u,...re(d.data,e.options)}),t._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:c,errorUpdatedAt:_,status:l}=u;p=u.data;let y=!1;if(t.placeholderData!==void 0&&p===void 0&&l==="pending"){let b;n?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(b=n.data,y=!0):b=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,b!==void 0&&(l="success",p=z(n?.data,b,t),x=!0)}if(t.select&&p!==void 0&&!y)if(n&&p===h?.data&&t.select===this.#f)p=this.#u;else try{this.#f=t.select,p=t.select(p),p=z(n?.data,p,t),this.#u=p,this.#i=null}catch(b){this.#i=b}this.#i&&(c=this.#i,p=this.#u,_=Date.now(),l="error");const j=u.fetchStatus==="fetching",T=l==="pending",I=l==="error",$=T&&j,H=p!==void 0,S={status:l,fetchStatus:u.fetchStatus,isPending:T,isSuccess:l==="success",isError:I,isInitialLoading:$,isLoading:$,data:p,dataUpdatedAt:u.dataUpdatedAt,error:c,errorUpdatedAt:_,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>f.dataUpdateCount||u.errorUpdateCount>f.errorUpdateCount,isFetching:j,isRefetching:j&&!T,isLoadingError:I&&!H,isPaused:u.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:I&&H,isStale:A(e,t),refetch:this.refetch,promise:this.#a,isEnabled:g(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const b=S.data!==void 0,w=S.status==="error"&&!b,E=B=>{w?B.reject(S.error):b&&B.resolve(S.data)},q=()=>{const B=this.#a=S.promise=G();E(B)},N=this.#a;switch(N.status){case"pending":e.queryHash===a.queryHash&&E(N);break;case"fulfilled":(w||S.data!==N.value)&&q();break;case"rejected":(!w||S.error!==N.reason)&&q();break}}return S}updateResult(){const e=this.#t,t=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#d=this.options,this.#r.data!==void 0&&(this.#h=this.#e),F(t,e))return;this.#t=t;const a=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,n=typeof r=="function"?r():r;if(n==="all"||!n&&!this.#p.size)return!0;const h=new Set(n??this.#p);return this.options.throwOnError&&h.add("error"),Object.keys(this.#t).some(o=>{const m=o;return this.#t[m]!==e[m]&&h.has(m)})};this.#S({listeners:a()})}#j(){const e=this.#s.getQueryCache().build(this.#s,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#m=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#S(e){X.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#t)}),this.#s.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function ce(e,t){return g(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function K(e,t){return ce(e,t)||e.state.data!==void 0&&L(e,t,t.refetchOnMount)}function L(e,t,a){if(g(t.enabled,e)!==!1&&R(t.staleTime,e)!=="static"){const r=typeof a=="function"?a(e):a;return r==="always"||r!==!1&&A(e,t)}return!1}function V(e,t,a,r){return(e!==t||g(r.enabled,e)===!1)&&(!a.suspense||e.state.status!=="error")&&A(e,a)}function A(e,t){return g(t.enabled,e)!==!1&&e.isStaleByTime(R(t.staleTime,e))}function de(e,t){return!F(e.getCurrentResult(),t)}var te=v.createContext(!1),ue=()=>v.useContext(te);te.Provider;function he(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var pe=v.createContext(he()),me=()=>v.useContext(pe),fe=(e,t,a)=>{const r=a?.state.error&&typeof e.throwOnError=="function"?Y(e.throwOnError,[a.state.error,a]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},ve=e=>{v.useEffect(()=>{e.clearReset()},[e])},_e=({result:e,errorResetBoundary:t,throwOnError:a,query:r,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(n&&e.data===void 0||Y(a,[e.error,r])),ye=e=>{if(e.suspense){const a=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>a(r(...n)):a(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},be=(e,t)=>e.isLoading&&e.isFetching&&!t,ge=(e,t)=>e?.suspense&&t.isPending,Z=(e,t,a)=>t.fetchOptimistic(e).catch(()=>{a.clearReset()});function xe(e,t,a){const r=ue(),n=me(),h=ee(),o=h.defaultQueryOptions(e);h.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const m=h.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",ye(o),fe(o,n,m),ve(n);const f=!h.getQueryCache().get(o.queryHash),[d]=v.useState(()=>new t(h,o)),u=d.getOptimisticResult(o),x=!r&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(p=>{const c=x?d.subscribe(X.batchCalls(p)):U;return d.updateResult(),c},[d,x]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),v.useEffect(()=>{d.setOptions(o)},[o,d]),ge(o,u))throw Z(o,d,n);if(_e({result:u,errorResetBoundary:n,throwOnError:o.throwOnError,query:m,suspense:o.suspense}))throw u.error;return h.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!Q&&be(u,r)&&(f?Z(o,d,n):m?.promise)?.catch(U).finally(()=>{d.updateResult()}),o.notifyOnChangeProps?u:d.trackResult(u)}function P(e,t){return xe(e,le)}function je({tabs:e,activeTab:t,onTabChange:a,containerClassName:r,panelClassName:n,tabListClassName:h,tabClassName:o,activeTabClassName:m}){return s.jsxs("div",{className:r,children:[s.jsx("div",{role:"tablist",className:h,style:h?void 0:{display:"flex",gap:"2px",borderBottom:"1px solid var(--border-subtle, rgba(255,255,255,0.06))",marginBottom:"12px"},children:e.map(f=>{const d=t===f.id,u=[o,d&&m].filter(Boolean).join(" ");return s.jsx("button",{role:"tab","aria-selected":d,onClick:()=>a(f.id),className:u||void 0,style:u?void 0:{padding:"8px 16px",background:d?"var(--bg-accent, rgba(0,229,255,0.1))":"transparent",border:"none",borderBottom:d?"2px solid var(--accent-cyan, #00e5ff)":"2px solid transparent",color:d?"var(--accent-cyan, #00e5ff)":"var(--text-secondary, #8888aa)",cursor:"pointer",fontSize:"0.85rem",fontFamily:"var(--font-mono, monospace)",transition:"color 0.15s, background 0.15s"},children:f.label},f.id)})}),s.jsx("div",{role:"tabpanel",className:n,children:e.find(f=>f.id===t)?.content})]})}const Se="_container_1uen7_5",Te="_filters_1uen7_15",we="_filterGroup_1uen7_22",Ce="_filterLabel_1uen7_28",Re="_filterInput_1uen7_36",Ee="_sortToggle_1uen7_54",Ne="_results_1uen7_72",Be="_emptyState_1uen7_80",De="_row_1uen7_89",Oe="_rowTitle_1uen7_107",Ie="_rowProject_1uen7_115",Me="_rowDate_1uen7_123",ke="_rowDuration_1uen7_129",Pe="_rowStatus_1uen7_135",Fe="_rowMeta_1uen7_165",Ue="_resumeBtn_1uen7_171",Qe="_deleteBtn_1uen7_189",Le="_pagination_1uen7_207",Ae="_pageBtn_1uen7_215",$e="_pageBtnActive_1uen7_236",He="_pageEllipsis_1uen7_242",qe="_detailOverlay_1uen7_249",Ge="_detailCard_1uen7_259",We="_detailTabs_1uen7_273",ze="_detailTabPanel_1uen7_281",Ke="_detailHeader_1uen7_289",Ve="_detailTitle_1uen7_296",Ze="_detailMeta_1uen7_302",Je="_detailCloseBtn_1uen7_309",Xe="_detailBody_1uen7_322",Ye="_convoEntry_1uen7_327",et="_convoEntryHeader_1uen7_335",tt="_copyBtn_1uen7_342",st="_convoPrompt_1uen7_364",at="_convoResponse_1uen7_369",it="_convoTime_1uen7_374",nt="_convoText_1uen7_380",rt="_activityEntry_1uen7_387",ot="_activityTime_1uen7_395",lt="_activityBadge_1uen7_401",ct="_activityBadgeTool_1uen7_410",dt="_activityBadgeEvent_1uen7_415",ut="_activityDetail_1uen7_420",i={container:Se,filters:Te,filterGroup:we,filterLabel:Ce,filterInput:Re,sortToggle:Ee,results:Ne,emptyState:Be,row:De,rowTitle:Oe,rowProject:Ie,rowDate:Me,rowDuration:ke,rowStatus:Pe,rowMeta:Fe,resumeBtn:Ue,deleteBtn:Qe,pagination:Le,pageBtn:Ae,pageBtnActive:$e,pageEllipsis:He,detailOverlay:qe,detailCard:Ge,detailTabs:We,detailTabPanel:ze,detailHeader:Ke,detailTitle:Ve,detailMeta:Ze,detailCloseBtn:Je,detailBody:Xe,convoEntry:Ye,convoEntryHeader:et,copyBtn:tt,convoPrompt:st,convoResponse:at,convoTime:it,convoText:nt,activityEntry:rt,activityTime:ot,activityBadge:lt,activityBadgeTool:ct,activityBadgeEvent:dt,activityDetail:ut},se=50;function O(e){if(e<1e3)return"<1s";const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const a=Math.floor(t/60);return a<60?`${a}m ${t%60}s`:`${Math.floor(a/60)}h ${a%60}m`}function ht(e){return e?new Date(e).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}):"--"}function J(e){return new Date(e).toLocaleTimeString("en-US",{hour12:!1})}function pt(e){const t=new URLSearchParams;e.query&&t.set("query",e.query),e.project&&t.set("project",e.project),e.status==="archived"?t.set("archived","true"):e.status&&t.set("status",e.status),e.dateFrom&&t.set("dateFrom",String(new Date(e.dateFrom).getTime())),e.dateTo&&t.set("dateTo",String(new Date(e.dateTo+"T23:59:59").getTime()));const a={date:"started_at",duration:"last_activity_at",prompts:"started_at",tools:"started_at"};return t.set("sortBy",a[e.sortBy]||"started_at"),t.set("sortDir",e.sortDir),t.set("page",String(e.page)),t.set("pageSize",String(se)),t.toString()}function xt(){const e=ee(),[t,a]=v.useState({query:"",project:"",status:"",dateFrom:"",dateTo:"",sortBy:"date",sortDir:"desc",page:1}),[r,n]=v.useState(null),{data:h}=P({queryKey:["db-projects"],queryFn:async()=>{const l=await C("/api/db/projects");if(!l.ok)throw new Error("Failed to load projects");return l.json()},staleTime:6e4}),{data:o,isLoading:m}=P({queryKey:["db-sessions",t],queryFn:async()=>{const l=await C(`/api/db/sessions?${pt(t)}`);if(!l.ok)throw new Error("Failed to load sessions");return l.json()}}),{data:f}=P({queryKey:["db-session-detail",r],queryFn:async()=>{if(!r)return null;const l=await C(`/api/db/sessions/${encodeURIComponent(r)}`);if(!l.ok)throw new Error("Failed to load session detail");return l.json()},enabled:!!r}),d=v.useCallback((l,y)=>{a(j=>({...j,[l]:y,page:l==="page"?y:1}))},[]),u=v.useCallback(async(l,y)=>{l.stopPropagation(),window.confirm("Delete this session from history? This cannot be undone.")&&(await C(`/api/db/sessions/${encodeURIComponent(y)}`,{method:"DELETE"}),e.invalidateQueries({queryKey:["db-sessions"]}))},[e]),x=v.useCallback(async(l,y)=>{l.stopPropagation();try{const T=await(await C(`/api/sessions/${encodeURIComponent(y)}/resume`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();T.ok?M("Resuming Claude session in terminal","success"):M(T.error||"Resume failed","error")}catch(j){M(j.message,"error")}},[]),p=o?.sessions??[],c=o?.total??0,_=Math.ceil(c/se);return s.jsxs("div",{className:i.container,"data-testid":"history-view",children:[s.jsxs("div",{className:i.filters,children:[s.jsx(oe,{value:t.query,onChange:l=>d("query",l),placeholder:"Search prompts..."}),s.jsxs("div",{className:i.filterGroup,children:[s.jsx("span",{className:i.filterLabel,children:"Project"}),s.jsx(k,{value:t.project,onChange:l=>d("project",l),options:[{value:"",label:"All"},...h?.map(l=>({value:l.project_path,label:l.project_name}))??[]]})]}),s.jsxs("div",{className:i.filterGroup,children:[s.jsx("span",{className:i.filterLabel,children:"Status"}),s.jsx(k,{value:t.status,onChange:l=>d("status",l),options:[{value:"",label:"All"},{value:"idle",label:"Idle"},{value:"working",label:"Working"},{value:"waiting",label:"Waiting"},{value:"ended",label:"Ended"},{value:"archived",label:"Archived"}]})]}),s.jsxs("div",{className:i.filterGroup,children:[s.jsx("span",{className:i.filterLabel,children:"From"}),s.jsx("input",{type:"date",className:i.filterInput,value:t.dateFrom,onChange:l=>d("dateFrom",l.target.value)})]}),s.jsxs("div",{className:i.filterGroup,children:[s.jsx("span",{className:i.filterLabel,children:"To"}),s.jsx("input",{type:"date",className:i.filterInput,value:t.dateTo,onChange:l=>d("dateTo",l.target.value)})]}),s.jsxs("div",{className:i.filterGroup,children:[s.jsx("span",{className:i.filterLabel,children:"Sort"}),s.jsx(k,{value:t.sortBy,onChange:l=>d("sortBy",l),options:[{value:"date",label:"Date"},{value:"duration",label:"Activity"},{value:"prompts",label:"Prompts"},{value:"tools",label:"Tools"}]}),s.jsx("button",{className:i.sortToggle,onClick:()=>d("sortDir",t.sortDir==="desc"?"asc":"desc"),children:t.sortDir.toUpperCase()})]})]}),s.jsxs("div",{className:i.results,children:[m&&s.jsx("div",{className:i.emptyState,children:"Loading..."}),!m&&p.length===0&&s.jsx("div",{className:i.emptyState,children:"No sessions found"}),p.map(l=>s.jsx(ft,{session:l,onClick:()=>n(l.id),onResume:y=>x(y,l.id),onDelete:y=>u(y,l.id)},l.id))]}),_>1&&s.jsx(vt,{currentPage:t.page,totalPages:_,onPageChange:l=>d("page",l)}),r&&f&&s.jsx(yt,{detail:f,onClose:()=>n(null)})]})}function mt(){return s.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("polyline",{points:"1 4 1 10 7 10"}),s.jsx("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]})}function ft({session:e,onClick:t,onResume:a,onDelete:r}){const n=e.ended_at&&e.started_at?O(e.ended_at-e.started_at):e.started_at?O(Date.now()-e.started_at):"--";return s.jsxs("div",{className:i.row,onClick:t,children:[s.jsx("span",{className:i.rowTitle,children:e.title||e.project_name||e.id}),s.jsx("span",{className:i.rowProject,children:e.project_name}),s.jsx("span",{className:i.rowDate,children:ht(e.started_at)}),s.jsx("span",{className:i.rowDuration,children:n}),s.jsx("span",{className:i.rowStatus,"data-status":e.status,children:e.status.toUpperCase()}),s.jsxs("span",{className:i.rowMeta,children:[e.total_prompts," prompts"]}),s.jsxs("span",{className:i.rowMeta,children:[e.total_tool_calls," tools"]}),s.jsx("button",{className:i.resumeBtn,onClick:a,title:"Resume session","aria-label":"Resume session",children:s.jsx(mt,{})}),s.jsx("button",{className:i.deleteBtn,onClick:r,title:"Delete session","aria-label":"Delete session",children:"x"})]})}function vt({currentPage:e,totalPages:t,onPageChange:a}){const r=[];for(let o=1;o<=t;o++)(o===1||o===t||o>=e-2&&o<=e+2)&&r.push(o);const n=[];let h=0;for(const o of r)typeof o=="number"&&(h&&o-h>1&&n.push("ellipsis"),n.push(o),h=o);return s.jsxs("div",{className:i.pagination,children:[s.jsx("button",{className:i.pageBtn,disabled:e<=1,onClick:()=>a(e-1),children:"Prev"}),n.map((o,m)=>o==="ellipsis"?s.jsx("span",{className:i.pageEllipsis,children:"..."},`e-${m}`):s.jsx("button",{className:`${i.pageBtn} ${o===e?i.pageBtnActive:""}`,onClick:()=>a(o),children:o},o)),s.jsx("button",{className:i.pageBtn,disabled:e>=t,onClick:()=>a(e+1),children:"Next"})]})}function _t({text:e}){const[t,a]=v.useState(!1),r=n=>{n.stopPropagation(),navigator.clipboard.writeText(e).then(()=>{a(!0),setTimeout(()=>a(!1),1500)})};return s.jsx("button",{className:i.copyBtn,onClick:r,"aria-label":"Copy to clipboard",title:"Copy to clipboard",children:t?"✓":"⎘"})}function yt({detail:e,onClose:t}){const[a,r]=v.useState("conversation"),{session:n,prompts:h,responses:o,tool_calls:m,events:f}=e,d=[...h.map(c=>({type:"prompt",timestamp:c.timestamp,text:c.text})),...o.map(c=>({type:"response",timestamp:c.timestamp,text:c.text_excerpt}))].sort((c,_)=>c.timestamp-_.timestamp),u=[...m.map(c=>({kind:"tool",label:c.tool_name,detail:c.tool_input_summary,timestamp:c.timestamp})),...f.map(c=>({kind:"event",label:c.event_type,detail:c.detail,timestamp:c.timestamp}))].sort((c,_)=>_.timestamp-c.timestamp),x=n.ended_at&&n.started_at?O(n.ended_at-n.started_at):n.started_at?O(Date.now()-n.started_at):"--",p=[{id:"conversation",label:`Conversation (${d.length})`,content:s.jsxs("div",{className:i.detailBody,children:[d.length===0&&s.jsx("div",{className:i.emptyState,children:"No conversation recorded"}),d.map((c,_)=>s.jsxs("div",{className:`${i.convoEntry} ${c.type==="prompt"?i.convoPrompt:i.convoResponse}`,children:[s.jsxs("div",{className:i.convoEntryHeader,children:[s.jsx("div",{className:i.convoTime,children:J(c.timestamp)}),s.jsx(_t,{text:c.text})]}),s.jsx("div",{className:i.convoText,children:c.text})]},_))]})},{id:"activity",label:`Activity (${u.length})`,content:s.jsxs("div",{className:i.detailBody,children:[u.length===0&&s.jsx("div",{className:i.emptyState,children:"No activity recorded"}),u.map((c,_)=>s.jsxs("div",{className:i.activityEntry,children:[s.jsx("span",{className:i.activityTime,children:J(c.timestamp)}),s.jsx("span",{className:`${i.activityBadge} ${c.kind==="tool"?i.activityBadgeTool:i.activityBadgeEvent}`,children:c.label}),s.jsx("span",{className:i.activityDetail,children:c.detail})]},_))]})}];return s.jsx("div",{className:i.detailOverlay,onClick:t,children:s.jsxs("div",{className:i.detailCard,onClick:c=>c.stopPropagation(),children:[s.jsxs("div",{className:i.detailHeader,children:[s.jsxs("div",{children:[s.jsx("h2",{className:i.detailTitle,children:n.project_name||n.id}),s.jsxs("div",{className:i.detailMeta,children:[s.jsxs("span",{children:["Status: ",n.status.toUpperCase()]}),s.jsxs("span",{children:["Model: ",n.model||"--"]}),s.jsxs("span",{children:["Duration: ",x]}),s.jsxs("span",{children:[n.total_prompts," prompts / ",n.total_tool_calls," tools"]})]})]}),s.jsx("button",{className:i.detailCloseBtn,onClick:t,"aria-label":"Close",children:"x"})]}),s.jsx(je,{tabs:p,activeTab:a,onTabChange:r,containerClassName:i.detailTabs,panelClassName:i.detailTabPanel})]})})}export{xt as default};
@@ -1 +1 @@
1
- import{z as o,k as s,A as e,P as l}from"./index-CGTrscK-.js";function c(){const[t]=o(),a=t.get("path");if(!a)return s.jsx("div",{className:e.standalone,children:s.jsxs("div",{className:e.standaloneEmpty,children:["No project path specified. Use ",s.jsx("code",{children:"?path=/your/project"})," to open a project."]})});const i=a.split("/").filter(Boolean).pop()||a,n=t.get("file")||void 0;return s.jsxs("div",{className:e.standalone,children:[s.jsxs("div",{className:e.standaloneHeader,children:[s.jsx("span",{className:e.standaloneTitle,children:i}),s.jsx("span",{className:e.standalonePath,children:a})]}),s.jsx("div",{className:e.standaloneContent,children:s.jsx(l,{projectPath:a,initialPath:n,initialIsFile:!!n,persistId:`browser-${a}`})})]})}export{c as default};
1
+ import{z as o,k as s,A as e,P as l}from"./index-DMLiHQ-O.js";function c(){const[t]=o(),a=t.get("path");if(!a)return s.jsx("div",{className:e.standalone,children:s.jsxs("div",{className:e.standaloneEmpty,children:["No project path specified. Use ",s.jsx("code",{children:"?path=/your/project"})," to open a project."]})});const i=a.split("/").filter(Boolean).pop()||a,n=t.get("file")||void 0;return s.jsxs("div",{className:e.standalone,children:[s.jsxs("div",{className:e.standaloneHeader,children:[s.jsx("span",{className:e.standaloneTitle,children:i}),s.jsx("span",{className:e.standalonePath,children:a})]}),s.jsx("div",{className:e.standaloneContent,children:s.jsx(l,{projectPath:a,initialPath:n,initialIsFile:!!n,persistId:`browser-${a}`})})]})}export{c as default};
@@ -1 +1 @@
1
- import{v as x,w as $,h as d,m as S,k as e,x as a,q as D}from"./index-CGTrscK-.js";const B="_controls_uyjqd_6",E="_title_uyjqd_11",M="_stats_uyjqd_13",T="_statsSep_uyjqd_17",H="_content_uyjqd_19",P="_viewGroup_uyjqd_21",z="_groupHeader_uyjqd_22",G="_sessionName_uyjqd_23",R="_label_uyjqd_24",U="_sid_uyjqd_25",K="_itemCount_uyjqd_26",L="_table_uyjqd_28",O="_pos_uyjqd_34",Q="_text_uyjqd_36",V="_date_uyjqd_37",W="_deleteBtn_uyjqd_38",t={controls:B,title:E,stats:M,statsSep:T,content:H,viewGroup:P,groupHeader:z,sessionName:G,label:R,sid:U,itemCount:K,table:L,pos:O,text:Q,date:V,deleteBtn:W};let F=Date.now();function Y(){return F++}function J(o){return new Date(o).toLocaleTimeString("en-US",{hour12:!1})}function Z(){const o=x(s=>s.queues),y=x(s=>s.add),w=x(s=>s.remove),b=x(s=>s.moveToSession),h=$(s=>s.sessions),[l,k]=d.useState(""),[m,g]=d.useState(""),[i,f]=d.useState(null),p=Array.from(new Set([...o.keys(),...h.keys()])).filter(s=>{const n=o.get(s);return n&&n.length>0}),q=Array.from(o.values()).reduce((s,n)=>s+n.length,0),N=d.useCallback(()=>{const s=m.trim();if(!s||!l)return;const n=o.get(l)??[],c={id:Y(),sessionId:l,text:s,position:n.length,createdAt:Date.now()};y(l,c),g(""),S("Prompt added to queue","info",2e3)},[m,l,o,y]),A=d.useCallback(s=>{i&&(b([i.itemId],i.fromSessionId,s),f(null),S("Prompt moved","info",2e3))},[i,b]),j=Array.from(h.entries()),C=d.useMemo(()=>[{value:"",label:"Select session..."},...j.map(([s,n])=>({value:s,label:`${n.projectName||s.slice(0,8)}${n.title?` — ${n.title}`:""}`}))],[j]);return e.jsxs("div",{"data-testid":"queue-view",style:{height:"100%",overflow:"auto"},children:[e.jsx("div",{className:t.controls,children:e.jsx("h2",{className:t.title,children:"PROMPT QUEUE"})}),e.jsxs("div",{className:t.stats,children:[e.jsxs("span",{children:[q," queued prompt",q!==1?"s":""]}),e.jsx("span",{className:t.statsSep,children:"|"}),e.jsxs("span",{children:[p.length," session",p.length!==1?"s":""]})]}),e.jsx("div",{style:{padding:"0 24px 16px"},children:e.jsxs("div",{className:a.queueCompose,children:[e.jsx(D,{value:l,onChange:k,options:C,placeholder:"Select session...",style:{minWidth:"180px",fontSize:"11px"}}),e.jsx("textarea",{className:a.queueTextarea,placeholder:"Add a prompt to the queue...",rows:2,value:m,onChange:s=>g(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.metaKey||s.ctrlKey)&&(s.preventDefault(),N())}}),e.jsx("button",{className:`${a.toolbarBtn} ${a.queueAddBtn}`,onClick:N,disabled:!m.trim()||!l,children:"ADD"})]})}),e.jsx("div",{className:t.content,children:p.length===0?e.jsx("div",{style:{textAlign:"center",padding:"40px 0",color:"var(--text-dim)",fontSize:"13px"},children:"No prompts in queue. Add prompts from session detail panels or above."}):p.map(s=>{const n=o.get(s)??[],c=h.get(s);return e.jsxs("div",{className:t.viewGroup,children:[e.jsxs("div",{className:t.groupHeader,children:[e.jsx("span",{className:t.sessionName,children:c?.projectName||"Unknown"}),c?.label&&e.jsx("span",{className:t.label,children:c.label}),e.jsx("span",{className:t.sid,children:s.slice(0,8)}),e.jsxs("span",{className:t.itemCount,children:[n.length," item",n.length!==1?"s":""]})]}),e.jsxs("table",{className:t.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:t.pos,children:"#"}),e.jsx("th",{children:"Prompt"}),e.jsx("th",{children:"Added"}),e.jsx("th",{children:"Actions"})]})}),e.jsx("tbody",{children:n.map((r,I)=>e.jsxs("tr",{children:[e.jsx("td",{className:t.pos,children:I+1}),e.jsx("td",{className:t.text,children:r.text}),e.jsx("td",{className:t.date,children:J(r.createdAt)}),e.jsxs("td",{children:[e.jsxs("div",{style:{display:"flex",gap:"4px"},children:[e.jsx("button",{className:`${a.queueActionBtn} ${a.queueMove}`,onClick:()=>f(i?.itemId===r.id?null:{itemId:r.id,fromSessionId:s}),children:"MOVE"}),e.jsx("button",{className:`${a.queueActionBtn} ${a.queueDelete} ${t.deleteBtn}`,onClick:()=>w(s,r.id),children:"DEL"})]}),i?.itemId===r.id&&e.jsx("div",{style:{position:"absolute",zIndex:10,background:"var(--surface-card, #12122a)",border:"1px solid var(--border-subtle, rgba(255,255,255,0.08))",borderRadius:"4px",padding:"4px",maxHeight:"160px",overflowY:"auto",minWidth:"180px"},children:j.filter(([u])=>u!==s).map(([u,_])=>e.jsxs("button",{onClick:()=>A(u),style:{display:"block",width:"100%",padding:"4px 8px",background:"transparent",border:"none",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"10px",textAlign:"left",cursor:"pointer",borderRadius:"3px"},onMouseEnter:v=>{v.target.style.background="rgba(0,229,255,0.1)"},onMouseLeave:v=>{v.target.style.background="transparent"},children:[_.projectName||u.slice(0,8),_.title?` — ${_.title}`:""]},u))})]})]},r.id))})]})]},s)})})]})}export{Z as default};
1
+ import{v as x,w as $,h as d,m as S,k as e,x as a,q as D}from"./index-DMLiHQ-O.js";const B="_controls_uyjqd_6",E="_title_uyjqd_11",M="_stats_uyjqd_13",T="_statsSep_uyjqd_17",H="_content_uyjqd_19",P="_viewGroup_uyjqd_21",z="_groupHeader_uyjqd_22",G="_sessionName_uyjqd_23",R="_label_uyjqd_24",U="_sid_uyjqd_25",K="_itemCount_uyjqd_26",L="_table_uyjqd_28",O="_pos_uyjqd_34",Q="_text_uyjqd_36",V="_date_uyjqd_37",W="_deleteBtn_uyjqd_38",t={controls:B,title:E,stats:M,statsSep:T,content:H,viewGroup:P,groupHeader:z,sessionName:G,label:R,sid:U,itemCount:K,table:L,pos:O,text:Q,date:V,deleteBtn:W};let F=Date.now();function Y(){return F++}function J(o){return new Date(o).toLocaleTimeString("en-US",{hour12:!1})}function Z(){const o=x(s=>s.queues),y=x(s=>s.add),w=x(s=>s.remove),b=x(s=>s.moveToSession),h=$(s=>s.sessions),[l,k]=d.useState(""),[m,g]=d.useState(""),[i,f]=d.useState(null),p=Array.from(new Set([...o.keys(),...h.keys()])).filter(s=>{const n=o.get(s);return n&&n.length>0}),q=Array.from(o.values()).reduce((s,n)=>s+n.length,0),N=d.useCallback(()=>{const s=m.trim();if(!s||!l)return;const n=o.get(l)??[],c={id:Y(),sessionId:l,text:s,position:n.length,createdAt:Date.now()};y(l,c),g(""),S("Prompt added to queue","info",2e3)},[m,l,o,y]),A=d.useCallback(s=>{i&&(b([i.itemId],i.fromSessionId,s),f(null),S("Prompt moved","info",2e3))},[i,b]),j=Array.from(h.entries()),C=d.useMemo(()=>[{value:"",label:"Select session..."},...j.map(([s,n])=>({value:s,label:`${n.projectName||s.slice(0,8)}${n.title?` — ${n.title}`:""}`}))],[j]);return e.jsxs("div",{"data-testid":"queue-view",style:{height:"100%",overflow:"auto"},children:[e.jsx("div",{className:t.controls,children:e.jsx("h2",{className:t.title,children:"PROMPT QUEUE"})}),e.jsxs("div",{className:t.stats,children:[e.jsxs("span",{children:[q," queued prompt",q!==1?"s":""]}),e.jsx("span",{className:t.statsSep,children:"|"}),e.jsxs("span",{children:[p.length," session",p.length!==1?"s":""]})]}),e.jsx("div",{style:{padding:"0 24px 16px"},children:e.jsxs("div",{className:a.queueCompose,children:[e.jsx(D,{value:l,onChange:k,options:C,placeholder:"Select session...",style:{minWidth:"180px",fontSize:"11px"}}),e.jsx("textarea",{className:a.queueTextarea,placeholder:"Add a prompt to the queue...",rows:2,value:m,onChange:s=>g(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.metaKey||s.ctrlKey)&&(s.preventDefault(),N())}}),e.jsx("button",{className:`${a.toolbarBtn} ${a.queueAddBtn}`,onClick:N,disabled:!m.trim()||!l,children:"ADD"})]})}),e.jsx("div",{className:t.content,children:p.length===0?e.jsx("div",{style:{textAlign:"center",padding:"40px 0",color:"var(--text-dim)",fontSize:"13px"},children:"No prompts in queue. Add prompts from session detail panels or above."}):p.map(s=>{const n=o.get(s)??[],c=h.get(s);return e.jsxs("div",{className:t.viewGroup,children:[e.jsxs("div",{className:t.groupHeader,children:[e.jsx("span",{className:t.sessionName,children:c?.projectName||"Unknown"}),c?.label&&e.jsx("span",{className:t.label,children:c.label}),e.jsx("span",{className:t.sid,children:s.slice(0,8)}),e.jsxs("span",{className:t.itemCount,children:[n.length," item",n.length!==1?"s":""]})]}),e.jsxs("table",{className:t.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:t.pos,children:"#"}),e.jsx("th",{children:"Prompt"}),e.jsx("th",{children:"Added"}),e.jsx("th",{children:"Actions"})]})}),e.jsx("tbody",{children:n.map((r,I)=>e.jsxs("tr",{children:[e.jsx("td",{className:t.pos,children:I+1}),e.jsx("td",{className:t.text,children:r.text}),e.jsx("td",{className:t.date,children:J(r.createdAt)}),e.jsxs("td",{children:[e.jsxs("div",{style:{display:"flex",gap:"4px"},children:[e.jsx("button",{className:`${a.queueActionBtn} ${a.queueMove}`,onClick:()=>f(i?.itemId===r.id?null:{itemId:r.id,fromSessionId:s}),children:"MOVE"}),e.jsx("button",{className:`${a.queueActionBtn} ${a.queueDelete} ${t.deleteBtn}`,onClick:()=>w(s,r.id),children:"DEL"})]}),i?.itemId===r.id&&e.jsx("div",{style:{position:"absolute",zIndex:10,background:"var(--surface-card, #12122a)",border:"1px solid var(--border-subtle, rgba(255,255,255,0.08))",borderRadius:"4px",padding:"4px",maxHeight:"160px",overflowY:"auto",minWidth:"180px"},children:j.filter(([u])=>u!==s).map(([u,_])=>e.jsxs("button",{onClick:()=>A(u),style:{display:"block",width:"100%",padding:"4px 8px",background:"transparent",border:"none",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"10px",textAlign:"left",cursor:"pointer",borderRadius:"3px"},onMouseEnter:v=>{v.target.style.background="rgba(0,229,255,0.1)"},onMouseLeave:v=>{v.target.style.background="transparent"},children:[_.projectName||u.slice(0,8),_.title?` — ${_.title}`:""]},u))})]})]},r.id))})]})]},s)})})]})}export{Z as default};