decocms 4.513.3 → 4.513.4
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/{ActiveShapeUtils-CV2gQvF0.js → ActiveShapeUtils-CAxkWTE7.js} +1 -1
- package/dist/client/assets/{AlertCircle-Czw3GOXM.js → AlertCircle-iwRSZJFi.js} +1 -1
- package/dist/client/assets/{AreaChart-BhM70eeA.js → AreaChart-BCUK2U_v.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CBNZ6Kc8.js → ArrowLeft-_QxYwR3P.js} +1 -1
- package/dist/client/assets/{ArrowUp-D1TV4x6T.js → ArrowUp-CWx4kMsV.js} +1 -1
- package/dist/client/assets/{BarChart-BV8WJLUg.js → BarChart-BFfaTlE7.js} +1 -1
- package/dist/client/assets/{Building02-BufOoi54.js → Building02-Dcs_HLaa.js} +1 -1
- package/dist/client/assets/{CartesianChart-ButQNI6T.js → CartesianChart-DxoYDxJN.js} +1 -1
- package/dist/client/assets/{CategoricalChart-CU6wjw2Q.js → CategoricalChart-BWxwmOFO.js} +1 -1
- package/dist/client/assets/{CheckCircle-C6kHCEBQ.js → CheckCircle-X3D4eq-V.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-CREWgR2i.js → ChevronSelectorVertical-7X_EL11G.js} +1 -1
- package/dist/client/assets/{ChevronUp-DZ6u-CDn.js → ChevronUp-BlFhjumO.js} +1 -1
- package/dist/client/assets/{Copy01-Br8MuAU9.js → Copy01-CsyaL0tc.js} +1 -1
- package/dist/client/assets/{CreditCard01-BLe5-9IQ.js → CreditCard01-DZn9m-o1.js} +1 -1
- package/dist/client/assets/{DotsVertical-DgdCLmlp.js → DotsVertical-H16dBinG.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-D8FHRXZQ.js → ErrorBarContext-IXpluzmX.js} +1 -1
- package/dist/client/assets/{Globe04-BkNwdwoM.js → Globe04-B5AbE2NG.js} +1 -1
- package/dist/client/assets/{Image01-DxuLkpjX.js → Image01-C-r__mWH.js} +1 -1
- package/dist/client/assets/{Key01-Qdm6kw39.js → Key01-D8PhPz3k.js} +1 -1
- package/dist/client/assets/{Link01-B4M7ojFg.js → Link01-BZlTJYwG.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CJN7aOrV.js → LinkBroken01-y64X2SC-.js} +1 -1
- package/dist/client/assets/{Monitor01-CHS3e170.js → Monitor01-Ccoz_3RV.js} +1 -1
- package/dist/client/assets/{Play-Da27xlG_.js → Play-B8dkIMIB.js} +1 -1
- package/dist/client/assets/{Plus-D0ucptrV.js → Plus-D_siv_aA.js} +1 -1
- package/dist/client/assets/{ReferenceLine-CoS52beo.js → ReferenceLine-DBHRjJZR.js} +1 -1
- package/dist/client/assets/{SearchMd-0qnilUuy.js → SearchMd-KKuAy3kv.js} +1 -1
- package/dist/client/assets/{Sector-CKh2L0yG.js → Sector-BpwYW3Qx.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DV74WoBV.js → ShoppingBag01-COYAkOJY.js} +1 -1
- package/dist/client/assets/{Sun-D0O3J2yf.js → Sun-s_f7cajm.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-Ba0pyLay.js → SwitchHorizontal01-ZjaXGph0.js} +1 -1
- package/dist/client/assets/{Tool01-C0454p2c.js → Tool01-Bsd9MAXv.js} +1 -1
- package/dist/client/assets/{Trash01-CyxedK0n.js → Trash01-CqbCnp4Y.js} +1 -1
- package/dist/client/assets/{Upload01-BWpYXx52.js → Upload01-BuL02EP8.js} +1 -1
- package/dist/client/assets/{User01-Bb04dh7g.js → User01-DOqRt8wn.js} +1 -1
- package/dist/client/assets/{UserSquare-B_weldPC.js → UserSquare-CEX9DbWl.js} +1 -1
- package/dist/client/assets/{Users01-CNd-hMC8.js → Users01-n5qz8jdG.js} +1 -1
- package/dist/client/assets/{XClose-BeqwQ2Ei.js → XClose-BQ9Dlu1I.js} +1 -1
- package/dist/client/assets/{ZoomOut-DWT1qHXA.js → ZoomOut-CYcrWaFo.js} +1 -1
- package/dist/client/assets/{access-gate-mycOF7cD.js → access-gate-CCU3Jeds.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BkWp2fK0.js → add-connection-dialog-CJKZey2r.js} +1 -1
- package/dist/client/assets/{agent-analytics-B5byH36W.js → agent-analytics-BpgXx7qA.js} +1 -1
- package/dist/client/assets/agent-app-DDRmQd75.js +1 -0
- package/dist/client/assets/{agent-assets-pGTlMleF.js → agent-assets-BsicbZIc.js} +1 -1
- package/dist/client/assets/{agent-automation-D5u89G2_.js → agent-automation-BSqPTL3r.js} +1 -1
- package/dist/client/assets/{agent-automations-C4_XXiyv.js → agent-automations-CORWjDg5.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-C5p-0QMu.js → agent-connect-sources-nNFgzgd5.js} +1 -1
- package/dist/client/assets/agent-deck-sUBVFl57.js +1 -0
- package/dist/client/assets/{agent-e2e-Ce5bkH9z.js → agent-e2e-Q2mMYbFI.js} +1 -1
- package/dist/client/assets/{agent-experiments-D4NapCfE.js → agent-experiments-GpUhBLmP.js} +1 -1
- package/dist/client/assets/agent-file-Ay2rdSNY.js +1 -0
- package/dist/client/assets/{agent-hosting-ftgEMkT0.js → agent-hosting-B2Nl1zb-.js} +1 -1
- package/dist/client/assets/{agent-icon-C0Cpk_fI.js → agent-icon-DMH8Ftve.js} +1 -1
- package/dist/client/assets/agent-library-DQTTsoBq.js +1 -0
- package/dist/client/assets/agent-library-file-CoPN3Dl5.js +1 -0
- package/dist/client/assets/{agent-monitor-C-1u284m.js → agent-monitor-CvRpbef5.js} +1 -1
- package/dist/client/assets/{agent-overview-B5DYE-Ji.js → agent-overview-CIwIxcfm.js} +1 -1
- package/dist/client/assets/{agent-releases-aHzQJT8R.js → agent-releases-BX6W8KKx.js} +1 -1
- package/dist/client/assets/agent-settings-Da0_9JGD.js +1 -0
- package/dist/client/assets/{agent-site-editor-CPMVDSTZ.js → agent-site-editor-0D-T7ieN.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-B98Bnadv.js +2 -0
- package/dist/client/assets/agent-site-editor-content-87ZLW9rs.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-DD0qYhLr.js +1 -0
- package/dist/client/assets/agent-view-BPSlOxjt.js +1 -0
- package/dist/client/assets/{agent-view-guard-DNE4CXyR.js → agent-view-guard-DG6ZTgu0.js} +1 -1
- package/dist/client/assets/{agents-list-BeohBYvm.js → agents-list-DJAFMczy.js} +1 -1
- package/dist/client/assets/{ai-providers-BYfFnvED.js → ai-providers-CkTtAKoL.js} +1 -1
- package/dist/client/assets/{alert-fFwi0Rct.js → alert-BpKmtk7d.js} +1 -1
- package/dist/client/assets/{alert-dialog-DBOmU5EL.js → alert-dialog-CgRaXWeG.js} +1 -1
- package/dist/client/assets/{analytics-sections-BSFzvx60.js → analytics-sections-DmbiPFV0.js} +1 -1
- package/dist/client/assets/{api-keys-CjBRjWKE.js → api-keys-B8qmKYTS.js} +1 -1
- package/dist/client/assets/api-keys-CigsOsqY.js +1 -0
- package/dist/client/assets/{app-editor-9oqlCdGz.js → app-editor-BQE1NaFI.js} +1 -1
- package/dist/client/assets/{asset-utils-DRLxCAgr.js → asset-utils-CW4a0Tss.js} +1 -1
- package/dist/client/assets/{auth-BPJq9uZN.js → auth-Bjnc521y.js} +1 -1
- package/dist/client/assets/{auth-catchall-D2arJj-l.js → auth-catchall-CJDXycwe.js} +1 -1
- package/dist/client/assets/{auth-entry-BUYS1aRG.js → auth-entry-DKyMW2UQ.js} +1 -1
- package/dist/client/assets/{auth-split-layout-B60d6um2.js → auth-split-layout-BJfKUnO6.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CEKJsXYr.js → authenticate-and-persist-oauth-DK-E6e3Z.js} +1 -1
- package/dist/client/assets/{automation-list-row-BKl9kQg2.js → automation-list-row-DybT-MIG.js} +1 -1
- package/dist/client/assets/{automation-runs-Bc4ZG8Cd.js → automation-runs-DvbgOsZD.js} +1 -1
- package/dist/client/assets/{automations-Byx2iIlC.js → automations-DEtpbM4Z.js} +1 -1
- package/dist/client/assets/{autosend-BRrz2Y4f.js → autosend-D1RPfsoi.js} +1 -1
- package/dist/client/assets/{avatar--bVWjvdf.js → avatar-B2nFfSHv.js} +1 -1
- package/dist/client/assets/{badge-O9zNBxIS.js → badge-CRNAVwfV.js} +1 -1
- package/dist/client/assets/{block-document-EMb4OAJD.js → block-document-9nzhTDhY.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-CswMFv9v.js → blocks-preview-workspace-context-BGEsHkZW.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-CXGOEMTq.js → blocks-tab-states-7xd0L-RH.js} +3 -3
- package/dist/client/assets/{blog-schema-BBgfoIQP.js → blog-schema-CPbtg-YY.js} +1 -1
- package/dist/client/assets/{board-analytics-BnyzhqyI.js → board-analytics-DfcXMGIx.js} +1 -1
- package/dist/client/assets/{buckets-CScAlRwn.js → buckets-CmybaOoN.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DZKU2eq8.js → build-improve-prompt-doc-C4jIZJDS.js} +1 -1
- package/dist/client/assets/{calendar-DsjGYQg2.js → calendar-CBcRt8Oe.js} +1 -1
- package/dist/client/assets/{capability-load-error-D5sZmG67.js → capability-load-error-CKIgKs8S.js} +1 -1
- package/dist/client/assets/{category-editor-TdrhQc2d.js → category-editor-WcaRs-tk.js} +1 -1
- package/dist/client/assets/{chart-CdJbyFrF.js → chart-k_AUhfu2.js} +1 -1
- package/dist/client/assets/{chat-context-Dnn7Mdeu.js → chat-context-70xHoaxp.js} +1 -1
- package/dist/client/assets/{chat-draft-QF0rnEVx.js → chat-draft-Nb1SIeYI.js} +1 -1
- package/dist/client/assets/{checkbox-_9cHZuVh.js → checkbox-CwspTWv-.js} +1 -1
- package/dist/client/assets/{choose-editor-DjeEuPt0.js → choose-editor-B_p_lpqj.js} +1 -1
- package/dist/client/assets/{cli-auth-success-s_E43D3X.js → cli-auth-success-DWqeUnva.js} +1 -1
- package/dist/client/assets/{client-icons-CnZ15Laz.js → client-icons-DYkySYk1.js} +1 -1
- package/dist/client/assets/cms-settings-editor-BGIEXOlq.js +1 -0
- package/dist/client/assets/{collapsible-CzHslCH_.js → collapsible-CKlYJ7JC.js} +1 -1
- package/dist/client/assets/{collection-detail-DRUItL6q.js → collection-detail-FEHQdrUM.js} +1 -1
- package/dist/client/assets/{collection-display-button-BLKqGGaY.js → collection-display-button-CEiwIbk0.js} +1 -1
- package/dist/client/assets/{collection-search-BiaY0GVT.js → collection-search-ZGgli3wR.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-ymUDH0Iy.js → collection-table-wrapper-BJKQfvlr.js} +1 -1
- package/dist/client/assets/{collection-tabs-BLEBGgk-.js → collection-tabs-C331r2n4.js} +1 -1
- package/dist/client/assets/{column-rules-B7xl4xQZ.js → column-rules-CoEiTMWe.js} +1 -1
- package/dist/client/assets/{combobox-CdVSN4C-.js → combobox-D7TXxp7o.js} +1 -1
- package/dist/client/assets/{coming-soon-page-DU1ARjbb.js → coming-soon-page-CUty8r32.js} +1 -1
- package/dist/client/assets/{command-BwFTVPCg.js → command-CAYMLhJL.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-wyIo_eN7.js → companion-mcps-section-BHQ5YIJi.js} +1 -1
- package/dist/client/assets/{config-D3pVqIKI.js → config-B5hUFPIX.js} +1 -1
- package/dist/client/assets/{connect-DBOmX-8C.js → connect-Cj4-EZJC.js} +1 -1
- package/dist/client/assets/{connect-layout-BI0GOmFg.js → connect-layout-CmN5RxRi.js} +1 -1
- package/dist/client/assets/{connection-DdsAVMED.js → connection-CEjWhO8M.js} +1 -1
- package/dist/client/assets/{connection-card-DquRZmyq.js → connection-card-Qtm3n_hS.js} +1 -1
- package/dist/client/assets/{connection-detail-C2_9jZRg.js → connection-detail-Du-3dW0g.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CppaGv96.js → connection-form-helpers-C8PcIQLm.js} +1 -1
- package/dist/client/assets/{connections-CPYwbOBM.js → connections-CrNA73Wo.js} +1 -1
- package/dist/client/assets/{content-tab-BGK1XaKL.js → content-tab-CRvcTJJ2.js} +3 -3
- package/dist/client/assets/{context-D2VrQMS2.js → context-BqWdy054.js} +1 -1
- package/dist/client/assets/{context-menu-D1SjU6l-.js → context-menu-CdwmTDFy.js} +1 -1
- package/dist/client/assets/{context-shell-CKI9uW2C.js → context-shell-CwudT8OH.js} +3 -3
- package/dist/client/assets/{core.esm-DnTbXhD8.js → core.esm-uZtRM3l4.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BIJBsiHg.js → create-organization-dialog-CJin8Jxw.js} +1 -1
- package/dist/client/assets/{daily-pulse-Drk3CnaM.js → daily-pulse-DTkBeVsw.js} +1 -1
- package/dist/client/assets/{discover-BDubv_ZJ.js → discover-DGpiIGQv.js} +1 -1
- package/dist/client/assets/{domain-settings-CCe7QH7l.js → domain-settings-BmE4V_Yd.js} +1 -1
- package/dist/client/assets/{drawer-CTSig7Vj.js → drawer-CkgkUBCk.js} +1 -1
- package/dist/client/assets/{editor-B8TTVjFi.js → editor-B2CFLfaQ.js} +1 -1
- package/dist/client/assets/{editor-classes-BUSqIt7e.js → editor-classes-DcYQ4Aap.js} +1 -1
- package/dist/client/assets/{empty-state-DIpCFPkI.js → empty-state-BZa0U-xG.js} +1 -1
- package/dist/client/assets/{empty-state-DweMe7pE.js → empty-state-DAdNQg6Y.js} +1 -1
- package/dist/client/assets/{extract-connection-data-C2M3P64h.js → extract-connection-data-BpdUae_j.js} +1 -1
- package/dist/client/assets/{feature-gate-hxH8uzOp.js → feature-gate-DKD0xNwQ.js} +1 -1
- package/dist/client/assets/{feature-paywall-5JkjVbP-.js → feature-paywall-BqNVafLn.js} +1 -1
- package/dist/client/assets/{file-explorer-CsGruqCR.js → file-explorer-BrcXVEUy.js} +1 -1
- package/dist/client/assets/{file-preview-ySEcJuT1.js → file-preview-pejw4DEs.js} +1 -1
- package/dist/client/assets/{file-share-button-BcJLFZEu.js → file-share-button-AFuoJHS8.js} +1 -1
- package/dist/client/assets/{file-type-icon-CBmuqe9u.js → file-type-icon-2Asg9IKB.js} +1 -1
- package/dist/client/assets/flat-project-COKm-_lB.js +1 -0
- package/dist/client/assets/{folder-icon-BbG7eONI.js → folder-icon-DqT7qo5j.js} +1 -1
- package/dist/client/assets/{form-CGiGUgzW.js → form-DidHa5sD.js} +1 -1
- package/dist/client/assets/{general-40Wry3sr.js → general-BF4C2ZJb.js} +1 -1
- package/dist/client/assets/{home-CuekDzCb.js → home-fSRcvGJQ.js} +1 -1
- package/dist/client/assets/{hosted-publish-feedback-Dj41Gksp.js → hosted-publish-feedback-DbuE45Er.js} +1 -1
- package/dist/client/assets/{icon-button-D0a6m1Sz.js → icon-button-iwZ3O0_B.js} +1 -1
- package/dist/client/assets/{index-Ct79h6Jq.js → index-B2vL4Txo.js} +1 -1
- package/dist/client/assets/{index-fdN8eXM2.js → index-BdqfOdIE.js} +1 -1
- package/dist/client/assets/{index-CEYZyBqV.js → index-BjUY_TPp.js} +1 -1
- package/dist/client/assets/{index-Cn8WHbCR.js → index-BpuRA4Yb.js} +1 -1
- package/dist/client/assets/{index-C5AhGK9V.js → index-CUOlm63w.js} +3 -3
- package/dist/client/assets/{index-BL53jR3y.js → index-Cex7aoHx.js} +1 -1
- package/dist/client/assets/{index-eirpwNKj.js → index-Cmhl3zNb.js} +2 -2
- package/dist/client/assets/{index-BgaKQ-Q-.js → index-CzrtR5Z7.js} +1 -1
- package/dist/client/assets/{index-C1nhsm_w.js → index-D-4AgGmD.js} +1 -1
- package/dist/client/assets/{index-YSmMnHTP.js → index-D2R52OCR.js} +1 -1
- package/dist/client/assets/{index-DZWoZhT5.js → index-D69M9S-D.js} +1 -1
- package/dist/client/assets/{index-D_cOu6AK.js → index-DL_AHT72.js} +1 -1
- package/dist/client/assets/{index-DOjuGDiB.js → index-DNlGRld6.js} +1 -1
- package/dist/client/assets/{index-FsB7lUoK.js → index-DVqdGkOX.js} +1 -1
- package/dist/client/assets/{index-CQodxdYF.js → index-DhA7J1aJ.js} +1 -1
- package/dist/client/assets/{index-DMApSpFV.js → index-lwornGU3.js} +1 -1
- package/dist/client/assets/{index-redirect-Dk2uc0Gh.js → index-redirect-CZXJxQAy.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-47K3Cxqe.js → infiniteQueryObserver-978TY1hh.js} +1 -1
- package/dist/client/assets/{infra-billing-CE_ELMRw.js → infra-billing-C59D5YaM.js} +1 -1
- package/dist/client/assets/{input-BH9IvcPC.js → input-CbMPZsxE.js} +1 -1
- package/dist/client/assets/{input-DdEOORL2.js → input-DVPmZILt.js} +3 -3
- package/dist/client/assets/{integration-icon-CKknGZhR.js → integration-icon-CktagpLu.js} +1 -1
- package/dist/client/assets/{jira-icon-DreVKI44.js → jira-icon-eYd_xfOx.js} +1 -1
- package/dist/client/assets/{label-BL4W2KPI.js → label-COA0amPU.js} +1 -1
- package/dist/client/assets/{layout-B6GTwWgR.js → layout-C-tE3imG.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-h-k8kxkI.js → legacy-agents-deep-CPmss93q.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-D6Wq6vr4.js → legacy-main-redirect-B8hjRkjB.js} +1 -1
- package/dist/client/assets/library-OhQHeeUu.js +1 -0
- package/dist/client/assets/{library-tab-6tliBei-.js → library-tab-CHu062C1.js} +1 -1
- package/dist/client/assets/{login-2dWlgBxu.js → login-BN5lalgG.js} +1 -1
- package/dist/client/assets/{markdown-BjPIZk-u.js → markdown-DntfPEgK.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-afmtzlAD.js → mcp-app-renderer-CFqAYLtv.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DJh33UXx.js → mcp-oauth-DqjrYGbv.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DqMHjHip.js → mcp-oauth-jIbhs8wE.js} +1 -1
- package/dist/client/assets/{members-De3ITOSK.js → members-CikLEMEO.js} +1 -1
- package/dist/client/assets/{memory-Bd-agrjz.js → memory-CTulcnPs.js} +1 -1
- package/dist/client/assets/{mini-report-page-qugNBWyG.js → mini-report-page-C4z6zUee.js} +1 -1
- package/dist/client/assets/{mock-board-DsyG_BKd.js → mock-board-C-bx3LOx.js} +1 -1
- package/dist/client/assets/{monaco-editor-frZbpSC4.js → monaco-editor-94ag9h78.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CbmvtcQ8.js → monitoring-stats-row-BiBXmqEX.js} +1 -1
- package/dist/client/assets/monitoring-zFjmyWaK.js +1 -0
- package/dist/client/assets/{multi-select-mMhkiaxx.js → multi-select-CknX6tqH.js} +1 -1
- package/dist/client/assets/{mustache-BE_jNzrX.js → mustache-CHjvX4mG.js} +1 -1
- package/dist/client/assets/{new-project-dialog-BMxQGh6T.js → new-project-dialog-Y_XjAxS_.js} +1 -1
- package/dist/client/assets/{oauth-callback-NxseMyYt.js → oauth-callback-CuyXteK1.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-JHRZj7cm.js → oauth-callback-ai-provider-mmuJSvU9.js} +1 -1
- package/dist/client/assets/{onboarding-BNSpsBHl.js → onboarding-rJV8oAVf.js} +1 -1
- package/dist/client/assets/{openai-conversation-B9wySkKU.js → openai-conversation-DMiHuV_M.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-DqJuR4Ij.js → optimistic-project-sidebar-views-CGSVQMMQ.js} +1 -1
- package/dist/client/assets/{order-monitor-day-DTRXFSPm.js → order-monitor-day-BYmFkC3g.js} +1 -1
- package/dist/client/assets/{organization-choice-D_pQMc9T.js → organization-choice-uNKN81tq.js} +1 -1
- package/dist/client/assets/{orgs-CsIZaTyi.js → orgs-DsslXidX.js} +1 -1
- package/dist/client/assets/{page-seo-form-DAN_oC73.js → page-seo-form-ysYceart.js} +1 -1
- package/dist/client/assets/{pair-BERDoCro.js → pair-CCzeqHVB.js} +1 -1
- package/dist/client/assets/plan-DirWo8wP.js +1 -0
- package/dist/client/assets/{plan-ladder-DL1JtpvS.js → plan-ladder-DYIZDWtc.js} +1 -1
- package/dist/client/assets/{popover-oZJ3oDMA.js → popover-YaXt6bOC.js} +1 -1
- package/dist/client/assets/{post-calendar-DfH5svUX.js → post-calendar-BT_Rw0Q6.js} +1 -1
- package/dist/client/assets/{post-editor-hWgegmwE.js → post-editor-COleSFOD.js} +1 -1
- package/dist/client/assets/{preview-content-PTYjaSyC.js → preview-content-C1Rk597M.js} +1 -1
- package/dist/client/assets/{preview-dialog-4ft9O22y.js → preview-dialog-BTsQwEhu.js} +1 -1
- package/dist/client/assets/{preview-panel-DM51Fpvo.js → preview-panel-HJZsRhmr.js} +1 -1
- package/dist/client/assets/{preview-tab-CNeiDQgU.js → preview-tab-DVJzXKEK.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-BDff_MLx.js → product-picker-dialog-B0S08IE6.js} +1 -1
- package/dist/client/assets/{profile-_0v0w_uk.js → profile-BAcwiajI.js} +1 -1
- package/dist/client/assets/{project-app-view-D_QJpB96.js → project-app-view-e6WdBuWR.js} +1 -1
- package/dist/client/assets/{project-apps-BRjQ6ES3.js → project-apps-bT8vigK2.js} +1 -1
- package/dist/client/assets/{project-feed-CYGKnY4Q.js → project-feed-qY5aN-GD.js} +1 -1
- package/dist/client/assets/{project-icon-D_aSXDOt.js → project-icon-CIzqFWaQ.js} +1 -1
- package/dist/client/assets/project-reports-DQGUzueG.js +1 -0
- package/dist/client/assets/project-tasks-B1VrMiAq.js +1 -0
- package/dist/client/assets/{projects-BmIdJmG4.js → projects-BsK-2g1X.js} +1 -1
- package/dist/client/assets/{projects-empty-state-BdoV9-x8.js → projects-empty-state-Bw7Hl-T4.js} +1 -1
- package/dist/client/assets/{prompts-BSkHwl6y.js → prompts-BN3p2ELV.js} +1 -1
- package/dist/client/assets/record-editor-DD50VfEv.js +1 -0
- package/dist/client/assets/{redirect-editor-CtFVIrY2.js → redirect-editor-CVdnjBHw.js} +1 -1
- package/dist/client/assets/{reports-CLhp1Pr5.js → reports-DB2vUJ0m.js} +1 -1
- package/dist/client/assets/reports-DCFnios-.js +1 -0
- package/dist/client/assets/{reports-onboarding-C8PLHLPc.js → reports-onboarding-DG16InmK.js} +1 -1
- package/dist/client/assets/{reports-tab-DDrFZP3m.js → reports-tab-CiJ9MhGs.js} +2 -2
- package/dist/client/assets/repositories-CuvgQNAy.js +1 -0
- package/dist/client/assets/{repositories-DoNhvU-g.js → repositories-DVlGH0wi.js} +1 -1
- package/dist/client/assets/{repository-binding-BNbbDYQQ.js → repository-binding-X3TRktCN.js} +1 -1
- package/dist/client/assets/{repository-import-picker-CMsE5EOk.js → repository-import-picker-DVf3Vnm6.js} +1 -1
- package/dist/client/assets/{repository-picker-DOtWfpYo.js → repository-picker-B8x2K0Wa.js} +1 -1
- package/dist/client/assets/{require-capability-CBG6rA7o.js → require-capability-sXOC3J02.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Dz1OowhH.js → required-auth-layout-Dxnpn4YU.js} +1 -1
- package/dist/client/assets/{reset-password-v_UkU5Xg.js → reset-password-CZ33ExeQ.js} +1 -1
- package/dist/client/assets/{resizable-CWaYgp8D.js → resizable-DKp6vSsG.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-B2EU-8BB.js → resolve-tab-icon-SxG6TPRU.js} +1 -1
- package/dist/client/assets/{review-settings-BZhzjgRq.js → review-settings-g25PFo2o.js} +1 -1
- package/dist/client/assets/{roles-Y2HKVQnL.js → roles-C_YmoM1c.js} +1 -1
- package/dist/client/assets/route-BsG_rQz2.js +1 -0
- package/dist/client/assets/{route-7L_TW384.js → route-DKuH8vLv.js} +1 -1
- package/dist/client/assets/{route-DPCqrSJX.js → route-DeOeP4Wq.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-Pb8-9nPA.js → sandbox-lifecycle-context-CrtkjvLt.js} +1 -1
- package/dist/client/assets/{schema-C1o97tHt.js → schema-ChwlN9B2.js} +1 -1
- package/dist/client/assets/{schema-CviV2OeO.js → schema-nN2fVtd3.js} +1 -1
- package/dist/client/assets/{scroll-area-D2V3l6oK.js → scroll-area-DDy8s3Ss.js} +1 -1
- package/dist/client/assets/{search-input-Bq9urCGV.js → search-input-DBKGcZuw.js} +1 -1
- package/dist/client/assets/{search-toggle-DwZ6dTB5.js → search-toggle-CLG4gmKJ.js} +1 -1
- package/dist/client/assets/{secret-ciphertext-BkXDtxC6.js → secret-ciphertext-COE-QTj7.js} +1 -1
- package/dist/client/assets/{secret-picker-BoK4uSMi.js → secret-picker-DHJiW7t8.js} +1 -1
- package/dist/client/assets/{secrets-C0qlLAI4.js → secrets-Br2wfWxI.js} +1 -1
- package/dist/client/assets/{sections-CR_pzMlx.js → sections-DeEHL6VG.js} +1 -1
- package/dist/client/assets/{sections-editor-BK3_J9sX.js → sections-editor-A_RH8q6f.js} +1 -1
- package/dist/client/assets/{select-C5-hj9Ts.js → select-BFXL8R1G.js} +1 -1
- package/dist/client/assets/{select-model-CwXefPFG.js → select-model-BEL7Tbo9.js} +1 -1
- package/dist/client/assets/{seo-editor-CSy5-rpo.js → seo-editor--98cMxSm.js} +1 -1
- package/dist/client/assets/{separator-BD6ld_rn.js → separator-gsO2sYby.js} +1 -1
- package/dist/client/assets/settings-tab-BXdif76g.js +1 -0
- package/dist/client/assets/{sheet-s29eirRf.js → sheet-CYoLylxA.js} +1 -1
- package/dist/client/assets/{shell-layout-DS0Ye6S1.js → shell-layout-CtdsDlSz.js} +1 -1
- package/dist/client/assets/site-editor-BojLUeGp.js +1 -0
- package/dist/client/assets/{site-editor-toast-C5e-1uEv.js → site-editor-toast-g-4xfmJ4.js} +1 -1
- package/dist/client/assets/{skills-pQpcosHp.js → skills-BRiGDde6.js} +1 -1
- package/dist/client/assets/{slider-P84DbLvc.js → slider-CpXtUVDi.js} +1 -1
- package/dist/client/assets/{sortable.esm-DMQ-WncJ.js → sortable.esm-CwAjqrb2.js} +1 -1
- package/dist/client/assets/{sso-BaZj_16B.js → sso-D0IDI51o.js} +1 -1
- package/dist/client/assets/{suggestion-BtCYsnHk.js → suggestion-Bv3b6MxU.js} +1 -1
- package/dist/client/assets/{switch-COyvKYHV.js → switch-CvZlxlV0.js} +1 -1
- package/dist/client/assets/{symbol-DE4EJv1h.js → symbol-BmpW8_Es.js} +1 -1
- package/dist/client/assets/{synced-repos-BchTuYeZ.js → synced-repos-_e-rYrNS.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-Bd77emAf.js → tab-icon-glyph-CHxD5oom.js} +1 -1
- package/dist/client/assets/{table-E7GbRtTD.js → table-B26a0ePo.js} +1 -1
- package/dist/client/assets/{tabs-DWtBgLg_.js → tabs-BEPPtBqO.js} +1 -1
- package/dist/client/assets/{task-assignee-avatar-DTLURih6.js → task-assignee-avatar-BUQ0pMCX.js} +1 -1
- package/dist/client/assets/{task-board-fU-Cl8m2.js → task-board-C1s59vKR.js} +1 -1
- package/dist/client/assets/{task-route-DuNmXwWp.js → task-route-BzBoe3sC.js} +1 -1
- package/dist/client/assets/{task-status-wpuxJDO5.js → task-status-CErsPlHV.js} +1 -1
- package/dist/client/assets/taskboard-analytics-h_2DA62k.js +1 -0
- package/dist/client/assets/tasks-BkgOKiT9.js +1 -0
- package/dist/client/assets/{tasks-B4X2VVxT.js → tasks-tr_d8SW4.js} +1 -1
- package/dist/client/assets/{textarea-BDL4MHBS.js → textarea-CMJRBl6x.js} +1 -1
- package/dist/client/assets/{thread-analytics-0ZqqwnzE.js → thread-analytics-CeNaBD4e.js} +1 -1
- package/dist/client/assets/{thread-intent-DzC9Ji46.js → thread-intent-CCu0BEYJ.js} +1 -1
- package/dist/client/assets/{thread-route-DuRhXh4I.js → thread-route--bdvrJML.js} +1 -1
- package/dist/client/assets/{thread-route-D0aLhRkR.js → thread-route-C2rii--a.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-VXXOBFly.js → thread-sheet-body-BVs76jnQ.js} +1 -1
- package/dist/client/assets/{time-range-picker-vYJ0Kk8S.js → time-range-picker-CMbmxxqv.js} +1 -1
- package/dist/client/assets/{toggle-group-CRigS0R4.js → toggle-group-a7j08s-f.js} +1 -1
- package/dist/client/assets/{tool-namespace-DPiptzHh.js → tool-namespace-CRTO9xOA.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-uuYUYVtr.js → toolbar-icon-button-BsOv6rvJ.js} +1 -1
- package/dist/client/assets/{tooltip-DX3EibzC.js → tooltip-kZk2wAMk.js} +1 -1
- package/dist/client/assets/{tooltipContext-DiSBImQr.js → tooltipContext-DIsnCXpc.js} +1 -1
- package/dist/client/assets/{track-D-YCF_rE.js → track-C_ZVQYs-.js} +1 -1
- package/dist/client/assets/{types-BmDn-Bmr.js → types-CD9jRVDk.js} +1 -1
- package/dist/client/assets/{url-slug-BjYL2qGa.js → url-slug-CXYaPIEX.js} +1 -1
- package/dist/client/assets/{usage-stats-DViGt9Z5.js → usage-stats-B3aY2c0l.js} +1 -1
- package/dist/client/assets/{use-ai-providers-XvM2-sU7.js → use-ai-providers-D84PtMSN.js} +1 -1
- package/dist/client/assets/{use-automations-BP7Qo80Q.js → use-automations-CAJcdhxV.js} +1 -1
- package/dist/client/assets/{use-autosave-DLpdlg6z.js → use-autosave-Cve7LmNN.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-BEn27bqi.js → use-chat-layout-state-4I8rtQwF.js} +1 -1
- package/dist/client/assets/{use-clock-tick--0G9fYV8.js → use-clock-tick-CgUj6u2i.js} +1 -1
- package/dist/client/assets/{use-connect-companion-Byfe_uLr.js → use-connect-companion-CCaa-yxn.js} +1 -1
- package/dist/client/assets/{use-connection-C4wyl2ru.js → use-connection-CikB9KcW.js} +1 -1
- package/dist/client/assets/{use-content-sync-BdbVP04j.js → use-content-sync-DX7UAl_W.js} +1 -1
- package/dist/client/assets/{use-copy-BS5soA37.js → use-copy-DzgBkNLT.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Bgr2d-1k.js → use-create-virtual-mcp-BCKaQYpl.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-D_SHRVT8.js → use-date-fns-locale-Dy4Oeqx-.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CteI237O.js → use-debounced-autosave-DR5Ahrkc.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DGbphRsM.js → use-debounced-value-C7Ih1llI.js} +1 -1
- package/dist/client/assets/{use-deco-credits-B7vnPi2P.js → use-deco-credits-ByP4Of99.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DTU6iW_4.js → use-decopilot-events-CBhHAjRY.js} +1 -1
- package/dist/client/assets/{use-delete-connection-v7vjwrBf.js → use-delete-connection-CjpOj4k7.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Cr49Ea_9.js → use-deployment-admin-CqgXaT_z.js} +1 -1
- package/dist/client/assets/{use-ensure-project-folder-BiBJcIU0.js → use-ensure-project-folder-BzFrwFoN.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-CUkbW62G.js → use-fast-preview-draft-url-R7ofHb_D.js} +1 -1
- package/dist/client/assets/{use-file-configs-dTlYe09H.js → use-file-configs-DhEp4msd.js} +1 -1
- package/dist/client/assets/{use-inbox-feed-d4Pg1vDp.js → use-inbox-feed-CZjjQk7K.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DYPYtqG2.js → use-infinite-scroll-DQl4a0Bs.js} +1 -1
- package/dist/client/assets/{use-join-requests-CgaNoIHU.js → use-join-requests-BIuh8dt2.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-bEgIKNUF.js → use-main-panel-tabs-BS-Dp3CX.js} +1 -1
- package/dist/client/assets/{use-main-schema-v8-BpRBE2if.js → use-main-schema-v8-DmthzehD.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-XO9Yp1aB.js → use-mcp-auth-status-BQFxszTc.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DA050uNw.js → use-mcp-client-CedU4dWV.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-C_C6tlAY.js → use-mcp-prompts-CdDNTlaE.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DDRwYO6T.js → use-mcp-tools-CcHLNRd3.js} +1 -1
- package/dist/client/assets/{use-members-C4ay671C.js → use-members-BI_Z9G2i.js} +1 -1
- package/dist/client/assets/{use-mobile-BsNhhNj1.js → use-mobile-CY0Djv_M.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-y0z5Ii2q.js → use-navigate-to-agent-cdHnGUXB.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-B2tbuRiV.js → use-open-billing-url-C9VcD5z_.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Cn5Gs8uE.js → use-org-auth-client-Cy7UT2_Z.js} +1 -1
- package/dist/client/assets/{use-org-fs-QKl-Epzm.js → use-org-fs-BzlMLYdA.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DkE7BEdc.js → use-org-repo-syncs-Bbiq7vxl.js} +1 -1
- package/dist/client/assets/{use-org-sso-fQ5NHD0A.js → use-org-sso-Dz08CIcx.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DDX-q-Qm.js → use-organization-roles-D5QmscBE.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BAyreMqm.js → use-organization-settings-BhbyABaR.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-CYHQ9H_T.js → use-panel-navigate-Cs4na-V_.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-DG_OsicQ.js → use-project-native-view-presence-F2BIVVKN.js} +1 -1
- package/dist/client/assets/{use-project-scope-DTa66aFc.js → use-project-scope-COiEpk7r.js} +1 -1
- package/dist/client/assets/{use-recent-apps-BkiI05bl.js → use-recent-apps-CQPv5LK_.js} +1 -1
- package/dist/client/assets/{use-releases-3QZUJcU8.js → use-releases-CYsXvho_.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-CFGQSOke.js → use-reports-diagnostic-D9AFmVnx.js} +1 -1
- package/dist/client/assets/{use-secrets-CFDBcYIs.js → use-secrets-C4QpZA2A.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-Bi0fZdk_.js → use-section-preview-base-Dp3nLlkj.js} +1 -1
- package/dist/client/assets/{use-sidebar-collapsed-BDC4KJoA.js → use-sidebar-collapsed-BdewWuhH.js} +1 -1
- package/dist/client/assets/{use-tags-Ck-mty1R.js → use-tags-B1Z7-48J.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-K9XTOq2z.js → use-task-board-analytics-G6UBxSrP.js} +1 -1
- package/dist/client/assets/{use-task-board-events-Jz6kbe9R.js → use-task-board-events-CQVfQw81.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-BGCAD4bx.js → use-task-board-item-prs-CTNtD0OU.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CkrB-bRy.js → use-task-metadata-2qdE9S5L.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-BNcqqwBS.js → use-thread-analytics-C0QELsJp.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-LnnMQYmj.js → use-thread-outputs-BRiZLmB3.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BLA_teXl.js +1 -0
- package/dist/client/assets/{useQueries-DsTjk3mN.js → useQueries-BaTjPT3P.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Cu40gYv3.js +1 -0
- package/dist/client/assets/{users-CnjGVWpi.js → users-hzXXTZtN.js} +1 -1
- package/dist/client/assets/{utils-CetO33tt.js → utils-D_iIHZov.js} +1 -1
- package/dist/client/assets/{variant-calendar-BVQKG7Pz.js → variant-calendar-BsY2CF48.js} +1 -1
- package/dist/client/assets/{variant-draft-pointer-1XzXcLtg.js → variant-draft-pointer-Di3PGFGj.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BuqrnQGM.js → view-mode-toggle-dGCnwIOo.js} +1 -1
- package/dist/client/assets/{virtual-mcp-Ux8j-_02.js → virtual-mcp-Cm_JxjLS.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-YHoQCS1I.js → watch-sse-pool-DnJO6AZk.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +193 -193
- package/package.json +1 -1
- package/dist/client/assets/agent-app-C8Q8eJy6.js +0 -1
- package/dist/client/assets/agent-deck-XMMtyHjd.js +0 -1
- package/dist/client/assets/agent-file-BNo94gQC.js +0 -1
- package/dist/client/assets/agent-library-GkmC1ahU.js +0 -1
- package/dist/client/assets/agent-library-file-6MKr5gfE.js +0 -1
- package/dist/client/assets/agent-settings-5nByAqOM.js +0 -1
- package/dist/client/assets/agent-site-editor-code-0fxD14rb.js +0 -2
- package/dist/client/assets/agent-site-editor-content-BN4VoKnm.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-BXzeSsT8.js +0 -1
- package/dist/client/assets/agent-view-hlAx7Qgd.js +0 -1
- package/dist/client/assets/api-keys-Dvm1thDW.js +0 -1
- package/dist/client/assets/cms-settings-editor-DLURX7ZR.js +0 -1
- package/dist/client/assets/flat-project-CcO2Ar9k.js +0 -1
- package/dist/client/assets/library-0gJacikj.js +0 -1
- package/dist/client/assets/monitoring-D5Nohicc.js +0 -1
- package/dist/client/assets/plan-N5Xy4KXF.js +0 -1
- package/dist/client/assets/project-reports-s2VJkQN9.js +0 -1
- package/dist/client/assets/project-tasks-DqRp61Xr.js +0 -1
- package/dist/client/assets/record-editor-BakkGf1Y.js +0 -1
- package/dist/client/assets/reports-DzmhhR-x.js +0 -1
- package/dist/client/assets/repositories-6gZ6hUD8.js +0 -1
- package/dist/client/assets/route-DXMOqHVl.js +0 -1
- package/dist/client/assets/settings-tab-DHN7ZjAa.js +0 -1
- package/dist/client/assets/site-editor-BfEYXklV.js +0 -1
- package/dist/client/assets/taskboard-analytics-jASQU8UF.js +0 -1
- package/dist/client/assets/tasks-DLjtcYlA.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DhVIMVRh.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BVpu0vkd.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aF as ve,cZ as Oe,cX as Me,aG as de,bW as ze,c as U,b as V,j as t,h as Ne,B,r as Q,l as Se,a2 as te,an as Ee,R as me,K as ee,d as se,x as ye,av as _e,eW as Re,b1 as Ue,n as Fe,fI as ue,a1 as Ve,I as J,X as Le,T as Be,V as Ge,U as xe,H as He,f as qe,fQ as Xe,o as Ke,aE as Qe,aD as We,t as Y}from"./index-eirpwNKj.js";import{g as Ye}from"./extract-connection-data-C2M3P64h.js";import{E as Ce}from"./empty-state-DIpCFPkI.js";import{E as Je,r as Ze,b as et,c as tt}from"./connection-form-helpers-CppaGv96.js";import{c as st,S as nt,D as it}from"./index-Cn8WHbCR.js";import{u as we,T as ot}from"./use-mcp-auth-status-XO9Yp1aB.js";import{a as at}from"./use-members-C4ay671C.js";import{A as lt}from"./avatar--bVWjvdf.js";import{a as rt}from"./mcp-oauth-DJh33UXx.js";import{I as ae}from"./integration-icon-CKknGZhR.js";import{s as ct}from"./Plus-D0ucptrV.js";import{bk as dt,aH as mt,aD as ut,u as ne}from"./agent-icon-C0Cpk_fI.js";import{a as ke,e as xt,s as pt}from"./Tool01-C0454p2c.js";import{s as re}from"./Trash01-CyxedK0n.js";import{b as ft,a as ht,c as gt,S as jt,d as bt}from"./sheet-s29eirRf.js";import{F as H,b as q,c as X,d as L,f as K,e as vt,a as Nt}from"./form-CGiGUgzW.js";import{a as Ie,b as Te,u as St}from"./use-connection-C4wyl2ru.js";import{u as Ae}from"./use-mcp-client-DA050uNw.js";import{u as yt}from"./use-mcp-tools-DDRwYO6T.js";import{a as _t}from"./use-mcp-prompts-C_C6tlAY.js";import{i as Ct}from"./mcp-oauth-DqMHjHip.js";import{u as wt,D as kt}from"./use-delete-connection-v7vjwrBf.js";import{c as It}from"./monitoring-stats-row-CbmvtcQ8.js";import{b as Tt,C as At,a as Pt}from"./chart-CdJbyFrF.js";import{a as Dt,B as $t}from"./BarChart-BV8WJLUg.js";import{C as Ot}from"./tooltipContext-DiSBImQr.js";import{b as Mt}from"./repository-binding-BNbbDYQQ.js";import{T as ie,a as zt,c as oe,b as Et}from"./tabs-DWtBgLg_.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Rt}from"./ShoppingBag01-DV74WoBV.js";import{g as ce}from"./types-BmDn-Bmr.js";import{M as Ut}from"./mcp-app-renderer-afmtzlAD.js";import{C as Ft}from"./collection-search-BiaY0GVT.js";import{B as Vt}from"./badge-O9zNBxIS.js";import{S as pe,b as fe,a as he,d as ge,c as G}from"./select-C5-hj9Ts.js";import{i as Lt}from"./CheckCircle-C6kHCEBQ.js";import{t as Bt}from"./ChevronUp-DZ6u-CDn.js";import{n as Gt}from"./LinkBroken01-CJN7aOrV.js";import{d as Ht}from"./UserSquare-B_weldPC.js";import{s as qt}from"./XClose-BeqwQ2Ei.js";import{p as Xt,i as Kt}from"./connection-DdsAVMED.js";import{c as Qt}from"./schema-C1o97tHt.js";import"./metadata-D72DunRR.js";import"./Key01-Qdm6kw39.js";import"./auth-BPJq9uZN.js";import"./index-fdN8eXM2.js";import"./index-CQodxdYF.js";import"./index-BdQq_4o_.js";import"./index-Ct79h6Jq.js";import"./popover-oZJ3oDMA.js";import"./tooltip-DX3EibzC.js";import"./index-DZWoZhT5.js";import"./SearchMd-0qnilUuy.js";import"./use-mobile-BsNhhNj1.js";import"./use-create-virtual-mcp-Bgr2d-1k.js";import"./use-navigate-to-agent-y0z5Ii2q.js";import"./thread-intent-DzC9Ji46.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-YHoQCS1I.js";import"./task-board-fU-Cl8m2.js";import"./schema-CviV2OeO.js";import"./slugify-CEUa2lfQ.js";import"./Image01-DxuLkpjX.js";import"./use-org-auth-client-Cn5Gs8uE.js";import"./User01-Bb04dh7g.js";import"./AlertCircle-Czw3GOXM.js";import"./ArrowUp-D1TV4x6T.js";import"./ArrowLeft-CBNZ6Kc8.js";import"./ZoomOut-DWT1qHXA.js";import"./Building02-BufOoi54.js";import"./ChevronSelectorVertical-CREWgR2i.js";import"./Copy01-Br8MuAU9.js";import"./CreditCard01-BLe5-9IQ.js";import"./DotsVertical-DgdCLmlp.js";import"./Globe04-BkNwdwoM.js";import"./SwitchHorizontal01-Ba0pyLay.js";import"./Link01-B4M7ojFg.js";import"./Monitor01-CHS3e170.js";import"./Sun-D0O3J2yf.js";import"./Play-Da27xlG_.js";import"./Upload01-BWpYXx52.js";import"./Users01-CNd-hMC8.js";import"./label-BL4W2KPI.js";import"./alert-dialog-DBOmU5EL.js";import"./CartesianChart-ButQNI6T.js";import"./CategoricalChart-CU6wjw2Q.js";import"./AreaChart-BhM70eeA.js";import"./symbol-DE4EJv1h.js";import"./ActiveShapeUtils-CV2gQvF0.js";import"./Sector-CKh2L0yG.js";import"./ErrorBarContext-D8FHRXZQ.js";import"./url-slug-BjYL2qGa.js";const Wt=ve({scopes:ze(de()).describe("List of scopes available"),stateSchema:Oe(de(),Me()).describe("JSON Schema (draft-07) defining the state structure")}),Yt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Wt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l}=s,a=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),x=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,f=n.status!=="active",m=x||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==m?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",m),e[2]=m,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 N;e[9]!==n.status||e[10]!==f||e[11]!==x||e[12]!==a?(N=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:a("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?a("details.connectionInstancesPanel.disabledError"):a("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=x,e[12]=a,e[13]=N):N=e[13];let _;e[14]!==j||e[15]!==N?(_=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,N]}),e[14]=j,e[15]=N,e[16]=_):_=e[16];let y;e[17]!==n||e[18]!==x||e[19]!==o||e[20]!==a?(y=x&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>o(n),children:a("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=x,e[19]=o,e[20]=a,e[21]=y):y=e[21];let C;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==a?(C=f?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(dt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:a("details.connectionInstancesPanel.disable"),"aria-label":a("details.connectionInstancesPanel.disable"),children:t.jsx(mt,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=a,e[26]=C):C=e[26];let D;e[27]!==n||e[28]!==c?(D=()=>c(n),e[27]=n,e[28]=c,e[29]=D):D=e[29];let w;e[30]!==a?(w=a("details.connectionInstancesPanel.configure"),e[30]=a,e[31]=w):w=e[31];let $;e[32]!==a?($=a("details.connectionInstancesPanel.configure"),e[32]=a,e[33]=$):$=e[33];let O;e[34]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(ke,{size:13}),e[34]=O):O=e[34];let P;e[35]!==D||e[36]!==w||e[37]!==$?(P=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:D,title:w,"aria-label":$,children:O}),e[35]=D,e[36]=w,e[37]=$,e[38]=P):P=e[38];let T;e[39]!==n||e[40]!==i?(T=()=>i(n),e[39]=n,e[40]=i,e[41]=T):T=e[41];let S;e[42]!==a?(S=a("details.connectionInstancesPanel.delete"),e[42]=a,e[43]=S):S=e[43];let b;e[44]!==a?(b=a("details.connectionInstancesPanel.delete"),e[44]=a,e[45]=b):b=e[45];let z;e[46]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(re,{size:13}),e[46]=z):z=e[46];let E;e[47]!==T||e[48]!==S||e[49]!==b?(E=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:T,title:S,"aria-label":b,children:z}),e[47]=T,e[48]=S,e[49]=b,e[50]=E):E=e[50];let M;e[51]!==P||e[52]!==E||e[53]!==y||e[54]!==C?(M=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,C,P,E]}),e[51]=P,e[52]=E,e[53]=y,e[54]=C,e[55]=M):M=e[55];let A;return e[56]!==M||e[57]!==h||e[58]!==g||e[59]!==_?(A=t.jsxs("div",{className:h,children:[g,_,M]}),e[56]=M,e[57]=h,e[58]=g,e[59]=_,e[60]=A):A=e[60],A}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,o=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 a;e[5]!==n||e[6]!==c?(a=()=>c(n),e[5]=n,e[6]=c,e[7]=a):a=e[7];let r;e[8]!==o?(r=o("details.connectionInstancesPanel.configure"),e[8]=o,e[9]=r):r=e[9];let d;e[10]!==o?(d=o("details.connectionInstancesPanel.configure"),e[10]=o,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ke,{size:13}),e[12]=u):u=e[12];let x;e[13]!==a||e[14]!==r||e[15]!==d?(x=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:a,title:r,"aria-label":d,children:u})}),e[13]=a,e[14]=r,e[15]=d,e[16]=x):x=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==x?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,x]}),e[17]=i,e[18]=l,e[19]=x,e[20]=f):f=e[20],f}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l,onAdd:a,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 x;e[3]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=x):x=e[4];let f;e[5]!==r?(f=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(ct,{size:13}),e[5]=r,e[6]=f):f=e[6];let m;e[7]!==d?(m=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=m):m=e[8];let h;e[9]!==r||e[10]!==a||e[11]!==f||e[12]!==m?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:a,disabled:r,children:[f,m]}),e[9]=r,e[10]=a,e[11]=f,e[12]=m,e[13]=h):h=e[13];let g;e[14]!==x||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,h]}),e[14]=x,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==o||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==o||e[24]!==c||e[25]!==i||e[26]!==l?(y=C=>t.jsx(Q.Suspense,{fallback:t.jsx(Zt,{instance:C,onConfigure:c}),children:t.jsx(Jt,{instance:C,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l})},C.id),e[23]=o,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],j=n.map(y),e[17]=n,e[18]=o,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let N;e[28]!==j?(N=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=N):N=e[29];let _;return e[30]!==g||e[31]!==N?(_=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,N]}),e[30]=g,e[31]=N,e[32]=_):_=e[32],_}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const o=(c.errorMessage??"").trim()||"Unknown error";n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([c,o])=>({message:c,count:o})).sort((c,o)=>o.count-c.count).slice(0,e)}const ss=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ns(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const is={calls:{label:"Tool calls"},errors:{label:"Errors"}};function os(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:o}=s,i=V(),l=Ee(),a=ns(o),{data:r}=me({queryKey:ee.connectionActivity(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=It(r?.logs??[],a,void 0,r?.total,d?.total),x=u.data,f=u.totalCalls>0,m=ts(r?.logs??[]),h=u.totalCalls>0?Math.round(u.totalErrors/u.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),j]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),f?t.jsxs("div",{children:[t.jsx(Tt,{config:is,className:"h-16 w-full",children:t.jsxs(Dt,{data:x,barCategoryGap:"4%",children:[t.jsx(At,{content:t.jsx(Pt,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:x.map(ls)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[x.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),m.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:m.map(as)})]})]})}function as(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function ls(s,e){return t.jsx(Ot,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function rs(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function cs(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ds(s){const e=U.c(22),{connectionId:n}=s,c=V(),[o,i]=Q.useState("14d"),{org:l}=te();let a;e[0]!==c?(a=c("details.connectionActivity.activity"),e[0]=c,e[1]=a):a=e[1];let r;e[2]!==a?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a})}),e[2]=a,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==o?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":o===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",o===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=o,e[7]=u):u=e[7];let x;e[8]!==d||e[9]!==u?(x=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]=x):x=e[10];let f;e[11]!==r||e[12]!==x?(f=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,x]}),e[11]=r,e[12]=x,e[13]=f):f=e[13];let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(cs,{}),e[14]=m):m=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==o?(h=t.jsx(Q.Suspense,{fallback:m,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:o})}),e[15]=n,e[16]=l.id,e[17]=o,e[18]=h):h=e[18];let g;return e[19]!==f||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,h]}),e[19]=f,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,o=se();let i;e[0]!==o||e[1]!==c||e[2]!==n.id?(i=()=>{const x=crypto.randomUUID();o({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:x}})},e[0]=o,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let a;e[5]!==n.icon||e[6]!==n.title?(a=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=a):a=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_e,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==a||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:[a,r,d]}),e[11]=i,e[12]=a,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let o;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=a=>t.jsx(ms,{virtualMcp:a,org:c},a.id),e[3]=c,e[4]=l):l=e[4],o=n.map(l),e[0]=c,e[1]=n,e[2]=o}else o=e[2];let i;return e[5]!==o?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:o})}),e[5]=o,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=V(),{org:o}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=Mt(i);if(!(l.length>0)){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(t.Fragment,{}),e[2]=f):f=e[2],f}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let 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]!==o.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:o.slug})}),e[7]=o.slug,e[8]=l,e[9]=u):u=e[9];let x;return e[10]!==d||e[11]!==u?(x=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=x):x=e[12],x}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:o}=s,i=V(),l=se(),{org:a}=te();let r;e[0]!==c||e[1]!==a.id||e[2]!==a.slug?(r={connectionId:c,orgId:a.id,orgSlug:a.slug},e[0]=c,e[1]=a.id,e[2]=a.slug,e[3]=r):r=e[3];const d=Ae(r),u=Ie(c);let x;e[4]!==u||e[5]!==c?(x=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=x):x=e[6];const f=x,[m,h]=Q.useState("");let g,j,N,_;if(e[7]!==f||e[8]!==d||e[9]!==l||e[10]!==o||e[11]!==m||e[12]!==i||e[13]!==n){const D=(n??[]).filter(fs),w=m.toLowerCase().trim(),$=w?D.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):D;let O;e[18]!==f||e[19]!==l||e[20]!==o?(O=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=f,e[19]=l,e[20]=o,e[21]=O):O=e[21];const P=O;N="flex flex-col h-full overflow-hidden";let T;e[22]!==i?(T=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=T):T=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=S):S=e[24],e[25]!==m||e[26]!==T?(_=t.jsx(Ft,{value:m,onChange:h,placeholder:T,onKeyDown:S}),e[25]=m,e[26]=T,e[27]=_):_=e[27],g="flex-1 overflow-auto p-5",j=$.length===0?t.jsx(Ce,{image:null,title:i(m?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(m?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:$.map(b=>{const z=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>P(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Q.Suspense,{fallback:t.jsx(Ue,{className:"h-full w-full"}),children:t.jsx(Ut,{resourceURI:z,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]=f,e[8]=d,e[9]=l,e[10]=o,e[11]=m,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=N,e[17]=_}else g=e[14],j=e[15],N=e[16],_=e[17];let y;e[28]!==g||e[29]!==j?(y=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=y):y=e[30];let C;return e[31]!==N||e[32]!==_||e[33]!==y?(C=t.jsxs("div",{className:N,children:[_,y]}),e[31]=N,e[32]=_,e[33]=y,e[34]=C):C=e[34],C}function fs(s){return!!ce(s._meta)}const je=[];function De(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),o=e.map(n),i=e[e.length-1];return o.length>=2&&i&&c.has(i)?[o.pop(),...o].join(" "):o.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=V();let o;e[0]!==n||e[1]!==c?(o=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=o):o=e[2];let i;return e[3]!==o?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o})}),e[3]=o,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:o,connectionId:i,org:l}=s,a=c===void 0?je:c,r=o===void 0?je:o,d=V(),u=se(),x=Ie(i??"");let f;e[0]!==x||e[1]!==i?(f=x?Pe(x):i,e[0]=x,e[1]=i,e[2]=f):f=e[2];const m=f;let h;e[3]!==m||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(k){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:m,collectionName:"tools",itemId:encodeURIComponent(k)}})},e[3]=m,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(bs),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const N=j;if(n.length+a.length+r.length===0){let v;e[12]!==d?(v=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=v):v=e[13];let k;e[14]!==v?(k=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:v}),e[14]=v,e[15]=k):k=e[15];let I;e[16]!==d?(I=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=I):I=e[17];let F;e[18]!==I?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:I}),e[18]=I,e[19]=F):F=e[19];let W;return e[20]!==k||e[21]!==F?(W=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[k,F]}),e[20]=k,e[21]=F,e[22]=W):W=e[22],W}let y;e[23]!==d||e[24]!==n.length?(y=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=y):y=e[25];let C;e[26]!==y?(C=t.jsx(ie,{value:"tools",variant:"underline",children:y}),e[26]=y,e[27]=C):C=e[27];let D;e[28]!==N||e[29]!==d?(D=N&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=N,e[29]=d,e[30]=D):D=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let $;e[33]!==w?($=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=$):$=e[34];let O;e[35]!==d?(O=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=O):O=e[36];let P;e[37]!==O?(P=t.jsx(ie,{value:"resources",variant:"underline",children:O}),e[37]=O,e[38]=P):P=e[38];let T;e[39]!==$||e[40]!==P||e[41]!==C||e[42]!==D?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(zt,{variant:"underline",className:"gap-1",children:[C,D,$,P]})}),e[39]=$,e[40]=P,e[41]=C,e[42]=D,e[43]=T):T=e[43];let S;e[44]!==g||e[45]!==n?(S=n.length>0?n.map(v=>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(v.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(xt,{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(v.name)}),v.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:v.description})]}),t.jsx(_e,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},v.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=S):S=e[46];let b;e[47]!==S?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[47]=S,e[48]=b):b=e[48];let z;e[49]!==i||e[50]!==N||e[51]!==l||e[52]!==n?(z=N&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ps,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=N,e[51]=l,e[52]=n,e[53]=z):z=e[53];let E;e[54]!==a?(E=a.length>0?a.map(js):t.jsx(le,{label:"prompts"}),e[54]=a,e[55]=E):E=e[55];let M;e[56]!==E?(M=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[56]=E,e[57]=M):M=e[57];let A;e[58]!==r?(A=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=A):A=e[59];let R;e[60]!==A?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=R):R=e[61];let p;return e[62]!==T||e[63]!==b||e[64]!==z||e[65]!==M||e[66]!==R?(p=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Et,{defaultValue:"tools",variant:"underline",children:[T,b,z,M,R]})}),e[62]=T,e[63]=b,e[64]=z,e[65]=M,e[66]=R,e[67]=p):p=e[67],p}function gs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(ut,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function js(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Rt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function bs(s){return ce(s._meta)}function vs(s){const e=U.c(13),{connection:n,displayTitle:c}=s,o=c??n.title;let i;e[0]!==n.icon||e[1]!==o?(i=t.jsx(ae,{icon:n.icon,name:o,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=o,e[2]=i):i=e[2];let l;e[3]!==o?(l=t.jsx(Fe.Title,{children:o}),e[3]=o,e[4]=l):l=e[4];let a;e[5]!==n.description?(a=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=a):a=e[6];let r;e[7]!==l||e[8]!==a?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[7]=l,e[8]=a,e[9]=r):r=e[9];let 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 Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:o}){const i=V(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Ve(),d=(()=>{if(typeof a!="string"||!a)return!1;try{const m=new URL(a);return m.hostname==="api.githubcopilot.com"&&m.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",f=x?Xt(e.connection_url):null;return x?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")})]}),f&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(H,{control:s.control,name:"ui_type",render:({field:m})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(X,{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:m.value,onValueChange:m.onChange,children:[t.jsx(L,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(G,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(G,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(G,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(H,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(q,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:m.value,onValueChange:m.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(G,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(G,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Gt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(G,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(K,{})]})}),l==="NPX"&&t.jsx(H,{control:s.control,name:"npx_package",render:({field:m})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(H,{control:s.control,name:"stdio_command",render:({field:m})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})}),t.jsx(H,{control:s.control,name:"stdio_args",render:({field:m})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(K,{})]})})]}),t.jsx(H,{control:s.control,name:"stdio_cwd",render:({field:m})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(H,{control:s.control,name:"env_vars",render:({field:m})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Je,{value:m.value??[],onChange:m.onChange})}),t.jsx(K,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(H,{control:s.control,name:"connection_token",render:({field:m})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(X,{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(Le,{children:[t.jsx(Be,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Vt,{variant:"success",className:"gap-1.5",children:[t.jsx(Lt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Bt,{size:12})]})})}),t.jsxs(Ge,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(pt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:o,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&m.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:()=>m.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(qt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(J,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(vt,{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(K,{})]})})]})}function Ss(s){return s.command==="npx"}function ys(s){return s.args?.find(e=>!e.startsWith("-"))??""}function _s(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"&&Kt(s.connection_headers)){const c=s.connection_headers,o=Ze(c.envVars);if(Ss(c)){const l=ys(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o}}const i=_s(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:o}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Cs(s){let e,n=null,c=!1,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=tt(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token!==null&&s.connection_token!==void 0,o=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:o,prompts:i,resources:l,siblings:a}){const r=V(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Ke(),x=Te(),{org:f}=te(),m=wt({onSuccess:()=>{a.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Q.useState(null),[j,N]=Q.useState(!1),_=we({connectionId:e}),{data:y}=at(),C=y?.data?.members??[],D=h??s,w=C.find(p=>p.userId===D.created_by),O=s?.connection_type==="VIRTUAL"||_.isAuthenticated,P={...s,tools:o},T=st(P,Yt),S=Qe({resolver:We(Qt),values:be(h??s)}),b=S.formState.isDirty,z=async()=>{if(!await S.trigger())return;const v=S.getValues(),k=Cs(v),I=h?.id??e;await x.update.mutateAsync({id:I,data:k}),S.reset(v)},E=()=>{S.reset(be(h??s))},M=async p=>{const v=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:k,tokenInfo:I,error:F}=await rt({connectionId:p,orgSlug:f.slug,...v?{scope:v}:{}});if(F||!k){Y.error(r("details.connection.authFailed",{error:F??""}));return}if(I)try{const Z=await fetch(`/api/${f.slug}/connections/${p}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:I.accessToken,refreshToken:I.refreshToken,expiresIn:I.expiresIn,scope:I.scope,clientId:I.clientId,clientSecret:I.clientSecret,tokenEndpoint:I.tokenEndpoint})});if(!Z.ok)console.error("Failed to save OAuth token:",await Z.text()),await x.update.mutateAsync({id:p,data:{connection_token:k}});else try{await x.update.mutateAsync({id:p,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Z){console.error("Error saving OAuth token:",Z),await x.update.mutateAsync({id:p,data:{connection_token:k}})}else await x.update.mutateAsync({id:p,data:{connection_token:k}});const W=new URL(`/api/${f.slug}/mcp/${p}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(W.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>M(s.id),R=async()=>{try{const p=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!p.ok){const k=await p.text();Y.error(r("details.connection.failedRemoveOAuth",{error:k}));return}const v=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(v.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(p){console.error("Error removing OAuth token:",p),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(kt,{...m}),t.jsx(ft,{open:h!==null,onOpenChange:p=>{p||g(null)},children:t.jsxs(ht,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(gt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(jt,{className:"text-base",children:h?.title??s.title}),t.jsx(bt,{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(Nt,{...S,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(H,{control:S.control,name:"title",render:({field:p})=>t.jsxs(q,{children:[t.jsx(X,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...p})}),t.jsx(K,{})]})}),t.jsx(H,{control:S.control,name:"description",render:({field:p})=>t.jsxs(q,{children:[t.jsx(X,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(J,{...p,value:p.value||""})}),t.jsx(K,{})]})})]}),t.jsx(Ns,{form:S,connection:h??s,hasOAuthToken:_.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:R}),t.jsx(nt,{connection:h??s,form:S,hasMcpBinding:T,isMCPAuthenticated:O,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:A,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:z,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:E,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const p=h??s;g(null),m.requestDelete(p)},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(vs,{connection:s,displayTitle:(()=>{const p=a[0]??s;return p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ds,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(es,{instances:a,onConfigure:p=>g(p),onAuthenticate:p=>M(p.id),onDelete:p=>m.requestDelete(p),onToggleStatus:async(p,v)=>{try{await x.update.mutateAsync({id:p.id,data:{status:v}}),Y.success(r(v==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{N(!0);try{const p=a[0]??s,v=p.title.replace(/\s*\(\d+\)\s*$/,""),k=a.length+1,I=`${v} (${k})`,F=Ye("conn");await x.create.mutateAsync({id:F,title:I,description:p.description??null,connection_type:p.connection_type,connection_url:p.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p.created_by,organization_id:p.organization_id,icon:p.icon??null,app_name:p.app_name??null,app_id:p.app_id??null,connection_headers:p.connection_headers??null,oauth_config:null,configuration_state:p.configuration_state??null,metadata:null,tools:null,bindings:null});const W=new URL(`/api/${f.slug}/mcp/${F}`,window.location.origin),Z=await Ct({url:W.href,token:null,orgId:f.id});Z.supportsOAuth&&!Z.isAuthenticated&&await M(F)}catch(p){console.error("Failed to add connection instance:",p),Y.error(r("details.connection.failedAddInstance"))}finally{N(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:o,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ks(){const s=U.c(43),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 o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug"},s[1]=o):o=s[1];const{appSlug:i,org:l}=qe(o),{org:a}=te(),r=Te();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=St(d),[x,f]=Q.useState(null),m=u.find(A=>A.id===x)??u[0]??null;m&&m.id!==x&&f(m.id);const h=m?.id??"",g=Ae({connectionId:h||null,orgId:a.id,orgSlug:a.slug});let j;s[4]!==g?(j={client:g},s[4]=g,s[5]=j):j=s[5];const{data:N}=yt(j),_=N?N.tools.map($s):(m?.tools??[]).map(Ds);let y;e:{if(u.length<=1){y=_;break e}const A=new Set,R=[],p=As;for(const v of u){const k=v.id===h?_:p(v.tools);for(const I of k)A.has(I.name)||(A.add(I.name),R.push(I))}y=R.length>0?R:_}const C=y;let D;s[6]!==g?(D={client:g},s[6]=g,s[7]=D):D=s[7];const{data:w}=_t(D);let $;s[8]!==g?($={client:g},s[8]=g,s[9]=$):$=s[9];const{data:O}=Xe($);let P;s[10]!==w?.prompts?(P=w?.prompts??[],s[10]=w?.prompts,s[11]=P):P=s[11];let T;s[12]!==P?(T=P.map(Ts),s[12]=P,s[13]=T):T=s[13];const S=T;let b;s[14]!==O?.resources?(b=O?.resources??[],s[14]=O?.resources,s[15]=b):b=s[15];let z;s[16]!==b?(z=b.map(Is),s[16]=b,s[17]=z):z=s[17];const E=z;if(!m){let A;s[18]!==e?(A=e("details.connection.notFoundTitle"),s[18]=e,s[19]=A):A=s[19];let R;s[20]!==e?(R=e("details.connection.notFoundDescription"),s[20]=e,s[21]=R):R=s[21];let p;s[22]!==c||s[23]!==l?(p=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[22]=c,s[23]=l,s[24]=p):p=s[24];let v;s[25]!==e?(v=e("details.connection.backButton"),s[25]=e,s[26]=v):v=s[26];let k;s[27]!==p||s[28]!==v?(k=t.jsx(B,{variant:"outline",onClick:p,children:v}),s[27]=p,s[28]=v,s[29]=k):k=s[29];let I;return s[30]!==A||s[31]!==R||s[32]!==k?(I=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ce,{title:A,description:R,actions:k})}),s[30]=A,s[31]=R,s[32]=k,s[33]=I):I=s[33],I}let M;return s[34]!==r.update.isPending||s[35]!==C||s[36]!==m||s[37]!==h||s[38]!==l||s[39]!==S||s[40]!==E||s[41]!==u?(M=t.jsx(ws,{org:l,connection:m,connectionId:h,isUpdating:r.update.isPending,tools:C,prompts:S,resources:E,siblings:u}),s[34]=r.update.isPending,s[35]=C,s[36]=m,s[37]=h,s[38]=l,s[39]=S,s[40]=E,s[41]=u,s[42]=M):M=s[42],M}function Is(s){return{name:s.name,description:s.description,uri:s.uri}}function Ts(s){return{name:s.name,description:s.description}}function As(s){return(s??[]).map(Ps)}function Ps(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ds(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function $s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Os(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(He,{children:t.jsx(Q.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(ks,{})})}),s[0]=e):e=s[0],e}function Ni(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Os,{}),s[0]=e):e=s[0],e}export{Ni as default};
|
|
1
|
+
import{aF as ve,cZ as Oe,cX as Me,aG as de,bW as ze,c as U,b as V,j as t,h as Ne,B,r as Q,l as Se,a2 as te,an as Ee,R as me,K as ee,d as se,x as ye,av as _e,eW as Re,b1 as Ue,n as Fe,fI as ue,a1 as Ve,I as J,X as Le,T as Be,V as Ge,U as xe,H as He,f as qe,fQ as Xe,o as Ke,aE as Qe,aD as We,t as Y}from"./index-Cmhl3zNb.js";import{g as Ye}from"./extract-connection-data-BpdUae_j.js";import{E as Ce}from"./empty-state-BZa0U-xG.js";import{E as Je,r as Ze,b as et,c as tt}from"./connection-form-helpers-C8PcIQLm.js";import{c as st,S as nt,D as it}from"./index-BpuRA4Yb.js";import{u as we,T as ot}from"./use-mcp-auth-status-BQFxszTc.js";import{a as at}from"./use-members-BI_Z9G2i.js";import{A as lt}from"./avatar-B2nFfSHv.js";import{a as rt}from"./mcp-oauth-DqjrYGbv.js";import{I as ae}from"./integration-icon-CktagpLu.js";import{s as ct}from"./Plus-D_siv_aA.js";import{bk as dt,aH as mt,aD as ut,u as ne}from"./agent-icon-DMH8Ftve.js";import{a as ke,e as xt,s as pt}from"./Tool01-Bsd9MAXv.js";import{s as re}from"./Trash01-CqbCnp4Y.js";import{b as ft,a as ht,c as gt,S as jt,d as bt}from"./sheet-CYoLylxA.js";import{F as H,b as q,c as X,d as L,f as K,e as vt,a as Nt}from"./form-DidHa5sD.js";import{a as Ie,b as Te,u as St}from"./use-connection-CikB9KcW.js";import{u as Ae}from"./use-mcp-client-CedU4dWV.js";import{u as yt}from"./use-mcp-tools-CcHLNRd3.js";import{a as _t}from"./use-mcp-prompts-CdDNTlaE.js";import{i as Ct}from"./mcp-oauth-jIbhs8wE.js";import{u as wt,D as kt}from"./use-delete-connection-CjpOj4k7.js";import{c as It}from"./monitoring-stats-row-BiBXmqEX.js";import{b as Tt,C as At,a as Pt}from"./chart-k_AUhfu2.js";import{a as Dt,B as $t}from"./BarChart-BFfaTlE7.js";import{C as Ot}from"./tooltipContext-DIsnCXpc.js";import{b as Mt}from"./repository-binding-X3TRktCN.js";import{T as ie,a as zt,c as oe,b as Et}from"./tabs-BEPPtBqO.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Rt}from"./ShoppingBag01-COYAkOJY.js";import{g as ce}from"./types-CD9jRVDk.js";import{M as Ut}from"./mcp-app-renderer-CFqAYLtv.js";import{C as Ft}from"./collection-search-ZGgli3wR.js";import{B as Vt}from"./badge-CRNAVwfV.js";import{S as pe,b as fe,a as he,d as ge,c as G}from"./select-BFXL8R1G.js";import{i as Lt}from"./CheckCircle-X3D4eq-V.js";import{t as Bt}from"./ChevronUp-BlFhjumO.js";import{n as Gt}from"./LinkBroken01-y64X2SC-.js";import{d as Ht}from"./UserSquare-CEX9DbWl.js";import{s as qt}from"./XClose-BQ9Dlu1I.js";import{p as Xt,i as Kt}from"./connection-CEjWhO8M.js";import{c as Qt}from"./schema-ChwlN9B2.js";import"./metadata-D72DunRR.js";import"./Key01-D8PhPz3k.js";import"./auth-Bjnc521y.js";import"./index-BdqfOdIE.js";import"./index-DhA7J1aJ.js";import"./index-BdQq_4o_.js";import"./index-B2vL4Txo.js";import"./popover-YaXt6bOC.js";import"./tooltip-kZk2wAMk.js";import"./index-D69M9S-D.js";import"./SearchMd-KKuAy3kv.js";import"./use-mobile-CY0Djv_M.js";import"./use-create-virtual-mcp-BCKaQYpl.js";import"./use-navigate-to-agent-cdHnGUXB.js";import"./thread-intent-CCu0BEYJ.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-DnJO6AZk.js";import"./task-board-C1s59vKR.js";import"./schema-nN2fVtd3.js";import"./slugify-CEUa2lfQ.js";import"./Image01-C-r__mWH.js";import"./use-org-auth-client-Cy7UT2_Z.js";import"./User01-DOqRt8wn.js";import"./AlertCircle-iwRSZJFi.js";import"./ArrowUp-CWx4kMsV.js";import"./ArrowLeft-_QxYwR3P.js";import"./ZoomOut-CYcrWaFo.js";import"./Building02-Dcs_HLaa.js";import"./ChevronSelectorVertical-7X_EL11G.js";import"./Copy01-CsyaL0tc.js";import"./CreditCard01-DZn9m-o1.js";import"./DotsVertical-H16dBinG.js";import"./Globe04-B5AbE2NG.js";import"./SwitchHorizontal01-ZjaXGph0.js";import"./Link01-BZlTJYwG.js";import"./Monitor01-Ccoz_3RV.js";import"./Sun-s_f7cajm.js";import"./Play-B8dkIMIB.js";import"./Upload01-BuL02EP8.js";import"./Users01-n5qz8jdG.js";import"./label-COA0amPU.js";import"./alert-dialog-CgRaXWeG.js";import"./CartesianChart-DxoYDxJN.js";import"./CategoricalChart-BWxwmOFO.js";import"./AreaChart-BCUK2U_v.js";import"./symbol-BmpW8_Es.js";import"./ActiveShapeUtils-CAxkWTE7.js";import"./Sector-BpwYW3Qx.js";import"./ErrorBarContext-IXpluzmX.js";import"./url-slug-CXYaPIEX.js";const Wt=ve({scopes:ze(de()).describe("List of scopes available"),stateSchema:Oe(de(),Me()).describe("JSON Schema (draft-07) defining the state structure")}),Yt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Wt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l}=s,a=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),x=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,f=n.status!=="active",m=x||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==m?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",m),e[2]=m,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 N;e[9]!==n.status||e[10]!==f||e[11]!==x||e[12]!==a?(N=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:a("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?a("details.connectionInstancesPanel.disabledError"):a("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=x,e[12]=a,e[13]=N):N=e[13];let _;e[14]!==j||e[15]!==N?(_=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,N]}),e[14]=j,e[15]=N,e[16]=_):_=e[16];let y;e[17]!==n||e[18]!==x||e[19]!==o||e[20]!==a?(y=x&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>o(n),children:a("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=x,e[19]=o,e[20]=a,e[21]=y):y=e[21];let C;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==a?(C=f?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(dt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:a("details.connectionInstancesPanel.disable"),"aria-label":a("details.connectionInstancesPanel.disable"),children:t.jsx(mt,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=a,e[26]=C):C=e[26];let D;e[27]!==n||e[28]!==c?(D=()=>c(n),e[27]=n,e[28]=c,e[29]=D):D=e[29];let w;e[30]!==a?(w=a("details.connectionInstancesPanel.configure"),e[30]=a,e[31]=w):w=e[31];let $;e[32]!==a?($=a("details.connectionInstancesPanel.configure"),e[32]=a,e[33]=$):$=e[33];let O;e[34]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(ke,{size:13}),e[34]=O):O=e[34];let P;e[35]!==D||e[36]!==w||e[37]!==$?(P=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:D,title:w,"aria-label":$,children:O}),e[35]=D,e[36]=w,e[37]=$,e[38]=P):P=e[38];let T;e[39]!==n||e[40]!==i?(T=()=>i(n),e[39]=n,e[40]=i,e[41]=T):T=e[41];let S;e[42]!==a?(S=a("details.connectionInstancesPanel.delete"),e[42]=a,e[43]=S):S=e[43];let b;e[44]!==a?(b=a("details.connectionInstancesPanel.delete"),e[44]=a,e[45]=b):b=e[45];let z;e[46]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(re,{size:13}),e[46]=z):z=e[46];let E;e[47]!==T||e[48]!==S||e[49]!==b?(E=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:T,title:S,"aria-label":b,children:z}),e[47]=T,e[48]=S,e[49]=b,e[50]=E):E=e[50];let M;e[51]!==P||e[52]!==E||e[53]!==y||e[54]!==C?(M=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,C,P,E]}),e[51]=P,e[52]=E,e[53]=y,e[54]=C,e[55]=M):M=e[55];let A;return e[56]!==M||e[57]!==h||e[58]!==g||e[59]!==_?(A=t.jsxs("div",{className:h,children:[g,_,M]}),e[56]=M,e[57]=h,e[58]=g,e[59]=_,e[60]=A):A=e[60],A}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,o=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 a;e[5]!==n||e[6]!==c?(a=()=>c(n),e[5]=n,e[6]=c,e[7]=a):a=e[7];let r;e[8]!==o?(r=o("details.connectionInstancesPanel.configure"),e[8]=o,e[9]=r):r=e[9];let d;e[10]!==o?(d=o("details.connectionInstancesPanel.configure"),e[10]=o,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ke,{size:13}),e[12]=u):u=e[12];let x;e[13]!==a||e[14]!==r||e[15]!==d?(x=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:a,title:r,"aria-label":d,children:u})}),e[13]=a,e[14]=r,e[15]=d,e[16]=x):x=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==x?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,x]}),e[17]=i,e[18]=l,e[19]=x,e[20]=f):f=e[20],f}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l,onAdd:a,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 x;e[3]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=x):x=e[4];let f;e[5]!==r?(f=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(ct,{size:13}),e[5]=r,e[6]=f):f=e[6];let m;e[7]!==d?(m=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=m):m=e[8];let h;e[9]!==r||e[10]!==a||e[11]!==f||e[12]!==m?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:a,disabled:r,children:[f,m]}),e[9]=r,e[10]=a,e[11]=f,e[12]=m,e[13]=h):h=e[13];let g;e[14]!==x||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,h]}),e[14]=x,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==o||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==o||e[24]!==c||e[25]!==i||e[26]!==l?(y=C=>t.jsx(Q.Suspense,{fallback:t.jsx(Zt,{instance:C,onConfigure:c}),children:t.jsx(Jt,{instance:C,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l})},C.id),e[23]=o,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],j=n.map(y),e[17]=n,e[18]=o,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let N;e[28]!==j?(N=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=N):N=e[29];let _;return e[30]!==g||e[31]!==N?(_=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,N]}),e[30]=g,e[31]=N,e[32]=_):_=e[32],_}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const o=(c.errorMessage??"").trim()||"Unknown error";n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([c,o])=>({message:c,count:o})).sort((c,o)=>o.count-c.count).slice(0,e)}const ss=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ns(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const is={calls:{label:"Tool calls"},errors:{label:"Errors"}};function os(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:o}=s,i=V(),l=Ee(),a=ns(o),{data:r}=me({queryKey:ee.connectionActivity(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=It(r?.logs??[],a,void 0,r?.total,d?.total),x=u.data,f=u.totalCalls>0,m=ts(r?.logs??[]),h=u.totalCalls>0?Math.round(u.totalErrors/u.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),j]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),f?t.jsxs("div",{children:[t.jsx(Tt,{config:is,className:"h-16 w-full",children:t.jsxs(Dt,{data:x,barCategoryGap:"4%",children:[t.jsx(At,{content:t.jsx(Pt,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:x.map(ls)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[x.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),m.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:m.map(as)})]})]})}function as(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function ls(s,e){return t.jsx(Ot,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function rs(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function cs(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ds(s){const e=U.c(22),{connectionId:n}=s,c=V(),[o,i]=Q.useState("14d"),{org:l}=te();let a;e[0]!==c?(a=c("details.connectionActivity.activity"),e[0]=c,e[1]=a):a=e[1];let r;e[2]!==a?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a})}),e[2]=a,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==o?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":o===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",o===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=o,e[7]=u):u=e[7];let x;e[8]!==d||e[9]!==u?(x=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]=x):x=e[10];let f;e[11]!==r||e[12]!==x?(f=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,x]}),e[11]=r,e[12]=x,e[13]=f):f=e[13];let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(cs,{}),e[14]=m):m=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==o?(h=t.jsx(Q.Suspense,{fallback:m,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:o})}),e[15]=n,e[16]=l.id,e[17]=o,e[18]=h):h=e[18];let g;return e[19]!==f||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,h]}),e[19]=f,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,o=se();let i;e[0]!==o||e[1]!==c||e[2]!==n.id?(i=()=>{const x=crypto.randomUUID();o({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:x}})},e[0]=o,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let a;e[5]!==n.icon||e[6]!==n.title?(a=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=a):a=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_e,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==a||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:[a,r,d]}),e[11]=i,e[12]=a,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let o;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=a=>t.jsx(ms,{virtualMcp:a,org:c},a.id),e[3]=c,e[4]=l):l=e[4],o=n.map(l),e[0]=c,e[1]=n,e[2]=o}else o=e[2];let i;return e[5]!==o?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:o})}),e[5]=o,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=V(),{org:o}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=Mt(i);if(!(l.length>0)){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(t.Fragment,{}),e[2]=f):f=e[2],f}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let 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]!==o.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:o.slug})}),e[7]=o.slug,e[8]=l,e[9]=u):u=e[9];let x;return e[10]!==d||e[11]!==u?(x=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=x):x=e[12],x}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:o}=s,i=V(),l=se(),{org:a}=te();let r;e[0]!==c||e[1]!==a.id||e[2]!==a.slug?(r={connectionId:c,orgId:a.id,orgSlug:a.slug},e[0]=c,e[1]=a.id,e[2]=a.slug,e[3]=r):r=e[3];const d=Ae(r),u=Ie(c);let x;e[4]!==u||e[5]!==c?(x=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=x):x=e[6];const f=x,[m,h]=Q.useState("");let g,j,N,_;if(e[7]!==f||e[8]!==d||e[9]!==l||e[10]!==o||e[11]!==m||e[12]!==i||e[13]!==n){const D=(n??[]).filter(fs),w=m.toLowerCase().trim(),$=w?D.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):D;let O;e[18]!==f||e[19]!==l||e[20]!==o?(O=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=f,e[19]=l,e[20]=o,e[21]=O):O=e[21];const P=O;N="flex flex-col h-full overflow-hidden";let T;e[22]!==i?(T=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=T):T=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=S):S=e[24],e[25]!==m||e[26]!==T?(_=t.jsx(Ft,{value:m,onChange:h,placeholder:T,onKeyDown:S}),e[25]=m,e[26]=T,e[27]=_):_=e[27],g="flex-1 overflow-auto p-5",j=$.length===0?t.jsx(Ce,{image:null,title:i(m?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(m?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:$.map(b=>{const z=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>P(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Q.Suspense,{fallback:t.jsx(Ue,{className:"h-full w-full"}),children:t.jsx(Ut,{resourceURI:z,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]=f,e[8]=d,e[9]=l,e[10]=o,e[11]=m,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=N,e[17]=_}else g=e[14],j=e[15],N=e[16],_=e[17];let y;e[28]!==g||e[29]!==j?(y=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=y):y=e[30];let C;return e[31]!==N||e[32]!==_||e[33]!==y?(C=t.jsxs("div",{className:N,children:[_,y]}),e[31]=N,e[32]=_,e[33]=y,e[34]=C):C=e[34],C}function fs(s){return!!ce(s._meta)}const je=[];function De(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),o=e.map(n),i=e[e.length-1];return o.length>=2&&i&&c.has(i)?[o.pop(),...o].join(" "):o.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=V();let o;e[0]!==n||e[1]!==c?(o=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=o):o=e[2];let i;return e[3]!==o?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o})}),e[3]=o,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:o,connectionId:i,org:l}=s,a=c===void 0?je:c,r=o===void 0?je:o,d=V(),u=se(),x=Ie(i??"");let f;e[0]!==x||e[1]!==i?(f=x?Pe(x):i,e[0]=x,e[1]=i,e[2]=f):f=e[2];const m=f;let h;e[3]!==m||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(k){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:m,collectionName:"tools",itemId:encodeURIComponent(k)}})},e[3]=m,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(bs),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const N=j;if(n.length+a.length+r.length===0){let v;e[12]!==d?(v=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=v):v=e[13];let k;e[14]!==v?(k=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:v}),e[14]=v,e[15]=k):k=e[15];let I;e[16]!==d?(I=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=I):I=e[17];let F;e[18]!==I?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:I}),e[18]=I,e[19]=F):F=e[19];let W;return e[20]!==k||e[21]!==F?(W=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[k,F]}),e[20]=k,e[21]=F,e[22]=W):W=e[22],W}let y;e[23]!==d||e[24]!==n.length?(y=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=y):y=e[25];let C;e[26]!==y?(C=t.jsx(ie,{value:"tools",variant:"underline",children:y}),e[26]=y,e[27]=C):C=e[27];let D;e[28]!==N||e[29]!==d?(D=N&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=N,e[29]=d,e[30]=D):D=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let $;e[33]!==w?($=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=$):$=e[34];let O;e[35]!==d?(O=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=O):O=e[36];let P;e[37]!==O?(P=t.jsx(ie,{value:"resources",variant:"underline",children:O}),e[37]=O,e[38]=P):P=e[38];let T;e[39]!==$||e[40]!==P||e[41]!==C||e[42]!==D?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(zt,{variant:"underline",className:"gap-1",children:[C,D,$,P]})}),e[39]=$,e[40]=P,e[41]=C,e[42]=D,e[43]=T):T=e[43];let S;e[44]!==g||e[45]!==n?(S=n.length>0?n.map(v=>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(v.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(xt,{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(v.name)}),v.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:v.description})]}),t.jsx(_e,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},v.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=S):S=e[46];let b;e[47]!==S?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[47]=S,e[48]=b):b=e[48];let z;e[49]!==i||e[50]!==N||e[51]!==l||e[52]!==n?(z=N&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ps,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=N,e[51]=l,e[52]=n,e[53]=z):z=e[53];let E;e[54]!==a?(E=a.length>0?a.map(js):t.jsx(le,{label:"prompts"}),e[54]=a,e[55]=E):E=e[55];let M;e[56]!==E?(M=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[56]=E,e[57]=M):M=e[57];let A;e[58]!==r?(A=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=A):A=e[59];let R;e[60]!==A?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=R):R=e[61];let p;return e[62]!==T||e[63]!==b||e[64]!==z||e[65]!==M||e[66]!==R?(p=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Et,{defaultValue:"tools",variant:"underline",children:[T,b,z,M,R]})}),e[62]=T,e[63]=b,e[64]=z,e[65]=M,e[66]=R,e[67]=p):p=e[67],p}function gs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(ut,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function js(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Rt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function bs(s){return ce(s._meta)}function vs(s){const e=U.c(13),{connection:n,displayTitle:c}=s,o=c??n.title;let i;e[0]!==n.icon||e[1]!==o?(i=t.jsx(ae,{icon:n.icon,name:o,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=o,e[2]=i):i=e[2];let l;e[3]!==o?(l=t.jsx(Fe.Title,{children:o}),e[3]=o,e[4]=l):l=e[4];let a;e[5]!==n.description?(a=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=a):a=e[6];let r;e[7]!==l||e[8]!==a?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[7]=l,e[8]=a,e[9]=r):r=e[9];let 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 Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:o}){const i=V(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Ve(),d=(()=>{if(typeof a!="string"||!a)return!1;try{const m=new URL(a);return m.hostname==="api.githubcopilot.com"&&m.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",f=x?Xt(e.connection_url):null;return x?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")})]}),f&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(H,{control:s.control,name:"ui_type",render:({field:m})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(X,{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:m.value,onValueChange:m.onChange,children:[t.jsx(L,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(G,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(G,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(G,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(H,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(q,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:m.value,onValueChange:m.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(G,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(G,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(G,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Gt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(G,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(K,{})]})}),l==="NPX"&&t.jsx(H,{control:s.control,name:"npx_package",render:({field:m})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(H,{control:s.control,name:"stdio_command",render:({field:m})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})}),t.jsx(H,{control:s.control,name:"stdio_args",render:({field:m})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(K,{})]})})]}),t.jsx(H,{control:s.control,name:"stdio_cwd",render:({field:m})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(H,{control:s.control,name:"env_vars",render:({field:m})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Je,{value:m.value??[],onChange:m.onChange})}),t.jsx(K,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(H,{control:s.control,name:"connection_token",render:({field:m})=>t.jsxs(q,{className:"flex flex-col gap-3",children:[t.jsx(X,{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(Le,{children:[t.jsx(Be,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Vt,{variant:"success",className:"gap-1.5",children:[t.jsx(Lt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Bt,{size:12})]})})}),t.jsxs(Ge,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(pt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:o,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&m.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:()=>m.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(qt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(J,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(vt,{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(K,{})]})})]})}function Ss(s){return s.command==="npx"}function ys(s){return s.args?.find(e=>!e.startsWith("-"))??""}function _s(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"&&Kt(s.connection_headers)){const c=s.connection_headers,o=Ze(c.envVars);if(Ss(c)){const l=ys(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o}}const i=_s(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:o}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Cs(s){let e,n=null,c=!1,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=tt(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token!==null&&s.connection_token!==void 0,o=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:o,prompts:i,resources:l,siblings:a}){const r=V(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Ke(),x=Te(),{org:f}=te(),m=wt({onSuccess:()=>{a.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Q.useState(null),[j,N]=Q.useState(!1),_=we({connectionId:e}),{data:y}=at(),C=y?.data?.members??[],D=h??s,w=C.find(p=>p.userId===D.created_by),O=s?.connection_type==="VIRTUAL"||_.isAuthenticated,P={...s,tools:o},T=st(P,Yt),S=Qe({resolver:We(Qt),values:be(h??s)}),b=S.formState.isDirty,z=async()=>{if(!await S.trigger())return;const v=S.getValues(),k=Cs(v),I=h?.id??e;await x.update.mutateAsync({id:I,data:k}),S.reset(v)},E=()=>{S.reset(be(h??s))},M=async p=>{const v=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:k,tokenInfo:I,error:F}=await rt({connectionId:p,orgSlug:f.slug,...v?{scope:v}:{}});if(F||!k){Y.error(r("details.connection.authFailed",{error:F??""}));return}if(I)try{const Z=await fetch(`/api/${f.slug}/connections/${p}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:I.accessToken,refreshToken:I.refreshToken,expiresIn:I.expiresIn,scope:I.scope,clientId:I.clientId,clientSecret:I.clientSecret,tokenEndpoint:I.tokenEndpoint})});if(!Z.ok)console.error("Failed to save OAuth token:",await Z.text()),await x.update.mutateAsync({id:p,data:{connection_token:k}});else try{await x.update.mutateAsync({id:p,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Z){console.error("Error saving OAuth token:",Z),await x.update.mutateAsync({id:p,data:{connection_token:k}})}else await x.update.mutateAsync({id:p,data:{connection_token:k}});const W=new URL(`/api/${f.slug}/mcp/${p}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(W.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>M(s.id),R=async()=>{try{const p=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!p.ok){const k=await p.text();Y.error(r("details.connection.failedRemoveOAuth",{error:k}));return}const v=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(v.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(p){console.error("Error removing OAuth token:",p),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(kt,{...m}),t.jsx(ft,{open:h!==null,onOpenChange:p=>{p||g(null)},children:t.jsxs(ht,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(gt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(jt,{className:"text-base",children:h?.title??s.title}),t.jsx(bt,{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(Nt,{...S,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(H,{control:S.control,name:"title",render:({field:p})=>t.jsxs(q,{children:[t.jsx(X,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...p})}),t.jsx(K,{})]})}),t.jsx(H,{control:S.control,name:"description",render:({field:p})=>t.jsxs(q,{children:[t.jsx(X,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(J,{...p,value:p.value||""})}),t.jsx(K,{})]})})]}),t.jsx(Ns,{form:S,connection:h??s,hasOAuthToken:_.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:R}),t.jsx(nt,{connection:h??s,form:S,hasMcpBinding:T,isMCPAuthenticated:O,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:A,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:z,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:E,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const p=h??s;g(null),m.requestDelete(p)},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(vs,{connection:s,displayTitle:(()=>{const p=a[0]??s;return p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ds,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(es,{instances:a,onConfigure:p=>g(p),onAuthenticate:p=>M(p.id),onDelete:p=>m.requestDelete(p),onToggleStatus:async(p,v)=>{try{await x.update.mutateAsync({id:p.id,data:{status:v}}),Y.success(r(v==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{N(!0);try{const p=a[0]??s,v=p.title.replace(/\s*\(\d+\)\s*$/,""),k=a.length+1,I=`${v} (${k})`,F=Ye("conn");await x.create.mutateAsync({id:F,title:I,description:p.description??null,connection_type:p.connection_type,connection_url:p.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p.created_by,organization_id:p.organization_id,icon:p.icon??null,app_name:p.app_name??null,app_id:p.app_id??null,connection_headers:p.connection_headers??null,oauth_config:null,configuration_state:p.configuration_state??null,metadata:null,tools:null,bindings:null});const W=new URL(`/api/${f.slug}/mcp/${F}`,window.location.origin),Z=await Ct({url:W.href,token:null,orgId:f.id});Z.supportsOAuth&&!Z.isAuthenticated&&await M(F)}catch(p){console.error("Failed to add connection instance:",p),Y.error(r("details.connection.failedAddInstance"))}finally{N(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:o,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ks(){const s=U.c(43),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 o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug"},s[1]=o):o=s[1];const{appSlug:i,org:l}=qe(o),{org:a}=te(),r=Te();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=St(d),[x,f]=Q.useState(null),m=u.find(A=>A.id===x)??u[0]??null;m&&m.id!==x&&f(m.id);const h=m?.id??"",g=Ae({connectionId:h||null,orgId:a.id,orgSlug:a.slug});let j;s[4]!==g?(j={client:g},s[4]=g,s[5]=j):j=s[5];const{data:N}=yt(j),_=N?N.tools.map($s):(m?.tools??[]).map(Ds);let y;e:{if(u.length<=1){y=_;break e}const A=new Set,R=[],p=As;for(const v of u){const k=v.id===h?_:p(v.tools);for(const I of k)A.has(I.name)||(A.add(I.name),R.push(I))}y=R.length>0?R:_}const C=y;let D;s[6]!==g?(D={client:g},s[6]=g,s[7]=D):D=s[7];const{data:w}=_t(D);let $;s[8]!==g?($={client:g},s[8]=g,s[9]=$):$=s[9];const{data:O}=Xe($);let P;s[10]!==w?.prompts?(P=w?.prompts??[],s[10]=w?.prompts,s[11]=P):P=s[11];let T;s[12]!==P?(T=P.map(Ts),s[12]=P,s[13]=T):T=s[13];const S=T;let b;s[14]!==O?.resources?(b=O?.resources??[],s[14]=O?.resources,s[15]=b):b=s[15];let z;s[16]!==b?(z=b.map(Is),s[16]=b,s[17]=z):z=s[17];const E=z;if(!m){let A;s[18]!==e?(A=e("details.connection.notFoundTitle"),s[18]=e,s[19]=A):A=s[19];let R;s[20]!==e?(R=e("details.connection.notFoundDescription"),s[20]=e,s[21]=R):R=s[21];let p;s[22]!==c||s[23]!==l?(p=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[22]=c,s[23]=l,s[24]=p):p=s[24];let v;s[25]!==e?(v=e("details.connection.backButton"),s[25]=e,s[26]=v):v=s[26];let k;s[27]!==p||s[28]!==v?(k=t.jsx(B,{variant:"outline",onClick:p,children:v}),s[27]=p,s[28]=v,s[29]=k):k=s[29];let I;return s[30]!==A||s[31]!==R||s[32]!==k?(I=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ce,{title:A,description:R,actions:k})}),s[30]=A,s[31]=R,s[32]=k,s[33]=I):I=s[33],I}let M;return s[34]!==r.update.isPending||s[35]!==C||s[36]!==m||s[37]!==h||s[38]!==l||s[39]!==S||s[40]!==E||s[41]!==u?(M=t.jsx(ws,{org:l,connection:m,connectionId:h,isUpdating:r.update.isPending,tools:C,prompts:S,resources:E,siblings:u}),s[34]=r.update.isPending,s[35]=C,s[36]=m,s[37]=h,s[38]=l,s[39]=S,s[40]=E,s[41]=u,s[42]=M):M=s[42],M}function Is(s){return{name:s.name,description:s.description,uri:s.uri}}function Ts(s){return{name:s.name,description:s.description}}function As(s){return(s??[]).map(Ps)}function Ps(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ds(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function $s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Os(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(He,{children:t.jsx(Q.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(ks,{})})}),s[0]=e):e=s[0],e}function Ni(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Os,{}),s[0]=e):e=s[0],e}export{Ni as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as A,j as c,I as T,B as N}from"./index-
|
|
1
|
+
import{c as A,j as c,I as T,B as N}from"./index-Cmhl3zNb.js";import{s as H}from"./Plus-D_siv_aA.js";import{s as S}from"./Trash01-CqbCnp4Y.js";function V(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(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function $(n){const e=A.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:k}=n,p=o===void 0?"VARIABLE_NAME":o,h=s===void 0?"value...":s;let _;e[0]!==r||e[1]!==t?(_=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=_):_=e[2];const C=_;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((u,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const v=x;let b;e[6]!==r||e[7]!==t?(b=(l,u)=>{const i=[...t],a=i[l];a&&(i[l]={key:u,value:a.value},r(i))},e[6]=r,e[7]=t,e[8]=b):b=e[8];const y=b;let P;e[9]!==r||e[10]!==t?(P=(l,u)=>{const i=[...t],a=i[l];a&&(i[l]={key:a.key,value:u},r(i))},e[9]=r,e[10]=t,e[11]=P):P=e[11];const g=P;let f;if(e[12]!==y||e[13]!==v||e[14]!==g||e[15]!==p||e[16]!==t||e[17]!==h){let l;e[19]!==y||e[20]!==v||e[21]!==g||e[22]!==p||e[23]!==h?(l=(u,i)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(T,{placeholder:p,value:u.key,onChange:a=>y(i,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),c.jsx(T,{type:V(u.key)?"password":"text",placeholder:h,value:u.value,onChange:a=>g(i,a.target.value),className:"h-10 rounded-lg flex-1"}),c.jsx(N,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>v(i),children:c.jsx(S,{size:16})})]},i),e[19]=y,e[20]=v,e[21]=g,e[22]=p,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=y,e[13]=v,e[14]=g,e[15]=p,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=c.jsx(H,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==C?(d=c.jsxs(N,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:C,children:[w,"Add Environment Variable"]}),e[26]=C,e[27]=d):d=e[27];let m;e[28]!==f||e[29]!==d?(m=c.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=m):m=e[30];let E;return e[31]!==k||e[32]!==m?(E=c.jsx("div",{className:k,children:m}),e[31]=k,e[32]=m,e[33]=E):E=e[33],E}function R(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function K(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function j(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 W(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 o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function B(n){const{uiType:e}=n,t=j(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===j("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 G(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=j(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(p=>j(p.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function U(n,e){const t={command:"npx",args:["-y",n]},r=R(e);return Object.keys(r).length>0&&(t.envVars=r),t}function M(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=R(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{$ as E,G as a,U as b,M as c,B as i,W as p,K as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as z,c as G,b as se,j as t,B as L,h as ge,l as fe,U as ce,v as ke,aM as Te,s as we,w as Ae,q as Ie,D as Pe,T as We,X as Xe,V as Ge,H as Qe,a2 as Me,d as $e,u as qe,a as Fe,a1 as Je,am as ye,aa as Ye,au as Ze,aw as et,aE as tt,aD as nt,n as ae,I as oe,y as ne,o as st,an as ot,t as X,b8 as it,K as ct,eB as lt}from"./index-eirpwNKj.js";import{a as Oe,g as rt,e as at}from"./extract-connection-data-C2M3P64h.js";import{C as dt}from"./collection-display-button-BLKqGGaY.js";import{S as ut}from"./search-input-Bq9urCGV.js";import{S as gt}from"./search-toggle-DwZ6dTB5.js";import{C as mt}from"./collection-tabs-BLEBGgk-.js";import{C as ve,u as Ue,g as pt}from"./connection-card-DquRZmyq.js";import{E as ht}from"./empty-state-DIpCFPkI.js";import{u as ft,D as xt}from"./use-delete-connection-v7vjwrBf.js";import{u as jt}from"./use-infinite-scroll-DYPYtqG2.js";import{u as Ve}from"./use-mobile-BsNhhNj1.js";import{g as ue}from"./connection-slug-CITJ0kGN.js";import{A as St,a as yt,b as vt,c as Ct,g as bt,d as _t,e as Nt,f as Dt}from"./alert-dialog-DBOmU5EL.js";import{n as xe}from"./LinkBroken01-CJN7aOrV.js";import{g as kt,a as Tt}from"./metadata-D72DunRR.js";import{D as wt,a as At,d as It,b as Pt,e as Mt,f as $t,g as Ft}from"./drawer-CTSig7Vj.js";import{F as q,b as J,c as Y,d as Z,f as ee,a as Ne}from"./form-CGiGUgzW.js";import{S as Ot,b as Ut,a as Vt,d as zt,c as de}from"./select-C5-hj9Ts.js";import{T as Lt}from"./textarea-BDL4MHBS.js";import{b as ze,u as Et}from"./use-connection-C4wyl2ru.js";import{m as Bt}from"./use-mcp-client-DA050uNw.js";import{b as Ht}from"./repository-binding-BNbbDYQQ.js";import{g as Kt}from"./types-BmDn-Bmr.js";import{A as Rt,bL as Wt,aH as Xt,bk as Gt,u as Se}from"./agent-icon-C0Cpk_fI.js";import{s as Le}from"./Plus-D0ucptrV.js";import{d as Qt}from"./UserSquare-B_weldPC.js";import{s as Ee}from"./XClose-BeqwQ2Ei.js";import{s as qt}from"./use-project-scope-DTa66aFc.js";import{c as Jt}from"./schema-C1o97tHt.js";import{i as he,a as De,E as Yt,p as Zt,b as en,c as tn}from"./connection-form-helpers-CppaGv96.js";import{a as nn}from"./authenticate-and-persist-oauth-CEKJsXYr.js";import{I as sn}from"./integration-icon-CKknGZhR.js";import{C as Be}from"./checkbox-_9cHZuVh.js";import{i as on}from"./DotsVertical-DgdCLmlp.js";import{s as He}from"./Image01-DxuLkpjX.js";import{s as Ke}from"./Trash01-CyxedK0n.js";import"./connection-DdsAVMED.js";import"./url-slug-BjYL2qGa.js";import"./ArrowUp-D1TV4x6T.js";import"./SwitchHorizontal01-Ba0pyLay.js";import"./tooltip-DX3EibzC.js";import"./index-DZWoZhT5.js";import"./view-mode-toggle-BuqrnQGM.js";import"./badge-O9zNBxIS.js";import"./SearchMd-0qnilUuy.js";import"./icon-button-D0a6m1Sz.js";import"./useInfiniteQuery-DhVIMVRh.js";import"./infiniteQueryObserver-47K3Cxqe.js";import"./slugify-CEUa2lfQ.js";import"./label-BL4W2KPI.js";import"./index-BdQq_4o_.js";import"./ChevronUp-DZ6u-CDn.js";import"./auth-BPJq9uZN.js";import"./AlertCircle-Czw3GOXM.js";import"./Tool01-C0454p2c.js";import"./ArrowLeft-CBNZ6Kc8.js";import"./ShoppingBag01-DV74WoBV.js";import"./ZoomOut-DWT1qHXA.js";import"./Building02-BufOoi54.js";import"./CheckCircle-C6kHCEBQ.js";import"./ChevronSelectorVertical-CREWgR2i.js";import"./Copy01-Br8MuAU9.js";import"./CreditCard01-BLe5-9IQ.js";import"./Globe04-BkNwdwoM.js";import"./Key01-Qdm6kw39.js";import"./Link01-B4M7ojFg.js";import"./Monitor01-CHS3e170.js";import"./Sun-D0O3J2yf.js";import"./Play-Da27xlG_.js";import"./Upload01-BWpYXx52.js";import"./User01-Bb04dh7g.js";import"./Users01-CNd-hMC8.js";import"./mcp-oauth-DJh33UXx.js";import"./mcp-oauth-DqMHjHip.js";function cn(s){const e=`deco-filters-${s}`,[n,g]=z.useState(()=>{try{const i=globalThis.localStorage?.getItem(e);if(i)return JSON.parse(i)}catch(i){console.error("Failed to parse stored filters:",i)}return[]});return[n,i=>{g(i);try{globalThis.localStorage?.setItem(e,JSON.stringify(i))}catch(c){console.error("Failed to save filters:",c)}}]}function ln(s){const e=G.c(7),[n,g]=z.useState(s),[o,i]=z.useState(s?"desc":null);let c;e[0]!==o||e[1]!==n?(c=p=>{n!==p?(g(p),i("asc")):o==="asc"?i("desc"):o==="desc"&&(g(void 0),i(null))},e[0]=o,e[1]=n,e[2]=c):c=e[2];const a=c;let r;return e[3]!==a||e[4]!==o||e[5]!==n?(r={sortKey:n,sortDirection:o,handleSort:a},e[3]=a,e[4]=o,e[5]=n,e[6]=r):r=e[6],r}function rn(s,e){const n=G.c(12),g=e===void 0?"cards":e,o=Ve(),i=z.useRef(o),c=s?`deco-view-mode-${s}`:"deco-view-mode";let a;n[0]!==g||n[1]!==c?(a=()=>{const x=globalThis.localStorage?.getItem(c);return x==="cards"||x==="table"?x:g},n[0]=g,n[1]=c,n[2]=a):a=n[2];const[r,p]=z.useState(a);let m;n[3]!==c?(m=x=>{p(x),globalThis.localStorage?.setItem(c,x)},n[3]=c,n[4]=m):m=n[4];const u=m;let d,h;n[5]!==o||n[6]!==r?(d=()=>{!i.current&&o&&r==="table"&&p("cards"),i.current=o},h=[o,r],n[5]=o,n[6]=r,n[7]=d,n[8]=h):(d=n[7],h=n[8]),z.useEffect(d,h);let f;return n[9]!==u||n[10]!==r?(f=[r,u],n[9]=u,n[10]=r,n[11]=f):f=n[11],f}function an(s){const e=G.c(20),{namespace:n,resource:g,defaultSortKey:o,defaultViewMode:i}=s,c=o===void 0?"title":o,a=i===void 0?"table":i,[r,p]=z.useState(""),m=z.useDeferredValue(r),u=`${n}-${g}`,[d,h]=cn(u),f=`studio-${g}-filter-visible-${n}`;let x;e[0]!==f?(x=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=x):x=e[1];const[j,b]=z.useState(x);let v;e[2]!==f?(v=M=>{b(M),globalThis.localStorage?.setItem(f,String(M))},e[2]=f,e[3]=v):v=e[3];const S=v;let l;e[4]!==j||e[5]!==S?(l=()=>{S(!j)},e[4]=j,e[5]=S,e[6]=l):l=e[6];const N=l,[T,I]=rn(`studio-${g}-${n}`,a),{sortKey:A,sortDirection:w,handleSort:F}=ln(c),P=A;let k;return e[7]!==j||e[8]!==d||e[9]!==F||e[10]!==r||e[11]!==m||e[12]!==S||e[13]!==h||e[14]!==I||e[15]!==w||e[16]!==P||e[17]!==N||e[18]!==T?(k={search:r,searchTerm:m,setSearch:p,filters:d,setFilters:h,filterBarVisible:j,setFilterBarVisible:S,toggleFilterBar:N,viewMode:T,setViewMode:I,sortKey:P,sortDirection:w,handleSort:F},e[7]=j,e[8]=d,e[9]=F,e[10]=r,e[11]=m,e[12]=S,e[13]=h,e[14]=I,e[15]=w,e[16]=P,e[17]=N,e[18]=T,e[19]=k):k=e[19],k}function dn(s){const e=G.c(35),{open:n,onOpenChange:g,count:o,onConfirm:i}=s,c=se(),a=o===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let r;e[0]!==o||e[1]!==c||e[2]!==a?(r=c(a,{count:o}),e[0]=o,e[1]=c,e[2]=a,e[3]=r):r=e[3];let p;e[4]!==r?(p=t.jsx(St,{children:r}),e[4]=r,e[5]=p):p=e[5];const m=o===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==c||e[7]!==m?(u=c(m),e[6]=c,e[7]=m,e[8]=u):u=e[8];let d;e[9]!==u?(d=t.jsx(yt,{children:u}),e[9]=u,e[10]=d):d=e[10];let h;e[11]!==p||e[12]!==d?(h=t.jsxs(vt,{children:[p,d]}),e[11]=p,e[12]=d,e[13]=h):h=e[13];let f;e[14]!==c?(f=c("orgs.bulkDeleteDialog.cancelButton"),e[14]=c,e[15]=f):f=e[15];let x;e[16]!==f?(x=t.jsx(Ct,{children:f}),e[16]=f,e[17]=x):x=e[17];const j=o===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let b;e[18]!==o||e[19]!==c||e[20]!==j?(b=c(j,{count:o}),e[18]=o,e[19]=c,e[20]=j,e[21]=b):b=e[21];let v;e[22]!==i||e[23]!==b?(v=t.jsx(bt,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:b}),e[22]=i,e[23]=b,e[24]=v):v=e[24];let S;e[25]!==v||e[26]!==x?(S=t.jsxs(_t,{children:[x,v]}),e[25]=v,e[26]=x,e[27]=S):S=e[27];let l;e[28]!==S||e[29]!==h?(l=t.jsxs(Nt,{children:[h,S]}),e[28]=S,e[29]=h,e[30]=l):l=e[30];let N;return e[31]!==g||e[32]!==n||e[33]!==l?(N=t.jsx(Dt,{open:n,onOpenChange:g,children:l}),e[31]=g,e[32]=n,e[33]=l,e[34]=N):N=e[34],N}function un(s){const e=G.c(39),{item:n,canManage:g,allConnections:o,connectedAppNames:i,connectingItemId:c,onNavigateConnected:a,onConnect:r}=s,p=se();let m,u;e[0]!==i||e[1]!==n?(m=Oe(n)??"",u=i.has(m),e[0]=i,e[1]=n,e[2]=m,e[3]=u):(m=e[2],u=e[3]);const d=u;let h;e[4]!==n._meta?(h=kt(n._meta),e[4]=n._meta,e[5]=h):h=e[5];const f=h,x=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",j=n.server?.description||n.description||null;let b;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(b=n.server?.icons?.[0]?.src||Tt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=b):b=e[8];const v=b;let S;if(e[9]!==o||e[10]!==m){let O;e[12]!==m?(O=R=>R.connection_type!=="VIRTUAL"&&R.app_name===m,e[12]=m,e[13]=O):O=e[13],S=o.filter(O),e[9]=o,e[10]=m,e[11]=S}else S=e[11];const l=S,N=d||g;let T,I;e[14]!==l||e[15]!==d||e[16]!==n||e[17]!==r||e[18]!==a?(T=()=>{if(d){const O=l[0];O&&a(O);return}I()},I=()=>r(n),e[14]=l,e[15]=d,e[16]=n,e[17]=r,e[18]=a,e[19]=T,e[20]=I):(T=e[19],I=e[20]);let A;e[21]!==j||e[22]!==v||e[23]!==x?(A={title:x,description:j,icon:v},e[21]=j,e[22]=v,e[23]=x,e[24]=A):A=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(xe,{}),e[25]=w):w=e[25];const F=N?T:void 0;let P;e[26]!==g||e[27]!==c||e[28]!==I||e[29]!==d||e[30]!==n.id||e[31]!==p?(P=d?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:p("orgs.catalogItemCard.connected")}):g&&t.jsx(L,{variant:"outline",size:"sm",className:"h-7 px-3 text-sm font-medium",disabled:c!==null,onClick:O=>{O.stopPropagation(),I()},children:c===n.id?t.jsx(ge,{className:"size-3.5"}):p("orgs.catalogItemCard.connect")}),e[26]=g,e[27]=c,e[28]=I,e[29]=d,e[30]=n.id,e[31]=p,e[32]=P):P=e[32];let k;e[33]!==P?(k=t.jsx("div",{className:"flex items-center gap-2",children:P}),e[33]=P,e[34]=k):k=e[34];let M;return e[35]!==A||e[36]!==F||e[37]!==k?(M=t.jsx(ve,{connection:A,fallbackIcon:w,onClick:F,headerActionsAlwaysVisible:!0,headerActions:k}),e[35]=A,e[36]=F,e[37]=k,e[38]=M):M=e[38],M}function gn(s){return s?.length?{appToolName:s.find(n=>!!Kt(n._meta))?.name??null}:null}const mn=3;function pn(s){const e=new Map;for(const n of s)for(const g of n.connections??[]){const o=e.get(g.connection_id)??[];o.push(n),e.set(g.connection_id,o)}return e}function hn(s){const e=G.c(21),{projects:n}=s,g=se();if(n.length===0){let u;e[0]!==g?(u=g("projects.connections.orgWide"),e[0]=g,e[1]=u):u=e[1];let d;return e[2]!==u?(d=t.jsx("span",{className:"text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=d):d=e[3],d}let o,i,c;if(e[4]!==n){const u=n.slice(0,mn);c="flex min-w-0 items-center gap-2",o="flex shrink-0 -space-x-1.5",i=u.map(fn),e[4]=n,e[5]=o,e[6]=i,e[7]=c}else o=e[5],i=e[6],c=e[7];let a;e[8]!==o||e[9]!==i?(a=t.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=a):a=e[10];let r;e[11]!==n[0]?.title||e[12]!==n.length||e[13]!==g?(r=n.length===1?n[0]?.title:g("projects.connections.usedBy",{count:n.length}),e[11]=n[0]?.title,e[12]=n.length,e[13]=g,e[14]=r):r=e[14];let p;e[15]!==r?(p=t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:r}),e[15]=r,e[16]=p):p=e[16];let m;return e[17]!==c||e[18]!==a||e[19]!==p?(m=t.jsxs("div",{className:c,children:[a,p]}),e[17]=c,e[18]=a,e[19]=p,e[20]=m):m=e[20],m}function fn(s){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:s.title,children:t.jsx(Rt,{icon:s.icon,name:s.title,size:"xs"})},s.id)}function Re(s){const e=G.c(8),{selectionMode:n,children:g}=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 c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(We,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:jn,children:t.jsx(on,{size:20})})}),e[2]=c):c=e[2];let a;e[3]!==g?(a=t.jsxs(Xe,{children:[c,t.jsx(Ge,{align:"end",onClick:xn,children:g})]}),e[3]=g,e[4]=a):a=e[4];let r;return e[5]!==i||e[6]!==a?(r=t.jsx("div",{className:i,children:a}),e[5]=i,e[6]=a,e[7]=r):r=e[7],r}function xn(s){return s.stopPropagation()}function jn(s){return s.stopPropagation()}function Sn(s){const e=G.c(57),{group:n,onOpen:g,selectionMode:o,selectedIds:i,onToggleSelect:c}=s,a=se();let r;if(e[0]!==n.connections||e[1]!==i){let U;e[3]!==i?(U=y=>i.has(y.id),e[3]=i,e[4]=U):U=e[4],r=n.connections.every(U),e[0]=n.connections,e[1]=i,e[2]=r}else r=e[2];const p=r;let m;if(e[5]!==n.connections||e[6]!==i){let U;e[8]!==i?(U=y=>i.has(y.id),e[8]=i,e[9]=U):U=e[9],m=n.connections.some(U),e[5]=n.connections,e[6]=i,e[7]=m}else m=e[7];const u=m;let d;e[10]!==p||e[11]!==n.connections||e[12]!==c||e[13]!==i?(d=()=>{for(const U of n.connections)p?i.has(U.id)&&c(U.id):i.has(U.id)||c(U.id)},e[10]=p,e[11]=n.connections,e[12]=c,e[13]=i,e[14]=d):d=e[14];const h=d,f=n.title,x=n.icon;let j;e[15]!==n.connections.length||e[16]!==a?(j=a("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=a,e[17]=j):j=e[17];let b;e[18]!==n.icon||e[19]!==n.title||e[20]!==j?(b={title:f,icon:x,description:j},e[18]=n.icon,e[19]=n.title,e[20]=j,e[21]=b):b=e[21];let v;e[22]!==g||e[23]!==o||e[24]!==h?(v=()=>o?h():g(),e[22]=g,e[23]=o,e[24]=h,e[25]=v):v=e[25];const S=o&&p&&"ring-2 ring-primary",l=o&&u&&!p&&"ring-1 ring-primary/50";let N;e[26]!==l||e[27]!==S?(N=fe(S,l),e[26]=l,e[27]=S,e[28]=N):N=e[28];const T=o?p?!0:u&&"mixed":void 0;let I;e[29]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(xe,{}),e[29]=I):I=e[29];let A;e[30]!==p||e[31]!==n.connections.length||e[32]!==o||e[33]!==u||e[34]!==a||e[35]!==h?(A=o?t.jsx(Be,{checked:p?!0:u?"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]=p,e[31]=n.connections.length,e[32]=o,e[33]=u,e[34]=a,e[35]=h,e[36]=A):A=e[36];let w;e[37]!==g?(w=U=>{U.stopPropagation(),g()},e[37]=g,e[38]=w):w=e[38];let F;e[39]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(He,{size:16}),e[39]=F):F=e[39];let P;e[40]!==a?(P=a("orgs.connectionSelectionUi.open"),e[40]=a,e[41]=P):P=e[41];let k;e[42]!==w||e[43]!==P?(k=t.jsxs(ce,{onClick:w,children:[F,P]}),e[42]=w,e[43]=P,e[44]=k):k=e[44];let M;e[45]!==o||e[46]!==k?(M=t.jsx(Re,{selectionMode:o,children:k}),e[45]=o,e[46]=k,e[47]=M):M=e[47];let O;e[48]!==A||e[49]!==M?(O=t.jsxs("div",{className:"flex items-center gap-1",children:[A,M]}),e[48]=A,e[49]=M,e[50]=O):O=e[50];let R;return e[51]!==N||e[52]!==T||e[53]!==O||e[54]!==b||e[55]!==v?(R=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:b,onClick:v,className:N,selected:T,fallbackIcon:I,headerActionsAlwaysVisible:!0,headerActions:O})}),e[51]=N,e[52]=T,e[53]=O,e[54]=b,e[55]=v,e[56]=R):R=e[56],R}function yn(s){const e=G.c(36),{connection:n,isSelected:g,selectionMode:o,canManage:i,canManageAgents:c,onToggleSelect:a,onOpen:r,onToggleStatus:p,onDelete:m}=s,u=se();let d;e[0]!==g||e[1]!==a||e[2]!==o||e[3]!==u?(d=o?t.jsx(Be,{checked:g,onCheckedChange:a,onClick:vn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=g,e[1]=a,e[2]=o,e[3]=u,e[4]=d):d=e[4];let h;e[5]!==r?(h=T=>{T.stopPropagation(),r()},e[5]=r,e[6]=h):h=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(He,{size:16}),e[7]=f):f=e[7];let x;e[8]!==u?(x=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=x):x=e[9];let j;e[10]!==h||e[11]!==x?(j=t.jsxs(ce,{onClick:h,children:[f,x]}),e[10]=h,e[11]=x,e[12]=j):j=e[12];let b;e[13]!==i||e[14]!==c||e[15]!==a||e[16]!==u?(b=(i||c)&&t.jsxs(ce,{onClick:T=>{T.stopPropagation(),a()},children:[t.jsx(Wt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=c,e[15]=a,e[16]=u,e[17]=b):b=e[17];let v;e[18]!==i||e[19]!==n||e[20]!==p||e[21]!==u?(v=i&&(n.status==="active"?t.jsxs(ce,{onClick:T=>{T.stopPropagation(),p("inactive")},children:[t.jsx(Xt,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ce,{onClick:T=>{T.stopPropagation(),p("active")},children:[t.jsx(Gt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=p,e[21]=u,e[22]=v):v=e[22];let S;e[23]!==i||e[24]!==m||e[25]!==u?(S=i&&t.jsxs(ce,{variant:"destructive",onClick:T=>{T.stopPropagation(),m()},children:[t.jsx(Ke,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=m,e[25]=u,e[26]=S):S=e[26];let l;e[27]!==o||e[28]!==j||e[29]!==b||e[30]!==v||e[31]!==S?(l=t.jsxs(Re,{selectionMode:o,children:[j,b,v,S]}),e[27]=o,e[28]=j,e[29]=b,e[30]=v,e[31]=S,e[32]=l):l=e[32];let N;return e[33]!==d||e[34]!==l?(N=t.jsxs("div",{className:"flex items-center gap-1",children:[d,l]}),e[33]=d,e[34]=l,e[35]=N):N=e[35],N}function vn(s){return s.stopPropagation()}function Cn(s){const e=G.c(29),{count:n,total:g,canManage:o,canManageAgents:i,onSelectAll:c,onDeselectAll:a,onDelete:r,onAddToAgent:p,onToggleStatus:m,onCancel:u}=s,d=se();if(n===0)return null;let h;e[0]!==n||e[1]!==d?(h=d("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=d,e[2]=h):h=e[2];let f;e[3]!==h?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:h}),e[3]=h,e[4]=f):f=e[4];let x;e[5]!==n||e[6]!==a||e[7]!==c||e[8]!==d||e[9]!==g?(x=n<g?t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:d("orgs.connectionSelectionUi.selectAll",{total:g})}):t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:d("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=a,e[7]=c,e[8]=d,e[9]=g,e[10]=x):x=e[10];let j;e[11]!==i||e[12]!==p||e[13]!==d?(j=i&&t.jsxs(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:p,children:[t.jsx(Le,{size:13}),d("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=p,e[13]=d,e[14]=j):j=e[14];let b;e[15]!==o||e[16]!==r||e[17]!==m||e[18]!==d?(b=o&&t.jsxs(t.Fragment,{children:[t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("active"),children:d("orgs.connectionSelectionUi.enable")}),t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("inactive"),children:d("orgs.connectionSelectionUi.disable")}),t.jsxs(L,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:[t.jsx(Ke,{size:13}),d("orgs.connectionSelectionUi.delete")]})]}),e[15]=o,e[16]=r,e[17]=m,e[18]=d,e[19]=b):b=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Ee,{size:13}),e[20]=v):v=e[20];let S;e[21]!==u?(S=t.jsx(L,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:v}),e[21]=u,e[22]=S):S=e[22];let l;return e[23]!==f||e[24]!==x||e[25]!==j||e[26]!==b||e[27]!==S?(l=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[f,x,j,b,S]})}),e[23]=f,e[24]=x,e[25]=j,e[26]=b,e[27]=S,e[28]=l):l=e[28],l}function bn(s){const e=G.c(47),{open:n,onOpenChange:g,agents:o,onConfirm:i}=s,c=se(),[a,r]=z.useState(null);let p;e[0]!==g?(p=k=>{k||r(null),g(k)},e[0]=g,e[1]=p):p=e[1];const m=p;let u;e[2]!==c?(u=c("orgs.connectionSelectionUi.addToAgentTitle"),e[2]=c,e[3]=u):u=e[3];let d;e[4]!==u?(d=t.jsx(ke,{children:u}),e[4]=u,e[5]=d):d=e[5];let h;e[6]!==c?(h=c("orgs.connectionSelectionUi.addToAgentDescription"),e[6]=c,e[7]=h):h=e[7];let f;e[8]!==h?(f=t.jsx(Te,{children:h}),e[8]=h,e[9]=f):f=e[9];let x;e[10]!==d||e[11]!==f?(x=t.jsxs(we,{children:[d,f]}),e[10]=d,e[11]=f,e[12]=x):x=e[12];let j;e[13]!==o||e[14]!==a||e[15]!==c?(j=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:c("orgs.connectionSelectionUi.noAgentsFound")}):o.map(k=>t.jsxs("button",{type:"button",onClick:()=>r(k.id),className:fe("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",a===k.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(sn,{icon:k.icon,name:k.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:k.title}),k.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.description})]})]},k.id)),e[13]=o,e[14]=a,e[15]=c,e[16]=j):j=e[16];let b;e[17]!==j?(b=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[17]=j,e[18]=b):b=e[18];let v;e[19]!==m?(v=()=>m(!1),e[19]=m,e[20]=v):v=e[20];let S;e[21]!==c?(S=c("orgs.connectionSelectionUi.cancel"),e[21]=c,e[22]=S):S=e[22];let l;e[23]!==S||e[24]!==v?(l=t.jsx(L,{variant:"outline",onClick:v,children:S}),e[23]=S,e[24]=v,e[25]=l):l=e[25];const N=!a;let T;e[26]!==m||e[27]!==i||e[28]!==a?(T=()=>{a&&(i(a),m(!1))},e[26]=m,e[27]=i,e[28]=a,e[29]=T):T=e[29];let I;e[30]!==c?(I=c("orgs.connectionSelectionUi.add"),e[30]=c,e[31]=I):I=e[31];let A;e[32]!==N||e[33]!==T||e[34]!==I?(A=t.jsx(L,{disabled:N,onClick:T,children:I}),e[32]=N,e[33]=T,e[34]=I,e[35]=A):A=e[35];let w;e[36]!==l||e[37]!==A?(w=t.jsxs(Ae,{children:[l,A]}),e[36]=l,e[37]=A,e[38]=w):w=e[38];let F;e[39]!==w||e[40]!==x||e[41]!==b?(F=t.jsxs(Ie,{className:"sm:max-w-[400px]",children:[x,b,w]}),e[39]=w,e[40]=x,e[41]=b,e[42]=F):F=e[42];let P;return e[43]!==m||e[44]!==n||e[45]!==F?(P=t.jsx(Pe,{open:n,onOpenChange:m,children:F}),e[43]=m,e[44]=n,e[45]=F,e[46]=P):P=e[46],P}function _n({listState:s,activeTab:e,typeFilter:n,statusFilter:g}){const o=se(),{org:i}=Me(),c=st(),a=$e(),{data:r}=Fe.useSession(),p=ze(),m=Et(s),u=ft(),{granted:d}=ye("connections:manage"),{granted:h}=ye("agents:manage"),[f,x]=z.useState(new Set),j=f.size>0,[b,v]=z.useState(!1),[S,l]=z.useState(!1),[N,T]=z.useState(null),I=Ht(),A=pn(qt(I)),w=m.filter(_=>!(n!=="ALL"&&_.connection_type!==n||g!=="ALL"&&_.status!==g)),F=pt(w),P=_=>{x(C=>{const B=new Set(C);return B.has(_)?B.delete(_):B.add(_),B})},k=()=>{x(new Set)},M=Ue(s.searchTerm),O=M.items,R=jt(M.loadMore,M.hasMore,M.isLoadingMore),U=new Set(m.filter(_=>_.app_name).map(_=>_.app_name)),y=s.search.length>0,$=e==="all"||y?O.filter(_=>{if(y){const C=Oe(_);if(C&&U.has(C))return!1}return!0}):[],W=e==="connected"||y?F:[],te=async _=>{if(!(!i||!r?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),T(_.id);try{const C=at(_,i.id,r.user.id,{remoteIndex:0}),B=C.connection_type==="STDIO",H=!!C.connection_url,K=B&&C.connection_headers&&typeof C.connection_headers=="object"&&"command"in C.connection_headers;if(!H&&!K){X.error(o("orgs.connections.cannotConnectNoMethod")),T(null);return}const Ce=await p.create.mutateAsync(C),{id:ie}=Ce,le=await nn({connectionId:ie,orgId:i.id,orgSlug:i.slug,persistFallback:re=>p.update.mutateAsync({id:ie,data:{connection_token:re}}).then(()=>{})});if(le.ran&&!le.ok){ne("connection_oauth_failed",{connection_id:ie,flow:"connections_page_connect",error:le.error??"no_token"}),X.error(o("orgs.connections.authenticationFailed",{error:le.error??"no token received"}));return}if(le.ran){ne("connection_oauth_succeeded",{connection_id:ie,flow:"connections_page_connect"});const re=new URL(`/api/${i.slug}/mcp/${ie}`,window.location.origin);await c.invalidateQueries({queryKey:ct.isMCPAuthenticated(re.href,null)}),D(),X.success(o("orgs.connections.authenticationSuccessful"))}let pe=null;try{const re=await c.fetchQuery(Bt({connectionId:ie,orgId:i.id,orgSlug:i.slug}));pe=gn((await re.listTools()).tools)}catch{}const be=ue(Ce),_e=pe?pe.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(pe.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:be}}:null;X.success(o("orgs.connections.connectedSuccessfully"),_e?{action:{label:o("orgs.connections.openConnection"),onClick:()=>a(_e)}}:void 0)}catch(C){X.error(o("orgs.connections.failedToConnect",{error:C instanceof Error?C.message:String(C)}))}finally{T(null)}}},Q=ot(),D=()=>{lt(c,i.id)},E=async()=>{v(!1);const _=[...f];ne("connections_bulk_delete",{count:_.length});const B=(await Promise.allSettled(_.map(H=>Q.call("COLLECTION_CONNECTIONS_DELETE",{id:H,force:!0})))).filter(H=>H.status==="fulfilled").length;D(),X.success(o("orgs.connections.deletedConnections",{count:B})),k()},V=async(_,C)=>{try{await p.update.mutateAsync({id:_,data:{status:C}}),D(),X.success(o(C==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{X.error(o("orgs.connections.failedToUpdateConnection"))}},me=async _=>{const C=[...f];ne("connections_bulk_status_toggled",{count:C.length,to_status:_});const H=(await Promise.allSettled(C.map(K=>p.update.mutateAsync({id:K,data:{status:_}})))).filter(K=>K.status==="fulfilled").length;D(),X.success(_==="active"?o("orgs.connections.enabledConnections",{count:H}):o("orgs.connections.disabledConnections",{count:H})),k()},je=async _=>{const C=I.find(K=>K.id===_);if(!C)return;ne("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const B=new Set(C.connections.map(K=>K.connection_id)),H=[...f].filter(K=>!B.has(K)).map(K=>({connection_id:K,selected_tools:null,selected_resources:null,selected_prompts:null}));if(H.length===0){X.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await Q.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...C.connections,...H]}}),it(c,i.id),X.success(o("orgs.connections.addedConnectionsToAgent",{count:H.length,agentTitle:C.title})),k()}catch{X.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(xt,{...u}),t.jsx(dn,{open:b,onOpenChange:v,count:f.size,onConfirm:E}),t.jsx(bn,{open:S,onOpenChange:l,agents:I,onConfirm:je}),M.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ge,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(y?$.length===0&&w.length===0:e==="all"?$.length===0:w.length===0)?t.jsx(ht,{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(d?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[W.map(_=>{if(_.type==="group")return t.jsx(Sn,{group:_,onOpen:()=>{a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:_.key}})},selectionMode:j,selectedIds:f,onToggleSelect:P},_.key);const C=_.connection,B=f.has(C.id);return t.jsx(ve,{connection:C,fallbackIcon:t.jsx(xe,{}),onClick:()=>j?P(C.id):a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ue(C)}}),className:fe(B&&"ring-2 ring-primary bg-primary/5"),selected:j?B:void 0,footer:t.jsx(hn,{projects:A.get(C.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(yn,{connection:C,isSelected:B,selectionMode:j,canManage:d,canManageAgents:h,onToggleSelect:()=>P(C.id),onOpen:()=>a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ue(C)}}),onToggleStatus:H=>V(C.id,H),onDelete:()=>u.requestDelete(C)})},C.id)}),$.map(_=>t.jsx(un,{item:_,canManage:d,allConnections:m,connectedAppNames:U,connectingItemId:N,onNavigateConnected:C=>a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ue(C)}}),onConnect:te},_.id)),(e==="all"||y)&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||y)&&M.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ge,{className:"size-6 text-muted-foreground"})})]})}),j&&t.jsx(Cn,{count:f.size,total:w.length,canManage:d,canManageAgents:h,onSelectAll:()=>{x(new Set(w.map(_=>_.id)))},onDeselectAll:()=>x(new Set),onDelete:()=>v(!0),onAddToAgent:()=>l(!0),onToggleStatus:me,onCancel:k})]})}function Nn(){const s=se(),{org:e}=Me(),n=$e(),g=qe({strict:!1}),{data:o}=Fe.useSession(),{stdioEnabled:i}=Je(),c=Ve(),{granted:a}=ye("connections:manage"),r=an({namespace:e.slug,resource:"connections"}),p=ze(),m=Ye(),[u,d]=Ze(et.connectionsTab(e.slug),y=>g.tab==="all"||g.tab==="connected"?g.tab:y??"all"),[h,f]=z.useState("ALL"),[x,j]=z.useState("ALL"),v=Ue(r.searchTerm).items,S=r.search!==r.searchTerm,l=tt({resolver:nt(Jt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),N=l.watch("ui_type"),T=l.watch("connection_url"),I=l.watch("npx_package"),A=he({uiType:N,connectionUrl:T??"",npxPackage:I??""})??De({uiType:N,connectionUrl:T??"",registryItems:v}),w=a&&g.action==="create",F=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),n({to:".",search:y=>({...y,action:"create"})})},P=()=>{n({to:".",search:y=>({...y,action:void 0})})},k=async y=>{let $,W=null,te=null,Q=null;y.ui_type==="NPX"?($="STDIO",W="",Q=en(y.npx_package||"",y.env_vars||[])):y.ui_type==="STDIO"?($="STDIO",W="",Q=tn(y.stdio_command||"",y.stdio_args||"",y.stdio_cwd,y.env_vars||[])):($=y.ui_type,W=y.connection_url||"",te=y.connection_token||null);const D=rt("conn");ne("connection_custom_created",{connection_type:$,ui_type:y.ui_type}),await p.create.mutateAsync({id:D,title:y.title,description:y.description||null,connection_type:$,connection_url:W,connection_token:te,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:e.id,icon:y.icon??null,app_name:null,app_id:null,connection_headers:Q,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null}),P(),l.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ue({app_name:null,connection_url:W,title:y.title,id:D})}})},M=y=>{y||(w&&P(),l.reset())},O=y=>{const $=y.trim();if(!$)return;const W=!!l.formState.dirtyFields.title,te=!!l.formState.dirtyFields.description,Q=!!l.formState.dirtyFields.env_vars,D=V=>{if(V&&(!W&&!l.getValues("title").trim()&&V.title&&l.setValue("title",V.title,{shouldDirty:!1}),!te&&!(l.getValues("description")??"").trim()&&V.description&&l.setValue("description",V.description,{shouldDirty:!1}),!Q&&V.envVarKeys?.length)){const me=l.getValues("env_vars")??[],je=new Set(me.map(C=>C.key)),_=V.envVarKeys.filter(C=>!je.has(C));_.length>0&&l.setValue("env_vars",[...me,..._.map(C=>({key:C,value:""}))],{shouldDirty:!0})}},E=Zt($);if(E&&i){l.setValue("ui_type","NPX",{shouldDirty:!0}),l.setValue("npx_package",E.packageName,{shouldDirty:!0}),l.setValue("connection_url","",{shouldDirty:!0}),l.setValue("connection_token",null,{shouldDirty:!0}),D(he({uiType:"NPX",npxPackage:E.packageName}));return}if($.startsWith("http://")||$.startsWith("https://")){const V=N==="HTTP"||N==="SSE"||N==="Websocket"?N:"HTTP";l.setValue("ui_type",V,{shouldDirty:!0}),l.setValue("connection_url",$,{shouldDirty:!0}),D(he({uiType:V,connectionUrl:$})??De({uiType:V,connectionUrl:$,registryItems:v}));return}N==="NPX"&&D(he({uiType:"NPX",npxPackage:$}))},R=a?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(L,{size:"sm",variant:"default",onClick:F,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:s("orgs.connections.customConnection")})]})}):null,U=t.jsx(dt,{sortKey:r.sortKey,sortDirection:r.sortDirection,onSort:r.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:h,onChange:y=>f(y||"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:x,onChange:y=>j(y||"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")}]}]});return t.jsx(t.Fragment,{children:t.jsxs(ae,{children:[(()=>{const y=s("orgs.connections.createConnection"),$=s("orgs.connections.createConnectionDescription"),W=l.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),te=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(q,{control:l.control,name:"ui_type",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.type")}),t.jsxs(Ot,{value:D.value,onValueChange:D.onChange,children:[t.jsx(Z,{children:t.jsx(Ut,{children:t.jsx(Vt,{})})}),t.jsxs(zt,{children:[t.jsx(de,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(de,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(de,{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(de,{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(de,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Qt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(ee,{})]})}),N==="NPX"&&t.jsx(q,{control:l.control,name:"npx_package",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.npmPackage")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...D,value:D.value??"",onPaste:E=>{const V=E.clipboardData.getData("text");V&&(E.preventDefault(),l.setValue("npx_package",V.trim(),{shouldDirty:!0}),O(V))},onBlur:E=>{O(E.target.value),D.onBlur()}})}),t.jsx(ee,{})]})}),N==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(q,{control:l.control,name:"stdio_command",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.command")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.commandPlaceholder"),...D,value:D.value??""})}),t.jsx(ee,{})]})}),t.jsx(q,{control:l.control,name:"stdio_args",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.arguments")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.argumentsPlaceholder"),...D,value:D.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(q,{control:l.control,name:"stdio_cwd",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.workingDirectory")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...D,value:D.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(ee,{})]})})]}),(N==="NPX"||N==="STDIO")&&t.jsx(q,{control:l.control,name:"env_vars",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.environmentVariables")}),t.jsx(Z,{children:t.jsx(Yt,{value:D.value??[],onChange:D.onChange})}),t.jsx(ee,{})]})}),N!=="NPX"&&N!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(q,{control:l.control,name:"connection_url",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.url")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.urlPlaceholder"),...D,value:D.value??"",onPaste:E=>{const V=E.clipboardData.getData("text");V&&(E.preventDefault(),l.setValue("connection_url",V.trim(),{shouldDirty:!0}),O(V))},onBlur:E=>{O(E.target.value),D.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(q,{control:l.control,name:"connection_token",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:A?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(Z,{children:t.jsx(oe,{type:"password",placeholder:A?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...D,value:D.value??""})}),A?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.token.helperText,A.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(ee,{})]})})]}),t.jsx(q,{control:l.control,name:"title",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.name")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.namePlaceholder"),...D})}),t.jsx(ee,{})]})}),t.jsx(q,{control:l.control,name:"description",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.description")}),t.jsx(Z,{children:t.jsx(Lt,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...D,value:D.value??""})}),t.jsx(ee,{})]})})]}),Q=w;return c?t.jsx(wt,{open:Q,onOpenChange:M,children:t.jsxs(At,{className:"max-h-[90vh]",children:[t.jsx(It,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Pt,{children:y}),t.jsx(Mt,{className:"mt-1",children:$})]}),t.jsx($t,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(Ne,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(k),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:te}),t.jsx(Ft,{children:t.jsx(L,{type:"submit",disabled:l.formState.isSubmitting,className:"w-full",children:W})})]})})]})}):t.jsx(Pe,{open:Q,onOpenChange:M,children:t.jsxs(Ie,{className:"sm:max-w-[525px]",children:[t.jsxs(we,{children:[t.jsx(ke,{children:y}),t.jsx(Te,{children:$})]}),t.jsx(Ne,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(k),children:[t.jsx("div",{className:"py-4",children:te}),t.jsxs(Ae,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>M(!1),children:s("orgs.connections.cancel")}),t.jsx(L,{type:"submit",disabled:l.formState.isSubmitting,className:"min-w-40",children:W})]})]})})]})})})(),t.jsx(ae.Content,{children:t.jsx(ae.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[m?t.jsx(ae.Actions,{secondary:t.jsxs(t.Fragment,{children:[t.jsx(gt,{value:r.search,onChange:r.setSearch,label:s("library.context.search"),placeholder:s("orgs.connections.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),U]}),children:R}):t.jsx(ae.Title,{actions:R,children:s("orgs.connections.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 empty:hidden",children:!m&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ut,{value:r.search,onChange:r.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:y=>{y.key==="Escape"&&(r.setSearch(""),y.target.blur())}}),U]})}),t.jsx(mt,{placement:"page",tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:u,onTabChange:y=>{const $=y;$!==u&&ne("connections_page_tab_changed",{to_tab:$}),d($)}}),t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ge,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:S?.5:1,transition:S?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:S?"none":"auto"},children:t.jsx(_n,{listState:r,activeTab:u,typeFilter:h,statusFilter:x})})})]})})})]})})}function Ws(){const s=G.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",children:t.jsx(ge,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Nn,{})})}),s[0]=e):e=s[0],e}export{Ws as default};
|
|
1
|
+
import{r as z,c as G,b as se,j as t,B as L,h as ge,l as fe,U as ce,v as ke,aM as Te,s as we,w as Ae,q as Ie,D as Pe,T as We,X as Xe,V as Ge,H as Qe,a2 as Me,d as $e,u as qe,a as Fe,a1 as Je,am as ye,aa as Ye,au as Ze,aw as et,aE as tt,aD as nt,n as ae,I as oe,y as ne,o as st,an as ot,t as X,b8 as it,K as ct,eB as lt}from"./index-Cmhl3zNb.js";import{a as Oe,g as rt,e as at}from"./extract-connection-data-BpdUae_j.js";import{C as dt}from"./collection-display-button-CEiwIbk0.js";import{S as ut}from"./search-input-DBKGcZuw.js";import{S as gt}from"./search-toggle-CLG4gmKJ.js";import{C as mt}from"./collection-tabs-C331r2n4.js";import{C as ve,u as Ue,g as pt}from"./connection-card-Qtm3n_hS.js";import{E as ht}from"./empty-state-BZa0U-xG.js";import{u as ft,D as xt}from"./use-delete-connection-CjpOj4k7.js";import{u as jt}from"./use-infinite-scroll-DQl4a0Bs.js";import{u as Ve}from"./use-mobile-CY0Djv_M.js";import{g as ue}from"./connection-slug-CITJ0kGN.js";import{A as St,a as yt,b as vt,c as Ct,g as bt,d as _t,e as Nt,f as Dt}from"./alert-dialog-CgRaXWeG.js";import{n as xe}from"./LinkBroken01-y64X2SC-.js";import{g as kt,a as Tt}from"./metadata-D72DunRR.js";import{D as wt,a as At,d as It,b as Pt,e as Mt,f as $t,g as Ft}from"./drawer-CkgkUBCk.js";import{F as q,b as J,c as Y,d as Z,f as ee,a as Ne}from"./form-DidHa5sD.js";import{S as Ot,b as Ut,a as Vt,d as zt,c as de}from"./select-BFXL8R1G.js";import{T as Lt}from"./textarea-CMJRBl6x.js";import{b as ze,u as Et}from"./use-connection-CikB9KcW.js";import{m as Bt}from"./use-mcp-client-CedU4dWV.js";import{b as Ht}from"./repository-binding-X3TRktCN.js";import{g as Kt}from"./types-CD9jRVDk.js";import{A as Rt,bL as Wt,aH as Xt,bk as Gt,u as Se}from"./agent-icon-DMH8Ftve.js";import{s as Le}from"./Plus-D_siv_aA.js";import{d as Qt}from"./UserSquare-CEX9DbWl.js";import{s as Ee}from"./XClose-BQ9Dlu1I.js";import{s as qt}from"./use-project-scope-COiEpk7r.js";import{c as Jt}from"./schema-ChwlN9B2.js";import{i as he,a as De,E as Yt,p as Zt,b as en,c as tn}from"./connection-form-helpers-C8PcIQLm.js";import{a as nn}from"./authenticate-and-persist-oauth-DK-E6e3Z.js";import{I as sn}from"./integration-icon-CktagpLu.js";import{C as Be}from"./checkbox-CwspTWv-.js";import{i as on}from"./DotsVertical-H16dBinG.js";import{s as He}from"./Image01-C-r__mWH.js";import{s as Ke}from"./Trash01-CqbCnp4Y.js";import"./connection-CEjWhO8M.js";import"./url-slug-CXYaPIEX.js";import"./ArrowUp-CWx4kMsV.js";import"./SwitchHorizontal01-ZjaXGph0.js";import"./tooltip-kZk2wAMk.js";import"./index-D69M9S-D.js";import"./view-mode-toggle-dGCnwIOo.js";import"./badge-CRNAVwfV.js";import"./SearchMd-KKuAy3kv.js";import"./icon-button-iwZ3O0_B.js";import"./useInfiniteQuery-BLA_teXl.js";import"./infiniteQueryObserver-978TY1hh.js";import"./slugify-CEUa2lfQ.js";import"./label-COA0amPU.js";import"./index-BdQq_4o_.js";import"./ChevronUp-BlFhjumO.js";import"./auth-Bjnc521y.js";import"./AlertCircle-iwRSZJFi.js";import"./Tool01-Bsd9MAXv.js";import"./ArrowLeft-_QxYwR3P.js";import"./ShoppingBag01-COYAkOJY.js";import"./ZoomOut-CYcrWaFo.js";import"./Building02-Dcs_HLaa.js";import"./CheckCircle-X3D4eq-V.js";import"./ChevronSelectorVertical-7X_EL11G.js";import"./Copy01-CsyaL0tc.js";import"./CreditCard01-DZn9m-o1.js";import"./Globe04-B5AbE2NG.js";import"./Key01-D8PhPz3k.js";import"./Link01-BZlTJYwG.js";import"./Monitor01-Ccoz_3RV.js";import"./Sun-s_f7cajm.js";import"./Play-B8dkIMIB.js";import"./Upload01-BuL02EP8.js";import"./User01-DOqRt8wn.js";import"./Users01-n5qz8jdG.js";import"./mcp-oauth-DqjrYGbv.js";import"./mcp-oauth-jIbhs8wE.js";function cn(s){const e=`deco-filters-${s}`,[n,g]=z.useState(()=>{try{const i=globalThis.localStorage?.getItem(e);if(i)return JSON.parse(i)}catch(i){console.error("Failed to parse stored filters:",i)}return[]});return[n,i=>{g(i);try{globalThis.localStorage?.setItem(e,JSON.stringify(i))}catch(c){console.error("Failed to save filters:",c)}}]}function ln(s){const e=G.c(7),[n,g]=z.useState(s),[o,i]=z.useState(s?"desc":null);let c;e[0]!==o||e[1]!==n?(c=p=>{n!==p?(g(p),i("asc")):o==="asc"?i("desc"):o==="desc"&&(g(void 0),i(null))},e[0]=o,e[1]=n,e[2]=c):c=e[2];const a=c;let r;return e[3]!==a||e[4]!==o||e[5]!==n?(r={sortKey:n,sortDirection:o,handleSort:a},e[3]=a,e[4]=o,e[5]=n,e[6]=r):r=e[6],r}function rn(s,e){const n=G.c(12),g=e===void 0?"cards":e,o=Ve(),i=z.useRef(o),c=s?`deco-view-mode-${s}`:"deco-view-mode";let a;n[0]!==g||n[1]!==c?(a=()=>{const x=globalThis.localStorage?.getItem(c);return x==="cards"||x==="table"?x:g},n[0]=g,n[1]=c,n[2]=a):a=n[2];const[r,p]=z.useState(a);let m;n[3]!==c?(m=x=>{p(x),globalThis.localStorage?.setItem(c,x)},n[3]=c,n[4]=m):m=n[4];const u=m;let d,h;n[5]!==o||n[6]!==r?(d=()=>{!i.current&&o&&r==="table"&&p("cards"),i.current=o},h=[o,r],n[5]=o,n[6]=r,n[7]=d,n[8]=h):(d=n[7],h=n[8]),z.useEffect(d,h);let f;return n[9]!==u||n[10]!==r?(f=[r,u],n[9]=u,n[10]=r,n[11]=f):f=n[11],f}function an(s){const e=G.c(20),{namespace:n,resource:g,defaultSortKey:o,defaultViewMode:i}=s,c=o===void 0?"title":o,a=i===void 0?"table":i,[r,p]=z.useState(""),m=z.useDeferredValue(r),u=`${n}-${g}`,[d,h]=cn(u),f=`studio-${g}-filter-visible-${n}`;let x;e[0]!==f?(x=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=x):x=e[1];const[j,b]=z.useState(x);let v;e[2]!==f?(v=M=>{b(M),globalThis.localStorage?.setItem(f,String(M))},e[2]=f,e[3]=v):v=e[3];const S=v;let l;e[4]!==j||e[5]!==S?(l=()=>{S(!j)},e[4]=j,e[5]=S,e[6]=l):l=e[6];const N=l,[T,I]=rn(`studio-${g}-${n}`,a),{sortKey:A,sortDirection:w,handleSort:F}=ln(c),P=A;let k;return e[7]!==j||e[8]!==d||e[9]!==F||e[10]!==r||e[11]!==m||e[12]!==S||e[13]!==h||e[14]!==I||e[15]!==w||e[16]!==P||e[17]!==N||e[18]!==T?(k={search:r,searchTerm:m,setSearch:p,filters:d,setFilters:h,filterBarVisible:j,setFilterBarVisible:S,toggleFilterBar:N,viewMode:T,setViewMode:I,sortKey:P,sortDirection:w,handleSort:F},e[7]=j,e[8]=d,e[9]=F,e[10]=r,e[11]=m,e[12]=S,e[13]=h,e[14]=I,e[15]=w,e[16]=P,e[17]=N,e[18]=T,e[19]=k):k=e[19],k}function dn(s){const e=G.c(35),{open:n,onOpenChange:g,count:o,onConfirm:i}=s,c=se(),a=o===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let r;e[0]!==o||e[1]!==c||e[2]!==a?(r=c(a,{count:o}),e[0]=o,e[1]=c,e[2]=a,e[3]=r):r=e[3];let p;e[4]!==r?(p=t.jsx(St,{children:r}),e[4]=r,e[5]=p):p=e[5];const m=o===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==c||e[7]!==m?(u=c(m),e[6]=c,e[7]=m,e[8]=u):u=e[8];let d;e[9]!==u?(d=t.jsx(yt,{children:u}),e[9]=u,e[10]=d):d=e[10];let h;e[11]!==p||e[12]!==d?(h=t.jsxs(vt,{children:[p,d]}),e[11]=p,e[12]=d,e[13]=h):h=e[13];let f;e[14]!==c?(f=c("orgs.bulkDeleteDialog.cancelButton"),e[14]=c,e[15]=f):f=e[15];let x;e[16]!==f?(x=t.jsx(Ct,{children:f}),e[16]=f,e[17]=x):x=e[17];const j=o===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let b;e[18]!==o||e[19]!==c||e[20]!==j?(b=c(j,{count:o}),e[18]=o,e[19]=c,e[20]=j,e[21]=b):b=e[21];let v;e[22]!==i||e[23]!==b?(v=t.jsx(bt,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:b}),e[22]=i,e[23]=b,e[24]=v):v=e[24];let S;e[25]!==v||e[26]!==x?(S=t.jsxs(_t,{children:[x,v]}),e[25]=v,e[26]=x,e[27]=S):S=e[27];let l;e[28]!==S||e[29]!==h?(l=t.jsxs(Nt,{children:[h,S]}),e[28]=S,e[29]=h,e[30]=l):l=e[30];let N;return e[31]!==g||e[32]!==n||e[33]!==l?(N=t.jsx(Dt,{open:n,onOpenChange:g,children:l}),e[31]=g,e[32]=n,e[33]=l,e[34]=N):N=e[34],N}function un(s){const e=G.c(39),{item:n,canManage:g,allConnections:o,connectedAppNames:i,connectingItemId:c,onNavigateConnected:a,onConnect:r}=s,p=se();let m,u;e[0]!==i||e[1]!==n?(m=Oe(n)??"",u=i.has(m),e[0]=i,e[1]=n,e[2]=m,e[3]=u):(m=e[2],u=e[3]);const d=u;let h;e[4]!==n._meta?(h=kt(n._meta),e[4]=n._meta,e[5]=h):h=e[5];const f=h,x=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",j=n.server?.description||n.description||null;let b;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(b=n.server?.icons?.[0]?.src||Tt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=b):b=e[8];const v=b;let S;if(e[9]!==o||e[10]!==m){let O;e[12]!==m?(O=R=>R.connection_type!=="VIRTUAL"&&R.app_name===m,e[12]=m,e[13]=O):O=e[13],S=o.filter(O),e[9]=o,e[10]=m,e[11]=S}else S=e[11];const l=S,N=d||g;let T,I;e[14]!==l||e[15]!==d||e[16]!==n||e[17]!==r||e[18]!==a?(T=()=>{if(d){const O=l[0];O&&a(O);return}I()},I=()=>r(n),e[14]=l,e[15]=d,e[16]=n,e[17]=r,e[18]=a,e[19]=T,e[20]=I):(T=e[19],I=e[20]);let A;e[21]!==j||e[22]!==v||e[23]!==x?(A={title:x,description:j,icon:v},e[21]=j,e[22]=v,e[23]=x,e[24]=A):A=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(xe,{}),e[25]=w):w=e[25];const F=N?T:void 0;let P;e[26]!==g||e[27]!==c||e[28]!==I||e[29]!==d||e[30]!==n.id||e[31]!==p?(P=d?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:p("orgs.catalogItemCard.connected")}):g&&t.jsx(L,{variant:"outline",size:"sm",className:"h-7 px-3 text-sm font-medium",disabled:c!==null,onClick:O=>{O.stopPropagation(),I()},children:c===n.id?t.jsx(ge,{className:"size-3.5"}):p("orgs.catalogItemCard.connect")}),e[26]=g,e[27]=c,e[28]=I,e[29]=d,e[30]=n.id,e[31]=p,e[32]=P):P=e[32];let k;e[33]!==P?(k=t.jsx("div",{className:"flex items-center gap-2",children:P}),e[33]=P,e[34]=k):k=e[34];let M;return e[35]!==A||e[36]!==F||e[37]!==k?(M=t.jsx(ve,{connection:A,fallbackIcon:w,onClick:F,headerActionsAlwaysVisible:!0,headerActions:k}),e[35]=A,e[36]=F,e[37]=k,e[38]=M):M=e[38],M}function gn(s){return s?.length?{appToolName:s.find(n=>!!Kt(n._meta))?.name??null}:null}const mn=3;function pn(s){const e=new Map;for(const n of s)for(const g of n.connections??[]){const o=e.get(g.connection_id)??[];o.push(n),e.set(g.connection_id,o)}return e}function hn(s){const e=G.c(21),{projects:n}=s,g=se();if(n.length===0){let u;e[0]!==g?(u=g("projects.connections.orgWide"),e[0]=g,e[1]=u):u=e[1];let d;return e[2]!==u?(d=t.jsx("span",{className:"text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=d):d=e[3],d}let o,i,c;if(e[4]!==n){const u=n.slice(0,mn);c="flex min-w-0 items-center gap-2",o="flex shrink-0 -space-x-1.5",i=u.map(fn),e[4]=n,e[5]=o,e[6]=i,e[7]=c}else o=e[5],i=e[6],c=e[7];let a;e[8]!==o||e[9]!==i?(a=t.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=a):a=e[10];let r;e[11]!==n[0]?.title||e[12]!==n.length||e[13]!==g?(r=n.length===1?n[0]?.title:g("projects.connections.usedBy",{count:n.length}),e[11]=n[0]?.title,e[12]=n.length,e[13]=g,e[14]=r):r=e[14];let p;e[15]!==r?(p=t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:r}),e[15]=r,e[16]=p):p=e[16];let m;return e[17]!==c||e[18]!==a||e[19]!==p?(m=t.jsxs("div",{className:c,children:[a,p]}),e[17]=c,e[18]=a,e[19]=p,e[20]=m):m=e[20],m}function fn(s){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:s.title,children:t.jsx(Rt,{icon:s.icon,name:s.title,size:"xs"})},s.id)}function Re(s){const e=G.c(8),{selectionMode:n,children:g}=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 c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(We,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:jn,children:t.jsx(on,{size:20})})}),e[2]=c):c=e[2];let a;e[3]!==g?(a=t.jsxs(Xe,{children:[c,t.jsx(Ge,{align:"end",onClick:xn,children:g})]}),e[3]=g,e[4]=a):a=e[4];let r;return e[5]!==i||e[6]!==a?(r=t.jsx("div",{className:i,children:a}),e[5]=i,e[6]=a,e[7]=r):r=e[7],r}function xn(s){return s.stopPropagation()}function jn(s){return s.stopPropagation()}function Sn(s){const e=G.c(57),{group:n,onOpen:g,selectionMode:o,selectedIds:i,onToggleSelect:c}=s,a=se();let r;if(e[0]!==n.connections||e[1]!==i){let U;e[3]!==i?(U=y=>i.has(y.id),e[3]=i,e[4]=U):U=e[4],r=n.connections.every(U),e[0]=n.connections,e[1]=i,e[2]=r}else r=e[2];const p=r;let m;if(e[5]!==n.connections||e[6]!==i){let U;e[8]!==i?(U=y=>i.has(y.id),e[8]=i,e[9]=U):U=e[9],m=n.connections.some(U),e[5]=n.connections,e[6]=i,e[7]=m}else m=e[7];const u=m;let d;e[10]!==p||e[11]!==n.connections||e[12]!==c||e[13]!==i?(d=()=>{for(const U of n.connections)p?i.has(U.id)&&c(U.id):i.has(U.id)||c(U.id)},e[10]=p,e[11]=n.connections,e[12]=c,e[13]=i,e[14]=d):d=e[14];const h=d,f=n.title,x=n.icon;let j;e[15]!==n.connections.length||e[16]!==a?(j=a("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=a,e[17]=j):j=e[17];let b;e[18]!==n.icon||e[19]!==n.title||e[20]!==j?(b={title:f,icon:x,description:j},e[18]=n.icon,e[19]=n.title,e[20]=j,e[21]=b):b=e[21];let v;e[22]!==g||e[23]!==o||e[24]!==h?(v=()=>o?h():g(),e[22]=g,e[23]=o,e[24]=h,e[25]=v):v=e[25];const S=o&&p&&"ring-2 ring-primary",l=o&&u&&!p&&"ring-1 ring-primary/50";let N;e[26]!==l||e[27]!==S?(N=fe(S,l),e[26]=l,e[27]=S,e[28]=N):N=e[28];const T=o?p?!0:u&&"mixed":void 0;let I;e[29]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(xe,{}),e[29]=I):I=e[29];let A;e[30]!==p||e[31]!==n.connections.length||e[32]!==o||e[33]!==u||e[34]!==a||e[35]!==h?(A=o?t.jsx(Be,{checked:p?!0:u?"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]=p,e[31]=n.connections.length,e[32]=o,e[33]=u,e[34]=a,e[35]=h,e[36]=A):A=e[36];let w;e[37]!==g?(w=U=>{U.stopPropagation(),g()},e[37]=g,e[38]=w):w=e[38];let F;e[39]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(He,{size:16}),e[39]=F):F=e[39];let P;e[40]!==a?(P=a("orgs.connectionSelectionUi.open"),e[40]=a,e[41]=P):P=e[41];let k;e[42]!==w||e[43]!==P?(k=t.jsxs(ce,{onClick:w,children:[F,P]}),e[42]=w,e[43]=P,e[44]=k):k=e[44];let M;e[45]!==o||e[46]!==k?(M=t.jsx(Re,{selectionMode:o,children:k}),e[45]=o,e[46]=k,e[47]=M):M=e[47];let O;e[48]!==A||e[49]!==M?(O=t.jsxs("div",{className:"flex items-center gap-1",children:[A,M]}),e[48]=A,e[49]=M,e[50]=O):O=e[50];let R;return e[51]!==N||e[52]!==T||e[53]!==O||e[54]!==b||e[55]!==v?(R=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:b,onClick:v,className:N,selected:T,fallbackIcon:I,headerActionsAlwaysVisible:!0,headerActions:O})}),e[51]=N,e[52]=T,e[53]=O,e[54]=b,e[55]=v,e[56]=R):R=e[56],R}function yn(s){const e=G.c(36),{connection:n,isSelected:g,selectionMode:o,canManage:i,canManageAgents:c,onToggleSelect:a,onOpen:r,onToggleStatus:p,onDelete:m}=s,u=se();let d;e[0]!==g||e[1]!==a||e[2]!==o||e[3]!==u?(d=o?t.jsx(Be,{checked:g,onCheckedChange:a,onClick:vn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=g,e[1]=a,e[2]=o,e[3]=u,e[4]=d):d=e[4];let h;e[5]!==r?(h=T=>{T.stopPropagation(),r()},e[5]=r,e[6]=h):h=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(He,{size:16}),e[7]=f):f=e[7];let x;e[8]!==u?(x=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=x):x=e[9];let j;e[10]!==h||e[11]!==x?(j=t.jsxs(ce,{onClick:h,children:[f,x]}),e[10]=h,e[11]=x,e[12]=j):j=e[12];let b;e[13]!==i||e[14]!==c||e[15]!==a||e[16]!==u?(b=(i||c)&&t.jsxs(ce,{onClick:T=>{T.stopPropagation(),a()},children:[t.jsx(Wt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=c,e[15]=a,e[16]=u,e[17]=b):b=e[17];let v;e[18]!==i||e[19]!==n||e[20]!==p||e[21]!==u?(v=i&&(n.status==="active"?t.jsxs(ce,{onClick:T=>{T.stopPropagation(),p("inactive")},children:[t.jsx(Xt,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ce,{onClick:T=>{T.stopPropagation(),p("active")},children:[t.jsx(Gt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=p,e[21]=u,e[22]=v):v=e[22];let S;e[23]!==i||e[24]!==m||e[25]!==u?(S=i&&t.jsxs(ce,{variant:"destructive",onClick:T=>{T.stopPropagation(),m()},children:[t.jsx(Ke,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=m,e[25]=u,e[26]=S):S=e[26];let l;e[27]!==o||e[28]!==j||e[29]!==b||e[30]!==v||e[31]!==S?(l=t.jsxs(Re,{selectionMode:o,children:[j,b,v,S]}),e[27]=o,e[28]=j,e[29]=b,e[30]=v,e[31]=S,e[32]=l):l=e[32];let N;return e[33]!==d||e[34]!==l?(N=t.jsxs("div",{className:"flex items-center gap-1",children:[d,l]}),e[33]=d,e[34]=l,e[35]=N):N=e[35],N}function vn(s){return s.stopPropagation()}function Cn(s){const e=G.c(29),{count:n,total:g,canManage:o,canManageAgents:i,onSelectAll:c,onDeselectAll:a,onDelete:r,onAddToAgent:p,onToggleStatus:m,onCancel:u}=s,d=se();if(n===0)return null;let h;e[0]!==n||e[1]!==d?(h=d("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=d,e[2]=h):h=e[2];let f;e[3]!==h?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:h}),e[3]=h,e[4]=f):f=e[4];let x;e[5]!==n||e[6]!==a||e[7]!==c||e[8]!==d||e[9]!==g?(x=n<g?t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:d("orgs.connectionSelectionUi.selectAll",{total:g})}):t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:d("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=a,e[7]=c,e[8]=d,e[9]=g,e[10]=x):x=e[10];let j;e[11]!==i||e[12]!==p||e[13]!==d?(j=i&&t.jsxs(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:p,children:[t.jsx(Le,{size:13}),d("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=p,e[13]=d,e[14]=j):j=e[14];let b;e[15]!==o||e[16]!==r||e[17]!==m||e[18]!==d?(b=o&&t.jsxs(t.Fragment,{children:[t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("active"),children:d("orgs.connectionSelectionUi.enable")}),t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("inactive"),children:d("orgs.connectionSelectionUi.disable")}),t.jsxs(L,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:[t.jsx(Ke,{size:13}),d("orgs.connectionSelectionUi.delete")]})]}),e[15]=o,e[16]=r,e[17]=m,e[18]=d,e[19]=b):b=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Ee,{size:13}),e[20]=v):v=e[20];let S;e[21]!==u?(S=t.jsx(L,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:v}),e[21]=u,e[22]=S):S=e[22];let l;return e[23]!==f||e[24]!==x||e[25]!==j||e[26]!==b||e[27]!==S?(l=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[f,x,j,b,S]})}),e[23]=f,e[24]=x,e[25]=j,e[26]=b,e[27]=S,e[28]=l):l=e[28],l}function bn(s){const e=G.c(47),{open:n,onOpenChange:g,agents:o,onConfirm:i}=s,c=se(),[a,r]=z.useState(null);let p;e[0]!==g?(p=k=>{k||r(null),g(k)},e[0]=g,e[1]=p):p=e[1];const m=p;let u;e[2]!==c?(u=c("orgs.connectionSelectionUi.addToAgentTitle"),e[2]=c,e[3]=u):u=e[3];let d;e[4]!==u?(d=t.jsx(ke,{children:u}),e[4]=u,e[5]=d):d=e[5];let h;e[6]!==c?(h=c("orgs.connectionSelectionUi.addToAgentDescription"),e[6]=c,e[7]=h):h=e[7];let f;e[8]!==h?(f=t.jsx(Te,{children:h}),e[8]=h,e[9]=f):f=e[9];let x;e[10]!==d||e[11]!==f?(x=t.jsxs(we,{children:[d,f]}),e[10]=d,e[11]=f,e[12]=x):x=e[12];let j;e[13]!==o||e[14]!==a||e[15]!==c?(j=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:c("orgs.connectionSelectionUi.noAgentsFound")}):o.map(k=>t.jsxs("button",{type:"button",onClick:()=>r(k.id),className:fe("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",a===k.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(sn,{icon:k.icon,name:k.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:k.title}),k.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.description})]})]},k.id)),e[13]=o,e[14]=a,e[15]=c,e[16]=j):j=e[16];let b;e[17]!==j?(b=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[17]=j,e[18]=b):b=e[18];let v;e[19]!==m?(v=()=>m(!1),e[19]=m,e[20]=v):v=e[20];let S;e[21]!==c?(S=c("orgs.connectionSelectionUi.cancel"),e[21]=c,e[22]=S):S=e[22];let l;e[23]!==S||e[24]!==v?(l=t.jsx(L,{variant:"outline",onClick:v,children:S}),e[23]=S,e[24]=v,e[25]=l):l=e[25];const N=!a;let T;e[26]!==m||e[27]!==i||e[28]!==a?(T=()=>{a&&(i(a),m(!1))},e[26]=m,e[27]=i,e[28]=a,e[29]=T):T=e[29];let I;e[30]!==c?(I=c("orgs.connectionSelectionUi.add"),e[30]=c,e[31]=I):I=e[31];let A;e[32]!==N||e[33]!==T||e[34]!==I?(A=t.jsx(L,{disabled:N,onClick:T,children:I}),e[32]=N,e[33]=T,e[34]=I,e[35]=A):A=e[35];let w;e[36]!==l||e[37]!==A?(w=t.jsxs(Ae,{children:[l,A]}),e[36]=l,e[37]=A,e[38]=w):w=e[38];let F;e[39]!==w||e[40]!==x||e[41]!==b?(F=t.jsxs(Ie,{className:"sm:max-w-[400px]",children:[x,b,w]}),e[39]=w,e[40]=x,e[41]=b,e[42]=F):F=e[42];let P;return e[43]!==m||e[44]!==n||e[45]!==F?(P=t.jsx(Pe,{open:n,onOpenChange:m,children:F}),e[43]=m,e[44]=n,e[45]=F,e[46]=P):P=e[46],P}function _n({listState:s,activeTab:e,typeFilter:n,statusFilter:g}){const o=se(),{org:i}=Me(),c=st(),a=$e(),{data:r}=Fe.useSession(),p=ze(),m=Et(s),u=ft(),{granted:d}=ye("connections:manage"),{granted:h}=ye("agents:manage"),[f,x]=z.useState(new Set),j=f.size>0,[b,v]=z.useState(!1),[S,l]=z.useState(!1),[N,T]=z.useState(null),I=Ht(),A=pn(qt(I)),w=m.filter(_=>!(n!=="ALL"&&_.connection_type!==n||g!=="ALL"&&_.status!==g)),F=pt(w),P=_=>{x(C=>{const B=new Set(C);return B.has(_)?B.delete(_):B.add(_),B})},k=()=>{x(new Set)},M=Ue(s.searchTerm),O=M.items,R=jt(M.loadMore,M.hasMore,M.isLoadingMore),U=new Set(m.filter(_=>_.app_name).map(_=>_.app_name)),y=s.search.length>0,$=e==="all"||y?O.filter(_=>{if(y){const C=Oe(_);if(C&&U.has(C))return!1}return!0}):[],W=e==="connected"||y?F:[],te=async _=>{if(!(!i||!r?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),T(_.id);try{const C=at(_,i.id,r.user.id,{remoteIndex:0}),B=C.connection_type==="STDIO",H=!!C.connection_url,K=B&&C.connection_headers&&typeof C.connection_headers=="object"&&"command"in C.connection_headers;if(!H&&!K){X.error(o("orgs.connections.cannotConnectNoMethod")),T(null);return}const Ce=await p.create.mutateAsync(C),{id:ie}=Ce,le=await nn({connectionId:ie,orgId:i.id,orgSlug:i.slug,persistFallback:re=>p.update.mutateAsync({id:ie,data:{connection_token:re}}).then(()=>{})});if(le.ran&&!le.ok){ne("connection_oauth_failed",{connection_id:ie,flow:"connections_page_connect",error:le.error??"no_token"}),X.error(o("orgs.connections.authenticationFailed",{error:le.error??"no token received"}));return}if(le.ran){ne("connection_oauth_succeeded",{connection_id:ie,flow:"connections_page_connect"});const re=new URL(`/api/${i.slug}/mcp/${ie}`,window.location.origin);await c.invalidateQueries({queryKey:ct.isMCPAuthenticated(re.href,null)}),D(),X.success(o("orgs.connections.authenticationSuccessful"))}let pe=null;try{const re=await c.fetchQuery(Bt({connectionId:ie,orgId:i.id,orgSlug:i.slug}));pe=gn((await re.listTools()).tools)}catch{}const be=ue(Ce),_e=pe?pe.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(pe.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:be}}:null;X.success(o("orgs.connections.connectedSuccessfully"),_e?{action:{label:o("orgs.connections.openConnection"),onClick:()=>a(_e)}}:void 0)}catch(C){X.error(o("orgs.connections.failedToConnect",{error:C instanceof Error?C.message:String(C)}))}finally{T(null)}}},Q=ot(),D=()=>{lt(c,i.id)},E=async()=>{v(!1);const _=[...f];ne("connections_bulk_delete",{count:_.length});const B=(await Promise.allSettled(_.map(H=>Q.call("COLLECTION_CONNECTIONS_DELETE",{id:H,force:!0})))).filter(H=>H.status==="fulfilled").length;D(),X.success(o("orgs.connections.deletedConnections",{count:B})),k()},V=async(_,C)=>{try{await p.update.mutateAsync({id:_,data:{status:C}}),D(),X.success(o(C==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{X.error(o("orgs.connections.failedToUpdateConnection"))}},me=async _=>{const C=[...f];ne("connections_bulk_status_toggled",{count:C.length,to_status:_});const H=(await Promise.allSettled(C.map(K=>p.update.mutateAsync({id:K,data:{status:_}})))).filter(K=>K.status==="fulfilled").length;D(),X.success(_==="active"?o("orgs.connections.enabledConnections",{count:H}):o("orgs.connections.disabledConnections",{count:H})),k()},je=async _=>{const C=I.find(K=>K.id===_);if(!C)return;ne("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const B=new Set(C.connections.map(K=>K.connection_id)),H=[...f].filter(K=>!B.has(K)).map(K=>({connection_id:K,selected_tools:null,selected_resources:null,selected_prompts:null}));if(H.length===0){X.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await Q.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...C.connections,...H]}}),it(c,i.id),X.success(o("orgs.connections.addedConnectionsToAgent",{count:H.length,agentTitle:C.title})),k()}catch{X.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(xt,{...u}),t.jsx(dn,{open:b,onOpenChange:v,count:f.size,onConfirm:E}),t.jsx(bn,{open:S,onOpenChange:l,agents:I,onConfirm:je}),M.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ge,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(y?$.length===0&&w.length===0:e==="all"?$.length===0:w.length===0)?t.jsx(ht,{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(d?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[W.map(_=>{if(_.type==="group")return t.jsx(Sn,{group:_,onOpen:()=>{a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:_.key}})},selectionMode:j,selectedIds:f,onToggleSelect:P},_.key);const C=_.connection,B=f.has(C.id);return t.jsx(ve,{connection:C,fallbackIcon:t.jsx(xe,{}),onClick:()=>j?P(C.id):a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ue(C)}}),className:fe(B&&"ring-2 ring-primary bg-primary/5"),selected:j?B:void 0,footer:t.jsx(hn,{projects:A.get(C.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(yn,{connection:C,isSelected:B,selectionMode:j,canManage:d,canManageAgents:h,onToggleSelect:()=>P(C.id),onOpen:()=>a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ue(C)}}),onToggleStatus:H=>V(C.id,H),onDelete:()=>u.requestDelete(C)})},C.id)}),$.map(_=>t.jsx(un,{item:_,canManage:d,allConnections:m,connectedAppNames:U,connectingItemId:N,onNavigateConnected:C=>a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ue(C)}}),onConnect:te},_.id)),(e==="all"||y)&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||y)&&M.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ge,{className:"size-6 text-muted-foreground"})})]})}),j&&t.jsx(Cn,{count:f.size,total:w.length,canManage:d,canManageAgents:h,onSelectAll:()=>{x(new Set(w.map(_=>_.id)))},onDeselectAll:()=>x(new Set),onDelete:()=>v(!0),onAddToAgent:()=>l(!0),onToggleStatus:me,onCancel:k})]})}function Nn(){const s=se(),{org:e}=Me(),n=$e(),g=qe({strict:!1}),{data:o}=Fe.useSession(),{stdioEnabled:i}=Je(),c=Ve(),{granted:a}=ye("connections:manage"),r=an({namespace:e.slug,resource:"connections"}),p=ze(),m=Ye(),[u,d]=Ze(et.connectionsTab(e.slug),y=>g.tab==="all"||g.tab==="connected"?g.tab:y??"all"),[h,f]=z.useState("ALL"),[x,j]=z.useState("ALL"),v=Ue(r.searchTerm).items,S=r.search!==r.searchTerm,l=tt({resolver:nt(Jt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),N=l.watch("ui_type"),T=l.watch("connection_url"),I=l.watch("npx_package"),A=he({uiType:N,connectionUrl:T??"",npxPackage:I??""})??De({uiType:N,connectionUrl:T??"",registryItems:v}),w=a&&g.action==="create",F=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),n({to:".",search:y=>({...y,action:"create"})})},P=()=>{n({to:".",search:y=>({...y,action:void 0})})},k=async y=>{let $,W=null,te=null,Q=null;y.ui_type==="NPX"?($="STDIO",W="",Q=en(y.npx_package||"",y.env_vars||[])):y.ui_type==="STDIO"?($="STDIO",W="",Q=tn(y.stdio_command||"",y.stdio_args||"",y.stdio_cwd,y.env_vars||[])):($=y.ui_type,W=y.connection_url||"",te=y.connection_token||null);const D=rt("conn");ne("connection_custom_created",{connection_type:$,ui_type:y.ui_type}),await p.create.mutateAsync({id:D,title:y.title,description:y.description||null,connection_type:$,connection_url:W,connection_token:te,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:e.id,icon:y.icon??null,app_name:null,app_id:null,connection_headers:Q,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null}),P(),l.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ue({app_name:null,connection_url:W,title:y.title,id:D})}})},M=y=>{y||(w&&P(),l.reset())},O=y=>{const $=y.trim();if(!$)return;const W=!!l.formState.dirtyFields.title,te=!!l.formState.dirtyFields.description,Q=!!l.formState.dirtyFields.env_vars,D=V=>{if(V&&(!W&&!l.getValues("title").trim()&&V.title&&l.setValue("title",V.title,{shouldDirty:!1}),!te&&!(l.getValues("description")??"").trim()&&V.description&&l.setValue("description",V.description,{shouldDirty:!1}),!Q&&V.envVarKeys?.length)){const me=l.getValues("env_vars")??[],je=new Set(me.map(C=>C.key)),_=V.envVarKeys.filter(C=>!je.has(C));_.length>0&&l.setValue("env_vars",[...me,..._.map(C=>({key:C,value:""}))],{shouldDirty:!0})}},E=Zt($);if(E&&i){l.setValue("ui_type","NPX",{shouldDirty:!0}),l.setValue("npx_package",E.packageName,{shouldDirty:!0}),l.setValue("connection_url","",{shouldDirty:!0}),l.setValue("connection_token",null,{shouldDirty:!0}),D(he({uiType:"NPX",npxPackage:E.packageName}));return}if($.startsWith("http://")||$.startsWith("https://")){const V=N==="HTTP"||N==="SSE"||N==="Websocket"?N:"HTTP";l.setValue("ui_type",V,{shouldDirty:!0}),l.setValue("connection_url",$,{shouldDirty:!0}),D(he({uiType:V,connectionUrl:$})??De({uiType:V,connectionUrl:$,registryItems:v}));return}N==="NPX"&&D(he({uiType:"NPX",npxPackage:$}))},R=a?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(L,{size:"sm",variant:"default",onClick:F,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:s("orgs.connections.customConnection")})]})}):null,U=t.jsx(dt,{sortKey:r.sortKey,sortDirection:r.sortDirection,onSort:r.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:h,onChange:y=>f(y||"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:x,onChange:y=>j(y||"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")}]}]});return t.jsx(t.Fragment,{children:t.jsxs(ae,{children:[(()=>{const y=s("orgs.connections.createConnection"),$=s("orgs.connections.createConnectionDescription"),W=l.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),te=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(q,{control:l.control,name:"ui_type",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.type")}),t.jsxs(Ot,{value:D.value,onValueChange:D.onChange,children:[t.jsx(Z,{children:t.jsx(Ut,{children:t.jsx(Vt,{})})}),t.jsxs(zt,{children:[t.jsx(de,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(de,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(de,{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(de,{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(de,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Qt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(ee,{})]})}),N==="NPX"&&t.jsx(q,{control:l.control,name:"npx_package",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.npmPackage")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...D,value:D.value??"",onPaste:E=>{const V=E.clipboardData.getData("text");V&&(E.preventDefault(),l.setValue("npx_package",V.trim(),{shouldDirty:!0}),O(V))},onBlur:E=>{O(E.target.value),D.onBlur()}})}),t.jsx(ee,{})]})}),N==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(q,{control:l.control,name:"stdio_command",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.command")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.commandPlaceholder"),...D,value:D.value??""})}),t.jsx(ee,{})]})}),t.jsx(q,{control:l.control,name:"stdio_args",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.arguments")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.argumentsPlaceholder"),...D,value:D.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(q,{control:l.control,name:"stdio_cwd",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.workingDirectory")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...D,value:D.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(ee,{})]})})]}),(N==="NPX"||N==="STDIO")&&t.jsx(q,{control:l.control,name:"env_vars",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.environmentVariables")}),t.jsx(Z,{children:t.jsx(Yt,{value:D.value??[],onChange:D.onChange})}),t.jsx(ee,{})]})}),N!=="NPX"&&N!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(q,{control:l.control,name:"connection_url",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.url")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.urlPlaceholder"),...D,value:D.value??"",onPaste:E=>{const V=E.clipboardData.getData("text");V&&(E.preventDefault(),l.setValue("connection_url",V.trim(),{shouldDirty:!0}),O(V))},onBlur:E=>{O(E.target.value),D.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(q,{control:l.control,name:"connection_token",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:A?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(Z,{children:t.jsx(oe,{type:"password",placeholder:A?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...D,value:D.value??""})}),A?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.token.helperText,A.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(ee,{})]})})]}),t.jsx(q,{control:l.control,name:"title",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.name")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.namePlaceholder"),...D})}),t.jsx(ee,{})]})}),t.jsx(q,{control:l.control,name:"description",render:({field:D})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.description")}),t.jsx(Z,{children:t.jsx(Lt,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...D,value:D.value??""})}),t.jsx(ee,{})]})})]}),Q=w;return c?t.jsx(wt,{open:Q,onOpenChange:M,children:t.jsxs(At,{className:"max-h-[90vh]",children:[t.jsx(It,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Pt,{children:y}),t.jsx(Mt,{className:"mt-1",children:$})]}),t.jsx($t,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(Ne,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(k),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:te}),t.jsx(Ft,{children:t.jsx(L,{type:"submit",disabled:l.formState.isSubmitting,className:"w-full",children:W})})]})})]})}):t.jsx(Pe,{open:Q,onOpenChange:M,children:t.jsxs(Ie,{className:"sm:max-w-[525px]",children:[t.jsxs(we,{children:[t.jsx(ke,{children:y}),t.jsx(Te,{children:$})]}),t.jsx(Ne,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(k),children:[t.jsx("div",{className:"py-4",children:te}),t.jsxs(Ae,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>M(!1),children:s("orgs.connections.cancel")}),t.jsx(L,{type:"submit",disabled:l.formState.isSubmitting,className:"min-w-40",children:W})]})]})})]})})})(),t.jsx(ae.Content,{children:t.jsx(ae.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[m?t.jsx(ae.Actions,{secondary:t.jsxs(t.Fragment,{children:[t.jsx(gt,{value:r.search,onChange:r.setSearch,label:s("library.context.search"),placeholder:s("orgs.connections.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),U]}),children:R}):t.jsx(ae.Title,{actions:R,children:s("orgs.connections.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 empty:hidden",children:!m&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ut,{value:r.search,onChange:r.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:y=>{y.key==="Escape"&&(r.setSearch(""),y.target.blur())}}),U]})}),t.jsx(mt,{placement:"page",tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:u,onTabChange:y=>{const $=y;$!==u&&ne("connections_page_tab_changed",{to_tab:$}),d($)}}),t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ge,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:S?.5:1,transition:S?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:S?"none":"auto"},children:t.jsx(_n,{listState:r,activeTab:u,typeFilter:h,statusFilter:x})})})]})})})]})})}function Ws(){const s=G.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",children:t.jsx(ge,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Nn,{})})}),s[0]=e):e=s[0],e}export{Ws as default};
|