decocms 4.427.3 → 4.427.4

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 (351) hide show
  1. package/dist/client/assets/{AlertCircle-LgH1QoTd.js → AlertCircle-CPQSuuWk.js} +1 -1
  2. package/dist/client/assets/{AreaChart-nTxNjdUo.js → AreaChart-BKxeqcvu.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DXn8x-hc.js → ArrowLeft-Bvd89_b4.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-DMcFYEQV.js → ArrowRight-n-IJ4Fik.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-hOT7zM5c.js → ArrowUp-BTBhPpEu.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-CNpA5Q-x.js → CartesianChart-Ba_8acEa.js} +1 -1
  7. package/dist/client/assets/{Check-CJBdxo1x.js → Check-CP73h7yQ.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-B2FtFP_M.js → CheckCircle-BpnJdBCF.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-JJQ1R76T.js → ChevronUp-CIZg0YhK.js} +1 -1
  10. package/dist/client/assets/{Copy01-DLl7IkAX.js → Copy01-YoGcseNZ.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-BvqpwW9d.js → CreditCard01-C-9IP3Dn.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-CfCl81oT.js → DotsVertical-_UiBrHHr.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-BywYAHQQ.js → ErrorBarContext-CtWkO946.js} +1 -1
  14. package/dist/client/assets/{Image01-ChZ5ec4B.js → Image01-C_d_m-XY.js} +1 -1
  15. package/dist/client/assets/{Key01-DJ4Ph9An.js → Key01-Di5njQWH.js} +1 -1
  16. package/dist/client/assets/{Line-ahq5Dv8y.js → Line-2NdbZbdQ.js} +1 -1
  17. package/dist/client/assets/{Link01-D9SeIlWM.js → Link01-BzReMq2w.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-wpbajNPV.js → LinkExternal01-CuSjyiN1.js} +1 -1
  19. package/dist/client/assets/{Monitor01-CldPGi5G.js → Monitor01-C8qvsEmS.js} +1 -1
  20. package/dist/client/assets/{Palette-D5Dmn1Mg.js → Palette-edCnzPtR.js} +1 -1
  21. package/dist/client/assets/{Plus-CoCopPFe.js → Plus-BPVcSaQ1.js} +1 -1
  22. package/dist/client/assets/{SearchMd-D_gFR8gZ.js → SearchMd-CQ_uV2jU.js} +1 -1
  23. package/dist/client/assets/{Sector-CiAU2uLo.js → Sector-UvElOWGp.js} +1 -1
  24. package/dist/client/assets/{ShoppingBag01-Dv73R-S1.js → ShoppingBag01-DskCGm9K.js} +1 -1
  25. package/dist/client/assets/{Sun-Ck9W5L0l.js → Sun-CPwiYds_.js} +1 -1
  26. package/dist/client/assets/{Tool01-Cmx87k3R.js → Tool01-Cr3g7eFI.js} +1 -1
  27. package/dist/client/assets/{Trash01-Cn3n-zZO.js → Trash01-DsSqN_Va.js} +1 -1
  28. package/dist/client/assets/{Upload01-DGQb_EA3.js → Upload01-CsCOoftz.js} +1 -1
  29. package/dist/client/assets/{User01-Cf1Q03zT.js → User01-CFCaTmZh.js} +1 -1
  30. package/dist/client/assets/{UserSquare-Dbf0yjYU.js → UserSquare-k-BSPAbI.js} +1 -1
  31. package/dist/client/assets/{Users01-DlQODEmu.js → Users01-DeynvlqM.js} +1 -1
  32. package/dist/client/assets/{X-C31L8F55.js → X-srLHGSHt.js} +1 -1
  33. package/dist/client/assets/{XAxis-CKLs9YQe.js → XAxis-BjWqcwD8.js} +1 -1
  34. package/dist/client/assets/{XClose-e3DY7fD7.js → XClose-DeW6TQBh.js} +1 -1
  35. package/dist/client/assets/{ZoomOut-gxmwr3p2.js → ZoomOut-Dv2fO7S6.js} +1 -1
  36. package/dist/client/assets/{access-gate-C9TGkMuV.js → access-gate-B3mORPKI.js} +1 -1
  37. package/dist/client/assets/{add-connection-dialog-De-dU7Sc.js → add-connection-dialog-BcjdUiaQ.js} +1 -1
  38. package/dist/client/assets/{agent-analytics-CG_RWDE0.js → agent-analytics-CKV0hDyk.js} +1 -1
  39. package/dist/client/assets/agent-app-BFOjtgCv.js +1 -0
  40. package/dist/client/assets/{agent-assets-CTQdq_7C.js → agent-assets-CdbsBbCR.js} +1 -1
  41. package/dist/client/assets/{agent-automation-B48W_kZA.js → agent-automation-B4U-RCdw.js} +1 -1
  42. package/dist/client/assets/{agent-automations--9OwScw6.js → agent-automations-BofxR-p6.js} +1 -1
  43. package/dist/client/assets/{agent-connect-sources-D4naxmLm.js → agent-connect-sources-DVCassCM.js} +1 -1
  44. package/dist/client/assets/agent-deck-CzBl7ZXg.js +1 -0
  45. package/dist/client/assets/{agent-e2e-nsCxCgZH.js → agent-e2e-wt_yRGNI.js} +1 -1
  46. package/dist/client/assets/{agent-experiments-DbsZWcDI.js → agent-experiments-DDuThSIz.js} +1 -1
  47. package/dist/client/assets/{agent-file-CFmKPE3z.js → agent-file-B32pX_Mg.js} +1 -1
  48. package/dist/client/assets/{agent-git-DOOK3AWw.js → agent-git-Bo65C6U1.js} +1 -1
  49. package/dist/client/assets/{agent-hosting-C1_sfMLQ.js → agent-hosting-EBCxvgo5.js} +1 -1
  50. package/dist/client/assets/{agent-icon-DOuarSUR.js → agent-icon-Dnnu07Dp.js} +1 -1
  51. package/dist/client/assets/agent-library-cQi5KYsD.js +1 -0
  52. package/dist/client/assets/agent-library-file-sn2mdwoo.js +1 -0
  53. package/dist/client/assets/{agent-monitor-BlgXKjRG.js → agent-monitor-Q5jbBFc5.js} +1 -1
  54. package/dist/client/assets/{agent-overview-DZp1e5nc.js → agent-overview-jkrc4Z5H.js} +1 -1
  55. package/dist/client/assets/agent-settings-5TJZgZyU.js +1 -0
  56. package/dist/client/assets/{agent-site-editor-DZF_4RiJ.js → agent-site-editor-C243VRJF.js} +1 -1
  57. package/dist/client/assets/agent-site-editor-code-Ci_MsG4X.js +2 -0
  58. package/dist/client/assets/{agent-site-editor-content-lQkJiJ4D.js → agent-site-editor-content-Bsy-qFwp.js} +3 -3
  59. package/dist/client/assets/{agent-site-editor-preview-BrZsP1dl.js → agent-site-editor-preview-BmdmZr27.js} +3 -3
  60. package/dist/client/assets/{agent-view-guard-BfjHuZPk.js → agent-view-guard-CDZZYqXI.js} +1 -1
  61. package/dist/client/assets/agent-view-tmUFFOC3.js +1 -0
  62. package/dist/client/assets/{agents-list-DiGjU-95.js → agents-list-nBgdBAsA.js} +1 -1
  63. package/dist/client/assets/{ai-providers-Bymg50bM.js → ai-providers-D2D5FHP_.js} +1 -1
  64. package/dist/client/assets/{alert-dialog-HXdE5Gnc.js → alert-dialog-BFZCPfXf.js} +1 -1
  65. package/dist/client/assets/{alert-Dmahyhuy.js → alert-yU0z8SHT.js} +1 -1
  66. package/dist/client/assets/{analytics-sections-t4olf6Qe.js → analytics-sections-r7g_2PI9.js} +1 -1
  67. package/dist/client/assets/api-keys-BzobvLd_.js +1 -0
  68. package/dist/client/assets/{api-keys-C8JA05v4.js → api-keys-Dq_Ir7lG.js} +1 -1
  69. package/dist/client/assets/{app-editor-31GxTBfl.js → app-editor-BbrLoyhg.js} +1 -1
  70. package/dist/client/assets/{asset-utils-CmEiE9Uc.js → asset-utils-DUl4MpZE.js} +1 -1
  71. package/dist/client/assets/{auth-CEDbnarF.js → auth-DYiVP7MT.js} +1 -1
  72. package/dist/client/assets/{auth-catchall-Bw98HcCS.js → auth-catchall-PWrNJU9a.js} +1 -1
  73. package/dist/client/assets/{auth-entry-BguAYTmy.js → auth-entry-DXkRq0Vo.js} +1 -1
  74. package/dist/client/assets/{auth-split-layout-CN2cfVXP.js → auth-split-layout-CmGSwYw9.js} +1 -1
  75. package/dist/client/assets/{authenticate-and-persist-oauth-NS0ShRS6.js → authenticate-and-persist-oauth-Fhu72ZVZ.js} +1 -1
  76. package/dist/client/assets/{automation-list-row-B5awWkGX.js → automation-list-row-Cws0Y7Xb.js} +1 -1
  77. package/dist/client/assets/{automation-runs-CqpMal_k.js → automation-runs-2uHfD8tk.js} +1 -1
  78. package/dist/client/assets/{automations-D1uwssbO.js → automations-D3LKcXfl.js} +1 -1
  79. package/dist/client/assets/{autosend-D5CvCJ-i.js → autosend-DdEs0_Ox.js} +1 -1
  80. package/dist/client/assets/{avatar-u_MWZIGi.js → avatar-IYCAP9D4.js} +1 -1
  81. package/dist/client/assets/{badge-BX9BIMvF.js → badge-Bx-goeTE.js} +1 -1
  82. package/dist/client/assets/{block-document-BLnHrDch.js → block-document-CudYy7pf.js} +1 -1
  83. package/dist/client/assets/{blocks-preview-workspace-context-Cdg4ibbN.js → blocks-preview-workspace-context-CZgMFcZn.js} +1 -1
  84. package/dist/client/assets/{buckets-CWJprjfJ.js → buckets-CTjUYDpA.js} +1 -1
  85. package/dist/client/assets/{build-improve-prompt-doc-Damnk5Ex.js → build-improve-prompt-doc-sqppqftt.js} +1 -1
  86. package/dist/client/assets/{calendar-jhyZLBMo.js → calendar-Da7EzsC_.js} +1 -1
  87. package/dist/client/assets/{capability-load-error-CcDe-fRB.js → capability-load-error-CW18N_J-.js} +1 -1
  88. package/dist/client/assets/{category-editor-CWwBDlse.js → category-editor-SDdqVzYD.js} +1 -1
  89. package/dist/client/assets/{chart-B2y-kKQ0.js → chart-CUr_Oc7J.js} +1 -1
  90. package/dist/client/assets/{chat-context-BwDW_kfn.js → chat-context-DON-iHtd.js} +1 -1
  91. package/dist/client/assets/{chat-draft-Cl-wTCCT.js → chat-draft-DMzZaSVw.js} +1 -1
  92. package/dist/client/assets/{checkbox-BSRHWuev.js → checkbox-tfdkp6cA.js} +1 -1
  93. package/dist/client/assets/{choose-editor-C8WO_xUV.js → choose-editor-DLtNSxee.js} +1 -1
  94. package/dist/client/assets/{claim-phase-copy-lXnLa3JE.js → claim-phase-copy-DR8vjdW9.js} +1 -1
  95. package/dist/client/assets/{cli-auth-success-kkM7ps-e.js → cli-auth-success-Bkluc_U5.js} +1 -1
  96. package/dist/client/assets/{client-icons-BGQmYdos.js → client-icons-CSURvWnQ.js} +1 -1
  97. package/dist/client/assets/{collapsible-D2v2kHCp.js → collapsible-EbSIRvil.js} +1 -1
  98. package/dist/client/assets/{collection-detail-D00QEuKM.js → collection-detail-C2v6Molb.js} +1 -1
  99. package/dist/client/assets/{collection-display-button-Dhq5dlaG.js → collection-display-button-fQZLsPPw.js} +1 -1
  100. package/dist/client/assets/{collection-search-Ab7KDawL.js → collection-search-DshGdcb0.js} +1 -1
  101. package/dist/client/assets/{collection-table-wrapper-auQPNSDA.js → collection-table-wrapper-DHFOBwKW.js} +1 -1
  102. package/dist/client/assets/{collection-tabs-CWG2Ssug.js → collection-tabs-DZ5NL0dm.js} +1 -1
  103. package/dist/client/assets/{combobox-BjW-E7gd.js → combobox-1x_gJLmD.js} +1 -1
  104. package/dist/client/assets/{command-CbOwtpAb.js → command-CGV8_1wr.js} +1 -1
  105. package/dist/client/assets/{companion-mcps-section-DybN6E44.js → companion-mcps-section-DBilles0.js} +1 -1
  106. package/dist/client/assets/{config-cjO0ec13.js → config-BQUS_r3B.js} +1 -1
  107. package/dist/client/assets/{connect-CZQuBtcR.js → connect-BTbCanHU.js} +1 -1
  108. package/dist/client/assets/{connect-layout-9t7Rh7Vh.js → connect-layout-DEXuG2Yo.js} +1 -1
  109. package/dist/client/assets/{connection-BQHh86t6.js → connection-DUhRStgE.js} +1 -1
  110. package/dist/client/assets/{connection-card-CXVlnV9x.js → connection-card-CLQNp13z.js} +1 -1
  111. package/dist/client/assets/{connection-detail-DgOWvKok.js → connection-detail-BtJmkvpf.js} +1 -1
  112. package/dist/client/assets/{connection-form-helpers-D8c6nuwN.js → connection-form-helpers-DSaYnQN2.js} +1 -1
  113. package/dist/client/assets/{connections-9NgRVJC2.js → connections-D96n_qp_.js} +1 -1
  114. package/dist/client/assets/{context-Ux9G6xnM.js → context-BGRn957C.js} +1 -1
  115. package/dist/client/assets/{context-menu-wSg2GQJ1.js → context-menu-CQbUe-ra.js} +1 -1
  116. package/dist/client/assets/{create-organization-dialog-CjXfUzzS.js → create-organization-dialog-kLzAxj94.js} +1 -1
  117. package/dist/client/assets/{daily-pulse-C_TjVQs3.js → daily-pulse-Cd1z4FAa.js} +1 -1
  118. package/dist/client/assets/{decopilot-C2SQZxBZ.js → decopilot-0B-Wngp1.js} +1 -1
  119. package/dist/client/assets/{dialog-BTrZTHUg.js → dialog-CETaaDWs.js} +1 -1
  120. package/dist/client/assets/{discover-CDQBWF3f.js → discover-B-ilIHMP.js} +1 -1
  121. package/dist/client/assets/{domain-settings-DWNXcUq-.js → domain-settings-BslLFOdM.js} +1 -1
  122. package/dist/client/assets/{download-app-dialog-rxkHUuQW.js → download-app-dialog-8Rp12cmh.js} +1 -1
  123. package/dist/client/assets/{drawer-D0MZ4mo1.js → drawer-BWFufjc5.js} +1 -1
  124. package/dist/client/assets/{editor-CZNcI_SV.js → editor-DCdz0KkZ.js} +1 -1
  125. package/dist/client/assets/{empty-state-2J_TOd9y.js → empty-state-C1nhEd0-.js} +1 -1
  126. package/dist/client/assets/{empty-state-C0rOaw8I.js → empty-state-CCrjb95L.js} +1 -1
  127. package/dist/client/assets/{extract-connection-data-BoNYfZov.js → extract-connection-data-CMpFLKxZ.js} +1 -1
  128. package/dist/client/assets/{feature-gate-CYQFZ14_.js → feature-gate-BFpFz5qO.js} +1 -1
  129. package/dist/client/assets/{feature-paywall-BwzbgDQ2.js → feature-paywall-C4yY8Ib4.js} +1 -1
  130. package/dist/client/assets/{file-explorer-BeLwDfpq.js → file-explorer-CdDjQr7g.js} +1 -1
  131. package/dist/client/assets/{file-preview-DK64AFJA.js → file-preview-C_o5YOlI.js} +1 -1
  132. package/dist/client/assets/{file-share-button-B8UXgZpv.js → file-share-button-BFkhjbuE.js} +1 -1
  133. package/dist/client/assets/{file-type-icon-DKVj9WdW.js → file-type-icon-BOUS9AkT.js} +1 -1
  134. package/dist/client/assets/flat-project-QmHgVWcO.js +1 -0
  135. package/dist/client/assets/{folder-icon-BAqwN8FW.js → folder-icon-NO1Kx9J0.js} +1 -1
  136. package/dist/client/assets/{form-8UJeqUiI.js → form-0lcPxUaV.js} +1 -1
  137. package/dist/client/assets/{gateway-client-Bdpr8BZh.js → gateway-client-l5gwlcsP.js} +1 -1
  138. package/dist/client/assets/{general-BF-C0Z12.js → general-RK-Z5buE.js} +1 -1
  139. package/dist/client/assets/{home-DJCEpQ02.js → home-CKLboulk.js} +1 -1
  140. package/dist/client/assets/{icon-button-CF7hoaxW.js → icon-button-6nUT6iDC.js} +1 -1
  141. package/dist/client/assets/{index-BWB9RQBb.js → index-5wKgIWMb.js} +1 -1
  142. package/dist/client/assets/{index-DZb2klda.js → index-B937Cf7T.js} +1 -1
  143. package/dist/client/assets/{index-DmYJaTVV.js → index-BfVD2brg.js} +1 -1
  144. package/dist/client/assets/{index-Cmc1gJKg.js → index-Bj1jqTBk.js} +1 -1
  145. package/dist/client/assets/{index-CF33tV9H.js → index-BkwVGG61.js} +2 -2
  146. package/dist/client/assets/{index-Vjru0x-d.js → index-CTHyXtAa.js} +1 -1
  147. package/dist/client/assets/{index-C-POkbWx.js → index-Cryf-8qU.js} +1 -1
  148. package/dist/client/assets/{index-DsGrUBDn.js → index-DRXNkaTh.js} +3 -3
  149. package/dist/client/assets/{index-C-EzIAGn.js → index-DaTxyVef.js} +1 -1
  150. package/dist/client/assets/{index-spGJzdyg.js → index-Ds19ODXY.js} +1 -1
  151. package/dist/client/assets/{index-76SxZk_X.js → index-DsOjhcBf.js} +1 -1
  152. package/dist/client/assets/{index-CxrCNzwL.js → index-Dw4oNOsw.js} +1 -1
  153. package/dist/client/assets/{index-1AIxMAAv.js → index-QMMagPPL.js} +1 -1
  154. package/dist/client/assets/{index-xbjCfbu7.js → index-cy7uuLPR.js} +1 -1
  155. package/dist/client/assets/{index-CRkgh-05.js → index-jlKQueRg.js} +1 -1
  156. package/dist/client/assets/{index-redirect-DSYHpybA.js → index-redirect-Dq7SWXpC.js} +1 -1
  157. package/dist/client/assets/{infiniteQueryObserver-B2NoY_fE.js → infiniteQueryObserver-Da-u5q9x.js} +1 -1
  158. package/dist/client/assets/{infra-billing-DkJvW3iq.js → infra-billing-4atOBTNp.js} +1 -1
  159. package/dist/client/assets/{input-AjjN82QQ.js → input-BC8VVwvY.js} +1 -1
  160. package/dist/client/assets/{input-CfFpcyV7.js → input-BdWjJobT.js} +3 -3
  161. package/dist/client/assets/{input-yaPbdNpf.js → input-C7EfrFTT.js} +1 -1
  162. package/dist/client/assets/{integration-icon-DP9NSovP.js → integration-icon-B3X6G1Wg.js} +1 -1
  163. package/dist/client/assets/{label-BbaxSm2e.js → label-1zPphAKx.js} +1 -1
  164. package/dist/client/assets/{last-preview-page-JBlzHOgO.js → last-preview-page-cK2MEC8D.js} +1 -1
  165. package/dist/client/assets/{layout-knRlbNSK.js → layout-DHJPER-7.js} +1 -1
  166. package/dist/client/assets/{legacy-agents-deep-UdzPgZRs.js → legacy-agents-deep-BsoSPgFz.js} +1 -1
  167. package/dist/client/assets/{legacy-main-redirect-CHPpwdRi.js → legacy-main-redirect-ChGBy0pr.js} +1 -1
  168. package/dist/client/assets/library-C3wY5IDS.js +1 -0
  169. package/dist/client/assets/{library-tab-CflDoRvR.js → library-tab-DeBKrgJg.js} +1 -1
  170. package/dist/client/assets/{login-w4_pWNqb.js → login-C0riyamj.js} +1 -1
  171. package/dist/client/assets/{markdown-Bgy5OrzQ.js → markdown-CzQeLeJo.js} +1 -1
  172. package/dist/client/assets/{mcp-app-renderer-CFF7AAUa.js → mcp-app-renderer-DGp0KYfs.js} +1 -1
  173. package/dist/client/assets/{mcp-oauth-BzBo_-Jy.js → mcp-oauth-C_AhA8BD.js} +1 -1
  174. package/dist/client/assets/{members-DKbvdexc.js → members-wD81k9VR.js} +1 -1
  175. package/dist/client/assets/{message-templates-FmZnnh3p.js → message-templates-Bz6YUiFR.js} +1 -1
  176. package/dist/client/assets/{mini-report-page-BnFWPj1C.js → mini-report-page-xC-b4ikd.js} +1 -1
  177. package/dist/client/assets/{mock-board-BCoIiT3t.js → mock-board-BDB7iXmu.js} +1 -1
  178. package/dist/client/assets/{monaco-editor-DQWxb8wg.js → monaco-editor-DknCndmN.js} +1 -1
  179. package/dist/client/assets/{monitoring-stats-row-XCQkGjEK.js → monitoring-stats-row-hrEvYAfu.js} +1 -1
  180. package/dist/client/assets/{multi-select-CcYIvmDR.js → multi-select-BldQfs4n.js} +1 -1
  181. package/dist/client/assets/{mustache-CdtnXA29.js → mustache-myD7wuI4.js} +1 -1
  182. package/dist/client/assets/{new-project-dialog-Bakb8W9y.js → new-project-dialog-CSocvB7L.js} +1 -1
  183. package/dist/client/assets/{oauth-callback-ai-provider-Byb3zpPg.js → oauth-callback-ai-provider-CiMFOAgr.js} +1 -1
  184. package/dist/client/assets/{oauth-callback-DkNp0t-_.js → oauth-callback-onJRIxdw.js} +1 -1
  185. package/dist/client/assets/{onboarding-D37ykwLO.js → onboarding-CrRJG04Q.js} +1 -1
  186. package/dist/client/assets/openai-conversation-C-qWjUGl.js +3 -0
  187. package/dist/client/assets/{optimistic-project-sidebar-views-ecBjPgL5.js → optimistic-project-sidebar-views-CMDmsGJV.js} +1 -1
  188. package/dist/client/assets/{org-file-open-context-U3fQRmd6.js → org-file-open-context-B35TDcCu.js} +1 -1
  189. package/dist/client/assets/{organization-choice-ZGqdbIdJ.js → organization-choice-Bs9ulFE-.js} +1 -1
  190. package/dist/client/assets/{orgs-TnGNXtmZ.js → orgs-JD0iC6HY.js} +1 -1
  191. package/dist/client/assets/{page-seo-form-uBcIOZzO.js → page-seo-form-CTgmdwJ8.js} +1 -1
  192. package/dist/client/assets/{pair-B9vgkujD.js → pair-Bg6eSzpi.js} +1 -1
  193. package/dist/client/assets/{plan-ladder-C4jLq8gJ.js → plan-ladder-CDdTsNd1.js} +1 -1
  194. package/dist/client/assets/{popover-DN_kN9Uf.js → popover-CmYWPOzN.js} +1 -1
  195. package/dist/client/assets/{post-calendar-BOHVV9jx.js → post-calendar-ByuVszdB.js} +1 -1
  196. package/dist/client/assets/{post-editor-DVWD2-YL.js → post-editor-DtruhQnc.js} +1 -1
  197. package/dist/client/assets/{preview-content-gCXONmKY.js → preview-content-BQkGg4d0.js} +1 -1
  198. package/dist/client/assets/{preview-dialog-CFWBgSUu.js → preview-dialog-DcCFcBh7.js} +1 -1
  199. package/dist/client/assets/{profile-Dmk0HG2j.js → profile-DkcT6VXV.js} +1 -1
  200. package/dist/client/assets/{project-app-view-CuKYEErt.js → project-app-view-C0egNxXw.js} +1 -1
  201. package/dist/client/assets/{project-feed-DEi8rhF-.js → project-feed-BiP37r-A.js} +1 -1
  202. package/dist/client/assets/{project-icon-BkqkP7nf.js → project-icon-BNmVQ8L_.js} +1 -1
  203. package/dist/client/assets/project-reports-DZVcP-kH.js +1 -0
  204. package/dist/client/assets/project-tasks-DcGDTMZk.js +1 -0
  205. package/dist/client/assets/{projects-z4rvDAJj.js → projects-DUdfK2n3.js} +1 -1
  206. package/dist/client/assets/{projects-empty-state-HdBVfNER.js → projects-empty-state-ZlqTL85m.js} +1 -1
  207. package/dist/client/assets/{prompts-oCi4D2Yn.js → prompts-D7l3ZBvl.js} +1 -1
  208. package/dist/client/assets/record-editor-BRIfWSyG.js +1 -0
  209. package/dist/client/assets/{redirect-editor-zzKZ_yFT.js → redirect-editor-CcNVHhk0.js} +1 -1
  210. package/dist/client/assets/{reports-Bsjf3cGo.js → reports-CFlpMLMU.js} +1 -1
  211. package/dist/client/assets/reports-DJs1HSu3.js +1 -0
  212. package/dist/client/assets/{reports-onboarding-CCr9AwWY.js → reports-onboarding-DOel7yM5.js} +1 -1
  213. package/dist/client/assets/{reports-tab-DHn13A7k.js → reports-tab-DSXBJ6j9.js} +2 -2
  214. package/dist/client/assets/{repositories-Bvm8OkRO.js → repositories-BlDNOXEU.js} +1 -1
  215. package/dist/client/assets/{repository-binding-BoCSsnZc.js → repository-binding-B1w5M3gR.js} +1 -1
  216. package/dist/client/assets/{repository-import-picker-BVazJzzA.js → repository-import-picker-DF4pGbwe.js} +1 -1
  217. package/dist/client/assets/{repository-picker-8D1UXDg3.js → repository-picker-DgFy3-3l.js} +1 -1
  218. package/dist/client/assets/{require-capability-DguXasWW.js → require-capability-BnsT5PDo.js} +1 -1
  219. package/dist/client/assets/{required-auth-layout-RbAoR6Yn.js → required-auth-layout-BY0JzfRF.js} +1 -1
  220. package/dist/client/assets/{reset-password-Bpw_zifE.js → reset-password-PfCZuD9G.js} +1 -1
  221. package/dist/client/assets/{resizable-DSTf149y.js → resizable-CVSfaXZw.js} +1 -1
  222. package/dist/client/assets/{resolve-tab-icon-Bxf16ZwD.js → resolve-tab-icon-D1OGWrhZ.js} +1 -1
  223. package/dist/client/assets/{review-settings-BK16Nzk_.js → review-settings-q73Hh01R.js} +1 -1
  224. package/dist/client/assets/{rich-text-link-control-DHPpV00b.js → rich-text-link-control-YXgXuHt3.js} +1 -1
  225. package/dist/client/assets/{roles-Bjd0yuor.js → roles-Dr-FnL5J.js} +1 -1
  226. package/dist/client/assets/{route-BpcxVoRm.js → route-Bp5MJKr5.js} +1 -1
  227. package/dist/client/assets/{route-fNfrD2eG.js → route-CJXhitv7.js} +1 -1
  228. package/dist/client/assets/route-DN5ECAHy.js +1 -0
  229. package/dist/client/assets/{runnable-block-editor-Col2LSMj.js → runnable-block-editor-DSW-0LCr.js} +1 -1
  230. package/dist/client/assets/{sandbox-lifecycle-context-DAbyS7JV.js → sandbox-lifecycle-context-D2n8i5Gu.js} +1 -1
  231. package/dist/client/assets/{schema-CCD4YccI.js → schema-DvklMLx3.js} +1 -1
  232. package/dist/client/assets/{scroll-area-DM1jN7ke.js → scroll-area-BVufpFEW.js} +1 -1
  233. package/dist/client/assets/{search-input-Dx_18pro.js → search-input-BUOZ4kam.js} +1 -1
  234. package/dist/client/assets/{search-toggle-BMSaJG7T.js → search-toggle-C_JkVd8s.js} +1 -1
  235. package/dist/client/assets/{secret-picker-BLHfDxBo.js → secret-picker-D8pSURig.js} +1 -1
  236. package/dist/client/assets/{secrets-6pAliXgF.js → secrets-B8mqBann.js} +1 -1
  237. package/dist/client/assets/{sections-editor-DhpxII9P.js → sections-editor-BTaByHjs.js} +1 -1
  238. package/dist/client/assets/{select-BcXaErmA.js → select-Bk77xGJr.js} +1 -1
  239. package/dist/client/assets/{select-model-BNgkxljj.js → select-model-CiJwtYy9.js} +1 -1
  240. package/dist/client/assets/{seo-editor-8b-CJKFm.js → seo-editor-BohrAqqO.js} +1 -1
  241. package/dist/client/assets/{separator-CEzjtG6-.js → separator-BvzthCPi.js} +1 -1
  242. package/dist/client/assets/{settings-tab-Ca-N-XEW.js → settings-tab-BzkB1T3I.js} +1 -1
  243. package/dist/client/assets/{sheet-BQj61VK7.js → sheet-DdorBPzD.js} +1 -1
  244. package/dist/client/assets/{shell-layout-CrZ2-6Ce.js → shell-layout-DOQLZ3dZ.js} +1 -1
  245. package/dist/client/assets/{skills-BbSvA9id.js → skills-D-IDyzrA.js} +1 -1
  246. package/dist/client/assets/{sso-DvC-OMNQ.js → sso-81Vm6orn.js} +1 -1
  247. package/dist/client/assets/{suggestion-KDtRzygk.js → suggestion-DIcqp-mJ.js} +1 -1
  248. package/dist/client/assets/{switch-Dq_tuvKa.js → switch-DwnLjlqL.js} +1 -1
  249. package/dist/client/assets/{synced-repos-BjPrHp4f.js → synced-repos-C3FNmB7n.js} +1 -1
  250. package/dist/client/assets/{tab-icon-glyph-XPSqhFC7.js → tab-icon-glyph-DC_q_J1n.js} +1 -1
  251. package/dist/client/assets/{table-CLm3Vp87.js → table-CDYgRw2s.js} +1 -1
  252. package/dist/client/assets/{tabs-Ej7qM1mE.js → tabs-2VLLco4y.js} +1 -1
  253. package/dist/client/assets/{task-board-Bd0mg36M.js → task-board-C6ymciPp.js} +1 -1
  254. package/dist/client/assets/{task-route-CRC8grXh.js → task-route-CaJcZGh-.js} +1 -1
  255. package/dist/client/assets/{task-status-D-8U0vLp.js → task-status-DHBSX2mE.js} +1 -1
  256. package/dist/client/assets/{taskboard-analytics-CO2xmo5W.js → taskboard-analytics-dVsJ8ut7.js} +1 -1
  257. package/dist/client/assets/tasks-DIpH-que.js +1 -0
  258. package/dist/client/assets/{tasks-DoB3AtOX.js → tasks-DPtIBjSy.js} +1 -1
  259. package/dist/client/assets/{textarea-BCrT32Yf.js → textarea-DqtOZ_En.js} +1 -1
  260. package/dist/client/assets/{thread-analytics-sFdRkUQb.js → thread-analytics-D__8lYtr.js} +1 -1
  261. package/dist/client/assets/{thread-intent-CKwVWoUw.js → thread-intent-Dv0pFBsV.js} +1 -1
  262. package/dist/client/assets/{thread-route-CRN5C0rz.js → thread-route-BZugAEv3.js} +1 -1
  263. package/dist/client/assets/{thread-route-r92j2DQk.js → thread-route-ycmuVhFr.js} +1 -1
  264. package/dist/client/assets/{thread-sheet-body-BZ08Szwl.js → thread-sheet-body-CTvxuNl1.js} +1 -1
  265. package/dist/client/assets/{toggle-group-BG3uQJT1.js → toggle-group-BeacaAeg.js} +1 -1
  266. package/dist/client/assets/{toolbar-icon-button-WdsBB5ag.js → toolbar-icon-button-CLDPbOoA.js} +1 -1
  267. package/dist/client/assets/{tooltip-BipEhILt.js → tooltip-F9F0ZScm.js} +1 -1
  268. package/dist/client/assets/{track-DH1PLgww.js → track-DJ0hdxgP.js} +1 -1
  269. package/dist/client/assets/{types-DjFj33MP.js → types-1jfERRTH.js} +1 -1
  270. package/dist/client/assets/{usage-stats-CXgOJHoL.js → usage-stats-DFk0NwSH.js} +1 -1
  271. package/dist/client/assets/{use-ai-providers-nujHT3kc.js → use-ai-providers-ox5ll27Z.js} +1 -1
  272. package/dist/client/assets/{use-automations-BPYAumfs.js → use-automations-Dl_7dpcH.js} +1 -1
  273. package/dist/client/assets/{use-autosave-DbkPkV9x.js → use-autosave-YctWTqUt.js} +1 -1
  274. package/dist/client/assets/{use-chat-layout-state-Df24ZRB3.js → use-chat-layout-state-zJEW_ZS9.js} +1 -1
  275. package/dist/client/assets/{use-connect-companion-CIuesGgq.js → use-connect-companion-BuvSS7n-.js} +1 -1
  276. package/dist/client/assets/{use-connection-BP6uA1Pm.js → use-connection-ub_Ste14.js} +1 -1
  277. package/dist/client/assets/{use-copy-xbzBE9wD.js → use-copy-CtGMHYLy.js} +1 -1
  278. package/dist/client/assets/{use-create-virtual-mcp-jvahsWTp.js → use-create-virtual-mcp-Bf7w0Lce.js} +1 -1
  279. package/dist/client/assets/{use-date-fns-locale-CVmVbLGr.js → use-date-fns-locale-B9VkaJgg.js} +1 -1
  280. package/dist/client/assets/{use-debounced-autosave-DtHiemPV.js → use-debounced-autosave-vZPUSJfn.js} +1 -1
  281. package/dist/client/assets/{use-debounced-value-BqAFy0xh.js → use-debounced-value-Bw9kIjO1.js} +1 -1
  282. package/dist/client/assets/{use-deco-credits-3SqWhb0e.js → use-deco-credits-MhwX_k9L.js} +1 -1
  283. package/dist/client/assets/{use-decopilot-events-DKAwuHK5.js → use-decopilot-events-BSl-VzHR.js} +1 -1
  284. package/dist/client/assets/{use-delete-connection-DGBclfUv.js → use-delete-connection-Va4KqXUY.js} +1 -1
  285. package/dist/client/assets/{use-deployment-admin-Hzf6w5Lv.js → use-deployment-admin-BmRjrW1v.js} +1 -1
  286. package/dist/client/assets/{use-fast-preview-draft-url-BMGQbWRn.js → use-fast-preview-draft-url-BXtnB34v.js} +1 -1
  287. package/dist/client/assets/{use-file-configs-CQzLvGNZ.js → use-file-configs-Cm3sO4It.js} +1 -1
  288. package/dist/client/assets/{use-infinite-scroll-DKwxtCTJ.js → use-infinite-scroll-BnsQBnBU.js} +1 -1
  289. package/dist/client/assets/{use-join-requests-BOmP9iaL.js → use-join-requests-Dt9TMCIO.js} +1 -1
  290. package/dist/client/assets/{use-main-panel-tabs-DHYkf6om.js → use-main-panel-tabs-B0LD5D_L.js} +1 -1
  291. package/dist/client/assets/{use-mcp-auth-status-B6RnyZox.js → use-mcp-auth-status-DlHZx2h4.js} +1 -1
  292. package/dist/client/assets/{use-mcp-client-D6KtocGH.js → use-mcp-client-B4p5PsQD.js} +1 -1
  293. package/dist/client/assets/{use-mcp-prompts-B3G2hquO.js → use-mcp-prompts-B6aj_cxq.js} +1 -1
  294. package/dist/client/assets/{use-mcp-tools-CpWlYYef.js → use-mcp-tools-CXnljfkB.js} +1 -1
  295. package/dist/client/assets/{use-members-Dnggi0H6.js → use-members-CtYcpfCh.js} +1 -1
  296. package/dist/client/assets/{use-mobile-BNDa1qTW.js → use-mobile-Dh8MyBYN.js} +1 -1
  297. package/dist/client/assets/{use-navigate-to-agent-CeA0-zHI.js → use-navigate-to-agent-DlSL6F2i.js} +1 -1
  298. package/dist/client/assets/use-new-blocks-editor-HQ--6Q1A.js +1 -0
  299. package/dist/client/assets/{use-open-billing-url-Cs9C1v2X.js → use-open-billing-url-DtL_wVY2.js} +1 -1
  300. package/dist/client/assets/{use-org-auth-client-EfCsoPfs.js → use-org-auth-client-DURj-ul1.js} +1 -1
  301. package/dist/client/assets/{use-org-fs-DQxdLo5A.js → use-org-fs-CxNjPBxj.js} +1 -1
  302. package/dist/client/assets/{use-org-repo-syncs-bfi-YYwW.js → use-org-repo-syncs-CAB_c8N2.js} +1 -1
  303. package/dist/client/assets/{use-org-sso-rRMaOWUO.js → use-org-sso-o7wDP61N.js} +1 -1
  304. package/dist/client/assets/{use-organization-roles-CgoQJuMN.js → use-organization-roles-BkOdkr5h.js} +1 -1
  305. package/dist/client/assets/{use-organization-settings-CwQMCm2X.js → use-organization-settings-DWQ6x2cR.js} +1 -1
  306. package/dist/client/assets/{use-panel-navigate-CmlT4jEu.js → use-panel-navigate-BKuLVg6a.js} +1 -1
  307. package/dist/client/assets/{use-project-scope-C7RhDnCk.js → use-project-scope-5CtWl7GN.js} +1 -1
  308. package/dist/client/assets/{use-releases-CYvBu8aq.js → use-releases-BhZoP6Ng.js} +1 -1
  309. package/dist/client/assets/{use-reports-diagnostic-BgQmaMqy.js → use-reports-diagnostic-D3Lwse-O.js} +1 -1
  310. package/dist/client/assets/{use-secrets-1HQ4IAy9.js → use-secrets-9r6yYa06.js} +1 -1
  311. package/dist/client/assets/{use-section-preview-base-x9UIH6k9.js → use-section-preview-base-DIWbEEZH.js} +1 -1
  312. package/dist/client/assets/{use-session-runtime-B4jdIOYN.js → use-session-runtime-B8-oCkfr.js} +1 -1
  313. package/dist/client/assets/{use-tags-BlpOZnWR.js → use-tags-BxTW3RA-.js} +1 -1
  314. package/dist/client/assets/{use-task-board-analytics-CBvkLBQE.js → use-task-board-analytics-B1xiX_Yt.js} +1 -1
  315. package/dist/client/assets/{use-task-board-events-C77eTZYe.js → use-task-board-events-B5EnTn3m.js} +1 -1
  316. package/dist/client/assets/{use-task-metadata-sbP-XuQa.js → use-task-metadata-LDUAaeqf.js} +1 -1
  317. package/dist/client/assets/{use-thread-analytics-B4Vm3HVL.js → use-thread-analytics-CBxuhPwb.js} +1 -1
  318. package/dist/client/assets/{use-thread-outputs-9NrRnT-T.js → use-thread-outputs-B4erQwfd.js} +1 -1
  319. package/dist/client/assets/useInfiniteQuery-CT33ZGQJ.js +1 -0
  320. package/dist/client/assets/{useQueries-N8-1K_Cp.js → useQueries-CI_3SPtT.js} +1 -1
  321. package/dist/client/assets/useSuspenseInfiniteQuery-Bu7a9ISW.js +1 -0
  322. package/dist/client/assets/{users-CDdQNtGh.js → users-CcUhG10I.js} +1 -1
  323. package/dist/client/assets/{utils-CZUxIVnX.js → utils-BZ6AqxWQ.js} +1 -1
  324. package/dist/client/assets/{variant-calendar-BjExOmBY.js → variant-calendar-Dhrw7NO4.js} +1 -1
  325. package/dist/client/assets/{variant-matcher-override-DXlQIHF1.js → variant-matcher-override-DKsgVjHd.js} +1 -1
  326. package/dist/client/assets/{view-mode-toggle-BVZCIAk6.js → view-mode-toggle-BFlIWoM5.js} +1 -1
  327. package/dist/client/assets/{virtual-mcp-oZFwaeGo.js → virtual-mcp-DF2PBYsh.js} +1 -1
  328. package/dist/client/index.html +1 -1
  329. package/dist/server/cli.js +1 -1
  330. package/dist/server/server.js +1 -1
  331. package/package.json +1 -1
  332. package/dist/client/assets/agent-app-E92-Gy6a.js +0 -1
  333. package/dist/client/assets/agent-deck-D_fZUZQS.js +0 -1
  334. package/dist/client/assets/agent-library-BPINonmt.js +0 -1
  335. package/dist/client/assets/agent-library-file-AVdvAedU.js +0 -1
  336. package/dist/client/assets/agent-settings-DUPHIZdv.js +0 -1
  337. package/dist/client/assets/agent-site-editor-code-CHA17hBZ.js +0 -2
  338. package/dist/client/assets/agent-view-CCGzL59P.js +0 -1
  339. package/dist/client/assets/api-keys-BOftoTw7.js +0 -1
  340. package/dist/client/assets/flat-project-BLTCXO4n.js +0 -1
  341. package/dist/client/assets/library--ZJ93w6z.js +0 -1
  342. package/dist/client/assets/openai-conversation-DxP6q00m.js +0 -3
  343. package/dist/client/assets/project-reports-D5pkTXWX.js +0 -1
  344. package/dist/client/assets/project-tasks-BjPlWRGd.js +0 -1
  345. package/dist/client/assets/record-editor-M_ekBwOD.js +0 -1
  346. package/dist/client/assets/reports-DVnyqFgQ.js +0 -1
  347. package/dist/client/assets/route-D5lOE-ik.js +0 -1
  348. package/dist/client/assets/tasks-Csv_fiFp.js +0 -1
  349. package/dist/client/assets/use-new-blocks-editor-CodmWGli.js +0 -1
  350. package/dist/client/assets/useInfiniteQuery-CkFqoTC5.js +0 -1
  351. package/dist/client/assets/useSuspenseInfiniteQuery-BOArJQiA.js +0 -1
@@ -1 +1 @@
1
- import{au as ve,bN as Oe,bO as Me,av as de,bM as ze,c as U,b as V,j as t,h as Ne,B,r as Z,l as Se,X as te,a2 as Ee,D as me,K as ee,d as se,p as ye,ak as Ce,e_ as Re,n as Ue,fl as ue,R as Fe,I as Ve,F as Le,H as Be,G as xe,E as Ge,f as qe,fu as He,o as Ke,at as Xe,as as Qe,t as J}from"./index-CF33tV9H.js";import{g as We}from"./extract-connection-data-BoNYfZov.js";import{E as _e}from"./empty-state-2J_TOd9y.js";import{E as Ye,c as Je,r as Ze,b as et,d as tt}from"./connection-form-helpers-D8c6nuwN.js";import{c as st,S as nt,D as it}from"./index-C-POkbWx.js";import{u as we,T as ot}from"./use-mcp-auth-status-B6RnyZox.js";import{a as at}from"./use-members-Dnggi0H6.js";import{A as lt}from"./avatar-u_MWZIGi.js";import{a as Ie,b as ke,u as rt}from"./use-connection-BP6uA1Pm.js";import{u as Te}from"./use-mcp-client-D6KtocGH.js";import{u as ct}from"./use-mcp-tools-CpWlYYef.js";import{a as dt}from"./use-mcp-prompts-B3G2hquO.js";import{i as mt,a as ut}from"./mcp-oauth-BzBo_-Jy.js";import{I as ae}from"./integration-icon-DP9NSovP.js";import{s as xt}from"./Plus-CoCopPFe.js";import{bb as pt,av as ft,bv as ht,p as ne,au as gt}from"./agent-icon-DOuarSUR.js";import{a as Ae,f as jt,s as bt}from"./Tool01-Cmx87k3R.js";import{s as re}from"./Trash01-Cn3n-zZO.js";import{b as vt,a as Nt,c as St,S as yt,d as Ct}from"./sheet-BQj61VK7.js";import{F as q,b as H,c as K,d as L,f as X,e as _t,a as wt}from"./form-8UJeqUiI.js";import{I as W}from"./input-AjjN82QQ.js";import{u as It,D as kt}from"./use-delete-connection-DGBclfUv.js";import{c as Tt,B as At,a as Pt,C as Dt}from"./monitoring-stats-row-XCQkGjEK.js";import{d as $t,C as Ot,a as Mt}from"./chart-B2y-kKQ0.js";import{b as zt}from"./repository-binding-BoCSsnZc.js";import{T as ie,a as Et,c as oe,b as Rt}from"./tabs-Ej7qM1mE.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Ut}from"./ShoppingBag01-Dv73R-S1.js";import{g as ce}from"./types-DjFj33MP.js";import{M as Ft}from"./mcp-app-renderer-CFF7AAUa.js";import{C as Vt}from"./collection-search-Ab7KDawL.js";import{B as Lt}from"./badge-BX9BIMvF.js";import{S as pe,b as fe,a as he,d as ge,c as G}from"./select-BcXaErmA.js";import{i as Bt}from"./CheckCircle-B2FtFP_M.js";import{t as Gt}from"./ChevronUp-JJQ1R76T.js";import{c as qt}from"./UserSquare-Dbf0yjYU.js";import{s as Ht}from"./XClose-e3DY7fD7.js";import{p as Kt,i as Xt}from"./connection-BQHh86t6.js";import"./metadata-D72DunRR.js";import"./Key01-DJ4Ph9An.js";import"./auth-CEDbnarF.js";import"./index-C-EzIAGn.js";import"./index-DmYJaTVV.js";import"./index-CRkgh-05.js";import"./popover-DN_kN9Uf.js";import"./tooltip-BipEhILt.js";import"./index-xbjCfbu7.js";import"./Check-CJBdxo1x.js";import"./SearchMd-D_gFR8gZ.js";import"./use-mobile-BNDa1qTW.js";import"./use-create-virtual-mcp-jvahsWTp.js";import"./use-navigate-to-agent-CeA0-zHI.js";import"./thread-intent-CKwVWoUw.js";import"./backoff-8mStPHYB.js";import"./task-board-Bd0mg36M.js";import"./schema-CCD4YccI.js";import"./slugify-CEUa2lfQ.js";import"./Image01-ChZ5ec4B.js";import"./use-org-auth-client-EfCsoPfs.js";import"./User01-Cf1Q03zT.js";import"./AlertCircle-LgH1QoTd.js";import"./ArrowUp-hOT7zM5c.js";import"./ArrowLeft-DXn8x-hc.js";import"./ArrowRight-DMcFYEQV.js";import"./ZoomOut-gxmwr3p2.js";import"./Palette-D5Dmn1Mg.js";import"./Copy01-DLl7IkAX.js";import"./CreditCard01-BvqpwW9d.js";import"./DotsVertical-CfCl81oT.js";import"./Link01-D9SeIlWM.js";import"./LinkExternal01-wpbajNPV.js";import"./Monitor01-CldPGi5G.js";import"./Sun-Ck9W5L0l.js";import"./Upload01-DGQb_EA3.js";import"./Users01-DlQODEmu.js";import"./X-C31L8F55.js";import"./label-BbaxSm2e.js";import"./alert-dialog-HXdE5Gnc.js";import"./CartesianChart-CNpA5Q-x.js";import"./XAxis-CKLs9YQe.js";import"./AreaChart-nTxNjdUo.js";import"./ErrorBarContext-BywYAHQQ.js";import"./Sector-CiAU2uLo.js";const Qt=ve({scopes:ze(de()).describe("List of scopes available"),stateSchema:Oe(de(),Me()).describe("JSON Schema (draft-07) defining the state structure")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Qt}];function Yt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=V();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),m=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,p=n.status!=="active",x=m||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==x?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",x),e[2]=x,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let j;e[7]!==n.title?(j=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let S;e[9]!==n.status||e[10]!==p||e[11]!==m||e[12]!==o?(S=m?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=p,e[11]=m,e[12]=o,e[13]=S):S=e[13];let y;e[14]!==j||e[15]!==S?(y=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,S]}),e[14]=j,e[15]=S,e[16]=y):y=e[16];let C;e[17]!==n||e[18]!==m||e[19]!==a||e[20]!==o?(C=m&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=m,e[19]=a,e[20]=o,e[21]=C):C=e[21];let _;e[22]!==n||e[23]!==p||e[24]!==l||e[25]!==o?(_=p?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(pt,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(ft,{size:13})}),e[22]=n,e[23]=p,e[24]=l,e[25]=o,e[26]=_):_=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let w;e[30]!==o?(w=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=w):w=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Ae,{size:13}),e[34]=A):A=e[34];let O;e[35]!==$||e[36]!==w||e[37]!==M?(O=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:w,"aria-label":M,children:A}),e[35]=$,e[36]=w,e[37]=M,e[38]=O):O=e[38];let k;e[39]!==n||e[40]!==i?(k=()=>i(n),e[39]=n,e[40]=i,e[41]=k):k=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let b;e[44]!==o?(b=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(re,{size:13}),e[46]=E):E=e[46];let z;e[47]!==k||e[48]!==v||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:k,title:v,"aria-label":b,children:E}),e[47]=k,e[48]=v,e[49]=b,e[50]=z):z=e[50];let I;e[51]!==O||e[52]!==z||e[53]!==C||e[54]!==_?(I=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[C,_,O,z]}),e[51]=O,e[52]=z,e[53]=C,e[54]=_,e[55]=I):I=e[55];let P;return e[56]!==I||e[57]!==h||e[58]!==g||e[59]!==y?(P=t.jsxs("div",{className:h,children:[g,y,I]}),e[56]=I,e[57]=h,e[58]=g,e[59]=y,e[60]=P):P=e[60],P}function Jt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,a=V();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let d;e[10]!==a?(d=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ae,{size:13}),e[12]=u):u=e[12];let m;e[13]!==o||e[14]!==r||e[15]!==d?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":d,children:u})}),e[13]=o,e[14]=r,e[15]=d,e[16]=m):m=e[16];let p;return e[17]!==i||e[18]!==l||e[19]!==m?(p=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,m]}),e[17]=i,e[18]=l,e[19]=m,e[20]=p):p=e[20],p}function Zt(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,d=V();if(n.length===0)return null;let u;e[0]!==n.length||e[1]!==d?(u=n.length===1?d("details.connectionInstancesPanel.instance"):d("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=d,e[2]=u):u=e[2];let m;e[3]!==u?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(xt,{size:13}),e[5]=r,e[6]=p):p=e[6];let x;e[7]!==d?(x=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=x):x=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==p||e[12]!==x?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[p,x]}),e[9]=r,e[10]=o,e[11]=p,e[12]=x,e[13]=h):h=e[13];let g;e[14]!==m||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[m,h]}),e[14]=m,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let C;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(C=_=>t.jsx(Z.Suspense,{fallback:t.jsx(Jt,{instance:_,onConfigure:c}),children:t.jsx(Yt,{instance:_,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},_.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=C):C=e[27],j=n.map(C),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let S;e[28]!==j?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=S):S=e[29];let y;return e[30]!==g||e[31]!==S?(y=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=y):y=e[32],y}function es(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const ts=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ss(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const ns={calls:{label:"Tool calls"},errors:{label:"Errors"}};function is(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:a}=s,i=V(),l=Ee(),o=ss(a),{data:r}=me({queryKey:ee.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=Tt(r?.logs??[],o,void 0,r?.total,d?.total),m=u.data,p=u.totalCalls>0,x=es(r?.logs??[]),h=u.totalCalls>0?Math.round(u.totalErrors/u.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),j]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),p?t.jsxs("div",{children:[t.jsx($t,{config:ns,className:"h-16 w-full",children:t.jsxs(At,{data:m,barCategoryGap:"4%",children:[t.jsx(Ot,{content:t.jsx(Mt,{labelFormatter:ls}),cursor:{fill:"var(--muted)"}}),t.jsx(Pt,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:m.map(as)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[m.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),x.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:x.map(os)})]})]})}function os(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function as(s,e){return t.jsx(Dt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function ls(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function rs(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function cs(s){const e=U.c(22),{connectionId:n}=s,c=V(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==a?(u=ts.map(j=>t.jsx("button",{type:"button","aria-pressed":a===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",a===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=a,e[7]=u):u=e[7];let m;e[8]!==d||e[9]!==u?(m=t.jsx("div",{role:"group","aria-label":d,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:u}),e[8]=d,e[9]=u,e[10]=m):m=e[10];let p;e[11]!==r||e[12]!==m?(p=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,m]}),e[11]=r,e[12]=m,e[13]=p):p=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rs,{}),e[14]=x):x=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==a?(h=t.jsx(Z.Suspense,{fallback:x,children:t.jsx(is,{connectionId:n,orgId:l.id,timeframe:a})}),e[15]=n,e[16]=l.id,e[17]=a,e[18]=h):h=e[18];let g;return e[19]!==p||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[p,h]}),e[19]=p,e[20]=h,e[21]=g):g=e[21],g}function ds(s){const e=U.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const m=crypto.randomUUID();a({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:m}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==o||e[13]!==r?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,d]}),e[11]=i,e[12]=o,e[13]=r,e[14]=u):u=e[14],u}function ms(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(ds,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function us(s){const e=U.c(13),{connection:n}=s,c=V(),{org:a}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=zt(i);if(!(l.length>0)){let p;return e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(t.Fragment,{}),e[2]=p):p=e[2],p}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==r?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r})}),e[5]=r,e[6]=d):d=e[6];let u;e[7]!==a.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(ms,{virtualMcps:l,org:a.slug})}),e[7]=a.slug,e[8]=l,e[9]=u):u=e[9];let m;return e[10]!==d||e[11]!==u?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=m):m=e[12],m}function xs(s){const e=U.c(35),{tools:n,connectionId:c,org:a}=s,i=V(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const d=Te(r),u=Ie(c);let m;e[4]!==u||e[5]!==c?(m=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=m):m=e[6];const p=m,[x,h]=Z.useState("");let g,j,S,y;if(e[7]!==p||e[8]!==d||e[9]!==l||e[10]!==a||e[11]!==x||e[12]!==i||e[13]!==n){const $=(n??[]).filter(ps),w=x.toLowerCase().trim(),M=w?$.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):$;let A;e[18]!==p||e[19]!==l||e[20]!==a?(A=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=p,e[19]=l,e[20]=a,e[21]=A):A=e[21];const O=A;S="flex flex-col h-full overflow-hidden";let k;e[22]!==i?(k=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=k):k=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=v):v=e[24],e[25]!==x||e[26]!==k?(y=t.jsx(Vt,{value:x,onChange:h,placeholder:k,onKeyDown:v}),e[25]=x,e[26]=k,e[27]=y):y=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(_e,{image:null,title:i(x?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(x?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>O(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Ft,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.annotations?.title??b.name}),t.jsx(ot,{annotations:b.annotations,_meta:b._meta})]}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b.description})]})]},b.name)})}),e[7]=p,e[8]=d,e[9]=l,e[10]=a,e[11]=x,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=S,e[17]=y}else g=e[14],j=e[15],S=e[16],y=e[17];let C;e[28]!==g||e[29]!==j?(C=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=C):C=e[30];let _;return e[31]!==S||e[32]!==y||e[33]!==C?(_=t.jsxs("div",{className:S,children:[y,C]}),e[31]=S,e[32]=y,e[33]=C,e[34]=_):_=e[34],_}function ps(s){return!!ce(s._meta)}const je=[];function De(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=V();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function fs(s){const e=U.c(68),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s,o=c===void 0?je:c,r=a===void 0?je:a,d=V(),u=se(),m=Ie(i??"");let p;e[0]!==m||e[1]!==i?(p=m?Pe(m):i,e[0]=m,e[1]=i,e[2]=p):p=e[2];const x=p;let h;e[3]!==x||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(T){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:x,collectionName:"tools",itemId:encodeURIComponent(T)}})},e[3]=x,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(js),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const S=j;if(n.length+o.length+r.length===0){let N;e[12]!==d?(N=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=N):N=e[13];let T;e[14]!==N?(T=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:N}),e[14]=N,e[15]=T):T=e[15];let D;e[16]!==d?(D=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=D):D=e[17];let F;e[18]!==D?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:D}),e[18]=D,e[19]=F):F=e[19];let Q;return e[20]!==T||e[21]!==F?(Q=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[T,F]}),e[20]=T,e[21]=F,e[22]=Q):Q=e[22],Q}let C;e[23]!==d||e[24]!==n.length?(C=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=C):C=e[25];let _;e[26]!==C?(_=t.jsx(ie,{value:"tools",variant:"underline",children:C}),e[26]=C,e[27]=_):_=e[27];let $;e[28]!==S||e[29]!==d?($=S&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=S,e[29]=d,e[30]=$):$=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let M;e[33]!==w?(M=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=M):M=e[34];let A;e[35]!==d?(A=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=A):A=e[36];let O;e[37]!==A?(O=t.jsx(ie,{value:"resources",variant:"underline",children:A}),e[37]=A,e[38]=O):O=e[38];let k;e[39]!==M||e[40]!==O||e[41]!==_||e[42]!==$?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Et,{variant:"underline",className:"gap-1",children:[_,$,M,O]})}),e[39]=M,e[40]=O,e[41]=_,e[42]=$,e[43]=k):k=e[43];let v;e[44]!==g||e[45]!==n?(v=n.length>0?n.map(N=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>g(N.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(jt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},N.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=v):v=e[46];let b;e[47]!==v?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:v})}),e[47]=v,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==S||e[51]!==l||e[52]!==n?(E=S&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(xs,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=S,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==o?(z=o.length>0?o.map(gs):t.jsx(le,{label:"prompts"}),e[54]=o,e[55]=z):z=e[55];let I;e[56]!==z?(I=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=I):I=e[57];let P;e[58]!==r?(P=r.length>0?r.map(hs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=P):P=e[59];let R;e[60]!==P?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:P})}),e[60]=P,e[61]=R):R=e[61];let f;return e[62]!==k||e[63]!==b||e[64]!==E||e[65]!==I||e[66]!==R?(f=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Rt,{defaultValue:"tools",variant:"underline",children:[k,b,E,I,R]})}),e[62]=k,e[63]=b,e[64]=E,e[65]=I,e[66]=R,e[67]=f):f=e[67],f}function hs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(ht,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function gs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Ut,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function js(s){return ce(s._meta)}function bs(s){const e=U.c(13),{connection:n,displayTitle:c}=s,a=c??n.title;let i;e[0]!==n.icon||e[1]!==a?(i=t.jsx(ae,{icon:n.icon,name:a,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=i):i=e[2];let l;e[3]!==a?(l=t.jsx(Ue.Title,{children:a}),e[3]=a,e[4]=l):l=e[4];let o;e[5]!==n.description?(o=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=o):o=e[6];let r;e[7]!==l||e[8]!==o?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,o]}),e[7]=l,e[8]=o,e[9]=r):r=e[9];let d;return e[10]!==i||e[11]!==r?(d=t.jsxs("div",{className:"flex items-center px-4 md:px-8 bg-background border-b border-border shrink-0 gap-3 py-4",children:[i,r]}),e[10]=i,e[11]=r,e[12]=d):d=e[12],d}function vs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=V(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Fe(),d=(()=>{if(typeof o!="string"||!o)return!1;try{const x=new URL(o);return x.hostname==="api.githubcopilot.com"&&x.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",m=e.connection_type==="VIRTUAL",p=m?Kt(e.connection_url):null;return m?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(ye,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(q,{control:s.control,name:"ui_type",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(L,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(G,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(G,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(G,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(q,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(G,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(G,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(G,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(qt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(X,{})]})}),l==="NPX"&&t.jsx(q,{control:s.control,name:"npx_package",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(q,{control:s.control,name:"stdio_command",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),t.jsx(q,{control:s.control,name:"stdio_args",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(X,{})]})})]}),t.jsx(q,{control:s.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(q,{control:s.control,name:"env_vars",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Ye,{value:x.value??[],onChange:x.onChange})}),t.jsx(X,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(q,{control:s.control,name:"connection_token",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ve,{children:[t.jsx(Le,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Lt,{variant:"success",className:"gap-1.5",children:[t.jsx(Bt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Gt,{size:12})]})})}),t.jsxs(Be,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(bt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&x.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>x.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(W,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(_t,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(X,{})]})})]})}function Ns(s){return s.command==="npx"}function Ss(s){return s.args?.find(e=>!e.startsWith("-"))??""}function ys(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function be(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Xt(s.connection_headers)){const c=s.connection_headers,a=Ze(c.envVars);if(Ns(c)){const l=Ss(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const i=ys(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Cs(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=tt(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function _s({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=V(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Ke(),m=ke(),{org:p}=te(),x=It({onSuccess:()=>{o.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[j,S]=Z.useState(!1),y=we({connectionId:e}),{data:C}=at(),_=C?.data?.members??[],$=h??s,w=_.find(f=>f.userId===$.created_by),A=s?.connection_type==="VIRTUAL"||y.isAuthenticated,O={...s,tools:a},k=st(O,Wt),v=Xe({resolver:Qe(Je),values:be(h??s)}),b=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const N=v.getValues(),T=Cs(N),D=h?.id??e;await m.update.mutateAsync({id:D,data:T}),v.reset(N)},z=()=>{v.reset(be(h??s))},I=async f=>{const N=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:T,tokenInfo:D,error:F}=await ut({connectionId:f,orgSlug:p.slug,...N?{scope:N}:{}});if(F||!T){J.error(r("details.connection.authFailed",{error:F??""}));return}if(D)try{const Y=await fetch(`/api/${p.slug}/connections/${f}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!Y.ok)console.error("Failed to save OAuth token:",await Y.text()),await m.update.mutateAsync({id:f,data:{connection_token:T}});else try{await m.update.mutateAsync({id:f,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Y){console.error("Error saving OAuth token:",Y),await m.update.mutateAsync({id:f,data:{connection_token:T}})}else await m.update.mutateAsync({id:f,data:{connection_token:T}});const Q=new URL(`/api/${p.slug}/mcp/${f}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},P=()=>I(s.id),R=async()=>{try{const f=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!f.ok){const T=await f.text();J.error(r("details.connection.failedRemoveOAuth",{error:T}));return}const N=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(N.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(f){console.error("Error removing OAuth token:",f),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(kt,{...x}),t.jsx(vt,{open:h!==null,onOpenChange:f=>{f||g(null)},children:t.jsxs(Nt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(St,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(yt,{className:"text-base",children:h?.title??s.title}),t.jsx(Ct,{className:"text-xs",children:r("details.connection.settingsDescription")}),w&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(lt,{url:w.user?.image??void 0,fallback:w.user?.name??w.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:w.user?.name||w.user?.email})]})]}),t.jsxs(wt,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(q,{control:v.control,name:"title",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(W,{...f})}),t.jsx(X,{})]})}),t.jsx(q,{control:v.control,name:"description",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(W,{...f,value:f.value||""})}),t.jsx(X,{})]})})]}),t.jsx(vs,{form:v,connection:h??s,hasOAuthToken:y.hasOAuthToken,onReauthenticate:P,onRemoveOAuth:R}),t.jsx(nt,{connection:h??s,form:v,hasMcpBinding:k,isMCPAuthenticated:A,supportsOAuth:y.supportsOAuth,isServerError:y.isServerError,onAuthenticate:P,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const f=h??s;g(null),x.requestDelete(f)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(it,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(bs,{connection:s,displayTitle:(()=>{const f=o[0]??s;return f.app_name?f.title.replace(/\s*\(\d+\)\s*$/,""):f.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(cs,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Zt,{instances:o,onConfigure:f=>g(f),onAuthenticate:f=>I(f.id),onDelete:f=>x.requestDelete(f),onToggleStatus:async(f,N)=>{try{await m.update.mutateAsync({id:f.id,data:{status:N}}),J.success(r(N==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{S(!0);try{const f=o[0]??s,N=f.title.replace(/\s*\(\d+\)\s*$/,""),T=o.length+1,D=`${N} (${T})`,F=We("conn");await m.create.mutateAsync({id:F,title:D,description:f.description??null,connection_type:f.connection_type,connection_url:f.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:f.created_by,organization_id:f.organization_id,icon:f.icon??null,app_name:f.app_name??null,app_id:f.app_id??null,connection_headers:f.connection_headers??null,oauth_config:null,configuration_state:f.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const Q=new URL(`/api/${p.slug}/mcp/${F}`,window.location.origin),Y=await mt({url:Q.href,token:null,orgId:p.id});Y.supportsOAuth&&!Y.isAuthenticated&&await I(F)}finally{S(!1)}}}),t.jsx(us,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(fs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ws(){const s=U.c(52),e=V();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=qe(a),{org:o}=te(),r=ke();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=rt(d),m=u[0]??null,p=m?.id??"",x=p||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==x?(h={connectionId:x,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=x,s[7]=h):h=s[7];const g=Te(h);let j;s[8]!==g?(j={client:g},s[8]=g,s[9]=j):j=s[9];const{data:S}=ct(j);let y;if(s[10]!==m?.tools||s[11]!==p||s[12]!==u||s[13]!==S){const I=S?S.tools.map(Ds):(m?.tools??[]).map(Ps);e:{if(u.length<=1){y=I;break e}const P=new Set,R=[],f=Ts;for(const N of u){const T=N.id===p?I:f(N.tools);for(const D of T)P.has(D.name)||(P.add(D.name),R.push(D))}y=R.length>0?R:I}s[10]=m?.tools,s[11]=p,s[12]=u,s[13]=S,s[14]=y}else y=s[14];const C=y;let _;s[15]!==g?(_={client:g},s[15]=g,s[16]=_):_=s[16];const{data:$}=dt(_);let w;s[17]!==g?(w={client:g},s[17]=g,s[18]=w):w=s[18];const{data:M}=He(w);let A;s[19]!==$?.prompts?(A=$?.prompts??[],s[19]=$?.prompts,s[20]=A):A=s[20];let O;s[21]!==A?(O=A.map(ks),s[21]=A,s[22]=O):O=s[22];const k=O;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let b;s[25]!==v?(b=v.map(Is),s[25]=v,s[26]=b):b=s[26];const E=b;if(!m){let I;s[27]!==e?(I=e("details.connection.notFoundTitle"),s[27]=e,s[28]=I):I=s[28];let P;s[29]!==e?(P=e("details.connection.notFoundDescription"),s[29]=e,s[30]=P):P=s[30];let R;s[31]!==c||s[32]!==l?(R=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=R):R=s[33];let f;s[34]!==e?(f=e("details.connection.backButton"),s[34]=e,s[35]=f):f=s[35];let N;s[36]!==R||s[37]!==f?(N=t.jsx(B,{variant:"outline",onClick:R,children:f}),s[36]=R,s[37]=f,s[38]=N):N=s[38];let T;return s[39]!==I||s[40]!==P||s[41]!==N?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(_e,{title:I,description:P,actions:N})}),s[39]=I,s[40]=P,s[41]=N,s[42]=T):T=s[42],T}let z;return s[43]!==r.update.isPending||s[44]!==C||s[45]!==m||s[46]!==p||s[47]!==l||s[48]!==k||s[49]!==E||s[50]!==u?(z=t.jsx(_s,{org:l,connection:m,connectionId:p,isUpdating:r.update.isPending,tools:C,prompts:k,resources:E,siblings:u}),s[43]=r.update.isPending,s[44]=C,s[45]=m,s[46]=p,s[47]=l,s[48]=k,s[49]=E,s[50]=u,s[51]=z):z=s[51],z}function Is(s){return{name:s.name,description:s.description,uri:s.uri}}function ks(s){return{name:s.name,description:s.description}}function Ts(s){return(s??[]).map(As)}function As(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ps(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ds(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function $s(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(ws,{})})}),s[0]=e):e=s[0],e}function di(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx($s,{}),s[0]=e):e=s[0],e}export{di as default};
1
+ import{au as ve,bN as Oe,bO as Me,av as de,bM as ze,c as U,b as V,j as t,h as Ne,B,r as Z,l as Se,X as te,a2 as Ee,D as me,K as ee,d as se,p as ye,ak as Ce,e_ as Re,n as Ue,fl as ue,R as Fe,I as Ve,F as Le,H as Be,G as xe,E as Ge,f as qe,fu as He,o as Ke,at as Xe,as as Qe,t as J}from"./index-BkwVGG61.js";import{g as We}from"./extract-connection-data-CMpFLKxZ.js";import{E as _e}from"./empty-state-C1nhEd0-.js";import{E as Ye,c as Je,r as Ze,b as et,d as tt}from"./connection-form-helpers-DSaYnQN2.js";import{c as st,S as nt,D as it}from"./index-Cryf-8qU.js";import{u as we,T as ot}from"./use-mcp-auth-status-DlHZx2h4.js";import{a as at}from"./use-members-CtYcpfCh.js";import{A as lt}from"./avatar-IYCAP9D4.js";import{a as Ie,b as ke,u as rt}from"./use-connection-ub_Ste14.js";import{u as Te}from"./use-mcp-client-B4p5PsQD.js";import{u as ct}from"./use-mcp-tools-CXnljfkB.js";import{a as dt}from"./use-mcp-prompts-B6aj_cxq.js";import{i as mt,a as ut}from"./mcp-oauth-C_AhA8BD.js";import{I as ae}from"./integration-icon-B3X6G1Wg.js";import{s as xt}from"./Plus-BPVcSaQ1.js";import{bb as pt,av as ft,bv as ht,p as ne,au as gt}from"./agent-icon-Dnnu07Dp.js";import{a as Ae,f as jt,s as bt}from"./Tool01-Cr3g7eFI.js";import{s as re}from"./Trash01-DsSqN_Va.js";import{b as vt,a as Nt,c as St,S as yt,d as Ct}from"./sheet-DdorBPzD.js";import{F as q,b as H,c as K,d as L,f as X,e as _t,a as wt}from"./form-0lcPxUaV.js";import{I as W}from"./input-BC8VVwvY.js";import{u as It,D as kt}from"./use-delete-connection-Va4KqXUY.js";import{c as Tt,B as At,a as Pt,C as Dt}from"./monitoring-stats-row-hrEvYAfu.js";import{d as $t,C as Ot,a as Mt}from"./chart-CUr_Oc7J.js";import{b as zt}from"./repository-binding-B1w5M3gR.js";import{T as ie,a as Et,c as oe,b as Rt}from"./tabs-2VLLco4y.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Ut}from"./ShoppingBag01-DskCGm9K.js";import{g as ce}from"./types-1jfERRTH.js";import{M as Ft}from"./mcp-app-renderer-DGp0KYfs.js";import{C as Vt}from"./collection-search-DshGdcb0.js";import{B as Lt}from"./badge-Bx-goeTE.js";import{S as pe,b as fe,a as he,d as ge,c as G}from"./select-Bk77xGJr.js";import{i as Bt}from"./CheckCircle-BpnJdBCF.js";import{t as Gt}from"./ChevronUp-CIZg0YhK.js";import{c as qt}from"./UserSquare-k-BSPAbI.js";import{s as Ht}from"./XClose-DeW6TQBh.js";import{p as Kt,i as Xt}from"./connection-DUhRStgE.js";import"./metadata-D72DunRR.js";import"./Key01-Di5njQWH.js";import"./auth-DYiVP7MT.js";import"./index-DaTxyVef.js";import"./index-BfVD2brg.js";import"./index-jlKQueRg.js";import"./popover-CmYWPOzN.js";import"./tooltip-F9F0ZScm.js";import"./index-cy7uuLPR.js";import"./Check-CP73h7yQ.js";import"./SearchMd-CQ_uV2jU.js";import"./use-mobile-Dh8MyBYN.js";import"./use-create-virtual-mcp-Bf7w0Lce.js";import"./use-navigate-to-agent-DlSL6F2i.js";import"./thread-intent-Dv0pFBsV.js";import"./backoff-8mStPHYB.js";import"./task-board-C6ymciPp.js";import"./schema-DvklMLx3.js";import"./slugify-CEUa2lfQ.js";import"./Image01-C_d_m-XY.js";import"./use-org-auth-client-DURj-ul1.js";import"./User01-CFCaTmZh.js";import"./AlertCircle-CPQSuuWk.js";import"./ArrowUp-BTBhPpEu.js";import"./ArrowLeft-Bvd89_b4.js";import"./ArrowRight-n-IJ4Fik.js";import"./ZoomOut-Dv2fO7S6.js";import"./Palette-edCnzPtR.js";import"./Copy01-YoGcseNZ.js";import"./CreditCard01-C-9IP3Dn.js";import"./DotsVertical-_UiBrHHr.js";import"./Link01-BzReMq2w.js";import"./LinkExternal01-CuSjyiN1.js";import"./Monitor01-C8qvsEmS.js";import"./Sun-CPwiYds_.js";import"./Upload01-CsCOoftz.js";import"./Users01-DeynvlqM.js";import"./X-srLHGSHt.js";import"./label-1zPphAKx.js";import"./alert-dialog-BFZCPfXf.js";import"./CartesianChart-Ba_8acEa.js";import"./XAxis-BjWqcwD8.js";import"./AreaChart-BKxeqcvu.js";import"./ErrorBarContext-CtWkO946.js";import"./Sector-UvElOWGp.js";const Qt=ve({scopes:ze(de()).describe("List of scopes available"),stateSchema:Oe(de(),Me()).describe("JSON Schema (draft-07) defining the state structure")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Qt}];function Yt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=V();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),m=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,p=n.status!=="active",x=m||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==x?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",x),e[2]=x,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let j;e[7]!==n.title?(j=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let S;e[9]!==n.status||e[10]!==p||e[11]!==m||e[12]!==o?(S=m?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=p,e[11]=m,e[12]=o,e[13]=S):S=e[13];let y;e[14]!==j||e[15]!==S?(y=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,S]}),e[14]=j,e[15]=S,e[16]=y):y=e[16];let C;e[17]!==n||e[18]!==m||e[19]!==a||e[20]!==o?(C=m&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=m,e[19]=a,e[20]=o,e[21]=C):C=e[21];let _;e[22]!==n||e[23]!==p||e[24]!==l||e[25]!==o?(_=p?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(pt,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(ft,{size:13})}),e[22]=n,e[23]=p,e[24]=l,e[25]=o,e[26]=_):_=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let w;e[30]!==o?(w=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=w):w=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Ae,{size:13}),e[34]=A):A=e[34];let O;e[35]!==$||e[36]!==w||e[37]!==M?(O=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:w,"aria-label":M,children:A}),e[35]=$,e[36]=w,e[37]=M,e[38]=O):O=e[38];let k;e[39]!==n||e[40]!==i?(k=()=>i(n),e[39]=n,e[40]=i,e[41]=k):k=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let b;e[44]!==o?(b=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(re,{size:13}),e[46]=E):E=e[46];let z;e[47]!==k||e[48]!==v||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:k,title:v,"aria-label":b,children:E}),e[47]=k,e[48]=v,e[49]=b,e[50]=z):z=e[50];let I;e[51]!==O||e[52]!==z||e[53]!==C||e[54]!==_?(I=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[C,_,O,z]}),e[51]=O,e[52]=z,e[53]=C,e[54]=_,e[55]=I):I=e[55];let P;return e[56]!==I||e[57]!==h||e[58]!==g||e[59]!==y?(P=t.jsxs("div",{className:h,children:[g,y,I]}),e[56]=I,e[57]=h,e[58]=g,e[59]=y,e[60]=P):P=e[60],P}function Jt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,a=V();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let d;e[10]!==a?(d=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ae,{size:13}),e[12]=u):u=e[12];let m;e[13]!==o||e[14]!==r||e[15]!==d?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":d,children:u})}),e[13]=o,e[14]=r,e[15]=d,e[16]=m):m=e[16];let p;return e[17]!==i||e[18]!==l||e[19]!==m?(p=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,m]}),e[17]=i,e[18]=l,e[19]=m,e[20]=p):p=e[20],p}function Zt(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,d=V();if(n.length===0)return null;let u;e[0]!==n.length||e[1]!==d?(u=n.length===1?d("details.connectionInstancesPanel.instance"):d("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=d,e[2]=u):u=e[2];let m;e[3]!==u?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(xt,{size:13}),e[5]=r,e[6]=p):p=e[6];let x;e[7]!==d?(x=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=x):x=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==p||e[12]!==x?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[p,x]}),e[9]=r,e[10]=o,e[11]=p,e[12]=x,e[13]=h):h=e[13];let g;e[14]!==m||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[m,h]}),e[14]=m,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let C;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(C=_=>t.jsx(Z.Suspense,{fallback:t.jsx(Jt,{instance:_,onConfigure:c}),children:t.jsx(Yt,{instance:_,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},_.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=C):C=e[27],j=n.map(C),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let S;e[28]!==j?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=S):S=e[29];let y;return e[30]!==g||e[31]!==S?(y=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=y):y=e[32],y}function es(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const ts=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ss(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const ns={calls:{label:"Tool calls"},errors:{label:"Errors"}};function is(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:a}=s,i=V(),l=Ee(),o=ss(a),{data:r}=me({queryKey:ee.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=Tt(r?.logs??[],o,void 0,r?.total,d?.total),m=u.data,p=u.totalCalls>0,x=es(r?.logs??[]),h=u.totalCalls>0?Math.round(u.totalErrors/u.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),j]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),p?t.jsxs("div",{children:[t.jsx($t,{config:ns,className:"h-16 w-full",children:t.jsxs(At,{data:m,barCategoryGap:"4%",children:[t.jsx(Ot,{content:t.jsx(Mt,{labelFormatter:ls}),cursor:{fill:"var(--muted)"}}),t.jsx(Pt,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:m.map(as)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[m.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),x.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:x.map(os)})]})]})}function os(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function as(s,e){return t.jsx(Dt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function ls(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function rs(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function cs(s){const e=U.c(22),{connectionId:n}=s,c=V(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==a?(u=ts.map(j=>t.jsx("button",{type:"button","aria-pressed":a===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",a===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=a,e[7]=u):u=e[7];let m;e[8]!==d||e[9]!==u?(m=t.jsx("div",{role:"group","aria-label":d,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:u}),e[8]=d,e[9]=u,e[10]=m):m=e[10];let p;e[11]!==r||e[12]!==m?(p=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,m]}),e[11]=r,e[12]=m,e[13]=p):p=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rs,{}),e[14]=x):x=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==a?(h=t.jsx(Z.Suspense,{fallback:x,children:t.jsx(is,{connectionId:n,orgId:l.id,timeframe:a})}),e[15]=n,e[16]=l.id,e[17]=a,e[18]=h):h=e[18];let g;return e[19]!==p||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[p,h]}),e[19]=p,e[20]=h,e[21]=g):g=e[21],g}function ds(s){const e=U.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const m=crypto.randomUUID();a({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:m}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==o||e[13]!==r?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,d]}),e[11]=i,e[12]=o,e[13]=r,e[14]=u):u=e[14],u}function ms(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(ds,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function us(s){const e=U.c(13),{connection:n}=s,c=V(),{org:a}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=zt(i);if(!(l.length>0)){let p;return e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(t.Fragment,{}),e[2]=p):p=e[2],p}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==r?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r})}),e[5]=r,e[6]=d):d=e[6];let u;e[7]!==a.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(ms,{virtualMcps:l,org:a.slug})}),e[7]=a.slug,e[8]=l,e[9]=u):u=e[9];let m;return e[10]!==d||e[11]!==u?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=m):m=e[12],m}function xs(s){const e=U.c(35),{tools:n,connectionId:c,org:a}=s,i=V(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const d=Te(r),u=Ie(c);let m;e[4]!==u||e[5]!==c?(m=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=m):m=e[6];const p=m,[x,h]=Z.useState("");let g,j,S,y;if(e[7]!==p||e[8]!==d||e[9]!==l||e[10]!==a||e[11]!==x||e[12]!==i||e[13]!==n){const $=(n??[]).filter(ps),w=x.toLowerCase().trim(),M=w?$.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):$;let A;e[18]!==p||e[19]!==l||e[20]!==a?(A=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=p,e[19]=l,e[20]=a,e[21]=A):A=e[21];const O=A;S="flex flex-col h-full overflow-hidden";let k;e[22]!==i?(k=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=k):k=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=v):v=e[24],e[25]!==x||e[26]!==k?(y=t.jsx(Vt,{value:x,onChange:h,placeholder:k,onKeyDown:v}),e[25]=x,e[26]=k,e[27]=y):y=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(_e,{image:null,title:i(x?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(x?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>O(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Ft,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.annotations?.title??b.name}),t.jsx(ot,{annotations:b.annotations,_meta:b._meta})]}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b.description})]})]},b.name)})}),e[7]=p,e[8]=d,e[9]=l,e[10]=a,e[11]=x,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=S,e[17]=y}else g=e[14],j=e[15],S=e[16],y=e[17];let C;e[28]!==g||e[29]!==j?(C=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=C):C=e[30];let _;return e[31]!==S||e[32]!==y||e[33]!==C?(_=t.jsxs("div",{className:S,children:[y,C]}),e[31]=S,e[32]=y,e[33]=C,e[34]=_):_=e[34],_}function ps(s){return!!ce(s._meta)}const je=[];function De(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=V();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function fs(s){const e=U.c(68),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s,o=c===void 0?je:c,r=a===void 0?je:a,d=V(),u=se(),m=Ie(i??"");let p;e[0]!==m||e[1]!==i?(p=m?Pe(m):i,e[0]=m,e[1]=i,e[2]=p):p=e[2];const x=p;let h;e[3]!==x||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(T){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:x,collectionName:"tools",itemId:encodeURIComponent(T)}})},e[3]=x,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(js),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const S=j;if(n.length+o.length+r.length===0){let N;e[12]!==d?(N=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=N):N=e[13];let T;e[14]!==N?(T=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:N}),e[14]=N,e[15]=T):T=e[15];let D;e[16]!==d?(D=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=D):D=e[17];let F;e[18]!==D?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:D}),e[18]=D,e[19]=F):F=e[19];let Q;return e[20]!==T||e[21]!==F?(Q=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[T,F]}),e[20]=T,e[21]=F,e[22]=Q):Q=e[22],Q}let C;e[23]!==d||e[24]!==n.length?(C=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=C):C=e[25];let _;e[26]!==C?(_=t.jsx(ie,{value:"tools",variant:"underline",children:C}),e[26]=C,e[27]=_):_=e[27];let $;e[28]!==S||e[29]!==d?($=S&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=S,e[29]=d,e[30]=$):$=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let M;e[33]!==w?(M=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=M):M=e[34];let A;e[35]!==d?(A=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=A):A=e[36];let O;e[37]!==A?(O=t.jsx(ie,{value:"resources",variant:"underline",children:A}),e[37]=A,e[38]=O):O=e[38];let k;e[39]!==M||e[40]!==O||e[41]!==_||e[42]!==$?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Et,{variant:"underline",className:"gap-1",children:[_,$,M,O]})}),e[39]=M,e[40]=O,e[41]=_,e[42]=$,e[43]=k):k=e[43];let v;e[44]!==g||e[45]!==n?(v=n.length>0?n.map(N=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>g(N.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(jt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},N.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=v):v=e[46];let b;e[47]!==v?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:v})}),e[47]=v,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==S||e[51]!==l||e[52]!==n?(E=S&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(xs,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=S,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==o?(z=o.length>0?o.map(gs):t.jsx(le,{label:"prompts"}),e[54]=o,e[55]=z):z=e[55];let I;e[56]!==z?(I=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=I):I=e[57];let P;e[58]!==r?(P=r.length>0?r.map(hs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=P):P=e[59];let R;e[60]!==P?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:P})}),e[60]=P,e[61]=R):R=e[61];let f;return e[62]!==k||e[63]!==b||e[64]!==E||e[65]!==I||e[66]!==R?(f=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Rt,{defaultValue:"tools",variant:"underline",children:[k,b,E,I,R]})}),e[62]=k,e[63]=b,e[64]=E,e[65]=I,e[66]=R,e[67]=f):f=e[67],f}function hs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(ht,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function gs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Ut,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function js(s){return ce(s._meta)}function bs(s){const e=U.c(13),{connection:n,displayTitle:c}=s,a=c??n.title;let i;e[0]!==n.icon||e[1]!==a?(i=t.jsx(ae,{icon:n.icon,name:a,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=i):i=e[2];let l;e[3]!==a?(l=t.jsx(Ue.Title,{children:a}),e[3]=a,e[4]=l):l=e[4];let o;e[5]!==n.description?(o=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=o):o=e[6];let r;e[7]!==l||e[8]!==o?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,o]}),e[7]=l,e[8]=o,e[9]=r):r=e[9];let d;return e[10]!==i||e[11]!==r?(d=t.jsxs("div",{className:"flex items-center px-4 md:px-8 bg-background border-b border-border shrink-0 gap-3 py-4",children:[i,r]}),e[10]=i,e[11]=r,e[12]=d):d=e[12],d}function vs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=V(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Fe(),d=(()=>{if(typeof o!="string"||!o)return!1;try{const x=new URL(o);return x.hostname==="api.githubcopilot.com"&&x.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",m=e.connection_type==="VIRTUAL",p=m?Kt(e.connection_url):null;return m?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(ye,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(q,{control:s.control,name:"ui_type",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(L,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(G,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(G,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(G,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(q,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(G,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(G,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(G,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(qt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(X,{})]})}),l==="NPX"&&t.jsx(q,{control:s.control,name:"npx_package",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(q,{control:s.control,name:"stdio_command",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),t.jsx(q,{control:s.control,name:"stdio_args",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(X,{})]})})]}),t.jsx(q,{control:s.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(q,{control:s.control,name:"env_vars",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Ye,{value:x.value??[],onChange:x.onChange})}),t.jsx(X,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(q,{control:s.control,name:"connection_token",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ve,{children:[t.jsx(Le,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Lt,{variant:"success",className:"gap-1.5",children:[t.jsx(Bt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Gt,{size:12})]})})}),t.jsxs(Be,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(bt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&x.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>x.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(W,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(_t,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(X,{})]})})]})}function Ns(s){return s.command==="npx"}function Ss(s){return s.args?.find(e=>!e.startsWith("-"))??""}function ys(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function be(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Xt(s.connection_headers)){const c=s.connection_headers,a=Ze(c.envVars);if(Ns(c)){const l=Ss(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const i=ys(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Cs(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=tt(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function _s({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=V(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Ke(),m=ke(),{org:p}=te(),x=It({onSuccess:()=>{o.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[j,S]=Z.useState(!1),y=we({connectionId:e}),{data:C}=at(),_=C?.data?.members??[],$=h??s,w=_.find(f=>f.userId===$.created_by),A=s?.connection_type==="VIRTUAL"||y.isAuthenticated,O={...s,tools:a},k=st(O,Wt),v=Xe({resolver:Qe(Je),values:be(h??s)}),b=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const N=v.getValues(),T=Cs(N),D=h?.id??e;await m.update.mutateAsync({id:D,data:T}),v.reset(N)},z=()=>{v.reset(be(h??s))},I=async f=>{const N=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:T,tokenInfo:D,error:F}=await ut({connectionId:f,orgSlug:p.slug,...N?{scope:N}:{}});if(F||!T){J.error(r("details.connection.authFailed",{error:F??""}));return}if(D)try{const Y=await fetch(`/api/${p.slug}/connections/${f}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!Y.ok)console.error("Failed to save OAuth token:",await Y.text()),await m.update.mutateAsync({id:f,data:{connection_token:T}});else try{await m.update.mutateAsync({id:f,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Y){console.error("Error saving OAuth token:",Y),await m.update.mutateAsync({id:f,data:{connection_token:T}})}else await m.update.mutateAsync({id:f,data:{connection_token:T}});const Q=new URL(`/api/${p.slug}/mcp/${f}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},P=()=>I(s.id),R=async()=>{try{const f=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!f.ok){const T=await f.text();J.error(r("details.connection.failedRemoveOAuth",{error:T}));return}const N=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(N.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(f){console.error("Error removing OAuth token:",f),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(kt,{...x}),t.jsx(vt,{open:h!==null,onOpenChange:f=>{f||g(null)},children:t.jsxs(Nt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(St,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(yt,{className:"text-base",children:h?.title??s.title}),t.jsx(Ct,{className:"text-xs",children:r("details.connection.settingsDescription")}),w&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(lt,{url:w.user?.image??void 0,fallback:w.user?.name??w.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:w.user?.name||w.user?.email})]})]}),t.jsxs(wt,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(q,{control:v.control,name:"title",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(W,{...f})}),t.jsx(X,{})]})}),t.jsx(q,{control:v.control,name:"description",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(W,{...f,value:f.value||""})}),t.jsx(X,{})]})})]}),t.jsx(vs,{form:v,connection:h??s,hasOAuthToken:y.hasOAuthToken,onReauthenticate:P,onRemoveOAuth:R}),t.jsx(nt,{connection:h??s,form:v,hasMcpBinding:k,isMCPAuthenticated:A,supportsOAuth:y.supportsOAuth,isServerError:y.isServerError,onAuthenticate:P,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const f=h??s;g(null),x.requestDelete(f)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(it,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(bs,{connection:s,displayTitle:(()=>{const f=o[0]??s;return f.app_name?f.title.replace(/\s*\(\d+\)\s*$/,""):f.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(cs,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Zt,{instances:o,onConfigure:f=>g(f),onAuthenticate:f=>I(f.id),onDelete:f=>x.requestDelete(f),onToggleStatus:async(f,N)=>{try{await m.update.mutateAsync({id:f.id,data:{status:N}}),J.success(r(N==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{S(!0);try{const f=o[0]??s,N=f.title.replace(/\s*\(\d+\)\s*$/,""),T=o.length+1,D=`${N} (${T})`,F=We("conn");await m.create.mutateAsync({id:F,title:D,description:f.description??null,connection_type:f.connection_type,connection_url:f.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:f.created_by,organization_id:f.organization_id,icon:f.icon??null,app_name:f.app_name??null,app_id:f.app_id??null,connection_headers:f.connection_headers??null,oauth_config:null,configuration_state:f.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const Q=new URL(`/api/${p.slug}/mcp/${F}`,window.location.origin),Y=await mt({url:Q.href,token:null,orgId:p.id});Y.supportsOAuth&&!Y.isAuthenticated&&await I(F)}finally{S(!1)}}}),t.jsx(us,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(fs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ws(){const s=U.c(52),e=V();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=qe(a),{org:o}=te(),r=ke();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=rt(d),m=u[0]??null,p=m?.id??"",x=p||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==x?(h={connectionId:x,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=x,s[7]=h):h=s[7];const g=Te(h);let j;s[8]!==g?(j={client:g},s[8]=g,s[9]=j):j=s[9];const{data:S}=ct(j);let y;if(s[10]!==m?.tools||s[11]!==p||s[12]!==u||s[13]!==S){const I=S?S.tools.map(Ds):(m?.tools??[]).map(Ps);e:{if(u.length<=1){y=I;break e}const P=new Set,R=[],f=Ts;for(const N of u){const T=N.id===p?I:f(N.tools);for(const D of T)P.has(D.name)||(P.add(D.name),R.push(D))}y=R.length>0?R:I}s[10]=m?.tools,s[11]=p,s[12]=u,s[13]=S,s[14]=y}else y=s[14];const C=y;let _;s[15]!==g?(_={client:g},s[15]=g,s[16]=_):_=s[16];const{data:$}=dt(_);let w;s[17]!==g?(w={client:g},s[17]=g,s[18]=w):w=s[18];const{data:M}=He(w);let A;s[19]!==$?.prompts?(A=$?.prompts??[],s[19]=$?.prompts,s[20]=A):A=s[20];let O;s[21]!==A?(O=A.map(ks),s[21]=A,s[22]=O):O=s[22];const k=O;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let b;s[25]!==v?(b=v.map(Is),s[25]=v,s[26]=b):b=s[26];const E=b;if(!m){let I;s[27]!==e?(I=e("details.connection.notFoundTitle"),s[27]=e,s[28]=I):I=s[28];let P;s[29]!==e?(P=e("details.connection.notFoundDescription"),s[29]=e,s[30]=P):P=s[30];let R;s[31]!==c||s[32]!==l?(R=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=R):R=s[33];let f;s[34]!==e?(f=e("details.connection.backButton"),s[34]=e,s[35]=f):f=s[35];let N;s[36]!==R||s[37]!==f?(N=t.jsx(B,{variant:"outline",onClick:R,children:f}),s[36]=R,s[37]=f,s[38]=N):N=s[38];let T;return s[39]!==I||s[40]!==P||s[41]!==N?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(_e,{title:I,description:P,actions:N})}),s[39]=I,s[40]=P,s[41]=N,s[42]=T):T=s[42],T}let z;return s[43]!==r.update.isPending||s[44]!==C||s[45]!==m||s[46]!==p||s[47]!==l||s[48]!==k||s[49]!==E||s[50]!==u?(z=t.jsx(_s,{org:l,connection:m,connectionId:p,isUpdating:r.update.isPending,tools:C,prompts:k,resources:E,siblings:u}),s[43]=r.update.isPending,s[44]=C,s[45]=m,s[46]=p,s[47]=l,s[48]=k,s[49]=E,s[50]=u,s[51]=z):z=s[51],z}function Is(s){return{name:s.name,description:s.description,uri:s.uri}}function ks(s){return{name:s.name,description:s.description}}function Ts(s){return(s??[]).map(As)}function As(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ps(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ds(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function $s(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(ws,{})})}),s[0]=e):e=s[0],e}function di(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx($s,{}),s[0]=e):e=s[0],e}export{di as default};
@@ -1 +1 @@
1
- import{au as R,bN as A,bO as I,av as o,bM as j,bL as L,c as z,j as u,B as C}from"./index-CF33tV9H.js";import{I as H}from"./input-AjjN82QQ.js";import{s as W}from"./Plus-CoCopPFe.js";import{s as q}from"./Trash01-Cn3n-zZO.js";const K=R({key:o().min(1,"Key is required"),value:o()}),G=R({title:o().min(1,"Name is required"),description:o().nullable().optional(),icon:o().nullable().optional(),ui_type:L(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:o().optional(),connection_token:o().nullable().optional(),npx_package:o().optional(),stdio_command:o().optional(),stdio_args:o().optional(),stdio_cwd:o().optional(),env_vars:j(K).optional(),configuration_scopes:j(o()).nullable().optional(),configuration_state:A(o(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]}).refine(n=>(n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket")&&n.connection_url?.trim()?o().url().safeParse(n.connection_url.trim()).success:!0,{message:"Enter a valid URL",path:["connection_url"]});function O(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(i=>e.includes(i))||["sk_","rk_","whsec_","pk_live","sk_live"].some(i=>e.startsWith(i))||["_key","_secret","_token","_password","_auth","_pat"].some(i=>e.endsWith(i)))}function X(n){const e=z.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:i,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=i===void 0?"value...":i;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,s)=>s!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:p,value:c.value},r(s))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const g=P;let T;e[9]!==r||e[10]!==t?(T=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:c.key,value:p},r(s))},e[9]=r,e[10]=t,e[11]=T):T=e[11];const k=T;let f;if(e[12]!==g||e[13]!==y||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==g||e[20]!==y||e[21]!==k||e[22]!==m||e[23]!==h?(l=(p,s)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>g(s,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:O(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(s,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(s),children:u.jsx(q,{size:16})})]},s),e[19]=g,e[20]=y,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=g,e[13]=y,e[14]=k,e[15]=m,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(W,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==S?(d=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[w,"Add Environment Variable"]}),e[26]=S,e[27]=d):d=e[27];let _;e[28]!==f||e[29]!==d?(_=u.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=_):_=e[30];let E;return e[31]!==v||e[32]!==_?(E=u.jsx("div",{className:v,children:_}),e[31]=v,e[32]=_,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const a=e.slice(1).find(i=>!i.startsWith("-"));return a?{packageName:a}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(i=>(i.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",a=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:a}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const i=V(r);return Object.keys(i).length>0&&(a.envVars=i),a}export{X as E,J as a,Q as b,G as c,Z as d,Y as i,F as p,D as r};
1
+ import{au as R,bN as A,bO as I,av as o,bM as j,bL as L,c as z,j as u,B as C}from"./index-BkwVGG61.js";import{I as H}from"./input-BC8VVwvY.js";import{s as W}from"./Plus-BPVcSaQ1.js";import{s as q}from"./Trash01-DsSqN_Va.js";const K=R({key:o().min(1,"Key is required"),value:o()}),G=R({title:o().min(1,"Name is required"),description:o().nullable().optional(),icon:o().nullable().optional(),ui_type:L(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:o().optional(),connection_token:o().nullable().optional(),npx_package:o().optional(),stdio_command:o().optional(),stdio_args:o().optional(),stdio_cwd:o().optional(),env_vars:j(K).optional(),configuration_scopes:j(o()).nullable().optional(),configuration_state:A(o(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]}).refine(n=>(n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket")&&n.connection_url?.trim()?o().url().safeParse(n.connection_url.trim()).success:!0,{message:"Enter a valid URL",path:["connection_url"]});function O(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(i=>e.includes(i))||["sk_","rk_","whsec_","pk_live","sk_live"].some(i=>e.startsWith(i))||["_key","_secret","_token","_password","_auth","_pat"].some(i=>e.endsWith(i)))}function X(n){const e=z.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:i,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=i===void 0?"value...":i;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,s)=>s!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:p,value:c.value},r(s))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const g=P;let T;e[9]!==r||e[10]!==t?(T=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:c.key,value:p},r(s))},e[9]=r,e[10]=t,e[11]=T):T=e[11];const k=T;let f;if(e[12]!==g||e[13]!==y||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==g||e[20]!==y||e[21]!==k||e[22]!==m||e[23]!==h?(l=(p,s)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>g(s,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:O(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(s,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(s),children:u.jsx(q,{size:16})})]},s),e[19]=g,e[20]=y,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=g,e[13]=y,e[14]=k,e[15]=m,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(W,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==S?(d=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[w,"Add Environment Variable"]}),e[26]=S,e[27]=d):d=e[27];let _;e[28]!==f||e[29]!==d?(_=u.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=_):_=e[30];let E;return e[31]!==v||e[32]!==_?(E=u.jsx("div",{className:v,children:_}),e[31]=v,e[32]=_,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const a=e.slice(1).find(i=>!i.startsWith("-"));return a?{packageName:a}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(i=>(i.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",a=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:a}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const i=V(r);return Object.keys(i).length>0&&(a.envVars=i),a}export{X as E,J as a,Q as b,G as c,Z as d,Y as i,F as p,D as r};
@@ -1 +1 @@
1
- import{r as z,c as W,b as te,j as t,B as E,h as ue,l as xe,G as ce,F as We,I as Xe,H as Ge,E as qe,X as ke,d as Te,u as Qe,a as we,R as Je,ad as ve,U as Ye,V as Ze,at as et,as as tt,n as fe,q as ee,o as nt,a2 as st,t as R,K as ot}from"./index-CF33tV9H.js";import{a as Ae,g as it,e as ct}from"./extract-connection-data-BoNYfZov.js";import{C as lt}from"./collection-display-button-Dhq5dlaG.js";import{S as rt}from"./search-input-Dx_18pro.js";import{C as at}from"./collection-tabs-CWG2Ssug.js";import{C as Ce,u as Ie,g as dt}from"./connection-card-CXVlnV9x.js";import{E as ut}from"./empty-state-2J_TOd9y.js";import{u as gt,D as mt}from"./use-delete-connection-DGBclfUv.js";import{u as pt}from"./use-infinite-scroll-DKwxtCTJ.js";import{u as Pe}from"./use-mobile-BNDa1qTW.js";import{g as de}from"./connection-slug-CITJ0kGN.js";import{A as ft,a as ht,b as xt,c as jt,g as St,d as yt,e as vt,f as Ct}from"./alert-dialog-HXdE5Gnc.js";import{au as je,A as bt,bu as _t,av as Nt,bb as Dt,p as ye}from"./agent-icon-DOuarSUR.js";import{g as kt,a as Tt}from"./metadata-D72DunRR.js";import{d as Me,h as $e,c as Oe,e as Fe,b as Ue,D as Ve}from"./dialog-BTrZTHUg.js";import{D as wt,a as At,d as It,b as Pt,e as Mt,f as $t,g as Ot}from"./drawer-D0MZ4mo1.js";import{F as q,b as Q,c as J,d as Y,f as Z,a as Ne}from"./form-8UJeqUiI.js";import{I as se}from"./input-AjjN82QQ.js";import{S as Ft,b as Ut,a as Vt,d as zt,c as ae}from"./select-BcXaErmA.js";import{T as Lt}from"./textarea-BCrT32Yf.js";import{b as ze,u as Et}from"./use-connection-BP6uA1Pm.js";import{m as Bt}from"./use-mcp-client-D6KtocGH.js";import{b as Kt}from"./repository-binding-BoCSsnZc.js";import{g as Ht}from"./types-DjFj33MP.js";import{s as Le}from"./Plus-CoCopPFe.js";import{c as Rt}from"./UserSquare-Dbf0yjYU.js";import{s as Ee}from"./XClose-e3DY7fD7.js";import{s as Wt}from"./use-project-scope-C7RhDnCk.js";import{i as he,a as De,E as Xt,c as Gt,p as qt,b as Qt,d as Jt}from"./connection-form-helpers-D8c6nuwN.js";import{a as Yt}from"./authenticate-and-persist-oauth-NS0ShRS6.js";import{I as Zt}from"./integration-icon-DP9NSovP.js";import{C as Be}from"./checkbox-BSRHWuev.js";import{i as en}from"./DotsVertical-CfCl81oT.js";import{s as Ke}from"./Image01-ChZ5ec4B.js";import{s as He}from"./Trash01-Cn3n-zZO.js";import"./connection-BQHh86t6.js";import"./ArrowUp-hOT7zM5c.js";import"./Check-CJBdxo1x.js";import"./tooltip-BipEhILt.js";import"./index-xbjCfbu7.js";import"./view-mode-toggle-BVZCIAk6.js";import"./badge-BX9BIMvF.js";import"./SearchMd-D_gFR8gZ.js";import"./useInfiniteQuery-CkFqoTC5.js";import"./infiniteQueryObserver-B2NoY_fE.js";import"./slugify-CEUa2lfQ.js";import"./AlertCircle-LgH1QoTd.js";import"./Tool01-Cmx87k3R.js";import"./ArrowLeft-DXn8x-hc.js";import"./ArrowRight-DMcFYEQV.js";import"./ShoppingBag01-Dv73R-S1.js";import"./ZoomOut-gxmwr3p2.js";import"./Palette-D5Dmn1Mg.js";import"./CheckCircle-B2FtFP_M.js";import"./ChevronUp-JJQ1R76T.js";import"./Copy01-DLl7IkAX.js";import"./CreditCard01-BvqpwW9d.js";import"./Key01-DJ4Ph9An.js";import"./Link01-D9SeIlWM.js";import"./LinkExternal01-wpbajNPV.js";import"./Monitor01-CldPGi5G.js";import"./Sun-Ck9W5L0l.js";import"./Upload01-DGQb_EA3.js";import"./User01-Cf1Q03zT.js";import"./Users01-DlQODEmu.js";import"./X-C31L8F55.js";import"./label-BbaxSm2e.js";import"./auth-CEDbnarF.js";import"./mcp-oauth-BzBo_-Jy.js";function tn(o){const e=`deco-filters-${o}`,[n,u]=z.useState(()=>{try{const i=globalThis.localStorage?.getItem(e);if(i)return JSON.parse(i)}catch(i){console.error("Failed to parse stored filters:",i)}return[]});return[n,i=>{u(i);try{globalThis.localStorage?.setItem(e,JSON.stringify(i))}catch(l){console.error("Failed to save filters:",l)}}]}function nn(o){const e=W.c(7),[n,u]=z.useState(o),[s,i]=z.useState(o?"desc":null);let l;e[0]!==s||e[1]!==n?(l=f=>{n!==f?(u(f),i("asc")):s==="asc"?i("desc"):s==="desc"&&(u(void 0),i(null))},e[0]=s,e[1]=n,e[2]=l):l=e[2];const r=l;let d;return e[3]!==r||e[4]!==s||e[5]!==n?(d={sortKey:n,sortDirection:s,handleSort:r},e[3]=r,e[4]=s,e[5]=n,e[6]=d):d=e[6],d}function sn(o,e){const n=W.c(12),u=e===void 0?"cards":e,s=Pe(),i=z.useRef(s),l=o?`deco-view-mode-${o}`:"deco-view-mode";let r;n[0]!==u||n[1]!==l?(r=()=>{const j=globalThis.localStorage?.getItem(l);return j==="cards"||j==="table"?j:u},n[0]=u,n[1]=l,n[2]=r):r=n[2];const[d,f]=z.useState(r);let h;n[3]!==l?(h=j=>{f(j),globalThis.localStorage?.setItem(l,j)},n[3]=l,n[4]=h):h=n[4];const g=h;let a,m;n[5]!==s||n[6]!==d?(a=()=>{!i.current&&s&&d==="table"&&f("cards"),i.current=s},m=[s,d],n[5]=s,n[6]=d,n[7]=a,n[8]=m):(a=n[7],m=n[8]),z.useEffect(a,m);let p;return n[9]!==g||n[10]!==d?(p=[d,g],n[9]=g,n[10]=d,n[11]=p):p=n[11],p}function on(o){const e=W.c(20),{namespace:n,resource:u,defaultSortKey:s,defaultViewMode:i}=o,l=s===void 0?"title":s,r=i===void 0?"table":i,[d,f]=z.useState(""),h=z.useDeferredValue(d),g=`${n}-${u}`,[a,m]=tn(g),p=`studio-${u}-filter-visible-${n}`;let j;e[0]!==p?(j=()=>globalThis.localStorage?.getItem(p)==="true",e[0]=p,e[1]=j):j=e[1];const[S,v]=z.useState(j);let y;e[2]!==p?(y=M=>{v(M),globalThis.localStorage?.setItem(p,String(M))},e[2]=p,e[3]=y):y=e[3];const c=y;let x;e[4]!==S||e[5]!==c?(x=()=>{c(!S)},e[4]=S,e[5]=c,e[6]=x):x=e[6];const T=x,[k,w]=sn(`studio-${u}-${n}`,r),{sortKey:I,sortDirection:A,handleSort:$}=nn(l),O=I;let P;return e[7]!==S||e[8]!==a||e[9]!==$||e[10]!==d||e[11]!==h||e[12]!==c||e[13]!==m||e[14]!==w||e[15]!==A||e[16]!==O||e[17]!==T||e[18]!==k?(P={search:d,searchTerm:h,setSearch:f,filters:a,setFilters:m,filterBarVisible:S,setFilterBarVisible:c,toggleFilterBar:T,viewMode:k,setViewMode:w,sortKey:O,sortDirection:A,handleSort:$},e[7]=S,e[8]=a,e[9]=$,e[10]=d,e[11]=h,e[12]=c,e[13]=m,e[14]=w,e[15]=A,e[16]=O,e[17]=T,e[18]=k,e[19]=P):P=e[19],P}function cn(o){const e=W.c(35),{open:n,onOpenChange:u,count:s,onConfirm:i}=o,l=te(),r=s===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==s||e[1]!==l||e[2]!==r?(d=l(r,{count:s}),e[0]=s,e[1]=l,e[2]=r,e[3]=d):d=e[3];let f;e[4]!==d?(f=t.jsx(ft,{children:d}),e[4]=d,e[5]=f):f=e[5];const h=s===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let g;e[6]!==l||e[7]!==h?(g=l(h),e[6]=l,e[7]=h,e[8]=g):g=e[8];let a;e[9]!==g?(a=t.jsx(ht,{children:g}),e[9]=g,e[10]=a):a=e[10];let m;e[11]!==f||e[12]!==a?(m=t.jsxs(xt,{children:[f,a]}),e[11]=f,e[12]=a,e[13]=m):m=e[13];let p;e[14]!==l?(p=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=p):p=e[15];let j;e[16]!==p?(j=t.jsx(jt,{children:p}),e[16]=p,e[17]=j):j=e[17];const S=s===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let v;e[18]!==s||e[19]!==l||e[20]!==S?(v=l(S,{count:s}),e[18]=s,e[19]=l,e[20]=S,e[21]=v):v=e[21];let y;e[22]!==i||e[23]!==v?(y=t.jsx(St,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:v}),e[22]=i,e[23]=v,e[24]=y):y=e[24];let c;e[25]!==y||e[26]!==j?(c=t.jsxs(yt,{children:[j,y]}),e[25]=y,e[26]=j,e[27]=c):c=e[27];let x;e[28]!==c||e[29]!==m?(x=t.jsxs(vt,{children:[m,c]}),e[28]=c,e[29]=m,e[30]=x):x=e[30];let T;return e[31]!==u||e[32]!==n||e[33]!==x?(T=t.jsx(Ct,{open:n,onOpenChange:u,children:x}),e[31]=u,e[32]=n,e[33]=x,e[34]=T):T=e[34],T}function ln(o){const e=W.c(39),{item:n,canManage:u,allConnections:s,connectedAppNames:i,connectingItemId:l,onNavigateConnected:r,onConnect:d}=o,f=te();let h,g;e[0]!==i||e[1]!==n?(h=Ae(n)??"",g=i.has(h),e[0]=i,e[1]=n,e[2]=h,e[3]=g):(h=e[2],g=e[3]);const a=g;let m;e[4]!==n._meta?(m=kt(n._meta),e[4]=n._meta,e[5]=m):m=e[5];const p=m,j=p?.friendlyName||p?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",S=n.server?.description||n.description||null;let v;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(v=n.server?.icons?.[0]?.src||Tt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=v):v=e[8];const y=v;let c;if(e[9]!==s||e[10]!==h){let V;e[12]!==h?(V=b=>b.connection_type!=="VIRTUAL"&&b.app_name===h,e[12]=h,e[13]=V):V=e[13],c=s.filter(V),e[9]=s,e[10]=h,e[11]=c}else c=e[11];const x=c,T=a||u;let k,w;e[14]!==x||e[15]!==a||e[16]!==n||e[17]!==d||e[18]!==r?(k=()=>{if(a){const V=x[0];V&&r(V);return}w()},w=()=>d(n),e[14]=x,e[15]=a,e[16]=n,e[17]=d,e[18]=r,e[19]=k,e[20]=w):(k=e[19],w=e[20]);let I;e[21]!==S||e[22]!==y||e[23]!==j?(I={title:j,description:S,icon:y},e[21]=S,e[22]=y,e[23]=j,e[24]=I):I=e[24];let A;e[25]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(je,{}),e[25]=A):A=e[25];const $=T?k:void 0;let O;e[26]!==u||e[27]!==l||e[28]!==w||e[29]!==a||e[30]!==n.id||e[31]!==f?(O=a?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:f("orgs.catalogItemCard.connected")}):u&&t.jsx(E,{variant:"outline",size:"sm",className:"h-7 px-3 text-sm font-medium",disabled:l!==null,onClick:V=>{V.stopPropagation(),w()},children:l===n.id?t.jsx(ue,{className:"size-3.5"}):f("orgs.catalogItemCard.connect")}),e[26]=u,e[27]=l,e[28]=w,e[29]=a,e[30]=n.id,e[31]=f,e[32]=O):O=e[32];let P;e[33]!==O?(P=t.jsx("div",{className:"flex items-center gap-2",children:O}),e[33]=O,e[34]=P):P=e[34];let M;return e[35]!==I||e[36]!==$||e[37]!==P?(M=t.jsx(Ce,{connection:I,fallbackIcon:A,onClick:$,headerActionsAlwaysVisible:!0,headerActions:P}),e[35]=I,e[36]=$,e[37]=P,e[38]=M):M=e[38],M}function rn(o){return o?.length?{appToolName:o.find(n=>!!Ht(n._meta))?.name??null}:null}const an=3;function dn(o){const e=new Map;for(const n of o)for(const u of n.connections??[]){const s=e.get(u.connection_id)??[];s.push(n),e.set(u.connection_id,s)}return e}function un(o){const e=W.c(25),{projects:n}=o,u=te();if(n.length===0){let m;e[0]!==u?(m=u("projects.connections.orgWide"),e[0]=u,e[1]=m):m=e[1];let p;return e[2]!==m?(p=t.jsx("span",{className:"text-xs text-muted-foreground",children:m}),e[2]=m,e[3]=p):p=e[3],p}let s,i,l,r;if(e[4]!==n){const m=n.slice(0,an);s=n.length-m.length,r="flex min-w-0 items-center gap-2",i="flex shrink-0 -space-x-1.5",l=m.map(gn),e[4]=n,e[5]=s,e[6]=i,e[7]=l,e[8]=r}else s=e[5],i=e[6],l=e[7],r=e[8];let d;e[9]!==i||e[10]!==l?(d=t.jsx("div",{className:i,children:l}),e[9]=i,e[10]=l,e[11]=d):d=e[11];let f;e[12]!==n[0]?.title||e[13]!==n.length||e[14]!==u?(f=n.length===1?n[0]?.title:u("projects.connections.usedBy",{count:n.length}),e[12]=n[0]?.title,e[13]=n.length,e[14]=u,e[15]=f):f=e[15];let h;e[16]!==f?(h=t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:f}),e[16]=f,e[17]=h):h=e[17];let g;e[18]!==s?(g=s>0&&t.jsx("span",{className:"sr-only",children:s}),e[18]=s,e[19]=g):g=e[19];let a;return e[20]!==r||e[21]!==d||e[22]!==h||e[23]!==g?(a=t.jsxs("div",{className:r,children:[d,h,g]}),e[20]=r,e[21]=d,e[22]=h,e[23]=g,e[24]=a):a=e[24],a}function gn(o){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:o.title,children:t.jsx(bt,{icon:o.icon,name:o.title,size:"xs"})},o.id)}function Re(o){const e=W.c(8),{selectionMode:n,children:u}=o,s=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let i;e[0]!==s?(i=xe("overflow-hidden transition-all duration-150 ease-out",s),e[0]=s,e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(We,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:pn,children:t.jsx(en,{size:20})})}),e[2]=l):l=e[2];let r;e[3]!==u?(r=t.jsxs(Xe,{children:[l,t.jsx(Ge,{align:"end",onClick:mn,children:u})]}),e[3]=u,e[4]=r):r=e[4];let d;return e[5]!==i||e[6]!==r?(d=t.jsx("div",{className:i,children:r}),e[5]=i,e[6]=r,e[7]=d):d=e[7],d}function mn(o){return o.stopPropagation()}function pn(o){return o.stopPropagation()}function fn(o){const e=W.c(57),{group:n,onOpen:u,selectionMode:s,selectedIds:i,onToggleSelect:l}=o,r=te();let d;if(e[0]!==n.connections||e[1]!==i){let N;e[3]!==i?(N=U=>i.has(U.id),e[3]=i,e[4]=N):N=e[4],d=n.connections.every(N),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const f=d;let h;if(e[5]!==n.connections||e[6]!==i){let N;e[8]!==i?(N=U=>i.has(U.id),e[8]=i,e[9]=N):N=e[9],h=n.connections.some(N),e[5]=n.connections,e[6]=i,e[7]=h}else h=e[7];const g=h;let a;e[10]!==f||e[11]!==n.connections||e[12]!==l||e[13]!==i?(a=()=>{for(const N of n.connections)f?i.has(N.id)&&l(N.id):i.has(N.id)||l(N.id)},e[10]=f,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=a):a=e[14];const m=a,p=n.title,j=n.icon;let S;e[15]!==n.connections.length||e[16]!==r?(S=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=S):S=e[17];let v;e[18]!==n.icon||e[19]!==n.title||e[20]!==S?(v={title:p,icon:j,description:S},e[18]=n.icon,e[19]=n.title,e[20]=S,e[21]=v):v=e[21];let y;e[22]!==u||e[23]!==s||e[24]!==m?(y=()=>s?m():u(),e[22]=u,e[23]=s,e[24]=m,e[25]=y):y=e[25];const c=s&&f&&"ring-2 ring-primary",x=s&&g&&!f&&"ring-1 ring-primary/50";let T;e[26]!==x||e[27]!==c?(T=xe(c,x),e[26]=x,e[27]=c,e[28]=T):T=e[28];const k=s?f?!0:g&&"mixed":void 0;let w;e[29]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(je,{}),e[29]=w):w=e[29];let I;e[30]!==f||e[31]!==n.connections.length||e[32]!==s||e[33]!==g||e[34]!==r||e[35]!==m?(I=s?t.jsx(Be,{checked:f?!0:g?"indeterminate":!1,onCheckedChange:m}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:r("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=f,e[31]=n.connections.length,e[32]=s,e[33]=g,e[34]=r,e[35]=m,e[36]=I):I=e[36];let A;e[37]!==u?(A=N=>{N.stopPropagation(),u()},e[37]=u,e[38]=A):A=e[38];let $;e[39]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Ke,{size:16}),e[39]=$):$=e[39];let O;e[40]!==r?(O=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=O):O=e[41];let P;e[42]!==A||e[43]!==O?(P=t.jsxs(ce,{onClick:A,children:[$,O]}),e[42]=A,e[43]=O,e[44]=P):P=e[44];let M;e[45]!==s||e[46]!==P?(M=t.jsx(Re,{selectionMode:s,children:P}),e[45]=s,e[46]=P,e[47]=M):M=e[47];let V;e[48]!==I||e[49]!==M?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[I,M]}),e[48]=I,e[49]=M,e[50]=V):V=e[50];let b;return e[51]!==T||e[52]!==k||e[53]!==V||e[54]!==v||e[55]!==y?(b=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:v,onClick:y,className:T,selected:k,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:V})}),e[51]=T,e[52]=k,e[53]=V,e[54]=v,e[55]=y,e[56]=b):b=e[56],b}function hn(o){const e=W.c(36),{connection:n,isSelected:u,selectionMode:s,canManage:i,canManageAgents:l,onToggleSelect:r,onOpen:d,onToggleStatus:f,onDelete:h}=o,g=te();let a;e[0]!==u||e[1]!==r||e[2]!==s||e[3]!==g?(a=s?t.jsx(Be,{checked:u,onCheckedChange:r,onClick:xn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:g("orgs.connectionSelectionUi.connected")}),e[0]=u,e[1]=r,e[2]=s,e[3]=g,e[4]=a):a=e[4];let m;e[5]!==d?(m=k=>{k.stopPropagation(),d()},e[5]=d,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Ke,{size:16}),e[7]=p):p=e[7];let j;e[8]!==g?(j=g("orgs.connectionSelectionUi.open"),e[8]=g,e[9]=j):j=e[9];let S;e[10]!==m||e[11]!==j?(S=t.jsxs(ce,{onClick:m,children:[p,j]}),e[10]=m,e[11]=j,e[12]=S):S=e[12];let v;e[13]!==i||e[14]!==l||e[15]!==r||e[16]!==g?(v=(i||l)&&t.jsxs(ce,{onClick:k=>{k.stopPropagation(),r()},children:[t.jsx(_t,{size:16}),g("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=r,e[16]=g,e[17]=v):v=e[17];let y;e[18]!==i||e[19]!==n||e[20]!==f||e[21]!==g?(y=i&&(n.status==="active"?t.jsxs(ce,{onClick:k=>{k.stopPropagation(),f("inactive")},children:[t.jsx(Nt,{size:16}),g("orgs.connectionSelectionUi.disable")]}):t.jsxs(ce,{onClick:k=>{k.stopPropagation(),f("active")},children:[t.jsx(Dt,{size:16}),g("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=f,e[21]=g,e[22]=y):y=e[22];let c;e[23]!==i||e[24]!==h||e[25]!==g?(c=i&&t.jsxs(ce,{variant:"destructive",onClick:k=>{k.stopPropagation(),h()},children:[t.jsx(He,{size:16}),g("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=h,e[25]=g,e[26]=c):c=e[26];let x;e[27]!==s||e[28]!==S||e[29]!==v||e[30]!==y||e[31]!==c?(x=t.jsxs(Re,{selectionMode:s,children:[S,v,y,c]}),e[27]=s,e[28]=S,e[29]=v,e[30]=y,e[31]=c,e[32]=x):x=e[32];let T;return e[33]!==a||e[34]!==x?(T=t.jsxs("div",{className:"flex items-center gap-1",children:[a,x]}),e[33]=a,e[34]=x,e[35]=T):T=e[35],T}function xn(o){return o.stopPropagation()}function jn(o){const e=W.c(29),{count:n,total:u,canManage:s,canManageAgents:i,onSelectAll:l,onDeselectAll:r,onDelete:d,onAddToAgent:f,onToggleStatus:h,onCancel:g}=o,a=te();if(n===0)return null;let m;e[0]!==n||e[1]!==a?(m=a("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=a,e[2]=m):m=e[2];let p;e[3]!==m?(p=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:m}),e[3]=m,e[4]=p):p=e[4];let j;e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==a||e[9]!==u?(j=n<u?t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:a("orgs.connectionSelectionUi.selectAll",{total:u})}):t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:a("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=l,e[8]=a,e[9]=u,e[10]=j):j=e[10];let S;e[11]!==i||e[12]!==f||e[13]!==a?(S=i&&t.jsxs(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:f,children:[t.jsx(Le,{size:13}),a("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=f,e[13]=a,e[14]=S):S=e[14];let v;e[15]!==s||e[16]!==d||e[17]!==h||e[18]!==a?(v=s&&t.jsxs(t.Fragment,{children:[t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("active"),children:a("orgs.connectionSelectionUi.enable")}),t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("inactive"),children:a("orgs.connectionSelectionUi.disable")}),t.jsxs(E,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(He,{size:13}),a("orgs.connectionSelectionUi.delete")]})]}),e[15]=s,e[16]=d,e[17]=h,e[18]=a,e[19]=v):v=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ee,{size:13}),e[20]=y):y=e[20];let c;e[21]!==g?(c=t.jsx(E,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:y}),e[21]=g,e[22]=c):c=e[22];let x;return e[23]!==p||e[24]!==j||e[25]!==S||e[26]!==v||e[27]!==c?(x=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:[p,j,S,v,c]})}),e[23]=p,e[24]=j,e[25]=S,e[26]=v,e[27]=c,e[28]=x):x=e[28],x}function Sn(o){const e=W.c(45),{open:n,onOpenChange:u,agents:s,onConfirm:i}=o,l=te(),[r,d]=z.useState(null);let f;e[0]!==l?(f=l("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=l,e[1]=f):f=e[1];let h;e[2]!==f?(h=t.jsx(Me,{children:f}),e[2]=f,e[3]=h):h=e[3];let g;e[4]!==l?(g=l("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=l,e[5]=g):g=e[5];let a;e[6]!==g?(a=t.jsx($e,{children:g}),e[6]=g,e[7]=a):a=e[7];let m;e[8]!==h||e[9]!==a?(m=t.jsxs(Oe,{children:[h,a]}),e[8]=h,e[9]=a,e[10]=m):m=e[10];let p;e[11]!==s||e[12]!==r||e[13]!==l?(p=s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):s.map($=>t.jsxs("button",{type:"button",onClick:()=>d($.id),className:xe("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",r===$.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Zt,{icon:$.icon,name:$.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:$.title}),$.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:$.description})]})]},$.id)),e[11]=s,e[12]=r,e[13]=l,e[14]=p):p=e[14];let j;e[15]!==p?(j=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:p}),e[15]=p,e[16]=j):j=e[16];let S;e[17]!==u?(S=()=>u(!1),e[17]=u,e[18]=S):S=e[18];let v;e[19]!==l?(v=l("orgs.connectionSelectionUi.cancel"),e[19]=l,e[20]=v):v=e[20];let y;e[21]!==S||e[22]!==v?(y=t.jsx(E,{variant:"outline",onClick:S,children:v}),e[21]=S,e[22]=v,e[23]=y):y=e[23];const c=!r;let x;e[24]!==i||e[25]!==u||e[26]!==r?(x=()=>{r&&(i(r),u(!1),d(null))},e[24]=i,e[25]=u,e[26]=r,e[27]=x):x=e[27];let T;e[28]!==l?(T=l("orgs.connectionSelectionUi.add"),e[28]=l,e[29]=T):T=e[29];let k;e[30]!==c||e[31]!==x||e[32]!==T?(k=t.jsx(E,{disabled:c,onClick:x,children:T}),e[30]=c,e[31]=x,e[32]=T,e[33]=k):k=e[33];let w;e[34]!==y||e[35]!==k?(w=t.jsxs(Fe,{children:[y,k]}),e[34]=y,e[35]=k,e[36]=w):w=e[36];let I;e[37]!==w||e[38]!==m||e[39]!==j?(I=t.jsxs(Ue,{className:"sm:max-w-[400px]",children:[m,j,w]}),e[37]=w,e[38]=m,e[39]=j,e[40]=I):I=e[40];let A;return e[41]!==u||e[42]!==n||e[43]!==I?(A=t.jsx(Ve,{open:n,onOpenChange:u,children:I}),e[41]=u,e[42]=n,e[43]=I,e[44]=A):A=e[44],A}function yn({listState:o,activeTab:e,typeFilter:n,statusFilter:u}){const s=te(),{org:i}=ke(),l=nt(),r=Te(),{data:d}=we.useSession(),f=ze(),h=Et(o),g=gt(),{granted:a}=ve("connections:manage"),{granted:m}=ve("agents:manage"),[p,j]=z.useState(new Set),S=p.size>0,[v,y]=z.useState(!1),[c,x]=z.useState(!1),[T,k]=z.useState(null),w=Kt(),I=dn(Wt(w)),A=h.filter(_=>!(n!=="ALL"&&_.connection_type!==n||u!=="ALL"&&_.status!==u)),$=dt(A),O=_=>{j(C=>{const B=new Set(C);return B.has(_)?B.delete(_):B.add(_),B})},P=()=>{j(new Set)},M=Ie(o.searchTerm),V=M.items,b=pt(M.loadMore,M.hasMore,M.isLoadingMore),N=new Set(h.filter(_=>_.app_name).map(_=>_.app_name)),U=o.search.length>0,X=e==="all"||U?V.filter(_=>{if(U){const C=Ae(_);if(C&&N.has(C))return!1}return!0}):[],G=e==="connected"||U?$:[],D=async _=>{if(!(!i||!d?.user?.id)){ee("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),k(_.id);try{const C=ct(_,i.id,d.user.id,{remoteIndex:0}),B=C.connection_type==="STDIO",H=!!C.connection_url,K=B&&C.connection_headers&&typeof C.connection_headers=="object"&&"command"in C.connection_headers;if(!H&&!K){R.error(s("orgs.connections.cannotConnectNoMethod")),k(null);return}const oe=await f.create.mutateAsync(C),{id:ie}=oe,le=await Yt({connectionId:ie,orgId:i.id,orgSlug:i.slug,persistFallback:re=>f.update.mutateAsync({id:ie,data:{connection_token:re}}).then(()=>{})});if(le.ran&&!le.ok){ee("connection_oauth_failed",{connection_id:ie,flow:"connections_page_connect",error:le.error??"no_token"}),R.error(s("orgs.connections.authenticationFailed",{error:le.error??"no token received"}));return}if(le.ran){ee("connection_oauth_succeeded",{connection_id:ie,flow:"connections_page_connect"});const re=new URL(`/api/${i.slug}/mcp/${ie}`,window.location.origin);await l.invalidateQueries({queryKey:ot.isMCPAuthenticated(re.href,null)}),F(),R.success(s("orgs.connections.authenticationSuccessful"))}let pe=null;try{const re=await l.fetchQuery(Bt({connectionId:ie,orgId:i.id,orgSlug:i.slug}));pe=rn((await re.listTools()).tools)}catch{}const be=de(oe),_e=pe?pe.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(pe.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:be}}:null;R.success(s("orgs.connections.connectedSuccessfully"),_e?{action:{label:s("orgs.connections.openConnection"),onClick:()=>r(_e)}}:void 0)}catch(C){R.error(s("orgs.connections.failedToConnect",{error:C instanceof Error?C.message:String(C)}))}finally{k(null)}}},L=st(),F=()=>{l.invalidateQueries({predicate:_=>{const C=_.queryKey;return C[1]===i.id&&C[3]==="collection"&&C[4]==="CONNECTIONS"}})},ge=async()=>{y(!1);const _=[...p];ee("connections_bulk_delete",{count:_.length});const B=(await Promise.allSettled(_.map(H=>L.call("COLLECTION_CONNECTIONS_DELETE",{id:H,force:!0})))).filter(H=>H.status==="fulfilled").length;F(),R.success(s("orgs.connections.deletedConnections",{count:B})),P()},Se=async(_,C)=>{try{await f.update.mutateAsync({id:_,data:{status:C}}),F(),R.success(s(C==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(s("orgs.connections.failedToUpdateConnection"))}},me=async _=>{const C=[...p];ee("connections_bulk_status_toggled",{count:C.length,to_status:_});const H=(await Promise.allSettled(C.map(K=>f.update.mutateAsync({id:K,data:{status:_}})))).filter(K=>K.status==="fulfilled").length;F(),R.success(_==="active"?s("orgs.connections.enabledConnections",{count:H}):s("orgs.connections.disabledConnections",{count:H})),P()},ne=async _=>{const C=w.find(K=>K.id===_);if(!C)return;ee("connections_bulk_add_to_agent",{agent_id:_,count:p.size});const B=new Set(C.connections.map(K=>K.connection_id)),H=[...p].filter(K=>!B.has(K)).map(K=>({connection_id:K,selected_tools:null,selected_resources:null,selected_prompts:null}));if(H.length===0){R.info(s("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await L.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...C.connections,...H]}}),l.invalidateQueries({predicate:K=>{const oe=K.queryKey;return oe[1]===i.id&&oe[3]==="collection"&&oe[4]==="VIRTUAL_MCP"}}),R.success(s("orgs.connections.addedConnectionsToAgent",{count:H.length,agentTitle:C.title})),P()}catch{R.error(s("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(mt,{...g}),t.jsx(cn,{open:v,onOpenChange:y,count:p.size,onConfirm:ge}),t.jsx(Sn,{open:c,onOpenChange:x,agents:w,onConfirm:ne}),M.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(U?X.length===0&&A.length===0:e==="all"?X.length===0:A.length===0)?t.jsx(ut,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:s("orgs.connections.noConnectionsFound"),description:o.search?s("orgs.connections.noConnectionsMatchSearch",{search:o.search}):s(a?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[G.map(_=>{if(_.type==="group")return t.jsx(fn,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:_.key}})},selectionMode:S,selectedIds:p,onToggleSelect:O},_.key);const C=_.connection,B=p.has(C.id);return t.jsx(Ce,{connection:C,fallbackIcon:t.jsx(je,{}),onClick:()=>S?O(C.id):r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:de(C)}}),className:xe(B&&"ring-2 ring-primary bg-primary/5"),selected:S?B:void 0,footer:t.jsx(un,{projects:I.get(C.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(hn,{connection:C,isSelected:B,selectionMode:S,canManage:a,canManageAgents:m,onToggleSelect:()=>O(C.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:de(C)}}),onToggleStatus:H=>Se(C.id,H),onDelete:()=>g.requestDelete(C)})},C.id)}),X.map(_=>t.jsx(ln,{item:_,canManage:a,allConnections:h,connectedAppNames:N,connectingItemId:T,onNavigateConnected:C=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:de(C)}}),onConnect:D},_.id)),(e==="all"||U)&&t.jsx("div",{ref:b,className:"col-span-full h-4"}),(e==="all"||U)&&M.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ue,{className:"size-6 text-muted-foreground"})})]})}),S&&t.jsx(jn,{count:p.size,total:A.length,canManage:a,canManageAgents:m,onSelectAll:()=>{j(new Set(A.map(_=>_.id)))},onDeselectAll:()=>j(new Set),onDelete:()=>y(!0),onAddToAgent:()=>x(!0),onToggleStatus:me,onCancel:P})]})}function vn(){const o=te(),{org:e}=ke(),n=Te(),u=Qe({strict:!1}),{data:s}=we.useSession(),{stdioEnabled:i}=Je(),l=Pe(),{granted:r}=ve("connections:manage"),d=on({namespace:e.slug,resource:"connections"}),f=ze(),[h,g]=Ye(Ze.connectionsTab(e.slug),b=>u.tab==="all"||u.tab==="connected"?u.tab:b??"all"),[a,m]=z.useState("ALL"),[p,j]=z.useState("ALL"),v=Ie(d.searchTerm).items,y=d.search!==d.searchTerm,c=et({resolver:tt(Gt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),x=c.watch("ui_type"),T=c.watch("connection_url"),k=c.watch("npx_package"),w=he({uiType:x,connectionUrl:T??"",npxPackage:k??""})??De({uiType:x,connectionUrl:T??"",registryItems:v}),I=r&&u.action==="create",A=()=>{ee("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},$=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},O=async b=>{let N,U=null,X=null,G=null;b.ui_type==="NPX"?(N="STDIO",U="",G=Qt(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(N="STDIO",U="",G=Jt(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(N=b.ui_type,U=b.connection_url||"",X=b.connection_token||null);const D=it("conn");ee("connection_custom_created",{connection_type:N,ui_type:b.ui_type}),await f.create.mutateAsync({id:D,title:b.title,description:b.description||null,connection_type:N,connection_url:U,connection_token:X,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:s?.user?.id||"system",organization_id:e.id,icon:b.icon??null,app_name:null,app_id:null,connection_headers:G,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),$(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:de({app_name:null,connection_url:U,title:b.title,id:D})}})},P=b=>{b||(I&&$(),c.reset())},M=b=>{const N=b.trim();if(!N)return;const U=!!c.formState.dirtyFields.title,X=!!c.formState.dirtyFields.description,G=!!c.formState.dirtyFields.env_vars,D=F=>{if(F&&(!U&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!X&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!G&&F.envVarKeys?.length)){const ge=c.getValues("env_vars")??[],Se=new Set(ge.map(ne=>ne.key)),me=F.envVarKeys.filter(ne=>!Se.has(ne));me.length>0&&c.setValue("env_vars",[...ge,...me.map(ne=>({key:ne,value:""}))],{shouldDirty:!0})}},L=qt(N);if(L&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",L.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),D(he({uiType:"NPX",npxPackage:L.packageName}));return}if(N.startsWith("http://")||N.startsWith("https://")){const F=x==="HTTP"||x==="SSE"||x==="Websocket"?x:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",N,{shouldDirty:!0}),D(he({uiType:F,connectionUrl:N})??De({uiType:F,connectionUrl:N,registryItems:v}));return}x==="NPX"&&D(he({uiType:"NPX",npxPackage:N}))},V=r?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(E,{size:"sm",variant:"default",onClick:A,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:o("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(fe,{children:[(()=>{const b=o("orgs.connections.createConnection"),N=o("orgs.connections.createConnectionDescription"),U=c.formState.isSubmitting?o("orgs.connections.saving"):o("orgs.connections.createConnection"),X=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(q,{control:c.control,name:"ui_type",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.type")}),t.jsxs(Ft,{value:D.value,onValueChange:D.onChange,children:[t.jsx(Y,{children:t.jsx(Ut,{children:t.jsx(Vt,{})})}),t.jsxs(zt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"Websocket"]})}),i&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),o("orgs.connections.npxPackage")]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Rt,{className:"w-4 h-4"}),o("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),x==="NPX"&&t.jsx(q,{control:c.control,name:"npx_package",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.npmPackage")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.npmPackagePlaceholder"),...D,value:D.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),M(F))},onBlur:L=>{M(L.target.value),D.onBlur()}})}),t.jsx(Z,{})]})}),x==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(q,{control:c.control,name:"stdio_command",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.command")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.commandPlaceholder"),...D,value:D.value??""})}),t.jsx(Z,{})]})}),t.jsx(q,{control:c.control,name:"stdio_args",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.arguments")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.argumentsPlaceholder"),...D,value:D.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:c.control,name:"stdio_cwd",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.workingDirectory")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.workingDirectoryPlaceholder"),...D,value:D.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(x==="NPX"||x==="STDIO")&&t.jsx(q,{control:c.control,name:"env_vars",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.environmentVariables")}),t.jsx(Y,{children:t.jsx(Xt,{value:D.value??[],onChange:D.onChange})}),t.jsx(Z,{})]})}),x!=="NPX"&&x!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(q,{control:c.control,name:"connection_url",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.url")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.urlPlaceholder"),...D,value:D.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),M(F))},onBlur:L=>{M(L.target.value),D.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(q,{control:c.control,name:"connection_token",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:w?.token?.label??o("orgs.connections.tokenOptional")}),t.jsx(Y,{children:t.jsx(se,{type:"password",placeholder:w?.token?.placeholder??o("orgs.connections.tokenPlaceholder"),...D,value:D.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:o("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:c.control,name:"title",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.name")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.namePlaceholder"),...D})}),t.jsx(Z,{})]})}),t.jsx(q,{control:c.control,name:"description",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.description")}),t.jsx(Y,{children:t.jsx(Lt,{placeholder:o("orgs.connections.descriptionPlaceholder"),rows:3,...D,value:D.value??""})}),t.jsx(Z,{})]})})]}),G=I;return l?t.jsx(wt,{open:G,onOpenChange:P,children:t.jsxs(At,{className:"max-h-[90vh]",children:[t.jsx(It,{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(Pt,{children:b}),t.jsx(Mt,{className:"mt-1",children:N})]}),t.jsx($t,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":o("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(O),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:X}),t.jsx(Ot,{children:t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:U})})]})})]})}):t.jsx(Ve,{open:G,onOpenChange:P,children:t.jsxs(Ue,{className:"sm:max-w-[525px]",children:[t.jsxs(Oe,{children:[t.jsx(Me,{children:b}),t.jsx($e,{children:N})]}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(O),children:[t.jsx("div",{className:"py-4",children:X}),t.jsxs(Fe,{children:[t.jsx(E,{type:"button",variant:"outline",onClick:()=>P(!1),children:o("orgs.connections.cancel")}),t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:U})]})]})})]})})})(),t.jsx(fe.Content,{children:t.jsx(fe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(fe.Title,{actions:V,children:o("orgs.connections.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(rt,{value:d.search,onChange:d.setSearch,placeholder:o("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:b=>{b.key==="Escape"&&(d.setSearch(""),b.target.blur())}}),t.jsx(lt,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:o("orgs.connections.sortName")},{id:"description",label:o("orgs.connections.sortDescription")},{id:"connection_type",label:o("orgs.connections.sortType")},{id:"updated_by",label:o("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:o("orgs.connections.sortUpdated")}],filters:[{label:o("orgs.connections.filterType"),value:a,onChange:b=>m(b||"ALL"),options:[{id:"ALL",label:o("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:o("orgs.connections.filterStatus"),value:p,onChange:b=>j(b||"ALL"),options:[{id:"ALL",label:o("orgs.connections.filterAll")},{id:"active",label:o("orgs.connections.filterActive")},{id:"inactive",label:o("orgs.connections.filterInactive")},{id:"error",label:o("orgs.connections.filterError")}]}]})]})}),t.jsx(at,{placement:"page",tabs:[{id:"all",label:o("orgs.connections.tabAll")},{id:"connected",label:o("orgs.connections.tabConnected")}],activeTab:h,onTabChange:b=>{const N=b;N!==h&&ee("connections_page_tab_changed",{to_tab:N}),g(N)}}),t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:y?.5:1,transition:y?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:y?"none":"auto"},children:t.jsx(yn,{listState:d,activeTab:h,typeFilter:a,statusFilter:p})})})]})})})]})})}function Us(){const o=W.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(qe,{children:t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx(vn,{})})}),o[0]=e):e=o[0],e}export{Us as default};
1
+ import{r as z,c as W,b as te,j as t,B as E,h as ue,l as xe,G as ce,F as We,I as Xe,H as Ge,E as qe,X as ke,d as Te,u as Qe,a as we,R as Je,ad as ve,U as Ye,V as Ze,at as et,as as tt,n as fe,q as ee,o as nt,a2 as st,t as R,K as ot}from"./index-BkwVGG61.js";import{a as Ae,g as it,e as ct}from"./extract-connection-data-CMpFLKxZ.js";import{C as lt}from"./collection-display-button-fQZLsPPw.js";import{S as rt}from"./search-input-BUOZ4kam.js";import{C as at}from"./collection-tabs-DZ5NL0dm.js";import{C as Ce,u as Ie,g as dt}from"./connection-card-CLQNp13z.js";import{E as ut}from"./empty-state-C1nhEd0-.js";import{u as gt,D as mt}from"./use-delete-connection-Va4KqXUY.js";import{u as pt}from"./use-infinite-scroll-BnsQBnBU.js";import{u as Pe}from"./use-mobile-Dh8MyBYN.js";import{g as de}from"./connection-slug-CITJ0kGN.js";import{A as ft,a as ht,b as xt,c as jt,g as St,d as yt,e as vt,f as Ct}from"./alert-dialog-BFZCPfXf.js";import{au as je,A as bt,bu as _t,av as Nt,bb as Dt,p as ye}from"./agent-icon-Dnnu07Dp.js";import{g as kt,a as Tt}from"./metadata-D72DunRR.js";import{d as Me,h as $e,c as Oe,e as Fe,b as Ue,D as Ve}from"./dialog-CETaaDWs.js";import{D as wt,a as At,d as It,b as Pt,e as Mt,f as $t,g as Ot}from"./drawer-BWFufjc5.js";import{F as q,b as Q,c as J,d as Y,f as Z,a as Ne}from"./form-0lcPxUaV.js";import{I as se}from"./input-BC8VVwvY.js";import{S as Ft,b as Ut,a as Vt,d as zt,c as ae}from"./select-Bk77xGJr.js";import{T as Lt}from"./textarea-DqtOZ_En.js";import{b as ze,u as Et}from"./use-connection-ub_Ste14.js";import{m as Bt}from"./use-mcp-client-B4p5PsQD.js";import{b as Kt}from"./repository-binding-B1w5M3gR.js";import{g as Ht}from"./types-1jfERRTH.js";import{s as Le}from"./Plus-BPVcSaQ1.js";import{c as Rt}from"./UserSquare-k-BSPAbI.js";import{s as Ee}from"./XClose-DeW6TQBh.js";import{s as Wt}from"./use-project-scope-5CtWl7GN.js";import{i as he,a as De,E as Xt,c as Gt,p as qt,b as Qt,d as Jt}from"./connection-form-helpers-DSaYnQN2.js";import{a as Yt}from"./authenticate-and-persist-oauth-Fhu72ZVZ.js";import{I as Zt}from"./integration-icon-B3X6G1Wg.js";import{C as Be}from"./checkbox-tfdkp6cA.js";import{i as en}from"./DotsVertical-_UiBrHHr.js";import{s as Ke}from"./Image01-C_d_m-XY.js";import{s as He}from"./Trash01-DsSqN_Va.js";import"./connection-DUhRStgE.js";import"./ArrowUp-BTBhPpEu.js";import"./Check-CP73h7yQ.js";import"./tooltip-F9F0ZScm.js";import"./index-cy7uuLPR.js";import"./view-mode-toggle-BFlIWoM5.js";import"./badge-Bx-goeTE.js";import"./SearchMd-CQ_uV2jU.js";import"./useInfiniteQuery-CT33ZGQJ.js";import"./infiniteQueryObserver-Da-u5q9x.js";import"./slugify-CEUa2lfQ.js";import"./AlertCircle-CPQSuuWk.js";import"./Tool01-Cr3g7eFI.js";import"./ArrowLeft-Bvd89_b4.js";import"./ArrowRight-n-IJ4Fik.js";import"./ShoppingBag01-DskCGm9K.js";import"./ZoomOut-Dv2fO7S6.js";import"./Palette-edCnzPtR.js";import"./CheckCircle-BpnJdBCF.js";import"./ChevronUp-CIZg0YhK.js";import"./Copy01-YoGcseNZ.js";import"./CreditCard01-C-9IP3Dn.js";import"./Key01-Di5njQWH.js";import"./Link01-BzReMq2w.js";import"./LinkExternal01-CuSjyiN1.js";import"./Monitor01-C8qvsEmS.js";import"./Sun-CPwiYds_.js";import"./Upload01-CsCOoftz.js";import"./User01-CFCaTmZh.js";import"./Users01-DeynvlqM.js";import"./X-srLHGSHt.js";import"./label-1zPphAKx.js";import"./auth-DYiVP7MT.js";import"./mcp-oauth-C_AhA8BD.js";function tn(o){const e=`deco-filters-${o}`,[n,u]=z.useState(()=>{try{const i=globalThis.localStorage?.getItem(e);if(i)return JSON.parse(i)}catch(i){console.error("Failed to parse stored filters:",i)}return[]});return[n,i=>{u(i);try{globalThis.localStorage?.setItem(e,JSON.stringify(i))}catch(l){console.error("Failed to save filters:",l)}}]}function nn(o){const e=W.c(7),[n,u]=z.useState(o),[s,i]=z.useState(o?"desc":null);let l;e[0]!==s||e[1]!==n?(l=f=>{n!==f?(u(f),i("asc")):s==="asc"?i("desc"):s==="desc"&&(u(void 0),i(null))},e[0]=s,e[1]=n,e[2]=l):l=e[2];const r=l;let d;return e[3]!==r||e[4]!==s||e[5]!==n?(d={sortKey:n,sortDirection:s,handleSort:r},e[3]=r,e[4]=s,e[5]=n,e[6]=d):d=e[6],d}function sn(o,e){const n=W.c(12),u=e===void 0?"cards":e,s=Pe(),i=z.useRef(s),l=o?`deco-view-mode-${o}`:"deco-view-mode";let r;n[0]!==u||n[1]!==l?(r=()=>{const j=globalThis.localStorage?.getItem(l);return j==="cards"||j==="table"?j:u},n[0]=u,n[1]=l,n[2]=r):r=n[2];const[d,f]=z.useState(r);let h;n[3]!==l?(h=j=>{f(j),globalThis.localStorage?.setItem(l,j)},n[3]=l,n[4]=h):h=n[4];const g=h;let a,m;n[5]!==s||n[6]!==d?(a=()=>{!i.current&&s&&d==="table"&&f("cards"),i.current=s},m=[s,d],n[5]=s,n[6]=d,n[7]=a,n[8]=m):(a=n[7],m=n[8]),z.useEffect(a,m);let p;return n[9]!==g||n[10]!==d?(p=[d,g],n[9]=g,n[10]=d,n[11]=p):p=n[11],p}function on(o){const e=W.c(20),{namespace:n,resource:u,defaultSortKey:s,defaultViewMode:i}=o,l=s===void 0?"title":s,r=i===void 0?"table":i,[d,f]=z.useState(""),h=z.useDeferredValue(d),g=`${n}-${u}`,[a,m]=tn(g),p=`studio-${u}-filter-visible-${n}`;let j;e[0]!==p?(j=()=>globalThis.localStorage?.getItem(p)==="true",e[0]=p,e[1]=j):j=e[1];const[S,v]=z.useState(j);let y;e[2]!==p?(y=M=>{v(M),globalThis.localStorage?.setItem(p,String(M))},e[2]=p,e[3]=y):y=e[3];const c=y;let x;e[4]!==S||e[5]!==c?(x=()=>{c(!S)},e[4]=S,e[5]=c,e[6]=x):x=e[6];const T=x,[k,w]=sn(`studio-${u}-${n}`,r),{sortKey:I,sortDirection:A,handleSort:$}=nn(l),O=I;let P;return e[7]!==S||e[8]!==a||e[9]!==$||e[10]!==d||e[11]!==h||e[12]!==c||e[13]!==m||e[14]!==w||e[15]!==A||e[16]!==O||e[17]!==T||e[18]!==k?(P={search:d,searchTerm:h,setSearch:f,filters:a,setFilters:m,filterBarVisible:S,setFilterBarVisible:c,toggleFilterBar:T,viewMode:k,setViewMode:w,sortKey:O,sortDirection:A,handleSort:$},e[7]=S,e[8]=a,e[9]=$,e[10]=d,e[11]=h,e[12]=c,e[13]=m,e[14]=w,e[15]=A,e[16]=O,e[17]=T,e[18]=k,e[19]=P):P=e[19],P}function cn(o){const e=W.c(35),{open:n,onOpenChange:u,count:s,onConfirm:i}=o,l=te(),r=s===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==s||e[1]!==l||e[2]!==r?(d=l(r,{count:s}),e[0]=s,e[1]=l,e[2]=r,e[3]=d):d=e[3];let f;e[4]!==d?(f=t.jsx(ft,{children:d}),e[4]=d,e[5]=f):f=e[5];const h=s===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let g;e[6]!==l||e[7]!==h?(g=l(h),e[6]=l,e[7]=h,e[8]=g):g=e[8];let a;e[9]!==g?(a=t.jsx(ht,{children:g}),e[9]=g,e[10]=a):a=e[10];let m;e[11]!==f||e[12]!==a?(m=t.jsxs(xt,{children:[f,a]}),e[11]=f,e[12]=a,e[13]=m):m=e[13];let p;e[14]!==l?(p=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=p):p=e[15];let j;e[16]!==p?(j=t.jsx(jt,{children:p}),e[16]=p,e[17]=j):j=e[17];const S=s===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let v;e[18]!==s||e[19]!==l||e[20]!==S?(v=l(S,{count:s}),e[18]=s,e[19]=l,e[20]=S,e[21]=v):v=e[21];let y;e[22]!==i||e[23]!==v?(y=t.jsx(St,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:v}),e[22]=i,e[23]=v,e[24]=y):y=e[24];let c;e[25]!==y||e[26]!==j?(c=t.jsxs(yt,{children:[j,y]}),e[25]=y,e[26]=j,e[27]=c):c=e[27];let x;e[28]!==c||e[29]!==m?(x=t.jsxs(vt,{children:[m,c]}),e[28]=c,e[29]=m,e[30]=x):x=e[30];let T;return e[31]!==u||e[32]!==n||e[33]!==x?(T=t.jsx(Ct,{open:n,onOpenChange:u,children:x}),e[31]=u,e[32]=n,e[33]=x,e[34]=T):T=e[34],T}function ln(o){const e=W.c(39),{item:n,canManage:u,allConnections:s,connectedAppNames:i,connectingItemId:l,onNavigateConnected:r,onConnect:d}=o,f=te();let h,g;e[0]!==i||e[1]!==n?(h=Ae(n)??"",g=i.has(h),e[0]=i,e[1]=n,e[2]=h,e[3]=g):(h=e[2],g=e[3]);const a=g;let m;e[4]!==n._meta?(m=kt(n._meta),e[4]=n._meta,e[5]=m):m=e[5];const p=m,j=p?.friendlyName||p?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",S=n.server?.description||n.description||null;let v;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(v=n.server?.icons?.[0]?.src||Tt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=v):v=e[8];const y=v;let c;if(e[9]!==s||e[10]!==h){let V;e[12]!==h?(V=b=>b.connection_type!=="VIRTUAL"&&b.app_name===h,e[12]=h,e[13]=V):V=e[13],c=s.filter(V),e[9]=s,e[10]=h,e[11]=c}else c=e[11];const x=c,T=a||u;let k,w;e[14]!==x||e[15]!==a||e[16]!==n||e[17]!==d||e[18]!==r?(k=()=>{if(a){const V=x[0];V&&r(V);return}w()},w=()=>d(n),e[14]=x,e[15]=a,e[16]=n,e[17]=d,e[18]=r,e[19]=k,e[20]=w):(k=e[19],w=e[20]);let I;e[21]!==S||e[22]!==y||e[23]!==j?(I={title:j,description:S,icon:y},e[21]=S,e[22]=y,e[23]=j,e[24]=I):I=e[24];let A;e[25]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(je,{}),e[25]=A):A=e[25];const $=T?k:void 0;let O;e[26]!==u||e[27]!==l||e[28]!==w||e[29]!==a||e[30]!==n.id||e[31]!==f?(O=a?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:f("orgs.catalogItemCard.connected")}):u&&t.jsx(E,{variant:"outline",size:"sm",className:"h-7 px-3 text-sm font-medium",disabled:l!==null,onClick:V=>{V.stopPropagation(),w()},children:l===n.id?t.jsx(ue,{className:"size-3.5"}):f("orgs.catalogItemCard.connect")}),e[26]=u,e[27]=l,e[28]=w,e[29]=a,e[30]=n.id,e[31]=f,e[32]=O):O=e[32];let P;e[33]!==O?(P=t.jsx("div",{className:"flex items-center gap-2",children:O}),e[33]=O,e[34]=P):P=e[34];let M;return e[35]!==I||e[36]!==$||e[37]!==P?(M=t.jsx(Ce,{connection:I,fallbackIcon:A,onClick:$,headerActionsAlwaysVisible:!0,headerActions:P}),e[35]=I,e[36]=$,e[37]=P,e[38]=M):M=e[38],M}function rn(o){return o?.length?{appToolName:o.find(n=>!!Ht(n._meta))?.name??null}:null}const an=3;function dn(o){const e=new Map;for(const n of o)for(const u of n.connections??[]){const s=e.get(u.connection_id)??[];s.push(n),e.set(u.connection_id,s)}return e}function un(o){const e=W.c(25),{projects:n}=o,u=te();if(n.length===0){let m;e[0]!==u?(m=u("projects.connections.orgWide"),e[0]=u,e[1]=m):m=e[1];let p;return e[2]!==m?(p=t.jsx("span",{className:"text-xs text-muted-foreground",children:m}),e[2]=m,e[3]=p):p=e[3],p}let s,i,l,r;if(e[4]!==n){const m=n.slice(0,an);s=n.length-m.length,r="flex min-w-0 items-center gap-2",i="flex shrink-0 -space-x-1.5",l=m.map(gn),e[4]=n,e[5]=s,e[6]=i,e[7]=l,e[8]=r}else s=e[5],i=e[6],l=e[7],r=e[8];let d;e[9]!==i||e[10]!==l?(d=t.jsx("div",{className:i,children:l}),e[9]=i,e[10]=l,e[11]=d):d=e[11];let f;e[12]!==n[0]?.title||e[13]!==n.length||e[14]!==u?(f=n.length===1?n[0]?.title:u("projects.connections.usedBy",{count:n.length}),e[12]=n[0]?.title,e[13]=n.length,e[14]=u,e[15]=f):f=e[15];let h;e[16]!==f?(h=t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:f}),e[16]=f,e[17]=h):h=e[17];let g;e[18]!==s?(g=s>0&&t.jsx("span",{className:"sr-only",children:s}),e[18]=s,e[19]=g):g=e[19];let a;return e[20]!==r||e[21]!==d||e[22]!==h||e[23]!==g?(a=t.jsxs("div",{className:r,children:[d,h,g]}),e[20]=r,e[21]=d,e[22]=h,e[23]=g,e[24]=a):a=e[24],a}function gn(o){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:o.title,children:t.jsx(bt,{icon:o.icon,name:o.title,size:"xs"})},o.id)}function Re(o){const e=W.c(8),{selectionMode:n,children:u}=o,s=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let i;e[0]!==s?(i=xe("overflow-hidden transition-all duration-150 ease-out",s),e[0]=s,e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(We,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:pn,children:t.jsx(en,{size:20})})}),e[2]=l):l=e[2];let r;e[3]!==u?(r=t.jsxs(Xe,{children:[l,t.jsx(Ge,{align:"end",onClick:mn,children:u})]}),e[3]=u,e[4]=r):r=e[4];let d;return e[5]!==i||e[6]!==r?(d=t.jsx("div",{className:i,children:r}),e[5]=i,e[6]=r,e[7]=d):d=e[7],d}function mn(o){return o.stopPropagation()}function pn(o){return o.stopPropagation()}function fn(o){const e=W.c(57),{group:n,onOpen:u,selectionMode:s,selectedIds:i,onToggleSelect:l}=o,r=te();let d;if(e[0]!==n.connections||e[1]!==i){let N;e[3]!==i?(N=U=>i.has(U.id),e[3]=i,e[4]=N):N=e[4],d=n.connections.every(N),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const f=d;let h;if(e[5]!==n.connections||e[6]!==i){let N;e[8]!==i?(N=U=>i.has(U.id),e[8]=i,e[9]=N):N=e[9],h=n.connections.some(N),e[5]=n.connections,e[6]=i,e[7]=h}else h=e[7];const g=h;let a;e[10]!==f||e[11]!==n.connections||e[12]!==l||e[13]!==i?(a=()=>{for(const N of n.connections)f?i.has(N.id)&&l(N.id):i.has(N.id)||l(N.id)},e[10]=f,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=a):a=e[14];const m=a,p=n.title,j=n.icon;let S;e[15]!==n.connections.length||e[16]!==r?(S=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=S):S=e[17];let v;e[18]!==n.icon||e[19]!==n.title||e[20]!==S?(v={title:p,icon:j,description:S},e[18]=n.icon,e[19]=n.title,e[20]=S,e[21]=v):v=e[21];let y;e[22]!==u||e[23]!==s||e[24]!==m?(y=()=>s?m():u(),e[22]=u,e[23]=s,e[24]=m,e[25]=y):y=e[25];const c=s&&f&&"ring-2 ring-primary",x=s&&g&&!f&&"ring-1 ring-primary/50";let T;e[26]!==x||e[27]!==c?(T=xe(c,x),e[26]=x,e[27]=c,e[28]=T):T=e[28];const k=s?f?!0:g&&"mixed":void 0;let w;e[29]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(je,{}),e[29]=w):w=e[29];let I;e[30]!==f||e[31]!==n.connections.length||e[32]!==s||e[33]!==g||e[34]!==r||e[35]!==m?(I=s?t.jsx(Be,{checked:f?!0:g?"indeterminate":!1,onCheckedChange:m}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:r("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=f,e[31]=n.connections.length,e[32]=s,e[33]=g,e[34]=r,e[35]=m,e[36]=I):I=e[36];let A;e[37]!==u?(A=N=>{N.stopPropagation(),u()},e[37]=u,e[38]=A):A=e[38];let $;e[39]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Ke,{size:16}),e[39]=$):$=e[39];let O;e[40]!==r?(O=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=O):O=e[41];let P;e[42]!==A||e[43]!==O?(P=t.jsxs(ce,{onClick:A,children:[$,O]}),e[42]=A,e[43]=O,e[44]=P):P=e[44];let M;e[45]!==s||e[46]!==P?(M=t.jsx(Re,{selectionMode:s,children:P}),e[45]=s,e[46]=P,e[47]=M):M=e[47];let V;e[48]!==I||e[49]!==M?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[I,M]}),e[48]=I,e[49]=M,e[50]=V):V=e[50];let b;return e[51]!==T||e[52]!==k||e[53]!==V||e[54]!==v||e[55]!==y?(b=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:v,onClick:y,className:T,selected:k,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:V})}),e[51]=T,e[52]=k,e[53]=V,e[54]=v,e[55]=y,e[56]=b):b=e[56],b}function hn(o){const e=W.c(36),{connection:n,isSelected:u,selectionMode:s,canManage:i,canManageAgents:l,onToggleSelect:r,onOpen:d,onToggleStatus:f,onDelete:h}=o,g=te();let a;e[0]!==u||e[1]!==r||e[2]!==s||e[3]!==g?(a=s?t.jsx(Be,{checked:u,onCheckedChange:r,onClick:xn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:g("orgs.connectionSelectionUi.connected")}),e[0]=u,e[1]=r,e[2]=s,e[3]=g,e[4]=a):a=e[4];let m;e[5]!==d?(m=k=>{k.stopPropagation(),d()},e[5]=d,e[6]=m):m=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Ke,{size:16}),e[7]=p):p=e[7];let j;e[8]!==g?(j=g("orgs.connectionSelectionUi.open"),e[8]=g,e[9]=j):j=e[9];let S;e[10]!==m||e[11]!==j?(S=t.jsxs(ce,{onClick:m,children:[p,j]}),e[10]=m,e[11]=j,e[12]=S):S=e[12];let v;e[13]!==i||e[14]!==l||e[15]!==r||e[16]!==g?(v=(i||l)&&t.jsxs(ce,{onClick:k=>{k.stopPropagation(),r()},children:[t.jsx(_t,{size:16}),g("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=r,e[16]=g,e[17]=v):v=e[17];let y;e[18]!==i||e[19]!==n||e[20]!==f||e[21]!==g?(y=i&&(n.status==="active"?t.jsxs(ce,{onClick:k=>{k.stopPropagation(),f("inactive")},children:[t.jsx(Nt,{size:16}),g("orgs.connectionSelectionUi.disable")]}):t.jsxs(ce,{onClick:k=>{k.stopPropagation(),f("active")},children:[t.jsx(Dt,{size:16}),g("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=f,e[21]=g,e[22]=y):y=e[22];let c;e[23]!==i||e[24]!==h||e[25]!==g?(c=i&&t.jsxs(ce,{variant:"destructive",onClick:k=>{k.stopPropagation(),h()},children:[t.jsx(He,{size:16}),g("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=h,e[25]=g,e[26]=c):c=e[26];let x;e[27]!==s||e[28]!==S||e[29]!==v||e[30]!==y||e[31]!==c?(x=t.jsxs(Re,{selectionMode:s,children:[S,v,y,c]}),e[27]=s,e[28]=S,e[29]=v,e[30]=y,e[31]=c,e[32]=x):x=e[32];let T;return e[33]!==a||e[34]!==x?(T=t.jsxs("div",{className:"flex items-center gap-1",children:[a,x]}),e[33]=a,e[34]=x,e[35]=T):T=e[35],T}function xn(o){return o.stopPropagation()}function jn(o){const e=W.c(29),{count:n,total:u,canManage:s,canManageAgents:i,onSelectAll:l,onDeselectAll:r,onDelete:d,onAddToAgent:f,onToggleStatus:h,onCancel:g}=o,a=te();if(n===0)return null;let m;e[0]!==n||e[1]!==a?(m=a("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=a,e[2]=m):m=e[2];let p;e[3]!==m?(p=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:m}),e[3]=m,e[4]=p):p=e[4];let j;e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==a||e[9]!==u?(j=n<u?t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:a("orgs.connectionSelectionUi.selectAll",{total:u})}):t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:a("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=l,e[8]=a,e[9]=u,e[10]=j):j=e[10];let S;e[11]!==i||e[12]!==f||e[13]!==a?(S=i&&t.jsxs(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:f,children:[t.jsx(Le,{size:13}),a("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=f,e[13]=a,e[14]=S):S=e[14];let v;e[15]!==s||e[16]!==d||e[17]!==h||e[18]!==a?(v=s&&t.jsxs(t.Fragment,{children:[t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("active"),children:a("orgs.connectionSelectionUi.enable")}),t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("inactive"),children:a("orgs.connectionSelectionUi.disable")}),t.jsxs(E,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(He,{size:13}),a("orgs.connectionSelectionUi.delete")]})]}),e[15]=s,e[16]=d,e[17]=h,e[18]=a,e[19]=v):v=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ee,{size:13}),e[20]=y):y=e[20];let c;e[21]!==g?(c=t.jsx(E,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:y}),e[21]=g,e[22]=c):c=e[22];let x;return e[23]!==p||e[24]!==j||e[25]!==S||e[26]!==v||e[27]!==c?(x=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:[p,j,S,v,c]})}),e[23]=p,e[24]=j,e[25]=S,e[26]=v,e[27]=c,e[28]=x):x=e[28],x}function Sn(o){const e=W.c(45),{open:n,onOpenChange:u,agents:s,onConfirm:i}=o,l=te(),[r,d]=z.useState(null);let f;e[0]!==l?(f=l("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=l,e[1]=f):f=e[1];let h;e[2]!==f?(h=t.jsx(Me,{children:f}),e[2]=f,e[3]=h):h=e[3];let g;e[4]!==l?(g=l("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=l,e[5]=g):g=e[5];let a;e[6]!==g?(a=t.jsx($e,{children:g}),e[6]=g,e[7]=a):a=e[7];let m;e[8]!==h||e[9]!==a?(m=t.jsxs(Oe,{children:[h,a]}),e[8]=h,e[9]=a,e[10]=m):m=e[10];let p;e[11]!==s||e[12]!==r||e[13]!==l?(p=s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):s.map($=>t.jsxs("button",{type:"button",onClick:()=>d($.id),className:xe("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",r===$.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Zt,{icon:$.icon,name:$.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:$.title}),$.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:$.description})]})]},$.id)),e[11]=s,e[12]=r,e[13]=l,e[14]=p):p=e[14];let j;e[15]!==p?(j=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:p}),e[15]=p,e[16]=j):j=e[16];let S;e[17]!==u?(S=()=>u(!1),e[17]=u,e[18]=S):S=e[18];let v;e[19]!==l?(v=l("orgs.connectionSelectionUi.cancel"),e[19]=l,e[20]=v):v=e[20];let y;e[21]!==S||e[22]!==v?(y=t.jsx(E,{variant:"outline",onClick:S,children:v}),e[21]=S,e[22]=v,e[23]=y):y=e[23];const c=!r;let x;e[24]!==i||e[25]!==u||e[26]!==r?(x=()=>{r&&(i(r),u(!1),d(null))},e[24]=i,e[25]=u,e[26]=r,e[27]=x):x=e[27];let T;e[28]!==l?(T=l("orgs.connectionSelectionUi.add"),e[28]=l,e[29]=T):T=e[29];let k;e[30]!==c||e[31]!==x||e[32]!==T?(k=t.jsx(E,{disabled:c,onClick:x,children:T}),e[30]=c,e[31]=x,e[32]=T,e[33]=k):k=e[33];let w;e[34]!==y||e[35]!==k?(w=t.jsxs(Fe,{children:[y,k]}),e[34]=y,e[35]=k,e[36]=w):w=e[36];let I;e[37]!==w||e[38]!==m||e[39]!==j?(I=t.jsxs(Ue,{className:"sm:max-w-[400px]",children:[m,j,w]}),e[37]=w,e[38]=m,e[39]=j,e[40]=I):I=e[40];let A;return e[41]!==u||e[42]!==n||e[43]!==I?(A=t.jsx(Ve,{open:n,onOpenChange:u,children:I}),e[41]=u,e[42]=n,e[43]=I,e[44]=A):A=e[44],A}function yn({listState:o,activeTab:e,typeFilter:n,statusFilter:u}){const s=te(),{org:i}=ke(),l=nt(),r=Te(),{data:d}=we.useSession(),f=ze(),h=Et(o),g=gt(),{granted:a}=ve("connections:manage"),{granted:m}=ve("agents:manage"),[p,j]=z.useState(new Set),S=p.size>0,[v,y]=z.useState(!1),[c,x]=z.useState(!1),[T,k]=z.useState(null),w=Kt(),I=dn(Wt(w)),A=h.filter(_=>!(n!=="ALL"&&_.connection_type!==n||u!=="ALL"&&_.status!==u)),$=dt(A),O=_=>{j(C=>{const B=new Set(C);return B.has(_)?B.delete(_):B.add(_),B})},P=()=>{j(new Set)},M=Ie(o.searchTerm),V=M.items,b=pt(M.loadMore,M.hasMore,M.isLoadingMore),N=new Set(h.filter(_=>_.app_name).map(_=>_.app_name)),U=o.search.length>0,X=e==="all"||U?V.filter(_=>{if(U){const C=Ae(_);if(C&&N.has(C))return!1}return!0}):[],G=e==="connected"||U?$:[],D=async _=>{if(!(!i||!d?.user?.id)){ee("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),k(_.id);try{const C=ct(_,i.id,d.user.id,{remoteIndex:0}),B=C.connection_type==="STDIO",H=!!C.connection_url,K=B&&C.connection_headers&&typeof C.connection_headers=="object"&&"command"in C.connection_headers;if(!H&&!K){R.error(s("orgs.connections.cannotConnectNoMethod")),k(null);return}const oe=await f.create.mutateAsync(C),{id:ie}=oe,le=await Yt({connectionId:ie,orgId:i.id,orgSlug:i.slug,persistFallback:re=>f.update.mutateAsync({id:ie,data:{connection_token:re}}).then(()=>{})});if(le.ran&&!le.ok){ee("connection_oauth_failed",{connection_id:ie,flow:"connections_page_connect",error:le.error??"no_token"}),R.error(s("orgs.connections.authenticationFailed",{error:le.error??"no token received"}));return}if(le.ran){ee("connection_oauth_succeeded",{connection_id:ie,flow:"connections_page_connect"});const re=new URL(`/api/${i.slug}/mcp/${ie}`,window.location.origin);await l.invalidateQueries({queryKey:ot.isMCPAuthenticated(re.href,null)}),F(),R.success(s("orgs.connections.authenticationSuccessful"))}let pe=null;try{const re=await l.fetchQuery(Bt({connectionId:ie,orgId:i.id,orgSlug:i.slug}));pe=rn((await re.listTools()).tools)}catch{}const be=de(oe),_e=pe?pe.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(pe.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:be}}:null;R.success(s("orgs.connections.connectedSuccessfully"),_e?{action:{label:s("orgs.connections.openConnection"),onClick:()=>r(_e)}}:void 0)}catch(C){R.error(s("orgs.connections.failedToConnect",{error:C instanceof Error?C.message:String(C)}))}finally{k(null)}}},L=st(),F=()=>{l.invalidateQueries({predicate:_=>{const C=_.queryKey;return C[1]===i.id&&C[3]==="collection"&&C[4]==="CONNECTIONS"}})},ge=async()=>{y(!1);const _=[...p];ee("connections_bulk_delete",{count:_.length});const B=(await Promise.allSettled(_.map(H=>L.call("COLLECTION_CONNECTIONS_DELETE",{id:H,force:!0})))).filter(H=>H.status==="fulfilled").length;F(),R.success(s("orgs.connections.deletedConnections",{count:B})),P()},Se=async(_,C)=>{try{await f.update.mutateAsync({id:_,data:{status:C}}),F(),R.success(s(C==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(s("orgs.connections.failedToUpdateConnection"))}},me=async _=>{const C=[...p];ee("connections_bulk_status_toggled",{count:C.length,to_status:_});const H=(await Promise.allSettled(C.map(K=>f.update.mutateAsync({id:K,data:{status:_}})))).filter(K=>K.status==="fulfilled").length;F(),R.success(_==="active"?s("orgs.connections.enabledConnections",{count:H}):s("orgs.connections.disabledConnections",{count:H})),P()},ne=async _=>{const C=w.find(K=>K.id===_);if(!C)return;ee("connections_bulk_add_to_agent",{agent_id:_,count:p.size});const B=new Set(C.connections.map(K=>K.connection_id)),H=[...p].filter(K=>!B.has(K)).map(K=>({connection_id:K,selected_tools:null,selected_resources:null,selected_prompts:null}));if(H.length===0){R.info(s("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await L.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...C.connections,...H]}}),l.invalidateQueries({predicate:K=>{const oe=K.queryKey;return oe[1]===i.id&&oe[3]==="collection"&&oe[4]==="VIRTUAL_MCP"}}),R.success(s("orgs.connections.addedConnectionsToAgent",{count:H.length,agentTitle:C.title})),P()}catch{R.error(s("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(mt,{...g}),t.jsx(cn,{open:v,onOpenChange:y,count:p.size,onConfirm:ge}),t.jsx(Sn,{open:c,onOpenChange:x,agents:w,onConfirm:ne}),M.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(U?X.length===0&&A.length===0:e==="all"?X.length===0:A.length===0)?t.jsx(ut,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:s("orgs.connections.noConnectionsFound"),description:o.search?s("orgs.connections.noConnectionsMatchSearch",{search:o.search}):s(a?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[G.map(_=>{if(_.type==="group")return t.jsx(fn,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:_.key}})},selectionMode:S,selectedIds:p,onToggleSelect:O},_.key);const C=_.connection,B=p.has(C.id);return t.jsx(Ce,{connection:C,fallbackIcon:t.jsx(je,{}),onClick:()=>S?O(C.id):r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:de(C)}}),className:xe(B&&"ring-2 ring-primary bg-primary/5"),selected:S?B:void 0,footer:t.jsx(un,{projects:I.get(C.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(hn,{connection:C,isSelected:B,selectionMode:S,canManage:a,canManageAgents:m,onToggleSelect:()=>O(C.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:de(C)}}),onToggleStatus:H=>Se(C.id,H),onDelete:()=>g.requestDelete(C)})},C.id)}),X.map(_=>t.jsx(ln,{item:_,canManage:a,allConnections:h,connectedAppNames:N,connectingItemId:T,onNavigateConnected:C=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:de(C)}}),onConnect:D},_.id)),(e==="all"||U)&&t.jsx("div",{ref:b,className:"col-span-full h-4"}),(e==="all"||U)&&M.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ue,{className:"size-6 text-muted-foreground"})})]})}),S&&t.jsx(jn,{count:p.size,total:A.length,canManage:a,canManageAgents:m,onSelectAll:()=>{j(new Set(A.map(_=>_.id)))},onDeselectAll:()=>j(new Set),onDelete:()=>y(!0),onAddToAgent:()=>x(!0),onToggleStatus:me,onCancel:P})]})}function vn(){const o=te(),{org:e}=ke(),n=Te(),u=Qe({strict:!1}),{data:s}=we.useSession(),{stdioEnabled:i}=Je(),l=Pe(),{granted:r}=ve("connections:manage"),d=on({namespace:e.slug,resource:"connections"}),f=ze(),[h,g]=Ye(Ze.connectionsTab(e.slug),b=>u.tab==="all"||u.tab==="connected"?u.tab:b??"all"),[a,m]=z.useState("ALL"),[p,j]=z.useState("ALL"),v=Ie(d.searchTerm).items,y=d.search!==d.searchTerm,c=et({resolver:tt(Gt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),x=c.watch("ui_type"),T=c.watch("connection_url"),k=c.watch("npx_package"),w=he({uiType:x,connectionUrl:T??"",npxPackage:k??""})??De({uiType:x,connectionUrl:T??"",registryItems:v}),I=r&&u.action==="create",A=()=>{ee("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},$=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},O=async b=>{let N,U=null,X=null,G=null;b.ui_type==="NPX"?(N="STDIO",U="",G=Qt(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(N="STDIO",U="",G=Jt(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(N=b.ui_type,U=b.connection_url||"",X=b.connection_token||null);const D=it("conn");ee("connection_custom_created",{connection_type:N,ui_type:b.ui_type}),await f.create.mutateAsync({id:D,title:b.title,description:b.description||null,connection_type:N,connection_url:U,connection_token:X,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:s?.user?.id||"system",organization_id:e.id,icon:b.icon??null,app_name:null,app_id:null,connection_headers:G,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),$(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:de({app_name:null,connection_url:U,title:b.title,id:D})}})},P=b=>{b||(I&&$(),c.reset())},M=b=>{const N=b.trim();if(!N)return;const U=!!c.formState.dirtyFields.title,X=!!c.formState.dirtyFields.description,G=!!c.formState.dirtyFields.env_vars,D=F=>{if(F&&(!U&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!X&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!G&&F.envVarKeys?.length)){const ge=c.getValues("env_vars")??[],Se=new Set(ge.map(ne=>ne.key)),me=F.envVarKeys.filter(ne=>!Se.has(ne));me.length>0&&c.setValue("env_vars",[...ge,...me.map(ne=>({key:ne,value:""}))],{shouldDirty:!0})}},L=qt(N);if(L&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",L.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),D(he({uiType:"NPX",npxPackage:L.packageName}));return}if(N.startsWith("http://")||N.startsWith("https://")){const F=x==="HTTP"||x==="SSE"||x==="Websocket"?x:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",N,{shouldDirty:!0}),D(he({uiType:F,connectionUrl:N})??De({uiType:F,connectionUrl:N,registryItems:v}));return}x==="NPX"&&D(he({uiType:"NPX",npxPackage:N}))},V=r?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(E,{size:"sm",variant:"default",onClick:A,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:o("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(fe,{children:[(()=>{const b=o("orgs.connections.createConnection"),N=o("orgs.connections.createConnectionDescription"),U=c.formState.isSubmitting?o("orgs.connections.saving"):o("orgs.connections.createConnection"),X=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(q,{control:c.control,name:"ui_type",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.type")}),t.jsxs(Ft,{value:D.value,onValueChange:D.onChange,children:[t.jsx(Y,{children:t.jsx(Ut,{children:t.jsx(Vt,{})})}),t.jsxs(zt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"Websocket"]})}),i&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),o("orgs.connections.npxPackage")]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Rt,{className:"w-4 h-4"}),o("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),x==="NPX"&&t.jsx(q,{control:c.control,name:"npx_package",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.npmPackage")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.npmPackagePlaceholder"),...D,value:D.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),M(F))},onBlur:L=>{M(L.target.value),D.onBlur()}})}),t.jsx(Z,{})]})}),x==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(q,{control:c.control,name:"stdio_command",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.command")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.commandPlaceholder"),...D,value:D.value??""})}),t.jsx(Z,{})]})}),t.jsx(q,{control:c.control,name:"stdio_args",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.arguments")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.argumentsPlaceholder"),...D,value:D.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:c.control,name:"stdio_cwd",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.workingDirectory")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.workingDirectoryPlaceholder"),...D,value:D.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(x==="NPX"||x==="STDIO")&&t.jsx(q,{control:c.control,name:"env_vars",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.environmentVariables")}),t.jsx(Y,{children:t.jsx(Xt,{value:D.value??[],onChange:D.onChange})}),t.jsx(Z,{})]})}),x!=="NPX"&&x!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(q,{control:c.control,name:"connection_url",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.url")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.urlPlaceholder"),...D,value:D.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),M(F))},onBlur:L=>{M(L.target.value),D.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(q,{control:c.control,name:"connection_token",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:w?.token?.label??o("orgs.connections.tokenOptional")}),t.jsx(Y,{children:t.jsx(se,{type:"password",placeholder:w?.token?.placeholder??o("orgs.connections.tokenPlaceholder"),...D,value:D.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:o("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:c.control,name:"title",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.name")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.namePlaceholder"),...D})}),t.jsx(Z,{})]})}),t.jsx(q,{control:c.control,name:"description",render:({field:D})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.description")}),t.jsx(Y,{children:t.jsx(Lt,{placeholder:o("orgs.connections.descriptionPlaceholder"),rows:3,...D,value:D.value??""})}),t.jsx(Z,{})]})})]}),G=I;return l?t.jsx(wt,{open:G,onOpenChange:P,children:t.jsxs(At,{className:"max-h-[90vh]",children:[t.jsx(It,{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(Pt,{children:b}),t.jsx(Mt,{className:"mt-1",children:N})]}),t.jsx($t,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":o("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(O),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:X}),t.jsx(Ot,{children:t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:U})})]})})]})}):t.jsx(Ve,{open:G,onOpenChange:P,children:t.jsxs(Ue,{className:"sm:max-w-[525px]",children:[t.jsxs(Oe,{children:[t.jsx(Me,{children:b}),t.jsx($e,{children:N})]}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(O),children:[t.jsx("div",{className:"py-4",children:X}),t.jsxs(Fe,{children:[t.jsx(E,{type:"button",variant:"outline",onClick:()=>P(!1),children:o("orgs.connections.cancel")}),t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:U})]})]})})]})})})(),t.jsx(fe.Content,{children:t.jsx(fe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(fe.Title,{actions:V,children:o("orgs.connections.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(rt,{value:d.search,onChange:d.setSearch,placeholder:o("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:b=>{b.key==="Escape"&&(d.setSearch(""),b.target.blur())}}),t.jsx(lt,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:o("orgs.connections.sortName")},{id:"description",label:o("orgs.connections.sortDescription")},{id:"connection_type",label:o("orgs.connections.sortType")},{id:"updated_by",label:o("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:o("orgs.connections.sortUpdated")}],filters:[{label:o("orgs.connections.filterType"),value:a,onChange:b=>m(b||"ALL"),options:[{id:"ALL",label:o("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:o("orgs.connections.filterStatus"),value:p,onChange:b=>j(b||"ALL"),options:[{id:"ALL",label:o("orgs.connections.filterAll")},{id:"active",label:o("orgs.connections.filterActive")},{id:"inactive",label:o("orgs.connections.filterInactive")},{id:"error",label:o("orgs.connections.filterError")}]}]})]})}),t.jsx(at,{placement:"page",tabs:[{id:"all",label:o("orgs.connections.tabAll")},{id:"connected",label:o("orgs.connections.tabConnected")}],activeTab:h,onTabChange:b=>{const N=b;N!==h&&ee("connections_page_tab_changed",{to_tab:N}),g(N)}}),t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:y?.5:1,transition:y?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:y?"none":"auto"},children:t.jsx(yn,{listState:d,activeTab:h,typeFilter:a,statusFilter:p})})})]})})})]})})}function Us(){const o=W.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(qe,{children:t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx(vn,{})})}),o[0]=e):e=o[0],e}export{Us as default};