decocms 4.22.2 → 4.23.0

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 (225) hide show
  1. package/dist/client/assets/{AlertCircle-BWfyWgiw.js → AlertCircle-CLapFvcx.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-h5-lNOU3.js → ArrowUpRight-DYI4ZFTv.js} +1 -1
  3. package/dist/client/assets/{Check-B2t3_u8j.js → Check-CWR2GX_4.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-Cd9sCPj_.js → CheckCircle-BJr7jKsb.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CJGVvA9G.js → ChevronDown-BOnFs3ZP.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-SxNLyRA0.js → ChevronRight--Sw9cfbS.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-Cfv8kwOP.js → ChevronUp-CkMhjJB_.js} +1 -1
  8. package/dist/client/assets/{Circle-CmWJQsR2.js → Circle-CSNCa0Ai.js} +1 -1
  9. package/dist/client/assets/{Copy01-C_1mrR9P.js → Copy01-C_vDrK62.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-DQ-r-KXk.js → DotsVertical-CVxu5D2B.js} +1 -1
  11. package/dist/client/assets/{Eye-Jd91Hda4.js → Eye-DCiEQJIv.js} +1 -1
  12. package/dist/client/assets/{FilterLines-C7Zdp7-q.js → FilterLines-YtMlMBJN.js} +1 -1
  13. package/dist/client/assets/{Globe01-4bI1LBPk.js → Globe01-pYyw4zjF.js} +1 -1
  14. package/dist/client/assets/{Globe04-CPnbhr3e.js → Globe04-B5LRDZX0.js} +1 -1
  15. package/dist/client/assets/{HardDrive-WT4IA8YF.js → HardDrive-Bt_8Ilkp.js} +1 -1
  16. package/dist/client/assets/{Key01-_0kmrESm.js → Key01-BGm5x2_7.js} +1 -1
  17. package/dist/client/assets/{LayoutLeft-D_5UU_fl.js → LayoutLeft-WEbo8J87.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-CYx_LjKe.js → LinkExternal01-C9wAno25.js} +1 -1
  19. package/dist/client/assets/{List-5nWMXvgZ.js → List-wZrVQa3Y.js} +1 -1
  20. package/dist/client/assets/{Loading02-D5Q9o2ML.js → Loading02-BY5Z_ytL.js} +1 -1
  21. package/dist/client/assets/{Monitor01-EVfMwGgl.js → Monitor01-CjaozmNA.js} +1 -1
  22. package/dist/client/assets/{Palette-Cg2Il5Mo.js → Palette-DX20ptpQ.js} +1 -1
  23. package/dist/client/assets/{Play-C4pBBuTc.js → Play-DrXY2oRx.js} +1 -1
  24. package/dist/client/assets/{Plus-Cj9kK9tN.js → Plus-j1oUcvSs.js} +1 -1
  25. package/dist/client/assets/{SearchLg-JSkDDvk4.js → SearchLg-Dt-H4O3z.js} +1 -1
  26. package/dist/client/assets/{SearchMd-CP9WApAb.js → SearchMd-Cmh57xGa.js} +1 -1
  27. package/dist/client/assets/{Settings02-Bs74lw7T.js → Settings02-CtgBTtnW.js} +1 -1
  28. package/dist/client/assets/{Shield01-DMFwBOtF.js → Shield01-BsAF4snY.js} +1 -1
  29. package/dist/client/assets/{Star01-CC3gyOop.js → Star01-DgFqZM1H.js} +1 -1
  30. package/dist/client/assets/{Stars01-DKD-uu49.js → Stars01-Ch3VikRv.js} +1 -1
  31. package/dist/client/assets/{Stars02-DGriyPK-.js → Stars02-C0LkLtPv.js} +1 -1
  32. package/dist/client/assets/{Sun-DszeKWvN.js → Sun-D-D5LZ02.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-a_i15cCW.js → SwitchHorizontal01-DAV6AujY.js} +1 -1
  34. package/dist/client/assets/{Tool01-iIXzQIf6.js → Tool01-Csfd8Wry.js} +1 -1
  35. package/dist/client/assets/{Trash01-D_xTnQtW.js → Trash01-Bf3SN1nH.js} +1 -1
  36. package/dist/client/assets/{Upload01-COCQSA6j.js → Upload01-BYEqY1Ay.js} +1 -1
  37. package/dist/client/assets/{User01-DBHhpCM7.js → User01-C7pBq15o.js} +1 -1
  38. package/dist/client/assets/{Users01-BymojQtX.js → Users01-9SoD8uT4.js} +1 -1
  39. package/dist/client/assets/{Users03-Dnn-6pZq.js → Users03-kFy3UJPi.js} +1 -1
  40. package/dist/client/assets/{X-DY9hR308.js → X-C0ZgGoQb.js} +1 -1
  41. package/dist/client/assets/{XCircle-DofnF94J.js → XCircle-DRgrnFcC.js} +1 -1
  42. package/dist/client/assets/{XClose-CmiCfuv_.js → XClose-CmJ8_Kxi.js} +1 -1
  43. package/dist/client/assets/{Zap-BwbZR_TW.js → Zap-CjHl9Hth.js} +1 -1
  44. package/dist/client/assets/{ZapSquare-B7pUKk1h.js → ZapSquare-BtUSi6w5.js} +1 -1
  45. package/dist/client/assets/{ZoomOut-B3kimgA9.js → ZoomOut-B4weRH-H.js} +1 -1
  46. package/dist/client/assets/{access-gate-BOS773UI.js → access-gate-DPOW1JQt.js} +1 -1
  47. package/dist/client/assets/{add-section-modal-Z7yIxDfk.js → add-section-modal-2t6y9pJq.js} +1 -1
  48. package/dist/client/assets/{agent-capabilities-DRUNyKs6.js → agent-capabilities-UH4_NDRB.js} +1 -1
  49. package/dist/client/assets/{agent-icon-K57A0DzY.js → agent-icon-CRPqtjX6.js} +1 -1
  50. package/dist/client/assets/{agents-list-DdfrpJA4.js → agents-list-C3JbHbWL.js} +1 -1
  51. package/dist/client/assets/{ai-providers-ZlX0S41Y.js → ai-providers-KhClLvY9.js} +1 -1
  52. package/dist/client/assets/{alert-D12iE_jh.js → alert-BSFVY_ft.js} +1 -1
  53. package/dist/client/assets/{alert-dialog-BuY0O9iQ.js → alert-dialog-DseQ_eoR.js} +1 -1
  54. package/dist/client/assets/{app-editor-B6oORsVZ.js → app-editor-C9SM21Xh.js} +1 -1
  55. package/dist/client/assets/{auth-D1xUzxIp.js → auth-YT0L3u0f.js} +1 -1
  56. package/dist/client/assets/{auth-catchall-BTjXPhNI.js → auth-catchall-Ch0KjyC5.js} +1 -1
  57. package/dist/client/assets/{auth-entry-Bg2Xb6tT.js → auth-entry-BpZO7T6i.js} +1 -1
  58. package/dist/client/assets/{auth-split-layout-CzHLXrwa.js → auth-split-layout-C37u8WlO.js} +1 -1
  59. package/dist/client/assets/{authenticate-and-persist-oauth-CbQ04gTK.js → authenticate-and-persist-oauth-D8TojuXv.js} +1 -1
  60. package/dist/client/assets/{automation-list-row-3xTUT0sz.js → automation-list-row-d7ebkZcP.js} +1 -1
  61. package/dist/client/assets/{automation-runs-B5QugYRM.js → automation-runs-Bo90h8_b.js} +1 -1
  62. package/dist/client/assets/{automations-DpLONqEv.js → automations-COxs7MJo.js} +1 -1
  63. package/dist/client/assets/{avatar-b6IKYKQs.js → avatar-DN0SQ2YP.js} +1 -1
  64. package/dist/client/assets/{badge-DGFEVFje.js → badge-CYqiGv_0.js} +1 -1
  65. package/dist/client/assets/{block-document-CLPFDPat.js → block-document-Tux1C7cf.js} +1 -1
  66. package/dist/client/assets/{brand-context-Ba-On5d-.js → brand-context-DYaR7ozG.js} +1 -1
  67. package/dist/client/assets/{breadcrumb-8G_CoEun.js → breadcrumb-Ca0mTftR.js} +1 -1
  68. package/dist/client/assets/{buckets-pXaevYUV.js → buckets-DwYOYKjz.js} +1 -1
  69. package/dist/client/assets/{bulk-category-panel-OTFFglhS.js → bulk-category-panel-IzdJ5QQ_.js} +1 -1
  70. package/dist/client/assets/{capability-load-error-CEmXpgFG.js → capability-load-error-DIVlJMVm.js} +1 -1
  71. package/dist/client/assets/{card-dPxA0RCs.js → card-D9G2yXrJ.js} +1 -1
  72. package/dist/client/assets/{category-editor-B2KWZmpg.js → category-editor-9mLUM1gN.js} +1 -1
  73. package/dist/client/assets/{chat-context-COllONR2.js → chat-context-DIUSa9Jr.js} +1 -1
  74. package/dist/client/assets/{checkbox-5y5TSI8u.js → checkbox-DCa6681A.js} +1 -1
  75. package/dist/client/assets/{cli-auth-success-DY-Hf-b0.js → cli-auth-success-Dlh4FD0T.js} +1 -1
  76. package/dist/client/assets/collection-detail-BqYrcVNr.js +1 -0
  77. package/dist/client/assets/{collection-display-button-B4kpKs3o.js → collection-display-button-C5acvrDe.js} +1 -1
  78. package/dist/client/assets/{collection-search-SaKzAiAF.js → collection-search-DT12aqMT.js} +1 -1
  79. package/dist/client/assets/{collection-table-wrapper-CJ-K0eS_.js → collection-table-wrapper-DroBY1GW.js} +1 -1
  80. package/dist/client/assets/{collection-tabs-CZb_AY94.js → collection-tabs-2clxo3lG.js} +1 -1
  81. package/dist/client/assets/{command-DDwBnk4S.js → command-qHaitSxv.js} +1 -1
  82. package/dist/client/assets/{commerce-onboarding-Cj6KuavN.js → commerce-onboarding-zByXwUoa.js} +1 -1
  83. package/dist/client/assets/{connect-desktop-dialog-uu1uNLI_.js → connect-desktop-dialog-RWUM4LPN.js} +1 -1
  84. package/dist/client/assets/{connection-card-BsaY572f.js → connection-card-COE4b4Kl.js} +1 -1
  85. package/dist/client/assets/{connection-detail-CVTulNyz.js → connection-detail-B4q53uMa.js} +1 -1
  86. package/dist/client/assets/{connection-form-helpers-CHdocTpm.js → connection-form-helpers-D9d9jQ9S.js} +1 -1
  87. package/dist/client/assets/{connections-JYGKhfuk.js → connections--zriX-8H.js} +1 -1
  88. package/dist/client/assets/{decopilot-B6qg2Op3.js → decopilot-BmUbIKrs.js} +1 -1
  89. package/dist/client/assets/{decopilot-sse-pool-D8tR3MTD.js → decopilot-sse-pool-Ct1_UW6D.js} +1 -1
  90. package/dist/client/assets/{dialog-RRPWwqaQ.js → dialog-fRprLEhn.js} +1 -1
  91. package/dist/client/assets/{domain-settings-CtXa1jf3.js → domain-settings-z8x2a3yI.js} +1 -1
  92. package/dist/client/assets/{drawer-DJfZ0VmD.js → drawer-BK13Nuy8.js} +1 -1
  93. package/dist/client/assets/{dropdown-menu-DDhytuEd.js → dropdown-menu-sPU_Xw0y.js} +1 -1
  94. package/dist/client/assets/{empty-state-CtsFp5nF.js → empty-state-D4vz7sAz.js} +1 -1
  95. package/dist/client/assets/{extract-connection-data-DI_Hy6px.js → extract-connection-data-UsNBmqW8.js} +1 -1
  96. package/dist/client/assets/{file-explorer-D1P9uacX.js → file-explorer-Bd_22RPw.js} +1 -1
  97. package/dist/client/assets/{file-type-icon-CBM2EyFd.js → file-type-icon-QdIQBEjI.js} +1 -1
  98. package/dist/client/assets/{files-DdTksaS8.js → files-BkGmR0AO.js} +1 -1
  99. package/dist/client/assets/{form-BylSC3lX.js → form-Cciq6tIX.js} +1 -1
  100. package/dist/client/assets/{general-DGX6oTcl.js → general-DcAHMO7L.js} +1 -1
  101. package/dist/client/assets/{github-repo-picker-J64_EPEa.js → github-repo-picker-Bo3EK1uO.js} +1 -1
  102. package/dist/client/assets/{hooks-B4JA5-D1.js → hooks-G0kJppE-.js} +1 -1
  103. package/dist/client/assets/{index-jUZDCPpZ.js → index-5tWfdRb-.js} +1 -1
  104. package/dist/client/assets/{index-B3JJ62uP.js → index-B1h3Rb7u.js} +1 -1
  105. package/dist/client/assets/{index-CC3_vx1n.js → index-B4ybF-Jh.js} +1 -1
  106. package/dist/client/assets/{index-DHu9eqr8.js → index-BJ4F5Cgi.js} +1 -1
  107. package/dist/client/assets/{index-8heN4TLW.js → index-BOeQzDmj.js} +1 -1
  108. package/dist/client/assets/{index-DACIolxc.js → index-BURNjU1u.js} +1 -1
  109. package/dist/client/assets/{index-5AaNNafz.js → index-BUtSNxMV.js} +3 -3
  110. package/dist/client/assets/{index-DTx-RDv5.js → index-BzYmCclH.js} +1 -1
  111. package/dist/client/assets/{index-DKXcf6uO.js → index-C8pUNf9d.js} +1 -1
  112. package/dist/client/assets/{index-CZfoQE-0.js → index-CG-jn-0q.js} +1 -1
  113. package/dist/client/assets/index-CLM-5yf3.js +513 -0
  114. package/dist/client/assets/{index-C7SCPFX7.js → index-CMw-30pH.js} +1 -1
  115. package/dist/client/assets/{index-DEenRZAo.js → index-D8DZXmXW.js} +1 -1
  116. package/dist/client/assets/{index-Bxu03H5X.js → index-SinsnlPg.js} +1 -1
  117. package/dist/client/assets/{index-redirect-KOsw3DwK.js → index-redirect-CnIqCBs5.js} +1 -1
  118. package/dist/client/assets/{input-BAz505sI.js → input-CVpmA2Kz.js} +1 -1
  119. package/dist/client/assets/{integration-icon-DtLxCtgy.js → integration-icon-DN2_9kxR.js} +1 -1
  120. package/dist/client/assets/{invite-member-dialog-BDVAAQIu.js → invite-member-dialog-DoItRcGW.js} +1 -1
  121. package/dist/client/assets/{label-BALEyZ3d.js → label-CHYsX_t_.js} +1 -1
  122. package/dist/client/assets/{library-tab-Ds5fpIQF.js → library-tab-Bsgpjy35.js} +1 -1
  123. package/dist/client/assets/{login-DPGDZC34.js → login-eX2LrEPi.js} +1 -1
  124. package/dist/client/assets/{mcp-oauth-CXxRaWx9.js → mcp-oauth-SYbSLgYN.js} +1 -1
  125. package/dist/client/assets/{members-Bape-XGh.js → members-DdtN3bGm.js} +1 -1
  126. package/dist/client/assets/{monaco-editor-qr3YxpgD.js → monaco-editor-DdObp8MJ.js} +1 -1
  127. package/dist/client/assets/{monitoring-stats-row-DHs40KAy.js → monitoring-stats-row-CLTH09T0.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-DAEXXBSA.js → oauth-callback-CTAFn26d.js} +1 -1
  129. package/dist/client/assets/{oauth-callback-ai-provider-DGzIC1E3.js → oauth-callback-ai-provider-Ba2WeI6r.js} +1 -1
  130. package/dist/client/assets/{onboarding-BQNZ1j24.js → onboarding-DlHZ-Su3.js} +1 -1
  131. package/dist/client/assets/{org-install-cdxFoHPK.js → org-install-DI0N3Yqx.js} +1 -1
  132. package/dist/client/assets/{org-layout-MlmaWu50.js → org-layout-CsvIFjMG.js} +1 -1
  133. package/dist/client/assets/{organization-choice-CCNhBIVu.js → organization-choice-uMvBpR1W.js} +1 -1
  134. package/dist/client/assets/{page-seo-form-B9WRtqtD.js → page-seo-form-DkJGxvT4.js} +1 -1
  135. package/dist/client/assets/page-seo-sheet-e5hks3lZ.js +1 -0
  136. package/dist/client/assets/{popover-QpTPPo-c.js → popover-leYVnzzq.js} +1 -1
  137. package/dist/client/assets/{post-editor-DrsCS-yJ.js → post-editor-BbMPNeY8.js} +1 -1
  138. package/dist/client/assets/{primitives-BjlgEPjn.js → primitives-BMqbH9T1.js} +1 -1
  139. package/dist/client/assets/{profile-BJ8vtOlo.js → profile-DJtsX_gg.js} +1 -1
  140. package/dist/client/assets/project-app-view-4fI2e2P9.js +1 -0
  141. package/dist/client/assets/record-editor-DuRqUeJW.js +1 -0
  142. package/dist/client/assets/registry-BOBWp4Rn.js +2 -0
  143. package/dist/client/assets/{registry-layout-ksLcOWzv.js → registry-layout-DUqvgFRD.js} +1 -1
  144. package/dist/client/assets/{require-capability-C2pr3gWk.js → require-capability-B4WZYZM4.js} +1 -1
  145. package/dist/client/assets/{required-auth-layout-BIsgDBTS.js → required-auth-layout-BGUbgKtE.js} +1 -1
  146. package/dist/client/assets/{reset-password-5xoBMew1.js → reset-password-BmozYPOY.js} +1 -1
  147. package/dist/client/assets/{roles-CTVYbrPK.js → roles-DaQkY_HN.js} +1 -1
  148. package/dist/client/assets/{scroll-area-B7g9A0xO.js → scroll-area-dCf_ML-5.js} +1 -1
  149. package/dist/client/assets/{search-input-Cn-k-Sr0.js → search-input-CgRadFHi.js} +1 -1
  150. package/dist/client/assets/{secrets-01-N-EoG.js → secrets-BK3hZvS4.js} +1 -1
  151. package/dist/client/assets/{sections-editor-FTn-qJ5h.js → sections-editor-CRAmv7O4.js} +1 -1
  152. package/dist/client/assets/{select-DMOL9nTa.js → select-CRwP8DNI.js} +1 -1
  153. package/dist/client/assets/{select-model-DJ7qLHls.js → select-model-vYsEfmhg.js} +1 -1
  154. package/dist/client/assets/{seo-editor-CJg20m-v.js → seo-editor-sG5N6UB0.js} +1 -1
  155. package/dist/client/assets/{settings-layout-C-lnHpnd.js → settings-layout-CkBMH0P4.js} +1 -1
  156. package/dist/client/assets/{settings-section-knuBYiSB.js → settings-section-uwWu-APP.js} +1 -1
  157. package/dist/client/assets/{sheet-B1hdeTXZ.js → sheet-DtNuWaQa.js} +1 -1
  158. package/dist/client/assets/{shell-controls-DGQEgSmu.js → shell-controls-BF0ZsNdF.js} +1 -1
  159. package/dist/client/assets/{shell-layout-BzrEGgvG.js → shell-layout-CFR90kZQ.js} +1 -1
  160. package/dist/client/assets/{sidebar-BZHqZbJ1.js → sidebar-IpepvLp_.js} +1 -1
  161. package/dist/client/assets/{skeleton-C1g3sLzc.js → skeleton-Dp2Vqkiu.js} +1 -1
  162. package/dist/client/assets/{sso-BRP47dTR.js → sso-DVCuwIPw.js} +1 -1
  163. package/dist/client/assets/{store-COqKQ01f.js → store-DdDejNZs.js} +1 -1
  164. package/dist/client/assets/store-registry-BcIIOkiT.js +2 -0
  165. package/dist/client/assets/{studio-tools-CK3O9apC.js → studio-tools-BBJKqBLb.js} +1 -1
  166. package/dist/client/assets/{switch-CTqoacsA.js → switch-CGRWKftH.js} +1 -1
  167. package/dist/client/assets/{table-D9O3xZPm.js → table-CES495US.js} +1 -1
  168. package/dist/client/assets/{tabs-OKKf4LAY.js → tabs-CF8uQ85g.js} +1 -1
  169. package/dist/client/assets/{task-row-mk4G9x-_.js → task-row-Bh0ziHfN.js} +1 -1
  170. package/dist/client/assets/{task-status-gvDe4NpG.js → task-status-BgxqbUD3.js} +1 -1
  171. package/dist/client/assets/{textarea-BwMDBTqD.js → textarea-DXtj6szK.js} +1 -1
  172. package/dist/client/assets/{toggle-group-CqoGi-AW.js → toggle-group-D2VkNZ7z.js} +1 -1
  173. package/dist/client/assets/{toolbar-Do7hu99P.js → toolbar-BL6j7wlL.js} +1 -1
  174. package/dist/client/assets/{toolbar-icon-button-D8xZWaZ4.js → toolbar-icon-button-zRIr6s4s.js} +1 -1
  175. package/dist/client/assets/{tools-list-D7bHk7AU.js → tools-list-XTSk446L.js} +1 -1
  176. package/dist/client/assets/{tooltip-jwNiafJz.js → tooltip-PSiaLaWJ.js} +1 -1
  177. package/dist/client/assets/{types-Z9nbiCM2.js → types-dxyE9Hx8.js} +1 -1
  178. package/dist/client/assets/{use-ai-providers-CaFOP2gL.js → use-ai-providers-BfSwDb4T.js} +1 -1
  179. package/dist/client/assets/{use-automations-BYB1tBxg.js → use-automations-b_vrwPQ_.js} +1 -1
  180. package/dist/client/assets/{use-capability-BJgOQ1dM.js → use-capability-BrY7n9pF.js} +1 -1
  181. package/dist/client/assets/{use-clock-tick-DiuTRa3m.js → use-clock-tick-DCObx26s.js} +1 -1
  182. package/dist/client/assets/{use-collections-D9VCe-RD.js → use-collections-BkB7fOzG.js} +1 -1
  183. package/dist/client/assets/{use-connection-BsHhz007.js → use-connection-BTrFuX_N.js} +1 -1
  184. package/dist/client/assets/{use-copy-BhkveYAE.js → use-copy-CUt0RcPi.js} +1 -1
  185. package/dist/client/assets/{use-create-virtual-mcp-DL7SpS9p.js → use-create-virtual-mcp-FIJSHCtF.js} +1 -1
  186. package/dist/client/assets/{use-debounced-autosave-CP4G_DMm.js → use-debounced-autosave-DT9RTx36.js} +1 -1
  187. package/dist/client/assets/{use-debounced-value-qurf1YAB.js → use-debounced-value-tBjolHlG.js} +1 -1
  188. package/dist/client/assets/{use-decopilot-events-89JO9cLA.js → use-decopilot-events-CB_ilHxh.js} +1 -1
  189. package/dist/client/assets/{use-delete-connection-CPcnCL2Y.js → use-delete-connection-DRxNkjYZ.js} +1 -1
  190. package/dist/client/assets/{use-file-configs-C37Mzz_w.js → use-file-configs-B_Y4Bta1.js} +1 -1
  191. package/dist/client/assets/{use-infinite-scroll-Dzaxo4bN.js → use-infinite-scroll-ziAI3qTA.js} +1 -1
  192. package/dist/client/assets/{use-join-requests-CPgcKwb5.js → use-join-requests-Cw33iAqx.js} +1 -1
  193. package/dist/client/assets/{use-mcp-client-DAdRU1cY.js → use-mcp-client-ytX3rIBe.js} +1 -1
  194. package/dist/client/assets/{use-mcp-prompts-DbP7dBZf.js → use-mcp-prompts-DGlgK9Vf.js} +1 -1
  195. package/dist/client/assets/{use-mcp-tools-s0H1m2Ok.js → use-mcp-tools-Pie2rBqX.js} +1 -1
  196. package/dist/client/assets/{use-members-BT2wuks0.js → use-members-BFNAbzwS.js} +1 -1
  197. package/dist/client/assets/{use-mobile-CCjACM_-.js → use-mobile-dwrFF7Ga.js} +1 -1
  198. package/dist/client/assets/{use-navigate-to-agent-CMFaBfX6.js → use-navigate-to-agent-3AMa0O2a.js} +1 -1
  199. package/dist/client/assets/{use-org-auth-client-BSqoqb51.js → use-org-auth-client-BUcY_yRN.js} +1 -1
  200. package/dist/client/assets/{use-org-sso-CZi5R7ze.js → use-org-sso--qDPTafN.js} +1 -1
  201. package/dist/client/assets/{use-organization-roles-amhmG5-6.js → use-organization-roles-DDZE7ylp.js} +1 -1
  202. package/dist/client/assets/{use-organization-settings-DJLfSIHV.js → use-organization-settings-DLQ_RcCc.js} +1 -1
  203. package/dist/client/assets/{use-registry-connections-DPtEZCsY.js → use-registry-connections-CE2j8i_H.js} +1 -1
  204. package/dist/client/assets/{use-secrets-CTWIslZA.js → use-secrets-BcayTN5e.js} +1 -1
  205. package/dist/client/assets/{use-status-sounds-Du5pinlF.js → use-status-sounds-DqsU9cpf.js} +1 -1
  206. package/dist/client/assets/{use-view-mode-C9H3mYaP.js → use-view-mode-DaspnYvg.js} +1 -1
  207. package/dist/client/assets/{use-virtual-mcp-B0Bq3-Jt.js → use-virtual-mcp-DoBqiTt8.js} +1 -1
  208. package/dist/client/assets/useInfiniteQuery-DX_yJgCV.js +1 -0
  209. package/dist/client/assets/useSuspenseInfiniteQuery-COveRdn6.js +1 -0
  210. package/dist/client/assets/{useSuspenseQueries-BQ3vTQtS.js → useSuspenseQueries-BeEuUcyy.js} +1 -1
  211. package/dist/client/assets/{variant-calendar-DKaaO6xE.js → variant-calendar-Czyjsj57.js} +1 -1
  212. package/dist/client/assets/{view-mode-toggle-B6q9qYR8.js → view-mode-toggle-Bl026rsL.js} +1 -1
  213. package/dist/client/index.html +1 -1
  214. package/dist/server/cli.js +12 -17
  215. package/dist/server/server.js +2 -2
  216. package/package.json +1 -1
  217. package/dist/client/assets/collection-detail-bmPgPvem.js +0 -1
  218. package/dist/client/assets/index-FLLcVjP1.js +0 -513
  219. package/dist/client/assets/page-seo-sheet-Da6XfVR0.js +0 -1
  220. package/dist/client/assets/project-app-view-DseQWbDi.js +0 -1
  221. package/dist/client/assets/record-editor-DbGexVfp.js +0 -1
  222. package/dist/client/assets/registry-DeMcmcPG.js +0 -2
  223. package/dist/client/assets/store-registry-DkYzijdd.js +0 -2
  224. package/dist/client/assets/useInfiniteQuery-C7fx2naq.js +0 -1
  225. package/dist/client/assets/useSuspenseInfiniteQuery-DpHAMt5e.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as oe,r as K,b as yt,D as Be,j as t,B as Z,t as Se,l as de,K as it,k as wt,W as rs,u as os,v as xt,E as ls}from"./index-5AaNNafz.js";import{S as as}from"./search-input-Cn-k-Sr0.js";import{P as De}from"./index-CC3_vx1n.js";import{E as St}from"./empty-state-CtsFp5nF.js";import{R as ns}from"./require-capability-C2pr3gWk.js";import{K as Tt,S as is}from"./scroll-area-B7g9A0xO.js";import{u as vt}from"./use-connection-BsHhz007.js";import{g as Pt}from"./connection-slug-eyAPH6o3.js";import{B as rt}from"./badge-DGFEVFje.js";import{P as ct,a as dt,b as mt}from"./popover-QpTPPo-c.js";import{T as Ze,a as et,b as tt}from"./tooltip-jwNiafJz.js";import{i as ft}from"./Check-B2t3_u8j.js";import{a as Xe}from"./Copy01-C_1mrR9P.js";import{n as Mt}from"./Globe01-4bI1LBPk.js";import{i as At}from"./FilterLines-C7Zdp7-q.js";import{i as cs}from"./Key01-_0kmrESm.js";import{i as ds}from"./Play-C4pBBuTc.js";import{aq as ms,X as us,L as xs}from"./agent-icon-K57A0DzY.js";import{M as _t}from"./monaco-editor-qr3YxpgD.js";import{u as fs}from"./use-members-BT2wuks0.js";import{u as ps}from"./use-mcp-client-DAdRU1cY.js";import{u as hs}from"./use-virtual-mcp-B0Bq3-Jt.js";import{S as gs,W as js}from"./constants-C8_Swa4x.js";import{n as Qe}from"./XCircle-DofnF94J.js";import{c as vs}from"./SwitchHorizontal01-a_i15cCW.js";import{s as Ns}from"./Plus-Cj9kK9tN.js";import{s as bs}from"./Trash01-D_xTnQtW.js";import{I as Ge}from"./input-BAz505sI.js";import{C as ys,g as ws,b as Dt,f as st,a as Vt,c as pt,d as Ss,e as Lt,h as Ut,A as Is,T as Cs,i as ks,M as ht}from"./automation-runs-B5QugYRM.js";import{S as ot,a as lt,b as at,c as $e,d as nt}from"./select-DMOL9nTa.js";import{t as Kt}from"./ChevronDown-CJGVvA9G.js";import{s as Ts}from"./Stars02-DGriyPK-.js";import{T as Ms}from"./textarea-BwMDBTqD.js";import{C as qt}from"./collection-tabs-CZb_AY94.js";import{S as _s}from"./switch-CTqoacsA.js";import{L as Ds}from"./label-BALEyZ3d.js";import{I as qe}from"./integration-icon-DtLxCtgy.js";import{A as Bt}from"./avatar-b6IKYKQs.js";import{A as Ls,a as Fs,b as Rs}from"./alert-D12iE_jh.js";import{C as Ht}from"./card-dPxA0RCs.js";import{K as Me}from"./monitoring-stats-row-DHs40KAy.js";import{u as Jt}from"./studio-tools-CK3O9apC.js";import{u as $s}from"./useSuspenseInfiniteQuery-DpHAMt5e.js";import{b as zs,S as Os,c as Es,d as Ps}from"./sheet-B1hdeTXZ.js";import{T as Fe,a as ut,b as Gt,c as Qt,d as Wt,e as ae}from"./table-D9O3xZPm.js";import{n as As}from"./ChevronUp-Cfv8kwOP.js";import{u as Vs}from"./use-infinite-scroll-Dzaxo4bN.js";import{c as Us,b as Ks}from"./use-automations-BYB1tBxg.js";import"./SearchMd-CP9WApAb.js";import"./sidebar-BZHqZbJ1.js";import"./LayoutLeft-D_5UU_fl.js";import"./use-mobile-CCjACM_-.js";import"./use-capability-BJgOQ1dM.js";import"./access-gate-BOS773UI.js";import"./capability-load-error-CEmXpgFG.js";import"./Stars01-DKD-uu49.js";import"./ChevronRight-SxNLyRA0.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BhkveYAE.js";import"./file-type-icon-CBM2EyFd.js";import"./dialog-RRPWwqaQ.js";import"./X-DY9hR308.js";import"./ZoomOut-B3kimgA9.js";import"./tab-id-CLpu897Q.js";import"./content-blocks-o63cs2vh.js";import"./types-Z9nbiCM2.js";import"./chat-context-COllONR2.js";import"./hooks-B4JA5-D1.js";import"./decopilot-sse-pool-D8tR3MTD.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CaFOP2gL.js";import"./use-decopilot-events-89JO9cLA.js";import"./use-organization-settings-DJLfSIHV.js";import"./AlertCircle-BWfyWgiw.js";import"./Eye-Jd91Hda4.js";import"./Star01-CC3gyOop.js";import"./XClose-CmiCfuv_.js";import"./ZapSquare-B7pUKk1h.js";import"./Tool01-iIXzQIf6.js";import"./Monitor01-EVfMwGgl.js";import"./Upload01-COCQSA6j.js";import"./use-clock-tick-DiuTRa3m.js";import"./shell-layout-BzrEGgvG.js";import"./Users03-Dnn-6pZq.js";import"./SearchLg-JSkDDvk4.js";import"./CheckCircle-Cd9sCPj_.js";import"./Zap-BwbZR_TW.js";import"./alert-dialog-BuY0O9iQ.js";import"./required-auth-layout-BIsgDBTS.js";import"./use-org-sso-CZi5R7ze.js";import"./LinkExternal01-CYx_LjKe.js";import"./ArrowUpRight-h5-lNOU3.js";import"./Palette-Cg2Il5Mo.js";import"./use-navigate-to-agent-CMFaBfX6.js";import"./use-mcp-prompts-DbP7dBZf.js";import"./form-BylSC3lX.js";import"./use-collections-D9VCe-RD.js";import"./Settings02-Bs74lw7T.js";import"./Circle-CmWJQsR2.js";import"./Loading02-D5Q9o2ML.js";import"./DotsVertical-DQ-r-KXk.js";import"./Globe04-CPnbhr3e.js";import"./HardDrive-WT4IA8YF.js";import"./List-5nWMXvgZ.js";import"./Sun-DszeKWvN.js";import"./Shield01-DMFwBOtF.js";import"./User01-DBHhpCM7.js";import"./Users01-BymojQtX.js";import"./index-8heN4TLW.js";import"./use-org-auth-client-BSqoqb51.js";import"./auth-D1xUzxIp.js";import"./useInfiniteQuery-C7fx2naq.js";import"./task-status-gvDe4NpG.js";import"./checkbox-5y5TSI8u.js";import"./command-DDwBnk4S.js";import"./index-DHu9eqr8.js";import"./index-DKXcf6uO.js";const Nt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Re(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),o=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${o}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,o,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:o||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
1
+ import{c as oe,r as K,b as yt,D as Be,j as t,B as Z,t as Se,l as de,K as it,k as wt,W as rs,u as os,v as xt,E as ls}from"./index-BUtSNxMV.js";import{S as as}from"./search-input-CgRadFHi.js";import{P as De}from"./index-B4ybF-Jh.js";import{E as St}from"./empty-state-D4vz7sAz.js";import{R as ns}from"./require-capability-B4WZYZM4.js";import{K as Tt,S as is}from"./scroll-area-dCf_ML-5.js";import{u as vt}from"./use-connection-BTrFuX_N.js";import{g as Pt}from"./connection-slug-eyAPH6o3.js";import{B as rt}from"./badge-CYqiGv_0.js";import{P as ct,a as dt,b as mt}from"./popover-leYVnzzq.js";import{T as Ze,a as et,b as tt}from"./tooltip-PSiaLaWJ.js";import{i as ft}from"./Check-CWR2GX_4.js";import{a as Xe}from"./Copy01-C_vDrK62.js";import{n as Mt}from"./Globe01-pYyw4zjF.js";import{i as At}from"./FilterLines-YtMlMBJN.js";import{i as cs}from"./Key01-BGm5x2_7.js";import{i as ds}from"./Play-DrXY2oRx.js";import{aq as ms,Y as us,L as xs}from"./agent-icon-CRPqtjX6.js";import{M as _t}from"./monaco-editor-DdObp8MJ.js";import{u as fs}from"./use-members-BFNAbzwS.js";import{u as ps}from"./use-mcp-client-ytX3rIBe.js";import{u as hs}from"./use-virtual-mcp-DoBqiTt8.js";import{S as gs,W as js}from"./constants-C8_Swa4x.js";import{n as Qe}from"./XCircle-DRgrnFcC.js";import{c as vs}from"./SwitchHorizontal01-DAV6AujY.js";import{s as Ns}from"./Plus-j1oUcvSs.js";import{s as bs}from"./Trash01-Bf3SN1nH.js";import{I as Ge}from"./input-CVpmA2Kz.js";import{C as ys,g as ws,b as Dt,f as st,a as Vt,c as pt,d as Ss,e as Lt,h as Ut,A as Is,T as Cs,i as ks,M as ht}from"./automation-runs-Bo90h8_b.js";import{S as ot,a as lt,b as at,c as $e,d as nt}from"./select-CRwP8DNI.js";import{t as Kt}from"./ChevronDown-BOnFs3ZP.js";import{s as Ts}from"./Stars02-C0LkLtPv.js";import{T as Ms}from"./textarea-DXtj6szK.js";import{C as qt}from"./collection-tabs-2clxo3lG.js";import{S as _s}from"./switch-CGRWKftH.js";import{L as Ds}from"./label-CHYsX_t_.js";import{I as qe}from"./integration-icon-DN2_9kxR.js";import{A as Bt}from"./avatar-DN0SQ2YP.js";import{A as Ls,a as Fs,b as Rs}from"./alert-BSFVY_ft.js";import{C as Ht}from"./card-D9G2yXrJ.js";import{K as Me}from"./monitoring-stats-row-CLTH09T0.js";import{u as Jt}from"./studio-tools-BBJKqBLb.js";import{u as $s}from"./useSuspenseInfiniteQuery-COveRdn6.js";import{b as zs,S as Os,c as Es,d as Ps}from"./sheet-DtNuWaQa.js";import{T as Fe,a as ut,b as Gt,c as Qt,d as Wt,e as ae}from"./table-CES495US.js";import{n as As}from"./ChevronUp-CkMhjJB_.js";import{u as Vs}from"./use-infinite-scroll-ziAI3qTA.js";import{c as Us,b as Ks}from"./use-automations-b_vrwPQ_.js";import"./SearchMd-Cmh57xGa.js";import"./sidebar-IpepvLp_.js";import"./LayoutLeft-WEbo8J87.js";import"./use-mobile-dwrFF7Ga.js";import"./use-capability-BrY7n9pF.js";import"./access-gate-DPOW1JQt.js";import"./capability-load-error-DIVlJMVm.js";import"./Stars01-Ch3VikRv.js";import"./ChevronRight--Sw9cfbS.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CUt0RcPi.js";import"./file-type-icon-QdIQBEjI.js";import"./dialog-fRprLEhn.js";import"./X-C0ZgGoQb.js";import"./ZoomOut-B4weRH-H.js";import"./tab-id-CLpu897Q.js";import"./content-blocks-o63cs2vh.js";import"./types-dxyE9Hx8.js";import"./chat-context-DIUSa9Jr.js";import"./hooks-G0kJppE-.js";import"./decopilot-sse-pool-Ct1_UW6D.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-BfSwDb4T.js";import"./use-decopilot-events-CB_ilHxh.js";import"./use-organization-settings-DLQ_RcCc.js";import"./AlertCircle-CLapFvcx.js";import"./Eye-DCiEQJIv.js";import"./Star01-DgFqZM1H.js";import"./XClose-CmJ8_Kxi.js";import"./ZapSquare-BtUSi6w5.js";import"./Tool01-Csfd8Wry.js";import"./Monitor01-CjaozmNA.js";import"./Upload01-BYEqY1Ay.js";import"./use-clock-tick-DCObx26s.js";import"./shell-layout-CFR90kZQ.js";import"./Users03-kFy3UJPi.js";import"./SearchLg-Dt-H4O3z.js";import"./CheckCircle-BJr7jKsb.js";import"./Zap-CjHl9Hth.js";import"./alert-dialog-DseQ_eoR.js";import"./required-auth-layout-BGUbgKtE.js";import"./use-org-sso--qDPTafN.js";import"./LinkExternal01-C9wAno25.js";import"./ArrowUpRight-DYI4ZFTv.js";import"./Palette-DX20ptpQ.js";import"./use-navigate-to-agent-3AMa0O2a.js";import"./use-mcp-prompts-DGlgK9Vf.js";import"./form-Cciq6tIX.js";import"./use-collections-BkB7fOzG.js";import"./Settings02-CtgBTtnW.js";import"./Circle-CSNCa0Ai.js";import"./Loading02-BY5Z_ytL.js";import"./DotsVertical-CVxu5D2B.js";import"./Globe04-B5LRDZX0.js";import"./HardDrive-Bt_8Ilkp.js";import"./List-wZrVQa3Y.js";import"./Sun-D-D5LZ02.js";import"./Shield01-BsAF4snY.js";import"./User01-C7pBq15o.js";import"./Users01-9SoD8uT4.js";import"./index-BOeQzDmj.js";import"./use-org-auth-client-BUcY_yRN.js";import"./auth-YT0L3u0f.js";import"./useInfiniteQuery-DX_yJgCV.js";import"./task-status-BgxqbUD3.js";import"./checkbox-DCa6681A.js";import"./command-qHaitSxv.js";import"./index-BJ4F5Cgi.js";import"./index-C8pUNf9d.js";const Nt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Re(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),o=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${o}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,o,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:o||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
2
2
  `)}function Ft(s){return s.trim()?s.split(`
3
3
  `).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[r,...o]=e.split("=");return{key:r||"",operator:"eq",value:o.join("=")}}if(e.includes("~")){const[r,...o]=e.split("~");return{key:r||"",operator:"contains",value:o.join("~")}}if(e.includes("@")){const[r,...o]=e.split("@");return{key:r||"",operator:"in",value:o.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Bs(s){const e={},r={},o=[],a={};for(const l of s)if(l.key.trim())switch(l.operator){case"eq":l.value&&(e[l.key]=l.value);break;case"contains":l.value&&(r[l.key]=`%${l.value}%`);break;case"exists":o.push(l.key);break;case"in":l.value&&(a[l.key]=l.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(r).length>0?r:void 0,propertyKeys:o.length>0?o:void 0,propertyInValues:Object.keys(a).length>0?a:void 0}}function Rt(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};if(typeof s._decocms_truncated=="string")return{content:s._decocms_truncated,isTruncated:!0,originalSize:s._decocms_truncated.length};const e=JSON.stringify(s,null,2),r=e.length;return r<=Nt.maxJsonRenderSize?{content:e,isTruncated:!1,originalSize:r}:{content:e.slice(0,Nt.maxJsonRenderSize)+`
4
4
 
@@ -1 +1 @@
1
- import{r as s,a9 as L,a7 as B,j as d,b5 as q,a4 as x,a8 as E,b3 as K,aa as C,b4 as _,b6 as T,a6 as w,bE as U,bD as V}from"./index-5AaNNafz.js";var I="Radio",[z,P]=w(I),[H,W]=z(I),k=s.forwardRef((a,c)=>{const{__scopeRadio:o,name:n,checked:e=!1,required:r,disabled:t,value:l="on",onCheck:f,form:R,...v}=a,[p,m]=s.useState(null),i=E(c,h=>m(h)),u=s.useRef(!1),b=p?R||!!p.closest("form"):!0;return d.jsxs(H,{scope:o,checked:e,disabled:t,children:[d.jsx(x.button,{type:"button",role:"radio","aria-checked":e,"data-state":A(e),"data-disabled":t?"":void 0,disabled:t,value:l,...v,ref:i,onClick:C(a.onClick,h=>{e||f?.(),b&&(u.current=h.isPropagationStopped(),u.current||h.stopPropagation())})}),b&&d.jsx(S,{control:p,bubbles:!u.current,name:n,value:l,checked:e,required:r,disabled:t,form:R,style:{transform:"translateX(-100%)"}})]})});k.displayName=I;var g="RadioIndicator",G=s.forwardRef((a,c)=>{const{__scopeRadio:o,forceMount:n,...e}=a,r=W(g,o);return d.jsx(T,{present:n||r.checked,children:d.jsx(x.span,{"data-state":A(r.checked),"data-disabled":r.disabled?"":void 0,...e,ref:c})})});G.displayName=g;var X="RadioBubbleInput",S=s.forwardRef(({__scopeRadio:a,control:c,checked:o,bubbles:n=!0,...e},r)=>{const t=s.useRef(null),l=E(t,r),f=U(o),R=V(c);return s.useEffect(()=>{const v=t.current;if(!v)return;const p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==o&&i){const u=new Event("click",{bubbles:n});i.call(v,o),v.dispatchEvent(u)}},[f,o,n]),d.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...e,tabIndex:-1,ref:l,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});S.displayName=X;function A(a){return a?"checked":"unchecked"}var Y=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],y="RadioGroup",[J]=w(y,[_,P]),j=_(),N=P(),[Q,Z]=J(y),D=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,name:n,defaultValue:e,value:r,required:t=!1,disabled:l=!1,orientation:f,dir:R,loop:v=!0,onValueChange:p,...m}=a,i=j(o),u=L(R),[b,h]=B({prop:r,defaultProp:e??null,onChange:p,caller:y});return d.jsx(Q,{scope:o,name:n,required:t,disabled:l,value:b,onValueChange:h,children:d.jsx(q,{asChild:!0,...i,orientation:f,dir:u,loop:v,children:d.jsx(x.div,{role:"radiogroup","aria-required":t,"aria-orientation":f,"data-disabled":l?"":void 0,dir:u,...m,ref:c})})})});D.displayName=y;var M="RadioGroupItem",O=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,disabled:n,...e}=a,r=Z(M,o),t=r.disabled||n,l=j(o),f=N(o),R=s.useRef(null),v=E(c,R),p=r.value===e.value,m=s.useRef(!1);return s.useEffect(()=>{const i=b=>{Y.includes(b.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)}},[]),d.jsx(K,{asChild:!0,...l,focusable:!t,active:p,children:d.jsx(k,{disabled:t,required:r.required,checked:p,...f,...e,name:r.name,ref:v,onCheck:()=>r.onValueChange(e.value),onKeyDown:C(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:C(e.onFocus,()=>{m.current&&R.current?.click()})})})});O.displayName=M;var $="RadioGroupIndicator",F=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,...n}=a,e=N(o);return d.jsx(G,{...e,...n,ref:c})});F.displayName=$;var oe=D,re=O,ae=F;export{re as I,oe as R,ae as a};
1
+ import{r as s,a9 as L,a7 as B,j as d,b5 as q,a4 as x,a8 as E,b3 as K,aa as C,b4 as _,b6 as T,a6 as w,bE as U,bD as V}from"./index-BUtSNxMV.js";var I="Radio",[z,P]=w(I),[H,W]=z(I),k=s.forwardRef((a,c)=>{const{__scopeRadio:o,name:n,checked:e=!1,required:r,disabled:t,value:l="on",onCheck:f,form:R,...v}=a,[p,m]=s.useState(null),i=E(c,h=>m(h)),u=s.useRef(!1),b=p?R||!!p.closest("form"):!0;return d.jsxs(H,{scope:o,checked:e,disabled:t,children:[d.jsx(x.button,{type:"button",role:"radio","aria-checked":e,"data-state":A(e),"data-disabled":t?"":void 0,disabled:t,value:l,...v,ref:i,onClick:C(a.onClick,h=>{e||f?.(),b&&(u.current=h.isPropagationStopped(),u.current||h.stopPropagation())})}),b&&d.jsx(S,{control:p,bubbles:!u.current,name:n,value:l,checked:e,required:r,disabled:t,form:R,style:{transform:"translateX(-100%)"}})]})});k.displayName=I;var g="RadioIndicator",G=s.forwardRef((a,c)=>{const{__scopeRadio:o,forceMount:n,...e}=a,r=W(g,o);return d.jsx(T,{present:n||r.checked,children:d.jsx(x.span,{"data-state":A(r.checked),"data-disabled":r.disabled?"":void 0,...e,ref:c})})});G.displayName=g;var X="RadioBubbleInput",S=s.forwardRef(({__scopeRadio:a,control:c,checked:o,bubbles:n=!0,...e},r)=>{const t=s.useRef(null),l=E(t,r),f=U(o),R=V(c);return s.useEffect(()=>{const v=t.current;if(!v)return;const p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==o&&i){const u=new Event("click",{bubbles:n});i.call(v,o),v.dispatchEvent(u)}},[f,o,n]),d.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...e,tabIndex:-1,ref:l,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});S.displayName=X;function A(a){return a?"checked":"unchecked"}var Y=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],y="RadioGroup",[J]=w(y,[_,P]),j=_(),N=P(),[Q,Z]=J(y),D=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,name:n,defaultValue:e,value:r,required:t=!1,disabled:l=!1,orientation:f,dir:R,loop:v=!0,onValueChange:p,...m}=a,i=j(o),u=L(R),[b,h]=B({prop:r,defaultProp:e??null,onChange:p,caller:y});return d.jsx(Q,{scope:o,name:n,required:t,disabled:l,value:b,onValueChange:h,children:d.jsx(q,{asChild:!0,...i,orientation:f,dir:u,loop:v,children:d.jsx(x.div,{role:"radiogroup","aria-required":t,"aria-orientation":f,"data-disabled":l?"":void 0,dir:u,...m,ref:c})})})});D.displayName=y;var M="RadioGroupItem",O=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,disabled:n,...e}=a,r=Z(M,o),t=r.disabled||n,l=j(o),f=N(o),R=s.useRef(null),v=E(c,R),p=r.value===e.value,m=s.useRef(!1);return s.useEffect(()=>{const i=b=>{Y.includes(b.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)}},[]),d.jsx(K,{asChild:!0,...l,focusable:!t,active:p,children:d.jsx(k,{disabled:t,required:r.required,checked:p,...f,...e,name:r.name,ref:v,onCheck:()=>r.onValueChange(e.value),onKeyDown:C(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:C(e.onFocus,()=>{m.current&&R.current?.click()})})})});O.displayName=M;var $="RadioGroupIndicator",F=s.forwardRef((a,c)=>{const{__scopeRadioGroup:o,...n}=a,e=N(o);return d.jsx(G,{...e,...n,ref:c})});F.displayName=$;var oe=D,re=O,ae=F;export{re as I,oe as R,ae as a};
@@ -1 +1 @@
1
- import{c as C,j as s,C as We,r as D,D as ee,b as ne,l as F,v as ue,F as zs,G as Ts,a as be,H as Ms,I as Os,t as se,J as Ds,M as Ps,m as Lt,u as Ke,P as vt,B as ze,y as Es,R as Rs,K as Fs,k as Ls,i as Bt,e as ct,E as Ht,o as Bs,s as Hs,n as Us,p as Gs,d as qs,x as Ws,T as Ut,O as Ks,U as Vs}from"./index-5AaNNafz.js";import{u as ve,S as dt,a as mt,b as fe,c as J,d as K,e as ut,f as Gt,g as Xs,h as Qs,i as st,j as Ys,k as Js,l as Zs}from"./sidebar-BZHqZbJ1.js";import{u as ft}from"./use-mobile-CCjACM_-.js";import{n as en}from"./Loading02-D5Q9o2ML.js";import{u as tn}from"./use-organization-settings-DJLfSIHV.js";import{S as oe}from"./skeleton-C1g3sLzc.js";import{i as qt}from"./LayoutLeft-D_5UU_fl.js";import{T as ae}from"./toolbar-icon-button-D8xZWaZ4.js";import{P as De,a as je,b as Pe}from"./popover-QpTPPo-c.js";import{D as Wt,a as Kt,b as Vt}from"./drawer-DJfZ0VmD.js";import{A as Oe}from"./avatar-b6IKYKQs.js";import{a as he,b as xe,c as nt,T as pe}from"./tooltip-jwNiafJz.js";import{a as yt}from"./Copy01-C_1mrR9P.js";import{n as sn,i as nn}from"./Globe01-4bI1LBPk.js";import{i as ln}from"./ZoomOut-B3kimgA9.js";import{i as rn,a as on}from"./ZapSquare-B7pUKk1h.js";import{i as Xt}from"./Monitor01-EVfMwGgl.js";import{n as an,a as cn}from"./Sun-DszeKWvN.js";import{a as Ve,b as dn}from"./Settings02-Bs74lw7T.js";import{i as mn}from"./Shield01-DMFwBOtF.js";import{a as un}from"./Users03-Dnn-6pZq.js";import{a as St,b as Nt,c as Qt,d as fn,A as Te,e as _t,i as hn,s as xn,f as pn}from"./agent-icon-K57A0DzY.js";import"./index-DACIolxc.js";import{n as Xe}from"./Stars02-DGriyPK-.js";import{D as gn,a as bn,b as jn,c as wt,d as vn}from"./dropdown-menu-DDhytuEd.js";import{i as Ee}from"./Check-B2t3_u8j.js";import{s as $e}from"./Plus-Cj9kK9tN.js";import{u as yn}from"./use-connection-BsHhz007.js";import{u as Yt}from"./use-mcp-client-DAdRU1cY.js";import{u as ht,a as xt}from"./use-virtual-mcp-B0Bq3-Jt.js";import{i as Jt,S as Zt,a as Ge}from"./constants-C8_Swa4x.js";import{G as Sn,g as lt,i as Nn,a as rt}from"./github-repo-picker-J64_EPEa.js";import{u as _n,S as es,a as wn,g as Cn,b as kn,c as In}from"./use-navigate-to-agent-CMFaBfX6.js";import{I as An}from"./invite-member-dialog-BDVAAQIu.js";import{u as ts,A as $n,g as zn}from"./agent-capabilities-DRUNyKs6.js";import{u as Tn,v as Mn,C as On}from"./connect-desktop-dialog-uu1uNLI_.js";import{s as ss}from"./XClose-CmiCfuv_.js";import{u as Dn,a as Pn}from"./use-join-requests-CPgcKwb5.js";import{i as ns}from"./ChevronRight-SxNLyRA0.js";import{u as En,R as Rn,a as Fn,b as pt,r as Ln}from"./shell-layout-BzrEGgvG.js";import{i as Bn}from"./FilterLines-C7Zdp7-q.js";import{T as Hn,a as Un}from"./toggle-group-CqoGi-AW.js";import{u as Gn,a as gt,b as ls,T as qn}from"./hooks-B4JA5-D1.js";import{c as Wn,a as Kn,b as Vn,d as Xn,e as Qn}from"./dialog-RRPWwqaQ.js";import{C as Yn,a as Jn,b as Zn,c as el,d as tl}from"./command-DDwBnk4S.js";import{u as rs}from"./studio-tools-CK3O9apC.js";import{i as sl}from"./Zap-BwbZR_TW.js";import{S as is,M as nl}from"./shell-controls-DGQEgSmu.js";import{T as os}from"./task-row-mk4G9x-_.js";import{t as bt}from"./ChevronDown-CJGVvA9G.js";import{S as ll}from"./task-status-gvDe4NpG.js";import{S as rl,C as il}from"./chat-context-COllONR2.js";import{B as Ct,a as ol,b as al}from"./breadcrumb-8G_CoEun.js";import{T as Z}from"./toolbar-Do7hu99P.js";import{i as as}from"./SearchMd-CP9WApAb.js";import{A as cl,a as dl,b as ml,c as ul,d as fl,e as hl,f as xl}from"./alert-dialog-BuY0O9iQ.js";import{F as pl,a as gl,b as bl,c as jl,d as vl,f as yl,e as Sl}from"./form-BylSC3lX.js";import{I as Nl}from"./input-BAz505sI.js";import"./sheet-B1hdeTXZ.js";import"./X-DY9hR308.js";import"./User01-DBHhpCM7.js";import"./AlertCircle-BWfyWgiw.js";import"./Tool01-iIXzQIf6.js";import"./SwitchHorizontal01-a_i15cCW.js";import"./XCircle-DofnF94J.js";import"./ArrowUpRight-h5-lNOU3.js";import"./CheckCircle-Cd9sCPj_.js";import"./ChevronUp-Cfv8kwOP.js";import"./Circle-CmWJQsR2.js";import"./DotsVertical-DQ-r-KXk.js";import"./Eye-Jd91Hda4.js";import"./Star01-CC3gyOop.js";import"./Globe04-CPnbhr3e.js";import"./HardDrive-WT4IA8YF.js";import"./Key01-_0kmrESm.js";import"./LinkExternal01-CYx_LjKe.js";import"./List-5nWMXvgZ.js";import"./Palette-Cg2Il5Mo.js";import"./Play-C4pBBuTc.js";import"./SearchLg-JSkDDvk4.js";import"./Stars01-DKD-uu49.js";import"./Trash01-D_xTnQtW.js";import"./Upload01-COCQSA6j.js";import"./Users01-BymojQtX.js";import"./use-collections-D9VCe-RD.js";import"./auth-D1xUzxIp.js";import"./checkbox-5y5TSI8u.js";import"./collection-search-SaKzAiAF.js";import"./use-debounced-value-qurf1YAB.js";import"./authenticate-and-persist-oauth-CbQ04gTK.js";import"./mcp-oauth-CXxRaWx9.js";import"./use-mcp-tools-s0H1m2Ok.js";import"./extract-connection-data-DI_Hy6px.js";import"./github-installations-DzN1UQ4x.js";import"./select-DMOL9nTa.js";import"./textarea-BwMDBTqD.js";import"./use-org-auth-client-BSqoqb51.js";import"./use-organization-roles-amhmG5-6.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BsaY572f.js";import"./use-registry-connections-DPtEZCsY.js";import"./useInfiniteQuery-C7fx2naq.js";import"./use-infinite-scroll-Dzaxo4bN.js";import"./card-dPxA0RCs.js";import"./integration-icon-DtLxCtgy.js";import"./collection-tabs-CZb_AY94.js";import"./badge-DGFEVFje.js";import"./connection-form-helpers-CHdocTpm.js";import"./useSuspenseInfiniteQuery-DpHAMt5e.js";import"./use-ai-providers-CaFOP2gL.js";import"./use-capability-BJgOQ1dM.js";import"./required-auth-layout-BIsgDBTS.js";import"./tab-id-CLpu897Q.js";import"./use-org-sso-CZi5R7ze.js";import"./decopilot-sse-pool-D8tR3MTD.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./index-DHu9eqr8.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-clock-tick-DiuTRa3m.js";import"./use-decopilot-events-89JO9cLA.js";import"./label-BALEyZ3d.js";function _l(t){const e=C.c(5),{onPointerDown:n,onDoubleClick:l}=t,{state:r,isMobile:i}=ve();if(i||r==="collapsed")return null;let o,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={left:"var(--sidebar-width)"},a=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=o,e[1]=a):(o=e[0],a=e[1]);let d;return e[2]!==l||e[3]!==n?(d=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:l,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:o,children:a}),e[2]=l,e[3]=n,e[4]=d):d=e[4],d}const jt=240,wl=400,Cl="sidebar.width";function Me(t){return Math.max(jt,Math.min(wl,t))}function kl(){const t=C.c(11),[e,n]=We(Cl,Il),l=D.useRef(null);let r;t[0]!==n||t[1]!==e?(r=m=>{m.preventDefault();const u=m.clientX,f=Me(e),x=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),p=x?Array.from(x.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of p)b.style.transition="none";const h=b=>{const j=Me(f+(b.clientX-u));x?.style.setProperty("--sidebar-width",`${j}px`)},g=b=>{const j=Me(f+(b.clientX-u));n(j);for(const v of p)v.style.transition="";window.removeEventListener("pointermove",h),window.removeEventListener("pointerup",g),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",h),window.addEventListener("pointerup",g)},t[0]=n,t[1]=e,t[2]=r):r=t[2];const i=r;let o;t[3]!==n?(o=()=>{n(jt)},t[3]=n,t[4]=o):o=t[4];const a=o;let d;t[5]!==e?(d=Me(e),t[5]=e,t[6]=d):d=t[6];let c;return t[7]!==i||t[8]!==a||t[9]!==d?(c={width:d,wrapperRef:l,onStartResize:i,resetWidth:a},t[7]=i,t[8]=a,t[9]=d,t[10]=c):c=t[10],c}function Il(t){return typeof t=="number"?Me(t):jt}function cs(){const t=C.c(8),{org:e}=ee(),n=ne(),l=tn();let r;if(t[0]!==n||t[1]!==e||t[2]!==l){if(r=[],l){let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(en,{className:"size-4!"}),t[4]=i):i=t[4];let o;t[5]!==n||t[6]!==e?(o={type:"items",items:[{key:"board",label:"Board",icon:i,onClick:()=>n({to:"/$org/board",params:{org:e.slug}})}]},t[5]=n,t[6]=e,t[7]=o):o=t[7],r.push(o)}t[0]=n,t[1]=e,t[2]=l,t[3]=r}else r=t[3];return r}function ds(t){const e=C.c(3),{children:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=l):l=e[0];let r;return e[1]!==n?(r=s.jsxs(dt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[l,s.jsx(mt,{children:s.jsx(fe,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=r):r=e[2],r}function ms(t){const e=C.c(18),{item:n}=t,{isMobile:l,setOpenMobile:r}=ve();let i;e[0]!==l||e[1]!==n||e[2]!==r?(i=()=>{ue("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:l}),n.onClick?.(),l&&r(!1)},e[0]=l,e[1]=n,e[2]=r,e[3]=i):i=e[3];const o=i,a=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=F(d),e[4]=d,e[5]=c):c=e[5];let m;e[6]!==n.label?(m=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=m):m=e[7];let u;e[8]!==o||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(J,{onClick:o,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=o,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=m,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==c||e[16]!==u?(f=s.jsx(K,{className:c,children:u},a),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function Al(t){const e=C.c(12),{section:n}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ut,{className:"my-2"}),e[0]=l):l=e[0],l}case"spacer":{let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1"}),e[1]=l):l=e[1],l}case"group":{const l=n.group.label,r=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(zl),e[2]=n.group.items,e[3]=i):i=e[3];let o;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(o=s.jsx(ds,{label:l,defaultExpanded:r,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=o):o=e[7],o}case"items":{let l;e[8]!==n.items?(l=n.items.map($l),e[8]=n.items,e[9]=l):l=e[9];let r;return e[10]!==l?(r=s.jsx(dt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(mt,{children:s.jsx(fe,{className:"gap-1.5",children:l})})}),e[10]=l,e[11]=r):r=e[11],r}case"custom":return n.content}}function $l(t){return s.jsx(ms,{item:t},t.key)}function zl(t){return s.jsx(ms,{item:t},t.key)}function Tl(t){const e=C.c(14),{sections:n,footer:l,additionalContent:r,variant:i,contentClassName:o}=t,a=i===void 0?"sidebar":i;let d;e[0]!==o?(d=F("flex flex-col flex-1 px-2 py-2 gap-0.5",o),e[0]=o,e[1]=d):d=e[1];let c;e[2]!==n?(c=n.map(Ml),e[2]=n,e[3]=c):c=e[3];let m;e[4]!==r?(m=r&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:r}),e[4]=r,e[5]=m):m=e[5];let u;e[6]!==d||e[7]!==c||e[8]!==m?(u=s.jsxs(Gt,{className:d,children:[c,m]}),e[6]=d,e[7]=c,e[8]=m,e[9]=u):u=e[9];let f;return e[10]!==l||e[11]!==u||e[12]!==a?(f=s.jsxs(Xs,{variant:a,children:[u,l]}),e[10]=l,e[11]=u,e[12]=a,e[13]=f):f=e[13],f}function Ml(t,e){return s.jsx(Al,{section:t},e)}function us(t){const e=C.c(2);let n;return e[0]!==t?(n=s.jsx(Tl,{...t}),e[0]=t,e[1]=n):n=e[1],n}us.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(oe,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Ol(t){const e=C.c(16),{onToggle:n,className:l}=t,i=zs().logo??Ts,o=typeof i=="string"?i:i.light,a=typeof i=="string"?i:i.dark;let d;e[0]!==l?(d=F("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",l),e[0]=l,e[1]=d):d=e[1];let c;e[2]!==o?(c=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=o,e[3]=c):c=e[3];let m;e[4]!==a?(m=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=a,e[5]=m):m=e[5];let u;e[6]!==c||e[7]!==m?(u=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[c,m]})}),e[6]=c,e[7]=m,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(qt,{size:16}),e[9]=f):f=e[9];let x;e[10]!==n?(x=s.jsx(ae,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=x):x=e[11];let p;return e[12]!==d||e[13]!==u||e[14]!==x?(p=s.jsxs(Qs,{className:d,children:[u,x]}),e[12]=d,e[13]=u,e[14]=x,e[15]=p):p=e[15],p}function kt(t){const e=C.c(18),{item:n,onClose:l}=t,r=n.isActive&&"z-10";let i;e[0]!==r?(i=F(r),e[0]=r,e[1]=i):i=e[1];let o;e[2]!==n||e[3]!==l?(o=()=>{n.onClick?.(),l()},e[2]=n,e[3]=l,e[4]=o):o=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let d;e[7]!==n.label?(d=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=d):d=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==o||e[12]!==a||e[13]!==d?(c=s.jsxs(J,{onClick:o,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=o,e[12]=a,e[13]=d,e[14]=c):c=e[14];let m;return e[15]!==i||e[16]!==c?(m=s.jsx(K,{className:i,children:c}),e[15]=i,e[16]=c,e[17]=m):m=e[17],m}function Dl(t){const e=C.c(18),{section:n,onClose:l}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ut,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,i=n.group.defaultExpanded;let o;if(e[2]!==l||e[3]!==n.group.items){let d;e[5]!==l?(d=c=>s.jsx(kt,{item:c,onClose:l},c.key),e[5]=l,e[6]=d):d=e[6],o=n.group.items.map(d),e[2]=l,e[3]=n.group.items,e[4]=o}else o=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==o?(a=s.jsx(ds,{label:r,defaultExpanded:i,children:o}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=o,e[10]=a):a=e[10],a}case"items":{let r;if(e[11]!==l||e[12]!==n.items){let o;e[14]!==l?(o=a=>s.jsx(kt,{item:a,onClose:l},a.key),e[14]=l,e[15]=o):o=e[15],r=n.items.map(o),e[11]=l,e[12]=n.items,e[13]=r}else r=e[13];let i;return e[16]!==r?(i=s.jsx(dt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(mt,{children:s.jsx(fe,{className:"gap-1.5",children:r})})}),e[16]=r,e[17]=i):i=e[17],i}case"custom":return n.content}}function Pl(t){const e=C.c(17),{sections:n,onClose:l,footer:r,additionalContent:i}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=o):o=e[0];let a;e[1]!==l?(a=s.jsx(D.Suspense,{fallback:o,children:s.jsx(Ol,{onToggle:l})}),e[1]=l,e[2]=a):a=e[2];let d;if(e[3]!==l||e[4]!==n){let f;e[6]!==l?(f=(x,p)=>s.jsx(Dl,{section:x,onClose:l},p),e[6]=l,e[7]=f):f=e[7],d=n.map(f),e[3]=l,e[4]=n,e[5]=d}else d=e[5];let c;e[8]!==i?(c=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[8]=i,e[9]=c):c=e[9];let m;e[10]!==d||e[11]!==c?(m=s.jsxs(Gt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[d,c]}),e[10]=d,e[11]=c,e[12]=m):m=e[12];let u;return e[13]!==r||e[14]!==a||e[15]!==m?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,m,r]}),e[13]=r,e[14]=a,e[15]=m,e[16]=u):u=e[16],u}function Be(t){const e=C.c(22),{item:n,onClose:l}=t;if(n.href){const d=n.external?"_blank":void 0,c=n.external?"noopener noreferrer":void 0;let m;e[0]!==n.icon?(m=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=m):m=e[1];let u;e[2]!==n.label?(u=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=u):u=e[3];let f;return e[4]!==n.href||e[5]!==l||e[6]!==d||e[7]!==c||e[8]!==m||e[9]!==u?(f=s.jsxs("a",{href:n.href,target:d,rel:c,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:l,children:[m,u]}),e[4]=n.href,e[5]=l,e[6]=d,e[7]=c,e[8]=m,e[9]=u,e[10]=f):f=e[10],f}let r;e[11]!==n||e[12]!==l?(r=()=>{n.onClick?.(),l()},e[11]=n,e[12]=l,e[13]=r):r=e[13];let i;e[14]!==n.icon?(i=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=i):i=e[15];let o;e[16]!==n.label?(o=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=o):o=e[17];let a;return e[18]!==r||e[19]!==i||e[20]!==o?(a=s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[i,o]}),e[18]=r,e[19]=i,e[20]=o,e[21]=a):a=e[21],a}function It(t){const e=C.c(126),{user:n,userImage:l,menuItems:r,signOutItem:i,themeOptions:o,preferences:a,setPreferences:d,close:c,isMobile:m}=t;if(m){const T=n?.name??"U";let P;e[0]!==T||e[1]!==l?(P=s.jsx(Oe,{url:l,fallback:T,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=T,e[1]=l,e[2]=P):P=e[2];const Y=n?.name??"User";let q;e[3]!==Y?(q=s.jsx("p",{className:"text-sm font-medium truncate",children:Y}),e[3]=Y,e[4]=q):q=e[4];const le=n?.email;let W;e[5]!==le?(W=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:le}),e[5]=le,e[6]=W):W=e[6];let re;e[7]!==q||e[8]!==W?(re=s.jsxs("div",{className:"flex-1 min-w-0",children:[q,W]}),e[7]=q,e[8]=W,e[9]=re):re=e[9];let ie;e[10]!==n?(ie=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ll)},e[10]=n,e[11]=ie):ie=e[11];let ce;e[12]===Symbol.for("react.memo_cache_sentinel")?(ce=s.jsx(yt,{size:14}),e[12]=ce):ce=e[12];let ge;e[13]!==ie?(ge=s.jsx(he,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:ie,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ce})}),e[13]=ie,e[14]=ge):ge=e[14];let ye;e[15]===Symbol.for("react.memo_cache_sentinel")?(ye=s.jsx(xe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=ye):ye=e[15];let I;e[16]!==ge?(I=s.jsx(nt,{delayDuration:300,children:s.jsxs(pe,{children:[ge,ye]})}),e[16]=ge,e[17]=I):I=e[17];let L;e[18]!==I||e[19]!==P||e[20]!==re?(L=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[P,re,I]}),e[18]=I,e[19]=P,e[20]=re,e[21]=L):L=e[21];let V;if(e[22]!==c||e[23]!==r){let me;e[25]!==c?(me=Le=>s.jsx(Be,{item:Le,onClose:c},Le.key),e[25]=c,e[26]=me):me=e[26],V=r.map(me),e[22]=c,e[23]=r,e[24]=V}else V=e[24];let H;e[27]!==c||e[28]!==i?(H=s.jsx(Be,{item:i,onClose:c}),e[27]=c,e[28]=i,e[29]=H):H=e[29];let de;e[30]!==V||e[31]!==H?(de=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[V,H]})}),e[30]=V,e[31]=H,e[32]=de):de=e[32];let Se;if(e[33]!==a.theme||e[34]!==d||e[35]!==o){let me;e[37]!==a.theme||e[38]!==d?(me=Le=>{const{value:Ze,icon:Is,label:As}=Le;return s.jsx("button",{type:"button","aria-label":As,onClick:()=>d($s=>({...$s,theme:Ze})),className:F("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Ze?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Is},Ze)},e[37]=a.theme,e[38]=d,e[39]=me):me=e[39],Se=o.map(me),e[33]=a.theme,e[34]=d,e[35]=o,e[36]=Se}else Se=e[36];let Ne;e[40]!==Se?(Ne=s.jsx("div",{className:"flex items-center gap-0.5",children:Se}),e[40]=Se,e[41]=Ne):Ne=e[41];const Ye=a.enableSounds?"Disable sounds":"Enable sounds";let _e;e[42]!==d?(_e=()=>d(Fl),e[42]=d,e[43]=_e):_e=e[43];const Je=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let we;e[44]!==Je?(we=F("size-8 rounded-md flex items-center justify-center transition-colors",Je),e[44]=Je,e[45]=we):we=e[45];let Ce;e[46]!==a.enableSounds?(Ce=a.enableSounds?s.jsx(St,{size:14}):s.jsx(Nt,{size:14}),e[46]=a.enableSounds,e[47]=Ce):Ce=e[47];let ke;e[48]!==Ye||e[49]!==_e||e[50]!==we||e[51]!==Ce?(ke=s.jsx("button",{type:"button","aria-label":Ye,onClick:_e,className:we,children:Ce}),e[48]=Ye,e[49]=_e,e[50]=we,e[51]=Ce,e[52]=ke):ke=e[52];let Re;e[53]===Symbol.for("react.memo_cache_sentinel")?(Re=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.22.2"]}),e[53]=Re):Re=e[53];let Ie;e[54]!==ke?(Ie=s.jsxs("div",{className:"flex items-center gap-2",children:[ke,Re]}),e[54]=ke,e[55]=Ie):Ie=e[55];let Ae;e[56]!==Ne||e[57]!==Ie?(Ae=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ne,Ie]}),e[56]=Ne,e[57]=Ie,e[58]=Ae):Ae=e[58];let Fe;return e[59]!==L||e[60]!==de||e[61]!==Ae?(Fe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[L,de,Ae]}),e[59]=L,e[60]=de,e[61]=Ae,e[62]=Fe):Fe=e[62],Fe}const u=n?.name??"U";let f;e[63]!==u||e[64]!==l?(f=s.jsx(Oe,{url:l,fallback:u,shape:"circle",size:"sm",className:"shrink-0"}),e[63]=u,e[64]=l,e[65]=f):f=e[65];const x=n?.name??"User";let p;e[66]!==x?(p=s.jsx("p",{className:"text-sm font-medium truncate",children:x}),e[66]=x,e[67]=p):p=e[67];const h=n?.email;let g;e[68]!==h?(g=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:h}),e[68]=h,e[69]=g):g=e[69];let b;e[70]!==p||e[71]!==g?(b=s.jsxs("div",{className:"flex-1 min-w-0",children:[p,g]}),e[70]=p,e[71]=g,e[72]=b):b=e[72];let j;e[73]!==n?(j=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Rl)},e[73]=n,e[74]=j):j=e[74];let v;e[75]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(yt,{size:14}),e[75]=v):v=e[75];let y;e[76]!==j?(y=s.jsx(he,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:j,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:v})}),e[76]=j,e[77]=y):y=e[77];let w;e[78]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(xe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[78]=w):w=e[78];let k;e[79]!==y?(k=s.jsx(nt,{delayDuration:300,children:s.jsxs(pe,{children:[y,w]})}),e[79]=y,e[80]=k):k=e[80];let S;e[81]!==k||e[82]!==f||e[83]!==b?(S=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[f,b,k]}),e[81]=k,e[82]=f,e[83]=b,e[84]=S):S=e[84];let N;if(e[85]!==c||e[86]!==r){let T;e[88]!==c?(T=P=>s.jsx(Be,{item:P,onClose:c},P.key),e[88]=c,e[89]=T):T=e[89],N=r.map(T),e[85]=c,e[86]=r,e[87]=N}else N=e[87];let _;e[90]!==c||e[91]!==i?(_=s.jsx(Be,{item:i,onClose:c}),e[90]=c,e[91]=i,e[92]=_):_=e[92];let A;e[93]!==N||e[94]!==_?(A=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[N,_]}),e[93]=N,e[94]=_,e[95]=A):A=e[95];let O;if(e[96]!==a.theme||e[97]!==d||e[98]!==o){let T;e[100]!==a.theme||e[101]!==d?(T=P=>{const{value:Y,icon:q,label:le}=P;return s.jsx("button",{type:"button","aria-label":le,onClick:()=>d(W=>({...W,theme:Y})),className:F("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===Y?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:q},Y)},e[100]=a.theme,e[101]=d,e[102]=T):T=e[102],O=o.map(T),e[96]=a.theme,e[97]=d,e[98]=o,e[99]=O}else O=e[99];let $;e[103]!==O?($=s.jsx("div",{className:"flex items-center gap-0.5",children:O}),e[103]=O,e[104]=$):$=e[104];const z=a.enableSounds?"Disable sounds":"Enable sounds";let R;e[105]!==d?(R=()=>d(El),e[105]=d,e[106]=R):R=e[106];const U=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let E;e[107]!==U?(E=F("size-7 rounded-md flex items-center justify-center transition-colors",U),e[107]=U,e[108]=E):E=e[108];let B;e[109]!==a.enableSounds?(B=a.enableSounds?s.jsx(St,{size:14}):s.jsx(Nt,{size:14}),e[109]=a.enableSounds,e[110]=B):B=e[110];let M;e[111]!==z||e[112]!==R||e[113]!==E||e[114]!==B?(M=s.jsx("button",{type:"button","aria-label":z,onClick:R,className:E,children:B}),e[111]=z,e[112]=R,e[113]=E,e[114]=B,e[115]=M):M=e[115];let G;e[116]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.22.2"]}),e[116]=G):G=e[116];let X;e[117]!==M?(X=s.jsxs("div",{className:"flex items-center gap-2",children:[M,G]}),e[117]=M,e[118]=X):X=e[118];let Q;e[119]!==$||e[120]!==X?(Q=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[$,X]}),e[119]=$,e[120]=X,e[121]=Q):Q=e[121];let te;return e[122]!==S||e[123]!==A||e[124]!==Q?(te=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[S,A,Q]})}),e[122]=S,e[123]=A,e[124]=Q,e[125]=te):te=e[125],te}function El(t){return{...t,enableSounds:!t.enableSounds}}function Rl(){se.success("User ID copied")}function Fl(t){return{...t,enableSounds:!t.enableSounds}}function Ll(){se.success("User ID copied")}function it(){const t=C.c(34),{data:e}=be.useSession(),{org:n}=ee(),l=ne();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org",shouldThrow:!1},t[0]=r):r=t[0];const o=Ms(r)?.params.org,[a,d]=Os(),c=ft(),[m,u]=D.useState(!1),f=e?.user,x=f?.image;let p;t[1]===Symbol.for("react.memo_cache_sentinel")?(p=()=>u(!1),t[1]=p):p=t[1];const h=p;let g;t[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Ve,{size:16}),t[2]=g):g=t[2];let b;t[3]!==l||t[4]!==o?(b={key:"preferences",label:"Preferences",icon:g,onClick:()=>{l({to:"/$org/settings/profile",params:{org:o??""}})}},t[3]=l,t[4]=o,t[5]=b):b=t[5];let j;t[6]!==n||t[7]!==l?(j=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(sn,{size:16}),onClick:()=>{l({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=l,t[8]=j):j=t[8];let v;t[9]===Symbol.for("react.memo_cache_sentinel")?(v={key:"terms",label:"Terms of Use",icon:s.jsx(ln,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=v):v=t[9];let y;t[10]===Symbol.for("react.memo_cache_sentinel")?(y={key:"privacy",label:"Privacy Policy",icon:s.jsx(mn,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=y):y=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w={key:"github",label:"decocms/studio",icon:s.jsx(Ds,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=w):w=t[11];let k;t[12]===Symbol.for("react.memo_cache_sentinel")?(k={key:"community",label:"Community",icon:s.jsx(un,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=k):k=t[12];let S;t[13]===Symbol.for("react.memo_cache_sentinel")?(S={key:"homepage",label:"Homepage",icon:s.jsx(nn,{size:16}),href:"https://decocms.com",external:!0},t[13]=S):S=t[13];let N;t[14]!==b||t[15]!==j?(N=[b,...j,v,y,w,k,S],t[14]=b,t[15]=j,t[16]=N):N=t[16];const _=N;let A;t[17]===Symbol.for("react.memo_cache_sentinel")?(A={key:"logout",label:"Sign out",icon:s.jsx(rn,{size:16}),onClick:Hl},t[17]=A):A=t[17];const O=A;let $;t[18]===Symbol.for("react.memo_cache_sentinel")?($={value:"light",icon:s.jsx(an,{size:14}),label:"Light theme"},t[18]=$):$=t[18];let z;t[19]===Symbol.for("react.memo_cache_sentinel")?(z={value:"dark",icon:s.jsx(cn,{size:14}),label:"Dark theme"},t[19]=z):z=t[19];let R;t[20]===Symbol.for("react.memo_cache_sentinel")?(R=[$,z,{value:"system",icon:s.jsx(Xt,{size:14}),label:"System theme"}],t[20]=R):R=t[20];const U=R;let E;t[21]!==c||t[22]!==_||t[23]!==a||t[24]!==d||t[25]!==f||t[26]!==x?(E={user:f,userImage:x,menuItems:_,signOutItem:O,themeOptions:U,preferences:a,setPreferences:d,close:h,isMobile:c},t[21]=c,t[22]=_,t[23]=a,t[24]=d,t[25]=f,t[26]=x,t[27]=E):E=t[27];const B=E;let M;return t[28]!==c||t[29]!==m||t[30]!==B||t[31]!==f?.name||t[32]!==x?(M=s.jsx(s.Fragment,{children:c?s.jsxs(Wt,{open:m,onOpenChange:u,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx(Oe,{url:x,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]}),s.jsxs(Kt,{className:"h-[80dvh] p-0",children:[s.jsx(Vt,{className:"sr-only",children:"Account"}),s.jsx(It,{...B})]})]}):s.jsxs(De,{open:m,onOpenChange:u,children:[s.jsx(je,{asChild:!0,children:s.jsxs(J,{tooltip:f?.name??"Account",className:"rounded-md",children:[s.jsx(Oe,{url:x,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]})}),s.jsx(Pe,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Bl,children:s.jsx(It,{...B})})]})}),t[28]=c,t[29]=m,t[30]=B,t[31]=f?.name,t[32]=x,t[33]=M):M=t[33],M}function Bl(t){return t.preventDefault()}function Hl(){ue("signed_out",{source:"account_popover"}),Ps(),be.signOut()}const At=["requires_action","in_progress","failed","expired","completed"];function Ul(t){const e=new Map(At.map(n=>[n,[]]));for(const n of t){const l=n.status??"completed";(e.get(l)??e.get("completed")).push(n)}return At.map(n=>({status:n,threads:e.get(n)}))}function fs(t){const e=C.c(4),{onClick:n}=t;let l,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(rt,{}),r=s.jsx("span",{children:"Add repo"}),e[0]=l,e[1]=r):(l=e[0],r=e[1]);let i;return e[2]!==n?(i=s.jsxs(J,{tooltip:"Add repo",onClick:n,children:[l,r]}),e[2]=n,e[3]=i):i=e[3],i}function Gl(t){const e=C.c(41),{onAddNew:n}=t,{org:l}=ee(),r=Lt(),i=ne(),o=_n();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const c=Ke(a).virtualmcpid??null;let m;e[1]!==c?(m=!!c&&!Jt(c),e[1]=c,e[2]=m):m=e[2];const u=m;let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f={slug:"mcp-github"},e[3]=f):f=e[3];const p=yn(f).filter(Wl),h=ht(),b=xt(u?c:null)?.metadata?.githubRepo?.connectionId??null;let j;e[4]!==l.id||e[5]!==l.slug?(j={connectionId:Zt,orgId:l.id,orgSlug:l.slug},e[4]=l.id,e[5]=l.slug,e[6]=j):j=e[6];const v=Yt(j);if(p.length===0){let T;return e[7]!==n?(T=s.jsx(fs,{onClick:n}),e[7]=n,e[8]=T):T=e[8],T}let y;e[9]!==c||e[10]!==i||e[11]!==l.id||e[12]!==r||e[13]!==v?(y=async(T,P)=>{await v.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:c,data:{metadata:{githubRepo:T}}}}),vt(r,l.id),se.success(`Previewing ${P}`),i({to:".",search:ql,replace:!0})},e[9]=c,e[10]=i,e[11]=l.id,e[12]=r,e[13]=v,e[14]=y):y=e[14];const w=y;let k;e[15]!==h||e[16]!==o||e[17]!==l.id||e[18]!==r||e[19]!==v?(k=async(T,P,Y)=>{const q=h.find(re=>{const ie=re.metadata?.githubRepo;return ie?.owner?.toLowerCase()===T.owner.toLowerCase()&&ie?.name?.toLowerCase()===T.name.toLowerCase()});if(q){o(q.id,{search:{main:"preview"}});return}const W=(await v.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:T.name,description:`Imported from ${Y}`,status:"active",pinned:!1,icon:null,connections:[{connection_id:P}],metadata:{githubRepo:T,instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}}}}})).structuredContent?.item?.id;if(vt(r,l.id),!W)throw new Error("Failed to create the repo agent");se.success(`Created ${Y}`),o(W,{search:{main:"preview"}})},e[15]=h,e[16]=o,e[17]=l.id,e[18]=r,e[19]=v,e[20]=k):k=e[20];const S=k;let N;e[21]!==w||e[22]!==u||e[23]!==S?(N=async T=>{const P=lt(T);if(!P)return;const Y=`${P.owner}/${P.repo}`,q={owner:P.owner,name:P.repo,url:`https://github.com/${P.owner}/${P.repo}`,installationId:P.installationId,connectionId:T.id};try{u?await w(q,Y):await S(q,T.id,Y)}catch(le){const W=le;se.error("Failed to set preview repo: "+(W instanceof Error?W.message:"Unknown error"))}},e[21]=w,e[22]=u,e[23]=S,e[24]=N):N=e[24];const _=N,A=bn;let O;e[25]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(jn,{asChild:!0,children:s.jsxs(J,{children:[s.jsx(rt,{}),s.jsx("span",{children:"Add repo"})]})}),e[25]=O):O=e[25];const $=gn,z="start",R="right",U="w-56";let E;e[26]!==b||e[27]!==_?(E=T=>{const P=lt(T);return P?s.jsxs(wt,{onSelect:()=>_(T),children:[s.jsx(rt,{className:"size-4 text-muted-foreground"}),s.jsxs("span",{className:"flex-1 truncate",children:[P.owner,"/",P.repo]}),T.id===b&&s.jsx(Ee,{className:"size-4"})]},T.id):null},e[26]=b,e[27]=_,e[28]=E):E=e[28];const B=p.map(E);let M;e[29]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(vn,{}),e[29]=M):M=e[29];let G;e[30]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx($e,{className:"size-4"}),e[30]=G):G=e[30];let X;e[31]!==n?(X=s.jsxs(wt,{onSelect:n,children:[G,"Add new repo…"]}),e[31]=n,e[32]=X):X=e[32];let Q;e[33]!==$||e[34]!==B||e[35]!==X?(Q=s.jsxs($,{align:z,side:R,className:U,children:[B,M,X]}),e[33]=$,e[34]=B,e[35]=X,e[36]=Q):Q=e[36];let te;return e[37]!==A||e[38]!==Q||e[39]!==O?(te=s.jsxs(A,{children:[O,Q]}),e[37]=A,e[38]=Q,e[39]=O,e[40]=te):te=e[40],te}function ql(t){return{...t,main:"preview"}}function Wl(t){return lt(t)!==null&&Nn(t)}function Kl(){const t=C.c(4),[e,n]=D.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(fs,{onClick:()=>n(!0)}),t[0]=l):l=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(D.Suspense,{fallback:l,children:s.jsx(Gl,{onAddNew:()=>n(!0)})}),t[1]=r):r=t[1];let i;return t[2]!==e?(i=s.jsxs(s.Fragment,{children:[r,s.jsx(Sn,{open:e,onOpenChange:n,mode:"connection"})]}),t[2]=e,t[3]=i):i=t[3],i}function ot(){const t=C.c(22),e=Tn(),[n,l]=D.useState(!1);let r;if(t[0]!==e.capabilities||t[1]!==e.hostname||t[2]!==e.machineId||t[3]!==e.online){const h=Mn(e.capabilities);r=e.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:e.hostname??e.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:h.length>0?`Available: ${h.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),t[0]=e.capabilities,t[1]=e.hostname,t[2]=e.machineId,t[3]=e.online,t[4]=r}else r=t[4];const i=r;let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=()=>l(!0),t[5]=o):o=t[5];const a=e.online?"Desktop linked":"Connect your desktop";let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Xt,{size:16}),t[6]=d):d=t[6];let c;t[7]!==e.online?(c=e.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),t[7]=e.online,t[8]=c):c=t[8];let m;t[9]!==a||t[10]!==c?(m=s.jsx(he,{asChild:!0,children:s.jsxs(ae,{onClick:o,"aria-label":a,children:[d,c]})}),t[9]=a,t[10]=c,t[11]=m):m=t[11];let u;t[12]!==i?(u=s.jsx(xe,{side:"bottom",children:i}),t[12]=i,t[13]=u):u=t[13];let f;t[14]!==m||t[15]!==u?(f=s.jsxs(pe,{children:[m,u]}),t[14]=m,t[15]=u,t[16]=f):f=t[16];let x;t[17]!==n?(x=s.jsx(On,{open:n,onOpenChange:l}),t[17]=n,t[18]=x):x=t[18];let p;return t[19]!==f||t[20]!==x?(p=s.jsxs(s.Fragment,{children:[f,x]}),t[19]=f,t[20]=x,t[21]=p):p=t[21],p}function Vl({invitation:t}){const[e,n]=D.useState(!1),[l,r]=D.useState(!1),i=Lt(),o=async()=>{n(!0);try{const c=await be.organization.acceptInvitation({invitationId:t.id});if(c.error){se.error(c.error.message),n(!1);return}}catch{se.error("Failed to accept invitation"),n(!1);return}se.success("Invitation accepted!"),Es();let d;try{d=(await be.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=d?`/${d}`:"/"},a=async()=>{r(!0);try{const d=await be.organization.rejectInvitation({invitationId:t.id});d.error?(se.error(d.error.message),r(!1)):(se.success("Invitation declined"),i.invalidateQueries())}catch{se.error("Failed to decline invitation"),r(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(ze,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:o,disabled:e||l,"aria-label":"Accept invitation",children:s.jsx(Ee,{size:14})}),s.jsx(ze,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||l,"aria-label":"Decline invitation",children:s.jsx(ss,{size:14})})]})]})}function Xl(t){const e=C.c(29),{request:n}=t,{approve:l,deny:r}=Dn(),i=l.isPending||r.isPending,o=n.user?.name??n.user?.email??n.userId,a=n.user?.image??void 0;let d;e[0]!==o?(d=o.charAt(0).toUpperCase(),e[0]=o,e[1]=d):d=e[1];let c;e[2]!==a||e[3]!==d?(c=s.jsx(Oe,{url:a,fallback:d,shape:"circle",size:"sm"}),e[2]=a,e[3]=d,e[4]=c):c=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Requested to join"}),e[5]=m):m=e[5];let u;e[6]!==o?(u=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,s.jsx("p",{className:"text-sm font-medium truncate",children:o})]}),e[6]=o,e[7]=u):u=e[7];let f;e[8]!==l||e[9]!==n.id?(f=()=>l.mutate(n.id),e[8]=l,e[9]=n.id,e[10]=f):f=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ee,{size:14}),e[11]=x):x=e[11];let p;e[12]!==i||e[13]!==f?(p=s.jsx(ze,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:f,disabled:i,"aria-label":"Approve join request",children:x}),e[12]=i,e[13]=f,e[14]=p):p=e[14];let h;e[15]!==r||e[16]!==n.id?(h=()=>r.mutate(n.id),e[15]=r,e[16]=n.id,e[17]=h):h=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ss,{size:14}),e[18]=g):g=e[18];let b;e[19]!==i||e[20]!==h?(b=s.jsx(ze,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:h,disabled:i,"aria-label":"Deny join request",children:g}),e[19]=i,e[20]=h,e[21]=b):b=e[21];let j;e[22]!==b||e[23]!==p?(j=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[p,b]}),e[22]=b,e[23]=p,e[24]=j):j=e[24];let v;return e[25]!==j||e[26]!==c||e[27]!==u?(v=s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[c,u,j]}),e[25]=j,e[26]=c,e[27]=u,e[28]=v):v=e[28],v}function Ql(t){const e=C.c(14),{release:n,isSeen:l,onSelect:r}=t;let i;e[0]!==l?(i=!l&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=l,e[1]=i):i=e[1];let o;e[2]!==n.eyebrow?(o=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=o):o=e[3];let a;e[4]!==n.title?(a=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let d;e[6]!==o||e[7]!==a?(d=s.jsxs("div",{className:"flex-1 min-w-0",children:[o,a]}),e[6]=o,e[7]=a,e[8]=d):d=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ns,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=c):c=e[9];let m;return e[10]!==r||e[11]!==i||e[12]!==d?(m=s.jsxs("button",{type:"button",onClick:r,className:"relative w-full flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors text-left",children:[i,d,c]}),e[10]=r,e[11]=i,e[12]=d,e[13]=m):m=e[13],m}function Yl(){const t=D.useContext(Rs),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(l=>l.status==="pending"&&new Date(l.expiresAt)>new Date)}function hs(){const t=C.c(11),{isSeen:e,markSeen:n,unseenCount:l}=En(),r=Yl(),i=Pn();let o;if(t[0]!==e||t[1]!==r||t[2]!==i){const c=[...i].sort(sr).map(tr),m=[...r].sort(er).map(Zl);let u;t[4]!==e?(u=x=>({type:"release",release:x,isSeen:e(x.id)}),t[4]=e,t[5]=u):u=t[5];const f=[...Rn].sort(Jl).map(u);o=[...c,...m,...f],t[0]=e,t[1]=r,t[2]=i,t[3]=o}else o=t[3];const a=l+r.length+i.length;let d;return t[6]!==n||t[7]!==r||t[8]!==o||t[9]!==a?(d={items:o,pendingInvitations:r,redDotCount:a,markReleaseSeen:n},t[6]=n,t[7]=r,t[8]=o,t[9]=a,t[10]=d):d=t[10],d}function Jl(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function Zl(t){return{type:"invitation",invitation:t}}function er(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}function tr(t){return{type:"join-request",request:t}}function sr(t,e){return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}class xs extends D.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function ps(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function nr(){const t=C.c(17),e=ne(),{org:n}=ee(),{hasDecoKey:l,balanceDollars:r}=ts();if(!l)return null;let i;t[0]!==r?(i=r!=null?`Credits: $${r.toFixed(2)}`:"Credits",t[0]=r,t[1]=i):i=t[1];let o;t[2]!==r?(o=F(r!=null&&ps(r)),t[2]=r,t[3]=o):o=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Qt,{}),t[7]=d):d=t[7];let c;t[8]!==r?(c=r!=null?`$${r.toFixed(2)}`:"Credits",t[8]=r,t[9]=c):c=t[9];let m;t[10]!==c?(m=s.jsx("span",{children:c}),t[10]=c,t[11]=m):m=t[11];let u;return t[12]!==i||t[13]!==o||t[14]!==a||t[15]!==m?(u=s.jsx(fe,{children:s.jsx(K,{children:s.jsxs(J,{tooltip:i,className:o,onClick:a,children:[d,m]})})}),t[12]=i,t[13]=o,t[14]=a,t[15]=m,t[16]=u):u=t[16],u}function lr(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(xs,{children:s.jsx(D.Suspense,{fallback:null,children:s.jsx(nr,{})})}),t[0]=e):e=t[0],e}function rr(){const t=C.c(17),e=ne(),{org:n}=ee(),{hasDecoKey:l,balanceDollars:r}=ts();if(!l)return null;let i;t[0]!==r?(i=r!=null?`Credits: $${r.toFixed(2)}`:"Credits",t[0]=r,t[1]=i):i=t[1];const o=i;let a;t[2]!==e||t[3]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[2]=e,t[3]=n.slug,t[4]=a):a=t[4];let d;t[5]!==r?(d=F(r!=null&&ps(r)),t[5]=r,t[6]=d):d=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Qt,{className:"size-4"}),t[7]=c):c=t[7];let m;t[8]!==a||t[9]!==d||t[10]!==o?(m=s.jsx(he,{asChild:!0,children:s.jsx(ae,{"aria-label":o,onClick:a,className:d,children:c})}),t[8]=a,t[9]=d,t[10]=o,t[11]=m):m=t[11];let u;t[12]!==o?(u=s.jsx(xe,{side:"top",children:o}),t[12]=o,t[13]=u):u=t[13];let f;return t[14]!==m||t[15]!==u?(f=s.jsxs(pe,{delayDuration:300,children:[m,u]}),t[14]=m,t[15]=u,t[16]=f):f=t[16],f}function ir(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(xs,{children:s.jsx(D.Suspense,{fallback:null,children:s.jsx(rr,{})})}),t[0]=e):e=t[0],e}function gs(t){const e=C.c(15),{children:n}=t,{items:l,markReleaseSeen:r}=hs(),[i,o]=D.useState(null);let a;if(e[0]!==l||e[1]!==i){let h;e[3]!==i?(h=g=>g.type==="release"&&g.release.id===i,e[3]=i,e[4]=h):h=e[4],a=l.find(h),e[0]=l,e[1]=i,e[2]=a}else a=e[2];const d=a,c=d?.type==="release"?d.release:null;let m;e[5]!==r?(m=h=>{o(h),r(h)},e[5]=r,e[6]=m):m=e[6];const u=m;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=h=>{h||o(null)},e[7]=f):f=e[7];let x;e[8]!==u||e[9]!==l||e[10]!==c?(x=s.jsx(Pe,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:c?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-border shrink-0",children:[s.jsx(ze,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>o(null),children:s.jsx(dn,{size:16})}),s.jsx("h3",{className:"text-sm font-medium truncate",children:c.title})]}),s.jsx("div",{className:"overflow-y-auto flex-1 p-5",children:s.jsx(Fn,{release:c})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),l.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(Xe,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Nothing here yet"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Invitations, join requests, and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:l.map(h=>h.type==="join-request"?s.jsx(Xl,{request:h.request},`req-${h.request.id}`):h.type==="invitation"?s.jsx(Vl,{invitation:h.invitation},`inv-${h.invitation.id}`):s.jsx(Ql,{release:h.release,isSeen:h.isSeen,onSelect:()=>u(h.release.id)},`rel-${h.release.id}`))})]})}),e[8]=u,e[9]=l,e[10]=c,e[11]=x):x=e[11];let p;return e[12]!==n||e[13]!==x?(p=s.jsxs(De,{onOpenChange:f,children:[n,x]}),e[12]=n,e[13]=x,e[14]=p):p=e[14],p}function bs(){const{redDotCount:t}=hs();return t>0}function or(){const t=C.c(6),e=bs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Xe,{}),t[0]=n):n=t[0];let l;t[1]!==e?(l=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=l):l=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("span",{children:"Inbox"}),t[3]=r):r=t[3];let i;return t[4]!==l?(i=s.jsx(gs,{children:s.jsx(je,{asChild:!0,children:s.jsxs(J,{tooltip:"Inbox",className:"relative",children:[n,l,r]})})}),t[4]=l,t[5]=i):i=t[5],i}function ar(){const t=C.c(8),e=bs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Xe,{className:"size-4"}),t[0]=n):n=t[0];let l;t[1]!==e?(l=e&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=l):l=t[2];let r;t[3]!==l?(r=s.jsx(je,{asChild:!0,children:s.jsx(he,{asChild:!0,children:s.jsxs(ae,{"aria-label":"Inbox",children:[n,l]})})}),t[3]=l,t[4]=r):r=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(xe,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let o;return t[6]!==r?(o=s.jsx(gs,{children:s.jsxs(pe,{delayDuration:300,children:[r,i]})}),t[6]=r,t[7]=o):o=t[7],o}function cr(){const t=C.c(7),e=ne(),{org:n}=ee();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let r,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ve,{}),i=s.jsx("span",{children:"Settings"}),t[3]=r,t[4]=i):(r=t[3],i=t[4]);let o;return t[5]!==l?(o=s.jsxs(J,{tooltip:"Settings",onClick:l,children:[r,i]}),t[5]=l,t[6]=o):o=t[6],o}function dr(){const t=C.c(9),e=ne(),{org:n}=ee();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ve,{className:"size-4"}),t[3]=r):r=t[3];let i;t[4]!==l?(i=s.jsx(he,{asChild:!0,children:s.jsx(ae,{"aria-label":"Settings",onClick:l,children:r})}),t[4]=l,t[5]=i):i=t[5];let o;t[6]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(xe,{side:"top",children:"Settings"}),t[6]=o):o=t[6];let a;return t[7]!==i?(a=s.jsxs(pe,{delayDuration:300,children:[i,o]}),t[7]=i,t[8]=a):a=t[8],a}function mr(){const t=C.c(5),[e,n]=D.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(K,{children:s.jsx(An,{trigger:s.jsxs(J,{tooltip:"Invite members",children:[s.jsx(fn,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=l):l=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K,{children:s.jsx(Kl,{})}),t[1]=r):r=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(fe,{className:"gap-0.5",children:[l,r,s.jsx(K,{children:s.jsxs(J,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(on,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[2]=i):i=t[2];let o;return t[3]!==e?(o=s.jsxs(s.Fragment,{children:[i,s.jsx($n,{open:e,onOpenChange:n,mode:"browse"})]}),t[3]=e,t[4]=o):o=t[4],o}function ur(){const t=C.c(8),{state:e}=ve();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(lr,{}),t[0]=o):o=t[0];let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(K,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(ot,{})})}),t[1]=a):a=t[1];let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(K,{children:s.jsx(or,{})}),t[2]=d):d=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(K,{children:s.jsx(cr,{})}),t[3]=c):c=t[3];let m;return t[4]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs(st,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs(fe,{children:[a,d,c,s.jsx(K,{children:s.jsx(it,{})})]})]}),t[4]=m):m=t[4],m}let l,r;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(mr,{}),r=s.jsx(ut,{className:"mx-0"}),t[5]=l,t[6]=r):(l=t[5],r=t[6]);let i;return t[7]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(st,{className:"px-2 pb-3 gap-1.5",children:[l,r,s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(fe,{children:s.jsx(K,{children:s.jsx(it,{})})})}),s.jsx(dr,{}),s.jsx(ar,{}),s.jsx(ot,{}),s.jsx(ir,{})]})]}),t[7]=i):i=t[7],i}function fr(){const t=C.c(8),e=ne(),{org:n}=ee(),{setOpenMobile:l}=ve();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(fe,{children:s.jsx(K,{children:s.jsx(it,{})})})}),t[0]=r):r=t[0];let i;t[1]!==e||t[2]!==n.slug||t[3]!==l?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),l(!1)},t[1]=e,t[2]=n.slug,t[3]=l,t[4]=i):i=t[4];let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ve,{className:"size-4"}),t[5]=o):o=t[5];let a;return t[6]!==i?(a=s.jsx(st,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[r,s.jsx(ae,{"aria-label":"Settings",onClick:i,children:o})]})}),t[6]=i,t[7]=a):a=t[7],a}function $t(t){const e=C.c(15),{className:n,wrapperClassName:l,children:r}=t,[i,o]=D.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&o(b.scrollHeight>b.clientHeight+1)},e[0]=a):a=e[0];const d=a;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=b=>{const j=b.currentTarget;o(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=c):c=e[1];const m=c;let u;e[2]!==l?(u=F("relative",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==r||e[5]!==n?(f=s.jsx("div",{ref:d,onScroll:m,className:n,children:r}),e[4]=r,e[5]=n,e[6]=f):f=e[6];const x=i?"opacity-100":"opacity-0";let p;e[7]!==x?(p=F("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",x),e[7]=x,e[8]=p):p=e[8];let h;e[9]!==p?(h=s.jsx("div",{"aria-hidden":!0,className:p}),e[9]=p,e[10]=h):h=e[10];let g;return e[11]!==u||e[12]!==f||e[13]!==h?(g=s.jsxs("div",{className:u,children:[f,h]}),e[11]=u,e[12]=f,e[13]=h,e[14]=g):g=e[14],g}function hr(t){const e=C.c(8),{virtualMcpId:n,size:l,showAutomationBadge:r}=t,i=l===void 0?"sm":l;let o;e[0]!==i||e[1]!==n?(o=n?s.jsx(xr,{virtualMcpId:n,size:i}):s.jsx(Te,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=o):o=e[2];let a;e[3]!==r?(a=r&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(sl,{size:10,className:"text-white"})}),e[3]=r,e[4]=a):a=e[4];let d;return e[5]!==o||e[6]!==a?(d=s.jsxs("div",{className:"relative shrink-0",children:[o,a]}),e[5]=o,e[6]=a,e[7]=d):d=e[7],d}function xr(t){const e=C.c(6),{virtualMcpId:n,size:l}=t,r=xt(n);if(!r){let a;return e[0]!==l?(a=s.jsx(Te,{icon:null,name:"?",size:l}),e[0]=l,e[1]=a):a=e[1],a}const i=r.icon??null;let o;return e[2]!==r.title||e[3]!==l||e[4]!==i?(o=s.jsx(Te,{icon:i,name:r.title,size:l}),e[2]=r.title,e[3]=l,e[4]=i,e[5]=o):o=e[5],o}function zt(t){const e=C.c(36),{open:n,onOpenChange:l}=t,[r,i]=D.useState(""),{org:o}=ee(),{setTaskId:a}=pt(),d=rs();let c,m,u;e[0]!==o.id||e[1]!==r?(u=r.trim(),m=Ls,c=Fs.globalSearch(o.id,u),e[0]=o.id,e[1]=r,e[2]=c,e[3]=m,e[4]=u):(c=e[2],m=e[3],u=e[4]);const f=n&&u.length>0;let x;e[5]!==d||e[6]!==u?(x=async()=>await d.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=d,e[6]=u,e[7]=x):x=e[7];let p;e[8]!==c||e[9]!==f||e[10]!==x?(p={queryKey:c,enabled:f,queryFn:x,staleTime:1e4},e[8]=c,e[9]=f,e[10]=x,e[11]=p):p=e[11];const{data:h,isFetching:g}=m(p);let b;e[12]!==h?.items?(b=h?.items??[],e[12]=h?.items,e[13]=b):b=e[13];const j=b;let v;e[14]!==l?(v=z=>{z||i(""),l(z)},e[14]=l,e[15]=v):v=e[15];const y=v;let w;e[16]!==y||e[17]!==a?(w=z=>{y(!1),a(z.id,z.virtual_mcp_id??void 0)},e[16]=y,e[17]=a,e[18]=w):w=e[18];const k=w;let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsxs(Wn,{className:"sr-only",children:[s.jsx(Kn,{children:"Search"}),s.jsx(Vn,{children:"Search across your organization's resources."})]}),e[19]=S):S=e[19];let N;e[20]!==r?(N=s.jsx(Zn,{value:r,onValueChange:i,placeholder:"Search..."}),e[20]=r,e[21]=N):N=e[21];let _;e[22]!==k||e[23]!==g||e[24]!==j||e[25]!==u?(_=u?g&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Yn,{children:"No results."}):j.map(z=>z.type==="thread"?s.jsxs(Jn,{value:`thread:${z.id}:${z.title}`,onSelect:()=>k(z),className:"gap-2.5",children:[s.jsx(hr,{virtualMcpId:z.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:z.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(z.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${z.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=k,e[23]=g,e[24]=j,e[25]=u,e[26]=_):_=e[26];let A;e[27]!==_?(A=s.jsx(el,{children:_}),e[27]=_,e[28]=A):A=e[28];let O;e[29]!==N||e[30]!==A?(O=s.jsxs(Xn,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[S,s.jsxs(tl,{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:[N,A]})]}),e[29]=N,e[30]=A,e[31]=O):O=e[31];let $;return e[32]!==y||e[33]!==n||e[34]!==O?($=s.jsx(Qn,{open:n,onOpenChange:y,children:O}),e[32]=y,e[33]=n,e[34]=O,e[35]=$):$=e[35],$}const pr="sidebar.group.expanded.";function gr(t,e){const n=C.c(3),[l,r]=We(`${pr}${t}`,e);let i;return n[0]!==l||n[1]!==r?(i=[l,r],n[0]=l,n[1]=r,n[2]=i):i=n[2],i}function js(t){const e=C.c(12),{onClick:n,isFetching:l,indented:r}=t,i=r?"-ml-4 pl-6 pr-2":"px-2";let o;e[0]!==i?(o=F("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",i,"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[0]=i,e[1]=o):o=e[1];let a;e[2]!==l?(a=l&&s.jsx(Bt,{size:14,className:"animate-spin"}),e[2]=l,e[3]=a):a=e[3];const d=l?"Loading…":"Show more";let c;e[4]!==d?(c=s.jsx("span",{children:d}),e[4]=d,e[5]=c):c=e[5];let m;return e[6]!==l||e[7]!==n||e[8]!==o||e[9]!==a||e[10]!==c?(m=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:l,className:o,children:[a,c]}),e[6]=l,e[7]=n,e[8]=o,e[9]=a,e[10]=c,e[11]=m):m=e[11],m}function br(t,e,n,l){return[t,e,n,l.type,l.member,l.currentUserId??""].join("|")}function jr(t){return t.member==="mine"&&!t.currentUserId}const vs=4;let Ue=0;const at=[];function vr(){for(;Ue<vs&&at.length>0;){const t=at.shift();t&&t()}}function ys(t){return new Promise((e,n)=>{const l=()=>{Ue++,t().then(e,n).finally(()=>{Ue--,vr()})};Ue<vs?l():at.push(l)})}const Qe=10;function Tt(t,e,n,l,r){const i={hidden:!1};l.member==="mine"&&l.currentUserId&&(i.created_by=l.currentUserId),l.type==="automation"&&(i.has_trigger=!0),l.type==="manual"&&(i.has_trigger=!1);const o={where:i,limit:r,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return o.status=e,o}function yr(t,e,n,l){let r=0;for(const i of t)Ss(i,e,n,l)&&r++;return r}function et(t,e,n,l){return yr(t,e,n,l)}function Sr(t,e){return!!(t>=Qe||t===0&&e)}function Mt(t,e){return t<e}function Nr(t,e){return e===!1?!1:e===!0?!0:t}function Ss(t,e,n,l){return!(t.hidden||(t.status??"completed")!==n||l.member==="mine"&&l.currentUserId&&t.created_by!==l.currentUserId||l.type==="automation"&&!t.trigger_id||l.type==="manual"&&t.trigger_id)}const qe=new Map,He=new Map;function _r(t,e){return e?t>=Qe?!0:null:!1}function Ot(t){return qe.get(t)}function wr(t,e){qe.set(t,e)}function Cr(t,e,n){const l=qe.get(t);if(l!==void 0){n(l);return}let r=He.get(t);r||(r=ys(e).then(i=>(qe.set(t,i),He.delete(t),i)).catch(()=>(He.delete(t),Promise.reject(new Error("group probe failed")))),He.set(t,r)),r.then(n,()=>n(!1))}function Dt(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Qe,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function kr(t,e,n,l,r){let i=0;for(const o of t)e.has(o.id)||Ss(o,n,l,r)&&i++;return i}function Ir(t,e,n,l){const r=C.c(8),{org:i}=ee(),o=br(i.id,t,e,n);let a;r[0]!==n?(a=jr(n),r[0]=n,r[1]=a):a=r[1];const d=a,[c,m]=D.useState({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==o&&m({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});const u=Gn(),{threads:f,hasMore:x}=gt(),p=et(f,t,e,n),h=Sr(p,x),g=_r(p,x),b=rs();if(c.identity===o&&c.serverHasMore===null){const S=g??Ot(o);S!==void 0&&m({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:S})}!d&&c.identity===o&&c.serverHasMore===null&&g===null&&Ot(o)===void 0&&c.probeSubscribedIdentity!==o&&(m(S=>S.identity===o?{...S,isProbing:!0,probeSubscribedIdentity:o}:S),Cr(o,async()=>{const S=Tt(t,e,0,n,1),N=await b.call("COLLECTION_THREADS_LIST",S),{totalCount:_}=Dt(N),A=et(u.threads.get(),t,e,n);return _===void 0?!1:Mt(A,_)},S=>{m(N=>N.identity!==o?N:{...N,isProbing:!1,serverHasMore:S})}));const v=async function(){if(c.isFetching||c.isProbing||d)return;const N=o;m(_=>_.identity===N?{..._,isFetching:!0}:_);try{const _=et(f,t,e,n),A=Tt(t,e,_,n,Qe),O=await ys(()=>b.call("COLLECTION_THREADS_LIST",A)),{items:$,hasMore:z,totalCount:R}=Dt(O),U=new Set(f.map(Ar)),E=kr($,U,t,e,n),B=_;u.mergeThreads($),m(M=>{if(M.identity!==N)return M;let G;return R!==void 0?G=Mt(B+E,R):G=$.length===0||E===0?!1:z,wr(N,G),{...M,isFetching:!1,serverHasMore:G}})}catch(_){const A=_,O=A instanceof Error?A.message:String(A);se.error(`Could not load more tasks: ${O}`),m($=>$.identity===N?{...$,isFetching:!1}:$)}},y=c.isFetching||c.isProbing,w=!d&&!y&&Nr(h,c.serverHasMore);let k;return r[2]!==y||r[3]!==v||r[4]!==w||r[5]!==c.isProbing||r[6]!==c.serverHasMore?(k={hasMore:w,isFetching:y,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:v},r[2]=y,r[3]=v,r[4]=w,r[5]=c.isProbing,r[6]=c.serverHasMore,r[7]=k):k=r[7],k}function Ar(t){return t.id}function $r(t){const e=C.c(18),{status:n,threads:l,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a}=t,{isFetching:d,isProbing:c,loadMore:m,hasMore:u,serverHasMore:f}=Ir("status",n,a),[x,p]=D.useState(!1);!x&&l.length===0&&f===!0&&!d&&!c&&(p(!0),queueMicrotask(()=>{m()}));let h;if(e[0]!==r||e[1]!==a||e[2]!==o||e[3]!==i||e[4]!==l){let j;e[6]!==r||e[7]!==a||e[8]!==o||e[9]!==i?(j=v=>s.jsx(os,{task:v,isActive:r===v.id,onClick:()=>i(v),onArchive:v.created_by===a.currentUserId?()=>o(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[6]=r,e[7]=a,e[8]=o,e[9]=i,e[10]=j):j=e[10],h=l.map(j),e[0]=r,e[1]=a,e[2]=o,e[3]=i,e[4]=l,e[5]=h}else h=e[5];let g;e[11]!==u||e[12]!==d||e[13]!==m?(g=(u||d)&&s.jsx(js,{onClick:()=>{m()},isFetching:d,indented:!0}),e[11]=u,e[12]=d,e[13]=m,e[14]=g):g=e[14];let b;return e[15]!==h||e[16]!==g?(b=s.jsxs(s.Fragment,{children:[h,g]}),e[15]=h,e[16]=g,e[17]=b):b=e[17],b}function zr(t){const e=C.c(35),{status:n,threads:l,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a}=t,d=ll[n],c=d.icon,[m,u]=gr(`status-${n}`,!1);let f;e[0]!==m||e[1]!==u?(f=function(){u(!m)},e[0]=m,e[1]=u,e[2]=f):f=e[2];const x=f;let p;e[3]!==x?(p=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),x())},e[3]=x,e[4]=p):p=e[4];let h;e[5]!==c||e[6]!==d.iconClassName?(h=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(c,{size:12,className:d.iconClassName})}),e[5]=c,e[6]=d.iconClassName,e[7]=h):h=e[7];let g;e[8]!==m?(g=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:m?s.jsx(bt,{size:14}):s.jsx(ns,{size:14})}),e[8]=m,e[9]=g):g=e[9];let b;e[10]!==h||e[11]!==g?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[h,g]}),e[10]=h,e[11]=g,e[12]=b):b=e[12];let j;e[13]!==d.label?(j=s.jsx("span",{className:"flex-1 truncate",children:d.label}),e[13]=d.label,e[14]=j):j=e[14];let v;e[15]!==l.length?(v=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:l.length})}),e[15]=l.length,e[16]=v):v=e[16];let y;e[17]!==m||e[18]!==x||e[19]!==p||e[20]!==b||e[21]!==j||e[22]!==v?(y=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":m,onClick:x,onKeyDown:p,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md 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:[b,j,v]}),e[17]=m,e[18]=x,e[19]=p,e[20]=b,e[21]=j,e[22]=v,e[23]=y):y=e[23];let w;e[24]!==r||e[25]!==m||e[26]!==a||e[27]!==o||e[28]!==i||e[29]!==n||e[30]!==l?(w=m&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx($r,{status:n,threads:l,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a})}),e[24]=r,e[25]=m,e[26]=a,e[27]=o,e[28]=i,e[29]=n,e[30]=l,e[31]=w):w=e[31];let k;return e[32]!==y||e[33]!==w?(k=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[y,w]}),e[32]=y,e[33]=w,e[34]=k):k=e[34],k}function Pt(t){const e=C.c(34),{threads:n,groupBy:l,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a,hasMore:d,isFetchingMore:c,onLoadMore:m,filtersActive:u}=t;if(n.length===0&&!d&&!c){let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Xe,{className:"size-6 opacity-60"}),e[0]=h):h=e[0];const g=u?"No threads match your filters":"No threads yet";let b;return e[1]!==g?(b=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[h,s.jsx("p",{className:"text-sm",children:g})]}),e[1]=g,e[2]=b):b=e[2],b}if(l==="status"){let h;if(e[3]!==r||e[4]!==a||e[5]!==o||e[6]!==i||e[7]!==n){let b;e[9]!==r||e[10]!==a||e[11]!==o||e[12]!==i?(b=j=>s.jsx(zr,{status:j.status,threads:j.threads,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a},j.status),e[9]=r,e[10]=a,e[11]=o,e[12]=i,e[13]=b):b=e[13],h=Ul(n).map(b),e[3]=r,e[4]=a,e[5]=o,e[6]=i,e[7]=n,e[8]=h}else h=e[8];let g;return e[14]!==h?(g=s.jsx(s.Fragment,{children:h}),e[14]=h,e[15]=g):g=e[15],g}let f;if(e[16]!==r||e[17]!==a||e[18]!==o||e[19]!==i||e[20]!==n){let h;e[22]!==r||e[23]!==a||e[24]!==o||e[25]!==i?(h=g=>s.jsx(os,{task:g,isActive:r===g.id,onClick:()=>i(g),onArchive:g.created_by===a.currentUserId?()=>o(g):void 0,showAutomationBadge:!!g.trigger_id,showAgentIcon:!0},g.id),e[22]=r,e[23]=a,e[24]=o,e[25]=i,e[26]=h):h=e[26],f=n.map(h),e[16]=r,e[17]=a,e[18]=o,e[19]=i,e[20]=n,e[21]=f}else f=e[21];let x;e[27]!==d||e[28]!==c||e[29]!==m?(x=(d||c)&&s.jsx(js,{onClick:m,isFetching:c}),e[27]=d,e[28]=c,e[29]=m,e[30]=x):x=e[30];let p;return e[31]!==f||e[32]!==x?(p=s.jsxs(s.Fragment,{children:[f,x]}),e[31]=f,e[32]=x,e[33]=p):p=e[33],p}function Et(t){const e=C.c(17),{label:n,onClick:l,active:r,children:i}=t,[o,a]=D.useState(!1);let d,c,m,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>a(!0),c=()=>a(!1),m=()=>a(!0),u=()=>a(!1),e[0]=d,e[1]=c,e[2]=m,e[3]=u):(d=e[0],c=e[1],m=e[2],u=e[3]);const f=r&&"bg-sidebar-accent text-foreground";let x;e[4]!==f?(x=F(f),e[4]=f,e[5]=x):x=e[5];let p;e[6]!==i||e[7]!==n||e[8]!==l||e[9]!==x?(p=s.jsx(he,{asChild:!0,children:s.jsx(ae,{"aria-label":n,onClick:l,onPointerEnter:d,onPointerLeave:c,onFocus:m,onBlur:u,className:x,children:i})}),e[6]=i,e[7]=n,e[8]=l,e[9]=x,e[10]=p):p=e[10];let h;e[11]!==n?(h=s.jsx(xe,{side:"bottom",children:n}),e[11]=n,e[12]=h):h=e[12];let g;return e[13]!==o||e[14]!==p||e[15]!==h?(g=s.jsxs(pe,{open:o,children:[p,h]}),e[13]=o,e[14]=p,e[15]=h,e[16]=g):g=e[16],g}function tt(t){const e=C.c(13),{label:n,value:l,onChange:r,options:i}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let a;e[2]!==r?(a=u=>u&&r(u),e[2]=r,e[3]=a):a=e[3];let d;e[4]!==i?(d=i.map(Tr),e[4]=i,e[5]=d):d=e[5];let c;e[6]!==a||e[7]!==d||e[8]!==l?(c=s.jsx(Un,{type:"single",size:"sm",value:l,onValueChange:a,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:d}),e[6]=a,e[7]=d,e[8]=l,e[9]=c):c=e[9];let m;return e[10]!==o||e[11]!==c?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,c]}),e[10]=o,e[11]=c,e[12]=m):m=e[12],m}function Tr(t){return s.jsxs(Hn,{value:t.value,className:"h-6 gap-1.5 rounded-md 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 Ns({onNavigate:t}={}){const{data:e}=be.useSession(),n=e?.user?.id,{org:l}=ee(),r=Yt({connectionId:Zt,orgId:l.id,orgSlug:l.slug}),i=Ge(l.id).id,o=ht(),{threads:a,hasMore:d,isFetchingMore:c,fetchNextPage:m}=gt(),u=a.filter(I=>!I.hidden),{hide:f}=ls(),x=ne(),{setTaskId:p,createNewTask:h}=pt(),g=ct({strict:!1}),b=Ke({strict:!1}),j=g.taskId??null,v=b.virtualmcpid??a.find(I=>I.id===j)?.virtual_mcp_id??null,y=()=>{t?.()},w=[...u].sort((I,L)=>(L.updated_at??"").localeCompare(I.updated_at??"")),[k,S]=D.useState("all"),[N,_]=D.useState("flat"),[A,O]=We("sidebar-threads-scope-all",!1),[$,z]=D.useState(!1),[R,U]=D.useState(!1),E={type:k,member:"mine",currentUserId:n??null},B=I=>n?I.filter(L=>L.created_by===n):[],M=I=>k==="automation"?I.filter(L=>!!L.trigger_id):k==="manual"?I.filter(L=>!L.trigger_id):I,G=B(w),X=M(G),Q=M(w),te=A?Q:X,T=I=>{if(n&&I.created_by&&I.created_by!==n)return;const L=I.id===j;if(f(I.id),!L)return;const V=G.find(H=>H.id!==I.id&&H.virtual_mcp_id===I.virtual_mcp_id);y(),V?p(V.id,V.virtual_mcp_id):x({to:"/$org",params:{org:l.slug}})},P=I=>{y(),p(I.id,I.virtual_mcp_id)},Y=async I=>{try{const L=await r.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:I,limit:1,offset:0}});return((L.structuredContent??L).items?.length??0)===0}catch{return!1}},q=async()=>{const I=v??i;ue("sidebar_new_thread_clicked",{virtual_mcp_id:I});const L=G.find(V=>V.virtual_mcp_id===I&&V.title==="New chat");if(L&&await Y(L.id)){y(),p(L.id,I);return}y(),h(I)},{state:le,isMobile:W,toggleSidebar:re}=ve();if(le==="collapsed"&&!W){const I=Ge(l.id),L=new Map((o??[]).map(H=>[H.id,H])),V=H=>(H?L.get(H):void 0)??(H===i?I:void 0);return s.jsxs(fe,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(K,{children:s.jsx(J,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:re,children:s.jsx(qt,{size:16})})}),s.jsx(K,{children:s.jsx(J,{tooltip:"New thread",onClick:()=>{q()},children:s.jsx(_t,{size:16})})}),te.map(H=>{const de=V(H.virtual_mcp_id);return s.jsx(K,{children:s.jsx(J,{tooltip:H.title||"New chat",isActive:H.id===j,onClick:()=>P(H),children:s.jsx(Te,{icon:de?.icon??null,name:de?.title??"Agent",size:"2xs"})})},H.id)})]})}const ce=N!=="flat"||k!=="all"||A===!0,ge=s.jsxs(De,{children:[s.jsxs(pe,{children:[s.jsx(he,{asChild:!0,children:s.jsx(je,{asChild:!0,children:s.jsxs(ae,{"aria-label":"Filter threads",active:ce,children:[s.jsx(Bn,{size:16}),ce&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(xe,{side:"bottom",children:"Filter threads"})]}),s.jsxs(Pe,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(tt,{label:"View",value:N,onChange:I=>{ue("tasks_panel_group_by_changed",{to_value:I}),_(I)},options:[{value:"flat",label:"List",icon:s.jsx(xn,{size:13})},{value:"status",label:"Status",icon:s.jsx(pn,{size:13})}]}),s.jsx(tt,{label:"Type",value:k,onChange:I=>{ue("tasks_panel_filter_changed",{to_value:I}),S(I)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(tt,{label:"Scope",value:A?"team":"mine",onChange:I=>O(I==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),ye=I=>s.jsx(nt,{delayDuration:300,children:s.jsxs("div",{className:F("shrink-0 px-1 flex items-center justify-between",I?"h-10":"h-10 md:h-7 mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!I&&s.jsx(is,{}),ge]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Et,{label:"Search threads",onClick:()=>{ue("tasks_panel_search_opened"),U(!0),z(!0)},children:s.jsx(hn,{size:16})}),s.jsx(Et,{label:"New thread",onClick:()=>{q()},children:s.jsx(_t,{size:16})})]})]})});return W?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[ye(!0),s.jsx($t,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(Pt,{threads:te,groupBy:N,activeTaskId:j,onSelectTask:P,onArchiveTask:T,filters:E,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ce})}),R&&s.jsx(zt,{open:$,onOpenChange:z})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[ye(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx($t,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Pt,{threads:te,groupBy:N,activeTaskId:j,onSelectTask:P,onArchiveTask:T,filters:E,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ce})})}),R&&s.jsx(zt,{open:$,onOpenChange:z})]})}const Mr=5,Or=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function _s(){const t=C.c(3),{state:e}=ve();if(e==="collapsed"){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:Mr}).map(Er)}),t[0]=r):r=t[0],r}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(oe,{className:"size-6 rounded-md"}),s.jsx(oe,{className:"size-6 rounded-md"}),s.jsx(oe,{className:"size-6 rounded-md"})]}),s.jsx(oe,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:Or.map(Dr)})]}),t[2]=l):l=t[2],l}function Dr(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(oe,{className:"size-5 rounded-full shrink-0"}),s.jsx(oe,{className:F("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(Pr)})]},e)}function Pr(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(oe,{className:"h-3 flex-1 rounded-sm"})},e)}function Er(t,e){return s.jsx(oe,{className:"size-10 rounded-lg mx-auto"},e)}function Rr(){const t=C.c(4),e=cs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ur,{}),t[0]=n):n=t[0];let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ht,{children:s.jsx(D.Suspense,{fallback:s.jsx(_s,{}),children:s.jsx(Ns,{})})}),t[1]=l):l=t[1];let r;return t[2]!==e?(r=s.jsx(es,{children:s.jsx(us,{sections:e,footer:n,additionalContent:l})}),t[2]=e,t[3]=r):r=t[3],r}function Fr(t){const e=C.c(8),{onClose:n}=t,l=cs();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(fr,{}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(_s,{}),e[1]=i):i=e[1];let o;e[2]!==n?(o=s.jsx(Ht,{children:s.jsx(D.Suspense,{fallback:i,children:s.jsx(Ns,{onNavigate:n})})}),e[2]=n,e[3]=o):o=e[3];let a;return e[4]!==n||e[5]!==l||e[6]!==o?(a=s.jsx(es,{children:s.jsx(Pl,{sections:l,onClose:n,footer:r,additionalContent:o})}),e[4]=n,e[5]=l,e[6]=o,e[7]=a):a=e[7],a}function ws(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Lr=Bs({name:Hs().min(2,"Organization name is required")});function Br(t){const e=C.c(41),{open:n,onOpenChange:l}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:Us(Lr),defaultValues:{name:""}},e[0]=r):r=e[0];const i=Gs(r);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={mutationFn:Ur,onSuccess:Hr},e[1]=o):o=e[1];const a=qs(o),d=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(ml,{children:[s.jsx(ul,{children:"Create a new organization"}),s.jsx(fl,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let m;if(e[3]!==a||e[4]!==i){let S;e[6]!==a?(S=N=>a.mutateAsync(N),e[6]=a,e[7]=S):S=e[7],m=i.handleSubmit(S),e[3]=a,e[4]=i,e[5]=m}else m=e[5];let u;e[8]!==i.formState.isSubmitting?(u=S=>{const{field:N}=S;return s.jsxs(bl,{children:[s.jsx(jl,{children:"Organization Name"}),s.jsx(vl,{children:s.jsx(Nl,{...N,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(yl,{children:"The name of your company or organization"}),N.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",ws(N.value)]})]}),s.jsx(Sl,{})]})},e[8]=i.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==i.control||e[11]!==u?(f=s.jsx(pl,{control:i.control,name:"name",render:u}),e[10]=i.control,e[11]=u,e[12]=f):f=e[12];let x;e[13]!==d?(x=d&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:d}),e[13]=d,e[14]=x):x=e[14];let p;e[15]!==a||e[16]!==i?(p=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=p):p=e[17];let h;e[18]!==i.formState.isSubmitting||e[19]!==p?(h=s.jsx(cl,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=h):h=e[20];const g=!i.formState.isValid||i.formState.isSubmitting;let b;e[21]!==i.formState.isSubmitting?(b=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(rl,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==g||e[24]!==b?(j=s.jsx(ze,{type:"submit",variant:"default",disabled:g,children:b}),e[23]=g,e[24]=b,e[25]=j):j=e[25];let v;e[26]!==j||e[27]!==h?(v=s.jsxs(hl,{children:[h,j]}),e[26]=j,e[27]=h,e[28]=v):v=e[28];let y;e[29]!==v||e[30]!==m||e[31]!==f||e[32]!==x?(y=s.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[f,x,v]}),e[29]=v,e[30]=m,e[31]=f,e[32]=x,e[33]=y):y=e[33];let w;e[34]!==i||e[35]!==y?(w=s.jsxs(dl,{children:[c,s.jsx(gl,{...i,children:y})]}),e[34]=i,e[35]=y,e[36]=w):w=e[36];let k;return e[37]!==l||e[38]!==n||e[39]!==w?(k=s.jsx(xl,{open:n,onOpenChange:l,children:w}),e[37]=l,e[38]=n,e[39]=w,e[40]=k):k=e[40],k}function Hr(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Ur(t){const e=ws(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await be.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const l=n?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}function Gr(t){let e=0;for(let l=0;l<t.length;l++)e=t.charCodeAt(l)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function Cs(t){const e=C.c(13),{org:n,size:l}=t,r=l===void 0?"sm":l,i=r==="xs"?"size-5":"size-6",o=r==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=F(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let d;e[2]!==n.logo||e[3]!==n.name?(d=n.logo?void 0:Gr(n.name),e[2]=n.logo,e[3]=n.name,e[4]=d):d=e[4];let c;e[5]!==n.logo||e[6]!==n.name||e[7]!==o?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:F("font-semibold leading-none",o),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=o,e[8]=c):c=e[8];let m;return e[9]!==a||e[10]!==d||e[11]!==c?(m=s.jsx("div",{className:a,style:d,children:c}),e[9]=a,e[10]=d,e[11]=c,e[12]=m):m=e[12],m}function qr(t){const e=C.c(24),{orgParam:n,onSelectOrg:l,onCreateOrg:r}=t,{data:i}=Ws();let o;e[0]!==n?(o=(_,A)=>_.slug===n?-1:A.slug===n?1:_.name.localeCompare(A.name),e[0]=n,e[1]=o):o=e[1];const a=[...i??[]].sort(o),[d,c]=D.useState(""),m=d.toLowerCase(),u=m?a.filter(_=>_.name.toLowerCase().includes(m)||_.slug.toLowerCase().includes(m)):a;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(as,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=f):f=e[2];let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=_=>c(_.target.value),e[3]=x):x=e[3];let p;e[4]!==d?(p=_=>_.key==="Escape"&&d&&c(""),e[4]=d,e[5]=p):p=e[5];let h;e[6]!==d||e[7]!==p?(h=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:d,onChange:x,onKeyDown:p,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=d,e[7]=p,e[8]=h):h=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx($e,{size:16}),e[9]=g):g=e[9];let b;e[10]!==r?(b=s.jsx("button",{type:"button",onClick:r,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:g}),e[10]=r,e[11]=b):b=e[11];let j;e[12]!==h||e[13]!==b?(j=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[f,h,b]}),e[12]=h,e[13]=b,e[14]=j):j=e[14];const v="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",y=u.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:d?`No organizations match "${d}"`:"No organizations available"});let w;e[15]!==l||e[16]!==n?(w=_=>s.jsxs("button",{type:"button",onClick:()=>l(_.slug),className:F("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",_.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(Cs,{org:_,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:_.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:_.slug})]}),_.slug===n&&s.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},_.id),e[15]=l,e[16]=n,e[17]=w):w=e[17];const k=u.map(w);let S;e[18]!==y||e[19]!==k?(S=s.jsxs("div",{className:v,children:[y,k]}),e[18]=y,e[19]=k,e[20]=S):S=e[20];let N;return e[21]!==S||e[22]!==j?(N=s.jsxs(s.Fragment,{children:[j,S]}),e[21]=S,e[22]=j,e[23]=N):N=e[23],N}function Wr(t){const e=C.c(22),{trigger:n,orgParam:l,align:r,side:i}=t,o=r===void 0?"start":r,a=i===void 0?"bottom":i,d=ne(),[c,m]=D.useState(!1),[u,f]=D.useState(!1);let x;e[0]!==n?(x=s.jsx(je,{asChild:!0,children:n}),e[0]=n,e[1]=x):x=e[1];const p=String(c);let h;e[2]!==d?(h=k=>{m(!1),d({to:"/$org",params:{org:k}})},e[2]=d,e[3]=h):h=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{m(!1),f(!0)},e[4]=g):g=e[4];let b;e[5]!==l||e[6]!==p||e[7]!==h?(b=s.jsx(qr,{orgParam:l,onSelectOrg:h,onCreateOrg:g},p),e[5]=l,e[6]=p,e[7]=h,e[8]=b):b=e[8];let j;e[9]!==o||e[10]!==a||e[11]!==b?(j=s.jsx(Pe,{side:a,align:o,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:Vr,onCloseAutoFocus:Kr,children:b}),e[9]=o,e[10]=a,e[11]=b,e[12]=j):j=e[12];let v;e[13]!==c||e[14]!==x||e[15]!==j?(v=s.jsxs(De,{open:c,onOpenChange:m,children:[x,j]}),e[13]=c,e[14]=x,e[15]=j,e[16]=v):v=e[16];let y;e[17]!==u?(y=s.jsx(Br,{open:u,onOpenChange:f}),e[17]=u,e[18]=y):y=e[18];let w;return e[19]!==y||e[20]!==v?(w=s.jsxs(s.Fragment,{children:[v,y]}),e[19]=y,e[20]=v,e[21]=w):w=e[21],w}function Kr(t){return t.preventDefault()}function Vr(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function Xr(t){const e=C.c(21),{value:n,onChange:l,placeholder:r,onKeyDown:i,className:o,isSearching:a,disabled:d}=t,c=r===void 0?"Search...":r;let m;e[0]!==o?(m=F("shrink-0 w-full border-b border-border h-12",o),e[0]=o,e[1]=m):m=e[1];const u=d?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=F("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let x;e[4]!==a?(x=a?s.jsx(Bt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(as,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=x):x=e[5];let p;e[6]!==l?(p=j=>l(j.target.value),e[6]=l,e[7]=p):p=e[7];let h;e[8]!==d||e[9]!==i||e[10]!==c||e[11]!==p||e[12]!==n?(h=s.jsx("input",{type:"text",value:n,onChange:p,onKeyDown:i,placeholder:c,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=i,e[10]=c,e[11]=p,e[12]=n,e[13]=h):h=e[13];let g;e[14]!==f||e[15]!==x||e[16]!==h?(g=s.jsxs("label",{className:f,children:[x,h]}),e[14]=f,e[15]=x,e[16]=h,e[17]=g):g=e[17];let b;return e[18]!==m||e[19]!==g?(b=s.jsx("div",{className:m,children:g}),e[18]=m,e[19]=g,e[20]=b):b=e[20],b}const Qr="Select an existing agent";function Yr(t){const e=C.c(5),{children:n}=t;let l;e[0]!==n?(l=s.jsx(he,{asChild:!0,children:n}),e[0]=n,e[1]=l):l=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(xe,{side:"right",sideOffset:8,children:Qr}),e[2]=r):r=e[2];let i;return e[3]!==l?(i=s.jsxs(pe,{defaultOpen:!0,delayDuration:0,children:[l,r]}),e[3]=l,e[4]=i):i=e[4],i}function Jr(t){const e=ne(),{create:n}=ls(),{locator:l}=ee(),r=ct({strict:!1}),i=Ke({strict:!1});return async o=>{const a=crypto.randomUUID(),d=o===i.virtualmcpid?Ln(t,l,r.taskId??""):null;try{await n({id:a,virtual_mcp_id:o,...d?{branch:d}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:o}})}}function Rt(t){const e=C.c(20),{agent:n,selected:l,onClick:r}=t,i=l?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let o;e[0]!==i?(o=F("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",i),e[0]=i,e[1]=o):o=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(Te,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let d;e[5]!==n.title?(d=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=d):d=e[6];let c;e[7]!==n.description?(c=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let m;e[9]!==d||e[10]!==c?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,c]}),e[9]=d,e[10]=c,e[11]=m):m=e[11];let u;e[12]!==l?(u=l&&s.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=l,e[13]=u):u=e[13];let f;return e[14]!==r||e[15]!==o||e[16]!==a||e[17]!==m||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:r,className:o,children:[a,m,u]}),e[14]=r,e[15]=o,e[16]=a,e[17]=m,e[18]=u,e[19]=f):f=e[19],f}function Zr(t){const e=C.c(23),{onClose:n,onSelectAgent:l,selectedAgentId:r}=t,[i,o]=D.useState(""),a=ht(),d=a??[],{org:c}=ee(),{data:m}=be.useSession(),u=m?.user?.id??"anon",f=Cn(a),x=kn(),p=Jr(c.slug),h=zn(a),g=i.toLowerCase(),b=d.filter(ei).filter(M=>!h.has(M.id)).filter(M=>!i||M.title.toLowerCase().includes(g)),j=Ge(c.id),v=!i||j.title.toLowerCase().includes(g);let y;e[0]!==n||e[1]!==l?(y=()=>{l?.(null),n(),o("")},e[0]=n,e[1]=l,e[2]=y):y=e[2];const w=y,k=M=>{if(l){l(M.id),n(),o("");return}In({orgId:c.id,userId:u},M.id,f),x(),n(),o(""),p(M.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let N;e[3]!==i?(N=s.jsx(Xr,{value:i,onChange:o,placeholder:"Search agents..."}),e[3]=i,e[4]=N):N=e[4];const _="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-1",A=l&&v&&j&&s.jsx(Rt,{agent:j,selected:!r||r===j.id,onClick:w}),O=b.map(M=>s.jsx(Rt,{agent:M,selected:l?r===M.id:void 0,onClick:()=>k(M)},M.id));let $;e[5]!==i||e[6]!==b.length?($=b.length===0&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:i?"No agents found":"No agents yet"}),e[5]=i,e[6]=b.length,e[7]=$):$=e[7];let z;e[8]!==A||e[9]!==O||e[10]!==$?(z=s.jsxs("div",{className:_,children:[A,O,$]}),e[8]=A,e[9]=O,e[10]=$,e[11]=z):z=e[11];let R;e[12]!==c.slug?(R={org:c.slug},e[12]=c.slug,e[13]=R):R=e[13];let U;e[14]!==n?(U=()=>n(),e[14]=n,e[15]=U):U=e[15];let E;e[16]!==U||e[17]!==R?(E=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Ut,{to:"/$org/settings/agents",params:R,onClick:U,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[16]=U,e[17]=R,e[18]=E):E=e[18];let B;return e[19]!==E||e[20]!==N||e[21]!==z?(B=s.jsxs("div",{className:S,children:[N,z,E]}),e[19]=E,e[20]=N,e[21]=z,e[22]=B):B=e[22],B}function ei(t){return!Jt(t.id)}function ti(t){const e=C.c(23);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:l,trigger:r,onSelectAgent:i,selectedAgentId:o,side:a,align:d}=n,c=l===void 0?!1:l,m=a===void 0?"right":a,u=d===void 0?"start":d,[f,x]=D.useState(!1),p=ft(),{setOpenMobile:h}=ve(),g=wn(),b=g?"border border-border":void 0;let j;e[2]!==g?(j=_=>g?s.jsx(Yr,{children:_}):_,e[2]=g,e[3]=j):j=e[3];const v=j;let y;e[4]!==p||e[5]!==h?(y=()=>{x(!1),p&&h(!1)},e[4]=p,e[5]=h,e[6]=y):y=e[6];const w=y;let k;e[7]!==w||e[8]!==i||e[9]!==f||e[10]!==o?(k=f&&s.jsx(D.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(oe,{className:"h-4 w-24"})}),children:s.jsx(Zr,{onClose:w,onSelectAgent:i,selectedAgentId:o})}),e[7]=w,e[8]=i,e[9]=f,e[10]=o,e[11]=k):k=e[11];const S=k;let N;return e[12]!==u||e[13]!==c||e[14]!==b||e[15]!==g||e[16]!==p||e[17]!==f||e[18]!==S||e[19]!==m||e[20]!==r||e[21]!==v?(N=s.jsx(s.Fragment,{children:p?s.jsxs(s.Fragment,{children:[r?s.jsx("button",{type:"button",onClick:()=>x(!0),className:"contents",children:r}):c?v(s.jsx(ae,{"aria-label":"Browse agents",className:F(b),onClick:()=>{ue("agent_browser_opened",{surface:"mobile_drawer"}),x(!0)},children:s.jsx($e,{className:"size-4"})})):s.jsx(K,{children:v(s.jsxs(J,{tooltip:g?void 0:"Browse agents",className:F(b),onClick:()=>{ue("agent_browser_opened",{surface:"mobile_drawer"}),x(!0)},children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Wt,{open:f,onOpenChange:x,direction:"bottom",children:s.jsxs(Kt,{className:"max-h-[85dvh] p-0",children:[s.jsx(Vt,{className:"sr-only",children:"Browse agents"}),S]})})]}):s.jsxs(De,{open:f,onOpenChange:_=>{_&&!f&&ue("agent_browser_opened",{surface:"desktop_popover"}),x(_)},children:[r?s.jsx(je,{asChild:!0,children:r}):c?v(s.jsx(je,{asChild:!0,children:s.jsx(ae,{"aria-label":"Browse agents",className:F(b),children:s.jsx($e,{className:"size-4"})})})):s.jsx(K,{children:v(s.jsx(je,{asChild:!0,children:s.jsxs(J,{tooltip:g?void 0:"Browse agents",className:F(b),children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Pe,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:S})]})}),e[12]=u,e[13]=c,e[14]=b,e[15]=g,e[16]=p,e[17]=f,e[18]=S,e[19]=m,e[20]=r,e[21]=v,e[22]=N):N=e[22],N}const ks="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md px-1.5 py-1 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function si(t){const e=C.c(19),{agentId:n,onOpenHome:l,onPick:r}=t,i=xt(n),o=i?.title??"Decopilot",a=`Open ${o} home`,d=i?.icon??null;let c;e[0]!==d||e[1]!==o?(c=s.jsx(Te,{icon:d,name:o,size:"2xs"}),e[0]=d,e[1]=o,e[2]=c):c=e[2];let m;e[3]!==l||e[4]!==a||e[5]!==c?(m=s.jsx("button",{type:"button",onClick:l,"aria-label":a,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:c}),e[3]=l,e[4]=a,e[5]=c,e[6]=m):m=e[6];let u;e[7]!==o?(u=s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:o}),e[7]=o,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(bt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=f):f=e[9];let x;e[10]!==u?(x=s.jsxs("button",{type:"button",className:ks,children:[u,f]}),e[10]=u,e[11]=x):x=e[11];let p;e[12]!==n||e[13]!==r||e[14]!==x?(p=s.jsx(ti,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:r,trigger:x}),e[12]=n,e[13]=r,e[14]=x,e[15]=p):p=e[15];let h;return e[16]!==m||e[17]!==p?(h=s.jsxs("div",{className:"flex items-center gap-0.5",children:[m,p]}),e[16]=m,e[17]=p,e[18]=h):h=e[18],h}function Ft(){const t=C.c(33),{org:e}=ee(),{state:n}=ve(),l=n==="collapsed",r=ne();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[0]=i):i=t[0];const o=ct(i);let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[1]=a):a=t[1];const d=Ke(a),{threads:c}=gt(),{setTaskId:m,createNewTask:u}=pt();let f;t[2]!==e.id?(f=Ge(e.id),t[2]=e.id,t[3]=f):f=t[3];const x=f.id,p=o.taskId?d.virtualmcpid??x:x;let h;t[4]!==u||t[5]!==x||t[6]!==r||t[7]!==e.slug||t[8]!==m||t[9]!==c?(h=A=>{if(!A||A===x){r({to:"/$org",params:{org:e.slug}});return}const O=c.find($=>!$.hidden&&$.virtual_mcp_id===A&&$.title==="New chat"&&(!$.status||$.status==="in_progress"));O?m(O.id,A):u(A)},t[4]=u,t[5]=x,t[6]=r,t[7]=e.slug,t[8]=m,t[9]=c,t[10]=h):h=t[10];const g=h;let b;t[11]!==e.slug?(b={org:e.slug},t[11]=e.slug,t[12]=b):b=t[12];let j;t[13]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Z.Logo,{}),t[13]=j):j=t[13];let v;t[14]!==b?(v=s.jsx(Ut,{to:"/$org",params:b,"aria-label":"Organization home",title:"Home",className:"wco-no-drag flex items-center shrink-0 cursor-pointer rounded-md px-1 hover:bg-accent/60 transition-colors",children:j}),t[14]=b,t[15]=v):v=t[15];let y;t[16]!==e||t[17]!==l?(y=!l&&s.jsx(Wr,{orgParam:e.slug,trigger:s.jsxs("button",{type:"button",className:ks,children:[s.jsx(Cs,{org:e,size:"xs"}),s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:e.name}),s.jsx(bt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"})]})}),t[16]=e,t[17]=l,t[18]=y):y=t[18];let w;t[19]!==v||t[20]!==y?(w=s.jsxs(Ct,{className:"gap-0.5",children:[v,y]}),t[19]=v,t[20]=y,t[21]=w):w=t[21];let k;t[22]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("span",{className:"h-4 w-24 rounded bg-muted animate-pulse"}),t[22]=k):k=t[22];let S;t[23]!==p||t[24]!==g?(S=()=>g(p),t[23]=p,t[24]=g,t[25]=S):S=t[25];let N;t[26]!==p||t[27]!==g||t[28]!==S?(N=s.jsx(Ct,{children:s.jsx(D.Suspense,{fallback:k,children:s.jsx(si,{agentId:p,onOpenHome:S,onPick:g})})}),t[26]=p,t[27]=g,t[28]=S,t[29]=N):N=t[29];let _;return t[30]!==N||t[31]!==w?(_=s.jsx(ol,{className:"wco-no-drag",children:s.jsxs(al,{className:"flex-nowrap",children:[w,N]})}),t[30]=N,t[31]=w,t[32]=_):_=t[32],_}const ni="sidebar.open";function li(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Vs,{}),t[0]=e):e=t[0],e}function Sa(){const t=C.c(24),e=ft(),[n,l]=We(ni,!1),{width:r,wrapperRef:i,onStartResize:o,resetWidth:a}=kl();let d;t[0]!==e?(d=e?s.jsxs(Z.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto] items-center gap-2",children:[s.jsx(is,{}),s.jsx(Ft,{}),s.jsx(ot,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(Z.TogglesSlot,{}),s.jsx(Z.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(Z.CenterSlot,{}),s.jsx(Z.RightSlot,{})]}):s.jsxs(Z.Header,{children:[s.jsx(Z.LeftColumn,{children:s.jsx(Ft,{})}),s.jsx(Z.CenterSlot,{}),s.jsxs(Z.RightColumn,{children:[s.jsxs("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:[s.jsx(Z.TogglesSlot,{}),s.jsx(Z.TabsSlot,{})]}),s.jsx(Z.RightSlot,{})]})]}),t[0]=e,t[1]=d):d=t[1];const c=`${r}px`;let m;t[2]!==c?(m={"--sidebar-width":c,"--sidebar-width-icon":"3.5rem"},t[2]=c,t[3]=m):m=t[3];const u=m;let f;t[4]!==e||t[5]!==o||t[6]!==a?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(Rr,{}),s.jsx(_l,{onPointerDown:o,onDoubleClick:a})]}),t[4]=e,t[5]=o,t[6]=a,t[7]=f):f=t[7];let x;t[8]===Symbol.for("react.memo_cache_sentinel")?(x={background:"transparent",containerType:"inline-size"},t[8]=x):x=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ys,{className:"flex flex-col",style:x,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(D.Suspense,{fallback:s.jsx(li,{}),children:s.jsx(Ks,{})})})})}),t[9]=p):p=t[9];let h;t[10]!==u||t[11]!==f||t[12]!==i?(h=s.jsxs(Js,{ref:i,className:"flex-1 bg-sidebar relative min-h-0",style:u,children:[f,p]}),t[10]=u,t[11]=f,t[12]=i,t[13]=h):h=t[13];let g;t[14]!==e?(g=e&&s.jsx(nl,{renderSidebar:ri}),t[14]=e,t[15]=g):g=t[15];let b;t[16]!==d||t[17]!==h||t[18]!==g?(b=s.jsx(il,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[d,h,g]})}),t[16]=d,t[17]=h,t[18]=g,t[19]=b):b=t[19];let j;return t[20]!==l||t[21]!==n||t[22]!==b?(j=s.jsx(qn,{children:s.jsx(Z.Provider,{children:s.jsx(Zs,{open:n,onOpenChange:l,children:b})})}),t[20]=l,t[21]=n,t[22]=b,t[23]=j):j=t[23],j}function ri(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(Fr,{onClose:e})})})}export{Sa as default};
1
+ import{c as C,j as s,C as We,r as D,D as ee,b as ne,l as F,v as ue,F as zs,G as Ts,a as be,H as Ms,I as Os,t as se,J as Ds,M as Ps,m as Lt,u as Ke,P as vt,B as ze,y as Es,R as Rs,K as Fs,k as Ls,i as Bt,e as ct,E as Ht,o as Bs,s as Hs,n as Us,p as Gs,d as qs,x as Ws,T as Ut,O as Ks,U as Vs}from"./index-BUtSNxMV.js";import{u as ve,S as dt,a as mt,b as fe,c as J,d as K,e as ut,f as Gt,g as Xs,h as Qs,i as st,j as Ys,k as Js,l as Zs}from"./sidebar-IpepvLp_.js";import{u as ft}from"./use-mobile-dwrFF7Ga.js";import{n as en}from"./Loading02-BY5Z_ytL.js";import{u as tn}from"./use-organization-settings-DLQ_RcCc.js";import{S as oe}from"./skeleton-Dp2Vqkiu.js";import{i as qt}from"./LayoutLeft-WEbo8J87.js";import{T as ae}from"./toolbar-icon-button-zRIr6s4s.js";import{P as De,a as je,b as Pe}from"./popover-leYVnzzq.js";import{D as Wt,a as Kt,b as Vt}from"./drawer-BK13Nuy8.js";import{A as Oe}from"./avatar-DN0SQ2YP.js";import{a as he,b as xe,c as nt,T as pe}from"./tooltip-PSiaLaWJ.js";import{a as yt}from"./Copy01-C_vDrK62.js";import{n as sn,i as nn}from"./Globe01-pYyw4zjF.js";import{i as ln}from"./ZoomOut-B4weRH-H.js";import{i as rn,a as on}from"./ZapSquare-BtUSi6w5.js";import{i as Xt}from"./Monitor01-CjaozmNA.js";import{n as an,a as cn}from"./Sun-D-D5LZ02.js";import{a as Ve,b as dn}from"./Settings02-CtgBTtnW.js";import{i as mn}from"./Shield01-BsAF4snY.js";import{a as un}from"./Users03-kFy3UJPi.js";import{a as St,b as Nt,c as Qt,d as fn,A as Te,e as _t,i as hn,s as xn,f as pn}from"./agent-icon-CRPqtjX6.js";import"./index-BURNjU1u.js";import{n as Xe}from"./Stars02-C0LkLtPv.js";import{D as gn,a as bn,b as jn,c as wt,d as vn}from"./dropdown-menu-sPU_Xw0y.js";import{i as Ee}from"./Check-CWR2GX_4.js";import{s as $e}from"./Plus-j1oUcvSs.js";import{u as yn}from"./use-connection-BTrFuX_N.js";import{u as Yt}from"./use-mcp-client-ytX3rIBe.js";import{u as ht,a as xt}from"./use-virtual-mcp-DoBqiTt8.js";import{i as Jt,S as Zt,a as Ge}from"./constants-C8_Swa4x.js";import{G as Sn,g as lt,i as Nn,a as rt}from"./github-repo-picker-Bo3EK1uO.js";import{u as _n,S as es,a as wn,g as Cn,b as kn,c as In}from"./use-navigate-to-agent-3AMa0O2a.js";import{I as An}from"./invite-member-dialog-DoItRcGW.js";import{u as ts,A as $n,g as zn}from"./agent-capabilities-UH4_NDRB.js";import{u as Tn,v as Mn,C as On}from"./connect-desktop-dialog-RWUM4LPN.js";import{s as ss}from"./XClose-CmJ8_Kxi.js";import{u as Dn,a as Pn}from"./use-join-requests-Cw33iAqx.js";import{i as ns}from"./ChevronRight--Sw9cfbS.js";import{u as En,R as Rn,a as Fn,b as pt,r as Ln}from"./shell-layout-CFR90kZQ.js";import{i as Bn}from"./FilterLines-YtMlMBJN.js";import{T as Hn,a as Un}from"./toggle-group-D2VkNZ7z.js";import{u as Gn,a as gt,b as ls,T as qn}from"./hooks-G0kJppE-.js";import{c as Wn,a as Kn,b as Vn,d as Xn,e as Qn}from"./dialog-fRprLEhn.js";import{C as Yn,a as Jn,b as Zn,c as el,d as tl}from"./command-qHaitSxv.js";import{u as rs}from"./studio-tools-BBJKqBLb.js";import{i as sl}from"./Zap-CjHl9Hth.js";import{S as is,M as nl}from"./shell-controls-BF0ZsNdF.js";import{T as os}from"./task-row-Bh0ziHfN.js";import{t as bt}from"./ChevronDown-BOnFs3ZP.js";import{S as ll}from"./task-status-BgxqbUD3.js";import{S as rl,C as il}from"./chat-context-DIUSa9Jr.js";import{B as Ct,a as ol,b as al}from"./breadcrumb-Ca0mTftR.js";import{T as Z}from"./toolbar-BL6j7wlL.js";import{i as as}from"./SearchMd-Cmh57xGa.js";import{A as cl,a as dl,b as ml,c as ul,d as fl,e as hl,f as xl}from"./alert-dialog-DseQ_eoR.js";import{F as pl,a as gl,b as bl,c as jl,d as vl,f as yl,e as Sl}from"./form-Cciq6tIX.js";import{I as Nl}from"./input-CVpmA2Kz.js";import"./sheet-DtNuWaQa.js";import"./X-C0ZgGoQb.js";import"./User01-C7pBq15o.js";import"./AlertCircle-CLapFvcx.js";import"./Tool01-Csfd8Wry.js";import"./SwitchHorizontal01-DAV6AujY.js";import"./XCircle-DRgrnFcC.js";import"./ArrowUpRight-DYI4ZFTv.js";import"./CheckCircle-BJr7jKsb.js";import"./ChevronUp-CkMhjJB_.js";import"./Circle-CSNCa0Ai.js";import"./DotsVertical-CVxu5D2B.js";import"./Eye-DCiEQJIv.js";import"./Star01-DgFqZM1H.js";import"./Globe04-B5LRDZX0.js";import"./HardDrive-Bt_8Ilkp.js";import"./Key01-BGm5x2_7.js";import"./LinkExternal01-C9wAno25.js";import"./List-wZrVQa3Y.js";import"./Palette-DX20ptpQ.js";import"./Play-DrXY2oRx.js";import"./SearchLg-Dt-H4O3z.js";import"./Stars01-Ch3VikRv.js";import"./Trash01-Bf3SN1nH.js";import"./Upload01-BYEqY1Ay.js";import"./Users01-9SoD8uT4.js";import"./use-collections-BkB7fOzG.js";import"./auth-YT0L3u0f.js";import"./checkbox-DCa6681A.js";import"./collection-search-DT12aqMT.js";import"./use-debounced-value-tBjolHlG.js";import"./authenticate-and-persist-oauth-D8TojuXv.js";import"./mcp-oauth-SYbSLgYN.js";import"./use-mcp-tools-Pie2rBqX.js";import"./extract-connection-data-UsNBmqW8.js";import"./github-installations-DzN1UQ4x.js";import"./select-CRwP8DNI.js";import"./textarea-DXtj6szK.js";import"./use-org-auth-client-BUcY_yRN.js";import"./use-organization-roles-DDZE7ylp.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-COE4b4Kl.js";import"./use-registry-connections-CE2j8i_H.js";import"./useInfiniteQuery-DX_yJgCV.js";import"./use-infinite-scroll-ziAI3qTA.js";import"./card-D9G2yXrJ.js";import"./integration-icon-DN2_9kxR.js";import"./collection-tabs-2clxo3lG.js";import"./badge-CYqiGv_0.js";import"./connection-form-helpers-D9d9jQ9S.js";import"./useSuspenseInfiniteQuery-COveRdn6.js";import"./use-ai-providers-BfSwDb4T.js";import"./use-capability-BrY7n9pF.js";import"./required-auth-layout-BGUbgKtE.js";import"./tab-id-CLpu897Q.js";import"./use-org-sso--qDPTafN.js";import"./decopilot-sse-pool-Ct1_UW6D.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./index-BJ4F5Cgi.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-clock-tick-DCObx26s.js";import"./use-decopilot-events-CB_ilHxh.js";import"./label-CHYsX_t_.js";function _l(t){const e=C.c(5),{onPointerDown:n,onDoubleClick:l}=t,{state:r,isMobile:i}=ve();if(i||r==="collapsed")return null;let o,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={left:"var(--sidebar-width)"},a=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=o,e[1]=a):(o=e[0],a=e[1]);let d;return e[2]!==l||e[3]!==n?(d=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:l,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:o,children:a}),e[2]=l,e[3]=n,e[4]=d):d=e[4],d}const jt=240,wl=400,Cl="sidebar.width";function Me(t){return Math.max(jt,Math.min(wl,t))}function kl(){const t=C.c(11),[e,n]=We(Cl,Il),l=D.useRef(null);let r;t[0]!==n||t[1]!==e?(r=m=>{m.preventDefault();const u=m.clientX,f=Me(e),x=l.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),p=x?Array.from(x.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of p)b.style.transition="none";const h=b=>{const j=Me(f+(b.clientX-u));x?.style.setProperty("--sidebar-width",`${j}px`)},g=b=>{const j=Me(f+(b.clientX-u));n(j);for(const v of p)v.style.transition="";window.removeEventListener("pointermove",h),window.removeEventListener("pointerup",g),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",h),window.addEventListener("pointerup",g)},t[0]=n,t[1]=e,t[2]=r):r=t[2];const i=r;let o;t[3]!==n?(o=()=>{n(jt)},t[3]=n,t[4]=o):o=t[4];const a=o;let d;t[5]!==e?(d=Me(e),t[5]=e,t[6]=d):d=t[6];let c;return t[7]!==i||t[8]!==a||t[9]!==d?(c={width:d,wrapperRef:l,onStartResize:i,resetWidth:a},t[7]=i,t[8]=a,t[9]=d,t[10]=c):c=t[10],c}function Il(t){return typeof t=="number"?Me(t):jt}function cs(){const t=C.c(8),{org:e}=ee(),n=ne(),l=tn();let r;if(t[0]!==n||t[1]!==e||t[2]!==l){if(r=[],l){let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(en,{className:"size-4!"}),t[4]=i):i=t[4];let o;t[5]!==n||t[6]!==e?(o={type:"items",items:[{key:"board",label:"Board",icon:i,onClick:()=>n({to:"/$org/board",params:{org:e.slug}})}]},t[5]=n,t[6]=e,t[7]=o):o=t[7],r.push(o)}t[0]=n,t[1]=e,t[2]=l,t[3]=r}else r=t[3];return r}function ds(t){const e=C.c(3),{children:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=l):l=e[0];let r;return e[1]!==n?(r=s.jsxs(dt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[l,s.jsx(mt,{children:s.jsx(fe,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=r):r=e[2],r}function ms(t){const e=C.c(18),{item:n}=t,{isMobile:l,setOpenMobile:r}=ve();let i;e[0]!==l||e[1]!==n||e[2]!==r?(i=()=>{ue("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:l}),n.onClick?.(),l&&r(!1)},e[0]=l,e[1]=n,e[2]=r,e[3]=i):i=e[3];const o=i,a=n.key,d=n.isActive&&"z-10";let c;e[4]!==d?(c=F(d),e[4]=d,e[5]=c):c=e[5];let m;e[6]!==n.label?(m=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=m):m=e[7];let u;e[8]!==o||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==m?(u=s.jsxs(J,{onClick:o,isActive:n.isActive,tooltip:n.label,children:[n.icon,m]}),e[8]=o,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=m,e[13]=u):u=e[13];let f;return e[14]!==n.key||e[15]!==c||e[16]!==u?(f=s.jsx(K,{className:c,children:u},a),e[14]=n.key,e[15]=c,e[16]=u,e[17]=f):f=e[17],f}function Al(t){const e=C.c(12),{section:n}=t;switch(n.type){case"divider":{let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ut,{className:"my-2"}),e[0]=l):l=e[0],l}case"spacer":{let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex-1"}),e[1]=l):l=e[1],l}case"group":{const l=n.group.label,r=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(zl),e[2]=n.group.items,e[3]=i):i=e[3];let o;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(o=s.jsx(ds,{label:l,defaultExpanded:r,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=o):o=e[7],o}case"items":{let l;e[8]!==n.items?(l=n.items.map($l),e[8]=n.items,e[9]=l):l=e[9];let r;return e[10]!==l?(r=s.jsx(dt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(mt,{children:s.jsx(fe,{className:"gap-1.5",children:l})})}),e[10]=l,e[11]=r):r=e[11],r}case"custom":return n.content}}function $l(t){return s.jsx(ms,{item:t},t.key)}function zl(t){return s.jsx(ms,{item:t},t.key)}function Tl(t){const e=C.c(14),{sections:n,footer:l,additionalContent:r,variant:i,contentClassName:o}=t,a=i===void 0?"sidebar":i;let d;e[0]!==o?(d=F("flex flex-col flex-1 px-2 py-2 gap-0.5",o),e[0]=o,e[1]=d):d=e[1];let c;e[2]!==n?(c=n.map(Ml),e[2]=n,e[3]=c):c=e[3];let m;e[4]!==r?(m=r&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:r}),e[4]=r,e[5]=m):m=e[5];let u;e[6]!==d||e[7]!==c||e[8]!==m?(u=s.jsxs(Gt,{className:d,children:[c,m]}),e[6]=d,e[7]=c,e[8]=m,e[9]=u):u=e[9];let f;return e[10]!==l||e[11]!==u||e[12]!==a?(f=s.jsxs(Xs,{variant:a,children:[u,l]}),e[10]=l,e[11]=u,e[12]=a,e[13]=f):f=e[13],f}function Ml(t,e){return s.jsx(Al,{section:t},e)}function us(t){const e=C.c(2);let n;return e[0]!==t?(n=s.jsx(Tl,{...t}),e[0]=t,e[1]=n):n=e[1],n}us.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(oe,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Ol(t){const e=C.c(16),{onToggle:n,className:l}=t,i=zs().logo??Ts,o=typeof i=="string"?i:i.light,a=typeof i=="string"?i:i.dark;let d;e[0]!==l?(d=F("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",l),e[0]=l,e[1]=d):d=e[1];let c;e[2]!==o?(c=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=o,e[3]=c):c=e[3];let m;e[4]!==a?(m=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=a,e[5]=m):m=e[5];let u;e[6]!==c||e[7]!==m?(u=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[c,m]})}),e[6]=c,e[7]=m,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(qt,{size:16}),e[9]=f):f=e[9];let x;e[10]!==n?(x=s.jsx(ae,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=x):x=e[11];let p;return e[12]!==d||e[13]!==u||e[14]!==x?(p=s.jsxs(Qs,{className:d,children:[u,x]}),e[12]=d,e[13]=u,e[14]=x,e[15]=p):p=e[15],p}function kt(t){const e=C.c(18),{item:n,onClose:l}=t,r=n.isActive&&"z-10";let i;e[0]!==r?(i=F(r),e[0]=r,e[1]=i):i=e[1];let o;e[2]!==n||e[3]!==l?(o=()=>{n.onClick?.(),l()},e[2]=n,e[3]=l,e[4]=o):o=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let d;e[7]!==n.label?(d=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=d):d=e[8];let c;e[9]!==n.isActive||e[10]!==n.label||e[11]!==o||e[12]!==a||e[13]!==d?(c=s.jsxs(J,{onClick:o,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,d]}),e[9]=n.isActive,e[10]=n.label,e[11]=o,e[12]=a,e[13]=d,e[14]=c):c=e[14];let m;return e[15]!==i||e[16]!==c?(m=s.jsx(K,{className:i,children:c}),e[15]=i,e[16]=c,e[17]=m):m=e[17],m}function Dl(t){const e=C.c(18),{section:n,onClose:l}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ut,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,i=n.group.defaultExpanded;let o;if(e[2]!==l||e[3]!==n.group.items){let d;e[5]!==l?(d=c=>s.jsx(kt,{item:c,onClose:l},c.key),e[5]=l,e[6]=d):d=e[6],o=n.group.items.map(d),e[2]=l,e[3]=n.group.items,e[4]=o}else o=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==o?(a=s.jsx(ds,{label:r,defaultExpanded:i,children:o}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=o,e[10]=a):a=e[10],a}case"items":{let r;if(e[11]!==l||e[12]!==n.items){let o;e[14]!==l?(o=a=>s.jsx(kt,{item:a,onClose:l},a.key),e[14]=l,e[15]=o):o=e[15],r=n.items.map(o),e[11]=l,e[12]=n.items,e[13]=r}else r=e[13];let i;return e[16]!==r?(i=s.jsx(dt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(mt,{children:s.jsx(fe,{className:"gap-1.5",children:r})})}),e[16]=r,e[17]=i):i=e[17],i}case"custom":return n.content}}function Pl(t){const e=C.c(17),{sections:n,onClose:l,footer:r,additionalContent:i}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=o):o=e[0];let a;e[1]!==l?(a=s.jsx(D.Suspense,{fallback:o,children:s.jsx(Ol,{onToggle:l})}),e[1]=l,e[2]=a):a=e[2];let d;if(e[3]!==l||e[4]!==n){let f;e[6]!==l?(f=(x,p)=>s.jsx(Dl,{section:x,onClose:l},p),e[6]=l,e[7]=f):f=e[7],d=n.map(f),e[3]=l,e[4]=n,e[5]=d}else d=e[5];let c;e[8]!==i?(c=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[8]=i,e[9]=c):c=e[9];let m;e[10]!==d||e[11]!==c?(m=s.jsxs(Gt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[d,c]}),e[10]=d,e[11]=c,e[12]=m):m=e[12];let u;return e[13]!==r||e[14]!==a||e[15]!==m?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,m,r]}),e[13]=r,e[14]=a,e[15]=m,e[16]=u):u=e[16],u}function Be(t){const e=C.c(22),{item:n,onClose:l}=t;if(n.href){const d=n.external?"_blank":void 0,c=n.external?"noopener noreferrer":void 0;let m;e[0]!==n.icon?(m=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=m):m=e[1];let u;e[2]!==n.label?(u=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=u):u=e[3];let f;return e[4]!==n.href||e[5]!==l||e[6]!==d||e[7]!==c||e[8]!==m||e[9]!==u?(f=s.jsxs("a",{href:n.href,target:d,rel:c,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:l,children:[m,u]}),e[4]=n.href,e[5]=l,e[6]=d,e[7]=c,e[8]=m,e[9]=u,e[10]=f):f=e[10],f}let r;e[11]!==n||e[12]!==l?(r=()=>{n.onClick?.(),l()},e[11]=n,e[12]=l,e[13]=r):r=e[13];let i;e[14]!==n.icon?(i=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=i):i=e[15];let o;e[16]!==n.label?(o=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=o):o=e[17];let a;return e[18]!==r||e[19]!==i||e[20]!==o?(a=s.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[i,o]}),e[18]=r,e[19]=i,e[20]=o,e[21]=a):a=e[21],a}function It(t){const e=C.c(126),{user:n,userImage:l,menuItems:r,signOutItem:i,themeOptions:o,preferences:a,setPreferences:d,close:c,isMobile:m}=t;if(m){const T=n?.name??"U";let P;e[0]!==T||e[1]!==l?(P=s.jsx(Oe,{url:l,fallback:T,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=T,e[1]=l,e[2]=P):P=e[2];const Y=n?.name??"User";let q;e[3]!==Y?(q=s.jsx("p",{className:"text-sm font-medium truncate",children:Y}),e[3]=Y,e[4]=q):q=e[4];const le=n?.email;let W;e[5]!==le?(W=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:le}),e[5]=le,e[6]=W):W=e[6];let re;e[7]!==q||e[8]!==W?(re=s.jsxs("div",{className:"flex-1 min-w-0",children:[q,W]}),e[7]=q,e[8]=W,e[9]=re):re=e[9];let ie;e[10]!==n?(ie=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ll)},e[10]=n,e[11]=ie):ie=e[11];let ce;e[12]===Symbol.for("react.memo_cache_sentinel")?(ce=s.jsx(yt,{size:14}),e[12]=ce):ce=e[12];let ge;e[13]!==ie?(ge=s.jsx(he,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:ie,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ce})}),e[13]=ie,e[14]=ge):ge=e[14];let ye;e[15]===Symbol.for("react.memo_cache_sentinel")?(ye=s.jsx(xe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=ye):ye=e[15];let I;e[16]!==ge?(I=s.jsx(nt,{delayDuration:300,children:s.jsxs(pe,{children:[ge,ye]})}),e[16]=ge,e[17]=I):I=e[17];let L;e[18]!==I||e[19]!==P||e[20]!==re?(L=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[P,re,I]}),e[18]=I,e[19]=P,e[20]=re,e[21]=L):L=e[21];let V;if(e[22]!==c||e[23]!==r){let me;e[25]!==c?(me=Le=>s.jsx(Be,{item:Le,onClose:c},Le.key),e[25]=c,e[26]=me):me=e[26],V=r.map(me),e[22]=c,e[23]=r,e[24]=V}else V=e[24];let H;e[27]!==c||e[28]!==i?(H=s.jsx(Be,{item:i,onClose:c}),e[27]=c,e[28]=i,e[29]=H):H=e[29];let de;e[30]!==V||e[31]!==H?(de=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[V,H]})}),e[30]=V,e[31]=H,e[32]=de):de=e[32];let Se;if(e[33]!==a.theme||e[34]!==d||e[35]!==o){let me;e[37]!==a.theme||e[38]!==d?(me=Le=>{const{value:Ze,icon:Is,label:As}=Le;return s.jsx("button",{type:"button","aria-label":As,onClick:()=>d($s=>({...$s,theme:Ze})),className:F("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===Ze?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Is},Ze)},e[37]=a.theme,e[38]=d,e[39]=me):me=e[39],Se=o.map(me),e[33]=a.theme,e[34]=d,e[35]=o,e[36]=Se}else Se=e[36];let Ne;e[40]!==Se?(Ne=s.jsx("div",{className:"flex items-center gap-0.5",children:Se}),e[40]=Se,e[41]=Ne):Ne=e[41];const Ye=a.enableSounds?"Disable sounds":"Enable sounds";let _e;e[42]!==d?(_e=()=>d(Fl),e[42]=d,e[43]=_e):_e=e[43];const Je=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let we;e[44]!==Je?(we=F("size-8 rounded-md flex items-center justify-center transition-colors",Je),e[44]=Je,e[45]=we):we=e[45];let Ce;e[46]!==a.enableSounds?(Ce=a.enableSounds?s.jsx(St,{size:14}):s.jsx(Nt,{size:14}),e[46]=a.enableSounds,e[47]=Ce):Ce=e[47];let ke;e[48]!==Ye||e[49]!==_e||e[50]!==we||e[51]!==Ce?(ke=s.jsx("button",{type:"button","aria-label":Ye,onClick:_e,className:we,children:Ce}),e[48]=Ye,e[49]=_e,e[50]=we,e[51]=Ce,e[52]=ke):ke=e[52];let Re;e[53]===Symbol.for("react.memo_cache_sentinel")?(Re=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.23.0"]}),e[53]=Re):Re=e[53];let Ie;e[54]!==ke?(Ie=s.jsxs("div",{className:"flex items-center gap-2",children:[ke,Re]}),e[54]=ke,e[55]=Ie):Ie=e[55];let Ae;e[56]!==Ne||e[57]!==Ie?(Ae=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ne,Ie]}),e[56]=Ne,e[57]=Ie,e[58]=Ae):Ae=e[58];let Fe;return e[59]!==L||e[60]!==de||e[61]!==Ae?(Fe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[L,de,Ae]}),e[59]=L,e[60]=de,e[61]=Ae,e[62]=Fe):Fe=e[62],Fe}const u=n?.name??"U";let f;e[63]!==u||e[64]!==l?(f=s.jsx(Oe,{url:l,fallback:u,shape:"circle",size:"sm",className:"shrink-0"}),e[63]=u,e[64]=l,e[65]=f):f=e[65];const x=n?.name??"User";let p;e[66]!==x?(p=s.jsx("p",{className:"text-sm font-medium truncate",children:x}),e[66]=x,e[67]=p):p=e[67];const h=n?.email;let g;e[68]!==h?(g=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:h}),e[68]=h,e[69]=g):g=e[69];let b;e[70]!==p||e[71]!==g?(b=s.jsxs("div",{className:"flex-1 min-w-0",children:[p,g]}),e[70]=p,e[71]=g,e[72]=b):b=e[72];let j;e[73]!==n?(j=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Rl)},e[73]=n,e[74]=j):j=e[74];let v;e[75]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(yt,{size:14}),e[75]=v):v=e[75];let y;e[76]!==j?(y=s.jsx(he,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:j,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:v})}),e[76]=j,e[77]=y):y=e[77];let w;e[78]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(xe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[78]=w):w=e[78];let k;e[79]!==y?(k=s.jsx(nt,{delayDuration:300,children:s.jsxs(pe,{children:[y,w]})}),e[79]=y,e[80]=k):k=e[80];let S;e[81]!==k||e[82]!==f||e[83]!==b?(S=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[f,b,k]}),e[81]=k,e[82]=f,e[83]=b,e[84]=S):S=e[84];let N;if(e[85]!==c||e[86]!==r){let T;e[88]!==c?(T=P=>s.jsx(Be,{item:P,onClose:c},P.key),e[88]=c,e[89]=T):T=e[89],N=r.map(T),e[85]=c,e[86]=r,e[87]=N}else N=e[87];let _;e[90]!==c||e[91]!==i?(_=s.jsx(Be,{item:i,onClose:c}),e[90]=c,e[91]=i,e[92]=_):_=e[92];let A;e[93]!==N||e[94]!==_?(A=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[N,_]}),e[93]=N,e[94]=_,e[95]=A):A=e[95];let O;if(e[96]!==a.theme||e[97]!==d||e[98]!==o){let T;e[100]!==a.theme||e[101]!==d?(T=P=>{const{value:Y,icon:q,label:le}=P;return s.jsx("button",{type:"button","aria-label":le,onClick:()=>d(W=>({...W,theme:Y})),className:F("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===Y?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:q},Y)},e[100]=a.theme,e[101]=d,e[102]=T):T=e[102],O=o.map(T),e[96]=a.theme,e[97]=d,e[98]=o,e[99]=O}else O=e[99];let $;e[103]!==O?($=s.jsx("div",{className:"flex items-center gap-0.5",children:O}),e[103]=O,e[104]=$):$=e[104];const z=a.enableSounds?"Disable sounds":"Enable sounds";let R;e[105]!==d?(R=()=>d(El),e[105]=d,e[106]=R):R=e[106];const U=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let E;e[107]!==U?(E=F("size-7 rounded-md flex items-center justify-center transition-colors",U),e[107]=U,e[108]=E):E=e[108];let B;e[109]!==a.enableSounds?(B=a.enableSounds?s.jsx(St,{size:14}):s.jsx(Nt,{size:14}),e[109]=a.enableSounds,e[110]=B):B=e[110];let M;e[111]!==z||e[112]!==R||e[113]!==E||e[114]!==B?(M=s.jsx("button",{type:"button","aria-label":z,onClick:R,className:E,children:B}),e[111]=z,e[112]=R,e[113]=E,e[114]=B,e[115]=M):M=e[115];let G;e[116]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","4.23.0"]}),e[116]=G):G=e[116];let X;e[117]!==M?(X=s.jsxs("div",{className:"flex items-center gap-2",children:[M,G]}),e[117]=M,e[118]=X):X=e[118];let Q;e[119]!==$||e[120]!==X?(Q=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[$,X]}),e[119]=$,e[120]=X,e[121]=Q):Q=e[121];let te;return e[122]!==S||e[123]!==A||e[124]!==Q?(te=s.jsx("div",{className:"flex w-full flex-col overflow-hidden",children:s.jsxs("div",{className:"flex flex-col",children:[S,A,Q]})}),e[122]=S,e[123]=A,e[124]=Q,e[125]=te):te=e[125],te}function El(t){return{...t,enableSounds:!t.enableSounds}}function Rl(){se.success("User ID copied")}function Fl(t){return{...t,enableSounds:!t.enableSounds}}function Ll(){se.success("User ID copied")}function it(){const t=C.c(34),{data:e}=be.useSession(),{org:n}=ee(),l=ne();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org",shouldThrow:!1},t[0]=r):r=t[0];const o=Ms(r)?.params.org,[a,d]=Os(),c=ft(),[m,u]=D.useState(!1),f=e?.user,x=f?.image;let p;t[1]===Symbol.for("react.memo_cache_sentinel")?(p=()=>u(!1),t[1]=p):p=t[1];const h=p;let g;t[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Ve,{size:16}),t[2]=g):g=t[2];let b;t[3]!==l||t[4]!==o?(b={key:"preferences",label:"Preferences",icon:g,onClick:()=>{l({to:"/$org/settings/profile",params:{org:o??""}})}},t[3]=l,t[4]=o,t[5]=b):b=t[5];let j;t[6]!==n||t[7]!==l?(j=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(sn,{size:16}),onClick:()=>{l({to:"/$org/install",params:{org:n.slug}})}}]:[],t[6]=n,t[7]=l,t[8]=j):j=t[8];let v;t[9]===Symbol.for("react.memo_cache_sentinel")?(v={key:"terms",label:"Terms of Use",icon:s.jsx(ln,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[9]=v):v=t[9];let y;t[10]===Symbol.for("react.memo_cache_sentinel")?(y={key:"privacy",label:"Privacy Policy",icon:s.jsx(mn,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[10]=y):y=t[10];let w;t[11]===Symbol.for("react.memo_cache_sentinel")?(w={key:"github",label:"decocms/studio",icon:s.jsx(Ds,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[11]=w):w=t[11];let k;t[12]===Symbol.for("react.memo_cache_sentinel")?(k={key:"community",label:"Community",icon:s.jsx(un,{size:16}),href:"https://decocms.com/discord",external:!0},t[12]=k):k=t[12];let S;t[13]===Symbol.for("react.memo_cache_sentinel")?(S={key:"homepage",label:"Homepage",icon:s.jsx(nn,{size:16}),href:"https://decocms.com",external:!0},t[13]=S):S=t[13];let N;t[14]!==b||t[15]!==j?(N=[b,...j,v,y,w,k,S],t[14]=b,t[15]=j,t[16]=N):N=t[16];const _=N;let A;t[17]===Symbol.for("react.memo_cache_sentinel")?(A={key:"logout",label:"Sign out",icon:s.jsx(rn,{size:16}),onClick:Hl},t[17]=A):A=t[17];const O=A;let $;t[18]===Symbol.for("react.memo_cache_sentinel")?($={value:"light",icon:s.jsx(an,{size:14}),label:"Light theme"},t[18]=$):$=t[18];let z;t[19]===Symbol.for("react.memo_cache_sentinel")?(z={value:"dark",icon:s.jsx(cn,{size:14}),label:"Dark theme"},t[19]=z):z=t[19];let R;t[20]===Symbol.for("react.memo_cache_sentinel")?(R=[$,z,{value:"system",icon:s.jsx(Xt,{size:14}),label:"System theme"}],t[20]=R):R=t[20];const U=R;let E;t[21]!==c||t[22]!==_||t[23]!==a||t[24]!==d||t[25]!==f||t[26]!==x?(E={user:f,userImage:x,menuItems:_,signOutItem:O,themeOptions:U,preferences:a,setPreferences:d,close:h,isMobile:c},t[21]=c,t[22]=_,t[23]=a,t[24]=d,t[25]=f,t[26]=x,t[27]=E):E=t[27];const B=E;let M;return t[28]!==c||t[29]!==m||t[30]!==B||t[31]!==f?.name||t[32]!==x?(M=s.jsx(s.Fragment,{children:c?s.jsxs(Wt,{open:m,onOpenChange:u,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx(Oe,{url:x,fallback:f?.name??"U",shape:"circle",size:"2xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]}),s.jsxs(Kt,{className:"h-[80dvh] p-0",children:[s.jsx(Vt,{className:"sr-only",children:"Account"}),s.jsx(It,{...B})]})]}):s.jsxs(De,{open:m,onOpenChange:u,children:[s.jsx(je,{asChild:!0,children:s.jsxs(J,{tooltip:f?.name??"Account",className:"rounded-md",children:[s.jsx(Oe,{url:x,fallback:f?.name??"U",shape:"circle",size:"xs",className:"shrink-0"}),s.jsx("span",{className:"truncate",children:f?.name??"Account"})]})}),s.jsx(Pe,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[280px] p-0 flex flex-col max-h-[520px]",onCloseAutoFocus:Bl,children:s.jsx(It,{...B})})]})}),t[28]=c,t[29]=m,t[30]=B,t[31]=f?.name,t[32]=x,t[33]=M):M=t[33],M}function Bl(t){return t.preventDefault()}function Hl(){ue("signed_out",{source:"account_popover"}),Ps(),be.signOut()}const At=["requires_action","in_progress","failed","expired","completed"];function Ul(t){const e=new Map(At.map(n=>[n,[]]));for(const n of t){const l=n.status??"completed";(e.get(l)??e.get("completed")).push(n)}return At.map(n=>({status:n,threads:e.get(n)}))}function fs(t){const e=C.c(4),{onClick:n}=t;let l,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(rt,{}),r=s.jsx("span",{children:"Add repo"}),e[0]=l,e[1]=r):(l=e[0],r=e[1]);let i;return e[2]!==n?(i=s.jsxs(J,{tooltip:"Add repo",onClick:n,children:[l,r]}),e[2]=n,e[3]=i):i=e[3],i}function Gl(t){const e=C.c(41),{onAddNew:n}=t,{org:l}=ee(),r=Lt(),i=ne(),o=_n();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const c=Ke(a).virtualmcpid??null;let m;e[1]!==c?(m=!!c&&!Jt(c),e[1]=c,e[2]=m):m=e[2];const u=m;let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f={slug:"mcp-github"},e[3]=f):f=e[3];const p=yn(f).filter(Wl),h=ht(),b=xt(u?c:null)?.metadata?.githubRepo?.connectionId??null;let j;e[4]!==l.id||e[5]!==l.slug?(j={connectionId:Zt,orgId:l.id,orgSlug:l.slug},e[4]=l.id,e[5]=l.slug,e[6]=j):j=e[6];const v=Yt(j);if(p.length===0){let T;return e[7]!==n?(T=s.jsx(fs,{onClick:n}),e[7]=n,e[8]=T):T=e[8],T}let y;e[9]!==c||e[10]!==i||e[11]!==l.id||e[12]!==r||e[13]!==v?(y=async(T,P)=>{await v.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:c,data:{metadata:{githubRepo:T}}}}),vt(r,l.id),se.success(`Previewing ${P}`),i({to:".",search:ql,replace:!0})},e[9]=c,e[10]=i,e[11]=l.id,e[12]=r,e[13]=v,e[14]=y):y=e[14];const w=y;let k;e[15]!==h||e[16]!==o||e[17]!==l.id||e[18]!==r||e[19]!==v?(k=async(T,P,Y)=>{const q=h.find(re=>{const ie=re.metadata?.githubRepo;return ie?.owner?.toLowerCase()===T.owner.toLowerCase()&&ie?.name?.toLowerCase()===T.name.toLowerCase()});if(q){o(q.id,{search:{main:"preview"}});return}const W=(await v.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:T.name,description:`Imported from ${Y}`,status:"active",pinned:!1,icon:null,connections:[{connection_id:P}],metadata:{githubRepo:T,instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}}}}})).structuredContent?.item?.id;if(vt(r,l.id),!W)throw new Error("Failed to create the repo agent");se.success(`Created ${Y}`),o(W,{search:{main:"preview"}})},e[15]=h,e[16]=o,e[17]=l.id,e[18]=r,e[19]=v,e[20]=k):k=e[20];const S=k;let N;e[21]!==w||e[22]!==u||e[23]!==S?(N=async T=>{const P=lt(T);if(!P)return;const Y=`${P.owner}/${P.repo}`,q={owner:P.owner,name:P.repo,url:`https://github.com/${P.owner}/${P.repo}`,installationId:P.installationId,connectionId:T.id};try{u?await w(q,Y):await S(q,T.id,Y)}catch(le){const W=le;se.error("Failed to set preview repo: "+(W instanceof Error?W.message:"Unknown error"))}},e[21]=w,e[22]=u,e[23]=S,e[24]=N):N=e[24];const _=N,A=bn;let O;e[25]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(jn,{asChild:!0,children:s.jsxs(J,{children:[s.jsx(rt,{}),s.jsx("span",{children:"Add repo"})]})}),e[25]=O):O=e[25];const $=gn,z="start",R="right",U="w-56";let E;e[26]!==b||e[27]!==_?(E=T=>{const P=lt(T);return P?s.jsxs(wt,{onSelect:()=>_(T),children:[s.jsx(rt,{className:"size-4 text-muted-foreground"}),s.jsxs("span",{className:"flex-1 truncate",children:[P.owner,"/",P.repo]}),T.id===b&&s.jsx(Ee,{className:"size-4"})]},T.id):null},e[26]=b,e[27]=_,e[28]=E):E=e[28];const B=p.map(E);let M;e[29]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(vn,{}),e[29]=M):M=e[29];let G;e[30]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx($e,{className:"size-4"}),e[30]=G):G=e[30];let X;e[31]!==n?(X=s.jsxs(wt,{onSelect:n,children:[G,"Add new repo…"]}),e[31]=n,e[32]=X):X=e[32];let Q;e[33]!==$||e[34]!==B||e[35]!==X?(Q=s.jsxs($,{align:z,side:R,className:U,children:[B,M,X]}),e[33]=$,e[34]=B,e[35]=X,e[36]=Q):Q=e[36];let te;return e[37]!==A||e[38]!==Q||e[39]!==O?(te=s.jsxs(A,{children:[O,Q]}),e[37]=A,e[38]=Q,e[39]=O,e[40]=te):te=e[40],te}function ql(t){return{...t,main:"preview"}}function Wl(t){return lt(t)!==null&&Nn(t)}function Kl(){const t=C.c(4),[e,n]=D.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(fs,{onClick:()=>n(!0)}),t[0]=l):l=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(D.Suspense,{fallback:l,children:s.jsx(Gl,{onAddNew:()=>n(!0)})}),t[1]=r):r=t[1];let i;return t[2]!==e?(i=s.jsxs(s.Fragment,{children:[r,s.jsx(Sn,{open:e,onOpenChange:n,mode:"connection"})]}),t[2]=e,t[3]=i):i=t[3],i}function ot(){const t=C.c(22),e=Tn(),[n,l]=D.useState(!1);let r;if(t[0]!==e.capabilities||t[1]!==e.hostname||t[2]!==e.machineId||t[3]!==e.online){const h=Mn(e.capabilities);r=e.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:e.hostname??e.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:h.length>0?`Available: ${h.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),t[0]=e.capabilities,t[1]=e.hostname,t[2]=e.machineId,t[3]=e.online,t[4]=r}else r=t[4];const i=r;let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=()=>l(!0),t[5]=o):o=t[5];const a=e.online?"Desktop linked":"Connect your desktop";let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Xt,{size:16}),t[6]=d):d=t[6];let c;t[7]!==e.online?(c=e.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),t[7]=e.online,t[8]=c):c=t[8];let m;t[9]!==a||t[10]!==c?(m=s.jsx(he,{asChild:!0,children:s.jsxs(ae,{onClick:o,"aria-label":a,children:[d,c]})}),t[9]=a,t[10]=c,t[11]=m):m=t[11];let u;t[12]!==i?(u=s.jsx(xe,{side:"bottom",children:i}),t[12]=i,t[13]=u):u=t[13];let f;t[14]!==m||t[15]!==u?(f=s.jsxs(pe,{children:[m,u]}),t[14]=m,t[15]=u,t[16]=f):f=t[16];let x;t[17]!==n?(x=s.jsx(On,{open:n,onOpenChange:l}),t[17]=n,t[18]=x):x=t[18];let p;return t[19]!==f||t[20]!==x?(p=s.jsxs(s.Fragment,{children:[f,x]}),t[19]=f,t[20]=x,t[21]=p):p=t[21],p}function Vl({invitation:t}){const[e,n]=D.useState(!1),[l,r]=D.useState(!1),i=Lt(),o=async()=>{n(!0);try{const c=await be.organization.acceptInvitation({invitationId:t.id});if(c.error){se.error(c.error.message),n(!1);return}}catch{se.error("Failed to accept invitation"),n(!1);return}se.success("Invitation accepted!"),Es();let d;try{d=(await be.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=d?`/${d}`:"/"},a=async()=>{r(!0);try{const d=await be.organization.rejectInvitation({invitationId:t.id});d.error?(se.error(d.error.message),r(!1)):(se.success("Invitation declined"),i.invalidateQueries())}catch{se.error("Failed to decline invitation"),r(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(ze,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:o,disabled:e||l,"aria-label":"Accept invitation",children:s.jsx(Ee,{size:14})}),s.jsx(ze,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||l,"aria-label":"Decline invitation",children:s.jsx(ss,{size:14})})]})]})}function Xl(t){const e=C.c(29),{request:n}=t,{approve:l,deny:r}=Dn(),i=l.isPending||r.isPending,o=n.user?.name??n.user?.email??n.userId,a=n.user?.image??void 0;let d;e[0]!==o?(d=o.charAt(0).toUpperCase(),e[0]=o,e[1]=d):d=e[1];let c;e[2]!==a||e[3]!==d?(c=s.jsx(Oe,{url:a,fallback:d,shape:"circle",size:"sm"}),e[2]=a,e[3]=d,e[4]=c):c=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Requested to join"}),e[5]=m):m=e[5];let u;e[6]!==o?(u=s.jsxs("div",{className:"flex-1 min-w-0",children:[m,s.jsx("p",{className:"text-sm font-medium truncate",children:o})]}),e[6]=o,e[7]=u):u=e[7];let f;e[8]!==l||e[9]!==n.id?(f=()=>l.mutate(n.id),e[8]=l,e[9]=n.id,e[10]=f):f=e[10];let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ee,{size:14}),e[11]=x):x=e[11];let p;e[12]!==i||e[13]!==f?(p=s.jsx(ze,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:f,disabled:i,"aria-label":"Approve join request",children:x}),e[12]=i,e[13]=f,e[14]=p):p=e[14];let h;e[15]!==r||e[16]!==n.id?(h=()=>r.mutate(n.id),e[15]=r,e[16]=n.id,e[17]=h):h=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ss,{size:14}),e[18]=g):g=e[18];let b;e[19]!==i||e[20]!==h?(b=s.jsx(ze,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:h,disabled:i,"aria-label":"Deny join request",children:g}),e[19]=i,e[20]=h,e[21]=b):b=e[21];let j;e[22]!==b||e[23]!==p?(j=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[p,b]}),e[22]=b,e[23]=p,e[24]=j):j=e[24];let v;return e[25]!==j||e[26]!==c||e[27]!==u?(v=s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[c,u,j]}),e[25]=j,e[26]=c,e[27]=u,e[28]=v):v=e[28],v}function Ql(t){const e=C.c(14),{release:n,isSeen:l,onSelect:r}=t;let i;e[0]!==l?(i=!l&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=l,e[1]=i):i=e[1];let o;e[2]!==n.eyebrow?(o=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=o):o=e[3];let a;e[4]!==n.title?(a=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let d;e[6]!==o||e[7]!==a?(d=s.jsxs("div",{className:"flex-1 min-w-0",children:[o,a]}),e[6]=o,e[7]=a,e[8]=d):d=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ns,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=c):c=e[9];let m;return e[10]!==r||e[11]!==i||e[12]!==d?(m=s.jsxs("button",{type:"button",onClick:r,className:"relative w-full flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors text-left",children:[i,d,c]}),e[10]=r,e[11]=i,e[12]=d,e[13]=m):m=e[13],m}function Yl(){const t=D.useContext(Rs),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(l=>l.status==="pending"&&new Date(l.expiresAt)>new Date)}function hs(){const t=C.c(11),{isSeen:e,markSeen:n,unseenCount:l}=En(),r=Yl(),i=Pn();let o;if(t[0]!==e||t[1]!==r||t[2]!==i){const c=[...i].sort(sr).map(tr),m=[...r].sort(er).map(Zl);let u;t[4]!==e?(u=x=>({type:"release",release:x,isSeen:e(x.id)}),t[4]=e,t[5]=u):u=t[5];const f=[...Rn].sort(Jl).map(u);o=[...c,...m,...f],t[0]=e,t[1]=r,t[2]=i,t[3]=o}else o=t[3];const a=l+r.length+i.length;let d;return t[6]!==n||t[7]!==r||t[8]!==o||t[9]!==a?(d={items:o,pendingInvitations:r,redDotCount:a,markReleaseSeen:n},t[6]=n,t[7]=r,t[8]=o,t[9]=a,t[10]=d):d=t[10],d}function Jl(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function Zl(t){return{type:"invitation",invitation:t}}function er(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}function tr(t){return{type:"join-request",request:t}}function sr(t,e){return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}class xs extends D.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function ps(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function nr(){const t=C.c(17),e=ne(),{org:n}=ee(),{hasDecoKey:l,balanceDollars:r}=ts();if(!l)return null;let i;t[0]!==r?(i=r!=null?`Credits: $${r.toFixed(2)}`:"Credits",t[0]=r,t[1]=i):i=t[1];let o;t[2]!==r?(o=F(r!=null&&ps(r)),t[2]=r,t[3]=o):o=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Qt,{}),t[7]=d):d=t[7];let c;t[8]!==r?(c=r!=null?`$${r.toFixed(2)}`:"Credits",t[8]=r,t[9]=c):c=t[9];let m;t[10]!==c?(m=s.jsx("span",{children:c}),t[10]=c,t[11]=m):m=t[11];let u;return t[12]!==i||t[13]!==o||t[14]!==a||t[15]!==m?(u=s.jsx(fe,{children:s.jsx(K,{children:s.jsxs(J,{tooltip:i,className:o,onClick:a,children:[d,m]})})}),t[12]=i,t[13]=o,t[14]=a,t[15]=m,t[16]=u):u=t[16],u}function lr(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(xs,{children:s.jsx(D.Suspense,{fallback:null,children:s.jsx(nr,{})})}),t[0]=e):e=t[0],e}function rr(){const t=C.c(17),e=ne(),{org:n}=ee(),{hasDecoKey:l,balanceDollars:r}=ts();if(!l)return null;let i;t[0]!==r?(i=r!=null?`Credits: $${r.toFixed(2)}`:"Credits",t[0]=r,t[1]=i):i=t[1];const o=i;let a;t[2]!==e||t[3]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[2]=e,t[3]=n.slug,t[4]=a):a=t[4];let d;t[5]!==r?(d=F(r!=null&&ps(r)),t[5]=r,t[6]=d):d=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Qt,{className:"size-4"}),t[7]=c):c=t[7];let m;t[8]!==a||t[9]!==d||t[10]!==o?(m=s.jsx(he,{asChild:!0,children:s.jsx(ae,{"aria-label":o,onClick:a,className:d,children:c})}),t[8]=a,t[9]=d,t[10]=o,t[11]=m):m=t[11];let u;t[12]!==o?(u=s.jsx(xe,{side:"top",children:o}),t[12]=o,t[13]=u):u=t[13];let f;return t[14]!==m||t[15]!==u?(f=s.jsxs(pe,{delayDuration:300,children:[m,u]}),t[14]=m,t[15]=u,t[16]=f):f=t[16],f}function ir(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(xs,{children:s.jsx(D.Suspense,{fallback:null,children:s.jsx(rr,{})})}),t[0]=e):e=t[0],e}function gs(t){const e=C.c(15),{children:n}=t,{items:l,markReleaseSeen:r}=hs(),[i,o]=D.useState(null);let a;if(e[0]!==l||e[1]!==i){let h;e[3]!==i?(h=g=>g.type==="release"&&g.release.id===i,e[3]=i,e[4]=h):h=e[4],a=l.find(h),e[0]=l,e[1]=i,e[2]=a}else a=e[2];const d=a,c=d?.type==="release"?d.release:null;let m;e[5]!==r?(m=h=>{o(h),r(h)},e[5]=r,e[6]=m):m=e[6];const u=m;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=h=>{h||o(null)},e[7]=f):f=e[7];let x;e[8]!==u||e[9]!==l||e[10]!==c?(x=s.jsx(Pe,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:c?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-border shrink-0",children:[s.jsx(ze,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>o(null),children:s.jsx(dn,{size:16})}),s.jsx("h3",{className:"text-sm font-medium truncate",children:c.title})]}),s.jsx("div",{className:"overflow-y-auto flex-1 p-5",children:s.jsx(Fn,{release:c})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),l.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(Xe,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Nothing here yet"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Invitations, join requests, and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:l.map(h=>h.type==="join-request"?s.jsx(Xl,{request:h.request},`req-${h.request.id}`):h.type==="invitation"?s.jsx(Vl,{invitation:h.invitation},`inv-${h.invitation.id}`):s.jsx(Ql,{release:h.release,isSeen:h.isSeen,onSelect:()=>u(h.release.id)},`rel-${h.release.id}`))})]})}),e[8]=u,e[9]=l,e[10]=c,e[11]=x):x=e[11];let p;return e[12]!==n||e[13]!==x?(p=s.jsxs(De,{onOpenChange:f,children:[n,x]}),e[12]=n,e[13]=x,e[14]=p):p=e[14],p}function bs(){const{redDotCount:t}=hs();return t>0}function or(){const t=C.c(6),e=bs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Xe,{}),t[0]=n):n=t[0];let l;t[1]!==e?(l=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=l):l=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("span",{children:"Inbox"}),t[3]=r):r=t[3];let i;return t[4]!==l?(i=s.jsx(gs,{children:s.jsx(je,{asChild:!0,children:s.jsxs(J,{tooltip:"Inbox",className:"relative",children:[n,l,r]})})}),t[4]=l,t[5]=i):i=t[5],i}function ar(){const t=C.c(8),e=bs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Xe,{className:"size-4"}),t[0]=n):n=t[0];let l;t[1]!==e?(l=e&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=l):l=t[2];let r;t[3]!==l?(r=s.jsx(je,{asChild:!0,children:s.jsx(he,{asChild:!0,children:s.jsxs(ae,{"aria-label":"Inbox",children:[n,l]})})}),t[3]=l,t[4]=r):r=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(xe,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let o;return t[6]!==r?(o=s.jsx(gs,{children:s.jsxs(pe,{delayDuration:300,children:[r,i]})}),t[6]=r,t[7]=o):o=t[7],o}function cr(){const t=C.c(7),e=ne(),{org:n}=ee();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let r,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ve,{}),i=s.jsx("span",{children:"Settings"}),t[3]=r,t[4]=i):(r=t[3],i=t[4]);let o;return t[5]!==l?(o=s.jsxs(J,{tooltip:"Settings",onClick:l,children:[r,i]}),t[5]=l,t[6]=o):o=t[6],o}function dr(){const t=C.c(9),e=ne(),{org:n}=ee();let l;t[0]!==e||t[1]!==n.slug?(l=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=l):l=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ve,{className:"size-4"}),t[3]=r):r=t[3];let i;t[4]!==l?(i=s.jsx(he,{asChild:!0,children:s.jsx(ae,{"aria-label":"Settings",onClick:l,children:r})}),t[4]=l,t[5]=i):i=t[5];let o;t[6]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(xe,{side:"top",children:"Settings"}),t[6]=o):o=t[6];let a;return t[7]!==i?(a=s.jsxs(pe,{delayDuration:300,children:[i,o]}),t[7]=i,t[8]=a):a=t[8],a}function mr(){const t=C.c(5),[e,n]=D.useState(!1);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(K,{children:s.jsx(An,{trigger:s.jsxs(J,{tooltip:"Invite members",children:[s.jsx(fn,{}),s.jsx("span",{children:"Invite members"})]})})}),t[0]=l):l=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K,{children:s.jsx(Kl,{})}),t[1]=r):r=t[1];let i;t[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(fe,{className:"gap-0.5",children:[l,r,s.jsx(K,{children:s.jsxs(J,{tooltip:"Add connection",onClick:()=>n(!0),children:[s.jsx(on,{}),s.jsx("span",{children:"Add connection"})]})})]}),t[2]=i):i=t[2];let o;return t[3]!==e?(o=s.jsxs(s.Fragment,{children:[i,s.jsx($n,{open:e,onOpenChange:n,mode:"browse"})]}),t[3]=e,t[4]=o):o=t[4],o}function ur(){const t=C.c(8),{state:e}=ve();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(lr,{}),t[0]=o):o=t[0];let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(K,{children:s.jsx("div",{className:"flex justify-center",children:s.jsx(ot,{})})}),t[1]=a):a=t[1];let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(K,{children:s.jsx(or,{})}),t[2]=d):d=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(K,{children:s.jsx(cr,{})}),t[3]=c):c=t[3];let m;return t[4]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsxs(st,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs(fe,{children:[a,d,c,s.jsx(K,{children:s.jsx(it,{})})]})]}),t[4]=m):m=t[4],m}let l,r;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(mr,{}),r=s.jsx(ut,{className:"mx-0"}),t[5]=l,t[6]=r):(l=t[5],r=t[6]);let i;return t[7]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(st,{className:"px-2 pb-3 gap-1.5",children:[l,r,s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(fe,{children:s.jsx(K,{children:s.jsx(it,{})})})}),s.jsx(dr,{}),s.jsx(ar,{}),s.jsx(ot,{}),s.jsx(ir,{})]})]}),t[7]=i):i=t[7],i}function fr(){const t=C.c(8),e=ne(),{org:n}=ee(),{setOpenMobile:l}=ve();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(fe,{children:s.jsx(K,{children:s.jsx(it,{})})})}),t[0]=r):r=t[0];let i;t[1]!==e||t[2]!==n.slug||t[3]!==l?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),l(!1)},t[1]=e,t[2]=n.slug,t[3]=l,t[4]=i):i=t[4];let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ve,{className:"size-4"}),t[5]=o):o=t[5];let a;return t[6]!==i?(a=s.jsx(st,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[r,s.jsx(ae,{"aria-label":"Settings",onClick:i,children:o})]})}),t[6]=i,t[7]=a):a=t[7],a}function $t(t){const e=C.c(15),{className:n,wrapperClassName:l,children:r}=t,[i,o]=D.useState(!1);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=b=>{b&&o(b.scrollHeight>b.clientHeight+1)},e[0]=a):a=e[0];const d=a;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=b=>{const j=b.currentTarget;o(j.scrollHeight-j.scrollTop>j.clientHeight+1)},e[1]=c):c=e[1];const m=c;let u;e[2]!==l?(u=F("relative",l),e[2]=l,e[3]=u):u=e[3];let f;e[4]!==r||e[5]!==n?(f=s.jsx("div",{ref:d,onScroll:m,className:n,children:r}),e[4]=r,e[5]=n,e[6]=f):f=e[6];const x=i?"opacity-100":"opacity-0";let p;e[7]!==x?(p=F("pointer-events-none absolute right-0 bottom-0 left-0 h-10 bg-gradient-to-t from-sidebar to-transparent transition-opacity duration-150",x),e[7]=x,e[8]=p):p=e[8];let h;e[9]!==p?(h=s.jsx("div",{"aria-hidden":!0,className:p}),e[9]=p,e[10]=h):h=e[10];let g;return e[11]!==u||e[12]!==f||e[13]!==h?(g=s.jsxs("div",{className:u,children:[f,h]}),e[11]=u,e[12]=f,e[13]=h,e[14]=g):g=e[14],g}function hr(t){const e=C.c(8),{virtualMcpId:n,size:l,showAutomationBadge:r}=t,i=l===void 0?"sm":l;let o;e[0]!==i||e[1]!==n?(o=n?s.jsx(xr,{virtualMcpId:n,size:i}):s.jsx(Te,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=o):o=e[2];let a;e[3]!==r?(a=r&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(sl,{size:10,className:"text-white"})}),e[3]=r,e[4]=a):a=e[4];let d;return e[5]!==o||e[6]!==a?(d=s.jsxs("div",{className:"relative shrink-0",children:[o,a]}),e[5]=o,e[6]=a,e[7]=d):d=e[7],d}function xr(t){const e=C.c(6),{virtualMcpId:n,size:l}=t,r=xt(n);if(!r){let a;return e[0]!==l?(a=s.jsx(Te,{icon:null,name:"?",size:l}),e[0]=l,e[1]=a):a=e[1],a}const i=r.icon??null;let o;return e[2]!==r.title||e[3]!==l||e[4]!==i?(o=s.jsx(Te,{icon:i,name:r.title,size:l}),e[2]=r.title,e[3]=l,e[4]=i,e[5]=o):o=e[5],o}function zt(t){const e=C.c(36),{open:n,onOpenChange:l}=t,[r,i]=D.useState(""),{org:o}=ee(),{setTaskId:a}=pt(),d=rs();let c,m,u;e[0]!==o.id||e[1]!==r?(u=r.trim(),m=Ls,c=Fs.globalSearch(o.id,u),e[0]=o.id,e[1]=r,e[2]=c,e[3]=m,e[4]=u):(c=e[2],m=e[3],u=e[4]);const f=n&&u.length>0;let x;e[5]!==d||e[6]!==u?(x=async()=>await d.call("GLOBAL_SEARCH",{query:u,limit:20}),e[5]=d,e[6]=u,e[7]=x):x=e[7];let p;e[8]!==c||e[9]!==f||e[10]!==x?(p={queryKey:c,enabled:f,queryFn:x,staleTime:1e4},e[8]=c,e[9]=f,e[10]=x,e[11]=p):p=e[11];const{data:h,isFetching:g}=m(p);let b;e[12]!==h?.items?(b=h?.items??[],e[12]=h?.items,e[13]=b):b=e[13];const j=b;let v;e[14]!==l?(v=z=>{z||i(""),l(z)},e[14]=l,e[15]=v):v=e[15];const y=v;let w;e[16]!==y||e[17]!==a?(w=z=>{y(!1),a(z.id,z.virtual_mcp_id??void 0)},e[16]=y,e[17]=a,e[18]=w):w=e[18];const k=w;let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsxs(Wn,{className:"sr-only",children:[s.jsx(Kn,{children:"Search"}),s.jsx(Vn,{children:"Search across your organization's resources."})]}),e[19]=S):S=e[19];let N;e[20]!==r?(N=s.jsx(Zn,{value:r,onValueChange:i,placeholder:"Search..."}),e[20]=r,e[21]=N):N=e[21];let _;e[22]!==k||e[23]!==g||e[24]!==j||e[25]!==u?(_=u?g&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Yn,{children:"No results."}):j.map(z=>z.type==="thread"?s.jsxs(Jn,{value:`thread:${z.id}:${z.title}`,onSelect:()=>k(z),className:"gap-2.5",children:[s.jsx(hr,{virtualMcpId:z.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:z.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(z.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${z.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=k,e[23]=g,e[24]=j,e[25]=u,e[26]=_):_=e[26];let A;e[27]!==_?(A=s.jsx(el,{children:_}),e[27]=_,e[28]=A):A=e[28];let O;e[29]!==N||e[30]!==A?(O=s.jsxs(Xn,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[S,s.jsxs(tl,{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:[N,A]})]}),e[29]=N,e[30]=A,e[31]=O):O=e[31];let $;return e[32]!==y||e[33]!==n||e[34]!==O?($=s.jsx(Qn,{open:n,onOpenChange:y,children:O}),e[32]=y,e[33]=n,e[34]=O,e[35]=$):$=e[35],$}const pr="sidebar.group.expanded.";function gr(t,e){const n=C.c(3),[l,r]=We(`${pr}${t}`,e);let i;return n[0]!==l||n[1]!==r?(i=[l,r],n[0]=l,n[1]=r,n[2]=i):i=n[2],i}function js(t){const e=C.c(12),{onClick:n,isFetching:l,indented:r}=t,i=r?"-ml-4 pl-6 pr-2":"px-2";let o;e[0]!==i?(o=F("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",i,"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[0]=i,e[1]=o):o=e[1];let a;e[2]!==l?(a=l&&s.jsx(Bt,{size:14,className:"animate-spin"}),e[2]=l,e[3]=a):a=e[3];const d=l?"Loading…":"Show more";let c;e[4]!==d?(c=s.jsx("span",{children:d}),e[4]=d,e[5]=c):c=e[5];let m;return e[6]!==l||e[7]!==n||e[8]!==o||e[9]!==a||e[10]!==c?(m=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:l,className:o,children:[a,c]}),e[6]=l,e[7]=n,e[8]=o,e[9]=a,e[10]=c,e[11]=m):m=e[11],m}function br(t,e,n,l){return[t,e,n,l.type,l.member,l.currentUserId??""].join("|")}function jr(t){return t.member==="mine"&&!t.currentUserId}const vs=4;let Ue=0;const at=[];function vr(){for(;Ue<vs&&at.length>0;){const t=at.shift();t&&t()}}function ys(t){return new Promise((e,n)=>{const l=()=>{Ue++,t().then(e,n).finally(()=>{Ue--,vr()})};Ue<vs?l():at.push(l)})}const Qe=10;function Tt(t,e,n,l,r){const i={hidden:!1};l.member==="mine"&&l.currentUserId&&(i.created_by=l.currentUserId),l.type==="automation"&&(i.has_trigger=!0),l.type==="manual"&&(i.has_trigger=!1);const o={where:i,limit:r,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return o.status=e,o}function yr(t,e,n,l){let r=0;for(const i of t)Ss(i,e,n,l)&&r++;return r}function et(t,e,n,l){return yr(t,e,n,l)}function Sr(t,e){return!!(t>=Qe||t===0&&e)}function Mt(t,e){return t<e}function Nr(t,e){return e===!1?!1:e===!0?!0:t}function Ss(t,e,n,l){return!(t.hidden||(t.status??"completed")!==n||l.member==="mine"&&l.currentUserId&&t.created_by!==l.currentUserId||l.type==="automation"&&!t.trigger_id||l.type==="manual"&&t.trigger_id)}const qe=new Map,He=new Map;function _r(t,e){return e?t>=Qe?!0:null:!1}function Ot(t){return qe.get(t)}function wr(t,e){qe.set(t,e)}function Cr(t,e,n){const l=qe.get(t);if(l!==void 0){n(l);return}let r=He.get(t);r||(r=ys(e).then(i=>(qe.set(t,i),He.delete(t),i)).catch(()=>(He.delete(t),Promise.reject(new Error("group probe failed")))),He.set(t,r)),r.then(n,()=>n(!1))}function Dt(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Qe,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function kr(t,e,n,l,r){let i=0;for(const o of t)e.has(o.id)||Ss(o,n,l,r)&&i++;return i}function Ir(t,e,n,l){const r=C.c(8),{org:i}=ee(),o=br(i.id,t,e,n);let a;r[0]!==n?(a=jr(n),r[0]=n,r[1]=a):a=r[1];const d=a,[c,m]=D.useState({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});c.identity!==o&&m({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:null,serverHasMore:null});const u=Gn(),{threads:f,hasMore:x}=gt(),p=et(f,t,e,n),h=Sr(p,x),g=_r(p,x),b=rs();if(c.identity===o&&c.serverHasMore===null){const S=g??Ot(o);S!==void 0&&m({isFetching:!1,isProbing:!1,identity:o,probeSubscribedIdentity:c.probeSubscribedIdentity,serverHasMore:S})}!d&&c.identity===o&&c.serverHasMore===null&&g===null&&Ot(o)===void 0&&c.probeSubscribedIdentity!==o&&(m(S=>S.identity===o?{...S,isProbing:!0,probeSubscribedIdentity:o}:S),Cr(o,async()=>{const S=Tt(t,e,0,n,1),N=await b.call("COLLECTION_THREADS_LIST",S),{totalCount:_}=Dt(N),A=et(u.threads.get(),t,e,n);return _===void 0?!1:Mt(A,_)},S=>{m(N=>N.identity!==o?N:{...N,isProbing:!1,serverHasMore:S})}));const v=async function(){if(c.isFetching||c.isProbing||d)return;const N=o;m(_=>_.identity===N?{..._,isFetching:!0}:_);try{const _=et(f,t,e,n),A=Tt(t,e,_,n,Qe),O=await ys(()=>b.call("COLLECTION_THREADS_LIST",A)),{items:$,hasMore:z,totalCount:R}=Dt(O),U=new Set(f.map(Ar)),E=kr($,U,t,e,n),B=_;u.mergeThreads($),m(M=>{if(M.identity!==N)return M;let G;return R!==void 0?G=Mt(B+E,R):G=$.length===0||E===0?!1:z,wr(N,G),{...M,isFetching:!1,serverHasMore:G}})}catch(_){const A=_,O=A instanceof Error?A.message:String(A);se.error(`Could not load more tasks: ${O}`),m($=>$.identity===N?{...$,isFetching:!1}:$)}},y=c.isFetching||c.isProbing,w=!d&&!y&&Nr(h,c.serverHasMore);let k;return r[2]!==y||r[3]!==v||r[4]!==w||r[5]!==c.isProbing||r[6]!==c.serverHasMore?(k={hasMore:w,isFetching:y,isProbing:c.isProbing,serverHasMore:c.serverHasMore,loadMore:v},r[2]=y,r[3]=v,r[4]=w,r[5]=c.isProbing,r[6]=c.serverHasMore,r[7]=k):k=r[7],k}function Ar(t){return t.id}function $r(t){const e=C.c(18),{status:n,threads:l,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a}=t,{isFetching:d,isProbing:c,loadMore:m,hasMore:u,serverHasMore:f}=Ir("status",n,a),[x,p]=D.useState(!1);!x&&l.length===0&&f===!0&&!d&&!c&&(p(!0),queueMicrotask(()=>{m()}));let h;if(e[0]!==r||e[1]!==a||e[2]!==o||e[3]!==i||e[4]!==l){let j;e[6]!==r||e[7]!==a||e[8]!==o||e[9]!==i?(j=v=>s.jsx(os,{task:v,isActive:r===v.id,onClick:()=>i(v),onArchive:v.created_by===a.currentUserId?()=>o(v):void 0,showAutomationBadge:!!v.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},v.id),e[6]=r,e[7]=a,e[8]=o,e[9]=i,e[10]=j):j=e[10],h=l.map(j),e[0]=r,e[1]=a,e[2]=o,e[3]=i,e[4]=l,e[5]=h}else h=e[5];let g;e[11]!==u||e[12]!==d||e[13]!==m?(g=(u||d)&&s.jsx(js,{onClick:()=>{m()},isFetching:d,indented:!0}),e[11]=u,e[12]=d,e[13]=m,e[14]=g):g=e[14];let b;return e[15]!==h||e[16]!==g?(b=s.jsxs(s.Fragment,{children:[h,g]}),e[15]=h,e[16]=g,e[17]=b):b=e[17],b}function zr(t){const e=C.c(35),{status:n,threads:l,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a}=t,d=ll[n],c=d.icon,[m,u]=gr(`status-${n}`,!1);let f;e[0]!==m||e[1]!==u?(f=function(){u(!m)},e[0]=m,e[1]=u,e[2]=f):f=e[2];const x=f;let p;e[3]!==x?(p=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),x())},e[3]=x,e[4]=p):p=e[4];let h;e[5]!==c||e[6]!==d.iconClassName?(h=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(c,{size:12,className:d.iconClassName})}),e[5]=c,e[6]=d.iconClassName,e[7]=h):h=e[7];let g;e[8]!==m?(g=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:m?s.jsx(bt,{size:14}):s.jsx(ns,{size:14})}),e[8]=m,e[9]=g):g=e[9];let b;e[10]!==h||e[11]!==g?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[h,g]}),e[10]=h,e[11]=g,e[12]=b):b=e[12];let j;e[13]!==d.label?(j=s.jsx("span",{className:"flex-1 truncate",children:d.label}),e[13]=d.label,e[14]=j):j=e[14];let v;e[15]!==l.length?(v=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:l.length})}),e[15]=l.length,e[16]=v):v=e[16];let y;e[17]!==m||e[18]!==x||e[19]!==p||e[20]!==b||e[21]!==j||e[22]!==v?(y=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":m,onClick:x,onKeyDown:p,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md 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:[b,j,v]}),e[17]=m,e[18]=x,e[19]=p,e[20]=b,e[21]=j,e[22]=v,e[23]=y):y=e[23];let w;e[24]!==r||e[25]!==m||e[26]!==a||e[27]!==o||e[28]!==i||e[29]!==n||e[30]!==l?(w=m&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx($r,{status:n,threads:l,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a})}),e[24]=r,e[25]=m,e[26]=a,e[27]=o,e[28]=i,e[29]=n,e[30]=l,e[31]=w):w=e[31];let k;return e[32]!==y||e[33]!==w?(k=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[y,w]}),e[32]=y,e[33]=w,e[34]=k):k=e[34],k}function Pt(t){const e=C.c(34),{threads:n,groupBy:l,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a,hasMore:d,isFetchingMore:c,onLoadMore:m,filtersActive:u}=t;if(n.length===0&&!d&&!c){let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Xe,{className:"size-6 opacity-60"}),e[0]=h):h=e[0];const g=u?"No threads match your filters":"No threads yet";let b;return e[1]!==g?(b=s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[h,s.jsx("p",{className:"text-sm",children:g})]}),e[1]=g,e[2]=b):b=e[2],b}if(l==="status"){let h;if(e[3]!==r||e[4]!==a||e[5]!==o||e[6]!==i||e[7]!==n){let b;e[9]!==r||e[10]!==a||e[11]!==o||e[12]!==i?(b=j=>s.jsx(zr,{status:j.status,threads:j.threads,activeTaskId:r,onSelectTask:i,onArchiveTask:o,filters:a},j.status),e[9]=r,e[10]=a,e[11]=o,e[12]=i,e[13]=b):b=e[13],h=Ul(n).map(b),e[3]=r,e[4]=a,e[5]=o,e[6]=i,e[7]=n,e[8]=h}else h=e[8];let g;return e[14]!==h?(g=s.jsx(s.Fragment,{children:h}),e[14]=h,e[15]=g):g=e[15],g}let f;if(e[16]!==r||e[17]!==a||e[18]!==o||e[19]!==i||e[20]!==n){let h;e[22]!==r||e[23]!==a||e[24]!==o||e[25]!==i?(h=g=>s.jsx(os,{task:g,isActive:r===g.id,onClick:()=>i(g),onArchive:g.created_by===a.currentUserId?()=>o(g):void 0,showAutomationBadge:!!g.trigger_id,showAgentIcon:!0},g.id),e[22]=r,e[23]=a,e[24]=o,e[25]=i,e[26]=h):h=e[26],f=n.map(h),e[16]=r,e[17]=a,e[18]=o,e[19]=i,e[20]=n,e[21]=f}else f=e[21];let x;e[27]!==d||e[28]!==c||e[29]!==m?(x=(d||c)&&s.jsx(js,{onClick:m,isFetching:c}),e[27]=d,e[28]=c,e[29]=m,e[30]=x):x=e[30];let p;return e[31]!==f||e[32]!==x?(p=s.jsxs(s.Fragment,{children:[f,x]}),e[31]=f,e[32]=x,e[33]=p):p=e[33],p}function Et(t){const e=C.c(17),{label:n,onClick:l,active:r,children:i}=t,[o,a]=D.useState(!1);let d,c,m,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>a(!0),c=()=>a(!1),m=()=>a(!0),u=()=>a(!1),e[0]=d,e[1]=c,e[2]=m,e[3]=u):(d=e[0],c=e[1],m=e[2],u=e[3]);const f=r&&"bg-sidebar-accent text-foreground";let x;e[4]!==f?(x=F(f),e[4]=f,e[5]=x):x=e[5];let p;e[6]!==i||e[7]!==n||e[8]!==l||e[9]!==x?(p=s.jsx(he,{asChild:!0,children:s.jsx(ae,{"aria-label":n,onClick:l,onPointerEnter:d,onPointerLeave:c,onFocus:m,onBlur:u,className:x,children:i})}),e[6]=i,e[7]=n,e[8]=l,e[9]=x,e[10]=p):p=e[10];let h;e[11]!==n?(h=s.jsx(xe,{side:"bottom",children:n}),e[11]=n,e[12]=h):h=e[12];let g;return e[13]!==o||e[14]!==p||e[15]!==h?(g=s.jsxs(pe,{open:o,children:[p,h]}),e[13]=o,e[14]=p,e[15]=h,e[16]=g):g=e[16],g}function tt(t){const e=C.c(13),{label:n,value:l,onChange:r,options:i}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let a;e[2]!==r?(a=u=>u&&r(u),e[2]=r,e[3]=a):a=e[3];let d;e[4]!==i?(d=i.map(Tr),e[4]=i,e[5]=d):d=e[5];let c;e[6]!==a||e[7]!==d||e[8]!==l?(c=s.jsx(Un,{type:"single",size:"sm",value:l,onValueChange:a,className:"gap-0.5 rounded-lg border border-border bg-muted/50 p-0.5",children:d}),e[6]=a,e[7]=d,e[8]=l,e[9]=c):c=e[9];let m;return e[10]!==o||e[11]!==c?(m=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,c]}),e[10]=o,e[11]=c,e[12]=m):m=e[12],m}function Tr(t){return s.jsxs(Hn,{value:t.value,className:"h-6 gap-1.5 rounded-md 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 Ns({onNavigate:t}={}){const{data:e}=be.useSession(),n=e?.user?.id,{org:l}=ee(),r=Yt({connectionId:Zt,orgId:l.id,orgSlug:l.slug}),i=Ge(l.id).id,o=ht(),{threads:a,hasMore:d,isFetchingMore:c,fetchNextPage:m}=gt(),u=a.filter(I=>!I.hidden),{hide:f}=ls(),x=ne(),{setTaskId:p,createNewTask:h}=pt(),g=ct({strict:!1}),b=Ke({strict:!1}),j=g.taskId??null,v=b.virtualmcpid??a.find(I=>I.id===j)?.virtual_mcp_id??null,y=()=>{t?.()},w=[...u].sort((I,L)=>(L.updated_at??"").localeCompare(I.updated_at??"")),[k,S]=D.useState("all"),[N,_]=D.useState("flat"),[A,O]=We("sidebar-threads-scope-all",!1),[$,z]=D.useState(!1),[R,U]=D.useState(!1),E={type:k,member:"mine",currentUserId:n??null},B=I=>n?I.filter(L=>L.created_by===n):[],M=I=>k==="automation"?I.filter(L=>!!L.trigger_id):k==="manual"?I.filter(L=>!L.trigger_id):I,G=B(w),X=M(G),Q=M(w),te=A?Q:X,T=I=>{if(n&&I.created_by&&I.created_by!==n)return;const L=I.id===j;if(f(I.id),!L)return;const V=G.find(H=>H.id!==I.id&&H.virtual_mcp_id===I.virtual_mcp_id);y(),V?p(V.id,V.virtual_mcp_id):x({to:"/$org",params:{org:l.slug}})},P=I=>{y(),p(I.id,I.virtual_mcp_id)},Y=async I=>{try{const L=await r.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:I,limit:1,offset:0}});return((L.structuredContent??L).items?.length??0)===0}catch{return!1}},q=async()=>{const I=v??i;ue("sidebar_new_thread_clicked",{virtual_mcp_id:I});const L=G.find(V=>V.virtual_mcp_id===I&&V.title==="New chat");if(L&&await Y(L.id)){y(),p(L.id,I);return}y(),h(I)},{state:le,isMobile:W,toggleSidebar:re}=ve();if(le==="collapsed"&&!W){const I=Ge(l.id),L=new Map((o??[]).map(H=>[H.id,H])),V=H=>(H?L.get(H):void 0)??(H===i?I:void 0);return s.jsxs(fe,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[s.jsx(K,{children:s.jsx(J,{"aria-label":"Toggle sidebar",tooltip:"Toggle sidebar",onClick:re,children:s.jsx(qt,{size:16})})}),s.jsx(K,{children:s.jsx(J,{tooltip:"New thread",onClick:()=>{q()},children:s.jsx(_t,{size:16})})}),te.map(H=>{const de=V(H.virtual_mcp_id);return s.jsx(K,{children:s.jsx(J,{tooltip:H.title||"New chat",isActive:H.id===j,onClick:()=>P(H),children:s.jsx(Te,{icon:de?.icon??null,name:de?.title??"Agent",size:"2xs"})})},H.id)})]})}const ce=N!=="flat"||k!=="all"||A===!0,ge=s.jsxs(De,{children:[s.jsxs(pe,{children:[s.jsx(he,{asChild:!0,children:s.jsx(je,{asChild:!0,children:s.jsxs(ae,{"aria-label":"Filter threads",active:ce,children:[s.jsx(Bn,{size:16}),ce&&s.jsx("span",{className:"absolute right-1 top-1 size-1.5 rounded-full bg-primary ring-2 ring-sidebar"})]})})}),s.jsx(xe,{side:"bottom",children:"Filter threads"})]}),s.jsxs(Pe,{align:"start",className:"w-64 flex flex-col gap-3 p-3",children:[s.jsx(tt,{label:"View",value:N,onChange:I=>{ue("tasks_panel_group_by_changed",{to_value:I}),_(I)},options:[{value:"flat",label:"List",icon:s.jsx(xn,{size:13})},{value:"status",label:"Status",icon:s.jsx(pn,{size:13})}]}),s.jsx(tt,{label:"Type",value:k,onChange:I=>{ue("tasks_panel_filter_changed",{to_value:I}),S(I)},options:[{value:"all",label:"All"},{value:"manual",label:"Chats"},{value:"automation",label:"Auto"}]}),s.jsx(tt,{label:"Scope",value:A?"team":"mine",onChange:I=>O(I==="team"),options:[{value:"mine",label:"Mine"},{value:"team",label:"Team"}]})]})]}),ye=I=>s.jsx(nt,{delayDuration:300,children:s.jsxs("div",{className:F("shrink-0 px-1 flex items-center justify-between",I?"h-10":"h-10 md:h-7 mb-2"),children:[s.jsxs("div",{className:"flex items-center gap-0.5",children:[!I&&s.jsx(is,{}),ge]}),s.jsxs("div",{className:"flex items-center gap-0.5",children:[s.jsx(Et,{label:"Search threads",onClick:()=>{ue("tasks_panel_search_opened"),U(!0),z(!0)},children:s.jsx(hn,{size:16})}),s.jsx(Et,{label:"New thread",onClick:()=>{q()},children:s.jsx(_t,{size:16})})]})]})});return W?s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[ye(!0),s.jsx($t,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain px-1 h-full",children:s.jsx(Pt,{threads:te,groupBy:N,activeTaskId:j,onSelectTask:P,onArchiveTask:T,filters:E,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ce})}),R&&s.jsx(zt,{open:$,onOpenChange:z})]}):s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[ye(!1),s.jsx("div",{className:"flex-1 min-h-0 flex flex-col gap-0.5 -mr-2 pr-2",children:s.jsx($t,{wrapperClassName:"flex-1 min-h-0",className:"flex flex-col gap-0.5 overflow-y-auto overscroll-contain h-full",children:s.jsx(Pt,{threads:te,groupBy:N,activeTaskId:j,onSelectTask:P,onArchiveTask:T,filters:E,hasMore:d,isFetchingMore:c,onLoadMore:()=>{m()},filtersActive:ce})})}),R&&s.jsx(zt,{open:$,onOpenChange:z})]})}const Mr=5,Or=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function _s(){const t=C.c(3),{state:e}=ve();if(e==="collapsed"){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:Mr}).map(Er)}),t[0]=r):r=t[0],r}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(oe,{className:"size-6 rounded-md"}),s.jsx(oe,{className:"size-6 rounded-md"}),s.jsx(oe,{className:"size-6 rounded-md"})]}),s.jsx(oe,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:Or.map(Dr)})]}),t[2]=l):l=t[2],l}function Dr(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(oe,{className:"size-5 rounded-full shrink-0"}),s.jsx(oe,{className:F("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(Pr)})]},e)}function Pr(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(oe,{className:"h-3 flex-1 rounded-sm"})},e)}function Er(t,e){return s.jsx(oe,{className:"size-10 rounded-lg mx-auto"},e)}function Rr(){const t=C.c(4),e=cs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ur,{}),t[0]=n):n=t[0];let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ht,{children:s.jsx(D.Suspense,{fallback:s.jsx(_s,{}),children:s.jsx(Ns,{})})}),t[1]=l):l=t[1];let r;return t[2]!==e?(r=s.jsx(es,{children:s.jsx(us,{sections:e,footer:n,additionalContent:l})}),t[2]=e,t[3]=r):r=t[3],r}function Fr(t){const e=C.c(8),{onClose:n}=t,l=cs();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(fr,{}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(_s,{}),e[1]=i):i=e[1];let o;e[2]!==n?(o=s.jsx(Ht,{children:s.jsx(D.Suspense,{fallback:i,children:s.jsx(Ns,{onNavigate:n})})}),e[2]=n,e[3]=o):o=e[3];let a;return e[4]!==n||e[5]!==l||e[6]!==o?(a=s.jsx(es,{children:s.jsx(Pl,{sections:l,onClose:n,footer:r,additionalContent:o})}),e[4]=n,e[5]=l,e[6]=o,e[7]=a):a=e[7],a}function ws(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Lr=Bs({name:Hs().min(2,"Organization name is required")});function Br(t){const e=C.c(41),{open:n,onOpenChange:l}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:Us(Lr),defaultValues:{name:""}},e[0]=r):r=e[0];const i=Gs(r);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={mutationFn:Ur,onSuccess:Hr},e[1]=o):o=e[1];const a=qs(o),d=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(ml,{children:[s.jsx(ul,{children:"Create a new organization"}),s.jsx(fl,{children:"Set up a new organization to collaborate with others."})]}),e[2]=c):c=e[2];let m;if(e[3]!==a||e[4]!==i){let S;e[6]!==a?(S=N=>a.mutateAsync(N),e[6]=a,e[7]=S):S=e[7],m=i.handleSubmit(S),e[3]=a,e[4]=i,e[5]=m}else m=e[5];let u;e[8]!==i.formState.isSubmitting?(u=S=>{const{field:N}=S;return s.jsxs(bl,{children:[s.jsx(jl,{children:"Organization Name"}),s.jsx(vl,{children:s.jsx(Nl,{...N,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(yl,{children:"The name of your company or organization"}),N.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",ws(N.value)]})]}),s.jsx(Sl,{})]})},e[8]=i.formState.isSubmitting,e[9]=u):u=e[9];let f;e[10]!==i.control||e[11]!==u?(f=s.jsx(pl,{control:i.control,name:"name",render:u}),e[10]=i.control,e[11]=u,e[12]=f):f=e[12];let x;e[13]!==d?(x=d&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:d}),e[13]=d,e[14]=x):x=e[14];let p;e[15]!==a||e[16]!==i?(p=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=p):p=e[17];let h;e[18]!==i.formState.isSubmitting||e[19]!==p?(h=s.jsx(cl,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=h):h=e[20];const g=!i.formState.isValid||i.formState.isSubmitting;let b;e[21]!==i.formState.isSubmitting?(b=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(rl,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==g||e[24]!==b?(j=s.jsx(ze,{type:"submit",variant:"default",disabled:g,children:b}),e[23]=g,e[24]=b,e[25]=j):j=e[25];let v;e[26]!==j||e[27]!==h?(v=s.jsxs(hl,{children:[h,j]}),e[26]=j,e[27]=h,e[28]=v):v=e[28];let y;e[29]!==v||e[30]!==m||e[31]!==f||e[32]!==x?(y=s.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[f,x,v]}),e[29]=v,e[30]=m,e[31]=f,e[32]=x,e[33]=y):y=e[33];let w;e[34]!==i||e[35]!==y?(w=s.jsxs(dl,{children:[c,s.jsx(gl,{...i,children:y})]}),e[34]=i,e[35]=y,e[36]=w):w=e[36];let k;return e[37]!==l||e[38]!==n||e[39]!==w?(k=s.jsx(xl,{open:n,onOpenChange:l,children:w}),e[37]=l,e[38]=n,e[39]=w,e[40]=k):k=e[40],k}function Hr(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Ur(t){const e=ws(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await be.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const l=n?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}function Gr(t){let e=0;for(let l=0;l<t.length;l++)e=t.charCodeAt(l)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function Cs(t){const e=C.c(13),{org:n,size:l}=t,r=l===void 0?"sm":l,i=r==="xs"?"size-5":"size-6",o=r==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=F(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let d;e[2]!==n.logo||e[3]!==n.name?(d=n.logo?void 0:Gr(n.name),e[2]=n.logo,e[3]=n.name,e[4]=d):d=e[4];let c;e[5]!==n.logo||e[6]!==n.name||e[7]!==o?(c=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:F("font-semibold leading-none",o),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=o,e[8]=c):c=e[8];let m;return e[9]!==a||e[10]!==d||e[11]!==c?(m=s.jsx("div",{className:a,style:d,children:c}),e[9]=a,e[10]=d,e[11]=c,e[12]=m):m=e[12],m}function qr(t){const e=C.c(24),{orgParam:n,onSelectOrg:l,onCreateOrg:r}=t,{data:i}=Ws();let o;e[0]!==n?(o=(_,A)=>_.slug===n?-1:A.slug===n?1:_.name.localeCompare(A.name),e[0]=n,e[1]=o):o=e[1];const a=[...i??[]].sort(o),[d,c]=D.useState(""),m=d.toLowerCase(),u=m?a.filter(_=>_.name.toLowerCase().includes(m)||_.slug.toLowerCase().includes(m)):a;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(as,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=f):f=e[2];let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=_=>c(_.target.value),e[3]=x):x=e[3];let p;e[4]!==d?(p=_=>_.key==="Escape"&&d&&c(""),e[4]=d,e[5]=p):p=e[5];let h;e[6]!==d||e[7]!==p?(h=s.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:d,onChange:x,onKeyDown:p,placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[6]=d,e[7]=p,e[8]=h):h=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx($e,{size:16}),e[9]=g):g=e[9];let b;e[10]!==r?(b=s.jsx("button",{type:"button",onClick:r,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:g}),e[10]=r,e[11]=b):b=e[11];let j;e[12]!==h||e[13]!==b?(j=s.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[f,h,b]}),e[12]=h,e[13]=b,e[14]=j):j=e[14];const v="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",y=u.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:d?`No organizations match "${d}"`:"No organizations available"});let w;e[15]!==l||e[16]!==n?(w=_=>s.jsxs("button",{type:"button",onClick:()=>l(_.slug),className:F("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",_.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(Cs,{org:_,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:_.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:_.slug})]}),_.slug===n&&s.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},_.id),e[15]=l,e[16]=n,e[17]=w):w=e[17];const k=u.map(w);let S;e[18]!==y||e[19]!==k?(S=s.jsxs("div",{className:v,children:[y,k]}),e[18]=y,e[19]=k,e[20]=S):S=e[20];let N;return e[21]!==S||e[22]!==j?(N=s.jsxs(s.Fragment,{children:[j,S]}),e[21]=S,e[22]=j,e[23]=N):N=e[23],N}function Wr(t){const e=C.c(22),{trigger:n,orgParam:l,align:r,side:i}=t,o=r===void 0?"start":r,a=i===void 0?"bottom":i,d=ne(),[c,m]=D.useState(!1),[u,f]=D.useState(!1);let x;e[0]!==n?(x=s.jsx(je,{asChild:!0,children:n}),e[0]=n,e[1]=x):x=e[1];const p=String(c);let h;e[2]!==d?(h=k=>{m(!1),d({to:"/$org",params:{org:k}})},e[2]=d,e[3]=h):h=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{m(!1),f(!0)},e[4]=g):g=e[4];let b;e[5]!==l||e[6]!==p||e[7]!==h?(b=s.jsx(qr,{orgParam:l,onSelectOrg:h,onCreateOrg:g},p),e[5]=l,e[6]=p,e[7]=h,e[8]=b):b=e[8];let j;e[9]!==o||e[10]!==a||e[11]!==b?(j=s.jsx(Pe,{side:a,align:o,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:Vr,onCloseAutoFocus:Kr,children:b}),e[9]=o,e[10]=a,e[11]=b,e[12]=j):j=e[12];let v;e[13]!==c||e[14]!==x||e[15]!==j?(v=s.jsxs(De,{open:c,onOpenChange:m,children:[x,j]}),e[13]=c,e[14]=x,e[15]=j,e[16]=v):v=e[16];let y;e[17]!==u?(y=s.jsx(Br,{open:u,onOpenChange:f}),e[17]=u,e[18]=y):y=e[18];let w;return e[19]!==y||e[20]!==v?(w=s.jsxs(s.Fragment,{children:[v,y]}),e[19]=y,e[20]=v,e[21]=w):w=e[21],w}function Kr(t){return t.preventDefault()}function Vr(t){t.preventDefault(),t.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function Xr(t){const e=C.c(21),{value:n,onChange:l,placeholder:r,onKeyDown:i,className:o,isSearching:a,disabled:d}=t,c=r===void 0?"Search...":r;let m;e[0]!==o?(m=F("shrink-0 w-full border-b border-border h-12",o),e[0]=o,e[1]=m):m=e[1];const u=d?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==u?(f=F("flex items-center gap-2.5 h-12 px-4",u),e[2]=u,e[3]=f):f=e[3];let x;e[4]!==a?(x=a?s.jsx(Bt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(as,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=x):x=e[5];let p;e[6]!==l?(p=j=>l(j.target.value),e[6]=l,e[7]=p):p=e[7];let h;e[8]!==d||e[9]!==i||e[10]!==c||e[11]!==p||e[12]!==n?(h=s.jsx("input",{type:"text",value:n,onChange:p,onKeyDown:i,placeholder:c,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=i,e[10]=c,e[11]=p,e[12]=n,e[13]=h):h=e[13];let g;e[14]!==f||e[15]!==x||e[16]!==h?(g=s.jsxs("label",{className:f,children:[x,h]}),e[14]=f,e[15]=x,e[16]=h,e[17]=g):g=e[17];let b;return e[18]!==m||e[19]!==g?(b=s.jsx("div",{className:m,children:g}),e[18]=m,e[19]=g,e[20]=b):b=e[20],b}const Qr="Select an existing agent";function Yr(t){const e=C.c(5),{children:n}=t;let l;e[0]!==n?(l=s.jsx(he,{asChild:!0,children:n}),e[0]=n,e[1]=l):l=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(xe,{side:"right",sideOffset:8,children:Qr}),e[2]=r):r=e[2];let i;return e[3]!==l?(i=s.jsxs(pe,{defaultOpen:!0,delayDuration:0,children:[l,r]}),e[3]=l,e[4]=i):i=e[4],i}function Jr(t){const e=ne(),{create:n}=ls(),{locator:l}=ee(),r=ct({strict:!1}),i=Ke({strict:!1});return async o=>{const a=crypto.randomUUID(),d=o===i.virtualmcpid?Ln(t,l,r.taskId??""):null;try{await n({id:a,virtual_mcp_id:o,...d?{branch:d}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:o}})}}function Rt(t){const e=C.c(20),{agent:n,selected:l,onClick:r}=t,i=l?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let o;e[0]!==i?(o=F("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",i),e[0]=i,e[1]=o):o=e[1];let a;e[2]!==n.icon||e[3]!==n.title?(a=s.jsx(Te,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[2]=n.icon,e[3]=n.title,e[4]=a):a=e[4];let d;e[5]!==n.title?(d=s.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[5]=n.title,e[6]=d):d=e[6];let c;e[7]!==n.description?(c=n.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[7]=n.description,e[8]=c):c=e[8];let m;e[9]!==d||e[10]!==c?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,c]}),e[9]=d,e[10]=c,e[11]=m):m=e[11];let u;e[12]!==l?(u=l&&s.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=l,e[13]=u):u=e[13];let f;return e[14]!==r||e[15]!==o||e[16]!==a||e[17]!==m||e[18]!==u?(f=s.jsxs("button",{type:"button",onClick:r,className:o,children:[a,m,u]}),e[14]=r,e[15]=o,e[16]=a,e[17]=m,e[18]=u,e[19]=f):f=e[19],f}function Zr(t){const e=C.c(23),{onClose:n,onSelectAgent:l,selectedAgentId:r}=t,[i,o]=D.useState(""),a=ht(),d=a??[],{org:c}=ee(),{data:m}=be.useSession(),u=m?.user?.id??"anon",f=Cn(a),x=kn(),p=Jr(c.slug),h=zn(a),g=i.toLowerCase(),b=d.filter(ei).filter(M=>!h.has(M.id)).filter(M=>!i||M.title.toLowerCase().includes(g)),j=Ge(c.id),v=!i||j.title.toLowerCase().includes(g);let y;e[0]!==n||e[1]!==l?(y=()=>{l?.(null),n(),o("")},e[0]=n,e[1]=l,e[2]=y):y=e[2];const w=y,k=M=>{if(l){l(M.id),n(),o("");return}In({orgId:c.id,userId:u},M.id,f),x(),n(),o(""),p(M.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let N;e[3]!==i?(N=s.jsx(Xr,{value:i,onChange:o,placeholder:"Search agents..."}),e[3]=i,e[4]=N):N=e[4];const _="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-1",A=l&&v&&j&&s.jsx(Rt,{agent:j,selected:!r||r===j.id,onClick:w}),O=b.map(M=>s.jsx(Rt,{agent:M,selected:l?r===M.id:void 0,onClick:()=>k(M)},M.id));let $;e[5]!==i||e[6]!==b.length?($=b.length===0&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:i?"No agents found":"No agents yet"}),e[5]=i,e[6]=b.length,e[7]=$):$=e[7];let z;e[8]!==A||e[9]!==O||e[10]!==$?(z=s.jsxs("div",{className:_,children:[A,O,$]}),e[8]=A,e[9]=O,e[10]=$,e[11]=z):z=e[11];let R;e[12]!==c.slug?(R={org:c.slug},e[12]=c.slug,e[13]=R):R=e[13];let U;e[14]!==n?(U=()=>n(),e[14]=n,e[15]=U):U=e[15];let E;e[16]!==U||e[17]!==R?(E=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Ut,{to:"/$org/settings/agents",params:R,onClick:U,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[16]=U,e[17]=R,e[18]=E):E=e[18];let B;return e[19]!==E||e[20]!==N||e[21]!==z?(B=s.jsxs("div",{className:S,children:[N,z,E]}),e[19]=E,e[20]=N,e[21]=z,e[22]=B):B=e[22],B}function ei(t){return!Jt(t.id)}function ti(t){const e=C.c(23);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:l,trigger:r,onSelectAgent:i,selectedAgentId:o,side:a,align:d}=n,c=l===void 0?!1:l,m=a===void 0?"right":a,u=d===void 0?"start":d,[f,x]=D.useState(!1),p=ft(),{setOpenMobile:h}=ve(),g=wn(),b=g?"border border-border":void 0;let j;e[2]!==g?(j=_=>g?s.jsx(Yr,{children:_}):_,e[2]=g,e[3]=j):j=e[3];const v=j;let y;e[4]!==p||e[5]!==h?(y=()=>{x(!1),p&&h(!1)},e[4]=p,e[5]=h,e[6]=y):y=e[6];const w=y;let k;e[7]!==w||e[8]!==i||e[9]!==f||e[10]!==o?(k=f&&s.jsx(D.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(oe,{className:"h-4 w-24"})}),children:s.jsx(Zr,{onClose:w,onSelectAgent:i,selectedAgentId:o})}),e[7]=w,e[8]=i,e[9]=f,e[10]=o,e[11]=k):k=e[11];const S=k;let N;return e[12]!==u||e[13]!==c||e[14]!==b||e[15]!==g||e[16]!==p||e[17]!==f||e[18]!==S||e[19]!==m||e[20]!==r||e[21]!==v?(N=s.jsx(s.Fragment,{children:p?s.jsxs(s.Fragment,{children:[r?s.jsx("button",{type:"button",onClick:()=>x(!0),className:"contents",children:r}):c?v(s.jsx(ae,{"aria-label":"Browse agents",className:F(b),onClick:()=>{ue("agent_browser_opened",{surface:"mobile_drawer"}),x(!0)},children:s.jsx($e,{className:"size-4"})})):s.jsx(K,{children:v(s.jsxs(J,{tooltip:g?void 0:"Browse agents",className:F(b),onClick:()=>{ue("agent_browser_opened",{surface:"mobile_drawer"}),x(!0)},children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(Wt,{open:f,onOpenChange:x,direction:"bottom",children:s.jsxs(Kt,{className:"max-h-[85dvh] p-0",children:[s.jsx(Vt,{className:"sr-only",children:"Browse agents"}),S]})})]}):s.jsxs(De,{open:f,onOpenChange:_=>{_&&!f&&ue("agent_browser_opened",{surface:"desktop_popover"}),x(_)},children:[r?s.jsx(je,{asChild:!0,children:r}):c?v(s.jsx(je,{asChild:!0,children:s.jsx(ae,{"aria-label":"Browse agents",className:F(b),children:s.jsx($e,{className:"size-4"})})})):s.jsx(K,{children:v(s.jsx(je,{asChild:!0,children:s.jsxs(J,{tooltip:g?void 0:"Browse agents",className:F(b),children:[s.jsx($e,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Pe,{className:"w-[380px] p-0 overflow-hidden",side:m,align:u,children:S})]})}),e[12]=u,e[13]=c,e[14]=b,e[15]=g,e[16]=p,e[17]=f,e[18]=S,e[19]=m,e[20]=r,e[21]=v,e[22]=N):N=e[22],N}const ks="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md px-1.5 py-1 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function si(t){const e=C.c(19),{agentId:n,onOpenHome:l,onPick:r}=t,i=xt(n),o=i?.title??"Decopilot",a=`Open ${o} home`,d=i?.icon??null;let c;e[0]!==d||e[1]!==o?(c=s.jsx(Te,{icon:d,name:o,size:"2xs"}),e[0]=d,e[1]=o,e[2]=c):c=e[2];let m;e[3]!==l||e[4]!==a||e[5]!==c?(m=s.jsx("button",{type:"button",onClick:l,"aria-label":a,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:c}),e[3]=l,e[4]=a,e[5]=c,e[6]=m):m=e[6];let u;e[7]!==o?(u=s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:o}),e[7]=o,e[8]=u):u=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(bt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=f):f=e[9];let x;e[10]!==u?(x=s.jsxs("button",{type:"button",className:ks,children:[u,f]}),e[10]=u,e[11]=x):x=e[11];let p;e[12]!==n||e[13]!==r||e[14]!==x?(p=s.jsx(ti,{side:"bottom",align:"start",selectedAgentId:n,onSelectAgent:r,trigger:x}),e[12]=n,e[13]=r,e[14]=x,e[15]=p):p=e[15];let h;return e[16]!==m||e[17]!==p?(h=s.jsxs("div",{className:"flex items-center gap-0.5",children:[m,p]}),e[16]=m,e[17]=p,e[18]=h):h=e[18],h}function Ft(){const t=C.c(33),{org:e}=ee(),{state:n}=ve(),l=n==="collapsed",r=ne();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[0]=i):i=t[0];const o=ct(i);let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[1]=a):a=t[1];const d=Ke(a),{threads:c}=gt(),{setTaskId:m,createNewTask:u}=pt();let f;t[2]!==e.id?(f=Ge(e.id),t[2]=e.id,t[3]=f):f=t[3];const x=f.id,p=o.taskId?d.virtualmcpid??x:x;let h;t[4]!==u||t[5]!==x||t[6]!==r||t[7]!==e.slug||t[8]!==m||t[9]!==c?(h=A=>{if(!A||A===x){r({to:"/$org",params:{org:e.slug}});return}const O=c.find($=>!$.hidden&&$.virtual_mcp_id===A&&$.title==="New chat"&&(!$.status||$.status==="in_progress"));O?m(O.id,A):u(A)},t[4]=u,t[5]=x,t[6]=r,t[7]=e.slug,t[8]=m,t[9]=c,t[10]=h):h=t[10];const g=h;let b;t[11]!==e.slug?(b={org:e.slug},t[11]=e.slug,t[12]=b):b=t[12];let j;t[13]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Z.Logo,{}),t[13]=j):j=t[13];let v;t[14]!==b?(v=s.jsx(Ut,{to:"/$org",params:b,"aria-label":"Organization home",title:"Home",className:"wco-no-drag flex items-center shrink-0 cursor-pointer rounded-md px-1 hover:bg-accent/60 transition-colors",children:j}),t[14]=b,t[15]=v):v=t[15];let y;t[16]!==e||t[17]!==l?(y=!l&&s.jsx(Wr,{orgParam:e.slug,trigger:s.jsxs("button",{type:"button",className:ks,children:[s.jsx(Cs,{org:e,size:"xs"}),s.jsx("span",{className:"truncate font-medium max-w-[10rem]",children:e.name}),s.jsx(bt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"})]})}),t[16]=e,t[17]=l,t[18]=y):y=t[18];let w;t[19]!==v||t[20]!==y?(w=s.jsxs(Ct,{className:"gap-0.5",children:[v,y]}),t[19]=v,t[20]=y,t[21]=w):w=t[21];let k;t[22]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("span",{className:"h-4 w-24 rounded bg-muted animate-pulse"}),t[22]=k):k=t[22];let S;t[23]!==p||t[24]!==g?(S=()=>g(p),t[23]=p,t[24]=g,t[25]=S):S=t[25];let N;t[26]!==p||t[27]!==g||t[28]!==S?(N=s.jsx(Ct,{children:s.jsx(D.Suspense,{fallback:k,children:s.jsx(si,{agentId:p,onOpenHome:S,onPick:g})})}),t[26]=p,t[27]=g,t[28]=S,t[29]=N):N=t[29];let _;return t[30]!==N||t[31]!==w?(_=s.jsx(ol,{className:"wco-no-drag",children:s.jsxs(al,{className:"flex-nowrap",children:[w,N]})}),t[30]=N,t[31]=w,t[32]=_):_=t[32],_}const ni="sidebar.open";function li(){const t=C.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Vs,{}),t[0]=e):e=t[0],e}function Sa(){const t=C.c(24),e=ft(),[n,l]=We(ni,!1),{width:r,wrapperRef:i,onStartResize:o,resetWidth:a}=kl();let d;t[0]!==e?(d=e?s.jsxs(Z.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto] items-center gap-2",children:[s.jsx(is,{}),s.jsx(Ft,{}),s.jsx(ot,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(Z.TogglesSlot,{}),s.jsx(Z.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(Z.CenterSlot,{}),s.jsx(Z.RightSlot,{})]}):s.jsxs(Z.Header,{children:[s.jsx(Z.LeftColumn,{children:s.jsx(Ft,{})}),s.jsx(Z.CenterSlot,{}),s.jsxs(Z.RightColumn,{children:[s.jsxs("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end items-center gap-0.5",children:[s.jsx(Z.TogglesSlot,{}),s.jsx(Z.TabsSlot,{})]}),s.jsx(Z.RightSlot,{})]})]}),t[0]=e,t[1]=d):d=t[1];const c=`${r}px`;let m;t[2]!==c?(m={"--sidebar-width":c,"--sidebar-width-icon":"3.5rem"},t[2]=c,t[3]=m):m=t[3];const u=m;let f;t[4]!==e||t[5]!==o||t[6]!==a?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(Rr,{}),s.jsx(_l,{onPointerDown:o,onDoubleClick:a})]}),t[4]=e,t[5]=o,t[6]=a,t[7]=f):f=t[7];let x;t[8]===Symbol.for("react.memo_cache_sentinel")?(x={background:"transparent",containerType:"inline-size"},t[8]=x):x=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ys,{className:"flex flex-col",style:x,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(D.Suspense,{fallback:s.jsx(li,{}),children:s.jsx(Ks,{})})})})}),t[9]=p):p=t[9];let h;t[10]!==u||t[11]!==f||t[12]!==i?(h=s.jsxs(Js,{ref:i,className:"flex-1 bg-sidebar relative min-h-0",style:u,children:[f,p]}),t[10]=u,t[11]=f,t[12]=i,t[13]=h):h=t[13];let g;t[14]!==e?(g=e&&s.jsx(nl,{renderSidebar:ri}),t[14]=e,t[15]=g):g=t[15];let b;t[16]!==d||t[17]!==h||t[18]!==g?(b=s.jsx(il,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[d,h,g]})}),t[16]=d,t[17]=h,t[18]=g,t[19]=b):b=t[19];let j;return t[20]!==l||t[21]!==n||t[22]!==b?(j=s.jsx(qn,{children:s.jsx(Z.Provider,{children:s.jsx(Zs,{open:n,onOpenChange:l,children:b})})}),t[20]=l,t[21]=n,t[22]=b,t[23]=j):j=t[23],j}function ri(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(Fr,{onClose:e})})})}export{Sa as default};
@@ -1 +1 @@
1
- import{c as g,e as p,j as s,i as u,N as a}from"./index-5AaNNafz.js";import{a as x}from"./use-capability-BJgOQ1dM.js";import{C as j}from"./capability-load-error-CEmXpgFG.js";function v(){const t=g.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:c,error:f}=x();if(c){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(f){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};
1
+ import{c as g,e as p,j as s,i as u,N as a}from"./index-BUtSNxMV.js";import{a as x}from"./use-capability-BrY7n9pF.js";import{C as j}from"./capability-load-error-DIVlJMVm.js";function v(){const t=g.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:c,error:f}=x();if(c){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(f){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};