decocms 4.401.0 → 4.401.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-D1gV07Oe.js → AlertCircle-B6v6clUp.js} +1 -1
- package/dist/client/assets/{AreaChart-lv4gftWl.js → AreaChart-DMVzNDEl.js} +1 -1
- package/dist/client/assets/{ArrowLeft-Bpb3sor7.js → ArrowLeft-DDW5by-5.js} +1 -1
- package/dist/client/assets/{ArrowRight-BFyYdKNd.js → ArrowRight-b4OSvT38.js} +1 -1
- package/dist/client/assets/{ArrowUp-COLR6KTW.js → ArrowUp-Cwnen55n.js} +1 -1
- package/dist/client/assets/{CartesianChart-CJGGumCB.js → CartesianChart-BfpVdm26.js} +1 -1
- package/dist/client/assets/{Check-C-Vn17o5.js → Check-BcWDZio0.js} +1 -1
- package/dist/client/assets/{CheckCircle-CyKBJceB.js → CheckCircle-MH252tOY.js} +1 -1
- package/dist/client/assets/{ChevronUp-Dto8qCq2.js → ChevronUp-zgSkYMxJ.js} +1 -1
- package/dist/client/assets/{Copy01-B2GuMU9Q.js → Copy01-B1NOvXZB.js} +1 -1
- package/dist/client/assets/{CreditCard01-CoMSE38C.js → CreditCard01-BZsA4Hwc.js} +1 -1
- package/dist/client/assets/{DotsVertical-R1tuLE9v.js → DotsVertical-Bl1hnuJi.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-viPSAyu4.js → ErrorBarContext-Cf0TgTnP.js} +1 -1
- package/dist/client/assets/{Eye-BhTmzCKr.js → Eye-BbaBeCZ5.js} +1 -1
- package/dist/client/assets/{Globe04-BLoVxWaz.js → Globe04-BKigapNa.js} +1 -1
- package/dist/client/assets/{Image01-D02_x5mu.js → Image01-w2ZWkVaa.js} +1 -1
- package/dist/client/assets/{Key01-BuudAO_W.js → Key01-DT2DLjDU.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CuG2yJZR.js → LayoutLeft-DmPeVi4U.js} +1 -1
- package/dist/client/assets/{Line-CsKmpStn.js → Line-B-z09LFG.js} +1 -1
- package/dist/client/assets/{Link01-CVUd8ZSz.js → Link01-CwAzoHCm.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Bo5cppL4.js → LinkExternal01-BVro7p0d.js} +1 -1
- package/dist/client/assets/{Monitor01-Cj93oSbT.js → Monitor01-BXGpB3DU.js} +1 -1
- package/dist/client/assets/{Palette-CEa7GqA9.js → Palette-p6gpXB43.js} +1 -1
- package/dist/client/assets/{Plus-Ch1uJBgh.js → Plus-CPRr8eLA.js} +1 -1
- package/dist/client/assets/{SearchMd-B_MXZ22A.js → SearchMd-DmrZ8tNb.js} +1 -1
- package/dist/client/assets/{Sector-CNfzRqjQ.js → Sector-DZC4A0lj.js} +1 -1
- package/dist/client/assets/{Share07-D6XgmppM.js → Share07-Cs13DReE.js} +1 -1
- package/dist/client/assets/{Sun-Dy_rDhHe.js → Sun-Cvn5rNir.js} +1 -1
- package/dist/client/assets/{Tool01-BoO1X0ZH.js → Tool01-Cc10eS4M.js} +1 -1
- package/dist/client/assets/{Trash01-D4CwdSy9.js → Trash01-BUFUahy8.js} +1 -1
- package/dist/client/assets/{Upload01-hQyKBWZL.js → Upload01-BYDz7chj.js} +1 -1
- package/dist/client/assets/{User01-gmEyKvLo.js → User01-jkNTFSxf.js} +1 -1
- package/dist/client/assets/{UserSquare-DXqYCX9F.js → UserSquare-BcjGTyJF.js} +1 -1
- package/dist/client/assets/{Users01-BBb4-Wbt.js → Users01-CnASZBXO.js} +1 -1
- package/dist/client/assets/{X-CEngH8b7.js → X-DMAiKm4q.js} +1 -1
- package/dist/client/assets/{XClose-Dvx_qcsQ.js → XClose-BNpVIYKH.js} +1 -1
- package/dist/client/assets/{Zap-DkS3ccHw.js → Zap-YBE6LDnX.js} +1 -1
- package/dist/client/assets/{ZoomOut-D3wne5dx.js → ZoomOut-BWWdIPu7.js} +1 -1
- package/dist/client/assets/{access-gate-D2mi3EXZ.js → access-gate-Ddqr1mvk.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-mm-WrmAR.js → add-connection-dialog-C9-7gsrE.js} +1 -1
- package/dist/client/assets/{agent-analytics-IX3kP91L.js → agent-analytics-C47FuCQZ.js} +1 -1
- package/dist/client/assets/agent-app-C7cXZ0kS.js +1 -0
- package/dist/client/assets/{agent-assets-BbU_YrcZ.js → agent-assets-CPvE-CBL.js} +1 -1
- package/dist/client/assets/{agent-automation-v13d06rk.js → agent-automation-CgzYkuuN.js} +1 -1
- package/dist/client/assets/{agent-automations-yzTI8Hoc.js → agent-automations--sI5vNnO.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-CEF4jbih.js → agent-connect-sources-D1bHyzQg.js} +1 -1
- package/dist/client/assets/agent-deck-Cw35maEW.js +1 -0
- package/dist/client/assets/{agent-e2e-SKpj9Qv7.js → agent-e2e-BxdoyeFi.js} +1 -1
- package/dist/client/assets/{agent-experiments-DPD7MHX9.js → agent-experiments-r7syzEaa.js} +1 -1
- package/dist/client/assets/{agent-file-CBIwfV0H.js → agent-file-Bm3BKmT9.js} +1 -1
- package/dist/client/assets/{agent-git-N-SzMySX.js → agent-git-Tbbx1T0C.js} +1 -1
- package/dist/client/assets/{agent-hosting-BnzsqBpZ.js → agent-hosting-CPcY-HOG.js} +1 -1
- package/dist/client/assets/{agent-icon-CjNFk4Bw.js → agent-icon-8fIO3moM.js} +1 -1
- package/dist/client/assets/agent-library-file-DldGDe9Y.js +1 -0
- package/dist/client/assets/{agent-monitor-BeURekaz.js → agent-monitor-C2Jao52C.js} +1 -1
- package/dist/client/assets/{agent-overview-By923wES.js → agent-overview-B6UPf1Up.js} +1 -1
- package/dist/client/assets/agent-settings-PqVZkvdc.js +1 -0
- package/dist/client/assets/{agent-site-editor-B7WR4KwZ.js → agent-site-editor-_6Tt0TKl.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-C-BuVqW6.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-CTyxs9-E.js → agent-site-editor-content-FXH4AYL7.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-Db1buU8G.js → agent-site-editor-preview-Badj2YHF.js} +3 -3
- package/dist/client/assets/agent-view-_8QAMrkV.js +1 -0
- package/dist/client/assets/{agent-view-guard-BpwecHVM.js → agent-view-guard-9U9HS2_t.js} +1 -1
- package/dist/client/assets/{agents-list-XIrdiWMz.js → agents-list-y7CUfAaF.js} +1 -1
- package/dist/client/assets/{ai-providers-CsYNRATt.js → ai-providers-DiqO8wdM.js} +1 -1
- package/dist/client/assets/{alert-BYraKSPm.js → alert-DGPx0aDu.js} +1 -1
- package/dist/client/assets/{alert-dialog-DpzgB-Ls.js → alert-dialog-mXuhGOeD.js} +1 -1
- package/dist/client/assets/{analytics-sections-C2rbPWDv.js → analytics-sections-DgI0FI3X.js} +1 -1
- package/dist/client/assets/api-keys-BMZKZiWC.js +1 -0
- package/dist/client/assets/{api-keys-CzlAuC7_.js → api-keys-CFmbWRSI.js} +1 -1
- package/dist/client/assets/app-editor-BZsVeaYh.js +1 -0
- package/dist/client/assets/{asset-utils-4p52RC3c.js → asset-utils-DCRQ2cUb.js} +1 -1
- package/dist/client/assets/{auth-catchall-DD401U-a.js → auth-catchall-LQUX4Het.js} +1 -1
- package/dist/client/assets/{auth-entry-CEr7Y2wf.js → auth-entry-qy2UOGAe.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DLRovWby.js → auth-split-layout-D9dYFtzN.js} +1 -1
- package/dist/client/assets/{auth-Dafjkfpj.js → auth-yECgQ-YG.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DIl2N_8B.js → authenticate-and-persist-oauth-Cdoq_uUT.js} +1 -1
- package/dist/client/assets/{automation-list-row-ueTfZfDa.js → automation-list-row-mdjfkD8U.js} +1 -1
- package/dist/client/assets/{automation-runs-iTxxsepZ.js → automation-runs-B5ioc_Ms.js} +1 -1
- package/dist/client/assets/{automations-Cad12Ows.js → automations-BiI3jWxV.js} +1 -1
- package/dist/client/assets/{autosend-DeYn5nkP.js → autosend-CBLCn5Df.js} +1 -1
- package/dist/client/assets/{avatar-B6HmPhM4.js → avatar-BWIF2BFh.js} +1 -1
- package/dist/client/assets/{badge-4kURMy-V.js → badge-MUYSitCi.js} +1 -1
- package/dist/client/assets/{block-document-CgGOvOyl.js → block-document-Caszzcw-.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-Bm8P7H4k.js → blocks-preview-workspace-context-C0MFUrPc.js} +1 -1
- package/dist/client/assets/{buckets-CK1WY8Rz.js → buckets-BrC8LnsU.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-BYdufdhy.js → build-improve-prompt-doc-HGUNWQ_n.js} +1 -1
- package/dist/client/assets/{calendar-CZsGTekl.js → calendar-BGSFNOk3.js} +1 -1
- package/dist/client/assets/{capability-load-error-CaE4aliY.js → capability-load-error-CjiWoJ39.js} +1 -1
- package/dist/client/assets/{cards-DaNm0Rmg.js → cards-BcbkVzXP.js} +1 -1
- package/dist/client/assets/{category-editor-CyFQk1RV.js → category-editor-D0xlnLlv.js} +1 -1
- package/dist/client/assets/{chart-_YADtzsN.js → chart-BAAxrEuW.js} +1 -1
- package/dist/client/assets/{chat-context-v9O7Tar9.js → chat-context-BiOtKn7P.js} +1 -1
- package/dist/client/assets/{chat-draft-BSL5UQWs.js → chat-draft-IKP3Bpj9.js} +1 -1
- package/dist/client/assets/{checkbox-BMxilLAm.js → checkbox-iCK8-YOo.js} +1 -1
- package/dist/client/assets/{choose-editor-TgQWBIvA.js → choose-editor-DRWnK3Kj.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-DHsomph6.js → claim-phase-copy-Yh04XZxP.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Bsu7TVxL.js → cli-auth-success-D9AMqFFP.js} +1 -1
- package/dist/client/assets/{client-icons-PiLBRjl7.js → client-icons-DLp3d5R1.js} +1 -1
- package/dist/client/assets/{collapsible-bc19817o.js → collapsible-CzA8-NMA.js} +1 -1
- package/dist/client/assets/{collection-detail-DpwCwzTH.js → collection-detail-Dhwx_szl.js} +1 -1
- package/dist/client/assets/{collection-display-button-BBRywDRf.js → collection-display-button-D4IBHGZc.js} +1 -1
- package/dist/client/assets/{collection-search-kj64tBFw.js → collection-search-BvnUba7J.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D2tmoW8T.js → collection-table-wrapper-DjKD0XJB.js} +1 -1
- package/dist/client/assets/{collection-tabs-DCLfzEOA.js → collection-tabs--W1A2Kno.js} +1 -1
- package/dist/client/assets/{combobox-DlQnH8_N.js → combobox-BdqfRWb0.js} +1 -1
- package/dist/client/assets/{command-vKgGCoFF.js → command-CzEVwgKB.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-Dpcawwvl.js → companion-mcps-section-DTCGaI6A.js} +1 -1
- package/dist/client/assets/{connect-Dick3000.js → connect-CT8jrV2P.js} +1 -1
- package/dist/client/assets/{connect-layout-BfLs3zCI.js → connect-layout-CYt4Oksg.js} +1 -1
- package/dist/client/assets/{connection-CTAV5crm.js → connection-BY8-KaA4.js} +1 -1
- package/dist/client/assets/{connection-card-DXWUKoxP.js → connection-card-B4bw8HCo.js} +1 -1
- package/dist/client/assets/{connection-detail-BsIDB4zB.js → connection-detail-DRVN8VC-.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BrejHCrx.js → connection-form-helpers-DMj6bxTF.js} +1 -1
- package/dist/client/assets/{connections-dBKfZKZY.js → connections-w9tEnUf-.js} +1 -1
- package/dist/client/assets/{context-VbsY_yj4.js → context-CiiTJRNN.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BCpMYw7e.js → create-organization-dialog-CStCZ29k.js} +1 -1
- package/dist/client/assets/{decofile-api-5Nr0-h_v.js → decofile-api-CTqqNPjg.js} +1 -1
- package/dist/client/assets/{decopilot-DlmPNMn_.js → decopilot-D-CvU-Yz.js} +1 -1
- package/dist/client/assets/{dialog-CEiE0rPQ.js → dialog-BGQjuyIa.js} +1 -1
- package/dist/client/assets/{discover-BvxkrONV.js → discover-CUaLN8h5.js} +1 -1
- package/dist/client/assets/{domain-settings-D1tynvCC.js → domain-settings-Bvt351cL.js} +1 -1
- package/dist/client/assets/{download-app-dialog-fmWolHKD.js → download-app-dialog-REdgjDQr.js} +1 -1
- package/dist/client/assets/{drawer-mNZA6mOf.js → drawer-B-c-ivso.js} +1 -1
- package/dist/client/assets/{editor-BGAJHie_.js → editor-DzPBGxM9.js} +1 -1
- package/dist/client/assets/{empty-state-BJxP56xq.js → empty-state-CzE4b4zD.js} +1 -1
- package/dist/client/assets/{empty-state-BgjUu2bT.js → empty-state-D4FOaSCM.js} +1 -1
- package/dist/client/assets/{extract-connection-data-erEsLv_0.js → extract-connection-data-D4h0y4EU.js} +1 -1
- package/dist/client/assets/{feature-gate-BdRUy7K_.js → feature-gate-BxoH2N-k.js} +1 -1
- package/dist/client/assets/{feature-paywall-Tj9HTPlX.js → feature-paywall-D1UvIJE8.js} +1 -1
- package/dist/client/assets/{file-explorer-0KdYuesc.js → file-explorer-L6D988ID.js} +1 -1
- package/dist/client/assets/{file-preview-i5I4Vmk2.js → file-preview-bVJ7RHCN.js} +1 -1
- package/dist/client/assets/{file-share-button-FS8XJyOj.js → file-share-button-X4sCk74v.js} +1 -1
- package/dist/client/assets/{file-type-icon-Cv10yXI0.js → file-type-icon-9ZD-EW4g.js} +1 -1
- package/dist/client/assets/{folder-icon-DJuQAXN-.js → folder-icon-BnECBWBk.js} +1 -1
- package/dist/client/assets/{form-CCT2OtgN.js → form-DTmMHLRx.js} +1 -1
- package/dist/client/assets/{gateway-client-hbsOo-al.js → gateway-client-BA28nWtn.js} +1 -1
- package/dist/client/assets/{general-B_HDEt1Q.js → general-Bwpt40AL.js} +1 -1
- package/dist/client/assets/{github-icon-BpCOzzV8.js → github-icon-D1YjVdXZ.js} +1 -1
- package/dist/client/assets/{home-CMRSzFNz.js → home-B5OFK-dy.js} +1 -1
- package/dist/client/assets/{hooks-CcmbiBeQ.js → hooks-DkDt1nFE.js} +1 -1
- package/dist/client/assets/{icon-button-B8KzCtPE.js → icon-button-YPSYZ_i4.js} +1 -1
- package/dist/client/assets/{index-DVgj8U7g.js → index-BExO8BBu.js} +1 -1
- package/dist/client/assets/{index-De5sr9zh.js → index-BjrR9kZj.js} +2 -2
- package/dist/client/assets/{index-BpvXUNGE.js → index-CFqXjwf4.js} +1 -1
- package/dist/client/assets/{index-CKZ6XrRd.js → index-CO4A8f3_.js} +1 -1
- package/dist/client/assets/{index-CGxhGPsv.js → index-CTVfZLyR.js} +1 -1
- package/dist/client/assets/{index-gldwodyc.js → index-CYxcU_1G.js} +1 -1
- package/dist/client/assets/{index-CDe2yrwT.js → index-CdjFDf_N.js} +1 -1
- package/dist/client/assets/{index-ClooW3Im.js → index-Cep3DlIQ.js} +1 -1
- package/dist/client/assets/{index-CWksyNR9.js → index-CujAxzYL.js} +1 -1
- package/dist/client/assets/{index-ldS2WUeM.js → index-DA-FmRbp.js} +1 -1
- package/dist/client/assets/{index-D_lD_4br.js → index-DSi-K9mm.js} +1 -1
- package/dist/client/assets/{index-bMw4G7-h.js → index-DhBFD4kx.js} +1 -1
- package/dist/client/assets/{index-BsLVRPrU.js → index-DoT72w42.js} +1 -1
- package/dist/client/assets/{index-Kwx27vNK.js → index-DvDGTSZO.js} +1 -1
- package/dist/client/assets/{index-redirect-CfY3ykU_.js → index-redirect-UZ8z6_9_.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CwgE9ndj.js → infiniteQueryObserver-DFZOc4R3.js} +1 -1
- package/dist/client/assets/{infra-billing-TzlPUT1_.js → infra-billing-CbcvcVow.js} +1 -1
- package/dist/client/assets/{input-CogQggtY.js → input-D4erz3OA.js} +1 -1
- package/dist/client/assets/{input-B-DIEGoS.js → input-DFe835A1.js} +1 -1
- package/dist/client/assets/{input-DMbK8B2u.js → input-DbKUv_Vw.js} +1 -1
- package/dist/client/assets/{integration-icon-CsYMgjoT.js → integration-icon-DpzEVv6e.js} +1 -1
- package/dist/client/assets/{label-Baft7ecp.js → label-68C0kM-R.js} +1 -1
- package/dist/client/assets/{last-preview-page-DkIjQnDn.js → last-preview-page-LzMfR51s.js} +1 -1
- package/dist/client/assets/{layout-CI3O4gkp.js → layout-P9Bd-jAm.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-BvWpwcOc.js → legacy-agents-deep-CVENV7ac.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-CQgWSIje.js → legacy-main-redirect-BdVZ82I_.js} +1 -1
- package/dist/client/assets/{library-CAwdTP4-.js → library-DJGGZ0Zy.js} +1 -1
- package/dist/client/assets/{login-DJ5PeYOE.js → login-BOm6626q.js} +1 -1
- package/dist/client/assets/{markdown-UaZeehfy.js → markdown-FaJSXz8c.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DVXFXjZU.js → mcp-app-renderer-Bcpidv6E.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DpJ1IX9I.js → mcp-oauth-BMxlsP2O.js} +1 -1
- package/dist/client/assets/{members-CXM5jx_X.js → members-BS5tCQVH.js} +1 -1
- package/dist/client/assets/{message-templates-54foej4h.js → message-templates-OWljVJD5.js} +1 -1
- package/dist/client/assets/{mini-report-page-B1sFW1ww.js → mini-report-page-BRlf5FN6.js} +1 -1
- package/dist/client/assets/{mock-board-BbS_eZEl.js → mock-board-BNj7oowZ.js} +3 -3
- package/dist/client/assets/{monaco-editor-B9FUV1NZ.js → monaco-editor-CZp4UVdz.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Cl5_OBZ5.js → monitoring-stats-row-Cbi53snE.js} +1 -1
- package/dist/client/assets/{multi-select-VDMM47xB.js → multi-select-CnlVdbwv.js} +1 -1
- package/dist/client/assets/{mustache-DZ4FV0Nc.js → mustache-Ca6JIIV3.js} +1 -1
- package/dist/client/assets/{oauth-callback-OoZf3jL0.js → oauth-callback-BeLO32vx.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-foDaIFwI.js → oauth-callback-ai-provider-BY8qEJVF.js} +1 -1
- package/dist/client/assets/{onboarding-Dq71FOpN.js → onboarding-BtAEKL_6.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-CgB8Gy1s.js → optimistic-project-sidebar-views-Dd7Kmc6p.js} +1 -1
- package/dist/client/assets/{org-file-open-context-Mx8jC4-P.js → org-file-open-context-dfBXT7MO.js} +1 -1
- package/dist/client/assets/{organization-choice-ZqNf00EY.js → organization-choice-BF8PizrV.js} +1 -1
- package/dist/client/assets/{orgs-B8y0HHqF.js → orgs-DhSyLRvs.js} +1 -1
- package/dist/client/assets/{page-seo-form-DPObRKD4.js → page-seo-form-CkLwkYBd.js} +1 -1
- package/dist/client/assets/{pair-D39JYx1G.js → pair-CI7mZS0g.js} +1 -1
- package/dist/client/assets/{plan-ladder-D85oNnSr.js → plan-ladder-BHP-xahB.js} +1 -1
- package/dist/client/assets/{popover-DCaw39mN.js → popover-Bfdv1gl-.js} +1 -1
- package/dist/client/assets/{post-calendar-Dpixo2IP.js → post-calendar-C-FAL0Ry.js} +1 -1
- package/dist/client/assets/{post-editor-BivV74bZ.js → post-editor-CqQXYpr7.js} +1 -1
- package/dist/client/assets/{preview-content-ziDhpr9V.js → preview-content-CbqQjhni.js} +1 -1
- package/dist/client/assets/{preview-dialog-DHJShsrA.js → preview-dialog-CDG9haxV.js} +1 -1
- package/dist/client/assets/{profile-C9xI3KvS.js → profile-D8cs-pPc.js} +1 -1
- package/dist/client/assets/{project-app-view-CFWAaKq_.js → project-app-view-CwbZ9tdF.js} +1 -1
- package/dist/client/assets/{project-feed-D6D6bSHY.js → project-feed-DiRf7mLY.js} +1 -1
- package/dist/client/assets/{project-icon-CXM68zVZ.js → project-icon-Cr4yXuUg.js} +1 -1
- package/dist/client/assets/project-reports-Dlwv4gmO.js +1 -0
- package/dist/client/assets/project-tasks-DSsmEYDA.js +1 -0
- package/dist/client/assets/{prompts-CVNAEIJB.js → prompts-amdxWtkw.js} +1 -1
- package/dist/client/assets/record-editor-BeMREyAi.js +1 -0
- package/dist/client/assets/{redirect-editor-Dy1UJRrv.js → redirect-editor-vEh44rPX.js} +1 -1
- package/dist/client/assets/{reports-BvZHk8Hk.js → reports-BRTUu7pH.js} +2 -2
- package/dist/client/assets/reports-BxBXnK7L.js +1 -0
- package/dist/client/assets/{reports-BnLE7A3p.css → reports-aVRaDDaG.css} +1 -1
- package/dist/client/assets/{reports-onboarding-D4Uaui5Y.js → reports-onboarding-D3OrRvWJ.js} +1 -1
- package/dist/client/assets/{reports-tab-CwwTWlIS.js → reports-tab-BxNOl98V.js} +2 -2
- package/dist/client/assets/{repositories-CqbcdDdH.js → repositories-Ckb6ekqQ.js} +1 -1
- package/dist/client/assets/{repository-import-picker-BXQhU82J.js → repository-import-picker-BAZ9mPpT.js} +1 -1
- package/dist/client/assets/{repository-picker-D1hSYB_G.js → repository-picker-D-TogGEt.js} +1 -1
- package/dist/client/assets/{require-capability-Cab5QyjH.js → require-capability-BVjtMA1J.js} +1 -1
- package/dist/client/assets/{required-auth-layout-scRrBHKS.js → required-auth-layout-DY_cdaIx.js} +1 -1
- package/dist/client/assets/{reset-password-CDE1iX3h.js → reset-password-CsZF9Bi0.js} +1 -1
- package/dist/client/assets/{resizable-D2L182YF.js → resizable-BtDH_0Vi.js} +1 -1
- package/dist/client/assets/{review-settings-B98rLFs_.js → review-settings-hRNYkWVc.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-DwRx0-0K.js → rich-text-link-control-DJRcgLMd.js} +1 -1
- package/dist/client/assets/{roles-CZvYgdUZ.js → roles-Dtk1kJXW.js} +1 -1
- package/dist/client/assets/{route-N926-QRJ.js → route-4WMSVXXz.js} +1 -1
- package/dist/client/assets/{route-B9TApoqS.js → route-DVw-1wdo.js} +1 -1
- package/dist/client/assets/{route-OKy5_TxY.js → route-Hbxv89X2.js} +1 -1
- package/dist/client/assets/{route-page-header-ErgCCo2N.js → route-page-header-BWvRqVR5.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-C2YphDcL.js → runnable-block-editor-B-NGtP-T.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-o4KKoGrI.js → sandbox-lifecycle-context-ir4poExj.js} +1 -1
- package/dist/client/assets/{schema-DkZUkArz.js → schema-DR6HLXFs.js} +1 -1
- package/dist/client/assets/{scroll-area-Ca9Mo_QH.js → scroll-area-C2I8c9NJ.js} +1 -1
- package/dist/client/assets/{search-input-DRWRYRPs.js → search-input-CFuVSdCR.js} +1 -1
- package/dist/client/assets/{search-toggle-B5FB44XX.js → search-toggle--L0X1zt3.js} +1 -1
- package/dist/client/assets/{secret-picker-DLap6vTC.js → secret-picker-DvWxSNYJ.js} +1 -1
- package/dist/client/assets/{secrets-jZp-bTCf.js → secrets-lxuA8lGZ.js} +1 -1
- package/dist/client/assets/{sections-editor-BFbkxXEt.js → sections-editor-BrJtbdMq.js} +1 -1
- package/dist/client/assets/{select-BZ6sktb7.js → select-DfRa6U-n.js} +1 -1
- package/dist/client/assets/{select-model-BIWsu5PV.js → select-model-U4Dqa8Dd.js} +1 -1
- package/dist/client/assets/{seo-editor-PDlEaSFK.js → seo-editor-DHpSeEA1.js} +1 -1
- package/dist/client/assets/{separator-D_UVaWw6.js → separator-D2OxZy8p.js} +1 -1
- package/dist/client/assets/{settings-tab-BBHI-Kul.js → settings-tab-C7fwvrln.js} +1 -1
- package/dist/client/assets/{sheet-Kja83qKC.js → sheet-CBJ9Lsc2.js} +1 -1
- package/dist/client/assets/{shell-layout-ynqF32RZ.js → shell-layout-CVhVAInm.js} +1 -1
- package/dist/client/assets/{skill-preview-BjeMKh94.js → skill-preview-dfvgyHwB.js} +1 -1
- package/dist/client/assets/{skills-BVNUFN8s.js → skills-zNDBdjJd.js} +1 -1
- package/dist/client/assets/{sso-CbvzPnGh.js → sso-CuKtRutW.js} +1 -1
- package/dist/client/assets/{suggestion-DMGPIg87.js → suggestion-ns0qv0uQ.js} +1 -1
- package/dist/client/assets/{switch-CSgTLkLq.js → switch-tss5J5qD.js} +1 -1
- package/dist/client/assets/{synced-repos-DkDa4E03.js → synced-repos-2hWPuLjw.js} +1 -1
- package/dist/client/assets/{table-BNlBwUw8.js → table-CAWKNKxB.js} +1 -1
- package/dist/client/assets/{tabs-DWl7SNDG.js → tabs-Ct12da-2.js} +1 -1
- package/dist/client/assets/{task-board-C6TTBmRS.js → task-board-D00YvbAx.js} +1 -1
- package/dist/client/assets/{task-route-Bz3woGSP.js → task-route-DA0R3nvt.js} +1 -1
- package/dist/client/assets/{task-status-CnFMIlt_.js → task-status-BFvj4FVC.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-DoJw1Xfg.js → taskboard-analytics-B4f7NdY4.js} +1 -1
- package/dist/client/assets/{tasks-Cqz8mQiU.js → tasks-DSHLXRfJ.js} +1 -1
- package/dist/client/assets/tasks-Dv8B8TKy.js +1 -0
- package/dist/client/assets/{textarea-CufiKBr1.js → textarea-DcUTXKBn.js} +1 -1
- package/dist/client/assets/{thread-analytics-CC-_zVgm.js → thread-analytics-Br9oWS6c.js} +1 -1
- package/dist/client/assets/{thread-button-Ds-0KssI.js → thread-button-D9YdtqqV.js} +1 -1
- package/dist/client/assets/{thread-intent-rbLXiRX-.js → thread-intent-Dk6BvhGr.js} +1 -1
- package/dist/client/assets/{thread-route-D_-4E_Qa.js → thread-route-DtaqqUc8.js} +1 -1
- package/dist/client/assets/{thread-route-B3__WRb1.js → thread-route-V1sEHiBY.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-C6Nvo-gY.js → thread-sheet-body-28PK5CVb.js} +1 -1
- package/dist/client/assets/{toggle-group-CEb1zCbt.js → toggle-group-BN_nhcbs.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-B7ENG3u2.js → toolbar-icon-button-dJwApEoN.js} +1 -1
- package/dist/client/assets/{tooltip-Bdu4_ay-.js → tooltip-a6VXOqQI.js} +1 -1
- package/dist/client/assets/{track-DYcNrkYj.js → track-DIm5D0FO.js} +1 -1
- package/dist/client/assets/{types-C1lh-7rD.js → types-CuuumKKW.js} +1 -1
- package/dist/client/assets/{usage-stats-C8kdutYl.js → usage-stats-C7Cj3ABB.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DdvmCGxF.js → use-ai-providers-OcKKapmz.js} +1 -1
- package/dist/client/assets/{use-automations-By-N-e6c.js → use-automations-CTWHi6sW.js} +1 -1
- package/dist/client/assets/{use-autosave-tkO4DMDZ.js → use-autosave-C4kWhwdX.js} +1 -1
- package/dist/client/assets/{use-connect-companion-CRgCDVPT.js → use-connect-companion-d9HKC-0k.js} +1 -1
- package/dist/client/assets/{use-connection-CzhqmkxY.js → use-connection-C8UZsu8O.js} +1 -1
- package/dist/client/assets/{use-copy-D35bNj5j.js → use-copy-o2njqteO.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DSS6KW-Y.js → use-create-virtual-mcp-CeoevsEt.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-B65-a3KP.js → use-date-fns-locale-B8wxfqnW.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-UCDN4Lw3.js → use-debounced-autosave-BPjq0zWT.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CWshbX7F.js → use-debounced-value-B18TIcGd.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DTu_Qf20.js → use-deco-credits-CgEDwdqQ.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BvKgG5Ws.js → use-decopilot-events-DAkmyAjs.js} +1 -1
- package/dist/client/assets/{use-delete-connection-1XhxmMPF.js → use-delete-connection-B1tYA8Rp.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DMXwbJU8.js → use-deployment-admin-CQsyen5K.js} +1 -1
- package/dist/client/assets/{use-entitlements-Da1bmf67.js → use-entitlements-DWdxlnxk.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-C7L3VsQn.js → use-fast-preview-draft-url-B1UgW16r.js} +1 -1
- package/dist/client/assets/{use-file-configs-C7xVU8E2.js → use-file-configs-D3FQo26s.js} +1 -1
- package/dist/client/assets/{use-in-settings-icIKIpSR.js → use-in-settings-GZqf01My.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-7-m4dXi3.js → use-infinite-scroll-BPlWiH_j.js} +1 -1
- package/dist/client/assets/{use-join-requests-D_x3dmzZ.js → use-join-requests-CbTCJ0RQ.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-B5g6e1MJ.js → use-main-panel-tabs-Box7rwH3.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-nDkEwx2c.js → use-mcp-auth-status-DVw_h1d5.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CkjkRUta.js → use-mcp-client-_RtWTLxt.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-D2XJcis0.js → use-mcp-prompts-DeRVqq5E.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DZlo67bQ.js → use-mcp-tools-DCl_jTFW.js} +1 -1
- package/dist/client/assets/{use-members-CdPjttiy.js → use-members-6K9R1oBQ.js} +1 -1
- package/dist/client/assets/{use-mobile-DVMuGaln.js → use-mobile-DN-7qwao.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BCcYux8q.js → use-navigate-to-agent-D1O3uESn.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-CJn1G7pV.js → use-open-billing-url-BVcQWIPf.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-D8dxsLtj.js → use-org-auth-client-BxtjYe6u.js} +1 -1
- package/dist/client/assets/{use-org-fs-3jzMRDSK.js → use-org-fs-DORLuh0o.js} +1 -1
- package/dist/client/assets/{use-org-sso-Bb_2_N0Z.js → use-org-sso-CFSNXhow.js} +1 -1
- package/dist/client/assets/{use-organization-roles-ixSaPxG5.js → use-organization-roles-BkeY_qOu.js} +1 -1
- package/dist/client/assets/{use-organization-settings-B0mobgxG.js → use-organization-settings-BxxGkCBh.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-CjSWJCy4.js → use-panel-navigate-fIPDxYtj.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-_PPun-xm.js → use-project-native-view-presence-qb6mZmmd.js} +1 -1
- package/dist/client/assets/{use-project-scope-CJnr8HCi.js → use-project-scope-DnsWGMAI.js} +1 -1
- package/dist/client/assets/{use-releases-CT-nVxtd.js → use-releases-BOEFTfGN.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-AsJIEIvt.js → use-reports-diagnostic-Bk5i3iRe.js} +1 -1
- package/dist/client/assets/{use-route-default-main-CQGz2KW9.js → use-route-default-main-CgrCIrJm.js} +1 -1
- package/dist/client/assets/{use-secrets-DgNcVRY9.js → use-secrets-B2ml5euf.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-mIL7vKdH.js → use-section-preview-base-CYzrmMH8.js} +1 -1
- package/dist/client/assets/{use-session-runtime-B9eFlXyW.js → use-session-runtime-BSZZ8HIC.js} +1 -1
- package/dist/client/assets/{use-tags-BM82Yu0K.js → use-tags-QXuvcG5w.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-D_ruF5p9.js → use-task-board-analytics-CgBHstM8.js} +1 -1
- package/dist/client/assets/{use-task-metadata-qZ-qzNT-.js → use-task-metadata-DSs-EmG9.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-BcEpZDI1.js → use-thread-analytics-Bsk1DFKA.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-CIF4-tq_.js → use-thread-outputs-C8be3K3D.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BKP1YfD8.js → use-virtual-mcp-BHM7_O3U.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BBFjBKxn.js +1 -0
- package/dist/client/assets/{useQueries-CbuhlNe5.js → useQueries-lLlYiC7p.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-xG_Af635.js +1 -0
- package/dist/client/assets/{users-CDy-vhRi.js → users-D4wAQwHR.js} +1 -1
- package/dist/client/assets/{utils-VRidfAJX.js → utils-C4OWYF9w.js} +1 -1
- package/dist/client/assets/{variant-calendar-C5Yhhu_f.js → variant-calendar-B6gLK3az.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-NRDTBNQG.js → variant-matcher-override-zacKGhFx.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-P-VmNhrj.js → view-mode-toggle-DSuJIM_N.js} +1 -1
- package/dist/client/assets/{virtual-mcp-DXr1jTLu.js → virtual-mcp-IurQ91Dd.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +266 -266
- package/dist/server/server.js +239 -239
- package/package.json +1 -1
- package/dist/client/assets/agent-app-CliE0mM3.js +0 -1
- package/dist/client/assets/agent-deck-rRdXFIQU.js +0 -1
- package/dist/client/assets/agent-library-file-DHUyHSwO.js +0 -1
- package/dist/client/assets/agent-settings-DiYW6DT3.js +0 -1
- package/dist/client/assets/agent-site-editor-code-A3lMFnBk.js +0 -2
- package/dist/client/assets/agent-view-Ct7YMMW7.js +0 -1
- package/dist/client/assets/api-keys-B9Lt-UrM.js +0 -1
- package/dist/client/assets/app-editor-tD7rn_1-.js +0 -1
- package/dist/client/assets/project-reports-8SYQbI2J.js +0 -1
- package/dist/client/assets/project-tasks-DrEyprGU.js +0 -1
- package/dist/client/assets/record-editor-CKxwz78L.js +0 -1
- package/dist/client/assets/reports-DyvsxSR9.js +0 -1
- package/dist/client/assets/tasks-CIdMsSLJ.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DhVx-Xnv.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CB90sByh.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{an as ve,bO as Oe,bP as Me,ao as de,bN as ze,c as U,b as V,j as t,h as Ne,B,r as Z,l as Se,X as te,a3 as Ee,D as me,K as ee,d as se,p as ye,ak as Ce,eK as Re,n as Ue,f3 as ue,R as Fe,I as Ve,F as Le,H as Be,G as xe,E as qe,f as Ge,fd as He,o as Ke,am as Qe,al as Xe,t as J}from"./index-De5sr9zh.js";import{g as We}from"./extract-connection-data-erEsLv_0.js";import{E as _e}from"./empty-state-BJxP56xq.js";import{E as Ye,c as Je,r as Ze,b as et,d as tt}from"./connection-form-helpers-BrejHCrx.js";import{c as st,S as nt,D as it}from"./index-BsLVRPrU.js";import{u as we,T as ot}from"./use-mcp-auth-status-nDkEwx2c.js";import{a as at}from"./use-members-CdPjttiy.js";import{A as lt}from"./avatar-B6HmPhM4.js";import{a as Ie,b as ke,u as rt}from"./use-connection-CzhqmkxY.js";import{u as Te}from"./use-mcp-client-CkjkRUta.js";import{u as ct}from"./use-mcp-tools-DZlo67bQ.js";import{a as dt}from"./use-mcp-prompts-D2XJcis0.js";import{i as mt,a as ut}from"./mcp-oauth-DpJ1IX9I.js";import{I as ae}from"./integration-icon-CsYMgjoT.js";import{s as xt}from"./Plus-Ch1uJBgh.js";import{b4 as pt,at as ft,Q as ht,bq as gt,l as ne,as as jt}from"./agent-icon-CjNFk4Bw.js";import{a as Ae,f as bt,s as vt}from"./Tool01-BoO1X0ZH.js";import{s as re}from"./Trash01-D4CwdSy9.js";import{b as Nt,a as St,c as yt,S as Ct,d as _t}from"./sheet-Kja83qKC.js";import{F as G,b as H,c as K,d as L,f as Q,e as wt,a as It}from"./form-CCT2OtgN.js";import{I as W}from"./input-B-DIEGoS.js";import{u as kt,D as Tt}from"./use-delete-connection-1XhxmMPF.js";import{c as At,B as Pt,a as Dt,C as $t}from"./monitoring-stats-row-Cl5_OBZ5.js";import{b as Ot,c as Mt,d as zt}from"./chart-_YADtzsN.js";import{b as Et}from"./use-virtual-mcp-BKP1YfD8.js";import{T as ie,a as Rt,c as oe,b as Ut}from"./tabs-DWl7SNDG.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{g as ce}from"./types-C1lh-7rD.js";import{M as Ft}from"./mcp-app-renderer-DVXFXjZU.js";import{C as Vt}from"./collection-search-kj64tBFw.js";import{B as Lt}from"./badge-4kURMy-V.js";import{S as pe,b as fe,a as he,d as ge,c as q}from"./select-BZ6sktb7.js";import{i as Bt}from"./CheckCircle-CyKBJceB.js";import{t as qt}from"./ChevronUp-Dto8qCq2.js";import{b as Gt}from"./UserSquare-DXqYCX9F.js";import{s as Ht}from"./XClose-Dvx_qcsQ.js";import{p as Kt,i as Qt}from"./connection-CTAV5crm.js";import"./metadata-D72DunRR.js";import"./Key01-BuudAO_W.js";import"./auth-Dafjkfpj.js";import"./index-gldwodyc.js";import"./index-CDe2yrwT.js";import"./index-Kwx27vNK.js";import"./popover-DCaw39mN.js";import"./tooltip-Bdu4_ay-.js";import"./index-DVgj8U7g.js";import"./Check-C-Vn17o5.js";import"./SearchMd-B_MXZ22A.js";import"./use-mobile-DVMuGaln.js";import"./use-create-virtual-mcp-DSS6KW-Y.js";import"./use-navigate-to-agent-BCcYux8q.js";import"./hooks-CcmbiBeQ.js";import"./backoff-8mStPHYB.js";import"./task-board-C6TTBmRS.js";import"./schema-DkZUkArz.js";import"./thread-intent-rbLXiRX-.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BknN0SVI.js";import"./Eye-BhTmzCKr.js";import"./use-org-auth-client-D8dxsLtj.js";import"./User01-gmEyKvLo.js";import"./AlertCircle-D1gV07Oe.js";import"./ArrowUp-COLR6KTW.js";import"./ArrowLeft-Bpb3sor7.js";import"./ArrowRight-BFyYdKNd.js";import"./ZoomOut-D3wne5dx.js";import"./Globe04-BLoVxWaz.js";import"./Copy01-B2GuMU9Q.js";import"./CreditCard01-CoMSE38C.js";import"./DotsVertical-R1tuLE9v.js";import"./Share07-D6XgmppM.js";import"./Image01-D02_x5mu.js";import"./LayoutLeft-CuG2yJZR.js";import"./Link01-CVUd8ZSz.js";import"./LinkExternal01-Bo5cppL4.js";import"./Monitor01-Cj93oSbT.js";import"./Sun-Dy_rDhHe.js";import"./Palette-CEa7GqA9.js";import"./Upload01-hQyKBWZL.js";import"./Users01-BBb4-Wbt.js";import"./X-CEngH8b7.js";import"./Zap-DkS3ccHw.js";import"./label-Baft7ecp.js";import"./alert-dialog-DpzgB-Ls.js";import"./CartesianChart-CJGGumCB.js";import"./AreaChart-lv4gftWl.js";import"./ErrorBarContext-viPSAyu4.js";import"./Sector-CNfzRqjQ.js";const Xt=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:Xt}];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 C;e[17]!==n||e[18]!==m||e[19]!==a||e[20]!==o?(C=m&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=m,e[19]=a,e[20]=o,e[21]=C):C=e[21];let _;e[22]!==n||e[23]!==p||e[24]!==l||e[25]!==o?(_=p?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(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]=_):_=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let w;e[30]!==o?(w=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=w):w=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Ae,{size:13}),e[34]=A):A=e[34];let O;e[35]!==$||e[36]!==w||e[37]!==M?(O=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:w,"aria-label":M,children:A}),e[35]=$,e[36]=w,e[37]=M,e[38]=O):O=e[38];let k;e[39]!==n||e[40]!==i?(k=()=>i(n),e[39]=n,e[40]=i,e[41]=k):k=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let b;e[44]!==o?(b=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(re,{size:13}),e[46]=E):E=e[46];let z;e[47]!==k||e[48]!==v||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:k,title:v,"aria-label":b,children:E}),e[47]=k,e[48]=v,e[49]=b,e[50]=z):z=e[50];let I;e[51]!==O||e[52]!==z||e[53]!==C||e[54]!==_?(I=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[C,_,O,z]}),e[51]=O,e[52]=z,e[53]=C,e[54]=_,e[55]=I):I=e[55];let P;return e[56]!==I||e[57]!==h||e[58]!==g||e[59]!==y?(P=t.jsxs("div",{className:h,children:[g,y,I]}),e[56]=I,e[57]=h,e[58]=g,e[59]=y,e[60]=P):P=e[60],P}function 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 C;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(C=_=>t.jsx(Z.Suspense,{fallback:t.jsx(Jt,{instance:_,onConfigure:c}),children:t.jsx(Yt,{instance:_,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},_.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=C):C=e[27],j=n.map(C),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let S;e[28]!==j?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=S):S=e[29];let y;return e[30]!==g||e[31]!==S?(y=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=y):y=e[32],y}function 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=At(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(Ot,{config:ns,className:"h-16 w-full",children:t.jsxs(Pt,{data:m,barCategoryGap:"4%",children:[t.jsx(Mt,{content:t.jsx(zt,{labelFormatter:ls}),cursor:{fill:"var(--muted)"}}),t.jsx(Dt,{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($t,{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(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==o||e[13]!==r?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,d]}),e[11]=i,e[12]=o,e[13]=r,e[14]=u):u=e[14],u}function 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=Et(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=Ie(c);let m;e[4]!==u||e[5]!==c?(m=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=m):m=e[6];const p=m,[x,h]=Z.useState("");let g,j,S,y;if(e[7]!==p||e[8]!==d||e[9]!==l||e[10]!==a||e[11]!==x||e[12]!==i||e[13]!==n){const $=(n??[]).filter(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 k;e[22]!==i?(k=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=k):k=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=v):v=e[24],e[25]!==x||e[26]!==k?(y=t.jsx(Vt,{value:x,onChange:h,placeholder:k,onKeyDown:v}),e[25]=x,e[26]=k,e[27]=y):y=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(_e,{image:null,title:i(x?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(x?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>O(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Ft,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.annotations?.title??b.name}),t.jsx(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 C;e[28]!==g||e[29]!==j?(C=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=C):C=e[30];let _;return e[31]!==S||e[32]!==y||e[33]!==C?(_=t.jsxs("div",{className:S,children:[y,C]}),e[31]=S,e[32]=y,e[33]=C,e[34]=_):_=e[34],_}function 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=Ie(i??"");let p;e[0]!==m||e[1]!==i?(p=m?Pe(m):i,e[0]=m,e[1]=i,e[2]=p):p=e[2];const x=p;let h;e[3]!==x||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(T){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:x,collectionName:"tools",itemId:encodeURIComponent(T)}})},e[3]=x,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(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 X;return e[20]!==T||e[21]!==F?(X=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[T,F]}),e[20]=T,e[21]=F,e[22]=X):X=e[22],X}let C;e[23]!==d||e[24]!==n.length?(C=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=C):C=e[25];let _;e[26]!==C?(_=t.jsx(ie,{value:"tools",variant:"underline",children:C}),e[26]=C,e[27]=_):_=e[27];let $;e[28]!==S||e[29]!==d?($=S&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=S,e[29]=d,e[30]=$):$=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let M;e[33]!==w?(M=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=M):M=e[34];let A;e[35]!==d?(A=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=A):A=e[36];let O;e[37]!==A?(O=t.jsx(ie,{value:"resources",variant:"underline",children:A}),e[37]=A,e[38]=O):O=e[38];let k;e[39]!==M||e[40]!==O||e[41]!==_||e[42]!==$?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Rt,{variant:"underline",className:"gap-1",children:[_,$,M,O]})}),e[39]=M,e[40]=O,e[41]=_,e[42]=$,e[43]=k):k=e[43];let v;e[44]!==g||e[45]!==n?(v=n.length>0?n.map(N=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>g(N.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(bt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},N.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=v):v=e[46];let b;e[47]!==v?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:v})}),e[47]=v,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==S||e[51]!==l||e[52]!==n?(E=S&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(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 I;e[56]!==z?(I=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=I):I=e[57];let P;e[58]!==r?(P=r.length>0?r.map(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]!==k||e[63]!==b||e[64]!==E||e[65]!==I||e[66]!==R?(f=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Ut,{defaultValue:"tools",variant:"underline",children:[k,b,E,I,R]})}),e[62]=k,e[63]=b,e[64]=E,e[65]=I,e[66]=R,e[67]=f):f=e[67],f}function 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(gt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function 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(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: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(G,{control:s.control,name:"ui_type",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(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(q,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(q,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(q,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(q,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(G,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(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(q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Gt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(Q,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(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(Q,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Ye,{value:x.value??[],onChange:x.onChange})}),t.jsx(Q,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ve,{children:[t.jsx(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(qt,{size:12})]})})}),t.jsxs(Be,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(vt,{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(wt,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(Q,{})]})})]})}function 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"&&Qt(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 Cs(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=tt(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function _s({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=ke(),{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:C}=at(),_=C?.data?.members??[],$=h??s,w=_.find(f=>f.userId===$.created_by),A=s?.connection_type==="VIRTUAL"||y.isAuthenticated,O={...s,tools:a},k=st(O,Wt),v=Qe({resolver:Xe(Je),values:be(h??s)}),b=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const N=v.getValues(),T=Cs(N),D=h?.id??e;await m.update.mutateAsync({id:D,data:T}),v.reset(N)},z=()=>{v.reset(be(h??s))},I=async f=>{const N=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:T,tokenInfo:D,error: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 X=new URL(`/api/${p.slug}/mcp/${f}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(X.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},P=()=>I(s.id),R=async()=>{try{const f=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!f.ok){const T=await f.text();J.error(r("details.connection.failedRemoveOAuth",{error:T}));return}const N=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(N.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(f){console.error("Error removing OAuth token:",f),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(Tt,{...x}),t.jsx(Nt,{open:h!==null,onOpenChange:f=>{f||g(null)},children:t.jsxs(St,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(yt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(Ct,{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(It,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(G,{control:v.control,name:"title",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(W,{...f})}),t.jsx(Q,{})]})}),t.jsx(G,{control:v.control,name:"description",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(W,{...f,value:f.value||""})}),t.jsx(Q,{})]})})]}),t.jsx(vs,{form:v,connection:h??s,hasOAuthToken:y.hasOAuthToken,onReauthenticate:P,onRemoveOAuth:R}),t.jsx(nt,{connection:h??s,form:v,hasMcpBinding:k,isMCPAuthenticated:A,supportsOAuth:y.supportsOAuth,isServerError:y.isServerError,onAuthenticate:P,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const f=h??s;g(null),x.requestDelete(f)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(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=>I(f.id),onDelete:f=>x.requestDelete(f),onToggleStatus:async(f,N)=>{try{await m.update.mutateAsync({id:f.id,data:{status:N}}),J.success(r(N==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{S(!0);try{const f=o[0]??s,N=f.title.replace(/\s*\(\d+\)\s*$/,""),T=o.length+1,D=`${N} (${T})`,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,status:"inactive"});const X=new URL(`/api/${p.slug}/mcp/${F}`,window.location.origin),Y=await mt({url:X.href,token:null,orgId:p.id});Y.supportsOAuth&&!Y.isAuthenticated&&await I(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}=Ge(a),{org:o}=te(),r=ke();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=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 I=S?S.tools.map(Ds):(m?.tools??[]).map(Ps);e:{if(u.length<=1){y=I;break e}const P=new Set,R=[],f=Ts;for(const N of u){const T=N.id===p?I:f(N.tools);for(const D of T)P.has(D.name)||(P.add(D.name),R.push(D))}y=R.length>0?R:I}s[10]=m?.tools,s[11]=p,s[12]=u,s[13]=S,s[14]=y}else y=s[14];const C=y;let _;s[15]!==g?(_={client:g},s[15]=g,s[16]=_):_=s[16];const{data:$}=dt(_);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(ks),s[21]=A,s[22]=O):O=s[22];const k=O;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let b;s[25]!==v?(b=v.map(Is),s[25]=v,s[26]=b):b=s[26];const E=b;if(!m){let I;s[27]!==e?(I=e("details.connection.notFoundTitle"),s[27]=e,s[28]=I):I=s[28];let P;s[29]!==e?(P=e("details.connection.notFoundDescription"),s[29]=e,s[30]=P):P=s[30];let R;s[31]!==c||s[32]!==l?(R=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=R):R=s[33];let f;s[34]!==e?(f=e("details.connection.backButton"),s[34]=e,s[35]=f):f=s[35];let N;s[36]!==R||s[37]!==f?(N=t.jsx(B,{variant:"outline",onClick:R,children:f}),s[36]=R,s[37]=f,s[38]=N):N=s[38];let T;return s[39]!==I||s[40]!==P||s[41]!==N?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(_e,{title:I,description:P,actions:N})}),s[39]=I,s[40]=P,s[41]=N,s[42]=T):T=s[42],T}let z;return s[43]!==r.update.isPending||s[44]!==C||s[45]!==m||s[46]!==p||s[47]!==l||s[48]!==k||s[49]!==E||s[50]!==u?(z=t.jsx(_s,{org:l,connection:m,connectionId:p,isUpdating:r.update.isPending,tools:C,prompts:k,resources:E,siblings:u}),s[43]=r.update.isPending,s[44]=C,s[45]=m,s[46]=p,s[47]=l,s[48]=k,s[49]=E,s[50]=u,s[51]=z):z=s[51],z}function Is(s){return{name:s.name,description:s.description,uri:s.uri}}function ks(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(qe,{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 fi(){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{fi as default};
|
|
1
|
+
import{an as ve,bO as Oe,bP as Me,ao as de,bN as ze,c as U,b as V,j as t,h as Ne,B,r as Z,l as Se,X as te,a3 as Ee,D as me,K as ee,d as se,p as ye,ak as Ce,eK as Re,n as Ue,f3 as ue,R as Fe,I as Ve,F as Le,H as Be,G as xe,E as qe,f as Ge,fd as He,o as Ke,am as Qe,al as Xe,t as J}from"./index-BjrR9kZj.js";import{g as We}from"./extract-connection-data-D4h0y4EU.js";import{E as _e}from"./empty-state-CzE4b4zD.js";import{E as Ye,c as Je,r as Ze,b as et,d as tt}from"./connection-form-helpers-DMj6bxTF.js";import{c as st,S as nt,D as it}from"./index-DoT72w42.js";import{u as we,T as ot}from"./use-mcp-auth-status-DVw_h1d5.js";import{a as at}from"./use-members-6K9R1oBQ.js";import{A as lt}from"./avatar-BWIF2BFh.js";import{a as Ie,b as ke,u as rt}from"./use-connection-C8UZsu8O.js";import{u as Te}from"./use-mcp-client-_RtWTLxt.js";import{u as ct}from"./use-mcp-tools-DCl_jTFW.js";import{a as dt}from"./use-mcp-prompts-DeRVqq5E.js";import{i as mt,a as ut}from"./mcp-oauth-BMxlsP2O.js";import{I as ae}from"./integration-icon-DpzEVv6e.js";import{s as xt}from"./Plus-CPRr8eLA.js";import{b4 as pt,at as ft,Q as ht,bq as gt,l as ne,as as jt}from"./agent-icon-8fIO3moM.js";import{a as Ae,f as bt,s as vt}from"./Tool01-Cc10eS4M.js";import{s as re}from"./Trash01-BUFUahy8.js";import{b as Nt,a as St,c as yt,S as Ct,d as _t}from"./sheet-CBJ9Lsc2.js";import{F as G,b as H,c as K,d as L,f as Q,e as wt,a as It}from"./form-DTmMHLRx.js";import{I as W}from"./input-DFe835A1.js";import{u as kt,D as Tt}from"./use-delete-connection-B1tYA8Rp.js";import{c as At,B as Pt,a as Dt,C as $t}from"./monitoring-stats-row-Cbi53snE.js";import{b as Ot,c as Mt,d as zt}from"./chart-BAAxrEuW.js";import{b as Et}from"./use-virtual-mcp-BHM7_O3U.js";import{T as ie,a as Rt,c as oe,b as Ut}from"./tabs-Ct12da-2.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{g as ce}from"./types-CuuumKKW.js";import{M as Ft}from"./mcp-app-renderer-Bcpidv6E.js";import{C as Vt}from"./collection-search-BvnUba7J.js";import{B as Lt}from"./badge-MUYSitCi.js";import{S as pe,b as fe,a as he,d as ge,c as q}from"./select-DfRa6U-n.js";import{i as Bt}from"./CheckCircle-MH252tOY.js";import{t as qt}from"./ChevronUp-zgSkYMxJ.js";import{b as Gt}from"./UserSquare-BcjGTyJF.js";import{s as Ht}from"./XClose-BNpVIYKH.js";import{p as Kt,i as Qt}from"./connection-BY8-KaA4.js";import"./metadata-D72DunRR.js";import"./Key01-DT2DLjDU.js";import"./auth-yECgQ-YG.js";import"./index-CYxcU_1G.js";import"./index-CdjFDf_N.js";import"./index-DvDGTSZO.js";import"./popover-Bfdv1gl-.js";import"./tooltip-a6VXOqQI.js";import"./index-BExO8BBu.js";import"./Check-BcWDZio0.js";import"./SearchMd-DmrZ8tNb.js";import"./use-mobile-DN-7qwao.js";import"./use-create-virtual-mcp-CeoevsEt.js";import"./use-navigate-to-agent-D1O3uESn.js";import"./hooks-DkDt1nFE.js";import"./backoff-8mStPHYB.js";import"./task-board-D00YvbAx.js";import"./schema-DR6HLXFs.js";import"./thread-intent-Dk6BvhGr.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BknN0SVI.js";import"./Eye-BbaBeCZ5.js";import"./use-org-auth-client-BxtjYe6u.js";import"./User01-jkNTFSxf.js";import"./AlertCircle-B6v6clUp.js";import"./ArrowUp-Cwnen55n.js";import"./ArrowLeft-DDW5by-5.js";import"./ArrowRight-b4OSvT38.js";import"./ZoomOut-BWWdIPu7.js";import"./Globe04-BKigapNa.js";import"./Copy01-B1NOvXZB.js";import"./CreditCard01-BZsA4Hwc.js";import"./DotsVertical-Bl1hnuJi.js";import"./Share07-Cs13DReE.js";import"./Image01-w2ZWkVaa.js";import"./LayoutLeft-DmPeVi4U.js";import"./Link01-CwAzoHCm.js";import"./LinkExternal01-BVro7p0d.js";import"./Monitor01-BXGpB3DU.js";import"./Sun-Cvn5rNir.js";import"./Palette-p6gpXB43.js";import"./Upload01-BYDz7chj.js";import"./Users01-CnASZBXO.js";import"./X-DMAiKm4q.js";import"./Zap-YBE6LDnX.js";import"./label-68C0kM-R.js";import"./alert-dialog-mXuhGOeD.js";import"./CartesianChart-BfpVdm26.js";import"./AreaChart-DMVzNDEl.js";import"./ErrorBarContext-Cf0TgTnP.js";import"./Sector-DZC4A0lj.js";const Xt=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:Xt}];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 C;e[17]!==n||e[18]!==m||e[19]!==a||e[20]!==o?(C=m&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=m,e[19]=a,e[20]=o,e[21]=C):C=e[21];let _;e[22]!==n||e[23]!==p||e[24]!==l||e[25]!==o?(_=p?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(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]=_):_=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let w;e[30]!==o?(w=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=w):w=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Ae,{size:13}),e[34]=A):A=e[34];let O;e[35]!==$||e[36]!==w||e[37]!==M?(O=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:w,"aria-label":M,children:A}),e[35]=$,e[36]=w,e[37]=M,e[38]=O):O=e[38];let k;e[39]!==n||e[40]!==i?(k=()=>i(n),e[39]=n,e[40]=i,e[41]=k):k=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let b;e[44]!==o?(b=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(re,{size:13}),e[46]=E):E=e[46];let z;e[47]!==k||e[48]!==v||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:k,title:v,"aria-label":b,children:E}),e[47]=k,e[48]=v,e[49]=b,e[50]=z):z=e[50];let I;e[51]!==O||e[52]!==z||e[53]!==C||e[54]!==_?(I=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[C,_,O,z]}),e[51]=O,e[52]=z,e[53]=C,e[54]=_,e[55]=I):I=e[55];let P;return e[56]!==I||e[57]!==h||e[58]!==g||e[59]!==y?(P=t.jsxs("div",{className:h,children:[g,y,I]}),e[56]=I,e[57]=h,e[58]=g,e[59]=y,e[60]=P):P=e[60],P}function 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 C;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(C=_=>t.jsx(Z.Suspense,{fallback:t.jsx(Jt,{instance:_,onConfigure:c}),children:t.jsx(Yt,{instance:_,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},_.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=C):C=e[27],j=n.map(C),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let S;e[28]!==j?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=S):S=e[29];let y;return e[30]!==g||e[31]!==S?(y=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=y):y=e[32],y}function 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=At(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(Ot,{config:ns,className:"h-16 w-full",children:t.jsxs(Pt,{data:m,barCategoryGap:"4%",children:[t.jsx(Mt,{content:t.jsx(zt,{labelFormatter:ls}),cursor:{fill:"var(--muted)"}}),t.jsx(Dt,{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($t,{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(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==o||e[13]!==r?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,d]}),e[11]=i,e[12]=o,e[13]=r,e[14]=u):u=e[14],u}function 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=Et(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=Ie(c);let m;e[4]!==u||e[5]!==c?(m=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=m):m=e[6];const p=m,[x,h]=Z.useState("");let g,j,S,y;if(e[7]!==p||e[8]!==d||e[9]!==l||e[10]!==a||e[11]!==x||e[12]!==i||e[13]!==n){const $=(n??[]).filter(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 k;e[22]!==i?(k=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=k):k=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=v):v=e[24],e[25]!==x||e[26]!==k?(y=t.jsx(Vt,{value:x,onChange:h,placeholder:k,onKeyDown:v}),e[25]=x,e[26]=k,e[27]=y):y=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(_e,{image:null,title:i(x?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(x?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>O(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Ft,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.annotations?.title??b.name}),t.jsx(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 C;e[28]!==g||e[29]!==j?(C=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=C):C=e[30];let _;return e[31]!==S||e[32]!==y||e[33]!==C?(_=t.jsxs("div",{className:S,children:[y,C]}),e[31]=S,e[32]=y,e[33]=C,e[34]=_):_=e[34],_}function 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=Ie(i??"");let p;e[0]!==m||e[1]!==i?(p=m?Pe(m):i,e[0]=m,e[1]=i,e[2]=p):p=e[2];const x=p;let h;e[3]!==x||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(T){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:x,collectionName:"tools",itemId:encodeURIComponent(T)}})},e[3]=x,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(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 X;return e[20]!==T||e[21]!==F?(X=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[T,F]}),e[20]=T,e[21]=F,e[22]=X):X=e[22],X}let C;e[23]!==d||e[24]!==n.length?(C=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=C):C=e[25];let _;e[26]!==C?(_=t.jsx(ie,{value:"tools",variant:"underline",children:C}),e[26]=C,e[27]=_):_=e[27];let $;e[28]!==S||e[29]!==d?($=S&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=S,e[29]=d,e[30]=$):$=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let M;e[33]!==w?(M=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=M):M=e[34];let A;e[35]!==d?(A=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=A):A=e[36];let O;e[37]!==A?(O=t.jsx(ie,{value:"resources",variant:"underline",children:A}),e[37]=A,e[38]=O):O=e[38];let k;e[39]!==M||e[40]!==O||e[41]!==_||e[42]!==$?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Rt,{variant:"underline",className:"gap-1",children:[_,$,M,O]})}),e[39]=M,e[40]=O,e[41]=_,e[42]=$,e[43]=k):k=e[43];let v;e[44]!==g||e[45]!==n?(v=n.length>0?n.map(N=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>g(N.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(bt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},N.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=v):v=e[46];let b;e[47]!==v?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:v})}),e[47]=v,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==S||e[51]!==l||e[52]!==n?(E=S&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(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 I;e[56]!==z?(I=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=I):I=e[57];let P;e[58]!==r?(P=r.length>0?r.map(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]!==k||e[63]!==b||e[64]!==E||e[65]!==I||e[66]!==R?(f=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Ut,{defaultValue:"tools",variant:"underline",children:[k,b,E,I,R]})}),e[62]=k,e[63]=b,e[64]=E,e[65]=I,e[66]=R,e[67]=f):f=e[67],f}function 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(gt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function 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(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: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(G,{control:s.control,name:"ui_type",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(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(q,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(q,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(q,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(q,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(G,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(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(q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Gt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(Q,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(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(Q,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Ye,{value:x.value??[],onChange:x.onChange})}),t.jsx(Q,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ve,{children:[t.jsx(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(qt,{size:12})]})})}),t.jsxs(Be,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(vt,{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(wt,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(Q,{})]})})]})}function 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"&&Qt(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 Cs(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=tt(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function _s({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=ke(),{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:C}=at(),_=C?.data?.members??[],$=h??s,w=_.find(f=>f.userId===$.created_by),A=s?.connection_type==="VIRTUAL"||y.isAuthenticated,O={...s,tools:a},k=st(O,Wt),v=Qe({resolver:Xe(Je),values:be(h??s)}),b=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const N=v.getValues(),T=Cs(N),D=h?.id??e;await m.update.mutateAsync({id:D,data:T}),v.reset(N)},z=()=>{v.reset(be(h??s))},I=async f=>{const N=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:T,tokenInfo:D,error: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 X=new URL(`/api/${p.slug}/mcp/${f}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(X.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},P=()=>I(s.id),R=async()=>{try{const f=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!f.ok){const T=await f.text();J.error(r("details.connection.failedRemoveOAuth",{error:T}));return}const N=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(N.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(f){console.error("Error removing OAuth token:",f),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(Tt,{...x}),t.jsx(Nt,{open:h!==null,onOpenChange:f=>{f||g(null)},children:t.jsxs(St,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(yt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(Ct,{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(It,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(G,{control:v.control,name:"title",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(W,{...f})}),t.jsx(Q,{})]})}),t.jsx(G,{control:v.control,name:"description",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(W,{...f,value:f.value||""})}),t.jsx(Q,{})]})})]}),t.jsx(vs,{form:v,connection:h??s,hasOAuthToken:y.hasOAuthToken,onReauthenticate:P,onRemoveOAuth:R}),t.jsx(nt,{connection:h??s,form:v,hasMcpBinding:k,isMCPAuthenticated:A,supportsOAuth:y.supportsOAuth,isServerError:y.isServerError,onAuthenticate:P,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const f=h??s;g(null),x.requestDelete(f)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(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=>I(f.id),onDelete:f=>x.requestDelete(f),onToggleStatus:async(f,N)=>{try{await m.update.mutateAsync({id:f.id,data:{status:N}}),J.success(r(N==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{S(!0);try{const f=o[0]??s,N=f.title.replace(/\s*\(\d+\)\s*$/,""),T=o.length+1,D=`${N} (${T})`,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,status:"inactive"});const X=new URL(`/api/${p.slug}/mcp/${F}`,window.location.origin),Y=await mt({url:X.href,token:null,orgId:p.id});Y.supportsOAuth&&!Y.isAuthenticated&&await I(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}=Ge(a),{org:o}=te(),r=ke();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=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 I=S?S.tools.map(Ds):(m?.tools??[]).map(Ps);e:{if(u.length<=1){y=I;break e}const P=new Set,R=[],f=Ts;for(const N of u){const T=N.id===p?I:f(N.tools);for(const D of T)P.has(D.name)||(P.add(D.name),R.push(D))}y=R.length>0?R:I}s[10]=m?.tools,s[11]=p,s[12]=u,s[13]=S,s[14]=y}else y=s[14];const C=y;let _;s[15]!==g?(_={client:g},s[15]=g,s[16]=_):_=s[16];const{data:$}=dt(_);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(ks),s[21]=A,s[22]=O):O=s[22];const k=O;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let b;s[25]!==v?(b=v.map(Is),s[25]=v,s[26]=b):b=s[26];const E=b;if(!m){let I;s[27]!==e?(I=e("details.connection.notFoundTitle"),s[27]=e,s[28]=I):I=s[28];let P;s[29]!==e?(P=e("details.connection.notFoundDescription"),s[29]=e,s[30]=P):P=s[30];let R;s[31]!==c||s[32]!==l?(R=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=R):R=s[33];let f;s[34]!==e?(f=e("details.connection.backButton"),s[34]=e,s[35]=f):f=s[35];let N;s[36]!==R||s[37]!==f?(N=t.jsx(B,{variant:"outline",onClick:R,children:f}),s[36]=R,s[37]=f,s[38]=N):N=s[38];let T;return s[39]!==I||s[40]!==P||s[41]!==N?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(_e,{title:I,description:P,actions:N})}),s[39]=I,s[40]=P,s[41]=N,s[42]=T):T=s[42],T}let z;return s[43]!==r.update.isPending||s[44]!==C||s[45]!==m||s[46]!==p||s[47]!==l||s[48]!==k||s[49]!==E||s[50]!==u?(z=t.jsx(_s,{org:l,connection:m,connectionId:p,isUpdating:r.update.isPending,tools:C,prompts:k,resources:E,siblings:u}),s[43]=r.update.isPending,s[44]=C,s[45]=m,s[46]=p,s[47]=l,s[48]=k,s[49]=E,s[50]=u,s[51]=z):z=s[51],z}function Is(s){return{name:s.name,description:s.description,uri:s.uri}}function ks(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(qe,{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 fi(){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{fi as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{an as R,bO as A,bP as I,ao as o,bN as j,bM as z,c as L,j as u,B as C}from"./index-
|
|
1
|
+
import{an as R,bO as A,bP as I,ao as o,bN as j,bM as z,c as L,j as u,B as C}from"./index-BjrR9kZj.js";import{I as H}from"./input-DFe835A1.js";import{s as W}from"./Plus-CPRr8eLA.js";import{s as q}from"./Trash01-BUFUahy8.js";const K=R({key:o().min(1,"Key is required"),value:o()}),G=R({title:o().min(1,"Name is required"),description:o().nullable().optional(),icon:o().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:o().optional(),connection_token:o().nullable().optional(),npx_package:o().optional(),stdio_command:o().optional(),stdio_args:o().optional(),stdio_cwd:o().optional(),env_vars:j(K).optional(),configuration_scopes:j(o()).nullable().optional(),configuration_state:A(o(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]}).refine(n=>(n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket")&&n.connection_url?.trim()?o().url().safeParse(n.connection_url.trim()).success:!0,{message:"Enter a valid URL",path:["connection_url"]});function O(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(i=>e.includes(i))||["sk_","rk_","whsec_","pk_live","sk_live"].some(i=>e.startsWith(i))||["_key","_secret","_token","_password","_auth","_pat"].some(i=>e.endsWith(i)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:i,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=i===void 0?"value...":i;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,s)=>s!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:p,value:c.value},r(s))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const g=P;let T;e[9]!==r||e[10]!==t?(T=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:c.key,value:p},r(s))},e[9]=r,e[10]=t,e[11]=T):T=e[11];const k=T;let f;if(e[12]!==g||e[13]!==y||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==g||e[20]!==y||e[21]!==k||e[22]!==m||e[23]!==h?(l=(p,s)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>g(s,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:O(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(s,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(s),children:u.jsx(q,{size:16})})]},s),e[19]=g,e[20]=y,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=g,e[13]=y,e[14]=k,e[15]=m,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(W,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==S?(d=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[w,"Add Environment Variable"]}),e[26]=S,e[27]=d):d=e[27];let _;e[28]!==f||e[29]!==d?(_=u.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=_):_=e[30];let E;return e[31]!==v||e[32]!==_?(E=u.jsx("div",{className:v,children:_}),e[31]=v,e[32]=_,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const a=e.slice(1).find(i=>!i.startsWith("-"));return a?{packageName:a}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(i=>(i.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",a=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:a}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const i=V(r);return Object.keys(i).length>0&&(a.envVars=i),a}export{X as E,J as a,Q as b,G as c,Z as d,Y as i,F as p,D as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as L,c as W,b as te,j as t,B as E,h as de,l as fe,G as ie,F as Re,I as We,H as Xe,E as Ge,X as Ne,d as ke,u as qe,a as Te,R as Qe,ac as ye,U as Je,V as Ye,am as Ze,al as et,n as pe,q as ee,o as tt,a3 as nt,t as R,K as st}from"./index-De5sr9zh.js";import{a as we,g as ot,e as it}from"./extract-connection-data-erEsLv_0.js";import{C as ct}from"./collection-display-button-BBRywDRf.js";import{S as lt}from"./search-input-DRWRYRPs.js";import{C as rt}from"./collection-tabs-DCLfzEOA.js";import{C as Ce,u as Ae,g as at}from"./connection-card-DXWUKoxP.js";import{E as dt}from"./empty-state-BJxP56xq.js";import{u as ut,D as gt}from"./use-delete-connection-1XhxmMPF.js";import{u as mt}from"./use-infinite-scroll-7-m4dXi3.js";import{u as Ie}from"./use-mobile-DVMuGaln.js";import{g as ae}from"./connection-slug-CITJ0kGN.js";import{A as pt,a as ht,b as ft,c as xt,g as jt,d as St,e as yt,f as Ct}from"./alert-dialog-DpzgB-Ls.js";import{as as xe,bp as vt,at as bt,b4 as _t,l as Se}from"./agent-icon-CjNFk4Bw.js";import{g as Dt,a as Nt}from"./metadata-D72DunRR.js";import{d as Pe,h as Me,c as $e,e as Oe,b as Fe,D as Ue}from"./dialog-CEiE0rPQ.js";import{D as kt,a as Tt,d as wt,b as At,e as It,f as Pt,g as Mt}from"./drawer-mNZA6mOf.js";import{F as G,b as q,c as Q,d as J,f as Y,a as _e}from"./form-CCT2OtgN.js";import{I as ne}from"./input-B-DIEGoS.js";import{S as $t,b as Ot,a as Ft,d as Ut,c as re}from"./select-BZ6sktb7.js";import{T as Vt}from"./textarea-CufiKBr1.js";import{b as Ve,u as zt}from"./use-connection-CzhqmkxY.js";import{m as Lt}from"./use-mcp-client-CkjkRUta.js";import{b as Et}from"./use-virtual-mcp-BKP1YfD8.js";import{g as Bt}from"./types-C1lh-7rD.js";import{s as ze}from"./Plus-Ch1uJBgh.js";import{b as Kt}from"./UserSquare-DXqYCX9F.js";import{s as Le}from"./XClose-Dvx_qcsQ.js";import{i as he,a as De,E as Ht,c as Rt,p as Wt,b as Xt,d as Gt}from"./connection-form-helpers-BrejHCrx.js";import{a as qt}from"./authenticate-and-persist-oauth-DIl2N_8B.js";import{I as Qt}from"./integration-icon-CsYMgjoT.js";import{C as Ee}from"./checkbox-BMxilLAm.js";import{i as Jt}from"./DotsVertical-R1tuLE9v.js";import{s as Be}from"./Eye-BhTmzCKr.js";import{s as Ke}from"./Trash01-D4CwdSy9.js";import"./connection-CTAV5crm.js";import"./ArrowUp-COLR6KTW.js";import"./Check-C-Vn17o5.js";import"./tooltip-Bdu4_ay-.js";import"./index-DVgj8U7g.js";import"./view-mode-toggle-P-VmNhrj.js";import"./badge-4kURMy-V.js";import"./SearchMd-B_MXZ22A.js";import"./useInfiniteQuery-DhVx-Xnv.js";import"./infiniteQueryObserver-CwgE9ndj.js";import"./slugify-CEUa2lfQ.js";import"./AlertCircle-D1gV07Oe.js";import"./Tool01-BoO1X0ZH.js";import"./ArrowLeft-Bpb3sor7.js";import"./ArrowRight-BFyYdKNd.js";import"./ZoomOut-D3wne5dx.js";import"./Globe04-BLoVxWaz.js";import"./CheckCircle-CyKBJceB.js";import"./ChevronUp-Dto8qCq2.js";import"./Copy01-B2GuMU9Q.js";import"./CreditCard01-CoMSE38C.js";import"./Share07-D6XgmppM.js";import"./Image01-D02_x5mu.js";import"./Key01-BuudAO_W.js";import"./LayoutLeft-CuG2yJZR.js";import"./Link01-CVUd8ZSz.js";import"./LinkExternal01-Bo5cppL4.js";import"./Monitor01-Cj93oSbT.js";import"./Sun-Dy_rDhHe.js";import"./Palette-CEa7GqA9.js";import"./Upload01-hQyKBWZL.js";import"./User01-gmEyKvLo.js";import"./Users01-BBb4-Wbt.js";import"./X-CEngH8b7.js";import"./Zap-DkS3ccHw.js";import"./label-Baft7ecp.js";import"./auth-Dafjkfpj.js";import"./mcp-oauth-DpJ1IX9I.js";function Yt(s){const e=`deco-filters-${s}`,[n,u]=L.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 Zt(s){const e=W.c(7),[n,u]=L.useState(s),[o,i]=L.useState(s?"desc":null);let l;e[0]!==o||e[1]!==n?(l=f=>{n!==f?(u(f),i("asc")):o==="asc"?i("desc"):o==="desc"&&(u(void 0),i(null))},e[0]=o,e[1]=n,e[2]=l):l=e[2];const a=l;let d;return e[3]!==a||e[4]!==o||e[5]!==n?(d={sortKey:n,sortDirection:o,handleSort:a},e[3]=a,e[4]=o,e[5]=n,e[6]=d):d=e[6],d}function en(s,e){const n=W.c(12),u=e===void 0?"cards":e,o=Ie(),i=L.useRef(o),l=s?`deco-view-mode-${s}`:"deco-view-mode";let a;n[0]!==u||n[1]!==l?(a=()=>{const x=globalThis.localStorage?.getItem(l);return x==="cards"||x==="table"?x:u},n[0]=u,n[1]=l,n[2]=a):a=n[2];const[d,f]=L.useState(a);let j;n[3]!==l?(j=x=>{f(x),globalThis.localStorage?.setItem(l,x)},n[3]=l,n[4]=j):j=n[4];const g=j;let r,h;n[5]!==o||n[6]!==d?(r=()=>{!i.current&&o&&d==="table"&&f("cards"),i.current=o},h=[o,d],n[5]=o,n[6]=d,n[7]=r,n[8]=h):(r=n[7],h=n[8]),L.useEffect(r,h);let m;return n[9]!==g||n[10]!==d?(m=[d,g],n[9]=g,n[10]=d,n[11]=m):m=n[11],m}function tn(s){const e=W.c(20),{namespace:n,resource:u,defaultSortKey:o,defaultViewMode:i}=s,l=o===void 0?"title":o,a=i===void 0?"table":i,[d,f]=L.useState(""),j=L.useDeferredValue(d),g=`${n}-${u}`,[r,h]=Yt(g),m=`studio-${u}-filter-visible-${n}`;let x;e[0]!==m?(x=()=>globalThis.localStorage?.getItem(m)==="true",e[0]=m,e[1]=x):x=e[1];const[S,v]=L.useState(x);let y;e[2]!==m?(y=O=>{v(O),globalThis.localStorage?.setItem(m,String(O))},e[2]=m,e[3]=y):y=e[3];const c=y;let p;e[4]!==S||e[5]!==c?(p=()=>{c(!S)},e[4]=S,e[5]=c,e[6]=p):p=e[6];const T=p,[k,w]=en(`studio-${u}-${n}`,a),{sortKey:A,sortDirection:$,handleSort:P}=Zt(l),M=A;let I;return e[7]!==S||e[8]!==r||e[9]!==P||e[10]!==d||e[11]!==j||e[12]!==c||e[13]!==h||e[14]!==w||e[15]!==$||e[16]!==M||e[17]!==T||e[18]!==k?(I={search:d,searchTerm:j,setSearch:f,filters:r,setFilters:h,filterBarVisible:S,setFilterBarVisible:c,toggleFilterBar:T,viewMode:k,setViewMode:w,sortKey:M,sortDirection:$,handleSort:P},e[7]=S,e[8]=r,e[9]=P,e[10]=d,e[11]=j,e[12]=c,e[13]=h,e[14]=w,e[15]=$,e[16]=M,e[17]=T,e[18]=k,e[19]=I):I=e[19],I}function nn(s){const e=W.c(35),{open:n,onOpenChange:u,count:o,onConfirm:i}=s,l=te(),a=o===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==o||e[1]!==l||e[2]!==a?(d=l(a,{count:o}),e[0]=o,e[1]=l,e[2]=a,e[3]=d):d=e[3];let f;e[4]!==d?(f=t.jsx(pt,{children:d}),e[4]=d,e[5]=f):f=e[5];const j=o===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let g;e[6]!==l||e[7]!==j?(g=l(j),e[6]=l,e[7]=j,e[8]=g):g=e[8];let r;e[9]!==g?(r=t.jsx(ht,{children:g}),e[9]=g,e[10]=r):r=e[10];let h;e[11]!==f||e[12]!==r?(h=t.jsxs(ft,{children:[f,r]}),e[11]=f,e[12]=r,e[13]=h):h=e[13];let m;e[14]!==l?(m=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=m):m=e[15];let x;e[16]!==m?(x=t.jsx(xt,{children:m}),e[16]=m,e[17]=x):x=e[17];const S=o===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let v;e[18]!==o||e[19]!==l||e[20]!==S?(v=l(S,{count:o}),e[18]=o,e[19]=l,e[20]=S,e[21]=v):v=e[21];let y;e[22]!==i||e[23]!==v?(y=t.jsx(jt,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:v}),e[22]=i,e[23]=v,e[24]=y):y=e[24];let c;e[25]!==y||e[26]!==x?(c=t.jsxs(St,{children:[x,y]}),e[25]=y,e[26]=x,e[27]=c):c=e[27];let p;e[28]!==c||e[29]!==h?(p=t.jsxs(yt,{children:[h,c]}),e[28]=c,e[29]=h,e[30]=p):p=e[30];let T;return e[31]!==u||e[32]!==n||e[33]!==p?(T=t.jsx(Ct,{open:n,onOpenChange:u,children:p}),e[31]=u,e[32]=n,e[33]=p,e[34]=T):T=e[34],T}function sn(s){const e=W.c(39),{item:n,canManage:u,allConnections:o,connectedAppNames:i,connectingItemId:l,onNavigateConnected:a,onConnect:d}=s,f=te();let j,g;e[0]!==i||e[1]!==n?(j=we(n)??"",g=i.has(j),e[0]=i,e[1]=n,e[2]=j,e[3]=g):(j=e[2],g=e[3]);const r=g;let h;e[4]!==n._meta?(h=Dt(n._meta),e[4]=n._meta,e[5]=h):h=e[5];const m=h,x=m?.friendlyName||m?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",S=n.server?.description||n.description||null;let v;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(v=n.server?.icons?.[0]?.src||Nt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=v):v=e[8];const y=v;let c;if(e[9]!==o||e[10]!==j){let U;e[12]!==j?(U=b=>b.connection_type!=="VIRTUAL"&&b.app_name===j,e[12]=j,e[13]=U):U=e[13],c=o.filter(U),e[9]=o,e[10]=j,e[11]=c}else c=e[11];const p=c,T=r||u;let k,w;e[14]!==p||e[15]!==r||e[16]!==n||e[17]!==d||e[18]!==a?(k=()=>{if(r){const U=p[0];U&&a(U);return}w()},w=()=>d(n),e[14]=p,e[15]=r,e[16]=n,e[17]=d,e[18]=a,e[19]=k,e[20]=w):(k=e[19],w=e[20]);let A;e[21]!==S||e[22]!==y||e[23]!==x?(A={title:x,description:S,icon:y},e[21]=S,e[22]=y,e[23]=x,e[24]=A):A=e[24];let $;e[25]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(xe,{}),e[25]=$):$=e[25];const P=T?k:void 0;let M;e[26]!==u||e[27]!==l||e[28]!==w||e[29]!==r||e[30]!==n.id||e[31]!==f?(M=r?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:f("orgs.catalogItemCard.connected")}):u&&t.jsx(E,{variant:"outline",size:"sm",className:"h-7 px-3 text-sm font-medium",disabled:l!==null,onClick:U=>{U.stopPropagation(),w()},children:l===n.id?t.jsx(de,{className:"size-3.5"}):f("orgs.catalogItemCard.connect")}),e[26]=u,e[27]=l,e[28]=w,e[29]=r,e[30]=n.id,e[31]=f,e[32]=M):M=e[32];let I;e[33]!==M?(I=t.jsx("div",{className:"flex items-center gap-2",children:M}),e[33]=M,e[34]=I):I=e[34];let O;return e[35]!==A||e[36]!==P||e[37]!==I?(O=t.jsx(Ce,{connection:A,fallbackIcon:$,onClick:P,headerActionsAlwaysVisible:!0,headerActions:I}),e[35]=A,e[36]=P,e[37]=I,e[38]=O):O=e[38],O}function on(s){return s?.length?{appToolName:s.find(n=>!!Bt(n._meta))?.name??null}:null}function He(s){const e=W.c(8),{selectionMode:n,children:u}=s,o=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let i;e[0]!==o?(i=fe("overflow-hidden transition-all duration-150 ease-out",o),e[0]=o,e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Re,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ln,children:t.jsx(Jt,{size:20})})}),e[2]=l):l=e[2];let a;e[3]!==u?(a=t.jsxs(We,{children:[l,t.jsx(Xe,{align:"end",onClick:cn,children:u})]}),e[3]=u,e[4]=a):a=e[4];let d;return e[5]!==i||e[6]!==a?(d=t.jsx("div",{className:i,children:a}),e[5]=i,e[6]=a,e[7]=d):d=e[7],d}function cn(s){return s.stopPropagation()}function ln(s){return s.stopPropagation()}function rn(s){const e=W.c(57),{group:n,onOpen:u,selectionMode:o,selectedIds:i,onToggleSelect:l}=s,a=te();let d;if(e[0]!==n.connections||e[1]!==i){let _;e[3]!==i?(_=V=>i.has(V.id),e[3]=i,e[4]=_):_=e[4],d=n.connections.every(_),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const f=d;let j;if(e[5]!==n.connections||e[6]!==i){let _;e[8]!==i?(_=V=>i.has(V.id),e[8]=i,e[9]=_):_=e[9],j=n.connections.some(_),e[5]=n.connections,e[6]=i,e[7]=j}else j=e[7];const g=j;let r;e[10]!==f||e[11]!==n.connections||e[12]!==l||e[13]!==i?(r=()=>{for(const _ of n.connections)f?i.has(_.id)&&l(_.id):i.has(_.id)||l(_.id)},e[10]=f,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=r):r=e[14];const h=r,m=n.title,x=n.icon;let S;e[15]!==n.connections.length||e[16]!==a?(S=a("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=a,e[17]=S):S=e[17];let v;e[18]!==n.icon||e[19]!==n.title||e[20]!==S?(v={title:m,icon:x,description:S},e[18]=n.icon,e[19]=n.title,e[20]=S,e[21]=v):v=e[21];let y;e[22]!==u||e[23]!==o||e[24]!==h?(y=()=>o?h():u(),e[22]=u,e[23]=o,e[24]=h,e[25]=y):y=e[25];const c=o&&f&&"ring-2 ring-primary",p=o&&g&&!f&&"ring-1 ring-primary/50";let T;e[26]!==p||e[27]!==c?(T=fe(c,p),e[26]=p,e[27]=c,e[28]=T):T=e[28];const k=o?f?!0:g&&"mixed":void 0;let w;e[29]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(xe,{}),e[29]=w):w=e[29];let A;e[30]!==f||e[31]!==n.connections.length||e[32]!==o||e[33]!==g||e[34]!==a||e[35]!==h?(A=o?t.jsx(Ee,{checked:f?!0:g?"indeterminate":!1,onCheckedChange:h}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=f,e[31]=n.connections.length,e[32]=o,e[33]=g,e[34]=a,e[35]=h,e[36]=A):A=e[36];let $;e[37]!==u?($=_=>{_.stopPropagation(),u()},e[37]=u,e[38]=$):$=e[38];let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Be,{size:16}),e[39]=P):P=e[39];let M;e[40]!==a?(M=a("orgs.connectionSelectionUi.open"),e[40]=a,e[41]=M):M=e[41];let I;e[42]!==$||e[43]!==M?(I=t.jsxs(ie,{onClick:$,children:[P,M]}),e[42]=$,e[43]=M,e[44]=I):I=e[44];let O;e[45]!==o||e[46]!==I?(O=t.jsx(He,{selectionMode:o,children:I}),e[45]=o,e[46]=I,e[47]=O):O=e[47];let U;e[48]!==A||e[49]!==O?(U=t.jsxs("div",{className:"flex items-center gap-1",children:[A,O]}),e[48]=A,e[49]=O,e[50]=U):U=e[50];let b;return e[51]!==T||e[52]!==k||e[53]!==U||e[54]!==v||e[55]!==y?(b=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:v,onClick:y,className:T,selected:k,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:U})}),e[51]=T,e[52]=k,e[53]=U,e[54]=v,e[55]=y,e[56]=b):b=e[56],b}function an(s){const e=W.c(36),{connection:n,isSelected:u,selectionMode:o,canManage:i,canManageAgents:l,onToggleSelect:a,onOpen:d,onToggleStatus:f,onDelete:j}=s,g=te();let r;e[0]!==u||e[1]!==a||e[2]!==o||e[3]!==g?(r=o?t.jsx(Ee,{checked:u,onCheckedChange:a,onClick:dn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:g("orgs.connectionSelectionUi.connected")}),e[0]=u,e[1]=a,e[2]=o,e[3]=g,e[4]=r):r=e[4];let h;e[5]!==d?(h=k=>{k.stopPropagation(),d()},e[5]=d,e[6]=h):h=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Be,{size:16}),e[7]=m):m=e[7];let x;e[8]!==g?(x=g("orgs.connectionSelectionUi.open"),e[8]=g,e[9]=x):x=e[9];let S;e[10]!==h||e[11]!==x?(S=t.jsxs(ie,{onClick:h,children:[m,x]}),e[10]=h,e[11]=x,e[12]=S):S=e[12];let v;e[13]!==i||e[14]!==l||e[15]!==a||e[16]!==g?(v=(i||l)&&t.jsxs(ie,{onClick:k=>{k.stopPropagation(),a()},children:[t.jsx(vt,{size:16}),g("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=a,e[16]=g,e[17]=v):v=e[17];let y;e[18]!==i||e[19]!==n||e[20]!==f||e[21]!==g?(y=i&&(n.status==="active"?t.jsxs(ie,{onClick:k=>{k.stopPropagation(),f("inactive")},children:[t.jsx(bt,{size:16}),g("orgs.connectionSelectionUi.disable")]}):t.jsxs(ie,{onClick:k=>{k.stopPropagation(),f("active")},children:[t.jsx(_t,{size:16}),g("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=f,e[21]=g,e[22]=y):y=e[22];let c;e[23]!==i||e[24]!==j||e[25]!==g?(c=i&&t.jsxs(ie,{variant:"destructive",onClick:k=>{k.stopPropagation(),j()},children:[t.jsx(Ke,{size:16}),g("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=j,e[25]=g,e[26]=c):c=e[26];let p;e[27]!==o||e[28]!==S||e[29]!==v||e[30]!==y||e[31]!==c?(p=t.jsxs(He,{selectionMode:o,children:[S,v,y,c]}),e[27]=o,e[28]=S,e[29]=v,e[30]=y,e[31]=c,e[32]=p):p=e[32];let T;return e[33]!==r||e[34]!==p?(T=t.jsxs("div",{className:"flex items-center gap-1",children:[r,p]}),e[33]=r,e[34]=p,e[35]=T):T=e[35],T}function dn(s){return s.stopPropagation()}function un(s){const e=W.c(29),{count:n,total:u,canManage:o,canManageAgents:i,onSelectAll:l,onDeselectAll:a,onDelete:d,onAddToAgent:f,onToggleStatus:j,onCancel:g}=s,r=te();if(n===0)return null;let h;e[0]!==n||e[1]!==r?(h=r("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=r,e[2]=h):h=e[2];let m;e[3]!==h?(m=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:h}),e[3]=h,e[4]=m):m=e[4];let x;e[5]!==n||e[6]!==a||e[7]!==l||e[8]!==r||e[9]!==u?(x=n<u?t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:r("orgs.connectionSelectionUi.selectAll",{total:u})}):t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:r("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=a,e[7]=l,e[8]=r,e[9]=u,e[10]=x):x=e[10];let S;e[11]!==i||e[12]!==f||e[13]!==r?(S=i&&t.jsxs(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:f,children:[t.jsx(ze,{size:13}),r("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=f,e[13]=r,e[14]=S):S=e[14];let v;e[15]!==o||e[16]!==d||e[17]!==j||e[18]!==r?(v=o&&t.jsxs(t.Fragment,{children:[t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>j("active"),children:r("orgs.connectionSelectionUi.enable")}),t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>j("inactive"),children:r("orgs.connectionSelectionUi.disable")}),t.jsxs(E,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(Ke,{size:13}),r("orgs.connectionSelectionUi.delete")]})]}),e[15]=o,e[16]=d,e[17]=j,e[18]=r,e[19]=v):v=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Le,{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 p;return e[23]!==m||e[24]!==x||e[25]!==S||e[26]!==v||e[27]!==c?(p=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:[m,x,S,v,c]})}),e[23]=m,e[24]=x,e[25]=S,e[26]=v,e[27]=c,e[28]=p):p=e[28],p}function gn(s){const e=W.c(45),{open:n,onOpenChange:u,agents:o,onConfirm:i}=s,l=te(),[a,d]=L.useState(null);let f;e[0]!==l?(f=l("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=l,e[1]=f):f=e[1];let j;e[2]!==f?(j=t.jsx(Pe,{children:f}),e[2]=f,e[3]=j):j=e[3];let g;e[4]!==l?(g=l("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=l,e[5]=g):g=e[5];let r;e[6]!==g?(r=t.jsx(Me,{children:g}),e[6]=g,e[7]=r):r=e[7];let h;e[8]!==j||e[9]!==r?(h=t.jsxs($e,{children:[j,r]}),e[8]=j,e[9]=r,e[10]=h):h=e[10];let m;e[11]!==o||e[12]!==a||e[13]!==l?(m=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):o.map(P=>t.jsxs("button",{type:"button",onClick:()=>d(P.id),className:fe("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",a===P.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Qt,{icon:P.icon,name:P.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:P.title}),P.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:P.description})]})]},P.id)),e[11]=o,e[12]=a,e[13]=l,e[14]=m):m=e[14];let x;e[15]!==m?(x=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:m}),e[15]=m,e[16]=x):x=e[16];let S;e[17]!==u?(S=()=>u(!1),e[17]=u,e[18]=S):S=e[18];let v;e[19]!==l?(v=l("orgs.connectionSelectionUi.cancel"),e[19]=l,e[20]=v):v=e[20];let y;e[21]!==S||e[22]!==v?(y=t.jsx(E,{variant:"outline",onClick:S,children:v}),e[21]=S,e[22]=v,e[23]=y):y=e[23];const c=!a;let p;e[24]!==i||e[25]!==u||e[26]!==a?(p=()=>{a&&(i(a),u(!1),d(null))},e[24]=i,e[25]=u,e[26]=a,e[27]=p):p=e[27];let T;e[28]!==l?(T=l("orgs.connectionSelectionUi.add"),e[28]=l,e[29]=T):T=e[29];let k;e[30]!==c||e[31]!==p||e[32]!==T?(k=t.jsx(E,{disabled:c,onClick:p,children:T}),e[30]=c,e[31]=p,e[32]=T,e[33]=k):k=e[33];let w;e[34]!==y||e[35]!==k?(w=t.jsxs(Oe,{children:[y,k]}),e[34]=y,e[35]=k,e[36]=w):w=e[36];let A;e[37]!==w||e[38]!==h||e[39]!==x?(A=t.jsxs(Fe,{className:"sm:max-w-[400px]",children:[h,x,w]}),e[37]=w,e[38]=h,e[39]=x,e[40]=A):A=e[40];let $;return e[41]!==u||e[42]!==n||e[43]!==A?($=t.jsx(Ue,{open:n,onOpenChange:u,children:A}),e[41]=u,e[42]=n,e[43]=A,e[44]=$):$=e[44],$}function mn({listState:s,activeTab:e,typeFilter:n,statusFilter:u}){const o=te(),{org:i}=Ne(),l=tt(),a=ke(),{data:d}=Te.useSession(),f=Ve(),j=zt(s),g=ut(),{granted:r}=ye("connections:manage"),{granted:h}=ye("agents:manage"),[m,x]=L.useState(new Set),S=m.size>0,[v,y]=L.useState(!1),[c,p]=L.useState(!1),[T,k]=L.useState(null),w=Et(),A=j.filter(C=>!(n!=="ALL"&&C.connection_type!==n||u!=="ALL"&&C.status!==u)),$=at(A),P=C=>{x(D=>{const B=new Set(D);return B.has(C)?B.delete(C):B.add(C),B})},M=()=>{x(new Set)},I=Ae(s.searchTerm),O=I.items,U=mt(I.loadMore,I.hasMore,I.isLoadingMore),b=new Set(j.filter(C=>C.app_name).map(C=>C.app_name)),_=s.search.length>0,V=e==="all"||_?O.filter(C=>{if(_){const D=we(C);if(D&&b.has(D))return!1}return!0}):[],Z=e==="connected"||_?$:[],X=async C=>{if(!(!i||!d?.user?.id)){ee("connection_add_clicked",{action:"connect_new",registry_item_id:C.id,source:"connections_page"}),k(C.id);try{const D=it(C,i.id,d.user.id,{remoteIndex:0}),B=D.connection_type==="STDIO",H=!!D.connection_url,K=B&&D.connection_headers&&typeof D.connection_headers=="object"&&"command"in D.connection_headers;if(!H&&!K){R.error(o("orgs.connections.cannotConnectNoMethod")),k(null);return}const se=await f.create.mutateAsync(D),{id:oe}=se,ce=await qt({connectionId:oe,orgId:i.id,orgSlug:i.slug,persistFallback:le=>f.update.mutateAsync({id:oe,data:{connection_token:le}}).then(()=>{})});if(ce.ran&&!ce.ok){ee("connection_oauth_failed",{connection_id:oe,flow:"connections_page_connect",error:ce.error??"no_token"}),R.error(o("orgs.connections.authenticationFailed",{error:ce.error??"no token received"}));return}if(ce.ran){ee("connection_oauth_succeeded",{connection_id:oe,flow:"connections_page_connect"});const le=new URL(`/api/${i.slug}/mcp/${oe}`,window.location.origin);await l.invalidateQueries({queryKey:st.isMCPAuthenticated(le.href,null)}),z(),R.success(o("orgs.connections.authenticationSuccessful"))}let me=null;try{const le=await l.fetchQuery(Lt({connectionId:oe,orgId:i.id,orgSlug:i.slug}));me=on((await le.listTools()).tools)}catch{}const ve=ae(se),be=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:ve,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ve}}:null;R.success(o("orgs.connections.connectedSuccessfully"),be?{action:{label:o("orgs.connections.openConnection"),onClick:()=>a(be)}}:void 0)}catch(D){R.error(o("orgs.connections.failedToConnect",{error:D instanceof Error?D.message:String(D)}))}finally{k(null)}}},N=nt(),z=()=>{l.invalidateQueries({predicate:C=>{const D=C.queryKey;return D[1]===i.id&&D[3]==="collection"&&D[4]==="CONNECTIONS"}})},F=async()=>{y(!1);const C=[...m];ee("connections_bulk_delete",{count:C.length});const B=(await Promise.allSettled(C.map(H=>N.call("COLLECTION_CONNECTIONS_DELETE",{id:H,force:!0})))).filter(H=>H.status==="fulfilled").length;z(),R.success(o("orgs.connections.deletedConnections",{count:B})),M()},ue=async(C,D)=>{try{await f.update.mutateAsync({id:C,data:{status:D}}),z(),R.success(o(D==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(o("orgs.connections.failedToUpdateConnection"))}},je=async C=>{const D=[...m];ee("connections_bulk_status_toggled",{count:D.length,to_status:C});const H=(await Promise.allSettled(D.map(K=>f.update.mutateAsync({id:K,data:{status:C}})))).filter(K=>K.status==="fulfilled").length;z(),R.success(C==="active"?o("orgs.connections.enabledConnections",{count:H}):o("orgs.connections.disabledConnections",{count:H})),M()},ge=async C=>{const D=w.find(K=>K.id===C);if(!D)return;ee("connections_bulk_add_to_agent",{agent_id:C,count:m.size});const B=new Set(D.connections.map(K=>K.connection_id)),H=[...m].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(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await N.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:C,data:{connections:[...D.connections,...H]}}),l.invalidateQueries({predicate:K=>{const se=K.queryKey;return se[1]===i.id&&se[3]==="collection"&&se[4]==="VIRTUAL_MCP"}}),R.success(o("orgs.connections.addedConnectionsToAgent",{count:H.length,agentTitle:D.title})),M()}catch{R.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(gt,{...g}),t.jsx(nn,{open:v,onOpenChange:y,count:m.size,onConfirm:F}),t.jsx(gn,{open:c,onOpenChange:p,agents:w,onConfirm:ge}),I.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(_?V.length===0&&A.length===0:e==="all"?V.length===0:A.length===0)?t.jsx(dt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:o("orgs.connections.noConnectionsFound"),description:s.search?o("orgs.connections.noConnectionsMatchSearch",{search:s.search}):o(r?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[Z.map(C=>{if(C.type==="group")return t.jsx(rn,{group:C,onOpen:()=>{a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:C.key}})},selectionMode:S,selectedIds:m,onToggleSelect:P},C.key);const D=C.connection,B=m.has(D.id);return t.jsx(Ce,{connection:D,fallbackIcon:t.jsx(xe,{}),onClick:()=>S?P(D.id):a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(D)}}),className:fe(B&&"ring-2 ring-primary bg-primary/5"),selected:S?B:void 0,headerActionsAlwaysVisible:!0,headerActions:t.jsx(an,{connection:D,isSelected:B,selectionMode:S,canManage:r,canManageAgents:h,onToggleSelect:()=>P(D.id),onOpen:()=>a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(D)}}),onToggleStatus:H=>ue(D.id,H),onDelete:()=>g.requestDelete(D)})},D.id)}),V.map(C=>t.jsx(sn,{item:C,canManage:r,allConnections:j,connectedAppNames:b,connectingItemId:T,onNavigateConnected:D=>a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(D)}}),onConnect:X},C.id)),(e==="all"||_)&&t.jsx("div",{ref:U,className:"col-span-full h-4"}),(e==="all"||_)&&I.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(de,{className:"size-6 text-muted-foreground"})})]})}),S&&t.jsx(un,{count:m.size,total:A.length,canManage:r,canManageAgents:h,onSelectAll:()=>{x(new Set(A.map(C=>C.id)))},onDeselectAll:()=>x(new Set),onDelete:()=>y(!0),onAddToAgent:()=>p(!0),onToggleStatus:je,onCancel:M})]})}function pn(){const s=te(),{org:e}=Ne(),n=ke(),u=qe({strict:!1}),{data:o}=Te.useSession(),{stdioEnabled:i}=Qe(),l=Ie(),{granted:a}=ye("connections:manage"),d=tn({namespace:e.slug,resource:"connections"}),f=Ve(),[j,g]=Je(Ye.connectionsTab(e.slug),b=>u.tab==="all"||u.tab==="connected"?u.tab:b??"all"),[r,h]=L.useState("ALL"),[m,x]=L.useState("ALL"),v=Ae(d.searchTerm).items,y=d.search!==d.searchTerm,c=Ze({resolver:et(Rt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),p=c.watch("ui_type"),T=c.watch("connection_url"),k=c.watch("npx_package"),w=he({uiType:p,connectionUrl:T??"",npxPackage:k??""})??De({uiType:p,connectionUrl:T??"",registryItems:v}),A=a&&u.action==="create",$=()=>{ee("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},P=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},M=async b=>{let _,V=null,Z=null,X=null;b.ui_type==="NPX"?(_="STDIO",V="",X=Xt(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(_="STDIO",V="",X=Gt(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(_=b.ui_type,V=b.connection_url||"",Z=b.connection_token||null);const N=ot("conn");ee("connection_custom_created",{connection_type:_,ui_type:b.ui_type}),await f.create.mutateAsync({id:N,title:b.title,description:b.description||null,connection_type:_,connection_url:V,connection_token:Z,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:e.id,icon:b.icon??null,app_name:null,app_id:null,connection_headers:X,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),P(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ae({app_name:null,connection_url:V,title:b.title,id:N})}})},I=b=>{b||(A&&P(),c.reset())},O=b=>{const _=b.trim();if(!_)return;const V=!!c.formState.dirtyFields.title,Z=!!c.formState.dirtyFields.description,X=!!c.formState.dirtyFields.env_vars,N=F=>{if(F&&(!V&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!Z&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!X&&F.envVarKeys?.length)){const ue=c.getValues("env_vars")??[],je=new Set(ue.map(C=>C.key)),ge=F.envVarKeys.filter(C=>!je.has(C));ge.length>0&&c.setValue("env_vars",[...ue,...ge.map(C=>({key:C,value:""}))],{shouldDirty:!0})}},z=Wt(_);if(z&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",z.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),N(he({uiType:"NPX",npxPackage:z.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const F=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",_,{shouldDirty:!0}),N(he({uiType:F,connectionUrl:_})??De({uiType:F,connectionUrl:_,registryItems:v}));return}p==="NPX"&&N(he({uiType:"NPX",npxPackage:_}))},U=a?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(E,{size:"sm",variant:"default",onClick:$,children:[t.jsx(ze,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:s("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const b=s("orgs.connections.createConnection"),_=s("orgs.connections.createConnectionDescription"),V=c.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),Z=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(G,{control:c.control,name:"ui_type",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:s("orgs.connections.type")}),t.jsxs($t,{value:N.value,onValueChange:N.onChange,children:[t.jsx(J,{children:t.jsx(Ot,{children:t.jsx(Ft,{})})}),t.jsxs(Ut,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),i&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),s("orgs.connections.npxPackage")]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Kt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Y,{})]})}),p==="NPX"&&t.jsx(G,{control:c.control,name:"npx_package",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:s("orgs.connections.npmPackage")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...N,value:N.value??"",onPaste:z=>{const F=z.clipboardData.getData("text");F&&(z.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),O(F))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Y,{})]})}),p==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(G,{control:c.control,name:"stdio_command",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:s("orgs.connections.command")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.commandPlaceholder"),...N,value:N.value??""})}),t.jsx(Y,{})]})}),t.jsx(G,{control:c.control,name:"stdio_args",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:s("orgs.connections.arguments")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.argumentsPlaceholder"),...N,value:N.value??""})}),t.jsx(Y,{})]})})]}),t.jsx(G,{control:c.control,name:"stdio_cwd",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:s("orgs.connections.workingDirectory")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...N,value:N.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(Y,{})]})})]}),(p==="NPX"||p==="STDIO")&&t.jsx(G,{control:c.control,name:"env_vars",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:s("orgs.connections.environmentVariables")}),t.jsx(J,{children:t.jsx(Ht,{value:N.value??[],onChange:N.onChange})}),t.jsx(Y,{})]})}),p!=="NPX"&&p!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(G,{control:c.control,name:"connection_url",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:s("orgs.connections.url")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.urlPlaceholder"),...N,value:N.value??"",onPaste:z=>{const F=z.clipboardData.getData("text");F&&(z.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),O(F))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Y,{})]})}),t.jsx(G,{control:c.control,name:"connection_token",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:w?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(J,{children:t.jsx(ne,{type:"password",placeholder:w?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...N,value:N.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:s("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Y,{})]})})]}),t.jsx(G,{control:c.control,name:"title",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:s("orgs.connections.name")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.namePlaceholder"),...N})}),t.jsx(Y,{})]})}),t.jsx(G,{control:c.control,name:"description",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:s("orgs.connections.description")}),t.jsx(J,{children:t.jsx(Vt,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...N,value:N.value??""})}),t.jsx(Y,{})]})})]}),X=A;return l?t.jsx(kt,{open:X,onOpenChange:I,children:t.jsxs(Tt,{className:"max-h-[90vh]",children:[t.jsx(wt,{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(At,{children:b}),t.jsx(It,{className:"mt-1",children:_})]}),t.jsx(Pt,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Le,{size:16})})})]})}),t.jsx(_e,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(M),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:Z}),t.jsx(Mt,{children:t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Ue,{open:X,onOpenChange:I,children:t.jsxs(Fe,{className:"sm:max-w-[525px]",children:[t.jsxs($e,{children:[t.jsx(Pe,{children:b}),t.jsx(Me,{children:_})]}),t.jsx(_e,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(M),children:[t.jsx("div",{className:"py-4",children:Z}),t.jsxs(Oe,{children:[t.jsx(E,{type:"button",variant:"outline",onClick:()=>I(!1),children:s("orgs.connections.cancel")}),t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{actions:U,children:s("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(lt,{value:d.search,onChange:d.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:b=>{b.key==="Escape"&&(d.setSearch(""),b.target.blur())}}),t.jsx(ct,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:s("orgs.connections.sortName")},{id:"description",label:s("orgs.connections.sortDescription")},{id:"connection_type",label:s("orgs.connections.sortType")},{id:"updated_by",label:s("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:s("orgs.connections.sortUpdated")}],filters:[{label:s("orgs.connections.filterType"),value:r,onChange:b=>h(b||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:s("orgs.connections.filterStatus"),value:m,onChange:b=>x(b||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"active",label:s("orgs.connections.filterActive")},{id:"inactive",label:s("orgs.connections.filterInactive")},{id:"error",label:s("orgs.connections.filterError")}]}]})]})}),t.jsx(rt,{placement:"page",tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:j,onTabChange:b=>{const _=b;_!==j&&ee("connections_page_tab_changed",{to_tab:_}),g(_)}}),t.jsx(L.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:y?.5:1,transition:y?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:y?"none":"auto"},children:t.jsx(mn,{listState:d,activeTab:j,typeFilter:r,statusFilter:m})})})]})})})]})})}function Ms(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(L.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx(pn,{})})}),s[0]=e):e=s[0],e}export{Ms as default};
|
|
1
|
+
import{r as L,c as W,b as te,j as t,B as E,h as de,l as fe,G as ie,F as Re,I as We,H as Xe,E as Ge,X as Ne,d as ke,u as qe,a as Te,R as Qe,ac as ye,U as Je,V as Ye,am as Ze,al as et,n as pe,q as ee,o as tt,a3 as nt,t as R,K as st}from"./index-BjrR9kZj.js";import{a as we,g as ot,e as it}from"./extract-connection-data-D4h0y4EU.js";import{C as ct}from"./collection-display-button-D4IBHGZc.js";import{S as lt}from"./search-input-CFuVSdCR.js";import{C as rt}from"./collection-tabs--W1A2Kno.js";import{C as Ce,u as Ae,g as at}from"./connection-card-B4bw8HCo.js";import{E as dt}from"./empty-state-CzE4b4zD.js";import{u as ut,D as gt}from"./use-delete-connection-B1tYA8Rp.js";import{u as mt}from"./use-infinite-scroll-BPlWiH_j.js";import{u as Ie}from"./use-mobile-DN-7qwao.js";import{g as ae}from"./connection-slug-CITJ0kGN.js";import{A as pt,a as ht,b as ft,c as xt,g as jt,d as St,e as yt,f as Ct}from"./alert-dialog-mXuhGOeD.js";import{as as xe,bp as vt,at as bt,b4 as _t,l as Se}from"./agent-icon-8fIO3moM.js";import{g as Dt,a as Nt}from"./metadata-D72DunRR.js";import{d as Pe,h as Me,c as $e,e as Oe,b as Fe,D as Ue}from"./dialog-BGQjuyIa.js";import{D as kt,a as Tt,d as wt,b as At,e as It,f as Pt,g as Mt}from"./drawer-B-c-ivso.js";import{F as G,b as q,c as Q,d as J,f as Y,a as _e}from"./form-DTmMHLRx.js";import{I as ne}from"./input-DFe835A1.js";import{S as $t,b as Ot,a as Ft,d as Ut,c as re}from"./select-DfRa6U-n.js";import{T as Vt}from"./textarea-DcUTXKBn.js";import{b as Ve,u as zt}from"./use-connection-C8UZsu8O.js";import{m as Lt}from"./use-mcp-client-_RtWTLxt.js";import{b as Et}from"./use-virtual-mcp-BHM7_O3U.js";import{g as Bt}from"./types-CuuumKKW.js";import{s as ze}from"./Plus-CPRr8eLA.js";import{b as Kt}from"./UserSquare-BcjGTyJF.js";import{s as Le}from"./XClose-BNpVIYKH.js";import{i as he,a as De,E as Ht,c as Rt,p as Wt,b as Xt,d as Gt}from"./connection-form-helpers-DMj6bxTF.js";import{a as qt}from"./authenticate-and-persist-oauth-Cdoq_uUT.js";import{I as Qt}from"./integration-icon-DpzEVv6e.js";import{C as Ee}from"./checkbox-iCK8-YOo.js";import{i as Jt}from"./DotsVertical-Bl1hnuJi.js";import{s as Be}from"./Eye-BbaBeCZ5.js";import{s as Ke}from"./Trash01-BUFUahy8.js";import"./connection-BY8-KaA4.js";import"./ArrowUp-Cwnen55n.js";import"./Check-BcWDZio0.js";import"./tooltip-a6VXOqQI.js";import"./index-BExO8BBu.js";import"./view-mode-toggle-DSuJIM_N.js";import"./badge-MUYSitCi.js";import"./SearchMd-DmrZ8tNb.js";import"./useInfiniteQuery-BBFjBKxn.js";import"./infiniteQueryObserver-DFZOc4R3.js";import"./slugify-CEUa2lfQ.js";import"./AlertCircle-B6v6clUp.js";import"./Tool01-Cc10eS4M.js";import"./ArrowLeft-DDW5by-5.js";import"./ArrowRight-b4OSvT38.js";import"./ZoomOut-BWWdIPu7.js";import"./Globe04-BKigapNa.js";import"./CheckCircle-MH252tOY.js";import"./ChevronUp-zgSkYMxJ.js";import"./Copy01-B1NOvXZB.js";import"./CreditCard01-BZsA4Hwc.js";import"./Share07-Cs13DReE.js";import"./Image01-w2ZWkVaa.js";import"./Key01-DT2DLjDU.js";import"./LayoutLeft-DmPeVi4U.js";import"./Link01-CwAzoHCm.js";import"./LinkExternal01-BVro7p0d.js";import"./Monitor01-BXGpB3DU.js";import"./Sun-Cvn5rNir.js";import"./Palette-p6gpXB43.js";import"./Upload01-BYDz7chj.js";import"./User01-jkNTFSxf.js";import"./Users01-CnASZBXO.js";import"./X-DMAiKm4q.js";import"./Zap-YBE6LDnX.js";import"./label-68C0kM-R.js";import"./auth-yECgQ-YG.js";import"./mcp-oauth-BMxlsP2O.js";function Yt(s){const e=`deco-filters-${s}`,[n,u]=L.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 Zt(s){const e=W.c(7),[n,u]=L.useState(s),[o,i]=L.useState(s?"desc":null);let l;e[0]!==o||e[1]!==n?(l=f=>{n!==f?(u(f),i("asc")):o==="asc"?i("desc"):o==="desc"&&(u(void 0),i(null))},e[0]=o,e[1]=n,e[2]=l):l=e[2];const a=l;let d;return e[3]!==a||e[4]!==o||e[5]!==n?(d={sortKey:n,sortDirection:o,handleSort:a},e[3]=a,e[4]=o,e[5]=n,e[6]=d):d=e[6],d}function en(s,e){const n=W.c(12),u=e===void 0?"cards":e,o=Ie(),i=L.useRef(o),l=s?`deco-view-mode-${s}`:"deco-view-mode";let a;n[0]!==u||n[1]!==l?(a=()=>{const x=globalThis.localStorage?.getItem(l);return x==="cards"||x==="table"?x:u},n[0]=u,n[1]=l,n[2]=a):a=n[2];const[d,f]=L.useState(a);let j;n[3]!==l?(j=x=>{f(x),globalThis.localStorage?.setItem(l,x)},n[3]=l,n[4]=j):j=n[4];const g=j;let r,h;n[5]!==o||n[6]!==d?(r=()=>{!i.current&&o&&d==="table"&&f("cards"),i.current=o},h=[o,d],n[5]=o,n[6]=d,n[7]=r,n[8]=h):(r=n[7],h=n[8]),L.useEffect(r,h);let m;return n[9]!==g||n[10]!==d?(m=[d,g],n[9]=g,n[10]=d,n[11]=m):m=n[11],m}function tn(s){const e=W.c(20),{namespace:n,resource:u,defaultSortKey:o,defaultViewMode:i}=s,l=o===void 0?"title":o,a=i===void 0?"table":i,[d,f]=L.useState(""),j=L.useDeferredValue(d),g=`${n}-${u}`,[r,h]=Yt(g),m=`studio-${u}-filter-visible-${n}`;let x;e[0]!==m?(x=()=>globalThis.localStorage?.getItem(m)==="true",e[0]=m,e[1]=x):x=e[1];const[S,v]=L.useState(x);let y;e[2]!==m?(y=O=>{v(O),globalThis.localStorage?.setItem(m,String(O))},e[2]=m,e[3]=y):y=e[3];const c=y;let p;e[4]!==S||e[5]!==c?(p=()=>{c(!S)},e[4]=S,e[5]=c,e[6]=p):p=e[6];const T=p,[k,w]=en(`studio-${u}-${n}`,a),{sortKey:A,sortDirection:$,handleSort:P}=Zt(l),M=A;let I;return e[7]!==S||e[8]!==r||e[9]!==P||e[10]!==d||e[11]!==j||e[12]!==c||e[13]!==h||e[14]!==w||e[15]!==$||e[16]!==M||e[17]!==T||e[18]!==k?(I={search:d,searchTerm:j,setSearch:f,filters:r,setFilters:h,filterBarVisible:S,setFilterBarVisible:c,toggleFilterBar:T,viewMode:k,setViewMode:w,sortKey:M,sortDirection:$,handleSort:P},e[7]=S,e[8]=r,e[9]=P,e[10]=d,e[11]=j,e[12]=c,e[13]=h,e[14]=w,e[15]=$,e[16]=M,e[17]=T,e[18]=k,e[19]=I):I=e[19],I}function nn(s){const e=W.c(35),{open:n,onOpenChange:u,count:o,onConfirm:i}=s,l=te(),a=o===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==o||e[1]!==l||e[2]!==a?(d=l(a,{count:o}),e[0]=o,e[1]=l,e[2]=a,e[3]=d):d=e[3];let f;e[4]!==d?(f=t.jsx(pt,{children:d}),e[4]=d,e[5]=f):f=e[5];const j=o===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let g;e[6]!==l||e[7]!==j?(g=l(j),e[6]=l,e[7]=j,e[8]=g):g=e[8];let r;e[9]!==g?(r=t.jsx(ht,{children:g}),e[9]=g,e[10]=r):r=e[10];let h;e[11]!==f||e[12]!==r?(h=t.jsxs(ft,{children:[f,r]}),e[11]=f,e[12]=r,e[13]=h):h=e[13];let m;e[14]!==l?(m=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=m):m=e[15];let x;e[16]!==m?(x=t.jsx(xt,{children:m}),e[16]=m,e[17]=x):x=e[17];const S=o===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let v;e[18]!==o||e[19]!==l||e[20]!==S?(v=l(S,{count:o}),e[18]=o,e[19]=l,e[20]=S,e[21]=v):v=e[21];let y;e[22]!==i||e[23]!==v?(y=t.jsx(jt,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:v}),e[22]=i,e[23]=v,e[24]=y):y=e[24];let c;e[25]!==y||e[26]!==x?(c=t.jsxs(St,{children:[x,y]}),e[25]=y,e[26]=x,e[27]=c):c=e[27];let p;e[28]!==c||e[29]!==h?(p=t.jsxs(yt,{children:[h,c]}),e[28]=c,e[29]=h,e[30]=p):p=e[30];let T;return e[31]!==u||e[32]!==n||e[33]!==p?(T=t.jsx(Ct,{open:n,onOpenChange:u,children:p}),e[31]=u,e[32]=n,e[33]=p,e[34]=T):T=e[34],T}function sn(s){const e=W.c(39),{item:n,canManage:u,allConnections:o,connectedAppNames:i,connectingItemId:l,onNavigateConnected:a,onConnect:d}=s,f=te();let j,g;e[0]!==i||e[1]!==n?(j=we(n)??"",g=i.has(j),e[0]=i,e[1]=n,e[2]=j,e[3]=g):(j=e[2],g=e[3]);const r=g;let h;e[4]!==n._meta?(h=Dt(n._meta),e[4]=n._meta,e[5]=h):h=e[5];const m=h,x=m?.friendlyName||m?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",S=n.server?.description||n.description||null;let v;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(v=n.server?.icons?.[0]?.src||Nt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=v):v=e[8];const y=v;let c;if(e[9]!==o||e[10]!==j){let U;e[12]!==j?(U=b=>b.connection_type!=="VIRTUAL"&&b.app_name===j,e[12]=j,e[13]=U):U=e[13],c=o.filter(U),e[9]=o,e[10]=j,e[11]=c}else c=e[11];const p=c,T=r||u;let k,w;e[14]!==p||e[15]!==r||e[16]!==n||e[17]!==d||e[18]!==a?(k=()=>{if(r){const U=p[0];U&&a(U);return}w()},w=()=>d(n),e[14]=p,e[15]=r,e[16]=n,e[17]=d,e[18]=a,e[19]=k,e[20]=w):(k=e[19],w=e[20]);let A;e[21]!==S||e[22]!==y||e[23]!==x?(A={title:x,description:S,icon:y},e[21]=S,e[22]=y,e[23]=x,e[24]=A):A=e[24];let $;e[25]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(xe,{}),e[25]=$):$=e[25];const P=T?k:void 0;let M;e[26]!==u||e[27]!==l||e[28]!==w||e[29]!==r||e[30]!==n.id||e[31]!==f?(M=r?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:f("orgs.catalogItemCard.connected")}):u&&t.jsx(E,{variant:"outline",size:"sm",className:"h-7 px-3 text-sm font-medium",disabled:l!==null,onClick:U=>{U.stopPropagation(),w()},children:l===n.id?t.jsx(de,{className:"size-3.5"}):f("orgs.catalogItemCard.connect")}),e[26]=u,e[27]=l,e[28]=w,e[29]=r,e[30]=n.id,e[31]=f,e[32]=M):M=e[32];let I;e[33]!==M?(I=t.jsx("div",{className:"flex items-center gap-2",children:M}),e[33]=M,e[34]=I):I=e[34];let O;return e[35]!==A||e[36]!==P||e[37]!==I?(O=t.jsx(Ce,{connection:A,fallbackIcon:$,onClick:P,headerActionsAlwaysVisible:!0,headerActions:I}),e[35]=A,e[36]=P,e[37]=I,e[38]=O):O=e[38],O}function on(s){return s?.length?{appToolName:s.find(n=>!!Bt(n._meta))?.name??null}:null}function He(s){const e=W.c(8),{selectionMode:n,children:u}=s,o=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let i;e[0]!==o?(i=fe("overflow-hidden transition-all duration-150 ease-out",o),e[0]=o,e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Re,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ln,children:t.jsx(Jt,{size:20})})}),e[2]=l):l=e[2];let a;e[3]!==u?(a=t.jsxs(We,{children:[l,t.jsx(Xe,{align:"end",onClick:cn,children:u})]}),e[3]=u,e[4]=a):a=e[4];let d;return e[5]!==i||e[6]!==a?(d=t.jsx("div",{className:i,children:a}),e[5]=i,e[6]=a,e[7]=d):d=e[7],d}function cn(s){return s.stopPropagation()}function ln(s){return s.stopPropagation()}function rn(s){const e=W.c(57),{group:n,onOpen:u,selectionMode:o,selectedIds:i,onToggleSelect:l}=s,a=te();let d;if(e[0]!==n.connections||e[1]!==i){let _;e[3]!==i?(_=V=>i.has(V.id),e[3]=i,e[4]=_):_=e[4],d=n.connections.every(_),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const f=d;let j;if(e[5]!==n.connections||e[6]!==i){let _;e[8]!==i?(_=V=>i.has(V.id),e[8]=i,e[9]=_):_=e[9],j=n.connections.some(_),e[5]=n.connections,e[6]=i,e[7]=j}else j=e[7];const g=j;let r;e[10]!==f||e[11]!==n.connections||e[12]!==l||e[13]!==i?(r=()=>{for(const _ of n.connections)f?i.has(_.id)&&l(_.id):i.has(_.id)||l(_.id)},e[10]=f,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=r):r=e[14];const h=r,m=n.title,x=n.icon;let S;e[15]!==n.connections.length||e[16]!==a?(S=a("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=a,e[17]=S):S=e[17];let v;e[18]!==n.icon||e[19]!==n.title||e[20]!==S?(v={title:m,icon:x,description:S},e[18]=n.icon,e[19]=n.title,e[20]=S,e[21]=v):v=e[21];let y;e[22]!==u||e[23]!==o||e[24]!==h?(y=()=>o?h():u(),e[22]=u,e[23]=o,e[24]=h,e[25]=y):y=e[25];const c=o&&f&&"ring-2 ring-primary",p=o&&g&&!f&&"ring-1 ring-primary/50";let T;e[26]!==p||e[27]!==c?(T=fe(c,p),e[26]=p,e[27]=c,e[28]=T):T=e[28];const k=o?f?!0:g&&"mixed":void 0;let w;e[29]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(xe,{}),e[29]=w):w=e[29];let A;e[30]!==f||e[31]!==n.connections.length||e[32]!==o||e[33]!==g||e[34]!==a||e[35]!==h?(A=o?t.jsx(Ee,{checked:f?!0:g?"indeterminate":!1,onCheckedChange:h}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=f,e[31]=n.connections.length,e[32]=o,e[33]=g,e[34]=a,e[35]=h,e[36]=A):A=e[36];let $;e[37]!==u?($=_=>{_.stopPropagation(),u()},e[37]=u,e[38]=$):$=e[38];let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Be,{size:16}),e[39]=P):P=e[39];let M;e[40]!==a?(M=a("orgs.connectionSelectionUi.open"),e[40]=a,e[41]=M):M=e[41];let I;e[42]!==$||e[43]!==M?(I=t.jsxs(ie,{onClick:$,children:[P,M]}),e[42]=$,e[43]=M,e[44]=I):I=e[44];let O;e[45]!==o||e[46]!==I?(O=t.jsx(He,{selectionMode:o,children:I}),e[45]=o,e[46]=I,e[47]=O):O=e[47];let U;e[48]!==A||e[49]!==O?(U=t.jsxs("div",{className:"flex items-center gap-1",children:[A,O]}),e[48]=A,e[49]=O,e[50]=U):U=e[50];let b;return e[51]!==T||e[52]!==k||e[53]!==U||e[54]!==v||e[55]!==y?(b=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:v,onClick:y,className:T,selected:k,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:U})}),e[51]=T,e[52]=k,e[53]=U,e[54]=v,e[55]=y,e[56]=b):b=e[56],b}function an(s){const e=W.c(36),{connection:n,isSelected:u,selectionMode:o,canManage:i,canManageAgents:l,onToggleSelect:a,onOpen:d,onToggleStatus:f,onDelete:j}=s,g=te();let r;e[0]!==u||e[1]!==a||e[2]!==o||e[3]!==g?(r=o?t.jsx(Ee,{checked:u,onCheckedChange:a,onClick:dn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:g("orgs.connectionSelectionUi.connected")}),e[0]=u,e[1]=a,e[2]=o,e[3]=g,e[4]=r):r=e[4];let h;e[5]!==d?(h=k=>{k.stopPropagation(),d()},e[5]=d,e[6]=h):h=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Be,{size:16}),e[7]=m):m=e[7];let x;e[8]!==g?(x=g("orgs.connectionSelectionUi.open"),e[8]=g,e[9]=x):x=e[9];let S;e[10]!==h||e[11]!==x?(S=t.jsxs(ie,{onClick:h,children:[m,x]}),e[10]=h,e[11]=x,e[12]=S):S=e[12];let v;e[13]!==i||e[14]!==l||e[15]!==a||e[16]!==g?(v=(i||l)&&t.jsxs(ie,{onClick:k=>{k.stopPropagation(),a()},children:[t.jsx(vt,{size:16}),g("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=a,e[16]=g,e[17]=v):v=e[17];let y;e[18]!==i||e[19]!==n||e[20]!==f||e[21]!==g?(y=i&&(n.status==="active"?t.jsxs(ie,{onClick:k=>{k.stopPropagation(),f("inactive")},children:[t.jsx(bt,{size:16}),g("orgs.connectionSelectionUi.disable")]}):t.jsxs(ie,{onClick:k=>{k.stopPropagation(),f("active")},children:[t.jsx(_t,{size:16}),g("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=f,e[21]=g,e[22]=y):y=e[22];let c;e[23]!==i||e[24]!==j||e[25]!==g?(c=i&&t.jsxs(ie,{variant:"destructive",onClick:k=>{k.stopPropagation(),j()},children:[t.jsx(Ke,{size:16}),g("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=j,e[25]=g,e[26]=c):c=e[26];let p;e[27]!==o||e[28]!==S||e[29]!==v||e[30]!==y||e[31]!==c?(p=t.jsxs(He,{selectionMode:o,children:[S,v,y,c]}),e[27]=o,e[28]=S,e[29]=v,e[30]=y,e[31]=c,e[32]=p):p=e[32];let T;return e[33]!==r||e[34]!==p?(T=t.jsxs("div",{className:"flex items-center gap-1",children:[r,p]}),e[33]=r,e[34]=p,e[35]=T):T=e[35],T}function dn(s){return s.stopPropagation()}function un(s){const e=W.c(29),{count:n,total:u,canManage:o,canManageAgents:i,onSelectAll:l,onDeselectAll:a,onDelete:d,onAddToAgent:f,onToggleStatus:j,onCancel:g}=s,r=te();if(n===0)return null;let h;e[0]!==n||e[1]!==r?(h=r("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=r,e[2]=h):h=e[2];let m;e[3]!==h?(m=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:h}),e[3]=h,e[4]=m):m=e[4];let x;e[5]!==n||e[6]!==a||e[7]!==l||e[8]!==r||e[9]!==u?(x=n<u?t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:r("orgs.connectionSelectionUi.selectAll",{total:u})}):t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:r("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=a,e[7]=l,e[8]=r,e[9]=u,e[10]=x):x=e[10];let S;e[11]!==i||e[12]!==f||e[13]!==r?(S=i&&t.jsxs(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:f,children:[t.jsx(ze,{size:13}),r("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=f,e[13]=r,e[14]=S):S=e[14];let v;e[15]!==o||e[16]!==d||e[17]!==j||e[18]!==r?(v=o&&t.jsxs(t.Fragment,{children:[t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>j("active"),children:r("orgs.connectionSelectionUi.enable")}),t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>j("inactive"),children:r("orgs.connectionSelectionUi.disable")}),t.jsxs(E,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(Ke,{size:13}),r("orgs.connectionSelectionUi.delete")]})]}),e[15]=o,e[16]=d,e[17]=j,e[18]=r,e[19]=v):v=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Le,{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 p;return e[23]!==m||e[24]!==x||e[25]!==S||e[26]!==v||e[27]!==c?(p=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:[m,x,S,v,c]})}),e[23]=m,e[24]=x,e[25]=S,e[26]=v,e[27]=c,e[28]=p):p=e[28],p}function gn(s){const e=W.c(45),{open:n,onOpenChange:u,agents:o,onConfirm:i}=s,l=te(),[a,d]=L.useState(null);let f;e[0]!==l?(f=l("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=l,e[1]=f):f=e[1];let j;e[2]!==f?(j=t.jsx(Pe,{children:f}),e[2]=f,e[3]=j):j=e[3];let g;e[4]!==l?(g=l("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=l,e[5]=g):g=e[5];let r;e[6]!==g?(r=t.jsx(Me,{children:g}),e[6]=g,e[7]=r):r=e[7];let h;e[8]!==j||e[9]!==r?(h=t.jsxs($e,{children:[j,r]}),e[8]=j,e[9]=r,e[10]=h):h=e[10];let m;e[11]!==o||e[12]!==a||e[13]!==l?(m=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):o.map(P=>t.jsxs("button",{type:"button",onClick:()=>d(P.id),className:fe("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",a===P.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Qt,{icon:P.icon,name:P.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:P.title}),P.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:P.description})]})]},P.id)),e[11]=o,e[12]=a,e[13]=l,e[14]=m):m=e[14];let x;e[15]!==m?(x=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:m}),e[15]=m,e[16]=x):x=e[16];let S;e[17]!==u?(S=()=>u(!1),e[17]=u,e[18]=S):S=e[18];let v;e[19]!==l?(v=l("orgs.connectionSelectionUi.cancel"),e[19]=l,e[20]=v):v=e[20];let y;e[21]!==S||e[22]!==v?(y=t.jsx(E,{variant:"outline",onClick:S,children:v}),e[21]=S,e[22]=v,e[23]=y):y=e[23];const c=!a;let p;e[24]!==i||e[25]!==u||e[26]!==a?(p=()=>{a&&(i(a),u(!1),d(null))},e[24]=i,e[25]=u,e[26]=a,e[27]=p):p=e[27];let T;e[28]!==l?(T=l("orgs.connectionSelectionUi.add"),e[28]=l,e[29]=T):T=e[29];let k;e[30]!==c||e[31]!==p||e[32]!==T?(k=t.jsx(E,{disabled:c,onClick:p,children:T}),e[30]=c,e[31]=p,e[32]=T,e[33]=k):k=e[33];let w;e[34]!==y||e[35]!==k?(w=t.jsxs(Oe,{children:[y,k]}),e[34]=y,e[35]=k,e[36]=w):w=e[36];let A;e[37]!==w||e[38]!==h||e[39]!==x?(A=t.jsxs(Fe,{className:"sm:max-w-[400px]",children:[h,x,w]}),e[37]=w,e[38]=h,e[39]=x,e[40]=A):A=e[40];let $;return e[41]!==u||e[42]!==n||e[43]!==A?($=t.jsx(Ue,{open:n,onOpenChange:u,children:A}),e[41]=u,e[42]=n,e[43]=A,e[44]=$):$=e[44],$}function mn({listState:s,activeTab:e,typeFilter:n,statusFilter:u}){const o=te(),{org:i}=Ne(),l=tt(),a=ke(),{data:d}=Te.useSession(),f=Ve(),j=zt(s),g=ut(),{granted:r}=ye("connections:manage"),{granted:h}=ye("agents:manage"),[m,x]=L.useState(new Set),S=m.size>0,[v,y]=L.useState(!1),[c,p]=L.useState(!1),[T,k]=L.useState(null),w=Et(),A=j.filter(C=>!(n!=="ALL"&&C.connection_type!==n||u!=="ALL"&&C.status!==u)),$=at(A),P=C=>{x(D=>{const B=new Set(D);return B.has(C)?B.delete(C):B.add(C),B})},M=()=>{x(new Set)},I=Ae(s.searchTerm),O=I.items,U=mt(I.loadMore,I.hasMore,I.isLoadingMore),b=new Set(j.filter(C=>C.app_name).map(C=>C.app_name)),_=s.search.length>0,V=e==="all"||_?O.filter(C=>{if(_){const D=we(C);if(D&&b.has(D))return!1}return!0}):[],Z=e==="connected"||_?$:[],X=async C=>{if(!(!i||!d?.user?.id)){ee("connection_add_clicked",{action:"connect_new",registry_item_id:C.id,source:"connections_page"}),k(C.id);try{const D=it(C,i.id,d.user.id,{remoteIndex:0}),B=D.connection_type==="STDIO",H=!!D.connection_url,K=B&&D.connection_headers&&typeof D.connection_headers=="object"&&"command"in D.connection_headers;if(!H&&!K){R.error(o("orgs.connections.cannotConnectNoMethod")),k(null);return}const se=await f.create.mutateAsync(D),{id:oe}=se,ce=await qt({connectionId:oe,orgId:i.id,orgSlug:i.slug,persistFallback:le=>f.update.mutateAsync({id:oe,data:{connection_token:le}}).then(()=>{})});if(ce.ran&&!ce.ok){ee("connection_oauth_failed",{connection_id:oe,flow:"connections_page_connect",error:ce.error??"no_token"}),R.error(o("orgs.connections.authenticationFailed",{error:ce.error??"no token received"}));return}if(ce.ran){ee("connection_oauth_succeeded",{connection_id:oe,flow:"connections_page_connect"});const le=new URL(`/api/${i.slug}/mcp/${oe}`,window.location.origin);await l.invalidateQueries({queryKey:st.isMCPAuthenticated(le.href,null)}),z(),R.success(o("orgs.connections.authenticationSuccessful"))}let me=null;try{const le=await l.fetchQuery(Lt({connectionId:oe,orgId:i.id,orgSlug:i.slug}));me=on((await le.listTools()).tools)}catch{}const ve=ae(se),be=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:ve,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ve}}:null;R.success(o("orgs.connections.connectedSuccessfully"),be?{action:{label:o("orgs.connections.openConnection"),onClick:()=>a(be)}}:void 0)}catch(D){R.error(o("orgs.connections.failedToConnect",{error:D instanceof Error?D.message:String(D)}))}finally{k(null)}}},N=nt(),z=()=>{l.invalidateQueries({predicate:C=>{const D=C.queryKey;return D[1]===i.id&&D[3]==="collection"&&D[4]==="CONNECTIONS"}})},F=async()=>{y(!1);const C=[...m];ee("connections_bulk_delete",{count:C.length});const B=(await Promise.allSettled(C.map(H=>N.call("COLLECTION_CONNECTIONS_DELETE",{id:H,force:!0})))).filter(H=>H.status==="fulfilled").length;z(),R.success(o("orgs.connections.deletedConnections",{count:B})),M()},ue=async(C,D)=>{try{await f.update.mutateAsync({id:C,data:{status:D}}),z(),R.success(o(D==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(o("orgs.connections.failedToUpdateConnection"))}},je=async C=>{const D=[...m];ee("connections_bulk_status_toggled",{count:D.length,to_status:C});const H=(await Promise.allSettled(D.map(K=>f.update.mutateAsync({id:K,data:{status:C}})))).filter(K=>K.status==="fulfilled").length;z(),R.success(C==="active"?o("orgs.connections.enabledConnections",{count:H}):o("orgs.connections.disabledConnections",{count:H})),M()},ge=async C=>{const D=w.find(K=>K.id===C);if(!D)return;ee("connections_bulk_add_to_agent",{agent_id:C,count:m.size});const B=new Set(D.connections.map(K=>K.connection_id)),H=[...m].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(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await N.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:C,data:{connections:[...D.connections,...H]}}),l.invalidateQueries({predicate:K=>{const se=K.queryKey;return se[1]===i.id&&se[3]==="collection"&&se[4]==="VIRTUAL_MCP"}}),R.success(o("orgs.connections.addedConnectionsToAgent",{count:H.length,agentTitle:D.title})),M()}catch{R.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(gt,{...g}),t.jsx(nn,{open:v,onOpenChange:y,count:m.size,onConfirm:F}),t.jsx(gn,{open:c,onOpenChange:p,agents:w,onConfirm:ge}),I.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(_?V.length===0&&A.length===0:e==="all"?V.length===0:A.length===0)?t.jsx(dt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:o("orgs.connections.noConnectionsFound"),description:s.search?o("orgs.connections.noConnectionsMatchSearch",{search:s.search}):o(r?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[Z.map(C=>{if(C.type==="group")return t.jsx(rn,{group:C,onOpen:()=>{a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:C.key}})},selectionMode:S,selectedIds:m,onToggleSelect:P},C.key);const D=C.connection,B=m.has(D.id);return t.jsx(Ce,{connection:D,fallbackIcon:t.jsx(xe,{}),onClick:()=>S?P(D.id):a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(D)}}),className:fe(B&&"ring-2 ring-primary bg-primary/5"),selected:S?B:void 0,headerActionsAlwaysVisible:!0,headerActions:t.jsx(an,{connection:D,isSelected:B,selectionMode:S,canManage:r,canManageAgents:h,onToggleSelect:()=>P(D.id),onOpen:()=>a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(D)}}),onToggleStatus:H=>ue(D.id,H),onDelete:()=>g.requestDelete(D)})},D.id)}),V.map(C=>t.jsx(sn,{item:C,canManage:r,allConnections:j,connectedAppNames:b,connectingItemId:T,onNavigateConnected:D=>a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(D)}}),onConnect:X},C.id)),(e==="all"||_)&&t.jsx("div",{ref:U,className:"col-span-full h-4"}),(e==="all"||_)&&I.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(de,{className:"size-6 text-muted-foreground"})})]})}),S&&t.jsx(un,{count:m.size,total:A.length,canManage:r,canManageAgents:h,onSelectAll:()=>{x(new Set(A.map(C=>C.id)))},onDeselectAll:()=>x(new Set),onDelete:()=>y(!0),onAddToAgent:()=>p(!0),onToggleStatus:je,onCancel:M})]})}function pn(){const s=te(),{org:e}=Ne(),n=ke(),u=qe({strict:!1}),{data:o}=Te.useSession(),{stdioEnabled:i}=Qe(),l=Ie(),{granted:a}=ye("connections:manage"),d=tn({namespace:e.slug,resource:"connections"}),f=Ve(),[j,g]=Je(Ye.connectionsTab(e.slug),b=>u.tab==="all"||u.tab==="connected"?u.tab:b??"all"),[r,h]=L.useState("ALL"),[m,x]=L.useState("ALL"),v=Ae(d.searchTerm).items,y=d.search!==d.searchTerm,c=Ze({resolver:et(Rt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),p=c.watch("ui_type"),T=c.watch("connection_url"),k=c.watch("npx_package"),w=he({uiType:p,connectionUrl:T??"",npxPackage:k??""})??De({uiType:p,connectionUrl:T??"",registryItems:v}),A=a&&u.action==="create",$=()=>{ee("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},P=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},M=async b=>{let _,V=null,Z=null,X=null;b.ui_type==="NPX"?(_="STDIO",V="",X=Xt(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(_="STDIO",V="",X=Gt(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(_=b.ui_type,V=b.connection_url||"",Z=b.connection_token||null);const N=ot("conn");ee("connection_custom_created",{connection_type:_,ui_type:b.ui_type}),await f.create.mutateAsync({id:N,title:b.title,description:b.description||null,connection_type:_,connection_url:V,connection_token:Z,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:e.id,icon:b.icon??null,app_name:null,app_id:null,connection_headers:X,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),P(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ae({app_name:null,connection_url:V,title:b.title,id:N})}})},I=b=>{b||(A&&P(),c.reset())},O=b=>{const _=b.trim();if(!_)return;const V=!!c.formState.dirtyFields.title,Z=!!c.formState.dirtyFields.description,X=!!c.formState.dirtyFields.env_vars,N=F=>{if(F&&(!V&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!Z&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!X&&F.envVarKeys?.length)){const ue=c.getValues("env_vars")??[],je=new Set(ue.map(C=>C.key)),ge=F.envVarKeys.filter(C=>!je.has(C));ge.length>0&&c.setValue("env_vars",[...ue,...ge.map(C=>({key:C,value:""}))],{shouldDirty:!0})}},z=Wt(_);if(z&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",z.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),N(he({uiType:"NPX",npxPackage:z.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const F=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",_,{shouldDirty:!0}),N(he({uiType:F,connectionUrl:_})??De({uiType:F,connectionUrl:_,registryItems:v}));return}p==="NPX"&&N(he({uiType:"NPX",npxPackage:_}))},U=a?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(E,{size:"sm",variant:"default",onClick:$,children:[t.jsx(ze,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:s("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const b=s("orgs.connections.createConnection"),_=s("orgs.connections.createConnectionDescription"),V=c.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),Z=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(G,{control:c.control,name:"ui_type",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:s("orgs.connections.type")}),t.jsxs($t,{value:N.value,onValueChange:N.onChange,children:[t.jsx(J,{children:t.jsx(Ot,{children:t.jsx(Ft,{})})}),t.jsxs(Ut,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),i&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),s("orgs.connections.npxPackage")]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Kt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Y,{})]})}),p==="NPX"&&t.jsx(G,{control:c.control,name:"npx_package",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:s("orgs.connections.npmPackage")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...N,value:N.value??"",onPaste:z=>{const F=z.clipboardData.getData("text");F&&(z.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),O(F))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Y,{})]})}),p==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(G,{control:c.control,name:"stdio_command",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:s("orgs.connections.command")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.commandPlaceholder"),...N,value:N.value??""})}),t.jsx(Y,{})]})}),t.jsx(G,{control:c.control,name:"stdio_args",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:s("orgs.connections.arguments")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.argumentsPlaceholder"),...N,value:N.value??""})}),t.jsx(Y,{})]})})]}),t.jsx(G,{control:c.control,name:"stdio_cwd",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:s("orgs.connections.workingDirectory")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...N,value:N.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(Y,{})]})})]}),(p==="NPX"||p==="STDIO")&&t.jsx(G,{control:c.control,name:"env_vars",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:s("orgs.connections.environmentVariables")}),t.jsx(J,{children:t.jsx(Ht,{value:N.value??[],onChange:N.onChange})}),t.jsx(Y,{})]})}),p!=="NPX"&&p!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(G,{control:c.control,name:"connection_url",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:s("orgs.connections.url")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.urlPlaceholder"),...N,value:N.value??"",onPaste:z=>{const F=z.clipboardData.getData("text");F&&(z.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),O(F))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Y,{})]})}),t.jsx(G,{control:c.control,name:"connection_token",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:w?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(J,{children:t.jsx(ne,{type:"password",placeholder:w?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...N,value:N.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:s("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Y,{})]})})]}),t.jsx(G,{control:c.control,name:"title",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:s("orgs.connections.name")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.namePlaceholder"),...N})}),t.jsx(Y,{})]})}),t.jsx(G,{control:c.control,name:"description",render:({field:N})=>t.jsxs(q,{children:[t.jsx(Q,{children:s("orgs.connections.description")}),t.jsx(J,{children:t.jsx(Vt,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...N,value:N.value??""})}),t.jsx(Y,{})]})})]}),X=A;return l?t.jsx(kt,{open:X,onOpenChange:I,children:t.jsxs(Tt,{className:"max-h-[90vh]",children:[t.jsx(wt,{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(At,{children:b}),t.jsx(It,{className:"mt-1",children:_})]}),t.jsx(Pt,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Le,{size:16})})})]})}),t.jsx(_e,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(M),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:Z}),t.jsx(Mt,{children:t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Ue,{open:X,onOpenChange:I,children:t.jsxs(Fe,{className:"sm:max-w-[525px]",children:[t.jsxs($e,{children:[t.jsx(Pe,{children:b}),t.jsx(Me,{children:_})]}),t.jsx(_e,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(M),children:[t.jsx("div",{className:"py-4",children:Z}),t.jsxs(Oe,{children:[t.jsx(E,{type:"button",variant:"outline",onClick:()=>I(!1),children:s("orgs.connections.cancel")}),t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{actions:U,children:s("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(lt,{value:d.search,onChange:d.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:b=>{b.key==="Escape"&&(d.setSearch(""),b.target.blur())}}),t.jsx(ct,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:s("orgs.connections.sortName")},{id:"description",label:s("orgs.connections.sortDescription")},{id:"connection_type",label:s("orgs.connections.sortType")},{id:"updated_by",label:s("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:s("orgs.connections.sortUpdated")}],filters:[{label:s("orgs.connections.filterType"),value:r,onChange:b=>h(b||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:s("orgs.connections.filterStatus"),value:m,onChange:b=>x(b||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"active",label:s("orgs.connections.filterActive")},{id:"inactive",label:s("orgs.connections.filterInactive")},{id:"error",label:s("orgs.connections.filterError")}]}]})]})}),t.jsx(rt,{placement:"page",tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:j,onTabChange:b=>{const _=b;_!==j&&ee("connections_page_tab_changed",{to_tab:_}),g(_)}}),t.jsx(L.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:y?.5:1,transition:y?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:y?"none":"auto"},children:t.jsx(mn,{listState:d,activeTab:j,typeFilter:r,statusFilter:m})})})]})})})]})})}function Ms(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(L.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx(pn,{})})}),s[0]=e):e=s[0],e}export{Ms as default};
|