decocms 3.28.0 → 3.28.1

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 (234) hide show
  1. package/dist/client/assets/{AlertCircle-DU7uZY8J.js → AlertCircle-De-QnqNt.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-DEY-b6kE.js → ArrowUpRight-B0GfNpsw.js} +1 -1
  3. package/dist/client/assets/{Check-Bk-n4rKs.js → Check-DHmAQH53.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-i_SCh8HK.js → CheckCircle-DKSRB9Xd.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-D_SiD52e.js → ChevronDown-CN6qoGcG.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-CJxMMdOC.js → ChevronLeft-HFx1Uufy.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-DRFF6KW4.js → ChevronRight-BJSYQUmF.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-f28rZEwl.js → ChevronUp-CTGwFzLw.js} +1 -1
  9. package/dist/client/assets/{Container-DxRK5lMe.js → Container-DZBZNA8Y.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-BD0Jlzeq.js → DotsVertical-jUGLCiy5.js} +1 -1
  11. package/dist/client/assets/{Eye-BR5jFpci.js → Eye-CGoLCmzu.js} +1 -1
  12. package/dist/client/assets/{FilterLines-DqLLGuqf.js → FilterLines-DYSfUppO.js} +1 -1
  13. package/dist/client/assets/{Globe01-CNB6Mpsd.js → Globe01--hrfRyvA.js} +1 -1
  14. package/dist/client/assets/{HardDrive-p4TajzWn.js → HardDrive-yKlUP3QG.js} +1 -1
  15. package/dist/client/assets/{Key01-DSBXnSBm.js → Key01-DqH2W8Qa.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-XknICfD_.js → LayoutLeft-CLZVvVLM.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-DtQPZgan.js → LinkExternal01-CaYoYL1Y.js} +1 -1
  18. package/dist/client/assets/{Monitor01-B2xyeevM.js → Monitor01-BRL4_dKI.js} +1 -1
  19. package/dist/client/assets/{Palette-BbNQF7ac.js → Palette-B9PbEO6t.js} +1 -1
  20. package/dist/client/assets/{Play-TWKPwhCM.js → Play-Btpg8EpH.js} +1 -1
  21. package/dist/client/assets/{Plus-DXSb81sc.js → Plus-Cv0T2Pov.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-CR2Fhw_7.js → RefreshCcw01-CcpA4rje.js} +1 -1
  23. package/dist/client/assets/{SearchMd-AWrKGzzG.js → SearchMd-BP9M1g2N.js} +1 -1
  24. package/dist/client/assets/{Settings02-C46G6WCc.js → Settings02-BMRrFVdB.js} +1 -1
  25. package/dist/client/assets/{Shield01-CX_dkwPt.js → Shield01-rOhEAWZ1.js} +1 -1
  26. package/dist/client/assets/{Star01-Bj8KnWg6.js → Star01-BjpgI7im.js} +1 -1
  27. package/dist/client/assets/{Stars01-EZHZaPSP.js → Stars01-yuWjNyMF.js} +1 -1
  28. package/dist/client/assets/{Stars02-C_A7q-Eh.js → Stars02-Cv3Kyp_N.js} +1 -1
  29. package/dist/client/assets/{Sun-DXzJdR2z.js → Sun-C0I4hv8e.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-D6F_mKYx.js → SwitchHorizontal01-CLZ8VEjC.js} +1 -1
  31. package/dist/client/assets/{Tool01-CE1enLWz.js → Tool01-DPPRaW86.js} +1 -1
  32. package/dist/client/assets/{Trash01-D8gQFcOn.js → Trash01-s7FZsfBC.js} +1 -1
  33. package/dist/client/assets/{Upload01-Br3xRIzS.js → Upload01-xUCMslnL.js} +1 -1
  34. package/dist/client/assets/{User01-D6Gs71XK.js → User01-BsF0RS3z.js} +1 -1
  35. package/dist/client/assets/{Users01-Bb-aDnk6.js → Users01-D-iBSVXa.js} +1 -1
  36. package/dist/client/assets/{Users03-CTeoWFzj.js → Users03-CKUicuTa.js} +1 -1
  37. package/dist/client/assets/{X-Bf_z2Leo.js → X-CMYaHMo4.js} +1 -1
  38. package/dist/client/assets/{XCircle-UQit86MX.js → XCircle-BdbzgmP6.js} +1 -1
  39. package/dist/client/assets/{XClose-Bgoke-N6.js → XClose-N2P2hiYb.js} +1 -1
  40. package/dist/client/assets/{Zap-TkrtxiYp.js → Zap-gqEvk94k.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-H66QOKYB.js → ZapSquare-AN7R7mTa.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-Cx-hi9HP.js → ZoomOut-Xe1itnU7.js} +1 -1
  43. package/dist/client/assets/{access-gate-lvdpuHDY.js → access-gate-Dx320Euv.js} +1 -1
  44. package/dist/client/assets/{accordion-SKOJ-KFj.js → accordion-BIWbMpHu.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-TR_K3MgP.js → add-section-modal-e667gRvo.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities-Dfyq2uGy.js → agent-capabilities-Deuuzqbm.js} +1 -1
  47. package/dist/client/assets/{agent-icon-OWcPDEQ2.js → agent-icon-D1ySfhKA.js} +1 -1
  48. package/dist/client/assets/{agent-icons-cDvwhRBa.js → agent-icons-DpDt_xvu.js} +1 -1
  49. package/dist/client/assets/{agents-list-CQR5Pn0v.js → agents-list-DXTuElJ5.js} +1 -1
  50. package/dist/client/assets/{ai-providers-DaCH_i9C.js → ai-providers-CHLGgXkW.js} +1 -1
  51. package/dist/client/assets/{alert-dialog-BqyMBnmX.js → alert-dialog-CBzhgusU.js} +1 -1
  52. package/dist/client/assets/{alert-B23mwX-o.js → alert-zJcnZqHG.js} +1 -1
  53. package/dist/client/assets/app-editor-DqV_IRWA.js +1 -0
  54. package/dist/client/assets/{auth-catchall-9EV3406W.js → auth-catchall-GeRmeWq3.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-DLW_QQ-W.js → auth-split-layout-B_vpA1VO.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-BwkKTT5_.js → automation-list-row-7qb4yrwv.js} +1 -1
  57. package/dist/client/assets/{automation-runs-CZtduC0L.js → automation-runs-BcknuTTv.js} +1 -1
  58. package/dist/client/assets/{automations-BICbKbA1.js → automations-K7jo5bzv.js} +1 -1
  59. package/dist/client/assets/{avatar-BzNw5Uju.js → avatar-AI83PqVE.js} +1 -1
  60. package/dist/client/assets/{badge-B2p1Cov_.js → badge-CikIA9ZK.js} +1 -1
  61. package/dist/client/assets/{brand-context-DZXUjVgo.js → brand-context-BwVwErVn.js} +1 -1
  62. package/dist/client/assets/{buckets-5mIo-vQP.js → buckets-DUsKq9i-.js} +1 -1
  63. package/dist/client/assets/{calendar-CNvaxbzF.js → calendar-DZmZKFmb.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-DiOZh0BR.js → capability-load-error-Db8x02Oo.js} +1 -1
  65. package/dist/client/assets/{card-Cm77QeIs.js → card-DmbfBYZU.js} +1 -1
  66. package/dist/client/assets/{chat-context-hSR2djUS.js → chat-context-BOn4WPpq.js} +6 -6
  67. package/dist/client/assets/{checkbox-B-8BZy2m.js → checkbox-Cwl_z5GL.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-C_SoVu4q.js → cli-auth-success--vqcpMzi.js} +1 -1
  69. package/dist/client/assets/{collection-detail-BiXcw8MS.js → collection-detail-BnmgQ1CE.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-ID_MOaLN.js → collection-display-button-0uuG9Zva.js} +1 -1
  71. package/dist/client/assets/{collection-search-BAFbwDkO.js → collection-search-B-CX-Cb7.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-CV-yXvS9.js → collection-table-wrapper-DI5q4GEY.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-CrxbRblh.js → collection-tabs-CdfD34L4.js} +1 -1
  74. package/dist/client/assets/{collections-BI_JGQp4.js → collections-CXYJ8MVZ.js} +1 -1
  75. package/dist/client/assets/{command-OYpJfVPX.js → command-BHuAtd3n.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-DCdLrvVO.js → connect-desktop-dialog-DRFjva34.js} +1 -1
  77. package/dist/client/assets/{connection-card-BMnV5fMv.js → connection-card-DEvkcpmQ.js} +1 -1
  78. package/dist/client/assets/{connection-detail-DEj4qBsZ.js → connection-detail-CWd-Y8iP.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-DnPdxsfv.js → connection-form-helpers-BxYEqmM8.js} +1 -1
  80. package/dist/client/assets/{connections-DSD_MevM.js → connections-BtPFfd05.js} +1 -1
  81. package/dist/client/assets/{decopilot-sse-pool-E7Sw2N0h.js → decopilot-sse-pool-Bj1W2y0B.js} +1 -1
  82. package/dist/client/assets/{dialog-C6QaYxl0.js → dialog-IkiImd7I.js} +1 -1
  83. package/dist/client/assets/{domain-settings-BQ528-l5.js → domain-settings-B-px7BiX.js} +1 -1
  84. package/dist/client/assets/{drawer-vaHtyblX.js → drawer-DO_U_Bhd.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-Imbn90PR.js → dropdown-menu-C-Cxaez8.js} +1 -1
  86. package/dist/client/assets/{dynamic-plugin-layout-6a9zWAcg.js → dynamic-plugin-layout-DHOlocDg.js} +1 -1
  87. package/dist/client/assets/{empty-state-BcYDemrG.js → empty-state-CzxH8T9l.js} +1 -1
  88. package/dist/client/assets/{empty-state-DiL0zFYg.js → empty-state-o52Hq4fy.js} +1 -1
  89. package/dist/client/assets/{extract-connection-data-A3fQ5XNQ.js → extract-connection-data-Uz57CpVC.js} +1 -1
  90. package/dist/client/assets/{features-D5bvFK6H.js → features-DfTRf5eR.js} +1 -1
  91. package/dist/client/assets/{file-explorer-dtc6EQ2u.js → file-explorer-Wed6GBRH.js} +1 -1
  92. package/dist/client/assets/{file-type-icon-DlkWBYHv.js → file-type-icon-BYSeb5A3.js} +1 -1
  93. package/dist/client/assets/{files-OPskzPlL.js → files-PguEGaiI.js} +1 -1
  94. package/dist/client/assets/{form-9w_l2sE8.js → form-ChQh_wIn.js} +1 -1
  95. package/dist/client/assets/{general-lhm5elhX.js → general-BoF0bKER.js} +1 -1
  96. package/dist/client/assets/{generate-id-D-Z8lvmk.js → generate-id-BrtbvnKY.js} +1 -1
  97. package/dist/client/assets/{github-repo-picker-Dv4KJl0O.js → github-repo-picker-13FobS0K.js} +1 -1
  98. package/dist/client/assets/header-tab-button-Qu1eh6fb.js +5 -0
  99. package/dist/client/assets/{hover-card-BI6ysAg8.js → hover-card-5iaAH0_M.js} +1 -1
  100. package/dist/client/assets/{image-field-CcseK2kZ.js → image-field-C3Pv1Di2.js} +1 -1
  101. package/dist/client/assets/{index-duBgFwwx.js → index-BxF-LrkW.js} +1 -1
  102. package/dist/client/assets/{index-D7Ym_-5D.js → index-BxgO4x6f.js} +1 -1
  103. package/dist/client/assets/{index-Dm_1qSI1.js → index-C5R8l9NR.js} +1 -1
  104. package/dist/client/assets/{index-66izpaHD.js → index-CbGPcWEH.js} +1 -1
  105. package/dist/client/assets/{index-DbgXBP8O.js → index-Ctxajzpe.js} +1 -1
  106. package/dist/client/assets/{index-DkHi5sno.js → index-CwSpOXRj.js} +1 -1
  107. package/dist/client/assets/{index-mc4bQjv-.js → index-CweEMiqH.js} +1 -1
  108. package/dist/client/assets/{index-b-VAmZ9T.js → index-CwnBaaeQ.js} +25 -25
  109. package/dist/client/assets/{index-BmS_uKXZ.js → index-D0sk3sYa.js} +1 -1
  110. package/dist/client/assets/{index-Bi8_oF4i.js → index-DFp-rnQf.js} +1 -1
  111. package/dist/client/assets/{index-CEsEADMd.js → index-Dcfw-W2O.js} +1 -1
  112. package/dist/client/assets/{index-DBqH3_Tr.js → index-Dlc4tDxO.js} +3 -3
  113. package/dist/client/assets/{index-CZV4OD7q.js → index-Kzj6xvOo.js} +1 -1
  114. package/dist/client/assets/{index-DCdT8576.js → index-NNvehl9i.js} +1 -1
  115. package/dist/client/assets/{index-g0ii0jyc.js → index-YyegPZ6_.js} +1 -1
  116. package/dist/client/assets/{index-redirect-Cik9CpVs.js → index-redirect-BRsZDGI9.js} +1 -1
  117. package/dist/client/assets/{infiniteQueryObserver-DFtHCFaz.js → infiniteQueryObserver-D4Z6Hq7s.js} +1 -1
  118. package/dist/client/assets/{input-Cuzo-zTy.js → input-CDaarCl_.js} +1 -1
  119. package/dist/client/assets/{integration-icon-C1XpJ7QJ.js → integration-icon-DylMdkB7.js} +1 -1
  120. package/dist/client/assets/{label-CcXzfa1l.js → label-CmtFIrH6.js} +1 -1
  121. package/dist/client/assets/{layout-BJtn7s4t.js → layout-Czl8yfyb.js} +1 -1
  122. package/dist/client/assets/{login-Jhcl5D4A.js → login-CZ304Hwe.js} +1 -1
  123. package/dist/client/assets/{members-DANjql1K.js → members-DldCeEf4.js} +1 -1
  124. package/dist/client/assets/{monaco-editor-CSoW9X1e.js → monaco-editor--8410HRL.js} +1 -1
  125. package/dist/client/assets/{monitoring-stats-row-BGCHrDPH.js → monitoring-stats-row-p2QkpslG.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-BlNYkvOU.js → oauth-callback-BjKMJUNm.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-ai-provider-DH8djC-I.js → oauth-callback-ai-provider--EBMOSLZ.js} +1 -1
  128. package/dist/client/assets/{onboarding-CYkPWfyZ.js → onboarding-Dujhc2aN.js} +1 -1
  129. package/dist/client/assets/{org-install-DgsgwzFi.js → org-install-BRL26TWn.js} +1 -1
  130. package/dist/client/assets/{org-layout-CkFNhLrh.js → org-layout-7aQLDDnY.js} +1 -1
  131. package/dist/client/assets/{org-plugin-layout-BXdjOse3.js → org-plugin-layout-Ch8ukpQt.js} +1 -1
  132. package/dist/client/assets/{page-seo-form-DgwMXCLr.js → page-seo-form-Cz5Nib_0.js} +1 -1
  133. package/dist/client/assets/page-seo-sheet-CcoAXMMc.js +1 -0
  134. package/dist/client/assets/{pair-D-dPw7Vh.js → pair-BfYvjacw.js} +2 -2
  135. package/dist/client/assets/{plugin-empty-state-CeRXXOD9.js → plugin-empty-state-Bafs814S.js} +1 -1
  136. package/dist/client/assets/{plugin-header-DZqxJKiL.js → plugin-header-CzH_o1AA.js} +1 -1
  137. package/dist/client/assets/{plugin-layout-CGOJQMJE.js → plugin-layout-BrlPuAvi.js} +1 -1
  138. package/dist/client/assets/{popover-Cg9khto7.js → popover-DaxAVDXR.js} +1 -1
  139. package/dist/client/assets/{post-editor-DeTikwJT.js → post-editor-DZv3v9vs.js} +1 -1
  140. package/dist/client/assets/{primitives-B8qUvq34.js → primitives-C2FB52ts.js} +1 -1
  141. package/dist/client/assets/{profile-DcLK_GvV.js → profile-Ch1PMZ--.js} +1 -1
  142. package/dist/client/assets/project-app-view-CNkoTSGZ.js +1 -0
  143. package/dist/client/assets/record-editor-B2xsglRQ.js +1 -0
  144. package/dist/client/assets/registry-BD5AwdfO.js +2 -0
  145. package/dist/client/assets/{registry-layout-CeQDBbI0.js → registry-layout-D5296RDd.js} +1 -1
  146. package/dist/client/assets/{require-capability-LsMjGzeH.js → require-capability-D8n6HrEr.js} +1 -1
  147. package/dist/client/assets/{required-auth-layout-A79U5RVL.js → required-auth-layout-q1UX5iFV.js} +1 -1
  148. package/dist/client/assets/{reset-password-v1OfhuM4.js → reset-password-BUp5wXvt.js} +1 -1
  149. package/dist/client/assets/{resizable-DxL9OiT-.js → resizable-B_wg5OKG.js} +1 -1
  150. package/dist/client/assets/{roles-DrAidx6u.js → roles-CFjXltMh.js} +1 -1
  151. package/dist/client/assets/save-referenced-block-C-C4ro26.js +1 -0
  152. package/dist/client/assets/{save-status-BPgyONO2.js → save-status-CJhEsrLH.js} +1 -1
  153. package/dist/client/assets/{schema-form-CIsE9rP6.js → schema-form-D_d0W0_5.js} +1 -1
  154. package/dist/client/assets/{scroll-area-DOSO9pu3.js → scroll-area-CifcP4Wg.js} +1 -1
  155. package/dist/client/assets/{search-input-fUp8LGk1.js → search-input-eml2HEUh.js} +1 -1
  156. package/dist/client/assets/{secrets-BBpvMqxV.js → secrets-DnWBimzu.js} +1 -1
  157. package/dist/client/assets/{sections-editor-BUSId1Zm.js → sections-editor-GEeJkb9Q.js} +1 -1
  158. package/dist/client/assets/{select-O-homC7-.js → select-Dz7DPkoH.js} +1 -1
  159. package/dist/client/assets/{select-model-C2bxkMXw.js → select-model-B6KC9bZ9.js} +1 -1
  160. package/dist/client/assets/{seo-editor-COYKOkSM.js → seo-editor-yjW-SMAL.js} +1 -1
  161. package/dist/client/assets/{settings-layout-DzAPFM8g.js → settings-layout-Cvw0dTbU.js} +1 -1
  162. package/dist/client/assets/{settings-section-bWEtm5yt.js → settings-section-BkfPlxIX.js} +1 -1
  163. package/dist/client/assets/{sheet-BvtvfFAl.js → sheet-C2OErkZR.js} +1 -1
  164. package/dist/client/assets/{shell-controls-JCdbPD3N.js → shell-controls-CgyBrm6l.js} +1 -1
  165. package/dist/client/assets/{shell-layout-Bhb76vPi.js → shell-layout-D-4Zna-j.js} +1 -1
  166. package/dist/client/assets/{shell-route-loading-mUaMt2AK.js → shell-route-loading-D7iIgnMy.js} +1 -1
  167. package/dist/client/assets/{sidebar-qjaU6R6F.js → sidebar-BT1O99E-.js} +1 -1
  168. package/dist/client/assets/{skeleton-Bs6B9g7A.js → skeleton-bErIIEAe.js} +1 -1
  169. package/dist/client/assets/{sortable.esm-CyfFdOo4.js → sortable.esm-D_73qywG.js} +1 -1
  170. package/dist/client/assets/{spinner-CODSjjQl.js → spinner-DUmur8qx.js} +1 -1
  171. package/dist/client/assets/{sso-ETVhKmcD.js → sso-jmWB0IlU.js} +1 -1
  172. package/dist/client/assets/{store-BWJ3fbUY.js → store-CPLW6WOq.js} +1 -1
  173. package/dist/client/assets/store-registry-BUknjkUH.js +2 -0
  174. package/dist/client/assets/{studio-tools-hfOcm94T.js → studio-tools-B-zlmqyw.js} +1 -1
  175. package/dist/client/assets/{switch-B76FjS24.js → switch-CRVfQAZr.js} +1 -1
  176. package/dist/client/assets/{tab-id-DJcQxSw_.js → tab-id-By_JW--7.js} +2 -2
  177. package/dist/client/assets/{table-DychmbHa.js → table-70fRVfwQ.js} +1 -1
  178. package/dist/client/assets/{tabs-5VCr7Lmg.js → tabs-_yym-ubf.js} +1 -1
  179. package/dist/client/assets/{task-status-BrHrBwF0.js → task-status-B3M1uY2i.js} +1 -1
  180. package/dist/client/assets/{textarea-Oxf83X-s.js → textarea-BhyLj2Dp.js} +1 -1
  181. package/dist/client/assets/{toggle-group-B_flmDPF.js → toggle-group-BYYoZiYB.js} +1 -1
  182. package/dist/client/assets/{toolbar-8WByzcnO.js → toolbar-BQgYgute.js} +1 -1
  183. package/dist/client/assets/{tools-list-dYx9Si__.js → tools-list-Bib10JJv.js} +1 -1
  184. package/dist/client/assets/{tooltip-B7sOnQkv.js → tooltip-D0rD3x8T.js} +1 -1
  185. package/dist/client/assets/{types-DBP54icS.js → types-Bt2jh4HB.js} +1 -1
  186. package/dist/client/assets/{use-ai-providers-CSnlplZs.js → use-ai-providers-BL6EQsm8.js} +1 -1
  187. package/dist/client/assets/{use-automations-Ds0WDnWO.js → use-automations-jCgcI_Hn.js} +1 -1
  188. package/dist/client/assets/{use-capability-CPfyR7lg.js → use-capability-DqPX2R7m.js} +1 -1
  189. package/dist/client/assets/{use-collections-cYI0oKE6.js → use-collections-CH3Uvmj5.js} +1 -1
  190. package/dist/client/assets/{use-connection-lmAzDQtG.js → use-connection-BGpjiuJJ.js} +1 -1
  191. package/dist/client/assets/{use-copy-BZu-B9lH.js → use-copy-DHiMTnai.js} +1 -1
  192. package/dist/client/assets/{use-create-virtual-mcp-Bkzx6tcI.js → use-create-virtual-mcp-8G8o89BT.js} +1 -1
  193. package/dist/client/assets/{use-debounced-autosave-CyyIp3oB.js → use-debounced-autosave-BnF-F24h.js} +1 -1
  194. package/dist/client/assets/{use-delete-connection-2QDp_tYR.js → use-delete-connection-DSxSiAyt.js} +1 -1
  195. package/dist/client/assets/{use-file-configs-BY47ZlQU.js → use-file-configs-CDby3RwC.js} +1 -1
  196. package/dist/client/assets/{use-infinite-scroll-bWgRjm8B.js → use-infinite-scroll-BlDyJWAa.js} +1 -1
  197. package/dist/client/assets/{use-list-state-Dq7vira_.js → use-list-state-nfg3Cb56.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-BgKdABiW.js → use-mcp-client-BoOtVD9g.js} +1 -1
  199. package/dist/client/assets/{use-mcp-prompts-D52UL8AH.js → use-mcp-prompts-CYbN8Yyl.js} +1 -1
  200. package/dist/client/assets/{use-mcp-tools-DVLWn59S.js → use-mcp-tools-DlzThqmJ.js} +1 -1
  201. package/dist/client/assets/{use-members-BY2IDfpw.js → use-members-BLEStPtC.js} +1 -1
  202. package/dist/client/assets/{use-navigate-to-agent-B96HLz_j.js → use-navigate-to-agent-_X_kAEcz.js} +1 -1
  203. package/dist/client/assets/{use-org-auth-client-CdNQL1J3.js → use-org-auth-client-ziK5gAU8.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-ChCwS_VA.js → use-org-sso-BCRYycoj.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-BPVtkwsY.js → use-organization-roles-zr9qa8BU.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-Dpet9l_V.js → use-organization-settings-BQtNgLEs.js} +1 -1
  207. package/dist/client/assets/{use-registry-connections-XCi4lRb-.js → use-registry-connections-CPtcwe6P.js} +1 -1
  208. package/dist/client/assets/{use-secrets-BqVTqitm.js → use-secrets-wimlaYjN.js} +1 -1
  209. package/dist/client/assets/{use-status-sounds-CwFju7iN.js → use-status-sounds-CZU7jLXq.js} +1 -1
  210. package/dist/client/assets/{use-view-mode-B5hNsOGq.js → use-view-mode-BJ_FnvkJ.js} +1 -1
  211. package/dist/client/assets/{use-virtual-mcp-FBTL02d0.js → use-virtual-mcp-_FyR-EfH.js} +1 -1
  212. package/dist/client/assets/useInfiniteQuery-Dzg2BCY9.js +1 -0
  213. package/dist/client/assets/{useRouterState--dWmVQ9c.js → useRouterState-CfhsEB7J.js} +1 -1
  214. package/dist/client/assets/useSuspenseInfiniteQuery-D3ys-EbO.js +1 -0
  215. package/dist/client/assets/{user-Cg2LA8Mh.js → user-CXZKnlfK.js} +1 -1
  216. package/dist/client/assets/{view-mode-toggle-DVxKMSOa.js → view-mode-toggle-BO9qiFWG.js} +1 -1
  217. package/dist/client/assets/{workflow-t9WsYZ9Y.js → workflow-CA6KPd9J.js} +1 -1
  218. package/dist/client/assets/workflow-detail-DzevlE_t.js +1 -0
  219. package/dist/client/index.html +1 -1
  220. package/dist/server/cli.js +421 -513
  221. package/dist/server/migrate.js +98 -98
  222. package/dist/server/server.js +282 -282
  223. package/package.json +1 -1
  224. package/dist/client/assets/app-editor-DcKlfdHo.js +0 -1
  225. package/dist/client/assets/header-tab-button-2U6O3giw.js +0 -5
  226. package/dist/client/assets/page-seo-sheet-B2dnrk9E.js +0 -1
  227. package/dist/client/assets/project-app-view-CUDu3MEL.js +0 -1
  228. package/dist/client/assets/record-editor-Bqbny3n8.js +0 -1
  229. package/dist/client/assets/registry-CT-bGrYc.js +0 -2
  230. package/dist/client/assets/save-referenced-block-6TdaXn38.js +0 -1
  231. package/dist/client/assets/store-registry-BQiuioAM.js +0 -2
  232. package/dist/client/assets/useInfiniteQuery-DMW4zCm0.js +0 -1
  233. package/dist/client/assets/useSuspenseInfiniteQuery-tnhNRWqB.js +0 -1
  234. package/dist/client/assets/workflow-detail-BgLcBn-p.js +0 -1
@@ -1 +1 @@
1
- import{T as R,aJ as V,ba as A,W as a,aH as j,aI as z,e as W,j as u,B as C}from"./index-DBqH3_Tr.js";import{I as H}from"./input-Cuzo-zTy.js";import{s as L}from"./Plus-DXSb81sc.js";import{s as q}from"./Trash01-D8gQFcOn.js";const K=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(K).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:V(a(),A()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function $(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=W.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let T;e[9]!==r||e[10]!==t?(T=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=T):T=e[11];const k=T;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(q,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(L,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[w,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function I(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=I(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=I(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,J as a,Q as b,M as c,Z as d,Y as i,F as p,D as r};
1
+ import{T as R,aJ as V,ba as A,W as a,aH as j,aI as z,e as W,j as u,B as C}from"./index-Dlc4tDxO.js";import{I as H}from"./input-CDaarCl_.js";import{s as L}from"./Plus-Cv0T2Pov.js";import{s as q}from"./Trash01-s7FZsfBC.js";const K=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(K).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:V(a(),A()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function $(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=W.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let T;e[9]!==r||e[10]!==t?(T=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=T):T=e[11];const k=T;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(q,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(L,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[w,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function I(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=I(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=I(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,J as a,Q as b,M as c,Z as d,Y as i,F as p,D as r};
@@ -1 +1 @@
1
- import{e as ce,j as t,E as tt,r as X,l as le,q as ke,f as De,d as nt,b as Ae,u as st,p as ot,L as it,H as at,I as ct,B as M,t as ne,G as rt,c as de,o as W,M as lt,J as dt,K as mt}from"./index-DBqH3_Tr.js";import{g as ut}from"./generate-id-D-Z8lvmk.js";import{C as pt}from"./collection-display-button-ID_MOaLN.js";import{S as ht}from"./search-input-fUp8LGk1.js";import{C as xt}from"./collection-tabs-CrxbRblh.js";import{u as gt,a as we,g as ft,C as ve}from"./connection-card-BMnV5fMv.js";import{E as jt}from"./empty-state-DiL0zFYg.js";import{I as yt}from"./integration-icon-C1XpJ7QJ.js";import{P as pe}from"./index-DCdT8576.js";import{u as Ct,D as vt}from"./use-delete-connection-2QDp_tYR.js";import{u as Ce}from"./use-capability-CPfyR7lg.js";import{u as _t}from"./use-infinite-scroll-bWgRjm8B.js";import{u as bt}from"./use-list-state-Dq7vira_.js";import{g as Te,a as St,e as Nt}from"./extract-connection-data-A3fQ5XNQ.js";import{g as xe}from"./connection-slug-eyAPH6o3.js";import{c as Ie,d as Pe,b as Le,f as Oe,e as $e,g as ze,a as Ee,A as Me}from"./alert-dialog-BqyMBnmX.js";import{C as Fe}from"./checkbox-B-8BZy2m.js";import{D as Ve,a as Be,b as Ue,c as He,e as Re,d as Ke}from"./dialog-C6QaYxl0.js";import{b as kt,a as Dt,c as At,D as wt,d as Tt,e as It,f as Pt}from"./drawer-vaHtyblX.js";import{u as Lt}from"./tooltip-B7sOnQkv.js";import{D as We,a as Xe,b as qe,c as ae}from"./dropdown-menu-Imbn90PR.js";import{F as J,b as Y,c as Z,d as ee,f as te,a as Se}from"./form-9w_l2sE8.js";import{I as ie}from"./input-Cuzo-zTy.js";import{d as Ot,S as $t,a as zt,b as Et,c as re}from"./select-O-homC7-.js";import{T as Mt}from"./textarea-Oxf83X-s.js";import{b as Ge,u as Ft}from"./use-connection-lmAzDQtG.js";import{a as Vt}from"./use-virtual-mcp-FBTL02d0.js";import{u as Bt}from"./studio-tools-hfOcm94T.js";import{S as Ut,a5 as Ht,u as Rt,r as Kt}from"./agent-icon-OWcPDEQ2.js";import{n as ge}from"./Container-DxRK5lMe.js";import{i as Qe}from"./DotsVertical-BD0Jlzeq.js";import{s as Je}from"./Eye-BR5jFpci.js";import{s as ye}from"./Star01-Bj8KnWg6.js";import{s as Ye}from"./Plus-DXSb81sc.js";import{s as Ze}from"./Trash01-D8gQFcOn.js";import{s as et}from"./XClose-Bgoke-N6.js";import{i as he,a as Ne,E as Wt,c as Xt,p as qt,b as Gt,d as Qt}from"./connection-form-helpers-DnPdxsfv.js";import"./collections-BI_JGQp4.js";import"./SwitchHorizontal01-D6F_mKYx.js";import"./Check-Bk-n4rKs.js";import"./view-mode-toggle-DVxKMSOa.js";import"./badge-B2p1Cov_.js";import"./SearchMd-AWrKGzzG.js";import"./use-registry-connections-XCi4lRb-.js";import"./use-mcp-client-BgKdABiW.js";import"./use-organization-settings-Dpet9l_V.js";import"./useInfiniteQuery-DMW4zCm0.js";import"./infiniteQueryObserver-DFtHCFaz.js";import"./card-Cm77QeIs.js";import"./sidebar-qjaU6R6F.js";import"./LayoutLeft-XknICfD_.js";import"./sheet-BvtvfFAl.js";import"./X-Bf_z2Leo.js";import"./use-view-mode-B5hNsOGq.js";import"./ChevronRight-DRFF6KW4.js";import"./label-CcXzfa1l.js";import"./ChevronDown-D_SiD52e.js";import"./ChevronUp-f28rZEwl.js";import"./use-collections-cYI0oKE6.js";import"./AlertCircle-DU7uZY8J.js";import"./Tool01-CE1enLWz.js";import"./RefreshCcw01-CR2Fhw_7.js";import"./XCircle-UQit86MX.js";import"./ArrowUpRight-DEY-b6kE.js";import"./ZapSquare-H66QOKYB.js";import"./Users03-CTeoWFzj.js";import"./CheckCircle-i_SCh8HK.js";import"./ChevronLeft-CJxMMdOC.js";import"./ZoomOut-Cx-hi9HP.js";import"./Globe01-CNB6Mpsd.js";import"./FilterLines-DqLLGuqf.js";import"./Palette-BbNQF7ac.js";import"./HardDrive-p4TajzWn.js";import"./Stars02-C_A7q-Eh.js";import"./Key01-DSBXnSBm.js";import"./LinkExternal01-DtQPZgan.js";import"./Monitor01-B2xyeevM.js";import"./Sun-DXzJdR2z.js";import"./Play-TWKPwhCM.js";import"./Settings02-C46G6WCc.js";import"./Shield01-CX_dkwPt.js";import"./Stars01-EZHZaPSP.js";import"./Upload01-Br3xRIzS.js";import"./User01-D6Gs71XK.js";import"./Users01-Bb-aDnk6.js";import"./Zap-TkrtxiYp.js";function Jt(v){const e=ce.c(51),{group:n,onOpen:p,selectionMode:u,selectedIds:m,onToggleSelect:l}=v;let h;if(e[0]!==n.connections||e[1]!==m){let C;e[3]!==m?(C=P=>m.has(P.id),e[3]=m,e[4]=C):C=e[4],h=n.connections.every(C),e[0]=n.connections,e[1]=m,e[2]=h}else h=e[2];const g=h;let y;if(e[5]!==n.connections||e[6]!==m){let C;e[8]!==m?(C=P=>m.has(P.id),e[8]=m,e[9]=C):C=e[9],y=n.connections.some(C),e[5]=n.connections,e[6]=m,e[7]=y}else y=e[7];const x=y,S=`${n.connections.length} instances`;let N;e[10]!==n.icon||e[11]!==n.title||e[12]!==S?(N={title:n.title,icon:n.icon,description:S},e[10]=n.icon,e[11]=n.title,e[12]=S,e[13]=N):N=e[13];let c;e[14]!==g||e[15]!==n.connections||e[16]!==p||e[17]!==l||e[18]!==m||e[19]!==u?(c=()=>u?(()=>{for(const C of n.connections)g?m.has(C.id)&&l(C.id):m.has(C.id)||l(C.id)})():p(),e[14]=g,e[15]=n.connections,e[16]=p,e[17]=l,e[18]=m,e[19]=u,e[20]=c):c=e[20];const j=u&&g&&"ring-2 ring-primary",d=u&&x&&!g&&"ring-1 ring-primary/50";let k;e[21]!==j||e[22]!==d?(k=de(j,d),e[21]=j,e[22]=d,e[23]=k):k=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==g||e[26]!==n.connections||e[27]!==l||e[28]!==m||e[29]!==u||e[30]!==x?(D=u?t.jsx(Fe,{checked:g?!0:x?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)g?m.has(C.id)&&l(C.id):m.has(C.id)||l(C.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=g,e[26]=n.connections,e[27]=l,e[28]=m,e[29]=u,e[30]=x,e[31]=D):D=e[31];const U=u?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let F;e[32]!==U?(F=de("overflow-hidden transition-all duration-150 ease-out",U),e[32]=U,e[33]=F):F=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Xe,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Zt,children:t.jsx(Qe,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Je,{size:16}),e[37]=V):V=e[37];let $;e[38]!==A?($=t.jsxs(We,{children:[s,t.jsx(qe,{align:"end",onClick:Yt,children:t.jsxs(ae,{onClick:A,children:[V,"Open"]})})]}),e[38]=A,e[39]=$):$=e[39];let w;e[40]!==F||e[41]!==$?(w=t.jsx("div",{className:F,children:$}),e[40]=F,e[41]=$,e[42]=w):w=e[42];let L;e[43]!==D||e[44]!==w?(L=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=L):L=e[45];let B;return e[46]!==L||e[47]!==N||e[48]!==c||e[49]!==k?(B=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:N,onClick:c,className:k,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:L})}),e[46]=L,e[47]=N,e[48]=c,e[49]=k,e[50]=B):B=e[50],B}function Yt(v){return v.stopPropagation()}function Zt(v){return v.stopPropagation()}function en(v){const e=ce.c(23),{count:n,total:p,canManage:u,canManageAgents:m,onSelectAll:l,onDeselectAll:h,onDelete:g,onAddToAgent:y,onToggleStatus:x,onCancel:S}=v;if(n===0)return null;let N;e[0]!==n?(N=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let c;e[2]!==n||e[3]!==h||e[4]!==l||e[5]!==p?(c=n<p?t.jsxs(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:["Select all (",p,")"]}):t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:"Clear selection"}),e[2]=n,e[3]=h,e[4]=l,e[5]=p,e[6]=c):c=e[6];let j;e[7]!==m||e[8]!==y?(j=m&&t.jsxs(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:y,children:[t.jsx(Ye,{size:13}),"Add to Agent"]}),e[7]=m,e[8]=y,e[9]=j):j=e[9];let d;e[10]!==u||e[11]!==g||e[12]!==x?(d=u&&t.jsxs(t.Fragment,{children:[t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("active"),children:"Enable"}),t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("inactive"),children:"Disable"}),t.jsxs(M,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:[t.jsx(Ze,{size:13}),"Delete"]})]}),e[10]=u,e[11]=g,e[12]=x,e[13]=d):d=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(et,{size:13}),e[14]=k):k=e[14];let _;e[15]!==S?(_=t.jsx(M,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:S,children:k}),e[15]=S,e[16]=_):_=e[16];let D;return e[17]!==N||e[18]!==c||e[19]!==j||e[20]!==d||e[21]!==_?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[N,c,j,d,_]})}),e[17]=N,e[18]=c,e[19]=j,e[20]=d,e[21]=_,e[22]=D):D=e[22],D}function tn(v){const e=ce.c(25),{open:n,onOpenChange:p,agents:u,onConfirm:m}=v,[l,h]=X.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs(Ue,{children:[t.jsx(He,{children:"Add to Agent"}),t.jsx(Re,{children:"Select an agent to add the selected connections to."})]}),e[0]=g):g=e[0];let y;e[1]!==u||e[2]!==l?(y=u.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):u.map(D=>t.jsxs("button",{type:"button",onClick:()=>h(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",l===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(yt,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=u,e[2]=l,e[3]=y):y=e[3];let x;e[4]!==y?(x=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[4]=y,e[5]=x):x=e[5];let S;e[6]!==p?(S=t.jsx(M,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=S):S=e[7];const N=!l;let c;e[8]!==m||e[9]!==p||e[10]!==l?(c=()=>{l&&(m(l),p(!1),h(null))},e[8]=m,e[9]=p,e[10]=l,e[11]=c):c=e[11];let j;e[12]!==N||e[13]!==c?(j=t.jsx(M,{disabled:N,onClick:c,children:"Add"}),e[12]=N,e[13]=c,e[14]=j):j=e[14];let d;e[15]!==S||e[16]!==j?(d=t.jsxs(Ke,{children:[S,j]}),e[15]=S,e[16]=j,e[17]=d):d=e[17];let k;e[18]!==x||e[19]!==d?(k=t.jsxs(Be,{className:"sm:max-w-[400px]",children:[g,x,d]}),e[18]=x,e[19]=d,e[20]=k):k=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==k?(_=t.jsx(Ve,{open:n,onOpenChange:p,children:k}),e[21]=p,e[22]=n,e[23]=k,e[24]=_):_=e[24],_}function nn(v){const e=ce.c(20),{open:n,onOpenChange:p,count:u,onConfirm:m}=v,l=u!==1?"s":"";let h;e[0]!==u||e[1]!==l?(h=t.jsxs(Ie,{children:["Delete ",u," connection",l,"?"]}),e[0]=u,e[1]=l,e[2]=h):h=e[2];const g=u!==1?"s":"";let y;e[3]!==g?(y=t.jsxs(Pe,{children:["This will permanently delete the selected connection",g,". This action cannot be undone."]}),e[3]=g,e[4]=y):y=e[4];let x;e[5]!==h||e[6]!==y?(x=t.jsxs(Le,{children:[h,y]}),e[5]=h,e[6]=y,e[7]=x):x=e[7];let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Oe,{children:"Cancel"}),e[8]=S):S=e[8];const N=u!==1?"s":"";let c;e[9]!==u||e[10]!==m||e[11]!==N?(c=t.jsxs($e,{children:[S,t.jsxs(ze,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",u," connection",N]})]}),e[9]=u,e[10]=m,e[11]=N,e[12]=c):c=e[12];let j;e[13]!==x||e[14]!==c?(j=t.jsxs(Ee,{children:[x,c]}),e[13]=x,e[14]=c,e[15]=j):j=e[15];let d;return e[16]!==p||e[17]!==n||e[18]!==j?(d=t.jsx(Me,{open:n,onOpenChange:p,children:j}),e[16]=p,e[17]=n,e[18]=j,e[19]=d):d=e[19],d}function sn(v){return v._registryId?.includes("community-registry")===!0}function on(v){const e=ce.c(58),{item:n,canManage:p,allConnections:u,connectedAppNames:m,connectingItemId:l,onNavigateConnected:h,onConnect:g}=v,[y,x]=X.useState(!1),[S,N]=X.useState(null);let c,j;e[0]!==m||e[1]!==n?(c=Te(n)??"",j=m.has(c),e[0]=m,e[1]=n,e[2]=c,e[3]=j):(c=e[2],j=e[3]);const d=j,k=n._meta?.["mcp.mesh"],_=k?.friendlyName||k?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let U;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(U=n.server?.icons?.[0]?.src||St(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=U):U=e[6];const F=U;let s;if(e[7]!==u||e[8]!==c){let b;e[10]!==c?(b=se=>se.connection_type!=="VIRTUAL"&&se.app_name===c,e[10]=c,e[11]=b):b=e[11],s=u.filter(b),e[7]=u,e[8]=c,e[9]=s}else s=e[9];const A=s;let V;e[12]!==n?(V=sn(n),e[12]=n,e[13]=V):V=e[13];const $=V;let w,L;e[14]!==A||e[15]!==p||e[16]!==$||e[17]!==d||e[18]!==n||e[19]!==g||e[20]!==h?(w=()=>{if(d){const b=A[0];b&&h(b);return}p&&L()},L=()=>{$?(N("connect"),x(!0)):g(n)},e[14]=A,e[15]=p,e[16]=$,e[17]=d,e[18]=n,e[19]=g,e[20]=h,e[21]=w,e[22]=L):(w=e[21],L=e[22]);let B;e[23]!==n||e[24]!==g||e[25]!==S?(B=()=>{ne("connections_community_warning_confirmed",{registry_item_id:n.id}),x(!1),S==="connect"&&g(n),N(null)},e[23]=n,e[24]=g,e[25]=S,e[26]=B):B=e[26];const C=B;let P;e[27]!==D||e[28]!==F||e[29]!==_?(P={title:_,description:D,icon:F},e[27]=D,e[28]=F,e[29]=_,e[30]=P):P=e[30];let Q;e[31]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(ge,{}),e[31]=Q):Q=e[31];let R;e[32]!==$||e[33]!==n._sourceIcon?(R=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=$,e[33]=n._sourceIcon,e[34]=R):R=e[34];let q;e[35]!==p||e[36]!==l||e[37]!==L||e[38]!==d||e[39]!==n.id?(q=d?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(M,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:l!==null,onClick:b=>{b.stopPropagation(),L()},children:l===n.id?t.jsx(le,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=l,e[37]=L,e[38]=d,e[39]=n.id,e[40]=q):q=e[40];let i;e[41]!==R||e[42]!==q?(i=t.jsxs("div",{className:"flex items-center gap-2",children:[R,q]}),e[41]=R,e[42]=q,e[43]=i):i=e[43];let f;e[44]!==w||e[45]!==i||e[46]!==P?(f=t.jsx(ve,{connection:P,fallbackIcon:Q,onClick:w,headerActionsAlwaysVisible:!0,headerActions:i}),e[44]=w,e[45]=i,e[46]=P,e[47]=f):f=e[47];let O;e[48]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Le,{children:[t.jsx(Ie,{children:"Community MCP Server"}),t.jsx(Pe,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=O):O=e[48];let H;e[49]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Oe,{children:"Cancel"}),e[49]=H):H=e[49];let z;e[50]!==C?(z=t.jsxs(Ee,{children:[O,t.jsxs($e,{children:[H,t.jsx(ze,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=z):z=e[51];let r;e[52]!==y||e[53]!==z?(r=t.jsx(Me,{open:y,onOpenChange:x,children:z}),e[52]=y,e[53]=z,e[54]=r):r=e[54];let I;return e[55]!==f||e[56]!==r?(I=t.jsxs(t.Fragment,{children:[f,r]}),e[55]=f,e[56]=r,e[57]=I):I=e[57],I}function an({listState:v,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:u,enabledRegistries:m}){const{org:l}=ke(),h=rt(),g=De(),{data:y}=Ae.useSession(),x=Ge(),S=Ft(v),N=Ct(),{granted:c}=Ce("connections:manage"),{granted:j}=Ce("agents:manage"),[d,k]=X.useState(new Set),_=d.size>0,[D,U]=X.useState(!1),[F,s]=X.useState(!1),[A,V]=X.useState(null),$=Vt(),w=S.filter(o=>!(n!=="ALL"&&o.connection_type!==n||p!=="ALL"&&o.status!==p)),L=ft(w),B=o=>{k(a=>{const E=new Set(a);return E.has(o)?E.delete(o):E.add(o),E})},C=()=>{k(new Set)},P=we(m,v.searchTerm),Q=P.items,R=_t(P.loadMore,P.hasMore,P.isLoadingMore),q=new Set(S.filter(o=>o.app_name).map(o=>o.app_name)),i=u==="ALL"||m.some(o=>o.id===u)?u:"ALL",f=v.search.length>0,O=e==="all"||f?Q.filter(o=>{if(i!=="ALL"&&o._registryId!==i)return!1;if(f){const a=Te(o);if(a&&q.has(a))return!1}return!0}):[],H=e==="connected"||f?L:[],z=async o=>{if(!(!l||!y?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:o.id,source:"connections_page"}),V(o.id);try{const a=Nt(o,l.id,y.user.id,{remoteIndex:0}),E=a.connection_type==="STDIO",T=!!a.connection_url,G=E&&a.connection_headers&&typeof a.connection_headers=="object"&&"command"in a.connection_headers;if(!T&&!G){W.error("This MCP Server cannot be connected: no connection method available"),V(null);return}const{id:K}=await x.create.mutateAsync(a),_e=new URL(`/api/${l.slug}/mcp/${K}`,window.location.origin),be=await lt({url:_e.href,token:null,orgId:l.id});if(be.supportsOAuth&&!be.isAuthenticated){const{token:ue,tokenInfo:oe,error:je}=await dt({connectionId:K,orgSlug:l.slug,scope:"offline_access"});if(je||!ue){ne("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:je??"no_token"}),W.error(`Authentication failed: ${je??"no token received"}`);return}else{if(ne("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),oe)try{(await fetch(`/api/${l.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:oe.accessToken,refreshToken:oe.refreshToken,expiresIn:oe.expiresIn,scope:oe.scope,clientId:oe.clientId,clientSecret:oe.clientSecret,tokenEndpoint:oe.tokenEndpoint})})).ok?await x.update.mutateAsync({id:K,data:{}}):await x.update.mutateAsync({id:K,data:{connection_token:ue}})}catch{await x.update.mutateAsync({id:K,data:{connection_token:ue}})}else await x.update.mutateAsync({id:K,data:{connection_token:ue}});await h.invalidateQueries({queryKey:mt.isMCPAuthenticated(_e.href,null)}),W.success("Authentication successful")}}W.success("Connected successfully")}catch(a){W.error(`Failed to connect: ${a instanceof Error?a.message:String(a)}`)}finally{V(null)}}},r=Bt(),I=()=>{h.invalidateQueries({predicate:o=>{const a=o.queryKey;return a[1]===l.id&&a[3]==="collection"&&a[4]==="CONNECTIONS"}})},b=async()=>{U(!1);const o=[...d];ne("connections_bulk_delete",{count:o.length});let a=0;for(const E of o)try{await r.call("COLLECTION_CONNECTIONS_DELETE",{id:E,force:!0}),a++}catch{}I(),W.success(`Deleted ${a} connection${a!==1?"s":""}`),C()},se=async(o,a)=>{try{await x.update.mutateAsync({id:o,data:{status:a}}),I(),W.success(a==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},fe=async o=>{const a=[...d];ne("connections_bulk_status_toggled",{count:a.length,to_status:o});let E=0;for(const T of a)try{await x.update.mutateAsync({id:T,data:{status:o}}),E++}catch{}I(),W.success(`${o==="active"?"Enabled":"Disabled"} ${E} connection${E!==1?"s":""}`),C()},me=async o=>{const a=$.find(G=>G.id===o);if(!a)return;ne("connections_bulk_add_to_agent",{agent_id:o,count:d.size});const E=new Set(a.connections.map(G=>G.connection_id)),T=[...d].filter(G=>!E.has(G)).map(G=>({connection_id:G,selected_tools:null,selected_resources:null,selected_prompts:null}));if(T.length===0){W.info("All selected connections are already in that agent");return}try{await r.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:o,data:{connections:[...a.connections,...T]}}),h.invalidateQueries({predicate:G=>{const K=G.queryKey;return K[1]===l.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),W.success(`Added ${T.length} connection${T.length!==1?"s":""} to "${a.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(vt,{...N}),t.jsx(nn,{open:D,onOpenChange:U,count:d.size,onConfirm:b}),t.jsx(tn,{open:F,onOpenChange:s,agents:$,onConfirm:me}),P.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(f?O.length===0&&w.length===0:e==="all"?O.length===0:w.length===0)?t.jsx(jt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:v.search?`No Connections match "${v.search}"`:c?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[H.map(o=>{if(o.type==="group")return t.jsx(Jt,{group:o,onOpen:()=>{g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:o.key}})},selectionMode:_,selectedIds:d,onToggleSelect:B},o.key);const a=o.connection,E=d.has(a.id);return t.jsx(ve,{connection:a,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?B(a.id):g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}}),className:de(E&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:E,onCheckedChange:()=>B(a.id),onClick:T=>T.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:de("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(We,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:T=>T.stopPropagation(),children:t.jsx(Qe,{size:20})})}),t.jsxs(qe,{align:"end",onClick:T=>T.stopPropagation(),children:[t.jsxs(ae,{onClick:T=>{T.stopPropagation(),g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}})},children:[t.jsx(Je,{size:16}),"Open"]}),(c||j)&&t.jsxs(ae,{onClick:T=>{T.stopPropagation(),B(a.id)},children:[t.jsx(Ht,{size:16}),"Select"]}),c&&(a.status==="active"?t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"inactive")},children:[t.jsx(Rt,{size:16}),"Disable"]}):t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"active")},children:[t.jsx(Kt,{size:16}),"Enable"]})),c&&t.jsxs(ae,{variant:"destructive",onClick:T=>{T.stopPropagation(),N.requestDelete(a)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]})})]})},a.id)}),O.map(o=>t.jsx(on,{item:o,canManage:c,allConnections:S,connectedAppNames:q,connectingItemId:A,onNavigateConnected:a=>g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}}),onConnect:z},`catalog-${o._registryId}:${o.id}`)),(e==="all"||f)&&m.length>0&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||f)&&P.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(le,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(en,{count:d.size,total:w.length,canManage:c,canManageAgents:j,onSelectAll:()=>{k(new Set(w.map(o=>o.id)))},onDeselectAll:()=>k(new Set),onDelete:()=>U(!0),onAddToAgent:()=>s(!0),onToggleStatus:fe,onCancel:C})]})}function cn(){const{org:v}=ke(),e=De(),n=nt({strict:!1}),{data:p}=Ae.useSession(),{stdioEnabled:u}=st(),m=Lt(),{granted:l}=Ce("connections:manage"),h=bt({namespace:v.slug,resource:"connections"}),g=Ge(),[y,x]=ot(it.connectionsTab(v.slug),i=>n.tab==="all"||n.tab==="connected"?n.tab:i??"all"),[S,N]=X.useState("ALL"),[c,j]=X.useState("ALL"),[d,k]=X.useState("ALL"),_=gt(),U=we(_,h.searchTerm).items,F=h.search!==h.searchTerm,s=at({resolver:ct(Xt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),V=s.watch("connection_url"),$=s.watch("npx_package"),w=he({uiType:A,connectionUrl:V??"",npxPackage:$??""})??Ne({uiType:A,connectionUrl:V??"",registryItems:U}),L=l&&n.action==="create",B=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:v.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:v.slug},search:{}})},P=async i=>{let f,O=null,H=null,z=null;i.ui_type==="NPX"?(f="STDIO",O="",z=Gt(i.npx_package||"",i.env_vars||[])):i.ui_type==="STDIO"?(f="STDIO",O="",z=Qt(i.stdio_command||"",i.stdio_args||"",i.stdio_cwd,i.env_vars||[])):(f=i.ui_type,O=i.connection_url||"",H=i.connection_token||null);const r=ut("conn");ne("connection_custom_created",{connection_type:f,ui_type:i.ui_type}),await g.create.mutateAsync({id:r,title:i.title,description:i.description||null,connection_type:f,connection_url:O,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:v.id,icon:i.icon??null,app_name:null,app_id:null,connection_headers:z,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:v.slug,appSlug:xe({app_name:null,connection_url:O,title:i.title,id:r})}})},Q=i=>{i||(L&&C(),s.reset())},R=i=>{const f=i.trim();if(!f)return;const O=!!s.formState.dirtyFields.title,H=!!s.formState.dirtyFields.description,z=!!s.formState.dirtyFields.env_vars,r=b=>{if(b&&(!O&&!s.getValues("title").trim()&&b.title&&s.setValue("title",b.title,{shouldDirty:!1}),!H&&!(s.getValues("description")??"").trim()&&b.description&&s.setValue("description",b.description,{shouldDirty:!1}),!z&&b.envVarKeys?.length)){const se=s.getValues("env_vars")??[],fe=new Set(se.map(o=>o.key)),me=b.envVarKeys.filter(o=>!fe.has(o));me.length>0&&s.setValue("env_vars",[...se,...me.map(o=>({key:o,value:""}))],{shouldDirty:!0})}},I=qt(f);if(I&&u){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",I.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),r(he({uiType:"NPX",npxPackage:I.packageName}));return}if(f.startsWith("http://")||f.startsWith("https://")){const b=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",b,{shouldDirty:!0}),s.setValue("connection_url",f,{shouldDirty:!0}),r(he({uiType:b,connectionUrl:f})??Ne({uiType:b,connectionUrl:f,registryItems:U}));return}A==="NPX"&&r(he({uiType:"NPX",npxPackage:f}))},q=l?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(M,{variant:"outline",onClick:B,children:[t.jsx(Ye,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const i="Create Connection",f="Create a custom connection in your organization. Fill in the details below.",O=s.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(J,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Type *"}),t.jsxs(Ot,{value:r.value,onValueChange:r.onChange,children:[t.jsx(ee,{children:t.jsx($t,{children:t.jsx(zt,{})})}),t.jsxs(Et,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(te,{})]})}),A==="NPX"&&t.jsx(J,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"NPM Package *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value??"",onPaste:I=>{const b=I.clipboardData.getData("text");b&&(I.preventDefault(),s.setValue("npx_package",b.trim(),{shouldDirty:!0}),R(b))},onBlur:I=>{R(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(J,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Command *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"node, bun, python...",...r,value:r.value??""})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Arguments"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...r,value:r.value??""})}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Working Directory"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...r,value:r.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(te,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(J,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Environment Variables"}),t.jsx(ee,{children:t.jsx(Wt,{value:r.value??[],onChange:r.onChange})}),t.jsx(te,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(J,{control:s.control,name:"connection_url",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"URL *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...r,value:r.value??"",onPaste:I=>{const b=I.clipboardData.getData("text");b&&(I.preventDefault(),s.setValue("connection_url",b.trim(),{shouldDirty:!0}),R(b))},onBlur:I=>{R(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:w?.token?.label??"Token (optional)"}),t.jsx(ee,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...r,value:r.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"title",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Name *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"My Connection",...r})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"description",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Description"}),t.jsx(ee,{children:t.jsx(Mt,{placeholder:"A brief description of this connection",rows:3,...r,value:r.value??""})}),t.jsx(te,{})]})})]}),z=L;return m?t.jsx(kt,{open:z,onOpenChange:Q,children:t.jsxs(Dt,{className:"max-h-[90vh]",children:[t.jsx(At,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(wt,{children:i}),t.jsx(Tt,{className:"mt-1",children:f})]}),t.jsx(It,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(et,{size:16})})})]})}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(Pt,{children:t.jsx(M,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:O})})]})})]})}):t.jsx(Ve,{open:z,onOpenChange:Q,children:t.jsxs(Be,{className:"sm:max-w-[525px]",children:[t.jsxs(Ue,{children:[t.jsx(He,{children:i}),t.jsx(Re,{children:f})]}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Ke,{children:[t.jsx(M,{type:"button",variant:"outline",onClick:()=>Q(!1),children:"Cancel"}),t.jsx(M,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:O})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ht,{value:h.search,onChange:h.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(h.setSearch(""),i.target.blur())}}),t.jsx(pt,{sortKey:h.sortKey,sortDirection:h.sortDirection,onSort:h.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:S,onChange:i=>N(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:c,onChange:i=>j(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:d,onChange:i=>k(i||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(i=>({id:i.id,label:i.id.includes("community-registry")?"Community MCP Registry":i.title}))]}]:[]]})]}),q]}),t.jsx(xt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:y,onTabChange:i=>{const f=i;f!==y&&ne("connections_page_tab_changed",{to_tab:f}),x(f)}}),t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:F?.5:1,transition:F?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:F?"none":"auto"},children:t.jsx(an,{listState:h,activeTab:y,typeFilter:S,statusFilter:c,registryFilter:d,enabledRegistries:_})})})]})})})]})})}function Bs(){const v=ce.c(1);let e;return v[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tt,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(cn,{})})}),v[0]=e):e=v[0],e}export{Bs as default};
1
+ import{e as ce,j as t,E as tt,r as X,l as le,q as ke,f as De,d as nt,b as Ae,u as st,p as ot,L as it,H as at,I as ct,B as M,t as ne,G as rt,c as de,o as W,M as lt,J as dt,K as mt}from"./index-Dlc4tDxO.js";import{g as ut}from"./generate-id-BrtbvnKY.js";import{C as pt}from"./collection-display-button-0uuG9Zva.js";import{S as ht}from"./search-input-eml2HEUh.js";import{C as xt}from"./collection-tabs-CdfD34L4.js";import{u as gt,a as we,g as ft,C as ve}from"./connection-card-DEvkcpmQ.js";import{E as jt}from"./empty-state-o52Hq4fy.js";import{I as yt}from"./integration-icon-DylMdkB7.js";import{P as pe}from"./index-NNvehl9i.js";import{u as Ct,D as vt}from"./use-delete-connection-DSxSiAyt.js";import{u as Ce}from"./use-capability-DqPX2R7m.js";import{u as _t}from"./use-infinite-scroll-BlDyJWAa.js";import{u as bt}from"./use-list-state-nfg3Cb56.js";import{g as Te,a as St,e as Nt}from"./extract-connection-data-Uz57CpVC.js";import{g as xe}from"./connection-slug-eyAPH6o3.js";import{c as Ie,d as Pe,b as Le,f as Oe,e as $e,g as ze,a as Ee,A as Me}from"./alert-dialog-CBzhgusU.js";import{C as Fe}from"./checkbox-Cwl_z5GL.js";import{D as Ve,a as Be,b as Ue,c as He,e as Re,d as Ke}from"./dialog-IkiImd7I.js";import{b as kt,a as Dt,c as At,D as wt,d as Tt,e as It,f as Pt}from"./drawer-DO_U_Bhd.js";import{u as Lt}from"./tooltip-D0rD3x8T.js";import{D as We,a as Xe,b as qe,c as ae}from"./dropdown-menu-C-Cxaez8.js";import{F as J,b as Y,c as Z,d as ee,f as te,a as Se}from"./form-ChQh_wIn.js";import{I as ie}from"./input-CDaarCl_.js";import{d as Ot,S as $t,a as zt,b as Et,c as re}from"./select-Dz7DPkoH.js";import{T as Mt}from"./textarea-BhyLj2Dp.js";import{b as Ge,u as Ft}from"./use-connection-BGpjiuJJ.js";import{a as Vt}from"./use-virtual-mcp-_FyR-EfH.js";import{u as Bt}from"./studio-tools-B-zlmqyw.js";import{S as Ut,a5 as Ht,u as Rt,r as Kt}from"./agent-icon-D1ySfhKA.js";import{n as ge}from"./Container-DZBZNA8Y.js";import{i as Qe}from"./DotsVertical-jUGLCiy5.js";import{s as Je}from"./Eye-CGoLCmzu.js";import{s as ye}from"./Star01-BjpgI7im.js";import{s as Ye}from"./Plus-Cv0T2Pov.js";import{s as Ze}from"./Trash01-s7FZsfBC.js";import{s as et}from"./XClose-N2P2hiYb.js";import{i as he,a as Ne,E as Wt,c as Xt,p as qt,b as Gt,d as Qt}from"./connection-form-helpers-BxYEqmM8.js";import"./collections-CXYJ8MVZ.js";import"./SwitchHorizontal01-CLZ8VEjC.js";import"./Check-DHmAQH53.js";import"./view-mode-toggle-BO9qiFWG.js";import"./badge-CikIA9ZK.js";import"./SearchMd-BP9M1g2N.js";import"./use-registry-connections-CPtcwe6P.js";import"./use-mcp-client-BoOtVD9g.js";import"./use-organization-settings-BQtNgLEs.js";import"./useInfiniteQuery-Dzg2BCY9.js";import"./infiniteQueryObserver-D4Z6Hq7s.js";import"./card-DmbfBYZU.js";import"./sidebar-BT1O99E-.js";import"./LayoutLeft-CLZVvVLM.js";import"./sheet-C2OErkZR.js";import"./X-CMYaHMo4.js";import"./use-view-mode-BJ_FnvkJ.js";import"./ChevronRight-BJSYQUmF.js";import"./label-CmtFIrH6.js";import"./ChevronDown-CN6qoGcG.js";import"./ChevronUp-CTGwFzLw.js";import"./use-collections-CH3Uvmj5.js";import"./AlertCircle-De-QnqNt.js";import"./Tool01-DPPRaW86.js";import"./RefreshCcw01-CcpA4rje.js";import"./XCircle-BdbzgmP6.js";import"./ArrowUpRight-B0GfNpsw.js";import"./ZapSquare-AN7R7mTa.js";import"./Users03-CKUicuTa.js";import"./CheckCircle-DKSRB9Xd.js";import"./ChevronLeft-HFx1Uufy.js";import"./ZoomOut-Xe1itnU7.js";import"./Globe01--hrfRyvA.js";import"./FilterLines-DYSfUppO.js";import"./Palette-B9PbEO6t.js";import"./HardDrive-yKlUP3QG.js";import"./Stars02-Cv3Kyp_N.js";import"./Key01-DqH2W8Qa.js";import"./LinkExternal01-CaYoYL1Y.js";import"./Monitor01-BRL4_dKI.js";import"./Sun-C0I4hv8e.js";import"./Play-Btpg8EpH.js";import"./Settings02-BMRrFVdB.js";import"./Shield01-rOhEAWZ1.js";import"./Stars01-yuWjNyMF.js";import"./Upload01-xUCMslnL.js";import"./User01-BsF0RS3z.js";import"./Users01-D-iBSVXa.js";import"./Zap-gqEvk94k.js";function Jt(v){const e=ce.c(51),{group:n,onOpen:p,selectionMode:u,selectedIds:m,onToggleSelect:l}=v;let h;if(e[0]!==n.connections||e[1]!==m){let C;e[3]!==m?(C=P=>m.has(P.id),e[3]=m,e[4]=C):C=e[4],h=n.connections.every(C),e[0]=n.connections,e[1]=m,e[2]=h}else h=e[2];const g=h;let y;if(e[5]!==n.connections||e[6]!==m){let C;e[8]!==m?(C=P=>m.has(P.id),e[8]=m,e[9]=C):C=e[9],y=n.connections.some(C),e[5]=n.connections,e[6]=m,e[7]=y}else y=e[7];const x=y,S=`${n.connections.length} instances`;let N;e[10]!==n.icon||e[11]!==n.title||e[12]!==S?(N={title:n.title,icon:n.icon,description:S},e[10]=n.icon,e[11]=n.title,e[12]=S,e[13]=N):N=e[13];let c;e[14]!==g||e[15]!==n.connections||e[16]!==p||e[17]!==l||e[18]!==m||e[19]!==u?(c=()=>u?(()=>{for(const C of n.connections)g?m.has(C.id)&&l(C.id):m.has(C.id)||l(C.id)})():p(),e[14]=g,e[15]=n.connections,e[16]=p,e[17]=l,e[18]=m,e[19]=u,e[20]=c):c=e[20];const j=u&&g&&"ring-2 ring-primary",d=u&&x&&!g&&"ring-1 ring-primary/50";let k;e[21]!==j||e[22]!==d?(k=de(j,d),e[21]=j,e[22]=d,e[23]=k):k=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==g||e[26]!==n.connections||e[27]!==l||e[28]!==m||e[29]!==u||e[30]!==x?(D=u?t.jsx(Fe,{checked:g?!0:x?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)g?m.has(C.id)&&l(C.id):m.has(C.id)||l(C.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=g,e[26]=n.connections,e[27]=l,e[28]=m,e[29]=u,e[30]=x,e[31]=D):D=e[31];const U=u?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let F;e[32]!==U?(F=de("overflow-hidden transition-all duration-150 ease-out",U),e[32]=U,e[33]=F):F=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Xe,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Zt,children:t.jsx(Qe,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Je,{size:16}),e[37]=V):V=e[37];let $;e[38]!==A?($=t.jsxs(We,{children:[s,t.jsx(qe,{align:"end",onClick:Yt,children:t.jsxs(ae,{onClick:A,children:[V,"Open"]})})]}),e[38]=A,e[39]=$):$=e[39];let w;e[40]!==F||e[41]!==$?(w=t.jsx("div",{className:F,children:$}),e[40]=F,e[41]=$,e[42]=w):w=e[42];let L;e[43]!==D||e[44]!==w?(L=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=L):L=e[45];let B;return e[46]!==L||e[47]!==N||e[48]!==c||e[49]!==k?(B=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:N,onClick:c,className:k,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:L})}),e[46]=L,e[47]=N,e[48]=c,e[49]=k,e[50]=B):B=e[50],B}function Yt(v){return v.stopPropagation()}function Zt(v){return v.stopPropagation()}function en(v){const e=ce.c(23),{count:n,total:p,canManage:u,canManageAgents:m,onSelectAll:l,onDeselectAll:h,onDelete:g,onAddToAgent:y,onToggleStatus:x,onCancel:S}=v;if(n===0)return null;let N;e[0]!==n?(N=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let c;e[2]!==n||e[3]!==h||e[4]!==l||e[5]!==p?(c=n<p?t.jsxs(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:["Select all (",p,")"]}):t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:"Clear selection"}),e[2]=n,e[3]=h,e[4]=l,e[5]=p,e[6]=c):c=e[6];let j;e[7]!==m||e[8]!==y?(j=m&&t.jsxs(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:y,children:[t.jsx(Ye,{size:13}),"Add to Agent"]}),e[7]=m,e[8]=y,e[9]=j):j=e[9];let d;e[10]!==u||e[11]!==g||e[12]!==x?(d=u&&t.jsxs(t.Fragment,{children:[t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("active"),children:"Enable"}),t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("inactive"),children:"Disable"}),t.jsxs(M,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:[t.jsx(Ze,{size:13}),"Delete"]})]}),e[10]=u,e[11]=g,e[12]=x,e[13]=d):d=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(et,{size:13}),e[14]=k):k=e[14];let _;e[15]!==S?(_=t.jsx(M,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:S,children:k}),e[15]=S,e[16]=_):_=e[16];let D;return e[17]!==N||e[18]!==c||e[19]!==j||e[20]!==d||e[21]!==_?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[N,c,j,d,_]})}),e[17]=N,e[18]=c,e[19]=j,e[20]=d,e[21]=_,e[22]=D):D=e[22],D}function tn(v){const e=ce.c(25),{open:n,onOpenChange:p,agents:u,onConfirm:m}=v,[l,h]=X.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs(Ue,{children:[t.jsx(He,{children:"Add to Agent"}),t.jsx(Re,{children:"Select an agent to add the selected connections to."})]}),e[0]=g):g=e[0];let y;e[1]!==u||e[2]!==l?(y=u.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):u.map(D=>t.jsxs("button",{type:"button",onClick:()=>h(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",l===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(yt,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=u,e[2]=l,e[3]=y):y=e[3];let x;e[4]!==y?(x=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[4]=y,e[5]=x):x=e[5];let S;e[6]!==p?(S=t.jsx(M,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=S):S=e[7];const N=!l;let c;e[8]!==m||e[9]!==p||e[10]!==l?(c=()=>{l&&(m(l),p(!1),h(null))},e[8]=m,e[9]=p,e[10]=l,e[11]=c):c=e[11];let j;e[12]!==N||e[13]!==c?(j=t.jsx(M,{disabled:N,onClick:c,children:"Add"}),e[12]=N,e[13]=c,e[14]=j):j=e[14];let d;e[15]!==S||e[16]!==j?(d=t.jsxs(Ke,{children:[S,j]}),e[15]=S,e[16]=j,e[17]=d):d=e[17];let k;e[18]!==x||e[19]!==d?(k=t.jsxs(Be,{className:"sm:max-w-[400px]",children:[g,x,d]}),e[18]=x,e[19]=d,e[20]=k):k=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==k?(_=t.jsx(Ve,{open:n,onOpenChange:p,children:k}),e[21]=p,e[22]=n,e[23]=k,e[24]=_):_=e[24],_}function nn(v){const e=ce.c(20),{open:n,onOpenChange:p,count:u,onConfirm:m}=v,l=u!==1?"s":"";let h;e[0]!==u||e[1]!==l?(h=t.jsxs(Ie,{children:["Delete ",u," connection",l,"?"]}),e[0]=u,e[1]=l,e[2]=h):h=e[2];const g=u!==1?"s":"";let y;e[3]!==g?(y=t.jsxs(Pe,{children:["This will permanently delete the selected connection",g,". This action cannot be undone."]}),e[3]=g,e[4]=y):y=e[4];let x;e[5]!==h||e[6]!==y?(x=t.jsxs(Le,{children:[h,y]}),e[5]=h,e[6]=y,e[7]=x):x=e[7];let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Oe,{children:"Cancel"}),e[8]=S):S=e[8];const N=u!==1?"s":"";let c;e[9]!==u||e[10]!==m||e[11]!==N?(c=t.jsxs($e,{children:[S,t.jsxs(ze,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",u," connection",N]})]}),e[9]=u,e[10]=m,e[11]=N,e[12]=c):c=e[12];let j;e[13]!==x||e[14]!==c?(j=t.jsxs(Ee,{children:[x,c]}),e[13]=x,e[14]=c,e[15]=j):j=e[15];let d;return e[16]!==p||e[17]!==n||e[18]!==j?(d=t.jsx(Me,{open:n,onOpenChange:p,children:j}),e[16]=p,e[17]=n,e[18]=j,e[19]=d):d=e[19],d}function sn(v){return v._registryId?.includes("community-registry")===!0}function on(v){const e=ce.c(58),{item:n,canManage:p,allConnections:u,connectedAppNames:m,connectingItemId:l,onNavigateConnected:h,onConnect:g}=v,[y,x]=X.useState(!1),[S,N]=X.useState(null);let c,j;e[0]!==m||e[1]!==n?(c=Te(n)??"",j=m.has(c),e[0]=m,e[1]=n,e[2]=c,e[3]=j):(c=e[2],j=e[3]);const d=j,k=n._meta?.["mcp.mesh"],_=k?.friendlyName||k?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let U;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(U=n.server?.icons?.[0]?.src||St(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=U):U=e[6];const F=U;let s;if(e[7]!==u||e[8]!==c){let b;e[10]!==c?(b=se=>se.connection_type!=="VIRTUAL"&&se.app_name===c,e[10]=c,e[11]=b):b=e[11],s=u.filter(b),e[7]=u,e[8]=c,e[9]=s}else s=e[9];const A=s;let V;e[12]!==n?(V=sn(n),e[12]=n,e[13]=V):V=e[13];const $=V;let w,L;e[14]!==A||e[15]!==p||e[16]!==$||e[17]!==d||e[18]!==n||e[19]!==g||e[20]!==h?(w=()=>{if(d){const b=A[0];b&&h(b);return}p&&L()},L=()=>{$?(N("connect"),x(!0)):g(n)},e[14]=A,e[15]=p,e[16]=$,e[17]=d,e[18]=n,e[19]=g,e[20]=h,e[21]=w,e[22]=L):(w=e[21],L=e[22]);let B;e[23]!==n||e[24]!==g||e[25]!==S?(B=()=>{ne("connections_community_warning_confirmed",{registry_item_id:n.id}),x(!1),S==="connect"&&g(n),N(null)},e[23]=n,e[24]=g,e[25]=S,e[26]=B):B=e[26];const C=B;let P;e[27]!==D||e[28]!==F||e[29]!==_?(P={title:_,description:D,icon:F},e[27]=D,e[28]=F,e[29]=_,e[30]=P):P=e[30];let Q;e[31]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(ge,{}),e[31]=Q):Q=e[31];let R;e[32]!==$||e[33]!==n._sourceIcon?(R=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=$,e[33]=n._sourceIcon,e[34]=R):R=e[34];let q;e[35]!==p||e[36]!==l||e[37]!==L||e[38]!==d||e[39]!==n.id?(q=d?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(M,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:l!==null,onClick:b=>{b.stopPropagation(),L()},children:l===n.id?t.jsx(le,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=l,e[37]=L,e[38]=d,e[39]=n.id,e[40]=q):q=e[40];let i;e[41]!==R||e[42]!==q?(i=t.jsxs("div",{className:"flex items-center gap-2",children:[R,q]}),e[41]=R,e[42]=q,e[43]=i):i=e[43];let f;e[44]!==w||e[45]!==i||e[46]!==P?(f=t.jsx(ve,{connection:P,fallbackIcon:Q,onClick:w,headerActionsAlwaysVisible:!0,headerActions:i}),e[44]=w,e[45]=i,e[46]=P,e[47]=f):f=e[47];let O;e[48]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Le,{children:[t.jsx(Ie,{children:"Community MCP Server"}),t.jsx(Pe,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=O):O=e[48];let H;e[49]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Oe,{children:"Cancel"}),e[49]=H):H=e[49];let z;e[50]!==C?(z=t.jsxs(Ee,{children:[O,t.jsxs($e,{children:[H,t.jsx(ze,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=z):z=e[51];let r;e[52]!==y||e[53]!==z?(r=t.jsx(Me,{open:y,onOpenChange:x,children:z}),e[52]=y,e[53]=z,e[54]=r):r=e[54];let I;return e[55]!==f||e[56]!==r?(I=t.jsxs(t.Fragment,{children:[f,r]}),e[55]=f,e[56]=r,e[57]=I):I=e[57],I}function an({listState:v,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:u,enabledRegistries:m}){const{org:l}=ke(),h=rt(),g=De(),{data:y}=Ae.useSession(),x=Ge(),S=Ft(v),N=Ct(),{granted:c}=Ce("connections:manage"),{granted:j}=Ce("agents:manage"),[d,k]=X.useState(new Set),_=d.size>0,[D,U]=X.useState(!1),[F,s]=X.useState(!1),[A,V]=X.useState(null),$=Vt(),w=S.filter(o=>!(n!=="ALL"&&o.connection_type!==n||p!=="ALL"&&o.status!==p)),L=ft(w),B=o=>{k(a=>{const E=new Set(a);return E.has(o)?E.delete(o):E.add(o),E})},C=()=>{k(new Set)},P=we(m,v.searchTerm),Q=P.items,R=_t(P.loadMore,P.hasMore,P.isLoadingMore),q=new Set(S.filter(o=>o.app_name).map(o=>o.app_name)),i=u==="ALL"||m.some(o=>o.id===u)?u:"ALL",f=v.search.length>0,O=e==="all"||f?Q.filter(o=>{if(i!=="ALL"&&o._registryId!==i)return!1;if(f){const a=Te(o);if(a&&q.has(a))return!1}return!0}):[],H=e==="connected"||f?L:[],z=async o=>{if(!(!l||!y?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:o.id,source:"connections_page"}),V(o.id);try{const a=Nt(o,l.id,y.user.id,{remoteIndex:0}),E=a.connection_type==="STDIO",T=!!a.connection_url,G=E&&a.connection_headers&&typeof a.connection_headers=="object"&&"command"in a.connection_headers;if(!T&&!G){W.error("This MCP Server cannot be connected: no connection method available"),V(null);return}const{id:K}=await x.create.mutateAsync(a),_e=new URL(`/api/${l.slug}/mcp/${K}`,window.location.origin),be=await lt({url:_e.href,token:null,orgId:l.id});if(be.supportsOAuth&&!be.isAuthenticated){const{token:ue,tokenInfo:oe,error:je}=await dt({connectionId:K,orgSlug:l.slug,scope:"offline_access"});if(je||!ue){ne("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:je??"no_token"}),W.error(`Authentication failed: ${je??"no token received"}`);return}else{if(ne("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),oe)try{(await fetch(`/api/${l.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:oe.accessToken,refreshToken:oe.refreshToken,expiresIn:oe.expiresIn,scope:oe.scope,clientId:oe.clientId,clientSecret:oe.clientSecret,tokenEndpoint:oe.tokenEndpoint})})).ok?await x.update.mutateAsync({id:K,data:{}}):await x.update.mutateAsync({id:K,data:{connection_token:ue}})}catch{await x.update.mutateAsync({id:K,data:{connection_token:ue}})}else await x.update.mutateAsync({id:K,data:{connection_token:ue}});await h.invalidateQueries({queryKey:mt.isMCPAuthenticated(_e.href,null)}),W.success("Authentication successful")}}W.success("Connected successfully")}catch(a){W.error(`Failed to connect: ${a instanceof Error?a.message:String(a)}`)}finally{V(null)}}},r=Bt(),I=()=>{h.invalidateQueries({predicate:o=>{const a=o.queryKey;return a[1]===l.id&&a[3]==="collection"&&a[4]==="CONNECTIONS"}})},b=async()=>{U(!1);const o=[...d];ne("connections_bulk_delete",{count:o.length});let a=0;for(const E of o)try{await r.call("COLLECTION_CONNECTIONS_DELETE",{id:E,force:!0}),a++}catch{}I(),W.success(`Deleted ${a} connection${a!==1?"s":""}`),C()},se=async(o,a)=>{try{await x.update.mutateAsync({id:o,data:{status:a}}),I(),W.success(a==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},fe=async o=>{const a=[...d];ne("connections_bulk_status_toggled",{count:a.length,to_status:o});let E=0;for(const T of a)try{await x.update.mutateAsync({id:T,data:{status:o}}),E++}catch{}I(),W.success(`${o==="active"?"Enabled":"Disabled"} ${E} connection${E!==1?"s":""}`),C()},me=async o=>{const a=$.find(G=>G.id===o);if(!a)return;ne("connections_bulk_add_to_agent",{agent_id:o,count:d.size});const E=new Set(a.connections.map(G=>G.connection_id)),T=[...d].filter(G=>!E.has(G)).map(G=>({connection_id:G,selected_tools:null,selected_resources:null,selected_prompts:null}));if(T.length===0){W.info("All selected connections are already in that agent");return}try{await r.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:o,data:{connections:[...a.connections,...T]}}),h.invalidateQueries({predicate:G=>{const K=G.queryKey;return K[1]===l.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),W.success(`Added ${T.length} connection${T.length!==1?"s":""} to "${a.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(vt,{...N}),t.jsx(nn,{open:D,onOpenChange:U,count:d.size,onConfirm:b}),t.jsx(tn,{open:F,onOpenChange:s,agents:$,onConfirm:me}),P.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(f?O.length===0&&w.length===0:e==="all"?O.length===0:w.length===0)?t.jsx(jt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:v.search?`No Connections match "${v.search}"`:c?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[H.map(o=>{if(o.type==="group")return t.jsx(Jt,{group:o,onOpen:()=>{g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:o.key}})},selectionMode:_,selectedIds:d,onToggleSelect:B},o.key);const a=o.connection,E=d.has(a.id);return t.jsx(ve,{connection:a,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?B(a.id):g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}}),className:de(E&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:E,onCheckedChange:()=>B(a.id),onClick:T=>T.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:de("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(We,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:T=>T.stopPropagation(),children:t.jsx(Qe,{size:20})})}),t.jsxs(qe,{align:"end",onClick:T=>T.stopPropagation(),children:[t.jsxs(ae,{onClick:T=>{T.stopPropagation(),g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}})},children:[t.jsx(Je,{size:16}),"Open"]}),(c||j)&&t.jsxs(ae,{onClick:T=>{T.stopPropagation(),B(a.id)},children:[t.jsx(Ht,{size:16}),"Select"]}),c&&(a.status==="active"?t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"inactive")},children:[t.jsx(Rt,{size:16}),"Disable"]}):t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"active")},children:[t.jsx(Kt,{size:16}),"Enable"]})),c&&t.jsxs(ae,{variant:"destructive",onClick:T=>{T.stopPropagation(),N.requestDelete(a)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]})})]})},a.id)}),O.map(o=>t.jsx(on,{item:o,canManage:c,allConnections:S,connectedAppNames:q,connectingItemId:A,onNavigateConnected:a=>g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}}),onConnect:z},`catalog-${o._registryId}:${o.id}`)),(e==="all"||f)&&m.length>0&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||f)&&P.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(le,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(en,{count:d.size,total:w.length,canManage:c,canManageAgents:j,onSelectAll:()=>{k(new Set(w.map(o=>o.id)))},onDeselectAll:()=>k(new Set),onDelete:()=>U(!0),onAddToAgent:()=>s(!0),onToggleStatus:fe,onCancel:C})]})}function cn(){const{org:v}=ke(),e=De(),n=nt({strict:!1}),{data:p}=Ae.useSession(),{stdioEnabled:u}=st(),m=Lt(),{granted:l}=Ce("connections:manage"),h=bt({namespace:v.slug,resource:"connections"}),g=Ge(),[y,x]=ot(it.connectionsTab(v.slug),i=>n.tab==="all"||n.tab==="connected"?n.tab:i??"all"),[S,N]=X.useState("ALL"),[c,j]=X.useState("ALL"),[d,k]=X.useState("ALL"),_=gt(),U=we(_,h.searchTerm).items,F=h.search!==h.searchTerm,s=at({resolver:ct(Xt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),V=s.watch("connection_url"),$=s.watch("npx_package"),w=he({uiType:A,connectionUrl:V??"",npxPackage:$??""})??Ne({uiType:A,connectionUrl:V??"",registryItems:U}),L=l&&n.action==="create",B=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:v.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:v.slug},search:{}})},P=async i=>{let f,O=null,H=null,z=null;i.ui_type==="NPX"?(f="STDIO",O="",z=Gt(i.npx_package||"",i.env_vars||[])):i.ui_type==="STDIO"?(f="STDIO",O="",z=Qt(i.stdio_command||"",i.stdio_args||"",i.stdio_cwd,i.env_vars||[])):(f=i.ui_type,O=i.connection_url||"",H=i.connection_token||null);const r=ut("conn");ne("connection_custom_created",{connection_type:f,ui_type:i.ui_type}),await g.create.mutateAsync({id:r,title:i.title,description:i.description||null,connection_type:f,connection_url:O,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:v.id,icon:i.icon??null,app_name:null,app_id:null,connection_headers:z,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:v.slug,appSlug:xe({app_name:null,connection_url:O,title:i.title,id:r})}})},Q=i=>{i||(L&&C(),s.reset())},R=i=>{const f=i.trim();if(!f)return;const O=!!s.formState.dirtyFields.title,H=!!s.formState.dirtyFields.description,z=!!s.formState.dirtyFields.env_vars,r=b=>{if(b&&(!O&&!s.getValues("title").trim()&&b.title&&s.setValue("title",b.title,{shouldDirty:!1}),!H&&!(s.getValues("description")??"").trim()&&b.description&&s.setValue("description",b.description,{shouldDirty:!1}),!z&&b.envVarKeys?.length)){const se=s.getValues("env_vars")??[],fe=new Set(se.map(o=>o.key)),me=b.envVarKeys.filter(o=>!fe.has(o));me.length>0&&s.setValue("env_vars",[...se,...me.map(o=>({key:o,value:""}))],{shouldDirty:!0})}},I=qt(f);if(I&&u){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",I.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),r(he({uiType:"NPX",npxPackage:I.packageName}));return}if(f.startsWith("http://")||f.startsWith("https://")){const b=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",b,{shouldDirty:!0}),s.setValue("connection_url",f,{shouldDirty:!0}),r(he({uiType:b,connectionUrl:f})??Ne({uiType:b,connectionUrl:f,registryItems:U}));return}A==="NPX"&&r(he({uiType:"NPX",npxPackage:f}))},q=l?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(M,{variant:"outline",onClick:B,children:[t.jsx(Ye,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const i="Create Connection",f="Create a custom connection in your organization. Fill in the details below.",O=s.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(J,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Type *"}),t.jsxs(Ot,{value:r.value,onValueChange:r.onChange,children:[t.jsx(ee,{children:t.jsx($t,{children:t.jsx(zt,{})})}),t.jsxs(Et,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(te,{})]})}),A==="NPX"&&t.jsx(J,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"NPM Package *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value??"",onPaste:I=>{const b=I.clipboardData.getData("text");b&&(I.preventDefault(),s.setValue("npx_package",b.trim(),{shouldDirty:!0}),R(b))},onBlur:I=>{R(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(J,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Command *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"node, bun, python...",...r,value:r.value??""})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Arguments"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...r,value:r.value??""})}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Working Directory"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...r,value:r.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(te,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(J,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Environment Variables"}),t.jsx(ee,{children:t.jsx(Wt,{value:r.value??[],onChange:r.onChange})}),t.jsx(te,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(J,{control:s.control,name:"connection_url",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"URL *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...r,value:r.value??"",onPaste:I=>{const b=I.clipboardData.getData("text");b&&(I.preventDefault(),s.setValue("connection_url",b.trim(),{shouldDirty:!0}),R(b))},onBlur:I=>{R(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:w?.token?.label??"Token (optional)"}),t.jsx(ee,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...r,value:r.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(te,{})]})})]}),t.jsx(J,{control:s.control,name:"title",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Name *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"My Connection",...r})}),t.jsx(te,{})]})}),t.jsx(J,{control:s.control,name:"description",render:({field:r})=>t.jsxs(Y,{children:[t.jsx(Z,{children:"Description"}),t.jsx(ee,{children:t.jsx(Mt,{placeholder:"A brief description of this connection",rows:3,...r,value:r.value??""})}),t.jsx(te,{})]})})]}),z=L;return m?t.jsx(kt,{open:z,onOpenChange:Q,children:t.jsxs(Dt,{className:"max-h-[90vh]",children:[t.jsx(At,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(wt,{children:i}),t.jsx(Tt,{className:"mt-1",children:f})]}),t.jsx(It,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(et,{size:16})})})]})}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(Pt,{children:t.jsx(M,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:O})})]})})]})}):t.jsx(Ve,{open:z,onOpenChange:Q,children:t.jsxs(Be,{className:"sm:max-w-[525px]",children:[t.jsxs(Ue,{children:[t.jsx(He,{children:i}),t.jsx(Re,{children:f})]}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Ke,{children:[t.jsx(M,{type:"button",variant:"outline",onClick:()=>Q(!1),children:"Cancel"}),t.jsx(M,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:O})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ht,{value:h.search,onChange:h.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(h.setSearch(""),i.target.blur())}}),t.jsx(pt,{sortKey:h.sortKey,sortDirection:h.sortDirection,onSort:h.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:S,onChange:i=>N(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:c,onChange:i=>j(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:d,onChange:i=>k(i||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(i=>({id:i.id,label:i.id.includes("community-registry")?"Community MCP Registry":i.title}))]}]:[]]})]}),q]}),t.jsx(xt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:y,onTabChange:i=>{const f=i;f!==y&&ne("connections_page_tab_changed",{to_tab:f}),x(f)}}),t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:F?.5:1,transition:F?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:F?"none":"auto"},children:t.jsx(an,{listState:h,activeTab:y,typeFilter:S,statusFilter:c,registryFilter:d,enabledRegistries:_})})})]})})})]})})}function Bs(){const v=ce.c(1);let e;return v[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tt,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(cn,{})})}),v[0]=e):e=v[0],e}export{Bs as default};
@@ -1 +1 @@
1
- import"./index-DBqH3_Tr.js";import{c as s}from"./create-sse-subscription-BS5983N4.js";const c={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},t=Object.values(c),n=s({buildUrl:o=>{const e=t.join(",");return`/api/${encodeURIComponent(o)}/watch?types=${e}`},eventTypes:[...t]});export{c as D,n as d};
1
+ import"./index-Dlc4tDxO.js";import{c as s}from"./create-sse-subscription-BS5983N4.js";const c={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},t=Object.values(c),n=s({buildUrl:o=>{const e=t.join(",");return`/api/${encodeURIComponent(o)}/watch?types=${e}`},eventTypes:[...t]});export{c as D,n as d};
@@ -1 +1 @@
1
- import{e as n,j as i,cz as u,c,bE as m,de as x,df as j,cA as N,cB as b,dg as p,dh as h}from"./index-DBqH3_Tr.js";import{i as D}from"./X-Bf_z2Leo.js";function _(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(h,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(p,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(D,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(p,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let g;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(g=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=g):g=e[14],g}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{_ as D,T as a,B as b,R as c,E as d,O as e,w as f,v as g,y as h,k as i};
1
+ import{e as n,j as i,cz as u,c,bE as m,de as x,df as j,cA as N,cB as b,dg as p,dh as h}from"./index-Dlc4tDxO.js";import{i as D}from"./X-CMYaHMo4.js";function _(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(h,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(p,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(D,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(p,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let g;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(g=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=g):g=e[14],g}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{_ as D,T as a,B as b,R as c,E as d,O as e,w as f,v as g,y as h,k as i};
@@ -1 +1 @@
1
- import{e as Z,q as L,b as Q,G as B,K as k,n as U,a as P,j as s,B as q,t as z,o as h}from"./index-DBqH3_Tr.js";import{u as $}from"./studio-tools-hfOcm94T.js";import{S as Y}from"./switch-B76FjS24.js";import{S as H,a as v,b as M}from"./settings-section-bWEtm5yt.js";function ei(){const i=Z.c(59),{org:e}=L(),{data:J}=Q.useSession(),R=B(),a=$();let r;i[0]!==e.id?(r=k.organizationDomain(e.id),i[0]=e.id,i[1]=r):r=i[1];let d;i[2]!==a?(d=()=>a.call("ORGANIZATION_DOMAIN_GET",{}),i[2]=a,i[3]=d):d=i[3];let A;i[4]!==r||i[5]!==d?(A={queryKey:r,queryFn:d},i[4]=r,i[5]=d,i[6]=A):A=i[6];const{data:G,isPending:K}=U(A),T=J?.user?.email??"";let x;i[7]!==T?(x=T.split("@")[1]?.toLowerCase()??"",i[7]=T,i[8]=x):x=i[8];const n=x,o=G?.domain??null,w=G?.autoJoinEnabled??!1,F=n&&n!==o;let C;i[9]!==e.id||i[10]!==R?(C=()=>R.invalidateQueries({queryKey:k.organizationDomain(e.id)}),i[9]=e.id,i[10]=R,i[11]=C):C=i[11];const l=C;let c;i[12]!==a||i[13]!==n?(c=()=>a.call("ORGANIZATION_DOMAIN_SET",{domain:n,autoJoinEnabled:!1}),i[12]=a,i[13]=n,i[14]=c):c=i[14];let m;i[15]!==l||i[16]!==e.id||i[17]!==n?(m=()=>{z("organization_domain_claimed",{organization_id:e.id,email_domain:n}),l(),h.success("Domain claimed")},i[15]=l,i[16]=e.id,i[17]=n,i[18]=m):m=i[18];let u;i[19]!==e.id||i[20]!==n?(u=t=>{z("organization_domain_claim_failed",{organization_id:e.id,email_domain:n,error:t instanceof Error?t.message:String(t)}),h.error(t instanceof Error?t.message:"Failed to claim domain")},i[19]=e.id,i[20]=n,i[21]=u):u=i[21];let D;i[22]!==c||i[23]!==m||i[24]!==u?(D={mutationFn:c,onSuccess:m,onError:u},i[22]=c,i[23]=m,i[24]=u,i[25]=D):D=i[25];const p=P(D);let g;i[26]!==a?(g=()=>a.call("ORGANIZATION_DOMAIN_CLEAR",{}),i[26]=a,i[27]=g):g=i[27];let f;i[28]!==o||i[29]!==l||i[30]!==e.id?(f=()=>{z("organization_domain_cleared",{organization_id:e.id,email_domain:o}),l(),h.success("Domain removed")},i[28]=o,i[29]=l,i[30]=e.id,i[31]=f):f=i[31];let _;i[32]!==o||i[33]!==e.id?(_=t=>{z("organization_domain_clear_failed",{organization_id:e.id,email_domain:o,error:t instanceof Error?t.message:String(t)}),h.error(t instanceof Error?t.message:"Failed to remove domain")},i[32]=o,i[33]=e.id,i[34]=_):_=i[34];let I;i[35]!==f||i[36]!==_||i[37]!==g?(I={mutationFn:g,onSuccess:f,onError:_},i[35]=f,i[36]=_,i[37]=g,i[38]=I):I=i[38];const N=P(I);let E;i[39]!==o||i[40]!==e.id||i[41]!==a?(E=async t=>{if(o)return z("organization_auto_join_toggled",{organization_id:e.id,enabled:t}),a.call("ORGANIZATION_DOMAIN_UPDATE",{autoJoinEnabled:t})},i[39]=o,i[40]=e.id,i[41]=a,i[42]=E):E=i[42];let j;i[43]!==l?(j=()=>{l(),h.success("Auto-join setting updated")},i[43]=l,i[44]=j):j=i[44];let S;i[45]!==e.id?(S=t=>{z("organization_auto_join_toggle_failed",{organization_id:e.id,error:t instanceof Error?t.message:String(t)}),h.error(t instanceof Error?t.message:"Failed to update auto-join")},i[45]=e.id,i[46]=S):S=i[46];let O;i[47]!==E||i[48]!==j||i[49]!==S?(O={mutationFn:E,onSuccess:j,onError:S},i[47]=E,i[48]=j,i[49]=S,i[50]=O):O=i[50];const y=P(O);if(K)return null;let b;return i[51]!==w||i[52]!==F||i[53]!==N||i[54]!==o||i[55]!==p||i[56]!==y||i[57]!==n?(b=s.jsx(H,{title:"Email domain",children:o?s.jsxs(v,{children:[s.jsx(M,{title:o,description:"Claimed domain",action:s.jsx(q,{variant:"outline",size:"sm",onClick:()=>N.mutate(),disabled:N.isPending,children:"Remove"})}),s.jsx(M,{title:"Auto-join",description:`Users with @${o} emails will automatically join this organization on signup.`,action:s.jsx(Y,{checked:w,onCheckedChange:t=>y.mutate(t),disabled:y.isPending})})]}):F?s.jsx(v,{children:s.jsx(M,{title:n,description:"Let new users with matching emails auto-join this org.",action:s.jsx(q,{size:"sm",onClick:()=>p.mutate(),disabled:p.isPending,children:p.isPending?"Claiming...":"Claim domain"})})}):s.jsx(v,{children:s.jsx(M,{title:"No domain detected",description:"Sign in with a corporate email to claim a domain for your organization."})})}),i[51]=w,i[52]=F,i[53]=N,i[54]=o,i[55]=p,i[56]=y,i[57]=n,i[58]=b):b=i[58],b}export{ei as D};
1
+ import{e as Z,q as L,b as Q,G as B,K as k,n as U,a as P,j as s,B as q,t as z,o as h}from"./index-Dlc4tDxO.js";import{u as $}from"./studio-tools-B-zlmqyw.js";import{S as Y}from"./switch-CRVfQAZr.js";import{S as H,a as v,b as M}from"./settings-section-BkfPlxIX.js";function ei(){const i=Z.c(59),{org:e}=L(),{data:J}=Q.useSession(),R=B(),a=$();let r;i[0]!==e.id?(r=k.organizationDomain(e.id),i[0]=e.id,i[1]=r):r=i[1];let d;i[2]!==a?(d=()=>a.call("ORGANIZATION_DOMAIN_GET",{}),i[2]=a,i[3]=d):d=i[3];let A;i[4]!==r||i[5]!==d?(A={queryKey:r,queryFn:d},i[4]=r,i[5]=d,i[6]=A):A=i[6];const{data:G,isPending:K}=U(A),T=J?.user?.email??"";let x;i[7]!==T?(x=T.split("@")[1]?.toLowerCase()??"",i[7]=T,i[8]=x):x=i[8];const n=x,o=G?.domain??null,w=G?.autoJoinEnabled??!1,F=n&&n!==o;let C;i[9]!==e.id||i[10]!==R?(C=()=>R.invalidateQueries({queryKey:k.organizationDomain(e.id)}),i[9]=e.id,i[10]=R,i[11]=C):C=i[11];const l=C;let c;i[12]!==a||i[13]!==n?(c=()=>a.call("ORGANIZATION_DOMAIN_SET",{domain:n,autoJoinEnabled:!1}),i[12]=a,i[13]=n,i[14]=c):c=i[14];let m;i[15]!==l||i[16]!==e.id||i[17]!==n?(m=()=>{z("organization_domain_claimed",{organization_id:e.id,email_domain:n}),l(),h.success("Domain claimed")},i[15]=l,i[16]=e.id,i[17]=n,i[18]=m):m=i[18];let u;i[19]!==e.id||i[20]!==n?(u=t=>{z("organization_domain_claim_failed",{organization_id:e.id,email_domain:n,error:t instanceof Error?t.message:String(t)}),h.error(t instanceof Error?t.message:"Failed to claim domain")},i[19]=e.id,i[20]=n,i[21]=u):u=i[21];let D;i[22]!==c||i[23]!==m||i[24]!==u?(D={mutationFn:c,onSuccess:m,onError:u},i[22]=c,i[23]=m,i[24]=u,i[25]=D):D=i[25];const p=P(D);let g;i[26]!==a?(g=()=>a.call("ORGANIZATION_DOMAIN_CLEAR",{}),i[26]=a,i[27]=g):g=i[27];let f;i[28]!==o||i[29]!==l||i[30]!==e.id?(f=()=>{z("organization_domain_cleared",{organization_id:e.id,email_domain:o}),l(),h.success("Domain removed")},i[28]=o,i[29]=l,i[30]=e.id,i[31]=f):f=i[31];let _;i[32]!==o||i[33]!==e.id?(_=t=>{z("organization_domain_clear_failed",{organization_id:e.id,email_domain:o,error:t instanceof Error?t.message:String(t)}),h.error(t instanceof Error?t.message:"Failed to remove domain")},i[32]=o,i[33]=e.id,i[34]=_):_=i[34];let I;i[35]!==f||i[36]!==_||i[37]!==g?(I={mutationFn:g,onSuccess:f,onError:_},i[35]=f,i[36]=_,i[37]=g,i[38]=I):I=i[38];const N=P(I);let E;i[39]!==o||i[40]!==e.id||i[41]!==a?(E=async t=>{if(o)return z("organization_auto_join_toggled",{organization_id:e.id,enabled:t}),a.call("ORGANIZATION_DOMAIN_UPDATE",{autoJoinEnabled:t})},i[39]=o,i[40]=e.id,i[41]=a,i[42]=E):E=i[42];let j;i[43]!==l?(j=()=>{l(),h.success("Auto-join setting updated")},i[43]=l,i[44]=j):j=i[44];let S;i[45]!==e.id?(S=t=>{z("organization_auto_join_toggle_failed",{organization_id:e.id,error:t instanceof Error?t.message:String(t)}),h.error(t instanceof Error?t.message:"Failed to update auto-join")},i[45]=e.id,i[46]=S):S=i[46];let O;i[47]!==E||i[48]!==j||i[49]!==S?(O={mutationFn:E,onSuccess:j,onError:S},i[47]=E,i[48]=j,i[49]=S,i[50]=O):O=i[50];const y=P(O);if(K)return null;let b;return i[51]!==w||i[52]!==F||i[53]!==N||i[54]!==o||i[55]!==p||i[56]!==y||i[57]!==n?(b=s.jsx(H,{title:"Email domain",children:o?s.jsxs(v,{children:[s.jsx(M,{title:o,description:"Claimed domain",action:s.jsx(q,{variant:"outline",size:"sm",onClick:()=>N.mutate(),disabled:N.isPending,children:"Remove"})}),s.jsx(M,{title:"Auto-join",description:`Users with @${o} emails will automatically join this organization on signup.`,action:s.jsx(Y,{checked:w,onCheckedChange:t=>y.mutate(t),disabled:y.isPending})})]}):F?s.jsx(v,{children:s.jsx(M,{title:n,description:"Let new users with matching emails auto-join this org.",action:s.jsx(q,{size:"sm",onClick:()=>p.mutate(),disabled:p.isPending,children:p.isPending?"Claiming...":"Claim domain"})})}):s.jsx(v,{children:s.jsx(M,{title:"No domain detected",description:"Sign in with a corporate email to claim a domain for your organization."})})}),i[51]=w,i[52]=F,i[53]=N,i[54]=o,i[55]=p,i[56]=y,i[57]=n,i[58]=b):b=i[58],b}export{ei as D};
@@ -1 +1 @@
1
- import{e as d,j as s,co as i,c}from"./index-DBqH3_Tr.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{D,g as a,x as b,h as c,N as d,b as e,j as f,v as g};
1
+ import{e as d,j as s,co as i,c}from"./index-Dlc4tDxO.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{D,g as a,x as b,h as c,N as d,b as e,j as f,v as g};
@@ -1 +1 @@
1
- import{e as c,j as i,dI as f,dJ as m,c as u,dK as g,dL as x,dM as v,dN as b,dO as h,dP as w,dQ as j,dR as N,dS as z,dT as _,dU as y,dV as p}from"./index-DBqH3_Tr.js";import{i as $}from"./Check-Bk-n4rKs.js";import{i as D}from"./ChevronRight-DRFF6KW4.js";import{a as M}from"./DotsVertical-BD0Jlzeq.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function L(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("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-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==r?(d=i.jsx(x,{children:i.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function O(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("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-pointer items-center gap-2 rounded-lg 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",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==r?(l=i.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:d,...o}),e[7]=s,e[8]=o,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function E(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx($,{className:"size-4"})})}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=i.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[d,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function G(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let d;return e[7]!==t||e[8]!==o||e[9]!==n?(d=i.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=d):d=e[10],d}function J(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=i.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function K(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function Q(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function U(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(D,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=i.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,d]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function V(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("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 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,L as b,O as c,Q as d,U as e,V as f,K as g,G as h,P as i,J as j,E as k};
1
+ import{e as c,j as i,dI as f,dJ as m,c as u,dK as g,dL as x,dM as v,dN as b,dO as h,dP as w,dQ as j,dR as N,dS as z,dT as _,dU as y,dV as p}from"./index-Dlc4tDxO.js";import{i as $}from"./Check-DHmAQH53.js";import{i as D}from"./ChevronRight-BJSYQUmF.js";import{a as M}from"./DotsVertical-jUGLCiy5.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function L(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("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-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==r?(d=i.jsx(x,{children:i.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function O(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("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-pointer items-center gap-2 rounded-lg 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",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==r?(l=i.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:d,...o}),e[7]=s,e[8]=o,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function E(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx($,{className:"size-4"})})}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=i.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[d,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function G(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let d;return e[7]!==t||e[8]!==o||e[9]!==n?(d=i.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=d):d=e[10],d}function J(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=i.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function K(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function Q(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function U(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(D,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=i.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,d]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function V(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("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 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,L as b,O as c,Q as d,U as e,V as f,K as g,G as h,P as i,J as j,E as k};
@@ -1 +1 @@
1
- import{e as p,g as d,cm as l,j as s,O as u}from"./index-DBqH3_Tr.js";import{P as c}from"./plugin-layout-CGOJQMJE.js";import"./use-connection-lmAzDQtG.js";import"./use-collections-cYI0oKE6.js";import"./use-mcp-client-BgKdABiW.js";import"./studio-tools-hfOcm94T.js";import"./Settings02-C46G6WCc.js";import"./index-DCdT8576.js";import"./sidebar-qjaU6R6F.js";import"./LayoutLeft-XknICfD_.js";import"./tooltip-B7sOnQkv.js";import"./sheet-BvtvfFAl.js";import"./X-Bf_z2Leo.js";function $(){const e=p.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$taskId/$pluginId"},e[0]=n):n=e[0];const{pluginId:a}=d(n);let i;e[1]!==a?(i=l.find(r=>r.id===a),e[1]=a,e[2]=i):i=e[2];const t=i;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let r;return e[3]!==t.bindingName||e[4]!==t.renderEmptyState||e[5]!==t.renderHeader?(r=s.jsx(c,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState}),e[3]=t.bindingName,e[4]=t.renderEmptyState,e[5]=t.renderHeader,e[6]=r):r=e[6],r}const o=t?.LayoutComponent;if(!o){let r;return e[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{}),e[7]=r):r=e[7],r}let m;return e[8]!==o?(m=s.jsx(o,{}),e[8]=o,e[9]=m):m=e[9],m}export{$ as default};
1
+ import{e as p,g as d,cm as l,j as s,O as u}from"./index-Dlc4tDxO.js";import{P as c}from"./plugin-layout-BrlPuAvi.js";import"./use-connection-BGpjiuJJ.js";import"./use-collections-CH3Uvmj5.js";import"./use-mcp-client-BoOtVD9g.js";import"./studio-tools-B-zlmqyw.js";import"./Settings02-BMRrFVdB.js";import"./index-NNvehl9i.js";import"./sidebar-BT1O99E-.js";import"./LayoutLeft-CLZVvVLM.js";import"./tooltip-D0rD3x8T.js";import"./sheet-C2OErkZR.js";import"./X-CMYaHMo4.js";function $(){const e=p.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$taskId/$pluginId"},e[0]=n):n=e[0];const{pluginId:a}=d(n);let i;e[1]!==a?(i=l.find(r=>r.id===a),e[1]=a,e[2]=i):i=e[2];const t=i;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let r;return e[3]!==t.bindingName||e[4]!==t.renderEmptyState||e[5]!==t.renderHeader?(r=s.jsx(c,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState}),e[3]=t.bindingName,e[4]=t.renderEmptyState,e[5]=t.renderHeader,e[6]=r):r=e[6],r}const o=t?.LayoutComponent;if(!o){let r;return e[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{}),e[7]=r):r=e[7],r}let m;return e[8]!==o?(m=s.jsx(o,{}),e[8]=o,e[9]=m):m=e[9],m}export{$ as default};
@@ -1 +1 @@
1
- import{e as b,c as h,j as t,B as g}from"./index-DBqH3_Tr.js";function y(N){const e=b.c(21),{icon:o,illustration:a,title:u,description:d,buttonProps:s,buttonComponent:x,className:j,children:p}=N;let l;e[0]!==j?(l=h("flex flex-col items-center justify-center py-16 text-center",j),e[0]=j,e[1]=l):l=e[1];let i;e[2]!==o||e[3]!==a?(i=a?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:a}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=a,e[4]=i):i=e[4];let n;e[5]!==u?(n=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[5]=u,e[6]=n):n=e[6];let c;e[7]!==d?(c=d&&t.jsx("div",{className:"text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=c):c=e[8];let r;e[9]!==n||e[10]!==c?(r=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[n,c]}),e[9]=n,e[10]=c,e[11]=r):r=e[11];let m;e[12]!==x||e[13]!==s?(m=(x??s)&&t.jsx("div",{className:"mt-4",children:x??(s&&t.jsx(g,{size:"sm",className:h(s?.className),...s}))}),e[12]=x,e[13]=s,e[14]=m):m=e[14];let f;return e[15]!==p||e[16]!==l||e[17]!==i||e[18]!==r||e[19]!==m?(f=t.jsxs("div",{className:l,children:[i,r,m,p]}),e[15]=p,e[16]=l,e[17]=i,e[18]=r,e[19]=m,e[20]=f):f=e[20],f}export{y as E};
1
+ import{e as b,c as h,j as t,B as g}from"./index-Dlc4tDxO.js";function y(N){const e=b.c(21),{icon:o,illustration:a,title:u,description:d,buttonProps:s,buttonComponent:x,className:j,children:p}=N;let l;e[0]!==j?(l=h("flex flex-col items-center justify-center py-16 text-center",j),e[0]=j,e[1]=l):l=e[1];let i;e[2]!==o||e[3]!==a?(i=a?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:a}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=a,e[4]=i):i=e[4];let n;e[5]!==u?(n=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[5]=u,e[6]=n):n=e[6];let c;e[7]!==d?(c=d&&t.jsx("div",{className:"text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=c):c=e[8];let r;e[9]!==n||e[10]!==c?(r=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[n,c]}),e[9]=n,e[10]=c,e[11]=r):r=e[11];let m;e[12]!==x||e[13]!==s?(m=(x??s)&&t.jsx("div",{className:"mt-4",children:x??(s&&t.jsx(g,{size:"sm",className:h(s?.className),...s}))}),e[12]=x,e[13]=s,e[14]=m):m=e[14];let f;return e[15]!==p||e[16]!==l||e[17]!==i||e[18]!==r||e[19]!==m?(f=t.jsxs("div",{className:l,children:[i,r,m,p]}),e[15]=p,e[16]=l,e[17]=i,e[18]=r,e[19]=m,e[20]=f):f=e[20],f}export{y as E};
@@ -1 +1 @@
1
- import{e as v,c as N,j as t}from"./index-DBqH3_Tr.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
1
+ import{e as v,c as N,j as t}from"./index-Dlc4tDxO.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
@@ -1 +1 @@
1
- import{g as O}from"./generate-id-D-Z8lvmk.js";import"./index-DBqH3_Tr.js";import{W as T,c as x}from"./use-mcp-client-BgKdABiW.js";const U="mcp.mesh";function H(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function L(e){const t=H(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function Y(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function F(e,t){return Y(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function q(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const D={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function G(e){return e?D[e]??e.toUpperCase():null}function B(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function J(e,t,n,a,r){const o=await x({connectionId:e,orgId:t,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}function j(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function K(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function $(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Q(e,t,n,a){const r=e.server,o=e._meta?.[U],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",k=r?.description||null,C=r?.icons?.[0]?.src||L(r?.repository)||null,i=o?.oauth_config,R=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,P=o?.configuration_state,v=o?.configuration_scopes,w=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],d=r?.remotes??[],A=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&a?.packageIndex!==void 0,c=y?p[A]:null,l=y?null:d[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=G(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=d.length>1,M=p.length>1;let g="";c&&M?g=` (${$(c)})`:l&&N&&(g=` (${K(l)})`);const E=I+g;return{id:O("conn"),title:E,description:k,icon:C,app_name:j(e),app_id:o?.id||e.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:R,configuration_state:P??null,configuration_scopes:v??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:w},created_at:s,updated_at:s,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{L as a,B as b,J as c,Q as e,q as f,j as g,F as i};
1
+ import{g as O}from"./generate-id-BrtbvnKY.js";import"./index-Dlc4tDxO.js";import{W as T,c as x}from"./use-mcp-client-BoOtVD9g.js";const U="mcp.mesh";function H(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function L(e){const t=H(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function Y(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function F(e,t){return Y(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function q(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const D={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function G(e){return e?D[e]??e.toUpperCase():null}function B(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function J(e,t,n,a,r){const o=await x({connectionId:e,orgId:t,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}function j(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function K(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function $(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Q(e,t,n,a){const r=e.server,o=e._meta?.[U],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",k=r?.description||null,C=r?.icons?.[0]?.src||L(r?.repository)||null,i=o?.oauth_config,R=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,P=o?.configuration_state,v=o?.configuration_scopes,w=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],d=r?.remotes??[],A=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&a?.packageIndex!==void 0,c=y?p[A]:null,l=y?null:d[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=G(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=d.length>1,M=p.length>1;let g="";c&&M?g=` (${$(c)})`:l&&N&&(g=` (${K(l)})`);const E=I+g;return{id:O("conn"),title:E,description:k,icon:C,app_name:j(e),app_id:o?.id||e.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:R,configuration_state:P??null,configuration_scopes:v??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:w},created_at:s,updated_at:s,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{L as a,B as b,J as c,Q as e,q as f,j as g,F as i};
@@ -1 +1 @@
1
- import{e as b,q as k,G as q,cm as P,j as n,cn as E,b7 as R,K as S,o as K}from"./index-DBqH3_Tr.js";import{P as j}from"./index-DCdT8576.js";import{d as _}from"./use-organization-settings-Dpet9l_V.js";import{S as I}from"./switch-B76FjS24.js";import{n as Q}from"./Container-DxRK5lMe.js";import{b as w,S as z,a as F,c as N}from"./settings-section-bWEtm5yt.js";import{R as T}from"./require-capability-LsMjGzeH.js";import"./sidebar-qjaU6R6F.js";import"./LayoutLeft-XknICfD_.js";import"./tooltip-B7sOnQkv.js";import"./sheet-BvtvfFAl.js";import"./X-Bf_z2Leo.js";import"./use-mcp-client-BgKdABiW.js";import"./card-Cm77QeIs.js";import"./ArrowUpRight-DEY-b6kE.js";import"./use-capability-CPfyR7lg.js";import"./access-gate-lvdpuHDY.js";import"./capability-load-error-DiOZh0BR.js";function U(){const e=b.c(17),{org:t,project:s}=k(),r=q();let d;e[0]!==s.enabledPlugins?(d=s.enabledPlugins??[],e[0]=s.enabledPlugins,e[1]=d):d=e[1];const a=d,l=_();let m;e[2]!==t||e[3]!==s.slug||e[4]!==r?(m=()=>{r.invalidateQueries({queryKey:S.project(t.id,s.slug)}),r.invalidateQueries({queryKey:S.projects(t.id)}),r.invalidateQueries({predicate:i=>{const o=i.queryKey;return o[1]===t.id&&o[3]==="collection"&&o[4]==="VIRTUAL_MCP"}})},e[2]=t,e[3]=s.slug,e[4]=r,e[5]=m):m=e[5];const x=m;let p;e[6]!==x||e[7]!==l||e[8]!==a?(p=(i,o)=>{const u=new Set(a);o?u.add(i):u.delete(i),l.mutate({enabled_plugins:Array.from(u)},{onSuccess:x,onError:G})},e[6]=x,e[7]=l,e[8]=a,e[9]=p):p=e[9];const g=p,y=D,C=A;if(P.length===0){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}),e[10]=i):i=e[10],i}let c;e[11]!==g||e[12]!==l||e[13]!==a?(c=P.map(i=>{const o=y(i.id),u=C(i.id),h=a.includes(i.id);return n.jsx(w,{title:o?.label??i.id,description:u??void 0,icon:n.jsx("span",{className:"text-muted-foreground [&>svg]:size-4",children:o?.icon??n.jsx(Q,{size:14})}),onClick:()=>!l.isPending&&g(i.id,!h),action:n.jsx(I,{checked:h,onCheckedChange:v=>g(i.id,v),disabled:l.isPending,onClick:$})},i.id)}),e[11]=g,e[12]=l,e[13]=a,e[14]=c):c=e[14];let f;return e[15]!==c?(f=n.jsx(z,{children:n.jsx(F,{children:c})}),e[15]=c,e[16]=f):f=e[16],f}function $(e){return e.stopPropagation()}function A(e){return P.find(s=>s.id===e)?.description??null}function D(e){const t=E.find(r=>r.pluginId===e);if(t)return{label:t.label,icon:t.items[0]?.icon};const s=R.find(r=>r.pluginId===e);return s?{label:s.label,icon:s.icon}:null}function G(e){K.error("Failed to update plugin: "+(e instanceof Error?e.message:"Unknown error"))}function M(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(j,{children:n.jsx(j.Content,{children:n.jsx(j.Body,{children:n.jsxs(N,{children:[n.jsx(j.Title,{children:"Plugins"}),n.jsx(U,{})]})})})}),e[0]=t):t=e[0],t}function ae(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(T,{capability:"org:manage",area:"plugins",children:n.jsx(M,{})}),e[0]=t):t=e[0],t}export{ae as default};
1
+ import{e as b,q as k,G as q,cm as P,j as n,cn as E,b7 as R,K as S,o as K}from"./index-Dlc4tDxO.js";import{P as j}from"./index-NNvehl9i.js";import{d as _}from"./use-organization-settings-BQtNgLEs.js";import{S as I}from"./switch-CRVfQAZr.js";import{n as Q}from"./Container-DZBZNA8Y.js";import{b as w,S as z,a as F,c as N}from"./settings-section-BkfPlxIX.js";import{R as T}from"./require-capability-D8n6HrEr.js";import"./sidebar-BT1O99E-.js";import"./LayoutLeft-CLZVvVLM.js";import"./tooltip-D0rD3x8T.js";import"./sheet-C2OErkZR.js";import"./X-CMYaHMo4.js";import"./use-mcp-client-BoOtVD9g.js";import"./card-DmbfBYZU.js";import"./ArrowUpRight-B0GfNpsw.js";import"./use-capability-DqPX2R7m.js";import"./access-gate-Dx320Euv.js";import"./capability-load-error-Db8x02Oo.js";function U(){const e=b.c(17),{org:t,project:s}=k(),r=q();let d;e[0]!==s.enabledPlugins?(d=s.enabledPlugins??[],e[0]=s.enabledPlugins,e[1]=d):d=e[1];const a=d,l=_();let m;e[2]!==t||e[3]!==s.slug||e[4]!==r?(m=()=>{r.invalidateQueries({queryKey:S.project(t.id,s.slug)}),r.invalidateQueries({queryKey:S.projects(t.id)}),r.invalidateQueries({predicate:i=>{const o=i.queryKey;return o[1]===t.id&&o[3]==="collection"&&o[4]==="VIRTUAL_MCP"}})},e[2]=t,e[3]=s.slug,e[4]=r,e[5]=m):m=e[5];const x=m;let p;e[6]!==x||e[7]!==l||e[8]!==a?(p=(i,o)=>{const u=new Set(a);o?u.add(i):u.delete(i),l.mutate({enabled_plugins:Array.from(u)},{onSuccess:x,onError:G})},e[6]=x,e[7]=l,e[8]=a,e[9]=p):p=e[9];const g=p,y=D,C=A;if(P.length===0){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}),e[10]=i):i=e[10],i}let c;e[11]!==g||e[12]!==l||e[13]!==a?(c=P.map(i=>{const o=y(i.id),u=C(i.id),h=a.includes(i.id);return n.jsx(w,{title:o?.label??i.id,description:u??void 0,icon:n.jsx("span",{className:"text-muted-foreground [&>svg]:size-4",children:o?.icon??n.jsx(Q,{size:14})}),onClick:()=>!l.isPending&&g(i.id,!h),action:n.jsx(I,{checked:h,onCheckedChange:v=>g(i.id,v),disabled:l.isPending,onClick:$})},i.id)}),e[11]=g,e[12]=l,e[13]=a,e[14]=c):c=e[14];let f;return e[15]!==c?(f=n.jsx(z,{children:n.jsx(F,{children:c})}),e[15]=c,e[16]=f):f=e[16],f}function $(e){return e.stopPropagation()}function A(e){return P.find(s=>s.id===e)?.description??null}function D(e){const t=E.find(r=>r.pluginId===e);if(t)return{label:t.label,icon:t.items[0]?.icon};const s=R.find(r=>r.pluginId===e);return s?{label:s.label,icon:s.icon}:null}function G(e){K.error("Failed to update plugin: "+(e instanceof Error?e.message:"Unknown error"))}function M(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(j,{children:n.jsx(j.Content,{children:n.jsx(j.Body,{children:n.jsxs(N,{children:[n.jsx(j.Title,{children:"Plugins"}),n.jsx(U,{})]})})})}),e[0]=t):t=e[0],t}function ae(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(T,{capability:"org:manage",area:"plugins",children:n.jsx(M,{})}),e[0]=t):t=e[0],t}export{ae as default};
@@ -1,2 +1,2 @@
1
- import{e as Ke,r as l,j as i,l as re,B as fe,c as Ve,G as ut,o as $,K as Te}from"./index-DBqH3_Tr.js";import{F as mt,l as pt}from"./index-CEsEADMd.js";import{_ as ht,ar as xt,as as gt,at as ae,au as yt,H as $e}from"./agent-icon-OWcPDEQ2.js";import{a as wt}from"./Tool01-CE1enLWz.js";import{s as jt}from"./XClose-Bgoke-N6.js";import{S as bt}from"./scroll-area-DOSO9pu3.js";import{b as Re,T as Oe,a as ze}from"./tooltip-B7sOnQkv.js";import{A as vt,a as Ct,b as Nt,c as St,d as Dt,e as kt,f as Ft,g as Lt}from"./alert-dialog-BqyMBnmX.js";import{a as Et}from"./chat-context-hSR2djUS.js";import{u as Pt}from"./shell-layout-Bhb76vPi.js";import{a7 as le,a8 as Ae,a9 as Tt}from"./index-b-VAmZ9T.js";import{c as $t,e as Rt,b as Ot,d as zt,a as At,D as Wt}from"./dialog-C6QaYxl0.js";import{I as We}from"./input-Cuzo-zTy.js";import{C as It,c as _,d as Ie,e as Mt,f as Kt}from"./shell-route-loading-mUaMt2AK.js";import{t as Vt}from"./ChevronDown-D_SiD52e.js";import{i as Bt}from"./ChevronRight-DRFF6KW4.js";import{i as Gt}from"./ZoomOut-Cx-hi9HP.js";import{E as qt,q as Me,r as he,s as Qt,t as Ut,v as Ht,w as M,x as ce,g as xe,y as ge,z as Jt,A as Xt,B as ye,C as de,D as we,G as Yt,I as Zt}from"./header-tab-button-2U6O3giw.js";import"./AlertCircle-DU7uZY8J.js";import"./SwitchHorizontal01-D6F_mKYx.js";import"./RefreshCcw01-CR2Fhw_7.js";import"./XCircle-UQit86MX.js";import"./ArrowUpRight-DEY-b6kE.js";import"./ZapSquare-H66QOKYB.js";import"./Users03-CTeoWFzj.js";import"./CheckCircle-i_SCh8HK.js";import"./Check-Bk-n4rKs.js";import"./ChevronLeft-CJxMMdOC.js";import"./ChevronUp-f28rZEwl.js";import"./DotsVertical-BD0Jlzeq.js";import"./Container-DxRK5lMe.js";import"./Eye-BR5jFpci.js";import"./Globe01-CNB6Mpsd.js";import"./FilterLines-DqLLGuqf.js";import"./Star01-Bj8KnWg6.js";import"./Palette-BbNQF7ac.js";import"./HardDrive-p4TajzWn.js";import"./Stars02-C_A7q-Eh.js";import"./Key01-DSBXnSBm.js";import"./LayoutLeft-XknICfD_.js";import"./LinkExternal01-DtQPZgan.js";import"./Monitor01-B2xyeevM.js";import"./Sun-DXzJdR2z.js";import"./Play-TWKPwhCM.js";import"./Plus-DXSb81sc.js";import"./SearchMd-AWrKGzzG.js";import"./Settings02-C46G6WCc.js";import"./Shield01-CX_dkwPt.js";import"./Stars01-EZHZaPSP.js";import"./Trash01-D8gQFcOn.js";import"./Upload01-Br3xRIzS.js";import"./User01-D6Gs71XK.js";import"./Users01-Bb-aDnk6.js";import"./X-Bf_z2Leo.js";import"./Zap-TkrtxiYp.js";import"./select-O-homC7-.js";import"./tab-id-DJcQxSw_.js";import"./use-mcp-client-BgKdABiW.js";import"./decopilot-sse-pool-E7Sw2N0h.js";import"./create-sse-subscription-BS5983N4.js";import"./studio-tools-hfOcm94T.js";import"./use-virtual-mcp-FBTL02d0.js";import"./use-collections-cYI0oKE6.js";import"./use-ai-providers-CSnlplZs.js";import"./use-organization-settings-Dpet9l_V.js";import"./avatar-BzNw5Uju.js";import"./required-auth-layout-A79U5RVL.js";import"./useRouterState--dWmVQ9c.js";import"./use-org-sso-ChCwS_VA.js";import"./agent-capabilities-Dfyq2uGy.js";import"./pair-D-dPw7Vh.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BZu-B9lH.js";import"./file-type-icon-DlkWBYHv.js";import"./content-blocks-o63cs2vh.js";import"./types-DBP54icS.js";import"./integration-icon-C1XpJ7QJ.js";import"./use-navigate-to-agent-B96HLz_j.js";import"./use-connection-lmAzDQtG.js";import"./use-mcp-prompts-D52UL8AH.js";import"./form-9w_l2sE8.js";import"./label-CcXzfa1l.js";import"./spinner-CODSjjQl.js";import"./drawer-vaHtyblX.js";import"./collection-search-BAFbwDkO.js";import"./tabs-5VCr7Lmg.js";import"./toggle-group-B_flmDPF.js";import"./connect-desktop-dialog-DCdLrvVO.js";import"./agent-icons-cDvwhRBa.js";import"./checkbox-B-8BZy2m.js";import"./skeleton-Bs6B9g7A.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-bWEtm5yt.js";import"./card-Cm77QeIs.js";import"./popover-Cg9khto7.js";import"./command-OYpJfVPX.js";import"./index-Dm_1qSI1.js";import"./useInfiniteQuery-DMW4zCm0.js";import"./infiniteQueryObserver-DFtHCFaz.js";import"./sortable.esm-CyfFdOo4.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BMnV5fMv.js";import"./use-registry-connections-XCi4lRb-.js";import"./extract-connection-data-A3fQ5XNQ.js";import"./generate-id-D-Z8lvmk.js";import"./collections-BI_JGQp4.js";import"./collection-tabs-CrxbRblh.js";import"./badge-B2p1Cov_.js";import"./textarea-Oxf83X-s.js";import"./connection-form-helpers-DnPdxsfv.js";import"./use-infinite-scroll-bWgRjm8B.js";import"./useSuspenseInfiniteQuery-tnhNRWqB.js";import"./index-Bi8_oF4i.js";import"./dropdown-menu-Imbn90PR.js";import"./question-004-sINsf4GQ.js";import"./sidebar-qjaU6R6F.js";import"./sheet-BvtvfFAl.js";import"./use-status-sounds-CwFju7iN.js";import"./empty-state-DiL0zFYg.js";import"./toolbar-8WByzcnO.js";import"./resizable-DxL9OiT-.js";import"./use-mcp-tools-DVLWn59S.js";import"./use-capability-CPfyR7lg.js";import"./user-Cg2LA8Mh.js";import"./tools-list-dYx9Si__.js";import"./switch-B76FjS24.js";import"./use-debounced-autosave-CyyIp3oB.js";import"./index-DCdT8576.js";import"./search-input-fUp8LGk1.js";import"./use-secrets-BqVTqitm.js";import"./github-repo-picker-Dv4KJl0O.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-SKOJ-KFj.js";import"./view-mode-toggle-DVxKMSOa.js";import"./select-model-C2bxkMXw.js";import"./use-automations-Ds0WDnWO.js";import"./monaco-editor-CSoW9X1e.js";import"./automation-runs-CZtduC0L.js";import"./table-DychmbHa.js";import"./use-members-BY2IDfpw.js";import"./use-org-auth-client-CdNQL1J3.js";import"./task-status-BrHrBwF0.js";import"./automation-list-row-BwkKTT5_.js";import"./use-create-virtual-mcp-Bkzx6tcI.js";import"./index-mc4bQjv-.js";import"./hover-card-BI6ysAg8.js";const _t={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function en(y){const e=Ke.c(51),{open:c,mode:K,initialName:X,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,W=X===void 0?"":X,o=A===void 0?!1:A,[p,R]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&R(W));let F;e[0]!==o||e[1]!==P?(F=E=>{!E&&!o&&P(!1)},e[0]=o,e[1]=P,e[2]=F):F=e[2];const U=F;let G;e[3]!==o||e[4]!==p||e[5]!==V?(G=async E=>{E.preventDefault();const z=p.trim();!z||o||await V(z)},e[3]=o,e[4]=p,e[5]=V,e[6]=G):G=e[6];const q=G;let L;e[7]!==f.title?(L=i.jsx($t,{children:f.title}),e[7]=f.title,e[8]=L):L=e[8];let N;e[9]!==f.description?(N=i.jsx(Rt,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let O;e[11]!==L||e[12]!==N?(O=i.jsxs(Ot,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=O):O=e[13];let S;e[14]!==Q?(S=Q&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),i.jsx(We,{value:Q,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=Q,e[15]=S):S=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=E=>R(E.target.value),e[17]=j):j=e[17];let b;e[18]!==f.placeholder||e[19]!==o||e[20]!==p?(b=i.jsxs("div",{className:"space-y-1.5",children:[D,i.jsx(We,{id:"file-explorer-name",value:p,onChange:j,placeholder:f.placeholder,autoFocus:!0,disabled:o})]}),e[18]=f.placeholder,e[19]=o,e[20]=p,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==S?(h=i.jsxs("div",{className:"space-y-4 py-4",children:[S,b]}),e[22]=b,e[23]=S,e[24]=h):h=e[24];let x;e[25]!==P?(x=()=>P(!1),e[25]=P,e[26]=x):x=e[26];let v;e[27]!==o||e[28]!==x?(v=i.jsx(fe,{type:"button",variant:"outline",onClick:x,disabled:o,children:"Cancel"}),e[27]=o,e[28]=x,e[29]=v):v=e[29];let C;e[30]!==o||e[31]!==p?(C=!p.trim()||o,e[30]=o,e[31]=p,e[32]=C):C=e[32];let u;e[33]!==f.submit||e[34]!==o?(u=o?i.jsxs(i.Fragment,{children:[i.jsx(re,{size:14,className:"animate-spin"}),"Saving…"]}):f.submit,e[33]=f.submit,e[34]=o,e[35]=u):u=e[35];let k;e[36]!==C||e[37]!==u?(k=i.jsx(fe,{type:"submit",disabled:C,children:u}),e[36]=C,e[37]=u,e[38]=k):k=e[38];let m;e[39]!==v||e[40]!==k?(m=i.jsxs(zt,{children:[v,k]}),e[39]=v,e[40]=k,e[41]=m):m=e[41];let g;e[42]!==q||e[43]!==h||e[44]!==m||e[45]!==O?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[O,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=O,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(Wt,{open:c,onOpenChange:U,children:g}),e[47]=U,e[48]=c,e[49]=g,e[50]=T):T=e[50],T}const tn="#d9a441";function nn(y){const e=Ke.c(45),{node:c,depth:K,isExpanded:X,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:W,onNewFile:o,onNewFolder:p,onCopyPath:R,onCopyRelativePath:I,onRename:B,onDelete:f}=y,F=A===void 0?!1:A,U=c.kind==="directory",{Icon:G,color:q}=V,L=Q&&"bg-accent";let N;e[0]!==L?(N=Ve("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",L),e[0]=L,e[1]=N):N=e[1];const O=`${K*14+8}px`;let S;e[2]!==O?(S={paddingLeft:O},e[2]=O,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==W?(D=()=>{W(),P()},e[4]=P,e[5]=W,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==X||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):X?i.jsx(Vt,{size:14,className:"shrink-0 text-muted-foreground"}):i.jsx(Bt,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx(Gt,{size:16,className:"shrink-0",style:{color:tn}})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-3.5 shrink-0"}),i.jsx(G,{size:16,className:"shrink-0",style:{color:q}})]}),e[7]=G,e[8]=q,e[9]=U,e[10]=X,e[11]=F,e[12]=j):j=e[12];let b;e[13]!==c.name?(b=i.jsx("span",{className:"truncate",children:c.name}),e[13]=c.name,e[14]=b):b=e[14];let h;e[15]!==N||e[16]!==S||e[17]!==D||e[18]!==j||e[19]!==b?(h=i.jsx(It,{asChild:!0,children:i.jsxs("button",{type:"button",className:N,style:S,onClick:D,children:[j,b]})}),e[15]=N,e[16]=S,e[17]=D,e[18]=j,e[19]=b,e[20]=h):h=e[20];let x;e[21]!==o?(x=i.jsx(_,{onSelect:o,children:"New File"}),e[21]=o,e[22]=x):x=e[22];let v;e[23]!==p?(v=i.jsx(_,{onSelect:p,children:"New Folder"}),e[23]=p,e[24]=v):v=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ie,{}),e[25]=C):C=e[25];let u;e[26]!==R?(u=i.jsx(_,{onSelect:R,children:"Copy Path"}),e[26]=R,e[27]=u):u=e[27];let k;e[28]!==I?(k=i.jsx(_,{onSelect:I,children:"Copy Relative Path"}),e[28]=I,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ie,{}),e[30]=m):m=e[30];let g;e[31]!==B?(g=i.jsx(_,{onSelect:B,children:"Rename"}),e[31]=B,e[32]=g):g=e[32];let T;e[33]!==f?(T=i.jsx(_,{variant:"destructive",onSelect:f,children:"Delete"}),e[33]=f,e[34]=T):T=e[34];let E;e[35]!==x||e[36]!==v||e[37]!==u||e[38]!==k||e[39]!==g||e[40]!==T?(E=i.jsxs(Mt,{className:"w-52",children:[x,v,C,u,k,m,g,T]}),e[35]=x,e[36]=v,e[37]=u,e[38]=k,e[39]=g,e[40]=T,e[41]=E):E=e[41];let z;return e[42]!==E||e[43]!==h?(z=i.jsxs(Kt,{children:[h,E]}),e[42]=E,e[43]=h,e[44]=z):z=e[44],z}pt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function je(y,e,c,K){return`/api/${y}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(c)}/${K}`}function rn(y){const e=M(y);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const sn="#94a3b8";function on(y){const e=y.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ae,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ae,color:"#d9a441"}:e.endsWith(".json")?{Icon:yt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ae,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ae,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:wt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:$e,color:"#64748b"}:{Icon:$e,color:sn}}function Qi({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[X,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=X,[P,W]=l.useState(new Set),[o,p]=l.useState(null),[R,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,O]=l.useState(new Set),[S,D]=l.useState(new Set),j=l.useRef(0),b=l.useRef(null),h=l.useRef(new Set),x=l.useRef(new Map);function v(t){O(n=>{const r=typeof t=="function"?t(n):t;return h.current=r,r})}const[C,u]=l.useState(new Map),k=l.useRef(null),[m,g]=l.useState(null),{sendMessage:T}=Et(),{setChatOpen:E}=Pt(),z=ut(),[w,H]=l.useState(null),[J,ue]=l.useState(null),[ee,ie]=l.useState(!1);async function te(t,n){const r=await fetch(je(y,e,c,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`Request failed (${r.status})`)}return r.json()}async function se(){z.invalidateQueries({queryKey:Ae(y,e,c)})}function be(t,n){navigator.clipboard.writeText(n).then(()=>$.success(`${t} copied`),()=>$.error(`Failed to copy ${t.toLowerCase()}`))}function Be(t){const n=Yt(t);if(!n)return;const r=`${y}/${e}/${c}`;z.setQueryData(Te.decofile(r),s=>{if(!s)return s;const{[n]:a,...d}=s;return d}),z.invalidateQueries({queryKey:Te.liveMeta(r)})}function Ge(t){const n=t.kind==="file"?[t.path]:A.filter(r=>r.startsWith(".deco/blocks/")).map(r=>ce(r)).filter(r=>r===t.path||r.startsWith(`${t.path}/`));for(const r of n)Be(r)}function qe(t){const n=ce(t);return B.filter(r=>{if(r!==n&&!r.startsWith(`${n}/`))return!1;const s=C.get(r);return!!(s?.loaded&&s.editorValue!==s.savedContent)})}function ve(t){f(n=>n.map(r=>t(r)).filter(r=>r!==null)),p(n=>n&&t(n)),u(n=>{const r=new Map;for(const[s,a]of n){const d=t(s);d&&r.set(d,a)}return r}),I(n=>{if(!n)return n;const r=t(n.path);return r?r===n.path?n:{...n,path:r,name:r.split("/").pop()??r}:null})}function Qe(t){const n=ce(t);I(r=>r&&(r.path===n||r.path.startsWith(`${n}/`)?null:r)),ve(r=>r===n||r.startsWith(`${n}/`)?null:r)}async function Ue(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);await te("write",{path:M(n),content:""}),await ne(),await se(),H(null),me(n)}async function He(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);const r=M(n);await te("mkdir",{path:r}),Q(s=>({...s,directories:s.directories.includes(r)?s.directories:[...s.directories,r]})),await ne(),await se(),H(null),W(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),I({name:t,path:n,kind:"directory",children:[]})}async function Je(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){H(null);return}if(we(s,A,V))throw new Error(`"${t}" already exists`);await te("rename",{from:M(n),to:M(s)}),ve(a=>a===n?s:a.startsWith(`${n}/`)?de(s,a.slice(n.length+1)):a),await ne(),await se(),H(null)}async function Xe(t){ie(!0);try{await te("unlink",{path:M(t.path),recursive:t.kind==="directory"}),Ge(t),Qe(t.path),await ne(),await se(),ue(null),$.success(`Deleted "${t.name}"`)}catch(n){$.error(n instanceof Error?n.message:"Delete failed")}finally{ie(!1)}}async function Ye(t){const n=Xt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await He(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await Je(t),$.success(`Renamed to "${t}"`))}catch(r){$.error(r instanceof Error?r.message:"Operation failed")}finally{ie(!1)}}const Ce=l.useRef(!1);Ce.current||(Ce.current=!0,b.current=ne());const[Ze,_e]=l.useState(null);if(K&&K!==Ze){_e(K);const t=K;queueMicrotask(()=>{rn(t)&&me(t).catch(n=>{$.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ne(t){const n=await te("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Se(t,n,r){if(r!==j.current)return!1;let s=!1;return Q(a=>{const d=n?Zt(a.files,a.directories,t,a.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return s=!!d.truncated,{files:d.files,directories:d.directories,truncated:s}}),s&&$.warning("File list truncated — some files may be hidden"),s}async function et(t){const n=x.current.get(t);if(n)return n;const r=j.current,s=(async()=>{const a=await Ne({pattern:"**/*",path:M(t),limit:Me}),d=Se(a,!0,r);return!d&&r===j.current&&v(Y=>{const oe=new Set(Y);return oe.add(t),oe}),d})();x.current.set(t,s);try{return await s}finally{x.current.delete(t)}}async function De(t){if(!ge(t,h.current))return!1;D(n=>new Set(n).add(t));try{return await et(t)}finally{D(n=>{const r=new Set(n);return r.delete(t),r})}}async function tt(t){const n=new Set(h.current);for(const r of he(t)){if(!ge(r,n))continue;if(await De(r))throw new Error("Folder listing truncated — expand again to load more");n.add(r)}}async function ne(){const t=++j.current;x.current.clear(),q(!0),v(new Set),W(new Set),D(new Set);try{const n=await Ne({pattern:"**/*",limit:Me,maxDepth:qt});Se(n,!1,t),N(!0)}catch{L&&$.error("Failed to refresh file tree")}finally{q(!1)}}async function ke(t){if(!C.get(t)?.loaded){u(r=>{const s=new Map(r);return s.set(t,{savedContent:"",editorValue:"",loaded:!1}),s});try{const r=await fetch(je(y,e,c,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),full:!0})});if(!r.ok)return;const s=await r.json(),a=Jt(s.content??"");u(d=>{const Y=new Map(d);return Y.set(t,{savedContent:a,editorValue:a,loaded:!0}),Y})}catch{}}}async function nt(t,n){try{const r=await fetch(je(y,e,c,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),content:n})});if(!r.ok){le("file save failed",{path:t,status:r.status});return}le("file saved via sandbox /write",{path:t}),z.invalidateQueries({queryKey:Ae(y,e,c)});try{const s=await Tt(y,e,c);le("git status after save",s)}catch(s){le("git status after save failed",{path:t,error:s instanceof Error?s.message:String(s)})}u(s=>{const a=new Map(s),d=a.get(t);return d&&a.set(t,{...d,savedContent:n}),a})}catch{}}function rt(t){p(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),g(null),B.includes(t)||f(n=>[...n,t]),ke(t)}function it(t){f(n=>{const r=n.filter(s=>s!==t);return o===t&&p(r[r.length-1]??null),r}),u(n=>{const r=new Map(n);return r.delete(t),r})}function Fe(t){W(n=>{const r=new Set(n);return r.has(t)?r.delete(t):r.add(t),r})}async function st(t){if(ge(t,h.current))try{if(await De(t))return}catch(n){$.error(n instanceof Error?n.message:"Failed to load folder");return}Fe(t)}async function ot(t,n){if(n){Fe(t);return}await st(t)}async function me(t){await b.current,await tt(t);const n=he(t);W(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return R?.kind==="directory"?R.path:R?.kind==="file"?ye(R.path):o?ye(o):"/"}function Le(t){const n=at();H({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const lt=Qt(A,V),Ee=Ut(lt,P),Pe=F?Ee.filter(t=>t.node.name.toLowerCase().includes(F.toLowerCase())):Ee,Z=o?C.get(o):null,ct=Z?.loaded&&Z.editorValue!==Z.savedContent,pe=J?qe(J.path):[],dt=(t,n)=>{k.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!o)return;const r=t.getValue();await nt(o,r)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const r=t.getSelection(),s=t.getModel();if(!r||!s||!o)return;const a=s.getValueInRange(r);g({filePath:o,lineStart:r.startLineNumber,lineEnd:r.endLineNumber,selectedCode:a})})};function ft(t){if(!m)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${m.filePath}\``,`**Lines:** ${m.lineStart}–${m.lineEnd}`];if(m.selectedCode){const r=xe(m.filePath),s=m.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+r,s,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),E(!0),T({parts:[{type:"text",text:n.join(`
1
+ import{e as Ke,r as l,j as i,l as re,B as fe,c as Ve,G as ut,o as $,K as Te}from"./index-Dlc4tDxO.js";import{F as mt,l as pt}from"./index-Dcfw-W2O.js";import{_ as ht,ar as xt,as as gt,at as ae,au as yt,H as $e}from"./agent-icon-D1ySfhKA.js";import{a as wt}from"./Tool01-DPPRaW86.js";import{s as jt}from"./XClose-N2P2hiYb.js";import{S as bt}from"./scroll-area-CifcP4Wg.js";import{b as Re,T as Oe,a as ze}from"./tooltip-D0rD3x8T.js";import{A as vt,a as Ct,b as Nt,c as St,d as Dt,e as kt,f as Ft,g as Lt}from"./alert-dialog-CBzhgusU.js";import{a as Et}from"./chat-context-BOn4WPpq.js";import{u as Pt}from"./shell-layout-D-4Zna-j.js";import{a7 as le,a8 as Ae,a9 as Tt}from"./index-CwnBaaeQ.js";import{c as $t,e as Rt,b as Ot,d as zt,a as At,D as Wt}from"./dialog-IkiImd7I.js";import{I as We}from"./input-CDaarCl_.js";import{C as It,c as _,d as Ie,e as Mt,f as Kt}from"./shell-route-loading-D7iIgnMy.js";import{t as Vt}from"./ChevronDown-CN6qoGcG.js";import{i as Bt}from"./ChevronRight-BJSYQUmF.js";import{i as Gt}from"./ZoomOut-Xe1itnU7.js";import{E as qt,q as Me,r as he,s as Qt,t as Ut,v as Ht,w as M,x as ce,g as xe,y as ge,z as Jt,A as Xt,B as ye,C as de,D as we,G as Yt,I as Zt}from"./header-tab-button-Qu1eh6fb.js";import"./AlertCircle-De-QnqNt.js";import"./SwitchHorizontal01-CLZ8VEjC.js";import"./RefreshCcw01-CcpA4rje.js";import"./XCircle-BdbzgmP6.js";import"./ArrowUpRight-B0GfNpsw.js";import"./ZapSquare-AN7R7mTa.js";import"./Users03-CKUicuTa.js";import"./CheckCircle-DKSRB9Xd.js";import"./Check-DHmAQH53.js";import"./ChevronLeft-HFx1Uufy.js";import"./ChevronUp-CTGwFzLw.js";import"./DotsVertical-jUGLCiy5.js";import"./Container-DZBZNA8Y.js";import"./Eye-CGoLCmzu.js";import"./Globe01--hrfRyvA.js";import"./FilterLines-DYSfUppO.js";import"./Star01-BjpgI7im.js";import"./Palette-B9PbEO6t.js";import"./HardDrive-yKlUP3QG.js";import"./Stars02-Cv3Kyp_N.js";import"./Key01-DqH2W8Qa.js";import"./LayoutLeft-CLZVvVLM.js";import"./LinkExternal01-CaYoYL1Y.js";import"./Monitor01-BRL4_dKI.js";import"./Sun-C0I4hv8e.js";import"./Play-Btpg8EpH.js";import"./Plus-Cv0T2Pov.js";import"./SearchMd-BP9M1g2N.js";import"./Settings02-BMRrFVdB.js";import"./Shield01-rOhEAWZ1.js";import"./Stars01-yuWjNyMF.js";import"./Trash01-s7FZsfBC.js";import"./Upload01-xUCMslnL.js";import"./User01-BsF0RS3z.js";import"./Users01-D-iBSVXa.js";import"./X-CMYaHMo4.js";import"./Zap-gqEvk94k.js";import"./select-Dz7DPkoH.js";import"./tab-id-By_JW--7.js";import"./use-mcp-client-BoOtVD9g.js";import"./decopilot-sse-pool-Bj1W2y0B.js";import"./create-sse-subscription-BS5983N4.js";import"./studio-tools-B-zlmqyw.js";import"./use-virtual-mcp-_FyR-EfH.js";import"./use-collections-CH3Uvmj5.js";import"./use-ai-providers-BL6EQsm8.js";import"./use-organization-settings-BQtNgLEs.js";import"./avatar-AI83PqVE.js";import"./required-auth-layout-q1UX5iFV.js";import"./useRouterState-CfhsEB7J.js";import"./use-org-sso-BCRYycoj.js";import"./agent-capabilities-Deuuzqbm.js";import"./pair-BfYvjacw.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DHiMTnai.js";import"./file-type-icon-BYSeb5A3.js";import"./content-blocks-o63cs2vh.js";import"./types-Bt2jh4HB.js";import"./integration-icon-DylMdkB7.js";import"./use-navigate-to-agent-_X_kAEcz.js";import"./use-connection-BGpjiuJJ.js";import"./use-mcp-prompts-CYbN8Yyl.js";import"./form-ChQh_wIn.js";import"./label-CmtFIrH6.js";import"./spinner-DUmur8qx.js";import"./drawer-DO_U_Bhd.js";import"./collection-search-B-CX-Cb7.js";import"./tabs-_yym-ubf.js";import"./toggle-group-BYYoZiYB.js";import"./connect-desktop-dialog-DRFjva34.js";import"./agent-icons-DpDt_xvu.js";import"./checkbox-Cwl_z5GL.js";import"./skeleton-bErIIEAe.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BkfPlxIX.js";import"./card-DmbfBYZU.js";import"./popover-DaxAVDXR.js";import"./command-BHuAtd3n.js";import"./index-C5R8l9NR.js";import"./useInfiniteQuery-Dzg2BCY9.js";import"./infiniteQueryObserver-D4Z6Hq7s.js";import"./sortable.esm-D_73qywG.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DEvkcpmQ.js";import"./use-registry-connections-CPtcwe6P.js";import"./extract-connection-data-Uz57CpVC.js";import"./generate-id-BrtbvnKY.js";import"./collections-CXYJ8MVZ.js";import"./collection-tabs-CdfD34L4.js";import"./badge-CikIA9ZK.js";import"./textarea-BhyLj2Dp.js";import"./connection-form-helpers-BxYEqmM8.js";import"./use-infinite-scroll-BlDyJWAa.js";import"./useSuspenseInfiniteQuery-D3ys-EbO.js";import"./index-DFp-rnQf.js";import"./dropdown-menu-C-Cxaez8.js";import"./question-004-sINsf4GQ.js";import"./sidebar-BT1O99E-.js";import"./sheet-C2OErkZR.js";import"./use-status-sounds-CZU7jLXq.js";import"./empty-state-o52Hq4fy.js";import"./toolbar-BQgYgute.js";import"./resizable-B_wg5OKG.js";import"./use-mcp-tools-DlzThqmJ.js";import"./use-capability-DqPX2R7m.js";import"./user-CXZKnlfK.js";import"./tools-list-Bib10JJv.js";import"./switch-CRVfQAZr.js";import"./use-debounced-autosave-BnF-F24h.js";import"./index-NNvehl9i.js";import"./search-input-eml2HEUh.js";import"./use-secrets-wimlaYjN.js";import"./github-repo-picker-13FobS0K.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-BIWbMpHu.js";import"./view-mode-toggle-BO9qiFWG.js";import"./select-model-B6KC9bZ9.js";import"./use-automations-jCgcI_Hn.js";import"./monaco-editor--8410HRL.js";import"./automation-runs-BcknuTTv.js";import"./table-70fRVfwQ.js";import"./use-members-BLEStPtC.js";import"./use-org-auth-client-ziK5gAU8.js";import"./task-status-B3M1uY2i.js";import"./automation-list-row-7qb4yrwv.js";import"./use-create-virtual-mcp-8G8o89BT.js";import"./index-CweEMiqH.js";import"./hover-card-5iaAH0_M.js";const _t={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function en(y){const e=Ke.c(51),{open:c,mode:K,initialName:X,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,W=X===void 0?"":X,o=A===void 0?!1:A,[p,R]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&R(W));let F;e[0]!==o||e[1]!==P?(F=E=>{!E&&!o&&P(!1)},e[0]=o,e[1]=P,e[2]=F):F=e[2];const U=F;let G;e[3]!==o||e[4]!==p||e[5]!==V?(G=async E=>{E.preventDefault();const z=p.trim();!z||o||await V(z)},e[3]=o,e[4]=p,e[5]=V,e[6]=G):G=e[6];const q=G;let L;e[7]!==f.title?(L=i.jsx($t,{children:f.title}),e[7]=f.title,e[8]=L):L=e[8];let N;e[9]!==f.description?(N=i.jsx(Rt,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let O;e[11]!==L||e[12]!==N?(O=i.jsxs(Ot,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=O):O=e[13];let S;e[14]!==Q?(S=Q&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),i.jsx(We,{value:Q,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=Q,e[15]=S):S=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=E=>R(E.target.value),e[17]=j):j=e[17];let b;e[18]!==f.placeholder||e[19]!==o||e[20]!==p?(b=i.jsxs("div",{className:"space-y-1.5",children:[D,i.jsx(We,{id:"file-explorer-name",value:p,onChange:j,placeholder:f.placeholder,autoFocus:!0,disabled:o})]}),e[18]=f.placeholder,e[19]=o,e[20]=p,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==S?(h=i.jsxs("div",{className:"space-y-4 py-4",children:[S,b]}),e[22]=b,e[23]=S,e[24]=h):h=e[24];let x;e[25]!==P?(x=()=>P(!1),e[25]=P,e[26]=x):x=e[26];let v;e[27]!==o||e[28]!==x?(v=i.jsx(fe,{type:"button",variant:"outline",onClick:x,disabled:o,children:"Cancel"}),e[27]=o,e[28]=x,e[29]=v):v=e[29];let C;e[30]!==o||e[31]!==p?(C=!p.trim()||o,e[30]=o,e[31]=p,e[32]=C):C=e[32];let u;e[33]!==f.submit||e[34]!==o?(u=o?i.jsxs(i.Fragment,{children:[i.jsx(re,{size:14,className:"animate-spin"}),"Saving…"]}):f.submit,e[33]=f.submit,e[34]=o,e[35]=u):u=e[35];let k;e[36]!==C||e[37]!==u?(k=i.jsx(fe,{type:"submit",disabled:C,children:u}),e[36]=C,e[37]=u,e[38]=k):k=e[38];let m;e[39]!==v||e[40]!==k?(m=i.jsxs(zt,{children:[v,k]}),e[39]=v,e[40]=k,e[41]=m):m=e[41];let g;e[42]!==q||e[43]!==h||e[44]!==m||e[45]!==O?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[O,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=O,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(Wt,{open:c,onOpenChange:U,children:g}),e[47]=U,e[48]=c,e[49]=g,e[50]=T):T=e[50],T}const tn="#d9a441";function nn(y){const e=Ke.c(45),{node:c,depth:K,isExpanded:X,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:W,onNewFile:o,onNewFolder:p,onCopyPath:R,onCopyRelativePath:I,onRename:B,onDelete:f}=y,F=A===void 0?!1:A,U=c.kind==="directory",{Icon:G,color:q}=V,L=Q&&"bg-accent";let N;e[0]!==L?(N=Ve("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",L),e[0]=L,e[1]=N):N=e[1];const O=`${K*14+8}px`;let S;e[2]!==O?(S={paddingLeft:O},e[2]=O,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==W?(D=()=>{W(),P()},e[4]=P,e[5]=W,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==X||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):X?i.jsx(Vt,{size:14,className:"shrink-0 text-muted-foreground"}):i.jsx(Bt,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx(Gt,{size:16,className:"shrink-0",style:{color:tn}})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-3.5 shrink-0"}),i.jsx(G,{size:16,className:"shrink-0",style:{color:q}})]}),e[7]=G,e[8]=q,e[9]=U,e[10]=X,e[11]=F,e[12]=j):j=e[12];let b;e[13]!==c.name?(b=i.jsx("span",{className:"truncate",children:c.name}),e[13]=c.name,e[14]=b):b=e[14];let h;e[15]!==N||e[16]!==S||e[17]!==D||e[18]!==j||e[19]!==b?(h=i.jsx(It,{asChild:!0,children:i.jsxs("button",{type:"button",className:N,style:S,onClick:D,children:[j,b]})}),e[15]=N,e[16]=S,e[17]=D,e[18]=j,e[19]=b,e[20]=h):h=e[20];let x;e[21]!==o?(x=i.jsx(_,{onSelect:o,children:"New File"}),e[21]=o,e[22]=x):x=e[22];let v;e[23]!==p?(v=i.jsx(_,{onSelect:p,children:"New Folder"}),e[23]=p,e[24]=v):v=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ie,{}),e[25]=C):C=e[25];let u;e[26]!==R?(u=i.jsx(_,{onSelect:R,children:"Copy Path"}),e[26]=R,e[27]=u):u=e[27];let k;e[28]!==I?(k=i.jsx(_,{onSelect:I,children:"Copy Relative Path"}),e[28]=I,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ie,{}),e[30]=m):m=e[30];let g;e[31]!==B?(g=i.jsx(_,{onSelect:B,children:"Rename"}),e[31]=B,e[32]=g):g=e[32];let T;e[33]!==f?(T=i.jsx(_,{variant:"destructive",onSelect:f,children:"Delete"}),e[33]=f,e[34]=T):T=e[34];let E;e[35]!==x||e[36]!==v||e[37]!==u||e[38]!==k||e[39]!==g||e[40]!==T?(E=i.jsxs(Mt,{className:"w-52",children:[x,v,C,u,k,m,g,T]}),e[35]=x,e[36]=v,e[37]=u,e[38]=k,e[39]=g,e[40]=T,e[41]=E):E=e[41];let z;return e[42]!==E||e[43]!==h?(z=i.jsxs(Kt,{children:[h,E]}),e[42]=E,e[43]=h,e[44]=z):z=e[44],z}pt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function je(y,e,c,K){return`/api/${y}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(c)}/${K}`}function rn(y){const e=M(y);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const sn="#94a3b8";function on(y){const e=y.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ae,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ae,color:"#d9a441"}:e.endsWith(".json")?{Icon:yt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ae,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ae,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:wt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:$e,color:"#64748b"}:{Icon:$e,color:sn}}function Qi({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[X,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=X,[P,W]=l.useState(new Set),[o,p]=l.useState(null),[R,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,O]=l.useState(new Set),[S,D]=l.useState(new Set),j=l.useRef(0),b=l.useRef(null),h=l.useRef(new Set),x=l.useRef(new Map);function v(t){O(n=>{const r=typeof t=="function"?t(n):t;return h.current=r,r})}const[C,u]=l.useState(new Map),k=l.useRef(null),[m,g]=l.useState(null),{sendMessage:T}=Et(),{setChatOpen:E}=Pt(),z=ut(),[w,H]=l.useState(null),[J,ue]=l.useState(null),[ee,ie]=l.useState(!1);async function te(t,n){const r=await fetch(je(y,e,c,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`Request failed (${r.status})`)}return r.json()}async function se(){z.invalidateQueries({queryKey:Ae(y,e,c)})}function be(t,n){navigator.clipboard.writeText(n).then(()=>$.success(`${t} copied`),()=>$.error(`Failed to copy ${t.toLowerCase()}`))}function Be(t){const n=Yt(t);if(!n)return;const r=`${y}/${e}/${c}`;z.setQueryData(Te.decofile(r),s=>{if(!s)return s;const{[n]:a,...d}=s;return d}),z.invalidateQueries({queryKey:Te.liveMeta(r)})}function Ge(t){const n=t.kind==="file"?[t.path]:A.filter(r=>r.startsWith(".deco/blocks/")).map(r=>ce(r)).filter(r=>r===t.path||r.startsWith(`${t.path}/`));for(const r of n)Be(r)}function qe(t){const n=ce(t);return B.filter(r=>{if(r!==n&&!r.startsWith(`${n}/`))return!1;const s=C.get(r);return!!(s?.loaded&&s.editorValue!==s.savedContent)})}function ve(t){f(n=>n.map(r=>t(r)).filter(r=>r!==null)),p(n=>n&&t(n)),u(n=>{const r=new Map;for(const[s,a]of n){const d=t(s);d&&r.set(d,a)}return r}),I(n=>{if(!n)return n;const r=t(n.path);return r?r===n.path?n:{...n,path:r,name:r.split("/").pop()??r}:null})}function Qe(t){const n=ce(t);I(r=>r&&(r.path===n||r.path.startsWith(`${n}/`)?null:r)),ve(r=>r===n||r.startsWith(`${n}/`)?null:r)}async function Ue(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);await te("write",{path:M(n),content:""}),await ne(),await se(),H(null),me(n)}async function He(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);const r=M(n);await te("mkdir",{path:r}),Q(s=>({...s,directories:s.directories.includes(r)?s.directories:[...s.directories,r]})),await ne(),await se(),H(null),W(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),I({name:t,path:n,kind:"directory",children:[]})}async function Je(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){H(null);return}if(we(s,A,V))throw new Error(`"${t}" already exists`);await te("rename",{from:M(n),to:M(s)}),ve(a=>a===n?s:a.startsWith(`${n}/`)?de(s,a.slice(n.length+1)):a),await ne(),await se(),H(null)}async function Xe(t){ie(!0);try{await te("unlink",{path:M(t.path),recursive:t.kind==="directory"}),Ge(t),Qe(t.path),await ne(),await se(),ue(null),$.success(`Deleted "${t.name}"`)}catch(n){$.error(n instanceof Error?n.message:"Delete failed")}finally{ie(!1)}}async function Ye(t){const n=Xt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await He(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await Je(t),$.success(`Renamed to "${t}"`))}catch(r){$.error(r instanceof Error?r.message:"Operation failed")}finally{ie(!1)}}const Ce=l.useRef(!1);Ce.current||(Ce.current=!0,b.current=ne());const[Ze,_e]=l.useState(null);if(K&&K!==Ze){_e(K);const t=K;queueMicrotask(()=>{rn(t)&&me(t).catch(n=>{$.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ne(t){const n=await te("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Se(t,n,r){if(r!==j.current)return!1;let s=!1;return Q(a=>{const d=n?Zt(a.files,a.directories,t,a.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return s=!!d.truncated,{files:d.files,directories:d.directories,truncated:s}}),s&&$.warning("File list truncated — some files may be hidden"),s}async function et(t){const n=x.current.get(t);if(n)return n;const r=j.current,s=(async()=>{const a=await Ne({pattern:"**/*",path:M(t),limit:Me}),d=Se(a,!0,r);return!d&&r===j.current&&v(Y=>{const oe=new Set(Y);return oe.add(t),oe}),d})();x.current.set(t,s);try{return await s}finally{x.current.delete(t)}}async function De(t){if(!ge(t,h.current))return!1;D(n=>new Set(n).add(t));try{return await et(t)}finally{D(n=>{const r=new Set(n);return r.delete(t),r})}}async function tt(t){const n=new Set(h.current);for(const r of he(t)){if(!ge(r,n))continue;if(await De(r))throw new Error("Folder listing truncated — expand again to load more");n.add(r)}}async function ne(){const t=++j.current;x.current.clear(),q(!0),v(new Set),W(new Set),D(new Set);try{const n=await Ne({pattern:"**/*",limit:Me,maxDepth:qt});Se(n,!1,t),N(!0)}catch{L&&$.error("Failed to refresh file tree")}finally{q(!1)}}async function ke(t){if(!C.get(t)?.loaded){u(r=>{const s=new Map(r);return s.set(t,{savedContent:"",editorValue:"",loaded:!1}),s});try{const r=await fetch(je(y,e,c,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),full:!0})});if(!r.ok)return;const s=await r.json(),a=Jt(s.content??"");u(d=>{const Y=new Map(d);return Y.set(t,{savedContent:a,editorValue:a,loaded:!0}),Y})}catch{}}}async function nt(t,n){try{const r=await fetch(je(y,e,c,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),content:n})});if(!r.ok){le("file save failed",{path:t,status:r.status});return}le("file saved via sandbox /write",{path:t}),z.invalidateQueries({queryKey:Ae(y,e,c)});try{const s=await Tt(y,e,c);le("git status after save",s)}catch(s){le("git status after save failed",{path:t,error:s instanceof Error?s.message:String(s)})}u(s=>{const a=new Map(s),d=a.get(t);return d&&a.set(t,{...d,savedContent:n}),a})}catch{}}function rt(t){p(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),g(null),B.includes(t)||f(n=>[...n,t]),ke(t)}function it(t){f(n=>{const r=n.filter(s=>s!==t);return o===t&&p(r[r.length-1]??null),r}),u(n=>{const r=new Map(n);return r.delete(t),r})}function Fe(t){W(n=>{const r=new Set(n);return r.has(t)?r.delete(t):r.add(t),r})}async function st(t){if(ge(t,h.current))try{if(await De(t))return}catch(n){$.error(n instanceof Error?n.message:"Failed to load folder");return}Fe(t)}async function ot(t,n){if(n){Fe(t);return}await st(t)}async function me(t){await b.current,await tt(t);const n=he(t);W(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return R?.kind==="directory"?R.path:R?.kind==="file"?ye(R.path):o?ye(o):"/"}function Le(t){const n=at();H({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const lt=Qt(A,V),Ee=Ut(lt,P),Pe=F?Ee.filter(t=>t.node.name.toLowerCase().includes(F.toLowerCase())):Ee,Z=o?C.get(o):null,ct=Z?.loaded&&Z.editorValue!==Z.savedContent,pe=J?qe(J.path):[],dt=(t,n)=>{k.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!o)return;const r=t.getValue();await nt(o,r)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const r=t.getSelection(),s=t.getModel();if(!r||!s||!o)return;const a=s.getValueInRange(r);g({filePath:o,lineStart:r.startLineNumber,lineEnd:r.endLineNumber,selectedCode:a})})};function ft(t){if(!m)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${m.filePath}\``,`**Lines:** ${m.lineStart}–${m.lineEnd}`];if(m.selectedCode){const r=xe(m.filePath),s=m.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+r,s,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),E(!0),T({parts:[{type:"text",text:n.join(`
2
2
  `)}]}),g(null)}return G&&!L?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[i.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[i.jsxs("div",{className:"relative min-w-0 flex-1",children:[i.jsx(ht,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{type:"text",value:F,onChange:t=>U(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),i.jsxs(Re,{children:[i.jsx(Oe,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:i.jsx(xt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New file"})]}),i.jsxs(Re,{children:[i.jsx(Oe,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:i.jsx(gt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New folder"})]})]}),i.jsx(bt,{className:"flex-1",children:i.jsxs("div",{className:"py-1",children:[Pe.map(t=>{const{node:n,depth:r}=t,s=n.kind==="directory",a=P.has(n.path),d=R?.path===n.path,Y=Ht(n.path,n.kind),oe=s&&S.has(n.path);return i.jsx(nn,{node:n,depth:r,isExpanded:a,isSelected:d,isLoading:oe,fileVisual:on(n.name),onSelect:()=>I(n),onOpen:()=>{s?ot(n.path,a):me(n.path)},onNewFile:()=>H({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>H({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>be("Path",ce(n.path)),onCopyRelativePath:()=>be("Relative path",M(n.path)),onRename:()=>H({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ue(n)},n.path)}),L&&Pe.length===0&&i.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:F?`No files match "${F}"`:"No files found"})]})})]}),i.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[B.length>0&&i.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:B.map(t=>{const n=C.get(t),r=n?.loaded&&n.editorValue!==n.savedContent,s=o===t,a=t.split("/").pop()??t;return i.jsxs("div",{className:Ve("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",s?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{p(t),ke(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":s,children:[i.jsx("span",{className:"truncate max-w-32",children:a}),r&&i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),i.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:d=>{d.stopPropagation(),it(t)},children:i.jsx(jt,{size:12})})]},t)})}),m&&i.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:i.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const r=t.currentTarget.elements.namedItem("askAiInput");r.value.trim()&&ft(r.value)},children:[i.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&g(null)}}),i.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[i.jsx("title",{children:"Send"}),i.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),i.jsx("div",{className:"flex-1 overflow-hidden",children:o&&Z?.loaded?i.jsx(mt,{language:xe(o),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:o,onChange:t=>{const n=o;n&&u(r=>{const s=new Map(r),a=s.get(n);return a&&s.set(n,{...a,editorValue:t??""}),s})},onMount:dt,loading:i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},o):o&&!Z?.loaded?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),o&&i.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[i.jsx("span",{className:"truncate",children:o}),i.jsxs("span",{children:[ct?"Modified":"Saved"," ·"," ",xe(o)]})]})]}),i.jsx(en,{open:w!==null,mode:w?.mode??"new-file",initialName:w?.mode==="rename"?w.node.name:"",parentLabel:w&&w.mode!=="rename"?w.parentDir==="/"?"/":M(w.parentDir):void 0,isPending:ee,onSubmit:Ye,onOpenChange:t=>{!t&&!ee&&H(null)}}),i.jsx(vt,{open:J!==null,onOpenChange:t=>{!t&&!ee&&ue(null)},children:i.jsxs(Ct,{children:[i.jsxs(Nt,{children:[i.jsxs(St,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),i.jsxs(Dt,{children:["This will permanently delete"," ",i.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",pe.length>0&&i.jsxs(i.Fragment,{children:[" ",pe.length===1?"One open file has unsaved changes that will be lost.":`${pe.length} open files have unsaved changes that will be lost.`]})]})]}),i.jsxs(kt,{children:[i.jsx(Ft,{disabled:ee,children:"Cancel"}),i.jsx(Lt,{disabled:ee||!J,onClick:t=>{t.preventDefault(),J&&Xe(J)},children:"Delete"})]})]})})]})}export{Qi as FileExplorer};