ai-agent-session-center 2.10.0 → 2.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{y as f,h as l,k as e,o as A}from"./index-C13EUDCm.js";const P="_container_3h9eq_6",F="_filterBar_3h9eq_15",$="_toggleLabel_3h9eq_42",U="_taskList_3h9eq_61",Y="_groupHeader_3h9eq_69",G="_groupChevron_3h9eq_78",V="_collapsed_3h9eq_86",W="_groupLabel_3h9eq_90",K="_groupCount_3h9eq_99",z="_taskCard_3h9eq_107",J="_completed_3h9eq_124",Q="_taskTitle_3h9eq_128",X="_overdue_3h9eq_133",Z="_dueToday_3h9eq_138",ee="_checkbox_3h9eq_145",te="_taskContent_3h9eq_160",se="_taskHeader_3h9eq_165",ae="_taskTitleInput_3h9eq_189",ne="_priorityBadge_3h9eq_204",oe="_priorityUrgent_3h9eq_231",le="_priorityHigh_3h9eq_237",ie="_priorityMedium_3h9eq_243",re="_priorityLow_3h9eq_249",ce="_taskMeta_3h9eq_257",de="_dueDate_3h9eq_265",ue="_dueDateOverdue_3h9eq_271",pe="_dueDateToday_3h9eq_275",he="_tag_3h9eq_279",ge="_tagInput_3h9eq_294",me="_addTagBtn_3h9eq_307",_e="_description_3h9eq_327",fe="_descriptionToggle_3h9eq_337",ve="_deleteBtn_3h9eq_354",xe="_addForm_3h9eq_375",ye="_titleInput_3h9eq_418",Ce="_tagsInput_3h9eq_423",je="_addBtn_3h9eq_428",Te="_emptyState_3h9eq_454",ke="_loading_3h9eq_475",De="_stats_3h9eq_488",be="_statsSep_3h9eq_498",we="_confirmOverlay_3h9eq_504",qe="_confirmBtn_3h9eq_513",Se="_cancelBtn_3h9eq_528",s={container:P,filterBar:F,toggleLabel:$,taskList:U,groupHeader:Y,groupChevron:G,collapsed:V,groupLabel:W,groupCount:K,taskCard:z,completed:J,taskTitle:Q,overdue:X,dueToday:Z,checkbox:ee,taskContent:te,taskHeader:se,taskTitleInput:ae,priorityBadge:ne,priorityUrgent:oe,priorityHigh:le,priorityMedium:ie,priorityLow:re,taskMeta:ce,dueDate:de,dueDateOverdue:ue,dueDateToday:pe,tag:he,tagInput:ge,addTagBtn:me,description:_e,descriptionToggle:fe,deleteBtn:ve,addForm:xe,titleInput:ye,tagsInput:Ce,addBtn:je,emptyState:Te,loading:ke,stats:De,statsSep:be,confirmOverlay:we,confirmBtn:qe,cancelBtn:Se},Ne=[{value:"all",label:"All priorities"},{value:"urgent",label:"Urgent"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}],Be=[{value:"priority",label:"Priority"},{value:"dueDate",label:"Due date"},{value:"createdAt",label:"Created"}];function Ie(){const t=f(i=>i.filter),o=f(i=>i.setFilter),n=l.useCallback(i=>o({search:i}),[o]),c=l.useCallback(i=>o({priority:i.target.value}),[o]),d=l.useCallback(i=>o({sortBy:i.target.value}),[o]),p=l.useCallback(()=>o({showCompleted:!t.showCompleted}),[o,t.showCompleted]);return e.jsxs("div",{className:s.filterBar,children:[e.jsx(A,{value:t.search,onChange:n,placeholder:"Search tasks...",debounceMs:200}),e.jsx("select",{value:t.priority,onChange:c,children:Ne.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))}),e.jsx("select",{value:t.sortBy,onChange:d,children:Be.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))}),e.jsxs("label",{className:s.toggleLabel,children:[e.jsx("input",{type:"checkbox",checked:t.showCompleted,onChange:p}),"Show completed"]})]})}const Le={urgent:s.priorityUrgent,high:s.priorityHigh,medium:s.priorityMedium,low:s.priorityLow},Oe=["low","medium","high","urgent"];function Re(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 Ee(t){return new Date(t+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric"})}function N({task:t}){const o=f(a=>a.toggleTask),n=f(a=>a.updateTask),c=f(a=>a.deleteTask),[d,p]=l.useState(!1),[i,m]=l.useState(t.title),[_,x]=l.useState(!1),[u,C]=l.useState(""),[j,r]=l.useState(!1),[v,g]=l.useState(!1),T=l.useRef(null),b=l.useRef(null);l.useEffect(()=>{d&&(T.current?.focus(),T.current?.select())},[d]),l.useEffect(()=>{_&&b.current?.focus()},[_]),l.useEffect(()=>{d||m(t.title)},[t.title,d]);const k=l.useCallback(()=>{p(!1);const a=i.trim();a&&a!==t.title?n(t.id,{title:a}):m(t.title)},[i,t.id,t.title,n]),w=l.useCallback(()=>{o(t.id)},[o,t.id]),h=l.useCallback(()=>{c(t.id),g(!1)},[c,t.id]),y=l.useCallback(()=>{C(t.tags.join(", ")),x(!0)},[t.tags]),R=l.useCallback(a=>{n(t.id,{priority:a.target.value})},[t.id,n]),S=l.useCallback(()=>{x(!1);const a=u.split(",").map(M=>M.trim()).filter(Boolean),E=t.tags.join(","),H=a.join(",");E!==H&&n(t.id,{tags:a})},[u,t.id,t.tags,n]),D=Re(t.dueDate),q=[s.taskCard];return t.completed&&q.push(s.completed),!t.completed&&D==="overdue"&&q.push(s.overdue),!t.completed&&D==="today"&&q.push(s.dueToday),e.jsxs("div",{className:q.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:T,className:s.taskTitleInput,value:i,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("select",{className:`${s.priorityBadge} ${Le[t.priority]}`,value:t.priority,onChange:R,onClick:a=>a.stopPropagation(),title:"Change priority",children:Oe.map(a=>e.jsx("option",{value:a,children:a.toUpperCase()},a))})]}),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: ",Ee(t.dueDate)]}),_?e.jsx("input",{ref:b,className:s.tagInput,value:u,onChange:a=>C(a.target.value),onBlur:S,onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),S()),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:y,title:"Click to edit tags",style:{cursor:"pointer"},children:a},a)),e.jsx("button",{className:s.addTagBtn,onClick:y,title:"Add / edit tags",children:"+"})]})]}),t.description&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:s.descriptionToggle,onClick:()=>r(a=>!a),children:j?"- Hide details":"+ Show details"}),j&&e.jsx("div",{className:s.description,children:t.description})]})]}),v?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 He(){const t=f(u=>u.createTask),[o,n]=l.useState(""),[c,d]=l.useState("medium"),[p,i]=l.useState(""),[m,_]=l.useState(""),x=l.useCallback(u=>{u.preventDefault();const C=o.trim();if(!C)return;const j=m.split(",").map(r=>r.trim()).filter(Boolean);t({title:C,priority:c,tags:j,dueDate:p||void 0}),n(""),d("medium"),i(""),_("")},[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=>i(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 B=["urgent","high","medium","low"],I={urgent:0,high:1,medium:2,low:3},Me={urgent:"Urgent",high:"High",medium:"Medium",low:"Low"};function Ae(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),i=(t.description??"").toLowerCase().includes(d);if(!p&&!i)return!1}return!0}function L(t,o){return[...t].sort((n,c)=>{if(o==="priority"){const d=I[n.priority],p=I[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 O({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 Fe(){const t=f(r=>r.tasks),o=f(r=>r.loading),n=f(r=>r.filter),c=f(r=>r.fetchTasks),[d,p]=l.useState(new Set);l.useEffect(()=>{c()},[c]);const i=l.useCallback(r=>{p(v=>{const g=new Set(v);return g.has(r)?g.delete(r):g.add(r),g})},[]),{groups:m,completedTasks:_,totalIncomplete:x,totalCompleted:u}=l.useMemo(()=>{const v=[...t.values()].filter(h=>Ae(h,n.search,n.priority,n.tag)),g=v.filter(h=>!h.completed),T=v.filter(h=>h.completed),b=L(g,n.sortBy),k=new Map;for(const h of B)k.set(h,[]);for(const h of b){const y=k.get(h.priority);y&&y.push(h)}const w=[];for(const h of B){const y=k.get(h)??[];y.length>0&&w.push({id:h,label:Me[h],tasks:y})}return{groups:w,completedTasks:L(T,n.sortBy),totalIncomplete:g.length,totalCompleted:T.length}},[t,n]);if(o)return e.jsx("div",{className:s.container,children:e.jsx("div",{className:s.loading,children:"Loading tasks..."})});const C=m.length===0&&_.length===0,j=t.size===0;return e.jsxs("div",{className:s.container,"data-testid":"agenda-view",children:[e.jsx(Ie,{}),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:j?e.jsxs("div",{className:s.emptyState,children:[e.jsx("div",{children:"No tasks yet"}),e.jsx("span",{children:"Add your first task below"})]}):C?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 v=d.has(r.id);return e.jsxs("div",{children:[e.jsx(O,{label:r.label,count:r.tasks.length,collapsed:v,onToggle:()=>i(r.id)}),!v&&r.tasks.map(g=>e.jsx(N,{task:g},g.id))]},r.id)}),n.showCompleted&&_.length>0&&e.jsxs("div",{children:[e.jsx(O,{label:"Completed",count:_.length,collapsed:d.has("__completed__"),onToggle:()=>i("__completed__")}),!d.has("__completed__")&&_.map(r=>e.jsx(N,{task:r},r.id))]})]})}),e.jsx(He,{})]})}export{Fe as default};
@@ -0,0 +1 @@
1
+ ._container_3h9eq_6{display:flex;flex-direction:column;height:100%;overflow:hidden}._filterBar_3h9eq_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_3h9eq_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_3h9eq_15 select:focus{border-color:var(--accent-cyan)}._toggleLabel_3h9eq_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_3h9eq_42 input[type=checkbox]{accent-color:var(--accent-cyan);cursor:pointer}._taskList_3h9eq_61{flex:1;overflow-y:auto;padding:12px 24px}._groupHeader_3h9eq_69{display:flex;align-items:center;gap:8px;padding:8px 0 6px;cursor:pointer;-webkit-user-select:none;user-select:none}._groupChevron_3h9eq_78{width:10px;height:10px;flex-shrink:0;transition:transform .15s ease;color:var(--text-dim)}._groupChevron_3h9eq_78._collapsed_3h9eq_86{transform:rotate(-90deg)}._groupLabel_3h9eq_90{font-size:11px;letter-spacing:1.5px;color:var(--text-dim);text-transform:uppercase;font-family:var(--font-mono);flex:1}._groupCount_3h9eq_99{font-size:10px;color:var(--text-dim);font-family:var(--font-mono)}._taskCard_3h9eq_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_3h9eq_107:hover{background:var(--bg-subtle);border-color:#ffffff1a}._completed_3h9eq_124{opacity:.5}._completed_3h9eq_124 ._taskTitle_3h9eq_128{text-decoration:line-through;color:var(--text-dim)}._overdue_3h9eq_133{border-color:var(--accent-red);box-shadow:0 0 8px color-mix(in srgb,var(--accent-red) 30%,transparent)}._dueToday_3h9eq_138{border-color:var(--accent-yellow);box-shadow:0 0 8px color-mix(in srgb,var(--accent-yellow) 20%,transparent)}._checkbox_3h9eq_145{width:18px;height:18px;flex-shrink:0;margin-top:1px;accent-color:var(--accent-cyan);cursor:pointer}._checkbox_3h9eq_145:checked{filter:drop-shadow(0 0 4px var(--accent-cyan))}._taskContent_3h9eq_160{flex:1;min-width:0}._taskHeader_3h9eq_165{display:flex;align-items:center;gap:8px;margin-bottom:2px}._taskTitle_3h9eq_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_3h9eq_128:hover{color:var(--accent-cyan)}._taskTitleInput_3h9eq_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_3h9eq_204{font-size:9px;font-weight:600;letter-spacing:.5px;text-transform:uppercase;padding:1px 16px 1px 6px;border-radius:3px;flex-shrink:0;line-height:1.6;transition:filter .15s ease,transform .15s ease;cursor:pointer;font-family:var(--font-mono, "JetBrains Mono", monospace);-webkit-appearance:none;-moz-appearance:none;appearance:none;background-repeat:no-repeat;background-position:right 4px center;background-image:url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%23888' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");outline:none}._priorityBadge_3h9eq_204:hover{filter:brightness(1.3);transform:scale(1.05)}._priorityUrgent_3h9eq_231{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_3h9eq_237{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_3h9eq_243{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_3h9eq_249{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_3h9eq_257{display:flex;align-items:center;gap:8px;margin-top:4px;flex-wrap:wrap}._dueDate_3h9eq_265{font-size:10px;font-family:var(--font-mono);color:var(--text-dim)}._dueDateOverdue_3h9eq_271{color:var(--accent-red)}._dueDateToday_3h9eq_275{color:var(--accent-yellow)}._tag_3h9eq_279{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_3h9eq_279:hover{background:color-mix(in srgb,var(--accent-cyan) 20%,transparent);border-color:var(--accent-cyan)}._tagInput_3h9eq_294{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_3h9eq_307{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_3h9eq_307:hover{color:var(--accent-cyan);border-color:var(--accent-cyan)}._description_3h9eq_327{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_3h9eq_337{font-size:10px;color:var(--text-dim);cursor:pointer;background:none;border:none;padding:0;font-family:var(--font-mono);margin-top:4px}._descriptionToggle_3h9eq_337:hover{color:var(--accent-cyan)}._deleteBtn_3h9eq_354{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_3h9eq_354:hover{color:var(--accent-red);background:color-mix(in srgb,var(--accent-red) 15%,transparent)}._addForm_3h9eq_375{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_3h9eq_375 input[type=text],._addForm_3h9eq_375 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_3h9eq_375 input[type=text]:focus,._addForm_3h9eq_375 input[type=date]:focus{border-color:var(--accent-cyan)}._addForm_3h9eq_375 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_3h9eq_375 select:focus{border-color:var(--accent-cyan)}._titleInput_3h9eq_418{flex:1;min-width:180px}._tagsInput_3h9eq_423{min-width:120px;width:140px}._addBtn_3h9eq_428{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_3h9eq_428:hover:not(:disabled){background:color-mix(in srgb,var(--accent-cyan) 25%,transparent)}._addBtn_3h9eq_428:disabled{opacity:.4;cursor:not-allowed}._emptyState_3h9eq_454{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_3h9eq_454 span{font-size:11px;color:var(--text-dim);opacity:.6}._loading_3h9eq_475{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_3h9eq_488{padding:6px 24px;font-size:11px;color:var(--text-secondary);font-family:var(--font-mono);display:flex;gap:6px;flex-shrink:0}._statsSep_3h9eq_498{color:var(--text-dim)}._confirmOverlay_3h9eq_504{display:flex;align-items:center;gap:6px;font-size:10px;font-family:var(--font-mono);color:var(--accent-red)}._confirmBtn_3h9eq_513{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_3h9eq_513:hover{background:color-mix(in srgb,var(--accent-red) 30%,transparent)}._cancelBtn_3h9eq_528{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_3h9eq_528:hover{border-color:var(--text-dim)}
@@ -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-C13EUDCm.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-C13EUDCm.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-C13EUDCm.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-C13EUDCm.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};