decocms 3.89.2 → 3.90.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/dist/client/assets/{AlertCircle-flSoo6uw.js → AlertCircle-eL7jEjpx.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-BeOMO89N.js → ArrowUpRight-BtZv9HXz.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-B9ekAAw-.js → CheckCircle-Ce4sW5Fr.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-BWfuTI7r.js → ChevronDown-8-SpQ5a6.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-BNcg18cx.js → ChevronLeft-DQ6Y033o.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-ChYOVgWd.js → ChevronRight-C7AnVgNL.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-BhWz3ylT.js → ChevronUp-hzSQl57_.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-C0YWb9xq.js → DotsVertical-CBCiPEnd.js} +1 -1
  9. package/dist/client/assets/{Eye-DWTUBTZ_.js → Eye-Du8USWUC.js} +1 -1
  10. package/dist/client/assets/{FilterLines-Djqj6uj_.js → FilterLines-D51fKry2.js} +1 -1
  11. package/dist/client/assets/{Globe01-BgRW2EiE.js → Globe01-ByUFNYZ1.js} +1 -1
  12. package/dist/client/assets/{Globe04-XITcP2mp.js → Globe04-BnUIZrLZ.js} +1 -1
  13. package/dist/client/assets/{HardDrive-DS3VxDtU.js → HardDrive-OrjxQFg1.js} +1 -1
  14. package/dist/client/assets/{Key01-DX7L8s0Z.js → Key01-CI_-yaVv.js} +1 -1
  15. package/dist/client/assets/{LayoutLeft-BqtFvEWV.js → LayoutLeft-DnqAFiqW.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-Cf-6A1_h.js → LinkExternal01-C9plWUCQ.js} +1 -1
  17. package/dist/client/assets/{Monitor01-CZ30bS8J.js → Monitor01-Cx6UPY56.js} +1 -1
  18. package/dist/client/assets/{Palette-Dy2dQgqx.js → Palette-DxYtHeiN.js} +1 -1
  19. package/dist/client/assets/{Play-DvFnuZIO.js → Play-Bpofg5MS.js} +1 -1
  20. package/dist/client/assets/{Plus-jFajoMCA.js → Plus-B6Bp27KE.js} +1 -1
  21. package/dist/client/assets/{SearchMd-uzKFlzQB.js → SearchMd-DY2IStnr.js} +1 -1
  22. package/dist/client/assets/{Settings02-47eDNk4K.js → Settings02-CzDpZT_t.js} +1 -1
  23. package/dist/client/assets/{Shield01-BgRa80OR.js → Shield01-ByoQOTwe.js} +1 -1
  24. package/dist/client/assets/{Star01-BrkbxV-A.js → Star01-COmcJPAd.js} +1 -1
  25. package/dist/client/assets/{Stars01-Daq_eW6a.js → Stars01-DjTb55Tj.js} +1 -1
  26. package/dist/client/assets/{Stars02-DlImJz_z.js → Stars02-B4L_1USv.js} +1 -1
  27. package/dist/client/assets/{Sun-9FxiCes3.js → Sun-BrBndJzL.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-CB5mOBIf.js → SwitchHorizontal01-COrtT0WP.js} +1 -1
  29. package/dist/client/assets/{Tool01-rx0lKYM8.js → Tool01-D9Z3ra2m.js} +1 -1
  30. package/dist/client/assets/{Trash01-DI7qV1ow.js → Trash01-S_d8yXYH.js} +1 -1
  31. package/dist/client/assets/{Upload01-Boqk1hvA.js → Upload01-BovBQGIq.js} +1 -1
  32. package/dist/client/assets/{User01-B3UbdHmL.js → User01-Dcns6QTI.js} +1 -1
  33. package/dist/client/assets/{Users01-BUyczaeV.js → Users01-Dua8TttV.js} +1 -1
  34. package/dist/client/assets/{Users03-gvBLUtvG.js → Users03-DTBaxDUb.js} +1 -1
  35. package/dist/client/assets/{X-B-cRV-7d.js → X-ClFhIPPx.js} +1 -1
  36. package/dist/client/assets/{XCircle-CkhBWURn.js → XCircle-ZlnM-le2.js} +1 -1
  37. package/dist/client/assets/{XClose-Doj89HqF.js → XClose-Cr1-H9ci.js} +1 -1
  38. package/dist/client/assets/{Zap-BCqTHl-x.js → Zap-TPho1Yix.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-DdgE8vy-.js → ZapSquare-Brn6J5mG.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-BdBjpsIq.js → ZoomOut-BkeollDv.js} +1 -1
  41. package/dist/client/assets/{access-gate-BXDE0rsJ.js → access-gate-FCkKFtCU.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-7a6BUncs.js → add-section-modal-CP8OZAs0.js} +1 -1
  43. package/dist/client/assets/{agent-icon-C6bJxQ04.js → agent-icon-B6eCx9D1.js} +1 -1
  44. package/dist/client/assets/{agents-list-sjsqj6Ot.js → agents-list-CoW11iHc.js} +1 -1
  45. package/dist/client/assets/ai-providers-DZvST0-1.js +1 -0
  46. package/dist/client/assets/{alert-C81LnOX9.js → alert-DG7kpTTq.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-HmiP05XU.js → alert-dialog-DCN5JdMo.js} +3 -3
  48. package/dist/client/assets/app-editor-Cslki56N.js +1 -0
  49. package/dist/client/assets/{auth-B9Q1UUsp.js → auth-B9FveTwh.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-ClOrr_P8.js → auth-catchall-c1PPJXlb.js} +1 -1
  51. package/dist/client/assets/{auth-entry-B7DIloAw.js → auth-entry-_nOUFp_x.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-dWTaQKch.js → auth-split-layout-DqH6c0k8.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-xCkDryiA.js → authenticate-and-persist-oauth-DiMpH9Hf.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-CLUMzxuG.js → automation-list-row-D6X7gs0k.js} +1 -1
  55. package/dist/client/assets/{automation-runs-DxPUfxy1.js → automation-runs-B9slN7zB.js} +1 -1
  56. package/dist/client/assets/automations-DgNLJXiB.js +1 -0
  57. package/dist/client/assets/{avatar-oAcdiJ9v.js → avatar-CMukQvh7.js} +1 -1
  58. package/dist/client/assets/{badge-CpKEkIGn.js → badge-BkyT3WoL.js} +1 -1
  59. package/dist/client/assets/{block-document-BVHsyU-9.js → block-document-DuE6VWLI.js} +1 -1
  60. package/dist/client/assets/{brand-context-CwjLKTtp.js → brand-context--ofWuplm.js} +1 -1
  61. package/dist/client/assets/buckets-YjT6-1gl.js +1 -0
  62. package/dist/client/assets/{capability-load-error-CG-hWPTN.js → capability-load-error-b3EGpgG0.js} +1 -1
  63. package/dist/client/assets/{card-BIwENur_.js → card-Bs3t5A2h.js} +1 -1
  64. package/dist/client/assets/category-editor-CEjlWNxU.js +1 -0
  65. package/dist/client/assets/{chat-context-DN0_9Gee.js → chat-context-DueHVvJY.js} +5 -5
  66. package/dist/client/assets/{checkbox-Bi39v4Qa.js → checkbox-LHoIUSFR.js} +1 -1
  67. package/dist/client/assets/{cli-auth-success-pdfiwdy1.js → cli-auth-success-ML14RiWT.js} +1 -1
  68. package/dist/client/assets/collection-detail-ibjdpE0q.js +1 -0
  69. package/dist/client/assets/{collection-display-button-Bzf7YHNy.js → collection-display-button-Drrg41_3.js} +1 -1
  70. package/dist/client/assets/{collection-search-DbQr2iji.js → collection-search-CgpTu-Mz.js} +1 -1
  71. package/dist/client/assets/{collection-tabs-D77_So6e.js → collection-tabs-C8hplLSb.js} +1 -1
  72. package/dist/client/assets/command-BQdrUZdP.js +1 -0
  73. package/dist/client/assets/commerce-onboarding-D1XLRejF.js +1 -0
  74. package/dist/client/assets/{connect-desktop-dialog-ByWaevjw.js → connect-desktop-dialog-XNmCdvVO.js} +1 -1
  75. package/dist/client/assets/{connection-card-DehsL0Sf.js → connection-card-DFgMcv0g.js} +1 -1
  76. package/dist/client/assets/connection-detail-D4rMC3p5.js +1 -0
  77. package/dist/client/assets/{connection-form-helpers-CASdXQaW.js → connection-form-helpers-BehaoK99.js} +1 -1
  78. package/dist/client/assets/connections-EApUiHUb.js +1 -0
  79. package/dist/client/assets/{context-menu-Bt-E5y3C.js → context-menu-BrlUfyhd.js} +1 -1
  80. package/dist/client/assets/{decopilot-BXlT8NLf.js → decopilot-2OorXRZy.js} +1 -1
  81. package/dist/client/assets/{decopilot-sse-pool-CKTJhrtc.js → decopilot-sse-pool-BTlcRVcA.js} +1 -1
  82. package/dist/client/assets/{dialog-BLvz2lK8.js → dialog-DGm31nBN.js} +1 -1
  83. package/dist/client/assets/{domain-settings-ed9WclHg.js → domain-settings-CdtyE8KM.js} +1 -1
  84. package/dist/client/assets/{drawer-C4RJ4_GY.js → drawer-DdWdZjEE.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-CRyIPZil.js → dropdown-menu-BLOjaXD3.js} +1 -1
  86. package/dist/client/assets/{empty-state-CmZpGujH.js → empty-state-DVp61Buk.js} +1 -1
  87. package/dist/client/assets/{extract-connection-data-iACc8UZO.js → extract-connection-data-D_bB-ShD.js} +1 -1
  88. package/dist/client/assets/file-explorer-vaSlSqZW.js +2 -0
  89. package/dist/client/assets/{file-type-icon-Db262N7w.js → file-type-icon-BCa6hDuH.js} +1 -1
  90. package/dist/client/assets/{files-BwDocccC.js → files-DQb9-lnV.js} +1 -1
  91. package/dist/client/assets/{form-CPJbrMq5.js → form-B5xe8o6u.js} +1 -1
  92. package/dist/client/assets/general-ydE7PYML.js +1 -0
  93. package/dist/client/assets/{github-repo-picker-Db_ehY6e.js → github-repo-picker-8IaQB8YW.js} +1 -1
  94. package/dist/client/assets/{hooks-chgqRyLj.js → hooks-DpQFLCh_.js} +1 -1
  95. package/dist/client/assets/{import-from-deco-dialog-Nrpq_g30.js → import-from-deco-dialog-CRv9nGz3.js} +1 -1
  96. package/dist/client/assets/{index-D7a1JQHt.js → index-B6YHm6is.js} +2 -2
  97. package/dist/client/assets/index-BCPspZww.js +1 -0
  98. package/dist/client/assets/{index-DAmj773w.js → index-BOJe9uwl.js} +1 -1
  99. package/dist/client/assets/{index-K-17SMjl.js → index-BRdqVONz.js} +1 -1
  100. package/dist/client/assets/{index-RkQpccOp.js → index-BtAPhKbE.js} +1 -1
  101. package/dist/client/assets/{index-DFNABgCe.js → index-CRPVmS_G.js} +1 -1
  102. package/dist/client/assets/index-CS7neKAN.js +26 -0
  103. package/dist/client/assets/{index-BkSIY6JJ.js → index-CZQAHCWx.js} +4 -4
  104. package/dist/client/assets/index-CthwRpPw.js +1 -0
  105. package/dist/client/assets/{index-QdluHxPe.js → index-CuxqDMpm.js} +1 -1
  106. package/dist/client/assets/index-DRv0VWsh.js +1 -0
  107. package/dist/client/assets/{index-DC36sAC_.js → index-EMcMxAnt.js} +2 -2
  108. package/dist/client/assets/{index-1ECwD4fs.js → index-hv1cpMXB.js} +10 -10
  109. package/dist/client/assets/{index-redirect-DO0D1qdv.js → index-redirect-Q0F80k5-.js} +1 -1
  110. package/dist/client/assets/{index-4GXqE9fp.js → index-w238AwGD.js} +1 -1
  111. package/dist/client/assets/{input-jkT1z5r1.js → input-Bnf6c030.js} +1 -1
  112. package/dist/client/assets/{integration-icon-CZDEviNI.js → integration-icon-BZb9eAa5.js} +1 -1
  113. package/dist/client/assets/{label-CETsHBZ0.js → label-Di7vPCvs.js} +1 -1
  114. package/dist/client/assets/{login-eY2xl_Qt.js → login-2SyCeWam.js} +1 -1
  115. package/dist/client/assets/{mcp-oauth-BIBzZgcE.js → mcp-oauth-CkPjLCsH.js} +1 -1
  116. package/dist/client/assets/{members-BAHTTEXJ.js → members-CjaCp3dg.js} +2 -2
  117. package/dist/client/assets/{monaco-editor-tVsx1Jkl.js → monaco-editor-DwYoS9zw.js} +1 -1
  118. package/dist/client/assets/{monitoring-stats-row-CivwdnUP.js → monitoring-stats-row-DkqIQOcq.js} +1 -1
  119. package/dist/client/assets/{oauth-callback-BnrL3BsC.js → oauth-callback-CZp0JiJW.js} +1 -1
  120. package/dist/client/assets/{oauth-callback-ai-provider-D3_UsvKg.js → oauth-callback-ai-provider-Dg09kVke.js} +1 -1
  121. package/dist/client/assets/{onboarding-Cde-ZfY9.js → onboarding-BbfRp_j7.js} +1 -1
  122. package/dist/client/assets/{org-install-Cri2HTyv.js → org-install-C35OKz52.js} +1 -1
  123. package/dist/client/assets/{org-layout-DH1oGgfN.js → org-layout-DZByPEyS.js} +1 -1
  124. package/dist/client/assets/{organization-choice-BZIXFBHd.js → organization-choice-D-8Jpbxq.js} +1 -1
  125. package/dist/client/assets/{page-seo-form-DCgyqE3q.js → page-seo-form-DpKXv5ZW.js} +1 -1
  126. package/dist/client/assets/page-seo-sheet-BNm6Mm2L.js +1 -0
  127. package/dist/client/assets/{popover-1pFpRX6s.js → popover-BLg2uxUj.js} +1 -1
  128. package/dist/client/assets/post-editor-DtfgS5ZG.js +1 -0
  129. package/dist/client/assets/{preview-dialog-DRmrGWbh.js → preview-dialog-DqH-_Rmc.js} +1 -1
  130. package/dist/client/assets/{primitives-C06Pn9p4.js → primitives-DXpcMQqJ.js} +1 -1
  131. package/dist/client/assets/profile-BoEvNBMC.js +1 -0
  132. package/dist/client/assets/project-app-view-DMQWiDoZ.js +1 -0
  133. package/dist/client/assets/record-editor-GeUn2Cfg.js +1 -0
  134. package/dist/client/assets/registry-BnG2g9Fw.js +2 -0
  135. package/dist/client/assets/{registry-layout-Dww7dssY.js → registry-layout-DkLgn4PF.js} +2 -2
  136. package/dist/client/assets/{require-capability-BC8YsasG.js → require-capability-ghUcEykT.js} +1 -1
  137. package/dist/client/assets/{required-auth-layout-DjRtF3m8.js → required-auth-layout-SCPc1ODv.js} +1 -1
  138. package/dist/client/assets/{reset-password-DNWeSy4_.js → reset-password-ohLffP_O.js} +1 -1
  139. package/dist/client/assets/{roles-Cyz3Z1vr.js → roles-BjyevsY6.js} +1 -1
  140. package/dist/client/assets/{save-status-BsQDaUlP.js → save-status-COIKtaoc.js} +1 -1
  141. package/dist/client/assets/{scroll-area-D51A_KQ5.js → scroll-area-DFbOrGft.js} +1 -1
  142. package/dist/client/assets/{search-input-CEqRaXj6.js → search-input-Db1Wlp2M.js} +1 -1
  143. package/dist/client/assets/secrets-BORDpp9r.js +1 -0
  144. package/dist/client/assets/{sections-editor-331tz7B6.js → sections-editor-CsdioN2W.js} +2 -2
  145. package/dist/client/assets/select-Biv4m02a.js +1 -0
  146. package/dist/client/assets/{select-model-DJ7vH3M2.js → select-model-B6vWutyx.js} +1 -1
  147. package/dist/client/assets/seo-editor-CSTNL9M8.js +1 -0
  148. package/dist/client/assets/{settings-layout-CSyEHpma.js → settings-layout-5lmse1ub.js} +1 -1
  149. package/dist/client/assets/{settings-section-D6f1v8Lb.js → settings-section-CD_Cl2xg.js} +1 -1
  150. package/dist/client/assets/{sheet-CUfjkNRy.js → sheet-CLgUQ0k9.js} +1 -1
  151. package/dist/client/assets/{shell-controls-C6FYdYnB.js → shell-controls-DuKZWqgd.js} +1 -1
  152. package/dist/client/assets/{shell-layout-CR4YIb2n.js → shell-layout-fqgrNv9Y.js} +1 -1
  153. package/dist/client/assets/{shell-route-loading-fK7OWXny.js → shell-route-loading-B3Il8pQg.js} +1 -1
  154. package/dist/client/assets/{sidebar-C45GjVmp.js → sidebar-B6ogJK6o.js} +1 -1
  155. package/dist/client/assets/{skeleton-h95MLET_.js → skeleton-7DG8UULc.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-CbeYFn14.js → sortable.esm-BBNRI0-0.js} +1 -1
  157. package/dist/client/assets/sso-50J9BcfO.js +1 -0
  158. package/dist/client/assets/{store-O5BcQA2t.js → store-D0nqcAbk.js} +1 -1
  159. package/dist/client/assets/store-registry-DZK1gxtR.js +2 -0
  160. package/dist/client/assets/{studio-tools-BgUSKeCY.js → studio-tools-DCyngkzJ.js} +1 -1
  161. package/dist/client/assets/{switch-Cf_WUos9.js → switch-DQj88pZv.js} +1 -1
  162. package/dist/client/assets/{table-tHeeUiY0.js → table-Du45gWno.js} +1 -1
  163. package/dist/client/assets/{tabs-CNnqe_sK.js → tabs--E0r9_Sj.js} +1 -1
  164. package/dist/client/assets/{task-status-DzLkYYrk.js → task-status-B_9F2gh5.js} +1 -1
  165. package/dist/client/assets/{textarea-BzYVaGJ0.js → textarea-BFNmWFvP.js} +1 -1
  166. package/dist/client/assets/{toggle-group-BE1kDwdz.js → toggle-group-KbM3MWcV.js} +1 -1
  167. package/dist/client/assets/{toolbar-D5FkjLVB.js → toolbar-BgwgtfBD.js} +1 -1
  168. package/dist/client/assets/{tooltip-CAEDbADy.js → tooltip-Dcp4xtTX.js} +1 -1
  169. package/dist/client/assets/{types-Dw2dcWcn.js → types-BhFW6kUE.js} +1 -1
  170. package/dist/client/assets/{use-ai-providers-BcLob6tS.js → use-ai-providers-BMg8Dsli.js} +1 -1
  171. package/dist/client/assets/{use-automations-CfP4AmpB.js → use-automations-D4GU11Hn.js} +1 -1
  172. package/dist/client/assets/{use-capability-CbeJheXW.js → use-capability-CAL5M8kW.js} +1 -1
  173. package/dist/client/assets/{use-clock-tick-DHvuEFIJ.js → use-clock-tick-CG1lc4nO.js} +1 -1
  174. package/dist/client/assets/{use-collections-yHRKnSEt.js → use-collections-BYr7pEmZ.js} +1 -1
  175. package/dist/client/assets/use-connection-D9HsjWxg.js +1 -0
  176. package/dist/client/assets/{use-copy-DOTEBoID.js → use-copy-B6e0ArXF.js} +1 -1
  177. package/dist/client/assets/{use-create-virtual-mcp-C88JBuQM.js → use-create-virtual-mcp-UIYeNsla.js} +1 -1
  178. package/dist/client/assets/{use-debounced-autosave-BnfFXRc0.js → use-debounced-autosave-xepBeP7W.js} +1 -1
  179. package/dist/client/assets/{use-delete-connection-D1yU7B0G.js → use-delete-connection-BEeKZ9NT.js} +1 -1
  180. package/dist/client/assets/{use-file-configs-C8z3zSDD.js → use-file-configs-BmyLNtzY.js} +1 -1
  181. package/dist/client/assets/{use-infinite-scroll-V4l3DQJD.js → use-infinite-scroll-CJlKxIxa.js} +1 -1
  182. package/dist/client/assets/{use-join-requests-Duz0LeuZ.js → use-join-requests-Dh4DPnmF.js} +1 -1
  183. package/dist/client/assets/{use-mcp-client-DYpZuPPA.js → use-mcp-client-7EfqWxgd.js} +1 -1
  184. package/dist/client/assets/{use-mcp-prompts-BxOgLeZF.js → use-mcp-prompts-DIkRTD9t.js} +1 -1
  185. package/dist/client/assets/{use-mcp-tools-xhV-ENX5.js → use-mcp-tools-W08KOK_v.js} +1 -1
  186. package/dist/client/assets/{use-members-CJKZdynB.js → use-members-DyLgAHg5.js} +1 -1
  187. package/dist/client/assets/{use-mobile-CPyq18pe.js → use-mobile-CeVjRMu3.js} +1 -1
  188. package/dist/client/assets/{use-navigate-to-agent-Bhu6dr_a.js → use-navigate-to-agent-CfSjeQwH.js} +1 -1
  189. package/dist/client/assets/use-org-auth-client-CVfi2bFZ.js +1 -0
  190. package/dist/client/assets/{use-org-sso-DGBv3Hvc.js → use-org-sso-3_seOFru.js} +1 -1
  191. package/dist/client/assets/{use-organization-roles-1exN43Rd.js → use-organization-roles-BBD5Uy2k.js} +1 -1
  192. package/dist/client/assets/{use-organization-settings-DFnXSR7Z.js → use-organization-settings-Bvieu16r.js} +1 -1
  193. package/dist/client/assets/{use-registry-connections-Czx1u2H6.js → use-registry-connections-DgPJKdCX.js} +1 -1
  194. package/dist/client/assets/{use-secrets-DqgJI3yC.js → use-secrets-Bpmq5HaY.js} +1 -1
  195. package/dist/client/assets/{use-status-sounds-DRhhwMt0.js → use-status-sounds-Dsmk_M7Y.js} +1 -1
  196. package/dist/client/assets/{use-view-mode-BB9Jcv_5.js → use-view-mode-DhQbMx-b.js} +1 -1
  197. package/dist/client/assets/{use-virtual-mcp-DnY7c9gE.js → use-virtual-mcp-CTBnE7sF.js} +1 -1
  198. package/dist/client/assets/useInfiniteQuery-B8aLEC__.js +1 -0
  199. package/dist/client/assets/{useQueries-D96G2W1b.js → useQueries-DRRNcEOA.js} +1 -1
  200. package/dist/client/assets/useSuspenseInfiniteQuery-BJo3aYmp.js +1 -0
  201. package/dist/client/assets/variant-calendar-D-QL2C_C.js +1 -0
  202. package/dist/client/assets/{view-mode-toggle-ncGR_sPB.js → view-mode-toggle-9We3fjVd.js} +1 -1
  203. package/dist/client/index.html +1 -1
  204. package/dist/server/cli.js +1 -1
  205. package/package.json +4 -5
  206. package/dist/client/assets/Form-Czxo_N56.js +0 -26
  207. package/dist/client/assets/ai-providers-6xIkfdtm.js +0 -1
  208. package/dist/client/assets/app-editor-k7Nl_uKp.js +0 -1
  209. package/dist/client/assets/automations-TTHh4EuE.js +0 -1
  210. package/dist/client/assets/buckets-CM0nkgpJ.js +0 -1
  211. package/dist/client/assets/category-editor-Bx9oTK3B.js +0 -1
  212. package/dist/client/assets/collection-detail-BcWtgoUr.js +0 -1
  213. package/dist/client/assets/command-DyJgh8wP.js +0 -1
  214. package/dist/client/assets/commerce-onboarding-CJHzpHob.js +0 -1
  215. package/dist/client/assets/connection-detail-CCaFPgvC.js +0 -1
  216. package/dist/client/assets/connections-DZYmLj7X.js +0 -1
  217. package/dist/client/assets/file-explorer-BveBp463.js +0 -2
  218. package/dist/client/assets/general-FW5Wth3b.js +0 -1
  219. package/dist/client/assets/index-BdQq_4o_.js +0 -1
  220. package/dist/client/assets/index-D5RW_4sI.js +0 -1
  221. package/dist/client/assets/index-DAWoaMpc.js +0 -1
  222. package/dist/client/assets/index-DoculpR5.js +0 -1
  223. package/dist/client/assets/index-UgEhsCuR.js +0 -1
  224. package/dist/client/assets/page-seo-sheet-o3dCAhA-.js +0 -1
  225. package/dist/client/assets/post-editor-CWr-_gb_.js +0 -1
  226. package/dist/client/assets/profile-62y90jm_.js +0 -1
  227. package/dist/client/assets/project-app-view-BeZFUwcQ.js +0 -1
  228. package/dist/client/assets/record-editor-BsdzrkRD.js +0 -1
  229. package/dist/client/assets/registry-DpNbpkzg.js +0 -2
  230. package/dist/client/assets/secrets-C6bKEzDN.js +0 -1
  231. package/dist/client/assets/select-Ct-_FhWe.js +0 -1
  232. package/dist/client/assets/seo-editor-Ad8X__jc.js +0 -1
  233. package/dist/client/assets/sso-DGooE6a8.js +0 -1
  234. package/dist/client/assets/store-registry-BPQHh-y5.js +0 -2
  235. package/dist/client/assets/tools-list-BKN97Z6h.js +0 -1
  236. package/dist/client/assets/use-connection-BPcAXa47.js +0 -1
  237. package/dist/client/assets/use-org-auth-client-Tiq6Yt9b.js +0 -1
  238. package/dist/client/assets/useInfiniteQuery-DlRMWoIP.js +0 -1
  239. package/dist/client/assets/useSuspenseInfiniteQuery-BjlxN-DZ.js +0 -1
  240. package/dist/client/assets/variant-calendar-BlIkgRxn.js +0 -1
@@ -1 +0,0 @@
1
- import{r as E,c as oe,j as t,E as Ye,i as ce,w as be,b as _e,u as Ze,a as Ne,q as et,v as tt,L as nt,G as st,F as ot,B as U,s as te,m as it,l as de,t as W,K as rt}from"./index-BkSIY6JJ.js";import{a as lt,b as De,g as at,e as ct}from"./extract-connection-data-iACc8UZO.js";import{C as dt}from"./collection-display-button-Bzf7YHNy.js";import{S as mt}from"./search-input-CEqRaXj6.js";import{C as ut}from"./collection-tabs-D77_So6e.js";import{u as pt,a as ke,g as ht,C as Ce}from"./connection-card-DehsL0Sf.js";import{E as gt}from"./empty-state-CmZpGujH.js";import{I as xt}from"./integration-icon-CZDEviNI.js";import{P as ue}from"./index-RkQpccOp.js";import{u as ft,D as jt}from"./use-delete-connection-D1yU7B0G.js";import{u as ye}from"./use-capability-CbeJheXW.js";import{u as yt}from"./use-infinite-scroll-V4l3DQJD.js";import{u as Ct}from"./use-view-mode-BB9Jcv_5.js";import{g as he}from"./connection-slug-eyAPH6o3.js";import{c as Ae,d as we,b as Te,A as Ie,e as Pe,g as $e,a as Le,f as Oe}from"./alert-dialog-HmiP05XU.js";import{C as Fe}from"./checkbox-Bi39v4Qa.js";import{e as Me,d as ze,b as Ve,D as Ee,a as Be,c as Ke}from"./dialog-BLvz2lK8.js";import{D as vt,a as St,c as bt,b as _t,d as Nt,e as Dt,f as kt}from"./drawer-C4RJ4_GY.js";import{u as At}from"./use-mobile-CPyq18pe.js";import{D as Ue,a as Re,b as He,c as re}from"./dropdown-menu-CRyIPZil.js";import{F as Q,b as J,c as Y,d as Z,f as ee,a as ve}from"./form-CPJbrMq5.js";import{I as ie}from"./input-jkT1z5r1.js";import{d as wt,b as Tt,c as It,S as Pt,a as ae}from"./select-Ct-_FhWe.js";import{T as $t}from"./textarea-BzYVaGJ0.js";import{b as We,u as Lt}from"./use-connection-BPcAXa47.js";import{u as Ot}from"./use-virtual-mcp-DnY7c9gE.js";import{u as Ft}from"./studio-tools-BgUSKeCY.js";import{a5 as Mt,af as zt,C as Vt,z as Et}from"./agent-icon-C6bJxQ04.js";import{n as ge}from"./XCircle-CkhBWURn.js";import{a as Xe}from"./DotsVertical-C0YWb9xq.js";import{s as qe}from"./Eye-DWTUBTZ_.js";import{s as je}from"./Star01-BrkbxV-A.js";import{s as Ge}from"./Plus-jFajoMCA.js";import{s as Qe}from"./Trash01-DI7qV1ow.js";import{s as Je}from"./XClose-Doj89HqF.js";import{i as pe,a as Se,E as Bt,c as Kt,p as Ut,b as Rt,d as Ht}from"./connection-form-helpers-CASdXQaW.js";import{a as Wt}from"./authenticate-and-persist-oauth-xCkDryiA.js";import"./use-mcp-client-DYpZuPPA.js";import"./auth-B9Q1UUsp.js";import"./SwitchHorizontal01-CB5mOBIf.js";import"./ChevronUp-BhWz3ylT.js";import"./tooltip-CAEDbADy.js";import"./view-mode-toggle-ncGR_sPB.js";import"./badge-CpKEkIGn.js";import"./SearchMd-uzKFlzQB.js";import"./use-registry-connections-Czx1u2H6.js";import"./use-organization-settings-DFnXSR7Z.js";import"./useInfiniteQuery-DlRMWoIP.js";import"./card-BIwENur_.js";import"./sidebar-C45GjVmp.js";import"./LayoutLeft-BqtFvEWV.js";import"./sheet-CUfjkNRy.js";import"./X-B-cRV-7d.js";import"./ChevronRight-ChYOVgWd.js";import"./label-CETsHBZ0.js";import"./index-BdQq_4o_.js";import"./ChevronDown-BWfuTI7r.js";import"./use-collections-yHRKnSEt.js";import"./AlertCircle-flSoo6uw.js";import"./Tool01-rx0lKYM8.js";import"./Settings02-47eDNk4K.js";import"./ArrowUpRight-BeOMO89N.js";import"./ZapSquare-DdgE8vy-.js";import"./Users03-gvBLUtvG.js";import"./CheckCircle-B9ekAAw-.js";import"./ChevronLeft-BNcg18cx.js";import"./Stars02-DlImJz_z.js";import"./ZoomOut-BdBjpsIq.js";import"./Globe01-BgRW2EiE.js";import"./FilterLines-Djqj6uj_.js";import"./Globe04-XITcP2mp.js";import"./HardDrive-DS3VxDtU.js";import"./Key01-DX7L8s0Z.js";import"./LinkExternal01-Cf-6A1_h.js";import"./Monitor01-CZ30bS8J.js";import"./Sun-9FxiCes3.js";import"./Palette-Dy2dQgqx.js";import"./Play-DvFnuZIO.js";import"./Shield01-BgRa80OR.js";import"./Stars01-Daq_eW6a.js";import"./Upload01-Boqk1hvA.js";import"./User01-B3UbdHmL.js";import"./Users01-BUyczaeV.js";import"./Zap-BCqTHl-x.js";import"./mcp-oauth-BIBzZgcE.js";function Xt(f){const e=`deco-filters-${f}`,[n,p]=E.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[n,o=>{p(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(i){console.error("Failed to save filters:",i)}}]}function qt(f){const e=oe.c(7),[n,p]=E.useState(f),[l,o]=E.useState(f?"desc":null);let i;e[0]!==l||e[1]!==n?(i=j=>{n!==j?(p(j),o("asc")):l==="asc"?o("desc"):l==="desc"&&(p(void 0),o(null))},e[0]=l,e[1]=n,e[2]=i):i=e[2];const g=i;let h;return e[3]!==g||e[4]!==l||e[5]!==n?(h={sortKey:n,sortDirection:l,handleSort:g},e[3]=g,e[4]=l,e[5]=n,e[6]=h):h=e[6],h}function Gt(f){const e=oe.c(20),{namespace:n,resource:p,defaultSortKey:l,defaultViewMode:o}=f,i=l===void 0?"title":l,g=o===void 0?"table":o,[h,j]=E.useState(""),y=E.useDeferredValue(h),N=`${n}-${p}`,[b,a]=Xt(N),x=`mesh-${p}-filter-visible-${n}`;let m;e[0]!==x?(m=()=>globalThis.localStorage?.getItem(x)==="true",e[0]=x,e[1]=m):m=e[1];const[v,_]=E.useState(m);let D;e[2]!==x?(D=T=>{_(T),globalThis.localStorage?.setItem(x,String(T))},e[2]=x,e[3]=D):D=e[3];const L=D;let O;e[4]!==v||e[5]!==L?(O=()=>{L(!v)},e[4]=v,e[5]=L,e[6]=O):O=e[6];const s=O,[A,F]=Ct(`mesh-${p}-${n}`,g),{sortKey:M,sortDirection:w,handleSort:P}=qt(i),z=M;let C;return e[7]!==v||e[8]!==b||e[9]!==P||e[10]!==h||e[11]!==y||e[12]!==L||e[13]!==a||e[14]!==F||e[15]!==w||e[16]!==z||e[17]!==s||e[18]!==A?(C={search:h,searchTerm:y,setSearch:j,filters:b,setFilters:a,filterBarVisible:v,setFilterBarVisible:L,toggleFilterBar:s,viewMode:A,setViewMode:F,sortKey:z,sortDirection:w,handleSort:P},e[7]=v,e[8]=b,e[9]=P,e[10]=h,e[11]=y,e[12]=L,e[13]=a,e[14]=F,e[15]=w,e[16]=z,e[17]=s,e[18]=A,e[19]=C):C=e[19],C}function Qt(f){const e=oe.c(51),{group:n,onOpen:p,selectionMode:l,selectedIds:o,onToggleSelect:i}=f;let g;if(e[0]!==n.connections||e[1]!==o){let C;e[3]!==o?(C=T=>o.has(T.id),e[3]=o,e[4]=C):C=e[4],g=n.connections.every(C),e[0]=n.connections,e[1]=o,e[2]=g}else g=e[2];const h=g;let j;if(e[5]!==n.connections||e[6]!==o){let C;e[8]!==o?(C=T=>o.has(T.id),e[8]=o,e[9]=C):C=e[9],j=n.connections.some(C),e[5]=n.connections,e[6]=o,e[7]=j}else j=e[7];const y=j,N=`${n.connections.length} instances`;let b;e[10]!==n.icon||e[11]!==n.title||e[12]!==N?(b={title:n.title,icon:n.icon,description:N},e[10]=n.icon,e[11]=n.title,e[12]=N,e[13]=b):b=e[13];let a;e[14]!==h||e[15]!==n.connections||e[16]!==p||e[17]!==i||e[18]!==o||e[19]!==l?(a=()=>l?(()=>{for(const C of n.connections)h?o.has(C.id)&&i(C.id):o.has(C.id)||i(C.id)})():p(),e[14]=h,e[15]=n.connections,e[16]=p,e[17]=i,e[18]=o,e[19]=l,e[20]=a):a=e[20];const x=l&&h&&"ring-2 ring-primary",m=l&&y&&!h&&"ring-1 ring-primary/50";let v;e[21]!==x||e[22]!==m?(v=de(x,m),e[21]=x,e[22]=m,e[23]=v):v=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==h||e[26]!==n.connections||e[27]!==i||e[28]!==o||e[29]!==l||e[30]!==y?(D=l?t.jsx(Fe,{checked:h?!0:y?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)h?o.has(C.id)&&i(C.id):o.has(C.id)||i(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]=h,e[26]=n.connections,e[27]=i,e[28]=o,e[29]=l,e[30]=y,e[31]=D):D=e[31];const L=l?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let O;e[32]!==L?(O=de("overflow-hidden transition-all duration-150 ease-out",L),e[32]=L,e[33]=O):O=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Re,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Yt,children:t.jsx(Xe,{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 F;e[37]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(qe,{size:16}),e[37]=F):F=e[37];let M;e[38]!==A?(M=t.jsxs(Ue,{children:[s,t.jsx(He,{align:"end",onClick:Jt,children:t.jsxs(re,{onClick:A,children:[F,"Open"]})})]}),e[38]=A,e[39]=M):M=e[39];let w;e[40]!==O||e[41]!==M?(w=t.jsx("div",{className:O,children:M}),e[40]=O,e[41]=M,e[42]=w):w=e[42];let P;e[43]!==D||e[44]!==w?(P=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=P):P=e[45];let z;return e[46]!==P||e[47]!==b||e[48]!==a||e[49]!==v?(z=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:b,onClick:a,className:v,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:P})}),e[46]=P,e[47]=b,e[48]=a,e[49]=v,e[50]=z):z=e[50],z}function Jt(f){return f.stopPropagation()}function Yt(f){return f.stopPropagation()}function Zt(f){const e=oe.c(23),{count:n,total:p,canManage:l,canManageAgents:o,onSelectAll:i,onDeselectAll:g,onDelete:h,onAddToAgent:j,onToggleStatus:y,onCancel:N}=f;if(n===0)return null;let b;e[0]!==n?(b=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=b):b=e[1];let a;e[2]!==n||e[3]!==g||e[4]!==i||e[5]!==p?(a=n<p?t.jsxs(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:i,children:["Select all (",p,")"]}):t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:"Clear selection"}),e[2]=n,e[3]=g,e[4]=i,e[5]=p,e[6]=a):a=e[6];let x;e[7]!==o||e[8]!==j?(x=o&&t.jsxs(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:[t.jsx(Ge,{size:13}),"Add to Agent"]}),e[7]=o,e[8]=j,e[9]=x):x=e[9];let m;e[10]!==l||e[11]!==h||e[12]!==y?(m=l&&t.jsxs(t.Fragment,{children:[t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("active"),children:"Enable"}),t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("inactive"),children:"Disable"}),t.jsxs(U,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:[t.jsx(Qe,{size:13}),"Delete"]})]}),e[10]=l,e[11]=h,e[12]=y,e[13]=m):m=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Je,{size:13}),e[14]=v):v=e[14];let _;e[15]!==N?(_=t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:N,children:v}),e[15]=N,e[16]=_):_=e[16];let D;return e[17]!==b||e[18]!==a||e[19]!==x||e[20]!==m||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:[b,a,x,m,_]})}),e[17]=b,e[18]=a,e[19]=x,e[20]=m,e[21]=_,e[22]=D):D=e[22],D}function en(f){const e=oe.c(25),{open:n,onOpenChange:p,agents:l,onConfirm:o}=f,[i,g]=E.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(Ve,{children:[t.jsx(Ee,{children:"Add to Agent"}),t.jsx(Be,{children:"Select an agent to add the selected connections to."})]}),e[0]=h):h=e[0];let j;e[1]!==l||e[2]!==i?(j=l.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):l.map(D=>t.jsxs("button",{type:"button",onClick:()=>g(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",i===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(xt,{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]=l,e[2]=i,e[3]=j):j=e[3];let y;e[4]!==j?(y=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=y):y=e[5];let N;e[6]!==p?(N=t.jsx(U,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=N):N=e[7];const b=!i;let a;e[8]!==o||e[9]!==p||e[10]!==i?(a=()=>{i&&(o(i),p(!1),g(null))},e[8]=o,e[9]=p,e[10]=i,e[11]=a):a=e[11];let x;e[12]!==b||e[13]!==a?(x=t.jsx(U,{disabled:b,onClick:a,children:"Add"}),e[12]=b,e[13]=a,e[14]=x):x=e[14];let m;e[15]!==N||e[16]!==x?(m=t.jsxs(Ke,{children:[N,x]}),e[15]=N,e[16]=x,e[17]=m):m=e[17];let v;e[18]!==y||e[19]!==m?(v=t.jsxs(ze,{className:"sm:max-w-[400px]",children:[h,y,m]}),e[18]=y,e[19]=m,e[20]=v):v=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==v?(_=t.jsx(Me,{open:n,onOpenChange:p,children:v}),e[21]=p,e[22]=n,e[23]=v,e[24]=_):_=e[24],_}function tn(f){const e=oe.c(20),{open:n,onOpenChange:p,count:l,onConfirm:o}=f,i=l!==1?"s":"";let g;e[0]!==l||e[1]!==i?(g=t.jsxs(Ae,{children:["Delete ",l," connection",i,"?"]}),e[0]=l,e[1]=i,e[2]=g):g=e[2];const h=l!==1?"s":"";let j;e[3]!==h?(j=t.jsxs(we,{children:["This will permanently delete the selected connection",h,". This action cannot be undone."]}),e[3]=h,e[4]=j):j=e[4];let y;e[5]!==g||e[6]!==j?(y=t.jsxs(Te,{children:[g,j]}),e[5]=g,e[6]=j,e[7]=y):y=e[7];let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Ie,{children:"Cancel"}),e[8]=N):N=e[8];const b=l!==1?"s":"";let a;e[9]!==l||e[10]!==o||e[11]!==b?(a=t.jsxs(Pe,{children:[N,t.jsxs($e,{onClick:o,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",l," connection",b]})]}),e[9]=l,e[10]=o,e[11]=b,e[12]=a):a=e[12];let x;e[13]!==y||e[14]!==a?(x=t.jsxs(Le,{children:[y,a]}),e[13]=y,e[14]=a,e[15]=x):x=e[15];let m;return e[16]!==p||e[17]!==n||e[18]!==x?(m=t.jsx(Oe,{open:n,onOpenChange:p,children:x}),e[16]=p,e[17]=n,e[18]=x,e[19]=m):m=e[19],m}function nn(f){return f._registryId?.includes("community-registry")===!0}function sn(f){const e=oe.c(58),{item:n,canManage:p,allConnections:l,connectedAppNames:o,connectingItemId:i,onNavigateConnected:g,onConnect:h}=f,[j,y]=E.useState(!1),[N,b]=E.useState(null);let a,x;e[0]!==o||e[1]!==n?(a=De(n)??"",x=o.has(a),e[0]=o,e[1]=n,e[2]=a,e[3]=x):(a=e[2],x=e[3]);const m=x,v=n._meta?.["mcp.mesh"],_=v?.friendlyName||v?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let L;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(L=n.server?.icons?.[0]?.src||at(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=L):L=e[6];const O=L;let s;if(e[7]!==l||e[8]!==a){let k;e[10]!==a?(k=se=>se.connection_type!=="VIRTUAL"&&se.app_name===a,e[10]=a,e[11]=k):k=e[11],s=l.filter(k),e[7]=l,e[8]=a,e[9]=s}else s=e[9];const A=s;let F;e[12]!==n?(F=nn(n),e[12]=n,e[13]=F):F=e[13];const M=F;let w,P;e[14]!==A||e[15]!==p||e[16]!==M||e[17]!==m||e[18]!==n||e[19]!==h||e[20]!==g?(w=()=>{if(m){const k=A[0];k&&g(k);return}p&&P()},P=()=>{M?(b("connect"),y(!0)):h(n)},e[14]=A,e[15]=p,e[16]=M,e[17]=m,e[18]=n,e[19]=h,e[20]=g,e[21]=w,e[22]=P):(w=e[21],P=e[22]);let z;e[23]!==n||e[24]!==h||e[25]!==N?(z=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),y(!1),N==="connect"&&h(n),b(null)},e[23]=n,e[24]=h,e[25]=N,e[26]=z):z=e[26];const C=z;let T;e[27]!==D||e[28]!==O||e[29]!==_?(T={title:_,description:D,icon:O},e[27]=D,e[28]=O,e[29]=_,e[30]=T):T=e[30];let G;e[31]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(ge,{}),e[31]=G):G=e[31];let H;e[32]!==M||e[33]!==n._sourceIcon?(H=M&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=M,e[33]=n._sourceIcon,e[34]=H):H=e[34];let X;e[35]!==p||e[36]!==i||e[37]!==P||e[38]!==m||e[39]!==n.id?(X=m?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(U,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i!==null,onClick:k=>{k.stopPropagation(),P()},children:i===n.id?t.jsx(ce,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=i,e[37]=P,e[38]=m,e[39]=n.id,e[40]=X):X=e[40];let c;e[41]!==H||e[42]!==X?(c=t.jsxs("div",{className:"flex items-center gap-2",children:[H,X]}),e[41]=H,e[42]=X,e[43]=c):c=e[43];let S;e[44]!==w||e[45]!==c||e[46]!==T?(S=t.jsx(Ce,{connection:T,fallbackIcon:G,onClick:w,headerActionsAlwaysVisible:!0,headerActions:c}),e[44]=w,e[45]=c,e[46]=T,e[47]=S):S=e[47];let V;e[48]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(Te,{children:[t.jsx(Ae,{children:"Community MCP Server"}),t.jsx(we,{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]=V):V=e[48];let R;e[49]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(Ie,{children:"Cancel"}),e[49]=R):R=e[49];let B;e[50]!==C?(B=t.jsxs(Le,{children:[V,t.jsxs(Pe,{children:[R,t.jsx($e,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=B):B=e[51];let u;e[52]!==j||e[53]!==B?(u=t.jsx(Oe,{open:j,onOpenChange:y,children:B}),e[52]=j,e[53]=B,e[54]=u):u=e[54];let $;return e[55]!==S||e[56]!==u?($=t.jsxs(t.Fragment,{children:[S,u]}),e[55]=S,e[56]=u,e[57]=$):$=e[57],$}function on({listState:f,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:l,enabledRegistries:o}){const{org:i}=be(),g=it(),h=_e(),{data:j}=Ne.useSession(),y=We(),N=Lt(f),b=ft(),{granted:a}=ye("connections:manage"),{granted:x}=ye("agents:manage"),[m,v]=E.useState(new Set),_=m.size>0,[D,L]=E.useState(!1),[O,s]=E.useState(!1),[A,F]=E.useState(null),M=Ot(),w=N.filter(r=>!(n!=="ALL"&&r.connection_type!==n||p!=="ALL"&&r.status!==p)),P=ht(w),z=r=>{v(d=>{const K=new Set(d);return K.has(r)?K.delete(r):K.add(r),K})},C=()=>{v(new Set)},T=ke(o,f.searchTerm),G=T.items,H=yt(T.loadMore,T.hasMore,T.isLoadingMore),X=new Set(N.filter(r=>r.app_name).map(r=>r.app_name)),c=l==="ALL"||o.some(r=>r.id===l)?l:"ALL",S=f.search.length>0,V=e==="all"||S?G.filter(r=>{if(c!=="ALL"&&r._registryId!==c)return!1;if(S){const d=De(r);if(d&&X.has(d))return!1}return!0}):[],R=e==="connected"||S?P:[],B=async r=>{if(!(!i||!j?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:r.id,source:"connections_page"}),F(r.id);try{const d=ct(r,i.id,j.user.id,{remoteIndex:0}),K=d.connection_type==="STDIO",I=!!d.connection_url,q=K&&d.connection_headers&&typeof d.connection_headers=="object"&&"command"in d.connection_headers;if(!I&&!q){W.error("This MCP Server cannot be connected: no connection method available"),F(null);return}const{id:ne}=await y.create.mutateAsync(d),le=await Wt({connectionId:ne,orgId:i.id,orgSlug:i.slug,persistFallback:fe=>y.update.mutateAsync({id:ne,data:{connection_token:fe}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ne,flow:"connections_page_connect",error:le.error??"no_token"}),W.error(`Authentication failed: ${le.error??"no token received"}`);return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ne,flow:"connections_page_connect"});const fe=new URL(`/api/${i.slug}/mcp/${ne}`,window.location.origin);await g.invalidateQueries({queryKey:rt.isMCPAuthenticated(fe.href,null)}),$(),W.success("Authentication successful")}W.success("Connected successfully")}catch(d){W.error(`Failed to connect: ${d instanceof Error?d.message:String(d)}`)}finally{F(null)}}},u=Ft(),$=()=>{g.invalidateQueries({predicate:r=>{const d=r.queryKey;return d[1]===i.id&&d[3]==="collection"&&d[4]==="CONNECTIONS"}})},k=async()=>{L(!1);const r=[...m];te("connections_bulk_delete",{count:r.length});let d=0;for(const K of r)try{await u.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0}),d++}catch{}$(),W.success(`Deleted ${d} connection${d!==1?"s":""}`),C()},se=async(r,d)=>{try{await y.update.mutateAsync({id:r,data:{status:d}}),$(),W.success(d==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},xe=async r=>{const d=[...m];te("connections_bulk_status_toggled",{count:d.length,to_status:r});let K=0;for(const I of d)try{await y.update.mutateAsync({id:I,data:{status:r}}),K++}catch{}$(),W.success(`${r==="active"?"Enabled":"Disabled"} ${K} connection${K!==1?"s":""}`),C()},me=async r=>{const d=M.find(q=>q.id===r);if(!d)return;te("connections_bulk_add_to_agent",{agent_id:r,count:m.size});const K=new Set(d.connections.map(q=>q.connection_id)),I=[...m].filter(q=>!K.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(I.length===0){W.info("All selected connections are already in that agent");return}try{await u.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:r,data:{connections:[...d.connections,...I]}}),g.invalidateQueries({predicate:q=>{const ne=q.queryKey;return ne[1]===i.id&&ne[3]==="collection"&&ne[4]==="VIRTUAL_MCP"}}),W.success(`Added ${I.length} connection${I.length!==1?"s":""} to "${d.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(jt,{...b}),t.jsx(tn,{open:D,onOpenChange:L,count:m.size,onConfirm:k}),t.jsx(en,{open:O,onOpenChange:s,agents:M,onConfirm:me}),T.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(S?V.length===0&&w.length===0:e==="all"?V.length===0:w.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:f.search?`No Connections match "${f.search}"`:a?"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:[R.map(r=>{if(r.type==="group")return t.jsx(Qt,{group:r,onOpen:()=>{h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:r.key}})},selectionMode:_,selectedIds:m,onToggleSelect:z},r.key);const d=r.connection,K=m.has(d.id);return t.jsx(Ce,{connection:d,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?z(d.id):h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}}),className:de(K&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:K,onCheckedChange:()=>z(d.id),onClick:I=>I.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(Ue,{children:[t.jsx(Re,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:I=>I.stopPropagation(),children:t.jsx(Xe,{size:20})})}),t.jsxs(He,{align:"end",onClick:I=>I.stopPropagation(),children:[t.jsxs(re,{onClick:I=>{I.stopPropagation(),h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}})},children:[t.jsx(qe,{size:16}),"Open"]}),(a||x)&&t.jsxs(re,{onClick:I=>{I.stopPropagation(),z(d.id)},children:[t.jsx(zt,{size:16}),"Select"]}),a&&(d.status==="active"?t.jsxs(re,{onClick:I=>{I.stopPropagation(),se(d.id,"inactive")},children:[t.jsx(Vt,{size:16}),"Disable"]}):t.jsxs(re,{onClick:I=>{I.stopPropagation(),se(d.id,"active")},children:[t.jsx(Et,{size:16}),"Enable"]})),a&&t.jsxs(re,{variant:"destructive",onClick:I=>{I.stopPropagation(),b.requestDelete(d)},children:[t.jsx(Qe,{size:16}),"Delete"]})]})]})})]})},d.id)}),V.map(r=>t.jsx(sn,{item:r,canManage:a,allConnections:N,connectedAppNames:X,connectingItemId:A,onNavigateConnected:d=>h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}}),onConnect:B},`catalog-${r._registryId}:${r.id}`)),(e==="all"||S)&&o.length>0&&t.jsx("div",{ref:H,className:"col-span-full h-4"}),(e==="all"||S)&&T.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ce,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(Zt,{count:m.size,total:w.length,canManage:a,canManageAgents:x,onSelectAll:()=>{v(new Set(w.map(r=>r.id)))},onDeselectAll:()=>v(new Set),onDelete:()=>L(!0),onAddToAgent:()=>s(!0),onToggleStatus:xe,onCancel:C})]})}function rn(){const{org:f}=be(),e=_e(),n=Ze({strict:!1}),{data:p}=Ne.useSession(),{stdioEnabled:l}=et(),o=At(),{granted:i}=ye("connections:manage"),g=Gt({namespace:f.slug,resource:"connections"}),h=We(),[j,y]=tt(nt.connectionsTab(f.slug),c=>n.tab==="all"||n.tab==="connected"?n.tab:c??"all"),[N,b]=E.useState("ALL"),[a,x]=E.useState("ALL"),[m,v]=E.useState("ALL"),_=pt(),L=ke(_,g.searchTerm).items,O=g.search!==g.searchTerm,s=st({resolver:ot(Kt),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"),F=s.watch("connection_url"),M=s.watch("npx_package"),w=pe({uiType:A,connectionUrl:F??"",npxPackage:M??""})??Se({uiType:A,connectionUrl:F??"",registryItems:L}),P=i&&n.action==="create",z=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:f.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:f.slug},search:{}})},T=async c=>{let S,V=null,R=null,B=null;c.ui_type==="NPX"?(S="STDIO",V="",B=Rt(c.npx_package||"",c.env_vars||[])):c.ui_type==="STDIO"?(S="STDIO",V="",B=Ht(c.stdio_command||"",c.stdio_args||"",c.stdio_cwd,c.env_vars||[])):(S=c.ui_type,V=c.connection_url||"",R=c.connection_token||null);const u=lt("conn");te("connection_custom_created",{connection_type:S,ui_type:c.ui_type}),await h.create.mutateAsync({id:u,title:c.title,description:c.description||null,connection_type:S,connection_url:V,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:f.id,icon:c.icon??null,app_name:null,app_id:null,connection_headers:B,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:f.slug,appSlug:he({app_name:null,connection_url:V,title:c.title,id:u})}})},G=c=>{c||(P&&C(),s.reset())},H=c=>{const S=c.trim();if(!S)return;const V=!!s.formState.dirtyFields.title,R=!!s.formState.dirtyFields.description,B=!!s.formState.dirtyFields.env_vars,u=k=>{if(k&&(!V&&!s.getValues("title").trim()&&k.title&&s.setValue("title",k.title,{shouldDirty:!1}),!R&&!(s.getValues("description")??"").trim()&&k.description&&s.setValue("description",k.description,{shouldDirty:!1}),!B&&k.envVarKeys?.length)){const se=s.getValues("env_vars")??[],xe=new Set(se.map(r=>r.key)),me=k.envVarKeys.filter(r=>!xe.has(r));me.length>0&&s.setValue("env_vars",[...se,...me.map(r=>({key:r,value:""}))],{shouldDirty:!0})}},$=Ut(S);if($&&l){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",$.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),u(pe({uiType:"NPX",npxPackage:$.packageName}));return}if(S.startsWith("http://")||S.startsWith("https://")){const k=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",k,{shouldDirty:!0}),s.setValue("connection_url",S,{shouldDirty:!0}),u(pe({uiType:k,connectionUrl:S})??Se({uiType:k,connectionUrl:S,registryItems:L}));return}A==="NPX"&&u(pe({uiType:"NPX",npxPackage:S}))},X=i?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(U,{variant:"outline",onClick:z,children:[t.jsx(Ge,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(ue,{children:[(()=>{const c="Create Connection",S="Create a custom connection in your organization. Fill in the details below.",V=s.formState.isSubmitting?"Saving...":"Create Connection",R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Type *"}),t.jsxs(wt,{value:u.value,onValueChange:u.onChange,children:[t.jsx(Z,{children:t.jsx(Tt,{children:t.jsx(It,{})})}),t.jsxs(Pt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{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(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),A==="NPX"&&t.jsx(Q,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...u,value:u.value??"",onPaste:$=>{const k=$.clipboardData.getData("text");k&&($.preventDefault(),s.setValue("npx_package",k.trim(),{shouldDirty:!0}),H(k))},onBlur:$=>{H($.target.value),u.onBlur()}})}),t.jsx(ee,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Command *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"node, bun, python...",...u,value:u.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...u,value:u.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...u,value:u.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(Q,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Bt,{value:u.value??[],onChange:u.onChange})}),t.jsx(ee,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:s.control,name:"connection_url",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"URL *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...u,value:u.value??"",onPaste:$=>{const k=$.clipboardData.getData("text");k&&($.preventDefault(),s.setValue("connection_url",k.trim(),{shouldDirty:!0}),H(k))},onBlur:$=>{H($.target.value),u.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:w?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...u,value:u.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(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"title",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Name *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"My Connection",...u})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"description",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Description"}),t.jsx(Z,{children:t.jsx($t,{placeholder:"A brief description of this connection",rows:3,...u,value:u.value??""})}),t.jsx(ee,{})]})})]}),B=P;return o?t.jsx(vt,{open:B,onOpenChange:G,children:t.jsxs(St,{className:"max-h-[90vh]",children:[t.jsx(bt,{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(_t,{children:c}),t.jsx(Nt,{className:"mt-1",children:S})]}),t.jsx(Dt,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Je,{size:16})})})]})}),t.jsx(ve,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(T),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(kt,{children:t.jsx(U,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Me,{open:B,onOpenChange:G,children:t.jsxs(ze,{className:"sm:max-w-[525px]",children:[t.jsxs(Ve,{children:[t.jsx(Ee,{children:c}),t.jsx(Be,{children:S})]}),t.jsx(ve,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(T),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(Ke,{children:[t.jsx(U,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),t.jsx(U,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(ue.Content,{children:t.jsx(ue.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ue.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(mt,{value:g.search,onChange:g.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:c=>{c.key==="Escape"&&(g.setSearch(""),c.target.blur())}}),t.jsx(dt,{sortKey:g.sortKey,sortDirection:g.sortDirection,onSort:g.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:N,onChange:c=>b(c||"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:a,onChange:c=>x(c||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:m,onChange:c=>v(c||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(c=>({id:c.id,label:c.id.includes("community-registry")?"Community MCP Registry":c.title}))]}]:[]]})]}),X]}),t.jsx(ut,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:j,onTabChange:c=>{const S=c;S!==j&&te("connections_page_tab_changed",{to_tab:S}),y(S)}}),t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:O?.5:1,transition:O?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:O?"none":"auto"},children:t.jsx(on,{listState:g,activeTab:j,typeFilter:N,statusFilter:a,registryFilter:m,enabledRegistries:_})})})]})})})]})})}function zs(){const f=oe.c(1);let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(rn,{})})}),f[0]=e):e=f[0],e}export{zs as default};
@@ -1,2 +0,0 @@
1
- import{c as Ke,r as l,j as i,i as re,B as fe,l as Ve,m as ut,t as $,K as Te}from"./index-BkSIY6JJ.js";import{F as mt,l as pt}from"./index-DFNABgCe.js";import{e as ht,au as xt,av as gt,aw as ae,ax as yt,U as $e}from"./agent-icon-C6bJxQ04.js";import{a as wt}from"./Tool01-rx0lKYM8.js";import{s as jt}from"./XClose-Doj89HqF.js";import{S as bt}from"./scroll-area-D51A_KQ5.js";import{T as Oe,a as Re,b as ze}from"./tooltip-CAEDbADy.js";import{f as vt,a as Ct,b as Nt,c as St,d as Dt,e as kt,A as Ft,g as Lt}from"./alert-dialog-HmiP05XU.js";import{u as Et}from"./chat-context-DN0_9Gee.js";import{b as Pt}from"./shell-layout-CR4YIb2n.js";import{al as le,am as Ae,an as Tt}from"./index-1ECwD4fs.js";import{D as $t,a as Ot,b as Rt,c as zt,d as At,e as Wt}from"./dialog-BLvz2lK8.js";import{I as We}from"./input-jkT1z5r1.js";import{b as It,C as _,a as Ie,c as Mt,d as Kt}from"./context-menu-Bt-E5y3C.js";import{t as Vt}from"./ChevronDown-BWfuTI7r.js";import{i as Bt}from"./ChevronRight-ChYOVgWd.js";import{b as Gt}from"./ZoomOut-BdBjpsIq.js";import{E as qt,z as Me,A as he,B as Qt,C as Ut,D as Jt,G as M,I as ce,g as xe,J as ge,K as Ht,M as Xt,N as ye,O as de,P as we,Q as Yt,U as Zt}from"./preview-dialog-DRmrGWbh.js";import"./AlertCircle-flSoo6uw.js";import"./SwitchHorizontal01-CB5mOBIf.js";import"./Settings02-47eDNk4K.js";import"./XCircle-CkhBWURn.js";import"./ArrowUpRight-BeOMO89N.js";import"./ZapSquare-DdgE8vy-.js";import"./Users03-gvBLUtvG.js";import"./CheckCircle-B9ekAAw-.js";import"./ChevronUp-BhWz3ylT.js";import"./ChevronLeft-BNcg18cx.js";import"./DotsVertical-C0YWb9xq.js";import"./Stars02-DlImJz_z.js";import"./Eye-DWTUBTZ_.js";import"./Globe01-BgRW2EiE.js";import"./FilterLines-Djqj6uj_.js";import"./Star01-BrkbxV-A.js";import"./Globe04-XITcP2mp.js";import"./HardDrive-DS3VxDtU.js";import"./Key01-DX7L8s0Z.js";import"./LayoutLeft-BqtFvEWV.js";import"./LinkExternal01-Cf-6A1_h.js";import"./Monitor01-CZ30bS8J.js";import"./Sun-9FxiCes3.js";import"./Palette-Dy2dQgqx.js";import"./Play-DvFnuZIO.js";import"./Plus-jFajoMCA.js";import"./SearchMd-uzKFlzQB.js";import"./Shield01-BgRa80OR.js";import"./Stars01-Daq_eW6a.js";import"./Trash01-DI7qV1ow.js";import"./Upload01-Boqk1hvA.js";import"./User01-B3UbdHmL.js";import"./Users01-BUyczaeV.js";import"./X-B-cRV-7d.js";import"./Zap-BCqTHl-x.js";import"./use-clock-tick-DHvuEFIJ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DOTEBoID.js";import"./file-type-icon-Db262N7w.js";import"./use-mobile-CPyq18pe.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-Dw2dcWcn.js";import"./use-mcp-client-DYpZuPPA.js";import"./auth-B9Q1UUsp.js";import"./hooks-chgqRyLj.js";import"./decopilot-sse-pool-CKTJhrtc.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-BgUSKeCY.js";import"./sheet-CUfjkNRy.js";import"./integration-icon-CZDEviNI.js";import"./use-virtual-mcp-DnY7c9gE.js";import"./use-collections-yHRKnSEt.js";import"./use-navigate-to-agent-Bhu6dr_a.js";import"./use-connection-BPcAXa47.js";import"./use-mcp-prompts-BxOgLeZF.js";import"./form-CPJbrMq5.js";import"./label-CETsHBZ0.js";import"./index-BdQq_4o_.js";import"./use-ai-providers-BcLob6tS.js";import"./use-organization-settings-DFnXSR7Z.js";import"./avatar-oAcdiJ9v.js";import"./required-auth-layout-DjRtF3m8.js";import"./use-org-sso-DGBv3Hvc.js";import"./index-D7a1JQHt.js";import"./drawer-C4RJ4_GY.js";import"./collection-search-DbQr2iji.js";import"./select-Ct-_FhWe.js";import"./tabs-CNnqe_sK.js";import"./toggle-group-BE1kDwdz.js";import"./sortable.esm-CbeYFn14.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DehsL0Sf.js";import"./use-registry-connections-Czx1u2H6.js";import"./useInfiniteQuery-DlRMWoIP.js";import"./use-infinite-scroll-V4l3DQJD.js";import"./extract-connection-data-iACc8UZO.js";import"./card-BIwENur_.js";import"./collection-tabs-D77_So6e.js";import"./badge-CpKEkIGn.js";import"./textarea-BzYVaGJ0.js";import"./connection-form-helpers-CASdXQaW.js";import"./authenticate-and-persist-oauth-xCkDryiA.js";import"./mcp-oauth-BIBzZgcE.js";import"./useSuspenseInfiniteQuery-BjlxN-DZ.js";import"./connect-desktop-dialog-ByWaevjw.js";import"./decopilot-BXlT8NLf.js";import"./checkbox-Bi39v4Qa.js";import"./skeleton-h95MLET_.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-D6f1v8Lb.js";import"./popover-1pFpRX6s.js";import"./command-DyJgh8wP.js";import"./index-DAmj773w.js";import"./dropdown-menu-CRyIPZil.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DRhhwMt0.js";import"./empty-state-CmZpGujH.js";import"./toolbar-D5FkjLVB.js";import"./use-mcp-tools-xhV-ENX5.js";import"./use-capability-CbeJheXW.js";import"./shell-route-loading-fK7OWXny.js";import"./tools-list-BKN97Z6h.js";import"./switch-Cf_WUos9.js";import"./use-debounced-autosave-BnfFXRc0.js";import"./index-RkQpccOp.js";import"./sidebar-C45GjVmp.js";import"./search-input-CEqRaXj6.js";import"./github-repo-picker-Db_ehY6e.js";import"./use-secrets-DqgJI3yC.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-ncGR_sPB.js";import"./index-DAWoaMpc.js";import"./automation-runs-DxPUfxy1.js";import"./table-tHeeUiY0.js";import"./use-members-CJKZdynB.js";import"./use-org-auth-client-Tiq6Yt9b.js";import"./task-status-DzLkYYrk.js";import"./use-automations-CfP4AmpB.js";import"./use-file-configs-C8z3zSDD.js";import"./monaco-editor-tVsx1Jkl.js";import"./select-model-DJ7vH3M2.js";import"./automation-list-row-CLUMzxuG.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,O]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&O(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(Ot,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let R;e[11]!==L||e[12]!==N?(R=i.jsxs(Rt,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=R):R=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=>O(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]!==R?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[R,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=R,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:O,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 R=`${K*14+8}px`;let S;e[2]!==R?(S={paddingLeft:R},e[2]=R,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]!==O?(u=i.jsx(_,{onSelect:O,children:"Copy Path"}),e[26]=O,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 Ki({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),[O,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,R]=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){R(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,J]=l.useState(null),[H,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(),J(null),me(n)}async function Je(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(),J(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 He(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){J(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(),J(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 Je(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await He(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=Ht(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 O?.kind==="directory"?O.path:O?.kind==="file"?ye(O.path):o?ye(o):"/"}function Le(t){const n=at();J({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=H?qe(H.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
- `)}]}),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(Oe,{children:[i.jsx(Re,{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(Oe,{children:[i.jsx(Re,{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=O?.path===n.path,Y=Jt(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:()=>J({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>J({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>be("Path",ce(n.path)),onCopyRelativePath:()=>be("Relative path",M(n.path)),onRename:()=>J({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&&J(null)}}),i.jsx(vt,{open:H!==null,onOpenChange:t=>{!t&&!ee&&ue(null)},children:i.jsxs(Ct,{children:[i.jsxs(Nt,{children:[i.jsxs(St,{children:["Delete ",H?.kind==="directory"?"folder":"file","?"]}),i.jsxs(Dt,{children:["This will permanently delete"," ",i.jsx("span",{className:"font-mono",children:H?.name}),H?.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||!H,onClick:t=>{t.preventDefault(),H&&Xe(H)},children:"Delete"})]})]})})]})}export{Ki as FileExplorer};
@@ -1 +0,0 @@
1
- import{b as M,w as $,m as U,G as Q,F as Y,d as q,s as P,t as w,K as L,j as n,ae as I,z as Z,C as k,c as F,r as T,B as H,L as B,o as J}from"./index-BkSIY6JJ.js";import{P as N}from"./index-RkQpccOp.js";import{u as W}from"./use-org-auth-client-Tiq6Yt9b.js";import{u as X}from"./use-debounced-autosave-BnfFXRc0.js";import{A as ee}from"./avatar-oAcdiJ9v.js";import{I as V}from"./input-jkT1z5r1.js";import{S as G,a as K,b as A,c as te}from"./settings-section-D6f1v8Lb.js";import{D as ne}from"./domain-settings-ed9WclHg.js";import{u as ae}from"./studio-tools-BgUSKeCY.js";import{c as se,b as oe,d as ie,A as re,e as le,g as ce,a as ue,f as de}from"./alert-dialog-HmiP05XU.js";import{R as me}from"./require-capability-BC8YsasG.js";import"./sidebar-C45GjVmp.js";import"./LayoutLeft-BqtFvEWV.js";import"./use-mobile-CPyq18pe.js";import"./sheet-CUfjkNRy.js";import"./X-B-cRV-7d.js";import"./tooltip-CAEDbADy.js";import"./User01-B3UbdHmL.js";import"./card-BIwENur_.js";import"./ArrowUpRight-BeOMO89N.js";import"./badge-CpKEkIGn.js";import"./select-Ct-_FhWe.js";import"./index-BdQq_4o_.js";import"./ChevronUp-BhWz3ylT.js";import"./ChevronDown-BWfuTI7r.js";import"./use-capability-CbeJheXW.js";import"./access-gate-BXDE0rsJ.js";import"./capability-load-error-CG-hWPTN.js";const ge=Z({name:k().min(1,"Name is required").max(255,"Name is too long"),slug:k().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:k().optional()});function fe(e){const t=F.c(13),{value:v,onChange:h,name:o,disabled:d}=e,m=T.useRef(null);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>m.current?.click(),t[0]=l):l=t[0];const r=l;let c;t[1]!==h?(c=x=>{const j=x.target.files?.[0];if(!j)return;if(j.size>2097152){w.error("Image must be smaller than 2MB");return}const u=new FileReader;u.onerror=pe,u.onloadend=()=>{u.result&&h(u.result),m.current&&(m.current.value="")},u.readAsDataURL(j)},t[1]=h,t[2]=c):c=t[2];const a=c;let s;t[3]!==d||t[4]!==a?(s=n.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:d}),t[3]=d,t[4]=a,t[5]=s):s=t[5];const i=v||void 0,p=o??"?";let g;t[6]!==i||t[7]!==p?(g=n.jsx(ee,{url:i,fallback:p,shape:"square",size:"base"}),t[6]=i,t[7]=p,t[8]=g):g=t[8];let f;return t[9]!==d||t[10]!==s||t[11]!==g?(f=n.jsxs("button",{type:"button",onClick:r,disabled:d,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[s,g]}),t[9]=d,t[10]=s,t[11]=g,t[12]=f):f=t[12],f}function pe(){return w.error("Failed to read image")}function he(){const e=M(),{org:t}=$(),v=W(),h=U(),o=Q({resolver:Y(ge),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),d=q({mutationFn:async a=>{const s={name:a.name,slug:a.slug};a.logo&&(s.logo=a.logo);const i=await v.organization.update({data:s});if(i?.error)throw new Error(i.error.message||"Failed to update organization");return i},onSuccess:(a,s)=>{P("organization_settings_updated",{organization_id:t.id,fields:Object.keys(s)}),h.invalidateQueries({queryKey:L.organizations()}),h.invalidateQueries({queryKey:L.activeOrganization(t.slug)}),w.success("Organization updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:a.data.slug}})},onError:(a,s)=>{P("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(s),error:a instanceof Error?a.message:String(a)}),w.error(a instanceof Error?a.message:"Failed to update organization")}}),{schedule:m,flush:l}=X({save:async()=>{const a=o.control._formState.dirtyFields;if(Object.keys(a).length===0||!await o.trigger())return;const i=o.getValues(),p=o.control._defaultValues;o.reset(i,{keepValues:!0});try{await d.mutateAsync(i)}catch{o.reset(p,{keepValues:!0})}}}),r=o.formState.errors,c=typeof window<"u"?`${window.location.host}/`:"";return n.jsx(G,{children:n.jsxs(K,{children:[n.jsx(A,{title:"Logo",description:"Recommended size is 256x256px",action:n.jsx(fe,{value:o.watch("logo"),onChange:a=>{o.setValue("logo",a??"",{shouldDirty:!0}),l()},name:o.watch("name")})}),n.jsx(A,{title:"Name",action:n.jsx(I,{control:o.control,name:"name",render:({field:a})=>n.jsx(V,{id:"org-name",...a,onChange:s=>{a.onChange(s),m()},onBlur:()=>{a.onBlur(),l()},placeholder:"Organization name",className:"w-[280px]"})})}),n.jsx(A,{title:"URL",action:n.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[c&&n.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:c}),n.jsx(I,{control:o.control,name:"slug",render:({field:a})=>n.jsx("input",{id:"org-slug",value:a.value??"",name:a.name,ref:a.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:s=>{const i=s.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");o.setValue("slug",i,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),m()},onBlur:()=>{a.onBlur(),l()}})})]})}),(r.name||r.slug||r.logo)&&n.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&n.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.slug&&n.jsx("p",{className:"text-xs text-destructive",children:r.slug.message}),r.logo&&n.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function xe(){const e=F.c(42),{org:t}=$(),[v,h]=T.useState(!1),[o,d]=T.useState(""),m=ae();let l;e[0]!==t.id||e[1]!==m?(l=async()=>{await m.call("ORGANIZATION_DELETE",{id:t.id})},e[0]=t.id,e[1]=m,e[2]=l):l=e[2];let r;e[3]!==t.id||e[4]!==t.slug?(r=()=>{P("organization_deleted",{organization_id:t.id}),localStorage.getItem(B.lastOrgSlug())===t.slug&&localStorage.removeItem(B.lastOrgSlug()),J(),w.success("Organization deleted"),window.location.href="/"},e[3]=t.id,e[4]=t.slug,e[5]=r):r=e[5];let c;e[6]!==l||e[7]!==r?(c={mutationFn:l,onSuccess:r,onError:je},e[6]=l,e[7]=r,e[8]=c):c=e[8];const a=q(c);let s;e[9]===Symbol.for("react.memo_cache_sentinel")?(s=()=>h(!0),e[9]=s):s=e[9];let i;e[10]!==a.isPending?(i=n.jsx(G,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(K,{className:"border-destructive/40",children:n.jsx(A,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:n.jsx(H,{variant:"destructive",size:"sm",onClick:s,disabled:a.isPending,children:"Delete"})})})}),e[10]=a.isPending,e[11]=i):i=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=O=>{h(O),O||d("")},e[12]=p):p=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(se,{children:"Delete Organization?"}),e[13]=g):g=e[13];let f;e[14]!==t.name?(f=n.jsxs("p",{children:["This will permanently delete all data associated with"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[14]=t.name,e[15]=f):f=e[15];let x;e[16]!==t.name?(x=n.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[16]=t.name,e[17]=x):x=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=O=>d(O.target.value),e[18]=j):j=e[18];let u;e[19]!==o||e[20]!==t.name?(u=n.jsx(V,{value:o,onChange:j,placeholder:t.name,autoFocus:!0}),e[19]=o,e[20]=t.name,e[21]=u):u=e[21];let b;e[22]!==u||e[23]!==f||e[24]!==x?(b=n.jsxs(oe,{children:[g,n.jsx(ie,{asChild:!0,children:n.jsxs("div",{children:[f,x,u]})})]}),e[22]=u,e[23]=f,e[24]=x,e[25]=b):b=e[25];let D;e[26]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(re,{children:"Cancel"}),e[26]=D):D=e[26];let y;e[27]!==a?(y=()=>a.mutate(),e[27]=a,e[28]=y):y=e[28];const E=o!==t.name||a.isPending,R=a.isPending?"Deleting…":"Delete organization";let S;e[29]!==y||e[30]!==E||e[31]!==R?(S=n.jsxs(le,{children:[D,n.jsx(ce,{onClick:y,disabled:E,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:R})]}),e[29]=y,e[30]=E,e[31]=R,e[32]=S):S=e[32];let z;e[33]!==b||e[34]!==S?(z=n.jsxs(ue,{children:[b,S]}),e[33]=b,e[34]=S,e[35]=z):z=e[35];let C;e[36]!==v||e[37]!==z?(C=n.jsx(de,{open:v,onOpenChange:p,children:z}),e[36]=v,e[37]=z,e[38]=C):C=e[38];let _;return e[39]!==C||e[40]!==i?(_=n.jsxs(n.Fragment,{children:[i,C]}),e[39]=C,e[40]=i,e[41]=_):_=e[41],_}function je(e){w.error(e instanceof Error?e.message:"Failed to delete organization")}function ve(){const e=F.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(N.Content,{children:n.jsx(N.Body,{children:n.jsxs(te,{children:[n.jsx(N.Title,{children:"Organization"}),n.jsx(he,{}),n.jsx(ne,{}),n.jsx(xe,{})]})})})}),e[0]=t):t=e[0],t}function Ye(){const e=F.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(me,{capability:"org:manage",area:"general settings",children:n.jsx(ve,{})}),e[0]=t):t=e[0],t}export{Ye as default};
@@ -1 +0,0 @@
1
- function c(a,[t,n]){return Math.min(n,Math.max(t,a))}export{c};
@@ -1 +0,0 @@
1
- import{bg as st,bh as q,bi as De,C as c,ak as A,aF as Y,bj as Le,aC as _,bk as pe,bl as G,aD as ee,bm as le,z as p,bn as He,bo as Ve,bp as nt,bq as it,br as Ke,bs as ot,bt as at,bu as lt,bv as Ye,bw as ct,b6 as Z,bx as ut,aE as K,by as dt,c as U,r as F,l as _e,j as o,aP as Qe,w as Ue,a as ft,t as xe,B as Ce,i as $e,b as mt,E as ht,aa as pt}from"./index-BkSIY6JJ.js";import{P as ce}from"./index-RkQpccOp.js";import{E as Xe}from"./empty-state-CmZpGujH.js";import{A as gt,f as bt,h as yt,n as xt,j as vt,k as wt,i as St,u as jt}from"./use-mcp-client-DYpZuPPA.js";import{c as _t}from"./use-mcp-tools-xhV-ENX5.js";import{c as Ct}from"./ZoomOut-BdBjpsIq.js";import{i as Et}from"./Key01-DX7L8s0Z.js";import{b as Nt,u as Ot,a as Tt}from"./use-connection-BPcAXa47.js";import{U as ue,a as Ne,e as We}from"./auth-B9Q1UUsp.js";import{i as kt,c as It,d as Pt,e as Mt}from"./extract-connection-data-iACc8UZO.js";import{u as At}from"./use-registry-connections-Czx1u2H6.js";import{b as Rt}from"./use-organization-settings-DFnXSR7Z.js";import{s as Lt}from"./Plus-jFajoMCA.js";import{d as Ht,b as Ut,c as $t,S as Ft,a as Bt}from"./select-Ct-_FhWe.js";import{F as Dt,v as Vt}from"./Form-Czxo_N56.js";import"./index-QdluHxPe.js";import{A as et}from"./agent-icon-C6bJxQ04.js";import{I as Wt}from"./input-jkT1z5r1.js";import{a as qt,b as zt,P as Gt}from"./popover-1pFpRX6s.js";import{b as Jt,a as Zt,c as Kt,T as Yt}from"./tooltip-CAEDbADy.js";import{u as Qt}from"./use-virtual-mcp-DnY7c9gE.js";import{i as Xt}from"./ChevronUp-BhWz3ylT.js";import{i as er}from"./SearchMd-uzKFlzQB.js";import{a as tr}from"./Users03-gvBLUtvG.js";import{u as rr}from"./use-mobile-CPyq18pe.js";import{u as sr}from"./use-create-virtual-mcp-C88JBuQM.js";function nr(){const t=new gt({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0,code:{optimize:!1}});return st(t),t}class ir{#e=nr();#t=new Map;#r=new WeakMap;getValidator(e){const r=this.#r.get(e);if(r)return r;let s;const n=i=>{if(!s){const a=or(e);let l=this.#t.get(a);l||(l=this.#e.compile(e),this.#t.set(a,l)),s=l}return s(i)?{valid:!0,data:i,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this.#e.errorsText(s.errors)}};return this.#r.set(e,n),n}}function or(t){return JSON.stringify(t,(e,r)=>r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.keys(r).sort().map(s=>[s,r[s]])):r)}const ar=new ir;var lr=class{apply(t,e){if(!e.type)return;const r=Array.isArray(e.type)?e.type:[e.type],s=new Set(r);if(s.has("string")||(t.string=!1),!s.has("number")&&!s.has("integer")&&(t.number=!1),s.has("boolean")||(t.boolean=!1),s.has("null")||(t.null=!1),s.has("array")||(t.array=!1),s.has("object")||(t.object=!1),s.has("integer")&&t.number!==!1){const n=t.number||A();n instanceof le&&(t.number=n.int())}}},cr=class{apply(t,e){if(e.const===void 0)return;const r=e.const;t.string=!1,t.number=!1,t.boolean=!1,t.null=!1,t.array=!1,t.object=!1,typeof r=="string"?t.string=G(r):typeof r=="number"?t.number=G(r):typeof r=="boolean"?t.boolean=G(r):r===null?t.null=Le():Array.isArray(r)?t.array=void 0:typeof r=="object"&&(t.object=void 0)}},ur=class{apply(t,e){if(!e.enum)return;if(e.enum.length===0){e.type||(t.string=!1,t.number=!1,t.boolean=!1,t.null=!1,t.array=!1,t.object=!1);return}const r={string:e.enum.filter(s=>typeof s=="string"),number:e.enum.filter(s=>typeof s=="number"),boolean:e.enum.filter(s=>typeof s=="boolean"),null:e.enum.filter(s=>s===null),array:e.enum.filter(s=>Array.isArray(s)),object:e.enum.filter(s=>typeof s=="object"&&s!==null&&!Array.isArray(s))};t.string=this.createTypeSchema(r.string,"string"),t.number=this.createTypeSchema(r.number,"number"),t.boolean=this.createTypeSchema(r.boolean,"boolean"),t.null=r.null.length>0?Le():!1,t.array=r.array.length>0?void 0:!1,t.object=r.object.length>0?void 0:!1}createTypeSchema(t,e){if(t.length===0)return!1;if(t.length===1)return G(t[0]);if(e==="string")return ee(t);if(e==="number"){const[r,s,...n]=t;return pe([G(r),G(s),...n.map(i=>G(i))])}return e==="boolean"?pe([G(!0),G(!1)]):!1}},dr=class{apply(t,e){const r=e;if(r.type==="string"&&r.format==="binary"&&r.contentEncoding==="binary"){let s=lt();r.minLength!==void 0&&(s=s.min(r.minLength)),r.maxLength!==void 0&&(s=s.max(r.maxLength)),r.contentMediaType!==void 0&&(s=s.mime(r.contentMediaType)),t.file=s,t.string=!1}}},fr=class{apply(t,e){const r=e;e.type===void 0&&(r.minLength!==void 0||r.maxLength!==void 0||r.pattern!==void 0)&&t.string===void 0&&(t.string=c())}},mr=class{apply(t,e){const r=e;if(r.minLength!==void 0&&t.string!==!1){const s=t.string||c();s instanceof He&&(t.string=s.refine(n=>Array.from(n).length>=r.minLength,{message:`String must be at least ${r.minLength} characters long`}))}}},hr=class{apply(t,e){const r=e;if(r.maxLength!==void 0&&t.string!==!1){const s=t.string||c();s instanceof He&&(t.string=s.refine(n=>Array.from(n).length<=r.maxLength,{message:`String must be at most ${r.maxLength} characters long`}))}}},pr=class{apply(t,e){const r=e;if(r.pattern&&t.string!==!1){const s=t.string||c();if(s instanceof He){const n=new RegExp(r.pattern);t.string=s.regex(n)}}}},gr=class{apply(t,e){const r=e;if(r.minimum!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(t.number=s.min(r.minimum))}}},br=class{apply(t,e){const r=e;if(r.maximum!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(t.number=s.max(r.maximum))}}},yr=class{apply(t,e){const r=e;if(r.exclusiveMinimum!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(typeof r.exclusiveMinimum=="number"?t.number=s.gt(r.exclusiveMinimum):t.number=!1)}}},xr=class{apply(t,e){const r=e;if(r.exclusiveMaximum!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(typeof r.exclusiveMaximum=="number"?t.number=s.lt(r.exclusiveMaximum):t.number=!1)}}},vr=class{apply(t,e){const r=e;if(r.multipleOf!==void 0&&t.number!==!1){const s=t.number||A();s instanceof le&&(t.number=s.refine(n=>{if(r.multipleOf===0)return!1;const i=n/r.multipleOf,a=Math.round(i),l=Math.min(Math.abs(n)*Number.EPSILON*10,Math.abs(r.multipleOf)*Number.EPSILON*10);return Math.abs(i-a)<=l/Math.abs(r.multipleOf)},{message:`Must be a multiple of ${r.multipleOf}`}))}}},wr=class{apply(t,e){const r=e;e.type===void 0&&(r.minItems!==void 0||r.maxItems!==void 0||r.items!==void 0||r.prefixItems!==void 0)&&t.array===void 0&&(t.array=_(q()))}},Sr=class{apply(t,e){const r=e;r.minItems!==void 0&&t.array!==!1&&(t.array=(t.array||_(q())).min(r.minItems))}},jr=class{apply(t,e){const r=e;r.maxItems!==void 0&&t.array!==!1&&(t.array=(t.array||_(q())).max(r.maxItems))}},_r=class{apply(t,e){const r=e;if(t.array!==!1)if(Array.isArray(r.items))t.array=t.array||_(q());else if(r.items&&typeof r.items!="boolean"&&!r.prefixItems){const s=$(r.items);let n=_(s);if(t.array&&t.array instanceof nt){const i=t.array._def;i.checks&&i.checks.forEach(a=>{if(a._zod&&a._zod.def){const l=a._zod.def;l.check==="min_length"&&l.minimum!==void 0?n=n.min(l.minimum):l.check==="max_length"&&l.maximum!==void 0&&(n=n.max(l.maximum))}})}t.array=n}else typeof r.items=="boolean"&&r.items===!1?r.prefixItems?t.array=t.array||_(q()):t.array=_(q()).max(0):typeof r.items=="boolean"&&r.items===!0?t.array=t.array||_(q()):r.prefixItems&&(t.array=t.array||_(q()))}},Cr=class{apply(t,e){if(e.type!=="array")return;const r=e;if(!Array.isArray(r.items)||t.array===!1)return;const s=r.items.map(i=>$(i));let n;s.length===0?n=Ve([]):n=Ve(s),r.minItems!==void 0&&r.minItems>s.length&&(n=!1),r.maxItems!==void 0&&r.maxItems<s.length&&(n=!1),t.tuple=n,t.array=!1}},Er=class{apply(t,e){const r=e;t.object!==!1&&(r.properties||r.required||r.additionalProperties!==void 0)&&(t.object=t.object||p({}).passthrough())}},Nr=class{apply(t,e){const r=e;e.type===void 0&&(r.maxProperties!==void 0||r.minProperties!==void 0)&&t.object===void 0&&(t.object=p({}).passthrough())}},Or=class{apply(t,e){const r=e;if(r.maxProperties!==void 0&&t.object!==!1){const s=t.object||p({}).passthrough();t.object=s.refine(n=>Object.keys(n).length<=r.maxProperties,{message:`Object must have at most ${r.maxProperties} properties`})}}},Tr=class{apply(t,e){const r=e;if(r.minProperties!==void 0&&t.object!==!1){const s=t.object||p({}).passthrough();t.object=s.refine(n=>Object.keys(n).length>=r.minProperties,{message:`Object must have at least ${r.minProperties} properties`})}}};function ge(t,e){if(t===e)return!0;if(t==null||e==null)return t===e;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e))return t.length!==e.length?!1:t.every((r,s)=>ge(r,e[s]));if(typeof t=="object"&&typeof e=="object"){const r=Object.keys(t),s=Object.keys(e);return r.length!==s.length?!1:r.every(n=>s.includes(n)&&ge(t[n],e[n]))}return!1}function kr(){return t=>{if(!Array.isArray(t))return!0;const e=[];return t.every(r=>e.some(n=>ge(r,n))?!1:(e.push(r),!0))}}function Se(t,e){return t.safeParse(e).success}var Ir=class{apply(t,e){if(!e.not)return t;const r=$(e.not);return t.refine(s=>!Se(r,s),{message:"Value must not match the 'not' schema"})}},Pr=class{apply(t,e){return e.uniqueItems!==!0?t:t.refine(kr(),{message:"Array items must be unique"})}},Mr=class{apply(t,e){return!e.allOf||e.allOf.length===0?t:e.allOf.map(s=>$(s)).reduce((s,n)=>Ke(s,n),t)}},Ar=class{apply(t,e){if(!e.anyOf||e.anyOf.length===0)return t;const r=e.anyOf.length===1?$(e.anyOf[0]):pe([$(e.anyOf[0]),$(e.anyOf[1]),...e.anyOf.slice(2).map(s=>$(s))]);return Ke(t,r)}},Rr=class{apply(t,e){if(!e.oneOf||e.oneOf.length===0)return t;const r=e.oneOf.map(s=>$(s));return t.refine(s=>{let n=0;for(const i of r)if(i.safeParse(s).success&&(n++,n>1))return!1;return n===1},{message:"Value must match exactly one of the oneOf schemas"})}},Lr=class{apply(t,e){const r=e;if(r.prefixItems&&Array.isArray(r.prefixItems)){const n=r.prefixItems.map(i=>$(i));return t.refine(i=>{if(!Array.isArray(i))return!0;for(let a=0;a<Math.min(i.length,n.length);a++)if(!Se(n[a],i[a]))return!1;if(i.length>n.length){if(typeof r.items=="boolean"&&r.items===!1)return!1;if(r.items&&typeof r.items=="object"&&!Array.isArray(r.items)){const a=$(r.items);for(let l=n.length;l<i.length;l++)if(!Se(a,i[l]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return t}},Hr=class{apply(t,e){const r=e;if(!r.properties&&!r.required&&r.additionalProperties!==!1)return t;if(t instanceof ot||t instanceof at){const s={};if(r.properties)for(const[n,i]of Object.entries(r.properties))i!==void 0&&(s[n]=$(i));if(r.required&&Array.isArray(r.required)){const n=new Set(r.required);for(const i of Object.keys(s))n.has(i)||(s[i]=s[i].optional())}else for(const n of Object.keys(s))s[n]=s[n].optional();return r.additionalProperties===!1?p(s):p(s).passthrough()}return t.refine(s=>{if(typeof s!="object"||s===null||Array.isArray(s))return!0;if(r.properties){for(const[n,i]of Object.entries(r.properties))if(i!==void 0&&Object.getOwnPropertyDescriptor(s,n)!==void 0&&!$(i).safeParse(s[n]).success)return!1}if(r.required&&Array.isArray(r.required)){for(const n of r.required)if(!(Object.getOwnPropertyDescriptor(s,n)!==void 0))return!1}if(r.additionalProperties===!1&&r.properties){const n=new Set(Object.keys(r.properties));for(const i in s)if(!n.has(i))return!1}return!0},{message:"Object constraints validation failed"})}},Ur=class{apply(t,e){if(!e.enum||e.enum.length===0)return t;const r=e.enum.filter(s=>Array.isArray(s)||typeof s=="object"&&s!==null);return r.length===0?t:t.refine(s=>typeof s!="object"||s===null?!0:r.some(n=>ge(s,n)),{message:"Value must match one of the enum values"})}},$r=class{apply(t,e){if(e.const===void 0)return t;const r=e.const;return typeof r!="object"||r===null?t:t.refine(s=>ge(s,r),{message:"Value must equal the const value"})}},Fr=class{apply(t,e){return e.description&&(t=t.describe(e.description)),t}},Br=class{apply(t,e){var r;const s=e;return!((r=s.required)!=null&&r.includes("__proto__"))||e.type!==void 0?t:q().refine(n=>this.validateRequired(n,s.required),{message:"Missing required properties"})}validateRequired(t,e){return typeof t!="object"||t===null||Array.isArray(t)?!0:e.every(r=>Object.prototype.hasOwnProperty.call(t,r))}},Dr=class{apply(t,e){var r;const s=e;if(s.contains===void 0)return t;const n=$(s.contains),i=(r=s.minContains)!=null?r:1,a=s.maxContains;return t.refine(l=>{if(!Array.isArray(l))return!0;let d=0;for(const u of l)Se(n,u)&&d++;return!(d<i||a!==void 0&&d>a)},{message:"Array must contain required items matching the schema"})}},Vr=class{apply(t,e){const{default:r}=e;return r===void 0||!t.safeParse(r).success?t:t.default(r)}},Wr=[new cr,new ur,new lr,new dr,new fr,new wr,new Nr,new mr,new hr,new pr,new gr,new br,new yr,new xr,new vr,new Cr,new Sr,new jr,new _r,new Or,new Tr,new Er],qr=[new Br,new Ur,new $r,new Mr,new Ar,new Rr,new Lr,new Hr,new Dr,new Ir,new Pr,new Vr,new Fr];function $(t){if(typeof t=="boolean")return t?q():De();const e={};for(const n of Wr)n.apply(e,t);const r=[];if(e.string!==!1&&r.push(e.string||c()),e.number!==!1&&r.push(e.number||A()),e.boolean!==!1&&r.push(e.boolean||Y()),e.null!==!1&&r.push(e.null||Le()),e.array!==!1&&r.push(e.array||_(q())),e.tuple!==!1&&e.tuple!==void 0&&r.push(e.tuple),e.object!==!1)if(e.object)r.push(e.object);else{const n=it(i=>typeof i=="object"&&i!==null&&!Array.isArray(i),"Must be an object, not an array");r.push(n)}e.file!==!1&&e.file!==void 0&&r.push(e.file);let s;r.length===0?s=De():r.length===1?s=r[0]:Object.keys(t).some(i=>i!=="$schema"&&i!=="title"&&i!=="description")?s=pe(r):s=q();for(const n of qr)s=n.apply(s,t);return s}class qe extends Event{constructor(e,r){var s,n;super(e),this.code=(s=r?.code)!=null?s:void 0,this.message=(n=r?.message)!=null?n:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,r,s){return s(ze(this),r)}[Symbol.for("Deno.customInspect")](e,r){return e(ze(this),r)}}function zr(t){const e=globalThis.DOMException;return typeof e=="function"?new e(t,"SyntaxError"):new SyntaxError(t)}function Oe(t){return t instanceof Error?"errors"in t&&Array.isArray(t.errors)?t.errors.map(Oe).join(", "):"cause"in t&&t.cause instanceof Error?`${t}: ${Oe(t.cause)}`:t.message:`${t}`}function ze(t){return{type:t.type,message:t.message,code:t.code,defaultPrevented:t.defaultPrevented,cancelable:t.cancelable,timeStamp:t.timeStamp}}var tt=t=>{throw TypeError(t)},Fe=(t,e,r)=>e.has(t)||tt("Cannot "+r),v=(t,e,r)=>(Fe(t,e,"read from private field"),r?r.call(t):e.get(t)),H=(t,e,r)=>e.has(t)?tt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),T=(t,e,r,s)=>(Fe(t,e,"write to private field"),e.set(t,r),r),J=(t,e,r)=>(Fe(t,e,"access private method"),r),D,X,se,ve,je,me,oe,he,Q,ne,ae,ie,de,z,Te,ke,Ie,Ge,Pe,Me,fe,Ae,Re;class we extends EventTarget{constructor(e,r){var s,n;super(),H(this,z),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,H(this,D),H(this,X),H(this,se),H(this,ve),H(this,je),H(this,me),H(this,oe),H(this,he,null),H(this,Q),H(this,ne),H(this,ae,null),H(this,ie,null),H(this,de,null),H(this,ke,async i=>{var a;v(this,ne).reset();const{body:l,redirected:d,status:u,headers:m}=i;if(u===204){J(this,z,fe).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(d?T(this,se,new URL(i.url)):T(this,se,void 0),u!==200){J(this,z,fe).call(this,`Non-200 status code (${u})`,u);return}if(!(m.get("content-type")||"").startsWith("text/event-stream")){J(this,z,fe).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(v(this,D)===this.CLOSED)return;T(this,D,this.OPEN);const f=new Event("open");if((a=v(this,de))==null||a.call(this,f),this.dispatchEvent(f),typeof l!="object"||!l||!("getReader"in l)){J(this,z,fe).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const h=new TextDecoder,x=l.getReader();let y=!0;do{const{done:b,value:w}=await x.read();w&&v(this,ne).feed(h.decode(w,{stream:!b})),b&&(y=!1,v(this,ne).reset(),J(this,z,Ae).call(this))}while(y)}),H(this,Ie,i=>{T(this,Q,void 0),!(i.name==="AbortError"||i.type==="aborted")&&J(this,z,Ae).call(this,Oe(i))}),H(this,Pe,i=>{typeof i.id=="string"&&T(this,he,i.id);const a=new MessageEvent(i.event||"message",{data:i.data,origin:v(this,se)?v(this,se).origin:v(this,X).origin,lastEventId:i.id||""});v(this,ie)&&(!i.event||i.event==="message")&&v(this,ie).call(this,a),this.dispatchEvent(a)}),H(this,Me,i=>{T(this,me,i)}),H(this,Re,()=>{T(this,oe,void 0),v(this,D)===this.CONNECTING&&J(this,z,Te).call(this)});try{if(e instanceof URL)T(this,X,e);else if(typeof e=="string")T(this,X,new URL(e,Gr()));else throw new Error("Invalid URL")}catch{throw zr("An invalid or illegal string was specified")}T(this,ne,bt({onEvent:v(this,Pe),onRetry:v(this,Me)})),T(this,D,this.CONNECTING),T(this,me,3e3),T(this,je,(s=r?.fetch)!=null?s:globalThis.fetch),T(this,ve,(n=r?.withCredentials)!=null?n:!1),J(this,z,Te).call(this)}get readyState(){return v(this,D)}get url(){return v(this,X).href}get withCredentials(){return v(this,ve)}get onerror(){return v(this,ae)}set onerror(e){T(this,ae,e)}get onmessage(){return v(this,ie)}set onmessage(e){T(this,ie,e)}get onopen(){return v(this,de)}set onopen(e){T(this,de,e)}addEventListener(e,r,s){const n=r;super.addEventListener(e,n,s)}removeEventListener(e,r,s){const n=r;super.removeEventListener(e,n,s)}close(){v(this,oe)&&clearTimeout(v(this,oe)),v(this,D)!==this.CLOSED&&(v(this,Q)&&v(this,Q).abort(),T(this,D,this.CLOSED),T(this,Q,void 0))}}D=new WeakMap,X=new WeakMap,se=new WeakMap,ve=new WeakMap,je=new WeakMap,me=new WeakMap,oe=new WeakMap,he=new WeakMap,Q=new WeakMap,ne=new WeakMap,ae=new WeakMap,ie=new WeakMap,de=new WeakMap,z=new WeakSet,Te=function(){T(this,D,this.CONNECTING),T(this,Q,new AbortController),v(this,je)(v(this,X),J(this,z,Ge).call(this)).then(v(this,ke)).catch(v(this,Ie))},ke=new WeakMap,Ie=new WeakMap,Ge=function(){var t;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...v(this,he)?{"Last-Event-ID":v(this,he)}:void 0},cache:"no-store",signal:(t=v(this,Q))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},Pe=new WeakMap,Me=new WeakMap,fe=function(t,e){var r;v(this,D)!==this.CLOSED&&T(this,D,this.CLOSED);const s=new qe("error",{code:e,message:t});(r=v(this,ae))==null||r.call(this,s),this.dispatchEvent(s)},Ae=function(t,e){var r;if(v(this,D)===this.CLOSED)return;T(this,D,this.CONNECTING);const s=new qe("error",{code:e,message:t});(r=v(this,ae))==null||r.call(this,s),this.dispatchEvent(s),T(this,oe,setTimeout(v(this,Re),v(this,me)))},Re=new WeakMap,we.CONNECTING=0,we.OPEN=1,we.CLOSED=2;function Gr(){const t="document"in globalThis?globalThis.document:void 0;return t&&typeof t=="object"&&"baseURI"in t&&typeof t.baseURI=="string"?t.baseURI:void 0}class Jr extends Error{constructor(e,r,s){super(`SSE error: ${r}`),this.code=e,this.event=s}}class Zr{constructor(e,r){this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=r?.eventSourceInit,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=yt(r?.fetch,r?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new ue("No auth provider");let e;try{e=await Ne(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new ue;return await this._startOrAuth()}async _commonHeaders(){const e={};if(this._authProvider){const s=await this._authProvider.tokens();s&&(e.Authorization=`Bearer ${s.access_token}`)}this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);const r=xt(this._requestInit?.headers);return new Headers({...e,...r})}_startOrAuth(){const e=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((r,s)=>{this._eventSource=new we(this._url.href,{...this._eventSourceInit,fetch:async(n,i)=>{const a=await this._commonHeaders();a.set("Accept","text/event-stream");const l=await e(n,{...i,headers:a});if(l.status===401&&l.headers.has("www-authenticate")){const{resourceMetadataUrl:d,scope:u}=We(l);this._resourceMetadataUrl=d,this._scope=u}return l}}),this._abortController=new AbortController,this._eventSource.onerror=n=>{if(n.code===401&&this._authProvider){this._authThenStart().then(r,s);return}const i=new Jr(n.code,n.message,n);s(i),this.onerror?.(i)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",n=>{const i=n;try{if(this._endpoint=new URL(i.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(a){s(a),this.onerror?.(a),this.close();return}r()}),this._eventSource.onmessage=n=>{const i=n;let a;try{a=Ye.parse(JSON.parse(i.data))}catch(l){this.onerror?.(l);return}this.onmessage?.(a)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(e){if(!this._authProvider)throw new ue("No auth provider");if(await Ne(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new ue("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(e){if(!this._endpoint)throw new Error("Not connected");try{const r=await this._commonHeaders();r.set("content-type","application/json");const s={...this._requestInit,method:"POST",headers:r,body:JSON.stringify(e),signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._endpoint,s);if(!n.ok){const i=await n.text().catch(()=>null);if(n.status===401&&this._authProvider){const{resourceMetadataUrl:a,scope:l}=We(n);if(this._resourceMetadataUrl=a,this._scope=l,await Ne(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new ue;return this.send(e)}throw new Error(`Error POSTing to endpoint (HTTP ${n.status}): ${i}`)}await n.body?.cancel()}catch(r){throw this.onerror?.(r),r}}setProtocolVersion(e){this._protocolVersion=e}}const Kr="mcp";class Yr{constructor(e){this._url=e}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,r)=>{this._socket=new WebSocket(this._url,Kr),this._socket.onerror=s=>{const n="error"in s?s.error:new Error(`WebSocket error: ${JSON.stringify(s)}`);r(n),this.onerror?.(n)},this._socket.onopen=()=>{e()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=s=>{let n;try{n=Ye.parse(JSON.parse(s.data))}catch(i){this.onerror?.(i);return}this.onmessage?.(n)}})}async close(){this._socket?.close()}send(e){return new Promise((r,s)=>{if(!this._socket){s(new Error("Not connected"));return}this._socket?.send(JSON.stringify(e)),r()})}}class Qr extends vt{constructor(e,r){super(e,r)}send(e,r){const s=Xr(e);return s?.type==="emit"?(this.onmessage?.(s.message),Promise.resolve()):s?.type==="suppress"?Promise.resolve():super.send(e,r)}}function Xr(t){const e=t;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const r=e?.params?.protocolVersion;return r?{type:"emit",message:{result:{protocolVersion:r,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class es extends wt{constructor(e,r){super(e,{jsonSchemaValidator:ar,...r})}async listTools(e,r){return await this.request({method:"tools/list",params:e},ct,r)}}const ts=async(t,e,r)=>{const s=rs(t.connection,e,r);if(!s)throw new Error("Unknown MCP connection type");const n=new es({name:t?.name??"MCP Client",version:"1.0.0"});return await n.connect(s),{client:n}},rs=(t,e,r)=>{if(t.type==="Websocket")return new Yr(new URL(t.url));if(t.type!=="SSE"&&t.type!=="HTTP")return null;const n={...t.token?{authorization:`Bearer ${t.token}`}:{},...r??{},..."headers"in t?t.headers||{}:{}};if(t.type==="SSE"){const i={requestInit:{headers:n,signal:e}};return t.token&&(i.eventSourceInit={fetch:(a,l)=>fetch(a,{...l,headers:{...n,Accept:"text/event-stream"},signal:e})}),new Zr(new URL(t.url),i)}return new Qr(new URL(t.url),{requestInit:{headers:n,signal:e,credentials:"include"}})},Je=t=>{try{return JSON.parse(t)}catch{return t}},ye=new Map,Ze=(t,e)=>({...t,id:t.name,inputSchema:t.inputSchema?$(t.inputSchema):void 0,outputSchema:t.outputSchema?$(t.outputSchema):void 0,execute:r=>e(r.context,t.name)});function ss(t){const e=r=>"connection"in t?ts({connection:t.connection},void 0,r):t.client;return new Proxy({},{get(r,s){if(s==="toJSON")return null;if(typeof s!="string")throw new Error("Name must be a string");if(s==="listTools")return l;async function n(d,u=s){const m=t?.debugId?.(),f=m?{"x-trace-debug-id":m}:void 0,{client:h}=await e(f),{structuredContent:x,isError:y,content:b}=await h.callTool({name:String(u),arguments:d});if(y){const S=b?.[0]?.text,g=typeof S=="string"?Je(S):null,O=g?.code&&typeof t?.getErrorByStatusCode=="function"?t.getErrorByStatusCode(g.code,g.message,g.traceId):null;throw O||new Error(`Tool ${String(u)} returned an error: ${JSON.stringify(x??b)}`)}if(x!==void 0)return x;const w=b?.[0]?.text;return typeof w=="string"?Je(w):void 0}async function i(){const{client:d}=await e(),{tools:u}=await d.listTools();return u}async function a(){if(!("connection"in t))return i();const d=t.connection,u=JSON.stringify(d);try{return ye.has(u)||ye.set(u,i()),await ye.get(u)}catch(m){console.error("Failed to list tools",m),ye.delete(u);return}}async function l(){return(await a()??[]).map(u=>Ze(u,n))}return n.asTool=async()=>{const u=(await a()??[]).find(m=>m.name===s);if(!u)throw new Error(`Tool ${s} not found`);return Ze(u,n)},n}})}new Proxy({},{get(t,e){return e==="toJSON"?null:e==="forConnection"?r=>ns({connection:r}):global[e]}});function ns(t){return ss(t)}function is(t){return{isImplementedBy:e=>{for(const r of t){const s=typeof r.name=="string"?new RegExp(`^${r.name}$`):r.name,n=e.find(i=>s.test(i.name));if(!(!n&&r.opt)&&!n)return!1}return!0}}}const os=p({id:c().describe("Unique identifier for the entity"),title:c().describe("Human-readable title for the entity"),description:c().nullish().describe("Description of the entity"),created_at:c().datetime(),updated_at:c().datetime(),created_by:c().optional(),updated_by:c().optional()}),as=p({field:_(c()),operator:ee(["eq","gt","gte","lt","lte","in","like","contains"]),value:Z()}),rt=ut(()=>pe([as,p({operator:ee(["and","or","not"]),conditions:_(rt)})])),ls=p({field:_(c()),direction:ee(["asc","desc"]),nulls:ee(["first","last"]).optional()}),cs=p({where:rt.optional().describe("Filter expression"),orderBy:_(ls).optional().describe("Sort expressions"),limit:A().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:A().int().min(0).optional().describe("Number of items to skip")});function us(t){return p({items:_(t).describe("Array of collection items"),totalCount:A().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:Y().optional().describe("Whether there are more items available")})}const ds=p({id:c().describe("ID of the entity to retrieve")});function fs(t){return p({item:t.nullable().describe("The retrieved item, or null if not found")})}p({id:c().describe("ID of the entity to delete")});function ms(t,e,r){const s=t.toUpperCase();return[{name:`COLLECTION_${s}_LIST`,inputSchema:cs,outputSchema:us(e)},{name:`COLLECTION_${s}_GET`,inputSchema:ds,outputSchema:fs(e)}]}const hs=p({id:c(),name:c(),description:c().optional(),inputSchema:K(c(),Z()),outputSchema:K(c(),Z()).optional()}),ps=os.extend({_meta:p({"io.decocms":p({id:c(),verified:Y(),scopeName:c(),appName:c(),friendlyName:c().nullable().optional(),metadata:K(c(),Z()).nullable().optional(),publishedAt:c().datetime().optional(),updatedAt:c().datetime().optional(),tools:_(hs).nullable().optional().describe("Available tools exposed by this app")}).optional()}).optional(),server:p({$schema:c().optional(),_meta:K(c(),Z()).optional(),name:c().describe("The server name (scope/app)"),title:c().optional().describe("User-friendly title"),description:c().optional().describe("Server description"),icons:_(p({src:c(),mimeType:c().optional(),sizes:_(c()).optional(),theme:ee(["light","dark"]).optional()})).optional(),remotes:_(p({type:ee(["http","stdio","sse"]),url:c().optional(),headers:_(Z()).optional()})).optional(),packages:_(Z()).optional(),repository:p({url:c(),source:c().optional(),subfolder:c().optional()}).optional(),version:c().optional(),websiteUrl:c().optional()})});ms("registry_app",ps);const gs=p({specversion:G("1.0").describe("CloudEvents specification version"),id:c().describe("Unique identifier for this event (UUID recommended)"),source:c().describe("Connection ID of the event publisher"),type:c().describe("Event type (e.g., 'order.created', 'user.signup')"),time:c().datetime().optional().describe("Timestamp of when the event occurred (ISO 8601)"),subject:c().optional().describe("Subject/resource identifier (e.g., order ID, user ID)"),datacontenttype:c().optional().default("application/json").describe("Content type of the data attribute"),dataschema:c().url().optional().describe("URI to the schema for the data attribute"),data:Z().optional().describe("Event payload (any JSON value)")});p({events:_(gs).min(1).describe("Batch of CloudEvents to process")});const bs=p({success:Y().optional().describe("Whether this event was processed successfully"),error:c().optional().describe("Error message for this event"),retryAfter:A().int().positive().optional().describe("Re-deliver this event after this many ms")});p({success:Y().optional().describe("Batch success - applies to events not in results"),error:c().optional().describe("Batch error message - applies to events not in results"),processedCount:A().int().min(0).optional().describe("Number of events successfully processed"),retryAfter:A().int().positive().optional().describe("Batch retryAfter - applies to events not in results"),results:K(c(),bs).optional().describe("Per-event results keyed by event ID")});const ys=p({type:G("string"),enum:_(c()).optional(),description:c().optional()}),xs=p({type:c(),description:c(),paramsSchema:K(c(),ys)});p({});p({triggers:_(xs)});p({type:c(),params:K(c(),c()),enabled:Y(),callbackUrl:dt().optional(),callbackToken:c().min(1).optional()});p({success:Y()});p({prefix:c().optional().describe("Filter objects by prefix (e.g., 'folder/' for folder contents)"),maxKeys:A().optional().default(1e3).describe("Maximum number of keys to return (default: 1000)"),continuationToken:c().optional().describe("Token for pagination from previous response"),delimiter:c().optional().describe("Delimiter for grouping keys (typically '/'). When set, commonPrefixes returns folder paths.")});p({objects:_(p({key:c().describe("Object key/path"),size:A().describe("Object size in bytes"),lastModified:c().describe("Last modified timestamp"),etag:c().describe("Entity tag for the object")})),nextContinuationToken:c().optional().describe("Token for fetching next page of results"),isTruncated:Y().describe("Whether there are more results available"),commonPrefixes:_(c()).optional().describe("Folder paths when delimiter is used (e.g., ['photos/2024/', 'photos/2025/'])")});p({key:c().describe("Object key/path to get metadata for")});p({contentType:c().optional().describe("MIME type of the object"),contentLength:A().describe("Size of the object in bytes"),lastModified:c().describe("Last modified timestamp"),etag:c().describe("Entity tag for the object"),metadata:K(c(),c()).optional().describe("Custom metadata key-value pairs")});p({key:c().describe("Object key/path to generate URL for"),expiresIn:A().optional().describe("URL expiration time in seconds (default: from state config or 3600)")});p({url:c().describe("Presigned URL for downloading the object"),expiresIn:A().describe("Expiration time in seconds that was used")});p({key:c().describe("Object key/path for the upload"),expiresIn:A().optional().describe("URL expiration time in seconds (default: from state config or 3600)"),contentType:c().optional().describe("MIME type for the object being uploaded")});p({url:c().describe("Presigned URL for uploading the object"),expiresIn:A().describe("Expiration time in seconds that was used")});p({key:c().describe("Object key/path to delete")});p({success:Y().describe("Whether the deletion was successful"),key:c().describe("The key that was deleted")});p({keys:_(c()).max(1e3).describe("Array of object keys/paths to delete (max 1000)")});p({deleted:_(c()).describe("Array of successfully deleted keys"),errors:_(p({key:c(),message:c()})).describe("Array of errors for failed deletions")});const vs=p({primary:c().optional().describe("Primary brand color (hex)"),secondary:c().optional().describe("Secondary brand color (hex)"),accent:c().optional().describe("Accent / highlight color (hex)"),background:c().optional().describe("Background color (hex)"),foreground:c().optional().describe("Foreground / text color (hex)")}),ws=p({heading:c().optional().describe("Font family for headings"),body:c().optional().describe("Font family for body text"),code:c().optional().describe("Font family for code / monospace")}),Ss=p({logo:c().optional().describe("Logo URL"),favicon:c().optional().describe("Favicon URL"),ogImage:c().optional().describe("Open Graph image URL")}),js=p({id:c(),name:c().describe("Brand / company name"),domain:c().optional().describe("Company domain (e.g. example.com)"),colors:vs.optional().describe("Semantic color palette"),fonts:ws.optional().describe("Font families by role"),assets:Ss.optional().describe("Visual identity assets"),overview:c().optional().describe("Company overview / description"),tagline:c().optional().describe("Brand tagline"),tone:c().optional().describe("Tone of voice description"),metadata:K(c(),Z()).optional().describe("Extra design tokens and metadata")});p({id:c().optional().describe("Brand ID. Omit to get the default brand.")});p({});p({items:_(js)});const _s={"@deco/llm":"LLMS","@deco/trigger":"TRIGGER","@deco/object-storage":"OBJECT_STORAGE","@deco/brand":"BRAND"};function Cs(t){if(t)return _s[t]}function En(t,e){const r=t.tools;if(!r||r.length===0)return!1;const s=r.map(a=>({name:a.name,inputSchema:a.inputSchema})),n=e.map(a=>({name:a.name,inputSchema:a.inputSchema,opt:a.opt}));return is(n).isImplementedBy(s)}const Be=F.createContext(null);function Nn(t){const e=U.c(3),{children:r}=t,s=F.useContext(Be);if(!s?.tabsEl)return null;let n;return e[0]!==r||e[1]!==s.tabsEl?(n=Qe.createPortal(r,s.tabsEl),e[0]=r,e[1]=s.tabsEl,e[2]=n):n=e[2],n}function Es(t){const e=U.c(3),{children:r}=t,s=F.useContext(Be);if(!s?.actionsEl)return null;let n;return e[0]!==r||e[1]!==s.actionsEl?(n=Qe.createPortal(r,s.actionsEl),e[0]=r,e[1]=s.actionsEl,e[2]=n):n=e[2],n}const On=Es;function Tn(t){const e=U.c(21),{children:r,breadcrumb:s,hideHeader:n}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={leftEl:null,tabsEl:null,actionsEl:null},e[0]=i):i=e[0];const[a,l]=F.useState(i),d=F.useRef(null),u=F.useRef(null),m=F.useRef(null);let f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=j=>{d.current=j,j&&l(C=>C.leftEl===j?C:{...C,leftEl:j})},e[1]=f):f=e[1];const h=f;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=j=>{u.current=j,j&&l(C=>C.tabsEl===j?C:{...C,tabsEl:j})},e[2]=x):x=e[2];const y=x;let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=j=>{m.current=j,j&&l(C=>C.actionsEl===j?C:{...C,actionsEl:j})},e[3]=b):b=e[3];const w=b,S=n&&"hidden";let g;e[4]!==S?(g=_e(S),e[4]=S,e[5]=g):g=e[5];let O;e[6]===Symbol.for("react.memo_cache_sentinel")?(O=o.jsx("div",{ref:h,className:"flex items-center gap-2 min-w-0"}),e[6]=O):O=e[6];let R;e[7]!==s?(R=o.jsxs(ce.Header.Left,{children:[s,O]}),e[7]=s,e[8]=R):R=e[8];let L;e[9]===Symbol.for("react.memo_cache_sentinel")?(L=o.jsxs(ce.Header.Right,{children:[o.jsx("div",{ref:y,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),o.jsx("div",{ref:w,className:"flex items-center gap-2 shrink-0"})]}),e[9]=L):L=e[9];let k;e[10]!==g||e[11]!==R?(k=o.jsxs(ce.Header,{className:g,children:[R,L]}),e[10]=g,e[11]=R,e[12]=k):k=e[12];let I;e[13]!==r?(I=o.jsx(ce.Content,{children:r}),e[13]=r,e[14]=I):I=e[14];let P;e[15]!==k||e[16]!==I?(P=o.jsxs(ce,{children:[k,I]}),e[15]=k,e[16]=I,e[17]=P):P=e[17];let N;return e[18]!==a||e[19]!==P?(N=o.jsx(Be,{value:a,children:P}),e[18]=a,e[19]=P,e[20]=N):N=e[20],N}function Ns(t){return t.startsWith("@")?t:`@${t}`}function Os(){const{org:t}=Ue(),{data:e}=ft.useSession(),r=Nt(),s=At(),n=Rt(),i=s.filter(l=>n(l.id));return{installByBinding:async l=>{if(!t||!e?.user?.id){xe.error("Not authenticated");return}const d=Ns(l),m=(await Promise.all(i.map(async b=>{const w=kt(b.id,t.id);try{const S=await It(b.id,t.id,t.slug,w,{where:{appName:d}});return Pt(S??[])[0]??null}catch{return null}}))).find(b=>b!==null);if(!m){xe.error(`MCP Server not found in registry: ${l}`);return}const f=Mt(m,t.id,e.user.id),h=f.connection_type==="STDIO",x=!!f.connection_url,y=h&&f.connection_headers&&typeof f.connection_headers=="object"&&"command"in f.connection_headers;if(!x&&!y){xe.error("This MCP Server cannot be connected: no connection method available");return}return await r.create.mutateAsync(f),{id:f.id,connection:f}},isInstalling:r.create.isPending}}function Ts(t){const e=U.c(21),{virtualMcp:r,isSelected:s}=t,n=s&&"bg-accent";let i;e[0]!==n?(i=_e("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-xl transition-colors",n),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==r.icon||e[3]!==r.title?(a=o.jsx(et,{icon:r.icon,name:r.title,size:"sm"}),e[2]=r.icon,e[3]=r.title,e[4]=a):a=e[4];let l;e[5]!==r.title?(l=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:r.title}),e[5]=r.title,e[6]=l):l=e[6];let d;e[7]!==s?(d=s&&o.jsx(Xt,{size:16,className:"text-foreground shrink-0"}),e[7]=s,e[8]=d):d=e[8];let u;e[9]!==l||e[10]!==d?(u=o.jsxs("div",{className:"flex items-center justify-between",children:[l,d]}),e[9]=l,e[10]=d,e[11]=u):u=e[11];let m;e[12]!==r.description?(m=r.description&&o.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:r.description}),e[12]=r.description,e[13]=m):m=e[13];let f;e[14]!==u||e[15]!==m?(f=o.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[u,m]}),e[14]=u,e[15]=m,e[16]=f):f=e[16];let h;return e[17]!==i||e[18]!==a||e[19]!==f?(h=o.jsxs("div",{className:i,children:[a,f]}),e[17]=i,e[18]=a,e[19]=f,e[20]=h):h=e[20],h}function ks(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("div",{className:"flex items-center justify-center py-12",children:o.jsx($e,{size:20,className:"animate-spin text-muted-foreground"})}),t[0]=e):e=t[0],e}function Is(t){const e=U.c(33),{selectedVirtualMcpId:r,onVirtualMcpChange:s,searchInputRef:n}=t,i=Qt(),[a,l]=F.useState(""),d=F.useRef(null),u=n??d;let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={navigateOnCreate:!0},e[0]=m):m=e[0];const{createVirtualMCP:f,isCreating:h}=sr(m);let x,y,b,w;if(e[1]!==f||e[2]!==u||e[3]!==h||e[4]!==s||e[5]!==a||e[6]!==r||e[7]!==i){let O;e:{const E=i.filter(Ps);if(!a.trim()){O=E;break e}const M=a.toLowerCase();O=E.filter(B=>B.title.toLowerCase().includes(M)||B.description?.toLowerCase().includes(M))}const R=O;let L;e[12]!==s?(L=E=>{s(E),l("")},e[12]=s,e[13]=L):L=e[13];const k=L;b="flex flex-col max-h-[min(400px,60dvh)]";let I;e[14]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(er,{size:16,className:"text-muted-foreground pointer-events-none shrink-0"}),e[14]=I):I=e[14];let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=E=>l(E.target.value),e[15]=P):P=e[15];let N;e[16]!==u||e[17]!==a?(N=o.jsx(Wt,{ref:u,type:"text",placeholder:"Search for an agent...",value:a,onChange:P,className:"flex-1 h-8 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none p-0"}),e[16]=u,e[17]=a,e[18]=N):N=e[18];const j=h?"Creating...":"Create Agent";let C;e[19]!==f||e[20]!==h||e[21]!==j?(C=o.jsx(Ce,{onClick:f,variant:"outline",size:"sm",className:"h-8 px-3 rounded-lg text-sm font-medium shrink-0",disabled:h,children:j}),e[19]=f,e[20]=h,e[21]=j,e[22]=C):C=e[22],e[23]!==N||e[24]!==C?(w=o.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:o.jsxs("div",{className:"relative flex items-center gap-2",children:[I,N,C]})}),e[23]=N,e[24]=C,e[25]=w):w=e[25],x="overflow-y-auto p-1.5 flex-1 min-h-0 [touch-action:pan-y]",y=R.length>0?o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-0.5",children:R.map(E=>o.jsx("div",{role:"button",tabIndex:0,onClick:()=>k(E.id),onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),k(E.id))},className:"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-xl",children:o.jsx(Ts,{virtualMcp:E,isSelected:E.id===r})},E.id))}):o.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No agents found"}),e[1]=f,e[2]=u,e[3]=h,e[4]=s,e[5]=a,e[6]=r,e[7]=i,e[8]=x,e[9]=y,e[10]=b,e[11]=w}else x=e[8],y=e[9],b=e[10],w=e[11];let S;e[26]!==x||e[27]!==y?(S=o.jsx("div",{className:x,children:y}),e[26]=x,e[27]=y,e[28]=S):S=e[28];let g;return e[29]!==b||e[30]!==w||e[31]!==S?(g=o.jsxs("div",{className:b,children:[w,S]}),e[29]=b,e[30]=w,e[31]=S,e[32]=g):g=e[32],g}function Ps(t){return!t.id||!St(t.id)}function Ms(t){const e=U.c(3);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(ks,{}),e[0]=r):r=e[0];let s;return e[1]!==t?(s=o.jsx(F.Suspense,{fallback:r,children:o.jsx(Is,{...t})}),e[1]=t,e[2]=s):s=e[2],s}function As(t){const e=U.c(32),{selectedVirtualMcpId:r,selectedVirtualMcp:s,onVirtualMcpChange:n,className:i,placeholder:a,showTooltip:l,disabled:d}=t,u=a===void 0?"Select Agent":a,m=l===void 0?!0:l,f=d===void 0?!1:d,[h,x]=F.useState(!1),y=F.useRef(null);let b;e[0]!==n?(b=W=>{n(W),x(!1)},e[0]=n,e[1]=b):b=e[1];const w=b,S=rr();let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=W=>{x(W)},e[2]=g):g=e[2];const O=g;let R,L;e[3]!==S||e[4]!==h?(R=()=>{h&&!S&&setTimeout(()=>{y.current?.focus()},0)},L=[h,S],e[3]=S,e[4]=h,e[5]=R,e[6]=L):(R=e[5],L=e[6]),F.useEffect(R,L);const k=f?!1:h,I=f?void 0:O,P=f?"cursor-not-allowed opacity-50":"cursor-pointer hover:text-muted-foreground";let N;e[7]!==i||e[8]!==P?(N=_e("relative flex items-center justify-center size-8 rounded-lg text-muted-foreground/75 transition-colors shrink-0",P,i),e[7]=i,e[8]=P,e[9]=N):N=e[9];let j;e[10]!==s?(j=s?o.jsx(et,{icon:s.icon,name:s.title,size:"sm",className:"absolute inset-0 size-full"}):o.jsxs(o.Fragment,{children:[o.jsxs("svg",{className:"absolute inset-0 size-full",fill:"none",children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"agent-border-gradient",gradientUnits:"userSpaceOnUse",x1:"0",y1:"0",x2:"32",y2:"32",children:[o.jsx("animateTransform",{attributeName:"gradientTransform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"6s",repeatCount:"indefinite"}),o.jsx("stop",{offset:"0%",stopColor:"var(--chart-1)"}),o.jsx("stop",{offset:"100%",stopColor:"var(--chart-4)"})]})}),o.jsx("rect",{x:"0.5",y:"0.5",width:"31",height:"31",rx:"7.5",stroke:"url(#agent-border-gradient)",strokeWidth:"1",strokeDasharray:"3 3"})]}),o.jsx(tr,{size:16})]}),e[10]=s,e[11]=j):j=e[11];let C;e[12]!==f||e[13]!==u||e[14]!==N||e[15]!==j?(C=o.jsx(Zt,{asChild:!0,children:o.jsx(qt,{asChild:!0,children:o.jsx("button",{type:"button",disabled:f,className:N,"aria-label":u,children:j})})}),e[12]=f,e[13]=u,e[14]=N,e[15]=j,e[16]=C):C=e[16];let E;e[17]!==h||e[18]!==s?.title||e[19]!==m?(E=m&&!h&&o.jsx(Jt,{side:"top",className:"text-xs",children:s?.title??"Choose an agent to chat with"}),e[17]=h,e[18]=s?.title,e[19]=m,e[20]=E):E=e[20];let M;e[21]!==C||e[22]!==E?(M=o.jsx(Kt,{children:o.jsxs(Yt,{children:[C,E]})}),e[21]=C,e[22]=E,e[23]=M):M=e[23];let B;e[24]!==w||e[25]!==r?(B=o.jsx(zt,{className:"w-[min(550px,calc(100vw-2rem))] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,collisionPadding:16,children:o.jsx(Ms,{selectedVirtualMcpId:r,onVirtualMcpChange:w,searchInputRef:y})}),e[24]=w,e[25]=r,e[26]=B):B=e[26];let V;return e[27]!==M||e[28]!==B||e[29]!==k||e[30]!==I?(V=o.jsxs(Gt,{open:k,onOpenChange:I,children:[M,B]}),e[27]=M,e[28]=B,e[29]=k,e[30]=I,e[31]=V):V=e[31],V}function Rs(t){const e=t.properties;if(!e)return!1;const r=e.__type,s=e.__binding;return!!(r?.const||s?.const)}function Ls(t){const e=t.properties;if(!e)return{};const r=e.__type,s=e.__binding;return{bindingType:r?.const,bindingSchema:s?.const}}function Hs(t){const e=U.c(10),{bindingSchema:r,bindingType:s,currentValue:n,onValueChange:i,placeholder:a,onAddNew:l,className:d}=t;let u;e[0]!==s?(u=Cs(s),e[0]=s,e[1]=u):u=e[1];const f=u??(typeof r=="string"?r:r??void 0);let h;return e[2]!==s||e[3]!==d||e[4]!==n||e[5]!==l||e[6]!==i||e[7]!==a||e[8]!==f?(h=o.jsx(Us,{value:n,onValueChange:i,placeholder:a,binding:f,bindingType:s,onAddNew:l,className:d}),e[2]=s,e[3]=d,e[4]=n,e[5]=l,e[6]=i,e[7]=a,e[8]=f,e[9]=h):h=e[9],h}function Us({value:t,onValueChange:e,placeholder:r="Select a connection...",binding:s,bindingType:n,onAddNew:i,className:a}){const[l,d]=F.useState(!1),{installByBinding:u,isInstalling:m}=Os(),f=l||m,h=s?void 0:n||void 0,x=Ot(s?{binding:s}:h?{filters:[{column:"app_name",value:h}]}:{}),y=Tt(t&&!x.some(g=>g.id===t)?t:void 0),b=y?[y,...x]:x,w=n?.startsWith("@"),S=async()=>{if(w&&n){d(!0);try{const g=await u(n);g&&e(g.id)}catch(g){const O=g instanceof Error?g.message:String(g);xe.error(`Failed to connect MCP: ${O}`)}finally{d(!1)}return}i?.()};return o.jsxs(Ht,{value:t,onValueChange:e,children:[o.jsx(Ut,{size:"sm",className:_e("w-[200px]",a),children:o.jsx($t,{placeholder:r})}),o.jsxs(Ft,{children:[b.length===0?o.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No connections found"}):b.map(g=>o.jsx(Bt,{value:g.id,children:o.jsxs("div",{className:"flex items-center gap-2",children:[g.icon?o.jsx("img",{src:g.icon,alt:g.title,className:"w-4 h-4 rounded"}):o.jsx("div",{className:"w-4 h-4 rounded bg-linear-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:g.title.slice(0,1).toUpperCase()}),o.jsx("span",{children:g.title})]})},g.id)),(i||w)&&o.jsx("div",{className:"border-t border-border",children:o.jsx(Ce,{onClick:g=>{g.preventDefault(),g.stopPropagation(),S()},disabled:f,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:f?o.jsxs(o.Fragment,{children:[o.jsx($e,{size:16,className:"animate-spin"}),o.jsx("span",{children:"Connecting..."})]}):o.jsxs(o.Fragment,{children:[o.jsx(Lt,{size:16}),o.jsx("span",{children:"Custom Connection"})]})})})]})]})}function $s(t){const e=U.c(49),{schema:r,formData:s,title:n,description:i,registry:a}=t,l=a.formContext,d=n||"",u=n||"";if(Rs(r)){const h=r;let x;e[0]!==h?(x=Ls(h),e[0]=h,e[1]=x):x=e[1];const{bindingType:y,bindingSchema:b}=x,S=(l?.formData?.[d]?.value??s?.value)||"";let g;e[2]!==y||e[3]!==d||e[4]!==l||e[5]!==s?(g=V=>{const W={...s,value:V??"",...y&&{__type:y}};l?.onFieldChange(d,W)},e[2]=y,e[3]=d,e[4]=l,e[5]=s,e[6]=g):g=e[6];const O=g,R=Bs;let L;e[7]!==u||e[8]!==d||e[9]!==n?(L=R(n||u||d),e[7]=u,e[8]=d,e[9]=n,e[10]=L):L=e[10];const k=L;if(y==="@deco/agent"){let V;e[11]!==k?(V=o.jsx("label",{className:"text-sm font-medium truncate block",children:k}),e[11]=k,e[12]=V):V=e[12];let W;e[13]!==i?(W=i&&o.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[13]=i,e[14]=W):W=e[14];let te;e[15]!==V||e[16]!==W?(te=o.jsxs("div",{className:"flex-1 min-w-0",children:[V,W]}),e[15]=V,e[16]=W,e[17]=te):te=e[17];const Ee=S||void 0;let re;e[18]!==O||e[19]!==Ee?(re=o.jsx(As,{selectedVirtualMcpId:Ee,onVirtualMcpChange:O,variant:"bordered",placeholder:"Select Agent",className:"w-[200px] shrink-0"}),e[18]=O,e[19]=Ee,e[20]=re):re=e[20];let be;return e[21]!==te||e[22]!==re?(be=o.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[te,re]}),e[21]=te,e[22]=re,e[23]=be):be=e[23],be}let I;e[24]!==k?(I=o.jsx("label",{className:"text-sm font-medium truncate block",children:k}),e[24]=k,e[25]=I):I=e[25];let P;e[26]!==i?(P=i&&o.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[26]=i,e[27]=P):P=e[27];let N;e[28]!==I||e[29]!==P?(N=o.jsxs("div",{className:"flex-1 min-w-0",children:[I,P]}),e[28]=I,e[29]=P,e[30]=N):N=e[30];let j;e[31]!==k?(j=k.toLowerCase(),e[31]=k,e[32]=j):j=e[32];const C=`Select ${j}...`;let E;e[33]!==l?(E=()=>l?.onAddNew(),e[33]=l,e[34]=E):E=e[34];let M;e[35]!==b||e[36]!==y||e[37]!==S||e[38]!==O||e[39]!==C||e[40]!==E?(M=o.jsx(Hs,{bindingSchema:b,bindingType:y,currentValue:S,onValueChange:O,placeholder:C,onAddNew:E,className:"w-[200px] shrink-0"}),e[35]=b,e[36]=y,e[37]=S,e[38]=O,e[39]=C,e[40]=E,e[41]=M):M=e[41];let B;return e[42]!==M||e[43]!==N?(B=o.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[N,M]}),e[42]=M,e[43]=N,e[44]=B):B=e[44],B}let m;e[45]!==t.properties?(m=t.properties.map(Fs),e[45]=t.properties,e[46]=m):m=e[46];let f;return e[47]!==m?(f=o.jsx("div",{className:"flex flex-col gap-4",children:m}),e[47]=m,e[48]=f):f=e[48],f}function Fs(t){return t.content}function Bs(t){return t.toLowerCase().replace(/_/g," ").replace(/\b\w/g,Ds)}function Ds(t){return t.toUpperCase()}function Vs(t){const e=U.c(13),{label:r,children:s,description:n,id:i,schema:a}=t;if(i.includes("__type")||i.includes("__binding"))return null;if(a.type==="object")return s;let l;e[0]!==i||e[1]!==r?(l=r&&o.jsx("label",{className:"text-sm font-medium truncate block",htmlFor:i,children:r}),e[0]=i,e[1]=r,e[2]=l):l=e[2];let d;e[3]!==n?(d=n&&o.jsx("div",{className:"text-xs text-muted-foreground truncate",children:n}),e[3]=n,e[4]=d):d=e[4];let u;e[5]!==l||e[6]!==d?(u=o.jsxs("div",{className:"flex-1 min-w-0",children:[l,d]}),e[5]=l,e[6]=d,e[7]=u):u=e[7];let m;e[8]!==s?(m=o.jsx("div",{className:"w-[200px] shrink-0",children:s}),e[8]=s,e[9]=m):m=e[9];let f;return e[10]!==u||e[11]!==m?(f=o.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[u,m]}),e[10]=u,e[11]=m,e[12]=f):f=e[12],f}const Ws={ObjectFieldTemplate:$s,FieldTemplate:Vs};function qs(t){const e=U.c(19),{formKey:r,formState:s,onFormStateChange:n,stateSchema:i}=t,{org:a}=Ue(),l=mt();let d;e[0]!==n?(d=g=>{g.formData&&n(g.formData)},e[0]=n,e[1]=d):d=e[1];const u=d;let m;e[2]!==s||e[3]!==n?(m=(g,O)=>{const R={...s,[g]:O};n(R)},e[2]=s,e[3]=n,e[4]=m):m=e[4];const f=m;let h;e[5]!==l||e[6]!==a?(h=()=>{l({to:"/$org/settings/connections",params:{org:a.slug},search:{action:"create"}})},e[5]=l,e[6]=a,e[7]=h):h=e[7];const x=h;let y;e[8]!==s||e[9]!==x||e[10]!==f?(y={onFieldChange:f,formData:s,onAddNew:x},e[8]=s,e[9]=x,e[10]=f,e[11]=y):y=e[11];const b=y;let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(o.Fragment,{}),e[12]=w):w=e[12];let S;return e[13]!==b||e[14]!==r||e[15]!==s||e[16]!==u||e[17]!==i?(S=o.jsx("div",{className:"flex flex-col h-full overflow-auto",children:o.jsx(Dt,{schema:i,validator:Vt,formData:s,onChange:u,formContext:b,liveValidate:!1,showErrorList:!1,templates:Ws,children:w},r)}),e[13]=b,e[14]=r,e[15]=s,e[16]=u,e[17]=i,e[18]=S):S=e[18],S}function zs(t){const e=U.c(14),{org:r}=Ue();let s;e[0]!==t||e[1]!==r.id||e[2]!==r.slug?(s={connectionId:t,orgId:r.id,orgSlug:r.slug},e[0]=t,e[1]=r.id,e[2]=r.slug,e[3]=s):s=e[3];const n=jt(s);let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i={},e[4]=i):i=e[4];let a;e[5]!==n?(a={client:n,toolName:"MCP_CONFIGURATION",toolArguments:i,select:Gs},e[5]=n,e[6]=a):a=e[6];const{data:l}=_t(a);let d;e[7]!==l.stateSchema?(d=l.stateSchema??{type:"object",properties:{}},e[7]=l.stateSchema,e[8]=d):d=e[8];const u=d;let m;e[9]!==l.scopes?(m=l.scopes??[],e[9]=l.scopes,e[10]=m):m=e[10];const f=m;let h;return e[11]!==f||e[12]!==u?(h={stateSchema:u,scopes:f},e[11]=f,e[12]=u,e[13]=h):h=e[13],h}function Gs(t){return t.structuredContent??t}function Js(t){const e=U.c(4),{onAuthenticate:r,buttonText:s}=t,n=s===void 0?"Authenticate":s;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h3",{className:"text-sm font-semibold",children:"Authentication Required"}),o.jsx("p",{className:"text-xs text-muted-foreground max-w-md text-center",children:"This connection requires OAuth authentication to access resources."})]}),e[0]=i):i=e[0];let a;return e[1]!==n||e[2]!==r?(a=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[i,o.jsx(Ce,{onClick:r,size:"default",children:n})]})}),e[1]=n,e[2]=r,e[3]=a):a=e[3],a}function Zs(t){const e=U.c(7),{hasReadme:r,onViewReadme:s}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=o.jsx(Et,{size:36,className:"text-muted-foreground"}),e[0]=n):n=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h3",{className:"text-sm font-semibold",children:"Manual Authentication Required"}),o.jsx("p",{className:"text-xs text-muted-foreground max-w-md text-center",children:"This server requires an API key or token that must be configured manually. Check the server's documentation for instructions on obtaining credentials."})]}),e[1]=i):i=e[1];let a;e[2]!==r||e[3]!==s?(a=r&&s&&o.jsxs(Ce,{onClick:s,variant:"outline",size:"lg",children:[o.jsx(Ct,{size:18,className:"mr-2"}),"View README"]}),e[2]=r,e[3]=s,e[4]=a):a=e[4];let l;return e[5]!==a?(l=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[n,i,a]})}),e[5]=a,e[6]=l):l=e[6],l}function Ks(){const t=U.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o.jsx("img",{src:"/empty-state-error.svg",alt:"",width:160,height:160,"aria-hidden":"true"}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[e,o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h3",{className:"text-lg font-semibold",children:"Server Error"}),o.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"The MCP server is currently experiencing issues. Please try again later or check the server's status."})]})]})}),t[1]=r):r=t[1],r}function Ys(t){const e=U.c(12),{connection:r,form:s}=t,{stateSchema:n}=zs(r.id);let i;e[0]!==s.control?(i={control:s.control,name:"configuration_state"},e[0]=s.control,e[1]=i):i=e[1];const a=pt(i);let l;e[2]!==s?(l=h=>{s.setValue("configuration_state",h,{shouldDirty:!0})},e[2]=s,e[3]=l):l=e[3];const d=l;if(!(n&&n.properties&&typeof n.properties=="object"&&Object.keys(n.properties).length>0)){let h;return e[4]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Xe,{image:o.jsx("img",{src:"/empty-state-success-muted.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),title:"This server is all set!",description:"No additional configuration is needed. Everything is ready to go."})}),e[4]=h):h=e[4],h}let m;e[5]!==a?(m=a??{},e[5]=a,e[6]=m):m=e[6];let f;return e[7]!==r.id||e[8]!==d||e[9]!==n||e[10]!==m?(f=o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(qs,{formKey:r.id,stateSchema:n,formState:m,onFormStateChange:d})}),e[7]=r.id,e[8]=d,e[9]=n,e[10]=m,e[11]=f):f=e[11],f}function Qs(t){const e=U.c(11),{connection:r,form:s,hasMcpBinding:n,isMCPAuthenticated:i,supportsOAuth:a,isServerError:l,onAuthenticate:d,onViewReadme:u}=t,f=!!r?.metadata?.repository?.url;if(!i){if(l){let b;return e[0]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(Ks,{}),e[0]=b):b=e[0],b}if(a){let b;return e[1]!==d?(b=o.jsx(Js,{onAuthenticate:d}),e[1]=d,e[2]=b):b=e[2],b}let y;return e[3]!==f||e[4]!==u?(y=o.jsx(Zs,{hasReadme:f,onViewReadme:u}),e[3]=f,e[4]=u,e[5]=y):y=e[5],y}if(!n){let y;return e[6]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(Xe,{image:o.jsx("img",{src:"/empty-state-success-muted.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),title:"This server is all set!",description:"No additional configuration is needed. Everything is ready to go."})}),e[6]=y):y=e[6],y}let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx($e,{size:32,className:"animate-spin text-muted-foreground"})}),e[7]=h):h=e[7];let x;return e[8]!==r||e[9]!==s?(x=o.jsx(ht,{children:o.jsx(F.Suspense,{fallback:h,children:o.jsx(Ys,{connection:r,form:s})})}),e[8]=r,e[9]=s,e[10]=x):x=e[10],x}function kn(t){const e=U.c(2);let r;return e[0]!==t?(r=o.jsx("div",{className:"flex-1 flex h-full",children:o.jsx(Qs,{...t})}),e[0]=t,e[1]=r):r=e[1],r}export{Zs as M,Js as O,kn as S,Tn as V,On as a,Nn as b,En as c};
@@ -1 +0,0 @@
1
- import{r as s,ai as L,a2 as B,j as d,bc as K,U as x,Z as E,ba as U,V as C,bb as _,Y as V,X as w,bK as q,bJ as T}from"./index-BkSIY6JJ.js";var I="Radio",[z,P]=w(I),[H,X]=z(I),k=s.forwardRef((t,c)=>{const{__scopeRadio:o,name:n,checked:e=!1,required:r,disabled:a,value:l="on",onCheck:f,form:R,...v}=t,[p,m]=s.useState(null),i=E(c,h=>m(h)),u=s.useRef(!1),b=p?R||!!p.closest("form"):!0;return d.jsxs(H,{scope:o,checked:e,disabled:a,children:[d.jsx(x.button,{type:"button",role:"radio","aria-checked":e,"data-state":A(e),"data-disabled":a?"":void 0,disabled:a,value:l,...v,ref:i,onClick:C(t.onClick,h=>{e||f?.(),b&&(u.current=h.isPropagationStopped(),u.current||h.stopPropagation())})}),b&&d.jsx(S,{control:p,bubbles:!u.current,name:n,value:l,checked:e,required:r,disabled:a,form:R,style:{transform:"translateX(-100%)"}})]})});k.displayName=I;var g="RadioIndicator",G=s.forwardRef((t,c)=>{const{__scopeRadio:o,forceMount:n,...e}=t,r=X(g,o);return d.jsx(V,{present:n||r.checked,children:d.jsx(x.span,{"data-state":A(r.checked),"data-disabled":r.disabled?"":void 0,...e,ref:c})})});G.displayName=g;var Y="RadioBubbleInput",S=s.forwardRef(({__scopeRadio:t,control:c,checked:o,bubbles:n=!0,...e},r)=>{const a=s.useRef(null),l=E(a,r),f=q(o),R=T(c);return s.useEffect(()=>{const v=a.current;if(!v)return;const p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==o&&i){const u=new Event("click",{bubbles:n});i.call(v,o),v.dispatchEvent(u)}},[f,o,n]),d.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:o,...e,tabIndex:-1,ref:l,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});S.displayName=Y;function A(t){return t?"checked":"unchecked"}var J=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],y="RadioGroup",[W]=w(y,[_,P]),j=_(),N=P(),[Z,Q]=W(y),D=s.forwardRef((t,c)=>{const{__scopeRadioGroup:o,name:n,defaultValue:e,value:r,required:a=!1,disabled:l=!1,orientation:f,dir:R,loop:v=!0,onValueChange:p,...m}=t,i=j(o),u=L(R),[b,h]=B({prop:r,defaultProp:e??null,onChange:p,caller:y});return d.jsx(Z,{scope:o,name:n,required:a,disabled:l,value:b,onValueChange:h,children:d.jsx(K,{asChild:!0,...i,orientation:f,dir:u,loop:v,children:d.jsx(x.div,{role:"radiogroup","aria-required":a,"aria-orientation":f,"data-disabled":l?"":void 0,dir:u,...m,ref:c})})})});D.displayName=y;var M="RadioGroupItem",O=s.forwardRef((t,c)=>{const{__scopeRadioGroup:o,disabled:n,...e}=t,r=Q(M,o),a=r.disabled||n,l=j(o),f=N(o),R=s.useRef(null),v=E(c,R),p=r.value===e.value,m=s.useRef(!1);return s.useEffect(()=>{const i=b=>{J.includes(b.key)&&(m.current=!0)},u=()=>m.current=!1;return document.addEventListener("keydown",i),document.addEventListener("keyup",u),()=>{document.removeEventListener("keydown",i),document.removeEventListener("keyup",u)}},[]),d.jsx(U,{asChild:!0,...l,focusable:!a,active:p,children:d.jsx(k,{disabled:a,required:r.required,checked:p,...f,...e,name:r.name,ref:v,onCheck:()=>r.onValueChange(e.value),onKeyDown:C(i=>{i.key==="Enter"&&i.preventDefault()}),onFocus:C(e.onFocus,()=>{m.current&&R.current?.click()})})})});O.displayName=M;var $="RadioGroupIndicator",F=s.forwardRef((t,c)=>{const{__scopeRadioGroup:o,...n}=t,e=N(o);return d.jsx(G,{...e,...n,ref:c})});F.displayName=$;var oe=D,re=O,te=F;export{re as I,oe as R,te as a};