decocms 4.446.1 → 4.446.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 (356) hide show
  1. package/dist/client/assets/{AlertCircle-CQA_p2Cp.js → AlertCircle-DjoFdKqn.js} +1 -1
  2. package/dist/client/assets/{AreaChart-94A56lku.js → AreaChart-B4-QNIT5.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-Dl_7c8AB.js → ArrowLeft-DCPdaQBd.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-0DU20WU2.js → ArrowUp-CxGCH_mE.js} +1 -1
  5. package/dist/client/assets/{Building02-CsHqQGTj.js → Building02-DQhkI7KU.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-OVjYagl6.js → CartesianChart-B1qOpm8T.js} +1 -1
  7. package/dist/client/assets/{Check-Bo3qSXwJ.js → Check-aE-8J-dx.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-BCxvtn62.js → CheckCircle-Yu1WDdmS.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-Ds84QUAn.js → ChevronUp-Br5R9lTH.js} +1 -1
  10. package/dist/client/assets/{Copy01-QNdLW2v3.js → Copy01-CtLn8eQC.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-D1KkCG7o.js → CreditCard01-DARYnajC.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-Dyi1_2jC.js → DotsVertical-BkKYV-uH.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-Dckliguf.js → ErrorBarContext-C1OQDTFH.js} +1 -1
  14. package/dist/client/assets/{Image01-0Rs0fG3a.js → Image01-CUJhdG59.js} +1 -1
  15. package/dist/client/assets/{Key01-DvlZjbjO.js → Key01-DA8aX6Mo.js} +1 -1
  16. package/dist/client/assets/{Line-BZPiXXVf.js → Line-rn1mQt36.js} +1 -1
  17. package/dist/client/assets/{Link01-3DcN1bgm.js → Link01-PgFxgiYI.js} +1 -1
  18. package/dist/client/assets/{LinkBroken01-8QjnprbC.js → LinkBroken01-_oPW_2dj.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-CLN31q0P.js → LinkExternal01-Bzb2WBKu.js} +1 -1
  20. package/dist/client/assets/{Monitor01-C0xXEFc5.js → Monitor01-evoIPilr.js} +1 -1
  21. package/dist/client/assets/{Palette-CaoJ793n.js → Palette-CI5-z0zm.js} +1 -1
  22. package/dist/client/assets/{Plus-DUwLVLW_.js → Plus-MXLtMY7l.js} +1 -1
  23. package/dist/client/assets/{SearchMd-BiNHdvMf.js → SearchMd-D2iMNQwW.js} +1 -1
  24. package/dist/client/assets/{Sector-DrcdpRCF.js → Sector-C_r2Ffen.js} +1 -1
  25. package/dist/client/assets/{ShoppingBag01-BlgcPhxp.js → ShoppingBag01-BUSIbN12.js} +1 -1
  26. package/dist/client/assets/{Sun-aSGS3XrK.js → Sun-DaF8KN8m.js} +1 -1
  27. package/dist/client/assets/{Tool01-BuLiX0jy.js → Tool01-BgPGiYBJ.js} +1 -1
  28. package/dist/client/assets/{Trash01-DtMJF0U3.js → Trash01-DEfHm1-C.js} +1 -1
  29. package/dist/client/assets/{Upload01-C2lcKrsy.js → Upload01-AiwUaS84.js} +1 -1
  30. package/dist/client/assets/{User01-DmaMR1Ca.js → User01-BJjdpbkY.js} +1 -1
  31. package/dist/client/assets/{UserSquare-B0WZmX6s.js → UserSquare-DkdLf214.js} +1 -1
  32. package/dist/client/assets/{Users01-C8SJUk8C.js → Users01-DB-isk4t.js} +1 -1
  33. package/dist/client/assets/{X-BO04Dn0R.js → X-BHK_66ka.js} +1 -1
  34. package/dist/client/assets/{XAxis-DjkUxR47.js → XAxis-alrFH4LG.js} +1 -1
  35. package/dist/client/assets/{XClose-DwKTRWak.js → XClose-oHtKIul6.js} +1 -1
  36. package/dist/client/assets/{ZoomOut-hhnEYknp.js → ZoomOut-tzNSNsYS.js} +1 -1
  37. package/dist/client/assets/{access-gate-g4Ol-Lnp.js → access-gate-DCBw1mxT.js} +1 -1
  38. package/dist/client/assets/{add-connection-dialog-BB1INtAa.js → add-connection-dialog-CxePJyfV.js} +1 -1
  39. package/dist/client/assets/{agent-analytics-UbMmc2xM.js → agent-analytics-CmDIgmaf.js} +1 -1
  40. package/dist/client/assets/agent-app-BFLhnOBw.js +1 -0
  41. package/dist/client/assets/{agent-assets-DFJmMVeP.js → agent-assets-BKN8mrH9.js} +1 -1
  42. package/dist/client/assets/{agent-automation-gh60EKv-.js → agent-automation-D2_4jFte.js} +1 -1
  43. package/dist/client/assets/{agent-automations-Cyb-cCIs.js → agent-automations-BdO5Otm-.js} +1 -1
  44. package/dist/client/assets/{agent-connect-sources-C93dhycr.js → agent-connect-sources-C_Vz66Hn.js} +1 -1
  45. package/dist/client/assets/agent-deck-SJNcwym0.js +1 -0
  46. package/dist/client/assets/{agent-e2e-CRjvTqPc.js → agent-e2e-BtxZGTPP.js} +1 -1
  47. package/dist/client/assets/{agent-experiments-Od-fEEVw.js → agent-experiments-jrY0lkQL.js} +1 -1
  48. package/dist/client/assets/{agent-file-Uip3fQYD.js → agent-file-DW7h_l0N.js} +1 -1
  49. package/dist/client/assets/{agent-git-BJ3uVxrR.js → agent-git-CNZofsuU.js} +1 -1
  50. package/dist/client/assets/{agent-hosting-Cpk5ThRL.js → agent-hosting-Do0x_Cui.js} +1 -1
  51. package/dist/client/assets/{agent-icon-C8zn459s.js → agent-icon-B_yyO4wu.js} +1 -1
  52. package/dist/client/assets/agent-library-CZwkAyEb.js +1 -0
  53. package/dist/client/assets/agent-library-file-BNnVRc85.js +1 -0
  54. package/dist/client/assets/{agent-monitor-DKWpCvbH.js → agent-monitor-qUYNqgR7.js} +1 -1
  55. package/dist/client/assets/{agent-overview-C0CBjtgK.js → agent-overview-CIJcl1y9.js} +1 -1
  56. package/dist/client/assets/agent-settings-DRae4Kkc.js +1 -0
  57. package/dist/client/assets/{agent-site-editor-C9GivBz_.js → agent-site-editor-CGcJkBvQ.js} +1 -1
  58. package/dist/client/assets/agent-site-editor-code-DZBVrZ49.js +2 -0
  59. package/dist/client/assets/{agent-site-editor-content-CGWvdS7C.js → agent-site-editor-content-C3un--7d.js} +3 -3
  60. package/dist/client/assets/{agent-site-editor-preview-TbwhHm-5.js → agent-site-editor-preview-CzW3y0aF.js} +3 -3
  61. package/dist/client/assets/agent-view-D4okXxIR.js +1 -0
  62. package/dist/client/assets/{agent-view-guard-CYaQjfk2.js → agent-view-guard-COpIrMD5.js} +1 -1
  63. package/dist/client/assets/{agents-list-BhjRlvRY.js → agents-list-DbnK_TS0.js} +1 -1
  64. package/dist/client/assets/{ai-providers-UcNEAf_J.js → ai-providers-BWZH15D3.js} +1 -1
  65. package/dist/client/assets/{alert-DwmQ7qtd.js → alert-B1_hjg8d.js} +1 -1
  66. package/dist/client/assets/{alert-dialog-zI-mFpSQ.js → alert-dialog-D39kK11B.js} +1 -1
  67. package/dist/client/assets/{analytics-sections-rNV5HZ50.js → analytics-sections-DioPGL-G.js} +1 -1
  68. package/dist/client/assets/{api-keys-sSvDZG99.js → api-keys-DRbDIYDv.js} +1 -1
  69. package/dist/client/assets/api-keys-Js_fbclL.js +1 -0
  70. package/dist/client/assets/app-editor-Cm4YSTQy.js +1 -0
  71. package/dist/client/assets/{asset-utils-C3FMP3nb.js → asset-utils-BO8plCL6.js} +1 -1
  72. package/dist/client/assets/{auth-DQuDCDTH.js → auth-BII1ityf.js} +1 -1
  73. package/dist/client/assets/{auth-catchall-BTTBnKvo.js → auth-catchall-DRT8MYeJ.js} +1 -1
  74. package/dist/client/assets/{auth-entry-XM1FbOYg.js → auth-entry-0e7KL3PN.js} +1 -1
  75. package/dist/client/assets/{auth-split-layout-mHJ8Mnv8.js → auth-split-layout-Bg4lwkz7.js} +1 -1
  76. package/dist/client/assets/{authenticate-and-persist-oauth--Ui7uUW3.js → authenticate-and-persist-oauth-D4OxRuRh.js} +1 -1
  77. package/dist/client/assets/{automation-list-row-Cph_qNFz.js → automation-list-row-cmz2A1Mm.js} +1 -1
  78. package/dist/client/assets/{automation-runs-Bk7987tn.js → automation-runs-By1RUmSp.js} +1 -1
  79. package/dist/client/assets/{automations-BusQTRzA.js → automations-Dxsyy-_P.js} +1 -1
  80. package/dist/client/assets/{autosend-B7xOxZCV.js → autosend-B3t52XX_.js} +1 -1
  81. package/dist/client/assets/{avatar-BxSXBdTP.js → avatar-BTitfgsj.js} +1 -1
  82. package/dist/client/assets/{badge-Bkod8faG.js → badge-E2auaQms.js} +1 -1
  83. package/dist/client/assets/{block-document-CFi5j69X.js → block-document-C0DAZm8i.js} +1 -1
  84. package/dist/client/assets/{blocks-preview-workspace-context-CNAK__es.js → blocks-preview-workspace-context-Pq5_mqQ_.js} +1 -1
  85. package/dist/client/assets/{buckets-8h9eIrQM.js → buckets-BJvCDpwG.js} +1 -1
  86. package/dist/client/assets/{build-improve-prompt-doc-BbWygkjj.js → build-improve-prompt-doc-DbrN2I_U.js} +1 -1
  87. package/dist/client/assets/{calendar-BL2c1BVO.js → calendar-1uM2n-Jw.js} +1 -1
  88. package/dist/client/assets/{capability-load-error-AIgwu68M.js → capability-load-error--JlNKsUV.js} +1 -1
  89. package/dist/client/assets/{category-editor-By6DtwpQ.js → category-editor-BRLR25s7.js} +1 -1
  90. package/dist/client/assets/{chart-NHKhTpOL.js → chart-BWgcHAUx.js} +1 -1
  91. package/dist/client/assets/{chat-context-CvEgaFCN.js → chat-context-rrrEGdS4.js} +1 -1
  92. package/dist/client/assets/{chat-draft-jBRWjVIJ.js → chat-draft-dKpt_1aH.js} +1 -1
  93. package/dist/client/assets/{checkbox-DM1zG_bR.js → checkbox-Dzt92tI8.js} +1 -1
  94. package/dist/client/assets/{choose-editor-DXMPbOcS.js → choose-editor-CuReZRwP.js} +1 -1
  95. package/dist/client/assets/{claim-phase-copy-DOJxxCtG.js → claim-phase-copy-BIkHWTfz.js} +1 -1
  96. package/dist/client/assets/{cli-auth-success-RzErssq7.js → cli-auth-success-Cgszpcpc.js} +1 -1
  97. package/dist/client/assets/{client-icons-CpN46V1K.js → client-icons-7ySP-Erv.js} +1 -1
  98. package/dist/client/assets/{collapsible-DckFjvhZ.js → collapsible-wtqcAzkF.js} +1 -1
  99. package/dist/client/assets/{collection-detail-BhrjxRoz.js → collection-detail-DFQ_Ozgb.js} +1 -1
  100. package/dist/client/assets/{collection-display-button-B4IWBje6.js → collection-display-button-C5weD_DC.js} +1 -1
  101. package/dist/client/assets/{collection-search-Cp0gVUrY.js → collection-search-B7qdcCbg.js} +1 -1
  102. package/dist/client/assets/{collection-table-wrapper-Bww62NEV.js → collection-table-wrapper-Ca4ZKWBI.js} +1 -1
  103. package/dist/client/assets/{collection-tabs-DujOg3C7.js → collection-tabs-B4z9WtuV.js} +1 -1
  104. package/dist/client/assets/{column-rules-DjRlzWHk.js → column-rules-D1hu0gi4.js} +1 -1
  105. package/dist/client/assets/{combobox-2qhSjEFr.js → combobox-pwfK5e2Y.js} +1 -1
  106. package/dist/client/assets/{command-ZBxh5GnQ.js → command-DTs9ObR-.js} +1 -1
  107. package/dist/client/assets/{companion-mcps-section-CDnsqeV6.js → companion-mcps-section-BRquAdAG.js} +1 -1
  108. package/dist/client/assets/{config-DK92N2N0.js → config-C96MdU2Q.js} +1 -1
  109. package/dist/client/assets/{connect-lp3YwtIU.js → connect-JpHHEq0g.js} +1 -1
  110. package/dist/client/assets/{connect-layout-BmKB0MQt.js → connect-layout-C6hpYb9u.js} +1 -1
  111. package/dist/client/assets/{connection-Bw7PTYac.js → connection-B2m_fkQ_.js} +1 -1
  112. package/dist/client/assets/{connection-card-BE5DxUWL.js → connection-card-DBWNFKql.js} +1 -1
  113. package/dist/client/assets/{connection-detail-D4H16vJ0.js → connection-detail-C0vRZ2H6.js} +1 -1
  114. package/dist/client/assets/{connection-form-helpers-B0fzrlcU.js → connection-form-helpers-BwQZA_xH.js} +1 -1
  115. package/dist/client/assets/{connections-D_QAyydr.js → connections-CDnUvJCF.js} +1 -1
  116. package/dist/client/assets/{context-0yOwY8Xe.js → context-Dkg4joGs.js} +1 -1
  117. package/dist/client/assets/{context-menu-CzHrYgyK.js → context-menu-CEwcq9KD.js} +1 -1
  118. package/dist/client/assets/{create-organization-dialog-uaygtZt_.js → create-organization-dialog-B_uh2TuL.js} +1 -1
  119. package/dist/client/assets/{daily-pulse-DQNDzVjv.js → daily-pulse-Dj713Lim.js} +1 -1
  120. package/dist/client/assets/{decopilot-BdkjG-bD.js → decopilot-DNRWEod6.js} +1 -1
  121. package/dist/client/assets/{device-hint-D3ZO4Iw7.js → device-hint-CPjfUQMP.js} +1 -1
  122. package/dist/client/assets/{dialog-DC6TmMkf.js → dialog-BDXg80r_.js} +1 -1
  123. package/dist/client/assets/{discover-BLKvCoGk.js → discover-C1wwFXVd.js} +1 -1
  124. package/dist/client/assets/{domain-settings-BVxXQdaO.js → domain-settings-DbZZ4hAo.js} +1 -1
  125. package/dist/client/assets/{download-app-dialog-CEx38Fcv.js → download-app-dialog-CgdOlOsO.js} +1 -1
  126. package/dist/client/assets/{drawer-BUMMA5sr.js → drawer-DAp1D7F-.js} +1 -1
  127. package/dist/client/assets/{editor-CJUNgGBw.js → editor-D6ylwlDD.js} +1 -1
  128. package/dist/client/assets/{empty-state-CDvZ4pSZ.js → empty-state-BWACKPTq.js} +1 -1
  129. package/dist/client/assets/{empty-state-ftdhK3Qw.js → empty-state-DXW-Qm8C.js} +1 -1
  130. package/dist/client/assets/{extract-connection-data-VVSQT7HS.js → extract-connection-data-C3og9nET.js} +1 -1
  131. package/dist/client/assets/{feature-gate-BYR6DKao.js → feature-gate-DvnLrc-B.js} +1 -1
  132. package/dist/client/assets/{feature-paywall-Pv-riKE7.js → feature-paywall-C__T43mL.js} +1 -1
  133. package/dist/client/assets/{file-explorer-BpCZxL2W.js → file-explorer-BlJGBAuC.js} +1 -1
  134. package/dist/client/assets/{file-preview-C_Ah7YRc.js → file-preview-BQqXnMWa.js} +1 -1
  135. package/dist/client/assets/{file-share-button-C8uAgffH.js → file-share-button-B0H2-78i.js} +1 -1
  136. package/dist/client/assets/{file-type-icon-CQEUNMAM.js → file-type-icon-DzrUMDgr.js} +1 -1
  137. package/dist/client/assets/flat-project-nMTKhWNR.js +1 -0
  138. package/dist/client/assets/{folder-icon-B1vzKX5d.js → folder-icon-CnNcFzK_.js} +1 -1
  139. package/dist/client/assets/{form-R8MW_Gtw.js → form-BQW41VGV.js} +1 -1
  140. package/dist/client/assets/{gateway-client-Dv4XJFUM.js → gateway-client-DeH7kjYP.js} +1 -1
  141. package/dist/client/assets/{general-CtUtUhHu.js → general-DpC2Xqx-.js} +1 -1
  142. package/dist/client/assets/{home-DV_eNq6b.js → home-BGumdQEa.js} +1 -1
  143. package/dist/client/assets/{icon-button-Blj1QpLb.js → icon-button-DexH_d8x.js} +1 -1
  144. package/dist/client/assets/{index-Cvm8dv5Z.js → index-B5AhRWPJ.js} +1 -1
  145. package/dist/client/assets/{index--FVWSK_c.js → index-BYU2fptV.js} +1 -1
  146. package/dist/client/assets/{index-CZDhy56e.js → index-BaM-tpLs.js} +3 -3
  147. package/dist/client/assets/{index-Bpt0MDIX.js → index-Ce0CI_HW.js} +1 -1
  148. package/dist/client/assets/{index-Ck6X-2qm.js → index-Cf73Fziv.js} +1 -1
  149. package/dist/client/assets/{index-CwSrznSB.js → index-Cy_i_3Zg.js} +1 -1
  150. package/dist/client/assets/{index-MmpnLDGH.js → index-DCe0TA20.js} +1 -1
  151. package/dist/client/assets/{index-BE867Qee.js → index-DD17LdOo.js} +2 -2
  152. package/dist/client/assets/{index-0M4CmMBW.js → index-DKop9cOd.js} +1 -1
  153. package/dist/client/assets/{index-CaSLW3R8.js → index-DXEiFGhx.js} +1 -1
  154. package/dist/client/assets/{index-CM8cxFEW.js → index-Dq_1-8A2.js} +1 -1
  155. package/dist/client/assets/{index-6OICj4ln.js → index-Dsl1ukJt.js} +1 -1
  156. package/dist/client/assets/{index-XL6-vv-o.js → index-N3y65NSG.js} +1 -1
  157. package/dist/client/assets/{index-CE-LgiHP.js → index-bQA4cKD0.js} +1 -1
  158. package/dist/client/assets/{index-redirect-BdJPlstn.js → index-redirect-6LEJgFFV.js} +1 -1
  159. package/dist/client/assets/{index-BcuaxK20.js → index-yQ2CKmbB.js} +1 -1
  160. package/dist/client/assets/{infiniteQueryObserver-B0NvduwT.js → infiniteQueryObserver-DjN6qwGN.js} +1 -1
  161. package/dist/client/assets/{infra-billing-Ks9T1Sq9.js → infra-billing-ByEqMCug.js} +1 -1
  162. package/dist/client/assets/{input-DWWEe804.js → input-BbeG6cTt.js} +1 -1
  163. package/dist/client/assets/{input-BUuO9CZI.js → input-VO0irtoo.js} +3 -3
  164. package/dist/client/assets/{input-CmcPYdOc.js → input-fqK_PA15.js} +1 -1
  165. package/dist/client/assets/{integration-icon-aoXYYKdZ.js → integration-icon-DNr48VB-.js} +1 -1
  166. package/dist/client/assets/{label-CpTis3ZF.js → label-DeoZl-yW.js} +1 -1
  167. package/dist/client/assets/{layout-BmpAxoQw.js → layout-CssYzEFi.js} +1 -1
  168. package/dist/client/assets/{legacy-agents-deep-dsUZ1M1k.js → legacy-agents-deep-Di8U03Ks.js} +1 -1
  169. package/dist/client/assets/{legacy-main-redirect-BSs4XNwX.js → legacy-main-redirect-aXZ00Ch4.js} +1 -1
  170. package/dist/client/assets/library-BsFI4hAN.js +1 -0
  171. package/dist/client/assets/{library-tab-Bx_O7czI.js → library-tab-DO-vL1Sp.js} +1 -1
  172. package/dist/client/assets/{login-Bs8ZDJgZ.js → login-CIyCTb3_.js} +1 -1
  173. package/dist/client/assets/{markdown-Bmw63uOU.js → markdown-CDhnofjs.js} +1 -1
  174. package/dist/client/assets/{mcp-app-renderer-fAGsYxUD.js → mcp-app-renderer-2ABF18H4.js} +1 -1
  175. package/dist/client/assets/{mcp-oauth-DOvgIVsQ.js → mcp-oauth-DRu55AOe.js} +1 -1
  176. package/dist/client/assets/{members-cQXKvPTX.js → members-DJvZO0Gs.js} +1 -1
  177. package/dist/client/assets/{memory-C9LPerZ9.js → memory-CHY8Nsh9.js} +1 -1
  178. package/dist/client/assets/{message-templates-s_ZoUf0b.js → message-templates-CAOd2UKb.js} +1 -1
  179. package/dist/client/assets/{mini-report-page-BpUKaSbF.js → mini-report-page-BAjp42Eo.js} +1 -1
  180. package/dist/client/assets/{mock-board-GWZVcMrh.js → mock-board-Ci0rJP9S.js} +1 -1
  181. package/dist/client/assets/{monaco-editor-CQc-iURz.js → monaco-editor-B9-EbuZp.js} +1 -1
  182. package/dist/client/assets/{monitoring-stats-row-CIORylAm.js → monitoring-stats-row-C4IvvKh8.js} +1 -1
  183. package/dist/client/assets/{multi-select-DgYPzhCT.js → multi-select-DWjLi79A.js} +1 -1
  184. package/dist/client/assets/{mustache-CSxb2mPF.js → mustache-CGqpmqnY.js} +1 -1
  185. package/dist/client/assets/{new-project-dialog-QzgehZk_.js → new-project-dialog-aJ5dJ1rh.js} +1 -1
  186. package/dist/client/assets/{oauth-callback-xEhmpXdh.js → oauth-callback-CTZ5IMCe.js} +1 -1
  187. package/dist/client/assets/{oauth-callback-ai-provider-D3V_oXs6.js → oauth-callback-ai-provider-DQXOWeoZ.js} +1 -1
  188. package/dist/client/assets/{onboarding-CBuQm5u4.js → onboarding-BY2hI8B5.js} +1 -1
  189. package/dist/client/assets/{openai-conversation-BC7ip1oe.js → openai-conversation-oO5Jtxhx.js} +1 -1
  190. package/dist/client/assets/{optimistic-project-sidebar-views-BRgs7fHb.js → optimistic-project-sidebar-views-DCkPfpOs.js} +1 -1
  191. package/dist/client/assets/{org-file-open-context-hWHGVIMb.js → org-file-open-context-BkQsHsKZ.js} +1 -1
  192. package/dist/client/assets/{organization-choice-BRq-jJ2y.js → organization-choice-Cv2hkzvH.js} +1 -1
  193. package/dist/client/assets/{orgs-EVoggyaK.js → orgs-Cy2r07rI.js} +1 -1
  194. package/dist/client/assets/{page-seo-form-Bj5T5rN8.js → page-seo-form-Mk2av7Sl.js} +1 -1
  195. package/dist/client/assets/{pair-DKzXjxOb.js → pair-DdTx6Iw4.js} +1 -1
  196. package/dist/client/assets/{plan-ladder-BtE6OACw.js → plan-ladder-wwhl4s-D.js} +1 -1
  197. package/dist/client/assets/{popover-CabOm1Wu.js → popover-WjvvubuZ.js} +1 -1
  198. package/dist/client/assets/{post-calendar-w0VgMnGf.js → post-calendar-BNR4t9ZN.js} +1 -1
  199. package/dist/client/assets/{post-editor-B82uurtc.js → post-editor-DOklsxV3.js} +1 -1
  200. package/dist/client/assets/{preview-content-CN_ZoH0s.js → preview-content-DPf79jXA.js} +1 -1
  201. package/dist/client/assets/{preview-dialog-DXrNofiq.js → preview-dialog-xi299w6D.js} +1 -1
  202. package/dist/client/assets/{profile-ZDdV7Sjt.js → profile-BEB3wVnr.js} +1 -1
  203. package/dist/client/assets/{project-app-view-Cd6lCir_.js → project-app-view-CPv6WSxO.js} +1 -1
  204. package/dist/client/assets/{project-feed-DKk1GtFx.js → project-feed-BIBH3UPz.js} +1 -1
  205. package/dist/client/assets/{project-icon-CeJwJwGP.js → project-icon-D1c3GFHZ.js} +1 -1
  206. package/dist/client/assets/project-reports-DgCdGEvu.js +1 -0
  207. package/dist/client/assets/project-tasks-CM7ap7PD.js +1 -0
  208. package/dist/client/assets/{projects-empty-state-BZB9j08t.js → projects-empty-state-B79AOVTQ.js} +1 -1
  209. package/dist/client/assets/{projects-B2Tngpmc.js → projects-rXHz0BaU.js} +1 -1
  210. package/dist/client/assets/{prompts-DNtPf-Uo.js → prompts-BCxnWdIU.js} +1 -1
  211. package/dist/client/assets/record-editor-y816y4Ir.js +1 -0
  212. package/dist/client/assets/{redirect-editor-79Kd-396.js → redirect-editor-DeKPZWhP.js} +1 -1
  213. package/dist/client/assets/reports-D8CHApNA.js +1 -0
  214. package/dist/client/assets/{reports-k2lgDaV5.js → reports-DGvj55Ah.js} +1 -1
  215. package/dist/client/assets/{reports-onboarding-azHAAu-G.js → reports-onboarding-B7ECOmwM.js} +1 -1
  216. package/dist/client/assets/{reports-tab-CdMrxIwA.js → reports-tab-DToyyT3v.js} +2 -2
  217. package/dist/client/assets/{repositories-hjUQ2loa.js → repositories-DQB7QntA.js} +1 -1
  218. package/dist/client/assets/{repository-binding-kLfd1JPC.js → repository-binding-CJ_pw95F.js} +1 -1
  219. package/dist/client/assets/{repository-import-picker-C4bVjDlN.js → repository-import-picker-Dr1vQH8s.js} +1 -1
  220. package/dist/client/assets/{repository-picker-CSvuMd3o.js → repository-picker-C5h4QyUX.js} +1 -1
  221. package/dist/client/assets/{require-capability-tQig_059.js → require-capability-CdLM5-q0.js} +1 -1
  222. package/dist/client/assets/{required-auth-layout-CVAQQhe-.js → required-auth-layout-DErGL9Rh.js} +1 -1
  223. package/dist/client/assets/{reset-password-D34LCqZt.js → reset-password-D81cB6v9.js} +1 -1
  224. package/dist/client/assets/{resizable-DncVAUZ5.js → resizable-CkV4haoj.js} +1 -1
  225. package/dist/client/assets/{resolve-tab-icon-1rWgS1Jh.js → resolve-tab-icon-2k8oZvTh.js} +1 -1
  226. package/dist/client/assets/{review-settings-D_4cx7Vi.js → review-settings-CcqxaPA7.js} +1 -1
  227. package/dist/client/assets/{rich-text-link-control-BWM1Qfc8.js → rich-text-link-control-C94WsSn4.js} +1 -1
  228. package/dist/client/assets/{roles-3KA0vrRL.js → roles-CwOlJtAT.js} +1 -1
  229. package/dist/client/assets/{route-9df-A80E.js → route-Bk-qMy-9.js} +1 -1
  230. package/dist/client/assets/route-Ct8T-J8s.js +1 -0
  231. package/dist/client/assets/{route-Dnh3EpsD.js → route-DFtzuP8H.js} +1 -1
  232. package/dist/client/assets/{runnable-block-editor-DjjqZBfa.js → runnable-block-editor-DJs4CTRJ.js} +1 -1
  233. package/dist/client/assets/{sandbox-lifecycle-context-BlOR06Zw.js → sandbox-lifecycle-context-xQTXGx64.js} +1 -1
  234. package/dist/client/assets/{schema-CaBw1j44.js → schema-BPz-DoxV.js} +1 -1
  235. package/dist/client/assets/{scroll-area-BlYZotDi.js → scroll-area-BYX63UJI.js} +1 -1
  236. package/dist/client/assets/{search-input-B5un_Cd7.js → search-input-BML3Kenk.js} +1 -1
  237. package/dist/client/assets/{search-toggle-DgedUVLj.js → search-toggle-CvhVGWw1.js} +1 -1
  238. package/dist/client/assets/{secret-picker-CtZnmzu1.js → secret-picker-B9rV98rP.js} +1 -1
  239. package/dist/client/assets/{secrets-CSt6RJDc.js → secrets-CXLj5c-L.js} +1 -1
  240. package/dist/client/assets/{sections-editor-BW7HMRFS.js → sections-editor-CnNLFRme.js} +1 -1
  241. package/dist/client/assets/{select-CYYv9Vtn.js → select-CvaUVwrC.js} +1 -1
  242. package/dist/client/assets/{select-model-BMFiXFaW.js → select-model-C1nF3qen.js} +1 -1
  243. package/dist/client/assets/{seo-editor-BqY8Ur2i.js → seo-editor-GB3MOC4z.js} +1 -1
  244. package/dist/client/assets/{separator-Cl4FYhEq.js → separator-CR_-CVBp.js} +1 -1
  245. package/dist/client/assets/{settings-tab-CLqtPJZG.js → settings-tab-CLxqNPs8.js} +1 -1
  246. package/dist/client/assets/{sheet-CmXNGCBA.js → sheet-BID6Bcl4.js} +1 -1
  247. package/dist/client/assets/{shell-layout-D2P6ouzP.js → shell-layout-B48Lo5Zk.js} +1 -1
  248. package/dist/client/assets/{skills-C1v0xaAk.js → skills-CckAVRfc.js} +1 -1
  249. package/dist/client/assets/{sso-BthSYQ1g.js → sso-ILTug89T.js} +1 -1
  250. package/dist/client/assets/{suggestion-DRMbopje.js → suggestion-BriuVru4.js} +1 -1
  251. package/dist/client/assets/{switch-B6KzjFhw.js → switch-CDzEt_Yx.js} +1 -1
  252. package/dist/client/assets/{synced-repos-CnPrjVSO.js → synced-repos-xqnoVQ3o.js} +1 -1
  253. package/dist/client/assets/{tab-icon-glyph-B6O2AOCF.js → tab-icon-glyph-DfT7jmRq.js} +1 -1
  254. package/dist/client/assets/{table-BHDtYz9k.js → table-8bUT8seV.js} +1 -1
  255. package/dist/client/assets/{tabs-CfLMYw89.js → tabs-BaxVRsCI.js} +1 -1
  256. package/dist/client/assets/{task-board-C7HcCxeg.js → task-board-D2BE2LPw.js} +1 -1
  257. package/dist/client/assets/{task-route-bn2URA0q.js → task-route-BlXoLKUv.js} +1 -1
  258. package/dist/client/assets/{task-status-C4kf54Sm.js → task-status-BMtNEPmq.js} +1 -1
  259. package/dist/client/assets/{taskboard-analytics-B2xD2xvd.js → taskboard-analytics-BfH8uJBw.js} +1 -1
  260. package/dist/client/assets/{tasks-OZpkcyom.js → tasks-BOz1Ws1V.js} +1 -1
  261. package/dist/client/assets/tasks-Dsw3egox.js +1 -0
  262. package/dist/client/assets/{textarea-D_VH3s7x.js → textarea-C7A4jkvL.js} +1 -1
  263. package/dist/client/assets/{thread-analytics-U5yFfcuN.js → thread-analytics-Jd9FTruE.js} +1 -1
  264. package/dist/client/assets/{thread-button-BHZP_s0g.js → thread-button-DNHhXrfO.js} +1 -1
  265. package/dist/client/assets/{thread-intent-tToQ_3Cn.js → thread-intent-wfAGHI9k.js} +1 -1
  266. package/dist/client/assets/{thread-route-Bzzi_5mF.js → thread-route-BWW9Xj2f.js} +1 -1
  267. package/dist/client/assets/{thread-route-CUOWsTdF.js → thread-route-DsI5gcIr.js} +1 -1
  268. package/dist/client/assets/{thread-sheet-body-B0QtugED.js → thread-sheet-body-Bd1XBkek.js} +1 -1
  269. package/dist/client/assets/{toggle-group-BrWdayuI.js → toggle-group-C85PVL3X.js} +1 -1
  270. package/dist/client/assets/{toolbar-icon-button-Dn4ZIc9O.js → toolbar-icon-button-DKjVMod_.js} +1 -1
  271. package/dist/client/assets/{tooltip-2Ew10_I0.js → tooltip-Cyc9NKXJ.js} +1 -1
  272. package/dist/client/assets/{track-DH05wicf.js → track-p_LAuNvK.js} +1 -1
  273. package/dist/client/assets/{types-DSEqfHk2.js → types-l4l1-swZ.js} +1 -1
  274. package/dist/client/assets/{usage-stats-y5sLQYFP.js → usage-stats-EK6mC9s2.js} +1 -1
  275. package/dist/client/assets/{use-ai-providers-jnOy5tNY.js → use-ai-providers-BKLzJh1_.js} +1 -1
  276. package/dist/client/assets/{use-automations-CZEM3KgU.js → use-automations-D3x6QSEG.js} +1 -1
  277. package/dist/client/assets/{use-autosave-Bk6osCzP.js → use-autosave-oFSjwwUF.js} +1 -1
  278. package/dist/client/assets/{use-chat-layout-state-BbJD-IRs.js → use-chat-layout-state-0qWIlbnk.js} +1 -1
  279. package/dist/client/assets/{use-clock-tick-BY0qK7ow.js → use-clock-tick-BYTJfFPJ.js} +1 -1
  280. package/dist/client/assets/{use-connect-companion-D6e9vX_L.js → use-connect-companion-DZDzQd28.js} +1 -1
  281. package/dist/client/assets/{use-connection-x3pfvWpW.js → use-connection-BDIMmEql.js} +1 -1
  282. package/dist/client/assets/{use-copy-CJPO8CYZ.js → use-copy-DNk3vyQa.js} +1 -1
  283. package/dist/client/assets/{use-create-virtual-mcp-BDos_868.js → use-create-virtual-mcp-BpxFtCSO.js} +1 -1
  284. package/dist/client/assets/{use-date-fns-locale-vNVrC6Qj.js → use-date-fns-locale-CatCLOAz.js} +1 -1
  285. package/dist/client/assets/{use-debounced-autosave-zy5tN1OH.js → use-debounced-autosave-BqsvUMpV.js} +1 -1
  286. package/dist/client/assets/{use-debounced-value-Cjq6wHlM.js → use-debounced-value-CMs08Lup.js} +1 -1
  287. package/dist/client/assets/{use-deco-credits-BBnccG_w.js → use-deco-credits-DO_Mi4f2.js} +1 -1
  288. package/dist/client/assets/{use-decopilot-events-CCMkDtUe.js → use-decopilot-events-BY_hixqd.js} +1 -1
  289. package/dist/client/assets/{use-delete-connection-C6BGGvaV.js → use-delete-connection-JYdb3g8I.js} +1 -1
  290. package/dist/client/assets/{use-deployment-admin-CrwlatSG.js → use-deployment-admin-lMjJ-tOg.js} +1 -1
  291. package/dist/client/assets/{use-fast-preview-draft-url-Z9tq3pqw.js → use-fast-preview-draft-url-D8bUARFA.js} +1 -1
  292. package/dist/client/assets/{use-file-configs-D6BnOxCa.js → use-file-configs-BYFcKLTt.js} +1 -1
  293. package/dist/client/assets/{use-infinite-scroll-Cj7K2rNB.js → use-infinite-scroll-D_h1bU_O.js} +1 -1
  294. package/dist/client/assets/{use-join-requests-8kDr2sOv.js → use-join-requests-CuheCnou.js} +1 -1
  295. package/dist/client/assets/{use-main-panel-tabs-CAIlwMdR.js → use-main-panel-tabs-CT7NVKmX.js} +1 -1
  296. package/dist/client/assets/{use-mcp-auth-status-DaNrG9Qa.js → use-mcp-auth-status-C0JasP2w.js} +1 -1
  297. package/dist/client/assets/{use-mcp-client-BGKUmMJU.js → use-mcp-client-BwmV3MW8.js} +1 -1
  298. package/dist/client/assets/{use-mcp-prompts-Brgv7p5b.js → use-mcp-prompts-DfL0DKop.js} +1 -1
  299. package/dist/client/assets/{use-mcp-tools-D65vA86V.js → use-mcp-tools-DaY04Cnx.js} +1 -1
  300. package/dist/client/assets/{use-members-BiMQcnAS.js → use-members-CeSqgIx5.js} +1 -1
  301. package/dist/client/assets/{use-mobile-avjkwF6P.js → use-mobile-dxqjeB9C.js} +1 -1
  302. package/dist/client/assets/{use-navigate-to-agent-DT6SP7we.js → use-navigate-to-agent-Co4saf9i.js} +1 -1
  303. package/dist/client/assets/use-new-blocks-editor-CyUK_4wA.js +1 -0
  304. package/dist/client/assets/{use-open-billing-url-D3-Evs3P.js → use-open-billing-url-DNH1wvY9.js} +1 -1
  305. package/dist/client/assets/{use-org-auth-client-C0kfn4Hh.js → use-org-auth-client-D4bGY1I4.js} +1 -1
  306. package/dist/client/assets/{use-org-fs-Bb3mK6Hx.js → use-org-fs-DTUSNHuq.js} +1 -1
  307. package/dist/client/assets/{use-org-repo-syncs-BaPlgvkL.js → use-org-repo-syncs-CDggK2v-.js} +1 -1
  308. package/dist/client/assets/{use-org-sso-D0ubLH8o.js → use-org-sso-Bbo5tHOp.js} +1 -1
  309. package/dist/client/assets/{use-organization-roles-BjapmWnU.js → use-organization-roles-DJHkyVq7.js} +1 -1
  310. package/dist/client/assets/{use-organization-settings-b1uEqEl7.js → use-organization-settings-4sBPGImH.js} +1 -1
  311. package/dist/client/assets/{use-panel-navigate-DM9oBo_y.js → use-panel-navigate-C-oGXzox.js} +1 -1
  312. package/dist/client/assets/{use-project-scope-CdG18ZwV.js → use-project-scope-BYZ6yY5x.js} +1 -1
  313. package/dist/client/assets/{use-releases-BY6Ey7qp.js → use-releases-D6w9Gx21.js} +1 -1
  314. package/dist/client/assets/{use-reports-diagnostic-Cea-ZR7h.js → use-reports-diagnostic-BO4L5i9s.js} +1 -1
  315. package/dist/client/assets/{use-secrets-BuVtrCbN.js → use-secrets-B3wy2yaT.js} +1 -1
  316. package/dist/client/assets/{use-section-preview-base-BL5_n6HI.js → use-section-preview-base-D_QxAs1Z.js} +1 -1
  317. package/dist/client/assets/{use-session-runtime-BqNS_uzd.js → use-session-runtime-CEr5Osm3.js} +1 -1
  318. package/dist/client/assets/{use-tags-OZ8EdmaG.js → use-tags-BIcLkILs.js} +1 -1
  319. package/dist/client/assets/{use-task-board-analytics-DD0mNFO7.js → use-task-board-analytics-CXzmZIDx.js} +1 -1
  320. package/dist/client/assets/{use-task-board-events-DEqI3Q6Z.js → use-task-board-events-xJ2Gil4b.js} +1 -1
  321. package/dist/client/assets/{use-task-metadata-BZ9jc8IS.js → use-task-metadata-CCng6xu_.js} +1 -1
  322. package/dist/client/assets/{use-thread-analytics-C_Ib4AtX.js → use-thread-analytics-tp8G0WjA.js} +1 -1
  323. package/dist/client/assets/{use-thread-outputs-BEYgt-Dh.js → use-thread-outputs-8410oJSY.js} +1 -1
  324. package/dist/client/assets/useInfiniteQuery-CTTKOBfu.js +1 -0
  325. package/dist/client/assets/{useQueries-BBJ9drAO.js → useQueries-ChX2pN0S.js} +1 -1
  326. package/dist/client/assets/useSuspenseInfiniteQuery-3AX2bQF7.js +1 -0
  327. package/dist/client/assets/{users-C0Q7tPX9.js → users-CQgXffaI.js} +1 -1
  328. package/dist/client/assets/{utils-BawmeI6v.js → utils-Bcg0LMFt.js} +1 -1
  329. package/dist/client/assets/{variant-calendar-B3kfwaT1.js → variant-calendar-CjE-C9R-.js} +1 -1
  330. package/dist/client/assets/{variant-matcher-override-D5KXYhON.js → variant-matcher-override-Dr2AK1Ld.js} +1 -1
  331. package/dist/client/assets/{view-mode-toggle-DSgKza5v.js → view-mode-toggle-C4wafyT7.js} +1 -1
  332. package/dist/client/assets/{virtual-mcp-Biy9WvuX.js → virtual-mcp-3VgUzbRs.js} +1 -1
  333. package/dist/client/index.html +1 -1
  334. package/dist/server/cli.js +1 -1
  335. package/dist/server/server.js +1 -1
  336. package/package.json +1 -1
  337. package/dist/client/assets/agent-app-qbb5JA2r.js +0 -1
  338. package/dist/client/assets/agent-deck-CqgjLBSE.js +0 -1
  339. package/dist/client/assets/agent-library-CSTO-y-t.js +0 -1
  340. package/dist/client/assets/agent-library-file-Df58itl6.js +0 -1
  341. package/dist/client/assets/agent-settings-Cgq30tNP.js +0 -1
  342. package/dist/client/assets/agent-site-editor-code-CFdjiowh.js +0 -2
  343. package/dist/client/assets/agent-view-DFwQL9ld.js +0 -1
  344. package/dist/client/assets/api-keys-vTb1XbGG.js +0 -1
  345. package/dist/client/assets/app-editor-CuHZFDnk.js +0 -1
  346. package/dist/client/assets/flat-project-BZORVBKb.js +0 -1
  347. package/dist/client/assets/library-CdGzPeek.js +0 -1
  348. package/dist/client/assets/project-reports-R5pejKr0.js +0 -1
  349. package/dist/client/assets/project-tasks-xxw_xxBg.js +0 -1
  350. package/dist/client/assets/record-editor-DdM0Ufnd.js +0 -1
  351. package/dist/client/assets/reports-B2qbOUEG.js +0 -1
  352. package/dist/client/assets/route-B_mbIWRZ.js +0 -1
  353. package/dist/client/assets/tasks-Lw-J8js3.js +0 -1
  354. package/dist/client/assets/use-new-blocks-editor-BlVQ71Up.js +0 -1
  355. package/dist/client/assets/useInfiniteQuery-B0OQsDiL.js +0 -1
  356. package/dist/client/assets/useSuspenseInfiniteQuery-BjRsbalC.js +0 -1
@@ -1 +1 @@
1
- import{au as ve,bN as Oe,bO as Me,av as de,bM as ze,c as U,b as V,j as t,h as Ne,B,r as Z,l as Se,X as te,a2 as Ee,D as me,K as ee,d as se,p as ye,ak as _e,e_ as Re,n as Ue,fl as ue,R as Fe,I as Ve,F as Le,H as Be,G as xe,E as Ge,f as qe,fu as He,o as Ke,at as Xe,as as Qe,t as J}from"./index-BE867Qee.js";import{g as We}from"./extract-connection-data-VVSQT7HS.js";import{E as Ce}from"./empty-state-CDvZ4pSZ.js";import{E as Ye,c as Je,r as Ze,b as et,d as tt}from"./connection-form-helpers-B0fzrlcU.js";import{c as st,S as nt,D as it}from"./index-MmpnLDGH.js";import{u as we,T as ot}from"./use-mcp-auth-status-DaNrG9Qa.js";import{a as at}from"./use-members-BiMQcnAS.js";import{A as lt}from"./avatar-BxSXBdTP.js";import{a as ke,b as Ie,u as rt}from"./use-connection-x3pfvWpW.js";import{u as Te}from"./use-mcp-client-BGKUmMJU.js";import{u as ct}from"./use-mcp-tools-D65vA86V.js";import{a as dt}from"./use-mcp-prompts-Brgv7p5b.js";import{i as mt,a as ut}from"./mcp-oauth-DOvgIVsQ.js";import{I as ae}from"./integration-icon-aoXYYKdZ.js";import{s as xt}from"./Plus-DUwLVLW_.js";import{bb as pt,aw as ft,bv as ht,p as ne}from"./agent-icon-C8zn459s.js";import{a as Ae,f as gt,s as jt}from"./Tool01-BuLiX0jy.js";import{s as re}from"./Trash01-DtMJF0U3.js";import{b as bt,a as vt,c as Nt,S as St,d as yt}from"./sheet-CmXNGCBA.js";import{F as q,b as H,c as K,d as L,f as X,e as _t,a as Ct}from"./form-R8MW_Gtw.js";import{I as W}from"./input-DWWEe804.js";import{u as wt,D as kt}from"./use-delete-connection-C6BGGvaV.js";import{c as It,B as Tt,a as At,C as Pt}from"./monitoring-stats-row-CIORylAm.js";import{d as Dt,C as $t,a as Ot}from"./chart-NHKhTpOL.js";import{b as Mt}from"./repository-binding-kLfd1JPC.js";import{T as ie,a as zt,c as oe,b as Et}from"./tabs-CfLMYw89.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Rt}from"./ShoppingBag01-BlgcPhxp.js";import{g as ce}from"./types-DSEqfHk2.js";import{M as Ut}from"./mcp-app-renderer-fAGsYxUD.js";import{C as Ft}from"./collection-search-Cp0gVUrY.js";import{B as Vt}from"./badge-Bkod8faG.js";import{S as pe,b as fe,a as he,d as ge,c as G}from"./select-CYYv9Vtn.js";import{i as Lt}from"./CheckCircle-BCxvtn62.js";import{t as Bt}from"./ChevronUp-Ds84QUAn.js";import{n as Gt}from"./LinkBroken01-8QjnprbC.js";import{c as qt}from"./UserSquare-B0WZmX6s.js";import{s as Ht}from"./XClose-DwKTRWak.js";import{p as Kt,i as Xt}from"./connection-Bw7PTYac.js";import"./metadata-D72DunRR.js";import"./Key01-DvlZjbjO.js";import"./auth-DQuDCDTH.js";import"./index--FVWSK_c.js";import"./index-Bpt0MDIX.js";import"./index-CaSLW3R8.js";import"./popover-CabOm1Wu.js";import"./tooltip-2Ew10_I0.js";import"./index-6OICj4ln.js";import"./Check-Bo3qSXwJ.js";import"./SearchMd-BiNHdvMf.js";import"./use-mobile-avjkwF6P.js";import"./use-create-virtual-mcp-BDos_868.js";import"./use-navigate-to-agent-DT6SP7we.js";import"./thread-intent-tToQ_3Cn.js";import"./backoff-8mStPHYB.js";import"./task-board-C7HcCxeg.js";import"./schema-CaBw1j44.js";import"./slugify-CEUa2lfQ.js";import"./Image01-0Rs0fG3a.js";import"./use-org-auth-client-C0kfn4Hh.js";import"./User01-DmaMR1Ca.js";import"./AlertCircle-CQA_p2Cp.js";import"./ArrowUp-0DU20WU2.js";import"./ArrowLeft-Dl_7c8AB.js";import"./ZoomOut-hhnEYknp.js";import"./Building02-CsHqQGTj.js";import"./Copy01-QNdLW2v3.js";import"./CreditCard01-D1KkCG7o.js";import"./DotsVertical-Dyi1_2jC.js";import"./Palette-CaoJ793n.js";import"./Link01-3DcN1bgm.js";import"./LinkExternal01-CLN31q0P.js";import"./Monitor01-C0xXEFc5.js";import"./Sun-aSGS3XrK.js";import"./Upload01-C2lcKrsy.js";import"./Users01-C8SJUk8C.js";import"./X-BO04Dn0R.js";import"./label-CpTis3ZF.js";import"./alert-dialog-zI-mFpSQ.js";import"./CartesianChart-OVjYagl6.js";import"./XAxis-DjkUxR47.js";import"./AreaChart-94A56lku.js";import"./ErrorBarContext-Dckliguf.js";import"./Sector-DrcdpRCF.js";const Qt=ve({scopes:ze(de()).describe("List of scopes available"),stateSchema:Oe(de(),Me()).describe("JSON Schema (draft-07) defining the state structure")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Qt}];function Yt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=V();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),m=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,p=n.status!=="active",x=m||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==x?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",x),e[2]=x,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let j;e[7]!==n.title?(j=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let S;e[9]!==n.status||e[10]!==p||e[11]!==m||e[12]!==o?(S=m?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=p,e[11]=m,e[12]=o,e[13]=S):S=e[13];let y;e[14]!==j||e[15]!==S?(y=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,S]}),e[14]=j,e[15]=S,e[16]=y):y=e[16];let _;e[17]!==n||e[18]!==m||e[19]!==a||e[20]!==o?(_=m&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=m,e[19]=a,e[20]=o,e[21]=_):_=e[21];let C;e[22]!==n||e[23]!==p||e[24]!==l||e[25]!==o?(C=p?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(pt,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(ft,{size:13})}),e[22]=n,e[23]=p,e[24]=l,e[25]=o,e[26]=C):C=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let w;e[30]!==o?(w=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=w):w=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Ae,{size:13}),e[34]=A):A=e[34];let O;e[35]!==$||e[36]!==w||e[37]!==M?(O=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:w,"aria-label":M,children:A}),e[35]=$,e[36]=w,e[37]=M,e[38]=O):O=e[38];let I;e[39]!==n||e[40]!==i?(I=()=>i(n),e[39]=n,e[40]=i,e[41]=I):I=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let b;e[44]!==o?(b=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(re,{size:13}),e[46]=E):E=e[46];let z;e[47]!==I||e[48]!==v||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:I,title:v,"aria-label":b,children:E}),e[47]=I,e[48]=v,e[49]=b,e[50]=z):z=e[50];let k;e[51]!==O||e[52]!==z||e[53]!==_||e[54]!==C?(k=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[_,C,O,z]}),e[51]=O,e[52]=z,e[53]=_,e[54]=C,e[55]=k):k=e[55];let P;return e[56]!==k||e[57]!==h||e[58]!==g||e[59]!==y?(P=t.jsxs("div",{className:h,children:[g,y,k]}),e[56]=k,e[57]=h,e[58]=g,e[59]=y,e[60]=P):P=e[60],P}function Jt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,a=V();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let d;e[10]!==a?(d=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ae,{size:13}),e[12]=u):u=e[12];let m;e[13]!==o||e[14]!==r||e[15]!==d?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":d,children:u})}),e[13]=o,e[14]=r,e[15]=d,e[16]=m):m=e[16];let p;return e[17]!==i||e[18]!==l||e[19]!==m?(p=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,m]}),e[17]=i,e[18]=l,e[19]=m,e[20]=p):p=e[20],p}function Zt(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,d=V();if(n.length===0)return null;let u;e[0]!==n.length||e[1]!==d?(u=n.length===1?d("details.connectionInstancesPanel.instance"):d("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=d,e[2]=u):u=e[2];let m;e[3]!==u?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(xt,{size:13}),e[5]=r,e[6]=p):p=e[6];let x;e[7]!==d?(x=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=x):x=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==p||e[12]!==x?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[p,x]}),e[9]=r,e[10]=o,e[11]=p,e[12]=x,e[13]=h):h=e[13];let g;e[14]!==m||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[m,h]}),e[14]=m,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let _;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(_=C=>t.jsx(Z.Suspense,{fallback:t.jsx(Jt,{instance:C,onConfigure:c}),children:t.jsx(Yt,{instance:C,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},C.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=_):_=e[27],j=n.map(_),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let S;e[28]!==j?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=S):S=e[29];let y;return e[30]!==g||e[31]!==S?(y=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=y):y=e[32],y}function es(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const ts=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ss(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const ns={calls:{label:"Tool calls"},errors:{label:"Errors"}};function is(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:a}=s,i=V(),l=Ee(),o=ss(a),{data:r}=me({queryKey:ee.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=It(r?.logs??[],o,void 0,r?.total,d?.total),m=u.data,p=u.totalCalls>0,x=es(r?.logs??[]),h=u.totalCalls>0?Math.round(u.totalErrors/u.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),j]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),p?t.jsxs("div",{children:[t.jsx(Dt,{config:ns,className:"h-16 w-full",children:t.jsxs(Tt,{data:m,barCategoryGap:"4%",children:[t.jsx($t,{content:t.jsx(Ot,{labelFormatter:ls}),cursor:{fill:"var(--muted)"}}),t.jsx(At,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:m.map(as)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[m.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),x.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:x.map(os)})]})]})}function os(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function as(s,e){return t.jsx(Pt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function ls(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function rs(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function cs(s){const e=U.c(22),{connectionId:n}=s,c=V(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==a?(u=ts.map(j=>t.jsx("button",{type:"button","aria-pressed":a===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",a===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=a,e[7]=u):u=e[7];let m;e[8]!==d||e[9]!==u?(m=t.jsx("div",{role:"group","aria-label":d,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:u}),e[8]=d,e[9]=u,e[10]=m):m=e[10];let p;e[11]!==r||e[12]!==m?(p=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,m]}),e[11]=r,e[12]=m,e[13]=p):p=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rs,{}),e[14]=x):x=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==a?(h=t.jsx(Z.Suspense,{fallback:x,children:t.jsx(is,{connectionId:n,orgId:l.id,timeframe:a})}),e[15]=n,e[16]=l.id,e[17]=a,e[18]=h):h=e[18];let g;return e[19]!==p||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[p,h]}),e[19]=p,e[20]=h,e[21]=g):g=e[21],g}function ds(s){const e=U.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const m=crypto.randomUUID();a({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:m}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_e,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==o||e[13]!==r?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,d]}),e[11]=i,e[12]=o,e[13]=r,e[14]=u):u=e[14],u}function ms(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(ds,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function us(s){const e=U.c(13),{connection:n}=s,c=V(),{org:a}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=Mt(i);if(!(l.length>0)){let p;return e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(t.Fragment,{}),e[2]=p):p=e[2],p}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==r?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r})}),e[5]=r,e[6]=d):d=e[6];let u;e[7]!==a.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(ms,{virtualMcps:l,org:a.slug})}),e[7]=a.slug,e[8]=l,e[9]=u):u=e[9];let m;return e[10]!==d||e[11]!==u?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=m):m=e[12],m}function xs(s){const e=U.c(35),{tools:n,connectionId:c,org:a}=s,i=V(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const d=Te(r),u=ke(c);let m;e[4]!==u||e[5]!==c?(m=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=m):m=e[6];const p=m,[x,h]=Z.useState("");let g,j,S,y;if(e[7]!==p||e[8]!==d||e[9]!==l||e[10]!==a||e[11]!==x||e[12]!==i||e[13]!==n){const $=(n??[]).filter(ps),w=x.toLowerCase().trim(),M=w?$.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):$;let A;e[18]!==p||e[19]!==l||e[20]!==a?(A=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=p,e[19]=l,e[20]=a,e[21]=A):A=e[21];const O=A;S="flex flex-col h-full overflow-hidden";let I;e[22]!==i?(I=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=I):I=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=v):v=e[24],e[25]!==x||e[26]!==I?(y=t.jsx(Ft,{value:x,onChange:h,placeholder:I,onKeyDown:v}),e[25]=x,e[26]=I,e[27]=y):y=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(Ce,{image:null,title:i(x?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(x?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>O(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Ut,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.annotations?.title??b.name}),t.jsx(ot,{annotations:b.annotations,_meta:b._meta})]}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b.description})]})]},b.name)})}),e[7]=p,e[8]=d,e[9]=l,e[10]=a,e[11]=x,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=S,e[17]=y}else g=e[14],j=e[15],S=e[16],y=e[17];let _;e[28]!==g||e[29]!==j?(_=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=_):_=e[30];let C;return e[31]!==S||e[32]!==y||e[33]!==_?(C=t.jsxs("div",{className:S,children:[y,_]}),e[31]=S,e[32]=y,e[33]=_,e[34]=C):C=e[34],C}function ps(s){return!!ce(s._meta)}const je=[];function De(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=V();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function fs(s){const e=U.c(68),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s,o=c===void 0?je:c,r=a===void 0?je:a,d=V(),u=se(),m=ke(i??"");let p;e[0]!==m||e[1]!==i?(p=m?Pe(m):i,e[0]=m,e[1]=i,e[2]=p):p=e[2];const x=p;let h;e[3]!==x||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(T){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:x,collectionName:"tools",itemId:encodeURIComponent(T)}})},e[3]=x,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(js),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const S=j;if(n.length+o.length+r.length===0){let N;e[12]!==d?(N=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=N):N=e[13];let T;e[14]!==N?(T=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:N}),e[14]=N,e[15]=T):T=e[15];let D;e[16]!==d?(D=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=D):D=e[17];let F;e[18]!==D?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:D}),e[18]=D,e[19]=F):F=e[19];let Q;return e[20]!==T||e[21]!==F?(Q=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[T,F]}),e[20]=T,e[21]=F,e[22]=Q):Q=e[22],Q}let _;e[23]!==d||e[24]!==n.length?(_=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=_):_=e[25];let C;e[26]!==_?(C=t.jsx(ie,{value:"tools",variant:"underline",children:_}),e[26]=_,e[27]=C):C=e[27];let $;e[28]!==S||e[29]!==d?($=S&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=S,e[29]=d,e[30]=$):$=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let M;e[33]!==w?(M=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=M):M=e[34];let A;e[35]!==d?(A=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=A):A=e[36];let O;e[37]!==A?(O=t.jsx(ie,{value:"resources",variant:"underline",children:A}),e[37]=A,e[38]=O):O=e[38];let I;e[39]!==M||e[40]!==O||e[41]!==C||e[42]!==$?(I=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(zt,{variant:"underline",className:"gap-1",children:[C,$,M,O]})}),e[39]=M,e[40]=O,e[41]=C,e[42]=$,e[43]=I):I=e[43];let v;e[44]!==g||e[45]!==n?(v=n.length>0?n.map(N=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>g(N.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(gt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(_e,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},N.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=v):v=e[46];let b;e[47]!==v?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:v})}),e[47]=v,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==S||e[51]!==l||e[52]!==n?(E=S&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(xs,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=S,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==o?(z=o.length>0?o.map(gs):t.jsx(le,{label:"prompts"}),e[54]=o,e[55]=z):z=e[55];let k;e[56]!==z?(k=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=k):k=e[57];let P;e[58]!==r?(P=r.length>0?r.map(hs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=P):P=e[59];let R;e[60]!==P?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:P})}),e[60]=P,e[61]=R):R=e[61];let f;return e[62]!==I||e[63]!==b||e[64]!==E||e[65]!==k||e[66]!==R?(f=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Et,{defaultValue:"tools",variant:"underline",children:[I,b,E,k,R]})}),e[62]=I,e[63]=b,e[64]=E,e[65]=k,e[66]=R,e[67]=f):f=e[67],f}function hs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(ht,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function gs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Rt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function js(s){return ce(s._meta)}function bs(s){const e=U.c(13),{connection:n,displayTitle:c}=s,a=c??n.title;let i;e[0]!==n.icon||e[1]!==a?(i=t.jsx(ae,{icon:n.icon,name:a,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=i):i=e[2];let l;e[3]!==a?(l=t.jsx(Ue.Title,{children:a}),e[3]=a,e[4]=l):l=e[4];let o;e[5]!==n.description?(o=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=o):o=e[6];let r;e[7]!==l||e[8]!==o?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,o]}),e[7]=l,e[8]=o,e[9]=r):r=e[9];let d;return e[10]!==i||e[11]!==r?(d=t.jsxs("div",{className:"flex items-center px-4 md:px-8 bg-background border-b border-border shrink-0 gap-3 py-4",children:[i,r]}),e[10]=i,e[11]=r,e[12]=d):d=e[12],d}function vs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=V(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Fe(),d=(()=>{if(typeof o!="string"||!o)return!1;try{const x=new URL(o);return x.hostname==="api.githubcopilot.com"&&x.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",m=e.connection_type==="VIRTUAL",p=m?Kt(e.connection_url):null;return m?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(ye,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(q,{control:s.control,name:"ui_type",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(L,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(G,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(G,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(G,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(q,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(G,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(G,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Gt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(G,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(qt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(X,{})]})}),l==="NPX"&&t.jsx(q,{control:s.control,name:"npx_package",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(q,{control:s.control,name:"stdio_command",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),t.jsx(q,{control:s.control,name:"stdio_args",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(X,{})]})})]}),t.jsx(q,{control:s.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(q,{control:s.control,name:"env_vars",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Ye,{value:x.value??[],onChange:x.onChange})}),t.jsx(X,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(q,{control:s.control,name:"connection_token",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ve,{children:[t.jsx(Le,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Vt,{variant:"success",className:"gap-1.5",children:[t.jsx(Lt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Bt,{size:12})]})})}),t.jsxs(Be,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(jt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&x.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>x.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(W,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(_t,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(X,{})]})})]})}function Ns(s){return s.command==="npx"}function Ss(s){return s.args?.find(e=>!e.startsWith("-"))??""}function ys(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function be(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Xt(s.connection_headers)){const c=s.connection_headers,a=Ze(c.envVars);if(Ns(c)){const l=Ss(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const i=ys(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function _s(s){let e,n=null,c=!1,a=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=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&&s.connection_token!==void 0,a=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:a},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function Cs({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=V(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Ke(),m=Ie(),{org:p}=te(),x=wt({onSuccess:()=>{o.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[j,S]=Z.useState(!1),y=we({connectionId:e}),{data:_}=at(),C=_?.data?.members??[],$=h??s,w=C.find(f=>f.userId===$.created_by),A=s?.connection_type==="VIRTUAL"||y.isAuthenticated,O={...s,tools:a},I=st(O,Wt),v=Xe({resolver:Qe(Je),values:be(h??s)}),b=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const N=v.getValues(),T=_s(N),D=h?.id??e;await m.update.mutateAsync({id:D,data:T}),v.reset(N)},z=()=>{v.reset(be(h??s))},k=async f=>{const N=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:T,tokenInfo:D,error:F}=await ut({connectionId:f,orgSlug:p.slug,...N?{scope:N}:{}});if(F||!T){J.error(r("details.connection.authFailed",{error:F??""}));return}if(D)try{const Y=await fetch(`/api/${p.slug}/connections/${f}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!Y.ok)console.error("Failed to save OAuth token:",await Y.text()),await m.update.mutateAsync({id:f,data:{connection_token:T}});else try{await m.update.mutateAsync({id:f,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Y){console.error("Error saving OAuth token:",Y),await m.update.mutateAsync({id:f,data:{connection_token:T}})}else await m.update.mutateAsync({id:f,data:{connection_token:T}});const Q=new URL(`/api/${p.slug}/mcp/${f}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},P=()=>k(s.id),R=async()=>{try{const f=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!f.ok){const T=await f.text();J.error(r("details.connection.failedRemoveOAuth",{error:T}));return}const N=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(N.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(f){console.error("Error removing OAuth token:",f),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(kt,{...x}),t.jsx(bt,{open:h!==null,onOpenChange:f=>{f||g(null)},children:t.jsxs(vt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Nt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(St,{className:"text-base",children:h?.title??s.title}),t.jsx(yt,{className:"text-xs",children:r("details.connection.settingsDescription")}),w&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(lt,{url:w.user?.image??void 0,fallback:w.user?.name??w.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:w.user?.name||w.user?.email})]})]}),t.jsxs(Ct,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(q,{control:v.control,name:"title",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(W,{...f})}),t.jsx(X,{})]})}),t.jsx(q,{control:v.control,name:"description",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(W,{...f,value:f.value||""})}),t.jsx(X,{})]})})]}),t.jsx(vs,{form:v,connection:h??s,hasOAuthToken:y.hasOAuthToken,onReauthenticate:P,onRemoveOAuth:R}),t.jsx(nt,{connection:h??s,form:v,hasMcpBinding:I,isMCPAuthenticated:A,supportsOAuth:y.supportsOAuth,isServerError:y.isServerError,onAuthenticate:P,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const f=h??s;g(null),x.requestDelete(f)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(it,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(bs,{connection:s,displayTitle:(()=>{const f=o[0]??s;return f.app_name?f.title.replace(/\s*\(\d+\)\s*$/,""):f.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(cs,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Zt,{instances:o,onConfigure:f=>g(f),onAuthenticate:f=>k(f.id),onDelete:f=>x.requestDelete(f),onToggleStatus:async(f,N)=>{try{await m.update.mutateAsync({id:f.id,data:{status:N}}),J.success(r(N==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{S(!0);try{const f=o[0]??s,N=f.title.replace(/\s*\(\d+\)\s*$/,""),T=o.length+1,D=`${N} (${T})`,F=We("conn");await m.create.mutateAsync({id:F,title:D,description:f.description??null,connection_type:f.connection_type,connection_url:f.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:f.created_by,organization_id:f.organization_id,icon:f.icon??null,app_name:f.app_name??null,app_id:f.app_id??null,connection_headers:f.connection_headers??null,oauth_config:null,configuration_state:f.configuration_state??null,metadata:null,tools:null,bindings:null});const Q=new URL(`/api/${p.slug}/mcp/${F}`,window.location.origin),Y=await mt({url:Q.href,token:null,orgId:p.id});Y.supportsOAuth&&!Y.isAuthenticated&&await k(F)}finally{S(!1)}}}),t.jsx(us,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(fs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ws(){const s=U.c(52),e=V();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=qe(a),{org:o}=te(),r=Ie();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=rt(d),m=u[0]??null,p=m?.id??"",x=p||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==x?(h={connectionId:x,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=x,s[7]=h):h=s[7];const g=Te(h);let j;s[8]!==g?(j={client:g},s[8]=g,s[9]=j):j=s[9];const{data:S}=ct(j);let y;if(s[10]!==m?.tools||s[11]!==p||s[12]!==u||s[13]!==S){const k=S?S.tools.map(Ds):(m?.tools??[]).map(Ps);e:{if(u.length<=1){y=k;break e}const P=new Set,R=[],f=Ts;for(const N of u){const T=N.id===p?k:f(N.tools);for(const D of T)P.has(D.name)||(P.add(D.name),R.push(D))}y=R.length>0?R:k}s[10]=m?.tools,s[11]=p,s[12]=u,s[13]=S,s[14]=y}else y=s[14];const _=y;let C;s[15]!==g?(C={client:g},s[15]=g,s[16]=C):C=s[16];const{data:$}=dt(C);let w;s[17]!==g?(w={client:g},s[17]=g,s[18]=w):w=s[18];const{data:M}=He(w);let A;s[19]!==$?.prompts?(A=$?.prompts??[],s[19]=$?.prompts,s[20]=A):A=s[20];let O;s[21]!==A?(O=A.map(Is),s[21]=A,s[22]=O):O=s[22];const I=O;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let b;s[25]!==v?(b=v.map(ks),s[25]=v,s[26]=b):b=s[26];const E=b;if(!m){let k;s[27]!==e?(k=e("details.connection.notFoundTitle"),s[27]=e,s[28]=k):k=s[28];let P;s[29]!==e?(P=e("details.connection.notFoundDescription"),s[29]=e,s[30]=P):P=s[30];let R;s[31]!==c||s[32]!==l?(R=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=R):R=s[33];let f;s[34]!==e?(f=e("details.connection.backButton"),s[34]=e,s[35]=f):f=s[35];let N;s[36]!==R||s[37]!==f?(N=t.jsx(B,{variant:"outline",onClick:R,children:f}),s[36]=R,s[37]=f,s[38]=N):N=s[38];let T;return s[39]!==k||s[40]!==P||s[41]!==N?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ce,{title:k,description:P,actions:N})}),s[39]=k,s[40]=P,s[41]=N,s[42]=T):T=s[42],T}let z;return s[43]!==r.update.isPending||s[44]!==_||s[45]!==m||s[46]!==p||s[47]!==l||s[48]!==I||s[49]!==E||s[50]!==u?(z=t.jsx(Cs,{org:l,connection:m,connectionId:p,isUpdating:r.update.isPending,tools:_,prompts:I,resources:E,siblings:u}),s[43]=r.update.isPending,s[44]=_,s[45]=m,s[46]=p,s[47]=l,s[48]=I,s[49]=E,s[50]=u,s[51]=z):z=s[51],z}function ks(s){return{name:s.name,description:s.description,uri:s.uri}}function Is(s){return{name:s.name,description:s.description}}function Ts(s){return(s??[]).map(As)}function As(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ps(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ds(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function $s(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(ws,{})})}),s[0]=e):e=s[0],e}function mi(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx($s,{}),s[0]=e):e=s[0],e}export{mi as default};
1
+ import{au as ve,bN as Oe,bO as Me,av as de,bM as ze,c as U,b as V,j as t,h as Ne,B,r as Z,l as Se,X as te,a2 as Ee,D as me,K as ee,d as se,p as ye,ak as _e,e_ as Re,n as Ue,fl as ue,R as Fe,I as Ve,F as Le,H as Be,G as xe,E as Ge,f as qe,fu as He,o as Ke,at as Xe,as as Qe,t as J}from"./index-DD17LdOo.js";import{g as We}from"./extract-connection-data-C3og9nET.js";import{E as Ce}from"./empty-state-BWACKPTq.js";import{E as Ye,c as Je,r as Ze,b as et,d as tt}from"./connection-form-helpers-BwQZA_xH.js";import{c as st,S as nt,D as it}from"./index-DCe0TA20.js";import{u as we,T as ot}from"./use-mcp-auth-status-C0JasP2w.js";import{a as at}from"./use-members-CeSqgIx5.js";import{A as lt}from"./avatar-BTitfgsj.js";import{a as ke,b as Ie,u as rt}from"./use-connection-BDIMmEql.js";import{u as Te}from"./use-mcp-client-BwmV3MW8.js";import{u as ct}from"./use-mcp-tools-DaY04Cnx.js";import{a as dt}from"./use-mcp-prompts-DfL0DKop.js";import{i as mt,a as ut}from"./mcp-oauth-DRu55AOe.js";import{I as ae}from"./integration-icon-DNr48VB-.js";import{s as xt}from"./Plus-MXLtMY7l.js";import{bb as pt,aw as ft,bv as ht,p as ne}from"./agent-icon-B_yyO4wu.js";import{a as Ae,f as gt,s as jt}from"./Tool01-BgPGiYBJ.js";import{s as re}from"./Trash01-DEfHm1-C.js";import{b as bt,a as vt,c as Nt,S as St,d as yt}from"./sheet-BID6Bcl4.js";import{F as q,b as H,c as K,d as L,f as X,e as _t,a as Ct}from"./form-BQW41VGV.js";import{I as W}from"./input-BbeG6cTt.js";import{u as wt,D as kt}from"./use-delete-connection-JYdb3g8I.js";import{c as It,B as Tt,a as At,C as Pt}from"./monitoring-stats-row-C4IvvKh8.js";import{d as Dt,C as $t,a as Ot}from"./chart-BWgcHAUx.js";import{b as Mt}from"./repository-binding-CJ_pw95F.js";import{T as ie,a as zt,c as oe,b as Et}from"./tabs-BaxVRsCI.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Rt}from"./ShoppingBag01-BUSIbN12.js";import{g as ce}from"./types-l4l1-swZ.js";import{M as Ut}from"./mcp-app-renderer-2ABF18H4.js";import{C as Ft}from"./collection-search-B7qdcCbg.js";import{B as Vt}from"./badge-E2auaQms.js";import{S as pe,b as fe,a as he,d as ge,c as G}from"./select-CvaUVwrC.js";import{i as Lt}from"./CheckCircle-Yu1WDdmS.js";import{t as Bt}from"./ChevronUp-Br5R9lTH.js";import{n as Gt}from"./LinkBroken01-_oPW_2dj.js";import{c as qt}from"./UserSquare-DkdLf214.js";import{s as Ht}from"./XClose-oHtKIul6.js";import{p as Kt,i as Xt}from"./connection-B2m_fkQ_.js";import"./metadata-D72DunRR.js";import"./Key01-DA8aX6Mo.js";import"./auth-BII1ityf.js";import"./index-BYU2fptV.js";import"./index-Ce0CI_HW.js";import"./index-DXEiFGhx.js";import"./popover-WjvvubuZ.js";import"./tooltip-Cyc9NKXJ.js";import"./index-Dsl1ukJt.js";import"./Check-aE-8J-dx.js";import"./SearchMd-D2iMNQwW.js";import"./use-mobile-dxqjeB9C.js";import"./use-create-virtual-mcp-BpxFtCSO.js";import"./use-navigate-to-agent-Co4saf9i.js";import"./thread-intent-wfAGHI9k.js";import"./backoff-8mStPHYB.js";import"./task-board-D2BE2LPw.js";import"./schema-BPz-DoxV.js";import"./slugify-CEUa2lfQ.js";import"./Image01-CUJhdG59.js";import"./use-org-auth-client-D4bGY1I4.js";import"./User01-BJjdpbkY.js";import"./AlertCircle-DjoFdKqn.js";import"./ArrowUp-CxGCH_mE.js";import"./ArrowLeft-DCPdaQBd.js";import"./ZoomOut-tzNSNsYS.js";import"./Building02-DQhkI7KU.js";import"./Copy01-CtLn8eQC.js";import"./CreditCard01-DARYnajC.js";import"./DotsVertical-BkKYV-uH.js";import"./Palette-CI5-z0zm.js";import"./Link01-PgFxgiYI.js";import"./LinkExternal01-Bzb2WBKu.js";import"./Monitor01-evoIPilr.js";import"./Sun-DaF8KN8m.js";import"./Upload01-AiwUaS84.js";import"./Users01-DB-isk4t.js";import"./X-BHK_66ka.js";import"./label-DeoZl-yW.js";import"./alert-dialog-D39kK11B.js";import"./CartesianChart-B1qOpm8T.js";import"./XAxis-alrFH4LG.js";import"./AreaChart-B4-QNIT5.js";import"./ErrorBarContext-C1OQDTFH.js";import"./Sector-C_r2Ffen.js";const Qt=ve({scopes:ze(de()).describe("List of scopes available"),stateSchema:Oe(de(),Me()).describe("JSON Schema (draft-07) defining the state structure")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Qt}];function Yt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=V();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),m=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,p=n.status!=="active",x=m||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==x?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",x),e[2]=x,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let j;e[7]!==n.title?(j=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let S;e[9]!==n.status||e[10]!==p||e[11]!==m||e[12]!==o?(S=m?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=p,e[11]=m,e[12]=o,e[13]=S):S=e[13];let y;e[14]!==j||e[15]!==S?(y=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,S]}),e[14]=j,e[15]=S,e[16]=y):y=e[16];let _;e[17]!==n||e[18]!==m||e[19]!==a||e[20]!==o?(_=m&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=m,e[19]=a,e[20]=o,e[21]=_):_=e[21];let C;e[22]!==n||e[23]!==p||e[24]!==l||e[25]!==o?(C=p?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(pt,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(ft,{size:13})}),e[22]=n,e[23]=p,e[24]=l,e[25]=o,e[26]=C):C=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let w;e[30]!==o?(w=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=w):w=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Ae,{size:13}),e[34]=A):A=e[34];let O;e[35]!==$||e[36]!==w||e[37]!==M?(O=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:w,"aria-label":M,children:A}),e[35]=$,e[36]=w,e[37]=M,e[38]=O):O=e[38];let I;e[39]!==n||e[40]!==i?(I=()=>i(n),e[39]=n,e[40]=i,e[41]=I):I=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let b;e[44]!==o?(b=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(re,{size:13}),e[46]=E):E=e[46];let z;e[47]!==I||e[48]!==v||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:I,title:v,"aria-label":b,children:E}),e[47]=I,e[48]=v,e[49]=b,e[50]=z):z=e[50];let k;e[51]!==O||e[52]!==z||e[53]!==_||e[54]!==C?(k=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[_,C,O,z]}),e[51]=O,e[52]=z,e[53]=_,e[54]=C,e[55]=k):k=e[55];let P;return e[56]!==k||e[57]!==h||e[58]!==g||e[59]!==y?(P=t.jsxs("div",{className:h,children:[g,y,k]}),e[56]=k,e[57]=h,e[58]=g,e[59]=y,e[60]=P):P=e[60],P}function Jt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,a=V();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let d;e[10]!==a?(d=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ae,{size:13}),e[12]=u):u=e[12];let m;e[13]!==o||e[14]!==r||e[15]!==d?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":d,children:u})}),e[13]=o,e[14]=r,e[15]=d,e[16]=m):m=e[16];let p;return e[17]!==i||e[18]!==l||e[19]!==m?(p=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,m]}),e[17]=i,e[18]=l,e[19]=m,e[20]=p):p=e[20],p}function Zt(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,d=V();if(n.length===0)return null;let u;e[0]!==n.length||e[1]!==d?(u=n.length===1?d("details.connectionInstancesPanel.instance"):d("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=d,e[2]=u):u=e[2];let m;e[3]!==u?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(xt,{size:13}),e[5]=r,e[6]=p):p=e[6];let x;e[7]!==d?(x=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=x):x=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==p||e[12]!==x?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[p,x]}),e[9]=r,e[10]=o,e[11]=p,e[12]=x,e[13]=h):h=e[13];let g;e[14]!==m||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[m,h]}),e[14]=m,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let _;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(_=C=>t.jsx(Z.Suspense,{fallback:t.jsx(Jt,{instance:C,onConfigure:c}),children:t.jsx(Yt,{instance:C,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},C.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=_):_=e[27],j=n.map(_),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let S;e[28]!==j?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=S):S=e[29];let y;return e[30]!==g||e[31]!==S?(y=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=y):y=e[32],y}function es(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const ts=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ss(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const ns={calls:{label:"Tool calls"},errors:{label:"Errors"}};function is(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:a}=s,i=V(),l=Ee(),o=ss(a),{data:r}=me({queryKey:ee.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=It(r?.logs??[],o,void 0,r?.total,d?.total),m=u.data,p=u.totalCalls>0,x=es(r?.logs??[]),h=u.totalCalls>0?Math.round(u.totalErrors/u.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),j]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),p?t.jsxs("div",{children:[t.jsx(Dt,{config:ns,className:"h-16 w-full",children:t.jsxs(Tt,{data:m,barCategoryGap:"4%",children:[t.jsx($t,{content:t.jsx(Ot,{labelFormatter:ls}),cursor:{fill:"var(--muted)"}}),t.jsx(At,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:m.map(as)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[m.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),x.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:x.map(os)})]})]})}function os(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function as(s,e){return t.jsx(Pt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function ls(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function rs(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function cs(s){const e=U.c(22),{connectionId:n}=s,c=V(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==a?(u=ts.map(j=>t.jsx("button",{type:"button","aria-pressed":a===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",a===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=a,e[7]=u):u=e[7];let m;e[8]!==d||e[9]!==u?(m=t.jsx("div",{role:"group","aria-label":d,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:u}),e[8]=d,e[9]=u,e[10]=m):m=e[10];let p;e[11]!==r||e[12]!==m?(p=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,m]}),e[11]=r,e[12]=m,e[13]=p):p=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rs,{}),e[14]=x):x=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==a?(h=t.jsx(Z.Suspense,{fallback:x,children:t.jsx(is,{connectionId:n,orgId:l.id,timeframe:a})}),e[15]=n,e[16]=l.id,e[17]=a,e[18]=h):h=e[18];let g;return e[19]!==p||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[p,h]}),e[19]=p,e[20]=h,e[21]=g):g=e[21],g}function ds(s){const e=U.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const m=crypto.randomUUID();a({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:m}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_e,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==o||e[13]!==r?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,d]}),e[11]=i,e[12]=o,e[13]=r,e[14]=u):u=e[14],u}function ms(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(ds,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function us(s){const e=U.c(13),{connection:n}=s,c=V(),{org:a}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=Mt(i);if(!(l.length>0)){let p;return e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(t.Fragment,{}),e[2]=p):p=e[2],p}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==r?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r})}),e[5]=r,e[6]=d):d=e[6];let u;e[7]!==a.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(ms,{virtualMcps:l,org:a.slug})}),e[7]=a.slug,e[8]=l,e[9]=u):u=e[9];let m;return e[10]!==d||e[11]!==u?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=m):m=e[12],m}function xs(s){const e=U.c(35),{tools:n,connectionId:c,org:a}=s,i=V(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const d=Te(r),u=ke(c);let m;e[4]!==u||e[5]!==c?(m=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=m):m=e[6];const p=m,[x,h]=Z.useState("");let g,j,S,y;if(e[7]!==p||e[8]!==d||e[9]!==l||e[10]!==a||e[11]!==x||e[12]!==i||e[13]!==n){const $=(n??[]).filter(ps),w=x.toLowerCase().trim(),M=w?$.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):$;let A;e[18]!==p||e[19]!==l||e[20]!==a?(A=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=p,e[19]=l,e[20]=a,e[21]=A):A=e[21];const O=A;S="flex flex-col h-full overflow-hidden";let I;e[22]!==i?(I=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=I):I=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=v):v=e[24],e[25]!==x||e[26]!==I?(y=t.jsx(Ft,{value:x,onChange:h,placeholder:I,onKeyDown:v}),e[25]=x,e[26]=I,e[27]=y):y=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(Ce,{image:null,title:i(x?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(x?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>O(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Ut,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.annotations?.title??b.name}),t.jsx(ot,{annotations:b.annotations,_meta:b._meta})]}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b.description})]})]},b.name)})}),e[7]=p,e[8]=d,e[9]=l,e[10]=a,e[11]=x,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=S,e[17]=y}else g=e[14],j=e[15],S=e[16],y=e[17];let _;e[28]!==g||e[29]!==j?(_=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=_):_=e[30];let C;return e[31]!==S||e[32]!==y||e[33]!==_?(C=t.jsxs("div",{className:S,children:[y,_]}),e[31]=S,e[32]=y,e[33]=_,e[34]=C):C=e[34],C}function ps(s){return!!ce(s._meta)}const je=[];function De(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=V();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function fs(s){const e=U.c(68),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s,o=c===void 0?je:c,r=a===void 0?je:a,d=V(),u=se(),m=ke(i??"");let p;e[0]!==m||e[1]!==i?(p=m?Pe(m):i,e[0]=m,e[1]=i,e[2]=p):p=e[2];const x=p;let h;e[3]!==x||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(T){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:x,collectionName:"tools",itemId:encodeURIComponent(T)}})},e[3]=x,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(js),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const S=j;if(n.length+o.length+r.length===0){let N;e[12]!==d?(N=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=N):N=e[13];let T;e[14]!==N?(T=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:N}),e[14]=N,e[15]=T):T=e[15];let D;e[16]!==d?(D=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=D):D=e[17];let F;e[18]!==D?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:D}),e[18]=D,e[19]=F):F=e[19];let Q;return e[20]!==T||e[21]!==F?(Q=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[T,F]}),e[20]=T,e[21]=F,e[22]=Q):Q=e[22],Q}let _;e[23]!==d||e[24]!==n.length?(_=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=_):_=e[25];let C;e[26]!==_?(C=t.jsx(ie,{value:"tools",variant:"underline",children:_}),e[26]=_,e[27]=C):C=e[27];let $;e[28]!==S||e[29]!==d?($=S&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=S,e[29]=d,e[30]=$):$=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let M;e[33]!==w?(M=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=M):M=e[34];let A;e[35]!==d?(A=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=A):A=e[36];let O;e[37]!==A?(O=t.jsx(ie,{value:"resources",variant:"underline",children:A}),e[37]=A,e[38]=O):O=e[38];let I;e[39]!==M||e[40]!==O||e[41]!==C||e[42]!==$?(I=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(zt,{variant:"underline",className:"gap-1",children:[C,$,M,O]})}),e[39]=M,e[40]=O,e[41]=C,e[42]=$,e[43]=I):I=e[43];let v;e[44]!==g||e[45]!==n?(v=n.length>0?n.map(N=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>g(N.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(gt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(_e,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},N.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=v):v=e[46];let b;e[47]!==v?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:v})}),e[47]=v,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==S||e[51]!==l||e[52]!==n?(E=S&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(xs,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=S,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==o?(z=o.length>0?o.map(gs):t.jsx(le,{label:"prompts"}),e[54]=o,e[55]=z):z=e[55];let k;e[56]!==z?(k=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=k):k=e[57];let P;e[58]!==r?(P=r.length>0?r.map(hs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=P):P=e[59];let R;e[60]!==P?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:P})}),e[60]=P,e[61]=R):R=e[61];let f;return e[62]!==I||e[63]!==b||e[64]!==E||e[65]!==k||e[66]!==R?(f=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Et,{defaultValue:"tools",variant:"underline",children:[I,b,E,k,R]})}),e[62]=I,e[63]=b,e[64]=E,e[65]=k,e[66]=R,e[67]=f):f=e[67],f}function hs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(ht,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function gs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Rt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function js(s){return ce(s._meta)}function bs(s){const e=U.c(13),{connection:n,displayTitle:c}=s,a=c??n.title;let i;e[0]!==n.icon||e[1]!==a?(i=t.jsx(ae,{icon:n.icon,name:a,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=i):i=e[2];let l;e[3]!==a?(l=t.jsx(Ue.Title,{children:a}),e[3]=a,e[4]=l):l=e[4];let o;e[5]!==n.description?(o=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=o):o=e[6];let r;e[7]!==l||e[8]!==o?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,o]}),e[7]=l,e[8]=o,e[9]=r):r=e[9];let d;return e[10]!==i||e[11]!==r?(d=t.jsxs("div",{className:"flex items-center px-4 md:px-8 bg-background border-b border-border shrink-0 gap-3 py-4",children:[i,r]}),e[10]=i,e[11]=r,e[12]=d):d=e[12],d}function vs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=V(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Fe(),d=(()=>{if(typeof o!="string"||!o)return!1;try{const x=new URL(o);return x.hostname==="api.githubcopilot.com"&&x.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",m=e.connection_type==="VIRTUAL",p=m?Kt(e.connection_url):null;return m?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(ye,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(q,{control:s.control,name:"ui_type",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(L,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(G,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(G,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(G,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(q,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(G,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(G,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Gt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(G,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(qt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(X,{})]})}),l==="NPX"&&t.jsx(q,{control:s.control,name:"npx_package",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(q,{control:s.control,name:"stdio_command",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),t.jsx(q,{control:s.control,name:"stdio_args",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(X,{})]})})]}),t.jsx(q,{control:s.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(q,{control:s.control,name:"env_vars",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Ye,{value:x.value??[],onChange:x.onChange})}),t.jsx(X,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(q,{control:s.control,name:"connection_token",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ve,{children:[t.jsx(Le,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Vt,{variant:"success",className:"gap-1.5",children:[t.jsx(Lt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Bt,{size:12})]})})}),t.jsxs(Be,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(jt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&x.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>x.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(W,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(_t,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(X,{})]})})]})}function Ns(s){return s.command==="npx"}function Ss(s){return s.args?.find(e=>!e.startsWith("-"))??""}function ys(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function be(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Xt(s.connection_headers)){const c=s.connection_headers,a=Ze(c.envVars);if(Ns(c)){const l=Ss(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const i=ys(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function _s(s){let e,n=null,c=!1,a=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=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&&s.connection_token!==void 0,a=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:a},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function Cs({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=V(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Ke(),m=Ie(),{org:p}=te(),x=wt({onSuccess:()=>{o.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[j,S]=Z.useState(!1),y=we({connectionId:e}),{data:_}=at(),C=_?.data?.members??[],$=h??s,w=C.find(f=>f.userId===$.created_by),A=s?.connection_type==="VIRTUAL"||y.isAuthenticated,O={...s,tools:a},I=st(O,Wt),v=Xe({resolver:Qe(Je),values:be(h??s)}),b=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const N=v.getValues(),T=_s(N),D=h?.id??e;await m.update.mutateAsync({id:D,data:T}),v.reset(N)},z=()=>{v.reset(be(h??s))},k=async f=>{const N=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:T,tokenInfo:D,error:F}=await ut({connectionId:f,orgSlug:p.slug,...N?{scope:N}:{}});if(F||!T){J.error(r("details.connection.authFailed",{error:F??""}));return}if(D)try{const Y=await fetch(`/api/${p.slug}/connections/${f}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!Y.ok)console.error("Failed to save OAuth token:",await Y.text()),await m.update.mutateAsync({id:f,data:{connection_token:T}});else try{await m.update.mutateAsync({id:f,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Y){console.error("Error saving OAuth token:",Y),await m.update.mutateAsync({id:f,data:{connection_token:T}})}else await m.update.mutateAsync({id:f,data:{connection_token:T}});const Q=new URL(`/api/${p.slug}/mcp/${f}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},P=()=>k(s.id),R=async()=>{try{const f=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!f.ok){const T=await f.text();J.error(r("details.connection.failedRemoveOAuth",{error:T}));return}const N=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(N.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(f){console.error("Error removing OAuth token:",f),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(kt,{...x}),t.jsx(bt,{open:h!==null,onOpenChange:f=>{f||g(null)},children:t.jsxs(vt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Nt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(St,{className:"text-base",children:h?.title??s.title}),t.jsx(yt,{className:"text-xs",children:r("details.connection.settingsDescription")}),w&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(lt,{url:w.user?.image??void 0,fallback:w.user?.name??w.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:w.user?.name||w.user?.email})]})]}),t.jsxs(Ct,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(q,{control:v.control,name:"title",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(W,{...f})}),t.jsx(X,{})]})}),t.jsx(q,{control:v.control,name:"description",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(W,{...f,value:f.value||""})}),t.jsx(X,{})]})})]}),t.jsx(vs,{form:v,connection:h??s,hasOAuthToken:y.hasOAuthToken,onReauthenticate:P,onRemoveOAuth:R}),t.jsx(nt,{connection:h??s,form:v,hasMcpBinding:I,isMCPAuthenticated:A,supportsOAuth:y.supportsOAuth,isServerError:y.isServerError,onAuthenticate:P,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const f=h??s;g(null),x.requestDelete(f)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(it,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(bs,{connection:s,displayTitle:(()=>{const f=o[0]??s;return f.app_name?f.title.replace(/\s*\(\d+\)\s*$/,""):f.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(cs,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Zt,{instances:o,onConfigure:f=>g(f),onAuthenticate:f=>k(f.id),onDelete:f=>x.requestDelete(f),onToggleStatus:async(f,N)=>{try{await m.update.mutateAsync({id:f.id,data:{status:N}}),J.success(r(N==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{S(!0);try{const f=o[0]??s,N=f.title.replace(/\s*\(\d+\)\s*$/,""),T=o.length+1,D=`${N} (${T})`,F=We("conn");await m.create.mutateAsync({id:F,title:D,description:f.description??null,connection_type:f.connection_type,connection_url:f.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:f.created_by,organization_id:f.organization_id,icon:f.icon??null,app_name:f.app_name??null,app_id:f.app_id??null,connection_headers:f.connection_headers??null,oauth_config:null,configuration_state:f.configuration_state??null,metadata:null,tools:null,bindings:null});const Q=new URL(`/api/${p.slug}/mcp/${F}`,window.location.origin),Y=await mt({url:Q.href,token:null,orgId:p.id});Y.supportsOAuth&&!Y.isAuthenticated&&await k(F)}finally{S(!1)}}}),t.jsx(us,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(fs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ws(){const s=U.c(52),e=V();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=qe(a),{org:o}=te(),r=Ie();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=rt(d),m=u[0]??null,p=m?.id??"",x=p||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==x?(h={connectionId:x,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=x,s[7]=h):h=s[7];const g=Te(h);let j;s[8]!==g?(j={client:g},s[8]=g,s[9]=j):j=s[9];const{data:S}=ct(j);let y;if(s[10]!==m?.tools||s[11]!==p||s[12]!==u||s[13]!==S){const k=S?S.tools.map(Ds):(m?.tools??[]).map(Ps);e:{if(u.length<=1){y=k;break e}const P=new Set,R=[],f=Ts;for(const N of u){const T=N.id===p?k:f(N.tools);for(const D of T)P.has(D.name)||(P.add(D.name),R.push(D))}y=R.length>0?R:k}s[10]=m?.tools,s[11]=p,s[12]=u,s[13]=S,s[14]=y}else y=s[14];const _=y;let C;s[15]!==g?(C={client:g},s[15]=g,s[16]=C):C=s[16];const{data:$}=dt(C);let w;s[17]!==g?(w={client:g},s[17]=g,s[18]=w):w=s[18];const{data:M}=He(w);let A;s[19]!==$?.prompts?(A=$?.prompts??[],s[19]=$?.prompts,s[20]=A):A=s[20];let O;s[21]!==A?(O=A.map(Is),s[21]=A,s[22]=O):O=s[22];const I=O;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let b;s[25]!==v?(b=v.map(ks),s[25]=v,s[26]=b):b=s[26];const E=b;if(!m){let k;s[27]!==e?(k=e("details.connection.notFoundTitle"),s[27]=e,s[28]=k):k=s[28];let P;s[29]!==e?(P=e("details.connection.notFoundDescription"),s[29]=e,s[30]=P):P=s[30];let R;s[31]!==c||s[32]!==l?(R=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=R):R=s[33];let f;s[34]!==e?(f=e("details.connection.backButton"),s[34]=e,s[35]=f):f=s[35];let N;s[36]!==R||s[37]!==f?(N=t.jsx(B,{variant:"outline",onClick:R,children:f}),s[36]=R,s[37]=f,s[38]=N):N=s[38];let T;return s[39]!==k||s[40]!==P||s[41]!==N?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ce,{title:k,description:P,actions:N})}),s[39]=k,s[40]=P,s[41]=N,s[42]=T):T=s[42],T}let z;return s[43]!==r.update.isPending||s[44]!==_||s[45]!==m||s[46]!==p||s[47]!==l||s[48]!==I||s[49]!==E||s[50]!==u?(z=t.jsx(Cs,{org:l,connection:m,connectionId:p,isUpdating:r.update.isPending,tools:_,prompts:I,resources:E,siblings:u}),s[43]=r.update.isPending,s[44]=_,s[45]=m,s[46]=p,s[47]=l,s[48]=I,s[49]=E,s[50]=u,s[51]=z):z=s[51],z}function ks(s){return{name:s.name,description:s.description,uri:s.uri}}function Is(s){return{name:s.name,description:s.description}}function Ts(s){return(s??[]).map(As)}function As(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ps(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ds(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function $s(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(ws,{})})}),s[0]=e):e=s[0],e}function mi(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx($s,{}),s[0]=e):e=s[0],e}export{mi as default};
@@ -1 +1 @@
1
- import{au as R,bN as A,bO as I,av as o,bM as j,bL as L,c as z,j as u,B as C}from"./index-BE867Qee.js";import{I as H}from"./input-DWWEe804.js";import{s as W}from"./Plus-DUwLVLW_.js";import{s as q}from"./Trash01-DtMJF0U3.js";const K=R({key:o().min(1,"Key is required"),value:o()}),G=R({title:o().min(1,"Name is required"),description:o().nullable().optional(),icon:o().nullable().optional(),ui_type:L(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:o().optional(),connection_token:o().nullable().optional(),npx_package:o().optional(),stdio_command:o().optional(),stdio_args:o().optional(),stdio_cwd:o().optional(),env_vars:j(K).optional(),configuration_scopes:j(o()).nullable().optional(),configuration_state:A(o(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]}).refine(n=>(n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket")&&n.connection_url?.trim()?o().url().safeParse(n.connection_url.trim()).success:!0,{message:"Enter a valid URL",path:["connection_url"]});function O(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(i=>e.includes(i))||["sk_","rk_","whsec_","pk_live","sk_live"].some(i=>e.startsWith(i))||["_key","_secret","_token","_password","_auth","_pat"].some(i=>e.endsWith(i)))}function X(n){const e=z.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:i,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=i===void 0?"value...":i;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,s)=>s!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:p,value:c.value},r(s))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const g=P;let T;e[9]!==r||e[10]!==t?(T=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:c.key,value:p},r(s))},e[9]=r,e[10]=t,e[11]=T):T=e[11];const k=T;let f;if(e[12]!==g||e[13]!==y||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==g||e[20]!==y||e[21]!==k||e[22]!==m||e[23]!==h?(l=(p,s)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>g(s,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:O(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(s,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(s),children:u.jsx(q,{size:16})})]},s),e[19]=g,e[20]=y,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=g,e[13]=y,e[14]=k,e[15]=m,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(W,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==S?(d=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[w,"Add Environment Variable"]}),e[26]=S,e[27]=d):d=e[27];let _;e[28]!==f||e[29]!==d?(_=u.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=_):_=e[30];let E;return e[31]!==v||e[32]!==_?(E=u.jsx("div",{className:v,children:_}),e[31]=v,e[32]=_,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const a=e.slice(1).find(i=>!i.startsWith("-"));return a?{packageName:a}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(i=>(i.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",a=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:a}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const i=V(r);return Object.keys(i).length>0&&(a.envVars=i),a}export{X as E,J as a,Q as b,G as c,Z as d,Y as i,F as p,D as r};
1
+ import{au as R,bN as A,bO as I,av as o,bM as j,bL as L,c as z,j as u,B as C}from"./index-DD17LdOo.js";import{I as H}from"./input-BbeG6cTt.js";import{s as W}from"./Plus-MXLtMY7l.js";import{s as q}from"./Trash01-DEfHm1-C.js";const K=R({key:o().min(1,"Key is required"),value:o()}),G=R({title:o().min(1,"Name is required"),description:o().nullable().optional(),icon:o().nullable().optional(),ui_type:L(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:o().optional(),connection_token:o().nullable().optional(),npx_package:o().optional(),stdio_command:o().optional(),stdio_args:o().optional(),stdio_cwd:o().optional(),env_vars:j(K).optional(),configuration_scopes:j(o()).nullable().optional(),configuration_state:A(o(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]}).refine(n=>(n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket")&&n.connection_url?.trim()?o().url().safeParse(n.connection_url.trim()).success:!0,{message:"Enter a valid URL",path:["connection_url"]});function O(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(i=>e.includes(i))||["sk_","rk_","whsec_","pk_live","sk_live"].some(i=>e.startsWith(i))||["_key","_secret","_token","_password","_auth","_pat"].some(i=>e.endsWith(i)))}function X(n){const e=z.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:i,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=i===void 0?"value...":i;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,s)=>s!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:p,value:c.value},r(s))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const g=P;let T;e[9]!==r||e[10]!==t?(T=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:c.key,value:p},r(s))},e[9]=r,e[10]=t,e[11]=T):T=e[11];const k=T;let f;if(e[12]!==g||e[13]!==y||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==g||e[20]!==y||e[21]!==k||e[22]!==m||e[23]!==h?(l=(p,s)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>g(s,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:O(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(s,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(s),children:u.jsx(q,{size:16})})]},s),e[19]=g,e[20]=y,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=g,e[13]=y,e[14]=k,e[15]=m,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(W,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==S?(d=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[w,"Add Environment Variable"]}),e[26]=S,e[27]=d):d=e[27];let _;e[28]!==f||e[29]!==d?(_=u.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=_):_=e[30];let E;return e[31]!==v||e[32]!==_?(E=u.jsx("div",{className:v,children:_}),e[31]=v,e[32]=_,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const a=e.slice(1).find(i=>!i.startsWith("-"));return a?{packageName:a}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(i=>(i.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",a=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:a}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const i=V(r);return Object.keys(i).length>0&&(a.envVars=i),a}export{X as E,J as a,Q as b,G as c,Z as d,Y as i,F as p,D as r};
@@ -1 +1 @@
1
- import{r as z,c as W,b as te,j as t,B as E,h as ue,l as xe,G as ce,F as We,I as Xe,H as Ge,E as qe,X as ke,d as Te,u as Qe,a as we,R as Je,ad as Ce,U as Ye,V as Ze,at as et,as as tt,n as fe,q as ee,o as nt,a2 as st,t as R,K as ot}from"./index-BE867Qee.js";import{a as Ae,g as it,e as ct}from"./extract-connection-data-VVSQT7HS.js";import{C as lt}from"./collection-display-button-B4IWBje6.js";import{S as rt}from"./search-input-B5un_Cd7.js";import{C as at}from"./collection-tabs-DujOg3C7.js";import{C as ve,u as Ie,g as dt}from"./connection-card-BE5DxUWL.js";import{E as ut}from"./empty-state-CDvZ4pSZ.js";import{u as gt,D as mt}from"./use-delete-connection-C6BGGvaV.js";import{u as pt}from"./use-infinite-scroll-Cj7K2rNB.js";import{u as Pe}from"./use-mobile-avjkwF6P.js";import{g as de}from"./connection-slug-CITJ0kGN.js";import{A as ft,a as ht,b as xt,c as jt,g as St,d as yt,e as Ct,f as vt}from"./alert-dialog-zI-mFpSQ.js";import{n as je}from"./LinkBroken01-8QjnprbC.js";import{g as bt,a as _t}from"./metadata-D72DunRR.js";import{d as Me,h as $e,c as Oe,e as Fe,b as Ue,D as Ve}from"./dialog-DC6TmMkf.js";import{D as Nt,a as Dt,d as kt,b as Tt,e as wt,f as At,g as It}from"./drawer-BUMMA5sr.js";import{F as q,b as Q,c as J,d as Y,f as Z,a as Ne}from"./form-R8MW_Gtw.js";import{I as se}from"./input-DWWEe804.js";import{S as Pt,b as Mt,a as $t,d as Ot,c as ae}from"./select-CYYv9Vtn.js";import{T as Ft}from"./textarea-D_VH3s7x.js";import{b as ze,u as Ut}from"./use-connection-x3pfvWpW.js";import{m as Vt}from"./use-mcp-client-BGKUmMJU.js";import{b as zt}from"./repository-binding-kLfd1JPC.js";import{g as Lt}from"./types-DSEqfHk2.js";import{A as Et,bu as Bt,aw as Kt,bb as Ht,p as ye}from"./agent-icon-C8zn459s.js";import{s as Le}from"./Plus-DUwLVLW_.js";import{c as Rt}from"./UserSquare-B0WZmX6s.js";import{s as Ee}from"./XClose-DwKTRWak.js";import{s as Wt}from"./use-project-scope-CdG18ZwV.js";import{i as he,a as De,E as Xt,c as Gt,p as qt,b as Qt,d as Jt}from"./connection-form-helpers-B0fzrlcU.js";import{a as Yt}from"./authenticate-and-persist-oauth--Ui7uUW3.js";import{I as Zt}from"./integration-icon-aoXYYKdZ.js";import{C as Be}from"./checkbox-DM1zG_bR.js";import{i as en}from"./DotsVertical-Dyi1_2jC.js";import{s as Ke}from"./Image01-0Rs0fG3a.js";import{s as He}from"./Trash01-DtMJF0U3.js";import"./connection-Bw7PTYac.js";import"./ArrowUp-0DU20WU2.js";import"./Check-Bo3qSXwJ.js";import"./tooltip-2Ew10_I0.js";import"./index-6OICj4ln.js";import"./view-mode-toggle-DSgKza5v.js";import"./badge-Bkod8faG.js";import"./SearchMd-BiNHdvMf.js";import"./useInfiniteQuery-B0OQsDiL.js";import"./infiniteQueryObserver-B0NvduwT.js";import"./slugify-CEUa2lfQ.js";import"./X-BO04Dn0R.js";import"./label-CpTis3ZF.js";import"./ChevronUp-Ds84QUAn.js";import"./auth-DQuDCDTH.js";import"./AlertCircle-CQA_p2Cp.js";import"./Tool01-BuLiX0jy.js";import"./ArrowLeft-Dl_7c8AB.js";import"./ShoppingBag01-BlgcPhxp.js";import"./ZoomOut-hhnEYknp.js";import"./Building02-CsHqQGTj.js";import"./CheckCircle-BCxvtn62.js";import"./Copy01-QNdLW2v3.js";import"./CreditCard01-D1KkCG7o.js";import"./Palette-CaoJ793n.js";import"./Key01-DvlZjbjO.js";import"./Link01-3DcN1bgm.js";import"./LinkExternal01-CLN31q0P.js";import"./Monitor01-C0xXEFc5.js";import"./Sun-aSGS3XrK.js";import"./Upload01-C2lcKrsy.js";import"./User01-DmaMR1Ca.js";import"./Users01-C8SJUk8C.js";import"./mcp-oauth-DOvgIVsQ.js";function tn(o){const e=`deco-filters-${o}`,[n,u]=z.useState(()=>{try{const i=globalThis.localStorage?.getItem(e);if(i)return JSON.parse(i)}catch(i){console.error("Failed to parse stored filters:",i)}return[]});return[n,i=>{u(i);try{globalThis.localStorage?.setItem(e,JSON.stringify(i))}catch(l){console.error("Failed to save filters:",l)}}]}function nn(o){const e=W.c(7),[n,u]=z.useState(o),[s,i]=z.useState(o?"desc":null);let l;e[0]!==s||e[1]!==n?(l=h=>{n!==h?(u(h),i("asc")):s==="asc"?i("desc"):s==="desc"&&(u(void 0),i(null))},e[0]=s,e[1]=n,e[2]=l):l=e[2];const r=l;let d;return e[3]!==r||e[4]!==s||e[5]!==n?(d={sortKey:n,sortDirection:s,handleSort:r},e[3]=r,e[4]=s,e[5]=n,e[6]=d):d=e[6],d}function sn(o,e){const n=W.c(12),u=e===void 0?"cards":e,s=Pe(),i=z.useRef(s),l=o?`deco-view-mode-${o}`:"deco-view-mode";let r;n[0]!==u||n[1]!==l?(r=()=>{const j=globalThis.localStorage?.getItem(l);return j==="cards"||j==="table"?j:u},n[0]=u,n[1]=l,n[2]=r):r=n[2];const[d,h]=z.useState(r);let p;n[3]!==l?(p=j=>{h(j),globalThis.localStorage?.setItem(l,j)},n[3]=l,n[4]=p):p=n[4];const g=p;let a,m;n[5]!==s||n[6]!==d?(a=()=>{!i.current&&s&&d==="table"&&h("cards"),i.current=s},m=[s,d],n[5]=s,n[6]=d,n[7]=a,n[8]=m):(a=n[7],m=n[8]),z.useEffect(a,m);let f;return n[9]!==g||n[10]!==d?(f=[d,g],n[9]=g,n[10]=d,n[11]=f):f=n[11],f}function on(o){const e=W.c(20),{namespace:n,resource:u,defaultSortKey:s,defaultViewMode:i}=o,l=s===void 0?"title":s,r=i===void 0?"table":i,[d,h]=z.useState(""),p=z.useDeferredValue(d),g=`${n}-${u}`,[a,m]=tn(g),f=`studio-${u}-filter-visible-${n}`;let j;e[0]!==f?(j=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=j):j=e[1];const[S,C]=z.useState(j);let y;e[2]!==f?(y=$=>{C($),globalThis.localStorage?.setItem(f,String($))},e[2]=f,e[3]=y):y=e[3];const c=y;let x;e[4]!==S||e[5]!==c?(x=()=>{c(!S)},e[4]=S,e[5]=c,e[6]=x):x=e[6];const A=x,[T,w]=sn(`studio-${u}-${n}`,r),{sortKey:M,sortDirection:I,handleSort:O}=nn(l),P=M;let D;return e[7]!==S||e[8]!==a||e[9]!==O||e[10]!==d||e[11]!==p||e[12]!==c||e[13]!==m||e[14]!==w||e[15]!==I||e[16]!==P||e[17]!==A||e[18]!==T?(D={search:d,searchTerm:p,setSearch:h,filters:a,setFilters:m,filterBarVisible:S,setFilterBarVisible:c,toggleFilterBar:A,viewMode:T,setViewMode:w,sortKey:P,sortDirection:I,handleSort:O},e[7]=S,e[8]=a,e[9]=O,e[10]=d,e[11]=p,e[12]=c,e[13]=m,e[14]=w,e[15]=I,e[16]=P,e[17]=A,e[18]=T,e[19]=D):D=e[19],D}function cn(o){const e=W.c(35),{open:n,onOpenChange:u,count:s,onConfirm:i}=o,l=te(),r=s===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==s||e[1]!==l||e[2]!==r?(d=l(r,{count:s}),e[0]=s,e[1]=l,e[2]=r,e[3]=d):d=e[3];let h;e[4]!==d?(h=t.jsx(ft,{children:d}),e[4]=d,e[5]=h):h=e[5];const p=s===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let g;e[6]!==l||e[7]!==p?(g=l(p),e[6]=l,e[7]=p,e[8]=g):g=e[8];let a;e[9]!==g?(a=t.jsx(ht,{children:g}),e[9]=g,e[10]=a):a=e[10];let m;e[11]!==h||e[12]!==a?(m=t.jsxs(xt,{children:[h,a]}),e[11]=h,e[12]=a,e[13]=m):m=e[13];let f;e[14]!==l?(f=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=f):f=e[15];let j;e[16]!==f?(j=t.jsx(jt,{children:f}),e[16]=f,e[17]=j):j=e[17];const S=s===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let C;e[18]!==s||e[19]!==l||e[20]!==S?(C=l(S,{count:s}),e[18]=s,e[19]=l,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==i||e[23]!==C?(y=t.jsx(St,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:C}),e[22]=i,e[23]=C,e[24]=y):y=e[24];let c;e[25]!==y||e[26]!==j?(c=t.jsxs(yt,{children:[j,y]}),e[25]=y,e[26]=j,e[27]=c):c=e[27];let x;e[28]!==c||e[29]!==m?(x=t.jsxs(Ct,{children:[m,c]}),e[28]=c,e[29]=m,e[30]=x):x=e[30];let A;return e[31]!==u||e[32]!==n||e[33]!==x?(A=t.jsx(vt,{open:n,onOpenChange:u,children:x}),e[31]=u,e[32]=n,e[33]=x,e[34]=A):A=e[34],A}function ln(o){const e=W.c(39),{item:n,canManage:u,allConnections:s,connectedAppNames:i,connectingItemId:l,onNavigateConnected:r,onConnect:d}=o,h=te();let p,g;e[0]!==i||e[1]!==n?(p=Ae(n)??"",g=i.has(p),e[0]=i,e[1]=n,e[2]=p,e[3]=g):(p=e[2],g=e[3]);const a=g;let m;e[4]!==n._meta?(m=bt(n._meta),e[4]=n._meta,e[5]=m):m=e[5];const f=m,j=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",S=n.server?.description||n.description||null;let C;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(C=n.server?.icons?.[0]?.src||_t(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=C):C=e[8];const y=C;let c;if(e[9]!==s||e[10]!==p){let V;e[12]!==p?(V=b=>b.connection_type!=="VIRTUAL"&&b.app_name===p,e[12]=p,e[13]=V):V=e[13],c=s.filter(V),e[9]=s,e[10]=p,e[11]=c}else c=e[11];const x=c,A=a||u;let T,w;e[14]!==x||e[15]!==a||e[16]!==n||e[17]!==d||e[18]!==r?(T=()=>{if(a){const V=x[0];V&&r(V);return}w()},w=()=>d(n),e[14]=x,e[15]=a,e[16]=n,e[17]=d,e[18]=r,e[19]=T,e[20]=w):(T=e[19],w=e[20]);let M;e[21]!==S||e[22]!==y||e[23]!==j?(M={title:j,description:S,icon:y},e[21]=S,e[22]=y,e[23]=j,e[24]=M):M=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(je,{}),e[25]=I):I=e[25];const O=A?T:void 0;let P;e[26]!==u||e[27]!==l||e[28]!==w||e[29]!==a||e[30]!==n.id||e[31]!==h?(P=a?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:h("orgs.catalogItemCard.connected")}):u&&t.jsx(E,{variant:"outline",size:"sm",className:"h-7 px-3 text-sm font-medium",disabled:l!==null,onClick:V=>{V.stopPropagation(),w()},children:l===n.id?t.jsx(ue,{className:"size-3.5"}):h("orgs.catalogItemCard.connect")}),e[26]=u,e[27]=l,e[28]=w,e[29]=a,e[30]=n.id,e[31]=h,e[32]=P):P=e[32];let D;e[33]!==P?(D=t.jsx("div",{className:"flex items-center gap-2",children:P}),e[33]=P,e[34]=D):D=e[34];let $;return e[35]!==M||e[36]!==O||e[37]!==D?($=t.jsx(ve,{connection:M,fallbackIcon:I,onClick:O,headerActionsAlwaysVisible:!0,headerActions:D}),e[35]=M,e[36]=O,e[37]=D,e[38]=$):$=e[38],$}function rn(o){return o?.length?{appToolName:o.find(n=>!!Lt(n._meta))?.name??null}:null}const an=3;function dn(o){const e=new Map;for(const n of o)for(const u of n.connections??[]){const s=e.get(u.connection_id)??[];s.push(n),e.set(u.connection_id,s)}return e}function un(o){const e=W.c(25),{projects:n}=o,u=te();if(n.length===0){let m;e[0]!==u?(m=u("projects.connections.orgWide"),e[0]=u,e[1]=m):m=e[1];let f;return e[2]!==m?(f=t.jsx("span",{className:"text-xs text-muted-foreground",children:m}),e[2]=m,e[3]=f):f=e[3],f}let s,i,l,r;if(e[4]!==n){const m=n.slice(0,an);s=n.length-m.length,r="flex min-w-0 items-center gap-2",i="flex shrink-0 -space-x-1.5",l=m.map(gn),e[4]=n,e[5]=s,e[6]=i,e[7]=l,e[8]=r}else s=e[5],i=e[6],l=e[7],r=e[8];let d;e[9]!==i||e[10]!==l?(d=t.jsx("div",{className:i,children:l}),e[9]=i,e[10]=l,e[11]=d):d=e[11];let h;e[12]!==n[0]?.title||e[13]!==n.length||e[14]!==u?(h=n.length===1?n[0]?.title:u("projects.connections.usedBy",{count:n.length}),e[12]=n[0]?.title,e[13]=n.length,e[14]=u,e[15]=h):h=e[15];let p;e[16]!==h?(p=t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:h}),e[16]=h,e[17]=p):p=e[17];let g;e[18]!==s?(g=s>0&&t.jsx("span",{className:"sr-only",children:s}),e[18]=s,e[19]=g):g=e[19];let a;return e[20]!==r||e[21]!==d||e[22]!==p||e[23]!==g?(a=t.jsxs("div",{className:r,children:[d,p,g]}),e[20]=r,e[21]=d,e[22]=p,e[23]=g,e[24]=a):a=e[24],a}function gn(o){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:o.title,children:t.jsx(Et,{icon:o.icon,name:o.title,size:"xs"})},o.id)}function Re(o){const e=W.c(8),{selectionMode:n,children:u}=o,s=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let i;e[0]!==s?(i=xe("overflow-hidden transition-all duration-150 ease-out",s),e[0]=s,e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(We,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:pn,children:t.jsx(en,{size:20})})}),e[2]=l):l=e[2];let r;e[3]!==u?(r=t.jsxs(Xe,{children:[l,t.jsx(Ge,{align:"end",onClick:mn,children:u})]}),e[3]=u,e[4]=r):r=e[4];let d;return e[5]!==i||e[6]!==r?(d=t.jsx("div",{className:i,children:r}),e[5]=i,e[6]=r,e[7]=d):d=e[7],d}function mn(o){return o.stopPropagation()}function pn(o){return o.stopPropagation()}function fn(o){const e=W.c(57),{group:n,onOpen:u,selectionMode:s,selectedIds:i,onToggleSelect:l}=o,r=te();let d;if(e[0]!==n.connections||e[1]!==i){let N;e[3]!==i?(N=U=>i.has(U.id),e[3]=i,e[4]=N):N=e[4],d=n.connections.every(N),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const h=d;let p;if(e[5]!==n.connections||e[6]!==i){let N;e[8]!==i?(N=U=>i.has(U.id),e[8]=i,e[9]=N):N=e[9],p=n.connections.some(N),e[5]=n.connections,e[6]=i,e[7]=p}else p=e[7];const g=p;let a;e[10]!==h||e[11]!==n.connections||e[12]!==l||e[13]!==i?(a=()=>{for(const N of n.connections)h?i.has(N.id)&&l(N.id):i.has(N.id)||l(N.id)},e[10]=h,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=a):a=e[14];const m=a,f=n.title,j=n.icon;let S;e[15]!==n.connections.length||e[16]!==r?(S=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=S):S=e[17];let C;e[18]!==n.icon||e[19]!==n.title||e[20]!==S?(C={title:f,icon:j,description:S},e[18]=n.icon,e[19]=n.title,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==u||e[23]!==s||e[24]!==m?(y=()=>s?m():u(),e[22]=u,e[23]=s,e[24]=m,e[25]=y):y=e[25];const c=s&&h&&"ring-2 ring-primary",x=s&&g&&!h&&"ring-1 ring-primary/50";let A;e[26]!==x||e[27]!==c?(A=xe(c,x),e[26]=x,e[27]=c,e[28]=A):A=e[28];const T=s?h?!0:g&&"mixed":void 0;let w;e[29]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(je,{}),e[29]=w):w=e[29];let M;e[30]!==h||e[31]!==n.connections.length||e[32]!==s||e[33]!==g||e[34]!==r||e[35]!==m?(M=s?t.jsx(Be,{checked:h?!0:g?"indeterminate":!1,onCheckedChange:m}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:r("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=h,e[31]=n.connections.length,e[32]=s,e[33]=g,e[34]=r,e[35]=m,e[36]=M):M=e[36];let I;e[37]!==u?(I=N=>{N.stopPropagation(),u()},e[37]=u,e[38]=I):I=e[38];let O;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Ke,{size:16}),e[39]=O):O=e[39];let P;e[40]!==r?(P=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=P):P=e[41];let D;e[42]!==I||e[43]!==P?(D=t.jsxs(ce,{onClick:I,children:[O,P]}),e[42]=I,e[43]=P,e[44]=D):D=e[44];let $;e[45]!==s||e[46]!==D?($=t.jsx(Re,{selectionMode:s,children:D}),e[45]=s,e[46]=D,e[47]=$):$=e[47];let V;e[48]!==M||e[49]!==$?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[M,$]}),e[48]=M,e[49]=$,e[50]=V):V=e[50];let b;return e[51]!==A||e[52]!==T||e[53]!==V||e[54]!==C||e[55]!==y?(b=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:C,onClick:y,className:A,selected:T,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:V})}),e[51]=A,e[52]=T,e[53]=V,e[54]=C,e[55]=y,e[56]=b):b=e[56],b}function hn(o){const e=W.c(36),{connection:n,isSelected:u,selectionMode:s,canManage:i,canManageAgents:l,onToggleSelect:r,onOpen:d,onToggleStatus:h,onDelete:p}=o,g=te();let a;e[0]!==u||e[1]!==r||e[2]!==s||e[3]!==g?(a=s?t.jsx(Be,{checked:u,onCheckedChange:r,onClick:xn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:g("orgs.connectionSelectionUi.connected")}),e[0]=u,e[1]=r,e[2]=s,e[3]=g,e[4]=a):a=e[4];let m;e[5]!==d?(m=T=>{T.stopPropagation(),d()},e[5]=d,e[6]=m):m=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ke,{size:16}),e[7]=f):f=e[7];let j;e[8]!==g?(j=g("orgs.connectionSelectionUi.open"),e[8]=g,e[9]=j):j=e[9];let S;e[10]!==m||e[11]!==j?(S=t.jsxs(ce,{onClick:m,children:[f,j]}),e[10]=m,e[11]=j,e[12]=S):S=e[12];let C;e[13]!==i||e[14]!==l||e[15]!==r||e[16]!==g?(C=(i||l)&&t.jsxs(ce,{onClick:T=>{T.stopPropagation(),r()},children:[t.jsx(Bt,{size:16}),g("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=r,e[16]=g,e[17]=C):C=e[17];let y;e[18]!==i||e[19]!==n||e[20]!==h||e[21]!==g?(y=i&&(n.status==="active"?t.jsxs(ce,{onClick:T=>{T.stopPropagation(),h("inactive")},children:[t.jsx(Kt,{size:16}),g("orgs.connectionSelectionUi.disable")]}):t.jsxs(ce,{onClick:T=>{T.stopPropagation(),h("active")},children:[t.jsx(Ht,{size:16}),g("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=h,e[21]=g,e[22]=y):y=e[22];let c;e[23]!==i||e[24]!==p||e[25]!==g?(c=i&&t.jsxs(ce,{variant:"destructive",onClick:T=>{T.stopPropagation(),p()},children:[t.jsx(He,{size:16}),g("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=p,e[25]=g,e[26]=c):c=e[26];let x;e[27]!==s||e[28]!==S||e[29]!==C||e[30]!==y||e[31]!==c?(x=t.jsxs(Re,{selectionMode:s,children:[S,C,y,c]}),e[27]=s,e[28]=S,e[29]=C,e[30]=y,e[31]=c,e[32]=x):x=e[32];let A;return e[33]!==a||e[34]!==x?(A=t.jsxs("div",{className:"flex items-center gap-1",children:[a,x]}),e[33]=a,e[34]=x,e[35]=A):A=e[35],A}function xn(o){return o.stopPropagation()}function jn(o){const e=W.c(29),{count:n,total:u,canManage:s,canManageAgents:i,onSelectAll:l,onDeselectAll:r,onDelete:d,onAddToAgent:h,onToggleStatus:p,onCancel:g}=o,a=te();if(n===0)return null;let m;e[0]!==n||e[1]!==a?(m=a("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=a,e[2]=m):m=e[2];let f;e[3]!==m?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:m}),e[3]=m,e[4]=f):f=e[4];let j;e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==a||e[9]!==u?(j=n<u?t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:a("orgs.connectionSelectionUi.selectAll",{total:u})}):t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:a("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=l,e[8]=a,e[9]=u,e[10]=j):j=e[10];let S;e[11]!==i||e[12]!==h||e[13]!==a?(S=i&&t.jsxs(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:[t.jsx(Le,{size:13}),a("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=h,e[13]=a,e[14]=S):S=e[14];let C;e[15]!==s||e[16]!==d||e[17]!==p||e[18]!==a?(C=s&&t.jsxs(t.Fragment,{children:[t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>p("active"),children:a("orgs.connectionSelectionUi.enable")}),t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>p("inactive"),children:a("orgs.connectionSelectionUi.disable")}),t.jsxs(E,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(He,{size:13}),a("orgs.connectionSelectionUi.delete")]})]}),e[15]=s,e[16]=d,e[17]=p,e[18]=a,e[19]=C):C=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ee,{size:13}),e[20]=y):y=e[20];let c;e[21]!==g?(c=t.jsx(E,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:y}),e[21]=g,e[22]=c):c=e[22];let x;return e[23]!==f||e[24]!==j||e[25]!==S||e[26]!==C||e[27]!==c?(x=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[f,j,S,C,c]})}),e[23]=f,e[24]=j,e[25]=S,e[26]=C,e[27]=c,e[28]=x):x=e[28],x}function Sn(o){const e=W.c(47),{open:n,onOpenChange:u,agents:s,onConfirm:i}=o,l=te(),[r,d]=z.useState(null);let h;e[0]!==u?(h=D=>{D||d(null),u(D)},e[0]=u,e[1]=h):h=e[1];const p=h;let g;e[2]!==l?(g=l("orgs.connectionSelectionUi.addToAgentTitle"),e[2]=l,e[3]=g):g=e[3];let a;e[4]!==g?(a=t.jsx(Me,{children:g}),e[4]=g,e[5]=a):a=e[5];let m;e[6]!==l?(m=l("orgs.connectionSelectionUi.addToAgentDescription"),e[6]=l,e[7]=m):m=e[7];let f;e[8]!==m?(f=t.jsx($e,{children:m}),e[8]=m,e[9]=f):f=e[9];let j;e[10]!==a||e[11]!==f?(j=t.jsxs(Oe,{children:[a,f]}),e[10]=a,e[11]=f,e[12]=j):j=e[12];let S;e[13]!==s||e[14]!==r||e[15]!==l?(S=s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):s.map(D=>t.jsxs("button",{type:"button",onClick:()=>d(D.id),className:xe("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",r===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Zt,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[13]=s,e[14]=r,e[15]=l,e[16]=S):S=e[16];let C;e[17]!==S?(C=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:S}),e[17]=S,e[18]=C):C=e[18];let y;e[19]!==p?(y=()=>p(!1),e[19]=p,e[20]=y):y=e[20];let c;e[21]!==l?(c=l("orgs.connectionSelectionUi.cancel"),e[21]=l,e[22]=c):c=e[22];let x;e[23]!==c||e[24]!==y?(x=t.jsx(E,{variant:"outline",onClick:y,children:c}),e[23]=c,e[24]=y,e[25]=x):x=e[25];const A=!r;let T;e[26]!==p||e[27]!==i||e[28]!==r?(T=()=>{r&&(i(r),p(!1))},e[26]=p,e[27]=i,e[28]=r,e[29]=T):T=e[29];let w;e[30]!==l?(w=l("orgs.connectionSelectionUi.add"),e[30]=l,e[31]=w):w=e[31];let M;e[32]!==A||e[33]!==T||e[34]!==w?(M=t.jsx(E,{disabled:A,onClick:T,children:w}),e[32]=A,e[33]=T,e[34]=w,e[35]=M):M=e[35];let I;e[36]!==x||e[37]!==M?(I=t.jsxs(Fe,{children:[x,M]}),e[36]=x,e[37]=M,e[38]=I):I=e[38];let O;e[39]!==I||e[40]!==j||e[41]!==C?(O=t.jsxs(Ue,{className:"sm:max-w-[400px]",children:[j,C,I]}),e[39]=I,e[40]=j,e[41]=C,e[42]=O):O=e[42];let P;return e[43]!==p||e[44]!==n||e[45]!==O?(P=t.jsx(Ve,{open:n,onOpenChange:p,children:O}),e[43]=p,e[44]=n,e[45]=O,e[46]=P):P=e[46],P}function yn({listState:o,activeTab:e,typeFilter:n,statusFilter:u}){const s=te(),{org:i}=ke(),l=nt(),r=Te(),{data:d}=we.useSession(),h=ze(),p=Ut(o),g=gt(),{granted:a}=Ce("connections:manage"),{granted:m}=Ce("agents:manage"),[f,j]=z.useState(new Set),S=f.size>0,[C,y]=z.useState(!1),[c,x]=z.useState(!1),[A,T]=z.useState(null),w=zt(),M=dn(Wt(w)),I=p.filter(_=>!(n!=="ALL"&&_.connection_type!==n||u!=="ALL"&&_.status!==u)),O=dt(I),P=_=>{j(v=>{const B=new Set(v);return B.has(_)?B.delete(_):B.add(_),B})},D=()=>{j(new Set)},$=Ie(o.searchTerm),V=$.items,b=pt($.loadMore,$.hasMore,$.isLoadingMore),N=new Set(p.filter(_=>_.app_name).map(_=>_.app_name)),U=o.search.length>0,X=e==="all"||U?V.filter(_=>{if(U){const v=Ae(_);if(v&&N.has(v))return!1}return!0}):[],G=e==="connected"||U?O:[],k=async _=>{if(!(!i||!d?.user?.id)){ee("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),T(_.id);try{const v=ct(_,i.id,d.user.id,{remoteIndex:0}),B=v.connection_type==="STDIO",H=!!v.connection_url,K=B&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!H&&!K){R.error(s("orgs.connections.cannotConnectNoMethod")),T(null);return}const oe=await h.create.mutateAsync(v),{id:ie}=oe,le=await Yt({connectionId:ie,orgId:i.id,orgSlug:i.slug,persistFallback:re=>h.update.mutateAsync({id:ie,data:{connection_token:re}}).then(()=>{})});if(le.ran&&!le.ok){ee("connection_oauth_failed",{connection_id:ie,flow:"connections_page_connect",error:le.error??"no_token"}),R.error(s("orgs.connections.authenticationFailed",{error:le.error??"no token received"}));return}if(le.ran){ee("connection_oauth_succeeded",{connection_id:ie,flow:"connections_page_connect"});const re=new URL(`/api/${i.slug}/mcp/${ie}`,window.location.origin);await l.invalidateQueries({queryKey:ot.isMCPAuthenticated(re.href,null)}),F(),R.success(s("orgs.connections.authenticationSuccessful"))}let pe=null;try{const re=await l.fetchQuery(Vt({connectionId:ie,orgId:i.id,orgSlug:i.slug}));pe=rn((await re.listTools()).tools)}catch{}const be=de(oe),_e=pe?pe.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(pe.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:be}}:null;R.success(s("orgs.connections.connectedSuccessfully"),_e?{action:{label:s("orgs.connections.openConnection"),onClick:()=>r(_e)}}:void 0)}catch(v){R.error(s("orgs.connections.failedToConnect",{error:v instanceof Error?v.message:String(v)}))}finally{T(null)}}},L=st(),F=()=>{l.invalidateQueries({predicate:_=>{const v=_.queryKey;return v[1]===i.id&&v[3]==="collection"&&v[4]==="CONNECTIONS"}})},ge=async()=>{y(!1);const _=[...f];ee("connections_bulk_delete",{count:_.length});const B=(await Promise.allSettled(_.map(H=>L.call("COLLECTION_CONNECTIONS_DELETE",{id:H,force:!0})))).filter(H=>H.status==="fulfilled").length;F(),R.success(s("orgs.connections.deletedConnections",{count:B})),D()},Se=async(_,v)=>{try{await h.update.mutateAsync({id:_,data:{status:v}}),F(),R.success(s(v==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(s("orgs.connections.failedToUpdateConnection"))}},me=async _=>{const v=[...f];ee("connections_bulk_status_toggled",{count:v.length,to_status:_});const H=(await Promise.allSettled(v.map(K=>h.update.mutateAsync({id:K,data:{status:_}})))).filter(K=>K.status==="fulfilled").length;F(),R.success(_==="active"?s("orgs.connections.enabledConnections",{count:H}):s("orgs.connections.disabledConnections",{count:H})),D()},ne=async _=>{const v=w.find(K=>K.id===_);if(!v)return;ee("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const B=new Set(v.connections.map(K=>K.connection_id)),H=[...f].filter(K=>!B.has(K)).map(K=>({connection_id:K,selected_tools:null,selected_resources:null,selected_prompts:null}));if(H.length===0){R.info(s("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await L.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...v.connections,...H]}}),l.invalidateQueries({predicate:K=>{const oe=K.queryKey;return oe[1]===i.id&&oe[3]==="collection"&&oe[4]==="VIRTUAL_MCP"}}),R.success(s("orgs.connections.addedConnectionsToAgent",{count:H.length,agentTitle:v.title})),D()}catch{R.error(s("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(mt,{...g}),t.jsx(cn,{open:C,onOpenChange:y,count:f.size,onConfirm:ge}),t.jsx(Sn,{open:c,onOpenChange:x,agents:w,onConfirm:ne}),$.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(U?X.length===0&&I.length===0:e==="all"?X.length===0:I.length===0)?t.jsx(ut,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:s("orgs.connections.noConnectionsFound"),description:o.search?s("orgs.connections.noConnectionsMatchSearch",{search:o.search}):s(a?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[G.map(_=>{if(_.type==="group")return t.jsx(fn,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:_.key}})},selectionMode:S,selectedIds:f,onToggleSelect:P},_.key);const v=_.connection,B=f.has(v.id);return t.jsx(ve,{connection:v,fallbackIcon:t.jsx(je,{}),onClick:()=>S?P(v.id):r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:de(v)}}),className:xe(B&&"ring-2 ring-primary bg-primary/5"),selected:S?B:void 0,footer:t.jsx(un,{projects:M.get(v.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(hn,{connection:v,isSelected:B,selectionMode:S,canManage:a,canManageAgents:m,onToggleSelect:()=>P(v.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:de(v)}}),onToggleStatus:H=>Se(v.id,H),onDelete:()=>g.requestDelete(v)})},v.id)}),X.map(_=>t.jsx(ln,{item:_,canManage:a,allConnections:p,connectedAppNames:N,connectingItemId:A,onNavigateConnected:v=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:de(v)}}),onConnect:k},_.id)),(e==="all"||U)&&t.jsx("div",{ref:b,className:"col-span-full h-4"}),(e==="all"||U)&&$.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ue,{className:"size-6 text-muted-foreground"})})]})}),S&&t.jsx(jn,{count:f.size,total:I.length,canManage:a,canManageAgents:m,onSelectAll:()=>{j(new Set(I.map(_=>_.id)))},onDeselectAll:()=>j(new Set),onDelete:()=>y(!0),onAddToAgent:()=>x(!0),onToggleStatus:me,onCancel:D})]})}function Cn(){const o=te(),{org:e}=ke(),n=Te(),u=Qe({strict:!1}),{data:s}=we.useSession(),{stdioEnabled:i}=Je(),l=Pe(),{granted:r}=Ce("connections:manage"),d=on({namespace:e.slug,resource:"connections"}),h=ze(),[p,g]=Ye(Ze.connectionsTab(e.slug),b=>u.tab==="all"||u.tab==="connected"?u.tab:b??"all"),[a,m]=z.useState("ALL"),[f,j]=z.useState("ALL"),C=Ie(d.searchTerm).items,y=d.search!==d.searchTerm,c=et({resolver:tt(Gt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),x=c.watch("ui_type"),A=c.watch("connection_url"),T=c.watch("npx_package"),w=he({uiType:x,connectionUrl:A??"",npxPackage:T??""})??De({uiType:x,connectionUrl:A??"",registryItems:C}),M=r&&u.action==="create",I=()=>{ee("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},O=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},P=async b=>{let N,U=null,X=null,G=null;b.ui_type==="NPX"?(N="STDIO",U="",G=Qt(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(N="STDIO",U="",G=Jt(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(N=b.ui_type,U=b.connection_url||"",X=b.connection_token||null);const k=it("conn");ee("connection_custom_created",{connection_type:N,ui_type:b.ui_type}),await h.create.mutateAsync({id:k,title:b.title,description:b.description||null,connection_type:N,connection_url:U,connection_token:X,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:s?.user?.id||"system",organization_id:e.id,icon:b.icon??null,app_name:null,app_id:null,connection_headers:G,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null}),O(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:de({app_name:null,connection_url:U,title:b.title,id:k})}})},D=b=>{b||(M&&O(),c.reset())},$=b=>{const N=b.trim();if(!N)return;const U=!!c.formState.dirtyFields.title,X=!!c.formState.dirtyFields.description,G=!!c.formState.dirtyFields.env_vars,k=F=>{if(F&&(!U&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!X&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!G&&F.envVarKeys?.length)){const ge=c.getValues("env_vars")??[],Se=new Set(ge.map(ne=>ne.key)),me=F.envVarKeys.filter(ne=>!Se.has(ne));me.length>0&&c.setValue("env_vars",[...ge,...me.map(ne=>({key:ne,value:""}))],{shouldDirty:!0})}},L=qt(N);if(L&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",L.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),k(he({uiType:"NPX",npxPackage:L.packageName}));return}if(N.startsWith("http://")||N.startsWith("https://")){const F=x==="HTTP"||x==="SSE"||x==="Websocket"?x:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",N,{shouldDirty:!0}),k(he({uiType:F,connectionUrl:N})??De({uiType:F,connectionUrl:N,registryItems:C}));return}x==="NPX"&&k(he({uiType:"NPX",npxPackage:N}))},V=r?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(E,{size:"sm",variant:"default",onClick:I,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:o("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(fe,{children:[(()=>{const b=o("orgs.connections.createConnection"),N=o("orgs.connections.createConnectionDescription"),U=c.formState.isSubmitting?o("orgs.connections.saving"):o("orgs.connections.createConnection"),X=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(q,{control:c.control,name:"ui_type",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.type")}),t.jsxs(Pt,{value:k.value,onValueChange:k.onChange,children:[t.jsx(Y,{children:t.jsx(Mt,{children:t.jsx($t,{})})}),t.jsxs(Ot,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"Websocket"]})}),i&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),o("orgs.connections.npxPackage")]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Rt,{className:"w-4 h-4"}),o("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),x==="NPX"&&t.jsx(q,{control:c.control,name:"npx_package",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.npmPackage")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.npmPackagePlaceholder"),...k,value:k.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),$(F))},onBlur:L=>{$(L.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),x==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(q,{control:c.control,name:"stdio_command",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.command")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.commandPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})}),t.jsx(q,{control:c.control,name:"stdio_args",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.arguments")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.argumentsPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:c.control,name:"stdio_cwd",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.workingDirectory")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.workingDirectoryPlaceholder"),...k,value:k.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(x==="NPX"||x==="STDIO")&&t.jsx(q,{control:c.control,name:"env_vars",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.environmentVariables")}),t.jsx(Y,{children:t.jsx(Xt,{value:k.value??[],onChange:k.onChange})}),t.jsx(Z,{})]})}),x!=="NPX"&&x!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(q,{control:c.control,name:"connection_url",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.url")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.urlPlaceholder"),...k,value:k.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),$(F))},onBlur:L=>{$(L.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(q,{control:c.control,name:"connection_token",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:w?.token?.label??o("orgs.connections.tokenOptional")}),t.jsx(Y,{children:t.jsx(se,{type:"password",placeholder:w?.token?.placeholder??o("orgs.connections.tokenPlaceholder"),...k,value:k.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:o("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:c.control,name:"title",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.name")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.namePlaceholder"),...k})}),t.jsx(Z,{})]})}),t.jsx(q,{control:c.control,name:"description",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.description")}),t.jsx(Y,{children:t.jsx(Ft,{placeholder:o("orgs.connections.descriptionPlaceholder"),rows:3,...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),G=M;return l?t.jsx(Nt,{open:G,onOpenChange:D,children:t.jsxs(Dt,{className:"max-h-[90vh]",children:[t.jsx(kt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Tt,{children:b}),t.jsx(wt,{className:"mt-1",children:N})]}),t.jsx(At,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":o("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:X}),t.jsx(It,{children:t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:U})})]})})]})}):t.jsx(Ve,{open:G,onOpenChange:D,children:t.jsxs(Ue,{className:"sm:max-w-[525px]",children:[t.jsxs(Oe,{children:[t.jsx(Me,{children:b}),t.jsx($e,{children:N})]}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:X}),t.jsxs(Fe,{children:[t.jsx(E,{type:"button",variant:"outline",onClick:()=>D(!1),children:o("orgs.connections.cancel")}),t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:U})]})]})})]})})})(),t.jsx(fe.Content,{children:t.jsx(fe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(fe.Title,{actions:V,children:o("orgs.connections.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(rt,{value:d.search,onChange:d.setSearch,placeholder:o("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:b=>{b.key==="Escape"&&(d.setSearch(""),b.target.blur())}}),t.jsx(lt,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:o("orgs.connections.sortName")},{id:"description",label:o("orgs.connections.sortDescription")},{id:"connection_type",label:o("orgs.connections.sortType")},{id:"updated_by",label:o("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:o("orgs.connections.sortUpdated")}],filters:[{label:o("orgs.connections.filterType"),value:a,onChange:b=>m(b||"ALL"),options:[{id:"ALL",label:o("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:o("orgs.connections.filterStatus"),value:f,onChange:b=>j(b||"ALL"),options:[{id:"ALL",label:o("orgs.connections.filterAll")},{id:"active",label:o("orgs.connections.filterActive")},{id:"inactive",label:o("orgs.connections.filterInactive")},{id:"error",label:o("orgs.connections.filterError")}]}]})]})}),t.jsx(at,{placement:"page",tabs:[{id:"all",label:o("orgs.connections.tabAll")},{id:"connected",label:o("orgs.connections.tabConnected")}],activeTab:p,onTabChange:b=>{const N=b;N!==p&&ee("connections_page_tab_changed",{to_tab:N}),g(N)}}),t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:y?.5:1,transition:y?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:y?"none":"auto"},children:t.jsx(yn,{listState:d,activeTab:p,typeFilter:a,statusFilter:f})})})]})})})]})})}function Vs(){const o=W.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(qe,{children:t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Cn,{})})}),o[0]=e):e=o[0],e}export{Vs as default};
1
+ import{r as z,c as W,b as te,j as t,B as E,h as ue,l as xe,G as ce,F as We,I as Xe,H as Ge,E as qe,X as ke,d as Te,u as Qe,a as we,R as Je,ad as Ce,U as Ye,V as Ze,at as et,as as tt,n as fe,q as ee,o as nt,a2 as st,t as R,K as ot}from"./index-DD17LdOo.js";import{a as Ae,g as it,e as ct}from"./extract-connection-data-C3og9nET.js";import{C as lt}from"./collection-display-button-C5weD_DC.js";import{S as rt}from"./search-input-BML3Kenk.js";import{C as at}from"./collection-tabs-B4z9WtuV.js";import{C as ve,u as Ie,g as dt}from"./connection-card-DBWNFKql.js";import{E as ut}from"./empty-state-BWACKPTq.js";import{u as gt,D as mt}from"./use-delete-connection-JYdb3g8I.js";import{u as pt}from"./use-infinite-scroll-D_h1bU_O.js";import{u as Pe}from"./use-mobile-dxqjeB9C.js";import{g as de}from"./connection-slug-CITJ0kGN.js";import{A as ft,a as ht,b as xt,c as jt,g as St,d as yt,e as Ct,f as vt}from"./alert-dialog-D39kK11B.js";import{n as je}from"./LinkBroken01-_oPW_2dj.js";import{g as bt,a as _t}from"./metadata-D72DunRR.js";import{d as Me,h as $e,c as Oe,e as Fe,b as Ue,D as Ve}from"./dialog-BDXg80r_.js";import{D as Nt,a as Dt,d as kt,b as Tt,e as wt,f as At,g as It}from"./drawer-DAp1D7F-.js";import{F as q,b as Q,c as J,d as Y,f as Z,a as Ne}from"./form-BQW41VGV.js";import{I as se}from"./input-BbeG6cTt.js";import{S as Pt,b as Mt,a as $t,d as Ot,c as ae}from"./select-CvaUVwrC.js";import{T as Ft}from"./textarea-C7A4jkvL.js";import{b as ze,u as Ut}from"./use-connection-BDIMmEql.js";import{m as Vt}from"./use-mcp-client-BwmV3MW8.js";import{b as zt}from"./repository-binding-CJ_pw95F.js";import{g as Lt}from"./types-l4l1-swZ.js";import{A as Et,bu as Bt,aw as Kt,bb as Ht,p as ye}from"./agent-icon-B_yyO4wu.js";import{s as Le}from"./Plus-MXLtMY7l.js";import{c as Rt}from"./UserSquare-DkdLf214.js";import{s as Ee}from"./XClose-oHtKIul6.js";import{s as Wt}from"./use-project-scope-BYZ6yY5x.js";import{i as he,a as De,E as Xt,c as Gt,p as qt,b as Qt,d as Jt}from"./connection-form-helpers-BwQZA_xH.js";import{a as Yt}from"./authenticate-and-persist-oauth-D4OxRuRh.js";import{I as Zt}from"./integration-icon-DNr48VB-.js";import{C as Be}from"./checkbox-Dzt92tI8.js";import{i as en}from"./DotsVertical-BkKYV-uH.js";import{s as Ke}from"./Image01-CUJhdG59.js";import{s as He}from"./Trash01-DEfHm1-C.js";import"./connection-B2m_fkQ_.js";import"./ArrowUp-CxGCH_mE.js";import"./Check-aE-8J-dx.js";import"./tooltip-Cyc9NKXJ.js";import"./index-Dsl1ukJt.js";import"./view-mode-toggle-C4wafyT7.js";import"./badge-E2auaQms.js";import"./SearchMd-D2iMNQwW.js";import"./useInfiniteQuery-CTTKOBfu.js";import"./infiniteQueryObserver-DjN6qwGN.js";import"./slugify-CEUa2lfQ.js";import"./X-BHK_66ka.js";import"./label-DeoZl-yW.js";import"./ChevronUp-Br5R9lTH.js";import"./auth-BII1ityf.js";import"./AlertCircle-DjoFdKqn.js";import"./Tool01-BgPGiYBJ.js";import"./ArrowLeft-DCPdaQBd.js";import"./ShoppingBag01-BUSIbN12.js";import"./ZoomOut-tzNSNsYS.js";import"./Building02-DQhkI7KU.js";import"./CheckCircle-Yu1WDdmS.js";import"./Copy01-CtLn8eQC.js";import"./CreditCard01-DARYnajC.js";import"./Palette-CI5-z0zm.js";import"./Key01-DA8aX6Mo.js";import"./Link01-PgFxgiYI.js";import"./LinkExternal01-Bzb2WBKu.js";import"./Monitor01-evoIPilr.js";import"./Sun-DaF8KN8m.js";import"./Upload01-AiwUaS84.js";import"./User01-BJjdpbkY.js";import"./Users01-DB-isk4t.js";import"./mcp-oauth-DRu55AOe.js";function tn(o){const e=`deco-filters-${o}`,[n,u]=z.useState(()=>{try{const i=globalThis.localStorage?.getItem(e);if(i)return JSON.parse(i)}catch(i){console.error("Failed to parse stored filters:",i)}return[]});return[n,i=>{u(i);try{globalThis.localStorage?.setItem(e,JSON.stringify(i))}catch(l){console.error("Failed to save filters:",l)}}]}function nn(o){const e=W.c(7),[n,u]=z.useState(o),[s,i]=z.useState(o?"desc":null);let l;e[0]!==s||e[1]!==n?(l=h=>{n!==h?(u(h),i("asc")):s==="asc"?i("desc"):s==="desc"&&(u(void 0),i(null))},e[0]=s,e[1]=n,e[2]=l):l=e[2];const r=l;let d;return e[3]!==r||e[4]!==s||e[5]!==n?(d={sortKey:n,sortDirection:s,handleSort:r},e[3]=r,e[4]=s,e[5]=n,e[6]=d):d=e[6],d}function sn(o,e){const n=W.c(12),u=e===void 0?"cards":e,s=Pe(),i=z.useRef(s),l=o?`deco-view-mode-${o}`:"deco-view-mode";let r;n[0]!==u||n[1]!==l?(r=()=>{const j=globalThis.localStorage?.getItem(l);return j==="cards"||j==="table"?j:u},n[0]=u,n[1]=l,n[2]=r):r=n[2];const[d,h]=z.useState(r);let p;n[3]!==l?(p=j=>{h(j),globalThis.localStorage?.setItem(l,j)},n[3]=l,n[4]=p):p=n[4];const g=p;let a,m;n[5]!==s||n[6]!==d?(a=()=>{!i.current&&s&&d==="table"&&h("cards"),i.current=s},m=[s,d],n[5]=s,n[6]=d,n[7]=a,n[8]=m):(a=n[7],m=n[8]),z.useEffect(a,m);let f;return n[9]!==g||n[10]!==d?(f=[d,g],n[9]=g,n[10]=d,n[11]=f):f=n[11],f}function on(o){const e=W.c(20),{namespace:n,resource:u,defaultSortKey:s,defaultViewMode:i}=o,l=s===void 0?"title":s,r=i===void 0?"table":i,[d,h]=z.useState(""),p=z.useDeferredValue(d),g=`${n}-${u}`,[a,m]=tn(g),f=`studio-${u}-filter-visible-${n}`;let j;e[0]!==f?(j=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=j):j=e[1];const[S,C]=z.useState(j);let y;e[2]!==f?(y=$=>{C($),globalThis.localStorage?.setItem(f,String($))},e[2]=f,e[3]=y):y=e[3];const c=y;let x;e[4]!==S||e[5]!==c?(x=()=>{c(!S)},e[4]=S,e[5]=c,e[6]=x):x=e[6];const A=x,[T,w]=sn(`studio-${u}-${n}`,r),{sortKey:M,sortDirection:I,handleSort:O}=nn(l),P=M;let D;return e[7]!==S||e[8]!==a||e[9]!==O||e[10]!==d||e[11]!==p||e[12]!==c||e[13]!==m||e[14]!==w||e[15]!==I||e[16]!==P||e[17]!==A||e[18]!==T?(D={search:d,searchTerm:p,setSearch:h,filters:a,setFilters:m,filterBarVisible:S,setFilterBarVisible:c,toggleFilterBar:A,viewMode:T,setViewMode:w,sortKey:P,sortDirection:I,handleSort:O},e[7]=S,e[8]=a,e[9]=O,e[10]=d,e[11]=p,e[12]=c,e[13]=m,e[14]=w,e[15]=I,e[16]=P,e[17]=A,e[18]=T,e[19]=D):D=e[19],D}function cn(o){const e=W.c(35),{open:n,onOpenChange:u,count:s,onConfirm:i}=o,l=te(),r=s===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==s||e[1]!==l||e[2]!==r?(d=l(r,{count:s}),e[0]=s,e[1]=l,e[2]=r,e[3]=d):d=e[3];let h;e[4]!==d?(h=t.jsx(ft,{children:d}),e[4]=d,e[5]=h):h=e[5];const p=s===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let g;e[6]!==l||e[7]!==p?(g=l(p),e[6]=l,e[7]=p,e[8]=g):g=e[8];let a;e[9]!==g?(a=t.jsx(ht,{children:g}),e[9]=g,e[10]=a):a=e[10];let m;e[11]!==h||e[12]!==a?(m=t.jsxs(xt,{children:[h,a]}),e[11]=h,e[12]=a,e[13]=m):m=e[13];let f;e[14]!==l?(f=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=f):f=e[15];let j;e[16]!==f?(j=t.jsx(jt,{children:f}),e[16]=f,e[17]=j):j=e[17];const S=s===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let C;e[18]!==s||e[19]!==l||e[20]!==S?(C=l(S,{count:s}),e[18]=s,e[19]=l,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==i||e[23]!==C?(y=t.jsx(St,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:C}),e[22]=i,e[23]=C,e[24]=y):y=e[24];let c;e[25]!==y||e[26]!==j?(c=t.jsxs(yt,{children:[j,y]}),e[25]=y,e[26]=j,e[27]=c):c=e[27];let x;e[28]!==c||e[29]!==m?(x=t.jsxs(Ct,{children:[m,c]}),e[28]=c,e[29]=m,e[30]=x):x=e[30];let A;return e[31]!==u||e[32]!==n||e[33]!==x?(A=t.jsx(vt,{open:n,onOpenChange:u,children:x}),e[31]=u,e[32]=n,e[33]=x,e[34]=A):A=e[34],A}function ln(o){const e=W.c(39),{item:n,canManage:u,allConnections:s,connectedAppNames:i,connectingItemId:l,onNavigateConnected:r,onConnect:d}=o,h=te();let p,g;e[0]!==i||e[1]!==n?(p=Ae(n)??"",g=i.has(p),e[0]=i,e[1]=n,e[2]=p,e[3]=g):(p=e[2],g=e[3]);const a=g;let m;e[4]!==n._meta?(m=bt(n._meta),e[4]=n._meta,e[5]=m):m=e[5];const f=m,j=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",S=n.server?.description||n.description||null;let C;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(C=n.server?.icons?.[0]?.src||_t(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=C):C=e[8];const y=C;let c;if(e[9]!==s||e[10]!==p){let V;e[12]!==p?(V=b=>b.connection_type!=="VIRTUAL"&&b.app_name===p,e[12]=p,e[13]=V):V=e[13],c=s.filter(V),e[9]=s,e[10]=p,e[11]=c}else c=e[11];const x=c,A=a||u;let T,w;e[14]!==x||e[15]!==a||e[16]!==n||e[17]!==d||e[18]!==r?(T=()=>{if(a){const V=x[0];V&&r(V);return}w()},w=()=>d(n),e[14]=x,e[15]=a,e[16]=n,e[17]=d,e[18]=r,e[19]=T,e[20]=w):(T=e[19],w=e[20]);let M;e[21]!==S||e[22]!==y||e[23]!==j?(M={title:j,description:S,icon:y},e[21]=S,e[22]=y,e[23]=j,e[24]=M):M=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(je,{}),e[25]=I):I=e[25];const O=A?T:void 0;let P;e[26]!==u||e[27]!==l||e[28]!==w||e[29]!==a||e[30]!==n.id||e[31]!==h?(P=a?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:h("orgs.catalogItemCard.connected")}):u&&t.jsx(E,{variant:"outline",size:"sm",className:"h-7 px-3 text-sm font-medium",disabled:l!==null,onClick:V=>{V.stopPropagation(),w()},children:l===n.id?t.jsx(ue,{className:"size-3.5"}):h("orgs.catalogItemCard.connect")}),e[26]=u,e[27]=l,e[28]=w,e[29]=a,e[30]=n.id,e[31]=h,e[32]=P):P=e[32];let D;e[33]!==P?(D=t.jsx("div",{className:"flex items-center gap-2",children:P}),e[33]=P,e[34]=D):D=e[34];let $;return e[35]!==M||e[36]!==O||e[37]!==D?($=t.jsx(ve,{connection:M,fallbackIcon:I,onClick:O,headerActionsAlwaysVisible:!0,headerActions:D}),e[35]=M,e[36]=O,e[37]=D,e[38]=$):$=e[38],$}function rn(o){return o?.length?{appToolName:o.find(n=>!!Lt(n._meta))?.name??null}:null}const an=3;function dn(o){const e=new Map;for(const n of o)for(const u of n.connections??[]){const s=e.get(u.connection_id)??[];s.push(n),e.set(u.connection_id,s)}return e}function un(o){const e=W.c(25),{projects:n}=o,u=te();if(n.length===0){let m;e[0]!==u?(m=u("projects.connections.orgWide"),e[0]=u,e[1]=m):m=e[1];let f;return e[2]!==m?(f=t.jsx("span",{className:"text-xs text-muted-foreground",children:m}),e[2]=m,e[3]=f):f=e[3],f}let s,i,l,r;if(e[4]!==n){const m=n.slice(0,an);s=n.length-m.length,r="flex min-w-0 items-center gap-2",i="flex shrink-0 -space-x-1.5",l=m.map(gn),e[4]=n,e[5]=s,e[6]=i,e[7]=l,e[8]=r}else s=e[5],i=e[6],l=e[7],r=e[8];let d;e[9]!==i||e[10]!==l?(d=t.jsx("div",{className:i,children:l}),e[9]=i,e[10]=l,e[11]=d):d=e[11];let h;e[12]!==n[0]?.title||e[13]!==n.length||e[14]!==u?(h=n.length===1?n[0]?.title:u("projects.connections.usedBy",{count:n.length}),e[12]=n[0]?.title,e[13]=n.length,e[14]=u,e[15]=h):h=e[15];let p;e[16]!==h?(p=t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:h}),e[16]=h,e[17]=p):p=e[17];let g;e[18]!==s?(g=s>0&&t.jsx("span",{className:"sr-only",children:s}),e[18]=s,e[19]=g):g=e[19];let a;return e[20]!==r||e[21]!==d||e[22]!==p||e[23]!==g?(a=t.jsxs("div",{className:r,children:[d,p,g]}),e[20]=r,e[21]=d,e[22]=p,e[23]=g,e[24]=a):a=e[24],a}function gn(o){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:o.title,children:t.jsx(Et,{icon:o.icon,name:o.title,size:"xs"})},o.id)}function Re(o){const e=W.c(8),{selectionMode:n,children:u}=o,s=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let i;e[0]!==s?(i=xe("overflow-hidden transition-all duration-150 ease-out",s),e[0]=s,e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(We,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:pn,children:t.jsx(en,{size:20})})}),e[2]=l):l=e[2];let r;e[3]!==u?(r=t.jsxs(Xe,{children:[l,t.jsx(Ge,{align:"end",onClick:mn,children:u})]}),e[3]=u,e[4]=r):r=e[4];let d;return e[5]!==i||e[6]!==r?(d=t.jsx("div",{className:i,children:r}),e[5]=i,e[6]=r,e[7]=d):d=e[7],d}function mn(o){return o.stopPropagation()}function pn(o){return o.stopPropagation()}function fn(o){const e=W.c(57),{group:n,onOpen:u,selectionMode:s,selectedIds:i,onToggleSelect:l}=o,r=te();let d;if(e[0]!==n.connections||e[1]!==i){let N;e[3]!==i?(N=U=>i.has(U.id),e[3]=i,e[4]=N):N=e[4],d=n.connections.every(N),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const h=d;let p;if(e[5]!==n.connections||e[6]!==i){let N;e[8]!==i?(N=U=>i.has(U.id),e[8]=i,e[9]=N):N=e[9],p=n.connections.some(N),e[5]=n.connections,e[6]=i,e[7]=p}else p=e[7];const g=p;let a;e[10]!==h||e[11]!==n.connections||e[12]!==l||e[13]!==i?(a=()=>{for(const N of n.connections)h?i.has(N.id)&&l(N.id):i.has(N.id)||l(N.id)},e[10]=h,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=a):a=e[14];const m=a,f=n.title,j=n.icon;let S;e[15]!==n.connections.length||e[16]!==r?(S=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=S):S=e[17];let C;e[18]!==n.icon||e[19]!==n.title||e[20]!==S?(C={title:f,icon:j,description:S},e[18]=n.icon,e[19]=n.title,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==u||e[23]!==s||e[24]!==m?(y=()=>s?m():u(),e[22]=u,e[23]=s,e[24]=m,e[25]=y):y=e[25];const c=s&&h&&"ring-2 ring-primary",x=s&&g&&!h&&"ring-1 ring-primary/50";let A;e[26]!==x||e[27]!==c?(A=xe(c,x),e[26]=x,e[27]=c,e[28]=A):A=e[28];const T=s?h?!0:g&&"mixed":void 0;let w;e[29]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(je,{}),e[29]=w):w=e[29];let M;e[30]!==h||e[31]!==n.connections.length||e[32]!==s||e[33]!==g||e[34]!==r||e[35]!==m?(M=s?t.jsx(Be,{checked:h?!0:g?"indeterminate":!1,onCheckedChange:m}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:r("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=h,e[31]=n.connections.length,e[32]=s,e[33]=g,e[34]=r,e[35]=m,e[36]=M):M=e[36];let I;e[37]!==u?(I=N=>{N.stopPropagation(),u()},e[37]=u,e[38]=I):I=e[38];let O;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Ke,{size:16}),e[39]=O):O=e[39];let P;e[40]!==r?(P=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=P):P=e[41];let D;e[42]!==I||e[43]!==P?(D=t.jsxs(ce,{onClick:I,children:[O,P]}),e[42]=I,e[43]=P,e[44]=D):D=e[44];let $;e[45]!==s||e[46]!==D?($=t.jsx(Re,{selectionMode:s,children:D}),e[45]=s,e[46]=D,e[47]=$):$=e[47];let V;e[48]!==M||e[49]!==$?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[M,$]}),e[48]=M,e[49]=$,e[50]=V):V=e[50];let b;return e[51]!==A||e[52]!==T||e[53]!==V||e[54]!==C||e[55]!==y?(b=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:C,onClick:y,className:A,selected:T,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:V})}),e[51]=A,e[52]=T,e[53]=V,e[54]=C,e[55]=y,e[56]=b):b=e[56],b}function hn(o){const e=W.c(36),{connection:n,isSelected:u,selectionMode:s,canManage:i,canManageAgents:l,onToggleSelect:r,onOpen:d,onToggleStatus:h,onDelete:p}=o,g=te();let a;e[0]!==u||e[1]!==r||e[2]!==s||e[3]!==g?(a=s?t.jsx(Be,{checked:u,onCheckedChange:r,onClick:xn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:g("orgs.connectionSelectionUi.connected")}),e[0]=u,e[1]=r,e[2]=s,e[3]=g,e[4]=a):a=e[4];let m;e[5]!==d?(m=T=>{T.stopPropagation(),d()},e[5]=d,e[6]=m):m=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ke,{size:16}),e[7]=f):f=e[7];let j;e[8]!==g?(j=g("orgs.connectionSelectionUi.open"),e[8]=g,e[9]=j):j=e[9];let S;e[10]!==m||e[11]!==j?(S=t.jsxs(ce,{onClick:m,children:[f,j]}),e[10]=m,e[11]=j,e[12]=S):S=e[12];let C;e[13]!==i||e[14]!==l||e[15]!==r||e[16]!==g?(C=(i||l)&&t.jsxs(ce,{onClick:T=>{T.stopPropagation(),r()},children:[t.jsx(Bt,{size:16}),g("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=r,e[16]=g,e[17]=C):C=e[17];let y;e[18]!==i||e[19]!==n||e[20]!==h||e[21]!==g?(y=i&&(n.status==="active"?t.jsxs(ce,{onClick:T=>{T.stopPropagation(),h("inactive")},children:[t.jsx(Kt,{size:16}),g("orgs.connectionSelectionUi.disable")]}):t.jsxs(ce,{onClick:T=>{T.stopPropagation(),h("active")},children:[t.jsx(Ht,{size:16}),g("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=h,e[21]=g,e[22]=y):y=e[22];let c;e[23]!==i||e[24]!==p||e[25]!==g?(c=i&&t.jsxs(ce,{variant:"destructive",onClick:T=>{T.stopPropagation(),p()},children:[t.jsx(He,{size:16}),g("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=p,e[25]=g,e[26]=c):c=e[26];let x;e[27]!==s||e[28]!==S||e[29]!==C||e[30]!==y||e[31]!==c?(x=t.jsxs(Re,{selectionMode:s,children:[S,C,y,c]}),e[27]=s,e[28]=S,e[29]=C,e[30]=y,e[31]=c,e[32]=x):x=e[32];let A;return e[33]!==a||e[34]!==x?(A=t.jsxs("div",{className:"flex items-center gap-1",children:[a,x]}),e[33]=a,e[34]=x,e[35]=A):A=e[35],A}function xn(o){return o.stopPropagation()}function jn(o){const e=W.c(29),{count:n,total:u,canManage:s,canManageAgents:i,onSelectAll:l,onDeselectAll:r,onDelete:d,onAddToAgent:h,onToggleStatus:p,onCancel:g}=o,a=te();if(n===0)return null;let m;e[0]!==n||e[1]!==a?(m=a("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=a,e[2]=m):m=e[2];let f;e[3]!==m?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:m}),e[3]=m,e[4]=f):f=e[4];let j;e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==a||e[9]!==u?(j=n<u?t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:a("orgs.connectionSelectionUi.selectAll",{total:u})}):t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:a("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=l,e[8]=a,e[9]=u,e[10]=j):j=e[10];let S;e[11]!==i||e[12]!==h||e[13]!==a?(S=i&&t.jsxs(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:[t.jsx(Le,{size:13}),a("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=h,e[13]=a,e[14]=S):S=e[14];let C;e[15]!==s||e[16]!==d||e[17]!==p||e[18]!==a?(C=s&&t.jsxs(t.Fragment,{children:[t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>p("active"),children:a("orgs.connectionSelectionUi.enable")}),t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>p("inactive"),children:a("orgs.connectionSelectionUi.disable")}),t.jsxs(E,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(He,{size:13}),a("orgs.connectionSelectionUi.delete")]})]}),e[15]=s,e[16]=d,e[17]=p,e[18]=a,e[19]=C):C=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ee,{size:13}),e[20]=y):y=e[20];let c;e[21]!==g?(c=t.jsx(E,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:y}),e[21]=g,e[22]=c):c=e[22];let x;return e[23]!==f||e[24]!==j||e[25]!==S||e[26]!==C||e[27]!==c?(x=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[f,j,S,C,c]})}),e[23]=f,e[24]=j,e[25]=S,e[26]=C,e[27]=c,e[28]=x):x=e[28],x}function Sn(o){const e=W.c(47),{open:n,onOpenChange:u,agents:s,onConfirm:i}=o,l=te(),[r,d]=z.useState(null);let h;e[0]!==u?(h=D=>{D||d(null),u(D)},e[0]=u,e[1]=h):h=e[1];const p=h;let g;e[2]!==l?(g=l("orgs.connectionSelectionUi.addToAgentTitle"),e[2]=l,e[3]=g):g=e[3];let a;e[4]!==g?(a=t.jsx(Me,{children:g}),e[4]=g,e[5]=a):a=e[5];let m;e[6]!==l?(m=l("orgs.connectionSelectionUi.addToAgentDescription"),e[6]=l,e[7]=m):m=e[7];let f;e[8]!==m?(f=t.jsx($e,{children:m}),e[8]=m,e[9]=f):f=e[9];let j;e[10]!==a||e[11]!==f?(j=t.jsxs(Oe,{children:[a,f]}),e[10]=a,e[11]=f,e[12]=j):j=e[12];let S;e[13]!==s||e[14]!==r||e[15]!==l?(S=s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):s.map(D=>t.jsxs("button",{type:"button",onClick:()=>d(D.id),className:xe("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",r===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Zt,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[13]=s,e[14]=r,e[15]=l,e[16]=S):S=e[16];let C;e[17]!==S?(C=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:S}),e[17]=S,e[18]=C):C=e[18];let y;e[19]!==p?(y=()=>p(!1),e[19]=p,e[20]=y):y=e[20];let c;e[21]!==l?(c=l("orgs.connectionSelectionUi.cancel"),e[21]=l,e[22]=c):c=e[22];let x;e[23]!==c||e[24]!==y?(x=t.jsx(E,{variant:"outline",onClick:y,children:c}),e[23]=c,e[24]=y,e[25]=x):x=e[25];const A=!r;let T;e[26]!==p||e[27]!==i||e[28]!==r?(T=()=>{r&&(i(r),p(!1))},e[26]=p,e[27]=i,e[28]=r,e[29]=T):T=e[29];let w;e[30]!==l?(w=l("orgs.connectionSelectionUi.add"),e[30]=l,e[31]=w):w=e[31];let M;e[32]!==A||e[33]!==T||e[34]!==w?(M=t.jsx(E,{disabled:A,onClick:T,children:w}),e[32]=A,e[33]=T,e[34]=w,e[35]=M):M=e[35];let I;e[36]!==x||e[37]!==M?(I=t.jsxs(Fe,{children:[x,M]}),e[36]=x,e[37]=M,e[38]=I):I=e[38];let O;e[39]!==I||e[40]!==j||e[41]!==C?(O=t.jsxs(Ue,{className:"sm:max-w-[400px]",children:[j,C,I]}),e[39]=I,e[40]=j,e[41]=C,e[42]=O):O=e[42];let P;return e[43]!==p||e[44]!==n||e[45]!==O?(P=t.jsx(Ve,{open:n,onOpenChange:p,children:O}),e[43]=p,e[44]=n,e[45]=O,e[46]=P):P=e[46],P}function yn({listState:o,activeTab:e,typeFilter:n,statusFilter:u}){const s=te(),{org:i}=ke(),l=nt(),r=Te(),{data:d}=we.useSession(),h=ze(),p=Ut(o),g=gt(),{granted:a}=Ce("connections:manage"),{granted:m}=Ce("agents:manage"),[f,j]=z.useState(new Set),S=f.size>0,[C,y]=z.useState(!1),[c,x]=z.useState(!1),[A,T]=z.useState(null),w=zt(),M=dn(Wt(w)),I=p.filter(_=>!(n!=="ALL"&&_.connection_type!==n||u!=="ALL"&&_.status!==u)),O=dt(I),P=_=>{j(v=>{const B=new Set(v);return B.has(_)?B.delete(_):B.add(_),B})},D=()=>{j(new Set)},$=Ie(o.searchTerm),V=$.items,b=pt($.loadMore,$.hasMore,$.isLoadingMore),N=new Set(p.filter(_=>_.app_name).map(_=>_.app_name)),U=o.search.length>0,X=e==="all"||U?V.filter(_=>{if(U){const v=Ae(_);if(v&&N.has(v))return!1}return!0}):[],G=e==="connected"||U?O:[],k=async _=>{if(!(!i||!d?.user?.id)){ee("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),T(_.id);try{const v=ct(_,i.id,d.user.id,{remoteIndex:0}),B=v.connection_type==="STDIO",H=!!v.connection_url,K=B&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!H&&!K){R.error(s("orgs.connections.cannotConnectNoMethod")),T(null);return}const oe=await h.create.mutateAsync(v),{id:ie}=oe,le=await Yt({connectionId:ie,orgId:i.id,orgSlug:i.slug,persistFallback:re=>h.update.mutateAsync({id:ie,data:{connection_token:re}}).then(()=>{})});if(le.ran&&!le.ok){ee("connection_oauth_failed",{connection_id:ie,flow:"connections_page_connect",error:le.error??"no_token"}),R.error(s("orgs.connections.authenticationFailed",{error:le.error??"no token received"}));return}if(le.ran){ee("connection_oauth_succeeded",{connection_id:ie,flow:"connections_page_connect"});const re=new URL(`/api/${i.slug}/mcp/${ie}`,window.location.origin);await l.invalidateQueries({queryKey:ot.isMCPAuthenticated(re.href,null)}),F(),R.success(s("orgs.connections.authenticationSuccessful"))}let pe=null;try{const re=await l.fetchQuery(Vt({connectionId:ie,orgId:i.id,orgSlug:i.slug}));pe=rn((await re.listTools()).tools)}catch{}const be=de(oe),_e=pe?pe.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(pe.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:be}}:null;R.success(s("orgs.connections.connectedSuccessfully"),_e?{action:{label:s("orgs.connections.openConnection"),onClick:()=>r(_e)}}:void 0)}catch(v){R.error(s("orgs.connections.failedToConnect",{error:v instanceof Error?v.message:String(v)}))}finally{T(null)}}},L=st(),F=()=>{l.invalidateQueries({predicate:_=>{const v=_.queryKey;return v[1]===i.id&&v[3]==="collection"&&v[4]==="CONNECTIONS"}})},ge=async()=>{y(!1);const _=[...f];ee("connections_bulk_delete",{count:_.length});const B=(await Promise.allSettled(_.map(H=>L.call("COLLECTION_CONNECTIONS_DELETE",{id:H,force:!0})))).filter(H=>H.status==="fulfilled").length;F(),R.success(s("orgs.connections.deletedConnections",{count:B})),D()},Se=async(_,v)=>{try{await h.update.mutateAsync({id:_,data:{status:v}}),F(),R.success(s(v==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(s("orgs.connections.failedToUpdateConnection"))}},me=async _=>{const v=[...f];ee("connections_bulk_status_toggled",{count:v.length,to_status:_});const H=(await Promise.allSettled(v.map(K=>h.update.mutateAsync({id:K,data:{status:_}})))).filter(K=>K.status==="fulfilled").length;F(),R.success(_==="active"?s("orgs.connections.enabledConnections",{count:H}):s("orgs.connections.disabledConnections",{count:H})),D()},ne=async _=>{const v=w.find(K=>K.id===_);if(!v)return;ee("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const B=new Set(v.connections.map(K=>K.connection_id)),H=[...f].filter(K=>!B.has(K)).map(K=>({connection_id:K,selected_tools:null,selected_resources:null,selected_prompts:null}));if(H.length===0){R.info(s("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await L.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...v.connections,...H]}}),l.invalidateQueries({predicate:K=>{const oe=K.queryKey;return oe[1]===i.id&&oe[3]==="collection"&&oe[4]==="VIRTUAL_MCP"}}),R.success(s("orgs.connections.addedConnectionsToAgent",{count:H.length,agentTitle:v.title})),D()}catch{R.error(s("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(mt,{...g}),t.jsx(cn,{open:C,onOpenChange:y,count:f.size,onConfirm:ge}),t.jsx(Sn,{open:c,onOpenChange:x,agents:w,onConfirm:ne}),$.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(U?X.length===0&&I.length===0:e==="all"?X.length===0:I.length===0)?t.jsx(ut,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:s("orgs.connections.noConnectionsFound"),description:o.search?s("orgs.connections.noConnectionsMatchSearch",{search:o.search}):s(a?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[G.map(_=>{if(_.type==="group")return t.jsx(fn,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:_.key}})},selectionMode:S,selectedIds:f,onToggleSelect:P},_.key);const v=_.connection,B=f.has(v.id);return t.jsx(ve,{connection:v,fallbackIcon:t.jsx(je,{}),onClick:()=>S?P(v.id):r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:de(v)}}),className:xe(B&&"ring-2 ring-primary bg-primary/5"),selected:S?B:void 0,footer:t.jsx(un,{projects:M.get(v.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(hn,{connection:v,isSelected:B,selectionMode:S,canManage:a,canManageAgents:m,onToggleSelect:()=>P(v.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:de(v)}}),onToggleStatus:H=>Se(v.id,H),onDelete:()=>g.requestDelete(v)})},v.id)}),X.map(_=>t.jsx(ln,{item:_,canManage:a,allConnections:p,connectedAppNames:N,connectingItemId:A,onNavigateConnected:v=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:de(v)}}),onConnect:k},_.id)),(e==="all"||U)&&t.jsx("div",{ref:b,className:"col-span-full h-4"}),(e==="all"||U)&&$.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ue,{className:"size-6 text-muted-foreground"})})]})}),S&&t.jsx(jn,{count:f.size,total:I.length,canManage:a,canManageAgents:m,onSelectAll:()=>{j(new Set(I.map(_=>_.id)))},onDeselectAll:()=>j(new Set),onDelete:()=>y(!0),onAddToAgent:()=>x(!0),onToggleStatus:me,onCancel:D})]})}function Cn(){const o=te(),{org:e}=ke(),n=Te(),u=Qe({strict:!1}),{data:s}=we.useSession(),{stdioEnabled:i}=Je(),l=Pe(),{granted:r}=Ce("connections:manage"),d=on({namespace:e.slug,resource:"connections"}),h=ze(),[p,g]=Ye(Ze.connectionsTab(e.slug),b=>u.tab==="all"||u.tab==="connected"?u.tab:b??"all"),[a,m]=z.useState("ALL"),[f,j]=z.useState("ALL"),C=Ie(d.searchTerm).items,y=d.search!==d.searchTerm,c=et({resolver:tt(Gt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),x=c.watch("ui_type"),A=c.watch("connection_url"),T=c.watch("npx_package"),w=he({uiType:x,connectionUrl:A??"",npxPackage:T??""})??De({uiType:x,connectionUrl:A??"",registryItems:C}),M=r&&u.action==="create",I=()=>{ee("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},O=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},P=async b=>{let N,U=null,X=null,G=null;b.ui_type==="NPX"?(N="STDIO",U="",G=Qt(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(N="STDIO",U="",G=Jt(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(N=b.ui_type,U=b.connection_url||"",X=b.connection_token||null);const k=it("conn");ee("connection_custom_created",{connection_type:N,ui_type:b.ui_type}),await h.create.mutateAsync({id:k,title:b.title,description:b.description||null,connection_type:N,connection_url:U,connection_token:X,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:s?.user?.id||"system",organization_id:e.id,icon:b.icon??null,app_name:null,app_id:null,connection_headers:G,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null}),O(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:de({app_name:null,connection_url:U,title:b.title,id:k})}})},D=b=>{b||(M&&O(),c.reset())},$=b=>{const N=b.trim();if(!N)return;const U=!!c.formState.dirtyFields.title,X=!!c.formState.dirtyFields.description,G=!!c.formState.dirtyFields.env_vars,k=F=>{if(F&&(!U&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!X&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!G&&F.envVarKeys?.length)){const ge=c.getValues("env_vars")??[],Se=new Set(ge.map(ne=>ne.key)),me=F.envVarKeys.filter(ne=>!Se.has(ne));me.length>0&&c.setValue("env_vars",[...ge,...me.map(ne=>({key:ne,value:""}))],{shouldDirty:!0})}},L=qt(N);if(L&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",L.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),k(he({uiType:"NPX",npxPackage:L.packageName}));return}if(N.startsWith("http://")||N.startsWith("https://")){const F=x==="HTTP"||x==="SSE"||x==="Websocket"?x:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",N,{shouldDirty:!0}),k(he({uiType:F,connectionUrl:N})??De({uiType:F,connectionUrl:N,registryItems:C}));return}x==="NPX"&&k(he({uiType:"NPX",npxPackage:N}))},V=r?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(E,{size:"sm",variant:"default",onClick:I,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:o("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(fe,{children:[(()=>{const b=o("orgs.connections.createConnection"),N=o("orgs.connections.createConnectionDescription"),U=c.formState.isSubmitting?o("orgs.connections.saving"):o("orgs.connections.createConnection"),X=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(q,{control:c.control,name:"ui_type",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.type")}),t.jsxs(Pt,{value:k.value,onValueChange:k.onChange,children:[t.jsx(Y,{children:t.jsx(Mt,{children:t.jsx($t,{})})}),t.jsxs(Ot,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"Websocket"]})}),i&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),o("orgs.connections.npxPackage")]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Rt,{className:"w-4 h-4"}),o("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),x==="NPX"&&t.jsx(q,{control:c.control,name:"npx_package",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.npmPackage")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.npmPackagePlaceholder"),...k,value:k.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),$(F))},onBlur:L=>{$(L.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),x==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(q,{control:c.control,name:"stdio_command",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.command")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.commandPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})}),t.jsx(q,{control:c.control,name:"stdio_args",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.arguments")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.argumentsPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:c.control,name:"stdio_cwd",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.workingDirectory")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.workingDirectoryPlaceholder"),...k,value:k.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(x==="NPX"||x==="STDIO")&&t.jsx(q,{control:c.control,name:"env_vars",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.environmentVariables")}),t.jsx(Y,{children:t.jsx(Xt,{value:k.value??[],onChange:k.onChange})}),t.jsx(Z,{})]})}),x!=="NPX"&&x!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(q,{control:c.control,name:"connection_url",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.url")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.urlPlaceholder"),...k,value:k.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),$(F))},onBlur:L=>{$(L.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(q,{control:c.control,name:"connection_token",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:w?.token?.label??o("orgs.connections.tokenOptional")}),t.jsx(Y,{children:t.jsx(se,{type:"password",placeholder:w?.token?.placeholder??o("orgs.connections.tokenPlaceholder"),...k,value:k.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:o("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:c.control,name:"title",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.name")}),t.jsx(Y,{children:t.jsx(se,{placeholder:o("orgs.connections.namePlaceholder"),...k})}),t.jsx(Z,{})]})}),t.jsx(q,{control:c.control,name:"description",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:o("orgs.connections.description")}),t.jsx(Y,{children:t.jsx(Ft,{placeholder:o("orgs.connections.descriptionPlaceholder"),rows:3,...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),G=M;return l?t.jsx(Nt,{open:G,onOpenChange:D,children:t.jsxs(Dt,{className:"max-h-[90vh]",children:[t.jsx(kt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Tt,{children:b}),t.jsx(wt,{className:"mt-1",children:N})]}),t.jsx(At,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":o("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:X}),t.jsx(It,{children:t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:U})})]})})]})}):t.jsx(Ve,{open:G,onOpenChange:D,children:t.jsxs(Ue,{className:"sm:max-w-[525px]",children:[t.jsxs(Oe,{children:[t.jsx(Me,{children:b}),t.jsx($e,{children:N})]}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:X}),t.jsxs(Fe,{children:[t.jsx(E,{type:"button",variant:"outline",onClick:()=>D(!1),children:o("orgs.connections.cancel")}),t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:U})]})]})})]})})})(),t.jsx(fe.Content,{children:t.jsx(fe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(fe.Title,{actions:V,children:o("orgs.connections.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(rt,{value:d.search,onChange:d.setSearch,placeholder:o("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:b=>{b.key==="Escape"&&(d.setSearch(""),b.target.blur())}}),t.jsx(lt,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:o("orgs.connections.sortName")},{id:"description",label:o("orgs.connections.sortDescription")},{id:"connection_type",label:o("orgs.connections.sortType")},{id:"updated_by",label:o("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:o("orgs.connections.sortUpdated")}],filters:[{label:o("orgs.connections.filterType"),value:a,onChange:b=>m(b||"ALL"),options:[{id:"ALL",label:o("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:o("orgs.connections.filterStatus"),value:f,onChange:b=>j(b||"ALL"),options:[{id:"ALL",label:o("orgs.connections.filterAll")},{id:"active",label:o("orgs.connections.filterActive")},{id:"inactive",label:o("orgs.connections.filterInactive")},{id:"error",label:o("orgs.connections.filterError")}]}]})]})}),t.jsx(at,{placement:"page",tabs:[{id:"all",label:o("orgs.connections.tabAll")},{id:"connected",label:o("orgs.connections.tabConnected")}],activeTab:p,onTabChange:b=>{const N=b;N!==p&&ee("connections_page_tab_changed",{to_tab:N}),g(N)}}),t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:y?.5:1,transition:y?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:y?"none":"auto"},children:t.jsx(yn,{listState:d,activeTab:p,typeFilter:a,statusFilter:f})})})]})})})]})})}function Vs(){const o=W.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(qe,{children:t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Cn,{})})}),o[0]=e):e=o[0],e}export{Vs as default};