decocms 4.321.1 → 4.321.2

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 (253) hide show
  1. package/dist/client/assets/{AlertCircle-DTA-xmN8.js → AlertCircle-mzPvygUw.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DWzH4cl2.js → AreaChart-DpI9x93q.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DJHyaGVg.js → ArrowLeft-Bp9N4N0-.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-B56zz92l.js → ArrowUp-Yj21fZGL.js} +1 -1
  5. package/dist/client/assets/{Check-yANPvlWH.js → Check-DFpZ57WE.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-CEm5M3Tl.js → CheckCircle-BL9fUGh0.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-D_8iRnVD.js → ChevronRight-B0k8i06h.js} +1 -1
  8. package/dist/client/assets/{ChevronSelectorVertical-CDr8Ovfg.js → ChevronSelectorVertical-C36SdIlf.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-D9JVuW7G.js → ChevronUp-DoFbOo5V.js} +1 -1
  10. package/dist/client/assets/{Copy01-ZnkwptEM.js → Copy01-DQrZ6li-.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-DBOo-aYq.js → CreditCard01-BwmXIXJx.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-mvRvTh6x.js → DotsVertical-DJWfzfak.js} +1 -1
  13. package/dist/client/assets/{Download01-CeBHR-fX.js → Download01-DsQzO8cd.js} +1 -1
  14. package/dist/client/assets/{ErrorBarContext-CMbUifoM.js → ErrorBarContext-CJd0p0QO.js} +1 -1
  15. package/dist/client/assets/{Eye-ggEjyhYq.js → Eye-BC_4l4lG.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-DZEodcVR.js → GitBranch01-C4EIccIA.js} +1 -1
  17. package/dist/client/assets/{Globe01-Dj13xfTI.js → Globe01-DHMT8bp9.js} +1 -1
  18. package/dist/client/assets/{HardDrive-Bkrrs0FV.js → HardDrive-DO3IjmaH.js} +1 -1
  19. package/dist/client/assets/{Image01-DfTbYbFE.js → Image01-C4TVJnST.js} +1 -1
  20. package/dist/client/assets/{Key01-BBxtRrGm.js → Key01-a9vi-Tku.js} +1 -1
  21. package/dist/client/assets/{Link01-DUUbBvGo.js → Link01-BWge3x25.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-61qG-hFo.js → LinkExternal01-qomjjlr4.js} +1 -1
  23. package/dist/client/assets/{LockUnlocked01-BfX9zVyU.js → LockUnlocked01-BD5ISYeA.js} +1 -1
  24. package/dist/client/assets/{Monitor01-Cvj67Ryv.js → Monitor01-BB9oelwa.js} +1 -1
  25. package/dist/client/assets/{Package-B4jzjbE8.js → Package-DRO-nel6.js} +1 -1
  26. package/dist/client/assets/{Palette-CXReGsk_.js → Palette-CzJtqmLV.js} +1 -1
  27. package/dist/client/assets/{Play-kr1GKsAc.js → Play-BOlL7p4H.js} +1 -1
  28. package/dist/client/assets/{Plus-Bz1cAYCY.js → Plus-B4HOF1E1.js} +1 -1
  29. package/dist/client/assets/{SearchMd-DN6cu6SZ.js → SearchMd-BL3yOzl8.js} +1 -1
  30. package/dist/client/assets/{Sector-DidaJ4gW.js → Sector-B66RdjM2.js} +1 -1
  31. package/dist/client/assets/{Settings02-C39ViKVB.js → Settings02-Bj1lDwij.js} +1 -1
  32. package/dist/client/assets/{Share07-vMCtuazW.js → Share07-K9acKdZ2.js} +1 -1
  33. package/dist/client/assets/{Shield01-SPzOFIU1.js → Shield01-B2le5qB9.js} +1 -1
  34. package/dist/client/assets/{Stars01-q62Ogx-P.js → Stars01-DBkTEhiq.js} +1 -1
  35. package/dist/client/assets/{Sun-B3CG15-H.js → Sun-v51TgHoC.js} +1 -1
  36. package/dist/client/assets/{ThumbsUp-DV6K5Csu.js → ThumbsUp-DZtUuNqz.js} +1 -1
  37. package/dist/client/assets/{Tool01-DP3BW23e.js → Tool01-3TSBet75.js} +1 -1
  38. package/dist/client/assets/{Tool02-DT-zZ1ks.js → Tool02-CUjmmZmP.js} +1 -1
  39. package/dist/client/assets/{Trash01-D5j2YoAs.js → Trash01-RcSuYrVJ.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-CaNIYwx8.js → TrendUp01-B1pPYfuK.js} +1 -1
  41. package/dist/client/assets/{Upload01-DSJ1fWRp.js → Upload01-lXk5j7xP.js} +1 -1
  42. package/dist/client/assets/{User01-Bq-AsdvG.js → User01-AECGy6qL.js} +1 -1
  43. package/dist/client/assets/{UserSquare-DGuYrk9Q.js → UserSquare-DAvB_kFJ.js} +1 -1
  44. package/dist/client/assets/{Users01-CS6rfCga.js → Users01-BgVgHDh8.js} +1 -1
  45. package/dist/client/assets/{Users03-BnbWbfJy.js → Users03-B7rH-Prq.js} +1 -1
  46. package/dist/client/assets/{XCircle-Dlv7pZja.js → XCircle-BcRsQfbp.js} +1 -1
  47. package/dist/client/assets/{XClose-BNIppwTn.js → XClose-CfMSoySe.js} +1 -1
  48. package/dist/client/assets/{Zap-CywbYsFI.js → Zap-B1-2Q3w4.js} +1 -1
  49. package/dist/client/assets/{ZoomOut-jLe5z2Gu.js → ZoomOut-CN3_bE81.js} +1 -1
  50. package/dist/client/assets/{access-gate-CgF7Ajgl.js → access-gate-Bqb_IoZo.js} +1 -1
  51. package/dist/client/assets/{agent-icon-D-9pJpLD.js → agent-icon-9NxB5SOp.js} +1 -1
  52. package/dist/client/assets/{agents-list-Bp5Z7NYF.js → agents-list-C76JNu3A.js} +1 -1
  53. package/dist/client/assets/{ai-providers-BxXtxvrC.js → ai-providers-BaeUPfRB.js} +1 -1
  54. package/dist/client/assets/{alert-DlKRUXrR.js → alert-4OAU_nBA.js} +1 -1
  55. package/dist/client/assets/{alert-dialog-D3FLXTEj.js → alert-dialog-CcHS-XLY.js} +1 -1
  56. package/dist/client/assets/{analytics-tab-BfjNGR6F.js → analytics-tab-BCxp8jRR.js} +1 -1
  57. package/dist/client/assets/api-keys-B1rGBGLW.js +1 -0
  58. package/dist/client/assets/{api-keys-DyNVpi-W.js → api-keys-gIqXyv9f.js} +1 -1
  59. package/dist/client/assets/app-editor-CO_1PqE8.js +1 -0
  60. package/dist/client/assets/{auth-CeWlFDdC.js → auth-7gOJrCJs.js} +1 -1
  61. package/dist/client/assets/{auth-catchall-D7POTu6Q.js → auth-catchall-DUFwyN0I.js} +1 -1
  62. package/dist/client/assets/{auth-entry-COCcX5A_.js → auth-entry-CmvczzF5.js} +1 -1
  63. package/dist/client/assets/{auth-split-layout-BG8u1Dhb.js → auth-split-layout-CdiwAUW1.js} +1 -1
  64. package/dist/client/assets/{authenticate-and-persist-oauth-CxGKh8aj.js → authenticate-and-persist-oauth-BSmdaYES.js} +1 -1
  65. package/dist/client/assets/{automation-list-row-Dr9aH5cl.js → automation-list-row-vaYTAqBr.js} +1 -1
  66. package/dist/client/assets/{automation-runs-D-MsqDZA.js → automation-runs-CH0DGbop.js} +1 -1
  67. package/dist/client/assets/{automations-DmzNjC10.js → automations-DS-29qSN.js} +1 -1
  68. package/dist/client/assets/{avatar-CsipcR4h.js → avatar-gFJWL-Vg.js} +1 -1
  69. package/dist/client/assets/{badge-Cr2fQRq8.js → badge-DU8Pt1Ge.js} +1 -1
  70. package/dist/client/assets/{block-document-CPpzuDJ1.js → block-document-B-APilfu.js} +1 -1
  71. package/dist/client/assets/{breadcrumb-BOw37uby.js → breadcrumb-TNKPI3dS.js} +1 -1
  72. package/dist/client/assets/{buckets-BhMvQpB6.js → buckets-rWwZp5wi.js} +1 -1
  73. package/dist/client/assets/{bulk-category-panel-lgnUhRZs.js → bulk-category-panel-Dmla31YZ.js} +1 -1
  74. package/dist/client/assets/{capability-load-error-D2I8YlS5.js → capability-load-error-BsnWRA5W.js} +1 -1
  75. package/dist/client/assets/{cards-Ckz_jSmB.js → cards-GrxitjN9.js} +1 -1
  76. package/dist/client/assets/{category-editor-CUeNF_8r.js → category-editor-CJqNv7_k.js} +1 -1
  77. package/dist/client/assets/{cdn-tab-EuSTLp5_.js → cdn-tab-CGwd_rBy.js} +1 -1
  78. package/dist/client/assets/{chart-BIwqiDqG.js → chart-Ctqg6c-J.js} +1 -1
  79. package/dist/client/assets/{chat-context-oSgRN_kR.js → chat-context-E6CzjtFL.js} +6 -6
  80. package/dist/client/assets/{checkbox-DRf1c0rh.js → checkbox-DoENx1Tp.js} +1 -1
  81. package/dist/client/assets/{choose-editor-Pdurttdh.js → choose-editor-6iE-NUNZ.js} +1 -1
  82. package/dist/client/assets/{cli-auth-success-CAWRFjR6.js → cli-auth-success-wrrg72SU.js} +1 -1
  83. package/dist/client/assets/{client-icons-BFT3ByhX.js → client-icons-DZ-wX-6W.js} +1 -1
  84. package/dist/client/assets/{collection-detail-B9Md04g8.js → collection-detail-BaCsEwRG.js} +1 -1
  85. package/dist/client/assets/{collection-display-button-DWOMOsAO.js → collection-display-button-DakfldYj.js} +1 -1
  86. package/dist/client/assets/{collection-search-lJZ_AiYh.js → collection-search-Bfeg8_4N.js} +1 -1
  87. package/dist/client/assets/{collection-table-wrapper-DvYmVRqQ.js → collection-table-wrapper-BtrS3OmC.js} +1 -1
  88. package/dist/client/assets/{collection-tabs-BCClisiC.js → collection-tabs-CtU4r8Hy.js} +1 -1
  89. package/dist/client/assets/{command-BvTOvAwX.js → command-C_Uammpe.js} +1 -1
  90. package/dist/client/assets/{commerce-onboarding-BVfRsUSf.js → commerce-onboarding-D5Q-YKhe.js} +1 -1
  91. package/dist/client/assets/{config-ykFar5kq.js → config-BGIQidIa.js} +1 -1
  92. package/dist/client/assets/{connect-C2gWPZrC.js → connect-0x4VThqB.js} +2 -2
  93. package/dist/client/assets/{connect-layout-DPz52OVW.js → connect-layout-CN6ikwT9.js} +1 -1
  94. package/dist/client/assets/{connection-q0Pvw2B2.js → connection-CZKw5XC0.js} +1 -1
  95. package/dist/client/assets/{connection-card-CLVO7gWM.js → connection-card-C8JTppjB.js} +1 -1
  96. package/dist/client/assets/{connection-detail-BUdncL7r.js → connection-detail-Ber683jR.js} +1 -1
  97. package/dist/client/assets/{connection-form-helpers-BhB23GqA.js → connection-form-helpers-C8Ib0fh-.js} +1 -1
  98. package/dist/client/assets/{connections-B8VbHw_f.js → connections-CnGMoGPi.js} +1 -1
  99. package/dist/client/assets/{create-organization-dialog-CfcRT_JW.js → create-organization-dialog-DmjxuakX.js} +1 -1
  100. package/dist/client/assets/{decopilot-sse-pool-_NQmGFbS.js → decopilot-sse-pool-CGjOzfxR.js} +1 -1
  101. package/dist/client/assets/{dialog-C7M7JvTo.js → dialog-oJmEQ7fd.js} +1 -1
  102. package/dist/client/assets/{domain-settings-9aEPBIWO.js → domain-settings-CArlyMNt.js} +1 -1
  103. package/dist/client/assets/{drawer-CMB3kWdd.js → drawer-Bw9gslIb.js} +1 -1
  104. package/dist/client/assets/{dropdown-menu-D4_fxfOo.js → dropdown-menu-DwjXZoet.js} +1 -1
  105. package/dist/client/assets/{e2e-tab-C_eFWdmQ.js → e2e-tab-Co0R0nLL.js} +1 -1
  106. package/dist/client/assets/{editor-D9KXkL69.js → editor-BX-SJ89b.js} +1 -1
  107. package/dist/client/assets/{empty-state-CMqWP7WN.js → empty-state-CRx1rEIR.js} +1 -1
  108. package/dist/client/assets/{empty-state-CXTU0Gr5.js → empty-state-DJ43bnFn.js} +1 -1
  109. package/dist/client/assets/{extract-connection-data-D_rrQk5k.js → extract-connection-data-MINwSTDT.js} +1 -1
  110. package/dist/client/assets/{file-explorer-_NdkqYe1.js → file-explorer-DpEq8ubB.js} +1 -1
  111. package/dist/client/assets/{file-type-icon-BnnSdDsH.js → file-type-icon-D_Zgk3qT.js} +1 -1
  112. package/dist/client/assets/{folder-icon-DlTz7QPL.js → folder-icon-Bp7D1Lcv.js} +1 -1
  113. package/dist/client/assets/{form-kmhrAcMq.js → form-KNJGif8F.js} +1 -1
  114. package/dist/client/assets/{general-Ds56K9tp.js → general-BMvfpBmx.js} +1 -1
  115. package/dist/client/assets/{github-repo-picker-CG5N8uO0.js → github-repo-picker-XPNUm2jV.js} +1 -1
  116. package/dist/client/assets/{hooks-D05F-stG.js → hooks-WsI05bHe.js} +1 -1
  117. package/dist/client/assets/{hosting-tab-r6isx4QP.js → hosting-tab-DAwmuGFe.js} +1 -1
  118. package/dist/client/assets/{index-DY3dr3k9.js → index-6Ycnwbva.js} +1 -1
  119. package/dist/client/assets/{index-BSbcWYFA.js → index-B0bzsRbf.js} +1 -1
  120. package/dist/client/assets/{index-BoKx8Diy.js → index-BbTCpGvf.js} +1 -1
  121. package/dist/client/assets/{index-Br8dpGPA.js → index-CHXtyL0r.js} +1 -1
  122. package/dist/client/assets/{index-CgPdM9sX.js → index-CvdDBP2H.js} +1 -1
  123. package/dist/client/assets/{index-BWEmC9U0.js → index-CwsK8XI2.js} +46 -46
  124. package/dist/client/assets/{index-CthsQzIN.js → index-Da2hHsRU.js} +1 -1
  125. package/dist/client/assets/{index-B8v6bpri.js → index-KlN2gCIz.js} +3 -3
  126. package/dist/client/assets/{index-M-Ir9x4g.js → index-Uk_mCif6.js} +1 -1
  127. package/dist/client/assets/{index-BsAjbvxf.js → index-a87BkhVH.js} +1 -1
  128. package/dist/client/assets/{index-redirect-CUiCthS_.js → index-redirect-DleK1Yt6.js} +1 -1
  129. package/dist/client/assets/{infra-billing-DhUuoMMN.js → infra-billing-Gef8-Dhn.js} +1 -1
  130. package/dist/client/assets/{input-DW2ahhtH.js → input-HEtJVl9i.js} +1 -1
  131. package/dist/client/assets/{integration-icon-B89DtTTF.js → integration-icon-BgsghQ7E.js} +1 -1
  132. package/dist/client/assets/{invite-member-dialog-BVqSRdPq.js → invite-member-dialog-DGzj_Tvq.js} +1 -1
  133. package/dist/client/assets/{label-BhS7vsEg.js → label-C0PesxR-.js} +1 -1
  134. package/dist/client/assets/{layout-CCn5VLb4.js → layout-D6_KfOu0.js} +1 -1
  135. package/dist/client/assets/{login-DUuhqIbA.js → login-Otop9Ck2.js} +1 -1
  136. package/dist/client/assets/{markdown-C3hAzezL.js → markdown-eRJzb9Cb.js} +1 -1
  137. package/dist/client/assets/{mcp-oauth-DLj5d3Vy.js → mcp-oauth-B78QmrXr.js} +1 -1
  138. package/dist/client/assets/{members-DwYXjhhh.js → members-cV_AP40t.js} +1 -1
  139. package/dist/client/assets/{monaco-editor-Vy_rhpBS.js → monaco-editor-u3OHcMfo.js} +1 -1
  140. package/dist/client/assets/{monitoring-stats-row-D_d5RjHF.js → monitoring-stats-row-DvisuCi9.js} +1 -1
  141. package/dist/client/assets/{multi-select-peQ8D8Pu.js → multi-select-kuRZRD8_.js} +1 -1
  142. package/dist/client/assets/{oauth-callback-D4zEQe6g.js → oauth-callback-CFiWX7_u.js} +1 -1
  143. package/dist/client/assets/{oauth-callback-ai-provider-9a41pxZK.js → oauth-callback-ai-provider-BXFT1DOb.js} +1 -1
  144. package/dist/client/assets/{onboarding-CUeeEM4A.js → onboarding-i3HWUuTF.js} +1 -1
  145. package/dist/client/assets/org-layout-CDZCpF2V.js +1 -0
  146. package/dist/client/assets/{organization-choice-CufRbPCe.js → organization-choice-DjXSPcsB.js} +1 -1
  147. package/dist/client/assets/{orgs-DOJ311_K.js → orgs-DzhQ4XlA.js} +1 -1
  148. package/dist/client/assets/{page-seo-form-Bzm5UnJ9.js → page-seo-form-CCYA0iJF.js} +1 -1
  149. package/dist/client/assets/{popover-t_ZIm7eh.js → popover-DMAen6H4.js} +1 -1
  150. package/dist/client/assets/{post-calendar-Bmj9kbgm.js → post-calendar-DFTSle3P.js} +1 -1
  151. package/dist/client/assets/{post-editor-B04BBFsL.js → post-editor-lUsz95wa.js} +1 -1
  152. package/dist/client/assets/{primitives-B8PIMqZF.js → primitives-B-Wm41ZY.js} +1 -1
  153. package/dist/client/assets/{profile-2ky8_NJs.js → profile-BmPUiRfA.js} +1 -1
  154. package/dist/client/assets/{project-app-view-CPyowKnA.js → project-app-view-CA9ASpQB.js} +1 -1
  155. package/dist/client/assets/{prompts-DF_PvFvF.js → prompts-B9q2oJHk.js} +1 -1
  156. package/dist/client/assets/record-editor-BCumq3mK.js +1 -0
  157. package/dist/client/assets/redirect-editor-CAyDfHTn.js +1 -0
  158. package/dist/client/assets/registry-DZUz6BnD.js +2 -0
  159. package/dist/client/assets/{registry-layout-CxgAdcGY.js → registry-layout-Bq-4xMFT.js} +1 -1
  160. package/dist/client/assets/{reports-Cfr_ooDi.js → reports-B6dBYVE9.js} +1 -1
  161. package/dist/client/assets/{require-capability-C3U03ONf.js → require-capability-BcT35GEL.js} +1 -1
  162. package/dist/client/assets/{required-auth-layout-BFd3YKM1.js → required-auth-layout-ByszmYIS.js} +1 -1
  163. package/dist/client/assets/{reset-password-CB7WpCLR.js → reset-password-C-j76GLY.js} +1 -1
  164. package/dist/client/assets/{review-settings-BWlNqIKi.js → review-settings-DOzVKzXE.js} +1 -1
  165. package/dist/client/assets/{roles-BypxpQys.js → roles-VMVSF7hO.js} +1 -1
  166. package/dist/client/assets/{schema-BuoIK2NM.js → schema-84vLWA89.js} +1 -1
  167. package/dist/client/assets/{scroll-area-CF5KP4xT.js → scroll-area-BC0xk88l.js} +1 -1
  168. package/dist/client/assets/{search-input-l9JmQN1V.js → search-input-BE0KVAOM.js} +1 -1
  169. package/dist/client/assets/{secrets-mUX1ZJSA.js → secrets-8as8OGs2.js} +1 -1
  170. package/dist/client/assets/{sections-editor-DkA5v4Ou.js → sections-editor-DT_YOSrM.js} +1 -1
  171. package/dist/client/assets/{select-BeM39jjH.js → select-BqDsJm6t.js} +1 -1
  172. package/dist/client/assets/{select-model-rW6YwKIw.js → select-model-BluwSVID.js} +1 -1
  173. package/dist/client/assets/{self-tool-result-BOY_ezHR.js → self-tool-result-Crp_HAZ-.js} +1 -1
  174. package/dist/client/assets/{seo-editor-ARl87ZpS.js → seo-editor-Dx0IkBh5.js} +1 -1
  175. package/dist/client/assets/settings-layout-CbCqYC0T.js +1 -0
  176. package/dist/client/assets/{settings-sidebar-qm5r11nz.js → settings-sidebar-HbW6Jgug.js} +1 -1
  177. package/dist/client/assets/{shell-controls-Dtx9w7-l.js → shell-controls-YRTZQ5Ef.js} +1 -1
  178. package/dist/client/assets/{shell-layout-CGFwfHMp.js → shell-layout-CvYCmCNz.js} +1 -1
  179. package/dist/client/assets/{skill-preview-hysKC1kO.js → skill-preview-JuBBgBRK.js} +1 -1
  180. package/dist/client/assets/{skills-C7wLCrdg.js → skills-CZPxgiPp.js} +1 -1
  181. package/dist/client/assets/{sso-b4d7V5F8.js → sso-BZACPXqJ.js} +1 -1
  182. package/dist/client/assets/{store-BPxn9mDU.js → store-cJ0amgmM.js} +1 -1
  183. package/dist/client/assets/store-registry-ByK7cRvk.js +2 -0
  184. package/dist/client/assets/{switch-BTJg1O9U.js → switch-D_k4Qu1u.js} +1 -1
  185. package/dist/client/assets/{synced-repos-iq5etoTM.js → synced-repos-uwlv0Pey.js} +1 -1
  186. package/dist/client/assets/{table-B_EStcLQ.js → table-Dap-hV0L.js} +1 -1
  187. package/dist/client/assets/{tabs-BjBxcmhp.js → tabs-COqGDJL6.js} +1 -1
  188. package/dist/client/assets/{task-board-BHMys9hW.js → task-board-B75_z9Rj.js} +1 -1
  189. package/dist/client/assets/{task-route-r-W3qHvB.js → task-route-DbcCoz7p.js} +1 -1
  190. package/dist/client/assets/{tasks-Dz1vfh1l.js → tasks-BhNpm5RX.js} +1 -1
  191. package/dist/client/assets/{textarea-ByOwMVOP.js → textarea-BvwRrfOE.js} +1 -1
  192. package/dist/client/assets/{thread-intent-DeAJERp8.js → thread-intent-aJd8je2A.js} +1 -1
  193. package/dist/client/assets/{thread-route-JP_jBQl2.js → thread-route-nSN2wMws.js} +1 -1
  194. package/dist/client/assets/{toggle-group-BQMbtzfI.js → toggle-group-5clbhSyw.js} +1 -1
  195. package/dist/client/assets/{toolbar-CR_lIJhX.js → toolbar-6ATG38pw.js} +1 -1
  196. package/dist/client/assets/{toolbar-icon-button-CyVRuDcs.js → toolbar-icon-button-D78WqDTu.js} +1 -1
  197. package/dist/client/assets/{track-BzrD-gEE.js → track-D1An3sTA.js} +1 -1
  198. package/dist/client/assets/{types-DdehnnVY.js → types-D6oSpRz1.js} +1 -1
  199. package/dist/client/assets/{use-ai-providers-VRUuTRhq.js → use-ai-providers-D3ICNjqW.js} +1 -1
  200. package/dist/client/assets/{use-automations-1X67KfoT.js → use-automations-BRtBR0Tx.js} +1 -1
  201. package/dist/client/assets/{use-autosave-DCQJH_gL.js → use-autosave-Cuy0PbSg.js} +1 -1
  202. package/dist/client/assets/use-connection-C_L1iNkQ.js +1 -0
  203. package/dist/client/assets/{use-copy-B1L1W9s2.js → use-copy-cKoPwH5D.js} +1 -1
  204. package/dist/client/assets/{use-create-virtual-mcp-DiQNHYEZ.js → use-create-virtual-mcp-BaW9xhHR.js} +1 -1
  205. package/dist/client/assets/{use-debounced-autosave-BMYZ2YGs.js → use-debounced-autosave-BufHbfWF.js} +1 -1
  206. package/dist/client/assets/{use-debounced-value-D1N9FCWc.js → use-debounced-value-B4gfPGsg.js} +1 -1
  207. package/dist/client/assets/{use-decopilot-events-q6jF3KyR.js → use-decopilot-events-CjxND1rZ.js} +1 -1
  208. package/dist/client/assets/{use-delete-connection-DjOX5zhj.js → use-delete-connection-DpF13y-G.js} +1 -1
  209. package/dist/client/assets/{use-deployment-admin-DnmqgnN7.js → use-deployment-admin-D6YGJgYx.js} +1 -1
  210. package/dist/client/assets/{use-destination-route-BZnZlxip.js → use-destination-route-C-c7cE6M.js} +1 -1
  211. package/dist/client/assets/{use-file-configs-RNJYyxdo.js → use-file-configs-BTZYprex.js} +1 -1
  212. package/dist/client/assets/{use-infinite-scroll-BkUvStlN.js → use-infinite-scroll-Ce21aioX.js} +1 -1
  213. package/dist/client/assets/{use-join-requests-D243QYrm.js → use-join-requests-DpubSuKS.js} +1 -1
  214. package/dist/client/assets/{use-mcp-auth-status-B_NYbaoD.js → use-mcp-auth-status-DIwhYzpu.js} +1 -1
  215. package/dist/client/assets/{use-mcp-client-DJ3fa1xp.js → use-mcp-client-DaJV2zKk.js} +1 -1
  216. package/dist/client/assets/{use-mcp-prompts-EDCEFkva.js → use-mcp-prompts-9qMQ8HS9.js} +1 -1
  217. package/dist/client/assets/{use-mcp-tools-CSF0Nzff.js → use-mcp-tools-DS4bYai0.js} +1 -1
  218. package/dist/client/assets/{use-members-CfnD8M7u.js → use-members-CNWUo54i.js} +1 -1
  219. package/dist/client/assets/{use-navigate-to-agent-Bfd85iwi.js → use-navigate-to-agent-DsYRGB5d.js} +1 -1
  220. package/dist/client/assets/{use-org-auth-client-C0QDcwVK.js → use-org-auth-client-BDB3wxk-.js} +1 -1
  221. package/dist/client/assets/{use-org-repo-syncs-D_mgvf_i.js → use-org-repo-syncs-sXrl_DWw.js} +1 -1
  222. package/dist/client/assets/{use-org-sso-DMI8WwP0.js → use-org-sso-BhjEyf4c.js} +1 -1
  223. package/dist/client/assets/{use-organization-roles-D8aZ-ZR_.js → use-organization-roles-G6p07kEe.js} +1 -1
  224. package/dist/client/assets/{use-organization-settings-BA2lxbR3.js → use-organization-settings-Bm9CU7A0.js} +1 -1
  225. package/dist/client/assets/{use-panel-navigate-Bd6QXiJy.js → use-panel-navigate-B_jYd-oO.js} +1 -1
  226. package/dist/client/assets/{use-project-scope-l_KFftl6.js → use-project-scope-M7A4kaM_.js} +1 -1
  227. package/dist/client/assets/{use-registry-connections-DXPYxL2r.js → use-registry-connections-BPblfAxm.js} +1 -1
  228. package/dist/client/assets/{use-secrets-Bgkr4W3S.js → use-secrets-ASFtQe9O.js} +1 -1
  229. package/dist/client/assets/{use-section-preview-base-BV3vay05.js → use-section-preview-base-DEmQvfgW.js} +1 -1
  230. package/dist/client/assets/{use-status-sounds-BBTrZxa1.js → use-status-sounds-C5nQIKjo.js} +1 -1
  231. package/dist/client/assets/{use-tags-CehLjUea.js → use-tags-BAdNUKqb.js} +1 -1
  232. package/dist/client/assets/{use-view-mode-DhfDSglh.js → use-view-mode-DixmuAd0.js} +1 -1
  233. package/dist/client/assets/{use-virtual-mcp-7JAczJJM.js → use-virtual-mcp-D1i-P-jz.js} +1 -1
  234. package/dist/client/assets/useInfiniteQuery-CEWWIp6Z.js +1 -0
  235. package/dist/client/assets/useSuspenseInfiniteQuery-Bv4wKU6R.js +1 -0
  236. package/dist/client/assets/{users-DlROvta_.js → users-D8OY72ZK.js} +1 -1
  237. package/dist/client/assets/{variant-calendar-BL03vejT.js → variant-calendar-BH49MFNR.js} +1 -1
  238. package/dist/client/assets/{view-mode-toggle-DITqQxrp.js → view-mode-toggle-BxwtIeBE.js} +1 -1
  239. package/dist/client/index.html +1 -1
  240. package/dist/server/cli.js +1 -1
  241. package/dist/server/server.js +1 -1
  242. package/package.json +1 -1
  243. package/dist/client/assets/api-keys-DpAgTJhn.js +0 -1
  244. package/dist/client/assets/app-editor-Zo3b9Buj.js +0 -1
  245. package/dist/client/assets/org-layout-C14JwsL-.js +0 -1
  246. package/dist/client/assets/record-editor-CdeH0PSN.js +0 -1
  247. package/dist/client/assets/redirect-editor-DNQScjsS.js +0 -1
  248. package/dist/client/assets/registry-DXjIrXbl.js +0 -2
  249. package/dist/client/assets/settings-layout-DYs5pwaZ.js +0 -1
  250. package/dist/client/assets/store-registry-BtXrmEhT.js +0 -2
  251. package/dist/client/assets/use-connection-C-dhEQVr.js +0 -1
  252. package/dist/client/assets/useInfiniteQuery-CVCgU7w5.js +0 -1
  253. package/dist/client/assets/useSuspenseInfiniteQuery-BONtGFny.js +0 -1
@@ -1 +1 @@
1
- import{c as j,W as k,m as N,K as S,b as w,j as s,z as R,ap as T,B as z}from"./index-B8v6bpri.js";import{m as E}from"./use-mcp-client-DJ3fa1xp.js";import{C as O,g as M,W as D,S as A}from"./constants-DNuUCxmW.js";import{D as F}from"./use-destination-route-BZnZlxip.js";import{c as I}from"./self-tool-result-BOY_ezHR.js";import{i as L}from"./ChevronRight-D_8iRnVD.js";import{aI as $,Q as q}from"./agent-icon-D-9pJpLD.js";function P(e){return e?e.run_in_progress?"generating":e.scanned_at?"ready":"none":"none"}const Q=2e4;function K(e){if(typeof e!="string"||!e)return null;try{return new URL(e).hostname||null}catch{return null}}function le(){const e=j.c(19),{org:t}=k(),l=D.COMMERCE_DISCOVERY(t.id);let c;e[0]!==t.id||e[1]!==t.slug?(c=E({connectionId:A,orgId:t.id,orgSlug:t.slug}),e[0]=t.id,e[1]=t.slug,e[2]=c):c=e[2];const{data:o}=N(c),r=N({queryKey:S.commerceDiscoveryConnection(t.id,l),enabled:!!o,retry:!1,staleTime:6e4,queryFn:async()=>{if(!o)throw new Error("selfClient not ready");const _=await o.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:l}});return I(_)}}),a=r.data?.item??null,{data:n}=N({...E({connectionId:l,orgId:t.id,orgSlug:t.slug}),enabled:!!a}),i=S.commerceDiscoveryDiagnostic(t.id,l),m=!!n;let d;e[3]!==n?(d=async()=>{if(!n)throw new Error("cdClient not ready");const _=await n.callTool({name:O,arguments:{}});return I(_).diagnostic??null},e[3]=n,e[4]=d):d=e[4];let u;e[5]!==i||e[6]!==m||e[7]!==d?(u={queryKey:i,enabled:m,retry:1,refetchInterval:U,queryFn:d},e[5]=i,e[6]=m,e[7]=d,e[8]=u):u=e[8];const g=N(u),f=a?.metadata?.siteUrl,h=g.data??null,v=g.isSuccess,p=r.isPending||!!a&&g.isPending,b=typeof f=="string"&&f?f:null;let x;e[9]!==f?(x=K(f),e[9]=f,e[10]=x):x=e[10];const C=n??null;let y;return e[11]!==l||e[12]!==g.isSuccess||e[13]!==C||e[14]!==h||e[15]!==p||e[16]!==b||e[17]!==x?(y={diagnostic:h,isSuccess:v,isLoading:p,siteUrl:b,host:x,connectionId:l,cdClient:C},e[11]=l,e[12]=g.isSuccess,e[13]=C,e[14]=h,e[15]=p,e[16]=b,e[17]=x,e[18]=y):y=e[18],y}function U(e){return e.state.status!=="error"&&P(e.state.data)==="generating"?Q:!1}function ne(e,t){return{to:F.agents,params:{org:e.slug,panel:"app"},search:{virtualmcpid:M(e.id),connection:t,tool:O}}}const B="https://decoims.com/image?src=decocms%2F06b54678-5335-4671-b63a-e13d9e541155%2Fagataesteves.png&quality=original&fit=cover&width=160&height=160";function G(){const e=j.c(13),t=w();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("img",{src:"/logos/summit/monte-carlo.svg",alt:"Monte Carlo",className:"h-14 w-[112px] shrink-0 self-start object-contain object-left brightness-0 invert"}),e[0]=l):l=e[0];let c;e[1]!==t?(c=t("routes.commerceOnboarding.connectModal.quote"),e[1]=t,e[2]=c):c=e[2];let o;e[3]!==c?(o=s.jsxs("blockquote",{className:"text-lg font-medium leading-[1.45] lg:text-xl",children:["“",c,"”"]}),e[3]=c,e[4]=o):o=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("img",{src:B,alt:"",className:"size-10 shrink-0 rounded-full object-cover",loading:"lazy"}),e[5]=r):r=e[5];let a;e[6]!==t?(a=t("routes.commerceOnboarding.connectModal.quoteAuthor"),e[6]=t,e[7]=a):a=e[7];let n;e[8]!==a?(n=s.jsxs("figcaption",{className:"flex items-center gap-2.5",children:[r,s.jsx("span",{className:"text-base font-medium",children:a})]}),e[8]=a,e[9]=n):n=e[9];let i;return e[10]!==o||e[11]!==n?(i=s.jsxs("div",{className:"relative flex flex-col gap-8 text-white",children:[l,o,n]}),e[10]=o,e[11]=n,e[12]=i):i=e[12],i}function V(){const e=j.c(19),t=w();let l;e[0]!==t?(l=t("routes.commerceOnboarding.connectModal.trustRevoke"),e[0]=t,e[1]=l):l=e[1];let c;e[2]!==l?(c={Icon:$,label:l},e[2]=l,e[3]=c):c=e[3];let o;e[4]!==t?(o=t("routes.commerceOnboarding.connectModal.trustEncrypted"),e[4]=t,e[5]=o):o=e[5];let r;e[6]!==o?(r={Icon:R,label:o},e[6]=o,e[7]=r):r=e[7];let a;e[8]!==t?(a=t("routes.commerceOnboarding.connectModal.trustNeverSold"),e[8]=t,e[9]=a):a=e[9];let n;e[10]!==a?(n={Icon:q,label:a},e[10]=a,e[11]=n):n=e[11];let i;e[12]!==c||e[13]!==r||e[14]!==n?(i=[c,r,n],e[12]=c,e[13]=r,e[14]=n,e[15]=i):i=e[15];const m=i;let d;e[16]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"h-px w-full bg-white/15"}),e[16]=d):d=e[16];let u;return e[17]!==m?(u=s.jsxs("div",{className:"relative flex flex-col gap-2.5 text-white",children:[d,s.jsx("ul",{className:"mt-1 flex flex-col gap-2.5",children:m.map(W)})]}),e[17]=m,e[18]=u):u=e[18],u}function W(e){const{Icon:t,label:l}=e;return s.jsxs("li",{className:"flex items-center gap-2.5 text-[13px] leading-tight text-white/70",children:[s.jsx(t,{className:"size-4 shrink-0 opacity-85"}),l]},l)}function oe(e){const t=j.c(22),{siteHost:l,footer:c,onClose:o,children:r}=e,a=w(),n=l?`https://www.google.com/s2/favicons?domain=${l}&sz=128`:null;let i;t[0]!==o||t[1]!==a?(i=o&&s.jsx("button",{type:"button",onClick:o,"aria-label":a("routes.commerceOnboarding.connectModal.close"),className:"absolute right-3 top-3 z-10 flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-black/10 hover:text-foreground lg:text-white/80 lg:hover:bg-white/15 lg:hover:text-white",children:s.jsx(T,{size:18})}),t[0]=o,t[1]=a,t[2]=i):i=t[2];let m,d;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"size-7 shrink-0 dark:hidden"}),d=s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"hidden size-7 shrink-0 dark:block"}),t[3]=m,t[4]=d):(m=t[3],d=t[4]);let u;t[5]!==n||t[6]!==l?(u=l&&s.jsxs(s.Fragment,{children:[s.jsx(L,{size:16,className:"shrink-0 text-foreground/25"}),n&&s.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center overflow-hidden rounded bg-white",children:s.jsx("img",{src:n,alt:"",className:"size-full"})}),s.jsx("span",{className:"truncate text-[15px] leading-tight text-muted-foreground",children:l})]}),t[5]=n,t[6]=l,t[7]=u):u=t[7];let g;t[8]!==u?(g=s.jsxs("div",{className:"flex items-center gap-2",children:[m,d,u]}),t[8]=u,t[9]=g):g=t[9];let f;t[10]!==c?(f=s.jsx("div",{className:"flex shrink-0 flex-col gap-3",children:c}),t[10]=c,t[11]=f):f=t[11];let h;t[12]!==r||t[13]!==g||t[14]!==f?(h=s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 bg-background p-6 lg:p-8",children:[g,r,f]}),t[12]=r,t[13]=g,t[14]=f,t[15]=h):h=t[15];let v,p;t[16]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("img",{src:"https://decoims.com/image?src=decocms%2F8191643a-1947-4c30-afb4-36b8073c90fb%2Fbg-quote.png&quality=original&fit=cover&width=880",alt:"",className:"absolute inset-0 size-full object-cover"}),p=s.jsx("div",{className:"absolute inset-0 bg-black/20"}),t[16]=v,t[17]=p):(v=t[16],p=t[17]);let b;t[18]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsxs("aside",{className:"relative hidden shrink-0 overflow-hidden lg:flex lg:w-[440px] lg:flex-col lg:p-14",children:[v,p,s.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[s.jsx("div",{className:"flex-1"}),s.jsx(G,{}),s.jsx("div",{className:"flex-1"}),s.jsx(V,{})]})]}),t[18]=b):b=t[18];let x;return t[19]!==i||t[20]!==h?(x=s.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col lg:flex-row",children:[i,h,b]}),t[19]=i,t[20]=h,t[21]=x):x=t[21],x}function ce(e){const t=j.c(5),{ready:l,pending:c,label:o,onClick:r,children:a}=e,n=c||!l,i=l&&!c?a:null;let m;return t[0]!==o||t[1]!==r||t[2]!==n||t[3]!==i?(m=s.jsxs(z,{type:"button",size:"lg",className:"h-auto min-h-12 w-full whitespace-normal rounded-lg py-3 text-center text-base font-medium leading-tight",onClick:r,disabled:n,children:[o,i]}),t[0]=o,t[1]=r,t[2]=n,t[3]=i,t[4]=m):m=t[4],m}export{oe as C,ce as a,ne as c,P as d,le as u};
1
+ import{c as j,W as k,m as N,K as S,b as w,j as s,z as R,ap as T,B as z}from"./index-KlN2gCIz.js";import{m as E}from"./use-mcp-client-DaJV2zKk.js";import{C as O,g as M,W as D,S as A}from"./constants-DNuUCxmW.js";import{D as F}from"./use-destination-route-C-c7cE6M.js";import{c as I}from"./self-tool-result-Crp_HAZ-.js";import{i as L}from"./ChevronRight-B0k8i06h.js";import{aI as $,Q as q}from"./agent-icon-9NxB5SOp.js";function P(e){return e?e.run_in_progress?"generating":e.scanned_at?"ready":"none":"none"}const Q=2e4;function K(e){if(typeof e!="string"||!e)return null;try{return new URL(e).hostname||null}catch{return null}}function le(){const e=j.c(19),{org:t}=k(),l=D.COMMERCE_DISCOVERY(t.id);let c;e[0]!==t.id||e[1]!==t.slug?(c=E({connectionId:A,orgId:t.id,orgSlug:t.slug}),e[0]=t.id,e[1]=t.slug,e[2]=c):c=e[2];const{data:o}=N(c),r=N({queryKey:S.commerceDiscoveryConnection(t.id,l),enabled:!!o,retry:!1,staleTime:6e4,queryFn:async()=>{if(!o)throw new Error("selfClient not ready");const _=await o.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:l}});return I(_)}}),a=r.data?.item??null,{data:n}=N({...E({connectionId:l,orgId:t.id,orgSlug:t.slug}),enabled:!!a}),i=S.commerceDiscoveryDiagnostic(t.id,l),m=!!n;let d;e[3]!==n?(d=async()=>{if(!n)throw new Error("cdClient not ready");const _=await n.callTool({name:O,arguments:{}});return I(_).diagnostic??null},e[3]=n,e[4]=d):d=e[4];let u;e[5]!==i||e[6]!==m||e[7]!==d?(u={queryKey:i,enabled:m,retry:1,refetchInterval:U,queryFn:d},e[5]=i,e[6]=m,e[7]=d,e[8]=u):u=e[8];const g=N(u),f=a?.metadata?.siteUrl,h=g.data??null,v=g.isSuccess,p=r.isPending||!!a&&g.isPending,b=typeof f=="string"&&f?f:null;let x;e[9]!==f?(x=K(f),e[9]=f,e[10]=x):x=e[10];const C=n??null;let y;return e[11]!==l||e[12]!==g.isSuccess||e[13]!==C||e[14]!==h||e[15]!==p||e[16]!==b||e[17]!==x?(y={diagnostic:h,isSuccess:v,isLoading:p,siteUrl:b,host:x,connectionId:l,cdClient:C},e[11]=l,e[12]=g.isSuccess,e[13]=C,e[14]=h,e[15]=p,e[16]=b,e[17]=x,e[18]=y):y=e[18],y}function U(e){return e.state.status!=="error"&&P(e.state.data)==="generating"?Q:!1}function ne(e,t){return{to:F.agents,params:{org:e.slug,panel:"app"},search:{virtualmcpid:M(e.id),connection:t,tool:O}}}const B="https://decoims.com/image?src=decocms%2F06b54678-5335-4671-b63a-e13d9e541155%2Fagataesteves.png&quality=original&fit=cover&width=160&height=160";function G(){const e=j.c(13),t=w();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("img",{src:"/logos/summit/monte-carlo.svg",alt:"Monte Carlo",className:"h-14 w-[112px] shrink-0 self-start object-contain object-left brightness-0 invert"}),e[0]=l):l=e[0];let c;e[1]!==t?(c=t("routes.commerceOnboarding.connectModal.quote"),e[1]=t,e[2]=c):c=e[2];let o;e[3]!==c?(o=s.jsxs("blockquote",{className:"text-lg font-medium leading-[1.45] lg:text-xl",children:["“",c,"”"]}),e[3]=c,e[4]=o):o=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("img",{src:B,alt:"",className:"size-10 shrink-0 rounded-full object-cover",loading:"lazy"}),e[5]=r):r=e[5];let a;e[6]!==t?(a=t("routes.commerceOnboarding.connectModal.quoteAuthor"),e[6]=t,e[7]=a):a=e[7];let n;e[8]!==a?(n=s.jsxs("figcaption",{className:"flex items-center gap-2.5",children:[r,s.jsx("span",{className:"text-base font-medium",children:a})]}),e[8]=a,e[9]=n):n=e[9];let i;return e[10]!==o||e[11]!==n?(i=s.jsxs("div",{className:"relative flex flex-col gap-8 text-white",children:[l,o,n]}),e[10]=o,e[11]=n,e[12]=i):i=e[12],i}function V(){const e=j.c(19),t=w();let l;e[0]!==t?(l=t("routes.commerceOnboarding.connectModal.trustRevoke"),e[0]=t,e[1]=l):l=e[1];let c;e[2]!==l?(c={Icon:$,label:l},e[2]=l,e[3]=c):c=e[3];let o;e[4]!==t?(o=t("routes.commerceOnboarding.connectModal.trustEncrypted"),e[4]=t,e[5]=o):o=e[5];let r;e[6]!==o?(r={Icon:R,label:o},e[6]=o,e[7]=r):r=e[7];let a;e[8]!==t?(a=t("routes.commerceOnboarding.connectModal.trustNeverSold"),e[8]=t,e[9]=a):a=e[9];let n;e[10]!==a?(n={Icon:q,label:a},e[10]=a,e[11]=n):n=e[11];let i;e[12]!==c||e[13]!==r||e[14]!==n?(i=[c,r,n],e[12]=c,e[13]=r,e[14]=n,e[15]=i):i=e[15];const m=i;let d;e[16]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("div",{className:"h-px w-full bg-white/15"}),e[16]=d):d=e[16];let u;return e[17]!==m?(u=s.jsxs("div",{className:"relative flex flex-col gap-2.5 text-white",children:[d,s.jsx("ul",{className:"mt-1 flex flex-col gap-2.5",children:m.map(W)})]}),e[17]=m,e[18]=u):u=e[18],u}function W(e){const{Icon:t,label:l}=e;return s.jsxs("li",{className:"flex items-center gap-2.5 text-[13px] leading-tight text-white/70",children:[s.jsx(t,{className:"size-4 shrink-0 opacity-85"}),l]},l)}function oe(e){const t=j.c(22),{siteHost:l,footer:c,onClose:o,children:r}=e,a=w(),n=l?`https://www.google.com/s2/favicons?domain=${l}&sz=128`:null;let i;t[0]!==o||t[1]!==a?(i=o&&s.jsx("button",{type:"button",onClick:o,"aria-label":a("routes.commerceOnboarding.connectModal.close"),className:"absolute right-3 top-3 z-10 flex size-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-black/10 hover:text-foreground lg:text-white/80 lg:hover:bg-white/15 lg:hover:text-white",children:s.jsx(T,{size:18})}),t[0]=o,t[1]=a,t[2]=i):i=t[2];let m,d;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"size-7 shrink-0 dark:hidden"}),d=s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"hidden size-7 shrink-0 dark:block"}),t[3]=m,t[4]=d):(m=t[3],d=t[4]);let u;t[5]!==n||t[6]!==l?(u=l&&s.jsxs(s.Fragment,{children:[s.jsx(L,{size:16,className:"shrink-0 text-foreground/25"}),n&&s.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center overflow-hidden rounded bg-white",children:s.jsx("img",{src:n,alt:"",className:"size-full"})}),s.jsx("span",{className:"truncate text-[15px] leading-tight text-muted-foreground",children:l})]}),t[5]=n,t[6]=l,t[7]=u):u=t[7];let g;t[8]!==u?(g=s.jsxs("div",{className:"flex items-center gap-2",children:[m,d,u]}),t[8]=u,t[9]=g):g=t[9];let f;t[10]!==c?(f=s.jsx("div",{className:"flex shrink-0 flex-col gap-3",children:c}),t[10]=c,t[11]=f):f=t[11];let h;t[12]!==r||t[13]!==g||t[14]!==f?(h=s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-8 bg-background p-6 lg:p-8",children:[g,r,f]}),t[12]=r,t[13]=g,t[14]=f,t[15]=h):h=t[15];let v,p;t[16]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("img",{src:"https://decoims.com/image?src=decocms%2F8191643a-1947-4c30-afb4-36b8073c90fb%2Fbg-quote.png&quality=original&fit=cover&width=880",alt:"",className:"absolute inset-0 size-full object-cover"}),p=s.jsx("div",{className:"absolute inset-0 bg-black/20"}),t[16]=v,t[17]=p):(v=t[16],p=t[17]);let b;t[18]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsxs("aside",{className:"relative hidden shrink-0 overflow-hidden lg:flex lg:w-[440px] lg:flex-col lg:p-14",children:[v,p,s.jsxs("div",{className:"relative z-10 flex h-full flex-col",children:[s.jsx("div",{className:"flex-1"}),s.jsx(G,{}),s.jsx("div",{className:"flex-1"}),s.jsx(V,{})]})]}),t[18]=b):b=t[18];let x;return t[19]!==i||t[20]!==h?(x=s.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col lg:flex-row",children:[i,h,b]}),t[19]=i,t[20]=h,t[21]=x):x=t[21],x}function ce(e){const t=j.c(5),{ready:l,pending:c,label:o,onClick:r,children:a}=e,n=c||!l,i=l&&!c?a:null;let m;return t[0]!==o||t[1]!==r||t[2]!==n||t[3]!==i?(m=s.jsxs(z,{type:"button",size:"lg",className:"h-auto min-h-12 w-full whitespace-normal rounded-lg py-3 text-center text-base font-medium leading-tight",onClick:r,disabled:n,children:[o,i]}),t[0]=o,t[1]=r,t[2]=n,t[3]=i,t[4]=m):m=t[4],m}export{oe as C,ce as a,ne as c,P as d,le as u};
@@ -1 +1 @@
1
- import{ae as i,ai as r,af as t,ag as e,aj as o,ao as a,an as d,d5 as l,cf as u}from"./index-B8v6bpri.js";const p=i({authorizationEndpoint:e().url(),tokenEndpoint:e().url(),introspectionEndpoint:e().url().optional(),clientId:e(),clientSecret:e().optional(),scopes:t(e()),grantType:r(["authorization_code","client_credentials"])}),c=i({type:d("object"),properties:o(e(),a()).optional(),required:t(e()).optional()}).catchall(a()),b=l.extend({inputSchema:c,outputSchema:c.optional()}),m=i({headers:o(e(),e()).optional()}),h=i({command:e().describe("Command to run (e.g., 'npx', 'node')"),args:t(e()).optional().describe("Command arguments"),cwd:e().optional().describe("Working directory"),envVars:o(e(),e()).optional().describe("Environment variables (encrypted in storage)")}),s=i({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:r(["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:u([h,m]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:p.nullable().describe("OAuth configuration"),configuration_state:o(e(),a()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:t(e()).nullable().optional().describe("Configuration scopes"),metadata:o(e(),a()).nullable().describe("Additional metadata (includes repository info)"),tools:t(b).nullable().describe("Discovered tools from MCP"),bindings:t(e()).nullable().describe("Detected bindings"),status:r(["active","inactive","error"]).describe("Current status")});s.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()});s.partial();function f(n){return n!=null&&"command"in n}function g(n){return!n||!n.startsWith("virtual://")?null:n.replace("virtual://","")}export{p as O,f as i,g as p};
1
+ import{ae as i,ai as r,af as t,ag as e,aj as o,ao as a,an as d,d4 as l,ce as u}from"./index-KlN2gCIz.js";const p=i({authorizationEndpoint:e().url(),tokenEndpoint:e().url(),introspectionEndpoint:e().url().optional(),clientId:e(),clientSecret:e().optional(),scopes:t(e()),grantType:r(["authorization_code","client_credentials"])}),c=i({type:d("object"),properties:o(e(),a()).optional(),required:t(e()).optional()}).catchall(a()),b=l.extend({inputSchema:c,outputSchema:c.optional()}),m=i({headers:o(e(),e()).optional()}),h=i({command:e().describe("Command to run (e.g., 'npx', 'node')"),args:t(e()).optional().describe("Command arguments"),cwd:e().optional().describe("Working directory"),envVars:o(e(),e()).optional().describe("Environment variables (encrypted in storage)")}),s=i({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:r(["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:u([h,m]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:p.nullable().describe("OAuth configuration"),configuration_state:o(e(),a()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:t(e()).nullable().optional().describe("Configuration scopes"),metadata:o(e(),a()).nullable().describe("Additional metadata (includes repository info)"),tools:t(b).nullable().describe("Discovered tools from MCP"),bindings:t(e()).nullable().describe("Detected bindings"),status:r(["active","inactive","error"]).describe("Current status")});s.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()});s.partial();function f(n){return n!=null&&"command"in n}function g(n){return!n||!n.startsWith("virtual://")?null:n.replace("virtual://","")}export{p as O,f as i,g as p};
@@ -1 +1 @@
1
- import{c as S,W as K,bZ as F,K as H,b as q,l as $,j as x,b4 as G}from"./index-B8v6bpri.js";import{u as U}from"./use-registry-connections-DXPYxL2r.js";import{e as V}from"./use-organization-settings-BA2lxbR3.js";import{S as k}from"./constants-DNuUCxmW.js";import{u as W}from"./useInfiniteQuery-CVCgU7w5.js";import{c as X}from"./use-mcp-client-DJ3fa1xp.js";import{i as Y,f as Z}from"./extract-connection-data-D_rrQk5k.js";import{r as z,R as B}from"./retry-CErkP7V6.js";import{g as A}from"./connection-slug-CITJ0kGN.js";import{I as J}from"./integration-icon-B89DtTTF.js";function ye(){const s=S.c(6),e=U(),t=V(),o=K().project.enabledPlugins??[];let n;if(s[0]!==o||s[1]!==t||s[2]!==e){let c;s[4]!==t?(c=r=>t(r.id),s[4]=t,s[5]=c):c=s[5],n=e.filter(c).map(O),o.includes("private-registry")&&t(k)&&n.push({id:k,title:"Private Registry",icon:null}),s[0]=o,s[1]=t,s[2]=e,s[3]=n}else n=s[3];return n}function O(s){return{id:s.id,title:s.title,icon:s.icon}}const ee=24,L=3;function Q(s){return s.id.includes("community-registry")}function te(s){const e=s?.trim().split(/\s+/).filter(Boolean)??[];if(e.length===0)return;const t=[["title"],["description"],["name"],["server","title"]];return{operator:"or",conditions:e.flatMap(o=>t.map(n=>({field:n,operator:"contains",value:o})))}}function D(s,e,t,o,n){const c=s.map(l=>l.id).sort().join(","),r=te(n),{data:p,fetchNextPage:f,hasNextPage:d,isFetchingNextPage:g,isLoading:C}=W({queryKey:H.storeDiscovery(e,`${c}:${n??""}`),queryFn:async({pageParam:l})=>{const a=l??{};return await Promise.all(s.map(async i=>{const y=a[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const b=Y(i.id,e);try{return await z(async()=>{let u=null;try{u=await X({connectionId:i.id,orgId:e,orgSlug:t});const h={limit:ee};y&&(h.cursor=y),r&&(h.where=r);const N=await u.callTool({name:b,arguments:h}),v=N.structuredContent??N,P=v.nextCursor||v.cursor||void 0,R=Z(v?[v]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:R,nextCursor:P}}finally{await u?.close().catch(()=>{})}},{maxAttempts:L,minTimeout:0,maxTimeout:1e3,jitter:0})}catch(u){return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${L} attempts:`,u instanceof B?u.cause:u),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}}))},initialPageParam:{},getNextPageParam:l=>{const a={};let m=!1;for(const i of l)i.registryId&&(i.nextCursor?(a[i.registryId]=i.nextCursor,m=!0):a[i.registryId]="EXHAUSTED");return m?a:void 0},staleTime:3600*1e3,placeholderData:F,retry:!1,enabled:s.length>0}),I=[];if(p?.pages)for(const l of p.pages)for(const a of l)for(const m of a.items)I.push({...m,_sourceName:m._sourceName??a.registryTitle,_sourceIcon:m._sourceIcon??a.registryIcon,_registryId:m._registryId??a.registryId});return{items:I,hasMore:d??!1,isLoadingMore:g,isInitialLoading:C,fetchNextPage:()=>{d&&!g&&f()}}}function he(s,e){const t=S.c(16),{org:o}=K();let n;t[0]!==s?(n=s.filter(ie),t[0]=s,t[1]=n):n=t[1];const c=n;let r;t[2]!==s?(r=s.filter(se),t[2]=s,t[3]=r):r=t[3];const p=r,f=D(c,o.id,o.slug,!0,e),d=D(p,o.id,o.slug,!0,e);let g;if(t[4]!==d.items||t[5]!==f.items){const y=new Set;g=[];const b=[...f.items,...d.items];for(const u of b){const h=`${u._registryId}:${u.id}`;y.has(h)||(y.add(h),g.push(u))}t[4]=d.items,t[5]=f.items,t[6]=g}else g=t[6];const C=f.isInitialLoading||d.isInitialLoading,I=f.isLoadingMore||d.isLoadingMore,l=f.hasMore||d.hasMore;let a;t[7]!==d||t[8]!==f?(a=()=>{f.hasMore&&f.fetchNextPage(),d.hasMore&&d.fetchNextPage()},t[7]=d,t[8]=f,t[9]=a):a=t[9];const m=a;let i;return t[10]!==l||t[11]!==C||t[12]!==I||t[13]!==g||t[14]!==m?(i={items:g,hasMore:l,isLoadingMore:I,isInitialLoading:C,loadMore:m},t[10]=l,t[11]=C,t[12]=I,t[13]=g,t[14]=m,t[15]=i):i=t[15],i}function se(s){return Q(s)}function ie(s){return!Q(s)}function xe(s){const e=new Map;for(const n of s){const c=A(n),r=e.get(c);r?r.push(n):e.set(c,[n])}const t=[],o=new Set;for(const n of s){const c=A(n);if(o.has(c))continue;o.add(c);const r=e.get(c),p=r[0];r.length===1?t.push({type:"single",connection:p}):t.push({type:"group",key:c,icon:p.icon,title:p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.title,connections:r})}return t}function ve(s){const e=S.c(43),{connection:t,onClick:o,headerActions:n,headerActionsAlwaysVisible:c,footer:r,className:p,fallbackIcon:f,selected:d}=s,g=c===void 0?!1:c,C=q(),I=o&&"cursor-pointer hover:bg-muted/50";let l;e[0]!==p||e[1]!==I?(l=$("transition-colors group overflow-hidden flex flex-col h-full",I,p),e[0]=p,e[1]=I,e[2]=l):l=e[2];const a=o?"button":void 0,m=o?0:void 0,i=o&&d!==void 0?d:void 0;let y;e[3]!==o?(y=o?E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),o())}:void 0,e[3]=o,e[4]=y):y=e[4];let b;e[5]!==t.icon||e[6]!==t.title||e[7]!==f?(b=x.jsx(J,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[5]=t.icon,e[6]=t.title,e[7]=f,e[8]=b):b=e[8];let u;e[9]!==n||e[10]!==g?(u=n&&x.jsx("div",{className:$("transition-opacity",!g&&"sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100"),onClick:ne,children:n}),e[9]=n,e[10]=g,e[11]=u):u=e[11];let h;e[12]!==u?(h=x.jsx("div",{className:"relative",children:u}),e[12]=u,e[13]=h):h=e[13];let N;e[14]!==h||e[15]!==b?(N=x.jsxs("div",{className:"flex items-start justify-between",children:[b,h]}),e[14]=h,e[15]=b,e[16]=N):N=e[16];let v;e[17]!==t.title?(v=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[17]=t.title,e[18]=v):v=e[18];let P;e[19]!==t.description||e[20]!==C?(P=t.description||C("connections.connectionCard.noDescription"),e[19]=t.description,e[20]=C,e[21]=P):P=e[21];let R;e[22]!==P?(R=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:P}),e[22]=P,e[23]=R):R=e[23];let j;e[24]!==v||e[25]!==R?(j=x.jsxs("div",{className:"flex flex-col gap-1",children:[v,R]}),e[24]=v,e[25]=R,e[26]=j):j=e[26];let M;e[27]!==N||e[28]!==j?(M=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[N,j]}),e[27]=N,e[28]=j,e[29]=M):M=e[29];let w;e[30]!==r?(w=r&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:oe,children:r})}),e[30]=r,e[31]=w):w=e[31];let T;e[32]!==M||e[33]!==w?(T=x.jsxs("div",{className:"flex flex-col flex-1",children:[M,w]}),e[32]=M,e[33]=w,e[34]=T):T=e[34];let _;return e[35]!==o||e[36]!==T||e[37]!==l||e[38]!==a||e[39]!==m||e[40]!==i||e[41]!==y?(_=x.jsx(G,{className:l,onClick:o,role:a,tabIndex:m,"aria-pressed":i,onKeyDown:y,children:T}),e[35]=o,e[36]=T,e[37]=l,e[38]=a,e[39]=m,e[40]=i,e[41]=y,e[42]=_):_=e[42],_}function oe(s){return s.stopPropagation()}function ne(s){return s.stopPropagation()}export{ve as C,he as a,xe as g,ye as u};
1
+ import{c as S,W as K,bY as F,K as H,b as Y,l as $,j as x,b4 as q}from"./index-KlN2gCIz.js";import{u as G}from"./use-registry-connections-BPblfAxm.js";import{e as U}from"./use-organization-settings-Bm9CU7A0.js";import{S as k}from"./constants-DNuUCxmW.js";import{u as V}from"./useInfiniteQuery-CEWWIp6Z.js";import{c as W}from"./use-mcp-client-DaJV2zKk.js";import{i as X,f as z}from"./extract-connection-data-MINwSTDT.js";import{r as B,R as Z}from"./retry-CErkP7V6.js";import{g as A}from"./connection-slug-CITJ0kGN.js";import{I as J}from"./integration-icon-BgsghQ7E.js";function ye(){const s=S.c(6),e=G(),t=U(),o=K().project.enabledPlugins??[];let n;if(s[0]!==o||s[1]!==t||s[2]!==e){let c;s[4]!==t?(c=r=>t(r.id),s[4]=t,s[5]=c):c=s[5],n=e.filter(c).map(O),o.includes("private-registry")&&t(k)&&n.push({id:k,title:"Private Registry",icon:null}),s[0]=o,s[1]=t,s[2]=e,s[3]=n}else n=s[3];return n}function O(s){return{id:s.id,title:s.title,icon:s.icon}}const ee=24,L=3;function Q(s){return s.id.includes("community-registry")}function te(s){const e=s?.trim().split(/\s+/).filter(Boolean)??[];if(e.length===0)return;const t=[["title"],["description"],["name"],["server","title"]];return{operator:"or",conditions:e.flatMap(o=>t.map(n=>({field:n,operator:"contains",value:o})))}}function D(s,e,t,o,n){const c=s.map(l=>l.id).sort().join(","),r=te(n),{data:p,fetchNextPage:f,hasNextPage:d,isFetchingNextPage:g,isLoading:C}=V({queryKey:H.storeDiscovery(e,`${c}:${n??""}`),queryFn:async({pageParam:l})=>{const a=l??{};return await Promise.all(s.map(async i=>{const y=a[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const b=X(i.id,e);try{return await B(async()=>{let u=null;try{u=await W({connectionId:i.id,orgId:e,orgSlug:t});const h={limit:ee};y&&(h.cursor=y),r&&(h.where=r);const N=await u.callTool({name:b,arguments:h}),v=N.structuredContent??N,P=v.nextCursor||v.cursor||void 0,R=z(v?[v]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:R,nextCursor:P}}finally{await u?.close().catch(()=>{})}},{maxAttempts:L,minTimeout:0,maxTimeout:1e3,jitter:0})}catch(u){return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${L} attempts:`,u instanceof Z?u.cause:u),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}}))},initialPageParam:{},getNextPageParam:l=>{const a={};let m=!1;for(const i of l)i.registryId&&(i.nextCursor?(a[i.registryId]=i.nextCursor,m=!0):a[i.registryId]="EXHAUSTED");return m?a:void 0},staleTime:3600*1e3,placeholderData:F,retry:!1,enabled:s.length>0}),I=[];if(p?.pages)for(const l of p.pages)for(const a of l)for(const m of a.items)I.push({...m,_sourceName:m._sourceName??a.registryTitle,_sourceIcon:m._sourceIcon??a.registryIcon,_registryId:m._registryId??a.registryId});return{items:I,hasMore:d??!1,isLoadingMore:g,isInitialLoading:C,fetchNextPage:()=>{d&&!g&&f()}}}function he(s,e){const t=S.c(16),{org:o}=K();let n;t[0]!==s?(n=s.filter(ie),t[0]=s,t[1]=n):n=t[1];const c=n;let r;t[2]!==s?(r=s.filter(se),t[2]=s,t[3]=r):r=t[3];const p=r,f=D(c,o.id,o.slug,!0,e),d=D(p,o.id,o.slug,!0,e);let g;if(t[4]!==d.items||t[5]!==f.items){const y=new Set;g=[];const b=[...f.items,...d.items];for(const u of b){const h=`${u._registryId}:${u.id}`;y.has(h)||(y.add(h),g.push(u))}t[4]=d.items,t[5]=f.items,t[6]=g}else g=t[6];const C=f.isInitialLoading||d.isInitialLoading,I=f.isLoadingMore||d.isLoadingMore,l=f.hasMore||d.hasMore;let a;t[7]!==d||t[8]!==f?(a=()=>{f.hasMore&&f.fetchNextPage(),d.hasMore&&d.fetchNextPage()},t[7]=d,t[8]=f,t[9]=a):a=t[9];const m=a;let i;return t[10]!==l||t[11]!==C||t[12]!==I||t[13]!==g||t[14]!==m?(i={items:g,hasMore:l,isLoadingMore:I,isInitialLoading:C,loadMore:m},t[10]=l,t[11]=C,t[12]=I,t[13]=g,t[14]=m,t[15]=i):i=t[15],i}function se(s){return Q(s)}function ie(s){return!Q(s)}function xe(s){const e=new Map;for(const n of s){const c=A(n),r=e.get(c);r?r.push(n):e.set(c,[n])}const t=[],o=new Set;for(const n of s){const c=A(n);if(o.has(c))continue;o.add(c);const r=e.get(c),p=r[0];r.length===1?t.push({type:"single",connection:p}):t.push({type:"group",key:c,icon:p.icon,title:p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.title,connections:r})}return t}function ve(s){const e=S.c(43),{connection:t,onClick:o,headerActions:n,headerActionsAlwaysVisible:c,footer:r,className:p,fallbackIcon:f,selected:d}=s,g=c===void 0?!1:c,C=Y(),I=o&&"cursor-pointer hover:bg-muted/50";let l;e[0]!==p||e[1]!==I?(l=$("transition-colors group overflow-hidden flex flex-col h-full",I,p),e[0]=p,e[1]=I,e[2]=l):l=e[2];const a=o?"button":void 0,m=o?0:void 0,i=o&&d!==void 0?d:void 0;let y;e[3]!==o?(y=o?E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),o())}:void 0,e[3]=o,e[4]=y):y=e[4];let b;e[5]!==t.icon||e[6]!==t.title||e[7]!==f?(b=x.jsx(J,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[5]=t.icon,e[6]=t.title,e[7]=f,e[8]=b):b=e[8];let u;e[9]!==n||e[10]!==g?(u=n&&x.jsx("div",{className:$("transition-opacity",!g&&"sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100"),onClick:ne,children:n}),e[9]=n,e[10]=g,e[11]=u):u=e[11];let h;e[12]!==u?(h=x.jsx("div",{className:"relative",children:u}),e[12]=u,e[13]=h):h=e[13];let N;e[14]!==h||e[15]!==b?(N=x.jsxs("div",{className:"flex items-start justify-between",children:[b,h]}),e[14]=h,e[15]=b,e[16]=N):N=e[16];let v;e[17]!==t.title?(v=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[17]=t.title,e[18]=v):v=e[18];let P;e[19]!==t.description||e[20]!==C?(P=t.description||C("connections.connectionCard.noDescription"),e[19]=t.description,e[20]=C,e[21]=P):P=e[21];let R;e[22]!==P?(R=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:P}),e[22]=P,e[23]=R):R=e[23];let j;e[24]!==v||e[25]!==R?(j=x.jsxs("div",{className:"flex flex-col gap-1",children:[v,R]}),e[24]=v,e[25]=R,e[26]=j):j=e[26];let M;e[27]!==N||e[28]!==j?(M=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[N,j]}),e[27]=N,e[28]=j,e[29]=M):M=e[29];let w;e[30]!==r?(w=r&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:oe,children:r})}),e[30]=r,e[31]=w):w=e[31];let T;e[32]!==M||e[33]!==w?(T=x.jsxs("div",{className:"flex flex-col flex-1",children:[M,w]}),e[32]=M,e[33]=w,e[34]=T):T=e[34];let _;return e[35]!==o||e[36]!==T||e[37]!==l||e[38]!==a||e[39]!==m||e[40]!==i||e[41]!==y?(_=x.jsx(q,{className:l,onClick:o,role:a,tabIndex:m,"aria-pressed":i,onKeyDown:y,children:T}),e[35]=o,e[36]=T,e[37]=l,e[38]=a,e[39]=m,e[40]=i,e[41]=y,e[42]=_):_=e[42],_}function oe(s){return s.stopPropagation()}function ne(s){return s.stopPropagation()}export{ve as C,he as a,xe as g,ye as u};
@@ -1 +1 @@
1
- import{ae as be,aj as $e,ao as De,ag as me,af as Oe,c as R,b as L,j as t,h as ve,B as H,r as Z,l as Ne,W as te,a7 as Me,x as ze,K as ae,d as se,b4 as Ee,b7 as ue,F as Ue,E as Re,f as Ve,c4 as Fe,n as Le,ar as Be,as as He,bl as Qe,bk as qe,bi as Ge,bj as Ke,c5 as We,t as Y}from"./index-B8v6bpri.js";import{g as Xe}from"./extract-connection-data-D_rrQk5k.js";import{E as Se}from"./empty-state-CMqWP7WN.js";import{E as Je,c as Ye,r as Ze,b as et,d as tt}from"./connection-form-helpers-BhB23GqA.js";import{c as st,S as nt,V as it}from"./index-DY3dr3k9.js";import{u as ye,T as ot}from"./use-mcp-auth-status-B_NYbaoD.js";import{a as at}from"./use-members-CfnD8M7u.js";import{A as lt}from"./avatar-CsipcR4h.js";import{a as Ce,b as _e,u as rt}from"./use-connection-C-dhEQVr.js";import{u as we}from"./use-mcp-client-DJ3fa1xp.js";import{a as ct}from"./use-mcp-tools-CSF0Nzff.js";import{a as dt}from"./use-mcp-prompts-EDCEFkva.js";import{i as mt,a as ut}from"./mcp-oauth-DLj5d3Vy.js";import{I as le}from"./integration-icon-B89DtTTF.js";import{s as xt}from"./Plus-Bz1cAYCY.js";import{P as pt,Q as ft,p as ht,aM as gt,s as ne}from"./agent-icon-D-9pJpLD.js";import{a as ke,s as jt}from"./Settings02-C39ViKVB.js";import{s as ce}from"./Trash01-D5j2YoAs.js";import{d as G,a as K,e as W,b as B,c as X,f as bt,F as vt}from"./form-kmhrAcMq.js";import{I as J}from"./input-DW2ahhtH.js";import{u as Nt,D as St}from"./use-delete-connection-DjOX5zhj.js";import{c as yt,B as Ct,a as _t,C as wt}from"./monitoring-stats-row-D_d5RjHF.js";import{C as kt,a as It,b as Tt}from"./chart-BIwqiDqG.js";import{b as At}from"./use-virtual-mcp-7JAczJJM.js";import{i as Ie}from"./ChevronRight-D_8iRnVD.js";import{b as Te}from"./Users03-BnbWbfJy.js";import{b as ie,c as Pt,T as oe,a as $t}from"./tabs-BjBxcmhp.js";import{g as Ae}from"./connection-slug-CITJ0kGN.js";import{b as Dt}from"./Tool01-DP3BW23e.js";import{g as de,M as Ot}from"./types-DdehnnVY.js";import{C as Mt}from"./collection-search-lJZ_AiYh.js";import{B as zt}from"./badge-Cr2fQRq8.js";import{c as Et,D as Ut,b as Rt,a as xe}from"./dropdown-menu-D4_fxfOo.js";import{S as pe,a as fe,b as he,c as ge,d as q}from"./select-BeM39jjH.js";import{i as Vt}from"./CheckCircle-CEm5M3Tl.js";import{t as Ft}from"./ChevronUp-D9JVuW7G.js";import{n as Lt}from"./Tool02-DT-zZ1ks.js";import{b as Bt}from"./UserSquare-DGuYrk9Q.js";import{s as Ht}from"./XClose-BNIppwTn.js";import{p as Qt,i as qt}from"./connection-q0Pvw2B2.js";import"./metadata-dUsYcpuu.js";import"./constants-DNuUCxmW.js";import"./Key01-BBxtRrGm.js";import"./auth-CeWlFDdC.js";import"./use-registry-connections-DXPYxL2r.js";import"./use-organization-settings-BA2lxbR3.js";import"./schema-BuoIK2NM.js";import"./task-board-BHMys9hW.js";import"./index-CthsQzIN.js";import"./index-BSbcWYFA.js";import"./index-BoKx8Diy.js";import"./popover-t_ZIm7eh.js";import"./Check-yANPvlWH.js";import"./SearchMd-DN6cu6SZ.js";import"./use-create-virtual-mcp-DiQNHYEZ.js";import"./use-navigate-to-agent-Bfd85iwi.js";import"./use-destination-route-BZnZlxip.js";import"./hooks-D05F-stG.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-_NQmGFbS.js";import"./thread-intent-DeAJERp8.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BpKUwJal.js";import"./Eye-ggEjyhYq.js";import"./use-org-auth-client-C0QDcwVK.js";import"./User01-Bq-AsdvG.js";import"./AlertCircle-DTA-xmN8.js";import"./ThumbsUp-DV6K5Csu.js";import"./ArrowUp-B56zz92l.js";import"./ArrowLeft-DJHyaGVg.js";import"./XCircle-Dlv7pZja.js";import"./TrendUp01-CaNIYwx8.js";import"./ZoomOut-jLe5z2Gu.js";import"./ChevronSelectorVertical-CDr8Ovfg.js";import"./DotsVertical-mvRvTh6x.js";import"./Copy01-ZnkwptEM.js";import"./CreditCard01-DBOo-aYq.js";import"./Download01-CeBHR-fX.js";import"./Share07-vMCtuazW.js";import"./GitBranch01-DZEodcVR.js";import"./Globe01-Dj13xfTI.js";import"./HardDrive-Bkrrs0FV.js";import"./Image01-DfTbYbFE.js";import"./Link01-DUUbBvGo.js";import"./LinkExternal01-61qG-hFo.js";import"./LockUnlocked01-BfX9zVyU.js";import"./Monitor01-Cvj67Ryv.js";import"./Sun-B3CG15-H.js";import"./Package-B4jzjbE8.js";import"./Palette-CXReGsk_.js";import"./Play-kr1GKsAc.js";import"./Shield01-SPzOFIU1.js";import"./Stars01-q62Ogx-P.js";import"./Upload01-DSJ1fWRp.js";import"./Users01-CS6rfCga.js";import"./Zap-CywbYsFI.js";import"./label-BhS7vsEg.js";import"./alert-dialog-D3FLXTEj.js";import"./AreaChart-DWzH4cl2.js";import"./ErrorBarContext-CMbUifoM.js";import"./Sector-DidaJ4gW.js";const Gt=be({scopes:Oe(me()).describe("List of scopes available"),stateSchema:$e(me(),De()).describe("JSON Schema (draft-07) defining the state structure")}),Kt=[{name:"MCP_CONFIGURATION",inputSchema:be({}),outputSchema:Gt}];function Wt(s){const e=R.c(61),{instance:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l}=s,a=L();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const m=ye(r),d=!(n.connection_type==="VIRTUAL")&&m.supportsOAuth&&!m.isAuthenticated,f=n.status!=="active",u=d||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==u?(h=Ne("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(le,{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 b;e[7]!==n.title?(b=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=b):b=e[8];let S;e[9]!==n.status||e[10]!==f||e[11]!==d||e[12]!==a?(S=d?t.jsx("span",{className:"text-xs text-destructive font-medium",children:a("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?a("details.connectionInstancesPanel.disabledError"):a("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=d,e[12]=a,e[13]=S):S=e[13];let v;e[14]!==b||e[15]!==S?(v=t.jsxs("div",{className:"flex-1 min-w-0",children:[b,S]}),e[14]=b,e[15]=S,e[16]=v):v=e[16];let y;e[17]!==n||e[18]!==d||e[19]!==o||e[20]!==a?(y=d&&t.jsx(H,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>o(n),children:a("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=d,e[19]=o,e[20]=a,e[21]=y):y=e[21];let P;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==a?(P=f?t.jsxs(H,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(pt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:a("details.connectionInstancesPanel.disable"),"aria-label":a("details.connectionInstancesPanel.disable"),children:t.jsx(ft,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=a,e[26]=P):P=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let _;e[30]!==a?(_=a("details.connectionInstancesPanel.configure"),e[30]=a,e[31]=_):_=e[31];let M;e[32]!==a?(M=a("details.connectionInstancesPanel.configure"),e[32]=a,e[33]=M):M=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ke,{size:13}),e[34]=T):T=e[34];let D;e[35]!==$||e[36]!==_||e[37]!==M?(D=t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:_,"aria-label":M,children:T}),e[35]=$,e[36]=_,e[37]=M,e[38]=D):D=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 N;e[42]!==a?(N=a("details.connectionInstancesPanel.delete"),e[42]=a,e[43]=N):N=e[43];let j;e[44]!==a?(j=a("details.connectionInstancesPanel.delete"),e[44]=a,e[45]=j):j=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ce,{size:13}),e[46]=E):E=e[46];let z;e[47]!==I||e[48]!==N||e[49]!==j?(z=t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:I,title:N,"aria-label":j,children:E}),e[47]=I,e[48]=N,e[49]=j,e[50]=z):z=e[50];let k;e[51]!==D||e[52]!==z||e[53]!==y||e[54]!==P?(k=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,P,D,z]}),e[51]=D,e[52]=z,e[53]=y,e[54]=P,e[55]=k):k=e[55];let A;return e[56]!==k||e[57]!==h||e[58]!==g||e[59]!==v?(A=t.jsxs("div",{className:h,children:[g,v,k]}),e[56]=k,e[57]=h,e[58]=g,e[59]=v,e[60]=A):A=e[60],A}function Xt(s){const e=R.c(21),{instance:n,onConfigure:c}=s,o=L();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let a;e[5]!==n||e[6]!==c?(a=()=>c(n),e[5]=n,e[6]=c,e[7]=a):a=e[7];let r;e[8]!==o?(r=o("details.connectionInstancesPanel.configure"),e[8]=o,e[9]=r):r=e[9];let m;e[10]!==o?(m=o("details.connectionInstancesPanel.configure"),e[10]=o,e[11]=m):m=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(ke,{size:13}),e[12]=x):x=e[12];let d;e[13]!==a||e[14]!==r||e[15]!==m?(d=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a,title:r,"aria-label":m,children:x})}),e[13]=a,e[14]=r,e[15]=m,e[16]=d):d=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==d?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,d]}),e[17]=i,e[18]=l,e[19]=d,e[20]=f):f=e[20],f}function Jt(s){const e=R.c(33),{instances:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l,onAdd:a,isAdding:r}=s,m=L();if(n.length===0)return null;let x;e[0]!==n.length||e[1]!==m?(x=n.length===1?m("details.connectionInstancesPanel.instance"):m("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=m,e[2]=x):x=e[2];let d;e[3]!==x?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:x}),e[3]=x,e[4]=d):d=e[4];let f;e[5]!==r?(f=r?t.jsx(ve,{className:"size-[13px]"}):t.jsx(xt,{size:13}),e[5]=r,e[6]=f):f=e[6];let u;e[7]!==m?(u=m("details.connectionInstancesPanel.addInstance"),e[7]=m,e[8]=u):u=e[8];let h;e[9]!==r||e[10]!==a||e[11]!==f||e[12]!==u?(h=t.jsxs(H,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:a,disabled:r,children:[f,u]}),e[9]=r,e[10]=a,e[11]=f,e[12]=u,e[13]=h):h=e[13];let g;e[14]!==d||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,h]}),e[14]=d,e[15]=h,e[16]=g):g=e[16];let b;if(e[17]!==n||e[18]!==o||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==o||e[24]!==c||e[25]!==i||e[26]!==l?(y=P=>t.jsx(Z.Suspense,{fallback:t.jsx(Xt,{instance:P,onConfigure:c}),children:t.jsx(Wt,{instance:P,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l})},P.id),e[23]=o,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],b=n.map(y),e[17]=n,e[18]=o,e[19]=c,e[20]=i,e[21]=l,e[22]=b}else b=e[22];let S;e[28]!==b?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:b}),e[28]=b,e[29]=S):S=e[29];let v;return e[30]!==g||e[31]!==S?(v=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=v):v=e[32],v}function Yt(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const o=(c.errorMessage??"").trim()||"Unknown error";n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([c,o])=>({message:c,count:o})).sort((c,o)=>o.count-c.count).slice(0,e)}const Zt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function es(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 ts={calls:{label:"Tool calls"},errors:{label:"Errors"}};function ss(s){const e=R.c(4),{connectionId:n,orgId:c,timeframe:o}=s,i=L(),l=Me(),a=es(o),{data:r}=ze({queryKey:ae.connectionActivity(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),m=yt(r?.logs??[],a,void 0,r?.total),x=m.data,d=m.totalCalls>0,f=Yt(r?.logs??[]),u=m.totalCalls>0?Math.round(m.totalErrors/m.totalCalls*100):0;let h;e[0]!==i?(h=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=h):h=e[1];let g;return e[2]!==h?(g=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:h}),e[2]=h,e[3]=g):g=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:m.totalCalls.toLocaleString()}),g]}),m.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:m.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),m.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(m.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),d?t.jsxs("div",{children:[t.jsx(kt,{config:ts,className:"h-16 w-full",children:t.jsxs(Ct,{data:x,barCategoryGap:"4%",children:[t.jsx(It,{content:t.jsx(Tt,{labelFormatter:os}),cursor:{fill:"var(--muted)"}}),t.jsx(_t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:x.map(is)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[x.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),f.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"),u>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:u.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:f.map(ns)})]})]})}function ns(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 is(s,e){return t.jsx(wt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function os(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function as(){const s=R.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 ls(s){const e=R.c(22),{connectionId:n}=s,c=L(),[o,i]=Z.useState("14d"),{org:l}=te();let a;e[0]!==c?(a=c("details.connectionActivity.activity"),e[0]=c,e[1]=a):a=e[1];let r;e[2]!==a?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a})}),e[2]=a,e[3]=r):r=e[3];let m;e[4]!==c?(m=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=m):m=e[5];let x;e[6]!==o?(x=Zt.map(b=>t.jsx("button",{type:"button","aria-pressed":o===b.value,onClick:()=>i(b.value),className:Ne("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",o===b.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:b.label},b.value)),e[6]=o,e[7]=x):x=e[7];let d;e[8]!==m||e[9]!==x?(d=t.jsx("div",{role:"group","aria-label":m,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:x}),e[8]=m,e[9]=x,e[10]=d):d=e[10];let f;e[11]!==r||e[12]!==d?(f=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,d]}),e[11]=r,e[12]=d,e[13]=f):f=e[13];let u;e[14]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(as,{}),e[14]=u):u=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==o?(h=t.jsx(Z.Suspense,{fallback:u,children:t.jsx(ss,{connectionId:n,orgId:l.id,timeframe:o})}),e[15]=n,e[16]=l.id,e[17]=o,e[18]=h):h=e[18];let g;return e[19]!==f||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,h]}),e[19]=f,e[20]=h,e[21]=g):g=e[21],g}function rs(s){const e=R.c(15),{virtualMcp:n,org:c}=s,o=se();let i;e[0]!==o||e[1]!==c||e[2]!==n.id?(i=()=>{const d=crypto.randomUUID();o({to:"/$org/$taskId",params:{org:c,taskId:d},search:{virtualmcpid:n.id}})},e[0]=o,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Te,{size:16}),e[4]=l):l=e[4];let a;e[5]!==n.icon||e[6]!==n.title?(a=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=a):a=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ie,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=m):m=e[10];let x;return e[11]!==i||e[12]!==a||e[13]!==r?(x=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:[a,r,m]}),e[11]=i,e[12]=a,e[13]=r,e[14]=x):x=e[14],x}function cs(s){const e=R.c(7),{virtualMcps:n,org:c}=s;let o;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=a=>t.jsx(rs,{virtualMcp:a,org:c},a.id),e[3]=c,e[4]=l):l=e[4],o=n.map(l),e[0]=c,e[1]=n,e[2]=o}else o=e[2];let i;return e[5]!==o?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:o})}),e[5]=o,e[6]=i):i=e[6],i}function ds(s){const e=R.c(13),{connection:n}=s,c=L(),{org:o}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=At(i);if(!(l.length>0)){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(t.Fragment,{}),e[2]=f):f=e[2],f}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let m;e[5]!==r?(m=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]=m):m=e[6];let x;e[7]!==o.slug||e[8]!==l?(x=t.jsx("div",{className:"px-5 py-4",children:t.jsx(cs,{virtualMcps:l,org:o.slug})}),e[7]=o.slug,e[8]=l,e[9]=x):x=e[9];let d;return e[10]!==m||e[11]!==x?(d=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,x]}),e[10]=m,e[11]=x,e[12]=d):d=e[12],d}function ms(s){const e=R.c(35),{tools:n,connectionId:c,org:o}=s,i=L(),l=se(),{org:a}=te();let r;e[0]!==c||e[1]!==a.id||e[2]!==a.slug?(r={connectionId:c,orgId:a.id,orgSlug:a.slug},e[0]=c,e[1]=a.id,e[2]=a.slug,e[3]=r):r=e[3];const m=we(r),x=Ce(c);let d;e[4]!==x||e[5]!==c?(d=x?Ae(x):c,e[4]=x,e[5]=c,e[6]=d):d=e[6];const f=d,[u,h]=Z.useState("");let g,b,S,v;if(e[7]!==f||e[8]!==m||e[9]!==l||e[10]!==o||e[11]!==u||e[12]!==i||e[13]!==n){const $=(n??[]).filter(us),_=u.toLowerCase().trim(),M=_?$.filter(j=>j.name.toLowerCase().includes(_)||j.description&&j.description.toLowerCase().includes(_)):$;let T;e[18]!==f||e[19]!==l||e[20]!==o?(T=j=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(j.name)}})},e[18]=f,e[19]=l,e[20]=o,e[21]=T):T=e[21];const D=T;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 N;e[24]===Symbol.for("react.memo_cache_sentinel")?(N=j=>{j.key==="Escape"&&(h(""),j.target.blur())},e[24]=N):N=e[24],e[25]!==u||e[26]!==I?(v=t.jsx(Mt,{value:u,onChange:h,placeholder:I,onKeyDown:N}),e[25]=u,e[26]=I,e[27]=v):v=e[27],g="flex-1 overflow-auto p-5",b=M.length===0?t.jsx(Se,{image:null,title:i(u?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(u?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(j=>{const E=de(j._meta);return t.jsxs(Ee,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>D(j),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Ot,{resourceURI:E,toolInfo:{tool:j},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),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:j.annotations?.title??j.name}),t.jsx(ot,{annotations:j.annotations,_meta:j._meta})]}),j.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j.description})]})]},j.name)})}),e[7]=f,e[8]=m,e[9]=l,e[10]=o,e[11]=u,e[12]=i,e[13]=n,e[14]=g,e[15]=b,e[16]=S,e[17]=v}else g=e[14],b=e[15],S=e[16],v=e[17];let y;e[28]!==g||e[29]!==b?(y=t.jsx("div",{className:g,children:b}),e[28]=g,e[29]=b,e[30]=y):y=e[30];let P;return e[31]!==S||e[32]!==v||e[33]!==y?(P=t.jsxs("div",{className:S,children:[v,y]}),e[31]=S,e[32]=v,e[33]=y,e[34]=P):P=e[34],P}function us(s){return!!de(s._meta)}function Pe(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),o=e.map(n),i=e[e.length-1];return o.length>=2&&i&&c.has(i)?[o.pop(),...o].join(" "):o.join(" ")}function re(s){const e=R.c(5),{label:n}=s,c=L();let o;e[0]!==n||e[1]!==c?(o=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=o):o=e[2];let i;return e[3]!==o?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o})}),e[3]=o,e[4]=i):i=e[4],i}function xs(s){const e=R.c(72),{tools:n,prompts:c,resources:o,connectionId:i,org:l}=s;let a;e[0]!==c?(a=c===void 0?[]:c,e[0]=c,e[1]=a):a=e[1];const r=a;let m;e[2]!==o?(m=o===void 0?[]:o,e[2]=o,e[3]=m):m=e[3];const x=m,d=L(),f=se(),u=Ce(i??"");let h;e[4]!==u||e[5]!==i?(h=u?Ae(u):i,e[4]=u,e[5]=i,e[6]=h):h=e[6];const g=h;let b;e[7]!==g||e[8]!==i||e[9]!==f||e[10]!==l?(b=function(V){!i||!l||f({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(V)}})},e[7]=g,e[8]=i,e[9]=f,e[10]=l,e[11]=b):b=e[11];const S=b;let v;e[12]!==i||e[13]!==l||e[14]!==n?(v=i&&l&&n.some(hs),e[12]=i,e[13]=l,e[14]=n,e[15]=v):v=e[15];const y=v;if(n.length+r.length+x.length===0){let C;e[16]!==d?(C=d("details.connectionCapabilities.capabilities"),e[16]=d,e[17]=C):C=e[17];let V;e[18]!==C?(V=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:C}),e[18]=C,e[19]=V):V=e[19];let Q;e[20]!==d?(Q=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[20]=d,e[21]=Q):Q=e[21];let F;e[22]!==Q?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:Q}),e[22]=Q,e[23]=F):F=e[23];let ee;return e[24]!==F||e[25]!==V?(ee=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[V,F]}),e[24]=F,e[25]=V,e[26]=ee):ee=e[26],ee}let $;e[27]!==d||e[28]!==n.length?($=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[27]=d,e[28]=n.length,e[29]=$):$=e[29];let _;e[30]!==$?(_=t.jsx(ie,{value:"tools",variant:"underline",children:$}),e[30]=$,e[31]=_):_=e[31];let M;e[32]!==y||e[33]!==d?(M=y&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[32]=y,e[33]=d,e[34]=M):M=e[34];let T;e[35]!==d?(T=d("details.connectionCapabilities.promptsTab"),e[35]=d,e[36]=T):T=e[36];let D;e[37]!==T?(D=t.jsx(ie,{value:"prompts",variant:"underline",children:T}),e[37]=T,e[38]=D):D=e[38];let I;e[39]!==d?(I=d("details.connectionCapabilities.resourcesTab"),e[39]=d,e[40]=I):I=e[40];let N;e[41]!==I?(N=t.jsx(ie,{value:"resources",variant:"underline",children:I}),e[41]=I,e[42]=N):N=e[42];let j;e[43]!==M||e[44]!==D||e[45]!==N||e[46]!==_?(j=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Pt,{variant:"underline",className:"gap-1",children:[_,M,D,N]})}),e[43]=M,e[44]=D,e[45]=N,e[46]=_,e[47]=j):j=e[47];let E;e[48]!==S||e[49]!==n?(E=n.length>0?n.map(C=>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:()=>S(C.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(Dt,{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:Pe(C.name)}),C.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:C.description})]}),t.jsx(Ie,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},C.name)):t.jsx(re,{label:"tools"}),e[48]=S,e[49]=n,e[50]=E):E=e[50];let z;e[51]!==E?(z=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[51]=E,e[52]=z):z=e[52];let k;e[53]!==i||e[54]!==y||e[55]!==l||e[56]!==n?(k=y&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ms,{tools:n,connectionId:i,org:l})}),e[53]=i,e[54]=y,e[55]=l,e[56]=n,e[57]=k):k=e[57];let A;e[58]!==r?(A=r.length>0?r.map(fs):t.jsx(re,{label:"prompts"}),e[58]=r,e[59]=A):A=e[59];let U;e[60]!==A?(U=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=U):U=e[61];let p;e[62]!==x?(p=x.length>0?x.map(ps):t.jsx(re,{label:"resources"}),e[62]=x,e[63]=p):p=e[63];let w;e[64]!==p?(w=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:p})}),e[64]=p,e[65]=w):w=e[65];let O;return e[66]!==j||e[67]!==z||e[68]!==k||e[69]!==U||e[70]!==w?(O=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs($t,{defaultValue:"tools",variant:"underline",children:[j,z,k,U,w]})}),e[66]=j,e[67]=z,e[68]=k,e[69]=U,e[70]=w,e[71]=O):O=e[71],O}function ps(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: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 fs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(ht,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Pe(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 hs(s){return de(s._meta)}function gs(s){const e=R.c(13),{connection:n,displayTitle:c}=s,o=c??n.title;let i;e[0]!==n.icon||e[1]!==o?(i=t.jsx(le,{icon:n.icon,name:o,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=o,e[2]=i):i=e[2];let l;e[3]!==o?(l=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:o})}),e[3]=o,e[4]=l):l=e[4];let a;e[5]!==n.description?(a=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=a):a=e[6];let r;e[7]!==l||e[8]!==a?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[7]=l,e[8]=a,e[9]=r):r=e[9];let m;return e[10]!==i||e[11]!==r?(m=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[i,r]}),e[10]=i,e[11]=r,e[12]=m):m=e[12],m}function js({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:o}){const i=L(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Ue(),m=(()=>{if(typeof a!="string"||!a)return!1;try{const u=new URL(a);return u.hostname==="api.githubcopilot.com"&&u.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),x=r||e.connection_type==="STDIO",d=e.connection_type==="VIRTUAL",f=d?Qt(e.connection_url):null;return d?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(Te,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),f&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(W,{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:u.value,onValueChange:u.onChange,children:[t.jsx(B,{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")}),x&&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(K,{className:"flex-1 min-w-0",children:t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:u.value,onValueChange:u.onChange,children:[t.jsx(B,{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")]})}),x&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{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(Bt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(X,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(X,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(B,{children:t.jsx(Je,{value:u.value??[],onChange:u.onChange})}),t.jsx(X,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i(m?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Et,{children:[t.jsx(Ut,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(zt,{variant:"success",className:"gap-1.5",children:[t.jsx(Vt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Ft,{size:12})]})})}),t.jsxs(Rt,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(jt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:o,children:[t.jsx(ce,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&u.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:()=>u.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(B,{children:t.jsx(J,{type:"password",placeholder:i(m?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(bt,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(X,{})]})})]})}function bs(s){return s.command==="npx"}function vs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Ns(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function je(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"&&qt(s.connection_headers)){const c=s.connection_headers,o=Ze(c.envVars);if(bs(c)){const l=vs(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o}}const i=Ns(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:o}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Ss(s){let e,n=null,c=null,o=null;return s.ui_type==="NPX"?(e="STDIO",n="",o=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",o=tt(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...o&&{connection_headers:o},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ys({connection:s,connectionId:e,org:n,isUpdating:c,tools:o,prompts:i,resources:l,siblings:a}){const r=L(),m=se({from:"/$org/settings/connections/$appSlug"}),x=Le(),d=_e(),{org:f}=te(),u=Nt({onSuccess:()=>{a.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[b,S]=Z.useState(!1),v=ye({connectionId:e}),{data:y}=at(),P=y?.data?.members??[],$=h??s,_=P.find(p=>p.userId===$.created_by),T=s?.connection_type==="VIRTUAL"||v.isAuthenticated,D={...s,tools:o},I=st(D,Kt),N=Be({resolver:He(Ye),values:je(h??s)}),j=N.formState.isDirty,E=async()=>{if(!await N.trigger())return;const w=N.getValues(),O=Ss(w),C=h?.id??e;await d.update.mutateAsync({id:C,data:O}),N.reset(w)},z=()=>{N.reset(je(h??s))},k=async p=>{const w=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:O,tokenInfo:C,error:V}=await ut({connectionId:p,orgSlug:f.slug,...w?{scope:w}:{}});if(V||!O){Y.error(r("details.connection.authFailed",{error:V??""}));return}if(C)try{const F=await fetch(`/api/${f.slug}/connections/${p}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:C.accessToken,refreshToken:C.refreshToken,expiresIn:C.expiresIn,scope:C.scope,clientId:C.clientId,clientSecret:C.clientSecret,tokenEndpoint:C.tokenEndpoint})});if(!F.ok)console.error("Failed to save OAuth token:",await F.text()),await d.update.mutateAsync({id:p,data:{connection_token:O}});else try{await d.update.mutateAsync({id:p,data:{}})}catch(ee){console.warn("Failed to refresh connection tools after OAuth:",ee)}}catch(F){console.error("Error saving OAuth token:",F),await d.update.mutateAsync({id:p,data:{connection_token:O}})}else await d.update.mutateAsync({id:p,data:{connection_token:O}});const Q=new URL(`/api/${f.slug}/mcp/${p}`,window.location.origin);await x.invalidateQueries({queryKey:ae.isMCPAuthenticated(Q.href,null)}),await x.invalidateQueries({queryKey:ae.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>k(s.id),U=async()=>{try{const p=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!p.ok){const O=await p.text();Y.error(r("details.connection.failedRemoveOAuth",{error:O}));return}const w=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await x.invalidateQueries({queryKey:ae.isMCPAuthenticated(w.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(p){console.error("Error removing OAuth token:",p),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(St,{...u}),t.jsx(Qe,{open:h!==null,onOpenChange:p=>{p||g(null)},children:t.jsxs(qe,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Ge,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(Ke,{className:"text-base",children:h?.title??s.title}),t.jsx(We,{className:"text-xs",children:r("details.connection.settingsDescription")}),_&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(lt,{url:_.user?.image??void 0,fallback:_.user?.name??_.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:_.user?.name||_.user?.email})]})]}),t.jsxs(vt,{...N,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:N.control,name:"title",render:({field:p})=>t.jsxs(K,{children:[t.jsx(W,{children:r("details.connection.nameLabel")}),t.jsx(B,{children:t.jsx(J,{...p})}),t.jsx(X,{})]})}),t.jsx(G,{control:N.control,name:"description",render:({field:p})=>t.jsxs(K,{children:[t.jsx(W,{children:r("details.connection.descriptionLabel")}),t.jsx(B,{children:t.jsx(J,{...p,value:p.value||""})}),t.jsx(X,{})]})})]}),t.jsx(js,{form:N,connection:h??s,hasOAuthToken:v.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:U}),t.jsx(nt,{connection:h??s,form:N,hasMcpBinding:I,isMCPAuthenticated:T,supportsOAuth:v.supportsOAuth,isServerError:v.isServerError,onAuthenticate:A,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(H,{onClick:E,disabled:!j||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),j&&t.jsx(H,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(H,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const p=h??s;g(null),u.requestDelete(p)},children:[t.jsx(ce,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(it,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(gs,{connection:s,displayTitle:(()=>{const p=a[0]??s;return p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ls,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Jt,{instances:a,onConfigure:p=>g(p),onAuthenticate:p=>k(p.id),onDelete:p=>u.requestDelete(p),onToggleStatus:async(p,w)=>{try{await d.update.mutateAsync({id:p.id,data:{status:w}}),Y.success(r(w==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:b,onAdd:async()=>{S(!0);try{const p=a[0]??s,w=p.title.replace(/\s*\(\d+\)\s*$/,""),O=a.length+1,C=`${w} (${O})`,V=Xe("conn");await d.create.mutateAsync({id:V,title:C,description:p.description??null,connection_type:p.connection_type,connection_url:p.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p.created_by,organization_id:p.organization_id,icon:p.icon??null,app_name:p.app_name??null,app_id:p.app_id??null,connection_headers:p.connection_headers??null,oauth_config:null,configuration_state:p.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const Q=new URL(`/api/${f.slug}/mcp/${V}`,window.location.origin),F=await mt({url:Q.href,token:null,orgId:f.id});F.supportsOAuth&&!F.isAuthenticated&&await k(V)}finally{S(!1)}}}),t.jsx(ds,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(xs,{tools:o,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function Cs(){const s=R.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 o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug"},s[1]=o):o=s[1];const{appSlug:i,org:l}=Ve(o),{org:a}=te(),r=_e();let m;s[2]!==i?(m={slug:i},s[2]=i,s[3]=m):m=s[3];const x=rt(m),d=x[0]??null,f=d?.id??"",u=f||null;let h;s[4]!==a.id||s[5]!==a.slug||s[6]!==u?(h={connectionId:u,orgId:a.id,orgSlug:a.slug},s[4]=a.id,s[5]=a.slug,s[6]=u,s[7]=h):h=s[7];const g=we(h);let b;s[8]!==g?(b={client:g},s[8]=g,s[9]=b):b=s[9];const{data:S}=ct(b);let v;if(s[10]!==d?.tools||s[11]!==f||s[12]!==x||s[13]!==S){const k=S?S.tools.map(As):(d?.tools??[]).map(Ts);e:{if(x.length<=1){v=k;break e}const A=new Set,U=[],p=ks;for(const w of x){const O=w.id===f?k:p(w.tools);for(const C of O)A.has(C.name)||(A.add(C.name),U.push(C))}v=U.length>0?U:k}s[10]=d?.tools,s[11]=f,s[12]=x,s[13]=S,s[14]=v}else v=s[14];const y=v;let P;s[15]!==g?(P={client:g},s[15]=g,s[16]=P):P=s[16];const{data:$}=dt(P);let _;s[17]!==g?(_={client:g},s[17]=g,s[18]=_):_=s[18];const{data:M}=Fe(_);let T;s[19]!==$?.prompts?(T=$?.prompts??[],s[19]=$?.prompts,s[20]=T):T=s[20];let D;s[21]!==T?(D=T.map(ws),s[21]=T,s[22]=D):D=s[22];const I=D;let N;s[23]!==M?.resources?(N=M?.resources??[],s[23]=M?.resources,s[24]=N):N=s[24];let j;s[25]!==N?(j=N.map(_s),s[25]=N,s[26]=j):j=s[26];const E=j;if(!d){let k;s[27]!==e?(k=e("details.connection.notFoundTitle"),s[27]=e,s[28]=k):k=s[28];let A;s[29]!==e?(A=e("details.connection.notFoundDescription"),s[29]=e,s[30]=A):A=s[30];let U;s[31]!==c||s[32]!==l?(U=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=U):U=s[33];let p;s[34]!==e?(p=e("details.connection.backButton"),s[34]=e,s[35]=p):p=s[35];let w;s[36]!==U||s[37]!==p?(w=t.jsx(H,{variant:"outline",onClick:U,children:p}),s[36]=U,s[37]=p,s[38]=w):w=s[38];let O;return s[39]!==k||s[40]!==A||s[41]!==w?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Se,{title:k,description:A,actions:w})}),s[39]=k,s[40]=A,s[41]=w,s[42]=O):O=s[42],O}let z;return s[43]!==r.update.isPending||s[44]!==y||s[45]!==d||s[46]!==f||s[47]!==l||s[48]!==I||s[49]!==E||s[50]!==x?(z=t.jsx(ys,{org:l,connection:d,connectionId:f,isUpdating:r.update.isPending,tools:y,prompts:I,resources:E,siblings:x}),s[43]=r.update.isPending,s[44]=y,s[45]=d,s[46]=f,s[47]=l,s[48]=I,s[49]=E,s[50]=x,s[51]=z):z=s[51],z}function _s(s){return{name:s.name,description:s.description,uri:s.uri}}function ws(s){return{name:s.name,description:s.description}}function ks(s){return(s??[]).map(Is)}function Is(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function As(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ps(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Re,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ve,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Cs,{})})}),s[0]=e):e=s[0],e}function ki(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ps,{}),s[0]=e):e=s[0],e}export{ki as default};
1
+ import{ae as be,aj as $e,ao as De,ag as me,af as Oe,c as R,b as L,j as t,h as ve,B as H,r as Z,l as Ne,W as te,a7 as Me,x as ze,K as ae,d as se,b4 as Ee,b7 as ue,F as Ue,E as Re,f as Ve,c3 as Fe,n as Le,ar as Be,as as He,bl as Qe,bk as qe,bi as Ge,bj as Ke,c4 as We,t as Y}from"./index-KlN2gCIz.js";import{g as Xe}from"./extract-connection-data-MINwSTDT.js";import{E as Se}from"./empty-state-CRx1rEIR.js";import{E as Je,c as Ye,r as Ze,b as et,d as tt}from"./connection-form-helpers-C8Ib0fh-.js";import{c as st,S as nt,V as it}from"./index-6Ycnwbva.js";import{u as ye,T as ot}from"./use-mcp-auth-status-DIwhYzpu.js";import{a as at}from"./use-members-CNWUo54i.js";import{A as lt}from"./avatar-gFJWL-Vg.js";import{a as Ce,b as _e,u as rt}from"./use-connection-C_L1iNkQ.js";import{u as we}from"./use-mcp-client-DaJV2zKk.js";import{a as ct}from"./use-mcp-tools-DS4bYai0.js";import{a as dt}from"./use-mcp-prompts-9qMQ8HS9.js";import{i as mt,a as ut}from"./mcp-oauth-B78QmrXr.js";import{I as le}from"./integration-icon-BgsghQ7E.js";import{s as xt}from"./Plus-B4HOF1E1.js";import{P as pt,Q as ft,p as ht,aM as gt,s as ne}from"./agent-icon-9NxB5SOp.js";import{a as ke,s as jt}from"./Settings02-Bj1lDwij.js";import{s as ce}from"./Trash01-RcSuYrVJ.js";import{d as G,a as K,e as W,b as B,c as X,f as bt,F as vt}from"./form-KNJGif8F.js";import{I as J}from"./input-HEtJVl9i.js";import{u as Nt,D as St}from"./use-delete-connection-DpF13y-G.js";import{c as yt,B as Ct,a as _t,C as wt}from"./monitoring-stats-row-DvisuCi9.js";import{C as kt,a as It,b as Tt}from"./chart-Ctqg6c-J.js";import{b as At}from"./use-virtual-mcp-D1i-P-jz.js";import{i as Ie}from"./ChevronRight-B0k8i06h.js";import{b as Te}from"./Users03-B7rH-Prq.js";import{b as ie,c as Pt,T as oe,a as $t}from"./tabs-COqGDJL6.js";import{g as Ae}from"./connection-slug-CITJ0kGN.js";import{b as Dt}from"./Tool01-3TSBet75.js";import{g as de,M as Ot}from"./types-D6oSpRz1.js";import{C as Mt}from"./collection-search-Bfeg8_4N.js";import{B as zt}from"./badge-DU8Pt1Ge.js";import{c as Et,D as Ut,b as Rt,a as xe}from"./dropdown-menu-DwjXZoet.js";import{S as pe,a as fe,b as he,c as ge,d as q}from"./select-BqDsJm6t.js";import{i as Vt}from"./CheckCircle-BL9fUGh0.js";import{t as Ft}from"./ChevronUp-DoFbOo5V.js";import{n as Lt}from"./Tool02-CUjmmZmP.js";import{b as Bt}from"./UserSquare-DAvB_kFJ.js";import{s as Ht}from"./XClose-CfMSoySe.js";import{p as Qt,i as qt}from"./connection-CZKw5XC0.js";import"./metadata-dUsYcpuu.js";import"./constants-DNuUCxmW.js";import"./Key01-a9vi-Tku.js";import"./auth-7gOJrCJs.js";import"./use-registry-connections-BPblfAxm.js";import"./use-organization-settings-Bm9CU7A0.js";import"./schema-84vLWA89.js";import"./task-board-B75_z9Rj.js";import"./index-Da2hHsRU.js";import"./index-B0bzsRbf.js";import"./index-BbTCpGvf.js";import"./popover-DMAen6H4.js";import"./Check-DFpZ57WE.js";import"./SearchMd-BL3yOzl8.js";import"./use-create-virtual-mcp-BaW9xhHR.js";import"./use-navigate-to-agent-DsYRGB5d.js";import"./use-destination-route-C-c7cE6M.js";import"./hooks-WsI05bHe.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-CGjOzfxR.js";import"./thread-intent-aJd8je2A.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BpKUwJal.js";import"./Eye-BC_4l4lG.js";import"./use-org-auth-client-BDB3wxk-.js";import"./User01-AECGy6qL.js";import"./AlertCircle-mzPvygUw.js";import"./ThumbsUp-DZtUuNqz.js";import"./ArrowUp-Yj21fZGL.js";import"./ArrowLeft-Bp9N4N0-.js";import"./XCircle-BcRsQfbp.js";import"./TrendUp01-B1pPYfuK.js";import"./ZoomOut-CN3_bE81.js";import"./ChevronSelectorVertical-C36SdIlf.js";import"./DotsVertical-DJWfzfak.js";import"./Copy01-DQrZ6li-.js";import"./CreditCard01-BwmXIXJx.js";import"./Download01-DsQzO8cd.js";import"./Share07-K9acKdZ2.js";import"./GitBranch01-C4EIccIA.js";import"./Globe01-DHMT8bp9.js";import"./HardDrive-DO3IjmaH.js";import"./Image01-C4TVJnST.js";import"./Link01-BWge3x25.js";import"./LinkExternal01-qomjjlr4.js";import"./LockUnlocked01-BD5ISYeA.js";import"./Monitor01-BB9oelwa.js";import"./Sun-v51TgHoC.js";import"./Package-DRO-nel6.js";import"./Palette-CzJtqmLV.js";import"./Play-BOlL7p4H.js";import"./Shield01-B2le5qB9.js";import"./Stars01-DBkTEhiq.js";import"./Upload01-lXk5j7xP.js";import"./Users01-BgVgHDh8.js";import"./Zap-B1-2Q3w4.js";import"./label-C0PesxR-.js";import"./alert-dialog-CcHS-XLY.js";import"./AreaChart-DpI9x93q.js";import"./ErrorBarContext-CJd0p0QO.js";import"./Sector-B66RdjM2.js";const Gt=be({scopes:Oe(me()).describe("List of scopes available"),stateSchema:$e(me(),De()).describe("JSON Schema (draft-07) defining the state structure")}),Kt=[{name:"MCP_CONFIGURATION",inputSchema:be({}),outputSchema:Gt}];function Wt(s){const e=R.c(61),{instance:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l}=s,a=L();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const m=ye(r),d=!(n.connection_type==="VIRTUAL")&&m.supportsOAuth&&!m.isAuthenticated,f=n.status!=="active",u=d||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==u?(h=Ne("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(le,{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 b;e[7]!==n.title?(b=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=b):b=e[8];let S;e[9]!==n.status||e[10]!==f||e[11]!==d||e[12]!==a?(S=d?t.jsx("span",{className:"text-xs text-destructive font-medium",children:a("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?a("details.connectionInstancesPanel.disabledError"):a("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=d,e[12]=a,e[13]=S):S=e[13];let v;e[14]!==b||e[15]!==S?(v=t.jsxs("div",{className:"flex-1 min-w-0",children:[b,S]}),e[14]=b,e[15]=S,e[16]=v):v=e[16];let y;e[17]!==n||e[18]!==d||e[19]!==o||e[20]!==a?(y=d&&t.jsx(H,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>o(n),children:a("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=d,e[19]=o,e[20]=a,e[21]=y):y=e[21];let P;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==a?(P=f?t.jsxs(H,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(pt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:a("details.connectionInstancesPanel.disable"),"aria-label":a("details.connectionInstancesPanel.disable"),children:t.jsx(ft,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=a,e[26]=P):P=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let _;e[30]!==a?(_=a("details.connectionInstancesPanel.configure"),e[30]=a,e[31]=_):_=e[31];let M;e[32]!==a?(M=a("details.connectionInstancesPanel.configure"),e[32]=a,e[33]=M):M=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ke,{size:13}),e[34]=T):T=e[34];let D;e[35]!==$||e[36]!==_||e[37]!==M?(D=t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:_,"aria-label":M,children:T}),e[35]=$,e[36]=_,e[37]=M,e[38]=D):D=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 N;e[42]!==a?(N=a("details.connectionInstancesPanel.delete"),e[42]=a,e[43]=N):N=e[43];let j;e[44]!==a?(j=a("details.connectionInstancesPanel.delete"),e[44]=a,e[45]=j):j=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ce,{size:13}),e[46]=E):E=e[46];let z;e[47]!==I||e[48]!==N||e[49]!==j?(z=t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:I,title:N,"aria-label":j,children:E}),e[47]=I,e[48]=N,e[49]=j,e[50]=z):z=e[50];let k;e[51]!==D||e[52]!==z||e[53]!==y||e[54]!==P?(k=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,P,D,z]}),e[51]=D,e[52]=z,e[53]=y,e[54]=P,e[55]=k):k=e[55];let A;return e[56]!==k||e[57]!==h||e[58]!==g||e[59]!==v?(A=t.jsxs("div",{className:h,children:[g,v,k]}),e[56]=k,e[57]=h,e[58]=g,e[59]=v,e[60]=A):A=e[60],A}function Xt(s){const e=R.c(21),{instance:n,onConfigure:c}=s,o=L();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let a;e[5]!==n||e[6]!==c?(a=()=>c(n),e[5]=n,e[6]=c,e[7]=a):a=e[7];let r;e[8]!==o?(r=o("details.connectionInstancesPanel.configure"),e[8]=o,e[9]=r):r=e[9];let m;e[10]!==o?(m=o("details.connectionInstancesPanel.configure"),e[10]=o,e[11]=m):m=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(ke,{size:13}),e[12]=x):x=e[12];let d;e[13]!==a||e[14]!==r||e[15]!==m?(d=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(H,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a,title:r,"aria-label":m,children:x})}),e[13]=a,e[14]=r,e[15]=m,e[16]=d):d=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==d?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,d]}),e[17]=i,e[18]=l,e[19]=d,e[20]=f):f=e[20],f}function Jt(s){const e=R.c(33),{instances:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l,onAdd:a,isAdding:r}=s,m=L();if(n.length===0)return null;let x;e[0]!==n.length||e[1]!==m?(x=n.length===1?m("details.connectionInstancesPanel.instance"):m("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=m,e[2]=x):x=e[2];let d;e[3]!==x?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:x}),e[3]=x,e[4]=d):d=e[4];let f;e[5]!==r?(f=r?t.jsx(ve,{className:"size-[13px]"}):t.jsx(xt,{size:13}),e[5]=r,e[6]=f):f=e[6];let u;e[7]!==m?(u=m("details.connectionInstancesPanel.addInstance"),e[7]=m,e[8]=u):u=e[8];let h;e[9]!==r||e[10]!==a||e[11]!==f||e[12]!==u?(h=t.jsxs(H,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:a,disabled:r,children:[f,u]}),e[9]=r,e[10]=a,e[11]=f,e[12]=u,e[13]=h):h=e[13];let g;e[14]!==d||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,h]}),e[14]=d,e[15]=h,e[16]=g):g=e[16];let b;if(e[17]!==n||e[18]!==o||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==o||e[24]!==c||e[25]!==i||e[26]!==l?(y=P=>t.jsx(Z.Suspense,{fallback:t.jsx(Xt,{instance:P,onConfigure:c}),children:t.jsx(Wt,{instance:P,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l})},P.id),e[23]=o,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],b=n.map(y),e[17]=n,e[18]=o,e[19]=c,e[20]=i,e[21]=l,e[22]=b}else b=e[22];let S;e[28]!==b?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:b}),e[28]=b,e[29]=S):S=e[29];let v;return e[30]!==g||e[31]!==S?(v=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=v):v=e[32],v}function Yt(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const o=(c.errorMessage??"").trim()||"Unknown error";n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([c,o])=>({message:c,count:o})).sort((c,o)=>o.count-c.count).slice(0,e)}const Zt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function es(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 ts={calls:{label:"Tool calls"},errors:{label:"Errors"}};function ss(s){const e=R.c(4),{connectionId:n,orgId:c,timeframe:o}=s,i=L(),l=Me(),a=es(o),{data:r}=ze({queryKey:ae.connectionActivity(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),m=yt(r?.logs??[],a,void 0,r?.total),x=m.data,d=m.totalCalls>0,f=Yt(r?.logs??[]),u=m.totalCalls>0?Math.round(m.totalErrors/m.totalCalls*100):0;let h;e[0]!==i?(h=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=h):h=e[1];let g;return e[2]!==h?(g=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:h}),e[2]=h,e[3]=g):g=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:m.totalCalls.toLocaleString()}),g]}),m.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:m.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),m.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(m.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),d?t.jsxs("div",{children:[t.jsx(kt,{config:ts,className:"h-16 w-full",children:t.jsxs(Ct,{data:x,barCategoryGap:"4%",children:[t.jsx(It,{content:t.jsx(Tt,{labelFormatter:os}),cursor:{fill:"var(--muted)"}}),t.jsx(_t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:x.map(is)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[x.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),f.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"),u>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:u.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:f.map(ns)})]})]})}function ns(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 is(s,e){return t.jsx(wt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function os(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function as(){const s=R.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 ls(s){const e=R.c(22),{connectionId:n}=s,c=L(),[o,i]=Z.useState("14d"),{org:l}=te();let a;e[0]!==c?(a=c("details.connectionActivity.activity"),e[0]=c,e[1]=a):a=e[1];let r;e[2]!==a?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a})}),e[2]=a,e[3]=r):r=e[3];let m;e[4]!==c?(m=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=m):m=e[5];let x;e[6]!==o?(x=Zt.map(b=>t.jsx("button",{type:"button","aria-pressed":o===b.value,onClick:()=>i(b.value),className:Ne("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",o===b.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:b.label},b.value)),e[6]=o,e[7]=x):x=e[7];let d;e[8]!==m||e[9]!==x?(d=t.jsx("div",{role:"group","aria-label":m,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:x}),e[8]=m,e[9]=x,e[10]=d):d=e[10];let f;e[11]!==r||e[12]!==d?(f=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,d]}),e[11]=r,e[12]=d,e[13]=f):f=e[13];let u;e[14]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(as,{}),e[14]=u):u=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==o?(h=t.jsx(Z.Suspense,{fallback:u,children:t.jsx(ss,{connectionId:n,orgId:l.id,timeframe:o})}),e[15]=n,e[16]=l.id,e[17]=o,e[18]=h):h=e[18];let g;return e[19]!==f||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,h]}),e[19]=f,e[20]=h,e[21]=g):g=e[21],g}function rs(s){const e=R.c(15),{virtualMcp:n,org:c}=s,o=se();let i;e[0]!==o||e[1]!==c||e[2]!==n.id?(i=()=>{const d=crypto.randomUUID();o({to:"/$org/$taskId",params:{org:c,taskId:d},search:{virtualmcpid:n.id}})},e[0]=o,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Te,{size:16}),e[4]=l):l=e[4];let a;e[5]!==n.icon||e[6]!==n.title?(a=t.jsx(le,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=a):a=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ie,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=m):m=e[10];let x;return e[11]!==i||e[12]!==a||e[13]!==r?(x=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:[a,r,m]}),e[11]=i,e[12]=a,e[13]=r,e[14]=x):x=e[14],x}function cs(s){const e=R.c(7),{virtualMcps:n,org:c}=s;let o;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=a=>t.jsx(rs,{virtualMcp:a,org:c},a.id),e[3]=c,e[4]=l):l=e[4],o=n.map(l),e[0]=c,e[1]=n,e[2]=o}else o=e[2];let i;return e[5]!==o?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:o})}),e[5]=o,e[6]=i):i=e[6],i}function ds(s){const e=R.c(13),{connection:n}=s,c=L(),{org:o}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=At(i);if(!(l.length>0)){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(t.Fragment,{}),e[2]=f):f=e[2],f}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let m;e[5]!==r?(m=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]=m):m=e[6];let x;e[7]!==o.slug||e[8]!==l?(x=t.jsx("div",{className:"px-5 py-4",children:t.jsx(cs,{virtualMcps:l,org:o.slug})}),e[7]=o.slug,e[8]=l,e[9]=x):x=e[9];let d;return e[10]!==m||e[11]!==x?(d=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,x]}),e[10]=m,e[11]=x,e[12]=d):d=e[12],d}function ms(s){const e=R.c(35),{tools:n,connectionId:c,org:o}=s,i=L(),l=se(),{org:a}=te();let r;e[0]!==c||e[1]!==a.id||e[2]!==a.slug?(r={connectionId:c,orgId:a.id,orgSlug:a.slug},e[0]=c,e[1]=a.id,e[2]=a.slug,e[3]=r):r=e[3];const m=we(r),x=Ce(c);let d;e[4]!==x||e[5]!==c?(d=x?Ae(x):c,e[4]=x,e[5]=c,e[6]=d):d=e[6];const f=d,[u,h]=Z.useState("");let g,b,S,v;if(e[7]!==f||e[8]!==m||e[9]!==l||e[10]!==o||e[11]!==u||e[12]!==i||e[13]!==n){const $=(n??[]).filter(us),_=u.toLowerCase().trim(),M=_?$.filter(j=>j.name.toLowerCase().includes(_)||j.description&&j.description.toLowerCase().includes(_)):$;let T;e[18]!==f||e[19]!==l||e[20]!==o?(T=j=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(j.name)}})},e[18]=f,e[19]=l,e[20]=o,e[21]=T):T=e[21];const D=T;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 N;e[24]===Symbol.for("react.memo_cache_sentinel")?(N=j=>{j.key==="Escape"&&(h(""),j.target.blur())},e[24]=N):N=e[24],e[25]!==u||e[26]!==I?(v=t.jsx(Mt,{value:u,onChange:h,placeholder:I,onKeyDown:N}),e[25]=u,e[26]=I,e[27]=v):v=e[27],g="flex-1 overflow-auto p-5",b=M.length===0?t.jsx(Se,{image:null,title:i(u?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(u?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(j=>{const E=de(j._meta);return t.jsxs(Ee,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>D(j),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Ot,{resourceURI:E,toolInfo:{tool:j},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),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:j.annotations?.title??j.name}),t.jsx(ot,{annotations:j.annotations,_meta:j._meta})]}),j.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j.description})]})]},j.name)})}),e[7]=f,e[8]=m,e[9]=l,e[10]=o,e[11]=u,e[12]=i,e[13]=n,e[14]=g,e[15]=b,e[16]=S,e[17]=v}else g=e[14],b=e[15],S=e[16],v=e[17];let y;e[28]!==g||e[29]!==b?(y=t.jsx("div",{className:g,children:b}),e[28]=g,e[29]=b,e[30]=y):y=e[30];let P;return e[31]!==S||e[32]!==v||e[33]!==y?(P=t.jsxs("div",{className:S,children:[v,y]}),e[31]=S,e[32]=v,e[33]=y,e[34]=P):P=e[34],P}function us(s){return!!de(s._meta)}function Pe(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),o=e.map(n),i=e[e.length-1];return o.length>=2&&i&&c.has(i)?[o.pop(),...o].join(" "):o.join(" ")}function re(s){const e=R.c(5),{label:n}=s,c=L();let o;e[0]!==n||e[1]!==c?(o=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=o):o=e[2];let i;return e[3]!==o?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o})}),e[3]=o,e[4]=i):i=e[4],i}function xs(s){const e=R.c(72),{tools:n,prompts:c,resources:o,connectionId:i,org:l}=s;let a;e[0]!==c?(a=c===void 0?[]:c,e[0]=c,e[1]=a):a=e[1];const r=a;let m;e[2]!==o?(m=o===void 0?[]:o,e[2]=o,e[3]=m):m=e[3];const x=m,d=L(),f=se(),u=Ce(i??"");let h;e[4]!==u||e[5]!==i?(h=u?Ae(u):i,e[4]=u,e[5]=i,e[6]=h):h=e[6];const g=h;let b;e[7]!==g||e[8]!==i||e[9]!==f||e[10]!==l?(b=function(V){!i||!l||f({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(V)}})},e[7]=g,e[8]=i,e[9]=f,e[10]=l,e[11]=b):b=e[11];const S=b;let v;e[12]!==i||e[13]!==l||e[14]!==n?(v=i&&l&&n.some(hs),e[12]=i,e[13]=l,e[14]=n,e[15]=v):v=e[15];const y=v;if(n.length+r.length+x.length===0){let C;e[16]!==d?(C=d("details.connectionCapabilities.capabilities"),e[16]=d,e[17]=C):C=e[17];let V;e[18]!==C?(V=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:C}),e[18]=C,e[19]=V):V=e[19];let Q;e[20]!==d?(Q=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[20]=d,e[21]=Q):Q=e[21];let F;e[22]!==Q?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:Q}),e[22]=Q,e[23]=F):F=e[23];let ee;return e[24]!==F||e[25]!==V?(ee=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[V,F]}),e[24]=F,e[25]=V,e[26]=ee):ee=e[26],ee}let $;e[27]!==d||e[28]!==n.length?($=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[27]=d,e[28]=n.length,e[29]=$):$=e[29];let _;e[30]!==$?(_=t.jsx(ie,{value:"tools",variant:"underline",children:$}),e[30]=$,e[31]=_):_=e[31];let M;e[32]!==y||e[33]!==d?(M=y&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[32]=y,e[33]=d,e[34]=M):M=e[34];let T;e[35]!==d?(T=d("details.connectionCapabilities.promptsTab"),e[35]=d,e[36]=T):T=e[36];let D;e[37]!==T?(D=t.jsx(ie,{value:"prompts",variant:"underline",children:T}),e[37]=T,e[38]=D):D=e[38];let I;e[39]!==d?(I=d("details.connectionCapabilities.resourcesTab"),e[39]=d,e[40]=I):I=e[40];let N;e[41]!==I?(N=t.jsx(ie,{value:"resources",variant:"underline",children:I}),e[41]=I,e[42]=N):N=e[42];let j;e[43]!==M||e[44]!==D||e[45]!==N||e[46]!==_?(j=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Pt,{variant:"underline",className:"gap-1",children:[_,M,D,N]})}),e[43]=M,e[44]=D,e[45]=N,e[46]=_,e[47]=j):j=e[47];let E;e[48]!==S||e[49]!==n?(E=n.length>0?n.map(C=>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:()=>S(C.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(Dt,{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:Pe(C.name)}),C.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:C.description})]}),t.jsx(Ie,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},C.name)):t.jsx(re,{label:"tools"}),e[48]=S,e[49]=n,e[50]=E):E=e[50];let z;e[51]!==E?(z=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[51]=E,e[52]=z):z=e[52];let k;e[53]!==i||e[54]!==y||e[55]!==l||e[56]!==n?(k=y&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ms,{tools:n,connectionId:i,org:l})}),e[53]=i,e[54]=y,e[55]=l,e[56]=n,e[57]=k):k=e[57];let A;e[58]!==r?(A=r.length>0?r.map(fs):t.jsx(re,{label:"prompts"}),e[58]=r,e[59]=A):A=e[59];let U;e[60]!==A?(U=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=U):U=e[61];let p;e[62]!==x?(p=x.length>0?x.map(ps):t.jsx(re,{label:"resources"}),e[62]=x,e[63]=p):p=e[63];let w;e[64]!==p?(w=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:p})}),e[64]=p,e[65]=w):w=e[65];let O;return e[66]!==j||e[67]!==z||e[68]!==k||e[69]!==U||e[70]!==w?(O=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs($t,{defaultValue:"tools",variant:"underline",children:[j,z,k,U,w]})}),e[66]=j,e[67]=z,e[68]=k,e[69]=U,e[70]=w,e[71]=O):O=e[71],O}function ps(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: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 fs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(ht,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Pe(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 hs(s){return de(s._meta)}function gs(s){const e=R.c(13),{connection:n,displayTitle:c}=s,o=c??n.title;let i;e[0]!==n.icon||e[1]!==o?(i=t.jsx(le,{icon:n.icon,name:o,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=o,e[2]=i):i=e[2];let l;e[3]!==o?(l=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:o})}),e[3]=o,e[4]=l):l=e[4];let a;e[5]!==n.description?(a=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=a):a=e[6];let r;e[7]!==l||e[8]!==a?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[7]=l,e[8]=a,e[9]=r):r=e[9];let m;return e[10]!==i||e[11]!==r?(m=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[i,r]}),e[10]=i,e[11]=r,e[12]=m):m=e[12],m}function js({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:o}){const i=L(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Ue(),m=(()=>{if(typeof a!="string"||!a)return!1;try{const u=new URL(a);return u.hostname==="api.githubcopilot.com"&&u.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),x=r||e.connection_type==="STDIO",d=e.connection_type==="VIRTUAL",f=d?Qt(e.connection_url):null;return d?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(Te,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),f&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(W,{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:u.value,onValueChange:u.onChange,children:[t.jsx(B,{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")}),x&&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(K,{className:"flex-1 min-w-0",children:t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:u.value,onValueChange:u.onChange,children:[t.jsx(B,{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")]})}),x&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{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(Bt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(X,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(X,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(B,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(B,{children:t.jsx(Je,{value:u.value??[],onChange:u.onChange})}),t.jsx(X,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(K,{className:"flex flex-col gap-3",children:[t.jsx(W,{className:"text-xs text-muted-foreground font-medium",children:i(m?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Et,{children:[t.jsx(Ut,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(zt,{variant:"success",className:"gap-1.5",children:[t.jsx(Vt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Ft,{size:12})]})})}),t.jsxs(Rt,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(jt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:o,children:[t.jsx(ce,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&u.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:()=>u.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(B,{children:t.jsx(J,{type:"password",placeholder:i(m?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(bt,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(X,{})]})})]})}function bs(s){return s.command==="npx"}function vs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Ns(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function je(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"&&qt(s.connection_headers)){const c=s.connection_headers,o=Ze(c.envVars);if(bs(c)){const l=vs(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o}}const i=Ns(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:o}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Ss(s){let e,n=null,c=null,o=null;return s.ui_type==="NPX"?(e="STDIO",n="",o=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",o=tt(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...o&&{connection_headers:o},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ys({connection:s,connectionId:e,org:n,isUpdating:c,tools:o,prompts:i,resources:l,siblings:a}){const r=L(),m=se({from:"/$org/settings/connections/$appSlug"}),x=Le(),d=_e(),{org:f}=te(),u=Nt({onSuccess:()=>{a.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[b,S]=Z.useState(!1),v=ye({connectionId:e}),{data:y}=at(),P=y?.data?.members??[],$=h??s,_=P.find(p=>p.userId===$.created_by),T=s?.connection_type==="VIRTUAL"||v.isAuthenticated,D={...s,tools:o},I=st(D,Kt),N=Be({resolver:He(Ye),values:je(h??s)}),j=N.formState.isDirty,E=async()=>{if(!await N.trigger())return;const w=N.getValues(),O=Ss(w),C=h?.id??e;await d.update.mutateAsync({id:C,data:O}),N.reset(w)},z=()=>{N.reset(je(h??s))},k=async p=>{const w=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:O,tokenInfo:C,error:V}=await ut({connectionId:p,orgSlug:f.slug,...w?{scope:w}:{}});if(V||!O){Y.error(r("details.connection.authFailed",{error:V??""}));return}if(C)try{const F=await fetch(`/api/${f.slug}/connections/${p}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:C.accessToken,refreshToken:C.refreshToken,expiresIn:C.expiresIn,scope:C.scope,clientId:C.clientId,clientSecret:C.clientSecret,tokenEndpoint:C.tokenEndpoint})});if(!F.ok)console.error("Failed to save OAuth token:",await F.text()),await d.update.mutateAsync({id:p,data:{connection_token:O}});else try{await d.update.mutateAsync({id:p,data:{}})}catch(ee){console.warn("Failed to refresh connection tools after OAuth:",ee)}}catch(F){console.error("Error saving OAuth token:",F),await d.update.mutateAsync({id:p,data:{connection_token:O}})}else await d.update.mutateAsync({id:p,data:{connection_token:O}});const Q=new URL(`/api/${f.slug}/mcp/${p}`,window.location.origin);await x.invalidateQueries({queryKey:ae.isMCPAuthenticated(Q.href,null)}),await x.invalidateQueries({queryKey:ae.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>k(s.id),U=async()=>{try{const p=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!p.ok){const O=await p.text();Y.error(r("details.connection.failedRemoveOAuth",{error:O}));return}const w=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await x.invalidateQueries({queryKey:ae.isMCPAuthenticated(w.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(p){console.error("Error removing OAuth token:",p),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(St,{...u}),t.jsx(Qe,{open:h!==null,onOpenChange:p=>{p||g(null)},children:t.jsxs(qe,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Ge,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(Ke,{className:"text-base",children:h?.title??s.title}),t.jsx(We,{className:"text-xs",children:r("details.connection.settingsDescription")}),_&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(lt,{url:_.user?.image??void 0,fallback:_.user?.name??_.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:_.user?.name||_.user?.email})]})]}),t.jsxs(vt,{...N,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:N.control,name:"title",render:({field:p})=>t.jsxs(K,{children:[t.jsx(W,{children:r("details.connection.nameLabel")}),t.jsx(B,{children:t.jsx(J,{...p})}),t.jsx(X,{})]})}),t.jsx(G,{control:N.control,name:"description",render:({field:p})=>t.jsxs(K,{children:[t.jsx(W,{children:r("details.connection.descriptionLabel")}),t.jsx(B,{children:t.jsx(J,{...p,value:p.value||""})}),t.jsx(X,{})]})})]}),t.jsx(js,{form:N,connection:h??s,hasOAuthToken:v.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:U}),t.jsx(nt,{connection:h??s,form:N,hasMcpBinding:I,isMCPAuthenticated:T,supportsOAuth:v.supportsOAuth,isServerError:v.isServerError,onAuthenticate:A,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(H,{onClick:E,disabled:!j||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),j&&t.jsx(H,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(H,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const p=h??s;g(null),u.requestDelete(p)},children:[t.jsx(ce,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(it,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(gs,{connection:s,displayTitle:(()=>{const p=a[0]??s;return p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ls,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Jt,{instances:a,onConfigure:p=>g(p),onAuthenticate:p=>k(p.id),onDelete:p=>u.requestDelete(p),onToggleStatus:async(p,w)=>{try{await d.update.mutateAsync({id:p.id,data:{status:w}}),Y.success(r(w==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:b,onAdd:async()=>{S(!0);try{const p=a[0]??s,w=p.title.replace(/\s*\(\d+\)\s*$/,""),O=a.length+1,C=`${w} (${O})`,V=Xe("conn");await d.create.mutateAsync({id:V,title:C,description:p.description??null,connection_type:p.connection_type,connection_url:p.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p.created_by,organization_id:p.organization_id,icon:p.icon??null,app_name:p.app_name??null,app_id:p.app_id??null,connection_headers:p.connection_headers??null,oauth_config:null,configuration_state:p.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const Q=new URL(`/api/${f.slug}/mcp/${V}`,window.location.origin),F=await mt({url:Q.href,token:null,orgId:f.id});F.supportsOAuth&&!F.isAuthenticated&&await k(V)}finally{S(!1)}}}),t.jsx(ds,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(xs,{tools:o,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function Cs(){const s=R.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 o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug"},s[1]=o):o=s[1];const{appSlug:i,org:l}=Ve(o),{org:a}=te(),r=_e();let m;s[2]!==i?(m={slug:i},s[2]=i,s[3]=m):m=s[3];const x=rt(m),d=x[0]??null,f=d?.id??"",u=f||null;let h;s[4]!==a.id||s[5]!==a.slug||s[6]!==u?(h={connectionId:u,orgId:a.id,orgSlug:a.slug},s[4]=a.id,s[5]=a.slug,s[6]=u,s[7]=h):h=s[7];const g=we(h);let b;s[8]!==g?(b={client:g},s[8]=g,s[9]=b):b=s[9];const{data:S}=ct(b);let v;if(s[10]!==d?.tools||s[11]!==f||s[12]!==x||s[13]!==S){const k=S?S.tools.map(As):(d?.tools??[]).map(Ts);e:{if(x.length<=1){v=k;break e}const A=new Set,U=[],p=ks;for(const w of x){const O=w.id===f?k:p(w.tools);for(const C of O)A.has(C.name)||(A.add(C.name),U.push(C))}v=U.length>0?U:k}s[10]=d?.tools,s[11]=f,s[12]=x,s[13]=S,s[14]=v}else v=s[14];const y=v;let P;s[15]!==g?(P={client:g},s[15]=g,s[16]=P):P=s[16];const{data:$}=dt(P);let _;s[17]!==g?(_={client:g},s[17]=g,s[18]=_):_=s[18];const{data:M}=Fe(_);let T;s[19]!==$?.prompts?(T=$?.prompts??[],s[19]=$?.prompts,s[20]=T):T=s[20];let D;s[21]!==T?(D=T.map(ws),s[21]=T,s[22]=D):D=s[22];const I=D;let N;s[23]!==M?.resources?(N=M?.resources??[],s[23]=M?.resources,s[24]=N):N=s[24];let j;s[25]!==N?(j=N.map(_s),s[25]=N,s[26]=j):j=s[26];const E=j;if(!d){let k;s[27]!==e?(k=e("details.connection.notFoundTitle"),s[27]=e,s[28]=k):k=s[28];let A;s[29]!==e?(A=e("details.connection.notFoundDescription"),s[29]=e,s[30]=A):A=s[30];let U;s[31]!==c||s[32]!==l?(U=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=U):U=s[33];let p;s[34]!==e?(p=e("details.connection.backButton"),s[34]=e,s[35]=p):p=s[35];let w;s[36]!==U||s[37]!==p?(w=t.jsx(H,{variant:"outline",onClick:U,children:p}),s[36]=U,s[37]=p,s[38]=w):w=s[38];let O;return s[39]!==k||s[40]!==A||s[41]!==w?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Se,{title:k,description:A,actions:w})}),s[39]=k,s[40]=A,s[41]=w,s[42]=O):O=s[42],O}let z;return s[43]!==r.update.isPending||s[44]!==y||s[45]!==d||s[46]!==f||s[47]!==l||s[48]!==I||s[49]!==E||s[50]!==x?(z=t.jsx(ys,{org:l,connection:d,connectionId:f,isUpdating:r.update.isPending,tools:y,prompts:I,resources:E,siblings:x}),s[43]=r.update.isPending,s[44]=y,s[45]=d,s[46]=f,s[47]=l,s[48]=I,s[49]=E,s[50]=x,s[51]=z):z=s[51],z}function _s(s){return{name:s.name,description:s.description,uri:s.uri}}function ws(s){return{name:s.name,description:s.description}}function ks(s){return(s??[]).map(Is)}function Is(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function As(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ps(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Re,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ve,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Cs,{})})}),s[0]=e):e=s[0],e}function ki(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ps,{}),s[0]=e):e=s[0],e}export{ki as default};
@@ -1 +1 @@
1
- import{ae as R,aj as A,ao as I,ag as o,af as j,ai as z,c as L,j as u,B as C}from"./index-B8v6bpri.js";import{I as H}from"./input-DW2ahhtH.js";import{s as W}from"./Plus-Bz1cAYCY.js";import{s as q}from"./Trash01-D5j2YoAs.js";const K=R({key:o().min(1,"Key is required"),value:o()}),M=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 U(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 g=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 y=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]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==y||e[20]!==g||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=>y(s,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:U(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:()=>g(s),children:u.jsx(q,{size:16})})]},s),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=y,e[13]=g,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 J(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 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,M as c,Z as d,Y as i,F as p,D as r};
1
+ import{ae as R,aj as A,ao as I,ag as o,af as j,ai as z,c as L,j as u,B as C}from"./index-KlN2gCIz.js";import{I as H}from"./input-HEtJVl9i.js";import{s as W}from"./Plus-B4HOF1E1.js";import{s as q}from"./Trash01-RcSuYrVJ.js";const K=R({key:o().min(1,"Key is required"),value:o()}),M=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 U(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 g=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 y=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]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==y||e[20]!==g||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=>y(s,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:U(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:()=>g(s),children:u.jsx(q,{size:16})})]},s),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=y,e[13]=g,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 J(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 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,M as c,Z as d,Y as i,F as p,D as r};