decocms 3.34.3 → 3.35.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 (268) hide show
  1. package/dist/client/assets/{AlertCircle-B5QG7wg7.js → AlertCircle-DfCrgvbm.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-Ce95HJs8.js → ArrowUpRight-BZPL9Pks.js} +1 -1
  3. package/dist/client/assets/{Check-CV74Rqqs.js → Check-CQSOJf1l.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-BiLWpS6e.js → CheckCircle-oP-mqP5v.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-XKMoQgX6.js → ChevronDown-DaBswAjS.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-rORK5a-Y.js → ChevronLeft-BGAK4Zdv.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-Betyx6_9.js → ChevronRight-Bwn2E0SF.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-CGfhqWp1.js → ChevronUp-BiGhh8Mf.js} +1 -1
  9. package/dist/client/assets/{Container-Byi81M5N.js → Container-C7dE1uq6.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-CuchmOf0.js → DotsVertical-Ddm9sNM7.js} +1 -1
  11. package/dist/client/assets/{Eye-RSaOlPZv.js → Eye-CJqEY9Bp.js} +1 -1
  12. package/dist/client/assets/{FilterLines-DuHSJmFt.js → FilterLines-B_l1Wkux.js} +1 -1
  13. package/dist/client/assets/{Globe01-Ds0ZgQYM.js → Globe01-CZ8FVUUU.js} +1 -1
  14. package/dist/client/assets/{HardDrive-C0JdZ_DO.js → HardDrive-CsWNNss4.js} +1 -1
  15. package/dist/client/assets/{Key01-CStdo5WX.js → Key01-CuoD3w0e.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-BdQI12mG.js → LayoutLeft-DkBHny3R.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-D7swM7zC.js → LinkExternal01-j7-s92dF.js} +1 -1
  18. package/dist/client/assets/{Monitor01-CaSeRueL.js → Monitor01-BKcboobL.js} +1 -1
  19. package/dist/client/assets/{Palette-gIYgJ3Wn.js → Palette-DX6Dwn47.js} +1 -1
  20. package/dist/client/assets/{Play-1bLCgUWF.js → Play-DF7j7sPZ.js} +1 -1
  21. package/dist/client/assets/{Plus-wat9tYeJ.js → Plus-DW0XqVol.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-D-1V89vv.js → RefreshCcw01-Csm4yVOO.js} +1 -1
  23. package/dist/client/assets/{SearchMd-BoptgjAM.js → SearchMd-DZ6aIwIg.js} +1 -1
  24. package/dist/client/assets/{Settings02-8XjUg3gM.js → Settings02-D5me1w67.js} +1 -1
  25. package/dist/client/assets/{Shield01-CjOnx-7R.js → Shield01-kWYSVjnp.js} +1 -1
  26. package/dist/client/assets/{Star01-Dsaeuwpa.js → Star01-Co_EFaK6.js} +1 -1
  27. package/dist/client/assets/{Stars01-DDkk5qux.js → Stars01-M9lSQCUv.js} +1 -1
  28. package/dist/client/assets/{Stars02-ChPYLNIJ.js → Stars02-C-4orbjJ.js} +1 -1
  29. package/dist/client/assets/{Sun-BUoG5bs4.js → Sun-D3s8g6wD.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-CkdIfbJ1.js → SwitchHorizontal01-CRsSfTt7.js} +1 -1
  31. package/dist/client/assets/{Tool01-Be5AVc1v.js → Tool01-CmnBi-ns.js} +1 -1
  32. package/dist/client/assets/{Trash01-YuwiLEVo.js → Trash01-DdLe4vdc.js} +1 -1
  33. package/dist/client/assets/{Upload01-aGUy8jUM.js → Upload01-B_SjMibr.js} +1 -1
  34. package/dist/client/assets/{User01-CUMpCZVS.js → User01-DXJ1fbKo.js} +1 -1
  35. package/dist/client/assets/{Users01-BGw9h7dE.js → Users01-j12rIRFD.js} +1 -1
  36. package/dist/client/assets/{Users03-Cf3_qQGc.js → Users03-CIMcoZEN.js} +1 -1
  37. package/dist/client/assets/{X-D1kqmcok.js → X-BNvE6MEM.js} +1 -1
  38. package/dist/client/assets/{XCircle-Ds6l9Vuw.js → XCircle-DxeB44sm.js} +1 -1
  39. package/dist/client/assets/{XClose-CwNjmDWz.js → XClose-SVLNQiVU.js} +1 -1
  40. package/dist/client/assets/{Zap-j2XVmCfk.js → Zap-Bgg4Oev9.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-DMmAEMvR.js → ZapSquare-CBHt5u2b.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-C6xbqN0H.js → ZoomOut-CiW88kaG.js} +1 -1
  43. package/dist/client/assets/{access-gate-DfmEpXgP.js → access-gate-D-y2d9t8.js} +1 -1
  44. package/dist/client/assets/{accordion-B4RSATFh.js → accordion-zpPrX7CV.js} +1 -1
  45. package/dist/client/assets/add-section-modal-DAWzDKwe.js +1 -0
  46. package/dist/client/assets/{agent-capabilities-UHQXEFqt.js → agent-capabilities-CPytCHGh.js} +2 -2
  47. package/dist/client/assets/{agent-icon-BAU0Nn5Q.js → agent-icon-CR2BOYIt.js} +1 -1
  48. package/dist/client/assets/{agent-icons-CMqOumOa.js → agent-icons-DnVG8vkz.js} +2 -2
  49. package/dist/client/assets/agents-list-DwVMk1n-.js +1 -0
  50. package/dist/client/assets/ai-providers-mE8ABjTw.js +1 -0
  51. package/dist/client/assets/{alert-CeTPCPF-.js → alert-B8OrVPLn.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-nDI1xJhR.js → alert-dialog-BN8wMw1R.js} +1 -1
  53. package/dist/client/assets/app-editor-Bbf1K7Id.js +1 -0
  54. package/dist/client/assets/{auth-catchall-BHc3WJmM.js → auth-catchall-DHwYEi7u.js} +1 -1
  55. package/dist/client/assets/auth-ottC0wHr.js +1 -0
  56. package/dist/client/assets/{auth-split-layout-By3wB5zH.js → auth-split-layout-CxpQ1x33.js} +1 -1
  57. package/dist/client/assets/{automation-list-row-C-im7Cyh.js → automation-list-row-BEJwS8Vh.js} +1 -1
  58. package/dist/client/assets/{automation-runs-BYZ99hni.js → automation-runs-DhzB2pEa.js} +1 -1
  59. package/dist/client/assets/automations-D61pNajM.js +1 -0
  60. package/dist/client/assets/{avatar-BZq-o3M_.js → avatar-CdZJe3C8.js} +1 -1
  61. package/dist/client/assets/{badge-DBQKr8ze.js → badge-C7EEpKuN.js} +1 -1
  62. package/dist/client/assets/brand-context-CNpbI5Wl.js +1 -0
  63. package/dist/client/assets/buckets-CdV7wLzR.js +1 -0
  64. package/dist/client/assets/{calendar-D0ZGZM9k.js → calendar-DFbEMX6r.js} +1 -1
  65. package/dist/client/assets/{capability-load-error-BqquNR5_.js → capability-load-error-Cl1kq3iF.js} +1 -1
  66. package/dist/client/assets/{card-_9LUJQRQ.js → card-CDrd0DTi.js} +1 -1
  67. package/dist/client/assets/{chat-context-BGBybCr0.js → chat-context-DG8MYWh9.js} +6 -6
  68. package/dist/client/assets/{checkbox-BoVEsaTu.js → checkbox-BGw-FQHn.js} +1 -1
  69. package/dist/client/assets/{cli-auth-success-BYlIpapz.js → cli-auth-success-DtIVHpOK.js} +1 -1
  70. package/dist/client/assets/collection-detail-FqeWA-st.js +1 -0
  71. package/dist/client/assets/{collection-display-button-C331HXzj.js → collection-display-button-C7zc09ko.js} +1 -1
  72. package/dist/client/assets/{collection-search-D2zd2w_6.js → collection-search-p8x92ubf.js} +1 -1
  73. package/dist/client/assets/{collection-table-wrapper-D_JocMSh.js → collection-table-wrapper-Cnh8Wpna.js} +1 -1
  74. package/dist/client/assets/{collection-tabs-Et7HpQI-.js → collection-tabs-CkYCGOii.js} +1 -1
  75. package/dist/client/assets/{collections-BEkDC2fV.js → collections-DyJP_FmO.js} +1 -1
  76. package/dist/client/assets/{command-DjRT1inC.js → command-BWTUFK3g.js} +1 -1
  77. package/dist/client/assets/{connect-desktop-dialog-C7P5AZy7.js → connect-desktop-dialog-BozHMyNF.js} +1 -1
  78. package/dist/client/assets/{connection-card-C6z8X3mv.js → connection-card-D4ICX_rU.js} +1 -1
  79. package/dist/client/assets/{connection-detail-DWcaSH3b.js → connection-detail-ucWXxoPl.js} +1 -1
  80. package/dist/client/assets/{connection-form-helpers-CJ-3PHD0.js → connection-form-helpers-8awFltv-.js} +1 -1
  81. package/dist/client/assets/{connections-plRLUbCm.js → connections-iQ8Bv6Z6.js} +1 -1
  82. package/dist/client/assets/decopilot-sse-pool-DR3EOQSz.js +1 -0
  83. package/dist/client/assets/{dialog-DilC5A4p.js → dialog-DDaCuEXe.js} +1 -1
  84. package/dist/client/assets/domain-settings-DTybx0PS.js +1 -0
  85. package/dist/client/assets/{drawer-PqoucHj8.js → drawer-iJuY2KNl.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-CCeLALQe.js → dropdown-menu-Bbmpm5z3.js} +1 -1
  87. package/dist/client/assets/dynamic-plugin-layout-fiDb4X6H.js +1 -0
  88. package/dist/client/assets/{empty-state-cuRG9xrS.js → empty-state-Cdm1CYyS.js} +1 -1
  89. package/dist/client/assets/{empty-state-C0m3QPuD.js → empty-state-D-Pxp7j0.js} +1 -1
  90. package/dist/client/assets/{extract-connection-data-zlBEIx4x.js → extract-connection-data-SrWlxhIa.js} +1 -1
  91. package/dist/client/assets/features-Cwh1Qv1Z.js +1 -0
  92. package/dist/client/assets/file-explorer--zdN4Zrz.js +2 -0
  93. package/dist/client/assets/{file-type-icon-CBlaUM9a.js → file-type-icon-B4-le7-M.js} +1 -1
  94. package/dist/client/assets/{files-De7CB1eQ.js → files-DFiPv_6i.js} +1 -1
  95. package/dist/client/assets/{form-DcfAV72q.js → form-3ozPMiDy.js} +1 -1
  96. package/dist/client/assets/general-BBvPcHvJ.js +1 -0
  97. package/dist/client/assets/generate-id-B9GOZfm-.js +1 -0
  98. package/dist/client/assets/{github-repo-picker-CIreZixy.js → github-repo-picker-CLz-6KHT.js} +2 -2
  99. package/dist/client/assets/{header-tab-button-CNFRl9p4.js → header-tab-button-KOmUg_0n.js} +3 -3
  100. package/dist/client/assets/{hover-card-Bizl54yc.js → hover-card-BdET2LVl.js} +1 -1
  101. package/dist/client/assets/{image-field-Btc7vZ_B.js → image-field-jDtV8hKH.js} +1 -1
  102. package/dist/client/assets/{index-CoxAwU4M.js → index-7nVwqMEY.js} +1 -1
  103. package/dist/client/assets/{index-CeH9NvWc.js → index-B1J4YXFH.js} +13 -13
  104. package/dist/client/assets/{index-DOV0yCSN.js → index-B8Zn3P3M.js} +1 -1
  105. package/dist/client/assets/{index-B6U1MHPz.js → index-BRNlnl29.js} +1 -1
  106. package/dist/client/assets/{index-Dr3ZvAAC.js → index-Bg-8akWr.js} +2 -2
  107. package/dist/client/assets/{index-WAvrfxHO.js → index-BnzjjyUc.js} +1 -1
  108. package/dist/client/assets/index-ByDZ7Ijt.js +1 -0
  109. package/dist/client/assets/{index-C_YL5c1Q.js → index-C6TcjGKf.js} +1 -1
  110. package/dist/client/assets/{index-KCjld4_L.js → index-CKiY6q7v.js} +3 -3
  111. package/dist/client/assets/{index-NuAPKwye.js → index-CMT1KgDi.js} +1 -1
  112. package/dist/client/assets/{index-DxLTuX83.js → index-CR2BsklH.js} +34 -34
  113. package/dist/client/assets/{index-DM719JZt.js → index-DB-iXjqO.js} +1 -1
  114. package/dist/client/assets/{index-EffHR3rD.js → index-jguHAjxa.js} +1 -1
  115. package/dist/client/assets/{index-VW961Pbw.js → index-lVjgiIsy.js} +1 -1
  116. package/dist/client/assets/{index-redirect-BoGD6xOD.js → index-redirect-0OmXb9MX.js} +1 -1
  117. package/dist/client/assets/index-sGHofokC.js +1 -0
  118. package/dist/client/assets/{input-3FcnQKag.js → input-BXKnvLhL.js} +1 -1
  119. package/dist/client/assets/{integration-icon-C2c_G7v_.js → integration-icon-Bw8f7ZPI.js} +1 -1
  120. package/dist/client/assets/{label-Cv-qQXYd.js → label-CjPScbhz.js} +1 -1
  121. package/dist/client/assets/{layout-2bgJD0NS.js → layout-Di1CCr2Q.js} +1 -1
  122. package/dist/client/assets/{login-DDLq_BK-.js → login-5GQvHYAE.js} +1 -1
  123. package/dist/client/assets/mcp-oauth-BRWfHEzR.js +1 -0
  124. package/dist/client/assets/{members-BlttLAcq.js → members-QwMU-3Ki.js} +2 -2
  125. package/dist/client/assets/{monaco-editor-BenQSBIk.js → monaco-editor-Cg1EQRnF.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-BcGGFk75.js → monitoring-stats-row-CNaJGhPf.js} +1 -1
  127. package/dist/client/assets/oauth-callback-D9zCuUON.js +1 -0
  128. package/dist/client/assets/{oauth-callback-ai-provider-BF79mlu4.js → oauth-callback-ai-provider-hDwaAL5R.js} +1 -1
  129. package/dist/client/assets/{onboarding-Dd72TDGl.js → onboarding-DlrXj6YO.js} +1 -1
  130. package/dist/client/assets/{org-install-Bv_VZKPn.js → org-install-Bu5JllIi.js} +1 -1
  131. package/dist/client/assets/{org-layout-CTAm8_WK.js → org-layout-BbJy_b93.js} +1 -1
  132. package/dist/client/assets/org-plugin-layout-B9FRU2Is.js +1 -0
  133. package/dist/client/assets/{page-seo-form-B0n1eGFy.js → page-seo-form-_9ZP3QBG.js} +1 -1
  134. package/dist/client/assets/page-seo-sheet-E9iDhskP.js +1 -0
  135. package/dist/client/assets/{pair-DU07s2Yy.js → pair-gQKhMMDb.js} +6 -6
  136. package/dist/client/assets/{plugin-empty-state-CVzEQ5Cm.js → plugin-empty-state-BZknPdIb.js} +1 -1
  137. package/dist/client/assets/{plugin-header-B7b_y-0E.js → plugin-header-DkjZWp_i.js} +1 -1
  138. package/dist/client/assets/{plugin-layout-Bwwo9Dmw.js → plugin-layout-BdqEclCD.js} +1 -1
  139. package/dist/client/assets/{popover-DpnBmU5u.js → popover-BTmtXv14.js} +1 -1
  140. package/dist/client/assets/{post-editor-DOuE35_z.js → post-editor-CH5fTOhb.js} +2 -2
  141. package/dist/client/assets/{primitives-DCRAmGAV.js → primitives-CKu1vpZw.js} +1 -1
  142. package/dist/client/assets/profile-Dko06RsO.js +1 -0
  143. package/dist/client/assets/project-app-view-Cd-36Jgd.js +1 -0
  144. package/dist/client/assets/record-editor-DT2U_m_t.js +1 -0
  145. package/dist/client/assets/{registry-layout-BMV-48W2.js → registry-layout-C-Rhe1GR.js} +4 -4
  146. package/dist/client/assets/registry-lt8SPDA4.js +2 -0
  147. package/dist/client/assets/{require-capability-BolUdzxs.js → require-capability-CvIZOTUa.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-Ce12SDHB.js → required-auth-layout-B00155Vc.js} +1 -1
  149. package/dist/client/assets/{reset-password-BUAFUG-w.js → reset-password-NK-zyZWv.js} +1 -1
  150. package/dist/client/assets/{resizable-CDtszfkc.js → resizable-DmhfTA5q.js} +1 -1
  151. package/dist/client/assets/roles-BUjXqBF2.js +1 -0
  152. package/dist/client/assets/save-referenced-block-CNwoR_kv.js +1 -0
  153. package/dist/client/assets/{save-status-CrbNr3Yt.js → save-status-DbsdUBrs.js} +1 -1
  154. package/dist/client/assets/{schema-form-DF5JNe2x.js → schema-form-DzfWzqPW.js} +1 -1
  155. package/dist/client/assets/{scroll-area-DtVZtiV9.js → scroll-area-CLZP3_5w.js} +1 -1
  156. package/dist/client/assets/{search-input-B5QgW7DO.js → search-input-MJliZ4jI.js} +1 -1
  157. package/dist/client/assets/{secrets-vyIYAehl.js → secrets-D4QL_fAR.js} +1 -1
  158. package/dist/client/assets/{sections-editor-ChsSqsQp.js → sections-editor-FDdDi8FD.js} +2 -2
  159. package/dist/client/assets/{select-C0Tyz9qJ.js → select-BFSfYXlX.js} +1 -1
  160. package/dist/client/assets/{select-model-qL2AwJh1.js → select-model-BbRpf076.js} +1 -1
  161. package/dist/client/assets/seo-editor-DwVV4QI0.js +1 -0
  162. package/dist/client/assets/settings-layout-B9A_ZqDS.js +1 -0
  163. package/dist/client/assets/{settings-section-BxOSnd7f.js → settings-section-C-Pwj2mI.js} +1 -1
  164. package/dist/client/assets/{sheet-BZaR5cN8.js → sheet-tO1j8MLX.js} +1 -1
  165. package/dist/client/assets/{shell-controls-B_EeVM1l.js → shell-controls-Bym8A09n.js} +1 -1
  166. package/dist/client/assets/{shell-layout-DSw-nDR6.js → shell-layout-CVwlRsIR.js} +1 -1
  167. package/dist/client/assets/shell-route-loading-I4t8prq1.js +1 -0
  168. package/dist/client/assets/{sidebar-DILd2AwV.js → sidebar-B1ZxuBN_.js} +1 -1
  169. package/dist/client/assets/{skeleton-Dvzf2GQP.js → skeleton-DJEW9jDp.js} +1 -1
  170. package/dist/client/assets/{sortable.esm-DhgyheK_.js → sortable.esm-LeLAN_LP.js} +2 -2
  171. package/dist/client/assets/{spinner-CIUpakvk.js → spinner-CDjEeRHa.js} +1 -1
  172. package/dist/client/assets/{sso-BYueQDf4.js → sso-DCBE9NzY.js} +1 -1
  173. package/dist/client/assets/store-BZj3mNA3.js +1 -0
  174. package/dist/client/assets/store-registry-Bh2zZ5xN.js +2 -0
  175. package/dist/client/assets/{studio-tools-qhNYzbg-.js → studio-tools-BgmLlqq0.js} +1 -1
  176. package/dist/client/assets/{switch-B2R8Oovd.js → switch-fOoBffiM.js} +1 -1
  177. package/dist/client/assets/{tab-id-BEXPtrYn.js → tab-id-DF4EtVz0.js} +1 -1
  178. package/dist/client/assets/{table-BHblf7Co.js → table-B7zPFKH4.js} +1 -1
  179. package/dist/client/assets/{tabs-BEFEoOMo.js → tabs-DwCivvg2.js} +1 -1
  180. package/dist/client/assets/{task-status-17hQtONR.js → task-status-Do0N2yEZ.js} +1 -1
  181. package/dist/client/assets/{textarea-CZOXZ6_T.js → textarea-C0PLb8A1.js} +1 -1
  182. package/dist/client/assets/{toggle-group-DzrJraBm.js → toggle-group-Bn94xmD3.js} +1 -1
  183. package/dist/client/assets/{toolbar-A-Rw_MZF.js → toolbar-D1E6jsA-.js} +1 -1
  184. package/dist/client/assets/tools-list-BXq3S6hl.js +1 -0
  185. package/dist/client/assets/{tooltip-D1D9JHhD.js → tooltip-CLG87qyy.js} +1 -1
  186. package/dist/client/assets/{types-DsYUq_UX.js → types-CBP_wAn8.js} +3 -3
  187. package/dist/client/assets/{use-ai-providers-CIvGzfXg.js → use-ai-providers-B-vDc98I.js} +1 -1
  188. package/dist/client/assets/{use-automations-CP8543px.js → use-automations-BPoyZBdX.js} +1 -1
  189. package/dist/client/assets/{use-capability-DDDjfOOE.js → use-capability-B_PDwTk3.js} +1 -1
  190. package/dist/client/assets/{use-clock-tick-DufrTL6j.js → use-clock-tick-dBvSZsql.js} +1 -1
  191. package/dist/client/assets/use-collections-C_yZKgDo.js +1 -0
  192. package/dist/client/assets/{use-connection-DIX015NP.js → use-connection-BGirJeWX.js} +1 -1
  193. package/dist/client/assets/{use-copy-B_iKACkn.js → use-copy-vy8ApQ-I.js} +1 -1
  194. package/dist/client/assets/{use-create-virtual-mcp-BiFjwqV_.js → use-create-virtual-mcp-BjqcuHoP.js} +1 -1
  195. package/dist/client/assets/{use-debounced-autosave-CsGRGmM0.js → use-debounced-autosave-D3nmvc0o.js} +1 -1
  196. package/dist/client/assets/use-delete-connection-hy9eBOJA.js +1 -0
  197. package/dist/client/assets/{use-file-configs-CzVPvQ04.js → use-file-configs-Rh_uaFMZ.js} +1 -1
  198. package/dist/client/assets/{use-infinite-scroll-BmPWzVgW.js → use-infinite-scroll-DzA4PJqc.js} +1 -1
  199. package/dist/client/assets/{use-list-state-BxWtfKJF.js → use-list-state-BKFx4oGM.js} +1 -1
  200. package/dist/client/assets/use-mcp-client-WRUNhji3.js +10 -0
  201. package/dist/client/assets/{use-mcp-prompts-B8H3Sb8-.js → use-mcp-prompts-D8_D9pv7.js} +1 -1
  202. package/dist/client/assets/use-mcp-tools-C9n7HK44.js +1 -0
  203. package/dist/client/assets/{use-members-D33brPm2.js → use-members-CRFHIxPI.js} +1 -1
  204. package/dist/client/assets/{use-navigate-to-agent-BpOmxFKV.js → use-navigate-to-agent-S7VbkvxA.js} +1 -1
  205. package/dist/client/assets/{use-org-auth-client-B3bhhuY4.js → use-org-auth-client-CSi9369v.js} +1 -1
  206. package/dist/client/assets/{use-org-sso-qcLKm5I7.js → use-org-sso-BpQsq_SJ.js} +1 -1
  207. package/dist/client/assets/{use-organization-roles-DV7FcWv5.js → use-organization-roles-D_SSRrwH.js} +1 -1
  208. package/dist/client/assets/{use-organization-settings-mMiPWte8.js → use-organization-settings-CGN7GbnQ.js} +1 -1
  209. package/dist/client/assets/use-registry-connections-UhNQSvBW.js +1 -0
  210. package/dist/client/assets/{use-secrets-CMyn_SAh.js → use-secrets-pnJMJ9Be.js} +1 -1
  211. package/dist/client/assets/use-status-sounds-Dz4RsXmq.js +1 -0
  212. package/dist/client/assets/{use-view-mode-CQiQ9BoV.js → use-view-mode-Gu7r5Cby.js} +1 -1
  213. package/dist/client/assets/{use-virtual-mcp-BHCygv1Q.js → use-virtual-mcp-CYog3nxZ.js} +1 -1
  214. package/dist/client/assets/useInfiniteQuery-BSkLeLWA.js +1 -0
  215. package/dist/client/assets/{useRouterState-CPOZ6kYF.js → useRouterState-D4-J_KM9.js} +1 -1
  216. package/dist/client/assets/useSuspenseInfiniteQuery-VzK0S1M9.js +1 -0
  217. package/dist/client/assets/{user-BHiBl7KY.js → user-BiR0-i8i.js} +1 -1
  218. package/dist/client/assets/{view-mode-toggle-C4AuqTiF.js → view-mode-toggle-YSQkkoIu.js} +1 -1
  219. package/dist/client/assets/{watch-sse-pool-BEICArze.js → watch-sse-pool-D-9b4N8J.js} +1 -1
  220. package/dist/client/assets/workflow-D9qNodRH.js +1 -0
  221. package/dist/client/assets/workflow-detail-CmQwmqlu.js +1 -0
  222. package/dist/client/index.html +1 -1
  223. package/dist/server/cli.js +458 -458
  224. package/dist/server/migrate.js +95 -95
  225. package/dist/server/server.js +335 -335
  226. package/package.json +1 -1
  227. package/dist/client/assets/add-section-modal-DGPmEqVH.js +0 -1
  228. package/dist/client/assets/agents-list-f6dvlBDo.js +0 -1
  229. package/dist/client/assets/ai-providers-CIni-0nv.js +0 -1
  230. package/dist/client/assets/app-editor-Dd3wbzna.js +0 -1
  231. package/dist/client/assets/automations-BKZFJOPp.js +0 -1
  232. package/dist/client/assets/brand-context-CpadUeMB.js +0 -1
  233. package/dist/client/assets/buckets-BWDxlk4n.js +0 -1
  234. package/dist/client/assets/collection-detail-C5awVm7D.js +0 -1
  235. package/dist/client/assets/decopilot-sse-pool-Cu7Nizzp.js +0 -1
  236. package/dist/client/assets/domain-settings-BUYR_el1.js +0 -1
  237. package/dist/client/assets/dynamic-plugin-layout-b5WMDmEL.js +0 -1
  238. package/dist/client/assets/features-1PDTV_2R.js +0 -1
  239. package/dist/client/assets/file-explorer-CBKgCWMC.js +0 -2
  240. package/dist/client/assets/general-DCkCuFZl.js +0 -1
  241. package/dist/client/assets/generate-id-N17blLwS.js +0 -1
  242. package/dist/client/assets/index-4vxs0ZGV.js +0 -1
  243. package/dist/client/assets/index-CQQJ5UaG.js +0 -1
  244. package/dist/client/assets/oauth-callback-CdBo7Kde.js +0 -1
  245. package/dist/client/assets/org-plugin-layout-KpgdAlfM.js +0 -1
  246. package/dist/client/assets/page-seo-sheet-Bo7n8Dbw.js +0 -1
  247. package/dist/client/assets/profile-DvJYJ7rR.js +0 -1
  248. package/dist/client/assets/project-app-view-DQhfhWs_.js +0 -1
  249. package/dist/client/assets/record-editor-BYnzNxDd.js +0 -1
  250. package/dist/client/assets/registry-469wEK7T.js +0 -2
  251. package/dist/client/assets/roles-ChM1uml4.js +0 -1
  252. package/dist/client/assets/save-referenced-block-p44kfiVf.js +0 -1
  253. package/dist/client/assets/seo-editor-BdvXc5GQ.js +0 -1
  254. package/dist/client/assets/settings-layout-Cd7DSf19.js +0 -1
  255. package/dist/client/assets/shell-route-loading-DGAtAFWm.js +0 -1
  256. package/dist/client/assets/store-DRNbauSU.js +0 -1
  257. package/dist/client/assets/store-registry-Cj3hC5ms.js +0 -2
  258. package/dist/client/assets/tools-list-CmTd7_Mb.js +0 -1
  259. package/dist/client/assets/use-collections-CUoYyXrz.js +0 -1
  260. package/dist/client/assets/use-delete-connection-C2rrW8fa.js +0 -1
  261. package/dist/client/assets/use-mcp-client-B7YSHa6V.js +0 -10
  262. package/dist/client/assets/use-mcp-tools-Bb7rwoEF.js +0 -1
  263. package/dist/client/assets/use-registry-connections-BIDj-EVl.js +0 -1
  264. package/dist/client/assets/use-status-sounds-FktjeAga.js +0 -1
  265. package/dist/client/assets/useInfiniteQuery-Du3dTl6W.js +0 -1
  266. package/dist/client/assets/useSuspenseInfiniteQuery-BHnbmrEl.js +0 -1
  267. package/dist/client/assets/workflow-CqlkVMXi.js +0 -1
  268. package/dist/client/assets/workflow-detail-CqR4Jdyr.js +0 -1
@@ -1 +0,0 @@
1
- import{e as N,c as K,j as s,l as Wt,r as O,t as Z,q as fe,b as Ce,X as _s,K as qt,n as Vt,f as Te,g as Ns,d as zn,P as Pn,Y as Rn,Z as Dn,T as En,W as Fn,I as Gn,H as Bn,a as Ln,B as $t,$ as Hn,a0 as Un,o as Ae,a1 as Kn,a2 as Wn,a3 as qn,G as Vn,a4 as Yn,a5 as Xn,a6 as Qn,a7 as Zn,a8 as xt,a9 as Jn,aa as er,ab as tr,ac as sr,ad as nr,ae as rr,af as Cs,ag as or,ah as ir,ai as lr,aj as ar,ak as cr,al as dr,am as ur,an as mr,ao as fr,ap as xr,aq as hr,p as pr,E as ws}from"./index-DxLTuX83.js";import{u as gr}from"./useRouterState-CPOZ6kYF.js";import{c as br,i as jr,a as vr}from"./ZoomOut-C6xbqN0H.js";import{u as Xe,c as xe,d as ke,e as zt,f as Pt,g as $e,h as ks,i as Is,j as yr,k as Sr,l as Lt}from"./sidebar-DILd2AwV.js";import{T as we}from"./toolbar-A-Rw_MZF.js";import{u as Ms,T as We,a as qe,b as Ve,c as ts}from"./tooltip-D1D9JHhD.js";import{S as _e}from"./skeleton-Dvzf2GQP.js";import{P as Rt,a as ut,b as Dt}from"./popover-DpnBmU5u.js";import{b as As,a as $s,D as Os}from"./drawer-PqoucHj8.js";import{i as Ts}from"./SearchMd-BoptgjAM.js";import{s as _r}from"./Star01-Dsaeuwpa.js";import{s as Ne}from"./Plus-wat9tYeJ.js";import{i as Nr,g as Cr}from"./use-mcp-client-B7YSHa6V.js";import{a as zs,u as ht,b as wr}from"./use-virtual-mcp-BHCygv1Q.js";import{u as kr}from"./use-create-virtual-mcp-BiFjwqV_.js";import{I as Ir,a as Mr,u as Ar,W as $r,H as Or,S as Tr,G as zr}from"./github-repo-picker-CIreZixy.js";import{A as Oe,W as ss,X as ns,Y as Ps,Z as Pr,_ as Rr,$ as Dr}from"./agent-icon-BAU0Nn5Q.js";import{u as Rs,d as Er,k as Ds}from"./tab-id-BEXPtrYn.js";import{r as Fr,a as Gr,R as Br,b as Lr,u as Es}from"./shell-layout-DSw-nDR6.js";import{u as Hr,a as Ur,b as Kr,s as Wr,c as qr,r as Vr,d as Yr,e as Xr,f as Qr,p as Zr,T as Fs,g as Jr,h as eo,i as to,j as so,k as no,l as ro,m as oo,n as io,S as rs,o as Gs}from"./use-navigate-to-agent-BpOmxFKV.js";import{A as os}from"./avatar-BZq-o3M_.js";import{i as Bs}from"./Check-CV74Rqqs.js";import{a as is}from"./Eye-RSaOlPZv.js";import{n as lo,i as ao}from"./Globe01-Ds0ZgQYM.js";import{i as co,a as Ls}from"./ZapSquare-DMmAEMvR.js";import{i as uo}from"./Monitor01-CaSeRueL.js";import{n as mo,a as fo}from"./Sun-BUoG5bs4.js";import{a as pt}from"./Settings02-8XjUg3gM.js";import{i as xo}from"./Shield01-CjOnx-7R.js";import{a as ho}from"./Users03-Cf3_qQGc.js";import{s as Hs}from"./XClose-CwNjmDWz.js";import{f as po,a as go,b as bo,c as jo,d as vo,e as yo,A as So}from"./alert-dialog-nDI1xJhR.js";import{F as _o,a as No,b as Co,c as wo,d as ko,e as Io,f as Mo}from"./form-DcfAV72q.js";import{I as Ao}from"./input-3FcnQKag.js";import{S as $o}from"./spinner-CIUpakvk.js";import"./index-CoxAwU4M.js";import{i as Oo,a as To}from"./RefreshCcw01-D-1V89vv.js";import{n as Yt}from"./Stars02-ChPYLNIJ.js";import{u as Us,A as Ks,g as zo,a as Po,b as ls,K as Ro,P as Do,s as Eo,S as Fo,v as Go,D as Bo,c as Lo,d as Ho,C as Uo}from"./sortable.esm-DhgyheK_.js";import{i as Xt}from"./ChevronRight-Betyx6_9.js";import{i as Ko}from"./FilterLines-DuHSJmFt.js";import{t as Wo}from"./Users01-BGw9h7dE.js";import{b as as,c as Ws,S as cs,a as ds,d as us}from"./select-C0Tyz9qJ.js";import{b as qo,c as Vo,e as Yo,a as Xo,D as Qo}from"./dialog-DilC5A4p.js";import{C as Zo,e as Jo,c as ei,d as ti,b as si}from"./command-DjRT1inC.js";import{u as qs}from"./studio-tools-qhNYzbg-.js";import{i as Vs}from"./Zap-j2XVmCfk.js";import{u as ni}from"./use-org-auth-client-B3bhhuY4.js";import{H as ri,a as oi,b as ii}from"./hover-card-Bizl54yc.js";import{g as li,S as ai}from"./task-status-17hQtONR.js";import{u as ci,f as di}from"./use-clock-tick-DufrTL6j.js";import{t as Ys}from"./ChevronDown-XKMoQgX6.js";function ui(t){const e=N.c(21),{value:n,onChange:r,placeholder:o,onKeyDown:i,className:a,isSearching:l,disabled:c}=t,d=o===void 0?"Search...":o;let u;e[0]!==a?(u=K("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=u):u=e[1];const m=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==m?(f=K("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=f):f=e[3];let g;e[4]!==l?(g=l?s.jsx(Wt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(Ts,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=l,e[5]=g):g=e[5];let p;e[6]!==r?(p=j=>r(j.target.value),e[6]=r,e[7]=p):p=e[7];let x;e[8]!==c||e[9]!==i||e[10]!==d||e[11]!==p||e[12]!==n?(x=s.jsx("input",{type:"text",value:n,onChange:p,onKeyDown:i,placeholder:d,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=i,e[10]=d,e[11]=p,e[12]=n,e[13]=x):x=e[13];let h;e[14]!==f||e[15]!==g||e[16]!==x?(h=s.jsxs("label",{className:f,children:[g,x]}),e[14]=f,e[15]=g,e[16]=x,e[17]=h):h=e[17];let v;return e[18]!==u||e[19]!==h?(v=s.jsx("div",{className:u,children:h}),e[18]=u,e[19]=h,e[20]=v):v=e[20],v}const mi="Select an existing agent";function fi(t){const e=N.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(We,{asChild:!0,children:n}),e[0]=n,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(qe,{side:"right",sideOffset:8,children:mi}),e[2]=o):o=e[2];let i;return e[3]!==r?(i=s.jsxs(Ve,{defaultOpen:!0,delayDuration:0,children:[r,o]}),e[3]=r,e[4]=i):i=e[4],i}function xi(){const t=N.c(5),{enableDecoImport:e}=_s(),{data:n}=Ce.useSession();let r;t[0]!==n?.user?.email?(r=qt.decoProfile(n?.user?.email),t[0]=n?.user?.email,t[1]=r):r=t[1];const o=!!e&&!!n?.user?.email;let i;t[2]!==r||t[3]!==o?(i={queryKey:r,queryFn:hi,enabled:o,staleTime:3e5},t[2]=r,t[3]=o,t[4]=i):i=t[4];const{data:a}=Vt(i);return a?.isDecoUser??!1}async function hi(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function pi(t){const e=Te(),{create:n}=Rs(),{locator:r}=fe(),o=Ns({strict:!1}),i=zn({strict:!1});return async a=>{const l=crypto.randomUUID(),c=a===i.virtualmcpid?Fr(t,r,o.taskId??""):null;try{await n({id:l,virtual_mcp_id:a,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:l},search:{virtualmcpid:a}})}}function gi(t){const e=N.c(9),{agent:n,onClick:r}=t;let o;e[0]!==n.icon||e[1]!==n.title?(o=s.jsx(Oe,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=n.icon,e[1]=n.title,e[2]=o):o=e[2];let i;e[3]!==n.title?(i=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:n.title}),e[3]=n.title,e[4]=i):i=e[4];let a;return e[5]!==r||e[6]!==o||e[7]!==i?(a=s.jsxs("button",{type:"button",onClick:r,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[o,i]}),e[5]=r,e[6]=o,e[7]=i,e[8]=a):a=e[8],a}function bi(t){const e=N.c(65),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:o}=t,[i,a]=O.useState(""),l=zs(),{org:c}=fe(),{data:d}=Ce.useSession(),u=d?.user?.id??"anon",m=l.filter(yi).map(vi),f=Ur();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={navigateOnCreate:!0},e[0]=g):g=e[0];const{createVirtualMCP:p,isCreating:x}=kr(g),{createFromTemplate:h,isCreating:v}=Ar(),j=xi(),y=pi(c.slug),b=i.toLowerCase(),S=l.filter(ji).filter(le=>!i||le.title.toLowerCase().includes(b)),k=le=>{Kr({orgId:c.id,userId:u},le.id,m),f(),n(),a(""),y(le.id)},_="flex flex-col max-h-[min(640px,80dvh)]";let C;e[1]!==i?(C=s.jsx(ui,{value:i,onChange:a,placeholder:"Search agents..."}),e[1]=i,e[2]=C):C=e[2];const I="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let A;e[3]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("div",{className:"px-1 pt-3 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[3]=A):A=e[3];const P="grid grid-cols-3 gap-1";let $;e[4]!==p||e[5]!==n?($=async()=>{Z("agent_create_new_clicked",{source:"browse_popover"}),await p(),n()},e[4]=p,e[5]=n,e[6]=$):$=e[6];let w,z;e[7]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Ne,{size:16,className:"text-muted-foreground"})}),z=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[7]=w,e[8]=z):(w=e[7],z=e[8]);let H;e[9]!==x||e[10]!==$?(H=s.jsxs("button",{type:"button",disabled:x,onClick:$,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[w,z]}),e[9]=x,e[10]=$,e[11]=H):H=e[11];let T;e[12]!==h||e[13]!==n?(T=async()=>{Z("agent_create_clicked",{source:"browse_popover",method:"website"}),await h($r),n()},e[12]=h,e[13]=n,e[14]=T):T=e[14];let B,R;e[15]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(_r,{className:"size-5 text-muted-foreground"})}),R=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[15]=B,e[16]=R):(B=e[15],R=e[16]);let L;e[17]!==v||e[18]!==T?(L=s.jsxs("button",{type:"button",disabled:v,onClick:T,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[B,R]}),e[17]=v,e[18]=T,e[19]=L):L=e[19];let D;e[20]!==h||e[21]!==n?(D=async()=>{Z("agent_create_clicked",{source:"browse_popover",method:"hydrogen"}),await h(Or),n()},e[20]=h,e[21]=n,e[22]=D):D=e[22];let G,F;e[23]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:Tr,alt:"",className:"size-5 object-contain"})}),F=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Shopify Headless Store"}),e[23]=G,e[24]=F):(G=e[23],F=e[24]);let E;e[25]!==v||e[26]!==D?(E=s.jsxs("button",{type:"button",disabled:v,onClick:D,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[G,F]}),e[25]=v,e[26]=D,e[27]=E):E=e[27];let W;e[28]!==n||e[29]!==o?(W=()=>{Z("agent_import_clicked",{source:"github"}),o(),n()},e[28]=n,e[29]=o,e[30]=W):W=e[30];let q,X;e[31]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(zr,{className:"size-5 text-muted-foreground"})}),X=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[31]=q,e[32]=X):(q=e[31],X=e[32]);let re;e[33]!==W?(re=s.jsxs("button",{type:"button",onClick:W,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[q,X]}),e[33]=W,e[34]=re):re=e[34];let Y;e[35]!==j||e[36]!==n||e[37]!==r?(Y=j&&s.jsxs("button",{type:"button",onClick:()=>{Z("agent_import_clicked",{source:"deco"}),r(),n()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"",className:"size-5 object-contain"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import deco.cx"})]}),e[35]=j,e[36]=n,e[37]=r,e[38]=Y):Y=e[38];const oe=S.map(le=>s.jsx(gi,{agent:le,onClick:()=>k(le)},le.id));let V;e[39]!==H||e[40]!==L||e[41]!==E||e[42]!==re||e[43]!==Y||e[44]!==oe?(V=s.jsxs("div",{className:P,children:[H,L,E,re,Y,oe]}),e[39]=H,e[40]=L,e[41]=E,e[42]=re,e[43]=Y,e[44]=oe,e[45]=V):V=e[45];let J;e[46]!==x||e[47]!==i||e[48]!==S.length?(J=S.length===0&&!x&&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[46]=x,e[47]=i,e[48]=S.length,e[49]=J):J=e[49];let Q;e[50]!==V||e[51]!==J||e[52]!==A?(Q=s.jsxs("div",{className:I,children:[A,V,J]}),e[50]=V,e[51]=J,e[52]=A,e[53]=Q):Q=e[53];let ee;e[54]!==c.slug?(ee={org:c.slug},e[54]=c.slug,e[55]=ee):ee=e[55];let te;e[56]!==n?(te=()=>n(),e[56]=n,e[57]=te):te=e[57];let se;e[58]!==ee||e[59]!==te?(se=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Pn,{to:"/$org/settings/agents",params:ee,onClick:te,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[58]=ee,e[59]=te,e[60]=se):se=e[60];let ie;return e[61]!==Q||e[62]!==C||e[63]!==se?(ie=s.jsxs("div",{className:_,children:[C,Q,se]}),e[61]=Q,e[62]=C,e[63]=se,e[64]=ie):ie=e[64],ie}function ji(t){return!Nr(t.id)}function vi(t){return t.id}function yi(t){return t.pinned}function Xs(t){const e=N.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:r}=n,o=r===void 0?!1:r,[i,a]=O.useState(!1),[l,c]=O.useState(!1),[d,u]=O.useState(!1),m=Ms(),{setOpenMobile:f}=Xe(),g=Hr(),p=g?"border border-border":void 0;let x;e[2]!==g?(x=I=>g?s.jsx(fi,{children:I}):I,e[2]=g,e[3]=x):x=e[3];const h=x;let v;e[4]!==m||e[5]!==f?(v=()=>{a(!1),m&&f(!1)},e[4]=m,e[5]=f,e[6]=v):v=e[6];const j=v;let y;e[7]!==j||e[8]!==i?(y=i&&s.jsx(O.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(_e,{className:"h-4 w-24"})}),children:s.jsx(bi,{onClose:j,onOpenImportDeco:()=>c(!0),onOpenGithubImport:()=>{u(!0),j()}})}),e[7]=j,e[8]=i,e[9]=y):y=e[9];const b=y;let S;e[10]!==o||e[11]!==p||e[12]!==g||e[13]!==m||e[14]!==i||e[15]!==b||e[16]!==h?(S=m?s.jsxs(s.Fragment,{children:[o?h(s.jsx(we,{"aria-label":"Browse agents",className:K(p),onClick:()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),a(!0)},children:s.jsx(Ne,{className:"size-4"})})):s.jsx(xe,{children:h(s.jsxs(ke,{tooltip:g?void 0:"Browse agents",className:K(p),onClick:()=>{Z("agent_browser_opened",{surface:"mobile_drawer"}),a(!0)},children:[s.jsx(Ne,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(As,{open:i,onOpenChange:a,direction:"bottom",children:s.jsxs($s,{className:"max-h-[85dvh] p-0",children:[s.jsx(Os,{className:"sr-only",children:"Browse agents"}),b]})})]}):s.jsxs(Rt,{open:i,onOpenChange:I=>{I&&!i&&Z("agent_browser_opened",{surface:"desktop_popover"}),a(I)},children:[o?h(s.jsx(ut,{asChild:!0,children:s.jsx(we,{"aria-label":"Browse agents",className:K(p),children:s.jsx(Ne,{className:"size-4"})})})):s.jsx(xe,{children:h(s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{tooltip:g?void 0:"Browse agents",className:K(p),children:[s.jsx(Ne,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Dt,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:b})]}),e[10]=o,e[11]=p,e[12]=g,e[13]=m,e[14]=i,e[15]=b,e[16]=h,e[17]=S):S=e[17];let k;e[18]!==l?(k=s.jsx(Ir,{open:l,onOpenChange:c}),e[18]=l,e[19]=k):k=e[19];let _;e[20]!==d?(_=s.jsx(Mr,{open:d,onOpenChange:u}),e[20]=d,e[21]=_):_=e[21];let C;return e[22]!==S||e[23]!==k||e[24]!==_?(C=s.jsxs(s.Fragment,{children:[S,k,_]}),e[22]=S,e[23]=k,e[24]=_,e[25]=C):C=e[25],C}function Qs(){const t=N.c(24),{org:e}=fe(),n=Te(),o=gr().location.pathname,i=e.slug,{state:a,isMobile:l}=Xe(),c=!l&&a==="collapsed";let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(br,{className:"size-4!"}),t[0]=d):d=t[0];const u=o===`/${i}`||o===`/${i}/`;let m;t[1]!==n||t[2]!==i?(m=()=>{n({to:"/$org",params:{org:i}})},t[1]=n,t[2]=i,t[3]=m):m=t[3];let f;t[4]!==u||t[5]!==m?(f={key:"home",label:"Home",icon:d,isActive:u,onClick:m},t[4]=u,t[5]=m,t[6]=f):f=t[6];const g=f;let p;t[7]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(jr,{className:"size-4!"}),t[7]=p):p=t[7];let x;t[8]!==o||t[9]!==i?(x=o.startsWith(`/${i}/files`),t[8]=o,t[9]=i,t[10]=x):x=t[10];let h;t[11]!==n||t[12]!==i?(h=()=>{n({to:"/$org/files",params:{org:i}})},t[11]=n,t[12]=i,t[13]=h):h=t[13];let v;t[14]!==x||t[15]!==h?(v={key:"files",label:"Library",icon:p,isActive:x,onClick:h},t[14]=x,t[15]=h,t[16]=v):v=t[16];const j=v;let y;t[17]!==j||t[18]!==g?(y={type:"items",items:[g,j]},t[17]=j,t[18]=g,t[19]=y):y=t[19];let b;if(t[20]!==c||t[21]!==y){if(b=[y],c){let S;t[23]===Symbol.for("react.memo_cache_sentinel")?(S={type:"custom",key:"new-task",content:s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:s.jsx(Xs,{})})})})},t[23]=S):S=t[23],b.push(S)}t[20]=c,t[21]=y,t[22]=b}else b=t[22];return b}function Ot(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,orientation:o,decorative:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const a=o===void 0?"horizontal":o,l=i===void 0?!0:i;let c;e[5]!==n?(c=K("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==l||e[8]!==a||e[9]!==r||e[10]!==c?(d=s.jsx(Rn,{"data-slot":"separator-root",decorative:l,orientation:a,className:c,...r}),e[7]=l,e[8]=a,e[9]=r,e[10]=c,e[11]=d):d=e[11],d}function Zs(t){const e=N.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=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]=r):r=e[0];let o;return e[1]!==n?(o=s.jsxs(zt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(Pt,{children:s.jsx($e,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function Js(t){const e=N.c(18),{item:n}=t,{isMobile:r,setOpenMobile:o}=Xe();let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=()=>{Z("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:r}),n.onClick?.(),r&&o(!1)},e[0]=r,e[1]=n,e[2]=o,e[3]=i):i=e[3];const a=i,l=n.key,c=n.isActive&&"z-10";let d;e[4]!==c?(d=K(c),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==n.label?(u=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=u):u=e[7];let m;e[8]!==a||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==u?(m=s.jsxs(ke,{onClick:a,isActive:n.isActive,tooltip:n.label,children:[n.icon,u]}),e[8]=a,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=u,e[13]=m):m=e[13];let f;return e[14]!==n.key||e[15]!==d||e[16]!==m?(f=s.jsx(xe,{className:d,children:m},l),e[14]=n.key,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function Si(t){const e=N.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ks,{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,o=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(Ni),e[2]=n.group.items,e[3]=i):i=e[3];let a;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(a=s.jsx(Zs,{label:r,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=a):a=e[7],a}case"items":{let r;e[8]!==n.items?(r=n.items.map(_i),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}case"custom":return n.content}}function _i(t){return s.jsx(Js,{item:t},t.key)}function Ni(t){return s.jsx(Js,{item:t},t.key)}function Ci(t){const e=N.c(14),{sections:n,footer:r,additionalContent:o,variant:i,contentClassName:a}=t,l=i===void 0?"sidebar":i;let c;e[0]!==a?(c=K("flex flex-col flex-1 px-2 py-2 gap-0.5",a),e[0]=a,e[1]=c):c=e[1];let d;e[2]!==n?(d=n.map(wi),e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o?(u=o&&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:o}),e[4]=o,e[5]=u):u=e[5];let m;e[6]!==c||e[7]!==d||e[8]!==u?(m=s.jsxs(Is,{className:c,children:[d,u]}),e[6]=c,e[7]=d,e[8]=u,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m||e[12]!==l?(f=s.jsxs(yr,{variant:l,children:[m,r]}),e[10]=r,e[11]=m,e[12]=l,e[13]=f):f=e[13],f}function wi(t,e){return s.jsx(Si,{section:t},e)}function en(t){const e=N.c(2);let n;return e[0]!==t?(n=s.jsx(Ci,{...t}),e[0]=t,e[1]=n):n=e[1],n}en.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(_e,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function ki(){const t=N.c(7),n=_s().logo??Dn,r=typeof n=="string"?n:n.light,o=typeof n=="string"?n:n.dark;let i;t[0]!==r?(i=s.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=r,t[1]=i):i=t[1];let a;t[2]!==o?(a=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=o,t[3]=a):a=t[3];let l;return t[4]!==i||t[5]!==a?(l=s.jsxs(Sr,{className:"flex flex-row items-center shrink-0 h-12 px-3 pb-0",children:[i,a]}),t[4]=i,t[5]=a,t[6]=l):l=t[6],l}function ms(t){const e=N.c(18),{item:n,onClose:r}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=K(o),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==n||e[3]!==r?(a=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=a):a=e[4];let l;e[5]!==n.icon?(l=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=l):l=e[6];let c;e[7]!==n.label?(c=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=c):c=e[8];let d;e[9]!==n.isActive||e[10]!==n.label||e[11]!==a||e[12]!==l||e[13]!==c?(d=s.jsxs(ke,{onClick:a,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[l,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=a,e[12]=l,e[13]=c,e[14]=d):d=e[14];let u;return e[15]!==i||e[16]!==d?(u=s.jsx(xe,{className:i,children:d}),e[15]=i,e[16]=d,e[17]=u):u=e[17],u}function Ii(t){const e=N.c(18),{section:n,onClose:r}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ks,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let a;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=d=>s.jsx(ms,{item:d,onClose:r},d.key),e[5]=r,e[6]=c):c=e[6],a=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=a}else a=e[4];let l;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==a?(l=s.jsx(Zs,{label:o,defaultExpanded:i,children:a}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=a,e[10]=l):l=e[10],l}case"items":{let o;if(e[11]!==r||e[12]!==n.items){let a;e[14]!==r?(a=l=>s.jsx(ms,{item:l,onClose:r},l.key),e[14]=r,e[15]=a):a=e[15],o=n.items.map(a),e[11]=r,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function Mi(t){const e=N.c(14),{sections:n,onClose:r,footer:o,additionalContent:i}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(O.Suspense,{fallback:s.jsx("div",{className:"h-10 shrink-0"}),children:s.jsx(ki,{})}),e[0]=a):a=e[0];let l;if(e[1]!==r||e[2]!==n){let m;e[4]!==r?(m=(f,g)=>s.jsx(Ii,{section:f,onClose:r},g),e[4]=r,e[5]=m):m=e[5],l=n.map(m),e[1]=r,e[2]=n,e[3]=l}else l=e[3];let c;e[6]!==i?(c=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[6]=i,e[7]=c):c=e[7];let d;e[8]!==l||e[9]!==c?(d=s.jsxs(Is,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[l,c]}),e[8]=l,e[9]=c,e[10]=d):d=e[10];let u;return e[11]!==o||e[12]!==d?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,d,o]}),e[11]=o,e[12]=d,e[13]=u):u=e[13],u}function tn(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ai=En({name:Fn().min(2,"Organization name is required")});function $i(t){const e=N.c(41),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={resolver:Gn(Ai),defaultValues:{name:""}},e[0]=o):o=e[0];const i=Bn(o);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={mutationFn:Ti,onSuccess:Oi},e[1]=a):a=e[1];const l=Ln(a),c=l.error instanceof Error?l.error.message:l.error?"Failed to create organization.":null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(bo,{children:[s.jsx(jo,{children:"Create a new organization"}),s.jsx(vo,{children:"Set up a new organization to collaborate with others."})]}),e[2]=d):d=e[2];let u;if(e[3]!==l||e[4]!==i){let _;e[6]!==l?(_=C=>l.mutateAsync(C),e[6]=l,e[7]=_):_=e[7],u=i.handleSubmit(_),e[3]=l,e[4]=i,e[5]=u}else u=e[5];let m;e[8]!==i.formState.isSubmitting?(m=_=>{const{field:C}=_;return s.jsxs(Co,{children:[s.jsx(wo,{children:"Organization Name"}),s.jsx(ko,{children:s.jsx(Ao,{...C,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(Io,{children:"The name of your company or organization"}),C.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:"","/",tn(C.value)]})]}),s.jsx(Mo,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==i.control||e[11]!==m?(f=s.jsx(_o,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=f):f=e[12];let g;e[13]!==c?(g=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=g):g=e[14];let p;e[15]!==l||e[16]!==i?(p=()=>{l.reset(),i.reset()},e[15]=l,e[16]=i,e[17]=p):p=e[17];let x;e[18]!==i.formState.isSubmitting||e[19]!==p?(x=s.jsx(po,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=x):x=e[20];const h=!i.formState.isValid||i.formState.isSubmitting;let v;e[21]!==i.formState.isSubmitting?(v=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx($o,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=v):v=e[22];let j;e[23]!==h||e[24]!==v?(j=s.jsx($t,{type:"submit",variant:"default",disabled:h,children:v}),e[23]=h,e[24]=v,e[25]=j):j=e[25];let y;e[26]!==j||e[27]!==x?(y=s.jsxs(yo,{children:[x,j]}),e[26]=j,e[27]=x,e[28]=y):y=e[28];let b;e[29]!==y||e[30]!==u||e[31]!==f||e[32]!==g?(b=s.jsxs("form",{className:"space-y-6",onSubmit:u,autoComplete:"off",children:[f,g,y]}),e[29]=y,e[30]=u,e[31]=f,e[32]=g,e[33]=b):b=e[33];let S;e[34]!==i||e[35]!==b?(S=s.jsxs(go,{children:[d,s.jsx(No,{...i,children:b})]}),e[34]=i,e[35]=b,e[36]=S):S=e[36];let k;return e[37]!==r||e[38]!==n||e[39]!==S?(k=s.jsx(So,{open:n,onOpenChange:r,children:S}),e[37]=r,e[38]=n,e[39]=S,e[40]=k):k=e[40],k}function Oi(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Ti(t){const e=tn(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await Ce.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const r=n?.data?.slug??e;if(!r)throw new Error("Failed to create organization");return{orgSlug:r}}function Ht(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function zi(t){const e=N.c(13),{org:n,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",a=o==="xs"?"text-[9px]":"text-xs";let l;e[0]!==i?(l=K(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:Ht(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let d;e[5]!==n.logo||e[6]!==n.name||e[7]!==a?(d=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:K("font-semibold leading-none",a),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=a,e[8]=d):d=e[8];let u;return e[9]!==l||e[10]!==c||e[11]!==d?(u=s.jsx("div",{className:l,style:c,children:d}),e[9]=l,e[10]=c,e[11]=d,e[12]=u):u=e[12],u}function wt(t){const e=N.c(22),{item:n,onClose:r}=t;if(n.href){const c=n.external?"_blank":void 0,d=n.external?"noopener noreferrer":void 0;let u;e[0]!==n.icon?(u=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=u):u=e[1];let m;e[2]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=m):m=e[3];let f;return e[4]!==n.href||e[5]!==r||e[6]!==c||e[7]!==d||e[8]!==u||e[9]!==m?(f=s.jsxs("a",{href:n.href,target:c,rel:d,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:r,children:[u,m]}),e[4]=n.href,e[5]=r,e[6]=c,e[7]=d,e[8]=u,e[9]=m,e[10]=f):f=e[10],f}let o;e[11]!==n||e[12]!==r?(o=()=>{n.onClick?.(),r()},e[11]=n,e[12]=r,e[13]=o):o=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 a;e[16]!==n.label?(a=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=a):a=e[17];let l;return e[18]!==o||e[19]!==i||e[20]!==a?(l=s.jsxs("button",{type:"button",onClick:o,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,a]}),e[18]=o,e[19]=i,e[20]=a,e[21]=l):l=e[21],l}function fs(t){const e=N.c(31),{orgParam:n,onSelectOrg:r,onCreateOrg:o}=t,{data:i}=qn();let a;e[0]!==n?(a=(w,z)=>w.slug===n?-1:z.slug===n?1:w.name.localeCompare(z.name),e[0]=n,e[1]=a):a=e[1];const l=[...i??[]].sort(a),[c,d]=O.useState(!1),[u,m]=O.useState(""),f=u.toLowerCase(),g=f?l.filter(w=>w.name.toLowerCase().includes(f)||w.slug.toLowerCase().includes(f)):l;let p;e[2]!==c?(p=function(){c&&m(""),d(Pi)},e[2]=c,e[3]=p):p=e[3];const x=p;let h;e[4]!==u||e[5]!==c||e[6]!==x?(h=c?s.jsx("input",{autoFocus:!0,type:"text",value:u,onChange:w=>m(w.target.value),onKeyDown:w=>w.key==="Escape"&&x(),placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}):s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[4]=u,e[5]=c,e[6]=x,e[7]=h):h=e[7];let v;e[8]!==c?(v=c?s.jsx(Hs,{size:16}):s.jsx(Ts,{size:16}),e[8]=c,e[9]=v):v=e[9];let j;e[10]!==v||e[11]!==x?(j=s.jsx("button",{type:"button",onClick:x,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:v}),e[10]=v,e[11]=x,e[12]=j):j=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ne,{size:16}),e[13]=y):y=e[13];let b;e[14]!==o?(b=s.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:y}),e[14]=o,e[15]=b):b=e[15];let S;e[16]!==j||e[17]!==b?(S=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[j,b]}),e[16]=j,e[17]=b,e[18]=S):S=e[18];let k;e[19]!==h||e[20]!==S?(k=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[h,S]}),e[19]=h,e[20]=S,e[21]=k):k=e[21];const _="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",C=g.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:u?`No organizations match "${u}"`:"No organizations available"});let I;e[22]!==r||e[23]!==n?(I=w=>s.jsxs("button",{type:"button",onClick:()=>r(w.slug),className:K("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",w.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(zi,{org:w,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:w.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:w.slug})]}),w.slug===n&&s.jsx(Bs,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},w.id),e[22]=r,e[23]=n,e[24]=I):I=e[24];const A=g.map(I);let P;e[25]!==C||e[26]!==A?(P=s.jsxs("div",{className:_,children:[C,A]}),e[25]=C,e[26]=A,e[27]=P):P=e[27];let $;return e[28]!==P||e[29]!==k?($=s.jsxs(s.Fragment,{children:[k,P]}),e[28]=P,e[29]=k,e[30]=$):$=e[30],$}function Pi(t){return!t}function xs(t){const e=N.c(142),{user:n,userImage:r,menuItems:o,signOutItem:i,themeOptions:a,preferences:l,setPreferences:c,orgParam:d,onSelectOrg:u,onCreateOrg:m,close:f,isMobile:g,open:p}=t;if(g){const V=n?.name??"U";let J;e[0]!==V||e[1]!==r?(J=s.jsx(os,{url:r,fallback:V,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=V,e[1]=r,e[2]=J):J=e[2];const Q=n?.name??"User";let ee;e[3]!==Q?(ee=s.jsx("p",{className:"text-sm font-medium truncate",children:Q}),e[3]=Q,e[4]=ee):ee=e[4];const te=n?.email;let se;e[5]!==te?(se=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:te}),e[5]=te,e[6]=se):se=e[6];let ie;e[7]!==ee||e[8]!==se?(ie=s.jsxs("div",{className:"flex-1 min-w-0",children:[ee,se]}),e[7]=ee,e[8]=se,e[9]=ie):ie=e[9];let le;e[10]!==n?(le=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Fi)},e[10]=n,e[11]=le):le=e[11];let Ie;e[12]===Symbol.for("react.memo_cache_sentinel")?(Ie=s.jsx(is,{size:14}),e[12]=Ie):Ie=e[12];let ze;e[13]!==le?(ze=s.jsx(We,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:le,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:Ie})}),e[13]=le,e[14]=ze):ze=e[14];let Pe;e[15]===Symbol.for("react.memo_cache_sentinel")?(Pe=s.jsx(qe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=Pe):Pe=e[15];let he;e[16]!==ze?(he=s.jsx(ts,{delayDuration:300,children:s.jsxs(Ve,{children:[ze,Pe]})}),e[16]=ze,e[17]=he):he=e[17];let Re;e[18]!==he||e[19]!==J||e[20]!==ie?(Re=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[J,ie,he]}),e[18]=he,e[19]=J,e[20]=ie,e[21]=Re):Re=e[21];const mt=String(p);let De;e[22]!==m||e[23]!==u||e[24]!==d||e[25]!==mt?(De=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(fs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},mt)}),e[22]=m,e[23]=u,e[24]=d,e[25]=mt,e[26]=De):De=e[26];let Ee;if(e[27]!==f||e[28]!==o){let de;e[30]!==f?(de=He=>s.jsx(wt,{item:He,onClose:f},He.key),e[30]=f,e[31]=de):de=e[31],Ee=o.map(de),e[27]=f,e[28]=o,e[29]=Ee}else Ee=e[29];let Me;e[32]!==f||e[33]!==i?(Me=s.jsx(wt,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=Me):Me=e[34];let ae;e[35]!==Ee||e[36]!==Me?(ae=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[Ee,Me]}),e[35]=Ee,e[36]=Me,e[37]=ae):ae=e[37];let Fe;e[38]!==De||e[39]!==ae?(Fe=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[De,ae]}),e[38]=De,e[39]=ae,e[40]=Fe):Fe=e[40];let Ge;if(e[41]!==l.theme||e[42]!==c||e[43]!==a){let de;e[45]!==l.theme||e[46]!==c?(de=He=>{const{value:ye,icon:Ue,label:Ke}=He;return s.jsx("button",{type:"button","aria-label":Ke,onClick:()=>c(Qe=>({...Qe,theme:ye})),className:K("size-8 rounded-md flex items-center justify-center transition-colors",l.theme===ye?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Ue},ye)},e[45]=l.theme,e[46]=c,e[47]=de):de=e[47],Ge=a.map(de),e[41]=l.theme,e[42]=c,e[43]=a,e[44]=Ge}else Ge=e[44];let Ye;e[48]!==Ge?(Ye=s.jsx("div",{className:"flex items-center gap-0.5",children:Ge}),e[48]=Ge,e[49]=Ye):Ye=e[49];const ft=l.enableSounds?"Disable sounds":"Enable sounds";let be;e[50]!==c?(be=()=>c(Ei),e[50]=c,e[51]=be):be=e[51];const je=l.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let ue;e[52]!==je?(ue=K("size-8 rounded-md flex items-center justify-center transition-colors",je),e[52]=je,e[53]=ue):ue=e[53];let pe;e[54]!==l.enableSounds?(pe=l.enableSounds?s.jsx(ss,{size:14}):s.jsx(ns,{size:14}),e[54]=l.enableSounds,e[55]=pe):pe=e[55];let me;e[56]!==ft||e[57]!==be||e[58]!==ue||e[59]!==pe?(me=s.jsx("button",{type:"button","aria-label":ft,onClick:be,className:ue,children:pe}),e[56]=ft,e[57]=be,e[58]=ue,e[59]=pe,e[60]=me):me=e[60];let Be;e[61]===Symbol.for("react.memo_cache_sentinel")?(Be=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.34.3"]}),e[61]=Be):Be=e[61];let ge;e[62]!==me?(ge=s.jsxs("div",{className:"flex items-center gap-2",children:[me,Be]}),e[62]=me,e[63]=ge):ge=e[63];let ve;e[64]!==Ye||e[65]!==ge?(ve=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ye,ge]}),e[64]=Ye,e[65]=ge,e[66]=ve):ve=e[66];let Le;return e[67]!==Re||e[68]!==Fe||e[69]!==ve?(Le=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[Re,Fe,ve]}),e[67]=Re,e[68]=Fe,e[69]=ve,e[70]=Le):Le=e[70],Le}const x=n?.name??"U";let h;e[71]!==x||e[72]!==r?(h=s.jsx(os,{url:r,fallback:x,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=x,e[72]=r,e[73]=h):h=e[73];const v=n?.name??"User";let j;e[74]!==v?(j=s.jsx("p",{className:"text-sm font-medium truncate",children:v}),e[74]=v,e[75]=j):j=e[75];const y=n?.email;let b;e[76]!==y?(b=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y}),e[76]=y,e[77]=b):b=e[77];let S;e[78]!==j||e[79]!==b?(S=s.jsxs("div",{className:"flex-1 min-w-0",children:[j,b]}),e[78]=j,e[79]=b,e[80]=S):S=e[80];let k;e[81]!==n?(k=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Di)},e[81]=n,e[82]=k):k=e[82];let _;e[83]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(is,{size:14}),e[83]=_):_=e[83];let C;e[84]!==k?(C=s.jsx(We,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:k,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:_})}),e[84]=k,e[85]=C):C=e[85];let I;e[86]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(qe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=I):I=e[86];let A;e[87]!==C?(A=s.jsx(ts,{delayDuration:300,children:s.jsxs(Ve,{children:[C,I]})}),e[87]=C,e[88]=A):A=e[88];let P;e[89]!==A||e[90]!==h||e[91]!==S?(P=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[h,S,A]}),e[89]=A,e[90]=h,e[91]=S,e[92]=P):P=e[92];let $;if(e[93]!==f||e[94]!==o){let V;e[96]!==f?(V=J=>s.jsx(wt,{item:J,onClose:f},J.key),e[96]=f,e[97]=V):V=e[97],$=o.map(V),e[93]=f,e[94]=o,e[95]=$}else $=e[95];let w;e[98]!==f||e[99]!==i?(w=s.jsx(wt,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=w):w=e[100];let z;e[101]!==$||e[102]!==w?(z=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[$,w]}),e[101]=$,e[102]=w,e[103]=z):z=e[103];let H;if(e[104]!==l.theme||e[105]!==c||e[106]!==a){let V;e[108]!==l.theme||e[109]!==c?(V=J=>{const{value:Q,icon:ee,label:te}=J;return s.jsx("button",{type:"button","aria-label":te,onClick:()=>c(se=>({...se,theme:Q})),className:K("size-7 rounded-md flex items-center justify-center transition-colors",l.theme===Q?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:ee},Q)},e[108]=l.theme,e[109]=c,e[110]=V):V=e[110],H=a.map(V),e[104]=l.theme,e[105]=c,e[106]=a,e[107]=H}else H=e[107];let T;e[111]!==H?(T=s.jsx("div",{className:"flex items-center gap-0.5",children:H}),e[111]=H,e[112]=T):T=e[112];const B=l.enableSounds?"Disable sounds":"Enable sounds";let R;e[113]!==c?(R=()=>c(Ri),e[113]=c,e[114]=R):R=e[114];const L=l.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let D;e[115]!==L?(D=K("size-7 rounded-md flex items-center justify-center transition-colors",L),e[115]=L,e[116]=D):D=e[116];let G;e[117]!==l.enableSounds?(G=l.enableSounds?s.jsx(ss,{size:14}):s.jsx(ns,{size:14}),e[117]=l.enableSounds,e[118]=G):G=e[118];let F;e[119]!==B||e[120]!==R||e[121]!==D||e[122]!==G?(F=s.jsx("button",{type:"button","aria-label":B,onClick:R,className:D,children:G}),e[119]=B,e[120]=R,e[121]=D,e[122]=G,e[123]=F):F=e[123];let E;e[124]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.34.3"]}),e[124]=E):E=e[124];let W;e[125]!==F?(W=s.jsxs("div",{className:"flex items-center gap-2",children:[F,E]}),e[125]=F,e[126]=W):W=e[126];let q;e[127]!==T||e[128]!==W?(q=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[T,W]}),e[127]=T,e[128]=W,e[129]=q):q=e[129];let X;e[130]!==P||e[131]!==z||e[132]!==q?(X=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[P,z,q]}),e[130]=P,e[131]=z,e[132]=q,e[133]=X):X=e[133];const re=String(p);let Y;e[134]!==m||e[135]!==u||e[136]!==d||e[137]!==re?(Y=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(fs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},re)}),e[134]=m,e[135]=u,e[136]=d,e[137]=re,e[138]=Y):Y=e[138];let oe;return e[139]!==X||e[140]!==Y?(oe=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[X,Y]}),e[139]=X,e[140]=Y,e[141]=oe):oe=e[141],oe}function Ri(t){return{...t,enableSounds:!t.enableSounds}}function Di(){Ae.success("User ID copied")}function Ei(t){return{...t,enableSounds:!t.enableSounds}}function Fi(){Ae.success("User ID copied")}function Ut(){const t=N.c(44),{data:e}=Ce.useSession(),{org:n}=fe(),r=Te();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const a=Hn(o)?.params.org,[l,c]=Un(),d=Ms(),[u,m]=O.useState(!1),[f,g]=O.useState(!1),p=e?.user,x=p?.image;let h;t[1]!==r?(h=X=>{m(!1),r({to:"/$org",params:{org:X}})},t[1]=r,t[2]=h):h=t[2];const v=h;let j;t[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>m(!1),t[3]=j):j=t[3];const y=j;let b;t[4]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(pt,{size:16}),t[4]=b):b=t[4];let S;t[5]!==r||t[6]!==a?(S={key:"preferences",label:"Preferences",icon:b,onClick:()=>{r({to:"/$org/settings/profile",params:{org:a??""}})}},t[5]=r,t[6]=a,t[7]=S):S=t[7];let k;t[8]!==n||t[9]!==r?(k=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(lo,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[8]=n,t[9]=r,t[10]=k):k=t[10];let _;t[11]===Symbol.for("react.memo_cache_sentinel")?(_={key:"terms",label:"Terms of Use",icon:s.jsx(vr,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[11]=_):_=t[11];let C;t[12]===Symbol.for("react.memo_cache_sentinel")?(C={key:"privacy",label:"Privacy Policy",icon:s.jsx(xo,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[12]=C):C=t[12];let I;t[13]===Symbol.for("react.memo_cache_sentinel")?(I={key:"github",label:"decocms/studio",icon:s.jsx(Kn,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[13]=I):I=t[13];let A;t[14]===Symbol.for("react.memo_cache_sentinel")?(A={key:"community",label:"Community",icon:s.jsx(ho,{size:16}),href:"https://decocms.com/discord",external:!0},t[14]=A):A=t[14];let P;t[15]===Symbol.for("react.memo_cache_sentinel")?(P={key:"homepage",label:"Homepage",icon:s.jsx(ao,{size:16}),href:"https://decocms.com",external:!0},t[15]=P):P=t[15];let $;t[16]!==S||t[17]!==k?($=[S,...k,_,C,I,A,P],t[16]=S,t[17]=k,t[18]=$):$=t[18];const w=$;let z;t[19]===Symbol.for("react.memo_cache_sentinel")?(z={key:"logout",label:"Sign out",icon:s.jsx(co,{size:16}),onClick:Bi},t[19]=z):z=t[19];const H=z;let T;t[20]===Symbol.for("react.memo_cache_sentinel")?(T={value:"light",icon:s.jsx(mo,{size:14}),label:"Light theme"},t[20]=T):T=t[20];let B;t[21]===Symbol.for("react.memo_cache_sentinel")?(B={value:"dark",icon:s.jsx(fo,{size:14}),label:"Dark theme"},t[21]=B):B=t[21];let R;t[22]===Symbol.for("react.memo_cache_sentinel")?(R=[T,B,{value:"system",icon:s.jsx(uo,{size:14}),label:"System theme"}],t[22]=R):R=t[22];const L=R;let D;t[23]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{m(!1),g(!0)},t[23]=D):D=t[23];let G;t[24]!==v||t[25]!==d||t[26]!==w||t[27]!==u||t[28]!==a||t[29]!==l||t[30]!==c||t[31]!==p||t[32]!==x?(G={user:p,userImage:x,menuItems:w,signOutItem:H,themeOptions:L,preferences:l,setPreferences:c,orgParam:a,onSelectOrg:v,onCreateOrg:D,close:y,isMobile:d,open:u},t[24]=v,t[25]=d,t[26]=w,t[27]=u,t[28]=a,t[29]=l,t[30]=c,t[31]=p,t[32]=x,t[33]=G):G=t[33];const F=G;let E;t[34]!==n||t[35]!==d||t[36]!==u||t[37]!==F?(E=d?s.jsxs(As,{open:u,onOpenChange:m,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>m(!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("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:Ht(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]}),s.jsxs($s,{className:"h-[80dvh] p-0",children:[s.jsx(Os,{className:"sr-only",children:"Account"}),s.jsx(xs,{...F})]})]}):s.jsxs(Rt,{open:u,onOpenChange:m,children:[s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{tooltip:n?.name??"Account",className:"rounded-md",children:[s.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:Ht(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]})}),s.jsx(Dt,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:Gi,children:s.jsx(xs,{...F})})]}),t[34]=n,t[35]=d,t[36]=u,t[37]=F,t[38]=E):E=t[38];let W;t[39]!==f?(W=s.jsx($i,{open:f,onOpenChange:g}),t[39]=f,t[40]=W):W=t[40];let q;return t[41]!==E||t[42]!==W?(q=s.jsxs(s.Fragment,{children:[E,W]}),t[41]=E,t[42]=W,t[43]=q):q=t[43],q}function Gi(t){return t.preventDefault()}function Bi(){Z("signed_out",{source:"account_popover"}),Wn(),Ce.signOut()}function Li({invitation:t}){const[e,n]=O.useState(!1),[r,o]=O.useState(!1),i=Vn(),a=async()=>{n(!0);try{const d=await Ce.organization.acceptInvitation({invitationId:t.id});if(d.error){Ae.error(d.error.message),n(!1);return}}catch{Ae.error("Failed to accept invitation"),n(!1);return}Ae.success("Invitation accepted!"),Yn();let c;try{c=(await Ce.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},l=async()=>{o(!0);try{const c=await Ce.organization.rejectInvitation({invitationId:t.id});c.error?(Ae.error(c.error.message),o(!1)):(Ae.success("Invitation declined"),i.invalidateQueries())}catch{Ae.error("Failed to decline invitation"),o(!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($t,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:a,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(Bs,{size:14})}),s.jsx($t,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:l,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(Hs,{size:14})})]})]})}function Hi(t){const e=N.c(14),{release:n,isSeen:r,onSelect:o}=t;let i;e[0]!==r?(i=!r&&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]=r,e[1]=i):i=e[1];let a;e[2]!==n.eyebrow?(a=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=a):a=e[3];let l;e[4]!==n.title?(l=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=l):l=e[5];let c;e[6]!==a||e[7]!==l?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[a,l]}),e[6]=a,e[7]=l,e[8]=c):c=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Xt,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=d):d=e[9];let u;return e[10]!==o||e[11]!==i||e[12]!==c?(u=s.jsxs("button",{type:"button",onClick:o,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,c,d]}),e[10]=o,e[11]=i,e[12]=c,e[13]=u):u=e[13],u}function Ui(){const t=O.useContext(Xn),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function sn(){const t=N.c(10),{isSeen:e,markSeen:n,unseenCount:r}=Gr(),o=Ui();let i;if(t[0]!==e||t[1]!==o){const c=[...o].sort(qi).map(Wi);let d;t[3]!==e?(d=m=>({type:"release",release:m,isSeen:e(m.id)}),t[3]=e,t[4]=d):d=t[4];const u=[...Br].sort(Ki).map(d);i=[...c,...u],t[0]=e,t[1]=o,t[2]=i}else i=t[2];const a=r+o.length;let l;return t[5]!==n||t[6]!==o||t[7]!==i||t[8]!==a?(l={items:i,pendingInvitations:o,redDotCount:a,markReleaseSeen:n},t[5]=n,t[6]=o,t[7]=i,t[8]=a,t[9]=l):l=t[9],l}function Ki(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function Wi(t){return{type:"invitation",invitation:t}}function qi(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}class nn extends O.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 rn(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Vi(){const t=N.c(17),e=Te(),{org:n}=fe(),{hasDecoKey:r,balanceDollars:o}=Us();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];let a;t[2]!==o?(a=K(o!=null&&rn(o)),t[2]=o,t[3]=a):a=t[3];let l;t[4]!==e||t[5]!==n.slug?(l=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=l):l=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ps,{}),t[7]=c):c=t[7];let d;t[8]!==o?(d=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,t[9]=d):d=t[9];let u;t[10]!==d?(u=s.jsx("span",{children:d}),t[10]=d,t[11]=u):u=t[11];let m;return t[12]!==i||t[13]!==a||t[14]!==l||t[15]!==u?(m=s.jsx($e,{children:s.jsx(xe,{children:s.jsxs(ke,{tooltip:i,className:a,onClick:l,children:[c,u]})})}),t[12]=i,t[13]=a,t[14]=l,t[15]=u,t[16]=m):m=t[16],m}function Yi(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(nn,{children:s.jsx(O.Suspense,{fallback:null,children:s.jsx(Vi,{})})}),t[0]=e):e=t[0],e}function Xi(){const t=N.c(17),e=Te(),{org:n}=fe(),{hasDecoKey:r,balanceDollars:o}=Us();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];const a=i;let l;t[2]!==e||t[3]!==n.slug?(l=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[2]=e,t[3]=n.slug,t[4]=l):l=t[4];let c;t[5]!==o?(c=K(o!=null&&rn(o)),t[5]=o,t[6]=c):c=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ps,{className:"size-4"}),t[7]=d):d=t[7];let u;t[8]!==l||t[9]!==c||t[10]!==a?(u=s.jsx(We,{asChild:!0,children:s.jsx(we,{"aria-label":a,onClick:l,className:c,children:d})}),t[8]=l,t[9]=c,t[10]=a,t[11]=u):u=t[11];let m;t[12]!==a?(m=s.jsx(qe,{side:"top",children:a}),t[12]=a,t[13]=m):m=t[13];let f;return t[14]!==u||t[15]!==m?(f=s.jsxs(Ve,{delayDuration:300,children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16],f}function Qi(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(nn,{children:s.jsx(O.Suspense,{fallback:null,children:s.jsx(Xi,{})})}),t[0]=e):e=t[0],e}function on(t){const e=N.c(15),{children:n}=t,{items:r,markReleaseSeen:o}=sn(),[i,a]=O.useState(null);let l;if(e[0]!==r||e[1]!==i){let x;e[3]!==i?(x=h=>h.type==="release"&&h.release.id===i,e[3]=i,e[4]=x):x=e[4],l=r.find(x),e[0]=r,e[1]=i,e[2]=l}else l=e[2];const c=l,d=c?.type==="release"?c.release:null;let u;e[5]!==o?(u=x=>{a(x),o(x)},e[5]=o,e[6]=u):u=e[6];const m=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=x=>{x||a(null)},e[7]=f):f=e[7];let g;e[8]!==m||e[9]!==r||e[10]!==d?(g=s.jsx(Dt,{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:d?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($t,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>a(null),children:s.jsx(Oo,{size:16})}),s.jsx("h3",{className:"text-sm font-medium truncate",children:d.title})]}),s.jsx("div",{className:"overflow-y-auto flex-1 p-5",children:s.jsx(Lr,{release:d})})]}):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"})}),r.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(Yt,{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 and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:r.map(x=>x.type==="invitation"?s.jsx(Li,{invitation:x.invitation},`inv-${x.invitation.id}`):s.jsx(Hi,{release:x.release,isSeen:x.isSeen,onSelect:()=>m(x.release.id)},`rel-${x.release.id}`))})]})}),e[8]=m,e[9]=r,e[10]=d,e[11]=g):g=e[11];let p;return e[12]!==n||e[13]!==g?(p=s.jsxs(Rt,{onOpenChange:f,children:[n,g]}),e[12]=n,e[13]=g,e[14]=p):p=e[14],p}function ln(){const{redDotCount:t}=sn();return t>0}function Zi(){const t=N.c(6),e=ln();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Yt,{}),t[0]=n):n=t[0];let r;t[1]!==e?(r=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]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{children:"Inbox"}),t[3]=o):o=t[3];let i;return t[4]!==r?(i=s.jsx(on,{children:s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{tooltip:"Inbox",className:"relative",children:[n,r,o]})})}),t[4]=r,t[5]=i):i=t[5],i}function Ji(){const t=N.c(8),e=ln();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Yt,{className:"size-4"}),t[0]=n):n=t[0];let r;t[1]!==e?(r=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]=r):r=t[2];let o;t[3]!==r?(o=s.jsx(ut,{asChild:!0,children:s.jsx(We,{asChild:!0,children:s.jsxs(we,{"aria-label":"Inbox",children:[n,r]})})}),t[3]=r,t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(qe,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let a;return t[6]!==o?(a=s.jsx(on,{children:s.jsxs(Ve,{delayDuration:300,children:[o,i]})}),t[6]=o,t[7]=a):a=t[7],a}function el(){const t=N.c(3),[e,n]=O.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(ke,{tooltip:"Connections",onClick:()=>{Z("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:[s.jsx(Ls,{}),s.jsx("span",{children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(Ks,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function tl(){const t=N.c(3),[e,n]=O.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Ve,{delayDuration:300,children:[s.jsx(We,{asChild:!0,children:s.jsx(we,{"aria-label":"Connections",onClick:()=>{Z("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(Ls,{className:"size-4"})})}),s.jsx(qe,{side:"top",children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(Ks,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function sl(){const t=N.c(7),e=Te(),{org:n}=fe();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pt,{}),i=s.jsx("span",{children:"Settings"}),t[3]=o,t[4]=i):(o=t[3],i=t[4]);let a;return t[5]!==r?(a=s.jsxs(ke,{tooltip:"Settings",onClick:r,children:[o,i]}),t[5]=r,t[6]=a):a=t[6],a}function nl(){const t=N.c(9),e=Te(),{org:n}=fe();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(pt,{className:"size-4"}),t[3]=o):o=t[3];let i;t[4]!==r?(i=s.jsx(We,{asChild:!0,children:s.jsx(we,{"aria-label":"Settings",onClick:r,children:o})}),t[4]=r,t[5]=i):i=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(qe,{side:"top",children:"Settings"}),t[6]=a):a=t[6];let l;return t[7]!==i?(l=s.jsxs(Ve,{delayDuration:300,children:[i,a]}),t[7]=i,t[8]=l):l=t[8],l}function rl(){const t=N.c(6),{state:e}=Xe();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Yi,{}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(xe,{children:s.jsx(el,{})}),t[1]=i):i=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(xe,{children:s.jsx(Zi,{})}),t[2]=a):a=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(xe,{children:s.jsx(sl,{})}),t[3]=l):l=t[3];let c;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(Lt,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs($e,{children:[i,a,l,s.jsx(xe,{children:s.jsx(Ut,{})})]})]}),t[4]=c):c=t[4],c}let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Lt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx($e,{children:s.jsx(xe,{children:s.jsx(Ut,{})})})}),s.jsx(nl,{}),s.jsx(Ji,{}),s.jsx(tl,{}),s.jsx(Qi,{})]})}),t[5]=r):r=t[5],r}function ol(){const t=N.c(8),e=Te(),{org:n}=fe(),{setOpenMobile:r}=Xe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx($e,{children:s.jsx(xe,{children:s.jsx(Ut,{})})})}),t[0]=o):o=t[0];let i;t[1]!==e||t[2]!==n.slug||t[3]!==r?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),r(!1)},t[1]=e,t[2]=n.slug,t[3]=r,t[4]=i):i=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(pt,{className:"size-4"}),t[5]=a):a=t[5];let l;return t[6]!==i?(l=s.jsx(Lt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[o,s.jsx(we,{"aria-label":"Settings",onClick:i,children:a})]})}),t[6]=i,t[7]=l):l=t[7],l}function il(t){const e=N.c(8),{virtualMcpId:n,size:r,showAutomationBadge:o}=t,i=r===void 0?"sm":r;let a;e[0]!==i||e[1]!==n?(a=n?s.jsx(ll,{virtualMcpId:n,size:i}):s.jsx(Oe,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=a):a=e[2];let l;e[3]!==o?(l=o&&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(Vs,{size:10,className:"text-white"})}),e[3]=o,e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==l?(c=s.jsxs("div",{className:"relative shrink-0",children:[a,l]}),e[5]=a,e[6]=l,e[7]=c):c=e[7],c}function ll(t){const e=N.c(6),{virtualMcpId:n,size:r}=t,o=ht(n);if(!o){let l;return e[0]!==r?(l=s.jsx(Oe,{icon:null,name:"?",size:r}),e[0]=r,e[1]=l):l=e[1],l}const i=o.icon??null;let a;return e[2]!==o.title||e[3]!==r||e[4]!==i?(a=s.jsx(Oe,{icon:i,name:o.title,size:r}),e[2]=o.title,e[3]=r,e[4]=i,e[5]=a):a=e[5],a}function al(t){const e=N.c(36),{open:n,onOpenChange:r}=t,[o,i]=O.useState(""),{org:a}=fe(),{setTaskId:l}=Es(),c=qs();let d,u,m;e[0]!==a.id||e[1]!==o?(m=o.trim(),u=Vt,d=qt.globalSearch(a.id,m),e[0]=a.id,e[1]=o,e[2]=d,e[3]=u,e[4]=m):(d=e[2],u=e[3],m=e[4]);const f=n&&m.length>0;let g;e[5]!==c||e[6]!==m?(g=async()=>await c.call("GLOBAL_SEARCH",{query:m,limit:20}),e[5]=c,e[6]=m,e[7]=g):g=e[7];let p;e[8]!==d||e[9]!==f||e[10]!==g?(p={queryKey:d,enabled:f,queryFn:g,staleTime:1e4},e[8]=d,e[9]=f,e[10]=g,e[11]=p):p=e[11];const{data:x,isFetching:h}=u(p);let v;e[12]!==x?.items?(v=x?.items??[],e[12]=x?.items,e[13]=v):v=e[13];const j=v;let y;e[14]!==r?(y=w=>{w||i(""),r(w)},e[14]=r,e[15]=y):y=e[15];const b=y;let S;e[16]!==b||e[17]!==l?(S=w=>{b(!1),l(w.id,w.virtual_mcp_id??void 0)},e[16]=b,e[17]=l,e[18]=S):S=e[18];const k=S;let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(qo,{className:"sr-only",children:[s.jsx(Vo,{children:"Search"}),s.jsx(Yo,{children:"Search across your organization's resources."})]}),e[19]=_):_=e[19];let C;e[20]!==o?(C=s.jsx(ei,{value:o,onValueChange:i,placeholder:"Search..."}),e[20]=o,e[21]=C):C=e[21];let I;e[22]!==k||e[23]!==h||e[24]!==j||e[25]!==m?(I=m?h&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Zo,{children:"No results."}):j.map(w=>w.type==="thread"?s.jsxs(Jo,{value:`thread:${w.id}:${w.title}`,onSelect:()=>k(w),className:"gap-2.5",children:[s.jsx(il,{virtualMcpId:w.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:w.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(w.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${w.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]=h,e[24]=j,e[25]=m,e[26]=I):I=e[26];let A;e[27]!==I?(A=s.jsx(ti,{children:I}),e[27]=I,e[28]=A):A=e[28];let P;e[29]!==C||e[30]!==A?(P=s.jsxs(Xo,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[_,s.jsxs(si,{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:[C,A]})]}),e[29]=C,e[30]=A,e[31]=P):P=e[31];let $;return e[32]!==b||e[33]!==n||e[34]!==P?($=s.jsx(Qo,{open:n,onOpenChange:b,children:P}),e[32]=b,e[33]=n,e[34]=P,e[35]=$):$=e[35],$}function cl(t){return t==="owner"||t==="admin"}function dl(){const t=N.c(11),{locator:e}=fe(),n=ni(),{data:r}=Ce.useSession(),o=r?.user?.id;let i;t[0]!==e?(i=qt.members(e),t[0]=e,t[1]=i):i=t[1];let a;t[2]!==n?(a=()=>n.organization.listMembers(),t[2]=n,t[3]=a):a=t[3];const l=!!o;let c;t[4]!==i||t[5]!==a||t[6]!==l?(c={queryKey:i,queryFn:a,enabled:l,staleTime:6e4},t[4]=i,t[5]=a,t[6]=l,t[7]=c):c=t[7];const{data:d}=Vt(c);let u;if(t[8]!==d?.data?.members||t[9]!==o){const f=(d?.data?.members??[]).find(g=>g.userId===o)?.role;u=cl(f??void 0),t[8]=d?.data?.members,t[9]=o,t[10]=u}else u=t[10];return u}var Qt="ContextMenu",[ul]=or(Qt,[Cs]),ce=Cs(),[ml,an]=ul(Qt),cn=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:o,modal:i=!0}=t,[a,l]=O.useState(!1),c=ce(e),d=nr(r),u=O.useCallback(m=>{l(m),d(m)},[d]);return s.jsx(ml,{scope:e,open:a,onOpenChange:u,modal:i,children:s.jsx(rr,{...c,dir:o,open:a,onOpenChange:u,modal:i,children:n})})};cn.displayName=Qt;var dn="ContextMenuTrigger",un=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=t,i=an(dn,n),a=ce(n),l=O.useRef({x:0,y:0}),c=O.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),d=O.useRef(0),u=O.useCallback(()=>window.clearTimeout(d.current),[]),m=f=>{l.current={x:f.clientX,y:f.clientY},i.onOpenChange(!0)};return O.useEffect(()=>u,[u]),O.useEffect(()=>{r&&u()},[r,u]),s.jsxs(s.Fragment,{children:[s.jsx(Qn,{...a,virtualRef:c}),s.jsx(Zn.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:xt(t.onContextMenu,f=>{u(),m(f),f.preventDefault()}),onPointerDown:r?t.onPointerDown:xt(t.onPointerDown,kt(f=>{u(),d.current=window.setTimeout(()=>m(f),700)})),onPointerMove:r?t.onPointerMove:xt(t.onPointerMove,kt(u)),onPointerCancel:r?t.onPointerCancel:xt(t.onPointerCancel,kt(u)),onPointerUp:r?t.onPointerUp:xt(t.onPointerUp,kt(u))})]})});un.displayName=dn;var fl="ContextMenuPortal",mn=t=>{const{__scopeContextMenu:e,...n}=t,r=ce(e);return s.jsx(tr,{...r,...n})};mn.displayName=fl;var fn="ContextMenuContent",xn=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=an(fn,n),i=ce(n),a=O.useRef(!1);return s.jsx(sr,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{t.onCloseAutoFocus?.(l),!l.defaultPrevented&&a.current&&l.preventDefault(),a.current=!1},onInteractOutside:l=>{t.onInteractOutside?.(l),!l.defaultPrevented&&!o.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xn.displayName=fn;var xl="ContextMenuGroup",hl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(ir,{...o,...r,ref:e})});hl.displayName=xl;var pl="ContextMenuLabel",gl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(lr,{...o,...r,ref:e})});gl.displayName=pl;var bl="ContextMenuItem",hn=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(Jn,{...o,...r,ref:e})});hn.displayName=bl;var jl="ContextMenuCheckboxItem",vl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(ar,{...o,...r,ref:e})});vl.displayName=jl;var yl="ContextMenuRadioGroup",Sl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(cr,{...o,...r,ref:e})});Sl.displayName=yl;var _l="ContextMenuRadioItem",Nl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(dr,{...o,...r,ref:e})});Nl.displayName=_l;var Cl="ContextMenuItemIndicator",wl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(ur,{...o,...r,ref:e})});wl.displayName=Cl;var kl="ContextMenuSeparator",pn=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(er,{...o,...r,ref:e})});pn.displayName=kl;var Il="ContextMenuArrow",Ml=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(mr,{...o,...r,ref:e})});Ml.displayName=Il;var Al="ContextMenuSubTrigger",$l=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(fr,{...o,...r,ref:e})});$l.displayName=Al;var Ol="ContextMenuSubContent",Tl=O.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(xr,{...o,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Tl.displayName=Ol;function kt(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var zl=cn,Pl=un,Rl=mn,Dl=xn,El=hn,Fl=pn;function gn(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(zl,{"data-slot":"context-menu",...n}),e[2]=n,e[3]=r):r=e[3],r}function bn(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(Pl,{"data-slot":"context-menu-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function jn(t){const e=N.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==r||e[6]!==o?(i=s.jsx(Rl,{children:s.jsx(Dl,{"data-slot":"context-menu-content",className:o,...r})}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}function It(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,inset:r,variant:i,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const a=i===void 0?"default":i;let l;e[5]!==n?(l=K("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),e[5]=n,e[6]=l):l=e[6];let c;return e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==a?(c=s.jsx(El,{"data-slot":"context-menu-item","data-inset":r,"data-variant":a,className:l,...o}),e[7]=r,e[8]=o,e[9]=l,e[10]=a,e[11]=c):c=e[11],c}function hs(t){const e=N.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("bg-border -mx-1 my-1 h-px",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==r||e[6]!==o?(i=s.jsx(Fl,{"data-slot":"context-menu-separator",className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}function vn(t){const e=N.c(26),{virtualMcpId:n,isOrgPinned:r,canManageOrgPin:o,onNewTaskInGroup:i,onShowSettings:a,onToggleOrgPin:l,onHideGroup:c}=t;let d;e[0]!==i||e[1]!==n?(d=()=>i(n),e[0]=i,e[1]=n,e[2]=d):d=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ne,{size:14,className:"mr-2"}),e[3]=u):u=e[3];let m;e[4]!==d?(m=s.jsxs(It,{onSelect:d,children:[u,"New task"]}),e[4]=d,e[5]=m):m=e[5];let f;e[6]!==a||e[7]!==n?(f=()=>a(n),e[6]=a,e[7]=n,e[8]=f):f=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(pt,{size:14,className:"mr-2"}),e[9]=g):g=e[9];let p;e[10]!==f?(p=s.jsxs(It,{onSelect:f,children:[g,"Settings"]}),e[10]=f,e[11]=p):p=e[11];let x;e[12]!==o||e[13]!==r||e[14]!==l||e[15]!==n?(x=o&&s.jsxs(s.Fragment,{children:[s.jsx(hs,{}),s.jsxs(It,{onSelect:()=>l(n,!r),children:[s.jsx(Pr,{size:14,className:"mr-2"}),r?"Unpin for all members":"Pin for all members"]})]}),e[12]=o,e[13]=r,e[14]=l,e[15]=n,e[16]=x):x=e[16];let h;e[17]!==r||e[18]!==c||e[19]!==n?(h=!r&&s.jsxs(s.Fragment,{children:[s.jsx(hs,{}),s.jsxs(It,{onSelect:()=>c(n),children:[s.jsx(To,{size:14,className:"mr-2"}),"Hide"]})]}),e[17]=r,e[18]=c,e[19]=n,e[20]=h):h=e[20];let v;return e[21]!==m||e[22]!==p||e[23]!==x||e[24]!==h?(v=s.jsxs(s.Fragment,{children:[m,p,x,h]}),e[21]=m,e[22]=p,e[23]=x,e[24]=h,e[25]=v):v=e[25],v}function Gl(t){return t==="ephemeral"||t.startsWith("thread:")}function Et(t){const e=N.c(45),{task:n,isActive:r,onClick:o,onArchive:i,showAutomationBadge:a,showAgentIcon:l,hideStatusIdle:c}=t,d=li(n.status),u=d.icon,m=n.metadata?.kind==="tool_call_run",f=ht(m?void 0:n.virtual_mcp_id);let g;e[0]!==f?(g=zo(f),e[0]=f,e[1]=g):g=e[1];const p=g;ci(6e4);const x=a||!!n.trigger_id,h=n.id,v="button",j=0;let y;e[2]!==o?(y=F=>{F.target===F.currentTarget&&(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),o())},e[2]=o,e[3]=y):y=e[3];const b=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let S;e[4]!==b?(S=K("group/row flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer transition-colors","focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",b),e[4]=b,e[5]=S):S=e[5];let k;e[6]!==m||e[7]!==l||e[8]!==f?.icon||e[9]!==f?.title?(k=l&&!m&&s.jsx(Oe,{icon:f?.icon??null,name:f?.title??"?",size:"2xs"}),e[6]=m,e[7]=l,e[8]=f?.icon,e[9]=f?.title,e[10]=k):k=e[10];let _;e[11]!==x?(_=x&&s.jsx(Vs,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[11]=x,e[12]=_):_=e[12];const C=n.title||"Untitled task";let I;e[13]!==C?(I=s.jsx("div",{className:"text-sm text-foreground truncate",children:C}),e[13]=C,e[14]=I):I=e[14];let A;e[15]!==I||e[16]!==_?(A=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[_,I]}),e[15]=I,e[16]=_,e[17]=A):A=e[17];let P;e[18]!==p||e[19]!==r||e[20]!==n.branch||e[21]!==n.updated_at?(P=n.updated_at&&s.jsxs("div",{className:K("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Gl(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):p?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[p.owner,"/",p.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:di(new Date(n.updated_at))})]}),e[18]=p,e[19]=r,e[20]=n.branch,e[21]=n.updated_at,e[22]=P):P=e[22];let $;e[23]!==A||e[24]!==P?($=s.jsxs("div",{className:"flex-1 min-w-0",children:[A,P]}),e[23]=A,e[24]=P,e[25]=$):$=e[25];const w="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",z=!c&&s.jsx("span",{className:"[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity group-hover/row:opacity-0","aria-label":d.label,children:s.jsx(u,{size:14,className:K(d.iconClassName,n.status==="in_progress"&&"animate-spin")})});let H;e[26]!==i?(H=F=>{F.stopPropagation(),i()},e[26]=i,e[27]=H):H=e[27];let T;e[28]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(hr,{size:14}),e[28]=T):T=e[28];let B;e[29]!==H?(B=s.jsx(We,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:H,className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:T})}),e[29]=H,e[30]=B):B=e[30];let R;e[31]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(qe,{side:"right",children:"Archive"}),e[31]=R):R=e[31];let L;e[32]!==B?(L=s.jsxs(Ve,{children:[B,R]}),e[32]=B,e[33]=L):L=e[33];let D;e[34]!==z||e[35]!==L?(D=s.jsxs("div",{className:w,children:[z,L]}),e[34]=z,e[35]=L,e[36]=D):D=e[36];let G;return e[37]!==o||e[38]!==$||e[39]!==D||e[40]!==y||e[41]!==S||e[42]!==k||e[43]!==n.id?(G=s.jsxs("div",{"data-task-id":h,role:v,tabIndex:j,onClick:o,onKeyDown:y,className:S,children:[k,$,D]}),e[37]=o,e[38]=$,e[39]=D,e[40]=y,e[41]=S,e[42]=k,e[43]=n.id,e[44]=G):G=e[44],G}function Zt(t){const e=N.c(10),{onClick:n,isFetching:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=K("flex items-center gap-2 px-2 py-1.5 rounded-md text-sm text-muted-foreground","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]=o):o=e[0];let i;e[1]!==r?(i=r&&s.jsx(Wt,{size:14,className:"animate-spin"}),e[1]=r,e[2]=i):i=e[2];const a=r?"Loading…":"Show more";let l;e[3]!==a?(l=s.jsx("span",{children:a}),e[3]=a,e[4]=l):l=e[4];let c;return e[5]!==r||e[6]!==n||e[7]!==i||e[8]!==l?(c=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:o,children:[i,l]}),e[5]=r,e[6]=n,e[7]=i,e[8]=l,e[9]=c):c=e[9],c}function Bl(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function Ll(t){return t.member==="mine"&&!t.currentUserId}const yn=4;let At=0;const Kt=[];function Hl(){for(;At<yn&&Kt.length>0;){const t=Kt.shift();t&&t()}}function Sn(t){return new Promise((e,n)=>{const r=()=>{At++,t().then(e,n).finally(()=>{At--,Hl()})};At<yn?r():Kt.push(r)})}const Ft=10;function ps(t,e,n,r,o){const i={hidden:!1};t==="agent"&&(i.virtual_mcp_id=e),r.member==="mine"&&r.currentUserId&&(i.created_by=r.currentUserId),r.type==="automation"&&(i.has_trigger=!0),r.type==="manual"&&(i.has_trigger=!1);const a={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return t==="status"&&(a.status=e),a}function Ul(t,e,n,r){let o=0;for(const i of t)Jt(i,e,n,r)&&o++;return o}function Bt(t,e,n,r){return Ul(t,e,n,r)}function Kl(t,e,n){const r=new Map;for(const o of t){const i=o.virtual_mcp_id;i&&Jt(o,e,i,n)&&r.set(i,(r.get(i)??0)+1)}return r}function Wl(t,e){return!!(t>=Ft||t===0&&e)}function gs(t,e){return t<e}function ql(t,e){return e===!1?!1:e===!0?!0:t}function Jt(t,e,n,r){return!(t.hidden||e==="agent"&&t.virtual_mcp_id!==n||e==="status"&&(t.status??"completed")!==n||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const Tt=new Map,Mt=new Map;function Vl(t,e){return e?t>=Ft?!0:null:!1}function bs(t){return Tt.get(t)}function Yl(t,e){Tt.set(t,e)}function Xl(t,e,n){const r=Tt.get(t);if(r!==void 0){n(r);return}let o=Mt.get(t);o||(o=Sn(e).then(i=>(Tt.set(t,i),Mt.delete(t),i)).catch(()=>(Mt.delete(t),Promise.reject(new Error("group probe failed")))),Mt.set(t,o)),o.then(n,()=>n(!1))}function js(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Ft,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Ql(t,e,n,r,o){let i=0;for(const a of t)e.has(a.id)||Jt(a,n,r,o)&&i++;return i}function es(t,e,n,r){const o=N.c(8),{org:i}=fe(),a=Bl(i.id,t,e,n);let l;o[0]!==n?(l=Ll(n),o[0]=n,o[1]=l):l=o[1];const c=l,[d,u]=O.useState({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==a&&u({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});const m=Er(),{threads:f,hasMore:g}=Ds(),p=r??Bt(f,t,e,n),x=Wl(p,g),h=Vl(p,g),v=qs();if(d.identity===a&&d.serverHasMore===null){const _=h??bs(a);_!==void 0&&u({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:_})}!c&&d.identity===a&&d.serverHasMore===null&&h===null&&bs(a)===void 0&&d.probeSubscribedIdentity!==a&&(u(_=>_.identity===a?{..._,isProbing:!0,probeSubscribedIdentity:a}:_),Xl(a,async()=>{const _=ps(t,e,0,n,1),C=await v.call("COLLECTION_THREADS_LIST",_),{totalCount:I}=js(C),A=Bt(m.threads.get(),t,e,n);return I===void 0?!1:gs(A,I)},_=>{u(C=>C.identity!==a?C:{...C,isProbing:!1,serverHasMore:_})}));const y=async function(){if(d.isFetching||d.isProbing||c)return;const C=a;u(I=>I.identity===C?{...I,isFetching:!0}:I);try{const I=Bt(f,t,e,n),A=ps(t,e,I,n,Ft),P=await Sn(()=>v.call("COLLECTION_THREADS_LIST",A)),{items:$,hasMore:w,totalCount:z}=js(P),H=new Set(f.map(Zl)),T=Ql($,H,t,e,n),B=I;m.mergeThreads($),u(R=>{if(R.identity!==C)return R;let L;return z!==void 0?L=gs(B+T,z):L=$.length===0||T===0?!1:w,Yl(C,L),{...R,isFetching:!1,serverHasMore:L}})}catch(I){const A=I,P=A instanceof Error?A.message:String(A);Ae.error(`Could not load more tasks: ${P}`),u($=>$.identity===C?{...$,isFetching:!1}:$)}},b=d.isFetching||d.isProbing,S=!c&&!b&&ql(x,d.serverHasMore);let k;return o[2]!==b||o[3]!==y||o[4]!==S||o[5]!==d.isProbing||o[6]!==d.serverHasMore?(k={hasMore:S,isFetching:b,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:y},o[2]=b,o[3]=y,o[4]=S,o[5]=d.isProbing,o[6]=d.serverHasMore,o[7]=k):k=o[7],k}function Zl(t){return t.id}function _n(t){const e=N.c(61),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,onSelectTask:a,onArchiveTask:l,onNewTaskInGroup:c,onShowSettings:d,onHideGroup:u,isOrgPinned:m,canManageOrgPin:f,onToggleOrgPin:g,sortable:p,groupVisibleCount:x}=t,h=m===void 0?!1:m,v=f===void 0?!1:f,j=ht(n),y=r[0];let b;e[0]!==y||e[1]!==c||e[2]!==a||e[3]!==n?(b=()=>{y?a(y):c(n)},e[0]=y,e[1]=c,e[2]=a,e[3]=n,e[4]=b):b=e[4];const S=b,k=p?.isDragging?!1:void 0;let _;e[5]!==p?.isDragging||e[6]!==n?(_=V=>{p?.isDragging||V&&Z("sidebar_group_hover_popover_opened",{virtual_mcp_id:n})},e[5]=p?.isDragging,e[6]=n,e[7]=_):_=e[7];const C=!!(y&&o&&y.id===o),I=p?"Drag to reorder":void 0;let A;e[8]!==p?(A=p?{...p.attributes,...p.listeners}:{},e[8]=p,e[9]=A):A=e[9];const P=p&&"cursor-pointer active:cursor-grabbing touch-none",$=p?.isDragging&&"cursor-grabbing";let w;e[10]!==$||e[11]!==P?(w=K("group-data-[state=collapsed]/sidebar:!size-10 group-data-[state=collapsed]/sidebar:!max-w-none group-data-[state=collapsed]/sidebar:!overflow-visible group-data-[state=collapsed]/sidebar:[&_svg]:opacity-100",P,$),e[10]=$,e[11]=P,e[12]=w):w=e[12];const z=j?.icon??null,H=j?.title??"?";let T;e[13]!==z||e[14]!==H?(T=s.jsx(Oe,{icon:z,name:H,size:"sm+",className:"rounded-lg"}),e[13]=z,e[14]=H,e[15]=T):T=e[15];let B;e[16]!==S||e[17]!==w||e[18]!==T||e[19]!==C||e[20]!==I||e[21]!==A?(B=s.jsx(xe,{children:s.jsx(bn,{asChild:!0,children:s.jsx(ri,{asChild:!0,children:s.jsx(ke,{onClick:S,isActive:C,title:I,...A,className:w,children:T})})})}),e[16]=S,e[17]=w,e[18]=T,e[19]=C,e[20]=I,e[21]=A,e[22]=B):B=e[22];const R=g??Jl;let L;e[23]!==v||e[24]!==h||e[25]!==u||e[26]!==c||e[27]!==d||e[28]!==R||e[29]!==n?(L=s.jsx(jn,{className:"w-56",children:s.jsx(vn,{virtualMcpId:n,isOrgPinned:h,canManageOrgPin:v,onNewTaskInGroup:c,onShowSettings:d,onToggleOrgPin:R,onHideGroup:u})}),e[23]=v,e[24]=h,e[25]=u,e[26]=c,e[27]=d,e[28]=R,e[29]=n,e[30]=L):L=e[30];let D;e[31]!==B||e[32]!==L?(D=s.jsxs(gn,{children:[B,L]}),e[31]=B,e[32]=L,e[33]=D):D=e[33];const G=j?.title??"Agent";let F;e[34]!==G?(F=s.jsx("span",{className:"truncate",children:G}),e[34]=G,e[35]=F):F=e[35];let E;e[36]!==c||e[37]!==n?(E=()=>c(n),e[36]=c,e[37]=n,e[38]=E):E=e[38];let W;e[39]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx(Ne,{size:14}),e[39]=W):W=e[39];let q;e[40]!==E?(q=s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:E,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground",children:W}),e[40]=E,e[41]=q):q=e[41];let X;e[42]!==F||e[43]!==q?(X=s.jsxs("div",{className:"flex items-center justify-between px-1 pb-1 text-xs font-medium",children:[F,q]}),e[42]=F,e[43]=q,e[44]=X):X=e[44];let re;e[45]!==o||e[46]!==i||e[47]!==x||e[48]!==l||e[49]!==a||e[50]!==r||e[51]!==n?(re=s.jsx(ea,{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:x,onSelectTask:a,onArchiveTask:l}),e[45]=o,e[46]=i,e[47]=x,e[48]=l,e[49]=a,e[50]=r,e[51]=n,e[52]=re):re=e[52];let Y;e[53]!==X||e[54]!==re?(Y=s.jsxs(oi,{side:"right",align:"start",sideOffset:8,className:"w-72 p-2",children:[X,re]}),e[53]=X,e[54]=re,e[55]=Y):Y=e[55];let oe;return e[56]!==D||e[57]!==Y||e[58]!==k||e[59]!==_?(oe=s.jsxs(ii,{open:k,openDelay:120,closeDelay:150,onOpenChange:_,children:[D,Y]}),e[56]=D,e[57]=Y,e[58]=k,e[59]=_,e[60]=oe):oe=e[60],oe}function Jl(){}function ea(t){const e=N.c(6),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:a,onSelectTask:l,onArchiveTask:c}=t,d=es("agent",n,i,a);let u;return e[0]!==o||e[1]!==c||e[2]!==l||e[3]!==d||e[4]!==r?(u=s.jsx("div",{className:"flex flex-col gap-0.5 max-h-[60vh] overflow-y-auto",children:r.length===0&&!d.hasMore&&!d.isFetching?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No tasks yet"}):s.jsxs(s.Fragment,{children:[r.map(m=>s.jsx(Et,{task:m,isActive:o===m.id,onClick:()=>l(m),onArchive:()=>c(m),showAutomationBadge:!!m.trigger_id},m.id)),(d.hasMore||d.isFetching)&&s.jsx(Zt,{onClick:()=>{d.loadMore()},isFetching:d.isFetching})]})}),e[0]=o,e[1]=c,e[2]=l,e[3]=d,e[4]=r,e[5]=u):u=e[5],u}function ta(t,e,n,r,o,i,a){const l=N.c(18),c=a===void 0?"expanded":a;let d;l[0]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:8}},l[0]=d):d=l[0];let u;l[1]===Symbol.for("react.memo_cache_sentinel")?(u={coordinateGetter:Eo},l[1]=u):u=l[1];const m=Po(ls(Do,d),ls(Ro,u));let f;l[2]!==r||l[3]!==o||l[4]!==e||l[5]!==t?(f=Wr(t,e,r,o),l[2]=r,l[3]=o,l[4]=e,l[5]=t,l[6]=f):f=l[6];const g=f;let p;l[7]!==i||l[8]!==n||l[9]!==o||l[10]!==e||l[11]!==g||l[12]!==c?(p=v=>{const{active:j,over:y}=v;if(!y||j.id===y.id)return;const b=String(j.id),S=String(y.id);if(!qr(b,S,o))return;const k=Vr(g,b,S),_=Yr(e,n,o,k);e==="org"?Xr(n.orgId,_):Qr(n,_),Z("sidebar_group_reordered",{virtual_mcp_id:b,over_virtual_mcp_id:S,surface:c,section:e}),i()},l[7]=i,l[8]=n,l[9]=o,l[10]=e,l[11]=g,l[12]=c,l[13]=p):p=l[13];const x=p;let h;return l[14]!==x||l[15]!==m||l[16]!==g?(h={sensors:m,sortableIds:g,handleDragEnd:x},l[14]=x,l[15]=m,l[16]=g,l[17]=h):h=l[17],h}function sa(t){const e=N.c(2),{collapsed:n}=t;if(n===void 0?!1:n){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"mx-auto my-1 h-px w-6 shrink-0 bg-border"}),e[0]=i):i=e[0],i}let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"my-1.5 h-px w-full shrink-0 bg-border"}),e[1]=o):o=e[1],o}function na(t){const e=N.c(12),{id:n,children:r}=t;let o;e[0]!==n?(o={id:n},e[0]=n,e[1]=o):o=e[1];const{attributes:i,listeners:a,setNodeRef:l,transform:c,transition:d,isDragging:u}=Ho(o);let m;if(e[2]!==i||e[3]!==r||e[4]!==u||e[5]!==a||e[6]!==l||e[7]!==c||e[8]!==d){const g={transform:Uo.Transform.toString(c),transition:d,zIndex:u?100:void 0};m=r({setNodeRef:l,style:g,isDragging:u,attributes:i,listeners:a}),e[2]=i,e[3]=r,e[4]=u,e[5]=a,e[6]=l,e[7]=c,e[8]=d,e[9]=m}else m=e[9];let f;return e[10]!==m?(f=s.jsx(s.Fragment,{children:m}),e[10]=m,e[11]=f):f=e[11],f}function vs(t){const e=N.c(18),{section:n,groups:r,orderScope:o,decopilotId:i,orgPinnedIds:a,onReorder:l,surface:c,renderGroup:d,renderSortable:u,renderFixed:m}=t,{sensors:f,sortableIds:g,handleDragEnd:p}=ta(r,n,o,i,a,l,c);if(r.length===0)return null;const x=g;let h;if(e[0]!==r||e[1]!==m||e[2]!==d||e[3]!==u||e[4]!==g){let y;e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==g?(y=b=>{const S=d(b);return g.includes(b.virtualMcpId)?s.jsx(na,{id:b.virtualMcpId,children:k=>{const{setNodeRef:_,style:C,isDragging:I,attributes:A,listeners:P}=k;return s.jsx("div",{ref:_,style:C,className:K(I&&"opacity-50"),children:u(S,{attributes:A,listeners:P,isDragging:I})})}},b.virtualMcpId):s.jsx("div",{children:m(S)},b.virtualMcpId)},e[6]=m,e[7]=d,e[8]=u,e[9]=g,e[10]=y):y=e[10],h=r.map(y),e[0]=r,e[1]=m,e[2]=d,e[3]=u,e[4]=g,e[5]=h}else h=e[5];let v;e[11]!==x||e[12]!==h?(v=s.jsx(Fo,{items:x,strategy:Go,children:h}),e[11]=x,e[12]=h,e[13]=v):v=e[13];let j;return e[14]!==p||e[15]!==f||e[16]!==v?(j=s.jsx(Bo,{sensors:f,collisionDetection:Lo,onDragEnd:p,children:v}),e[14]=p,e[15]=f,e[16]=v,e[17]=j):j=e[17],j}function Nn(t){const e=N.c(23),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:l,collapsedSeparator:c,renderGroup:d,renderSortable:u,renderFixed:m}=t;let f;if(e[0]!==c||e[1]!==o||e[2]!==n||e[3]!==a||e[4]!==r||e[5]!==i||e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==l){const{decopilot:g,orgPinned:p,user:x,toolCallRuns:h}=Zr(n,o,i),v=p.length>0&&x.length>0;let j;e[11]!==o||e[12]!==a||e[13]!==r||e[14]!==i||e[15]!==m||e[16]!==d||e[17]!==u||e[18]!==l?(j={orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:l,renderGroup:d,renderSortable:u,renderFixed:m},e[11]=o,e[12]=a,e[13]=r,e[14]=i,e[15]=m,e[16]=d,e[17]=u,e[18]=l,e[19]=j):j=e[19];const y=j;let b;e[20]!==c||e[21]!==v?(b=v&&s.jsx(sa,{collapsed:c}),e[20]=c,e[21]=v,e[22]=b):b=e[22],f=s.jsxs(s.Fragment,{children:[g&&m(d(g)),s.jsx(vs,{section:"org",groups:p,...y}),b,s.jsx(vs,{section:"user",groups:x,...y}),h&&m(d(h))]}),e[0]=c,e[1]=o,e[2]=n,e[3]=a,e[4]=r,e[5]=i,e[6]=m,e[7]=d,e[8]=u,e[9]=l,e[10]=f}else f=e[10];return f}function ra(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,renderGroup:l}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==a||e[3]!==r||e[4]!==i||e[5]!==l?(c=s.jsx(Nn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:"collapsed_rail",collapsedSeparator:!0,renderGroup:l,renderFixed:ia,renderSortable:oa}),e[0]=o,e[1]=n,e[2]=a,e[3]=r,e[4]=i,e[5]=l,e[6]=c):c=e[6],c}function oa(t,e){return s.jsx(_n,{...t,sortable:{attributes:e.attributes,listeners:e.listeners,isDragging:e.isDragging}},t.virtualMcpId)}function ia(t){return s.jsx(_n,{...t},t.virtualMcpId)}const la="sidebar.group.expanded.";function Cn(t,e){const n=N.c(3),[r,o]=pr(`${la}${t}`,e);let i;return n[0]!==r||n[1]!==o?(i=[r,o],n[0]=r,n[1]=o,n[2]=i):i=n[2],i}function wn(t){const e=N.c(59),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,onShowSettings:c,onHideGroup:d,isOrgPinned:u,canManageOrgPin:m,onToggleOrgPin:f,filters:g,groupVisibleCount:p,sortable:x}=t,h=u===void 0?!1:u,v=m===void 0?!1:m,[j,y]=Cn(n,!1),b=n===Fs,S=x?.isDragging??!1;let k;e[0]!==j||e[1]!==y?(k=function(){y(!j)},e[0]=j,e[1]=y,e[2]=k):k=e[2];const _=k;let C;e[3]!==b||e[4]!==x?(C=x&&!b?{...x.attributes,...x.listeners}:{},e[3]=b,e[4]=x,e[5]=C):C=e[5];let I;e[6]!==_?(I=E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),_())},e[6]=_,e[7]=I):I=e[7];const A=x&&!b&&"touch-none active:cursor-grabbing",P=S&&"shadow-md bg-accent/40 cursor-grabbing";let $;e[8]!==A||e[9]!==P?($=K("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",A,P),e[8]=A,e[9]=P,e[10]=$):$=e[10];let w;e[11]!==b||e[12]!==n?(w=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(ca,{virtualMcpId:n,isToolCallRuns:b})}),e[11]=b,e[12]=n,e[13]=w):w=e[13];let z;e[14]!==j?(z=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:j?s.jsx(Ys,{size:14}):s.jsx(Xt,{size:14})}),e[14]=j,e[15]=z):z=e[15];let H;e[16]!==z||e[17]!==w?(H=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[w,z]}),e[16]=z,e[17]=w,e[18]=H):H=e[18];let T;e[19]!==b||e[20]!==n?(T=s.jsx("span",{className:"flex-1 truncate",children:s.jsx(ua,{virtualMcpId:n,isToolCallRuns:b})}),e[19]=b,e[20]=n,e[21]=T):T=e[21];let B;e[22]!==b||e[23]!==l||e[24]!==n?(B=!b&&s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:E=>{E.stopPropagation(),l(n)},className:"opacity-0 group-hover/group:opacity-100 focus-visible:opacity-100 transition-opacity flex size-7 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(Ne,{size:14})}),e[22]=b,e[23]=l,e[24]=n,e[25]=B):B=e[25];let R;e[26]!==j||e[27]!==_||e[28]!==H||e[29]!==T||e[30]!==B||e[31]!==C||e[32]!==I||e[33]!==$?(R=s.jsxs("div",{...C,role:"button",tabIndex:0,"aria-expanded":j,onClick:_,onKeyDown:I,className:$,children:[H,T,B]}),e[26]=j,e[27]=_,e[28]=H,e[29]=T,e[30]=B,e[31]=C,e[32]=I,e[33]=$,e[34]=R):R=e[34];const L=R;let D;e[35]!==v||e[36]!==L||e[37]!==h||e[38]!==b||e[39]!==d||e[40]!==l||e[41]!==c||e[42]!==f||e[43]!==n?(D=b?L:s.jsxs(gn,{children:[s.jsx(bn,{asChild:!0,children:L}),s.jsx(jn,{className:"w-56",children:s.jsx(vn,{virtualMcpId:n,isOrgPinned:h,canManageOrgPin:v,onNewTaskInGroup:l,onShowSettings:c,onToggleOrgPin:f??aa,onHideGroup:d})})]}),e[35]=v,e[36]=L,e[37]=h,e[38]=b,e[39]=d,e[40]=l,e[41]=c,e[42]=f,e[43]=n,e[44]=D):D=e[44];let G;e[45]!==o||e[46]!==j||e[47]!==g||e[48]!==p||e[49]!==b||e[50]!==a||e[51]!==l||e[52]!==i||e[53]!==r||e[54]!==n?(G=j&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:b?r.map(E=>s.jsx(Et,{task:E,isActive:o===E.id,onClick:()=>i(E),onArchive:()=>a(E),showAutomationBadge:!!E.trigger_id},E.id)):s.jsx(fa,{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,filters:g,groupVisibleCount:p})}),e[45]=o,e[46]=j,e[47]=g,e[48]=p,e[49]=b,e[50]=a,e[51]=l,e[52]=i,e[53]=r,e[54]=n,e[55]=G):G=e[55];let F;return e[56]!==D||e[57]!==G?(F=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[D,G]}),e[56]=D,e[57]=G,e[58]=F):F=e[58],F}function aa(){}function ca(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Oe,{icon:null,name:"⚙",size:"2xs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(da,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function da(t){const e=N.c(4),{virtualMcpId:n}=t,r=ht(n);if(!r){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Oe,{icon:null,name:"?",size:"2xs"}),e[0]=a):a=e[0],a}const o=r.icon??null;let i;return e[1]!==r.title||e[2]!==o?(i=s.jsx(Oe,{icon:o,name:r.title,size:"2xs"}),e[1]=r.title,e[2]=o,e[3]=i):i=e[3],i}function ua(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(s.Fragment,{children:"Automation runs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(ma,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function ma(t){const e=N.c(2),{virtualMcpId:n}=t,o=ht(n)?.title??"Agent";let i;return e[0]!==o?(i=s.jsx(s.Fragment,{children:o}),e[0]=o,e[1]=i):i=e[1],i}function fa(t){const e=N.c(10),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,filters:c,groupVisibleCount:d}=t,u=es("agent",n,c,d),{isFetching:m,isProbing:f,loadMore:g,serverHasMore:p}=u,[x,h]=O.useState(!1);!x&&r.length===0&&p===!0&&!m&&!f&&(h(!0),queueMicrotask(()=>{g()}));const{hasMore:v}=u;let j;return e[0]!==o||e[1]!==v||e[2]!==m||e[3]!==g||e[4]!==a||e[5]!==l||e[6]!==i||e[7]!==r||e[8]!==n?(j=s.jsx(s.Fragment,{children:r.length===0?s.jsxs("button",{type:"button",onClick:()=>l(n),className:"flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer text-sm text-muted-foreground hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[s.jsx(Ne,{size:14}),s.jsx("span",{children:"New thread"})]}):s.jsxs(s.Fragment,{children:[r.map(y=>s.jsx(Et,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>a(y),showAutomationBadge:!!y.trigger_id},y.id)),(v||m)&&s.jsx(Zt,{onClick:()=>{g()},isFetching:m})]})}),e[0]=o,e[1]=v,e[2]=m,e[3]=g,e[4]=a,e[5]=l,e[6]=i,e[7]=r,e[8]=n,e[9]=j):j=e[9],j}function xa(t){const e=N.c(16),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:m,serverHasMore:f}=es("status",n,l),[g,p]=O.useState(!1);!g&&r.length===0&&f===!0&&!c&&!d&&(p(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==o||e[1]!==a||e[2]!==i||e[3]!==r){let j;e[5]!==o||e[6]!==a||e[7]!==i?(j=y=>s.jsx(Et,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>a(y),showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0},y.id),e[5]=o,e[6]=a,e[7]=i,e[8]=j):j=e[8],x=r.map(j),e[0]=o,e[1]=a,e[2]=i,e[3]=r,e[4]=x}else x=e[4];let h;e[9]!==m||e[10]!==c||e[11]!==u?(h=(m||c)&&s.jsx(Zt,{onClick:()=>{u()},isFetching:c}),e[9]=m,e[10]=c,e[11]=u,e[12]=h):h=e[12];let v;return e[13]!==x||e[14]!==h?(v=s.jsxs(s.Fragment,{children:[x,h]}),e[13]=x,e[14]=h,e[15]=v):v=e[15],v}function ha(t){const e=N.c(35),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l}=t,c=ai[n],d=c.icon,[u,m]=Cn(`status-${n}`,!1);let f;e[0]!==u||e[1]!==m?(f=function(){m(!u)},e[0]=u,e[1]=m,e[2]=f):f=e[2];const g=f;let p;e[3]!==g?(p=_=>{_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),g())},e[3]=g,e[4]=p):p=e[4];let x;e[5]!==d||e[6]!==c.iconClassName?(x=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(d,{size:12,className:c.iconClassName})}),e[5]=d,e[6]=c.iconClassName,e[7]=x):x=e[7];let h;e[8]!==u?(h=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:u?s.jsx(Ys,{size:14}):s.jsx(Xt,{size:14})}),e[8]=u,e[9]=h):h=e[9];let v;e[10]!==x||e[11]!==h?(v=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,h]}),e[10]=x,e[11]=h,e[12]=v):v=e[12];let j;e[13]!==c.label?(j=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=j):j=e[14];let y;e[15]!==r.length?(y=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:r.length})}),e[15]=r.length,e[16]=y):y=e[16];let b;e[17]!==u||e[18]!==g||e[19]!==p||e[20]!==v||e[21]!==j||e[22]!==y?(b=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:g,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:[v,j,y]}),e[17]=u,e[18]=g,e[19]=p,e[20]=v,e[21]=j,e[22]=y,e[23]=b):b=e[23];let S;e[24]!==o||e[25]!==u||e[26]!==l||e[27]!==a||e[28]!==i||e[29]!==n||e[30]!==r?(S=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(xa,{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l})}),e[24]=o,e[25]=u,e[26]=l,e[27]=a,e[28]=i,e[29]=n,e[30]=r,e[31]=S):S=e[31];let k;return e[32]!==b||e[33]!==S?(k=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[b,S]}),e[32]=b,e[33]=S,e[34]=k):k=e[34],k}function pa(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,renderGroup:l}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==a||e[3]!==r||e[4]!==i||e[5]!==l?(c=s.jsx(Nn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:"expanded",renderGroup:l,renderFixed:ba,renderSortable:ga}),e[0]=o,e[1]=n,e[2]=a,e[3]=r,e[4]=i,e[5]=l,e[6]=c):c=e[6],c}function ga(t,e){return s.jsx(wn,{...t,sortable:e},t.virtualMcpId)}function ba(t){return s.jsx(wn,{...t},t.virtualMcpId)}function ja(t,e,n,r){return[t.orgId,t.userId,r,n.slice().sort().join(","),e.map(o=>o.virtualMcpId).sort().join(",")].join("|")}function va(t,e,n,r,o){const i=N.c(5),a=ja(t,e,r,o),[l,c]=O.useState("");l!==a&&(Jr(t,e,n,r),c(a));let d;return i[0]!==n||i[1]!==r||i[2]!==t||i[3]!==e?(d=eo(t,e,n,r),i[0]=n,i[1]=r,i[2]=t,i[3]=e,i[4]=d):d=i[4],d}const kn={all:"All tasks",manual:"Chats",automation:"Automation"},In={all:"All members",mine:"Mine only"},ys={agent:"Agent",status:"Status"};function Mn(){const t=N.c(92),{data:e}=Ce.useSession(),n=e?.user?.id,r=n??"anon",{org:o}=fe(),i=Cr(o.id).id,l=zs().filter($a).map(Aa),c=dl(),d=wr();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u={},t[0]=u):u=t[0];const[m,f]=O.useState(u),g=new Set(l),p={},x=[];let h;t[1]!==m?(h=Object.entries(m),t[1]=m,t[2]=h):h=t[2];for(const[M,U]of h)g.has(M)!==U?p[M]=U:x.push(M);x.length>0&&f(M=>{const U={...M};for(const ne of x)delete U[ne];return U});const v=new Set(l);for(const[M,U]of Object.entries(p))U?v.add(M):v.delete(M);const j=[...v],y=new Set(j),{threads:b}=Ds(),S=b.filter(Ma),{hide:k}=Rs(),_=Te(),{setTaskId:C,createNewTask:I}=Es();let A;t[3]===Symbol.for("react.memo_cache_sentinel")?(A={strict:!1},t[3]=A):A=t[3];const $=Ns(A).taskId??null,w=[...S].sort(Ia),[z,H]=O.useState("all"),[T,B]=O.useState("mine"),[R,L]=O.useState("agent"),[D,G]=O.useState(!1),[F,E]=O.useState(!1),[W,q]=O.useState(0),X=to(),re=W+X;let Y;t[4]!==o.id||t[5]!==r?(Y={orgId:o.id,userId:r},t[4]=o.id,t[5]=r,t[6]=Y):Y=t[6];const oe=Y,V={type:z,member:T,currentUserId:n??null},J=Kl(w,"agent",V),Q=va(oe,so(w,i),i,j,re);let ee;t[7]!==n||t[8]!==T?(ee=M=>T==="mine"&&n?M.filter(U=>U.created_by===n):M,t[7]=n,t[8]=T,t[9]=ee):ee=t[9];const te=ee;let se;t[10]!==z?(se=M=>z==="automation"?M.filter(ka):z==="manual"?M.filter(wa):M,t[10]=z,t[11]=se):se=t[11];const ie=se,le=M=>{const U=M.id===$;if(k(M.id),!U)return;const ne=w.find(Se=>Se.id!==M.id&&Se.virtual_mcp_id===M.virtual_mcp_id);ne?C(ne.id,ne.virtual_mcp_id):_({to:"/$org",params:{org:o.slug}})};let Ie;t[12]!==I?(Ie=M=>{Z("sidebar_group_new_clicked",{virtual_mcp_id:M}),I(M)},t[12]=I,t[13]=Ie):Ie=t[13];const ze=Ie,Pe=no();let he;t[14]!==Pe?(he=M=>{Z("sidebar_group_settings_clicked",{virtual_mcp_id:M}),Pe(M,{search:{main:"instructions"}})},t[14]=Pe,t[15]=he):he=t[15];const Re=he,mt=M=>{if(y.has(M))return;Z("sidebar_group_hide_clicked",{virtual_mcp_id:M});const U=Q.find(ne=>ne.virtualMcpId===M);if(U)for(const ne of U.threads)k(ne.id);oo(oe,M,j),q(Ca)},De=async(M,U)=>{if(c&&p[M]===void 0){Z("sidebar_group_org_pin_toggled",{virtual_mcp_id:M,pinned:U}),f(ne=>({...ne,[M]:U}));try{await d.update.mutateAsync({id:M,data:{pinned:U}})}catch{io(oe,M,!U),f(ne=>{const Se={...ne};return delete Se[M],Se})}}},Ee=M=>{const U=M===i||M===Fs;return{isOrgPinned:y.has(M),canManageOrgPin:U?!1:c,onToggleOrgPin:U?void 0:De}},Me=M=>{const U=ie(te(M.threads));return{virtualMcpId:M.virtualMcpId,threads:U,activeTaskId:$,filters:V,groupVisibleCount:J.get(M.virtualMcpId)??0,onSelectTask:ne=>C(ne.id,ne.virtual_mcp_id),onArchiveTask:le,onNewTaskInGroup:ze,onShowSettings:Re,onHideGroup:mt,...Ee(M.virtualMcpId)}},ae=z!=="all"||T!=="mine",{state:Fe,isMobile:Ge}=Xe();if(Fe==="collapsed"&&!Ge){let M;if(t[16]!==ae||t[17]!==Q||t[18]!==te||t[19]!==ie){let dt;t[21]!==ae||t[22]!==te||t[23]!==ie?(dt=On=>{const Tn=ie(te(On.threads));return!(ae&&Tn.length===0)},t[21]=ae,t[22]=te,t[23]=ie,t[24]=dt):dt=t[24],M=Q.filter(dt),t[16]=ae,t[17]=Q,t[18]=te,t[19]=ie,t[20]=M}else M=t[20];const U=M,ne=R==="agent"&&Q.length===0;let Se;t[25]!==ne?(Se=s.jsx(rs,{value:ne}),t[25]=ne,t[26]=Se):Se=t[26];let Ct;return t[27]===Symbol.for("react.memo_cache_sentinel")?(Ct=()=>q(Na),t[27]=Ct):Ct=t[27],s.jsxs(s.Fragment,{children:[Se,s.jsx($e,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.jsx(ra,{groups:U,orderScope:oe,decopilotId:i,orgPinnedIds:j,onReorder:Ct,renderGroup:dt=>Me(dt)})})]})}const ft="flex flex-col h-full min-h-0",be=R==="agent"&&Q.length===0;let je;t[28]!==be?(je=s.jsx(rs,{value:be}),t[28]=be,t[29]=je):je=t[29];let ue;t[30]!==G?(ue=()=>{Z("tasks_panel_search_opened"),E(!0),G(!0)},t[30]=G,t[31]=ue):ue=t[31];let pe;t[32]===Symbol.for("react.memo_cache_sentinel")?(pe=s.jsx(Rr,{size:16}),t[32]=pe):pe=t[32];let me;t[33]!==ue?(me=s.jsx(we,{"aria-label":"Search threads",onClick:ue,children:pe}),t[33]=ue,t[34]=me):me=t[34];const Be=ys[R==="agent"?"status":"agent"];let ge;t[35]!==Be?(ge=Be.toLowerCase(),t[35]=Be,t[36]=ge):ge=t[36];const ve=`Group by ${ge}`,Le=ys[R];let de;t[37]!==Le?(de=Le.toLowerCase(),t[37]=Le,t[38]=de):de=t[38];const He=`Grouped by ${de}`;let ye,Ue;t[39]!==R?(ye=()=>{const M=R==="agent"?"status":"agent";Z("tasks_panel_group_by_changed",{to_value:M}),L(M)},Ue=R==="agent"?s.jsx(Wo,{size:16}):s.jsx(Dr,{size:16}),t[39]=R,t[40]=ye,t[41]=Ue):(ye=t[40],Ue=t[41]);let Ke;t[42]!==ve||t[43]!==He||t[44]!==ye||t[45]!==Ue?(Ke=s.jsx(we,{"aria-label":ve,title:He,onClick:ye,children:Ue}),t[42]=ve,t[43]=He,t[44]=ye,t[45]=Ue,t[46]=Ke):Ke=t[46];let Qe;t[47]===Symbol.for("react.memo_cache_sentinel")?(Qe=s.jsx(Ko,{size:16}),t[47]=Qe):Qe=t[47];let Ze;t[48]!==ae?(Ze=ae&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 ring-1 ring-sidebar pointer-events-none"}),t[48]=ae,t[49]=Ze):Ze=t[49];let Je;t[50]!==Ze?(Je=s.jsx(ut,{asChild:!0,children:s.jsxs(we,{"aria-label":"Filter tasks",children:[Qe,Ze]})}),t[50]=Ze,t[51]=Je):Je=t[51];let et;t[52]!==T?(et=M=>{const U=M;U!==T&&Z("tasks_panel_member_filter_changed",{to_value:U}),B(U)},t[52]=T,t[53]=et):et=t[53];let gt;t[54]===Symbol.for("react.memo_cache_sentinel")?(gt=s.jsx(cs,{size:"sm",className:"w-full",children:s.jsx(ds,{})}),t[54]=gt):gt=t[54];let bt;t[55]===Symbol.for("react.memo_cache_sentinel")?(bt=Object.keys(In),t[55]=bt):bt=t[55];let jt;t[56]===Symbol.for("react.memo_cache_sentinel")?(jt=s.jsx(as,{children:bt.map(_a)}),t[56]=jt):jt=t[56];let tt;t[57]!==T||t[58]!==et?(tt=s.jsx(Ss,{label:"Members",children:s.jsxs(us,{value:T,onValueChange:et,children:[gt,jt]})}),t[57]=T,t[58]=et,t[59]=tt):tt=t[59];let st;t[60]!==z?(st=M=>{const U=M;U!==z&&Z("tasks_panel_filter_changed",{to_value:U}),H(U)},t[60]=z,t[61]=st):st=t[61];let vt;t[62]===Symbol.for("react.memo_cache_sentinel")?(vt=s.jsx(cs,{size:"sm",className:"w-full",children:s.jsx(ds,{})}),t[62]=vt):vt=t[62];let yt;t[63]===Symbol.for("react.memo_cache_sentinel")?(yt=Object.keys(kn),t[63]=yt):yt=t[63];let St;t[64]===Symbol.for("react.memo_cache_sentinel")?(St=s.jsx(as,{children:yt.map(Sa)}),t[64]=St):St=t[64];let nt;t[65]!==st||t[66]!==z?(nt=s.jsx(Ss,{label:"Type",children:s.jsxs(us,{value:z,onValueChange:st,children:[vt,St]})}),t[65]=st,t[66]=z,t[67]=nt):nt=t[67];let rt;t[68]!==tt||t[69]!==nt?(rt=s.jsx(Dt,{align:"start",sideOffset:8,collisionPadding:16,className:"w-72 p-3",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[tt,nt]})}),t[68]=tt,t[69]=nt,t[70]=rt):rt=t[70];let ot;t[71]!==Je||t[72]!==rt?(ot=s.jsxs(Rt,{children:[Je,rt]}),t[71]=Je,t[72]=rt,t[73]=ot):ot=t[73];let it;t[74]!==me||t[75]!==Ke||t[76]!==ot?(it=s.jsxs("div",{className:"flex items-center gap-0.5",children:[me,Ke,ot]}),t[74]=me,t[75]=Ke,t[76]=ot,t[77]=it):it=t[77];let _t;t[78]===Symbol.for("react.memo_cache_sentinel")?(_t=s.jsx(Xs,{compact:!0}),t[78]=_t):_t=t[78];let lt;t[79]!==it?(lt=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[it,_t]}),t[79]=it,t[80]=lt):lt=t[80];const $n="flex-1 min-h-0 overflow-y-auto overscroll-contain flex flex-col gap-0.5 -mr-2 pr-2",Gt=R==="status"?s.jsx(s.Fragment,{children:ro(ie(te(w))).map(M=>s.jsx(ha,{status:M.status,threads:M.threads,activeTaskId:$,onSelectTask:U=>C(U.id,U.virtual_mcp_id),onArchiveTask:le,filters:V},M.status))}):s.jsx(pa,{groups:Q,orderScope:oe,decopilotId:i,orgPinnedIds:j,onReorder:()=>q(ya),renderGroup:M=>({...Me(M)})});let at;t[81]!==Gt?(at=s.jsx("div",{className:$n,children:Gt}),t[81]=Gt,t[82]=at):at=t[82];let ct;t[83]!==F||t[84]!==D||t[85]!==G?(ct=F&&s.jsx(al,{open:D,onOpenChange:G}),t[83]=F,t[84]=D,t[85]=G,t[86]=ct):ct=t[86];let Nt;return t[87]!==je||t[88]!==lt||t[89]!==at||t[90]!==ct?(Nt=s.jsxs("div",{className:ft,children:[je,lt,at,ct]}),t[87]=je,t[88]=lt,t[89]=at,t[90]=ct,t[91]=Nt):Nt=t[91],Nt}function ya(t){return t+1}function Sa(t){return s.jsx(Ws,{value:t,children:kn[t]},t)}function _a(t){return s.jsx(Ws,{value:t,children:In[t]},t)}function Na(t){return t+1}function Ca(t){return t+1}function wa(t){return!t.trigger_id}function ka(t){return!!t.trigger_id}function Ia(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Ma(t){return!t.hidden}function Aa(t){return t.id}function $a(t){return t.pinned}function Ss(t){const e=N.c(7),{label:n,children:r}=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 i;e[2]!==r?(i=s.jsx("div",{className:"w-36 shrink-0",children:r}),e[2]=r,e[3]=i):i=e[3];let a;return e[4]!==o||e[5]!==i?(a=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,i]}),e[4]=o,e[5]=i,e[6]=a):a=e[6],a}const Oa=5,Ta=[{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 An(){const t=N.c(3),{state:e}=Xe();if(e==="collapsed"){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:Oa}).map(Ra)}),t[0]=o):o=t[0],o}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(_e,{className:"size-6 rounded-md"}),s.jsx(_e,{className:"size-6 rounded-md"}),s.jsx(_e,{className:"size-6 rounded-md"})]}),s.jsx(_e,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=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:Ta.map(za)})]}),t[2]=r):r=t[2],r}function za(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(_e,{className:"size-5 rounded-full shrink-0"}),s.jsx(_e,{className:K("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(Pa)})]},e)}function Pa(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(_e,{className:"h-3 flex-1 rounded-sm"})},e)}function Ra(t,e){return s.jsx(_e,{className:"size-10 rounded-lg mx-auto"},e)}function Pc(){const t=N.c(4),e=Qs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(rl,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ws,{children:s.jsxs(O.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(An,{})]}),children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(Mn,{})]})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsx(Gs,{children:s.jsx(en,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=o):o=t[3],o}function Rc(t){const e=N.c(5),{onClose:n}=t,r=Qs();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ol,{}),e[0]=o):o=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ws,{children:s.jsxs(O.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(An,{})]}),children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(Mn,{})]})}),e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==r?(a=s.jsx(Gs,{children:s.jsx(Mi,{sections:r,onClose:n,footer:o,additionalContent:i})}),e[2]=n,e[3]=r,e[4]=a):a=e[4],a}function Dc(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{"data-testid":"shell-route-loading",className:"absolute inset-0 flex items-center justify-center",children:s.jsx(Wt,{size:20,className:"animate-spin text-muted-foreground"})}),t[0]=e):e=t[0],e}export{bn as C,Pc as S,Rc as a,Dc as b,It as c,hs as d,jn as e,gn as f};
@@ -1 +0,0 @@
1
- import{e as D,j as s,E as le,r as K,q as ae,G as ce,f as de,g as me,B as Y,t as te,K as fe,a as ge,o as ie}from"./index-DxLTuX83.js";import{i as ue}from"./AlertCircle-B5QG7wg7.js";import{i as pe}from"./ChevronRight-Betyx6_9.js";import{s as xe}from"./Plus-wat9tYeJ.js";import{s as he}from"./Trash01-YuwiLEVo.js";import{I as X}from"./input-3FcnQKag.js";import{S as oe}from"./switch-B2R8Oovd.js";import{S as ye}from"./skeleton-Dvzf2GQP.js";import{A as ne}from"./avatar-BZq-o3M_.js";import{P as je,a as Ce,b as Se}from"./popover-DpnBmU5u.js";import{b as re}from"./use-connection-DIX015NP.js";import{W as Z}from"./use-mcp-client-B7YSHa6V.js";import{P as G}from"./index-DM719JZt.js";import{u as ve}from"./use-registry-connections-BIDj-EVl.js";import{g as _e,h as be}from"./use-organization-settings-mMiPWte8.js";import{c as Pe,b as I,S as ee,a as Q}from"./settings-section-BxOSnd7f.js";import{R as Re}from"./require-capability-BolUdzxs.js";import"./User01-CUMpCZVS.js";import"./use-collections-CUoYyXrz.js";import"./sidebar-DILd2AwV.js";import"./LayoutLeft-BdQI12mG.js";import"./tooltip-D1D9JHhD.js";import"./sheet-BZaR5cN8.js";import"./X-D1kqmcok.js";import"./card-_9LUJQRQ.js";import"./ArrowUpRight-Ce95HJs8.js";import"./use-capability-DDDjfOOE.js";import"./access-gate-DfmEpXgP.js";import"./capability-load-error-BqquNR5_.js";function ke(t){const e=D.c(3),{error:o}=t;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ue,{size:16}),e[0]=m):m=e[0];let n;return e[1]!==o.message?(n=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[m,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load store settings: ",o.message]})]}),e[1]=o.message,e[2]=n):n=e[2],n}function we(t){const e=D.c(36),{onCancel:o,onSuccess:m}=t,n=re(),[r,j]=K.useState(""),[a,S]=K.useState(""),[x,v]=K.useState("");let h;e[0]!==n||e[1]!==r||e[2]!==x||e[3]!==a?(h=async()=>(await n.create.mutateAsync({title:r||"Private Registry",description:"Private MCP registry",connection_type:"HTTP",connection_url:a,connection_token:x||null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{type:"registry"},app_name:null,app_id:null,icon:null})).id,e[0]=n,e[1]=r,e[2]=x,e[3]=a,e[4]=h):h=e[4];let f;e[5]!==m?(f=C=>{te("store_private_registry_added",{connection_id:C}),ie.success("Private registry added"),m(C)},e[5]=m,e[6]=f):f=e[6];let y;e[7]!==h||e[8]!==f?(y={mutationFn:h,onSuccess:f,onError:Ne},e[7]=h,e[8]=f,e[9]=y):y=e[9];const{mutate:c,isPending:d}=ge(y);let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=C=>j(C.target.value),e[10]=g):g=e[10];let u;e[11]!==r?(u=s.jsx(I,{title:"Name",action:s.jsx(X,{placeholder:"e.g. Acme Corp Registry",value:r,onChange:g,className:"w-[280px]"})}),e[11]=r,e[12]=u):u=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=C=>S(C.target.value),e[13]=p):p=e[13];let l;e[14]!==a?(l=s.jsx(I,{title:"Registry URL",action:s.jsx(X,{placeholder:"https://registry.example.com/mcp",value:a,onChange:p,className:"w-[280px]"})}),e[14]=a,e[15]=l):l=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=C=>v(C.target.value),e[16]=_):_=e[16];let b;e[17]!==x?(b=s.jsx(I,{title:"Auth Token",description:"Optional",action:s.jsx(X,{type:"password",placeholder:"Bearer token...",value:x,onChange:_,className:"w-[280px]"})}),e[17]=x,e[18]=b):b=e[18];let k;e[19]!==d||e[20]!==o?(k=s.jsx(Y,{variant:"ghost",size:"sm",onClick:o,disabled:d,children:"Cancel"}),e[19]=d,e[20]=o,e[21]=k):k=e[21];let N;e[22]!==c?(N=()=>c(),e[22]=c,e[23]=N):N=e[23];const O=!a||d,B=d?"Adding...":"Add Registry";let A;e[24]!==N||e[25]!==O||e[26]!==B?(A=s.jsx(Y,{size:"sm",onClick:N,disabled:O,children:B}),e[24]=N,e[25]=O,e[26]=B,e[27]=A):A=e[27];let R;e[28]!==k||e[29]!==A?(R=s.jsxs("div",{className:"px-5 py-4 flex justify-end gap-2",children:[k,A]}),e[28]=k,e[29]=A,e[30]=R):R=e[30];let P;return e[31]!==R||e[32]!==u||e[33]!==l||e[34]!==b?(P=s.jsxs(Q,{children:[u,l,b,R]}),e[31]=R,e[32]=u,e[33]=l,e[34]=b,e[35]=P):P=e[35],P}function Ne(t){ie.error(`Failed to add registry: ${t.message}`)}function L(t){const e=D.c(29),{name:o,description:m,icon:n,enabled:r,onToggle:j,onDelete:a,href:S}=t,x=de();let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v={from:"/shell/$org"},e[0]=v):v=e[0];const{org:h}=me(v);let f;e[1]!==r||e[2]!==S||e[3]!==x||e[4]!==j||e[5]!==h?(f=()=>{S?x({to:S,params:{org:h}}):j(!r)},e[1]=r,e[2]=S,e[3]=x,e[4]=j,e[5]=h,e[6]=f):f=e[6];const y=f;let c;e[7]!==n||e[8]!==o?(c=n?s.jsx("img",{src:n,alt:o,className:"size-8 rounded-md object-contain"}):s.jsx(ne,{fallback:o.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[7]=n,e[8]=o,e[9]=c):c=e[9];let d;e[10]!==a?(d=a&&s.jsxs(je,{children:[s.jsx(Ce,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:Me,children:s.jsx(he,{size:14})})}),s.jsx(Se,{className:"w-auto p-2",align:"end",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-xs font-medium",children:"Remove this registry?"}),s.jsx(Y,{variant:"destructive",size:"xs",onClick:b=>{b.stopPropagation(),a()},children:"Remove"})]})})]}),e[10]=a,e[11]=d):d=e[11];let g;e[12]!==j?(g=b=>j(b),e[12]=j,e[13]=g):g=e[13];let u;e[14]!==r||e[15]!==g?(u=s.jsx(oe,{checked:r,onClick:Ae,onCheckedChange:g}),e[14]=r,e[15]=g,e[16]=u):u=e[16];let p;e[17]!==S?(p=S&&s.jsx(pe,{size:14,className:"text-muted-foreground"}),e[17]=S,e[18]=p):p=e[18];let l;e[19]!==d||e[20]!==u||e[21]!==p?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[d,u,p]}),e[19]=d,e[20]=u,e[21]=p,e[22]=l):l=e[22];let _;return e[23]!==m||e[24]!==y||e[25]!==o||e[26]!==c||e[27]!==l?(_=s.jsx(I,{title:o,description:m,onClick:y,icon:c,action:l}),e[23]=m,e[24]=y,e[25]=o,e[26]=c,e[27]=l,e[28]=_):_=e[28],_}function Ae(t){return t.stopPropagation()}function Me(t){return t.stopPropagation()}function Te(){const t=D.c(59),{org:e}=ae(),o=ve(),m=re(),n=_e(),{mutateAsync:r}=be(),j=ce(),[a,S]=K.useState(!1);let x,v,h,f,y,c;if(t[0]!==m||t[1]!==e.id||t[2]!==j||t[3]!==n||t[4]!==o||t[5]!==a||t[6]!==r){const p=Z.REGISTRY(e.id),l=i=>{if(!n)return i===p;const w=n.registries[i];return w?w.enabled:i===p},_=Z.COMMUNITY_REGISTRY(e.id),b=o.find(i=>i.id===p),k=o.find(i=>i.id===_||i.id==="community-registry"),N=k?.id??_,O=Z.SELF(e.id),B=new Set([p,_,"community-registry",O]),A=o.filter(i=>!B.has(i.id));let R;t[13]!==n||t[14]!==r?(R=async(i,w)=>{te("store_registry_toggled",{connection_id:i,enabled:w});const se=n??{registries:{},blockedMcps:[]};await r({...se,registries:{...se.registries,[i]:{enabled:w}}})},t[13]=n,t[14]=r,t[15]=R):R=t[15];const P=R;let C;t[16]!==m||t[17]!==e.id||t[18]!==j?(C=async i=>{te("store_private_registry_removed",{connection_id:i}),await m.delete.mutateAsync(i),j.invalidateQueries({queryKey:fe.organizationSettings(e.id)})},t[16]=m,t[17]=e.id,t[18]=j,t[19]=C):C=t[19];const W=C;let q;t[20]!==n||t[21]!==r?(q=async i=>{S(!1);const w=n??{registries:{},blockedMcps:[]};await r({...w,registries:{...w.registries,[i]:{enabled:!0}}})},t[20]=n,t[21]=r,t[22]=q):q=t[22];const H=q,J=b?s.jsx(L,{name:"Deco Store",description:"Official deco MCP registry with curated integrations",icon:b.icon,enabled:l(p),onToggle:i=>P(p,i)}):s.jsx(I,{title:"Deco Store",description:"Connection not found — will be created automatically."});t[23]!==J?(y=s.jsx(ee,{title:"Deco Store",children:s.jsx(Q,{children:J})}),t[23]=J,t[24]=y):y=t[24];let M;t[25]!==a?(M=a?void 0:s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>S(!0),children:[s.jsx(xe,{size:14}),"Add registry"]}),t[25]=a,t[26]=M):M=t[26];let T;t[27]!==H||t[28]!==a?(T=a&&s.jsx(we,{onCancel:()=>S(!1),onSuccess:H}),t[27]=H,t[28]=a,t[29]=T):T=t[29];let z;t[30]!==l?(z=l("self"),t[30]=l,t[31]=z):z=t[31];let E;t[32]!==P?(E=i=>P("self",i),t[32]=P,t[33]=E):E=t[33];let $;t[34]!==z||t[35]!==E?($=s.jsx(L,{name:"Private Registry",description:"Your organization's private MCP registry",enabled:z,onToggle:E,href:"/$org/settings/store/registry"}),t[34]=z,t[35]=E,t[36]=$):$=t[36];let U;t[37]!==W||t[38]!==P||t[39]!==l?(U=i=>s.jsx(L,{name:i.title,description:i.description??"Private MCP registry",icon:i.icon,enabled:l(i.id),onToggle:w=>P(i.id,w),onDelete:()=>W(i.id)},i.id),t[37]=W,t[38]=P,t[39]=l,t[40]=U):U=t[40];const V=A.map(U);let F;t[41]!==$||t[42]!==V?(F=s.jsxs(Q,{children:[$,V]}),t[41]=$,t[42]=V,t[43]=F):F=t[43],t[44]!==F||t[45]!==M||t[46]!==T?(c=s.jsxs(ee,{title:"Private Registries",actions:M,children:[T,F]}),t[44]=F,t[45]=M,t[46]=T,t[47]=c):c=t[47],v=ee,f="Community",x=Q,h=k?s.jsx(L,{name:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",icon:k.icon,enabled:l(N),onToggle:i=>P(N,i)}):s.jsx(I,{title:"MCP Registry",description:"Community MCP registry — not yet added",icon:s.jsx(ne,{fallback:"M",className:"size-8 bg-primary/10 text-primary"}),action:s.jsx(oe,{checked:!1,disabled:!0,onCheckedChange:ze})}),t[0]=m,t[1]=e.id,t[2]=j,t[3]=n,t[4]=o,t[5]=a,t[6]=r,t[7]=x,t[8]=v,t[9]=h,t[10]=f,t[11]=y,t[12]=c}else x=t[7],v=t[8],h=t[9],f=t[10],y=t[11],c=t[12];let d;t[48]!==x||t[49]!==h?(d=s.jsx(x,{children:h}),t[48]=x,t[49]=h,t[50]=d):d=t[50];let g;t[51]!==v||t[52]!==f||t[53]!==d?(g=s.jsx(v,{title:f,children:d}),t[51]=v,t[52]=f,t[53]=d,t[54]=g):g=t[54];let u;return t[55]!==y||t[56]!==c||t[57]!==g?(u=s.jsxs(s.Fragment,{children:[y,c,g]}),t[55]=y,t[56]=c,t[57]=g,t[58]=u):u=t[58],u}function ze(){}function Ee(){const t=D.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ye,{className:"h-64 w-full"}),t[0]=e):e=t[0];let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(le,{fallback:$e,children:s.jsx(K.Suspense,{fallback:e,children:s.jsx(G,{children:s.jsx(G.Content,{children:s.jsx(G.Body,{children:s.jsxs(Pe,{children:[s.jsx(G.Title,{children:"Store"}),s.jsx(Te,{})]})})})})})}),t[1]=o):o=t[1],o}function $e(t){const{error:e}=t;return s.jsx(ke,{error:e??new Error("Failed to load store settings")})}function mt(){const t=D.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Re,{capability:"registry:manage",area:"the store",children:s.jsx(Ee,{})}),t[0]=e):e=t[0],e}export{mt as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-BMV-48W2.js","assets/index-DxLTuX83.js","assets/index-DfYyH4IW.css","assets/XCircle-Ds6l9Vuw.js","assets/CheckCircle-BiLWpS6e.js","assets/Container-Byi81M5N.js","assets/Settings02-8XjUg3gM.js","assets/use-mcp-client-B7YSHa6V.js","assets/useInfiniteQuery-Du3dTl6W.js","assets/use-infinite-scroll-BmPWzVgW.js","assets/studio-tools-qhNYzbg-.js","assets/badge-DBQKr8ze.js","assets/input-3FcnQKag.js","assets/dropdown-menu-CCeLALQe.js","assets/Check-CV74Rqqs.js","assets/ChevronRight-Betyx6_9.js","assets/DotsVertical-CuchmOf0.js","assets/table-BHblf7Co.js","assets/toggle-group-DzrJraBm.js","assets/use-view-mode-CQiQ9BoV.js","assets/tooltip-D1D9JHhD.js","assets/FilterLines-DuHSJmFt.js","assets/Globe01-Ds0ZgQYM.js","assets/SearchMd-BoptgjAM.js","assets/dialog-DilC5A4p.js","assets/X-D1kqmcok.js","assets/AlertCircle-B5QG7wg7.js","assets/Upload01-aGUy8jUM.js","assets/alert-dialog-nDI1xJhR.js","assets/card-_9LUJQRQ.js","assets/Trash01-YuwiLEVo.js","assets/label-Cv-qQXYd.js","assets/select-C0Tyz9qJ.js","assets/ChevronDown-XKMoQgX6.js","assets/ChevronUp-CGfhqWp1.js","assets/switch-B2R8Oovd.js","assets/textarea-CZOXZ6_T.js","assets/RefreshCcw01-D-1V89vv.js","assets/checkbox-BoVEsaTu.js","assets/Eye-RSaOlPZv.js","assets/LinkExternal01-D7swM7zC.js","assets/use-copy-B_iKACkn.js","assets/Key01-CStdo5WX.js","assets/Plus-wat9tYeJ.js","assets/Play-1bLCgUWF.js"])))=>i.map(i=>d[i]);
2
- import{e as m,f as n,g as c,j as t,l as f,r as l,_ as p}from"./index-DxLTuX83.js";import{R as u}from"./require-capability-BolUdzxs.js";import"./use-capability-DDDjfOOE.js";import"./access-gate-DfmEpXgP.js";import"./capability-load-error-BqquNR5_.js";const g=l.lazy(()=>p(()=>import("./registry-layout-BMV-48W2.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44])));function j(){const e=m.c(5),i=n();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},e[0]=s):s=e[0];const{org:o}=c(s);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"h-full flex items-center justify-center",children:t.jsx(f,{size:20,className:"animate-spin text-muted-foreground"})}),e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==o?(a=t.jsx(u,{capability:"registry:manage",area:"the registry",children:t.jsx(l.Suspense,{fallback:r,children:t.jsx(g,{onBack:()=>i({to:"/$org/settings/store",params:{org:o}})})})}),e[2]=i,e[3]=o,e[4]=a):a=e[4],a}export{j as default};
@@ -1 +0,0 @@
1
- import{e as h,q as I,K as T,s as C,M as b,v as k,C as N,j as o}from"./index-DxLTuX83.js";import{B as x}from"./badge-DBQKr8ze.js";import{b as y,T as j,a as g,c as S}from"./tooltip-D1D9JHhD.js";import{g as _}from"./types-DsYUq_UX.js";import{s as $}from"./Eye-RSaOlPZv.js";import{s as A}from"./Star01-Dsaeuwpa.js";import{a8 as w}from"./agent-icon-BAU0Nn5Q.js";function M(m){const e=h.c(11),{connectionId:a}=m,{org:r}=I();let i,t,l;e[0]!==a||e[1]!==r.slug?(i=new URL(`/api/${r.slug}/mcp/${a}`,window.location.origin),l=C,t=T.isMCPAuthenticated(i.href,null),e[0]=a,e[1]=r.slug,e[2]=i,e[3]=t,e[4]=l):(i=e[2],t=e[3],l=e[4]);let s;e[5]!==i||e[6]!==r.id?(s=()=>b({url:i.href,token:null,orgId:r.id}),e[5]=i,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==t||e[9]!==s?(n={queryKey:t,queryFn:s},e[8]=t,e[9]=s,e[10]=n):n=e[10];const{data:c}=l(n);return c}const H=[{key:"readOnlyHint",label:"Read-only",Icon:$,variant:"secondary"},{key:"destructiveHint",label:"Destructive",Icon:k,variant:"destructive"},{key:"idempotentHint",label:"Idempotent",Icon:N,variant:"secondary"},{key:"openWorldHint",label:"Open-world",Icon:A,variant:"outline"}];function z(m){const e=h.c(18),{annotations:a,_meta:r}=m;let i;e[0]!==r?(i=_(r),e[0]=r,e[1]=i):i=e[1];const t=!!i;let l,s,n,c,u;if(e[2]!==a||e[3]!==t){u=Symbol.for("react.early_return_sentinel");e:{const f=a?H.filter(v=>a[v.key]===!0):[];if(f.length===0&&!t){u=null;break e}l=S,s="flex gap-1 flex-nowrap",e[9]!==t?(n=t&&o.jsxs(y,{children:[o.jsx(j,{asChild:!0,children:o.jsx(x,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(w,{})})}),o.jsx(g,{children:"Interactive"})]}),e[9]=t,e[10]=n):n=e[10],c=f.map(P)}e[2]=a,e[3]=t,e[4]=l,e[5]=s,e[6]=n,e[7]=c,e[8]=u}else l=e[4],s=e[5],n=e[6],c=e[7],u=e[8];if(u!==Symbol.for("react.early_return_sentinel"))return u;let d;e[11]!==s||e[12]!==n||e[13]!==c?(d=o.jsxs("div",{className:s,children:[n,c]}),e[11]=s,e[12]=n,e[13]=c,e[14]=d):d=e[14];let p;return e[15]!==l||e[16]!==d?(p=o.jsx(l,{children:d}),e[15]=l,e[16]=d,e[17]=p):p=e[17],p}function P(m){const{label:e,Icon:a,variant:r}=m;return o.jsxs(y,{children:[o.jsx(j,{asChild:!0,children:o.jsx(x,{asChild:!0,variant:r,className:"size-6 p-1",children:o.jsx(a,{})})}),o.jsx(g,{children:e})]},e)}export{z as T,M as u};
@@ -1 +0,0 @@
1
- import{e as v,G as b,a as F,s as x,aO as q,o as _}from"./index-DxLTuX83.js";function Q(e,s,n){const t=[];if(e?.trim()){const o=e.trim(),r=n.map(a=>({field:[String(a)],operator:"contains",value:o}));r.length===1&&r[0]?t.push(r[0]):r.length>1&&t.push({operator:"or",conditions:r})}if(s&&s.length>0)for(const o of s)t.push({field:[o.column],operator:"eq",value:o.value});if(t.length!==0)return t.length===1?t[0]:{operator:"and",conditions:t}}function k(e,s,n){const t=e??n,o=s??"desc";return[{field:[String(t)],direction:o}]}function w(e){if(!e||typeof e!="object")throw new Error("Invalid result");if("isError"in e&&e.isError)throw new Error("content"in e&&Array.isArray(e.content)&&e.content[0]?.type==="text"?e.content[0].text:"Unknown error");if("structuredContent"in e)return e.structuredContent;throw new Error("No structured content found")}function D(e,s,n,t){const o=s.toUpperCase(),r=`COLLECTION_${o}_GET`;return{queryKey:q.collectionItem(t,e,"",o,n??""),queryFn:async()=>{if(!n)return{item:null};const a=await t.callTool({name:r,arguments:{id:n}});return w(a)},staleTime:6e4}}function Y(e,s,n,t){const o=v.c(5);let r;o[0]!==t||o[1]!==s||o[2]!==n||o[3]!==e?(r=D(e,s,n,t),o[0]=t,o[1]=s,o[2]=n,o[3]=e,o[4]=r):r=o[4];const{data:a}=x(r);return a?.item??null}const K={structuredContent:{items:[]},isError:!1};function j(e,s,n,t={}){const{searchTerm:o,filters:r,sortKey:a,sortDirection:L,searchFields:S=["title","description"],defaultSortKey:h="updated_at",pageSize:g=100,additionalToolArgs:c}=t,l=s.toUpperCase(),f=`COLLECTION_${l}_LIST`,p=Q(o,r,S),T=k(a,L,h),u={...p&&{where:p},...T&&{orderBy:T},limit:g,offset:0,...c},m=JSON.stringify(u),C=q.collectionList(n,e,"",l,m),{data:O}=x({queryKey:C,queryFn:async()=>n?await n.callTool({name:f,arguments:u}):K,staleTime:3e4,retry:!1,select:d=>w(d??{})?.items??[]});return O}function z(e,s,n){const t=v.c(34),o=b();let r;t[0]!==s?(r=s.toUpperCase(),t[0]=s,t[1]=r):r=t[1];const a=r,L=`COLLECTION_${a}_CREATE`,S=`COLLECTION_${a}_UPDATE`,h=`COLLECTION_${a}_DELETE`;let g;t[2]!==o||t[3]!==e||t[4]!==a?(g=()=>{o.invalidateQueries({predicate:E=>{const i=E.queryKey;return i[1]===e&&i[3]==="collection"&&i[4]===a}})},t[2]=o,t[3]=e,t[4]=a,t[5]=g):g=t[5];const c=g;let l;t[6]!==n||t[7]!==L?(l=async E=>{const i=await n.callTool({name:L,arguments:{data:E}});if(i.isError)throw new Error(Array.isArray(i.content)?i.content[0]?.text:String(i.content));return w(i).item},t[6]=n,t[7]=L,t[8]=l):l=t[8];let f;t[9]!==c?(f=()=>{c(),_.success("Item created successfully")},t[9]=c,t[10]=f):f=t[10];let p;t[11]!==l||t[12]!==f?(p={mutationFn:l,onSuccess:f,onError:B},t[11]=l,t[12]=f,t[13]=p):p=t[13];const T=F(p);let u;t[14]!==n||t[15]!==S?(u=async E=>{const{id:i,data:A}=E,U=await n.callTool({name:S,arguments:{id:i,data:A}});return w(U).item},t[14]=n,t[15]=S,t[16]=u):u=t[16];let m;t[17]!==c?(m=()=>{c(),_.success("Item updated successfully")},t[17]=c,t[18]=m):m=t[18];let C;t[19]!==u||t[20]!==m?(C={mutationFn:u,onSuccess:m,onError:R},t[19]=u,t[20]=m,t[21]=C):C=t[21];const O=F(C);let d;t[22]!==n||t[23]!==h?(d=async E=>{const i=await n.callTool({name:h,arguments:{id:E}});return w(i).item.id},t[22]=n,t[23]=h,t[24]=d):d=t[24];let y;t[25]!==c?(y=()=>{c(),_.success("Item deleted successfully")},t[25]=c,t[26]=y):y=t[26];let N;t[27]!==d||t[28]!==y?(N={mutationFn:d,onSuccess:y,onError:P},t[27]=d,t[28]=y,t[29]=N):N=t[29];const $=F(N);let I;return t[30]!==T||t[31]!==$||t[32]!==O?(I={create:T,update:O,delete:$},t[30]=T,t[31]=$,t[32]=O,t[33]=I):I=t[33],I}function P(e){const s=e instanceof Error?e.message:String(e);_.error(`Failed to delete item: ${s}`)}function R(e){const s=e instanceof Error?e.message:String(e);_.error(`Failed to update item: ${s}`)}function B(e){const s=e instanceof Error?e.message:String(e);_.error(`Failed to create item: ${s}`)}export{z as a,j as b,D as c,Y as u};
@@ -1 +0,0 @@
1
- import{e as H,j as t,q as Q,G,r as J,o as F,bl as M,bm as P}from"./index-DxLTuX83.js";import{c as I,b as L,d as q,f as R,e as U,g as k,a as K,A as $}from"./alert-dialog-nDI1xJhR.js";import{u as Y}from"./studio-tools-qhNYzbg-.js";function W(T){const e=H.c(41),{deleteState:s,cancelDelete:i,confirmDelete:c,confirmForceDelete:l}=T,N=s.mode==="deleting";let r;e[0]!==i?(r=w=>{w||i()},e[0]=i,e[1]=r):r=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(I,{children:"Delete Connection?"}),e[2]=f):f=e[2];const S=s.mode==="deleting"&&s.connection.title;let u;e[3]!==S?(u=t.jsxs(L,{children:[f,t.jsxs(q,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:S}),"."]})]}),e[3]=S,e[4]=u):u=e[4];let E;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(R,{children:"Cancel"}),e[5]=E):E=e[5];let h;e[6]!==c?(h=t.jsxs(U,{children:[E,t.jsx(k,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[6]=c,e[7]=h):h=e[7];let n;e[8]!==u||e[9]!==h?(n=t.jsxs(K,{children:[u,h]}),e[8]=u,e[9]=h,e[10]=n):n=e[10];let o;e[11]!==N||e[12]!==r||e[13]!==n?(o=t.jsx($,{open:N,onOpenChange:r,children:n}),e[11]=N,e[12]=r,e[13]=n,e[14]=o):o=e[14];const a=s.mode==="force-deleting";let d;e[15]!==i?(d=w=>{w||i()},e[15]=i,e[16]=d):d=e[16];let m;e[17]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(I,{children:"Connection Used by Agents"}),e[17]=m):m=e[17];const _=s.mode==="force-deleting"&&s.connection.title;let g;e[18]!==_?(g=t.jsx("span",{className:"font-medium text-foreground",children:_}),e[18]=_,e[19]=g):g=e[19];const A=s.mode==="force-deleting"&&s.agentNames;let x;e[20]!==A?(x=t.jsx("span",{className:"font-medium text-foreground",children:A}),e[20]=A,e[21]=x):x=e[21];let C;e[22]!==g||e[23]!==x?(C=t.jsxs("p",{children:["The connection"," ",g," ","is currently used by the following agent(s):"," ",x,"."]}),e[22]=g,e[23]=x,e[24]=C):C=e[24];let O;e[25]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."}),e[25]=O):O=e[25];let D;e[26]!==C?(D=t.jsxs(L,{children:[m,t.jsx(q,{asChild:!0,children:t.jsxs("div",{children:[C,O]})})]}),e[26]=C,e[27]=D):D=e[27];let b;e[28]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(R,{children:"Cancel"}),e[28]=b):b=e[28];let j;e[29]!==l?(j=t.jsxs(U,{children:[b,t.jsx(k,{onClick:l,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]}),e[29]=l,e[30]=j):j=e[30];let p;e[31]!==D||e[32]!==j?(p=t.jsxs(K,{children:[D,j]}),e[31]=D,e[32]=j,e[33]=p):p=e[33];let y;e[34]!==a||e[35]!==d||e[36]!==p?(y=t.jsx($,{open:a,onOpenChange:d,children:p}),e[34]=a,e[35]=d,e[36]=p,e[37]=y):y=e[37];let v;return e[38]!==y||e[39]!==o?(v=t.jsxs(t.Fragment,{children:[o,y]}),e[38]=y,e[39]=o,e[40]=v):v=e[40],v}function X({onSuccess:T}={}){const{org:e}=Q(),s=G(),i=Y(),[c,l]=J.useState({mode:"idle"}),N=()=>{s.invalidateQueries({predicate:n=>{const o=n.queryKey;return o[1]===e.id&&o[3]==="collection"&&o[4]==="CONNECTIONS"}})},r=n=>{M(n),s.invalidateQueries({predicate:o=>o.queryKey[1]===P&&o.queryKey[3]===n})},f=n=>{N(),r(n),F.success("Connection deleted successfully"),l({mode:"idle"}),T?.()};return{deleteState:c,requestDelete:n=>{l({mode:"deleting",connection:n})},cancelDelete:()=>{l({mode:"idle"})},confirmDelete:async()=>{if(c.mode!=="deleting")return;const n=c.connection;l({mode:"idle"});try{await i.call("COLLECTION_CONNECTIONS_DELETE",{id:n.id}),f(n.id)}catch(o){const a=o instanceof Error?o.message:String(o),d=a.replace(/^Error:\s*/,"");try{const m=JSON.parse(d);if(m.code==="CONNECTION_IN_USE"&&m.agentNames){l({mode:"force-deleting",connection:n,agentNames:m.agentNames.map(_=>`"${_}"`).join(", ")});return}}catch{}F.error(`Failed to delete connection: ${a}`)}},confirmForceDelete:async()=>{if(c.mode!=="force-deleting")return;const n=c.connection.id;l({mode:"idle"});try{await i.call("COLLECTION_CONNECTIONS_DELETE",{id:n,force:!0}),f(n)}catch(o){const a=o instanceof Error?o.message:String(o);F.error(`Failed to delete connection: ${a}`)}}}}export{W as D,X as u};
@@ -1,10 +0,0 @@
1
- import{cH as le,cI as ue,cJ as de,c4 as he,cK as fe,bH as m,bI as w,cL as pe,cM as me,cN as _e,cO as A,cP as ge,cQ as j,cR as we,cS as q,cT as Te,cU as F,cV as ye,cW as ke,cX as ve,cY as z,bC as Se,cZ as Ce,c_ as be,b$ as ee,cc as Re,ci as Ie,cg as Ee,c$ as qe,d0 as Pe,d1 as $e,d2 as M,d3 as Ae,d4 as Me,ch as Oe,cd as He,ce as Ne,cf as xe,cb as De,d5 as Ue,d6 as je,d7 as Fe,c6 as Le,d8 as Ve,d9 as We,da as P,db as O,dc as Q,dd as ze,cj as x,e as te,s as se,aO as V}from"./index-DxLTuX83.js";function N(a){return!!a._zod}function b(a,e){return N(a)?le(a,e):a.safeParse(e)}function re(a){if(!a)return;let e;if(N(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Qe(a){if(N(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function G(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Qe(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function J(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ge=6e4;class Je{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(ue,t=>{this._oncancel(t)}),this.setNotificationHandler(de,t=>{this._onprogress(t)}),this.setRequestHandler(he,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(fe,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(w.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(pe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,f=u.id,l=this._requestResolvers.get(f);if(l)if(this._requestResolvers.delete(f),i.type==="response")l(u);else{const h=u,p=new m(h.error.code,h.error.message,h.error.data);l(p)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${f}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new m(w.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(me,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new m(w.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(_e,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(w.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new m(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(w.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),m.fromError(w.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),A(o)||ge(o)?this._onresponse(o):j(o)?this._onrequest(o,n):we(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=m.fromError(w.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:w.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=Te(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,f={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,p)=>{if(n.signal.aborted)throw new m(w.ConnectionClosed,"Request was cancelled");const g={...p,relatedRequestId:e.id};o&&!g.relatedTask&&(g.relatedTask={taskId:o});const y=g.relatedTask?.taskId??o;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,g)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,f)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:w.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),A(e))s(e);else{const n=new m(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(A(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),A(e))r(e);else{const n=m.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof m?n:new m(w.InternalError,String(n))}}return}let o;try{const n=await this.request(e,F,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(w.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new m(w.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(w.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(f=>setTimeout(f,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof m?n:new m(w.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((f,l)=>{const h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const p=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:p};s?.onprogress&&(this._progressHandlers.set(p,s.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),i&&(g.params={...g.params,task:i}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[q]:u}});const y=c=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof m?c:new m(w.RequestTimeout,String(c));l(_)};this._responseHandlers.set(p,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?f(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ge,k=()=>y(m.fromError(w.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(p,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(p);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,c),this._enqueueTaskMessage(d,{type:"request",message:g,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(p),l(_)})}else this._transport.send(g,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(p),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},ye,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ke,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ve,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=G(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=J(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=G(e);this._notificationHandlers.set(s,r=>{const o=J(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&j(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(w.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new m(w.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(w.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new m(w.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=z.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new m(w.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(w.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const f=z.parse({method:"notifications/tasks/status",params:u});await this.notification(f),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function K(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ke(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];K(n)&&K(o)?t[r]={...n,...o}:t[r]=o}return t}var Be=Ce();const Ye=Se(Be);function Ze(){const a=new Ye({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return be(a),a}class Xe{constructor(e){this._ajv=e??Ze()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class et{constructor(e){this._client=e}async*callToolStream(e,t=ee,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const f=u.result;if(!f.structuredContent&&!f.isError){yield{type:"error",error:new m(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(f.structuredContent)try{const l=i(f.structuredContent);if(!l.valid){yield{type:"error",error:new m(w.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof m){yield{type:"error",error:l};return}yield{type:"error",error:new m(w.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function tt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function st(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function H(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&H(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&H(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&H(t,e)}}function rt(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let at=class extends Je{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new Xe,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Re,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Ie,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ee,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new et(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ke(this._capabilities,e)}setRequestHandler(e,t){const r=re(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(N(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,f)=>{const l=b(je,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:p,supportsUrlMode:g}=rt(this._capabilities.elicitation);if(h.mode==="form"&&!p)throw new m(w.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new m(w.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,f));if(h.task){const c=b(F,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(w.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(w.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{H(d,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,f)=>{const l=b(Le,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(w.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,p=await Promise.resolve(t(u,f));if(h.task){const k=b(F,p);if(!k.success){const d=k.error instanceof Error?k.error.message:String(k.error);throw new m(w.InvalidParams,`Invalid task creation result: ${d}`)}return k.data}const y=h.tools||h.toolChoice?Ve:We,T=b(y,p);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(w.InvalidParams,`Invalid sampling result: ${k}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:qe,capabilities:this._capabilities,clientInfo:this._clientInfo}},Pe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!$e.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){tt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&st(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},M,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Ae,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},M,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Oe,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Ne,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},M,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},M,t)}async callTool(e,t=ee,s){if(this.isToolTaskRequired(e.name))throw new m(w.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new m(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new m(w.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(w.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},De,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ue.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,f=async()=>{if(!n){u(null,null);return}try{const h=await r();u(null,h)}catch(h){const p=h instanceof Error?h:new Error(String(h));u(p,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const p=setTimeout(f,i);this._listChangedDebounceTimers.set(e,p)}else f()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const St={SELF:a=>`${a}_self`,REGISTRY:a=>`${a}_registry`,COMMUNITY_REGISTRY:a=>`${a}_community-registry`,DEV_ASSETS:a=>`${a}_dev-assets`,SITE_DIAGNOSTICS:a=>`site-diagnostics_${a}`},ot="self";function nt(a){return{is(e){return!e||!e.startsWith(a)?null:e.slice(a.length)||null},get(e){return`${a}${e}`}}}function it(a){return{id:a.id,organization_id:a.organizationId,title:a.title,description:a.description,icon:a.icon,status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:a.instructions??null},pinned:!1,connections:[]}}const ae=nt("decopilot_"),Ct=ae.is,ct=ae.get;function bt(a){return it({id:ct(a),organizationId:a,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png"})}const Rt={AGENT_MANAGER:a=>`studio-agent-manager_${a}`,AUTOMATION_MANAGER:a=>`studio-automation-manager_${a}`,CONNECTION_MANAGER:a=>`studio-connection-manager_${a}`,STORE_MANAGER:a=>`studio-store-manager_${a}`,BRAND_MANAGER:a=>`studio-brand-manager_${a}`,USAGE_MANAGER:a=>`studio-usage-manager_${a}`};function It(a){return a?a.startsWith("studio-agent-manager_")||a.startsWith("studio-automation-manager_")||a.startsWith("studio-connection-manager_")||a.startsWith("studio-store-manager_")||a.startsWith("studio-brand-manager_")||a.startsWith("studio-usage-manager_"):!1}const D=a=>[{type:"text",text:a}];function lt(a){const e=a.meshUrl??(typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either meshUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let f;try{f=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(h){const p=h instanceof Error?h.message:"Network error";return{content:D(p),isError:!0}}if(!f.ok){let h=`${u.name} failed (${f.status})`;try{const p=await f.json();p?.error&&(h=p.error)}catch{}return{content:D(h),isError:!0}}const l=await f.json().catch(()=>({}));return{content:D(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function L(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function ut(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return a(t,r)}:a}class B extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Y=10,dt=13,I=32;function U(a){}function ht(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=U,onError:t=U,onRetry:s=U,onComment:r}=a,o=[];let n=!0,i,u="",f=0,l;function h(d){if(n&&(n=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),o.length===0){const v=p(d);v!==""&&o.push(v);return}if(d.indexOf(`
2
- `)===-1&&d.indexOf("\r")===-1){o.push(d);return}o.push(d);const c=o.join("");o.length=0;const _=p(c);_!==""&&o.push(_)}function p(d){let c=0;if(d.indexOf("\r")===-1){let _=d.indexOf(`
3
- `,c);for(;_!==-1;){if(c===_){f>0&&e({id:i,event:l,data:u}),i=void 0,u="",f=0,l=void 0,c=_+1,_=d.indexOf(`
4
- `,c);continue}const v=d.charCodeAt(c);if(Z(d,c,v)){const S=d.charCodeAt(c+5)===I?c+6:c+5,C=d.slice(S,_);if(f===0&&d.charCodeAt(_+1)===Y){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=_+2,_=d.indexOf(`
5
- `,c);continue}u=f===0?C:`${u}
6
- ${C}`,f++}else X(d,c,v)?l=d.slice(d.charCodeAt(c+6)===I?c+7:c+6,_)||void 0:g(d,c,_);c=_+1,_=d.indexOf(`
7
- `,c)}return d.slice(c)}for(;c<d.length;){const _=d.indexOf("\r",c),v=d.indexOf(`
8
- `,c);let S=-1;if(_!==-1&&v!==-1?S=_<v?_:v:_!==-1?_===d.length-1?S=-1:S=_:v!==-1&&(S=v),S===-1)break;g(d,c,S),c=S+1,d.charCodeAt(c-1)===dt&&d.charCodeAt(c)===Y&&c++}return d.slice(c)}function g(d,c,_){if(c===_){T();return}const v=d.charCodeAt(c);if(Z(d,c,v)){const E=d.charCodeAt(c+5)===I?c+6:c+5,W=d.slice(E,_);u=f===0?W:`${u}
9
- ${W}`,f++;return}if(X(d,c,v)){l=d.slice(d.charCodeAt(c+6)===I?c+7:c+6,_)||void 0;return}if(v===105&&d.charCodeAt(c+1)===100&&d.charCodeAt(c+2)===58){const E=d.slice(d.charCodeAt(c+3)===I?c+4:c+3,_);i=E.includes("\0")?void 0:E;return}if(v===58){if(r){const E=d.slice(c,_);r(E.slice(d.charCodeAt(c+1)===I?2:1))}return}const S=d.slice(c,_),C=S.indexOf(":");if(C===-1){y(S,"",S);return}const ne=S.slice(0,C),ie=S.charCodeAt(C+1)===I?2:1,ce=S.slice(C+ie);y(ne,ce,S)}function y(d,c,_){switch(d){case"event":l=c||void 0;break;case"data":u=f===0?c:`${u}
10
- ${c}`,f++;break;case"id":i=c.includes("\0")?void 0:c;break;case"retry":/^\d+$/.test(c)?s(parseInt(c,10)):t(new B(`Invalid \`retry\` value: "${c}"`,{type:"invalid-retry",value:c,line:_}));break;default:t(new B(`Unknown field "${d.length>20?`${d.slice(0,20)}…`:d}"`,{type:"unknown-field",field:d,value:c,line:_}));break}}function T(){f>0&&e({id:i,event:l,data:u}),i=void 0,u="",f=0,l=void 0}function k(d={}){if(d.consume&&o.length>0){const c=o.join("");g(c,0,c.length)}n=!0,i=void 0,u="",f=0,l=void 0,o.length=0}return{feed:h,reset:k}}function Z(a,e,t){return t===100&&a.charCodeAt(e+1)===97&&a.charCodeAt(e+2)===116&&a.charCodeAt(e+3)===97&&a.charCodeAt(e+4)===58}function X(a,e,t){return t===101&&a.charCodeAt(e+1)===118&&a.charCodeAt(e+2)===101&&a.charCodeAt(e+3)===110&&a.charCodeAt(e+4)===116&&a.charCodeAt(e+5)===58}class ft extends TransformStream{constructor({onError:e,onRetry:t,onComment:s}={}){let r;super({start(o){r=ht({onEvent:n=>{o.enqueue(n)},onError(n){e==="terminate"?o.error(n):typeof e=="function"&&e(n)},onRetry:t,onComment:s})},transform(o){r.feed(o)}})}}const pt={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class $ extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}}let mt=class{constructor(e,t){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=ut(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._reconnectionOptions=t?.reconnectionOptions??pt}async _authThenStart(){if(!this._authProvider)throw new P("No auth provider");let e;try{e=await O(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(t){throw this.onerror?.(t),t}if(e!=="AUTHORIZED")throw new P;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const e={};if(this._authProvider){const s=await this._authProvider.tokens();s&&(e.Authorization=`Bearer ${s.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);const t=L(this._requestInit?.headers);return new Headers({...e,...t})}async _startOrAuthSse(e){const{resumptionToken:t}=e;try{const s=await this._commonHeaders();s.set("Accept","text/event-stream"),t&&s.set("last-event-id",t);const r=await(this._fetch??fetch)(this._url,{method:"GET",headers:s,signal:this._abortController?.signal});if(!r.ok){if(await r.body?.cancel(),r.status===401&&this._authProvider)return await this._authThenStart();if(r.status===405)return;throw new $(r.status,`Failed to open SSE stream: ${r.statusText}`)}this._handleSseStream(r.body,e,!0)}catch(s){throw this.onerror?.(s),s}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const t=this._reconnectionOptions.initialReconnectionDelay,s=this._reconnectionOptions.reconnectionDelayGrowFactor,r=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*Math.pow(s,e),r)}_scheduleReconnection(e,t=0){const s=this._reconnectionOptions.maxRetries;if(t>=s){this.onerror?.(new Error(`Maximum reconnection attempts (${s}) exceeded.`));return}const r=this._getNextReconnectionDelay(t);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(o=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${o instanceof Error?o.message:String(o)}`)),this._scheduleReconnection(e,t+1)})},r)}_handleSseStream(e,t,s){if(!e)return;const{onresumptiontoken:r,replayMessageId:o}=t;let n,i=!1,u=!1;(async()=>{try{const l=e.pipeThrough(new TextDecoderStream).pipeThrough(new ft({onRetry:g=>{this._serverRetryMs=g}})).getReader();for(;;){const{value:g,done:y}=await l.read();if(y)break;if(g.id&&(n=g.id,i=!0,r?.(g.id)),!!g.data&&(!g.event||g.event==="message"))try{const T=x.parse(JSON.parse(g.data));A(T)&&(u=!0,o!==void 0&&(T.id=o)),this.onmessage?.(T)}catch(T){this.onerror?.(T)}}(s||i)&&!u&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:n,onresumptiontoken:r,replayMessageId:o},0)}catch(l){if(this.onerror?.(new Error(`SSE stream disconnected: ${l}`)),(s||i)&&!u&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:n,onresumptiontoken:r,replayMessageId:o},0)}catch(g){this.onerror?.(new Error(`Failed to reconnect: ${g instanceof Error?g.message:String(g)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new P("No auth provider");if(await O(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new P("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,t){try{const{resumptionToken:s,onresumptiontoken:r}=t||{};if(s){this._startOrAuthSse({resumptionToken:s,replayMessageId:j(e)?e.id:void 0}).catch(p=>this.onerror?.(p));return}const o=await this._commonHeaders();o.set("content-type","application/json"),o.set("accept","application/json, text/event-stream");const n={...this._requestInit,method:"POST",headers:o,body:JSON.stringify(e),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._url,n),u=i.headers.get("mcp-session-id");if(u&&(this._sessionId=u),!i.ok){const p=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new $(401,"Server returned 401 after successful authentication");const{resourceMetadataUrl:g,scope:y}=Q(i);if(this._resourceMetadataUrl=g,this._scope=y,await O(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new P;return this._hasCompletedAuthFlow=!0,this.send(e)}if(i.status===403&&this._authProvider){const{resourceMetadataUrl:g,scope:y,error:T}=Q(i);if(T==="insufficient_scope"){const k=i.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===k)throw new $(403,"Server returned 403 after trying upscoping");if(y&&(this._scope=y),g&&(this._resourceMetadataUrl=g),this._lastUpscopingHeader=k??void 0,await O(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new P;return this.send(e)}}throw new $(i.status,`Error POSTing to endpoint: ${p}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,i.status===202){await i.body?.cancel(),ze(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(p=>this.onerror?.(p));return}const l=(Array.isArray(e)?e:[e]).filter(p=>"method"in p&&"id"in p&&p.id!==void 0).length>0,h=i.headers.get("content-type");if(l)if(h?.includes("text/event-stream"))this._handleSseStream(i.body,{onresumptiontoken:r},!1);else if(h?.includes("application/json")){const p=await i.json(),g=Array.isArray(p)?p.map(y=>x.parse(y)):[x.parse(p)];for(const y of g)this.onmessage?.(y)}else throw await i.body?.cancel(),new $(-1,`Unexpected content type: ${h}`);else await i.body?.cancel()}catch(s){throw this.onerror?.(s),s}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{const e=await this._commonHeaders(),t={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},s=await(this._fetch??fetch)(this._url,t);if(await s.body?.cancel(),!s.ok&&s.status!==405)throw new $(s.status,`Failed to terminate session: ${s.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,t){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:t?.onresumptiontoken})}};class _t extends mt{constructor(e,t){super(e,t)}send(e,t){const s=gt(e);return s?.type==="emit"?(this.onmessage?.(s.message),Promise.resolve()):s?.type==="suppress"?Promise.resolve():super.send(e,t)}}function gt(a){const e=a;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const t=e?.params?.protocolVersion;return t?{type:"emit",message:{result:{protocolVersion:t,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"mesh-virtual-mcp",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const wt={name:"mesh-sdk",version:"1.0.0"};function Tt(a,e,t){const s=t??(typeof window<"u"?window.location.origin:void 0);if(!s)throw new Error("MCP client requires either meshUrl option or a browser environment.");const r=`/api/${encodeURIComponent(e)}`,o=a?`${r}/mcp/${a}`:`${r}/mcp`;return new URL(o,s).href}async function oe({connectionId:a,orgId:e,orgSlug:t,token:s,meshUrl:r}){const o=V.mcpClient(e,a??"self",s??"",r??"");if(!a||a===ot)return lt({orgSlug:t,token:s,meshUrl:r,toJSONString:`mcp-client:${o.join(":")}`});const n=Tt(a,t,r),i=new at(wt,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),u=new _t(new URL(n),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream",...s?{Authorization:`Bearer ${s}`}:{}}}});return await i.connect(u),i.toJSON=()=>`mcp-client:${o.join(":")}`,i}function yt(a){const{connectionId:e,token:t,meshUrl:s,orgId:r}=a;return{queryKey:V.mcpClient(r,e??"self",t??"",s??""),queryFn:()=>oe(a),staleTime:1/0,gcTime:6e4}}function qt(a){const e=te.c(2);let t;e[0]!==a?(t=yt(a),e[0]=a,e[1]=t):t=e[1];const{data:s}=se(t);return s}function Pt(a){const e=te.c(14),{connectionId:t,orgId:s,orgSlug:r,token:o,meshUrl:n}=a;let i;e[0]!==t||e[1]!==n||e[2]!==s||e[3]!==o?(i=t!==void 0?V.mcpClient(s,t??"self",o??"",n??""):["mcp","client","skip",s],e[0]=t,e[1]=n,e[2]=s,e[3]=o,e[4]=i):i=e[4];const u=i;let f;e[5]!==t||e[6]!==n||e[7]!==s||e[8]!==r||e[9]!==o?(f=async()=>t===void 0?null:oe({connectionId:t,orgId:s,orgSlug:r,token:o,meshUrl:n}),e[5]=t,e[6]=n,e[7]=s,e[8]=r,e[9]=o,e[10]=f):f=e[10];let l;e[11]!==u||e[12]!==f?(l={queryKey:u,queryFn:f,staleTime:1/0,gcTime:6e4},e[11]=u,e[12]=f,e[13]=l):l=e[13];const{data:h}=se(l);return h??null}export{Ye as A,at as C,Je as P,Rt as S,St as W,ot as a,It as b,oe as c,ht as d,ut as e,mt as f,bt as g,ct as h,Ct as i,Pt as j,yt as m,L as n,qt as u};
@@ -1 +0,0 @@
1
- import{e as m,n as p,s as q,aO as T,a as C}from"./index-DxLTuX83.js";function O(a){const e=m.c(12);let t,s;e[0]!==a?({client:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let o;e[5]!==t?(o=async()=>await t.listTools(),e[5]=t,e[6]=o):o=e[6];const n=s.staleTime??3e4;let i;return e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==n?(i={...s,queryKey:l,queryFn:o,staleTime:n,retry:!1},e[7]=s,e[8]=l,e[9]=o,e[10]=n,e[11]=i):i=e[11],q(i)}function K(a){const e=m.c(12);let t,s;e[0]!==a?({client:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let o;e[5]!==t?(o=async()=>await t.listTools(),e[5]=t,e[6]=o):o=e[6];const n=s.staleTime??3e4;let i;return e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==n?(i={...s,queryKey:l,queryFn:o,staleTime:n,retry:!1},e[7]=s,e[8]=l,e[9]=o,e[10]=n,e[11]=i):i=e[11],p(i)}function M(a){const e=m.c(21);let t,s,l,o;e[0]!==a?({client:t,toolName:o,toolArguments:l,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=l,e[4]=o):(t=e[1],s=e[2],l=e[3],o=e[4]);let n,i,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==o){const f=JSON.stringify(l??{});u=q,n=s,i=T.mcpToolCall(t,o,f),e[5]=t,e[6]=s,e[7]=l,e[8]=o,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let r;e[12]!==t||e[13]!==l||e[14]!==o?(r=async()=>await t.callTool({name:o,arguments:l}),e[12]=t,e[13]=l,e[14]=o,e[15]=r):r=e[15];const y=s.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==r||e[19]!==y?(c={...n,queryKey:i,queryFn:r,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=r,e[19]=y,e[20]=c):c=e[20],u(c)}function w(a){const e=m.c(21);let t,s,l,o;e[0]!==a?({client:t,toolName:o,toolArguments:l,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=l,e[4]=o):(t=e[1],s=e[2],l=e[3],o=e[4]);let n,i,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==o){const f=JSON.stringify(l??{});u=p,n=s,i=T.mcpToolCall(t,o,f),e[5]=t,e[6]=s,e[7]=l,e[8]=o,e[9]=n,e[10]=i,e[11]=u}else n=e[9],i=e[10],u=e[11];let r;e[12]!==t||e[13]!==l||e[14]!==o?(r=async()=>await t.callTool({name:o,arguments:l}),e[12]=t,e[13]=l,e[14]=o,e[15]=r):r=e[15];const y=s.staleTime??3e4;let c;return e[16]!==n||e[17]!==i||e[18]!==r||e[19]!==y?(c={...n,queryKey:i,queryFn:r,staleTime:y,retry:!1},e[16]=n,e[17]=i,e[18]=r,e[19]=y,e[20]=c):c=e[20],u(c)}function F(a){const e=m.c(8);let t,s;e[0]!==a?({client:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=async n=>await t.callTool(n),e[3]=t,e[4]=l):l=e[4];let o;return e[5]!==s||e[6]!==l?(o={...s,mutationFn:l},e[5]=s,e[6]=l,e[7]=o):o=e[7],C(o)}export{O as a,K as b,M as c,F as d,w as u};
@@ -1 +0,0 @@
1
- import{e as a,q as C}from"./index-DxLTuX83.js";import{u as R}from"./use-connection-DIX015NP.js";import{W as u}from"./use-mcp-client-B7YSHa6V.js";import{g as p}from"./use-organization-settings-mMiPWte8.js";function E(){const e=a.c(17),{org:i}=C(),o=p();let n;e[0]!==i.id?(n=u.REGISTRY(i.id),e[0]=i.id,e[1]=n):n=e[1];const c=n;let l;e[2]!==i.id?(l=u.COMMUNITY_REGISTRY(i.id),e[2]=i.id,e[3]=l):l=e[3];const d=l;let r;e[4]!==d||e[5]!==c?(r=[c,d],e[4]=d,e[5]=c,e[6]=r):r=e[6];let t;if(e[7]!==o||e[8]!==r){if(t=new Set(r),o?.registries){let s;e[10]!==o.registries?(s=Object.keys(o.registries),e[10]=o.registries,e[11]=s):s=e[11];for(const m of s)t.add(m)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const g=R();let f;if(e[12]!==g||e[13]!==t){let s;e[15]!==t?(s=m=>t.has(m.id),e[15]=t,e[16]=s):s=e[16],f=g.filter(s),e[12]=g,e[13]=t,e[14]=f}else f=e[14];return f}export{E as u};
@@ -1 +0,0 @@
1
- import{r as o,e as T,a0 as h}from"./index-DxLTuX83.js";import{p as R,q as I}from"./question-004-sINsf4GQ.js";import{D as S}from"./watch-sse-pool-BEICArze.js";import{d as y}from"./decopilot-sse-pool-Cu7Nizzp.js";const b=()=>0;function D(s){const{orgSlug:e,taskId:n,enabled:t=!0,onStep:r,onFinish:u,onTaskStatus:f}=s,l=o.useRef({taskId:n,onStep:r,onFinish:u,onTaskStatus:f});l.current={taskId:n,onStep:r,onFinish:u,onTaskStatus:f};const i=o.useRef(null),p=o.useRef(t),d=o.useRef(e);(!i.current||p.current!==t||d.current!==e)&&(p.current=t,d.current=e,i.current=m=>{if(!t||!e)return()=>{};const E=k=>{let a;try{a=JSON.parse(k.data)}catch{return}const c=l.current;if(!(c.taskId&&a.subject!==c.taskId)){switch(a.type){case S.STEP:c.onStep?.(a);break;case S.FINISH:c.onFinish?.(a);break;case S.THREAD_STATUS:c.onTaskStatus?.(a);break}m()}};return y.subscribe(e,E)}),o.useSyncExternalStore(i.current,b,b)}const O=new Set(["completed","failed","requires_action"]);function q(s){const e=T.c(5),[n]=h();let t;e[0]!==n?(t=u=>{n.enableSounds&&O.has(u.data.status)&&R(I.dataUri).catch(_)},e[0]=n,e[1]=t):t=e[1];let r;e[2]!==s||e[3]!==t?(r={orgSlug:s,onTaskStatus:t},e[2]=s,e[3]=t,e[4]=r):r=e[4],D(r)}function _(s){console.warn("[status-sounds] playback failed:",s)}export{q as u};
@@ -1 +0,0 @@
1
- import{I as u}from"./use-infinite-scroll-BmPWzVgW.js";import{cG as i}from"./index-DxLTuX83.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +0,0 @@
1
- import{I as s}from"./use-infinite-scroll-BmPWzVgW.js";import{cG as u,aF as n}from"./index-DxLTuX83.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
@@ -1 +0,0 @@
1
- import{e as oe,j as t,B as Ce,f as Be,b as lt,q as ze,r as at,o as Le,G as ct,a as dt,K as Fe,ec as Ke,dz as mt}from"./index-DxLTuX83.js";import{u as pt,a as ut}from"./use-mcp-client-B7YSHa6V.js";import{B as ft,g as Me}from"./generate-id-N17blLwS.js";import{C as qe}from"./collection-display-button-C331HXzj.js";import{C as ht}from"./collection-search-D2zd2w_6.js";import{C as gt}from"./card-_9LUJQRQ.js";import{I as Ve}from"./integration-icon-C2c_G7v_.js";import{D as Ge,a as Qe,b as He,c as O}from"./dropdown-menu-CCeLALQe.js";import{s as Je,a as Ye}from"./Eye-RSaOlPZv.js";import{i as Xe}from"./DotsVertical-CuchmOf0.js";import{i as Ze}from"./Tool01-Be5AVc1v.js";import{s as et}from"./Trash01-YuwiLEVo.js";import{C as xt}from"./collection-table-wrapper-D_JocMSh.js";import{E as Ue}from"./empty-state-C0m3QPuD.js";import{n as We}from"./Stars02-ChPYLNIJ.js";import{U as jt}from"./user-BHiBl7KY.js";import{E as tt}from"./empty-state-cuRG9xrS.js";import{u as Ct}from"./use-list-state-BxWtfKJF.js";import{g as bt}from"./connection-slug-eyAPH6o3.js";import{f as vt,g as yt,c as Nt,b as wt,d as St,e as Pt,a as _t,A as Dt}from"./alert-dialog-nDI1xJhR.js";import{a as It,b as At}from"./use-collections-CUoYyXrz.js";import{a as Tt}from"./use-connection-DIX015NP.js";import{s as Et}from"./Plus-wat9tYeJ.js";import{a as Ot}from"./layout-2bgJD0NS.js";import{u as $t}from"./studio-tools-qhNYzbg-.js";import{P as je}from"./index-DM719JZt.js";import"./collections-BEkDC2fV.js";import"./SwitchHorizontal01-CkdIfbJ1.js";import"./Check-CV74Rqqs.js";import"./tooltip-D1D9JHhD.js";import"./view-mode-toggle-C4AuqTiF.js";import"./badge-DBQKr8ze.js";import"./SearchMd-BoptgjAM.js";import"./Container-Byi81M5N.js";import"./agent-icon-BAU0Nn5Q.js";import"./AlertCircle-B5QG7wg7.js";import"./RefreshCcw01-D-1V89vv.js";import"./XCircle-Ds6l9Vuw.js";import"./ArrowUpRight-Ce95HJs8.js";import"./ZapSquare-DMmAEMvR.js";import"./Users03-Cf3_qQGc.js";import"./CheckCircle-BiLWpS6e.js";import"./ChevronDown-XKMoQgX6.js";import"./ChevronLeft-rORK5a-Y.js";import"./ChevronRight-Betyx6_9.js";import"./ChevronUp-CGfhqWp1.js";import"./ZoomOut-C6xbqN0H.js";import"./Globe01-Ds0ZgQYM.js";import"./FilterLines-DuHSJmFt.js";import"./Star01-Dsaeuwpa.js";import"./Palette-gIYgJ3Wn.js";import"./HardDrive-C0JdZ_DO.js";import"./Key01-CStdo5WX.js";import"./LayoutLeft-BdQI12mG.js";import"./LinkExternal01-D7swM7zC.js";import"./Monitor01-CaSeRueL.js";import"./Sun-BUoG5bs4.js";import"./Play-1bLCgUWF.js";import"./Settings02-8XjUg3gM.js";import"./Shield01-CjOnx-7R.js";import"./Stars01-DDkk5qux.js";import"./Upload01-aGUy8jUM.js";import"./User01-CUMpCZVS.js";import"./Users01-BGw9h7dE.js";import"./XClose-CwNjmDWz.js";import"./X-D1kqmcok.js";import"./Zap-j2XVmCfk.js";import"./table-BHblf7Co.js";import"./avatar-BZq-o3M_.js";import"./use-view-mode-CQiQ9BoV.js";import"./sidebar-DILd2AwV.js";import"./sheet-BZaR5cN8.js";function kt(i,e){const s=i.properties||{};for(const n in s){const a=s[n];if(a&&a.type==="string"&&(a.format==="url"||a.format==="uri")&&e&&typeof e=="object"&&n in e&&e[n])return e[n]}const l=["image","img","avatar","icon","logo","thumbnail","cover"];for(const n of l)if(e&&typeof e=="object"&&n in e&&typeof e[n]=="string")return e[n]}function zt(i){const e=oe.c(25),{item:s,schema:l,actions:n}=i;let a;e[0]!==s||e[1]!==l?(a=kt(l,s),e[0]=s,e[1]=l,e[2]=a):a=e[2];const r=a,u=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let m;e[3]!==n?(m=n&&Object.keys(n).length>0,e[3]=n,e[4]=m):m=e[4];const o=m;let p;e[5]!==r||e[6]!==s.title?(p=t.jsx(Ve,{icon:r,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=r,e[6]=s.title,e[7]=p):p=e[7];let d;e[8]!==s.title?(d=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=d):d=e[9];const h=u||"No description";let c;e[10]!==h?(c=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:h}),e[10]=h,e[11]=c):c=e[11];let v;e[12]!==d||e[13]!==c?(v=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[d,c]}),e[12]=d,e[13]=c,e[14]=v):v=e[14];let y;e[15]!==p||e[16]!==v?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[p,v]}),e[15]=p,e[16]=v,e[17]=y):y=e[17];let b;e[18]!==n||e[19]!==o||e[20]!==s?(b=o&&t.jsx("div",{className:"absolute top-6 right-6 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",onClick:Mt,onMouseDown:Kt,children:t.jsxs(Ge,{children:[t.jsx(Qe,{asChild:!0,children:t.jsx(Ce,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ft,children:t.jsx(Xe,{size:20})})}),t.jsxs(He,{align:"end",onClick:Lt,children:[n.open&&t.jsxs(O,{onClick:g=>{g.stopPropagation(),n.open?.(s)},children:[t.jsx(Je,{size:16}),"Open"]}),n.edit&&t.jsxs(O,{onClick:g=>{g.stopPropagation(),n.edit?.(s)},children:[t.jsx(Ze,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(O,{onClick:g=>{g.stopPropagation(),n.duplicate?.(s)},children:[t.jsx(Ye,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(O,{variant:"destructive",onClick:g=>{g.stopPropagation(),n.delete?.(s)},children:[t.jsx(et,{size:16}),"Delete"]})]})]})}),e[18]=n,e[19]=o,e[20]=s,e[21]=b):b=e[21];let x;return e[22]!==y||e[23]!==b?(x=t.jsxs(gt,{className:"cursor-pointer transition-colors hover:bg-accent/50 h-full flex flex-col group relative",children:[y,b]}),e[22]=y,e[23]=b,e[24]=x):x=e[24],x}function Lt(i){return i.stopPropagation()}function Ft(i){return i.stopPropagation()}function Kt(i){return i.stopPropagation()}function Mt(i){return i.stopPropagation()}const Ut=["icon","avatar","logo"],Re=["created_at","created_by","id"];function Wt(i){return Object.keys(i).find(e=>Ut.includes(e.toLowerCase()))}function st(i,e){return Object.keys(i.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Rt(i){const e=oe.c(30),{data:s,schema:l,viewMode:n,search:a,sortKey:r,sortDirection:u,onSort:m,actions:o,onItemClick:p,headerActions:d,emptyState:h,readOnly:c,columns:v,hideToolbar:y,sortableFields:b}=i,x=u===void 0?"asc":u,g=m===void 0?Gt:m;let $;e[0]!==o?($=o===void 0?{}:o,e[0]=o,e[1]=$):$=e[1];const f=$,T=p===void 0?Vt:p,E=d===void 0?null:d,N=h===void 0?null:h,k=c===void 0?!1:c,j=v===void 0?void 0:v,z=y===void 0?!1:y,P=b===void 0?void 0:b;let D;e[2]!==j||e[3]!==l||e[4]!==P?(D=j?j.filter(qt).filter(A=>!P||P.includes(A.id)).map(Bt):st(l,P),e[2]=j,e[3]=l,e[4]=P,e[5]=D):D=e[5];const w=D;let S;e[6]!==E||e[7]!==z||e[8]!==g||e[9]!==x||e[10]!==r||e[11]!==w?(S=!z&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:E}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(qe,{sortKey:r,sortDirection:x,onSort:g,sortOptions:w})})]})}),e[6]=E,e[7]=z,e[8]=g,e[9]=x,e[10]=r,e[11]=w,e[12]=S):S=e[12];let _;e[13]!==f||e[14]!==j||e[15]!==s||e[16]!==N||e[17]!==T||e[18]!==g||e[19]!==k||e[20]!==l||e[21]!==a||e[22]!==x||e[23]!==r||e[24]!==P||e[25]!==n?(_=n==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:N||t.jsx(Ue,{icon:t.jsx(We,{size:36,className:"text-muted-foreground"}),title:"No items found",description:a?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:s.map(A=>t.jsx("div",{onClick:()=>T?.(A),className:"cursor-pointer h-full",children:t.jsx(zt,{item:A,schema:l,readOnly:k,actions:f})},A.id))})}):t.jsx(xt,{columns:Jt(j,l,P,f),data:s,sortKey:r,sortDirection:x,onSort:g,onRowClick:T,emptyState:N||t.jsx(Ue,{icon:t.jsx(We,{size:36,className:"text-muted-foreground"}),title:"No items found",description:a?"Try adjusting your search":"No items to display"})}),e[13]=f,e[14]=j,e[15]=s,e[16]=N,e[17]=T,e[18]=g,e[19]=k,e[20]=l,e[21]=a,e[22]=x,e[23]=r,e[24]=P,e[25]=n,e[26]=_):_=e[26];let I;return e[27]!==S||e[28]!==_?(I=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[S,_]}),e[27]=S,e[28]=_,e[29]=I):I=e[29],I}function Bt(i){return{id:i.id,label:typeof i.header=="string"?i.header:i.id}}function qt(i){return i.sortable!==!1}function Vt(){}function Gt(){}function Qt(i){return{id:"actions",header:"",render:e=>t.jsxs(Ge,{children:[t.jsx(Qe,{asChild:!0,children:t.jsx(Ce,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Xe,{size:20})})}),t.jsxs(He,{align:"end",onClick:s=>s.stopPropagation(),children:[i.open&&t.jsxs(O,{onClick:s=>{s.stopPropagation(),i.open?.(e)},children:[t.jsx(Je,{size:16}),"Open"]}),i.edit&&t.jsxs(O,{onClick:s=>{s.stopPropagation(),i.edit?.(e)},children:[t.jsx(Ze,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(O,{onClick:s=>{s.stopPropagation(),i.duplicate?.(e)},children:[t.jsx(Ye,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(O,{variant:"destructive",onClick:s=>{s.stopPropagation(),i.delete?.(e)},children:[t.jsx(et,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function it(i){const e=i.type;return Array.isArray(e)?e.every(s=>it({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Ht(i,e){const s=i.properties||{},l=Object.keys(s).filter(o=>{const p=s[o];return p&&it(p)}),n=Wt(s),a=[],r=new Set;n&&l.includes(n)&&(a.push(n),r.add(n));const u=["title","description","updated_at","updated_by"];for(const o of u)l.includes(o)&&!r.has(o)&&(a.push(o),r.add(o));const m=l.filter(o=>!r.has(o)&&!Re.includes(o)).sort((o,p)=>o.localeCompare(p));for(const o of m)a.push(o),r.add(o);for(const o of Re)l.includes(o)&&!r.has(o)&&(a.push(o),r.add(o));return a.map(o=>{const p=s[o],d=e?e.includes(o):!["id"].includes(o);return o===n?{id:o,header:"",render:h=>{const c=h[o];return t.jsx(Ve,{icon:c,name:h.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:h=>{const c=h[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(c)})},sortable:d,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const c=h[o];return c?t.jsx(jt,{id:String(c),size:"xs"}):"—"},sortable:d,cellClassName:"max-w-[250px]"}:p?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const c=h[o];return c?t.jsx("span",{className:"block truncate max-w-full",children:new Date(c).toLocaleDateString()}):"—"},sortable:d,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:h=>{const c=h[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(c)})},sortable:d,cellClassName:"max-w-[200px]"}})}function Jt(i,e,s,l){const n=i||Ht(e,s);return n.some(u=>u.id==="actions")?n:Object.keys(l).length>0?[...n,Qt(l)]:n}function Yt(i){const e=oe.c(119),{connectionId:s,org:l,activeCollection:n,onItemClick:a}=i,r=n.name,u=n.schema??ft,m=n.hasCreateTool,o=n.hasUpdateTool,p=n.hasDeleteTool,d=Be(),{data:h}=lt.useSession(),c=h?.user?.id||"unknown",v=Tt(s);let y;e[0]!==v||e[1]!==s?(y=v?bt(v):s,e[0]=v,e[1]=s,e[2]=y):y=e[2];const b=y,{org:x}=ze();let g;e[3]!==s||e[4]!==x.id||e[5]!==x.slug?(g={connectionId:s,orgId:x.id,orgSlug:x.slug},e[3]=s,e[4]=x.id,e[5]=x.slug,e[6]=g):g=e[6];const $=pt(g),f=It(s,r,$),T=`${s}-${r}`;let E;e[7]!==l||e[8]!==T?(E={namespace:l,resource:T,defaultSortKey:"updated_at"},e[7]=l,e[8]=T,e[9]=E):E=e[9];const{search:N,searchTerm:k,setSearch:j,viewMode:z,setViewMode:P,sortKey:D,sortDirection:w,handleSort:S}=Ct(E);let _;e[10]!==k||e[11]!==w||e[12]!==D?(_={searchTerm:k,sortKey:D,sortDirection:w},e[10]=k,e[11]=w,e[12]=D,e[13]=_):_=e[13];const I=At(s,r,$,_),A=!m&&!o&&!p;let ne;e[14]!==b||e[15]!==r||e[16]!==d||e[17]!==a||e[18]!==l?(ne=C=>{if(a){a(C);return}d({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:b,collectionName:r,itemId:C.id}})},e[14]=b,e[15]=r,e[16]=d,e[17]=a,e[18]=l,e[19]=ne):ne=e[19];const L=ne;let re;e[20]!==f.create||e[21]!==c?(re=async C=>{const xe=new Date().toISOString();await f.create.mutateAsync({...C,id:Me("conn"),title:`${C.title} (Copy)`,created_at:xe,updated_at:xe,created_by:c,updated_by:c})},e[20]=f.create,e[21]=c,e[22]=re):re=e[22];const be=re,[F,ve]=at.useState(null);let le;e[23]===Symbol.for("react.memo_cache_sentinel")?(le=C=>{ve(C)},e[23]=le):le=e[23];const ot=le;let K;e[24]!==L||e[25]!==o?(K=o&&{edit:L},e[24]=L,e[25]=o,e[26]=K):K=e[26];let M;e[27]!==be||e[28]!==m?(M=m&&{duplicate:be},e[27]=be,e[28]=m,e[29]=M):M=e[29];let U;e[30]!==p?(U=p&&{delete:ot},e[30]=p,e[31]=U):U=e[31];let ae;e[32]!==M||e[33]!==U||e[34]!==K?(ae={...K,...M,...U},e[32]=M,e[33]=U,e[34]=K,e[35]=ae):ae=e[35];const ye=ae;let ce;e[36]!==f.delete||e[37]!==F?(ce=async()=>{F&&(await f.delete.mutateAsync(F.id),ve(null))},e[36]=f.delete,e[37]=F,e[38]=ce):ce=e[38];const Ne=ce;let de;e[39]!==f.create||e[40]!==b||e[41]!==r||e[42]!==m||e[43]!==d||e[44]!==l||e[45]!==c?(de=async()=>{if(!m){Le.error("Create operation is not available for this collection");return}const C=new Date().toISOString(),xe={id:Me("conn"),title:"New Item",description:"A brief description of the item",created_at:C,updated_at:C,created_by:c,updated_by:c};try{const ke=await f.create.mutateAsync(xe);d({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:b,collectionName:r,itemId:ke.id}})}catch(ke){console.error("Failed to create item:",ke)}},e[39]=f.create,e[40]=b,e[41]=r,e[42]=m,e[43]=d,e[44]=l,e[45]=c,e[46]=de):de=e[46];const we=de;let me;e[47]!==u?(me=st(u),e[47]=u,e[48]=me):me=e[48];const Se=me,nt=(I?.length??0)>0,rt=m&&!nt&&!N;let pe;e[49]!==f.create||e[50]!==we||e[51]!==m?(pe=m?t.jsxs(Ce,{onClick:we,size:"sm",disabled:f.create.isPending,className:"h-7",children:[t.jsx(Et,{className:"mr-2 h-4 w-4"}),f.create.isPending?"Creating...":"Create"]}):null,e[49]=f.create,e[50]=we,e[51]=m,e[52]=pe):pe=e[52];const ue=pe,Pe=D;let W;e[53]!==S||e[54]!==w||e[55]!==Se||e[56]!==Pe?(W=t.jsx(Ot,{children:t.jsx(qe,{sortKey:Pe,sortDirection:w,onSort:S,sortOptions:Se})}),e[53]=S,e[54]=w,e[55]=Se,e[56]=Pe,e[57]=W):W=e[57];const _e=`Search ${r}...`;let R;e[58]!==j?(R=C=>{C.key==="Escape"&&(j(""),C.target.blur())},e[58]=j,e[59]=R):R=e[59];let B;e[60]!==N||e[61]!==j||e[62]!==_e||e[63]!==R?(B=t.jsx("div",{className:"flex-1",children:t.jsx(ht,{value:N,onChange:j,placeholder:_e,onKeyDown:R})}),e[60]=N,e[61]=j,e[62]=_e,e[63]=R,e[64]=B):B=e[64];let q;e[65]!==ue||e[66]!==m?(q=m&&t.jsx("div",{className:"pr-3",children:ue}),e[65]=ue,e[66]=m,e[67]=q):q=e[67];let V;e[68]!==B||e[69]!==q?(V=t.jsxs("div",{className:"flex items-center gap-2",children:[B,q]}),e[68]=B,e[69]=q,e[70]=V):V=e[70];let G;e[71]!==I?(G=I??[],e[71]=I,e[72]=G):G=e[72];const De=D;let Q;e[73]!==L?(Q=C=>L(C),e[73]=L,e[74]=Q):Q=e[74];const Ie="No items found",Ae=N?"Try adjusting your search terms":"This collection doesn't have any items yet.",Te=rt?ue:void 0;let H;e[75]!==Ie||e[76]!==Ae||e[77]!==Te?(H=t.jsx(tt,{image:null,title:Ie,description:Ae,actions:Te}),e[75]=Ie,e[76]=Ae,e[77]=Te,e[78]=H):H=e[78];let J;e[79]!==S||e[80]!==A||e[81]!==ye||e[82]!==u||e[83]!==N||e[84]!==j||e[85]!==P||e[86]!==w||e[87]!==G||e[88]!==De||e[89]!==Q||e[90]!==H||e[91]!==z?(J=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Rt,{hideToolbar:!0,data:G,schema:u,viewMode:z,onViewModeChange:P,search:N,onSearchChange:j,sortKey:De,sortDirection:w,onSort:S,actions:ye,onItemClick:Q,readOnly:A,emptyState:H})}),e[79]=S,e[80]=A,e[81]=ye,e[82]=u,e[83]=N,e[84]=j,e[85]=P,e[86]=w,e[87]=G,e[88]=De,e[89]=Q,e[90]=H,e[91]=z,e[92]=J):J=e[92];let Y;e[93]!==V||e[94]!==J?(Y=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[V,J]}),e[93]=V,e[94]=J,e[95]=Y):Y=e[95];const Ee=!!F;let fe;e[96]===Symbol.for("react.memo_cache_sentinel")?(fe=C=>{C||ve(null)},e[96]=fe):fe=e[96];let he;e[97]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsx(Nt,{children:"Delete item?"}),e[97]=he):he=e[97];const Oe=F?.title;let X;e[98]!==Oe?(X=t.jsxs(wt,{children:[he,t.jsxs(St,{children:['Are you sure you want to delete "',Oe,'"? This action cannot be undone.']})]}),e[98]=Oe,e[99]=X):X=e[99];let Z;e[100]!==f.delete.isPending?(Z=t.jsx(vt,{disabled:f.delete.isPending,children:"Cancel"}),e[100]=f.delete.isPending,e[101]=Z):Z=e[101];const $e=f.delete.isPending?"Deleting...":"Delete";let ee;e[102]!==f.delete.isPending||e[103]!==Ne||e[104]!==$e?(ee=t.jsx(yt,{onClick:Ne,disabled:f.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$e}),e[102]=f.delete.isPending,e[103]=Ne,e[104]=$e,e[105]=ee):ee=e[105];let te;e[106]!==Z||e[107]!==ee?(te=t.jsxs(Pt,{children:[Z,ee]}),e[106]=Z,e[107]=ee,e[108]=te):te=e[108];let se;e[109]!==X||e[110]!==te?(se=t.jsxs(_t,{children:[X,te]}),e[109]=X,e[110]=te,e[111]=se):se=e[111];let ie;e[112]!==Ee||e[113]!==se?(ie=t.jsx(Dt,{open:Ee,onOpenChange:fe,children:se}),e[112]=Ee,e[113]=se,e[114]=ie):ie=e[114];let ge;return e[115]!==W||e[116]!==Y||e[117]!==ie?(ge=t.jsxs(t.Fragment,{children:[W,Y,ie]}),e[115]=W,e[116]=Y,e[117]=ie,e[118]=ge):ge=e[118],ge}function Xt(){const i=oe.c(10),{org:e,project:s}=ze(),l=ct(),n=$t();let a;i[0]!==s||i[1]!==n?(a=async o=>{const p=s.enabledPlugins??[];if(p.includes(o))return;const d=[...p,o];return await n.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:s.id,data:{metadata:{enabled_plugins:d}}})},i[0]=s,i[1]=n,i[2]=a):a=i[2];let r;i[3]!==e||i[4]!==s||i[5]!==l?(r=()=>{l.invalidateQueries({queryKey:Fe.project(e.id,s.slug)}),l.invalidateQueries({queryKey:Fe.projects(e.id)})},i[3]=e,i[4]=s,i[5]=l,i[6]=r):r=i[6];let u;return i[7]!==a||i[8]!==r?(u={mutationFn:a,onSuccess:r,onError:Zt},i[7]=a,i[8]=r,i[9]=u):u=i[9],dt(u)}function Zt(i){Le.error("Failed to enable plugin: "+(i instanceof Error?i.message:"Unknown error"))}function es(i){const e=oe.c(12),{pluginId:s,title:l,description:n,icon:a}=i,r=Xt();let u;e[0]!==r||e[1]!==s?(u=async()=>{try{await r.mutateAsync(s),Le.success("Plugin enabled!")}catch{}},e[0]=r,e[1]=s,e[2]=u):u=e[2];const m=u,o=a??null,p=r.isPending?"Enabling…":"Enable plugin";let d;e[3]!==r.isPending||e[4]!==m||e[5]!==p?(d=t.jsx(Ce,{onClick:m,disabled:r.isPending,children:p}),e[3]=r.isPending,e[4]=m,e[5]=p,e[6]=d):d=e[6];let h;return e[7]!==n||e[8]!==o||e[9]!==d||e[10]!==l?(h=t.jsx(tt,{image:o,title:l,description:n,actions:d}),e[7]=n,e[8]=o,e[9]=d,e[10]=l,e[11]=h):h=e[11],h}const ts={name:"WORKFLOW",displayName:"Workflow",hasCreateTool:!0,hasUpdateTool:!0,hasDeleteTool:!0};function vi(){const{project:i,org:e}=ze();if(!(i.enabledPlugins??[]).includes(Ke))return t.jsx(je,{children:t.jsx(je.Content,{children:t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(es,{pluginId:Ke,title:"Enable Workflows",description:"Automate multi-step processes by enabling the Workflows plugin. Once enabled you can create, run, and monitor workflows.",icon:t.jsx("div",{className:"bg-muted p-4 rounded-full",children:t.jsx(mt,{className:"size-8 text-muted-foreground"})})})})})});const n=Be();return t.jsx(je,{children:t.jsx(je.Content,{children:t.jsx(Yt,{connectionId:ut,org:e.slug,activeCollection:ts,onItemClick:a=>n({to:"/$org/settings/workflows/$itemId",params:{org:e.slug,itemId:a.id}})})})})}export{vi as default};
@@ -1 +0,0 @@
1
- import{e as s,g as l,j as o,l as a,E as n,r as c}from"./index-DxLTuX83.js";import{a as f}from"./index-EffHR3rD.js";import"./index-KCjld4_L.js";import"./use-mcp-client-B7YSHa6V.js";import"./collections-BEkDC2fV.js";import"./index-VW961Pbw.js";import"./use-virtual-mcp-BHCygv1Q.js";import"./use-collections-CUoYyXrz.js";import"./monaco-editor-BenQSBIk.js";import"./index-WAvrfxHO.js";import"./spinner-CIUpakvk.js";import"./resizable-CDtszfkc.js";import"./ZoomOut-C6xbqN0H.js";import"./badge-DBQKr8ze.js";import"./select-C0Tyz9qJ.js";import"./tooltip-D1D9JHhD.js";import"./Check-CV74Rqqs.js";import"./ChevronDown-XKMoQgX6.js";import"./ChevronUp-CGfhqWp1.js";import"./view-mode-toggle-C4AuqTiF.js";import"./agent-icon-BAU0Nn5Q.js";import"./AlertCircle-B5QG7wg7.js";import"./Tool01-Be5AVc1v.js";import"./SwitchHorizontal01-CkdIfbJ1.js";import"./RefreshCcw01-D-1V89vv.js";import"./XCircle-Ds6l9Vuw.js";import"./ArrowUpRight-Ce95HJs8.js";import"./ZapSquare-DMmAEMvR.js";import"./Users03-Cf3_qQGc.js";import"./CheckCircle-BiLWpS6e.js";import"./ChevronLeft-rORK5a-Y.js";import"./ChevronRight-Betyx6_9.js";import"./DotsVertical-CuchmOf0.js";import"./Container-Byi81M5N.js";import"./Eye-RSaOlPZv.js";import"./Globe01-Ds0ZgQYM.js";import"./FilterLines-DuHSJmFt.js";import"./Star01-Dsaeuwpa.js";import"./Palette-gIYgJ3Wn.js";import"./HardDrive-C0JdZ_DO.js";import"./Stars02-ChPYLNIJ.js";import"./Key01-CStdo5WX.js";import"./LayoutLeft-BdQI12mG.js";import"./LinkExternal01-D7swM7zC.js";import"./Monitor01-CaSeRueL.js";import"./Sun-BUoG5bs4.js";import"./Play-1bLCgUWF.js";import"./Plus-wat9tYeJ.js";import"./SearchMd-BoptgjAM.js";import"./Settings02-8XjUg3gM.js";import"./Shield01-CjOnx-7R.js";import"./Stars01-DDkk5qux.js";import"./Trash01-YuwiLEVo.js";import"./Upload01-aGUy8jUM.js";import"./User01-CUMpCZVS.js";import"./Users01-BGw9h7dE.js";import"./XClose-CwNjmDWz.js";import"./X-D1kqmcok.js";import"./Zap-j2XVmCfk.js";import"./layout-2bgJD0NS.js";import"./index-DM719JZt.js";import"./sidebar-DILd2AwV.js";import"./sheet-BZaR5cN8.js";import"./use-connection-DIX015NP.js";import"./use-mcp-tools-Bb7rwoEF.js";import"./dialog-DilC5A4p.js";import"./scroll-area-DtVZtiV9.js";import"./index-NuAPKwye.js";import"./hover-card-Bizl54yc.js";import"./dropdown-menu-CCeLALQe.js";import"./integration-icon-C2c_G7v_.js";import"./accordion-B4RSATFh.js";import"./index-CoxAwU4M.js";import"./empty-state-C0m3QPuD.js";import"./watch-sse-pool-BEICArze.js";import"./input-3FcnQKag.js";function Bt(){const t=s.c(4);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/workflows/$itemId"},t[0]=r):r=t[0];const{itemId:e}=l(r);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"flex h-full items-center justify-center",children:o.jsx(a,{size:32,className:"animate-spin text-muted-foreground"})}),t[1]=i):i=t[1];const p=decodeURIComponent(e);let m;return t[2]!==p?(m=o.jsx(n,{children:o.jsx(c.Suspense,{fallback:i,children:o.jsx(f,{itemId:p})})}),t[2]=p,t[3]=m):m=t[3],m}export{Bt as default};