decocms 4.500.2 → 4.500.3

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 (373) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-CeZzOoVf.js → ActiveShapeUtils-DpXLHK85.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-D4iOZ3Bs.js → AlertCircle-CWfOEKki.js} +1 -1
  3. package/dist/client/assets/{AreaChart-CUWmFHwI.js → AreaChart-BsAvYqSE.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-iygYSRbQ.js → ArrowLeft-B5i4q13h.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-KCSPs-fi.js → ArrowUp-BhTDxCnH.js} +1 -1
  6. package/dist/client/assets/{BarChart-gbo6r8aY.js → BarChart-C3qRncE0.js} +1 -1
  7. package/dist/client/assets/{Building02-EbX1A23K.js → Building02-BB32RZGw.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-DbqLrstZ.js → CategoricalChart-CydyA18G.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-CoJfU94i.js → CheckCircle-BAAjR6Yz.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-DqpRXMOM.js → ChevronSelectorVertical-iTIvKtkg.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-BSm7AtSf.js → ChevronUp-D2V0rxEI.js} +1 -1
  12. package/dist/client/assets/{Copy01-DlA26aBh.js → Copy01-D52Dm87Z.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-CXGPcE51.js → CreditCard01-ukHBKeCx.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-CTugBooH.js → DotsVertical-D3Nk6PKk.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-CJdWK23B.js → ErrorBarContext-CDf4ybMZ.js} +1 -1
  16. package/dist/client/assets/{Globe04-DDiW2Onm.js → Globe04-CD1Fa9uc.js} +1 -1
  17. package/dist/client/assets/{Image01-BjUHwjIr.js → Image01-CBMbNlWB.js} +1 -1
  18. package/dist/client/assets/{Key01-DMnhMxC3.js → Key01-DqMMqipC.js} +1 -1
  19. package/dist/client/assets/{Link01-DKypA3Uf.js → Link01-CnfFWr1B.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-Cjxu7rCw.js → LinkBroken01-ClQXqp6D.js} +1 -1
  21. package/dist/client/assets/{Monitor01-CTL-UG2p.js → Monitor01-CWjK0W6g.js} +1 -1
  22. package/dist/client/assets/{Play-NZWCLDah.js → Play-CiT2g6kK.js} +1 -1
  23. package/dist/client/assets/{Plus-DLTeBarI.js → Plus-DKtqOzS_.js} +1 -1
  24. package/dist/client/assets/{SearchMd-BsNWsFDv.js → SearchMd-Eodh17Ne.js} +1 -1
  25. package/dist/client/assets/{Sector-BRgBibA6.js → Sector-Bte8k9jG.js} +1 -1
  26. package/dist/client/assets/{ShoppingBag01-CWlRU3Ye.js → ShoppingBag01-CXpLfOIN.js} +1 -1
  27. package/dist/client/assets/{Sun-DhZMu2lN.js → Sun-CQyxb836.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-DZEm8csq.js → SwitchHorizontal01-Be__kNWY.js} +1 -1
  29. package/dist/client/assets/{Tool01-o_nJ7Y1x.js → Tool01-BTVhARMR.js} +1 -1
  30. package/dist/client/assets/{Trash01-JZaZB0vu.js → Trash01-Cplj2Ik4.js} +1 -1
  31. package/dist/client/assets/{Upload01-CpEePL13.js → Upload01-B6X2kk3D.js} +1 -1
  32. package/dist/client/assets/{User01-BGOQS9vx.js → User01-CqwCn9hE.js} +1 -1
  33. package/dist/client/assets/{UserSquare-BFlEW2x5.js → UserSquare-Gs4U-X0G.js} +1 -1
  34. package/dist/client/assets/{Users01-C9dOtgmV.js → Users01-HGukenVX.js} +1 -1
  35. package/dist/client/assets/{XAxis-4jP2_ps6.js → XAxis-D9i1XFXQ.js} +1 -1
  36. package/dist/client/assets/{XClose-DO008B8R.js → XClose-57_ntdgF.js} +1 -1
  37. package/dist/client/assets/{ZoomOut-DA1sRe95.js → ZoomOut-CK4FVubR.js} +1 -1
  38. package/dist/client/assets/{access-gate-DsVMqwjM.js → access-gate-BbBcdlA6.js} +1 -1
  39. package/dist/client/assets/{add-connection-dialog-BTQ6Snbx.js → add-connection-dialog-B6QIFmOE.js} +1 -1
  40. package/dist/client/assets/{agent-analytics-CpGEVH02.js → agent-analytics-DeR5Py98.js} +1 -1
  41. package/dist/client/assets/agent-app-jRyWHA-b.js +1 -0
  42. package/dist/client/assets/{agent-assets-D1AunKzQ.js → agent-assets-D65rdJP2.js} +1 -1
  43. package/dist/client/assets/{agent-automation-Ds-y1bNp.js → agent-automation-CevIWzHP.js} +1 -1
  44. package/dist/client/assets/{agent-automations-Bhv6Y5Fg.js → agent-automations-BKd6PuGH.js} +1 -1
  45. package/dist/client/assets/{agent-connect-sources-BWYssaAs.js → agent-connect-sources-CW6aSTWW.js} +1 -1
  46. package/dist/client/assets/agent-deck-iPy3FAq6.js +1 -0
  47. package/dist/client/assets/{agent-e2e-mBRBGP-4.js → agent-e2e-BG2Iz7Ak.js} +1 -1
  48. package/dist/client/assets/{agent-experiments-aivx3wKk.js → agent-experiments-CHzesuAq.js} +1 -1
  49. package/dist/client/assets/{agent-file-p8VPN5Ls.js → agent-file-D5VvPPPX.js} +1 -1
  50. package/dist/client/assets/{agent-hosting-BLydMzz1.js → agent-hosting-CYLr345F.js} +1 -1
  51. package/dist/client/assets/{agent-icon-DDBSTxwl.js → agent-icon-BnC2DyaZ.js} +1 -1
  52. package/dist/client/assets/agent-library-CJFAZEFF.js +1 -0
  53. package/dist/client/assets/agent-library-file-DJUqDoIy.js +1 -0
  54. package/dist/client/assets/{agent-monitor-DwF-OeKx.js → agent-monitor-DLQ5MS-a.js} +1 -1
  55. package/dist/client/assets/{agent-overview-PzlD3Gdw.js → agent-overview-D6dFXlZ4.js} +1 -1
  56. package/dist/client/assets/agent-settings-CHJwqyQm.js +1 -0
  57. package/dist/client/assets/{agent-site-editor-BpVIjbEo.js → agent-site-editor-CEDDq_xW.js} +1 -1
  58. package/dist/client/assets/agent-site-editor-code-LfbJWAq5.js +2 -0
  59. package/dist/client/assets/{agent-site-editor-content-UkRK2sPZ.js → agent-site-editor-content-DXZ1wpLE.js} +3 -3
  60. package/dist/client/assets/agent-site-editor-preview-DA_WWuwo.js +551 -0
  61. package/dist/client/assets/agent-view-KkOLU85d.js +1 -0
  62. package/dist/client/assets/{agent-view-guard-CNj-ECwU.js → agent-view-guard-BmBvgVKz.js} +1 -1
  63. package/dist/client/assets/{agents-list-DIvEheHR.js → agents-list-LTbwlLyC.js} +1 -1
  64. package/dist/client/assets/{ai-providers-Bv4VnLS0.js → ai-providers-Dz5giEXa.js} +1 -1
  65. package/dist/client/assets/{alert-DYBIxnQj.js → alert-DliOvsdZ.js} +1 -1
  66. package/dist/client/assets/{alert-dialog-DpmCpPBI.js → alert-dialog-DaPrRw6H.js} +1 -1
  67. package/dist/client/assets/{analytics-sections-Dv6tHtpt.js → analytics-sections-D4Cqsw8E.js} +1 -1
  68. package/dist/client/assets/api-keys-KOCO7qDg.js +1 -0
  69. package/dist/client/assets/{api-keys-BpociG2u.js → api-keys-ZVp581wb.js} +1 -1
  70. package/dist/client/assets/app-editor-DdlK37s8.js +1 -0
  71. package/dist/client/assets/{asset-utils-BUihGB_o.js → asset-utils-BViQjnRQ.js} +1 -1
  72. package/dist/client/assets/{auth-D1PkW9Uj.js → auth-DpVa9FBr.js} +1 -1
  73. package/dist/client/assets/{auth-catchall-xah8Rp3j.js → auth-catchall-D4OQ62gj.js} +1 -1
  74. package/dist/client/assets/{auth-entry-VLEYf8tT.js → auth-entry-Cz_DhHV3.js} +1 -1
  75. package/dist/client/assets/{auth-split-layout-HBBBJTJB.js → auth-split-layout-DEd5xiLA.js} +1 -1
  76. package/dist/client/assets/{authenticate-and-persist-oauth-BfNR0joU.js → authenticate-and-persist-oauth-CbYI0Hyu.js} +1 -1
  77. package/dist/client/assets/{automation-list-row-IGsRC78W.js → automation-list-row-CkqoLF09.js} +1 -1
  78. package/dist/client/assets/{automation-runs-C60W3bGo.js → automation-runs-Czz5mTZQ.js} +1 -1
  79. package/dist/client/assets/{automations-CaS6shwH.js → automations-CtdrMdnv.js} +1 -1
  80. package/dist/client/assets/{autosend-D3KZZhDs.js → autosend-Dna7U2HC.js} +1 -1
  81. package/dist/client/assets/{avatar-Brh_8d7a.js → avatar-DkyZyTLO.js} +1 -1
  82. package/dist/client/assets/{badge-Dp13ql_I.js → badge-8YPtojDh.js} +1 -1
  83. package/dist/client/assets/{block-document-Cxj1MUpK.js → block-document-DN2iU4sd.js} +3 -3
  84. package/dist/client/assets/{blocks-preview-workspace-context-D7M7BwP7.js → blocks-preview-workspace-context-B1X4jaIN.js} +1 -1
  85. package/dist/client/assets/{blog-schema-G4wBIdc6.js → blog-schema-DqTsSzyb.js} +1 -1
  86. package/dist/client/assets/{board-analytics-DO-wkHdX.js → board-analytics-x9jjsPTb.js} +1 -1
  87. package/dist/client/assets/{buckets-C5bRLlmM.js → buckets-D-HqnMa7.js} +1 -1
  88. package/dist/client/assets/{build-improve-prompt-doc-DHL2uEEa.js → build-improve-prompt-doc-B1CQIB3s.js} +1 -1
  89. package/dist/client/assets/{calendar-DEB-AUfC.js → calendar-NFkdhgk9.js} +1 -1
  90. package/dist/client/assets/{capability-load-error-CR2FG7xy.js → capability-load-error-CABlEf-V.js} +1 -1
  91. package/dist/client/assets/{category-editor-DfXKd-cd.js → category-editor-YNMOAbYu.js} +1 -1
  92. package/dist/client/assets/{chart-CXoR26LQ.js → chart-DKHjNlDg.js} +1 -1
  93. package/dist/client/assets/{chat-context-BR-PmAJg.js → chat-context-kJ7vpE9_.js} +1 -1
  94. package/dist/client/assets/{chat-draft-CWFQi3-d.js → chat-draft-BS9tIUoh.js} +1 -1
  95. package/dist/client/assets/{checkbox-CGTvhz0x.js → checkbox-CS0Igoet.js} +1 -1
  96. package/dist/client/assets/{choose-editor-DBCIeCbR.js → choose-editor-B402eTw2.js} +1 -1
  97. package/dist/client/assets/claim-phase-copy-CxTfX9Sr.js +1 -0
  98. package/dist/client/assets/{cli-auth-success-Nd2PZ9ox.js → cli-auth-success-rHBSNHET.js} +1 -1
  99. package/dist/client/assets/{client-icons-BI4heyKD.js → client-icons-CqYsPRCJ.js} +1 -1
  100. package/dist/client/assets/{collapsible-Cq1aFrCg.js → collapsible-BeEr-w4N.js} +1 -1
  101. package/dist/client/assets/{collection-detail-ClkMaErn.js → collection-detail-IBaUmFEi.js} +1 -1
  102. package/dist/client/assets/{collection-display-button-BjwUZtSd.js → collection-display-button-xcC6AWnY.js} +1 -1
  103. package/dist/client/assets/{collection-search-Cp82h57b.js → collection-search-CTKjuIpa.js} +1 -1
  104. package/dist/client/assets/{collection-table-wrapper-BmpUFI8T.js → collection-table-wrapper-KpLnsj3V.js} +1 -1
  105. package/dist/client/assets/{collection-tabs-C6HP7d51.js → collection-tabs-HaSRL7BY.js} +1 -1
  106. package/dist/client/assets/{column-rules-CJ4d_g8W.js → column-rules-CcRXiu56.js} +1 -1
  107. package/dist/client/assets/{combobox-CF6B9Wmt.js → combobox-C6uurxAD.js} +1 -1
  108. package/dist/client/assets/{command-BfXTTBD9.js → command-DW8vpIAn.js} +1 -1
  109. package/dist/client/assets/{companion-mcps-section-BLJLcZpb.js → companion-mcps-section-DowmMNQB.js} +1 -1
  110. package/dist/client/assets/{config-BZYNAwT6.js → config-DBnUW1ql.js} +1 -1
  111. package/dist/client/assets/{connect-FZH1ks7l.js → connect-fVFB8yuN.js} +1 -1
  112. package/dist/client/assets/{connect-layout-BbzklNPm.js → connect-layout-DZerNusC.js} +1 -1
  113. package/dist/client/assets/{connection-BTT1rt_2.js → connection-CpR5iu5o.js} +1 -1
  114. package/dist/client/assets/{connection-card-CsIFgDe8.js → connection-card-HH41R-gb.js} +1 -1
  115. package/dist/client/assets/{connection-detail-BSkgGFWF.js → connection-detail-CxUDzpC4.js} +1 -1
  116. package/dist/client/assets/{connection-form-helpers-Bg3g47y2.js → connection-form-helpers-DmYbPB1E.js} +1 -1
  117. package/dist/client/assets/{connections-BcHX4l-p.js → connections-BSZech5P.js} +1 -1
  118. package/dist/client/assets/{context-D9dob61q.js → context-Bk5mCl6c.js} +1 -1
  119. package/dist/client/assets/{context-menu-DPNtSYt0.js → context-menu-BvT7OaSF.js} +1 -1
  120. package/dist/client/assets/{core.esm-C90YQIGJ.js → core.esm-C9y_2p9u.js} +1 -1
  121. package/dist/client/assets/{create-organization-dialog-BoHINOyM.js → create-organization-dialog-BwYZdu8b.js} +1 -1
  122. package/dist/client/assets/{daily-pulse-tLPif3nO.js → daily-pulse-_rzFsffU.js} +1 -1
  123. package/dist/client/assets/{device-hint-ClxhQWtk.js → device-hint-D_MZXPt4.js} +1 -1
  124. package/dist/client/assets/{discover-BGUAZcdZ.js → discover-C7W0IXPg.js} +1 -1
  125. package/dist/client/assets/{domain-settings-C1KL1CIp.js → domain-settings-B8Rinbm5.js} +1 -1
  126. package/dist/client/assets/{drawer-20Gv7XN0.js → drawer-CPnx75cL.js} +1 -1
  127. package/dist/client/assets/{editor-CklcmkgZ.js → editor-yCqmKD--.js} +1 -1
  128. package/dist/client/assets/{empty-state-CsVqjGqu.js → empty-state-dTT22idT.js} +1 -1
  129. package/dist/client/assets/{empty-state-BWSdqiOv.js → empty-state-oMCOSg-5.js} +1 -1
  130. package/dist/client/assets/{extract-connection-data-C8Idk1Oj.js → extract-connection-data-B8QJH0-o.js} +1 -1
  131. package/dist/client/assets/{feature-gate-Brul-7Vc.js → feature-gate-BW7iq-dj.js} +1 -1
  132. package/dist/client/assets/{feature-paywall-B1-Kq6zS.js → feature-paywall-CgdVUKa4.js} +1 -1
  133. package/dist/client/assets/{file-explorer-0AwiXzsI.js → file-explorer-YbXRSd7M.js} +1 -1
  134. package/dist/client/assets/{file-preview-BTrgY74n.js → file-preview-Cw0eH4RI.js} +1 -1
  135. package/dist/client/assets/{file-share-button-kQh5APqr.js → file-share-button-D0sPfCUq.js} +1 -1
  136. package/dist/client/assets/{file-type-icon-Dbuavq5L.js → file-type-icon-SA_GdG2N.js} +1 -1
  137. package/dist/client/assets/flat-project-DadgDJiP.js +1 -0
  138. package/dist/client/assets/{folder-icon-D1xnfwm_.js → folder-icon-CDAtyCRn.js} +1 -1
  139. package/dist/client/assets/{form-BZ1i_2GJ.js → form-iGrCLiiK.js} +1 -1
  140. package/dist/client/assets/{general-C8gjvVqx.js → general-DjCTgVmp.js} +1 -1
  141. package/dist/client/assets/{home-BnDlnEHu.js → home-CdIrQRml.js} +1 -1
  142. package/dist/client/assets/{icon-button-BDbIWVW3.js → icon-button-CsR1tF4_.js} +1 -1
  143. package/dist/client/assets/{index-D94af8m5.js → index-9DHxScVd.js} +1 -1
  144. package/dist/client/assets/{index-DlsOrQnt.js → index-B2nut9lY.js} +1 -1
  145. package/dist/client/assets/{index-COd_qFje.js → index-B9Eu7iEA.js} +1 -1
  146. package/dist/client/assets/{index-DujNp8wX.js → index-BlqL9SMO.js} +1 -1
  147. package/dist/client/assets/{index-CWl9v4eu.js → index-BxgIKT5E.js} +1 -1
  148. package/dist/client/assets/{index-Bs_Ow9qj.js → index-C2Kh16_Z.js} +1 -1
  149. package/dist/client/assets/{index-DrIzKTur.js → index-C8t_0cfY.js} +1 -1
  150. package/dist/client/assets/{index-DVVx4F0i.js → index-CHnZ1OML.js} +1 -1
  151. package/dist/client/assets/{index-pEr2eE8n.js → index-Ci7HVjCb.js} +1 -1
  152. package/dist/client/assets/{index-CN8TQhg6.js → index-D-uNXrYS.js} +1 -1
  153. package/dist/client/assets/{index-C8VO6rJ2.js → index-DH_-9WPf.js} +3 -3
  154. package/dist/client/assets/index-DQO0lnZr.css +1 -0
  155. package/dist/client/assets/{index-C0n7mPS1.js → index-ECZj3unE.js} +1 -1
  156. package/dist/client/assets/{index-4XFLhK7S.js → index-U7sxkCtg.js} +41 -41
  157. package/dist/client/assets/{index-redirect-BQGkKPeS.js → index-redirect-DltXi-kk.js} +1 -1
  158. package/dist/client/assets/{infiniteQueryObserver-DLzEnjM8.js → infiniteQueryObserver-CXx-MaO_.js} +1 -1
  159. package/dist/client/assets/{infra-billing-Df_WNbOe.js → infra-billing-CrrVVDdG.js} +1 -1
  160. package/dist/client/assets/{input-DQtH0um6.js → input-CY_xbCC1.js} +1 -1
  161. package/dist/client/assets/{input-BzdgO_dK.js → input-Dsubxg1J.js} +3 -3
  162. package/dist/client/assets/{integration-icon-BqsHjS-b.js → integration-icon-B8zb5l7K.js} +1 -1
  163. package/dist/client/assets/{jira-icon-CG6W0SJT.js → jira-icon-CQAGuV2G.js} +1 -1
  164. package/dist/client/assets/{label-ByKoWpTn.js → label-BrB_d8st.js} +1 -1
  165. package/dist/client/assets/{layout-Ih9F7QDG.js → layout-gphUJcuu.js} +1 -1
  166. package/dist/client/assets/{legacy-agents-deep-D4aZSj1S.js → legacy-agents-deep-CVxOaXa7.js} +1 -1
  167. package/dist/client/assets/{legacy-main-redirect-CawnT8bs.js → legacy-main-redirect-WqO1j6y_.js} +1 -1
  168. package/dist/client/assets/library-YJdPBcsq.js +1 -0
  169. package/dist/client/assets/{library-tab-CWnL_FfR.js → library-tab-ChNPvFjS.js} +1 -1
  170. package/dist/client/assets/{login-BV5vcG2Q.js → login-o-JLuwfW.js} +1 -1
  171. package/dist/client/assets/{markdown-BW2GJSHC.js → markdown-B6KxKFZ3.js} +1 -1
  172. package/dist/client/assets/{mcp-app-renderer-fDcax7T2.js → mcp-app-renderer-CHuB1ZI6.js} +1 -1
  173. package/dist/client/assets/{mcp-oauth-CVI2AkSu.js → mcp-oauth-B-d-VRg6.js} +1 -1
  174. package/dist/client/assets/{mcp-oauth-BjHElKzR.js → mcp-oauth-B_CRpHbq.js} +1 -1
  175. package/dist/client/assets/{members-f-Grp_Zc.js → members-CPD6F51f.js} +1 -1
  176. package/dist/client/assets/{memory-CYDtZWEC.js → memory-OJn5uV0V.js} +1 -1
  177. package/dist/client/assets/{mini-report-page-BvYGpq5f.js → mini-report-page-CwDyJAfz.js} +1 -1
  178. package/dist/client/assets/{mock-board-hNRrDjvq.js → mock-board-CGiZtaDq.js} +1 -1
  179. package/dist/client/assets/{monaco-editor-DkahnDKS.js → monaco-editor-BgXIJi37.js} +1 -1
  180. package/dist/client/assets/{monitoring-stats-row-Cx7S4sFz.js → monitoring-stats-row-CRYRt9jM.js} +1 -1
  181. package/dist/client/assets/{multi-select-BsYgOBGm.js → multi-select-2LqqBNod.js} +1 -1
  182. package/dist/client/assets/{mustache-D7UTScQH.js → mustache-D2pCj9iS.js} +1 -1
  183. package/dist/client/assets/{new-project-dialog-DdG-RgMO.js → new-project-dialog-Civny35s.js} +1 -1
  184. package/dist/client/assets/{oauth-callback-GzdTg9VJ.js → oauth-callback-CITtYS7F.js} +1 -1
  185. package/dist/client/assets/{oauth-callback-ai-provider-BANi9OcB.js → oauth-callback-ai-provider-7ZDGQrFN.js} +1 -1
  186. package/dist/client/assets/{onboarding-w2z3NDRW.js → onboarding-BQWHCZlV.js} +1 -1
  187. package/dist/client/assets/{openai-conversation-C7TUEjal.js → openai-conversation-utJbcv70.js} +1 -1
  188. package/dist/client/assets/{optimistic-project-sidebar-views-7fDRNM1p.js → optimistic-project-sidebar-views-_XftP7OV.js} +1 -1
  189. package/dist/client/assets/{organization-choice-DRyD5yII.js → organization-choice-1vh8HAPM.js} +1 -1
  190. package/dist/client/assets/{orgs-EvyltNU-.js → orgs-BZ-5AWHQ.js} +1 -1
  191. package/dist/client/assets/{page-seo-form-0-tAzxyW.js → page-seo-form-DeitPdcq.js} +1 -1
  192. package/dist/client/assets/{pair-Cm6oR2ES.js → pair-DikNYdKi.js} +1 -1
  193. package/dist/client/assets/{plan-ladder-D4-VvMwX.js → plan-ladder-CIXyMEqm.js} +1 -1
  194. package/dist/client/assets/{popover-DGVyEQ9q.js → popover-KA4f1Rso.js} +1 -1
  195. package/dist/client/assets/{post-calendar-CGDOG4Ay.js → post-calendar-P7Yczeyh.js} +1 -1
  196. package/dist/client/assets/{post-editor-BFSJ6I4d.js → post-editor-D48qgVZF.js} +1 -1
  197. package/dist/client/assets/{preview-content-KcSZme5m.js → preview-content-CsRoC8kG.js} +1 -1
  198. package/dist/client/assets/{preview-dialog-DHH8biYM.js → preview-dialog-CgACqBPB.js} +1 -1
  199. package/dist/client/assets/{preview-panel-CMlsnFlv.js → preview-panel-Bz6heUxj.js} +1 -1
  200. package/dist/client/assets/{product-picker-dialog-Bz7bVPFI.js → product-picker-dialog-Bj-cxr4D.js} +1 -1
  201. package/dist/client/assets/{profile-be5NkG2U.js → profile-DttmzwVP.js} +1 -1
  202. package/dist/client/assets/{project-app-view-BV4H0rEJ.js → project-app-view-B-LHkLR3.js} +1 -1
  203. package/dist/client/assets/{project-feed-Dly67hgE.js → project-feed-nuT0MGeK.js} +1 -1
  204. package/dist/client/assets/{project-icon-CMe6LZd9.js → project-icon-BCIWlbB2.js} +1 -1
  205. package/dist/client/assets/project-reports-BuDozDAg.js +1 -0
  206. package/dist/client/assets/project-tasks-Bq0HB4Ij.js +1 -0
  207. package/dist/client/assets/{projects-CDscJwj7.js → projects-6rC_NtTv.js} +1 -1
  208. package/dist/client/assets/{projects-empty-state-VFtNQKgJ.js → projects-empty-state-BLhvUm-A.js} +1 -1
  209. package/dist/client/assets/{prompts-CG--DGsd.js → prompts-Ba_KG-2c.js} +1 -1
  210. package/dist/client/assets/record-editor-5kx4kvLF.js +1 -0
  211. package/dist/client/assets/redirect-editor-Bv9sv8zV.js +1 -0
  212. package/dist/client/assets/{reports-CODPKkJO.js → reports-D958VfvH.js} +1 -1
  213. package/dist/client/assets/reports-DkLsDhHf.js +1 -0
  214. package/dist/client/assets/{reports-onboarding-D0Irch0-.js → reports-onboarding-Lt3lfqUL.js} +1 -1
  215. package/dist/client/assets/{reports-tab-NvqzpdHL.js → reports-tab-ZR-CeLn9.js} +2 -2
  216. package/dist/client/assets/{repositories-xZsmQvzi.js → repositories-OT41oi2h.js} +1 -1
  217. package/dist/client/assets/{repository-binding-C_InVumU.js → repository-binding-C_rNGJZH.js} +1 -1
  218. package/dist/client/assets/{repository-import-picker-Bixi7zBc.js → repository-import-picker-yVMNVJAW.js} +1 -1
  219. package/dist/client/assets/{repository-picker-BHgNNGrn.js → repository-picker-B4dJGi5H.js} +1 -1
  220. package/dist/client/assets/{require-capability-D49j17CD.js → require-capability-Dh9KM2TE.js} +1 -1
  221. package/dist/client/assets/{required-auth-layout-CxaLcttO.js → required-auth-layout-CDnv3SsX.js} +1 -1
  222. package/dist/client/assets/{reset-password-Bg3-bOJi.js → reset-password-BBDI4kwV.js} +1 -1
  223. package/dist/client/assets/{resizable-sj2QiDEc.js → resizable-E6xc07q4.js} +1 -1
  224. package/dist/client/assets/{resolve-tab-icon-Benn2iaL.js → resolve-tab-icon-BF6rqPgZ.js} +1 -1
  225. package/dist/client/assets/{review-settings-DjIYcWCV.js → review-settings-NJYjR7BK.js} +1 -1
  226. package/dist/client/assets/{rich-text-link-control-C2ryIXD3.js → rich-text-link-control-CrNCYAJu.js} +1 -1
  227. package/dist/client/assets/{roles-8gcvGZJw.js → roles-DH7V2rhC.js} +1 -1
  228. package/dist/client/assets/route-CUxOTTob.js +1 -0
  229. package/dist/client/assets/{route-DyDxvrHS.js → route-Cj8uDmsr.js} +1 -1
  230. package/dist/client/assets/{route-C0mgkpSg.js → route-FBtmoSQ8.js} +1 -1
  231. package/dist/client/assets/{runnable-block-editor-dTVVXX5v.js → runnable-block-editor-CSPOZTx9.js} +4 -4
  232. package/dist/client/assets/{sandbox-lifecycle-context-DzcFvw1G.js → sandbox-lifecycle-context-BFOchDNn.js} +1 -1
  233. package/dist/client/assets/{schema-DyLXU88M.js → schema-Cx5CAoQi.js} +1 -1
  234. package/dist/client/assets/{scroll-area-DYybJ63r.js → scroll-area-gEfzLhri.js} +1 -1
  235. package/dist/client/assets/{search-input-DJwYl_zW.js → search-input-tSXGNIP6.js} +1 -1
  236. package/dist/client/assets/{search-toggle-DOVOYril.js → search-toggle-B2ZvA7nT.js} +1 -1
  237. package/dist/client/assets/{secret-picker-C40fL6uP.js → secret-picker-BsE6_iwf.js} +1 -1
  238. package/dist/client/assets/{secrets-Kq6gwxOB.js → secrets-D_3DGm4u.js} +1 -1
  239. package/dist/client/assets/sections-editor-CBUhadYU.js +4 -0
  240. package/dist/client/assets/{select-CEirlFRV.js → select-CbOgbS2d.js} +1 -1
  241. package/dist/client/assets/{select-model-5mFHKpuo.js → select-model-DsSD6E8C.js} +1 -1
  242. package/dist/client/assets/{seo-editor-DHTxrlCs.js → seo-editor-CnWdtXQc.js} +1 -1
  243. package/dist/client/assets/{separator-E-ZvgvRL.js → separator-Caj2juFE.js} +1 -1
  244. package/dist/client/assets/{settings-tab-C9ihpTae.js → settings-tab-DqBSlRVf.js} +1 -1
  245. package/dist/client/assets/{sheet-Bs1jJD9o.js → sheet-CcUwyeyx.js} +1 -1
  246. package/dist/client/assets/{shell-layout-DZBrJWAA.js → shell-layout-DQzu_3a6.js} +1 -1
  247. package/dist/client/assets/{skills-7xwa1ol9.js → skills-BAdMhSAc.js} +1 -1
  248. package/dist/client/assets/{slider-ki239RUG.js → slider-CfGhYSgO.js} +1 -1
  249. package/dist/client/assets/{sortable.esm-Dvqn6rnz.js → sortable.esm-Djdx6Fqm.js} +1 -1
  250. package/dist/client/assets/{sso-n5eUQ_Xy.js → sso-BdAlAmAg.js} +1 -1
  251. package/dist/client/assets/{suggestion-DHADwupQ.js → suggestion-BNgiJ1ZJ.js} +1 -1
  252. package/dist/client/assets/{switch-BD8_vvWq.js → switch-BhazVYJL.js} +1 -1
  253. package/dist/client/assets/{symbol-Dx-KpnN7.js → symbol-D7hSGlXb.js} +1 -1
  254. package/dist/client/assets/{synced-repos-B-5rRFwb.js → synced-repos-BC9YVpiQ.js} +1 -1
  255. package/dist/client/assets/{tab-icon-glyph-B9KZAh18.js → tab-icon-glyph-BYA6exv3.js} +1 -1
  256. package/dist/client/assets/{table-B1C2ctbL.js → table-BCWwFa46.js} +1 -1
  257. package/dist/client/assets/{tabs-tkvg_YSq.js → tabs-ygNtOTGD.js} +1 -1
  258. package/dist/client/assets/{task-board-DcolQ15W.js → task-board-CGKcZmT3.js} +1 -1
  259. package/dist/client/assets/{task-route-Dp4TtKUe.js → task-route-Bc1A0MFY.js} +1 -1
  260. package/dist/client/assets/{task-status-CF9KSEEA.js → task-status-VxTqyW4d.js} +1 -1
  261. package/dist/client/assets/taskboard-analytics-BXD65o9V.js +1 -0
  262. package/dist/client/assets/{tasks-B6gqzeMQ.js → tasks-LlnLf8Q6.js} +1 -1
  263. package/dist/client/assets/tasks-qcYGJhAG.js +1 -0
  264. package/dist/client/assets/{textarea-BpBHfDQd.js → textarea-Cz2yfMWd.js} +1 -1
  265. package/dist/client/assets/{thread-analytics-DfV1z1-8.js → thread-analytics-DYe_it_u.js} +1 -1
  266. package/dist/client/assets/{thread-button-BNBHV_Wu.js → thread-button-DbPrz4-p.js} +1 -1
  267. package/dist/client/assets/{thread-intent-DqexYQAC.js → thread-intent-oxPmiLpE.js} +1 -1
  268. package/dist/client/assets/{thread-route-B-yx1tFW.js → thread-route-CydsZIWs.js} +1 -1
  269. package/dist/client/assets/{thread-route-BXR-ufCz.js → thread-route-fmJJCDUN.js} +1 -1
  270. package/dist/client/assets/{thread-sheet-body-Bgp-QwJy.js → thread-sheet-body-D55xnaP7.js} +1 -1
  271. package/dist/client/assets/{time-range-picker-DILwkH82.js → time-range-picker-GRQ6ZyNo.js} +1 -1
  272. package/dist/client/assets/{toggle-group-SSpwI-zE.js → toggle-group-BoHp8d1Q.js} +1 -1
  273. package/dist/client/assets/{tool-namespace-CsdkV2uo.js → tool-namespace-BxpjstzE.js} +1 -1
  274. package/dist/client/assets/{toolbar-icon-button-CIXm0pyl.js → toolbar-icon-button-BmfLDUbS.js} +1 -1
  275. package/dist/client/assets/{tooltip-CUk78XFR.js → tooltip-D9dKhMcM.js} +1 -1
  276. package/dist/client/assets/{tooltipContext-BY8Qgc3U.js → tooltipContext-C42keTPt.js} +1 -1
  277. package/dist/client/assets/{track-DDd4x4-Y.js → track-B7AEg5DI.js} +1 -1
  278. package/dist/client/assets/{types-DPbXDbOS.js → types-DhTd2fZN.js} +1 -1
  279. package/dist/client/assets/{url-slug-CFKzH8Z4.js → url-slug-BF1zPW8D.js} +1 -1
  280. package/dist/client/assets/{usage-stats-wClM7TZ-.js → usage-stats-y9uwYGvN.js} +1 -1
  281. package/dist/client/assets/{use-ai-providers-CAEoYJwC.js → use-ai-providers-CEZuf2wE.js} +1 -1
  282. package/dist/client/assets/{use-automations-DXjaaH0T.js → use-automations-BbCwFFfW.js} +1 -1
  283. package/dist/client/assets/{use-autosave-BOlmY_xu.js → use-autosave-CNjnDRHj.js} +1 -1
  284. package/dist/client/assets/{use-chat-layout-state-BYcPLpFV.js → use-chat-layout-state-Dl5fbmt9.js} +1 -1
  285. package/dist/client/assets/{use-chat-navigation-CKcbdotk.js → use-chat-navigation-Dlyibisy.js} +1 -1
  286. package/dist/client/assets/{use-clock-tick-CwQv-OCe.js → use-clock-tick-BMU-GnSw.js} +1 -1
  287. package/dist/client/assets/{use-connect-companion-PBAraKBj.js → use-connect-companion-DKwI-FYz.js} +1 -1
  288. package/dist/client/assets/{use-connection-DldRXuvq.js → use-connection-Bjwl8al7.js} +1 -1
  289. package/dist/client/assets/{use-copy-BC3Fmh27.js → use-copy-DWwjFTFc.js} +1 -1
  290. package/dist/client/assets/{use-create-virtual-mcp-D8P6CVcB.js → use-create-virtual-mcp-Cq6u3V6a.js} +1 -1
  291. package/dist/client/assets/{use-date-fns-locale-DquxgLdE.js → use-date-fns-locale-BTXcqaiw.js} +1 -1
  292. package/dist/client/assets/{use-debounced-autosave-mYSK51JG.js → use-debounced-autosave-DS6-D0Z3.js} +1 -1
  293. package/dist/client/assets/{use-debounced-value-CNkuXNOW.js → use-debounced-value-BWgwAYQ4.js} +1 -1
  294. package/dist/client/assets/{use-deco-credits-DKtKOwIN.js → use-deco-credits-B2DLMpWA.js} +1 -1
  295. package/dist/client/assets/{use-decopilot-events-DH5jig6y.js → use-decopilot-events-CaQ-ifBF.js} +1 -1
  296. package/dist/client/assets/{use-delete-connection-Dzg9cQZm.js → use-delete-connection-BDlKnwpK.js} +1 -1
  297. package/dist/client/assets/{use-deployment-admin-CyBWrUgL.js → use-deployment-admin-DkCmIWo6.js} +1 -1
  298. package/dist/client/assets/{use-ensure-project-folder-CdHM_a-9.js → use-ensure-project-folder-CqRNoawD.js} +1 -1
  299. package/dist/client/assets/use-fast-preview-draft-url-UzD2wX6r.js +1 -0
  300. package/dist/client/assets/{use-file-configs-DsMQGho1.js → use-file-configs-BlVRbWGm.js} +1 -1
  301. package/dist/client/assets/{use-infinite-scroll-C0Ths8NM.js → use-infinite-scroll-TxEXws4q.js} +1 -1
  302. package/dist/client/assets/{use-join-requests-CoVXbvos.js → use-join-requests-B2UcVFtB.js} +1 -1
  303. package/dist/client/assets/{use-main-panel-tabs-DlD2zr1g.js → use-main-panel-tabs-CMS20W_c.js} +1 -1
  304. package/dist/client/assets/{use-mcp-auth-status-B2t4xmcR.js → use-mcp-auth-status-CPFHVJ3y.js} +1 -1
  305. package/dist/client/assets/{use-mcp-client-C5uLw7Lc.js → use-mcp-client-hyHjvXHS.js} +1 -1
  306. package/dist/client/assets/{use-mcp-prompts-Dxu80Ack.js → use-mcp-prompts-B4XQOyIC.js} +1 -1
  307. package/dist/client/assets/{use-mcp-tools-Cm9CvYn6.js → use-mcp-tools-DCX9XGmF.js} +1 -1
  308. package/dist/client/assets/{use-members-C9_S9nP9.js → use-members-BppTtT4e.js} +1 -1
  309. package/dist/client/assets/{use-mobile-Buz9Esa_.js → use-mobile-BfC7cdl6.js} +1 -1
  310. package/dist/client/assets/{use-navigate-to-agent-C41zpB_Z.js → use-navigate-to-agent-DbxbeXIC.js} +1 -1
  311. package/dist/client/assets/use-new-blocks-editor-DMV0JNBq.js +1 -0
  312. package/dist/client/assets/{use-open-billing-url-C1VukQDg.js → use-open-billing-url-BlRE_825.js} +1 -1
  313. package/dist/client/assets/{use-org-auth-client-DjRiIxwH.js → use-org-auth-client-BpOVJa8q.js} +1 -1
  314. package/dist/client/assets/{use-org-fs-DqhUUlbQ.js → use-org-fs-CpG4Ftj0.js} +1 -1
  315. package/dist/client/assets/{use-org-repo-syncs-cx9r2nZl.js → use-org-repo-syncs-DAOwh9J_.js} +1 -1
  316. package/dist/client/assets/{use-org-sso-DVCQNBfN.js → use-org-sso-D2PH-QV7.js} +1 -1
  317. package/dist/client/assets/{use-organization-roles-Bp0RCVOK.js → use-organization-roles-CG61KaMc.js} +1 -1
  318. package/dist/client/assets/{use-organization-settings-B0rQmLIX.js → use-organization-settings-CPOQOxKw.js} +1 -1
  319. package/dist/client/assets/{use-panel-navigate-DOyxnt44.js → use-panel-navigate-DFsIXY6f.js} +1 -1
  320. package/dist/client/assets/{use-project-scope-DJTJDi3A.js → use-project-scope-BDGuEIbQ.js} +1 -1
  321. package/dist/client/assets/{use-releases-BXUiPgUU.js → use-releases-POJh7lfH.js} +1 -1
  322. package/dist/client/assets/{use-reports-diagnostic-frCP_UW9.js → use-reports-diagnostic-BtTiu6Jz.js} +1 -1
  323. package/dist/client/assets/{use-sandbox-events-Clj9v6On.js → use-sandbox-events-D1UC0d1h.js} +1 -1
  324. package/dist/client/assets/{use-secrets-CIfBnw6x.js → use-secrets-CcQOv1cy.js} +1 -1
  325. package/dist/client/assets/{use-section-preview-base-BYZSxM0z.js → use-section-preview-base-DvkGVoSM.js} +1 -1
  326. package/dist/client/assets/{use-tags-Blq5AODj.js → use-tags-DP90qdqE.js} +1 -1
  327. package/dist/client/assets/{use-task-board-analytics-D09WT40p.js → use-task-board-analytics-BoVEsyvv.js} +1 -1
  328. package/dist/client/assets/{use-task-board-events-Bx8_k4aV.js → use-task-board-events-C6vPjypN.js} +1 -1
  329. package/dist/client/assets/{use-task-board-item-prs-Bsgf-2Zm.js → use-task-board-item-prs-C0LWlrKc.js} +1 -1
  330. package/dist/client/assets/{use-task-board-items-CIYsbBEM.js → use-task-board-items-Cx--Z4EY.js} +1 -1
  331. package/dist/client/assets/{use-task-metadata-DDV_r81k.js → use-task-metadata-DXtRT11o.js} +1 -1
  332. package/dist/client/assets/{use-thread-analytics-BuosijZj.js → use-thread-analytics-DSKonBCj.js} +1 -1
  333. package/dist/client/assets/{use-thread-outputs-D13C6fsy.js → use-thread-outputs-DR80xdVS.js} +1 -1
  334. package/dist/client/assets/useInfiniteQuery-D602T7Oc.js +1 -0
  335. package/dist/client/assets/{useQueries-DZMzH0ea.js → useQueries-BZ4QkddU.js} +1 -1
  336. package/dist/client/assets/useSuspenseInfiniteQuery-TMfZO9fH.js +1 -0
  337. package/dist/client/assets/{users-CE3WLjUJ.js → users-CdPfAxNL.js} +1 -1
  338. package/dist/client/assets/{utils-qUv9_Hyk.js → utils-DVQBiT32.js} +1 -1
  339. package/dist/client/assets/{variant-calendar-B604PCFx.js → variant-calendar-W8FuVjAz.js} +1 -1
  340. package/dist/client/assets/{variant-matcher-override-CgF3ujB9.js → variant-matcher-override-DWmch-z_.js} +1 -1
  341. package/dist/client/assets/{view-mode-toggle-BaZ1kmhW.js → view-mode-toggle-DpnRn8BO.js} +1 -1
  342. package/dist/client/assets/{virtual-mcp-CWsV4-pi.js → virtual-mcp-CadqoFCO.js} +1 -1
  343. package/dist/client/assets/{watch-sse-pool-BjTl5yOD.js → watch-sse-pool-BK0LBG5W.js} +1 -1
  344. package/dist/client/index.html +2 -2
  345. package/dist/server/server.js +1 -1
  346. package/package.json +1 -1
  347. package/dist/client/assets/agent-app-fS8AS09U.js +0 -1
  348. package/dist/client/assets/agent-deck-BSKZhX9C.js +0 -1
  349. package/dist/client/assets/agent-library-BORVKAKi.js +0 -1
  350. package/dist/client/assets/agent-library-file-CQVtmhou.js +0 -1
  351. package/dist/client/assets/agent-settings-CP8WaMNS.js +0 -1
  352. package/dist/client/assets/agent-site-editor-code-DBqdRzpW.js +0 -2
  353. package/dist/client/assets/agent-site-editor-preview-CMWo8Jpl.js +0 -518
  354. package/dist/client/assets/agent-view-BHgh3Lxp.js +0 -1
  355. package/dist/client/assets/api-keys-DLMcrFXL.js +0 -1
  356. package/dist/client/assets/app-editor-CJc6hCJ6.js +0 -1
  357. package/dist/client/assets/claim-phase-copy-C0pvoElR.js +0 -1
  358. package/dist/client/assets/flat-project-YGEAxpJq.js +0 -1
  359. package/dist/client/assets/index-D7k-FSss.css +0 -1
  360. package/dist/client/assets/library-BIKWwK0_.js +0 -1
  361. package/dist/client/assets/project-reports-BqyykKm5.js +0 -1
  362. package/dist/client/assets/project-tasks-DHxi49Je.js +0 -1
  363. package/dist/client/assets/record-editor-CQTy2--L.js +0 -1
  364. package/dist/client/assets/redirect-editor-Diq4Tlsx.js +0 -1
  365. package/dist/client/assets/reports-Bew0urwY.js +0 -1
  366. package/dist/client/assets/route-DQYAyMBI.js +0 -1
  367. package/dist/client/assets/sections-editor-5-gvD3vu.js +0 -1
  368. package/dist/client/assets/taskboard-analytics-C_zsZRzy.js +0 -1
  369. package/dist/client/assets/tasks-O62NX5lN.js +0 -1
  370. package/dist/client/assets/use-fast-preview-draft-url-Cuacxxyo.js +0 -1
  371. package/dist/client/assets/use-new-blocks-editor-DuP8uKZj.js +0 -1
  372. package/dist/client/assets/useInfiniteQuery-B3MUNCKJ.js +0 -1
  373. package/dist/client/assets/useSuspenseInfiniteQuery-DPTWpcSJ.js +0 -1
@@ -1 +1 @@
1
- import{c as M,a2 as ne,a as pe,aa as Ie,K as fe,m as me,b as K,r as B,l as ee,j as n,h as ve,aJ as je,aI as Ae,H as pt,y as he,v as qt,aK as Wt,s as Yt,q as Zt,D as Jt,aL as Qt,a0 as xt,t as Xt,at as es,d as Me,o as ts,n as st,aM as ss,f as ke,M as nt,e as ns,u as Le,k as as,aN as rs,aO as is,O as gt,aP as ls,N as os,B as cs,P as De}from"./index-4XFLhK7S.js";import{i as qe}from"./AlertCircle-D4iOZ3Bs.js";import{B as ds,C as at,A as ye,D as us,E as fs,F as ms,G as hs,H as ps,I as xs,J as bt,K as gs,d as bs,L as vs,n as ys,k as js,m as ks}from"./agent-icon-DDBSTxwl.js";import{u as Ss,a as Ts}from"./thread-button-BNBHV_Wu.js";import{T as we}from"./toolbar-icon-button-CIXm0pyl.js";import{C as W,w as Ns,S as _s}from"./use-sandbox-events-Clj9v6On.js";import{s as vt,C as ws,u as Cs,a as yt,V as Ps,b as Is}from"./input-BzdgO_dK.js";import{u as $e,a as We,b as Ee,c as jt,d as As,s as Ms}from"./chat-context-BR-PmAJg.js";import{u as Ls,s as kt}from"./use-ai-providers-CAEoYJwC.js";import{b as St,a as $s,u as Es}from"./use-organization-settings-B0rQmLIX.js";import{i as Fs}from"./CheckCircle-CoJfU94i.js";import{s as rt}from"./XClose-DO008B8R.js";import{a as Se,b as Tt,c as Nt,g as _t,p as Rs}from"./repository-binding-C_InVumU.js";import{I as wt}from"./integration-icon-BqsHjS-b.js";import{c as Os}from"./use-decopilot-events-DH5jig6y.js";import{t as Ye}from"./ChevronUp-BSm7AtSf.js";import{O as Bs}from"./pair-Cm6oR2ES.js";import{u as Ds,a as zs}from"./use-thread-outputs-D13C6fsy.js";import{u as Gs}from"./use-deco-credits-DKtKOwIN.js";import{a as Ze,f as Hs,L as Us,s as Ks,b as Vs}from"./shell-layout-DZBrJWAA.js";import{t as qs,f as Ws,m as Ys,b as Zs,a as Js}from"./use-chat-layout-state-BYcPLpFV.js";import{g as Ct,u as Qs,n as Xs,a as en}from"./use-releases-BXUiPgUU.js";import{u as tn,d as Pt,a as Je,b as Qe,c as Xe,e as sn}from"./thread-intent-DqexYQAC.js";import{f as nn,b as It,c as an}from"./use-navigate-to-agent-C41zpB_Z.js";import{o as rn,s as ln,u as on,S as cn}from"./sandbox-lifecycle-context-DzcFvw1G.js";import{E as At}from"./empty-state-CsVqjGqu.js";import{C as it}from"./index-Bs_Ow9qj.js";import{a as Mt,b as Lt,P as $t}from"./popover-DGVyEQ9q.js";import{T as Fe,a as Re,b as Oe}from"./tooltip-CUk78XFR.js";import{T as dn,a as un}from"./toggle-group-SSpwI-zE.js";import{u as Et,a as et,r as fn,b as Ft,c as mn,d as hn}from"./thread-route-B-yx1tFW.js";import{c as pn,a as xn,e as gn,b as bn,C as vn,f as yn}from"./command-BfXTTBD9.js";import{i as Rt}from"./ZoomOut-DA1sRe95.js";import{g as jn,S as kn}from"./task-status-CF9KSEEA.js";import{a as Sn}from"./format-time-CjIPQhCN.js";import{u as Tn}from"./use-clock-tick-CwQv-OCe.js";import{u as Nn}from"./use-chat-navigation-CKcbdotk.js";import{a as Ot,u as _n}from"./use-panel-navigate-DOyxnt44.js";import{u as Bt}from"./use-main-panel-tabs-DlD2zr1g.js";import{T as Ce}from"./tab-icon-glyph-B9KZAh18.js";import{a as wn}from"./UserSquare-BFlEW2x5.js";import{b as Cn,c as Dt,S as Pn,d as In}from"./select-CEirlFRV.js";import{L as tt,a as An}from"./legacy-main-redirect-CawnT8bs.js";import{u as Mn}from"./use-mobile-Buz9Esa_.js";import{L as Ln}from"./preview-dialog-DHH8biYM.js";import{O as $n}from"./markdown-BW2GJSHC.js";import{B as lt}from"./blocks-preview-workspace-context-D7M7BwP7.js";import{p as En}from"./virtual-mcp-CWsV4-pi.js";import"./Tool01-o_nJ7Y1x.js";import"./ArrowUp-KCSPs-fi.js";import"./ArrowLeft-iygYSRbQ.js";import"./LinkBroken01-Cjxu7rCw.js";import"./ShoppingBag01-CWlRU3Ye.js";import"./Building02-EbX1A23K.js";import"./ChevronSelectorVertical-DqpRXMOM.js";import"./Copy01-DlA26aBh.js";import"./CreditCard01-CXGPcE51.js";import"./DotsVertical-CTugBooH.js";import"./Image01-BjUHwjIr.js";import"./Globe04-DDiW2Onm.js";import"./SwitchHorizontal01-DZEm8csq.js";import"./Key01-DMnhMxC3.js";import"./Link01-DKypA3Uf.js";import"./Monitor01-CTL-UG2p.js";import"./Sun-DhZMu2lN.js";import"./Play-NZWCLDah.js";import"./Plus-DLTeBarI.js";import"./SearchMd-BsNWsFDv.js";import"./Trash01-JZaZB0vu.js";import"./Upload01-CpEePL13.js";import"./User01-BGOQS9vx.js";import"./Users01-C9dOtgmV.js";import"./sheet-Bs1jJD9o.js";import"./tool-namespace-CsdkV2uo.js";import"./drawer-20Gv7XN0.js";import"./collection-search-Cp82h57b.js";import"./use-mcp-client-C5uLw7Lc.js";import"./auth-D1PkW9Uj.js";import"./use-mcp-prompts-Dxu80Ack.js";import"./usage-stats-wClM7TZ-.js";import"./form-BZ1i_2GJ.js";import"./label-ByKoWpTn.js";import"./utils-CVEq3hMx.js";import"./use-copy-BC3Fmh27.js";import"./index-pEr2eE8n.js";import"./checkbox-CGTvhz0x.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-Brh_8d7a.js";import"./feature-paywall-B1-Kq6zS.js";import"./plan-ladder-D4-VvMwX.js";import"./sandbox-url-D3mC8qhT.js";import"./backoff-CrEUbyZT.js";import"./icon-button-BDbIWVW3.js";import"./file-type-icon-Dbuavq5L.js";import"./location-BjlyegC2.js";import"./autosend-D3KZZhDs.js";import"./chat-draft-CWFQi3-d.js";import"./tabs-tkvg_YSq.js";import"./use-open-billing-url-C1VukQDg.js";import"./input-DQtH0um6.js";import"./suggestion-DHADwupQ.js";import"./use-org-fs-DqhUUlbQ.js";import"./useInfiniteQuery-B3MUNCKJ.js";import"./infiniteQueryObserver-DLzEnjM8.js";import"./question-004-sINsf4GQ.js";import"./use-members-C9_S9nP9.js";import"./use-org-auth-client-DjRiIxwH.js";import"./add-connection-dialog-BTQ6Snbx.js";import"./extract-connection-data-C8Idk1Oj.js";import"./metadata-D72DunRR.js";import"./connection-BTT1rt_2.js";import"./url-slug-CFKzH8Z4.js";import"./connection-card-CsIFgDe8.js";import"./connection-slug-CITJ0kGN.js";import"./slugify-CEUa2lfQ.js";import"./textarea-BpBHfDQd.js";import"./use-connection-DldRXuvq.js";import"./connection-form-helpers-Bg3g47y2.js";import"./authenticate-and-persist-oauth-BfNR0joU.js";import"./mcp-oauth-BjHElKzR.js";import"./mcp-oauth-CVI2AkSu.js";import"./collection-tabs-C6HP7d51.js";import"./badge-Dp13ql_I.js";import"./use-infinite-scroll-C0Ths8NM.js";import"./useSuspenseInfiniteQuery-DPTWpcSJ.js";import"./use-task-board-events-Bx8_k4aV.js";import"./task-board-DcolQ15W.js";import"./schema-DyLXU88M.js";import"./watch-sse-pool-BjTl5yOD.js";import"./collapsible-Cq1aFrCg.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-fDcax7T2.js";import"./types-DPbXDbOS.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./use-project-scope-DJTJDi3A.js";import"./project-icon-CMe6LZd9.js";import"./new-project-dialog-DdG-RgMO.js";import"./repository-import-picker-Bixi7zBc.js";import"./repository-picker-BHgNNGrn.js";import"./use-debounced-value-CNkuXNOW.js";import"./required-auth-layout-CxaLcttO.js";import"./use-org-sso-DVCQNBfN.js";import"./use-file-configs-DsMQGho1.js";import"./site-slug-DebpOoQq.js";import"./serial-task-queue-CGOeQgpr.js";import"./delay-CnY5UFtP.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./resizable-sj2QiDEc.js";import"./index-DujNp8wX.js";import"./index-DVVx4F0i.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-mcp-tools-Cm9CvYn6.js";import"./resolve-tab-icon-Benn2iaL.js";import"./use-task-metadata-DDV_r81k.js";import"./index-BdQq_4o_.js";import"./preview-content-KcSZme5m.js";import"./file-share-button-kQh5APqr.js";import"./file-preview-BTrgY74n.js";import"./utils-qUv9_Hyk.js";import"./editor-CklcmkgZ.js";function Fn({isThreadLocked:t,hasCloudProviderKeys:e,sandboxOnlyChats:s,canRunClaudeCode:r}){return t?null:!e&&!(s&&r)?"provider":s&&!r?"claude-code-provider":null}function Rn(){const t=M.c(25),e=Ls(),s=$e(),r=St(),i=$s("chat_harness_codex"),{org:a}=ne(),{data:o}=pe.useSession(),c=o?.user.id??"",u=Ie(),l=e.some(Bn);let d;t[0]!==a.id?(d=fe.claudeSubscription(a.id),t[0]=a.id,t[1]=d):d=t[1];let m;t[2]!==u?(m=()=>u.call("CLAUDE_SUBSCRIPTION_STATUS",{}),t[2]=u,t[3]=m):m=t[3];const f=r&&!i&&!l;let h;t[4]!==d||t[5]!==m||t[6]!==f?(h={queryKey:d,queryFn:m,enabled:f},t[4]=d,t[5]=m,t[6]=f,t[7]=h):h=t[7];const j=me(h);let k;t[8]!==a.id?(k=fe.githubCopilot(a.id),t[8]=a.id,t[9]=k):k=t[9];let v;t[10]!==u?(v=()=>u.call("GITHUB_COPILOT_STATUS",{}),t[10]=u,t[11]=v):v=t[11];const x=r&&!i&&!l;let g;t[12]!==k||t[13]!==v||t[14]!==x?(g={queryKey:k,queryFn:v,enabled:x},t[12]=k,t[13]=v,t[14]=x,t[15]=g):g=t[15];const b=me(g);let y;t[16]!==a.id||t[17]!==c?(y=fe.codexSubscription(a.id,c),t[16]=a.id,t[17]=c,t[18]=y):y=t[18];let p;t[19]!==u?(p=()=>u.call("CODEX_SUBSCRIPTION_STATUS",{}),t[19]=u,t[20]=p):p=t[20];const S=r&&i;let N;t[21]!==S||t[22]!==y||t[23]!==p?(N={queryKey:y,queryFn:p,enabled:S},t[21]=S,t[22]=y,t[23]=p,t[24]=N):N=t[24];const T=me(N);return r&&i&&!s?.isThreadLocked?e.some(On)||T.data?.connected!==!1?null:"codex-provider":Fn({isThreadLocked:s?.isThreadLocked??!1,hasCloudProviderKeys:e.length>0,sandboxOnlyChats:r,canRunClaudeCode:l||j.data?.connected!==!1||b.data?.connected!==!1||!!b.data?.orgShare})}function On(t){return vt(t.providerId)}function Bn(t){return kt(t.providerId)}function be(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function ze(t){if(!t)return"—";const e=typeof t=="string"?new Date(t):t;return isNaN(e.getTime())?"—":e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function Dn(t){return t?t.replace(/-\d{8}(?:-[a-z0-9]+)*$/i,"").replace(/-/g," "):"—"}function zn(t){const e=M.c(4),{items:s}=t;let r;e[0]!==s?(r=s.map(Gn),e[0]=s,e[1]=r):r=e[1];let i;return e[2]!==r?(i=n.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-6",children:r}),e[2]=r,e[3]=i):i=e[3],i}function Gn(t){return n.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[n.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t.label}),n.jsx("span",{className:"text-sm text-foreground tabular-nums truncate",children:t.value})]},t.label)}function Hn(t){const e=M.c(33),{userTokens:s,assistantTokens:r,otherTokens:i}=t,a=K(),o=s+r+i,c=o>0?s/o*100:0,u=o>0?r/o*100:0,l=o>0?i/o*100:0;let d;e[0]!==c?(d=c>0&&n.jsx("div",{className:"h-full bg-chart-1",style:{width:`${c}%`}}),e[0]=c,e[1]=d):d=e[1];let m;e[2]!==u?(m=u>0&&n.jsx("div",{className:"h-full bg-chart-2",style:{width:`${u}%`}}),e[2]=u,e[3]=m):m=e[3];let f;e[4]!==l?(f=l>0&&n.jsx("div",{className:"h-full bg-muted-foreground/30",style:{width:`${l}%`}}),e[4]=l,e[5]=f):f=e[5];let h;e[6]!==d||e[7]!==m||e[8]!==f?(h=n.jsxs("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted",children:[d,m,f]}),e[6]=d,e[7]=m,e[8]=f,e[9]=h):h=e[9];let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-1 shrink-0"}),e[10]=j):j=e[10];let k;e[11]!==a||e[12]!==c?(k=a("chat.contextPanel.userPercent",{pct:c.toFixed(1)}),e[11]=a,e[12]=c,e[13]=k):k=e[13];let v;e[14]!==k?(v=n.jsxs("div",{className:"flex items-center gap-1.5",children:[j,n.jsx("span",{className:"text-xs text-muted-foreground",children:k})]}),e[14]=k,e[15]=v):v=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-2 shrink-0"}),e[16]=x):x=e[16];let g;e[17]!==u||e[18]!==a?(g=a("chat.contextPanel.assistantPercent",{pct:u.toFixed(1)}),e[17]=u,e[18]=a,e[19]=g):g=e[19];let b;e[20]!==g?(b=n.jsxs("div",{className:"flex items-center gap-1.5",children:[x,n.jsx("span",{className:"text-xs text-muted-foreground",children:g})]}),e[20]=g,e[21]=b):b=e[21];let y;e[22]!==l||e[23]!==i||e[24]!==a?(y=i>0&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-muted-foreground/30 shrink-0"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.otherPercent",{pct:l.toFixed(1)})})]}),e[22]=l,e[23]=i,e[24]=a,e[25]=y):y=e[25];let p;e[26]!==b||e[27]!==y||e[28]!==v?(p=n.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[v,b,y]}),e[26]=b,e[27]=y,e[28]=v,e[29]=p):p=e[29];let S;return e[30]!==p||e[31]!==h?(S=n.jsxs("div",{className:"flex flex-col gap-2",children:[h,p]}),e[30]=p,e[31]=h,e[32]=S):S=e[32],S}function Un(t){const e=M.c(14),{agentId:s,isError:r}=t,i=Se(s),a=K();let o;e[0]!==i?.title||e[1]!==a?(o=i?.title??a("chat.subtask.subtaskNoun"),e[0]=i?.title,e[1]=a,e[2]=o):o=e[2];const c=o,u=i?.icon??null;let l;e[3]!==u||e[4]!==c?(l=n.jsx(wt,{icon:u,name:c,size:"xs",className:"size-6 rounded-md shrink-0"}),e[3]=u,e[4]=c,e[5]=l):l=e[5];const d=r?"text-destructive":"text-foreground";let m;e[6]!==d?(m=ee("shrink-0 font-medium",d),e[6]=d,e[7]=m):m=e[7];let f;e[8]!==c||e[9]!==m?(f=n.jsx("span",{className:m,children:c}),e[8]=c,e[9]=m,e[10]=f):f=e[10];let h;return e[11]!==l||e[12]!==f?(h=n.jsxs(n.Fragment,{children:[l,f]}),e[11]=l,e[12]=f,e[13]=h):h=e[13],h}function Kn(t){const e=M.c(12),{isError:s}=t,r=K();let i;e[0]!==r?(i=r("chat.contextPanel.subtask"),e[0]=r,e[1]=i):i=e[1];const a=i;let o;e[2]!==a?(o=n.jsx(wt,{icon:null,name:a,size:"xs",className:"size-6 rounded-md shrink-0"}),e[2]=a,e[3]=o):o=e[3];const c=s?"text-destructive":"text-foreground";let u;e[4]!==c?(u=ee("shrink-0 font-medium",c),e[4]=c,e[5]=u):u=e[5];let l;e[6]!==a||e[7]!==u?(l=n.jsx("span",{className:u,children:a}),e[6]=a,e[7]=u,e[8]=l):l=e[8];let d;return e[9]!==o||e[10]!==l?(d=n.jsxs(n.Fragment,{children:[o,l]}),e[9]=o,e[10]=l,e[11]=d):d=e[11],d}function Vn(t){const e=M.c(18),{part:s}=t,r=s.input?.agent_id,i=s.state==="input-streaming"||s.state==="input-available"||s.state==="output-available"&&s.preliminary===!0,a=s.state==="output-error",o=s.state==="approval-requested";let c;e[0]!==a?(c=n.jsx(Kn,{isError:a}),e[0]=a,e[1]=c):c=e[1];let u;e[2]!==r||e[3]!==a?(u=n.jsx(Un,{agentId:r,isError:a}),e[2]=r,e[3]=a,e[4]=u):u=e[4];let l;e[5]!==c||e[6]!==u?(l=n.jsx(B.Suspense,{fallback:c,children:u}),e[5]=c,e[6]=u,e[7]=l):l=e[7];let d;e[8]!==s.input?(d=s.input?.prompt&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted-foreground/50",children:"·"}),n.jsx("span",{className:"truncate text-muted-foreground",children:s.input.prompt})]}),e[8]=s.input,e[9]=d):d=e[9];let m;e[10]!==o||e[11]!==a||e[12]!==i?(m=n.jsx("span",{className:"ml-auto shrink-0",children:i?n.jsx(ve,{className:"size-3 text-muted-foreground"}):a?n.jsx(ds,{size:12,className:"text-destructive"}):o?n.jsx(qe,{size:12,className:"text-warning"}):n.jsx(Fs,{size:12,className:"text-success"})}),e[10]=o,e[11]=a,e[12]=i,e[13]=m):m=e[13];let f;return e[14]!==l||e[15]!==d||e[16]!==m?(f=n.jsxs("div",{className:"flex items-center gap-2 text-xs min-w-0",children:[l,d,m]}),e[14]=l,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function qn(t){const e=M.c(51),{onClose:s,back:r,className:i}=t,a=K(),[o,c]=B.useState(null),{messages:u}=We(),{activeTask:l}=Ee(),{selectedModel:d,selectedVirtualMcp:m}=jt(),f=As(u),h=[...u].reverse().find(ra),j=h?.metadata?.usage,k=[...u].reverse().find(aa)?.metadata?.models?.thinking,v=h?.metadata?.modelLimits?.contextWindow??(!k||k.id===d?.modelId?d?.limits?.contextWindow:null)??null,x=j?.contextTokens??0,g=v&&v>0?(x/v*100).toFixed(1):null,b=u;let y;e[0]!==b?(y=b.filter(na).reduce(sa,0),e[0]=b,e[1]=y):y=e[1];const p=y,S=u;let N;e[2]!==S?(N=S.filter(ta).reduce(ea,0),e[2]=S,e[3]=N):N=e[3];const T=N,_=Math.max(0,f.totalTokens-p-T),w=u[0],I=u.at(-1),P=w?.metadata?.created_at??l?.created_at,L=I?.metadata?.created_at??l?.updated_at,$=u.filter(Xn),E=u.flatMap(Jn),F=Dn(k?.id??d?.modelId),R=m?.title??"Super Agent",A=Os(),C=[{label:a("chat.contextPanel.sessionLabel"),value:l?.title??a("chat.contextPanel.newChat")},{label:a("chat.contextPanel.messagesLabel"),value:$.length},{label:a("chat.contextPanel.agentLabel"),value:R},...A?[{label:a("chat.contextPanel.modelLabel"),value:F}]:[],{label:a("chat.contextPanel.contextLimitLabel"),value:v?be(v):"—"},{label:a("chat.contextPanel.sessionTokensLabel"),value:f.totalTokens>0?be(f.totalTokens):"0"},{label:a("chat.contextPanel.usageLabel"),value:g!==null?`${g}%`:"—"},{label:a("chat.contextPanel.inputTokensLabel"),value:f.inputTokens>0?be(f.inputTokens):"0"},{label:a("chat.contextPanel.outputTokensLabel"),value:f.outputTokens>0?be(f.outputTokens):"0"},{label:a("chat.contextPanel.reasoningTokensLabel"),value:f.reasoningTokens>0?be(f.reasoningTokens):"0"},...A?[{label:a("chat.contextPanel.costLabel"),value:f.cost>0?`$${f.cost<.001?f.cost.toFixed(6):f.cost.toFixed(4)}`:"$0.00"}]:[],{label:a("chat.contextPanel.sessionCreatedLabel"),value:ze(P)},{label:a("chat.contextPanel.lastActivityLabel"),value:ze(L)}];if(!l&&$.length===0){let D;e[4]!==i?(D=ee("flex flex-col h-full w-full border-l border-border bg-background",i),e[4]=i,e[5]=D):D=e[5];let re;e[6]!==a?(re=a("chat.contextPanel.title"),e[6]=a,e[7]=re):re=e[7];let Q;e[8]!==re?(Q=n.jsx("span",{className:"text-sm font-medium text-foreground",children:re}),e[8]=re,e[9]=Q):Q=e[9];let X;e[10]!==r?(X=r?n.jsx(at,{size:14,className:"text-muted-foreground"}):n.jsx(rt,{size:14,className:"text-muted-foreground"}),e[10]=r,e[11]=X):X=e[11];let te;e[12]!==s||e[13]!==X?(te=n.jsx("button",{type:"button",onClick:s,className:"flex size-6 items-center justify-center hover:bg-accent transition-colors rounded-lg",children:X}),e[12]=s,e[13]=X,e[14]=te):te=e[14];let ae;e[15]!==Q||e[16]!==te?(ae=n.jsxs("div",{className:"h-11 px-4 flex items-center justify-between shrink-0 border-b border-border/50",children:[Q,te]}),e[15]=Q,e[16]=te,e[17]=ae):ae=e[17];let ie;e[18]!==a?(ie=a("chat.contextPanel.emptyState"),e[18]=a,e[19]=ie):ie=e[19];let se;e[20]!==ie?(se=n.jsx("div",{className:"flex-1 flex items-center justify-center px-4 text-center",children:n.jsx("p",{className:"text-xs text-muted-foreground",children:ie})}),e[20]=ie,e[21]=se):se=e[21];let oe;return e[22]!==ae||e[23]!==se||e[24]!==D?(oe=n.jsxs("div",{className:D,children:[ae,se]}),e[22]=ae,e[23]=se,e[24]=D,e[25]=oe):oe=e[25],oe}let G;e[26]!==i?(G=ee("flex flex-col h-full w-full border-l border-border bg-background overflow-y-auto",i),e[26]=i,e[27]=G):G=e[27];let z;e[28]!==a?(z=a("chat.contextPanel.title"),e[28]=a,e[29]=z):z=e[29];let H;e[30]!==z?(H=n.jsx("span",{className:"text-sm font-medium text-foreground",children:z}),e[30]=z,e[31]=H):H=e[31];let O;e[32]!==r?(O=r?n.jsx(at,{size:14}):n.jsx(rt,{size:14}),e[32]=r,e[33]=O):O=e[33];let V;e[34]!==s||e[35]!==O?(V=n.jsx("button",{type:"button",onClick:s,className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:O}),e[34]=s,e[35]=O,e[36]=V):V=e[36];let Z;e[37]!==H||e[38]!==V?(Z=n.jsxs("div",{className:"flex h-11 shrink-0 items-center justify-between border-b border-border/50 px-4",children:[H,V]}),e[37]=H,e[38]=V,e[39]=Z):Z=e[39];let Y;e[40]!==a?(Y=a("chat.contextPanel.contextBreakdownSection"),e[40]=a,e[41]=Y):Y=e[41];let J;e[42]!==Y?(J=n.jsx("span",{className:"text-xs text-muted-foreground",children:Y}),e[42]=Y,e[43]=J):J=e[43];let q;e[44]!==T||e[45]!==_||e[46]!==p?(q=n.jsx(Hn,{userTokens:p,assistantTokens:T,otherTokens:_}),e[44]=T,e[45]=_,e[46]=p,e[47]=q):q=e[47];let le;return e[48]!==J||e[49]!==q?(le=n.jsxs("div",{className:"flex flex-col gap-3",children:[J,q]}),e[48]=J,e[49]=q,e[50]=le):le=e[50],n.jsxs("div",{className:G,children:[Z,n.jsxs("div",{className:"flex flex-col gap-8 p-6",children:[E.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.subtasksSection")}),n.jsx("div",{className:"flex flex-col gap-1",children:E.map(Zn)})]}),n.jsx(zn,{items:C}),le,$.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.rawMessagesSection")}),n.jsx("div",{className:"flex flex-col gap-1",children:$.map(D=>{const re=D.metadata?.created_at,Q=o?.id===D.id;return n.jsxs("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[n.jsxs("button",{type:"button",onClick:()=>c(Q?null:D),className:"flex items-center justify-between gap-2 px-3 py-2 text-xs hover:bg-accent/50 w-full text-left cursor-pointer",children:[n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx("span",{className:ee("shrink-0 font-medium",D.role==="user"?"text-chart-1":"text-chart-2"),children:D.role}),n.jsx("span",{className:"text-muted-foreground",children:"•"}),n.jsx("span",{className:"truncate text-muted-foreground font-mono",children:D.id})]}),re&&n.jsx("span",{className:"shrink-0 text-muted-foreground tabular-nums",children:ze(re)})]}),Q&&n.jsxs(n.Fragment,{children:[D.role==="assistant"&&(()=>{const X=D.metadata?._request;if(!X)return null;const te=X.systemSections??[],ae=Math.max(1,...te.map(Yn)),ie=te.reduce(Wn,0);return n.jsxs("div",{className:"border-t border-border/50 px-3 py-2.5 text-xs space-y-2.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"font-medium text-foreground",children:a("chat.contextPanel.requestLabel")}),n.jsxs("span",{className:"text-muted-foreground tabular-nums",children:[X.activeTools??0," / ",X.tools??0," ",a("chat.contextPanel.toolsActive")]})]}),te.length>0&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"text-muted-foreground",children:[a("chat.contextPanel.systemPromptLabel")," ",n.jsxs("span",{className:"tabular-nums",children:["~",Math.round(ie/4).toLocaleString()," ",a("chat.contextPanel.tokAbbrev")]})]}),te.map((se,oe)=>{const ce=se.preview.match(/^<([a-z-]+)/i)?.[1]??`section ${oe}`,xe=se.chars/ae*100,de=Math.round(se.chars/4);return n.jsxs("div",{className:"space-y-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("span",{className:"font-mono text-foreground truncate",children:ce}),n.jsxs("span",{className:"text-muted-foreground tabular-nums shrink-0",children:["~",de.toLocaleString()," ",a("chat.contextPanel.tokAbbrev")]})]}),n.jsx("div",{className:"h-1 w-full rounded-full bg-muted overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-chart-3",style:{width:`${xe}%`}})})]},oe)})]})]})})(),n.jsx("pre",{className:"text-xs font-mono bg-muted px-3 py-2 overflow-auto whitespace-pre-wrap break-all border-t border-border/50 max-h-64",children:JSON.stringify(D,null,2)})]})]},D.id)})})]})]})]})}function Wn(t,e){return t+e.chars}function Yn(t){return t.chars}function Zn(t,e){return n.jsx(Vn,{part:t},e)}function Jn(t){return(t.parts??[]).filter(Qn)}function Qn(t){return t.type==="tool-subtask"}function Xn(t){return t.role!=="system"}function ea(t,e){const s=e.metadata?.usage;return t+(s?.outputTokens??0)}function ta(t){return t.role==="assistant"}function sa(t,e){const s=e.metadata?.usage;return t+(s?.inputTokens??0)}function na(t){return t.role==="user"}function aa(t){return t.role==="assistant"&&t.metadata?.models}function ra(t){return t.role==="assistant"&&t.metadata?.usage}function ia(t){const e=M.c(21),{onOpenContextPanel:s}=t,{org:r}=ne(),{selectedVirtualMcp:i}=jt();let a;e[0]!==r.id?(a=je(r.id),e[0]=r.id,e[1]=a):a=e[1];const c=i??a,l=Se(c.id)??c,d=l.title??"Super Agent",m=l.icon??null,f=l.description??null;let h;e[2]!==m||e[3]!==d?(h=n.jsx(ye,{icon:m,name:d,size:"lg"}),e[2]=m,e[3]=d,e[4]=h):h=e[4];let j;e[5]!==d?(j=n.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-foreground",children:d}),e[5]=d,e[6]=j):j=e[6];let k;e[7]!==f?(k=f?n.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-balance",children:f}):null,e[7]=f,e[8]=k):k=e[8];let v;e[9]!==j||e[10]!==k?(v=n.jsxs("div",{className:"space-y-1.5",children:[j,k]}),e[9]=j,e[10]=k,e[11]=v):v=e[11];let x;e[12]!==h||e[13]!==v?(x=n.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center gap-4 px-6 text-center overflow-hidden",children:[h,v]}),e[12]=h,e[13]=v,e[14]=x):x=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(W.IceBreakers,{className:"pb-3"}),e[15]=g):g=e[15];let b;e[16]!==s?(b=n.jsxs(W.Footer,{children:[g,n.jsx(W.Input,{onOpenContextPanel:s})]}),e[16]=s,e[17]=b):b=e[17];let y;return e[18]!==x||e[19]!==b?(y=n.jsxs(n.Fragment,{children:[x,b]}),e[18]=x,e[19]=b,e[20]=y):y=e[20],y}function ot(t){const e=M.c(17),{outputs:s,collapsed:r,onToggle:i,variant:a}=t,o=a==="card"?"rounded-xl border border-border bg-muted/95 shadow-sm backdrop-blur-sm":"border-b border-border bg-background";let c;e[0]!==o?(c=ee(o),e[0]=o,e[1]=c):c=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx("span",{className:"text-sm font-medium text-foreground",children:"Files in this task"}),e[2]=u):u=e[2];const l=r&&"-rotate-90";let d;e[3]!==l?(d=ee("size-4 text-muted-foreground transition-transform",l),e[3]=l,e[4]=d):d=e[4];let m;e[5]!==d?(m=n.jsx(Ye,{className:d}),e[5]=d,e[6]=m):m=e[6];let f;e[7]!==i||e[8]!==m?(f=n.jsxs("button",{type:"button",onClick:i,className:"flex w-full items-center justify-between px-3 py-2.5 text-left",children:[u,m]}),e[7]=i,e[8]=m,e[9]=f):f=e[9];let h;e[10]!==r||e[11]!==s?(h=!r&&n.jsx("div",{className:"flex max-h-72 flex-col gap-1.5 overflow-y-auto px-2 pb-2",children:s.map(la)}),e[10]=r,e[11]=s,e[12]=h):h=e[12];let j;return e[13]!==c||e[14]!==f||e[15]!==h?(j=n.jsxs("div",{className:c,children:[f,h]}),e[13]=c,e[14]=f,e[15]=h,e[16]=j):j=e[16],j}function la(t){return n.jsx(Bs,{file:t},t.key)}function oa(){const t=M.c(13),e=$e()?.taskId??null,s=Ds();let r;t[0]!==s?(r={enabled:s},t[0]=s,t[1]=r):r=t[1];const{data:i}=zs(e,r),[a,o]=B.useState(!1),[c,u]=B.useState(!0);if(!e||!i||i.length===0)return null;let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>o(da),t[2]=l):l=t[2];let d;t[3]!==a||t[4]!==i?(d=n.jsx("div",{className:"absolute top-2 right-2 z-10 hidden w-72 @[1280px]:block",children:n.jsx(ot,{variant:"card",outputs:i,collapsed:a,onToggle:l})}),t[3]=a,t[4]=i,t[5]=d):d=t[5];let m;t[6]===Symbol.for("react.memo_cache_sentinel")?(m=()=>u(ca),t[6]=m):m=t[6];let f;t[7]!==c||t[8]!==i?(f=n.jsx("div",{className:"shrink-0 @[1280px]:hidden",children:n.jsx(ot,{variant:"bar",outputs:i,collapsed:c,onToggle:m})}),t[7]=c,t[8]=i,t[9]=f):f=t[9];let h;return t[10]!==d||t[11]!==f?(h=n.jsxs(n.Fragment,{children:[d,f]}),t[10]=d,t[11]=f,t[12]=h):h=t[12],h}function ca(t){return!t}function da(t){return!t}function ua(){const t=M.c(1);B.use(We().ready);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ws,{children:n.jsx(fa,{})}),t[0]=e):e=t[0],e}function fa(){const t=M.c(29),{active:e}=Cs(),{org:s}=ne(),r=$e(),{isChatEmpty:i}=We(),[a,o]=B.useState("chat"),c=Gs(),u=K(),l=Rn(),{runtime:d}=yt(r?.virtualMcpId);if(l!==null&&d!=="cms"){let T;return t[0]!==l||t[1]!==u?(T=n.jsx(W,{className:"animate-in fade-in-0 duration-200",children:n.jsx(W.Main,{className:"flex flex-col items-center",children:n.jsx(W.EmptyState,{children:l==="codex-provider"?n.jsx(W.NoAiProviderEmptyState,{title:u("settings.codexSubscription.setupHeading"),description:u("settings.codexSubscription.setupDescription"),providerFilter:vt}):l==="claude-code-provider"?n.jsx(W.NoAiProviderEmptyState,{title:u("chat.noAiProviderEmptyState.supportedHeading"),description:u("chat.noAiProviderEmptyState.supportedSubtitle"),providerFilter:kt}):n.jsx(W.NoAiProviderEmptyState,{})})})}),t[0]=l,t[1]=u,t[2]=T):T=t[2],T}let f;t[3]!==c.hasDecoKey||t[4]!==c.hasOnlyDecoProvider||t[5]!==c.isLoading||t[6]!==c.isZeroBalance||t[7]!==i||t[8]!==s?(f=c.hasDecoKey&&c.isZeroBalance&&c.hasOnlyDecoProvider&&!c.isLoading&&i&&!Ns(s.id),t[3]=c.hasDecoKey,t[4]=c.hasOnlyDecoProvider,t[5]=c.isLoading,t[6]=c.isZeroBalance,t[7]=i,t[8]=s,t[9]=f):f=t[9];const h=f;let j;t[10]!==h?(j=h&&n.jsx(W.CreditsEmptyState,{}),t[10]=h,t[11]=j):j=t[11];let k;t[12]!==a||t[13]!==i||t[14]!==d||t[15]!==e?(k=!e&&n.jsx("div",{inert:a!=="chat"?!0:void 0,"aria-hidden":a!=="chat",className:ee("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",a!=="chat"?"opacity-0 pointer-events-none":"opacity-100"),children:i&&d!=="cms"?n.jsx(ia,{onOpenContextPanel:()=>o("context")}):n.jsxs(n.Fragment,{children:[n.jsxs(W.Main,{className:"relative flex flex-col overflow-hidden @container",children:[n.jsx(oa,{}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(W.Messages,{})})]}),n.jsx(W.Footer,{children:n.jsx(W.Input,{onOpenContextPanel:()=>o("context")})})]})}),t[12]=a,t[13]=i,t[14]=d,t[15]=e,t[16]=k):k=t[16];let v;t[17]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ps,{}),t[17]=v):v=t[17];const x=a!=="context"?!0:void 0,g=a!=="context",b=a==="context"?"opacity-100":"opacity-0 pointer-events-none";let y;t[18]!==b?(y=ee("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",b),t[18]=b,t[19]=y):y=t[19];let p;t[20]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(qn,{back:!0,onClose:()=>o("chat")}),t[20]=p):p=t[20];let S;t[21]!==x||t[22]!==g||t[23]!==y?(S=n.jsx("div",{inert:x,"aria-hidden":g,className:y,children:p}),t[21]=x,t[22]=g,t[23]=y,t[24]=S):S=t[24];let N;return t[25]!==j||t[26]!==k||t[27]!==S?(N=n.jsxs(W,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[j,k,v,S]}),t[25]=j,t[26]=k,t[27]=S,t[28]=N):N=t[28],N}function ma(){const t=M.c(7),e=K();let s;t[0]!==e?(s=e("agentShellLayout.agentShellLayout.chatLoadingError"),t[0]=e,t[1]=s):s=t[1];let r;t[2]!==s?(r=n.jsx("div",{role:"alert",className:"flex h-full flex-1 items-center justify-center text-sm text-muted-foreground",children:s}),t[2]=s,t[3]=r):r=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Ae,{children:n.jsx(ua,{})}),t[4]=i):i=t[4];let a;return t[5]!==r?(a=n.jsx(pt,{fallback:r,children:i}),t[5]=r,t[6]=a):a=t[6],a}function ha(t){const e=M.c(10),{org:s}=ne(),r=tn(),{data:i}=pe.useSession(),a=i?.user?.id,o=t?.id??null,c=!!t&&!!a&&!!t.created_by&&t.created_by!==a;let u;e[0]!==s.id||e[1]!==o?(u=fe.viewedThreadMetadataRefresh(s.id,o??""),e[0]=s.id,e[1]=o,e[2]=u):u=e[2];const l=!!r&&!!o&&c;let d;e[3]!==r||e[4]!==o?(d=async()=>(await r?.refreshThreadMetadata(o??""),!0),e[3]=r,e[4]=o,e[5]=d):d=e[5];let m;e[6]!==u||e[7]!==l||e[8]!==d?(m={queryKey:u,enabled:l,staleTime:Number.POSITIVE_INFINITY,queryFn:d},e[6]=u,e[7]=l,e[8]=d,e[9]=m):m=e[9],me(m)}function Ge(t){const e=M.c(14),{label:s,value:r,onChange:i,options:a}=t;let o;e[0]!==s?(o=n.jsx("span",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=o):o=e[1];let c;e[2]!==i?(c=m=>m&&i(m),e[2]=i,e[3]=c):c=e[3];let u;e[4]!==a?(u=a.map(pa),e[4]=a,e[5]=u):u=e[5];let l;e[6]!==s||e[7]!==c||e[8]!==u||e[9]!==r?(l=n.jsx(un,{type:"single",size:"sm",value:r,onValueChange:c,"aria-label":s,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:u}),e[6]=s,e[7]=c,e[8]=u,e[9]=r,e[10]=l):l=e[10];let d;return e[11]!==o||e[12]!==l?(d=n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,l]}),e[11]=o,e[12]=l,e[13]=d):d=e[13],d}function pa(t){return n.jsxs(dn,{value:t.value,className:"h-6 gap-1.5 rounded-lg border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[t.icon,t.label]},t.value)}function xa(t){const e=M.c(91),{panel:s,className:r}=t,i=r===void 0?"md:size-[34px]":r,a=K();let o;e[0]!==a?(o=a("sidebar.taskGroupsList.filterChats"),e[0]=a,e[1]=o):o=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(us,{size:16}),e[2]=c):c=e[2];let u;e[3]!==s.filtersActive?(u=s.filtersActive&&n.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"}),e[3]=s.filtersActive,e[4]=u):u=e[4];let l;e[5]!==i||e[6]!==s.filtersActive||e[7]!==o||e[8]!==u?(l=n.jsx(Fe,{asChild:!0,children:n.jsx(Mt,{asChild:!0,children:n.jsxs(we,{"aria-label":o,active:s.filtersActive,className:i,children:[c,u]})})}),e[5]=i,e[6]=s.filtersActive,e[7]=o,e[8]=u,e[9]=l):l=e[9];let d;e[10]!==a?(d=a("sidebar.taskGroupsList.filterChats"),e[10]=a,e[11]=d):d=e[11];let m;e[12]!==d?(m=n.jsx(Re,{side:"bottom",children:d}),e[12]=d,e[13]=m):m=e[13];let f;e[14]!==l||e[15]!==m?(f=n.jsxs(Oe,{children:[l,m]}),e[14]=l,e[15]=m,e[16]=f):f=e[16];let h;e[17]!==a?(h=a("sidebar.taskGroupsList.filterView"),e[17]=a,e[18]=h):h=e[18];const j=s.groupBy;let k;e[19]!==s?(k=D=>{he("tasks_panel_group_by_changed",{to_value:D}),s.setGroupBy(D)},e[19]=s,e[20]=k):k=e[20];let v;e[21]!==a?(v=a("sidebar.taskGroupsList.viewList"),e[21]=a,e[22]=v):v=e[22];let x;e[23]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(fs,{size:13}),e[23]=x):x=e[23];let g;e[24]!==v?(g={value:"flat",label:v,icon:x},e[24]=v,e[25]=g):g=e[25];let b;e[26]!==a?(b=a("sidebar.taskGroupsList.viewStatus"),e[26]=a,e[27]=b):b=e[27];let y;e[28]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ms,{size:13}),e[28]=y):y=e[28];let p;e[29]!==b?(p={value:"status",label:b,icon:y},e[29]=b,e[30]=p):p=e[30];let S;e[31]!==g||e[32]!==p?(S=[g,p],e[31]=g,e[32]=p,e[33]=S):S=e[33];let N;e[34]!==s.groupBy||e[35]!==k||e[36]!==S||e[37]!==h?(N=n.jsx(Ge,{label:h,value:j,onChange:k,options:S}),e[34]=s.groupBy,e[35]=k,e[36]=S,e[37]=h,e[38]=N):N=e[38];let T;e[39]!==a?(T=a("sidebar.taskGroupsList.filterType"),e[39]=a,e[40]=T):T=e[40];const _=s.typeFilter;let w;e[41]!==s?(w=D=>{he("tasks_panel_filter_changed",{to_value:D}),s.setTypeFilter(D)},e[41]=s,e[42]=w):w=e[42];let I;e[43]!==a?(I=a("sidebar.taskGroupsList.typeAll"),e[43]=a,e[44]=I):I=e[44];let P;e[45]!==I?(P={value:"all",label:I},e[45]=I,e[46]=P):P=e[46];let L;e[47]!==a?(L=a("sidebar.taskGroupsList.typeChats"),e[47]=a,e[48]=L):L=e[48];let $;e[49]!==L?($={value:"manual",label:L},e[49]=L,e[50]=$):$=e[50];let E;e[51]!==a?(E=a("sidebar.taskGroupsList.typeAuto"),e[51]=a,e[52]=E):E=e[52];let F;e[53]!==E?(F={value:"automation",label:E},e[53]=E,e[54]=F):F=e[54];let R;e[55]!==P||e[56]!==$||e[57]!==F?(R=[P,$,F],e[55]=P,e[56]=$,e[57]=F,e[58]=R):R=e[58];let A;e[59]!==s.typeFilter||e[60]!==T||e[61]!==w||e[62]!==R?(A=n.jsx(Ge,{label:T,value:_,onChange:w,options:R}),e[59]=s.typeFilter,e[60]=T,e[61]=w,e[62]=R,e[63]=A):A=e[63];let C;e[64]!==a?(C=a("sidebar.taskGroupsList.filterScope"),e[64]=a,e[65]=C):C=e[65];const G=s.showAll?"team":"mine";let z;e[66]!==s?(z=D=>s.setShowAll(D==="team"),e[66]=s,e[67]=z):z=e[67];let H;e[68]!==a?(H=a("sidebar.taskGroupsList.scopeMine"),e[68]=a,e[69]=H):H=e[69];let O;e[70]!==H?(O={value:"mine",label:H},e[70]=H,e[71]=O):O=e[71];let V;e[72]!==a?(V=a("sidebar.taskGroupsList.scopeTeam"),e[72]=a,e[73]=V):V=e[73];let Z;e[74]!==V?(Z={value:"team",label:V},e[74]=V,e[75]=Z):Z=e[75];let Y;e[76]!==O||e[77]!==Z?(Y=[O,Z],e[76]=O,e[77]=Z,e[78]=Y):Y=e[78];let J;e[79]!==C||e[80]!==G||e[81]!==z||e[82]!==Y?(J=n.jsx(Ge,{label:C,value:G,onChange:z,options:Y}),e[79]=C,e[80]=G,e[81]=z,e[82]=Y,e[83]=J):J=e[83];let q;e[84]!==N||e[85]!==A||e[86]!==J?(q=n.jsxs(Lt,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[N,A,J]}),e[84]=N,e[85]=A,e[86]=J,e[87]=q):q=e[87];let le;return e[88]!==q||e[89]!==f?(le=n.jsxs($t,{children:[f,q]}),e[88]=q,e[89]=f,e[90]=le):le=e[90],le}function ga(t,e){return t.filter(s=>s.id===e||!!s.trigger_id||qs(s))}function ba(){const t=M.c(2),e=Tt()??[];let s;return t[0]!==e?(s=r=>{if(!r)return;const i=e.find(a=>a.id===r);return i?Pt(i.metadata):void 0},t[0]=e,t[1]=s):s=t[1],s}function va(t){const e=M.c(9),{virtualMcpId:s,size:r,showAutomationBadge:i}=t,a=r===void 0?"sm":r,o=K();let c;e[0]!==a||e[1]!==s?(c=s?n.jsx(ya,{virtualMcpId:s,size:a}):n.jsx(ye,{icon:null,name:"?",size:a}),e[0]=a,e[1]=s,e[2]=c):c=e[2];let u;e[3]!==i||e[4]!==o?(u=i&&n.jsx("span",{"aria-label":o("tasksPanel.mcpAvatar.automationTriggered"),className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-special border border-special text-special-foreground",children:n.jsx(Rt,{size:10,className:"text-white"})}),e[3]=i,e[4]=o,e[5]=u):u=e[5];let l;return e[6]!==c||e[7]!==u?(l=n.jsxs("div",{className:"relative shrink-0",children:[c,u]}),e[6]=c,e[7]=u,e[8]=l):l=e[8],l}function ya(t){const e=M.c(6),{virtualMcpId:s,size:r}=t,i=Nt(s);if(!i){let c;return e[0]!==r?(c=n.jsx(ye,{icon:null,name:"?",size:r}),e[0]=r,e[1]=c):c=e[1],c}const a=i.icon??null;let o;return e[2]!==i.title||e[3]!==r||e[4]!==a?(o=n.jsx(ye,{icon:a,name:i.title,size:r}),e[2]=i.title,e[3]=r,e[4]=a,e[5]=o):o=e[5],o}const ct=["thread"];function ja(t){const e=M.c(53),{open:s,onOpenChange:r}=t,[i,a]=B.useState(""),{org:o}=ne(),{setTaskId:c}=Ze(),u=Ie(),l=K();let d,m,f,h;e[0]!==o.id||e[1]!==i?(h=i.trim(),d=h?20:10,f=me,m=fe.globalSearch(o.id,h,d,ct),e[0]=o.id,e[1]=i,e[2]=d,e[3]=m,e[4]=f,e[5]=h):(d=e[2],m=e[3],f=e[4],h=e[5]);let j;e[6]!==d||e[7]!==u||e[8]!==h?(j=async()=>{const C=await u.call("GLOBAL_SEARCH",{query:h,limit:d,types:[...ct]});return{...C,items:C.items.filter(ka)}},e[6]=d,e[7]=u,e[8]=h,e[9]=j):j=e[9];let k;e[10]!==s||e[11]!==m||e[12]!==j?(k={queryKey:m,enabled:s,queryFn:j,staleTime:1e4},e[10]=s,e[11]=m,e[12]=j,e[13]=k):k=e[13];const{data:v,isFetching:x}=f(k);let g;e[14]!==v?.items?(g=v?.items??[],e[14]=v?.items,e[15]=g):g=e[15];const b=g;let y;e[16]!==r?(y=C=>{C||a(""),r(C)},e[16]=r,e[17]=y):y=e[17];const p=y;let S;e[18]!==p||e[19]!==c?(S=C=>{p(!1),c(C.id,C.virtual_mcp_id??void 0)},e[18]=p,e[19]=c,e[20]=S):S=e[20];const N=S;let T;e[21]!==l?(T=l("tasksPanel.globalSearchDialog.title"),e[21]=l,e[22]=T):T=e[22];let _;e[23]!==T?(_=n.jsx(qt,{children:T}),e[23]=T,e[24]=_):_=e[24];let w;e[25]!==l?(w=l("tasksPanel.globalSearchDialog.description"),e[25]=l,e[26]=w):w=e[26];let I;e[27]!==w?(I=n.jsx(Wt,{children:w}),e[27]=w,e[28]=I):I=e[28];let P;e[29]!==I||e[30]!==_?(P=n.jsxs(Yt,{className:"sr-only",children:[_,I]}),e[29]=I,e[30]=_,e[31]=P):P=e[31];let L;e[32]!==l?(L=l("tasksPanel.globalSearchDialog.placeholder"),e[32]=l,e[33]=L):L=e[33];let $;e[34]!==i||e[35]!==L?($=n.jsx(vn,{value:i,onValueChange:a,placeholder:L}),e[34]=i,e[35]=L,e[36]=$):$=e[36];let E;e[37]!==N||e[38]!==x||e[39]!==b||e[40]!==l||e[41]!==h?(E=n.jsx(pn,{children:x&&b.length===0?n.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l("tasksPanel.globalSearchDialog.searching")}):b.length===0?n.jsx(xn,{children:l("tasksPanel.globalSearchDialog.noResults")}):n.jsx(gn,{heading:h?void 0:l("tasksPanel.globalSearchDialog.recent"),children:b.map(C=>C.type==="thread"?n.jsxs(bn,{value:`thread:${C.id}:${C.title}`,onSelect:()=>N(C),className:"gap-2.5",children:[n.jsx(va,{virtualMcpId:C.virtual_mcp_id,size:"xs"}),n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx("div",{className:"text-sm text-foreground truncate",children:C.title||l("tasksPanel.globalSearchDialog.untitledChat")})}),n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(C.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${C.id}`):null)})}),e[37]=N,e[38]=x,e[39]=b,e[40]=l,e[41]=h,e[42]=E):E=e[42];let F;e[43]!==$||e[44]!==E?(F=n.jsxs(yn,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[$,E]}),e[43]=$,e[44]=E,e[45]=F):F=e[45];let R;e[46]!==P||e[47]!==F?(R=n.jsxs(Zt,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[P,F]}),e[46]=P,e[47]=F,e[48]=R):R=e[48];let A;return e[49]!==p||e[50]!==s||e[51]!==R?(A=n.jsx(Jt,{open:s,onOpenChange:p,children:R}),e[49]=p,e[50]=s,e[51]=R,e[52]=A):A=e[52],A}function ka(t){return t.type==="thread"}function Sa(t,e,s){if(!s)return;const r=t.findIndex(i=>i.id===e);if(r!==-1){for(let i=r+1;i<t.length;i++){const a=t[i];if(a?.created_by===s)return a}for(let i=r-1;i>=0;i--){const a=t[i];if(a?.created_by===s)return a}}}function Ta(t){return t==="ephemeral"||t.startsWith("thread:")}function zt(t){const e=M.c(45),{task:s,isActive:r,onClick:i,onArchive:a,showAutomationBadge:o,showAgentIcon:c,hideStatusIdle:u,indented:l}=t,d=K(),m=jn(s.status),f=m.icon,h=s.metadata?.kind==="tool_call_run",j=Nt(h?void 0:s.virtual_mcp_id);let k;e[0]!==j?(k=_t(j),e[0]=j,e[1]=k):k=e[1];const v=k;Tn(6e4);const x=o||!!s.trigger_id,g=s.id,b="button",y=0;let p;e[2]!==i?(p=z=>{z.target===z.currentTarget&&(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),i())},e[2]=i,e[3]=p):p=e[3];const S=l?"-ml-4 pl-6":"pl-[9px]",N=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let T;e[4]!==S||e[5]!==N?(T=ee("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",S,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[4]=S,e[5]=N,e[6]=T):T=e[6];let _;e[7]!==h||e[8]!==c||e[9]!==j?.icon||e[10]!==j?.title?(_=c&&!h&&n.jsx(ye,{icon:j?.icon??null,name:j?.title??"?",size:"2xs"}),e[7]=h,e[8]=c,e[9]=j?.icon,e[10]=j?.title,e[11]=_):_=e[11];let w;e[12]!==x||e[13]!==d?(w=x&&n.jsx(Rt,{size:12,"aria-label":d("tasksPanel.taskRow.automationTriggered"),className:"shrink-0 text-special"}),e[12]=x,e[13]=d,e[14]=w):w=e[14];let I;e[15]!==d||e[16]!==s.title?(I=s.title||d("tasksPanel.taskRow.untitledTask"),e[15]=d,e[16]=s.title,e[17]=I):I=e[17];let P;e[18]!==I?(P=n.jsx("div",{className:"text-sm text-foreground truncate",children:I}),e[18]=I,e[19]=P):P=e[19];let L;e[20]!==w||e[21]!==P?(L=n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[w,P]}),e[20]=w,e[21]=P,e[22]=L):L=e[22];let $;e[23]!==r||e[24]!==v||e[25]!==s.branch||e[26]!==s.updated_at?($=s.updated_at&&n.jsxs("div",{className:ee("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[s.branch&&!Ta(s.branch)?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"truncate font-mono",children:s.branch}),n.jsx("span",{className:"shrink-0",children:"·"})]}):v?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"truncate",children:[v.owner,"/",v.name]}),n.jsx("span",{className:"shrink-0",children:"·"})]}):null,n.jsx("span",{className:"shrink-0",children:Sn(new Date(s.updated_at))})]}),e[23]=r,e[24]=v,e[25]=s.branch,e[26]=s.updated_at,e[27]=$):$=e[27];let E;e[28]!==L||e[29]!==$?(E=n.jsxs("div",{className:"flex-1 min-w-0",children:[L,$]}),e[28]=L,e[29]=$,e[30]=E):E=e[30];const F="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",R=!u&&n.jsx("span",{className:ee("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",a&&"group-hover/row:opacity-0"),"aria-label":d("tasksPanel.taskRow.statusLabel",{status:d(m.labelKey)}),children:s.status==="in_progress"?n.jsx(ve,{className:ee("size-3.5",m.iconClassName)}):n.jsx(f,{size:14,className:m.iconClassName})});let A;e[31]!==a||e[32]!==d?(A=a&&n.jsxs(Oe,{children:[n.jsx(Fe,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":d("tasksPanel.taskRow.archiveTask"),onClick:z=>{z.stopPropagation(),a()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-8 items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:n.jsx(Qt,{size:14})})}),n.jsx(Re,{side:"right",children:d("tasksPanel.taskRow.archive")})]}),e[31]=a,e[32]=d,e[33]=A):A=e[33];let C;e[34]!==R||e[35]!==A?(C=n.jsxs("div",{className:F,children:[R,A]}),e[34]=R,e[35]=A,e[36]=C):C=e[36];let G;return e[37]!==i||e[38]!==E||e[39]!==C||e[40]!==p||e[41]!==T||e[42]!==_||e[43]!==s.id?(G=n.jsxs("div",{"data-task-id":g,role:b,tabIndex:y,onClick:i,onKeyDown:p,className:T,children:[_,E,C]}),e[37]=i,e[38]=E,e[39]=C,e[40]=p,e[41]=T,e[42]=_,e[43]=s.id,e[44]=G):G=e[44],G}const dt=["requires_action","in_progress","failed","expired","completed"];function Na(t){const e=new Map(dt.map(s=>[s,[]]));for(const s of t){const r=s.status??"completed";(e.get(r)??e.get("completed")).push(s)}return dt.map(s=>({status:s,threads:e.get(s)}))}const _a="sidebar.group.expanded.";function wa(t,e){const s=M.c(3),[r,i]=xt(`${_a}${t}`,e);let a;return s[0]!==r||s[1]!==i?(a=[r,i],s[0]=r,s[1]=i,s[2]=a):a=s[2],a}function Gt(t){const e=M.c(18),{onClick:s,isFetching:r,indented:i}=t,a=K();let o;e[0]!==a?(o=a("sidebar.showMoreButton.ariaLabel"),e[0]=a,e[1]=o):o=e[1];const c=i?"-ml-4 pl-6 pr-2":"px-2";let u;e[2]!==c?(u=ee("flex items-center gap-2 py-1.5 rounded-lg text-sm text-muted-foreground",c,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[2]=c,e[3]=u):u=e[3];let l;e[4]!==r?(l=r&&n.jsx(ve,{className:"size-3.5"}),e[4]=r,e[5]=l):l=e[5];let d;e[6]!==r||e[7]!==a?(d=a(r?"sidebar.showMoreButton.loading":"sidebar.showMoreButton.showMore"),e[6]=r,e[7]=a,e[8]=d):d=e[8];let m;e[9]!==d?(m=n.jsx("span",{children:d}),e[9]=d,e[10]=m):m=e[10];let f;return e[11]!==r||e[12]!==s||e[13]!==o||e[14]!==u||e[15]!==l||e[16]!==m?(f=n.jsxs("button",{type:"button","aria-label":o,onClick:s,disabled:r,className:u,children:[l,m]}),e[11]=r,e[12]=s,e[13]=o,e[14]=u,e[15]=l,e[16]=m,e[17]=f):f=e[17],f}function Ca(t,e,s,r){return[t,e,s,r.type,r.member,r.currentUserId??""].join("|")}function Pa(t){return t.member==="mine"&&!t.currentUserId}const Ht=4;let _e=0;const Ke=[];function Ia(){for(;_e<Ht&&Ke.length>0;){const t=Ke.shift();t&&t()}}function Ut(t){return new Promise((e,s)=>{const r=()=>{_e++,t().then(e,s).finally(()=>{_e--,Ia()})};_e<Ht?r():Ke.push(r)})}const Be=10;function ut(t,e,s,r,i){const a={hidden:!1};r.member==="mine"&&r.currentUserId&&(a.created_by=r.currentUserId),r.type==="automation"&&(a.has_trigger=!0),r.type==="manual"&&(a.has_trigger=!1);const o={where:a,limit:i,offset:s,orderBy:[{field:["updated_at"],direction:"desc"}]};return o.status=e,o}function Aa(t,e,s,r){let i=0;for(const a of t)Kt(a,e,s,r)&&i++;return i}function He(t,e,s,r){return Aa(t,e,s,r)}function Ma(t,e){return!!(t>=Be||t===0&&e)}function ft(t,e){return t<e}function La(t,e){return e===!1?!1:e===!0?!0:t}function Kt(t,e,s,r){return!(t.hidden||(t.status??"completed")!==s||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const Pe=new Map,Ne=new Map;function $a(t,e){return e?t>=Be?!0:null:!1}function mt(t){return Pe.get(t)}function Ea(t,e){Pe.set(t,e)}function Fa(t,e,s){const r=Pe.get(t);if(r!==void 0){s(r);return}let i=Ne.get(t);i||(i=Ut(e).then(a=>(Pe.set(t,a),Ne.delete(t),a)).catch(()=>(Ne.delete(t),Promise.reject(new Error("group probe failed")))),Ne.set(t,i)),i.then(s,()=>s(!1))}function ht(t){const e=t,s=Array.isArray(e.items)?e.items:[];return{items:s,hasMore:e.hasMore??s.length===Be,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Ra(t,e,s,r,i){let a=0;for(const o of t)e.has(o.id)||Kt(o,s,r,i)&&a++;return a}function Oa(t,e,s,r){const i=M.c(8),{org:a}=ne(),o=Ca(a.id,t,e,s);let c;i[0]!==s?(c=Pa(s),i[0]=s,i[1]=c):c=i[1];const u=c,[l,d]=B.useState({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});l.identity!==o&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});const m=Je(),{threads:f,hasMore:h}=Qe(),j=He(f,t,e,s),k=Ma(j,h),v=$a(j,h),x=Ie();if(l.identity===o&&l.serverHasMore===null){const N=v??mt(o);N!==void 0&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:l.probeSubscribedIdentity,serverHasMore:N})}!u&&l.identity===o&&l.serverHasMore===null&&v===null&&mt(o)===void 0&&l.probeSubscribedIdentity!==o&&(d(N=>N.identity===o?{...N,isProbing:!0,probeSubscribedIdentity:o}:N),Fa(o,async()=>{const N=ut(t,e,0,s,1),T=await x.call("COLLECTION_THREADS_LIST",N),{totalCount:_}=ht(T),w=He(m.threads.get(),t,e,s);return _===void 0?!1:ft(w,_)},N=>{d(T=>T.identity!==o?T:{...T,isProbing:!1,serverHasMore:N})}));const b=async function(){if(l.isFetching||l.isProbing||u)return;const T=o;d(_=>_.identity===T?{..._,isFetching:!0}:_);try{const _=He(f,t,e,s),w=ut(t,e,_,s,Be),I=await Ut(()=>x.call("COLLECTION_THREADS_LIST",w)),{items:P,hasMore:L,totalCount:$}=ht(I),E=new Set(f.map(Ba)),F=Ra(P,E,t,e,s),R=_;m.mergeThreads(P),d(A=>{if(A.identity!==T)return A;let C;return $!==void 0?C=ft(R+F,$):C=P.length===0||F===0?!1:L,Ea(T,C),{...A,isFetching:!1,serverHasMore:C}})}catch(_){const w=_,I=w instanceof Error?w.message:String(w);Xt.error(`Could not load more tasks: ${I}`),d(P=>P.identity===T?{...P,isFetching:!1}:P)}},y=l.isFetching||l.isProbing,p=!u&&!y&&La(k,l.serverHasMore);let S;return i[2]!==y||i[3]!==b||i[4]!==p||i[5]!==l.isProbing||i[6]!==l.serverHasMore?(S={hasMore:p,isFetching:y,isProbing:l.isProbing,serverHasMore:l.serverHasMore,loadMore:b},i[2]=y,i[3]=b,i[4]=p,i[5]=l.isProbing,i[6]=l.serverHasMore,i[7]=S):S=i[7],S}function Ba(t){return t.id}function Da(t){const e=M.c(20),{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u}=t,{isFetching:l,isProbing:d,loadMore:m,hasMore:f,serverHasMore:h}=Oa("status",s,u),[j,k]=B.useState(!1);!j&&r.length===0&&h===!0&&!l&&!d&&(k(!0),queueMicrotask(()=>{m()}));let v;if(e[0]!==i||e[1]!==c||e[2]!==u||e[3]!==o||e[4]!==a||e[5]!==r){let b;e[7]!==i||e[8]!==c||e[9]!==u||e[10]!==o||e[11]!==a?(b=y=>n.jsx(zt,{task:y,isActive:i===y.id,onClick:()=>a(y),onArchive:c&&y.created_by===u.currentUserId?()=>o(y):void 0,showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},y.id),e[7]=i,e[8]=c,e[9]=u,e[10]=o,e[11]=a,e[12]=b):b=e[12],v=r.map(b),e[0]=i,e[1]=c,e[2]=u,e[3]=o,e[4]=a,e[5]=r,e[6]=v}else v=e[6];let x;e[13]!==f||e[14]!==l||e[15]!==m?(x=(f||l)&&n.jsx(Gt,{onClick:()=>{m()},isFetching:l,indented:!0}),e[13]=f,e[14]=l,e[15]=m,e[16]=x):x=e[16];let g;return e[17]!==v||e[18]!==x?(g=n.jsxs(n.Fragment,{children:[v,x]}),e[17]=v,e[18]=x,e[19]=g):g=e[19],g}function za(t){const e=M.c(43),{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u}=t,l=K(),d=kn[s],m=d.icon,[f,h]=wa(`status-${s}`,!1);let j;e[0]!==f||e[1]!==h?(j=function(){h(!f)},e[0]=f,e[1]=h,e[2]=j):j=e[2];const k=j;let v;e[3]!==d.labelKey||e[4]!==l?(v=l("sidebar.taskGroupsList.toggleStatusGroup",{status:l(d.labelKey)}),e[3]=d.labelKey,e[4]=l,e[5]=v):v=e[5];let x;e[6]!==k?(x=I=>{I.target===I.currentTarget&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),k())},e[6]=k,e[7]=x):x=e[7];let g;e[8]!==m||e[9]!==d.iconClassName?(g=n.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:n.jsx(m,{size:12,className:d.iconClassName})}),e[8]=m,e[9]=d.iconClassName,e[10]=g):g=e[10];let b;e[11]!==f?(b=n.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:f?n.jsx(Ye,{size:14}):n.jsx(es,{size:14})}),e[11]=f,e[12]=b):b=e[12];let y;e[13]!==g||e[14]!==b?(y=n.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[g,b]}),e[13]=g,e[14]=b,e[15]=y):y=e[15];let p;e[16]!==d.labelKey||e[17]!==l?(p=l(d.labelKey),e[16]=d.labelKey,e[17]=l,e[18]=p):p=e[18];let S;e[19]!==p?(S=n.jsx("span",{className:"flex-1 truncate",children:p}),e[19]=p,e[20]=S):S=e[20];let N;e[21]!==r.length?(N=n.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:n.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[21]=r.length,e[22]=N):N=e[22];let T;e[23]!==f||e[24]!==k||e[25]!==v||e[26]!==x||e[27]!==y||e[28]!==S||e[29]!==N?(T=n.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":f,"aria-label":v,onClick:k,onKeyDown:x,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-lg text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[y,S,N]}),e[23]=f,e[24]=k,e[25]=v,e[26]=x,e[27]=y,e[28]=S,e[29]=N,e[30]=T):T=e[30];let _;e[31]!==i||e[32]!==c||e[33]!==f||e[34]!==u||e[35]!==o||e[36]!==a||e[37]!==s||e[38]!==r?(_=f&&n.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:n.jsx(Da,{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u})}),e[31]=i,e[32]=c,e[33]=f,e[34]=u,e[35]=o,e[36]=a,e[37]=s,e[38]=r,e[39]=_):_=e[39];let w;return e[40]!==T||e[41]!==_?(w=n.jsxs("div",{className:"flex flex-col gap-0.5",children:[T,_]}),e[40]=T,e[41]=_,e[42]=w):w=e[42],w}function Ga(t){const e=M.c(41),{threads:s,groupBy:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,filters:c,hasMore:u,isFetchingMore:l,onLoadMore:d,filtersActive:m}=t,f=K();if(s.length===0&&!u&&!l){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(hs,{className:"size-6 opacity-60"}),e[0]=x):x=e[0];let g;e[1]!==m||e[2]!==f?(g=f(m?"sidebar.myThreadsSection.noChatsMatchFilters":"sidebar.myThreadsSection.noChatsYet"),e[1]=m,e[2]=f,e[3]=g):g=e[3];let b;return e[4]!==g?(b=n.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[x,n.jsx("p",{className:"text-sm",children:g})]}),e[4]=g,e[5]=b):b=e[5],b}const h=s.length>1||u;if(r==="status"){let x;if(e[6]!==i||e[7]!==h||e[8]!==c||e[9]!==o||e[10]!==a||e[11]!==s){let b;e[13]!==i||e[14]!==h||e[15]!==c||e[16]!==o||e[17]!==a?(b=y=>n.jsx(za,{status:y.status,threads:y.threads,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:h,filters:c},y.status),e[13]=i,e[14]=h,e[15]=c,e[16]=o,e[17]=a,e[18]=b):b=e[18],x=Na(s).map(b),e[6]=i,e[7]=h,e[8]=c,e[9]=o,e[10]=a,e[11]=s,e[12]=x}else x=e[12];let g;return e[19]!==x?(g=n.jsx(n.Fragment,{children:x}),e[19]=x,e[20]=g):g=e[20],g}let j;if(e[21]!==i||e[22]!==h||e[23]!==c||e[24]!==o||e[25]!==a||e[26]!==s){let x;e[28]!==i||e[29]!==h||e[30]!==c||e[31]!==o||e[32]!==a?(x=g=>n.jsx(zt,{task:g,isActive:i===g.id,onClick:()=>a(g),onArchive:h&&g.created_by===c.currentUserId?()=>o(g):void 0,showAutomationBadge:!!g.trigger_id,showAgentIcon:!0},g.id),e[28]=i,e[29]=h,e[30]=c,e[31]=o,e[32]=a,e[33]=x):x=e[33],j=s.map(x),e[21]=i,e[22]=h,e[23]=c,e[24]=o,e[25]=a,e[26]=s,e[27]=j}else j=e[27];let k;e[34]!==u||e[35]!==l||e[36]!==d?(k=(u||l)&&n.jsx(Gt,{onClick:d,isFetching:l}),e[34]=u,e[35]=l,e[36]=d,e[37]=k):k=e[37];let v;return e[38]!==j||e[39]!==k?(v=n.jsxs(n.Fragment,{children:[j,k]}),e[38]=j,e[39]=k,e[40]=v):v=e[40],v}function Ha(t){const e=M.c(11),{panel:s}=t;let r;return e[0]!==s.activeTaskId||e[1]!==s.archiveTask||e[2]!==s.filters||e[3]!==s.filtersActive||e[4]!==s.groupBy||e[5]!==s.hasMore||e[6]!==s.isFetchingMore||e[7]!==s.loadMore||e[8]!==s.selectTask||e[9]!==s.threads?(r=n.jsx(Ga,{threads:s.threads,groupBy:s.groupBy,activeTaskId:s.activeTaskId,onSelectTask:s.selectTask,onArchiveTask:s.archiveTask,filters:s.filters,hasMore:s.hasMore,isFetchingMore:s.isFetchingMore,onLoadMore:s.loadMore,filtersActive:s.filtersActive}),e[0]=s.activeTaskId,e[1]=s.archiveTask,e[2]=s.filters,e[3]=s.filtersActive,e[4]=s.groupBy,e[5]=s.hasMore,e[6]=s.isFetchingMore,e[7]=s.loadMore,e[8]=s.selectTask,e[9]=s.threads,e[10]=r):r=e[10],r}function Ua(t){const e=M.c(67);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{onNavigate:r}=s,{data:i}=pe.useSession(),a=i?.user?.id,{org:o}=ne();let c;e[2]!==o.id?(c=je(o.id),e[2]=o.id,e[3]=c):c=e[3];const u=c.id,l=ba(),d=St(),{threads:m,hasMore:f,isFetchingMore:h,fetchNextPage:j}=Qe(),k=m.filter(Wa),{hide:v,setScope:x}=Xe(),g=Me(),{setTaskId:b,createNewTask:y}=Ze(),p=Et(),S=et();let N;e[4]!==S||e[5]!==m||e[6]!==p?(N=fn({routeAgentId:p,threadVirtualMcpId:m.find(U=>U.id===S)?.virtual_mcp_id}),e[4]=S,e[5]=m,e[6]=p,e[7]=N):N=e[7];const T=N;let _;e[8]!==r?(_=()=>{r?.()},e[8]=r,e[9]=_):_=e[9];const w=_,I=[...k].sort(qa),[P,L]=B.useState("all"),[$,E]=B.useState("flat"),[F,R]=xt("sidebar-threads-scope-all",!1),[A,C]=B.useState(!1),[G,z]=B.useState(!1);let H;e[10]!==C?(H=()=>{he("tasks_panel_search_opened"),z(!0),C(!0)},e[10]=C,e[11]=H):H=e[11];const O=H,V=a??null;let Z;e[12]!==V||e[13]!==P?(Z={type:P,member:"mine",currentUserId:V},e[12]=V,e[13]=P,e[14]=Z):Z=e[14];const Y=Z,J={};F||(J.created_by="me"),x(J);let q;e[15]!==a?(q=U=>a?U.filter(ue=>ue.created_by===a):[],e[15]=a,e[16]=q):q=e[16];const le=q;let D;e[17]!==P?(D=U=>P==="automation"?U.filter(Va):P==="manual"?U.filter(Ka):U,e[17]=P,e[18]=D):D=e[18];const re=D,Q=ga(re(F?I:le(I)),S);let X;e[19]!==S||e[20]!==w||e[21]!==a||e[22]!==v||e[23]!==g||e[24]!==o.slug||e[25]!==b||e[26]!==Q?(X=U=>{if(a&&U.created_by&&U.created_by!==a)return;const ue=U.id===S;if(v(U.id),Hs(U.id),!ue)return;const ge=Sa(Q,U.id,a);w(),ge?b(ge.id,ge.virtual_mcp_id):g({to:"/$org",params:{org:o.slug}})},e[19]=S,e[20]=w,e[21]=a,e[22]=v,e[23]=g,e[24]=o.slug,e[25]=b,e[26]=Q,e[27]=X):X=e[27];const te=X;let ae;e[28]!==w||e[29]!==b?(ae=U=>{w(),b(U.id,U.virtual_mcp_id)},e[28]=w,e[29]=b,e[30]=ae):ae=e[30];const ie=ae;let se;e[31]!==T||e[32]!==S||e[33]!==m||e[34]!==w||e[35]!==y||e[36]!==a||e[37]!==u||e[38]!==l||e[39]!==d||e[40]!==b?(se=()=>{const U=T??u;he("sidebar_new_thread_clicked",{virtual_mcp_id:U}),w();const ue=nn(m,U,a,l(U));if(ue){b(ue.id,ue.virtual_mcp_id);return}const ge=d?null:m.find(Vt=>Vt.id===S)?.branch??null;y(U,ge)},e[31]=T,e[32]=S,e[33]=m,e[34]=w,e[35]=y,e[36]=a,e[37]=u,e[38]=l,e[39]=d,e[40]=b,e[41]=se):se=e[41];const oe=se;let ce;e[42]!==j?(ce=()=>{j()},e[42]=j,e[43]=ce):ce=e[43];const xe=$!=="flat"||P!=="all"||F;let de;e[44]!==G||e[45]!==A||e[46]!==C?(de=G?n.jsx(ja,{open:A,onOpenChange:C}):null,e[44]=G,e[45]=A,e[46]=C,e[47]=de):de=e[47];let Te;return e[48]!==S||e[49]!==te||e[50]!==Y||e[51]!==$||e[52]!==f||e[53]!==h||e[54]!==oe||e[55]!==O||e[56]!==ie||e[57]!==E||e[58]!==R||e[59]!==L||e[60]!==F||e[61]!==ce||e[62]!==xe||e[63]!==de||e[64]!==P||e[65]!==Q?(Te={threads:Q,activeTaskId:S,filters:Y,hasMore:f,isFetchingMore:h,loadMore:ce,groupBy:$,setGroupBy:E,typeFilter:P,setTypeFilter:L,showAll:F,setShowAll:R,filtersActive:xe,selectTask:ie,archiveTask:te,newThread:oe,openSearch:O,searchDialog:de},e[48]=S,e[49]=te,e[50]=Y,e[51]=$,e[52]=f,e[53]=h,e[54]=oe,e[55]=O,e[56]=ie,e[57]=E,e[58]=R,e[59]=L,e[60]=F,e[61]=ce,e[62]=xe,e[63]=de,e[64]=P,e[65]=Q,e[66]=Te):Te=e[66],Te}function Ka(t){return!t.trigger_id}function Va(t){return!!t.trigger_id}function qa(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Wa(t){return!t.hidden}function Ya(){const t=M.c(59),e=K(),[s,r]=B.useState(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={onNavigate:()=>r(!1)},t[0]=i):i=t[0];const a=Ua(i),o=$e()?.activeTask;let c;t[1]!==o?.title||t[2]!==a.activeTaskId||t[3]!==a.threads||t[4]!==e?(c=o?.title||a.threads.find(A=>A.id===a.activeTaskId)?.title||e("tasksPanel.taskRow.untitledTask"),t[1]=o?.title,t[2]=a.activeTaskId,t[3]=a.threads,t[4]=e,t[5]=c):c=t[5];const u=c;let l;t[6]!==a?(l=()=>{r(!1),a.openSearch()},t[6]=a,t[7]=l):l=t[7];const d=l;let m;t[8]!==e?(m=e("chat.threadsMenu.chats"),t[8]=e,t[9]=m):m=t[9];const f=s&&"bg-sidebar-accent";let h;t[10]!==f?(h=ee("flex h-[34px] min-w-0 shrink items-center gap-1.5 rounded-lg px-2 text-sm text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",f),t[10]=f,t[11]=h):h=t[11];let j;t[12]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ps,{size:16,className:"shrink-0"}),t[12]=j):j=t[12];let k;t[13]!==u?(k=n.jsx("span",{className:"truncate max-w-[10rem] font-medium",children:u}),t[13]=u,t[14]=k):k=t[14];let v;t[15]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ye,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[15]=v):v=t[15];let x;t[16]!==m||t[17]!==h||t[18]!==k?(x=n.jsx(Fe,{asChild:!0,children:n.jsx(Mt,{asChild:!0,children:n.jsxs("button",{type:"button","aria-label":m,className:h,children:[j,k,v]})})}),t[16]=m,t[17]=h,t[18]=k,t[19]=x):x=t[19];let g;t[20]!==e?(g=e("chat.threadsMenu.chats"),t[20]=e,t[21]=g):g=t[21];let b;t[22]!==g?(b=n.jsx(Re,{side:"bottom",children:g}),t[22]=g,t[23]=b):b=t[23];let y;t[24]!==b||t[25]!==x?(y=n.jsxs(Oe,{children:[x,b]}),t[24]=b,t[25]=x,t[26]=y):y=t[26];let p;t[27]!==a?(p=n.jsx(xa,{panel:a,className:"size-8"}),t[27]=a,t[28]=p):p=t[28];let S;t[29]!==e?(S=e("sidebar.taskGroupsList.searchChats"),t[29]=e,t[30]=S):S=t[30];let N;t[31]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(xs,{size:16}),t[31]=N):N=t[31];let T;t[32]!==d||t[33]!==S?(T=n.jsx(we,{"aria-label":S,onClick:d,className:"size-8",children:N}),t[32]=d,t[33]=S,t[34]=T):T=t[34];let _;t[35]!==e?(_=e("sidebar.taskGroupsList.newChat"),t[35]=e,t[36]=_):_=t[36];let w;t[37]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(bt,{size:16}),t[37]=w):w=t[37];let I;t[38]!==a.newThread||t[39]!==_?(I=n.jsx(we,{"aria-label":_,onClick:a.newThread,className:"size-8",children:w}),t[38]=a.newThread,t[39]=_,t[40]=I):I=t[40];let P;t[41]!==T||t[42]!==I?(P=n.jsxs("div",{className:"flex items-center gap-0.5",children:[T,I]}),t[41]=T,t[42]=I,t[43]=P):P=t[43];let L;t[44]!==p||t[45]!==P?(L=n.jsxs("div",{className:"flex shrink-0 items-center justify-between",children:[p,P]}),t[44]=p,t[45]=P,t[46]=L):L=t[46];let $;t[47]!==a?($=n.jsx("div",{className:"flex max-h-[60vh] min-h-0 flex-col gap-0.5 overflow-y-auto overscroll-contain",children:n.jsx(Ha,{panel:a})}),t[47]=a,t[48]=$):$=t[48];let E;t[49]!==L||t[50]!==$?(E=n.jsxs(Lt,{align:"start",side:"bottom",onOpenAutoFocus:Za,className:"flex w-80 flex-col gap-2 p-2",children:[L,$]}),t[49]=L,t[50]=$,t[51]=E):E=t[51];let F;t[52]!==s||t[53]!==y||t[54]!==E?(F=n.jsxs($t,{open:s,onOpenChange:r,children:[y,E]}),t[52]=s,t[53]=y,t[54]=E,t[55]=F):F=t[55];let R;return t[56]!==a.searchDialog||t[57]!==F?(R=n.jsxs(n.Fragment,{children:[F,a.searchDialog]}),t[56]=a.searchDialog,t[57]=F,t[58]=R):R=t[58],R}function Za(t){return t.preventDefault()}function Ja(){const t=M.c(20),e=K(),{threads:s}=Qe(),{createNewTask:r}=Ze(),i=Ft(),a=et();let o;t[0]!==a||t[1]!==s?(o=s.find(v=>v.id===a)?.branch??null,t[0]=a,t[1]=s,t[2]=o):o=t[2];const c=o;let u;t[3]!==i||t[4]!==r||t[5]!==c?(u=()=>{r(i,c)},t[3]=i,t[4]=r,t[5]=c,t[6]=u):u=t[6];const l=u;let d;t[7]!==e?(d=e("sidebar.taskGroupsList.newChat"),t[7]=e,t[8]=d):d=t[8];let m;t[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(bt,{size:16}),t[9]=m):m=t[9];let f;t[10]!==l||t[11]!==d?(f=n.jsx(Fe,{asChild:!0,children:n.jsx("button",{type:"button",onClick:l,"aria-label":d,className:"flex shrink-0 items-center rounded-lg p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:m})}),t[10]=l,t[11]=d,t[12]=f):f=t[12];let h;t[13]!==e?(h=e("sidebar.taskGroupsList.newChat"),t[13]=e,t[14]=h):h=t[14];let j;t[15]!==h?(j=n.jsx(Re,{side:"bottom",children:h}),t[15]=h,t[16]=j):j=t[16];let k;return t[17]!==f||t[18]!==j?(k=n.jsxs(Oe,{children:[f,j]}),t[17]=f,t[18]=j,t[19]=k):k=t[19],k}function Qa(t){const e=M.c(18),{virtualMcp:s}=t,r=K(),i=Tt(),{navigateToTask:a}=Nn(),{create:o}=Xe(),c=ts(),{org:u}=ne();let l,d;if(e[0]!==i||e[1]!==o||e[2]!==a||e[3]!==u||e[4]!==c||e[5]!==r||e[6]!==s){d=Symbol.for("react.early_return_sentinel");e:{const m=Ws(s,i);if(!m){d=null;break e}const f=m.mode==="dev";let h;e[9]!==o||e[10]!==a||e[11]!==u||e[12]!==c?(h=async b=>{const y=crypto.randomUUID();await Promise.all([o({id:y,virtual_mcp_id:b}).catch(er),Rs(c,u,b).catch(Xa)]),a(y,{virtualMcpId:b})},e[9]=o,e[10]=a,e[11]=u,e[12]=c,e[13]=h):h=e[13];const j=h,k=(b,y,p)=>n.jsxs("button",{type:"button","aria-pressed":y,"aria-label":b,title:b,onClick:()=>{y||j(m.targetId)},className:ee("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg transition-colors",y?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[n.jsx(p,{className:"size-3.5 shrink-0"}),n.jsx("span",{className:"@max-3xl/panel-header:hidden",children:b})]});let v;e[14]!==r?(v=r("devAgent.devAgentControl.develop"),e[14]=r,e[15]=v):v=e[15];const x=k(v,f,gs);let g;e[16]!==r?(g=r("devAgent.devAgentControl.live"),e[16]=r,e[17]=g):g=e[17],l=n.jsxs("div",{className:"inline-flex items-center rounded-lg border border-border bg-muted p-0.5 text-xs font-medium",children:[x,k(g,!f,bs)]})}e[0]=i,e[1]=o,e[2]=a,e[3]=u,e[4]=c,e[5]=r,e[6]=s,e[7]=l,e[8]=d}else l=e[7],d=e[8];return d!==Symbol.for("react.early_return_sentinel")?d:l}function Xa(){}function er(){}function tr(t){const e=M.c(16),{virtualMcpId:s,taskId:r}=t,{openPanel:i}=Ot();let a;e[0]!==r||e[1]!==s?(a={virtualMcpId:s,taskId:r},e[0]=r,e[1]=s,e[2]=a):a=e[2];const{tabs:o,activeTab:c,mainOpen:u}=Bt(a);if(o.length===0)return null;let l;if(e[3]!==c||e[4]!==u||e[5]!==i||e[6]!==o||e[7]!==s){let m;e[9]!==c||e[10]!==u||e[11]!==i||e[12]!==s?(m=f=>{const h=f.id==="automations"?ss({activeTab:c,mainOpen:u}):u&&f.id===c;return n.jsxs(st.Tab,{active:h,onClick:()=>{h||(he("main_panel_tab_clicked",{virtual_mcp_id:s,tab_id:f.id,tab_kind:f.kind,was_active:!1}),i(f.id))},children:[n.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(Ce,{icon:f.icon})}),f.title]},f.id)},e[9]=c,e[10]=u,e[11]=i,e[12]=s,e[13]=m):m=e[13],l=o.map(m),e[3]=c,e[4]=u,e[5]=i,e[6]=o,e[7]=s,e[8]=l}else l=e[8];let d;return e[14]!==l?(d=n.jsx(st.Tabs,{"data-tour":Us.surfaceTabs,children:l}),e[14]=l,e[15]=d):d=e[15],d}function sr(t){return{threadId:t.routeThreadId,providerKey:t.routeThreadId??t.fallbackKey}}const Ue="__mobile-main-panel-tab-select__",Ve="main";function nr({tabs:t,activeTab:e,mainOpen:s,t:r}){const i=t.find(o=>o.id===e),a=r("mainPanelTabs.mobileMainPanelTabSelect.mainView");return s?i?.title??a:i?.title??t[0]?.title??a}const ar={kind:"component",Component:vs},rr={kind:"component",Component:ys},ir={kind:"component",Component:js},lr={kind:"component",Component:wn};function or({tabs:t,overlayEnabled:e,t:s}){return[{value:"chat",title:s("mainPanelTabs.mobileMainPanelTabSelect.chat"),icon:ar},...t.length>0?t.map(r=>({value:r.id,title:r.title,icon:r.icon})):[{value:Ve,title:s("mainPanelTabs.mobileMainPanelTabSelect.mainView"),icon:lr}],...e?[{value:"board",title:s("mainPanelTabs.mobileMainPanelTabSelect.tasks"),icon:rr},{value:"files",title:s("mainPanelTabs.mobileMainPanelTabSelect.library"),icon:ir}]:[]]}function cr(t){const e=M.c(53),{virtualMcpId:s,taskId:r}=t,i=K(),a=Me(),{openPanel:o}=Ot();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[0]=c):c=e[0];const u=ke(c);let l;e[1]!==r||e[2]!==s?(l={virtualMcpId:s,taskId:r},e[1]=r,e[2]=s,e[3]=l):l=e[3];const{tabs:d,activeTab:m,mainOpen:f}=Bt(l),{org:h}=ne(),j=Es();let k;e[4]!==h.id?(k=nt(h.id),e[4]=h.id,e[5]=k):k=e[5];const v=s===k;let x,g,b,y,p,S,N,T,_,w;if(e[6]!==m||e[7]!==f||e[8]!==a||e[9]!==v||e[10]!==o||e[11]!==h.id||e[12]!==u.org||e[13]!==u.taskId||e[14]!==j||e[15]!==i||e[16]!==d||e[17]!==s){y=Symbol.for("react.early_return_sentinel");e:{const L=or({tabs:d,overlayEnabled:!!(u.org&&u.taskId),t:i}),$=f?L.find(O=>O.value===m)?.value??Ve:"chat",E=L.find(O=>O.value===$),F=E?.title??nr({tabs:d,activeTab:m,mainOpen:f,t:i});let R;e[28]!==a?(R=O=>{a({to:".",search:V=>({...V,...Ys(O)}),replace:!0})},e[28]=a,e[29]=R):R=e[29];const A=R;let C;e[30]!==v||e[31]!==o||e[32]!==h.id||e[33]!==j||e[34]!==A||e[35]!==s?(C=O=>{if(O!==Ue){if(he("main_panel_tab_clicked",{virtual_mcp_id:s,tab_id:O,source:"mobile_select"}),Ks({reportsOnly:j,onReportAgent:v,tabId:O})){o(O,{virtualmcpid:nt(h.id),search:fr});return}if(O==="chat"||O===Ve){A(O==="chat"?"chat":"main");return}o(O,{search:ur})}},e[30]=v,e[31]=o,e[32]=h.id,e[33]=j,e[34]=A,e[35]=s,e[36]=C):C=e[36];const G=C,z=L.find(O=>O.value!==$);if(L.length===2&&z){y=n.jsxs("button",{type:"button",onClick:()=>G(z.value),"aria-label":i("mainPanelTabs.mobileMainPanelTabSelect.switchTo",{name:z.title}),className:"flex h-10 min-w-0 max-w-[7.5rem] items-center gap-1.5 rounded-lg px-1.5 text-xs text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(Ce,{icon:z.icon,className:"size-5"})}),n.jsx("span",{className:"min-w-0 truncate",children:z.title})]});break e}g=Pn,_=Ue,w=G;let H;e[37]!==i?(H=i("mainPanelTabs.mobileMainPanelTabSelect.view"),e[37]=i,e[38]=H):H=e[38],b=n.jsx(Cn,{"aria-label":H,className:"h-10! w-full min-w-0 max-w-[7.5rem] rounded-lg border-0 bg-transparent px-1.5 text-xs shadow-none [--card-shadow:none]",children:n.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[E&&n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(Ce,{icon:E.icon,className:"size-5"})}),n.jsx("span",{className:"min-w-0 truncate",children:F})]})}),x=In,p="end",S="w-56",e[39]!==F?(N=n.jsx(Dt,{value:Ue,disabled:!0,hideCheck:!0,className:"hidden",children:F}),e[39]=F,e[40]=N):N=e[40],T=L.map(dr)}e[6]=m,e[7]=f,e[8]=a,e[9]=v,e[10]=o,e[11]=h.id,e[12]=u.org,e[13]=u.taskId,e[14]=j,e[15]=i,e[16]=d,e[17]=s,e[18]=x,e[19]=g,e[20]=b,e[21]=y,e[22]=p,e[23]=S,e[24]=N,e[25]=T,e[26]=_,e[27]=w}else x=e[18],g=e[19],b=e[20],y=e[21],p=e[22],S=e[23],N=e[24],T=e[25],_=e[26],w=e[27];if(y!==Symbol.for("react.early_return_sentinel"))return y;let I;e[41]!==x||e[42]!==p||e[43]!==S||e[44]!==N||e[45]!==T?(I=n.jsxs(x,{align:p,className:S,children:[N,T]}),e[41]=x,e[42]=p,e[43]=S,e[44]=N,e[45]=T,e[46]=I):I=e[46];let P;return e[47]!==g||e[48]!==b||e[49]!==I||e[50]!==_||e[51]!==w?(P=n.jsxs(g,{value:_,onValueChange:w,children:[b,I]}),e[47]=g,e[48]=b,e[49]=I,e[50]=_,e[51]=w,e[52]=P):P=e[52],P}function dr(t){return n.jsx(Dt,{value:t.value,children:n.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(Ce,{icon:t.icon})}),n.jsx("span",{className:"min-w-0 truncate",children:t.title})]})},t.value)}function ur(t){return{...t,sidepanel:!1}}function fr(t){return{...t,thread:void 0,sidepanel:!1}}function mr(t,e,s){const r=M.c(33),i=Je(),{locator:a}=ne(),o=B.useSyncExternalStore(i.threads.subscribe,i.threads.get),c=B.useSyncExternalStore(i.threadsStatus.subscribe,i.threadsStatus.get);let u;r[0]!==t||r[1]!==o?(u=t===null?null:o.find(p=>p.id===t&&!p.partial)??null,r[0]=t,r[1]=o,r[2]=u):u=r[2];const l=u,[d,m]=B.useState(void 0),[f,h]=B.useState(t);f!==t&&(h(t),m(void 0));let j,k;r[3]!==d||r[4]!==t||r[5]!==l||r[6]!==i||r[7]!==c.kind?(j=()=>{t!==null&&(l||c.kind!=="loading"&&d===void 0&&(m("pending"),i.fetchThreadIntoSlot(t).then(p=>{m(p)})))},k=[t,l,c.kind,d,i],r[3]=d,r[4]=t,r[5]=l,r[6]=i,r[7]=c.kind,r[8]=j,r[9]=k):(j=r[8],k=r[9]),B.useEffect(j,k);let v;r[10]!==s||r[11]!==a||r[12]!==i||r[13]!==e?(v={mutationFn:async p=>i.create({id:p,virtual_mcp_id:e,...s?{branch:s}:{},...sn(sessionStorage,a,p)})},r[10]=s,r[11]=a,r[12]=i,r[13]=e,r[14]=v):v=r[14];const x=ns(v);let g,b;if(r[15]!==x||r[16]!==d||r[17]!==t||r[18]!==l||r[19]!==c.kind?(g=()=>{t!==null&&(l||d===null&&c.kind!=="loading"&&(x.isPending||x.variables!==t&&x.mutate(t)))},b=[t,l,d,c.kind,x],r[15]=x,r[16]=d,r[17]=t,r[18]=l,r[19]=c.kind,r[20]=g,r[21]=b):(g=r[20],b=r[21]),B.useEffect(g,b),t===null){let p;return r[22]===Symbol.for("react.memo_cache_sentinel")?(p={status:"ready",task:null},r[22]=p):p=r[22],p}if(l){let p;return r[23]!==l?(p={status:"ready",task:l},r[23]=l,r[24]=p):p=r[24],p}if(d&&typeof d=="object"){let p;return r[25]!==d?(p={status:"ready",task:d},r[25]=d,r[26]=p):p=r[26],p}if(x.data){let p;return r[27]!==x.data?(p={status:"ready",task:x.data},r[27]=x.data,r[28]=p):p=r[28],p}if(x.isError){let p;return r[29]!==x.error?(p={status:"error",error:x.error},r[29]=x.error,r[30]=p):p=r[30],p}if(x.isPending||c.kind!=="loading"){let p;return r[31]===Symbol.for("react.memo_cache_sentinel")?(p={status:"creating"},r[31]=p):p=r[31],p}let y;return r[32]===Symbol.for("react.memo_cache_sentinel")?(y={status:"loading"},r[32]=y):y=r[32],y}const hr=50;function pr(t,e){const s=M.c(15),{org:r}=ne(),i=Ie(),{data:a}=pe.useSession(),o=a?.user?.id??"";let c;s[0]!==r.id||s[1]!==o||s[2]!==t?(c=fe.agentEntryThreads(r.id,o,t),s[0]=r.id,s[1]=o,s[2]=t,s[3]=c):c=s[3];const u=e&&!!o;let l;s[4]!==i||s[5]!==t?(l=async()=>{try{return(await i.call("COLLECTION_THREADS_LIST",{limit:hr,offset:0,orderBy:[{field:["updated_at"],direction:"desc"}],where:{hidden:!1,created_by:"me",virtual_mcp_id:t}})).items}catch{return[]}},s[4]=i,s[5]=t,s[6]=l):l=s[6];let d;s[7]!==c||s[8]!==u||s[9]!==l?(d={queryKey:c,enabled:u,staleTime:0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,queryFn:l},s[7]=c,s[8]=u,s[9]=l,s[10]=d):d=s[10];const m=me(d);if(!e||!o){let h;return s[11]===Symbol.for("react.memo_cache_sentinel")?(h={status:"idle"},s[11]=h):h=s[11],h}if(!m.data||m.isFetching){let h;return s[12]===Symbol.for("react.memo_cache_sentinel")?(h={status:"loading"},s[12]=h):h=s[12],h}let f;return s[13]!==m.data?(f={status:"ready",threads:m.data},s[13]=m.data,s[14]=f):f=s[14],f}function xr(t){const e=M.c(13),{children:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const i=ke(r);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[1]=a):a=e[1];const o=Le(a);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={select:gr},e[2]=c):c=e[2];const u=as(c),{org:l}=ne();let d;e[3]!==l||e[4]!==i.agentId||e[5]!==i.legacyView||e[6]!==i.org||e[7]!==u||e[8]!==o?(d=i.org?rs({pathname:u,org:i.org,pathAgentId:i.agentId,pathLegacyView:i.legacyView,fallbackAgentId:je(l.id).id,search:o}):null,e[3]=l,e[4]=i.agentId,e[5]=i.legacyView,e[6]=i.org,e[7]=u,e[8]=o,e[9]=d):d=e[9];const m=d;let f;return e[10]!==s||e[11]!==m?(f=m?n.jsx(tt,{target:m}):s,e[10]=s,e[11]=m,e[12]=f):f=e[12],f}function gr(t){return t.matches.at(-1)?.pathname??t.location.pathname}function br(){const t=M.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=ke(e);let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[1]=r):r=t[1];const i=Le(r),{org:a}=ne(),{org:o,taskId:c}=s;if(!o||c===void 0)return null;let u;return t[2]!==o||t[3]!==a.id||t[4]!==i||t[5]!==c?(u=is({org:o,taskId:c,fallbackAgentId:je(a.id).id,search:i}),t[2]=o,t[3]=a.id,t[4]=i,t[5]=c,t[6]=u):u=t[6],u}function vr(){const t=M.c(2),e=br();let s;return t[0]!==e?(s=e?n.jsx(tt,{target:e}):null,t[0]=e,t[1]=s):s=t[1],s}function yr(){const t=M.c(6),e=Mn(),s=Me();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{preview:i}=Le(r);if(!e||!i)return null;let a;t[1]!==s?(a=()=>s({to:".",search:jr}),t[1]=s,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=n.jsx(Ln,{previewPath:i,onClose:a,showSeeInLibrary:!0}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function jr(t){const{preview:e,...s}=t;return s}function kr(t){const e=M.c(11),{children:s}=t,r=K();let i;e[0]!==r?(i=r("agentShellLayout.agentShellLayout.chatLoadingError"),e[0]=r,e[1]=i):i=e[1];let a;e[2]!==i?(a=n.jsx("div",{role:"alert",className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:i}),e[2]=i,e[3]=a):a=e[3];let o;e[4]!==s?(o=s??n.jsx(ma,{}),e[4]=s,e[5]=o):o=e[5];let c;e[6]!==o?(c=n.jsx(Ae,{children:o}),e[6]=o,e[7]=c):c=e[7];let u;return e[8]!==a||e[9]!==c?(u=n.jsx(pt,{fallback:a,children:c}),e[8]=a,e[9]=c,e[10]=u):u=e[10],u}function Sr(t){const e=M.c(5),{threadId:s,children:r}=t;if(s===null){let a;return e[0]!==r?(a=n.jsx(W.ThreadlessProvider,{children:r}),e[0]=r,e[1]=a):a=e[1],a}let i;return e[2]!==r||e[3]!==s?(i=n.jsx(W.ActiveTaskProvider,{taskId:s,children:r}),e[2]=r,e[3]=s,e[4]=i):i=e[4],i}function Tr(t){const e=M.c(3),{onNewTaskRef:s,createNewTask:r}=t;let i;return e[0]!==r||e[1]!==s?(i=()=>(s.current=r,()=>{s.current=null}),e[0]=r,e[1]=s,e[2]=i):i=e[2],B.useLayoutEffect(i),null}function Nr({virtualMcpId:t,hasActiveRepository:e,sandboxMap:s,children:r}){const i=K(),{currentBranch:a,activeTask:o,setCurrentTaskBranch:c}=Ee(),{data:u}=pe.useSession(),l=u?.user?.id,d=!Ms(o?.harness_id),m=rn({agentSandboxMap:s,threadSandboxMap:o?.metadata?.sandboxMap,userId:l,ownerId:o?.created_by,branch:a}),f=e||Js(o?.metadata),h=B.useRef(null),j=d&&ln({threadLoaded:!!o,isOwner:!!l&&o?.created_by===l,hasActiveRepository:f,branch:a??null,attempted:h.current===(o?.id??null)});B.useEffect(()=>{!j||!o||(h.current=o.id,c(Ct(u?.user?.name||u?.user?.email?.split("@")[0])))},[j,o,u,c]);const k=yt(t),v=Se(t),x=It(v,a),{releases:g,createRelease:b}=Qs(t),p=!!l&&o?.created_by===l&&!!a&&a!==x&&!g.some(L=>L.branch===a),S=B.useRef(null);B.useEffect(()=>{!p||!a||S.current!==a&&(S.current=a,b({branch:a,name:en(g,i("thread.branchPicker.defaultVersionName")),color:Xs(g.length),createdBy:l,createdAt:new Date().toISOString()}).catch(()=>{}))},[p,a,g,b,l,i]);const N=k.resolved?k.runtime:null,T=on(t,a??void 0),w=(l&&a?En(m?.[l]?.[a]):{})["agent-sandbox"]??null,I=w?.previewUrl??null,P=d&&N!=="cms"&&(!!w||T);return d?N==="cms"?n.jsx(lt,{children:r},`${t}:${a??"no-branch"}:${o?.id??""}`):n.jsx(_s,{virtualMcpId:t,branch:a??null,previewUrl:I,enabled:P,children:n.jsx(cn,{executionEnabled:d,virtualMcpId:t,branch:a??null,userId:l??null,hasActiveRepository:f,vmEntry:w,threadId:o?.id??null,children:n.jsx(lt,{children:r},`${t}:${a??"no-branch"}:${o?.id??""}`)})},o?.id??"no-thread"):n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsx("div",{className:"flex h-full rounded-[0.75rem] bg-background card-shadow",children:n.jsx(At,{image:n.jsx(qe,{size:48,className:"text-muted-foreground"}),title:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWeb"),description:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWebDescription")})})})}function _r(){const t=M.c(16),e=K(),{toggleSidebar:s}=Ts(),{virtualMcpId:r,taskId:i}=Ee();let a;t[0]!==e?(a=e("layouts.shellControls.toggleSidebar"),t[0]=e,t[1]=a):a=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(ks,{size:16}),t[2]=o):o=t[2];let c;t[3]!==a||t[4]!==s?(c=n.jsx(we,{className:"md:hidden",onClick:s,"aria-label":a,children:o}),t[3]=a,t[4]=s,t[5]=c):c=t[5];let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Ya,{}),t[6]=u):u=t[6];let l;t[7]!==c?(l=n.jsxs(De.Topbar.Left,{children:[c,u]}),t[7]=c,t[8]=l):l=t[8];let d;t[9]!==i||t[10]!==r?(d=n.jsx("div",{className:"min-w-0 md:hidden",children:n.jsx(cr,{virtualMcpId:r,taskId:i})}),t[9]=i,t[10]=r,t[11]=d):d=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(De.Topbar.Right,{className:"shrink-0",children:n.jsx(Ja,{})}),t[12]=m):m=t[12];let f;return t[13]!==l||t[14]!==d?(f=n.jsxs(De.Topbar,{className:"border-b border-border/60 px-3",children:[l,d,m]}),t[13]=l,t[14]=d,t[15]=f):f=t[15],f}function wr(t){const e=M.c(25),{layout:s,onNewTaskRef:r,createNewTask:i}=t,{virtualMcpId:a,taskId:o}=Ee(),c=Se(a),u=_n()??"overview",l=Ss(),[d,m]=B.useState(null),f=d===u,h=l?f:s.threadOpen;let j;e[0]!==u||e[1]!==s||e[2]!==l||e[3]!==f?(j=l?()=>m(f?null:u):s.toggleThread,e[0]=u,e[1]=s,e[2]=l,e[3]=f,e[4]=j):j=e[4];const k=j;let v;e[5]!==i||e[6]!==r?(v=n.jsx(Tr,{onNewTaskRef:r,createNewTask:i}),e[5]=i,e[6]=r,e[7]=v):v=e[7];let x;e[8]!==o||e[9]!==a?(x=n.jsx(tr,{virtualMcpId:a,taskId:o}),e[8]=o,e[9]=a,e[10]=x):x=e[10];let g;e[11]!==c?(g=c&&n.jsx(Qa,{virtualMcp:c}),e[11]=c,e[12]=g):g=e[12];let b,y;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(it.Thread,{topbar:n.jsx(_r,{}),children:n.jsx(kr,{})}),y=n.jsx(gt,{}),e[13]=b,e[14]=y):(b=e[13],y=e[14]);let p;e[15]!==u||e[16]!==s||e[17]!==x||e[18]!==g||e[19]!==h||e[20]!==k?(p=n.jsxs(it,{...s,threadOpen:h,toggleThread:k,contentKey:u,contentNavigation:x,contentActions:g,children:[b,y]}),e[15]=u,e[16]=s,e[17]=x,e[18]=g,e[19]=h,e[20]=k,e[21]=p):p=e[21];let S;return e[22]!==v||e[23]!==p?(S=n.jsxs(n.Fragment,{children:[v,p]}),e[22]=v,e[23]=p,e[24]=S):S=e[24],S}function Cr(){const t=K(),e=Me(),s=mn(),{create:r}=Xe(),{org:i}=ne(),o=ke({strict:!1}).org??"",c=Le({strict:!1}),u=et(),l=Ft(),d=Et(),[m]=B.useState(()=>crypto.randomUUID()),{data:f}=pe.useSession(),[h]=B.useState(()=>Ct(f?.user?.name||f?.user?.email?.split("@")[0])),j=Je(),k=B.useSyncExternalStore(j.threads.subscribe,j.threads.get),v=B.useSyncExternalStore(j.threadsStatus.subscribe,j.threadsStatus.get),x=Se(l),g=!!(x&&_t(x)),b=It(x,null),y=u===null&&!!d&&!!x,p=A=>an(A,l,f?.user?.id,Pt(x?.metadata),g,{baseBranch:b}),S=y&&v.kind!=="loading"?p(k):void 0,N=pr(l,y&&v.kind!=="loading"&&!S),T=mr(u,l,h);ha(T.status==="ready"?T.task:null);const _=x?.metadata?.ui?.layout??null,w=_?{defaultMainView:_.defaultMainView??null,chatDefaultOpen:_.chatDefaultOpen??null}:null,I=Zs(w),{threadId:P,providerKey:L}=sr({routeThreadId:u,fallbackKey:m}),$=async()=>{const A=crypto.randomUUID(),C=k.find(G=>G.id===P)?.branch??null;try{await r({id:A,virtual_mcp_id:l,...C?{branch:C}:{}})}catch{}s(A,()=>({}))},E=B.useRef(null);B.useEffect(()=>{const A=C=>{Vs(C)&&C.shiftKey&&C.code==="KeyS"&&!C.repeat&&(C.preventDefault(),E.current?.())};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[]);const F=T.status==="ready"?T.task:null,R=F?.virtual_mcp_id;if(F&&R&&!hn({routeAgentId:l,threadAgentId:R})){const A=ls({org:o,agentId:R,superAgentId:je(i.id).id});return n.jsx(tt,{target:{route:A,search:{thread:F.id,sidepanel:c.sidepanel,mainpanel:c.mainpanel,autosend:c.autosend}}})}if(y){if(v.kind==="loading"||N.status==="loading")return n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsxs("div",{role:"status","aria-live":"polite",className:"flex h-full items-center justify-center bg-background card-shadow rounded-[0.75rem] text-sm text-muted-foreground",children:[n.jsx(ve,{className:"size-4 mr-2"}),t("agentShellLayout.agentShellLayout.creatingTask")]})});const C=(S??(N.status==="ready"?p(N.threads):void 0))?.id??(g?m:null);if(C)return n.jsx(os,{to:".",replace:!0,search:G=>({...G,thread:C})})}return T.status==="creating"||T.status==="loading"?n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsxs("div",{role:"status","aria-live":"polite",className:"flex h-full items-center justify-center bg-background card-shadow rounded-[0.75rem] text-sm text-muted-foreground",children:[n.jsx(ve,{className:"size-4 mr-2"}),t("agentShellLayout.agentShellLayout.creatingTask")]})}):T.status==="error"?n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsxs("div",{role:"alert",className:"flex flex-col h-full items-center justify-center gap-2 bg-background card-shadow rounded-[0.75rem] p-8 text-sm",children:[n.jsx("div",{className:"font-medium",children:t("agentShellLayout.agentShellLayout.taskUnavailable")}),n.jsx("div",{className:"text-muted-foreground",children:T.error.message})]})}):x?n.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:n.jsx(W.Provider,{virtualMcpId:l,task:T.status==="ready"?T.task:null,children:n.jsx(Is,{layout:I,children:n.jsx(Nr,{virtualMcpId:l,hasActiveRepository:g,sandboxMap:x.metadata?.sandboxMap,children:n.jsx(Sr,{threadId:P,children:n.jsx(Ae,{children:n.jsx(wr,{layout:I,onNewTaskRef:E,createNewTask:$})})},L)})})},l)}):n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(At,{image:n.jsx(qe,{size:48,className:"text-muted-foreground"}),title:t("agentShellLayout.agentShellLayout.agentNotFound"),description:t("agentShellLayout.agentShellLayout.agentNotFoundDescription",{virtualMcpId:l}),actions:n.jsx(cs,{variant:"outline",onClick:()=>e({to:"/$org",params:{org:o}}),children:t("agentShellLayout.agentShellLayout.goToOrgHome")})})})})}function Co(){const t=M.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=ke(e);if(s.taskId!==void 0){let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(vr,{}),t[1]=i):i=t[1],i}if(s._splat!==void 0){let i;return t[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(gt,{}),t[2]=i):i=t[2],i}let r;return t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ae,{children:n.jsx(xr,{children:n.jsx(An,{children:n.jsxs($n,{children:[n.jsx(Cr,{}),n.jsx(yr,{})]})})})}),t[3]=r):r=t[3],r}export{Co as default};
1
+ import{c as M,a2 as ne,a as pe,aa as Ie,K as fe,m as me,b as K,r as B,l as ee,j as n,h as ve,aJ as je,aI as Ae,H as pt,y as he,v as qt,aK as Wt,s as Yt,q as Zt,D as Jt,aL as Qt,a0 as xt,t as Xt,at as es,d as Me,o as ts,n as st,aM as ss,f as ke,M as nt,e as ns,u as Le,k as as,aN as rs,aO as is,O as gt,aP as ls,N as os,B as cs,P as De}from"./index-U7sxkCtg.js";import{i as qe}from"./AlertCircle-CWfOEKki.js";import{B as ds,C as at,A as ye,D as us,E as fs,F as ms,G as hs,H as ps,I as xs,J as bt,K as gs,d as bs,L as vs,n as ys,k as js,m as ks}from"./agent-icon-BnC2DyaZ.js";import{u as Ss,a as Ts}from"./thread-button-DbPrz4-p.js";import{T as we}from"./toolbar-icon-button-BmfLDUbS.js";import{C as W,w as Ns,S as _s}from"./use-sandbox-events-D1UC0d1h.js";import{s as vt,C as ws,u as Cs,a as yt,V as Ps,b as Is}from"./input-Dsubxg1J.js";import{u as $e,a as We,b as Ee,c as jt,d as As,s as Ms}from"./chat-context-kJ7vpE9_.js";import{u as Ls,s as kt}from"./use-ai-providers-CEZuf2wE.js";import{b as St,a as $s,u as Es}from"./use-organization-settings-CPOQOxKw.js";import{i as Fs}from"./CheckCircle-BAAjR6Yz.js";import{s as rt}from"./XClose-57_ntdgF.js";import{a as Se,b as Tt,c as Nt,g as _t,p as Rs}from"./repository-binding-C_rNGJZH.js";import{I as wt}from"./integration-icon-B8zb5l7K.js";import{c as Os}from"./use-decopilot-events-CaQ-ifBF.js";import{t as Ye}from"./ChevronUp-D2V0rxEI.js";import{O as Bs}from"./pair-DikNYdKi.js";import{u as Ds,a as zs}from"./use-thread-outputs-DR80xdVS.js";import{u as Gs}from"./use-deco-credits-B2DLMpWA.js";import{a as Ze,f as Hs,L as Us,s as Ks,b as Vs}from"./shell-layout-DQzu_3a6.js";import{t as qs,f as Ws,m as Ys,b as Zs,a as Js}from"./use-chat-layout-state-Dl5fbmt9.js";import{g as Ct,u as Qs,n as Xs,a as en}from"./use-releases-POJh7lfH.js";import{u as tn,d as Pt,a as Je,b as Qe,c as Xe,e as sn}from"./thread-intent-oxPmiLpE.js";import{f as nn,b as It,c as an}from"./use-navigate-to-agent-DbxbeXIC.js";import{o as rn,s as ln,u as on,S as cn}from"./sandbox-lifecycle-context-BFOchDNn.js";import{E as At}from"./empty-state-dTT22idT.js";import{C as it}from"./index-C2Kh16_Z.js";import{a as Mt,b as Lt,P as $t}from"./popover-KA4f1Rso.js";import{T as Fe,a as Re,b as Oe}from"./tooltip-D9dKhMcM.js";import{T as dn,a as un}from"./toggle-group-BoHp8d1Q.js";import{u as Et,a as et,r as fn,b as Ft,c as mn,d as hn}from"./thread-route-CydsZIWs.js";import{c as pn,a as xn,e as gn,b as bn,C as vn,f as yn}from"./command-DW8vpIAn.js";import{i as Rt}from"./ZoomOut-CK4FVubR.js";import{g as jn,S as kn}from"./task-status-VxTqyW4d.js";import{a as Sn}from"./format-time-CjIPQhCN.js";import{u as Tn}from"./use-clock-tick-BMU-GnSw.js";import{u as Nn}from"./use-chat-navigation-Dlyibisy.js";import{a as Ot,u as _n}from"./use-panel-navigate-DFsIXY6f.js";import{u as Bt}from"./use-main-panel-tabs-CMS20W_c.js";import{T as Ce}from"./tab-icon-glyph-BYA6exv3.js";import{a as wn}from"./UserSquare-Gs4U-X0G.js";import{b as Cn,c as Dt,S as Pn,d as In}from"./select-CbOgbS2d.js";import{L as tt,a as An}from"./legacy-main-redirect-WqO1j6y_.js";import{u as Mn}from"./use-mobile-BfC7cdl6.js";import{L as Ln}from"./preview-dialog-CgACqBPB.js";import{O as $n}from"./markdown-B6KxKFZ3.js";import{B as lt}from"./blocks-preview-workspace-context-B1X4jaIN.js";import{p as En}from"./virtual-mcp-CadqoFCO.js";import"./Tool01-BTVhARMR.js";import"./ArrowUp-BhTDxCnH.js";import"./ArrowLeft-B5i4q13h.js";import"./LinkBroken01-ClQXqp6D.js";import"./ShoppingBag01-CXpLfOIN.js";import"./Building02-BB32RZGw.js";import"./ChevronSelectorVertical-iTIvKtkg.js";import"./Copy01-D52Dm87Z.js";import"./CreditCard01-ukHBKeCx.js";import"./DotsVertical-D3Nk6PKk.js";import"./Image01-CBMbNlWB.js";import"./Globe04-CD1Fa9uc.js";import"./SwitchHorizontal01-Be__kNWY.js";import"./Key01-DqMMqipC.js";import"./Link01-CnfFWr1B.js";import"./Monitor01-CWjK0W6g.js";import"./Sun-CQyxb836.js";import"./Play-CiT2g6kK.js";import"./Plus-DKtqOzS_.js";import"./SearchMd-Eodh17Ne.js";import"./Trash01-Cplj2Ik4.js";import"./Upload01-B6X2kk3D.js";import"./User01-CqwCn9hE.js";import"./Users01-HGukenVX.js";import"./sheet-CcUwyeyx.js";import"./tool-namespace-BxpjstzE.js";import"./drawer-CPnx75cL.js";import"./collection-search-CTKjuIpa.js";import"./use-mcp-client-hyHjvXHS.js";import"./auth-DpVa9FBr.js";import"./use-mcp-prompts-B4XQOyIC.js";import"./usage-stats-y9uwYGvN.js";import"./form-iGrCLiiK.js";import"./label-BrB_d8st.js";import"./utils-CVEq3hMx.js";import"./use-copy-DWwjFTFc.js";import"./index-Ci7HVjCb.js";import"./checkbox-CS0Igoet.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-DkyZyTLO.js";import"./feature-paywall-CgdVUKa4.js";import"./plan-ladder-CIXyMEqm.js";import"./sandbox-url-D3mC8qhT.js";import"./backoff-CrEUbyZT.js";import"./icon-button-CsR1tF4_.js";import"./file-type-icon-SA_GdG2N.js";import"./location-BjlyegC2.js";import"./autosend-Dna7U2HC.js";import"./chat-draft-BS9tIUoh.js";import"./tabs-ygNtOTGD.js";import"./use-open-billing-url-BlRE_825.js";import"./input-CY_xbCC1.js";import"./suggestion-BNgiJ1ZJ.js";import"./use-org-fs-CpG4Ftj0.js";import"./useInfiniteQuery-D602T7Oc.js";import"./infiniteQueryObserver-CXx-MaO_.js";import"./question-004-sINsf4GQ.js";import"./use-members-BppTtT4e.js";import"./use-org-auth-client-BpOVJa8q.js";import"./add-connection-dialog-B6QIFmOE.js";import"./extract-connection-data-B8QJH0-o.js";import"./metadata-D72DunRR.js";import"./connection-CpR5iu5o.js";import"./url-slug-BF1zPW8D.js";import"./connection-card-HH41R-gb.js";import"./connection-slug-CITJ0kGN.js";import"./slugify-CEUa2lfQ.js";import"./textarea-Cz2yfMWd.js";import"./use-connection-Bjwl8al7.js";import"./connection-form-helpers-DmYbPB1E.js";import"./authenticate-and-persist-oauth-CbYI0Hyu.js";import"./mcp-oauth-B_CRpHbq.js";import"./mcp-oauth-B-d-VRg6.js";import"./collection-tabs-HaSRL7BY.js";import"./badge-8YPtojDh.js";import"./use-infinite-scroll-TxEXws4q.js";import"./useSuspenseInfiniteQuery-TMfZO9fH.js";import"./use-task-board-events-C6vPjypN.js";import"./task-board-CGKcZmT3.js";import"./schema-Cx5CAoQi.js";import"./watch-sse-pool-BK0LBG5W.js";import"./collapsible-BeEr-w4N.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CHuB1ZI6.js";import"./types-DhTd2fZN.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./use-project-scope-BDGuEIbQ.js";import"./project-icon-BCIWlbB2.js";import"./new-project-dialog-Civny35s.js";import"./repository-import-picker-yVMNVJAW.js";import"./repository-picker-B4dJGi5H.js";import"./use-debounced-value-BWgwAYQ4.js";import"./required-auth-layout-CDnv3SsX.js";import"./use-org-sso-D2PH-QV7.js";import"./use-file-configs-BlVRbWGm.js";import"./site-slug-DebpOoQq.js";import"./serial-task-queue-CGOeQgpr.js";import"./delay-CnY5UFtP.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./resizable-E6xc07q4.js";import"./index-BlqL9SMO.js";import"./index-CHnZ1OML.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-mcp-tools-DCX9XGmF.js";import"./resolve-tab-icon-BF6rqPgZ.js";import"./use-task-metadata-DXtRT11o.js";import"./index-BdQq_4o_.js";import"./preview-content-CsRoC8kG.js";import"./file-share-button-D0sPfCUq.js";import"./file-preview-Cw0eH4RI.js";import"./utils-DVQBiT32.js";import"./editor-yCqmKD--.js";function Fn({isThreadLocked:t,hasCloudProviderKeys:e,sandboxOnlyChats:s,canRunClaudeCode:r}){return t?null:!e&&!(s&&r)?"provider":s&&!r?"claude-code-provider":null}function Rn(){const t=M.c(25),e=Ls(),s=$e(),r=St(),i=$s("chat_harness_codex"),{org:a}=ne(),{data:o}=pe.useSession(),c=o?.user.id??"",u=Ie(),l=e.some(Bn);let d;t[0]!==a.id?(d=fe.claudeSubscription(a.id),t[0]=a.id,t[1]=d):d=t[1];let m;t[2]!==u?(m=()=>u.call("CLAUDE_SUBSCRIPTION_STATUS",{}),t[2]=u,t[3]=m):m=t[3];const f=r&&!i&&!l;let h;t[4]!==d||t[5]!==m||t[6]!==f?(h={queryKey:d,queryFn:m,enabled:f},t[4]=d,t[5]=m,t[6]=f,t[7]=h):h=t[7];const j=me(h);let k;t[8]!==a.id?(k=fe.githubCopilot(a.id),t[8]=a.id,t[9]=k):k=t[9];let v;t[10]!==u?(v=()=>u.call("GITHUB_COPILOT_STATUS",{}),t[10]=u,t[11]=v):v=t[11];const x=r&&!i&&!l;let g;t[12]!==k||t[13]!==v||t[14]!==x?(g={queryKey:k,queryFn:v,enabled:x},t[12]=k,t[13]=v,t[14]=x,t[15]=g):g=t[15];const b=me(g);let y;t[16]!==a.id||t[17]!==c?(y=fe.codexSubscription(a.id,c),t[16]=a.id,t[17]=c,t[18]=y):y=t[18];let p;t[19]!==u?(p=()=>u.call("CODEX_SUBSCRIPTION_STATUS",{}),t[19]=u,t[20]=p):p=t[20];const S=r&&i;let N;t[21]!==S||t[22]!==y||t[23]!==p?(N={queryKey:y,queryFn:p,enabled:S},t[21]=S,t[22]=y,t[23]=p,t[24]=N):N=t[24];const T=me(N);return r&&i&&!s?.isThreadLocked?e.some(On)||T.data?.connected!==!1?null:"codex-provider":Fn({isThreadLocked:s?.isThreadLocked??!1,hasCloudProviderKeys:e.length>0,sandboxOnlyChats:r,canRunClaudeCode:l||j.data?.connected!==!1||b.data?.connected!==!1||!!b.data?.orgShare})}function On(t){return vt(t.providerId)}function Bn(t){return kt(t.providerId)}function be(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function ze(t){if(!t)return"—";const e=typeof t=="string"?new Date(t):t;return isNaN(e.getTime())?"—":e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function Dn(t){return t?t.replace(/-\d{8}(?:-[a-z0-9]+)*$/i,"").replace(/-/g," "):"—"}function zn(t){const e=M.c(4),{items:s}=t;let r;e[0]!==s?(r=s.map(Gn),e[0]=s,e[1]=r):r=e[1];let i;return e[2]!==r?(i=n.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-6",children:r}),e[2]=r,e[3]=i):i=e[3],i}function Gn(t){return n.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[n.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t.label}),n.jsx("span",{className:"text-sm text-foreground tabular-nums truncate",children:t.value})]},t.label)}function Hn(t){const e=M.c(33),{userTokens:s,assistantTokens:r,otherTokens:i}=t,a=K(),o=s+r+i,c=o>0?s/o*100:0,u=o>0?r/o*100:0,l=o>0?i/o*100:0;let d;e[0]!==c?(d=c>0&&n.jsx("div",{className:"h-full bg-chart-1",style:{width:`${c}%`}}),e[0]=c,e[1]=d):d=e[1];let m;e[2]!==u?(m=u>0&&n.jsx("div",{className:"h-full bg-chart-2",style:{width:`${u}%`}}),e[2]=u,e[3]=m):m=e[3];let f;e[4]!==l?(f=l>0&&n.jsx("div",{className:"h-full bg-muted-foreground/30",style:{width:`${l}%`}}),e[4]=l,e[5]=f):f=e[5];let h;e[6]!==d||e[7]!==m||e[8]!==f?(h=n.jsxs("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted",children:[d,m,f]}),e[6]=d,e[7]=m,e[8]=f,e[9]=h):h=e[9];let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-1 shrink-0"}),e[10]=j):j=e[10];let k;e[11]!==a||e[12]!==c?(k=a("chat.contextPanel.userPercent",{pct:c.toFixed(1)}),e[11]=a,e[12]=c,e[13]=k):k=e[13];let v;e[14]!==k?(v=n.jsxs("div",{className:"flex items-center gap-1.5",children:[j,n.jsx("span",{className:"text-xs text-muted-foreground",children:k})]}),e[14]=k,e[15]=v):v=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-2 shrink-0"}),e[16]=x):x=e[16];let g;e[17]!==u||e[18]!==a?(g=a("chat.contextPanel.assistantPercent",{pct:u.toFixed(1)}),e[17]=u,e[18]=a,e[19]=g):g=e[19];let b;e[20]!==g?(b=n.jsxs("div",{className:"flex items-center gap-1.5",children:[x,n.jsx("span",{className:"text-xs text-muted-foreground",children:g})]}),e[20]=g,e[21]=b):b=e[21];let y;e[22]!==l||e[23]!==i||e[24]!==a?(y=i>0&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-muted-foreground/30 shrink-0"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.otherPercent",{pct:l.toFixed(1)})})]}),e[22]=l,e[23]=i,e[24]=a,e[25]=y):y=e[25];let p;e[26]!==b||e[27]!==y||e[28]!==v?(p=n.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[v,b,y]}),e[26]=b,e[27]=y,e[28]=v,e[29]=p):p=e[29];let S;return e[30]!==p||e[31]!==h?(S=n.jsxs("div",{className:"flex flex-col gap-2",children:[h,p]}),e[30]=p,e[31]=h,e[32]=S):S=e[32],S}function Un(t){const e=M.c(14),{agentId:s,isError:r}=t,i=Se(s),a=K();let o;e[0]!==i?.title||e[1]!==a?(o=i?.title??a("chat.subtask.subtaskNoun"),e[0]=i?.title,e[1]=a,e[2]=o):o=e[2];const c=o,u=i?.icon??null;let l;e[3]!==u||e[4]!==c?(l=n.jsx(wt,{icon:u,name:c,size:"xs",className:"size-6 rounded-md shrink-0"}),e[3]=u,e[4]=c,e[5]=l):l=e[5];const d=r?"text-destructive":"text-foreground";let m;e[6]!==d?(m=ee("shrink-0 font-medium",d),e[6]=d,e[7]=m):m=e[7];let f;e[8]!==c||e[9]!==m?(f=n.jsx("span",{className:m,children:c}),e[8]=c,e[9]=m,e[10]=f):f=e[10];let h;return e[11]!==l||e[12]!==f?(h=n.jsxs(n.Fragment,{children:[l,f]}),e[11]=l,e[12]=f,e[13]=h):h=e[13],h}function Kn(t){const e=M.c(12),{isError:s}=t,r=K();let i;e[0]!==r?(i=r("chat.contextPanel.subtask"),e[0]=r,e[1]=i):i=e[1];const a=i;let o;e[2]!==a?(o=n.jsx(wt,{icon:null,name:a,size:"xs",className:"size-6 rounded-md shrink-0"}),e[2]=a,e[3]=o):o=e[3];const c=s?"text-destructive":"text-foreground";let u;e[4]!==c?(u=ee("shrink-0 font-medium",c),e[4]=c,e[5]=u):u=e[5];let l;e[6]!==a||e[7]!==u?(l=n.jsx("span",{className:u,children:a}),e[6]=a,e[7]=u,e[8]=l):l=e[8];let d;return e[9]!==o||e[10]!==l?(d=n.jsxs(n.Fragment,{children:[o,l]}),e[9]=o,e[10]=l,e[11]=d):d=e[11],d}function Vn(t){const e=M.c(18),{part:s}=t,r=s.input?.agent_id,i=s.state==="input-streaming"||s.state==="input-available"||s.state==="output-available"&&s.preliminary===!0,a=s.state==="output-error",o=s.state==="approval-requested";let c;e[0]!==a?(c=n.jsx(Kn,{isError:a}),e[0]=a,e[1]=c):c=e[1];let u;e[2]!==r||e[3]!==a?(u=n.jsx(Un,{agentId:r,isError:a}),e[2]=r,e[3]=a,e[4]=u):u=e[4];let l;e[5]!==c||e[6]!==u?(l=n.jsx(B.Suspense,{fallback:c,children:u}),e[5]=c,e[6]=u,e[7]=l):l=e[7];let d;e[8]!==s.input?(d=s.input?.prompt&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-muted-foreground/50",children:"·"}),n.jsx("span",{className:"truncate text-muted-foreground",children:s.input.prompt})]}),e[8]=s.input,e[9]=d):d=e[9];let m;e[10]!==o||e[11]!==a||e[12]!==i?(m=n.jsx("span",{className:"ml-auto shrink-0",children:i?n.jsx(ve,{className:"size-3 text-muted-foreground"}):a?n.jsx(ds,{size:12,className:"text-destructive"}):o?n.jsx(qe,{size:12,className:"text-warning"}):n.jsx(Fs,{size:12,className:"text-success"})}),e[10]=o,e[11]=a,e[12]=i,e[13]=m):m=e[13];let f;return e[14]!==l||e[15]!==d||e[16]!==m?(f=n.jsxs("div",{className:"flex items-center gap-2 text-xs min-w-0",children:[l,d,m]}),e[14]=l,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function qn(t){const e=M.c(51),{onClose:s,back:r,className:i}=t,a=K(),[o,c]=B.useState(null),{messages:u}=We(),{activeTask:l}=Ee(),{selectedModel:d,selectedVirtualMcp:m}=jt(),f=As(u),h=[...u].reverse().find(ra),j=h?.metadata?.usage,k=[...u].reverse().find(aa)?.metadata?.models?.thinking,v=h?.metadata?.modelLimits?.contextWindow??(!k||k.id===d?.modelId?d?.limits?.contextWindow:null)??null,x=j?.contextTokens??0,g=v&&v>0?(x/v*100).toFixed(1):null,b=u;let y;e[0]!==b?(y=b.filter(na).reduce(sa,0),e[0]=b,e[1]=y):y=e[1];const p=y,S=u;let N;e[2]!==S?(N=S.filter(ta).reduce(ea,0),e[2]=S,e[3]=N):N=e[3];const T=N,_=Math.max(0,f.totalTokens-p-T),w=u[0],I=u.at(-1),P=w?.metadata?.created_at??l?.created_at,L=I?.metadata?.created_at??l?.updated_at,$=u.filter(Xn),E=u.flatMap(Jn),F=Dn(k?.id??d?.modelId),R=m?.title??"Super Agent",A=Os(),C=[{label:a("chat.contextPanel.sessionLabel"),value:l?.title??a("chat.contextPanel.newChat")},{label:a("chat.contextPanel.messagesLabel"),value:$.length},{label:a("chat.contextPanel.agentLabel"),value:R},...A?[{label:a("chat.contextPanel.modelLabel"),value:F}]:[],{label:a("chat.contextPanel.contextLimitLabel"),value:v?be(v):"—"},{label:a("chat.contextPanel.sessionTokensLabel"),value:f.totalTokens>0?be(f.totalTokens):"0"},{label:a("chat.contextPanel.usageLabel"),value:g!==null?`${g}%`:"—"},{label:a("chat.contextPanel.inputTokensLabel"),value:f.inputTokens>0?be(f.inputTokens):"0"},{label:a("chat.contextPanel.outputTokensLabel"),value:f.outputTokens>0?be(f.outputTokens):"0"},{label:a("chat.contextPanel.reasoningTokensLabel"),value:f.reasoningTokens>0?be(f.reasoningTokens):"0"},...A?[{label:a("chat.contextPanel.costLabel"),value:f.cost>0?`$${f.cost<.001?f.cost.toFixed(6):f.cost.toFixed(4)}`:"$0.00"}]:[],{label:a("chat.contextPanel.sessionCreatedLabel"),value:ze(P)},{label:a("chat.contextPanel.lastActivityLabel"),value:ze(L)}];if(!l&&$.length===0){let D;e[4]!==i?(D=ee("flex flex-col h-full w-full border-l border-border bg-background",i),e[4]=i,e[5]=D):D=e[5];let re;e[6]!==a?(re=a("chat.contextPanel.title"),e[6]=a,e[7]=re):re=e[7];let Q;e[8]!==re?(Q=n.jsx("span",{className:"text-sm font-medium text-foreground",children:re}),e[8]=re,e[9]=Q):Q=e[9];let X;e[10]!==r?(X=r?n.jsx(at,{size:14,className:"text-muted-foreground"}):n.jsx(rt,{size:14,className:"text-muted-foreground"}),e[10]=r,e[11]=X):X=e[11];let te;e[12]!==s||e[13]!==X?(te=n.jsx("button",{type:"button",onClick:s,className:"flex size-6 items-center justify-center hover:bg-accent transition-colors rounded-lg",children:X}),e[12]=s,e[13]=X,e[14]=te):te=e[14];let ae;e[15]!==Q||e[16]!==te?(ae=n.jsxs("div",{className:"h-11 px-4 flex items-center justify-between shrink-0 border-b border-border/50",children:[Q,te]}),e[15]=Q,e[16]=te,e[17]=ae):ae=e[17];let ie;e[18]!==a?(ie=a("chat.contextPanel.emptyState"),e[18]=a,e[19]=ie):ie=e[19];let se;e[20]!==ie?(se=n.jsx("div",{className:"flex-1 flex items-center justify-center px-4 text-center",children:n.jsx("p",{className:"text-xs text-muted-foreground",children:ie})}),e[20]=ie,e[21]=se):se=e[21];let oe;return e[22]!==ae||e[23]!==se||e[24]!==D?(oe=n.jsxs("div",{className:D,children:[ae,se]}),e[22]=ae,e[23]=se,e[24]=D,e[25]=oe):oe=e[25],oe}let G;e[26]!==i?(G=ee("flex flex-col h-full w-full border-l border-border bg-background overflow-y-auto",i),e[26]=i,e[27]=G):G=e[27];let z;e[28]!==a?(z=a("chat.contextPanel.title"),e[28]=a,e[29]=z):z=e[29];let H;e[30]!==z?(H=n.jsx("span",{className:"text-sm font-medium text-foreground",children:z}),e[30]=z,e[31]=H):H=e[31];let O;e[32]!==r?(O=r?n.jsx(at,{size:14}):n.jsx(rt,{size:14}),e[32]=r,e[33]=O):O=e[33];let V;e[34]!==s||e[35]!==O?(V=n.jsx("button",{type:"button",onClick:s,className:"flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:O}),e[34]=s,e[35]=O,e[36]=V):V=e[36];let Z;e[37]!==H||e[38]!==V?(Z=n.jsxs("div",{className:"flex h-11 shrink-0 items-center justify-between border-b border-border/50 px-4",children:[H,V]}),e[37]=H,e[38]=V,e[39]=Z):Z=e[39];let Y;e[40]!==a?(Y=a("chat.contextPanel.contextBreakdownSection"),e[40]=a,e[41]=Y):Y=e[41];let J;e[42]!==Y?(J=n.jsx("span",{className:"text-xs text-muted-foreground",children:Y}),e[42]=Y,e[43]=J):J=e[43];let q;e[44]!==T||e[45]!==_||e[46]!==p?(q=n.jsx(Hn,{userTokens:p,assistantTokens:T,otherTokens:_}),e[44]=T,e[45]=_,e[46]=p,e[47]=q):q=e[47];let le;return e[48]!==J||e[49]!==q?(le=n.jsxs("div",{className:"flex flex-col gap-3",children:[J,q]}),e[48]=J,e[49]=q,e[50]=le):le=e[50],n.jsxs("div",{className:G,children:[Z,n.jsxs("div",{className:"flex flex-col gap-8 p-6",children:[E.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.subtasksSection")}),n.jsx("div",{className:"flex flex-col gap-1",children:E.map(Zn)})]}),n.jsx(zn,{items:C}),le,$.length>0&&n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground",children:a("chat.contextPanel.rawMessagesSection")}),n.jsx("div",{className:"flex flex-col gap-1",children:$.map(D=>{const re=D.metadata?.created_at,Q=o?.id===D.id;return n.jsxs("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[n.jsxs("button",{type:"button",onClick:()=>c(Q?null:D),className:"flex items-center justify-between gap-2 px-3 py-2 text-xs hover:bg-accent/50 w-full text-left cursor-pointer",children:[n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx("span",{className:ee("shrink-0 font-medium",D.role==="user"?"text-chart-1":"text-chart-2"),children:D.role}),n.jsx("span",{className:"text-muted-foreground",children:"•"}),n.jsx("span",{className:"truncate text-muted-foreground font-mono",children:D.id})]}),re&&n.jsx("span",{className:"shrink-0 text-muted-foreground tabular-nums",children:ze(re)})]}),Q&&n.jsxs(n.Fragment,{children:[D.role==="assistant"&&(()=>{const X=D.metadata?._request;if(!X)return null;const te=X.systemSections??[],ae=Math.max(1,...te.map(Yn)),ie=te.reduce(Wn,0);return n.jsxs("div",{className:"border-t border-border/50 px-3 py-2.5 text-xs space-y-2.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"font-medium text-foreground",children:a("chat.contextPanel.requestLabel")}),n.jsxs("span",{className:"text-muted-foreground tabular-nums",children:[X.activeTools??0," / ",X.tools??0," ",a("chat.contextPanel.toolsActive")]})]}),te.length>0&&n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"text-muted-foreground",children:[a("chat.contextPanel.systemPromptLabel")," ",n.jsxs("span",{className:"tabular-nums",children:["~",Math.round(ie/4).toLocaleString()," ",a("chat.contextPanel.tokAbbrev")]})]}),te.map((se,oe)=>{const ce=se.preview.match(/^<([a-z-]+)/i)?.[1]??`section ${oe}`,xe=se.chars/ae*100,de=Math.round(se.chars/4);return n.jsxs("div",{className:"space-y-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("span",{className:"font-mono text-foreground truncate",children:ce}),n.jsxs("span",{className:"text-muted-foreground tabular-nums shrink-0",children:["~",de.toLocaleString()," ",a("chat.contextPanel.tokAbbrev")]})]}),n.jsx("div",{className:"h-1 w-full rounded-full bg-muted overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-chart-3",style:{width:`${xe}%`}})})]},oe)})]})]})})(),n.jsx("pre",{className:"text-xs font-mono bg-muted px-3 py-2 overflow-auto whitespace-pre-wrap break-all border-t border-border/50 max-h-64",children:JSON.stringify(D,null,2)})]})]},D.id)})})]})]})]})}function Wn(t,e){return t+e.chars}function Yn(t){return t.chars}function Zn(t,e){return n.jsx(Vn,{part:t},e)}function Jn(t){return(t.parts??[]).filter(Qn)}function Qn(t){return t.type==="tool-subtask"}function Xn(t){return t.role!=="system"}function ea(t,e){const s=e.metadata?.usage;return t+(s?.outputTokens??0)}function ta(t){return t.role==="assistant"}function sa(t,e){const s=e.metadata?.usage;return t+(s?.inputTokens??0)}function na(t){return t.role==="user"}function aa(t){return t.role==="assistant"&&t.metadata?.models}function ra(t){return t.role==="assistant"&&t.metadata?.usage}function ia(t){const e=M.c(21),{onOpenContextPanel:s}=t,{org:r}=ne(),{selectedVirtualMcp:i}=jt();let a;e[0]!==r.id?(a=je(r.id),e[0]=r.id,e[1]=a):a=e[1];const c=i??a,l=Se(c.id)??c,d=l.title??"Super Agent",m=l.icon??null,f=l.description??null;let h;e[2]!==m||e[3]!==d?(h=n.jsx(ye,{icon:m,name:d,size:"lg"}),e[2]=m,e[3]=d,e[4]=h):h=e[4];let j;e[5]!==d?(j=n.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-foreground",children:d}),e[5]=d,e[6]=j):j=e[6];let k;e[7]!==f?(k=f?n.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-balance",children:f}):null,e[7]=f,e[8]=k):k=e[8];let v;e[9]!==j||e[10]!==k?(v=n.jsxs("div",{className:"space-y-1.5",children:[j,k]}),e[9]=j,e[10]=k,e[11]=v):v=e[11];let x;e[12]!==h||e[13]!==v?(x=n.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center gap-4 px-6 text-center overflow-hidden",children:[h,v]}),e[12]=h,e[13]=v,e[14]=x):x=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(W.IceBreakers,{className:"pb-3"}),e[15]=g):g=e[15];let b;e[16]!==s?(b=n.jsxs(W.Footer,{children:[g,n.jsx(W.Input,{onOpenContextPanel:s})]}),e[16]=s,e[17]=b):b=e[17];let y;return e[18]!==x||e[19]!==b?(y=n.jsxs(n.Fragment,{children:[x,b]}),e[18]=x,e[19]=b,e[20]=y):y=e[20],y}function ot(t){const e=M.c(17),{outputs:s,collapsed:r,onToggle:i,variant:a}=t,o=a==="card"?"rounded-xl border border-border bg-muted/95 shadow-sm backdrop-blur-sm":"border-b border-border bg-background";let c;e[0]!==o?(c=ee(o),e[0]=o,e[1]=c):c=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx("span",{className:"text-sm font-medium text-foreground",children:"Files in this task"}),e[2]=u):u=e[2];const l=r&&"-rotate-90";let d;e[3]!==l?(d=ee("size-4 text-muted-foreground transition-transform",l),e[3]=l,e[4]=d):d=e[4];let m;e[5]!==d?(m=n.jsx(Ye,{className:d}),e[5]=d,e[6]=m):m=e[6];let f;e[7]!==i||e[8]!==m?(f=n.jsxs("button",{type:"button",onClick:i,className:"flex w-full items-center justify-between px-3 py-2.5 text-left",children:[u,m]}),e[7]=i,e[8]=m,e[9]=f):f=e[9];let h;e[10]!==r||e[11]!==s?(h=!r&&n.jsx("div",{className:"flex max-h-72 flex-col gap-1.5 overflow-y-auto px-2 pb-2",children:s.map(la)}),e[10]=r,e[11]=s,e[12]=h):h=e[12];let j;return e[13]!==c||e[14]!==f||e[15]!==h?(j=n.jsxs("div",{className:c,children:[f,h]}),e[13]=c,e[14]=f,e[15]=h,e[16]=j):j=e[16],j}function la(t){return n.jsx(Bs,{file:t},t.key)}function oa(){const t=M.c(13),e=$e()?.taskId??null,s=Ds();let r;t[0]!==s?(r={enabled:s},t[0]=s,t[1]=r):r=t[1];const{data:i}=zs(e,r),[a,o]=B.useState(!1),[c,u]=B.useState(!0);if(!e||!i||i.length===0)return null;let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>o(da),t[2]=l):l=t[2];let d;t[3]!==a||t[4]!==i?(d=n.jsx("div",{className:"absolute top-2 right-2 z-10 hidden w-72 @[1280px]:block",children:n.jsx(ot,{variant:"card",outputs:i,collapsed:a,onToggle:l})}),t[3]=a,t[4]=i,t[5]=d):d=t[5];let m;t[6]===Symbol.for("react.memo_cache_sentinel")?(m=()=>u(ca),t[6]=m):m=t[6];let f;t[7]!==c||t[8]!==i?(f=n.jsx("div",{className:"shrink-0 @[1280px]:hidden",children:n.jsx(ot,{variant:"bar",outputs:i,collapsed:c,onToggle:m})}),t[7]=c,t[8]=i,t[9]=f):f=t[9];let h;return t[10]!==d||t[11]!==f?(h=n.jsxs(n.Fragment,{children:[d,f]}),t[10]=d,t[11]=f,t[12]=h):h=t[12],h}function ca(t){return!t}function da(t){return!t}function ua(){const t=M.c(1);B.use(We().ready);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ws,{children:n.jsx(fa,{})}),t[0]=e):e=t[0],e}function fa(){const t=M.c(29),{active:e}=Cs(),{org:s}=ne(),r=$e(),{isChatEmpty:i}=We(),[a,o]=B.useState("chat"),c=Gs(),u=K(),l=Rn(),{runtime:d}=yt(r?.virtualMcpId);if(l!==null&&d!=="cms"){let T;return t[0]!==l||t[1]!==u?(T=n.jsx(W,{className:"animate-in fade-in-0 duration-200",children:n.jsx(W.Main,{className:"flex flex-col items-center",children:n.jsx(W.EmptyState,{children:l==="codex-provider"?n.jsx(W.NoAiProviderEmptyState,{title:u("settings.codexSubscription.setupHeading"),description:u("settings.codexSubscription.setupDescription"),providerFilter:vt}):l==="claude-code-provider"?n.jsx(W.NoAiProviderEmptyState,{title:u("chat.noAiProviderEmptyState.supportedHeading"),description:u("chat.noAiProviderEmptyState.supportedSubtitle"),providerFilter:kt}):n.jsx(W.NoAiProviderEmptyState,{})})})}),t[0]=l,t[1]=u,t[2]=T):T=t[2],T}let f;t[3]!==c.hasDecoKey||t[4]!==c.hasOnlyDecoProvider||t[5]!==c.isLoading||t[6]!==c.isZeroBalance||t[7]!==i||t[8]!==s?(f=c.hasDecoKey&&c.isZeroBalance&&c.hasOnlyDecoProvider&&!c.isLoading&&i&&!Ns(s.id),t[3]=c.hasDecoKey,t[4]=c.hasOnlyDecoProvider,t[5]=c.isLoading,t[6]=c.isZeroBalance,t[7]=i,t[8]=s,t[9]=f):f=t[9];const h=f;let j;t[10]!==h?(j=h&&n.jsx(W.CreditsEmptyState,{}),t[10]=h,t[11]=j):j=t[11];let k;t[12]!==a||t[13]!==i||t[14]!==d||t[15]!==e?(k=!e&&n.jsx("div",{inert:a!=="chat"?!0:void 0,"aria-hidden":a!=="chat",className:ee("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",a!=="chat"?"opacity-0 pointer-events-none":"opacity-100"),children:i&&d!=="cms"?n.jsx(ia,{onOpenContextPanel:()=>o("context")}):n.jsxs(n.Fragment,{children:[n.jsxs(W.Main,{className:"relative flex flex-col overflow-hidden @container",children:[n.jsx(oa,{}),n.jsx("div",{className:"min-h-0 flex-1",children:n.jsx(W.Messages,{})})]}),n.jsx(W.Footer,{children:n.jsx(W.Input,{onOpenContextPanel:()=>o("context")})})]})}),t[12]=a,t[13]=i,t[14]=d,t[15]=e,t[16]=k):k=t[16];let v;t[17]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ps,{}),t[17]=v):v=t[17];const x=a!=="context"?!0:void 0,g=a!=="context",b=a==="context"?"opacity-100":"opacity-0 pointer-events-none";let y;t[18]!==b?(y=ee("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",b),t[18]=b,t[19]=y):y=t[19];let p;t[20]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(qn,{back:!0,onClose:()=>o("chat")}),t[20]=p):p=t[20];let S;t[21]!==x||t[22]!==g||t[23]!==y?(S=n.jsx("div",{inert:x,"aria-hidden":g,className:y,children:p}),t[21]=x,t[22]=g,t[23]=y,t[24]=S):S=t[24];let N;return t[25]!==j||t[26]!==k||t[27]!==S?(N=n.jsxs(W,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[j,k,v,S]}),t[25]=j,t[26]=k,t[27]=S,t[28]=N):N=t[28],N}function ma(){const t=M.c(7),e=K();let s;t[0]!==e?(s=e("agentShellLayout.agentShellLayout.chatLoadingError"),t[0]=e,t[1]=s):s=t[1];let r;t[2]!==s?(r=n.jsx("div",{role:"alert",className:"flex h-full flex-1 items-center justify-center text-sm text-muted-foreground",children:s}),t[2]=s,t[3]=r):r=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Ae,{children:n.jsx(ua,{})}),t[4]=i):i=t[4];let a;return t[5]!==r?(a=n.jsx(pt,{fallback:r,children:i}),t[5]=r,t[6]=a):a=t[6],a}function ha(t){const e=M.c(10),{org:s}=ne(),r=tn(),{data:i}=pe.useSession(),a=i?.user?.id,o=t?.id??null,c=!!t&&!!a&&!!t.created_by&&t.created_by!==a;let u;e[0]!==s.id||e[1]!==o?(u=fe.viewedThreadMetadataRefresh(s.id,o??""),e[0]=s.id,e[1]=o,e[2]=u):u=e[2];const l=!!r&&!!o&&c;let d;e[3]!==r||e[4]!==o?(d=async()=>(await r?.refreshThreadMetadata(o??""),!0),e[3]=r,e[4]=o,e[5]=d):d=e[5];let m;e[6]!==u||e[7]!==l||e[8]!==d?(m={queryKey:u,enabled:l,staleTime:Number.POSITIVE_INFINITY,queryFn:d},e[6]=u,e[7]=l,e[8]=d,e[9]=m):m=e[9],me(m)}function Ge(t){const e=M.c(14),{label:s,value:r,onChange:i,options:a}=t;let o;e[0]!==s?(o=n.jsx("span",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=o):o=e[1];let c;e[2]!==i?(c=m=>m&&i(m),e[2]=i,e[3]=c):c=e[3];let u;e[4]!==a?(u=a.map(pa),e[4]=a,e[5]=u):u=e[5];let l;e[6]!==s||e[7]!==c||e[8]!==u||e[9]!==r?(l=n.jsx(un,{type:"single",size:"sm",value:r,onValueChange:c,"aria-label":s,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:u}),e[6]=s,e[7]=c,e[8]=u,e[9]=r,e[10]=l):l=e[10];let d;return e[11]!==o||e[12]!==l?(d=n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,l]}),e[11]=o,e[12]=l,e[13]=d):d=e[13],d}function pa(t){return n.jsxs(dn,{value:t.value,className:"h-6 gap-1.5 rounded-lg border border-transparent px-2 text-xs font-medium text-muted-foreground hover:bg-transparent data-[state=on]:border-border data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm",children:[t.icon,t.label]},t.value)}function xa(t){const e=M.c(91),{panel:s,className:r}=t,i=r===void 0?"md:size-[34px]":r,a=K();let o;e[0]!==a?(o=a("sidebar.taskGroupsList.filterChats"),e[0]=a,e[1]=o):o=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(us,{size:16}),e[2]=c):c=e[2];let u;e[3]!==s.filtersActive?(u=s.filtersActive&&n.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"}),e[3]=s.filtersActive,e[4]=u):u=e[4];let l;e[5]!==i||e[6]!==s.filtersActive||e[7]!==o||e[8]!==u?(l=n.jsx(Fe,{asChild:!0,children:n.jsx(Mt,{asChild:!0,children:n.jsxs(we,{"aria-label":o,active:s.filtersActive,className:i,children:[c,u]})})}),e[5]=i,e[6]=s.filtersActive,e[7]=o,e[8]=u,e[9]=l):l=e[9];let d;e[10]!==a?(d=a("sidebar.taskGroupsList.filterChats"),e[10]=a,e[11]=d):d=e[11];let m;e[12]!==d?(m=n.jsx(Re,{side:"bottom",children:d}),e[12]=d,e[13]=m):m=e[13];let f;e[14]!==l||e[15]!==m?(f=n.jsxs(Oe,{children:[l,m]}),e[14]=l,e[15]=m,e[16]=f):f=e[16];let h;e[17]!==a?(h=a("sidebar.taskGroupsList.filterView"),e[17]=a,e[18]=h):h=e[18];const j=s.groupBy;let k;e[19]!==s?(k=D=>{he("tasks_panel_group_by_changed",{to_value:D}),s.setGroupBy(D)},e[19]=s,e[20]=k):k=e[20];let v;e[21]!==a?(v=a("sidebar.taskGroupsList.viewList"),e[21]=a,e[22]=v):v=e[22];let x;e[23]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(fs,{size:13}),e[23]=x):x=e[23];let g;e[24]!==v?(g={value:"flat",label:v,icon:x},e[24]=v,e[25]=g):g=e[25];let b;e[26]!==a?(b=a("sidebar.taskGroupsList.viewStatus"),e[26]=a,e[27]=b):b=e[27];let y;e[28]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx(ms,{size:13}),e[28]=y):y=e[28];let p;e[29]!==b?(p={value:"status",label:b,icon:y},e[29]=b,e[30]=p):p=e[30];let S;e[31]!==g||e[32]!==p?(S=[g,p],e[31]=g,e[32]=p,e[33]=S):S=e[33];let N;e[34]!==s.groupBy||e[35]!==k||e[36]!==S||e[37]!==h?(N=n.jsx(Ge,{label:h,value:j,onChange:k,options:S}),e[34]=s.groupBy,e[35]=k,e[36]=S,e[37]=h,e[38]=N):N=e[38];let T;e[39]!==a?(T=a("sidebar.taskGroupsList.filterType"),e[39]=a,e[40]=T):T=e[40];const _=s.typeFilter;let w;e[41]!==s?(w=D=>{he("tasks_panel_filter_changed",{to_value:D}),s.setTypeFilter(D)},e[41]=s,e[42]=w):w=e[42];let I;e[43]!==a?(I=a("sidebar.taskGroupsList.typeAll"),e[43]=a,e[44]=I):I=e[44];let P;e[45]!==I?(P={value:"all",label:I},e[45]=I,e[46]=P):P=e[46];let L;e[47]!==a?(L=a("sidebar.taskGroupsList.typeChats"),e[47]=a,e[48]=L):L=e[48];let $;e[49]!==L?($={value:"manual",label:L},e[49]=L,e[50]=$):$=e[50];let E;e[51]!==a?(E=a("sidebar.taskGroupsList.typeAuto"),e[51]=a,e[52]=E):E=e[52];let F;e[53]!==E?(F={value:"automation",label:E},e[53]=E,e[54]=F):F=e[54];let R;e[55]!==P||e[56]!==$||e[57]!==F?(R=[P,$,F],e[55]=P,e[56]=$,e[57]=F,e[58]=R):R=e[58];let A;e[59]!==s.typeFilter||e[60]!==T||e[61]!==w||e[62]!==R?(A=n.jsx(Ge,{label:T,value:_,onChange:w,options:R}),e[59]=s.typeFilter,e[60]=T,e[61]=w,e[62]=R,e[63]=A):A=e[63];let C;e[64]!==a?(C=a("sidebar.taskGroupsList.filterScope"),e[64]=a,e[65]=C):C=e[65];const G=s.showAll?"team":"mine";let z;e[66]!==s?(z=D=>s.setShowAll(D==="team"),e[66]=s,e[67]=z):z=e[67];let H;e[68]!==a?(H=a("sidebar.taskGroupsList.scopeMine"),e[68]=a,e[69]=H):H=e[69];let O;e[70]!==H?(O={value:"mine",label:H},e[70]=H,e[71]=O):O=e[71];let V;e[72]!==a?(V=a("sidebar.taskGroupsList.scopeTeam"),e[72]=a,e[73]=V):V=e[73];let Z;e[74]!==V?(Z={value:"team",label:V},e[74]=V,e[75]=Z):Z=e[75];let Y;e[76]!==O||e[77]!==Z?(Y=[O,Z],e[76]=O,e[77]=Z,e[78]=Y):Y=e[78];let J;e[79]!==C||e[80]!==G||e[81]!==z||e[82]!==Y?(J=n.jsx(Ge,{label:C,value:G,onChange:z,options:Y}),e[79]=C,e[80]=G,e[81]=z,e[82]=Y,e[83]=J):J=e[83];let q;e[84]!==N||e[85]!==A||e[86]!==J?(q=n.jsxs(Lt,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[N,A,J]}),e[84]=N,e[85]=A,e[86]=J,e[87]=q):q=e[87];let le;return e[88]!==q||e[89]!==f?(le=n.jsxs($t,{children:[f,q]}),e[88]=q,e[89]=f,e[90]=le):le=e[90],le}function ga(t,e){return t.filter(s=>s.id===e||!!s.trigger_id||qs(s))}function ba(){const t=M.c(2),e=Tt()??[];let s;return t[0]!==e?(s=r=>{if(!r)return;const i=e.find(a=>a.id===r);return i?Pt(i.metadata):void 0},t[0]=e,t[1]=s):s=t[1],s}function va(t){const e=M.c(9),{virtualMcpId:s,size:r,showAutomationBadge:i}=t,a=r===void 0?"sm":r,o=K();let c;e[0]!==a||e[1]!==s?(c=s?n.jsx(ya,{virtualMcpId:s,size:a}):n.jsx(ye,{icon:null,name:"?",size:a}),e[0]=a,e[1]=s,e[2]=c):c=e[2];let u;e[3]!==i||e[4]!==o?(u=i&&n.jsx("span",{"aria-label":o("tasksPanel.mcpAvatar.automationTriggered"),className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-special border border-special text-special-foreground",children:n.jsx(Rt,{size:10,className:"text-white"})}),e[3]=i,e[4]=o,e[5]=u):u=e[5];let l;return e[6]!==c||e[7]!==u?(l=n.jsxs("div",{className:"relative shrink-0",children:[c,u]}),e[6]=c,e[7]=u,e[8]=l):l=e[8],l}function ya(t){const e=M.c(6),{virtualMcpId:s,size:r}=t,i=Nt(s);if(!i){let c;return e[0]!==r?(c=n.jsx(ye,{icon:null,name:"?",size:r}),e[0]=r,e[1]=c):c=e[1],c}const a=i.icon??null;let o;return e[2]!==i.title||e[3]!==r||e[4]!==a?(o=n.jsx(ye,{icon:a,name:i.title,size:r}),e[2]=i.title,e[3]=r,e[4]=a,e[5]=o):o=e[5],o}const ct=["thread"];function ja(t){const e=M.c(53),{open:s,onOpenChange:r}=t,[i,a]=B.useState(""),{org:o}=ne(),{setTaskId:c}=Ze(),u=Ie(),l=K();let d,m,f,h;e[0]!==o.id||e[1]!==i?(h=i.trim(),d=h?20:10,f=me,m=fe.globalSearch(o.id,h,d,ct),e[0]=o.id,e[1]=i,e[2]=d,e[3]=m,e[4]=f,e[5]=h):(d=e[2],m=e[3],f=e[4],h=e[5]);let j;e[6]!==d||e[7]!==u||e[8]!==h?(j=async()=>{const C=await u.call("GLOBAL_SEARCH",{query:h,limit:d,types:[...ct]});return{...C,items:C.items.filter(ka)}},e[6]=d,e[7]=u,e[8]=h,e[9]=j):j=e[9];let k;e[10]!==s||e[11]!==m||e[12]!==j?(k={queryKey:m,enabled:s,queryFn:j,staleTime:1e4},e[10]=s,e[11]=m,e[12]=j,e[13]=k):k=e[13];const{data:v,isFetching:x}=f(k);let g;e[14]!==v?.items?(g=v?.items??[],e[14]=v?.items,e[15]=g):g=e[15];const b=g;let y;e[16]!==r?(y=C=>{C||a(""),r(C)},e[16]=r,e[17]=y):y=e[17];const p=y;let S;e[18]!==p||e[19]!==c?(S=C=>{p(!1),c(C.id,C.virtual_mcp_id??void 0)},e[18]=p,e[19]=c,e[20]=S):S=e[20];const N=S;let T;e[21]!==l?(T=l("tasksPanel.globalSearchDialog.title"),e[21]=l,e[22]=T):T=e[22];let _;e[23]!==T?(_=n.jsx(qt,{children:T}),e[23]=T,e[24]=_):_=e[24];let w;e[25]!==l?(w=l("tasksPanel.globalSearchDialog.description"),e[25]=l,e[26]=w):w=e[26];let I;e[27]!==w?(I=n.jsx(Wt,{children:w}),e[27]=w,e[28]=I):I=e[28];let P;e[29]!==I||e[30]!==_?(P=n.jsxs(Yt,{className:"sr-only",children:[_,I]}),e[29]=I,e[30]=_,e[31]=P):P=e[31];let L;e[32]!==l?(L=l("tasksPanel.globalSearchDialog.placeholder"),e[32]=l,e[33]=L):L=e[33];let $;e[34]!==i||e[35]!==L?($=n.jsx(vn,{value:i,onValueChange:a,placeholder:L}),e[34]=i,e[35]=L,e[36]=$):$=e[36];let E;e[37]!==N||e[38]!==x||e[39]!==b||e[40]!==l||e[41]!==h?(E=n.jsx(pn,{children:x&&b.length===0?n.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:l("tasksPanel.globalSearchDialog.searching")}):b.length===0?n.jsx(xn,{children:l("tasksPanel.globalSearchDialog.noResults")}):n.jsx(gn,{heading:h?void 0:l("tasksPanel.globalSearchDialog.recent"),children:b.map(C=>C.type==="thread"?n.jsxs(bn,{value:`thread:${C.id}:${C.title}`,onSelect:()=>N(C),className:"gap-2.5",children:[n.jsx(va,{virtualMcpId:C.virtual_mcp_id,size:"xs"}),n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx("div",{className:"text-sm text-foreground truncate",children:C.title||l("tasksPanel.globalSearchDialog.untitledChat")})}),n.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(C.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${C.id}`):null)})}),e[37]=N,e[38]=x,e[39]=b,e[40]=l,e[41]=h,e[42]=E):E=e[42];let F;e[43]!==$||e[44]!==E?(F=n.jsxs(yn,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[$,E]}),e[43]=$,e[44]=E,e[45]=F):F=e[45];let R;e[46]!==P||e[47]!==F?(R=n.jsxs(Zt,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[P,F]}),e[46]=P,e[47]=F,e[48]=R):R=e[48];let A;return e[49]!==p||e[50]!==s||e[51]!==R?(A=n.jsx(Jt,{open:s,onOpenChange:p,children:R}),e[49]=p,e[50]=s,e[51]=R,e[52]=A):A=e[52],A}function ka(t){return t.type==="thread"}function Sa(t,e,s){if(!s)return;const r=t.findIndex(i=>i.id===e);if(r!==-1){for(let i=r+1;i<t.length;i++){const a=t[i];if(a?.created_by===s)return a}for(let i=r-1;i>=0;i--){const a=t[i];if(a?.created_by===s)return a}}}function Ta(t){return t==="ephemeral"||t.startsWith("thread:")}function zt(t){const e=M.c(45),{task:s,isActive:r,onClick:i,onArchive:a,showAutomationBadge:o,showAgentIcon:c,hideStatusIdle:u,indented:l}=t,d=K(),m=jn(s.status),f=m.icon,h=s.metadata?.kind==="tool_call_run",j=Nt(h?void 0:s.virtual_mcp_id);let k;e[0]!==j?(k=_t(j),e[0]=j,e[1]=k):k=e[1];const v=k;Tn(6e4);const x=o||!!s.trigger_id,g=s.id,b="button",y=0;let p;e[2]!==i?(p=z=>{z.target===z.currentTarget&&(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),i())},e[2]=i,e[3]=p):p=e[3];const S=l?"-ml-4 pl-6":"pl-[9px]",N=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let T;e[4]!==S||e[5]!==N?(T=ee("group/row flex items-center gap-2 py-1.5 rounded-md cursor-pointer transition-colors",S,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",N),e[4]=S,e[5]=N,e[6]=T):T=e[6];let _;e[7]!==h||e[8]!==c||e[9]!==j?.icon||e[10]!==j?.title?(_=c&&!h&&n.jsx(ye,{icon:j?.icon??null,name:j?.title??"?",size:"2xs"}),e[7]=h,e[8]=c,e[9]=j?.icon,e[10]=j?.title,e[11]=_):_=e[11];let w;e[12]!==x||e[13]!==d?(w=x&&n.jsx(Rt,{size:12,"aria-label":d("tasksPanel.taskRow.automationTriggered"),className:"shrink-0 text-special"}),e[12]=x,e[13]=d,e[14]=w):w=e[14];let I;e[15]!==d||e[16]!==s.title?(I=s.title||d("tasksPanel.taskRow.untitledTask"),e[15]=d,e[16]=s.title,e[17]=I):I=e[17];let P;e[18]!==I?(P=n.jsx("div",{className:"text-sm text-foreground truncate",children:I}),e[18]=I,e[19]=P):P=e[19];let L;e[20]!==w||e[21]!==P?(L=n.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[w,P]}),e[20]=w,e[21]=P,e[22]=L):L=e[22];let $;e[23]!==r||e[24]!==v||e[25]!==s.branch||e[26]!==s.updated_at?($=s.updated_at&&n.jsxs("div",{className:ee("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[s.branch&&!Ta(s.branch)?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"truncate font-mono",children:s.branch}),n.jsx("span",{className:"shrink-0",children:"·"})]}):v?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"truncate",children:[v.owner,"/",v.name]}),n.jsx("span",{className:"shrink-0",children:"·"})]}):null,n.jsx("span",{className:"shrink-0",children:Sn(new Date(s.updated_at))})]}),e[23]=r,e[24]=v,e[25]=s.branch,e[26]=s.updated_at,e[27]=$):$=e[27];let E;e[28]!==L||e[29]!==$?(E=n.jsxs("div",{className:"flex-1 min-w-0",children:[L,$]}),e[28]=L,e[29]=$,e[30]=E):E=e[30];const F="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",R=!u&&n.jsx("span",{className:ee("[grid-area:slot] flex size-8 items-center justify-center pointer-events-none transition-opacity",a&&"group-hover/row:opacity-0"),"aria-label":d("tasksPanel.taskRow.statusLabel",{status:d(m.labelKey)}),children:s.status==="in_progress"?n.jsx(ve,{className:ee("size-3.5",m.iconClassName)}):n.jsx(f,{size:14,className:m.iconClassName})});let A;e[31]!==a||e[32]!==d?(A=a&&n.jsxs(Oe,{children:[n.jsx(Fe,{asChild:!0,children:n.jsx("button",{type:"button","aria-label":d("tasksPanel.taskRow.archiveTask"),onClick:z=>{z.stopPropagation(),a()},className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-8 items-center justify-center rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:n.jsx(Qt,{size:14})})}),n.jsx(Re,{side:"right",children:d("tasksPanel.taskRow.archive")})]}),e[31]=a,e[32]=d,e[33]=A):A=e[33];let C;e[34]!==R||e[35]!==A?(C=n.jsxs("div",{className:F,children:[R,A]}),e[34]=R,e[35]=A,e[36]=C):C=e[36];let G;return e[37]!==i||e[38]!==E||e[39]!==C||e[40]!==p||e[41]!==T||e[42]!==_||e[43]!==s.id?(G=n.jsxs("div",{"data-task-id":g,role:b,tabIndex:y,onClick:i,onKeyDown:p,className:T,children:[_,E,C]}),e[37]=i,e[38]=E,e[39]=C,e[40]=p,e[41]=T,e[42]=_,e[43]=s.id,e[44]=G):G=e[44],G}const dt=["requires_action","in_progress","failed","expired","completed"];function Na(t){const e=new Map(dt.map(s=>[s,[]]));for(const s of t){const r=s.status??"completed";(e.get(r)??e.get("completed")).push(s)}return dt.map(s=>({status:s,threads:e.get(s)}))}const _a="sidebar.group.expanded.";function wa(t,e){const s=M.c(3),[r,i]=xt(`${_a}${t}`,e);let a;return s[0]!==r||s[1]!==i?(a=[r,i],s[0]=r,s[1]=i,s[2]=a):a=s[2],a}function Gt(t){const e=M.c(18),{onClick:s,isFetching:r,indented:i}=t,a=K();let o;e[0]!==a?(o=a("sidebar.showMoreButton.ariaLabel"),e[0]=a,e[1]=o):o=e[1];const c=i?"-ml-4 pl-6 pr-2":"px-2";let u;e[2]!==c?(u=ee("flex items-center gap-2 py-1.5 rounded-lg text-sm text-muted-foreground",c,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[2]=c,e[3]=u):u=e[3];let l;e[4]!==r?(l=r&&n.jsx(ve,{className:"size-3.5"}),e[4]=r,e[5]=l):l=e[5];let d;e[6]!==r||e[7]!==a?(d=a(r?"sidebar.showMoreButton.loading":"sidebar.showMoreButton.showMore"),e[6]=r,e[7]=a,e[8]=d):d=e[8];let m;e[9]!==d?(m=n.jsx("span",{children:d}),e[9]=d,e[10]=m):m=e[10];let f;return e[11]!==r||e[12]!==s||e[13]!==o||e[14]!==u||e[15]!==l||e[16]!==m?(f=n.jsxs("button",{type:"button","aria-label":o,onClick:s,disabled:r,className:u,children:[l,m]}),e[11]=r,e[12]=s,e[13]=o,e[14]=u,e[15]=l,e[16]=m,e[17]=f):f=e[17],f}function Ca(t,e,s,r){return[t,e,s,r.type,r.member,r.currentUserId??""].join("|")}function Pa(t){return t.member==="mine"&&!t.currentUserId}const Ht=4;let _e=0;const Ke=[];function Ia(){for(;_e<Ht&&Ke.length>0;){const t=Ke.shift();t&&t()}}function Ut(t){return new Promise((e,s)=>{const r=()=>{_e++,t().then(e,s).finally(()=>{_e--,Ia()})};_e<Ht?r():Ke.push(r)})}const Be=10;function ut(t,e,s,r,i){const a={hidden:!1};r.member==="mine"&&r.currentUserId&&(a.created_by=r.currentUserId),r.type==="automation"&&(a.has_trigger=!0),r.type==="manual"&&(a.has_trigger=!1);const o={where:a,limit:i,offset:s,orderBy:[{field:["updated_at"],direction:"desc"}]};return o.status=e,o}function Aa(t,e,s,r){let i=0;for(const a of t)Kt(a,e,s,r)&&i++;return i}function He(t,e,s,r){return Aa(t,e,s,r)}function Ma(t,e){return!!(t>=Be||t===0&&e)}function ft(t,e){return t<e}function La(t,e){return e===!1?!1:e===!0?!0:t}function Kt(t,e,s,r){return!(t.hidden||(t.status??"completed")!==s||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const Pe=new Map,Ne=new Map;function $a(t,e){return e?t>=Be?!0:null:!1}function mt(t){return Pe.get(t)}function Ea(t,e){Pe.set(t,e)}function Fa(t,e,s){const r=Pe.get(t);if(r!==void 0){s(r);return}let i=Ne.get(t);i||(i=Ut(e).then(a=>(Pe.set(t,a),Ne.delete(t),a)).catch(()=>(Ne.delete(t),Promise.reject(new Error("group probe failed")))),Ne.set(t,i)),i.then(s,()=>s(!1))}function ht(t){const e=t,s=Array.isArray(e.items)?e.items:[];return{items:s,hasMore:e.hasMore??s.length===Be,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Ra(t,e,s,r,i){let a=0;for(const o of t)e.has(o.id)||Kt(o,s,r,i)&&a++;return a}function Oa(t,e,s,r){const i=M.c(8),{org:a}=ne(),o=Ca(a.id,t,e,s);let c;i[0]!==s?(c=Pa(s),i[0]=s,i[1]=c):c=i[1];const u=c,[l,d]=B.useState({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});l.identity!==o&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});const m=Je(),{threads:f,hasMore:h}=Qe(),j=He(f,t,e,s),k=Ma(j,h),v=$a(j,h),x=Ie();if(l.identity===o&&l.serverHasMore===null){const N=v??mt(o);N!==void 0&&d({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:l.probeSubscribedIdentity,serverHasMore:N})}!u&&l.identity===o&&l.serverHasMore===null&&v===null&&mt(o)===void 0&&l.probeSubscribedIdentity!==o&&(d(N=>N.identity===o?{...N,isProbing:!0,probeSubscribedIdentity:o}:N),Fa(o,async()=>{const N=ut(t,e,0,s,1),T=await x.call("COLLECTION_THREADS_LIST",N),{totalCount:_}=ht(T),w=He(m.threads.get(),t,e,s);return _===void 0?!1:ft(w,_)},N=>{d(T=>T.identity!==o?T:{...T,isProbing:!1,serverHasMore:N})}));const b=async function(){if(l.isFetching||l.isProbing||u)return;const T=o;d(_=>_.identity===T?{..._,isFetching:!0}:_);try{const _=He(f,t,e,s),w=ut(t,e,_,s,Be),I=await Ut(()=>x.call("COLLECTION_THREADS_LIST",w)),{items:P,hasMore:L,totalCount:$}=ht(I),E=new Set(f.map(Ba)),F=Ra(P,E,t,e,s),R=_;m.mergeThreads(P),d(A=>{if(A.identity!==T)return A;let C;return $!==void 0?C=ft(R+F,$):C=P.length===0||F===0?!1:L,Ea(T,C),{...A,isFetching:!1,serverHasMore:C}})}catch(_){const w=_,I=w instanceof Error?w.message:String(w);Xt.error(`Could not load more tasks: ${I}`),d(P=>P.identity===T?{...P,isFetching:!1}:P)}},y=l.isFetching||l.isProbing,p=!u&&!y&&La(k,l.serverHasMore);let S;return i[2]!==y||i[3]!==b||i[4]!==p||i[5]!==l.isProbing||i[6]!==l.serverHasMore?(S={hasMore:p,isFetching:y,isProbing:l.isProbing,serverHasMore:l.serverHasMore,loadMore:b},i[2]=y,i[3]=b,i[4]=p,i[5]=l.isProbing,i[6]=l.serverHasMore,i[7]=S):S=i[7],S}function Ba(t){return t.id}function Da(t){const e=M.c(20),{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u}=t,{isFetching:l,isProbing:d,loadMore:m,hasMore:f,serverHasMore:h}=Oa("status",s,u),[j,k]=B.useState(!1);!j&&r.length===0&&h===!0&&!l&&!d&&(k(!0),queueMicrotask(()=>{m()}));let v;if(e[0]!==i||e[1]!==c||e[2]!==u||e[3]!==o||e[4]!==a||e[5]!==r){let b;e[7]!==i||e[8]!==c||e[9]!==u||e[10]!==o||e[11]!==a?(b=y=>n.jsx(zt,{task:y,isActive:i===y.id,onClick:()=>a(y),onArchive:c&&y.created_by===u.currentUserId?()=>o(y):void 0,showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},y.id),e[7]=i,e[8]=c,e[9]=u,e[10]=o,e[11]=a,e[12]=b):b=e[12],v=r.map(b),e[0]=i,e[1]=c,e[2]=u,e[3]=o,e[4]=a,e[5]=r,e[6]=v}else v=e[6];let x;e[13]!==f||e[14]!==l||e[15]!==m?(x=(f||l)&&n.jsx(Gt,{onClick:()=>{m()},isFetching:l,indented:!0}),e[13]=f,e[14]=l,e[15]=m,e[16]=x):x=e[16];let g;return e[17]!==v||e[18]!==x?(g=n.jsxs(n.Fragment,{children:[v,x]}),e[17]=v,e[18]=x,e[19]=g):g=e[19],g}function za(t){const e=M.c(43),{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u}=t,l=K(),d=kn[s],m=d.icon,[f,h]=wa(`status-${s}`,!1);let j;e[0]!==f||e[1]!==h?(j=function(){h(!f)},e[0]=f,e[1]=h,e[2]=j):j=e[2];const k=j;let v;e[3]!==d.labelKey||e[4]!==l?(v=l("sidebar.taskGroupsList.toggleStatusGroup",{status:l(d.labelKey)}),e[3]=d.labelKey,e[4]=l,e[5]=v):v=e[5];let x;e[6]!==k?(x=I=>{I.target===I.currentTarget&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),k())},e[6]=k,e[7]=x):x=e[7];let g;e[8]!==m||e[9]!==d.iconClassName?(g=n.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:n.jsx(m,{size:12,className:d.iconClassName})}),e[8]=m,e[9]=d.iconClassName,e[10]=g):g=e[10];let b;e[11]!==f?(b=n.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:f?n.jsx(Ye,{size:14}):n.jsx(es,{size:14})}),e[11]=f,e[12]=b):b=e[12];let y;e[13]!==g||e[14]!==b?(y=n.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[g,b]}),e[13]=g,e[14]=b,e[15]=y):y=e[15];let p;e[16]!==d.labelKey||e[17]!==l?(p=l(d.labelKey),e[16]=d.labelKey,e[17]=l,e[18]=p):p=e[18];let S;e[19]!==p?(S=n.jsx("span",{className:"flex-1 truncate",children:p}),e[19]=p,e[20]=S):S=e[20];let N;e[21]!==r.length?(N=n.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:n.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[21]=r.length,e[22]=N):N=e[22];let T;e[23]!==f||e[24]!==k||e[25]!==v||e[26]!==x||e[27]!==y||e[28]!==S||e[29]!==N?(T=n.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":f,"aria-label":v,onClick:k,onKeyDown:x,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-lg text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[y,S,N]}),e[23]=f,e[24]=k,e[25]=v,e[26]=x,e[27]=y,e[28]=S,e[29]=N,e[30]=T):T=e[30];let _;e[31]!==i||e[32]!==c||e[33]!==f||e[34]!==u||e[35]!==o||e[36]!==a||e[37]!==s||e[38]!==r?(_=f&&n.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:n.jsx(Da,{status:s,threads:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:c,filters:u})}),e[31]=i,e[32]=c,e[33]=f,e[34]=u,e[35]=o,e[36]=a,e[37]=s,e[38]=r,e[39]=_):_=e[39];let w;return e[40]!==T||e[41]!==_?(w=n.jsxs("div",{className:"flex flex-col gap-0.5",children:[T,_]}),e[40]=T,e[41]=_,e[42]=w):w=e[42],w}function Ga(t){const e=M.c(41),{threads:s,groupBy:r,activeTaskId:i,onSelectTask:a,onArchiveTask:o,filters:c,hasMore:u,isFetchingMore:l,onLoadMore:d,filtersActive:m}=t,f=K();if(s.length===0&&!u&&!l){let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(hs,{className:"size-6 opacity-60"}),e[0]=x):x=e[0];let g;e[1]!==m||e[2]!==f?(g=f(m?"sidebar.myThreadsSection.noChatsMatchFilters":"sidebar.myThreadsSection.noChatsYet"),e[1]=m,e[2]=f,e[3]=g):g=e[3];let b;return e[4]!==g?(b=n.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[x,n.jsx("p",{className:"text-sm",children:g})]}),e[4]=g,e[5]=b):b=e[5],b}const h=s.length>1||u;if(r==="status"){let x;if(e[6]!==i||e[7]!==h||e[8]!==c||e[9]!==o||e[10]!==a||e[11]!==s){let b;e[13]!==i||e[14]!==h||e[15]!==c||e[16]!==o||e[17]!==a?(b=y=>n.jsx(za,{status:y.status,threads:y.threads,activeTaskId:i,onSelectTask:a,onArchiveTask:o,canArchive:h,filters:c},y.status),e[13]=i,e[14]=h,e[15]=c,e[16]=o,e[17]=a,e[18]=b):b=e[18],x=Na(s).map(b),e[6]=i,e[7]=h,e[8]=c,e[9]=o,e[10]=a,e[11]=s,e[12]=x}else x=e[12];let g;return e[19]!==x?(g=n.jsx(n.Fragment,{children:x}),e[19]=x,e[20]=g):g=e[20],g}let j;if(e[21]!==i||e[22]!==h||e[23]!==c||e[24]!==o||e[25]!==a||e[26]!==s){let x;e[28]!==i||e[29]!==h||e[30]!==c||e[31]!==o||e[32]!==a?(x=g=>n.jsx(zt,{task:g,isActive:i===g.id,onClick:()=>a(g),onArchive:h&&g.created_by===c.currentUserId?()=>o(g):void 0,showAutomationBadge:!!g.trigger_id,showAgentIcon:!0},g.id),e[28]=i,e[29]=h,e[30]=c,e[31]=o,e[32]=a,e[33]=x):x=e[33],j=s.map(x),e[21]=i,e[22]=h,e[23]=c,e[24]=o,e[25]=a,e[26]=s,e[27]=j}else j=e[27];let k;e[34]!==u||e[35]!==l||e[36]!==d?(k=(u||l)&&n.jsx(Gt,{onClick:d,isFetching:l}),e[34]=u,e[35]=l,e[36]=d,e[37]=k):k=e[37];let v;return e[38]!==j||e[39]!==k?(v=n.jsxs(n.Fragment,{children:[j,k]}),e[38]=j,e[39]=k,e[40]=v):v=e[40],v}function Ha(t){const e=M.c(11),{panel:s}=t;let r;return e[0]!==s.activeTaskId||e[1]!==s.archiveTask||e[2]!==s.filters||e[3]!==s.filtersActive||e[4]!==s.groupBy||e[5]!==s.hasMore||e[6]!==s.isFetchingMore||e[7]!==s.loadMore||e[8]!==s.selectTask||e[9]!==s.threads?(r=n.jsx(Ga,{threads:s.threads,groupBy:s.groupBy,activeTaskId:s.activeTaskId,onSelectTask:s.selectTask,onArchiveTask:s.archiveTask,filters:s.filters,hasMore:s.hasMore,isFetchingMore:s.isFetchingMore,onLoadMore:s.loadMore,filtersActive:s.filtersActive}),e[0]=s.activeTaskId,e[1]=s.archiveTask,e[2]=s.filters,e[3]=s.filtersActive,e[4]=s.groupBy,e[5]=s.hasMore,e[6]=s.isFetchingMore,e[7]=s.loadMore,e[8]=s.selectTask,e[9]=s.threads,e[10]=r):r=e[10],r}function Ua(t){const e=M.c(67);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const{onNavigate:r}=s,{data:i}=pe.useSession(),a=i?.user?.id,{org:o}=ne();let c;e[2]!==o.id?(c=je(o.id),e[2]=o.id,e[3]=c):c=e[3];const u=c.id,l=ba(),d=St(),{threads:m,hasMore:f,isFetchingMore:h,fetchNextPage:j}=Qe(),k=m.filter(Wa),{hide:v,setScope:x}=Xe(),g=Me(),{setTaskId:b,createNewTask:y}=Ze(),p=Et(),S=et();let N;e[4]!==S||e[5]!==m||e[6]!==p?(N=fn({routeAgentId:p,threadVirtualMcpId:m.find(U=>U.id===S)?.virtual_mcp_id}),e[4]=S,e[5]=m,e[6]=p,e[7]=N):N=e[7];const T=N;let _;e[8]!==r?(_=()=>{r?.()},e[8]=r,e[9]=_):_=e[9];const w=_,I=[...k].sort(qa),[P,L]=B.useState("all"),[$,E]=B.useState("flat"),[F,R]=xt("sidebar-threads-scope-all",!1),[A,C]=B.useState(!1),[G,z]=B.useState(!1);let H;e[10]!==C?(H=()=>{he("tasks_panel_search_opened"),z(!0),C(!0)},e[10]=C,e[11]=H):H=e[11];const O=H,V=a??null;let Z;e[12]!==V||e[13]!==P?(Z={type:P,member:"mine",currentUserId:V},e[12]=V,e[13]=P,e[14]=Z):Z=e[14];const Y=Z,J={};F||(J.created_by="me"),x(J);let q;e[15]!==a?(q=U=>a?U.filter(ue=>ue.created_by===a):[],e[15]=a,e[16]=q):q=e[16];const le=q;let D;e[17]!==P?(D=U=>P==="automation"?U.filter(Va):P==="manual"?U.filter(Ka):U,e[17]=P,e[18]=D):D=e[18];const re=D,Q=ga(re(F?I:le(I)),S);let X;e[19]!==S||e[20]!==w||e[21]!==a||e[22]!==v||e[23]!==g||e[24]!==o.slug||e[25]!==b||e[26]!==Q?(X=U=>{if(a&&U.created_by&&U.created_by!==a)return;const ue=U.id===S;if(v(U.id),Hs(U.id),!ue)return;const ge=Sa(Q,U.id,a);w(),ge?b(ge.id,ge.virtual_mcp_id):g({to:"/$org",params:{org:o.slug}})},e[19]=S,e[20]=w,e[21]=a,e[22]=v,e[23]=g,e[24]=o.slug,e[25]=b,e[26]=Q,e[27]=X):X=e[27];const te=X;let ae;e[28]!==w||e[29]!==b?(ae=U=>{w(),b(U.id,U.virtual_mcp_id)},e[28]=w,e[29]=b,e[30]=ae):ae=e[30];const ie=ae;let se;e[31]!==T||e[32]!==S||e[33]!==m||e[34]!==w||e[35]!==y||e[36]!==a||e[37]!==u||e[38]!==l||e[39]!==d||e[40]!==b?(se=()=>{const U=T??u;he("sidebar_new_thread_clicked",{virtual_mcp_id:U}),w();const ue=nn(m,U,a,l(U));if(ue){b(ue.id,ue.virtual_mcp_id);return}const ge=d?null:m.find(Vt=>Vt.id===S)?.branch??null;y(U,ge)},e[31]=T,e[32]=S,e[33]=m,e[34]=w,e[35]=y,e[36]=a,e[37]=u,e[38]=l,e[39]=d,e[40]=b,e[41]=se):se=e[41];const oe=se;let ce;e[42]!==j?(ce=()=>{j()},e[42]=j,e[43]=ce):ce=e[43];const xe=$!=="flat"||P!=="all"||F;let de;e[44]!==G||e[45]!==A||e[46]!==C?(de=G?n.jsx(ja,{open:A,onOpenChange:C}):null,e[44]=G,e[45]=A,e[46]=C,e[47]=de):de=e[47];let Te;return e[48]!==S||e[49]!==te||e[50]!==Y||e[51]!==$||e[52]!==f||e[53]!==h||e[54]!==oe||e[55]!==O||e[56]!==ie||e[57]!==E||e[58]!==R||e[59]!==L||e[60]!==F||e[61]!==ce||e[62]!==xe||e[63]!==de||e[64]!==P||e[65]!==Q?(Te={threads:Q,activeTaskId:S,filters:Y,hasMore:f,isFetchingMore:h,loadMore:ce,groupBy:$,setGroupBy:E,typeFilter:P,setTypeFilter:L,showAll:F,setShowAll:R,filtersActive:xe,selectTask:ie,archiveTask:te,newThread:oe,openSearch:O,searchDialog:de},e[48]=S,e[49]=te,e[50]=Y,e[51]=$,e[52]=f,e[53]=h,e[54]=oe,e[55]=O,e[56]=ie,e[57]=E,e[58]=R,e[59]=L,e[60]=F,e[61]=ce,e[62]=xe,e[63]=de,e[64]=P,e[65]=Q,e[66]=Te):Te=e[66],Te}function Ka(t){return!t.trigger_id}function Va(t){return!!t.trigger_id}function qa(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Wa(t){return!t.hidden}function Ya(){const t=M.c(59),e=K(),[s,r]=B.useState(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={onNavigate:()=>r(!1)},t[0]=i):i=t[0];const a=Ua(i),o=$e()?.activeTask;let c;t[1]!==o?.title||t[2]!==a.activeTaskId||t[3]!==a.threads||t[4]!==e?(c=o?.title||a.threads.find(A=>A.id===a.activeTaskId)?.title||e("tasksPanel.taskRow.untitledTask"),t[1]=o?.title,t[2]=a.activeTaskId,t[3]=a.threads,t[4]=e,t[5]=c):c=t[5];const u=c;let l;t[6]!==a?(l=()=>{r(!1),a.openSearch()},t[6]=a,t[7]=l):l=t[7];const d=l;let m;t[8]!==e?(m=e("chat.threadsMenu.chats"),t[8]=e,t[9]=m):m=t[9];const f=s&&"bg-sidebar-accent";let h;t[10]!==f?(h=ee("flex h-[34px] min-w-0 shrink items-center gap-1.5 rounded-lg px-2 text-sm text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",f),t[10]=f,t[11]=h):h=t[11];let j;t[12]===Symbol.for("react.memo_cache_sentinel")?(j=n.jsx(ps,{size:16,className:"shrink-0"}),t[12]=j):j=t[12];let k;t[13]!==u?(k=n.jsx("span",{className:"truncate max-w-[10rem] font-medium",children:u}),t[13]=u,t[14]=k):k=t[14];let v;t[15]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ye,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),t[15]=v):v=t[15];let x;t[16]!==m||t[17]!==h||t[18]!==k?(x=n.jsx(Fe,{asChild:!0,children:n.jsx(Mt,{asChild:!0,children:n.jsxs("button",{type:"button","aria-label":m,className:h,children:[j,k,v]})})}),t[16]=m,t[17]=h,t[18]=k,t[19]=x):x=t[19];let g;t[20]!==e?(g=e("chat.threadsMenu.chats"),t[20]=e,t[21]=g):g=t[21];let b;t[22]!==g?(b=n.jsx(Re,{side:"bottom",children:g}),t[22]=g,t[23]=b):b=t[23];let y;t[24]!==b||t[25]!==x?(y=n.jsxs(Oe,{children:[x,b]}),t[24]=b,t[25]=x,t[26]=y):y=t[26];let p;t[27]!==a?(p=n.jsx(xa,{panel:a,className:"size-8"}),t[27]=a,t[28]=p):p=t[28];let S;t[29]!==e?(S=e("sidebar.taskGroupsList.searchChats"),t[29]=e,t[30]=S):S=t[30];let N;t[31]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(xs,{size:16}),t[31]=N):N=t[31];let T;t[32]!==d||t[33]!==S?(T=n.jsx(we,{"aria-label":S,onClick:d,className:"size-8",children:N}),t[32]=d,t[33]=S,t[34]=T):T=t[34];let _;t[35]!==e?(_=e("sidebar.taskGroupsList.newChat"),t[35]=e,t[36]=_):_=t[36];let w;t[37]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(bt,{size:16}),t[37]=w):w=t[37];let I;t[38]!==a.newThread||t[39]!==_?(I=n.jsx(we,{"aria-label":_,onClick:a.newThread,className:"size-8",children:w}),t[38]=a.newThread,t[39]=_,t[40]=I):I=t[40];let P;t[41]!==T||t[42]!==I?(P=n.jsxs("div",{className:"flex items-center gap-0.5",children:[T,I]}),t[41]=T,t[42]=I,t[43]=P):P=t[43];let L;t[44]!==p||t[45]!==P?(L=n.jsxs("div",{className:"flex shrink-0 items-center justify-between",children:[p,P]}),t[44]=p,t[45]=P,t[46]=L):L=t[46];let $;t[47]!==a?($=n.jsx("div",{className:"flex max-h-[60vh] min-h-0 flex-col gap-0.5 overflow-y-auto overscroll-contain",children:n.jsx(Ha,{panel:a})}),t[47]=a,t[48]=$):$=t[48];let E;t[49]!==L||t[50]!==$?(E=n.jsxs(Lt,{align:"start",side:"bottom",onOpenAutoFocus:Za,className:"flex w-80 flex-col gap-2 p-2",children:[L,$]}),t[49]=L,t[50]=$,t[51]=E):E=t[51];let F;t[52]!==s||t[53]!==y||t[54]!==E?(F=n.jsxs($t,{open:s,onOpenChange:r,children:[y,E]}),t[52]=s,t[53]=y,t[54]=E,t[55]=F):F=t[55];let R;return t[56]!==a.searchDialog||t[57]!==F?(R=n.jsxs(n.Fragment,{children:[F,a.searchDialog]}),t[56]=a.searchDialog,t[57]=F,t[58]=R):R=t[58],R}function Za(t){return t.preventDefault()}function Ja(){const t=M.c(20),e=K(),{threads:s}=Qe(),{createNewTask:r}=Ze(),i=Ft(),a=et();let o;t[0]!==a||t[1]!==s?(o=s.find(v=>v.id===a)?.branch??null,t[0]=a,t[1]=s,t[2]=o):o=t[2];const c=o;let u;t[3]!==i||t[4]!==r||t[5]!==c?(u=()=>{r(i,c)},t[3]=i,t[4]=r,t[5]=c,t[6]=u):u=t[6];const l=u;let d;t[7]!==e?(d=e("sidebar.taskGroupsList.newChat"),t[7]=e,t[8]=d):d=t[8];let m;t[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(bt,{size:16}),t[9]=m):m=t[9];let f;t[10]!==l||t[11]!==d?(f=n.jsx(Fe,{asChild:!0,children:n.jsx("button",{type:"button",onClick:l,"aria-label":d,className:"flex shrink-0 items-center rounded-lg p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:m})}),t[10]=l,t[11]=d,t[12]=f):f=t[12];let h;t[13]!==e?(h=e("sidebar.taskGroupsList.newChat"),t[13]=e,t[14]=h):h=t[14];let j;t[15]!==h?(j=n.jsx(Re,{side:"bottom",children:h}),t[15]=h,t[16]=j):j=t[16];let k;return t[17]!==f||t[18]!==j?(k=n.jsxs(Oe,{children:[f,j]}),t[17]=f,t[18]=j,t[19]=k):k=t[19],k}function Qa(t){const e=M.c(18),{virtualMcp:s}=t,r=K(),i=Tt(),{navigateToTask:a}=Nn(),{create:o}=Xe(),c=ts(),{org:u}=ne();let l,d;if(e[0]!==i||e[1]!==o||e[2]!==a||e[3]!==u||e[4]!==c||e[5]!==r||e[6]!==s){d=Symbol.for("react.early_return_sentinel");e:{const m=Ws(s,i);if(!m){d=null;break e}const f=m.mode==="dev";let h;e[9]!==o||e[10]!==a||e[11]!==u||e[12]!==c?(h=async b=>{const y=crypto.randomUUID();await Promise.all([o({id:y,virtual_mcp_id:b}).catch(er),Rs(c,u,b).catch(Xa)]),a(y,{virtualMcpId:b})},e[9]=o,e[10]=a,e[11]=u,e[12]=c,e[13]=h):h=e[13];const j=h,k=(b,y,p)=>n.jsxs("button",{type:"button","aria-pressed":y,"aria-label":b,title:b,onClick:()=>{y||j(m.targetId)},className:ee("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg transition-colors",y?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[n.jsx(p,{className:"size-3.5 shrink-0"}),n.jsx("span",{className:"@max-3xl/panel-header:hidden",children:b})]});let v;e[14]!==r?(v=r("devAgent.devAgentControl.develop"),e[14]=r,e[15]=v):v=e[15];const x=k(v,f,gs);let g;e[16]!==r?(g=r("devAgent.devAgentControl.live"),e[16]=r,e[17]=g):g=e[17],l=n.jsxs("div",{className:"inline-flex items-center rounded-lg border border-border bg-muted p-0.5 text-xs font-medium",children:[x,k(g,!f,bs)]})}e[0]=i,e[1]=o,e[2]=a,e[3]=u,e[4]=c,e[5]=r,e[6]=s,e[7]=l,e[8]=d}else l=e[7],d=e[8];return d!==Symbol.for("react.early_return_sentinel")?d:l}function Xa(){}function er(){}function tr(t){const e=M.c(16),{virtualMcpId:s,taskId:r}=t,{openPanel:i}=Ot();let a;e[0]!==r||e[1]!==s?(a={virtualMcpId:s,taskId:r},e[0]=r,e[1]=s,e[2]=a):a=e[2];const{tabs:o,activeTab:c,mainOpen:u}=Bt(a);if(o.length===0)return null;let l;if(e[3]!==c||e[4]!==u||e[5]!==i||e[6]!==o||e[7]!==s){let m;e[9]!==c||e[10]!==u||e[11]!==i||e[12]!==s?(m=f=>{const h=f.id==="automations"?ss({activeTab:c,mainOpen:u}):u&&f.id===c;return n.jsxs(st.Tab,{active:h,onClick:()=>{h||(he("main_panel_tab_clicked",{virtual_mcp_id:s,tab_id:f.id,tab_kind:f.kind,was_active:!1}),i(f.id))},children:[n.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(Ce,{icon:f.icon})}),f.title]},f.id)},e[9]=c,e[10]=u,e[11]=i,e[12]=s,e[13]=m):m=e[13],l=o.map(m),e[3]=c,e[4]=u,e[5]=i,e[6]=o,e[7]=s,e[8]=l}else l=e[8];let d;return e[14]!==l?(d=n.jsx(st.Tabs,{"data-tour":Us.surfaceTabs,children:l}),e[14]=l,e[15]=d):d=e[15],d}function sr(t){return{threadId:t.routeThreadId,providerKey:t.routeThreadId??t.fallbackKey}}const Ue="__mobile-main-panel-tab-select__",Ve="main";function nr({tabs:t,activeTab:e,mainOpen:s,t:r}){const i=t.find(o=>o.id===e),a=r("mainPanelTabs.mobileMainPanelTabSelect.mainView");return s?i?.title??a:i?.title??t[0]?.title??a}const ar={kind:"component",Component:vs},rr={kind:"component",Component:ys},ir={kind:"component",Component:js},lr={kind:"component",Component:wn};function or({tabs:t,overlayEnabled:e,t:s}){return[{value:"chat",title:s("mainPanelTabs.mobileMainPanelTabSelect.chat"),icon:ar},...t.length>0?t.map(r=>({value:r.id,title:r.title,icon:r.icon})):[{value:Ve,title:s("mainPanelTabs.mobileMainPanelTabSelect.mainView"),icon:lr}],...e?[{value:"board",title:s("mainPanelTabs.mobileMainPanelTabSelect.tasks"),icon:rr},{value:"files",title:s("mainPanelTabs.mobileMainPanelTabSelect.library"),icon:ir}]:[]]}function cr(t){const e=M.c(53),{virtualMcpId:s,taskId:r}=t,i=K(),a=Me(),{openPanel:o}=Ot();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={strict:!1},e[0]=c):c=e[0];const u=ke(c);let l;e[1]!==r||e[2]!==s?(l={virtualMcpId:s,taskId:r},e[1]=r,e[2]=s,e[3]=l):l=e[3];const{tabs:d,activeTab:m,mainOpen:f}=Bt(l),{org:h}=ne(),j=Es();let k;e[4]!==h.id?(k=nt(h.id),e[4]=h.id,e[5]=k):k=e[5];const v=s===k;let x,g,b,y,p,S,N,T,_,w;if(e[6]!==m||e[7]!==f||e[8]!==a||e[9]!==v||e[10]!==o||e[11]!==h.id||e[12]!==u.org||e[13]!==u.taskId||e[14]!==j||e[15]!==i||e[16]!==d||e[17]!==s){y=Symbol.for("react.early_return_sentinel");e:{const L=or({tabs:d,overlayEnabled:!!(u.org&&u.taskId),t:i}),$=f?L.find(O=>O.value===m)?.value??Ve:"chat",E=L.find(O=>O.value===$),F=E?.title??nr({tabs:d,activeTab:m,mainOpen:f,t:i});let R;e[28]!==a?(R=O=>{a({to:".",search:V=>({...V,...Ys(O)}),replace:!0})},e[28]=a,e[29]=R):R=e[29];const A=R;let C;e[30]!==v||e[31]!==o||e[32]!==h.id||e[33]!==j||e[34]!==A||e[35]!==s?(C=O=>{if(O!==Ue){if(he("main_panel_tab_clicked",{virtual_mcp_id:s,tab_id:O,source:"mobile_select"}),Ks({reportsOnly:j,onReportAgent:v,tabId:O})){o(O,{virtualmcpid:nt(h.id),search:fr});return}if(O==="chat"||O===Ve){A(O==="chat"?"chat":"main");return}o(O,{search:ur})}},e[30]=v,e[31]=o,e[32]=h.id,e[33]=j,e[34]=A,e[35]=s,e[36]=C):C=e[36];const G=C,z=L.find(O=>O.value!==$);if(L.length===2&&z){y=n.jsxs("button",{type:"button",onClick:()=>G(z.value),"aria-label":i("mainPanelTabs.mobileMainPanelTabSelect.switchTo",{name:z.title}),className:"flex h-10 min-w-0 max-w-[7.5rem] items-center gap-1.5 rounded-lg px-1.5 text-xs text-foreground transition-colors hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(Ce,{icon:z.icon,className:"size-5"})}),n.jsx("span",{className:"min-w-0 truncate",children:z.title})]});break e}g=Pn,_=Ue,w=G;let H;e[37]!==i?(H=i("mainPanelTabs.mobileMainPanelTabSelect.view"),e[37]=i,e[38]=H):H=e[38],b=n.jsx(Cn,{"aria-label":H,className:"h-10! w-full min-w-0 max-w-[7.5rem] rounded-lg border-0 bg-transparent px-1.5 text-xs shadow-none [--card-shadow:none]",children:n.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[E&&n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(Ce,{icon:E.icon,className:"size-5"})}),n.jsx("span",{className:"min-w-0 truncate",children:F})]})}),x=In,p="end",S="w-56",e[39]!==F?(N=n.jsx(Dt,{value:Ue,disabled:!0,hideCheck:!0,className:"hidden",children:F}),e[39]=F,e[40]=N):N=e[40],T=L.map(dr)}e[6]=m,e[7]=f,e[8]=a,e[9]=v,e[10]=o,e[11]=h.id,e[12]=u.org,e[13]=u.taskId,e[14]=j,e[15]=i,e[16]=d,e[17]=s,e[18]=x,e[19]=g,e[20]=b,e[21]=y,e[22]=p,e[23]=S,e[24]=N,e[25]=T,e[26]=_,e[27]=w}else x=e[18],g=e[19],b=e[20],y=e[21],p=e[22],S=e[23],N=e[24],T=e[25],_=e[26],w=e[27];if(y!==Symbol.for("react.early_return_sentinel"))return y;let I;e[41]!==x||e[42]!==p||e[43]!==S||e[44]!==N||e[45]!==T?(I=n.jsxs(x,{align:p,className:S,children:[N,T]}),e[41]=x,e[42]=p,e[43]=S,e[44]=N,e[45]=T,e[46]=I):I=e[46];let P;return e[47]!==g||e[48]!==b||e[49]!==I||e[50]!==_||e[51]!==w?(P=n.jsxs(g,{value:_,onValueChange:w,children:[b,I]}),e[47]=g,e[48]=b,e[49]=I,e[50]=_,e[51]=w,e[52]=P):P=e[52],P}function dr(t){return n.jsx(Dt,{value:t.value,children:n.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[n.jsx("span",{className:"flex size-5 shrink-0 items-center justify-center",children:n.jsx(Ce,{icon:t.icon})}),n.jsx("span",{className:"min-w-0 truncate",children:t.title})]})},t.value)}function ur(t){return{...t,sidepanel:!1}}function fr(t){return{...t,thread:void 0,sidepanel:!1}}function mr(t,e,s){const r=M.c(33),i=Je(),{locator:a}=ne(),o=B.useSyncExternalStore(i.threads.subscribe,i.threads.get),c=B.useSyncExternalStore(i.threadsStatus.subscribe,i.threadsStatus.get);let u;r[0]!==t||r[1]!==o?(u=t===null?null:o.find(p=>p.id===t&&!p.partial)??null,r[0]=t,r[1]=o,r[2]=u):u=r[2];const l=u,[d,m]=B.useState(void 0),[f,h]=B.useState(t);f!==t&&(h(t),m(void 0));let j,k;r[3]!==d||r[4]!==t||r[5]!==l||r[6]!==i||r[7]!==c.kind?(j=()=>{t!==null&&(l||c.kind!=="loading"&&d===void 0&&(m("pending"),i.fetchThreadIntoSlot(t).then(p=>{m(p)})))},k=[t,l,c.kind,d,i],r[3]=d,r[4]=t,r[5]=l,r[6]=i,r[7]=c.kind,r[8]=j,r[9]=k):(j=r[8],k=r[9]),B.useEffect(j,k);let v;r[10]!==s||r[11]!==a||r[12]!==i||r[13]!==e?(v={mutationFn:async p=>i.create({id:p,virtual_mcp_id:e,...s?{branch:s}:{},...sn(sessionStorage,a,p)})},r[10]=s,r[11]=a,r[12]=i,r[13]=e,r[14]=v):v=r[14];const x=ns(v);let g,b;if(r[15]!==x||r[16]!==d||r[17]!==t||r[18]!==l||r[19]!==c.kind?(g=()=>{t!==null&&(l||d===null&&c.kind!=="loading"&&(x.isPending||x.variables!==t&&x.mutate(t)))},b=[t,l,d,c.kind,x],r[15]=x,r[16]=d,r[17]=t,r[18]=l,r[19]=c.kind,r[20]=g,r[21]=b):(g=r[20],b=r[21]),B.useEffect(g,b),t===null){let p;return r[22]===Symbol.for("react.memo_cache_sentinel")?(p={status:"ready",task:null},r[22]=p):p=r[22],p}if(l){let p;return r[23]!==l?(p={status:"ready",task:l},r[23]=l,r[24]=p):p=r[24],p}if(d&&typeof d=="object"){let p;return r[25]!==d?(p={status:"ready",task:d},r[25]=d,r[26]=p):p=r[26],p}if(x.data){let p;return r[27]!==x.data?(p={status:"ready",task:x.data},r[27]=x.data,r[28]=p):p=r[28],p}if(x.isError){let p;return r[29]!==x.error?(p={status:"error",error:x.error},r[29]=x.error,r[30]=p):p=r[30],p}if(x.isPending||c.kind!=="loading"){let p;return r[31]===Symbol.for("react.memo_cache_sentinel")?(p={status:"creating"},r[31]=p):p=r[31],p}let y;return r[32]===Symbol.for("react.memo_cache_sentinel")?(y={status:"loading"},r[32]=y):y=r[32],y}const hr=50;function pr(t,e){const s=M.c(15),{org:r}=ne(),i=Ie(),{data:a}=pe.useSession(),o=a?.user?.id??"";let c;s[0]!==r.id||s[1]!==o||s[2]!==t?(c=fe.agentEntryThreads(r.id,o,t),s[0]=r.id,s[1]=o,s[2]=t,s[3]=c):c=s[3];const u=e&&!!o;let l;s[4]!==i||s[5]!==t?(l=async()=>{try{return(await i.call("COLLECTION_THREADS_LIST",{limit:hr,offset:0,orderBy:[{field:["updated_at"],direction:"desc"}],where:{hidden:!1,created_by:"me",virtual_mcp_id:t}})).items}catch{return[]}},s[4]=i,s[5]=t,s[6]=l):l=s[6];let d;s[7]!==c||s[8]!==u||s[9]!==l?(d={queryKey:c,enabled:u,staleTime:0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,queryFn:l},s[7]=c,s[8]=u,s[9]=l,s[10]=d):d=s[10];const m=me(d);if(!e||!o){let h;return s[11]===Symbol.for("react.memo_cache_sentinel")?(h={status:"idle"},s[11]=h):h=s[11],h}if(!m.data||m.isFetching){let h;return s[12]===Symbol.for("react.memo_cache_sentinel")?(h={status:"loading"},s[12]=h):h=s[12],h}let f;return s[13]!==m.data?(f={status:"ready",threads:m.data},s[13]=m.data,s[14]=f):f=s[14],f}function xr(t){const e=M.c(13),{children:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const i=ke(r);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[1]=a):a=e[1];const o=Le(a);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={select:gr},e[2]=c):c=e[2];const u=as(c),{org:l}=ne();let d;e[3]!==l||e[4]!==i.agentId||e[5]!==i.legacyView||e[6]!==i.org||e[7]!==u||e[8]!==o?(d=i.org?rs({pathname:u,org:i.org,pathAgentId:i.agentId,pathLegacyView:i.legacyView,fallbackAgentId:je(l.id).id,search:o}):null,e[3]=l,e[4]=i.agentId,e[5]=i.legacyView,e[6]=i.org,e[7]=u,e[8]=o,e[9]=d):d=e[9];const m=d;let f;return e[10]!==s||e[11]!==m?(f=m?n.jsx(tt,{target:m}):s,e[10]=s,e[11]=m,e[12]=f):f=e[12],f}function gr(t){return t.matches.at(-1)?.pathname??t.location.pathname}function br(){const t=M.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=ke(e);let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[1]=r):r=t[1];const i=Le(r),{org:a}=ne(),{org:o,taskId:c}=s;if(!o||c===void 0)return null;let u;return t[2]!==o||t[3]!==a.id||t[4]!==i||t[5]!==c?(u=is({org:o,taskId:c,fallbackAgentId:je(a.id).id,search:i}),t[2]=o,t[3]=a.id,t[4]=i,t[5]=c,t[6]=u):u=t[6],u}function vr(){const t=M.c(2),e=br();let s;return t[0]!==e?(s=e?n.jsx(tt,{target:e}):null,t[0]=e,t[1]=s):s=t[1],s}function yr(){const t=M.c(6),e=Mn(),s=Me();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{preview:i}=Le(r);if(!e||!i)return null;let a;t[1]!==s?(a=()=>s({to:".",search:jr}),t[1]=s,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=n.jsx(Ln,{previewPath:i,onClose:a,showSeeInLibrary:!0}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function jr(t){const{preview:e,...s}=t;return s}function kr(t){const e=M.c(11),{children:s}=t,r=K();let i;e[0]!==r?(i=r("agentShellLayout.agentShellLayout.chatLoadingError"),e[0]=r,e[1]=i):i=e[1];let a;e[2]!==i?(a=n.jsx("div",{role:"alert",className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:i}),e[2]=i,e[3]=a):a=e[3];let o;e[4]!==s?(o=s??n.jsx(ma,{}),e[4]=s,e[5]=o):o=e[5];let c;e[6]!==o?(c=n.jsx(Ae,{children:o}),e[6]=o,e[7]=c):c=e[7];let u;return e[8]!==a||e[9]!==c?(u=n.jsx(pt,{fallback:a,children:c}),e[8]=a,e[9]=c,e[10]=u):u=e[10],u}function Sr(t){const e=M.c(5),{threadId:s,children:r}=t;if(s===null){let a;return e[0]!==r?(a=n.jsx(W.ThreadlessProvider,{children:r}),e[0]=r,e[1]=a):a=e[1],a}let i;return e[2]!==r||e[3]!==s?(i=n.jsx(W.ActiveTaskProvider,{taskId:s,children:r}),e[2]=r,e[3]=s,e[4]=i):i=e[4],i}function Tr(t){const e=M.c(3),{onNewTaskRef:s,createNewTask:r}=t;let i;return e[0]!==r||e[1]!==s?(i=()=>(s.current=r,()=>{s.current=null}),e[0]=r,e[1]=s,e[2]=i):i=e[2],B.useLayoutEffect(i),null}function Nr({virtualMcpId:t,hasActiveRepository:e,sandboxMap:s,children:r}){const i=K(),{currentBranch:a,activeTask:o,setCurrentTaskBranch:c}=Ee(),{data:u}=pe.useSession(),l=u?.user?.id,d=!Ms(o?.harness_id),m=rn({agentSandboxMap:s,threadSandboxMap:o?.metadata?.sandboxMap,userId:l,ownerId:o?.created_by,branch:a}),f=e||Js(o?.metadata),h=B.useRef(null),j=d&&ln({threadLoaded:!!o,isOwner:!!l&&o?.created_by===l,hasActiveRepository:f,branch:a??null,attempted:h.current===(o?.id??null)});B.useEffect(()=>{!j||!o||(h.current=o.id,c(Ct(u?.user?.name||u?.user?.email?.split("@")[0])))},[j,o,u,c]);const k=yt(t),v=Se(t),x=It(v,a),{releases:g,createRelease:b}=Qs(t),p=!!l&&o?.created_by===l&&!!a&&a!==x&&!g.some(L=>L.branch===a),S=B.useRef(null);B.useEffect(()=>{!p||!a||S.current!==a&&(S.current=a,b({branch:a,name:en(g,i("thread.branchPicker.defaultVersionName")),color:Xs(g.length),createdBy:l,createdAt:new Date().toISOString()}).catch(()=>{}))},[p,a,g,b,l,i]);const N=k.resolved?k.runtime:null,T=on(t,a??void 0),w=(l&&a?En(m?.[l]?.[a]):{})["agent-sandbox"]??null,I=w?.previewUrl??null,P=d&&N!=="cms"&&(!!w||T);return d?N==="cms"?n.jsx(lt,{children:r},`${t}:${a??"no-branch"}:${o?.id??""}`):n.jsx(_s,{virtualMcpId:t,branch:a??null,previewUrl:I,enabled:P,children:n.jsx(cn,{executionEnabled:d,virtualMcpId:t,branch:a??null,userId:l??null,hasActiveRepository:f,vmEntry:w,threadId:o?.id??null,children:n.jsx(lt,{children:r},`${t}:${a??"no-branch"}:${o?.id??""}`)})},o?.id??"no-thread"):n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsx("div",{className:"flex h-full rounded-[0.75rem] bg-background card-shadow",children:n.jsx(At,{image:n.jsx(qe,{size:48,className:"text-muted-foreground"}),title:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWeb"),description:i("agentShellLayout.agentShellLayout.runtimeUnavailableOnWebDescription")})})})}function _r(){const t=M.c(16),e=K(),{toggleSidebar:s}=Ts(),{virtualMcpId:r,taskId:i}=Ee();let a;t[0]!==e?(a=e("layouts.shellControls.toggleSidebar"),t[0]=e,t[1]=a):a=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(ks,{size:16}),t[2]=o):o=t[2];let c;t[3]!==a||t[4]!==s?(c=n.jsx(we,{className:"md:hidden",onClick:s,"aria-label":a,children:o}),t[3]=a,t[4]=s,t[5]=c):c=t[5];let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Ya,{}),t[6]=u):u=t[6];let l;t[7]!==c?(l=n.jsxs(De.Topbar.Left,{children:[c,u]}),t[7]=c,t[8]=l):l=t[8];let d;t[9]!==i||t[10]!==r?(d=n.jsx("div",{className:"min-w-0 md:hidden",children:n.jsx(cr,{virtualMcpId:r,taskId:i})}),t[9]=i,t[10]=r,t[11]=d):d=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(De.Topbar.Right,{className:"shrink-0",children:n.jsx(Ja,{})}),t[12]=m):m=t[12];let f;return t[13]!==l||t[14]!==d?(f=n.jsxs(De.Topbar,{className:"border-b border-border/60 px-3",children:[l,d,m]}),t[13]=l,t[14]=d,t[15]=f):f=t[15],f}function wr(t){const e=M.c(25),{layout:s,onNewTaskRef:r,createNewTask:i}=t,{virtualMcpId:a,taskId:o}=Ee(),c=Se(a),u=_n()??"overview",l=Ss(),[d,m]=B.useState(null),f=d===u,h=l?f:s.threadOpen;let j;e[0]!==u||e[1]!==s||e[2]!==l||e[3]!==f?(j=l?()=>m(f?null:u):s.toggleThread,e[0]=u,e[1]=s,e[2]=l,e[3]=f,e[4]=j):j=e[4];const k=j;let v;e[5]!==i||e[6]!==r?(v=n.jsx(Tr,{onNewTaskRef:r,createNewTask:i}),e[5]=i,e[6]=r,e[7]=v):v=e[7];let x;e[8]!==o||e[9]!==a?(x=n.jsx(tr,{virtualMcpId:a,taskId:o}),e[8]=o,e[9]=a,e[10]=x):x=e[10];let g;e[11]!==c?(g=c&&n.jsx(Qa,{virtualMcp:c}),e[11]=c,e[12]=g):g=e[12];let b,y;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(it.Thread,{topbar:n.jsx(_r,{}),children:n.jsx(kr,{})}),y=n.jsx(gt,{}),e[13]=b,e[14]=y):(b=e[13],y=e[14]);let p;e[15]!==u||e[16]!==s||e[17]!==x||e[18]!==g||e[19]!==h||e[20]!==k?(p=n.jsxs(it,{...s,threadOpen:h,toggleThread:k,contentKey:u,contentNavigation:x,contentActions:g,children:[b,y]}),e[15]=u,e[16]=s,e[17]=x,e[18]=g,e[19]=h,e[20]=k,e[21]=p):p=e[21];let S;return e[22]!==v||e[23]!==p?(S=n.jsxs(n.Fragment,{children:[v,p]}),e[22]=v,e[23]=p,e[24]=S):S=e[24],S}function Cr(){const t=K(),e=Me(),s=mn(),{create:r}=Xe(),{org:i}=ne(),o=ke({strict:!1}).org??"",c=Le({strict:!1}),u=et(),l=Ft(),d=Et(),[m]=B.useState(()=>crypto.randomUUID()),{data:f}=pe.useSession(),[h]=B.useState(()=>Ct(f?.user?.name||f?.user?.email?.split("@")[0])),j=Je(),k=B.useSyncExternalStore(j.threads.subscribe,j.threads.get),v=B.useSyncExternalStore(j.threadsStatus.subscribe,j.threadsStatus.get),x=Se(l),g=!!(x&&_t(x)),b=It(x,null),y=u===null&&!!d&&!!x,p=A=>an(A,l,f?.user?.id,Pt(x?.metadata),g,{baseBranch:b}),S=y&&v.kind!=="loading"?p(k):void 0,N=pr(l,y&&v.kind!=="loading"&&!S),T=mr(u,l,h);ha(T.status==="ready"?T.task:null);const _=x?.metadata?.ui?.layout??null,w=_?{defaultMainView:_.defaultMainView??null,chatDefaultOpen:_.chatDefaultOpen??null}:null,I=Zs(w),{threadId:P,providerKey:L}=sr({routeThreadId:u,fallbackKey:m}),$=async()=>{const A=crypto.randomUUID(),C=k.find(G=>G.id===P)?.branch??null;try{await r({id:A,virtual_mcp_id:l,...C?{branch:C}:{}})}catch{}s(A,()=>({}))},E=B.useRef(null);B.useEffect(()=>{const A=C=>{Vs(C)&&C.shiftKey&&C.code==="KeyS"&&!C.repeat&&(C.preventDefault(),E.current?.())};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[]);const F=T.status==="ready"?T.task:null,R=F?.virtual_mcp_id;if(F&&R&&!hn({routeAgentId:l,threadAgentId:R})){const A=ls({org:o,agentId:R,superAgentId:je(i.id).id});return n.jsx(tt,{target:{route:A,search:{thread:F.id,sidepanel:c.sidepanel,mainpanel:c.mainpanel,autosend:c.autosend}}})}if(y){if(v.kind==="loading"||N.status==="loading")return n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsxs("div",{role:"status","aria-live":"polite",className:"flex h-full items-center justify-center bg-background card-shadow rounded-[0.75rem] text-sm text-muted-foreground",children:[n.jsx(ve,{className:"size-4 mr-2"}),t("agentShellLayout.agentShellLayout.creatingTask")]})});const C=(S??(N.status==="ready"?p(N.threads):void 0))?.id??(g?m:null);if(C)return n.jsx(os,{to:".",replace:!0,search:G=>({...G,thread:C})})}return T.status==="creating"||T.status==="loading"?n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsxs("div",{role:"status","aria-live":"polite",className:"flex h-full items-center justify-center bg-background card-shadow rounded-[0.75rem] text-sm text-muted-foreground",children:[n.jsx(ve,{className:"size-4 mr-2"}),t("agentShellLayout.agentShellLayout.creatingTask")]})}):T.status==="error"?n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsxs("div",{role:"alert",className:"flex flex-col h-full items-center justify-center gap-2 bg-background card-shadow rounded-[0.75rem] p-8 text-sm",children:[n.jsx("div",{className:"font-medium",children:t("agentShellLayout.agentShellLayout.taskUnavailable")}),n.jsx("div",{className:"text-muted-foreground",children:T.error.message})]})}):x?n.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:n.jsx(W.Provider,{virtualMcpId:l,task:T.status==="ready"?T.task:null,children:n.jsx(Is,{layout:I,children:n.jsx(Nr,{virtualMcpId:l,hasActiveRepository:g,sandboxMap:x.metadata?.sandboxMap,children:n.jsx(Sr,{threadId:P,children:n.jsx(Ae,{children:n.jsx(wr,{layout:I,onNewTaskRef:E,createNewTask:$})})},L)})})},l)}):n.jsx("div",{className:"flex-1 min-h-0 pr-1.5 pb-1.5 overflow-hidden",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(At,{image:n.jsx(qe,{size:48,className:"text-muted-foreground"}),title:t("agentShellLayout.agentShellLayout.agentNotFound"),description:t("agentShellLayout.agentShellLayout.agentNotFoundDescription",{virtualMcpId:l}),actions:n.jsx(cs,{variant:"outline",onClick:()=>e({to:"/$org",params:{org:o}}),children:t("agentShellLayout.agentShellLayout.goToOrgHome")})})})})}function Co(){const t=M.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=ke(e);if(s.taskId!==void 0){let i;return t[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(vr,{}),t[1]=i):i=t[1],i}if(s._splat!==void 0){let i;return t[2]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(gt,{}),t[2]=i):i=t[2],i}let r;return t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Ae,{children:n.jsx(xr,{children:n.jsx(An,{children:n.jsxs($n,{children:[n.jsx(Cr,{}),n.jsx(yr,{})]})})})}),t[3]=r):r=t[3],r}export{Co as default};