decocms 4.588.0 → 4.589.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (433) hide show
  1. package/dist/client/assets/{AlertCircle-C1wYCQKa.js → AlertCircle-iHYLI3wA.js} +1 -1
  2. package/dist/client/assets/{AreaChart-C3h8TZP_.js → AreaChart-BYhZUeRP.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DEUSL-Af.js → ArrowLeft-Crx5FZ7V.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-BUikeU5m.js → ArrowRight-ipUtveZC.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-Jo2NpxcZ.js → ArrowUp-CLrfDSfr.js} +1 -1
  6. package/dist/client/assets/{BookOpen01-jt4iWUAm.js → BookOpen01-C_4qgS91.js} +1 -1
  7. package/dist/client/assets/{CartesianChart-SSdc9b7u.js → CartesianChart-uKSvKxUK.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-DILdewcR.js → CategoricalChart-DwLXaENy.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-DTkHxClo.js → CheckCircle-Bcn1SkPC.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-C3dAg-jK.js → ChevronDown-BEVTcfYy.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-CB9nodBH.js → ChevronSelectorVertical-DxrQPHmH.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-IRWvN0bs.js → ChevronUp-BEJWDky5.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-D2z7eRwD.js → CreditCard01-DQXQKw2A.js} +1 -1
  14. package/dist/client/assets/{Eye-BaoSWdOQ.js → Eye-8uguzols.js} +1 -1
  15. package/dist/client/assets/{File02-DshxjDyQ.js → File02-foS0DPWb.js} +1 -1
  16. package/dist/client/assets/{Fingerprint04-BGa9q7Wg.js → Fingerprint04-DJD9RxrF.js} +1 -1
  17. package/dist/client/assets/{Globe04-CmPStKLT.js → Globe04-CMPPLcPg.js} +1 -1
  18. package/dist/client/assets/{Image01-BZ44Kx4X.js → Image01-5QAQlONA.js} +1 -1
  19. package/dist/client/assets/{Key01-CF-3Aw3z.js → Key01-o1uKXv-x.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-CMVOW-pP.js → LayoutLeft-BejjIkGZ.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-D8a_i2U7.js → LinkBroken01-DOKZ024q.js} +1 -1
  22. package/dist/client/assets/{MessageCircle01-DW4_PNZG.js → MessageCircle01-BFCg8Yla.js} +1 -1
  23. package/dist/client/assets/{Minus-CMO3YoJU.js → Minus-CVLCskxk.js} +1 -1
  24. package/dist/client/assets/{Monitor01-Dung5Edg.js → Monitor01-D_volcqW.js} +1 -1
  25. package/dist/client/assets/{Play-fuDOU8F1.js → Play-ClJ-fqo6.js} +1 -1
  26. package/dist/client/assets/{Plus-C3lymMZB.js → Plus-DPgqzlX_.js} +1 -1
  27. package/dist/client/assets/{ReferenceLine-CRzzoVuF.js → ReferenceLine-BUQcJCjj.js} +1 -1
  28. package/dist/client/assets/{SearchMd-DPVHlHgz.js → SearchMd-0hSvyNNc.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-Dfd5AB1h.js → ShoppingBag01-Dzd7DSPA.js} +1 -1
  30. package/dist/client/assets/{Sun-vCtd1mVC.js → Sun-D-iFjrkT.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-BMEV6poX.js → SwitchHorizontal01-fo0U4Jp1.js} +1 -1
  32. package/dist/client/assets/{Tool01-BaohEBY5.js → Tool01-CAPkmPtU.js} +1 -1
  33. package/dist/client/assets/{Tooltip-pQTo2VHk.js → Tooltip-YU2cQ8p5.js} +1 -1
  34. package/dist/client/assets/{Trash01-MjAw8x8_.js → Trash01-BJozO1DS.js} +1 -1
  35. package/dist/client/assets/{TrendUp01-D0RC9MvR.js → TrendUp01-C3pm_0WN.js} +1 -1
  36. package/dist/client/assets/{Upload01-CutujZKW.js → Upload01-DSwYubv_.js} +1 -1
  37. package/dist/client/assets/{UserCheck01-DONIYjNn.js → UserCheck01-UUUmyjQl.js} +1 -1
  38. package/dist/client/assets/{UserSquare-C5Py9azN.js → UserSquare-C9Yfn3z-.js} +1 -1
  39. package/dist/client/assets/{Users01-CVAHFiWF.js → Users01-D4LsevsD.js} +1 -1
  40. package/dist/client/assets/{XClose-CBLfa9LU.js → XClose-2FBIsrt9.js} +1 -1
  41. package/dist/client/assets/{Zap-Bbh4tQj9.js → Zap-CDm_Ehxw.js} +1 -1
  42. package/dist/client/assets/{access-gate-F2_vRjBo.js → access-gate-BwFzBMDO.js} +1 -1
  43. package/dist/client/assets/{add-connection-dialog-CEf8POA5.js → add-connection-dialog-BXLnkEQI.js} +1 -1
  44. package/dist/client/assets/agent-app-CaThun3p.js +1 -0
  45. package/dist/client/assets/{agent-assets-C4p3mh9v.js → agent-assets-DQ6MCcEj.js} +1 -1
  46. package/dist/client/assets/{agent-automation-B-alPZig.js → agent-automation-BqTAjK3Y.js} +1 -1
  47. package/dist/client/assets/{agent-automations-Chqq-WzT.js → agent-automations-B_MlFsas.js} +1 -1
  48. package/dist/client/assets/{agent-blog-B5G4UDbb.js → agent-blog-Cf0tbU1l.js} +2 -2
  49. package/dist/client/assets/{agent-blog-post-BMavHtcz.js → agent-blog-post-31LJFaZl.js} +2 -2
  50. package/dist/client/assets/{agent-calendar-DUZ2YgMA.js → agent-calendar-BPD66_Yn.js} +1 -1
  51. package/dist/client/assets/{agent-capabilities-DpyBBkqG.js → agent-capabilities-BsyhIZjv.js} +1 -1
  52. package/dist/client/assets/{agent-connect-sources-CEulgWSr.js → agent-connect-sources-C5jaXM3z.js} +1 -1
  53. package/dist/client/assets/agent-deck-C4-3n5Um.js +1 -0
  54. package/dist/client/assets/{agent-e2e-C0hB2gkn.js → agent-e2e-B4bXub-8.js} +1 -1
  55. package/dist/client/assets/agent-experiments-Dt4E84CD.js +1 -0
  56. package/dist/client/assets/agent-file-ZoyASwRD.js +1 -0
  57. package/dist/client/assets/agent-hosting-S1nwBnV9.js +1 -0
  58. package/dist/client/assets/{agent-icon-5JzmaVYR.js → agent-icon-BsqGoLFA.js} +1 -1
  59. package/dist/client/assets/agent-library-Dp1THlC2.js +1 -0
  60. package/dist/client/assets/agent-library-file-MqTLUDDf.js +1 -0
  61. package/dist/client/assets/agent-overview-D36Aps5a.js +1 -0
  62. package/dist/client/assets/{agent-releases-DWG6mKzV.js → agent-releases-DU3bmm_0.js} +1 -1
  63. package/dist/client/assets/agent-settings-Cwf8ygyN.js +1 -0
  64. package/dist/client/assets/{agent-site-editor-D81iOOrK.js → agent-site-editor-C14Msw43.js} +1 -1
  65. package/dist/client/assets/agent-site-editor-code-Bfx6tF36.js +2 -0
  66. package/dist/client/assets/agent-site-editor-content-ClE_yu25.js +1 -0
  67. package/dist/client/assets/agent-site-editor-preview-CkOj53vr.js +1 -0
  68. package/dist/client/assets/agent-view-BFaJoYzv.js +1 -0
  69. package/dist/client/assets/{agent-view-guard-DAdKCfAN.js → agent-view-guard-CIz8LGod.js} +1 -1
  70. package/dist/client/assets/{ai-providers-KhmTNYUz.js → ai-providers-r0-0mCmL.js} +1 -1
  71. package/dist/client/assets/{alert-QrjSAWqk.js → alert-DOHGmi4E.js} +1 -1
  72. package/dist/client/assets/{analytics-sections-DurS5EH1.js → analytics-sections-ByzsZ2nT.js} +1 -1
  73. package/dist/client/assets/{api-keys-B1DZmqMX.js → api-keys-Cx-1_N3a.js} +1 -1
  74. package/dist/client/assets/api-keys-DEDTYWqc.js +1 -0
  75. package/dist/client/assets/{app-editor-uVK7ylku.js → app-editor-Dog5XorX.js} +1 -1
  76. package/dist/client/assets/{asset-utils-825nLVjJ.js → asset-utils-bAbYz6KR.js} +1 -1
  77. package/dist/client/assets/{auth-BRTdapwq.js → auth-D7fJVlZI.js} +1 -1
  78. package/dist/client/assets/{auth-catchall-BrkA-LCc.js → auth-catchall-mcIpmHwN.js} +1 -1
  79. package/dist/client/assets/{auth-entry-BidOhb4X.js → auth-entry--fPh4bga.js} +1 -1
  80. package/dist/client/assets/{auth-split-layout-C2t-6xgT.js → auth-split-layout-CgDgkGrM.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-vpbKGKXJ.js → authenticate-and-persist-oauth-CagzPMUa.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-ChRDJi0R.js → automation-list-row-CzmFBSJK.js} +1 -1
  83. package/dist/client/assets/{automation-runs-Bc-nt7MS.js → automation-runs-pGRkVZxp.js} +1 -1
  84. package/dist/client/assets/{automations-jahqUSIW.js → automations-CdiT8rAu.js} +1 -1
  85. package/dist/client/assets/{badge-BwAJrSlX.js → badge-6S4VrRSd.js} +1 -1
  86. package/dist/client/assets/{block-document-BmzbjSg6.js → block-document-W9khPqgD.js} +1 -1
  87. package/dist/client/assets/{blocks-preview-workspace-context-nQk3E9EB.js → blocks-preview-workspace-context-DqT5ijpX.js} +1 -1
  88. package/dist/client/assets/{blocks-tab-states-BXskNszC.js → blocks-tab-states-KPALSuby.js} +1 -1
  89. package/dist/client/assets/{blog-preview-url-DFuIgia2.js → blog-preview-url-B0kKH_hk.js} +1 -1
  90. package/dist/client/assets/{blog-schema-BAh2Vnnk.js → blog-schema-Cq1DY5OT.js} +1 -1
  91. package/dist/client/assets/{blog-source-gate-D0HidE-Q.js → blog-source-gate-BKHgRm5t.js} +1 -1
  92. package/dist/client/assets/{blog-view-gate-BaSrJ8QS.js → blog-view-gate-BSbrrvm1.js} +1 -1
  93. package/dist/client/assets/{buckets-0WEqj_m-.js → buckets-CnsbkFLd.js} +1 -1
  94. package/dist/client/assets/{build-improve-prompt-doc-BjFSDm_b.js → build-improve-prompt-doc-w2XF9qPZ.js} +1 -1
  95. package/dist/client/assets/{calendar-BNov9885.js → calendar-CMiVsJ2O.js} +1 -1
  96. package/dist/client/assets/{capability-load-error-GmWFwhZ1.js → capability-load-error-BsPxZdDg.js} +1 -1
  97. package/dist/client/assets/{category-editor-Cckb8Mrk.js → category-editor-B55wgVpm.js} +1 -1
  98. package/dist/client/assets/{category-tree-DEkrvAfa.js → category-tree-Dx9MEpa8.js} +1 -1
  99. package/dist/client/assets/{chart-CbO0Nof5.js → chart-_k2iqUio.js} +1 -1
  100. package/dist/client/assets/{chat-context-vliaa5pP.js → chat-context-j3hnPPib.js} +1 -1
  101. package/dist/client/assets/{chat-draft-mvxcgHO3.js → chat-draft-C0rM_rqB.js} +1 -1
  102. package/dist/client/assets/{checkbox-RrvLpN6t.js → checkbox-Cdx0XKK4.js} +1 -1
  103. package/dist/client/assets/{choose-editor-DgyXHwhL.js → choose-editor-BD2gD3z5.js} +1 -1
  104. package/dist/client/assets/{cli-auth-success-D-7dwqtb.js → cli-auth-success-DkpbFCDc.js} +1 -1
  105. package/dist/client/assets/{cms-settings-editor-BZw_hCEp.js → cms-settings-editor-B9i94VP_.js} +1 -1
  106. package/dist/client/assets/{cms-store-drafts-feX6WMqS.js → cms-store-drafts-FkDsCDbL.js} +1 -1
  107. package/dist/client/assets/{collapsible-DOhPo0qw.js → collapsible-BzN0Qes0.js} +1 -1
  108. package/dist/client/assets/{collection-detail-U2lvzfax.js → collection-detail-C4Ke0wbG.js} +1 -1
  109. package/dist/client/assets/{collection-display-button-Bg2ZHQuH.js → collection-display-button-BHiOzw31.js} +1 -1
  110. package/dist/client/assets/{collection-search-BHIo_ddJ.js → collection-search-CcaFYOka.js} +1 -1
  111. package/dist/client/assets/{collection-table-wrapper-Dh-qaQL7.js → collection-table-wrapper-DkjjklLa.js} +1 -1
  112. package/dist/client/assets/{collection-tabs-DvlmC9nK.js → collection-tabs-BwesRoId.js} +1 -1
  113. package/dist/client/assets/{combobox-o_zHZ5Hd.js → combobox-JgBd9MSE.js} +1 -1
  114. package/dist/client/assets/{command-CHrpJLNU.js → command-DVSq7p7n.js} +1 -1
  115. package/dist/client/assets/{companion-mcps-section-BdzKPAYx.js → companion-mcps-section-DCGfaw7A.js} +1 -1
  116. package/dist/client/assets/{config-BwHTrULW.js → config-CKkzGJkL.js} +1 -1
  117. package/dist/client/assets/{connect-key-A9QqGqZa.js → connect-key-hZHvW2X-.js} +1 -1
  118. package/dist/client/assets/{connect-layout-ClGjgY5-.js → connect-layout-tKbIMecd.js} +1 -1
  119. package/dist/client/assets/{connect-source-dialog-yUtziEP8.js → connect-source-dialog-CzPiRiCA.js} +1 -1
  120. package/dist/client/assets/{connect-DQEH2Vf5.js → connect-ys4Sl4xB.js} +1 -1
  121. package/dist/client/assets/{connection-card-VJNv_08i.js → connection-card-CJUEGGqR.js} +1 -1
  122. package/dist/client/assets/{connection-detail-CMOLspZS.js → connection-detail-lYpymXb_.js} +1 -1
  123. package/dist/client/assets/{connection-form-helpers-xFANUQG-.js → connection-form-helpers-Ccz7aVvg.js} +1 -1
  124. package/dist/client/assets/{connection-BL1DZL8y.js → connection-nHJUyklo.js} +1 -1
  125. package/dist/client/assets/{connection-slug-DOcsu9cs.js → connection-slug-DUcOK0Fv.js} +1 -1
  126. package/dist/client/assets/{connections-DmH0uTXa.js → connections-D32hrWXX.js} +1 -1
  127. package/dist/client/assets/{content-tab-BILh41Zh.js → content-tab-BrA4C_fM.js} +3 -3
  128. package/dist/client/assets/{context-B0d3qhRS.js → context-C7dlM4xM.js} +1 -1
  129. package/dist/client/assets/{context-menu-ClTHN8tv.js → context-menu-DHrP4gKv.js} +1 -1
  130. package/dist/client/assets/{context-shell-C26mXJ9s.js → context-shell-BUcF0UUg.js} +3 -3
  131. package/dist/client/assets/{create-organization-dialog-BnLyW5eI.js → create-organization-dialog-By1RJqKH.js} +1 -1
  132. package/dist/client/assets/{daily-pulse-CyPDL3Xo.js → daily-pulse-DSk3dDWE.js} +1 -1
  133. package/dist/client/assets/{delete-copy-INY8zmf2.js → delete-copy-Kn8AlU6Q.js} +1 -1
  134. package/dist/client/assets/{device-hint-DVfZ_0ay.js → device-hint-99FRzBRh.js} +1 -1
  135. package/dist/client/assets/{discover-vL02cgFS.js → discover-jVbiCy7Z.js} +1 -1
  136. package/dist/client/assets/{domain-settings-DCZLjNML.js → domain-settings-DTUBY3uJ.js} +1 -1
  137. package/dist/client/assets/{drawer-D7zKYyPf.js → drawer-CEhULiRL.js} +1 -1
  138. package/dist/client/assets/{editor-DvSx5Pu1.js → editor-CX-xsdGa.js} +1 -1
  139. package/dist/client/assets/{editor-classes-Dgo6OXKT.js → editor-classes-BJYykvRM.js} +1 -1
  140. package/dist/client/assets/{empty-message-DG0eX7g2.js → empty-message-BbW3Jun4.js} +1 -1
  141. package/dist/client/assets/{empty-state-OU8KvAyP.js → empty-state-Cojx_Zm8.js} +1 -1
  142. package/dist/client/assets/{empty-state-D6eiyQO3.js → empty-state-DXP-L1Wm.js} +1 -1
  143. package/dist/client/assets/{experiments-tab-choice-Cu58qs-W.js → experiments-tab-choice-Dh5QN5lA.js} +1 -1
  144. package/dist/client/assets/{extract-connection-data-LbbeCt5n.js → extract-connection-data-DpbVANVQ.js} +1 -1
  145. package/dist/client/assets/{feature-gate-Cihbzh6p.js → feature-gate-3H-gGeAe.js} +1 -1
  146. package/dist/client/assets/{feature-paywall-DkZBN3Gg.js → feature-paywall-DleoKpSm.js} +1 -1
  147. package/dist/client/assets/{file-explorer-DIMg-Uuu.js → file-explorer-Cp783Tpn.js} +1 -1
  148. package/dist/client/assets/{file-preview-D9H8g_kY.js → file-preview-8A9Z-Pv6.js} +1 -1
  149. package/dist/client/assets/{file-share-button-IjxnV1xT.js → file-share-button-Dtr80KeB.js} +1 -1
  150. package/dist/client/assets/{file-type-icon-CMHqTGj6.js → file-type-icon-DTjItFVz.js} +1 -1
  151. package/dist/client/assets/{folder-icon-JUDhfdHu.js → folder-icon-CzIe0pJo.js} +1 -1
  152. package/dist/client/assets/{form-D8xpAXPl.js → form-Dol0DPDh.js} +1 -1
  153. package/dist/client/assets/{frame-navigation-BuZ_tyOH.js → frame-navigation-DlUhG149.js} +1 -1
  154. package/dist/client/assets/{gateway-client-Db0L5juP.js → gateway-client-Cv5mFjk5.js} +1 -1
  155. package/dist/client/assets/{general-Cnhq5GeD.js → general-K7Ly14C_.js} +1 -1
  156. package/dist/client/assets/{github-icon-CPMf3VVH.js → github-icon-Df4tGqBJ.js} +1 -1
  157. package/dist/client/assets/{held-block-view-XrVX8KlN.js → held-block-view-CVaa9FfQ.js} +1 -1
  158. package/dist/client/assets/{home-Cq8ntqGs.js → home-CMisahbl.js} +1 -1
  159. package/dist/client/assets/{home-overview-C2PoiE-5.js → home-overview-QXWQEji-.js} +1 -1
  160. package/dist/client/assets/{hosted-reconcile-DUpne5PJ.js → hosted-reconcile-BMXAyYfq.js} +1 -1
  161. package/dist/client/assets/{icon-button-CrEhqBtX.js → icon-button-CdifSdSj.js} +1 -1
  162. package/dist/client/assets/{index-DUngohuH.js → index-4b--WRWP.js} +1 -1
  163. package/dist/client/assets/{index-DGzB6c1q.js → index-BBOoPujC.js} +1 -1
  164. package/dist/client/assets/{index-CcDr-Y8X.js → index-BgM7C0ew.js} +1 -1
  165. package/dist/client/assets/{index-AkLJHs7z.js → index-BgkSXyah.js} +1 -1
  166. package/dist/client/assets/{index-CfR8ZKTK.js → index-BlJBO-4-.js} +1 -1
  167. package/dist/client/assets/{index-bIDLYWvU.js → index-BmbgcyrV.js} +1 -1
  168. package/dist/client/assets/{index-CQd-rPe6.js → index-BybXw0ff.js} +1 -1
  169. package/dist/client/assets/index-C7mH2s-5.css +1 -0
  170. package/dist/client/assets/{index-D2i_pYwo.js → index-CM7QLcHH.js} +5 -5
  171. package/dist/client/assets/{index-LejBmCwV.js → index-COqqVuml.js} +1 -1
  172. package/dist/client/assets/{index-C5cCiApV.js → index-CUq-H9kS.js} +1 -1
  173. package/dist/client/assets/{index-CVMunsMY.js → index-CjeoaOq1.js} +1 -1
  174. package/dist/client/assets/{index-d-1NIOrr.js → index-Cv1rMcuh.js} +1 -1
  175. package/dist/client/assets/{index-Ci-Dro5W.js → index-CvH2MSpo.js} +1 -1
  176. package/dist/client/assets/{index-C8WQbHaK.js → index-VhglRpxf.js} +1 -1
  177. package/dist/client/assets/{index-DT1tUC0k.js → index-XHwfOtpV.js} +1 -1
  178. package/dist/client/assets/{index-CQnlHMgr.js → index-ZityOjdC.js} +1 -1
  179. package/dist/client/assets/{index-redirect-8Emt1n6E.js → index-redirect-8j7UZTHx.js} +1 -1
  180. package/dist/client/assets/{index-Ckt4ty8F.js → index-rm58Ae1x.js} +1 -1
  181. package/dist/client/assets/{infiniteQueryObserver-QvmxM8yp.js → infiniteQueryObserver-DvCgvYkY.js} +1 -1
  182. package/dist/client/assets/{infra-billing-BLl7l-l7.js → infra-billing-Cly584OY.js} +1 -1
  183. package/dist/client/assets/{input-9ttBVl4l.js → input-A3jqLlaQ.js} +3 -3
  184. package/dist/client/assets/{input-BGyzWk1_.js → input-DiaViL4j.js} +1 -1
  185. package/dist/client/assets/{integration-icon-B4igOrSf.js → integration-icon-DiYH80o3.js} +1 -1
  186. package/dist/client/assets/{item-actions-Aez4-bmr.js → item-actions-DloHlq0j.js} +1 -1
  187. package/dist/client/assets/{jira-icon-CJY-Jk0X.js → jira-icon--6KDrxLj.js} +1 -1
  188. package/dist/client/assets/{label-j3g0RaM0.js → label-C3UnAGG4.js} +1 -1
  189. package/dist/client/assets/{layout-Bteopugj.js → layout-DJuaIAka.js} +1 -1
  190. package/dist/client/assets/{legacy-admin-welcome-dialog-BjDc0ZvZ.js → legacy-admin-welcome-dialog-DFUf5Cdu.js} +1 -1
  191. package/dist/client/assets/{legacy-agents-deep-CcPTDmo1.js → legacy-agents-deep-DtW_imiE.js} +1 -1
  192. package/dist/client/assets/{legacy-main-redirect-Bn3YHqi3.js → legacy-main-redirect-BS5y0F2f.js} +1 -1
  193. package/dist/client/assets/library-qh111GTe.js +1 -0
  194. package/dist/client/assets/{library-tab-D4FhyiPJ.js → library-tab-CMlXx_SF.js} +1 -1
  195. package/dist/client/assets/{login-BR1es8iK.js → login-yrc2iZYE.js} +1 -1
  196. package/dist/client/assets/{markdown-B2A6HPlV.js → markdown-Dh0wHZhv.js} +1 -1
  197. package/dist/client/assets/{mcp-app-renderer-BhS5jb3I.js → mcp-app-renderer-DtYrCtmr.js} +1 -1
  198. package/dist/client/assets/{mcp-oauth-DQcSxcPM.js → mcp-oauth-ClKqUQpf.js} +1 -1
  199. package/dist/client/assets/{mcp-oauth-D57QGwp7.js → mcp-oauth-daaKdPIW.js} +1 -1
  200. package/dist/client/assets/{members-BP_PJyGQ.js → members-BX-0kJRN.js} +1 -1
  201. package/dist/client/assets/{memory-KT_xdhqd.js → memory-CtjxvXGU.js} +1 -1
  202. package/dist/client/assets/{mock-board-CHe3YZI3.js → mock-board-DpyDhwr5.js} +3 -3
  203. package/dist/client/assets/{monaco-editor-CrquiBr7.js → monaco-editor-D3Gw1Jfy.js} +1 -1
  204. package/dist/client/assets/monitoring-D_tNIZ2e.js +2 -0
  205. package/dist/client/assets/{monitoring-stats-row-33Fzla51.js → monitoring-stats-row-C6kAl3zD.js} +1 -1
  206. package/dist/client/assets/{multi-select-DXg_pHVL.js → multi-select-DvfLkkrU.js} +1 -1
  207. package/dist/client/assets/{mustache-CC6Wqc9K.js → mustache-CLHAlDpU.js} +1 -1
  208. package/dist/client/assets/{named-rule-step-D7p6T0__.js → named-rule-step-BnZCIvtI.js} +1 -1
  209. package/dist/client/assets/{named-rule-view-BreA3OZ7.js → named-rule-view-DM7JOYEY.js} +1 -1
  210. package/dist/client/assets/{new-project-dialog-nFFir7Y8.js → new-project-dialog-CLqrrOSd.js} +1 -1
  211. package/dist/client/assets/{new-project-store-BxAwHXqh.js → new-project-store-BfCXIlUR.js} +1 -1
  212. package/dist/client/assets/{oauth-callback-BVAtO5LW.js → oauth-callback-C2bvYENs.js} +1 -1
  213. package/dist/client/assets/{oauth-callback-ai-provider-QSarw700.js → oauth-callback-ai-provider-Cv9ZTrWg.js} +1 -1
  214. package/dist/client/assets/{oauth-consent-hMmPXM2-.js → oauth-consent-CXCI4aOM.js} +1 -1
  215. package/dist/client/assets/{onboarding-DS38_8rn.js → onboarding-CvxIS3gV.js} +1 -1
  216. package/dist/client/assets/{openai-conversation-BvnCXWjG.js → openai-conversation-DA7CTgnA.js} +1 -1
  217. package/dist/client/assets/{optimistic-project-sidebar-views-DTSdOM19.js → optimistic-project-sidebar-views-CsRuVxdu.js} +1 -1
  218. package/dist/client/assets/{order-monitor-day-DcdbMdq0.js → order-monitor-day-DyAv0mEB.js} +1 -1
  219. package/dist/client/assets/{organization-choice-DCKVHxum.js → organization-choice-D110x4oD.js} +1 -1
  220. package/dist/client/assets/{orgs-BJ4SWBn6.js → orgs-FQXpiZ1_.js} +1 -1
  221. package/dist/client/assets/{own-accounts-section-Dm8ExRJP.js → own-accounts-section-7akGVJrI.js} +1 -1
  222. package/dist/client/assets/{pair-iesoBa6Z.js → pair-Dm1DLdXS.js} +1 -1
  223. package/dist/client/assets/{parse-sections-CF6CS7KK.js → parse-sections-PsKqddQO.js} +2 -2
  224. package/dist/client/assets/{plan-DwRLo1eg.js → plan-Co0vMUcn.js} +1 -1
  225. package/dist/client/assets/{plan-ladder-CQx4XohT.js → plan-ladder-Cq8l_zYq.js} +1 -1
  226. package/dist/client/assets/{plan-usage-card-CU1hqhEd.js → plan-usage-card-DFxgoAX0.js} +1 -1
  227. package/dist/client/assets/{popover-DuZ7mT05.js → popover-DmtZGzFU.js} +1 -1
  228. package/dist/client/assets/{post-calendar-RMDsvitm.js → post-calendar-Da3q3Ygw.js} +1 -1
  229. package/dist/client/assets/{post-editor-C-jlqiqJ.js → post-editor-Hqz0xhX7.js} +1 -1
  230. package/dist/client/assets/{preview-content-PFfFbaGx.js → preview-content-hEcinhPu.js} +1 -1
  231. package/dist/client/assets/{preview-dialog-8wU07_1E.js → preview-dialog-DljBi3FV.js} +1 -1
  232. package/dist/client/assets/{preview-panel-Cf_1fMfg.js → preview-panel-DO2BIcaB.js} +1 -1
  233. package/dist/client/assets/{preview-tab-WVFcvq8E.js → preview-tab-pXBusHNY.js} +3 -3
  234. package/dist/client/assets/{product-picker-dialog-BL7cRMZT.js → product-picker-dialog-DLj4-KZd.js} +1 -1
  235. package/dist/client/assets/{profile-dhTMTrZ6.js → profile-Dtmbbo3x.js} +1 -1
  236. package/dist/client/assets/{project-app-view-BkAw1jQM.js → project-app-view-BxptOyUa.js} +1 -1
  237. package/dist/client/assets/{project-apps-Dcsb3Y5u.js → project-apps-Cn4DuDQX.js} +1 -1
  238. package/dist/client/assets/{project-icon-BpR6jOBz.js → project-icon-DbKP1qyo.js} +1 -1
  239. package/dist/client/assets/{project-index-CYkX_ZtW.js → project-index-BUELrKzm.js} +1 -1
  240. package/dist/client/assets/project-reports-CNlIBYwg.js +1 -0
  241. package/dist/client/assets/project-tasks-DQYKPSKu.js +1 -0
  242. package/dist/client/assets/{projects-BgDkjTC0.js → projects-BoBHi4SI.js} +1 -1
  243. package/dist/client/assets/{projects-empty-state-DPbMzC9K.js → projects-empty-state-C9ApcIGM.js} +1 -1
  244. package/dist/client/assets/{prompts-BF9jhmc3.js → prompts-jatLyuYM.js} +1 -1
  245. package/dist/client/assets/record-editor-Cp3c1KLb.js +1 -0
  246. package/dist/client/assets/{redirect-editor-C_o1Hzkh.js → redirect-editor-DgMP0xUQ.js} +1 -1
  247. package/dist/client/assets/{reports-B-EM5nUi.js → reports-CdFOpeDD.js} +1 -1
  248. package/dist/client/assets/reports-DOVfNyho.js +1 -0
  249. package/dist/client/assets/{reports-onboarding-CflNAQAt.js → reports-onboarding-D_ZP7_DT.js} +1 -1
  250. package/dist/client/assets/{reports-tab-C1SqZ4Rt.js → reports-tab-B8zZV09K.js} +2 -2
  251. package/dist/client/assets/repositories-HhM0lN0I.js +1 -0
  252. package/dist/client/assets/{repositories-D9sDUGsx.js → repositories-O2ZQLufg.js} +1 -1
  253. package/dist/client/assets/{repository-binding-BL79LH9r.js → repository-binding-DGBKNnnx.js} +1 -1
  254. package/dist/client/assets/{repository-picker-DwWCnHQR.js → repository-picker-Ck1bYhNz.js} +1 -1
  255. package/dist/client/assets/{require-capability-CxZZXTvb.js → require-capability-DWuswMDo.js} +1 -1
  256. package/dist/client/assets/{required-auth-layout-Dq35BF2j.js → required-auth-layout-fGhNBti1.js} +1 -1
  257. package/dist/client/assets/{reset-password-B3Qb6JSM.js → reset-password-YiTpF_34.js} +1 -1
  258. package/dist/client/assets/{resizable-BTfXulP-.js → resizable-utjkC78H.js} +1 -1
  259. package/dist/client/assets/{resolve-tab-icon-CXK-D0YH.js → resolve-tab-icon-Cdcrgm48.js} +1 -1
  260. package/dist/client/assets/{review-settings-CaeicWmL.js → review-settings-HU6DVEY_.js} +1 -1
  261. package/dist/client/assets/{role-color-FAQ1W6m3.js → role-color-Dn3u5B7Y.js} +1 -1
  262. package/dist/client/assets/{roles-CsIBFwe0.js → roles-BICOUyYP.js} +1 -1
  263. package/dist/client/assets/{route-BGJSiBve.js → route-BGXXnJrt.js} +1 -1
  264. package/dist/client/assets/{route-CgKVW_J3.js → route-Ds4xA11c.js} +1 -1
  265. package/dist/client/assets/{route-page-header-CQ-W3wvh.js → route-page-header-B-x8DYPs.js} +1 -1
  266. package/dist/client/assets/route-uH186jXx.js +1 -0
  267. package/dist/client/assets/{sandbox-git-api-OvhDI9kP.js → sandbox-git-api-Dn4SMgAT.js} +1 -1
  268. package/dist/client/assets/{sandbox-lifecycle-context-Bw4f72DR.js → sandbox-lifecycle-context-jNC_clan.js} +1 -1
  269. package/dist/client/assets/{save-status-CoI6LGHD.js → save-status-BV5dLQjb.js} +1 -1
  270. package/dist/client/assets/{schema-CuF9xhNS.js → schema-Ce-FrpNr.js} +1 -1
  271. package/dist/client/assets/{schema-e-gzop_8.js → schema-DcgkXC70.js} +1 -1
  272. package/dist/client/assets/{scroll-area-B87qIVfj.js → scroll-area-b9xVFzV5.js} +1 -1
  273. package/dist/client/assets/{search-input-CAKcgZpp.js → search-input-1i2wqfqT.js} +1 -1
  274. package/dist/client/assets/{search-toggle-DF77iWWe.js → search-toggle-XYuup3CG.js} +1 -1
  275. package/dist/client/assets/{secret-picker-BHSnOkWB.js → secret-picker-DZquDxOH.js} +1 -1
  276. package/dist/client/assets/{secrets--E376qwC.js → secrets-DpZZQQGY.js} +1 -1
  277. package/dist/client/assets/{section-array-field-CUW_8y4c.js → section-array-field-BSHV5f4W.js} +1 -1
  278. package/dist/client/assets/{sections-feeUuJPm.js → sections-Cx2cA7bt.js} +1 -1
  279. package/dist/client/assets/{sections-editor-DDJaWz_Q.js → sections-editor-PxxwYC37.js} +1 -1
  280. package/dist/client/assets/{select-BGtnFfIR.js → select-CaopsMfN.js} +1 -1
  281. package/dist/client/assets/{select-model-By0Hx8yC.js → select-model-BopeKOzD.js} +1 -1
  282. package/dist/client/assets/{seo-editor-DAf5w2Jb.js → seo-editor-aSBXwgtx.js} +1 -1
  283. package/dist/client/assets/{separator-ltSGXEwz.js → separator-HRL3cQc1.js} +1 -1
  284. package/dist/client/assets/{session-runtime-DIqtTbVV.js → session-runtime-DxWcwkbE.js} +1 -1
  285. package/dist/client/assets/settings-tab-DCmoO3Y0.js +1 -0
  286. package/dist/client/assets/{sheet-Dl5xK2Nn.js → sheet-BO3NxzQ5.js} +1 -1
  287. package/dist/client/assets/{shell-layout-DcGcftXj.js → shell-layout-B-KkCs2s.js} +1 -1
  288. package/dist/client/assets/{site-draft-actions-DxRhHgDQ.js → site-draft-actions-JYm0Mn1B.js} +1 -1
  289. package/dist/client/assets/{site-draft-view-CzVerqfB.js → site-draft-view-DNiaphx_.js} +1 -1
  290. package/dist/client/assets/site-editor-Cdx1-RS5.js +1 -0
  291. package/dist/client/assets/{site-editor-toast-FNFHPia1.js → site-editor-toast-Dn6ViTaq.js} +1 -1
  292. package/dist/client/assets/{skills-xGBAOWNw.js → skills-BHa_bfo4.js} +1 -1
  293. package/dist/client/assets/{slider-BKiITx4Z.js → slider-fBCZdjFb.js} +1 -1
  294. package/dist/client/assets/{sortable.esm-dy2EHflk.js → sortable.esm-BFwpd7Bz.js} +1 -1
  295. package/dist/client/assets/{sso-5IN_FX7_.js → sso-DiYuDVPI.js} +1 -1
  296. package/dist/client/assets/{suggestion-B5kbVF5_.js → suggestion-CCkp3p2A.js} +1 -1
  297. package/dist/client/assets/{super-agent-icon-C1_bZlYS.js → super-agent-icon-Dc9HnUHT.js} +1 -1
  298. package/dist/client/assets/{switch-D_6ySlUF.js → switch-D7D2_cGm.js} +1 -1
  299. package/dist/client/assets/{synced-repos-DDoH-_1E.js → synced-repos-BYS6iZQk.js} +1 -1
  300. package/dist/client/assets/{tab-icon-glyph-CGmnKelI.js → tab-icon-glyph--TL2dqdf.js} +1 -1
  301. package/dist/client/assets/{table-Bfr-vt1m.js → table-Byvkq2zY.js} +1 -1
  302. package/dist/client/assets/{tabs-BA-4oEsC.js → tabs-BsgKQ4s5.js} +1 -1
  303. package/dist/client/assets/{task-board-DHpGQG6h.js → task-board-GaVTCBBV.js} +1 -1
  304. package/dist/client/assets/{task-key-Dcb9W2hX.js → task-key-DtysXUVK.js} +1 -1
  305. package/dist/client/assets/{task-route-MJmKHPgU.js → task-route-CUqbdLvO.js} +1 -1
  306. package/dist/client/assets/{task-status-BQcu0cbl.js → task-status-BXqVXI-m.js} +1 -1
  307. package/dist/client/assets/{taskboard-analytics-CIFEwriO.js → taskboard-analytics-B0HWC6O-.js} +1 -1
  308. package/dist/client/assets/tasks-DhSSxaKz.js +1 -0
  309. package/dist/client/assets/{tasks-_qxYN3Pl.js → tasks-miMlN4cx.js} +1 -1
  310. package/dist/client/assets/{textarea-Dr6I78Fc.js → textarea-ZVs6QWMS.js} +1 -1
  311. package/dist/client/assets/{thread-analytics-C6phbawc.js → thread-analytics-BtdyB-95.js} +1 -1
  312. package/dist/client/assets/{thread-button-hq5fMUfA.js → thread-button-BP19iYV6.js} +1 -1
  313. package/dist/client/assets/{thread-intent-BHTVxi5n.js → thread-intent-CXxEw9VY.js} +1 -1
  314. package/dist/client/assets/{thread-route-o6nGmPof.js → thread-route-uvbTgJ88.js} +1 -1
  315. package/dist/client/assets/{thread-route-Clm7FOVJ.js → thread-route-vX4Lb76a.js} +1 -1
  316. package/dist/client/assets/{thread-sheet-body-CaJzvL1M.js → thread-sheet-body-W61B260Q.js} +1 -1
  317. package/dist/client/assets/{time-range-picker-EbUonLui.js → time-range-picker-KAXJCf1A.js} +1 -1
  318. package/dist/client/assets/{toggle-group-DtkvHfko.js → toggle-group-CnZM62uw.js} +1 -1
  319. package/dist/client/assets/{tool-set-selector-BXMUP78p.js → tool-set-selector-DkiUwtNk.js} +1 -1
  320. package/dist/client/assets/{toolbar-icon-button-C2P_K8-S.js → toolbar-icon-button-BIIhydVi.js} +1 -1
  321. package/dist/client/assets/{tooltip-6kGM_eQF.js → tooltip-BQEYSfJS.js} +1 -1
  322. package/dist/client/assets/{tooltipContext-t19BbNo9.js → tooltipContext-DbDWWDqQ.js} +1 -1
  323. package/dist/client/assets/{track-Cg7tJ4yx.js → track-e9xtonv_.js} +1 -1
  324. package/dist/client/assets/{types-lFZQt78s.js → types-DWswJ8mv.js} +1 -1
  325. package/dist/client/assets/{url-slug-j_pbLoit.js → url-slug-DjA6hXx8.js} +1 -1
  326. package/dist/client/assets/{usage-stats-DiNUvJki.js → usage-stats-B9lqQ6Vi.js} +1 -1
  327. package/dist/client/assets/{use-ai-providers-Si6lZfwd.js → use-ai-providers-BG51IkbK.js} +1 -1
  328. package/dist/client/assets/{use-api-keys-Ddie7BSj.js → use-api-keys-BxJnNXoF.js} +1 -1
  329. package/dist/client/assets/{use-apply-named-rule-B4Z9U8kV.js → use-apply-named-rule-C8FWPrxn.js} +1 -1
  330. package/dist/client/assets/use-ask-in-chat-D5OfnzQn.js +1 -0
  331. package/dist/client/assets/{use-automations-Bz4iP-ZG.js → use-automations-DbnU6HJw.js} +1 -1
  332. package/dist/client/assets/{use-autosave-DyMe7ETf.js → use-autosave-D33RJEAf.js} +1 -1
  333. package/dist/client/assets/use-blocks-v8-project-BoPkhD0M.js +1 -0
  334. package/dist/client/assets/use-blog-view-B86NPWtX.js +1 -0
  335. package/dist/client/assets/{use-chat-layout-state-CaYnCJg0.js → use-chat-layout-state-C-ACjcBl.js} +1 -1
  336. package/dist/client/assets/{use-cms-publish-actions-CZJapik6.js → use-cms-publish-actions-ReRXsKsa.js} +1 -1
  337. package/dist/client/assets/{use-connect-companion-RJrPjuPN.js → use-connect-companion-C1XxMwnF.js} +1 -1
  338. package/dist/client/assets/{use-connection-fTbSHOHv.js → use-connection-zSjqu4n6.js} +1 -1
  339. package/dist/client/assets/{use-content-sync-CeQBqmO0.js → use-content-sync-CjWUTBAq.js} +1 -1
  340. package/dist/client/assets/{use-copy-DHcPu_e6.js → use-copy-pqQjGIBG.js} +1 -1
  341. package/dist/client/assets/{use-current-view-DWCNmZ47.js → use-current-view-vcCNv8DD.js} +1 -1
  342. package/dist/client/assets/{use-date-fns-locale-Dkfc7ElU.js → use-date-fns-locale-CZuNa_MT.js} +1 -1
  343. package/dist/client/assets/{use-debounced-autosave-DUVf8Tpe.js → use-debounced-autosave-0vKSwZYP.js} +1 -1
  344. package/dist/client/assets/{use-debounced-value-Do0xF2Om.js → use-debounced-value-DfcYC5J6.js} +1 -1
  345. package/dist/client/assets/{use-deco-credits-BMocp54x.js → use-deco-credits-DxqKl3TU.js} +1 -1
  346. package/dist/client/assets/{use-decopilot-events-CK4eZo3O.js → use-decopilot-events-CMQAe_lU.js} +1 -1
  347. package/dist/client/assets/{use-delete-block-DH7xwbF6.js → use-delete-block-CFJmdzOj.js} +1 -1
  348. package/dist/client/assets/{use-delete-connection-vx3t15Ts.js → use-delete-connection-BHPfP1_h.js} +1 -1
  349. package/dist/client/assets/{use-deployment-admin-Bi_4KgF-.js → use-deployment-admin-CZypPrVT.js} +1 -1
  350. package/dist/client/assets/{use-entitlements-Cecn_eMO.js → use-entitlements-DDuw6b8L.js} +1 -1
  351. package/dist/client/assets/{use-fast-preview-draft-url-CihDCQDU.js → use-fast-preview-draft-url-YZ259K-C.js} +1 -1
  352. package/dist/client/assets/{use-file-configs-D6mTKjkn.js → use-file-configs-CDDhJYZV.js} +1 -1
  353. package/dist/client/assets/{use-id-selection-CR20LUvb.js → use-id-selection-YID_YzI_.js} +1 -1
  354. package/dist/client/assets/{use-in-settings-HuoXuf74.js → use-in-settings-BEbaMise.js} +1 -1
  355. package/dist/client/assets/{use-inbox-feed-DJQlqP2F.js → use-inbox-feed-DB2CtrvR.js} +1 -1
  356. package/dist/client/assets/{use-infinite-scroll-bABoIqF1.js → use-infinite-scroll-B49BW4bH.js} +1 -1
  357. package/dist/client/assets/{use-join-requests-DGYgQnb9.js → use-join-requests-7sKC-hWK.js} +1 -1
  358. package/dist/client/assets/{use-main-panel-tabs-CufAik2P.js → use-main-panel-tabs-CKmMTIf_.js} +1 -1
  359. package/dist/client/assets/{use-mcp-auth-status-CZ1ok4EH.js → use-mcp-auth-status-BuZ66FeQ.js} +1 -1
  360. package/dist/client/assets/{use-mcp-client-lA4u3y89.js → use-mcp-client-B64wHnuV.js} +1 -1
  361. package/dist/client/assets/{use-mcp-prompts-BNqxYTfw.js → use-mcp-prompts-C23e7-j9.js} +1 -1
  362. package/dist/client/assets/{use-mcp-tools-CK9iP7GI.js → use-mcp-tools-Dvg1HkLl.js} +1 -1
  363. package/dist/client/assets/{use-mobile-BG1vBhH-.js → use-mobile-UENbdBUz.js} +1 -1
  364. package/dist/client/assets/{use-move-blocks-CXdSpoYz.js → use-move-blocks-DlRJEeor.js} +1 -1
  365. package/dist/client/assets/{use-navigate-to-agent-BHhJ2VaM.js → use-navigate-to-agent-CSVf4amv.js} +1 -1
  366. package/dist/client/assets/{use-never-published-BrF2X2sL.js → use-never-published-DzAvx8nn.js} +1 -1
  367. package/dist/client/assets/{use-org-fs-lYP9x3KC.js → use-org-fs-BvX9HCNX.js} +1 -1
  368. package/dist/client/assets/{use-org-notice-rObp4Zxr.js → use-org-notice-CX9RQL9x.js} +1 -1
  369. package/dist/client/assets/{use-org-repo-syncs-DI357roP.js → use-org-repo-syncs-Dx0-27sI.js} +1 -1
  370. package/dist/client/assets/{use-org-sso-BG-E2bjp.js → use-org-sso-DCPh9AmN.js} +1 -1
  371. package/dist/client/assets/{use-organization-settings-CLr8-y2J.js → use-organization-settings-Bqv7vsKx.js} +1 -1
  372. package/dist/client/assets/{use-panel-navigate-6rjdBG7q.js → use-panel-navigate-BxbJ8ZAZ.js} +1 -1
  373. package/dist/client/assets/{use-project-native-view-presence-CpzVrHnY.js → use-project-native-view-presence-D5woEtTG.js} +1 -1
  374. package/dist/client/assets/{use-project-scope-esRFkQO3.js → use-project-scope-BUOLpI6_.js} +1 -1
  375. package/dist/client/assets/{use-recent-apps-D-8z9Gvt.js → use-recent-apps-Dlz8hl9S.js} +1 -1
  376. package/dist/client/assets/{use-reports-diagnostic-CUm9A6zF.js → use-reports-diagnostic-CzptLM8W.js} +1 -1
  377. package/dist/client/assets/{use-sandbox-events-DHMWW7Ku.js → use-sandbox-events-CNefffyh.js} +1 -1
  378. package/dist/client/assets/{use-secrets-DVt0aH4I.js → use-secrets-CM2rBe1P.js} +1 -1
  379. package/dist/client/assets/{use-section-preview-base-D-e02r7C.js → use-section-preview-base-8d_iVlol.js} +1 -1
  380. package/dist/client/assets/{use-sidebar-collapsed-CzvwMLEA.js → use-sidebar-collapsed-CBdcfBq2.js} +1 -1
  381. package/dist/client/assets/{use-tags-HZCihpNX.js → use-tags-C1iDbyRX.js} +1 -1
  382. package/dist/client/assets/{use-task-board-analytics-BD5xUav-.js → use-task-board-analytics-BYDsZg64.js} +1 -1
  383. package/dist/client/assets/{use-task-board-item-prs-Btgs_9xn.js → use-task-board-item-prs-BYZFu1Z-.js} +1 -1
  384. package/dist/client/assets/{use-task-board-items-CzS8qL54.js → use-task-board-items-BF60SnNN.js} +1 -1
  385. package/dist/client/assets/{use-task-board-prompts-mJVl9kUl.js → use-task-board-prompts-BxJJDuKd.js} +1 -1
  386. package/dist/client/assets/{use-task-metadata-gC9Senyq.js → use-task-metadata--lsabEC6.js} +1 -1
  387. package/dist/client/assets/{use-thread-outputs-3bGjHXvS.js → use-thread-outputs-BmkTnzaJ.js} +1 -1
  388. package/dist/client/assets/{use-view-draft-kind-DAOleCsb.js → use-view-draft-kind-B8piuikE.js} +1 -1
  389. package/dist/client/assets/{use-voice-input-CcsxQA_e.js → use-voice-input-DU1R1jSr.js} +1 -1
  390. package/dist/client/assets/useInfiniteQuery-C5QtpK6u.js +1 -0
  391. package/dist/client/assets/{useQueries-BBu6I0JI.js → useQueries-Cz_Jqaen.js} +1 -1
  392. package/dist/client/assets/useSuspenseInfiniteQuery-B3VojzV_.js +1 -0
  393. package/dist/client/assets/{users-XTWGlVoa.js → users-CyC8gi8K.js} +1 -1
  394. package/dist/client/assets/{utils-BglHo0I_.js → utils-DbRgnGD0.js} +1 -1
  395. package/dist/client/assets/{variant-calendar-BAvUJsZd.js → variant-calendar-CjXn36hn.js} +1 -1
  396. package/dist/client/assets/{variant-matcher-override-3kKJHYgn.js → variant-matcher-override-Bn-Yrew9.js} +1 -1
  397. package/dist/client/assets/{view-header-BfK0AGWA.js → view-header-BKQqoxa1.js} +1 -1
  398. package/dist/client/assets/{virtual-mcp-BIgZunK3.js → virtual-mcp-DoeeFvfY.js} +1 -1
  399. package/dist/client/assets/{watch-sse-pool-xQMj7Q2K.js → watch-sse-pool-DV_D2Q4a.js} +1 -1
  400. package/dist/client/index.html +2 -2
  401. package/dist/server/server.js +1 -1
  402. package/package.json +1 -1
  403. package/dist/client/assets/agent-app-Cs5Ci1wj.js +0 -1
  404. package/dist/client/assets/agent-deck-BUAWj83N.js +0 -1
  405. package/dist/client/assets/agent-experiments-BSfxOwrU.js +0 -1
  406. package/dist/client/assets/agent-file-CNGT6bMD.js +0 -1
  407. package/dist/client/assets/agent-hosting-BdWaBx2l.js +0 -1
  408. package/dist/client/assets/agent-library-D3DZF-ue.js +0 -1
  409. package/dist/client/assets/agent-library-file-CsnfDLau.js +0 -1
  410. package/dist/client/assets/agent-overview-D4QMyu1i.js +0 -1
  411. package/dist/client/assets/agent-settings-CjrEznsY.js +0 -1
  412. package/dist/client/assets/agent-site-editor-code-D1mSd-Cs.js +0 -2
  413. package/dist/client/assets/agent-site-editor-content-DZO1B689.js +0 -1
  414. package/dist/client/assets/agent-site-editor-preview-5BA66F6-.js +0 -1
  415. package/dist/client/assets/agent-view-Dr7QHtfR.js +0 -1
  416. package/dist/client/assets/api-keys-DNOm7cmQ.js +0 -1
  417. package/dist/client/assets/index-_-faNWQZ.css +0 -1
  418. package/dist/client/assets/library-HxNbnHpT.js +0 -1
  419. package/dist/client/assets/monitoring-hLDyFJ8K.js +0 -2
  420. package/dist/client/assets/project-reports-D_hcpFbz.js +0 -1
  421. package/dist/client/assets/project-tasks-CcY4Q3c7.js +0 -1
  422. package/dist/client/assets/record-editor-DEFLrIEG.js +0 -1
  423. package/dist/client/assets/reports-CienpUIv.js +0 -1
  424. package/dist/client/assets/repositories-B1RdVj12.js +0 -1
  425. package/dist/client/assets/route-CN-Y73to.js +0 -1
  426. package/dist/client/assets/settings-tab-DI3b3B76.js +0 -1
  427. package/dist/client/assets/site-editor-CFrxwnKg.js +0 -1
  428. package/dist/client/assets/tasks-D6zHY8EL.js +0 -1
  429. package/dist/client/assets/use-ask-in-chat-CkOEfFhD.js +0 -1
  430. package/dist/client/assets/use-blocks-v8-project-BsHc-UJ7.js +0 -1
  431. package/dist/client/assets/use-blog-view-CUXzG53e.js +0 -1
  432. package/dist/client/assets/useInfiniteQuery-Bhzp56vf.js +0 -1
  433. package/dist/client/assets/useSuspenseInfiniteQuery-DNLHz-yH.js +0 -1
@@ -1 +1 @@
1
- import{aH as Ne,dA as Me,dy as ze,aI as de,bx as Ee,c as U,b as V,j as t,h as Se,B,r as Q,m as ye,a6 as te,am as Re,V as me,K as ee,d as se,C as _e,au as Ce,gG as Ue,e0 as Fe,n as Ve,hA as ue,a5 as Le,I as J,_ as Be,X as Ge,Z as qe,Y as xe,R as He,f as Ke,hS as Xe,q as Qe,hf as We,aG as Ye,aF as Je,o as Ze,t as Y}from"./index-D2i_pYwo.js";import{g as et}from"./extract-connection-data-LbbeCt5n.js";import{E as we}from"./empty-state-OU8KvAyP.js";import{E as tt,r as st,b as nt,c as it}from"./connection-form-helpers-xFANUQG-.js";import{c as ot,S as at,D as lt}from"./index-LejBmCwV.js";import{u as Ie,T as rt}from"./use-mcp-auth-status-CZ1ok4EH.js";import{a as ct}from"./mcp-oauth-D57QGwp7.js";import{I as ae}from"./integration-icon-B4igOrSf.js";import{s as dt}from"./Plus-C3lymMZB.js";import{b5 as mt,a4 as ut,a_ as xt,a5 as ne}from"./agent-icon-5JzmaVYR.js";import{a as ke,f as pt,s as ft}from"./Tool01-BaohEBY5.js";import{s as re}from"./Trash01-MjAw8x8_.js";import{b as ht,a as gt,c as jt,S as vt,d as bt}from"./sheet-Dl5xK2Nn.js";import{F as q,b as H,c as K,d as L,f as X,e as pe,a as Nt}from"./form-D8xpAXPl.js";import{u as Te,a as Ae,b as St}from"./use-connection-fTbSHOHv.js";import{u as Pe}from"./use-mcp-client-lA4u3y89.js";import{u as yt}from"./use-mcp-tools-CK9iP7GI.js";import{a as _t}from"./use-mcp-prompts-BNqxYTfw.js";import{i as Ct}from"./mcp-oauth-DQcSxcPM.js";import{u as wt,D as It}from"./use-delete-connection-vx3t15Ts.js";import{c as kt}from"./monitoring-stats-row-33Fzla51.js";import{c as Tt,b as At,C as Pt,a as Dt,B as $t}from"./chart-CbO0Nof5.js";import{C as Ot}from"./tooltipContext-t19BbNo9.js";import{u as Mt}from"./repository-binding-BL79LH9r.js";import{T as ie,a as zt,c as oe,b as Et}from"./tabs-BA-4oEsC.js";import{g as De}from"./connection-slug-DOcsu9cs.js";import{n as Rt}from"./BookOpen01-jt4iWUAm.js";import{g as ce}from"./types-lFZQt78s.js";import{M as Ut}from"./mcp-app-renderer-BhS5jb3I.js";import{C as Ft}from"./collection-search-BHIo_ddJ.js";import{B as Vt}from"./badge-BwAJrSlX.js";import{S as fe,b as he,a as ge,d as je,c as G}from"./select-BGtnFfIR.js";import{i as Lt}from"./CheckCircle-DTkHxClo.js";import{t as Bt}from"./ChevronDown-C3dAg-jK.js";import{n as Gt}from"./LinkBroken01-D8a_i2U7.js";import{c as qt}from"./UserSquare-C5Py9azN.js";import{s as Ht}from"./XClose-CBLfa9LU.js";import{p as Kt,i as Xt}from"./connection-BL1DZL8y.js";import{c as Qt}from"./schema-e-gzop_8.js";import"./metadata-D72DunRR.js";import"./Key01-CF-3Aw3z.js";import"./auth-BRTdapwq.js";import"./index-Ci-Dro5W.js";import"./index-DT1tUC0k.js";import"./index-Ckt4ty8F.js";import"./index-BdQq_4o_.js";import"./index-CQnlHMgr.js";import"./popover-DuZ7mT05.js";import"./tooltip-6kGM_eQF.js";import"./index-C8WQbHaK.js";import"./SearchMd-DPVHlHgz.js";import"./use-mobile-BG1vBhH-.js";import"./use-navigate-to-agent-BHhJ2VaM.js";import"./thread-intent-BHTVxi5n.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-xQMj7Q2K.js";import"./task-board-DHpGQG6h.js";import"./schema-CuF9xhNS.js";import"./session-runtime-DIqtTbVV.js";import"./Eye-BaoSWdOQ.js";import"./AlertCircle-C1wYCQKa.js";import"./UserCheck01-DONIYjNn.js";import"./ArrowUp-Jo2NpxcZ.js";import"./ArrowLeft-DEUSL-Af.js";import"./ArrowRight-BUikeU5m.js";import"./Globe04-CmPStKLT.js";import"./TrendUp01-D0RC9MvR.js";import"./ChevronSelectorVertical-CB9nodBH.js";import"./ChevronUp-IRWvN0bs.js";import"./CreditCard01-D2z7eRwD.js";import"./File02-DshxjDyQ.js";import"./MessageCircle01-DW4_PNZG.js";import"./SwitchHorizontal01-BMEV6poX.js";import"./Fingerprint04-BGa9q7Wg.js";import"./Image01-BZ44Kx4X.js";import"./LayoutLeft-CMVOW-pP.js";import"./Minus-CMO3YoJU.js";import"./Monitor01-Dung5Edg.js";import"./Sun-vCtd1mVC.js";import"./Play-fuDOU8F1.js";import"./ShoppingBag01-Dfd5AB1h.js";import"./Upload01-CutujZKW.js";import"./Users01-CVAHFiWF.js";import"./Zap-Bbh4tQj9.js";import"./label-j3g0RaM0.js";import"./CartesianChart-SSdc9b7u.js";import"./CategoricalChart-DILdewcR.js";import"./AreaChart-C3h8TZP_.js";import"./active-indicator-CCMhAsc_.js";import"./url-slug-j_pbLoit.js";const Wt=Ne({scopes:Ee(de()).describe("List of scopes available"),stateSchema:Me(de(),ze()).describe("JSON Schema (draft-07) defining the state structure")}),Yt=[{name:"MCP_CONFIGURATION",inputSchema:Ne({}),outputSchema:Wt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l}=s,a=V();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=Ie(r),x=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,f=n.status!=="active",m=x||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==m?(h=ye("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",m),e[2]=m,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 N;e[9]!==n.status||e[10]!==f||e[11]!==x||e[12]!==a?(N=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:a("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?a("details.connectionInstancesPanel.disabledError"):a("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=x,e[12]=a,e[13]=N):N=e[13];let _;e[14]!==j||e[15]!==N?(_=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,N]}),e[14]=j,e[15]=N,e[16]=_):_=e[16];let y;e[17]!==n||e[18]!==x||e[19]!==o||e[20]!==a?(y=x&&t.jsx(B,{variant:"outline",size:"sm",onClick:()=>o(n),children:a("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=x,e[19]=o,e[20]=a,e[21]=y):y=e[21];let C;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==a?(C=f?t.jsxs(B,{variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(mt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground",onClick:()=>l(n,"inactive"),title:a("details.connectionInstancesPanel.disable"),"aria-label":a("details.connectionInstancesPanel.disable"),children:t.jsx(ut,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=a,e[26]=C):C=e[26];let D;e[27]!==n||e[28]!==c?(D=()=>c(n),e[27]=n,e[28]=c,e[29]=D):D=e[29];let w;e[30]!==a?(w=a("details.connectionInstancesPanel.configure"),e[30]=a,e[31]=w):w=e[31];let $;e[32]!==a?($=a("details.connectionInstancesPanel.configure"),e[32]=a,e[33]=$):$=e[33];let O;e[34]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(ke,{size:13}),e[34]=O):O=e[34];let P;e[35]!==D||e[36]!==w||e[37]!==$?(P=t.jsx(B,{variant:"ghost",size:"icon-sm",onClick:D,title:w,"aria-label":$,children:O}),e[35]=D,e[36]=w,e[37]=$,e[38]=P):P=e[38];let T;e[39]!==n||e[40]!==i?(T=()=>i(n),e[39]=n,e[40]=i,e[41]=T):T=e[41];let S;e[42]!==a?(S=a("details.connectionInstancesPanel.delete"),e[42]=a,e[43]=S):S=e[43];let v;e[44]!==a?(v=a("details.connectionInstancesPanel.delete"),e[44]=a,e[45]=v):v=e[45];let z;e[46]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(re,{size:13}),e[46]=z):z=e[46];let E;e[47]!==T||e[48]!==S||e[49]!==v?(E=t.jsx(B,{variant:"ghost-destructive",size:"icon-sm",onClick:T,title:S,"aria-label":v,children:z}),e[47]=T,e[48]=S,e[49]=v,e[50]=E):E=e[50];let M;e[51]!==P||e[52]!==E||e[53]!==y||e[54]!==C?(M=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,C,P,E]}),e[51]=P,e[52]=E,e[53]=y,e[54]=C,e[55]=M):M=e[55];let A;return e[56]!==M||e[57]!==h||e[58]!==g||e[59]!==_?(A=t.jsxs("div",{className:h,children:[g,_,M]}),e[56]=M,e[57]=h,e[58]=g,e[59]=_,e[60]=A):A=e[60],A}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,o=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 a;e[5]!==n||e[6]!==c?(a=()=>c(n),e[5]=n,e[6]=c,e[7]=a):a=e[7];let r;e[8]!==o?(r=o("details.connectionInstancesPanel.configure"),e[8]=o,e[9]=r):r=e[9];let d;e[10]!==o?(d=o("details.connectionInstancesPanel.configure"),e[10]=o,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ke,{size:13}),e[12]=u):u=e[12];let x;e[13]!==a||e[14]!==r||e[15]!==d?(x=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon-sm",onClick:a,title:r,"aria-label":d,children:u})}),e[13]=a,e[14]=r,e[15]=d,e[16]=x):x=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==x?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,x]}),e[17]=i,e[18]=l,e[19]=x,e[20]=f):f=e[20],f}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l,onAdd:a,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 x;e[3]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=x):x=e[4];let f;e[5]!==r?(f=r?t.jsx(Se,{className:"size-[13px]"}):t.jsx(dt,{size:13}),e[5]=r,e[6]=f):f=e[6];let m;e[7]!==d?(m=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=m):m=e[8];let h;e[9]!==r||e[10]!==a||e[11]!==f||e[12]!==m?(h=t.jsxs(B,{variant:"default",size:"sm",className:"gap-1.5",onClick:a,disabled:r,children:[f,m]}),e[9]=r,e[10]=a,e[11]=f,e[12]=m,e[13]=h):h=e[13];let g;e[14]!==x||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,h]}),e[14]=x,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==o||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==o||e[24]!==c||e[25]!==i||e[26]!==l?(y=C=>t.jsx(Q.Suspense,{fallback:t.jsx(Zt,{instance:C,onConfigure:c}),children:t.jsx(Jt,{instance:C,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l})},C.id),e[23]=o,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],j=n.map(y),e[17]=n,e[18]=o,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let N;e[28]!==j?(N=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=N):N=e[29];let _;return e[30]!==g||e[31]!==N?(_=t.jsxs("div",{className:"surface overflow-hidden",children:[g,N]}),e[30]=g,e[31]=N,e[32]=_):_=e[32],_}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const o=(c.errorMessage??"").trim()||"Unknown error";n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([c,o])=>({message:c,count:o})).sort((c,o)=>o.count-c.count).slice(0,e)}const ss=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ns(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 is={calls:{label:"Tool calls"},errors:{label:"Errors"}};function os(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:o}=s,i=V(),l=Re(),a=ns(o),{data:r}=me({queryKey:ee.connectionActivity(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=kt(r?.logs??[],a,void 0,r?.total,d?.total),x=u.data,f=u.totalCalls>0,m=ts(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")})]})]}),f?t.jsxs("div",{children:[t.jsx(Tt,{config:is,className:"h-16 w-full",children:t.jsxs(At,{data:x,barCategoryGap:"4%",children:[t.jsx(Pt,{content:t.jsx(Dt,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:x.map(ls)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-2xs text-muted-foreground",children:x[0]?.label}),t.jsx("span",{className:"text-2xs text-muted-foreground",children:x[x.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")})}),m.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:m.map(as)})]})]})}function as(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 ls(s,e){return t.jsx(Ot,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function rs(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function cs(){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 ds(s){const e=U.c(22),{connectionId:n}=s,c=V(),[o,i]=Q.useState("14d"),{org:l}=te();let a;e[0]!==c?(a=c("details.connectionActivity.activity"),e[0]=c,e[1]=a):a=e[1];let r;e[2]!==a?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a})}),e[2]=a,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]!==o?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":o===j.value,onClick:()=>i(j.value),className:ye("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",o===j.value?"bg-card text-foreground shadow-edge":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=o,e[7]=u):u=e[7];let x;e[8]!==d||e[9]!==u?(x=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]=x):x=e[10];let f;e[11]!==r||e[12]!==x?(f=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,x]}),e[11]=r,e[12]=x,e[13]=f):f=e[13];let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(cs,{}),e[14]=m):m=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==o?(h=t.jsx(Q.Suspense,{fallback:m,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:o})}),e[15]=n,e[16]=l.id,e[17]=o,e[18]=h):h=e[18];let g;return e[19]!==f||e[20]!==h?(g=t.jsxs("div",{className:"surface overflow-hidden",children:[f,h]}),e[19]=f,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,o=se();let i;e[0]!==o||e[1]!==c||e[2]!==n.id?(i=()=>{const x=crypto.randomUUID();o({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:x}})},e[0]=o,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(_e,{size:16}),e[4]=l):l=e[4];let a;e[5]!==n.icon||e[6]!==n.title?(a=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=a):a=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]!==a||e[13]!==r?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-accent transition-colors group text-left w-full",children:[a,r,d]}),e[11]=i,e[12]=a,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let o;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=a=>t.jsx(ms,{virtualMcp:a,org:c},a.id),e[3]=c,e[4]=l):l=e[4],o=n.map(l),e[0]=c,e[1]=n,e[2]=o}else o=e[2];let i;return e[5]!==o?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:o})}),e[5]=o,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=V(),{org:o}=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=Mt(i);if(!(l.length>0)){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(t.Fragment,{}),e[2]=f):f=e[2],f}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]!==o.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:o.slug})}),e[7]=o.slug,e[8]=l,e[9]=u):u=e[9];let x;return e[10]!==d||e[11]!==u?(x=t.jsxs("div",{className:"surface overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=x):x=e[12],x}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:o}=s,i=V(),l=se(),{org:a}=te();let r;e[0]!==c||e[1]!==a.id||e[2]!==a.slug?(r={connectionId:c,orgId:a.id,orgSlug:a.slug},e[0]=c,e[1]=a.id,e[2]=a.slug,e[3]=r):r=e[3];const d=Pe(r),u=Te(c);let x;e[4]!==u||e[5]!==c?(x=u?De(u):c,e[4]=u,e[5]=c,e[6]=x):x=e[6];const f=x,[m,h]=Q.useState("");let g,j,N,_;if(e[7]!==f||e[8]!==d||e[9]!==l||e[10]!==o||e[11]!==m||e[12]!==i||e[13]!==n){const D=(n??[]).filter(fs),w=m.toLowerCase().trim(),$=w?D.filter(v=>v.name.toLowerCase().includes(w)||v.description&&v.description.toLowerCase().includes(w)):D;let O;e[18]!==f||e[19]!==l||e[20]!==o?(O=v=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(v.name)}})},e[18]=f,e[19]=l,e[20]=o,e[21]=O):O=e[21];const P=O;N="flex flex-col h-full overflow-hidden";let T;e[22]!==i?(T=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=T):T=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=v=>{v.key==="Escape"&&(h(""),v.target.blur())},e[24]=S):S=e[24],e[25]!==m||e[26]!==T?(_=t.jsx(Ft,{value:m,onChange:h,placeholder:T,onKeyDown:S}),e[25]=m,e[26]=T,e[27]=_):_=e[27],g="flex-1 overflow-auto p-5",j=$.length===0?t.jsx(we,{image:null,title:i(m?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(m?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:$.map(v=>{const z=ce(v._meta);return t.jsxs(Ue,{size:"flush",className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>P(v),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Q.Suspense,{fallback:t.jsx(Fe,{className:"h-full w-full"}),children:t.jsx(Ut,{resourceURI:z,toolInfo:{tool:v},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:v.annotations?.title??v.name}),t.jsx(rt,{annotations:v.annotations,_meta:v._meta})]}),v.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:v.description})]})]},v.name)})}),e[7]=f,e[8]=d,e[9]=l,e[10]=o,e[11]=m,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=N,e[17]=_}else g=e[14],j=e[15],N=e[16],_=e[17];let y;e[28]!==g||e[29]!==j?(y=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=y):y=e[30];let C;return e[31]!==N||e[32]!==_||e[33]!==y?(C=t.jsxs("div",{className:N,children:[_,y]}),e[31]=N,e[32]=_,e[33]=y,e[34]=C):C=e[34],C}function fs(s){return!!ce(s._meta)}const ve=[];function $e(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"]),o=e.map(n),i=e[e.length-1];return o.length>=2&&i&&c.has(i)?[o.pop(),...o].join(" "):o.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=V();let o;e[0]!==n||e[1]!==c?(o=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=o):o=e[2];let i;return e[3]!==o?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o})}),e[3]=o,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:o,connectionId:i,org:l}=s,a=c===void 0?ve:c,r=o===void 0?ve:o,d=V(),u=se(),x=Te(i??"");let f;e[0]!==x||e[1]!==i?(f=x?De(x):i,e[0]=x,e[1]=i,e[2]=f):f=e[2];const m=f;let h;e[3]!==m||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(I){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:m,collectionName:"tools",itemId:encodeURIComponent(I)}})},e[3]=m,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(vs),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const N=j;if(n.length+a.length+r.length===0){let b;e[12]!==d?(b=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=b):b=e[13];let I;e[14]!==b?(I=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:b}),e[14]=b,e[15]=I):I=e[15];let k;e[16]!==d?(k=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=k):k=e[17];let F;e[18]!==k?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:k}),e[18]=k,e[19]=F):F=e[19];let W;return e[20]!==I||e[21]!==F?(W=t.jsxs("div",{className:"surface p-5",children:[I,F]}),e[20]=I,e[21]=F,e[22]=W):W=e[22],W}let y;e[23]!==d||e[24]!==n.length?(y=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=y):y=e[25];let C;e[26]!==y?(C=t.jsx(ie,{value:"tools",variant:"underline",children:y}),e[26]=y,e[27]=C):C=e[27];let D;e[28]!==N||e[29]!==d?(D=N&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=N,e[29]=d,e[30]=D):D=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let $;e[33]!==w?($=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=$):$=e[34];let O;e[35]!==d?(O=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=O):O=e[36];let P;e[37]!==O?(P=t.jsx(ie,{value:"resources",variant:"underline",children:O}),e[37]=O,e[38]=P):P=e[38];let T;e[39]!==$||e[40]!==P||e[41]!==C||e[42]!==D?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(zt,{variant:"underline",className:"gap-1",children:[C,D,$,P]})}),e[39]=$,e[40]=P,e[41]=C,e[42]=D,e[43]=T):T=e[43];let S;e[44]!==g||e[45]!==n?(S=n.length>0?n.map(b=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-accent transition-colors cursor-pointer",onClick:()=>g(b.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(pt,{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:$e(b.name)}),b.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:b.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},b.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=S):S=e[46];let v;e[47]!==S?(v=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[47]=S,e[48]=v):v=e[48];let z;e[49]!==i||e[50]!==N||e[51]!==l||e[52]!==n?(z=N&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ps,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=N,e[51]=l,e[52]=n,e[53]=z):z=e[53];let E;e[54]!==a?(E=a.length>0?a.map(js):t.jsx(le,{label:"prompts"}),e[54]=a,e[55]=E):E=e[55];let M;e[56]!==E?(M=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[56]=E,e[57]=M):M=e[57];let A;e[58]!==r?(A=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=A):A=e[59];let R;e[60]!==A?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=R):R=e[61];let p;return e[62]!==T||e[63]!==v||e[64]!==z||e[65]!==M||e[66]!==R?(p=t.jsx("div",{className:"surface overflow-hidden",children:t.jsxs(Et,{defaultValue:"tools",variant:"underline",children:[T,v,z,M,R]})}),e[62]=T,e[63]=v,e[64]=z,e[65]=M,e[66]=R,e[67]=p):p=e[67],p}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(xt,{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 js(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(Rt,{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:$e(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 vs(s){return ce(s._meta)}function bs(s){const e=U.c(13),{connection:n,displayTitle:c}=s,o=c??n.title;let i;e[0]!==n.icon||e[1]!==o?(i=t.jsx(ae,{icon:n.icon,name:o,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=o,e[2]=i):i=e[2];let l;e[3]!==o?(l=t.jsx(Ve.Title,{children:o}),e[3]=o,e[4]=l):l=e[4];let a;e[5]!==n.description?(a=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]=a):a=e[6];let r;e[7]!==l||e[8]!==a?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[7]=l,e[8]=a,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 Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:o}){const i=V(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Le(),d=(()=>{if(typeof a!="string"||!a)return!1;try{const m=new URL(a);return m.hostname==="api.githubcopilot.com"&&m.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",f=x?Kt(e.connection_url):null;return x?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(_e,{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")})]}),f&&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:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(q,{control:s.control,name:"ui_type",render:({field:m})=>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(fe,{value:m.value,onValueChange:m.onChange,children:[t.jsx(L,{children:t.jsxs(he,{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(ge,{})]})}),t.jsxs(je,{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(J,{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(fe,{value:m.value,onValueChange:m.onChange,children:[t.jsx(L,{children:t.jsx(he,{className:"h-10",children:t.jsx(ge,{})})}),t.jsxs(je,{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:m})=>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(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...m,value:m.value||"",className:"h-10"})}),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:m})=>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(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...m,value:m.value||"",className:"h-10"})}),t.jsx(X,{})]})}),t.jsx(q,{control:s.control,name:"stdio_args",render:({field:m})=>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(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...m,value:m.value||"",className:"h-10"})}),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:m})=>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(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...m,value:m.value||"",className:"h-10"})}),t.jsx(X,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(q,{control:s.control,name:"env_vars",render:({field:m})=>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(tt,{value:m.value??[],onChange:m.onChange})}),t.jsx(X,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(q,{control:s.control,name:"connection_token",render:({field:m})=>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(Be,{children:[t.jsx(Ge,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Vt,{variant:"success",className:"gap-1.5",children:[t.jsx(Lt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Bt,{size:12})]})})}),t.jsxs(qe,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(ft,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:o,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.has_connection_token&&m.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:()=>m.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-accent 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(J,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...m,value:m.value||"",className:"h-10"})}),d?t.jsxs(pe,{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(pe,{children:i("details.connectionSidebar.tokenSchemeHint")})]}),t.jsx(X,{})]})})]})}function Ss(s){return s.command==="npx"}function ys(s){return s.args?.find(e=>!e.startsWith("-"))??""}function _s(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,o=st(c.envVars);if(Ss(c)){const l=ys(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o}}const i=_s(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:o}}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=!1,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=nt(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=it(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&&s.connection_token!==void 0,o=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:o,prompts:i,resources:l,siblings:a}){const r=V(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Qe(),x=Ae(),{org:f}=te(),m=wt({onSuccess:()=>{a.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Q.useState(null),[j,N]=Q.useState(!1),_=Ie({connectionId:e}),{data:y}=We(),C=y?.data?.members??[],D=h??s,w=C.find(p=>p.userId===D.created_by),O=s?.connection_type==="VIRTUAL"||_.isAuthenticated,P={...s,tools:o},T=ot(P,Yt),S=Ye({resolver:Je(Qt),values:be(h??s)}),v=S.formState.isDirty,z=async()=>{if(!await S.trigger())return;const b=S.getValues(),I=Cs(b),k=h?.id??e;await x.update.mutateAsync({id:k,data:I}),S.reset(b)},E=()=>{S.reset(be(h??s))},M=async p=>{const b=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:I,tokenInfo:k,error:F}=await ct({connectionId:p,orgSlug:f.slug,...b?{scope:b}:{}});if(F||!I){Y.error(r("details.connection.authFailed",{error:F??""}));return}if(k)try{const Z=await fetch(`/api/${f.slug}/connections/${p}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:k.accessToken,refreshToken:k.refreshToken,expiresIn:k.expiresIn,scope:k.scope,clientId:k.clientId,clientSecret:k.clientSecret,tokenEndpoint:k.tokenEndpoint})});if(!Z.ok)console.error("Failed to save OAuth token:",await Z.text()),await x.update.mutateAsync({id:p,data:{connection_token:I}});else try{await x.update.mutateAsync({id:p,data:{}})}catch(Oe){console.warn("Failed to refresh connection tools after OAuth:",Oe)}}catch(Z){console.error("Error saving OAuth token:",Z),await x.update.mutateAsync({id:p,data:{connection_token:I}})}else await x.update.mutateAsync({id:p,data:{connection_token:I}});const W=new URL(`/api/${f.slug}/mcp/${p}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(W.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>M(s.id),R=async()=>{try{const p=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!p.ok){const I=await p.text();Y.error(r("details.connection.failedRemoveOAuth",{error:I}));return}const b=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(b.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(p){console.error("Error removing OAuth token:",p),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(It,{...m}),t.jsx(ht,{open:h!==null,onOpenChange:p=>{p||g(null)},children:t.jsxs(gt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(jt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(vt,{className:"text-base",children:h?.title??s.title}),t.jsx(bt,{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(Ze,{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(Nt,{...S,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:S.control,name:"title",render:({field:p})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...p})}),t.jsx(X,{})]})}),t.jsx(q,{control:S.control,name:"description",render:({field:p})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(J,{...p,value:p.value||""})}),t.jsx(X,{})]})})]}),t.jsx(Ns,{form:S,connection:h??s,hasOAuthToken:_.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:R}),t.jsx(at,{connection:h??s,form:S,hasMcpBinding:T,isMCPAuthenticated:O,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:A,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:z,disabled:!v||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),v&&t.jsx(B,{variant:"outline",onClick:E,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive",onClick:()=>{const p=h??s;g(null),m.requestDelete(p)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(lt,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(bs,{connection:s,displayTitle:(()=>{const p=a[0]??s;return p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.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(ds,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(es,{instances:a,onConfigure:p=>g(p),onAuthenticate:p=>M(p.id),onDelete:p=>m.requestDelete(p),onToggleStatus:async(p,b)=>{try{await x.update.mutateAsync({id:p.id,data:{status:b}}),Y.success(r(b==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{N(!0);try{const p=a[0]??s,b=p.title.replace(/\s*\(\d+\)\s*$/,""),I=a.length+1,k=`${b} (${I})`,F=et("conn");await x.create.mutateAsync({id:F,title:k,description:p.description??null,connection_type:p.connection_type,connection_url:p.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p.created_by,organization_id:p.organization_id,icon:p.icon??null,app_name:p.app_name??null,app_id:p.app_id??null,connection_headers:p.connection_headers??null,oauth_config:null,configuration_state:p.configuration_state??null,metadata:null,tools:null,bindings:null});const W=new URL(`/api/${f.slug}/mcp/${F}`,window.location.origin),Z=await Ct({url:W.href,token:null,orgId:f.id});Z.supportsOAuth&&!Z.isAuthenticated&&await M(F)}catch(p){console.error("Failed to add connection instance:",p),Y.error(r("details.connection.failedAddInstance"))}finally{N(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:o,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function Is(){const s=U.c(43),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 o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug"},s[1]=o):o=s[1];const{appSlug:i,org:l}=Ke(o),{org:a}=te(),r=Ae();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=St(d),[x,f]=Q.useState(null),m=u.find(A=>A.id===x)??u[0]??null;m&&m.id!==x&&f(m.id);const h=m?.id??"",g=Pe({connectionId:h||null,orgId:a.id,orgSlug:a.slug});let j;s[4]!==g?(j={client:g},s[4]=g,s[5]=j):j=s[5];const{data:N}=yt(j),_=N?N.tools.map($s):(m?.tools??[]).map(Ds);let y;e:{if(u.length<=1){y=_;break e}const A=new Set,R=[],p=As;for(const b of u){const I=b.id===h?_:p(b.tools);for(const k of I)A.has(k.name)||(A.add(k.name),R.push(k))}y=R.length>0?R:_}const C=y;let D;s[6]!==g?(D={client:g},s[6]=g,s[7]=D):D=s[7];const{data:w}=_t(D);let $;s[8]!==g?($={client:g},s[8]=g,s[9]=$):$=s[9];const{data:O}=Xe($);let P;s[10]!==w?.prompts?(P=w?.prompts??[],s[10]=w?.prompts,s[11]=P):P=s[11];let T;s[12]!==P?(T=P.map(Ts),s[12]=P,s[13]=T):T=s[13];const S=T;let v;s[14]!==O?.resources?(v=O?.resources??[],s[14]=O?.resources,s[15]=v):v=s[15];let z;s[16]!==v?(z=v.map(ks),s[16]=v,s[17]=z):z=s[17];const E=z;if(!m){let A;s[18]!==e?(A=e("details.connection.notFoundTitle"),s[18]=e,s[19]=A):A=s[19];let R;s[20]!==e?(R=e("details.connection.notFoundDescription"),s[20]=e,s[21]=R):R=s[21];let p;s[22]!==c||s[23]!==l?(p=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[22]=c,s[23]=l,s[24]=p):p=s[24];let b;s[25]!==e?(b=e("details.connection.backButton"),s[25]=e,s[26]=b):b=s[26];let I;s[27]!==p||s[28]!==b?(I=t.jsx(B,{variant:"outline",onClick:p,children:b}),s[27]=p,s[28]=b,s[29]=I):I=s[29];let k;return s[30]!==A||s[31]!==R||s[32]!==I?(k=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(we,{title:A,description:R,actions:I})}),s[30]=A,s[31]=R,s[32]=I,s[33]=k):k=s[33],k}let M;return s[34]!==r.update.isPending||s[35]!==C||s[36]!==m||s[37]!==h||s[38]!==l||s[39]!==S||s[40]!==E||s[41]!==u?(M=t.jsx(ws,{org:l,connection:m,connectionId:h,isUpdating:r.update.isPending,tools:C,prompts:S,resources:E,siblings:u}),s[34]=r.update.isPending,s[35]=C,s[36]=m,s[37]=h,s[38]=l,s[39]=S,s[40]=E,s[41]=u,s[42]=M):M=s[42],M}function ks(s){return{name:s.name,description:s.description,uri:s.uri}}function Ts(s){return{name:s.name,description:s.description}}function As(s){return(s??[]).map(Ps)}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(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Os(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(He,{children:t.jsx(Q.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Se,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Is,{})})}),s[0]=e):e=s[0],e}function vi(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Os,{}),s[0]=e):e=s[0],e}export{vi as default};
1
+ import{aH as Ne,dA as Me,dy as ze,aI as de,bx as Ee,c as U,b as V,j as t,h as Se,B,r as Q,m as ye,a6 as te,am as Re,V as me,K as ee,d as se,C as _e,au as Ce,gG as Ue,e0 as Fe,n as Ve,hA as ue,a5 as Le,I as J,_ as Be,X as Ge,Z as qe,Y as xe,R as He,f as Ke,hS as Xe,q as Qe,hf as We,aG as Ye,aF as Je,o as Ze,t as Y}from"./index-CM7QLcHH.js";import{g as et}from"./extract-connection-data-DpbVANVQ.js";import{E as we}from"./empty-state-Cojx_Zm8.js";import{E as tt,r as st,b as nt,c as it}from"./connection-form-helpers-Ccz7aVvg.js";import{c as ot,S as at,D as lt}from"./index-COqqVuml.js";import{u as Ie,T as rt}from"./use-mcp-auth-status-BuZ66FeQ.js";import{a as ct}from"./mcp-oauth-daaKdPIW.js";import{I as ae}from"./integration-icon-DiYH80o3.js";import{s as dt}from"./Plus-DPgqzlX_.js";import{b5 as mt,a4 as ut,a_ as xt,a5 as ne}from"./agent-icon-BsqGoLFA.js";import{a as ke,f as pt,s as ft}from"./Tool01-CAPkmPtU.js";import{s as re}from"./Trash01-BJozO1DS.js";import{b as ht,a as gt,c as jt,S as vt,d as bt}from"./sheet-BO3NxzQ5.js";import{F as q,b as H,c as K,d as L,f as X,e as pe,a as Nt}from"./form-Dol0DPDh.js";import{u as Te,a as Ae,b as St}from"./use-connection-zSjqu4n6.js";import{u as Pe}from"./use-mcp-client-B64wHnuV.js";import{u as yt}from"./use-mcp-tools-Dvg1HkLl.js";import{a as _t}from"./use-mcp-prompts-C23e7-j9.js";import{i as Ct}from"./mcp-oauth-ClKqUQpf.js";import{u as wt,D as It}from"./use-delete-connection-BHPfP1_h.js";import{c as kt}from"./monitoring-stats-row-C6kAl3zD.js";import{c as Tt,b as At,C as Pt,a as Dt,B as $t}from"./chart-_k2iqUio.js";import{C as Ot}from"./tooltipContext-DbDWWDqQ.js";import{u as Mt}from"./repository-binding-DGBKNnnx.js";import{T as ie,a as zt,c as oe,b as Et}from"./tabs-BsgKQ4s5.js";import{g as De}from"./connection-slug-DUcOK0Fv.js";import{n as Rt}from"./BookOpen01-C_4qgS91.js";import{g as ce}from"./types-DWswJ8mv.js";import{M as Ut}from"./mcp-app-renderer-DtYrCtmr.js";import{C as Ft}from"./collection-search-CcaFYOka.js";import{B as Vt}from"./badge-6S4VrRSd.js";import{S as fe,b as he,a as ge,d as je,c as G}from"./select-CaopsMfN.js";import{i as Lt}from"./CheckCircle-Bcn1SkPC.js";import{t as Bt}from"./ChevronDown-BEVTcfYy.js";import{n as Gt}from"./LinkBroken01-DOKZ024q.js";import{c as qt}from"./UserSquare-C9Yfn3z-.js";import{s as Ht}from"./XClose-2FBIsrt9.js";import{p as Kt,i as Xt}from"./connection-nHJUyklo.js";import{c as Qt}from"./schema-DcgkXC70.js";import"./metadata-D72DunRR.js";import"./Key01-o1uKXv-x.js";import"./auth-D7fJVlZI.js";import"./index-CvH2MSpo.js";import"./index-XHwfOtpV.js";import"./index-rm58Ae1x.js";import"./index-BdQq_4o_.js";import"./index-ZityOjdC.js";import"./popover-DmtZGzFU.js";import"./tooltip-BQEYSfJS.js";import"./index-VhglRpxf.js";import"./SearchMd-0hSvyNNc.js";import"./use-mobile-UENbdBUz.js";import"./use-navigate-to-agent-CSVf4amv.js";import"./thread-intent-CXxEw9VY.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-DV_D2Q4a.js";import"./task-board-GaVTCBBV.js";import"./schema-Ce-FrpNr.js";import"./session-runtime-DxWcwkbE.js";import"./Eye-8uguzols.js";import"./AlertCircle-iHYLI3wA.js";import"./UserCheck01-UUUmyjQl.js";import"./ArrowUp-CLrfDSfr.js";import"./ArrowLeft-Crx5FZ7V.js";import"./ArrowRight-ipUtveZC.js";import"./Globe04-CMPPLcPg.js";import"./TrendUp01-C3pm_0WN.js";import"./ChevronSelectorVertical-DxrQPHmH.js";import"./ChevronUp-BEJWDky5.js";import"./CreditCard01-DQXQKw2A.js";import"./File02-foS0DPWb.js";import"./MessageCircle01-BFCg8Yla.js";import"./SwitchHorizontal01-fo0U4Jp1.js";import"./Fingerprint04-DJD9RxrF.js";import"./Image01-5QAQlONA.js";import"./LayoutLeft-BejjIkGZ.js";import"./Minus-CVLCskxk.js";import"./Monitor01-D_volcqW.js";import"./Sun-D-iFjrkT.js";import"./Play-ClJ-fqo6.js";import"./ShoppingBag01-Dzd7DSPA.js";import"./Upload01-DSwYubv_.js";import"./Users01-D4LsevsD.js";import"./Zap-CDm_Ehxw.js";import"./label-C3UnAGG4.js";import"./CartesianChart-uKSvKxUK.js";import"./CategoricalChart-DwLXaENy.js";import"./AreaChart-BYhZUeRP.js";import"./active-indicator-CCMhAsc_.js";import"./url-slug-DjA6hXx8.js";const Wt=Ne({scopes:Ee(de()).describe("List of scopes available"),stateSchema:Me(de(),ze()).describe("JSON Schema (draft-07) defining the state structure")}),Yt=[{name:"MCP_CONFIGURATION",inputSchema:Ne({}),outputSchema:Wt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l}=s,a=V();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=Ie(r),x=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,f=n.status!=="active",m=x||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==m?(h=ye("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",m),e[2]=m,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 N;e[9]!==n.status||e[10]!==f||e[11]!==x||e[12]!==a?(N=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:a("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?a("details.connectionInstancesPanel.disabledError"):a("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=x,e[12]=a,e[13]=N):N=e[13];let _;e[14]!==j||e[15]!==N?(_=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,N]}),e[14]=j,e[15]=N,e[16]=_):_=e[16];let y;e[17]!==n||e[18]!==x||e[19]!==o||e[20]!==a?(y=x&&t.jsx(B,{variant:"outline",size:"sm",onClick:()=>o(n),children:a("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=x,e[19]=o,e[20]=a,e[21]=y):y=e[21];let C;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==a?(C=f?t.jsxs(B,{variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(mt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground",onClick:()=>l(n,"inactive"),title:a("details.connectionInstancesPanel.disable"),"aria-label":a("details.connectionInstancesPanel.disable"),children:t.jsx(ut,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=a,e[26]=C):C=e[26];let D;e[27]!==n||e[28]!==c?(D=()=>c(n),e[27]=n,e[28]=c,e[29]=D):D=e[29];let w;e[30]!==a?(w=a("details.connectionInstancesPanel.configure"),e[30]=a,e[31]=w):w=e[31];let $;e[32]!==a?($=a("details.connectionInstancesPanel.configure"),e[32]=a,e[33]=$):$=e[33];let O;e[34]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(ke,{size:13}),e[34]=O):O=e[34];let P;e[35]!==D||e[36]!==w||e[37]!==$?(P=t.jsx(B,{variant:"ghost",size:"icon-sm",onClick:D,title:w,"aria-label":$,children:O}),e[35]=D,e[36]=w,e[37]=$,e[38]=P):P=e[38];let T;e[39]!==n||e[40]!==i?(T=()=>i(n),e[39]=n,e[40]=i,e[41]=T):T=e[41];let S;e[42]!==a?(S=a("details.connectionInstancesPanel.delete"),e[42]=a,e[43]=S):S=e[43];let v;e[44]!==a?(v=a("details.connectionInstancesPanel.delete"),e[44]=a,e[45]=v):v=e[45];let z;e[46]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(re,{size:13}),e[46]=z):z=e[46];let E;e[47]!==T||e[48]!==S||e[49]!==v?(E=t.jsx(B,{variant:"ghost-destructive",size:"icon-sm",onClick:T,title:S,"aria-label":v,children:z}),e[47]=T,e[48]=S,e[49]=v,e[50]=E):E=e[50];let M;e[51]!==P||e[52]!==E||e[53]!==y||e[54]!==C?(M=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,C,P,E]}),e[51]=P,e[52]=E,e[53]=y,e[54]=C,e[55]=M):M=e[55];let A;return e[56]!==M||e[57]!==h||e[58]!==g||e[59]!==_?(A=t.jsxs("div",{className:h,children:[g,_,M]}),e[56]=M,e[57]=h,e[58]=g,e[59]=_,e[60]=A):A=e[60],A}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,o=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 a;e[5]!==n||e[6]!==c?(a=()=>c(n),e[5]=n,e[6]=c,e[7]=a):a=e[7];let r;e[8]!==o?(r=o("details.connectionInstancesPanel.configure"),e[8]=o,e[9]=r):r=e[9];let d;e[10]!==o?(d=o("details.connectionInstancesPanel.configure"),e[10]=o,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ke,{size:13}),e[12]=u):u=e[12];let x;e[13]!==a||e[14]!==r||e[15]!==d?(x=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon-sm",onClick:a,title:r,"aria-label":d,children:u})}),e[13]=a,e[14]=r,e[15]=d,e[16]=x):x=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==x?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,x]}),e[17]=i,e[18]=l,e[19]=x,e[20]=f):f=e[20],f}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l,onAdd:a,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 x;e[3]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=x):x=e[4];let f;e[5]!==r?(f=r?t.jsx(Se,{className:"size-[13px]"}):t.jsx(dt,{size:13}),e[5]=r,e[6]=f):f=e[6];let m;e[7]!==d?(m=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=m):m=e[8];let h;e[9]!==r||e[10]!==a||e[11]!==f||e[12]!==m?(h=t.jsxs(B,{variant:"default",size:"sm",className:"gap-1.5",onClick:a,disabled:r,children:[f,m]}),e[9]=r,e[10]=a,e[11]=f,e[12]=m,e[13]=h):h=e[13];let g;e[14]!==x||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,h]}),e[14]=x,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==o||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==o||e[24]!==c||e[25]!==i||e[26]!==l?(y=C=>t.jsx(Q.Suspense,{fallback:t.jsx(Zt,{instance:C,onConfigure:c}),children:t.jsx(Jt,{instance:C,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l})},C.id),e[23]=o,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],j=n.map(y),e[17]=n,e[18]=o,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let N;e[28]!==j?(N=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=N):N=e[29];let _;return e[30]!==g||e[31]!==N?(_=t.jsxs("div",{className:"surface overflow-hidden",children:[g,N]}),e[30]=g,e[31]=N,e[32]=_):_=e[32],_}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const o=(c.errorMessage??"").trim()||"Unknown error";n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([c,o])=>({message:c,count:o})).sort((c,o)=>o.count-c.count).slice(0,e)}const ss=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ns(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 is={calls:{label:"Tool calls"},errors:{label:"Errors"}};function os(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:o}=s,i=V(),l=Re(),a=ns(o),{data:r}=me({queryKey:ee.connectionActivity(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=kt(r?.logs??[],a,void 0,r?.total,d?.total),x=u.data,f=u.totalCalls>0,m=ts(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")})]})]}),f?t.jsxs("div",{children:[t.jsx(Tt,{config:is,className:"h-16 w-full",children:t.jsxs(At,{data:x,barCategoryGap:"4%",children:[t.jsx(Pt,{content:t.jsx(Dt,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:x.map(ls)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-2xs text-muted-foreground",children:x[0]?.label}),t.jsx("span",{className:"text-2xs text-muted-foreground",children:x[x.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")})}),m.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:m.map(as)})]})]})}function as(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 ls(s,e){return t.jsx(Ot,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function rs(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function cs(){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 ds(s){const e=U.c(22),{connectionId:n}=s,c=V(),[o,i]=Q.useState("14d"),{org:l}=te();let a;e[0]!==c?(a=c("details.connectionActivity.activity"),e[0]=c,e[1]=a):a=e[1];let r;e[2]!==a?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a})}),e[2]=a,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]!==o?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":o===j.value,onClick:()=>i(j.value),className:ye("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",o===j.value?"bg-card text-foreground shadow-edge":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=o,e[7]=u):u=e[7];let x;e[8]!==d||e[9]!==u?(x=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]=x):x=e[10];let f;e[11]!==r||e[12]!==x?(f=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,x]}),e[11]=r,e[12]=x,e[13]=f):f=e[13];let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(cs,{}),e[14]=m):m=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==o?(h=t.jsx(Q.Suspense,{fallback:m,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:o})}),e[15]=n,e[16]=l.id,e[17]=o,e[18]=h):h=e[18];let g;return e[19]!==f||e[20]!==h?(g=t.jsxs("div",{className:"surface overflow-hidden",children:[f,h]}),e[19]=f,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,o=se();let i;e[0]!==o||e[1]!==c||e[2]!==n.id?(i=()=>{const x=crypto.randomUUID();o({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:x}})},e[0]=o,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(_e,{size:16}),e[4]=l):l=e[4];let a;e[5]!==n.icon||e[6]!==n.title?(a=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=a):a=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]!==a||e[13]!==r?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-accent transition-colors group text-left w-full",children:[a,r,d]}),e[11]=i,e[12]=a,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let o;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=a=>t.jsx(ms,{virtualMcp:a,org:c},a.id),e[3]=c,e[4]=l):l=e[4],o=n.map(l),e[0]=c,e[1]=n,e[2]=o}else o=e[2];let i;return e[5]!==o?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:o})}),e[5]=o,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=V(),{org:o}=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=Mt(i);if(!(l.length>0)){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(t.Fragment,{}),e[2]=f):f=e[2],f}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]!==o.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:o.slug})}),e[7]=o.slug,e[8]=l,e[9]=u):u=e[9];let x;return e[10]!==d||e[11]!==u?(x=t.jsxs("div",{className:"surface overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=x):x=e[12],x}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:o}=s,i=V(),l=se(),{org:a}=te();let r;e[0]!==c||e[1]!==a.id||e[2]!==a.slug?(r={connectionId:c,orgId:a.id,orgSlug:a.slug},e[0]=c,e[1]=a.id,e[2]=a.slug,e[3]=r):r=e[3];const d=Pe(r),u=Te(c);let x;e[4]!==u||e[5]!==c?(x=u?De(u):c,e[4]=u,e[5]=c,e[6]=x):x=e[6];const f=x,[m,h]=Q.useState("");let g,j,N,_;if(e[7]!==f||e[8]!==d||e[9]!==l||e[10]!==o||e[11]!==m||e[12]!==i||e[13]!==n){const D=(n??[]).filter(fs),w=m.toLowerCase().trim(),$=w?D.filter(v=>v.name.toLowerCase().includes(w)||v.description&&v.description.toLowerCase().includes(w)):D;let O;e[18]!==f||e[19]!==l||e[20]!==o?(O=v=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(v.name)}})},e[18]=f,e[19]=l,e[20]=o,e[21]=O):O=e[21];const P=O;N="flex flex-col h-full overflow-hidden";let T;e[22]!==i?(T=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=T):T=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=v=>{v.key==="Escape"&&(h(""),v.target.blur())},e[24]=S):S=e[24],e[25]!==m||e[26]!==T?(_=t.jsx(Ft,{value:m,onChange:h,placeholder:T,onKeyDown:S}),e[25]=m,e[26]=T,e[27]=_):_=e[27],g="flex-1 overflow-auto p-5",j=$.length===0?t.jsx(we,{image:null,title:i(m?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(m?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:$.map(v=>{const z=ce(v._meta);return t.jsxs(Ue,{size:"flush",className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>P(v),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Q.Suspense,{fallback:t.jsx(Fe,{className:"h-full w-full"}),children:t.jsx(Ut,{resourceURI:z,toolInfo:{tool:v},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:v.annotations?.title??v.name}),t.jsx(rt,{annotations:v.annotations,_meta:v._meta})]}),v.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:v.description})]})]},v.name)})}),e[7]=f,e[8]=d,e[9]=l,e[10]=o,e[11]=m,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=N,e[17]=_}else g=e[14],j=e[15],N=e[16],_=e[17];let y;e[28]!==g||e[29]!==j?(y=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=y):y=e[30];let C;return e[31]!==N||e[32]!==_||e[33]!==y?(C=t.jsxs("div",{className:N,children:[_,y]}),e[31]=N,e[32]=_,e[33]=y,e[34]=C):C=e[34],C}function fs(s){return!!ce(s._meta)}const ve=[];function $e(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"]),o=e.map(n),i=e[e.length-1];return o.length>=2&&i&&c.has(i)?[o.pop(),...o].join(" "):o.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=V();let o;e[0]!==n||e[1]!==c?(o=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=o):o=e[2];let i;return e[3]!==o?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o})}),e[3]=o,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:o,connectionId:i,org:l}=s,a=c===void 0?ve:c,r=o===void 0?ve:o,d=V(),u=se(),x=Te(i??"");let f;e[0]!==x||e[1]!==i?(f=x?De(x):i,e[0]=x,e[1]=i,e[2]=f):f=e[2];const m=f;let h;e[3]!==m||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(I){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:m,collectionName:"tools",itemId:encodeURIComponent(I)}})},e[3]=m,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(vs),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const N=j;if(n.length+a.length+r.length===0){let b;e[12]!==d?(b=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=b):b=e[13];let I;e[14]!==b?(I=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:b}),e[14]=b,e[15]=I):I=e[15];let k;e[16]!==d?(k=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=k):k=e[17];let F;e[18]!==k?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:k}),e[18]=k,e[19]=F):F=e[19];let W;return e[20]!==I||e[21]!==F?(W=t.jsxs("div",{className:"surface p-5",children:[I,F]}),e[20]=I,e[21]=F,e[22]=W):W=e[22],W}let y;e[23]!==d||e[24]!==n.length?(y=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=y):y=e[25];let C;e[26]!==y?(C=t.jsx(ie,{value:"tools",variant:"underline",children:y}),e[26]=y,e[27]=C):C=e[27];let D;e[28]!==N||e[29]!==d?(D=N&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=N,e[29]=d,e[30]=D):D=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let $;e[33]!==w?($=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=$):$=e[34];let O;e[35]!==d?(O=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=O):O=e[36];let P;e[37]!==O?(P=t.jsx(ie,{value:"resources",variant:"underline",children:O}),e[37]=O,e[38]=P):P=e[38];let T;e[39]!==$||e[40]!==P||e[41]!==C||e[42]!==D?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(zt,{variant:"underline",className:"gap-1",children:[C,D,$,P]})}),e[39]=$,e[40]=P,e[41]=C,e[42]=D,e[43]=T):T=e[43];let S;e[44]!==g||e[45]!==n?(S=n.length>0?n.map(b=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-accent transition-colors cursor-pointer",onClick:()=>g(b.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(pt,{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:$e(b.name)}),b.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:b.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},b.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=S):S=e[46];let v;e[47]!==S?(v=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[47]=S,e[48]=v):v=e[48];let z;e[49]!==i||e[50]!==N||e[51]!==l||e[52]!==n?(z=N&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ps,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=N,e[51]=l,e[52]=n,e[53]=z):z=e[53];let E;e[54]!==a?(E=a.length>0?a.map(js):t.jsx(le,{label:"prompts"}),e[54]=a,e[55]=E):E=e[55];let M;e[56]!==E?(M=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[56]=E,e[57]=M):M=e[57];let A;e[58]!==r?(A=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=A):A=e[59];let R;e[60]!==A?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=R):R=e[61];let p;return e[62]!==T||e[63]!==v||e[64]!==z||e[65]!==M||e[66]!==R?(p=t.jsx("div",{className:"surface overflow-hidden",children:t.jsxs(Et,{defaultValue:"tools",variant:"underline",children:[T,v,z,M,R]})}),e[62]=T,e[63]=v,e[64]=z,e[65]=M,e[66]=R,e[67]=p):p=e[67],p}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(xt,{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 js(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(Rt,{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:$e(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 vs(s){return ce(s._meta)}function bs(s){const e=U.c(13),{connection:n,displayTitle:c}=s,o=c??n.title;let i;e[0]!==n.icon||e[1]!==o?(i=t.jsx(ae,{icon:n.icon,name:o,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=o,e[2]=i):i=e[2];let l;e[3]!==o?(l=t.jsx(Ve.Title,{children:o}),e[3]=o,e[4]=l):l=e[4];let a;e[5]!==n.description?(a=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]=a):a=e[6];let r;e[7]!==l||e[8]!==a?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[7]=l,e[8]=a,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 Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:o}){const i=V(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Le(),d=(()=>{if(typeof a!="string"||!a)return!1;try{const m=new URL(a);return m.hostname==="api.githubcopilot.com"&&m.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",f=x?Kt(e.connection_url):null;return x?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(_e,{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")})]}),f&&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:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(q,{control:s.control,name:"ui_type",render:({field:m})=>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(fe,{value:m.value,onValueChange:m.onChange,children:[t.jsx(L,{children:t.jsxs(he,{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(ge,{})]})}),t.jsxs(je,{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(J,{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(fe,{value:m.value,onValueChange:m.onChange,children:[t.jsx(L,{children:t.jsx(he,{className:"h-10",children:t.jsx(ge,{})})}),t.jsxs(je,{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:m})=>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(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...m,value:m.value||"",className:"h-10"})}),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:m})=>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(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...m,value:m.value||"",className:"h-10"})}),t.jsx(X,{})]})}),t.jsx(q,{control:s.control,name:"stdio_args",render:({field:m})=>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(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...m,value:m.value||"",className:"h-10"})}),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:m})=>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(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...m,value:m.value||"",className:"h-10"})}),t.jsx(X,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(q,{control:s.control,name:"env_vars",render:({field:m})=>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(tt,{value:m.value??[],onChange:m.onChange})}),t.jsx(X,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(q,{control:s.control,name:"connection_token",render:({field:m})=>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(Be,{children:[t.jsx(Ge,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Vt,{variant:"success",className:"gap-1.5",children:[t.jsx(Lt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Bt,{size:12})]})})}),t.jsxs(qe,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(ft,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:o,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.has_connection_token&&m.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:()=>m.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-accent 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(J,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...m,value:m.value||"",className:"h-10"})}),d?t.jsxs(pe,{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(pe,{children:i("details.connectionSidebar.tokenSchemeHint")})]}),t.jsx(X,{})]})})]})}function Ss(s){return s.command==="npx"}function ys(s){return s.args?.find(e=>!e.startsWith("-"))??""}function _s(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,o=st(c.envVars);if(Ss(c)){const l=ys(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o}}const i=_s(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:o}}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=!1,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=nt(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=it(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&&s.connection_token!==void 0,o=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:o,prompts:i,resources:l,siblings:a}){const r=V(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Qe(),x=Ae(),{org:f}=te(),m=wt({onSuccess:()=>{a.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Q.useState(null),[j,N]=Q.useState(!1),_=Ie({connectionId:e}),{data:y}=We(),C=y?.data?.members??[],D=h??s,w=C.find(p=>p.userId===D.created_by),O=s?.connection_type==="VIRTUAL"||_.isAuthenticated,P={...s,tools:o},T=ot(P,Yt),S=Ye({resolver:Je(Qt),values:be(h??s)}),v=S.formState.isDirty,z=async()=>{if(!await S.trigger())return;const b=S.getValues(),I=Cs(b),k=h?.id??e;await x.update.mutateAsync({id:k,data:I}),S.reset(b)},E=()=>{S.reset(be(h??s))},M=async p=>{const b=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:I,tokenInfo:k,error:F}=await ct({connectionId:p,orgSlug:f.slug,...b?{scope:b}:{}});if(F||!I){Y.error(r("details.connection.authFailed",{error:F??""}));return}if(k)try{const Z=await fetch(`/api/${f.slug}/connections/${p}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:k.accessToken,refreshToken:k.refreshToken,expiresIn:k.expiresIn,scope:k.scope,clientId:k.clientId,clientSecret:k.clientSecret,tokenEndpoint:k.tokenEndpoint})});if(!Z.ok)console.error("Failed to save OAuth token:",await Z.text()),await x.update.mutateAsync({id:p,data:{connection_token:I}});else try{await x.update.mutateAsync({id:p,data:{}})}catch(Oe){console.warn("Failed to refresh connection tools after OAuth:",Oe)}}catch(Z){console.error("Error saving OAuth token:",Z),await x.update.mutateAsync({id:p,data:{connection_token:I}})}else await x.update.mutateAsync({id:p,data:{connection_token:I}});const W=new URL(`/api/${f.slug}/mcp/${p}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(W.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>M(s.id),R=async()=>{try{const p=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!p.ok){const I=await p.text();Y.error(r("details.connection.failedRemoveOAuth",{error:I}));return}const b=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(b.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(p){console.error("Error removing OAuth token:",p),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(It,{...m}),t.jsx(ht,{open:h!==null,onOpenChange:p=>{p||g(null)},children:t.jsxs(gt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(jt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(vt,{className:"text-base",children:h?.title??s.title}),t.jsx(bt,{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(Ze,{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(Nt,{...S,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:S.control,name:"title",render:({field:p})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...p})}),t.jsx(X,{})]})}),t.jsx(q,{control:S.control,name:"description",render:({field:p})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(J,{...p,value:p.value||""})}),t.jsx(X,{})]})})]}),t.jsx(Ns,{form:S,connection:h??s,hasOAuthToken:_.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:R}),t.jsx(at,{connection:h??s,form:S,hasMcpBinding:T,isMCPAuthenticated:O,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:A,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:z,disabled:!v||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),v&&t.jsx(B,{variant:"outline",onClick:E,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive",onClick:()=>{const p=h??s;g(null),m.requestDelete(p)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(lt,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(bs,{connection:s,displayTitle:(()=>{const p=a[0]??s;return p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.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(ds,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(es,{instances:a,onConfigure:p=>g(p),onAuthenticate:p=>M(p.id),onDelete:p=>m.requestDelete(p),onToggleStatus:async(p,b)=>{try{await x.update.mutateAsync({id:p.id,data:{status:b}}),Y.success(r(b==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{N(!0);try{const p=a[0]??s,b=p.title.replace(/\s*\(\d+\)\s*$/,""),I=a.length+1,k=`${b} (${I})`,F=et("conn");await x.create.mutateAsync({id:F,title:k,description:p.description??null,connection_type:p.connection_type,connection_url:p.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p.created_by,organization_id:p.organization_id,icon:p.icon??null,app_name:p.app_name??null,app_id:p.app_id??null,connection_headers:p.connection_headers??null,oauth_config:null,configuration_state:p.configuration_state??null,metadata:null,tools:null,bindings:null});const W=new URL(`/api/${f.slug}/mcp/${F}`,window.location.origin),Z=await Ct({url:W.href,token:null,orgId:f.id});Z.supportsOAuth&&!Z.isAuthenticated&&await M(F)}catch(p){console.error("Failed to add connection instance:",p),Y.error(r("details.connection.failedAddInstance"))}finally{N(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:o,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function Is(){const s=U.c(43),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 o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug"},s[1]=o):o=s[1];const{appSlug:i,org:l}=Ke(o),{org:a}=te(),r=Ae();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=St(d),[x,f]=Q.useState(null),m=u.find(A=>A.id===x)??u[0]??null;m&&m.id!==x&&f(m.id);const h=m?.id??"",g=Pe({connectionId:h||null,orgId:a.id,orgSlug:a.slug});let j;s[4]!==g?(j={client:g},s[4]=g,s[5]=j):j=s[5];const{data:N}=yt(j),_=N?N.tools.map($s):(m?.tools??[]).map(Ds);let y;e:{if(u.length<=1){y=_;break e}const A=new Set,R=[],p=As;for(const b of u){const I=b.id===h?_:p(b.tools);for(const k of I)A.has(k.name)||(A.add(k.name),R.push(k))}y=R.length>0?R:_}const C=y;let D;s[6]!==g?(D={client:g},s[6]=g,s[7]=D):D=s[7];const{data:w}=_t(D);let $;s[8]!==g?($={client:g},s[8]=g,s[9]=$):$=s[9];const{data:O}=Xe($);let P;s[10]!==w?.prompts?(P=w?.prompts??[],s[10]=w?.prompts,s[11]=P):P=s[11];let T;s[12]!==P?(T=P.map(Ts),s[12]=P,s[13]=T):T=s[13];const S=T;let v;s[14]!==O?.resources?(v=O?.resources??[],s[14]=O?.resources,s[15]=v):v=s[15];let z;s[16]!==v?(z=v.map(ks),s[16]=v,s[17]=z):z=s[17];const E=z;if(!m){let A;s[18]!==e?(A=e("details.connection.notFoundTitle"),s[18]=e,s[19]=A):A=s[19];let R;s[20]!==e?(R=e("details.connection.notFoundDescription"),s[20]=e,s[21]=R):R=s[21];let p;s[22]!==c||s[23]!==l?(p=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[22]=c,s[23]=l,s[24]=p):p=s[24];let b;s[25]!==e?(b=e("details.connection.backButton"),s[25]=e,s[26]=b):b=s[26];let I;s[27]!==p||s[28]!==b?(I=t.jsx(B,{variant:"outline",onClick:p,children:b}),s[27]=p,s[28]=b,s[29]=I):I=s[29];let k;return s[30]!==A||s[31]!==R||s[32]!==I?(k=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(we,{title:A,description:R,actions:I})}),s[30]=A,s[31]=R,s[32]=I,s[33]=k):k=s[33],k}let M;return s[34]!==r.update.isPending||s[35]!==C||s[36]!==m||s[37]!==h||s[38]!==l||s[39]!==S||s[40]!==E||s[41]!==u?(M=t.jsx(ws,{org:l,connection:m,connectionId:h,isUpdating:r.update.isPending,tools:C,prompts:S,resources:E,siblings:u}),s[34]=r.update.isPending,s[35]=C,s[36]=m,s[37]=h,s[38]=l,s[39]=S,s[40]=E,s[41]=u,s[42]=M):M=s[42],M}function ks(s){return{name:s.name,description:s.description,uri:s.uri}}function Ts(s){return{name:s.name,description:s.description}}function As(s){return(s??[]).map(Ps)}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(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Os(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(He,{children:t.jsx(Q.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Se,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Is,{})})}),s[0]=e):e=s[0],e}function vi(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Os,{}),s[0]=e):e=s[0],e}export{vi as default};
@@ -1 +1 @@
1
- import{c as z,j as c,I as T,B as N}from"./index-D2i_pYwo.js";import{s as A}from"./Plus-C3lymMZB.js";import{s as H}from"./Trash01-MjAw8x8_.js";function S(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function $(n){const e=z.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:k}=n,p=o===void 0?"VARIABLE_NAME":o,h=s===void 0?"value...":s;let _;e[0]!==r||e[1]!==t?(_=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=_):_=e[2];const C=_;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((u,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let b;e[6]!==r||e[7]!==t?(b=(l,u)=>{const i=[...t],a=i[l];a&&(i[l]={key:u,value:a.value},r(i))},e[6]=r,e[7]=t,e[8]=b):b=e[8];const v=b;let P;e[9]!==r||e[10]!==t?(P=(l,u)=>{const i=[...t],a=i[l];a&&(i[l]={key:a.key,value:u},r(i))},e[9]=r,e[10]=t,e[11]=P):P=e[11];const g=P;let f;if(e[12]!==v||e[13]!==y||e[14]!==g||e[15]!==p||e[16]!==t||e[17]!==h){let l;e[19]!==v||e[20]!==y||e[21]!==g||e[22]!==p||e[23]!==h?(l=(u,i)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(T,{placeholder:p,value:u.key,onChange:a=>v(i,a.target.value),className:"h-10 flex-1 font-mono"}),c.jsx(T,{type:S(u.key)?"password":"text",placeholder:h,value:u.value,onChange:a=>g(i,a.target.value),className:"h-10 flex-1"}),c.jsx(N,{type:"button",variant:"ghost-destructive",size:"icon",className:"size-10 shrink-0",onClick:()=>y(i),children:c.jsx(H,{size:16})})]},i),e[19]=v,e[20]=y,e[21]=g,e[22]=p,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=v,e[13]=y,e[14]=g,e[15]=p,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=c.jsx(A,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let m;e[26]!==C?(m=c.jsxs(N,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:C,children:[w,"Add Environment Variable"]}),e[26]=C,e[27]=m):m=e[27];let d;e[28]!==f||e[29]!==m?(d=c.jsxs("div",{className:"flex flex-col gap-2",children:[f,m]}),e[28]=f,e[29]=m,e[30]=d):d=e[30];let E;return e[31]!==k||e[32]!==d?(E=c.jsx("div",{className:k,children:d}),e[31]=k,e[32]=d,e[33]=E):E=e[33],E}function R(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function K(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function j(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 W(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function B(n){const{uiType:e}=n,t=j(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===j("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 G(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=j(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(p=>j(p.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function U(n,e){const t={command:"npx",args:["-y",n]},r=R(e);return Object.keys(r).length>0&&(t.envVars=r),t}function M(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=R(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{$ as E,G as a,U as b,M as c,B as i,W as p,K as r};
1
+ import{c as z,j as c,I as T,B as N}from"./index-CM7QLcHH.js";import{s as A}from"./Plus-DPgqzlX_.js";import{s as H}from"./Trash01-BJozO1DS.js";function S(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function $(n){const e=z.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:k}=n,p=o===void 0?"VARIABLE_NAME":o,h=s===void 0?"value...":s;let _;e[0]!==r||e[1]!==t?(_=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=_):_=e[2];const C=_;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((u,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let b;e[6]!==r||e[7]!==t?(b=(l,u)=>{const i=[...t],a=i[l];a&&(i[l]={key:u,value:a.value},r(i))},e[6]=r,e[7]=t,e[8]=b):b=e[8];const v=b;let P;e[9]!==r||e[10]!==t?(P=(l,u)=>{const i=[...t],a=i[l];a&&(i[l]={key:a.key,value:u},r(i))},e[9]=r,e[10]=t,e[11]=P):P=e[11];const g=P;let f;if(e[12]!==v||e[13]!==y||e[14]!==g||e[15]!==p||e[16]!==t||e[17]!==h){let l;e[19]!==v||e[20]!==y||e[21]!==g||e[22]!==p||e[23]!==h?(l=(u,i)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(T,{placeholder:p,value:u.key,onChange:a=>v(i,a.target.value),className:"h-10 flex-1 font-mono"}),c.jsx(T,{type:S(u.key)?"password":"text",placeholder:h,value:u.value,onChange:a=>g(i,a.target.value),className:"h-10 flex-1"}),c.jsx(N,{type:"button",variant:"ghost-destructive",size:"icon",className:"size-10 shrink-0",onClick:()=>y(i),children:c.jsx(H,{size:16})})]},i),e[19]=v,e[20]=y,e[21]=g,e[22]=p,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=v,e[13]=y,e[14]=g,e[15]=p,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=c.jsx(A,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let m;e[26]!==C?(m=c.jsxs(N,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:C,children:[w,"Add Environment Variable"]}),e[26]=C,e[27]=m):m=e[27];let d;e[28]!==f||e[29]!==m?(d=c.jsxs("div",{className:"flex flex-col gap-2",children:[f,m]}),e[28]=f,e[29]=m,e[30]=d):d=e[30];let E;return e[31]!==k||e[32]!==d?(E=c.jsx("div",{className:k,children:d}),e[31]=k,e[32]=d,e[33]=E):E=e[33],E}function R(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function K(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function j(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 W(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function B(n){const{uiType:e}=n,t=j(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===j("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 G(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=j(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(p=>j(p.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function U(n,e){const t={command:"npx",args:["-y",n]},r=R(e);return Object.keys(r).length>0&&(t.envVars=r),t}function M(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=R(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{$ as E,G as a,U as b,M as c,B as i,W as p,K as r};
@@ -1 +1 @@
1
- import{U as b}from"./url-slug-j_pbLoit.js";import{aH as o,cq as a,bx as t,aI as e,dA as i,dy as r,dE as h,er as m,dz as _,cp as g}from"./index-D2i_pYwo.js";const f=o({authorizationEndpoint:e().url(),tokenEndpoint:e().url(),introspectionEndpoint:e().url().optional(),clientId:e(),clientSecret:e().optional(),scopes:t(e()),grantType:a(["authorization_code","client_credentials"])}),s=o({type:h("object"),properties:i(e(),r()).optional(),required:t(e()).optional()}).catchall(r()),S=m.extend({inputSchema:s,outputSchema:s.optional()}),T=o({headers:i(e(),e()).optional()}),y=o({command:e().describe("Command to run (e.g., 'npx', 'node')"),args:t(e()).optional().describe("Command arguments"),cwd:e().optional().describe("Working directory"),envVars:i(e(),e()).optional().describe("Environment variables (encrypted in storage)")}),l=256*1024;function d(n){return i(e(),r()).nullable().refine(c=>c===null||JSON.stringify(c).length<=l,{message:`${n} must serialize to at most ${l} bytes`})}const u=4096,p=o({id:e().describe("Unique identifier for the connection"),title:e().describe("Human-readable name for the connection"),created_at:e().describe("When the connection was created"),updated_at:e().describe("When the connection was last updated"),created_by:e().describe("User ID who created the connection"),updated_by:e().optional().describe("User ID who last updated the connection"),organization_id:e().describe("Organization ID this connection belongs to"),description:e().nullable().describe("Description of the connection"),icon:e().nullable().describe("Icon URL for the connection"),app_name:e().nullable().describe("Associated app name"),app_id:e().nullable().describe("Associated app ID"),slug:e().nullable().optional().describe("URL-safe slug derived from app_name, connection_url, or title"),url_slug:e().nullable().optional().describe("Name of the connection in Studio URLs, unique in the organization. Set it to rename the URL; the old one keeps redirecting."),connection_type:a(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:e().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:e().nullable().optional().describe("Authentication token (for HTTP connections). Write-only: tool responses never include it."),has_connection_token:g().optional().describe("Whether a connection_token is stored. Set on tool responses."),connection_headers:_([y,T]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:f.nullable().describe("OAuth configuration"),configuration_state:d("configuration_state").describe("Configuration state (decrypted)"),configuration_scopes:t(e()).nullable().optional().describe("Configuration scopes"),metadata:d("metadata").describe("Additional metadata (includes repository info)"),tools:t(S).nullable().describe("Discovered tools from MCP"),bindings:t(e()).nullable().describe("Detected bindings"),status:a(["active","inactive","error"]).describe("Current status")});p.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0,has_connection_token:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0}).extend({icon:e().nullish(),connection_token:e().max(u).nullish()});p.omit({has_connection_token:!0}).partial().extend({url_slug:b.nullish(),connection_token:e().max(u).nullish()});function C(n){return n!=null&&"command"in n}function E(n){return!n||!n.startsWith("virtual://")?null:n.replace("virtual://","")}export{f as O,C as i,E as p};
1
+ import{U as b}from"./url-slug-DjA6hXx8.js";import{aH as o,cq as a,bx as t,aI as e,dA as i,dy as r,dE as h,er as m,dz as _,cp as g}from"./index-CM7QLcHH.js";const f=o({authorizationEndpoint:e().url(),tokenEndpoint:e().url(),introspectionEndpoint:e().url().optional(),clientId:e(),clientSecret:e().optional(),scopes:t(e()),grantType:a(["authorization_code","client_credentials"])}),s=o({type:h("object"),properties:i(e(),r()).optional(),required:t(e()).optional()}).catchall(r()),S=m.extend({inputSchema:s,outputSchema:s.optional()}),T=o({headers:i(e(),e()).optional()}),y=o({command:e().describe("Command to run (e.g., 'npx', 'node')"),args:t(e()).optional().describe("Command arguments"),cwd:e().optional().describe("Working directory"),envVars:i(e(),e()).optional().describe("Environment variables (encrypted in storage)")}),l=256*1024;function d(n){return i(e(),r()).nullable().refine(c=>c===null||JSON.stringify(c).length<=l,{message:`${n} must serialize to at most ${l} bytes`})}const u=4096,p=o({id:e().describe("Unique identifier for the connection"),title:e().describe("Human-readable name for the connection"),created_at:e().describe("When the connection was created"),updated_at:e().describe("When the connection was last updated"),created_by:e().describe("User ID who created the connection"),updated_by:e().optional().describe("User ID who last updated the connection"),organization_id:e().describe("Organization ID this connection belongs to"),description:e().nullable().describe("Description of the connection"),icon:e().nullable().describe("Icon URL for the connection"),app_name:e().nullable().describe("Associated app name"),app_id:e().nullable().describe("Associated app ID"),slug:e().nullable().optional().describe("URL-safe slug derived from app_name, connection_url, or title"),url_slug:e().nullable().optional().describe("Name of the connection in Studio URLs, unique in the organization. Set it to rename the URL; the old one keeps redirecting."),connection_type:a(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:e().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:e().nullable().optional().describe("Authentication token (for HTTP connections). Write-only: tool responses never include it."),has_connection_token:g().optional().describe("Whether a connection_token is stored. Set on tool responses."),connection_headers:_([y,T]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:f.nullable().describe("OAuth configuration"),configuration_state:d("configuration_state").describe("Configuration state (decrypted)"),configuration_scopes:t(e()).nullable().optional().describe("Configuration scopes"),metadata:d("metadata").describe("Additional metadata (includes repository info)"),tools:t(S).nullable().describe("Discovered tools from MCP"),bindings:t(e()).nullable().describe("Detected bindings"),status:a(["active","inactive","error"]).describe("Current status")});p.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0,has_connection_token:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0}).extend({icon:e().nullish(),connection_token:e().max(u).nullish()});p.omit({has_connection_token:!0}).partial().extend({url_slug:b.nullish(),connection_token:e().max(u).nullish()});function C(n){return n!=null&&"command"in n}function E(n){return!n||!n.startsWith("virtual://")?null:n.replace("virtual://","")}export{f as O,C as i,E as p};
@@ -1 +1 @@
1
- import{e}from"./session-runtime-DIqtTbVV.js";function s(r){if(r.app_name)return r.app_name;if(r.connection_url)try{const t=new URL(r.connection_url),a=((t.port?`${t.hostname}-${t.port}`:t.hostname)+t.pathname).replace(/\/+$/,"");return e(a)}catch{return e(r.connection_url)}return r.title?e(r.title):r.id??"unknown"}export{s as g};
1
+ import{e}from"./session-runtime-DxWcwkbE.js";function s(r){if(r.app_name)return r.app_name;if(r.connection_url)try{const t=new URL(r.connection_url),a=((t.port?`${t.hostname}-${t.port}`:t.hostname)+t.pathname).replace(/\/+$/,"");return e(a)}catch{return e(r.connection_url)}return r.title?e(r.title):r.id??"unknown"}export{s as g};
@@ -1 +1 @@
1
- import{r as z,c as W,b as ne,j as t,aJ as We,aK as Xe,aL as Ge,aM as Qe,b9 as qe,aN as Je,aO as Ye,aP as Ze,B as L,h as de,m as he,Y as ie,x as Ne,aU as Te,w as Ae,y as we,v as Ie,D as Pe,X as et,_ as tt,Z as nt,R as ot,a6 as Me,d as $e,u as st,a as Oe,a5 as it,as as ye,at as ct,av as lt,aG as rt,aF as at,n as pe,I as oe,E as te,q as dt,am as ut,t as R,cI as gt,K as mt,go as pt}from"./index-D2i_pYwo.js";import{a as Fe,g as ft,e as ht}from"./extract-connection-data-LbbeCt5n.js";import{C as xt}from"./collection-display-button-Bg2ZHQuH.js";import{S as jt}from"./search-toggle-DF77iWWe.js";import{C as St}from"./collection-tabs-DvlmC9nK.js";import{C as Ce,u as Ue,g as yt}from"./connection-card-VJNv_08i.js";import{E as Ct}from"./empty-state-OU8KvAyP.js";import{u as vt,D as bt}from"./use-delete-connection-vx3t15Ts.js";import{u as _t}from"./use-infinite-scroll-bABoIqF1.js";import{u as Ve}from"./use-mobile-BG1vBhH-.js";import{g as ae}from"./connection-slug-DOcsu9cs.js";import{n as xe}from"./LinkBroken01-D8a_i2U7.js";import{g as Dt,a as kt}from"./metadata-D72DunRR.js";import{D as Nt,a as Tt,e as At,b as wt,c as It,f as Pt,g as Mt}from"./drawer-D7zKYyPf.js";import{F as Q,b as q,c as J,d as Y,f as Z,a as De}from"./form-D8xpAXPl.js";import{S as $t,b as Ot,a as Ft,d as Ut,c as re}from"./select-BGtnFfIR.js";import{T as Vt}from"./textarea-Dr6I78Fc.js";import{a as ze,b as zt}from"./use-connection-fTbSHOHv.js";import{m as Lt}from"./use-mcp-client-lA4u3y89.js";import{u as Et}from"./repository-binding-BL79LH9r.js";import{g as Bt}from"./types-lFZQt78s.js";import{A as Kt,bA as Ht,a4 as Rt,b5 as Wt,a5 as Se}from"./agent-icon-5JzmaVYR.js";import{s as Le}from"./Plus-C3lymMZB.js";import{c as Xt}from"./UserSquare-C5Py9azN.js";import{s as Ee}from"./XClose-CBLfa9LU.js";import{s as Gt}from"./use-project-scope-esRFkQO3.js";import{c as Qt}from"./schema-e-gzop_8.js";import{i as fe,a as ke,E as qt,p as Jt,b as Yt,c as Zt}from"./connection-form-helpers-xFANUQG-.js";import{a as en}from"./authenticate-and-persist-oauth-vpbKGKXJ.js";import{I as tn}from"./integration-icon-B4igOrSf.js";import{C as Be}from"./checkbox-RrvLpN6t.js";import{a as nn}from"./SwitchHorizontal01-BMEV6poX.js";import{s as Ke}from"./Eye-BaoSWdOQ.js";import{s as He}from"./Trash01-MjAw8x8_.js";import"./connection-BL1DZL8y.js";import"./url-slug-j_pbLoit.js";import"./ArrowUp-Jo2NpxcZ.js";import"./tooltip-6kGM_eQF.js";import"./index-C8WQbHaK.js";import"./toggle-group-DtkvHfko.js";import"./active-indicator-CCMhAsc_.js";import"./badge-BwAJrSlX.js";import"./SearchMd-DPVHlHgz.js";import"./icon-button-CrEhqBtX.js";import"./useInfiniteQuery-Bhzp56vf.js";import"./infiniteQueryObserver-QvmxM8yp.js";import"./session-runtime-DIqtTbVV.js";import"./label-j3g0RaM0.js";import"./index-BdQq_4o_.js";import"./ChevronDown-C3dAg-jK.js";import"./ChevronUp-IRWvN0bs.js";import"./auth-BRTdapwq.js";import"./AlertCircle-C1wYCQKa.js";import"./UserCheck01-DONIYjNn.js";import"./Tool01-BaohEBY5.js";import"./ArrowLeft-DEUSL-Af.js";import"./ArrowRight-BUikeU5m.js";import"./BookOpen01-jt4iWUAm.js";import"./Globe04-CmPStKLT.js";import"./CheckCircle-DTkHxClo.js";import"./TrendUp01-D0RC9MvR.js";import"./ChevronSelectorVertical-CB9nodBH.js";import"./CreditCard01-D2z7eRwD.js";import"./File02-DshxjDyQ.js";import"./MessageCircle01-DW4_PNZG.js";import"./Fingerprint04-BGa9q7Wg.js";import"./Image01-BZ44Kx4X.js";import"./Key01-CF-3Aw3z.js";import"./LayoutLeft-CMVOW-pP.js";import"./Minus-CMO3YoJU.js";import"./Monitor01-Dung5Edg.js";import"./Sun-vCtd1mVC.js";import"./Play-fuDOU8F1.js";import"./ShoppingBag01-Dfd5AB1h.js";import"./Upload01-CutujZKW.js";import"./Users01-CVAHFiWF.js";import"./Zap-Bbh4tQj9.js";import"./mcp-oauth-D57QGwp7.js";import"./mcp-oauth-DQcSxcPM.js";function on(o){const e=`deco-filters-${o}`,[n,g]=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=>{g(i);try{globalThis.localStorage?.setItem(e,JSON.stringify(i))}catch(l){console.error("Failed to save filters:",l)}}]}function sn(o){const e=W.c(7),[n,g]=z.useState(o),[s,i]=z.useState(o?"desc":null);let l;e[0]!==s||e[1]!==n?(l=p=>{n!==p?(g(p),i("asc")):s==="asc"?i("desc"):s==="desc"&&(g(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 cn(o,e){const n=W.c(12),g=e===void 0?"cards":e,s=Ve(),i=z.useRef(s),l=o?`deco-view-mode-${o}`:"deco-view-mode";let r;n[0]!==g||n[1]!==l?(r=()=>{const S=globalThis.localStorage?.getItem(l);return S==="cards"||S==="table"?S:g},n[0]=g,n[1]=l,n[2]=r):r=n[2];const[d,p]=z.useState(r);let m;n[3]!==l?(m=S=>{p(S),globalThis.localStorage?.setItem(l,S)},n[3]=l,n[4]=m):m=n[4];const u=m;let a,j;n[5]!==s||n[6]!==d?(a=()=>{!i.current&&s&&d==="table"&&p("cards"),i.current=s},j=[s,d],n[5]=s,n[6]=d,n[7]=a,n[8]=j):(a=n[7],j=n[8]),z.useEffect(a,j);let f;return n[9]!==u||n[10]!==d?(f=[d,u],n[9]=u,n[10]=d,n[11]=f):f=n[11],f}function ln(o){const e=W.c(20),{namespace:n,resource:g,defaultSortKey:s,defaultViewMode:i}=o,l=s===void 0?"title":s,r=i===void 0?"table":i,[d,p]=z.useState(""),m=z.useDeferredValue(d),u=`${n}-${g}`,[a,j]=on(u),f=`studio-${g}-filter-visible-${n}`;let S;e[0]!==f?(S=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=S):S=e[1];const[y,v]=z.useState(S);let C;e[2]!==f?(C=$=>{v($),globalThis.localStorage?.setItem(f,String($))},e[2]=f,e[3]=C):C=e[3];const c=C;let h;e[4]!==y||e[5]!==c?(h=()=>{c(!y)},e[4]=y,e[5]=c,e[6]=h):h=e[6];const w=h,[N,T]=cn(`studio-${g}-${n}`,r),{sortKey:M,sortDirection:I,handleSort:O}=sn(l),P=M;let k;return e[7]!==y||e[8]!==a||e[9]!==O||e[10]!==d||e[11]!==m||e[12]!==c||e[13]!==j||e[14]!==T||e[15]!==I||e[16]!==P||e[17]!==w||e[18]!==N?(k={search:d,searchTerm:m,setSearch:p,filters:a,setFilters:j,filterBarVisible:y,setFilterBarVisible:c,toggleFilterBar:w,viewMode:N,setViewMode:T,sortKey:P,sortDirection:I,handleSort:O},e[7]=y,e[8]=a,e[9]=O,e[10]=d,e[11]=m,e[12]=c,e[13]=j,e[14]=T,e[15]=I,e[16]=P,e[17]=w,e[18]=N,e[19]=k):k=e[19],k}function rn(o){const e=W.c(35),{open:n,onOpenChange:g,count:s,onConfirm:i}=o,l=ne(),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 p;e[4]!==d?(p=t.jsx(We,{children:d}),e[4]=d,e[5]=p):p=e[5];const m=s===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==l||e[7]!==m?(u=l(m),e[6]=l,e[7]=m,e[8]=u):u=e[8];let a;e[9]!==u?(a=t.jsx(Xe,{children:u}),e[9]=u,e[10]=a):a=e[10];let j;e[11]!==p||e[12]!==a?(j=t.jsxs(Ge,{children:[p,a]}),e[11]=p,e[12]=a,e[13]=j):j=e[13];let f;e[14]!==l?(f=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=f):f=e[15];let S;e[16]!==f?(S=t.jsx(Qe,{children:f}),e[16]=f,e[17]=S):S=e[17];const y=s===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let v;e[18]!==s||e[19]!==l||e[20]!==y?(v=l(y,{count:s}),e[18]=s,e[19]=l,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==i||e[23]!==v?(C=t.jsx(qe,{onClick:i,variant:"destructive",children:v}),e[22]=i,e[23]=v,e[24]=C):C=e[24];let c;e[25]!==C||e[26]!==S?(c=t.jsxs(Je,{children:[S,C]}),e[25]=C,e[26]=S,e[27]=c):c=e[27];let h;e[28]!==c||e[29]!==j?(h=t.jsxs(Ye,{children:[j,c]}),e[28]=c,e[29]=j,e[30]=h):h=e[30];let w;return e[31]!==g||e[32]!==n||e[33]!==h?(w=t.jsx(Ze,{open:n,onOpenChange:g,children:h}),e[31]=g,e[32]=n,e[33]=h,e[34]=w):w=e[34],w}function an(o){const e=W.c(39),{item:n,canManage:g,allConnections:s,connectedAppNames:i,connectingItemId:l,onNavigateConnected:r,onConnect:d}=o,p=ne();let m,u;e[0]!==i||e[1]!==n?(m=Fe(n)??"",u=i.has(m),e[0]=i,e[1]=n,e[2]=m,e[3]=u):(m=e[2],u=e[3]);const a=u;let j;e[4]!==n._meta?(j=Dt(n._meta),e[4]=n._meta,e[5]=j):j=e[5];const f=j,S=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",y=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||kt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=v):v=e[8];const C=v;let c;if(e[9]!==s||e[10]!==m){let U;e[12]!==m?(U=X=>X.connection_type!=="VIRTUAL"&&X.app_name===m,e[12]=m,e[13]=U):U=e[13],c=s.filter(U),e[9]=s,e[10]=m,e[11]=c}else c=e[11];const h=c,w=a||g;let N,T;e[14]!==h||e[15]!==a||e[16]!==n||e[17]!==d||e[18]!==r?(N=()=>{if(a){const U=h[0];U&&r(U);return}T()},T=()=>d(n),e[14]=h,e[15]=a,e[16]=n,e[17]=d,e[18]=r,e[19]=N,e[20]=T):(N=e[19],T=e[20]);let M;e[21]!==y||e[22]!==C||e[23]!==S?(M={title:S,description:y,icon:C},e[21]=y,e[22]=C,e[23]=S,e[24]=M):M=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(xe,{}),e[25]=I):I=e[25];const O=w?N:void 0;let P;e[26]!==g||e[27]!==l||e[28]!==T||e[29]!==a||e[30]!==n.id||e[31]!==p?(P=a?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:p("orgs.catalogItemCard.connected")}):g&&t.jsx(L,{variant:"outline",size:"sm",disabled:l!==null,onClick:U=>{U.stopPropagation(),T()},children:l===n.id?t.jsx(de,{className:"size-3.5"}):p("orgs.catalogItemCard.connect")}),e[26]=g,e[27]=l,e[28]=T,e[29]=a,e[30]=n.id,e[31]=p,e[32]=P):P=e[32];let k;e[33]!==P?(k=t.jsx("div",{className:"flex items-center gap-2",children:P}),e[33]=P,e[34]=k):k=e[34];let $;return e[35]!==M||e[36]!==O||e[37]!==k?($=t.jsx(Ce,{connection:M,fallbackIcon:I,onClick:O,headerActionsAlwaysVisible:!0,headerActions:k}),e[35]=M,e[36]=O,e[37]=k,e[38]=$):$=e[38],$}function dn(o){return o?.length?{appToolName:o.find(n=>!!Bt(n._meta))?.name??null}:null}const un=3;function gn(o){const e=new Map;for(const n of o)for(const g of n.connections??[]){const s=e.get(g.connection_id)??[];s.push(n),e.set(g.connection_id,s)}return e}function mn(o){const e=W.c(21),{projects:n}=o,g=ne();if(n.length===0){let u;e[0]!==g?(u=g("projects.connections.orgWide"),e[0]=g,e[1]=u):u=e[1];let a;return e[2]!==u?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=a):a=e[3],a}let s,i,l;if(e[4]!==n){const u=n.slice(0,un);l="flex min-w-0 items-center gap-2",s="flex shrink-0 -space-x-1.5",i=u.map(pn),e[4]=n,e[5]=s,e[6]=i,e[7]=l}else s=e[5],i=e[6],l=e[7];let r;e[8]!==s||e[9]!==i?(r=t.jsx("div",{className:s,children:i}),e[8]=s,e[9]=i,e[10]=r):r=e[10];let d;e[11]!==n[0]?.title||e[12]!==n.length||e[13]!==g?(d=n.length===1?n[0]?.title:g("projects.connections.usedBy",{count:n.length}),e[11]=n[0]?.title,e[12]=n.length,e[13]=g,e[14]=d):d=e[14];let p;e[15]!==d?(p=t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:d}),e[15]=d,e[16]=p):p=e[16];let m;return e[17]!==l||e[18]!==r||e[19]!==p?(m=t.jsxs("div",{className:l,children:[r,p]}),e[17]=l,e[18]=r,e[19]=p,e[20]=m):m=e[20],m}function pn(o){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:o.title,children:t.jsx(Kt,{icon:o.icon,name:o.title,size:"xs"})},o.id)}function Re(o){const e=W.c(8),{selectionMode:n,children:g}=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=he("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(et,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",onClick:hn,children:t.jsx(nn,{size:20})})}),e[2]=l):l=e[2];let r;e[3]!==g?(r=t.jsxs(tt,{children:[l,t.jsx(nt,{align:"end",onClick:fn,children:g})]}),e[3]=g,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 fn(o){return o.stopPropagation()}function hn(o){return o.stopPropagation()}function xn(o){const e=W.c(57),{group:n,onOpen:g,selectionMode:s,selectedIds:i,onToggleSelect:l}=o,r=ne();let d;if(e[0]!==n.connections||e[1]!==i){let x;e[3]!==i?(x=A=>i.has(A.id),e[3]=i,e[4]=x):x=e[4],d=n.connections.every(x),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const p=d;let m;if(e[5]!==n.connections||e[6]!==i){let x;e[8]!==i?(x=A=>i.has(A.id),e[8]=i,e[9]=x):x=e[9],m=n.connections.some(x),e[5]=n.connections,e[6]=i,e[7]=m}else m=e[7];const u=m;let a;e[10]!==p||e[11]!==n.connections||e[12]!==l||e[13]!==i?(a=()=>{for(const x of n.connections)p?i.has(x.id)&&l(x.id):i.has(x.id)||l(x.id)},e[10]=p,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=a):a=e[14];const j=a,f=n.title,S=n.icon;let y;e[15]!==n.connections.length||e[16]!==r?(y=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=y):y=e[17];let v;e[18]!==n.icon||e[19]!==n.title||e[20]!==y?(v={title:f,icon:S,description:y},e[18]=n.icon,e[19]=n.title,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==g||e[23]!==s||e[24]!==j?(C=()=>s?j():g(),e[22]=g,e[23]=s,e[24]=j,e[25]=C):C=e[25];const c=s&&p&&"ring-2 ring-primary",h=s&&u&&!p&&"ring-1 ring-primary/50";let w;e[26]!==h||e[27]!==c?(w=he(c,h),e[26]=h,e[27]=c,e[28]=w):w=e[28];const N=s?p?!0:u&&"mixed":void 0;let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(xe,{}),e[29]=T):T=e[29];let M;e[30]!==p||e[31]!==n.connections.length||e[32]!==s||e[33]!==u||e[34]!==r||e[35]!==j?(M=s?t.jsx(Be,{checked:p?!0:u?"indeterminate":!1,onCheckedChange:j}):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]=p,e[31]=n.connections.length,e[32]=s,e[33]=u,e[34]=r,e[35]=j,e[36]=M):M=e[36];let I;e[37]!==g?(I=x=>{x.stopPropagation(),g()},e[37]=g,e[38]=I):I=e[38];let O;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Ke,{size:16}),e[39]=O):O=e[39];let P;e[40]!==r?(P=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=P):P=e[41];let k;e[42]!==I||e[43]!==P?(k=t.jsxs(ie,{onClick:I,children:[O,P]}),e[42]=I,e[43]=P,e[44]=k):k=e[44];let $;e[45]!==s||e[46]!==k?($=t.jsx(Re,{selectionMode:s,children:k}),e[45]=s,e[46]=k,e[47]=$):$=e[47];let U;e[48]!==M||e[49]!==$?(U=t.jsxs("div",{className:"flex items-center gap-1",children:[M,$]}),e[48]=M,e[49]=$,e[50]=U):U=e[50];let X;return e[51]!==w||e[52]!==N||e[53]!==U||e[54]!==v||e[55]!==C?(X=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:v,onClick:C,className:w,selected:N,fallbackIcon:T,headerActionsAlwaysVisible:!0,headerActions:U})}),e[51]=w,e[52]=N,e[53]=U,e[54]=v,e[55]=C,e[56]=X):X=e[56],X}function jn(o){const e=W.c(36),{connection:n,isSelected:g,selectionMode:s,canManage:i,canManageAgents:l,onToggleSelect:r,onOpen:d,onToggleStatus:p,onDelete:m}=o,u=ne();let a;e[0]!==g||e[1]!==r||e[2]!==s||e[3]!==u?(a=s?t.jsx(Be,{checked:g,onCheckedChange:r,onClick:Sn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=g,e[1]=r,e[2]=s,e[3]=u,e[4]=a):a=e[4];let j;e[5]!==d?(j=N=>{N.stopPropagation(),d()},e[5]=d,e[6]=j):j=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ke,{size:16}),e[7]=f):f=e[7];let S;e[8]!==u?(S=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=S):S=e[9];let y;e[10]!==j||e[11]!==S?(y=t.jsxs(ie,{onClick:j,children:[f,S]}),e[10]=j,e[11]=S,e[12]=y):y=e[12];let v;e[13]!==i||e[14]!==l||e[15]!==r||e[16]!==u?(v=(i||l)&&t.jsxs(ie,{onClick:N=>{N.stopPropagation(),r()},children:[t.jsx(Ht,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=r,e[16]=u,e[17]=v):v=e[17];let C;e[18]!==i||e[19]!==n||e[20]!==p||e[21]!==u?(C=i&&(n.status==="active"?t.jsxs(ie,{onClick:N=>{N.stopPropagation(),p("inactive")},children:[t.jsx(Rt,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ie,{onClick:N=>{N.stopPropagation(),p("active")},children:[t.jsx(Wt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=p,e[21]=u,e[22]=C):C=e[22];let c;e[23]!==i||e[24]!==m||e[25]!==u?(c=i&&t.jsxs(ie,{variant:"destructive",onClick:N=>{N.stopPropagation(),m()},children:[t.jsx(He,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=m,e[25]=u,e[26]=c):c=e[26];let h;e[27]!==s||e[28]!==y||e[29]!==v||e[30]!==C||e[31]!==c?(h=t.jsxs(Re,{selectionMode:s,children:[y,v,C,c]}),e[27]=s,e[28]=y,e[29]=v,e[30]=C,e[31]=c,e[32]=h):h=e[32];let w;return e[33]!==a||e[34]!==h?(w=t.jsxs("div",{className:"flex items-center gap-1",children:[a,h]}),e[33]=a,e[34]=h,e[35]=w):w=e[35],w}function Sn(o){return o.stopPropagation()}function yn(o){const e=W.c(29),{count:n,total:g,canManage:s,canManageAgents:i,onSelectAll:l,onDeselectAll:r,onDelete:d,onAddToAgent:p,onToggleStatus:m,onCancel:u}=o,a=ne();if(n===0)return null;let j;e[0]!==n||e[1]!==a?(j=a("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=a,e[2]=j):j=e[2];let f;e[3]!==j?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:j}),e[3]=j,e[4]=f):f=e[4];let S;e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==a||e[9]!==g?(S=n<g?t.jsx(L,{variant:"outline",size:"sm",onClick:l,children:a("orgs.connectionSelectionUi.selectAll",{total:g})}):t.jsx(L,{variant:"outline",size:"sm",onClick:r,children:a("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=l,e[8]=a,e[9]=g,e[10]=S):S=e[10];let y;e[11]!==i||e[12]!==p||e[13]!==a?(y=i&&t.jsxs(L,{variant:"outline",size:"sm",onClick:p,children:[t.jsx(Le,{size:13}),a("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=p,e[13]=a,e[14]=y):y=e[14];let v;e[15]!==s||e[16]!==d||e[17]!==m||e[18]!==a?(v=s&&t.jsxs(t.Fragment,{children:[t.jsx(L,{variant:"outline",size:"sm",onClick:()=>m("active"),children:a("orgs.connectionSelectionUi.enable")}),t.jsx(L,{variant:"outline",size:"sm",onClick:()=>m("inactive"),children:a("orgs.connectionSelectionUi.disable")}),t.jsxs(L,{variant:"destructive",size:"sm",onClick:d,children:[t.jsx(He,{size:13}),a("orgs.connectionSelectionUi.delete")]})]}),e[15]=s,e[16]=d,e[17]=m,e[18]=a,e[19]=v):v=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Ee,{size:13}),e[20]=C):C=e[20];let c;e[21]!==u?(c=t.jsx(L,{variant:"ghost",size:"sm",onClick:u,children:C}),e[21]=u,e[22]=c):c=e[22];let h;return e[23]!==f||e[24]!==S||e[25]!==y||e[26]!==v||e[27]!==c?(h=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl glass px-3 py-2 flex items-center gap-2",children:[f,S,y,v,c]})}),e[23]=f,e[24]=S,e[25]=y,e[26]=v,e[27]=c,e[28]=h):h=e[28],h}function Cn(o){const e=W.c(47),{open:n,onOpenChange:g,agents:s,onConfirm:i}=o,l=ne(),[r,d]=z.useState(null);let p;e[0]!==g?(p=k=>{k||d(null),g(k)},e[0]=g,e[1]=p):p=e[1];const m=p;let u;e[2]!==l?(u=l("orgs.connectionSelectionUi.addToAgentTitle"),e[2]=l,e[3]=u):u=e[3];let a;e[4]!==u?(a=t.jsx(Ne,{children:u}),e[4]=u,e[5]=a):a=e[5];let j;e[6]!==l?(j=l("orgs.connectionSelectionUi.addToAgentDescription"),e[6]=l,e[7]=j):j=e[7];let f;e[8]!==j?(f=t.jsx(Te,{children:j}),e[8]=j,e[9]=f):f=e[9];let S;e[10]!==a||e[11]!==f?(S=t.jsxs(Ae,{children:[a,f]}),e[10]=a,e[11]=f,e[12]=S):S=e[12];let y;e[13]!==s||e[14]!==r||e[15]!==l?(y=s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):s.map(k=>t.jsxs("button",{type:"button",onClick:()=>d(k.id),className:he("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",r===k.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-accent"),children:[t.jsx(tn,{icon:k.icon,name:k.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:k.title}),k.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.description})]})]},k.id)),e[13]=s,e[14]=r,e[15]=l,e[16]=y):y=e[16];let v;e[17]!==y?(v=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[17]=y,e[18]=v):v=e[18];let C;e[19]!==m?(C=()=>m(!1),e[19]=m,e[20]=C):C=e[20];let c;e[21]!==l?(c=l("orgs.connectionSelectionUi.cancel"),e[21]=l,e[22]=c):c=e[22];let h;e[23]!==c||e[24]!==C?(h=t.jsx(L,{variant:"outline",onClick:C,children:c}),e[23]=c,e[24]=C,e[25]=h):h=e[25];const w=!r;let N;e[26]!==m||e[27]!==i||e[28]!==r?(N=()=>{r&&(i(r),m(!1))},e[26]=m,e[27]=i,e[28]=r,e[29]=N):N=e[29];let T;e[30]!==l?(T=l("orgs.connectionSelectionUi.add"),e[30]=l,e[31]=T):T=e[31];let M;e[32]!==w||e[33]!==N||e[34]!==T?(M=t.jsx(L,{disabled:w,onClick:N,children:T}),e[32]=w,e[33]=N,e[34]=T,e[35]=M):M=e[35];let I;e[36]!==h||e[37]!==M?(I=t.jsxs(we,{children:[h,M]}),e[36]=h,e[37]=M,e[38]=I):I=e[38];let O;e[39]!==I||e[40]!==S||e[41]!==v?(O=t.jsxs(Ie,{className:"sm:max-w-[400px]",children:[S,v,I]}),e[39]=I,e[40]=S,e[41]=v,e[42]=O):O=e[42];let P;return e[43]!==m||e[44]!==n||e[45]!==O?(P=t.jsx(Pe,{open:n,onOpenChange:m,children:O}),e[43]=m,e[44]=n,e[45]=O,e[46]=P):P=e[46],P}function vn({listState:o,activeTab:e,typeFilter:n,statusFilter:g}){const s=ne(),{org:i}=Me(),l=dt(),r=$e(),{data:d}=Oe.useSession(),p=ze(),m=zt(o),u=vt(),{granted:a}=ye("connections:manage"),{granted:j}=ye("agents:manage"),[f,S]=z.useState(new Set),y=f.size>0,[v,C]=z.useState(!1),[c,h]=z.useState(!1),[w,N]=z.useState(null),T=Et(),M=gn(Gt(T)),I=m.filter(b=>!(n!=="ALL"&&b.connection_type!==n||g!=="ALL"&&b.status!==g)),O=yt(I),P=b=>{S(_=>{const E=new Set(_);return E.has(b)?E.delete(b):E.add(b),E})},k=()=>{S(new Set)},$=Ue(o.searchTerm),U=$.items,X=_t($.loadMore,$.hasMore,$.isLoadingMore),x=new Set(m.filter(b=>b.app_name).map(b=>b.app_name)),A=o.search.length>0,B=e==="all"||A?U.filter(b=>{if(A){const _=Fe(b);if(_&&x.has(_))return!1}return!0}):[],ee=e==="connected"||A?O:[],G=async b=>{if(!(!i||!d?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:b.id,source:"connections_page"}),N(b.id);try{const _=ht(b,i.id,d.user.id,{remoteIndex:0}),E=_.connection_type==="STDIO",K=!!_.connection_url,H=E&&_.connection_headers&&typeof _.connection_headers=="object"&&"command"in _.connection_headers;if(!K&&!H){R.error(s("orgs.connections.cannotConnectNoMethod")),N(null);return}const ve=await p.create.mutateAsync(_),{id:se}=ve,ce=await en({connectionId:se,orgId:i.id,orgSlug:i.slug,persistFallback:le=>p.update.mutateAsync({id:se,data:{connection_token:le}}).then(()=>{})});if(ce.ran&&!ce.ok){te("connection_oauth_failed",{connection_id:se,flow:"connections_page_connect",error:ce.error??"no_token"}),R.error(s("orgs.connections.authenticationFailed",{error:ce.error??"no token received"}));return}if(ce.ran){te("connection_oauth_succeeded",{connection_id:se,flow:"connections_page_connect"});const le=new URL(`/api/${i.slug}/mcp/${se}`,window.location.origin);await l.invalidateQueries({queryKey:mt.isMCPAuthenticated(le.href,null)}),V(),R.success(s("orgs.connections.authenticationSuccessful"))}let me=null;try{const le=await l.fetchQuery(Lt({connectionId:se,orgId:i.id,orgSlug:i.slug}));me=dn((await le.listTools()).tools)}catch{}const be=ae(ve),_e=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(me.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(_){R.error(s("orgs.connections.failedToConnect",{error:_ instanceof Error?_.message:String(_)}))}finally{N(null)}}},D=ut(),V=()=>{pt(l,i.id)},F=async()=>{C(!1);const b=[...f];te("connections_bulk_delete",{count:b.length});const E=(await Promise.allSettled(b.map(K=>D.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;V(),R.success(s("orgs.connections.deletedConnections",{count:E})),k()},ue=async(b,_)=>{try{await p.update.mutateAsync({id:b,data:{status:_}}),V(),R.success(s(_==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(s("orgs.connections.failedToUpdateConnection"))}},je=async b=>{const _=[...f];te("connections_bulk_status_toggled",{count:_.length,to_status:b});const K=(await Promise.allSettled(_.map(H=>p.update.mutateAsync({id:H,data:{status:b}})))).filter(H=>H.status==="fulfilled").length;V(),R.success(b==="active"?s("orgs.connections.enabledConnections",{count:K}):s("orgs.connections.disabledConnections",{count:K})),k()},ge=async b=>{const _=T.find(H=>H.id===b);if(!_)return;te("connections_bulk_add_to_agent",{agent_id:b,count:f.size});const E=new Set(_.connections.map(H=>H.connection_id)),K=[...f].filter(H=>!E.has(H)).map(H=>({connection_id:H,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){R.info(s("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await D.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:b,data:{connections:[..._.connections,...K]}}),gt(l,i.id),R.success(s("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:_.title})),k()}catch{R.error(s("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(bt,{...u}),t.jsx(rn,{open:v,onOpenChange:C,count:f.size,onConfirm:F}),t.jsx(Cn,{open:c,onOpenChange:h,agents:T,onConfirm:ge}),$.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(A?B.length===0&&I.length===0:e==="all"?B.length===0:I.length===0)?t.jsx(Ct,{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:[ee.map(b=>{if(b.type==="group")return t.jsx(xn,{group:b,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:b.key}})},selectionMode:y,selectedIds:f,onToggleSelect:P},b.key);const _=b.connection,E=f.has(_.id);return t.jsx(Ce,{connection:_,fallbackIcon:t.jsx(xe,{}),onClick:()=>y?P(_.id):r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(_)}}),className:he(E&&"ring-2 ring-primary bg-primary/5"),selected:y?E:void 0,footer:t.jsx(mn,{projects:M.get(_.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(jn,{connection:_,isSelected:E,selectionMode:y,canManage:a,canManageAgents:j,onToggleSelect:()=>P(_.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(_)}}),onToggleStatus:K=>ue(_.id,K),onDelete:()=>u.requestDelete(_)})},_.id)}),B.map(b=>t.jsx(an,{item:b,canManage:a,allConnections:m,connectedAppNames:x,connectingItemId:w,onNavigateConnected:_=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(_)}}),onConnect:G},b.id)),(e==="all"||A)&&t.jsx("div",{ref:X,className:"col-span-full h-4"}),(e==="all"||A)&&$.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(de,{className:"size-6 text-muted-foreground"})})]})}),y&&t.jsx(yn,{count:f.size,total:I.length,canManage:a,canManageAgents:j,onSelectAll:()=>{S(new Set(I.map(b=>b.id)))},onDeselectAll:()=>S(new Set),onDelete:()=>C(!0),onAddToAgent:()=>h(!0),onToggleStatus:je,onCancel:k})]})}function bn(){const o=ne(),{org:e}=Me(),n=$e(),g=st({strict:!1}),{data:s}=Oe.useSession(),{stdioEnabled:i}=it(),l=Ve(),{granted:r}=ye("connections:manage"),d=ln({namespace:e.slug,resource:"connections"}),p=ze(),[m,u]=ct(lt.connectionsTab(e.slug),x=>g.tab==="all"||g.tab==="connected"?g.tab:x??"all"),[a,j]=z.useState("ALL"),[f,S]=z.useState("ALL"),v=Ue(d.searchTerm).items,C=d.search!==d.searchTerm,c=rt({resolver:at(Qt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),h=c.watch("ui_type"),w=c.watch("connection_url"),N=c.watch("npx_package"),T=fe({uiType:h,connectionUrl:w??"",npxPackage:N??""})??ke({uiType:h,connectionUrl:w??"",registryItems:v}),M=r&&g.action==="create",I=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),n({to:".",search:x=>({...x,action:"create"})})},O=()=>{n({to:".",search:x=>({...x,action:void 0})})},P=async x=>{let A,B=null,ee=null,G=null;x.ui_type==="NPX"?(A="STDIO",B="",G=Yt(x.npx_package||"",x.env_vars||[])):x.ui_type==="STDIO"?(A="STDIO",B="",G=Zt(x.stdio_command||"",x.stdio_args||"",x.stdio_cwd,x.env_vars||[])):(A=x.ui_type,B=x.connection_url||"",ee=x.connection_token||null);const D=ft("conn");te("connection_custom_created",{connection_type:A,ui_type:x.ui_type}),await p.create.mutateAsync({id:D,title:x.title,description:x.description||null,connection_type:A,connection_url:B,connection_token:ee,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:s?.user?.id||"system",organization_id:e.id,icon:x.icon??null,app_name:null,app_id:null,connection_headers:G,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null}),O(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ae({app_name:null,connection_url:B,title:x.title,id:D})}})},k=x=>{x||(M&&O(),c.reset())},$=x=>{const A=x.trim();if(!A)return;const B=!!c.formState.dirtyFields.title,ee=!!c.formState.dirtyFields.description,G=!!c.formState.dirtyFields.env_vars,D=F=>{if(F&&(!B&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!ee&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!G&&F.envVarKeys?.length)){const ue=c.getValues("env_vars")??[],je=new Set(ue.map(b=>b.key)),ge=F.envVarKeys.filter(b=>!je.has(b));ge.length>0&&c.setValue("env_vars",[...ue,...ge.map(b=>({key:b,value:""}))],{shouldDirty:!0})}},V=Jt(A);if(V&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",V.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),D(fe({uiType:"NPX",npxPackage:V.packageName}));return}if(A.startsWith("http://")||A.startsWith("https://")){const F=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",A,{shouldDirty:!0}),D(fe({uiType:F,connectionUrl:A})??ke({uiType:F,connectionUrl:A,registryItems:v}));return}h==="NPX"&&D(fe({uiType:"NPX",npxPackage:A}))},U=r?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(L,{size:"sm",variant:"default",onClick:I,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:o("orgs.connections.customConnection")})]})}):null,X=t.jsx(xt,{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:x=>j(x||"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:f,onChange:x=>S(x||"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")}]}]});return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const x=o("orgs.connections.createConnection"),A=o("orgs.connections.createConnectionDescription"),B=c.formState.isSubmitting?o("orgs.connections.saving"):o("orgs.connections.createConnection"),ee=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($t,{value:D.value,onValueChange:D.onChange,children:[t.jsx(Y,{children:t.jsx(Ot,{children:t.jsx(Ft,{})})}),t.jsxs(Ut,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),i&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),o("orgs.connections.npxPackage")]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Xt,{className:"w-4 h-4"}),o("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),h==="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(oe,{placeholder:o("orgs.connections.npmPackagePlaceholder"),...D,value:D.value??"",onPaste:V=>{const F=V.clipboardData.getData("text");F&&(V.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),$(F))},onBlur:V=>{$(V.target.value),D.onBlur()}})}),t.jsx(Z,{})]})}),h==="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(oe,{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(oe,{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(oe,{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,{})]})})]}),(h==="NPX"||h==="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(qt,{value:D.value??[],onChange:D.onChange})}),t.jsx(Z,{})]})}),h!=="NPX"&&h!=="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(oe,{placeholder:o("orgs.connections.urlPlaceholder"),...D,value:D.value??"",onPaste:V=>{const F=V.clipboardData.getData("text");F&&(V.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),$(F))},onBlur:V=>{$(V.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:T?.token?.label??o("orgs.connections.tokenOptional")}),t.jsx(Y,{children:t.jsx(oe,{type:"password",placeholder:T?.token?.placeholder??o("orgs.connections.tokenPlaceholder"),...D,value:D.value??""})}),T?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.token.helperText,T.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(oe,{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(Vt,{placeholder:o("orgs.connections.descriptionPlaceholder"),rows:3,...D,value:D.value??""})}),t.jsx(Z,{})]})})]}),G=M;return l?t.jsx(Nt,{open:G,onOpenChange:k,children:t.jsxs(Tt,{className:"max-h-[90vh]",children:[t.jsx(At,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(wt,{children:x}),t.jsx(It,{className:"mt-1",children:A})]}),t.jsx(Pt,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":o("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(De,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:ee}),t.jsx(Mt,{children:t.jsx(L,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:B})})]})})]})}):t.jsx(Pe,{open:G,onOpenChange:k,children:t.jsxs(Ie,{className:"sm:max-w-[525px]",children:[t.jsxs(Ae,{children:[t.jsx(Ne,{children:x}),t.jsx(Te,{children:A})]}),t.jsx(De,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:ee}),t.jsxs(we,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>k(!1),children:o("orgs.connections.cancel")}),t.jsx(L,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:B})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Actions,{secondary:t.jsxs(t.Fragment,{children:[t.jsx(jt,{value:d.search,onChange:d.setSearch,label:o("library.context.search"),placeholder:o("orgs.connections.searchPlaceholder"),clearLabel:o("library.library.clearSearch")}),X]}),children:U}),t.jsx(St,{placement:"page",tabs:[{id:"all",label:o("orgs.connections.tabAll")},{id:"connected",label:o("orgs.connections.tabConnected")}],activeTab:m,onTabChange:x=>{const A=x;A!==m&&te("connections_page_tab_changed",{to_tab:A}),u(A)}}),t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:C?.5:1,transition:C?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:C?"none":"auto"},children:t.jsx(vn,{listState:d,activeTab:m,typeFilter:a,statusFilter:f})})})]})})})]})})}function qo(){const o=W.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ot,{children:t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx(bn,{})})}),o[0]=e):e=o[0],e}export{qo as default};
1
+ import{r as z,c as W,b as ne,j as t,aJ as We,aK as Xe,aL as Ge,aM as Qe,b9 as qe,aN as Je,aO as Ye,aP as Ze,B as L,h as de,m as he,Y as ie,x as Ne,aU as Te,w as Ae,y as we,v as Ie,D as Pe,X as et,_ as tt,Z as nt,R as ot,a6 as Me,d as $e,u as st,a as Oe,a5 as it,as as ye,at as ct,av as lt,aG as rt,aF as at,n as pe,I as oe,E as te,q as dt,am as ut,t as R,cI as gt,K as mt,go as pt}from"./index-CM7QLcHH.js";import{a as Fe,g as ft,e as ht}from"./extract-connection-data-DpbVANVQ.js";import{C as xt}from"./collection-display-button-BHiOzw31.js";import{S as jt}from"./search-toggle-XYuup3CG.js";import{C as St}from"./collection-tabs-BwesRoId.js";import{C as Ce,u as Ue,g as yt}from"./connection-card-CJUEGGqR.js";import{E as Ct}from"./empty-state-Cojx_Zm8.js";import{u as vt,D as bt}from"./use-delete-connection-BHPfP1_h.js";import{u as _t}from"./use-infinite-scroll-B49BW4bH.js";import{u as Ve}from"./use-mobile-UENbdBUz.js";import{g as ae}from"./connection-slug-DUcOK0Fv.js";import{n as xe}from"./LinkBroken01-DOKZ024q.js";import{g as Dt,a as kt}from"./metadata-D72DunRR.js";import{D as Nt,a as Tt,e as At,b as wt,c as It,f as Pt,g as Mt}from"./drawer-CEhULiRL.js";import{F as Q,b as q,c as J,d as Y,f as Z,a as De}from"./form-Dol0DPDh.js";import{S as $t,b as Ot,a as Ft,d as Ut,c as re}from"./select-CaopsMfN.js";import{T as Vt}from"./textarea-ZVs6QWMS.js";import{a as ze,b as zt}from"./use-connection-zSjqu4n6.js";import{m as Lt}from"./use-mcp-client-B64wHnuV.js";import{u as Bt}from"./repository-binding-DGBKNnnx.js";import{g as Et}from"./types-DWswJ8mv.js";import{A as Kt,bB as Ht,a4 as Rt,b5 as Wt,a5 as Se}from"./agent-icon-BsqGoLFA.js";import{s as Le}from"./Plus-DPgqzlX_.js";import{c as Xt}from"./UserSquare-C9Yfn3z-.js";import{s as Be}from"./XClose-2FBIsrt9.js";import{s as Gt}from"./use-project-scope-BUOLpI6_.js";import{c as Qt}from"./schema-DcgkXC70.js";import{i as fe,a as ke,E as qt,p as Jt,b as Yt,c as Zt}from"./connection-form-helpers-Ccz7aVvg.js";import{a as en}from"./authenticate-and-persist-oauth-CagzPMUa.js";import{I as tn}from"./integration-icon-DiYH80o3.js";import{C as Ee}from"./checkbox-Cdx0XKK4.js";import{a as nn}from"./SwitchHorizontal01-fo0U4Jp1.js";import{s as Ke}from"./Eye-8uguzols.js";import{s as He}from"./Trash01-BJozO1DS.js";import"./connection-nHJUyklo.js";import"./url-slug-DjA6hXx8.js";import"./ArrowUp-CLrfDSfr.js";import"./tooltip-BQEYSfJS.js";import"./index-VhglRpxf.js";import"./toggle-group-CnZM62uw.js";import"./active-indicator-CCMhAsc_.js";import"./badge-6S4VrRSd.js";import"./SearchMd-0hSvyNNc.js";import"./icon-button-CdifSdSj.js";import"./useInfiniteQuery-C5QtpK6u.js";import"./infiniteQueryObserver-DvCgvYkY.js";import"./session-runtime-DxWcwkbE.js";import"./label-C3UnAGG4.js";import"./index-BdQq_4o_.js";import"./ChevronDown-BEVTcfYy.js";import"./ChevronUp-BEJWDky5.js";import"./auth-D7fJVlZI.js";import"./AlertCircle-iHYLI3wA.js";import"./UserCheck01-UUUmyjQl.js";import"./Tool01-CAPkmPtU.js";import"./ArrowLeft-Crx5FZ7V.js";import"./ArrowRight-ipUtveZC.js";import"./BookOpen01-C_4qgS91.js";import"./Globe04-CMPPLcPg.js";import"./CheckCircle-Bcn1SkPC.js";import"./TrendUp01-C3pm_0WN.js";import"./ChevronSelectorVertical-DxrQPHmH.js";import"./CreditCard01-DQXQKw2A.js";import"./File02-foS0DPWb.js";import"./MessageCircle01-BFCg8Yla.js";import"./Fingerprint04-DJD9RxrF.js";import"./Image01-5QAQlONA.js";import"./Key01-o1uKXv-x.js";import"./LayoutLeft-BejjIkGZ.js";import"./Minus-CVLCskxk.js";import"./Monitor01-D_volcqW.js";import"./Sun-D-iFjrkT.js";import"./Play-ClJ-fqo6.js";import"./ShoppingBag01-Dzd7DSPA.js";import"./Upload01-DSwYubv_.js";import"./Users01-D4LsevsD.js";import"./Zap-CDm_Ehxw.js";import"./mcp-oauth-daaKdPIW.js";import"./mcp-oauth-ClKqUQpf.js";function on(o){const e=`deco-filters-${o}`,[n,g]=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=>{g(i);try{globalThis.localStorage?.setItem(e,JSON.stringify(i))}catch(l){console.error("Failed to save filters:",l)}}]}function sn(o){const e=W.c(7),[n,g]=z.useState(o),[s,i]=z.useState(o?"desc":null);let l;e[0]!==s||e[1]!==n?(l=p=>{n!==p?(g(p),i("asc")):s==="asc"?i("desc"):s==="desc"&&(g(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 cn(o,e){const n=W.c(12),g=e===void 0?"cards":e,s=Ve(),i=z.useRef(s),l=o?`deco-view-mode-${o}`:"deco-view-mode";let r;n[0]!==g||n[1]!==l?(r=()=>{const S=globalThis.localStorage?.getItem(l);return S==="cards"||S==="table"?S:g},n[0]=g,n[1]=l,n[2]=r):r=n[2];const[d,p]=z.useState(r);let m;n[3]!==l?(m=S=>{p(S),globalThis.localStorage?.setItem(l,S)},n[3]=l,n[4]=m):m=n[4];const u=m;let a,j;n[5]!==s||n[6]!==d?(a=()=>{!i.current&&s&&d==="table"&&p("cards"),i.current=s},j=[s,d],n[5]=s,n[6]=d,n[7]=a,n[8]=j):(a=n[7],j=n[8]),z.useEffect(a,j);let f;return n[9]!==u||n[10]!==d?(f=[d,u],n[9]=u,n[10]=d,n[11]=f):f=n[11],f}function ln(o){const e=W.c(20),{namespace:n,resource:g,defaultSortKey:s,defaultViewMode:i}=o,l=s===void 0?"title":s,r=i===void 0?"table":i,[d,p]=z.useState(""),m=z.useDeferredValue(d),u=`${n}-${g}`,[a,j]=on(u),f=`studio-${g}-filter-visible-${n}`;let S;e[0]!==f?(S=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=S):S=e[1];const[y,v]=z.useState(S);let C;e[2]!==f?(C=$=>{v($),globalThis.localStorage?.setItem(f,String($))},e[2]=f,e[3]=C):C=e[3];const c=C;let h;e[4]!==y||e[5]!==c?(h=()=>{c(!y)},e[4]=y,e[5]=c,e[6]=h):h=e[6];const w=h,[N,T]=cn(`studio-${g}-${n}`,r),{sortKey:M,sortDirection:I,handleSort:O}=sn(l),P=M;let k;return e[7]!==y||e[8]!==a||e[9]!==O||e[10]!==d||e[11]!==m||e[12]!==c||e[13]!==j||e[14]!==T||e[15]!==I||e[16]!==P||e[17]!==w||e[18]!==N?(k={search:d,searchTerm:m,setSearch:p,filters:a,setFilters:j,filterBarVisible:y,setFilterBarVisible:c,toggleFilterBar:w,viewMode:N,setViewMode:T,sortKey:P,sortDirection:I,handleSort:O},e[7]=y,e[8]=a,e[9]=O,e[10]=d,e[11]=m,e[12]=c,e[13]=j,e[14]=T,e[15]=I,e[16]=P,e[17]=w,e[18]=N,e[19]=k):k=e[19],k}function rn(o){const e=W.c(35),{open:n,onOpenChange:g,count:s,onConfirm:i}=o,l=ne(),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 p;e[4]!==d?(p=t.jsx(We,{children:d}),e[4]=d,e[5]=p):p=e[5];const m=s===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==l||e[7]!==m?(u=l(m),e[6]=l,e[7]=m,e[8]=u):u=e[8];let a;e[9]!==u?(a=t.jsx(Xe,{children:u}),e[9]=u,e[10]=a):a=e[10];let j;e[11]!==p||e[12]!==a?(j=t.jsxs(Ge,{children:[p,a]}),e[11]=p,e[12]=a,e[13]=j):j=e[13];let f;e[14]!==l?(f=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=f):f=e[15];let S;e[16]!==f?(S=t.jsx(Qe,{children:f}),e[16]=f,e[17]=S):S=e[17];const y=s===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let v;e[18]!==s||e[19]!==l||e[20]!==y?(v=l(y,{count:s}),e[18]=s,e[19]=l,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==i||e[23]!==v?(C=t.jsx(qe,{onClick:i,variant:"destructive",children:v}),e[22]=i,e[23]=v,e[24]=C):C=e[24];let c;e[25]!==C||e[26]!==S?(c=t.jsxs(Je,{children:[S,C]}),e[25]=C,e[26]=S,e[27]=c):c=e[27];let h;e[28]!==c||e[29]!==j?(h=t.jsxs(Ye,{children:[j,c]}),e[28]=c,e[29]=j,e[30]=h):h=e[30];let w;return e[31]!==g||e[32]!==n||e[33]!==h?(w=t.jsx(Ze,{open:n,onOpenChange:g,children:h}),e[31]=g,e[32]=n,e[33]=h,e[34]=w):w=e[34],w}function an(o){const e=W.c(39),{item:n,canManage:g,allConnections:s,connectedAppNames:i,connectingItemId:l,onNavigateConnected:r,onConnect:d}=o,p=ne();let m,u;e[0]!==i||e[1]!==n?(m=Fe(n)??"",u=i.has(m),e[0]=i,e[1]=n,e[2]=m,e[3]=u):(m=e[2],u=e[3]);const a=u;let j;e[4]!==n._meta?(j=Dt(n._meta),e[4]=n._meta,e[5]=j):j=e[5];const f=j,S=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",y=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||kt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=v):v=e[8];const C=v;let c;if(e[9]!==s||e[10]!==m){let U;e[12]!==m?(U=X=>X.connection_type!=="VIRTUAL"&&X.app_name===m,e[12]=m,e[13]=U):U=e[13],c=s.filter(U),e[9]=s,e[10]=m,e[11]=c}else c=e[11];const h=c,w=a||g;let N,T;e[14]!==h||e[15]!==a||e[16]!==n||e[17]!==d||e[18]!==r?(N=()=>{if(a){const U=h[0];U&&r(U);return}T()},T=()=>d(n),e[14]=h,e[15]=a,e[16]=n,e[17]=d,e[18]=r,e[19]=N,e[20]=T):(N=e[19],T=e[20]);let M;e[21]!==y||e[22]!==C||e[23]!==S?(M={title:S,description:y,icon:C},e[21]=y,e[22]=C,e[23]=S,e[24]=M):M=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(xe,{}),e[25]=I):I=e[25];const O=w?N:void 0;let P;e[26]!==g||e[27]!==l||e[28]!==T||e[29]!==a||e[30]!==n.id||e[31]!==p?(P=a?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:p("orgs.catalogItemCard.connected")}):g&&t.jsx(L,{variant:"outline",size:"sm",disabled:l!==null,onClick:U=>{U.stopPropagation(),T()},children:l===n.id?t.jsx(de,{className:"size-3.5"}):p("orgs.catalogItemCard.connect")}),e[26]=g,e[27]=l,e[28]=T,e[29]=a,e[30]=n.id,e[31]=p,e[32]=P):P=e[32];let k;e[33]!==P?(k=t.jsx("div",{className:"flex items-center gap-2",children:P}),e[33]=P,e[34]=k):k=e[34];let $;return e[35]!==M||e[36]!==O||e[37]!==k?($=t.jsx(Ce,{connection:M,fallbackIcon:I,onClick:O,headerActionsAlwaysVisible:!0,headerActions:k}),e[35]=M,e[36]=O,e[37]=k,e[38]=$):$=e[38],$}function dn(o){return o?.length?{appToolName:o.find(n=>!!Et(n._meta))?.name??null}:null}const un=3;function gn(o){const e=new Map;for(const n of o)for(const g of n.connections??[]){const s=e.get(g.connection_id)??[];s.push(n),e.set(g.connection_id,s)}return e}function mn(o){const e=W.c(21),{projects:n}=o,g=ne();if(n.length===0){let u;e[0]!==g?(u=g("projects.connections.orgWide"),e[0]=g,e[1]=u):u=e[1];let a;return e[2]!==u?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=a):a=e[3],a}let s,i,l;if(e[4]!==n){const u=n.slice(0,un);l="flex min-w-0 items-center gap-2",s="flex shrink-0 -space-x-1.5",i=u.map(pn),e[4]=n,e[5]=s,e[6]=i,e[7]=l}else s=e[5],i=e[6],l=e[7];let r;e[8]!==s||e[9]!==i?(r=t.jsx("div",{className:s,children:i}),e[8]=s,e[9]=i,e[10]=r):r=e[10];let d;e[11]!==n[0]?.title||e[12]!==n.length||e[13]!==g?(d=n.length===1?n[0]?.title:g("projects.connections.usedBy",{count:n.length}),e[11]=n[0]?.title,e[12]=n.length,e[13]=g,e[14]=d):d=e[14];let p;e[15]!==d?(p=t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:d}),e[15]=d,e[16]=p):p=e[16];let m;return e[17]!==l||e[18]!==r||e[19]!==p?(m=t.jsxs("div",{className:l,children:[r,p]}),e[17]=l,e[18]=r,e[19]=p,e[20]=m):m=e[20],m}function pn(o){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:o.title,children:t.jsx(Kt,{icon:o.icon,name:o.title,size:"xs"})},o.id)}function Re(o){const e=W.c(8),{selectionMode:n,children:g}=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=he("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(et,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",onClick:hn,children:t.jsx(nn,{size:20})})}),e[2]=l):l=e[2];let r;e[3]!==g?(r=t.jsxs(tt,{children:[l,t.jsx(nt,{align:"end",onClick:fn,children:g})]}),e[3]=g,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 fn(o){return o.stopPropagation()}function hn(o){return o.stopPropagation()}function xn(o){const e=W.c(57),{group:n,onOpen:g,selectionMode:s,selectedIds:i,onToggleSelect:l}=o,r=ne();let d;if(e[0]!==n.connections||e[1]!==i){let x;e[3]!==i?(x=A=>i.has(A.id),e[3]=i,e[4]=x):x=e[4],d=n.connections.every(x),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const p=d;let m;if(e[5]!==n.connections||e[6]!==i){let x;e[8]!==i?(x=A=>i.has(A.id),e[8]=i,e[9]=x):x=e[9],m=n.connections.some(x),e[5]=n.connections,e[6]=i,e[7]=m}else m=e[7];const u=m;let a;e[10]!==p||e[11]!==n.connections||e[12]!==l||e[13]!==i?(a=()=>{for(const x of n.connections)p?i.has(x.id)&&l(x.id):i.has(x.id)||l(x.id)},e[10]=p,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=a):a=e[14];const j=a,f=n.title,S=n.icon;let y;e[15]!==n.connections.length||e[16]!==r?(y=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=y):y=e[17];let v;e[18]!==n.icon||e[19]!==n.title||e[20]!==y?(v={title:f,icon:S,description:y},e[18]=n.icon,e[19]=n.title,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==g||e[23]!==s||e[24]!==j?(C=()=>s?j():g(),e[22]=g,e[23]=s,e[24]=j,e[25]=C):C=e[25];const c=s&&p&&"ring-2 ring-primary",h=s&&u&&!p&&"ring-1 ring-primary/50";let w;e[26]!==h||e[27]!==c?(w=he(c,h),e[26]=h,e[27]=c,e[28]=w):w=e[28];const N=s?p?!0:u&&"mixed":void 0;let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(xe,{}),e[29]=T):T=e[29];let M;e[30]!==p||e[31]!==n.connections.length||e[32]!==s||e[33]!==u||e[34]!==r||e[35]!==j?(M=s?t.jsx(Ee,{checked:p?!0:u?"indeterminate":!1,onCheckedChange:j}):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]=p,e[31]=n.connections.length,e[32]=s,e[33]=u,e[34]=r,e[35]=j,e[36]=M):M=e[36];let I;e[37]!==g?(I=x=>{x.stopPropagation(),g()},e[37]=g,e[38]=I):I=e[38];let O;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Ke,{size:16}),e[39]=O):O=e[39];let P;e[40]!==r?(P=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=P):P=e[41];let k;e[42]!==I||e[43]!==P?(k=t.jsxs(ie,{onClick:I,children:[O,P]}),e[42]=I,e[43]=P,e[44]=k):k=e[44];let $;e[45]!==s||e[46]!==k?($=t.jsx(Re,{selectionMode:s,children:k}),e[45]=s,e[46]=k,e[47]=$):$=e[47];let U;e[48]!==M||e[49]!==$?(U=t.jsxs("div",{className:"flex items-center gap-1",children:[M,$]}),e[48]=M,e[49]=$,e[50]=U):U=e[50];let X;return e[51]!==w||e[52]!==N||e[53]!==U||e[54]!==v||e[55]!==C?(X=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:v,onClick:C,className:w,selected:N,fallbackIcon:T,headerActionsAlwaysVisible:!0,headerActions:U})}),e[51]=w,e[52]=N,e[53]=U,e[54]=v,e[55]=C,e[56]=X):X=e[56],X}function jn(o){const e=W.c(36),{connection:n,isSelected:g,selectionMode:s,canManage:i,canManageAgents:l,onToggleSelect:r,onOpen:d,onToggleStatus:p,onDelete:m}=o,u=ne();let a;e[0]!==g||e[1]!==r||e[2]!==s||e[3]!==u?(a=s?t.jsx(Ee,{checked:g,onCheckedChange:r,onClick:Sn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=g,e[1]=r,e[2]=s,e[3]=u,e[4]=a):a=e[4];let j;e[5]!==d?(j=N=>{N.stopPropagation(),d()},e[5]=d,e[6]=j):j=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ke,{size:16}),e[7]=f):f=e[7];let S;e[8]!==u?(S=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=S):S=e[9];let y;e[10]!==j||e[11]!==S?(y=t.jsxs(ie,{onClick:j,children:[f,S]}),e[10]=j,e[11]=S,e[12]=y):y=e[12];let v;e[13]!==i||e[14]!==l||e[15]!==r||e[16]!==u?(v=(i||l)&&t.jsxs(ie,{onClick:N=>{N.stopPropagation(),r()},children:[t.jsx(Ht,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=r,e[16]=u,e[17]=v):v=e[17];let C;e[18]!==i||e[19]!==n||e[20]!==p||e[21]!==u?(C=i&&(n.status==="active"?t.jsxs(ie,{onClick:N=>{N.stopPropagation(),p("inactive")},children:[t.jsx(Rt,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ie,{onClick:N=>{N.stopPropagation(),p("active")},children:[t.jsx(Wt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=p,e[21]=u,e[22]=C):C=e[22];let c;e[23]!==i||e[24]!==m||e[25]!==u?(c=i&&t.jsxs(ie,{variant:"destructive",onClick:N=>{N.stopPropagation(),m()},children:[t.jsx(He,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=m,e[25]=u,e[26]=c):c=e[26];let h;e[27]!==s||e[28]!==y||e[29]!==v||e[30]!==C||e[31]!==c?(h=t.jsxs(Re,{selectionMode:s,children:[y,v,C,c]}),e[27]=s,e[28]=y,e[29]=v,e[30]=C,e[31]=c,e[32]=h):h=e[32];let w;return e[33]!==a||e[34]!==h?(w=t.jsxs("div",{className:"flex items-center gap-1",children:[a,h]}),e[33]=a,e[34]=h,e[35]=w):w=e[35],w}function Sn(o){return o.stopPropagation()}function yn(o){const e=W.c(29),{count:n,total:g,canManage:s,canManageAgents:i,onSelectAll:l,onDeselectAll:r,onDelete:d,onAddToAgent:p,onToggleStatus:m,onCancel:u}=o,a=ne();if(n===0)return null;let j;e[0]!==n||e[1]!==a?(j=a("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=a,e[2]=j):j=e[2];let f;e[3]!==j?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:j}),e[3]=j,e[4]=f):f=e[4];let S;e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==a||e[9]!==g?(S=n<g?t.jsx(L,{variant:"outline",size:"sm",onClick:l,children:a("orgs.connectionSelectionUi.selectAll",{total:g})}):t.jsx(L,{variant:"outline",size:"sm",onClick:r,children:a("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=l,e[8]=a,e[9]=g,e[10]=S):S=e[10];let y;e[11]!==i||e[12]!==p||e[13]!==a?(y=i&&t.jsxs(L,{variant:"outline",size:"sm",onClick:p,children:[t.jsx(Le,{size:13}),a("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=p,e[13]=a,e[14]=y):y=e[14];let v;e[15]!==s||e[16]!==d||e[17]!==m||e[18]!==a?(v=s&&t.jsxs(t.Fragment,{children:[t.jsx(L,{variant:"outline",size:"sm",onClick:()=>m("active"),children:a("orgs.connectionSelectionUi.enable")}),t.jsx(L,{variant:"outline",size:"sm",onClick:()=>m("inactive"),children:a("orgs.connectionSelectionUi.disable")}),t.jsxs(L,{variant:"destructive",size:"sm",onClick:d,children:[t.jsx(He,{size:13}),a("orgs.connectionSelectionUi.delete")]})]}),e[15]=s,e[16]=d,e[17]=m,e[18]=a,e[19]=v):v=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Be,{size:13}),e[20]=C):C=e[20];let c;e[21]!==u?(c=t.jsx(L,{variant:"ghost",size:"sm",onClick:u,children:C}),e[21]=u,e[22]=c):c=e[22];let h;return e[23]!==f||e[24]!==S||e[25]!==y||e[26]!==v||e[27]!==c?(h=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl glass px-3 py-2 flex items-center gap-2",children:[f,S,y,v,c]})}),e[23]=f,e[24]=S,e[25]=y,e[26]=v,e[27]=c,e[28]=h):h=e[28],h}function Cn(o){const e=W.c(47),{open:n,onOpenChange:g,agents:s,onConfirm:i}=o,l=ne(),[r,d]=z.useState(null);let p;e[0]!==g?(p=k=>{k||d(null),g(k)},e[0]=g,e[1]=p):p=e[1];const m=p;let u;e[2]!==l?(u=l("orgs.connectionSelectionUi.addToAgentTitle"),e[2]=l,e[3]=u):u=e[3];let a;e[4]!==u?(a=t.jsx(Ne,{children:u}),e[4]=u,e[5]=a):a=e[5];let j;e[6]!==l?(j=l("orgs.connectionSelectionUi.addToAgentDescription"),e[6]=l,e[7]=j):j=e[7];let f;e[8]!==j?(f=t.jsx(Te,{children:j}),e[8]=j,e[9]=f):f=e[9];let S;e[10]!==a||e[11]!==f?(S=t.jsxs(Ae,{children:[a,f]}),e[10]=a,e[11]=f,e[12]=S):S=e[12];let y;e[13]!==s||e[14]!==r||e[15]!==l?(y=s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):s.map(k=>t.jsxs("button",{type:"button",onClick:()=>d(k.id),className:he("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",r===k.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-accent"),children:[t.jsx(tn,{icon:k.icon,name:k.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:k.title}),k.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.description})]})]},k.id)),e[13]=s,e[14]=r,e[15]=l,e[16]=y):y=e[16];let v;e[17]!==y?(v=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[17]=y,e[18]=v):v=e[18];let C;e[19]!==m?(C=()=>m(!1),e[19]=m,e[20]=C):C=e[20];let c;e[21]!==l?(c=l("orgs.connectionSelectionUi.cancel"),e[21]=l,e[22]=c):c=e[22];let h;e[23]!==c||e[24]!==C?(h=t.jsx(L,{variant:"outline",onClick:C,children:c}),e[23]=c,e[24]=C,e[25]=h):h=e[25];const w=!r;let N;e[26]!==m||e[27]!==i||e[28]!==r?(N=()=>{r&&(i(r),m(!1))},e[26]=m,e[27]=i,e[28]=r,e[29]=N):N=e[29];let T;e[30]!==l?(T=l("orgs.connectionSelectionUi.add"),e[30]=l,e[31]=T):T=e[31];let M;e[32]!==w||e[33]!==N||e[34]!==T?(M=t.jsx(L,{disabled:w,onClick:N,children:T}),e[32]=w,e[33]=N,e[34]=T,e[35]=M):M=e[35];let I;e[36]!==h||e[37]!==M?(I=t.jsxs(we,{children:[h,M]}),e[36]=h,e[37]=M,e[38]=I):I=e[38];let O;e[39]!==I||e[40]!==S||e[41]!==v?(O=t.jsxs(Ie,{className:"sm:max-w-[400px]",children:[S,v,I]}),e[39]=I,e[40]=S,e[41]=v,e[42]=O):O=e[42];let P;return e[43]!==m||e[44]!==n||e[45]!==O?(P=t.jsx(Pe,{open:n,onOpenChange:m,children:O}),e[43]=m,e[44]=n,e[45]=O,e[46]=P):P=e[46],P}function vn({listState:o,activeTab:e,typeFilter:n,statusFilter:g}){const s=ne(),{org:i}=Me(),l=dt(),r=$e(),{data:d}=Oe.useSession(),p=ze(),m=zt(o),u=vt(),{granted:a}=ye("connections:manage"),{granted:j}=ye("agents:manage"),[f,S]=z.useState(new Set),y=f.size>0,[v,C]=z.useState(!1),[c,h]=z.useState(!1),[w,N]=z.useState(null),T=Bt(),M=gn(Gt(T)),I=m.filter(b=>!(n!=="ALL"&&b.connection_type!==n||g!=="ALL"&&b.status!==g)),O=yt(I),P=b=>{S(_=>{const B=new Set(_);return B.has(b)?B.delete(b):B.add(b),B})},k=()=>{S(new Set)},$=Ue(o.searchTerm),U=$.items,X=_t($.loadMore,$.hasMore,$.isLoadingMore),x=new Set(m.filter(b=>b.app_name).map(b=>b.app_name)),A=o.search.length>0,E=e==="all"||A?U.filter(b=>{if(A){const _=Fe(b);if(_&&x.has(_))return!1}return!0}):[],ee=e==="connected"||A?O:[],G=async b=>{if(!(!i||!d?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:b.id,source:"connections_page"}),N(b.id);try{const _=ht(b,i.id,d.user.id,{remoteIndex:0}),B=_.connection_type==="STDIO",K=!!_.connection_url,H=B&&_.connection_headers&&typeof _.connection_headers=="object"&&"command"in _.connection_headers;if(!K&&!H){R.error(s("orgs.connections.cannotConnectNoMethod")),N(null);return}const ve=await p.create.mutateAsync(_),{id:se}=ve,ce=await en({connectionId:se,orgId:i.id,orgSlug:i.slug,persistFallback:le=>p.update.mutateAsync({id:se,data:{connection_token:le}}).then(()=>{})});if(ce.ran&&!ce.ok){te("connection_oauth_failed",{connection_id:se,flow:"connections_page_connect",error:ce.error??"no_token"}),R.error(s("orgs.connections.authenticationFailed",{error:ce.error??"no token received"}));return}if(ce.ran){te("connection_oauth_succeeded",{connection_id:se,flow:"connections_page_connect"});const le=new URL(`/api/${i.slug}/mcp/${se}`,window.location.origin);await l.invalidateQueries({queryKey:mt.isMCPAuthenticated(le.href,null)}),V(),R.success(s("orgs.connections.authenticationSuccessful"))}let me=null;try{const le=await l.fetchQuery(Lt({connectionId:se,orgId:i.id,orgSlug:i.slug}));me=dn((await le.listTools()).tools)}catch{}const be=ae(ve),_e=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(me.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(_){R.error(s("orgs.connections.failedToConnect",{error:_ instanceof Error?_.message:String(_)}))}finally{N(null)}}},D=ut(),V=()=>{pt(l,i.id)},F=async()=>{C(!1);const b=[...f];te("connections_bulk_delete",{count:b.length});const B=(await Promise.allSettled(b.map(K=>D.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;V(),R.success(s("orgs.connections.deletedConnections",{count:B})),k()},ue=async(b,_)=>{try{await p.update.mutateAsync({id:b,data:{status:_}}),V(),R.success(s(_==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(s("orgs.connections.failedToUpdateConnection"))}},je=async b=>{const _=[...f];te("connections_bulk_status_toggled",{count:_.length,to_status:b});const K=(await Promise.allSettled(_.map(H=>p.update.mutateAsync({id:H,data:{status:b}})))).filter(H=>H.status==="fulfilled").length;V(),R.success(b==="active"?s("orgs.connections.enabledConnections",{count:K}):s("orgs.connections.disabledConnections",{count:K})),k()},ge=async b=>{const _=T.find(H=>H.id===b);if(!_)return;te("connections_bulk_add_to_agent",{agent_id:b,count:f.size});const B=new Set(_.connections.map(H=>H.connection_id)),K=[...f].filter(H=>!B.has(H)).map(H=>({connection_id:H,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){R.info(s("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await D.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:b,data:{connections:[..._.connections,...K]}}),gt(l,i.id),R.success(s("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:_.title})),k()}catch{R.error(s("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(bt,{...u}),t.jsx(rn,{open:v,onOpenChange:C,count:f.size,onConfirm:F}),t.jsx(Cn,{open:c,onOpenChange:h,agents:T,onConfirm:ge}),$.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(A?E.length===0&&I.length===0:e==="all"?E.length===0:I.length===0)?t.jsx(Ct,{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:[ee.map(b=>{if(b.type==="group")return t.jsx(xn,{group:b,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:b.key}})},selectionMode:y,selectedIds:f,onToggleSelect:P},b.key);const _=b.connection,B=f.has(_.id);return t.jsx(Ce,{connection:_,fallbackIcon:t.jsx(xe,{}),onClick:()=>y?P(_.id):r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(_)}}),className:he(B&&"ring-2 ring-primary bg-primary/5"),selected:y?B:void 0,footer:t.jsx(mn,{projects:M.get(_.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(jn,{connection:_,isSelected:B,selectionMode:y,canManage:a,canManageAgents:j,onToggleSelect:()=>P(_.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(_)}}),onToggleStatus:K=>ue(_.id,K),onDelete:()=>u.requestDelete(_)})},_.id)}),E.map(b=>t.jsx(an,{item:b,canManage:a,allConnections:m,connectedAppNames:x,connectingItemId:w,onNavigateConnected:_=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(_)}}),onConnect:G},b.id)),(e==="all"||A)&&t.jsx("div",{ref:X,className:"col-span-full h-4"}),(e==="all"||A)&&$.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(de,{className:"size-6 text-muted-foreground"})})]})}),y&&t.jsx(yn,{count:f.size,total:I.length,canManage:a,canManageAgents:j,onSelectAll:()=>{S(new Set(I.map(b=>b.id)))},onDeselectAll:()=>S(new Set),onDelete:()=>C(!0),onAddToAgent:()=>h(!0),onToggleStatus:je,onCancel:k})]})}function bn(){const o=ne(),{org:e}=Me(),n=$e(),g=st({strict:!1}),{data:s}=Oe.useSession(),{stdioEnabled:i}=it(),l=Ve(),{granted:r}=ye("connections:manage"),d=ln({namespace:e.slug,resource:"connections"}),p=ze(),[m,u]=ct(lt.connectionsTab(e.slug),x=>g.tab==="all"||g.tab==="connected"?g.tab:x??"all"),[a,j]=z.useState("ALL"),[f,S]=z.useState("ALL"),v=Ue(d.searchTerm).items,C=d.search!==d.searchTerm,c=rt({resolver:at(Qt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),h=c.watch("ui_type"),w=c.watch("connection_url"),N=c.watch("npx_package"),T=fe({uiType:h,connectionUrl:w??"",npxPackage:N??""})??ke({uiType:h,connectionUrl:w??"",registryItems:v}),M=r&&g.action==="create",I=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),n({to:".",search:x=>({...x,action:"create"})})},O=()=>{n({to:".",search:x=>({...x,action:void 0})})},P=async x=>{let A,E=null,ee=null,G=null;x.ui_type==="NPX"?(A="STDIO",E="",G=Yt(x.npx_package||"",x.env_vars||[])):x.ui_type==="STDIO"?(A="STDIO",E="",G=Zt(x.stdio_command||"",x.stdio_args||"",x.stdio_cwd,x.env_vars||[])):(A=x.ui_type,E=x.connection_url||"",ee=x.connection_token||null);const D=ft("conn");te("connection_custom_created",{connection_type:A,ui_type:x.ui_type}),await p.create.mutateAsync({id:D,title:x.title,description:x.description||null,connection_type:A,connection_url:E,connection_token:ee,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:s?.user?.id||"system",organization_id:e.id,icon:x.icon??null,app_name:null,app_id:null,connection_headers:G,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null}),O(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ae({app_name:null,connection_url:E,title:x.title,id:D})}})},k=x=>{x||(M&&O(),c.reset())},$=x=>{const A=x.trim();if(!A)return;const E=!!c.formState.dirtyFields.title,ee=!!c.formState.dirtyFields.description,G=!!c.formState.dirtyFields.env_vars,D=F=>{if(F&&(!E&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!ee&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!G&&F.envVarKeys?.length)){const ue=c.getValues("env_vars")??[],je=new Set(ue.map(b=>b.key)),ge=F.envVarKeys.filter(b=>!je.has(b));ge.length>0&&c.setValue("env_vars",[...ue,...ge.map(b=>({key:b,value:""}))],{shouldDirty:!0})}},V=Jt(A);if(V&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",V.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),D(fe({uiType:"NPX",npxPackage:V.packageName}));return}if(A.startsWith("http://")||A.startsWith("https://")){const F=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",A,{shouldDirty:!0}),D(fe({uiType:F,connectionUrl:A})??ke({uiType:F,connectionUrl:A,registryItems:v}));return}h==="NPX"&&D(fe({uiType:"NPX",npxPackage:A}))},U=r?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(L,{size:"sm",variant:"default",onClick:I,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:o("orgs.connections.customConnection")})]})}):null,X=t.jsx(xt,{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:x=>j(x||"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:f,onChange:x=>S(x||"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")}]}]});return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const x=o("orgs.connections.createConnection"),A=o("orgs.connections.createConnectionDescription"),E=c.formState.isSubmitting?o("orgs.connections.saving"):o("orgs.connections.createConnection"),ee=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($t,{value:D.value,onValueChange:D.onChange,children:[t.jsx(Y,{children:t.jsx(Ot,{children:t.jsx(Ft,{})})}),t.jsxs(Ut,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),i&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),o("orgs.connections.npxPackage")]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Xt,{className:"w-4 h-4"}),o("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),h==="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(oe,{placeholder:o("orgs.connections.npmPackagePlaceholder"),...D,value:D.value??"",onPaste:V=>{const F=V.clipboardData.getData("text");F&&(V.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),$(F))},onBlur:V=>{$(V.target.value),D.onBlur()}})}),t.jsx(Z,{})]})}),h==="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(oe,{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(oe,{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(oe,{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,{})]})})]}),(h==="NPX"||h==="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(qt,{value:D.value??[],onChange:D.onChange})}),t.jsx(Z,{})]})}),h!=="NPX"&&h!=="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(oe,{placeholder:o("orgs.connections.urlPlaceholder"),...D,value:D.value??"",onPaste:V=>{const F=V.clipboardData.getData("text");F&&(V.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),$(F))},onBlur:V=>{$(V.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:T?.token?.label??o("orgs.connections.tokenOptional")}),t.jsx(Y,{children:t.jsx(oe,{type:"password",placeholder:T?.token?.placeholder??o("orgs.connections.tokenPlaceholder"),...D,value:D.value??""})}),T?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.token.helperText,T.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(oe,{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(Vt,{placeholder:o("orgs.connections.descriptionPlaceholder"),rows:3,...D,value:D.value??""})}),t.jsx(Z,{})]})})]}),G=M;return l?t.jsx(Nt,{open:G,onOpenChange:k,children:t.jsxs(Tt,{className:"max-h-[90vh]",children:[t.jsx(At,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(wt,{children:x}),t.jsx(It,{className:"mt-1",children:A})]}),t.jsx(Pt,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":o("orgs.connections.close"),children:t.jsx(Be,{size:16})})})]})}),t.jsx(De,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:ee}),t.jsx(Mt,{children:t.jsx(L,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:E})})]})})]})}):t.jsx(Pe,{open:G,onOpenChange:k,children:t.jsxs(Ie,{className:"sm:max-w-[525px]",children:[t.jsxs(Ae,{children:[t.jsx(Ne,{children:x}),t.jsx(Te,{children:A})]}),t.jsx(De,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:ee}),t.jsxs(we,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>k(!1),children:o("orgs.connections.cancel")}),t.jsx(L,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:E})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Actions,{secondary:t.jsxs(t.Fragment,{children:[t.jsx(jt,{value:d.search,onChange:d.setSearch,label:o("library.context.search"),placeholder:o("orgs.connections.searchPlaceholder"),clearLabel:o("library.library.clearSearch")}),X]}),children:U}),t.jsx(St,{placement:"page",tabs:[{id:"all",label:o("orgs.connections.tabAll")},{id:"connected",label:o("orgs.connections.tabConnected")}],activeTab:m,onTabChange:x=>{const A=x;A!==m&&te("connections_page_tab_changed",{to_tab:A}),u(A)}}),t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:C?.5:1,transition:C?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:C?"none":"auto"},children:t.jsx(vn,{listState:d,activeTab:m,typeFilter:a,statusFilter:f})})})]})})})]})})}function qo(){const o=W.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ot,{children:t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx(bn,{})})}),o[0]=e):e=o[0],e}export{qo as default};