decocms 4.429.5 → 4.429.6
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.
- package/dist/client/assets/{AlertCircle-CXwWyjWL.js → AlertCircle-B1Wz6L5U.js} +1 -1
- package/dist/client/assets/{AreaChart-CWnwFPGD.js → AreaChart-D8eDFA25.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DYnQbYxF.js → ArrowLeft-CecRcRxr.js} +1 -1
- package/dist/client/assets/{ArrowRight-C4e8QGnK.js → ArrowRight-BSlT04qT.js} +1 -1
- package/dist/client/assets/{ArrowUp-BiYv-XbK.js → ArrowUp-uu6L0oZa.js} +1 -1
- package/dist/client/assets/{CartesianChart-BGE8uJq6.js → CartesianChart-Cye2mySB.js} +1 -1
- package/dist/client/assets/{Check-C8M8v3vI.js → Check-BiHadeJU.js} +1 -1
- package/dist/client/assets/{CheckCircle-jESFBkr7.js → CheckCircle-BbTEzozp.js} +1 -1
- package/dist/client/assets/{ChevronUp-Q2TBgNib.js → ChevronUp-DMzxjk9Q.js} +1 -1
- package/dist/client/assets/{Copy01-CaF9W1F_.js → Copy01-Z8h17W5V.js} +1 -1
- package/dist/client/assets/{CreditCard01-Czi8bh9o.js → CreditCard01-BOXpMyZX.js} +1 -1
- package/dist/client/assets/{DotsVertical-DyDeVQCx.js → DotsVertical-BcY1zCnO.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-D4BkOvp5.js → ErrorBarContext-oZYgKRc9.js} +1 -1
- package/dist/client/assets/{Image01-CsDdVFAJ.js → Image01-BtlBqgq2.js} +1 -1
- package/dist/client/assets/{Key01-D2FR3CbZ.js → Key01-Crwm5tIn.js} +1 -1
- package/dist/client/assets/{Line-BfgHJMc3.js → Line-B6p_BSMr.js} +1 -1
- package/dist/client/assets/{Link01-NjQr5iwv.js → Link01-BCM1zE5K.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CR1925bA.js → LinkExternal01-BSjbzGPT.js} +1 -1
- package/dist/client/assets/{Monitor01-50nhII2F.js → Monitor01-Bu9itRvW.js} +1 -1
- package/dist/client/assets/{Palette-AyH3xXYO.js → Palette-Dfwz_KK_.js} +1 -1
- package/dist/client/assets/{Plus-DP7AHtKt.js → Plus-DWABMn2e.js} +1 -1
- package/dist/client/assets/{SearchMd-D_KPqWqZ.js → SearchMd-df6Y7iRV.js} +1 -1
- package/dist/client/assets/{Sector-BR7_Ijx1.js → Sector-DyaoP-4v.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-Dq4UD5Hm.js → ShoppingBag01-BzDsEvOc.js} +1 -1
- package/dist/client/assets/{Sun-oSoDHq1v.js → Sun-CuJDC_V5.js} +1 -1
- package/dist/client/assets/{Tool01-D2y7RTX1.js → Tool01-CXZVYCJV.js} +1 -1
- package/dist/client/assets/{Trash01-64yehlfB.js → Trash01-CZPHTYfi.js} +1 -1
- package/dist/client/assets/{Upload01-BvgQ3r-o.js → Upload01-BhUTj6_2.js} +1 -1
- package/dist/client/assets/{User01-CU3qbr5s.js → User01-BKQ4XDsb.js} +1 -1
- package/dist/client/assets/{UserSquare-nGw6lX43.js → UserSquare-C-IZAmnp.js} +1 -1
- package/dist/client/assets/{Users01-Lf2fvOej.js → Users01-NFbjkK3Z.js} +1 -1
- package/dist/client/assets/{X-NPE_cXRR.js → X-Df5KdWXB.js} +1 -1
- package/dist/client/assets/{XAxis-Drv4sXya.js → XAxis-BWQmNFV9.js} +1 -1
- package/dist/client/assets/{XClose-CMTvfCel.js → XClose-CigTCF4N.js} +1 -1
- package/dist/client/assets/{ZoomOut-xQj4oorm.js → ZoomOut-CrIY1x34.js} +1 -1
- package/dist/client/assets/{access-gate-DRBSlBtJ.js → access-gate-g9Q7ZgEZ.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-DHl4H43e.js → add-connection-dialog-7hGrBECA.js} +1 -1
- package/dist/client/assets/{agent-analytics-RDv7d0ta.js → agent-analytics-CObXpehp.js} +1 -1
- package/dist/client/assets/agent-app-k1_oJSpu.js +1 -0
- package/dist/client/assets/{agent-assets-QMTortLS.js → agent-assets-DO3tmGuX.js} +1 -1
- package/dist/client/assets/{agent-automation-kP7qIZSD.js → agent-automation-Ca1RFwdU.js} +1 -1
- package/dist/client/assets/{agent-automations-D5AIE6G6.js → agent-automations-CI9pfVCT.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-1UnRN6mW.js → agent-connect-sources-BuV_ZR1a.js} +1 -1
- package/dist/client/assets/agent-deck-CehM6vXp.js +1 -0
- package/dist/client/assets/{agent-e2e-DEc1NtfK.js → agent-e2e-CgIUjw8G.js} +1 -1
- package/dist/client/assets/{agent-experiments-D33dFCpI.js → agent-experiments-mi6BfJqy.js} +1 -1
- package/dist/client/assets/{agent-file-DxlwynYZ.js → agent-file-CGvjjvWl.js} +1 -1
- package/dist/client/assets/{agent-git-DVn4DsKt.js → agent-git-C25O_twU.js} +1 -1
- package/dist/client/assets/{agent-hosting-CgiR8Ql4.js → agent-hosting-C72vq_5m.js} +1 -1
- package/dist/client/assets/{agent-icon-TQUkqPJj.js → agent-icon-B241PBKK.js} +1 -1
- package/dist/client/assets/agent-library-BumAmLT2.js +1 -0
- package/dist/client/assets/agent-library-file-BnaSVA1s.js +1 -0
- package/dist/client/assets/{agent-monitor-DgcF05B9.js → agent-monitor-D6-3fGpu.js} +1 -1
- package/dist/client/assets/{agent-overview-dLl0w1eM.js → agent-overview-D3iRbnu8.js} +1 -1
- package/dist/client/assets/agent-settings-BGVwjdf6.js +1 -0
- package/dist/client/assets/{agent-site-editor-ITnkleU1.js → agent-site-editor-Bv4G1Ou2.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-B8dBeNBF.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-CNFJoRJD.js → agent-site-editor-content-SBwYc5Sx.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-CNLkTYYB.js → agent-site-editor-preview-GCIpof6D.js} +3 -3
- package/dist/client/assets/agent-view-BxYubinM.js +1 -0
- package/dist/client/assets/{agent-view-guard-BbHyaShN.js → agent-view-guard-yCCS9tda.js} +1 -1
- package/dist/client/assets/{agents-list-D9hihWFU.js → agents-list-D9Qqbumt.js} +1 -1
- package/dist/client/assets/{ai-providers-oyOl9W3y.js → ai-providers-BRF8Kdv0.js} +1 -1
- package/dist/client/assets/{alert-CokNymqA.js → alert-Vbti1gEG.js} +1 -1
- package/dist/client/assets/{alert-dialog-DeJgSFRZ.js → alert-dialog-AqvICzdc.js} +1 -1
- package/dist/client/assets/{analytics-sections-DDWh8YnS.js → analytics-sections-BRRkR5Qo.js} +1 -1
- package/dist/client/assets/api-keys-BHkPvB4Y.js +1 -0
- package/dist/client/assets/{api-keys-Ch7q_sOP.js → api-keys-BNqPisrV.js} +1 -1
- package/dist/client/assets/{app-editor-BhWLpri1.js → app-editor-D6e4YO7u.js} +1 -1
- package/dist/client/assets/{asset-utils-BRk3fUR7.js → asset-utils-BAeS61or.js} +1 -1
- package/dist/client/assets/{auth-BNR-bSJO.js → auth-C0Awroma.js} +1 -1
- package/dist/client/assets/{auth-catchall-CJ0eRklU.js → auth-catchall-M1lbFyHW.js} +1 -1
- package/dist/client/assets/{auth-entry-XcfUUozZ.js → auth-entry-DNTBr4dX.js} +1 -1
- package/dist/client/assets/{auth-split-layout-mYNIGFvp.js → auth-split-layout-VyPiSI-b.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CZrI0wkU.js → authenticate-and-persist-oauth-CkO9YCus.js} +1 -1
- package/dist/client/assets/{automation-list-row-DfLOPauj.js → automation-list-row-NNUpUcl1.js} +1 -1
- package/dist/client/assets/{automation-runs-RuvSYlk2.js → automation-runs-CmqXHMa2.js} +1 -1
- package/dist/client/assets/{automations-CQh_fULy.js → automations-tpSvjSCZ.js} +1 -1
- package/dist/client/assets/{autosend-h1h21hnM.js → autosend-BBuziBf6.js} +1 -1
- package/dist/client/assets/{avatar-UFbMnkmr.js → avatar-Cm5Wz0Ek.js} +1 -1
- package/dist/client/assets/{badge-DzTxW-Ts.js → badge-D-X7jCCj.js} +1 -1
- package/dist/client/assets/{block-document-hxIwEIoN.js → block-document-CBORFGb8.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-DRl7lMaq.js → blocks-preview-workspace-context-smhHThS8.js} +1 -1
- package/dist/client/assets/{buckets-B-CYwdgC.js → buckets-B5krVge0.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DNmtsTJk.js → build-improve-prompt-doc-BXIVXD_M.js} +1 -1
- package/dist/client/assets/{calendar-Bx26MiuJ.js → calendar-lqFPIlGZ.js} +1 -1
- package/dist/client/assets/{capability-load-error-BWTOxRLG.js → capability-load-error-8yr0cKsu.js} +1 -1
- package/dist/client/assets/{category-editor-DjdC64aL.js → category-editor-Cp8uxqcx.js} +1 -1
- package/dist/client/assets/{chart-BxpZzVsr.js → chart-BjcjMBp2.js} +1 -1
- package/dist/client/assets/{chat-context-DppIIhzA.js → chat-context-Bw1Qo4Kf.js} +1 -1
- package/dist/client/assets/{chat-draft-DiJpqitX.js → chat-draft-CQ5qjDsv.js} +1 -1
- package/dist/client/assets/{checkbox-BGfnFNv1.js → checkbox-BHKLlAci.js} +1 -1
- package/dist/client/assets/{choose-editor-DHwWSJiW.js → choose-editor-VLE21WTh.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-BRgB3yX1.js → claim-phase-copy-Bc0le9Uu.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BX3DQOO5.js → cli-auth-success-EpJb9LMW.js} +1 -1
- package/dist/client/assets/{client-icons-CYZ83j__.js → client-icons-DF05jGYG.js} +1 -1
- package/dist/client/assets/{collapsible-C2j127TD.js → collapsible-FI3WWzNe.js} +1 -1
- package/dist/client/assets/{collection-detail-ehNX3PLY.js → collection-detail-DA5Whp5b.js} +1 -1
- package/dist/client/assets/{collection-display-button-CwIm419d.js → collection-display-button-D2q-ABWg.js} +1 -1
- package/dist/client/assets/{collection-search-D_azi8Gq.js → collection-search-DdV66iL8.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DMU9yWMT.js → collection-table-wrapper-CGlcKHbe.js} +1 -1
- package/dist/client/assets/{collection-tabs-C6N84gCC.js → collection-tabs-DtGcsdTg.js} +1 -1
- package/dist/client/assets/{combobox--XWfS5lw.js → combobox-Br6WHzj1.js} +1 -1
- package/dist/client/assets/{command-D1RoIxg2.js → command-DkuU4Z8a.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-Cs-LBxQr.js → companion-mcps-section-CNei3iRu.js} +1 -1
- package/dist/client/assets/{config-CMMAnMUF.js → config-DynGIo1W.js} +1 -1
- package/dist/client/assets/{connect-DVE1Hnuy.js → connect-DG6OAh89.js} +1 -1
- package/dist/client/assets/{connect-layout--NwWaqYw.js → connect-layout-Cnc4NK49.js} +1 -1
- package/dist/client/assets/{connection-Ds6vwkGM.js → connection-CbXyxk_0.js} +1 -1
- package/dist/client/assets/{connection-card-BPKFHpho.js → connection-card-DvwNTHUt.js} +1 -1
- package/dist/client/assets/{connection-detail-BroJMnyc.js → connection-detail-DRP-MNPt.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-C4OB4j_3.js → connection-form-helpers-BoZMz-Fx.js} +1 -1
- package/dist/client/assets/{connections-DG2GlCvy.js → connections-C9THVD3s.js} +1 -1
- package/dist/client/assets/{context-BL1LKuLQ.js → context-D6Zd3Hi2.js} +1 -1
- package/dist/client/assets/{context-menu-CBJP1RfU.js → context-menu-VjgUfeOJ.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BQ0I0t_j.js → create-organization-dialog-C3ngVf0Y.js} +1 -1
- package/dist/client/assets/{daily-pulse-Dpp9pCbq.js → daily-pulse-DEC1kU0r.js} +1 -1
- package/dist/client/assets/{decopilot-BRlhj2Gw.js → decopilot-DTXbrEBB.js} +1 -1
- package/dist/client/assets/{dialog-Mg_Z3ES1.js → dialog-BR2W-zw-.js} +1 -1
- package/dist/client/assets/{discover-DCHf1gBE.js → discover-C0WrsbFb.js} +1 -1
- package/dist/client/assets/{domain-settings-CmoTC2Mj.js → domain-settings-VjNI_QNS.js} +1 -1
- package/dist/client/assets/{download-app-dialog-B7zcmkcH.js → download-app-dialog-UGyaf1gI.js} +1 -1
- package/dist/client/assets/{drawer-BIoKJwCW.js → drawer-BuCU4dtF.js} +1 -1
- package/dist/client/assets/{editor-JpZ1gWwV.js → editor-K_ZCeYmt.js} +1 -1
- package/dist/client/assets/{empty-state-BmztM-Bo.js → empty-state-Cc-zeI-b.js} +1 -1
- package/dist/client/assets/{empty-state-BayRP7H4.js → empty-state-CyVuIHKP.js} +1 -1
- package/dist/client/assets/{extract-connection-data-D5wjQBt3.js → extract-connection-data-CJFs5pw9.js} +1 -1
- package/dist/client/assets/{feature-gate-DvQXfI5S.js → feature-gate-DLNLPr3F.js} +1 -1
- package/dist/client/assets/{feature-paywall-sc2LtOXc.js → feature-paywall-dsk7xdNr.js} +1 -1
- package/dist/client/assets/{file-explorer-CqjD-skS.js → file-explorer-Bq_pA8Z8.js} +1 -1
- package/dist/client/assets/{file-preview-VfWoS2gk.js → file-preview-mQPZHAmY.js} +1 -1
- package/dist/client/assets/{file-share-button-BGOzbmtb.js → file-share-button-DtFsmxK8.js} +1 -1
- package/dist/client/assets/{file-type-icon-BhiPdwxi.js → file-type-icon-Dl1YFVBW.js} +1 -1
- package/dist/client/assets/flat-project-BIYjLVHC.js +1 -0
- package/dist/client/assets/{folder-icon-DBIJdeY7.js → folder-icon-CECAOUab.js} +1 -1
- package/dist/client/assets/{form-BgAERq-t.js → form-vqBaFO9r.js} +1 -1
- package/dist/client/assets/{gateway-client-CIbTMjGx.js → gateway-client-C-QySNgV.js} +1 -1
- package/dist/client/assets/{general-BBuB4XlH.js → general-Do2cA-65.js} +1 -1
- package/dist/client/assets/{home-C96-FMPc.js → home-DYEN5n0q.js} +1 -1
- package/dist/client/assets/{icon-button-CWL5E4Ua.js → icon-button-D6LkIJqw.js} +1 -1
- package/dist/client/assets/{index-B0WfPFpv.js → index-B65bqTRS.js} +1 -1
- package/dist/client/assets/{index-BZOsa8jC.js → index-BINYmdVo.js} +1 -1
- package/dist/client/assets/{index-CORXJXSN.js → index-BMtTkIcx.js} +1 -1
- package/dist/client/assets/{index-DWe-6mCD.js → index-BOvE7Vou.js} +1 -1
- package/dist/client/assets/{index-B9dD9jj0.js → index-B_3mBk4y.js} +47 -47
- package/dist/client/assets/{index-2-Z1VD2F.js → index-BgbBMhHU.js} +1 -1
- package/dist/client/assets/{index-DR9ob9os.js → index-BgjS0Ggx.js} +1 -1
- package/dist/client/assets/{index-DL-sDqTO.js → index-C0Nx6fZO.js} +1 -1
- package/dist/client/assets/{index-vYawqXRD.js → index-C5qguP-p.js} +1 -1
- package/dist/client/assets/{index-r8TBLtcZ.js → index-CSpDxMoa.js} +1 -1
- package/dist/client/assets/{index-RYaP6qX3.js → index-Cdm-vjxa.js} +3 -3
- package/dist/client/assets/{index-v5QvptSB.js → index-DYGqHQ2c.js} +1 -1
- package/dist/client/assets/{index-CpszPQp_.js → index-Dg8x2nny.js} +1 -1
- package/dist/client/assets/{index-ROw_u5-U.js → index-Dka8jQlP.js} +1 -1
- package/dist/client/assets/{index-Bv71AEH5.js → index-MTPwGC5m.js} +1 -1
- package/dist/client/assets/{index-redirect-DN5m0MeF.js → index-redirect-DoeqrB6K.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-Ex2lNjjr.js → infiniteQueryObserver-CBfG4TV-.js} +1 -1
- package/dist/client/assets/{infra-billing-BvYXN3Z1.js → infra-billing-BLgAtuiz.js} +1 -1
- package/dist/client/assets/{input-Cndqm_5O.js → input-B1N39T_Y.js} +1 -1
- package/dist/client/assets/{input-BmzPGvUi.js → input-BwSTkgpp.js} +1 -1
- package/dist/client/assets/{input-BZloVZ72.js → input-i0t9B7Yt.js} +3 -3
- package/dist/client/assets/{integration-icon-C5NBXdpz.js → integration-icon-DF1SWs0L.js} +1 -1
- package/dist/client/assets/{label-DpahMcEo.js → label-CAMUAUyp.js} +1 -1
- package/dist/client/assets/{last-preview-page-Dfux_ulA.js → last-preview-page-B2E_iOQP.js} +1 -1
- package/dist/client/assets/{layout-C6k3EFd1.js → layout-SznEbmEi.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-B_DiKZ0c.js → legacy-agents-deep-DzXfGrO1.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BgIGaynA.js → legacy-main-redirect-2uht7lTs.js} +1 -1
- package/dist/client/assets/library-BGY_wvai.js +1 -0
- package/dist/client/assets/{library-tab-Bso2C2NG.js → library-tab-8HAhdPuS.js} +1 -1
- package/dist/client/assets/{login-CXuSqosI.js → login-Dofn0_em.js} +1 -1
- package/dist/client/assets/{markdown-D8U5yexH.js → markdown-B9aD1F1t.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CWOIFfi6.js → mcp-app-renderer-CCjWAcAL.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DCDrWVc0.js → mcp-oauth-D4Ea-Fft.js} +1 -1
- package/dist/client/assets/{members-BfRC0ceX.js → members-BvY310ge.js} +1 -1
- package/dist/client/assets/{message-templates-DgOMle6a.js → message-templates-CUdgVJRM.js} +1 -1
- package/dist/client/assets/{mini-report-page-BIktJNbh.js → mini-report-page-BNEmX88t.js} +1 -1
- package/dist/client/assets/{mock-board-DjQ6xrU_.js → mock-board-DoArRGPA.js} +1 -1
- package/dist/client/assets/{monaco-editor-BRUSLTLk.js → monaco-editor-B_VHQ5gY.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C4bB2YFf.js → monitoring-stats-row-BDqEJkb_.js} +1 -1
- package/dist/client/assets/{multi-select-6bm7qEEn.js → multi-select-CgpS87eq.js} +1 -1
- package/dist/client/assets/{mustache-CAmcva4T.js → mustache-DmCtN5od.js} +1 -1
- package/dist/client/assets/{new-project-dialog-BejzbVG2.js → new-project-dialog-k4u3nID3.js} +1 -1
- package/dist/client/assets/{oauth-callback-0bxicPCo.js → oauth-callback-DFoxcVbz.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-D4kx59om.js → oauth-callback-ai-provider-Clc7UcPT.js} +1 -1
- package/dist/client/assets/{onboarding-C7mIZXvc.js → onboarding-QzWSNB68.js} +1 -1
- package/dist/client/assets/{openai-conversation-DYPzWsQc.js → openai-conversation-BYnJG3sG.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-DHo7EiTm.js → optimistic-project-sidebar-views-Bmn0i2L0.js} +1 -1
- package/dist/client/assets/{org-file-open-context-CSDcMwBD.js → org-file-open-context-C81CF5lY.js} +1 -1
- package/dist/client/assets/{organization-choice-BZ-4C5a6.js → organization-choice-1Ch3usqI.js} +1 -1
- package/dist/client/assets/{orgs-DnEd_o3Y.js → orgs-S_td7jXe.js} +1 -1
- package/dist/client/assets/{page-seo-form-BjAunJ7T.js → page-seo-form-CejuwtL1.js} +1 -1
- package/dist/client/assets/{pair-o8Pcow3m.js → pair-CffqlQYs.js} +1 -1
- package/dist/client/assets/{plan-ladder-COYrpP9N.js → plan-ladder-elmtHhgS.js} +1 -1
- package/dist/client/assets/{popover-D5s3M61L.js → popover-HtaOhw3r.js} +1 -1
- package/dist/client/assets/{post-calendar-Cl-vAwk3.js → post-calendar-BLuKhT2v.js} +1 -1
- package/dist/client/assets/{post-editor-D2HU9kfD.js → post-editor-B9m6130P.js} +1 -1
- package/dist/client/assets/{preview-content-B9bgsNRh.js → preview-content-7Xoo-BsV.js} +1 -1
- package/dist/client/assets/{preview-dialog-CwQ43Y6v.js → preview-dialog-EGWZsCf5.js} +1 -1
- package/dist/client/assets/{profile-BB1G47uY.js → profile-CdaDKILV.js} +1 -1
- package/dist/client/assets/{project-app-view-DS-jWTJh.js → project-app-view-DkTFe9BB.js} +1 -1
- package/dist/client/assets/{project-feed-Ceha3l-R.js → project-feed-JKI4eiPj.js} +1 -1
- package/dist/client/assets/{project-icon-CmV-Y1UZ.js → project-icon-CZCXf1ZD.js} +1 -1
- package/dist/client/assets/project-reports-CV3jPJF3.js +1 -0
- package/dist/client/assets/project-tasks-ByZ39JiK.js +1 -0
- package/dist/client/assets/{projects-Cv5osXsD.js → projects-DvXWKplD.js} +1 -1
- package/dist/client/assets/{projects-empty-state-CaTjevnb.js → projects-empty-state-9gNmeZsq.js} +1 -1
- package/dist/client/assets/{prompts-BgUtk3zC.js → prompts-DDBWSiYr.js} +1 -1
- package/dist/client/assets/record-editor-BwyoUD4K.js +1 -0
- package/dist/client/assets/{redirect-editor-BpclUTIj.js → redirect-editor-dBYIGyFb.js} +1 -1
- package/dist/client/assets/{reports-CLznlgS5.js → reports-BVjd03mK.js} +1 -1
- package/dist/client/assets/reports-PlaJXl-j.js +1 -0
- package/dist/client/assets/{reports-onboarding-BHCXUocU.js → reports-onboarding-s5-OPdwG.js} +1 -1
- package/dist/client/assets/{reports-tab-CoZHZlVb.js → reports-tab-zEmYxglx.js} +2 -2
- package/dist/client/assets/{repositories-DoauYKeu.js → repositories-q5YM_f7_.js} +1 -1
- package/dist/client/assets/{repository-binding-DzrKIMc8.js → repository-binding-DoGbZGqV.js} +1 -1
- package/dist/client/assets/{repository-import-picker-CVP1mN_O.js → repository-import-picker-Do_6Wg0W.js} +1 -1
- package/dist/client/assets/{repository-picker-BIkrH86Z.js → repository-picker-EdvJ_XCR.js} +1 -1
- package/dist/client/assets/{require-capability-CEGMzsiO.js → require-capability-C1D1dXCn.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BPzqc-yZ.js → required-auth-layout-DL1Uhs7R.js} +1 -1
- package/dist/client/assets/{reset-password-CC9lxhEO.js → reset-password-CQfjAeYc.js} +1 -1
- package/dist/client/assets/{resizable-Ck9CN4S9.js → resizable-eratR9AK.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-CgOUF0YA.js → resolve-tab-icon-Du8jGUtn.js} +1 -1
- package/dist/client/assets/{review-settings-cCLUF68J.js → review-settings-BDXdSq0U.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-RS2mJIfp.js → rich-text-link-control-BUaa9cuE.js} +1 -1
- package/dist/client/assets/{roles-DWD7cz1d.js → roles-BxLQKznn.js} +1 -1
- package/dist/client/assets/{route-DI4K2hiz.js → route-DN3pk65w.js} +1 -1
- package/dist/client/assets/route-Dk3w9UGz.js +1 -0
- package/dist/client/assets/{route-CjKIfVgB.js → route-GFaA83CZ.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-h-xGxUBS.js → runnable-block-editor-Bb72YaFN.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-OPdARg4I.js → sandbox-lifecycle-context-CZnq-87O.js} +1 -1
- package/dist/client/assets/{schema-BejaMrNT.js → schema-pZTMqosP.js} +1 -1
- package/dist/client/assets/{scroll-area-DjfgE2jb.js → scroll-area-kaq4mbUn.js} +1 -1
- package/dist/client/assets/{search-input-DviARBm2.js → search-input-BjeWS4bC.js} +1 -1
- package/dist/client/assets/{search-toggle-DvOTtKmA.js → search-toggle-BWjdA70E.js} +1 -1
- package/dist/client/assets/{secret-picker-CuEw2DSI.js → secret-picker-DFruMsO2.js} +1 -1
- package/dist/client/assets/{secrets-CoVAIKwE.js → secrets-C0ksgflf.js} +1 -1
- package/dist/client/assets/{sections-editor-CsNiIfgn.js → sections-editor-25cXOA_1.js} +1 -1
- package/dist/client/assets/{select-Cd1ykg-h.js → select-MC8L6Y4s.js} +1 -1
- package/dist/client/assets/{select-model-a344Xqu_.js → select-model-CgfK5T0X.js} +1 -1
- package/dist/client/assets/{seo-editor-D4_b59uB.js → seo-editor-qQizVqfD.js} +1 -1
- package/dist/client/assets/{separator-Ch977YA1.js → separator-CMC_q_rJ.js} +1 -1
- package/dist/client/assets/{settings-tab-sWmscvB1.js → settings-tab-DetxVou8.js} +1 -1
- package/dist/client/assets/{sheet-lggFYx6M.js → sheet-HF0WcB82.js} +1 -1
- package/dist/client/assets/{shell-layout-Bl8of89A.js → shell-layout-CTm_WHyN.js} +1 -1
- package/dist/client/assets/{skills-CzJ783Zp.js → skills-DfctZoHI.js} +1 -1
- package/dist/client/assets/{sso-DKlO8_Lq.js → sso-ChHWqNYy.js} +1 -1
- package/dist/client/assets/{suggestion-K--t6EP5.js → suggestion-CJYj-5kL.js} +1 -1
- package/dist/client/assets/{switch-BLWgY1pz.js → switch-BXBfxHLv.js} +1 -1
- package/dist/client/assets/{synced-repos-BnWEHPVF.js → synced-repos-8_ZxjVlT.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-C_bZ6WrZ.js → tab-icon-glyph-DdzedQEj.js} +1 -1
- package/dist/client/assets/{table-CufJwyXQ.js → table-DfMMeaNU.js} +1 -1
- package/dist/client/assets/{tabs-C1zPDoUI.js → tabs-CyQ-WrSH.js} +1 -1
- package/dist/client/assets/{task-board-DlEJAtdm.js → task-board-B1vzDAVG.js} +1 -1
- package/dist/client/assets/{task-route-z_uMrYh2.js → task-route-CxVqvuSa.js} +1 -1
- package/dist/client/assets/{task-status-DrVr4O9O.js → task-status-D_Ny_vO8.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-BEIixlIh.js → taskboard-analytics-9f61Lf0z.js} +1 -1
- package/dist/client/assets/{tasks-CpEABx-G.js → tasks--AojwOyu.js} +1 -1
- package/dist/client/assets/tasks-74JEZOvb.js +1 -0
- package/dist/client/assets/{textarea-r66bOcCD.js → textarea-VVwww85B.js} +1 -1
- package/dist/client/assets/{thread-analytics-BmowQF8I.js → thread-analytics-CGfF4U1z.js} +1 -1
- package/dist/client/assets/{thread-intent-UQGFcX_y.js → thread-intent-BwAsu2SG.js} +2 -2
- package/dist/client/assets/{thread-route-CVz2UKe8.js → thread-route-Bg90UHhP.js} +1 -1
- package/dist/client/assets/{thread-route-CowkfwAl.js → thread-route-CqPKjeFM.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-CxW1uZ8Z.js → thread-sheet-body-CAMNdnPV.js} +1 -1
- package/dist/client/assets/{toggle-group-BQtHqwCK.js → toggle-group-D4zRc1HZ.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-B4QTn-IO.js → toolbar-icon-button-voXPSLQD.js} +1 -1
- package/dist/client/assets/{tooltip-CM3YyNDC.js → tooltip-A9lPSKit.js} +1 -1
- package/dist/client/assets/{track-BqJ0I7ao.js → track-DobpObFT.js} +1 -1
- package/dist/client/assets/{types-DyM6In73.js → types-BjX52uU5.js} +1 -1
- package/dist/client/assets/{usage-stats-5Vc6zWOp.js → usage-stats-BY7R-UV8.js} +1 -1
- package/dist/client/assets/{use-ai-providers-C98JaJAU.js → use-ai-providers-CajwguYo.js} +1 -1
- package/dist/client/assets/{use-automations-CqbCGltu.js → use-automations-VXPCxEzn.js} +1 -1
- package/dist/client/assets/{use-autosave-tzZy_E8d.js → use-autosave-BgA4fgaR.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-BfZJHnkW.js → use-chat-layout-state-DD1tmwdx.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DfiphJ3V.js → use-connect-companion-CHoHPYq5.js} +1 -1
- package/dist/client/assets/{use-connection-BdSGHKJK.js → use-connection-CWXA50IZ.js} +1 -1
- package/dist/client/assets/{use-copy-CiP5Vy7i.js → use-copy-B5g9zFhy.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CoU2LYN8.js → use-create-virtual-mcp-Dz5gwPDd.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BQIR67dY.js → use-date-fns-locale-CZN80RON.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-6IETzqNZ.js → use-debounced-autosave-DKVhWfae.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DCYhoWzs.js → use-debounced-value-yeyF9VWy.js} +1 -1
- package/dist/client/assets/{use-deco-credits-x58AfrXU.js → use-deco-credits-BjM50lqx.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BZQXzmAo.js → use-decopilot-events-DgoNCAj-.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CzvLG4mr.js → use-delete-connection-nsQYmlH3.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BmH0eskZ.js → use-deployment-admin-5llNNzV_.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-DFL8djh0.js → use-fast-preview-draft-url-Cm_dQrR9.js} +1 -1
- package/dist/client/assets/{use-file-configs-DRP3Y7X_.js → use-file-configs-MloqKXG4.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BjVQV3DR.js → use-infinite-scroll-CgnPiJA2.js} +1 -1
- package/dist/client/assets/{use-join-requests-B6dqmlCQ.js → use-join-requests-Cr0cV6H_.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-sy9nYCqA.js → use-main-panel-tabs-CMknOIXL.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-Cjd2QrWU.js → use-mcp-auth-status-BBrvcdmC.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CqsHeShn.js → use-mcp-client-B_ORPqL8.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-D2YpCb1K.js → use-mcp-prompts-DL8S5JPE.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CHvaFbLg.js → use-mcp-tools-BUyi99fx.js} +1 -1
- package/dist/client/assets/{use-members-BIhBY7mT.js → use-members-C5YyvV0b.js} +1 -1
- package/dist/client/assets/{use-mobile-3MM_rw4D.js → use-mobile-Cit5JQWz.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-PjEm7mol.js → use-navigate-to-agent-BwWHCV0Z.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-BgW4UDeW.js +1 -0
- package/dist/client/assets/{use-open-billing-url-CVEaCqtR.js → use-open-billing-url-ufz1Edxj.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DM3Q5_fm.js → use-org-auth-client-uJpLhcXu.js} +1 -1
- package/dist/client/assets/{use-org-fs-DazA0BMP.js → use-org-fs-DSneEZr8.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DGjVBBAK.js → use-org-repo-syncs-rComLsRR.js} +1 -1
- package/dist/client/assets/{use-org-sso-DGy0uwEN.js → use-org-sso-DlHcchE2.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Bjw-G0xx.js → use-organization-roles-DMe1nsd1.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DbPbYeMx.js → use-organization-settings-NLGfOzk9.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-DH6_TAsx.js → use-panel-navigate-xfYLfPeP.js} +1 -1
- package/dist/client/assets/{use-project-scope-Bgnjdhs7.js → use-project-scope-mDKXkaKI.js} +1 -1
- package/dist/client/assets/{use-releases-DQGDjOy5.js → use-releases-B5H9FpQL.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-BASyyQU9.js → use-reports-diagnostic-Ds5W47nv.js} +1 -1
- package/dist/client/assets/{use-secrets-B41nk4LH.js → use-secrets-ycW9IMTs.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DKahorN-.js → use-section-preview-base-C7g5i8aB.js} +1 -1
- package/dist/client/assets/{use-session-runtime-CsLaMszW.js → use-session-runtime-41aA3FaG.js} +1 -1
- package/dist/client/assets/{use-tags-BQ9peM4A.js → use-tags-DCucaR9s.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-Co6FjpoI.js → use-task-board-analytics-Bn9GQ2td.js} +1 -1
- package/dist/client/assets/{use-task-board-events-BsviWCWn.js → use-task-board-events-0X4biGfq.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DvgRil5z.js → use-task-metadata-Cj1cmQvo.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-Bf4bUeLT.js → use-thread-analytics-AHDY4dNK.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-CvWfZHjR.js → use-thread-outputs-Blfor-oA.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CN5NPBR0.js +1 -0
- package/dist/client/assets/{useQueries-CIVnwtOu.js → useQueries-JzYmKszp.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CI9mo6bF.js +1 -0
- package/dist/client/assets/{users-2Adoo8D9.js → users-CfSFNWT_.js} +1 -1
- package/dist/client/assets/{utils-BeoNvR__.js → utils-C1m0wvDK.js} +1 -1
- package/dist/client/assets/{variant-calendar-C6HvphcB.js → variant-calendar-C4_2wBML.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-De1zsqbc.js → variant-matcher-override-BAnoj0VK.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DtqPFP6s.js → view-mode-toggle-chgrfj1u.js} +1 -1
- package/dist/client/assets/{virtual-mcp-Cr9A-Wo0.js → virtual-mcp-B2jselSK.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-BMOs_YKU.js +0 -1
- package/dist/client/assets/agent-deck-9_2F3EG2.js +0 -1
- package/dist/client/assets/agent-library-BoJuDeBh.js +0 -1
- package/dist/client/assets/agent-library-file-Dyz9u3bt.js +0 -1
- package/dist/client/assets/agent-settings-MQLrMTV8.js +0 -1
- package/dist/client/assets/agent-site-editor-code-D4dXTr1f.js +0 -2
- package/dist/client/assets/agent-view-CfCVRWZl.js +0 -1
- package/dist/client/assets/api-keys-DLiRLY55.js +0 -1
- package/dist/client/assets/flat-project-wkNYEFlO.js +0 -1
- package/dist/client/assets/library-D6flTj5t.js +0 -1
- package/dist/client/assets/project-reports-M4OcQRnq.js +0 -1
- package/dist/client/assets/project-tasks-D2UK5JuX.js +0 -1
- package/dist/client/assets/record-editor-C0G9mTGj.js +0 -1
- package/dist/client/assets/reports-cbjIbfxK.js +0 -1
- package/dist/client/assets/route-n8gaWLVb.js +0 -1
- package/dist/client/assets/tasks-l5i1Y6YC.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-BAZ5qlTk.js +0 -1
- package/dist/client/assets/useInfiniteQuery-TQWsreUe.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DMyZCSsI.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-B9dD9jj0.js";import{g as We}from"./extract-connection-data-D5wjQBt3.js";import{E as Ce}from"./empty-state-BmztM-Bo.js";import{E as Ye,c as Je,r as Ze,b as et,d as tt}from"./connection-form-helpers-C4OB4j_3.js";import{c as st,S as nt,D as it}from"./index-CpszPQp_.js";import{u as we,T as ot}from"./use-mcp-auth-status-Cjd2QrWU.js";import{a as at}from"./use-members-BIhBY7mT.js";import{A as lt}from"./avatar-UFbMnkmr.js";import{a as ke,b as Ie,u as rt}from"./use-connection-BdSGHKJK.js";import{u as Te}from"./use-mcp-client-CqsHeShn.js";import{u as ct}from"./use-mcp-tools-CHvaFbLg.js";import{a as dt}from"./use-mcp-prompts-D2YpCb1K.js";import{i as mt,a as ut}from"./mcp-oauth-DCDrWVc0.js";import{I as ae}from"./integration-icon-C5NBXdpz.js";import{s as xt}from"./Plus-DP7AHtKt.js";import{bb as pt,av as ft,bv as ht,p as ne,au as gt}from"./agent-icon-TQUkqPJj.js";import{a as Ae,f as jt,s as bt}from"./Tool01-D2y7RTX1.js";import{s as re}from"./Trash01-64yehlfB.js";import{b as vt,a as Nt,c as St,S as yt,d as _t}from"./sheet-lggFYx6M.js";import{F as q,b as H,c as K,d as L,f as X,e as Ct,a as wt}from"./form-BgAERq-t.js";import{I as W}from"./input-Cndqm_5O.js";import{u as kt,D as It}from"./use-delete-connection-CzvLG4mr.js";import{c as Tt,B as At,a as Pt,C as Dt}from"./monitoring-stats-row-C4bB2YFf.js";import{d as $t,C as Ot,a as Mt}from"./chart-BxpZzVsr.js";import{b as zt}from"./repository-binding-DzrKIMc8.js";import{T as ie,a as Et,c as oe,b as Rt}from"./tabs-C1zPDoUI.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Ut}from"./ShoppingBag01-Dq4UD5Hm.js";import{g as ce}from"./types-DyM6In73.js";import{M as Ft}from"./mcp-app-renderer-CWOIFfi6.js";import{C as Vt}from"./collection-search-D_azi8Gq.js";import{B as Lt}from"./badge-DzTxW-Ts.js";import{S as pe,b as fe,a as he,d as ge,c as G}from"./select-Cd1ykg-h.js";import{i as Bt}from"./CheckCircle-jESFBkr7.js";import{t as Gt}from"./ChevronUp-Q2TBgNib.js";import{c as qt}from"./UserSquare-nGw6lX43.js";import{s as Ht}from"./XClose-CMTvfCel.js";import{p as Kt,i as Xt}from"./connection-Ds6vwkGM.js";import"./metadata-D72DunRR.js";import"./Key01-D2FR3CbZ.js";import"./auth-BNR-bSJO.js";import"./index-B0WfPFpv.js";import"./index-Bv71AEH5.js";import"./index-BZOsa8jC.js";import"./popover-D5s3M61L.js";import"./tooltip-CM3YyNDC.js";import"./index-DWe-6mCD.js";import"./Check-C8M8v3vI.js";import"./SearchMd-D_KPqWqZ.js";import"./use-mobile-3MM_rw4D.js";import"./use-create-virtual-mcp-CoU2LYN8.js";import"./use-navigate-to-agent-PjEm7mol.js";import"./thread-intent-UQGFcX_y.js";import"./backoff-8mStPHYB.js";import"./task-board-DlEJAtdm.js";import"./schema-BejaMrNT.js";import"./slugify-CEUa2lfQ.js";import"./Image01-CsDdVFAJ.js";import"./use-org-auth-client-DM3Q5_fm.js";import"./User01-CU3qbr5s.js";import"./AlertCircle-CXwWyjWL.js";import"./ArrowUp-BiYv-XbK.js";import"./ArrowLeft-DYnQbYxF.js";import"./ArrowRight-C4e8QGnK.js";import"./ZoomOut-xQj4oorm.js";import"./Palette-AyH3xXYO.js";import"./Copy01-CaF9W1F_.js";import"./CreditCard01-Czi8bh9o.js";import"./DotsVertical-DyDeVQCx.js";import"./Link01-NjQr5iwv.js";import"./LinkExternal01-CR1925bA.js";import"./Monitor01-50nhII2F.js";import"./Sun-oSoDHq1v.js";import"./Upload01-BvgQ3r-o.js";import"./Users01-Lf2fvOej.js";import"./X-NPE_cXRR.js";import"./label-DpahMcEo.js";import"./alert-dialog-DeJgSFRZ.js";import"./CartesianChart-BGE8uJq6.js";import"./XAxis-Drv4sXya.js";import"./AreaChart-CWnwFPGD.js";import"./ErrorBarContext-D4BkOvp5.js";import"./Sector-BR7_Ijx1.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=Tt(r?.logs??[],o,void 0,r?.total,d?.total),m=u.data,p=u.totalCalls>0,x=es(r?.logs??[]),h=u.totalCalls>0?Math.round(u.totalErrors/u.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),j]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),p?t.jsxs("div",{children:[t.jsx($t,{config:ns,className:"h-16 w-full",children:t.jsxs(At,{data:m,barCategoryGap:"4%",children:[t.jsx(Ot,{content:t.jsx(Mt,{labelFormatter:ls}),cursor:{fill:"var(--muted)"}}),t.jsx(Pt,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:m.map(as)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[m.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),x.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:x.map(os)})]})]})}function os(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function as(s,e){return t.jsx(Dt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function ls(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function rs(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function cs(s){const e=U.c(22),{connectionId:n}=s,c=V(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==a?(u=ts.map(j=>t.jsx("button",{type:"button","aria-pressed":a===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",a===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=a,e[7]=u):u=e[7];let m;e[8]!==d||e[9]!==u?(m=t.jsx("div",{role:"group","aria-label":d,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:u}),e[8]=d,e[9]=u,e[10]=m):m=e[10];let p;e[11]!==r||e[12]!==m?(p=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,m]}),e[11]=r,e[12]=m,e[13]=p):p=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rs,{}),e[14]=x):x=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==a?(h=t.jsx(Z.Suspense,{fallback:x,children:t.jsx(is,{connectionId:n,orgId:l.id,timeframe:a})}),e[15]=n,e[16]=l.id,e[17]=a,e[18]=h):h=e[18];let g;return e[19]!==p||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[p,h]}),e[19]=p,e[20]=h,e[21]=g):g=e[21],g}function ds(s){const e=U.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const m=crypto.randomUUID();a({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:m}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_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=zt(i);if(!(l.length>0)){let p;return e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(t.Fragment,{}),e[2]=p):p=e[2],p}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==r?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r})}),e[5]=r,e[6]=d):d=e[6];let u;e[7]!==a.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(ms,{virtualMcps:l,org:a.slug})}),e[7]=a.slug,e[8]=l,e[9]=u):u=e[9];let m;return e[10]!==d||e[11]!==u?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=m):m=e[12],m}function xs(s){const e=U.c(35),{tools:n,connectionId:c,org:a}=s,i=V(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const d=Te(r),u=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(Vt,{value:x,onChange:h,placeholder:I,onKeyDown:v}),e[25]=x,e[26]=I,e[27]=y):y=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(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(Ft,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.annotations?.title??b.name}),t.jsx(ot,{annotations:b.annotations,_meta:b._meta})]}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b.description})]})]},b.name)})}),e[7]=p,e[8]=d,e[9]=l,e[10]=a,e[11]=x,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=S,e[17]=y}else g=e[14],j=e[15],S=e[16],y=e[17];let _;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(Et,{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(jt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(_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(Rt,{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(Ut,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function js(s){return ce(s._meta)}function bs(s){const e=U.c(13),{connection:n,displayTitle:c}=s,a=c??n.title;let i;e[0]!==n.icon||e[1]!==a?(i=t.jsx(ae,{icon:n.icon,name:a,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=i):i=e[2];let l;e[3]!==a?(l=t.jsx(Ue.Title,{children:a}),e[3]=a,e[4]=l):l=e[4];let o;e[5]!==n.description?(o=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=o):o=e[6];let r;e[7]!==l||e[8]!==o?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,o]}),e[7]=l,e[8]=o,e[9]=r):r=e[9];let d;return e[10]!==i||e[11]!==r?(d=t.jsxs("div",{className:"flex items-center px-4 md:px-8 bg-background border-b border-border shrink-0 gap-3 py-4",children:[i,r]}),e[10]=i,e[11]=r,e[12]=d):d=e[12],d}function vs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=V(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Fe(),d=(()=>{if(typeof o!="string"||!o)return!1;try{const x=new URL(o);return x.hostname==="api.githubcopilot.com"&&x.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",m=e.connection_type==="VIRTUAL",p=m?Kt(e.connection_url):null;return m?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(ye,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(q,{control:s.control,name:"ui_type",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(L,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(G,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(G,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(G,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(q,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(G,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(G,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(G,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(qt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(X,{})]})}),l==="NPX"&&t.jsx(q,{control:s.control,name:"npx_package",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(q,{control:s.control,name:"stdio_command",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),t.jsx(q,{control:s.control,name:"stdio_args",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(X,{})]})})]}),t.jsx(q,{control:s.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(q,{control:s.control,name:"env_vars",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Ye,{value:x.value??[],onChange:x.onChange})}),t.jsx(X,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(q,{control:s.control,name:"connection_token",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ve,{children:[t.jsx(Le,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Lt,{variant:"success",className:"gap-1.5",children:[t.jsx(Bt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Gt,{size:12})]})})}),t.jsxs(Be,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(bt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&x.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>x.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(W,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(Ct,{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=kt({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(It,{...x}),t.jsx(vt,{open:h!==null,onOpenChange:f=>{f||g(null)},children:t.jsxs(Nt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(St,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(yt,{className:"text-base",children:h?.title??s.title}),t.jsx(_t,{className:"text-xs",children:r("details.connection.settingsDescription")}),w&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(lt,{url:w.user?.image??void 0,fallback:w.user?.name??w.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:w.user?.name||w.user?.email})]})]}),t.jsxs(wt,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(q,{control:v.control,name:"title",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(W,{...f})}),t.jsx(X,{})]})}),t.jsx(q,{control:v.control,name:"description",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(W,{...f,value:f.value||""})}),t.jsx(X,{})]})})]}),t.jsx(vs,{form:v,connection:h??s,hasOAuthToken:y.hasOAuthToken,onReauthenticate:P,onRemoveOAuth:R}),t.jsx(nt,{connection:h??s,form:v,hasMcpBinding: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 di(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx($s,{}),s[0]=e):e=s[0],e}export{di as default};
|
|
1
|
+
import{au as ve,bN as Oe,bO as Me,av as de,bM as ze,c as U,b as V,j as t,h as Ne,B,r as Z,l as Se,X as te,a2 as Ee,D as me,K as ee,d as se,p as ye,ak as _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-B_3mBk4y.js";import{g as We}from"./extract-connection-data-CJFs5pw9.js";import{E as Ce}from"./empty-state-Cc-zeI-b.js";import{E as Ye,c as Je,r as Ze,b as et,d as tt}from"./connection-form-helpers-BoZMz-Fx.js";import{c as st,S as nt,D as it}from"./index-Dg8x2nny.js";import{u as we,T as ot}from"./use-mcp-auth-status-BBrvcdmC.js";import{a as at}from"./use-members-C5YyvV0b.js";import{A as lt}from"./avatar-Cm5Wz0Ek.js";import{a as ke,b as Ie,u as rt}from"./use-connection-CWXA50IZ.js";import{u as Te}from"./use-mcp-client-B_ORPqL8.js";import{u as ct}from"./use-mcp-tools-BUyi99fx.js";import{a as dt}from"./use-mcp-prompts-DL8S5JPE.js";import{i as mt,a as ut}from"./mcp-oauth-D4Ea-Fft.js";import{I as ae}from"./integration-icon-DF1SWs0L.js";import{s as xt}from"./Plus-DWABMn2e.js";import{bb as pt,av as ft,bv as ht,p as ne,au as gt}from"./agent-icon-B241PBKK.js";import{a as Ae,f as jt,s as bt}from"./Tool01-CXZVYCJV.js";import{s as re}from"./Trash01-CZPHTYfi.js";import{b as vt,a as Nt,c as St,S as yt,d as _t}from"./sheet-HF0WcB82.js";import{F as q,b as H,c as K,d as L,f as X,e as Ct,a as wt}from"./form-vqBaFO9r.js";import{I as W}from"./input-B1N39T_Y.js";import{u as kt,D as It}from"./use-delete-connection-nsQYmlH3.js";import{c as Tt,B as At,a as Pt,C as Dt}from"./monitoring-stats-row-BDqEJkb_.js";import{d as $t,C as Ot,a as Mt}from"./chart-BjcjMBp2.js";import{b as zt}from"./repository-binding-DoGbZGqV.js";import{T as ie,a as Et,c as oe,b as Rt}from"./tabs-CyQ-WrSH.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Ut}from"./ShoppingBag01-BzDsEvOc.js";import{g as ce}from"./types-BjX52uU5.js";import{M as Ft}from"./mcp-app-renderer-CCjWAcAL.js";import{C as Vt}from"./collection-search-DdV66iL8.js";import{B as Lt}from"./badge-D-X7jCCj.js";import{S as pe,b as fe,a as he,d as ge,c as G}from"./select-MC8L6Y4s.js";import{i as Bt}from"./CheckCircle-BbTEzozp.js";import{t as Gt}from"./ChevronUp-DMzxjk9Q.js";import{c as qt}from"./UserSquare-C-IZAmnp.js";import{s as Ht}from"./XClose-CigTCF4N.js";import{p as Kt,i as Xt}from"./connection-CbXyxk_0.js";import"./metadata-D72DunRR.js";import"./Key01-Crwm5tIn.js";import"./auth-C0Awroma.js";import"./index-B65bqTRS.js";import"./index-MTPwGC5m.js";import"./index-BINYmdVo.js";import"./popover-HtaOhw3r.js";import"./tooltip-A9lPSKit.js";import"./index-BOvE7Vou.js";import"./Check-BiHadeJU.js";import"./SearchMd-df6Y7iRV.js";import"./use-mobile-Cit5JQWz.js";import"./use-create-virtual-mcp-Dz5gwPDd.js";import"./use-navigate-to-agent-BwWHCV0Z.js";import"./thread-intent-BwAsu2SG.js";import"./backoff-8mStPHYB.js";import"./task-board-B1vzDAVG.js";import"./schema-pZTMqosP.js";import"./slugify-CEUa2lfQ.js";import"./Image01-BtlBqgq2.js";import"./use-org-auth-client-uJpLhcXu.js";import"./User01-BKQ4XDsb.js";import"./AlertCircle-B1Wz6L5U.js";import"./ArrowUp-uu6L0oZa.js";import"./ArrowLeft-CecRcRxr.js";import"./ArrowRight-BSlT04qT.js";import"./ZoomOut-CrIY1x34.js";import"./Palette-Dfwz_KK_.js";import"./Copy01-Z8h17W5V.js";import"./CreditCard01-BOXpMyZX.js";import"./DotsVertical-BcY1zCnO.js";import"./Link01-BCM1zE5K.js";import"./LinkExternal01-BSjbzGPT.js";import"./Monitor01-Bu9itRvW.js";import"./Sun-CuJDC_V5.js";import"./Upload01-BhUTj6_2.js";import"./Users01-NFbjkK3Z.js";import"./X-Df5KdWXB.js";import"./label-CAMUAUyp.js";import"./alert-dialog-AqvICzdc.js";import"./CartesianChart-Cye2mySB.js";import"./XAxis-BWQmNFV9.js";import"./AreaChart-D8eDFA25.js";import"./ErrorBarContext-oZYgKRc9.js";import"./Sector-DyaoP-4v.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=Tt(r?.logs??[],o,void 0,r?.total,d?.total),m=u.data,p=u.totalCalls>0,x=es(r?.logs??[]),h=u.totalCalls>0?Math.round(u.totalErrors/u.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),j]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),p?t.jsxs("div",{children:[t.jsx($t,{config:ns,className:"h-16 w-full",children:t.jsxs(At,{data:m,barCategoryGap:"4%",children:[t.jsx(Ot,{content:t.jsx(Mt,{labelFormatter:ls}),cursor:{fill:"var(--muted)"}}),t.jsx(Pt,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:m.map(as)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[m.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),x.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:x.map(os)})]})]})}function os(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function as(s,e){return t.jsx(Dt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function ls(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function rs(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function cs(s){const e=U.c(22),{connectionId:n}=s,c=V(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==a?(u=ts.map(j=>t.jsx("button",{type:"button","aria-pressed":a===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",a===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=a,e[7]=u):u=e[7];let m;e[8]!==d||e[9]!==u?(m=t.jsx("div",{role:"group","aria-label":d,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:u}),e[8]=d,e[9]=u,e[10]=m):m=e[10];let p;e[11]!==r||e[12]!==m?(p=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,m]}),e[11]=r,e[12]=m,e[13]=p):p=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rs,{}),e[14]=x):x=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==a?(h=t.jsx(Z.Suspense,{fallback:x,children:t.jsx(is,{connectionId:n,orgId:l.id,timeframe:a})}),e[15]=n,e[16]=l.id,e[17]=a,e[18]=h):h=e[18];let g;return e[19]!==p||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[p,h]}),e[19]=p,e[20]=h,e[21]=g):g=e[21],g}function ds(s){const e=U.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const m=crypto.randomUUID();a({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:m}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_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=zt(i);if(!(l.length>0)){let p;return e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(t.Fragment,{}),e[2]=p):p=e[2],p}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==r?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r})}),e[5]=r,e[6]=d):d=e[6];let u;e[7]!==a.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(ms,{virtualMcps:l,org:a.slug})}),e[7]=a.slug,e[8]=l,e[9]=u):u=e[9];let m;return e[10]!==d||e[11]!==u?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=m):m=e[12],m}function xs(s){const e=U.c(35),{tools:n,connectionId:c,org:a}=s,i=V(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const d=Te(r),u=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(Vt,{value:x,onChange:h,placeholder:I,onKeyDown:v}),e[25]=x,e[26]=I,e[27]=y):y=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(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(Ft,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.annotations?.title??b.name}),t.jsx(ot,{annotations:b.annotations,_meta:b._meta})]}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b.description})]})]},b.name)})}),e[7]=p,e[8]=d,e[9]=l,e[10]=a,e[11]=x,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=S,e[17]=y}else g=e[14],j=e[15],S=e[16],y=e[17];let _;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(Et,{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(jt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(_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(Rt,{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(Ut,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function js(s){return ce(s._meta)}function bs(s){const e=U.c(13),{connection:n,displayTitle:c}=s,a=c??n.title;let i;e[0]!==n.icon||e[1]!==a?(i=t.jsx(ae,{icon:n.icon,name:a,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=i):i=e[2];let l;e[3]!==a?(l=t.jsx(Ue.Title,{children:a}),e[3]=a,e[4]=l):l=e[4];let o;e[5]!==n.description?(o=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=o):o=e[6];let r;e[7]!==l||e[8]!==o?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,o]}),e[7]=l,e[8]=o,e[9]=r):r=e[9];let d;return e[10]!==i||e[11]!==r?(d=t.jsxs("div",{className:"flex items-center px-4 md:px-8 bg-background border-b border-border shrink-0 gap-3 py-4",children:[i,r]}),e[10]=i,e[11]=r,e[12]=d):d=e[12],d}function vs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=V(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Fe(),d=(()=>{if(typeof o!="string"||!o)return!1;try{const x=new URL(o);return x.hostname==="api.githubcopilot.com"&&x.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",m=e.connection_type==="VIRTUAL",p=m?Kt(e.connection_url):null;return m?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(ye,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(q,{control:s.control,name:"ui_type",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(L,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(G,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(G,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(G,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(q,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(G,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(G,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(G,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(qt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(X,{})]})}),l==="NPX"&&t.jsx(q,{control:s.control,name:"npx_package",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(q,{control:s.control,name:"stdio_command",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),t.jsx(q,{control:s.control,name:"stdio_args",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(X,{})]})})]}),t.jsx(q,{control:s.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(q,{control:s.control,name:"env_vars",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Ye,{value:x.value??[],onChange:x.onChange})}),t.jsx(X,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(q,{control:s.control,name:"connection_token",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ve,{children:[t.jsx(Le,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Lt,{variant:"success",className:"gap-1.5",children:[t.jsx(Bt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Gt,{size:12})]})})}),t.jsxs(Be,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(bt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&x.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>x.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(W,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(Ct,{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=kt({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(It,{...x}),t.jsx(vt,{open:h!==null,onOpenChange:f=>{f||g(null)},children:t.jsxs(Nt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(St,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(yt,{className:"text-base",children:h?.title??s.title}),t.jsx(_t,{className:"text-xs",children:r("details.connection.settingsDescription")}),w&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(lt,{url:w.user?.image??void 0,fallback:w.user?.name??w.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:w.user?.name||w.user?.email})]})]}),t.jsxs(wt,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(q,{control:v.control,name:"title",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(W,{...f})}),t.jsx(X,{})]})}),t.jsx(q,{control:v.control,name:"description",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(W,{...f,value:f.value||""})}),t.jsx(X,{})]})})]}),t.jsx(vs,{form:v,connection:h??s,hasOAuthToken:y.hasOAuthToken,onReauthenticate:P,onRemoveOAuth:R}),t.jsx(nt,{connection:h??s,form:v,hasMcpBinding: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 di(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx($s,{}),s[0]=e):e=s[0],e}export{di as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{au as R,bN as A,bO as I,av as o,bM as j,bL as L,c as z,j as u,B as C}from"./index-
|
|
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-B_3mBk4y.js";import{I as H}from"./input-B1N39T_Y.js";import{s as W}from"./Plus-DWABMn2e.js";import{s as q}from"./Trash01-CZPHTYfi.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-B9dD9jj0.js";import{a as Ae,g as it,e as ct}from"./extract-connection-data-D5wjQBt3.js";import{C as lt}from"./collection-display-button-CwIm419d.js";import{S as rt}from"./search-input-DviARBm2.js";import{C as at}from"./collection-tabs-C6N84gCC.js";import{C as ve,u as Ie,g as dt}from"./connection-card-BPKFHpho.js";import{E as ut}from"./empty-state-BmztM-Bo.js";import{u as gt,D as mt}from"./use-delete-connection-CzvLG4mr.js";import{u as pt}from"./use-infinite-scroll-BjVQV3DR.js";import{u as Pe}from"./use-mobile-3MM_rw4D.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-DeJgSFRZ.js";import{au as je,A as bt,bu as _t,av as Nt,bb as Dt,p as ye}from"./agent-icon-TQUkqPJj.js";import{g as kt,a as Tt}from"./metadata-D72DunRR.js";import{d as Me,h as $e,c as Oe,e as Fe,b as Ue,D as Ve}from"./dialog-Mg_Z3ES1.js";import{D as wt,a as At,d as It,b as Pt,e as Mt,f as $t,g as Ot}from"./drawer-BIoKJwCW.js";import{F as q,b as Q,c as J,d as Y,f as Z,a as Ne}from"./form-BgAERq-t.js";import{I as se}from"./input-Cndqm_5O.js";import{S as Ft,b as Ut,a as Vt,d as zt,c as ae}from"./select-Cd1ykg-h.js";import{T as Lt}from"./textarea-r66bOcCD.js";import{b as ze,u as Et}from"./use-connection-BdSGHKJK.js";import{m as Bt}from"./use-mcp-client-CqsHeShn.js";import{b as Kt}from"./repository-binding-DzrKIMc8.js";import{g as Ht}from"./types-DyM6In73.js";import{s as Le}from"./Plus-DP7AHtKt.js";import{c as Rt}from"./UserSquare-nGw6lX43.js";import{s as Ee}from"./XClose-CMTvfCel.js";import{s as Wt}from"./use-project-scope-Bgnjdhs7.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-C4OB4j_3.js";import{a as Yt}from"./authenticate-and-persist-oauth-CZrI0wkU.js";import{I as Zt}from"./integration-icon-C5NBXdpz.js";import{C as Be}from"./checkbox-BGfnFNv1.js";import{i as en}from"./DotsVertical-DyDeVQCx.js";import{s as Ke}from"./Image01-CsDdVFAJ.js";import{s as He}from"./Trash01-64yehlfB.js";import"./connection-Ds6vwkGM.js";import"./ArrowUp-BiYv-XbK.js";import"./Check-C8M8v3vI.js";import"./tooltip-CM3YyNDC.js";import"./index-DWe-6mCD.js";import"./view-mode-toggle-DtqPFP6s.js";import"./badge-DzTxW-Ts.js";import"./SearchMd-D_KPqWqZ.js";import"./useInfiniteQuery-TQWsreUe.js";import"./infiniteQueryObserver-Ex2lNjjr.js";import"./slugify-CEUa2lfQ.js";import"./AlertCircle-CXwWyjWL.js";import"./Tool01-D2y7RTX1.js";import"./ArrowLeft-DYnQbYxF.js";import"./ArrowRight-C4e8QGnK.js";import"./ShoppingBag01-Dq4UD5Hm.js";import"./ZoomOut-xQj4oorm.js";import"./Palette-AyH3xXYO.js";import"./CheckCircle-jESFBkr7.js";import"./ChevronUp-Q2TBgNib.js";import"./Copy01-CaF9W1F_.js";import"./CreditCard01-Czi8bh9o.js";import"./Key01-D2FR3CbZ.js";import"./Link01-NjQr5iwv.js";import"./LinkExternal01-CR1925bA.js";import"./Monitor01-50nhII2F.js";import"./Sun-oSoDHq1v.js";import"./Upload01-BvgQ3r-o.js";import"./User01-CU3qbr5s.js";import"./Users01-Lf2fvOej.js";import"./X-NPE_cXRR.js";import"./label-DpahMcEo.js";import"./auth-BNR-bSJO.js";import"./mcp-oauth-DCDrWVc0.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=kt(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||Tt(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=>!!Ht(n._meta))?.name??null}:null}const an=3;function dn(o){const e=new Map;for(const n of o)for(const u of n.connections??[]){const s=e.get(u.connection_id)??[];s.push(n),e.set(u.connection_id,s)}return e}function un(o){const e=W.c(25),{projects:n}=o,u=te();if(n.length===0){let m;e[0]!==u?(m=u("projects.connections.orgWide"),e[0]=u,e[1]=m):m=e[1];let 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(bt,{icon:o.icon,name:o.title,size:"xs"})},o.id)}function Re(o){const e=W.c(8),{selectionMode:n,children:u}=o,s=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let i;e[0]!==s?(i=xe("overflow-hidden transition-all duration-150 ease-out",s),e[0]=s,e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(We,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:pn,children:t.jsx(en,{size:20})})}),e[2]=l):l=e[2];let r;e[3]!==u?(r=t.jsxs(Xe,{children:[l,t.jsx(Ge,{align:"end",onClick:mn,children:u})]}),e[3]=u,e[4]=r):r=e[4];let d;return e[5]!==i||e[6]!==r?(d=t.jsx("div",{className:i,children:r}),e[5]=i,e[6]=r,e[7]=d):d=e[7],d}function mn(o){return o.stopPropagation()}function pn(o){return o.stopPropagation()}function fn(o){const e=W.c(57),{group:n,onOpen:u,selectionMode:s,selectedIds:i,onToggleSelect:l}=o,r=te();let d;if(e[0]!==n.connections||e[1]!==i){let N;e[3]!==i?(N=U=>i.has(U.id),e[3]=i,e[4]=N):N=e[4],d=n.connections.every(N),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const 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(_t,{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(Nt,{size:16}),g("orgs.connectionSelectionUi.disable")]}):t.jsxs(ce,{onClick:T=>{T.stopPropagation(),h("active")},children:[t.jsx(Dt,{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=Et(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=Kt(),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(Bt({connectionId:ie,orgId:i.id,orgSlug:i.slug}));pe=rn((await re.listTools()).tools)}catch{}const be=de(oe),_e=pe?pe.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(pe.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:be}}:null;R.success(s("orgs.connections.connectedSuccessfully"),_e?{action:{label:s("orgs.connections.openConnection"),onClick:()=>r(_e)}}:void 0)}catch(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(Ft,{value:k.value,onValueChange:k.onChange,children:[t.jsx(Y,{children:t.jsx(Ut,{children:t.jsx(Vt,{})})}),t.jsxs(zt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"Websocket"]})}),i&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),o("orgs.connections.npxPackage")]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Rt,{className:"w-4 h-4"}),o("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),x==="NPX"&&t.jsx(q,{control:c.control,name:"npx_package",render:({field: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(Lt,{placeholder:o("orgs.connections.descriptionPlaceholder"),rows:3,...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),G=M;return l?t.jsx(wt,{open:G,onOpenChange:D,children:t.jsxs(At,{className:"max-h-[90vh]",children:[t.jsx(It,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Pt,{children:b}),t.jsx(Mt,{className:"mt-1",children:N})]}),t.jsx($t,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":o("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:X}),t.jsx(Ot,{children:t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:U})})]})})]})}):t.jsx(Ve,{open:G,onOpenChange: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 Us(){const o=W.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(qe,{children:t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Cn,{})})}),o[0]=e):e=o[0],e}export{Us as default};
|
|
1
|
+
import{r as z,c as W,b as te,j as t,B as E,h as ue,l as xe,G as ce,F as We,I as Xe,H as Ge,E as qe,X as ke,d as Te,u as Qe,a as we,R as Je,ad as 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-B_3mBk4y.js";import{a as Ae,g as it,e as ct}from"./extract-connection-data-CJFs5pw9.js";import{C as lt}from"./collection-display-button-D2q-ABWg.js";import{S as rt}from"./search-input-BjeWS4bC.js";import{C as at}from"./collection-tabs-DtGcsdTg.js";import{C as ve,u as Ie,g as dt}from"./connection-card-DvwNTHUt.js";import{E as ut}from"./empty-state-Cc-zeI-b.js";import{u as gt,D as mt}from"./use-delete-connection-nsQYmlH3.js";import{u as pt}from"./use-infinite-scroll-CgnPiJA2.js";import{u as Pe}from"./use-mobile-Cit5JQWz.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-AqvICzdc.js";import{au as je,A as bt,bu as _t,av as Nt,bb as Dt,p as ye}from"./agent-icon-B241PBKK.js";import{g as kt,a as Tt}from"./metadata-D72DunRR.js";import{d as Me,h as $e,c as Oe,e as Fe,b as Ue,D as Ve}from"./dialog-BR2W-zw-.js";import{D as wt,a as At,d as It,b as Pt,e as Mt,f as $t,g as Ot}from"./drawer-BuCU4dtF.js";import{F as q,b as Q,c as J,d as Y,f as Z,a as Ne}from"./form-vqBaFO9r.js";import{I as se}from"./input-B1N39T_Y.js";import{S as Ft,b as Ut,a as Vt,d as zt,c as ae}from"./select-MC8L6Y4s.js";import{T as Lt}from"./textarea-VVwww85B.js";import{b as ze,u as Et}from"./use-connection-CWXA50IZ.js";import{m as Bt}from"./use-mcp-client-B_ORPqL8.js";import{b as Kt}from"./repository-binding-DoGbZGqV.js";import{g as Ht}from"./types-BjX52uU5.js";import{s as Le}from"./Plus-DWABMn2e.js";import{c as Rt}from"./UserSquare-C-IZAmnp.js";import{s as Ee}from"./XClose-CigTCF4N.js";import{s as Wt}from"./use-project-scope-mDKXkaKI.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-BoZMz-Fx.js";import{a as Yt}from"./authenticate-and-persist-oauth-CkO9YCus.js";import{I as Zt}from"./integration-icon-DF1SWs0L.js";import{C as Be}from"./checkbox-BHKLlAci.js";import{i as en}from"./DotsVertical-BcY1zCnO.js";import{s as Ke}from"./Image01-BtlBqgq2.js";import{s as He}from"./Trash01-CZPHTYfi.js";import"./connection-CbXyxk_0.js";import"./ArrowUp-uu6L0oZa.js";import"./Check-BiHadeJU.js";import"./tooltip-A9lPSKit.js";import"./index-BOvE7Vou.js";import"./view-mode-toggle-chgrfj1u.js";import"./badge-D-X7jCCj.js";import"./SearchMd-df6Y7iRV.js";import"./useInfiniteQuery-CN5NPBR0.js";import"./infiniteQueryObserver-CBfG4TV-.js";import"./slugify-CEUa2lfQ.js";import"./AlertCircle-B1Wz6L5U.js";import"./Tool01-CXZVYCJV.js";import"./ArrowLeft-CecRcRxr.js";import"./ArrowRight-BSlT04qT.js";import"./ShoppingBag01-BzDsEvOc.js";import"./ZoomOut-CrIY1x34.js";import"./Palette-Dfwz_KK_.js";import"./CheckCircle-BbTEzozp.js";import"./ChevronUp-DMzxjk9Q.js";import"./Copy01-Z8h17W5V.js";import"./CreditCard01-BOXpMyZX.js";import"./Key01-Crwm5tIn.js";import"./Link01-BCM1zE5K.js";import"./LinkExternal01-BSjbzGPT.js";import"./Monitor01-Bu9itRvW.js";import"./Sun-CuJDC_V5.js";import"./Upload01-BhUTj6_2.js";import"./User01-BKQ4XDsb.js";import"./Users01-NFbjkK3Z.js";import"./X-Df5KdWXB.js";import"./label-CAMUAUyp.js";import"./auth-C0Awroma.js";import"./mcp-oauth-D4Ea-Fft.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=kt(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||Tt(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=>!!Ht(n._meta))?.name??null}:null}const an=3;function dn(o){const e=new Map;for(const n of o)for(const u of n.connections??[]){const s=e.get(u.connection_id)??[];s.push(n),e.set(u.connection_id,s)}return e}function un(o){const e=W.c(25),{projects:n}=o,u=te();if(n.length===0){let m;e[0]!==u?(m=u("projects.connections.orgWide"),e[0]=u,e[1]=m):m=e[1];let 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(bt,{icon:o.icon,name:o.title,size:"xs"})},o.id)}function Re(o){const e=W.c(8),{selectionMode:n,children:u}=o,s=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let i;e[0]!==s?(i=xe("overflow-hidden transition-all duration-150 ease-out",s),e[0]=s,e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(We,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:pn,children:t.jsx(en,{size:20})})}),e[2]=l):l=e[2];let r;e[3]!==u?(r=t.jsxs(Xe,{children:[l,t.jsx(Ge,{align:"end",onClick:mn,children:u})]}),e[3]=u,e[4]=r):r=e[4];let d;return e[5]!==i||e[6]!==r?(d=t.jsx("div",{className:i,children:r}),e[5]=i,e[6]=r,e[7]=d):d=e[7],d}function mn(o){return o.stopPropagation()}function pn(o){return o.stopPropagation()}function fn(o){const e=W.c(57),{group:n,onOpen:u,selectionMode:s,selectedIds:i,onToggleSelect:l}=o,r=te();let d;if(e[0]!==n.connections||e[1]!==i){let N;e[3]!==i?(N=U=>i.has(U.id),e[3]=i,e[4]=N):N=e[4],d=n.connections.every(N),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const 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(_t,{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(Nt,{size:16}),g("orgs.connectionSelectionUi.disable")]}):t.jsxs(ce,{onClick:T=>{T.stopPropagation(),h("active")},children:[t.jsx(Dt,{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=Et(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=Kt(),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(Bt({connectionId:ie,orgId:i.id,orgSlug:i.slug}));pe=rn((await re.listTools()).tools)}catch{}const be=de(oe),_e=pe?pe.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(pe.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:be}}:null;R.success(s("orgs.connections.connectedSuccessfully"),_e?{action:{label:s("orgs.connections.openConnection"),onClick:()=>r(_e)}}:void 0)}catch(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(Ft,{value:k.value,onValueChange:k.onChange,children:[t.jsx(Y,{children:t.jsx(Ut,{children:t.jsx(Vt,{})})}),t.jsxs(zt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"Websocket"]})}),i&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),o("orgs.connections.npxPackage")]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Rt,{className:"w-4 h-4"}),o("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),x==="NPX"&&t.jsx(q,{control:c.control,name:"npx_package",render:({field: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(Lt,{placeholder:o("orgs.connections.descriptionPlaceholder"),rows:3,...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),G=M;return l?t.jsx(wt,{open:G,onOpenChange:D,children:t.jsxs(At,{className:"max-h-[90vh]",children:[t.jsx(It,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Pt,{children:b}),t.jsx(Mt,{className:"mt-1",children:N})]}),t.jsx($t,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":o("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:X}),t.jsx(Ot,{children:t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:U})})]})})]})}):t.jsx(Ve,{open:G,onOpenChange: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 Us(){const o=W.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(qe,{children:t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Cn,{})})}),o[0]=e):e=o[0],e}export{Us as default};
|