decocms 4.447.1 → 4.449.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Dsxcywwk.js → AlertCircle-Bx6Xy-Kw.js} +1 -1
- package/dist/client/assets/{AreaChart-BzkZYIYf.js → AreaChart-DQ7VB4Rk.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CUAoXnBl.js → ArrowLeft-BBlLaPEb.js} +1 -1
- package/dist/client/assets/{ArrowUp-DvEWAQS1.js → ArrowUp-Dr4dZUTV.js} +1 -1
- package/dist/client/assets/{Building02-DQSa0aPk.js → Building02-qqUg_lk7.js} +1 -1
- package/dist/client/assets/{CartesianChart-C_rbOUc_.js → CartesianChart-2IJlIK54.js} +1 -1
- package/dist/client/assets/{Check-CzhgdtoZ.js → Check-BhHmW1CL.js} +1 -1
- package/dist/client/assets/{CheckCircle-48zzWb5o.js → CheckCircle-DQ_Iwx7G.js} +1 -1
- package/dist/client/assets/{ChevronUp-bPHHer4a.js → ChevronUp-C6nGgzcV.js} +1 -1
- package/dist/client/assets/{Copy01-DK-rveWk.js → Copy01-1J_cPh43.js} +1 -1
- package/dist/client/assets/{CreditCard01-Bv4apDUd.js → CreditCard01-CZJLSW5h.js} +1 -1
- package/dist/client/assets/{DotsVertical-Cz9DnVkj.js → DotsVertical-DMzCTdNT.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-CAdF3KX1.js → ErrorBarContext-BsMO1nqd.js} +1 -1
- package/dist/client/assets/{Image01-DkSAzjSu.js → Image01-VqGHD62D.js} +1 -1
- package/dist/client/assets/{Key01-2_VP-ymA.js → Key01-3kquwPFB.js} +1 -1
- package/dist/client/assets/{Line-BEPKdvRr.js → Line-C3wcRFDr.js} +1 -1
- package/dist/client/assets/{Link01-CBIFqZsw.js → Link01-ZJZ8YMCs.js} +1 -1
- package/dist/client/assets/{LinkBroken01-CyPIuvAF.js → LinkBroken01-DLTNdGdq.js} +1 -1
- package/dist/client/assets/{LinkExternal01-D20IL3CN.js → LinkExternal01-ByTglQMD.js} +1 -1
- package/dist/client/assets/{Monitor01-WwJ1rHPk.js → Monitor01-CjCwBipo.js} +1 -1
- package/dist/client/assets/{Palette-jHJa2pFE.js → Palette-DItfN1RT.js} +1 -1
- package/dist/client/assets/{Plus-BvxsRY-0.js → Plus-jU4D0ULX.js} +1 -1
- package/dist/client/assets/{SearchMd-CHmk5GD6.js → SearchMd-yUpDH67q.js} +1 -1
- package/dist/client/assets/{Sector-BZGQzXCu.js → Sector-DADH10bp.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-D0N-Vb4c.js → ShoppingBag01-BnqPHk8-.js} +1 -1
- package/dist/client/assets/{Sun-7ajd25ZV.js → Sun-G5YUTpKk.js} +1 -1
- package/dist/client/assets/{Tool01-DetpIMtk.js → Tool01-DQZj0rVc.js} +1 -1
- package/dist/client/assets/{Trash01-DKbCrUTj.js → Trash01-CfWaytgc.js} +1 -1
- package/dist/client/assets/{Upload01-BBKhvCnt.js → Upload01-ca0GgR0P.js} +1 -1
- package/dist/client/assets/{User01-D2Lmw0ef.js → User01-BJgSr0na.js} +1 -1
- package/dist/client/assets/{UserSquare-CuUPyuma.js → UserSquare-DubBIV3t.js} +1 -1
- package/dist/client/assets/{Users01-DsJzDkrr.js → Users01-BI4qzwEi.js} +1 -1
- package/dist/client/assets/{X-ateu7dRb.js → X-4SjHAUB6.js} +1 -1
- package/dist/client/assets/{XAxis-o5Dc22O9.js → XAxis-6QdhlFSd.js} +1 -1
- package/dist/client/assets/{XClose-Chbrrnow.js → XClose-B5gtMDn3.js} +1 -1
- package/dist/client/assets/{ZoomOut-Bt3p5CRf.js → ZoomOut-o5Bj_0k0.js} +1 -1
- package/dist/client/assets/{access-gate-Uqlikjgu.js → access-gate-CVOkVcAR.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-B0L-P2sh.js → add-connection-dialog-C9teNzj3.js} +1 -1
- package/dist/client/assets/{agent-analytics-BFb91OPU.js → agent-analytics-pnZ5kkw4.js} +1 -1
- package/dist/client/assets/agent-app-Bmq8mE4b.js +1 -0
- package/dist/client/assets/{agent-assets-CLxww7C0.js → agent-assets-CkTPoTPt.js} +1 -1
- package/dist/client/assets/{agent-automation-CIS8quGB.js → agent-automation-IkGTi12K.js} +3 -3
- package/dist/client/assets/agent-automations-CeOlf6kC.js +1 -0
- package/dist/client/assets/{agent-connect-sources-BwAWjblO.js → agent-connect-sources-CE8WWO21.js} +1 -1
- package/dist/client/assets/agent-deck-ChJEzNvh.js +1 -0
- package/dist/client/assets/{agent-e2e-BaIs1jb9.js → agent-e2e-CqzK8bNw.js} +1 -1
- package/dist/client/assets/{agent-experiments-1jqEeSlQ.js → agent-experiments-y5AB7gNs.js} +1 -1
- package/dist/client/assets/{agent-file-53hFn7yw.js → agent-file-CaQOAUU8.js} +1 -1
- package/dist/client/assets/{agent-git-CTTGxwmS.js → agent-git-B3hEpRLE.js} +1 -1
- package/dist/client/assets/{agent-hosting--ETESSTx.js → agent-hosting-k179Ejew.js} +1 -1
- package/dist/client/assets/{agent-icon-BRxvZRmN.js → agent-icon-Plx0vVQZ.js} +1 -1
- package/dist/client/assets/agent-library-DCzTnvza.js +1 -0
- package/dist/client/assets/agent-library-file-DtqKvoz2.js +1 -0
- package/dist/client/assets/{agent-monitor-BILhL5_y.js → agent-monitor-_UheQa-B.js} +1 -1
- package/dist/client/assets/{agent-overview-DZ3BLKKZ.js → agent-overview-bLRGU593.js} +1 -1
- package/dist/client/assets/agent-settings-BFm3cinJ.js +1 -0
- package/dist/client/assets/{agent-site-editor-BL5gelUr.js → agent-site-editor-DVenLdmy.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-Bux6lvrY.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-BopCmF1V.js → agent-site-editor-content-GMuyS7LS.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-CvTzIzXq.js → agent-site-editor-preview-fQwmql9B.js} +3 -3
- package/dist/client/assets/agent-view-CLwrYt4k.js +1 -0
- package/dist/client/assets/{agent-view-guard-C9ItTzPi.js → agent-view-guard-BwrmGLlw.js} +1 -1
- package/dist/client/assets/{agents-list-COSLVvDS.js → agents-list-C3sXvejj.js} +1 -1
- package/dist/client/assets/{ai-providers-BCvug74N.js → ai-providers-CedLyqka.js} +1 -1
- package/dist/client/assets/{alert-DsodQpgY.js → alert-FpVcsSTC.js} +1 -1
- package/dist/client/assets/{alert-dialog-Dr37XaeA.js → alert-dialog-CRVM-23V.js} +1 -1
- package/dist/client/assets/{analytics-sections-DbtkycCZ.js → analytics-sections-rbnTnuvD.js} +1 -1
- package/dist/client/assets/api-keys-41OcNRfF.js +1 -0
- package/dist/client/assets/{api-keys-DAccLTlD.js → api-keys-COeksGyn.js} +1 -1
- package/dist/client/assets/app-editor-C0HEp9TR.js +1 -0
- package/dist/client/assets/{asset-utils-CEMW7jjJ.js → asset-utils-BZ8WEgo_.js} +1 -1
- package/dist/client/assets/{auth-qAvZ1LNt.js → auth-BhL4Ae7M.js} +1 -1
- package/dist/client/assets/{auth-catchall--nnHYbyR.js → auth-catchall-CwYBELfP.js} +1 -1
- package/dist/client/assets/{auth-entry-Dc4OnWLn.js → auth-entry-AWWhawM-.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Co7x06Lg.js → auth-split-layout-DKZlsvJh.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Bm9fWsOa.js → authenticate-and-persist-oauth-CM_sd9mo.js} +1 -1
- package/dist/client/assets/{automation-list-row-CqDXRJhE.js → automation-list-row-BaZJos7Z.js} +1 -1
- package/dist/client/assets/{automation-runs-bvqul2ks.js → automation-runs-D8nbfNRi.js} +1 -1
- package/dist/client/assets/{automations-Jd1l1G4G.js → automations-CSz4StRo.js} +1 -1
- package/dist/client/assets/{autosend-BrczLssG.js → autosend-CtvAncuN.js} +1 -1
- package/dist/client/assets/{avatar-Be2YP03d.js → avatar-ZtrZA-xC.js} +1 -1
- package/dist/client/assets/{badge-BbkeIMgp.js → badge-B0eiYJhc.js} +1 -1
- package/dist/client/assets/{block-document-Df24gcAz.js → block-document-BceCRczU.js} +3 -3
- package/dist/client/assets/{blocks-preview-workspace-context-CeDfLC0U.js → blocks-preview-workspace-context-CHwgOgkC.js} +1 -1
- package/dist/client/assets/blog-schema-CswZLK88.js +1 -0
- package/dist/client/assets/{buckets-9WzbA5Lg.js → buckets-Gs1fVclo.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-Cp9ERAt-.js → build-improve-prompt-doc-Cb05TlMk.js} +1 -1
- package/dist/client/assets/{calendar-B6jARNSc.js → calendar-Cwshzk8E.js} +1 -1
- package/dist/client/assets/{capability-load-error-DPnEcJx5.js → capability-load-error-CV82KOmw.js} +1 -1
- package/dist/client/assets/category-editor-BVh5TSwx.js +1 -0
- package/dist/client/assets/{chart-DQLuV_FI.js → chart-DQHWQ1kS.js} +1 -1
- package/dist/client/assets/{chat-context-Bf1EEUa_.js → chat-context-CW-2SJ9g.js} +1 -1
- package/dist/client/assets/{chat-draft-D0DwqSRP.js → chat-draft-CwKaZkWY.js} +1 -1
- package/dist/client/assets/{checkbox-GjKetutN.js → checkbox-Cs5VXlL7.js} +1 -1
- package/dist/client/assets/{choose-editor-CCuyU2RH.js → choose-editor-DYyB77HH.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-qcCOlkIz.js → claim-phase-copy-CLVpoo-M.js} +1 -1
- package/dist/client/assets/{cli-auth-success-B9a1R8wa.js → cli-auth-success-QlGAkecU.js} +1 -1
- package/dist/client/assets/{client-icons-C4EJJI6g.js → client-icons-B_Vdp-aH.js} +1 -1
- package/dist/client/assets/{collapsible-C3DyD3IY.js → collapsible-taXF9Vin.js} +1 -1
- package/dist/client/assets/{collection-detail-4z7JbQw1.js → collection-detail-Dj6LHA84.js} +1 -1
- package/dist/client/assets/{collection-display-button-C0cLpFRb.js → collection-display-button-oMAXeg11.js} +1 -1
- package/dist/client/assets/{collection-search-qakQR89K.js → collection-search-De8chpSh.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-4oDVKFGl.js → collection-table-wrapper-yQxCbZDl.js} +1 -1
- package/dist/client/assets/{collection-tabs-CJy8rHXV.js → collection-tabs-2Nn5b0UJ.js} +1 -1
- package/dist/client/assets/{column-rules-DMmszLDK.js → column-rules-NVsxdRkm.js} +1 -1
- package/dist/client/assets/{combobox-CKdv5r-2.js → combobox-uWP-A1cr.js} +1 -1
- package/dist/client/assets/{command-CNDsxgwl.js → command-Dj5wxXJe.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-bUkIE-gG.js → companion-mcps-section-DGa0mzqM.js} +1 -1
- package/dist/client/assets/{config-BFtdxgOC.js → config-CNoTk6kM.js} +1 -1
- package/dist/client/assets/{connect-C_Bx49BR.js → connect-CnaN_058.js} +1 -1
- package/dist/client/assets/{connect-layout-clJE61fN.js → connect-layout-1nOF0djv.js} +1 -1
- package/dist/client/assets/{connection-KyEHQxp9.js → connection-DCZz5J1M.js} +1 -1
- package/dist/client/assets/{connection-card-XVRQmb88.js → connection-card-DaZTNpcS.js} +1 -1
- package/dist/client/assets/{connection-detail-qTgpDNX7.js → connection-detail-BZEZF1y2.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Bz949-9G.js → connection-form-helpers-Dyc97_iQ.js} +1 -1
- package/dist/client/assets/{connections-R5S4BIDs.js → connections-DwyQu0E5.js} +1 -1
- package/dist/client/assets/context-Hy9lD2FY.js +1 -0
- package/dist/client/assets/{context-menu-BElFzhuX.js → context-menu-D4sB9rRV.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DKdoNuXz.js → create-organization-dialog-BPk6MpO6.js} +1 -1
- package/dist/client/assets/daily-pulse-jC7QtChD.js +1 -0
- package/dist/client/assets/{decopilot-D0L_iZDN.js → decopilot-CcCmg-UE.js} +1 -1
- package/dist/client/assets/{device-hint-BHJC54cI.js → device-hint-DFIHePB4.js} +1 -1
- package/dist/client/assets/{dialog-CSMrPqBB.js → dialog-DUkVOZIE.js} +1 -1
- package/dist/client/assets/{discover-DDLMC3cx.js → discover-PHqRmlAb.js} +1 -1
- package/dist/client/assets/{domain-settings-Cr2aZAf_.js → domain-settings-DC07Bwzh.js} +1 -1
- package/dist/client/assets/{download-app-dialog-DegRrl-D.js → download-app-dialog-VBK5SfsW.js} +1 -1
- package/dist/client/assets/{drawer-DamNEeFr.js → drawer-BE8-rjnv.js} +1 -1
- package/dist/client/assets/{editor-D-2XKeKJ.js → editor-Bicb4Bqw.js} +1 -1
- package/dist/client/assets/{empty-state-DfF0wZnW.js → empty-state-CGgBiEoz.js} +1 -1
- package/dist/client/assets/{empty-state-e8q1K35w.js → empty-state-Lw6BWO66.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Yv51Ip2F.js → extract-connection-data-BqvnWkg5.js} +1 -1
- package/dist/client/assets/{feature-gate-Dj2ZsmzR.js → feature-gate-BIe5gsHR.js} +1 -1
- package/dist/client/assets/{feature-paywall-DK7jIYwT.js → feature-paywall-DGxl3PI8.js} +1 -1
- package/dist/client/assets/{file-explorer-CfxW2_sL.js → file-explorer-DuE7CaLg.js} +1 -1
- package/dist/client/assets/{file-preview-ODrawZXt.js → file-preview-DwqtznxG.js} +1 -1
- package/dist/client/assets/{file-share-button-DT9bUw3x.js → file-share-button-CGad6pvg.js} +2 -2
- package/dist/client/assets/{file-type-icon-Bv7OJA49.js → file-type-icon-CideAigq.js} +1 -1
- package/dist/client/assets/flat-project-BXD7xaS4.js +1 -0
- package/dist/client/assets/{folder-icon-DGqv3QUB.js → folder-icon-C5v3kOW1.js} +1 -1
- package/dist/client/assets/{form-BJXkrxaF.js → form-esFIz8cn.js} +1 -1
- package/dist/client/assets/{gateway-client-9xfivYUp.js → gateway-client-DdEB-W_0.js} +1 -1
- package/dist/client/assets/{general-BP_QzpXy.js → general-C9QQwa7q.js} +1 -1
- package/dist/client/assets/home-DHdEzmGE.js +1 -0
- package/dist/client/assets/{icon-button-C4oA9vAv.js → icon-button-BpPbhU8u.js} +1 -1
- package/dist/client/assets/{index-DbabGxy6.js → index-B1zctMWM.js} +6 -6
- package/dist/client/assets/{index-rVMtfSUP.js → index-BP-g_hO2.js} +9 -9
- package/dist/client/assets/{index-CTYuweYZ.js → index-BtEM8a9F.js} +1 -1
- package/dist/client/assets/{index-CXm3YShm.js → index-CFflVJHI.js} +1 -1
- package/dist/client/assets/{index-Bj6rDen7.js → index-CKkIU_55.js} +1 -1
- package/dist/client/assets/{index-DNU42V4k.js → index-CazcJ_7a.js} +1 -1
- package/dist/client/assets/{index-Dy0RWBgm.js → index-Cbn4vfz_.js} +1 -1
- package/dist/client/assets/{index-C46RwiKZ.js → index-CfCqm3c8.js} +1 -1
- package/dist/client/assets/{index-CDt6WI9m.js → index-DCuYoDHT.js} +1 -1
- package/dist/client/assets/{index-Il2w9u7T.js → index-DD7q2zTd.js} +1 -1
- package/dist/client/assets/{index-CecxwC7F.js → index-De_dnJRN.js} +1 -1
- package/dist/client/assets/{index-DbpjHDZh.js → index-_Pfw1M40.js} +1 -1
- package/dist/client/assets/{index-CEGt2PRu.js → index-km7ID5lM.js} +1 -1
- package/dist/client/assets/{index-DK0Dq4zJ.js → index-pCZVwBrG.js} +1 -1
- package/dist/client/assets/{index-redirect-CsG08aDH.js → index-redirect-DJCpFh35.js} +1 -1
- package/dist/client/assets/{index-4hz_47mP.js → index-wBJ7lMpR.js} +5 -5
- package/dist/client/assets/{infiniteQueryObserver-yDX2PlMf.js → infiniteQueryObserver-BBgKyTli.js} +1 -1
- package/dist/client/assets/{infra-billing-CsnOWCZW.js → infra-billing-CT-SKwYV.js} +1 -1
- package/dist/client/assets/{input-DV9TXIhc.js → input-B3HVl7By.js} +1 -1
- package/dist/client/assets/{input-fdBI3UiD.js → input-D1BEXHTl.js} +1 -1
- package/dist/client/assets/{input-DGumA8Me.js → input-DsxQztmQ.js} +7 -7
- package/dist/client/assets/{integration-icon-CFV7KR9Q.js → integration-icon-B97YfXXZ.js} +1 -1
- package/dist/client/assets/{label-CaVwbUwP.js → label-Be_7Vms5.js} +1 -1
- package/dist/client/assets/{layout-Cn4gYBB0.js → layout-HR14oaFC.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CImQMpuD.js → legacy-agents-deep-Cg0ho0FK.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-pPc22tCf.js → legacy-main-redirect-B_6vW12N.js} +1 -1
- package/dist/client/assets/library-BbAPgXkD.js +1 -0
- package/dist/client/assets/{library-tab-DzLJVAy7.js → library-tab-tJXLlybm.js} +1 -1
- package/dist/client/assets/{login-9E08_289.js → login-DaVQiw7H.js} +1 -1
- package/dist/client/assets/{markdown-BFRBcVyc.js → markdown-BSYuVrvS.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-2vEnBSMK.js → mcp-app-renderer-BuJCA9WL.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DPBTzzM-.js → mcp-oauth-Dt9pIBq5.js} +1 -1
- package/dist/client/assets/{members-4taneDvj.js → members-CHSwnC7s.js} +1 -1
- package/dist/client/assets/{memory-ihVMY_AG.js → memory-y99QmzFe.js} +1 -1
- package/dist/client/assets/{message-templates-DZjeVSbL.js → message-templates-xF6Z-DZJ.js} +1 -1
- package/dist/client/assets/{mini-report-page-DtLYvRQ1.js → mini-report-page-CFRqMuFT.js} +1 -1
- package/dist/client/assets/{mock-board-CwpnFESF.js → mock-board-BD3qTGYo.js} +1 -1
- package/dist/client/assets/{monaco-editor-CTBaCfme.js → monaco-editor-BXK3f-Og.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BkHIbumL.js → monitoring-stats-row-IHl-mX1g.js} +1 -1
- package/dist/client/assets/{multi-select-Z8b5GDV-.js → multi-select-DGgRKpc4.js} +1 -1
- package/dist/client/assets/{mustache-B8Ea1V5C.js → mustache-Cgurdydm.js} +1 -1
- package/dist/client/assets/{new-project-dialog-B-Knb9QQ.js → new-project-dialog-BMehfxLv.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-aQAEhewW.js → oauth-callback-ai-provider-k4dNzBd0.js} +1 -1
- package/dist/client/assets/{oauth-callback-C8PRuTdi.js → oauth-callback-pqa-Hyt-.js} +1 -1
- package/dist/client/assets/{onboarding-CQwAJGam.js → onboarding-Dp8GO7az.js} +1 -1
- package/dist/client/assets/{openai-conversation-BieePbjd.js → openai-conversation-oneJt9QR.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-BjQNVvvG.js → optimistic-project-sidebar-views-DDETX0mx.js} +1 -1
- package/dist/client/assets/{org-file-open-context-DOjVu33M.js → org-file-open-context-2kSVNzGe.js} +1 -1
- package/dist/client/assets/{organization-choice-DGHtNB__.js → organization-choice-Di3lf1DM.js} +1 -1
- package/dist/client/assets/{orgs-CrnZIBKQ.js → orgs-BXBqBecG.js} +1 -1
- package/dist/client/assets/{page-seo-form-Cz3um724.js → page-seo-form-B-vBxb4j.js} +1 -1
- package/dist/client/assets/{pair-28ek-gGQ.js → pair-bDKRTMqu.js} +7 -7
- package/dist/client/assets/{plan-ladder-CyI_9DNH.js → plan-ladder-CfA0FpAL.js} +1 -1
- package/dist/client/assets/{popover-DpWUGKUo.js → popover-DwQza7Ap.js} +1 -1
- package/dist/client/assets/{post-calendar-DeYBTRsx.js → post-calendar-CM-j2TVF.js} +1 -1
- package/dist/client/assets/post-editor-DzeGxIPl.js +2 -0
- package/dist/client/assets/{preview-content-CnVo4-8-.js → preview-content-b2Kfd0ih.js} +1 -1
- package/dist/client/assets/{preview-dialog-DIfOL8lf.js → preview-dialog-7_zN433M.js} +1 -1
- package/dist/client/assets/{profile-BHIo5II1.js → profile-DH3xvW4M.js} +1 -1
- package/dist/client/assets/{project-app-view-DSWQ2xlW.js → project-app-view-8XHhP-21.js} +1 -1
- package/dist/client/assets/{project-feed-BuwrAz5D.js → project-feed-C4R5QRpx.js} +1 -1
- package/dist/client/assets/{project-icon-B2QkPtkD.js → project-icon-0knrxIOw.js} +1 -1
- package/dist/client/assets/project-reports-BrIp72jF.js +1 -0
- package/dist/client/assets/project-tasks-DV-ii699.js +1 -0
- package/dist/client/assets/{projects-CeBBjzLS.js → projects-ZExDUw0W.js} +1 -1
- package/dist/client/assets/{projects-empty-state-DqQWmR8c.js → projects-empty-state-BSpE0Riy.js} +1 -1
- package/dist/client/assets/{prompts-DMHqwjaa.js → prompts-BLBkOl8v.js} +1 -1
- package/dist/client/assets/record-editor-ziqyGjSB.js +1 -0
- package/dist/client/assets/{redirect-editor-VS53IAor.js → redirect-editor-BVFm9u4z.js} +1 -1
- package/dist/client/assets/reports-3EyuS8J8.js +1 -0
- package/dist/client/assets/{reports-CRnJns1V.js → reports-DSK9pInf.js} +1 -1
- package/dist/client/assets/{reports-onboarding-iY5NlXnv.js → reports-onboarding-BGpMVdJb.js} +1 -1
- package/dist/client/assets/{reports-tab-CjdgNBIh.js → reports-tab-DOaYQIgv.js} +2 -2
- package/dist/client/assets/{repositories-By85nJ-O.js → repositories-9mNfLfC6.js} +1 -1
- package/dist/client/assets/{repository-binding-DST5BjAq.js → repository-binding-DB3Rsfan.js} +1 -1
- package/dist/client/assets/{repository-import-picker-Cefyzn5z.js → repository-import-picker-DyQqkMVo.js} +1 -1
- package/dist/client/assets/{repository-picker-DIYtkoGR.js → repository-picker-BhN42NYE.js} +1 -1
- package/dist/client/assets/{require-capability-Cgz4k3Fi.js → require-capability-T865QzND.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Sm_LEIrf.js → required-auth-layout-BhtMSUK8.js} +1 -1
- package/dist/client/assets/{reset-password-BwpS-xL5.js → reset-password-DknJZEoY.js} +1 -1
- package/dist/client/assets/{resizable-Dd8Oiyrn.js → resizable-Cl5uhslg.js} +1 -1
- package/dist/client/assets/resolve-tab-icon-BJxTAEQQ.js +1 -0
- package/dist/client/assets/{review-settings-3T-TH-W9.js → review-settings-CMvo0pRC.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-CO6qXsgG.js → rich-text-link-control-CzOQrdNt.js} +1 -1
- package/dist/client/assets/{roles-BxZ_96io.js → roles-Bvw2DL9o.js} +1 -1
- package/dist/client/assets/route-BRK2g0Ok.js +1 -0
- package/dist/client/assets/{route-BWoA72Ha.js → route-BqhdkgCD.js} +1 -1
- package/dist/client/assets/{route-MgE6XCPe.js → route-Dq4tC8Qc.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-0DsB0lC3.js → runnable-block-editor-CU4DL_Np.js} +4 -4
- package/dist/client/assets/{sandbox-lifecycle-context-ZoWZCIt3.js → sandbox-lifecycle-context-CCWi8UrE.js} +1 -1
- package/dist/client/assets/{schema-BD3Ue3jK.js → schema-CtVpxfN8.js} +1 -1
- package/dist/client/assets/{scroll-area-C1UEqWPg.js → scroll-area-DTVFcTe4.js} +1 -1
- package/dist/client/assets/{search-input-uE9X4-9v.js → search-input-B7esxZLr.js} +1 -1
- package/dist/client/assets/{search-toggle-BgK-oFXG.js → search-toggle-BmdAS9S4.js} +1 -1
- package/dist/client/assets/{secret-picker-DpiORdM4.js → secret-picker-BV1iDD76.js} +1 -1
- package/dist/client/assets/{secrets-CG0o7p-Z.js → secrets-D9_ygYCx.js} +1 -1
- package/dist/client/assets/{sections-editor-mB_t7BGu.js → sections-editor-BOruSM_E.js} +1 -1
- package/dist/client/assets/{select-DOq28vkW.js → select-CCPnfgQ9.js} +1 -1
- package/dist/client/assets/{select-model-BvwOHBLi.js → select-model-8KGpYG78.js} +1 -1
- package/dist/client/assets/{seo-editor-te_rCW-y.js → seo-editor-C0NKkdi0.js} +1 -1
- package/dist/client/assets/{separator-BQGbPFWO.js → separator-CWugGQbc.js} +1 -1
- package/dist/client/assets/{settings-tab-h8YLdZG4.js → settings-tab-DRo0WDQp.js} +1 -1
- package/dist/client/assets/{sheet-CAPBfpxY.js → sheet-BHMUXURV.js} +1 -1
- package/dist/client/assets/{shell-layout-D3hbXuJp.js → shell-layout-XTP1Kn60.js} +1 -1
- package/dist/client/assets/{skills-bn8hfZhY.js → skills-E3OyU2oM.js} +1 -1
- package/dist/client/assets/{sso-B2mfdHDN.js → sso-BZQj7YFV.js} +1 -1
- package/dist/client/assets/{suggestion-CxpxmxhU.js → suggestion-089nWMGT.js} +1 -1
- package/dist/client/assets/{switch-DobgoLr7.js → switch-Bj8bJ2hL.js} +1 -1
- package/dist/client/assets/{synced-repos-BkubYLAQ.js → synced-repos-CVHbttMo.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-DTu4Vb5u.js → tab-icon-glyph-6vvl9RhU.js} +1 -1
- package/dist/client/assets/{table-B3glu4jC.js → table-vIpu14O-.js} +1 -1
- package/dist/client/assets/{tabs-tpTL3qIk.js → tabs-Cz37pyV6.js} +1 -1
- package/dist/client/assets/{task-board-DD4Wj2ht.js → task-board-BMQrxTue.js} +1 -1
- package/dist/client/assets/{task-route-DkYY7Jf8.js → task-route-BKWswtA1.js} +1 -1
- package/dist/client/assets/{task-status-DQDKjMn6.js → task-status-C1D3al28.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-BqZn-lMy.js → taskboard-analytics-D2gsuZp2.js} +1 -1
- package/dist/client/assets/{tasks-DoHgB8D-.js → tasks-CuCPnKFB.js} +1 -1
- package/dist/client/assets/tasks-sv7N_jrP.js +1 -0
- package/dist/client/assets/{textarea-B-0phPFl.js → textarea-C-PwJiry.js} +1 -1
- package/dist/client/assets/{thread-analytics-BqmJENFM.js → thread-analytics-6Vi5UYyl.js} +1 -1
- package/dist/client/assets/{thread-button-B6AnS30f.js → thread-button-CBArUpXO.js} +1 -1
- package/dist/client/assets/{thread-intent-CgGr7s14.js → thread-intent-swCQbScV.js} +1 -1
- package/dist/client/assets/{thread-route-CYYizTAL.js → thread-route-CMTlmdB2.js} +1 -1
- package/dist/client/assets/{thread-route-DIGJI8Dr.js → thread-route-DTbwFwzB.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-Ywa9zjyd.js → thread-sheet-body-BNWfu5MD.js} +1 -1
- package/dist/client/assets/{toggle-group-CHFxR7n1.js → toggle-group-CozxhBpA.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CLiPKHlm.js → toolbar-icon-button-BR_iVDC5.js} +1 -1
- package/dist/client/assets/{tooltip-wkfHPLLP.js → tooltip-CmsIn1_T.js} +1 -1
- package/dist/client/assets/{track-DHiW7Kzl.js → track-ISGFXwLG.js} +1 -1
- package/dist/client/assets/{types-D821jmOY.js → types-Dnj2Xk6p.js} +1 -1
- package/dist/client/assets/{usage-stats-dtNozGHE.js → usage-stats-CQr6G5Ur.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DAPxuNGR.js → use-ai-providers-DKY0H66j.js} +1 -1
- package/dist/client/assets/{use-automations-BSdsdElw.js → use-automations-CSJ606-d.js} +1 -1
- package/dist/client/assets/{use-autosave-Bb3SyJ6X.js → use-autosave-CnIoAHDs.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-DMEvvTdU.js → use-chat-layout-state-B1ZVGaLS.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CcZLWvhU.js → use-clock-tick-BsJNcY-e.js} +1 -1
- package/dist/client/assets/{use-connect-companion-bZE9oz5D.js → use-connect-companion-vcvy2-_E.js} +1 -1
- package/dist/client/assets/{use-connection-CbaLhExN.js → use-connection-o6IaHrCa.js} +1 -1
- package/dist/client/assets/{use-copy-ClIijIuF.js → use-copy-CbVFfAiy.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Ct8X79Tz.js → use-create-virtual-mcp-B90oa05V.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-Casbf2a3.js → use-date-fns-locale-DtLNXwQQ.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BWu_uxAJ.js → use-debounced-autosave-C94tXEES.js} +1 -1
- package/dist/client/assets/{use-debounced-value-B8wDF2XE.js → use-debounced-value-BJOL8Gwj.js} +1 -1
- package/dist/client/assets/{use-deco-credits-CV7jBFos.js → use-deco-credits-BTMj7mOL.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Ch1NmAx8.js → use-decopilot-events-B7N8IjI0.js} +1 -1
- package/dist/client/assets/{use-delete-connection-UsR0uNx4.js → use-delete-connection-CWCsmyea.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BF_f54Es.js → use-deployment-admin-C7HpswZD.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-B2gvR8WR.js → use-fast-preview-draft-url-X9ccfQ1G.js} +1 -1
- package/dist/client/assets/{use-file-configs-DI1Gb-A6.js → use-file-configs-BJx6-ZW4.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Cq0eGH_b.js → use-infinite-scroll-D564AByM.js} +1 -1
- package/dist/client/assets/{use-join-requests-CuAsvnrr.js → use-join-requests-DadESn-r.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-DpHhPbO5.js → use-main-panel-tabs-CvkNpk_m.js} +1 -1
- package/dist/client/assets/use-mcp-auth-status-BPJMjKJu.js +1 -0
- package/dist/client/assets/{use-mcp-client-CfAhFfUQ.js → use-mcp-client-BCOmh6mH.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DUcMyHUY.js → use-mcp-prompts-DsQz4qyp.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CzCYSnw_.js → use-mcp-tools-isgPo0N2.js} +1 -1
- package/dist/client/assets/{use-members-DgL3Nti4.js → use-members-B_fEZqvW.js} +1 -1
- package/dist/client/assets/{use-mobile-CRrGxASl.js → use-mobile-CUG36tjm.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BvvbqcqU.js → use-navigate-to-agent-Cv939dl9.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-CUI80h3P.js +1 -0
- package/dist/client/assets/{use-open-billing-url-CeVw8-rB.js → use-open-billing-url-DBj1DYvR.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BdIkgk3C.js → use-org-auth-client-Cro1UGGf.js} +1 -1
- package/dist/client/assets/{use-org-fs-DnXImEGt.js → use-org-fs-CfcB8IFl.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-CR1cxPeJ.js → use-org-repo-syncs-DVJH08hK.js} +1 -1
- package/dist/client/assets/{use-org-sso-BWqpxNPp.js → use-org-sso-554XjjGQ.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DeZ0GmYu.js → use-organization-roles-BTmd-L2w.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CAg22Y85.js → use-organization-settings-B-_PpufY.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-1U3BGwp7.js → use-panel-navigate-CuKDZSXf.js} +1 -1
- package/dist/client/assets/{use-project-scope-CAwN_j8n.js → use-project-scope-B1N6dPlK.js} +1 -1
- package/dist/client/assets/{use-releases-oNY9aclO.js → use-releases-BK-Rfz0E.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-BERenbrG.js → use-reports-diagnostic-kNe2-1FK.js} +1 -1
- package/dist/client/assets/{use-secrets-DVp8iDqR.js → use-secrets-Bpfmfnyi.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-0SFqRDNJ.js → use-section-preview-base-DDylhaW1.js} +1 -1
- package/dist/client/assets/{use-session-runtime-CYBHR_jn.js → use-session-runtime-CTR5dqXO.js} +1 -1
- package/dist/client/assets/{use-tags-BhYfCjoP.js → use-tags-CToQ_9AW.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-g2dJA7k7.js → use-task-board-analytics-BhmIKHN_.js} +1 -1
- package/dist/client/assets/{use-task-board-events-g4QVOfjw.js → use-task-board-events-B6plWEJr.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DyoW40DT.js → use-task-metadata-_V-lBt2X.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-CqH2wFAc.js → use-thread-analytics-DJ0Oh091.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-Dlae_WuT.js → use-thread-outputs-BH6QTvpP.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DRaKStQa.js +1 -0
- package/dist/client/assets/{useQueries-BrUezESb.js → useQueries-DHRnWhYf.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-WHFkobEh.js +1 -0
- package/dist/client/assets/{users-DLL0mxIn.js → users-UP11Y2d_.js} +1 -1
- package/dist/client/assets/{utils-CRUIllS1.js → utils-CSf7trYW.js} +1 -1
- package/dist/client/assets/variant-calendar-k_RwHcjk.js +1 -0
- package/dist/client/assets/{variant-matcher-override-QKsigM8f.js → variant-matcher-override-DEvkqGTd.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BP4sJ9Zb.js → view-mode-toggle-C7tIx4kb.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CU6lFPKs.js → virtual-mcp-BkcbnGY4.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-Dz4q7M33.js +0 -1
- package/dist/client/assets/agent-automations-BFirWNhs.js +0 -1
- package/dist/client/assets/agent-deck-WsR4Kn9L.js +0 -1
- package/dist/client/assets/agent-library-BKKs17DG.js +0 -1
- package/dist/client/assets/agent-library-file-os4HTtuL.js +0 -1
- package/dist/client/assets/agent-settings-DkVBAYdv.js +0 -1
- package/dist/client/assets/agent-site-editor-code-BhSQKIbt.js +0 -2
- package/dist/client/assets/agent-view-DHNwmHuh.js +0 -1
- package/dist/client/assets/api-keys-Cz0CzGuc.js +0 -1
- package/dist/client/assets/app-editor-JPlYmOB_.js +0 -1
- package/dist/client/assets/category-editor-By3O-w3E.js +0 -1
- package/dist/client/assets/context-BA5tBJat.js +0 -1
- package/dist/client/assets/daily-pulse-CKz-O4VD.js +0 -1
- package/dist/client/assets/flat-project-C-eO96A2.js +0 -1
- package/dist/client/assets/home-VShFyYWB.js +0 -1
- package/dist/client/assets/library-VxiqdGt5.js +0 -1
- package/dist/client/assets/post-editor-Vuu8KboN.js +0 -2
- package/dist/client/assets/project-reports-C2fGvQWV.js +0 -1
- package/dist/client/assets/project-tasks-CIHsh5h6.js +0 -1
- package/dist/client/assets/record-editor-tpiSv1vv.js +0 -1
- package/dist/client/assets/reports-Cjp1W3ep.js +0 -1
- package/dist/client/assets/resolve-tab-icon-BHe-FJLH.js +0 -1
- package/dist/client/assets/route-Cc-MOYOr.js +0 -1
- package/dist/client/assets/tasks-DARVJAgH.js +0 -1
- package/dist/client/assets/use-mcp-auth-status-DL6cA7oB.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-DMxJSTvk.js +0 -1
- package/dist/client/assets/useInfiniteQuery-CCCPgG_d.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-VJgBO4F9.js +0 -1
- package/dist/client/assets/variant-calendar-B-KiE4--.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as G,b as X,r as W,j as t,B as te,h as Xe,l as xe,I as ds,F as us,H as ms,G as Ke,aj as Pt,ah as $t,ai as Et,t as re,X as Ae,E as Re,Z as fs,ff as Qs,L as ps,ab as Xs,s as Js,ee as He,ak as Ft,aa as Zs,ed as Le,ec as Be,a2 as ot,m as en,K as hs,fg as tn,fh as sn,fi as nn,aU as pe,fj as ye,n as ze,P as an,d as Ct,u as ln,q as je,c$ as rn,ao as on,e_ as cn,fk as dn,aS as un,a as mn,fl as xs,fm as fn,aJ as pn,a7 as hn,o as xn,at as gn,as as vn,fn as bn,ay as jn}from"./index-DbabGxy6.js";import{g as yn}from"./extract-connection-data-Yv51Ip2F.js";import{a as wn}from"./chat-context-Bf1EEUa_.js";import{U as Sn,b as Nn}from"./build-improve-prompt-doc-Cp9ERAt-.js";import{E as Cn}from"./empty-state-DfF0wZnW.js";import{a as Mn}from"./shell-layout-D3hbXuJp.js";import{g as ct,n as kn,a as zt,e as _n,u as Vn,f as Tn}from"./use-date-fns-locale-Casbf2a3.js";import{a as Mt,b as gs,u as Dn}from"./use-connection-CbaLhExN.js";import{b as vs,a as bs,f as js,g as ys,k as An}from"./repository-binding-DST5BjAq.js";import{a as In,i as Rt}from"./mcp-oauth-DPBTzzM-.js";import{f as On,e as Pn,b as $n,A as En,a as Fn,d as zn,c as Rn,g as Ln}from"./alert-dialog-Dr37XaeA.js";import{D as Je,b as Ze,c as dt,d as ut,e as ws,h as Un}from"./dialog-CSMrPqBB.js";import{T as at}from"./textarea-B-0phPFl.js";import{b as we,T as Se,a as Ne}from"./tooltip-wkfHPLLP.js";import{n as Yn}from"./LinkExternal01-D20IL3CN.js";import{b9 as Bn,h as Kn,ba as Wn,bb as Gn,aM as Hn,aw as qn,aC as Qn,bc as Xn,bd as Ss,be as Ns,bf as Jn,ak as Zn,bg as ei,bh as xt,bi as Lt,A as Ut,G as ti,bj as si,bk as ni,g as Cs,m as Yt,n as ii,q as ai,p as li,f as Ms,bl as Bt,Q as ri,Z as oi,aK as ci,aa as di,aq as ui}from"./agent-icon-BRxvZRmN.js";import{s as $e}from"./Plus-BvxsRY-0.js";import{t as it,a as mi}from"./Tool01-DetpIMtk.js";import{s as kt}from"./Trash01-DKbCrUTj.js";import{u as Kt}from"./use-debounced-autosave-BWu_uxAJ.js";import{A as fi}from"./add-connection-dialog-B0L-P2sh.js";import{i as yt}from"./SearchMd-CHmk5GD6.js";import{F as Wt}from"./file-type-icon-Bv7OJA49.js";import{i as pi,h as hi,m as xi,p as gi}from"./use-org-fs-DnXImEGt.js";import{I as Ge}from"./integration-icon-CFV7KR9Q.js";import{C as ks}from"./checkbox-GjKetutN.js";import{S as vi}from"./search-input-uE9X4-9v.js";import{b as _e,a as Ve,c as ge,d as Te,S as De}from"./select-DOq28vkW.js";import{s as _t}from"./XClose-Chbrrnow.js";import{C as bi}from"./collection-tabs-CJy8rHXV.js";import{T as _s,u as Vs}from"./use-mcp-auth-status-DL6cA7oB.js";import{u as mt}from"./use-mcp-client-CfAhFfUQ.js";import{a as Ts}from"./use-mcp-tools-CzCYSnw_.js";import{u as ji}from"./use-mcp-prompts-DUcMyHUY.js";import{g as yi}from"./connection-slug-CITJ0kGN.js";import{t as wt}from"./utils-CVEq3hMx.js";import{I as ke}from"./input-DV9TXIhc.js";import{S as et}from"./switch-DobgoLr7.js";import{a as Ds,b as As,P as Is}from"./popover-DpWUGKUo.js";import{S as wi}from"./scroll-area-C1UEqWPg.js";import{i as Si}from"./Upload01-BBKhvCnt.js";import{i as Ni}from"./DotsVertical-Cz9DnVkj.js";import{a as Ci}from"./Image01-DkSAzjSu.js";import{i as Mi}from"./Monitor01-WwJ1rHPk.js";import{g as ki}from"./types-D821jmOY.js";import{b as lt,g as _i,d as Vi}from"./use-project-scope-CAwN_j8n.js";import{a as Ti}from"./use-panel-navigate-1U3BGwp7.js";import{u as Di,e as St,r as Nt,p as Ai,n as Ii,s as Oi,o as Pi,q as $i,c as Ei}from"./use-chat-layout-state-DMEvvTdU.js";import{a as Os,u as Fi,i as zi,o as Ri,r as Gt,p as Li,w as Ui,b as Ht}from"./optimistic-project-sidebar-views-BjQNVvvG.js";import{i as Yi}from"./Link01-CBIFqZsw.js";import{V as Bi,E as ft,r as Ps,C as Ki,w as Wi}from"./virtual-mcp-CU6lFPKs.js";import{s as $s}from"./slugify-CEUa2lfQ.js";import{b as Gi,a as Hi,D as qi}from"./drawer-DamNEeFr.js";import{u as Qi}from"./use-mobile-CRrGxASl.js";import{i as tt}from"./Check-CzhgdtoZ.js";import{a as pt}from"./Copy01-DK-rveWk.js";import{i as Vt}from"./Key01-2_VP-ymA.js";import{d as st}from"./backoff-8mStPHYB.js";import{R as Xi}from"./repository-import-picker-Cefyzn5z.js";import{b as Ji}from"./sandbox-url-D3mC8qhT.js";import{L as he}from"./label-CaVwbUwP.js";import{S as Zi,a as ea,b as ta}from"./secret-picker-DpiORdM4.js";import{u as sa,a as na}from"./use-secrets-DVp8iDqR.js";import{o as qt}from"./omit-sandbox-map-jj4lCB2U.js";import{G as ia}from"./repository-picker-DIYtkoGR.js";import{f as aa,s as la,g as ra}from"./thread-intent-CgGr7s14.js";import{r as oa}from"./serial-task-queue-CGOeQgpr.js";import{t as Ie,c as We,m as ca,a as Es}from"./differenceInSeconds-C3x8sHUj.js";function Qe(a,e){const n=ct(),s=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Ie(a,e?.in),l=i.getDay(),o=(l<s?7:0)+l-s;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function rt(a,e){return Qe(a,{...e,weekStartsOn:1})}function Fs(a,e){const n=Ie(a,e?.in),s=n.getFullYear(),i=We(n,0);i.setFullYear(s+1,0,4),i.setHours(0,0,0,0);const l=rt(i),o=We(n,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const r=rt(o);return n.getTime()>=l.getTime()?s+1:n.getTime()>=r.getTime()?s:s-1}function Qt(a,e){const n=Ie(a,e?.in);return n.setHours(0,0,0,0),n}function da(a,e,n){const[s,i]=kn(n?.in,a,e),l=Qt(s),o=Qt(i),r=+l-zt(l),h=+o-zt(o);return Math.round((r-h)/ca)}function ua(a,e){const n=Fs(a,e),s=We(a,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),rt(s)}function ma(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function fa(a){return!(!ma(a)&&typeof a!="number"||isNaN(+Ie(a)))}function pa(a,e){const n=Ie(a,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ha(a,e){const n=Ie(a,e?.in);return da(n,pa(n))+1}function xa(a,e){const n=Ie(a,e?.in),s=+rt(n)-+ua(n);return Math.round(s/Es)+1}function zs(a,e){const n=Ie(a,e?.in),s=n.getFullYear(),i=ct(),l=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=We(e?.in||a,0);o.setFullYear(s+1,0,l),o.setHours(0,0,0,0);const r=Qe(o,e),h=We(e?.in||a,0);h.setFullYear(s,0,l),h.setHours(0,0,0,0);const d=Qe(h,e);return+n>=+r?s+1:+n>=+d?s:s-1}function ga(a,e){const n=ct(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=zs(a,e),l=We(e?.in||a,0);return l.setFullYear(i,0,s),l.setHours(0,0,0,0),Qe(l,e)}function va(a,e){const n=Ie(a,e?.in),s=+Qe(n,e)-+ga(n,e);return Math.round(s/Es)+1}function le(a,e){const n=a<0?"-":"",s=Math.abs(a).toString().padStart(e,"0");return n+s}const Pe={y(a,e){const n=a.getFullYear(),s=n>0?n:1-n;return le(e==="yy"?s%100:s,e.length)},M(a,e){const n=a.getMonth();return e==="M"?String(n+1):le(n+1,2)},d(a,e){return le(a.getDate(),e.length)},a(a,e){const n=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(a,e){return le(a.getHours()%12||12,e.length)},H(a,e){return le(a.getHours(),e.length)},m(a,e){return le(a.getMinutes(),e.length)},s(a,e){return le(a.getSeconds(),e.length)},S(a,e){const n=e.length,s=a.getMilliseconds(),i=Math.trunc(s*Math.pow(10,n-3));return le(i,e.length)}},Ye={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Xt={G:function(a,e,n){const s=a.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});default:return n.era(s,{width:"wide"})}},y:function(a,e,n){if(e==="yo"){const s=a.getFullYear(),i=s>0?s:1-s;return n.ordinalNumber(i,{unit:"year"})}return Pe.y(a,e)},Y:function(a,e,n,s){const i=zs(a,s),l=i>0?i:1-i;if(e==="YY"){const o=l%100;return le(o,2)}return e==="Yo"?n.ordinalNumber(l,{unit:"year"}):le(l,e.length)},R:function(a,e){const n=Fs(a);return le(n,e.length)},u:function(a,e){const n=a.getFullYear();return le(n,e.length)},Q:function(a,e,n){const s=Math.ceil((a.getMonth()+1)/3);switch(e){case"Q":return String(s);case"QQ":return le(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(a,e,n){const s=Math.ceil((a.getMonth()+1)/3);switch(e){case"q":return String(s);case"qq":return le(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(a,e,n){const s=a.getMonth();switch(e){case"M":case"MM":return Pe.M(a,e);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(a,e,n){const s=a.getMonth();switch(e){case"L":return String(s+1);case"LL":return le(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(a,e,n,s){const i=va(a,s);return e==="wo"?n.ordinalNumber(i,{unit:"week"}):le(i,e.length)},I:function(a,e,n){const s=xa(a);return e==="Io"?n.ordinalNumber(s,{unit:"week"}):le(s,e.length)},d:function(a,e,n){return e==="do"?n.ordinalNumber(a.getDate(),{unit:"date"}):Pe.d(a,e)},D:function(a,e,n){const s=ha(a);return e==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):le(s,e.length)},E:function(a,e,n){const s=a.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(a,e,n,s){const i=a.getDay(),l=(i-s.weekStartsOn+8)%7||7;switch(e){case"e":return String(l);case"ee":return le(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(a,e,n,s){const i=a.getDay(),l=(i-s.weekStartsOn+8)%7||7;switch(e){case"c":return String(l);case"cc":return le(l,e.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(a,e,n){const s=a.getDay(),i=s===0?7:s;switch(e){case"i":return String(i);case"ii":return le(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(a,e,n){const i=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(a,e,n){const s=a.getHours();let i;switch(s===12?i=Ye.noon:s===0?i=Ye.midnight:i=s/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(a,e,n){const s=a.getHours();let i;switch(s>=17?i=Ye.evening:s>=12?i=Ye.afternoon:s>=4?i=Ye.morning:i=Ye.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(a,e,n){if(e==="ho"){let s=a.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return Pe.h(a,e)},H:function(a,e,n){return e==="Ho"?n.ordinalNumber(a.getHours(),{unit:"hour"}):Pe.H(a,e)},K:function(a,e,n){const s=a.getHours()%12;return e==="Ko"?n.ordinalNumber(s,{unit:"hour"}):le(s,e.length)},k:function(a,e,n){let s=a.getHours();return s===0&&(s=24),e==="ko"?n.ordinalNumber(s,{unit:"hour"}):le(s,e.length)},m:function(a,e,n){return e==="mo"?n.ordinalNumber(a.getMinutes(),{unit:"minute"}):Pe.m(a,e)},s:function(a,e,n){return e==="so"?n.ordinalNumber(a.getSeconds(),{unit:"second"}):Pe.s(a,e)},S:function(a,e){return Pe.S(a,e)},X:function(a,e,n){const s=a.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return Zt(s);case"XXXX":case"XX":return Fe(s);default:return Fe(s,":")}},x:function(a,e,n){const s=a.getTimezoneOffset();switch(e){case"x":return Zt(s);case"xxxx":case"xx":return Fe(s);default:return Fe(s,":")}},O:function(a,e,n){const s=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Jt(s,":");default:return"GMT"+Fe(s,":")}},z:function(a,e,n){const s=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Jt(s,":");default:return"GMT"+Fe(s,":")}},t:function(a,e,n){const s=Math.trunc(+a/1e3);return le(s,e.length)},T:function(a,e,n){return le(+a,e.length)}};function Jt(a,e=""){const n=a>0?"-":"+",s=Math.abs(a),i=Math.trunc(s/60),l=s%60;return l===0?n+String(i):n+String(i)+e+le(l,2)}function Zt(a,e){return a%60===0?(a>0?"-":"+")+le(Math.abs(a)/60,2):Fe(a,e)}function Fe(a,e=""){const n=a>0?"-":"+",s=Math.abs(a),i=le(Math.trunc(s/60),2),l=le(s%60,2);return n+i+e+l}const es=(a,e)=>{switch(a){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Rs=(a,e)=>{switch(a){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},ba=(a,e)=>{const n=a.match(/(P+)(p+)?/)||[],s=n[1],i=n[2];if(!i)return es(a,e);let l;switch(s){case"P":l=e.dateTime({width:"short"});break;case"PP":l=e.dateTime({width:"medium"});break;case"PPP":l=e.dateTime({width:"long"});break;default:l=e.dateTime({width:"full"});break}return l.replace("{{date}}",es(s,e)).replace("{{time}}",Rs(i,e))},ja={p:Rs,P:ba},ya=/^D+$/,wa=/^Y+$/,Sa=["D","DD","YY","YYYY"];function Na(a){return ya.test(a)}function Ca(a){return wa.test(a)}function Ma(a,e,n){const s=ka(a,e,n);if(console.warn(s),Sa.includes(a))throw new RangeError(s)}function ka(a,e,n){const s=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${e}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const _a=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Va=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ta=/^'([^]*?)'?$/,Da=/''/g,Aa=/[a-zA-Z]/;function Ia(a,e,n){const s=ct(),i=n?.locale??s.locale??_n,l=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,r=Ie(a,n?.in);if(!fa(r))throw new RangeError("Invalid time value");let h=e.match(Va).map(m=>{const f=m[0];if(f==="p"||f==="P"){const u=ja[f];return u(m,i.formatLong)}return m}).join("").match(_a).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const f=m[0];if(f==="'")return{isToken:!1,value:Oa(m)};if(Xt[f])return{isToken:!0,value:m};if(f.match(Aa))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:m}});i.localize.preprocessor&&(h=i.localize.preprocessor(r,h));const d={firstWeekContainsDate:l,weekStartsOn:o,locale:i};return h.map(m=>{if(!m.isToken)return m.value;const f=m.value;(!n?.useAdditionalWeekYearTokens&&Ca(f)||!n?.useAdditionalDayOfYearTokens&&Na(f))&&Ma(f,e,String(a));const u=Xt[f[0]];return u(r,f,i.localize,d)}).join("")}function Oa(a){const e=a.match(Ta);return e?e[1].replace(Da,"'"):a}const Ls=25*1024*1024,gt="home",vt="knowledge";function ts(a){return a==null?"":a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(0)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`}function Ee(a){return a.split("/").pop()??a}function Pa(a){const e=G.c(64),{form:n}=a,s=X(),{upload:i}=pi(gt),l=hi(),o=W.useRef(null),[r,h]=W.useState(!1),[d,m]=W.useState(""),[f,u]=W.useState(!1);let c;e[0]!==r?(c={enabled:r},e[0]=r,e[1]=c):c=e[1];const{data:p}=xi(60,c),x=p===void 0?[]:p;let g;e[2]!==r?(g={enabled:r},e[2]=r,e[3]=g):g=e[3];const{data:b}=gi(g),y=b===void 0?[]:b;let j;e[4]!==n?(j=()=>n.getValues("metadata.knowledge")??[],e[4]=n,e[5]=j):j=e[5];const[v,S]=W.useState(j);let N;e[6]!==n?(N=I=>{S(I),n.setValue("metadata.knowledge",I,{shouldDirty:!0})},e[6]=n,e[7]=N):N=e[7];const M=N;let w;e[8]!==l||e[9]!==v||e[10]!==M||e[11]!==s||e[12]!==i?(w=async I=>{if(!I||I.length===0)return;const J=Array.from(I),be=J.filter(Ua),ce=J.filter(La);if(ce.length>0&&re.warning(s("virtualMcp.filesSection.fileTooLargeTitle"),{description:s("virtualMcp.filesSection.fileTooLargeDescription",{names:ce.map(Ra).join(", ")})}),be.length!==0){try{await i.mutateAsync({dir:vt,files:be})}catch(me){const Oe=me;re.error(Oe instanceof Error?Oe.message:s("virtualMcp.filesSection.failedUploadFile"));return}M([...v,...be.map(me=>({id:crypto.randomUUID(),name:me.name,volume:gt,path:`${vt}/${me.name}`,url:l(gt,`${vt}/${me.name}`),contentType:me.type||null,size:me.size,addedAt:new Date().toISOString()}))])}},e[8]=l,e[9]=v,e[10]=M,e[11]=s,e[12]=i,e[13]=w):w=e[13];const C=w;let k;e[14]!==l||e[15]!==v||e[16]!==M?(k=I=>{v.some(J=>J.volume===I.volume&&J.path===I.path)||(M([...v,{id:crypto.randomUUID(),name:Ee(I.path),volume:I.volume,path:I.path,url:l(I.volume,I.path),contentType:null,size:I.size??null,addedAt:new Date().toISOString()}]),h(!1))},e[14]=l,e[15]=v,e[16]=M,e[17]=k):k=e[17];const T=k;let V;e[18]!==l||e[19]!==v||e[20]!==M?(V=I=>{v.some(J=>J.volume===I.volume&&J.path===I.path)||(M([...v,{id:crypto.randomUUID(),name:Ee(I.path),kind:"skill",volume:I.volume,path:I.path,url:l(I.volume,I.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),h(!1))},e[18]=l,e[19]=v,e[20]=M,e[21]=V):V=e[21];const A=V;let D;e[22]!==v||e[23]!==M?(D=I=>{M(v.filter(J=>J.id!==I))},e[22]=v,e[23]=M,e[24]=D):D=e[24];const z=D;let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=I=>{h(I),I&&m("")},e[25]=P):P=e[25];const $=P;let F;e[26]!==v?(F=new Set(v.map(za)),e[26]=v,e[27]=F):F=e[27];const H=F,B=d.toLowerCase();let Y;e[28]!==H?(Y=I=>!H.has(`${I.volume}/${I.path}`),e[28]=H,e[29]=Y):Y=e[29];const U=x.filter(Fa).filter(Y).filter(I=>Ee(I.path).toLowerCase().includes(B)).slice(0,5);let _;e[30]!==H?(_=I=>!H.has(`${I.volume}/${I.path}`),e[30]=H,e[31]=_):_=e[31];const E=y.filter(_).filter(I=>Ee(I.path).toLowerCase().includes(B)).slice(0,5),q=I=>t.jsxs(ds,{open:r,onOpenChange:$,children:[t.jsx(us,{asChild:!0,children:I}),t.jsxs(ms,{align:"end",className:"w-56",children:[t.jsxs(Ke,{onSelect:()=>{o.current?.click()},children:[t.jsx(Bn,{size:16}),s("virtualMcp.filesSection.uploadFile")]}),t.jsxs(Pt,{children:[t.jsxs($t,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(Kn,{size:16}),s("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(Et,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(yt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:d,onChange:J=>m(J.target.value),onKeyDown:Ea,placeholder:s("virtualMcp.filesSection.searchFilesPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:U.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:s("virtualMcp.filesSection.noFilesFound")}):U.map(J=>t.jsxs(Ke,{onSelect:()=>T(J),children:[t.jsx(Wt,{filename:Ee(J.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ee(J.path)}),J.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:ts(J.size)})]},`${J.volume}/${J.path}`))})]})]}),t.jsxs(Pt,{children:[t.jsxs($t,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(it,{size:16}),s("virtualMcp.filesSection.selectSkill")]}),t.jsxs(Et,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(yt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:d,onChange:J=>m(J.target.value),onKeyDown:$a,placeholder:s("virtualMcp.filesSection.searchSkillsPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:E.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:s("virtualMcp.filesSection.noSkillsFound")}):E.map(J=>t.jsxs(Ke,{onSelect:()=>A(J),children:[t.jsx(it,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ee(J.path)})]},`${J.volume}/${J.path}`))})]})]})]})]}),L="flex flex-col gap-3";let R;e[32]!==s?(R=s("virtualMcp.filesSection.filesAndSkills"),e[32]=s,e[33]=R):R=e[33];let K;e[34]!==R?(K=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:R}),e[34]=R,e[35]=K):K=e[35];let Z;e[36]!==s?(Z=s("virtualMcp.filesSection.description"),e[36]=s,e[37]=Z):Z=e[37];let ae;e[38]!==Z?(ae=t.jsx("p",{className:"text-sm text-muted-foreground",children:Z}),e[38]=Z,e[39]=ae):ae=e[39];let ee;e[40]!==K||e[41]!==ae?(ee=t.jsxs("div",{className:"flex flex-col gap-1",children:[K,ae]}),e[40]=K,e[41]=ae,e[42]=ee):ee=e[42];const de=v.length>0&&q(t.jsxs(te,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(Xe,{size:"xs"}):t.jsx($e,{size:14}),s("virtualMcp.filesSection.add")]}));let oe;e[43]!==ee||e[44]!==de?(oe=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[ee,de]}),e[43]=ee,e[44]=de,e[45]=oe):oe=e[45];let ue;e[46]!==C?(ue=t.jsx("input",{ref:o,type:"file",multiple:!0,className:"hidden",onChange:I=>{C(I.target.files),I.target.value=""}}),e[46]=C,e[47]=ue):ue=e[47];let se,fe;e[48]===Symbol.for("react.memo_cache_sentinel")?(se=I=>{I.preventDefault(),u(!0)},fe=()=>u(!1),e[48]=se,e[49]=fe):(se=e[48],fe=e[49]);let ve;e[50]!==C?(ve=I=>{I.preventDefault(),I.stopPropagation(),u(!1),C(I.dataTransfer.files)},e[50]=C,e[51]=ve):ve=e[51];const Ce=f&&"outline outline-2 outline-dashed outline-primary";let O;e[52]!==Ce?(O=xe("flex flex-col gap-2 rounded-lg",Ce),e[52]=Ce,e[53]=O):O=e[53];const ne=v.length===0?q(t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx($e,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:s("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):v.map(I=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-card",children:[I.kind==="skill"?t.jsx("div",{className:"flex items-center justify-center h-8 w-6.5 shrink-0 rounded-md bg-muted text-muted-foreground",children:t.jsx(it,{size:16})}):t.jsx(Wt,{filename:I.name,className:"h-8 w-6.5 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:I.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:I.kind==="skill"?s("virtualMcp.filesSection.kindSkill"):I.size!=null?ts(I.size):s("virtualMcp.filesSection.kindFile")})]}),t.jsx(te,{variant:"ghost",size:"icon",onClick:()=>z(I.id),"aria-label":s("virtualMcp.filesSection.removeAriaLabel",{name:I.name}),children:t.jsx(kt,{size:16})})]},I.id));let Q;e[54]!==se||e[55]!==fe||e[56]!==ve||e[57]!==O||e[58]!==ne?(Q=t.jsx("div",{onDragOver:se,onDragLeave:fe,onDrop:ve,className:O,children:ne}),e[54]=se,e[55]=fe,e[56]=ve,e[57]=O,e[58]=ne,e[59]=Q):Q=e[59];let ie;return e[60]!==oe||e[61]!==ue||e[62]!==Q?(ie=t.jsxs("section",{className:L,children:[oe,ue,Q]}),e[60]=oe,e[61]=ue,e[62]=Q,e[63]=ie):ie=e[63],ie}function $a(a){return a.stopPropagation()}function Ea(a){return a.stopPropagation()}function Fa(a){return a.kind!=="dir"}function za(a){return`${a.volume}/${a.path}`}function Ra(a){return a.name}function La(a){return a.size>Ls}function Ua(a){return a.size<=Ls}function Ya(a){return a==null?"all":a.length===0?"self":"selected"}function Ba(a){const e=G.c(88),{form:n,currentAgentId:s}=a,i=X(),{org:l}=Ae(),o=vs(),[r,h]=W.useState(!1);let d;e[0]!==n?(d=n.getValues("metadata.subAgents")??null,e[0]=n,e[1]=d):d=e[1];const m=d;let f;e[2]!==m?(f=()=>Ya(m),e[2]=m,e[3]=f):f=e[3];const[u,c]=W.useState(f);let p;e[4]!==m?(p=m??[],e[4]=m,e[5]=p):p=e[5];const[x,g]=W.useState(p);let b,y,j,v,S,N;if(e[6]!==o||e[7]!==s||e[8]!==n||e[9]!==u||e[10]!==l||e[11]!==x||e[12]!==i){let k;e[19]!==s||e[20]!==l?(k=se=>se.id!==s&&se.id!==l.id&&se.status==="active",e[19]=s,e[20]=l,e[21]=k):k=e[21],b=o.filter(k);let T;e[22]!==x?(T=se=>x.includes(se.id),e[22]=x,e[23]=T):T=e[23];const V=b.filter(T);let A;e[24]!==n?(A=(se,fe)=>n.setValue("metadata.subAgents",se==="all"?null:se==="self"?[]:fe,{shouldDirty:!0}),e[24]=n,e[25]=A):A=e[25];const D=A;let z;e[26]!==D||e[27]!==x?(z=se=>{c(se),D(se,x)},e[26]=D,e[27]=x,e[28]=z):z=e[28];const P=z;let $;e[29]!==D||e[30]!==x?($=se=>{const fe=x.includes(se)?x.filter(ve=>ve!==se):[...x,se];g(fe),D("selected",fe)},e[29]=D,e[30]=x,e[31]=$):$=e[31],y=$,S="flex flex-col gap-3";let F;e[32]!==i?(F=i("virtualMcp.subAgentsSection.title"),e[32]=i,e[33]=F):F=e[33];let H;e[34]!==F?(H=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:F}),e[34]=F,e[35]=H):H=e[35];let B;e[36]!==u||e[37]!==i?(B=u==="all"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canDelegateToAnyAgent")}),e[36]=u,e[37]=i,e[38]=B):B=e[38];let Y;e[39]!==u||e[40]!==i?(Y=u==="self"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canOnlyDelegateToItself")}),e[39]=u,e[40]=i,e[41]=Y):Y=e[41];let U;e[42]!==H||e[43]!==B||e[44]!==Y?(U=t.jsxs("div",{className:"flex flex-col gap-1",children:[H,B,Y]}),e[42]=H,e[43]=B,e[44]=Y,e[45]=U):U=e[45];const _=u==="selected"&&V.length>0&&t.jsxs(te,{variant:"outline",size:"sm",onClick:()=>h(!0),children:[t.jsx($e,{size:14}),i("virtualMcp.subAgentsSection.addSubAgent")]});let E;e[46]!==P?(E=se=>P(se),e[46]=P,e[47]=E):E=e[47];let q;e[48]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx(_e,{size:"sm",className:"w-auto",children:t.jsx(Ve,{})}),e[48]=q):q=e[48];let L;e[49]!==i?(L=i("virtualMcp.subAgentsSection.anyAgent"),e[49]=i,e[50]=L):L=e[50];let R;e[51]!==L?(R=t.jsx(ge,{value:"all",children:L}),e[51]=L,e[52]=R):R=e[52];let K;e[53]!==i?(K=i("virtualMcp.subAgentsSection.specificAgents"),e[53]=i,e[54]=K):K=e[54];let Z;e[55]!==K?(Z=t.jsx(ge,{value:"selected",children:K}),e[55]=K,e[56]=Z):Z=e[56];let ae;e[57]!==i?(ae=i("virtualMcp.subAgentsSection.onlyItself"),e[57]=i,e[58]=ae):ae=e[58];let ee;e[59]!==ae?(ee=t.jsx(ge,{value:"self",children:ae}),e[59]=ae,e[60]=ee):ee=e[60];let de;e[61]!==R||e[62]!==Z||e[63]!==ee?(de=t.jsxs(Te,{align:"end",children:[R,Z,ee]}),e[61]=R,e[62]=Z,e[63]=ee,e[64]=de):de=e[64];let oe;e[65]!==u||e[66]!==E||e[67]!==de?(oe=t.jsxs(De,{value:u,onValueChange:E,children:[q,de]}),e[65]=u,e[66]=E,e[67]=de,e[68]=oe):oe=e[68];let ue;e[69]!==_||e[70]!==oe?(ue=t.jsxs("div",{className:"flex items-center gap-2",children:[_,oe]}),e[69]=_,e[70]=oe,e[71]=ue):ue=e[71],e[72]!==U||e[73]!==ue?(N=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[U,ue]}),e[72]=U,e[73]=ue,e[74]=N):N=e[74],j="flex flex-col gap-2",v=u==="selected"&&(V.length>0?V.map(se=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-background",children:[t.jsx(Ge,{icon:se.icon,name:se.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:se.title}),se.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:se.description})]}),t.jsx(te,{variant:"ghost",size:"icon",onClick:()=>y(se.id),children:t.jsx(_t,{size:16})})]},se.id)):t.jsxs("button",{type:"button",onClick:()=>h(!0),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx($e,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.emptyStateMessage")})]})),e[6]=o,e[7]=s,e[8]=n,e[9]=u,e[10]=l,e[11]=x,e[12]=i,e[13]=b,e[14]=y,e[15]=j,e[16]=v,e[17]=S,e[18]=N}else b=e[13],y=e[14],j=e[15],v=e[16],S=e[17],N=e[18];let M;e[75]!==j||e[76]!==v?(M=t.jsx("div",{className:j,children:v}),e[75]=j,e[76]=v,e[77]=M):M=e[77];let w;e[78]!==b||e[79]!==y||e[80]!==r||e[81]!==x?(w=t.jsx(Ka,{open:r,onOpenChange:h,candidates:b,selectedIds:x,onToggle:y}),e[78]=b,e[79]=y,e[80]=r,e[81]=x,e[82]=w):w=e[82];let C;return e[83]!==S||e[84]!==N||e[85]!==M||e[86]!==w?(C=t.jsxs("section",{className:S,children:[N,M,w]}),e[83]=S,e[84]=N,e[85]=M,e[86]=w,e[87]=C):C=e[87],C}function Ka(a){const e=G.c(39),{open:n,onOpenChange:s,candidates:i,selectedIds:l,onToggle:o}=a,r=X(),[h,d]=W.useState("");let m,f,u,c,p,x,g,b,y;if(e[0]!==i||e[1]!==s||e[2]!==o||e[3]!==n||e[4]!==h||e[5]!==l||e[6]!==r){const N=h.toLowerCase(),M=i.filter(k=>k.title.toLowerCase().includes(N)||k.description?.toLowerCase().includes(N));f=Je,b=n,y=s,m=Ze,p="max-w-md";let w;e[16]!==r?(w=r("virtualMcp.subAgentsSection.title"),e[16]=r,e[17]=w):w=e[17],e[18]!==w?(x=t.jsx(dt,{children:t.jsx(ut,{children:w})}),e[18]=w,e[19]=x):x=e[19];let C;e[20]!==r?(C=r("virtualMcp.subAgentsSection.searchPlaceholder"),e[20]=r,e[21]=C):C=e[21],e[22]!==h||e[23]!==C?(g=t.jsx(vi,{value:h,onChange:d,placeholder:C,className:"w-full"}),e[22]=h,e[23]=C,e[24]=g):g=e[24],u="flex flex-col gap-1 max-h-80 overflow-y-auto",c=M.length===0?t.jsx("p",{className:"text-sm text-muted-foreground px-1 py-4 text-center",children:r("virtualMcp.subAgentsSection.noAgentsFound")}):M.map(k=>t.jsxs("button",{type:"button",onClick:()=>o(k.id),className:"flex items-center gap-3 px-2 py-2 rounded-lg hover:bg-accent/50 transition-colors cursor-pointer w-full text-left",children:[t.jsx(ks,{checked:l.includes(k.id),className:"pointer-events-none",tabIndex:-1}),t.jsx(Ge,{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[0]=i,e[1]=s,e[2]=o,e[3]=n,e[4]=h,e[5]=l,e[6]=r,e[7]=m,e[8]=f,e[9]=u,e[10]=c,e[11]=p,e[12]=x,e[13]=g,e[14]=b,e[15]=y}else m=e[7],f=e[8],u=e[9],c=e[10],p=e[11],x=e[12],g=e[13],b=e[14],y=e[15];let j;e[25]!==u||e[26]!==c?(j=t.jsx("div",{className:u,children:c}),e[25]=u,e[26]=c,e[27]=j):j=e[27];let v;e[28]!==m||e[29]!==p||e[30]!==x||e[31]!==g||e[32]!==j?(v=t.jsxs(m,{className:p,children:[x,g,j]}),e[28]=m,e[29]=p,e[30]=x,e[31]=g,e[32]=j,e[33]=v):v=e[33];let S;return e[34]!==f||e[35]!==b||e[36]!==y||e[37]!==v?(S=t.jsx(f,{open:b,onOpenChange:y,children:v}),e[34]=f,e[35]=b,e[36]=y,e[37]=v,e[38]=S):S=e[38],S}function qe(){const a=G.c(1);let e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(Xe,{className:"size-6 text-muted-foreground"})}),a[0]=e):e=a[0],e}function nt(a,e){return({error:n})=>n?.message?.includes("Method not found")||n?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:a})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(fs,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:e("virtualMcp.dependencySelectionDialog.somethingWentWrong")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:n?.message?n.message.length>200?`${n.message.slice(0,200)}...`:n.message:e("virtualMcp.dependencySelectionDialog.unexpectedError")})]})]})}function Us(a){const e=G.c(23),{item:n,isSelected:s,onToggle:i,disabled:l}=a,o=l?"cursor-not-allowed opacity-50":"cursor-pointer",r=s?"bg-accent/25":"hover:bg-muted/50";let h;e[0]!==o||e[1]!==r?(h=xe("flex items-start gap-3 p-4 rounded-lg transition-colors",o,r),e[0]=o,e[1]=r,e[2]=h):h=e[2];let d;e[3]!==n.name?(d=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:n.name}),e[3]=n.name,e[4]=d):d=e[4];let m;e[5]!==n.tags?(m=n.tags&&t.jsx("span",{className:"shrink-0",children:n.tags}),e[5]=n.tags,e[6]=m):m=e[6];let f;e[7]!==d||e[8]!==m?(f=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d,m]}),e[7]=d,e[8]=m,e[9]=f):f=e[9];let u;e[10]!==n.description?(u=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[10]=n.description,e[11]=u):u=e[11];let c;e[12]!==f||e[13]!==u?(c=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[f,u]}),e[12]=f,e[13]=u,e[14]=c):c=e[14];let p;e[15]!==l||e[16]!==s||e[17]!==i?(p=t.jsx(ks,{checked:s,onCheckedChange:i,disabled:l,className:"mt-0.5"}),e[15]=l,e[16]=s,e[17]=i,e[18]=p):p=e[18];let x;return e[19]!==h||e[20]!==c||e[21]!==p?(x=t.jsxs("label",{className:h,children:[c,p]}),e[19]=h,e[20]=c,e[21]=p,e[22]=x):x=e[22],x}function Wa(a){const e=G.c(35),{activeTab:n,onTabChange:s,showSelectAll:i,isAllSelected:l,handleSelectAll:o}=a,r=X();let h;e[0]!==r?(h=r("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=r,e[1]=h):h=e[1];let d;e[2]!==h?(d={id:"tools",label:h},e[2]=h,e[3]=d):d=e[3];let m;e[4]!==r?(m=r("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=r,e[5]=m):m=e[5];let f;e[6]!==m?(f={id:"active",label:m},e[6]=m,e[7]=f):f=e[7];let u;e[8]!==r?(u=r("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=r,e[9]=u):u=e[9];let c;e[10]!==u?(c={id:"resources",label:u},e[10]=u,e[11]=c):c=e[11];let p;e[12]!==r?(p=r("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=r,e[13]=p):p=e[13];let x;e[14]!==p?(x={id:"prompts",label:p},e[14]=p,e[15]=x):x=e[15];let g;e[16]!==d||e[17]!==f||e[18]!==c||e[19]!==x?(g=[d,f,c,x],e[16]=d,e[17]=f,e[18]=c,e[19]=x,e[20]=g):g=e[20];let b;e[21]!==s?(b=S=>s(S),e[21]=s,e[22]=b):b=e[22];let y;e[23]!==n||e[24]!==b||e[25]!==g?(y=t.jsx(bi,{tabs:g,activeTab:n,onTabChange:b}),e[23]=n,e[24]=b,e[25]=g,e[26]=y):y=e[26];let j;e[27]!==o||e[28]!==l||e[29]!==i||e[30]!==r?(j=i&&t.jsx("button",{type:"button",onClick:o,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r(l?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=o,e[28]=l,e[29]=i,e[30]=r,e[31]=j):j=e[31];let v;return e[32]!==y||e[33]!==j?(v=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border shrink-0",children:[y,j]}),e[32]=y,e[33]=j,e[34]=v):v=e[34],v}function Tt(a){const e=G.c(13),{items:n,selections:s,onToggle:i,emptyMessage:l,disabled:o}=a;let r,h,d;if(e[0]!==o||e[1]!==l||e[2]!==n||e[3]!==i||e[4]!==s){d=Symbol.for("react.early_return_sentinel");e:{const f=n.map(Ga);if(n.length===0){let u;e[8]!==l?(u=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:l})}),e[8]=l,e[9]=u):u=e[9],d=u;break e}r="flex-1 overflow-auto px-4 py-3 space-y-1",h=n.map(u=>t.jsx(Us,{item:u,isSelected:s===null||s?.includes(u.id),onToggle:()=>i(u.id,f),disabled:o},u.id))}e[0]=o,e[1]=l,e[2]=n,e[3]=i,e[4]=s,e[5]=r,e[6]=h,e[7]=d}else r=e[5],h=e[6],d=e[7];if(d!==Symbol.for("react.early_return_sentinel"))return d;let m;return e[10]!==r||e[11]!==h?(m=t.jsx("div",{className:r,children:h}),e[10]=r,e[11]=h,e[12]=m):m=e[12],m}function Ga(a){return a.id}function Ha(a){const e=G.c(22),{connectionId:n,toolSelections:s,onToggleTool:i}=a,l=X(),{org:o}=Ae();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=mt(r);let d;e[4]!==h?(d={client:h},e[4]=h,e[5]=d):d=e[5];const{data:m}=Ts(d),f=m.tools;let u,c,p;if(e[6]!==m.tools||e[7]!==i||e[8]!==l||e[9]!==s){p=Symbol.for("react.early_return_sentinel");e:{const g=f.map(Qa);let b;e[13]!==s?(b=v=>s===null||s.includes(v.name),e[13]=s,e[14]=b):b=e[14];const j=m.tools.filter(b).map(qa);if(j.length===0){let v;e[15]!==l?(v=l("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=l,e[16]=v):v=e[16];let S;e[17]!==v?(S=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:v})}),e[17]=v,e[18]=S):S=e[18],p=S;break e}u="flex-1 overflow-auto px-4 py-3 space-y-1",c=j.map(v=>t.jsx(Us,{item:v,isSelected:!0,onToggle:()=>i(v.id,g)},v.id))}e[6]=m.tools,e[7]=i,e[8]=l,e[9]=s,e[10]=u,e[11]=c,e[12]=p}else u=e[10],c=e[11],p=e[12];if(p!==Symbol.for("react.early_return_sentinel"))return p;let x;return e[19]!==u||e[20]!==c?(x=t.jsx("div",{className:u,children:c}),e[19]=u,e[20]=c,e[21]=x):x=e[21],x}function qa(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(_s,{annotations:a.annotations,_meta:a._meta})}}function Qa(a){return a.name}function Xa(a){const e=G.c(16),{connectionId:n,selections:s,onToggle:i,disabled:l}=a,{org:o}=Ae();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=mt(r);let d;e[4]!==h?(d={client:h},e[4]=h,e[5]=d):d=e[5];const{data:m}=Ts(d);let f;e[6]!==m.tools?(f=m.tools.map(Ja),e[6]=m.tools,e[7]=f):f=e[7];const u=f,c=X();let p;e[8]!==c?(p=c("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=c,e[9]=p):p=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==s||e[14]!==p?(x=t.jsx(Tt,{items:u,selections:s,onToggle:i,emptyMessage:p,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=s,e[14]=p,e[15]=x):x=e[15],x}function Ja(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(_s,{annotations:a.annotations,_meta:a._meta})}}function Za(a){const e=G.c(16),{connectionId:n,selections:s,onToggle:i,disabled:l}=a,{org:o}=Ae();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=mt(r);let d;e[4]!==h?(d={client:h},e[4]=h,e[5]=d):d=e[5];const{data:m}=Qs(d);let f;e[6]!==m.resources?(f=m.resources.map(el),e[6]=m.resources,e[7]=f):f=e[7];const u=f,c=X();let p;e[8]!==c?(p=c("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=c,e[9]=p):p=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==s||e[14]!==p?(x=t.jsx(Tt,{items:u,selections:s,onToggle:i,emptyMessage:p,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=s,e[14]=p,e[15]=x):x=e[15],x}function el(a){return{id:a.name||a.uri,name:a.name||a.uri,description:a.description}}function tl(a){const e=G.c(16),{connectionId:n,selections:s,onToggle:i,disabled:l}=a,{org:o}=Ae();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=mt(r);let d;e[4]!==h?(d={client:h},e[4]=h,e[5]=d):d=e[5];const{data:m}=ji(d);let f;e[6]!==m.prompts?(f=m.prompts.map(sl),e[6]=m.prompts,e[7]=f):f=e[7];const u=f,c=X();let p;e[8]!==c?(p=c("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=c,e[9]=p):p=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==s||e[14]!==p?(x=t.jsx(Tt,{items:u,selections:s,onToggle:i,emptyMessage:p,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=s,e[14]=p,e[15]=x):x=e[15],x}function sl(a){return{id:a.name,name:a.name,description:a.description}}function nl(a){const e=G.c(58),{currentConnection:n,activeTab:s,selectedId:i,formData:l,toggleTool:o,toggleResource:r,togglePrompt:h,toggleAllTools:d,toggleAllResources:m,toggleAllPrompts:f,onTabChange:u}=a,c=X(),p=l[i],x=s==="tools"?p?.tools===null:s==="resources"?p?.resources===null:s==="prompts"?p?.prompts===null:!1,g=s!=="active";let b;e[0]!==s||e[1]!==i||e[2]!==f||e[3]!==m||e[4]!==d?(b=()=>{s==="tools"?d(i):s==="resources"?m(i):s==="prompts"&&f(i)},e[0]=s,e[1]=i,e[2]=f,e[3]=m,e[4]=d,e[5]=b):b=e[5];const y=b;let j;e[6]!==n.icon||e[7]!==n.title?(j=t.jsx(Ge,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0"}),e[6]=n.icon,e[7]=n.title,e[8]=j):j=e[8];let v;e[9]!==n.title?(v=t.jsx("h2",{className:"text-base font-semibold truncate",children:n.title}),e[9]=n.title,e[10]=v):v=e[10];let S;e[11]!==n.description?(S=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[11]=n.description,e[12]=S):S=e[12];let N;e[13]!==v||e[14]!==S?(N=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,S]}),e[13]=v,e[14]=S,e[15]=N):N=e[15];let M;e[16]!==j||e[17]!==N?(M=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[j,N]})}),e[16]=j,e[17]=N,e[18]=M):M=e[18];let w;e[19]!==s||e[20]!==y||e[21]!==x||e[22]!==u||e[23]!==g?(w=t.jsx(Wa,{activeTab:s,onTabChange:u,showSelectAll:g,isAllSelected:x,handleSelectAll:y}),e[19]=s,e[20]=y,e[21]=x,e[22]=u,e[23]=g,e[24]=w):w=e[24];let C;e[25]!==s||e[26]!==l||e[27]!==i||e[28]!==c||e[29]!==o?(C=s==="active"&&t.jsx(Re,{fallback:nt(c("virtualMcp.dependencySelectionDialog.toolsNotSupported"),c),children:t.jsx(W.Suspense,{fallback:t.jsx(qe,{}),children:t.jsx(Ha,{connectionId:i,toolSelections:l[i]?l[i].tools:[],onToggleTool:(z,P)=>o(i,z,P)})})}),e[25]=s,e[26]=l,e[27]=i,e[28]=c,e[29]=o,e[30]=C):C=e[30];let k;e[31]!==s||e[32]!==l||e[33]!==i||e[34]!==c||e[35]!==o?(k=s==="tools"&&t.jsx(Re,{fallback:nt(c("virtualMcp.dependencySelectionDialog.toolsNotSupported"),c),children:t.jsx(W.Suspense,{fallback:t.jsx(qe,{}),children:t.jsx(Xa,{connectionId:i,selections:l[i]?l[i].tools:[],onToggle:(z,P)=>o(i,z,P)})})}),e[31]=s,e[32]=l,e[33]=i,e[34]=c,e[35]=o,e[36]=k):k=e[36];let T;e[37]!==s||e[38]!==l||e[39]!==i||e[40]!==c||e[41]!==r?(T=s==="resources"&&t.jsx(Re,{fallback:nt(c("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),c),children:t.jsx(W.Suspense,{fallback:t.jsx(qe,{}),children:t.jsx(Za,{connectionId:i,selections:l[i]?l[i].resources:[],onToggle:(z,P)=>r(i,z,P)})})}),e[37]=s,e[38]=l,e[39]=i,e[40]=c,e[41]=r,e[42]=T):T=e[42];let V;e[43]!==s||e[44]!==l||e[45]!==i||e[46]!==c||e[47]!==h?(V=s==="prompts"&&t.jsx(Re,{fallback:nt(c("virtualMcp.dependencySelectionDialog.promptsNotSupported"),c),children:t.jsx(W.Suspense,{fallback:t.jsx(qe,{}),children:t.jsx(tl,{connectionId:i,selections:l[i]?l[i].prompts:[],onToggle:(z,P)=>h(i,z,P)})})}),e[43]=s,e[44]=l,e[45]=i,e[46]=c,e[47]=h,e[48]=V):V=e[48];let A;e[49]!==T||e[50]!==V||e[51]!==C||e[52]!==k?(A=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[C,k,T,V]}),e[49]=T,e[50]=V,e[51]=C,e[52]=k,e[53]=A):A=e[53];let D;return e[54]!==A||e[55]!==M||e[56]!==w?(D=t.jsxs(t.Fragment,{children:[M,w,A]}),e[54]=A,e[55]=M,e[56]=w,e[57]=D):D=e[57],D}function il(a){const e=G.c(7),{onClose:n}=a,s=X();let i;e[0]!==n?(i=()=>n(!1),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==s?(l=s("virtualMcp.dependencySelectionDialog.done"),e[2]=s,e[3]=l):l=e[3];let o;return e[4]!==i||e[5]!==l?(o=t.jsx(ws,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(te,{variant:"outline",onClick:i,children:l})}),e[4]=i,e[5]=l,e[6]=o):o=e[6],o}function al(a){const e=G.c(23),{connectionId:n,onAuthenticate:s,children:i}=a,l=X();let o;e[0]!==n?(o={connectionId:n},e[0]=n,e[1]=o):o=e[1];const r=Vs(o);if(r.supportsOAuth&&!r.isAuthenticated){let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-muted",children:t.jsx(Wn,{size:22,className:"text-muted-foreground"})}),e[2]=m):m=e[2];let f;e[3]!==l?(f=l("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=l,e[4]=f):f=e[4];let u;e[5]!==f?(u=t.jsx("p",{className:"text-sm font-medium",children:f}),e[5]=f,e[6]=u):u=e[6];let c;e[7]!==l?(c=l("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=l,e[8]=c):c=e[8];let p;e[9]!==c?(p=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:c}),e[9]=c,e[10]=p):p=e[10];let x;e[11]!==u||e[12]!==p?(x=t.jsxs("div",{className:"space-y-1",children:[u,p]}),e[11]=u,e[12]=p,e[13]=x):x=e[13];let g;e[14]!==n||e[15]!==s||e[16]!==l?(g=s&&t.jsx(te,{variant:"outline",size:"sm",onClick:()=>s(n),children:l("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=n,e[15]=s,e[16]=l,e[17]=g):g=e[17];let b;return e[18]!==x||e[19]!==g?(b=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-8 text-center",children:[m,x,g]}),e[18]=x,e[19]=g,e[20]=b):b=e[20],b}let d;return e[21]!==i?(d=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=d):d=e[22],d}function ll(a){const e={};for(const n of a)e[n.connection_id]={tools:n.selected_tools,resources:n.selected_resources??null,prompts:n.selected_prompts??null};return e}function ss(a){return Object.entries(a).map(([e,n])=>({connection_id:e,selected_tools:n.tools,selected_resources:n.resources,selected_prompts:n.prompts}))}function ns(a,e,n,s){const i=a[e]??{tools:null,resources:null,prompts:null};return{...a,[e]:{...i,[n]:s}}}function rl(a,e){return e.type==="SET_ACTIVE_TAB"?{...a,activeTab:e.payload}:a}function ol(a){const e=G.c(49),{open:n,onOpenChange:s,selectedId:i,form:l,connections:o,onAuthenticate:r}=a;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activeTab:"tools"},e[0]=h):h=e[0];const[d,m]=W.useReducer(rl,h),f=Mt(i??"");let u;e[1]!==o?(u=o??[],e[1]=o,e[2]=u):u=e[2];let c;e[3]!==u?(c=ll(u),e[3]=u,e[4]=c):c=e[4];const p=c;let x;e[5]!==l||e[6]!==p?(x=(U,_,E,q)=>{const L=p[U]?.[_];let R;L===null?R=q.filter(K=>K!==E):L?.includes(E)?R=L.filter(K=>K!==E):(R=[...L??[],E],R.length===q.length&&(R=null)),l.setValue("connections",ss(ns(p,U,_,R)),{shouldDirty:!0,shouldTouch:!0})},e[5]=l,e[6]=p,e[7]=x):x=e[7];const g=x;let b;e[8]!==l||e[9]!==p?(b=(U,_)=>{const q=p[U]?.[_]===null?[]:null;l.setValue("connections",ss(ns(p,U,_,q)),{shouldDirty:!0,shouldTouch:!0})},e[8]=l,e[9]=p,e[10]=b):b=e[10];const y=b;let j;e[11]!==g?(j=(U,_,E)=>g(U,"tools",_,E),e[11]=g,e[12]=j):j=e[12];const v=j;let S;e[13]!==g?(S=(U,_,E)=>g(U,"resources",_,E),e[13]=g,e[14]=S):S=e[14];const N=S;let M;e[15]!==g?(M=(U,_,E)=>g(U,"prompts",_,E),e[15]=g,e[16]=M):M=e[16];const w=M;let C;e[17]!==y?(C=U=>y(U,"tools"),e[17]=y,e[18]=C):C=e[18];const k=C;let T;e[19]!==y?(T=U=>y(U,"resources"),e[19]=y,e[20]=T):T=e[20];const V=T;let A;e[21]!==y?(A=U=>y(U,"prompts"),e[21]=y,e[22]=A):A=e[22];const D=A;if(!i||!f)return null;let z;e[23]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(qe,{}),e[23]=z):z=e[23];let P;e[24]===Symbol.for("react.memo_cache_sentinel")?(P=U=>m({type:"SET_ACTIVE_TAB",payload:U}),e[24]=P):P=e[24];let $;e[25]!==f||e[26]!==d.activeTab||e[27]!==p||e[28]!==i||e[29]!==D||e[30]!==V||e[31]!==k||e[32]!==w||e[33]!==N||e[34]!==v?($=t.jsx(nl,{currentConnection:f,activeTab:d.activeTab,selectedId:i,formData:p,toggleTool:v,toggleResource:N,togglePrompt:w,toggleAllTools:k,toggleAllResources:V,toggleAllPrompts:D,onTabChange:P},i),e[25]=f,e[26]=d.activeTab,e[27]=p,e[28]=i,e[29]=D,e[30]=V,e[31]=k,e[32]=w,e[33]=N,e[34]=v,e[35]=$):$=e[35];let F;e[36]!==r||e[37]!==i||e[38]!==$?(F=t.jsx(W.Suspense,{fallback:z,children:t.jsx(al,{connectionId:i,onAuthenticate:r,children:$})}),e[36]=r,e[37]=i,e[38]=$,e[39]=F):F=e[39];let H;e[40]!==s?(H=t.jsx(il,{onClose:s}),e[40]=s,e[41]=H):H=e[41];let B;e[42]!==F||e[43]!==H?(B=t.jsxs(Ze,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[F,H]}),e[42]=F,e[43]=H,e[44]=B):B=e[44];let Y;return e[45]!==s||e[46]!==n||e[47]!==B?(Y=t.jsx(Je,{open:n,onOpenChange:s,children:B}),e[45]=s,e[46]=n,e[47]=B,e[48]=Y):Y=e[48],Y}const is="__new_instance__";function cl(a){const e=G.c(25),{connection_id:n,usedConnectionIds:s,onOpenSettings:i,onRemove:l,onAuthenticate:o,onSwitchInstance:r,onNewInstance:h}=a,d=Mt(n),{org:m}=Ae();if(!d){let g;return e[0]!==l?(g=t.jsx(fl,{onRemove:l}),e[0]=l,e[1]=g):g=e[1],g}let f;e[2]!==d?(f=yi(d),e[2]=d,e[3]=f):f=e[3];const u=f;let c;e[4]!==n?(c=t.jsx(ml,{connection_id:n}),e[4]=n,e[5]=c):c=e[5];let p;e[6]!==d.app_name||e[7]!==d.connection_type||e[8]!==d.description||e[9]!==d.icon||e[10]!==d.status||e[11]!==d.title||e[12]!==n||e[13]!==o||e[14]!==h||e[15]!==i||e[16]!==l||e[17]!==r||e[18]!==m.slug||e[19]!==u||e[20]!==s?(p=t.jsx(ul,{connection_id:n,connectionTitle:d.title,connectionDescription:d.description,connectionIcon:d.icon,connectionType:d.connection_type,connectionStatus:d.status,slug:u,orgSlug:m.slug,appName:d.app_name,usedConnectionIds:s,onOpenSettings:i,onRemove:l,onAuthenticate:o,onSwitchInstance:r,onNewInstance:h}),e[6]=d.app_name,e[7]=d.connection_type,e[8]=d.description,e[9]=d.icon,e[10]=d.status,e[11]=d.title,e[12]=n,e[13]=o,e[14]=h,e[15]=i,e[16]=l,e[17]=r,e[18]=m.slug,e[19]=u,e[20]=s,e[21]=p):p=e[21];let x;return e[22]!==c||e[23]!==p?(x=t.jsx(W.Suspense,{fallback:c,children:p}),e[22]=c,e[23]=p,e[24]=x):x=e[24],x}function dl(a){const e=G.c(24),{appName:n,connectionId:s,usedConnectionIds:i,onSwitchInstance:l,onNewInstance:o}=a,r=X();let h;e[0]!==n?(h={filters:[{column:"app_name",value:n}]},e[0]=n,e[1]=h):h=e[1];const d=Dn(h);if(d.length<=1&&!o)return null;let m;e[2]!==s||e[3]!==o||e[4]!==l?(m=g=>{g===is?o?.():l(s,g)},e[2]=s,e[3]=o,e[4]=l,e[5]=m):m=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(_e,{size:"sm",className:"w-auto text-xs gap-1 px-2 shadow-none",children:t.jsx(Ve,{})}),e[6]=f):f=e[6];let u;if(e[7]!==s||e[8]!==d||e[9]!==i){let g;e[11]!==s||e[12]!==i?(g=b=>t.jsx(ge,{value:b.id,className:"text-xs",disabled:b.id!==s&&i.has(b.id),children:b.title},b.id),e[11]=s,e[12]=i,e[13]=g):g=e[13],u=d.map(g),e[7]=s,e[8]=d,e[9]=i,e[10]=u}else u=e[10];let c;e[14]!==o||e[15]!==r?(c=o&&t.jsxs(ge,{value:is,className:"text-xs text-muted-foreground",children:["+ ",r("virtualMcp.connectionItem.newInstance")]}),e[14]=o,e[15]=r,e[16]=c):c=e[16];let p;e[17]!==u||e[18]!==c?(p=t.jsxs(Te,{children:[u,c]}),e[17]=u,e[18]=c,e[19]=p):p=e[19];let x;return e[20]!==s||e[21]!==m||e[22]!==p?(x=t.jsxs(De,{value:s,onValueChange:m,children:[f,p]}),e[20]=s,e[21]=m,e[22]=p,e[23]=x):x=e[23],x}function ul({connection_id:a,connectionTitle:e,connectionDescription:n,connectionIcon:s,connectionType:i,connectionStatus:l,slug:o,orgSlug:r,appName:h,usedConnectionIds:d,onOpenSettings:m,onRemove:f,onAuthenticate:u,onSwitchInstance:c,onNewInstance:p}){const x=Vs({connectionId:a}),g=gs(),y=!(i==="VIRTUAL")&&x.supportsOAuth&&!x.isAuthenticated,j=l!=="active",v=X(),S=async N=>{try{await g.update.mutateAsync({id:a,data:{status:N}}),re.success(v(N==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{re.error(v("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:xe("rounded-xl border overflow-hidden transition-colors",y||j?"border-destructive/50 bg-destructive/5":"border-border bg-card"),children:[t.jsxs(ps,{to:"/$org/settings/connections/$appSlug",params:{org:r,appSlug:o},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors",children:[t.jsx(Ge,{icon:s,name:e,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:e}),y?t.jsx("span",{className:"text-xs text-destructive font-medium",children:v("virtualMcp.connectionItem.needsAuthorization")}):j?t.jsx("span",{className:"text-xs text-destructive font-medium",children:v(l==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):n&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n})]}),y?t.jsx(te,{variant:"outline",size:"sm",className:"h-7 text-xs shrink-0",onClick:N=>{N.preventDefault(),N.stopPropagation(),u(a)},children:v("virtualMcp.connectionItem.authorize")}):j?t.jsxs(te,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:N=>{N.preventDefault(),N.stopPropagation(),S("active")},children:[t.jsx(Gn,{size:13}),v("virtualMcp.connectionItem.enable")]}):t.jsxs(we,{delayDuration:0,children:[t.jsx(Se,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center rounded-md h-7 w-7 hover:bg-accent text-muted-foreground shrink-0 transition-colors",children:t.jsx(mi,{size:16})})}),t.jsx(Ne,{side:"bottom",children:v("virtualMcp.connectionItem.connectionSettings")})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-t border-border bg-muted/25",children:[h&&t.jsx(dl,{appName:h,connectionId:a,usedConnectionIds:d,onSwitchInstance:c,onNewInstance:p}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(we,{delayDuration:0,children:[t.jsx(Se,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:m,"aria-label":v("virtualMcp.connectionItem.configureResources"),children:t.jsx(Hn,{size:13})})}),t.jsx(Ne,{side:"bottom",children:v("virtualMcp.connectionItem.configureResources")})]}),!j&&t.jsxs(we,{delayDuration:0,children:[t.jsx(Se,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>S("inactive"),"aria-label":v("virtualMcp.connectionItem.disableConnection"),children:t.jsx(qn,{size:13})})}),t.jsx(Ne,{side:"bottom",children:v("virtualMcp.connectionItem.disable")})]}),t.jsxs(we,{delayDuration:0,children:[t.jsx(Se,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:f,"aria-label":v("virtualMcp.connectionItem.removeConnection"),children:t.jsx(_t,{size:13})})}),t.jsx(Ne,{side:"bottom",children:v("virtualMcp.connectionItem.remove")})]})]})]})]})}function ml(a){const e=G.c(17),{connection_id:n}=a,s=Mt(n);if(!s){let f;return e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ys,{}),e[0]=f):f=e[0],f}let i;e[1]!==s.icon||e[2]!==s.title?(i=t.jsx(Ge,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0"}),e[1]=s.icon,e[2]=s.title,e[3]=i):i=e[3];let l;e[4]!==s.title?(l=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[4]=s.title,e[5]=l):l=e[5];let o;e[6]!==s.description?(o=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[6]=s.description,e[7]=o):o=e[7];let r;e[8]!==l||e[9]!==o?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,o]}),e[8]=l,e[9]=o,e[10]=r):r=e[10];let h;e[11]!==i||e[12]!==r?(h=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,r]}),e[11]=i,e[12]=r,e[13]=h):h=e[13];let d;e[14]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})}),e[14]=d):d=e[14];let m;return e[15]!==h?(m=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[h,d]}),e[15]=h,e[16]=m):m=e[16],m}function fl(a){const e=G.c(20),{onRemove:n}=a,s=X();let i;e[0]!==s?(i=s("virtualMcp.connectionItem.connectionNotFound"),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==i?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm text-destructive font-medium truncate",children:i})}),e[2]=i,e[3]=l):l=e[3];let o;e[4]!==s?(o=s("virtualMcp.connectionItem.removeConnection"),e[4]=s,e[5]=o):o=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(_t,{size:13}),e[6]=r):r=e[6];let h;e[7]!==n||e[8]!==o?(h=t.jsx(Se,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive shrink-0",onClick:n,"aria-label":o,children:r})}),e[7]=n,e[8]=o,e[9]=h):h=e[9];let d;e[10]!==s?(d=s("virtualMcp.connectionItem.remove"),e[10]=s,e[11]=d):d=e[11];let m;e[12]!==d?(m=t.jsx(Ne,{side:"bottom",children:d}),e[12]=d,e[13]=m):m=e[13];let f;e[14]!==h||e[15]!==m?(f=t.jsxs(we,{delayDuration:0,children:[h,m]}),e[14]=h,e[15]=m,e[16]=f):f=e[16];let u;return e[17]!==l||e[18]!==f?(u=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-destructive/50 bg-destructive/5",children:[l,f]}),e[17]=l,e[18]=f,e[19]=u):u=e[19],u}function Ys(){const a=G.c(3);let e;a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),a[0]=e):e=a[0];let n;a[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e,t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-48 rounded bg-muted animate-pulse"})]})]}),a[1]=n):n=a[1];let s;return a[2]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[n,t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})})]}),a[2]=s):s=a[2],s}function Bs(a){const e=G.c(85),{value:n,onChange:s,onColorChange:i,name:l,size:o,className:r,avatarClassName:h,showHoverOverlay:d,disabled:m}=a,f=o===void 0?"lg":o,u=d===void 0?!0:d,c=m===void 0?!1:m,p=X(),[x,g]=W.useState(!1),[b,y]=W.useState("icons"),[j,v]=W.useState(""),[S,N]=W.useState("blue");let M;e[0]!==n?(M=Qn(n),e[0]=n,e[1]=M):M=e[1];const w=M,C=w.type==="icon"||w.type==="url"&&w.color?w.color:S;let k;e[2]!==s||e[3]!==C?(k=ce=>{s(xt(ce,C))},e[2]=s,e[3]=C,e[4]=k):k=e[4];const T=k;let V;e[5]!==s||e[6]!==i||e[7]!==w.name||e[8]!==w.type||e[9]!==w.url?(V=ce=>{N(ce),i?.(ce),w.type==="icon"?s(xt(w.name,ce)):w.type==="url"&&s(Lt(w.url,ce))},e[5]=s,e[6]=i,e[7]=w.name,e[8]=w.type,e[9]=w.url,e[10]=V):V=e[10];const A=V;let D;e[11]!==s||e[12]!==C?(D=ce=>{s(Lt(ce,C)),g(!1)},e[11]=s,e[12]=C,e[13]=D):D=e[13];const z=D;let P;e[14]!==s||e[15]!==C?(P=()=>{const ce=Ss(),me=ce[Math.floor(Math.random()*ce.length)];s(xt(me,C))},e[14]=s,e[15]=C,e[16]=P):P=e[16];const $=P,F=c?!1:x;let H;e[17]!==p?(H=p("common.iconPicker.changeIcon"),e[17]=p,e[18]=H):H=e[18];const B=c?"cursor-default opacity-50":"cursor-pointer";let Y;e[19]!==r||e[20]!==f||e[21]!==B?(Y=xe("relative group overflow-hidden",B,Xn(f),r),e[19]=r,e[20]=f,e[21]=B,e[22]=Y):Y=e[22];let U;e[23]!==h||e[24]!==l||e[25]!==f||e[26]!==n?(U=t.jsx(Ut,{icon:n,name:l,size:f,className:h}),e[23]=h,e[24]=l,e[25]=f,e[26]=n,e[27]=U):U=e[27];let _;e[28]!==c||e[29]!==u?(_=u&&!c&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(ti,{size:16,className:"text-white"})}),e[28]=c,e[29]=u,e[30]=_):_=e[30];let E;e[31]!==c||e[32]!==H||e[33]!==Y||e[34]!==U||e[35]!==_?(E=t.jsx(Ds,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":H,disabled:c,className:Y,children:[U,_]})}),e[31]=c,e[32]=H,e[33]=Y,e[34]=U,e[35]=_,e[36]=E):E=e[36];let q;e[37]!==l||e[38]!==n?(q=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(Ut,{icon:n,name:l,size:"xl"})}),e[37]=l,e[38]=n,e[39]=q):q=e[39];let L;e[40]!==b?(L=ce=>{if(ce.key!=="ArrowLeft"&&ce.key!=="ArrowRight")return;ce.preventDefault();const me=b==="icons"?"upload":"icons";y(me),document.getElementById(`icon-picker-tab-${me}`)?.focus()},e[40]=b,e[41]=L):L=e[41];const R=b==="icons",K=b==="icons"?0:-1;let Z;e[42]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>y("icons"),e[42]=Z):Z=e[42];const ae=b==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let ee;e[43]!==ae?(ee=xe("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",ae),e[43]=ae,e[44]=ee):ee=e[44];let de;e[45]!==p?(de=p("common.iconPicker.iconsTab"),e[45]=p,e[46]=de):de=e[46];let oe;e[47]!==R||e[48]!==K||e[49]!==ee||e[50]!==de?(oe=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":R,"aria-controls":"icon-picker-panel-icons",tabIndex:K,onClick:Z,className:ee,children:de}),e[47]=R,e[48]=K,e[49]=ee,e[50]=de,e[51]=oe):oe=e[51];const ue=b==="upload",se=b==="upload"?0:-1;let fe;e[52]===Symbol.for("react.memo_cache_sentinel")?(fe=()=>y("upload"),e[52]=fe):fe=e[52];const ve=b==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let Ce;e[53]!==ve?(Ce=xe("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",ve),e[53]=ve,e[54]=Ce):Ce=e[54];let O;e[55]!==p?(O=p("common.iconPicker.uploadTab"),e[55]=p,e[56]=O):O=e[56];let ne;e[57]!==ue||e[58]!==se||e[59]!==Ce||e[60]!==O?(ne=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":ue,"aria-controls":"icon-picker-panel-upload",tabIndex:se,onClick:fe,className:Ce,children:O}),e[57]=ue,e[58]=se,e[59]=Ce,e[60]=O,e[61]=ne):ne=e[61];let Q;e[62]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx("div",{className:"flex-1"}),e[62]=Q):Q=e[62];let ie;e[63]!==L||e[64]!==oe||e[65]!==ne?(ie=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:L,children:[oe,ne,Q]}),e[63]=L,e[64]=oe,e[65]=ne,e[66]=ie):ie=e[66];let I;e[67]!==A||e[68]!==$||e[69]!==T||e[70]!==z||e[71]!==w.name||e[72]!==w.type||e[73]!==j||e[74]!==C||e[75]!==b?(I=b==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(gl,{search:j,onSearchChange:v,selectedColor:C,onColorChange:A,onSelectIcon:T,onRandom:$,currentIconName:w.type==="icon"?w.name:null})}):t.jsx("div",{id:"icon-picker-panel-upload",role:"tabpanel","aria-labelledby":"icon-picker-tab-upload",children:t.jsx(vl,{onUpload:z})}),e[67]=A,e[68]=$,e[69]=T,e[70]=z,e[71]=w.name,e[72]=w.type,e[73]=j,e[74]=C,e[75]=b,e[76]=I):I=e[76];let J;e[77]!==q||e[78]!==ie||e[79]!==I?(J=t.jsx(As,{align:"start",className:"w-80 p-0",onOpenAutoFocus:pl,children:t.jsxs("div",{className:"flex flex-col",children:[q,ie,I]})}),e[77]=q,e[78]=ie,e[79]=I,e[80]=J):J=e[80];let be;return e[81]!==E||e[82]!==J||e[83]!==F?(be=t.jsxs(Is,{open:F,onOpenChange:g,children:[E,J]}),e[81]=E,e[82]=J,e[83]=F,e[84]=be):be=e[84],be}function pl(a){return a.preventDefault()}function hl(a){const e=G.c(33),{selectedColor:n,onColorChange:s}=a,i=X(),[l,o]=W.useState(!1);let r,h,d,m,f,u,c;if(e[0]!==l||e[1]!==n){const S=Ns(n);h=Is,u=l,c=o,r=Ds,f=!0,d="button",m=xe("h-6 w-6 rounded-full shrink-0 ring-2 ring-offset-2 ring-offset-background transition-all cursor-pointer hover:scale-110",S.dot,"ring-foreground/20"),e[0]=l,e[1]=n,e[2]=r,e[3]=h,e[4]=d,e[5]=m,e[6]=f,e[7]=u,e[8]=c}else r=e[2],h=e[3],d=e[4],m=e[5],f=e[6],u=e[7],c=e[8];let p;e[9]!==i?(p=i("common.iconPicker.changeColor"),e[9]=i,e[10]=p):p=e[10];let x;e[11]!==i?(x=i("common.iconPicker.changeColor"),e[11]=i,e[12]=x):x=e[12];let g;e[13]!==d||e[14]!==m||e[15]!==p||e[16]!==x?(g=t.jsx("button",{type:d,className:m,title:p,"aria-label":x}),e[13]=d,e[14]=m,e[15]=p,e[16]=x,e[17]=g):g=e[17];let b;e[18]!==r||e[19]!==f||e[20]!==g?(b=t.jsx(r,{asChild:f,children:g}),e[18]=r,e[19]=f,e[20]=g,e[21]=b):b=e[21];let y;e[22]!==s||e[23]!==n?(y=ni.map(S=>t.jsx("button",{type:"button",onClick:()=>{s(S.name),o(!1)},className:xe("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",S.dot,n===S.name?"ring-2 ring-offset-1 ring-offset-background ring-foreground/30 scale-110":"hover:scale-110"),title:S.name,"aria-label":S.name},S.name)),e[22]=s,e[23]=n,e[24]=y):y=e[24];let j;e[25]!==y?(j=t.jsx(As,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:xl,children:t.jsx("div",{className:"grid grid-cols-4 gap-1",children:y})}),e[25]=y,e[26]=j):j=e[26];let v;return e[27]!==h||e[28]!==j||e[29]!==u||e[30]!==c||e[31]!==b?(v=t.jsxs(h,{open:u,onOpenChange:c,children:[b,j]}),e[27]=h,e[28]=j,e[29]=u,e[30]=c,e[31]=b,e[32]=v):v=e[32],v}function xl(a){return a.preventDefault()}function gl(a){const e=G.c(55),{search:n,onSearchChange:s,selectedColor:i,onColorChange:l,onSelectIcon:o,onRandom:r,currentIconName:h}=a,d=X();let m,f,u,c,p,x,g;if(e[0]!==h||e[1]!==l||e[2]!==r||e[3]!==s||e[4]!==o||e[5]!==n||e[6]!==i||e[7]!==d){const S=Ss(),N=Ns(i);f=Jn(S,n),x="flex flex-col";let M;e[15]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(yt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=M):M=e[15];let w;e[16]!==s?(w=P=>s(P.target.value),e[16]=s,e[17]=w):w=e[17];let C;e[18]!==d?(C=d("common.iconPicker.filterPlaceholder"),e[18]=d,e[19]=C):C=e[19];let k;e[20]!==n||e[21]!==w||e[22]!==C?(k=t.jsxs("div",{className:"relative flex-1",children:[M,t.jsx(ke,{value:n,onChange:w,placeholder:C,className:"h-8 text-xs pl-7"})]}),e[20]=n,e[21]=w,e[22]=C,e[23]=k):k=e[23];let T;e[24]!==d?(T=d("common.iconPicker.randomIcon"),e[24]=d,e[25]=T):T=e[25];let V;e[26]!==d?(V=d("common.iconPicker.randomIcon"),e[26]=d,e[27]=V):V=e[27];let A;e[28]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(si,{size:14,className:"text-muted-foreground"}),e[28]=A):A=e[28];let D;e[29]!==r||e[30]!==T||e[31]!==V?(D=t.jsx("button",{type:"button",onClick:r,className:"h-8 w-8 flex items-center justify-center rounded-lg border border-border hover:bg-accent transition-colors shrink-0",title:T,"aria-label":V,children:A}),e[29]=r,e[30]=T,e[31]=V,e[32]=D):D=e[32];let z;e[33]!==l||e[34]!==i?(z=t.jsx(hl,{selectedColor:i,onColorChange:l}),e[33]=l,e[34]=i,e[35]=z):z=e[35],e[36]!==D||e[37]!==z||e[38]!==k?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[k,D,z]}),e[36]=D,e[37]=z,e[38]=k,e[39]=g):g=e[39],m=wi,p="h-56",u="grid grid-cols-9 gap-0.5 px-2 pb-2",c=f.map(P=>{const $=Zn(P);return $?t.jsx("button",{type:"button",onClick:()=>o(P),className:xe("h-8 w-8 flex items-center justify-center rounded-lg transition-colors cursor-pointer",h===P?xe(N.bg,N.text):xe(N.text,"hover:bg-accent")),title:P,"aria-label":ei(P),children:t.jsx($,{size:18})},P):null}),e[0]=h,e[1]=l,e[2]=r,e[3]=s,e[4]=o,e[5]=n,e[6]=i,e[7]=d,e[8]=m,e[9]=f,e[10]=u,e[11]=c,e[12]=p,e[13]=x,e[14]=g}else m=e[8],f=e[9],u=e[10],c=e[11],p=e[12],x=e[13],g=e[14];let b;e[40]!==u||e[41]!==c?(b=t.jsx("div",{className:u,children:c}),e[40]=u,e[41]=c,e[42]=b):b=e[42];let y;e[43]!==f.length||e[44]!==d?(y=f.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:d("common.iconPicker.noIconsFound")}),e[43]=f.length,e[44]=d,e[45]=y):y=e[45];let j;e[46]!==m||e[47]!==p||e[48]!==b||e[49]!==y?(j=t.jsxs(m,{className:p,children:[b,y]}),e[46]=m,e[47]=p,e[48]=b,e[49]=y,e[50]=j):j=e[50];let v;return e[51]!==x||e[52]!==g||e[53]!==j?(v=t.jsxs("div",{className:x,children:[g,j]}),e[51]=x,e[52]=g,e[53]=j,e[54]=v):v=e[54],v}function vl(a){const e=G.c(46),{onUpload:n}=a,s=X(),i=W.useRef(null);let l;e[0]!==n||e[1]!==s?(l=D=>{const z=D.target.files?.[0];if(!z)return;if(z.size>2097152){re.error(s("common.iconPicker.imageTooLarge")),D.target.value="";return}const P=new FileReader;P.onerror=()=>{re.error(s("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},P.onloadend=()=>{P.readyState===FileReader.DONE&&P.result&&n(P.result),i.current&&(i.current.value="")},P.readAsDataURL(z)},e[0]=n,e[1]=s,e[2]=l):l=e[2];const o=l,[r,h]=W.useState("");let d;e[3]!==n||e[4]!==r?(d=()=>{const D=r.trim();D&&(n(D),h(""))},e[3]=n,e[4]=r,e[5]=d):d=e[5];const m=d;let f;e[6]!==o?(f=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:o}),e[6]=o,e[7]=f):f=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i.current?.click(),e[8]=u):u=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Si,{size:20}),e[9]=c):c=e[9];let p;e[10]!==s?(p=s("common.iconPicker.uploadHint"),e[10]=s,e[11]=p):p=e[11];let x;e[12]!==p?(x=t.jsxs("button",{type:"button",onClick:u,className:"h-24 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-2 text-muted-foreground hover:text-foreground",children:[c,t.jsx("span",{className:"text-xs",children:p})]}),e[12]=p,e[13]=x):x=e[13];let g;e[14]!==s?(g=s("common.iconPicker.or"),e[14]=s,e[15]=g):g=e[15];let b;e[16]!==g?(b=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[16]=g,e[17]=b):b=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex-1 h-px bg-border"}),e[18]=y):y=e[18];let j;e[19]!==b?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[b,y]}),e[19]=b,e[20]=j):j=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=D=>h(D.target.value),e[21]=v):v=e[21];let S;e[22]!==s?(S=s("common.iconPicker.pasteUrlPlaceholder"),e[22]=s,e[23]=S):S=e[23];let N;e[24]!==m?(N=D=>{D.key==="Enter"&&(D.preventDefault(),m())},e[24]=m,e[25]=N):N=e[25];let M;e[26]!==r||e[27]!==S||e[28]!==N?(M=t.jsx(ke,{value:r,onChange:v,placeholder:S,className:"h-8 text-xs flex-1",onKeyDown:N}),e[26]=r,e[27]=S,e[28]=N,e[29]=M):M=e[29];let w;e[30]!==r?(w=r.trim(),e[30]=r,e[31]=w):w=e[31];const C=!w;let k;e[32]!==s?(k=s("common.iconPicker.apply"),e[32]=s,e[33]=k):k=e[33];let T;e[34]!==m||e[35]!==C||e[36]!==k?(T=t.jsx(te,{variant:"outline",size:"sm",className:"h-8 px-3 text-xs shrink-0",onClick:m,disabled:C,children:k}),e[34]=m,e[35]=C,e[36]=k,e[37]=T):T=e[37];let V;e[38]!==M||e[39]!==T?(V=t.jsxs("div",{className:"flex items-center gap-1.5",children:[M,T]}),e[38]=M,e[39]=T,e[40]=V):V=e[40];let A;return e[41]!==j||e[42]!==V||e[43]!==f||e[44]!==x?(A=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[f,x,j,V]}),e[41]=j,e[42]=V,e[43]=f,e[44]=x,e[45]=A):A=e[45],A}function bl(a){const e=G.c(10),{viewId:n}=a;if(n==="overview"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Cs,{size:16}),e[0]=i):i=e[0],i}if(n==="reports"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Yt,{size:16}),e[1]=i):i=e[1],i}if(n==="board"){let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ii,{size:16}),e[2]=i):i=e[2],i}if(n==="site-editor"){let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Mi,{size:16}),e[3]=i):i=e[3],i}if(n==="assets"){let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ci,{size:16}),e[4]=i):i=e[4],i}if(n==="hosting"){let i;return e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Xs,{size:16}),e[5]=i):i=e[5],i}if(n==="e2e"){let i;return e[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ai,{size:16}),e[6]=i):i=e[6],i}if(n==="analytics"){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Yt,{size:16}),e[7]=i):i=e[7],i}if(n==="cdn"){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(li,{size:16}),e[8]=i):i=e[8],i}let s;return e[9]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Ms,{size:16}),e[9]=s):s=e[9],s}function as(a){const e=G.c(51),{pinned:n,canSetMainView:s,onOpen:i,onTogglePin:l,onSetMainView:o}=a,r=X(),h=n?"text-foreground":"text-muted-foreground/40";let d;e[0]!==h?(d=xe("size-7",h),e[0]=h,e[1]=d):d=e[1];let m;e[2]!==n||e[3]!==r?(m=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=n,e[3]=r,e[4]=m):m=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Bt,{size:16}),e[5]=f):f=e[5];let u;e[6]!==l||e[7]!==n||e[8]!==d||e[9]!==m?(u=t.jsx(Se,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:d,"aria-label":m,"aria-pressed":n,onClick:l,children:f})}),e[6]=l,e[7]=n,e[8]=d,e[9]=m,e[10]=u):u=e[10];let c;e[11]!==n||e[12]!==r?(c=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=n,e[12]=r,e[13]=c):c=e[13];let p;e[14]!==c?(p=t.jsx(Ne,{side:"top",children:c}),e[14]=c,e[15]=p):p=e[15];let x;e[16]!==u||e[17]!==p?(x=t.jsxs(we,{delayDuration:0,children:[u,p]}),e[16]=u,e[17]=p,e[18]=x):x=e[18];let g;e[19]!==r?(g=r("virtualMcp.settings.views.rowActions"),e[19]=r,e[20]=g):g=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Ni,{size:16}),e[21]=b):b=e[21];let y;e[22]!==g?(y=t.jsx(us,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground","aria-label":g,children:b})}),e[22]=g,e[23]=y):y=e[23];let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(Js,{size:14}),e[24]=j):j=e[24];let v;e[25]!==r?(v=r("virtualMcp.settings.views.open"),e[25]=r,e[26]=v):v=e[26];let S;e[27]!==i||e[28]!==v?(S=t.jsxs(Ke,{onClick:i,children:[j,v]}),e[27]=i,e[28]=v,e[29]=S):S=e[29];let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Bt,{size:14}),e[30]=N):N=e[30];let M;e[31]!==n||e[32]!==r?(M=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=n,e[32]=r,e[33]=M):M=e[33];let w;e[34]!==l||e[35]!==M?(w=t.jsxs(Ke,{onClick:l,children:[N,M]}),e[34]=l,e[35]=M,e[36]=w):w=e[36];let C;e[37]!==s||e[38]!==o||e[39]!==r?(C=s&&t.jsxs(Ke,{onClick:o,children:[t.jsx(Cs,{size:14}),r("virtualMcp.settings.views.setMainView")]}),e[37]=s,e[38]=o,e[39]=r,e[40]=C):C=e[40];let k;e[41]!==S||e[42]!==w||e[43]!==C?(k=t.jsxs(ms,{align:"end",children:[S,w,C]}),e[41]=S,e[42]=w,e[43]=C,e[44]=k):k=e[44];let T;e[45]!==y||e[46]!==k?(T=t.jsxs(ds,{children:[y,k]}),e[45]=y,e[46]=k,e[47]=T):T=e[47];let V;return e[48]!==T||e[49]!==x?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[x,T]}),e[48]=T,e[49]=x,e[50]=V):V=e[50],V}const ls=a=>a.stopPropagation();function jl(a){const e=G.c(8),{icon:n,title:s}=a;let i;e[0]!==n||e[1]!==s?(i=t.jsx(Ge,{icon:n,name:s,size:"xs",className:"shrink-0"}),e[0]=n,e[1]=s,e[2]=i):i=e[2];let l;e[3]!==s?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:s}),e[3]=s,e[4]=l):l=e[4];let o;return e[5]!==i||e[6]!==l?(o=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,l]}),e[5]=i,e[6]=l,e[7]=o):o=e[7],o}function yl(a){const e=G.c(70),{views:n}=a,s=X();let i;e[0]!==s?(i=s("virtualMcp.settings.views.defaults"),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==s?(l=s("virtualMcp.layoutTabContent.mainView"),e[2]=s,e[3]=l):l=e[3];let o;e[4]!==s?(o=s("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=s,e[5]=o):o=e[5];const r=n.defaultMainView,h=n.setMainView;let d;e[6]!==s?(d=s("virtualMcp.layoutTabContent.mainView"),e[6]=s,e[7]=d):d=e[7];let m;e[8]!==s?(m=s("virtualMcp.layoutTabContent.noMainView"),e[8]=s,e[9]=m):m=e[9];let f;e[10]!==m?(f=t.jsx(Ve,{placeholder:m}),e[10]=m,e[11]=f):f=e[11];let u;e[12]!==d||e[13]!==f?(u=t.jsx(_e,{"aria-label":d,className:"w-36 h-8 text-sm shrink-0 @min-xl/project-settings:w-44",children:f}),e[12]=d,e[13]=f,e[14]=u):u=e[14];let c;e[15]!==n.defaultMainOptions?(c=n.defaultMainOptions.map(wl),e[15]=n.defaultMainOptions,e[16]=c):c=e[16];let p;e[17]!==c?(p=t.jsx(Te,{children:c}),e[17]=c,e[18]=p):p=e[18];let x;e[19]!==p||e[20]!==u||e[21]!==n.defaultMainView||e[22]!==n.setMainView?(x=t.jsxs(De,{value:r,onValueChange:h,children:[u,p]}),e[19]=p,e[20]=u,e[21]=n.defaultMainView,e[22]=n.setMainView,e[23]=x):x=e[23];let g;e[24]!==x||e[25]!==l||e[26]!==o?(g=t.jsx(He,{title:l,description:o,action:x}),e[24]=x,e[25]=l,e[26]=o,e[27]=g):g=e[27];let b;e[28]!==s?(b=s("virtualMcp.layoutTabContent.showChat"),e[28]=s,e[29]=b):b=e[29];let y;e[30]!==s?(y=s("virtualMcp.layoutTabContent.showChatDescription"),e[30]=s,e[31]=y):y=e[31];let j;e[32]!==s?(j=s("virtualMcp.layoutTabContent.showChat"),e[32]=s,e[33]=j):j=e[33];const v=n.noMainView?!0:n.chatDefaultOpen;let S;e[34]!==j||e[35]!==v||e[36]!==n.noMainView||e[37]!==n.setChatDefaultOpen?(S=t.jsx(Se,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(et,{"aria-label":j,checked:v,disabled:n.noMainView,onCheckedChange:n.setChatDefaultOpen})})}),e[34]=j,e[35]=v,e[36]=n.noMainView,e[37]=n.setChatDefaultOpen,e[38]=S):S=e[38];let N;e[39]!==s||e[40]!==n.noMainView?(N=n.noMainView&&t.jsx(Ne,{side:"top",children:s("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[39]=s,e[40]=n.noMainView,e[41]=N):N=e[41];let M;e[42]!==S||e[43]!==N?(M=t.jsxs(we,{delayDuration:0,children:[S,N]}),e[42]=S,e[43]=N,e[44]=M):M=e[44];let w;e[45]!==b||e[46]!==y||e[47]!==M?(w=t.jsx(He,{title:b,description:y,action:M}),e[45]=b,e[46]=y,e[47]=M,e[48]=w):w=e[48];let C;e[49]!==g||e[50]!==w?(C=t.jsxs(Le,{children:[g,w]}),e[49]=g,e[50]=w,e[51]=C):C=e[51];let k;e[52]!==i||e[53]!==C?(k=t.jsx(Be,{title:i,children:C}),e[52]=i,e[53]=C,e[54]=k):k=e[54];let T;e[55]!==s?(T=s("virtualMcp.settings.views.sidebar"),e[55]=s,e[56]=T):T=e[56];let V;e[57]!==n?(V=n.projectViews.map($=>{const F=n.pinned($);return t.jsx(He,{icon:t.jsx(bl,{viewId:$}),title:n.labels[$],onClick:()=>n.openView($),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(as,{pinned:F,canSetMainView:F&&!n.isMainView($),onOpen:()=>n.openView($),onTogglePin:()=>n.togglePin($,!F),onSetMainView:()=>n.setMainView($)}),t.jsx("span",{onClick:()=>n.openView($),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Ft,{size:16})})]})},$)}),e[57]=n,e[58]=V):V=e[58];let A;e[59]!==n?(A=n.connectionsData.flatMap($=>[t.jsx(jl,{icon:$.icon,title:$.title},`${$.id}:header`),...$.uiTools.map(F=>{const H=n.pinnedAppViews.find(_=>_.connectionId===$.id&&_.toolName===F.name),B=!!H,Y=Zs($.id,F.name),U=`ext-apps:${$.id}:${F.name}`;return t.jsx(He,{onClick:()=>n.openView(Y),icon:B?t.jsx("span",{onClick:ls,children:t.jsx(Bs,{value:H.icon??null,name:H.label||F.name,size:"xs",showHoverOverlay:!1,onChange:_=>n.setAppViewIcon($.id,F.name,_)})}):t.jsx(Ms,{size:16}),title:B?t.jsx("span",{onClick:ls,children:t.jsx(ke,{value:H.label,onChange:_=>n.setAppViewLabel($.id,F.name,_.target.value),onBlur:n.commitAppViewLabel,"aria-label":F.title??wt(F.name),className:"h-7 w-full max-w-52 text-sm"})}):F.title??wt(F.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(as,{pinned:B,canSetMainView:B&&!n.isMainView(U),onOpen:()=>n.openView(Y),onTogglePin:()=>n.toggleAppViewPin($.id,F.name),onSetMainView:()=>n.setMainView(U)}),t.jsx("span",{onClick:()=>n.openView(Y),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Ft,{size:16})})]})},`${$.id}:${F.name}`)})]),e[59]=n,e[60]=A):A=e[60];let D;e[61]!==V||e[62]!==A?(D=t.jsxs(Le,{children:[V,A]}),e[61]=V,e[62]=A,e[63]=D):D=e[63];let z;e[64]!==T||e[65]!==D?(z=t.jsx(Be,{title:T,children:D}),e[64]=T,e[65]=D,e[66]=z):z=e[66];let P;return e[67]!==k||e[68]!==z?(P=t.jsxs(t.Fragment,{children:[k,z]}),e[67]=k,e[68]=z,e[69]=P):P=e[69],P}function wl(a){return t.jsx(ge,{value:a.value,children:a.label},a.value)}const Ks="site-editor",Sl=new Set([Ks,"content"]);function Nl({virtualMcpId:a,form:e,flushAndSave:n}){const s=X(),i=ot(),{openPanel:l}=Ti(),o=bs(a),r=Di(o),h=Os(a),d=Fi(a),m=(o?.connections??[]).map(_=>_.connection_id).sort(),{data:f}=en({queryKey:hs.projectConnectionDetails(a,m),enabled:m.length>0,queryFn:async()=>await Promise.all(m.map(async E=>{try{const{item:q}=await i.call("COLLECTION_CONNECTIONS_GET",{id:E}),L=(q?.tools??[]).flatMap(R=>{const K=ki(R._meta);return K?[{name:R.name,title:R.title,description:R.description,resourceUri:K}]:[]});return{fetchOk:!0,id:E,title:q?.title??E,icon:q?.icon??null,uiTools:L}}catch{return{fetchOk:!1,id:E,title:E,icon:null,uiTools:[]}}}))}),u=(f??[]).filter(_=>_.uiTools.length>0),c=new Set([...tn,...sn]),p=e.watch("metadata.ui.pinnedViews")??[],x=e.watch("metadata.ui.layout")??null,g=x?.defaultMainView??null,b=x?.chatDefaultOpen??!1,y=St(Nt({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:x}}),e.watch("metadata.sidebarViewsVersion")),j=d??(o?St(Nt(o.metadata),o.metadata.sidebarViewsVersion):y),v=(()=>{if(!g||g.type==="chat")return"";const _=nn(g.type);return _==="instructions"||_==="connections"||_==="layout"?"settings":Sl.has(_)?Ks:c.has(_)?_:`${_}:${g.id??""}:${g.toolName??""}`})(),S=v==="",N=_=>{const[E,q,L]=_.split(":");return E?c.has(E)?{type:E}:E==="ext-apps"&&q?{type:"ext-apps",id:q,toolName:L||void 0}:null:null},M=_=>{e.setValue("metadata.ui.pinnedViews",_,{shouldDirty:!0})},w=_=>{e.setValue("metadata.ui.layout",{...x,..._},{shouldDirty:!0})},C=W.useRef(!1);if(f&&f.length>0&&!C.current){C.current=!0;const _=new Set((f??[]).filter(R=>R.fetchOk).map(R=>R.id)),E=new Set(u.flatMap(R=>R.uiTools.map(K=>`${R.id}:${K.name}`))),q=new Set(m),L=p.filter(R=>q.has(R.connectionId)&&(!_.has(R.connectionId)||E.has(`${R.connectionId}:${R.toolName}`)));L.length!==p.length&&(M(L),g?.type==="ext-apps"&&!L.some(R=>R.connectionId===g.id&&R.toolName===g.toolName)&&w({defaultMainView:{type:"settings"}}))}const k=(_,E)=>{if(p.some(L=>L.connectionId===_&&L.toolName===E)){const L=p.filter(K=>!(K.connectionId===_&&K.toolName===E));M(L);const R=`ext-apps:${_}:${E}`;v===R&&w({defaultMainView:{type:"settings"}})}else{const L=u.find(R=>R.id===_)?.uiTools.find(R=>R.name===E)?.title;M([...p,{connectionId:_,toolName:E,label:L??wt(E),icon:null}])}n()},T=(_,E,q)=>{M(p.map(L=>L.connectionId===_&&L.toolName===E?{...L,label:q}:L))},V=()=>{n()},A=(_,E,q)=>{M(p.map(L=>L.connectionId===_&&L.toolName===E?{...L,icon:q}:L)),n()},D=_=>{w({defaultMainView:N(_)}),n()},z=(_,E)=>{const q=Pi(j,_,E,1);e.setValue("metadata.sidebarViews",q,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),h.stage(q,j);const L=$i(g,_,E);L!==g&&w({defaultMainView:L})},P=lt(o?.metadata),$=Ai(P,r.presence),F=Ii($),H=Oi(j,$,1),B={overview:s("sidebar.navDestinations.home"),reports:s("sidebar.navDestinations.reports"),board:s("sidebar.navDestinations.tasks"),"site-editor":s("virtualMcp.layoutTabContent.siteEditor"),assets:s("common.mainPanelTabs.assets"),hosting:s("common.mainPanelTabs.hosting"),e2e:s("common.mainPanelTabs.e2e"),analytics:s("common.mainPanelTabs.analytics"),cdn:s("common.mainPanelTabs.cdn"),automations:s("virtualMcp.layoutTabContent.automations"),experiments:s("experiments.title")},Y=[];for(const _ of H)_!=="automations"&&Y.push({value:_,label:B[_]});for(const _ of p)Y.push({value:`ext-apps:${_.connectionId}:${_.toolName}`,label:_.label||_.toolName});return H.includes("automations")&&Y.push({value:"automations",label:B.automations}),Y.push({value:"settings",label:s("virtualMcp.layoutTabContent.settings")}),{projectViews:F,labels:B,pinned:_=>j.includes(_),isMainView:_=>v===_,defaultMainView:v,defaultMainOptions:Y,noMainView:S,chatDefaultOpen:b,connectionsData:u,pinnedAppViews:p,openView:_=>l(_,{virtualmcpid:a}),togglePin:(_,E)=>z(_,E),setMainView:D,setChatDefaultOpen:_=>{w({chatDefaultOpen:_}),n()},toggleAppViewPin:k,setAppViewIcon:A,setAppViewLabel:T,commitAppViewLabel:V}}function Cl(a){const e=G.c(55),{form:n,onCommit:s}=a,i=X(),l=W.useId();let o;e[0]!==i?(o=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("p",{className:"text-sm font-medium",children:o}),e[2]=o,e[3]=r):r=e[3];let h;e[4]!==i?(h=i("virtualMcp.settings.identity.iconDescription"),e[4]=i,e[5]=h):h=e[5];let d;e[6]!==h?(d=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:h}),e[6]=h,e[7]=d):d=e[7];let m;e[8]!==r||e[9]!==d?(m=t.jsxs("div",{children:[r,d]}),e[8]=r,e[9]=d,e[10]=m):m=e[10];let f;e[11]!==n||e[12]!==s||e[13]!==i?(f=T=>{const{field:V}=T;return t.jsx("div",{className:"justify-self-start",children:t.jsx(Bs,{value:V.value??null,onChange:A=>{V.onChange(A),s()},onColorChange:A=>{n.setValue("metadata.ui.themeColor",A,{shouldDirty:!0}),s()},name:n.watch("title")||i("virtualMcp.virtualMcp.agentNameFallback"),size:"md",avatarClassName:"[&_svg]:w-1/2 [&_svg]:h-1/2"})})},e[11]=n,e[12]=s,e[13]=i,e[14]=f):f=e[14];let u;e[15]!==n.control||e[16]!==f?(u=t.jsx(pe,{name:"icon",control:n.control,render:f}),e[15]=n.control,e[16]=f,e[17]=u):u=e[17];let c;e[18]!==m||e[19]!==u?(c=t.jsxs(ye,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[m,u]}),e[18]=m,e[19]=u,e[20]=c):c=e[20];const p=`${l}-name`;let x;e[21]!==i?(x=i("virtualMcp.settings.identity.name"),e[21]=i,e[22]=x):x=e[22];let g;e[23]!==x||e[24]!==p?(g=t.jsx("label",{htmlFor:p,className:"text-sm font-medium",children:x}),e[23]=x,e[24]=p,e[25]=g):g=e[25];let b;e[26]!==l||e[27]!==s||e[28]!==i?(b=T=>{const{field:V}=T;return t.jsx(ke,{...V,id:`${l}-name`,value:V.value??"",onBlur:()=>{V.onBlur(),s()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=l,e[27]=s,e[28]=i,e[29]=b):b=e[29];let y;e[30]!==n.control||e[31]!==b?(y=t.jsx(pe,{name:"title",control:n.control,render:b}),e[30]=n.control,e[31]=b,e[32]=y):y=e[32];let j;e[33]!==g||e[34]!==y?(j=t.jsxs(ye,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[g,y]}),e[33]=g,e[34]=y,e[35]=j):j=e[35];const v=`${l}-description`;let S;e[36]!==i?(S=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=S):S=e[37];let N;e[38]!==v||e[39]!==S?(N=t.jsx("label",{htmlFor:v,className:"text-sm font-medium",children:S}),e[38]=v,e[39]=S,e[40]=N):N=e[40];let M;e[41]!==l||e[42]!==s||e[43]!==i?(M=T=>{const{field:V}=T;return t.jsx(at,{...V,id:`${l}-description`,value:V.value??"",onBlur:()=>{V.onBlur(),s()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=l,e[42]=s,e[43]=i,e[44]=M):M=e[44];let w;e[45]!==n.control||e[46]!==M?(w=t.jsx(pe,{name:"description",control:n.control,render:M}),e[45]=n.control,e[46]=M,e[47]=w):w=e[47];let C;e[48]!==N||e[49]!==w?(C=t.jsxs(ye,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[N,w]}),e[48]=N,e[49]=w,e[50]=C):C=e[50];let k;return e[51]!==j||e[52]!==C||e[53]!==c?(k=t.jsxs(Le,{children:[c,j,C]}),e[51]=j,e[52]=C,e[53]=c,e[54]=k):k=e[54],k}const Ws=["general","connections","site"],Ml={general:{icon:oi,titleKey:"virtualMcp.settings.general.title",descriptionKey:"virtualMcp.settings.general.description"},connections:{icon:Yi,titleKey:"virtualMcp.settings.connections.title",descriptionKey:"virtualMcp.settings.connections.description"},site:{icon:ri,titleKey:"virtualMcp.settings.site.title",descriptionKey:"virtualMcp.settings.site.description"}};function kl(a){return!!a&&Ws.includes(a)}function _l(a){const e=G.c(8),{section:n}=a,s=X();let i;e[0]!==s?(i=s("virtualMcp.settings.navigation"),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==n||e[3]!==s?(l=Ws.map(r=>{const{titleKey:h}=Ml[r];return t.jsx(ze.Tab,{active:n===r,asChild:!0,children:t.jsx(ps,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:d=>({...d,section:r==="general"?void 0:r}),children:s(h)})},r)}),e[2]=n,e[3]=s,e[4]=l):l=e[4];let o;if(e[5]!==i||e[6]!==l){const r=t.jsx(ze.Tabs,{"aria-label":i,children:l});o=t.jsx(an.Toolbar.Left.Portal,{fallback:r,children:r}),e[5]=i,e[6]=l,e[7]=o}else o=e[7];return o}function Vl(){const a=G.c(8),e=Ct();let n;a[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},a[0]=n):n=a[0];const{section:s}=ln(n);let i;a[1]!==s?(i=kl(s)?s:"general",a[1]=s,a[2]=i):i=a[2];let l;a[3]!==e?(l=r=>e({to:".",search:h=>({...h,section:r??void 0})}),a[3]=e,a[4]=l):l=a[4];let o;return a[5]!==i||a[6]!==l?(o={section:i,openSection:l},a[5]=i,a[6]=l,a[7]=o):o=a[7],o}const bt={tools:null,resources:null,prompts:null},Tl=Bi.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function Dl(a){const n=new TextEncoder().encode(a),s=Array.from(n,i=>String.fromCharCode(i)).join("");return btoa(s)}function Gs(a){return{"x-studio-client":a,"x-mesh-client":a}}function Al(a){const e=G.c(15),{url:n,agentId:s}=a,i=X(),[l,o]=W.useState(!1);let r;e[0]!==s||e[1]!==i||e[2]!==n?(r=async()=>{je("agent_connect_action",{agent_id:s,action:"copy_url"}),await navigator.clipboard.writeText(n),o(!0),re.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await st(2e3),o(!1)},e[0]=s,e[1]=i,e[2]=n,e[3]=r):r=e[3];const h=r;let d;e[4]!==l?(d=l?t.jsx(tt,{size:20,className:"text-success"}):t.jsx(pt,{size:20}),e[4]=l,e[5]=d):d=e[5];let m;e[6]!==l||e[7]!==i?(m=i(l?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=l,e[7]=i,e[8]=m):m=e[8];let f;e[9]!==m?(f=t.jsx("span",{className:"text-xs font-medium",children:m}),e[9]=m,e[10]=f):f=e[10];let u;return e[11]!==h||e[12]!==d||e[13]!==f?(u=t.jsxs(te,{type:"button",variant:"outline",onClick:h,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[d,f]}),e[11]=h,e[12]=d,e[13]=f,e[14]=u):u=e[14],u}function Il(a){const e=G.c(13),{url:n,serverName:s,agentId:i}=a,l=X();let o;e[0]!==i||e[1]!==s||e[2]!==l||e[3]!==n?(o=()=>{je("agent_connect_action",{agent_id:i,action:"install_cursor"});const u=$s(s),c={type:"http",url:n,headers:Gs("Cursor")},p=Dl(JSON.stringify(c,null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(u)}&config=${encodeURIComponent(p)}`;window.open(x,"_blank"),re.success(l("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=s,e[2]=l,e[3]=n,e[4]=o):o=e[4];const r=o;let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),e[5]=h):h=e[5];let d;e[6]!==l?(d=l("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=l,e[7]=d):d=e[7];let m;e[8]!==d?(m=t.jsx("span",{className:"text-xs font-medium",children:d}),e[8]=d,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m?(f=t.jsxs(te,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[h,m]}),e[10]=r,e[11]=m,e[12]=f):f=e[12],f}function Ol(a){const e=G.c(16),{url:n,serverName:s,agentId:i}=a,l=X(),[o,r]=W.useState(!1);let h;e[0]!==i||e[1]!==s||e[2]!==l||e[3]!==n?(h=async()=>{je("agent_connect_action",{agent_id:i,action:"install_claude_code"});const p=$s(s),x={type:"http",url:n,headers:Gs("Claude Code")},g=JSON.stringify(x,null,2),b=`claude mcp add-json "${p}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(b),r(!0),re.success(l("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await st(2e3),r(!1)},e[0]=i,e[1]=s,e[2]=l,e[3]=n,e[4]=h):h=e[4];const d=h;let m;e[5]!==o?(m=o?t.jsx(tt,{size:20,className:"text-success"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[5]=o,e[6]=m):m=e[6];let f;e[7]!==o||e[8]!==l?(f=l(o?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=o,e[8]=l,e[9]=f):f=e[9];let u;e[10]!==f?(u=t.jsx("span",{className:"text-xs font-medium",children:f}),e[10]=f,e[11]=u):u=e[11];let c;return e[12]!==d||e[13]!==m||e[14]!==u?(c=t.jsxs(te,{type:"button",variant:"outline",onClick:d,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[m,u]}),e[12]=d,e[13]=m,e[14]=u,e[15]=c):c=e[15],c}function Pl({virtualMcp:a}){const e=X(),n=ot(),[s,i]=W.useState(null),[l,o]=W.useState(!1),[r,h]=W.useState(!1),d=a.id,m=a.title||`agent-${d.slice(0,8)}`,f=s?`bunx @decocms/typegen@latest --mcp ${d} --key ${s} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${d} --key <api-key> --output client.ts`,u=async()=>{o(!0);try{const{key:p}=await n.call("API_KEY_CREATE",{name:`typegen-${m}`,permissions:{[d]:["*"]}});if(!p)throw new Error("No key in response");i(p),je("agent_typegen_key_generated",{agent_id:d})}catch{je("agent_typegen_key_failed",{agent_id:d}),re.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{o(!1)}},c=async()=>{je("agent_connect_action",{agent_id:d,action:"typegen_copy_command",has_api_key:!!s}),await navigator.clipboard.writeText(f),h(!0),re.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await st(2e3),h(!1)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClient")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClientDescription")})]}),!s&&t.jsxs(te,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:u,disabled:l,children:[l?t.jsx(Xe,{className:"size-3.5"}):t.jsx(Vt,{size:14}),t.jsx("span",{children:e(l?"virtualMcp.virtualMcpShareModal.generating":"virtualMcp.virtualMcpShareModal.generateApiKey")})]})]}),s&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateClientLabel")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:f}),t.jsx(te,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:c,children:r?t.jsx(tt,{size:12,className:"text-success"}):t.jsx(pt,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx($l,{apiKey:s,agentId:d})]})}function $l(a){const e=G.c(21),{apiKey:n,agentId:s}=a,[i,l]=W.useState(!1),o=window.location.origin,r=n?`STUDIO_API_KEY=${n}`:"STUDIO_API_KEY=<api-key>",h=`STUDIO_BASE_URL=${o}`,d=`${r}
|
|
1
|
+
import{c as G,b as X,r as W,j as t,B as te,h as Xe,l as xe,I as ds,F as us,H as ms,G as Ke,aj as Pt,ah as $t,ai as Et,t as re,X as Ae,E as Re,Z as fs,ff as Qs,L as ps,ab as Xs,s as Js,ee as He,ak as Ft,aa as Zs,ed as Le,ec as Be,a2 as ot,m as en,K as hs,fg as tn,fh as sn,fi as nn,aU as pe,fj as ye,n as ze,P as an,d as Ct,u as ln,q as je,c$ as rn,ao as on,e_ as cn,fk as dn,aS as un,a as mn,fl as xs,fm as fn,aJ as pn,a7 as hn,o as xn,at as gn,as as vn,fn as bn,ay as jn}from"./index-B1zctMWM.js";import{g as yn}from"./extract-connection-data-BqvnWkg5.js";import{a as wn}from"./chat-context-CW-2SJ9g.js";import{U as Sn,b as Nn}from"./build-improve-prompt-doc-Cb05TlMk.js";import{E as Cn}from"./empty-state-CGgBiEoz.js";import{a as Mn}from"./shell-layout-XTP1Kn60.js";import{g as ct,n as kn,a as zt,e as _n,u as Vn,f as Tn}from"./use-date-fns-locale-DtLNXwQQ.js";import{a as Mt,b as gs,u as Dn}from"./use-connection-o6IaHrCa.js";import{b as vs,a as bs,f as js,g as ys,k as An}from"./repository-binding-DB3Rsfan.js";import{a as In,i as Rt}from"./mcp-oauth-Dt9pIBq5.js";import{f as On,e as Pn,b as $n,A as En,a as Fn,d as zn,c as Rn,g as Ln}from"./alert-dialog-CRVM-23V.js";import{D as Je,b as Ze,c as dt,d as ut,e as ws,h as Un}from"./dialog-DUkVOZIE.js";import{T as at}from"./textarea-C-PwJiry.js";import{b as we,T as Se,a as Ne}from"./tooltip-CmsIn1_T.js";import{n as Yn}from"./LinkExternal01-ByTglQMD.js";import{ba as Bn,h as Kn,bb as Wn,bc as Gn,aN as Hn,ax as qn,aD as Qn,bd as Xn,be as Ss,bf as Ns,bg as Jn,al as Zn,bh as ei,bi as xt,bj as Lt,A as Ut,H as ti,bk as si,bl as ni,g as Cs,m as Yt,n as ii,r as ai,q as li,f as Ms,bm as Bt,R as ri,_ as oi,aL as ci,ab as di,ar as ui}from"./agent-icon-Plx0vVQZ.js";import{s as $e}from"./Plus-jU4D0ULX.js";import{t as it,a as mi}from"./Tool01-DQZj0rVc.js";import{s as kt}from"./Trash01-CfWaytgc.js";import{u as Kt}from"./use-debounced-autosave-C94tXEES.js";import{A as fi}from"./add-connection-dialog-C9teNzj3.js";import{i as yt}from"./SearchMd-yUpDH67q.js";import{F as Wt}from"./file-type-icon-CideAigq.js";import{i as pi,h as hi,m as xi,p as gi}from"./use-org-fs-CfcB8IFl.js";import{I as Ge}from"./integration-icon-B97YfXXZ.js";import{C as ks}from"./checkbox-Cs5VXlL7.js";import{S as vi}from"./search-input-B7esxZLr.js";import{b as _e,a as Ve,c as ge,d as Te,S as De}from"./select-CCPnfgQ9.js";import{s as _t}from"./XClose-B5gtMDn3.js";import{C as bi}from"./collection-tabs-2Nn5b0UJ.js";import{T as _s,u as Vs}from"./use-mcp-auth-status-BPJMjKJu.js";import{u as mt}from"./use-mcp-client-BCOmh6mH.js";import{a as Ts}from"./use-mcp-tools-isgPo0N2.js";import{u as ji}from"./use-mcp-prompts-DsQz4qyp.js";import{g as yi}from"./connection-slug-CITJ0kGN.js";import{t as wt}from"./utils-CVEq3hMx.js";import{I as ke}from"./input-B3HVl7By.js";import{S as et}from"./switch-Bj8bJ2hL.js";import{a as Ds,b as As,P as Is}from"./popover-DwQza7Ap.js";import{S as wi}from"./scroll-area-DTVFcTe4.js";import{i as Si}from"./Upload01-ca0GgR0P.js";import{i as Ni}from"./DotsVertical-DMzCTdNT.js";import{a as Ci}from"./Image01-VqGHD62D.js";import{i as Mi}from"./Monitor01-CjCwBipo.js";import{g as ki}from"./types-Dnj2Xk6p.js";import{b as lt,g as _i,d as Vi}from"./use-project-scope-B1N6dPlK.js";import{a as Ti}from"./use-panel-navigate-CuKDZSXf.js";import{u as Di,e as St,r as Nt,p as Ai,n as Ii,s as Oi,o as Pi,q as $i,c as Ei}from"./use-chat-layout-state-B1ZVGaLS.js";import{a as Os,u as Fi,i as zi,o as Ri,r as Gt,p as Li,w as Ui,b as Ht}from"./optimistic-project-sidebar-views-DDETX0mx.js";import{i as Yi}from"./Link01-ZJZ8YMCs.js";import{V as Bi,E as ft,r as Ps,C as Ki,w as Wi}from"./virtual-mcp-BkcbnGY4.js";import{s as $s}from"./slugify-CEUa2lfQ.js";import{b as Gi,a as Hi,D as qi}from"./drawer-BE8-rjnv.js";import{u as Qi}from"./use-mobile-CUG36tjm.js";import{i as tt}from"./Check-BhHmW1CL.js";import{a as pt}from"./Copy01-1J_cPh43.js";import{i as Vt}from"./Key01-3kquwPFB.js";import{d as st}from"./backoff-8mStPHYB.js";import{R as Xi}from"./repository-import-picker-DyQqkMVo.js";import{b as Ji}from"./sandbox-url-D3mC8qhT.js";import{L as he}from"./label-Be_7Vms5.js";import{S as Zi,a as ea,b as ta}from"./secret-picker-BV1iDD76.js";import{u as sa,a as na}from"./use-secrets-Bpfmfnyi.js";import{o as qt}from"./omit-sandbox-map-jj4lCB2U.js";import{G as ia}from"./repository-picker-BhN42NYE.js";import{f as aa,s as la,g as ra}from"./thread-intent-swCQbScV.js";import{r as oa}from"./serial-task-queue-CGOeQgpr.js";import{t as Ie,c as We,m as ca,a as Es}from"./differenceInSeconds-C3x8sHUj.js";function Qe(a,e){const n=ct(),s=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Ie(a,e?.in),l=i.getDay(),o=(l<s?7:0)+l-s;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function rt(a,e){return Qe(a,{...e,weekStartsOn:1})}function Fs(a,e){const n=Ie(a,e?.in),s=n.getFullYear(),i=We(n,0);i.setFullYear(s+1,0,4),i.setHours(0,0,0,0);const l=rt(i),o=We(n,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const r=rt(o);return n.getTime()>=l.getTime()?s+1:n.getTime()>=r.getTime()?s:s-1}function Qt(a,e){const n=Ie(a,e?.in);return n.setHours(0,0,0,0),n}function da(a,e,n){const[s,i]=kn(n?.in,a,e),l=Qt(s),o=Qt(i),r=+l-zt(l),h=+o-zt(o);return Math.round((r-h)/ca)}function ua(a,e){const n=Fs(a,e),s=We(a,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),rt(s)}function ma(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function fa(a){return!(!ma(a)&&typeof a!="number"||isNaN(+Ie(a)))}function pa(a,e){const n=Ie(a,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ha(a,e){const n=Ie(a,e?.in);return da(n,pa(n))+1}function xa(a,e){const n=Ie(a,e?.in),s=+rt(n)-+ua(n);return Math.round(s/Es)+1}function zs(a,e){const n=Ie(a,e?.in),s=n.getFullYear(),i=ct(),l=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=We(e?.in||a,0);o.setFullYear(s+1,0,l),o.setHours(0,0,0,0);const r=Qe(o,e),h=We(e?.in||a,0);h.setFullYear(s,0,l),h.setHours(0,0,0,0);const d=Qe(h,e);return+n>=+r?s+1:+n>=+d?s:s-1}function ga(a,e){const n=ct(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=zs(a,e),l=We(e?.in||a,0);return l.setFullYear(i,0,s),l.setHours(0,0,0,0),Qe(l,e)}function va(a,e){const n=Ie(a,e?.in),s=+Qe(n,e)-+ga(n,e);return Math.round(s/Es)+1}function le(a,e){const n=a<0?"-":"",s=Math.abs(a).toString().padStart(e,"0");return n+s}const Pe={y(a,e){const n=a.getFullYear(),s=n>0?n:1-n;return le(e==="yy"?s%100:s,e.length)},M(a,e){const n=a.getMonth();return e==="M"?String(n+1):le(n+1,2)},d(a,e){return le(a.getDate(),e.length)},a(a,e){const n=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(a,e){return le(a.getHours()%12||12,e.length)},H(a,e){return le(a.getHours(),e.length)},m(a,e){return le(a.getMinutes(),e.length)},s(a,e){return le(a.getSeconds(),e.length)},S(a,e){const n=e.length,s=a.getMilliseconds(),i=Math.trunc(s*Math.pow(10,n-3));return le(i,e.length)}},Ye={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Xt={G:function(a,e,n){const s=a.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});default:return n.era(s,{width:"wide"})}},y:function(a,e,n){if(e==="yo"){const s=a.getFullYear(),i=s>0?s:1-s;return n.ordinalNumber(i,{unit:"year"})}return Pe.y(a,e)},Y:function(a,e,n,s){const i=zs(a,s),l=i>0?i:1-i;if(e==="YY"){const o=l%100;return le(o,2)}return e==="Yo"?n.ordinalNumber(l,{unit:"year"}):le(l,e.length)},R:function(a,e){const n=Fs(a);return le(n,e.length)},u:function(a,e){const n=a.getFullYear();return le(n,e.length)},Q:function(a,e,n){const s=Math.ceil((a.getMonth()+1)/3);switch(e){case"Q":return String(s);case"QQ":return le(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(a,e,n){const s=Math.ceil((a.getMonth()+1)/3);switch(e){case"q":return String(s);case"qq":return le(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(a,e,n){const s=a.getMonth();switch(e){case"M":case"MM":return Pe.M(a,e);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(a,e,n){const s=a.getMonth();switch(e){case"L":return String(s+1);case"LL":return le(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(a,e,n,s){const i=va(a,s);return e==="wo"?n.ordinalNumber(i,{unit:"week"}):le(i,e.length)},I:function(a,e,n){const s=xa(a);return e==="Io"?n.ordinalNumber(s,{unit:"week"}):le(s,e.length)},d:function(a,e,n){return e==="do"?n.ordinalNumber(a.getDate(),{unit:"date"}):Pe.d(a,e)},D:function(a,e,n){const s=ha(a);return e==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):le(s,e.length)},E:function(a,e,n){const s=a.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(a,e,n,s){const i=a.getDay(),l=(i-s.weekStartsOn+8)%7||7;switch(e){case"e":return String(l);case"ee":return le(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(a,e,n,s){const i=a.getDay(),l=(i-s.weekStartsOn+8)%7||7;switch(e){case"c":return String(l);case"cc":return le(l,e.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(a,e,n){const s=a.getDay(),i=s===0?7:s;switch(e){case"i":return String(i);case"ii":return le(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(a,e,n){const i=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(a,e,n){const s=a.getHours();let i;switch(s===12?i=Ye.noon:s===0?i=Ye.midnight:i=s/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(a,e,n){const s=a.getHours();let i;switch(s>=17?i=Ye.evening:s>=12?i=Ye.afternoon:s>=4?i=Ye.morning:i=Ye.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(a,e,n){if(e==="ho"){let s=a.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return Pe.h(a,e)},H:function(a,e,n){return e==="Ho"?n.ordinalNumber(a.getHours(),{unit:"hour"}):Pe.H(a,e)},K:function(a,e,n){const s=a.getHours()%12;return e==="Ko"?n.ordinalNumber(s,{unit:"hour"}):le(s,e.length)},k:function(a,e,n){let s=a.getHours();return s===0&&(s=24),e==="ko"?n.ordinalNumber(s,{unit:"hour"}):le(s,e.length)},m:function(a,e,n){return e==="mo"?n.ordinalNumber(a.getMinutes(),{unit:"minute"}):Pe.m(a,e)},s:function(a,e,n){return e==="so"?n.ordinalNumber(a.getSeconds(),{unit:"second"}):Pe.s(a,e)},S:function(a,e){return Pe.S(a,e)},X:function(a,e,n){const s=a.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return Zt(s);case"XXXX":case"XX":return Fe(s);default:return Fe(s,":")}},x:function(a,e,n){const s=a.getTimezoneOffset();switch(e){case"x":return Zt(s);case"xxxx":case"xx":return Fe(s);default:return Fe(s,":")}},O:function(a,e,n){const s=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Jt(s,":");default:return"GMT"+Fe(s,":")}},z:function(a,e,n){const s=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Jt(s,":");default:return"GMT"+Fe(s,":")}},t:function(a,e,n){const s=Math.trunc(+a/1e3);return le(s,e.length)},T:function(a,e,n){return le(+a,e.length)}};function Jt(a,e=""){const n=a>0?"-":"+",s=Math.abs(a),i=Math.trunc(s/60),l=s%60;return l===0?n+String(i):n+String(i)+e+le(l,2)}function Zt(a,e){return a%60===0?(a>0?"-":"+")+le(Math.abs(a)/60,2):Fe(a,e)}function Fe(a,e=""){const n=a>0?"-":"+",s=Math.abs(a),i=le(Math.trunc(s/60),2),l=le(s%60,2);return n+i+e+l}const es=(a,e)=>{switch(a){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Rs=(a,e)=>{switch(a){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},ba=(a,e)=>{const n=a.match(/(P+)(p+)?/)||[],s=n[1],i=n[2];if(!i)return es(a,e);let l;switch(s){case"P":l=e.dateTime({width:"short"});break;case"PP":l=e.dateTime({width:"medium"});break;case"PPP":l=e.dateTime({width:"long"});break;default:l=e.dateTime({width:"full"});break}return l.replace("{{date}}",es(s,e)).replace("{{time}}",Rs(i,e))},ja={p:Rs,P:ba},ya=/^D+$/,wa=/^Y+$/,Sa=["D","DD","YY","YYYY"];function Na(a){return ya.test(a)}function Ca(a){return wa.test(a)}function Ma(a,e,n){const s=ka(a,e,n);if(console.warn(s),Sa.includes(a))throw new RangeError(s)}function ka(a,e,n){const s=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${e}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const _a=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Va=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ta=/^'([^]*?)'?$/,Da=/''/g,Aa=/[a-zA-Z]/;function Ia(a,e,n){const s=ct(),i=n?.locale??s.locale??_n,l=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,r=Ie(a,n?.in);if(!fa(r))throw new RangeError("Invalid time value");let h=e.match(Va).map(m=>{const f=m[0];if(f==="p"||f==="P"){const u=ja[f];return u(m,i.formatLong)}return m}).join("").match(_a).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const f=m[0];if(f==="'")return{isToken:!1,value:Oa(m)};if(Xt[f])return{isToken:!0,value:m};if(f.match(Aa))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:m}});i.localize.preprocessor&&(h=i.localize.preprocessor(r,h));const d={firstWeekContainsDate:l,weekStartsOn:o,locale:i};return h.map(m=>{if(!m.isToken)return m.value;const f=m.value;(!n?.useAdditionalWeekYearTokens&&Ca(f)||!n?.useAdditionalDayOfYearTokens&&Na(f))&&Ma(f,e,String(a));const u=Xt[f[0]];return u(r,f,i.localize,d)}).join("")}function Oa(a){const e=a.match(Ta);return e?e[1].replace(Da,"'"):a}const Ls=25*1024*1024,gt="home",vt="knowledge";function ts(a){return a==null?"":a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(0)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`}function Ee(a){return a.split("/").pop()??a}function Pa(a){const e=G.c(64),{form:n}=a,s=X(),{upload:i}=pi(gt),l=hi(),o=W.useRef(null),[r,h]=W.useState(!1),[d,m]=W.useState(""),[f,u]=W.useState(!1);let c;e[0]!==r?(c={enabled:r},e[0]=r,e[1]=c):c=e[1];const{data:p}=xi(60,c),x=p===void 0?[]:p;let g;e[2]!==r?(g={enabled:r},e[2]=r,e[3]=g):g=e[3];const{data:b}=gi(g),y=b===void 0?[]:b;let j;e[4]!==n?(j=()=>n.getValues("metadata.knowledge")??[],e[4]=n,e[5]=j):j=e[5];const[v,S]=W.useState(j);let N;e[6]!==n?(N=I=>{S(I),n.setValue("metadata.knowledge",I,{shouldDirty:!0})},e[6]=n,e[7]=N):N=e[7];const M=N;let w;e[8]!==l||e[9]!==v||e[10]!==M||e[11]!==s||e[12]!==i?(w=async I=>{if(!I||I.length===0)return;const J=Array.from(I),be=J.filter(Ua),ce=J.filter(La);if(ce.length>0&&re.warning(s("virtualMcp.filesSection.fileTooLargeTitle"),{description:s("virtualMcp.filesSection.fileTooLargeDescription",{names:ce.map(Ra).join(", ")})}),be.length!==0){try{await i.mutateAsync({dir:vt,files:be})}catch(me){const Oe=me;re.error(Oe instanceof Error?Oe.message:s("virtualMcp.filesSection.failedUploadFile"));return}M([...v,...be.map(me=>({id:crypto.randomUUID(),name:me.name,volume:gt,path:`${vt}/${me.name}`,url:l(gt,`${vt}/${me.name}`),contentType:me.type||null,size:me.size,addedAt:new Date().toISOString()}))])}},e[8]=l,e[9]=v,e[10]=M,e[11]=s,e[12]=i,e[13]=w):w=e[13];const C=w;let k;e[14]!==l||e[15]!==v||e[16]!==M?(k=I=>{v.some(J=>J.volume===I.volume&&J.path===I.path)||(M([...v,{id:crypto.randomUUID(),name:Ee(I.path),volume:I.volume,path:I.path,url:l(I.volume,I.path),contentType:null,size:I.size??null,addedAt:new Date().toISOString()}]),h(!1))},e[14]=l,e[15]=v,e[16]=M,e[17]=k):k=e[17];const T=k;let V;e[18]!==l||e[19]!==v||e[20]!==M?(V=I=>{v.some(J=>J.volume===I.volume&&J.path===I.path)||(M([...v,{id:crypto.randomUUID(),name:Ee(I.path),kind:"skill",volume:I.volume,path:I.path,url:l(I.volume,I.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),h(!1))},e[18]=l,e[19]=v,e[20]=M,e[21]=V):V=e[21];const A=V;let D;e[22]!==v||e[23]!==M?(D=I=>{M(v.filter(J=>J.id!==I))},e[22]=v,e[23]=M,e[24]=D):D=e[24];const z=D;let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=I=>{h(I),I&&m("")},e[25]=P):P=e[25];const $=P;let F;e[26]!==v?(F=new Set(v.map(za)),e[26]=v,e[27]=F):F=e[27];const H=F,B=d.toLowerCase();let Y;e[28]!==H?(Y=I=>!H.has(`${I.volume}/${I.path}`),e[28]=H,e[29]=Y):Y=e[29];const U=x.filter(Fa).filter(Y).filter(I=>Ee(I.path).toLowerCase().includes(B)).slice(0,5);let _;e[30]!==H?(_=I=>!H.has(`${I.volume}/${I.path}`),e[30]=H,e[31]=_):_=e[31];const E=y.filter(_).filter(I=>Ee(I.path).toLowerCase().includes(B)).slice(0,5),q=I=>t.jsxs(ds,{open:r,onOpenChange:$,children:[t.jsx(us,{asChild:!0,children:I}),t.jsxs(ms,{align:"end",className:"w-56",children:[t.jsxs(Ke,{onSelect:()=>{o.current?.click()},children:[t.jsx(Bn,{size:16}),s("virtualMcp.filesSection.uploadFile")]}),t.jsxs(Pt,{children:[t.jsxs($t,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(Kn,{size:16}),s("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(Et,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(yt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:d,onChange:J=>m(J.target.value),onKeyDown:Ea,placeholder:s("virtualMcp.filesSection.searchFilesPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:U.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:s("virtualMcp.filesSection.noFilesFound")}):U.map(J=>t.jsxs(Ke,{onSelect:()=>T(J),children:[t.jsx(Wt,{filename:Ee(J.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ee(J.path)}),J.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:ts(J.size)})]},`${J.volume}/${J.path}`))})]})]}),t.jsxs(Pt,{children:[t.jsxs($t,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(it,{size:16}),s("virtualMcp.filesSection.selectSkill")]}),t.jsxs(Et,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(yt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:d,onChange:J=>m(J.target.value),onKeyDown:$a,placeholder:s("virtualMcp.filesSection.searchSkillsPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:E.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:s("virtualMcp.filesSection.noSkillsFound")}):E.map(J=>t.jsxs(Ke,{onSelect:()=>A(J),children:[t.jsx(it,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ee(J.path)})]},`${J.volume}/${J.path}`))})]})]})]})]}),L="flex flex-col gap-3";let R;e[32]!==s?(R=s("virtualMcp.filesSection.filesAndSkills"),e[32]=s,e[33]=R):R=e[33];let K;e[34]!==R?(K=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:R}),e[34]=R,e[35]=K):K=e[35];let Z;e[36]!==s?(Z=s("virtualMcp.filesSection.description"),e[36]=s,e[37]=Z):Z=e[37];let ae;e[38]!==Z?(ae=t.jsx("p",{className:"text-sm text-muted-foreground",children:Z}),e[38]=Z,e[39]=ae):ae=e[39];let ee;e[40]!==K||e[41]!==ae?(ee=t.jsxs("div",{className:"flex flex-col gap-1",children:[K,ae]}),e[40]=K,e[41]=ae,e[42]=ee):ee=e[42];const de=v.length>0&&q(t.jsxs(te,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(Xe,{size:"xs"}):t.jsx($e,{size:14}),s("virtualMcp.filesSection.add")]}));let oe;e[43]!==ee||e[44]!==de?(oe=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[ee,de]}),e[43]=ee,e[44]=de,e[45]=oe):oe=e[45];let ue;e[46]!==C?(ue=t.jsx("input",{ref:o,type:"file",multiple:!0,className:"hidden",onChange:I=>{C(I.target.files),I.target.value=""}}),e[46]=C,e[47]=ue):ue=e[47];let se,fe;e[48]===Symbol.for("react.memo_cache_sentinel")?(se=I=>{I.preventDefault(),u(!0)},fe=()=>u(!1),e[48]=se,e[49]=fe):(se=e[48],fe=e[49]);let ve;e[50]!==C?(ve=I=>{I.preventDefault(),I.stopPropagation(),u(!1),C(I.dataTransfer.files)},e[50]=C,e[51]=ve):ve=e[51];const Ce=f&&"outline outline-2 outline-dashed outline-primary";let O;e[52]!==Ce?(O=xe("flex flex-col gap-2 rounded-lg",Ce),e[52]=Ce,e[53]=O):O=e[53];const ne=v.length===0?q(t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx($e,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:s("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):v.map(I=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-card",children:[I.kind==="skill"?t.jsx("div",{className:"flex items-center justify-center h-8 w-6.5 shrink-0 rounded-md bg-muted text-muted-foreground",children:t.jsx(it,{size:16})}):t.jsx(Wt,{filename:I.name,className:"h-8 w-6.5 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:I.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:I.kind==="skill"?s("virtualMcp.filesSection.kindSkill"):I.size!=null?ts(I.size):s("virtualMcp.filesSection.kindFile")})]}),t.jsx(te,{variant:"ghost",size:"icon",onClick:()=>z(I.id),"aria-label":s("virtualMcp.filesSection.removeAriaLabel",{name:I.name}),children:t.jsx(kt,{size:16})})]},I.id));let Q;e[54]!==se||e[55]!==fe||e[56]!==ve||e[57]!==O||e[58]!==ne?(Q=t.jsx("div",{onDragOver:se,onDragLeave:fe,onDrop:ve,className:O,children:ne}),e[54]=se,e[55]=fe,e[56]=ve,e[57]=O,e[58]=ne,e[59]=Q):Q=e[59];let ie;return e[60]!==oe||e[61]!==ue||e[62]!==Q?(ie=t.jsxs("section",{className:L,children:[oe,ue,Q]}),e[60]=oe,e[61]=ue,e[62]=Q,e[63]=ie):ie=e[63],ie}function $a(a){return a.stopPropagation()}function Ea(a){return a.stopPropagation()}function Fa(a){return a.kind!=="dir"}function za(a){return`${a.volume}/${a.path}`}function Ra(a){return a.name}function La(a){return a.size>Ls}function Ua(a){return a.size<=Ls}function Ya(a){return a==null?"all":a.length===0?"self":"selected"}function Ba(a){const e=G.c(88),{form:n,currentAgentId:s}=a,i=X(),{org:l}=Ae(),o=vs(),[r,h]=W.useState(!1);let d;e[0]!==n?(d=n.getValues("metadata.subAgents")??null,e[0]=n,e[1]=d):d=e[1];const m=d;let f;e[2]!==m?(f=()=>Ya(m),e[2]=m,e[3]=f):f=e[3];const[u,c]=W.useState(f);let p;e[4]!==m?(p=m??[],e[4]=m,e[5]=p):p=e[5];const[x,g]=W.useState(p);let b,y,j,v,S,N;if(e[6]!==o||e[7]!==s||e[8]!==n||e[9]!==u||e[10]!==l||e[11]!==x||e[12]!==i){let k;e[19]!==s||e[20]!==l?(k=se=>se.id!==s&&se.id!==l.id&&se.status==="active",e[19]=s,e[20]=l,e[21]=k):k=e[21],b=o.filter(k);let T;e[22]!==x?(T=se=>x.includes(se.id),e[22]=x,e[23]=T):T=e[23];const V=b.filter(T);let A;e[24]!==n?(A=(se,fe)=>n.setValue("metadata.subAgents",se==="all"?null:se==="self"?[]:fe,{shouldDirty:!0}),e[24]=n,e[25]=A):A=e[25];const D=A;let z;e[26]!==D||e[27]!==x?(z=se=>{c(se),D(se,x)},e[26]=D,e[27]=x,e[28]=z):z=e[28];const P=z;let $;e[29]!==D||e[30]!==x?($=se=>{const fe=x.includes(se)?x.filter(ve=>ve!==se):[...x,se];g(fe),D("selected",fe)},e[29]=D,e[30]=x,e[31]=$):$=e[31],y=$,S="flex flex-col gap-3";let F;e[32]!==i?(F=i("virtualMcp.subAgentsSection.title"),e[32]=i,e[33]=F):F=e[33];let H;e[34]!==F?(H=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:F}),e[34]=F,e[35]=H):H=e[35];let B;e[36]!==u||e[37]!==i?(B=u==="all"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canDelegateToAnyAgent")}),e[36]=u,e[37]=i,e[38]=B):B=e[38];let Y;e[39]!==u||e[40]!==i?(Y=u==="self"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canOnlyDelegateToItself")}),e[39]=u,e[40]=i,e[41]=Y):Y=e[41];let U;e[42]!==H||e[43]!==B||e[44]!==Y?(U=t.jsxs("div",{className:"flex flex-col gap-1",children:[H,B,Y]}),e[42]=H,e[43]=B,e[44]=Y,e[45]=U):U=e[45];const _=u==="selected"&&V.length>0&&t.jsxs(te,{variant:"outline",size:"sm",onClick:()=>h(!0),children:[t.jsx($e,{size:14}),i("virtualMcp.subAgentsSection.addSubAgent")]});let E;e[46]!==P?(E=se=>P(se),e[46]=P,e[47]=E):E=e[47];let q;e[48]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx(_e,{size:"sm",className:"w-auto",children:t.jsx(Ve,{})}),e[48]=q):q=e[48];let L;e[49]!==i?(L=i("virtualMcp.subAgentsSection.anyAgent"),e[49]=i,e[50]=L):L=e[50];let R;e[51]!==L?(R=t.jsx(ge,{value:"all",children:L}),e[51]=L,e[52]=R):R=e[52];let K;e[53]!==i?(K=i("virtualMcp.subAgentsSection.specificAgents"),e[53]=i,e[54]=K):K=e[54];let Z;e[55]!==K?(Z=t.jsx(ge,{value:"selected",children:K}),e[55]=K,e[56]=Z):Z=e[56];let ae;e[57]!==i?(ae=i("virtualMcp.subAgentsSection.onlyItself"),e[57]=i,e[58]=ae):ae=e[58];let ee;e[59]!==ae?(ee=t.jsx(ge,{value:"self",children:ae}),e[59]=ae,e[60]=ee):ee=e[60];let de;e[61]!==R||e[62]!==Z||e[63]!==ee?(de=t.jsxs(Te,{align:"end",children:[R,Z,ee]}),e[61]=R,e[62]=Z,e[63]=ee,e[64]=de):de=e[64];let oe;e[65]!==u||e[66]!==E||e[67]!==de?(oe=t.jsxs(De,{value:u,onValueChange:E,children:[q,de]}),e[65]=u,e[66]=E,e[67]=de,e[68]=oe):oe=e[68];let ue;e[69]!==_||e[70]!==oe?(ue=t.jsxs("div",{className:"flex items-center gap-2",children:[_,oe]}),e[69]=_,e[70]=oe,e[71]=ue):ue=e[71],e[72]!==U||e[73]!==ue?(N=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[U,ue]}),e[72]=U,e[73]=ue,e[74]=N):N=e[74],j="flex flex-col gap-2",v=u==="selected"&&(V.length>0?V.map(se=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-background",children:[t.jsx(Ge,{icon:se.icon,name:se.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:se.title}),se.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:se.description})]}),t.jsx(te,{variant:"ghost",size:"icon",onClick:()=>y(se.id),children:t.jsx(_t,{size:16})})]},se.id)):t.jsxs("button",{type:"button",onClick:()=>h(!0),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx($e,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.emptyStateMessage")})]})),e[6]=o,e[7]=s,e[8]=n,e[9]=u,e[10]=l,e[11]=x,e[12]=i,e[13]=b,e[14]=y,e[15]=j,e[16]=v,e[17]=S,e[18]=N}else b=e[13],y=e[14],j=e[15],v=e[16],S=e[17],N=e[18];let M;e[75]!==j||e[76]!==v?(M=t.jsx("div",{className:j,children:v}),e[75]=j,e[76]=v,e[77]=M):M=e[77];let w;e[78]!==b||e[79]!==y||e[80]!==r||e[81]!==x?(w=t.jsx(Ka,{open:r,onOpenChange:h,candidates:b,selectedIds:x,onToggle:y}),e[78]=b,e[79]=y,e[80]=r,e[81]=x,e[82]=w):w=e[82];let C;return e[83]!==S||e[84]!==N||e[85]!==M||e[86]!==w?(C=t.jsxs("section",{className:S,children:[N,M,w]}),e[83]=S,e[84]=N,e[85]=M,e[86]=w,e[87]=C):C=e[87],C}function Ka(a){const e=G.c(39),{open:n,onOpenChange:s,candidates:i,selectedIds:l,onToggle:o}=a,r=X(),[h,d]=W.useState("");let m,f,u,c,p,x,g,b,y;if(e[0]!==i||e[1]!==s||e[2]!==o||e[3]!==n||e[4]!==h||e[5]!==l||e[6]!==r){const N=h.toLowerCase(),M=i.filter(k=>k.title.toLowerCase().includes(N)||k.description?.toLowerCase().includes(N));f=Je,b=n,y=s,m=Ze,p="max-w-md";let w;e[16]!==r?(w=r("virtualMcp.subAgentsSection.title"),e[16]=r,e[17]=w):w=e[17],e[18]!==w?(x=t.jsx(dt,{children:t.jsx(ut,{children:w})}),e[18]=w,e[19]=x):x=e[19];let C;e[20]!==r?(C=r("virtualMcp.subAgentsSection.searchPlaceholder"),e[20]=r,e[21]=C):C=e[21],e[22]!==h||e[23]!==C?(g=t.jsx(vi,{value:h,onChange:d,placeholder:C,className:"w-full"}),e[22]=h,e[23]=C,e[24]=g):g=e[24],u="flex flex-col gap-1 max-h-80 overflow-y-auto",c=M.length===0?t.jsx("p",{className:"text-sm text-muted-foreground px-1 py-4 text-center",children:r("virtualMcp.subAgentsSection.noAgentsFound")}):M.map(k=>t.jsxs("button",{type:"button",onClick:()=>o(k.id),className:"flex items-center gap-3 px-2 py-2 rounded-lg hover:bg-accent/50 transition-colors cursor-pointer w-full text-left",children:[t.jsx(ks,{checked:l.includes(k.id),className:"pointer-events-none",tabIndex:-1}),t.jsx(Ge,{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[0]=i,e[1]=s,e[2]=o,e[3]=n,e[4]=h,e[5]=l,e[6]=r,e[7]=m,e[8]=f,e[9]=u,e[10]=c,e[11]=p,e[12]=x,e[13]=g,e[14]=b,e[15]=y}else m=e[7],f=e[8],u=e[9],c=e[10],p=e[11],x=e[12],g=e[13],b=e[14],y=e[15];let j;e[25]!==u||e[26]!==c?(j=t.jsx("div",{className:u,children:c}),e[25]=u,e[26]=c,e[27]=j):j=e[27];let v;e[28]!==m||e[29]!==p||e[30]!==x||e[31]!==g||e[32]!==j?(v=t.jsxs(m,{className:p,children:[x,g,j]}),e[28]=m,e[29]=p,e[30]=x,e[31]=g,e[32]=j,e[33]=v):v=e[33];let S;return e[34]!==f||e[35]!==b||e[36]!==y||e[37]!==v?(S=t.jsx(f,{open:b,onOpenChange:y,children:v}),e[34]=f,e[35]=b,e[36]=y,e[37]=v,e[38]=S):S=e[38],S}function qe(){const a=G.c(1);let e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(Xe,{className:"size-6 text-muted-foreground"})}),a[0]=e):e=a[0],e}function nt(a,e){return({error:n})=>n?.message?.includes("Method not found")||n?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:a})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(fs,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:e("virtualMcp.dependencySelectionDialog.somethingWentWrong")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:n?.message?n.message.length>200?`${n.message.slice(0,200)}...`:n.message:e("virtualMcp.dependencySelectionDialog.unexpectedError")})]})]})}function Us(a){const e=G.c(23),{item:n,isSelected:s,onToggle:i,disabled:l}=a,o=l?"cursor-not-allowed opacity-50":"cursor-pointer",r=s?"bg-accent/25":"hover:bg-muted/50";let h;e[0]!==o||e[1]!==r?(h=xe("flex items-start gap-3 p-4 rounded-lg transition-colors",o,r),e[0]=o,e[1]=r,e[2]=h):h=e[2];let d;e[3]!==n.name?(d=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:n.name}),e[3]=n.name,e[4]=d):d=e[4];let m;e[5]!==n.tags?(m=n.tags&&t.jsx("span",{className:"shrink-0",children:n.tags}),e[5]=n.tags,e[6]=m):m=e[6];let f;e[7]!==d||e[8]!==m?(f=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d,m]}),e[7]=d,e[8]=m,e[9]=f):f=e[9];let u;e[10]!==n.description?(u=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[10]=n.description,e[11]=u):u=e[11];let c;e[12]!==f||e[13]!==u?(c=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[f,u]}),e[12]=f,e[13]=u,e[14]=c):c=e[14];let p;e[15]!==l||e[16]!==s||e[17]!==i?(p=t.jsx(ks,{checked:s,onCheckedChange:i,disabled:l,className:"mt-0.5"}),e[15]=l,e[16]=s,e[17]=i,e[18]=p):p=e[18];let x;return e[19]!==h||e[20]!==c||e[21]!==p?(x=t.jsxs("label",{className:h,children:[c,p]}),e[19]=h,e[20]=c,e[21]=p,e[22]=x):x=e[22],x}function Wa(a){const e=G.c(35),{activeTab:n,onTabChange:s,showSelectAll:i,isAllSelected:l,handleSelectAll:o}=a,r=X();let h;e[0]!==r?(h=r("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=r,e[1]=h):h=e[1];let d;e[2]!==h?(d={id:"tools",label:h},e[2]=h,e[3]=d):d=e[3];let m;e[4]!==r?(m=r("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=r,e[5]=m):m=e[5];let f;e[6]!==m?(f={id:"active",label:m},e[6]=m,e[7]=f):f=e[7];let u;e[8]!==r?(u=r("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=r,e[9]=u):u=e[9];let c;e[10]!==u?(c={id:"resources",label:u},e[10]=u,e[11]=c):c=e[11];let p;e[12]!==r?(p=r("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=r,e[13]=p):p=e[13];let x;e[14]!==p?(x={id:"prompts",label:p},e[14]=p,e[15]=x):x=e[15];let g;e[16]!==d||e[17]!==f||e[18]!==c||e[19]!==x?(g=[d,f,c,x],e[16]=d,e[17]=f,e[18]=c,e[19]=x,e[20]=g):g=e[20];let b;e[21]!==s?(b=S=>s(S),e[21]=s,e[22]=b):b=e[22];let y;e[23]!==n||e[24]!==b||e[25]!==g?(y=t.jsx(bi,{tabs:g,activeTab:n,onTabChange:b}),e[23]=n,e[24]=b,e[25]=g,e[26]=y):y=e[26];let j;e[27]!==o||e[28]!==l||e[29]!==i||e[30]!==r?(j=i&&t.jsx("button",{type:"button",onClick:o,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r(l?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=o,e[28]=l,e[29]=i,e[30]=r,e[31]=j):j=e[31];let v;return e[32]!==y||e[33]!==j?(v=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border shrink-0",children:[y,j]}),e[32]=y,e[33]=j,e[34]=v):v=e[34],v}function Tt(a){const e=G.c(13),{items:n,selections:s,onToggle:i,emptyMessage:l,disabled:o}=a;let r,h,d;if(e[0]!==o||e[1]!==l||e[2]!==n||e[3]!==i||e[4]!==s){d=Symbol.for("react.early_return_sentinel");e:{const f=n.map(Ga);if(n.length===0){let u;e[8]!==l?(u=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:l})}),e[8]=l,e[9]=u):u=e[9],d=u;break e}r="flex-1 overflow-auto px-4 py-3 space-y-1",h=n.map(u=>t.jsx(Us,{item:u,isSelected:s===null||s?.includes(u.id),onToggle:()=>i(u.id,f),disabled:o},u.id))}e[0]=o,e[1]=l,e[2]=n,e[3]=i,e[4]=s,e[5]=r,e[6]=h,e[7]=d}else r=e[5],h=e[6],d=e[7];if(d!==Symbol.for("react.early_return_sentinel"))return d;let m;return e[10]!==r||e[11]!==h?(m=t.jsx("div",{className:r,children:h}),e[10]=r,e[11]=h,e[12]=m):m=e[12],m}function Ga(a){return a.id}function Ha(a){const e=G.c(22),{connectionId:n,toolSelections:s,onToggleTool:i}=a,l=X(),{org:o}=Ae();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=mt(r);let d;e[4]!==h?(d={client:h},e[4]=h,e[5]=d):d=e[5];const{data:m}=Ts(d),f=m.tools;let u,c,p;if(e[6]!==m.tools||e[7]!==i||e[8]!==l||e[9]!==s){p=Symbol.for("react.early_return_sentinel");e:{const g=f.map(Qa);let b;e[13]!==s?(b=v=>s===null||s.includes(v.name),e[13]=s,e[14]=b):b=e[14];const j=m.tools.filter(b).map(qa);if(j.length===0){let v;e[15]!==l?(v=l("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=l,e[16]=v):v=e[16];let S;e[17]!==v?(S=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:v})}),e[17]=v,e[18]=S):S=e[18],p=S;break e}u="flex-1 overflow-auto px-4 py-3 space-y-1",c=j.map(v=>t.jsx(Us,{item:v,isSelected:!0,onToggle:()=>i(v.id,g)},v.id))}e[6]=m.tools,e[7]=i,e[8]=l,e[9]=s,e[10]=u,e[11]=c,e[12]=p}else u=e[10],c=e[11],p=e[12];if(p!==Symbol.for("react.early_return_sentinel"))return p;let x;return e[19]!==u||e[20]!==c?(x=t.jsx("div",{className:u,children:c}),e[19]=u,e[20]=c,e[21]=x):x=e[21],x}function qa(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(_s,{annotations:a.annotations,_meta:a._meta})}}function Qa(a){return a.name}function Xa(a){const e=G.c(16),{connectionId:n,selections:s,onToggle:i,disabled:l}=a,{org:o}=Ae();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=mt(r);let d;e[4]!==h?(d={client:h},e[4]=h,e[5]=d):d=e[5];const{data:m}=Ts(d);let f;e[6]!==m.tools?(f=m.tools.map(Ja),e[6]=m.tools,e[7]=f):f=e[7];const u=f,c=X();let p;e[8]!==c?(p=c("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=c,e[9]=p):p=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==s||e[14]!==p?(x=t.jsx(Tt,{items:u,selections:s,onToggle:i,emptyMessage:p,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=s,e[14]=p,e[15]=x):x=e[15],x}function Ja(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(_s,{annotations:a.annotations,_meta:a._meta})}}function Za(a){const e=G.c(16),{connectionId:n,selections:s,onToggle:i,disabled:l}=a,{org:o}=Ae();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=mt(r);let d;e[4]!==h?(d={client:h},e[4]=h,e[5]=d):d=e[5];const{data:m}=Qs(d);let f;e[6]!==m.resources?(f=m.resources.map(el),e[6]=m.resources,e[7]=f):f=e[7];const u=f,c=X();let p;e[8]!==c?(p=c("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=c,e[9]=p):p=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==s||e[14]!==p?(x=t.jsx(Tt,{items:u,selections:s,onToggle:i,emptyMessage:p,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=s,e[14]=p,e[15]=x):x=e[15],x}function el(a){return{id:a.name||a.uri,name:a.name||a.uri,description:a.description}}function tl(a){const e=G.c(16),{connectionId:n,selections:s,onToggle:i,disabled:l}=a,{org:o}=Ae();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=mt(r);let d;e[4]!==h?(d={client:h},e[4]=h,e[5]=d):d=e[5];const{data:m}=ji(d);let f;e[6]!==m.prompts?(f=m.prompts.map(sl),e[6]=m.prompts,e[7]=f):f=e[7];const u=f,c=X();let p;e[8]!==c?(p=c("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=c,e[9]=p):p=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==s||e[14]!==p?(x=t.jsx(Tt,{items:u,selections:s,onToggle:i,emptyMessage:p,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=s,e[14]=p,e[15]=x):x=e[15],x}function sl(a){return{id:a.name,name:a.name,description:a.description}}function nl(a){const e=G.c(58),{currentConnection:n,activeTab:s,selectedId:i,formData:l,toggleTool:o,toggleResource:r,togglePrompt:h,toggleAllTools:d,toggleAllResources:m,toggleAllPrompts:f,onTabChange:u}=a,c=X(),p=l[i],x=s==="tools"?p?.tools===null:s==="resources"?p?.resources===null:s==="prompts"?p?.prompts===null:!1,g=s!=="active";let b;e[0]!==s||e[1]!==i||e[2]!==f||e[3]!==m||e[4]!==d?(b=()=>{s==="tools"?d(i):s==="resources"?m(i):s==="prompts"&&f(i)},e[0]=s,e[1]=i,e[2]=f,e[3]=m,e[4]=d,e[5]=b):b=e[5];const y=b;let j;e[6]!==n.icon||e[7]!==n.title?(j=t.jsx(Ge,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0"}),e[6]=n.icon,e[7]=n.title,e[8]=j):j=e[8];let v;e[9]!==n.title?(v=t.jsx("h2",{className:"text-base font-semibold truncate",children:n.title}),e[9]=n.title,e[10]=v):v=e[10];let S;e[11]!==n.description?(S=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[11]=n.description,e[12]=S):S=e[12];let N;e[13]!==v||e[14]!==S?(N=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,S]}),e[13]=v,e[14]=S,e[15]=N):N=e[15];let M;e[16]!==j||e[17]!==N?(M=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[j,N]})}),e[16]=j,e[17]=N,e[18]=M):M=e[18];let w;e[19]!==s||e[20]!==y||e[21]!==x||e[22]!==u||e[23]!==g?(w=t.jsx(Wa,{activeTab:s,onTabChange:u,showSelectAll:g,isAllSelected:x,handleSelectAll:y}),e[19]=s,e[20]=y,e[21]=x,e[22]=u,e[23]=g,e[24]=w):w=e[24];let C;e[25]!==s||e[26]!==l||e[27]!==i||e[28]!==c||e[29]!==o?(C=s==="active"&&t.jsx(Re,{fallback:nt(c("virtualMcp.dependencySelectionDialog.toolsNotSupported"),c),children:t.jsx(W.Suspense,{fallback:t.jsx(qe,{}),children:t.jsx(Ha,{connectionId:i,toolSelections:l[i]?l[i].tools:[],onToggleTool:(z,P)=>o(i,z,P)})})}),e[25]=s,e[26]=l,e[27]=i,e[28]=c,e[29]=o,e[30]=C):C=e[30];let k;e[31]!==s||e[32]!==l||e[33]!==i||e[34]!==c||e[35]!==o?(k=s==="tools"&&t.jsx(Re,{fallback:nt(c("virtualMcp.dependencySelectionDialog.toolsNotSupported"),c),children:t.jsx(W.Suspense,{fallback:t.jsx(qe,{}),children:t.jsx(Xa,{connectionId:i,selections:l[i]?l[i].tools:[],onToggle:(z,P)=>o(i,z,P)})})}),e[31]=s,e[32]=l,e[33]=i,e[34]=c,e[35]=o,e[36]=k):k=e[36];let T;e[37]!==s||e[38]!==l||e[39]!==i||e[40]!==c||e[41]!==r?(T=s==="resources"&&t.jsx(Re,{fallback:nt(c("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),c),children:t.jsx(W.Suspense,{fallback:t.jsx(qe,{}),children:t.jsx(Za,{connectionId:i,selections:l[i]?l[i].resources:[],onToggle:(z,P)=>r(i,z,P)})})}),e[37]=s,e[38]=l,e[39]=i,e[40]=c,e[41]=r,e[42]=T):T=e[42];let V;e[43]!==s||e[44]!==l||e[45]!==i||e[46]!==c||e[47]!==h?(V=s==="prompts"&&t.jsx(Re,{fallback:nt(c("virtualMcp.dependencySelectionDialog.promptsNotSupported"),c),children:t.jsx(W.Suspense,{fallback:t.jsx(qe,{}),children:t.jsx(tl,{connectionId:i,selections:l[i]?l[i].prompts:[],onToggle:(z,P)=>h(i,z,P)})})}),e[43]=s,e[44]=l,e[45]=i,e[46]=c,e[47]=h,e[48]=V):V=e[48];let A;e[49]!==T||e[50]!==V||e[51]!==C||e[52]!==k?(A=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[C,k,T,V]}),e[49]=T,e[50]=V,e[51]=C,e[52]=k,e[53]=A):A=e[53];let D;return e[54]!==A||e[55]!==M||e[56]!==w?(D=t.jsxs(t.Fragment,{children:[M,w,A]}),e[54]=A,e[55]=M,e[56]=w,e[57]=D):D=e[57],D}function il(a){const e=G.c(7),{onClose:n}=a,s=X();let i;e[0]!==n?(i=()=>n(!1),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==s?(l=s("virtualMcp.dependencySelectionDialog.done"),e[2]=s,e[3]=l):l=e[3];let o;return e[4]!==i||e[5]!==l?(o=t.jsx(ws,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(te,{variant:"outline",onClick:i,children:l})}),e[4]=i,e[5]=l,e[6]=o):o=e[6],o}function al(a){const e=G.c(23),{connectionId:n,onAuthenticate:s,children:i}=a,l=X();let o;e[0]!==n?(o={connectionId:n},e[0]=n,e[1]=o):o=e[1];const r=Vs(o);if(r.supportsOAuth&&!r.isAuthenticated){let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-muted",children:t.jsx(Wn,{size:22,className:"text-muted-foreground"})}),e[2]=m):m=e[2];let f;e[3]!==l?(f=l("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=l,e[4]=f):f=e[4];let u;e[5]!==f?(u=t.jsx("p",{className:"text-sm font-medium",children:f}),e[5]=f,e[6]=u):u=e[6];let c;e[7]!==l?(c=l("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=l,e[8]=c):c=e[8];let p;e[9]!==c?(p=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:c}),e[9]=c,e[10]=p):p=e[10];let x;e[11]!==u||e[12]!==p?(x=t.jsxs("div",{className:"space-y-1",children:[u,p]}),e[11]=u,e[12]=p,e[13]=x):x=e[13];let g;e[14]!==n||e[15]!==s||e[16]!==l?(g=s&&t.jsx(te,{variant:"outline",size:"sm",onClick:()=>s(n),children:l("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=n,e[15]=s,e[16]=l,e[17]=g):g=e[17];let b;return e[18]!==x||e[19]!==g?(b=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-8 text-center",children:[m,x,g]}),e[18]=x,e[19]=g,e[20]=b):b=e[20],b}let d;return e[21]!==i?(d=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=d):d=e[22],d}function ll(a){const e={};for(const n of a)e[n.connection_id]={tools:n.selected_tools,resources:n.selected_resources??null,prompts:n.selected_prompts??null};return e}function ss(a){return Object.entries(a).map(([e,n])=>({connection_id:e,selected_tools:n.tools,selected_resources:n.resources,selected_prompts:n.prompts}))}function ns(a,e,n,s){const i=a[e]??{tools:null,resources:null,prompts:null};return{...a,[e]:{...i,[n]:s}}}function rl(a,e){return e.type==="SET_ACTIVE_TAB"?{...a,activeTab:e.payload}:a}function ol(a){const e=G.c(49),{open:n,onOpenChange:s,selectedId:i,form:l,connections:o,onAuthenticate:r}=a;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activeTab:"tools"},e[0]=h):h=e[0];const[d,m]=W.useReducer(rl,h),f=Mt(i??"");let u;e[1]!==o?(u=o??[],e[1]=o,e[2]=u):u=e[2];let c;e[3]!==u?(c=ll(u),e[3]=u,e[4]=c):c=e[4];const p=c;let x;e[5]!==l||e[6]!==p?(x=(U,_,E,q)=>{const L=p[U]?.[_];let R;L===null?R=q.filter(K=>K!==E):L?.includes(E)?R=L.filter(K=>K!==E):(R=[...L??[],E],R.length===q.length&&(R=null)),l.setValue("connections",ss(ns(p,U,_,R)),{shouldDirty:!0,shouldTouch:!0})},e[5]=l,e[6]=p,e[7]=x):x=e[7];const g=x;let b;e[8]!==l||e[9]!==p?(b=(U,_)=>{const q=p[U]?.[_]===null?[]:null;l.setValue("connections",ss(ns(p,U,_,q)),{shouldDirty:!0,shouldTouch:!0})},e[8]=l,e[9]=p,e[10]=b):b=e[10];const y=b;let j;e[11]!==g?(j=(U,_,E)=>g(U,"tools",_,E),e[11]=g,e[12]=j):j=e[12];const v=j;let S;e[13]!==g?(S=(U,_,E)=>g(U,"resources",_,E),e[13]=g,e[14]=S):S=e[14];const N=S;let M;e[15]!==g?(M=(U,_,E)=>g(U,"prompts",_,E),e[15]=g,e[16]=M):M=e[16];const w=M;let C;e[17]!==y?(C=U=>y(U,"tools"),e[17]=y,e[18]=C):C=e[18];const k=C;let T;e[19]!==y?(T=U=>y(U,"resources"),e[19]=y,e[20]=T):T=e[20];const V=T;let A;e[21]!==y?(A=U=>y(U,"prompts"),e[21]=y,e[22]=A):A=e[22];const D=A;if(!i||!f)return null;let z;e[23]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(qe,{}),e[23]=z):z=e[23];let P;e[24]===Symbol.for("react.memo_cache_sentinel")?(P=U=>m({type:"SET_ACTIVE_TAB",payload:U}),e[24]=P):P=e[24];let $;e[25]!==f||e[26]!==d.activeTab||e[27]!==p||e[28]!==i||e[29]!==D||e[30]!==V||e[31]!==k||e[32]!==w||e[33]!==N||e[34]!==v?($=t.jsx(nl,{currentConnection:f,activeTab:d.activeTab,selectedId:i,formData:p,toggleTool:v,toggleResource:N,togglePrompt:w,toggleAllTools:k,toggleAllResources:V,toggleAllPrompts:D,onTabChange:P},i),e[25]=f,e[26]=d.activeTab,e[27]=p,e[28]=i,e[29]=D,e[30]=V,e[31]=k,e[32]=w,e[33]=N,e[34]=v,e[35]=$):$=e[35];let F;e[36]!==r||e[37]!==i||e[38]!==$?(F=t.jsx(W.Suspense,{fallback:z,children:t.jsx(al,{connectionId:i,onAuthenticate:r,children:$})}),e[36]=r,e[37]=i,e[38]=$,e[39]=F):F=e[39];let H;e[40]!==s?(H=t.jsx(il,{onClose:s}),e[40]=s,e[41]=H):H=e[41];let B;e[42]!==F||e[43]!==H?(B=t.jsxs(Ze,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[F,H]}),e[42]=F,e[43]=H,e[44]=B):B=e[44];let Y;return e[45]!==s||e[46]!==n||e[47]!==B?(Y=t.jsx(Je,{open:n,onOpenChange:s,children:B}),e[45]=s,e[46]=n,e[47]=B,e[48]=Y):Y=e[48],Y}const is="__new_instance__";function cl(a){const e=G.c(25),{connection_id:n,usedConnectionIds:s,onOpenSettings:i,onRemove:l,onAuthenticate:o,onSwitchInstance:r,onNewInstance:h}=a,d=Mt(n),{org:m}=Ae();if(!d){let g;return e[0]!==l?(g=t.jsx(fl,{onRemove:l}),e[0]=l,e[1]=g):g=e[1],g}let f;e[2]!==d?(f=yi(d),e[2]=d,e[3]=f):f=e[3];const u=f;let c;e[4]!==n?(c=t.jsx(ml,{connection_id:n}),e[4]=n,e[5]=c):c=e[5];let p;e[6]!==d.app_name||e[7]!==d.connection_type||e[8]!==d.description||e[9]!==d.icon||e[10]!==d.status||e[11]!==d.title||e[12]!==n||e[13]!==o||e[14]!==h||e[15]!==i||e[16]!==l||e[17]!==r||e[18]!==m.slug||e[19]!==u||e[20]!==s?(p=t.jsx(ul,{connection_id:n,connectionTitle:d.title,connectionDescription:d.description,connectionIcon:d.icon,connectionType:d.connection_type,connectionStatus:d.status,slug:u,orgSlug:m.slug,appName:d.app_name,usedConnectionIds:s,onOpenSettings:i,onRemove:l,onAuthenticate:o,onSwitchInstance:r,onNewInstance:h}),e[6]=d.app_name,e[7]=d.connection_type,e[8]=d.description,e[9]=d.icon,e[10]=d.status,e[11]=d.title,e[12]=n,e[13]=o,e[14]=h,e[15]=i,e[16]=l,e[17]=r,e[18]=m.slug,e[19]=u,e[20]=s,e[21]=p):p=e[21];let x;return e[22]!==c||e[23]!==p?(x=t.jsx(W.Suspense,{fallback:c,children:p}),e[22]=c,e[23]=p,e[24]=x):x=e[24],x}function dl(a){const e=G.c(24),{appName:n,connectionId:s,usedConnectionIds:i,onSwitchInstance:l,onNewInstance:o}=a,r=X();let h;e[0]!==n?(h={filters:[{column:"app_name",value:n}]},e[0]=n,e[1]=h):h=e[1];const d=Dn(h);if(d.length<=1&&!o)return null;let m;e[2]!==s||e[3]!==o||e[4]!==l?(m=g=>{g===is?o?.():l(s,g)},e[2]=s,e[3]=o,e[4]=l,e[5]=m):m=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(_e,{size:"sm",className:"w-auto text-xs gap-1 px-2 shadow-none",children:t.jsx(Ve,{})}),e[6]=f):f=e[6];let u;if(e[7]!==s||e[8]!==d||e[9]!==i){let g;e[11]!==s||e[12]!==i?(g=b=>t.jsx(ge,{value:b.id,className:"text-xs",disabled:b.id!==s&&i.has(b.id),children:b.title},b.id),e[11]=s,e[12]=i,e[13]=g):g=e[13],u=d.map(g),e[7]=s,e[8]=d,e[9]=i,e[10]=u}else u=e[10];let c;e[14]!==o||e[15]!==r?(c=o&&t.jsxs(ge,{value:is,className:"text-xs text-muted-foreground",children:["+ ",r("virtualMcp.connectionItem.newInstance")]}),e[14]=o,e[15]=r,e[16]=c):c=e[16];let p;e[17]!==u||e[18]!==c?(p=t.jsxs(Te,{children:[u,c]}),e[17]=u,e[18]=c,e[19]=p):p=e[19];let x;return e[20]!==s||e[21]!==m||e[22]!==p?(x=t.jsxs(De,{value:s,onValueChange:m,children:[f,p]}),e[20]=s,e[21]=m,e[22]=p,e[23]=x):x=e[23],x}function ul({connection_id:a,connectionTitle:e,connectionDescription:n,connectionIcon:s,connectionType:i,connectionStatus:l,slug:o,orgSlug:r,appName:h,usedConnectionIds:d,onOpenSettings:m,onRemove:f,onAuthenticate:u,onSwitchInstance:c,onNewInstance:p}){const x=Vs({connectionId:a}),g=gs(),y=!(i==="VIRTUAL")&&x.supportsOAuth&&!x.isAuthenticated,j=l!=="active",v=X(),S=async N=>{try{await g.update.mutateAsync({id:a,data:{status:N}}),re.success(v(N==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{re.error(v("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:xe("rounded-xl border overflow-hidden transition-colors",y||j?"border-destructive/50 bg-destructive/5":"border-border bg-card"),children:[t.jsxs(ps,{to:"/$org/settings/connections/$appSlug",params:{org:r,appSlug:o},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors",children:[t.jsx(Ge,{icon:s,name:e,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:e}),y?t.jsx("span",{className:"text-xs text-destructive font-medium",children:v("virtualMcp.connectionItem.needsAuthorization")}):j?t.jsx("span",{className:"text-xs text-destructive font-medium",children:v(l==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):n&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n})]}),y?t.jsx(te,{variant:"outline",size:"sm",className:"h-7 text-xs shrink-0",onClick:N=>{N.preventDefault(),N.stopPropagation(),u(a)},children:v("virtualMcp.connectionItem.authorize")}):j?t.jsxs(te,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:N=>{N.preventDefault(),N.stopPropagation(),S("active")},children:[t.jsx(Gn,{size:13}),v("virtualMcp.connectionItem.enable")]}):t.jsxs(we,{delayDuration:0,children:[t.jsx(Se,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center rounded-md h-7 w-7 hover:bg-accent text-muted-foreground shrink-0 transition-colors",children:t.jsx(mi,{size:16})})}),t.jsx(Ne,{side:"bottom",children:v("virtualMcp.connectionItem.connectionSettings")})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-t border-border bg-muted/25",children:[h&&t.jsx(dl,{appName:h,connectionId:a,usedConnectionIds:d,onSwitchInstance:c,onNewInstance:p}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(we,{delayDuration:0,children:[t.jsx(Se,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:m,"aria-label":v("virtualMcp.connectionItem.configureResources"),children:t.jsx(Hn,{size:13})})}),t.jsx(Ne,{side:"bottom",children:v("virtualMcp.connectionItem.configureResources")})]}),!j&&t.jsxs(we,{delayDuration:0,children:[t.jsx(Se,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>S("inactive"),"aria-label":v("virtualMcp.connectionItem.disableConnection"),children:t.jsx(qn,{size:13})})}),t.jsx(Ne,{side:"bottom",children:v("virtualMcp.connectionItem.disable")})]}),t.jsxs(we,{delayDuration:0,children:[t.jsx(Se,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:f,"aria-label":v("virtualMcp.connectionItem.removeConnection"),children:t.jsx(_t,{size:13})})}),t.jsx(Ne,{side:"bottom",children:v("virtualMcp.connectionItem.remove")})]})]})]})]})}function ml(a){const e=G.c(17),{connection_id:n}=a,s=Mt(n);if(!s){let f;return e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ys,{}),e[0]=f):f=e[0],f}let i;e[1]!==s.icon||e[2]!==s.title?(i=t.jsx(Ge,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0"}),e[1]=s.icon,e[2]=s.title,e[3]=i):i=e[3];let l;e[4]!==s.title?(l=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[4]=s.title,e[5]=l):l=e[5];let o;e[6]!==s.description?(o=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[6]=s.description,e[7]=o):o=e[7];let r;e[8]!==l||e[9]!==o?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,o]}),e[8]=l,e[9]=o,e[10]=r):r=e[10];let h;e[11]!==i||e[12]!==r?(h=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,r]}),e[11]=i,e[12]=r,e[13]=h):h=e[13];let d;e[14]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})}),e[14]=d):d=e[14];let m;return e[15]!==h?(m=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[h,d]}),e[15]=h,e[16]=m):m=e[16],m}function fl(a){const e=G.c(20),{onRemove:n}=a,s=X();let i;e[0]!==s?(i=s("virtualMcp.connectionItem.connectionNotFound"),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==i?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm text-destructive font-medium truncate",children:i})}),e[2]=i,e[3]=l):l=e[3];let o;e[4]!==s?(o=s("virtualMcp.connectionItem.removeConnection"),e[4]=s,e[5]=o):o=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(_t,{size:13}),e[6]=r):r=e[6];let h;e[7]!==n||e[8]!==o?(h=t.jsx(Se,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive shrink-0",onClick:n,"aria-label":o,children:r})}),e[7]=n,e[8]=o,e[9]=h):h=e[9];let d;e[10]!==s?(d=s("virtualMcp.connectionItem.remove"),e[10]=s,e[11]=d):d=e[11];let m;e[12]!==d?(m=t.jsx(Ne,{side:"bottom",children:d}),e[12]=d,e[13]=m):m=e[13];let f;e[14]!==h||e[15]!==m?(f=t.jsxs(we,{delayDuration:0,children:[h,m]}),e[14]=h,e[15]=m,e[16]=f):f=e[16];let u;return e[17]!==l||e[18]!==f?(u=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-destructive/50 bg-destructive/5",children:[l,f]}),e[17]=l,e[18]=f,e[19]=u):u=e[19],u}function Ys(){const a=G.c(3);let e;a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),a[0]=e):e=a[0];let n;a[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e,t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-48 rounded bg-muted animate-pulse"})]})]}),a[1]=n):n=a[1];let s;return a[2]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[n,t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})})]}),a[2]=s):s=a[2],s}function Bs(a){const e=G.c(85),{value:n,onChange:s,onColorChange:i,name:l,size:o,className:r,avatarClassName:h,showHoverOverlay:d,disabled:m}=a,f=o===void 0?"lg":o,u=d===void 0?!0:d,c=m===void 0?!1:m,p=X(),[x,g]=W.useState(!1),[b,y]=W.useState("icons"),[j,v]=W.useState(""),[S,N]=W.useState("blue");let M;e[0]!==n?(M=Qn(n),e[0]=n,e[1]=M):M=e[1];const w=M,C=w.type==="icon"||w.type==="url"&&w.color?w.color:S;let k;e[2]!==s||e[3]!==C?(k=ce=>{s(xt(ce,C))},e[2]=s,e[3]=C,e[4]=k):k=e[4];const T=k;let V;e[5]!==s||e[6]!==i||e[7]!==w.name||e[8]!==w.type||e[9]!==w.url?(V=ce=>{N(ce),i?.(ce),w.type==="icon"?s(xt(w.name,ce)):w.type==="url"&&s(Lt(w.url,ce))},e[5]=s,e[6]=i,e[7]=w.name,e[8]=w.type,e[9]=w.url,e[10]=V):V=e[10];const A=V;let D;e[11]!==s||e[12]!==C?(D=ce=>{s(Lt(ce,C)),g(!1)},e[11]=s,e[12]=C,e[13]=D):D=e[13];const z=D;let P;e[14]!==s||e[15]!==C?(P=()=>{const ce=Ss(),me=ce[Math.floor(Math.random()*ce.length)];s(xt(me,C))},e[14]=s,e[15]=C,e[16]=P):P=e[16];const $=P,F=c?!1:x;let H;e[17]!==p?(H=p("common.iconPicker.changeIcon"),e[17]=p,e[18]=H):H=e[18];const B=c?"cursor-default opacity-50":"cursor-pointer";let Y;e[19]!==r||e[20]!==f||e[21]!==B?(Y=xe("relative group overflow-hidden",B,Xn(f),r),e[19]=r,e[20]=f,e[21]=B,e[22]=Y):Y=e[22];let U;e[23]!==h||e[24]!==l||e[25]!==f||e[26]!==n?(U=t.jsx(Ut,{icon:n,name:l,size:f,className:h}),e[23]=h,e[24]=l,e[25]=f,e[26]=n,e[27]=U):U=e[27];let _;e[28]!==c||e[29]!==u?(_=u&&!c&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(ti,{size:16,className:"text-white"})}),e[28]=c,e[29]=u,e[30]=_):_=e[30];let E;e[31]!==c||e[32]!==H||e[33]!==Y||e[34]!==U||e[35]!==_?(E=t.jsx(Ds,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":H,disabled:c,className:Y,children:[U,_]})}),e[31]=c,e[32]=H,e[33]=Y,e[34]=U,e[35]=_,e[36]=E):E=e[36];let q;e[37]!==l||e[38]!==n?(q=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(Ut,{icon:n,name:l,size:"xl"})}),e[37]=l,e[38]=n,e[39]=q):q=e[39];let L;e[40]!==b?(L=ce=>{if(ce.key!=="ArrowLeft"&&ce.key!=="ArrowRight")return;ce.preventDefault();const me=b==="icons"?"upload":"icons";y(me),document.getElementById(`icon-picker-tab-${me}`)?.focus()},e[40]=b,e[41]=L):L=e[41];const R=b==="icons",K=b==="icons"?0:-1;let Z;e[42]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>y("icons"),e[42]=Z):Z=e[42];const ae=b==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let ee;e[43]!==ae?(ee=xe("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",ae),e[43]=ae,e[44]=ee):ee=e[44];let de;e[45]!==p?(de=p("common.iconPicker.iconsTab"),e[45]=p,e[46]=de):de=e[46];let oe;e[47]!==R||e[48]!==K||e[49]!==ee||e[50]!==de?(oe=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":R,"aria-controls":"icon-picker-panel-icons",tabIndex:K,onClick:Z,className:ee,children:de}),e[47]=R,e[48]=K,e[49]=ee,e[50]=de,e[51]=oe):oe=e[51];const ue=b==="upload",se=b==="upload"?0:-1;let fe;e[52]===Symbol.for("react.memo_cache_sentinel")?(fe=()=>y("upload"),e[52]=fe):fe=e[52];const ve=b==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let Ce;e[53]!==ve?(Ce=xe("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",ve),e[53]=ve,e[54]=Ce):Ce=e[54];let O;e[55]!==p?(O=p("common.iconPicker.uploadTab"),e[55]=p,e[56]=O):O=e[56];let ne;e[57]!==ue||e[58]!==se||e[59]!==Ce||e[60]!==O?(ne=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":ue,"aria-controls":"icon-picker-panel-upload",tabIndex:se,onClick:fe,className:Ce,children:O}),e[57]=ue,e[58]=se,e[59]=Ce,e[60]=O,e[61]=ne):ne=e[61];let Q;e[62]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx("div",{className:"flex-1"}),e[62]=Q):Q=e[62];let ie;e[63]!==L||e[64]!==oe||e[65]!==ne?(ie=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:L,children:[oe,ne,Q]}),e[63]=L,e[64]=oe,e[65]=ne,e[66]=ie):ie=e[66];let I;e[67]!==A||e[68]!==$||e[69]!==T||e[70]!==z||e[71]!==w.name||e[72]!==w.type||e[73]!==j||e[74]!==C||e[75]!==b?(I=b==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(gl,{search:j,onSearchChange:v,selectedColor:C,onColorChange:A,onSelectIcon:T,onRandom:$,currentIconName:w.type==="icon"?w.name:null})}):t.jsx("div",{id:"icon-picker-panel-upload",role:"tabpanel","aria-labelledby":"icon-picker-tab-upload",children:t.jsx(vl,{onUpload:z})}),e[67]=A,e[68]=$,e[69]=T,e[70]=z,e[71]=w.name,e[72]=w.type,e[73]=j,e[74]=C,e[75]=b,e[76]=I):I=e[76];let J;e[77]!==q||e[78]!==ie||e[79]!==I?(J=t.jsx(As,{align:"start",className:"w-80 p-0",onOpenAutoFocus:pl,children:t.jsxs("div",{className:"flex flex-col",children:[q,ie,I]})}),e[77]=q,e[78]=ie,e[79]=I,e[80]=J):J=e[80];let be;return e[81]!==E||e[82]!==J||e[83]!==F?(be=t.jsxs(Is,{open:F,onOpenChange:g,children:[E,J]}),e[81]=E,e[82]=J,e[83]=F,e[84]=be):be=e[84],be}function pl(a){return a.preventDefault()}function hl(a){const e=G.c(33),{selectedColor:n,onColorChange:s}=a,i=X(),[l,o]=W.useState(!1);let r,h,d,m,f,u,c;if(e[0]!==l||e[1]!==n){const S=Ns(n);h=Is,u=l,c=o,r=Ds,f=!0,d="button",m=xe("h-6 w-6 rounded-full shrink-0 ring-2 ring-offset-2 ring-offset-background transition-all cursor-pointer hover:scale-110",S.dot,"ring-foreground/20"),e[0]=l,e[1]=n,e[2]=r,e[3]=h,e[4]=d,e[5]=m,e[6]=f,e[7]=u,e[8]=c}else r=e[2],h=e[3],d=e[4],m=e[5],f=e[6],u=e[7],c=e[8];let p;e[9]!==i?(p=i("common.iconPicker.changeColor"),e[9]=i,e[10]=p):p=e[10];let x;e[11]!==i?(x=i("common.iconPicker.changeColor"),e[11]=i,e[12]=x):x=e[12];let g;e[13]!==d||e[14]!==m||e[15]!==p||e[16]!==x?(g=t.jsx("button",{type:d,className:m,title:p,"aria-label":x}),e[13]=d,e[14]=m,e[15]=p,e[16]=x,e[17]=g):g=e[17];let b;e[18]!==r||e[19]!==f||e[20]!==g?(b=t.jsx(r,{asChild:f,children:g}),e[18]=r,e[19]=f,e[20]=g,e[21]=b):b=e[21];let y;e[22]!==s||e[23]!==n?(y=ni.map(S=>t.jsx("button",{type:"button",onClick:()=>{s(S.name),o(!1)},className:xe("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",S.dot,n===S.name?"ring-2 ring-offset-1 ring-offset-background ring-foreground/30 scale-110":"hover:scale-110"),title:S.name,"aria-label":S.name},S.name)),e[22]=s,e[23]=n,e[24]=y):y=e[24];let j;e[25]!==y?(j=t.jsx(As,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:xl,children:t.jsx("div",{className:"grid grid-cols-4 gap-1",children:y})}),e[25]=y,e[26]=j):j=e[26];let v;return e[27]!==h||e[28]!==j||e[29]!==u||e[30]!==c||e[31]!==b?(v=t.jsxs(h,{open:u,onOpenChange:c,children:[b,j]}),e[27]=h,e[28]=j,e[29]=u,e[30]=c,e[31]=b,e[32]=v):v=e[32],v}function xl(a){return a.preventDefault()}function gl(a){const e=G.c(55),{search:n,onSearchChange:s,selectedColor:i,onColorChange:l,onSelectIcon:o,onRandom:r,currentIconName:h}=a,d=X();let m,f,u,c,p,x,g;if(e[0]!==h||e[1]!==l||e[2]!==r||e[3]!==s||e[4]!==o||e[5]!==n||e[6]!==i||e[7]!==d){const S=Ss(),N=Ns(i);f=Jn(S,n),x="flex flex-col";let M;e[15]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(yt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=M):M=e[15];let w;e[16]!==s?(w=P=>s(P.target.value),e[16]=s,e[17]=w):w=e[17];let C;e[18]!==d?(C=d("common.iconPicker.filterPlaceholder"),e[18]=d,e[19]=C):C=e[19];let k;e[20]!==n||e[21]!==w||e[22]!==C?(k=t.jsxs("div",{className:"relative flex-1",children:[M,t.jsx(ke,{value:n,onChange:w,placeholder:C,className:"h-8 text-xs pl-7"})]}),e[20]=n,e[21]=w,e[22]=C,e[23]=k):k=e[23];let T;e[24]!==d?(T=d("common.iconPicker.randomIcon"),e[24]=d,e[25]=T):T=e[25];let V;e[26]!==d?(V=d("common.iconPicker.randomIcon"),e[26]=d,e[27]=V):V=e[27];let A;e[28]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(si,{size:14,className:"text-muted-foreground"}),e[28]=A):A=e[28];let D;e[29]!==r||e[30]!==T||e[31]!==V?(D=t.jsx("button",{type:"button",onClick:r,className:"h-8 w-8 flex items-center justify-center rounded-lg border border-border hover:bg-accent transition-colors shrink-0",title:T,"aria-label":V,children:A}),e[29]=r,e[30]=T,e[31]=V,e[32]=D):D=e[32];let z;e[33]!==l||e[34]!==i?(z=t.jsx(hl,{selectedColor:i,onColorChange:l}),e[33]=l,e[34]=i,e[35]=z):z=e[35],e[36]!==D||e[37]!==z||e[38]!==k?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[k,D,z]}),e[36]=D,e[37]=z,e[38]=k,e[39]=g):g=e[39],m=wi,p="h-56",u="grid grid-cols-9 gap-0.5 px-2 pb-2",c=f.map(P=>{const $=Zn(P);return $?t.jsx("button",{type:"button",onClick:()=>o(P),className:xe("h-8 w-8 flex items-center justify-center rounded-lg transition-colors cursor-pointer",h===P?xe(N.bg,N.text):xe(N.text,"hover:bg-accent")),title:P,"aria-label":ei(P),children:t.jsx($,{size:18})},P):null}),e[0]=h,e[1]=l,e[2]=r,e[3]=s,e[4]=o,e[5]=n,e[6]=i,e[7]=d,e[8]=m,e[9]=f,e[10]=u,e[11]=c,e[12]=p,e[13]=x,e[14]=g}else m=e[8],f=e[9],u=e[10],c=e[11],p=e[12],x=e[13],g=e[14];let b;e[40]!==u||e[41]!==c?(b=t.jsx("div",{className:u,children:c}),e[40]=u,e[41]=c,e[42]=b):b=e[42];let y;e[43]!==f.length||e[44]!==d?(y=f.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:d("common.iconPicker.noIconsFound")}),e[43]=f.length,e[44]=d,e[45]=y):y=e[45];let j;e[46]!==m||e[47]!==p||e[48]!==b||e[49]!==y?(j=t.jsxs(m,{className:p,children:[b,y]}),e[46]=m,e[47]=p,e[48]=b,e[49]=y,e[50]=j):j=e[50];let v;return e[51]!==x||e[52]!==g||e[53]!==j?(v=t.jsxs("div",{className:x,children:[g,j]}),e[51]=x,e[52]=g,e[53]=j,e[54]=v):v=e[54],v}function vl(a){const e=G.c(46),{onUpload:n}=a,s=X(),i=W.useRef(null);let l;e[0]!==n||e[1]!==s?(l=D=>{const z=D.target.files?.[0];if(!z)return;if(z.size>2097152){re.error(s("common.iconPicker.imageTooLarge")),D.target.value="";return}const P=new FileReader;P.onerror=()=>{re.error(s("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},P.onloadend=()=>{P.readyState===FileReader.DONE&&P.result&&n(P.result),i.current&&(i.current.value="")},P.readAsDataURL(z)},e[0]=n,e[1]=s,e[2]=l):l=e[2];const o=l,[r,h]=W.useState("");let d;e[3]!==n||e[4]!==r?(d=()=>{const D=r.trim();D&&(n(D),h(""))},e[3]=n,e[4]=r,e[5]=d):d=e[5];const m=d;let f;e[6]!==o?(f=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:o}),e[6]=o,e[7]=f):f=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i.current?.click(),e[8]=u):u=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Si,{size:20}),e[9]=c):c=e[9];let p;e[10]!==s?(p=s("common.iconPicker.uploadHint"),e[10]=s,e[11]=p):p=e[11];let x;e[12]!==p?(x=t.jsxs("button",{type:"button",onClick:u,className:"h-24 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-2 text-muted-foreground hover:text-foreground",children:[c,t.jsx("span",{className:"text-xs",children:p})]}),e[12]=p,e[13]=x):x=e[13];let g;e[14]!==s?(g=s("common.iconPicker.or"),e[14]=s,e[15]=g):g=e[15];let b;e[16]!==g?(b=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[16]=g,e[17]=b):b=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex-1 h-px bg-border"}),e[18]=y):y=e[18];let j;e[19]!==b?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[b,y]}),e[19]=b,e[20]=j):j=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=D=>h(D.target.value),e[21]=v):v=e[21];let S;e[22]!==s?(S=s("common.iconPicker.pasteUrlPlaceholder"),e[22]=s,e[23]=S):S=e[23];let N;e[24]!==m?(N=D=>{D.key==="Enter"&&(D.preventDefault(),m())},e[24]=m,e[25]=N):N=e[25];let M;e[26]!==r||e[27]!==S||e[28]!==N?(M=t.jsx(ke,{value:r,onChange:v,placeholder:S,className:"h-8 text-xs flex-1",onKeyDown:N}),e[26]=r,e[27]=S,e[28]=N,e[29]=M):M=e[29];let w;e[30]!==r?(w=r.trim(),e[30]=r,e[31]=w):w=e[31];const C=!w;let k;e[32]!==s?(k=s("common.iconPicker.apply"),e[32]=s,e[33]=k):k=e[33];let T;e[34]!==m||e[35]!==C||e[36]!==k?(T=t.jsx(te,{variant:"outline",size:"sm",className:"h-8 px-3 text-xs shrink-0",onClick:m,disabled:C,children:k}),e[34]=m,e[35]=C,e[36]=k,e[37]=T):T=e[37];let V;e[38]!==M||e[39]!==T?(V=t.jsxs("div",{className:"flex items-center gap-1.5",children:[M,T]}),e[38]=M,e[39]=T,e[40]=V):V=e[40];let A;return e[41]!==j||e[42]!==V||e[43]!==f||e[44]!==x?(A=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[f,x,j,V]}),e[41]=j,e[42]=V,e[43]=f,e[44]=x,e[45]=A):A=e[45],A}function bl(a){const e=G.c(10),{viewId:n}=a;if(n==="overview"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Cs,{size:16}),e[0]=i):i=e[0],i}if(n==="reports"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Yt,{size:16}),e[1]=i):i=e[1],i}if(n==="board"){let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ii,{size:16}),e[2]=i):i=e[2],i}if(n==="site-editor"){let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Mi,{size:16}),e[3]=i):i=e[3],i}if(n==="assets"){let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ci,{size:16}),e[4]=i):i=e[4],i}if(n==="hosting"){let i;return e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Xs,{size:16}),e[5]=i):i=e[5],i}if(n==="e2e"){let i;return e[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ai,{size:16}),e[6]=i):i=e[6],i}if(n==="analytics"){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Yt,{size:16}),e[7]=i):i=e[7],i}if(n==="cdn"){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(li,{size:16}),e[8]=i):i=e[8],i}let s;return e[9]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Ms,{size:16}),e[9]=s):s=e[9],s}function as(a){const e=G.c(51),{pinned:n,canSetMainView:s,onOpen:i,onTogglePin:l,onSetMainView:o}=a,r=X(),h=n?"text-foreground":"text-muted-foreground/40";let d;e[0]!==h?(d=xe("size-7",h),e[0]=h,e[1]=d):d=e[1];let m;e[2]!==n||e[3]!==r?(m=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=n,e[3]=r,e[4]=m):m=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Bt,{size:16}),e[5]=f):f=e[5];let u;e[6]!==l||e[7]!==n||e[8]!==d||e[9]!==m?(u=t.jsx(Se,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:d,"aria-label":m,"aria-pressed":n,onClick:l,children:f})}),e[6]=l,e[7]=n,e[8]=d,e[9]=m,e[10]=u):u=e[10];let c;e[11]!==n||e[12]!==r?(c=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=n,e[12]=r,e[13]=c):c=e[13];let p;e[14]!==c?(p=t.jsx(Ne,{side:"top",children:c}),e[14]=c,e[15]=p):p=e[15];let x;e[16]!==u||e[17]!==p?(x=t.jsxs(we,{delayDuration:0,children:[u,p]}),e[16]=u,e[17]=p,e[18]=x):x=e[18];let g;e[19]!==r?(g=r("virtualMcp.settings.views.rowActions"),e[19]=r,e[20]=g):g=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Ni,{size:16}),e[21]=b):b=e[21];let y;e[22]!==g?(y=t.jsx(us,{asChild:!0,children:t.jsx(te,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground","aria-label":g,children:b})}),e[22]=g,e[23]=y):y=e[23];let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(Js,{size:14}),e[24]=j):j=e[24];let v;e[25]!==r?(v=r("virtualMcp.settings.views.open"),e[25]=r,e[26]=v):v=e[26];let S;e[27]!==i||e[28]!==v?(S=t.jsxs(Ke,{onClick:i,children:[j,v]}),e[27]=i,e[28]=v,e[29]=S):S=e[29];let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Bt,{size:14}),e[30]=N):N=e[30];let M;e[31]!==n||e[32]!==r?(M=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=n,e[32]=r,e[33]=M):M=e[33];let w;e[34]!==l||e[35]!==M?(w=t.jsxs(Ke,{onClick:l,children:[N,M]}),e[34]=l,e[35]=M,e[36]=w):w=e[36];let C;e[37]!==s||e[38]!==o||e[39]!==r?(C=s&&t.jsxs(Ke,{onClick:o,children:[t.jsx(Cs,{size:14}),r("virtualMcp.settings.views.setMainView")]}),e[37]=s,e[38]=o,e[39]=r,e[40]=C):C=e[40];let k;e[41]!==S||e[42]!==w||e[43]!==C?(k=t.jsxs(ms,{align:"end",children:[S,w,C]}),e[41]=S,e[42]=w,e[43]=C,e[44]=k):k=e[44];let T;e[45]!==y||e[46]!==k?(T=t.jsxs(ds,{children:[y,k]}),e[45]=y,e[46]=k,e[47]=T):T=e[47];let V;return e[48]!==T||e[49]!==x?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[x,T]}),e[48]=T,e[49]=x,e[50]=V):V=e[50],V}const ls=a=>a.stopPropagation();function jl(a){const e=G.c(8),{icon:n,title:s}=a;let i;e[0]!==n||e[1]!==s?(i=t.jsx(Ge,{icon:n,name:s,size:"xs",className:"shrink-0"}),e[0]=n,e[1]=s,e[2]=i):i=e[2];let l;e[3]!==s?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:s}),e[3]=s,e[4]=l):l=e[4];let o;return e[5]!==i||e[6]!==l?(o=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,l]}),e[5]=i,e[6]=l,e[7]=o):o=e[7],o}function yl(a){const e=G.c(70),{views:n}=a,s=X();let i;e[0]!==s?(i=s("virtualMcp.settings.views.defaults"),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==s?(l=s("virtualMcp.layoutTabContent.mainView"),e[2]=s,e[3]=l):l=e[3];let o;e[4]!==s?(o=s("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=s,e[5]=o):o=e[5];const r=n.defaultMainView,h=n.setMainView;let d;e[6]!==s?(d=s("virtualMcp.layoutTabContent.mainView"),e[6]=s,e[7]=d):d=e[7];let m;e[8]!==s?(m=s("virtualMcp.layoutTabContent.noMainView"),e[8]=s,e[9]=m):m=e[9];let f;e[10]!==m?(f=t.jsx(Ve,{placeholder:m}),e[10]=m,e[11]=f):f=e[11];let u;e[12]!==d||e[13]!==f?(u=t.jsx(_e,{"aria-label":d,className:"w-36 h-8 text-sm shrink-0 @min-xl/project-settings:w-44",children:f}),e[12]=d,e[13]=f,e[14]=u):u=e[14];let c;e[15]!==n.defaultMainOptions?(c=n.defaultMainOptions.map(wl),e[15]=n.defaultMainOptions,e[16]=c):c=e[16];let p;e[17]!==c?(p=t.jsx(Te,{children:c}),e[17]=c,e[18]=p):p=e[18];let x;e[19]!==p||e[20]!==u||e[21]!==n.defaultMainView||e[22]!==n.setMainView?(x=t.jsxs(De,{value:r,onValueChange:h,children:[u,p]}),e[19]=p,e[20]=u,e[21]=n.defaultMainView,e[22]=n.setMainView,e[23]=x):x=e[23];let g;e[24]!==x||e[25]!==l||e[26]!==o?(g=t.jsx(He,{title:l,description:o,action:x}),e[24]=x,e[25]=l,e[26]=o,e[27]=g):g=e[27];let b;e[28]!==s?(b=s("virtualMcp.layoutTabContent.showChat"),e[28]=s,e[29]=b):b=e[29];let y;e[30]!==s?(y=s("virtualMcp.layoutTabContent.showChatDescription"),e[30]=s,e[31]=y):y=e[31];let j;e[32]!==s?(j=s("virtualMcp.layoutTabContent.showChat"),e[32]=s,e[33]=j):j=e[33];const v=n.noMainView?!0:n.chatDefaultOpen;let S;e[34]!==j||e[35]!==v||e[36]!==n.noMainView||e[37]!==n.setChatDefaultOpen?(S=t.jsx(Se,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(et,{"aria-label":j,checked:v,disabled:n.noMainView,onCheckedChange:n.setChatDefaultOpen})})}),e[34]=j,e[35]=v,e[36]=n.noMainView,e[37]=n.setChatDefaultOpen,e[38]=S):S=e[38];let N;e[39]!==s||e[40]!==n.noMainView?(N=n.noMainView&&t.jsx(Ne,{side:"top",children:s("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[39]=s,e[40]=n.noMainView,e[41]=N):N=e[41];let M;e[42]!==S||e[43]!==N?(M=t.jsxs(we,{delayDuration:0,children:[S,N]}),e[42]=S,e[43]=N,e[44]=M):M=e[44];let w;e[45]!==b||e[46]!==y||e[47]!==M?(w=t.jsx(He,{title:b,description:y,action:M}),e[45]=b,e[46]=y,e[47]=M,e[48]=w):w=e[48];let C;e[49]!==g||e[50]!==w?(C=t.jsxs(Le,{children:[g,w]}),e[49]=g,e[50]=w,e[51]=C):C=e[51];let k;e[52]!==i||e[53]!==C?(k=t.jsx(Be,{title:i,children:C}),e[52]=i,e[53]=C,e[54]=k):k=e[54];let T;e[55]!==s?(T=s("virtualMcp.settings.views.sidebar"),e[55]=s,e[56]=T):T=e[56];let V;e[57]!==n?(V=n.projectViews.map($=>{const F=n.pinned($);return t.jsx(He,{icon:t.jsx(bl,{viewId:$}),title:n.labels[$],onClick:()=>n.openView($),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(as,{pinned:F,canSetMainView:F&&!n.isMainView($),onOpen:()=>n.openView($),onTogglePin:()=>n.togglePin($,!F),onSetMainView:()=>n.setMainView($)}),t.jsx("span",{onClick:()=>n.openView($),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Ft,{size:16})})]})},$)}),e[57]=n,e[58]=V):V=e[58];let A;e[59]!==n?(A=n.connectionsData.flatMap($=>[t.jsx(jl,{icon:$.icon,title:$.title},`${$.id}:header`),...$.uiTools.map(F=>{const H=n.pinnedAppViews.find(_=>_.connectionId===$.id&&_.toolName===F.name),B=!!H,Y=Zs($.id,F.name),U=`ext-apps:${$.id}:${F.name}`;return t.jsx(He,{onClick:()=>n.openView(Y),icon:B?t.jsx("span",{onClick:ls,children:t.jsx(Bs,{value:H.icon??null,name:H.label||F.name,size:"xs",showHoverOverlay:!1,onChange:_=>n.setAppViewIcon($.id,F.name,_)})}):t.jsx(Ms,{size:16}),title:B?t.jsx("span",{onClick:ls,children:t.jsx(ke,{value:H.label,onChange:_=>n.setAppViewLabel($.id,F.name,_.target.value),onBlur:n.commitAppViewLabel,"aria-label":F.title??wt(F.name),className:"h-7 w-full max-w-52 text-sm"})}):F.title??wt(F.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(as,{pinned:B,canSetMainView:B&&!n.isMainView(U),onOpen:()=>n.openView(Y),onTogglePin:()=>n.toggleAppViewPin($.id,F.name),onSetMainView:()=>n.setMainView(U)}),t.jsx("span",{onClick:()=>n.openView(Y),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Ft,{size:16})})]})},`${$.id}:${F.name}`)})]),e[59]=n,e[60]=A):A=e[60];let D;e[61]!==V||e[62]!==A?(D=t.jsxs(Le,{children:[V,A]}),e[61]=V,e[62]=A,e[63]=D):D=e[63];let z;e[64]!==T||e[65]!==D?(z=t.jsx(Be,{title:T,children:D}),e[64]=T,e[65]=D,e[66]=z):z=e[66];let P;return e[67]!==k||e[68]!==z?(P=t.jsxs(t.Fragment,{children:[k,z]}),e[67]=k,e[68]=z,e[69]=P):P=e[69],P}function wl(a){return t.jsx(ge,{value:a.value,children:a.label},a.value)}const Ks="site-editor",Sl=new Set([Ks,"content"]);function Nl({virtualMcpId:a,form:e,flushAndSave:n}){const s=X(),i=ot(),{openPanel:l}=Ti(),o=bs(a),r=Di(o),h=Os(a),d=Fi(a),m=(o?.connections??[]).map(_=>_.connection_id).sort(),{data:f}=en({queryKey:hs.projectConnectionDetails(a,m),enabled:m.length>0,queryFn:async()=>await Promise.all(m.map(async E=>{try{const{item:q}=await i.call("COLLECTION_CONNECTIONS_GET",{id:E}),L=(q?.tools??[]).flatMap(R=>{const K=ki(R._meta);return K?[{name:R.name,title:R.title,description:R.description,resourceUri:K}]:[]});return{fetchOk:!0,id:E,title:q?.title??E,icon:q?.icon??null,uiTools:L}}catch{return{fetchOk:!1,id:E,title:E,icon:null,uiTools:[]}}}))}),u=(f??[]).filter(_=>_.uiTools.length>0),c=new Set([...tn,...sn]),p=e.watch("metadata.ui.pinnedViews")??[],x=e.watch("metadata.ui.layout")??null,g=x?.defaultMainView??null,b=x?.chatDefaultOpen??!1,y=St(Nt({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:x}}),e.watch("metadata.sidebarViewsVersion")),j=d??(o?St(Nt(o.metadata),o.metadata.sidebarViewsVersion):y),v=(()=>{if(!g||g.type==="chat")return"";const _=nn(g.type);return _==="instructions"||_==="connections"||_==="layout"?"settings":Sl.has(_)?Ks:c.has(_)?_:`${_}:${g.id??""}:${g.toolName??""}`})(),S=v==="",N=_=>{const[E,q,L]=_.split(":");return E?c.has(E)?{type:E}:E==="ext-apps"&&q?{type:"ext-apps",id:q,toolName:L||void 0}:null:null},M=_=>{e.setValue("metadata.ui.pinnedViews",_,{shouldDirty:!0})},w=_=>{e.setValue("metadata.ui.layout",{...x,..._},{shouldDirty:!0})},C=W.useRef(!1);if(f&&f.length>0&&!C.current){C.current=!0;const _=new Set((f??[]).filter(R=>R.fetchOk).map(R=>R.id)),E=new Set(u.flatMap(R=>R.uiTools.map(K=>`${R.id}:${K.name}`))),q=new Set(m),L=p.filter(R=>q.has(R.connectionId)&&(!_.has(R.connectionId)||E.has(`${R.connectionId}:${R.toolName}`)));L.length!==p.length&&(M(L),g?.type==="ext-apps"&&!L.some(R=>R.connectionId===g.id&&R.toolName===g.toolName)&&w({defaultMainView:{type:"settings"}}))}const k=(_,E)=>{if(p.some(L=>L.connectionId===_&&L.toolName===E)){const L=p.filter(K=>!(K.connectionId===_&&K.toolName===E));M(L);const R=`ext-apps:${_}:${E}`;v===R&&w({defaultMainView:{type:"settings"}})}else{const L=u.find(R=>R.id===_)?.uiTools.find(R=>R.name===E)?.title;M([...p,{connectionId:_,toolName:E,label:L??wt(E),icon:null}])}n()},T=(_,E,q)=>{M(p.map(L=>L.connectionId===_&&L.toolName===E?{...L,label:q}:L))},V=()=>{n()},A=(_,E,q)=>{M(p.map(L=>L.connectionId===_&&L.toolName===E?{...L,icon:q}:L)),n()},D=_=>{w({defaultMainView:N(_)}),n()},z=(_,E)=>{const q=Pi(j,_,E,1);e.setValue("metadata.sidebarViews",q,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),h.stage(q,j);const L=$i(g,_,E);L!==g&&w({defaultMainView:L})},P=lt(o?.metadata),$=Ai(P,r.presence),F=Ii($),H=Oi(j,$,1),B={overview:s("sidebar.navDestinations.home"),reports:s("sidebar.navDestinations.reports"),board:s("sidebar.navDestinations.tasks"),"site-editor":s("virtualMcp.layoutTabContent.siteEditor"),assets:s("common.mainPanelTabs.assets"),hosting:s("common.mainPanelTabs.hosting"),e2e:s("common.mainPanelTabs.e2e"),analytics:s("common.mainPanelTabs.analytics"),cdn:s("common.mainPanelTabs.cdn"),automations:s("virtualMcp.layoutTabContent.automations"),experiments:s("experiments.title")},Y=[];for(const _ of H)_!=="automations"&&Y.push({value:_,label:B[_]});for(const _ of p)Y.push({value:`ext-apps:${_.connectionId}:${_.toolName}`,label:_.label||_.toolName});return H.includes("automations")&&Y.push({value:"automations",label:B.automations}),Y.push({value:"settings",label:s("virtualMcp.layoutTabContent.settings")}),{projectViews:F,labels:B,pinned:_=>j.includes(_),isMainView:_=>v===_,defaultMainView:v,defaultMainOptions:Y,noMainView:S,chatDefaultOpen:b,connectionsData:u,pinnedAppViews:p,openView:_=>l(_,{virtualmcpid:a}),togglePin:(_,E)=>z(_,E),setMainView:D,setChatDefaultOpen:_=>{w({chatDefaultOpen:_}),n()},toggleAppViewPin:k,setAppViewIcon:A,setAppViewLabel:T,commitAppViewLabel:V}}function Cl(a){const e=G.c(55),{form:n,onCommit:s}=a,i=X(),l=W.useId();let o;e[0]!==i?(o=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("p",{className:"text-sm font-medium",children:o}),e[2]=o,e[3]=r):r=e[3];let h;e[4]!==i?(h=i("virtualMcp.settings.identity.iconDescription"),e[4]=i,e[5]=h):h=e[5];let d;e[6]!==h?(d=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:h}),e[6]=h,e[7]=d):d=e[7];let m;e[8]!==r||e[9]!==d?(m=t.jsxs("div",{children:[r,d]}),e[8]=r,e[9]=d,e[10]=m):m=e[10];let f;e[11]!==n||e[12]!==s||e[13]!==i?(f=T=>{const{field:V}=T;return t.jsx("div",{className:"justify-self-start",children:t.jsx(Bs,{value:V.value??null,onChange:A=>{V.onChange(A),s()},onColorChange:A=>{n.setValue("metadata.ui.themeColor",A,{shouldDirty:!0}),s()},name:n.watch("title")||i("virtualMcp.virtualMcp.agentNameFallback"),size:"md",avatarClassName:"[&_svg]:w-1/2 [&_svg]:h-1/2"})})},e[11]=n,e[12]=s,e[13]=i,e[14]=f):f=e[14];let u;e[15]!==n.control||e[16]!==f?(u=t.jsx(pe,{name:"icon",control:n.control,render:f}),e[15]=n.control,e[16]=f,e[17]=u):u=e[17];let c;e[18]!==m||e[19]!==u?(c=t.jsxs(ye,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[m,u]}),e[18]=m,e[19]=u,e[20]=c):c=e[20];const p=`${l}-name`;let x;e[21]!==i?(x=i("virtualMcp.settings.identity.name"),e[21]=i,e[22]=x):x=e[22];let g;e[23]!==x||e[24]!==p?(g=t.jsx("label",{htmlFor:p,className:"text-sm font-medium",children:x}),e[23]=x,e[24]=p,e[25]=g):g=e[25];let b;e[26]!==l||e[27]!==s||e[28]!==i?(b=T=>{const{field:V}=T;return t.jsx(ke,{...V,id:`${l}-name`,value:V.value??"",onBlur:()=>{V.onBlur(),s()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=l,e[27]=s,e[28]=i,e[29]=b):b=e[29];let y;e[30]!==n.control||e[31]!==b?(y=t.jsx(pe,{name:"title",control:n.control,render:b}),e[30]=n.control,e[31]=b,e[32]=y):y=e[32];let j;e[33]!==g||e[34]!==y?(j=t.jsxs(ye,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[g,y]}),e[33]=g,e[34]=y,e[35]=j):j=e[35];const v=`${l}-description`;let S;e[36]!==i?(S=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=S):S=e[37];let N;e[38]!==v||e[39]!==S?(N=t.jsx("label",{htmlFor:v,className:"text-sm font-medium",children:S}),e[38]=v,e[39]=S,e[40]=N):N=e[40];let M;e[41]!==l||e[42]!==s||e[43]!==i?(M=T=>{const{field:V}=T;return t.jsx(at,{...V,id:`${l}-description`,value:V.value??"",onBlur:()=>{V.onBlur(),s()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=l,e[42]=s,e[43]=i,e[44]=M):M=e[44];let w;e[45]!==n.control||e[46]!==M?(w=t.jsx(pe,{name:"description",control:n.control,render:M}),e[45]=n.control,e[46]=M,e[47]=w):w=e[47];let C;e[48]!==N||e[49]!==w?(C=t.jsxs(ye,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[N,w]}),e[48]=N,e[49]=w,e[50]=C):C=e[50];let k;return e[51]!==j||e[52]!==C||e[53]!==c?(k=t.jsxs(Le,{children:[c,j,C]}),e[51]=j,e[52]=C,e[53]=c,e[54]=k):k=e[54],k}const Ws=["general","connections","site"],Ml={general:{icon:oi,titleKey:"virtualMcp.settings.general.title",descriptionKey:"virtualMcp.settings.general.description"},connections:{icon:Yi,titleKey:"virtualMcp.settings.connections.title",descriptionKey:"virtualMcp.settings.connections.description"},site:{icon:ri,titleKey:"virtualMcp.settings.site.title",descriptionKey:"virtualMcp.settings.site.description"}};function kl(a){return!!a&&Ws.includes(a)}function _l(a){const e=G.c(8),{section:n}=a,s=X();let i;e[0]!==s?(i=s("virtualMcp.settings.navigation"),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==n||e[3]!==s?(l=Ws.map(r=>{const{titleKey:h}=Ml[r];return t.jsx(ze.Tab,{active:n===r,asChild:!0,children:t.jsx(ps,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:d=>({...d,section:r==="general"?void 0:r}),children:s(h)})},r)}),e[2]=n,e[3]=s,e[4]=l):l=e[4];let o;if(e[5]!==i||e[6]!==l){const r=t.jsx(ze.Tabs,{"aria-label":i,children:l});o=t.jsx(an.Toolbar.Left.Portal,{fallback:r,children:r}),e[5]=i,e[6]=l,e[7]=o}else o=e[7];return o}function Vl(){const a=G.c(8),e=Ct();let n;a[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},a[0]=n):n=a[0];const{section:s}=ln(n);let i;a[1]!==s?(i=kl(s)?s:"general",a[1]=s,a[2]=i):i=a[2];let l;a[3]!==e?(l=r=>e({to:".",search:h=>({...h,section:r??void 0})}),a[3]=e,a[4]=l):l=a[4];let o;return a[5]!==i||a[6]!==l?(o={section:i,openSection:l},a[5]=i,a[6]=l,a[7]=o):o=a[7],o}const bt={tools:null,resources:null,prompts:null},Tl=Bi.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function Dl(a){const n=new TextEncoder().encode(a),s=Array.from(n,i=>String.fromCharCode(i)).join("");return btoa(s)}function Gs(a){return{"x-studio-client":a,"x-mesh-client":a}}function Al(a){const e=G.c(15),{url:n,agentId:s}=a,i=X(),[l,o]=W.useState(!1);let r;e[0]!==s||e[1]!==i||e[2]!==n?(r=async()=>{je("agent_connect_action",{agent_id:s,action:"copy_url"}),await navigator.clipboard.writeText(n),o(!0),re.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await st(2e3),o(!1)},e[0]=s,e[1]=i,e[2]=n,e[3]=r):r=e[3];const h=r;let d;e[4]!==l?(d=l?t.jsx(tt,{size:20,className:"text-success"}):t.jsx(pt,{size:20}),e[4]=l,e[5]=d):d=e[5];let m;e[6]!==l||e[7]!==i?(m=i(l?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=l,e[7]=i,e[8]=m):m=e[8];let f;e[9]!==m?(f=t.jsx("span",{className:"text-xs font-medium",children:m}),e[9]=m,e[10]=f):f=e[10];let u;return e[11]!==h||e[12]!==d||e[13]!==f?(u=t.jsxs(te,{type:"button",variant:"outline",onClick:h,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[d,f]}),e[11]=h,e[12]=d,e[13]=f,e[14]=u):u=e[14],u}function Il(a){const e=G.c(13),{url:n,serverName:s,agentId:i}=a,l=X();let o;e[0]!==i||e[1]!==s||e[2]!==l||e[3]!==n?(o=()=>{je("agent_connect_action",{agent_id:i,action:"install_cursor"});const u=$s(s),c={type:"http",url:n,headers:Gs("Cursor")},p=Dl(JSON.stringify(c,null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(u)}&config=${encodeURIComponent(p)}`;window.open(x,"_blank"),re.success(l("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=s,e[2]=l,e[3]=n,e[4]=o):o=e[4];const r=o;let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),e[5]=h):h=e[5];let d;e[6]!==l?(d=l("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=l,e[7]=d):d=e[7];let m;e[8]!==d?(m=t.jsx("span",{className:"text-xs font-medium",children:d}),e[8]=d,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m?(f=t.jsxs(te,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[h,m]}),e[10]=r,e[11]=m,e[12]=f):f=e[12],f}function Ol(a){const e=G.c(16),{url:n,serverName:s,agentId:i}=a,l=X(),[o,r]=W.useState(!1);let h;e[0]!==i||e[1]!==s||e[2]!==l||e[3]!==n?(h=async()=>{je("agent_connect_action",{agent_id:i,action:"install_claude_code"});const p=$s(s),x={type:"http",url:n,headers:Gs("Claude Code")},g=JSON.stringify(x,null,2),b=`claude mcp add-json "${p}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(b),r(!0),re.success(l("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await st(2e3),r(!1)},e[0]=i,e[1]=s,e[2]=l,e[3]=n,e[4]=h):h=e[4];const d=h;let m;e[5]!==o?(m=o?t.jsx(tt,{size:20,className:"text-success"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[5]=o,e[6]=m):m=e[6];let f;e[7]!==o||e[8]!==l?(f=l(o?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=o,e[8]=l,e[9]=f):f=e[9];let u;e[10]!==f?(u=t.jsx("span",{className:"text-xs font-medium",children:f}),e[10]=f,e[11]=u):u=e[11];let c;return e[12]!==d||e[13]!==m||e[14]!==u?(c=t.jsxs(te,{type:"button",variant:"outline",onClick:d,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[m,u]}),e[12]=d,e[13]=m,e[14]=u,e[15]=c):c=e[15],c}function Pl({virtualMcp:a}){const e=X(),n=ot(),[s,i]=W.useState(null),[l,o]=W.useState(!1),[r,h]=W.useState(!1),d=a.id,m=a.title||`agent-${d.slice(0,8)}`,f=s?`bunx @decocms/typegen@latest --mcp ${d} --key ${s} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${d} --key <api-key> --output client.ts`,u=async()=>{o(!0);try{const{key:p}=await n.call("API_KEY_CREATE",{name:`typegen-${m}`,permissions:{[d]:["*"]}});if(!p)throw new Error("No key in response");i(p),je("agent_typegen_key_generated",{agent_id:d})}catch{je("agent_typegen_key_failed",{agent_id:d}),re.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{o(!1)}},c=async()=>{je("agent_connect_action",{agent_id:d,action:"typegen_copy_command",has_api_key:!!s}),await navigator.clipboard.writeText(f),h(!0),re.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await st(2e3),h(!1)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClient")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClientDescription")})]}),!s&&t.jsxs(te,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:u,disabled:l,children:[l?t.jsx(Xe,{className:"size-3.5"}):t.jsx(Vt,{size:14}),t.jsx("span",{children:e(l?"virtualMcp.virtualMcpShareModal.generating":"virtualMcp.virtualMcpShareModal.generateApiKey")})]})]}),s&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateClientLabel")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:f}),t.jsx(te,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:c,children:r?t.jsx(tt,{size:12,className:"text-success"}):t.jsx(pt,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx($l,{apiKey:s,agentId:d})]})}function $l(a){const e=G.c(21),{apiKey:n,agentId:s}=a,[i,l]=W.useState(!1),o=window.location.origin,r=n?`STUDIO_API_KEY=${n}`:"STUDIO_API_KEY=<api-key>",h=`STUDIO_BASE_URL=${o}`,d=`${r}
|
|
2
2
|
${h}`;let m;e[0]!==s||e[1]!==n||e[2]!==d?(m=async()=>{je("agent_connect_action",{agent_id:s,action:"typegen_copy_env",has_api_key:!!n}),await navigator.clipboard.writeText(d),l(!0),await st(2e3),l(!1)},e[0]=s,e[1]=n,e[2]=d,e[3]=m):m=e[3];const f=m,u=!n;let c;e[4]!==u?(c=xe({"opacity-50":u}),e[4]=u,e[5]=c):c=e[5];let p;e[6]!==r||e[7]!==c?(p=t.jsx("span",{className:c,children:r}),e[6]=r,e[7]=c,e[8]=p):p=e[8];let x,g;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("br",{}),g=t.jsx("span",{children:h}),e[9]=x,e[10]=g):(x=e[9],g=e[10]);let b;e[11]!==p?(b=t.jsxs("code",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:[p,x,g]}),e[11]=p,e[12]=b):b=e[12];let y;e[13]!==i?(y=i?t.jsx(tt,{size:12,className:"text-success"}):t.jsx(pt,{size:12}),e[13]=i,e[14]=y):y=e[14];let j;e[15]!==f||e[16]!==y?(j=t.jsx(te,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:f,children:y}),e[15]=f,e[16]=y,e[17]=j):j=e[17];let v;return e[18]!==b||e[19]!==j?(v=t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[b,j]})}),e[18]=b,e[19]=j,e[20]=v):v=e[20],v}function El(a){const e=G.c(3),{virtualMcp:n}=a;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=s):s=e[0];let i;return e[1]!==n?(i=t.jsx(W.Suspense,{fallback:s,children:t.jsx(Pl,{virtualMcp:n})}),e[1]=n,e[2]=i):i=e[2],i}const Fl={self:["COLLECTION_THREADS_CREATE","COLLECTION_THREADS_GET","COLLECTION_THREAD_MESSAGES_LIST","COLLECTION_THREADS_LIST"]},zl=3600*24*90;function Rl({virtualMcp:a}){const e=X(),n=ot(),{org:s}=Ae(),[i,l]=W.useState(null),[o,r]=W.useState(!1),[h,d]=W.useState(!1),m=a.id,f=a.title||`agent-${m.slice(0,8)}`,c=[`STUDIO_BASE_URL=${window.location.origin}`,`STUDIO_ORG=${s.slug}`,`STUDIO_AGENT_ID=${m}`,`STUDIO_API_KEY=${i??"<api-key>"}`].join(`
|
|
3
3
|
`),p=async()=>{r(!0);try{const{key:g}=await n.call("API_KEY_CREATE",{name:`chat-bridge-${f}`,permissions:Fl,expiresIn:zl});if(!g)throw new Error("No key in response");l(g),je("agent_chat_bridge_key_generated",{agent_id:m})}catch{je("agent_chat_bridge_key_failed",{agent_id:m}),re.error(e("virtualMcp.virtualMcpShareModal.failedCreateApiKey"))}finally{r(!1)}},x=async()=>{je("agent_connect_action",{agent_id:m,action:"chat_bridge_copy_env",has_api_key:!!i}),await navigator.clipboard.writeText(c),d(!0),re.success(e("virtualMcp.virtualMcpShareModal.connectionDetailsCopied")),await st(2e3),d(!1)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcpShareModal.callFromYourApp")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.callFromYourAppDescription")})]}),!i&&t.jsxs(te,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:p,disabled:o,children:[o?t.jsx(Xe,{className:"size-3.5"}):t.jsx(Vt,{size:14}),t.jsx("span",{children:e(o?"virtualMcp.virtualMcpShareModal.creating":"virtualMcp.virtualMcpShareModal.createApiKey")})]})]}),i&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.connectionDetails")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 whitespace-pre-wrap break-all font-mono text-xs text-muted-foreground",children:c}),t.jsx(te,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:x,children:h?t.jsx(tt,{size:12,className:"text-success"}):t.jsx(pt,{size:12})})]})})]})}function Ll(a){const e=G.c(3),{virtualMcp:n}=a;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=s):s=e[0];let i;return e[1]!==n?(i=t.jsx(W.Suspense,{fallback:s,children:t.jsx(Rl,{virtualMcp:n})}),e[1]=n,e[2]=i):i=e[2],i}function Ul(a){const e=G.c(49),{open:n,onOpenChange:s,virtualMcp:i}=a,l=X(),{org:o}=Ae(),r=`/api/${o.slug}/mcp/virtual-mcp/${i.id}`;let h;e[0]!==r?(h=new URL(r,window.location.origin),e[0]=r,e[1]=h):h=e[1];const d=h;let m;e[2]!==i.id||e[3]!==i.title?(m=i.title||`agent-${i.id?.slice(0,8)??"default"}`,e[2]=i.id,e[3]=i.title,e[4]=m):m=e[4];const f=m,u=Qi();let c;e[5]!==i.id||e[6]!==d.href?(c=t.jsx(Al,{url:d.href,agentId:i.id}),e[5]=i.id,e[6]=d.href,e[7]=c):c=e[7];let p,x;e[8]!==f||e[9]!==i.id||e[10]!==d.href?(p=t.jsx(Il,{url:d.href,serverName:f,agentId:i.id}),x=t.jsx(Ol,{url:d.href,serverName:f,agentId:i.id}),e[8]=f,e[9]=i.id,e[10]=d.href,e[11]=p,e[12]=x):(p=e[11],x=e[12]);let g;e[13]!==c||e[14]!==p||e[15]!==x?(g=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[c,p,x]})}),e[13]=c,e[14]=p,e[15]=x,e[16]=g):g=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"border-t border-border"}),e[17]=b):b=e[17];let y;e[18]!==i?(y=t.jsx(El,{virtualMcp:i}),e[18]=i,e[19]=y):y=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"border-t border-border"}),e[20]=j):j=e[20];let v;e[21]!==i?(v=t.jsx(Ll,{virtualMcp:i}),e[21]=i,e[22]=v):v=e[22];let S;e[23]!==v||e[24]!==g||e[25]!==y?(S=t.jsxs("div",{className:"flex flex-col gap-6",children:[g,b,y,j,v]}),e[23]=v,e[24]=g,e[25]=y,e[26]=S):S=e[26];const N=S;if(u){let T;e[27]!==l?(T=l("virtualMcp.virtualMcpShareModal.connect"),e[27]=l,e[28]=T):T=e[28];let V;e[29]!==T?(V=t.jsx(Gi,{className:"mt-4 mb-4 text-base font-semibold",children:T}),e[29]=T,e[30]=V):V=e[30];let A;e[31]!==N||e[32]!==V?(A=t.jsx(Hi,{children:t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-6 [touch-action:pan-y]",children:[V,N]})}),e[31]=N,e[32]=V,e[33]=A):A=e[33];let D;return e[34]!==s||e[35]!==n||e[36]!==A?(D=t.jsx(qi,{open:n,onOpenChange:s,children:A}),e[34]=s,e[35]=n,e[36]=A,e[37]=D):D=e[37],D}let M;e[38]!==l?(M=l("virtualMcp.virtualMcpShareModal.connect"),e[38]=l,e[39]=M):M=e[39];let w;e[40]!==M?(w=t.jsx(dt,{children:t.jsx(ut,{children:M})}),e[40]=M,e[41]=w):w=e[41];let C;e[42]!==N||e[43]!==w?(C=t.jsxs(Ze,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[w,N]}),e[42]=N,e[43]=w,e[44]=C):C=e[44];let k;return e[45]!==s||e[46]!==n||e[47]!==C?(k=t.jsx(Je,{open:n,onOpenChange:s,children:C}),e[45]=s,e[46]=n,e[47]=C,e[48]=k):k=e[48],k}function Yl(a){const e=G.c(50),{virtualMcp:n}=a,s=X(),i=vs(),l=js(),[o,r]=W.useState(!1);let h,d,m,f,u,c,p,x,g;if(e[0]!==l||e[1]!==i||e[2]!==s||e[3]!==n.id||e[4]!==n.metadata){g=Symbol.for("react.early_return_sentinel");e:{const M=_i(i);if(rn(n.id)||lt(n.metadata)||M.has(n.id)){g=null;break e}let w;e[14]!==i||e[15]!==n.id?(w=(i??[]).find(F=>F.metadata?.liveAgentId===n.id)??null,e[14]=i,e[15]=n.id,e[16]=w):w=e[16];const C=w,k=C?.id??null;let T;e[17]!==l.update?(T=(F,H)=>l.update.mutateAsync({id:F,data:{metadata:{liveAgentId:H}}}).catch(Kl),e[17]=l.update,e[18]=T):T=e[18];const V=T;let A;e[19]!==V||e[20]!==n.id?(A=F=>{V(F,n.id)},e[19]=V,e[20]=n.id,e[21]=A):A=e[21],m=A;let D;e[22]!==k||e[23]!==V?(D=()=>{k&&V(k,null)},e[22]=k,e[23]=V,e[24]=D):D=e[24];const z=D,P=(i??[]).filter(F=>F.id!==n.id&<(F.metadata)&&!M.has(F.id));p="flex flex-col gap-3";let $;e[25]!==s?($=s("devAgent.devAgentSetup.title"),e[25]=s,e[26]=$):$=e[26],e[27]!==$?(x=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:$}),e[27]=$,e[28]=x):x=e[28],d=cn,c="p-6 gap-4",h=dn,f="p-0 space-y-4",u=k?t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[t.jsx("span",{className:"text-sm text-foreground truncate",children:C?C.title:k}),t.jsx("span",{className:"text-xs text-muted-foreground",children:s("devAgent.devAgentSetup.linkedDescription")})]}),t.jsx(te,{variant:"outline",size:"sm",className:"shrink-0",onClick:z,children:s("devAgent.devAgentSetup.unlinkButton")})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:s("devAgent.devAgentSetup.linkDescription")}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsxs(te,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>r(!0),children:[t.jsx(on,{className:"size-4"}),s("devAgent.devAgentSetup.importButton")]}),P.length>0?t.jsxs(De,{onValueChange:m,children:[t.jsx(_e,{size:"sm",className:"w-56",children:t.jsx(Ve,{placeholder:s("devAgent.devAgentSetup.selectPlaceholder")})}),t.jsx(Te,{children:P.map(Bl)})]}):null]})]})}e[0]=l,e[1]=i,e[2]=s,e[3]=n.id,e[4]=n.metadata,e[5]=h,e[6]=d,e[7]=m,e[8]=f,e[9]=u,e[10]=c,e[11]=p,e[12]=x,e[13]=g}else h=e[5],d=e[6],m=e[7],f=e[8],u=e[9],c=e[10],p=e[11],x=e[12],g=e[13];if(g!==Symbol.for("react.early_return_sentinel"))return g;let b;e[29]!==h||e[30]!==f||e[31]!==u?(b=t.jsx(h,{className:f,children:u}),e[29]=h,e[30]=f,e[31]=u,e[32]=b):b=e[32];let y;e[33]!==d||e[34]!==c||e[35]!==b?(y=t.jsx(d,{className:c,children:b}),e[33]=d,e[34]=c,e[35]=b,e[36]=y):y=e[36];let j;e[37]!==s?(j=s("devAgent.devAgentSetup.importDialogTitle"),e[37]=s,e[38]=j):j=e[38];let v;e[39]!==m?(v=M=>{const{virtualMcpId:w}=M;r(!1),w&&m(w)},e[39]=m,e[40]=v):v=e[40];let S;e[41]!==o||e[42]!==v||e[43]!==j?(S=t.jsx(Xi,{open:o,onOpenChange:r,title:j,onImportComplete:v}),e[41]=o,e[42]=v,e[43]=j,e[44]=S):S=e[44];let N;return e[45]!==S||e[46]!==p||e[47]!==x||e[48]!==y?(N=t.jsxs("div",{className:p,children:[x,y,S]}),e[45]=S,e[46]=p,e[47]=x,e[48]=y,e[49]=N):N=e[49],N}function Bl(a){return t.jsx(ge,{value:a.id,children:a.title},a.id)}function Kl(){}const Wl=/^[A-Za-z_][A-Za-z0-9_]*$/;function Gl(a){const e={},n=a.split(/\r?\n/);for(let s=0;s<n.length;s++){let i=(n[s]??"").trim();if(!i||i.startsWith("#"))continue;i.startsWith("export ")&&(i=i.slice(7).trim());const l=i.indexOf("=");if(l<0)throw new Error(`Line ${s+1}: missing '='`);const o=i.slice(0,l).trim();if(!Wl.test(o))throw new Error(`Line ${s+1}: invalid key "${o}"`);let r=i.slice(l+1).trim();r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),e[o]=r}return e}function Hl(a){const e=G.c(28),{control:n,form:s,virtualMcpId:i,orgSlug:l,sandboxMap:o}=a,r=X();let h;e[0]!==r?(h=r("sandbox.envVarsField.title"),e[0]=r,e[1]=h):h=e[1];let d;e[2]!==h?(d=t.jsx("div",{className:"flex items-baseline justify-between gap-2",children:t.jsx(he,{className:"font-normal text-foreground",children:h})}),e[2]=h,e[3]=d):d=e[3];let m;e[4]!==r?(m=r("sandbox.envVarsField.description"),e[4]=r,e[5]=m):m=e[5];let f;e[6]!==m?(f=t.jsx("p",{className:"text-xs text-muted-foreground",children:m}),e[6]=m,e[7]=f):f=e[7];let u;e[8]!==n||e[9]!==s||e[10]!==l||e[11]!==o||e[12]!==i?(u=t.jsx(ql,{control:n,form:s,virtualMcpId:i,orgSlug:l,sandboxMap:o}),e[8]=n,e[9]=s,e[10]=l,e[11]=o,e[12]=i,e[13]=u):u=e[13];let c;e[14]!==r?(c=y=>{const{error:j}=y;return t.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:j?.message??r("sandbox.envVarsField.failedToLoadSecrets")})},e[14]=r,e[15]=c):c=e[15];let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(un,{className:"h-9 w-full"}),e[16]=p):p=e[16];let x;e[17]!==n||e[18]!==s?(x=t.jsx(W.Suspense,{fallback:p,children:t.jsx(Xl,{control:n,form:s})}),e[17]=n,e[18]=s,e[19]=x):x=e[19];let g;e[20]!==c||e[21]!==x?(g=t.jsx(Re,{fallback:c,children:x}),e[20]=c,e[21]=x,e[22]=g):g=e[22];let b;return e[23]!==d||e[24]!==f||e[25]!==u||e[26]!==g?(b=t.jsxs("div",{className:"space-y-2",children:[d,f,u,g]}),e[23]=d,e[24]=f,e[25]=u,e[26]=g,e[27]=b):b=e[27],b}function ql(a){const e=G.c(33),{control:n,form:s,virtualMcpId:i,orgSlug:l,sandboxMap:o}=a,r=X(),d=mn.useSession().data?.user?.id,m="metadata.runtime.env";let f;e[0]!==s?(f=()=>JSON.stringify(rs(s.getValues(m))),e[0]=s,e[1]=f):f=e[1];const[u,c]=W.useState(f);let p;e[2]!==n?(p={control:n,name:m},e[2]=n,e[3]=p):p=e[3];const x=xs(p);let g;e[4]!==x?(g=JSON.stringify(rs(x)),e[4]=x,e[5]=g):g=e[5];const b=g,y=b!==u;let j;e[6]!==o||e[7]!==d?(j=d?Object.keys(o?.[d]??{}):[],e[6]=o,e[7]=d,e[8]=j):j=e[8];const v=j,S=v.length>0,[N,M]=W.useState(!1);if(!y||!S)return null;let w;e[9]!==b||e[10]!==l||e[11]!==r||e[12]!==v||e[13]!==i?(w=async()=>{M(!0);const $=await Promise.allSettled(v.map(async H=>{const B=Ji({orgSlug:l,virtualMcpId:i,branch:H,threadId:null},"setup/start"),Y=await fetch(B,{method:"POST"});if(!Y.ok){const U=await Y.text().catch(()=>Y.statusText);throw new Error(U||Y.statusText)}}));M(!1);const F=$.filter(Ql).length;F===0?(c(b),re.success(v.length===1?r("sandbox.envVarsField.restartedSingle"):r("sandbox.envVarsField.restartedMultiple",{count:v.length}))):re.error(r("sandbox.envVarsField.restartFailed",{failed:F,total:v.length}))},e[9]=b,e[10]=l,e[11]=r,e[12]=v,e[13]=i,e[14]=w):w=e[14];const C=w;let k;e[15]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(fs,{className:"size-3.5 shrink-0"}),e[15]=k):k=e[15];let T;e[16]!==r?(T=r("sandbox.envVarsField.sandboxRunningNotice"),e[16]=r,e[17]=T):T=e[17];let V;e[18]!==T?(V=t.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-warning",children:[k,t.jsx("span",{className:"truncate",children:T})]}),e[18]=T,e[19]=V):V=e[19];let A;e[20]!==N?(A=N?t.jsx(Xe,{className:"size-3.5"}):t.jsx(pn,{className:"size-3.5"}),e[20]=N,e[21]=A):A=e[21];let D;e[22]!==N||e[23]!==r?(D=r(N?"sandbox.envVarsField.restarting":"sandbox.envVarsField.restartDev"),e[22]=N,e[23]=r,e[24]=D):D=e[24];let z;e[25]!==C||e[26]!==N||e[27]!==D||e[28]!==A?(z=t.jsxs(te,{type:"button",variant:"outline",size:"sm",onClick:C,disabled:N,className:"shrink-0",children:[A,D]}),e[25]=C,e[26]=N,e[27]=D,e[28]=A,e[29]=z):z=e[29];let P;return e[30]!==z||e[31]!==V?(P=t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs",children:[V,z]}),e[30]=z,e[31]=V,e[32]=P):P=e[32],P}function Ql(a){return a.status==="rejected"}function Xl(a){const e=G.c(62),{control:n,form:s}=a,i=X(),l="metadata.runtime.env";let o;e[0]!==n?(o={control:n,name:l},e[0]=n,e[1]=o):o=e[1];const r=fn(o),{fields:h,append:d,remove:m}=r;let f;e[2]!==s?(f=(B,Y)=>{s.setValue(`${l}.${B}`,Y,{shouldDirty:!0,shouldTouch:!0})},e[2]=s,e[3]=f):f=e[3];const u=f,c=sa();let p;if(e[4]!==c){p=new Map;for(const B of c)p.set(B.id,B);e[4]=c,e[5]=p}else p=e[5];const[x,g]=W.useState(null);let b;e[6]!==d?(b=()=>{d({key:"",kind:"literal",value:""})},e[6]=d,e[7]=b):b=e[7];const y=b;let j;e[8]!==d||e[9]!==s||e[10]!==i?(j=async()=>{let B;try{B=await navigator.clipboard.readText()}catch{re.error(i("sandbox.envVarsField.clipboardReadFailed"));return}if(!B.trim()){re.error(i("sandbox.envVarsField.clipboardEmpty"));return}let Y;try{Y=Gl(B)}catch(R){const K=R;re.error(K.message);return}const U=Object.entries(Y);if(U.length===0){re.error(i("sandbox.envVarsField.nothingToAdd"));return}const _=s.getValues(l)??[],E=new Set;for(const R of _){const K=(R.key??"").trim();K&&E.add(K)}let q=0,L=0;for(const[R,K]of U){if(E.has(R)){L++;continue}d({key:R,kind:"literal",value:K}),E.add(R),q++}q===0&&L>0?re.message(i("sandbox.envVarsField.allKeysExist",{count:L})):re.success(L>0?i("sandbox.envVarsField.addedWithSkipped",{added:q,skipped:L}):i("sandbox.envVarsField.added",{added:q}))},e[8]=d,e[9]=s,e[10]=i,e[11]=j):j=e[11];const v=j;let S;if(e[12]!==n||e[13]!==h||e[14]!==s||e[15]!==m||e[16]!==p||e[17]!==c||e[18]!==u){let B;e[20]!==n||e[21]!==s||e[22]!==m||e[23]!==p||e[24]!==c||e[25]!==u?(B=(Y,U)=>t.jsx("li",{className:"rounded-md border border-border bg-background",children:t.jsx(Jl,{index:U,control:n,form:s,onUpdateEntry:u,fieldPath:l,secrets:c,secretById:p,onSaveAsSecret:(_,E)=>g({kind:"save-literal",index:U,presetKey:_,presetValue:E}),onCreateNewSecret:_=>g({kind:"create-new",index:U,presetKey:_}),onRemove:()=>m(U)})},Y.id),e[20]=n,e[21]=s,e[22]=m,e[23]=p,e[24]=c,e[25]=u,e[26]=B):B=e[26],S=h.map(B),e[12]=n,e[13]=h,e[14]=s,e[15]=m,e[16]=p,e[17]=c,e[18]=u,e[19]=S}else S=e[19];let N;e[27]!==S?(N=t.jsx("ul",{className:"space-y-2",children:S}),e[27]=S,e[28]=N):N=e[28];let M;e[29]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx($e,{className:"size-3.5"}),e[29]=M):M=e[29];let w;e[30]!==i?(w=i("sandbox.envVarsField.addEnvVar"),e[30]=i,e[31]=w):w=e[31];let C;e[32]!==y||e[33]!==w?(C=t.jsxs(te,{type:"button",variant:"outline",size:"sm",onClick:y,className:"flex-1",children:[M,w]}),e[32]=y,e[33]=w,e[34]=C):C=e[34];let k;e[35]!==i?(k=i("sandbox.envVarsField.pasteDotenvAriaLabel"),e[35]=i,e[36]=k):k=e[36];let T;e[37]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ci,{className:"size-3.5"}),e[37]=T):T=e[37];let V;e[38]!==i?(V=i("sandbox.envVarsField.pasteDotenv"),e[38]=i,e[39]=V):V=e[39];let A;e[40]!==v||e[41]!==k||e[42]!==V?(A=t.jsx(Se,{asChild:!0,children:t.jsxs(te,{type:"button",variant:"outline",size:"sm",onClick:v,"aria-label":k,children:[T,V]})}),e[40]=v,e[41]=k,e[42]=V,e[43]=A):A=e[43];let D;e[44]!==i?(D=i("sandbox.envVarsField.pasteDotenvTooltip"),e[44]=i,e[45]=D):D=e[45];let z;e[46]!==D?(z=t.jsx(Ne,{children:D}),e[46]=D,e[47]=z):z=e[47];let P;e[48]!==A||e[49]!==z?(P=t.jsxs(we,{children:[A,z]}),e[48]=A,e[49]=z,e[50]=P):P=e[50];let $;e[51]!==P||e[52]!==C?($=t.jsxs("div",{className:"flex items-center gap-2",children:[C,P]}),e[51]=P,e[52]=C,e[53]=$):$=e[53];let F;e[54]!==x||e[55]!==s||e[56]!==u?(F=x!==null?t.jsx(er,{mode:x,onClose:()=>g(null),onSaved:B=>{const Y=s.getValues(`${l}.${x.index}.key`)?.trim()??"";u(x.index,{key:Y,kind:"secret",secretId:B}),g(null)}}):null,e[54]=x,e[55]=s,e[56]=u,e[57]=F):F=e[57];let H;return e[58]!==$||e[59]!==F||e[60]!==N?(H=t.jsxs("div",{className:"space-y-2",children:[N,$,F]}),e[58]=$,e[59]=F,e[60]=N,e[61]=H):H=e[61],H}function Jl(a){const e=G.c(77),{index:n,control:s,form:i,onUpdateEntry:l,fieldPath:o,secrets:r,secretById:h,onSaveAsSecret:d,onCreateNewSecret:m,onRemove:f}=a,u=X(),c=`${o}.${n}.key`,p=`${o}.${n}.value`,x=`${o}.${n}.secretId`,g=`${o}.${n}.kind`;let b;e[0]!==s||e[1]!==g?(b={control:s,name:g},e[0]=s,e[1]=g,e[2]=b):b=e[2];const j=xs(b)==="secret"?"secret":"literal";let v;e[3]!==i||e[4]!==n||e[5]!==c||e[6]!==d||e[7]!==l||e[8]!==p?(v=K=>{const Z=i.getValues(c)?.trim()??"";if(K==="literal"){l(n,{key:Z,kind:"literal",value:""});return}const ae=i.getValues(p)??"";if(ae.length>0){d(Z,ae);return}l(n,{key:Z,kind:"secret",secretId:""})},e[3]=i,e[4]=n,e[5]=c,e[6]=d,e[7]=l,e[8]=p,e[9]=v):v=e[9];const S=v;let N;e[10]!==n||e[11]!==u?(N=K=>{const{field:Z}=K,ae=(Z.value??"").trim(),ee=ae.length>0&&!ft.test(ae);return t.jsxs("div",{className:"space-y-1",children:[t.jsx(ke,{...Z,value:Z.value??"",placeholder:u("sandbox.envVarsField.keyPlaceholder"),spellCheck:!1,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",className:xe("font-mono",ee&&"border-destructive focus-visible:ring-destructive"),"aria-invalid":ee,"aria-label":u("sandbox.envVarsField.envVarKeyLabel",{index:n+1}),onBlur:de=>{const oe=de.target.value.trim();Z.onChange(oe),Z.onBlur()}}),ee?t.jsx("p",{className:"text-[11px] text-destructive",children:u("sandbox.envVarsField.invalidKeyMessage")}):null]})},e[10]=n,e[11]=u,e[12]=N):N=e[12];let M;e[13]!==s||e[14]!==c||e[15]!==N?(M=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(pe,{control:s,name:c,render:N})}),e[13]=s,e[14]=c,e[15]=N,e[16]=M):M=e[16];let w;e[17]!==S?(w=K=>S(K),e[17]=S,e[18]=w):w=e[18];let C;e[19]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(_e,{className:"h-9 w-[110px]",children:t.jsx(Ve,{})}),e[19]=C):C=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Vt,{className:"size-3.5"}),e[20]=k):k=e[20];let T;e[21]!==u?(T=u("sandbox.envVarsField.literal"),e[21]=u,e[22]=T):T=e[22];let V;e[23]!==T?(V=t.jsx(ge,{value:"literal",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[k,T]})}),e[23]=T,e[24]=V):V=e[24];let A;e[25]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(hn,{className:"size-3.5"}),e[25]=A):A=e[25];let D;e[26]!==u?(D=u("sandbox.envVarsField.secret"),e[26]=u,e[27]=D):D=e[27];let z;e[28]!==D?(z=t.jsx(ge,{value:"secret",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[A,D]})}),e[28]=D,e[29]=z):z=e[29];let P;e[30]!==z||e[31]!==V?(P=t.jsxs(Te,{children:[V,z]}),e[30]=z,e[31]=V,e[32]=P):P=e[32];let $;e[33]!==j||e[34]!==P||e[35]!==w?($=t.jsx("div",{className:"shrink-0",children:t.jsxs(De,{value:j,onValueChange:w,children:[C,P]})}),e[33]=j,e[34]=P,e[35]=w,e[36]=$):$=e[36];let F;e[37]!==s||e[38]!==i||e[39]!==n||e[40]!==c||e[41]!==j||e[42]!==m||e[43]!==h||e[44]!==x||e[45]!==r||e[46]!==u||e[47]!==p?(F=t.jsx("div",{className:"flex flex-[2] min-w-0 items-center gap-1",children:j==="literal"?t.jsx(pe,{control:s,name:p,render:K=>{const{field:Z}=K;return t.jsx(ke,{...Z,value:Z.value??"",type:"password",placeholder:u("sandbox.envVarsField.valuePlaceholder"),spellCheck:!1,autoComplete:"off",className:"font-mono","aria-label":u("sandbox.envVarsField.envVarValueLabel",{index:n+1}),onBlur:ae=>{Z.onChange(ae.target.value),Z.onBlur()}})}}):t.jsxs(t.Fragment,{children:[t.jsx(pe,{control:s,name:x,render:K=>{const{field:Z}=K;return t.jsxs(De,{value:Z.value||"",onValueChange:ae=>Z.onChange(ae),children:[t.jsx(_e,{className:xe("h-9 w-full",!Z.value&&"text-muted-foreground"),"aria-label":u("sandbox.envVarsField.secretAriaLabel",{index:n+1}),children:t.jsx(Ve,{placeholder:u("sandbox.envVarsField.pickSecretPlaceholder"),children:t.jsx(Zi,{field:Z,secretById:h})})}),t.jsx(Te,{children:r.length===0?t.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:u("sandbox.envVarsField.noSecretsYet")}):r.map(Zl)})]})}}),t.jsxs(we,{children:[t.jsx(Se,{asChild:!0,children:t.jsx(te,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.createNewSecretAriaLabel"),onClick:()=>{const K=i.getValues(c)?.trim()??"";m(K)},children:t.jsx($e,{className:"size-3.5"})})}),t.jsx(Ne,{children:u("sandbox.envVarsField.createNewSecret")})]})]})}),e[37]=s,e[38]=i,e[39]=n,e[40]=c,e[41]=j,e[42]=m,e[43]=h,e[44]=x,e[45]=r,e[46]=u,e[47]=p,e[48]=F):F=e[48];let H;e[49]!==i||e[50]!==c||e[51]!==j||e[52]!==d||e[53]!==u||e[54]!==p?(H=j==="literal"?t.jsxs(we,{children:[t.jsx(Se,{asChild:!0,children:t.jsx(te,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.saveAsSecretAriaLabel"),onClick:()=>{const K=i.getValues(c)?.trim()??"",Z=i.getValues(p)??"";d(K,Z)},children:t.jsx(di,{className:"size-3.5"})})}),t.jsx(Ne,{children:u("sandbox.envVarsField.saveAsSecret")})]}):null,e[49]=i,e[50]=c,e[51]=j,e[52]=d,e[53]=u,e[54]=p,e[55]=H):H=e[55];let B;e[56]!==u?(B=u("sandbox.envVarsField.removeEnvVarAriaLabel"),e[56]=u,e[57]=B):B=e[57];let Y;e[58]===Symbol.for("react.memo_cache_sentinel")?(Y=t.jsx(kt,{className:"size-3.5"}),e[58]=Y):Y=e[58];let U;e[59]!==f||e[60]!==B?(U=t.jsx(Se,{asChild:!0,children:t.jsx(te,{type:"button",variant:"ghost",size:"icon","aria-label":B,onClick:f,children:Y})}),e[59]=f,e[60]=B,e[61]=U):U=e[61];let _;e[62]!==u?(_=u("sandbox.envVarsField.remove"),e[62]=u,e[63]=_):_=e[63];let E;e[64]!==_?(E=t.jsx(Ne,{children:_}),e[64]=_,e[65]=E):E=e[65];let q;e[66]!==U||e[67]!==E?(q=t.jsxs(we,{children:[U,E]}),e[66]=U,e[67]=E,e[68]=q):q=e[68];let L;e[69]!==H||e[70]!==q?(L=t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[H,q]}),e[69]=H,e[70]=q,e[71]=L):L=e[71];let R;return e[72]!==$||e[73]!==F||e[74]!==L||e[75]!==M?(R=t.jsxs("div",{className:"flex flex-col gap-2 p-2 sm:flex-row sm:items-center",children:[M,$,F,L]}),e[72]=$,e[73]=F,e[74]=L,e[75]=M,e[76]=R):R=e[76],R}function Zl(a){return t.jsx(ge,{value:a.id,children:t.jsxs("span",{className:"inline-flex items-center gap-2",children:[t.jsx(ta,{scope:a.scope}),t.jsx("span",{className:"font-mono",children:a.name})]})},a.id)}function er({mode:a,onClose:e,onSaved:n}){const s=X(),i=a.kind==="save-literal"?a.presetValue:"",l=a.presetKey,[o,r]=W.useState(()=>tr(l)),[h,d]=W.useState("organization"),[m,f]=W.useState(i),[u,c]=W.useState(""),p=na(),x=o.trim(),g=m.length>0&&x.length>0&&ea.test(x),b=async v=>{if(v.preventDefault(),!!g)try{const S=await p.mutateAsync({scope:h,name:x,value:m,description:u.trim()||void 0});re.success(s("sandbox.envVarsField.secretSaved",{name:S.name})),n(S.id)}catch(S){re.error(S instanceof Error?S.message:s("sandbox.envVarsField.failedToSaveSecret"))}},y=a.kind==="save-literal"?s("sandbox.envVarsField.saveValueAsSecretTitle"):s("sandbox.envVarsField.createNewSecretTitle"),j=a.kind==="save-literal"?s("sandbox.envVarsField.saveValueAsSecretDescription"):s("sandbox.envVarsField.createNewSecretDescription");return t.jsx(Je,{open:!0,onOpenChange:v=>{v||e()},children:t.jsxs(Ze,{className:"sm:max-w-md",children:[t.jsxs(dt,{children:[t.jsx(ut,{children:y}),t.jsx(Un,{children:j})]}),t.jsxs("form",{onSubmit:b,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(he,{htmlFor:"save-secret-scope",children:s("sandbox.envVarsField.scopeLabel")}),t.jsxs(De,{value:h,onValueChange:v=>d(v),children:[t.jsx(_e,{id:"save-secret-scope",children:t.jsx(Ve,{})}),t.jsxs(Te,{children:[t.jsx(ge,{value:"organization",children:s("sandbox.envVarsField.scopeOrganization")}),t.jsx(ge,{value:"user",children:s("sandbox.envVarsField.scopePrivate")})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(he,{htmlFor:"save-secret-name",children:s("sandbox.envVarsField.nameLabel")}),t.jsx(ke,{id:"save-secret-name",value:o,onChange:v=>r(v.target.value),placeholder:s("sandbox.envVarsField.namePlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("sandbox.envVarsField.nameHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(he,{htmlFor:"save-secret-value",children:s("sandbox.envVarsField.valueLabel")}),t.jsx(ke,{id:"save-secret-value",type:"password",value:m,onChange:v=>f(v.target.value),placeholder:s("sandbox.envVarsField.secretValuePlaceholder"),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(he,{htmlFor:"save-secret-description",children:s("sandbox.envVarsField.descriptionLabel")}),t.jsx(at,{id:"save-secret-description",value:u,onChange:v=>c(v.target.value),rows:2,placeholder:s("sandbox.envVarsField.descriptionPlaceholder")})]}),t.jsxs(ws,{children:[t.jsx(te,{type:"button",variant:"outline",onClick:e,disabled:p.isPending,children:s("sandbox.envVarsField.cancel")}),t.jsx(te,{type:"submit",disabled:!g||p.isPending,children:p.isPending?s("sandbox.envVarsField.saving"):s("sandbox.envVarsField.saveSecret")})]})]})]})})}function rs(a){if(!Array.isArray(a))return[];const e=[];for(const n of a){if(!n||typeof n!="object")continue;const s=n,i=(s.key??"").trim();if(!(!i||!ft.test(i))){if(s.kind==="literal"){e.push({key:i,kind:"literal",value:s.value??""});continue}s.kind==="secret"&&s.secretId&&e.push({key:i,kind:"secret",secretId:s.secretId})}}return e}function tr(a){const e=a.trim();return e&&ft.test(e)?e:""}function sr(a){const e=G.c(21),{repo:n,className:s}=a,i=X();let l;e[0]!==s?(l=xe("space-y-2",s),e[0]=s,e[1]=l):l=e[1];let o;e[2]!==i?(o=i("sandbox.repoRow.label"),e[2]=i,e[3]=o):o=e[3];let r;e[4]!==o?(r=t.jsx(he,{children:o}),e[4]=o,e[5]=r):r=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(ia,{size:20,className:"shrink-0 text-foreground/60"}),e[6]=h):h=e[6];let d;e[7]!==n||e[8]!==i?(d=t.jsx(Se,{asChild:!0,children:t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-background px-4 py-3",tabIndex:0,children:[h,t.jsx("div",{className:"min-w-0 flex-1",children:n?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"truncate text-sm font-medium",children:[n.owner,"/",n.name]}),t.jsx("div",{className:"truncate text-xs text-muted-foreground",children:n.url})]}):t.jsx("div",{className:"text-sm text-muted-foreground",children:i("sandbox.repoRow.noRepositoryConnected")})})]})}),e[7]=n,e[8]=i,e[9]=d):d=e[9];let m;e[10]!==i?(m=i("sandbox.repoRow.tooltipContent"),e[10]=i,e[11]=m):m=e[11];let f;e[12]!==m?(f=t.jsx(Ne,{children:m}),e[12]=m,e[13]=f):f=e[13];let u;e[14]!==d||e[15]!==f?(u=t.jsxs(we,{children:[d,f]}),e[14]=d,e[15]=f,e[16]=u):u=e[16];let c;return e[17]!==l||e[18]!==r||e[19]!==u?(c=t.jsxs("div",{className:l,children:[r,u]}),e[17]=l,e[18]=r,e[19]=u,e[20]=c):c=e[20],c}const nr={npm:{install:"npm install",run:a=>`npm run ${a}`,runtime:"node"},pnpm:{install:"pnpm install",run:a=>`pnpm run ${a}`,runtime:"node"},yarn:{install:"yarn install",run:a=>`yarn run ${a}`,runtime:"node"},bun:{install:"bun install",run:a=>`bun run ${a}`,runtime:"bun"},deno:{install:"deno install",run:a=>`deno task ${a}`,runtime:"deno"}};function ir(a){const e=a.trim();if(e==="")return{ok:!0,value:null};if(!/^\d+$/.test(e))return{ok:!1};const n=Number(e);return n<1||n>65535?{ok:!1}:{ok:!0,value:String(n)}}const ar=Object.keys(nr),jt="__none__";function lr(a){const e=G.c(47),{control:n}=a,s=X(),i=W.useRef(null);let l;e[0]!==s?(l=s("sandbox.runtimeFields.packageManager"),e[0]=s,e[1]=l):l=e[1];let o;e[2]!==l?(o=t.jsx(he,{htmlFor:"runtime-pm",children:l}),e[2]=l,e[3]=o):o=e[3];let r;e[4]!==s?(r=w=>{const{field:C}=w;return t.jsxs(De,{value:C.value??jt,onValueChange:k=>C.onChange(k===jt?null:k),children:[t.jsx(_e,{id:"runtime-pm",children:t.jsx(Ve,{placeholder:s("sandbox.runtimeFields.autoDetect")})}),t.jsxs(Te,{children:[t.jsx(ge,{value:jt,children:s("sandbox.runtimeFields.autoDetect")}),ar.map(or)]})]})},e[4]=s,e[5]=r):r=e[5];let h;e[6]!==n||e[7]!==r?(h=t.jsx(pe,{control:n,name:"metadata.runtime.selected",render:r}),e[6]=n,e[7]=r,e[8]=h):h=e[8];let d;e[9]!==o||e[10]!==h?(d=t.jsxs("div",{className:"space-y-2",children:[o,h]}),e[9]=o,e[10]=h,e[11]=d):d=e[11];let m;e[12]!==s?(m=s("sandbox.runtimeFields.packagePath"),e[12]=s,e[13]=m):m=e[13];let f;e[14]!==m?(f=t.jsx(he,{htmlFor:"runtime-path",children:m}),e[14]=m,e[15]=f):f=e[15];let u;e[16]!==n?(u=t.jsx(pe,{control:n,name:"metadata.runtime.path",render:rr}),e[16]=n,e[17]=u):u=e[17];let c;e[18]!==s?(c=s("sandbox.runtimeFields.packagePathDescription"),e[18]=s,e[19]=c):c=e[19];let p;e[20]!==c?(p=t.jsx("p",{className:"text-xs text-muted-foreground",children:c}),e[20]=c,e[21]=p):p=e[21];let x;e[22]!==p||e[23]!==f||e[24]!==u?(x=t.jsxs("div",{className:"space-y-2",children:[f,u,p]}),e[22]=p,e[23]=f,e[24]=u,e[25]=x):x=e[25];let g;e[26]!==s?(g=s("sandbox.runtimeFields.devServerPort"),e[26]=s,e[27]=g):g=e[27];let b;e[28]!==g?(b=t.jsx(he,{htmlFor:"runtime-port",children:g}),e[28]=g,e[29]=b):b=e[29];let y;e[30]!==s?(y=w=>{const{field:C}=w;return t.jsx(ke,{ref:i,id:"runtime-port",inputMode:"numeric",placeholder:s("sandbox.runtimeFields.auto"),defaultValue:C.value??"",onBlur:k=>{const T=ir(k.target.value);T.ok?C.onChange(T.value):i.current&&(i.current.value=C.value??"")}})},e[30]=s,e[31]=y):y=e[31];let j;e[32]!==n||e[33]!==y?(j=t.jsx(pe,{control:n,name:"metadata.runtime.port",render:y}),e[32]=n,e[33]=y,e[34]=j):j=e[34];let v;e[35]!==s?(v=s("sandbox.runtimeFields.devServerPortDescription"),e[35]=s,e[36]=v):v=e[36];let S;e[37]!==v?(S=t.jsx("p",{className:"text-xs text-muted-foreground",children:v}),e[37]=v,e[38]=S):S=e[38];let N;e[39]!==b||e[40]!==j||e[41]!==S?(N=t.jsxs("div",{className:"space-y-2",children:[b,j,S]}),e[39]=b,e[40]=j,e[41]=S,e[42]=N):N=e[42];let M;return e[43]!==x||e[44]!==N||e[45]!==d?(M=t.jsxs("div",{className:"space-y-5",children:[d,x,N]}),e[43]=x,e[44]=N,e[45]=d,e[46]=M):M=e[46],M}function rr(a){const{field:e}=a;return t.jsx(ke,{id:"runtime-path",placeholder:".",defaultValue:e.value??"",onBlur:n=>{const s=n.target.value.trim();e.onChange(s===""?null:s)}})}function or(a){return t.jsx(ge,{value:a,children:a},a)}function cr(a){const e=G.c(17),{control:n}=a,s=X();let i;e[0]!==s?(i=s("sandbox.previewServerUrlField.label"),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==i?(l=t.jsx(he,{htmlFor:"preview-server-url",children:i}),e[2]=i,e[3]=l):l=e[3];let o;e[4]!==s?(o=f=>{const{field:u}=f,c=u.value??"";return t.jsx(ke,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:s("sandbox.previewServerUrlField.placeholder"),value:c,onChange:p=>u.onChange(p.target.value===""?null:p.target.value),onBlur:()=>{u.onChange(aa(c)),u.onBlur()}})},e[4]=s,e[5]=o):o=e[5];let r;e[6]!==n||e[7]!==o?(r=t.jsx(pe,{control:n,name:"metadata.previewServerUrl",render:o}),e[6]=n,e[7]=o,e[8]=r):r=e[8];let h;e[9]!==s?(h=s("sandbox.previewServerUrlField.description"),e[9]=s,e[10]=h):h=e[10];let d;e[11]!==h?(d=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[11]=h,e[12]=d):d=e[12];let m;return e[13]!==l||e[14]!==r||e[15]!==d?(m=t.jsxs("div",{className:"space-y-2",children:[l,r,d]}),e[13]=l,e[14]=r,e[15]=d,e[16]=m):m=e[16],m}function dr(a){const e=G.c(5),{control:n}=a,s=X();let i;e[0]!==s?(i=o=>{const{field:r}=o;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(he,{htmlFor:"field-description-tooltips",className:"font-normal text-foreground",children:s("sandbox.fieldDescriptionTooltipsField.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("sandbox.fieldDescriptionTooltipsField.description")})]}),t.jsx(et,{id:"field-description-tooltips",className:"shrink-0",checked:r.value??!1,onCheckedChange:h=>r.onChange(h)})]})},e[0]=s,e[1]=i):i=e[1];let l;return e[2]!==n||e[3]!==i?(l=t.jsx(pe,{control:n,name:"metadata.fieldDescriptionTooltips",render:i}),e[2]=n,e[3]=i,e[4]=l):l=e[4],l}function ur(a){const e=G.c(5),{control:n}=a,s=X();let i;e[0]!==s?(i=o=>{const{field:r}=o;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(he,{htmlFor:"publish-visual-review",className:"font-normal text-foreground",children:s("sandbox.publishVisualReviewField.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("sandbox.publishVisualReviewField.description")})]}),t.jsx(et,{id:"publish-visual-review",className:"shrink-0",checked:r.value??!1,onCheckedChange:h=>r.onChange(h)})]})},e[0]=s,e[1]=i):i=e[1];let l;return e[2]!==n||e[3]!==i?(l=t.jsx(pe,{control:n,name:"metadata.publishVisualReview",render:i}),e[2]=n,e[3]=i,e[4]=l):l=e[4],l}function mr(a){const e=G.c(8),{control:n,previewServerUrl:s}=a,i=X();let l;e[0]!==s?(l=la(s),e[0]=s,e[1]=l):l=e[1];const o=!!l;let r;e[2]!==o||e[3]!==i?(r=d=>{const{field:m}=d;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(he,{htmlFor:"fast-preview",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreview.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i(o?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(et,{id:"fast-preview",className:"shrink-0",checked:!!m.value&&o,disabled:!o,onCheckedChange:f=>m.onChange(f)})]})},e[2]=o,e[3]=i,e[4]=r):r=e[4];let h;return e[5]!==n||e[6]!==r?(h=t.jsx(pe,{control:n,name:"metadata.fastPreview",render:r}),e[5]=n,e[6]=r,e[7]=h):h=e[7],h}function fr(a){const e=G.c(5),{control:n,fastPreview:s}=a,i=X();if(!s)return null;let l;e[0]!==i?(l=r=>{const{field:h}=r;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(he,{htmlFor:"fast-preview-in-place",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.description")})]}),t.jsx(et,{id:"fast-preview-in-place",className:"shrink-0",checked:!!h.value,onCheckedChange:d=>h.onChange(d)})]})},e[0]=i,e[1]=l):l=e[1];let o;return e[2]!==n||e[3]!==l?(o=t.jsx(pe,{control:n,name:"metadata.fastPreviewInPlace",render:l}),e[2]=n,e[3]=l,e[4]=o):o=e[4],o}function pr(a){const e=G.c(32),{control:n,onCommit:s}=a,i=X();let l;e[0]!==i?(l=i("virtualMcp.virtualMcp.publishPolicySmart"),e[0]=i,e[1]=l):l=e[1];let o;e[2]!==i?(o=i("virtualMcp.virtualMcp.publishPolicySmartDescription"),e[2]=i,e[3]=o):o=e[3];let r;e[4]!==l||e[5]!==o?(r={value:"smart",label:l,description:o},e[4]=l,e[5]=o,e[6]=r):r=e[6];let h;e[7]!==i?(h=i("virtualMcp.virtualMcp.publishPolicyCodeReview"),e[7]=i,e[8]=h):h=e[8];let d;e[9]!==i?(d=i("virtualMcp.virtualMcp.publishPolicyCodeReviewDescription"),e[9]=i,e[10]=d):d=e[10];let m;e[11]!==h||e[12]!==d?(m={value:"code-review",label:h,description:d},e[11]=h,e[12]=d,e[13]=m):m=e[13];let f;e[14]!==i?(f=i("virtualMcp.virtualMcp.publishPolicyOpen"),e[14]=i,e[15]=f):f=e[15];let u;e[16]!==i?(u=i("virtualMcp.virtualMcp.publishPolicyOpenDescription"),e[16]=i,e[17]=u):u=e[17];let c;e[18]!==f||e[19]!==u?(c={value:"open",label:f,description:u},e[18]=f,e[19]=u,e[20]=c):c=e[20];let p;e[21]!==r||e[22]!==m||e[23]!==c?(p=[r,m,c],e[21]=r,e[22]=m,e[23]=c,e[24]=p):p=e[24];const x=p;let g;e[25]!==s||e[26]!==x||e[27]!==i?(g=y=>{const{field:j}=y,v=j.value??"smart";return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(he,{htmlFor:"publish-policy",className:"font-normal text-foreground",children:i("virtualMcp.virtualMcp.publishing")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("virtualMcp.virtualMcp.publishingDescription")})]}),t.jsxs(De,{value:v,onValueChange:S=>{j.onChange(S),s()},children:[t.jsx(_e,{id:"publish-policy",className:"w-44 shrink-0 text-sm",children:t.jsx(Ve,{})}),t.jsx(Te,{className:"max-w-80",children:x.map(hr)})]})]})},e[25]=s,e[26]=x,e[27]=i,e[28]=g):g=e[28];let b;return e[29]!==n||e[30]!==g?(b=t.jsx(pe,{name:"metadata.publishPolicy",control:n,render:g}),e[29]=n,e[30]=g,e[31]=b):b=e[31],b}function hr(a){return t.jsx(ge,{value:a.value,description:a.description,children:a.label},a.value)}function xr(a){const e=G.c(24),{control:n,onCommit:s}=a,i=X();let l;e[0]!==i?(l=i("sandbox.cmsSettings.contentEditing.off"),e[0]=i,e[1]=l):l=e[1];let o;e[2]!==i?(o=i("sandbox.cmsSettings.contentEditing.offDescription"),e[2]=i,e[3]=o):o=e[3];let r;e[4]!==l||e[5]!==o?(r={value:"off",label:l,description:o},e[4]=l,e[5]=o,e[6]=r):r=e[6];let h;e[7]!==i?(h=i("sandbox.cmsSettings.contentEditing.on"),e[7]=i,e[8]=h):h=e[8];let d;e[9]!==i?(d=i("sandbox.cmsSettings.contentEditing.onDescription"),e[9]=i,e[10]=d):d=e[10];let m;e[11]!==h||e[12]!==d?(m={value:"on",label:h,description:d},e[11]=h,e[12]=d,e[13]=m):m=e[13];let f;e[14]!==r||e[15]!==m?(f=[r,m],e[14]=r,e[15]=m,e[16]=f):f=e[16];const u=f;let c;e[17]!==s||e[18]!==u||e[19]!==i?(c=x=>{const{field:g}=x,b=g.value??null,y=Ps(b);return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(he,{htmlFor:"content-editing-mode",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.contentEditing.title")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.contentEditing.description")})]}),t.jsxs(De,{value:y,onValueChange:j=>{const v=Ki.safeParse(j);v.success&&(g.onChange(Wi(b,v.data)),s())},children:[t.jsx(_e,{id:"content-editing-mode",className:"w-44 shrink-0 text-sm",children:t.jsx(Ve,{})}),t.jsx(Te,{className:"max-w-80",children:u.map(gr)})]})]})},e[17]=s,e[18]=u,e[19]=i,e[20]=c):c=e[20];let p;return e[21]!==n||e[22]!==c?(p=t.jsx(pe,{name:"metadata.ui.layout",control:n,render:c}),e[21]=n,e[22]=c,e[23]=p):p=e[23],p}function gr(a){return t.jsx(ge,{value:a.value,description:a.description,children:a.label},a.value)}function os(a){const e=a.metadata?.sidebarViews,n=a.metadata?.sidebarViewsVersion;return{effectiveViews:[...St(Nt(a.metadata),n)],rawViews:e===null?null:e?[...e]:void 0,version:n}}function vr(a,e){return a===e?!0:!a||!e||a.length!==e.length?!1:a.every((n,s)=>n===e[s])}function br(a,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...a,shareDialogOpen:e.payload};case"SET_ADD_DIALOG_OPEN":return{...a,addDialogOpen:e.payload};case"OPEN_SETTINGS":return{...a,settingsDialogOpen:!0,settingsConnectionId:e.payload};case"CLOSE_SETTINGS":return{...a,settingsDialogOpen:!1,settingsConnectionId:null};default:return a}}function jr(a,e){switch(e.type){case"accumulate":{const n=a??{start:e.now,fields:new Set,saveCount:0,instructionsLength:null},s=new Set(n.fields);for(const i of e.fields)s.add(i);return{...n,fields:s,saveCount:n.saveCount+1,instructionsLength:e.instructionsLength??n.instructionsLength}}case"reset":return null}}function yr(a){const e=a.metadata?.runtime?.env;if(!e||e.length===0)return a;const n=e.filter(s=>{if(!s||typeof s!="object")return!1;const i=(s.key??"").trim();return!i||!ft.test(i)?!1:s.kind==="literal"?!0:s.kind==="secret"?!!s.secretId:!1});return n.length===e.length?a:{...a,metadata:{...a.metadata,runtime:{...a.metadata?.runtime??{},env:n}}}}async function wr(a,e){const n=a?.idToken??null;if(n){const i=cs(n);if(i)return i}const s=a?.userinfoEndpoint??null;if(s)try{const i=await fetch(s,{headers:{Authorization:`Bearer ${e}`}});if(i.ok){const l=await i.json(),o=typeof l.email=="string"?l.email:typeof l.upn=="string"?l.upn:typeof l.preferred_username=="string"?l.preferred_username:null;if(o)return o}}catch{}return cs(e)}function cs(a){try{const e=a.split(".");if(e.length===3&&e[1]){const n=JSON.parse(atob(e[1].replace(/-/g,"+").replace(/_/g,"/")));if(typeof n.email=="string")return n.email;if(typeof n.upn=="string")return n.upn;if(typeof n.preferred_username=="string")return n.preferred_username}}catch{}return null}function Sr({virtualMcp:a}){const e=X(),n=Vn(),{org:s}=Ae(),i=js(),{data:l}=An([a.id]),o=l?.get(a.id)?.last_used_at,r=gs(),h=xn(),d=ot(),m=Os(a.id),f=JSON.stringify([s.id,a.id]),u=zi(a.metadata,m.snapshot()),c=gn({resolver:vn(Tl),defaultValues:{...a,metadata:{...qt(a.metadata),previewServerUrl:ra(a.metadata),...u}}}),p=c.watch("connections"),x=Vi(a),g=lt(a?.metadata),b=g&&Ps(c.watch("metadata.ui.layout"))==="off",y=ys(a),j=y?{owner:y.owner,name:y.name,url:y.url}:null,[v,S]=W.useReducer(br,{shareDialogOpen:!1,addDialogOpen:!1,settingsDialogOpen:!1,settingsConnectionId:null}),[N,M]=W.useState(!1),[w,C]=W.useState(!1),{openSidePanel:k}=Mn(),{sendMessage:T}=wn(),V=async()=>{if(w)return;const O=c.getValues("metadata.instructions");if(O?.trim()){C(!0);try{$(),je("agent_instructions_improve_clicked",{agent_id:a.id,instructions_length:O.length}),k();const ne=jn(s.id);await T({tiptapDoc:Nn({managerAgentId:ne.id,managerName:ne.title,kind:"agent",id:a.id,instructions:O})})}finally{C(!1)}}},[A,D]=W.useReducer(jr,null),z=()=>{A!==null&&(je("agent_updated",{agent_id:a.id,fields:Array.from(A.fields),instructions_length:A.instructionsLength,save_count:A.saveCount,edit_duration_ms:Date.now()-A.start}),D({type:"reset"}))},{schedule:P,flush:$}=Kt({delayMs:3e4,save:async()=>z()}),F=async()=>{const O=m.snapshot(),ne={predicate:Me=>Ht(Me.queryKey,s.id)},Q=async()=>(await h.invalidateQueries({predicate:Me=>Ht(Me.queryKey,s.id),refetchType:"all"}),Gt(h,s.id,a.id)),ie=(Me,Ue)=>{if(Me){vr(c.getValues("metadata.sidebarViews"),Me.rawViews)||c.setValue("metadata.sidebarViews",Me.rawViews,{shouldDirty:!1}),c.getValues("metadata.sidebarViewsVersion")!==Me.version&&c.setValue("metadata.sidebarViewsVersion",Me.version,{shouldDirty:!1});return}Ue!==null&&(c.setValue("metadata.sidebarViews",[...Ue],{shouldDirty:!1}),c.setValue("metadata.sidebarViewsVersion",Ei,{shouldDirty:!1}))},I=Ri(O),J=Object.keys(c.control._formState.dirtyFields);if(J.length===0&&!I){await m.settle({snapshot:O,saved:!0,authoritativeViews:O?.persistedViews});return}const be=J.length>0?J:["metadata"],ce=be.includes("metadata"),me=c.getValues();c.reset(me,{keepValues:!0});const Oe=yr(me),Hs=Gt(h,s.id,a.id),qs=Li({sidebarViews:Oe.metadata?.sidebarViews,sidebarViewsVersion:Oe.metadata?.sidebarViewsVersion},O,Hs?.metadata);Oe.metadata={...qt(Oe.metadata),...qs};let ht;try{ht=await i.update.mutateAsync({id:a.id,data:Oe})}catch(Me){let Ue=null;try{Ue=await Q()}catch{}const It=Ue?os(Ue):null,Ot=await m.settle({snapshot:O,saved:!1,authoritativeViews:It?.effectiveViews});throw Ot.settledLatest&&ie(It,Ot.reconciledViews),Me}await h.cancelQueries(ne),Ui(h,s.id,ht);const Dt=os(ht),At=await m.settle({snapshot:O,saved:!0,authoritativeViews:Dt.effectiveViews});At.settledLatest&&ie(Dt,At.reconciledViews),D({type:"accumulate",now:Date.now(),fields:be,instructionsLength:ce?me.metadata?.instructions?.length??0:null}),P()},H=()=>oa(f,F),{schedule:B,flush:Y}=Kt({save:H});W.useEffect(()=>{const O=c.watch(()=>B());return()=>O.unsubscribe()},[]);const U=()=>{je("connections_dialog_opened",{source:"agent_settings",mode:"add"}),S({type:"SET_ADD_DIALOG_OPEN",payload:!0})},_=async O=>{const ne=c.getValues("connections");if(ne.some(I=>I.connection_id===O))return;c.setValue("connections",[...ne,{connection_id:O,selected_tools:bt.tools,selected_resources:bt.resources,selected_prompts:bt.prompts}],{shouldDirty:!0}),S({type:"SET_ADD_DIALOG_OPEN",payload:!1});const Q=new URL(`/api/${s.slug}/mcp/${O}`,window.location.origin),ie=await Rt({url:Q.href,token:null,orgId:s.id});ie.supportsOAuth&&!ie.isAuthenticated&&await K(O)},E=O=>{const Q=c.getValues("connections").filter(ie=>ie.connection_id!==O);c.setValue("connections",Q,{shouldDirty:!0})},q=(O,ne)=>{const Q=c.getValues("connections");if(Q.some(ie=>ie.connection_id===ne)){re.error(e("virtualMcp.virtualMcp.instanceAlreadyAdded"));return}c.setValue("connections",Q.map(ie=>ie.connection_id===O?{...ie,connection_id:ne}:ie),{shouldDirty:!0})},L=async O=>{if(c.getValues("connections").find(Q=>Q.connection_id===O))try{const{item:Q}=await d.call("COLLECTION_CONNECTIONS_GET",{id:O});if(!Q)return;const ie=Q.title.replace(/\s*\(.*?\)\s*$/,""),I=yn("conn"),J=`${ie} (${Date.now().toString(36).slice(-4)})`;await r.create.mutateAsync({id:I,title:J,description:Q.description??null,connection_type:Q.connection_type,connection_url:Q.connection_url??null,connection_token:null,icon:Q.icon??null,app_name:Q.app_name??null,app_id:Q.app_id??null,connection_headers:Q.connection_headers??null});const be=new URL(`/api/${s.slug}/mcp/${I}`,window.location.origin),ce=await Rt({url:be.href,token:null,orgId:s.id});if(ce.supportsOAuth&&!ce.isAuthenticated){const me=await K(I);if(!me){await r.delete.mutateAsync(I);return}await r.update.mutateAsync({id:I,data:{title:`${ie} (${me})`}})}q(O,I),re.success(e("virtualMcp.virtualMcp.newInstanceCreated"))}catch(Q){console.error("Failed to create instance:",Q),re.error(e("virtualMcp.virtualMcp.failedToCreateInstance"))}},R=O=>{S({type:"OPEN_SETTINGS",payload:O})},K=async O=>{const{token:ne,tokenInfo:Q,error:ie}=await In({connectionId:O,orgSlug:s.slug,scope:"offline_access"});if(ie||!ne)return re.error(e("virtualMcp.virtualMcp.authenticationFailed",{error:ie??""})),null;if(Q)try{const J=await fetch(`/api/${s.slug}/connections/${O}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:Q.accessToken,refreshToken:Q.refreshToken,expiresIn:Q.expiresIn,scope:Q.scope,clientId:Q.clientId,clientSecret:Q.clientSecret,tokenEndpoint:Q.tokenEndpoint})});if(!J.ok)console.error("Failed to save OAuth token:",await J.text()),await r.update.mutateAsync({id:O,data:{connection_token:ne}});else try{await r.update.mutateAsync({id:O,data:{}})}catch(be){console.warn("Failed to refresh connection tools after OAuth:",be)}}catch(J){console.error("Error saving OAuth token:",J),await r.update.mutateAsync({id:O,data:{connection_token:ne}})}else await r.update.mutateAsync({id:O,data:{connection_token:ne}});const I=new URL(`/api/${s.slug}/mcp/${O}`,window.location.origin);return await h.invalidateQueries({queryKey:hs.isMCPAuthenticated(I.href,null)}),re.success(e("virtualMcp.virtualMcp.authenticationSuccessful")),wr(Q,ne)},Z=()=>{const O=c.getValues("metadata.instructions")??"",ne=e("virtualMcp.virtualMcp.promptTemplateContent"),Q=O.trim()?`${O}
|
|
4
4
|
|