pisper 0.6.22 → 0.6.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/package.json +5 -5
  2. package/web/.vite/manifest.json +550 -550
  3. package/web/assets/{AppDialog-BluIYP8v.js → AppDialog-_fH6eQpb.js} +1 -1
  4. package/web/assets/{AppOverlays-vn_Ter3M.js → AppOverlays-BMST1vfu.js} +1 -1
  5. package/web/assets/{AssetsPage-CLlSYXp8.js → AssetsPage-CDJmOEP7.js} +1 -1
  6. package/web/assets/{BoardPage-nSsZudtr.js → BoardPage-CJT8VYBj.js} +3 -3
  7. package/web/assets/{ChannelsPage-DqnfAoWC.js → ChannelsPage-l3o-utCr.js} +1 -1
  8. package/web/assets/{ChatAppearancePage-2itvW4ex.js → ChatAppearancePage-CdJHIq2M.js} +1 -1
  9. package/web/assets/{ChatHistoryPage-OPTj6spQ.js → ChatHistoryPage-7EAqApuM.js} +1 -1
  10. package/web/assets/{ChatPage-C_3_rpJn.js → ChatPage-DPnOu_7p.js} +3 -3
  11. package/web/assets/{ConfigPage-DnPb_QrV.js → ConfigPage-Qd6FIlD6.js} +2 -2
  12. package/web/assets/{DesktopWindowControls-DQf3N-Pq.js → DesktopWindowControls-X6khTXXD.js} +1 -1
  13. package/web/assets/{FeaturePage-B8dFhtLs.js → FeaturePage-CgoODqI_.js} +1 -1
  14. package/web/assets/{FileAttachmentPreview-CeQTyfpt.js → FileAttachmentPreview-WMfxb0MX.js} +1 -1
  15. package/web/assets/{FloatingWidgets-CWpMJq1K.js → FloatingWidgets-CtU5t-r2.js} +1 -1
  16. package/web/assets/{FocusRuntimeControls-J_hbXz7v.js → FocusRuntimeControls-DSAsb9Mz.js} +1 -1
  17. package/web/assets/{GitDiffViewer-DZm3DoP7.js → GitDiffViewer-AcMle1-H.js} +1 -1
  18. package/web/assets/{ManageProjectsDialog-VaG1Uu6p.js → ManageProjectsDialog-jq84FKmf.js} +1 -1
  19. package/web/assets/{MarkdownMessage-Dbypp4RC.js → MarkdownMessage-BDrWMmiv.js} +1 -1
  20. package/web/assets/{McpPage-D8NZyKoO.js → McpPage-Dyz-7b-d.js} +1 -1
  21. package/web/assets/{MemoryPage-DZsAXror.js → MemoryPage-CG-PNmFi.js} +1 -1
  22. package/web/assets/{MobileNavigation-DHWkx5h0.js → MobileNavigation-oAbj8oEW.js} +1 -1
  23. package/web/assets/{MorePage-PK0vEEda.js → MorePage-7NckHj2X.js} +1 -1
  24. package/web/assets/{NewFolderDialog-DjC2xSrj.js → NewFolderDialog-CSwYKD8L.js} +1 -1
  25. package/web/assets/{PageHeader-CcgJJB4K.js → PageHeader-BWTQQV6l.js} +1 -1
  26. package/web/assets/{PhoneDrawer-DMIlKCRW.js → PhoneDrawer-CRjYXK4U.js} +1 -1
  27. package/web/assets/{PhoneMenuButton-dzvj0NS0.js → PhoneMenuButton-YyU4CxN-.js} +1 -1
  28. package/web/assets/{PhoneTopBar-UqSQG8KO.js → PhoneTopBar-fFBj5SYy.js} +1 -1
  29. package/web/assets/{PluginsPage-D_7E0Mcm.js → PluginsPage-TtUACDkO.js} +1 -1
  30. package/web/assets/{SafeModePrompt-CYubRBr0.js → SafeModePrompt-BdJZpk9Z.js} +1 -1
  31. package/web/assets/{SchedulesPage-BsX821QZ.js → SchedulesPage-CEont77M.js} +1 -1
  32. package/web/assets/{SessionBrowserPane-ZvjA5vop.js → SessionBrowserPane-C41VsVCn.js} +2 -2
  33. package/web/assets/{SessionContextPanel-39eXpERL.js → SessionContextPanel-UpOQ6Tf5.js} +2 -2
  34. package/web/assets/{SessionHome-Cm131bvz.js → SessionHome-ByCLax94.js} +1 -1
  35. package/web/assets/{SessionInspector-DiSWVd6R.js → SessionInspector-BQ-ZzmN8.js} +1 -1
  36. package/web/assets/{SessionShell-DiWPHdio.js → SessionShell-DzcjZ9sC.js} +1 -1
  37. package/web/assets/{SettingsSidebar-Br83KuNT.js → SettingsSidebar-BnzGBl2P.js} +1 -1
  38. package/web/assets/{ShortcutHelpDialog-rmlTJwrg.js → ShortcutHelpDialog-6xpCSBSl.js} +1 -1
  39. package/web/assets/{ShortcutKeys-CE7wsdx4.js → ShortcutKeys-wE65pcQn.js} +1 -1
  40. package/web/assets/{SidebarUpdateStatus-BSxoGQFm.js → SidebarUpdateStatus-1ObaQPYU.js} +1 -1
  41. package/web/assets/{SkillsPage-zrZCbP5L.js → SkillsPage-DCqMIsRZ.js} +1 -1
  42. package/web/assets/{TaskProcessesPane-B9a-bK8Q.js → TaskProcessesPane-B4o1GC7K.js} +1 -1
  43. package/web/assets/{TaskTerminalView-Dnl9t0Yq.js → TaskTerminalView-DxVr8Wtj.js} +1 -1
  44. package/web/assets/{TerminalPanel-EbsJNe9L.js → TerminalPanel-lHTUD4Da.js} +1 -1
  45. package/web/assets/{WebDesktopPet-CqR3puOx.js → WebDesktopPet-KS-ffs_Y.js} +1 -1
  46. package/web/assets/{WorkflowsPage-ChXjB-wW.js → WorkflowsPage-BiWUVESO.js} +1 -1
  47. package/web/assets/{WorkspacePicker-CojYPYIa.js → WorkspacePicker-BdQxcQ7F.js} +1 -1
  48. package/web/assets/{api-3pnTJcsp.js → api-CWaE7hay.js} +1 -1
  49. package/web/assets/{app-update-C6PjqV-N.js → app-update-BhZYouFz.js} +1 -1
  50. package/web/assets/{approval-confirm-Ng3lhZR9.js → approval-confirm-hgX2Qj5h.js} +1 -1
  51. package/web/assets/{board-projects-Cn83x27D.js → board-projects-Br5xIhXi.js} +1 -1
  52. package/web/assets/{bots-store-B0uE78FQ.js → bots-store-BxXimpjG.js} +1 -1
  53. package/web/assets/{chat-api-DE-00AQt.js → chat-api-DIe7JvSq.js} +1 -1
  54. package/web/assets/{client-store-B0G8KCEA.js → client-store-BVvrKxe7.js} +1 -1
  55. package/web/assets/{config-search-Cnob89Wh.js → config-search-BS9VXlM0.js} +1 -1
  56. package/web/assets/{dialog-sq6TFrs2.js → dialog-VGmRGR6P.js} +1 -1
  57. package/web/assets/{events-BYm_7rfH.js → events-CAk4qwf5.js} +1 -1
  58. package/web/assets/{folder-paths-BeZN9wq7.js → folder-paths-9JtGeIlu.js} +1 -1
  59. package/web/assets/{hosts-BWu_xvML.js → hosts-Cc6SO6LM.js} +1 -1
  60. package/web/assets/i18n-BkTAd6ln.js +1 -0
  61. package/web/assets/{index-DT21IKeB.js → index-BEFqinGB.js} +2 -2
  62. package/web/assets/{mount-app-YAzhl88_.js → mount-app-Z24rEaKY.js} +3 -3
  63. package/web/assets/{permission-rules-api-DdYftUQE.js → permission-rules-api-C_to5cI_.js} +1 -1
  64. package/web/assets/{pick-system-directory-LOpQirAM.js → pick-system-directory-BEo0M2BR.js} +1 -1
  65. package/web/assets/{placements-BzbpQDQ7.js → placements-41bRhaLX.js} +2 -2
  66. package/web/assets/{popover-CEwCyvso.js → popover-CyHncZuo.js} +1 -1
  67. package/web/assets/{public-CgfPT7gK.js → public-BLPYRVOl.js} +2 -2
  68. package/web/assets/{public-CoivUKr6.js → public-BxfK5CJX.js} +1 -1
  69. package/web/assets/{public-Ck1i4t8o.js → public-Dxz02eyM.js} +1 -1
  70. package/web/assets/{public-components-CQf0np0Z.js → public-components--elKl8rY.js} +1 -1
  71. package/web/assets/public-diff-DuYNyToX.js +1 -0
  72. package/web/assets/public-events-CVwkgTyV.js +1 -0
  73. package/web/assets/{public-flags-DZvYvsWH.js → public-flags-bV1lnTa9.js} +1 -1
  74. package/web/assets/{public-session-Bx2TqcKh.js → public-session-71n0uBba.js} +1 -1
  75. package/web/assets/{public-sidebar-3z7xPwe3.js → public-sidebar-COsk0-e3.js} +1 -1
  76. package/web/assets/{runtime-capabilities-store-CDhzPVU-.js → runtime-capabilities-store-DIlItxug.js} +1 -1
  77. package/web/assets/{safe-mode-instance-D_H4Z8Xv.js → safe-mode-instance-B4YViTAj.js} +1 -1
  78. package/web/assets/safe-mode-sentinel-BOIlJBCx.js +1 -0
  79. package/web/assets/{session-change-summary-api-CxOV5OrA.js → session-change-summary-api-Dvl_So5i.js} +1 -1
  80. package/web/assets/{session-home-chPk0XEV.js → session-home-CpduZY-Y.js} +1 -1
  81. package/web/assets/{session-organization-api-A3EudhgK.js → session-organization-api-C3f-pQuJ.js} +1 -1
  82. package/web/assets/{session-scope-CF4OLtKw.js → session-scope-9NO78BDR.js} +1 -1
  83. package/web/assets/{session-tree-actions-DNefaiZO.js → session-tree-actions-Ch4rkxjV.js} +1 -1
  84. package/web/assets/{session-tree-summary-DPqtCWEP.js → session-tree-summary-DXft8Rmr.js} +1 -1
  85. package/web/assets/{shortcuts-zcQP1D4E.js → shortcuts-BtoPU0le.js} +1 -1
  86. package/web/assets/{side-chat-context-BpjCorLu.js → side-chat-context-D7xA1822.js} +4 -4
  87. package/web/assets/{sidebar-Bb6NlEeR.js → sidebar-CG-HyJsS.js} +1 -1
  88. package/web/assets/{sidebar-store-CQWNlMxT.js → sidebar-store-C9Pot2yY.js} +1 -1
  89. package/web/assets/{speech-session-2WJk-z3P.js → speech-session-TxJG88R-.js} +1 -1
  90. package/web/assets/{startup-queries-C9AHlyOp.js → startup-queries-VYxaEx9w.js} +1 -1
  91. package/web/assets/{use-i18n-BPJI6-Ue.js → use-i18n-D2lZDIiK.js} +1 -1
  92. package/web/assets/{use-open-bot-5wf_No4c.js → use-open-bot-CFe4Kt8r.js} +1 -1
  93. package/web/assets/{use-studio-actions-C5heO0nL.js → use-studio-actions-CfZNLW6c.js} +1 -1
  94. package/web/assets/{useCatalogProjects-BWKT2GrE.js → useCatalogProjects-CGj_Phaf.js} +1 -1
  95. package/web/assets/{useNewProjectPicker-BCkEpwht.js → useNewProjectPicker-pn-RD8BP.js} +2 -2
  96. package/web/assets/{useNow-e0HHzVad.js → useNow-CtiiZXYi.js} +1 -1
  97. package/web/assets/{usePhoneShell-C90daPSI.js → usePhoneShell-CnoUyYeJ.js} +1 -1
  98. package/web/assets/{useSessionListQuery-Ezaq4rI5.js → useSessionListQuery-BeFsCihm.js} +1 -1
  99. package/web/assets/{useSessionRowActions-BIJ-eKcN.js → useSessionRowActions-Cv7ZLvGZ.js} +1 -1
  100. package/web/assets/{useSidebarModel-DDqX8onb.js → useSidebarModel-BFDzcvAc.js} +1 -1
  101. package/web/assets/{web-preview-C5NXKRu-.js → web-preview-BvYYjssc.js} +1 -1
  102. package/web/assets/{web-preview-events-CIJw4Wx-.js → web-preview-events-DREck2MQ.js} +1 -1
  103. package/web/assets/{workspace-order-store-0jm2oVHS.js → workspace-order-store-BDSlzOUk.js} +1 -1
  104. package/web/index.html +1 -1
  105. package/web/assets/i18n-Cewq43aI.js +0 -1
  106. package/web/assets/public-diff-wY-tpFFs.js +0 -1
  107. package/web/assets/public-events-B-fuAF9_.js +0 -1
  108. package/web/assets/safe-mode-sentinel-BG7I9wh1.js +0 -1
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./index-DT21IKeB.js";import{i as n,r}from"./vendor-react-DwNgTV1j.js";import{t as i}from"./use-i18n-BPJI6-Ue.js";import{t as a}from"./storage-8QW6lXuT.js";import{t as o}from"./useQuery-DdcpUQhO.js";import{a as s,n as c,o as l,t as u}from"./startup-queries-C9AHlyOp.js";import{t as d}from"./api-3pnTJcsp.js";import{t as ee}from"./usePhoneShell-C90daPSI.js";import{t as f}from"./createLucideIcon-Cd-3GVxJ.js";import{a as p,c as te,t as ne}from"./session-list-BeyOEzyU.js";import{t as re}from"./ellipsis-CfGKfbq6.js";import{t as ie}from"./pencil-U08v_vV9.js";import{t as m}from"./pin-CU0FG0lI.js";import{t as ae}from"./refresh-cw-TbWxTY4K.js";import{t as oe}from"./square-pen-hYbjKh6A.js";import{t as se}from"./trash-2-CNrPOoPR.js";import{t as h}from"./brand-DIEc3fK8.js";import{t as ce}from"./more-pages-D_PnxLN0.js";import{c as le,i as g,p as ue,r as de,t as fe}from"./dropdown-menu-Ds0gD8S8.js";import{t as _}from"./utils-C8uzG5AZ.js";import{n as pe,t as v}from"./button-CCcCN8tE.js";import{c as me,t as y,u as b,y as he}from"./events-BYm_7rfH.js";import{s as ge}from"./shortcuts-zcQP1D4E.js";import{n as _e,t as ve}from"./session-organization-api-A3EudhgK.js";import{a as ye,o as be}from"./format-DMJQzoZ7.js";import{t as x}from"./StatusGlyph-1KgitlUg.js";import{t as S}from"./session-change-summary-api-CxOV5OrA.js";import{n as C}from"./PageState-Cz6vFMXv.js";import{a as xe,i as Se,n as Ce,o as we,r as Te,s as Ee,t as De}from"./FeaturePage-B8dFhtLs.js";import{t as Oe}from"./badge-CWB3lj2H.js";var ke=f(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),Ae=f(`folder-closed`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`M2 10h20`,key:`1ir3d8`}]]),je=f(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),w=e(n(),1),T=864e5;function E(e,t=Date.now()){if(e.pinned)return`pinned`;let n=Date.parse(e.modified||``);if(!Number.isFinite(n))return`earlier`;let r=new Date(t);return r.setHours(0,0,0,0),n>=r.getTime()?`today`:n>=r.getTime()-6*T?`week`:`earlier`}function D(e,t,n=Date.now()){let r=new Map;return e.forEach((e,i)=>{let a=E(e,n),o=r.get(a)??{key:a,count:0,items:[]};o.count+=1,i<t&&o.items.push(e),r.set(a,o)}),[...r.values()].filter(e=>e.items.length>0)}function Me(e,t,n,r=`active`,i=Date.now()){let a=t.trim().toLowerCase(),o=a?e.filter(e=>`${e.name||``} ${e.firstMessage||``} ${e.cwd||``} ${e.model||``}`.toLowerCase().includes(a)):e.filter(e=>!!e.archived==(r===`archived`)),s=p(o),c=s.slice(0,Math.max(0,n));return{total:o.length,items:c,groups:D(s,c.length,i)}}var O=r();function k({sessionId:e,lastCompletedAt:t,streaming:n}){let{t:r}=i(),a=(0,w.useRef)(null),[s,c]=(0,w.useState)(!1);(0,w.useEffect)(()=>{let e=a.current;if(!e||s)return;if(!(`IntersectionObserver`in window)){c(!0);return}let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(c(!0),t.disconnect())},{rootMargin:`120px`});return t.observe(e),()=>t.disconnect()},[s]);let{data:l}=o({queryKey:[`session-change-summary`,e,t],queryFn:()=>S(e),enabled:s,staleTime:6e4,retry:0,refetchInterval:n&&s?2e4:!1});return l?.status!==`known`||!l.changedFiles?(0,O.jsx)(`span`,{ref:a}):(0,O.jsx)(`span`,{ref:a,className:`ml-1 inline-flex items-center gap-1 tabular-nums before:mr-1 before:content-['·']`,children:r(`chat:chatHistoryPage.changeSummary`,{count:l.changedFiles,added:l.added||0,removed:l.removed||0})})}function A(e){s.setQueryData(u,t=>t&&{...t,sessions:e(t.sessions||[])})}function j({navigate:e,onBack:n,onNewTask:r,notify:s,requestConfirm:u,requestText:f}){let{t:S,language:T}=i(),E=ee(),D=ge(`focusSearch`),[j,Ne]=(0,w.useState)(``),M=o(l(`sessions`)),N=(0,w.useMemo)(()=>p(M.data?.sessions||[]),[M.data]),[P,Pe]=(0,w.useState)(`active`),F=`${P}\0${j}`,[I,L]=(0,w.useState)({filterKey:F,count:50}),R=(0,w.useRef)(!1),z=(0,w.useRef)(null),[B,V]=(0,w.useState)(()=>t.getItem(a.activeSession)||``),[Fe,H]=(0,w.useState)(!1),[U,W]=(0,w.useState)(``),G=M.isPending||Fe,K=M.error&&!M.data?M.error instanceof Error?M.error.message:String(M.error):``;(0,w.useEffect)(()=>{L(e=>e.filterKey===F&&e.count===50?e:{filterKey:F,count:50})},[F]);let q=(0,w.useCallback)(async()=>{H(!0),W(``);try{await c(`sessions`,!0)}catch(e){W(e instanceof Error?e.message:String(e))}finally{H(!1)}},[]);(0,w.useEffect)(()=>(document.title=`${S(`chat:chatHistoryPage.chatHistory`)} · ${h}`,()=>{document.title=h}),[S]),(0,w.useEffect)(()=>{let e=e=>V(e.detail?.id||t.getItem(a.activeSession)||``);return window.addEventListener(y,e),()=>window.removeEventListener(y,e)},[]);let J=I.filterKey===F?I.count:50,Y=(0,w.useMemo)(()=>Me(N,j,J,P),[P,j,N,J]),X=N.filter(e=>e.archived).length,Z={active:N.length-X,archived:X},Ie={pinned:S(`chat:chatHistoryPage.groupPinned`),today:S(`chat:chatHistoryPage.groupToday`),week:S(`chat:chatHistoryPage.groupWeek`),earlier:S(`chat:chatHistoryPage.groupEarlier`)};(0,w.useEffect)(()=>{R.current&&(R.current=!1,z.current?.focus())},[Y.items.length,Y.total]);let Le=t=>{he(t),e(`chat`)},Re=async e=>{let t=await f({title:S(`chat:chatHistoryPage.renameChat`),inputLabel:S(`chat:chatHistoryPage.chatTitle`),value:e.name,confirmLabel:S(`chat:chatHistoryPage.save`)});if(t!==null&&t!==e.name)try{let n=await d(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`PATCH`,body:JSON.stringify({name:t})});A(t=>t.map(t=>t.id===e.id?{...t,name:n.name}:t)),b({id:e.id,name:n.name}),s(S(`chat:chatHistoryPage.chatTitleUpdated`))}catch(e){W(e instanceof Error?e.message:String(e))}},Q=async(e,t,n)=>{try{let r=await _e(e.id,t);A(e=>ne(e,r)),s(n)}catch(e){W(e instanceof ve?S(`chat:chatHistoryPage.sessionUpdateFailed`):e instanceof Error?e.message:String(e))}},ze=async e=>{if(await u({title:S(`chat:chatHistoryPage.deleteChat`),message:S(`chat:chatHistoryPage.deleteChatNameThisAlsoRemovesLocalChatHistory`,{name:e.name}),confirmLabel:S(`chat:chatHistoryPage.delete`)}))try{await d(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`DELETE`});let n=N.filter(t=>t.id!==e.id);if(A(t=>t.filter(t=>t.id!==e.id)),B===e.id){let e=n[0]?.id||``;V(e),e?t.setItem(a.activeSession,e):t.removeItem(a.activeSession),me(e)}b({deletedIds:[e.id]}),s(S(`chat:chatHistoryPage.chatDeleted`))}catch(e){W(e instanceof Error?e.message:String(e))}},Be=e=>e.streaming?(0,O.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-content-secondary`,children:[(0,O.jsx)(x,{status:`run`,className:`size-3.5`}),S(`chat:chatHistoryPage.statusRunning`)]}):e.needsAttention?(0,O.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 font-medium text-warning-strong`,children:[(0,O.jsx)(x,{status:`attention`,className:`size-3.5`}),e.attentionReason===`failure`?S(`chat:chatHistoryPage.statusFailed`):e.attentionReason===`approval`?S(`chat:chatHistoryPage.statusApproval`):S(`chat:chatHistoryPage.needsAttention`)]}):null,$=S(`chat:chatHistoryPage.chatHistory`),Ve=j?S(`chat:chatHistoryPage.noMatchingConversations`):P===`archived`?S(`chat:chatHistoryPage.noArchivedChats`):N.length?S(`chat:chatHistoryPage.noActiveChats`):S(`chat:chatHistoryPage.noConversationsHaveLeftAnEchoYet`),He=j?S(`chat:chatHistoryPage.tryADifferentSearch`):P===`archived`?S(`chat:chatHistoryPage.archivedChatsAppearHere`):N.length?S(`chat:chatHistoryPage.restoreArchivedChats`):S(`chat:chatHistoryPage.onceAConversationBeginsItWillBeQuietlyGatheredHere`);return(0,O.jsx)(Te,{title:$,description:S(`chat:chatHistoryPage.lede`),back:n&&{label:S(`navigation:sidebar.features`),ariaLabel:S(`navigation:shell.backToFeaturesLabel`),onBack:n},toolbar:(0,O.jsx)(Ee,{search:(0,O.jsx)(xe,{id:ce,value:j,onValueChange:Ne,placeholder:S(`navigation:pageHeader.searchPage`,{page:$}),shortcut:D,clearLabel:S(`navigation:more.clearSearch`)}),actions:r&&!E&&(0,O.jsxs)(v,{type:`button`,className:`h-9`,onClick:r,children:[(0,O.jsx)(oe,{}),S(`navigation:shell.newTask`)]}),filters:(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[(0,O.jsx)(`div`,{role:`group`,"aria-label":S(`chat:chatHistoryPage.historySections`),className:`inline-grid h-8 grid-cols-2 rounded-md border border-stroke bg-chrome p-[3px] max-[650px]:h-auto max-[650px]:flex-1 max-[650px]:rounded-[10px] pointer-coarse:h-auto`,children:[`active`,`archived`].map(e=>(0,O.jsxs)(`button`,{type:`button`,"aria-pressed":P===e,"aria-label":e===`active`?S(`chat:chatHistoryPage.activeChatsCount`,{count:Z.active}):S(`chat:chatHistoryPage.archivedChats`,{count:Z.archived}),className:_(`inline-flex min-w-0 items-center justify-center gap-1.5 rounded-sm border border-transparent px-3 text-sm text-content-secondary transition-colors duration-(--d-fast) hover:text-content max-[650px]:h-11 max-[650px]:text-base pointer-coarse:h-11`,P===e&&`border-key-border bg-key font-medium text-content shadow-key`),onClick:()=>Pe(e),children:[S(e===`active`?`chat:chatHistoryPage.activeChats`:`chat:chatHistoryPage.archived`),(0,O.jsx)(`span`,{className:_(`text-xs font-normal tabular-nums`,P===e?`text-content-secondary`:`text-content-muted`),children:Z[e]})]},e))}),(0,O.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 text-xs text-content-muted tabular-nums`,children:[(0,O.jsxs)(`span`,{className:_(`truncate`,!j&&`max-[650px]:hidden`),children:[S(`chat:chatHistoryPage.countChatHistoryItems`,{count:N.length}),` · `,j?S(`chat:chatHistoryPage.countCurrentlyFiltered`,{count:Y.total}):S(`chat:chatHistoryPage.sortedByMostRecentlyUpdated`)]}),(0,O.jsx)(v,{variant:`ghost`,size:`icon-sm`,className:`text-content-muted max-[650px]:size-11 pointer-coarse:size-11`,"aria-label":S(`chat:chatHistoryPage.refresh`),title:S(`chat:chatHistoryPage.refresh`),onClick:()=>void q(),disabled:G,children:G?(0,O.jsx)(pe,{className:`text-current`}):(0,O.jsx)(ae,{size:14})})]})]})}),children:G&&!N.length?(0,O.jsx)(C,{kind:`loading`,title:S(`chat:chatHistoryPage.loadingChatHistory`)}):K&&!N.length?(0,O.jsx)(C,{kind:`error`,title:S(`chat:chatHistoryPage.loadFailed`),description:K,action:(0,O.jsx)(v,{variant:`secondary`,className:`max-[650px]:h-11`,loading:G,disabled:G,onClick:()=>void q(),children:S(`common:pageTemplate.retry`)})}):(0,O.jsxs)(O.Fragment,{children:[(U||K)&&(0,O.jsx)(De,{children:U||K}),Y.total?(0,O.jsxs)(`div`,{className:`chat-history-list`,children:[Y.groups.map(e=>(0,O.jsx)(we,{title:Ie[e.key],count:e.count,children:(0,O.jsx)(Ce,{children:e.items.map(e=>{let t=e.name||S(`chat:chatHistoryPage.untitledChat`),n=e.model&&!/(^|\/)unknown$/i.test(String(e.model))?String(e.model).split(`/`).at(-1):``,r=e.id===B;return(0,O.jsx)(Se,{"data-history-session":e.id,"data-current":r||void 0,className:_(`chat-history-row relative`,r&&`after:absolute after:top-3.5 after:bottom-3.5 after:-left-3 after:w-[3px] after:rounded-r-[3px] after:bg-star max-[650px]:after:-left-2.5`),onOpen:()=>Le(e.id),openLabel:S(`chat:chatHistoryPage.openChatNamed`,{name:t}),name:(0,O.jsxs)(`span`,{className:`chat-history-copy inline-flex max-w-full min-w-0 items-center gap-2`,children:[e.unread&&(0,O.jsx)(`span`,{role:`img`,"aria-label":S(`chat:chatHistoryPage.unread`),className:`size-1.5 shrink-0 rounded-full bg-ink`}),e.pinned&&(0,O.jsx)(m,{className:`size-3.5 shrink-0 text-content-muted`,"aria-hidden":`true`}),(0,O.jsx)(`strong`,{"data-history-name":!0,className:`min-w-0 truncate font-medium`,title:t,children:t})]}),description:(0,O.jsx)(`span`,{className:_(`line-clamp-1`,e.firstMessage?`text-content-secondary`:void 0),children:e.firstMessage||S(`chat:chatHistoryPage.noMessageSummary`)}),meta:(0,O.jsxs)(O.Fragment,{children:[Be(e),e.archived&&j.trim()&&(0,O.jsx)(Oe,{children:S(`chat:chatHistoryPage.archived`)}),(0,O.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1 font-mono`,children:[(0,O.jsx)(Ae,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`truncate`,children:be(e.projectless?``:e.cwd,T)})]}),(0,O.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,O.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:S(`chat:chatHistoryPage.countMessages`,{count:e.messageCount||0})}),n&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`max-[650px]:hidden`,children:`·`}),(0,O.jsx)(`span`,{className:`min-w-0 truncate font-mono max-[650px]:hidden`,children:n})]}),(0,O.jsx)(k,{sessionId:e.id,lastCompletedAt:e.lastCompletedAt,streaming:e.streaming})]}),status:(0,O.jsx)(`time`,{dateTime:e.modified,children:ye(e.modified,T)}),actions:(0,O.jsxs)(fe,{children:[(0,O.jsx)(ue,{asChild:!0,children:(0,O.jsx)(v,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8 shrink-0 text-content-muted max-[650px]:size-11 pointer-coarse:size-11`,"aria-label":S(`chat:chatHistoryPage.moreActionsForChat`,{name:t}),children:(0,O.jsx)(re,{size:16})})}),(0,O.jsxs)(de,{align:`end`,className:`min-w-48`,children:[(0,O.jsxs)(g,{className:`min-h-11`,onSelect:()=>void Re(e),children:[(0,O.jsx)(ie,{}),S(`chat:chatHistoryPage.renameChat`)]}),(0,O.jsxs)(g,{className:`min-h-11`,onSelect:()=>void Q(e,{pinned:!e.pinned},e.pinned?S(`chat:chatHistoryPage.unpinned`):S(`chat:chatHistoryPage.pinned`)),children:[e.pinned?(0,O.jsx)(je,{}):(0,O.jsx)(m,{}),e.pinned?S(`chat:chatHistoryPage.unpin`):S(`chat:chatHistoryPage.pin`)]}),(0,O.jsxs)(g,{className:`min-h-11`,onSelect:()=>void Q(e,{archived:!e.archived},e.archived?S(`chat:chatHistoryPage.restored`):S(`chat:chatHistoryPage.movedToArchive`)),children:[e.archived?(0,O.jsx)(ke,{}):(0,O.jsx)(te,{}),e.archived?S(`chat:chatHistoryPage.restore`):S(`chat:chatHistoryPage.archive`)]}),e.unread&&(0,O.jsx)(g,{className:`min-h-11`,onSelect:()=>void Q(e,{read:!0},S(`chat:chatHistoryPage.markedRead`)),children:S(`chat:chatHistoryPage.markRead`)}),(0,O.jsx)(le,{}),(0,O.jsxs)(g,{variant:`destructive`,className:`min-h-11`,onSelect:()=>void ze(e),children:[(0,O.jsx)(se,{}),S(`chat:chatHistoryPage.deleteChat`)]})]})]})},e.id)})})},e.key)),Y.total>50&&(0,O.jsx)(`div`,{className:`flex justify-center pt-4`,children:Y.total>Y.items.length?(0,O.jsx)(v,{type:`button`,variant:`secondary`,className:`tabular-nums max-[650px]:min-h-11 pointer-coarse:min-h-11`,onClick:()=>{let e=J+50;R.current=e>=Y.total,L({filterKey:F,count:e})},children:S(`chat:chatHistoryPage.loadMoreChats`,{shown:Y.items.length,total:Y.total})}):(0,O.jsx)(`p`,{ref:z,tabIndex:-1,role:`status`,className:`py-2 text-xs text-content-muted tabular-nums`,children:S(`chat:chatHistoryPage.allChatsShown`,{count:Y.total})})})]}):(0,O.jsx)(C,{kind:`empty`,title:Ve,description:He})]})})}export{j as ChatHistoryPage};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./index-BEFqinGB.js";import{i as n,r}from"./vendor-react-DwNgTV1j.js";import{t as i}from"./use-i18n-D2lZDIiK.js";import{t as a}from"./storage-8QW6lXuT.js";import{t as o}from"./useQuery-DdcpUQhO.js";import{a as s,n as c,o as l,t as u}from"./startup-queries-VYxaEx9w.js";import{t as d}from"./api-CWaE7hay.js";import{t as ee}from"./usePhoneShell-CnoUyYeJ.js";import{t as f}from"./createLucideIcon-Cd-3GVxJ.js";import{a as p,c as te,t as ne}from"./session-list-BeyOEzyU.js";import{t as re}from"./ellipsis-CfGKfbq6.js";import{t as ie}from"./pencil-U08v_vV9.js";import{t as m}from"./pin-CU0FG0lI.js";import{t as ae}from"./refresh-cw-TbWxTY4K.js";import{t as oe}from"./square-pen-hYbjKh6A.js";import{t as se}from"./trash-2-CNrPOoPR.js";import{t as h}from"./brand-DIEc3fK8.js";import{t as ce}from"./more-pages-D_PnxLN0.js";import{c as le,i as g,p as ue,r as de,t as fe}from"./dropdown-menu-Ds0gD8S8.js";import{t as _}from"./utils-C8uzG5AZ.js";import{n as pe,t as v}from"./button-CCcCN8tE.js";import{c as me,t as y,u as b,y as he}from"./events-CAk4qwf5.js";import{s as ge}from"./shortcuts-BtoPU0le.js";import{n as _e,t as ve}from"./session-organization-api-C3f-pQuJ.js";import{a as ye,o as be}from"./format-DMJQzoZ7.js";import{t as x}from"./StatusGlyph-1KgitlUg.js";import{t as S}from"./session-change-summary-api-Dvl_So5i.js";import{n as C}from"./PageState-Cz6vFMXv.js";import{a as xe,i as Se,n as Ce,o as we,r as Te,s as Ee,t as De}from"./FeaturePage-CgoODqI_.js";import{t as Oe}from"./badge-CWB3lj2H.js";var ke=f(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),Ae=f(`folder-closed`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`M2 10h20`,key:`1ir3d8`}]]),je=f(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),w=e(n(),1),T=864e5;function E(e,t=Date.now()){if(e.pinned)return`pinned`;let n=Date.parse(e.modified||``);if(!Number.isFinite(n))return`earlier`;let r=new Date(t);return r.setHours(0,0,0,0),n>=r.getTime()?`today`:n>=r.getTime()-6*T?`week`:`earlier`}function D(e,t,n=Date.now()){let r=new Map;return e.forEach((e,i)=>{let a=E(e,n),o=r.get(a)??{key:a,count:0,items:[]};o.count+=1,i<t&&o.items.push(e),r.set(a,o)}),[...r.values()].filter(e=>e.items.length>0)}function Me(e,t,n,r=`active`,i=Date.now()){let a=t.trim().toLowerCase(),o=a?e.filter(e=>`${e.name||``} ${e.firstMessage||``} ${e.cwd||``} ${e.model||``}`.toLowerCase().includes(a)):e.filter(e=>!!e.archived==(r===`archived`)),s=p(o),c=s.slice(0,Math.max(0,n));return{total:o.length,items:c,groups:D(s,c.length,i)}}var O=r();function k({sessionId:e,lastCompletedAt:t,streaming:n}){let{t:r}=i(),a=(0,w.useRef)(null),[s,c]=(0,w.useState)(!1);(0,w.useEffect)(()=>{let e=a.current;if(!e||s)return;if(!(`IntersectionObserver`in window)){c(!0);return}let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(c(!0),t.disconnect())},{rootMargin:`120px`});return t.observe(e),()=>t.disconnect()},[s]);let{data:l}=o({queryKey:[`session-change-summary`,e,t],queryFn:()=>S(e),enabled:s,staleTime:6e4,retry:0,refetchInterval:n&&s?2e4:!1});return l?.status!==`known`||!l.changedFiles?(0,O.jsx)(`span`,{ref:a}):(0,O.jsx)(`span`,{ref:a,className:`ml-1 inline-flex items-center gap-1 tabular-nums before:mr-1 before:content-['·']`,children:r(`chat:chatHistoryPage.changeSummary`,{count:l.changedFiles,added:l.added||0,removed:l.removed||0})})}function A(e){s.setQueryData(u,t=>t&&{...t,sessions:e(t.sessions||[])})}function j({navigate:e,onBack:n,onNewTask:r,notify:s,requestConfirm:u,requestText:f}){let{t:S,language:T}=i(),E=ee(),D=ge(`focusSearch`),[j,Ne]=(0,w.useState)(``),M=o(l(`sessions`)),N=(0,w.useMemo)(()=>p(M.data?.sessions||[]),[M.data]),[P,Pe]=(0,w.useState)(`active`),F=`${P}\0${j}`,[I,L]=(0,w.useState)({filterKey:F,count:50}),R=(0,w.useRef)(!1),z=(0,w.useRef)(null),[B,V]=(0,w.useState)(()=>t.getItem(a.activeSession)||``),[Fe,H]=(0,w.useState)(!1),[U,W]=(0,w.useState)(``),G=M.isPending||Fe,K=M.error&&!M.data?M.error instanceof Error?M.error.message:String(M.error):``;(0,w.useEffect)(()=>{L(e=>e.filterKey===F&&e.count===50?e:{filterKey:F,count:50})},[F]);let q=(0,w.useCallback)(async()=>{H(!0),W(``);try{await c(`sessions`,!0)}catch(e){W(e instanceof Error?e.message:String(e))}finally{H(!1)}},[]);(0,w.useEffect)(()=>(document.title=`${S(`chat:chatHistoryPage.chatHistory`)} · ${h}`,()=>{document.title=h}),[S]),(0,w.useEffect)(()=>{let e=e=>V(e.detail?.id||t.getItem(a.activeSession)||``);return window.addEventListener(y,e),()=>window.removeEventListener(y,e)},[]);let J=I.filterKey===F?I.count:50,Y=(0,w.useMemo)(()=>Me(N,j,J,P),[P,j,N,J]),X=N.filter(e=>e.archived).length,Z={active:N.length-X,archived:X},Ie={pinned:S(`chat:chatHistoryPage.groupPinned`),today:S(`chat:chatHistoryPage.groupToday`),week:S(`chat:chatHistoryPage.groupWeek`),earlier:S(`chat:chatHistoryPage.groupEarlier`)};(0,w.useEffect)(()=>{R.current&&(R.current=!1,z.current?.focus())},[Y.items.length,Y.total]);let Le=t=>{he(t),e(`chat`)},Re=async e=>{let t=await f({title:S(`chat:chatHistoryPage.renameChat`),inputLabel:S(`chat:chatHistoryPage.chatTitle`),value:e.name,confirmLabel:S(`chat:chatHistoryPage.save`)});if(t!==null&&t!==e.name)try{let n=await d(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`PATCH`,body:JSON.stringify({name:t})});A(t=>t.map(t=>t.id===e.id?{...t,name:n.name}:t)),b({id:e.id,name:n.name}),s(S(`chat:chatHistoryPage.chatTitleUpdated`))}catch(e){W(e instanceof Error?e.message:String(e))}},Q=async(e,t,n)=>{try{let r=await _e(e.id,t);A(e=>ne(e,r)),s(n)}catch(e){W(e instanceof ve?S(`chat:chatHistoryPage.sessionUpdateFailed`):e instanceof Error?e.message:String(e))}},ze=async e=>{if(await u({title:S(`chat:chatHistoryPage.deleteChat`),message:S(`chat:chatHistoryPage.deleteChatNameThisAlsoRemovesLocalChatHistory`,{name:e.name}),confirmLabel:S(`chat:chatHistoryPage.delete`)}))try{await d(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`DELETE`});let n=N.filter(t=>t.id!==e.id);if(A(t=>t.filter(t=>t.id!==e.id)),B===e.id){let e=n[0]?.id||``;V(e),e?t.setItem(a.activeSession,e):t.removeItem(a.activeSession),me(e)}b({deletedIds:[e.id]}),s(S(`chat:chatHistoryPage.chatDeleted`))}catch(e){W(e instanceof Error?e.message:String(e))}},Be=e=>e.streaming?(0,O.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-content-secondary`,children:[(0,O.jsx)(x,{status:`run`,className:`size-3.5`}),S(`chat:chatHistoryPage.statusRunning`)]}):e.needsAttention?(0,O.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 font-medium text-warning-strong`,children:[(0,O.jsx)(x,{status:`attention`,className:`size-3.5`}),e.attentionReason===`failure`?S(`chat:chatHistoryPage.statusFailed`):e.attentionReason===`approval`?S(`chat:chatHistoryPage.statusApproval`):S(`chat:chatHistoryPage.needsAttention`)]}):null,$=S(`chat:chatHistoryPage.chatHistory`),Ve=j?S(`chat:chatHistoryPage.noMatchingConversations`):P===`archived`?S(`chat:chatHistoryPage.noArchivedChats`):N.length?S(`chat:chatHistoryPage.noActiveChats`):S(`chat:chatHistoryPage.noConversationsHaveLeftAnEchoYet`),He=j?S(`chat:chatHistoryPage.tryADifferentSearch`):P===`archived`?S(`chat:chatHistoryPage.archivedChatsAppearHere`):N.length?S(`chat:chatHistoryPage.restoreArchivedChats`):S(`chat:chatHistoryPage.onceAConversationBeginsItWillBeQuietlyGatheredHere`);return(0,O.jsx)(Te,{title:$,description:S(`chat:chatHistoryPage.lede`),back:n&&{label:S(`navigation:sidebar.features`),ariaLabel:S(`navigation:shell.backToFeaturesLabel`),onBack:n},toolbar:(0,O.jsx)(Ee,{search:(0,O.jsx)(xe,{id:ce,value:j,onValueChange:Ne,placeholder:S(`navigation:pageHeader.searchPage`,{page:$}),shortcut:D,clearLabel:S(`navigation:more.clearSearch`)}),actions:r&&!E&&(0,O.jsxs)(v,{type:`button`,className:`h-9`,onClick:r,children:[(0,O.jsx)(oe,{}),S(`navigation:shell.newTask`)]}),filters:(0,O.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[(0,O.jsx)(`div`,{role:`group`,"aria-label":S(`chat:chatHistoryPage.historySections`),className:`inline-grid h-8 grid-cols-2 rounded-md border border-stroke bg-chrome p-[3px] max-[650px]:h-auto max-[650px]:flex-1 max-[650px]:rounded-[10px] pointer-coarse:h-auto`,children:[`active`,`archived`].map(e=>(0,O.jsxs)(`button`,{type:`button`,"aria-pressed":P===e,"aria-label":e===`active`?S(`chat:chatHistoryPage.activeChatsCount`,{count:Z.active}):S(`chat:chatHistoryPage.archivedChats`,{count:Z.archived}),className:_(`inline-flex min-w-0 items-center justify-center gap-1.5 rounded-sm border border-transparent px-3 text-sm text-content-secondary transition-colors duration-(--d-fast) hover:text-content max-[650px]:h-11 max-[650px]:text-base pointer-coarse:h-11`,P===e&&`border-key-border bg-key font-medium text-content shadow-key`),onClick:()=>Pe(e),children:[S(e===`active`?`chat:chatHistoryPage.activeChats`:`chat:chatHistoryPage.archived`),(0,O.jsx)(`span`,{className:_(`text-xs font-normal tabular-nums`,P===e?`text-content-secondary`:`text-content-muted`),children:Z[e]})]},e))}),(0,O.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 text-xs text-content-muted tabular-nums`,children:[(0,O.jsxs)(`span`,{className:_(`truncate`,!j&&`max-[650px]:hidden`),children:[S(`chat:chatHistoryPage.countChatHistoryItems`,{count:N.length}),` · `,j?S(`chat:chatHistoryPage.countCurrentlyFiltered`,{count:Y.total}):S(`chat:chatHistoryPage.sortedByMostRecentlyUpdated`)]}),(0,O.jsx)(v,{variant:`ghost`,size:`icon-sm`,className:`text-content-muted max-[650px]:size-11 pointer-coarse:size-11`,"aria-label":S(`chat:chatHistoryPage.refresh`),title:S(`chat:chatHistoryPage.refresh`),onClick:()=>void q(),disabled:G,children:G?(0,O.jsx)(pe,{className:`text-current`}):(0,O.jsx)(ae,{size:14})})]})]})}),children:G&&!N.length?(0,O.jsx)(C,{kind:`loading`,title:S(`chat:chatHistoryPage.loadingChatHistory`)}):K&&!N.length?(0,O.jsx)(C,{kind:`error`,title:S(`chat:chatHistoryPage.loadFailed`),description:K,action:(0,O.jsx)(v,{variant:`secondary`,className:`max-[650px]:h-11`,loading:G,disabled:G,onClick:()=>void q(),children:S(`common:pageTemplate.retry`)})}):(0,O.jsxs)(O.Fragment,{children:[(U||K)&&(0,O.jsx)(De,{children:U||K}),Y.total?(0,O.jsxs)(`div`,{className:`chat-history-list`,children:[Y.groups.map(e=>(0,O.jsx)(we,{title:Ie[e.key],count:e.count,children:(0,O.jsx)(Ce,{children:e.items.map(e=>{let t=e.name||S(`chat:chatHistoryPage.untitledChat`),n=e.model&&!/(^|\/)unknown$/i.test(String(e.model))?String(e.model).split(`/`).at(-1):``,r=e.id===B;return(0,O.jsx)(Se,{"data-history-session":e.id,"data-current":r||void 0,className:_(`chat-history-row relative`,r&&`after:absolute after:top-3.5 after:bottom-3.5 after:-left-3 after:w-[3px] after:rounded-r-[3px] after:bg-star max-[650px]:after:-left-2.5`),onOpen:()=>Le(e.id),openLabel:S(`chat:chatHistoryPage.openChatNamed`,{name:t}),name:(0,O.jsxs)(`span`,{className:`chat-history-copy inline-flex max-w-full min-w-0 items-center gap-2`,children:[e.unread&&(0,O.jsx)(`span`,{role:`img`,"aria-label":S(`chat:chatHistoryPage.unread`),className:`size-1.5 shrink-0 rounded-full bg-ink`}),e.pinned&&(0,O.jsx)(m,{className:`size-3.5 shrink-0 text-content-muted`,"aria-hidden":`true`}),(0,O.jsx)(`strong`,{"data-history-name":!0,className:`min-w-0 truncate font-medium`,title:t,children:t})]}),description:(0,O.jsx)(`span`,{className:_(`line-clamp-1`,e.firstMessage?`text-content-secondary`:void 0),children:e.firstMessage||S(`chat:chatHistoryPage.noMessageSummary`)}),meta:(0,O.jsxs)(O.Fragment,{children:[Be(e),e.archived&&j.trim()&&(0,O.jsx)(Oe,{children:S(`chat:chatHistoryPage.archived`)}),(0,O.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1 font-mono`,children:[(0,O.jsx)(Ae,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`truncate`,children:be(e.projectless?``:e.cwd,T)})]}),(0,O.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,O.jsx)(`span`,{className:`shrink-0 tabular-nums`,children:S(`chat:chatHistoryPage.countMessages`,{count:e.messageCount||0})}),n&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`max-[650px]:hidden`,children:`·`}),(0,O.jsx)(`span`,{className:`min-w-0 truncate font-mono max-[650px]:hidden`,children:n})]}),(0,O.jsx)(k,{sessionId:e.id,lastCompletedAt:e.lastCompletedAt,streaming:e.streaming})]}),status:(0,O.jsx)(`time`,{dateTime:e.modified,children:ye(e.modified,T)}),actions:(0,O.jsxs)(fe,{children:[(0,O.jsx)(ue,{asChild:!0,children:(0,O.jsx)(v,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8 shrink-0 text-content-muted max-[650px]:size-11 pointer-coarse:size-11`,"aria-label":S(`chat:chatHistoryPage.moreActionsForChat`,{name:t}),children:(0,O.jsx)(re,{size:16})})}),(0,O.jsxs)(de,{align:`end`,className:`min-w-48`,children:[(0,O.jsxs)(g,{className:`min-h-11`,onSelect:()=>void Re(e),children:[(0,O.jsx)(ie,{}),S(`chat:chatHistoryPage.renameChat`)]}),(0,O.jsxs)(g,{className:`min-h-11`,onSelect:()=>void Q(e,{pinned:!e.pinned},e.pinned?S(`chat:chatHistoryPage.unpinned`):S(`chat:chatHistoryPage.pinned`)),children:[e.pinned?(0,O.jsx)(je,{}):(0,O.jsx)(m,{}),e.pinned?S(`chat:chatHistoryPage.unpin`):S(`chat:chatHistoryPage.pin`)]}),(0,O.jsxs)(g,{className:`min-h-11`,onSelect:()=>void Q(e,{archived:!e.archived},e.archived?S(`chat:chatHistoryPage.restored`):S(`chat:chatHistoryPage.movedToArchive`)),children:[e.archived?(0,O.jsx)(ke,{}):(0,O.jsx)(te,{}),e.archived?S(`chat:chatHistoryPage.restore`):S(`chat:chatHistoryPage.archive`)]}),e.unread&&(0,O.jsx)(g,{className:`min-h-11`,onSelect:()=>void Q(e,{read:!0},S(`chat:chatHistoryPage.markedRead`)),children:S(`chat:chatHistoryPage.markRead`)}),(0,O.jsx)(le,{}),(0,O.jsxs)(g,{variant:`destructive`,className:`min-h-11`,onSelect:()=>void ze(e),children:[(0,O.jsx)(se,{}),S(`chat:chatHistoryPage.deleteChat`)]})]})]})},e.id)})})},e.key)),Y.total>50&&(0,O.jsx)(`div`,{className:`flex justify-center pt-4`,children:Y.total>Y.items.length?(0,O.jsx)(v,{type:`button`,variant:`secondary`,className:`tabular-nums max-[650px]:min-h-11 pointer-coarse:min-h-11`,onClick:()=>{let e=J+50;R.current=e>=Y.total,L({filterKey:F,count:e})},children:S(`chat:chatHistoryPage.loadMoreChats`,{shown:Y.items.length,total:Y.total})}):(0,O.jsx)(`p`,{ref:z,tabIndex:-1,role:`status`,className:`py-2 text-xs text-content-muted tabular-nums`,children:S(`chat:chatHistoryPage.allChatsShown`,{count:Y.total})})})]}):(0,O.jsx)(C,{kind:`empty`,title:Ve,description:He})]})})}export{j as ChatHistoryPage};