decocms 4.388.4 → 4.389.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (373) hide show
  1. package/dist/client/assets/{AlertCircle-Cat-Fy2i.js → AlertCircle-CVkVxygv.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CSNer7sZ.js → AreaChart-lVePxdbV.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DuxVUo5_.js → ArrowLeft-CN6aZBvX.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-CsoDgnUj.js → ArrowRight-FqJnNh3f.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-CbPBDOpZ.js → ArrowUp-bOLRJZuX.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-DgQehil3.js → CartesianChart-C3Zko_Et.js} +1 -1
  7. package/dist/client/assets/{Check-BZXRTDaX.js → Check-DL_AGZMy.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-Cj4PQGuv.js → CheckCircle-DtMp-qqq.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-DGt31MPD.js → ChevronUp-B6mY-MC1.js} +1 -1
  10. package/dist/client/assets/{Copy01-B6hr4CBg.js → Copy01-6lOOhJcp.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-CiYLi_pR.js → CreditCard01-DdYfDHIS.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-BITRq5d-.js → DotsVertical-CAjUqtRp.js} +1 -1
  13. package/dist/client/assets/{Download01-CsYfHghd.js → Download01-Dq8Pn8XY.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-zVAOL4kJ.js → ErrorBarContext-B26KvZ3G.js} +1 -1
  15. package/dist/client/assets/{Eye-rQUtSbk6.js → Eye-B5e-ilzV.js} +1 -1
  16. package/dist/client/assets/{Globe04-C_9DD9oO.js → Globe04-_nV993le.js} +1 -1
  17. package/dist/client/assets/{Image01-BLIf6uY9.js → Image01-CkJtDP-I.js} +1 -1
  18. package/dist/client/assets/{Key01-SGIR_QrT.js → Key01-BCuGindq.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-GBQ0rQxQ.js → LayoutLeft-U0F-Da_p.js} +1 -1
  20. package/dist/client/assets/{Line-y7nkMb-C.js → Line-BA6i0Sln.js} +1 -1
  21. package/dist/client/assets/{Link01-BnVQGp2l.js → Link01-BjTxU_bP.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-Dh0AABP8.js → LinkExternal01-DSUCZUJp.js} +1 -1
  23. package/dist/client/assets/{Monitor01-CxisI5ut.js → Monitor01-r707obGd.js} +1 -1
  24. package/dist/client/assets/{Package-DsU1cU6S.js → Package-D2jMN__x.js} +1 -1
  25. package/dist/client/assets/{Palette-CzoNEzRs.js → Palette-DebiHmrq.js} +1 -1
  26. package/dist/client/assets/{Plus-qASEo4cN.js → Plus-BbELO07z.js} +1 -1
  27. package/dist/client/assets/{SearchLg-qmi8uaeX.js → SearchLg-C9MObDBB.js} +1 -1
  28. package/dist/client/assets/{SearchMd-B6NDUgzQ.js → SearchMd-B1Foybfh.js} +1 -1
  29. package/dist/client/assets/{Sector-DK9KwpRN.js → Sector-OiAocllE.js} +1 -1
  30. package/dist/client/assets/{Share07-CMPYQYHk.js → Share07-B2WnpDWD.js} +1 -1
  31. package/dist/client/assets/{Stars01-cdnol_cb.js → Stars01-DUL2jKUJ.js} +1 -1
  32. package/dist/client/assets/{Sun-BSFyLDhg.js → Sun-BKxdX8hu.js} +1 -1
  33. package/dist/client/assets/{Tool01-H9OcfGdq.js → Tool01-BvNT4KDI.js} +1 -1
  34. package/dist/client/assets/{Trash01-mB4s-hrv.js → Trash01-BLoRPhD3.js} +1 -1
  35. package/dist/client/assets/{Upload01-Uv_jtHIk.js → Upload01-CNb1qfRO.js} +1 -1
  36. package/dist/client/assets/{User01-DHGCVvV3.js → User01-U5CIC-GP.js} +1 -1
  37. package/dist/client/assets/{UserSquare-BfT6tB5U.js → UserSquare-CZakdYWe.js} +1 -1
  38. package/dist/client/assets/{Users01-C_qUmfZB.js → Users01-C6BprSkC.js} +1 -1
  39. package/dist/client/assets/{X-vKTIsgL1.js → X-BNszojyh.js} +1 -1
  40. package/dist/client/assets/{XCircle-Cu2Sy8Aw.js → XCircle-BuDwhQqF.js} +1 -1
  41. package/dist/client/assets/{XClose-DFUqDOc8.js → XClose-D_JLFZFT.js} +1 -1
  42. package/dist/client/assets/{Zap-CSRFlEXK.js → Zap-BCwjglMw.js} +1 -1
  43. package/dist/client/assets/{ZoomOut-Burao8Eg.js → ZoomOut-q6Y0RhlM.js} +1 -1
  44. package/dist/client/assets/{access-gate-Bbnx_Qh-.js → access-gate-Clo8Jex8.js} +1 -1
  45. package/dist/client/assets/{add-connection-dialog-DzNaYAxM.js → add-connection-dialog-C5SXdxkT.js} +1 -1
  46. package/dist/client/assets/{agent-analytics-C0sV-7Xb.js → agent-analytics-es8O9CL0.js} +2 -2
  47. package/dist/client/assets/agent-app-CGYFJjq5.js +1 -0
  48. package/dist/client/assets/{agent-assets-OnbttXnX.js → agent-assets-Dy169ySy.js} +1 -1
  49. package/dist/client/assets/{agent-automation-BSmqRx9Q.js → agent-automation-D1R1huVt.js} +6 -6
  50. package/dist/client/assets/{agent-automations-D7yiwZb3.js → agent-automations-BVBbNAeW.js} +1 -1
  51. package/dist/client/assets/{agent-connect-sources-CTElBaoM.js → agent-connect-sources-BYoUrpVF.js} +1 -1
  52. package/dist/client/assets/agent-deck-sqReTFoM.js +1 -0
  53. package/dist/client/assets/{agent-e2e-36-yunOr.js → agent-e2e-DxRXY84q.js} +1 -1
  54. package/dist/client/assets/{agent-experiments-B5DGYFrd.js → agent-experiments-_dQ2BC_Q.js} +1 -1
  55. package/dist/client/assets/agent-file-CGmxIBgM.js +1 -0
  56. package/dist/client/assets/{agent-git-BYVAaPsW.js → agent-git-B2s_zuHj.js} +2 -2
  57. package/dist/client/assets/{agent-hosting-BbmS530x.js → agent-hosting-BGGSrQLd.js} +1 -1
  58. package/dist/client/assets/{agent-icon-CzsnrYjD.js → agent-icon-CSebdE0g.js} +1 -1
  59. package/dist/client/assets/agent-library-file-CK_Y2Pye.js +1 -0
  60. package/dist/client/assets/{agent-monitor-C27DYrEB.js → agent-monitor-Dd5ty7vm.js} +1 -1
  61. package/dist/client/assets/{agent-overview-DsQze4i5.js → agent-overview-Cm3ny-qk.js} +1 -1
  62. package/dist/client/assets/agent-settings-B-c4VHd9.js +1 -0
  63. package/dist/client/assets/{agent-site-editor-BNuBiz19.js → agent-site-editor-CDYe7KMp.js} +1 -1
  64. package/dist/client/assets/agent-site-editor-code-C2ptd6Is.js +2 -0
  65. package/dist/client/assets/agent-site-editor-content-B7A6sQQt.js +2 -0
  66. package/dist/client/assets/agent-site-editor-preview-sULLmso9.js +518 -0
  67. package/dist/client/assets/agent-view-C2yjGU43.js +1 -0
  68. package/dist/client/assets/{agent-view-guard-C4pdkmKc.js → agent-view-guard-a8AZfEO9.js} +1 -1
  69. package/dist/client/assets/{agents-list-B3F1REj8.js → agents-list-oZyF4Ii3.js} +1 -1
  70. package/dist/client/assets/{ai-providers-BYHAVCy5.js → ai-providers-BlScv4nl.js} +2 -2
  71. package/dist/client/assets/{alert-DsW1KUvt.js → alert-DsihHj7h.js} +1 -1
  72. package/dist/client/assets/{alert-dialog-Dg6YJ6PP.js → alert-dialog-DeRt3vSN.js} +1 -1
  73. package/dist/client/assets/{api-keys-DDd9VBHu.js → api-keys-C9NfUH35.js} +1 -1
  74. package/dist/client/assets/api-keys-D3tjigFv.js +1 -0
  75. package/dist/client/assets/app-editor-D_REDtDg.js +1 -0
  76. package/dist/client/assets/{asset-utils-DOWh4JzZ.js → asset-utils-BS06OXCA.js} +1 -1
  77. package/dist/client/assets/{auth-D3Q2r2cz.js → auth-B-OXMWGw.js} +1 -1
  78. package/dist/client/assets/{auth-catchall-M53zUwPP.js → auth-catchall-CLBv3q5z.js} +1 -1
  79. package/dist/client/assets/{auth-entry-CQhZUGUz.js → auth-entry-uRCGi0qy.js} +1 -1
  80. package/dist/client/assets/{auth-split-layout-Cp7zhn_p.js → auth-split-layout-C9jB6J1h.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-DG9xWGRs.js → authenticate-and-persist-oauth-B71_ZhsC.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-DuetYP8A.js → automation-list-row-BX3OvbcZ.js} +1 -1
  83. package/dist/client/assets/{automation-runs-DrVjV_Uv.js → automation-runs-CUFGFLxs.js} +1 -1
  84. package/dist/client/assets/automations-DGcV2mJq.js +1 -0
  85. package/dist/client/assets/{autosend-C5knIVwo.js → autosend-pQ9pD2-2.js} +1 -1
  86. package/dist/client/assets/{avatar-CLf3yQhN.js → avatar-GIuLZx2C.js} +1 -1
  87. package/dist/client/assets/{badge-DuB4cqrw.js → badge-DS3KIYvS.js} +1 -1
  88. package/dist/client/assets/{block-document-DZ3zGn-U.js → block-document-WF9-dn_8.js} +3 -3
  89. package/dist/client/assets/blocks-preview-workspace-context-BlZqg5yu.js +1 -0
  90. package/dist/client/assets/{breadcrumb-SXbKtw7u.js → breadcrumb-D6xZIsj2.js} +1 -1
  91. package/dist/client/assets/{buckets-D7jxbA8X.js → buckets-CNixgGHU.js} +1 -1
  92. package/dist/client/assets/{build-improve-prompt-doc-DKo7W0US.js → build-improve-prompt-doc-DeGFReow.js} +1 -1
  93. package/dist/client/assets/{bulk-category-panel-CS9EslBN.js → bulk-category-panel-BS5_T4uL.js} +1 -1
  94. package/dist/client/assets/{calendar-D41RMBsP.js → calendar-D4hMMrVq.js} +1 -1
  95. package/dist/client/assets/{capability-load-error-CYpF4fm6.js → capability-load-error-BjI2iK0-.js} +1 -1
  96. package/dist/client/assets/category-editor-BFX9U9Yh.js +1 -0
  97. package/dist/client/assets/{chart-CdmZzz30.js → chart-CdPsiu6K.js} +1 -1
  98. package/dist/client/assets/{chat-context-D1GbDSrr.js → chat-context-HOmU0YHH.js} +6 -6
  99. package/dist/client/assets/{chat-draft-VYqGGS3B.js → chat-draft-BdxqYU8-.js} +1 -1
  100. package/dist/client/assets/{checkbox-BKGUJJNh.js → checkbox-DBYfq56y.js} +1 -1
  101. package/dist/client/assets/{choose-editor-Dkb9gjmg.js → choose-editor-DSxVv7hu.js} +1 -1
  102. package/dist/client/assets/{claim-phase-copy-0btUuJoC.js → claim-phase-copy-njXeDF0h.js} +1 -1
  103. package/dist/client/assets/{cli-auth-success-BFRzX7yY.js → cli-auth-success-uK8yk1Sb.js} +1 -1
  104. package/dist/client/assets/{client-icons-CIit2qYG.js → client-icons-CaoDPAaa.js} +1 -1
  105. package/dist/client/assets/{collapsible-eiDLfZY7.js → collapsible-BpIxv8-d.js} +1 -1
  106. package/dist/client/assets/{collection-detail-D6aw3A-V.js → collection-detail-vK2X038F.js} +1 -1
  107. package/dist/client/assets/{collection-display-button-D9O76Rnp.js → collection-display-button-ChjN1roR.js} +1 -1
  108. package/dist/client/assets/{collection-search-BQXOJg8a.js → collection-search-DyuqjLWs.js} +1 -1
  109. package/dist/client/assets/{collection-table-wrapper-zKpdBBAO.js → collection-table-wrapper-CNNpAz5Y.js} +1 -1
  110. package/dist/client/assets/{collection-tabs-BWQrYrdS.js → collection-tabs-3_QvnkN-.js} +1 -1
  111. package/dist/client/assets/combobox-OP-CbRFf.js +1 -0
  112. package/dist/client/assets/command-ByUEKQB9.js +1 -0
  113. package/dist/client/assets/{companion-mcps-section-8c0rXQex.js → companion-mcps-section-6HKE7JJ2.js} +1 -1
  114. package/dist/client/assets/{connect-B9ZzFP7o.js → connect-CsNBKbv0.js} +2 -2
  115. package/dist/client/assets/{connect-layout-CSTvrhGM.js → connect-layout-DVtCwqcX.js} +1 -1
  116. package/dist/client/assets/{connection-DzM2SOZ6.js → connection-DR9gf0au.js} +1 -1
  117. package/dist/client/assets/{connection-card-DF11WhqU.js → connection-card-BOo8yulu.js} +1 -1
  118. package/dist/client/assets/{connection-detail-Dimacfl3.js → connection-detail-BqzECTqG.js} +1 -1
  119. package/dist/client/assets/{connection-form-helpers-CyBATU5Y.js → connection-form-helpers-D5P5OxyV.js} +1 -1
  120. package/dist/client/assets/{connections-C_1m4t4b.js → connections-DH9JM6iR.js} +1 -1
  121. package/dist/client/assets/{create-organization-dialog-Cy1fVEro.js → create-organization-dialog-S8LtKHhd.js} +1 -1
  122. package/dist/client/assets/{decofile-api-DkM3ZQFM.js → decofile-api-CWaaGMA2.js} +1 -1
  123. package/dist/client/assets/{decopilot-YckYKTsg.js → decopilot-B7-O9fZC.js} +2 -2
  124. package/dist/client/assets/{dialog-C36x61_J.js → dialog-BG6kEGFR.js} +1 -1
  125. package/dist/client/assets/{discover-CqgNMlsp.js → discover-OS0btTyd.js} +1 -1
  126. package/dist/client/assets/{domain-settings-D6TBWbch.js → domain-settings-BrbTzYfK.js} +1 -1
  127. package/dist/client/assets/{download-app-dialog-7J000m-o.js → download-app-dialog-NqW4PLAx.js} +1 -1
  128. package/dist/client/assets/{drawer-CsJzOKcM.js → drawer-Bl-PPIzX.js} +1 -1
  129. package/dist/client/assets/{editor-BQuCFEpz.js → editor-BiwQpn1s.js} +1 -1
  130. package/dist/client/assets/{empty-state-ClBiZqLf.js → empty-state-BpI78UAU.js} +1 -1
  131. package/dist/client/assets/{empty-state-gVTYQvW1.js → empty-state-DzReaOau.js} +1 -1
  132. package/dist/client/assets/{extract-connection-data-BIqslos8.js → extract-connection-data-BimwPioU.js} +1 -1
  133. package/dist/client/assets/{feature-gate-DLeaUXYN.js → feature-gate-B63BZEdG.js} +1 -1
  134. package/dist/client/assets/{feature-paywall-lhh7GOr7.js → feature-paywall-DwNmZ-M9.js} +1 -1
  135. package/dist/client/assets/{file-explorer-BRRFAgbe.js → file-explorer-DLzYcbz9.js} +1 -1
  136. package/dist/client/assets/{file-preview-DobzjEc2.js → file-preview-DCBxvWAy.js} +1 -1
  137. package/dist/client/assets/{file-share-button-6XYGV6w8.js → file-share-button-Cz0mgdAm.js} +1 -1
  138. package/dist/client/assets/{file-type-icon-CFRsMAQ4.js → file-type-icon-Cbv1Det1.js} +1 -1
  139. package/dist/client/assets/{folder-icon-CxyYiSJb.js → folder-icon-DltflRpD.js} +1 -1
  140. package/dist/client/assets/{form-CXSt7_li.js → form-Bx8qGby0.js} +1 -1
  141. package/dist/client/assets/{gateway-client-BF14HPqj.js → gateway-client-DiyAsoDf.js} +1 -1
  142. package/dist/client/assets/{general-0kms2_Mb.js → general-DTp5FT8F.js} +1 -1
  143. package/dist/client/assets/{github-icon-CIx0jkrL.js → github-icon-Bx6tzbBb.js} +1 -1
  144. package/dist/client/assets/{home-CyQJcQvg.js → home-tpS1TH6x.js} +1 -1
  145. package/dist/client/assets/{hooks-enzgIMXj.js → hooks-ZOtfl4oi.js} +2 -2
  146. package/dist/client/assets/{hooks-C8t7cMQJ.js → hooks-lZSCdRwc.js} +1 -1
  147. package/dist/client/assets/{icon-button-Df-IeDHT.js → icon-button-BudvJWM8.js} +1 -1
  148. package/dist/client/assets/{index-Ci3v6d1n.js → index-B7pMCohP.js} +1 -1
  149. package/dist/client/assets/index-B88q0man.css +1 -0
  150. package/dist/client/assets/{index-B7z_63F4.js → index-B8ZawsDP.js} +1 -1
  151. package/dist/client/assets/{index-DC9_5qIh.js → index-B9lZAmmH.js} +1 -1
  152. package/dist/client/assets/{index-DowxFM-Z.js → index-Bzch_Lwn.js} +1 -1
  153. package/dist/client/assets/{index-ClQyNrgO.js → index-C-u7JO1Y.js} +1 -1
  154. package/dist/client/assets/{index-Doi07Y6T.js → index-C0e8Nw2i.js} +1 -1
  155. package/dist/client/assets/{index-Byz-UaqT.js → index-CR8U3UFH.js} +1 -1
  156. package/dist/client/assets/{index-doEaURqC.js → index-CyBVTyGa.js} +7 -7
  157. package/dist/client/assets/{index-DV9UJZA2.js → index-CzuzrcF3.js} +1 -1
  158. package/dist/client/assets/{index-BoSUEB27.js → index-DeVdNW-7.js} +1 -1
  159. package/dist/client/assets/{index-CDAG9yf3.js → index-DmF8NlWI.js} +1 -1
  160. package/dist/client/assets/{index-BODjkOG4.js → index-DmsjOEhK.js} +1 -1
  161. package/dist/client/assets/{index-C4LzZ3-O.js → index-DtBnPwzh.js} +1 -1
  162. package/dist/client/assets/{index-D9padtMD.js → index-nJTy1ykh.js} +1 -1
  163. package/dist/client/assets/{index-redirect-XY4L95T5.js → index-redirect-lSGpveHC.js} +1 -1
  164. package/dist/client/assets/{infiniteQueryObserver-CxJm0T6_.js → infiniteQueryObserver-COZ-9XSO.js} +1 -1
  165. package/dist/client/assets/{infra-billing-zdKJ_MUK.js → infra-billing-ZSvY9y-Y.js} +1 -1
  166. package/dist/client/assets/input-D5Zi_pUc.js +1 -0
  167. package/dist/client/assets/{input-BT236l5B.js → input-DMG-B3VZ.js} +2 -2
  168. package/dist/client/assets/{input-CLIoB1hh.js → input-DOIUaBAK.js} +1 -1
  169. package/dist/client/assets/{integration-icon-Crk6WRxP.js → integration-icon-mTqkOE6y.js} +1 -1
  170. package/dist/client/assets/{label-tAsQMZ2G.js → label-DVhvlWqs.js} +1 -1
  171. package/dist/client/assets/{last-preview-page-002026Ee.js → last-preview-page-Cc9l6ICr.js} +1 -1
  172. package/dist/client/assets/{layout-CCpqo3zm.js → layout-0DaHUY7Z.js} +1 -1
  173. package/dist/client/assets/{legacy-agents-deep-Cj78AYzA.js → legacy-agents-deep-O9zXW4qh.js} +1 -1
  174. package/dist/client/assets/{legacy-main-redirect-Dn96iLn4.js → legacy-main-redirect-MeePJHje.js} +1 -1
  175. package/dist/client/assets/{library-BuoDGyY9.js → library-DHdWNZX-.js} +1 -1
  176. package/dist/client/assets/{login-DqL9YZRz.js → login-CXyISdG5.js} +1 -1
  177. package/dist/client/assets/{markdown-D0jNOMCX.js → markdown-DCPDulUN.js} +1 -1
  178. package/dist/client/assets/{mcp-app-renderer-BvLPqeD1.js → mcp-app-renderer-DBdofBbE.js} +2 -2
  179. package/dist/client/assets/{mcp-oauth-61IHYJoj.js → mcp-oauth-DdNMjTqu.js} +1 -1
  180. package/dist/client/assets/{members-BcXF5gIl.js → members-YBQ4CS4C.js} +1 -1
  181. package/dist/client/assets/{message-templates-CUQwBtaa.js → message-templates-B-vmK4Xp.js} +1 -1
  182. package/dist/client/assets/{mini-report-page-DbALNxiX.js → mini-report-page-DekMuoTa.js} +1 -1
  183. package/dist/client/assets/{mock-board-D9-PmaL9.js → mock-board-D9NUZPwb.js} +9 -9
  184. package/dist/client/assets/{monaco-editor-xB6SdWXy.js → monaco-editor-tpWF7AL5.js} +1 -1
  185. package/dist/client/assets/{monitoring-stats-row-CTbrFT2U.js → monitoring-stats-row-D_bvL4CA.js} +1 -1
  186. package/dist/client/assets/{multi-select-BPlBOZll.js → multi-select-C3lQgqH3.js} +1 -1
  187. package/dist/client/assets/{mustache-Btjjkmrx.js → mustache-BU3hKYND.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-D8-Vh_4C.js → oauth-callback-BiuyznT3.js} +1 -1
  189. package/dist/client/assets/{oauth-callback-ai-provider-Dpai0ql-.js → oauth-callback-ai-provider-DqtXAIB8.js} +1 -1
  190. package/dist/client/assets/{onboarding-uOVvp-Mg.js → onboarding-BS368ORS.js} +1 -1
  191. package/dist/client/assets/{optimistic-project-sidebar-views-BQt56FI4.js → optimistic-project-sidebar-views-BfkTIuSj.js} +1 -1
  192. package/dist/client/assets/org-file-open-context-Bh_zBQ2O.js +1 -0
  193. package/dist/client/assets/{organization-choice-9DpczJ4c.js → organization-choice-GuO7qGDl.js} +1 -1
  194. package/dist/client/assets/{orgs-B6tWlX0C.js → orgs-DhHpNlvn.js} +1 -1
  195. package/dist/client/assets/page-seo-form-BML1eDhR.js +1 -0
  196. package/dist/client/assets/{pair-BIUMok9W.js → pair-CIltybgP.js} +1 -1
  197. package/dist/client/assets/{plan-ladder-DjuDG4EH.js → plan-ladder-BEYdYGx8.js} +1 -1
  198. package/dist/client/assets/{popover-GUR8piky.js → popover-CUdTfYte.js} +1 -1
  199. package/dist/client/assets/post-calendar-BVrfveN8.js +1 -0
  200. package/dist/client/assets/post-editor-LBOMfHyI.js +1 -0
  201. package/dist/client/assets/{preview-content-CkHbAlf-.js → preview-content-D7H_AlKU.js} +1 -1
  202. package/dist/client/assets/{preview-dialog-DUI33rZ8.js → preview-dialog-CUz95NoQ.js} +1 -1
  203. package/dist/client/assets/{primitives-CHkTFFF-.js → primitives-CyfO2GN8.js} +1 -1
  204. package/dist/client/assets/{profile-BIFbXoSW.js → profile-BNPVU14n.js} +1 -1
  205. package/dist/client/assets/{project-app-view-ZkgOByQo.js → project-app-view-Dm6c4g3t.js} +1 -1
  206. package/dist/client/assets/{project-feed-DGoAUO34.js → project-feed-orYCz9U3.js} +1 -1
  207. package/dist/client/assets/{project-icon-mjklzNJs.js → project-icon-DWnsLAeJ.js} +1 -1
  208. package/dist/client/assets/project-reports-DhaLYRaZ.js +1 -0
  209. package/dist/client/assets/project-tasks-Dzzzm0ET.js +1 -0
  210. package/dist/client/assets/{prompts-BwsVrHFI.js → prompts-Dpv9Ex1_.js} +1 -1
  211. package/dist/client/assets/record-editor-BQ-gbw4b.js +1 -0
  212. package/dist/client/assets/redirect-editor-eLzPdMVZ.js +1 -0
  213. package/dist/client/assets/reports-8U4sSr1z.js +1 -0
  214. package/dist/client/assets/{reports-ChF6GDQz.js → reports-CUfYm0DC.js} +1 -1
  215. package/dist/client/assets/{reports-onboarding-ukyewr1e.js → reports-onboarding-V3a9FHx8.js} +1 -1
  216. package/dist/client/assets/{reports-tab-Cxq1-mux.js → reports-tab-Bx7-g2HC.js} +2 -2
  217. package/dist/client/assets/{repositories-D7d8VzOE.js → repositories-Bbw6GL37.js} +1 -1
  218. package/dist/client/assets/{repository-import-picker-B6ijLkOL.js → repository-import-picker-74Y3ta69.js} +1 -1
  219. package/dist/client/assets/{repository-picker-Ca5oB9j5.js → repository-picker-dKTE5PS5.js} +1 -1
  220. package/dist/client/assets/{require-capability-vhXMBpff.js → require-capability-QoYjHav_.js} +1 -1
  221. package/dist/client/assets/{required-auth-layout-DbGCmQgx.js → required-auth-layout-BgLvQHTP.js} +1 -1
  222. package/dist/client/assets/{reset-password-DrRaSkr-.js → reset-password-ateNgI6E.js} +1 -1
  223. package/dist/client/assets/{resizable-WgWAPECX.js → resizable-D6HLmII4.js} +1 -1
  224. package/dist/client/assets/{review-settings-BzcjRJO0.js → review-settings-jZZT0JG1.js} +1 -1
  225. package/dist/client/assets/{rich-text-link-control-i_tw_Jd2.js → rich-text-link-control-0ZhNexVb.js} +2 -2
  226. package/dist/client/assets/{roles-DTbcvvsD.js → roles-ERYsouVf.js} +1 -1
  227. package/dist/client/assets/{route-BRh6VH3Q.js → route-D5DT7lzH.js} +1 -1
  228. package/dist/client/assets/{route-B8hLxHmX.js → route-DW_oVxtq.js} +1 -1
  229. package/dist/client/assets/{route-DsWfLZyf.js → route-HgZwHfFA.js} +1 -1
  230. package/dist/client/assets/{route-page-header-tbVW9ntg.js → route-page-header-BHdnDvfR.js} +1 -1
  231. package/dist/client/assets/runnable-block-editor-DrtKYS1k.js +17 -0
  232. package/dist/client/assets/{sandbox-lifecycle-context-CvyFr09R.js → sandbox-lifecycle-context-LNZL2c0K.js} +2 -2
  233. package/dist/client/assets/{schema-BVqtjcyJ.js → schema-DSsDEA1v.js} +1 -1
  234. package/dist/client/assets/{scroll-area-Cve7MqyA.js → scroll-area-CmvmQLS1.js} +1 -1
  235. package/dist/client/assets/{search-input-CCUlZDzf.js → search-input-0hd-PWUF.js} +1 -1
  236. package/dist/client/assets/{search-toggle-BtmGTpxl.js → search-toggle-Bp6o4xvm.js} +1 -1
  237. package/dist/client/assets/{secret-picker-DVWtSCXk.js → secret-picker--QwK1qR-.js} +1 -1
  238. package/dist/client/assets/{secrets-dQAYGJYM.js → secrets-ODT01eOm.js} +1 -1
  239. package/dist/client/assets/sections-editor-DwSDIcRs.js +1 -0
  240. package/dist/client/assets/select-CDhEibGy.js +1 -0
  241. package/dist/client/assets/{select-model-Bnz73VTx.js → select-model-Dd7JcBMF.js} +1 -1
  242. package/dist/client/assets/seo-editor-BMnaZ5KR.js +1 -0
  243. package/dist/client/assets/{separator-JATiwE_2.js → separator-D-_LXjFg.js} +1 -1
  244. package/dist/client/assets/{settings-tab-CE0tP2vq.js → settings-tab-CKxa2O9d.js} +4 -4
  245. package/dist/client/assets/{sheet-ZoEgH6s-.js → sheet-DH_REC9j.js} +1 -1
  246. package/dist/client/assets/shell-layout-B3x_9fo1.js +1 -0
  247. package/dist/client/assets/{sidebar-Cz1S2PSM.js → sidebar-CxoDmdm4.js} +1 -1
  248. package/dist/client/assets/{skill-preview-BP5xxsO4.js → skill-preview-D4GrMJU0.js} +1 -1
  249. package/dist/client/assets/{skills-D52kTkau.js → skills-BYtnT-vq.js} +1 -1
  250. package/dist/client/assets/{sso-DAgB-pSG.js → sso-C8v2EdhJ.js} +1 -1
  251. package/dist/client/assets/{switch-BNLiV_oA.js → switch-C7dIR4UF.js} +1 -1
  252. package/dist/client/assets/{synced-repos-BzaJ7fNm.js → synced-repos-BNAaKJnR.js} +1 -1
  253. package/dist/client/assets/{table-D7l9brRh.js → table-B9OXzOjU.js} +1 -1
  254. package/dist/client/assets/{tabs-Gq0qvZI4.js → tabs-D6s_HA-y.js} +1 -1
  255. package/dist/client/assets/{task-board-BXLBBo-B.js → task-board-Qj-6Ctqf.js} +1 -1
  256. package/dist/client/assets/{task-route-BpYPpL3v.js → task-route-9wqWimw6.js} +1 -1
  257. package/dist/client/assets/{task-status-C7fhyr8_.js → task-status-D5cWLC8O.js} +1 -1
  258. package/dist/client/assets/{taskboard-analytics-Bhbjv4p8.js → taskboard-analytics-BtiQkIih.js} +1 -1
  259. package/dist/client/assets/{tasks-C2avg53f.js → tasks-BF0fu0p2.js} +2 -2
  260. package/dist/client/assets/tasks-D4PEOEIP.js +1 -0
  261. package/dist/client/assets/textarea-TE2JJa-B.js +1 -0
  262. package/dist/client/assets/{thread-button-CzoAkKWi.js → thread-button-DUOTtsFE.js} +1 -1
  263. package/dist/client/assets/{thread-intent-DuCE7MYG.js → thread-intent-jq9HKW3p.js} +1 -1
  264. package/dist/client/assets/{thread-route-C5QqTXOt.js → thread-route-C47YRRAe.js} +1 -1
  265. package/dist/client/assets/{thread-route-BBKn0p1b.js → thread-route-JcpQ-ikA.js} +1 -1
  266. package/dist/client/assets/{thread-sheet-body-C52UGBXx.js → thread-sheet-body-DvAYJwTc.js} +1 -1
  267. package/dist/client/assets/{toggle-group-DHrftnUg.js → toggle-group-Dv_lnjT7.js} +1 -1
  268. package/dist/client/assets/{toolbar-icon-button-iy_uLVVB.js → toolbar-icon-button-Cq75cloK.js} +1 -1
  269. package/dist/client/assets/{tooltip-C91IS2ON.js → tooltip-BjUMPvkB.js} +1 -1
  270. package/dist/client/assets/{track-CpCOxAsM.js → track-CNE2_M0H.js} +1 -1
  271. package/dist/client/assets/{types-BCbJ4Eml.js → types-Bxr6Ak0g.js} +3 -3
  272. package/dist/client/assets/{usage-stats-P7Ebxq4V.js → usage-stats-Bug-9_EL.js} +1 -1
  273. package/dist/client/assets/{use-ai-providers-CJ2ga4nx.js → use-ai-providers-ShRDl02e.js} +1 -1
  274. package/dist/client/assets/{use-automations-V0dkF89H.js → use-automations-qnBbEhgN.js} +1 -1
  275. package/dist/client/assets/{use-autosave-ClFMVO3A.js → use-autosave-exq2JPmQ.js} +1 -1
  276. package/dist/client/assets/{use-connect-companion-CXK99yF4.js → use-connect-companion-DQoSkSuB.js} +1 -1
  277. package/dist/client/assets/{use-connection-PgTQPnAp.js → use-connection-WQuJ5yl_.js} +1 -1
  278. package/dist/client/assets/{use-copy-CGJ-16i-.js → use-copy-CPOYPvBF.js} +1 -1
  279. package/dist/client/assets/{use-create-virtual-mcp-D4lB4pbk.js → use-create-virtual-mcp-Da7cL0aL.js} +1 -1
  280. package/dist/client/assets/{use-date-fns-locale-VjB0j61V.js → use-date-fns-locale-BcOQz_O6.js} +1 -1
  281. package/dist/client/assets/{use-debounced-autosave-Du2G3qf3.js → use-debounced-autosave-BnbZSVdn.js} +1 -1
  282. package/dist/client/assets/{use-debounced-value-CG2jgHBI.js → use-debounced-value-DHN-wkc6.js} +1 -1
  283. package/dist/client/assets/{use-deco-credits-DU8sJrax.js → use-deco-credits-Fltfd2iB.js} +1 -1
  284. package/dist/client/assets/{use-decopilot-events-x0K7Zb7m.js → use-decopilot-events-DF_mJ7FX.js} +1 -1
  285. package/dist/client/assets/{use-delete-connection-Pe3fW9Dc.js → use-delete-connection-Di7K1zHS.js} +1 -1
  286. package/dist/client/assets/{use-deployment-admin-CWwZo7oV.js → use-deployment-admin-Ney-Hrk_.js} +1 -1
  287. package/dist/client/assets/{use-entitlements-pN-YIa6T.js → use-entitlements-D6f3xZaU.js} +1 -1
  288. package/dist/client/assets/{use-fast-preview-draft-url-CCQm80wV.js → use-fast-preview-draft-url-B6rIt3gA.js} +1 -1
  289. package/dist/client/assets/{use-file-configs-CzJCjBKX.js → use-file-configs-Cd7oj9Fw.js} +1 -1
  290. package/dist/client/assets/{use-in-settings-DplznXN9.js → use-in-settings-8fsBM1xN.js} +1 -1
  291. package/dist/client/assets/{use-infinite-scroll-Bm905rys.js → use-infinite-scroll-BCiTqxTQ.js} +1 -1
  292. package/dist/client/assets/{use-join-requests-D4wrlTl5.js → use-join-requests-BFN9i-Es.js} +1 -1
  293. package/dist/client/assets/use-main-panel-tabs-Wh3mzXf2.js +1 -0
  294. package/dist/client/assets/{use-mcp-auth-status-BnAPI8Zf.js → use-mcp-auth-status-B1aTfNe_.js} +1 -1
  295. package/dist/client/assets/{use-mcp-client-D2DgMGL-.js → use-mcp-client-CqKNXJW7.js} +1 -1
  296. package/dist/client/assets/{use-mcp-prompts-UNzUvECH.js → use-mcp-prompts-DpED8Vrg.js} +1 -1
  297. package/dist/client/assets/{use-mcp-tools-CtMvHJK9.js → use-mcp-tools-BgkfMsvS.js} +1 -1
  298. package/dist/client/assets/{use-members-C_tB-qI-.js → use-members-CeW4sAKm.js} +1 -1
  299. package/dist/client/assets/{use-mobile-DYpKQ1eP.js → use-mobile-CUQu4L8c.js} +1 -1
  300. package/dist/client/assets/{use-navigate-to-agent-TwlhlbmB.js → use-navigate-to-agent-W6hb3mqs.js} +1 -1
  301. package/dist/client/assets/{use-open-billing-url-BrlDdS6U.js → use-open-billing-url-KLMgEPxW.js} +1 -1
  302. package/dist/client/assets/{use-org-auth-client-BkVvw_9f.js → use-org-auth-client-zTkj17z7.js} +1 -1
  303. package/dist/client/assets/{use-org-fs-Bbl2QQqg.js → use-org-fs-B1IHOZ9S.js} +1 -1
  304. package/dist/client/assets/{use-org-repo-syncs-Ds4sFbSY.js → use-org-repo-syncs-CksqUgv6.js} +1 -1
  305. package/dist/client/assets/{use-org-sso-BnqcEd47.js → use-org-sso-CI1_4UQM.js} +1 -1
  306. package/dist/client/assets/{use-organization-roles-3K_wbMHo.js → use-organization-roles-DeV7SnLa.js} +1 -1
  307. package/dist/client/assets/{use-organization-settings-Wh36EN0I.js → use-organization-settings-4gJ9Tp49.js} +1 -1
  308. package/dist/client/assets/{use-panel-navigate-xYH0iX8e.js → use-panel-navigate-Bg-MVKv6.js} +1 -1
  309. package/dist/client/assets/{use-project-native-view-presence-U59DT0hQ.js → use-project-native-view-presence-C3jxCCXQ.js} +1 -1
  310. package/dist/client/assets/{use-project-scope-CENQvfVc.js → use-project-scope-CRdwBUT7.js} +1 -1
  311. package/dist/client/assets/{use-releases-_xbQ8yPk.js → use-releases-nsAtxjuW.js} +1 -1
  312. package/dist/client/assets/{use-reports-diagnostic-Cz_g9Pum.js → use-reports-diagnostic-CtuJZ5jH.js} +1 -1
  313. package/dist/client/assets/{use-route-default-main-evb2BAGs.js → use-route-default-main-DA5X9xDG.js} +1 -1
  314. package/dist/client/assets/{use-secrets-44zj-3N9.js → use-secrets-BfDHS5Uq.js} +1 -1
  315. package/dist/client/assets/use-section-preview-base-DW4RpMx9.js +1 -0
  316. package/dist/client/assets/{use-session-runtime-COugfsOm.js → use-session-runtime-DiG_Qt8i.js} +1 -1
  317. package/dist/client/assets/{use-tags-BqebMAjW.js → use-tags-BloUFB1L.js} +1 -1
  318. package/dist/client/assets/{use-task-board-analytics-CElip-Jh.js → use-task-board-analytics-C7hgblhm.js} +1 -1
  319. package/dist/client/assets/{use-task-metadata-Dhub_XGT.js → use-task-metadata-ehugU85S.js} +1 -1
  320. package/dist/client/assets/{use-thread-outputs-DldRsY9l.js → use-thread-outputs-C9_GjCjS.js} +1 -1
  321. package/dist/client/assets/{use-virtual-mcp-B-mdsJbn.js → use-virtual-mcp-Vg_Ogz61.js} +1 -1
  322. package/dist/client/assets/useInfiniteQuery-DebjMHv1.js +1 -0
  323. package/dist/client/assets/{useQueries-CrUxqve0.js → useQueries-CDvJYO-m.js} +1 -1
  324. package/dist/client/assets/useSuspenseInfiniteQuery-CqRV1dKR.js +1 -0
  325. package/dist/client/assets/{users-XpLTDG6s.js → users-BC2i5HSG.js} +1 -1
  326. package/dist/client/assets/{utils-BcFrUaDf.js → utils-Bf0RpmgB.js} +1 -1
  327. package/dist/client/assets/variant-calendar-BWeWEpfR.js +1 -0
  328. package/dist/client/assets/{variant-matcher-override-DWffsqol.js → variant-matcher-override-fLxntWss.js} +1 -1
  329. package/dist/client/assets/{view-mode-toggle-Bsk0Q0dk.js → view-mode-toggle-DQkw8yuh.js} +1 -1
  330. package/dist/client/assets/{virtual-mcp-Bj7Y16hO.js → virtual-mcp-S8IoUqby.js} +1 -1
  331. package/dist/client/index.html +2 -2
  332. package/dist/server/cli.js +1 -1
  333. package/dist/server/server.js +1 -1
  334. package/package.json +1 -1
  335. package/dist/client/assets/agent-app-D8aCkILQ.js +0 -1
  336. package/dist/client/assets/agent-deck-JfSkYOo0.js +0 -1
  337. package/dist/client/assets/agent-file-BQkNRXR6.js +0 -1
  338. package/dist/client/assets/agent-library-file-B_9ZfsqS.js +0 -1
  339. package/dist/client/assets/agent-settings-Dlb-w-aW.js +0 -1
  340. package/dist/client/assets/agent-site-editor-code-Cg74frt9.js +0 -2
  341. package/dist/client/assets/agent-site-editor-content-BMF_TO-O.js +0 -2
  342. package/dist/client/assets/agent-site-editor-preview-DfUEy_mW.js +0 -518
  343. package/dist/client/assets/agent-view-9ku1NYkG.js +0 -1
  344. package/dist/client/assets/api-keys-CB0BbOJK.js +0 -1
  345. package/dist/client/assets/app-editor-6ntO4YLY.js +0 -1
  346. package/dist/client/assets/automations-CflFKE1S.js +0 -1
  347. package/dist/client/assets/blocks-preview-workspace-context-CGrONP0s.js +0 -1
  348. package/dist/client/assets/category-editor-CMewSARd.js +0 -1
  349. package/dist/client/assets/combobox-B1IXE26_.js +0 -1
  350. package/dist/client/assets/command-CDaLB2Ox.js +0 -1
  351. package/dist/client/assets/index-xA_kfo6T.css +0 -1
  352. package/dist/client/assets/input-BK5Sp8hZ.js +0 -1
  353. package/dist/client/assets/org-file-open-context-DodrnIMR.js +0 -1
  354. package/dist/client/assets/page-seo-form-Dbz3eu1p.js +0 -1
  355. package/dist/client/assets/post-calendar-FfQIYQQi.js +0 -1
  356. package/dist/client/assets/post-editor-YU4-WfQ7.js +0 -1
  357. package/dist/client/assets/project-reports-DVMPWWFi.js +0 -1
  358. package/dist/client/assets/project-tasks-Jy5UvQy6.js +0 -1
  359. package/dist/client/assets/record-editor-CXOCBCZ1.js +0 -1
  360. package/dist/client/assets/redirect-editor-MDe3fibH.js +0 -1
  361. package/dist/client/assets/reports-DwYY1RWm.js +0 -1
  362. package/dist/client/assets/runnable-block-editor-CdEmnBad.js +0 -16
  363. package/dist/client/assets/sections-editor-C6cdGUNk.js +0 -2
  364. package/dist/client/assets/select-oEHCSTZi.js +0 -1
  365. package/dist/client/assets/seo-editor-BD39YQzP.js +0 -1
  366. package/dist/client/assets/shell-layout-BNVBlKMe.js +0 -1
  367. package/dist/client/assets/tasks-aGbeVyrS.js +0 -1
  368. package/dist/client/assets/textarea-B9cyNs7j.js +0 -1
  369. package/dist/client/assets/use-main-panel-tabs-BcprnHpG.js +0 -1
  370. package/dist/client/assets/use-section-preview-base-BbxztEDH.js +0 -1
  371. package/dist/client/assets/useInfiniteQuery-DCZL7BN4.js +0 -1
  372. package/dist/client/assets/useSuspenseInfiniteQuery-C0KSbZH8.js +0 -1
  373. package/dist/client/assets/variant-calendar-BPWkuyHy.js +0 -1
@@ -1 +1 @@
1
- import{an as o,bM as a,bN as t,ao as e,bO as i,bP as r,cV as p,dA as b,cR as m}from"./index-doEaURqC.js";const h=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:p("object"),properties:i(e(),r()).optional(),required:t(e()).optional()}).catchall(r()),_=b.extend({inputSchema:s,outputSchema:s.optional()}),f=o({headers:i(e(),e()).optional()}),g=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)")}),d=256*1024;function l(n){return i(e(),r()).nullable().refine(c=>c===null||JSON.stringify(c).length<=d,{message:`${n} must serialize to at most ${d} bytes`})}const u=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"),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().describe("Authentication token (for HTTP connections)"),connection_headers:m([g,f]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:h.nullable().describe("OAuth configuration"),configuration_state:l("configuration_state").describe("Configuration state (decrypted)"),configuration_scopes:t(e()).nullable().optional().describe("Configuration scopes"),metadata:l("metadata").describe("Additional metadata (includes repository info)"),tools:t(_).nullable().describe("Discovered tools from MCP"),bindings:t(e()).nullable().describe("Detected bindings"),status:a(["active","inactive","error"]).describe("Current status")});u.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!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()});u.partial();function T(n){return n!=null&&"command"in n}function y(n){return!n||!n.startsWith("virtual://")?null:n.replace("virtual://","")}export{h as O,T as i,y as p};
1
+ import{an as o,bO as a,bP as t,ao as e,bQ as i,bR as r,cX as p,dC as b,cT as m}from"./index-CyBVTyGa.js";const h=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:p("object"),properties:i(e(),r()).optional(),required:t(e()).optional()}).catchall(r()),_=b.extend({inputSchema:s,outputSchema:s.optional()}),f=o({headers:i(e(),e()).optional()}),g=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)")}),d=256*1024;function l(n){return i(e(),r()).nullable().refine(c=>c===null||JSON.stringify(c).length<=d,{message:`${n} must serialize to at most ${d} bytes`})}const u=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"),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().describe("Authentication token (for HTTP connections)"),connection_headers:m([g,f]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:h.nullable().describe("OAuth configuration"),configuration_state:l("configuration_state").describe("Configuration state (decrypted)"),configuration_scopes:t(e()).nullable().optional().describe("Configuration scopes"),metadata:l("metadata").describe("Additional metadata (includes repository info)"),tools:t(_).nullable().describe("Discovered tools from MCP"),bindings:t(e()).nullable().describe("Detected bindings"),status:a(["active","inactive","error"]).describe("Current status")});u.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!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()});u.partial();function T(n){return n!=null&&"command"in n}function y(n){return!n||!n.startsWith("virtual://")?null:n.replace("virtual://","")}export{h as O,T as i,y as p};
@@ -1 +1 @@
1
- import{c as M,a0 as S,a6 as $,K as F,a8 as R,b as K,l as A,j as c,eL as q}from"./index-doEaURqC.js";import{u as O}from"./useInfiniteQuery-DCZL7BN4.js";import{g as D}from"./connection-slug-CITJ0kGN.js";import{I as V}from"./integration-icon-Crk6WRxP.js";function X(t){const e=M.c(21),{org:s}=S(),o=$();let l;e[0]!==t?(l=t?.trim().split(/\s+/).filter(Boolean)??[],e[0]=t,e[1]=l):l=e[1];const r=l;let n;e[2]!==s.id||e[3]!==t?(n=F.storeDiscovery(s.id,`deco-json:${t??""}`),e[2]=s.id,e[3]=t,e[4]=n):n=e[4];let a;e[5]!==o||e[6]!==r?(a=I=>{const{pageParam:L}=I;return o.call("COLLECTION_REGISTRY_APP_LIST",{limit:24,cursor:L,where:r.length?{operator:"or",conditions:r.flatMap(B)}:void 0})},e[5]=o,e[6]=r,e[7]=a):a=e[7];let u;e[8]!==n||e[9]!==a?(u={queryKey:n,queryFn:a,initialPageParam:void 0,getNextPageParam:z,staleTime:3e5,placeholderData:R,throwOnError:!0},e[8]=n,e[9]=a,e[10]=u):u=e[10];const i=O(u);let p;e[11]!==i.data?.pages?(p=i.data?.pages.flatMap(Y)??[],e[11]=i.data?.pages,e[12]=p):p=e[12];const m=p;let f;e[13]!==i?(f=()=>{i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},e[13]=i,e[14]=f):f=e[14];let d;return e[15]!==m||e[16]!==i.hasNextPage||e[17]!==i.isFetchingNextPage||e[18]!==i.isLoading||e[19]!==f?(d={items:m,hasMore:i.hasNextPage,isLoadingMore:i.isFetchingNextPage,isInitialLoading:i.isLoading,loadMore:f},e[15]=m,e[16]=i.hasNextPage,e[17]=i.isFetchingNextPage,e[18]=i.isLoading,e[19]=f,e[20]=d):d=e[20],d}function Y(t){return t.items}function z(t){return t.nextCursor}function B(t){return[["title"],["description"],["id"],["server","name"]].map(e=>({field:e,operator:"contains",value:t}))}function Z(t){const e=new Map;for(const l of t){const r=D(l),n=e.get(r);n?n.push(l):e.set(r,[l])}const s=[],o=new Set;for(const l of t){const r=D(l);if(o.has(r))continue;o.add(r);const n=e.get(r),a=n[0];n.length===1?s.push({type:"single",connection:a}):s.push({type:"group",key:r,icon:a.icon,title:a.app_name?a.title.replace(/\s*\(\d+\)\s*$/,""):a.title,connections:n})}return s}function ee(t){const e=M.c(43),{connection:s,onClick:o,headerActions:l,headerActionsAlwaysVisible:r,footer:n,className:a,fallbackIcon:u,selected:i}=t,p=r===void 0?!1:r,m=K(),f=o&&"cursor-pointer hover:bg-muted/50";let d;e[0]!==a||e[1]!==f?(d=A("transition-colors group overflow-hidden flex flex-col h-full",f,a),e[0]=a,e[1]=f,e[2]=d):d=e[2];const I=o?"button":void 0,L=o?0:void 0,T=o&&i!==void 0?i:void 0;let g;e[3]!==o?(g=o?_=>{_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),o())}:void 0,e[3]=o,e[4]=g):g=e[4];let x;e[5]!==s.icon||e[6]!==s.title||e[7]!==u?(x=c.jsx(V,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:u}),e[5]=s.icon,e[6]=s.title,e[7]=u,e[8]=x):x=e[8];let h;e[9]!==l||e[10]!==p?(h=l&&c.jsx("div",{className:A("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100"),onClick:Q,children:l}),e[9]=l,e[10]=p,e[11]=h):h=e[11];let v;e[12]!==h?(v=c.jsx("div",{className:"relative",children:h}),e[12]=h,e[13]=v):v=e[13];let N;e[14]!==v||e[15]!==x?(N=c.jsxs("div",{className:"flex items-start justify-between",children:[x,v]}),e[14]=v,e[15]=x,e[16]=N):N=e[16];let y;e[17]!==s.title?(y=c.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[17]=s.title,e[18]=y):y=e[18];let P;e[19]!==s.description||e[20]!==m?(P=s.description||m("connections.connectionCard.noDescription"),e[19]=s.description,e[20]=m,e[21]=P):P=e[21];let j;e[22]!==P?(j=c.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:P}),e[22]=P,e[23]=j):j=e[23];let C;e[24]!==y||e[25]!==j?(C=c.jsxs("div",{className:"flex flex-col gap-1",children:[y,j]}),e[24]=y,e[25]=j,e[26]=C):C=e[26];let b;e[27]!==N||e[28]!==C?(b=c.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[N,C]}),e[27]=N,e[28]=C,e[29]=b):b=e[29];let k;e[30]!==n?(k=n&&c.jsx("div",{className:"border-t border-border mt-auto",children:c.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:G,children:n})}),e[30]=n,e[31]=k):k=e[31];let w;e[32]!==b||e[33]!==k?(w=c.jsxs("div",{className:"flex flex-col flex-1",children:[b,k]}),e[32]=b,e[33]=k,e[34]=w):w=e[34];let E;return e[35]!==o||e[36]!==w||e[37]!==d||e[38]!==I||e[39]!==L||e[40]!==T||e[41]!==g?(E=c.jsx(q,{className:d,onClick:o,role:I,tabIndex:L,"aria-pressed":T,onKeyDown:g,children:w}),e[35]=o,e[36]=w,e[37]=d,e[38]=I,e[39]=L,e[40]=T,e[41]=g,e[42]=E):E=e[42],E}function G(t){return t.stopPropagation()}function Q(t){return t.stopPropagation()}export{ee as C,Z as g,X as u};
1
+ import{c as D,a0 as S,a6 as $,K as F,a8 as R,b as K,l as T,j as c,eM as q}from"./index-CyBVTyGa.js";import{u as O}from"./useInfiniteQuery-DebjMHv1.js";import{g as A}from"./connection-slug-CITJ0kGN.js";import{I as V}from"./integration-icon-mTqkOE6y.js";function X(t){const e=D.c(21),{org:s}=S(),o=$();let l;e[0]!==t?(l=t?.trim().split(/\s+/).filter(Boolean)??[],e[0]=t,e[1]=l):l=e[1];const r=l;let n;e[2]!==s.id||e[3]!==t?(n=F.storeDiscovery(s.id,`deco-json:${t??""}`),e[2]=s.id,e[3]=t,e[4]=n):n=e[4];let a;e[5]!==o||e[6]!==r?(a=I=>{const{pageParam:_}=I;return o.call("COLLECTION_REGISTRY_APP_LIST",{limit:24,cursor:_,where:r.length?{operator:"or",conditions:r.flatMap(B)}:void 0})},e[5]=o,e[6]=r,e[7]=a):a=e[7];let u;e[8]!==n||e[9]!==a?(u={queryKey:n,queryFn:a,initialPageParam:void 0,getNextPageParam:z,staleTime:3e5,placeholderData:R,throwOnError:!0},e[8]=n,e[9]=a,e[10]=u):u=e[10];const i=O(u);let p;e[11]!==i.data?.pages?(p=i.data?.pages.flatMap(Y)??[],e[11]=i.data?.pages,e[12]=p):p=e[12];const m=p;let f;e[13]!==i?(f=()=>{i.hasNextPage&&!i.isFetchingNextPage&&i.fetchNextPage()},e[13]=i,e[14]=f):f=e[14];let d;return e[15]!==m||e[16]!==i.hasNextPage||e[17]!==i.isFetchingNextPage||e[18]!==i.isLoading||e[19]!==f?(d={items:m,hasMore:i.hasNextPage,isLoadingMore:i.isFetchingNextPage,isInitialLoading:i.isLoading,loadMore:f},e[15]=m,e[16]=i.hasNextPage,e[17]=i.isFetchingNextPage,e[18]=i.isLoading,e[19]=f,e[20]=d):d=e[20],d}function Y(t){return t.items}function z(t){return t.nextCursor}function B(t){return[["title"],["description"],["id"],["server","name"]].map(e=>({field:e,operator:"contains",value:t}))}function Z(t){const e=new Map;for(const l of t){const r=A(l),n=e.get(r);n?n.push(l):e.set(r,[l])}const s=[],o=new Set;for(const l of t){const r=A(l);if(o.has(r))continue;o.add(r);const n=e.get(r),a=n[0];n.length===1?s.push({type:"single",connection:a}):s.push({type:"group",key:r,icon:a.icon,title:a.app_name?a.title.replace(/\s*\(\d+\)\s*$/,""):a.title,connections:n})}return s}function ee(t){const e=D.c(43),{connection:s,onClick:o,headerActions:l,headerActionsAlwaysVisible:r,footer:n,className:a,fallbackIcon:u,selected:i}=t,p=r===void 0?!1:r,m=K(),f=o&&"cursor-pointer hover:bg-muted/50";let d;e[0]!==a||e[1]!==f?(d=T("transition-colors group overflow-hidden flex flex-col h-full",f,a),e[0]=a,e[1]=f,e[2]=d):d=e[2];const I=o?"button":void 0,_=o?0:void 0,M=o&&i!==void 0?i:void 0;let g;e[3]!==o?(g=o?L=>{L.target===L.currentTarget&&(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),o())}:void 0,e[3]=o,e[4]=g):g=e[4];let x;e[5]!==s.icon||e[6]!==s.title||e[7]!==u?(x=c.jsx(V,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:u}),e[5]=s.icon,e[6]=s.title,e[7]=u,e[8]=x):x=e[8];let h;e[9]!==l||e[10]!==p?(h=l&&c.jsx("div",{className:T("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100"),onClick:Q,children:l}),e[9]=l,e[10]=p,e[11]=h):h=e[11];let v;e[12]!==h?(v=c.jsx("div",{className:"relative",children:h}),e[12]=h,e[13]=v):v=e[13];let N;e[14]!==v||e[15]!==x?(N=c.jsxs("div",{className:"flex items-start justify-between",children:[x,v]}),e[14]=v,e[15]=x,e[16]=N):N=e[16];let y;e[17]!==s.title?(y=c.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title}),e[17]=s.title,e[18]=y):y=e[18];let P;e[19]!==s.description||e[20]!==m?(P=s.description||m("connections.connectionCard.noDescription"),e[19]=s.description,e[20]=m,e[21]=P):P=e[21];let j;e[22]!==P?(j=c.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:P}),e[22]=P,e[23]=j):j=e[23];let C;e[24]!==y||e[25]!==j?(C=c.jsxs("div",{className:"flex flex-col gap-1",children:[y,j]}),e[24]=y,e[25]=j,e[26]=C):C=e[26];let b;e[27]!==N||e[28]!==C?(b=c.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[N,C]}),e[27]=N,e[28]=C,e[29]=b):b=e[29];let k;e[30]!==n?(k=n&&c.jsx("div",{className:"border-t border-border mt-auto",children:c.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:G,children:n})}),e[30]=n,e[31]=k):k=e[31];let w;e[32]!==b||e[33]!==k?(w=c.jsxs("div",{className:"flex flex-col flex-1",children:[b,k]}),e[32]=b,e[33]=k,e[34]=w):w=e[34];let E;return e[35]!==o||e[36]!==w||e[37]!==d||e[38]!==I||e[39]!==_||e[40]!==M||e[41]!==g?(E=c.jsx(q,{className:d,onClick:o,role:I,tabIndex:_,"aria-pressed":M,onKeyDown:g,children:w}),e[35]=o,e[36]=w,e[37]=d,e[38]=I,e[39]=_,e[40]=M,e[41]=g,e[42]=E):E=e[42],E}function G(t){return t.stopPropagation()}function Q(t){return t.stopPropagation()}export{ee as C,Z as g,X as u};
@@ -1 +1 @@
1
- import{an as ve,bO as Oe,bP as Me,ao as de,bN as ze,c as U,b as F,j as t,h as Ne,B,r as Z,l as Se,a0 as te,a6 as Ee,D as me,K as ee,d as se,p as ye,am as Ce,eL as Re,Z as Ue,n as Le,f5 as ue,Y as Fe,I as Ve,F as Be,H as qe,G as xe,E as Ge,f as He,fe as Ke,o as Qe,aq as Xe,ap as We,t as J}from"./index-doEaURqC.js";import{g as Ye}from"./extract-connection-data-BIqslos8.js";import{E as _e}from"./empty-state-ClBiZqLf.js";import{E as Je,c as Ze,r as et,b as tt,d as st}from"./connection-form-helpers-CyBATU5Y.js";import{c as nt,S as it,D as ot}from"./index-Doi07Y6T.js";import{u as we,T as at}from"./use-mcp-auth-status-BnAPI8Zf.js";import{a as lt}from"./use-members-C_tB-qI-.js";import{A as rt}from"./avatar-CLf3yQhN.js";import{a as Ie,b as ke,u as ct}from"./use-connection-PgTQPnAp.js";import{u as Te}from"./use-mcp-client-D2DgMGL-.js";import{u as dt}from"./use-mcp-tools-CtMvHJK9.js";import{a as mt}from"./use-mcp-prompts-UNzUvECH.js";import{i as ut,a as xt}from"./mcp-oauth-61IHYJoj.js";import{I as ae}from"./integration-icon-Crk6WRxP.js";import{s as pt}from"./Plus-qASEo4cN.js";import{b4 as ft,ai as ht,L as gt,bi as jt,j as ne,ah as bt}from"./agent-icon-CzsnrYjD.js";import{a as Ae,f as vt,s as Nt}from"./Tool01-H9OcfGdq.js";import{s as re}from"./Trash01-mB4s-hrv.js";import{b as St,a as yt,c as Ct,S as _t,d as wt}from"./sheet-ZoEgH6s-.js";import{F as G,b as H,c as K,d as V,f as Q,e as It,a as kt}from"./form-CXSt7_li.js";import{I as W}from"./input-BK5Sp8hZ.js";import{u as Tt,D as At}from"./use-delete-connection-Pe3fW9Dc.js";import{c as Pt,B as Dt,a as $t,C as Ot}from"./monitoring-stats-row-CTbrFT2U.js";import{b as Mt,c as zt,d as Et}from"./chart-CdmZzz30.js";import{b as Rt}from"./use-virtual-mcp-B-mdsJbn.js";import{T as ie,a as Ut,c as oe,b as Lt}from"./tabs-Gq0qvZI4.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{g as ce}from"./types-BCbJ4Eml.js";import{M as Ft}from"./mcp-app-renderer-BvLPqeD1.js";import{C as Vt}from"./collection-search-BQXOJg8a.js";import{B as Bt}from"./badge-DuB4cqrw.js";import{S as pe,b as fe,a as he,d as ge,c as q}from"./select-oEHCSTZi.js";import{i as qt}from"./CheckCircle-Cj4PQGuv.js";import{t as Gt}from"./ChevronUp-DGt31MPD.js";import{a as Ht}from"./UserSquare-BfT6tB5U.js";import{s as Kt}from"./XClose-DFUqDOc8.js";import{p as Qt,i as Xt}from"./connection-DzM2SOZ6.js";import"./metadata-D72DunRR.js";import"./sidebar-Cz1S2PSM.js";import"./LayoutLeft-GBQ0rQxQ.js";import"./use-mobile-DYpKQ1eP.js";import"./tooltip-C91IS2ON.js";import"./index-C4LzZ3-O.js";import"./Key01-SGIR_QrT.js";import"./auth-D3Q2r2cz.js";import"./index-BoSUEB27.js";import"./index-DV9UJZA2.js";import"./index-BODjkOG4.js";import"./index-Byz-UaqT.js";import"./popover-GUR8piky.js";import"./Check-BZXRTDaX.js";import"./SearchMd-B6NDUgzQ.js";import"./use-create-virtual-mcp-D4lB4pbk.js";import"./use-navigate-to-agent-TwlhlbmB.js";import"./hooks-C8t7cMQJ.js";import"./backoff-8mStPHYB.js";import"./task-board-BXLBBo-B.js";import"./schema-BVqtjcyJ.js";import"./thread-intent-DuCE7MYG.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BknN0SVI.js";import"./Eye-rQUtSbk6.js";import"./use-org-auth-client-BkVvw_9f.js";import"./User01-DHGCVvV3.js";import"./AlertCircle-Cat-Fy2i.js";import"./ArrowUp-CbPBDOpZ.js";import"./ArrowLeft-DuxVUo5_.js";import"./ArrowRight-CsoDgnUj.js";import"./XCircle-Cu2Sy8Aw.js";import"./ZoomOut-Burao8Eg.js";import"./Globe04-C_9DD9oO.js";import"./Copy01-B6hr4CBg.js";import"./CreditCard01-CiYLi_pR.js";import"./DotsVertical-BITRq5d-.js";import"./Download01-CsYfHghd.js";import"./Share07-CMPYQYHk.js";import"./Image01-BLIf6uY9.js";import"./Link01-BnVQGp2l.js";import"./LinkExternal01-Dh0AABP8.js";import"./Monitor01-CxisI5ut.js";import"./Sun-BSFyLDhg.js";import"./Package-DsU1cU6S.js";import"./Palette-CzoNEzRs.js";import"./SearchLg-qmi8uaeX.js";import"./Stars01-cdnol_cb.js";import"./Upload01-Uv_jtHIk.js";import"./Users01-C_qUmfZB.js";import"./X-vKTIsgL1.js";import"./Zap-CSRFlEXK.js";import"./label-tAsQMZ2G.js";import"./alert-dialog-Dg6YJ6PP.js";import"./CartesianChart-DgQehil3.js";import"./AreaChart-CSNer7sZ.js";import"./ErrorBarContext-zVAOL4kJ.js";import"./Sector-DK9KwpRN.js";const Wt=ve({scopes:ze(de()).describe("List of scopes available"),stateSchema:Oe(de(),Me()).describe("JSON Schema (draft-07) defining the state structure")}),Yt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Wt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=F();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),m=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,p=n.status!=="active",x=m||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==x?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",x),e[2]=x,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let j;e[7]!==n.title?(j=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let S;e[9]!==n.status||e[10]!==p||e[11]!==m||e[12]!==o?(S=m?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=p,e[11]=m,e[12]=o,e[13]=S):S=e[13];let y;e[14]!==j||e[15]!==S?(y=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,S]}),e[14]=j,e[15]=S,e[16]=y):y=e[16];let C;e[17]!==n||e[18]!==m||e[19]!==a||e[20]!==o?(C=m&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=m,e[19]=a,e[20]=o,e[21]=C):C=e[21];let _;e[22]!==n||e[23]!==p||e[24]!==l||e[25]!==o?(_=p?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(ft,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(ht,{size:13})}),e[22]=n,e[23]=p,e[24]=l,e[25]=o,e[26]=_):_=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let w;e[30]!==o?(w=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=w):w=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Ae,{size:13}),e[34]=A):A=e[34];let O;e[35]!==$||e[36]!==w||e[37]!==M?(O=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:w,"aria-label":M,children:A}),e[35]=$,e[36]=w,e[37]=M,e[38]=O):O=e[38];let k;e[39]!==n||e[40]!==i?(k=()=>i(n),e[39]=n,e[40]=i,e[41]=k):k=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let b;e[44]!==o?(b=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(re,{size:13}),e[46]=E):E=e[46];let z;e[47]!==k||e[48]!==v||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:k,title:v,"aria-label":b,children:E}),e[47]=k,e[48]=v,e[49]=b,e[50]=z):z=e[50];let I;e[51]!==O||e[52]!==z||e[53]!==C||e[54]!==_?(I=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[C,_,O,z]}),e[51]=O,e[52]=z,e[53]=C,e[54]=_,e[55]=I):I=e[55];let P;return e[56]!==I||e[57]!==h||e[58]!==g||e[59]!==y?(P=t.jsxs("div",{className:h,children:[g,y,I]}),e[56]=I,e[57]=h,e[58]=g,e[59]=y,e[60]=P):P=e[60],P}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,a=F();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let d;e[10]!==a?(d=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ae,{size:13}),e[12]=u):u=e[12];let m;e[13]!==o||e[14]!==r||e[15]!==d?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":d,children:u})}),e[13]=o,e[14]=r,e[15]=d,e[16]=m):m=e[16];let p;return e[17]!==i||e[18]!==l||e[19]!==m?(p=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,m]}),e[17]=i,e[18]=l,e[19]=m,e[20]=p):p=e[20],p}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,d=F();if(n.length===0)return null;let u;e[0]!==n.length||e[1]!==d?(u=n.length===1?d("details.connectionInstancesPanel.instance"):d("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=d,e[2]=u):u=e[2];let m;e[3]!==u?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(pt,{size:13}),e[5]=r,e[6]=p):p=e[6];let x;e[7]!==d?(x=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=x):x=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==p||e[12]!==x?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[p,x]}),e[9]=r,e[10]=o,e[11]=p,e[12]=x,e[13]=h):h=e[13];let g;e[14]!==m||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[m,h]}),e[14]=m,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let C;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(C=_=>t.jsx(Z.Suspense,{fallback:t.jsx(Zt,{instance:_,onConfigure:c}),children:t.jsx(Jt,{instance:_,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},_.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=C):C=e[27],j=n.map(C),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let S;e[28]!==j?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=S):S=e[29];let y;return e[30]!==g||e[31]!==S?(y=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=y):y=e[32],y}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const 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:a}=s,i=F(),l=Ee(),o=ns(a),{data:r}=me({queryKey:ee.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=Pt(r?.logs??[],o,void 0,r?.total,d?.total),m=u.data,p=u.totalCalls>0,x=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")})]})]}),p?t.jsxs("div",{children:[t.jsx(Mt,{config:is,className:"h-16 w-full",children:t.jsxs(Dt,{data:m,barCategoryGap:"4%",children:[t.jsx(zt,{content:t.jsx(Et,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:m.map(ls)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[m.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),x.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:x.map(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=F(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==a?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":a===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium classic:rounded-md compact:rounded-lg transition-colors",a===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=a,e[7]=u):u=e[7];let m;e[8]!==d||e[9]!==u?(m=t.jsx("div",{role:"group","aria-label":d,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:u}),e[8]=d,e[9]=u,e[10]=m):m=e[10];let p;e[11]!==r||e[12]!==m?(p=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,m]}),e[11]=r,e[12]=m,e[13]=p):p=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(cs,{}),e[14]=x):x=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==a?(h=t.jsx(Z.Suspense,{fallback:x,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:a})}),e[15]=n,e[16]=l.id,e[17]=a,e[18]=h):h=e[18];let g;return e[19]!==p||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[p,h]}),e[19]=p,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const m=crypto.randomUUID();a({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:m}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==o||e[13]!==r?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,d]}),e[11]=i,e[12]=o,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(ms,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=F(),{org:a}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=Rt(i);if(!(l.length>0)){let p;return e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(t.Fragment,{}),e[2]=p):p=e[2],p}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==r?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r})}),e[5]=r,e[6]=d):d=e[6];let u;e[7]!==a.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:a.slug})}),e[7]=a.slug,e[8]=l,e[9]=u):u=e[9];let m;return e[10]!==d||e[11]!==u?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=m):m=e[12],m}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:a}=s,i=F(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const d=Te(r),u=Ie(c);let m;e[4]!==u||e[5]!==c?(m=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=m):m=e[6];const p=m,[x,h]=Z.useState("");let g,j,S,y;if(e[7]!==p||e[8]!==d||e[9]!==l||e[10]!==a||e[11]!==x||e[12]!==i||e[13]!==n){const $=(n??[]).filter(fs),w=x.toLowerCase().trim(),M=w?$.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):$;let A;e[18]!==p||e[19]!==l||e[20]!==a?(A=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=p,e[19]=l,e[20]=a,e[21]=A):A=e[21];const O=A;S="flex flex-col h-full overflow-hidden";let k;e[22]!==i?(k=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=k):k=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=v):v=e[24],e[25]!==x||e[26]!==k?(y=t.jsx(Vt,{value:x,onChange:h,placeholder:k,onKeyDown:v}),e[25]=x,e[26]=k,e[27]=y):y=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(_e,{image:null,title:i(x?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(x?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>O(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Ft,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.annotations?.title??b.name}),t.jsx(at,{annotations:b.annotations,_meta:b._meta})]}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b.description})]})]},b.name)})}),e[7]=p,e[8]=d,e[9]=l,e[10]=a,e[11]=x,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=S,e[17]=y}else g=e[14],j=e[15],S=e[16],y=e[17];let C;e[28]!==g||e[29]!==j?(C=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=C):C=e[30];let _;return e[31]!==S||e[32]!==y||e[33]!==C?(_=t.jsxs("div",{className:S,children:[y,C]}),e[31]=S,e[32]=y,e[33]=C,e[34]=_):_=e[34],_}function fs(s){return!!ce(s._meta)}const je=[];function De(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=F();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s,o=c===void 0?je:c,r=a===void 0?je:a,d=F(),u=se(),m=Ie(i??"");let p;e[0]!==m||e[1]!==i?(p=m?Pe(m):i,e[0]=m,e[1]=i,e[2]=p):p=e[2];const x=p;let h;e[3]!==x||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(T){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:x,collectionName:"tools",itemId:encodeURIComponent(T)}})},e[3]=x,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(bs),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const S=j;if(n.length+o.length+r.length===0){let N;e[12]!==d?(N=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=N):N=e[13];let T;e[14]!==N?(T=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:N}),e[14]=N,e[15]=T):T=e[15];let D;e[16]!==d?(D=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=D):D=e[17];let L;e[18]!==D?(L=t.jsx("p",{className:"text-sm text-muted-foreground",children:D}),e[18]=D,e[19]=L):L=e[19];let X;return e[20]!==T||e[21]!==L?(X=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[T,L]}),e[20]=T,e[21]=L,e[22]=X):X=e[22],X}let C;e[23]!==d||e[24]!==n.length?(C=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=C):C=e[25];let _;e[26]!==C?(_=t.jsx(ie,{value:"tools",variant:"underline",children:C}),e[26]=C,e[27]=_):_=e[27];let $;e[28]!==S||e[29]!==d?($=S&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=S,e[29]=d,e[30]=$):$=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let M;e[33]!==w?(M=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=M):M=e[34];let A;e[35]!==d?(A=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=A):A=e[36];let O;e[37]!==A?(O=t.jsx(ie,{value:"resources",variant:"underline",children:A}),e[37]=A,e[38]=O):O=e[38];let k;e[39]!==M||e[40]!==O||e[41]!==_||e[42]!==$?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Ut,{variant:"underline",className:"gap-1",children:[_,$,M,O]})}),e[39]=M,e[40]=O,e[41]=_,e[42]=$,e[43]=k):k=e[43];let v;e[44]!==g||e[45]!==n?(v=n.length>0?n.map(N=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>g(N.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(vt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},N.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=v):v=e[46];let b;e[47]!==v?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:v})}),e[47]=v,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==S||e[51]!==l||e[52]!==n?(E=S&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ps,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=S,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==o?(z=o.length>0?o.map(js):t.jsx(le,{label:"prompts"}),e[54]=o,e[55]=z):z=e[55];let I;e[56]!==z?(I=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=I):I=e[57];let P;e[58]!==r?(P=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=P):P=e[59];let R;e[60]!==P?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:P})}),e[60]=P,e[61]=R):R=e[61];let f;return e[62]!==k||e[63]!==b||e[64]!==E||e[65]!==I||e[66]!==R?(f=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Lt,{defaultValue:"tools",variant:"underline",children:[k,b,E,I,R]})}),e[62]=k,e[63]=b,e[64]=E,e[65]=I,e[66]=R,e[67]=f):f=e[67],f}function 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(jt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children: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(gt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function bs(s){return ce(s._meta)}function vs(s){const e=U.c(15),{connection:n,displayTitle:c}=s,a=Ue(),i=c??n.title,l=a?"md":"xl";let o;e[0]!==n.icon||e[1]!==l||e[2]!==i?(o=t.jsx(ae,{icon:n.icon,name:i,size:l,className:"shrink-0"}),e[0]=n.icon,e[1]=l,e[2]=i,e[3]=o):o=e[3];let r;e[4]!==a||e[5]!==i?(r=a?t.jsx(Le.Title,{children:i}):t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:i})}),e[4]=a,e[5]=i,e[6]=r):r=e[6];let d;e[7]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[7]=n.description,e[8]=d):d=e[8];let u;e[9]!==r||e[10]!==d?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[r,d]}),e[9]=r,e[10]=d,e[11]=u):u=e[11];let m;return e[12]!==o||e[13]!==u?(m=t.jsxs("div",{className:"flex items-center classic:gap-4 classic:md:gap-6 classic:py-5 classic:md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0 compact:gap-3 compact:py-4",children:[o,u]}),e[12]=o,e[13]=u,e[14]=m):m=e[14],m}function Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=F(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Fe(),d=(()=>{if(typeof o!="string"||!o)return!1;try{const x=new URL(o);return x.hostname==="api.githubcopilot.com"&&x.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",m=e.connection_type==="VIRTUAL",p=m?Qt(e.connection_url):null;return m?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(ye,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(V,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(q,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(q,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(q,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(q,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(G,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(V,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(q,{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(q,{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(q,{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(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(bt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(Q,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(Q,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(V,{children:t.jsx(Je,{value:x.value??[],onChange:x.onChange})}),t.jsx(Q,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ve,{children:[t.jsx(Be,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Bt,{variant:"success",className:"gap-1.5",children:[t.jsx(qt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Gt,{size:12})]})})}),t.jsxs(qe,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(Nt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&x.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>x.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 classic:rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity compact:rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Kt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(W,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(It,{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(Q,{})]})})]})}function Ss(s){return s.command==="npx"}function ys(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Cs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function be(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Xt(s.connection_headers)){const c=s.connection_headers,a=et(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:a}}const i=Cs(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function _s(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=tt(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=st(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=F(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Qe(),m=ke(),{org:p}=te(),x=Tt({onSuccess:()=>{o.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[j,S]=Z.useState(!1),y=we({connectionId:e}),{data:C}=lt(),_=C?.data?.members??[],$=h??s,w=_.find(f=>f.userId===$.created_by),A=s?.connection_type==="VIRTUAL"||y.isAuthenticated,O={...s,tools:a},k=nt(O,Yt),v=Xe({resolver:We(Ze),values:be(h??s)}),b=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const N=v.getValues(),T=_s(N),D=h?.id??e;await m.update.mutateAsync({id:D,data:T}),v.reset(N)},z=()=>{v.reset(be(h??s))},I=async f=>{const N=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:T,tokenInfo:D,error:L}=await xt({connectionId:f,orgSlug:p.slug,...N?{scope:N}:{}});if(L||!T){J.error(r("details.connection.authFailed",{error:L??""}));return}if(D)try{const Y=await fetch(`/api/${p.slug}/connections/${f}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!Y.ok)console.error("Failed to save OAuth token:",await Y.text()),await m.update.mutateAsync({id:f,data:{connection_token:T}});else try{await m.update.mutateAsync({id:f,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Y){console.error("Error saving OAuth token:",Y),await m.update.mutateAsync({id:f,data:{connection_token:T}})}else await m.update.mutateAsync({id:f,data:{connection_token:T}});const X=new URL(`/api/${p.slug}/mcp/${f}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(X.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},P=()=>I(s.id),R=async()=>{try{const f=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!f.ok){const T=await f.text();J.error(r("details.connection.failedRemoveOAuth",{error:T}));return}const N=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(N.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(f){console.error("Error removing OAuth token:",f),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(At,{...x}),t.jsx(St,{open:h!==null,onOpenChange:f=>{f||g(null)},children:t.jsxs(yt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Ct,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(_t,{className:"text-base",children:h?.title??s.title}),t.jsx(wt,{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(rt,{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(kt,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(G,{control:v.control,name:"title",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(V,{children:t.jsx(W,{...f})}),t.jsx(Q,{})]})}),t.jsx(G,{control:v.control,name:"description",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(V,{children:t.jsx(W,{...f,value:f.value||""})}),t.jsx(Q,{})]})})]}),t.jsx(Ns,{form:v,connection:h??s,hasOAuthToken:y.hasOAuthToken,onReauthenticate:P,onRemoveOAuth:R}),t.jsx(it,{connection:h??s,form:v,hasMcpBinding:k,isMCPAuthenticated:A,supportsOAuth:y.supportsOAuth,isServerError:y.isServerError,onAuthenticate:P,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const f=h??s;g(null),x.requestDelete(f)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(ot,{hideTopbar:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(vs,{connection:s,displayTitle:(()=>{const f=o[0]??s;return f.app_name?f.title.replace(/\s*\(\d+\)\s*$/,""):f.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ds,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(es,{instances:o,onConfigure:f=>g(f),onAuthenticate:f=>I(f.id),onDelete:f=>x.requestDelete(f),onToggleStatus:async(f,N)=>{try{await m.update.mutateAsync({id:f.id,data:{status:N}}),J.success(r(N==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{S(!0);try{const f=o[0]??s,N=f.title.replace(/\s*\(\d+\)\s*$/,""),T=o.length+1,D=`${N} (${T})`,L=Ye("conn");await m.create.mutateAsync({id:L,title:D,description:f.description??null,connection_type:f.connection_type,connection_url:f.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:f.created_by,organization_id:f.organization_id,icon:f.icon??null,app_name:f.app_name??null,app_id:f.app_id??null,connection_headers:f.connection_headers??null,oauth_config:null,configuration_state:f.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const X=new URL(`/api/${p.slug}/mcp/${L}`,window.location.origin),Y=await ut({url:X.href,token:null,orgId:p.id});Y.supportsOAuth&&!Y.isAuthenticated&&await I(L)}finally{S(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function Is(){const s=U.c(52),e=F();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=He(a),{org:o}=te(),r=ke();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=ct(d),m=u[0]??null,p=m?.id??"",x=p||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==x?(h={connectionId:x,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=x,s[7]=h):h=s[7];const g=Te(h);let j;s[8]!==g?(j={client:g},s[8]=g,s[9]=j):j=s[9];const{data:S}=dt(j);let y;if(s[10]!==m?.tools||s[11]!==p||s[12]!==u||s[13]!==S){const I=S?S.tools.map($s):(m?.tools??[]).map(Ds);e:{if(u.length<=1){y=I;break e}const P=new Set,R=[],f=As;for(const N of u){const T=N.id===p?I:f(N.tools);for(const D of T)P.has(D.name)||(P.add(D.name),R.push(D))}y=R.length>0?R:I}s[10]=m?.tools,s[11]=p,s[12]=u,s[13]=S,s[14]=y}else y=s[14];const C=y;let _;s[15]!==g?(_={client:g},s[15]=g,s[16]=_):_=s[16];const{data:$}=mt(_);let w;s[17]!==g?(w={client:g},s[17]=g,s[18]=w):w=s[18];const{data:M}=Ke(w);let A;s[19]!==$?.prompts?(A=$?.prompts??[],s[19]=$?.prompts,s[20]=A):A=s[20];let O;s[21]!==A?(O=A.map(Ts),s[21]=A,s[22]=O):O=s[22];const k=O;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let b;s[25]!==v?(b=v.map(ks),s[25]=v,s[26]=b):b=s[26];const E=b;if(!m){let I;s[27]!==e?(I=e("details.connection.notFoundTitle"),s[27]=e,s[28]=I):I=s[28];let P;s[29]!==e?(P=e("details.connection.notFoundDescription"),s[29]=e,s[30]=P):P=s[30];let R;s[31]!==c||s[32]!==l?(R=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=R):R=s[33];let f;s[34]!==e?(f=e("details.connection.backButton"),s[34]=e,s[35]=f):f=s[35];let N;s[36]!==R||s[37]!==f?(N=t.jsx(B,{variant:"outline",onClick:R,children:f}),s[36]=R,s[37]=f,s[38]=N):N=s[38];let T;return s[39]!==I||s[40]!==P||s[41]!==N?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(_e,{title:I,description:P,actions:N})}),s[39]=I,s[40]=P,s[41]=N,s[42]=T):T=s[42],T}let z;return s[43]!==r.update.isPending||s[44]!==C||s[45]!==m||s[46]!==p||s[47]!==l||s[48]!==k||s[49]!==E||s[50]!==u?(z=t.jsx(ws,{org:l,connection:m,connectionId:p,isUpdating:r.update.isPending,tools:C,prompts:k,resources:E,siblings:u}),s[43]=r.update.isPending,s[44]=C,s[45]=m,s[46]=p,s[47]=l,s[48]=k,s[49]=E,s[50]=u,s[51]=z):z=s[51],z}function 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(Ge,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Is,{})})}),s[0]=e):e=s[0],e}function yi(){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{yi as default};
1
+ import{an as ve,bQ as Oe,bR as Me,ao as de,bP as ze,c as U,b as L,j as t,h as Ne,B,r as Z,l as Se,a0 as te,a6 as Ee,D as me,K as ee,d as se,p as ye,am as Ce,eM as Re,Z as Ue,n as Fe,f6 as ue,Y as Le,I as Ve,F as Be,H as qe,G as xe,E as Ge,f as He,ff as Ke,o as Qe,aq as Xe,ap as We,t as J}from"./index-CyBVTyGa.js";import{g as Ye}from"./extract-connection-data-BimwPioU.js";import{E as _e}from"./empty-state-BpI78UAU.js";import{E as Je,c as Ze,r as et,b as tt,d as st}from"./connection-form-helpers-D5P5OxyV.js";import{c as nt,S as it,D as ot}from"./index-C0e8Nw2i.js";import{u as we,T as at}from"./use-mcp-auth-status-B1aTfNe_.js";import{a as lt}from"./use-members-CeW4sAKm.js";import{A as rt}from"./avatar-GIuLZx2C.js";import{a as ke,b as Ie,u as ct}from"./use-connection-WQuJ5yl_.js";import{u as Te}from"./use-mcp-client-CqKNXJW7.js";import{u as dt}from"./use-mcp-tools-BgkfMsvS.js";import{a as mt}from"./use-mcp-prompts-DpED8Vrg.js";import{i as ut,a as xt}from"./mcp-oauth-DdNMjTqu.js";import{I as ae}from"./integration-icon-mTqkOE6y.js";import{s as pt}from"./Plus-BbELO07z.js";import{b6 as ft,ak as ht,L as gt,bk as jt,j as ne,aj as bt}from"./agent-icon-CSebdE0g.js";import{a as Ae,f as vt,s as Nt}from"./Tool01-BvNT4KDI.js";import{s as re}from"./Trash01-BLoRPhD3.js";import{b as St,a as yt,c as Ct,S as _t,d as wt}from"./sheet-DH_REC9j.js";import{F as G,b as H,c as K,d as V,f as Q,e as kt,a as It}from"./form-Bx8qGby0.js";import{I as W}from"./input-D5Zi_pUc.js";import{u as Tt,D as At}from"./use-delete-connection-Di7K1zHS.js";import{c as Pt,B as Dt,a as $t,C as Ot}from"./monitoring-stats-row-D_bvL4CA.js";import{b as Mt,c as zt,d as Et}from"./chart-CdPsiu6K.js";import{b as Rt}from"./use-virtual-mcp-Vg_Ogz61.js";import{T as ie,a as Ut,c as oe,b as Ft}from"./tabs-D6s_HA-y.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{g as ce}from"./types-Bxr6Ak0g.js";import{M as Lt}from"./mcp-app-renderer-DBdofBbE.js";import{C as Vt}from"./collection-search-DyuqjLWs.js";import{B as Bt}from"./badge-DS3KIYvS.js";import{S as pe,b as fe,a as he,d as ge,c as q}from"./select-CDhEibGy.js";import{i as qt}from"./CheckCircle-DtMp-qqq.js";import{t as Gt}from"./ChevronUp-B6mY-MC1.js";import{a as Ht}from"./UserSquare-CZakdYWe.js";import{s as Kt}from"./XClose-D_JLFZFT.js";import{p as Qt,i as Xt}from"./connection-DR9gf0au.js";import"./metadata-D72DunRR.js";import"./sidebar-CxoDmdm4.js";import"./LayoutLeft-U0F-Da_p.js";import"./use-mobile-CUQu4L8c.js";import"./tooltip-BjUMPvkB.js";import"./index-DtBnPwzh.js";import"./Key01-BCuGindq.js";import"./auth-B-OXMWGw.js";import"./index-DeVdNW-7.js";import"./index-CzuzrcF3.js";import"./index-DmsjOEhK.js";import"./index-CR8U3UFH.js";import"./popover-CUdTfYte.js";import"./Check-DL_AGZMy.js";import"./SearchMd-B1Foybfh.js";import"./use-create-virtual-mcp-Da7cL0aL.js";import"./use-navigate-to-agent-W6hb3mqs.js";import"./hooks-lZSCdRwc.js";import"./backoff-8mStPHYB.js";import"./task-board-Qj-6Ctqf.js";import"./schema-DSsDEA1v.js";import"./thread-intent-jq9HKW3p.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BknN0SVI.js";import"./Eye-B5e-ilzV.js";import"./use-org-auth-client-zTkj17z7.js";import"./User01-U5CIC-GP.js";import"./AlertCircle-CVkVxygv.js";import"./ArrowUp-bOLRJZuX.js";import"./ArrowLeft-CN6aZBvX.js";import"./ArrowRight-FqJnNh3f.js";import"./XCircle-BuDwhQqF.js";import"./ZoomOut-q6Y0RhlM.js";import"./Globe04-_nV993le.js";import"./Copy01-6lOOhJcp.js";import"./CreditCard01-DdYfDHIS.js";import"./DotsVertical-CAjUqtRp.js";import"./Download01-Dq8Pn8XY.js";import"./Share07-B2WnpDWD.js";import"./Image01-CkJtDP-I.js";import"./Link01-BjTxU_bP.js";import"./LinkExternal01-DSUCZUJp.js";import"./Monitor01-r707obGd.js";import"./Sun-BKxdX8hu.js";import"./Package-D2jMN__x.js";import"./Palette-DebiHmrq.js";import"./SearchLg-C9MObDBB.js";import"./Stars01-DUL2jKUJ.js";import"./Upload01-CNb1qfRO.js";import"./Users01-C6BprSkC.js";import"./X-BNszojyh.js";import"./Zap-BCwjglMw.js";import"./label-DVhvlWqs.js";import"./alert-dialog-DeRt3vSN.js";import"./CartesianChart-C3Zko_Et.js";import"./AreaChart-lVePxdbV.js";import"./ErrorBarContext-B26KvZ3G.js";import"./Sector-OiAocllE.js";const Wt=ve({scopes:ze(de()).describe("List of scopes available"),stateSchema:Oe(de(),Me()).describe("JSON Schema (draft-07) defining the state structure")}),Yt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Wt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=L();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),m=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,p=n.status!=="active",x=m||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==x?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",x),e[2]=x,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let j;e[7]!==n.title?(j=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let S;e[9]!==n.status||e[10]!==p||e[11]!==m||e[12]!==o?(S=m?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=p,e[11]=m,e[12]=o,e[13]=S):S=e[13];let y;e[14]!==j||e[15]!==S?(y=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,S]}),e[14]=j,e[15]=S,e[16]=y):y=e[16];let C;e[17]!==n||e[18]!==m||e[19]!==a||e[20]!==o?(C=m&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=m,e[19]=a,e[20]=o,e[21]=C):C=e[21];let _;e[22]!==n||e[23]!==p||e[24]!==l||e[25]!==o?(_=p?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(ft,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(ht,{size:13})}),e[22]=n,e[23]=p,e[24]=l,e[25]=o,e[26]=_):_=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let w;e[30]!==o?(w=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=w):w=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Ae,{size:13}),e[34]=A):A=e[34];let O;e[35]!==$||e[36]!==w||e[37]!==M?(O=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:w,"aria-label":M,children:A}),e[35]=$,e[36]=w,e[37]=M,e[38]=O):O=e[38];let I;e[39]!==n||e[40]!==i?(I=()=>i(n),e[39]=n,e[40]=i,e[41]=I):I=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let b;e[44]!==o?(b=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(re,{size:13}),e[46]=E):E=e[46];let z;e[47]!==I||e[48]!==v||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:I,title:v,"aria-label":b,children:E}),e[47]=I,e[48]=v,e[49]=b,e[50]=z):z=e[50];let k;e[51]!==O||e[52]!==z||e[53]!==C||e[54]!==_?(k=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[C,_,O,z]}),e[51]=O,e[52]=z,e[53]=C,e[54]=_,e[55]=k):k=e[55];let P;return e[56]!==k||e[57]!==h||e[58]!==g||e[59]!==y?(P=t.jsxs("div",{className:h,children:[g,y,k]}),e[56]=k,e[57]=h,e[58]=g,e[59]=y,e[60]=P):P=e[60],P}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,a=L();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let d;e[10]!==a?(d=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ae,{size:13}),e[12]=u):u=e[12];let m;e[13]!==o||e[14]!==r||e[15]!==d?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":d,children:u})}),e[13]=o,e[14]=r,e[15]=d,e[16]=m):m=e[16];let p;return e[17]!==i||e[18]!==l||e[19]!==m?(p=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,m]}),e[17]=i,e[18]=l,e[19]=m,e[20]=p):p=e[20],p}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,d=L();if(n.length===0)return null;let u;e[0]!==n.length||e[1]!==d?(u=n.length===1?d("details.connectionInstancesPanel.instance"):d("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=d,e[2]=u):u=e[2];let m;e[3]!==u?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(pt,{size:13}),e[5]=r,e[6]=p):p=e[6];let x;e[7]!==d?(x=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=x):x=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==p||e[12]!==x?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[p,x]}),e[9]=r,e[10]=o,e[11]=p,e[12]=x,e[13]=h):h=e[13];let g;e[14]!==m||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[m,h]}),e[14]=m,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let C;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(C=_=>t.jsx(Z.Suspense,{fallback:t.jsx(Zt,{instance:_,onConfigure:c}),children:t.jsx(Jt,{instance:_,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},_.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=C):C=e[27],j=n.map(C),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let S;e[28]!==j?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=S):S=e[29];let y;return e[30]!==g||e[31]!==S?(y=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=y):y=e[32],y}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const 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:a}=s,i=L(),l=Ee(),o=ns(a),{data:r}=me({queryKey:ee.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=Pt(r?.logs??[],o,void 0,r?.total,d?.total),m=u.data,p=u.totalCalls>0,x=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")})]})]}),p?t.jsxs("div",{children:[t.jsx(Mt,{config:is,className:"h-16 w-full",children:t.jsxs(Dt,{data:m,barCategoryGap:"4%",children:[t.jsx(zt,{content:t.jsx(Et,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:m.map(ls)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[m.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),x.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:x.map(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=L(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==a?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":a===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium classic:rounded-md compact:rounded-lg transition-colors",a===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=a,e[7]=u):u=e[7];let m;e[8]!==d||e[9]!==u?(m=t.jsx("div",{role:"group","aria-label":d,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:u}),e[8]=d,e[9]=u,e[10]=m):m=e[10];let p;e[11]!==r||e[12]!==m?(p=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,m]}),e[11]=r,e[12]=m,e[13]=p):p=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(cs,{}),e[14]=x):x=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==a?(h=t.jsx(Z.Suspense,{fallback:x,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:a})}),e[15]=n,e[16]=l.id,e[17]=a,e[18]=h):h=e[18];let g;return e[19]!==p||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[p,h]}),e[19]=p,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const m=crypto.randomUUID();a({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:m}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==o||e[13]!==r?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,d]}),e[11]=i,e[12]=o,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(ms,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=L(),{org:a}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=Rt(i);if(!(l.length>0)){let p;return e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(t.Fragment,{}),e[2]=p):p=e[2],p}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==r?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r})}),e[5]=r,e[6]=d):d=e[6];let u;e[7]!==a.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:a.slug})}),e[7]=a.slug,e[8]=l,e[9]=u):u=e[9];let m;return e[10]!==d||e[11]!==u?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=m):m=e[12],m}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:a}=s,i=L(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const d=Te(r),u=ke(c);let m;e[4]!==u||e[5]!==c?(m=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=m):m=e[6];const p=m,[x,h]=Z.useState("");let g,j,S,y;if(e[7]!==p||e[8]!==d||e[9]!==l||e[10]!==a||e[11]!==x||e[12]!==i||e[13]!==n){const $=(n??[]).filter(fs),w=x.toLowerCase().trim(),M=w?$.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):$;let A;e[18]!==p||e[19]!==l||e[20]!==a?(A=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=p,e[19]=l,e[20]=a,e[21]=A):A=e[21];const O=A;S="flex flex-col h-full overflow-hidden";let I;e[22]!==i?(I=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=I):I=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=v):v=e[24],e[25]!==x||e[26]!==I?(y=t.jsx(Vt,{value:x,onChange:h,placeholder:I,onKeyDown:v}),e[25]=x,e[26]=I,e[27]=y):y=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(_e,{image:null,title:i(x?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(x?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>O(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Lt,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.annotations?.title??b.name}),t.jsx(at,{annotations:b.annotations,_meta:b._meta})]}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b.description})]})]},b.name)})}),e[7]=p,e[8]=d,e[9]=l,e[10]=a,e[11]=x,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=S,e[17]=y}else g=e[14],j=e[15],S=e[16],y=e[17];let C;e[28]!==g||e[29]!==j?(C=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=C):C=e[30];let _;return e[31]!==S||e[32]!==y||e[33]!==C?(_=t.jsxs("div",{className:S,children:[y,C]}),e[31]=S,e[32]=y,e[33]=C,e[34]=_):_=e[34],_}function fs(s){return!!ce(s._meta)}const je=[];function De(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=L();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s,o=c===void 0?je:c,r=a===void 0?je:a,d=L(),u=se(),m=ke(i??"");let p;e[0]!==m||e[1]!==i?(p=m?Pe(m):i,e[0]=m,e[1]=i,e[2]=p):p=e[2];const x=p;let h;e[3]!==x||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(T){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:x,collectionName:"tools",itemId:encodeURIComponent(T)}})},e[3]=x,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(bs),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const S=j;if(n.length+o.length+r.length===0){let N;e[12]!==d?(N=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=N):N=e[13];let T;e[14]!==N?(T=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:N}),e[14]=N,e[15]=T):T=e[15];let D;e[16]!==d?(D=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=D):D=e[17];let F;e[18]!==D?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:D}),e[18]=D,e[19]=F):F=e[19];let X;return e[20]!==T||e[21]!==F?(X=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[T,F]}),e[20]=T,e[21]=F,e[22]=X):X=e[22],X}let C;e[23]!==d||e[24]!==n.length?(C=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=C):C=e[25];let _;e[26]!==C?(_=t.jsx(ie,{value:"tools",variant:"underline",children:C}),e[26]=C,e[27]=_):_=e[27];let $;e[28]!==S||e[29]!==d?($=S&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=S,e[29]=d,e[30]=$):$=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let M;e[33]!==w?(M=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=M):M=e[34];let A;e[35]!==d?(A=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=A):A=e[36];let O;e[37]!==A?(O=t.jsx(ie,{value:"resources",variant:"underline",children:A}),e[37]=A,e[38]=O):O=e[38];let I;e[39]!==M||e[40]!==O||e[41]!==_||e[42]!==$?(I=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Ut,{variant:"underline",className:"gap-1",children:[_,$,M,O]})}),e[39]=M,e[40]=O,e[41]=_,e[42]=$,e[43]=I):I=e[43];let v;e[44]!==g||e[45]!==n?(v=n.length>0?n.map(N=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>g(N.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(vt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},N.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=v):v=e[46];let b;e[47]!==v?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:v})}),e[47]=v,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==S||e[51]!==l||e[52]!==n?(E=S&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ps,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=S,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==o?(z=o.length>0?o.map(js):t.jsx(le,{label:"prompts"}),e[54]=o,e[55]=z):z=e[55];let k;e[56]!==z?(k=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=k):k=e[57];let P;e[58]!==r?(P=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=P):P=e[59];let R;e[60]!==P?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:P})}),e[60]=P,e[61]=R):R=e[61];let f;return e[62]!==I||e[63]!==b||e[64]!==E||e[65]!==k||e[66]!==R?(f=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Ft,{defaultValue:"tools",variant:"underline",children:[I,b,E,k,R]})}),e[62]=I,e[63]=b,e[64]=E,e[65]=k,e[66]=R,e[67]=f):f=e[67],f}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(jt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children: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(gt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function bs(s){return ce(s._meta)}function vs(s){const e=U.c(15),{connection:n,displayTitle:c}=s,a=Ue(),i=c??n.title,l=a?"md":"xl";let o;e[0]!==n.icon||e[1]!==l||e[2]!==i?(o=t.jsx(ae,{icon:n.icon,name:i,size:l,className:"shrink-0"}),e[0]=n.icon,e[1]=l,e[2]=i,e[3]=o):o=e[3];let r;e[4]!==a||e[5]!==i?(r=a?t.jsx(Fe.Title,{children:i}):t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:i})}),e[4]=a,e[5]=i,e[6]=r):r=e[6];let d;e[7]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[7]=n.description,e[8]=d):d=e[8];let u;e[9]!==r||e[10]!==d?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[r,d]}),e[9]=r,e[10]=d,e[11]=u):u=e[11];let m;return e[12]!==o||e[13]!==u?(m=t.jsxs("div",{className:"flex items-center classic:gap-4 classic:md:gap-6 classic:py-5 classic:md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0 compact:gap-3 compact:py-4",children:[o,u]}),e[12]=o,e[13]=u,e[14]=m):m=e[14],m}function Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=L(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Le(),d=(()=>{if(typeof o!="string"||!o)return!1;try{const x=new URL(o);return x.hostname==="api.githubcopilot.com"&&x.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",m=e.connection_type==="VIRTUAL",p=m?Qt(e.connection_url):null;return m?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(ye,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(V,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(q,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(q,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(q,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(q,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(G,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(V,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(q,{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(q,{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(q,{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(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(bt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(Q,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(Q,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(V,{children:t.jsx(Je,{value:x.value??[],onChange:x.onChange})}),t.jsx(Q,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ve,{children:[t.jsx(Be,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Bt,{variant:"success",className:"gap-1.5",children:[t.jsx(qt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Gt,{size:12})]})})}),t.jsxs(qe,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(Nt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&x.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>x.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 classic:rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity compact:rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Kt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(W,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(kt,{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(Q,{})]})})]})}function Ss(s){return s.command==="npx"}function ys(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Cs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function be(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Xt(s.connection_headers)){const c=s.connection_headers,a=et(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:a}}const i=Cs(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function _s(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=tt(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=st(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=L(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Qe(),m=Ie(),{org:p}=te(),x=Tt({onSuccess:()=>{o.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[j,S]=Z.useState(!1),y=we({connectionId:e}),{data:C}=lt(),_=C?.data?.members??[],$=h??s,w=_.find(f=>f.userId===$.created_by),A=s?.connection_type==="VIRTUAL"||y.isAuthenticated,O={...s,tools:a},I=nt(O,Yt),v=Xe({resolver:We(Ze),values:be(h??s)}),b=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const N=v.getValues(),T=_s(N),D=h?.id??e;await m.update.mutateAsync({id:D,data:T}),v.reset(N)},z=()=>{v.reset(be(h??s))},k=async f=>{const N=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:T,tokenInfo:D,error:F}=await xt({connectionId:f,orgSlug:p.slug,...N?{scope:N}:{}});if(F||!T){J.error(r("details.connection.authFailed",{error:F??""}));return}if(D)try{const Y=await fetch(`/api/${p.slug}/connections/${f}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!Y.ok)console.error("Failed to save OAuth token:",await Y.text()),await m.update.mutateAsync({id:f,data:{connection_token:T}});else try{await m.update.mutateAsync({id:f,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Y){console.error("Error saving OAuth token:",Y),await m.update.mutateAsync({id:f,data:{connection_token:T}})}else await m.update.mutateAsync({id:f,data:{connection_token:T}});const X=new URL(`/api/${p.slug}/mcp/${f}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(X.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},P=()=>k(s.id),R=async()=>{try{const f=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!f.ok){const T=await f.text();J.error(r("details.connection.failedRemoveOAuth",{error:T}));return}const N=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(N.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(f){console.error("Error removing OAuth token:",f),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(At,{...x}),t.jsx(St,{open:h!==null,onOpenChange:f=>{f||g(null)},children:t.jsxs(yt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Ct,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(_t,{className:"text-base",children:h?.title??s.title}),t.jsx(wt,{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(rt,{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(It,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(G,{control:v.control,name:"title",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(V,{children:t.jsx(W,{...f})}),t.jsx(Q,{})]})}),t.jsx(G,{control:v.control,name:"description",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(V,{children:t.jsx(W,{...f,value:f.value||""})}),t.jsx(Q,{})]})})]}),t.jsx(Ns,{form:v,connection:h??s,hasOAuthToken:y.hasOAuthToken,onReauthenticate:P,onRemoveOAuth:R}),t.jsx(it,{connection:h??s,form:v,hasMcpBinding:I,isMCPAuthenticated:A,supportsOAuth:y.supportsOAuth,isServerError:y.isServerError,onAuthenticate:P,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const f=h??s;g(null),x.requestDelete(f)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(ot,{hideTopbar:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(vs,{connection:s,displayTitle:(()=>{const f=o[0]??s;return f.app_name?f.title.replace(/\s*\(\d+\)\s*$/,""):f.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ds,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(es,{instances:o,onConfigure:f=>g(f),onAuthenticate:f=>k(f.id),onDelete:f=>x.requestDelete(f),onToggleStatus:async(f,N)=>{try{await m.update.mutateAsync({id:f.id,data:{status:N}}),J.success(r(N==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{S(!0);try{const f=o[0]??s,N=f.title.replace(/\s*\(\d+\)\s*$/,""),T=o.length+1,D=`${N} (${T})`,F=Ye("conn");await m.create.mutateAsync({id:F,title:D,description:f.description??null,connection_type:f.connection_type,connection_url:f.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:f.created_by,organization_id:f.organization_id,icon:f.icon??null,app_name:f.app_name??null,app_id:f.app_id??null,connection_headers:f.connection_headers??null,oauth_config:null,configuration_state:f.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const X=new URL(`/api/${p.slug}/mcp/${F}`,window.location.origin),Y=await ut({url:X.href,token:null,orgId:p.id});Y.supportsOAuth&&!Y.isAuthenticated&&await k(F)}finally{S(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ks(){const s=U.c(52),e=L();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=He(a),{org:o}=te(),r=Ie();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=ct(d),m=u[0]??null,p=m?.id??"",x=p||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==x?(h={connectionId:x,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=x,s[7]=h):h=s[7];const g=Te(h);let j;s[8]!==g?(j={client:g},s[8]=g,s[9]=j):j=s[9];const{data:S}=dt(j);let y;if(s[10]!==m?.tools||s[11]!==p||s[12]!==u||s[13]!==S){const k=S?S.tools.map($s):(m?.tools??[]).map(Ds);e:{if(u.length<=1){y=k;break e}const P=new Set,R=[],f=As;for(const N of u){const T=N.id===p?k:f(N.tools);for(const D of T)P.has(D.name)||(P.add(D.name),R.push(D))}y=R.length>0?R:k}s[10]=m?.tools,s[11]=p,s[12]=u,s[13]=S,s[14]=y}else y=s[14];const C=y;let _;s[15]!==g?(_={client:g},s[15]=g,s[16]=_):_=s[16];const{data:$}=mt(_);let w;s[17]!==g?(w={client:g},s[17]=g,s[18]=w):w=s[18];const{data:M}=Ke(w);let A;s[19]!==$?.prompts?(A=$?.prompts??[],s[19]=$?.prompts,s[20]=A):A=s[20];let O;s[21]!==A?(O=A.map(Ts),s[21]=A,s[22]=O):O=s[22];const I=O;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let b;s[25]!==v?(b=v.map(Is),s[25]=v,s[26]=b):b=s[26];const E=b;if(!m){let k;s[27]!==e?(k=e("details.connection.notFoundTitle"),s[27]=e,s[28]=k):k=s[28];let P;s[29]!==e?(P=e("details.connection.notFoundDescription"),s[29]=e,s[30]=P):P=s[30];let R;s[31]!==c||s[32]!==l?(R=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=R):R=s[33];let f;s[34]!==e?(f=e("details.connection.backButton"),s[34]=e,s[35]=f):f=s[35];let N;s[36]!==R||s[37]!==f?(N=t.jsx(B,{variant:"outline",onClick:R,children:f}),s[36]=R,s[37]=f,s[38]=N):N=s[38];let T;return s[39]!==k||s[40]!==P||s[41]!==N?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(_e,{title:k,description:P,actions:N})}),s[39]=k,s[40]=P,s[41]=N,s[42]=T):T=s[42],T}let z;return s[43]!==r.update.isPending||s[44]!==C||s[45]!==m||s[46]!==p||s[47]!==l||s[48]!==I||s[49]!==E||s[50]!==u?(z=t.jsx(ws,{org:l,connection:m,connectionId:p,isUpdating:r.update.isPending,tools:C,prompts:I,resources:E,siblings:u}),s[43]=r.update.isPending,s[44]=C,s[45]=m,s[46]=p,s[47]=l,s[48]=I,s[49]=E,s[50]=u,s[51]=z):z=s[51],z}function Is(s){return{name:s.name,description:s.description,uri:s.uri}}function 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(Ge,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(ks,{})})}),s[0]=e):e=s[0],e}function yi(){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{yi as default};
@@ -1 +1 @@
1
- import{an as R,bO as A,bP as I,ao as o,bN as j,bM as z,c as L,j as u,B as C}from"./index-doEaURqC.js";import{I as H}from"./input-BK5Sp8hZ.js";import{s as W}from"./Plus-qASEo4cN.js";import{s as q}from"./Trash01-mB4s-hrv.js";const K=R({key:o().min(1,"Key is required"),value:o()}),G=R({title:o().min(1,"Name is required"),description:o().nullable().optional(),icon:o().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:o().optional(),connection_token:o().nullable().optional(),npx_package:o().optional(),stdio_command:o().optional(),stdio_args:o().optional(),stdio_cwd:o().optional(),env_vars:j(K).optional(),configuration_scopes:j(o()).nullable().optional(),configuration_state:A(o(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]}).refine(n=>(n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket")&&n.connection_url?.trim()?o().url().safeParse(n.connection_url.trim()).success:!0,{message:"Enter a valid URL",path:["connection_url"]});function O(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(i=>e.includes(i))||["sk_","rk_","whsec_","pk_live","sk_live"].some(i=>e.startsWith(i))||["_key","_secret","_token","_password","_auth","_pat"].some(i=>e.endsWith(i)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:i,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=i===void 0?"value...":i;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,s)=>s!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:p,value:c.value},r(s))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const g=P;let T;e[9]!==r||e[10]!==t?(T=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:c.key,value:p},r(s))},e[9]=r,e[10]=t,e[11]=T):T=e[11];const k=T;let f;if(e[12]!==g||e[13]!==y||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==g||e[20]!==y||e[21]!==k||e[22]!==m||e[23]!==h?(l=(p,s)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>g(s,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:O(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(s,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(s),children:u.jsx(q,{size:16})})]},s),e[19]=g,e[20]=y,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=g,e[13]=y,e[14]=k,e[15]=m,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(W,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==S?(d=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[w,"Add Environment Variable"]}),e[26]=S,e[27]=d):d=e[27];let _;e[28]!==f||e[29]!==d?(_=u.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=_):_=e[30];let E;return e[31]!==v||e[32]!==_?(E=u.jsx("div",{className:v,children:_}),e[31]=v,e[32]=_,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const a=e.slice(1).find(i=>!i.startsWith("-"));return a?{packageName:a}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(i=>(i.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",a=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:a}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const i=V(r);return Object.keys(i).length>0&&(a.envVars=i),a}export{X as E,J as a,Q as b,G as c,Z as d,Y as i,F as p,D as r};
1
+ import{an as H,bQ as A,bR as I,ao as o,bP as j,bO as z,c as L,j as u,B as C}from"./index-CyBVTyGa.js";import{I as R}from"./input-D5Zi_pUc.js";import{s as W}from"./Plus-BbELO07z.js";import{s as q}from"./Trash01-BLoRPhD3.js";const K=H({key:o().min(1,"Key is required"),value:o()}),M=H({title:o().min(1,"Name is required"),description:o().nullable().optional(),icon:o().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:o().optional(),connection_token:o().nullable().optional(),npx_package:o().optional(),stdio_command:o().optional(),stdio_args:o().optional(),stdio_cwd:o().optional(),env_vars:j(K).optional(),configuration_scopes:j(o()).nullable().optional(),configuration_state:A(o(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]}).refine(n=>(n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket")&&n.connection_url?.trim()?o().url().safeParse(n.connection_url.trim()).success:!0,{message:"Enter a valid URL",path:["connection_url"]});function O(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(i=>e.includes(i))||["sk_","rk_","whsec_","pk_live","sk_live"].some(i=>e.startsWith(i))||["_key","_secret","_token","_password","_auth","_pat"].some(i=>e.endsWith(i)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:i,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=i===void 0?"value...":i;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const N=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,s)=>s!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:p,value:c.value},r(s))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const g=P;let T;e[9]!==r||e[10]!==t?(T=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:c.key,value:p},r(s))},e[9]=r,e[10]=t,e[11]=T):T=e[11];const k=T;let f;if(e[12]!==g||e[13]!==y||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==g||e[20]!==y||e[21]!==k||e[22]!==m||e[23]!==h?(l=(p,s)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(R,{placeholder:m,value:p.key,onChange:c=>g(s,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(R,{type:O(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(s,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(s),children:u.jsx(q,{size:16})})]},s),e[19]=g,e[20]=y,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=g,e[13]=y,e[14]=k,e[15]=m,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(W,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==N?(d=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:N,children:[w,"Add Environment Variable"]}),e[26]=N,e[27]=d):d=e[27];let _;e[28]!==f||e[29]!==d?(_=u.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=_):_=e[30];let E;return e[31]!==v||e[32]!==_?(E=u.jsx("div",{className:v,children:_}),e[31]=v,e[32]=_,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function S(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const a=e.slice(1).find(i=>!i.startsWith("-"));return a?{packageName:a}:null}function Y(n){const{uiType:e}=n,t=S(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===S("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 Q(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=S(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(i=>(i.server?.remotes??[]).some(m=>S(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",a=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:a}:null}function J(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const i=V(r);return Object.keys(i).length>0&&(a.envVars=i),a}export{X as E,Q as a,J as b,M as c,Z as d,Y as i,F as p,D as r};
@@ -1 +1 @@
1
- import{r as V,c as q,b as ne,j as t,B as L,h as ue,l as fe,G as ce,F as Re,I as We,H as Xe,E as qe,Z as Ge,a0 as Ne,d as ke,u as Qe,a as Te,Y as Ye,ae as ye,_ as Je,$ as Ze,aq as et,ap as tt,n as pe,q as te,o as nt,a6 as st,t as W,K as ot}from"./index-doEaURqC.js";import{a as we,g as it,e as ct}from"./extract-connection-data-BIqslos8.js";import{C as lt}from"./collection-display-button-D9O76Rnp.js";import{S as rt}from"./search-input-CCUlZDzf.js";import{C as at}from"./collection-tabs-BWQrYrdS.js";import{C as Ce,u as Ae,g as dt}from"./connection-card-DF11WhqU.js";import{E as ut}from"./empty-state-ClBiZqLf.js";import{u as gt,D as mt}from"./use-delete-connection-Pe3fW9Dc.js";import{u as pt}from"./use-infinite-scroll-Bm905rys.js";import{u as Ie}from"./use-mobile-DYpKQ1eP.js";import{g as de}from"./connection-slug-CITJ0kGN.js";import{A as ht,a as ft,b as xt,c as jt,g as St,d as yt,e as Ct,f as vt}from"./alert-dialog-Dg6YJ6PP.js";import{ah as xe,bh as bt,ai as _t,b4 as Dt,j as Se}from"./agent-icon-CzsnrYjD.js";import{g as Nt,a as kt}from"./metadata-D72DunRR.js";import{d as Pe,h as Me,c as $e,e as Oe,b as Fe,D as Ue}from"./dialog-C36x61_J.js";import{D as Tt,a as wt,d as At,b as It,e as Pt,f as Mt,g as $t}from"./drawer-CsJzOKcM.js";import{F as G,b as Q,c as Y,d as J,f as Z,a as _e}from"./form-CXSt7_li.js";import{I as se}from"./input-BK5Sp8hZ.js";import{S as Ot,b as Ft,a as Ut,d as Vt,c as ae}from"./select-oEHCSTZi.js";import{T as Lt}from"./textarea-B9cyNs7j.js";import{b as Ve,u as zt}from"./use-connection-PgTQPnAp.js";import{m as Et}from"./use-mcp-client-D2DgMGL-.js";import{b as Bt}from"./use-virtual-mcp-B-mdsJbn.js";import{g as Kt}from"./types-BCbJ4Eml.js";import{s as Le}from"./Plus-qASEo4cN.js";import{a as Ht}from"./UserSquare-BfT6tB5U.js";import{s as ze}from"./XClose-DFUqDOc8.js";import{i as he,a as De,E as Rt,c as Wt,p as Xt,b as qt,d as Gt}from"./connection-form-helpers-CyBATU5Y.js";import{a as Qt}from"./authenticate-and-persist-oauth-DG9xWGRs.js";import{I as Yt}from"./integration-icon-Crk6WRxP.js";import{C as Ee}from"./checkbox-BKGUJJNh.js";import{i as Jt}from"./DotsVertical-BITRq5d-.js";import{s as Be}from"./Eye-rQUtSbk6.js";import{s as Ke}from"./Trash01-mB4s-hrv.js";import"./connection-DzM2SOZ6.js";import"./ArrowUp-CbPBDOpZ.js";import"./Check-BZXRTDaX.js";import"./tooltip-C91IS2ON.js";import"./index-C4LzZ3-O.js";import"./view-mode-toggle-Bsk0Q0dk.js";import"./badge-DuB4cqrw.js";import"./SearchMd-B6NDUgzQ.js";import"./useInfiniteQuery-DCZL7BN4.js";import"./infiniteQueryObserver-CxJm0T6_.js";import"./slugify-CEUa2lfQ.js";import"./AlertCircle-Cat-Fy2i.js";import"./Tool01-H9OcfGdq.js";import"./ArrowLeft-DuxVUo5_.js";import"./ArrowRight-CsoDgnUj.js";import"./XCircle-Cu2Sy8Aw.js";import"./ZoomOut-Burao8Eg.js";import"./Globe04-C_9DD9oO.js";import"./CheckCircle-Cj4PQGuv.js";import"./ChevronUp-DGt31MPD.js";import"./Copy01-B6hr4CBg.js";import"./CreditCard01-CiYLi_pR.js";import"./Download01-CsYfHghd.js";import"./Share07-CMPYQYHk.js";import"./Image01-BLIf6uY9.js";import"./Key01-SGIR_QrT.js";import"./LayoutLeft-GBQ0rQxQ.js";import"./Link01-BnVQGp2l.js";import"./LinkExternal01-Dh0AABP8.js";import"./Monitor01-CxisI5ut.js";import"./Sun-BSFyLDhg.js";import"./Package-DsU1cU6S.js";import"./Palette-CzoNEzRs.js";import"./SearchLg-qmi8uaeX.js";import"./Stars01-cdnol_cb.js";import"./Upload01-Uv_jtHIk.js";import"./User01-DHGCVvV3.js";import"./Users01-C_qUmfZB.js";import"./X-vKTIsgL1.js";import"./Zap-CSRFlEXK.js";import"./label-tAsQMZ2G.js";import"./auth-D3Q2r2cz.js";import"./mcp-oauth-61IHYJoj.js";function Zt(C){const e=`deco-filters-${C}`,[n,d]=V.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[n,o=>{d(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(c){console.error("Failed to save filters:",c)}}]}function en(C){const e=q.c(7),[n,d]=V.useState(C),[s,o]=V.useState(C?"desc":null);let c;e[0]!==s||e[1]!==n?(c=a=>{n!==a?(d(a),o("asc")):s==="asc"?o("desc"):s==="desc"&&(d(void 0),o(null))},e[0]=s,e[1]=n,e[2]=c):c=e[2];const r=c;let m;return e[3]!==r||e[4]!==s||e[5]!==n?(m={sortKey:n,sortDirection:s,handleSort:r},e[3]=r,e[4]=s,e[5]=n,e[6]=m):m=e[6],m}function tn(C,e){const n=q.c(12),d=e===void 0?"cards":e,s=Ie(),o=V.useRef(s),c=C?`deco-view-mode-${C}`:"deco-view-mode";let r;n[0]!==d||n[1]!==c?(r=()=>{const f=globalThis.localStorage?.getItem(c);return f==="cards"||f==="table"?f:d},n[0]=d,n[1]=c,n[2]=r):r=n[2];const[m,a]=V.useState(r);let S;n[3]!==c?(S=f=>{a(f),globalThis.localStorage?.setItem(c,f)},n[3]=c,n[4]=S):S=n[4];const u=S;let l,p;n[5]!==s||n[6]!==m?(l=()=>{!o.current&&s&&m==="table"&&a("cards"),o.current=s},p=[s,m],n[5]=s,n[6]=m,n[7]=l,n[8]=p):(l=n[7],p=n[8]),V.useEffect(l,p);let h;return n[9]!==u||n[10]!==m?(h=[m,u],n[9]=u,n[10]=m,n[11]=h):h=n[11],h}function nn(C){const e=q.c(20),{namespace:n,resource:d,defaultSortKey:s,defaultViewMode:o}=C,c=s===void 0?"title":s,r=o===void 0?"table":o,[m,a]=V.useState(""),S=V.useDeferredValue(m),u=`${n}-${d}`,[l,p]=Zt(u),h=`studio-${d}-filter-visible-${n}`;let f;e[0]!==h?(f=()=>globalThis.localStorage?.getItem(h)==="true",e[0]=h,e[1]=f):f=e[1];const[x,D]=V.useState(f);let y;e[2]!==h?(y=F=>{D(F),globalThis.localStorage?.setItem(h,String(F))},e[2]=h,e[3]=y):y=e[3];const v=y;let i;e[4]!==x||e[5]!==v?(i=()=>{v(!x)},e[4]=x,e[5]=v,e[6]=i):i=e[6];const b=i,[k,A]=tn(`studio-${d}-${n}`,r),{sortKey:T,sortDirection:M,handleSort:P}=en(c),$=T;let I;return e[7]!==x||e[8]!==l||e[9]!==P||e[10]!==m||e[11]!==S||e[12]!==v||e[13]!==p||e[14]!==A||e[15]!==M||e[16]!==$||e[17]!==b||e[18]!==k?(I={search:m,searchTerm:S,setSearch:a,filters:l,setFilters:p,filterBarVisible:x,setFilterBarVisible:v,toggleFilterBar:b,viewMode:k,setViewMode:A,sortKey:$,sortDirection:M,handleSort:P},e[7]=x,e[8]=l,e[9]=P,e[10]=m,e[11]=S,e[12]=v,e[13]=p,e[14]=A,e[15]=M,e[16]=$,e[17]=b,e[18]=k,e[19]=I):I=e[19],I}function sn(C){const e=q.c(35),{open:n,onOpenChange:d,count:s,onConfirm:o}=C,c=ne(),r=s===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let m;e[0]!==s||e[1]!==c||e[2]!==r?(m=c(r,{count:s}),e[0]=s,e[1]=c,e[2]=r,e[3]=m):m=e[3];let a;e[4]!==m?(a=t.jsx(ht,{children:m}),e[4]=m,e[5]=a):a=e[5];const S=s===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==c||e[7]!==S?(u=c(S),e[6]=c,e[7]=S,e[8]=u):u=e[8];let l;e[9]!==u?(l=t.jsx(ft,{children:u}),e[9]=u,e[10]=l):l=e[10];let p;e[11]!==a||e[12]!==l?(p=t.jsxs(xt,{children:[a,l]}),e[11]=a,e[12]=l,e[13]=p):p=e[13];let h;e[14]!==c?(h=c("orgs.bulkDeleteDialog.cancelButton"),e[14]=c,e[15]=h):h=e[15];let f;e[16]!==h?(f=t.jsx(jt,{children:h}),e[16]=h,e[17]=f):f=e[17];const x=s===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let D;e[18]!==s||e[19]!==c||e[20]!==x?(D=c(x,{count:s}),e[18]=s,e[19]=c,e[20]=x,e[21]=D):D=e[21];let y;e[22]!==o||e[23]!==D?(y=t.jsx(St,{onClick:o,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:D}),e[22]=o,e[23]=D,e[24]=y):y=e[24];let v;e[25]!==y||e[26]!==f?(v=t.jsxs(yt,{children:[f,y]}),e[25]=y,e[26]=f,e[27]=v):v=e[27];let i;e[28]!==v||e[29]!==p?(i=t.jsxs(Ct,{children:[p,v]}),e[28]=v,e[29]=p,e[30]=i):i=e[30];let b;return e[31]!==d||e[32]!==n||e[33]!==i?(b=t.jsx(vt,{open:n,onOpenChange:d,children:i}),e[31]=d,e[32]=n,e[33]=i,e[34]=b):b=e[34],b}function on(C){const e=q.c(39),{item:n,canManage:d,allConnections:s,connectedAppNames:o,connectingItemId:c,onNavigateConnected:r,onConnect:m}=C,a=ne();let S,u;e[0]!==o||e[1]!==n?(S=we(n)??"",u=o.has(S),e[0]=o,e[1]=n,e[2]=S,e[3]=u):(S=e[2],u=e[3]);const l=u;let p;e[4]!==n._meta?(p=Nt(n._meta),e[4]=n._meta,e[5]=p):p=e[5];const h=p,f=h?.friendlyName||h?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",x=n.server?.description||n.description||null;let D;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(D=n.server?.icons?.[0]?.src||kt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=D):D=e[8];const y=D;let v;if(e[9]!==s||e[10]!==S){let O;e[12]!==S?(O=H=>H.connection_type!=="VIRTUAL"&&H.app_name===S,e[12]=S,e[13]=O):O=e[13],v=s.filter(O),e[9]=s,e[10]=S,e[11]=v}else v=e[11];const i=v,b=l||d;let k,A;e[14]!==i||e[15]!==l||e[16]!==n||e[17]!==m||e[18]!==r?(k=()=>{if(l){const O=i[0];O&&r(O);return}A()},A=()=>m(n),e[14]=i,e[15]=l,e[16]=n,e[17]=m,e[18]=r,e[19]=k,e[20]=A):(k=e[19],A=e[20]);let T;e[21]!==x||e[22]!==y||e[23]!==f?(T={title:f,description:x,icon:y},e[21]=x,e[22]=y,e[23]=f,e[24]=T):T=e[24];let M;e[25]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(xe,{}),e[25]=M):M=e[25];const P=b?k:void 0;let $;e[26]!==d||e[27]!==c||e[28]!==A||e[29]!==l||e[30]!==n.id||e[31]!==a?($=l?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.catalogItemCard.connected")}):d&&t.jsx(L,{variant:"outline",size:"sm",className:"h-7 px-3 classic:rounded-lg text-sm font-medium",disabled:c!==null,onClick:O=>{O.stopPropagation(),A()},children:c===n.id?t.jsx(ue,{className:"size-3.5"}):a("orgs.catalogItemCard.connect")}),e[26]=d,e[27]=c,e[28]=A,e[29]=l,e[30]=n.id,e[31]=a,e[32]=$):$=e[32];let I;e[33]!==$?(I=t.jsx("div",{className:"flex items-center gap-2",children:$}),e[33]=$,e[34]=I):I=e[34];let F;return e[35]!==T||e[36]!==P||e[37]!==I?(F=t.jsx(Ce,{connection:T,fallbackIcon:M,onClick:P,headerActionsAlwaysVisible:!0,headerActions:I}),e[35]=T,e[36]=P,e[37]=I,e[38]=F):F=e[38],F}function cn(C){return C?.length?{appToolName:C.find(n=>!!Kt(n._meta))?.name??null}:null}function He(C){const e=q.c(8),{selectionMode:n,children:d}=C,s=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let o;e[0]!==s?(o=fe("overflow-hidden transition-all duration-150 ease-out",s),e[0]=s,e[1]=o):o=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Re,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:rn,children:t.jsx(Jt,{size:20})})}),e[2]=c):c=e[2];let r;e[3]!==d?(r=t.jsxs(We,{children:[c,t.jsx(Xe,{align:"end",onClick:ln,children:d})]}),e[3]=d,e[4]=r):r=e[4];let m;return e[5]!==o||e[6]!==r?(m=t.jsx("div",{className:o,children:r}),e[5]=o,e[6]=r,e[7]=m):m=e[7],m}function ln(C){return C.stopPropagation()}function rn(C){return C.stopPropagation()}function an(C){const e=q.c(57),{group:n,onOpen:d,selectionMode:s,selectedIds:o,onToggleSelect:c}=C,r=ne();let m;if(e[0]!==n.connections||e[1]!==o){let g;e[3]!==o?(g=w=>o.has(w.id),e[3]=o,e[4]=g):g=e[4],m=n.connections.every(g),e[0]=n.connections,e[1]=o,e[2]=m}else m=e[2];const a=m;let S;if(e[5]!==n.connections||e[6]!==o){let g;e[8]!==o?(g=w=>o.has(w.id),e[8]=o,e[9]=g):g=e[9],S=n.connections.some(g),e[5]=n.connections,e[6]=o,e[7]=S}else S=e[7];const u=S;let l;e[10]!==a||e[11]!==n.connections||e[12]!==c||e[13]!==o?(l=()=>{for(const g of n.connections)a?o.has(g.id)&&c(g.id):o.has(g.id)||c(g.id)},e[10]=a,e[11]=n.connections,e[12]=c,e[13]=o,e[14]=l):l=e[14];const p=l,h=n.title,f=n.icon;let x;e[15]!==n.connections.length||e[16]!==r?(x=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=x):x=e[17];let D;e[18]!==n.icon||e[19]!==n.title||e[20]!==x?(D={title:h,icon:f,description:x},e[18]=n.icon,e[19]=n.title,e[20]=x,e[21]=D):D=e[21];let y;e[22]!==d||e[23]!==s||e[24]!==p?(y=()=>s?p():d(),e[22]=d,e[23]=s,e[24]=p,e[25]=y):y=e[25];const v=s&&a&&"ring-2 ring-primary",i=s&&u&&!a&&"ring-1 ring-primary/50";let b;e[26]!==i||e[27]!==v?(b=fe(v,i),e[26]=i,e[27]=v,e[28]=b):b=e[28];const k=s?a?!0:u&&"mixed":void 0;let A;e[29]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(xe,{}),e[29]=A):A=e[29];let T;e[30]!==a||e[31]!==n.connections.length||e[32]!==s||e[33]!==u||e[34]!==r||e[35]!==p?(T=s?t.jsx(Ee,{checked:a?!0:u?"indeterminate":!1,onCheckedChange:p}):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]=a,e[31]=n.connections.length,e[32]=s,e[33]=u,e[34]=r,e[35]=p,e[36]=T):T=e[36];let M;e[37]!==d?(M=g=>{g.stopPropagation(),d()},e[37]=d,e[38]=M):M=e[38];let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Be,{size:16}),e[39]=P):P=e[39];let $;e[40]!==r?($=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=$):$=e[41];let I;e[42]!==M||e[43]!==$?(I=t.jsxs(ce,{onClick:M,children:[P,$]}),e[42]=M,e[43]=$,e[44]=I):I=e[44];let F;e[45]!==s||e[46]!==I?(F=t.jsx(He,{selectionMode:s,children:I}),e[45]=s,e[46]=I,e[47]=F):F=e[47];let O;e[48]!==T||e[49]!==F?(O=t.jsxs("div",{className:"flex items-center gap-1",children:[T,F]}),e[48]=T,e[49]=F,e[50]=O):O=e[50];let H;return e[51]!==b||e[52]!==k||e[53]!==O||e[54]!==D||e[55]!==y?(H=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:D,onClick:y,className:b,selected:k,fallbackIcon:A,headerActionsAlwaysVisible:!0,headerActions:O})}),e[51]=b,e[52]=k,e[53]=O,e[54]=D,e[55]=y,e[56]=H):H=e[56],H}function dn(C){const e=q.c(36),{connection:n,isSelected:d,selectionMode:s,canManage:o,canManageAgents:c,onToggleSelect:r,onOpen:m,onToggleStatus:a,onDelete:S}=C,u=ne();let l;e[0]!==d||e[1]!==r||e[2]!==s||e[3]!==u?(l=s?t.jsx(Ee,{checked:d,onCheckedChange:r,onClick:un}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=d,e[1]=r,e[2]=s,e[3]=u,e[4]=l):l=e[4];let p;e[5]!==m?(p=k=>{k.stopPropagation(),m()},e[5]=m,e[6]=p):p=e[6];let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Be,{size:16}),e[7]=h):h=e[7];let f;e[8]!==u?(f=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=f):f=e[9];let x;e[10]!==p||e[11]!==f?(x=t.jsxs(ce,{onClick:p,children:[h,f]}),e[10]=p,e[11]=f,e[12]=x):x=e[12];let D;e[13]!==o||e[14]!==c||e[15]!==r||e[16]!==u?(D=(o||c)&&t.jsxs(ce,{onClick:k=>{k.stopPropagation(),r()},children:[t.jsx(bt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=o,e[14]=c,e[15]=r,e[16]=u,e[17]=D):D=e[17];let y;e[18]!==o||e[19]!==n||e[20]!==a||e[21]!==u?(y=o&&(n.status==="active"?t.jsxs(ce,{onClick:k=>{k.stopPropagation(),a("inactive")},children:[t.jsx(_t,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ce,{onClick:k=>{k.stopPropagation(),a("active")},children:[t.jsx(Dt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=o,e[19]=n,e[20]=a,e[21]=u,e[22]=y):y=e[22];let v;e[23]!==o||e[24]!==S||e[25]!==u?(v=o&&t.jsxs(ce,{variant:"destructive",onClick:k=>{k.stopPropagation(),S()},children:[t.jsx(Ke,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=o,e[24]=S,e[25]=u,e[26]=v):v=e[26];let i;e[27]!==s||e[28]!==x||e[29]!==D||e[30]!==y||e[31]!==v?(i=t.jsxs(He,{selectionMode:s,children:[x,D,y,v]}),e[27]=s,e[28]=x,e[29]=D,e[30]=y,e[31]=v,e[32]=i):i=e[32];let b;return e[33]!==l||e[34]!==i?(b=t.jsxs("div",{className:"flex items-center gap-1",children:[l,i]}),e[33]=l,e[34]=i,e[35]=b):b=e[35],b}function un(C){return C.stopPropagation()}function gn(C){const e=q.c(29),{count:n,total:d,canManage:s,canManageAgents:o,onSelectAll:c,onDeselectAll:r,onDelete:m,onAddToAgent:a,onToggleStatus:S,onCancel:u}=C,l=ne();if(n===0)return null;let p;e[0]!==n||e[1]!==l?(p=l("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=l,e[2]=p):p=e[2];let h;e[3]!==p?(h=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:p}),e[3]=p,e[4]=h):h=e[4];let f;e[5]!==n||e[6]!==r||e[7]!==c||e[8]!==l||e[9]!==d?(f=n<d?t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:l("orgs.connectionSelectionUi.selectAll",{total:d})}):t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:l("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=c,e[8]=l,e[9]=d,e[10]=f):f=e[10];let x;e[11]!==o||e[12]!==a||e[13]!==l?(x=o&&t.jsxs(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:[t.jsx(Le,{size:13}),l("orgs.connectionSelectionUi.addToAgent")]}),e[11]=o,e[12]=a,e[13]=l,e[14]=x):x=e[14];let D;e[15]!==s||e[16]!==m||e[17]!==S||e[18]!==l?(D=s&&t.jsxs(t.Fragment,{children:[t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>S("active"),children:l("orgs.connectionSelectionUi.enable")}),t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>S("inactive"),children:l("orgs.connectionSelectionUi.disable")}),t.jsxs(L,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:[t.jsx(Ke,{size:13}),l("orgs.connectionSelectionUi.delete")]})]}),e[15]=s,e[16]=m,e[17]=S,e[18]=l,e[19]=D):D=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ze,{size:13}),e[20]=y):y=e[20];let v;e[21]!==u?(v=t.jsx(L,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:y}),e[21]=u,e[22]=v):v=e[22];let i;return e[23]!==h||e[24]!==f||e[25]!==x||e[26]!==D||e[27]!==v?(i=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[h,f,x,D,v]})}),e[23]=h,e[24]=f,e[25]=x,e[26]=D,e[27]=v,e[28]=i):i=e[28],i}function mn(C){const e=q.c(45),{open:n,onOpenChange:d,agents:s,onConfirm:o}=C,c=ne(),[r,m]=V.useState(null);let a;e[0]!==c?(a=c("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=c,e[1]=a):a=e[1];let S;e[2]!==a?(S=t.jsx(Pe,{children:a}),e[2]=a,e[3]=S):S=e[3];let u;e[4]!==c?(u=c("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=c,e[5]=u):u=e[5];let l;e[6]!==u?(l=t.jsx(Me,{children:u}),e[6]=u,e[7]=l):l=e[7];let p;e[8]!==S||e[9]!==l?(p=t.jsxs($e,{children:[S,l]}),e[8]=S,e[9]=l,e[10]=p):p=e[10];let h;e[11]!==s||e[12]!==r||e[13]!==c?(h=s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:c("orgs.connectionSelectionUi.noAgentsFound")}):s.map(P=>t.jsxs("button",{type:"button",onClick:()=>m(P.id),className:fe("flex items-center gap-3 w-full classic:rounded-md compact:rounded-lg px-3 py-2 text-left transition-colors",r===P.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Yt,{icon:P.icon,name:P.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:P.title}),P.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:P.description})]})]},P.id)),e[11]=s,e[12]=r,e[13]=c,e[14]=h):h=e[14];let f;e[15]!==h?(f=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:h}),e[15]=h,e[16]=f):f=e[16];let x;e[17]!==d?(x=()=>d(!1),e[17]=d,e[18]=x):x=e[18];let D;e[19]!==c?(D=c("orgs.connectionSelectionUi.cancel"),e[19]=c,e[20]=D):D=e[20];let y;e[21]!==x||e[22]!==D?(y=t.jsx(L,{variant:"outline",onClick:x,children:D}),e[21]=x,e[22]=D,e[23]=y):y=e[23];const v=!r;let i;e[24]!==o||e[25]!==d||e[26]!==r?(i=()=>{r&&(o(r),d(!1),m(null))},e[24]=o,e[25]=d,e[26]=r,e[27]=i):i=e[27];let b;e[28]!==c?(b=c("orgs.connectionSelectionUi.add"),e[28]=c,e[29]=b):b=e[29];let k;e[30]!==v||e[31]!==i||e[32]!==b?(k=t.jsx(L,{disabled:v,onClick:i,children:b}),e[30]=v,e[31]=i,e[32]=b,e[33]=k):k=e[33];let A;e[34]!==y||e[35]!==k?(A=t.jsxs(Oe,{children:[y,k]}),e[34]=y,e[35]=k,e[36]=A):A=e[36];let T;e[37]!==A||e[38]!==p||e[39]!==f?(T=t.jsxs(Fe,{className:"sm:max-w-[400px]",children:[p,f,A]}),e[37]=A,e[38]=p,e[39]=f,e[40]=T):T=e[40];let M;return e[41]!==d||e[42]!==n||e[43]!==T?(M=t.jsx(Ue,{open:n,onOpenChange:d,children:T}),e[41]=d,e[42]=n,e[43]=T,e[44]=M):M=e[44],M}function pn({listState:C,activeTab:e,typeFilter:n,statusFilter:d}){const s=ne(),{org:o}=Ne(),c=nt(),r=ke(),{data:m}=Te.useSession(),a=Ve(),S=zt(C),u=gt(),{granted:l}=ye("connections:manage"),{granted:p}=ye("agents:manage"),[h,f]=V.useState(new Set),x=h.size>0,[D,y]=V.useState(!1),[v,i]=V.useState(!1),[b,k]=V.useState(null),A=Bt(),T=S.filter(_=>!(n!=="ALL"&&_.connection_type!==n||d!=="ALL"&&_.status!==d)),M=dt(T),P=_=>{f(j=>{const E=new Set(j);return E.has(_)?E.delete(_):E.add(_),E})},$=()=>{f(new Set)},I=Ae(C.searchTerm),F=I.items,O=pt(I.loadMore,I.hasMore,I.isLoadingMore),H=new Set(S.filter(_=>_.app_name).map(_=>_.app_name)),g=C.search.length>0,w=e==="all"||g?F.filter(_=>{if(g){const j=we(_);if(j&&H.has(j))return!1}return!0}):[],R=e==="connected"||g?M:[],ee=async _=>{if(!(!o||!m?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),k(_.id);try{const j=ct(_,o.id,m.user.id,{remoteIndex:0}),E=j.connection_type==="STDIO",K=!!j.connection_url,B=E&&j.connection_headers&&typeof j.connection_headers=="object"&&"command"in j.connection_headers;if(!K&&!B){W.error(s("orgs.connections.cannotConnectNoMethod")),k(null);return}const oe=await a.create.mutateAsync(j),{id:ie}=oe,le=await Qt({connectionId:ie,orgId:o.id,orgSlug:o.slug,persistFallback:re=>a.update.mutateAsync({id:ie,data:{connection_token:re}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ie,flow:"connections_page_connect",error:le.error??"no_token"}),W.error(s("orgs.connections.authenticationFailed",{error:le.error??"no token received"}));return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ie,flow:"connections_page_connect"});const re=new URL(`/api/${o.slug}/mcp/${ie}`,window.location.origin);await c.invalidateQueries({queryKey:ot.isMCPAuthenticated(re.href,null)}),N(),W.success(s("orgs.connections.authenticationSuccessful"))}let me=null;try{const re=await c.fetchQuery(Et({connectionId:ie,orgId:o.id,orgSlug:o.slug}));me=cn((await re.listTools()).tools)}catch{}const ve=de(oe),be=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o.slug,appSlug:ve,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ve}}:null;W.success(s("orgs.connections.connectedSuccessfully"),be?{action:{label:s("orgs.connections.openConnection"),onClick:()=>r(be)}}:void 0)}catch(j){W.error(s("orgs.connections.failedToConnect",{error:j instanceof Error?j.message:String(j)}))}finally{k(null)}}},X=st(),N=()=>{c.invalidateQueries({predicate:_=>{const j=_.queryKey;return j[1]===o.id&&j[3]==="collection"&&j[4]==="CONNECTIONS"}})},z=async()=>{y(!1);const _=[...h];te("connections_bulk_delete",{count:_.length});const E=(await Promise.allSettled(_.map(K=>X.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;N(),W.success(s("orgs.connections.deletedConnections",{count:E})),$()},U=async(_,j)=>{try{await a.update.mutateAsync({id:_,data:{status:j}}),N(),W.success(s(j==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{W.error(s("orgs.connections.failedToUpdateConnection"))}},ge=async _=>{const j=[...h];te("connections_bulk_status_toggled",{count:j.length,to_status:_});const K=(await Promise.allSettled(j.map(B=>a.update.mutateAsync({id:B,data:{status:_}})))).filter(B=>B.status==="fulfilled").length;N(),W.success(_==="active"?s("orgs.connections.enabledConnections",{count:K}):s("orgs.connections.disabledConnections",{count:K})),$()},je=async _=>{const j=A.find(B=>B.id===_);if(!j)return;te("connections_bulk_add_to_agent",{agent_id:_,count:h.size});const E=new Set(j.connections.map(B=>B.connection_id)),K=[...h].filter(B=>!E.has(B)).map(B=>({connection_id:B,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){W.info(s("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await X.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...j.connections,...K]}}),c.invalidateQueries({predicate:B=>{const oe=B.queryKey;return oe[1]===o.id&&oe[3]==="collection"&&oe[4]==="VIRTUAL_MCP"}}),W.success(s("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:j.title})),$()}catch{W.error(s("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(mt,{...u}),t.jsx(sn,{open:D,onOpenChange:y,count:h.size,onConfirm:z}),t.jsx(mn,{open:v,onOpenChange:i,agents:A,onConfirm:je}),I.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(g?w.length===0&&T.length===0:e==="all"?w.length===0:T.length===0)?t.jsx(ut,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:s("orgs.connections.noConnectionsFound"),description:C.search?s("orgs.connections.noConnectionsMatchSearch",{search:C.search}):s(l?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(_=>{if(_.type==="group")return t.jsx(an,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:_.key}})},selectionMode:x,selectedIds:h,onToggleSelect:P},_.key);const j=_.connection,E=h.has(j.id);return t.jsx(Ce,{connection:j,fallbackIcon:t.jsx(xe,{}),onClick:()=>x?P(j.id):r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),className:fe(E&&"ring-2 ring-primary bg-primary/5"),selected:x?E:void 0,headerActionsAlwaysVisible:!0,headerActions:t.jsx(dn,{connection:j,isSelected:E,selectionMode:x,canManage:l,canManageAgents:p,onToggleSelect:()=>P(j.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),onToggleStatus:K=>U(j.id,K),onDelete:()=>u.requestDelete(j)})},j.id)}),w.map(_=>t.jsx(on,{item:_,canManage:l,allConnections:S,connectedAppNames:H,connectingItemId:b,onNavigateConnected:j=>r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),onConnect:ee},_.id)),(e==="all"||g)&&t.jsx("div",{ref:O,className:"col-span-full h-4"}),(e==="all"||g)&&I.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ue,{className:"size-6 text-muted-foreground"})})]})}),x&&t.jsx(gn,{count:h.size,total:T.length,canManage:l,canManageAgents:p,onSelectAll:()=>{f(new Set(T.map(_=>_.id)))},onDeselectAll:()=>f(new Set),onDelete:()=>y(!0),onAddToAgent:()=>i(!0),onToggleStatus:ge,onCancel:$})]})}function hn(){const C=Ge(),e=ne(),{org:n}=Ne(),d=ke(),s=Qe({strict:!1}),{data:o}=Te.useSession(),{stdioEnabled:c}=Ye(),r=Ie(),{granted:m}=ye("connections:manage"),a=nn({namespace:n.slug,resource:"connections"}),S=Ve(),[u,l]=Je(Ze.connectionsTab(n.slug),g=>s.tab==="all"||s.tab==="connected"?s.tab:g??"all"),[p,h]=V.useState("ALL"),[f,x]=V.useState("ALL"),y=Ae(a.searchTerm).items,v=a.search!==a.searchTerm,i=et({resolver:tt(Wt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),b=i.watch("ui_type"),k=i.watch("connection_url"),A=i.watch("npx_package"),T=he({uiType:b,connectionUrl:k??"",npxPackage:A??""})??De({uiType:b,connectionUrl:k??"",registryItems:y}),M=m&&s.action==="create",P=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),d({to:"/$org/settings/connections",params:{org:n.slug},search:{action:"create"}})},$=()=>{d({to:"/$org/settings/connections",params:{org:n.slug},search:{}})},I=async g=>{let w,R=null,ee=null,X=null;g.ui_type==="NPX"?(w="STDIO",R="",X=qt(g.npx_package||"",g.env_vars||[])):g.ui_type==="STDIO"?(w="STDIO",R="",X=Gt(g.stdio_command||"",g.stdio_args||"",g.stdio_cwd,g.env_vars||[])):(w=g.ui_type,R=g.connection_url||"",ee=g.connection_token||null);const N=it("conn");te("connection_custom_created",{connection_type:w,ui_type:g.ui_type}),await S.create.mutateAsync({id:N,title:g.title,description:g.description||null,connection_type:w,connection_url:R,connection_token:ee,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:n.id,icon:g.icon??null,app_name:null,app_id:null,connection_headers:X,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),$(),i.reset(),d({to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:de({app_name:null,connection_url:R,title:g.title,id:N})}})},F=g=>{g||(M&&$(),i.reset())},O=g=>{const w=g.trim();if(!w)return;const R=!!i.formState.dirtyFields.title,ee=!!i.formState.dirtyFields.description,X=!!i.formState.dirtyFields.env_vars,N=U=>{if(U&&(!R&&!i.getValues("title").trim()&&U.title&&i.setValue("title",U.title,{shouldDirty:!1}),!ee&&!(i.getValues("description")??"").trim()&&U.description&&i.setValue("description",U.description,{shouldDirty:!1}),!X&&U.envVarKeys?.length)){const ge=i.getValues("env_vars")??[],je=new Set(ge.map(j=>j.key)),_=U.envVarKeys.filter(j=>!je.has(j));_.length>0&&i.setValue("env_vars",[...ge,..._.map(j=>({key:j,value:""}))],{shouldDirty:!0})}},z=Xt(w);if(z&&c){i.setValue("ui_type","NPX",{shouldDirty:!0}),i.setValue("npx_package",z.packageName,{shouldDirty:!0}),i.setValue("connection_url","",{shouldDirty:!0}),i.setValue("connection_token",null,{shouldDirty:!0}),N(he({uiType:"NPX",npxPackage:z.packageName}));return}if(w.startsWith("http://")||w.startsWith("https://")){const U=b==="HTTP"||b==="SSE"||b==="Websocket"?b:"HTTP";i.setValue("ui_type",U,{shouldDirty:!0}),i.setValue("connection_url",w,{shouldDirty:!0}),N(he({uiType:U,connectionUrl:w})??De({uiType:U,connectionUrl:w,registryItems:y}));return}b==="NPX"&&N(he({uiType:"NPX",npxPackage:w}))},H=m?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(L,{size:C?"sm":"default",variant:C?"default":"outline",onClick:P,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:e("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const g=e("orgs.connections.createConnection"),w=e("orgs.connections.createConnectionDescription"),R=i.formState.isSubmitting?e("orgs.connections.saving"):e("orgs.connections.createConnection"),ee=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(G,{control:i.control,name:"ui_type",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.type")}),t.jsxs(Ot,{value:N.value,onValueChange:N.onChange,children:[t.jsx(J,{children:t.jsx(Ft,{children:t.jsx(Ut,{})})}),t.jsxs(Vt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),c&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),e("orgs.connections.npxPackage")]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),e("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),b==="NPX"&&t.jsx(G,{control:i.control,name:"npx_package",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.npmPackage")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.npmPackagePlaceholder"),...N,value:N.value??"",onPaste:z=>{const U=z.clipboardData.getData("text");U&&(z.preventDefault(),i.setValue("npx_package",U.trim(),{shouldDirty:!0}),O(U))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Z,{})]})}),b==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(G,{control:i.control,name:"stdio_command",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.command")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.commandPlaceholder"),...N,value:N.value??""})}),t.jsx(Z,{})]})}),t.jsx(G,{control:i.control,name:"stdio_args",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.arguments")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.argumentsPlaceholder"),...N,value:N.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(G,{control:i.control,name:"stdio_cwd",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.workingDirectory")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.workingDirectoryPlaceholder"),...N,value:N.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(b==="NPX"||b==="STDIO")&&t.jsx(G,{control:i.control,name:"env_vars",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.environmentVariables")}),t.jsx(J,{children:t.jsx(Rt,{value:N.value??[],onChange:N.onChange})}),t.jsx(Z,{})]})}),b!=="NPX"&&b!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(G,{control:i.control,name:"connection_url",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.url")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.urlPlaceholder"),...N,value:N.value??"",onPaste:z=>{const U=z.clipboardData.getData("text");U&&(z.preventDefault(),i.setValue("connection_url",U.trim(),{shouldDirty:!0}),O(U))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(G,{control:i.control,name:"connection_token",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:T?.token?.label??e("orgs.connections.tokenOptional")}),t.jsx(J,{children:t.jsx(se,{type:"password",placeholder:T?.token?.placeholder??e("orgs.connections.tokenPlaceholder"),...N,value:N.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:e("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(G,{control:i.control,name:"title",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.name")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.namePlaceholder"),...N})}),t.jsx(Z,{})]})}),t.jsx(G,{control:i.control,name:"description",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.description")}),t.jsx(J,{children:t.jsx(Lt,{placeholder:e("orgs.connections.descriptionPlaceholder"),rows:3,...N,value:N.value??""})}),t.jsx(Z,{})]})})]}),X=M;return r?t.jsx(Tt,{open:X,onOpenChange:F,children:t.jsxs(wt,{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(It,{children:g}),t.jsx(Pt,{className:"mt-1",children:w})]}),t.jsx(Mt,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":e("orgs.connections.close"),children:t.jsx(ze,{size:16})})})]})}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(I),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:ee}),t.jsx($t,{children:t.jsx(L,{type:"submit",disabled:i.formState.isSubmitting,className:"w-full",children:R})})]})})]})}):t.jsx(Ue,{open:X,onOpenChange:F,children:t.jsxs(Fe,{className:"sm:max-w-[525px]",children:[t.jsxs($e,{children:[t.jsx(Pe,{children:g}),t.jsx(Me,{children:w})]}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(I),children:[t.jsx("div",{className:"py-4",children:ee}),t.jsxs(Oe,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>F(!1),children:e("orgs.connections.cancel")}),t.jsx(L,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:R})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{actions:C&&H,children:e("orgs.connections.pageTitle")}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(rt,{value:a.search,onChange:a.setSearch,placeholder:e("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:g=>{g.key==="Escape"&&(a.setSearch(""),g.target.blur())}}),t.jsx(lt,{sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:e("orgs.connections.sortName")},{id:"description",label:e("orgs.connections.sortDescription")},{id:"connection_type",label:e("orgs.connections.sortType")},{id:"updated_by",label:e("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:e("orgs.connections.sortUpdated")}],filters:[{label:e("orgs.connections.filterType"),value:p,onChange:g=>h(g||"ALL"),options:[{id:"ALL",label:e("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:e("orgs.connections.filterStatus"),value:f,onChange:g=>x(g||"ALL"),options:[{id:"ALL",label:e("orgs.connections.filterAll")},{id:"active",label:e("orgs.connections.filterActive")},{id:"inactive",label:e("orgs.connections.filterInactive")},{id:"error",label:e("orgs.connections.filterError")}]}]})]}),!C&&H]}),t.jsx(at,{placement:"page",tabs:[{id:"all",label:e("orgs.connections.tabAll")},{id:"connected",label:e("orgs.connections.tabConnected")}],activeTab:u,onTabChange:g=>{const w=g;w!==u&&te("connections_page_tab_changed",{to_tab:w}),l(w)}}),t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:v?.5:1,transition:v?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:v?"none":"auto"},children:t.jsx(pn,{listState:a,activeTab:u,typeFilter:p,statusFilter:f})})})]})})})]})})}function Ls(){const C=q.c(1);let e;return C[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(qe,{children:t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx(hn,{})})}),C[0]=e):e=C[0],e}export{Ls as default};
1
+ import{r as V,c as q,b as ne,j as t,B as L,h as ue,l as he,G as ce,F as Re,I as We,H as Xe,E as qe,Z as Ge,a0 as Ne,d as ke,u as Qe,a as Te,Y as Ye,ae as ye,_ as Je,$ as Ze,aq as et,ap as tt,n as pe,q as te,o as nt,a6 as st,t as W,K as ot}from"./index-CyBVTyGa.js";import{a as we,g as it,e as ct}from"./extract-connection-data-BimwPioU.js";import{C as lt}from"./collection-display-button-ChjN1roR.js";import{S as rt}from"./search-input-0hd-PWUF.js";import{C as at}from"./collection-tabs-3_QvnkN-.js";import{C as Ce,u as Ae,g as dt}from"./connection-card-BOo8yulu.js";import{E as ut}from"./empty-state-BpI78UAU.js";import{u as gt,D as mt}from"./use-delete-connection-Di7K1zHS.js";import{u as pt}from"./use-infinite-scroll-BCiTqxTQ.js";import{u as Ie}from"./use-mobile-CUQu4L8c.js";import{g as de}from"./connection-slug-CITJ0kGN.js";import{A as ft,a as ht,b as xt,c as jt,g as St,d as yt,e as Ct,f as vt}from"./alert-dialog-DeRt3vSN.js";import{aj as xe,bj as bt,ak as _t,b6 as Dt,j as Se}from"./agent-icon-CSebdE0g.js";import{g as Nt,a as kt}from"./metadata-D72DunRR.js";import{d as Pe,h as Me,c as $e,e as Oe,b as Fe,D as Ue}from"./dialog-BG6kEGFR.js";import{D as Tt,a as wt,d as At,b as It,e as Pt,f as Mt,g as $t}from"./drawer-Bl-PPIzX.js";import{F as G,b as Q,c as Y,d as J,f as Z,a as _e}from"./form-Bx8qGby0.js";import{I as se}from"./input-D5Zi_pUc.js";import{S as Ot,b as Ft,a as Ut,d as Vt,c as ae}from"./select-CDhEibGy.js";import{T as Lt}from"./textarea-TE2JJa-B.js";import{b as Ve,u as zt}from"./use-connection-WQuJ5yl_.js";import{m as Et}from"./use-mcp-client-CqKNXJW7.js";import{b as Bt}from"./use-virtual-mcp-Vg_Ogz61.js";import{g as Kt}from"./types-Bxr6Ak0g.js";import{s as Le}from"./Plus-BbELO07z.js";import{a as Ht}from"./UserSquare-CZakdYWe.js";import{s as ze}from"./XClose-D_JLFZFT.js";import{i as fe,a as De,E as Rt,c as Wt,p as Xt,b as qt,d as Gt}from"./connection-form-helpers-D5P5OxyV.js";import{a as Qt}from"./authenticate-and-persist-oauth-B71_ZhsC.js";import{I as Yt}from"./integration-icon-mTqkOE6y.js";import{C as Ee}from"./checkbox-DBYfq56y.js";import{i as Jt}from"./DotsVertical-CAjUqtRp.js";import{s as Be}from"./Eye-B5e-ilzV.js";import{s as Ke}from"./Trash01-BLoRPhD3.js";import"./connection-DR9gf0au.js";import"./ArrowUp-bOLRJZuX.js";import"./Check-DL_AGZMy.js";import"./tooltip-BjUMPvkB.js";import"./index-DtBnPwzh.js";import"./view-mode-toggle-DQkw8yuh.js";import"./badge-DS3KIYvS.js";import"./SearchMd-B1Foybfh.js";import"./useInfiniteQuery-DebjMHv1.js";import"./infiniteQueryObserver-COZ-9XSO.js";import"./slugify-CEUa2lfQ.js";import"./AlertCircle-CVkVxygv.js";import"./Tool01-BvNT4KDI.js";import"./ArrowLeft-CN6aZBvX.js";import"./ArrowRight-FqJnNh3f.js";import"./XCircle-BuDwhQqF.js";import"./ZoomOut-q6Y0RhlM.js";import"./Globe04-_nV993le.js";import"./CheckCircle-DtMp-qqq.js";import"./ChevronUp-B6mY-MC1.js";import"./Copy01-6lOOhJcp.js";import"./CreditCard01-DdYfDHIS.js";import"./Download01-Dq8Pn8XY.js";import"./Share07-B2WnpDWD.js";import"./Image01-CkJtDP-I.js";import"./Key01-BCuGindq.js";import"./LayoutLeft-U0F-Da_p.js";import"./Link01-BjTxU_bP.js";import"./LinkExternal01-DSUCZUJp.js";import"./Monitor01-r707obGd.js";import"./Sun-BKxdX8hu.js";import"./Package-D2jMN__x.js";import"./Palette-DebiHmrq.js";import"./SearchLg-C9MObDBB.js";import"./Stars01-DUL2jKUJ.js";import"./Upload01-CNb1qfRO.js";import"./User01-U5CIC-GP.js";import"./Users01-C6BprSkC.js";import"./X-BNszojyh.js";import"./Zap-BCwjglMw.js";import"./label-DVhvlWqs.js";import"./auth-B-OXMWGw.js";import"./mcp-oauth-DdNMjTqu.js";function Zt(C){const e=`deco-filters-${C}`,[n,d]=V.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[n,o=>{d(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(c){console.error("Failed to save filters:",c)}}]}function en(C){const e=q.c(7),[n,d]=V.useState(C),[s,o]=V.useState(C?"desc":null);let c;e[0]!==s||e[1]!==n?(c=a=>{n!==a?(d(a),o("asc")):s==="asc"?o("desc"):s==="desc"&&(d(void 0),o(null))},e[0]=s,e[1]=n,e[2]=c):c=e[2];const r=c;let m;return e[3]!==r||e[4]!==s||e[5]!==n?(m={sortKey:n,sortDirection:s,handleSort:r},e[3]=r,e[4]=s,e[5]=n,e[6]=m):m=e[6],m}function tn(C,e){const n=q.c(12),d=e===void 0?"cards":e,s=Ie(),o=V.useRef(s),c=C?`deco-view-mode-${C}`:"deco-view-mode";let r;n[0]!==d||n[1]!==c?(r=()=>{const h=globalThis.localStorage?.getItem(c);return h==="cards"||h==="table"?h:d},n[0]=d,n[1]=c,n[2]=r):r=n[2];const[m,a]=V.useState(r);let S;n[3]!==c?(S=h=>{a(h),globalThis.localStorage?.setItem(c,h)},n[3]=c,n[4]=S):S=n[4];const u=S;let l,p;n[5]!==s||n[6]!==m?(l=()=>{!o.current&&s&&m==="table"&&a("cards"),o.current=s},p=[s,m],n[5]=s,n[6]=m,n[7]=l,n[8]=p):(l=n[7],p=n[8]),V.useEffect(l,p);let f;return n[9]!==u||n[10]!==m?(f=[m,u],n[9]=u,n[10]=m,n[11]=f):f=n[11],f}function nn(C){const e=q.c(20),{namespace:n,resource:d,defaultSortKey:s,defaultViewMode:o}=C,c=s===void 0?"title":s,r=o===void 0?"table":o,[m,a]=V.useState(""),S=V.useDeferredValue(m),u=`${n}-${d}`,[l,p]=Zt(u),f=`studio-${d}-filter-visible-${n}`;let h;e[0]!==f?(h=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=h):h=e[1];const[x,D]=V.useState(h);let y;e[2]!==f?(y=F=>{D(F),globalThis.localStorage?.setItem(f,String(F))},e[2]=f,e[3]=y):y=e[3];const v=y;let i;e[4]!==x||e[5]!==v?(i=()=>{v(!x)},e[4]=x,e[5]=v,e[6]=i):i=e[6];const b=i,[k,A]=tn(`studio-${d}-${n}`,r),{sortKey:T,sortDirection:M,handleSort:P}=en(c),$=T;let I;return e[7]!==x||e[8]!==l||e[9]!==P||e[10]!==m||e[11]!==S||e[12]!==v||e[13]!==p||e[14]!==A||e[15]!==M||e[16]!==$||e[17]!==b||e[18]!==k?(I={search:m,searchTerm:S,setSearch:a,filters:l,setFilters:p,filterBarVisible:x,setFilterBarVisible:v,toggleFilterBar:b,viewMode:k,setViewMode:A,sortKey:$,sortDirection:M,handleSort:P},e[7]=x,e[8]=l,e[9]=P,e[10]=m,e[11]=S,e[12]=v,e[13]=p,e[14]=A,e[15]=M,e[16]=$,e[17]=b,e[18]=k,e[19]=I):I=e[19],I}function sn(C){const e=q.c(35),{open:n,onOpenChange:d,count:s,onConfirm:o}=C,c=ne(),r=s===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let m;e[0]!==s||e[1]!==c||e[2]!==r?(m=c(r,{count:s}),e[0]=s,e[1]=c,e[2]=r,e[3]=m):m=e[3];let a;e[4]!==m?(a=t.jsx(ft,{children:m}),e[4]=m,e[5]=a):a=e[5];const S=s===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==c||e[7]!==S?(u=c(S),e[6]=c,e[7]=S,e[8]=u):u=e[8];let l;e[9]!==u?(l=t.jsx(ht,{children:u}),e[9]=u,e[10]=l):l=e[10];let p;e[11]!==a||e[12]!==l?(p=t.jsxs(xt,{children:[a,l]}),e[11]=a,e[12]=l,e[13]=p):p=e[13];let f;e[14]!==c?(f=c("orgs.bulkDeleteDialog.cancelButton"),e[14]=c,e[15]=f):f=e[15];let h;e[16]!==f?(h=t.jsx(jt,{children:f}),e[16]=f,e[17]=h):h=e[17];const x=s===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let D;e[18]!==s||e[19]!==c||e[20]!==x?(D=c(x,{count:s}),e[18]=s,e[19]=c,e[20]=x,e[21]=D):D=e[21];let y;e[22]!==o||e[23]!==D?(y=t.jsx(St,{onClick:o,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:D}),e[22]=o,e[23]=D,e[24]=y):y=e[24];let v;e[25]!==y||e[26]!==h?(v=t.jsxs(yt,{children:[h,y]}),e[25]=y,e[26]=h,e[27]=v):v=e[27];let i;e[28]!==v||e[29]!==p?(i=t.jsxs(Ct,{children:[p,v]}),e[28]=v,e[29]=p,e[30]=i):i=e[30];let b;return e[31]!==d||e[32]!==n||e[33]!==i?(b=t.jsx(vt,{open:n,onOpenChange:d,children:i}),e[31]=d,e[32]=n,e[33]=i,e[34]=b):b=e[34],b}function on(C){const e=q.c(39),{item:n,canManage:d,allConnections:s,connectedAppNames:o,connectingItemId:c,onNavigateConnected:r,onConnect:m}=C,a=ne();let S,u;e[0]!==o||e[1]!==n?(S=we(n)??"",u=o.has(S),e[0]=o,e[1]=n,e[2]=S,e[3]=u):(S=e[2],u=e[3]);const l=u;let p;e[4]!==n._meta?(p=Nt(n._meta),e[4]=n._meta,e[5]=p):p=e[5];const f=p,h=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",x=n.server?.description||n.description||null;let D;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(D=n.server?.icons?.[0]?.src||kt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=D):D=e[8];const y=D;let v;if(e[9]!==s||e[10]!==S){let O;e[12]!==S?(O=H=>H.connection_type!=="VIRTUAL"&&H.app_name===S,e[12]=S,e[13]=O):O=e[13],v=s.filter(O),e[9]=s,e[10]=S,e[11]=v}else v=e[11];const i=v,b=l||d;let k,A;e[14]!==i||e[15]!==l||e[16]!==n||e[17]!==m||e[18]!==r?(k=()=>{if(l){const O=i[0];O&&r(O);return}A()},A=()=>m(n),e[14]=i,e[15]=l,e[16]=n,e[17]=m,e[18]=r,e[19]=k,e[20]=A):(k=e[19],A=e[20]);let T;e[21]!==x||e[22]!==y||e[23]!==h?(T={title:h,description:x,icon:y},e[21]=x,e[22]=y,e[23]=h,e[24]=T):T=e[24];let M;e[25]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(xe,{}),e[25]=M):M=e[25];const P=b?k:void 0;let $;e[26]!==d||e[27]!==c||e[28]!==A||e[29]!==l||e[30]!==n.id||e[31]!==a?($=l?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.catalogItemCard.connected")}):d&&t.jsx(L,{variant:"outline",size:"sm",className:"h-7 px-3 classic:rounded-lg text-sm font-medium",disabled:c!==null,onClick:O=>{O.stopPropagation(),A()},children:c===n.id?t.jsx(ue,{className:"size-3.5"}):a("orgs.catalogItemCard.connect")}),e[26]=d,e[27]=c,e[28]=A,e[29]=l,e[30]=n.id,e[31]=a,e[32]=$):$=e[32];let I;e[33]!==$?(I=t.jsx("div",{className:"flex items-center gap-2",children:$}),e[33]=$,e[34]=I):I=e[34];let F;return e[35]!==T||e[36]!==P||e[37]!==I?(F=t.jsx(Ce,{connection:T,fallbackIcon:M,onClick:P,headerActionsAlwaysVisible:!0,headerActions:I}),e[35]=T,e[36]=P,e[37]=I,e[38]=F):F=e[38],F}function cn(C){return C?.length?{appToolName:C.find(n=>!!Kt(n._meta))?.name??null}:null}function He(C){const e=q.c(8),{selectionMode:n,children:d}=C,s=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let o;e[0]!==s?(o=he("overflow-hidden transition-all duration-150 ease-out",s),e[0]=s,e[1]=o):o=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Re,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:rn,children:t.jsx(Jt,{size:20})})}),e[2]=c):c=e[2];let r;e[3]!==d?(r=t.jsxs(We,{children:[c,t.jsx(Xe,{align:"end",onClick:ln,children:d})]}),e[3]=d,e[4]=r):r=e[4];let m;return e[5]!==o||e[6]!==r?(m=t.jsx("div",{className:o,children:r}),e[5]=o,e[6]=r,e[7]=m):m=e[7],m}function ln(C){return C.stopPropagation()}function rn(C){return C.stopPropagation()}function an(C){const e=q.c(57),{group:n,onOpen:d,selectionMode:s,selectedIds:o,onToggleSelect:c}=C,r=ne();let m;if(e[0]!==n.connections||e[1]!==o){let g;e[3]!==o?(g=w=>o.has(w.id),e[3]=o,e[4]=g):g=e[4],m=n.connections.every(g),e[0]=n.connections,e[1]=o,e[2]=m}else m=e[2];const a=m;let S;if(e[5]!==n.connections||e[6]!==o){let g;e[8]!==o?(g=w=>o.has(w.id),e[8]=o,e[9]=g):g=e[9],S=n.connections.some(g),e[5]=n.connections,e[6]=o,e[7]=S}else S=e[7];const u=S;let l;e[10]!==a||e[11]!==n.connections||e[12]!==c||e[13]!==o?(l=()=>{for(const g of n.connections)a?o.has(g.id)&&c(g.id):o.has(g.id)||c(g.id)},e[10]=a,e[11]=n.connections,e[12]=c,e[13]=o,e[14]=l):l=e[14];const p=l,f=n.title,h=n.icon;let x;e[15]!==n.connections.length||e[16]!==r?(x=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=x):x=e[17];let D;e[18]!==n.icon||e[19]!==n.title||e[20]!==x?(D={title:f,icon:h,description:x},e[18]=n.icon,e[19]=n.title,e[20]=x,e[21]=D):D=e[21];let y;e[22]!==d||e[23]!==s||e[24]!==p?(y=()=>s?p():d(),e[22]=d,e[23]=s,e[24]=p,e[25]=y):y=e[25];const v=s&&a&&"ring-2 ring-primary",i=s&&u&&!a&&"ring-1 ring-primary/50";let b;e[26]!==i||e[27]!==v?(b=he(v,i),e[26]=i,e[27]=v,e[28]=b):b=e[28];const k=s?a?!0:u&&"mixed":void 0;let A;e[29]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(xe,{}),e[29]=A):A=e[29];let T;e[30]!==a||e[31]!==n.connections.length||e[32]!==s||e[33]!==u||e[34]!==r||e[35]!==p?(T=s?t.jsx(Ee,{checked:a?!0:u?"indeterminate":!1,onCheckedChange:p}):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]=a,e[31]=n.connections.length,e[32]=s,e[33]=u,e[34]=r,e[35]=p,e[36]=T):T=e[36];let M;e[37]!==d?(M=g=>{g.stopPropagation(),d()},e[37]=d,e[38]=M):M=e[38];let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Be,{size:16}),e[39]=P):P=e[39];let $;e[40]!==r?($=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=$):$=e[41];let I;e[42]!==M||e[43]!==$?(I=t.jsxs(ce,{onClick:M,children:[P,$]}),e[42]=M,e[43]=$,e[44]=I):I=e[44];let F;e[45]!==s||e[46]!==I?(F=t.jsx(He,{selectionMode:s,children:I}),e[45]=s,e[46]=I,e[47]=F):F=e[47];let O;e[48]!==T||e[49]!==F?(O=t.jsxs("div",{className:"flex items-center gap-1",children:[T,F]}),e[48]=T,e[49]=F,e[50]=O):O=e[50];let H;return e[51]!==b||e[52]!==k||e[53]!==O||e[54]!==D||e[55]!==y?(H=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:D,onClick:y,className:b,selected:k,fallbackIcon:A,headerActionsAlwaysVisible:!0,headerActions:O})}),e[51]=b,e[52]=k,e[53]=O,e[54]=D,e[55]=y,e[56]=H):H=e[56],H}function dn(C){const e=q.c(36),{connection:n,isSelected:d,selectionMode:s,canManage:o,canManageAgents:c,onToggleSelect:r,onOpen:m,onToggleStatus:a,onDelete:S}=C,u=ne();let l;e[0]!==d||e[1]!==r||e[2]!==s||e[3]!==u?(l=s?t.jsx(Ee,{checked:d,onCheckedChange:r,onClick:un}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=d,e[1]=r,e[2]=s,e[3]=u,e[4]=l):l=e[4];let p;e[5]!==m?(p=k=>{k.stopPropagation(),m()},e[5]=m,e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Be,{size:16}),e[7]=f):f=e[7];let h;e[8]!==u?(h=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=h):h=e[9];let x;e[10]!==p||e[11]!==h?(x=t.jsxs(ce,{onClick:p,children:[f,h]}),e[10]=p,e[11]=h,e[12]=x):x=e[12];let D;e[13]!==o||e[14]!==c||e[15]!==r||e[16]!==u?(D=(o||c)&&t.jsxs(ce,{onClick:k=>{k.stopPropagation(),r()},children:[t.jsx(bt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=o,e[14]=c,e[15]=r,e[16]=u,e[17]=D):D=e[17];let y;e[18]!==o||e[19]!==n||e[20]!==a||e[21]!==u?(y=o&&(n.status==="active"?t.jsxs(ce,{onClick:k=>{k.stopPropagation(),a("inactive")},children:[t.jsx(_t,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ce,{onClick:k=>{k.stopPropagation(),a("active")},children:[t.jsx(Dt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=o,e[19]=n,e[20]=a,e[21]=u,e[22]=y):y=e[22];let v;e[23]!==o||e[24]!==S||e[25]!==u?(v=o&&t.jsxs(ce,{variant:"destructive",onClick:k=>{k.stopPropagation(),S()},children:[t.jsx(Ke,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=o,e[24]=S,e[25]=u,e[26]=v):v=e[26];let i;e[27]!==s||e[28]!==x||e[29]!==D||e[30]!==y||e[31]!==v?(i=t.jsxs(He,{selectionMode:s,children:[x,D,y,v]}),e[27]=s,e[28]=x,e[29]=D,e[30]=y,e[31]=v,e[32]=i):i=e[32];let b;return e[33]!==l||e[34]!==i?(b=t.jsxs("div",{className:"flex items-center gap-1",children:[l,i]}),e[33]=l,e[34]=i,e[35]=b):b=e[35],b}function un(C){return C.stopPropagation()}function gn(C){const e=q.c(29),{count:n,total:d,canManage:s,canManageAgents:o,onSelectAll:c,onDeselectAll:r,onDelete:m,onAddToAgent:a,onToggleStatus:S,onCancel:u}=C,l=ne();if(n===0)return null;let p;e[0]!==n||e[1]!==l?(p=l("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=l,e[2]=p):p=e[2];let f;e[3]!==p?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:p}),e[3]=p,e[4]=f):f=e[4];let h;e[5]!==n||e[6]!==r||e[7]!==c||e[8]!==l||e[9]!==d?(h=n<d?t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:l("orgs.connectionSelectionUi.selectAll",{total:d})}):t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:l("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=c,e[8]=l,e[9]=d,e[10]=h):h=e[10];let x;e[11]!==o||e[12]!==a||e[13]!==l?(x=o&&t.jsxs(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:[t.jsx(Le,{size:13}),l("orgs.connectionSelectionUi.addToAgent")]}),e[11]=o,e[12]=a,e[13]=l,e[14]=x):x=e[14];let D;e[15]!==s||e[16]!==m||e[17]!==S||e[18]!==l?(D=s&&t.jsxs(t.Fragment,{children:[t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>S("active"),children:l("orgs.connectionSelectionUi.enable")}),t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>S("inactive"),children:l("orgs.connectionSelectionUi.disable")}),t.jsxs(L,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:[t.jsx(Ke,{size:13}),l("orgs.connectionSelectionUi.delete")]})]}),e[15]=s,e[16]=m,e[17]=S,e[18]=l,e[19]=D):D=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ze,{size:13}),e[20]=y):y=e[20];let v;e[21]!==u?(v=t.jsx(L,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:y}),e[21]=u,e[22]=v):v=e[22];let i;return e[23]!==f||e[24]!==h||e[25]!==x||e[26]!==D||e[27]!==v?(i=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[f,h,x,D,v]})}),e[23]=f,e[24]=h,e[25]=x,e[26]=D,e[27]=v,e[28]=i):i=e[28],i}function mn(C){const e=q.c(45),{open:n,onOpenChange:d,agents:s,onConfirm:o}=C,c=ne(),[r,m]=V.useState(null);let a;e[0]!==c?(a=c("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=c,e[1]=a):a=e[1];let S;e[2]!==a?(S=t.jsx(Pe,{children:a}),e[2]=a,e[3]=S):S=e[3];let u;e[4]!==c?(u=c("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=c,e[5]=u):u=e[5];let l;e[6]!==u?(l=t.jsx(Me,{children:u}),e[6]=u,e[7]=l):l=e[7];let p;e[8]!==S||e[9]!==l?(p=t.jsxs($e,{children:[S,l]}),e[8]=S,e[9]=l,e[10]=p):p=e[10];let f;e[11]!==s||e[12]!==r||e[13]!==c?(f=s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:c("orgs.connectionSelectionUi.noAgentsFound")}):s.map(P=>t.jsxs("button",{type:"button",onClick:()=>m(P.id),className:he("flex items-center gap-3 w-full classic:rounded-md compact:rounded-lg px-3 py-2 text-left transition-colors",r===P.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Yt,{icon:P.icon,name:P.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:P.title}),P.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:P.description})]})]},P.id)),e[11]=s,e[12]=r,e[13]=c,e[14]=f):f=e[14];let h;e[15]!==f?(h=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:f}),e[15]=f,e[16]=h):h=e[16];let x;e[17]!==d?(x=()=>d(!1),e[17]=d,e[18]=x):x=e[18];let D;e[19]!==c?(D=c("orgs.connectionSelectionUi.cancel"),e[19]=c,e[20]=D):D=e[20];let y;e[21]!==x||e[22]!==D?(y=t.jsx(L,{variant:"outline",onClick:x,children:D}),e[21]=x,e[22]=D,e[23]=y):y=e[23];const v=!r;let i;e[24]!==o||e[25]!==d||e[26]!==r?(i=()=>{r&&(o(r),d(!1),m(null))},e[24]=o,e[25]=d,e[26]=r,e[27]=i):i=e[27];let b;e[28]!==c?(b=c("orgs.connectionSelectionUi.add"),e[28]=c,e[29]=b):b=e[29];let k;e[30]!==v||e[31]!==i||e[32]!==b?(k=t.jsx(L,{disabled:v,onClick:i,children:b}),e[30]=v,e[31]=i,e[32]=b,e[33]=k):k=e[33];let A;e[34]!==y||e[35]!==k?(A=t.jsxs(Oe,{children:[y,k]}),e[34]=y,e[35]=k,e[36]=A):A=e[36];let T;e[37]!==A||e[38]!==p||e[39]!==h?(T=t.jsxs(Fe,{className:"sm:max-w-[400px]",children:[p,h,A]}),e[37]=A,e[38]=p,e[39]=h,e[40]=T):T=e[40];let M;return e[41]!==d||e[42]!==n||e[43]!==T?(M=t.jsx(Ue,{open:n,onOpenChange:d,children:T}),e[41]=d,e[42]=n,e[43]=T,e[44]=M):M=e[44],M}function pn({listState:C,activeTab:e,typeFilter:n,statusFilter:d}){const s=ne(),{org:o}=Ne(),c=nt(),r=ke(),{data:m}=Te.useSession(),a=Ve(),S=zt(C),u=gt(),{granted:l}=ye("connections:manage"),{granted:p}=ye("agents:manage"),[f,h]=V.useState(new Set),x=f.size>0,[D,y]=V.useState(!1),[v,i]=V.useState(!1),[b,k]=V.useState(null),A=Bt(),T=S.filter(_=>!(n!=="ALL"&&_.connection_type!==n||d!=="ALL"&&_.status!==d)),M=dt(T),P=_=>{h(j=>{const E=new Set(j);return E.has(_)?E.delete(_):E.add(_),E})},$=()=>{h(new Set)},I=Ae(C.searchTerm),F=I.items,O=pt(I.loadMore,I.hasMore,I.isLoadingMore),H=new Set(S.filter(_=>_.app_name).map(_=>_.app_name)),g=C.search.length>0,w=e==="all"||g?F.filter(_=>{if(g){const j=we(_);if(j&&H.has(j))return!1}return!0}):[],R=e==="connected"||g?M:[],ee=async _=>{if(!(!o||!m?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),k(_.id);try{const j=ct(_,o.id,m.user.id,{remoteIndex:0}),E=j.connection_type==="STDIO",K=!!j.connection_url,B=E&&j.connection_headers&&typeof j.connection_headers=="object"&&"command"in j.connection_headers;if(!K&&!B){W.error(s("orgs.connections.cannotConnectNoMethod")),k(null);return}const oe=await a.create.mutateAsync(j),{id:ie}=oe,le=await Qt({connectionId:ie,orgId:o.id,orgSlug:o.slug,persistFallback:re=>a.update.mutateAsync({id:ie,data:{connection_token:re}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ie,flow:"connections_page_connect",error:le.error??"no_token"}),W.error(s("orgs.connections.authenticationFailed",{error:le.error??"no token received"}));return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ie,flow:"connections_page_connect"});const re=new URL(`/api/${o.slug}/mcp/${ie}`,window.location.origin);await c.invalidateQueries({queryKey:ot.isMCPAuthenticated(re.href,null)}),N(),W.success(s("orgs.connections.authenticationSuccessful"))}let me=null;try{const re=await c.fetchQuery(Et({connectionId:ie,orgId:o.id,orgSlug:o.slug}));me=cn((await re.listTools()).tools)}catch{}const ve=de(oe),be=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o.slug,appSlug:ve,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ve}}:null;W.success(s("orgs.connections.connectedSuccessfully"),be?{action:{label:s("orgs.connections.openConnection"),onClick:()=>r(be)}}:void 0)}catch(j){W.error(s("orgs.connections.failedToConnect",{error:j instanceof Error?j.message:String(j)}))}finally{k(null)}}},X=st(),N=()=>{c.invalidateQueries({predicate:_=>{const j=_.queryKey;return j[1]===o.id&&j[3]==="collection"&&j[4]==="CONNECTIONS"}})},z=async()=>{y(!1);const _=[...f];te("connections_bulk_delete",{count:_.length});const E=(await Promise.allSettled(_.map(K=>X.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;N(),W.success(s("orgs.connections.deletedConnections",{count:E})),$()},U=async(_,j)=>{try{await a.update.mutateAsync({id:_,data:{status:j}}),N(),W.success(s(j==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{W.error(s("orgs.connections.failedToUpdateConnection"))}},ge=async _=>{const j=[...f];te("connections_bulk_status_toggled",{count:j.length,to_status:_});const K=(await Promise.allSettled(j.map(B=>a.update.mutateAsync({id:B,data:{status:_}})))).filter(B=>B.status==="fulfilled").length;N(),W.success(_==="active"?s("orgs.connections.enabledConnections",{count:K}):s("orgs.connections.disabledConnections",{count:K})),$()},je=async _=>{const j=A.find(B=>B.id===_);if(!j)return;te("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const E=new Set(j.connections.map(B=>B.connection_id)),K=[...f].filter(B=>!E.has(B)).map(B=>({connection_id:B,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){W.info(s("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await X.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...j.connections,...K]}}),c.invalidateQueries({predicate:B=>{const oe=B.queryKey;return oe[1]===o.id&&oe[3]==="collection"&&oe[4]==="VIRTUAL_MCP"}}),W.success(s("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:j.title})),$()}catch{W.error(s("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(mt,{...u}),t.jsx(sn,{open:D,onOpenChange:y,count:f.size,onConfirm:z}),t.jsx(mn,{open:v,onOpenChange:i,agents:A,onConfirm:je}),I.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(g?w.length===0&&T.length===0:e==="all"?w.length===0:T.length===0)?t.jsx(ut,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:s("orgs.connections.noConnectionsFound"),description:C.search?s("orgs.connections.noConnectionsMatchSearch",{search:C.search}):s(l?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(_=>{if(_.type==="group")return t.jsx(an,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:_.key}})},selectionMode:x,selectedIds:f,onToggleSelect:P},_.key);const j=_.connection,E=f.has(j.id);return t.jsx(Ce,{connection:j,fallbackIcon:t.jsx(xe,{}),onClick:()=>x?P(j.id):r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),className:he(E&&"ring-2 ring-primary bg-primary/5"),selected:x?E:void 0,headerActionsAlwaysVisible:!0,headerActions:t.jsx(dn,{connection:j,isSelected:E,selectionMode:x,canManage:l,canManageAgents:p,onToggleSelect:()=>P(j.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),onToggleStatus:K=>U(j.id,K),onDelete:()=>u.requestDelete(j)})},j.id)}),w.map(_=>t.jsx(on,{item:_,canManage:l,allConnections:S,connectedAppNames:H,connectingItemId:b,onNavigateConnected:j=>r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),onConnect:ee},_.id)),(e==="all"||g)&&t.jsx("div",{ref:O,className:"col-span-full h-4"}),(e==="all"||g)&&I.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ue,{className:"size-6 text-muted-foreground"})})]})}),x&&t.jsx(gn,{count:f.size,total:T.length,canManage:l,canManageAgents:p,onSelectAll:()=>{h(new Set(T.map(_=>_.id)))},onDeselectAll:()=>h(new Set),onDelete:()=>y(!0),onAddToAgent:()=>i(!0),onToggleStatus:ge,onCancel:$})]})}function fn(){const C=Ge(),e=ne(),{org:n}=Ne(),d=ke(),s=Qe({strict:!1}),{data:o}=Te.useSession(),{stdioEnabled:c}=Ye(),r=Ie(),{granted:m}=ye("connections:manage"),a=nn({namespace:n.slug,resource:"connections"}),S=Ve(),[u,l]=Je(Ze.connectionsTab(n.slug),g=>s.tab==="all"||s.tab==="connected"?s.tab:g??"all"),[p,f]=V.useState("ALL"),[h,x]=V.useState("ALL"),y=Ae(a.searchTerm).items,v=a.search!==a.searchTerm,i=et({resolver:tt(Wt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),b=i.watch("ui_type"),k=i.watch("connection_url"),A=i.watch("npx_package"),T=fe({uiType:b,connectionUrl:k??"",npxPackage:A??""})??De({uiType:b,connectionUrl:k??"",registryItems:y}),M=m&&s.action==="create",P=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),d({to:"/$org/settings/connections",params:{org:n.slug},search:{action:"create"}})},$=()=>{d({to:"/$org/settings/connections",params:{org:n.slug},search:{}})},I=async g=>{let w,R=null,ee=null,X=null;g.ui_type==="NPX"?(w="STDIO",R="",X=qt(g.npx_package||"",g.env_vars||[])):g.ui_type==="STDIO"?(w="STDIO",R="",X=Gt(g.stdio_command||"",g.stdio_args||"",g.stdio_cwd,g.env_vars||[])):(w=g.ui_type,R=g.connection_url||"",ee=g.connection_token||null);const N=it("conn");te("connection_custom_created",{connection_type:w,ui_type:g.ui_type}),await S.create.mutateAsync({id:N,title:g.title,description:g.description||null,connection_type:w,connection_url:R,connection_token:ee,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:n.id,icon:g.icon??null,app_name:null,app_id:null,connection_headers:X,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),$(),i.reset(),d({to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:de({app_name:null,connection_url:R,title:g.title,id:N})}})},F=g=>{g||(M&&$(),i.reset())},O=g=>{const w=g.trim();if(!w)return;const R=!!i.formState.dirtyFields.title,ee=!!i.formState.dirtyFields.description,X=!!i.formState.dirtyFields.env_vars,N=U=>{if(U&&(!R&&!i.getValues("title").trim()&&U.title&&i.setValue("title",U.title,{shouldDirty:!1}),!ee&&!(i.getValues("description")??"").trim()&&U.description&&i.setValue("description",U.description,{shouldDirty:!1}),!X&&U.envVarKeys?.length)){const ge=i.getValues("env_vars")??[],je=new Set(ge.map(j=>j.key)),_=U.envVarKeys.filter(j=>!je.has(j));_.length>0&&i.setValue("env_vars",[...ge,..._.map(j=>({key:j,value:""}))],{shouldDirty:!0})}},z=Xt(w);if(z&&c){i.setValue("ui_type","NPX",{shouldDirty:!0}),i.setValue("npx_package",z.packageName,{shouldDirty:!0}),i.setValue("connection_url","",{shouldDirty:!0}),i.setValue("connection_token",null,{shouldDirty:!0}),N(fe({uiType:"NPX",npxPackage:z.packageName}));return}if(w.startsWith("http://")||w.startsWith("https://")){const U=b==="HTTP"||b==="SSE"||b==="Websocket"?b:"HTTP";i.setValue("ui_type",U,{shouldDirty:!0}),i.setValue("connection_url",w,{shouldDirty:!0}),N(fe({uiType:U,connectionUrl:w})??De({uiType:U,connectionUrl:w,registryItems:y}));return}b==="NPX"&&N(fe({uiType:"NPX",npxPackage:w}))},H=m?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(L,{size:C?"sm":"default",variant:C?"default":"outline",onClick:P,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:e("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const g=e("orgs.connections.createConnection"),w=e("orgs.connections.createConnectionDescription"),R=i.formState.isSubmitting?e("orgs.connections.saving"):e("orgs.connections.createConnection"),ee=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(G,{control:i.control,name:"ui_type",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.type")}),t.jsxs(Ot,{value:N.value,onValueChange:N.onChange,children:[t.jsx(J,{children:t.jsx(Ft,{children:t.jsx(Ut,{})})}),t.jsxs(Vt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),c&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),e("orgs.connections.npxPackage")]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),e("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),b==="NPX"&&t.jsx(G,{control:i.control,name:"npx_package",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.npmPackage")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.npmPackagePlaceholder"),...N,value:N.value??"",onPaste:z=>{const U=z.clipboardData.getData("text");U&&(z.preventDefault(),i.setValue("npx_package",U.trim(),{shouldDirty:!0}),O(U))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Z,{})]})}),b==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(G,{control:i.control,name:"stdio_command",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.command")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.commandPlaceholder"),...N,value:N.value??""})}),t.jsx(Z,{})]})}),t.jsx(G,{control:i.control,name:"stdio_args",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.arguments")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.argumentsPlaceholder"),...N,value:N.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(G,{control:i.control,name:"stdio_cwd",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.workingDirectory")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.workingDirectoryPlaceholder"),...N,value:N.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(b==="NPX"||b==="STDIO")&&t.jsx(G,{control:i.control,name:"env_vars",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.environmentVariables")}),t.jsx(J,{children:t.jsx(Rt,{value:N.value??[],onChange:N.onChange})}),t.jsx(Z,{})]})}),b!=="NPX"&&b!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(G,{control:i.control,name:"connection_url",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.url")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.urlPlaceholder"),...N,value:N.value??"",onPaste:z=>{const U=z.clipboardData.getData("text");U&&(z.preventDefault(),i.setValue("connection_url",U.trim(),{shouldDirty:!0}),O(U))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(G,{control:i.control,name:"connection_token",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:T?.token?.label??e("orgs.connections.tokenOptional")}),t.jsx(J,{children:t.jsx(se,{type:"password",placeholder:T?.token?.placeholder??e("orgs.connections.tokenPlaceholder"),...N,value:N.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:e("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(G,{control:i.control,name:"title",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.name")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.namePlaceholder"),...N})}),t.jsx(Z,{})]})}),t.jsx(G,{control:i.control,name:"description",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.description")}),t.jsx(J,{children:t.jsx(Lt,{placeholder:e("orgs.connections.descriptionPlaceholder"),rows:3,...N,value:N.value??""})}),t.jsx(Z,{})]})})]}),X=M;return r?t.jsx(Tt,{open:X,onOpenChange:F,children:t.jsxs(wt,{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(It,{children:g}),t.jsx(Pt,{className:"mt-1",children:w})]}),t.jsx(Mt,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":e("orgs.connections.close"),children:t.jsx(ze,{size:16})})})]})}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(I),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:ee}),t.jsx($t,{children:t.jsx(L,{type:"submit",disabled:i.formState.isSubmitting,className:"w-full",children:R})})]})})]})}):t.jsx(Ue,{open:X,onOpenChange:F,children:t.jsxs(Fe,{className:"sm:max-w-[525px]",children:[t.jsxs($e,{children:[t.jsx(Pe,{children:g}),t.jsx(Me,{children:w})]}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(I),children:[t.jsx("div",{className:"py-4",children:ee}),t.jsxs(Oe,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>F(!1),children:e("orgs.connections.cancel")}),t.jsx(L,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:R})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{actions:C&&H,children:e("orgs.connections.pageTitle")}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(rt,{value:a.search,onChange:a.setSearch,placeholder:e("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:g=>{g.key==="Escape"&&(a.setSearch(""),g.target.blur())}}),t.jsx(lt,{sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:e("orgs.connections.sortName")},{id:"description",label:e("orgs.connections.sortDescription")},{id:"connection_type",label:e("orgs.connections.sortType")},{id:"updated_by",label:e("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:e("orgs.connections.sortUpdated")}],filters:[{label:e("orgs.connections.filterType"),value:p,onChange:g=>f(g||"ALL"),options:[{id:"ALL",label:e("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:e("orgs.connections.filterStatus"),value:h,onChange:g=>x(g||"ALL"),options:[{id:"ALL",label:e("orgs.connections.filterAll")},{id:"active",label:e("orgs.connections.filterActive")},{id:"inactive",label:e("orgs.connections.filterInactive")},{id:"error",label:e("orgs.connections.filterError")}]}]})]}),!C&&H]}),t.jsx(at,{placement:"page",tabs:[{id:"all",label:e("orgs.connections.tabAll")},{id:"connected",label:e("orgs.connections.tabConnected")}],activeTab:u,onTabChange:g=>{const w=g;w!==u&&te("connections_page_tab_changed",{to_tab:w}),l(w)}}),t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:v?.5:1,transition:v?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:v?"none":"auto"},children:t.jsx(pn,{listState:a,activeTab:u,typeFilter:p,statusFilter:h})})})]})})})]})})}function Ls(){const C=q.c(1);let e;return C[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(qe,{children:t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx(fn,{})})}),C[0]=e):e=C[0],e}export{Ls as default};