decocms 4.503.2 → 4.503.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ActiveShapeUtils-CBLSJqBl.js → ActiveShapeUtils-B5q2Fpj9.js} +1 -1
- package/dist/client/assets/{AlertCircle-BFUZ4yx0.js → AlertCircle-DNYRiSZ5.js} +1 -1
- package/dist/client/assets/{AreaChart-DKrmhkRJ.js → AreaChart-BTuXJM5s.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CK2OAC0l.js → ArrowLeft-BPRTZJKi.js} +1 -1
- package/dist/client/assets/{ArrowUp-U6_gobY2.js → ArrowUp-ZHJFpRuE.js} +1 -1
- package/dist/client/assets/{BarChart-DBqZyJQX.js → BarChart-Bezom8e_.js} +1 -1
- package/dist/client/assets/{Building02-Ddm6hNyu.js → Building02-BpZfnUaY.js} +1 -1
- package/dist/client/assets/{CategoricalChart-DYWjGYq1.js → CategoricalChart-Uo4Rj6g_.js} +1 -1
- package/dist/client/assets/{CheckCircle-BWW06ZXQ.js → CheckCircle-DOJo5D8E.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-DKcwgXpF.js → ChevronSelectorVertical-BjGO6IDu.js} +1 -1
- package/dist/client/assets/{ChevronUp-CTrNq9Nk.js → ChevronUp-85QiHbB8.js} +1 -1
- package/dist/client/assets/{Copy01-TJP2zB12.js → Copy01-DHwdjF9k.js} +1 -1
- package/dist/client/assets/{CreditCard01-Bm6_xB5H.js → CreditCard01-BMScCkLO.js} +1 -1
- package/dist/client/assets/{DotsVertical-DKl8j3BE.js → DotsVertical-XGcmOLtN.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-CR5xIaDQ.js → ErrorBarContext-1_vc7VhI.js} +1 -1
- package/dist/client/assets/{Globe04-ClrCqE7c.js → Globe04-BJ3qfVTm.js} +1 -1
- package/dist/client/assets/{Image01-Cf_YxPro.js → Image01-DA50Hqzp.js} +1 -1
- package/dist/client/assets/{Key01-55Z6tHcr.js → Key01-GJDDXAJz.js} +1 -1
- package/dist/client/assets/{Link01-DNXOSsg9.js → Link01-DITYAShx.js} +1 -1
- package/dist/client/assets/{LinkBroken01-Vuoqu_ZW.js → LinkBroken01-DqJqD91d.js} +1 -1
- package/dist/client/assets/{Monitor01-C-mB2rao.js → Monitor01-CDHoaa0R.js} +1 -1
- package/dist/client/assets/{Play-CUFyJJIt.js → Play-YAp6V4vH.js} +1 -1
- package/dist/client/assets/{Plus-D-GSl2MA.js → Plus-CPrlnOw7.js} +1 -1
- package/dist/client/assets/{SearchMd-CkV8MM4H.js → SearchMd-vuCQLB6T.js} +1 -1
- package/dist/client/assets/{Sector-CNZsIxmG.js → Sector-Ch82gOyF.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-dI1cRqeE.js → ShoppingBag01-C5bgz2eY.js} +1 -1
- package/dist/client/assets/{Sun-BPl8u-yx.js → Sun-BVt8ND9g.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-KDjTaTLX.js → SwitchHorizontal01-BmNVXOBy.js} +1 -1
- package/dist/client/assets/{Tool01-CvAlZ6_R.js → Tool01-D30btgv0.js} +1 -1
- package/dist/client/assets/{Trash01-BzUZQR5Y.js → Trash01-CuDfbX9_.js} +1 -1
- package/dist/client/assets/{Upload01-CdgDB-zC.js → Upload01-Bbz_T9k9.js} +1 -1
- package/dist/client/assets/{User01-CinpYulR.js → User01-DkehSUca.js} +1 -1
- package/dist/client/assets/{UserSquare-0R6kuy9W.js → UserSquare-CkJD4oxT.js} +1 -1
- package/dist/client/assets/{Users01-DFSTtPtZ.js → Users01-Bx_TIoWb.js} +1 -1
- package/dist/client/assets/{XAxis-CMCcO3jI.js → XAxis-BuYm-sWK.js} +1 -1
- package/dist/client/assets/{XClose-CXxsMd9c.js → XClose-jBQRwEAI.js} +1 -1
- package/dist/client/assets/{ZoomOut-C1rwTYBB.js → ZoomOut-CpX8NTBd.js} +1 -1
- package/dist/client/assets/{access-gate-BSx5LbNZ.js → access-gate-tig-XyXk.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-CNB1XZS8.js → add-connection-dialog-bxfInPMj.js} +1 -1
- package/dist/client/assets/{agent-analytics-BKsJAgnt.js → agent-analytics-B-N286Uf.js} +1 -1
- package/dist/client/assets/agent-app-6dfYkztJ.js +1 -0
- package/dist/client/assets/{agent-assets-CvHLRtfR.js → agent-assets-Cgi1ormd.js} +1 -1
- package/dist/client/assets/{agent-automation-DG660AlN.js → agent-automation-Bc_Pzkf9.js} +1 -1
- package/dist/client/assets/{agent-automations-DkNZsDdV.js → agent-automations-ZrkdxSWn.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-DFGjLsvu.js → agent-connect-sources-DqHqfSqs.js} +1 -1
- package/dist/client/assets/agent-deck-B3gVo2Qj.js +1 -0
- package/dist/client/assets/{agent-e2e-CTTKhY1C.js → agent-e2e-BDGDGL0J.js} +1 -1
- package/dist/client/assets/{agent-experiments-B23reQrT.js → agent-experiments-CSJXs5ck.js} +1 -1
- package/dist/client/assets/{agent-file-CFgK4Fqg.js → agent-file-B4y2baGc.js} +1 -1
- package/dist/client/assets/{agent-hosting-BL7RyxMT.js → agent-hosting-HBYg130L.js} +1 -1
- package/dist/client/assets/{agent-icon-Bmu0Xuy8.js → agent-icon-C1V6kO6k.js} +1 -1
- package/dist/client/assets/agent-library-CrxCYORH.js +1 -0
- package/dist/client/assets/agent-library-file-DAsbJq5U.js +1 -0
- package/dist/client/assets/{agent-monitor-Dxt5K5x_.js → agent-monitor-C2b2Y_Y1.js} +1 -1
- package/dist/client/assets/{agent-overview-CAzScYJD.js → agent-overview-CsnhRf0H.js} +1 -1
- package/dist/client/assets/{agent-releases-RSbZ96r7.js → agent-releases-DRgXlmeB.js} +1 -1
- package/dist/client/assets/agent-settings-BZ88TB1O.js +1 -0
- package/dist/client/assets/{agent-site-editor-DFWKub_t.js → agent-site-editor-DsdBJNL9.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-Df5lx3om.js +2 -0
- package/dist/client/assets/agent-site-editor-content-BOiOZFoZ.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-DO0UOaFC.js +1 -0
- package/dist/client/assets/agent-view-BgXKt_Jw.js +1 -0
- package/dist/client/assets/{agent-view-guard-BwubZYi8.js → agent-view-guard-Km-JyuT6.js} +1 -1
- package/dist/client/assets/{agents-list-L7YgNFph.js → agents-list-BanY1y62.js} +1 -1
- package/dist/client/assets/{ai-providers-DEeLkiCM.js → ai-providers-BQ1fiNa3.js} +1 -1
- package/dist/client/assets/{alert-CnRQ3m-7.js → alert-CwC4mTxQ.js} +1 -1
- package/dist/client/assets/{alert-dialog-BaBKldUA.js → alert-dialog-DmhXDwQf.js} +1 -1
- package/dist/client/assets/{analytics-sections-BIEC86HP.js → analytics-sections-BVE76D5N.js} +1 -1
- package/dist/client/assets/api-keys-Br0s22Rf.js +1 -0
- package/dist/client/assets/{api-keys-CmpJo1Rr.js → api-keys-MPhXPzmG.js} +1 -1
- package/dist/client/assets/{app-editor-BqvAOKlk.js → app-editor-Hif319cO.js} +1 -1
- package/dist/client/assets/{asset-utils--N2gsOKr.js → asset-utils-CU6xrAQD.js} +1 -1
- package/dist/client/assets/{auth-BeK8rRbB.js → auth-BfGJq755.js} +1 -1
- package/dist/client/assets/{auth-catchall-fFMHk_ps.js → auth-catchall-DHUJeHRe.js} +1 -1
- package/dist/client/assets/{auth-entry-C1_Znn_c.js → auth-entry-D7U4AjUc.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CocPnGfp.js → auth-split-layout-BwhoO-JF.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DJwJCiC8.js → authenticate-and-persist-oauth-Brcij0L8.js} +1 -1
- package/dist/client/assets/{automation-list-row-3WI1rtPZ.js → automation-list-row-DhqnXrm1.js} +1 -1
- package/dist/client/assets/{automation-runs-dkpbdf4I.js → automation-runs-CFyZ7Iod.js} +1 -1
- package/dist/client/assets/{automations-CaP79ol1.js → automations-CPaO2SBr.js} +1 -1
- package/dist/client/assets/{autosend-B-VPnrp2.js → autosend-BOeZuHqU.js} +1 -1
- package/dist/client/assets/{avatar-yCbsNNbw.js → avatar-GhiWKw1r.js} +1 -1
- package/dist/client/assets/{badge-Zdi_g359.js → badge-ZAtAF3u1.js} +1 -1
- package/dist/client/assets/{block-document-D4x1DRNW.js → block-document-BFsYEKLL.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-CMtVQxL8.js → blocks-preview-workspace-context-x6dOFQvJ.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-B7_Q2Byx.js → blocks-tab-states-iEAVPlIx.js} +3 -3
- package/dist/client/assets/{blog-schema-D0r94Mwa.js → blog-schema-ctDuKA_t.js} +1 -1
- package/dist/client/assets/{board-analytics-DjFw48Ii.js → board-analytics-DvMyzeTp.js} +1 -1
- package/dist/client/assets/{buckets-DmovZm0n.js → buckets-CgmF5YK1.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-Cd4DLFMv.js → build-improve-prompt-doc-C3V-cifS.js} +1 -1
- package/dist/client/assets/{calendar-aMW3a7Qx.js → calendar-DCNv43ZU.js} +1 -1
- package/dist/client/assets/{capability-load-error-xmV40q_-.js → capability-load-error-BwwdyiCX.js} +1 -1
- package/dist/client/assets/{category-editor-BYf-_N2d.js → category-editor-C1SS3xs8.js} +1 -1
- package/dist/client/assets/{chart-D1eqwoYD.js → chart-C2XR0VWr.js} +1 -1
- package/dist/client/assets/{chat-context-C4pDshj1.js → chat-context-B8EIbmvQ.js} +1 -1
- package/dist/client/assets/{chat-draft-D5dlb_sl.js → chat-draft-qnxtVEVH.js} +1 -1
- package/dist/client/assets/{checkbox-C2l5tKo2.js → checkbox-C7CPIIbh.js} +1 -1
- package/dist/client/assets/{choose-editor-C_NzKjq2.js → choose-editor-C5zdSB58.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DSx-mAhh.js → cli-auth-success-DTXn6lOO.js} +1 -1
- package/dist/client/assets/{client-icons-BasHQFnS.js → client-icons-TMNg5z-u.js} +1 -1
- package/dist/client/assets/cms-settings-editor-CK28ljtG.js +1 -0
- package/dist/client/assets/{collapsible-CDZFoOK-.js → collapsible-CVaRDj_D.js} +1 -1
- package/dist/client/assets/{collection-detail-DkNCk0OQ.js → collection-detail-BR9DK1c7.js} +1 -1
- package/dist/client/assets/{collection-display-button--eCg5c5n.js → collection-display-button-ehG7rKuY.js} +1 -1
- package/dist/client/assets/{collection-search-sopr7ssV.js → collection-search-DOoRymFZ.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Cy3Cbckv.js → collection-table-wrapper-zN3HZXSF.js} +1 -1
- package/dist/client/assets/{collection-tabs-DU5QTifc.js → collection-tabs-DLtCCrSF.js} +1 -1
- package/dist/client/assets/{column-rules-Z54WqqNc.js → column-rules-Du1x2YcT.js} +1 -1
- package/dist/client/assets/{combobox-C2hXpc1p.js → combobox-DlHUORRR.js} +1 -1
- package/dist/client/assets/{command-BSGZ-TwS.js → command-_UmLRidn.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-d9HGklIc.js → companion-mcps-section-joijt_6l.js} +1 -1
- package/dist/client/assets/{config-CddNRjRY.js → config-Cx-JIPqO.js} +1 -1
- package/dist/client/assets/{connect-BGfL3A9r.js → connect-DoSLTcjV.js} +1 -1
- package/dist/client/assets/{connect-layout-DoM7vuFX.js → connect-layout-Bm_59z-Y.js} +1 -1
- package/dist/client/assets/{connection-B0eFNfCu.js → connection-DL3AzTOs.js} +1 -1
- package/dist/client/assets/{connection-card-BzTYJa6s.js → connection-card-Dvq8DJhG.js} +1 -1
- package/dist/client/assets/{connection-detail-Cwz-qT82.js → connection-detail-DqoTA2Jx.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-ChgreO5F.js → connection-form-helpers-D9j_N0x7.js} +1 -1
- package/dist/client/assets/{connections-CnirV_66.js → connections-CcmlL0dN.js} +1 -1
- package/dist/client/assets/{content-tab-BIEsoSfa.js → content-tab-63E-NyaC.js} +3 -3
- package/dist/client/assets/{context-DEuw9CjH.js → context-DQMyTLF9.js} +1 -1
- package/dist/client/assets/{context-menu-CHrxflOD.js → context-menu-BxD8Qoq9.js} +1 -1
- package/dist/client/assets/{core.esm-CWXW2IWJ.js → core.esm-5rgifJ6w.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-Bci4qKSS.js → create-organization-dialog-DKnw552E.js} +1 -1
- package/dist/client/assets/{daily-pulse-CRZ8lDnm.js → daily-pulse-BLN6tqFf.js} +1 -1
- package/dist/client/assets/{discover-C3iLTVFB.js → discover-C69w99TN.js} +1 -1
- package/dist/client/assets/{domain-settings-DdY9W_8b.js → domain-settings-z0KMryJJ.js} +1 -1
- package/dist/client/assets/{drawer-BpEasqMM.js → drawer-Cwq-E8vz.js} +1 -1
- package/dist/client/assets/{editor-DQK8Gbky.js → editor-YT1hAWJG.js} +1 -1
- package/dist/client/assets/{editor-classes-wKHzvXkJ.js → editor-classes-BOlaxHer.js} +1 -1
- package/dist/client/assets/{empty-state-Ck0Y0zH4.js → empty-state-COxR0UdU.js} +1 -1
- package/dist/client/assets/{empty-state-GUv-DLNf.js → empty-state-bIFMElEe.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CyaR6DQN.js → extract-connection-data-BOqucuID.js} +1 -1
- package/dist/client/assets/{feature-gate-Cd3TCuYG.js → feature-gate-zfN6jjr4.js} +1 -1
- package/dist/client/assets/{feature-paywall-HnwykYzM.js → feature-paywall-DOf-RXxD.js} +1 -1
- package/dist/client/assets/{file-explorer-B8GvovSI.js → file-explorer-CflV7iiA.js} +1 -1
- package/dist/client/assets/{file-preview-KNDU2UhF.js → file-preview-BPog6jkH.js} +1 -1
- package/dist/client/assets/file-share-button-DwxdVjUj.js +3 -0
- package/dist/client/assets/{file-type-icon-C2WSm6EM.js → file-type-icon-fTBob-KS.js} +1 -1
- package/dist/client/assets/flat-project-D1WKpn7D.js +1 -0
- package/dist/client/assets/{folder-icon-DOSAeTvE.js → folder-icon-hdUwkBM6.js} +1 -1
- package/dist/client/assets/{form-Dz-wry37.js → form-mnUTUUgy.js} +1 -1
- package/dist/client/assets/{general-lahSHdvs.js → general-CgQXqxtP.js} +1 -1
- package/dist/client/assets/{home-CfslMwmV.js → home-CV9BF9nv.js} +1 -1
- package/dist/client/assets/{hosted-publish-feedback-D7K1BgAP.js → hosted-publish-feedback-B7Lxlu-b.js} +1 -1
- package/dist/client/assets/{icon-button-BbQESQAz.js → icon-button-Bt7uHWxC.js} +1 -1
- package/dist/client/assets/{index-CVeMcxNw.js → index-0NedKVmw.js} +1 -1
- package/dist/client/assets/{index-COyZFAVd.js → index-9SoDq1r6.js} +1 -1
- package/dist/client/assets/{index-DSuQX-Dj.js → index-B0o9NkGp.js} +1 -1
- package/dist/client/assets/{index-qp2WMoaq.js → index-B7MMDJJ7.js} +1 -1
- package/dist/client/assets/{index-Fqg3dcpq.js → index-Bo2QXn8j.js} +1 -1
- package/dist/client/assets/{index-mPiuZtAa.js → index-Bt_WPZSk.js} +1 -1
- package/dist/client/assets/{index-BoB02eW2.js → index-Bu9BjZrq.js} +2 -2
- package/dist/client/assets/{index-Cdsu1Nw_.js → index-BwRxHLj2.js} +1 -1
- package/dist/client/assets/{index-CAsLc9Zw.js → index-C2F2YRTL.js} +1 -1
- package/dist/client/assets/{index-DuSo48nd.js → index-CVgtqYMj.js} +1 -1
- package/dist/client/assets/{index-BFWcpEys.js → index-C_vMO742.js} +1 -1
- package/dist/client/assets/{index-BhuMySoe.js → index-CaAWsuiJ.js} +1 -1
- package/dist/client/assets/{index-DhnL-yRw.js → index-CdyBZ-dj.js} +1 -1
- package/dist/client/assets/{index-CD1O2KuY.js → index-DIb14xIW.js} +3 -3
- package/dist/client/assets/{index-BX4Ek3Q9.js → index-DYj9xST9.js} +1 -1
- package/dist/client/assets/{index-redirect-LGC8XAQa.js → index-redirect-BUSEAkWr.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BuOPvaCd.js → infiniteQueryObserver-Cgqjyb2j.js} +1 -1
- package/dist/client/assets/{infra-billing-C7a9CxBG.js → infra-billing-Dmuw8KU-.js} +1 -1
- package/dist/client/assets/{input-Dx6Yl3YV.js → input-CEeDInNj.js} +3 -3
- package/dist/client/assets/{input-CC2XqVda.js → input-GO29c19t.js} +1 -1
- package/dist/client/assets/{integration-icon-YHEiRLgT.js → integration-icon-D0zNx-RJ.js} +1 -1
- package/dist/client/assets/{jira-icon-i9apovX2.js → jira-icon-DvLH7QI5.js} +1 -1
- package/dist/client/assets/{label-CsyEQPG4.js → label-BqTE8eVe.js} +1 -1
- package/dist/client/assets/{layout-BT112QdT.js → layout-DpqY7e7r.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-HgU3c2Dz.js → legacy-agents-deep-XW7PcOvc.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-jScx_XSf.js → legacy-main-redirect-BlcRg6jU.js} +1 -1
- package/dist/client/assets/library-BCn7yrRw.js +1 -0
- package/dist/client/assets/{library-tab-9158ORpA.js → library-tab-DX4N_54U.js} +1 -1
- package/dist/client/assets/{login-OE28YT2s.js → login-D_5_-2-7.js} +1 -1
- package/dist/client/assets/{markdown-TXCHEe-4.js → markdown-Wx3jaxrX.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BAlCN3Lv.js → mcp-app-renderer-CIdjohnw.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CuU6LL15.js → mcp-oauth-BqOO-7HR.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BFqNJ-iQ.js → mcp-oauth-CP7f2bqu.js} +1 -1
- package/dist/client/assets/{members-CbEEa2ua.js → members-CWfNsRhJ.js} +1 -1
- package/dist/client/assets/{memory-malk94i-.js → memory-CBEItIQh.js} +1 -1
- package/dist/client/assets/{mini-report-page-Dhes7qGv.js → mini-report-page-BUjMh7u3.js} +1 -1
- package/dist/client/assets/{mock-board-B4GBU96k.js → mock-board-Ci5UecWv.js} +1 -1
- package/dist/client/assets/{monaco-editor-DIn5LVAo.js → monaco-editor-uL7EgDLV.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CsXWM1-N.js → monitoring-stats-row-CTBvl4CT.js} +1 -1
- package/dist/client/assets/{multi-select-jv5l4gKB.js → multi-select-Dsayixmw.js} +1 -1
- package/dist/client/assets/{mustache-C3mAjW3w.js → mustache-CdAmmkEb.js} +1 -1
- package/dist/client/assets/{new-project-dialog-DCPZVRuS.js → new-project-dialog-C2CawYle.js} +1 -1
- package/dist/client/assets/{oauth-callback-C7bM7rgT.js → oauth-callback-Cr6Mkw-S.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-maa6Zm5e.js → oauth-callback-ai-provider-3XAXL_LG.js} +1 -1
- package/dist/client/assets/{onboarding-ds1UbiQ9.js → onboarding-Cr8prmNS.js} +1 -1
- package/dist/client/assets/{openai-conversation-BSvbWT0F.js → openai-conversation-CqdQkpbG.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-2rlAyeqj.js → optimistic-project-sidebar-views-CqtTgCjK.js} +1 -1
- package/dist/client/assets/{order-monitor-day-CZG8_Uqo.js → order-monitor-day-xXzJoCon.js} +1 -1
- package/dist/client/assets/{organization-choice-CGGV7pYx.js → organization-choice-ysHevYPz.js} +1 -1
- package/dist/client/assets/{orgs-DSh5ncFV.js → orgs-DdXSSyy_.js} +1 -1
- package/dist/client/assets/{page-seo-form-BPMiXtW-.js → page-seo-form--GeHG2Y7.js} +1 -1
- package/dist/client/assets/{pair-C9IKm4JE.js → pair-BRzx8V28.js} +1 -1
- package/dist/client/assets/{plan-ladder-DbkDT52b.js → plan-ladder-DEcsqAHq.js} +1 -1
- package/dist/client/assets/{popover-CzNTcDJM.js → popover-DBhjt7xF.js} +1 -1
- package/dist/client/assets/{post-calendar-DGIFZvru.js → post-calendar-BBgMihhC.js} +1 -1
- package/dist/client/assets/{post-editor-BINaZa6q.js → post-editor-D6Q9G6HD.js} +1 -1
- package/dist/client/assets/{preview-content-BjX4Mivy.js → preview-content-B8gytc3A.js} +1 -1
- package/dist/client/assets/{preview-dialog-C8Boj2eR.js → preview-dialog-Du8s313b.js} +1 -1
- package/dist/client/assets/{preview-panel-BTtWNKn9.js → preview-panel-lv7hIcbh.js} +1 -1
- package/dist/client/assets/{preview-tab-BYhuHpLV.js → preview-tab-OUmlHA2w.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-qxyRXjlS.js → product-picker-dialog-Vi9M9XbY.js} +1 -1
- package/dist/client/assets/{profile-Cgb34CQu.js → profile-rjLUYrke.js} +1 -1
- package/dist/client/assets/{project-app-view-B5MD1o9B.js → project-app-view-ChI-tWmY.js} +1 -1
- package/dist/client/assets/{project-feed-DnDlefHV.js → project-feed-DSYFIf9h.js} +1 -1
- package/dist/client/assets/{project-icon-CP0m7tWm.js → project-icon-DEfb1G5F.js} +1 -1
- package/dist/client/assets/project-reports-CSI1uE8Z.js +1 -0
- package/dist/client/assets/project-tasks-DxRsaOWu.js +1 -0
- package/dist/client/assets/{projects-DmCmaniu.js → projects-CtrF1Zf3.js} +1 -1
- package/dist/client/assets/{projects-empty-state-fIhR2Z5I.js → projects-empty-state-Cebygjnd.js} +1 -1
- package/dist/client/assets/{prompts-CW5UUH65.js → prompts-BVXX6Xql.js} +1 -1
- package/dist/client/assets/record-editor-CCo2C6Wx.js +1 -0
- package/dist/client/assets/{redirect-editor-CxJl2CVJ.js → redirect-editor-DIAc_1Im.js} +1 -1
- package/dist/client/assets/{reports-BXGEiRjn.js → reports-Du7byUHW.js} +1 -1
- package/dist/client/assets/reports-MoZoLp_a.js +1 -0
- package/dist/client/assets/{reports-onboarding-DNEAbZJV.js → reports-onboarding-Ds-Ispiz.js} +1 -1
- package/dist/client/assets/{reports-tab-CwK-fp7x.js → reports-tab-ChePuZZ4.js} +2 -2
- package/dist/client/assets/{repositories-ClghJilC.js → repositories-BTxz09bM.js} +1 -1
- package/dist/client/assets/{repository-binding-BYnKmLVI.js → repository-binding-DTzReh06.js} +1 -1
- package/dist/client/assets/{repository-import-picker-De4qAOck.js → repository-import-picker-CUpsn0UU.js} +1 -1
- package/dist/client/assets/{repository-picker-B7BUYgB7.js → repository-picker-liId9_zf.js} +1 -1
- package/dist/client/assets/{require-capability-hn1SreP5.js → require-capability-CfedINkj.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Mqzz7XgH.js → required-auth-layout-CZd2SYeJ.js} +1 -1
- package/dist/client/assets/{reset-password-BOpvbCSW.js → reset-password-qlKVFcE6.js} +1 -1
- package/dist/client/assets/{resizable-DpCFVPH5.js → resizable-D31F4eAS.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-8PRTNpAS.js → resolve-tab-icon-DvCi-XX9.js} +1 -1
- package/dist/client/assets/{review-settings-Bw0A1sn1.js → review-settings-ZCONB0R7.js} +1 -1
- package/dist/client/assets/{roles-BMCtr4MB.js → roles-C28vWKZO.js} +1 -1
- package/dist/client/assets/{route-DnP6JRb8.js → route-BNyTQhdC.js} +1 -1
- package/dist/client/assets/{route-DLSqOpoM.js → route-Jtrcqjic.js} +1 -1
- package/dist/client/assets/route-dcUraDhg.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-Dg7K5ioC.js → sandbox-lifecycle-context-BSXgRctA.js} +1 -1
- package/dist/client/assets/{schema-D-qEbXZ-.js → schema-Bn8rqd_f.js} +1 -1
- package/dist/client/assets/{schema-zU96PUAb.js → schema-D1LjZYZ_.js} +1 -1
- package/dist/client/assets/{scroll-area-D_ro8hTm.js → scroll-area-Cvpjc0l0.js} +1 -1
- package/dist/client/assets/{search-input-qNQGHbDh.js → search-input-CvytUoQu.js} +1 -1
- package/dist/client/assets/{search-toggle-Dfh8XGYH.js → search-toggle-DWczizY_.js} +1 -1
- package/dist/client/assets/{secret-ciphertext-DkD2R7dc.js → secret-ciphertext-BOjfqnbQ.js} +1 -1
- package/dist/client/assets/{secret-picker-CmVVvqgZ.js → secret-picker-DR8k8utG.js} +1 -1
- package/dist/client/assets/{secrets-BDW-A1kb.js → secrets-B26-rytL.js} +1 -1
- package/dist/client/assets/{sections-editor-BKmXdadO.js → sections-editor-DIXfWh89.js} +1 -1
- package/dist/client/assets/{select-C4iThYr6.js → select-B9xwWJY1.js} +1 -1
- package/dist/client/assets/{select-model-BND792Uy.js → select-model-BISIL0Kz.js} +1 -1
- package/dist/client/assets/{seo-editor-ClpJZQda.js → seo-editor-BlwDgWbu.js} +1 -1
- package/dist/client/assets/{separator-DYHY_XVB.js → separator-fhIOQ41X.js} +1 -1
- package/dist/client/assets/{settings-tab-A8T1BHYG.js → settings-tab-msJQpCfG.js} +1 -1
- package/dist/client/assets/{sheet-BXRHJIP3.js → sheet-Rjoe19XZ.js} +1 -1
- package/dist/client/assets/{shell-layout-BhM3Q_22.js → shell-layout-fqXaSGsn.js} +1 -1
- package/dist/client/assets/site-editor-DZgKAtXf.js +1 -0
- package/dist/client/assets/{site-editor-toast-DPPGE5LH.js → site-editor-toast-CKw1dZ19.js} +1 -1
- package/dist/client/assets/{skills-Kw1j3-7B.js → skills-C7DkipJu.js} +1 -1
- package/dist/client/assets/{slider-CpU4rmfX.js → slider-CHDMj7-G.js} +1 -1
- package/dist/client/assets/{sortable.esm-CBSg5QWi.js → sortable.esm-Dys0-jaI.js} +1 -1
- package/dist/client/assets/{sso-GSEhvAQ2.js → sso-cg0TfFU1.js} +1 -1
- package/dist/client/assets/{suggestion-BPVDnpZj.js → suggestion-DpmKDRpP.js} +1 -1
- package/dist/client/assets/{switch-63WSXheM.js → switch-Dyv9YUWT.js} +1 -1
- package/dist/client/assets/{symbol-rviHpBrN.js → symbol-BK6V8ZzP.js} +1 -1
- package/dist/client/assets/{synced-repos-D3YnOlYC.js → synced-repos-DpQU86pc.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-Dqe-yN6V.js → tab-icon-glyph-KVUtF-xE.js} +1 -1
- package/dist/client/assets/{table-CLaOCONQ.js → table-9i0Xw8tZ.js} +1 -1
- package/dist/client/assets/{tabs-BQUPeDjf.js → tabs-h2gBBRzw.js} +1 -1
- package/dist/client/assets/{task-board-DxxiAR5A.js → task-board-AWLuhkrp.js} +1 -1
- package/dist/client/assets/{task-route-Ce6MTE8h.js → task-route-BfCPNuEb.js} +1 -1
- package/dist/client/assets/{task-status-CMbp-PaL.js → task-status-C0Jba3Xb.js} +1 -1
- package/dist/client/assets/taskboard-analytics-DOVTfSds.js +1 -0
- package/dist/client/assets/{tasks-BarD4hla.js → tasks-B3wC6JY6.js} +1 -1
- package/dist/client/assets/tasks-DhO2f9o0.js +1 -0
- package/dist/client/assets/{textarea-CxYAsAPe.js → textarea-7aD59y1C.js} +1 -1
- package/dist/client/assets/{thread-analytics-Cjx1orRq.js → thread-analytics-B5RrlZAS.js} +1 -1
- package/dist/client/assets/{thread-intent-DikZOwd-.js → thread-intent-YA4iB4rg.js} +1 -1
- package/dist/client/assets/{thread-route-CRU_aqN9.js → thread-route-B90y2Ttt.js} +1 -1
- package/dist/client/assets/{thread-route-ChugAIRh.js → thread-route-BgOTv3tU.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-DfFj6DBB.js → thread-sheet-body-DBmCCiJG.js} +1 -1
- package/dist/client/assets/{time-range-picker-Bf6M5ihN.js → time-range-picker-CWWLy_3R.js} +1 -1
- package/dist/client/assets/{toggle-group-DbSldXZX.js → toggle-group-DRNkGgUT.js} +1 -1
- package/dist/client/assets/{tool-namespace-pIFYrei5.js → tool-namespace-C83WlsNL.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-B24Twz-b.js → toolbar-icon-button-Bt6CBlAy.js} +1 -1
- package/dist/client/assets/{tooltip-Bs0EJaD7.js → tooltip-Djfj4yvo.js} +1 -1
- package/dist/client/assets/{tooltipContext-fXkDpiI8.js → tooltipContext-B0xkDjO4.js} +1 -1
- package/dist/client/assets/{track-BzGhLw1A.js → track-aEjANf-j.js} +1 -1
- package/dist/client/assets/{types-IpdOmnYx.js → types-DSQN8Y9X.js} +1 -1
- package/dist/client/assets/{url-slug-CMCbwnaP.js → url-slug-DNuO5vGK.js} +1 -1
- package/dist/client/assets/{usage-stats-DuvxTL2m.js → usage-stats-BXR_QJg-.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Becg3IYt.js → use-ai-providers-CS760siL.js} +1 -1
- package/dist/client/assets/{use-app-takeover-DFb1RzQs.js → use-app-takeover-BiROkfIG.js} +1 -1
- package/dist/client/assets/{use-automations-Cp9pysoO.js → use-automations-C8HNZgvV.js} +1 -1
- package/dist/client/assets/{use-autosave-C5CskRdQ.js → use-autosave-DiQgKPVz.js} +1 -1
- package/dist/client/assets/{use-chat-navigation-BJSvg7rH.js → use-chat-navigation-CkUks0CI.js} +1 -1
- package/dist/client/assets/{use-clock-tick-B1PaG9d4.js → use-clock-tick-D9Y3YKA4.js} +1 -1
- package/dist/client/assets/{use-connect-companion-ClLk9Ret.js → use-connect-companion-Dh2GSI2w.js} +1 -1
- package/dist/client/assets/{use-connection-CLmhN_H7.js → use-connection-CYm-Vxmx.js} +1 -1
- package/dist/client/assets/{use-copy-T3xwaExj.js → use-copy-C0ICuN7j.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CVTk_yNo.js → use-create-virtual-mcp-iJVLGT10.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-CYDYn543.js → use-date-fns-locale-BEXRTRYo.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-8fEcHiWI.js → use-debounced-autosave-Z24y5bHD.js} +1 -1
- package/dist/client/assets/{use-debounced-value-d254MtLc.js → use-debounced-value-Tstd89O2.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BJdkVUlJ.js → use-deco-credits-a2fVSYw4.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-D42PqykU.js → use-decopilot-events-B59p52EB.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Bp41mUbu.js → use-delete-connection-CjcSXnbW.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Cz36UM7j.js → use-deployment-admin-gB6Ubqa0.js} +1 -1
- package/dist/client/assets/{use-ensure-project-folder-DV9pI0pa.js → use-ensure-project-folder-DakHhVfG.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-Dbj9pvCB.js → use-fast-preview-draft-url-BElMJQru.js} +1 -1
- package/dist/client/assets/{use-file-configs-D_kGDRPd.js → use-file-configs-CMXUzCw9.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-C47I-wuH.js → use-infinite-scroll-Bkeb3Emc.js} +1 -1
- package/dist/client/assets/{use-join-requests-Cy3hlZv5.js → use-join-requests-Bt9kCP2g.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-DjhEbRyd.js → use-main-panel-tabs-DiN00eBp.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-5SUSMsp-.js → use-mcp-auth-status-C8SSMyOQ.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CEKqqblF.js → use-mcp-client-DXWvBBzU.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CwF-bqUg.js → use-mcp-prompts-D5_raFI0.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-_07-mu_D.js → use-mcp-tools-BA7tqEjQ.js} +1 -1
- package/dist/client/assets/{use-members-CFcpHrvE.js → use-members-CBJHrFbr.js} +1 -1
- package/dist/client/assets/{use-mobile-CYsZ0F3X.js → use-mobile-DVlrjJnR.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DNsHLJD8.js → use-navigate-to-agent-zweZgwVY.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-C1m0KS6b.js → use-open-billing-url-CZCPBR61.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-9ZqTxhaU.js → use-org-auth-client-QUHxqp7u.js} +1 -1
- package/dist/client/assets/{use-org-fs-Wo4_O8nn.js → use-org-fs-ZG2jF1ev.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-HjlHy8Rb.js → use-org-repo-syncs-BkNHAu91.js} +1 -1
- package/dist/client/assets/{use-org-sso-BSkklN8h.js → use-org-sso-BY7vua13.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Dga2ANZJ.js → use-organization-roles-BX0bRQ46.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DHSMN_14.js → use-organization-settings-DrbkHsVi.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-62gIHptt.js → use-panel-navigate-CgLeC7oT.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-D12oGF6A.js → use-project-native-view-presence-FuvDcd3j.js} +1 -1
- package/dist/client/assets/{use-project-scope-Dk4Q60O6.js → use-project-scope-Mbz61u0U.js} +1 -1
- package/dist/client/assets/{use-recent-apps-CCwo686W.js → use-recent-apps-ByE0IPMO.js} +1 -1
- package/dist/client/assets/{use-releases-wK1mECcA.js → use-releases-Cn9YGFYD.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-CfPcDRof.js → use-reports-diagnostic-CNH6bT_s.js} +1 -1
- package/dist/client/assets/{use-secrets-Cmhjz2bf.js → use-secrets-BdA07xp7.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DJFgOhQZ.js → use-section-preview-base-BGUJwyF6.js} +1 -1
- package/dist/client/assets/{use-tags-D0LqZNOI.js → use-tags-RK2ALcRH.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BpQqtB1w.js → use-task-board-analytics-Lm2x_Ld6.js} +1 -1
- package/dist/client/assets/{use-task-board-events-BrTJpTlj.js → use-task-board-events-CwaYpBZ3.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-BHRZFWqk.js → use-task-board-item-prs-DuoDCPJm.js} +1 -1
- package/dist/client/assets/{use-task-board-items-CZjiF2uB.js → use-task-board-items-C9iR5m8M.js} +1 -1
- package/dist/client/assets/{use-task-metadata-Bef5UioD.js → use-task-metadata-BOySMSW9.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-CiJumHRj.js → use-thread-analytics-B-6hcr7K.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-BVEM1vsy.js → use-thread-outputs-Bnh-FZdC.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-9rJQjSuN.js +1 -0
- package/dist/client/assets/{useQueries-D52x651p.js → useQueries-BWCAInNJ.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-xLkb2FEg.js +1 -0
- package/dist/client/assets/{users-DfEzbgjc.js → users-BSQM-sro.js} +1 -1
- package/dist/client/assets/{utils-DVs-Bhj-.js → utils-aJ0jY1W-.js} +1 -1
- package/dist/client/assets/{variant-calendar-B4damr_G.js → variant-calendar-CHK_OU2h.js} +1 -1
- package/dist/client/assets/{variant-draft-pointer-BnxZeLy_.js → variant-draft-pointer-1dv3zT6b.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DKlegHXH.js → view-mode-toggle-C14-toNe.js} +1 -1
- package/dist/client/assets/{virtual-mcp-UT0zZzHO.js → virtual-mcp-QuhvrKMt.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-BdkzrgTO.js → watch-sse-pool-CWMRkqIp.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +2 -2
- package/dist/client/assets/agent-app-DBSthuoA.js +0 -1
- package/dist/client/assets/agent-deck-DW69LMk-.js +0 -1
- package/dist/client/assets/agent-library-D9aAC92j.js +0 -1
- package/dist/client/assets/agent-library-file-Dlq-Vts6.js +0 -1
- package/dist/client/assets/agent-settings-5EOlZJW6.js +0 -1
- package/dist/client/assets/agent-site-editor-code-I8N3vaXE.js +0 -2
- package/dist/client/assets/agent-site-editor-content-uhd8Bnc-.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-CV5DbDBm.js +0 -1
- package/dist/client/assets/agent-view-QNUTYcIi.js +0 -1
- package/dist/client/assets/api-keys-BgtInlXe.js +0 -1
- package/dist/client/assets/cms-settings-editor-BB3l1bfM.js +0 -1
- package/dist/client/assets/file-share-button-BX7_JCXp.js +0 -3
- package/dist/client/assets/flat-project-XWFiDywx.js +0 -1
- package/dist/client/assets/library-CWV47kSp.js +0 -1
- package/dist/client/assets/project-reports-8XAuspn6.js +0 -1
- package/dist/client/assets/project-tasks-CGbl7DTy.js +0 -1
- package/dist/client/assets/record-editor--8X4AXV_.js +0 -1
- package/dist/client/assets/reports-eZ_It7qc.js +0 -1
- package/dist/client/assets/route-yiouOCXy.js +0 -1
- package/dist/client/assets/site-editor-LulM9jUZ.js +0 -1
- package/dist/client/assets/taskboard-analytics-_ZvfL2sj.js +0 -1
- package/dist/client/assets/tasks-DcunZstc.js +0 -1
- package/dist/client/assets/useInfiniteQuery-S3a_-GqY.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DiRI5XkI.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as q,b as ee,r as Q,j as t,B as ne,h as et,l as xe,X as ps,T as hs,V as xs,U as We,as as Et,aq as zt,ar as Rt,t as re,a2 as Oe,D as Ge,q as qe,s as tt,v as st,H as Le,a3 as gs,fz as nn,w as Ct,L as vs,I as Ce,ak as ln,z as an,ep as Xe,au as Lt,aj as rn,eo as Fe,en as Ue,a9 as kt,m as bs,K as Mt,fA as on,fB as cn,fC as dn,b9 as ve,fD as be,n as Re,P as un,d as _t,u as mn,ah as nt,o as js,e as fn,aM as ys,y as ke,ey as pn,az as hn,eU as xn,fE as gn,b1 as vn,a as bn,fF as ws,fG as jn,aW as yn,af as wn,aE as Sn,aD as Nn,a5 as Cn,fH as kn,aL as Mn}from"./index-BoB02eW2.js";import{g as _n}from"./extract-connection-data-CyaR6DQN.js";import{b as Vn}from"./chat-context-C4pDshj1.js";import{U as Tn,b as Dn}from"./build-improve-prompt-doc-Cd4DLFMv.js";import{E as An}from"./empty-state-GUv-DLNf.js";import{a as Pn}from"./shell-layout-BhM3Q_22.js";import{g as ct,n as In,a as Ut,e as On,u as $n,f as Fn}from"./use-date-fns-locale-CYDYn543.js";import{a as En}from"./mcp-oauth-BFqNJ-iQ.js";import{f as zn,e as Rn,b as Ln,A as Un,a as Bn,d as Yn,c as Wn,g as Kn}from"./alert-dialog-BaBKldUA.js";import{T as at}from"./textarea-CxYAsAPe.js";import{c as we,T as Se,a as Ne}from"./tooltip-Bs0EJaD7.js";import{a as Vt,b as Ss,u as Gn}from"./use-connection-CLmhN_H7.js";import{b as Ns,a as Cs,f as ks,g as Ms,l as qn}from"./repository-binding-BYnKmLVI.js";import{i as Bt}from"./mcp-oauth-CuU6LL15.js";import{bf as Hn,h as Qn,bg as Xn,bh as Jn,aL as Zn,aC as ei,aF as ti,bi as si,bj as _s,bk as Vs,bl as ni,ao as ii,bm as li,bn as xt,bo as Yt,A as Wt,K as ai,bp as ri,bq as oi,g as Ts,m as Kt,n as ci,u as di,r as ui,q as mi,f as Ds,z as Gt,V as fi,B as pi,aJ as hi,ac as xi,au as gi}from"./agent-icon-Bmu0Xuy8.js";import{s as Ie}from"./Plus-D-GSl2MA.js";import{t as lt,a as vi}from"./Tool01-CvAlZ6_R.js";import{s as Tt}from"./Trash01-BzUZQR5Y.js";import{u as qt}from"./use-debounced-autosave-8fEcHiWI.js";import{A as bi}from"./add-connection-dialog-CNB1XZS8.js";import{i as yt}from"./SearchMd-CkV8MM4H.js";import{F as Ht}from"./file-type-icon-C2WSm6EM.js";import{i as ji,h as yi,n as wi,q as Si}from"./use-org-fs-Wo4_O8nn.js";import{I as He}from"./integration-icon-YHEiRLgT.js";import{C as As}from"./checkbox-C2l5tKo2.js";import{S as Ni}from"./search-input-qNQGHbDh.js";import{b as _e,a as Ve,c as je,d as Te,S as De}from"./select-C4iThYr6.js";import{s as Dt}from"./XClose-CXxsMd9c.js";import{C as Ci}from"./collection-tabs-DU5QTifc.js";import{T as Ps,u as Is}from"./use-mcp-auth-status-5SUSMsp-.js";import{u as dt}from"./use-mcp-client-CEKqqblF.js";import{a as Os}from"./use-mcp-tools-_07-mu_D.js";import{u as ki}from"./use-mcp-prompts-CwF-bqUg.js";import{g as Mi}from"./connection-slug-CITJ0kGN.js";import{t as wt}from"./utils-CVEq3hMx.js";import{S as ut}from"./switch-63WSXheM.js";import{a as $s,b as Fs,P as Es}from"./popover-CzNTcDJM.js";import{S as _i}from"./scroll-area-D_ro8hTm.js";import{i as Vi}from"./Upload01-CdgDB-zC.js";import{i as Ti}from"./DotsVertical-DKl8j3BE.js";import{a as Di}from"./Image01-Cf_YxPro.js";import{i as Ai}from"./Monitor01-C-mB2rao.js";import{g as Pi}from"./types-IpdOmnYx.js";import{u as Ii,e as St,r as Nt,a as rt,p as Oi,y as $i,s as Fi,z as Ei,A as zi,l as Ri,B as Li,c as Ui,n as Bi}from"./use-project-native-view-presence-D12oGF6A.js";import{a as Yi}from"./use-panel-navigate-62gIHptt.js";import{a as zs,u as Wi,i as Ki,o as Gi,r as Qt,p as qi,w as Hi,b as Xt}from"./optimistic-project-sidebar-views-2rlAyeqj.js";import{i as Qi}from"./Link01-DNXOSsg9.js";import{i as At}from"./Key01-55Z6tHcr.js";import{a as Xi}from"./format-time-CAj8AQXM.js";import{a as mt}from"./Copy01-TJP2zB12.js";import{u as Ji}from"./use-copy-T3xwaExj.js";import{L as ye}from"./label-CsyEQPG4.js";import{s as Rs,p as Zi,f as el}from"./thread-intent-DikZOwd-.js";import{V as tl,E as ft,r as Ls,C as sl,w as nl}from"./virtual-mcp-UT0zZzHO.js";import{s as Us}from"./slugify-CEUa2lfQ.js";import{b as il,a as ll,D as al}from"./drawer-BpEasqMM.js";import{u as rl}from"./use-mobile-CYsZ0F3X.js";import{d as pt}from"./delay-CnY5UFtP.js";import{R as ol}from"./repository-import-picker-De4qAOck.js";import{b as cl}from"./sandbox-url-D3mC8qhT.js";import{S as dl,a as ul,b as ml}from"./secret-picker-CmVVvqgZ.js";import{u as fl,a as pl}from"./use-secrets-Cmhjz2bf.js";import{o as Jt}from"./omit-sandbox-map-jj4lCB2U.js";import{G as hl}from"./repository-picker-B7BUYgB7.js";import{r as xl}from"./serial-task-queue-CGOeQgpr.js";import{t as Ae,c as Ke,m as gl,a as Bs}from"./differenceInSeconds-C3x8sHUj.js";function Ze(l,e){const n=ct(),s=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Ae(l,e?.in),a=i.getDay(),c=(a<s?7:0)+a-s;return i.setDate(i.getDate()-c),i.setHours(0,0,0,0),i}function ot(l,e){return Ze(l,{...e,weekStartsOn:1})}function Ys(l,e){const n=Ae(l,e?.in),s=n.getFullYear(),i=Ke(n,0);i.setFullYear(s+1,0,4),i.setHours(0,0,0,0);const a=ot(i),c=Ke(n,0);c.setFullYear(s,0,4),c.setHours(0,0,0,0);const r=ot(c);return n.getTime()>=a.getTime()?s+1:n.getTime()>=r.getTime()?s:s-1}function Zt(l,e){const n=Ae(l,e?.in);return n.setHours(0,0,0,0),n}function vl(l,e,n){const[s,i]=In(n?.in,l,e),a=Zt(s),c=Zt(i),r=+a-Ut(a),h=+c-Ut(c);return Math.round((r-h)/gl)}function bl(l,e){const n=Ys(l,e),s=Ke(l,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),ot(s)}function jl(l){return l instanceof Date||typeof l=="object"&&Object.prototype.toString.call(l)==="[object Date]"}function yl(l){return!(!jl(l)&&typeof l!="number"||isNaN(+Ae(l)))}function wl(l,e){const n=Ae(l,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Sl(l,e){const n=Ae(l,e?.in);return vl(n,wl(n))+1}function Nl(l,e){const n=Ae(l,e?.in),s=+ot(n)-+bl(n);return Math.round(s/Bs)+1}function Ws(l,e){const n=Ae(l,e?.in),s=n.getFullYear(),i=ct(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,c=Ke(e?.in||l,0);c.setFullYear(s+1,0,a),c.setHours(0,0,0,0);const r=Ze(c,e),h=Ke(e?.in||l,0);h.setFullYear(s,0,a),h.setHours(0,0,0,0);const o=Ze(h,e);return+n>=+r?s+1:+n>=+o?s:s-1}function Cl(l,e){const n=ct(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Ws(l,e),a=Ke(e?.in||l,0);return a.setFullYear(i,0,s),a.setHours(0,0,0,0),Ze(a,e)}function kl(l,e){const n=Ae(l,e?.in),s=+Ze(n,e)-+Cl(n,e);return Math.round(s/Bs)+1}function ae(l,e){const n=l<0?"-":"",s=Math.abs(l).toString().padStart(e,"0");return n+s}const $e={y(l,e){const n=l.getFullYear(),s=n>0?n:1-n;return ae(e==="yy"?s%100:s,e.length)},M(l,e){const n=l.getMonth();return e==="M"?String(n+1):ae(n+1,2)},d(l,e){return ae(l.getDate(),e.length)},a(l,e){const n=l.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(l,e){return ae(l.getHours()%12||12,e.length)},H(l,e){return ae(l.getHours(),e.length)},m(l,e){return ae(l.getMinutes(),e.length)},s(l,e){return ae(l.getSeconds(),e.length)},S(l,e){const n=e.length,s=l.getMilliseconds(),i=Math.trunc(s*Math.pow(10,n-3));return ae(i,e.length)}},Ye={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},es={G:function(l,e,n){const s=l.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(l,e,n){if(e==="yo"){const s=l.getFullYear(),i=s>0?s:1-s;return n.ordinalNumber(i,{unit:"year"})}return $e.y(l,e)},Y:function(l,e,n,s){const i=Ws(l,s),a=i>0?i:1-i;if(e==="YY"){const c=a%100;return ae(c,2)}return e==="Yo"?n.ordinalNumber(a,{unit:"year"}):ae(a,e.length)},R:function(l,e){const n=Ys(l);return ae(n,e.length)},u:function(l,e){const n=l.getFullYear();return ae(n,e.length)},Q:function(l,e,n){const s=Math.ceil((l.getMonth()+1)/3);switch(e){case"Q":return String(s);case"QQ":return ae(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(l,e,n){const s=Math.ceil((l.getMonth()+1)/3);switch(e){case"q":return String(s);case"qq":return ae(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(l,e,n){const s=l.getMonth();switch(e){case"M":case"MM":return $e.M(l,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(l,e,n){const s=l.getMonth();switch(e){case"L":return String(s+1);case"LL":return ae(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(l,e,n,s){const i=kl(l,s);return e==="wo"?n.ordinalNumber(i,{unit:"week"}):ae(i,e.length)},I:function(l,e,n){const s=Nl(l);return e==="Io"?n.ordinalNumber(s,{unit:"week"}):ae(s,e.length)},d:function(l,e,n){return e==="do"?n.ordinalNumber(l.getDate(),{unit:"date"}):$e.d(l,e)},D:function(l,e,n){const s=Sl(l);return e==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):ae(s,e.length)},E:function(l,e,n){const s=l.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(l,e,n,s){const i=l.getDay(),a=(i-s.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return ae(a,2);case"eo":return n.ordinalNumber(a,{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(l,e,n,s){const i=l.getDay(),a=(i-s.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return ae(a,e.length);case"co":return n.ordinalNumber(a,{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(l,e,n){const s=l.getDay(),i=s===0?7:s;switch(e){case"i":return String(i);case"ii":return ae(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(l,e,n){const i=l.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(l,e,n){const s=l.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(l,e,n){const s=l.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(l,e,n){if(e==="ho"){let s=l.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return $e.h(l,e)},H:function(l,e,n){return e==="Ho"?n.ordinalNumber(l.getHours(),{unit:"hour"}):$e.H(l,e)},K:function(l,e,n){const s=l.getHours()%12;return e==="Ko"?n.ordinalNumber(s,{unit:"hour"}):ae(s,e.length)},k:function(l,e,n){let s=l.getHours();return s===0&&(s=24),e==="ko"?n.ordinalNumber(s,{unit:"hour"}):ae(s,e.length)},m:function(l,e,n){return e==="mo"?n.ordinalNumber(l.getMinutes(),{unit:"minute"}):$e.m(l,e)},s:function(l,e,n){return e==="so"?n.ordinalNumber(l.getSeconds(),{unit:"second"}):$e.s(l,e)},S:function(l,e){return $e.S(l,e)},X:function(l,e,n){const s=l.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return ss(s);case"XXXX":case"XX":return ze(s);default:return ze(s,":")}},x:function(l,e,n){const s=l.getTimezoneOffset();switch(e){case"x":return ss(s);case"xxxx":case"xx":return ze(s);default:return ze(s,":")}},O:function(l,e,n){const s=l.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ts(s,":");default:return"GMT"+ze(s,":")}},z:function(l,e,n){const s=l.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ts(s,":");default:return"GMT"+ze(s,":")}},t:function(l,e,n){const s=Math.trunc(+l/1e3);return ae(s,e.length)},T:function(l,e,n){return ae(+l,e.length)}};function ts(l,e=""){const n=l>0?"-":"+",s=Math.abs(l),i=Math.trunc(s/60),a=s%60;return a===0?n+String(i):n+String(i)+e+ae(a,2)}function ss(l,e){return l%60===0?(l>0?"-":"+")+ae(Math.abs(l)/60,2):ze(l,e)}function ze(l,e=""){const n=l>0?"-":"+",s=Math.abs(l),i=ae(Math.trunc(s/60),2),a=ae(s%60,2);return n+i+e+a}const ns=(l,e)=>{switch(l){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"})}},Ks=(l,e)=>{switch(l){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"})}},Ml=(l,e)=>{const n=l.match(/(P+)(p+)?/)||[],s=n[1],i=n[2];if(!i)return ns(l,e);let a;switch(s){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;default:a=e.dateTime({width:"full"});break}return a.replace("{{date}}",ns(s,e)).replace("{{time}}",Ks(i,e))},_l={p:Ks,P:Ml},Vl=/^D+$/,Tl=/^Y+$/,Dl=["D","DD","YY","YYYY"];function Al(l){return Vl.test(l)}function Pl(l){return Tl.test(l)}function Il(l,e,n){const s=Ol(l,e,n);if(console.warn(s),Dl.includes(l))throw new RangeError(s)}function Ol(l,e,n){const s=l[0]==="Y"?"years":"days of the month";return`Use \`${l.toLowerCase()}\` instead of \`${l}\` (in \`${e}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $l=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Fl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,El=/^'([^]*?)'?$/,zl=/''/g,Rl=/[a-zA-Z]/;function Ll(l,e,n){const s=ct(),i=n?.locale??s.locale??On,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,c=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,r=Ae(l,n?.in);if(!yl(r))throw new RangeError("Invalid time value");let h=e.match(Fl).map(m=>{const f=m[0];if(f==="p"||f==="P"){const u=_l[f];return u(m,i.formatLong)}return m}).join("").match($l).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const f=m[0];if(f==="'")return{isToken:!1,value:Ul(m)};if(es[f])return{isToken:!0,value:m};if(f.match(Rl))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 o={firstWeekContainsDate:a,weekStartsOn:c,locale:i};return h.map(m=>{if(!m.isToken)return m.value;const f=m.value;(!n?.useAdditionalWeekYearTokens&&Pl(f)||!n?.useAdditionalDayOfYearTokens&&Al(f))&&Il(f,e,String(l));const u=es[f[0]];return u(r,f,i.localize,o)}).join("")}function Ul(l){const e=l.match(El);return e?e[1].replace(zl,"'"):l}const Gs=25*1024*1024,gt="home",vt="knowledge";function is(l){return l==null?"":l<1024?`${l} B`:l<1024*1024?`${(l/1024).toFixed(0)} KB`:`${(l/(1024*1024)).toFixed(1)} MB`}function Ee(l){return l.split("/").pop()??l}function Bl(l){const e=q.c(64),{form:n}=l,s=ee(),{upload:i}=ji(gt),a=yi(),c=Q.useRef(null),[r,h]=Q.useState(!1),[o,m]=Q.useState(""),[f,u]=Q.useState(!1);let d;e[0]!==r?(d={enabled:r},e[0]=r,e[1]=d):d=e[1];const{data:p}=wi(60,d),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}=Si(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]=Q.useState(j);let C;e[6]!==n?(C=D=>{S(D),n.setValue("metadata.knowledge",D,{shouldDirty:!0})},e[6]=n,e[7]=C):C=e[7];const k=C;let w;e[8]!==a||e[9]!==v||e[10]!==k||e[11]!==s||e[12]!==i?(w=async D=>{if(!D||D.length===0)return;const Z=Array.from(D),he=Z.filter(Ql),de=Z.filter(Hl);if(de.length>0&&re.warning(s("virtualMcp.filesSection.fileTooLargeTitle"),{description:s("virtualMcp.filesSection.fileTooLargeDescription",{names:de.map(ql).join(", ")})}),he.length!==0){try{await i.mutateAsync({dir:vt,files:he})}catch(ge){const Pe=ge;re.error(Pe instanceof Error?Pe.message:s("virtualMcp.filesSection.failedUploadFile"));return}k([...v,...he.map(ge=>({id:crypto.randomUUID(),name:ge.name,volume:gt,path:`${vt}/${ge.name}`,url:a(gt,`${vt}/${ge.name}`),contentType:ge.type||null,size:ge.size,addedAt:new Date().toISOString()}))])}},e[8]=a,e[9]=v,e[10]=k,e[11]=s,e[12]=i,e[13]=w):w=e[13];const N=w;let M;e[14]!==a||e[15]!==v||e[16]!==k?(M=D=>{v.some(Z=>Z.volume===D.volume&&Z.path===D.path)||(k([...v,{id:crypto.randomUUID(),name:Ee(D.path),volume:D.volume,path:D.path,url:a(D.volume,D.path),contentType:null,size:D.size??null,addedAt:new Date().toISOString()}]),h(!1))},e[14]=a,e[15]=v,e[16]=k,e[17]=M):M=e[17];const T=M;let V;e[18]!==a||e[19]!==v||e[20]!==k?(V=D=>{v.some(Z=>Z.volume===D.volume&&Z.path===D.path)||(k([...v,{id:crypto.randomUUID(),name:Ee(D.path),kind:"skill",volume:D.volume,path:D.path,url:a(D.volume,D.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),h(!1))},e[18]=a,e[19]=v,e[20]=k,e[21]=V):V=e[21];const P=V;let A;e[22]!==v||e[23]!==k?(A=D=>{k(v.filter(Z=>Z.id!==D))},e[22]=v,e[23]=k,e[24]=A):A=e[24];const z=A;let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=D=>{h(D),D&&m("")},e[25]=I):I=e[25];const $=I;let F;e[26]!==v?(F=new Set(v.map(Gl)),e[26]=v,e[27]=F):F=e[27];const K=F,Y=o.toLowerCase();let B;e[28]!==K?(B=D=>!K.has(`${D.volume}/${D.path}`),e[28]=K,e[29]=B):B=e[29];const U=x.filter(Kl).filter(B).filter(D=>Ee(D.path).toLowerCase().includes(Y)).slice(0,5);let _;e[30]!==K?(_=D=>!K.has(`${D.volume}/${D.path}`),e[30]=K,e[31]=_):_=e[31];const E=y.filter(_).filter(D=>Ee(D.path).toLowerCase().includes(Y)).slice(0,5),G=D=>t.jsxs(ps,{open:r,onOpenChange:$,children:[t.jsx(hs,{asChild:!0,children:D}),t.jsxs(xs,{align:"end",className:"w-56",children:[t.jsxs(We,{onSelect:()=>{c.current?.click()},children:[t.jsx(Hn,{size:16}),s("virtualMcp.filesSection.uploadFile")]}),t.jsxs(Et,{children:[t.jsxs(zt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(Qn,{size:16}),s("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(Rt,{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:o,onChange:Z=>m(Z.target.value),onKeyDown:Wl,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(Z=>t.jsxs(We,{onSelect:()=>T(Z),children:[t.jsx(Ht,{filename:Ee(Z.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ee(Z.path)}),Z.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:is(Z.size)})]},`${Z.volume}/${Z.path}`))})]})]}),t.jsxs(Et,{children:[t.jsxs(zt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(lt,{size:16}),s("virtualMcp.filesSection.selectSkill")]}),t.jsxs(Rt,{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:o,onChange:Z=>m(Z.target.value),onKeyDown:Yl,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(Z=>t.jsxs(We,{onSelect:()=>P(Z),children:[t.jsx(lt,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ee(Z.path)})]},`${Z.volume}/${Z.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 W;e[34]!==R?(W=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:R}),e[34]=R,e[35]=W):W=e[35];let X;e[36]!==s?(X=s("virtualMcp.filesSection.description"),e[36]=s,e[37]=X):X=e[37];let ie;e[38]!==X?(ie=t.jsx("p",{className:"text-sm text-muted-foreground",children:X}),e[38]=X,e[39]=ie):ie=e[39];let J;e[40]!==W||e[41]!==ie?(J=t.jsxs("div",{className:"flex flex-col gap-1",children:[W,ie]}),e[40]=W,e[41]=ie,e[42]=J):J=e[42];const oe=v.length>0&&G(t.jsxs(ne,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(et,{size:"xs"}):t.jsx(Ie,{size:14}),s("virtualMcp.filesSection.add")]}));let le;e[43]!==J||e[44]!==oe?(le=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[J,oe]}),e[43]=J,e[44]=oe,e[45]=le):le=e[45];let ce;e[46]!==N?(ce=t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:D=>{N(D.target.files),D.target.value=""}}),e[46]=N,e[47]=ce):ce=e[47];let te,ue;e[48]===Symbol.for("react.memo_cache_sentinel")?(te=D=>{D.preventDefault(),u(!0)},ue=()=>u(!1),e[48]=te,e[49]=ue):(te=e[48],ue=e[49]);let fe;e[50]!==N?(fe=D=>{D.preventDefault(),D.stopPropagation(),u(!1),N(D.dataTransfer.files)},e[50]=N,e[51]=fe):fe=e[51];const pe=f&&"outline outline-2 outline-dashed outline-primary";let me;e[52]!==pe?(me=xe("flex flex-col gap-2 rounded-lg",pe),e[52]=pe,e[53]=me):me=e[53];const O=v.length===0?G(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(Ie,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:s("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):v.map(D=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-card",children:[D.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(lt,{size:16})}):t.jsx(Ht,{filename:D.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:D.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:D.kind==="skill"?s("virtualMcp.filesSection.kindSkill"):D.size!=null?is(D.size):s("virtualMcp.filesSection.kindFile")})]}),t.jsx(ne,{variant:"ghost",size:"icon",onClick:()=>z(D.id),"aria-label":s("virtualMcp.filesSection.removeAriaLabel",{name:D.name}),children:t.jsx(Tt,{size:16})})]},D.id));let se;e[54]!==te||e[55]!==ue||e[56]!==fe||e[57]!==me||e[58]!==O?(se=t.jsx("div",{onDragOver:te,onDragLeave:ue,onDrop:fe,className:me,children:O}),e[54]=te,e[55]=ue,e[56]=fe,e[57]=me,e[58]=O,e[59]=se):se=e[59];let H;return e[60]!==le||e[61]!==ce||e[62]!==se?(H=t.jsxs("section",{className:L,children:[le,ce,se]}),e[60]=le,e[61]=ce,e[62]=se,e[63]=H):H=e[63],H}function Yl(l){return l.stopPropagation()}function Wl(l){return l.stopPropagation()}function Kl(l){return l.kind!=="dir"}function Gl(l){return`${l.volume}/${l.path}`}function ql(l){return l.name}function Hl(l){return l.size>Gs}function Ql(l){return l.size<=Gs}function Xl(l){return l==null?"all":l.length===0?"self":"selected"}function Jl(l){const e=q.c(88),{form:n,currentAgentId:s}=l,i=ee(),{org:a}=Oe(),c=Ns(),[r,h]=Q.useState(!1);let o;e[0]!==n?(o=n.getValues("metadata.subAgents")??null,e[0]=n,e[1]=o):o=e[1];const m=o;let f;e[2]!==m?(f=()=>Xl(m),e[2]=m,e[3]=f):f=e[3];const[u,d]=Q.useState(f);let p;e[4]!==m?(p=m??[],e[4]=m,e[5]=p):p=e[5];const[x,g]=Q.useState(p);let b,y,j,v,S,C;if(e[6]!==c||e[7]!==s||e[8]!==n||e[9]!==u||e[10]!==a||e[11]!==x||e[12]!==i){let M;e[19]!==s||e[20]!==a?(M=te=>te.id!==s&&te.id!==a.id&&te.status==="active",e[19]=s,e[20]=a,e[21]=M):M=e[21],b=c.filter(M);let T;e[22]!==x?(T=te=>x.includes(te.id),e[22]=x,e[23]=T):T=e[23];const V=b.filter(T);let P;e[24]!==n?(P=(te,ue)=>n.setValue("metadata.subAgents",te==="all"?null:te==="self"?[]:ue,{shouldDirty:!0}),e[24]=n,e[25]=P):P=e[25];const A=P;let z;e[26]!==A||e[27]!==x?(z=te=>{d(te),A(te,x)},e[26]=A,e[27]=x,e[28]=z):z=e[28];const I=z;let $;e[29]!==A||e[30]!==x?($=te=>{const ue=x.includes(te)?x.filter(fe=>fe!==te):[...x,te];g(ue),A("selected",ue)},e[29]=A,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 K;e[34]!==F?(K=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:F}),e[34]=F,e[35]=K):K=e[35];let Y;e[36]!==u||e[37]!==i?(Y=u==="all"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canDelegateToAnyAgent")}),e[36]=u,e[37]=i,e[38]=Y):Y=e[38];let B;e[39]!==u||e[40]!==i?(B=u==="self"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canOnlyDelegateToItself")}),e[39]=u,e[40]=i,e[41]=B):B=e[41];let U;e[42]!==K||e[43]!==Y||e[44]!==B?(U=t.jsxs("div",{className:"flex flex-col gap-1",children:[K,Y,B]}),e[42]=K,e[43]=Y,e[44]=B,e[45]=U):U=e[45];const _=u==="selected"&&V.length>0&&t.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>h(!0),children:[t.jsx(Ie,{size:14}),i("virtualMcp.subAgentsSection.addSubAgent")]});let E;e[46]!==I?(E=te=>I(te),e[46]=I,e[47]=E):E=e[47];let G;e[48]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(_e,{size:"sm",className:"w-auto",children:t.jsx(Ve,{})}),e[48]=G):G=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(je,{value:"all",children:L}),e[51]=L,e[52]=R):R=e[52];let W;e[53]!==i?(W=i("virtualMcp.subAgentsSection.specificAgents"),e[53]=i,e[54]=W):W=e[54];let X;e[55]!==W?(X=t.jsx(je,{value:"selected",children:W}),e[55]=W,e[56]=X):X=e[56];let ie;e[57]!==i?(ie=i("virtualMcp.subAgentsSection.onlyItself"),e[57]=i,e[58]=ie):ie=e[58];let J;e[59]!==ie?(J=t.jsx(je,{value:"self",children:ie}),e[59]=ie,e[60]=J):J=e[60];let oe;e[61]!==R||e[62]!==X||e[63]!==J?(oe=t.jsxs(Te,{align:"end",children:[R,X,J]}),e[61]=R,e[62]=X,e[63]=J,e[64]=oe):oe=e[64];let le;e[65]!==u||e[66]!==E||e[67]!==oe?(le=t.jsxs(De,{value:u,onValueChange:E,children:[G,oe]}),e[65]=u,e[66]=E,e[67]=oe,e[68]=le):le=e[68];let ce;e[69]!==_||e[70]!==le?(ce=t.jsxs("div",{className:"flex items-center gap-2",children:[_,le]}),e[69]=_,e[70]=le,e[71]=ce):ce=e[71],e[72]!==U||e[73]!==ce?(C=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[U,ce]}),e[72]=U,e[73]=ce,e[74]=C):C=e[74],j="flex flex-col gap-2",v=u==="selected"&&(V.length>0?V.map(te=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-background",children:[t.jsx(He,{icon:te.icon,name:te.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:te.title}),te.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:te.description})]}),t.jsx(ne,{variant:"ghost",size:"icon",onClick:()=>y(te.id),children:t.jsx(Dt,{size:16})})]},te.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(Ie,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.emptyStateMessage")})]})),e[6]=c,e[7]=s,e[8]=n,e[9]=u,e[10]=a,e[11]=x,e[12]=i,e[13]=b,e[14]=y,e[15]=j,e[16]=v,e[17]=S,e[18]=C}else b=e[13],y=e[14],j=e[15],v=e[16],S=e[17],C=e[18];let k;e[75]!==j||e[76]!==v?(k=t.jsx("div",{className:j,children:v}),e[75]=j,e[76]=v,e[77]=k):k=e[77];let w;e[78]!==b||e[79]!==y||e[80]!==r||e[81]!==x?(w=t.jsx(Zl,{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 N;return e[83]!==S||e[84]!==C||e[85]!==k||e[86]!==w?(N=t.jsxs("section",{className:S,children:[C,k,w]}),e[83]=S,e[84]=C,e[85]=k,e[86]=w,e[87]=N):N=e[87],N}function Zl(l){const e=q.c(39),{open:n,onOpenChange:s,candidates:i,selectedIds:a,onToggle:c}=l,r=ee(),[h,o]=Q.useState("");let m,f,u,d,p,x,g,b,y;if(e[0]!==i||e[1]!==s||e[2]!==c||e[3]!==n||e[4]!==h||e[5]!==a||e[6]!==r){const C=h.toLowerCase(),k=i.filter(M=>M.title.toLowerCase().includes(C)||M.description?.toLowerCase().includes(C));f=Ge,b=n,y=s,m=qe,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(tt,{children:t.jsx(st,{children:w})}),e[18]=w,e[19]=x):x=e[19];let N;e[20]!==r?(N=r("virtualMcp.subAgentsSection.searchPlaceholder"),e[20]=r,e[21]=N):N=e[21],e[22]!==h||e[23]!==N?(g=t.jsx(Ni,{value:h,onChange:o,placeholder:N,className:"w-full"}),e[22]=h,e[23]=N,e[24]=g):g=e[24],u="flex flex-col gap-1 max-h-80 overflow-y-auto",d=k.length===0?t.jsx("p",{className:"text-sm text-muted-foreground px-1 py-4 text-center",children:r("virtualMcp.subAgentsSection.noAgentsFound")}):k.map(M=>t.jsxs("button",{type:"button",onClick:()=>c(M.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(As,{checked:a.includes(M.id),className:"pointer-events-none",tabIndex:-1}),t.jsx(He,{icon:M.icon,name:M.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:M.title}),M.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:M.description})]})]},M.id)),e[0]=i,e[1]=s,e[2]=c,e[3]=n,e[4]=h,e[5]=a,e[6]=r,e[7]=m,e[8]=f,e[9]=u,e[10]=d,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],d=e[10],p=e[11],x=e[12],g=e[13],b=e[14],y=e[15];let j;e[25]!==u||e[26]!==d?(j=t.jsx("div",{className:u,children:d}),e[25]=u,e[26]=d,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 Je(){const l=q.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(et,{className:"size-6 text-muted-foreground"})}),l[0]=e):e=l[0],e}function it(l,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:l})}):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(gs,{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 qs(l){const e=q.c(23),{item:n,isSelected:s,onToggle:i,disabled:a}=l,c=a?"cursor-not-allowed opacity-50":"cursor-pointer",r=s?"bg-accent/25":"hover:bg-muted/50";let h;e[0]!==c||e[1]!==r?(h=xe("flex items-start gap-3 p-4 rounded-lg transition-colors",c,r),e[0]=c,e[1]=r,e[2]=h):h=e[2];let o;e[3]!==n.name?(o=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:n.name}),e[3]=n.name,e[4]=o):o=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]!==o||e[8]!==m?(f=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o,m]}),e[7]=o,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 d;e[12]!==f||e[13]!==u?(d=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[f,u]}),e[12]=f,e[13]=u,e[14]=d):d=e[14];let p;e[15]!==a||e[16]!==s||e[17]!==i?(p=t.jsx(As,{checked:s,onCheckedChange:i,disabled:a,className:"mt-0.5"}),e[15]=a,e[16]=s,e[17]=i,e[18]=p):p=e[18];let x;return e[19]!==h||e[20]!==d||e[21]!==p?(x=t.jsxs("label",{className:h,children:[d,p]}),e[19]=h,e[20]=d,e[21]=p,e[22]=x):x=e[22],x}function ea(l){const e=q.c(35),{activeTab:n,onTabChange:s,showSelectAll:i,isAllSelected:a,handleSelectAll:c}=l,r=ee();let h;e[0]!==r?(h=r("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=r,e[1]=h):h=e[1];let o;e[2]!==h?(o={id:"tools",label:h},e[2]=h,e[3]=o):o=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 d;e[10]!==u?(d={id:"resources",label:u},e[10]=u,e[11]=d):d=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]!==o||e[17]!==f||e[18]!==d||e[19]!==x?(g=[o,f,d,x],e[16]=o,e[17]=f,e[18]=d,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(Ci,{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]!==c||e[28]!==a||e[29]!==i||e[30]!==r?(j=i&&t.jsx("button",{type:"button",onClick:c,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r(a?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=c,e[28]=a,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 Pt(l){const e=q.c(13),{items:n,selections:s,onToggle:i,emptyMessage:a,disabled:c}=l;let r,h,o;if(e[0]!==c||e[1]!==a||e[2]!==n||e[3]!==i||e[4]!==s){o=Symbol.for("react.early_return_sentinel");e:{const f=n.map(ta);if(n.length===0){let u;e[8]!==a?(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:a})}),e[8]=a,e[9]=u):u=e[9],o=u;break e}r="flex-1 overflow-auto px-4 py-3 space-y-1",h=n.map(u=>t.jsx(qs,{item:u,isSelected:s===null||s?.includes(u.id),onToggle:()=>i(u.id,f),disabled:c},u.id))}e[0]=c,e[1]=a,e[2]=n,e[3]=i,e[4]=s,e[5]=r,e[6]=h,e[7]=o}else r=e[5],h=e[6],o=e[7];if(o!==Symbol.for("react.early_return_sentinel"))return o;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 ta(l){return l.id}function sa(l){const e=q.c(22),{connectionId:n,toolSelections:s,onToggleTool:i}=l,a=ee(),{org:c}=Oe();let r;e[0]!==n||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:n,orgId:c.id,orgSlug:c.slug},e[0]=n,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const h=dt(r);let o;e[4]!==h?(o={client:h},e[4]=h,e[5]=o):o=e[5];const{data:m}=Os(o),f=m.tools;let u,d,p;if(e[6]!==m.tools||e[7]!==i||e[8]!==a||e[9]!==s){p=Symbol.for("react.early_return_sentinel");e:{const g=f.map(ia);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(na);if(j.length===0){let v;e[15]!==a?(v=a("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=a,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",d=j.map(v=>t.jsx(qs,{item:v,isSelected:!0,onToggle:()=>i(v.id,g)},v.id))}e[6]=m.tools,e[7]=i,e[8]=a,e[9]=s,e[10]=u,e[11]=d,e[12]=p}else u=e[10],d=e[11],p=e[12];if(p!==Symbol.for("react.early_return_sentinel"))return p;let x;return e[19]!==u||e[20]!==d?(x=t.jsx("div",{className:u,children:d}),e[19]=u,e[20]=d,e[21]=x):x=e[21],x}function na(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(Ps,{annotations:l.annotations,_meta:l._meta})}}function ia(l){return l.name}function la(l){const e=q.c(16),{connectionId:n,selections:s,onToggle:i,disabled:a}=l,{org:c}=Oe();let r;e[0]!==n||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:n,orgId:c.id,orgSlug:c.slug},e[0]=n,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const h=dt(r);let o;e[4]!==h?(o={client:h},e[4]=h,e[5]=o):o=e[5];const{data:m}=Os(o);let f;e[6]!==m.tools?(f=m.tools.map(aa),e[6]=m.tools,e[7]=f):f=e[7];const u=f,d=ee();let p;e[8]!==d?(p=d("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=d,e[9]=p):p=e[9];let x;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==s||e[14]!==p?(x=t.jsx(Pt,{items:u,selections:s,onToggle:i,emptyMessage:p,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=s,e[14]=p,e[15]=x):x=e[15],x}function aa(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(Ps,{annotations:l.annotations,_meta:l._meta})}}function ra(l){const e=q.c(16),{connectionId:n,selections:s,onToggle:i,disabled:a}=l,{org:c}=Oe();let r;e[0]!==n||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:n,orgId:c.id,orgSlug:c.slug},e[0]=n,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const h=dt(r);let o;e[4]!==h?(o={client:h},e[4]=h,e[5]=o):o=e[5];const{data:m}=nn(o);let f;e[6]!==m.resources?(f=m.resources.map(oa),e[6]=m.resources,e[7]=f):f=e[7];const u=f,d=ee();let p;e[8]!==d?(p=d("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=d,e[9]=p):p=e[9];let x;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==s||e[14]!==p?(x=t.jsx(Pt,{items:u,selections:s,onToggle:i,emptyMessage:p,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=s,e[14]=p,e[15]=x):x=e[15],x}function oa(l){return{id:l.name||l.uri,name:l.name||l.uri,description:l.description}}function ca(l){const e=q.c(16),{connectionId:n,selections:s,onToggle:i,disabled:a}=l,{org:c}=Oe();let r;e[0]!==n||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:n,orgId:c.id,orgSlug:c.slug},e[0]=n,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const h=dt(r);let o;e[4]!==h?(o={client:h},e[4]=h,e[5]=o):o=e[5];const{data:m}=ki(o);let f;e[6]!==m.prompts?(f=m.prompts.map(da),e[6]=m.prompts,e[7]=f):f=e[7];const u=f,d=ee();let p;e[8]!==d?(p=d("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=d,e[9]=p):p=e[9];let x;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==s||e[14]!==p?(x=t.jsx(Pt,{items:u,selections:s,onToggle:i,emptyMessage:p,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=s,e[14]=p,e[15]=x):x=e[15],x}function da(l){return{id:l.name,name:l.name,description:l.description}}function ua(l){const e=q.c(58),{currentConnection:n,activeTab:s,selectedId:i,formData:a,toggleTool:c,toggleResource:r,togglePrompt:h,toggleAllTools:o,toggleAllResources:m,toggleAllPrompts:f,onTabChange:u}=l,d=ee(),p=a[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]!==o?(b=()=>{s==="tools"?o(i):s==="resources"?m(i):s==="prompts"&&f(i)},e[0]=s,e[1]=i,e[2]=f,e[3]=m,e[4]=o,e[5]=b):b=e[5];const y=b;let j;e[6]!==n.icon||e[7]!==n.title?(j=t.jsx(He,{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 C;e[13]!==v||e[14]!==S?(C=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,S]}),e[13]=v,e[14]=S,e[15]=C):C=e[15];let k;e[16]!==j||e[17]!==C?(k=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[j,C]})}),e[16]=j,e[17]=C,e[18]=k):k=e[18];let w;e[19]!==s||e[20]!==y||e[21]!==x||e[22]!==u||e[23]!==g?(w=t.jsx(ea,{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 N;e[25]!==s||e[26]!==a||e[27]!==i||e[28]!==d||e[29]!==c?(N=s==="active"&&t.jsx(Le,{fallback:it(d("virtualMcp.dependencySelectionDialog.toolsNotSupported"),d),children:t.jsx(Q.Suspense,{fallback:t.jsx(Je,{}),children:t.jsx(sa,{connectionId:i,toolSelections:a[i]?a[i].tools:[],onToggleTool:(z,I)=>c(i,z,I)})})}),e[25]=s,e[26]=a,e[27]=i,e[28]=d,e[29]=c,e[30]=N):N=e[30];let M;e[31]!==s||e[32]!==a||e[33]!==i||e[34]!==d||e[35]!==c?(M=s==="tools"&&t.jsx(Le,{fallback:it(d("virtualMcp.dependencySelectionDialog.toolsNotSupported"),d),children:t.jsx(Q.Suspense,{fallback:t.jsx(Je,{}),children:t.jsx(la,{connectionId:i,selections:a[i]?a[i].tools:[],onToggle:(z,I)=>c(i,z,I)})})}),e[31]=s,e[32]=a,e[33]=i,e[34]=d,e[35]=c,e[36]=M):M=e[36];let T;e[37]!==s||e[38]!==a||e[39]!==i||e[40]!==d||e[41]!==r?(T=s==="resources"&&t.jsx(Le,{fallback:it(d("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),d),children:t.jsx(Q.Suspense,{fallback:t.jsx(Je,{}),children:t.jsx(ra,{connectionId:i,selections:a[i]?a[i].resources:[],onToggle:(z,I)=>r(i,z,I)})})}),e[37]=s,e[38]=a,e[39]=i,e[40]=d,e[41]=r,e[42]=T):T=e[42];let V;e[43]!==s||e[44]!==a||e[45]!==i||e[46]!==d||e[47]!==h?(V=s==="prompts"&&t.jsx(Le,{fallback:it(d("virtualMcp.dependencySelectionDialog.promptsNotSupported"),d),children:t.jsx(Q.Suspense,{fallback:t.jsx(Je,{}),children:t.jsx(ca,{connectionId:i,selections:a[i]?a[i].prompts:[],onToggle:(z,I)=>h(i,z,I)})})}),e[43]=s,e[44]=a,e[45]=i,e[46]=d,e[47]=h,e[48]=V):V=e[48];let P;e[49]!==T||e[50]!==V||e[51]!==N||e[52]!==M?(P=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[N,M,T,V]}),e[49]=T,e[50]=V,e[51]=N,e[52]=M,e[53]=P):P=e[53];let A;return e[54]!==P||e[55]!==k||e[56]!==w?(A=t.jsxs(t.Fragment,{children:[k,w,P]}),e[54]=P,e[55]=k,e[56]=w,e[57]=A):A=e[57],A}function ma(l){const e=q.c(7),{onClose:n}=l,s=ee();let i;e[0]!==n?(i=()=>n(!1),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==s?(a=s("virtualMcp.dependencySelectionDialog.done"),e[2]=s,e[3]=a):a=e[3];let c;return e[4]!==i||e[5]!==a?(c=t.jsx(Ct,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(ne,{variant:"outline",onClick:i,children:a})}),e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function fa(l){const e=q.c(23),{connectionId:n,onAuthenticate:s,children:i}=l,a=ee();let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const r=Is(c);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(Xn,{size:22,className:"text-muted-foreground"})}),e[2]=m):m=e[2];let f;e[3]!==a?(f=a("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=a,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 d;e[7]!==a?(d=a("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=a,e[8]=d):d=e[8];let p;e[9]!==d?(p=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:d}),e[9]=d,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]!==a?(g=s&&t.jsx(ne,{variant:"outline",size:"sm",onClick:()=>s(n),children:a("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=n,e[15]=s,e[16]=a,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 o;return e[21]!==i?(o=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=o):o=e[22],o}function pa(l){const e={};for(const n of l)e[n.connection_id]={tools:n.selected_tools,resources:n.selected_resources??null,prompts:n.selected_prompts??null};return e}function ls(l){return Object.entries(l).map(([e,n])=>({connection_id:e,selected_tools:n.tools,selected_resources:n.resources,selected_prompts:n.prompts}))}function as(l,e,n,s){const i=l[e]??{tools:null,resources:null,prompts:null};return{...l,[e]:{...i,[n]:s}}}function ha(l,e){return e.type==="SET_ACTIVE_TAB"?{...l,activeTab:e.payload}:l}function xa(l){const e=q.c(49),{open:n,onOpenChange:s,selectedId:i,form:a,connections:c,onAuthenticate:r}=l;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activeTab:"tools"},e[0]=h):h=e[0];const[o,m]=Q.useReducer(ha,h),f=Vt(i??"");let u;e[1]!==c?(u=c??[],e[1]=c,e[2]=u):u=e[2];let d;e[3]!==u?(d=pa(u),e[3]=u,e[4]=d):d=e[4];const p=d;let x;e[5]!==a||e[6]!==p?(x=(U,_,E,G)=>{const L=p[U]?.[_];let R;L===null?R=G.filter(W=>W!==E):L?.includes(E)?R=L.filter(W=>W!==E):(R=[...L??[],E],R.length===G.length&&(R=null)),a.setValue("connections",ls(as(p,U,_,R)),{shouldDirty:!0,shouldTouch:!0})},e[5]=a,e[6]=p,e[7]=x):x=e[7];const g=x;let b;e[8]!==a||e[9]!==p?(b=(U,_)=>{const G=p[U]?.[_]===null?[]:null;a.setValue("connections",ls(as(p,U,_,G)),{shouldDirty:!0,shouldTouch:!0})},e[8]=a,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 C=S;let k;e[15]!==g?(k=(U,_,E)=>g(U,"prompts",_,E),e[15]=g,e[16]=k):k=e[16];const w=k;let N;e[17]!==y?(N=U=>y(U,"tools"),e[17]=y,e[18]=N):N=e[18];const M=N;let T;e[19]!==y?(T=U=>y(U,"resources"),e[19]=y,e[20]=T):T=e[20];const V=T;let P;e[21]!==y?(P=U=>y(U,"prompts"),e[21]=y,e[22]=P):P=e[22];const A=P;if(!i||!f)return null;let z;e[23]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(Je,{}),e[23]=z):z=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=U=>m({type:"SET_ACTIVE_TAB",payload:U}),e[24]=I):I=e[24];let $;e[25]!==f||e[26]!==o.activeTab||e[27]!==p||e[28]!==i||e[29]!==A||e[30]!==V||e[31]!==M||e[32]!==w||e[33]!==C||e[34]!==v?($=t.jsx(ua,{currentConnection:f,activeTab:o.activeTab,selectedId:i,formData:p,toggleTool:v,toggleResource:C,togglePrompt:w,toggleAllTools:M,toggleAllResources:V,toggleAllPrompts:A,onTabChange:I},i),e[25]=f,e[26]=o.activeTab,e[27]=p,e[28]=i,e[29]=A,e[30]=V,e[31]=M,e[32]=w,e[33]=C,e[34]=v,e[35]=$):$=e[35];let F;e[36]!==r||e[37]!==i||e[38]!==$?(F=t.jsx(Q.Suspense,{fallback:z,children:t.jsx(fa,{connectionId:i,onAuthenticate:r,children:$})}),e[36]=r,e[37]=i,e[38]=$,e[39]=F):F=e[39];let K;e[40]!==s?(K=t.jsx(ma,{onClose:s}),e[40]=s,e[41]=K):K=e[41];let Y;e[42]!==F||e[43]!==K?(Y=t.jsxs(qe,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[F,K]}),e[42]=F,e[43]=K,e[44]=Y):Y=e[44];let B;return e[45]!==s||e[46]!==n||e[47]!==Y?(B=t.jsx(Ge,{open:n,onOpenChange:s,children:Y}),e[45]=s,e[46]=n,e[47]=Y,e[48]=B):B=e[48],B}const rs="__new_instance__";function ga(l){const e=q.c(25),{connection_id:n,usedConnectionIds:s,onOpenSettings:i,onRemove:a,onAuthenticate:c,onSwitchInstance:r,onNewInstance:h}=l,o=Vt(n),{org:m}=Oe();if(!o){let g;return e[0]!==a?(g=t.jsx(ya,{onRemove:a}),e[0]=a,e[1]=g):g=e[1],g}let f;e[2]!==o?(f=Mi(o),e[2]=o,e[3]=f):f=e[3];const u=f;let d;e[4]!==n?(d=t.jsx(ja,{connection_id:n}),e[4]=n,e[5]=d):d=e[5];let p;e[6]!==o.app_name||e[7]!==o.connection_type||e[8]!==o.description||e[9]!==o.icon||e[10]!==o.status||e[11]!==o.title||e[12]!==n||e[13]!==c||e[14]!==h||e[15]!==i||e[16]!==a||e[17]!==r||e[18]!==m.slug||e[19]!==u||e[20]!==s?(p=t.jsx(ba,{connection_id:n,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,connectionType:o.connection_type,connectionStatus:o.status,slug:u,orgSlug:m.slug,appName:o.app_name,usedConnectionIds:s,onOpenSettings:i,onRemove:a,onAuthenticate:c,onSwitchInstance:r,onNewInstance:h}),e[6]=o.app_name,e[7]=o.connection_type,e[8]=o.description,e[9]=o.icon,e[10]=o.status,e[11]=o.title,e[12]=n,e[13]=c,e[14]=h,e[15]=i,e[16]=a,e[17]=r,e[18]=m.slug,e[19]=u,e[20]=s,e[21]=p):p=e[21];let x;return e[22]!==d||e[23]!==p?(x=t.jsx(Q.Suspense,{fallback:d,children:p}),e[22]=d,e[23]=p,e[24]=x):x=e[24],x}function va(l){const e=q.c(24),{appName:n,connectionId:s,usedConnectionIds:i,onSwitchInstance:a,onNewInstance:c}=l,r=ee();let h;e[0]!==n?(h={filters:[{column:"app_name",value:n}]},e[0]=n,e[1]=h):h=e[1];const o=Gn(h);if(o.length<=1&&!c)return null;let m;e[2]!==s||e[3]!==c||e[4]!==a?(m=g=>{g===rs?c?.():a(s,g)},e[2]=s,e[3]=c,e[4]=a,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]!==o||e[9]!==i){let g;e[11]!==s||e[12]!==i?(g=b=>t.jsx(je,{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=o.map(g),e[7]=s,e[8]=o,e[9]=i,e[10]=u}else u=e[10];let d;e[14]!==c||e[15]!==r?(d=c&&t.jsxs(je,{value:rs,className:"text-xs text-muted-foreground",children:["+ ",r("virtualMcp.connectionItem.newInstance")]}),e[14]=c,e[15]=r,e[16]=d):d=e[16];let p;e[17]!==u||e[18]!==d?(p=t.jsxs(Te,{children:[u,d]}),e[17]=u,e[18]=d,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 ba({connection_id:l,connectionTitle:e,connectionDescription:n,connectionIcon:s,connectionType:i,connectionStatus:a,slug:c,orgSlug:r,appName:h,usedConnectionIds:o,onOpenSettings:m,onRemove:f,onAuthenticate:u,onSwitchInstance:d,onNewInstance:p}){const x=Is({connectionId:l}),g=Ss(),y=!(i==="VIRTUAL")&&x.supportsOAuth&&!x.isAuthenticated,j=a!=="active",v=ee(),S=async C=>{try{await g.update.mutateAsync({id:l,data:{status:C}}),re.success(v(C==="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(vs,{to:"/$org/settings/connections/$appSlug",params:{org:r,appSlug:c},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors",children:[t.jsx(He,{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(a==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):n&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n})]}),y?t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 text-xs shrink-0",onClick:C=>{C.preventDefault(),C.stopPropagation(),u(l)},children:v("virtualMcp.connectionItem.authorize")}):j?t.jsxs(ne,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:C=>{C.preventDefault(),C.stopPropagation(),S("active")},children:[t.jsx(Jn,{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(vi,{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(va,{appName:h,connectionId:l,usedConnectionIds:o,onSwitchInstance:d,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(ne,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:m,"aria-label":v("virtualMcp.connectionItem.configureResources"),children:t.jsx(Zn,{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(ne,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>S("inactive"),"aria-label":v("virtualMcp.connectionItem.disableConnection"),children:t.jsx(ei,{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(ne,{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(Dt,{size:13})})}),t.jsx(Ne,{side:"bottom",children:v("virtualMcp.connectionItem.remove")})]})]})]})]})}function ja(l){const e=q.c(17),{connection_id:n}=l,s=Vt(n);if(!s){let f;return e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Hs,{}),e[0]=f):f=e[0],f}let i;e[1]!==s.icon||e[2]!==s.title?(i=t.jsx(He,{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 a;e[4]!==s.title?(a=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[4]=s.title,e[5]=a):a=e[5];let c;e[6]!==s.description?(c=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[6]=s.description,e[7]=c):c=e[7];let r;e[8]!==a||e[9]!==c?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,c]}),e[8]=a,e[9]=c,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 o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=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]=o):o=e[14];let m;return e[15]!==h?(m=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[h,o]}),e[15]=h,e[16]=m):m=e[16],m}function ya(l){const e=q.c(20),{onRemove:n}=l,s=ee();let i;e[0]!==s?(i=s("virtualMcp.connectionItem.connectionNotFound"),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==i?(a=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]=a):a=e[3];let c;e[4]!==s?(c=s("virtualMcp.connectionItem.removeConnection"),e[4]=s,e[5]=c):c=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Dt,{size:13}),e[6]=r):r=e[6];let h;e[7]!==n||e[8]!==c?(h=t.jsx(Se,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive shrink-0",onClick:n,"aria-label":c,children:r})}),e[7]=n,e[8]=c,e[9]=h):h=e[9];let o;e[10]!==s?(o=s("virtualMcp.connectionItem.remove"),e[10]=s,e[11]=o):o=e[11];let m;e[12]!==o?(m=t.jsx(Ne,{side:"bottom",children:o}),e[12]=o,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]!==a||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:[a,f]}),e[17]=a,e[18]=f,e[19]=u):u=e[19],u}function Hs(){const l=q.c(3);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),l[0]=e):e=l[0];let n;l[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"})]})]}),l[1]=n):n=l[1];let s;return l[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"})})]}),l[2]=s):s=l[2],s}function Qs(l){const e=q.c(85),{value:n,onChange:s,onColorChange:i,name:a,size:c,className:r,avatarClassName:h,showHoverOverlay:o,disabled:m}=l,f=c===void 0?"lg":c,u=o===void 0?!0:o,d=m===void 0?!1:m,p=ee(),[x,g]=Q.useState(!1),[b,y]=Q.useState("icons"),[j,v]=Q.useState(""),[S,C]=Q.useState("blue");let k;e[0]!==n?(k=ti(n),e[0]=n,e[1]=k):k=e[1];const w=k,N=w.type==="icon"||w.type==="url"&&w.color?w.color:S;let M;e[2]!==s||e[3]!==N?(M=de=>{s(xt(de,N))},e[2]=s,e[3]=N,e[4]=M):M=e[4];const T=M;let V;e[5]!==s||e[6]!==i||e[7]!==w.name||e[8]!==w.type||e[9]!==w.url?(V=de=>{C(de),i?.(de),w.type==="icon"?s(xt(w.name,de)):w.type==="url"&&s(Yt(w.url,de))},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 P=V;let A;e[11]!==s||e[12]!==N?(A=de=>{s(Yt(de,N)),g(!1)},e[11]=s,e[12]=N,e[13]=A):A=e[13];const z=A;let I;e[14]!==s||e[15]!==N?(I=()=>{const de=_s(),ge=de[Math.floor(Math.random()*de.length)];s(xt(ge,N))},e[14]=s,e[15]=N,e[16]=I):I=e[16];const $=I,F=d?!1:x;let K;e[17]!==p?(K=p("common.iconPicker.changeIcon"),e[17]=p,e[18]=K):K=e[18];const Y=d?"cursor-default opacity-50":"cursor-pointer";let B;e[19]!==r||e[20]!==f||e[21]!==Y?(B=xe("relative group overflow-hidden",Y,si(f),r),e[19]=r,e[20]=f,e[21]=Y,e[22]=B):B=e[22];let U;e[23]!==h||e[24]!==a||e[25]!==f||e[26]!==n?(U=t.jsx(Wt,{icon:n,name:a,size:f,className:h}),e[23]=h,e[24]=a,e[25]=f,e[26]=n,e[27]=U):U=e[27];let _;e[28]!==d||e[29]!==u?(_=u&&!d&&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(ai,{size:16,className:"text-white"})}),e[28]=d,e[29]=u,e[30]=_):_=e[30];let E;e[31]!==d||e[32]!==K||e[33]!==B||e[34]!==U||e[35]!==_?(E=t.jsx($s,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":K,disabled:d,className:B,children:[U,_]})}),e[31]=d,e[32]=K,e[33]=B,e[34]=U,e[35]=_,e[36]=E):E=e[36];let G;e[37]!==a||e[38]!==n?(G=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(Wt,{icon:n,name:a,size:"xl"})}),e[37]=a,e[38]=n,e[39]=G):G=e[39];let L;e[40]!==b?(L=de=>{if(de.key!=="ArrowLeft"&&de.key!=="ArrowRight")return;de.preventDefault();const ge=b==="icons"?"upload":"icons";y(ge),document.getElementById(`icon-picker-tab-${ge}`)?.focus()},e[40]=b,e[41]=L):L=e[41];const R=b==="icons",W=b==="icons"?0:-1;let X;e[42]===Symbol.for("react.memo_cache_sentinel")?(X=()=>y("icons"),e[42]=X):X=e[42];const ie=b==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let J;e[43]!==ie?(J=xe("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",ie),e[43]=ie,e[44]=J):J=e[44];let oe;e[45]!==p?(oe=p("common.iconPicker.iconsTab"),e[45]=p,e[46]=oe):oe=e[46];let le;e[47]!==R||e[48]!==W||e[49]!==J||e[50]!==oe?(le=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":R,"aria-controls":"icon-picker-panel-icons",tabIndex:W,onClick:X,className:J,children:oe}),e[47]=R,e[48]=W,e[49]=J,e[50]=oe,e[51]=le):le=e[51];const ce=b==="upload",te=b==="upload"?0:-1;let ue;e[52]===Symbol.for("react.memo_cache_sentinel")?(ue=()=>y("upload"),e[52]=ue):ue=e[52];const fe=b==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let pe;e[53]!==fe?(pe=xe("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",fe),e[53]=fe,e[54]=pe):pe=e[54];let me;e[55]!==p?(me=p("common.iconPicker.uploadTab"),e[55]=p,e[56]=me):me=e[56];let O;e[57]!==ce||e[58]!==te||e[59]!==pe||e[60]!==me?(O=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":ce,"aria-controls":"icon-picker-panel-upload",tabIndex:te,onClick:ue,className:pe,children:me}),e[57]=ce,e[58]=te,e[59]=pe,e[60]=me,e[61]=O):O=e[61];let se;e[62]===Symbol.for("react.memo_cache_sentinel")?(se=t.jsx("div",{className:"flex-1"}),e[62]=se):se=e[62];let H;e[63]!==L||e[64]!==le||e[65]!==O?(H=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:L,children:[le,O,se]}),e[63]=L,e[64]=le,e[65]=O,e[66]=H):H=e[66];let D;e[67]!==P||e[68]!==$||e[69]!==T||e[70]!==z||e[71]!==w.name||e[72]!==w.type||e[73]!==j||e[74]!==N||e[75]!==b?(D=b==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(Ca,{search:j,onSearchChange:v,selectedColor:N,onColorChange:P,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(ka,{onUpload:z})}),e[67]=P,e[68]=$,e[69]=T,e[70]=z,e[71]=w.name,e[72]=w.type,e[73]=j,e[74]=N,e[75]=b,e[76]=D):D=e[76];let Z;e[77]!==G||e[78]!==H||e[79]!==D?(Z=t.jsx(Fs,{align:"start",className:"w-80 p-0",onOpenAutoFocus:wa,children:t.jsxs("div",{className:"flex flex-col",children:[G,H,D]})}),e[77]=G,e[78]=H,e[79]=D,e[80]=Z):Z=e[80];let he;return e[81]!==E||e[82]!==Z||e[83]!==F?(he=t.jsxs(Es,{open:F,onOpenChange:g,children:[E,Z]}),e[81]=E,e[82]=Z,e[83]=F,e[84]=he):he=e[84],he}function wa(l){return l.preventDefault()}function Sa(l){const e=q.c(33),{selectedColor:n,onColorChange:s}=l,i=ee(),[a,c]=Q.useState(!1);let r,h,o,m,f,u,d;if(e[0]!==a||e[1]!==n){const S=Vs(n);h=Es,u=a,d=c,r=$s,f=!0,o="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]=a,e[1]=n,e[2]=r,e[3]=h,e[4]=o,e[5]=m,e[6]=f,e[7]=u,e[8]=d}else r=e[2],h=e[3],o=e[4],m=e[5],f=e[6],u=e[7],d=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]!==o||e[14]!==m||e[15]!==p||e[16]!==x?(g=t.jsx("button",{type:o,className:m,title:p,"aria-label":x}),e[13]=o,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=oi.map(S=>t.jsx("button",{type:"button",onClick:()=>{s(S.name),c(!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(Fs,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:Na,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]!==d||e[31]!==b?(v=t.jsxs(h,{open:u,onOpenChange:d,children:[b,j]}),e[27]=h,e[28]=j,e[29]=u,e[30]=d,e[31]=b,e[32]=v):v=e[32],v}function Na(l){return l.preventDefault()}function Ca(l){const e=q.c(55),{search:n,onSearchChange:s,selectedColor:i,onColorChange:a,onSelectIcon:c,onRandom:r,currentIconName:h}=l,o=ee();let m,f,u,d,p,x,g;if(e[0]!==h||e[1]!==a||e[2]!==r||e[3]!==s||e[4]!==c||e[5]!==n||e[6]!==i||e[7]!==o){const S=_s(),C=Vs(i);f=ni(S,n),x="flex flex-col";let k;e[15]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(yt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=k):k=e[15];let w;e[16]!==s?(w=I=>s(I.target.value),e[16]=s,e[17]=w):w=e[17];let N;e[18]!==o?(N=o("common.iconPicker.filterPlaceholder"),e[18]=o,e[19]=N):N=e[19];let M;e[20]!==n||e[21]!==w||e[22]!==N?(M=t.jsxs("div",{className:"relative flex-1",children:[k,t.jsx(Ce,{value:n,onChange:w,placeholder:N,className:"h-8 text-xs pl-7"})]}),e[20]=n,e[21]=w,e[22]=N,e[23]=M):M=e[23];let T;e[24]!==o?(T=o("common.iconPicker.randomIcon"),e[24]=o,e[25]=T):T=e[25];let V;e[26]!==o?(V=o("common.iconPicker.randomIcon"),e[26]=o,e[27]=V):V=e[27];let P;e[28]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(ri,{size:14,className:"text-muted-foreground"}),e[28]=P):P=e[28];let A;e[29]!==r||e[30]!==T||e[31]!==V?(A=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:P}),e[29]=r,e[30]=T,e[31]=V,e[32]=A):A=e[32];let z;e[33]!==a||e[34]!==i?(z=t.jsx(Sa,{selectedColor:i,onColorChange:a}),e[33]=a,e[34]=i,e[35]=z):z=e[35],e[36]!==A||e[37]!==z||e[38]!==M?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[M,A,z]}),e[36]=A,e[37]=z,e[38]=M,e[39]=g):g=e[39],m=_i,p="h-56",u="grid grid-cols-9 gap-0.5 px-2 pb-2",d=f.map(I=>{const $=ii(I);return $?t.jsx("button",{type:"button",onClick:()=>c(I),className:xe("h-8 w-8 flex items-center justify-center rounded-lg transition-colors cursor-pointer",h===I?xe(C.bg,C.text):xe(C.text,"hover:bg-accent")),title:I,"aria-label":li(I),children:t.jsx($,{size:18})},I):null}),e[0]=h,e[1]=a,e[2]=r,e[3]=s,e[4]=c,e[5]=n,e[6]=i,e[7]=o,e[8]=m,e[9]=f,e[10]=u,e[11]=d,e[12]=p,e[13]=x,e[14]=g}else m=e[8],f=e[9],u=e[10],d=e[11],p=e[12],x=e[13],g=e[14];let b;e[40]!==u||e[41]!==d?(b=t.jsx("div",{className:u,children:d}),e[40]=u,e[41]=d,e[42]=b):b=e[42];let y;e[43]!==f.length||e[44]!==o?(y=f.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:o("common.iconPicker.noIconsFound")}),e[43]=f.length,e[44]=o,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 ka(l){const e=q.c(46),{onUpload:n}=l,s=ee(),i=Q.useRef(null);let a;e[0]!==n||e[1]!==s?(a=A=>{const z=A.target.files?.[0];if(!z)return;if(z.size>2097152){re.error(s("common.iconPicker.imageTooLarge")),A.target.value="";return}const I=new FileReader;I.onerror=()=>{re.error(s("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},I.onloadend=()=>{I.readyState===FileReader.DONE&&I.result&&n(I.result),i.current&&(i.current.value="")},I.readAsDataURL(z)},e[0]=n,e[1]=s,e[2]=a):a=e[2];const c=a,[r,h]=Q.useState("");let o;e[3]!==n||e[4]!==r?(o=()=>{const A=r.trim();A&&(n(A),h(""))},e[3]=n,e[4]=r,e[5]=o):o=e[5];const m=o;let f;e[6]!==c?(f=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:c}),e[6]=c,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 d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Vi,{size:20}),e[9]=d):d=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:[d,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=A=>h(A.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 C;e[24]!==m?(C=A=>{A.key==="Enter"&&(A.preventDefault(),m())},e[24]=m,e[25]=C):C=e[25];let k;e[26]!==r||e[27]!==S||e[28]!==C?(k=t.jsx(Ce,{value:r,onChange:v,placeholder:S,className:"h-8 text-xs flex-1",onKeyDown:C}),e[26]=r,e[27]=S,e[28]=C,e[29]=k):k=e[29];let w;e[30]!==r?(w=r.trim(),e[30]=r,e[31]=w):w=e[31];const N=!w;let M;e[32]!==s?(M=s("common.iconPicker.apply"),e[32]=s,e[33]=M):M=e[33];let T;e[34]!==m||e[35]!==N||e[36]!==M?(T=t.jsx(ne,{variant:"outline",size:"sm",className:"h-8 px-3 text-xs shrink-0",onClick:m,disabled:N,children:M}),e[34]=m,e[35]=N,e[36]=M,e[37]=T):T=e[37];let V;e[38]!==k||e[39]!==T?(V=t.jsxs("div",{className:"flex items-center gap-1.5",children:[k,T]}),e[38]=k,e[39]=T,e[40]=V):V=e[40];let P;return e[41]!==j||e[42]!==V||e[43]!==f||e[44]!==x?(P=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]=P):P=e[45],P}function Ma(l){const e=q.c(11),{viewId:n}=l;if(n==="overview"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ts,{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(Kt,{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(ci,{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(Ai,{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(Di,{size:16}),e[4]=i):i=e[4],i}if(n==="releases"){let i;return e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(di,{size:16}),e[5]=i):i=e[5],i}if(n==="hosting"){let i;return e[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ln,{size:16}),e[6]=i):i=e[6],i}if(n==="e2e"){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ui,{size:16}),e[7]=i):i=e[7],i}if(n==="analytics"){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Kt,{size:16}),e[8]=i):i=e[8],i}if(n==="cdn"){let i;return e[9]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(mi,{size:16}),e[9]=i):i=e[9],i}let s;return e[10]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Ds,{size:16}),e[10]=s):s=e[10],s}function os(l){const e=q.c(51),{pinned:n,canSetMainView:s,onOpen:i,onTogglePin:a,onSetMainView:c}=l,r=ee(),h=n?"text-foreground":"text-muted-foreground/40";let o;e[0]!==h?(o=xe("size-7",h),e[0]=h,e[1]=o):o=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(Gt,{size:16}),e[5]=f):f=e[5];let u;e[6]!==a||e[7]!==n||e[8]!==o||e[9]!==m?(u=t.jsx(Se,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:o,"aria-label":m,"aria-pressed":n,onClick:a,children:f})}),e[6]=a,e[7]=n,e[8]=o,e[9]=m,e[10]=u):u=e[10];let d;e[11]!==n||e[12]!==r?(d=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=n,e[12]=r,e[13]=d):d=e[13];let p;e[14]!==d?(p=t.jsx(Ne,{side:"top",children:d}),e[14]=d,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(Ti,{size:16}),e[21]=b):b=e[21];let y;e[22]!==g?(y=t.jsx(hs,{asChild:!0,children:t.jsx(ne,{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(an,{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(We,{onClick:i,children:[j,v]}),e[27]=i,e[28]=v,e[29]=S):S=e[29];let C;e[30]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Gt,{size:14}),e[30]=C):C=e[30];let k;e[31]!==n||e[32]!==r?(k=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=n,e[32]=r,e[33]=k):k=e[33];let w;e[34]!==a||e[35]!==k?(w=t.jsxs(We,{onClick:a,children:[C,k]}),e[34]=a,e[35]=k,e[36]=w):w=e[36];let N;e[37]!==s||e[38]!==c||e[39]!==r?(N=s&&t.jsxs(We,{onClick:c,children:[t.jsx(Ts,{size:14}),r("virtualMcp.settings.views.setMainView")]}),e[37]=s,e[38]=c,e[39]=r,e[40]=N):N=e[40];let M;e[41]!==S||e[42]!==w||e[43]!==N?(M=t.jsxs(xs,{align:"end",children:[S,w,N]}),e[41]=S,e[42]=w,e[43]=N,e[44]=M):M=e[44];let T;e[45]!==y||e[46]!==M?(T=t.jsxs(ps,{children:[y,M]}),e[45]=y,e[46]=M,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 cs=l=>l.stopPropagation();function _a(l){const e=q.c(8),{icon:n,title:s}=l;let i;e[0]!==n||e[1]!==s?(i=t.jsx(He,{icon:n,name:s,size:"xs",className:"shrink-0"}),e[0]=n,e[1]=s,e[2]=i):i=e[2];let a;e[3]!==s?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:s}),e[3]=s,e[4]=a):a=e[4];let c;return e[5]!==i||e[6]!==a?(c=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,a]}),e[5]=i,e[6]=a,e[7]=c):c=e[7],c}function Va(l){const e=q.c(70),{views:n}=l,s=ee();let i;e[0]!==s?(i=s("virtualMcp.settings.views.defaults"),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==s?(a=s("virtualMcp.layoutTabContent.mainView"),e[2]=s,e[3]=a):a=e[3];let c;e[4]!==s?(c=s("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=s,e[5]=c):c=e[5];const r=n.defaultMainView,h=n.setMainView;let o;e[6]!==s?(o=s("virtualMcp.layoutTabContent.mainView"),e[6]=s,e[7]=o):o=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]!==o||e[13]!==f?(u=t.jsx(_e,{"aria-label":o,className:"w-36 h-8 text-sm shrink-0 @min-xl/project-settings:w-44",children:f}),e[12]=o,e[13]=f,e[14]=u):u=e[14];let d;e[15]!==n.defaultMainOptions?(d=n.defaultMainOptions.map(Ta),e[15]=n.defaultMainOptions,e[16]=d):d=e[16];let p;e[17]!==d?(p=t.jsx(Te,{children:d}),e[17]=d,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]!==a||e[26]!==c?(g=t.jsx(Xe,{title:a,description:c,action:x}),e[24]=x,e[25]=a,e[26]=c,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(ut,{"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 C;e[39]!==s||e[40]!==n.noMainView?(C=n.noMainView&&t.jsx(Ne,{side:"top",children:s("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[39]=s,e[40]=n.noMainView,e[41]=C):C=e[41];let k;e[42]!==S||e[43]!==C?(k=t.jsxs(we,{delayDuration:0,children:[S,C]}),e[42]=S,e[43]=C,e[44]=k):k=e[44];let w;e[45]!==b||e[46]!==y||e[47]!==k?(w=t.jsx(Xe,{title:b,description:y,action:k}),e[45]=b,e[46]=y,e[47]=k,e[48]=w):w=e[48];let N;e[49]!==g||e[50]!==w?(N=t.jsxs(Fe,{children:[g,w]}),e[49]=g,e[50]=w,e[51]=N):N=e[51];let M;e[52]!==i||e[53]!==N?(M=t.jsx(Ue,{title:i,children:N}),e[52]=i,e[53]=N,e[54]=M):M=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(Xe,{icon:t.jsx(Ma,{viewId:$}),title:n.labels[$],onClick:()=>n.openView($),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(os,{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(Lt,{size:16})})]})},$)}),e[57]=n,e[58]=V):V=e[58];let P;e[59]!==n?(P=n.connectionsData.flatMap($=>[t.jsx(_a,{icon:$.icon,title:$.title},`${$.id}:header`),...$.uiTools.map(F=>{const K=n.pinnedAppViews.find(_=>_.connectionId===$.id&&_.toolName===F.name),Y=!!K,B=rn($.id,F.name),U=`ext-apps:${$.id}:${F.name}`;return t.jsx(Xe,{onClick:()=>n.openView(B),icon:Y?t.jsx("span",{onClick:cs,children:t.jsx(Qs,{value:K.icon??null,name:K.label||F.name,size:"xs",showHoverOverlay:!1,onChange:_=>n.setAppViewIcon($.id,F.name,_)})}):t.jsx(Ds,{size:16}),title:Y?t.jsx("span",{onClick:cs,children:t.jsx(Ce,{value:K.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(os,{pinned:Y,canSetMainView:Y&&!n.isMainView(U),onOpen:()=>n.openView(B),onTogglePin:()=>n.toggleAppViewPin($.id,F.name),onSetMainView:()=>n.setMainView(U)}),t.jsx("span",{onClick:()=>n.openView(B),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Lt,{size:16})})]})},`${$.id}:${F.name}`)})]),e[59]=n,e[60]=P):P=e[60];let A;e[61]!==V||e[62]!==P?(A=t.jsxs(Fe,{children:[V,P]}),e[61]=V,e[62]=P,e[63]=A):A=e[63];let z;e[64]!==T||e[65]!==A?(z=t.jsx(Ue,{title:T,children:A}),e[64]=T,e[65]=A,e[66]=z):z=e[66];let I;return e[67]!==M||e[68]!==z?(I=t.jsxs(t.Fragment,{children:[M,z]}),e[67]=M,e[68]=z,e[69]=I):I=e[69],I}function Ta(l){return t.jsx(je,{value:l.value,children:l.label},l.value)}const Xs="site-editor",Da=new Set([Xs,"content"]);function Aa({virtualMcpId:l,form:e,flushAndSave:n}){const s=ee(),i=kt(),{openPanel:a}=Yi(),c=Cs(l),r=Ii(c),h=zs(l),o=Wi(l),m=(c?.connections??[]).map(_=>_.connection_id).sort(),{data:f}=bs({queryKey:Mt.projectConnectionDetails(l,m),enabled:m.length>0,queryFn:async()=>await Promise.all(m.map(async E=>{try{const{item:G}=await i.call("COLLECTION_CONNECTIONS_GET",{id:E}),L=(G?.tools??[]).flatMap(R=>{const W=Pi(R._meta);return W?[{name:R.name,title:R.title,description:R.description,resourceUri:W}]:[]});return{fetchOk:!0,id:E,title:G?.title??E,icon:G?.icon??null,uiTools:L}}catch{return{fetchOk:!1,id:E,title:E,icon:null,uiTools:[]}}}))}),u=(f??[]).filter(_=>_.uiTools.length>0),d=new Set([...on,...cn]),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=o??(c?St(Nt(c.metadata),c.metadata.sidebarViewsVersion):y),v=(()=>{if(!g||g.type==="chat")return"";const _=dn(g.type);return _==="instructions"||_==="connections"||_==="layout"?"settings":Da.has(_)?Xs:d.has(_)?_:`${_}:${g.id??""}:${g.toolName??""}`})(),S=v==="",C=_=>{const[E,G,L]=_.split(":");return E?d.has(E)?{type:E}:E==="ext-apps"&&G?{type:"ext-apps",id:G,toolName:L||void 0}:null:null},k=_=>{e.setValue("metadata.ui.pinnedViews",_,{shouldDirty:!0})},w=_=>{e.setValue("metadata.ui.layout",{...x,..._},{shouldDirty:!0})},N=Q.useRef(!1);if(f&&f.length>0&&!N.current){N.current=!0;const _=new Set((f??[]).filter(R=>R.fetchOk).map(R=>R.id)),E=new Set(u.flatMap(R=>R.uiTools.map(W=>`${R.id}:${W.name}`))),G=new Set(m),L=p.filter(R=>G.has(R.connectionId)&&(!_.has(R.connectionId)||E.has(`${R.connectionId}:${R.toolName}`)));L.length!==p.length&&(k(L),g?.type==="ext-apps"&&!L.some(R=>R.connectionId===g.id&&R.toolName===g.toolName)&&w({defaultMainView:{type:"settings"}}))}const M=(_,E)=>{if(p.some(L=>L.connectionId===_&&L.toolName===E)){const L=p.filter(W=>!(W.connectionId===_&&W.toolName===E));k(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;k([...p,{connectionId:_,toolName:E,label:L??wt(E),icon:null}])}n()},T=(_,E,G)=>{k(p.map(L=>L.connectionId===_&&L.toolName===E?{...L,label:G}:L))},V=()=>{n()},P=(_,E,G)=>{k(p.map(L=>L.connectionId===_&&L.toolName===E?{...L,icon:G}:L)),n()},A=_=>{w({defaultMainView:C(_)}),n()},z=(_,E)=>{const G=Ei(j,_,E,1);e.setValue("metadata.sidebarViews",G,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),h.stage(G,j);const L=zi(g,_,E);L!==g&&w({defaultMainView:L})},I=rt(c?.metadata),$=Oi(I,r.presence),F=$i($),K=Fi(j,$,1),Y={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"),releases:s("common.mainPanelTabs.releases"),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")},B=[];for(const _ of K)_!=="automations"&&B.push({value:_,label:Y[_]});for(const _ of p)B.push({value:`ext-apps:${_.connectionId}:${_.toolName}`,label:_.label||_.toolName});return K.includes("automations")&&B.push({value:"automations",label:Y.automations}),B.push({value:"settings",label:s("virtualMcp.layoutTabContent.settings")}),{projectViews:F,labels:Y,pinned:_=>j.includes(_),isMainView:_=>v===_,defaultMainView:v,defaultMainOptions:B,noMainView:S,chatDefaultOpen:b,connectionsData:u,pinnedAppViews:p,openView:_=>a(_,{virtualmcpid:l}),togglePin:(_,E)=>z(_,E),setMainView:A,setChatDefaultOpen:_=>{w({chatDefaultOpen:_}),n()},toggleAppViewPin:M,setAppViewIcon:P,setAppViewLabel:T,commitAppViewLabel:V}}function Pa(l){const e=q.c(55),{form:n,onCommit:s}=l,i=ee(),a=Q.useId();let c;e[0]!==i?(c=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==c?(r=t.jsx("p",{className:"text-sm font-medium",children:c}),e[2]=c,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 o;e[6]!==h?(o=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:h}),e[6]=h,e[7]=o):o=e[7];let m;e[8]!==r||e[9]!==o?(m=t.jsxs("div",{children:[r,o]}),e[8]=r,e[9]=o,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(Qs,{value:V.value??null,onChange:P=>{V.onChange(P),s()},onColorChange:P=>{n.setValue("metadata.ui.themeColor",P,{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(ve,{name:"icon",control:n.control,render:f}),e[15]=n.control,e[16]=f,e[17]=u):u=e[17];let d;e[18]!==m||e[19]!==u?(d=t.jsxs(be,{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]=d):d=e[20];const p=`${a}-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]!==a||e[27]!==s||e[28]!==i?(b=T=>{const{field:V}=T;return t.jsx(Ce,{...V,id:`${a}-name`,value:V.value??"",onBlur:()=>{V.onBlur(),s()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=a,e[27]=s,e[28]=i,e[29]=b):b=e[29];let y;e[30]!==n.control||e[31]!==b?(y=t.jsx(ve,{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(be,{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=`${a}-description`;let S;e[36]!==i?(S=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=S):S=e[37];let C;e[38]!==v||e[39]!==S?(C=t.jsx("label",{htmlFor:v,className:"text-sm font-medium",children:S}),e[38]=v,e[39]=S,e[40]=C):C=e[40];let k;e[41]!==a||e[42]!==s||e[43]!==i?(k=T=>{const{field:V}=T;return t.jsx(at,{...V,id:`${a}-description`,value:V.value??"",onBlur:()=>{V.onBlur(),s()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=a,e[42]=s,e[43]=i,e[44]=k):k=e[44];let w;e[45]!==n.control||e[46]!==k?(w=t.jsx(ve,{name:"description",control:n.control,render:k}),e[45]=n.control,e[46]=k,e[47]=w):w=e[47];let N;e[48]!==C||e[49]!==w?(N=t.jsxs(be,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[C,w]}),e[48]=C,e[49]=w,e[50]=N):N=e[50];let M;return e[51]!==j||e[52]!==N||e[53]!==d?(M=t.jsxs(Fe,{children:[d,j,N]}),e[51]=j,e[52]=N,e[53]=d,e[54]=M):M=e[54],M}const Js=["general","connections","site"],Ia={general:{icon:pi,titleKey:"virtualMcp.settings.general.title",descriptionKey:"virtualMcp.settings.general.description"},connections:{icon:Qi,titleKey:"virtualMcp.settings.connections.title",descriptionKey:"virtualMcp.settings.connections.description"},site:{icon:fi,titleKey:"virtualMcp.settings.site.title",descriptionKey:"virtualMcp.settings.site.description"}};function Oa(l){return!!l&&Js.includes(l)}function $a(l){const e=q.c(8),{section:n}=l,s=ee();let i;e[0]!==s?(i=s("virtualMcp.settings.navigation"),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n||e[3]!==s?(a=Js.map(r=>{const{titleKey:h}=Ia[r];return t.jsx(Re.Tab,{active:n===r,asChild:!0,children:t.jsx(vs,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:o=>({...o,section:r==="general"?void 0:r}),children:s(h)})},r)}),e[2]=n,e[3]=s,e[4]=a):a=e[4];let c;if(e[5]!==i||e[6]!==a){const r=t.jsx(Re.Tabs,{"aria-label":i,children:a});c=t.jsx(un.Toolbar.Left.Portal,{fallback:r,children:r}),e[5]=i,e[6]=a,e[7]=c}else c=e[7];return c}function Fa(){const l=q.c(8),e=_t();let n;l[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},l[0]=n):n=l[0];const{section:s}=mn(n);let i;l[1]!==s?(i=Oa(s)?s:"general",l[1]=s,l[2]=i):i=l[2];let a;l[3]!==e?(a=r=>e({to:".",search:h=>({...h,section:r??void 0})}),l[3]=e,l[4]=a):a=l[4];let c;return l[5]!==i||l[6]!==a?(c={section:i,openSection:a},l[5]=i,l[6]=a,l[7]=c):c=l[7],c}function Zs(l){const e=q.c(20),{value:n,label:s,copiedLabel:i,variant:a,size:c,className:r,copiedClassName:h}=l,o=a===void 0?"ghost":a,m=c===void 0?"icon-sm":c,{handleCopy:f,copied:u}=Ji();let d;e[0]!==f||e[1]!==n?(d=()=>{f(n).catch(Ea)},e[0]=f,e[1]=n,e[2]=d):d=e[2];const p=u&&h;let x;e[3]!==r||e[4]!==p?(x=xe(r,p),e[3]=r,e[4]=p,e[5]=x):x=e[5];let g;e[6]!==u?(g=u?t.jsx(nt,{className:"text-success"}):t.jsx(mt,{}),e[6]=u,e[7]=g):g=e[7];let b;e[8]!==s||e[9]!==m||e[10]!==d||e[11]!==x||e[12]!==g||e[13]!==o?(b=t.jsx(ne,{type:"button",variant:o,size:m,"aria-label":s,onClick:d,className:x,children:g}),e[8]=s,e[9]=m,e[10]=d,e[11]=x,e[12]=g,e[13]=o,e[14]=b):b=e[14];const y=u?i:"";let j;e[15]!==y?(j=t.jsx("span",{className:"sr-only","aria-live":"polite",children:y}),e[15]=y,e[16]=j):j=e[16];let v;return e[17]!==b||e[18]!==j?(v=t.jsxs(t.Fragment,{children:[b,j]}),e[17]=b,e[18]=j,e[19]=v):v=e[19],v}function Ea(){}function za(l){const e=q.c(14),{id:n,value:s,copyLabel:i,copiedLabel:a,className:c}=l;let r;e[0]!==c?(r=xe("relative h-fit",c),e[0]=c,e[1]=r):r=e[1];let h;e[2]!==n||e[3]!==s?(h=t.jsx(Ce,{id:n,value:s,readOnly:!0,disabled:!0,className:"pr-10 font-mono"}),e[2]=n,e[3]=s,e[4]=h):h=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=xe("absolute top-1/2 right-1 -translate-y-1/2 transition-opacity","opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100 pointer-coarse:opacity-100"),e[5]=o):o=e[5];let m;e[6]!==a||e[7]!==i||e[8]!==s?(m=t.jsx(Zs,{value:s,label:i,copiedLabel:a,className:o,copiedClassName:"opacity-100"}),e[6]=a,e[7]=i,e[8]=s,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==h||e[12]!==m?(f=t.jsxs("div",{className:r,children:[h,m]}),e[10]=r,e[11]=h,e[12]=m,e[13]=f):f=e[13],f}async function ds(l){const e=await l.json().catch(()=>({}));if(!l.ok)throw new Error(e.error??`HTTP ${l.status}`);return e}function Ra(l){const e=q.c(106),{orgSlug:n,virtualMcpId:s}=l,i=ee(),a=js(),c=`/api/${n}/hosted/${encodeURIComponent(s)}/site-tokens`;let r;e[0]!==n||e[1]!==s?(r=Mt.hostedSiteTokens(n,s),e[0]=n,e[1]=s,e[2]=r):r=e[2];const h=r,[o,m]=Q.useState(null),f=Q.useId();let u;e[3]!==c?(u=async()=>ds(await fetch(c)),e[3]=c,e[4]=u):u=e[4];let d;e[5]!==h||e[6]!==u?(d={queryKey:h,queryFn:u},e[5]=h,e[6]=u,e[7]=d):d=e[7];const p=bs(d);let x;e[8]!==c?(x=async()=>ds(await fetch(c,{method:"POST"})),e[8]=c,e[9]=x):x=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=H=>{const{token:D}=H;return m(D)},e[10]=g):g=e[10];let b;e[11]!==h||e[12]!==a?(b=()=>a.invalidateQueries({queryKey:h}),e[11]=h,e[12]=a,e[13]=b):b=e[13];let y;e[14]!==x||e[15]!==b?(y={mutationFn:x,onSuccess:g,onError:La,onSettled:b},e[14]=x,e[15]=b,e[16]=y):y=e[16];const j=fn(y);let v;e[17]!==p.data?.tokens?(v=p.data?.tokens??[],e[17]=p.data?.tokens,e[18]=v):v=e[18];const S=v,C=p.data?.site;let k;e[19]!==i?(k=i("siteTokens.title"),e[19]=i,e[20]=k):k=e[20];let w;e[21]!==i?(w=i("siteTokens.description"),e[21]=i,e[22]=w):w=e[22];let N;e[23]!==i?(N=i("siteTokens.siteId"),e[23]=i,e[24]=N):N=e[24];let M;e[25]!==f||e[26]!==N?(M=t.jsx("label",{htmlFor:f,className:"text-sm font-medium",children:N}),e[25]=f,e[26]=N,e[27]=M):M=e[27];let T;e[28]!==i?(T=i("siteTokens.siteIdDescription"),e[28]=i,e[29]=T):T=e[29];let V;e[30]!==T?(V=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:T}),e[30]=T,e[31]=V):V=e[31];let P;e[32]!==C||e[33]!==f||e[34]!==i?(P=C?t.jsx(za,{id:f,value:C,copyLabel:i("siteTokens.copySiteId"),copiedLabel:i("siteTokens.siteIdCopied"),className:"min-w-0 flex-1"}):t.jsx("p",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:"—"}),e[32]=C,e[33]=f,e[34]=i,e[35]=P):P=e[35];const A=!p.data||j.isPending;let z;e[36]!==j?(z=()=>j.mutate(),e[36]=j,e[37]=z):z=e[37];let I;e[38]!==j.isPending?(I=j.isPending?t.jsx(et,{className:"size-3.5"}):t.jsx(Ie,{size:14}),e[38]=j.isPending,e[39]=I):I=e[39];let $;e[40]!==i?($=i("siteTokens.issue"),e[40]=i,e[41]=$):$=e[41];let F;e[42]!==A||e[43]!==z||e[44]!==I||e[45]!==$?(F=t.jsxs(ne,{type:"button",size:"sm",className:"shrink-0",disabled:A,onClick:z,children:[I,$]}),e[42]=A,e[43]=z,e[44]=I,e[45]=$,e[46]=F):F=e[46];let K;e[47]!==P||e[48]!==F?(K=t.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[P,F]}),e[47]=P,e[48]=F,e[49]=K):K=e[49];let Y;e[50]!==M||e[51]!==V||e[52]!==K?(Y=t.jsxs(be,{className:"group",children:[M,V,K]}),e[50]=M,e[51]=V,e[52]=K,e[53]=Y):Y=e[53];let B;e[54]!==p.error||e[55]!==p.isError?(B=p.isError?t.jsx(be,{children:t.jsx("p",{className:"text-xs text-destructive",children:p.error.message})}):null,e[54]=p.error,e[55]=p.isError,e[56]=B):B=e[56];let U;if(e[57]!==i||e[58]!==S){let H;e[60]!==i?(H=D=>t.jsx(be,{children:t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsx(At,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate font-mono text-xs",children:D.kid}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("siteTokens.issuedAgo",{when:Xi(new Date(D.iat*1e3))})})]})]})},D.kid),e[60]=i,e[61]=H):H=e[61],U=S.map(H),e[57]=i,e[58]=S,e[59]=U}else U=e[59];let _;e[62]!==Y||e[63]!==B||e[64]!==U?(_=t.jsxs(Fe,{children:[Y,B,U]}),e[62]=Y,e[63]=B,e[64]=U,e[65]=_):_=e[65];const E=o!==null;let G;e[66]===Symbol.for("react.memo_cache_sentinel")?(G=H=>!H&&m(null),e[66]=G):G=e[66];let L;e[67]!==i?(L=i("siteTokens.createdTitle"),e[67]=i,e[68]=L):L=e[68];let R;e[69]!==L?(R=t.jsx(st,{children:L}),e[69]=L,e[70]=R):R=e[70];let W;e[71]!==i?(W=i("siteTokens.createdDescription"),e[71]=i,e[72]=W):W=e[72];let X;e[73]!==W?(X=t.jsx(ys,{children:W}),e[73]=W,e[74]=X):X=e[74];let ie;e[75]!==R||e[76]!==X?(ie=t.jsxs(tt,{children:[R,X]}),e[75]=R,e[76]=X,e[77]=ie):ie=e[77];let J;e[78]!==i?(J=i("siteTokens.createdTitle"),e[78]=i,e[79]=J):J=e[79];const oe=o??"";let le;e[80]!==J||e[81]!==oe?(le=t.jsx(Ce,{readOnly:!0,"aria-label":J,value:oe,className:"font-mono text-xs"}),e[80]=J,e[81]=oe,e[82]=le):le=e[82];let ce;e[83]!==o||e[84]!==i?(ce=o?t.jsx(Zs,{value:o,label:i("siteTokens.copy"),copiedLabel:i("siteTokens.copied"),variant:"outline",size:"icon",className:"shrink-0"}):null,e[83]=o,e[84]=i,e[85]=ce):ce=e[85];let te;e[86]!==le||e[87]!==ce?(te=t.jsxs("div",{className:"flex items-center gap-2",children:[le,ce]}),e[86]=le,e[87]=ce,e[88]=te):te=e[88];let ue;e[89]===Symbol.for("react.memo_cache_sentinel")?(ue=()=>m(null),e[89]=ue):ue=e[89];let fe;e[90]!==i?(fe=i("siteTokens.done"),e[90]=i,e[91]=fe):fe=e[91];let pe;e[92]!==fe?(pe=t.jsx(Ct,{children:t.jsx(ne,{onClick:ue,children:fe})}),e[92]=fe,e[93]=pe):pe=e[93];let me;e[94]!==ie||e[95]!==te||e[96]!==pe?(me=t.jsxs(qe,{className:"sm:max-w-lg",children:[ie,te,pe]}),e[94]=ie,e[95]=te,e[96]=pe,e[97]=me):me=e[97];let O;e[98]!==E||e[99]!==me?(O=t.jsx(Ge,{open:E,onOpenChange:G,children:me}),e[98]=E,e[99]=me,e[100]=O):O=e[100];let se;return e[101]!==w||e[102]!==_||e[103]!==O||e[104]!==k?(se=t.jsxs(Ue,{title:k,description:w,children:[_,O]}),e[101]=w,e[102]=_,e[103]=O,e[104]=k,e[105]=se):se=e[105],se}function La(l){return re.error(l.message)}function Ua(l){const e=q.c(8),{control:n,previewServerUrl:s}=l,i=ee();let a;e[0]!==s?(a=Rs(s),e[0]=s,e[1]=a):a=e[1];const c=!!a;let r;e[2]!==c||e[3]!==i?(r=o=>{const{field:m}=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(ye,{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(c?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(ut,{id:"fast-preview",className:"shrink-0",checked:!!m.value&&c,disabled:!c,onCheckedChange:f=>m.onChange(f)})]})},e[2]=c,e[3]=i,e[4]=r):r=e[4];let h;return e[5]!==n||e[6]!==r?(h=t.jsx(ve,{control:n,name:"metadata.fastPreview",render:r}),e[5]=n,e[6]=r,e[7]=h):h=e[7],h}function Ba(l){const e=q.c(5),{control:n,fastPreview:s}=l,i=ee();if(!s)return null;let a;e[0]!==i?(a=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(ye,{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(ut,{id:"fast-preview-in-place",className:"shrink-0",checked:!!h.value,onCheckedChange:o=>h.onChange(o)})]})},e[0]=i,e[1]=a):a=e[1];let c;return e[2]!==n||e[3]!==a?(c=t.jsx(ve,{control:n,name:"metadata.fastPreviewInPlace",render:a}),e[2]=n,e[3]=a,e[4]=c):c=e[4],c}function Ya(l){const e=q.c(18),{control:n,isBlocksV8:s}=l,i=s===void 0?!1:s,a=ee();let c;e[0]!==a?(c=a("sandbox.previewServerUrlField.label"),e[0]=a,e[1]=c):c=e[1];let r;e[2]!==c?(r=t.jsx(ye,{htmlFor:"preview-server-url",children:c}),e[2]=c,e[3]=r):r=e[3];let h;e[4]!==a?(h=p=>{const{field:x}=p,g=x.value??"";return t.jsx(Ce,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:a("sandbox.previewServerUrlField.placeholder"),value:g,onChange:b=>x.onChange(b.target.value===""?null:b.target.value),onBlur:()=>{x.onChange(Zi(g)),x.onBlur()}})},e[4]=a,e[5]=h):h=e[5];let o;e[6]!==n||e[7]!==h?(o=t.jsx(ve,{control:n,name:"metadata.previewServerUrl",render:h}),e[6]=n,e[7]=h,e[8]=o):o=e[8];const m=i?"sandbox.previewServerUrlField.descriptionBlocksV8":"sandbox.previewServerUrlField.description";let f;e[9]!==a||e[10]!==m?(f=a(m),e[9]=a,e[10]=m,e[11]=f):f=e[11];let u;e[12]!==f?(u=t.jsx("p",{className:"text-xs text-muted-foreground",children:f}),e[12]=f,e[13]=u):u=e[13];let d;return e[14]!==r||e[15]!==o||e[16]!==u?(d=t.jsxs("div",{className:"space-y-2",children:[r,o,u]}),e[14]=r,e[15]=o,e[16]=u,e[17]=d):d=e[17],d}function Wa(l){const e=q.c(15),{control:n,isBlocksV8:s,previewServerUrl:i,fastPreview:a}=l,c=ee(),r=s||!!a;let h;e[0]!==n||e[1]!==s?(h=t.jsx(be,{children:t.jsx(Ya,{control:n,isBlocksV8:s})}),e[0]=n,e[1]=s,e[2]=h):h=e[2];let o;e[3]!==n||e[4]!==s||e[5]!==i||e[6]!==c?(o=s?!Rs(i)&&t.jsx(be,{children:t.jsx("p",{className:"text-xs text-muted-foreground",children:c("sandbox.cmsSettings.blocksV8.needsPreviewServerUrl")})}):t.jsx(be,{children:t.jsx(Ua,{control:n,previewServerUrl:i})}),e[3]=n,e[4]=s,e[5]=i,e[6]=c,e[7]=o):o=e[7];let m;e[8]!==n||e[9]!==r?(m=r&&t.jsx(be,{children:t.jsx(Ba,{control:n,fastPreview:r})}),e[8]=n,e[9]=r,e[10]=m):m=e[10];let f;return e[11]!==h||e[12]!==o||e[13]!==m?(f=t.jsxs(t.Fragment,{children:[h,o,m]}),e[11]=h,e[12]=o,e[13]=m,e[14]=f):f=e[14],f}const bt={tools:null,resources:null,prompts:null},Ka=tl.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function Ga(l){const n=new TextEncoder().encode(l),s=Array.from(n,i=>String.fromCharCode(i)).join("");return btoa(s)}function en(l){return{"x-studio-client":l,"x-mesh-client":l}}function qa(l){const e=q.c(15),{url:n,agentId:s}=l,i=ee(),[a,c]=Q.useState(!1);let r;e[0]!==s||e[1]!==i||e[2]!==n?(r=async()=>{ke("agent_connect_action",{agent_id:s,action:"copy_url"}),await navigator.clipboard.writeText(n),c(!0),re.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await pt(2e3),c(!1)},e[0]=s,e[1]=i,e[2]=n,e[3]=r):r=e[3];const h=r;let o;e[4]!==a?(o=a?t.jsx(nt,{size:20,className:"text-success"}):t.jsx(mt,{size:20}),e[4]=a,e[5]=o):o=e[5];let m;e[6]!==a||e[7]!==i?(m=i(a?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=a,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]!==o||e[13]!==f?(u=t.jsxs(ne,{type:"button",variant:"outline",onClick:h,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[o,f]}),e[11]=h,e[12]=o,e[13]=f,e[14]=u):u=e[14],u}function Ha(l){const e=q.c(13),{url:n,serverName:s,agentId:i}=l,a=ee();let c;e[0]!==i||e[1]!==s||e[2]!==a||e[3]!==n?(c=()=>{ke("agent_connect_action",{agent_id:i,action:"install_cursor"});const u=Us(s),d={type:"http",url:n,headers:en("Cursor")},p=Ga(JSON.stringify(d,null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(u)}&config=${encodeURIComponent(p)}`;window.open(x,"_blank"),re.success(a("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=s,e[2]=a,e[3]=n,e[4]=c):c=e[4];const r=c;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 o;e[6]!==a?(o=a("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=a,e[7]=o):o=e[7];let m;e[8]!==o?(m=t.jsx("span",{className:"text-xs font-medium",children:o}),e[8]=o,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m?(f=t.jsxs(ne,{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 Qa(l){const e=q.c(16),{url:n,serverName:s,agentId:i}=l,a=ee(),[c,r]=Q.useState(!1);let h;e[0]!==i||e[1]!==s||e[2]!==a||e[3]!==n?(h=async()=>{ke("agent_connect_action",{agent_id:i,action:"install_claude_code"});const p=Us(s),x={type:"http",url:n,headers:en("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(a("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await pt(2e3),r(!1)},e[0]=i,e[1]=s,e[2]=a,e[3]=n,e[4]=h):h=e[4];const o=h;let m;e[5]!==c?(m=c?t.jsx(nt,{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]=c,e[6]=m):m=e[6];let f;e[7]!==c||e[8]!==a?(f=a(c?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=c,e[8]=a,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 d;return e[12]!==o||e[13]!==m||e[14]!==u?(d=t.jsxs(ne,{type:"button",variant:"outline",onClick:o,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[m,u]}),e[12]=o,e[13]=m,e[14]=u,e[15]=d):d=e[15],d}const Xa=720*60*60;function Ja({virtualMcp:l}){const e=ee(),n=kt(),[s,i]=Q.useState(null),[a,c]=Q.useState(!1),[r,h]=Q.useState(!1),o=l.id,m=l.title||`agent-${o.slice(0,8)}`,f=s?`bunx @decocms/typegen@latest --mcp ${o} --key ${s} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${o} --key <api-key> --output client.ts`,u=async()=>{c(!0);try{const{key:p}=await n.call("API_KEY_CREATE",{name:`typegen-${m}`,permissions:{[o]:["*"]},expiresIn:Xa});if(!p)throw new Error("No key in response");i(p),ke("agent_typegen_key_generated",{agent_id:o})}catch{ke("agent_typegen_key_failed",{agent_id:o}),re.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{c(!1)}},d=async()=>{ke("agent_connect_action",{agent_id:o,action:"typegen_copy_command",has_api_key:!!s}),await navigator.clipboard.writeText(f),h(!0),re.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await pt(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(ne,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:u,disabled:a,children:[a?t.jsx(et,{className:"size-3.5"}):t.jsx(At,{size:14}),t.jsx("span",{children:e(a?"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(ne,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:d,children:r?t.jsx(nt,{size:12,className:"text-success"}):t.jsx(mt,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx(Za,{apiKey:s,agentId:o})]})}function Za(l){const e=q.c(21),{apiKey:n,agentId:s}=l,[i,a]=Q.useState(!1),c=window.location.origin,r=n?`STUDIO_API_KEY=${n}`:"STUDIO_API_KEY=<api-key>",h=`STUDIO_BASE_URL=${c}`,o=`${r}
|
|
1
|
+
import{c as q,b as ee,r as Q,j as t,B as ne,h as et,l as xe,X as ps,T as hs,V as xs,U as We,as as Et,aq as zt,ar as Rt,t as re,a2 as Oe,D as Ge,q as qe,s as tt,v as st,H as Le,a3 as gs,fz as nn,w as Ct,L as vs,I as Ce,ak as ln,z as an,ep as Xe,au as Lt,aj as rn,eo as Fe,en as Ue,a9 as kt,m as bs,K as Mt,fA as on,fB as cn,fC as dn,b9 as ve,fD as be,n as Re,P as un,d as _t,u as mn,ah as nt,o as js,e as fn,aM as ys,y as ke,ey as pn,az as hn,eU as xn,fE as gn,b1 as vn,a as bn,fF as ws,fG as jn,aW as yn,af as wn,aE as Sn,aD as Nn,a5 as Cn,fH as kn,aL as Mn}from"./index-Bu9BjZrq.js";import{g as _n}from"./extract-connection-data-BOqucuID.js";import{b as Vn}from"./chat-context-B8EIbmvQ.js";import{U as Tn,b as Dn}from"./build-improve-prompt-doc-C3V-cifS.js";import{E as An}from"./empty-state-bIFMElEe.js";import{a as Pn}from"./shell-layout-fqXaSGsn.js";import{g as ct,n as In,a as Ut,e as On,u as $n,f as Fn}from"./use-date-fns-locale-BEXRTRYo.js";import{a as En}from"./mcp-oauth-CP7f2bqu.js";import{f as zn,e as Rn,b as Ln,A as Un,a as Bn,d as Yn,c as Wn,g as Kn}from"./alert-dialog-DmhXDwQf.js";import{T as at}from"./textarea-7aD59y1C.js";import{c as we,T as Se,a as Ne}from"./tooltip-Djfj4yvo.js";import{a as Vt,b as Ss,u as Gn}from"./use-connection-CYm-Vxmx.js";import{b as Ns,a as Cs,f as ks,g as Ms,l as qn}from"./repository-binding-DTzReh06.js";import{i as Bt}from"./mcp-oauth-BqOO-7HR.js";import{bf as Hn,h as Qn,bg as Xn,bh as Jn,aL as Zn,aC as ei,aF as ti,bi as si,bj as _s,bk as Vs,bl as ni,ao as ii,bm as li,bn as xt,bo as Yt,A as Wt,K as ai,bp as ri,bq as oi,g as Ts,m as Kt,n as ci,u as di,r as ui,q as mi,f as Ds,z as Gt,V as fi,B as pi,aJ as hi,ac as xi,au as gi}from"./agent-icon-C1V6kO6k.js";import{s as Ie}from"./Plus-CPrlnOw7.js";import{t as lt,a as vi}from"./Tool01-D30btgv0.js";import{s as Tt}from"./Trash01-CuDfbX9_.js";import{u as qt}from"./use-debounced-autosave-Z24y5bHD.js";import{A as bi}from"./add-connection-dialog-bxfInPMj.js";import{i as yt}from"./SearchMd-vuCQLB6T.js";import{F as Ht}from"./file-type-icon-fTBob-KS.js";import{i as ji,h as yi,n as wi,q as Si}from"./use-org-fs-ZG2jF1ev.js";import{I as He}from"./integration-icon-D0zNx-RJ.js";import{C as As}from"./checkbox-C7CPIIbh.js";import{S as Ni}from"./search-input-CvytUoQu.js";import{b as _e,a as Ve,c as je,d as Te,S as De}from"./select-B9xwWJY1.js";import{s as Dt}from"./XClose-jBQRwEAI.js";import{C as Ci}from"./collection-tabs-DLtCCrSF.js";import{T as Ps,u as Is}from"./use-mcp-auth-status-C8SSMyOQ.js";import{u as dt}from"./use-mcp-client-DXWvBBzU.js";import{a as Os}from"./use-mcp-tools-BA7tqEjQ.js";import{u as ki}from"./use-mcp-prompts-D5_raFI0.js";import{g as Mi}from"./connection-slug-CITJ0kGN.js";import{t as wt}from"./utils-CVEq3hMx.js";import{S as ut}from"./switch-Dyv9YUWT.js";import{a as $s,b as Fs,P as Es}from"./popover-DBhjt7xF.js";import{S as _i}from"./scroll-area-Cvpjc0l0.js";import{i as Vi}from"./Upload01-Bbz_T9k9.js";import{i as Ti}from"./DotsVertical-XGcmOLtN.js";import{a as Di}from"./Image01-DA50Hqzp.js";import{i as Ai}from"./Monitor01-CDHoaa0R.js";import{g as Pi}from"./types-DSQN8Y9X.js";import{u as Ii,e as St,r as Nt,a as rt,p as Oi,y as $i,s as Fi,z as Ei,A as zi,l as Ri,B as Li,c as Ui,n as Bi}from"./use-project-native-view-presence-FuvDcd3j.js";import{a as Yi}from"./use-panel-navigate-CgLeC7oT.js";import{a as zs,u as Wi,i as Ki,o as Gi,r as Qt,p as qi,w as Hi,b as Xt}from"./optimistic-project-sidebar-views-CqtTgCjK.js";import{i as Qi}from"./Link01-DITYAShx.js";import{i as At}from"./Key01-GJDDXAJz.js";import{a as Xi}from"./format-time-CAj8AQXM.js";import{a as mt}from"./Copy01-DHwdjF9k.js";import{u as Ji}from"./use-copy-C0ICuN7j.js";import{L as ye}from"./label-BqTE8eVe.js";import{s as Rs,p as Zi,f as el}from"./thread-intent-YA4iB4rg.js";import{V as tl,E as ft,r as Ls,C as sl,w as nl}from"./virtual-mcp-QuhvrKMt.js";import{s as Us}from"./slugify-CEUa2lfQ.js";import{b as il,a as ll,D as al}from"./drawer-Cwq-E8vz.js";import{u as rl}from"./use-mobile-DVlrjJnR.js";import{d as pt}from"./delay-CnY5UFtP.js";import{R as ol}from"./repository-import-picker-CUpsn0UU.js";import{b as cl}from"./sandbox-url-D3mC8qhT.js";import{S as dl,a as ul,b as ml}from"./secret-picker-DR8k8utG.js";import{u as fl,a as pl}from"./use-secrets-BdA07xp7.js";import{o as Jt}from"./omit-sandbox-map-jj4lCB2U.js";import{G as hl}from"./repository-picker-liId9_zf.js";import{r as xl}from"./serial-task-queue-CGOeQgpr.js";import{t as Ae,c as Ke,m as gl,a as Bs}from"./differenceInSeconds-C3x8sHUj.js";function Ze(l,e){const n=ct(),s=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Ae(l,e?.in),a=i.getDay(),c=(a<s?7:0)+a-s;return i.setDate(i.getDate()-c),i.setHours(0,0,0,0),i}function ot(l,e){return Ze(l,{...e,weekStartsOn:1})}function Ys(l,e){const n=Ae(l,e?.in),s=n.getFullYear(),i=Ke(n,0);i.setFullYear(s+1,0,4),i.setHours(0,0,0,0);const a=ot(i),c=Ke(n,0);c.setFullYear(s,0,4),c.setHours(0,0,0,0);const r=ot(c);return n.getTime()>=a.getTime()?s+1:n.getTime()>=r.getTime()?s:s-1}function Zt(l,e){const n=Ae(l,e?.in);return n.setHours(0,0,0,0),n}function vl(l,e,n){const[s,i]=In(n?.in,l,e),a=Zt(s),c=Zt(i),r=+a-Ut(a),h=+c-Ut(c);return Math.round((r-h)/gl)}function bl(l,e){const n=Ys(l,e),s=Ke(l,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),ot(s)}function jl(l){return l instanceof Date||typeof l=="object"&&Object.prototype.toString.call(l)==="[object Date]"}function yl(l){return!(!jl(l)&&typeof l!="number"||isNaN(+Ae(l)))}function wl(l,e){const n=Ae(l,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Sl(l,e){const n=Ae(l,e?.in);return vl(n,wl(n))+1}function Nl(l,e){const n=Ae(l,e?.in),s=+ot(n)-+bl(n);return Math.round(s/Bs)+1}function Ws(l,e){const n=Ae(l,e?.in),s=n.getFullYear(),i=ct(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,c=Ke(e?.in||l,0);c.setFullYear(s+1,0,a),c.setHours(0,0,0,0);const r=Ze(c,e),h=Ke(e?.in||l,0);h.setFullYear(s,0,a),h.setHours(0,0,0,0);const o=Ze(h,e);return+n>=+r?s+1:+n>=+o?s:s-1}function Cl(l,e){const n=ct(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Ws(l,e),a=Ke(e?.in||l,0);return a.setFullYear(i,0,s),a.setHours(0,0,0,0),Ze(a,e)}function kl(l,e){const n=Ae(l,e?.in),s=+Ze(n,e)-+Cl(n,e);return Math.round(s/Bs)+1}function ae(l,e){const n=l<0?"-":"",s=Math.abs(l).toString().padStart(e,"0");return n+s}const $e={y(l,e){const n=l.getFullYear(),s=n>0?n:1-n;return ae(e==="yy"?s%100:s,e.length)},M(l,e){const n=l.getMonth();return e==="M"?String(n+1):ae(n+1,2)},d(l,e){return ae(l.getDate(),e.length)},a(l,e){const n=l.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(l,e){return ae(l.getHours()%12||12,e.length)},H(l,e){return ae(l.getHours(),e.length)},m(l,e){return ae(l.getMinutes(),e.length)},s(l,e){return ae(l.getSeconds(),e.length)},S(l,e){const n=e.length,s=l.getMilliseconds(),i=Math.trunc(s*Math.pow(10,n-3));return ae(i,e.length)}},Ye={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},es={G:function(l,e,n){const s=l.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(l,e,n){if(e==="yo"){const s=l.getFullYear(),i=s>0?s:1-s;return n.ordinalNumber(i,{unit:"year"})}return $e.y(l,e)},Y:function(l,e,n,s){const i=Ws(l,s),a=i>0?i:1-i;if(e==="YY"){const c=a%100;return ae(c,2)}return e==="Yo"?n.ordinalNumber(a,{unit:"year"}):ae(a,e.length)},R:function(l,e){const n=Ys(l);return ae(n,e.length)},u:function(l,e){const n=l.getFullYear();return ae(n,e.length)},Q:function(l,e,n){const s=Math.ceil((l.getMonth()+1)/3);switch(e){case"Q":return String(s);case"QQ":return ae(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(l,e,n){const s=Math.ceil((l.getMonth()+1)/3);switch(e){case"q":return String(s);case"qq":return ae(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(l,e,n){const s=l.getMonth();switch(e){case"M":case"MM":return $e.M(l,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(l,e,n){const s=l.getMonth();switch(e){case"L":return String(s+1);case"LL":return ae(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(l,e,n,s){const i=kl(l,s);return e==="wo"?n.ordinalNumber(i,{unit:"week"}):ae(i,e.length)},I:function(l,e,n){const s=Nl(l);return e==="Io"?n.ordinalNumber(s,{unit:"week"}):ae(s,e.length)},d:function(l,e,n){return e==="do"?n.ordinalNumber(l.getDate(),{unit:"date"}):$e.d(l,e)},D:function(l,e,n){const s=Sl(l);return e==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):ae(s,e.length)},E:function(l,e,n){const s=l.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(l,e,n,s){const i=l.getDay(),a=(i-s.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return ae(a,2);case"eo":return n.ordinalNumber(a,{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(l,e,n,s){const i=l.getDay(),a=(i-s.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return ae(a,e.length);case"co":return n.ordinalNumber(a,{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(l,e,n){const s=l.getDay(),i=s===0?7:s;switch(e){case"i":return String(i);case"ii":return ae(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(l,e,n){const i=l.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(l,e,n){const s=l.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(l,e,n){const s=l.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(l,e,n){if(e==="ho"){let s=l.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return $e.h(l,e)},H:function(l,e,n){return e==="Ho"?n.ordinalNumber(l.getHours(),{unit:"hour"}):$e.H(l,e)},K:function(l,e,n){const s=l.getHours()%12;return e==="Ko"?n.ordinalNumber(s,{unit:"hour"}):ae(s,e.length)},k:function(l,e,n){let s=l.getHours();return s===0&&(s=24),e==="ko"?n.ordinalNumber(s,{unit:"hour"}):ae(s,e.length)},m:function(l,e,n){return e==="mo"?n.ordinalNumber(l.getMinutes(),{unit:"minute"}):$e.m(l,e)},s:function(l,e,n){return e==="so"?n.ordinalNumber(l.getSeconds(),{unit:"second"}):$e.s(l,e)},S:function(l,e){return $e.S(l,e)},X:function(l,e,n){const s=l.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return ss(s);case"XXXX":case"XX":return ze(s);default:return ze(s,":")}},x:function(l,e,n){const s=l.getTimezoneOffset();switch(e){case"x":return ss(s);case"xxxx":case"xx":return ze(s);default:return ze(s,":")}},O:function(l,e,n){const s=l.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ts(s,":");default:return"GMT"+ze(s,":")}},z:function(l,e,n){const s=l.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ts(s,":");default:return"GMT"+ze(s,":")}},t:function(l,e,n){const s=Math.trunc(+l/1e3);return ae(s,e.length)},T:function(l,e,n){return ae(+l,e.length)}};function ts(l,e=""){const n=l>0?"-":"+",s=Math.abs(l),i=Math.trunc(s/60),a=s%60;return a===0?n+String(i):n+String(i)+e+ae(a,2)}function ss(l,e){return l%60===0?(l>0?"-":"+")+ae(Math.abs(l)/60,2):ze(l,e)}function ze(l,e=""){const n=l>0?"-":"+",s=Math.abs(l),i=ae(Math.trunc(s/60),2),a=ae(s%60,2);return n+i+e+a}const ns=(l,e)=>{switch(l){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"})}},Ks=(l,e)=>{switch(l){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"})}},Ml=(l,e)=>{const n=l.match(/(P+)(p+)?/)||[],s=n[1],i=n[2];if(!i)return ns(l,e);let a;switch(s){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;default:a=e.dateTime({width:"full"});break}return a.replace("{{date}}",ns(s,e)).replace("{{time}}",Ks(i,e))},_l={p:Ks,P:Ml},Vl=/^D+$/,Tl=/^Y+$/,Dl=["D","DD","YY","YYYY"];function Al(l){return Vl.test(l)}function Pl(l){return Tl.test(l)}function Il(l,e,n){const s=Ol(l,e,n);if(console.warn(s),Dl.includes(l))throw new RangeError(s)}function Ol(l,e,n){const s=l[0]==="Y"?"years":"days of the month";return`Use \`${l.toLowerCase()}\` instead of \`${l}\` (in \`${e}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $l=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Fl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,El=/^'([^]*?)'?$/,zl=/''/g,Rl=/[a-zA-Z]/;function Ll(l,e,n){const s=ct(),i=n?.locale??s.locale??On,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,c=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,r=Ae(l,n?.in);if(!yl(r))throw new RangeError("Invalid time value");let h=e.match(Fl).map(m=>{const f=m[0];if(f==="p"||f==="P"){const u=_l[f];return u(m,i.formatLong)}return m}).join("").match($l).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const f=m[0];if(f==="'")return{isToken:!1,value:Ul(m)};if(es[f])return{isToken:!0,value:m};if(f.match(Rl))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 o={firstWeekContainsDate:a,weekStartsOn:c,locale:i};return h.map(m=>{if(!m.isToken)return m.value;const f=m.value;(!n?.useAdditionalWeekYearTokens&&Pl(f)||!n?.useAdditionalDayOfYearTokens&&Al(f))&&Il(f,e,String(l));const u=es[f[0]];return u(r,f,i.localize,o)}).join("")}function Ul(l){const e=l.match(El);return e?e[1].replace(zl,"'"):l}const Gs=25*1024*1024,gt="home",vt="knowledge";function is(l){return l==null?"":l<1024?`${l} B`:l<1024*1024?`${(l/1024).toFixed(0)} KB`:`${(l/(1024*1024)).toFixed(1)} MB`}function Ee(l){return l.split("/").pop()??l}function Bl(l){const e=q.c(64),{form:n}=l,s=ee(),{upload:i}=ji(gt),a=yi(),c=Q.useRef(null),[r,h]=Q.useState(!1),[o,m]=Q.useState(""),[f,u]=Q.useState(!1);let d;e[0]!==r?(d={enabled:r},e[0]=r,e[1]=d):d=e[1];const{data:p}=wi(60,d),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}=Si(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]=Q.useState(j);let C;e[6]!==n?(C=D=>{S(D),n.setValue("metadata.knowledge",D,{shouldDirty:!0})},e[6]=n,e[7]=C):C=e[7];const k=C;let w;e[8]!==a||e[9]!==v||e[10]!==k||e[11]!==s||e[12]!==i?(w=async D=>{if(!D||D.length===0)return;const Z=Array.from(D),he=Z.filter(Ql),de=Z.filter(Hl);if(de.length>0&&re.warning(s("virtualMcp.filesSection.fileTooLargeTitle"),{description:s("virtualMcp.filesSection.fileTooLargeDescription",{names:de.map(ql).join(", ")})}),he.length!==0){try{await i.mutateAsync({dir:vt,files:he})}catch(ge){const Pe=ge;re.error(Pe instanceof Error?Pe.message:s("virtualMcp.filesSection.failedUploadFile"));return}k([...v,...he.map(ge=>({id:crypto.randomUUID(),name:ge.name,volume:gt,path:`${vt}/${ge.name}`,url:a(gt,`${vt}/${ge.name}`),contentType:ge.type||null,size:ge.size,addedAt:new Date().toISOString()}))])}},e[8]=a,e[9]=v,e[10]=k,e[11]=s,e[12]=i,e[13]=w):w=e[13];const N=w;let M;e[14]!==a||e[15]!==v||e[16]!==k?(M=D=>{v.some(Z=>Z.volume===D.volume&&Z.path===D.path)||(k([...v,{id:crypto.randomUUID(),name:Ee(D.path),volume:D.volume,path:D.path,url:a(D.volume,D.path),contentType:null,size:D.size??null,addedAt:new Date().toISOString()}]),h(!1))},e[14]=a,e[15]=v,e[16]=k,e[17]=M):M=e[17];const T=M;let V;e[18]!==a||e[19]!==v||e[20]!==k?(V=D=>{v.some(Z=>Z.volume===D.volume&&Z.path===D.path)||(k([...v,{id:crypto.randomUUID(),name:Ee(D.path),kind:"skill",volume:D.volume,path:D.path,url:a(D.volume,D.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),h(!1))},e[18]=a,e[19]=v,e[20]=k,e[21]=V):V=e[21];const P=V;let A;e[22]!==v||e[23]!==k?(A=D=>{k(v.filter(Z=>Z.id!==D))},e[22]=v,e[23]=k,e[24]=A):A=e[24];const z=A;let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=D=>{h(D),D&&m("")},e[25]=I):I=e[25];const $=I;let F;e[26]!==v?(F=new Set(v.map(Gl)),e[26]=v,e[27]=F):F=e[27];const K=F,Y=o.toLowerCase();let B;e[28]!==K?(B=D=>!K.has(`${D.volume}/${D.path}`),e[28]=K,e[29]=B):B=e[29];const U=x.filter(Kl).filter(B).filter(D=>Ee(D.path).toLowerCase().includes(Y)).slice(0,5);let _;e[30]!==K?(_=D=>!K.has(`${D.volume}/${D.path}`),e[30]=K,e[31]=_):_=e[31];const E=y.filter(_).filter(D=>Ee(D.path).toLowerCase().includes(Y)).slice(0,5),G=D=>t.jsxs(ps,{open:r,onOpenChange:$,children:[t.jsx(hs,{asChild:!0,children:D}),t.jsxs(xs,{align:"end",className:"w-56",children:[t.jsxs(We,{onSelect:()=>{c.current?.click()},children:[t.jsx(Hn,{size:16}),s("virtualMcp.filesSection.uploadFile")]}),t.jsxs(Et,{children:[t.jsxs(zt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(Qn,{size:16}),s("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(Rt,{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:o,onChange:Z=>m(Z.target.value),onKeyDown:Wl,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(Z=>t.jsxs(We,{onSelect:()=>T(Z),children:[t.jsx(Ht,{filename:Ee(Z.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ee(Z.path)}),Z.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:is(Z.size)})]},`${Z.volume}/${Z.path}`))})]})]}),t.jsxs(Et,{children:[t.jsxs(zt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(lt,{size:16}),s("virtualMcp.filesSection.selectSkill")]}),t.jsxs(Rt,{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:o,onChange:Z=>m(Z.target.value),onKeyDown:Yl,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(Z=>t.jsxs(We,{onSelect:()=>P(Z),children:[t.jsx(lt,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ee(Z.path)})]},`${Z.volume}/${Z.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 W;e[34]!==R?(W=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:R}),e[34]=R,e[35]=W):W=e[35];let X;e[36]!==s?(X=s("virtualMcp.filesSection.description"),e[36]=s,e[37]=X):X=e[37];let ie;e[38]!==X?(ie=t.jsx("p",{className:"text-sm text-muted-foreground",children:X}),e[38]=X,e[39]=ie):ie=e[39];let J;e[40]!==W||e[41]!==ie?(J=t.jsxs("div",{className:"flex flex-col gap-1",children:[W,ie]}),e[40]=W,e[41]=ie,e[42]=J):J=e[42];const oe=v.length>0&&G(t.jsxs(ne,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(et,{size:"xs"}):t.jsx(Ie,{size:14}),s("virtualMcp.filesSection.add")]}));let le;e[43]!==J||e[44]!==oe?(le=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[J,oe]}),e[43]=J,e[44]=oe,e[45]=le):le=e[45];let ce;e[46]!==N?(ce=t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:D=>{N(D.target.files),D.target.value=""}}),e[46]=N,e[47]=ce):ce=e[47];let te,ue;e[48]===Symbol.for("react.memo_cache_sentinel")?(te=D=>{D.preventDefault(),u(!0)},ue=()=>u(!1),e[48]=te,e[49]=ue):(te=e[48],ue=e[49]);let fe;e[50]!==N?(fe=D=>{D.preventDefault(),D.stopPropagation(),u(!1),N(D.dataTransfer.files)},e[50]=N,e[51]=fe):fe=e[51];const pe=f&&"outline outline-2 outline-dashed outline-primary";let me;e[52]!==pe?(me=xe("flex flex-col gap-2 rounded-lg",pe),e[52]=pe,e[53]=me):me=e[53];const O=v.length===0?G(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(Ie,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:s("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):v.map(D=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-card",children:[D.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(lt,{size:16})}):t.jsx(Ht,{filename:D.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:D.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:D.kind==="skill"?s("virtualMcp.filesSection.kindSkill"):D.size!=null?is(D.size):s("virtualMcp.filesSection.kindFile")})]}),t.jsx(ne,{variant:"ghost",size:"icon",onClick:()=>z(D.id),"aria-label":s("virtualMcp.filesSection.removeAriaLabel",{name:D.name}),children:t.jsx(Tt,{size:16})})]},D.id));let se;e[54]!==te||e[55]!==ue||e[56]!==fe||e[57]!==me||e[58]!==O?(se=t.jsx("div",{onDragOver:te,onDragLeave:ue,onDrop:fe,className:me,children:O}),e[54]=te,e[55]=ue,e[56]=fe,e[57]=me,e[58]=O,e[59]=se):se=e[59];let H;return e[60]!==le||e[61]!==ce||e[62]!==se?(H=t.jsxs("section",{className:L,children:[le,ce,se]}),e[60]=le,e[61]=ce,e[62]=se,e[63]=H):H=e[63],H}function Yl(l){return l.stopPropagation()}function Wl(l){return l.stopPropagation()}function Kl(l){return l.kind!=="dir"}function Gl(l){return`${l.volume}/${l.path}`}function ql(l){return l.name}function Hl(l){return l.size>Gs}function Ql(l){return l.size<=Gs}function Xl(l){return l==null?"all":l.length===0?"self":"selected"}function Jl(l){const e=q.c(88),{form:n,currentAgentId:s}=l,i=ee(),{org:a}=Oe(),c=Ns(),[r,h]=Q.useState(!1);let o;e[0]!==n?(o=n.getValues("metadata.subAgents")??null,e[0]=n,e[1]=o):o=e[1];const m=o;let f;e[2]!==m?(f=()=>Xl(m),e[2]=m,e[3]=f):f=e[3];const[u,d]=Q.useState(f);let p;e[4]!==m?(p=m??[],e[4]=m,e[5]=p):p=e[5];const[x,g]=Q.useState(p);let b,y,j,v,S,C;if(e[6]!==c||e[7]!==s||e[8]!==n||e[9]!==u||e[10]!==a||e[11]!==x||e[12]!==i){let M;e[19]!==s||e[20]!==a?(M=te=>te.id!==s&&te.id!==a.id&&te.status==="active",e[19]=s,e[20]=a,e[21]=M):M=e[21],b=c.filter(M);let T;e[22]!==x?(T=te=>x.includes(te.id),e[22]=x,e[23]=T):T=e[23];const V=b.filter(T);let P;e[24]!==n?(P=(te,ue)=>n.setValue("metadata.subAgents",te==="all"?null:te==="self"?[]:ue,{shouldDirty:!0}),e[24]=n,e[25]=P):P=e[25];const A=P;let z;e[26]!==A||e[27]!==x?(z=te=>{d(te),A(te,x)},e[26]=A,e[27]=x,e[28]=z):z=e[28];const I=z;let $;e[29]!==A||e[30]!==x?($=te=>{const ue=x.includes(te)?x.filter(fe=>fe!==te):[...x,te];g(ue),A("selected",ue)},e[29]=A,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 K;e[34]!==F?(K=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:F}),e[34]=F,e[35]=K):K=e[35];let Y;e[36]!==u||e[37]!==i?(Y=u==="all"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canDelegateToAnyAgent")}),e[36]=u,e[37]=i,e[38]=Y):Y=e[38];let B;e[39]!==u||e[40]!==i?(B=u==="self"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canOnlyDelegateToItself")}),e[39]=u,e[40]=i,e[41]=B):B=e[41];let U;e[42]!==K||e[43]!==Y||e[44]!==B?(U=t.jsxs("div",{className:"flex flex-col gap-1",children:[K,Y,B]}),e[42]=K,e[43]=Y,e[44]=B,e[45]=U):U=e[45];const _=u==="selected"&&V.length>0&&t.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>h(!0),children:[t.jsx(Ie,{size:14}),i("virtualMcp.subAgentsSection.addSubAgent")]});let E;e[46]!==I?(E=te=>I(te),e[46]=I,e[47]=E):E=e[47];let G;e[48]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(_e,{size:"sm",className:"w-auto",children:t.jsx(Ve,{})}),e[48]=G):G=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(je,{value:"all",children:L}),e[51]=L,e[52]=R):R=e[52];let W;e[53]!==i?(W=i("virtualMcp.subAgentsSection.specificAgents"),e[53]=i,e[54]=W):W=e[54];let X;e[55]!==W?(X=t.jsx(je,{value:"selected",children:W}),e[55]=W,e[56]=X):X=e[56];let ie;e[57]!==i?(ie=i("virtualMcp.subAgentsSection.onlyItself"),e[57]=i,e[58]=ie):ie=e[58];let J;e[59]!==ie?(J=t.jsx(je,{value:"self",children:ie}),e[59]=ie,e[60]=J):J=e[60];let oe;e[61]!==R||e[62]!==X||e[63]!==J?(oe=t.jsxs(Te,{align:"end",children:[R,X,J]}),e[61]=R,e[62]=X,e[63]=J,e[64]=oe):oe=e[64];let le;e[65]!==u||e[66]!==E||e[67]!==oe?(le=t.jsxs(De,{value:u,onValueChange:E,children:[G,oe]}),e[65]=u,e[66]=E,e[67]=oe,e[68]=le):le=e[68];let ce;e[69]!==_||e[70]!==le?(ce=t.jsxs("div",{className:"flex items-center gap-2",children:[_,le]}),e[69]=_,e[70]=le,e[71]=ce):ce=e[71],e[72]!==U||e[73]!==ce?(C=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[U,ce]}),e[72]=U,e[73]=ce,e[74]=C):C=e[74],j="flex flex-col gap-2",v=u==="selected"&&(V.length>0?V.map(te=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-background",children:[t.jsx(He,{icon:te.icon,name:te.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:te.title}),te.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:te.description})]}),t.jsx(ne,{variant:"ghost",size:"icon",onClick:()=>y(te.id),children:t.jsx(Dt,{size:16})})]},te.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(Ie,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.emptyStateMessage")})]})),e[6]=c,e[7]=s,e[8]=n,e[9]=u,e[10]=a,e[11]=x,e[12]=i,e[13]=b,e[14]=y,e[15]=j,e[16]=v,e[17]=S,e[18]=C}else b=e[13],y=e[14],j=e[15],v=e[16],S=e[17],C=e[18];let k;e[75]!==j||e[76]!==v?(k=t.jsx("div",{className:j,children:v}),e[75]=j,e[76]=v,e[77]=k):k=e[77];let w;e[78]!==b||e[79]!==y||e[80]!==r||e[81]!==x?(w=t.jsx(Zl,{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 N;return e[83]!==S||e[84]!==C||e[85]!==k||e[86]!==w?(N=t.jsxs("section",{className:S,children:[C,k,w]}),e[83]=S,e[84]=C,e[85]=k,e[86]=w,e[87]=N):N=e[87],N}function Zl(l){const e=q.c(39),{open:n,onOpenChange:s,candidates:i,selectedIds:a,onToggle:c}=l,r=ee(),[h,o]=Q.useState("");let m,f,u,d,p,x,g,b,y;if(e[0]!==i||e[1]!==s||e[2]!==c||e[3]!==n||e[4]!==h||e[5]!==a||e[6]!==r){const C=h.toLowerCase(),k=i.filter(M=>M.title.toLowerCase().includes(C)||M.description?.toLowerCase().includes(C));f=Ge,b=n,y=s,m=qe,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(tt,{children:t.jsx(st,{children:w})}),e[18]=w,e[19]=x):x=e[19];let N;e[20]!==r?(N=r("virtualMcp.subAgentsSection.searchPlaceholder"),e[20]=r,e[21]=N):N=e[21],e[22]!==h||e[23]!==N?(g=t.jsx(Ni,{value:h,onChange:o,placeholder:N,className:"w-full"}),e[22]=h,e[23]=N,e[24]=g):g=e[24],u="flex flex-col gap-1 max-h-80 overflow-y-auto",d=k.length===0?t.jsx("p",{className:"text-sm text-muted-foreground px-1 py-4 text-center",children:r("virtualMcp.subAgentsSection.noAgentsFound")}):k.map(M=>t.jsxs("button",{type:"button",onClick:()=>c(M.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(As,{checked:a.includes(M.id),className:"pointer-events-none",tabIndex:-1}),t.jsx(He,{icon:M.icon,name:M.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:M.title}),M.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:M.description})]})]},M.id)),e[0]=i,e[1]=s,e[2]=c,e[3]=n,e[4]=h,e[5]=a,e[6]=r,e[7]=m,e[8]=f,e[9]=u,e[10]=d,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],d=e[10],p=e[11],x=e[12],g=e[13],b=e[14],y=e[15];let j;e[25]!==u||e[26]!==d?(j=t.jsx("div",{className:u,children:d}),e[25]=u,e[26]=d,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 Je(){const l=q.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(et,{className:"size-6 text-muted-foreground"})}),l[0]=e):e=l[0],e}function it(l,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:l})}):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(gs,{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 qs(l){const e=q.c(23),{item:n,isSelected:s,onToggle:i,disabled:a}=l,c=a?"cursor-not-allowed opacity-50":"cursor-pointer",r=s?"bg-accent/25":"hover:bg-muted/50";let h;e[0]!==c||e[1]!==r?(h=xe("flex items-start gap-3 p-4 rounded-lg transition-colors",c,r),e[0]=c,e[1]=r,e[2]=h):h=e[2];let o;e[3]!==n.name?(o=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:n.name}),e[3]=n.name,e[4]=o):o=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]!==o||e[8]!==m?(f=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o,m]}),e[7]=o,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 d;e[12]!==f||e[13]!==u?(d=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[f,u]}),e[12]=f,e[13]=u,e[14]=d):d=e[14];let p;e[15]!==a||e[16]!==s||e[17]!==i?(p=t.jsx(As,{checked:s,onCheckedChange:i,disabled:a,className:"mt-0.5"}),e[15]=a,e[16]=s,e[17]=i,e[18]=p):p=e[18];let x;return e[19]!==h||e[20]!==d||e[21]!==p?(x=t.jsxs("label",{className:h,children:[d,p]}),e[19]=h,e[20]=d,e[21]=p,e[22]=x):x=e[22],x}function ea(l){const e=q.c(35),{activeTab:n,onTabChange:s,showSelectAll:i,isAllSelected:a,handleSelectAll:c}=l,r=ee();let h;e[0]!==r?(h=r("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=r,e[1]=h):h=e[1];let o;e[2]!==h?(o={id:"tools",label:h},e[2]=h,e[3]=o):o=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 d;e[10]!==u?(d={id:"resources",label:u},e[10]=u,e[11]=d):d=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]!==o||e[17]!==f||e[18]!==d||e[19]!==x?(g=[o,f,d,x],e[16]=o,e[17]=f,e[18]=d,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(Ci,{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]!==c||e[28]!==a||e[29]!==i||e[30]!==r?(j=i&&t.jsx("button",{type:"button",onClick:c,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r(a?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=c,e[28]=a,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 Pt(l){const e=q.c(13),{items:n,selections:s,onToggle:i,emptyMessage:a,disabled:c}=l;let r,h,o;if(e[0]!==c||e[1]!==a||e[2]!==n||e[3]!==i||e[4]!==s){o=Symbol.for("react.early_return_sentinel");e:{const f=n.map(ta);if(n.length===0){let u;e[8]!==a?(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:a})}),e[8]=a,e[9]=u):u=e[9],o=u;break e}r="flex-1 overflow-auto px-4 py-3 space-y-1",h=n.map(u=>t.jsx(qs,{item:u,isSelected:s===null||s?.includes(u.id),onToggle:()=>i(u.id,f),disabled:c},u.id))}e[0]=c,e[1]=a,e[2]=n,e[3]=i,e[4]=s,e[5]=r,e[6]=h,e[7]=o}else r=e[5],h=e[6],o=e[7];if(o!==Symbol.for("react.early_return_sentinel"))return o;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 ta(l){return l.id}function sa(l){const e=q.c(22),{connectionId:n,toolSelections:s,onToggleTool:i}=l,a=ee(),{org:c}=Oe();let r;e[0]!==n||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:n,orgId:c.id,orgSlug:c.slug},e[0]=n,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const h=dt(r);let o;e[4]!==h?(o={client:h},e[4]=h,e[5]=o):o=e[5];const{data:m}=Os(o),f=m.tools;let u,d,p;if(e[6]!==m.tools||e[7]!==i||e[8]!==a||e[9]!==s){p=Symbol.for("react.early_return_sentinel");e:{const g=f.map(ia);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(na);if(j.length===0){let v;e[15]!==a?(v=a("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=a,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",d=j.map(v=>t.jsx(qs,{item:v,isSelected:!0,onToggle:()=>i(v.id,g)},v.id))}e[6]=m.tools,e[7]=i,e[8]=a,e[9]=s,e[10]=u,e[11]=d,e[12]=p}else u=e[10],d=e[11],p=e[12];if(p!==Symbol.for("react.early_return_sentinel"))return p;let x;return e[19]!==u||e[20]!==d?(x=t.jsx("div",{className:u,children:d}),e[19]=u,e[20]=d,e[21]=x):x=e[21],x}function na(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(Ps,{annotations:l.annotations,_meta:l._meta})}}function ia(l){return l.name}function la(l){const e=q.c(16),{connectionId:n,selections:s,onToggle:i,disabled:a}=l,{org:c}=Oe();let r;e[0]!==n||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:n,orgId:c.id,orgSlug:c.slug},e[0]=n,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const h=dt(r);let o;e[4]!==h?(o={client:h},e[4]=h,e[5]=o):o=e[5];const{data:m}=Os(o);let f;e[6]!==m.tools?(f=m.tools.map(aa),e[6]=m.tools,e[7]=f):f=e[7];const u=f,d=ee();let p;e[8]!==d?(p=d("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=d,e[9]=p):p=e[9];let x;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==s||e[14]!==p?(x=t.jsx(Pt,{items:u,selections:s,onToggle:i,emptyMessage:p,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=s,e[14]=p,e[15]=x):x=e[15],x}function aa(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(Ps,{annotations:l.annotations,_meta:l._meta})}}function ra(l){const e=q.c(16),{connectionId:n,selections:s,onToggle:i,disabled:a}=l,{org:c}=Oe();let r;e[0]!==n||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:n,orgId:c.id,orgSlug:c.slug},e[0]=n,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const h=dt(r);let o;e[4]!==h?(o={client:h},e[4]=h,e[5]=o):o=e[5];const{data:m}=nn(o);let f;e[6]!==m.resources?(f=m.resources.map(oa),e[6]=m.resources,e[7]=f):f=e[7];const u=f,d=ee();let p;e[8]!==d?(p=d("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=d,e[9]=p):p=e[9];let x;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==s||e[14]!==p?(x=t.jsx(Pt,{items:u,selections:s,onToggle:i,emptyMessage:p,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=s,e[14]=p,e[15]=x):x=e[15],x}function oa(l){return{id:l.name||l.uri,name:l.name||l.uri,description:l.description}}function ca(l){const e=q.c(16),{connectionId:n,selections:s,onToggle:i,disabled:a}=l,{org:c}=Oe();let r;e[0]!==n||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:n,orgId:c.id,orgSlug:c.slug},e[0]=n,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const h=dt(r);let o;e[4]!==h?(o={client:h},e[4]=h,e[5]=o):o=e[5];const{data:m}=ki(o);let f;e[6]!==m.prompts?(f=m.prompts.map(da),e[6]=m.prompts,e[7]=f):f=e[7];const u=f,d=ee();let p;e[8]!==d?(p=d("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=d,e[9]=p):p=e[9];let x;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==s||e[14]!==p?(x=t.jsx(Pt,{items:u,selections:s,onToggle:i,emptyMessage:p,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=s,e[14]=p,e[15]=x):x=e[15],x}function da(l){return{id:l.name,name:l.name,description:l.description}}function ua(l){const e=q.c(58),{currentConnection:n,activeTab:s,selectedId:i,formData:a,toggleTool:c,toggleResource:r,togglePrompt:h,toggleAllTools:o,toggleAllResources:m,toggleAllPrompts:f,onTabChange:u}=l,d=ee(),p=a[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]!==o?(b=()=>{s==="tools"?o(i):s==="resources"?m(i):s==="prompts"&&f(i)},e[0]=s,e[1]=i,e[2]=f,e[3]=m,e[4]=o,e[5]=b):b=e[5];const y=b;let j;e[6]!==n.icon||e[7]!==n.title?(j=t.jsx(He,{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 C;e[13]!==v||e[14]!==S?(C=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,S]}),e[13]=v,e[14]=S,e[15]=C):C=e[15];let k;e[16]!==j||e[17]!==C?(k=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[j,C]})}),e[16]=j,e[17]=C,e[18]=k):k=e[18];let w;e[19]!==s||e[20]!==y||e[21]!==x||e[22]!==u||e[23]!==g?(w=t.jsx(ea,{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 N;e[25]!==s||e[26]!==a||e[27]!==i||e[28]!==d||e[29]!==c?(N=s==="active"&&t.jsx(Le,{fallback:it(d("virtualMcp.dependencySelectionDialog.toolsNotSupported"),d),children:t.jsx(Q.Suspense,{fallback:t.jsx(Je,{}),children:t.jsx(sa,{connectionId:i,toolSelections:a[i]?a[i].tools:[],onToggleTool:(z,I)=>c(i,z,I)})})}),e[25]=s,e[26]=a,e[27]=i,e[28]=d,e[29]=c,e[30]=N):N=e[30];let M;e[31]!==s||e[32]!==a||e[33]!==i||e[34]!==d||e[35]!==c?(M=s==="tools"&&t.jsx(Le,{fallback:it(d("virtualMcp.dependencySelectionDialog.toolsNotSupported"),d),children:t.jsx(Q.Suspense,{fallback:t.jsx(Je,{}),children:t.jsx(la,{connectionId:i,selections:a[i]?a[i].tools:[],onToggle:(z,I)=>c(i,z,I)})})}),e[31]=s,e[32]=a,e[33]=i,e[34]=d,e[35]=c,e[36]=M):M=e[36];let T;e[37]!==s||e[38]!==a||e[39]!==i||e[40]!==d||e[41]!==r?(T=s==="resources"&&t.jsx(Le,{fallback:it(d("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),d),children:t.jsx(Q.Suspense,{fallback:t.jsx(Je,{}),children:t.jsx(ra,{connectionId:i,selections:a[i]?a[i].resources:[],onToggle:(z,I)=>r(i,z,I)})})}),e[37]=s,e[38]=a,e[39]=i,e[40]=d,e[41]=r,e[42]=T):T=e[42];let V;e[43]!==s||e[44]!==a||e[45]!==i||e[46]!==d||e[47]!==h?(V=s==="prompts"&&t.jsx(Le,{fallback:it(d("virtualMcp.dependencySelectionDialog.promptsNotSupported"),d),children:t.jsx(Q.Suspense,{fallback:t.jsx(Je,{}),children:t.jsx(ca,{connectionId:i,selections:a[i]?a[i].prompts:[],onToggle:(z,I)=>h(i,z,I)})})}),e[43]=s,e[44]=a,e[45]=i,e[46]=d,e[47]=h,e[48]=V):V=e[48];let P;e[49]!==T||e[50]!==V||e[51]!==N||e[52]!==M?(P=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[N,M,T,V]}),e[49]=T,e[50]=V,e[51]=N,e[52]=M,e[53]=P):P=e[53];let A;return e[54]!==P||e[55]!==k||e[56]!==w?(A=t.jsxs(t.Fragment,{children:[k,w,P]}),e[54]=P,e[55]=k,e[56]=w,e[57]=A):A=e[57],A}function ma(l){const e=q.c(7),{onClose:n}=l,s=ee();let i;e[0]!==n?(i=()=>n(!1),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==s?(a=s("virtualMcp.dependencySelectionDialog.done"),e[2]=s,e[3]=a):a=e[3];let c;return e[4]!==i||e[5]!==a?(c=t.jsx(Ct,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(ne,{variant:"outline",onClick:i,children:a})}),e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function fa(l){const e=q.c(23),{connectionId:n,onAuthenticate:s,children:i}=l,a=ee();let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const r=Is(c);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(Xn,{size:22,className:"text-muted-foreground"})}),e[2]=m):m=e[2];let f;e[3]!==a?(f=a("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=a,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 d;e[7]!==a?(d=a("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=a,e[8]=d):d=e[8];let p;e[9]!==d?(p=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:d}),e[9]=d,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]!==a?(g=s&&t.jsx(ne,{variant:"outline",size:"sm",onClick:()=>s(n),children:a("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=n,e[15]=s,e[16]=a,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 o;return e[21]!==i?(o=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=o):o=e[22],o}function pa(l){const e={};for(const n of l)e[n.connection_id]={tools:n.selected_tools,resources:n.selected_resources??null,prompts:n.selected_prompts??null};return e}function ls(l){return Object.entries(l).map(([e,n])=>({connection_id:e,selected_tools:n.tools,selected_resources:n.resources,selected_prompts:n.prompts}))}function as(l,e,n,s){const i=l[e]??{tools:null,resources:null,prompts:null};return{...l,[e]:{...i,[n]:s}}}function ha(l,e){return e.type==="SET_ACTIVE_TAB"?{...l,activeTab:e.payload}:l}function xa(l){const e=q.c(49),{open:n,onOpenChange:s,selectedId:i,form:a,connections:c,onAuthenticate:r}=l;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activeTab:"tools"},e[0]=h):h=e[0];const[o,m]=Q.useReducer(ha,h),f=Vt(i??"");let u;e[1]!==c?(u=c??[],e[1]=c,e[2]=u):u=e[2];let d;e[3]!==u?(d=pa(u),e[3]=u,e[4]=d):d=e[4];const p=d;let x;e[5]!==a||e[6]!==p?(x=(U,_,E,G)=>{const L=p[U]?.[_];let R;L===null?R=G.filter(W=>W!==E):L?.includes(E)?R=L.filter(W=>W!==E):(R=[...L??[],E],R.length===G.length&&(R=null)),a.setValue("connections",ls(as(p,U,_,R)),{shouldDirty:!0,shouldTouch:!0})},e[5]=a,e[6]=p,e[7]=x):x=e[7];const g=x;let b;e[8]!==a||e[9]!==p?(b=(U,_)=>{const G=p[U]?.[_]===null?[]:null;a.setValue("connections",ls(as(p,U,_,G)),{shouldDirty:!0,shouldTouch:!0})},e[8]=a,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 C=S;let k;e[15]!==g?(k=(U,_,E)=>g(U,"prompts",_,E),e[15]=g,e[16]=k):k=e[16];const w=k;let N;e[17]!==y?(N=U=>y(U,"tools"),e[17]=y,e[18]=N):N=e[18];const M=N;let T;e[19]!==y?(T=U=>y(U,"resources"),e[19]=y,e[20]=T):T=e[20];const V=T;let P;e[21]!==y?(P=U=>y(U,"prompts"),e[21]=y,e[22]=P):P=e[22];const A=P;if(!i||!f)return null;let z;e[23]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(Je,{}),e[23]=z):z=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=U=>m({type:"SET_ACTIVE_TAB",payload:U}),e[24]=I):I=e[24];let $;e[25]!==f||e[26]!==o.activeTab||e[27]!==p||e[28]!==i||e[29]!==A||e[30]!==V||e[31]!==M||e[32]!==w||e[33]!==C||e[34]!==v?($=t.jsx(ua,{currentConnection:f,activeTab:o.activeTab,selectedId:i,formData:p,toggleTool:v,toggleResource:C,togglePrompt:w,toggleAllTools:M,toggleAllResources:V,toggleAllPrompts:A,onTabChange:I},i),e[25]=f,e[26]=o.activeTab,e[27]=p,e[28]=i,e[29]=A,e[30]=V,e[31]=M,e[32]=w,e[33]=C,e[34]=v,e[35]=$):$=e[35];let F;e[36]!==r||e[37]!==i||e[38]!==$?(F=t.jsx(Q.Suspense,{fallback:z,children:t.jsx(fa,{connectionId:i,onAuthenticate:r,children:$})}),e[36]=r,e[37]=i,e[38]=$,e[39]=F):F=e[39];let K;e[40]!==s?(K=t.jsx(ma,{onClose:s}),e[40]=s,e[41]=K):K=e[41];let Y;e[42]!==F||e[43]!==K?(Y=t.jsxs(qe,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[F,K]}),e[42]=F,e[43]=K,e[44]=Y):Y=e[44];let B;return e[45]!==s||e[46]!==n||e[47]!==Y?(B=t.jsx(Ge,{open:n,onOpenChange:s,children:Y}),e[45]=s,e[46]=n,e[47]=Y,e[48]=B):B=e[48],B}const rs="__new_instance__";function ga(l){const e=q.c(25),{connection_id:n,usedConnectionIds:s,onOpenSettings:i,onRemove:a,onAuthenticate:c,onSwitchInstance:r,onNewInstance:h}=l,o=Vt(n),{org:m}=Oe();if(!o){let g;return e[0]!==a?(g=t.jsx(ya,{onRemove:a}),e[0]=a,e[1]=g):g=e[1],g}let f;e[2]!==o?(f=Mi(o),e[2]=o,e[3]=f):f=e[3];const u=f;let d;e[4]!==n?(d=t.jsx(ja,{connection_id:n}),e[4]=n,e[5]=d):d=e[5];let p;e[6]!==o.app_name||e[7]!==o.connection_type||e[8]!==o.description||e[9]!==o.icon||e[10]!==o.status||e[11]!==o.title||e[12]!==n||e[13]!==c||e[14]!==h||e[15]!==i||e[16]!==a||e[17]!==r||e[18]!==m.slug||e[19]!==u||e[20]!==s?(p=t.jsx(ba,{connection_id:n,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,connectionType:o.connection_type,connectionStatus:o.status,slug:u,orgSlug:m.slug,appName:o.app_name,usedConnectionIds:s,onOpenSettings:i,onRemove:a,onAuthenticate:c,onSwitchInstance:r,onNewInstance:h}),e[6]=o.app_name,e[7]=o.connection_type,e[8]=o.description,e[9]=o.icon,e[10]=o.status,e[11]=o.title,e[12]=n,e[13]=c,e[14]=h,e[15]=i,e[16]=a,e[17]=r,e[18]=m.slug,e[19]=u,e[20]=s,e[21]=p):p=e[21];let x;return e[22]!==d||e[23]!==p?(x=t.jsx(Q.Suspense,{fallback:d,children:p}),e[22]=d,e[23]=p,e[24]=x):x=e[24],x}function va(l){const e=q.c(24),{appName:n,connectionId:s,usedConnectionIds:i,onSwitchInstance:a,onNewInstance:c}=l,r=ee();let h;e[0]!==n?(h={filters:[{column:"app_name",value:n}]},e[0]=n,e[1]=h):h=e[1];const o=Gn(h);if(o.length<=1&&!c)return null;let m;e[2]!==s||e[3]!==c||e[4]!==a?(m=g=>{g===rs?c?.():a(s,g)},e[2]=s,e[3]=c,e[4]=a,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]!==o||e[9]!==i){let g;e[11]!==s||e[12]!==i?(g=b=>t.jsx(je,{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=o.map(g),e[7]=s,e[8]=o,e[9]=i,e[10]=u}else u=e[10];let d;e[14]!==c||e[15]!==r?(d=c&&t.jsxs(je,{value:rs,className:"text-xs text-muted-foreground",children:["+ ",r("virtualMcp.connectionItem.newInstance")]}),e[14]=c,e[15]=r,e[16]=d):d=e[16];let p;e[17]!==u||e[18]!==d?(p=t.jsxs(Te,{children:[u,d]}),e[17]=u,e[18]=d,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 ba({connection_id:l,connectionTitle:e,connectionDescription:n,connectionIcon:s,connectionType:i,connectionStatus:a,slug:c,orgSlug:r,appName:h,usedConnectionIds:o,onOpenSettings:m,onRemove:f,onAuthenticate:u,onSwitchInstance:d,onNewInstance:p}){const x=Is({connectionId:l}),g=Ss(),y=!(i==="VIRTUAL")&&x.supportsOAuth&&!x.isAuthenticated,j=a!=="active",v=ee(),S=async C=>{try{await g.update.mutateAsync({id:l,data:{status:C}}),re.success(v(C==="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(vs,{to:"/$org/settings/connections/$appSlug",params:{org:r,appSlug:c},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors",children:[t.jsx(He,{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(a==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):n&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n})]}),y?t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 text-xs shrink-0",onClick:C=>{C.preventDefault(),C.stopPropagation(),u(l)},children:v("virtualMcp.connectionItem.authorize")}):j?t.jsxs(ne,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:C=>{C.preventDefault(),C.stopPropagation(),S("active")},children:[t.jsx(Jn,{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(vi,{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(va,{appName:h,connectionId:l,usedConnectionIds:o,onSwitchInstance:d,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(ne,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:m,"aria-label":v("virtualMcp.connectionItem.configureResources"),children:t.jsx(Zn,{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(ne,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>S("inactive"),"aria-label":v("virtualMcp.connectionItem.disableConnection"),children:t.jsx(ei,{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(ne,{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(Dt,{size:13})})}),t.jsx(Ne,{side:"bottom",children:v("virtualMcp.connectionItem.remove")})]})]})]})]})}function ja(l){const e=q.c(17),{connection_id:n}=l,s=Vt(n);if(!s){let f;return e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Hs,{}),e[0]=f):f=e[0],f}let i;e[1]!==s.icon||e[2]!==s.title?(i=t.jsx(He,{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 a;e[4]!==s.title?(a=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[4]=s.title,e[5]=a):a=e[5];let c;e[6]!==s.description?(c=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[6]=s.description,e[7]=c):c=e[7];let r;e[8]!==a||e[9]!==c?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,c]}),e[8]=a,e[9]=c,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 o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=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]=o):o=e[14];let m;return e[15]!==h?(m=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[h,o]}),e[15]=h,e[16]=m):m=e[16],m}function ya(l){const e=q.c(20),{onRemove:n}=l,s=ee();let i;e[0]!==s?(i=s("virtualMcp.connectionItem.connectionNotFound"),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==i?(a=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]=a):a=e[3];let c;e[4]!==s?(c=s("virtualMcp.connectionItem.removeConnection"),e[4]=s,e[5]=c):c=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Dt,{size:13}),e[6]=r):r=e[6];let h;e[7]!==n||e[8]!==c?(h=t.jsx(Se,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive shrink-0",onClick:n,"aria-label":c,children:r})}),e[7]=n,e[8]=c,e[9]=h):h=e[9];let o;e[10]!==s?(o=s("virtualMcp.connectionItem.remove"),e[10]=s,e[11]=o):o=e[11];let m;e[12]!==o?(m=t.jsx(Ne,{side:"bottom",children:o}),e[12]=o,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]!==a||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:[a,f]}),e[17]=a,e[18]=f,e[19]=u):u=e[19],u}function Hs(){const l=q.c(3);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),l[0]=e):e=l[0];let n;l[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"})]})]}),l[1]=n):n=l[1];let s;return l[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"})})]}),l[2]=s):s=l[2],s}function Qs(l){const e=q.c(85),{value:n,onChange:s,onColorChange:i,name:a,size:c,className:r,avatarClassName:h,showHoverOverlay:o,disabled:m}=l,f=c===void 0?"lg":c,u=o===void 0?!0:o,d=m===void 0?!1:m,p=ee(),[x,g]=Q.useState(!1),[b,y]=Q.useState("icons"),[j,v]=Q.useState(""),[S,C]=Q.useState("blue");let k;e[0]!==n?(k=ti(n),e[0]=n,e[1]=k):k=e[1];const w=k,N=w.type==="icon"||w.type==="url"&&w.color?w.color:S;let M;e[2]!==s||e[3]!==N?(M=de=>{s(xt(de,N))},e[2]=s,e[3]=N,e[4]=M):M=e[4];const T=M;let V;e[5]!==s||e[6]!==i||e[7]!==w.name||e[8]!==w.type||e[9]!==w.url?(V=de=>{C(de),i?.(de),w.type==="icon"?s(xt(w.name,de)):w.type==="url"&&s(Yt(w.url,de))},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 P=V;let A;e[11]!==s||e[12]!==N?(A=de=>{s(Yt(de,N)),g(!1)},e[11]=s,e[12]=N,e[13]=A):A=e[13];const z=A;let I;e[14]!==s||e[15]!==N?(I=()=>{const de=_s(),ge=de[Math.floor(Math.random()*de.length)];s(xt(ge,N))},e[14]=s,e[15]=N,e[16]=I):I=e[16];const $=I,F=d?!1:x;let K;e[17]!==p?(K=p("common.iconPicker.changeIcon"),e[17]=p,e[18]=K):K=e[18];const Y=d?"cursor-default opacity-50":"cursor-pointer";let B;e[19]!==r||e[20]!==f||e[21]!==Y?(B=xe("relative group overflow-hidden",Y,si(f),r),e[19]=r,e[20]=f,e[21]=Y,e[22]=B):B=e[22];let U;e[23]!==h||e[24]!==a||e[25]!==f||e[26]!==n?(U=t.jsx(Wt,{icon:n,name:a,size:f,className:h}),e[23]=h,e[24]=a,e[25]=f,e[26]=n,e[27]=U):U=e[27];let _;e[28]!==d||e[29]!==u?(_=u&&!d&&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(ai,{size:16,className:"text-white"})}),e[28]=d,e[29]=u,e[30]=_):_=e[30];let E;e[31]!==d||e[32]!==K||e[33]!==B||e[34]!==U||e[35]!==_?(E=t.jsx($s,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":K,disabled:d,className:B,children:[U,_]})}),e[31]=d,e[32]=K,e[33]=B,e[34]=U,e[35]=_,e[36]=E):E=e[36];let G;e[37]!==a||e[38]!==n?(G=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(Wt,{icon:n,name:a,size:"xl"})}),e[37]=a,e[38]=n,e[39]=G):G=e[39];let L;e[40]!==b?(L=de=>{if(de.key!=="ArrowLeft"&&de.key!=="ArrowRight")return;de.preventDefault();const ge=b==="icons"?"upload":"icons";y(ge),document.getElementById(`icon-picker-tab-${ge}`)?.focus()},e[40]=b,e[41]=L):L=e[41];const R=b==="icons",W=b==="icons"?0:-1;let X;e[42]===Symbol.for("react.memo_cache_sentinel")?(X=()=>y("icons"),e[42]=X):X=e[42];const ie=b==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let J;e[43]!==ie?(J=xe("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",ie),e[43]=ie,e[44]=J):J=e[44];let oe;e[45]!==p?(oe=p("common.iconPicker.iconsTab"),e[45]=p,e[46]=oe):oe=e[46];let le;e[47]!==R||e[48]!==W||e[49]!==J||e[50]!==oe?(le=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":R,"aria-controls":"icon-picker-panel-icons",tabIndex:W,onClick:X,className:J,children:oe}),e[47]=R,e[48]=W,e[49]=J,e[50]=oe,e[51]=le):le=e[51];const ce=b==="upload",te=b==="upload"?0:-1;let ue;e[52]===Symbol.for("react.memo_cache_sentinel")?(ue=()=>y("upload"),e[52]=ue):ue=e[52];const fe=b==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let pe;e[53]!==fe?(pe=xe("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",fe),e[53]=fe,e[54]=pe):pe=e[54];let me;e[55]!==p?(me=p("common.iconPicker.uploadTab"),e[55]=p,e[56]=me):me=e[56];let O;e[57]!==ce||e[58]!==te||e[59]!==pe||e[60]!==me?(O=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":ce,"aria-controls":"icon-picker-panel-upload",tabIndex:te,onClick:ue,className:pe,children:me}),e[57]=ce,e[58]=te,e[59]=pe,e[60]=me,e[61]=O):O=e[61];let se;e[62]===Symbol.for("react.memo_cache_sentinel")?(se=t.jsx("div",{className:"flex-1"}),e[62]=se):se=e[62];let H;e[63]!==L||e[64]!==le||e[65]!==O?(H=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:L,children:[le,O,se]}),e[63]=L,e[64]=le,e[65]=O,e[66]=H):H=e[66];let D;e[67]!==P||e[68]!==$||e[69]!==T||e[70]!==z||e[71]!==w.name||e[72]!==w.type||e[73]!==j||e[74]!==N||e[75]!==b?(D=b==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(Ca,{search:j,onSearchChange:v,selectedColor:N,onColorChange:P,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(ka,{onUpload:z})}),e[67]=P,e[68]=$,e[69]=T,e[70]=z,e[71]=w.name,e[72]=w.type,e[73]=j,e[74]=N,e[75]=b,e[76]=D):D=e[76];let Z;e[77]!==G||e[78]!==H||e[79]!==D?(Z=t.jsx(Fs,{align:"start",className:"w-80 p-0",onOpenAutoFocus:wa,children:t.jsxs("div",{className:"flex flex-col",children:[G,H,D]})}),e[77]=G,e[78]=H,e[79]=D,e[80]=Z):Z=e[80];let he;return e[81]!==E||e[82]!==Z||e[83]!==F?(he=t.jsxs(Es,{open:F,onOpenChange:g,children:[E,Z]}),e[81]=E,e[82]=Z,e[83]=F,e[84]=he):he=e[84],he}function wa(l){return l.preventDefault()}function Sa(l){const e=q.c(33),{selectedColor:n,onColorChange:s}=l,i=ee(),[a,c]=Q.useState(!1);let r,h,o,m,f,u,d;if(e[0]!==a||e[1]!==n){const S=Vs(n);h=Es,u=a,d=c,r=$s,f=!0,o="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]=a,e[1]=n,e[2]=r,e[3]=h,e[4]=o,e[5]=m,e[6]=f,e[7]=u,e[8]=d}else r=e[2],h=e[3],o=e[4],m=e[5],f=e[6],u=e[7],d=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]!==o||e[14]!==m||e[15]!==p||e[16]!==x?(g=t.jsx("button",{type:o,className:m,title:p,"aria-label":x}),e[13]=o,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=oi.map(S=>t.jsx("button",{type:"button",onClick:()=>{s(S.name),c(!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(Fs,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:Na,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]!==d||e[31]!==b?(v=t.jsxs(h,{open:u,onOpenChange:d,children:[b,j]}),e[27]=h,e[28]=j,e[29]=u,e[30]=d,e[31]=b,e[32]=v):v=e[32],v}function Na(l){return l.preventDefault()}function Ca(l){const e=q.c(55),{search:n,onSearchChange:s,selectedColor:i,onColorChange:a,onSelectIcon:c,onRandom:r,currentIconName:h}=l,o=ee();let m,f,u,d,p,x,g;if(e[0]!==h||e[1]!==a||e[2]!==r||e[3]!==s||e[4]!==c||e[5]!==n||e[6]!==i||e[7]!==o){const S=_s(),C=Vs(i);f=ni(S,n),x="flex flex-col";let k;e[15]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(yt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=k):k=e[15];let w;e[16]!==s?(w=I=>s(I.target.value),e[16]=s,e[17]=w):w=e[17];let N;e[18]!==o?(N=o("common.iconPicker.filterPlaceholder"),e[18]=o,e[19]=N):N=e[19];let M;e[20]!==n||e[21]!==w||e[22]!==N?(M=t.jsxs("div",{className:"relative flex-1",children:[k,t.jsx(Ce,{value:n,onChange:w,placeholder:N,className:"h-8 text-xs pl-7"})]}),e[20]=n,e[21]=w,e[22]=N,e[23]=M):M=e[23];let T;e[24]!==o?(T=o("common.iconPicker.randomIcon"),e[24]=o,e[25]=T):T=e[25];let V;e[26]!==o?(V=o("common.iconPicker.randomIcon"),e[26]=o,e[27]=V):V=e[27];let P;e[28]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(ri,{size:14,className:"text-muted-foreground"}),e[28]=P):P=e[28];let A;e[29]!==r||e[30]!==T||e[31]!==V?(A=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:P}),e[29]=r,e[30]=T,e[31]=V,e[32]=A):A=e[32];let z;e[33]!==a||e[34]!==i?(z=t.jsx(Sa,{selectedColor:i,onColorChange:a}),e[33]=a,e[34]=i,e[35]=z):z=e[35],e[36]!==A||e[37]!==z||e[38]!==M?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[M,A,z]}),e[36]=A,e[37]=z,e[38]=M,e[39]=g):g=e[39],m=_i,p="h-56",u="grid grid-cols-9 gap-0.5 px-2 pb-2",d=f.map(I=>{const $=ii(I);return $?t.jsx("button",{type:"button",onClick:()=>c(I),className:xe("h-8 w-8 flex items-center justify-center rounded-lg transition-colors cursor-pointer",h===I?xe(C.bg,C.text):xe(C.text,"hover:bg-accent")),title:I,"aria-label":li(I),children:t.jsx($,{size:18})},I):null}),e[0]=h,e[1]=a,e[2]=r,e[3]=s,e[4]=c,e[5]=n,e[6]=i,e[7]=o,e[8]=m,e[9]=f,e[10]=u,e[11]=d,e[12]=p,e[13]=x,e[14]=g}else m=e[8],f=e[9],u=e[10],d=e[11],p=e[12],x=e[13],g=e[14];let b;e[40]!==u||e[41]!==d?(b=t.jsx("div",{className:u,children:d}),e[40]=u,e[41]=d,e[42]=b):b=e[42];let y;e[43]!==f.length||e[44]!==o?(y=f.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:o("common.iconPicker.noIconsFound")}),e[43]=f.length,e[44]=o,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 ka(l){const e=q.c(46),{onUpload:n}=l,s=ee(),i=Q.useRef(null);let a;e[0]!==n||e[1]!==s?(a=A=>{const z=A.target.files?.[0];if(!z)return;if(z.size>2097152){re.error(s("common.iconPicker.imageTooLarge")),A.target.value="";return}const I=new FileReader;I.onerror=()=>{re.error(s("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},I.onloadend=()=>{I.readyState===FileReader.DONE&&I.result&&n(I.result),i.current&&(i.current.value="")},I.readAsDataURL(z)},e[0]=n,e[1]=s,e[2]=a):a=e[2];const c=a,[r,h]=Q.useState("");let o;e[3]!==n||e[4]!==r?(o=()=>{const A=r.trim();A&&(n(A),h(""))},e[3]=n,e[4]=r,e[5]=o):o=e[5];const m=o;let f;e[6]!==c?(f=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:c}),e[6]=c,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 d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Vi,{size:20}),e[9]=d):d=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:[d,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=A=>h(A.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 C;e[24]!==m?(C=A=>{A.key==="Enter"&&(A.preventDefault(),m())},e[24]=m,e[25]=C):C=e[25];let k;e[26]!==r||e[27]!==S||e[28]!==C?(k=t.jsx(Ce,{value:r,onChange:v,placeholder:S,className:"h-8 text-xs flex-1",onKeyDown:C}),e[26]=r,e[27]=S,e[28]=C,e[29]=k):k=e[29];let w;e[30]!==r?(w=r.trim(),e[30]=r,e[31]=w):w=e[31];const N=!w;let M;e[32]!==s?(M=s("common.iconPicker.apply"),e[32]=s,e[33]=M):M=e[33];let T;e[34]!==m||e[35]!==N||e[36]!==M?(T=t.jsx(ne,{variant:"outline",size:"sm",className:"h-8 px-3 text-xs shrink-0",onClick:m,disabled:N,children:M}),e[34]=m,e[35]=N,e[36]=M,e[37]=T):T=e[37];let V;e[38]!==k||e[39]!==T?(V=t.jsxs("div",{className:"flex items-center gap-1.5",children:[k,T]}),e[38]=k,e[39]=T,e[40]=V):V=e[40];let P;return e[41]!==j||e[42]!==V||e[43]!==f||e[44]!==x?(P=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]=P):P=e[45],P}function Ma(l){const e=q.c(11),{viewId:n}=l;if(n==="overview"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ts,{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(Kt,{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(ci,{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(Ai,{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(Di,{size:16}),e[4]=i):i=e[4],i}if(n==="releases"){let i;return e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(di,{size:16}),e[5]=i):i=e[5],i}if(n==="hosting"){let i;return e[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ln,{size:16}),e[6]=i):i=e[6],i}if(n==="e2e"){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ui,{size:16}),e[7]=i):i=e[7],i}if(n==="analytics"){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Kt,{size:16}),e[8]=i):i=e[8],i}if(n==="cdn"){let i;return e[9]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(mi,{size:16}),e[9]=i):i=e[9],i}let s;return e[10]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Ds,{size:16}),e[10]=s):s=e[10],s}function os(l){const e=q.c(51),{pinned:n,canSetMainView:s,onOpen:i,onTogglePin:a,onSetMainView:c}=l,r=ee(),h=n?"text-foreground":"text-muted-foreground/40";let o;e[0]!==h?(o=xe("size-7",h),e[0]=h,e[1]=o):o=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(Gt,{size:16}),e[5]=f):f=e[5];let u;e[6]!==a||e[7]!==n||e[8]!==o||e[9]!==m?(u=t.jsx(Se,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:o,"aria-label":m,"aria-pressed":n,onClick:a,children:f})}),e[6]=a,e[7]=n,e[8]=o,e[9]=m,e[10]=u):u=e[10];let d;e[11]!==n||e[12]!==r?(d=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=n,e[12]=r,e[13]=d):d=e[13];let p;e[14]!==d?(p=t.jsx(Ne,{side:"top",children:d}),e[14]=d,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(Ti,{size:16}),e[21]=b):b=e[21];let y;e[22]!==g?(y=t.jsx(hs,{asChild:!0,children:t.jsx(ne,{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(an,{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(We,{onClick:i,children:[j,v]}),e[27]=i,e[28]=v,e[29]=S):S=e[29];let C;e[30]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Gt,{size:14}),e[30]=C):C=e[30];let k;e[31]!==n||e[32]!==r?(k=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=n,e[32]=r,e[33]=k):k=e[33];let w;e[34]!==a||e[35]!==k?(w=t.jsxs(We,{onClick:a,children:[C,k]}),e[34]=a,e[35]=k,e[36]=w):w=e[36];let N;e[37]!==s||e[38]!==c||e[39]!==r?(N=s&&t.jsxs(We,{onClick:c,children:[t.jsx(Ts,{size:14}),r("virtualMcp.settings.views.setMainView")]}),e[37]=s,e[38]=c,e[39]=r,e[40]=N):N=e[40];let M;e[41]!==S||e[42]!==w||e[43]!==N?(M=t.jsxs(xs,{align:"end",children:[S,w,N]}),e[41]=S,e[42]=w,e[43]=N,e[44]=M):M=e[44];let T;e[45]!==y||e[46]!==M?(T=t.jsxs(ps,{children:[y,M]}),e[45]=y,e[46]=M,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 cs=l=>l.stopPropagation();function _a(l){const e=q.c(8),{icon:n,title:s}=l;let i;e[0]!==n||e[1]!==s?(i=t.jsx(He,{icon:n,name:s,size:"xs",className:"shrink-0"}),e[0]=n,e[1]=s,e[2]=i):i=e[2];let a;e[3]!==s?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:s}),e[3]=s,e[4]=a):a=e[4];let c;return e[5]!==i||e[6]!==a?(c=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,a]}),e[5]=i,e[6]=a,e[7]=c):c=e[7],c}function Va(l){const e=q.c(70),{views:n}=l,s=ee();let i;e[0]!==s?(i=s("virtualMcp.settings.views.defaults"),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==s?(a=s("virtualMcp.layoutTabContent.mainView"),e[2]=s,e[3]=a):a=e[3];let c;e[4]!==s?(c=s("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=s,e[5]=c):c=e[5];const r=n.defaultMainView,h=n.setMainView;let o;e[6]!==s?(o=s("virtualMcp.layoutTabContent.mainView"),e[6]=s,e[7]=o):o=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]!==o||e[13]!==f?(u=t.jsx(_e,{"aria-label":o,className:"w-36 h-8 text-sm shrink-0 @min-xl/project-settings:w-44",children:f}),e[12]=o,e[13]=f,e[14]=u):u=e[14];let d;e[15]!==n.defaultMainOptions?(d=n.defaultMainOptions.map(Ta),e[15]=n.defaultMainOptions,e[16]=d):d=e[16];let p;e[17]!==d?(p=t.jsx(Te,{children:d}),e[17]=d,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]!==a||e[26]!==c?(g=t.jsx(Xe,{title:a,description:c,action:x}),e[24]=x,e[25]=a,e[26]=c,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(ut,{"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 C;e[39]!==s||e[40]!==n.noMainView?(C=n.noMainView&&t.jsx(Ne,{side:"top",children:s("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[39]=s,e[40]=n.noMainView,e[41]=C):C=e[41];let k;e[42]!==S||e[43]!==C?(k=t.jsxs(we,{delayDuration:0,children:[S,C]}),e[42]=S,e[43]=C,e[44]=k):k=e[44];let w;e[45]!==b||e[46]!==y||e[47]!==k?(w=t.jsx(Xe,{title:b,description:y,action:k}),e[45]=b,e[46]=y,e[47]=k,e[48]=w):w=e[48];let N;e[49]!==g||e[50]!==w?(N=t.jsxs(Fe,{children:[g,w]}),e[49]=g,e[50]=w,e[51]=N):N=e[51];let M;e[52]!==i||e[53]!==N?(M=t.jsx(Ue,{title:i,children:N}),e[52]=i,e[53]=N,e[54]=M):M=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(Xe,{icon:t.jsx(Ma,{viewId:$}),title:n.labels[$],onClick:()=>n.openView($),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(os,{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(Lt,{size:16})})]})},$)}),e[57]=n,e[58]=V):V=e[58];let P;e[59]!==n?(P=n.connectionsData.flatMap($=>[t.jsx(_a,{icon:$.icon,title:$.title},`${$.id}:header`),...$.uiTools.map(F=>{const K=n.pinnedAppViews.find(_=>_.connectionId===$.id&&_.toolName===F.name),Y=!!K,B=rn($.id,F.name),U=`ext-apps:${$.id}:${F.name}`;return t.jsx(Xe,{onClick:()=>n.openView(B),icon:Y?t.jsx("span",{onClick:cs,children:t.jsx(Qs,{value:K.icon??null,name:K.label||F.name,size:"xs",showHoverOverlay:!1,onChange:_=>n.setAppViewIcon($.id,F.name,_)})}):t.jsx(Ds,{size:16}),title:Y?t.jsx("span",{onClick:cs,children:t.jsx(Ce,{value:K.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(os,{pinned:Y,canSetMainView:Y&&!n.isMainView(U),onOpen:()=>n.openView(B),onTogglePin:()=>n.toggleAppViewPin($.id,F.name),onSetMainView:()=>n.setMainView(U)}),t.jsx("span",{onClick:()=>n.openView(B),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Lt,{size:16})})]})},`${$.id}:${F.name}`)})]),e[59]=n,e[60]=P):P=e[60];let A;e[61]!==V||e[62]!==P?(A=t.jsxs(Fe,{children:[V,P]}),e[61]=V,e[62]=P,e[63]=A):A=e[63];let z;e[64]!==T||e[65]!==A?(z=t.jsx(Ue,{title:T,children:A}),e[64]=T,e[65]=A,e[66]=z):z=e[66];let I;return e[67]!==M||e[68]!==z?(I=t.jsxs(t.Fragment,{children:[M,z]}),e[67]=M,e[68]=z,e[69]=I):I=e[69],I}function Ta(l){return t.jsx(je,{value:l.value,children:l.label},l.value)}const Xs="site-editor",Da=new Set([Xs,"content"]);function Aa({virtualMcpId:l,form:e,flushAndSave:n}){const s=ee(),i=kt(),{openPanel:a}=Yi(),c=Cs(l),r=Ii(c),h=zs(l),o=Wi(l),m=(c?.connections??[]).map(_=>_.connection_id).sort(),{data:f}=bs({queryKey:Mt.projectConnectionDetails(l,m),enabled:m.length>0,queryFn:async()=>await Promise.all(m.map(async E=>{try{const{item:G}=await i.call("COLLECTION_CONNECTIONS_GET",{id:E}),L=(G?.tools??[]).flatMap(R=>{const W=Pi(R._meta);return W?[{name:R.name,title:R.title,description:R.description,resourceUri:W}]:[]});return{fetchOk:!0,id:E,title:G?.title??E,icon:G?.icon??null,uiTools:L}}catch{return{fetchOk:!1,id:E,title:E,icon:null,uiTools:[]}}}))}),u=(f??[]).filter(_=>_.uiTools.length>0),d=new Set([...on,...cn]),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=o??(c?St(Nt(c.metadata),c.metadata.sidebarViewsVersion):y),v=(()=>{if(!g||g.type==="chat")return"";const _=dn(g.type);return _==="instructions"||_==="connections"||_==="layout"?"settings":Da.has(_)?Xs:d.has(_)?_:`${_}:${g.id??""}:${g.toolName??""}`})(),S=v==="",C=_=>{const[E,G,L]=_.split(":");return E?d.has(E)?{type:E}:E==="ext-apps"&&G?{type:"ext-apps",id:G,toolName:L||void 0}:null:null},k=_=>{e.setValue("metadata.ui.pinnedViews",_,{shouldDirty:!0})},w=_=>{e.setValue("metadata.ui.layout",{...x,..._},{shouldDirty:!0})},N=Q.useRef(!1);if(f&&f.length>0&&!N.current){N.current=!0;const _=new Set((f??[]).filter(R=>R.fetchOk).map(R=>R.id)),E=new Set(u.flatMap(R=>R.uiTools.map(W=>`${R.id}:${W.name}`))),G=new Set(m),L=p.filter(R=>G.has(R.connectionId)&&(!_.has(R.connectionId)||E.has(`${R.connectionId}:${R.toolName}`)));L.length!==p.length&&(k(L),g?.type==="ext-apps"&&!L.some(R=>R.connectionId===g.id&&R.toolName===g.toolName)&&w({defaultMainView:{type:"settings"}}))}const M=(_,E)=>{if(p.some(L=>L.connectionId===_&&L.toolName===E)){const L=p.filter(W=>!(W.connectionId===_&&W.toolName===E));k(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;k([...p,{connectionId:_,toolName:E,label:L??wt(E),icon:null}])}n()},T=(_,E,G)=>{k(p.map(L=>L.connectionId===_&&L.toolName===E?{...L,label:G}:L))},V=()=>{n()},P=(_,E,G)=>{k(p.map(L=>L.connectionId===_&&L.toolName===E?{...L,icon:G}:L)),n()},A=_=>{w({defaultMainView:C(_)}),n()},z=(_,E)=>{const G=Ei(j,_,E,1);e.setValue("metadata.sidebarViews",G,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),h.stage(G,j);const L=zi(g,_,E);L!==g&&w({defaultMainView:L})},I=rt(c?.metadata),$=Oi(I,r.presence),F=$i($),K=Fi(j,$,1),Y={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"),releases:s("common.mainPanelTabs.releases"),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")},B=[];for(const _ of K)_!=="automations"&&B.push({value:_,label:Y[_]});for(const _ of p)B.push({value:`ext-apps:${_.connectionId}:${_.toolName}`,label:_.label||_.toolName});return K.includes("automations")&&B.push({value:"automations",label:Y.automations}),B.push({value:"settings",label:s("virtualMcp.layoutTabContent.settings")}),{projectViews:F,labels:Y,pinned:_=>j.includes(_),isMainView:_=>v===_,defaultMainView:v,defaultMainOptions:B,noMainView:S,chatDefaultOpen:b,connectionsData:u,pinnedAppViews:p,openView:_=>a(_,{virtualmcpid:l}),togglePin:(_,E)=>z(_,E),setMainView:A,setChatDefaultOpen:_=>{w({chatDefaultOpen:_}),n()},toggleAppViewPin:M,setAppViewIcon:P,setAppViewLabel:T,commitAppViewLabel:V}}function Pa(l){const e=q.c(55),{form:n,onCommit:s}=l,i=ee(),a=Q.useId();let c;e[0]!==i?(c=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==c?(r=t.jsx("p",{className:"text-sm font-medium",children:c}),e[2]=c,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 o;e[6]!==h?(o=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:h}),e[6]=h,e[7]=o):o=e[7];let m;e[8]!==r||e[9]!==o?(m=t.jsxs("div",{children:[r,o]}),e[8]=r,e[9]=o,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(Qs,{value:V.value??null,onChange:P=>{V.onChange(P),s()},onColorChange:P=>{n.setValue("metadata.ui.themeColor",P,{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(ve,{name:"icon",control:n.control,render:f}),e[15]=n.control,e[16]=f,e[17]=u):u=e[17];let d;e[18]!==m||e[19]!==u?(d=t.jsxs(be,{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]=d):d=e[20];const p=`${a}-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]!==a||e[27]!==s||e[28]!==i?(b=T=>{const{field:V}=T;return t.jsx(Ce,{...V,id:`${a}-name`,value:V.value??"",onBlur:()=>{V.onBlur(),s()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=a,e[27]=s,e[28]=i,e[29]=b):b=e[29];let y;e[30]!==n.control||e[31]!==b?(y=t.jsx(ve,{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(be,{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=`${a}-description`;let S;e[36]!==i?(S=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=S):S=e[37];let C;e[38]!==v||e[39]!==S?(C=t.jsx("label",{htmlFor:v,className:"text-sm font-medium",children:S}),e[38]=v,e[39]=S,e[40]=C):C=e[40];let k;e[41]!==a||e[42]!==s||e[43]!==i?(k=T=>{const{field:V}=T;return t.jsx(at,{...V,id:`${a}-description`,value:V.value??"",onBlur:()=>{V.onBlur(),s()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=a,e[42]=s,e[43]=i,e[44]=k):k=e[44];let w;e[45]!==n.control||e[46]!==k?(w=t.jsx(ve,{name:"description",control:n.control,render:k}),e[45]=n.control,e[46]=k,e[47]=w):w=e[47];let N;e[48]!==C||e[49]!==w?(N=t.jsxs(be,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[C,w]}),e[48]=C,e[49]=w,e[50]=N):N=e[50];let M;return e[51]!==j||e[52]!==N||e[53]!==d?(M=t.jsxs(Fe,{children:[d,j,N]}),e[51]=j,e[52]=N,e[53]=d,e[54]=M):M=e[54],M}const Js=["general","connections","site"],Ia={general:{icon:pi,titleKey:"virtualMcp.settings.general.title",descriptionKey:"virtualMcp.settings.general.description"},connections:{icon:Qi,titleKey:"virtualMcp.settings.connections.title",descriptionKey:"virtualMcp.settings.connections.description"},site:{icon:fi,titleKey:"virtualMcp.settings.site.title",descriptionKey:"virtualMcp.settings.site.description"}};function Oa(l){return!!l&&Js.includes(l)}function $a(l){const e=q.c(8),{section:n}=l,s=ee();let i;e[0]!==s?(i=s("virtualMcp.settings.navigation"),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n||e[3]!==s?(a=Js.map(r=>{const{titleKey:h}=Ia[r];return t.jsx(Re.Tab,{active:n===r,asChild:!0,children:t.jsx(vs,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:o=>({...o,section:r==="general"?void 0:r}),children:s(h)})},r)}),e[2]=n,e[3]=s,e[4]=a):a=e[4];let c;if(e[5]!==i||e[6]!==a){const r=t.jsx(Re.Tabs,{"aria-label":i,children:a});c=t.jsx(un.Toolbar.Left.Portal,{fallback:r,children:r}),e[5]=i,e[6]=a,e[7]=c}else c=e[7];return c}function Fa(){const l=q.c(8),e=_t();let n;l[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},l[0]=n):n=l[0];const{section:s}=mn(n);let i;l[1]!==s?(i=Oa(s)?s:"general",l[1]=s,l[2]=i):i=l[2];let a;l[3]!==e?(a=r=>e({to:".",search:h=>({...h,section:r??void 0})}),l[3]=e,l[4]=a):a=l[4];let c;return l[5]!==i||l[6]!==a?(c={section:i,openSection:a},l[5]=i,l[6]=a,l[7]=c):c=l[7],c}function Zs(l){const e=q.c(20),{value:n,label:s,copiedLabel:i,variant:a,size:c,className:r,copiedClassName:h}=l,o=a===void 0?"ghost":a,m=c===void 0?"icon-sm":c,{handleCopy:f,copied:u}=Ji();let d;e[0]!==f||e[1]!==n?(d=()=>{f(n).catch(Ea)},e[0]=f,e[1]=n,e[2]=d):d=e[2];const p=u&&h;let x;e[3]!==r||e[4]!==p?(x=xe(r,p),e[3]=r,e[4]=p,e[5]=x):x=e[5];let g;e[6]!==u?(g=u?t.jsx(nt,{className:"text-success"}):t.jsx(mt,{}),e[6]=u,e[7]=g):g=e[7];let b;e[8]!==s||e[9]!==m||e[10]!==d||e[11]!==x||e[12]!==g||e[13]!==o?(b=t.jsx(ne,{type:"button",variant:o,size:m,"aria-label":s,onClick:d,className:x,children:g}),e[8]=s,e[9]=m,e[10]=d,e[11]=x,e[12]=g,e[13]=o,e[14]=b):b=e[14];const y=u?i:"";let j;e[15]!==y?(j=t.jsx("span",{className:"sr-only","aria-live":"polite",children:y}),e[15]=y,e[16]=j):j=e[16];let v;return e[17]!==b||e[18]!==j?(v=t.jsxs(t.Fragment,{children:[b,j]}),e[17]=b,e[18]=j,e[19]=v):v=e[19],v}function Ea(){}function za(l){const e=q.c(14),{id:n,value:s,copyLabel:i,copiedLabel:a,className:c}=l;let r;e[0]!==c?(r=xe("relative h-fit",c),e[0]=c,e[1]=r):r=e[1];let h;e[2]!==n||e[3]!==s?(h=t.jsx(Ce,{id:n,value:s,readOnly:!0,disabled:!0,className:"pr-10 font-mono"}),e[2]=n,e[3]=s,e[4]=h):h=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=xe("absolute top-1/2 right-1 -translate-y-1/2 transition-opacity","opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100 pointer-coarse:opacity-100"),e[5]=o):o=e[5];let m;e[6]!==a||e[7]!==i||e[8]!==s?(m=t.jsx(Zs,{value:s,label:i,copiedLabel:a,className:o,copiedClassName:"opacity-100"}),e[6]=a,e[7]=i,e[8]=s,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==h||e[12]!==m?(f=t.jsxs("div",{className:r,children:[h,m]}),e[10]=r,e[11]=h,e[12]=m,e[13]=f):f=e[13],f}async function ds(l){const e=await l.json().catch(()=>({}));if(!l.ok)throw new Error(e.error??`HTTP ${l.status}`);return e}function Ra(l){const e=q.c(106),{orgSlug:n,virtualMcpId:s}=l,i=ee(),a=js(),c=`/api/${n}/hosted/${encodeURIComponent(s)}/site-tokens`;let r;e[0]!==n||e[1]!==s?(r=Mt.hostedSiteTokens(n,s),e[0]=n,e[1]=s,e[2]=r):r=e[2];const h=r,[o,m]=Q.useState(null),f=Q.useId();let u;e[3]!==c?(u=async()=>ds(await fetch(c)),e[3]=c,e[4]=u):u=e[4];let d;e[5]!==h||e[6]!==u?(d={queryKey:h,queryFn:u},e[5]=h,e[6]=u,e[7]=d):d=e[7];const p=bs(d);let x;e[8]!==c?(x=async()=>ds(await fetch(c,{method:"POST"})),e[8]=c,e[9]=x):x=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=H=>{const{token:D}=H;return m(D)},e[10]=g):g=e[10];let b;e[11]!==h||e[12]!==a?(b=()=>a.invalidateQueries({queryKey:h}),e[11]=h,e[12]=a,e[13]=b):b=e[13];let y;e[14]!==x||e[15]!==b?(y={mutationFn:x,onSuccess:g,onError:La,onSettled:b},e[14]=x,e[15]=b,e[16]=y):y=e[16];const j=fn(y);let v;e[17]!==p.data?.tokens?(v=p.data?.tokens??[],e[17]=p.data?.tokens,e[18]=v):v=e[18];const S=v,C=p.data?.site;let k;e[19]!==i?(k=i("siteTokens.title"),e[19]=i,e[20]=k):k=e[20];let w;e[21]!==i?(w=i("siteTokens.description"),e[21]=i,e[22]=w):w=e[22];let N;e[23]!==i?(N=i("siteTokens.siteId"),e[23]=i,e[24]=N):N=e[24];let M;e[25]!==f||e[26]!==N?(M=t.jsx("label",{htmlFor:f,className:"text-sm font-medium",children:N}),e[25]=f,e[26]=N,e[27]=M):M=e[27];let T;e[28]!==i?(T=i("siteTokens.siteIdDescription"),e[28]=i,e[29]=T):T=e[29];let V;e[30]!==T?(V=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:T}),e[30]=T,e[31]=V):V=e[31];let P;e[32]!==C||e[33]!==f||e[34]!==i?(P=C?t.jsx(za,{id:f,value:C,copyLabel:i("siteTokens.copySiteId"),copiedLabel:i("siteTokens.siteIdCopied"),className:"min-w-0 flex-1"}):t.jsx("p",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:"—"}),e[32]=C,e[33]=f,e[34]=i,e[35]=P):P=e[35];const A=!p.data||j.isPending;let z;e[36]!==j?(z=()=>j.mutate(),e[36]=j,e[37]=z):z=e[37];let I;e[38]!==j.isPending?(I=j.isPending?t.jsx(et,{className:"size-3.5"}):t.jsx(Ie,{size:14}),e[38]=j.isPending,e[39]=I):I=e[39];let $;e[40]!==i?($=i("siteTokens.issue"),e[40]=i,e[41]=$):$=e[41];let F;e[42]!==A||e[43]!==z||e[44]!==I||e[45]!==$?(F=t.jsxs(ne,{type:"button",size:"sm",className:"shrink-0",disabled:A,onClick:z,children:[I,$]}),e[42]=A,e[43]=z,e[44]=I,e[45]=$,e[46]=F):F=e[46];let K;e[47]!==P||e[48]!==F?(K=t.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[P,F]}),e[47]=P,e[48]=F,e[49]=K):K=e[49];let Y;e[50]!==M||e[51]!==V||e[52]!==K?(Y=t.jsxs(be,{className:"group",children:[M,V,K]}),e[50]=M,e[51]=V,e[52]=K,e[53]=Y):Y=e[53];let B;e[54]!==p.error||e[55]!==p.isError?(B=p.isError?t.jsx(be,{children:t.jsx("p",{className:"text-xs text-destructive",children:p.error.message})}):null,e[54]=p.error,e[55]=p.isError,e[56]=B):B=e[56];let U;if(e[57]!==i||e[58]!==S){let H;e[60]!==i?(H=D=>t.jsx(be,{children:t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsx(At,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate font-mono text-xs",children:D.kid}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("siteTokens.issuedAgo",{when:Xi(new Date(D.iat*1e3))})})]})]})},D.kid),e[60]=i,e[61]=H):H=e[61],U=S.map(H),e[57]=i,e[58]=S,e[59]=U}else U=e[59];let _;e[62]!==Y||e[63]!==B||e[64]!==U?(_=t.jsxs(Fe,{children:[Y,B,U]}),e[62]=Y,e[63]=B,e[64]=U,e[65]=_):_=e[65];const E=o!==null;let G;e[66]===Symbol.for("react.memo_cache_sentinel")?(G=H=>!H&&m(null),e[66]=G):G=e[66];let L;e[67]!==i?(L=i("siteTokens.createdTitle"),e[67]=i,e[68]=L):L=e[68];let R;e[69]!==L?(R=t.jsx(st,{children:L}),e[69]=L,e[70]=R):R=e[70];let W;e[71]!==i?(W=i("siteTokens.createdDescription"),e[71]=i,e[72]=W):W=e[72];let X;e[73]!==W?(X=t.jsx(ys,{children:W}),e[73]=W,e[74]=X):X=e[74];let ie;e[75]!==R||e[76]!==X?(ie=t.jsxs(tt,{children:[R,X]}),e[75]=R,e[76]=X,e[77]=ie):ie=e[77];let J;e[78]!==i?(J=i("siteTokens.createdTitle"),e[78]=i,e[79]=J):J=e[79];const oe=o??"";let le;e[80]!==J||e[81]!==oe?(le=t.jsx(Ce,{readOnly:!0,"aria-label":J,value:oe,className:"font-mono text-xs"}),e[80]=J,e[81]=oe,e[82]=le):le=e[82];let ce;e[83]!==o||e[84]!==i?(ce=o?t.jsx(Zs,{value:o,label:i("siteTokens.copy"),copiedLabel:i("siteTokens.copied"),variant:"outline",size:"icon",className:"shrink-0"}):null,e[83]=o,e[84]=i,e[85]=ce):ce=e[85];let te;e[86]!==le||e[87]!==ce?(te=t.jsxs("div",{className:"flex items-center gap-2",children:[le,ce]}),e[86]=le,e[87]=ce,e[88]=te):te=e[88];let ue;e[89]===Symbol.for("react.memo_cache_sentinel")?(ue=()=>m(null),e[89]=ue):ue=e[89];let fe;e[90]!==i?(fe=i("siteTokens.done"),e[90]=i,e[91]=fe):fe=e[91];let pe;e[92]!==fe?(pe=t.jsx(Ct,{children:t.jsx(ne,{onClick:ue,children:fe})}),e[92]=fe,e[93]=pe):pe=e[93];let me;e[94]!==ie||e[95]!==te||e[96]!==pe?(me=t.jsxs(qe,{className:"sm:max-w-lg",children:[ie,te,pe]}),e[94]=ie,e[95]=te,e[96]=pe,e[97]=me):me=e[97];let O;e[98]!==E||e[99]!==me?(O=t.jsx(Ge,{open:E,onOpenChange:G,children:me}),e[98]=E,e[99]=me,e[100]=O):O=e[100];let se;return e[101]!==w||e[102]!==_||e[103]!==O||e[104]!==k?(se=t.jsxs(Ue,{title:k,description:w,children:[_,O]}),e[101]=w,e[102]=_,e[103]=O,e[104]=k,e[105]=se):se=e[105],se}function La(l){return re.error(l.message)}function Ua(l){const e=q.c(8),{control:n,previewServerUrl:s}=l,i=ee();let a;e[0]!==s?(a=Rs(s),e[0]=s,e[1]=a):a=e[1];const c=!!a;let r;e[2]!==c||e[3]!==i?(r=o=>{const{field:m}=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(ye,{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(c?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(ut,{id:"fast-preview",className:"shrink-0",checked:!!m.value&&c,disabled:!c,onCheckedChange:f=>m.onChange(f)})]})},e[2]=c,e[3]=i,e[4]=r):r=e[4];let h;return e[5]!==n||e[6]!==r?(h=t.jsx(ve,{control:n,name:"metadata.fastPreview",render:r}),e[5]=n,e[6]=r,e[7]=h):h=e[7],h}function Ba(l){const e=q.c(5),{control:n,fastPreview:s}=l,i=ee();if(!s)return null;let a;e[0]!==i?(a=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(ye,{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(ut,{id:"fast-preview-in-place",className:"shrink-0",checked:!!h.value,onCheckedChange:o=>h.onChange(o)})]})},e[0]=i,e[1]=a):a=e[1];let c;return e[2]!==n||e[3]!==a?(c=t.jsx(ve,{control:n,name:"metadata.fastPreviewInPlace",render:a}),e[2]=n,e[3]=a,e[4]=c):c=e[4],c}function Ya(l){const e=q.c(18),{control:n,isBlocksV8:s}=l,i=s===void 0?!1:s,a=ee();let c;e[0]!==a?(c=a("sandbox.previewServerUrlField.label"),e[0]=a,e[1]=c):c=e[1];let r;e[2]!==c?(r=t.jsx(ye,{htmlFor:"preview-server-url",children:c}),e[2]=c,e[3]=r):r=e[3];let h;e[4]!==a?(h=p=>{const{field:x}=p,g=x.value??"";return t.jsx(Ce,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:a("sandbox.previewServerUrlField.placeholder"),value:g,onChange:b=>x.onChange(b.target.value===""?null:b.target.value),onBlur:()=>{x.onChange(Zi(g)),x.onBlur()}})},e[4]=a,e[5]=h):h=e[5];let o;e[6]!==n||e[7]!==h?(o=t.jsx(ve,{control:n,name:"metadata.previewServerUrl",render:h}),e[6]=n,e[7]=h,e[8]=o):o=e[8];const m=i?"sandbox.previewServerUrlField.descriptionBlocksV8":"sandbox.previewServerUrlField.description";let f;e[9]!==a||e[10]!==m?(f=a(m),e[9]=a,e[10]=m,e[11]=f):f=e[11];let u;e[12]!==f?(u=t.jsx("p",{className:"text-xs text-muted-foreground",children:f}),e[12]=f,e[13]=u):u=e[13];let d;return e[14]!==r||e[15]!==o||e[16]!==u?(d=t.jsxs("div",{className:"space-y-2",children:[r,o,u]}),e[14]=r,e[15]=o,e[16]=u,e[17]=d):d=e[17],d}function Wa(l){const e=q.c(15),{control:n,isBlocksV8:s,previewServerUrl:i,fastPreview:a}=l,c=ee(),r=s||!!a;let h;e[0]!==n||e[1]!==s?(h=t.jsx(be,{children:t.jsx(Ya,{control:n,isBlocksV8:s})}),e[0]=n,e[1]=s,e[2]=h):h=e[2];let o;e[3]!==n||e[4]!==s||e[5]!==i||e[6]!==c?(o=s?!Rs(i)&&t.jsx(be,{children:t.jsx("p",{className:"text-xs text-muted-foreground",children:c("sandbox.cmsSettings.blocksV8.needsPreviewServerUrl")})}):t.jsx(be,{children:t.jsx(Ua,{control:n,previewServerUrl:i})}),e[3]=n,e[4]=s,e[5]=i,e[6]=c,e[7]=o):o=e[7];let m;e[8]!==n||e[9]!==r?(m=r&&t.jsx(be,{children:t.jsx(Ba,{control:n,fastPreview:r})}),e[8]=n,e[9]=r,e[10]=m):m=e[10];let f;return e[11]!==h||e[12]!==o||e[13]!==m?(f=t.jsxs(t.Fragment,{children:[h,o,m]}),e[11]=h,e[12]=o,e[13]=m,e[14]=f):f=e[14],f}const bt={tools:null,resources:null,prompts:null},Ka=tl.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function Ga(l){const n=new TextEncoder().encode(l),s=Array.from(n,i=>String.fromCharCode(i)).join("");return btoa(s)}function en(l){return{"x-studio-client":l,"x-mesh-client":l}}function qa(l){const e=q.c(15),{url:n,agentId:s}=l,i=ee(),[a,c]=Q.useState(!1);let r;e[0]!==s||e[1]!==i||e[2]!==n?(r=async()=>{ke("agent_connect_action",{agent_id:s,action:"copy_url"}),await navigator.clipboard.writeText(n),c(!0),re.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await pt(2e3),c(!1)},e[0]=s,e[1]=i,e[2]=n,e[3]=r):r=e[3];const h=r;let o;e[4]!==a?(o=a?t.jsx(nt,{size:20,className:"text-success"}):t.jsx(mt,{size:20}),e[4]=a,e[5]=o):o=e[5];let m;e[6]!==a||e[7]!==i?(m=i(a?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=a,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]!==o||e[13]!==f?(u=t.jsxs(ne,{type:"button",variant:"outline",onClick:h,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[o,f]}),e[11]=h,e[12]=o,e[13]=f,e[14]=u):u=e[14],u}function Ha(l){const e=q.c(13),{url:n,serverName:s,agentId:i}=l,a=ee();let c;e[0]!==i||e[1]!==s||e[2]!==a||e[3]!==n?(c=()=>{ke("agent_connect_action",{agent_id:i,action:"install_cursor"});const u=Us(s),d={type:"http",url:n,headers:en("Cursor")},p=Ga(JSON.stringify(d,null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(u)}&config=${encodeURIComponent(p)}`;window.open(x,"_blank"),re.success(a("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=s,e[2]=a,e[3]=n,e[4]=c):c=e[4];const r=c;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 o;e[6]!==a?(o=a("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=a,e[7]=o):o=e[7];let m;e[8]!==o?(m=t.jsx("span",{className:"text-xs font-medium",children:o}),e[8]=o,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m?(f=t.jsxs(ne,{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 Qa(l){const e=q.c(16),{url:n,serverName:s,agentId:i}=l,a=ee(),[c,r]=Q.useState(!1);let h;e[0]!==i||e[1]!==s||e[2]!==a||e[3]!==n?(h=async()=>{ke("agent_connect_action",{agent_id:i,action:"install_claude_code"});const p=Us(s),x={type:"http",url:n,headers:en("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(a("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await pt(2e3),r(!1)},e[0]=i,e[1]=s,e[2]=a,e[3]=n,e[4]=h):h=e[4];const o=h;let m;e[5]!==c?(m=c?t.jsx(nt,{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]=c,e[6]=m):m=e[6];let f;e[7]!==c||e[8]!==a?(f=a(c?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=c,e[8]=a,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 d;return e[12]!==o||e[13]!==m||e[14]!==u?(d=t.jsxs(ne,{type:"button",variant:"outline",onClick:o,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[m,u]}),e[12]=o,e[13]=m,e[14]=u,e[15]=d):d=e[15],d}const Xa=720*60*60;function Ja({virtualMcp:l}){const e=ee(),n=kt(),[s,i]=Q.useState(null),[a,c]=Q.useState(!1),[r,h]=Q.useState(!1),o=l.id,m=l.title||`agent-${o.slice(0,8)}`,f=s?`bunx @decocms/typegen@latest --mcp ${o} --key ${s} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${o} --key <api-key> --output client.ts`,u=async()=>{c(!0);try{const{key:p}=await n.call("API_KEY_CREATE",{name:`typegen-${m}`,permissions:{[o]:["*"]},expiresIn:Xa});if(!p)throw new Error("No key in response");i(p),ke("agent_typegen_key_generated",{agent_id:o})}catch{ke("agent_typegen_key_failed",{agent_id:o}),re.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{c(!1)}},d=async()=>{ke("agent_connect_action",{agent_id:o,action:"typegen_copy_command",has_api_key:!!s}),await navigator.clipboard.writeText(f),h(!0),re.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await pt(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(ne,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:u,disabled:a,children:[a?t.jsx(et,{className:"size-3.5"}):t.jsx(At,{size:14}),t.jsx("span",{children:e(a?"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(ne,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:d,children:r?t.jsx(nt,{size:12,className:"text-success"}):t.jsx(mt,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx(Za,{apiKey:s,agentId:o})]})}function Za(l){const e=q.c(21),{apiKey:n,agentId:s}=l,[i,a]=Q.useState(!1),c=window.location.origin,r=n?`STUDIO_API_KEY=${n}`:"STUDIO_API_KEY=<api-key>",h=`STUDIO_BASE_URL=${c}`,o=`${r}
|
|
2
2
|
${h}`;let m;e[0]!==s||e[1]!==n||e[2]!==o?(m=async()=>{ke("agent_connect_action",{agent_id:s,action:"typegen_copy_env",has_api_key:!!n}),await navigator.clipboard.writeText(o),a(!0),await pt(2e3),a(!1)},e[0]=s,e[1]=n,e[2]=o,e[3]=m):m=e[3];const f=m,u=!n;let d;e[4]!==u?(d=xe({"opacity-50":u}),e[4]=u,e[5]=d):d=e[5];let p;e[6]!==r||e[7]!==d?(p=t.jsx("span",{className:d,children:r}),e[6]=r,e[7]=d,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(nt,{size:12,className:"text-success"}):t.jsx(mt,{size:12}),e[13]=i,e[14]=y):y=e[14];let j;e[15]!==f||e[16]!==y?(j=t.jsx(ne,{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 er(l){const e=q.c(3),{virtualMcp:n}=l;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(Q.Suspense,{fallback:s,children:t.jsx(Ja,{virtualMcp:n})}),e[1]=n,e[2]=i):i=e[2],i}function tr(l){const e=q.c(45),{open:n,onOpenChange:s,virtualMcp:i}=l,a=ee(),{org:c}=Oe(),r=`/api/${c.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 o=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=rl();let d;e[5]!==i.id||e[6]!==o.href?(d=t.jsx(qa,{url:o.href,agentId:i.id}),e[5]=i.id,e[6]=o.href,e[7]=d):d=e[7];let p,x;e[8]!==f||e[9]!==i.id||e[10]!==o.href?(p=t.jsx(Ha,{url:o.href,serverName:f,agentId:i.id}),x=t.jsx(Qa,{url:o.href,serverName:f,agentId:i.id}),e[8]=f,e[9]=i.id,e[10]=o.href,e[11]=p,e[12]=x):(p=e[11],x=e[12]);let g;e[13]!==d||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:[d,p,x]})}),e[13]=d,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(er,{virtualMcp:i}),e[18]=i,e[19]=y):y=e[19];let j;e[20]!==g||e[21]!==y?(j=t.jsxs("div",{className:"flex flex-col gap-6",children:[g,b,y]}),e[20]=g,e[21]=y,e[22]=j):j=e[22];const v=j;if(u){let N;e[23]!==a?(N=a("virtualMcp.virtualMcpShareModal.connect"),e[23]=a,e[24]=N):N=e[24];let M;e[25]!==N?(M=t.jsx(il,{className:"mt-4 mb-4 text-base font-semibold",children:N}),e[25]=N,e[26]=M):M=e[26];let T;e[27]!==v||e[28]!==M?(T=t.jsx(ll,{children:t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-6 [touch-action:pan-y]",children:[M,v]})}),e[27]=v,e[28]=M,e[29]=T):T=e[29];let V;return e[30]!==s||e[31]!==n||e[32]!==T?(V=t.jsx(al,{open:n,onOpenChange:s,children:T}),e[30]=s,e[31]=n,e[32]=T,e[33]=V):V=e[33],V}let S;e[34]!==a?(S=a("virtualMcp.virtualMcpShareModal.connect"),e[34]=a,e[35]=S):S=e[35];let C;e[36]!==S?(C=t.jsx(tt,{children:t.jsx(st,{children:S})}),e[36]=S,e[37]=C):C=e[37];let k;e[38]!==v||e[39]!==C?(k=t.jsxs(qe,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[C,v]}),e[38]=v,e[39]=C,e[40]=k):k=e[40];let w;return e[41]!==s||e[42]!==n||e[43]!==k?(w=t.jsx(Ge,{open:n,onOpenChange:s,children:k}),e[41]=s,e[42]=n,e[43]=k,e[44]=w):w=e[44],w}function sr(l){const e=q.c(50),{virtualMcp:n}=l,s=ee(),i=Ns(),a=ks(),[c,r]=Q.useState(!1);let h,o,m,f,u,d,p,x,g;if(e[0]!==a||e[1]!==i||e[2]!==s||e[3]!==n.id||e[4]!==n.metadata){g=Symbol.for("react.early_return_sentinel");e:{const k=Ri(i);if(pn(n.id)||rt(n.metadata)||k.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 N=w,M=N?.id??null;let T;e[17]!==a.update?(T=(F,K)=>a.update.mutateAsync({id:F,data:{metadata:{liveAgentId:K}}}).catch(ir),e[17]=a.update,e[18]=T):T=e[18];const V=T;let P;e[19]!==V||e[20]!==n.id?(P=F=>{V(F,n.id)},e[19]=V,e[20]=n.id,e[21]=P):P=e[21],m=P;let A;e[22]!==M||e[23]!==V?(A=()=>{M&&V(M,null)},e[22]=M,e[23]=V,e[24]=A):A=e[24];const z=A,I=(i??[]).filter(F=>F.id!==n.id&&rt(F.metadata)&&!k.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],o=xn,d="p-6 gap-4",h=gn,f="p-0 space-y-4",u=M?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:N?N.title:M}),t.jsx("span",{className:"text-xs text-muted-foreground",children:s("devAgent.devAgentSetup.linkedDescription")})]}),t.jsx(ne,{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(ne,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>r(!0),children:[t.jsx(hn,{className:"size-4"}),s("devAgent.devAgentSetup.importButton")]}),I.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:I.map(nr)})]}):null]})]})}e[0]=a,e[1]=i,e[2]=s,e[3]=n.id,e[4]=n.metadata,e[5]=h,e[6]=o,e[7]=m,e[8]=f,e[9]=u,e[10]=d,e[11]=p,e[12]=x,e[13]=g}else h=e[5],o=e[6],m=e[7],f=e[8],u=e[9],d=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]!==o||e[34]!==d||e[35]!==b?(y=t.jsx(o,{className:d,children:b}),e[33]=o,e[34]=d,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=k=>{const{virtualMcpId:w}=k;r(!1),w&&m(w)},e[39]=m,e[40]=v):v=e[40];let S;e[41]!==c||e[42]!==v||e[43]!==j?(S=t.jsx(ol,{open:c,onOpenChange:r,title:j,onImportComplete:v}),e[41]=c,e[42]=v,e[43]=j,e[44]=S):S=e[44];let C;return e[45]!==S||e[46]!==p||e[47]!==x||e[48]!==y?(C=t.jsxs("div",{className:p,children:[x,y,S]}),e[45]=S,e[46]=p,e[47]=x,e[48]=y,e[49]=C):C=e[49],C}function nr(l){return t.jsx(je,{value:l.id,children:l.title},l.id)}function ir(){}const lr=/^[A-Za-z_][A-Za-z0-9_]*$/;function ar(l){const e={},n=l.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 a=i.indexOf("=");if(a<0)throw new Error(`Line ${s+1}: missing '='`);const c=i.slice(0,a).trim();if(!lr.test(c))throw new Error(`Line ${s+1}: invalid key "${c}"`);let r=i.slice(a+1).trim();r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),e[c]=r}return e}function rr(l){const e=q.c(28),{control:n,form:s,virtualMcpId:i,orgSlug:a,sandboxMap:c}=l,r=ee();let h;e[0]!==r?(h=r("sandbox.envVarsField.title"),e[0]=r,e[1]=h):h=e[1];let o;e[2]!==h?(o=t.jsx("div",{className:"flex items-baseline justify-between gap-2",children:t.jsx(ye,{className:"font-normal text-foreground",children:h})}),e[2]=h,e[3]=o):o=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]!==a||e[11]!==c||e[12]!==i?(u=t.jsx(or,{control:n,form:s,virtualMcpId:i,orgSlug:a,sandboxMap:c}),e[8]=n,e[9]=s,e[10]=a,e[11]=c,e[12]=i,e[13]=u):u=e[13];let d;e[14]!==r?(d=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]=d):d=e[15];let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(vn,{className:"h-9 w-full"}),e[16]=p):p=e[16];let x;e[17]!==n||e[18]!==s?(x=t.jsx(Q.Suspense,{fallback:p,children:t.jsx(dr,{control:n,form:s})}),e[17]=n,e[18]=s,e[19]=x):x=e[19];let g;e[20]!==d||e[21]!==x?(g=t.jsx(Le,{fallback:d,children:x}),e[20]=d,e[21]=x,e[22]=g):g=e[22];let b;return e[23]!==o||e[24]!==f||e[25]!==u||e[26]!==g?(b=t.jsxs("div",{className:"space-y-2",children:[o,f,u,g]}),e[23]=o,e[24]=f,e[25]=u,e[26]=g,e[27]=b):b=e[27],b}function or(l){const e=q.c(33),{control:n,form:s,virtualMcpId:i,orgSlug:a,sandboxMap:c}=l,r=ee(),o=bn.useSession().data?.user?.id,m="metadata.runtime.env";let f;e[0]!==s?(f=()=>JSON.stringify(us(s.getValues(m))),e[0]=s,e[1]=f):f=e[1];const[u,d]=Q.useState(f);let p;e[2]!==n?(p={control:n,name:m},e[2]=n,e[3]=p):p=e[3];const x=ws(p);let g;e[4]!==x?(g=JSON.stringify(us(x)),e[4]=x,e[5]=g):g=e[5];const b=g,y=b!==u;let j;e[6]!==c||e[7]!==o?(j=o?Object.keys(c?.[o]??{}):[],e[6]=c,e[7]=o,e[8]=j):j=e[8];const v=j,S=v.length>0,[C,k]=Q.useState(!1);if(!y||!S)return null;let w;e[9]!==b||e[10]!==a||e[11]!==r||e[12]!==v||e[13]!==i?(w=async()=>{k(!0);const $=await Promise.allSettled(v.map(async K=>{const Y=cl({orgSlug:a,virtualMcpId:i,branch:K,threadId:null},"setup/start"),B=await fetch(Y,{method:"POST"});if(!B.ok){const U=await B.text().catch(()=>B.statusText);throw new Error(U||B.statusText)}}));k(!1);const F=$.filter(cr).length;F===0?(d(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]=a,e[11]=r,e[12]=v,e[13]=i,e[14]=w):w=e[14];const N=w;let M;e[15]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(gs,{className:"size-3.5 shrink-0"}),e[15]=M):M=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:[M,t.jsx("span",{className:"truncate",children:T})]}),e[18]=T,e[19]=V):V=e[19];let P;e[20]!==C?(P=C?t.jsx(et,{className:"size-3.5"}):t.jsx(yn,{className:"size-3.5"}),e[20]=C,e[21]=P):P=e[21];let A;e[22]!==C||e[23]!==r?(A=r(C?"sandbox.envVarsField.restarting":"sandbox.envVarsField.restartDev"),e[22]=C,e[23]=r,e[24]=A):A=e[24];let z;e[25]!==N||e[26]!==C||e[27]!==A||e[28]!==P?(z=t.jsxs(ne,{type:"button",variant:"outline",size:"sm",onClick:N,disabled:C,className:"shrink-0",children:[P,A]}),e[25]=N,e[26]=C,e[27]=A,e[28]=P,e[29]=z):z=e[29];let I;return e[30]!==z||e[31]!==V?(I=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]=I):I=e[32],I}function cr(l){return l.status==="rejected"}function dr(l){const e=q.c(62),{control:n,form:s}=l,i=ee(),a="metadata.runtime.env";let c;e[0]!==n?(c={control:n,name:a},e[0]=n,e[1]=c):c=e[1];const r=jn(c),{fields:h,append:o,remove:m}=r;let f;e[2]!==s?(f=(Y,B)=>{s.setValue(`${a}.${Y}`,B,{shouldDirty:!0,shouldTouch:!0})},e[2]=s,e[3]=f):f=e[3];const u=f,d=fl();let p;if(e[4]!==d){p=new Map;for(const Y of d)p.set(Y.id,Y);e[4]=d,e[5]=p}else p=e[5];const[x,g]=Q.useState(null);let b;e[6]!==o?(b=()=>{o({key:"",kind:"literal",value:""})},e[6]=o,e[7]=b):b=e[7];const y=b;let j;e[8]!==o||e[9]!==s||e[10]!==i?(j=async()=>{let Y;try{Y=await navigator.clipboard.readText()}catch{re.error(i("sandbox.envVarsField.clipboardReadFailed"));return}if(!Y.trim()){re.error(i("sandbox.envVarsField.clipboardEmpty"));return}let B;try{B=ar(Y)}catch(R){const W=R;re.error(W.message);return}const U=Object.entries(B);if(U.length===0){re.error(i("sandbox.envVarsField.nothingToAdd"));return}const _=s.getValues(a)??[],E=new Set;for(const R of _){const W=(R.key??"").trim();W&&E.add(W)}let G=0,L=0;for(const[R,W]of U){if(E.has(R)){L++;continue}o({key:R,kind:"literal",value:W}),E.add(R),G++}G===0&&L>0?re.message(i("sandbox.envVarsField.allKeysExist",{count:L})):re.success(L>0?i("sandbox.envVarsField.addedWithSkipped",{added:G,skipped:L}):i("sandbox.envVarsField.added",{added:G}))},e[8]=o,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]!==d||e[18]!==u){let Y;e[20]!==n||e[21]!==s||e[22]!==m||e[23]!==p||e[24]!==d||e[25]!==u?(Y=(B,U)=>t.jsx("li",{className:"rounded-md border border-border bg-background",children:t.jsx(ur,{index:U,control:n,form:s,onUpdateEntry:u,fieldPath:a,secrets:d,secretById:p,onSaveAsSecret:(_,E)=>g({kind:"save-literal",index:U,presetKey:_,presetValue:E}),onCreateNewSecret:_=>g({kind:"create-new",index:U,presetKey:_}),onRemove:()=>m(U)})},B.id),e[20]=n,e[21]=s,e[22]=m,e[23]=p,e[24]=d,e[25]=u,e[26]=Y):Y=e[26],S=h.map(Y),e[12]=n,e[13]=h,e[14]=s,e[15]=m,e[16]=p,e[17]=d,e[18]=u,e[19]=S}else S=e[19];let C;e[27]!==S?(C=t.jsx("ul",{className:"space-y-2",children:S}),e[27]=S,e[28]=C):C=e[28];let k;e[29]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ie,{className:"size-3.5"}),e[29]=k):k=e[29];let w;e[30]!==i?(w=i("sandbox.envVarsField.addEnvVar"),e[30]=i,e[31]=w):w=e[31];let N;e[32]!==y||e[33]!==w?(N=t.jsxs(ne,{type:"button",variant:"outline",size:"sm",onClick:y,className:"flex-1",children:[k,w]}),e[32]=y,e[33]=w,e[34]=N):N=e[34];let M;e[35]!==i?(M=i("sandbox.envVarsField.pasteDotenvAriaLabel"),e[35]=i,e[36]=M):M=e[36];let T;e[37]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(hi,{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 P;e[40]!==v||e[41]!==M||e[42]!==V?(P=t.jsx(Se,{asChild:!0,children:t.jsxs(ne,{type:"button",variant:"outline",size:"sm",onClick:v,"aria-label":M,children:[T,V]})}),e[40]=v,e[41]=M,e[42]=V,e[43]=P):P=e[43];let A;e[44]!==i?(A=i("sandbox.envVarsField.pasteDotenvTooltip"),e[44]=i,e[45]=A):A=e[45];let z;e[46]!==A?(z=t.jsx(Ne,{children:A}),e[46]=A,e[47]=z):z=e[47];let I;e[48]!==P||e[49]!==z?(I=t.jsxs(we,{children:[P,z]}),e[48]=P,e[49]=z,e[50]=I):I=e[50];let $;e[51]!==I||e[52]!==N?($=t.jsxs("div",{className:"flex items-center gap-2",children:[N,I]}),e[51]=I,e[52]=N,e[53]=$):$=e[53];let F;e[54]!==x||e[55]!==s||e[56]!==u?(F=x!==null?t.jsx(fr,{mode:x,onClose:()=>g(null),onSaved:Y=>{const B=s.getValues(`${a}.${x.index}.key`)?.trim()??"";u(x.index,{key:B,kind:"secret",secretId:Y}),g(null)}}):null,e[54]=x,e[55]=s,e[56]=u,e[57]=F):F=e[57];let K;return e[58]!==$||e[59]!==F||e[60]!==C?(K=t.jsxs("div",{className:"space-y-2",children:[C,$,F]}),e[58]=$,e[59]=F,e[60]=C,e[61]=K):K=e[61],K}function ur(l){const e=q.c(77),{index:n,control:s,form:i,onUpdateEntry:a,fieldPath:c,secrets:r,secretById:h,onSaveAsSecret:o,onCreateNewSecret:m,onRemove:f}=l,u=ee(),d=`${c}.${n}.key`,p=`${c}.${n}.value`,x=`${c}.${n}.secretId`,g=`${c}.${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=ws(b)==="secret"?"secret":"literal";let v;e[3]!==i||e[4]!==n||e[5]!==d||e[6]!==o||e[7]!==a||e[8]!==p?(v=W=>{const X=i.getValues(d)?.trim()??"";if(W==="literal"){a(n,{key:X,kind:"literal",value:""});return}const ie=i.getValues(p)??"";if(ie.length>0){o(X,ie);return}a(n,{key:X,kind:"secret",secretId:""})},e[3]=i,e[4]=n,e[5]=d,e[6]=o,e[7]=a,e[8]=p,e[9]=v):v=e[9];const S=v;let C;e[10]!==n||e[11]!==u?(C=W=>{const{field:X}=W,ie=(X.value??"").trim(),J=ie.length>0&&!ft.test(ie);return t.jsxs("div",{className:"space-y-1",children:[t.jsx(Ce,{...X,value:X.value??"",placeholder:u("sandbox.envVarsField.keyPlaceholder"),spellCheck:!1,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",className:xe("font-mono",J&&"border-destructive focus-visible:ring-destructive"),"aria-invalid":J,"aria-label":u("sandbox.envVarsField.envVarKeyLabel",{index:n+1}),onBlur:oe=>{const le=oe.target.value.trim();X.onChange(le),X.onBlur()}}),J?t.jsx("p",{className:"text-[11px] text-destructive",children:u("sandbox.envVarsField.invalidKeyMessage")}):null]})},e[10]=n,e[11]=u,e[12]=C):C=e[12];let k;e[13]!==s||e[14]!==d||e[15]!==C?(k=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(ve,{control:s,name:d,render:C})}),e[13]=s,e[14]=d,e[15]=C,e[16]=k):k=e[16];let w;e[17]!==S?(w=W=>S(W),e[17]=S,e[18]=w):w=e[18];let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(_e,{className:"h-9 w-[110px]",children:t.jsx(Ve,{})}),e[19]=N):N=e[19];let M;e[20]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(At,{className:"size-3.5"}),e[20]=M):M=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(je,{value:"literal",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[M,T]})}),e[23]=T,e[24]=V):V=e[24];let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(wn,{className:"size-3.5"}),e[25]=P):P=e[25];let A;e[26]!==u?(A=u("sandbox.envVarsField.secret"),e[26]=u,e[27]=A):A=e[27];let z;e[28]!==A?(z=t.jsx(je,{value:"secret",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[P,A]})}),e[28]=A,e[29]=z):z=e[29];let I;e[30]!==z||e[31]!==V?(I=t.jsxs(Te,{children:[V,z]}),e[30]=z,e[31]=V,e[32]=I):I=e[32];let $;e[33]!==j||e[34]!==I||e[35]!==w?($=t.jsx("div",{className:"shrink-0",children:t.jsxs(De,{value:j,onValueChange:w,children:[N,I]})}),e[33]=j,e[34]=I,e[35]=w,e[36]=$):$=e[36];let F;e[37]!==s||e[38]!==i||e[39]!==n||e[40]!==d||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(ve,{control:s,name:p,render:W=>{const{field:X}=W;return t.jsx(Ce,{...X,value:X.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:ie=>{X.onChange(ie.target.value),X.onBlur()}})}}):t.jsxs(t.Fragment,{children:[t.jsx(ve,{control:s,name:x,render:W=>{const{field:X}=W;return t.jsxs(De,{value:X.value||"",onValueChange:ie=>X.onChange(ie),children:[t.jsx(_e,{className:xe("h-9 w-full",!X.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(dl,{field:X,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(mr)})]})}}),t.jsxs(we,{children:[t.jsx(Se,{asChild:!0,children:t.jsx(ne,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.createNewSecretAriaLabel"),onClick:()=>{const W=i.getValues(d)?.trim()??"";m(W)},children:t.jsx(Ie,{className:"size-3.5"})})}),t.jsx(Ne,{children:u("sandbox.envVarsField.createNewSecret")})]})]})}),e[37]=s,e[38]=i,e[39]=n,e[40]=d,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 K;e[49]!==i||e[50]!==d||e[51]!==j||e[52]!==o||e[53]!==u||e[54]!==p?(K=j==="literal"?t.jsxs(we,{children:[t.jsx(Se,{asChild:!0,children:t.jsx(ne,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.saveAsSecretAriaLabel"),onClick:()=>{const W=i.getValues(d)?.trim()??"",X=i.getValues(p)??"";o(W,X)},children:t.jsx(xi,{className:"size-3.5"})})}),t.jsx(Ne,{children:u("sandbox.envVarsField.saveAsSecret")})]}):null,e[49]=i,e[50]=d,e[51]=j,e[52]=o,e[53]=u,e[54]=p,e[55]=K):K=e[55];let Y;e[56]!==u?(Y=u("sandbox.envVarsField.removeEnvVarAriaLabel"),e[56]=u,e[57]=Y):Y=e[57];let B;e[58]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(Tt,{className:"size-3.5"}),e[58]=B):B=e[58];let U;e[59]!==f||e[60]!==Y?(U=t.jsx(Se,{asChild:!0,children:t.jsx(ne,{type:"button",variant:"ghost",size:"icon","aria-label":Y,onClick:f,children:B})}),e[59]=f,e[60]=Y,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 G;e[66]!==U||e[67]!==E?(G=t.jsxs(we,{children:[U,E]}),e[66]=U,e[67]=E,e[68]=G):G=e[68];let L;e[69]!==K||e[70]!==G?(L=t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[K,G]}),e[69]=K,e[70]=G,e[71]=L):L=e[71];let R;return e[72]!==$||e[73]!==F||e[74]!==L||e[75]!==k?(R=t.jsxs("div",{className:"flex flex-col gap-2 p-2 sm:flex-row sm:items-center",children:[k,$,F,L]}),e[72]=$,e[73]=F,e[74]=L,e[75]=k,e[76]=R):R=e[76],R}function mr(l){return t.jsx(je,{value:l.id,children:t.jsxs("span",{className:"inline-flex items-center gap-2",children:[t.jsx(ml,{scope:l.scope}),t.jsx("span",{className:"font-mono",children:l.name})]})},l.id)}function fr({mode:l,onClose:e,onSaved:n}){const s=ee(),i=l.kind==="save-literal"?l.presetValue:"",a=l.presetKey,[c,r]=Q.useState(()=>pr(a)),[h,o]=Q.useState("organization"),[m,f]=Q.useState(i),[u,d]=Q.useState(""),p=pl(),x=c.trim(),g=m.length>0&&x.length>0&&ul.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=l.kind==="save-literal"?s("sandbox.envVarsField.saveValueAsSecretTitle"):s("sandbox.envVarsField.createNewSecretTitle"),j=l.kind==="save-literal"?s("sandbox.envVarsField.saveValueAsSecretDescription"):s("sandbox.envVarsField.createNewSecretDescription");return t.jsx(Ge,{open:!0,onOpenChange:v=>{v||e()},children:t.jsxs(qe,{className:"sm:max-w-md",children:[t.jsxs(tt,{children:[t.jsx(st,{children:y}),t.jsx(ys,{children:j})]}),t.jsxs("form",{onSubmit:b,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-scope",children:s("sandbox.envVarsField.scopeLabel")}),t.jsxs(De,{value:h,onValueChange:v=>o(v),children:[t.jsx(_e,{id:"save-secret-scope",children:t.jsx(Ve,{})}),t.jsxs(Te,{children:[t.jsx(je,{value:"organization",children:s("sandbox.envVarsField.scopeOrganization")}),t.jsx(je,{value:"user",children:s("sandbox.envVarsField.scopePrivate")})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ye,{htmlFor:"save-secret-name",children:s("sandbox.envVarsField.nameLabel")}),t.jsx(Ce,{id:"save-secret-name",value:c,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(ye,{htmlFor:"save-secret-value",children:s("sandbox.envVarsField.valueLabel")}),t.jsx(Ce,{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(ye,{htmlFor:"save-secret-description",children:s("sandbox.envVarsField.descriptionLabel")}),t.jsx(at,{id:"save-secret-description",value:u,onChange:v=>d(v.target.value),rows:2,placeholder:s("sandbox.envVarsField.descriptionPlaceholder")})]}),t.jsxs(Ct,{children:[t.jsx(ne,{type:"button",variant:"outline",onClick:e,disabled:p.isPending,children:s("sandbox.envVarsField.cancel")}),t.jsx(ne,{type:"submit",disabled:!g||p.isPending,children:p.isPending?s("sandbox.envVarsField.saving"):s("sandbox.envVarsField.saveSecret")})]})]})]})})}function us(l){if(!Array.isArray(l))return[];const e=[];for(const n of l){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 pr(l){const e=l.trim();return e&&ft.test(e)?e:""}function hr(l){const e=q.c(21),{repo:n,className:s}=l,i=ee();let a;e[0]!==s?(a=xe("space-y-2",s),e[0]=s,e[1]=a):a=e[1];let c;e[2]!==i?(c=i("sandbox.repoRow.label"),e[2]=i,e[3]=c):c=e[3];let r;e[4]!==c?(r=t.jsx(ye,{children:c}),e[4]=c,e[5]=r):r=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(hl,{size:20,className:"shrink-0 text-foreground/60"}),e[6]=h):h=e[6];let o;e[7]!==n||e[8]!==i?(o=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]=o):o=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]!==o||e[15]!==f?(u=t.jsxs(we,{children:[o,f]}),e[14]=o,e[15]=f,e[16]=u):u=e[16];let d;return e[17]!==a||e[18]!==r||e[19]!==u?(d=t.jsxs("div",{className:a,children:[r,u]}),e[17]=a,e[18]=r,e[19]=u,e[20]=d):d=e[20],d}const xr={npm:{install:"npm install",run:l=>`npm run ${l}`,runtime:"node"},pnpm:{install:"pnpm install",run:l=>`pnpm run ${l}`,runtime:"node"},yarn:{install:"yarn install",run:l=>`yarn run ${l}`,runtime:"node"},bun:{install:"bun install",run:l=>`bun run ${l}`,runtime:"bun"},deno:{install:"deno install",run:l=>`deno task ${l}`,runtime:"deno"}};function gr(l){const e=l.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 vr=Object.keys(xr),jt="__none__";function br(l){const e=q.c(47),{control:n}=l,s=ee(),i=Q.useRef(null);let a;e[0]!==s?(a=s("sandbox.runtimeFields.packageManager"),e[0]=s,e[1]=a):a=e[1];let c;e[2]!==a?(c=t.jsx(ye,{htmlFor:"runtime-pm",children:a}),e[2]=a,e[3]=c):c=e[3];let r;e[4]!==s?(r=w=>{const{field:N}=w;return t.jsxs(De,{value:N.value??jt,onValueChange:M=>N.onChange(M===jt?null:M),children:[t.jsx(_e,{id:"runtime-pm",children:t.jsx(Ve,{placeholder:s("sandbox.runtimeFields.autoDetect")})}),t.jsxs(Te,{children:[t.jsx(je,{value:jt,children:s("sandbox.runtimeFields.autoDetect")}),vr.map(yr)]})]})},e[4]=s,e[5]=r):r=e[5];let h;e[6]!==n||e[7]!==r?(h=t.jsx(ve,{control:n,name:"metadata.runtime.selected",render:r}),e[6]=n,e[7]=r,e[8]=h):h=e[8];let o;e[9]!==c||e[10]!==h?(o=t.jsxs("div",{className:"space-y-2",children:[c,h]}),e[9]=c,e[10]=h,e[11]=o):o=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(ye,{htmlFor:"runtime-path",children:m}),e[14]=m,e[15]=f):f=e[15];let u;e[16]!==n?(u=t.jsx(ve,{control:n,name:"metadata.runtime.path",render:jr}),e[16]=n,e[17]=u):u=e[17];let d;e[18]!==s?(d=s("sandbox.runtimeFields.packagePathDescription"),e[18]=s,e[19]=d):d=e[19];let p;e[20]!==d?(p=t.jsx("p",{className:"text-xs text-muted-foreground",children:d}),e[20]=d,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(ye,{htmlFor:"runtime-port",children:g}),e[28]=g,e[29]=b):b=e[29];let y;e[30]!==s?(y=w=>{const{field:N}=w;return t.jsx(Ce,{ref:i,id:"runtime-port",inputMode:"numeric",placeholder:s("sandbox.runtimeFields.auto"),defaultValue:N.value??"",onBlur:M=>{const T=gr(M.target.value);T.ok?N.onChange(T.value):i.current&&(i.current.value=N.value??"")}})},e[30]=s,e[31]=y):y=e[31];let j;e[32]!==n||e[33]!==y?(j=t.jsx(ve,{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 C;e[39]!==b||e[40]!==j||e[41]!==S?(C=t.jsxs("div",{className:"space-y-2",children:[b,j,S]}),e[39]=b,e[40]=j,e[41]=S,e[42]=C):C=e[42];let k;return e[43]!==x||e[44]!==C||e[45]!==o?(k=t.jsxs("div",{className:"space-y-5",children:[o,x,C]}),e[43]=x,e[44]=C,e[45]=o,e[46]=k):k=e[46],k}function jr(l){const{field:e}=l;return t.jsx(Ce,{id:"runtime-path",placeholder:".",defaultValue:e.value??"",onBlur:n=>{const s=n.target.value.trim();e.onChange(s===""?null:s)}})}function yr(l){return t.jsx(je,{value:l,children:l},l)}function wr(l){const e=q.c(5),{control:n}=l,s=ee();let i;e[0]!==s?(i=c=>{const{field:r}=c;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(ye,{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(ut,{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 a;return e[2]!==n||e[3]!==i?(a=t.jsx(ve,{control:n,name:"metadata.fieldDescriptionTooltips",render:i}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function Sr(l){const e=q.c(32),{control:n,onCommit:s}=l,i=ee();let a;e[0]!==i?(a=i("virtualMcp.virtualMcp.publishPolicySmart"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==i?(c=i("virtualMcp.virtualMcp.publishPolicySmartDescription"),e[2]=i,e[3]=c):c=e[3];let r;e[4]!==a||e[5]!==c?(r={value:"smart",label:a,description:c},e[4]=a,e[5]=c,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 o;e[9]!==i?(o=i("virtualMcp.virtualMcp.publishPolicyCodeReviewDescription"),e[9]=i,e[10]=o):o=e[10];let m;e[11]!==h||e[12]!==o?(m={value:"code-review",label:h,description:o},e[11]=h,e[12]=o,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 d;e[18]!==f||e[19]!==u?(d={value:"open",label:f,description:u},e[18]=f,e[19]=u,e[20]=d):d=e[20];let p;e[21]!==r||e[22]!==m||e[23]!==d?(p=[r,m,d],e[21]=r,e[22]=m,e[23]=d,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(ye,{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(Nr)})]})]})},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(ve,{name:"metadata.publishPolicy",control:n,render:g}),e[29]=n,e[30]=g,e[31]=b):b=e[31],b}function Nr(l){return t.jsx(je,{value:l.value,description:l.description,children:l.label},l.value)}function Cr(l){const e=q.c(24),{control:n,onCommit:s}=l,i=ee();let a;e[0]!==i?(a=i("sandbox.cmsSettings.contentEditing.off"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==i?(c=i("sandbox.cmsSettings.contentEditing.offDescription"),e[2]=i,e[3]=c):c=e[3];let r;e[4]!==a||e[5]!==c?(r={value:"off",label:a,description:c},e[4]=a,e[5]=c,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 o;e[9]!==i?(o=i("sandbox.cmsSettings.contentEditing.onDescription"),e[9]=i,e[10]=o):o=e[10];let m;e[11]!==h||e[12]!==o?(m={value:"on",label:h,description:o},e[11]=h,e[12]=o,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 d;e[17]!==s||e[18]!==u||e[19]!==i?(d=x=>{const{field:g}=x,b=g.value??null,y=Ls(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(ye,{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=sl.safeParse(j);v.success&&(g.onChange(nl(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(kr)})]})]})},e[17]=s,e[18]=u,e[19]=i,e[20]=d):d=e[20];let p;return e[21]!==n||e[22]!==d?(p=t.jsx(ve,{name:"metadata.ui.layout",control:n,render:d}),e[21]=n,e[22]=d,e[23]=p):p=e[23],p}function kr(l){return t.jsx(je,{value:l.value,description:l.description,children:l.label},l.value)}function ms(l){const e=l.metadata?.sidebarViews,n=l.metadata?.sidebarViewsVersion;return{effectiveViews:[...St(Nt(l.metadata),n)],rawViews:e===null?null:e?[...e]:void 0,version:n}}function Mr(l,e){return l===e?!0:!l||!e||l.length!==e.length?!1:l.every((n,s)=>n===e[s])}function _r(l,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...l,shareDialogOpen:e.payload};case"SET_ADD_DIALOG_OPEN":return{...l,addDialogOpen:e.payload};case"OPEN_SETTINGS":return{...l,settingsDialogOpen:!0,settingsConnectionId:e.payload};case"CLOSE_SETTINGS":return{...l,settingsDialogOpen:!1,settingsConnectionId:null};default:return l}}function Vr(l,e){switch(e.type){case"accumulate":{const n=l??{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 Tr(l){const e=l.metadata?.runtime?.env;if(!e||e.length===0)return l;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?l:{...l,metadata:{...l.metadata,runtime:{...l.metadata?.runtime??{},env:n}}}}async function Dr(l,e){const n=l?.idToken??null;if(n){const i=fs(n);if(i)return i}const s=l?.userinfoEndpoint??null;if(s)try{const i=await fetch(s,{headers:{Authorization:`Bearer ${e}`}});if(i.ok){const a=await i.json(),c=typeof a.email=="string"?a.email:typeof a.upn=="string"?a.upn:typeof a.preferred_username=="string"?a.preferred_username:null;if(c)return c}}catch{}return fs(e)}function fs(l){try{const e=l.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 Ar({virtualMcp:l}){const e=ee(),n=$n(),{org:s}=Oe(),i=ks(),{data:a}=qn([l.id]),c=a?.get(l.id)?.last_used_at,r=Ss(),h=js(),o=kt(),m=zs(l.id),f=JSON.stringify([s.id,l.id]),u=Ki(l.metadata,m.snapshot()),d=Sn({resolver:Nn(Ka),defaultValues:{...l,metadata:{...Jt(l.metadata),previewServerUrl:el(l.metadata),...u}}}),p=d.watch("connections"),x=Li(l),g=rt(l?.metadata),b=g&&Ls(d.watch("metadata.ui.layout"))==="off",y=Ms(l),j=y?{owner:y.owner,name:y.name,url:y.url}:null,[v,S]=Q.useReducer(_r,{shareDialogOpen:!1,addDialogOpen:!1,settingsDialogOpen:!1,settingsConnectionId:null}),[C,k]=Q.useState(!1),[w,N]=Q.useState(!1),{openSidePanel:M}=Pn(),{sendMessage:T}=Vn(),V=async()=>{if(w)return;const O=d.getValues("metadata.instructions");if(O?.trim()){N(!0);try{$(),ke("agent_instructions_improve_clicked",{agent_id:l.id,instructions_length:O.length}),M();const se=Mn(s.id);await T({tiptapDoc:Dn({managerAgentId:se.id,managerName:se.title,kind:"agent",id:l.id,instructions:O})})}finally{N(!1)}}},[P,A]=Q.useReducer(Vr,null),z=()=>{P!==null&&(ke("agent_updated",{agent_id:l.id,fields:Array.from(P.fields),instructions_length:P.instructionsLength,save_count:P.saveCount,edit_duration_ms:Date.now()-P.start}),A({type:"reset"}))},{schedule:I,flush:$}=qt({delayMs:3e4,save:async()=>z()}),F=async()=>{const O=m.snapshot(),se={predicate:Me=>Xt(Me.queryKey,s.id)},H=async()=>(await h.invalidateQueries({predicate:Me=>Xt(Me.queryKey,s.id),refetchType:"all"}),Qt(h,s.id,l.id)),D=(Me,Be)=>{if(Me){Mr(d.getValues("metadata.sidebarViews"),Me.rawViews)||d.setValue("metadata.sidebarViews",Me.rawViews,{shouldDirty:!1}),d.getValues("metadata.sidebarViewsVersion")!==Me.version&&d.setValue("metadata.sidebarViewsVersion",Me.version,{shouldDirty:!1});return}Be!==null&&(d.setValue("metadata.sidebarViews",[...Be],{shouldDirty:!1}),d.setValue("metadata.sidebarViewsVersion",Bi,{shouldDirty:!1}))},Z=Gi(O),he=Object.keys(d.control._formState.dirtyFields);if(he.length===0&&!Z){await m.settle({snapshot:O,saved:!0,authoritativeViews:O?.persistedViews});return}const de=he.length>0?he:["metadata"],ge=de.includes("metadata"),Pe=d.getValues();d.reset(Pe,{keepValues:!0});const Qe=Tr(Pe),tn=Qt(h,s.id,l.id),sn=qi({sidebarViews:Qe.metadata?.sidebarViews,sidebarViewsVersion:Qe.metadata?.sidebarViewsVersion},O,tn?.metadata);Qe.metadata={...Jt(Qe.metadata),...sn};let ht;try{ht=await i.update.mutateAsync({id:l.id,data:Qe})}catch(Me){let Be=null;try{Be=await H()}catch{}const $t=Be?ms(Be):null,Ft=await m.settle({snapshot:O,saved:!1,authoritativeViews:$t?.effectiveViews});throw Ft.settledLatest&&D($t,Ft.reconciledViews),Me}await h.cancelQueries(se),Hi(h,s.id,ht);const It=ms(ht),Ot=await m.settle({snapshot:O,saved:!0,authoritativeViews:It.effectiveViews});Ot.settledLatest&&D(It,Ot.reconciledViews),A({type:"accumulate",now:Date.now(),fields:de,instructionsLength:ge?Pe.metadata?.instructions?.length??0:null}),I()},K=()=>xl(f,F),{schedule:Y,flush:B}=qt({save:K});Q.useEffect(()=>{const O=d.watch(()=>Y());return()=>O.unsubscribe()},[]);const U=()=>{ke("connections_dialog_opened",{source:"agent_settings",mode:"add"}),S({type:"SET_ADD_DIALOG_OPEN",payload:!0})},_=async O=>{const se=d.getValues("connections");if(se.some(Z=>Z.connection_id===O))return;d.setValue("connections",[...se,{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 H=new URL(`/api/${s.slug}/mcp/${O}`,window.location.origin),D=await Bt({url:H.href,token:null,orgId:s.id});D.supportsOAuth&&!D.isAuthenticated&&await W(O)},E=O=>{const H=d.getValues("connections").filter(D=>D.connection_id!==O);d.setValue("connections",H,{shouldDirty:!0})},G=(O,se)=>{const H=d.getValues("connections");if(H.some(D=>D.connection_id===se)){re.error(e("virtualMcp.virtualMcp.instanceAlreadyAdded"));return}d.setValue("connections",H.map(D=>D.connection_id===O?{...D,connection_id:se}:D),{shouldDirty:!0})},L=async O=>{if(d.getValues("connections").find(H=>H.connection_id===O))try{const{item:H}=await o.call("COLLECTION_CONNECTIONS_GET",{id:O});if(!H)return;const D=H.title.replace(/\s*\(.*?\)\s*$/,""),Z=_n("conn"),he=`${D} (${Date.now().toString(36).slice(-4)})`;await r.create.mutateAsync({id:Z,title:he,description:H.description??null,connection_type:H.connection_type,connection_url:H.connection_url??null,connection_token:null,icon:H.icon??null,app_name:H.app_name??null,app_id:H.app_id??null,connection_headers:H.connection_headers??null});const de=new URL(`/api/${s.slug}/mcp/${Z}`,window.location.origin),ge=await Bt({url:de.href,token:null,orgId:s.id});if(ge.supportsOAuth&&!ge.isAuthenticated){const Pe=await W(Z);if(!Pe){await r.delete.mutateAsync(Z);return}await r.update.mutateAsync({id:Z,data:{title:`${D} (${Pe})`}})}G(O,Z),re.success(e("virtualMcp.virtualMcp.newInstanceCreated"))}catch(H){console.error("Failed to create instance:",H),re.error(e("virtualMcp.virtualMcp.failedToCreateInstance"))}},R=O=>{S({type:"OPEN_SETTINGS",payload:O})},W=async O=>{const{token:se,tokenInfo:H,error:D}=await En({connectionId:O,orgSlug:s.slug,scope:"offline_access"});if(D||!se)return re.error(e("virtualMcp.virtualMcp.authenticationFailed",{error:D??""})),null;if(H)try{const he=await fetch(`/api/${s.slug}/connections/${O}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:H.accessToken,refreshToken:H.refreshToken,expiresIn:H.expiresIn,scope:H.scope,clientId:H.clientId,clientSecret:H.clientSecret,tokenEndpoint:H.tokenEndpoint})});if(!he.ok)console.error("Failed to save OAuth token:",await he.text()),await r.update.mutateAsync({id:O,data:{connection_token:se}});else try{await r.update.mutateAsync({id:O,data:{}})}catch(de){console.warn("Failed to refresh connection tools after OAuth:",de)}}catch(he){console.error("Error saving OAuth token:",he),await r.update.mutateAsync({id:O,data:{connection_token:se}})}else await r.update.mutateAsync({id:O,data:{connection_token:se}});const Z=new URL(`/api/${s.slug}/mcp/${O}`,window.location.origin);return await h.invalidateQueries({queryKey:Mt.isMCPAuthenticated(Z.href,null)}),re.success(e("virtualMcp.virtualMcp.authenticationSuccessful")),Dr(H,se)},X=()=>{const O=d.getValues("metadata.instructions")??"",se=e("virtualMcp.virtualMcp.promptTemplateContent"),H=O.trim()?`${O}
|
|
3
3
|
|
|
4
4
|
${se}`:se;d.setValue("metadata.instructions",H,{shouldDirty:!0})},ie=new Set(p.map(O=>O.connection_id)),{section:J}=Fa(),oe=Ui(l.id)==="v8",le=Aa({virtualMcpId:l.id,form:d,flushAndSave:B}),ce=_t(),[te,ue]=Q.useState(!1),fe=async()=>{$();try{await i.delete.mutateAsync(l.id),ke("agent_deleted",{agent_id:l.id,source:"agent_detail"}),re.success(e("virtualMcp.virtualMcp.agentDeleted",{title:l.title})),ce({to:"/$org",params:{org:s.slug}})}catch{}},pe=t.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>{ke("agent_connect_modal_opened",{agent_id:l.id}),S({type:"SET_SHARE_DIALOG_OPEN",payload:!0})},children:[t.jsx(Cn,{size:14}),e("virtualMcp.virtualMcp.connect")]}),me=t.jsxs("div",{className:"flex items-center gap-2",children:[!d.watch("metadata.instructions")?.trim()&&t.jsx(ne,{variant:"outline",size:"sm",onClick:X,children:e("virtualMcp.virtualMcp.promptTemplate")}),t.jsxs(ne,{variant:"outline",size:"sm",disabled:w||!d.watch("metadata.instructions")?.trim(),onClick:V,children:[t.jsx(lt,{size:13}),e("virtualMcp.virtualMcp.improve")]})]});return t.jsxs(Re,{children:[t.jsxs(t.Fragment,{children:[t.jsx(Re.Title,{children:e("virtualMcp.settings.title")}),t.jsx($a,{section:J??"general"}),t.jsx(Re.Actions,{secondary:J==="connections"?pe:void 0,children:J==="connections"?t.jsxs(ne,{size:"sm",onClick:U,children:[t.jsx(Ie,{size:14}),e("virtualMcp.virtualMcp.addConnection")]}):pe}),t.jsx(Re.Content,{children:t.jsx(Re.Container,{width:"standard",className:"@container/project-settings",children:t.jsxs(kn,{children:[J==="general"&&t.jsx(Va,{views:le}),J==="general"&&t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(Pa,{form:d,onCommit:B}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 text-xs text-muted-foreground",children:[t.jsx(Tn,{id:l.created_by,size:"2xs",className:"text-sm text-muted-foreground"}),t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsxs("span",{children:[e("virtualMcp.virtualMcp.created")," ",Ll(new Date(l.created_at),"PP",{locale:n})]}),t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsx("span",{children:c?e("virtualMcp.virtualMcp.lastUsed",{time:Fn(new Date(c),{addSuffix:!0,locale:n})}):e("virtualMcp.virtualMcp.neverUsed")})]})]}),J==="connections"&&t.jsx("section",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:p.length===0?t.jsxs("button",{type:"button",onClick:U,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(Ie,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:e("virtualMcp.virtualMcp.noConnectionsYet")})]}):p.map(O=>t.jsx(Le,{fallback:()=>null,children:t.jsx(Q.Suspense,{fallback:t.jsx(Hs,{}),children:t.jsx(ga,{connection_id:O.connection_id,usedConnectionIds:ie,onOpenSettings:()=>R(O.connection_id),onRemove:()=>E(O.connection_id),onAuthenticate:W,onSwitchInstance:G,onNewInstance:()=>L(O.connection_id)})})},O.connection_id))})}),J==="general"&&t.jsxs("section",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcp.instructions")}),me]}),t.jsx(ve,{name:"metadata.instructions",control:d.control,render:({field:O})=>t.jsxs("div",{className:"relative rounded-xl card-shadow bg-card focus-within:ring-1 focus-within:ring-ring",children:[t.jsx(at,{...O,value:O.value??"",onChange:se=>{O.onChange(se)},onBlur:()=>{O.onBlur(),B()},placeholder:e("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"min-h-[200px] max-h-[360px] overflow-auto resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed border-0 shadow-none px-4 py-3 pr-11 focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent",style:{boxShadow:"none"}}),t.jsxs(we,{delayDuration:0,children:[t.jsx(Se,{asChild:!0,children:t.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"absolute top-2 right-2 h-7 w-7 text-muted-foreground",onClick:()=>k(!0),"aria-label":e("virtualMcp.virtualMcp.openFullscreenEditor"),children:t.jsx(gi,{size:14})})}),t.jsx(Ne,{side:"left",children:e("virtualMcp.virtualMcp.fullscreen")})]})]})})]}),J==="general"&&t.jsx(Bl,{form:d}),J==="general"&&t.jsx(Le,{fallback:()=>null,children:t.jsx(Q.Suspense,{fallback:t.jsxs("section",{className:"flex flex-col gap-3",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcp.subAgents")}),t.jsx("div",{className:"h-16 rounded-lg border border-dashed border-border animate-pulse"})]}),children:t.jsx(Jl,{form:d,currentAgentId:l.id})})}),J==="site"&&t.jsx(sr,{virtualMcp:l}),J==="site"&&g&&t.jsx(Ue,{title:e("sandbox.cmsSettings.title"),children:t.jsxs(Fe,{children:[t.jsx(be,{children:t.jsx(Cr,{control:d.control,onCommit:B})}),!b&&t.jsx(be,{children:t.jsx(wr,{control:d.control})}),!b&&x&&t.jsx(be,{children:t.jsx(Sr,{control:d.control,onCommit:B})})]})}),J==="site"&&!b&&t.jsx(Ue,{title:e("sandbox.cmsSettings.preview.title"),description:e("sandbox.cmsSettings.preview.description"),children:t.jsx(Fe,{children:t.jsx(Wa,{control:d.control,isBlocksV8:oe,previewServerUrl:d.watch("metadata.previewServerUrl"),fastPreview:d.watch("metadata.fastPreview")})})}),J==="site"&&oe&&x&&t.jsx(Ra,{orgSlug:s.slug,virtualMcpId:l.id}),J==="site"&&t.jsx(Ue,{title:e("virtualMcp.virtualMcp.sandbox"),children:t.jsxs(Fe,{children:[t.jsx(be,{children:t.jsx(hr,{repo:j})}),t.jsx(be,{children:t.jsx(br,{control:d.control})}),t.jsx(be,{children:t.jsx(rr,{control:d.control,form:d,virtualMcpId:l.id,orgSlug:s.slug,sandboxMap:l.metadata.sandboxMap})})]})}),J==="general"&&t.jsx(Ue,{title:e("virtualMcp.settings.groups.advanced"),children:t.jsx(Fe,{children:t.jsx(Xe,{title:e("virtualMcp.virtualMcp.deleteAgent"),description:e("virtualMcp.virtualMcp.deleteAgentDescription"),action:t.jsxs(ne,{variant:"outline",size:"sm",className:"text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:()=>ue(!0),children:[t.jsx(Tt,{size:14}),e("virtualMcp.virtualMcp.deleteAgent")]})})})})]})})},J)]}),t.jsx(zn,{open:te,onOpenChange:ue,children:t.jsxs(Rn,{children:[t.jsxs(Ln,{children:[t.jsx(Un,{children:e("virtualMcp.virtualMcp.deleteAgentConfirm")}),t.jsx(Bn,{children:e("virtualMcp.virtualMcp.deleteAgentConfirmDescription",{title:l.title})})]}),t.jsxs(Yn,{children:[t.jsx(Wn,{children:e("virtualMcp.virtualMcp.cancel")}),t.jsx(Kn,{onClick:fe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:e("virtualMcp.virtualMcp.delete")})]})]})}),t.jsx(bi,{open:v.addDialogOpen,onOpenChange:O=>S({type:"SET_ADD_DIALOG_OPEN",payload:O}),agentId:l.id,addedConnectionIds:ie,onAdd:_}),t.jsx(xa,{open:v.settingsDialogOpen,onOpenChange:O=>{O||S({type:"CLOSE_SETTINGS"})},selectedId:v.settingsConnectionId,form:d,connections:p,onAuthenticate:W}),t.jsx(tr,{open:v.shareDialogOpen,onOpenChange:O=>S({type:"SET_SHARE_DIALOG_OPEN",payload:O}),virtualMcp:l}),t.jsx(Ge,{open:C,onOpenChange:k,children:t.jsxs(qe,{className:"w-[90vw] sm:max-w-6xl h-[85vh] flex flex-col p-0 gap-0",children:[t.jsx(tt,{className:"px-6 pt-6 pb-3 border-b border-border shrink-0",children:t.jsx(st,{children:e("virtualMcp.virtualMcp.instructions")})}),t.jsx("div",{className:"flex-1 min-h-0 p-6",children:t.jsx(ve,{name:"metadata.instructions",control:d.control,render:({field:O})=>t.jsx(at,{...O,value:O.value??"",onChange:se=>{O.onChange(se)},onBlur:()=>{O.onBlur(),B()},placeholder:e("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"w-full h-full resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed rounded-xl card-shadow px-4 py-3 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-0 bg-card border-0",style:{boxShadow:"none"}})})})]})})]})}function Pr(l){const e=q.c(21),{virtualMcpId:n}=l,s=ee(),i=_t(),{org:a}=Oe(),c=Cs(n);if(!c){let m;e[0]!==s?(m=s("virtualMcp.virtualMcp.spaceNotFound"),e[0]=s,e[1]=m):m=e[1];let f;e[2]!==s?(f=s("virtualMcp.virtualMcp.spaceNotFoundDescription"),e[2]=s,e[3]=f):f=e[3];let u;e[4]!==i||e[5]!==a.slug?(u=()=>i({to:"/$org",params:{org:a.slug}}),e[4]=i,e[5]=a.slug,e[6]=u):u=e[6];let d;e[7]!==s?(d=s("virtualMcp.virtualMcp.backToSpaces"),e[7]=s,e[8]=d):d=e[8];let p;e[9]!==u||e[10]!==d?(p=t.jsx(ne,{variant:"outline",onClick:u,children:d}),e[9]=u,e[10]=d,e[11]=p):p=e[11];let x;return e[12]!==m||e[13]!==f||e[14]!==p?(x=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(An,{title:m,description:f,actions:p})}),e[12]=m,e[13]=f,e[14]=p,e[15]=x):x=e[15],x}let r;e[16]!==c?(r=Ms(c)?.connectionId??"",e[16]=c,e[17]=r):r=e[17];const h=`${c.id}:${r}`;let o;return e[18]!==h||e[19]!==c?(o=t.jsx(Ar,{virtualMcp:c},h),e[18]=h,e[19]=c,e[20]=o):o=e[20],o}function Go(l){const e=q.c(2),{virtualMcpId:n}=l;let s;return e[0]!==n?(s=t.jsx(Pr,{virtualMcpId:n}),e[0]=n,e[1]=s):s=e[1],s}export{Go as S};
|