decocms 4.414.0 → 4.415.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-DaJjYzK7.js → AlertCircle-CvaSOOO8.js} +1 -1
- package/dist/client/assets/AreaChart-C1zWMN3A.js +1 -0
- package/dist/client/assets/{ArrowLeft-CwZA6hhm.js → ArrowLeft-BsqlBCdi.js} +1 -1
- package/dist/client/assets/{ArrowRight-DlEEL0oL.js → ArrowRight-B6VZdTtP.js} +1 -1
- package/dist/client/assets/{ArrowUp-BVYCIIGM.js → ArrowUp-C1c3cSMN.js} +1 -1
- package/dist/client/assets/CartesianChart-DT33HVeq.js +6 -0
- package/dist/client/assets/{Check-OcoBiXmm.js → Check-ClKm876e.js} +1 -1
- package/dist/client/assets/{CheckCircle-Dd90iqND.js → CheckCircle-B38I9lsp.js} +1 -1
- package/dist/client/assets/{ChevronUp-CD5mSK7Y.js → ChevronUp-BBBSFlle.js} +1 -1
- package/dist/client/assets/{Copy01-BJqw8z9b.js → Copy01-kb1901QR.js} +1 -1
- package/dist/client/assets/{CreditCard01-BWWARSB9.js → CreditCard01-DkYuXaNf.js} +1 -1
- package/dist/client/assets/{DotsVertical-Chnn0E-M.js → DotsVertical-OXZ2C8qE.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-CWEL9dCO.js → ErrorBarContext-CSFQ9ttu.js} +1 -1
- package/dist/client/assets/Image01-xbxm22_Y.js +1 -0
- package/dist/client/assets/{Key01-CD0lgLSw.js → Key01-ZIYydTtn.js} +1 -1
- package/dist/client/assets/{Line-Bg6fTk0a.js → Line-C_txxRhK.js} +1 -1
- package/dist/client/assets/{Link01-CDLS3D8E.js → Link01-cXYRJQde.js} +1 -1
- package/dist/client/assets/{LinkExternal01-ClZInLaB.js → LinkExternal01-UxTfoueY.js} +1 -1
- package/dist/client/assets/{Monitor01-BdQ0e4n3.js → Monitor01-CINH3FWT.js} +1 -1
- package/dist/client/assets/{Globe04-BrBw0Avb.js → Palette-C2svjF4J.js} +1 -1
- package/dist/client/assets/{Plus-Du1X0BSn.js → Plus-Bv10xzXZ.js} +1 -1
- package/dist/client/assets/{SearchMd-BhrVtQgO.js → SearchMd-DRAIsS0-.js} +1 -1
- package/dist/client/assets/{Sector-qDv_EV21.js → Sector-TihpQ2pX.js} +5 -5
- package/dist/client/assets/{ShoppingBag01-DTuXZ14Y.js → ShoppingBag01-DsBku-zP.js} +1 -1
- package/dist/client/assets/{Sun-BOBnFu4U.js → Sun-CJOAGa8i.js} +1 -1
- package/dist/client/assets/{Tool01-B1l7rMbN.js → Tool01-gY-gdMF4.js} +1 -1
- package/dist/client/assets/{Trash01-5dU05cxX.js → Trash01-DUhLvzYZ.js} +1 -1
- package/dist/client/assets/{Upload01-HggPmwVR.js → Upload01-BsdejHE0.js} +1 -1
- package/dist/client/assets/{User01-DCaSZH6y.js → User01-B4dCU7oy.js} +1 -1
- package/dist/client/assets/{UserSquare-oitDkmCz.js → UserSquare-BA1qsXhU.js} +1 -1
- package/dist/client/assets/{Users01-C5KisUmx.js → Users01-BLSNtVXz.js} +1 -1
- package/dist/client/assets/{X-C_n07v-r.js → X-BTpPaU7c.js} +1 -1
- package/dist/client/assets/XAxis-Cj_1oR4W.js +1 -0
- package/dist/client/assets/{XClose-CH7JGbnX.js → XClose-DnZUIdlK.js} +1 -1
- package/dist/client/assets/{ZoomOut-CE1oJlBX.js → ZoomOut-DvQpsf4w.js} +1 -1
- package/dist/client/assets/{access-gate-djSuo48h.js → access-gate-BYf0rE33.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-ks_Gm8LK.js → add-connection-dialog-BdXnmDrQ.js} +1 -1
- package/dist/client/assets/agent-analytics-DQZgiL7L.js +2 -0
- package/dist/client/assets/agent-app-C7k2151J.js +1 -0
- package/dist/client/assets/agent-assets-B-r7ioGn.js +1 -0
- package/dist/client/assets/agent-automation-BkxL2BIZ.js +20 -0
- package/dist/client/assets/agent-automations-pf_bDZZ5.js +1 -0
- package/dist/client/assets/agent-connect-sources-Do412j4U.js +1 -0
- package/dist/client/assets/agent-deck-CYuHMzf-.js +1 -0
- package/dist/client/assets/agent-e2e-Db1tY-Py.js +1 -0
- package/dist/client/assets/agent-experiments-a-194CZ0.js +1 -0
- package/dist/client/assets/agent-file-DcPThm01.js +1 -0
- package/dist/client/assets/{agent-git-BTa_DVHj.js → agent-git-I5DAbFxV.js} +2 -2
- package/dist/client/assets/agent-hosting-8wURqYK1.js +1 -0
- package/dist/client/assets/agent-icon-BvDKYGuI.js +1 -0
- package/dist/client/assets/agent-library-DP9jULfe.js +1 -0
- package/dist/client/assets/agent-library-file-C2CuO8zG.js +1 -0
- package/dist/client/assets/agent-monitor-DU5E9xAR.js +1 -0
- package/dist/client/assets/agent-overview-BBH7XkKk.js +1 -0
- package/dist/client/assets/agent-settings-DBkRHp58.js +1 -0
- package/dist/client/assets/{agent-site-editor-CHHHOnLg.js → agent-site-editor-DSbFppgh.js} +4 -4
- package/dist/client/assets/agent-site-editor-code-CGBlhTFD.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-D7eFLsTa.js → agent-site-editor-content-C6CyUicz.js} +6 -6
- package/dist/client/assets/{agent-site-editor-preview-CU4mKdzV.js → agent-site-editor-preview-Bm6vi5GO.js} +3 -3
- package/dist/client/assets/{agent-view-guard-Dc-tIwiR.js → agent-view-guard-BHFZQ084.js} +1 -1
- package/dist/client/assets/agent-view-iS5vUDqd.js +1 -0
- package/dist/client/assets/agents-list-BmcrOH9K.js +1 -0
- package/dist/client/assets/{ai-providers-dlDhTyuB.js → ai-providers-D07lihCf.js} +2 -2
- package/dist/client/assets/{alert-CwBw9dro.js → alert-CbVRyYdn.js} +1 -1
- package/dist/client/assets/{alert-dialog-DIB7QD28.js → alert-dialog-D5AYweb7.js} +1 -1
- package/dist/client/assets/analytics-sections-C7kQuinp.js +1 -0
- package/dist/client/assets/{api-keys-3zmZWwRN.js → api-keys-CRcL5tuf.js} +1 -1
- package/dist/client/assets/api-keys-DrGX-MFg.js +1 -0
- package/dist/client/assets/app-editor-BH13ZfO_.js +1 -0
- package/dist/client/assets/{asset-utils-DwWjXWho.js → asset-utils-DxlUH6fM.js} +1 -1
- package/dist/client/assets/{auth-D5I2s61A.js → auth-DqmsEfIB.js} +1 -1
- package/dist/client/assets/{auth-catchall-WSWKM_Gq.js → auth-catchall-BMmDsnzK.js} +1 -1
- package/dist/client/assets/auth-entry-B26Aq39u.js +1 -0
- package/dist/client/assets/{auth-split-layout-DWTgZBat.js → auth-split-layout-D5nNb-G8.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-hhMpxZ3e.js → authenticate-and-persist-oauth-CtghXoSr.js} +1 -1
- package/dist/client/assets/{automation-list-row-DdEGsJ2i.js → automation-list-row-CkyFpQMb.js} +1 -1
- package/dist/client/assets/automation-runs-CoqjOPyS.js +1 -0
- package/dist/client/assets/automations-2UeJll3f.js +1 -0
- package/dist/client/assets/{autosend-Cxmy5f7O.js → autosend-D__v3v-c.js} +1 -1
- package/dist/client/assets/{avatar-foon9v7B.js → avatar-JoRElFKl.js} +1 -1
- package/dist/client/assets/badge-B0yp_bFb.js +1 -0
- package/dist/client/assets/{block-document-B8Nfg62J.js → block-document-iObAvspI.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-BaVmSFTq.js → blocks-preview-workspace-context-CroMcTkl.js} +1 -1
- package/dist/client/assets/{buckets-CUx3pPZV.js → buckets-CdF9xMMp.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-BygXIWi2.js → build-improve-prompt-doc-CXnpM7kh.js} +1 -1
- package/dist/client/assets/{calendar-G6mILgu2.js → calendar-_lAvk6Nt.js} +1 -1
- package/dist/client/assets/{capability-load-error-CO1VC4nF.js → capability-load-error-8qZRldzC.js} +1 -1
- package/dist/client/assets/category-editor-fWmRfYwN.js +1 -0
- package/dist/client/assets/{chart-oCBL-j7a.js → chart-B8A_E9YA.js} +5 -5
- package/dist/client/assets/{chat-context-Cugy5hDa.js → chat-context-DCpRbJmR.js} +5 -5
- package/dist/client/assets/{chat-draft-BdIaAbi7.js → chat-draft-BiPOqsxD.js} +1 -1
- package/dist/client/assets/{checkbox-Catn0jym.js → checkbox-DYn5BX_y.js} +1 -1
- package/dist/client/assets/choose-editor-9psJgCK3.js +1 -0
- package/dist/client/assets/{claim-phase-copy-BQxiL9ur.js → claim-phase-copy-CaNBNXR7.js} +1 -1
- package/dist/client/assets/{cli-auth-success-C8L7TKTw.js → cli-auth-success-B-HmvL0Z.js} +1 -1
- package/dist/client/assets/{client-icons-wx82VsS4.js → client-icons-DRAmgBv8.js} +1 -1
- package/dist/client/assets/{collapsible-BW-qIR3J.js → collapsible-Bg1MAa8S.js} +1 -1
- package/dist/client/assets/collection-detail-CzcE81KP.js +1 -0
- package/dist/client/assets/{collection-display-button-C7gBvlDS.js → collection-display-button-BbOo6z7N.js} +1 -1
- package/dist/client/assets/{collection-search-Bq1nxKvP.js → collection-search-EssCGlF9.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DVdtt0cC.js → collection-table-wrapper-BktaVXNL.js} +1 -1
- package/dist/client/assets/{collection-tabs-C36RG4Vf.js → collection-tabs-C2dMZ-Yz.js} +1 -1
- package/dist/client/assets/{combobox-DCIUJ1uY.js → combobox-DnOhf0WD.js} +1 -1
- package/dist/client/assets/command-DljL6hzf.js +1 -0
- package/dist/client/assets/{companion-mcps-section-DWDTtMpt.js → companion-mcps-section-DHfjmvo2.js} +1 -1
- package/dist/client/assets/config-BRt8XM2Q.js +1 -0
- package/dist/client/assets/{connect-jOPX0XiI.js → connect-COAAkNAe.js} +2 -2
- package/dist/client/assets/{connect-layout-CyFIUESs.js → connect-layout-D_XB9JJD.js} +1 -1
- package/dist/client/assets/{connection-CPFeF6nm.js → connection-DZucsf0o.js} +1 -1
- package/dist/client/assets/{connection-card-CTMJB3fp.js → connection-card-DrvsNBSo.js} +1 -1
- package/dist/client/assets/connection-detail-DELb5RqN.js +1 -0
- package/dist/client/assets/{connection-form-helpers-C5t2ERoW.js → connection-form-helpers-BOYwqVWG.js} +1 -1
- package/dist/client/assets/connections-BTjmigpS.js +1 -0
- package/dist/client/assets/context-t3HzYqzN.js +1 -0
- package/dist/client/assets/{create-organization-dialog-CZ1lcSy0.js → create-organization-dialog-BCIcZ5Ce.js} +1 -1
- package/dist/client/assets/{decopilot-BbmoQjBz.js → decopilot-BbS9GPYA.js} +2 -2
- package/dist/client/assets/{dialog-D5ye6U_D.js → dialog-CfIoHDlJ.js} +1 -1
- package/dist/client/assets/discover-C6NL6AwE.js +1 -0
- package/dist/client/assets/{domain-settings-BzTmzHwn.js → domain-settings-I8HFU1tc.js} +1 -1
- package/dist/client/assets/download-app-dialog-bvP5yIID.js +1 -0
- package/dist/client/assets/{drawer-CgCvwNdV.js → drawer-gbdrTv3r.js} +1 -1
- package/dist/client/assets/{editor-DCI3ZH5o.js → editor-CUtbeyZe.js} +1 -1
- package/dist/client/assets/{empty-state-DSA1rktW.js → empty-state-B7JCSTCX.js} +1 -1
- package/dist/client/assets/{empty-state-BpRvqX3b.js → empty-state-B_xAVz84.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DIQFM_Rl.js → extract-connection-data-CHpjURut.js} +1 -1
- package/dist/client/assets/feature-gate-CSCbG-02.js +1 -0
- package/dist/client/assets/feature-paywall-BK6fjPbO.js +1 -0
- package/dist/client/assets/file-explorer-BEA-kxcu.js +2 -0
- package/dist/client/assets/file-preview-Bk7_4BhT.js +1 -0
- package/dist/client/assets/file-share-button-CtEMEEnP.js +3 -0
- package/dist/client/assets/{file-type-icon-w64MSOpN.js → file-type-icon-C_2K-vjQ.js} +1 -1
- package/dist/client/assets/flat-project-Bp2uxu0m.js +1 -0
- package/dist/client/assets/folder-icon-D2srQ6r8.js +1 -0
- package/dist/client/assets/{form-F3knQ3ef.js → form-Bw-12Nua.js} +1 -1
- package/dist/client/assets/format-time-CjIPQhCN.js +1 -0
- package/dist/client/assets/{gateway-client-BkDoJc3i.js → gateway-client-DDRZPNgE.js} +1 -1
- package/dist/client/assets/{general-DRrG1HLu.js → general-DFurEwpf.js} +1 -1
- package/dist/client/assets/github-repo-22x8y8Tm.js +1 -0
- package/dist/client/assets/home-BEfet_Bo.js +1 -0
- package/dist/client/assets/{index-D9Qjyoct.js → index-B1gW_UZi.js} +12 -12
- package/dist/client/assets/index-BADnYX4j.css +1 -0
- package/dist/client/assets/{index-1xlnSxuL.js → index-BBClJhS5.js} +1 -1
- package/dist/client/assets/{index-B_6_b10B.js → index-BBn8QmOY.js} +1 -1
- package/dist/client/assets/{index-PWbqH2G3.js → index-BGw3HTPr.js} +1 -1
- package/dist/client/assets/index-C23QqnY4.js +1 -0
- package/dist/client/assets/{index-C1LXcrdL.js → index-CBJQH72Z.js} +1 -1
- package/dist/client/assets/{index-CQTi57zC.js → index-CP9MPNu2.js} +2 -2
- package/dist/client/assets/{index-DwGlegEL.js → index-Cc_Zqhkn.js} +1 -1
- package/dist/client/assets/{index-799YT1X7.js → index-Ccktnu9A.js} +1 -1
- package/dist/client/assets/index-CdYIy8eY.js +1 -0
- package/dist/client/assets/index-DRvgWruv.js +1 -0
- package/dist/client/assets/{index-BxbJS58j.js → index-DTVMnS9R.js} +1 -1
- package/dist/client/assets/{index-DXncJrGS.js → index-TvCpAFy_.js} +15 -15
- package/dist/client/assets/index-Ty5Jzwnf.js +10 -0
- package/dist/client/assets/{index-DUhG4tsR.js → index-oPco2Z7Q.js} +36 -36
- package/dist/client/assets/{index-redirect-W-CDsNw_.js → index-redirect-D8rObEfr.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CnSA8MF_.js → infiniteQueryObserver-BiKAGWol.js} +1 -1
- package/dist/client/assets/infra-billing-DM30eRIB.js +1 -0
- package/dist/client/assets/{input-DY62oxPZ.js → input-Dk8ExXFi.js} +1 -1
- package/dist/client/assets/{input-DaUsOzcS.js → input-MYwET4H0.js} +1 -1
- package/dist/client/assets/input-ZcuegaFq.js +1 -0
- package/dist/client/assets/{integration-icon-Didv4P2d.js → integration-icon-cSotbhTg.js} +1 -1
- package/dist/client/assets/{label-BypgdEhS.js → label-9S9F78nK.js} +1 -1
- package/dist/client/assets/{last-preview-page-BGLkyqI1.js → last-preview-page-BqZ-yKjx.js} +1 -1
- package/dist/client/assets/{layout-CPzExRWR.js → layout-XmYuHyUp.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-GQn_HHLF.js → legacy-agents-deep-Cos55l5T.js} +1 -1
- package/dist/client/assets/legacy-main-redirect-SvbBzQfx.js +1 -0
- package/dist/client/assets/library-DwuPF4v9.js +1 -0
- package/dist/client/assets/library-tab-jc2e6zcQ.js +168 -0
- package/dist/client/assets/location-DBePU4bz.js +1 -0
- package/dist/client/assets/{login-BRrTc0gG.js → login-Dk9tmaQV.js} +1 -1
- package/dist/client/assets/{markdown-Bc3TbOnL.js → markdown-D8NZ8Hcx.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-x41adwrD.js → mcp-app-renderer-CMM_xZGY.js} +1 -1
- package/dist/client/assets/{mcp-oauth-jFxfSUra.js → mcp-oauth-Rwm2gO51.js} +1 -1
- package/dist/client/assets/members-C7CWAgRC.js +1 -0
- package/dist/client/assets/{message-templates-nlH50gJ2.js → message-templates-LZ9bQOkh.js} +1 -1
- package/dist/client/assets/{mini-report-page-CxePAPTE.js → mini-report-page-Djd5YLq-.js} +1 -1
- package/dist/client/assets/mock-board-wLpRW8bx.js +1 -0
- package/dist/client/assets/{monaco-editor-D8GdrnPh.js → monaco-editor-gMJT6cpK.js} +2 -2
- package/dist/client/assets/monitoring-stats-row-DGiOnVB-.js +1 -0
- package/dist/client/assets/{multi-select-DhVdXTHb.js → multi-select-CgJiEc6d.js} +1 -1
- package/dist/client/assets/{mustache-Da5_vbMS.js → mustache-C_QlIzWy.js} +1 -1
- package/dist/client/assets/new-project-dialog-BaZdnvse.js +1 -0
- package/dist/client/assets/{oauth-callback-DTAJ88cJ.js → oauth-callback-DKlgv_Gu.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-zQxL0ybs.js → oauth-callback-ai-provider-bpHWEFSR.js} +1 -1
- package/dist/client/assets/onboarding-BCfoU2BS.js +1 -0
- package/dist/client/assets/optimistic-project-sidebar-views-CmwJxzI1.js +1 -0
- package/dist/client/assets/{org-file-open-context-CRfULtcz.js → org-file-open-context-Bv73tl5K.js} +1 -1
- package/dist/client/assets/{organization-choice-DrNVkNJX.js → organization-choice-1eorpCYU.js} +1 -1
- package/dist/client/assets/{orgs-CRvqTOkY.js → orgs-zhbMCzP-.js} +1 -1
- package/dist/client/assets/{page-seo-form-VepXUh7G.js → page-seo-form-CshajZtl.js} +1 -1
- package/dist/client/assets/{pair-CIPjczyu.js → pair-C-k8zr2J.js} +7 -7
- package/dist/client/assets/plan-ladder-BlKhVXlg.js +1 -0
- package/dist/client/assets/{popover-CLlJmv-M.js → popover-BgkxtrX7.js} +1 -1
- package/dist/client/assets/post-calendar-B-WdFfky.js +1 -0
- package/dist/client/assets/post-editor-CsDksmyM.js +2 -0
- package/dist/client/assets/preview-content-C6mifSrd.js +1 -0
- package/dist/client/assets/{preview-dialog-oInIOpgo.js → preview-dialog-CIYvMHEx.js} +1 -1
- package/dist/client/assets/profile-C0w8Yfz5.js +1 -0
- package/dist/client/assets/project-app-view-Sevz3SK2.js +1 -0
- package/dist/client/assets/project-feed-BMtZcRjf.js +1 -0
- package/dist/client/assets/{project-icon-BzJ0b0Ay.js → project-icon-C29pLjaM.js} +1 -1
- package/dist/client/assets/project-profile-B8BUGXs3.js +1 -0
- package/dist/client/assets/project-reports-DLR8Px_E.js +1 -0
- package/dist/client/assets/project-tasks-BpKda9bF.js +1 -0
- package/dist/client/assets/projects-B_9wM2AG.js +1 -0
- package/dist/client/assets/projects-empty-state-D2roHEQS.js +1 -0
- package/dist/client/assets/{prompts-DDV76PD8.js → prompts-SqPXo2ej.js} +1 -1
- package/dist/client/assets/record-editor-DwoOuklP.js +1 -0
- package/dist/client/assets/redirect-editor-BROySec3.js +1 -0
- package/dist/client/assets/reports-7388ESEV.js +1 -0
- package/dist/client/assets/{reports-x7ZW7jY1.js → reports-BAoHRlcZ.js} +1 -1
- package/dist/client/assets/reports-onboarding-DuXWRm1J.js +1 -0
- package/dist/client/assets/reports-tab-BTG8fjPp.js +2 -0
- package/dist/client/assets/repositories-dyiTYnan.js +1 -0
- package/dist/client/assets/{repository-import-picker-DdC8LWMV.js → repository-import-picker-OR5DGZp9.js} +1 -1
- package/dist/client/assets/repository-picker-BSwi4b8i.js +1 -0
- package/dist/client/assets/require-capability-Bqc8OMTK.js +1 -0
- package/dist/client/assets/{required-auth-layout-BeA6YeYQ.js → required-auth-layout-Byop8Zzr.js} +1 -1
- package/dist/client/assets/{reset-password-CZB-h_dr.js → reset-password-BJ7ek2C_.js} +1 -1
- package/dist/client/assets/{resizable-ChG3qNIS.js → resizable-3VTCAPsm.js} +1 -1
- package/dist/client/assets/resolve-tab-icon-CmlW-pVX.js +1 -0
- package/dist/client/assets/{review-settings-1_C-_b80.js → review-settings-DV0Kgix-.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-B4JFOCzI.js → rich-text-link-control-DHguSqou.js} +2 -2
- package/dist/client/assets/roles-BddVa5rc.js +1 -0
- package/dist/client/assets/route-BTyvu5tm.js +1 -0
- package/dist/client/assets/route-Dv07Kl62.js +1 -0
- package/dist/client/assets/route-wKh3eUlH.js +1 -0
- package/dist/client/assets/{runnable-block-editor-DZC0Baz4.js → runnable-block-editor-Do2tVSLe.js} +4 -4
- package/dist/client/assets/{sandbox-lifecycle-context-BonuevCJ.js → sandbox-lifecycle-context-DqykpNrC.js} +1 -1
- package/dist/client/assets/{schema-GqB2SNE_.js → schema-DN-s_HG6.js} +1 -1
- package/dist/client/assets/{scroll-area-9EhbhV4n.js → scroll-area--yTJQfnp.js} +1 -1
- package/dist/client/assets/{search-input-B84gMTxu.js → search-input-BNUWPEYj.js} +1 -1
- package/dist/client/assets/search-toggle-QxOnD3UE.js +1 -0
- package/dist/client/assets/{secret-picker-FZs_qkUu.js → secret-picker-B-IAzUKw.js} +1 -1
- package/dist/client/assets/{secrets-DQnlXKqx.js → secrets-BfsxO5FG.js} +1 -1
- package/dist/client/assets/sections-editor-BSMpRRaP.js +1 -0
- package/dist/client/assets/{select-CcGyx8ty.js → select-BSSRUEpK.js} +1 -1
- package/dist/client/assets/{select-model-BXKVjHOx.js → select-model-BpoA_wtD.js} +1 -1
- package/dist/client/assets/seo-editor-BLMg-jAb.js +1 -0
- package/dist/client/assets/{separator-CIgATGUR.js → separator-B-ZEExAQ.js} +1 -1
- package/dist/client/assets/settings-tab-Bjk0NW75.js +5 -0
- package/dist/client/assets/{sheet-HsqEW5k_.js → sheet--8zhfSHm.js} +1 -1
- package/dist/client/assets/shell-layout-DE5WStxe.js +1 -0
- package/dist/client/assets/skills-5oEukgyq.js +1 -0
- package/dist/client/assets/{sso-w-CGny8A.js → sso-p_1To1BG.js} +1 -1
- package/dist/client/assets/{suggestion-YJaAoX7G.js → suggestion-tikPUWB4.js} +1 -1
- package/dist/client/assets/{switch-BVaVIxoj.js → switch-XXcZ9CO9.js} +1 -1
- package/dist/client/assets/synced-repos-6N09TwCW.js +1 -0
- package/dist/client/assets/{tab-icon-glyph-D7xp64UN.js → tab-icon-glyph-Cg30pNjq.js} +1 -1
- package/dist/client/assets/{table-C4wC7jcA.js → table-UDk1rGCz.js} +1 -1
- package/dist/client/assets/{tabs-CtBDwYTw.js → tabs-DddEqGpk.js} +1 -1
- package/dist/client/assets/{task-board-DTEg_hTj.js → task-board-BQC0qjBI.js} +1 -1
- package/dist/client/assets/task-route-BIVpLzI_.js +1 -0
- package/dist/client/assets/{task-status-yZrVtsEU.js → task-status-5qx4S30L.js} +1 -1
- package/dist/client/assets/taskboard-analytics-BUkhCXum.js +1 -0
- package/dist/client/assets/{tasks-Ay-mjiXF.js → tasks-B2IZJpCB.js} +2 -2
- package/dist/client/assets/tasks-JL_Q5QmF.js +1 -0
- package/dist/client/assets/{textarea-Bd9BZaa2.js → textarea-mkcrN5g-.js} +1 -1
- package/dist/client/assets/thread-analytics-BL_w94D4.js +1 -0
- package/dist/client/assets/thread-button-DwWAsFW7.js +1 -0
- package/dist/client/assets/{hooks-C-YaiNLT.js → thread-intent-1MB6k5b2.js} +6 -6
- package/dist/client/assets/thread-route-BCeXxLYH.js +1 -0
- package/dist/client/assets/{thread-route-BfqlgN7w.js → thread-route-CRhZ1osu.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-C8gQ6cXL.js → thread-sheet-body-Bo7LPBv_.js} +1 -1
- package/dist/client/assets/{toggle-group-BgFCagKD.js → toggle-group-Cz7RSOBM.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CFttHyWN.js → toolbar-icon-button-CiJmHymh.js} +1 -1
- package/dist/client/assets/{tooltip-CGhrZMes.js → tooltip-CF6AcK-h.js} +1 -1
- package/dist/client/assets/{track-ZExbUuzl.js → track-OWWDrnQ-.js} +1 -1
- package/dist/client/assets/{types-pZX4k5UI.js → types-C-gwtfMH.js} +2 -2
- package/dist/client/assets/usage-stats-CBSbrOk_.js +1 -0
- package/dist/client/assets/{use-ai-providers-CFjUtZPr.js → use-ai-providers-B1JZFVlj.js} +1 -1
- package/dist/client/assets/{use-automations-C8WXPSJY.js → use-automations-D_9NQm3c.js} +1 -1
- package/dist/client/assets/{use-autosave-vgysQ9m_.js → use-autosave-DlgDe-Tc.js} +1 -1
- package/dist/client/assets/use-chat-layout-state-D4JUtDU_.js +1 -0
- package/dist/client/assets/use-connect-companion-DeEhFjbg.js +1 -0
- package/dist/client/assets/{use-connection-mxLfDMRW.js → use-connection-BSRKwy2j.js} +1 -1
- package/dist/client/assets/{use-copy-DUJ6ltm0.js → use-copy-BOgEqZMm.js} +1 -1
- package/dist/client/assets/use-create-virtual-mcp-zRgZOr46.js +1 -0
- package/dist/client/assets/{use-date-fns-locale-DyxqZQPj.js → use-date-fns-locale-DLQqaR-J.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DuPXl9wb.js → use-debounced-autosave-D_28bChm.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BUDe5Br2.js → use-debounced-value-DD9mnPT_.js} +1 -1
- package/dist/client/assets/{use-deco-credits-xeUqHdn1.js → use-deco-credits-BVTpTeQe.js} +1 -1
- package/dist/client/assets/use-decopilot-events-DrrVrYNR.js +1 -0
- package/dist/client/assets/{use-delete-connection-CATogPT_.js → use-delete-connection-XxANt-J1.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BDkUFo0H.js → use-deployment-admin-2URfC53G.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-DPJWXzMA.js → use-fast-preview-draft-url-DEazNknV.js} +1 -1
- package/dist/client/assets/{use-file-configs-CaiCm4YC.js → use-file-configs-CoaidzsY.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CaPw6C-5.js → use-infinite-scroll-BPqj-R_X.js} +1 -1
- package/dist/client/assets/{use-join-requests-Dpz06WqH.js → use-join-requests-Drw7IeW0.js} +1 -1
- package/dist/client/assets/use-main-panel-tabs-qFkwsuao.js +1 -0
- package/dist/client/assets/use-mcp-auth-status-CZ-0Pvu1.js +1 -0
- package/dist/client/assets/{use-mcp-client-Bax4L87A.js → use-mcp-client-DDH2Tr05.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DjwM3Aih.js → use-mcp-prompts-CogjK1bQ.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CbB7jVMv.js → use-mcp-tools-B7MXLlq3.js} +1 -1
- package/dist/client/assets/{use-members-D9drExEq.js → use-members-BLvVhz4X.js} +1 -1
- package/dist/client/assets/{use-mobile-BkNVLn-e.js → use-mobile-BCSnRACa.js} +1 -1
- package/dist/client/assets/use-navigate-to-agent-DYNDpstL.js +1 -0
- package/dist/client/assets/use-new-blocks-editor-DGdBBbiW.js +1 -0
- package/dist/client/assets/{use-open-billing-url-YekIfrRD.js → use-open-billing-url-Dq7moyEm.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BFMVTZYa.js → use-org-auth-client-BaoVl8Zl.js} +1 -1
- package/dist/client/assets/use-org-fs-gM-Wauv_.js +1 -0
- package/dist/client/assets/use-org-repo-syncs-DFgGELdf.js +1 -0
- package/dist/client/assets/{use-org-sso-TEOX56yY.js → use-org-sso-GwZiS-qS.js} +1 -1
- package/dist/client/assets/{use-organization-roles-C2hucAQ7.js → use-organization-roles-CqvDOd51.js} +1 -1
- package/dist/client/assets/{use-organization-settings-3QYUfCpW.js → use-organization-settings-mKOaKHuY.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-KvJ_j5rh.js → use-panel-navigate-CQHE_TAW.js} +1 -1
- package/dist/client/assets/use-project-native-view-presence-CjADt2wx.js +1 -0
- package/dist/client/assets/use-project-scope-UozAP0t-.js +1 -0
- package/dist/client/assets/use-releases-D-iqlxR6.js +1 -0
- package/dist/client/assets/{use-reports-diagnostic-B7R_a5Kv.js → use-reports-diagnostic-CknaDfb_.js} +1 -1
- package/dist/client/assets/{use-secrets-CNuvKS59.js → use-secrets-Bl8vA-cD.js} +1 -1
- package/dist/client/assets/use-section-preview-base-BqbdcWw1.js +1 -0
- package/dist/client/assets/use-session-runtime-B5XfJc8H.js +1 -0
- package/dist/client/assets/{use-tags-DSm1Zgi6.js → use-tags-C0g04rDb.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-Bt0Ix7m9.js → use-task-board-analytics-DQMIr-R3.js} +1 -1
- package/dist/client/assets/use-task-metadata--2QUxhiK.js +1 -0
- package/dist/client/assets/use-thread-analytics-CVoZDp6i.js +1 -0
- package/dist/client/assets/{use-thread-outputs-C38ocjxH.js → use-thread-outputs-CYriWIIs.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-U12d5VJc.js +1 -0
- package/dist/client/assets/{useQueries-CLsJAj_M.js → useQueries-tUSXojRG.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B912YJiX.js +1 -0
- package/dist/client/assets/{users-Db27IK-5.js → users-DFvmfIoV.js} +1 -1
- package/dist/client/assets/{utils-CwpmExkA.js → utils-BaPwSBi2.js} +1 -1
- package/dist/client/assets/variant-calendar-sxqpD_Oi.js +1 -0
- package/dist/client/assets/{variant-matcher-override-szW3kzoV.js → variant-matcher-override-C-94qzoj.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BBcGKlDx.js → view-mode-toggle-DrlZskFH.js} +1 -1
- package/dist/client/assets/{virtual-mcp-COzLXyrd.js → virtual-mcp-DBFF2brO.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/AreaChart-C8Vo_8Ig.js +0 -1
- package/dist/client/assets/CartesianChart-l7Ajhkvs.js +0 -6
- package/dist/client/assets/Eye-DR1l_Pl4.js +0 -1
- package/dist/client/assets/Image01-DMj_7b2c.js +0 -1
- package/dist/client/assets/LayoutLeft-7YdGH3zt.js +0 -1
- package/dist/client/assets/Palette-CJ_H2Ji8.js +0 -1
- package/dist/client/assets/Share07-3t9nqqkD.js +0 -1
- package/dist/client/assets/Zap-D3wZltKp.js +0 -1
- package/dist/client/assets/agent-analytics-By50bpU5.js +0 -2
- package/dist/client/assets/agent-app-CcBru_Dc.js +0 -1
- package/dist/client/assets/agent-assets-CoBq8gk-.js +0 -1
- package/dist/client/assets/agent-automation-YwmQKN06.js +0 -20
- package/dist/client/assets/agent-automations-Cq5KP2f5.js +0 -1
- package/dist/client/assets/agent-connect-sources-DxRi8BCM.js +0 -1
- package/dist/client/assets/agent-deck-DVLEuDhA.js +0 -1
- package/dist/client/assets/agent-e2e-5IoZIrla.js +0 -1
- package/dist/client/assets/agent-experiments-Int37iX5.js +0 -1
- package/dist/client/assets/agent-file-Ch99Gr0p.js +0 -1
- package/dist/client/assets/agent-hosting-DELLHkBv.js +0 -1
- package/dist/client/assets/agent-icon-CJ1up34I.js +0 -1
- package/dist/client/assets/agent-library-file-CS1rjRRh.js +0 -1
- package/dist/client/assets/agent-monitor-Ciy1E_-Q.js +0 -1
- package/dist/client/assets/agent-overview-BC_RAnEB.js +0 -1
- package/dist/client/assets/agent-settings-DTx-4cAY.js +0 -1
- package/dist/client/assets/agent-site-editor-code-DMrXO_8H.js +0 -2
- package/dist/client/assets/agent-view-CorDejXP.js +0 -1
- package/dist/client/assets/agents-list-CfDIHVDD.js +0 -1
- package/dist/client/assets/analytics-sections-C5_87xUx.js +0 -1
- package/dist/client/assets/api-keys-DmjbbAZ9.js +0 -1
- package/dist/client/assets/app-editor-Dk5jSXjv.js +0 -1
- package/dist/client/assets/auth-entry-BJ1WxKvH.js +0 -1
- package/dist/client/assets/automation-runs-CRr7g14c.js +0 -1
- package/dist/client/assets/automations-PMz-u3eU.js +0 -1
- package/dist/client/assets/badge-B8dizlCT.js +0 -1
- package/dist/client/assets/cards-ByVpaFgO.js +0 -8
- package/dist/client/assets/category-editor-BVzm0zUq.js +0 -1
- package/dist/client/assets/choose-editor-DwovNL0Y.js +0 -1
- package/dist/client/assets/collection-detail-Djse0DNa.js +0 -1
- package/dist/client/assets/command-DBqQ-b8W.js +0 -1
- package/dist/client/assets/config-9m7obEVv.js +0 -1
- package/dist/client/assets/connection-detail-CtFxBJog.js +0 -1
- package/dist/client/assets/connections-DYm-50T2.js +0 -1
- package/dist/client/assets/context-Cen00PJ2.js +0 -1
- package/dist/client/assets/discover-f-IlJYkY.js +0 -1
- package/dist/client/assets/download-app-dialog-CK-GvdAK.js +0 -1
- package/dist/client/assets/feature-gate-CEAThaDY.js +0 -1
- package/dist/client/assets/feature-paywall-DCqda5W4.js +0 -1
- package/dist/client/assets/file-explorer-IsG6Ynrb.js +0 -2
- package/dist/client/assets/file-preview-DkTtYjnK.js +0 -1
- package/dist/client/assets/file-share-button-BhqfoTyo.js +0 -3
- package/dist/client/assets/folder-icon-0KKPDvC_.js +0 -1
- package/dist/client/assets/format-time-BtXRrtv4.js +0 -1
- package/dist/client/assets/github-icon-BPkd3ouG.js +0 -1
- package/dist/client/assets/github-repo-B15wwZ1g.js +0 -1
- package/dist/client/assets/home-WT_7dde5.js +0 -1
- package/dist/client/assets/icon-button-C4M15Chh.js +0 -1
- package/dist/client/assets/index-B7QeXpyw.css +0 -1
- package/dist/client/assets/index-BlluJU8T.js +0 -1
- package/dist/client/assets/index-BvEM-dvH.js +0 -1
- package/dist/client/assets/index-CKALiP-j.js +0 -1
- package/dist/client/assets/infra-billing-IOD9NeWW.js +0 -1
- package/dist/client/assets/input-BM0pNmJR.js +0 -1
- package/dist/client/assets/legacy-main-redirect-Btysr0GK.js +0 -1
- package/dist/client/assets/library-BS4jnPds.js +0 -161
- package/dist/client/assets/location-oTTXFrSF.js +0 -1
- package/dist/client/assets/members-BkUMEbBZ.js +0 -1
- package/dist/client/assets/mock-board-CxZ6IfnT.js +0 -10
- package/dist/client/assets/monitoring-stats-row-B4HKQfEd.js +0 -1
- package/dist/client/assets/onboarding-C-Uu6LDz.js +0 -1
- package/dist/client/assets/optimistic-project-sidebar-views-QwaUX4Nu.js +0 -1
- package/dist/client/assets/plan-ladder-Io6vIIsL.js +0 -1
- package/dist/client/assets/post-calendar-DTivbJGd.js +0 -1
- package/dist/client/assets/post-editor-hRUF_q7o.js +0 -2
- package/dist/client/assets/preview-content-qYsw7P88.js +0 -1
- package/dist/client/assets/profile-DKiSx-md.js +0 -1
- package/dist/client/assets/project-app-view-BXbadkka.js +0 -1
- package/dist/client/assets/project-feed-CWlgSYJd.js +0 -1
- package/dist/client/assets/project-reports-D27FVZrO.js +0 -1
- package/dist/client/assets/project-tasks-BlwINbrD.js +0 -1
- package/dist/client/assets/record-editor-D0FEEilz.js +0 -1
- package/dist/client/assets/redirect-editor-8U0kYp-L.js +0 -1
- package/dist/client/assets/reports-SHBoIX6T.js +0 -1
- package/dist/client/assets/reports-onboarding-lz-YekBw.js +0 -1
- package/dist/client/assets/reports-tab-CQsFI9AI.js +0 -2
- package/dist/client/assets/repositories-B78A5I4U.js +0 -1
- package/dist/client/assets/repository-picker-DiXvXP64.js +0 -1
- package/dist/client/assets/require-capability-D3lYzq6i.js +0 -1
- package/dist/client/assets/resolve-tab-icon-H5U8-G1F.js +0 -1
- package/dist/client/assets/roles-BaCjCp-z.js +0 -1
- package/dist/client/assets/route-CkeTHcT5.js +0 -1
- package/dist/client/assets/route-D4LTJlBf.js +0 -1
- package/dist/client/assets/route-RUwqIRQf.js +0 -1
- package/dist/client/assets/route-page-header-BvgE0q5Z.js +0 -1
- package/dist/client/assets/search-toggle-Dllmt4oB.js +0 -1
- package/dist/client/assets/sections-editor-IVuj1qGO.js +0 -1
- package/dist/client/assets/seo-editor-DWMKmSd9.js +0 -1
- package/dist/client/assets/settings-tab-qIGPe64v.js +0 -5
- package/dist/client/assets/shell-layout-PsOcpnj-.js +0 -1
- package/dist/client/assets/skill-preview-DDuXNYxe.js +0 -1
- package/dist/client/assets/skills-C9zl4SYU.js +0 -1
- package/dist/client/assets/synced-repos-OeYTgI30.js +0 -1
- package/dist/client/assets/task-route-D8AxgdXG.js +0 -1
- package/dist/client/assets/taskboard-analytics-SldboJtr.js +0 -1
- package/dist/client/assets/tasks-B2JqGigR.js +0 -1
- package/dist/client/assets/thread-analytics-JrMutHmT.js +0 -1
- package/dist/client/assets/thread-button-CjEacYmJ.js +0 -1
- package/dist/client/assets/thread-intent-CNQdM8Ho.js +0 -1
- package/dist/client/assets/thread-route-CSSVlTLS.js +0 -1
- package/dist/client/assets/usage-stats-ClwItUaQ.js +0 -1
- package/dist/client/assets/use-chat-layout-state-Dr584zB8.js +0 -1
- package/dist/client/assets/use-connect-companion-Cgv0bZBV.js +0 -1
- package/dist/client/assets/use-create-virtual-mcp-ZvRac8CV.js +0 -1
- package/dist/client/assets/use-decopilot-events-Dy5N8Y9f.js +0 -1
- package/dist/client/assets/use-entitlements-CLVdcWhS.js +0 -1
- package/dist/client/assets/use-in-settings-Bi1UGPlh.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-D0Ib6HQf.js +0 -1
- package/dist/client/assets/use-mcp-auth-status-DHVKLIQk.js +0 -1
- package/dist/client/assets/use-navigate-to-agent-DWCyMlYN.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-CCZwmfNr.js +0 -1
- package/dist/client/assets/use-org-fs-tnSIwx8e.js +0 -1
- package/dist/client/assets/use-project-native-view-presence-CWXr40Pf.js +0 -1
- package/dist/client/assets/use-project-scope-DhGOPpT1.js +0 -1
- package/dist/client/assets/use-releases-DDoVPY5_.js +0 -1
- package/dist/client/assets/use-section-preview-base-VmECEpeP.js +0 -1
- package/dist/client/assets/use-session-runtime-CiLk98Je.js +0 -1
- package/dist/client/assets/use-task-metadata-DsWPSHLO.js +0 -1
- package/dist/client/assets/use-thread-analytics-CNx40-hY.js +0 -1
- package/dist/client/assets/use-virtual-mcp-C2m1pRHH.js +0 -1
- package/dist/client/assets/useInfiniteQuery-rQtGLM3y.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DPJ-gshr.js +0 -1
- package/dist/client/assets/variant-calendar-ZscKzDf5.js +0 -1
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{c as H,b as X,r as W,j as t,B as se,h as Xe,l as fe,I as gs,F as vs,H as bs,G as Ke,aQ as Ut,aR as Yt,aS as Bt,t as re,X as Ae,E as Re,Y as js,eY as en,L as ys,aa as tn,s as sn,dX as He,ak as Kt,a9 as nn,dW as Le,dV as Be,a3 as ot,m as an,K as ws,eZ as ln,e_ as rn,e$ as on,aT as he,f0 as Ce,n as ze,P as cn,d as Mt,u as dn,q as ge,c$ as un,ag as mn,eJ as fn,f1 as pn,aO as hn,a as xn,f2 as Ss,f3 as gn,aD as vn,a7 as bn,o as jn,am as yn,al as wn,f4 as Sn,ar as Nn}from"./index-DUhG4tsR.js";import{g as Cn}from"./extract-connection-data-DIQFM_Rl.js";import{a as Mn}from"./chat-context-Cugy5hDa.js";import{U as _n,b as kn}from"./build-improve-prompt-doc-BygXIWi2.js";import{E as Tn}from"./empty-state-BpRvqX3b.js";import{a as Dn}from"./shell-layout-PsOcpnj-.js";import{g as ct,n as Vn,a as Gt,e as An,u as In,f as On}from"./use-date-fns-locale-DyxqZQPj.js";import{a as _t,b as Ns,u as Pn}from"./use-connection-mxLfDMRW.js";import{b as Cs,a as Ms,c as _s,g as $n}from"./use-virtual-mcp-C2m1pRHH.js";import{a as En,i as Wt}from"./mcp-oauth-jFxfSUra.js";import{f as Fn,e as zn,b as Rn,A as Ln,a as Un,d as Yn,c as Bn,g as Kn}from"./alert-dialog-DIB7QD28.js";import{D as Je,b as Ze,c as dt,d as ut,e as ks,h as Gn}from"./dialog-D5ye6U_D.js";import{T as it}from"./textarea-Bd9BZaa2.js";import{c as je,T as ye,a as we}from"./tooltip-CGhrZMes.js";import{n as Wn}from"./LinkExternal01-ClZInLaB.js";import{a$ as Hn,b0 as qn,b1 as Qn,aF as Xn,ar as Jn,au as kt,b2 as Tt,b3 as Ts,ad as Dt,b4 as wt,j as Ds,h as Ht,n as Zn,m as ei,l as ti,e as Vs,b5 as qt,b6 as si,b7 as As,b8 as gt,b9 as Qt,A as Xt,B as ni,ba as ii,bb as ai,I as li,S as ri,aD as oi,a3 as ci,aj as di}from"./agent-icon-CJ1up34I.js";import{s as $e}from"./Plus-Du1X0BSn.js";import{t as nt,a as ui}from"./Tool01-B1l7rMbN.js";import{s as Vt}from"./Trash01-5dU05cxX.js";import{u as Jt}from"./use-debounced-autosave-DuPXl9wb.js";import{A as mi}from"./add-connection-dialog-ks_Gm8LK.js";import{a as fi}from"./Share07-3t9nqqkD.js";import{i as at}from"./SearchMd-BhrVtQgO.js";import{F as Zt}from"./file-type-icon-w64MSOpN.js";import{h as pi,i as hi,j as xi,k as gi}from"./use-org-fs-tnSIwx8e.js";import{I as We}from"./integration-icon-Didv4P2d.js";import{C as Is}from"./checkbox-Catn0jym.js";import{S as vi}from"./search-input-B84gMTxu.js";import{b as ke,a as Te,c as xe,d as De,S as Ve}from"./select-CcGyx8ty.js";import{s as At}from"./XClose-CH7JGbnX.js";import{C as bi}from"./collection-tabs-C36RG4Vf.js";import{T as Os,u as Ps}from"./use-mcp-auth-status-DHVKLIQk.js";import{u as mt}from"./use-mcp-client-Bax4L87A.js";import{a as $s}from"./use-mcp-tools-CbB7jVMv.js";import{u as ji}from"./use-mcp-prompts-DjwM3Aih.js";import{g as yi}from"./connection-slug-CITJ0kGN.js";import{t as St}from"./utils-CVEq3hMx.js";import{I as Me}from"./input-DaUsOzcS.js";import{S as ft}from"./switch-BVaVIxoj.js";import{P as It,a as Ot,b as Pt}from"./popover-CLlJmv-M.js";import{S as Es}from"./scroll-area-9EhbhV4n.js";import{i as wi}from"./LayoutLeft-7YdGH3zt.js";import{i as Si}from"./DotsVertical-Chnn0E-M.js";import{a as Ni}from"./Image01-DMj_7b2c.js";import{i as Ci}from"./Monitor01-BdQ0e4n3.js";import{g as Mi}from"./types-pZX4k5UI.js";import{b as lt,g as _i,d as ki}from"./use-project-scope-DhGOPpT1.js";import{a as Ti}from"./use-panel-navigate-KvJ_j5rh.js";import{u as Di,e as Nt,r as Ct,p as Vi,g as Ai,s as Ii,t as Oi,h as Pi,a as $i}from"./use-project-native-view-presence-CWXr40Pf.js";import{a as Fs,u as Ei,i as Fi,o as zi,r as es,p as Ri,w as Li,b as ts}from"./optimistic-project-sidebar-views-QwaUX4Nu.js";import{i as Ui}from"./Upload01-HggPmwVR.js";import{i as Yi}from"./Link01-CDLS3D8E.js";import{V as Bi,E as pt,r as zs,C as Ki,w as Gi}from"./virtual-mcp-COzLXyrd.js";import{s as Rs}from"./slugify-CEUa2lfQ.js";import{b as Wi,a as Hi,D as qi}from"./drawer-CgCvwNdV.js";import{u as Qi}from"./use-mobile-BkNVLn-e.js";import{i as et}from"./Check-OcoBiXmm.js";import{a as ht}from"./Copy01-BJqw8z9b.js";import{i as $t}from"./Key01-CD0lgLSw.js";import{d as tt}from"./backoff-8mStPHYB.js";import{g as Ls}from"./github-repo-B15wwZ1g.js";import{R as Xi}from"./repository-import-picker-DdC8LWMV.js";import{b as Ji}from"./sandbox-url-D3mC8qhT.js";import{L as ve}from"./label-BypgdEhS.js";import{S as Zi,a as ea,b as ta}from"./secret-picker-FZs_qkUu.js";import{u as sa,a as na}from"./use-secrets-CNuvKS59.js";import{o as ss}from"./omit-sandbox-map-jj4lCB2U.js";import{G as ia}from"./github-icon-BPkd3ouG.js";import{p as aa,s as la,a as ra}from"./thread-intent-CNQdM8Ho.js";import{r as oa}from"./serial-task-queue-CGOeQgpr.js";import{t as Ie,c as Ge,m as ca,a as Us}from"./differenceInSeconds-C3x8sHUj.js";function Qe(a,e){const n=ct(),s=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Ie(a,e?.in),l=i.getDay(),o=(l<s?7:0)+l-s;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function rt(a,e){return Qe(a,{...e,weekStartsOn:1})}function Ys(a,e){const n=Ie(a,e?.in),s=n.getFullYear(),i=Ge(n,0);i.setFullYear(s+1,0,4),i.setHours(0,0,0,0);const l=rt(i),o=Ge(n,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const r=rt(o);return n.getTime()>=l.getTime()?s+1:n.getTime()>=r.getTime()?s:s-1}function ns(a,e){const n=Ie(a,e?.in);return n.setHours(0,0,0,0),n}function da(a,e,n){const[s,i]=Vn(n?.in,a,e),l=ns(s),o=ns(i),r=+l-Gt(l),h=+o-Gt(o);return Math.round((r-h)/ca)}function ua(a,e){const n=Ys(a,e),s=Ge(a,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),rt(s)}function ma(a){return a instanceof Date||typeof a=="object"&&Object.prototype.toString.call(a)==="[object Date]"}function fa(a){return!(!ma(a)&&typeof a!="number"||isNaN(+Ie(a)))}function pa(a,e){const n=Ie(a,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ha(a,e){const n=Ie(a,e?.in);return da(n,pa(n))+1}function xa(a,e){const n=Ie(a,e?.in),s=+rt(n)-+ua(n);return Math.round(s/Us)+1}function Bs(a,e){const n=Ie(a,e?.in),s=n.getFullYear(),i=ct(),l=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=Ge(e?.in||a,0);o.setFullYear(s+1,0,l),o.setHours(0,0,0,0);const r=Qe(o,e),h=Ge(e?.in||a,0);h.setFullYear(s,0,l),h.setHours(0,0,0,0);const c=Qe(h,e);return+n>=+r?s+1:+n>=+c?s:s-1}function ga(a,e){const n=ct(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Bs(a,e),l=Ge(e?.in||a,0);return l.setFullYear(i,0,s),l.setHours(0,0,0,0),Qe(l,e)}function va(a,e){const n=Ie(a,e?.in),s=+Qe(n,e)-+ga(n,e);return Math.round(s/Us)+1}function le(a,e){const n=a<0?"-":"",s=Math.abs(a).toString().padStart(e,"0");return n+s}const Pe={y(a,e){const n=a.getFullYear(),s=n>0?n:1-n;return le(e==="yy"?s%100:s,e.length)},M(a,e){const n=a.getMonth();return e==="M"?String(n+1):le(n+1,2)},d(a,e){return le(a.getDate(),e.length)},a(a,e){const n=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(a,e){return le(a.getHours()%12||12,e.length)},H(a,e){return le(a.getHours(),e.length)},m(a,e){return le(a.getMinutes(),e.length)},s(a,e){return le(a.getSeconds(),e.length)},S(a,e){const n=e.length,s=a.getMilliseconds(),i=Math.trunc(s*Math.pow(10,n-3));return le(i,e.length)}},Ye={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},is={G:function(a,e,n){const s=a.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});default:return n.era(s,{width:"wide"})}},y:function(a,e,n){if(e==="yo"){const s=a.getFullYear(),i=s>0?s:1-s;return n.ordinalNumber(i,{unit:"year"})}return Pe.y(a,e)},Y:function(a,e,n,s){const i=Bs(a,s),l=i>0?i:1-i;if(e==="YY"){const o=l%100;return le(o,2)}return e==="Yo"?n.ordinalNumber(l,{unit:"year"}):le(l,e.length)},R:function(a,e){const n=Ys(a);return le(n,e.length)},u:function(a,e){const n=a.getFullYear();return le(n,e.length)},Q:function(a,e,n){const s=Math.ceil((a.getMonth()+1)/3);switch(e){case"Q":return String(s);case"QQ":return le(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(a,e,n){const s=Math.ceil((a.getMonth()+1)/3);switch(e){case"q":return String(s);case"qq":return le(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(a,e,n){const s=a.getMonth();switch(e){case"M":case"MM":return Pe.M(a,e);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(a,e,n){const s=a.getMonth();switch(e){case"L":return String(s+1);case"LL":return le(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(a,e,n,s){const i=va(a,s);return e==="wo"?n.ordinalNumber(i,{unit:"week"}):le(i,e.length)},I:function(a,e,n){const s=xa(a);return e==="Io"?n.ordinalNumber(s,{unit:"week"}):le(s,e.length)},d:function(a,e,n){return e==="do"?n.ordinalNumber(a.getDate(),{unit:"date"}):Pe.d(a,e)},D:function(a,e,n){const s=ha(a);return e==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):le(s,e.length)},E:function(a,e,n){const s=a.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(a,e,n,s){const i=a.getDay(),l=(i-s.weekStartsOn+8)%7||7;switch(e){case"e":return String(l);case"ee":return le(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(a,e,n,s){const i=a.getDay(),l=(i-s.weekStartsOn+8)%7||7;switch(e){case"c":return String(l);case"cc":return le(l,e.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(a,e,n){const s=a.getDay(),i=s===0?7:s;switch(e){case"i":return String(i);case"ii":return le(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(a,e,n){const i=a.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(a,e,n){const s=a.getHours();let i;switch(s===12?i=Ye.noon:s===0?i=Ye.midnight:i=s/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(a,e,n){const s=a.getHours();let i;switch(s>=17?i=Ye.evening:s>=12?i=Ye.afternoon:s>=4?i=Ye.morning:i=Ye.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(a,e,n){if(e==="ho"){let s=a.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return Pe.h(a,e)},H:function(a,e,n){return e==="Ho"?n.ordinalNumber(a.getHours(),{unit:"hour"}):Pe.H(a,e)},K:function(a,e,n){const s=a.getHours()%12;return e==="Ko"?n.ordinalNumber(s,{unit:"hour"}):le(s,e.length)},k:function(a,e,n){let s=a.getHours();return s===0&&(s=24),e==="ko"?n.ordinalNumber(s,{unit:"hour"}):le(s,e.length)},m:function(a,e,n){return e==="mo"?n.ordinalNumber(a.getMinutes(),{unit:"minute"}):Pe.m(a,e)},s:function(a,e,n){return e==="so"?n.ordinalNumber(a.getSeconds(),{unit:"second"}):Pe.s(a,e)},S:function(a,e){return Pe.S(a,e)},X:function(a,e,n){const s=a.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return ls(s);case"XXXX":case"XX":return Fe(s);default:return Fe(s,":")}},x:function(a,e,n){const s=a.getTimezoneOffset();switch(e){case"x":return ls(s);case"xxxx":case"xx":return Fe(s);default:return Fe(s,":")}},O:function(a,e,n){const s=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+as(s,":");default:return"GMT"+Fe(s,":")}},z:function(a,e,n){const s=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+as(s,":");default:return"GMT"+Fe(s,":")}},t:function(a,e,n){const s=Math.trunc(+a/1e3);return le(s,e.length)},T:function(a,e,n){return le(+a,e.length)}};function as(a,e=""){const n=a>0?"-":"+",s=Math.abs(a),i=Math.trunc(s/60),l=s%60;return l===0?n+String(i):n+String(i)+e+le(l,2)}function ls(a,e){return a%60===0?(a>0?"-":"+")+le(Math.abs(a)/60,2):Fe(a,e)}function Fe(a,e=""){const n=a>0?"-":"+",s=Math.abs(a),i=le(Math.trunc(s/60),2),l=le(s%60,2);return n+i+e+l}const rs=(a,e)=>{switch(a){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Ks=(a,e)=>{switch(a){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},ba=(a,e)=>{const n=a.match(/(P+)(p+)?/)||[],s=n[1],i=n[2];if(!i)return rs(a,e);let l;switch(s){case"P":l=e.dateTime({width:"short"});break;case"PP":l=e.dateTime({width:"medium"});break;case"PPP":l=e.dateTime({width:"long"});break;default:l=e.dateTime({width:"full"});break}return l.replace("{{date}}",rs(s,e)).replace("{{time}}",Ks(i,e))},ja={p:Ks,P:ba},ya=/^D+$/,wa=/^Y+$/,Sa=["D","DD","YY","YYYY"];function Na(a){return ya.test(a)}function Ca(a){return wa.test(a)}function Ma(a,e,n){const s=_a(a,e,n);if(console.warn(s),Sa.includes(a))throw new RangeError(s)}function _a(a,e,n){const s=a[0]==="Y"?"years":"days of the month";return`Use \`${a.toLowerCase()}\` instead of \`${a}\` (in \`${e}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ka=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ta=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Da=/^'([^]*?)'?$/,Va=/''/g,Aa=/[a-zA-Z]/;function Ia(a,e,n){const s=ct(),i=n?.locale??s.locale??An,l=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,r=Ie(a,n?.in);if(!fa(r))throw new RangeError("Invalid time value");let h=e.match(Ta).map(m=>{const f=m[0];if(f==="p"||f==="P"){const u=ja[f];return u(m,i.formatLong)}return m}).join("").match(ka).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const f=m[0];if(f==="'")return{isToken:!1,value:Oa(m)};if(is[f])return{isToken:!0,value:m};if(f.match(Aa))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:m}});i.localize.preprocessor&&(h=i.localize.preprocessor(r,h));const c={firstWeekContainsDate:l,weekStartsOn:o,locale:i};return h.map(m=>{if(!m.isToken)return m.value;const f=m.value;(!n?.useAdditionalWeekYearTokens&&Ca(f)||!n?.useAdditionalDayOfYearTokens&&Na(f))&&Ma(f,e,String(a));const u=is[f[0]];return u(r,f,i.localize,c)}).join("")}function Oa(a){const e=a.match(Da);return e?e[1].replace(Va,"'"):a}const Gs=25*1024*1024,vt="home",bt="knowledge";function os(a){return a==null?"":a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(0)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`}function Ee(a){return a.split("/").pop()??a}function Pa(a){const e=H.c(64),{form:n}=a,s=X(),{upload:i}=pi(vt),l=hi(),o=W.useRef(null),[r,h]=W.useState(!1),[c,m]=W.useState(""),[f,u]=W.useState(!1);let d;e[0]!==r?(d={enabled:r},e[0]=r,e[1]=d):d=e[1];const{data:p}=xi(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}=gi(g),y=b===void 0?[]:b;let j;e[4]!==n?(j=()=>n.getValues("metadata.knowledge")??[],e[4]=n,e[5]=j):j=e[5];const[v,S]=W.useState(j);let C;e[6]!==n?(C=P=>{S(P),n.setValue("metadata.knowledge",P,{shouldDirty:!0})},e[6]=n,e[7]=C):C=e[7];const M=C;let w;e[8]!==l||e[9]!==v||e[10]!==M||e[11]!==s||e[12]!==i?(w=async P=>{if(!P||P.length===0)return;const Z=Array.from(P),oe=Z.filter(Ua),Ne=Z.filter(La);if(Ne.length>0&&re.warning(s("virtualMcp.filesSection.fileTooLargeTitle"),{description:s("virtualMcp.filesSection.fileTooLargeDescription",{names:Ne.map(Ra).join(", ")})}),oe.length!==0){try{await i.mutateAsync({dir:bt,files:oe})}catch(be){const Oe=be;re.error(Oe instanceof Error?Oe.message:s("virtualMcp.filesSection.failedUploadFile"));return}M([...v,...oe.map(be=>({id:crypto.randomUUID(),name:be.name,volume:vt,path:`${bt}/${be.name}`,url:l(vt,`${bt}/${be.name}`),contentType:be.type||null,size:be.size,addedAt:new Date().toISOString()}))])}},e[8]=l,e[9]=v,e[10]=M,e[11]=s,e[12]=i,e[13]=w):w=e[13];const N=w;let _;e[14]!==l||e[15]!==v||e[16]!==M?(_=P=>{v.some(Z=>Z.volume===P.volume&&Z.path===P.path)||(M([...v,{id:crypto.randomUUID(),name:Ee(P.path),volume:P.volume,path:P.path,url:l(P.volume,P.path),contentType:null,size:P.size??null,addedAt:new Date().toISOString()}]),h(!1))},e[14]=l,e[15]=v,e[16]=M,e[17]=_):_=e[17];const D=_;let T;e[18]!==l||e[19]!==v||e[20]!==M?(T=P=>{v.some(Z=>Z.volume===P.volume&&Z.path===P.path)||(M([...v,{id:crypto.randomUUID(),name:Ee(P.path),kind:"skill",volume:P.volume,path:P.path,url:l(P.volume,P.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),h(!1))},e[18]=l,e[19]=v,e[20]=M,e[21]=T):T=e[21];const A=T;let V;e[22]!==v||e[23]!==M?(V=P=>{M(v.filter(Z=>Z.id!==P))},e[22]=v,e[23]=M,e[24]=V):V=e[24];const F=V;let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=P=>{h(P),P&&m("")},e[25]=I):I=e[25];const O=I;let z;e[26]!==v?(z=new Set(v.map(za)),e[26]=v,e[27]=z):z=e[27];const q=z,Y=c.toLowerCase();let K;e[28]!==q?(K=P=>!q.has(`${P.volume}/${P.path}`),e[28]=q,e[29]=K):K=e[29];const L=x.filter(Fa).filter(K).filter(P=>Ee(P.path).toLowerCase().includes(Y)).slice(0,5);let k;e[30]!==q?(k=P=>!q.has(`${P.volume}/${P.path}`),e[30]=q,e[31]=k):k=e[31];const $=y.filter(k).filter(P=>Ee(P.path).toLowerCase().includes(Y)).slice(0,5),G=P=>t.jsxs(gs,{open:r,onOpenChange:O,children:[t.jsx(vs,{asChild:!0,children:P}),t.jsxs(bs,{align:"end",className:"w-56",children:[t.jsxs(Ke,{onSelect:()=>{o.current?.click()},children:[t.jsx(Hn,{size:16}),s("virtualMcp.filesSection.uploadFile")]}),t.jsxs(Ut,{children:[t.jsxs(Yt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(fi,{size:16}),s("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(Bt,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(at,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:c,onChange:Z=>m(Z.target.value),onKeyDown:Ea,placeholder:s("virtualMcp.filesSection.searchFilesPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:L.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:s("virtualMcp.filesSection.noFilesFound")}):L.map(Z=>t.jsxs(Ke,{onSelect:()=>D(Z),children:[t.jsx(Zt,{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:os(Z.size)})]},`${Z.volume}/${Z.path}`))})]})]}),t.jsxs(Ut,{children:[t.jsxs(Yt,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(nt,{size:16}),s("virtualMcp.filesSection.selectSkill")]}),t.jsxs(Bt,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(at,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:c,onChange:Z=>m(Z.target.value),onKeyDown:$a,placeholder:s("virtualMcp.filesSection.searchSkillsPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:$.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:s("virtualMcp.filesSection.noSkillsFound")}):$.map(Z=>t.jsxs(Ke,{onSelect:()=>A(Z),children:[t.jsx(nt,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ee(Z.path)})]},`${Z.volume}/${Z.path}`))})]})]})]})]}),U="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 B;e[34]!==R?(B=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:R}),e[34]=R,e[35]=B):B=e[35];let J;e[36]!==s?(J=s("virtualMcp.filesSection.description"),e[36]=s,e[37]=J):J=e[37];let ie;e[38]!==J?(ie=t.jsx("p",{className:"text-sm text-muted-foreground",children:J}),e[38]=J,e[39]=ie):ie=e[39];let ee;e[40]!==B||e[41]!==ie?(ee=t.jsxs("div",{className:"flex flex-col gap-1",children:[B,ie]}),e[40]=B,e[41]=ie,e[42]=ee):ee=e[42];const ce=v.length>0&&G(t.jsxs(se,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(Xe,{size:"xs"}):t.jsx($e,{size:14}),s("virtualMcp.filesSection.add")]}));let de;e[43]!==ee||e[44]!==ce?(de=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[ee,ce]}),e[43]=ee,e[44]=ce,e[45]=de):de=e[45];let ue;e[46]!==N?(ue=t.jsx("input",{ref:o,type:"file",multiple:!0,className:"hidden",onChange:P=>{N(P.target.files),P.target.value=""}}),e[46]=N,e[47]=ue):ue=e[47];let te,pe;e[48]===Symbol.for("react.memo_cache_sentinel")?(te=P=>{P.preventDefault(),u(!0)},pe=()=>u(!1),e[48]=te,e[49]=pe):(te=e[48],pe=e[49]);let me;e[50]!==N?(me=P=>{P.preventDefault(),P.stopPropagation(),u(!1),N(P.dataTransfer.files)},e[50]=N,e[51]=me):me=e[51];const Se=f&&"outline outline-2 outline-dashed outline-primary";let E;e[52]!==Se?(E=fe("flex flex-col gap-2 rounded-lg",Se),e[52]=Se,e[53]=E):E=e[53];const ne=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($e,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:s("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):v.map(P=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-card",children:[P.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(nt,{size:16})}):t.jsx(Zt,{filename:P.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:P.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:P.kind==="skill"?s("virtualMcp.filesSection.kindSkill"):P.size!=null?os(P.size):s("virtualMcp.filesSection.kindFile")})]}),t.jsx(se,{variant:"ghost",size:"icon",onClick:()=>F(P.id),"aria-label":s("virtualMcp.filesSection.removeAriaLabel",{name:P.name}),children:t.jsx(Vt,{size:16})})]},P.id));let Q;e[54]!==te||e[55]!==pe||e[56]!==me||e[57]!==E||e[58]!==ne?(Q=t.jsx("div",{onDragOver:te,onDragLeave:pe,onDrop:me,className:E,children:ne}),e[54]=te,e[55]=pe,e[56]=me,e[57]=E,e[58]=ne,e[59]=Q):Q=e[59];let ae;return e[60]!==de||e[61]!==ue||e[62]!==Q?(ae=t.jsxs("section",{className:U,children:[de,ue,Q]}),e[60]=de,e[61]=ue,e[62]=Q,e[63]=ae):ae=e[63],ae}function $a(a){return a.stopPropagation()}function Ea(a){return a.stopPropagation()}function Fa(a){return a.kind!=="dir"}function za(a){return`${a.volume}/${a.path}`}function Ra(a){return a.name}function La(a){return a.size>Gs}function Ua(a){return a.size<=Gs}function Ya(a){return a==null?"all":a.length===0?"self":"selected"}function Ba(a){const e=H.c(88),{form:n,currentAgentId:s}=a,i=X(),{org:l}=Ae(),o=Cs(),[r,h]=W.useState(!1);let c;e[0]!==n?(c=n.getValues("metadata.subAgents")??null,e[0]=n,e[1]=c):c=e[1];const m=c;let f;e[2]!==m?(f=()=>Ya(m),e[2]=m,e[3]=f):f=e[3];const[u,d]=W.useState(f);let p;e[4]!==m?(p=m??[],e[4]=m,e[5]=p):p=e[5];const[x,g]=W.useState(p);let b,y,j,v,S,C;if(e[6]!==o||e[7]!==s||e[8]!==n||e[9]!==u||e[10]!==l||e[11]!==x||e[12]!==i){let _;e[19]!==s||e[20]!==l?(_=te=>te.id!==s&&te.id!==l.id&&te.status==="active",e[19]=s,e[20]=l,e[21]=_):_=e[21],b=o.filter(_);let D;e[22]!==x?(D=te=>x.includes(te.id),e[22]=x,e[23]=D):D=e[23];const T=b.filter(D);let A;e[24]!==n?(A=(te,pe)=>n.setValue("metadata.subAgents",te==="all"?null:te==="self"?[]:pe,{shouldDirty:!0}),e[24]=n,e[25]=A):A=e[25];const V=A;let F;e[26]!==V||e[27]!==x?(F=te=>{d(te),V(te,x)},e[26]=V,e[27]=x,e[28]=F):F=e[28];const I=F;let O;e[29]!==V||e[30]!==x?(O=te=>{const pe=x.includes(te)?x.filter(me=>me!==te):[...x,te];g(pe),V("selected",pe)},e[29]=V,e[30]=x,e[31]=O):O=e[31],y=O,S="flex flex-col gap-3";let z;e[32]!==i?(z=i("virtualMcp.subAgentsSection.title"),e[32]=i,e[33]=z):z=e[33];let q;e[34]!==z?(q=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:z}),e[34]=z,e[35]=q):q=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 K;e[39]!==u||e[40]!==i?(K=u==="self"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canOnlyDelegateToItself")}),e[39]=u,e[40]=i,e[41]=K):K=e[41];let L;e[42]!==q||e[43]!==Y||e[44]!==K?(L=t.jsxs("div",{className:"flex flex-col gap-1",children:[q,Y,K]}),e[42]=q,e[43]=Y,e[44]=K,e[45]=L):L=e[45];const k=u==="selected"&&T.length>0&&t.jsxs(se,{variant:"outline",size:"sm",onClick:()=>h(!0),children:[t.jsx($e,{size:14}),i("virtualMcp.subAgentsSection.addSubAgent")]});let $;e[46]!==I?($=te=>I(te),e[46]=I,e[47]=$):$=e[47];let G;e[48]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(ke,{size:"sm",className:"w-auto",children:t.jsx(Te,{})}),e[48]=G):G=e[48];let U;e[49]!==i?(U=i("virtualMcp.subAgentsSection.anyAgent"),e[49]=i,e[50]=U):U=e[50];let R;e[51]!==U?(R=t.jsx(xe,{value:"all",children:U}),e[51]=U,e[52]=R):R=e[52];let B;e[53]!==i?(B=i("virtualMcp.subAgentsSection.specificAgents"),e[53]=i,e[54]=B):B=e[54];let J;e[55]!==B?(J=t.jsx(xe,{value:"selected",children:B}),e[55]=B,e[56]=J):J=e[56];let ie;e[57]!==i?(ie=i("virtualMcp.subAgentsSection.onlyItself"),e[57]=i,e[58]=ie):ie=e[58];let ee;e[59]!==ie?(ee=t.jsx(xe,{value:"self",children:ie}),e[59]=ie,e[60]=ee):ee=e[60];let ce;e[61]!==R||e[62]!==J||e[63]!==ee?(ce=t.jsxs(De,{align:"end",children:[R,J,ee]}),e[61]=R,e[62]=J,e[63]=ee,e[64]=ce):ce=e[64];let de;e[65]!==u||e[66]!==$||e[67]!==ce?(de=t.jsxs(Ve,{value:u,onValueChange:$,children:[G,ce]}),e[65]=u,e[66]=$,e[67]=ce,e[68]=de):de=e[68];let ue;e[69]!==k||e[70]!==de?(ue=t.jsxs("div",{className:"flex items-center gap-2",children:[k,de]}),e[69]=k,e[70]=de,e[71]=ue):ue=e[71],e[72]!==L||e[73]!==ue?(C=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[L,ue]}),e[72]=L,e[73]=ue,e[74]=C):C=e[74],j="flex flex-col gap-2",v=u==="selected"&&(T.length>0?T.map(te=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-background",children:[t.jsx(We,{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(se,{variant:"ghost",size:"icon",onClick:()=>y(te.id),children:t.jsx(At,{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($e,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.emptyStateMessage")})]})),e[6]=o,e[7]=s,e[8]=n,e[9]=u,e[10]=l,e[11]=x,e[12]=i,e[13]=b,e[14]=y,e[15]=j,e[16]=v,e[17]=S,e[18]=C}else b=e[13],y=e[14],j=e[15],v=e[16],S=e[17],C=e[18];let M;e[75]!==j||e[76]!==v?(M=t.jsx("div",{className:j,children:v}),e[75]=j,e[76]=v,e[77]=M):M=e[77];let w;e[78]!==b||e[79]!==y||e[80]!==r||e[81]!==x?(w=t.jsx(Ka,{open:r,onOpenChange:h,candidates:b,selectedIds:x,onToggle:y}),e[78]=b,e[79]=y,e[80]=r,e[81]=x,e[82]=w):w=e[82];let N;return e[83]!==S||e[84]!==C||e[85]!==M||e[86]!==w?(N=t.jsxs("section",{className:S,children:[C,M,w]}),e[83]=S,e[84]=C,e[85]=M,e[86]=w,e[87]=N):N=e[87],N}function Ka(a){const e=H.c(39),{open:n,onOpenChange:s,candidates:i,selectedIds:l,onToggle:o}=a,r=X(),[h,c]=W.useState("");let m,f,u,d,p,x,g,b,y;if(e[0]!==i||e[1]!==s||e[2]!==o||e[3]!==n||e[4]!==h||e[5]!==l||e[6]!==r){const C=h.toLowerCase(),M=i.filter(_=>_.title.toLowerCase().includes(C)||_.description?.toLowerCase().includes(C));f=Je,b=n,y=s,m=Ze,p="max-w-md";let w;e[16]!==r?(w=r("virtualMcp.subAgentsSection.title"),e[16]=r,e[17]=w):w=e[17],e[18]!==w?(x=t.jsx(dt,{children:t.jsx(ut,{children:w})}),e[18]=w,e[19]=x):x=e[19];let 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(vi,{value:h,onChange:c,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=M.length===0?t.jsx("p",{className:"text-sm text-muted-foreground px-1 py-4 text-center",children:r("virtualMcp.subAgentsSection.noAgentsFound")}):M.map(_=>t.jsxs("button",{type:"button",onClick:()=>o(_.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(Is,{checked:l.includes(_.id),className:"pointer-events-none",tabIndex:-1}),t.jsx(We,{icon:_.icon,name:_.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:_.title}),_.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:_.description})]})]},_.id)),e[0]=i,e[1]=s,e[2]=o,e[3]=n,e[4]=h,e[5]=l,e[6]=r,e[7]=m,e[8]=f,e[9]=u,e[10]=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 qe(){const a=H.c(1);let e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(Xe,{className:"size-6 text-muted-foreground"})}),a[0]=e):e=a[0],e}function st(a,e){return({error:n})=>n?.message?.includes("Method not found")||n?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:a})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(js,{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 Ws(a){const e=H.c(23),{item:n,isSelected:s,onToggle:i,disabled:l}=a,o=l?"cursor-not-allowed opacity-50":"cursor-pointer",r=s?"bg-accent/25":"hover:bg-muted/50";let h;e[0]!==o||e[1]!==r?(h=fe("flex items-start gap-3 p-4 rounded-lg transition-colors",o,r),e[0]=o,e[1]=r,e[2]=h):h=e[2];let c;e[3]!==n.name?(c=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:n.name}),e[3]=n.name,e[4]=c):c=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]!==c||e[8]!==m?(f=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c,m]}),e[7]=c,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]!==l||e[16]!==s||e[17]!==i?(p=t.jsx(Is,{checked:s,onCheckedChange:i,disabled:l,className:"mt-0.5"}),e[15]=l,e[16]=s,e[17]=i,e[18]=p):p=e[18];let x;return e[19]!==h||e[20]!==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 Ga(a){const e=H.c(35),{activeTab:n,onTabChange:s,showSelectAll:i,isAllSelected:l,handleSelectAll:o}=a,r=X();let h;e[0]!==r?(h=r("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=r,e[1]=h):h=e[1];let c;e[2]!==h?(c={id:"tools",label:h},e[2]=h,e[3]=c):c=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]!==c||e[17]!==f||e[18]!==d||e[19]!==x?(g=[c,f,d,x],e[16]=c,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(bi,{tabs:g,activeTab:n,onTabChange:b}),e[23]=n,e[24]=b,e[25]=g,e[26]=y):y=e[26];let j;e[27]!==o||e[28]!==l||e[29]!==i||e[30]!==r?(j=i&&t.jsx("button",{type:"button",onClick:o,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r(l?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=o,e[28]=l,e[29]=i,e[30]=r,e[31]=j):j=e[31];let v;return e[32]!==y||e[33]!==j?(v=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border shrink-0",children:[y,j]}),e[32]=y,e[33]=j,e[34]=v):v=e[34],v}function Et(a){const e=H.c(13),{items:n,selections:s,onToggle:i,emptyMessage:l,disabled:o}=a;let r,h,c;if(e[0]!==o||e[1]!==l||e[2]!==n||e[3]!==i||e[4]!==s){c=Symbol.for("react.early_return_sentinel");e:{const f=n.map(Wa);if(n.length===0){let u;e[8]!==l?(u=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:l})}),e[8]=l,e[9]=u):u=e[9],c=u;break e}r="flex-1 overflow-auto px-4 py-3 space-y-1",h=n.map(u=>t.jsx(Ws,{item:u,isSelected:s===null||s?.includes(u.id),onToggle:()=>i(u.id,f),disabled:o},u.id))}e[0]=o,e[1]=l,e[2]=n,e[3]=i,e[4]=s,e[5]=r,e[6]=h,e[7]=c}else r=e[5],h=e[6],c=e[7];if(c!==Symbol.for("react.early_return_sentinel"))return c;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 Wa(a){return a.id}function Ha(a){const e=H.c(22),{connectionId:n,toolSelections:s,onToggleTool:i}=a,l=X(),{org:o}=Ae();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=mt(r);let c;e[4]!==h?(c={client:h},e[4]=h,e[5]=c):c=e[5];const{data:m}=$s(c),f=m.tools;let u,d,p;if(e[6]!==m.tools||e[7]!==i||e[8]!==l||e[9]!==s){p=Symbol.for("react.early_return_sentinel");e:{const g=f.map(Qa);let b;e[13]!==s?(b=v=>s===null||s.includes(v.name),e[13]=s,e[14]=b):b=e[14];const j=m.tools.filter(b).map(qa);if(j.length===0){let v;e[15]!==l?(v=l("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=l,e[16]=v):v=e[16];let S;e[17]!==v?(S=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:v})}),e[17]=v,e[18]=S):S=e[18],p=S;break e}u="flex-1 overflow-auto px-4 py-3 space-y-1",d=j.map(v=>t.jsx(Ws,{item:v,isSelected:!0,onToggle:()=>i(v.id,g)},v.id))}e[6]=m.tools,e[7]=i,e[8]=l,e[9]=s,e[10]=u,e[11]=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 qa(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Os,{annotations:a.annotations,_meta:a._meta})}}function Qa(a){return a.name}function Xa(a){const e=H.c(16),{connectionId:n,selections:s,onToggle:i,disabled:l}=a,{org:o}=Ae();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=mt(r);let c;e[4]!==h?(c={client:h},e[4]=h,e[5]=c):c=e[5];const{data:m}=$s(c);let f;e[6]!==m.tools?(f=m.tools.map(Ja),e[6]=m.tools,e[7]=f):f=e[7];const u=f,d=X();let p;e[8]!==d?(p=d("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=d,e[9]=p):p=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==s||e[14]!==p?(x=t.jsx(Et,{items:u,selections:s,onToggle:i,emptyMessage:p,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=s,e[14]=p,e[15]=x):x=e[15],x}function Ja(a){return{id:a.name,name:a.name,description:a.description,tags:t.jsx(Os,{annotations:a.annotations,_meta:a._meta})}}function Za(a){const e=H.c(16),{connectionId:n,selections:s,onToggle:i,disabled:l}=a,{org:o}=Ae();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=mt(r);let c;e[4]!==h?(c={client:h},e[4]=h,e[5]=c):c=e[5];const{data:m}=en(c);let f;e[6]!==m.resources?(f=m.resources.map(el),e[6]=m.resources,e[7]=f):f=e[7];const u=f,d=X();let p;e[8]!==d?(p=d("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=d,e[9]=p):p=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==s||e[14]!==p?(x=t.jsx(Et,{items:u,selections:s,onToggle:i,emptyMessage:p,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=s,e[14]=p,e[15]=x):x=e[15],x}function el(a){return{id:a.name||a.uri,name:a.name||a.uri,description:a.description}}function tl(a){const e=H.c(16),{connectionId:n,selections:s,onToggle:i,disabled:l}=a,{org:o}=Ae();let r;e[0]!==n||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:n,orgId:o.id,orgSlug:o.slug},e[0]=n,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const h=mt(r);let c;e[4]!==h?(c={client:h},e[4]=h,e[5]=c):c=e[5];const{data:m}=ji(c);let f;e[6]!==m.prompts?(f=m.prompts.map(sl),e[6]=m.prompts,e[7]=f):f=e[7];const u=f,d=X();let p;e[8]!==d?(p=d("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=d,e[9]=p):p=e[9];let x;return e[10]!==l||e[11]!==u||e[12]!==i||e[13]!==s||e[14]!==p?(x=t.jsx(Et,{items:u,selections:s,onToggle:i,emptyMessage:p,disabled:l}),e[10]=l,e[11]=u,e[12]=i,e[13]=s,e[14]=p,e[15]=x):x=e[15],x}function sl(a){return{id:a.name,name:a.name,description:a.description}}function nl(a){const e=H.c(58),{currentConnection:n,activeTab:s,selectedId:i,formData:l,toggleTool:o,toggleResource:r,togglePrompt:h,toggleAllTools:c,toggleAllResources:m,toggleAllPrompts:f,onTabChange:u}=a,d=X(),p=l[i],x=s==="tools"?p?.tools===null:s==="resources"?p?.resources===null:s==="prompts"?p?.prompts===null:!1,g=s!=="active";let b;e[0]!==s||e[1]!==i||e[2]!==f||e[3]!==m||e[4]!==c?(b=()=>{s==="tools"?c(i):s==="resources"?m(i):s==="prompts"&&f(i)},e[0]=s,e[1]=i,e[2]=f,e[3]=m,e[4]=c,e[5]=b):b=e[5];const y=b;let j;e[6]!==n.icon||e[7]!==n.title?(j=t.jsx(We,{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 M;e[16]!==j||e[17]!==C?(M=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[j,C]})}),e[16]=j,e[17]=C,e[18]=M):M=e[18];let w;e[19]!==s||e[20]!==y||e[21]!==x||e[22]!==u||e[23]!==g?(w=t.jsx(Ga,{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]!==l||e[27]!==i||e[28]!==d||e[29]!==o?(N=s==="active"&&t.jsx(Re,{fallback:st(d("virtualMcp.dependencySelectionDialog.toolsNotSupported"),d),children:t.jsx(W.Suspense,{fallback:t.jsx(qe,{}),children:t.jsx(Ha,{connectionId:i,toolSelections:l[i]?l[i].tools:[],onToggleTool:(F,I)=>o(i,F,I)})})}),e[25]=s,e[26]=l,e[27]=i,e[28]=d,e[29]=o,e[30]=N):N=e[30];let _;e[31]!==s||e[32]!==l||e[33]!==i||e[34]!==d||e[35]!==o?(_=s==="tools"&&t.jsx(Re,{fallback:st(d("virtualMcp.dependencySelectionDialog.toolsNotSupported"),d),children:t.jsx(W.Suspense,{fallback:t.jsx(qe,{}),children:t.jsx(Xa,{connectionId:i,selections:l[i]?l[i].tools:[],onToggle:(F,I)=>o(i,F,I)})})}),e[31]=s,e[32]=l,e[33]=i,e[34]=d,e[35]=o,e[36]=_):_=e[36];let D;e[37]!==s||e[38]!==l||e[39]!==i||e[40]!==d||e[41]!==r?(D=s==="resources"&&t.jsx(Re,{fallback:st(d("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),d),children:t.jsx(W.Suspense,{fallback:t.jsx(qe,{}),children:t.jsx(Za,{connectionId:i,selections:l[i]?l[i].resources:[],onToggle:(F,I)=>r(i,F,I)})})}),e[37]=s,e[38]=l,e[39]=i,e[40]=d,e[41]=r,e[42]=D):D=e[42];let T;e[43]!==s||e[44]!==l||e[45]!==i||e[46]!==d||e[47]!==h?(T=s==="prompts"&&t.jsx(Re,{fallback:st(d("virtualMcp.dependencySelectionDialog.promptsNotSupported"),d),children:t.jsx(W.Suspense,{fallback:t.jsx(qe,{}),children:t.jsx(tl,{connectionId:i,selections:l[i]?l[i].prompts:[],onToggle:(F,I)=>h(i,F,I)})})}),e[43]=s,e[44]=l,e[45]=i,e[46]=d,e[47]=h,e[48]=T):T=e[48];let A;e[49]!==D||e[50]!==T||e[51]!==N||e[52]!==_?(A=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[N,_,D,T]}),e[49]=D,e[50]=T,e[51]=N,e[52]=_,e[53]=A):A=e[53];let V;return e[54]!==A||e[55]!==M||e[56]!==w?(V=t.jsxs(t.Fragment,{children:[M,w,A]}),e[54]=A,e[55]=M,e[56]=w,e[57]=V):V=e[57],V}function il(a){const e=H.c(7),{onClose:n}=a,s=X();let i;e[0]!==n?(i=()=>n(!1),e[0]=n,e[1]=i):i=e[1];let l;e[2]!==s?(l=s("virtualMcp.dependencySelectionDialog.done"),e[2]=s,e[3]=l):l=e[3];let o;return e[4]!==i||e[5]!==l?(o=t.jsx(ks,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(se,{variant:"outline",onClick:i,children:l})}),e[4]=i,e[5]=l,e[6]=o):o=e[6],o}function al(a){const e=H.c(23),{connectionId:n,onAuthenticate:s,children:i}=a,l=X();let o;e[0]!==n?(o={connectionId:n},e[0]=n,e[1]=o):o=e[1];const r=Ps(o);if(r.supportsOAuth&&!r.isAuthenticated){let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-muted",children:t.jsx(qn,{size:22,className:"text-muted-foreground"})}),e[2]=m):m=e[2];let f;e[3]!==l?(f=l("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=l,e[4]=f):f=e[4];let u;e[5]!==f?(u=t.jsx("p",{className:"text-sm font-medium",children:f}),e[5]=f,e[6]=u):u=e[6];let d;e[7]!==l?(d=l("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=l,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]!==l?(g=s&&t.jsx(se,{variant:"outline",size:"sm",onClick:()=>s(n),children:l("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=n,e[15]=s,e[16]=l,e[17]=g):g=e[17];let b;return e[18]!==x||e[19]!==g?(b=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-8 text-center",children:[m,x,g]}),e[18]=x,e[19]=g,e[20]=b):b=e[20],b}let c;return e[21]!==i?(c=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=c):c=e[22],c}function ll(a){const e={};for(const n of a)e[n.connection_id]={tools:n.selected_tools,resources:n.selected_resources??null,prompts:n.selected_prompts??null};return e}function cs(a){return Object.entries(a).map(([e,n])=>({connection_id:e,selected_tools:n.tools,selected_resources:n.resources,selected_prompts:n.prompts}))}function ds(a,e,n,s){const i=a[e]??{tools:null,resources:null,prompts:null};return{...a,[e]:{...i,[n]:s}}}function rl(a,e){return e.type==="SET_ACTIVE_TAB"?{...a,activeTab:e.payload}:a}function ol(a){const e=H.c(49),{open:n,onOpenChange:s,selectedId:i,form:l,connections:o,onAuthenticate:r}=a;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activeTab:"tools"},e[0]=h):h=e[0];const[c,m]=W.useReducer(rl,h),f=_t(i??"");let u;e[1]!==o?(u=o??[],e[1]=o,e[2]=u):u=e[2];let d;e[3]!==u?(d=ll(u),e[3]=u,e[4]=d):d=e[4];const p=d;let x;e[5]!==l||e[6]!==p?(x=(L,k,$,G)=>{const U=p[L]?.[k];let R;U===null?R=G.filter(B=>B!==$):U?.includes($)?R=U.filter(B=>B!==$):(R=[...U??[],$],R.length===G.length&&(R=null)),l.setValue("connections",cs(ds(p,L,k,R)),{shouldDirty:!0,shouldTouch:!0})},e[5]=l,e[6]=p,e[7]=x):x=e[7];const g=x;let b;e[8]!==l||e[9]!==p?(b=(L,k)=>{const G=p[L]?.[k]===null?[]:null;l.setValue("connections",cs(ds(p,L,k,G)),{shouldDirty:!0,shouldTouch:!0})},e[8]=l,e[9]=p,e[10]=b):b=e[10];const y=b;let j;e[11]!==g?(j=(L,k,$)=>g(L,"tools",k,$),e[11]=g,e[12]=j):j=e[12];const v=j;let S;e[13]!==g?(S=(L,k,$)=>g(L,"resources",k,$),e[13]=g,e[14]=S):S=e[14];const C=S;let M;e[15]!==g?(M=(L,k,$)=>g(L,"prompts",k,$),e[15]=g,e[16]=M):M=e[16];const w=M;let N;e[17]!==y?(N=L=>y(L,"tools"),e[17]=y,e[18]=N):N=e[18];const _=N;let D;e[19]!==y?(D=L=>y(L,"resources"),e[19]=y,e[20]=D):D=e[20];const T=D;let A;e[21]!==y?(A=L=>y(L,"prompts"),e[21]=y,e[22]=A):A=e[22];const V=A;if(!i||!f)return null;let F;e[23]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(qe,{}),e[23]=F):F=e[23];let I;e[24]===Symbol.for("react.memo_cache_sentinel")?(I=L=>m({type:"SET_ACTIVE_TAB",payload:L}),e[24]=I):I=e[24];let O;e[25]!==f||e[26]!==c.activeTab||e[27]!==p||e[28]!==i||e[29]!==V||e[30]!==T||e[31]!==_||e[32]!==w||e[33]!==C||e[34]!==v?(O=t.jsx(nl,{currentConnection:f,activeTab:c.activeTab,selectedId:i,formData:p,toggleTool:v,toggleResource:C,togglePrompt:w,toggleAllTools:_,toggleAllResources:T,toggleAllPrompts:V,onTabChange:I},i),e[25]=f,e[26]=c.activeTab,e[27]=p,e[28]=i,e[29]=V,e[30]=T,e[31]=_,e[32]=w,e[33]=C,e[34]=v,e[35]=O):O=e[35];let z;e[36]!==r||e[37]!==i||e[38]!==O?(z=t.jsx(W.Suspense,{fallback:F,children:t.jsx(al,{connectionId:i,onAuthenticate:r,children:O})}),e[36]=r,e[37]=i,e[38]=O,e[39]=z):z=e[39];let q;e[40]!==s?(q=t.jsx(il,{onClose:s}),e[40]=s,e[41]=q):q=e[41];let Y;e[42]!==z||e[43]!==q?(Y=t.jsxs(Ze,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[z,q]}),e[42]=z,e[43]=q,e[44]=Y):Y=e[44];let K;return e[45]!==s||e[46]!==n||e[47]!==Y?(K=t.jsx(Je,{open:n,onOpenChange:s,children:Y}),e[45]=s,e[46]=n,e[47]=Y,e[48]=K):K=e[48],K}const us="__new_instance__";function cl(a){const e=H.c(25),{connection_id:n,usedConnectionIds:s,onOpenSettings:i,onRemove:l,onAuthenticate:o,onSwitchInstance:r,onNewInstance:h}=a,c=_t(n),{org:m}=Ae();if(!c){let g;return e[0]!==l?(g=t.jsx(fl,{onRemove:l}),e[0]=l,e[1]=g):g=e[1],g}let f;e[2]!==c?(f=yi(c),e[2]=c,e[3]=f):f=e[3];const u=f;let d;e[4]!==n?(d=t.jsx(ml,{connection_id:n}),e[4]=n,e[5]=d):d=e[5];let p;e[6]!==c.app_name||e[7]!==c.connection_type||e[8]!==c.description||e[9]!==c.icon||e[10]!==c.status||e[11]!==c.title||e[12]!==n||e[13]!==o||e[14]!==h||e[15]!==i||e[16]!==l||e[17]!==r||e[18]!==m.slug||e[19]!==u||e[20]!==s?(p=t.jsx(ul,{connection_id:n,connectionTitle:c.title,connectionDescription:c.description,connectionIcon:c.icon,connectionType:c.connection_type,connectionStatus:c.status,slug:u,orgSlug:m.slug,appName:c.app_name,usedConnectionIds:s,onOpenSettings:i,onRemove:l,onAuthenticate:o,onSwitchInstance:r,onNewInstance:h}),e[6]=c.app_name,e[7]=c.connection_type,e[8]=c.description,e[9]=c.icon,e[10]=c.status,e[11]=c.title,e[12]=n,e[13]=o,e[14]=h,e[15]=i,e[16]=l,e[17]=r,e[18]=m.slug,e[19]=u,e[20]=s,e[21]=p):p=e[21];let x;return e[22]!==d||e[23]!==p?(x=t.jsx(W.Suspense,{fallback:d,children:p}),e[22]=d,e[23]=p,e[24]=x):x=e[24],x}function dl(a){const e=H.c(24),{appName:n,connectionId:s,usedConnectionIds:i,onSwitchInstance:l,onNewInstance:o}=a,r=X();let h;e[0]!==n?(h={filters:[{column:"app_name",value:n}]},e[0]=n,e[1]=h):h=e[1];const c=Pn(h);if(c.length<=1&&!o)return null;let m;e[2]!==s||e[3]!==o||e[4]!==l?(m=g=>{g===us?o?.():l(s,g)},e[2]=s,e[3]=o,e[4]=l,e[5]=m):m=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ke,{size:"sm",className:"w-auto text-xs gap-1 px-2 shadow-none",children:t.jsx(Te,{})}),e[6]=f):f=e[6];let u;if(e[7]!==s||e[8]!==c||e[9]!==i){let g;e[11]!==s||e[12]!==i?(g=b=>t.jsx(xe,{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=c.map(g),e[7]=s,e[8]=c,e[9]=i,e[10]=u}else u=e[10];let d;e[14]!==o||e[15]!==r?(d=o&&t.jsxs(xe,{value:us,className:"text-xs text-muted-foreground",children:["+ ",r("virtualMcp.connectionItem.newInstance")]}),e[14]=o,e[15]=r,e[16]=d):d=e[16];let p;e[17]!==u||e[18]!==d?(p=t.jsxs(De,{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(Ve,{value:s,onValueChange:m,children:[f,p]}),e[20]=s,e[21]=m,e[22]=p,e[23]=x):x=e[23],x}function ul({connection_id:a,connectionTitle:e,connectionDescription:n,connectionIcon:s,connectionType:i,connectionStatus:l,slug:o,orgSlug:r,appName:h,usedConnectionIds:c,onOpenSettings:m,onRemove:f,onAuthenticate:u,onSwitchInstance:d,onNewInstance:p}){const x=Ps({connectionId:a}),g=Ns(),y=!(i==="VIRTUAL")&&x.supportsOAuth&&!x.isAuthenticated,j=l!=="active",v=X(),S=async C=>{try{await g.update.mutateAsync({id:a,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:fe("rounded-xl border overflow-hidden transition-colors",y||j?"border-destructive/50 bg-destructive/5":"border-border bg-card"),children:[t.jsxs(ys,{to:"/$org/settings/connections/$appSlug",params:{org:r,appSlug:o},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors",children:[t.jsx(We,{icon:s,name:e,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:e}),y?t.jsx("span",{className:"text-xs text-destructive font-medium",children:v("virtualMcp.connectionItem.needsAuthorization")}):j?t.jsx("span",{className:"text-xs text-destructive font-medium",children:v(l==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):n&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n})]}),y?t.jsx(se,{variant:"outline",size:"sm",className:"h-7 text-xs shrink-0",onClick:C=>{C.preventDefault(),C.stopPropagation(),u(a)},children:v("virtualMcp.connectionItem.authorize")}):j?t.jsxs(se,{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(Qn,{size:13}),v("virtualMcp.connectionItem.enable")]}):t.jsxs(je,{delayDuration:0,children:[t.jsx(ye,{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(ui,{size:16})})}),t.jsx(we,{side:"bottom",children:v("virtualMcp.connectionItem.connectionSettings")})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-t border-border bg-muted/25",children:[h&&t.jsx(dl,{appName:h,connectionId:a,usedConnectionIds:c,onSwitchInstance:d,onNewInstance:p}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(je,{delayDuration:0,children:[t.jsx(ye,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:m,"aria-label":v("virtualMcp.connectionItem.configureResources"),children:t.jsx(Xn,{size:13})})}),t.jsx(we,{side:"bottom",children:v("virtualMcp.connectionItem.configureResources")})]}),!j&&t.jsxs(je,{delayDuration:0,children:[t.jsx(ye,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>S("inactive"),"aria-label":v("virtualMcp.connectionItem.disableConnection"),children:t.jsx(Jn,{size:13})})}),t.jsx(we,{side:"bottom",children:v("virtualMcp.connectionItem.disable")})]}),t.jsxs(je,{delayDuration:0,children:[t.jsx(ye,{asChild:!0,children:t.jsx(se,{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(At,{size:13})})}),t.jsx(we,{side:"bottom",children:v("virtualMcp.connectionItem.remove")})]})]})]})]})}function ml(a){const e=H.c(17),{connection_id:n}=a,s=_t(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(We,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0"}),e[1]=s.icon,e[2]=s.title,e[3]=i):i=e[3];let l;e[4]!==s.title?(l=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[4]=s.title,e[5]=l):l=e[5];let o;e[6]!==s.description?(o=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[6]=s.description,e[7]=o):o=e[7];let r;e[8]!==l||e[9]!==o?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,o]}),e[8]=l,e[9]=o,e[10]=r):r=e[10];let h;e[11]!==i||e[12]!==r?(h=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,r]}),e[11]=i,e[12]=r,e[13]=h):h=e[13];let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=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]=c):c=e[14];let m;return e[15]!==h?(m=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[h,c]}),e[15]=h,e[16]=m):m=e[16],m}function fl(a){const e=H.c(20),{onRemove:n}=a,s=X();let i;e[0]!==s?(i=s("virtualMcp.connectionItem.connectionNotFound"),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==i?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm text-destructive font-medium truncate",children:i})}),e[2]=i,e[3]=l):l=e[3];let o;e[4]!==s?(o=s("virtualMcp.connectionItem.removeConnection"),e[4]=s,e[5]=o):o=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(At,{size:13}),e[6]=r):r=e[6];let h;e[7]!==n||e[8]!==o?(h=t.jsx(ye,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive shrink-0",onClick:n,"aria-label":o,children:r})}),e[7]=n,e[8]=o,e[9]=h):h=e[9];let c;e[10]!==s?(c=s("virtualMcp.connectionItem.remove"),e[10]=s,e[11]=c):c=e[11];let m;e[12]!==c?(m=t.jsx(we,{side:"bottom",children:c}),e[12]=c,e[13]=m):m=e[13];let f;e[14]!==h||e[15]!==m?(f=t.jsxs(je,{delayDuration:0,children:[h,m]}),e[14]=h,e[15]=m,e[16]=f):f=e[16];let u;return e[17]!==l||e[18]!==f?(u=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-destructive/50 bg-destructive/5",children:[l,f]}),e[17]=l,e[18]=f,e[19]=u):u=e[19],u}function Hs(){const a=H.c(3);let e;a[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),a[0]=e):e=a[0];let n;a[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e,t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-48 rounded bg-muted animate-pulse"})]})]}),a[1]=n):n=a[1];let s;return a[2]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[n,t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})})]}),a[2]=s):s=a[2],s}function pl(a){const e=H.c(5),{value:n}=a;let s;if(e[0]!==n){s=Symbol.for("react.early_return_sentinel");e:{const l=kt(n);if(l.type==="icon"){const o=Dt(l.name);if(o){let r;e[2]!==o?(r=t.jsx(o,{size:16,className:"text-muted-foreground"}),e[2]=o,e[3]=r):r=e[3],s=r;break e}}}e[0]=n,e[1]=s}else s=e[1];if(s!==Symbol.for("react.early_return_sentinel"))return s;let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(wi,{size:16,className:"text-muted-foreground"}),e[4]=i):i=e[4],i}function hl(a){const e=H.c(74),{value:n,onChange:s,className:i,disabled:l}=a,o=X(),[r,h]=W.useState(!1),[c,m]=W.useState("");let f;e[0]!==n?(f=kt(n),e[0]=n,e[1]=f):f=e[1];const u=f,d=u.type==="icon"?u.name:null;let p,x,g,b,y,j,v,S,C,M,w,N,_,D,T;if(e[2]!==i||e[3]!==d||e[4]!==l||e[5]!==s||e[6]!==r||e[7]!==c||e[8]!==o||e[9]!==n){const q=Tt();b=Ts(q,c),g=It,y=l?!1:r,j=h;let Y;e[25]!==o?(Y=o("common.simpleIconPicker.changeIcon"),e[25]=o,e[26]=Y):Y=e[26];const K=l?"cursor-default opacity-50":"cursor-pointer hover:bg-accent";let L;e[27]!==i||e[28]!==K?(L=fe("size-7 shrink-0 rounded-lg transition-colors flex items-center justify-center",K,i),e[27]=i,e[28]=K,e[29]=L):L=e[29];let k;e[30]!==n?(k=t.jsx(pl,{value:n}),e[30]=n,e[31]=k):k=e[31],e[32]!==l||e[33]!==Y||e[34]!==L||e[35]!==k?(v=t.jsx(Ot,{asChild:!0,children:t.jsx("button",{type:"button",disabled:l,"aria-label":Y,className:L,children:k})}),e[32]=l,e[33]=Y,e[34]=L,e[35]=k,e[36]=v):v=e[36],x=Pt,_="start",D="w-64 p-0",T=xl,w="flex flex-col";let $;e[37]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(at,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[37]=$):$=e[37];let G;e[38]===Symbol.for("react.memo_cache_sentinel")?(G=B=>m(B.target.value),e[38]=G):G=e[38];let U;e[39]!==o?(U=o("common.simpleIconPicker.filterPlaceholder"),e[39]=o,e[40]=U):U=e[40],e[41]!==c||e[42]!==U?(N=t.jsx("div",{className:"px-2 py-2",children:t.jsxs("div",{className:"relative",children:[$,t.jsx(Me,{value:c,onChange:G,placeholder:U,className:"h-7 text-xs pl-7"})]})}),e[41]=c,e[42]=U,e[43]=N):N=e[43],p=Es,M="h-48",S="grid grid-cols-8 gap-0.5 px-2 pb-2";let R;e[44]!==d||e[45]!==s?(R=B=>{const J=Dt(B);return J?t.jsx("button",{type:"button",onClick:()=>{s(`icon://${B}`),h(!1)},className:fe("h-7 w-7 flex items-center justify-center rounded-lg transition-colors cursor-pointer",d===B?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground"),title:wt(B),"aria-label":wt(B),children:t.jsx(J,{size:16})},B):null},e[44]=d,e[45]=s,e[46]=R):R=e[46],C=b.map(R),e[2]=i,e[3]=d,e[4]=l,e[5]=s,e[6]=r,e[7]=c,e[8]=o,e[9]=n,e[10]=p,e[11]=x,e[12]=g,e[13]=b,e[14]=y,e[15]=j,e[16]=v,e[17]=S,e[18]=C,e[19]=M,e[20]=w,e[21]=N,e[22]=_,e[23]=D,e[24]=T}else p=e[10],x=e[11],g=e[12],b=e[13],y=e[14],j=e[15],v=e[16],S=e[17],C=e[18],M=e[19],w=e[20],N=e[21],_=e[22],D=e[23],T=e[24];let A;e[47]!==S||e[48]!==C?(A=t.jsx("div",{className:S,children:C}),e[47]=S,e[48]=C,e[49]=A):A=e[49];let V;e[50]!==b.length||e[51]!==o?(V=b.length===0&&t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:o("common.simpleIconPicker.noIconsFound")}),e[50]=b.length,e[51]=o,e[52]=V):V=e[52];let F;e[53]!==p||e[54]!==A||e[55]!==V||e[56]!==M?(F=t.jsxs(p,{className:M,children:[A,V]}),e[53]=p,e[54]=A,e[55]=V,e[56]=M,e[57]=F):F=e[57];let I;e[58]!==F||e[59]!==w||e[60]!==N?(I=t.jsxs("div",{className:w,children:[N,F]}),e[58]=F,e[59]=w,e[60]=N,e[61]=I):I=e[61];let O;e[62]!==x||e[63]!==I||e[64]!==_||e[65]!==D||e[66]!==T?(O=t.jsx(x,{align:_,className:D,onOpenAutoFocus:T,children:I}),e[62]=x,e[63]=I,e[64]=_,e[65]=D,e[66]=T,e[67]=O):O=e[67];let z;return e[68]!==g||e[69]!==y||e[70]!==j||e[71]!==v||e[72]!==O?(z=t.jsxs(g,{open:y,onOpenChange:j,children:[v,O]}),e[68]=g,e[69]=y,e[70]=j,e[71]=v,e[72]=O,e[73]=z):z=e[73],z}function xl(a){return a.preventDefault()}function gl(a){const e=H.c(10),{viewId:n}=a;if(n==="overview"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ds,{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(Ht,{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(Zn,{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(Ci,{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(Ni,{size:16}),e[4]=i):i=e[4],i}if(n==="hosting"){let i;return e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(tn,{size:16}),e[5]=i):i=e[5],i}if(n==="e2e"){let i;return e[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ei,{size:16}),e[6]=i):i=e[6],i}if(n==="analytics"){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ht,{size:16}),e[7]=i):i=e[7],i}if(n==="cdn"){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ti,{size:16}),e[8]=i):i=e[8],i}let s;return e[9]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Vs,{size:16}),e[9]=s):s=e[9],s}function ms(a){const e=H.c(51),{pinned:n,canSetMainView:s,onOpen:i,onTogglePin:l,onSetMainView:o}=a,r=X(),h=n?"text-foreground":"text-muted-foreground/40";let c;e[0]!==h?(c=fe("size-7",h),e[0]=h,e[1]=c):c=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(qt,{size:16}),e[5]=f):f=e[5];let u;e[6]!==l||e[7]!==n||e[8]!==c||e[9]!==m?(u=t.jsx(ye,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"icon",className:c,"aria-label":m,"aria-pressed":n,onClick:l,children:f})}),e[6]=l,e[7]=n,e[8]=c,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(we,{side:"top",children:d}),e[14]=d,e[15]=p):p=e[15];let x;e[16]!==u||e[17]!==p?(x=t.jsxs(je,{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(Si,{size:16}),e[21]=b):b=e[21];let y;e[22]!==g?(y=t.jsx(vs,{asChild:!0,children:t.jsx(se,{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(sn,{size:14}),e[24]=j):j=e[24];let v;e[25]!==r?(v=r("virtualMcp.settings.views.open"),e[25]=r,e[26]=v):v=e[26];let S;e[27]!==i||e[28]!==v?(S=t.jsxs(Ke,{onClick:i,children:[j,v]}),e[27]=i,e[28]=v,e[29]=S):S=e[29];let C;e[30]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(qt,{size:14}),e[30]=C):C=e[30];let M;e[31]!==n||e[32]!==r?(M=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=n,e[32]=r,e[33]=M):M=e[33];let w;e[34]!==l||e[35]!==M?(w=t.jsxs(Ke,{onClick:l,children:[C,M]}),e[34]=l,e[35]=M,e[36]=w):w=e[36];let N;e[37]!==s||e[38]!==o||e[39]!==r?(N=s&&t.jsxs(Ke,{onClick:o,children:[t.jsx(Ds,{size:14}),r("virtualMcp.settings.views.setMainView")]}),e[37]=s,e[38]=o,e[39]=r,e[40]=N):N=e[40];let _;e[41]!==S||e[42]!==w||e[43]!==N?(_=t.jsxs(bs,{align:"end",children:[S,w,N]}),e[41]=S,e[42]=w,e[43]=N,e[44]=_):_=e[44];let D;e[45]!==y||e[46]!==_?(D=t.jsxs(gs,{children:[y,_]}),e[45]=y,e[46]=_,e[47]=D):D=e[47];let T;return e[48]!==D||e[49]!==x?(T=t.jsxs("div",{className:"flex items-center gap-1",children:[x,D]}),e[48]=D,e[49]=x,e[50]=T):T=e[50],T}const fs=a=>a.stopPropagation();function vl(a){const e=H.c(8),{icon:n,title:s}=a;let i;e[0]!==n||e[1]!==s?(i=t.jsx(We,{icon:n,name:s,size:"xs",className:"shrink-0"}),e[0]=n,e[1]=s,e[2]=i):i=e[2];let l;e[3]!==s?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:s}),e[3]=s,e[4]=l):l=e[4];let o;return e[5]!==i||e[6]!==l?(o=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,l]}),e[5]=i,e[6]=l,e[7]=o):o=e[7],o}function bl(a){const e=H.c(70),{views:n}=a,s=X();let i;e[0]!==s?(i=s("virtualMcp.settings.views.defaults"),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==s?(l=s("virtualMcp.layoutTabContent.mainView"),e[2]=s,e[3]=l):l=e[3];let o;e[4]!==s?(o=s("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=s,e[5]=o):o=e[5];const r=n.defaultMainView,h=n.setMainView;let c;e[6]!==s?(c=s("virtualMcp.layoutTabContent.mainView"),e[6]=s,e[7]=c):c=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(Te,{placeholder:m}),e[10]=m,e[11]=f):f=e[11];let u;e[12]!==c||e[13]!==f?(u=t.jsx(ke,{"aria-label":c,className:"w-36 h-8 text-sm shrink-0 @min-xl/project-settings:w-44",children:f}),e[12]=c,e[13]=f,e[14]=u):u=e[14];let d;e[15]!==n.defaultMainOptions?(d=n.defaultMainOptions.map(jl),e[15]=n.defaultMainOptions,e[16]=d):d=e[16];let p;e[17]!==d?(p=t.jsx(De,{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(Ve,{value:r,onValueChange:h,children:[u,p]}),e[19]=p,e[20]=u,e[21]=n.defaultMainView,e[22]=n.setMainView,e[23]=x):x=e[23];let g;e[24]!==x||e[25]!==l||e[26]!==o?(g=t.jsx(He,{title:l,description:o,action:x}),e[24]=x,e[25]=l,e[26]=o,e[27]=g):g=e[27];let b;e[28]!==s?(b=s("virtualMcp.layoutTabContent.showChat"),e[28]=s,e[29]=b):b=e[29];let y;e[30]!==s?(y=s("virtualMcp.layoutTabContent.showChatDescription"),e[30]=s,e[31]=y):y=e[31];let j;e[32]!==s?(j=s("virtualMcp.layoutTabContent.showChat"),e[32]=s,e[33]=j):j=e[33];const v=n.noMainView?!0:n.chatDefaultOpen;let S;e[34]!==j||e[35]!==v||e[36]!==n.noMainView||e[37]!==n.setChatDefaultOpen?(S=t.jsx(ye,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(ft,{"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(we,{side:"top",children:s("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[39]=s,e[40]=n.noMainView,e[41]=C):C=e[41];let M;e[42]!==S||e[43]!==C?(M=t.jsxs(je,{delayDuration:0,children:[S,C]}),e[42]=S,e[43]=C,e[44]=M):M=e[44];let w;e[45]!==b||e[46]!==y||e[47]!==M?(w=t.jsx(He,{title:b,description:y,action:M}),e[45]=b,e[46]=y,e[47]=M,e[48]=w):w=e[48];let N;e[49]!==g||e[50]!==w?(N=t.jsxs(Le,{children:[g,w]}),e[49]=g,e[50]=w,e[51]=N):N=e[51];let _;e[52]!==i||e[53]!==N?(_=t.jsx(Be,{title:i,children:N}),e[52]=i,e[53]=N,e[54]=_):_=e[54];let D;e[55]!==s?(D=s("virtualMcp.settings.views.sidebar"),e[55]=s,e[56]=D):D=e[56];let T;e[57]!==n?(T=n.projectViews.map(O=>{const z=n.pinned(O);return t.jsx(He,{icon:t.jsx(gl,{viewId:O}),title:n.labels[O],onClick:()=>n.openView(O),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ms,{pinned:z,canSetMainView:z&&!n.isMainView(O),onOpen:()=>n.openView(O),onTogglePin:()=>n.togglePin(O,!z),onSetMainView:()=>n.setMainView(O)}),t.jsx("span",{onClick:()=>n.openView(O),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Kt,{size:16})})]})},O)}),e[57]=n,e[58]=T):T=e[58];let A;e[59]!==n?(A=n.connectionsData.flatMap(O=>[t.jsx(vl,{icon:O.icon,title:O.title},`${O.id}:header`),...O.uiTools.map(z=>{const q=n.pinnedAppViews.find(k=>k.connectionId===O.id&&k.toolName===z.name),Y=!!q,K=nn(O.id,z.name),L=`ext-apps:${O.id}:${z.name}`;return t.jsx(He,{onClick:()=>n.openView(K),icon:Y?t.jsx("span",{onClick:fs,children:t.jsx(hl,{value:q.icon??null,onChange:k=>n.setAppViewIcon(O.id,z.name,k)})}):t.jsx(Vs,{size:16}),title:Y?t.jsx("span",{onClick:fs,children:t.jsx(Me,{value:q.label,onChange:k=>n.setAppViewLabel(O.id,z.name,k.target.value),onBlur:n.commitAppViewLabel,"aria-label":z.title??St(z.name),className:"h-7 w-full max-w-52 text-sm"})}):z.title??St(z.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ms,{pinned:Y,canSetMainView:Y&&!n.isMainView(L),onOpen:()=>n.openView(K),onTogglePin:()=>n.toggleAppViewPin(O.id,z.name),onSetMainView:()=>n.setMainView(L)}),t.jsx("span",{onClick:()=>n.openView(K),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Kt,{size:16})})]})},`${O.id}:${z.name}`)})]),e[59]=n,e[60]=A):A=e[60];let V;e[61]!==T||e[62]!==A?(V=t.jsxs(Le,{children:[T,A]}),e[61]=T,e[62]=A,e[63]=V):V=e[63];let F;e[64]!==D||e[65]!==V?(F=t.jsx(Be,{title:D,children:V}),e[64]=D,e[65]=V,e[66]=F):F=e[66];let I;return e[67]!==_||e[68]!==F?(I=t.jsxs(t.Fragment,{children:[_,F]}),e[67]=_,e[68]=F,e[69]=I):I=e[69],I}function jl(a){return t.jsx(xe,{value:a.value,children:a.label},a.value)}const qs="site-editor",yl=new Set([qs,"content"]);function wl({virtualMcpId:a,form:e,flushAndSave:n}){const s=X(),i=ot(),{openPanel:l}=Ti(),o=Ms(a),r=Di(o),h=Fs(a),c=Ei(a),m=(o?.connections??[]).map(k=>k.connection_id).sort(),{data:f}=an({queryKey:ws.projectConnectionDetails(a,m),enabled:m.length>0,queryFn:async()=>await Promise.all(m.map(async $=>{try{const{item:G}=await i.call("COLLECTION_CONNECTIONS_GET",{id:$}),U=(G?.tools??[]).flatMap(R=>{const B=Mi(R._meta);return B?[{name:R.name,title:R.title,description:R.description,resourceUri:B}]:[]});return{fetchOk:!0,id:$,title:G?.title??$,icon:G?.icon??null,uiTools:U}}catch{return{fetchOk:!1,id:$,title:$,icon:null,uiTools:[]}}}))}),u=(f??[]).filter(k=>k.uiTools.length>0),d=new Set([...ln,...rn]),p=e.watch("metadata.ui.pinnedViews")??[],x=e.watch("metadata.ui.layout")??null,g=x?.defaultMainView??null,b=x?.chatDefaultOpen??!1,y=Nt(Ct({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:x}}),e.watch("metadata.sidebarViewsVersion")),j=c??(o?Nt(Ct(o.metadata),o.metadata.sidebarViewsVersion):y),v=(()=>{if(!g||g.type==="chat")return"";const k=on(g.type);return k==="instructions"||k==="connections"||k==="layout"?"settings":yl.has(k)?qs:d.has(k)?k:`${k}:${g.id??""}:${g.toolName??""}`})(),S=v==="",C=k=>{const[$,G,U]=k.split(":");return $?d.has($)?{type:$}:$==="ext-apps"&&G?{type:"ext-apps",id:G,toolName:U||void 0}:null:null},M=k=>{e.setValue("metadata.ui.pinnedViews",k,{shouldDirty:!0})},w=k=>{e.setValue("metadata.ui.layout",{...x,...k},{shouldDirty:!0})},N=W.useRef(!1);if(f&&f.length>0&&!N.current){N.current=!0;const k=new Set((f??[]).filter(R=>R.fetchOk).map(R=>R.id)),$=new Set(u.flatMap(R=>R.uiTools.map(B=>`${R.id}:${B.name}`))),G=new Set(m),U=p.filter(R=>G.has(R.connectionId)&&(!k.has(R.connectionId)||$.has(`${R.connectionId}:${R.toolName}`)));U.length!==p.length&&(M(U),g?.type==="ext-apps"&&!U.some(R=>R.connectionId===g.id&&R.toolName===g.toolName)&&w({defaultMainView:{type:"settings"}}))}const _=(k,$)=>{if(p.some(U=>U.connectionId===k&&U.toolName===$)){const U=p.filter(B=>!(B.connectionId===k&&B.toolName===$));M(U);const R=`ext-apps:${k}:${$}`;v===R&&w({defaultMainView:{type:"settings"}})}else{const U=u.find(R=>R.id===k)?.uiTools.find(R=>R.name===$)?.title;M([...p,{connectionId:k,toolName:$,label:U??St($),icon:null}])}n()},D=(k,$,G)=>{M(p.map(U=>U.connectionId===k&&U.toolName===$?{...U,label:G}:U))},T=()=>{n()},A=(k,$,G)=>{M(p.map(U=>U.connectionId===k&&U.toolName===$?{...U,icon:G}:U)),n()},V=k=>{w({defaultMainView:C(k)}),n()},F=(k,$)=>{const G=Oi(j,k,$,1);e.setValue("metadata.sidebarViews",G,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),h.stage(G,j);const U=Pi(g,k,$);U!==g&&w({defaultMainView:U})},I=lt(o?.metadata),O=Vi(I,r.presence),z=Ai(O),q=Ii(j,O,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"),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")},K=[];for(const k of q)k!=="automations"&&K.push({value:k,label:Y[k]});for(const k of p)K.push({value:`ext-apps:${k.connectionId}:${k.toolName}`,label:k.label||k.toolName});return q.includes("automations")&&K.push({value:"automations",label:Y.automations}),K.push({value:"settings",label:s("virtualMcp.layoutTabContent.settings")}),{projectViews:z,labels:Y,pinned:k=>j.includes(k),isMainView:k=>v===k,defaultMainView:v,defaultMainOptions:K,noMainView:S,chatDefaultOpen:b,connectionsData:u,pinnedAppViews:p,openView:k=>l(k,{virtualmcpid:a}),togglePin:(k,$)=>F(k,$),setMainView:V,setChatDefaultOpen:k=>{w({chatDefaultOpen:k}),n()},toggleAppViewPin:_,setAppViewIcon:A,setAppViewLabel:D,commitAppViewLabel:T}}function Sl(a){const e=H.c(82),{value:n,onChange:s,onColorChange:i,name:l,size:o,className:r,avatarClassName:h,showHoverOverlay:c,disabled:m}=a,f=o===void 0?"lg":o,u=c===void 0?!0:c,d=m===void 0?!1:m,p=X(),[x,g]=W.useState(!1),[b,y]=W.useState("icons"),[j,v]=W.useState(""),[S,C]=W.useState("blue");let M;e[0]!==n?(M=kt(n),e[0]=n,e[1]=M):M=e[1];const w=M,N=w.type==="icon"||w.type==="url"&&w.color?w.color:S;let _;e[2]!==s||e[3]!==N?(_=oe=>{s(gt(oe,N))},e[2]=s,e[3]=N,e[4]=_):_=e[4];const D=_;let T;e[5]!==s||e[6]!==i||e[7]!==w.name||e[8]!==w.type||e[9]!==w.url?(T=oe=>{C(oe),i?.(oe),w.type==="icon"?s(gt(w.name,oe)):w.type==="url"&&s(Qt(w.url,oe))},e[5]=s,e[6]=i,e[7]=w.name,e[8]=w.type,e[9]=w.url,e[10]=T):T=e[10];const A=T;let V;e[11]!==s||e[12]!==N?(V=oe=>{s(Qt(oe,N)),g(!1)},e[11]=s,e[12]=N,e[13]=V):V=e[13];const F=V;let I;e[14]!==s||e[15]!==N?(I=()=>{const oe=Tt(),Ne=oe[Math.floor(Math.random()*oe.length)];s(gt(Ne,N))},e[14]=s,e[15]=N,e[16]=I):I=e[16];const O=I,z=d?!1:x,q=d?"cursor-default opacity-50":"cursor-pointer";let Y;e[17]!==r||e[18]!==f||e[19]!==q?(Y=fe("relative group overflow-hidden",q,si(f),r),e[17]=r,e[18]=f,e[19]=q,e[20]=Y):Y=e[20];let K;e[21]!==h||e[22]!==l||e[23]!==f||e[24]!==n?(K=t.jsx(Xt,{icon:n,name:l,size:f,className:h}),e[21]=h,e[22]=l,e[23]=f,e[24]=n,e[25]=K):K=e[25];let L;e[26]!==d||e[27]!==u?(L=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(ni,{size:16,className:"text-white"})}),e[26]=d,e[27]=u,e[28]=L):L=e[28];let k;e[29]!==d||e[30]!==Y||e[31]!==K||e[32]!==L?(k=t.jsx(Ot,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":"Change icon",disabled:d,className:Y,children:[K,L]})}),e[29]=d,e[30]=Y,e[31]=K,e[32]=L,e[33]=k):k=e[33];let $;e[34]!==l||e[35]!==n?($=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(Xt,{icon:n,name:l,size:"xl"})}),e[34]=l,e[35]=n,e[36]=$):$=e[36];let G;e[37]!==b?(G=oe=>{if(oe.key!=="ArrowLeft"&&oe.key!=="ArrowRight")return;oe.preventDefault();const Ne=b==="icons"?"upload":"icons";y(Ne),document.getElementById(`icon-picker-tab-${Ne}`)?.focus()},e[37]=b,e[38]=G):G=e[38];const U=b==="icons",R=b==="icons"?0:-1;let B;e[39]===Symbol.for("react.memo_cache_sentinel")?(B=()=>y("icons"),e[39]=B):B=e[39];const J=b==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let ie;e[40]!==J?(ie=fe("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",J),e[40]=J,e[41]=ie):ie=e[41];let ee;e[42]!==p?(ee=p("common.iconPicker.iconsTab"),e[42]=p,e[43]=ee):ee=e[43];let ce;e[44]!==U||e[45]!==R||e[46]!==ie||e[47]!==ee?(ce=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":U,"aria-controls":"icon-picker-panel-icons",tabIndex:R,onClick:B,className:ie,children:ee}),e[44]=U,e[45]=R,e[46]=ie,e[47]=ee,e[48]=ce):ce=e[48];const de=b==="upload",ue=b==="upload"?0:-1;let te;e[49]===Symbol.for("react.memo_cache_sentinel")?(te=()=>y("upload"),e[49]=te):te=e[49];const pe=b==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let me;e[50]!==pe?(me=fe("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",pe),e[50]=pe,e[51]=me):me=e[51];let Se;e[52]!==p?(Se=p("common.iconPicker.uploadTab"),e[52]=p,e[53]=Se):Se=e[53];let E;e[54]!==de||e[55]!==ue||e[56]!==me||e[57]!==Se?(E=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":de,"aria-controls":"icon-picker-panel-upload",tabIndex:ue,onClick:te,className:me,children:Se}),e[54]=de,e[55]=ue,e[56]=me,e[57]=Se,e[58]=E):E=e[58];let ne;e[59]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx("div",{className:"flex-1"}),e[59]=ne):ne=e[59];let Q;e[60]!==G||e[61]!==ce||e[62]!==E?(Q=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:G,children:[ce,E,ne]}),e[60]=G,e[61]=ce,e[62]=E,e[63]=Q):Q=e[63];let ae;e[64]!==A||e[65]!==O||e[66]!==D||e[67]!==F||e[68]!==w.name||e[69]!==w.type||e[70]!==j||e[71]!==N||e[72]!==b?(ae=b==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(_l,{search:j,onSearchChange:v,selectedColor:N,onColorChange:A,onSelectIcon:D,onRandom:O,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(kl,{onUpload:F})}),e[64]=A,e[65]=O,e[66]=D,e[67]=F,e[68]=w.name,e[69]=w.type,e[70]=j,e[71]=N,e[72]=b,e[73]=ae):ae=e[73];let P;e[74]!==$||e[75]!==Q||e[76]!==ae?(P=t.jsx(Pt,{align:"start",className:"w-80 p-0",onOpenAutoFocus:Nl,children:t.jsxs("div",{className:"flex flex-col",children:[$,Q,ae]})}),e[74]=$,e[75]=Q,e[76]=ae,e[77]=P):P=e[77];let Z;return e[78]!==k||e[79]!==P||e[80]!==z?(Z=t.jsxs(It,{open:z,onOpenChange:g,children:[k,P]}),e[78]=k,e[79]=P,e[80]=z,e[81]=Z):Z=e[81],Z}function Nl(a){return a.preventDefault()}function Cl(a){const e=H.c(33),{selectedColor:n,onColorChange:s}=a,i=X(),[l,o]=W.useState(!1);let r,h,c,m,f,u,d;if(e[0]!==l||e[1]!==n){const S=As(n);h=It,u=l,d=o,r=Ot,f=!0,c="button",m=fe("h-6 w-6 rounded-full shrink-0 ring-2 ring-offset-2 ring-offset-background transition-all cursor-pointer hover:scale-110",S.dot,"ring-foreground/20"),e[0]=l,e[1]=n,e[2]=r,e[3]=h,e[4]=c,e[5]=m,e[6]=f,e[7]=u,e[8]=d}else r=e[2],h=e[3],c=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]!==c||e[14]!==m||e[15]!==p||e[16]!==x?(g=t.jsx("button",{type:c,className:m,title:p,"aria-label":x}),e[13]=c,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=ai.map(S=>t.jsx("button",{type:"button",onClick:()=>{s(S.name),o(!1)},className:fe("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(Pt,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:Ml,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 Ml(a){return a.preventDefault()}function _l(a){const e=H.c(55),{search:n,onSearchChange:s,selectedColor:i,onColorChange:l,onSelectIcon:o,onRandom:r,currentIconName:h}=a,c=X();let m,f,u,d,p,x,g;if(e[0]!==h||e[1]!==l||e[2]!==r||e[3]!==s||e[4]!==o||e[5]!==n||e[6]!==i||e[7]!==c){const S=Tt(),C=As(i);f=Ts(S,n),x="flex flex-col";let M;e[15]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(at,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=M):M=e[15];let w;e[16]!==s?(w=I=>s(I.target.value),e[16]=s,e[17]=w):w=e[17];let N;e[18]!==c?(N=c("common.iconPicker.filterPlaceholder"),e[18]=c,e[19]=N):N=e[19];let _;e[20]!==n||e[21]!==w||e[22]!==N?(_=t.jsxs("div",{className:"relative flex-1",children:[M,t.jsx(Me,{value:n,onChange:w,placeholder:N,className:"h-8 text-xs pl-7"})]}),e[20]=n,e[21]=w,e[22]=N,e[23]=_):_=e[23];let D;e[24]!==c?(D=c("common.iconPicker.randomIcon"),e[24]=c,e[25]=D):D=e[25];let T;e[26]!==c?(T=c("common.iconPicker.randomIcon"),e[26]=c,e[27]=T):T=e[27];let A;e[28]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ii,{size:14,className:"text-muted-foreground"}),e[28]=A):A=e[28];let V;e[29]!==r||e[30]!==D||e[31]!==T?(V=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:D,"aria-label":T,children:A}),e[29]=r,e[30]=D,e[31]=T,e[32]=V):V=e[32];let F;e[33]!==l||e[34]!==i?(F=t.jsx(Cl,{selectedColor:i,onColorChange:l}),e[33]=l,e[34]=i,e[35]=F):F=e[35],e[36]!==V||e[37]!==F||e[38]!==_?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[_,V,F]}),e[36]=V,e[37]=F,e[38]=_,e[39]=g):g=e[39],m=Es,p="h-56",u="grid grid-cols-9 gap-0.5 px-2 pb-2",d=f.map(I=>{const O=Dt(I);return O?t.jsx("button",{type:"button",onClick:()=>o(I),className:fe("h-8 w-8 flex items-center justify-center rounded-lg transition-colors cursor-pointer",h===I?fe(C.bg,C.text):fe(C.text,"hover:bg-accent")),title:I,"aria-label":wt(I),children:t.jsx(O,{size:18})},I):null}),e[0]=h,e[1]=l,e[2]=r,e[3]=s,e[4]=o,e[5]=n,e[6]=i,e[7]=c,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]!==c?(y=f.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("common.iconPicker.noIconsFound")}),e[43]=f.length,e[44]=c,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 kl(a){const e=H.c(46),{onUpload:n}=a,s=X(),i=W.useRef(null);let l;e[0]!==n||e[1]!==s?(l=V=>{const F=V.target.files?.[0];if(!F)return;if(F.size>2097152){re.error(s("common.iconPicker.imageTooLarge")),V.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(F)},e[0]=n,e[1]=s,e[2]=l):l=e[2];const o=l,[r,h]=W.useState("");let c;e[3]!==n||e[4]!==r?(c=()=>{const V=r.trim();V&&(n(V),h(""))},e[3]=n,e[4]=r,e[5]=c):c=e[5];const m=c;let f;e[6]!==o?(f=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:o}),e[6]=o,e[7]=f):f=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i.current?.click(),e[8]=u):u=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ui,{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=V=>h(V.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=V=>{V.key==="Enter"&&(V.preventDefault(),m())},e[24]=m,e[25]=C):C=e[25];let M;e[26]!==r||e[27]!==S||e[28]!==C?(M=t.jsx(Me,{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]=M):M=e[29];let w;e[30]!==r?(w=r.trim(),e[30]=r,e[31]=w):w=e[31];const N=!w;let _;e[32]!==s?(_=s("common.iconPicker.apply"),e[32]=s,e[33]=_):_=e[33];let D;e[34]!==m||e[35]!==N||e[36]!==_?(D=t.jsx(se,{variant:"outline",size:"sm",className:"h-8 px-3 text-xs shrink-0",onClick:m,disabled:N,children:_}),e[34]=m,e[35]=N,e[36]=_,e[37]=D):D=e[37];let T;e[38]!==M||e[39]!==D?(T=t.jsxs("div",{className:"flex items-center gap-1.5",children:[M,D]}),e[38]=M,e[39]=D,e[40]=T):T=e[40];let A;return e[41]!==j||e[42]!==T||e[43]!==f||e[44]!==x?(A=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[f,x,j,T]}),e[41]=j,e[42]=T,e[43]=f,e[44]=x,e[45]=A):A=e[45],A}function Tl(a){const e=H.c(55),{form:n,onCommit:s}=a,i=X(),l=W.useId();let o;e[0]!==i?(o=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("p",{className:"text-sm font-medium",children:o}),e[2]=o,e[3]=r):r=e[3];let h;e[4]!==i?(h=i("virtualMcp.settings.identity.iconDescription"),e[4]=i,e[5]=h):h=e[5];let c;e[6]!==h?(c=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:h}),e[6]=h,e[7]=c):c=e[7];let m;e[8]!==r||e[9]!==c?(m=t.jsxs("div",{children:[r,c]}),e[8]=r,e[9]=c,e[10]=m):m=e[10];let f;e[11]!==n||e[12]!==s||e[13]!==i?(f=D=>{const{field:T}=D;return t.jsx("div",{className:"justify-self-start",children:t.jsx(Sl,{value:T.value??null,onChange:A=>{T.onChange(A),s()},onColorChange:A=>{n.setValue("metadata.ui.themeColor",A,{shouldDirty:!0}),s()},name:n.watch("title")||i("virtualMcp.virtualMcp.agentNameFallback"),size:"md",avatarClassName:"[&_svg]:w-1/2 [&_svg]:h-1/2"})})},e[11]=n,e[12]=s,e[13]=i,e[14]=f):f=e[14];let u;e[15]!==n.control||e[16]!==f?(u=t.jsx(he,{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(Ce,{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=`${l}-name`;let x;e[21]!==i?(x=i("virtualMcp.settings.identity.name"),e[21]=i,e[22]=x):x=e[22];let g;e[23]!==x||e[24]!==p?(g=t.jsx("label",{htmlFor:p,className:"text-sm font-medium",children:x}),e[23]=x,e[24]=p,e[25]=g):g=e[25];let b;e[26]!==l||e[27]!==s||e[28]!==i?(b=D=>{const{field:T}=D;return t.jsx(Me,{...T,id:`${l}-name`,value:T.value??"",onBlur:()=>{T.onBlur(),s()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=l,e[27]=s,e[28]=i,e[29]=b):b=e[29];let y;e[30]!==n.control||e[31]!==b?(y=t.jsx(he,{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(Ce,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[g,y]}),e[33]=g,e[34]=y,e[35]=j):j=e[35];const v=`${l}-description`;let S;e[36]!==i?(S=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=S):S=e[37];let 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 M;e[41]!==l||e[42]!==s||e[43]!==i?(M=D=>{const{field:T}=D;return t.jsx(it,{...T,id:`${l}-description`,value:T.value??"",onBlur:()=>{T.onBlur(),s()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=l,e[42]=s,e[43]=i,e[44]=M):M=e[44];let w;e[45]!==n.control||e[46]!==M?(w=t.jsx(he,{name:"description",control:n.control,render:M}),e[45]=n.control,e[46]=M,e[47]=w):w=e[47];let N;e[48]!==C||e[49]!==w?(N=t.jsxs(Ce,{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 _;return e[51]!==j||e[52]!==N||e[53]!==d?(_=t.jsxs(Le,{children:[d,j,N]}),e[51]=j,e[52]=N,e[53]=d,e[54]=_):_=e[54],_}const Qs=["general","connections","site"],Dl={general:{icon:ri,titleKey:"virtualMcp.settings.general.title",descriptionKey:"virtualMcp.settings.general.description"},connections:{icon:Yi,titleKey:"virtualMcp.settings.connections.title",descriptionKey:"virtualMcp.settings.connections.description"},site:{icon:li,titleKey:"virtualMcp.settings.site.title",descriptionKey:"virtualMcp.settings.site.description"}};function Vl(a){return!!a&&Qs.includes(a)}function Al(a){const e=H.c(8),{section:n}=a,s=X();let i;e[0]!==s?(i=s("virtualMcp.settings.navigation"),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==n||e[3]!==s?(l=Qs.map(r=>{const{titleKey:h}=Dl[r];return t.jsx(ze.Tab,{active:n===r,asChild:!0,children:t.jsx(ys,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:c=>({...c,section:r==="general"?void 0:r}),children:s(h)})},r)}),e[2]=n,e[3]=s,e[4]=l):l=e[4];let o;if(e[5]!==i||e[6]!==l){const r=t.jsx(ze.Tabs,{"aria-label":i,children:l});o=t.jsx(cn.Toolbar.Left.Portal,{fallback:r,children:r}),e[5]=i,e[6]=l,e[7]=o}else o=e[7];return o}function Il(){const a=H.c(8),e=Mt();let n;a[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},a[0]=n):n=a[0];const{section:s}=dn(n);let i;a[1]!==s?(i=Vl(s)?s:"general",a[1]=s,a[2]=i):i=a[2];let l;a[3]!==e?(l=r=>e({to:".",search:h=>({...h,section:r??void 0})}),a[3]=e,a[4]=l):l=a[4];let o;return a[5]!==i||a[6]!==l?(o={section:i,openSection:l},a[5]=i,a[6]=l,a[7]=o):o=a[7],o}const jt={tools:null,resources:null,prompts:null},Ol=Bi.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function Pl(a){const n=new TextEncoder().encode(a),s=Array.from(n,i=>String.fromCharCode(i)).join("");return btoa(s)}function Xs(a){return{"x-studio-client":a,"x-mesh-client":a}}function $l(a){const e=H.c(15),{url:n,agentId:s}=a,i=X(),[l,o]=W.useState(!1);let r;e[0]!==s||e[1]!==i||e[2]!==n?(r=async()=>{ge("agent_connect_action",{agent_id:s,action:"copy_url"}),await navigator.clipboard.writeText(n),o(!0),re.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await tt(2e3),o(!1)},e[0]=s,e[1]=i,e[2]=n,e[3]=r):r=e[3];const h=r;let c;e[4]!==l?(c=l?t.jsx(et,{size:20,className:"text-success"}):t.jsx(ht,{size:20}),e[4]=l,e[5]=c):c=e[5];let m;e[6]!==l||e[7]!==i?(m=i(l?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=l,e[7]=i,e[8]=m):m=e[8];let f;e[9]!==m?(f=t.jsx("span",{className:"text-xs font-medium",children:m}),e[9]=m,e[10]=f):f=e[10];let u;return e[11]!==h||e[12]!==c||e[13]!==f?(u=t.jsxs(se,{type:"button",variant:"outline",onClick:h,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[c,f]}),e[11]=h,e[12]=c,e[13]=f,e[14]=u):u=e[14],u}function El(a){const e=H.c(13),{url:n,serverName:s,agentId:i}=a,l=X();let o;e[0]!==i||e[1]!==s||e[2]!==l||e[3]!==n?(o=()=>{ge("agent_connect_action",{agent_id:i,action:"install_cursor"});const u=Rs(s),d={type:"http",url:n,headers:Xs("Cursor")},p=Pl(JSON.stringify(d,null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(u)}&config=${encodeURIComponent(p)}`;window.open(x,"_blank"),re.success(l("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=s,e[2]=l,e[3]=n,e[4]=o):o=e[4];const r=o;let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),e[5]=h):h=e[5];let c;e[6]!==l?(c=l("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=l,e[7]=c):c=e[7];let m;e[8]!==c?(m=t.jsx("span",{className:"text-xs font-medium",children:c}),e[8]=c,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m?(f=t.jsxs(se,{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 Fl(a){const e=H.c(16),{url:n,serverName:s,agentId:i}=a,l=X(),[o,r]=W.useState(!1);let h;e[0]!==i||e[1]!==s||e[2]!==l||e[3]!==n?(h=async()=>{ge("agent_connect_action",{agent_id:i,action:"install_claude_code"});const p=Rs(s),x={type:"http",url:n,headers:Xs("Claude Code")},g=JSON.stringify(x,null,2),b=`claude mcp add-json "${p}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(b),r(!0),re.success(l("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await tt(2e3),r(!1)},e[0]=i,e[1]=s,e[2]=l,e[3]=n,e[4]=h):h=e[4];const c=h;let m;e[5]!==o?(m=o?t.jsx(et,{size:20,className:"text-success"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[5]=o,e[6]=m):m=e[6];let f;e[7]!==o||e[8]!==l?(f=l(o?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=o,e[8]=l,e[9]=f):f=e[9];let u;e[10]!==f?(u=t.jsx("span",{className:"text-xs font-medium",children:f}),e[10]=f,e[11]=u):u=e[11];let d;return e[12]!==c||e[13]!==m||e[14]!==u?(d=t.jsxs(se,{type:"button",variant:"outline",onClick:c,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[m,u]}),e[12]=c,e[13]=m,e[14]=u,e[15]=d):d=e[15],d}function zl({virtualMcp:a}){const e=X(),n=ot(),[s,i]=W.useState(null),[l,o]=W.useState(!1),[r,h]=W.useState(!1),c=a.id,m=a.title||`agent-${c.slice(0,8)}`,f=s?`bunx @decocms/typegen@latest --mcp ${c} --key ${s} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${c} --key <api-key> --output client.ts`,u=async()=>{o(!0);try{const{key:p}=await n.call("API_KEY_CREATE",{name:`typegen-${m}`,permissions:{[c]:["*"]}});if(!p)throw new Error("No key in response");i(p),ge("agent_typegen_key_generated",{agent_id:c})}catch{ge("agent_typegen_key_failed",{agent_id:c}),re.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{o(!1)}},d=async()=>{ge("agent_connect_action",{agent_id:c,action:"typegen_copy_command",has_api_key:!!s}),await navigator.clipboard.writeText(f),h(!0),re.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await tt(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(se,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:u,disabled:l,children:[l?t.jsx(Xe,{className:"size-3.5"}):t.jsx($t,{size:14}),t.jsx("span",{children:e(l?"virtualMcp.virtualMcpShareModal.generating":"virtualMcp.virtualMcpShareModal.generateApiKey")})]})]}),s&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateClientLabel")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:f}),t.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:d,children:r?t.jsx(et,{size:12,className:"text-success"}):t.jsx(ht,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx(Rl,{apiKey:s,agentId:c})]})}function Rl(a){const e=H.c(21),{apiKey:n,agentId:s}=a,[i,l]=W.useState(!1),o=window.location.origin,r=n?`STUDIO_API_KEY=${n}`:"STUDIO_API_KEY=<api-key>",h=`STUDIO_BASE_URL=${o}`,c=`${r}
|
|
2
|
-
${h}`;let m;e[0]!==s||e[1]!==n||e[2]!==c?(m=async()=>{ge("agent_connect_action",{agent_id:s,action:"typegen_copy_env",has_api_key:!!n}),await navigator.clipboard.writeText(c),l(!0),await tt(2e3),l(!1)},e[0]=s,e[1]=n,e[2]=c,e[3]=m):m=e[3];const f=m,u=!n;let d;e[4]!==u?(d=fe({"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(et,{size:12,className:"text-success"}):t.jsx(ht,{size:12}),e[13]=i,e[14]=y):y=e[14];let j;e[15]!==f||e[16]!==y?(j=t.jsx(se,{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 Ll(a){const e=H.c(3),{virtualMcp:n}=a;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=s):s=e[0];let i;return e[1]!==n?(i=t.jsx(W.Suspense,{fallback:s,children:t.jsx(zl,{virtualMcp:n})}),e[1]=n,e[2]=i):i=e[2],i}const Ul={self:["COLLECTION_THREADS_CREATE","COLLECTION_THREADS_GET","COLLECTION_THREAD_MESSAGES_LIST","COLLECTION_THREADS_LIST"]},Yl=3600*24*90;function Bl({virtualMcp:a}){const e=X(),n=ot(),{org:s}=Ae(),[i,l]=W.useState(null),[o,r]=W.useState(!1),[h,c]=W.useState(!1),m=a.id,f=a.title||`agent-${m.slice(0,8)}`,d=[`STUDIO_BASE_URL=${window.location.origin}`,`STUDIO_ORG=${s.slug}`,`STUDIO_AGENT_ID=${m}`,`STUDIO_API_KEY=${i??"<api-key>"}`].join(`
|
|
3
|
-
`),p=async()=>{r(!0);try{const{key:g}=await n.call("API_KEY_CREATE",{name:`chat-bridge-${f}`,permissions:Ul,expiresIn:Yl});if(!g)throw new Error("No key in response");l(g),ge("agent_chat_bridge_key_generated",{agent_id:m})}catch{ge("agent_chat_bridge_key_failed",{agent_id:m}),re.error(e("virtualMcp.virtualMcpShareModal.failedCreateApiKey"))}finally{r(!1)}},x=async()=>{ge("agent_connect_action",{agent_id:m,action:"chat_bridge_copy_env",has_api_key:!!i}),await navigator.clipboard.writeText(d),c(!0),re.success(e("virtualMcp.virtualMcpShareModal.connectionDetailsCopied")),await tt(2e3),c(!1)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcpShareModal.callFromYourApp")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.callFromYourAppDescription")})]}),!i&&t.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:p,disabled:o,children:[o?t.jsx(Xe,{className:"size-3.5"}):t.jsx($t,{size:14}),t.jsx("span",{children:e(o?"virtualMcp.virtualMcpShareModal.creating":"virtualMcp.virtualMcpShareModal.createApiKey")})]})]}),i&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.connectionDetails")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 whitespace-pre-wrap break-all font-mono text-xs text-muted-foreground",children:d}),t.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:x,children:h?t.jsx(et,{size:12,className:"text-success"}):t.jsx(ht,{size:12})})]})})]})}function Kl(a){const e=H.c(3),{virtualMcp:n}=a;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=s):s=e[0];let i;return e[1]!==n?(i=t.jsx(W.Suspense,{fallback:s,children:t.jsx(Bl,{virtualMcp:n})}),e[1]=n,e[2]=i):i=e[2],i}function Gl(a){const e=H.c(49),{open:n,onOpenChange:s,virtualMcp:i}=a,l=X(),{org:o}=Ae(),r=`/api/${o.slug}/mcp/virtual-mcp/${i.id}`;let h;e[0]!==r?(h=new URL(r,window.location.origin),e[0]=r,e[1]=h):h=e[1];const c=h;let m;e[2]!==i.id||e[3]!==i.title?(m=i.title||`agent-${i.id?.slice(0,8)??"default"}`,e[2]=i.id,e[3]=i.title,e[4]=m):m=e[4];const f=m,u=Qi();let d;e[5]!==i.id||e[6]!==c.href?(d=t.jsx($l,{url:c.href,agentId:i.id}),e[5]=i.id,e[6]=c.href,e[7]=d):d=e[7];let p,x;e[8]!==f||e[9]!==i.id||e[10]!==c.href?(p=t.jsx(El,{url:c.href,serverName:f,agentId:i.id}),x=t.jsx(Fl,{url:c.href,serverName:f,agentId:i.id}),e[8]=f,e[9]=i.id,e[10]=c.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(Ll,{virtualMcp:i}),e[18]=i,e[19]=y):y=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"border-t border-border"}),e[20]=j):j=e[20];let v;e[21]!==i?(v=t.jsx(Kl,{virtualMcp:i}),e[21]=i,e[22]=v):v=e[22];let S;e[23]!==v||e[24]!==g||e[25]!==y?(S=t.jsxs("div",{className:"flex flex-col gap-6",children:[g,b,y,j,v]}),e[23]=v,e[24]=g,e[25]=y,e[26]=S):S=e[26];const C=S;if(u){let D;e[27]!==l?(D=l("virtualMcp.virtualMcpShareModal.connect"),e[27]=l,e[28]=D):D=e[28];let T;e[29]!==D?(T=t.jsx(Wi,{className:"mt-4 mb-4 text-base font-semibold",children:D}),e[29]=D,e[30]=T):T=e[30];let A;e[31]!==C||e[32]!==T?(A=t.jsx(Hi,{children:t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-6 [touch-action:pan-y]",children:[T,C]})}),e[31]=C,e[32]=T,e[33]=A):A=e[33];let V;return e[34]!==s||e[35]!==n||e[36]!==A?(V=t.jsx(qi,{open:n,onOpenChange:s,children:A}),e[34]=s,e[35]=n,e[36]=A,e[37]=V):V=e[37],V}let M;e[38]!==l?(M=l("virtualMcp.virtualMcpShareModal.connect"),e[38]=l,e[39]=M):M=e[39];let w;e[40]!==M?(w=t.jsx(dt,{children:t.jsx(ut,{children:M})}),e[40]=M,e[41]=w):w=e[41];let N;e[42]!==C||e[43]!==w?(N=t.jsxs(Ze,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[w,C]}),e[42]=C,e[43]=w,e[44]=N):N=e[44];let _;return e[45]!==s||e[46]!==n||e[47]!==N?(_=t.jsx(Je,{open:n,onOpenChange:s,children:N}),e[45]=s,e[46]=n,e[47]=N,e[48]=_):_=e[48],_}function Wl(a){const e=H.c(50),{virtualMcp:n}=a,s=X(),i=Cs(),l=_s(),[o,r]=W.useState(!1);let h,c,m,f,u,d,p,x,g;if(e[0]!==l||e[1]!==i||e[2]!==s||e[3]!==n.id||e[4]!==n.metadata){g=Symbol.for("react.early_return_sentinel");e:{const M=_i(i);if(un(n.id)||lt(n.metadata)||M.has(n.id)){g=null;break e}let w;e[14]!==i||e[15]!==n.id?(w=(i??[]).find(z=>z.metadata?.liveAgentId===n.id)??null,e[14]=i,e[15]=n.id,e[16]=w):w=e[16];const N=w,_=N?.id??null;let D;e[17]!==l.update?(D=(z,q)=>l.update.mutateAsync({id:z,data:{metadata:{liveAgentId:q}}}).catch(ql),e[17]=l.update,e[18]=D):D=e[18];const T=D;let A;e[19]!==T||e[20]!==n.id?(A=z=>{T(z,n.id)},e[19]=T,e[20]=n.id,e[21]=A):A=e[21],m=A;let V;e[22]!==_||e[23]!==T?(V=()=>{_&&T(_,null)},e[22]=_,e[23]=T,e[24]=V):V=e[24];const F=V,I=(i??[]).filter(z=>z.id!==n.id&<(z.metadata)&&!M.has(z.id));p="flex flex-col gap-3";let O;e[25]!==s?(O=s("devAgent.devAgentSetup.title"),e[25]=s,e[26]=O):O=e[26],e[27]!==O?(x=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:O}),e[27]=O,e[28]=x):x=e[28],c=fn,d="p-6 gap-4",h=pn,f="p-0 space-y-4",u=_?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:_}),t.jsx("span",{className:"text-xs text-muted-foreground",children:s("devAgent.devAgentSetup.linkedDescription")})]}),t.jsx(se,{variant:"outline",size:"sm",className:"shrink-0",onClick:F,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(se,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>r(!0),children:[t.jsx(mn,{className:"size-4"}),s("devAgent.devAgentSetup.importButton")]}),I.length>0?t.jsxs(Ve,{onValueChange:m,children:[t.jsx(ke,{size:"sm",className:"w-56",children:t.jsx(Te,{placeholder:s("devAgent.devAgentSetup.selectPlaceholder")})}),t.jsx(De,{children:I.map(Hl)})]}):null]})]})}e[0]=l,e[1]=i,e[2]=s,e[3]=n.id,e[4]=n.metadata,e[5]=h,e[6]=c,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],c=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]!==c||e[34]!==d||e[35]!==b?(y=t.jsx(c,{className:d,children:b}),e[33]=c,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=M=>{const{virtualMcpId:w}=M;r(!1),w&&m(w)},e[39]=m,e[40]=v):v=e[40];let S;e[41]!==o||e[42]!==v||e[43]!==j?(S=t.jsx(Xi,{open:o,onOpenChange:r,title:j,onImportComplete:v}),e[41]=o,e[42]=v,e[43]=j,e[44]=S):S=e[44];let 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 Hl(a){return t.jsx(xe,{value:a.id,children:a.title},a.id)}function ql(){}const Ql=/^[A-Za-z_][A-Za-z0-9_]*$/;function Xl(a){const e={},n=a.split(/\r?\n/);for(let s=0;s<n.length;s++){let i=(n[s]??"").trim();if(!i||i.startsWith("#"))continue;i.startsWith("export ")&&(i=i.slice(7).trim());const l=i.indexOf("=");if(l<0)throw new Error(`Line ${s+1}: missing '='`);const o=i.slice(0,l).trim();if(!Ql.test(o))throw new Error(`Line ${s+1}: invalid key "${o}"`);let r=i.slice(l+1).trim();r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),e[o]=r}return e}function Jl(a){const e=H.c(28),{control:n,form:s,virtualMcpId:i,orgSlug:l,sandboxMap:o}=a,r=X();let h;e[0]!==r?(h=r("sandbox.envVarsField.title"),e[0]=r,e[1]=h):h=e[1];let c;e[2]!==h?(c=t.jsx("div",{className:"flex items-baseline justify-between gap-2",children:t.jsx(ve,{className:"font-normal text-foreground",children:h})}),e[2]=h,e[3]=c):c=e[3];let m;e[4]!==r?(m=r("sandbox.envVarsField.description"),e[4]=r,e[5]=m):m=e[5];let f;e[6]!==m?(f=t.jsx("p",{className:"text-xs text-muted-foreground",children:m}),e[6]=m,e[7]=f):f=e[7];let u;e[8]!==n||e[9]!==s||e[10]!==l||e[11]!==o||e[12]!==i?(u=t.jsx(Zl,{control:n,form:s,virtualMcpId:i,orgSlug:l,sandboxMap:o}),e[8]=n,e[9]=s,e[10]=l,e[11]=o,e[12]=i,e[13]=u):u=e[13];let 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(hn,{className:"h-9 w-full"}),e[16]=p):p=e[16];let x;e[17]!==n||e[18]!==s?(x=t.jsx(W.Suspense,{fallback:p,children:t.jsx(tr,{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(Re,{fallback:d,children:x}),e[20]=d,e[21]=x,e[22]=g):g=e[22];let b;return e[23]!==c||e[24]!==f||e[25]!==u||e[26]!==g?(b=t.jsxs("div",{className:"space-y-2",children:[c,f,u,g]}),e[23]=c,e[24]=f,e[25]=u,e[26]=g,e[27]=b):b=e[27],b}function Zl(a){const e=H.c(33),{control:n,form:s,virtualMcpId:i,orgSlug:l,sandboxMap:o}=a,r=X(),c=xn.useSession().data?.user?.id,m="metadata.runtime.env";let f;e[0]!==s?(f=()=>JSON.stringify(ps(s.getValues(m))),e[0]=s,e[1]=f):f=e[1];const[u,d]=W.useState(f);let p;e[2]!==n?(p={control:n,name:m},e[2]=n,e[3]=p):p=e[3];const x=Ss(p);let g;e[4]!==x?(g=JSON.stringify(ps(x)),e[4]=x,e[5]=g):g=e[5];const b=g,y=b!==u;let j;e[6]!==o||e[7]!==c?(j=c?Object.keys(o?.[c]??{}):[],e[6]=o,e[7]=c,e[8]=j):j=e[8];const v=j,S=v.length>0,[C,M]=W.useState(!1);if(!y||!S)return null;let w;e[9]!==b||e[10]!==l||e[11]!==r||e[12]!==v||e[13]!==i?(w=async()=>{M(!0);const O=await Promise.allSettled(v.map(async q=>{const Y=Ji({orgSlug:l,virtualMcpId:i,branch:q,threadId:null},"setup/start"),K=await fetch(Y,{method:"POST"});if(!K.ok){const L=await K.text().catch(()=>K.statusText);throw new Error(L||K.statusText)}}));M(!1);const z=O.filter(er).length;z===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:z,total:v.length}))},e[9]=b,e[10]=l,e[11]=r,e[12]=v,e[13]=i,e[14]=w):w=e[14];const N=w;let _;e[15]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(js,{className:"size-3.5 shrink-0"}),e[15]=_):_=e[15];let D;e[16]!==r?(D=r("sandbox.envVarsField.sandboxRunningNotice"),e[16]=r,e[17]=D):D=e[17];let T;e[18]!==D?(T=t.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-warning",children:[_,t.jsx("span",{className:"truncate",children:D})]}),e[18]=D,e[19]=T):T=e[19];let A;e[20]!==C?(A=C?t.jsx(Xe,{className:"size-3.5"}):t.jsx(vn,{className:"size-3.5"}),e[20]=C,e[21]=A):A=e[21];let V;e[22]!==C||e[23]!==r?(V=r(C?"sandbox.envVarsField.restarting":"sandbox.envVarsField.restartDev"),e[22]=C,e[23]=r,e[24]=V):V=e[24];let F;e[25]!==N||e[26]!==C||e[27]!==V||e[28]!==A?(F=t.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:N,disabled:C,className:"shrink-0",children:[A,V]}),e[25]=N,e[26]=C,e[27]=V,e[28]=A,e[29]=F):F=e[29];let I;return e[30]!==F||e[31]!==T?(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:[T,F]}),e[30]=F,e[31]=T,e[32]=I):I=e[32],I}function er(a){return a.status==="rejected"}function tr(a){const e=H.c(62),{control:n,form:s}=a,i=X(),l="metadata.runtime.env";let o;e[0]!==n?(o={control:n,name:l},e[0]=n,e[1]=o):o=e[1];const r=gn(o),{fields:h,append:c,remove:m}=r;let f;e[2]!==s?(f=(Y,K)=>{s.setValue(`${l}.${Y}`,K,{shouldDirty:!0,shouldTouch:!0})},e[2]=s,e[3]=f):f=e[3];const u=f,d=sa();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]=W.useState(null);let b;e[6]!==c?(b=()=>{c({key:"",kind:"literal",value:""})},e[6]=c,e[7]=b):b=e[7];const y=b;let j;e[8]!==c||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 K;try{K=Xl(Y)}catch(R){const B=R;re.error(B.message);return}const L=Object.entries(K);if(L.length===0){re.error(i("sandbox.envVarsField.nothingToAdd"));return}const k=s.getValues(l)??[],$=new Set;for(const R of k){const B=(R.key??"").trim();B&&$.add(B)}let G=0,U=0;for(const[R,B]of L){if($.has(R)){U++;continue}c({key:R,kind:"literal",value:B}),$.add(R),G++}G===0&&U>0?re.message(i("sandbox.envVarsField.allKeysExist",{count:U})):re.success(U>0?i("sandbox.envVarsField.addedWithSkipped",{added:G,skipped:U}):i("sandbox.envVarsField.added",{added:G}))},e[8]=c,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=(K,L)=>t.jsx("li",{className:"rounded-md border border-border bg-background",children:t.jsx(sr,{index:L,control:n,form:s,onUpdateEntry:u,fieldPath:l,secrets:d,secretById:p,onSaveAsSecret:(k,$)=>g({kind:"save-literal",index:L,presetKey:k,presetValue:$}),onCreateNewSecret:k=>g({kind:"create-new",index:L,presetKey:k}),onRemove:()=>m(L)})},K.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 M;e[29]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx($e,{className:"size-3.5"}),e[29]=M):M=e[29];let w;e[30]!==i?(w=i("sandbox.envVarsField.addEnvVar"),e[30]=i,e[31]=w):w=e[31];let N;e[32]!==y||e[33]!==w?(N=t.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:y,className:"flex-1",children:[M,w]}),e[32]=y,e[33]=w,e[34]=N):N=e[34];let _;e[35]!==i?(_=i("sandbox.envVarsField.pasteDotenvAriaLabel"),e[35]=i,e[36]=_):_=e[36];let D;e[37]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(oi,{className:"size-3.5"}),e[37]=D):D=e[37];let T;e[38]!==i?(T=i("sandbox.envVarsField.pasteDotenv"),e[38]=i,e[39]=T):T=e[39];let A;e[40]!==v||e[41]!==_||e[42]!==T?(A=t.jsx(ye,{asChild:!0,children:t.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:v,"aria-label":_,children:[D,T]})}),e[40]=v,e[41]=_,e[42]=T,e[43]=A):A=e[43];let V;e[44]!==i?(V=i("sandbox.envVarsField.pasteDotenvTooltip"),e[44]=i,e[45]=V):V=e[45];let F;e[46]!==V?(F=t.jsx(we,{children:V}),e[46]=V,e[47]=F):F=e[47];let I;e[48]!==A||e[49]!==F?(I=t.jsxs(je,{children:[A,F]}),e[48]=A,e[49]=F,e[50]=I):I=e[50];let O;e[51]!==I||e[52]!==N?(O=t.jsxs("div",{className:"flex items-center gap-2",children:[N,I]}),e[51]=I,e[52]=N,e[53]=O):O=e[53];let z;e[54]!==x||e[55]!==s||e[56]!==u?(z=x!==null?t.jsx(ir,{mode:x,onClose:()=>g(null),onSaved:Y=>{const K=s.getValues(`${l}.${x.index}.key`)?.trim()??"";u(x.index,{key:K,kind:"secret",secretId:Y}),g(null)}}):null,e[54]=x,e[55]=s,e[56]=u,e[57]=z):z=e[57];let q;return e[58]!==O||e[59]!==z||e[60]!==C?(q=t.jsxs("div",{className:"space-y-2",children:[C,O,z]}),e[58]=O,e[59]=z,e[60]=C,e[61]=q):q=e[61],q}function sr(a){const e=H.c(77),{index:n,control:s,form:i,onUpdateEntry:l,fieldPath:o,secrets:r,secretById:h,onSaveAsSecret:c,onCreateNewSecret:m,onRemove:f}=a,u=X(),d=`${o}.${n}.key`,p=`${o}.${n}.value`,x=`${o}.${n}.secretId`,g=`${o}.${n}.kind`;let b;e[0]!==s||e[1]!==g?(b={control:s,name:g},e[0]=s,e[1]=g,e[2]=b):b=e[2];const j=Ss(b)==="secret"?"secret":"literal";let v;e[3]!==i||e[4]!==n||e[5]!==d||e[6]!==c||e[7]!==l||e[8]!==p?(v=B=>{const J=i.getValues(d)?.trim()??"";if(B==="literal"){l(n,{key:J,kind:"literal",value:""});return}const ie=i.getValues(p)??"";if(ie.length>0){c(J,ie);return}l(n,{key:J,kind:"secret",secretId:""})},e[3]=i,e[4]=n,e[5]=d,e[6]=c,e[7]=l,e[8]=p,e[9]=v):v=e[9];const S=v;let C;e[10]!==n||e[11]!==u?(C=B=>{const{field:J}=B,ie=(J.value??"").trim(),ee=ie.length>0&&!pt.test(ie);return t.jsxs("div",{className:"space-y-1",children:[t.jsx(Me,{...J,value:J.value??"",placeholder:u("sandbox.envVarsField.keyPlaceholder"),spellCheck:!1,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",className:fe("font-mono",ee&&"border-destructive focus-visible:ring-destructive"),"aria-invalid":ee,"aria-label":u("sandbox.envVarsField.envVarKeyLabel",{index:n+1}),onBlur:ce=>{const de=ce.target.value.trim();J.onChange(de),J.onBlur()}}),ee?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 M;e[13]!==s||e[14]!==d||e[15]!==C?(M=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(he,{control:s,name:d,render:C})}),e[13]=s,e[14]=d,e[15]=C,e[16]=M):M=e[16];let w;e[17]!==S?(w=B=>S(B),e[17]=S,e[18]=w):w=e[18];let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(ke,{className:"h-9 w-[110px]",children:t.jsx(Te,{})}),e[19]=N):N=e[19];let _;e[20]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx($t,{className:"size-3.5"}),e[20]=_):_=e[20];let D;e[21]!==u?(D=u("sandbox.envVarsField.literal"),e[21]=u,e[22]=D):D=e[22];let T;e[23]!==D?(T=t.jsx(xe,{value:"literal",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[_,D]})}),e[23]=D,e[24]=T):T=e[24];let A;e[25]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(bn,{className:"size-3.5"}),e[25]=A):A=e[25];let V;e[26]!==u?(V=u("sandbox.envVarsField.secret"),e[26]=u,e[27]=V):V=e[27];let F;e[28]!==V?(F=t.jsx(xe,{value:"secret",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[A,V]})}),e[28]=V,e[29]=F):F=e[29];let I;e[30]!==F||e[31]!==T?(I=t.jsxs(De,{children:[T,F]}),e[30]=F,e[31]=T,e[32]=I):I=e[32];let O;e[33]!==j||e[34]!==I||e[35]!==w?(O=t.jsx("div",{className:"shrink-0",children:t.jsxs(Ve,{value:j,onValueChange:w,children:[N,I]})}),e[33]=j,e[34]=I,e[35]=w,e[36]=O):O=e[36];let z;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?(z=t.jsx("div",{className:"flex flex-[2] min-w-0 items-center gap-1",children:j==="literal"?t.jsx(he,{control:s,name:p,render:B=>{const{field:J}=B;return t.jsx(Me,{...J,value:J.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=>{J.onChange(ie.target.value),J.onBlur()}})}}):t.jsxs(t.Fragment,{children:[t.jsx(he,{control:s,name:x,render:B=>{const{field:J}=B;return t.jsxs(Ve,{value:J.value||"",onValueChange:ie=>J.onChange(ie),children:[t.jsx(ke,{className:fe("h-9 w-full",!J.value&&"text-muted-foreground"),"aria-label":u("sandbox.envVarsField.secretAriaLabel",{index:n+1}),children:t.jsx(Te,{placeholder:u("sandbox.envVarsField.pickSecretPlaceholder"),children:t.jsx(Zi,{field:J,secretById:h})})}),t.jsx(De,{children:r.length===0?t.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:u("sandbox.envVarsField.noSecretsYet")}):r.map(nr)})]})}}),t.jsxs(je,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(se,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.createNewSecretAriaLabel"),onClick:()=>{const B=i.getValues(d)?.trim()??"";m(B)},children:t.jsx($e,{className:"size-3.5"})})}),t.jsx(we,{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]=z):z=e[48];let q;e[49]!==i||e[50]!==d||e[51]!==j||e[52]!==c||e[53]!==u||e[54]!==p?(q=j==="literal"?t.jsxs(je,{children:[t.jsx(ye,{asChild:!0,children:t.jsx(se,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.saveAsSecretAriaLabel"),onClick:()=>{const B=i.getValues(d)?.trim()??"",J=i.getValues(p)??"";c(B,J)},children:t.jsx(ci,{className:"size-3.5"})})}),t.jsx(we,{children:u("sandbox.envVarsField.saveAsSecret")})]}):null,e[49]=i,e[50]=d,e[51]=j,e[52]=c,e[53]=u,e[54]=p,e[55]=q):q=e[55];let Y;e[56]!==u?(Y=u("sandbox.envVarsField.removeEnvVarAriaLabel"),e[56]=u,e[57]=Y):Y=e[57];let K;e[58]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx(Vt,{className:"size-3.5"}),e[58]=K):K=e[58];let L;e[59]!==f||e[60]!==Y?(L=t.jsx(ye,{asChild:!0,children:t.jsx(se,{type:"button",variant:"ghost",size:"icon","aria-label":Y,onClick:f,children:K})}),e[59]=f,e[60]=Y,e[61]=L):L=e[61];let k;e[62]!==u?(k=u("sandbox.envVarsField.remove"),e[62]=u,e[63]=k):k=e[63];let $;e[64]!==k?($=t.jsx(we,{children:k}),e[64]=k,e[65]=$):$=e[65];let G;e[66]!==L||e[67]!==$?(G=t.jsxs(je,{children:[L,$]}),e[66]=L,e[67]=$,e[68]=G):G=e[68];let U;e[69]!==q||e[70]!==G?(U=t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[q,G]}),e[69]=q,e[70]=G,e[71]=U):U=e[71];let R;return e[72]!==O||e[73]!==z||e[74]!==U||e[75]!==M?(R=t.jsxs("div",{className:"flex flex-col gap-2 p-2 sm:flex-row sm:items-center",children:[M,O,z,U]}),e[72]=O,e[73]=z,e[74]=U,e[75]=M,e[76]=R):R=e[76],R}function nr(a){return t.jsx(xe,{value:a.id,children:t.jsxs("span",{className:"inline-flex items-center gap-2",children:[t.jsx(ta,{scope:a.scope}),t.jsx("span",{className:"font-mono",children:a.name})]})},a.id)}function ir({mode:a,onClose:e,onSaved:n}){const s=X(),i=a.kind==="save-literal"?a.presetValue:"",l=a.presetKey,[o,r]=W.useState(()=>ar(l)),[h,c]=W.useState("organization"),[m,f]=W.useState(i),[u,d]=W.useState(""),p=na(),x=o.trim(),g=m.length>0&&x.length>0&&ea.test(x),b=async v=>{if(v.preventDefault(),!!g)try{const S=await p.mutateAsync({scope:h,name:x,value:m,description:u.trim()||void 0});re.success(s("sandbox.envVarsField.secretSaved",{name:S.name})),n(S.id)}catch(S){re.error(S instanceof Error?S.message:s("sandbox.envVarsField.failedToSaveSecret"))}},y=a.kind==="save-literal"?s("sandbox.envVarsField.saveValueAsSecretTitle"):s("sandbox.envVarsField.createNewSecretTitle"),j=a.kind==="save-literal"?s("sandbox.envVarsField.saveValueAsSecretDescription"):s("sandbox.envVarsField.createNewSecretDescription");return t.jsx(Je,{open:!0,onOpenChange:v=>{v||e()},children:t.jsxs(Ze,{className:"sm:max-w-md",children:[t.jsxs(dt,{children:[t.jsx(ut,{children:y}),t.jsx(Gn,{children:j})]}),t.jsxs("form",{onSubmit:b,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ve,{htmlFor:"save-secret-scope",children:s("sandbox.envVarsField.scopeLabel")}),t.jsxs(Ve,{value:h,onValueChange:v=>c(v),children:[t.jsx(ke,{id:"save-secret-scope",children:t.jsx(Te,{})}),t.jsxs(De,{children:[t.jsx(xe,{value:"organization",children:s("sandbox.envVarsField.scopeOrganization")}),t.jsx(xe,{value:"user",children:s("sandbox.envVarsField.scopePrivate")})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ve,{htmlFor:"save-secret-name",children:s("sandbox.envVarsField.nameLabel")}),t.jsx(Me,{id:"save-secret-name",value:o,onChange:v=>r(v.target.value),placeholder:s("sandbox.envVarsField.namePlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("sandbox.envVarsField.nameHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(ve,{htmlFor:"save-secret-value",children:s("sandbox.envVarsField.valueLabel")}),t.jsx(Me,{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(ve,{htmlFor:"save-secret-description",children:s("sandbox.envVarsField.descriptionLabel")}),t.jsx(it,{id:"save-secret-description",value:u,onChange:v=>d(v.target.value),rows:2,placeholder:s("sandbox.envVarsField.descriptionPlaceholder")})]}),t.jsxs(ks,{children:[t.jsx(se,{type:"button",variant:"outline",onClick:e,disabled:p.isPending,children:s("sandbox.envVarsField.cancel")}),t.jsx(se,{type:"submit",disabled:!g||p.isPending,children:p.isPending?s("sandbox.envVarsField.saving"):s("sandbox.envVarsField.saveSecret")})]})]})]})})}function ps(a){if(!Array.isArray(a))return[];const e=[];for(const n of a){if(!n||typeof n!="object")continue;const s=n,i=(s.key??"").trim();if(!(!i||!pt.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 ar(a){const e=a.trim();return e&&pt.test(e)?e:""}function lr(a){const e=H.c(21),{repo:n,className:s}=a,i=X();let l;e[0]!==s?(l=fe("space-y-2",s),e[0]=s,e[1]=l):l=e[1];let o;e[2]!==i?(o=i("sandbox.repoRow.label"),e[2]=i,e[3]=o):o=e[3];let r;e[4]!==o?(r=t.jsx(ve,{children:o}),e[4]=o,e[5]=r):r=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(ia,{size:20,className:"shrink-0 text-foreground/60"}),e[6]=h):h=e[6];let c;e[7]!==n||e[8]!==i?(c=t.jsx(ye,{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]=c):c=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(we,{children:m}),e[12]=m,e[13]=f):f=e[13];let u;e[14]!==c||e[15]!==f?(u=t.jsxs(je,{children:[c,f]}),e[14]=c,e[15]=f,e[16]=u):u=e[16];let d;return e[17]!==l||e[18]!==r||e[19]!==u?(d=t.jsxs("div",{className:l,children:[r,u]}),e[17]=l,e[18]=r,e[19]=u,e[20]=d):d=e[20],d}const rr={npm:{install:"npm install",run:a=>`npm run ${a}`,runtime:"node"},pnpm:{install:"pnpm install",run:a=>`pnpm run ${a}`,runtime:"node"},yarn:{install:"yarn install",run:a=>`yarn run ${a}`,runtime:"node"},bun:{install:"bun install",run:a=>`bun run ${a}`,runtime:"bun"},deno:{install:"deno install",run:a=>`deno task ${a}`,runtime:"deno"}};function or(a){const e=a.trim();if(e==="")return{ok:!0,value:null};if(!/^\d+$/.test(e))return{ok:!1};const n=Number(e);return n<1||n>65535?{ok:!1}:{ok:!0,value:String(n)}}const cr=Object.keys(rr),yt="__none__";function dr(a){const e=H.c(47),{control:n}=a,s=X(),i=W.useRef(null);let l;e[0]!==s?(l=s("sandbox.runtimeFields.packageManager"),e[0]=s,e[1]=l):l=e[1];let o;e[2]!==l?(o=t.jsx(ve,{htmlFor:"runtime-pm",children:l}),e[2]=l,e[3]=o):o=e[3];let r;e[4]!==s?(r=w=>{const{field:N}=w;return t.jsxs(Ve,{value:N.value??yt,onValueChange:_=>N.onChange(_===yt?null:_),children:[t.jsx(ke,{id:"runtime-pm",children:t.jsx(Te,{placeholder:s("sandbox.runtimeFields.autoDetect")})}),t.jsxs(De,{children:[t.jsx(xe,{value:yt,children:s("sandbox.runtimeFields.autoDetect")}),cr.map(mr)]})]})},e[4]=s,e[5]=r):r=e[5];let h;e[6]!==n||e[7]!==r?(h=t.jsx(he,{control:n,name:"metadata.runtime.selected",render:r}),e[6]=n,e[7]=r,e[8]=h):h=e[8];let c;e[9]!==o||e[10]!==h?(c=t.jsxs("div",{className:"space-y-2",children:[o,h]}),e[9]=o,e[10]=h,e[11]=c):c=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(ve,{htmlFor:"runtime-path",children:m}),e[14]=m,e[15]=f):f=e[15];let u;e[16]!==n?(u=t.jsx(he,{control:n,name:"metadata.runtime.path",render:ur}),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(ve,{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(Me,{ref:i,id:"runtime-port",inputMode:"numeric",placeholder:s("sandbox.runtimeFields.auto"),defaultValue:N.value??"",onBlur:_=>{const D=or(_.target.value);D.ok?N.onChange(D.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(he,{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 M;return e[43]!==x||e[44]!==C||e[45]!==c?(M=t.jsxs("div",{className:"space-y-5",children:[c,x,C]}),e[43]=x,e[44]=C,e[45]=c,e[46]=M):M=e[46],M}function ur(a){const{field:e}=a;return t.jsx(Me,{id:"runtime-path",placeholder:".",defaultValue:e.value??"",onBlur:n=>{const s=n.target.value.trim();e.onChange(s===""?null:s)}})}function mr(a){return t.jsx(xe,{value:a,children:a},a)}function fr(a){const e=H.c(17),{control:n}=a,s=X();let i;e[0]!==s?(i=s("sandbox.previewServerUrlField.label"),e[0]=s,e[1]=i):i=e[1];let l;e[2]!==i?(l=t.jsx(ve,{htmlFor:"preview-server-url",children:i}),e[2]=i,e[3]=l):l=e[3];let o;e[4]!==s?(o=f=>{const{field:u}=f,d=u.value??"";return t.jsx(Me,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:s("sandbox.previewServerUrlField.placeholder"),value:d,onChange:p=>u.onChange(p.target.value===""?null:p.target.value),onBlur:()=>{u.onChange(aa(d)),u.onBlur()}})},e[4]=s,e[5]=o):o=e[5];let r;e[6]!==n||e[7]!==o?(r=t.jsx(he,{control:n,name:"metadata.previewServerUrl",render:o}),e[6]=n,e[7]=o,e[8]=r):r=e[8];let h;e[9]!==s?(h=s("sandbox.previewServerUrlField.description"),e[9]=s,e[10]=h):h=e[10];let c;e[11]!==h?(c=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[11]=h,e[12]=c):c=e[12];let m;return e[13]!==l||e[14]!==r||e[15]!==c?(m=t.jsxs("div",{className:"space-y-2",children:[l,r,c]}),e[13]=l,e[14]=r,e[15]=c,e[16]=m):m=e[16],m}function pr(a){const e=H.c(5),{control:n}=a,s=X();let i;e[0]!==s?(i=o=>{const{field:r}=o;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ve,{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(ft,{id:"field-description-tooltips",className:"shrink-0",checked:r.value??!1,onCheckedChange:h=>r.onChange(h)})]})},e[0]=s,e[1]=i):i=e[1];let l;return e[2]!==n||e[3]!==i?(l=t.jsx(he,{control:n,name:"metadata.fieldDescriptionTooltips",render:i}),e[2]=n,e[3]=i,e[4]=l):l=e[4],l}function hr(a){const e=H.c(8),{control:n,previewServerUrl:s}=a,i=X();let l;e[0]!==s?(l=la(s),e[0]=s,e[1]=l):l=e[1];const o=!!l;let r;e[2]!==o||e[3]!==i?(r=c=>{const{field:m}=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(ve,{htmlFor:"fast-preview",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreview.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i(o?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(ft,{id:"fast-preview",className:"shrink-0",checked:!!m.value&&o,disabled:!o,onCheckedChange:f=>m.onChange(f)})]})},e[2]=o,e[3]=i,e[4]=r):r=e[4];let h;return e[5]!==n||e[6]!==r?(h=t.jsx(he,{control:n,name:"metadata.fastPreview",render:r}),e[5]=n,e[6]=r,e[7]=h):h=e[7],h}function xr(a){const e=H.c(5),{control:n,fastPreview:s}=a,i=X();if(!s)return null;let l;e[0]!==i?(l=r=>{const{field:h}=r;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(ve,{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(ft,{id:"fast-preview-in-place",className:"shrink-0",checked:!!h.value,onCheckedChange:c=>h.onChange(c)})]})},e[0]=i,e[1]=l):l=e[1];let o;return e[2]!==n||e[3]!==l?(o=t.jsx(he,{control:n,name:"metadata.fastPreviewInPlace",render:l}),e[2]=n,e[3]=l,e[4]=o):o=e[4],o}function gr(a){const e=H.c(32),{control:n,onCommit:s}=a,i=X();let l;e[0]!==i?(l=i("virtualMcp.virtualMcp.publishPolicySmart"),e[0]=i,e[1]=l):l=e[1];let o;e[2]!==i?(o=i("virtualMcp.virtualMcp.publishPolicySmartDescription"),e[2]=i,e[3]=o):o=e[3];let r;e[4]!==l||e[5]!==o?(r={value:"smart",label:l,description:o},e[4]=l,e[5]=o,e[6]=r):r=e[6];let h;e[7]!==i?(h=i("virtualMcp.virtualMcp.publishPolicyCodeReview"),e[7]=i,e[8]=h):h=e[8];let c;e[9]!==i?(c=i("virtualMcp.virtualMcp.publishPolicyCodeReviewDescription"),e[9]=i,e[10]=c):c=e[10];let m;e[11]!==h||e[12]!==c?(m={value:"code-review",label:h,description:c},e[11]=h,e[12]=c,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(ve,{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(Ve,{value:v,onValueChange:S=>{j.onChange(S),s()},children:[t.jsx(ke,{id:"publish-policy",className:"w-44 shrink-0 text-sm",children:t.jsx(Te,{})}),t.jsx(De,{className:"max-w-80",children:x.map(vr)})]})]})},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(he,{name:"metadata.publishPolicy",control:n,render:g}),e[29]=n,e[30]=g,e[31]=b):b=e[31],b}function vr(a){return t.jsx(xe,{value:a.value,description:a.description,children:a.label},a.value)}function br(a){const e=H.c(24),{control:n,onCommit:s}=a,i=X();let l;e[0]!==i?(l=i("sandbox.cmsSettings.contentEditing.off"),e[0]=i,e[1]=l):l=e[1];let o;e[2]!==i?(o=i("sandbox.cmsSettings.contentEditing.offDescription"),e[2]=i,e[3]=o):o=e[3];let r;e[4]!==l||e[5]!==o?(r={value:"off",label:l,description:o},e[4]=l,e[5]=o,e[6]=r):r=e[6];let h;e[7]!==i?(h=i("sandbox.cmsSettings.contentEditing.on"),e[7]=i,e[8]=h):h=e[8];let c;e[9]!==i?(c=i("sandbox.cmsSettings.contentEditing.onDescription"),e[9]=i,e[10]=c):c=e[10];let m;e[11]!==h||e[12]!==c?(m={value:"on",label:h,description:c},e[11]=h,e[12]=c,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=zs(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(ve,{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(Ve,{value:y,onValueChange:j=>{const v=Ki.safeParse(j);v.success&&(g.onChange(Gi(b,v.data)),s())},children:[t.jsx(ke,{id:"content-editing-mode",className:"w-44 shrink-0 text-sm",children:t.jsx(Te,{})}),t.jsx(De,{className:"max-w-80",children:u.map(jr)})]})]})},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(he,{name:"metadata.ui.layout",control:n,render:d}),e[21]=n,e[22]=d,e[23]=p):p=e[23],p}function jr(a){return t.jsx(xe,{value:a.value,description:a.description,children:a.label},a.value)}function hs(a){const e=a.metadata?.sidebarViews,n=a.metadata?.sidebarViewsVersion;return{effectiveViews:[...Nt(Ct(a.metadata),n)],rawViews:e===null?null:e?[...e]:void 0,version:n}}function yr(a,e){return a===e?!0:!a||!e||a.length!==e.length?!1:a.every((n,s)=>n===e[s])}function wr(a,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...a,shareDialogOpen:e.payload};case"SET_ADD_DIALOG_OPEN":return{...a,addDialogOpen:e.payload};case"OPEN_SETTINGS":return{...a,settingsDialogOpen:!0,settingsConnectionId:e.payload};case"CLOSE_SETTINGS":return{...a,settingsDialogOpen:!1,settingsConnectionId:null};default:return a}}function Sr(a,e){switch(e.type){case"accumulate":{const n=a??{start:e.now,fields:new Set,saveCount:0,instructionsLength:null},s=new Set(n.fields);for(const i of e.fields)s.add(i);return{...n,fields:s,saveCount:n.saveCount+1,instructionsLength:e.instructionsLength??n.instructionsLength}}case"reset":return null}}function Nr(a){const e=a.metadata?.runtime?.env;if(!e||e.length===0)return a;const n=e.filter(s=>{if(!s||typeof s!="object")return!1;const i=(s.key??"").trim();return!i||!pt.test(i)?!1:s.kind==="literal"?!0:s.kind==="secret"?!!s.secretId:!1});return n.length===e.length?a:{...a,metadata:{...a.metadata,runtime:{...a.metadata?.runtime??{},env:n}}}}async function Cr(a,e){const n=a?.idToken??null;if(n){const i=xs(n);if(i)return i}const s=a?.userinfoEndpoint??null;if(s)try{const i=await fetch(s,{headers:{Authorization:`Bearer ${e}`}});if(i.ok){const l=await i.json(),o=typeof l.email=="string"?l.email:typeof l.upn=="string"?l.upn:typeof l.preferred_username=="string"?l.preferred_username:null;if(o)return o}}catch{}return xs(e)}function xs(a){try{const e=a.split(".");if(e.length===3&&e[1]){const n=JSON.parse(atob(e[1].replace(/-/g,"+").replace(/_/g,"/")));if(typeof n.email=="string")return n.email;if(typeof n.upn=="string")return n.upn;if(typeof n.preferred_username=="string")return n.preferred_username}}catch{}return null}function Mr({virtualMcp:a}){const e=X(),n=In(),{org:s}=Ae(),i=_s(),{data:l}=$n([a.id]),o=l?.get(a.id)?.last_used_at,r=Ns(),h=jn(),c=ot(),m=Fs(a.id),f=JSON.stringify([s.id,a.id]),u=Fi(a.metadata,m.snapshot()),d=yn({resolver:wn(Ol),defaultValues:{...a,metadata:{...ss(a.metadata),previewServerUrl:ra(a.metadata),...u}}}),p=d.watch("connections"),x=ki(a),g=lt(a?.metadata),b=g&&zs(d.watch("metadata.ui.layout"))==="off",y=Ls(a),j=y?{owner:y.owner,name:y.name,url:y.url}:null,[v,S]=W.useReducer(wr,{shareDialogOpen:!1,addDialogOpen:!1,settingsDialogOpen:!1,settingsConnectionId:null}),[C,M]=W.useState(!1),[w,N]=W.useState(!1),{openSidePanel:_}=Dn(),{sendMessage:D}=Mn(),T=async()=>{if(w)return;const E=d.getValues("metadata.instructions");if(E?.trim()){N(!0);try{O(),ge("agent_instructions_improve_clicked",{agent_id:a.id,instructions_length:E.length}),_();const ne=Nn(s.id);await D({tiptapDoc:kn({managerAgentId:ne.id,managerName:ne.title,kind:"agent",id:a.id,instructions:E})})}finally{N(!1)}}},[A,V]=W.useReducer(Sr,null),F=()=>{A!==null&&(ge("agent_updated",{agent_id:a.id,fields:Array.from(A.fields),instructions_length:A.instructionsLength,save_count:A.saveCount,edit_duration_ms:Date.now()-A.start}),V({type:"reset"}))},{schedule:I,flush:O}=Jt({delayMs:3e4,save:async()=>F()}),z=async()=>{const E=m.snapshot(),ne={predicate:_e=>ts(_e.queryKey,s.id)},Q=async()=>(await h.invalidateQueries({predicate:_e=>ts(_e.queryKey,s.id),refetchType:"all"}),es(h,s.id,a.id)),ae=(_e,Ue)=>{if(_e){yr(d.getValues("metadata.sidebarViews"),_e.rawViews)||d.setValue("metadata.sidebarViews",_e.rawViews,{shouldDirty:!1}),d.getValues("metadata.sidebarViewsVersion")!==_e.version&&d.setValue("metadata.sidebarViewsVersion",_e.version,{shouldDirty:!1});return}Ue!==null&&(d.setValue("metadata.sidebarViews",[...Ue],{shouldDirty:!1}),d.setValue("metadata.sidebarViewsVersion",$i,{shouldDirty:!1}))},P=zi(E),Z=Object.keys(d.control._formState.dirtyFields);if(Z.length===0&&!P){await m.settle({snapshot:E,saved:!0,authoritativeViews:E?.persistedViews});return}const oe=Z.length>0?Z:["metadata"],Ne=oe.includes("metadata"),be=d.getValues();d.reset(be,{keepValues:!0});const Oe=Nr(be),Js=es(h,s.id,a.id),Zs=Ri({sidebarViews:Oe.metadata?.sidebarViews,sidebarViewsVersion:Oe.metadata?.sidebarViewsVersion},E,Js?.metadata);Oe.metadata={...ss(Oe.metadata),...Zs};let xt;try{xt=await i.update.mutateAsync({id:a.id,data:Oe})}catch(_e){let Ue=null;try{Ue=await Q()}catch{}const Rt=Ue?hs(Ue):null,Lt=await m.settle({snapshot:E,saved:!1,authoritativeViews:Rt?.effectiveViews});throw Lt.settledLatest&&ae(Rt,Lt.reconciledViews),_e}await h.cancelQueries(ne),Li(h,s.id,xt);const Ft=hs(xt),zt=await m.settle({snapshot:E,saved:!0,authoritativeViews:Ft.effectiveViews});zt.settledLatest&&ae(Ft,zt.reconciledViews),V({type:"accumulate",now:Date.now(),fields:oe,instructionsLength:Ne?be.metadata?.instructions?.length??0:null}),I()},q=()=>oa(f,z),{schedule:Y,flush:K}=Jt({save:q});W.useEffect(()=>{const E=d.watch(()=>Y());return()=>E.unsubscribe()},[]);const L=()=>{ge("connections_dialog_opened",{source:"agent_settings",mode:"add"}),S({type:"SET_ADD_DIALOG_OPEN",payload:!0})},k=async E=>{const ne=d.getValues("connections");if(ne.some(P=>P.connection_id===E))return;d.setValue("connections",[...ne,{connection_id:E,selected_tools:jt.tools,selected_resources:jt.resources,selected_prompts:jt.prompts}],{shouldDirty:!0}),S({type:"SET_ADD_DIALOG_OPEN",payload:!1});const Q=new URL(`/api/${s.slug}/mcp/${E}`,window.location.origin),ae=await Wt({url:Q.href,token:null,orgId:s.id});ae.supportsOAuth&&!ae.isAuthenticated&&await B(E)},$=E=>{const Q=d.getValues("connections").filter(ae=>ae.connection_id!==E);d.setValue("connections",Q,{shouldDirty:!0})},G=(E,ne)=>{const Q=d.getValues("connections");if(Q.some(ae=>ae.connection_id===ne)){re.error(e("virtualMcp.virtualMcp.instanceAlreadyAdded"));return}d.setValue("connections",Q.map(ae=>ae.connection_id===E?{...ae,connection_id:ne}:ae),{shouldDirty:!0})},U=async E=>{if(d.getValues("connections").find(Q=>Q.connection_id===E))try{const{item:Q}=await c.call("COLLECTION_CONNECTIONS_GET",{id:E});if(!Q)return;const ae=Q.title.replace(/\s*\(.*?\)\s*$/,""),P=Cn("conn"),Z=`${ae} (${Date.now().toString(36).slice(-4)})`;await r.create.mutateAsync({id:P,title:Z,description:Q.description??null,connection_type:Q.connection_type,connection_url:Q.connection_url??null,connection_token:null,icon:Q.icon??null,app_name:Q.app_name??null,app_id:Q.app_id??null,connection_headers:Q.connection_headers??null});const oe=new URL(`/api/${s.slug}/mcp/${P}`,window.location.origin),Ne=await Wt({url:oe.href,token:null,orgId:s.id});if(Ne.supportsOAuth&&!Ne.isAuthenticated){const be=await B(P);if(!be){await r.delete.mutateAsync(P);return}await r.update.mutateAsync({id:P,data:{title:`${ae} (${be})`}})}G(E,P),re.success(e("virtualMcp.virtualMcp.newInstanceCreated"))}catch(Q){console.error("Failed to create instance:",Q),re.error(e("virtualMcp.virtualMcp.failedToCreateInstance"))}},R=E=>{S({type:"OPEN_SETTINGS",payload:E})},B=async E=>{const{token:ne,tokenInfo:Q,error:ae}=await En({connectionId:E,orgSlug:s.slug,scope:"offline_access"});if(ae||!ne)return re.error(e("virtualMcp.virtualMcp.authenticationFailed",{error:ae??""})),null;if(Q)try{const Z=await fetch(`/api/${s.slug}/connections/${E}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:Q.accessToken,refreshToken:Q.refreshToken,expiresIn:Q.expiresIn,scope:Q.scope,clientId:Q.clientId,clientSecret:Q.clientSecret,tokenEndpoint:Q.tokenEndpoint})});if(!Z.ok)console.error("Failed to save OAuth token:",await Z.text()),await r.update.mutateAsync({id:E,data:{connection_token:ne}});else try{await r.update.mutateAsync({id:E,data:{}})}catch(oe){console.warn("Failed to refresh connection tools after OAuth:",oe)}}catch(Z){console.error("Error saving OAuth token:",Z),await r.update.mutateAsync({id:E,data:{connection_token:ne}})}else await r.update.mutateAsync({id:E,data:{connection_token:ne}});const P=new URL(`/api/${s.slug}/mcp/${E}`,window.location.origin);return await h.invalidateQueries({queryKey:ws.isMCPAuthenticated(P.href,null)}),re.success(e("virtualMcp.virtualMcp.authenticationSuccessful")),Cr(Q,ne)},J=()=>{const E=d.getValues("metadata.instructions")??"",ne=e("virtualMcp.virtualMcp.promptTemplateContent"),Q=E.trim()?`${E}
|
|
4
|
-
|
|
5
|
-
${ne}`:ne;d.setValue("metadata.instructions",Q,{shouldDirty:!0})},ie=new Set(p.map(E=>E.connection_id)),{section:ee}=Il(),ce=wl({virtualMcpId:a.id,form:d,flushAndSave:K}),de=Mt(),[ue,te]=W.useState(!1),pe=async()=>{O();try{await i.delete.mutateAsync(a.id),ge("agent_deleted",{agent_id:a.id,source:"agent_detail"}),re.success(e("virtualMcp.virtualMcp.agentDeleted",{title:a.title})),de({to:"/$org",params:{org:s.slug}})}catch{}},me=t.jsxs(se,{variant:"outline",size:"sm",onClick:()=>{ge("agent_connect_modal_opened",{agent_id:a.id}),S({type:"SET_SHARE_DIALOG_OPEN",payload:!0})},children:[t.jsx(Wn,{size:14}),e("virtualMcp.virtualMcp.connect")]}),Se=t.jsxs("div",{className:"flex items-center gap-2",children:[!d.watch("metadata.instructions")?.trim()&&t.jsx(se,{variant:"outline",size:"sm",onClick:J,children:e("virtualMcp.virtualMcp.promptTemplate")}),t.jsxs(se,{variant:"outline",size:"sm",disabled:w||!d.watch("metadata.instructions")?.trim(),onClick:T,children:[t.jsx(nt,{size:13}),e("virtualMcp.virtualMcp.improve")]})]});return t.jsxs(ze,{children:[t.jsxs(t.Fragment,{children:[t.jsx(ze.Title,{children:e("virtualMcp.settings.title")}),t.jsx(Al,{section:ee??"general"}),t.jsx(ze.Actions,{secondary:ee==="connections"?me:void 0,children:ee==="connections"?t.jsxs(se,{size:"sm",onClick:L,children:[t.jsx($e,{size:14}),e("virtualMcp.virtualMcp.addConnection")]}):me}),t.jsx(ze.Content,{children:t.jsx(ze.Container,{width:"standard",className:"@container/project-settings",children:t.jsxs(Sn,{children:[ee==="general"&&t.jsx(bl,{views:ce}),ee==="general"&&t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(Tl,{form:d,onCommit:K}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 text-xs text-muted-foreground",children:[t.jsx(_n,{id:a.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")," ",Ia(new Date(a.created_at),"PP",{locale:n})]}),t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsx("span",{children:o?e("virtualMcp.virtualMcp.lastUsed",{time:On(new Date(o),{addSuffix:!0,locale:n})}):e("virtualMcp.virtualMcp.neverUsed")})]})]}),ee==="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:L,className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx($e,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:e("virtualMcp.virtualMcp.noConnectionsYet")})]}):p.map(E=>t.jsx(Re,{fallback:()=>null,children:t.jsx(W.Suspense,{fallback:t.jsx(Hs,{}),children:t.jsx(cl,{connection_id:E.connection_id,usedConnectionIds:ie,onOpenSettings:()=>R(E.connection_id),onRemove:()=>$(E.connection_id),onAuthenticate:B,onSwitchInstance:G,onNewInstance:()=>U(E.connection_id)})})},E.connection_id))})}),ee==="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")}),Se]}),t.jsx(he,{name:"metadata.instructions",control:d.control,render:({field:E})=>t.jsxs("div",{className:"relative rounded-xl card-shadow bg-card focus-within:ring-1 focus-within:ring-ring",children:[t.jsx(it,{...E,value:E.value??"",onChange:ne=>{E.onChange(ne)},onBlur:()=>{E.onBlur(),K()},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(je,{delayDuration:0,children:[t.jsx(ye,{asChild:!0,children:t.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"absolute top-2 right-2 h-7 w-7 text-muted-foreground",onClick:()=>M(!0),"aria-label":e("virtualMcp.virtualMcp.openFullscreenEditor"),children:t.jsx(di,{size:14})})}),t.jsx(we,{side:"left",children:e("virtualMcp.virtualMcp.fullscreen")})]})]})})]}),ee==="general"&&t.jsx(Pa,{form:d}),ee==="general"&&t.jsx(Re,{fallback:()=>null,children:t.jsx(W.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(Ba,{form:d,currentAgentId:a.id})})}),ee==="site"&&t.jsx(Wl,{virtualMcp:a}),ee==="site"&&g&&t.jsx(Be,{title:e("sandbox.cmsSettings.title"),children:t.jsxs(Le,{children:[t.jsx(Ce,{children:t.jsx(br,{control:d.control,onCommit:K})}),!b&&t.jsx(Ce,{children:t.jsx(pr,{control:d.control})}),!b&&x&&t.jsx(Ce,{children:t.jsx(gr,{control:d.control,onCommit:K})})]})}),ee==="site"&&!b&&t.jsx(Be,{title:e("sandbox.cmsSettings.preview.title"),description:e("sandbox.cmsSettings.preview.description"),children:t.jsxs(Le,{children:[t.jsx(Ce,{children:t.jsx(fr,{control:d.control})}),t.jsx(Ce,{children:t.jsx(hr,{control:d.control,previewServerUrl:d.watch("metadata.previewServerUrl")})}),d.watch("metadata.fastPreview")&&t.jsx(Ce,{children:t.jsx(xr,{control:d.control,fastPreview:d.watch("metadata.fastPreview")})})]})}),ee==="site"&&t.jsx(Be,{title:e("virtualMcp.virtualMcp.sandbox"),children:t.jsxs(Le,{children:[t.jsx(Ce,{children:t.jsx(lr,{repo:j})}),t.jsx(Ce,{children:t.jsx(dr,{control:d.control})}),t.jsx(Ce,{children:t.jsx(Jl,{control:d.control,form:d,virtualMcpId:a.id,orgSlug:s.slug,sandboxMap:a.metadata.sandboxMap})})]})}),ee==="general"&&t.jsx(Be,{title:e("virtualMcp.settings.groups.advanced"),children:t.jsx(Le,{children:t.jsx(He,{title:e("virtualMcp.virtualMcp.deleteAgent"),description:e("virtualMcp.virtualMcp.deleteAgentDescription"),action:t.jsxs(se,{variant:"outline",size:"sm",className:"text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:()=>te(!0),children:[t.jsx(Vt,{size:14}),e("virtualMcp.virtualMcp.deleteAgent")]})})})})]})})},ee)]}),t.jsx(Fn,{open:ue,onOpenChange:te,children:t.jsxs(zn,{children:[t.jsxs(Rn,{children:[t.jsx(Ln,{children:e("virtualMcp.virtualMcp.deleteAgentConfirm")}),t.jsx(Un,{children:e("virtualMcp.virtualMcp.deleteAgentConfirmDescription",{title:a.title})})]}),t.jsxs(Yn,{children:[t.jsx(Bn,{children:e("virtualMcp.virtualMcp.cancel")}),t.jsx(Kn,{onClick:pe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:e("virtualMcp.virtualMcp.delete")})]})]})}),t.jsx(mi,{open:v.addDialogOpen,onOpenChange:E=>S({type:"SET_ADD_DIALOG_OPEN",payload:E}),agentId:a.id,addedConnectionIds:ie,onAdd:k}),t.jsx(ol,{open:v.settingsDialogOpen,onOpenChange:E=>{E||S({type:"CLOSE_SETTINGS"})},selectedId:v.settingsConnectionId,form:d,connections:p,onAuthenticate:B}),t.jsx(Gl,{open:v.shareDialogOpen,onOpenChange:E=>S({type:"SET_SHARE_DIALOG_OPEN",payload:E}),virtualMcp:a}),t.jsx(Je,{open:C,onOpenChange:M,children:t.jsxs(Ze,{className:"w-[90vw] sm:max-w-6xl h-[85vh] flex flex-col p-0 gap-0",children:[t.jsx(dt,{className:"px-6 pt-6 pb-3 border-b border-border shrink-0",children:t.jsx(ut,{children:e("virtualMcp.virtualMcp.instructions")})}),t.jsx("div",{className:"flex-1 min-h-0 p-6",children:t.jsx(he,{name:"metadata.instructions",control:d.control,render:({field:E})=>t.jsx(it,{...E,value:E.value??"",onChange:ne=>{E.onChange(ne)},onBlur:()=>{E.onBlur(),K()},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 _r(a){const e=H.c(21),{virtualMcpId:n}=a,s=X(),i=Mt(),{org:l}=Ae(),o=Ms(n);if(!o){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]!==l.slug?(u=()=>i({to:"/$org",params:{org:l.slug}}),e[4]=i,e[5]=l.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(se,{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(Tn,{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]!==o?(r=Ls(o)?.connectionId??"",e[16]=o,e[17]=r):r=e[17];const h=`${o.id}:${r}`;let c;return e[18]!==h||e[19]!==o?(c=t.jsx(Mr,{virtualMcp:o},h),e[18]=h,e[19]=o,e[20]=c):c=e[20],c}function Go(a){const e=H.c(2),{virtualMcpId:n}=a;let s;return e[0]!==n?(s=t.jsx(_r,{virtualMcpId:n}),e[0]=n,e[1]=s):s=e[1],s}export{Go as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as R,b as W,e as Ye,j as n,B as F,t as Ve,bP as me,a7 as Nt,a as Ke,y as Yt,D as _t,K as Ue,bQ as Qt,bR as Xt,V as Be,l as dt,aF as Zt,p as pt,bS as en,r as G,Z as tn,a6 as ie,d as At,X as ht,z as Pt,m as He,q as ut,ar as Ct,bT as nn,ax as sn,aD as yt,x as on,bU as an,bV as rn,bW as ln,bX as cn,bY as dn,Y as un,u as mn,$ as fn,bZ as hn,b_ as gn,k as Et,b$ as lt,c0 as pn,c1 as yn,O as bn,c2 as xn}from"./index-DUhG4tsR.js";import{A as at}from"./avatar-foon9v7B.js";import{t as Ot}from"./Globe04-BrBw0Avb.js";import{a as wn}from"./UserSquare-oitDkmCz.js";import{an as Sn,N as vn,u as ct,$ as jn,P as te,x as kn,ao as Tn,n as bt,j as Nn,h as _n,ap as An,f as Pn}from"./agent-icon-CJ1up34I.js";import{s as Cn}from"./XClose-CH7JGbnX.js";import{D as En}from"./download-app-dialog-CK-GvdAK.js";import{a as On,u as In}from"./use-project-scope-DhGOPpT1.js";import{u as It,a as Ln}from"./use-panel-navigate-KvJ_j5rh.js";import{i as ae}from"./CheckCircle-Dd90iqND.js";import{i as ot}from"./Monitor01-BdQ0e4n3.js";import{i as re}from"./Zap-D3wZltKp.js";import{c as Lt,d as $t,b as Dt,D as Rt,h as $n,e as Dn}from"./dialog-D5ye6U_D.js";import{a as Rn}from"./Share07-3t9nqqkD.js";import{s as xt}from"./Plus-Du1X0BSn.js";import{a as Mn}from"./Tool01-B1l7rMbN.js";import{b as le,a as Ge,f as Fn,e as zn,c as qn,C as Bn}from"./command-DBqQ-b8W.js";import{I as Kn}from"./integration-icon-Didv4P2d.js";import{P as Hn}from"./project-icon-BzJ0b0Ay.js";import{a as Un,m as Gn}from"./use-mcp-client-Bax4L87A.js";import{S as Jn,u as Vn}from"./hooks-C-YaiNLT.js";import{u as Wn}from"./use-is-desktop-app-BNujXJc_.js";import{R as Yn}from"./required-auth-layout-BeA6YeYQ.js";import{A as Qn}from"./autosend-Cxmy5f7O.js";import{u as Xn,a as Zn,b as es,c as ts}from"./thread-route-BfqlgN7w.js";import{u as ns}from"./use-org-sso-TEOX56yY.js";function ss(t){const e=R.c(49),{orgName:s,orgSlug:a,orgLogo:o,domain:i}=t,r=W();let u;e[0]!==a||e[1]!==r?(u=async()=>{const k=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:a})}),_=await k.json();if(!k.ok||!_.success)throw new Error(_.error??r("common.autoDomainJoinScreen.joinError"));return _},e[0]=a,e[1]=r,e[2]=u):u=e[2];let m;e[3]!==a?(m=k=>{window.location.href=`/${k.slug??a}`},e[3]=a,e[4]=m):m=e[4];let h;e[5]!==r?(h=k=>{Ve.error(k instanceof Error?k.message:r("common.autoDomainJoinScreen.joinError"))},e[5]=r,e[6]=h):h=e[6];let v;e[7]!==u||e[8]!==m||e[9]!==h?(v={mutationFn:u,onSuccess:m,onError:h},e[7]=u,e[8]=m,e[9]=h,e[10]=v):v=e[10];const c=Ye(v),x=os;let g;e[11]!==o||e[12]!==s?(g=o?n.jsx(at,{url:o,fallback:s.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Ot,{className:"h-6 w-6 text-primary"})}),e[11]=o,e[12]=s,e[13]=g):g=e[13];let y;e[14]!==s||e[15]!==r?(y=r("common.autoDomainJoinScreen.joinPrompt",{orgName:s}),e[14]=s,e[15]=r,e[16]=y):y=e[16];let l;e[17]!==y?(l=n.jsx("h3",{className:"text-lg font-medium",children:y}),e[17]=y,e[18]=l):l=e[18];let d;e[19]!==i||e[20]!==r?(d=r("common.autoDomainJoinScreen.joinDescription",{domain:i}),e[19]=i,e[20]=r,e[21]=d):d=e[21];let p;e[22]!==d?(p=n.jsx("p",{className:"text-sm text-muted-foreground",children:d}),e[22]=d,e[23]=p):p=e[23];let b;e[24]!==l||e[25]!==p?(b=n.jsxs("div",{className:"space-y-2",children:[l,p]}),e[24]=l,e[25]=p,e[26]=b):b=e[26];let w;e[27]!==c?(w=()=>c.mutate(),e[27]=c,e[28]=w):w=e[28];let S;e[29]!==c.isPending||e[30]!==s||e[31]!==r?(S=c.isPending?r("common.autoDomainJoinScreen.joining"):r("common.autoDomainJoinScreen.enterOrg",{orgName:s}),e[29]=c.isPending,e[30]=s,e[31]=r,e[32]=S):S=e[32];let T;e[33]!==c.isPending||e[34]!==w||e[35]!==S?(T=n.jsx(F,{onClick:w,disabled:c.isPending,children:S}),e[33]=c.isPending,e[34]=w,e[35]=S,e[36]=T):T=e[36];const P=c.isPending;let A;e[37]!==r?(A=r("common.autoDomainJoinScreen.goHome"),e[37]=r,e[38]=A):A=e[38];let j;e[39]!==c.isPending||e[40]!==A?(j=n.jsx(F,{variant:"ghost",onClick:x,disabled:P,children:A}),e[39]=c.isPending,e[40]=A,e[41]=j):j=e[41];let f;e[42]!==T||e[43]!==j?(f=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[T,j]}),e[42]=T,e[43]=j,e[44]=f):f=e[44];let N;return e[45]!==b||e[46]!==f||e[47]!==g?(N=n.jsxs(me,{children:[g,b,f]}),e[45]=b,e[46]=f,e[47]=g,e[48]=N):N=e[48],N}function os(){window.location.href="/"}function wt(t){const e=R.c(25),{orgSlug:s,orgName:a,reason:o}=t,i=W(),r=is,u=o==="not-found",m=u?wn:Nt;let h;e[0]!==u||e[1]!==i?(h=i(u?"common.noAccessScreen.organizationNotFound":"common.noAccessScreen.noAccess"),e[0]=u,e[1]=i,e[2]=h):h=e[2];const v=h;let c;e[3]!==u||e[4]!==a||e[5]!==s||e[6]!==i?(c=u?n.jsxs(n.Fragment,{children:[i("common.noAccessScreen.couldNotFind")," ",n.jsx("strong",{children:s}),"."]}):n.jsxs(n.Fragment,{children:[i("common.noAccessScreen.noAccessTo")," ",n.jsx("strong",{children:a??s}),".",n.jsx("br",{}),i("common.noAccessScreen.askAdminToInvite")]}),e[3]=u,e[4]=a,e[5]=s,e[6]=i,e[7]=c):c=e[7];const x=c;let g;e[8]!==m?(g=n.jsx("div",{className:"bg-muted p-3 rounded-full",children:n.jsx(m,{className:"h-6 w-6 text-muted-foreground"})}),e[8]=m,e[9]=g):g=e[9];let y;e[10]!==v?(y=n.jsx("h3",{className:"text-lg font-medium",children:v}),e[10]=v,e[11]=y):y=e[11];let l;e[12]!==x?(l=n.jsx("p",{className:"text-sm text-muted-foreground",children:x}),e[12]=x,e[13]=l):l=e[13];let d;e[14]!==y||e[15]!==l?(d=n.jsxs("div",{className:"space-y-2",children:[y,l]}),e[14]=y,e[15]=l,e[16]=d):d=e[16];let p;e[17]!==i?(p=i("common.noAccessScreen.goToHome"),e[17]=i,e[18]=p):p=e[18];let b;e[19]!==p?(b=n.jsx(F,{onClick:r,children:p}),e[19]=p,e[20]=b):b=e[20];let w;return e[21]!==g||e[22]!==d||e[23]!==b?(w=n.jsxs(me,{children:[g,d,b]}),e[21]=g,e[22]=d,e[23]=b,e[24]=w):w=e[24],w}function is(){window.location.href="/"}function as(t){const e=R.c(59),{invitationId:s,orgName:a,orgSlug:o,orgLogo:i}=t,r=W();let u;e[0]!==s?(u=async()=>{const O=await Ke.organization.acceptInvitation({invitationId:s});if(O.error)throw new Error(O.error.message);return O.data},e[0]=s,e[1]=u):u=e[1];let m;e[2]!==o?(m=()=>{Yt(),window.location.href=`/${o}`},e[2]=o,e[3]=m):m=e[3];let h;e[4]!==r?(h=O=>{Ve.error(O instanceof Error?O.message:r("common.pendingInviteScreen.failedToAccept"))},e[4]=r,e[5]=h):h=e[5];let v;e[6]!==u||e[7]!==m||e[8]!==h?(v={mutationFn:u,onSuccess:m,onError:h},e[6]=u,e[7]=m,e[8]=h,e[9]=v):v=e[9];const c=Ye(v);let x;e[10]!==s?(x=async()=>{const O=await Ke.organization.rejectInvitation({invitationId:s});if(O.error)throw new Error(O.error.message);return O.data},e[10]=s,e[11]=x):x=e[11];let g,y;e[12]!==r?(g=()=>{Ve.success(r("common.pendingInviteScreen.invitationDeclined")),window.location.href="/"},y=O=>{Ve.error(O instanceof Error?O.message:r("common.pendingInviteScreen.failedToDecline"))},e[12]=r,e[13]=g,e[14]=y):(g=e[13],y=e[14]);let l;e[15]!==x||e[16]!==g||e[17]!==y?(l={mutationFn:x,onSuccess:g,onError:y},e[15]=x,e[16]=g,e[17]=y,e[18]=l):l=e[18];const d=Ye(l),p=c.isPending||d.isPending;let b;e[19]!==i||e[20]!==a?(b=i?n.jsx(at,{url:i,fallback:a.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Sn,{className:"h-6 w-6 text-primary"})}),e[19]=i,e[20]=a,e[21]=b):b=e[21];let w;e[22]!==a||e[23]!==r?(w=r("common.pendingInviteScreen.invitedTo",{orgName:a}),e[22]=a,e[23]=r,e[24]=w):w=e[24];let S;e[25]!==w?(S=n.jsx("h3",{className:"text-lg font-medium",children:w}),e[25]=w,e[26]=S):S=e[26];let T;e[27]!==r?(T=r("common.pendingInviteScreen.acceptDescription"),e[27]=r,e[28]=T):T=e[28];let P;e[29]!==T?(P=n.jsx("p",{className:"text-sm text-muted-foreground",children:T}),e[29]=T,e[30]=P):P=e[30];let A;e[31]!==S||e[32]!==P?(A=n.jsxs("div",{className:"space-y-2",children:[S,P]}),e[31]=S,e[32]=P,e[33]=A):A=e[33];let j;e[34]!==c?(j=()=>c.mutate(),e[34]=c,e[35]=j):j=e[35];let f;e[36]!==c.isPending||e[37]!==r?(f=c.isPending?r("common.pendingInviteScreen.acceptingButton"):r("common.pendingInviteScreen.acceptButton"),e[36]=c.isPending,e[37]=r,e[38]=f):f=e[38];let N;e[39]!==p||e[40]!==j||e[41]!==f?(N=n.jsx(F,{onClick:j,disabled:p,children:f}),e[39]=p,e[40]=j,e[41]=f,e[42]=N):N=e[42];let k;e[43]!==d?(k=()=>d.mutate(),e[43]=d,e[44]=k):k=e[44];let _;e[45]!==d.isPending||e[46]!==r?(_=d.isPending?r("common.pendingInviteScreen.decliningButton"):r("common.pendingInviteScreen.declineButton"),e[45]=d.isPending,e[46]=r,e[47]=_):_=e[47];let E;e[48]!==p||e[49]!==k||e[50]!==_?(E=n.jsx(F,{variant:"ghost",onClick:k,disabled:p,children:_}),e[48]=p,e[49]=k,e[50]=_,e[51]=E):E=e[51];let C;e[52]!==N||e[53]!==E?(C=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[N,E]}),e[52]=N,e[53]=E,e[54]=C):C=e[54];let I;return e[55]!==A||e[56]!==C||e[57]!==b?(I=n.jsxs(me,{children:[b,A,C]}),e[55]=A,e[56]=C,e[57]=b,e[58]=I):I=e[58],I}function rs(t){const e=R.c(23),{orgName:s,orgLogo:a}=t,o=W();let i;e[0]!==a||e[1]!==s?(i=a?n.jsx(at,{url:a,fallback:s.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(vn,{className:"h-6 w-6 text-primary"})}),e[0]=a,e[1]=s,e[2]=i):i=e[2];let r;e[3]!==o?(r=o("common.requestPendingScreen.title"),e[3]=o,e[4]=r):r=e[4];let u;e[5]!==r?(u=n.jsx("h3",{className:"text-lg font-medium",children:r}),e[5]=r,e[6]=u):u=e[6];let m;e[7]!==s||e[8]!==o?(m=o("common.requestPendingScreen.description",{orgName:s}),e[7]=s,e[8]=o,e[9]=m):m=e[9];let h;e[10]!==m?(h=n.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[10]=m,e[11]=h):h=e[11];let v;e[12]!==u||e[13]!==h?(v=n.jsxs("div",{className:"space-y-2",children:[u,h]}),e[12]=u,e[13]=h,e[14]=v):v=e[14];let c;e[15]!==o?(c=o("common.requestPendingScreen.goHome"),e[15]=o,e[16]=c):c=e[16];let x;e[17]!==c?(x=n.jsx(F,{variant:"ghost",onClick:ls,children:c}),e[17]=c,e[18]=x):x=e[18];let g;return e[19]!==i||e[20]!==v||e[21]!==x?(g=n.jsxs(me,{children:[i,v,x]}),e[19]=i,e[20]=v,e[21]=x,e[22]=g):g=e[22],g}function ls(){window.location.href="/"}function cs(t){const e=R.c(45),{orgName:s,orgSlug:a,orgLogo:o,domain:i}=t,r=W();let u;e[0]!==a?(u=async()=>{const N=await fetch("/api/auth/custom/domain-request-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:a})}),k=await N.json();if(!N.ok||!k.success)throw new Error(k.error??"Failed to request access");return k},e[0]=a,e[1]=u):u=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=us,e[2]=m):m=e[2];let h;e[3]!==r?(h=N=>{Ve.error(N instanceof Error?N.message:r("common.requestToJoinScreen.failedToRequest"))},e[3]=r,e[4]=h):h=e[4];let v;e[5]!==u||e[6]!==h?(v={mutationFn:u,onSuccess:m,onError:h},e[5]=u,e[6]=h,e[7]=v):v=e[7];const c=Ye(v);let x;e[8]!==o||e[9]!==s?(x=o?n.jsx(at,{url:o,fallback:s.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Ot,{className:"h-6 w-6 text-primary"})}),e[8]=o,e[9]=s,e[10]=x):x=e[10];let g;e[11]!==s||e[12]!==r?(g=r("common.requestToJoinScreen.title",{orgName:s}),e[11]=s,e[12]=r,e[13]=g):g=e[13];let y;e[14]!==g?(y=n.jsx("h3",{className:"text-lg font-medium",children:g}),e[14]=g,e[15]=y):y=e[15];let l;e[16]!==i||e[17]!==r?(l=r("common.requestToJoinScreen.description",{domain:i}),e[16]=i,e[17]=r,e[18]=l):l=e[18];let d;e[19]!==l?(d=n.jsx("p",{className:"text-sm text-muted-foreground",children:l}),e[19]=l,e[20]=d):d=e[20];let p;e[21]!==y||e[22]!==d?(p=n.jsxs("div",{className:"space-y-2",children:[y,d]}),e[21]=y,e[22]=d,e[23]=p):p=e[23];let b;e[24]!==c?(b=()=>c.mutate(),e[24]=c,e[25]=b):b=e[25];let w;e[26]!==c.isPending||e[27]!==r?(w=c.isPending?r("common.requestToJoinScreen.requesting"):r("common.requestToJoinScreen.requestButton"),e[26]=c.isPending,e[27]=r,e[28]=w):w=e[28];let S;e[29]!==c.isPending||e[30]!==b||e[31]!==w?(S=n.jsx(F,{onClick:b,disabled:c.isPending,children:w}),e[29]=c.isPending,e[30]=b,e[31]=w,e[32]=S):S=e[32];const T=c.isPending;let P;e[33]!==r?(P=r("common.requestToJoinScreen.goToHome"),e[33]=r,e[34]=P):P=e[34];let A;e[35]!==c.isPending||e[36]!==P?(A=n.jsx(F,{variant:"ghost",onClick:ds,disabled:T,children:P}),e[35]=c.isPending,e[36]=P,e[37]=A):A=e[37];let j;e[38]!==S||e[39]!==A?(j=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[S,A]}),e[38]=S,e[39]=A,e[40]=j):j=e[40];let f;return e[41]!==p||e[42]!==j||e[43]!==x?(f=n.jsxs(me,{children:[x,p,j]}),e[41]=p,e[42]=j,e[43]=x,e[44]=f):f=e[44],f}function ds(){window.location.href="/"}function us(t){if(t.alreadyMember&&t.slug){window.location.href=`/${t.slug}`;return}window.location.reload()}function ms(t){const e=R.c(7);let s;e[0]!==t?(s=Ue.orgAccessStatus(t),e[0]=t,e[1]=s):s=e[1];let a;e[2]!==t?(a=async()=>{const i=await fetch(`/api/auth/custom/org-access-status/${encodeURIComponent(t)}`,{credentials:"include"});if(!i.ok)throw new Error(`org-access-status failed (${i.status})`);return await i.json()},e[2]=t,e[3]=a):a=e[3];let o;return e[4]!==s||e[5]!==a?(o={queryKey:s,queryFn:a,refetchOnWindowFocus:!1},e[4]=s,e[5]=a,e[6]=o):o=e[6],_t(o)}function fs({orgSlug:t}){const{data:e}=ms(t);if(e.status!=="member"){Qt()?.org===t&&Xt();const s=localStorage.getItem(Be.lastOrgSlug())===t;if(s&&localStorage.removeItem(Be.lastOrgSlug()),s&&(e.status==="not-found"||e.status==="no-access"))return window.location.href="/",null}return e.status==="not-found"?n.jsx(wt,{orgSlug:t,reason:"not-found"}):e.status==="pending-invite"?n.jsx(as,{invitationId:e.invitation.id,orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo}):e.status==="auto-domain-join"?n.jsx(ss,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="can-request"?n.jsx(cs,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="request-pending"?n.jsx(rs,{orgName:e.organization.name,orgLogo:e.organization.logo}):e.status==="member"?(window.location.reload(),null):n.jsx(wt,{orgSlug:t,orgName:e.organization.name,reason:"no-access"})}function Mt(t){const e=R.c(42),{ariaLabel:s,dismissLabel:a,eyebrow:o,title:i,description:r,icon:u,children:m,footerLeading:h,actions:v,onDismiss:c,tone:x}=t,g=x===void 0?"neutral":x,y=h||v;let l;e[0]!==g?(l=g==="system"&&n.jsx("div",{className:"h-0.5 bg-special"}),e[0]=g,e[1]=l):l=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(Cn,{size:14}),e[2]=d):d=e[2];let p;e[3]!==a||e[4]!==c?(p=n.jsx(F,{size:"icon-sm",variant:"ghost","aria-label":a,className:"absolute right-2 top-2 z-10 text-muted-foreground",onClick:c,children:d}),e[3]=a,e[4]=c,e[5]=p):p=e[5];const b=u&&"flex items-start gap-3",w=m&&"pb-3";let S;e[6]!==b||e[7]!==w?(S=dt("p-4 pr-11",b,w),e[6]=b,e[7]=w,e[8]=S):S=e[8];let T;e[9]!==u?(T=u&&n.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-special/10 text-special",children:u}),e[9]=u,e[10]=T):T=e[10];let P;e[11]!==o?(P=o&&n.jsx("p",{className:"text-xs text-muted-foreground",children:o}),e[11]=o,e[12]=P):P=e[12];let A;e[13]!==i?(A=n.jsx("h3",{className:"text-base font-semibold text-foreground",children:i}),e[13]=i,e[14]=A):A=e[14];let j;e[15]!==r?(j=r&&n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:r}),e[15]=r,e[16]=j):j=e[16];let f;e[17]!==A||e[18]!==j||e[19]!==P?(f=n.jsxs("div",{children:[P,A,j]}),e[17]=A,e[18]=j,e[19]=P,e[20]=f):f=e[20];let N;e[21]!==m?(N=m&&n.jsx("div",{className:"mt-3",children:m}),e[21]=m,e[22]=N):N=e[22];let k;e[23]!==f||e[24]!==N?(k=n.jsxs("div",{className:"min-w-0 flex-1",children:[f,N]}),e[23]=f,e[24]=N,e[25]=k):k=e[25];let _;e[26]!==k||e[27]!==S||e[28]!==T?(_=n.jsxs("div",{className:S,children:[T,k]}),e[26]=k,e[27]=S,e[28]=T,e[29]=_):_=e[29];let E;e[30]!==v||e[31]!==h||e[32]!==y||e[33]!==g?(E=y&&n.jsxs("div",{className:dt("flex items-center justify-between gap-3 px-4 py-2.5",g==="system"?"border-t border-border bg-muted/50":"pt-0"),children:[n.jsx("div",{className:"min-w-0 text-xs text-muted-foreground",children:h}),n.jsx("div",{className:"flex shrink-0 items-center gap-2",children:v})]}),e[30]=v,e[31]=h,e[32]=y,e[33]=g,e[34]=E):E=e[34];let C;return e[35]!==s||e[36]!==_||e[37]!==E||e[38]!==l||e[39]!==p||e[40]!==g?(C=n.jsxs("div",{role:"dialog","aria-label":s,"data-slot":"announcement-card","data-tone":g,className:"relative w-full overflow-hidden rounded-lg border border-border bg-background shadow-lg animate-in fade-in slide-in-from-bottom-2 duration-300",children:[l,p,_,E]}),e[35]=s,e[36]=_,e[37]=E,e[38]=l,e[39]=p,e[40]=g,e[41]=C):C=e[41],C}const hs={switcher:"tour-layout-switcher",nav:"tour-layout-nav",tasks:"tour-layout-tasks",projects:"tour-layout-projects",account:"tour-layout-account",recentActivity:"tour-layout-recent-activity",siteEditor:"tour-layout-site-editor",surfaceTabs:"tour-layout-surface-tabs",branchPicker:"tour-layout-branch-picker",automations:"tour-layout-automations",settings:"tour-layout-settings"};function Ft(t){return`[data-tour="${hs[t]}"]`}const gs=[{scope:"shell",anchor:"switcher",titleKey:"layoutTour.switcher.title",descKey:"layoutTour.switcher.description",side:"right"},{scope:"shell",anchor:"nav",titleKey:"layoutTour.nav.title",descKey:"layoutTour.nav.description",side:"right"},{scope:"shell",anchor:"tasks",titleKey:"layoutTour.tasks.title",descKey:"layoutTour.tasks.description",side:"right"},{scope:"project",anchor:"siteEditor",titleKey:"layoutTour.siteEditor.title",descKey:"layoutTour.siteEditor.description",side:"right"},{scope:"project",anchor:"automations",titleKey:"layoutTour.automations.title",descKey:"layoutTour.automations.description",side:"right"},{scope:"shell",anchor:"settings",titleKey:"layoutTour.settings.title",descKey:"layoutTour.settings.description",side:"right"},{scope:"shell",anchor:"projects",titleKey:"layoutTour.projects.title",descKey:"layoutTour.projects.description",side:"right"},{scope:"shell",anchor:"account",titleKey:"layoutTour.account.title",descKey:"layoutTour.account.description",side:"right"},{scope:"siteEditor",anchor:"surfaceTabs",titleKey:"layoutTour.surfaceTabs.title",descKey:"layoutTour.surfaceTabs.description",side:"bottom"},{scope:"siteEditor",anchor:"branchPicker",titleKey:"layoutTour.branchPicker.title",descKey:"layoutTour.branchPicker.description",side:"bottom"},{scope:"orgHome",anchor:"recentActivity",titleKey:"layoutTour.recentActivity.title",descKey:"layoutTour.recentActivity.description",side:"top"}];function ps(t){return gs.filter(e=>e.scope==="shell"||e.scope==="orgHome"&&t.onOrgHome||e.scope==="project"&&t.inProject||e.scope==="siteEditor"&&t.onSiteEditor)}function ys(t,e){return ps(e).map(s=>({element:Ft(s.anchor),popover:{title:t(s.titleKey),description:t(s.descKey),side:s.side,align:"center"}}))}const bs=Ft("switcher"),xs=30;function zt(t){const e=document.querySelector(t);return e instanceof HTMLElement&&e.offsetParent!==null}function ws(t,e){return ys(t,e).filter(s=>typeof s.element=="string"&&zt(s.element))}function Ss(t,e){return{showProgress:!0,progressText:t("layoutTour.progress"),nextBtnText:t("layoutTour.next"),prevBtnText:t("layoutTour.prev"),doneBtnText:t("layoutTour.done"),showButtons:["next","previous"],smoothScroll:!0,allowClose:!0,disableActiveInteraction:!0,stagePadding:6,stageRadius:8,waitForElement:0,skipMissingElement:!0,popoverClass:"layout-tour-popover",onPopoverRender:(s,{driver:a})=>{if(s.footerButtons.querySelector(".layout-tour-skip"))return;const o=document.createElement("button");o.type="button",o.className="driver-popover-footer-btn layout-tour-skip",o.textContent=t("layoutTour.skip"),o.addEventListener("click",()=>a.destroy()),s.footerButtons.insertBefore(o,s.footerButtons.firstChild)},onDestroyed:()=>{Je=!1},steps:e}}let Je=!1;async function vs(){return(await Zt(()=>import("./driver.js-Dj4CfABu.js"),[])).driver}function js(t,e){if(Je)return;Je=!0;let s=0;const a=()=>{if(!zt(bs)&&s++<xs){requestAnimationFrame(a);return}const o=ws(t,e);if(o.length===0){Je=!1;return}vs().then(i=>{i(Ss(t,o)).drive()}).catch(()=>{Je=!1})};a()}function ks(t){return t!=="off"}function li(t){if(!t.hasSource)return[];const e=["site-editor"];return ks(t.cmsMode)&&e.push("content"),t.runtime==="sandbox"&&e.push("code"),e}function qt(t){return t==="site-editor"||t==="content"||t==="code"||t.startsWith("code:")}function ci(t){return t.reportsOnly&&!t.onReportAgent&&qt(t.tabId)}const Ts=[{id:"new-layout",date:"2026-09-22",eyebrow:"Now Available",title:"New Layout",bullets:[{icon:ot,title:"Unified page headers",body:"Every page now has a clear header with navigation breadcrumbs and actions, making it easy to orient yourself and move around."},{icon:ct,title:"Consistent navigation and controls",body:"Settings and project pages use a predictable sidebar instead of scattered tabs. Buttons, inputs and toolbars share one shape and one height, and the layout adapts to smaller screens."},{icon:jn,title:"Site editor redesigned",body:"Try the redesigned blocks editor from Profile & Preferences. Blocks share consistent actions, variants appear beside their block in the header, and section selection is searchable."}],cta:{label:"Take a tour",action:"start-tour"}},{id:"unified-workspace-layout",date:"2026-09-01",eyebrow:"Now Available",title:"A new way around Studio",bullets:[{icon:pt,title:"Unified org switcher",body:"Organizations and agents now share one control at the top of the sidebar. Search it to jump straight to any agent, including ones in your other organizations."},{icon:te,title:"Your org at a glance",body:"The organization home now opens on the agents your team built and the tasks they are running — no empty board to fill in first."},{icon:ot,title:"Simplified CMS",body:"The CMS opens over the page you are previewing rather than somewhere else, so changing a section never costs you your place."}],cta:{label:"Take the tour",action:"start-tour"}},{id:"native-app-linux-beta",date:"2026-08-20",eyebrow:"Now Available",title:"Studio for Linux is now in beta",bullets:[{icon:ot,title:"Native Linux desktop app",body:"Studio now ships as an AppImage for 64-bit x86 Linux, bringing the local desktop workflow to Linux."},{icon:ae,title:"Verified, no-root install",body:"The installer verifies the download, installs Studio to ~/.local/bin, and adds it to your application launcher without sudo."},{icon:re,title:"Beta today, broader support next",body:"We're validating more distributions and desktop environments. Arm builds are not available yet, and your feedback will shape general availability."}],cta:{label:"Install Studio",action:"download-app"},learnMoreHref:"https://github.com/decocms/studio/releases/tag/native-v4.242.0"},{id:"native-app-macos",date:"2026-07-30",eyebrow:"Now Available",title:"New beta studio app",bullets:[{icon:re,title:"Faster CMS previews",body:"Every draft gets its own git worktree on your machine, so previews render instantly as you edit."},{icon:te,title:"Native Claude Code & Codex support",body:"State-of-the-art coding agents, running natively against your local files."},{icon:en,title:"Boosted performance",body:"Entirely rewritten in Rust with a smaller memory footprint than the Bun-based runtime — fast even on modest machines."},{icon:ot,title:"Apple Silicon only — Windows coming soon",body:"Today's builds target macOS on Apple Silicon; Windows is next."}],cta:{label:"Install on Mac",action:"download-app"},learnMoreHref:"https://github.com/decocms/studio/releases"},{id:"codex-gpt-5-6-defaults",date:"2026-07-13",eyebrow:"Now Available",title:"Codex defaults move to GPT-5.6",bullets:[{icon:te,title:"Sol leads Thinking",body:"Codex Thinking now defaults to `gpt-5.6-sol` for deeper coding and reasoning work."},{icon:ae,title:"Terra balances Smart",body:"The Smart tier now uses `gpt-5.6-terra`, replacing GPT-5.4 as the default balanced Codex model."},{icon:re,title:"Luna speeds up Fast",body:"The Fast tier and lightweight Codex title generation now use `gpt-5.6-luna`. Existing threads that reference older GPT-5.4 or GPT-5.5 model IDs remain supported."}]},{id:"claude-sonnet-5",date:"2026-06-30",eyebrow:"Now Available",title:"Claude Sonnet 5 powers the Smart tier",bullets:[{icon:te,title:"More agentic coding",body:"Sonnet 5 is Anthropic's strongest Sonnet model yet, with improved reasoning, tool use, coding, and knowledge work compared with Sonnet 4.6."},{icon:ae,title:"Available in Claude Code",body:"The Claude Code harness now pins the Smart tier to the new `claude-sonnet-5` model id so new sessions use Sonnet 5 by default."},{icon:re,title:"Nothing to change",body:"Existing Smart-tier chats and agents pick up Sonnet 5 automatically. Thinking remains on Opus 4.8 1M."}],learnMoreHref:"https://www.anthropic.com/news/claude-sonnet-5"},{id:"fable-5-suspension",date:"2026-06-13",eyebrow:"Important Update",title:"Fable 5 & Mythos 5 suspended — Opus 4.8 takes over",bullets:[{icon:ae,title:"US government directive",body:"Anthropic received an export control directive requiring the suspension of Fable 5 and Mythos 5 access for all users, citing national security concerns. Anthropic is complying while it works to resolve the matter."},{icon:te,title:"Opus 4.8 steps in as the Thinking tier",body:"The Thinking tier now runs on Claude Opus 4.8, which remains fully operational. Performance on most tasks is comparable, and Anthropic reports more than 95% of sessions were unaffected by the Fable 5 classifiers anyway."},{icon:re,title:"Nothing to change",body:"The switch is automatic — any chat or agent already using the Thinking tier is now served by Opus 4.8. Anthropic will share further details within 24 hours."}],learnMoreHref:"https://www.anthropic.com/news/fable-mythos-access"},{id:"claude-fable-5",date:"2026-06-09",eyebrow:"Now Available",title:"Claude Fable 5 leads the Thinking tier",bullets:[{icon:te,title:"State-of-the-art reasoning",body:"Fable 5 takes the Thinking tier, posting top scores across software engineering, knowledge work, and vision — and outperforming Opus 4.8 on nearly every benchmark Anthropic tested."},{icon:ae,title:"Safety without the slowdown",body:"New classifiers route the small slice of high-risk requests (cybersecurity, bio/chem) back to Opus 4.8. Anthropic reports more than 95% of sessions never trigger a fallback."},{icon:re,title:"Nothing to change",body:"Chats and agents pick up Fable 5 automatically wherever the Thinking tier is selected. Opus 4.8 stays available as the safety fallback."}],learnMoreHref:"https://www.anthropic.com/news/claude-fable-5-mythos-5"},{id:"claude-opus-4-8",date:"2026-05-28",eyebrow:"Now Available",title:"Claude Opus 4.8 is the new default",bullets:[{icon:te,title:"Smarter thinking, same price",body:"Opus 4.8 now leads the Thinking and Smarter tiers, outperforming Opus 4.7 on coding, reasoning, and agent tasks at the same cost."},{icon:ae,title:"More honest answers",body:"It's about 4× less likely to let a code flaw slip through unflagged, and surfaces uncertainty instead of making unsupported claims."},{icon:re,title:"Nothing to change",body:"Chats and agents pick up Opus 4.8 automatically wherever the Thinking or Smarter tier is selected."}],learnMoreHref:"https://www.anthropic.com/news/claude-opus-4-8"},{id:"enhanced-sidebar",date:"2026-05-28",eyebrow:"Now Available",title:"Enhanced sidebar",bullets:[{icon:te,title:"A clearer view of what's running",body:"See every task in your organization at a glance, with each agent and status group laid out so you can spot active work without hunting for it."},{icon:ct,title:"Browse one group at a time",body:"Expand the groups you care about and pull in more results on demand — no more endless scrolling to find an older conversation."},{icon:ae,title:"Polished and steadier",body:"Several sidebar bugs are fixed, including empty agent groups showing the right action and status filters returning the right tasks."}]},{id:"smarter-task-delegation",date:"2026-05-27",eyebrow:"Now Available",title:"Smarter task delegation",bullets:[{icon:pt,title:"Real results from delegated agents",body:"When one agent hands work to another, you'll see the full report inline — no more empty replies hiding the work that was done."},{icon:re,title:"Same powers, top to bottom",body:"Delegated agents now work with the same tools, context, and memory as the agent that called them, so complex multi-agent investigations finish on the first try."},{icon:ae,title:"Clearer progress signals",body:"When a delegated task hits its limit or runs into a problem, you get a plain-language message instead of a silent stall."}]},{id:"sidebar-task-groups",date:"2026-05-27",eyebrow:"Now Available",title:"Redesigned sidebar",bullets:[{icon:te,title:"Group by agent or status",body:"Switch the task list between grouping by agent or by status — pick whichever matches how you're working right now."},{icon:ct,title:"Sharper filters",body:"Narrow the list to your tasks, manual chats, or automations from a compact filter row above the groups."}]},{id:"release-channel",date:"2026-05-26",eyebrow:"Now Available",title:"Release announcements",bullets:[{icon:te,title:"Heads-up when features ship",body:"New releases surface in a corner card the first time you see them, then stick around in your inbox."},{icon:kn,title:"Unified inbox",body:"Org invitations and product updates now share one chronological feed in the sidebar."}]}],Bt=Ts,it="studio.release-feed.v1",mt=new Set;let de="",ue={},ft=!1;function Ns(){if(ft)return de||"{}";try{return localStorage.getItem(it)??"{}"}catch{return de||"{}"}}function Kt(t){try{const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function St(){const t=Ns();return t!==de&&(de=t,ue=Kt(t)),ue}function _s(t){mt.add(t);const e=s=>{if(!(s.key!==it&&s.key!==null)){try{const a=localStorage.getItem(it)??"{}",i={...Kt(a),...ue};ue=i,de=JSON.stringify(i)}catch{}t()}};return window.addEventListener("storage",e),()=>{mt.delete(t),window.removeEventListener("storage",e)}}function As(t){ue=t,de=JSON.stringify(t);try{localStorage.setItem(it,de),ft=!1}catch{ft=!0}mt.forEach(e=>e())}function Ps(){const t=R.c(7),e=G.useSyncExternalStore(_s,St,St);let s;t[0]!==e?(s=m=>!!e[m],t[0]=e,t[1]=s):s=t[1];const a=s,o=Cs;let i;t[2]!==e?(i=Bt.reduce((m,h)=>e[h.id]?m:m+1,0),t[2]=e,t[3]=i):i=t[3];const r=i;let u;return t[4]!==a||t[5]!==r?(u={isSeen:a,markSeen:o,unseenCount:r},t[4]=a,t[5]=r,t[6]=u):u=t[6],u}function Cs(t){ue[t]||As({...ue,[t]:{seenAt:new Date().toISOString()}})}const vt=new Map;function Ht(t){let e=vt.get(t);return e||(e={now:Date.now(),subscribers:new Set,intervalId:null},vt.set(t,e)),e}function Es(t,e){const s=Ht(t);return s.subscribers.add(e),s.intervalId===null&&(s.intervalId=setInterval(()=>{s.now=Date.now();for(const a of s.subscribers)a()},t)),()=>{s.subscribers.delete(e),s.subscribers.size===0&&s.intervalId!==null&&(clearInterval(s.intervalId),s.intervalId=null)}}function Os(t){const e=R.c(4),s=t===void 0?6e4:t;let a;e[0]!==s?(a=()=>Ht(s).now,e[0]=s,e[1]=a):a=e[1];const o=a;let i;return e[2]!==s?(i=r=>Es(s,r),e[2]=s,e[3]=i):i=e[3],G.useSyncExternalStore(i,o,o)}const Is=720*60*60*1e3,Ls=10080*60*1e3;function $s(t){const[e,s,a]=t.split("-").map(Number);return!e||!s||!a?new Date(t).getTime():new Date(e,s-1,a).getTime()}function Ds(t){const e=Bt[0];if(!e)return null;const s=$s(e.date),a=t-s;return a<0||a>Is?null:e}function Rs(t){if(t instanceof Date)return t.getTime();if(typeof t=="string"||typeof t=="number"){const e=new Date(t).getTime();return Number.isFinite(e)?e:null}return null}function Ms(t,e){const s=Rs(t);return s===null?!1:e-s>=Ls}function Fs(){const t=R.c(53),e=W(),s=On(),a=tn(),o=It(),i=!!s,r=a===ie.home&&!s;let u;t[0]!==o||t[1]!==i?(u=i&&!!o&&qt(o),t[0]=o,t[1]=i,t[2]=u):u=t[2];const m=u,{data:h}=Ke.useSession(),{isSeen:v,markSeen:c}=Ps(),[x,g]=G.useState(!1),y=Os(6e4);let l,d,p;if(t[3]!==v||t[4]!==y||t[5]!==h?.user?.createdAt){p=Symbol.for("react.early_return_sentinel");e:{if(l=Ds(y),!l){p=null;break e}if(!Ms(h?.user?.createdAt,y)){p=null;break e}d=v(l.id)}t[3]=v,t[4]=y,t[5]=h?.user?.createdAt,t[6]=l,t[7]=d,t[8]=p}else l=t[6],d=t[7],p=t[8];if(p!==Symbol.for("react.early_return_sentinel"))return p;if(d)return null;let b;t[9]!==l.id||t[10]!==i||t[11]!==c||t[12]!==r||t[13]!==m||t[14]!==e?(b=()=>{c(l.id),js(e,{onOrgHome:r,inProject:i,onSiteEditor:m})},t[9]=l.id,t[10]=i,t[11]=c,t[12]=r,t[13]=m,t[14]=e,t[15]=b):b=t[15];const w=b;let S;t[16]!==e?(S=e("announcements.release.ariaLabel"),t[16]=e,t[17]=S):S=t[17];let T;t[18]!==e?(T=e("announcements.release.dismiss"),t[18]=e,t[19]=T):T=t[19];const P=l.eyebrow,A=l.title;let j;t[20]!==l.id||t[21]!==c?(j=()=>c(l.id),t[20]=l.id,t[21]=c,t[22]=j):j=t[22];let f;t[23]!==l.id||t[24]!==l.learnMoreHref||t[25]!==c||t[26]!==e?(f=l.learnMoreHref?n.jsx("a",{href:l.learnMoreHref,target:"_blank",rel:"noreferrer",onClick:()=>c(l.id),className:"underline-offset-2 hover:text-foreground hover:underline",children:e("announcements.release.learnMore")}):null,t[23]=l.id,t[24]=l.learnMoreHref,t[25]=c,t[26]=e,t[27]=f):f=t[27];let N;t[28]!==l.cta||t[29]!==l.id||t[30]!==c||t[31]!==w?(N=l.cta?"href"in l.cta?n.jsx(F,{asChild:!0,size:"sm",onClick:()=>c(l.id),children:n.jsx("a",{href:l.cta.href,children:l.cta.label})}):l.cta.action==="start-tour"?n.jsx(F,{size:"sm",onClick:w,children:l.cta.label}):n.jsx(F,{size:"sm",onClick:()=>g(!0),children:l.cta.label}):null,t[28]=l.cta,t[29]=l.id,t[30]=c,t[31]=w,t[32]=N):N=t[32];let k;t[33]!==l.bullets?(k=l.bullets.map(zs),t[33]=l.bullets,t[34]=k):k=t[34];let _;t[35]!==k?(_=n.jsx("ul",{className:"flex flex-col gap-3",children:k}),t[35]=k,t[36]=_):_=t[36];let E;t[37]!==l.id||t[38]!==c?(E=O=>{g(O),O||c(l.id)},t[37]=l.id,t[38]=c,t[39]=E):E=t[39];let C;t[40]!==x||t[41]!==E?(C=n.jsx(En,{open:x,onOpenChange:E}),t[40]=x,t[41]=E,t[42]=C):C=t[42];let I;return t[43]!==l.eyebrow||t[44]!==l.title||t[45]!==N||t[46]!==_||t[47]!==C||t[48]!==S||t[49]!==T||t[50]!==j||t[51]!==f?(I=n.jsxs(Mt,{ariaLabel:S,dismissLabel:T,eyebrow:P,title:A,onDismiss:j,footerLeading:f,actions:N,children:[_,C]}),t[43]=l.eyebrow,t[44]=l.title,t[45]=N,t[46]=_,t[47]=C,t[48]=S,t[49]=T,t[50]=j,t[51]=f,t[52]=I):I=t[52],I}function zs(t,e){return n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx(t.icon,{size:20,className:"mt-0.5 shrink-0 text-muted-foreground"}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),n.jsx("p",{className:"text-xs text-muted-foreground",children:t.body})]})]},e)}const Ut=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),ce=Ut?"⌘":"Ctrl",V={commandPalette:{keys:[ce,"K"],description:"Command palette"},keyboardShortcuts:{keys:["?"],description:"Keyboard shortcuts"},back:{keys:[ce,"["],description:"Back to previous"},focusChatInput:{keys:[ce,"L"],description:"Focus chat input"},saveAndFormat:{keys:[ce,"S"],description:"Save & format"},sendMessage:{keys:["Enter"],description:"Send message"},newLine:{keys:["Shift","Enter"],description:"New line"},selectOption:{keys:["1-9"],description:"Select option"},applyFilter:{keys:[ce,"Enter"],description:"Apply filter"},togglePlanMode:{keys:[ce,"Shift","L"],description:"Toggle plan mode"},newTask:{keys:["Shift",ce,"S"],description:"New task"},toggleDaemon:{keys:[ce,"D"],description:"Toggle daemon logs"}},qs=[{label:"General",shortcuts:[V.commandPalette,V.keyboardShortcuts,V.back,V.newTask,V.toggleDaemon]},{label:"Editor",shortcuts:[V.saveAndFormat]},{label:"Chat",shortcuts:[V.focusChatInput,V.togglePlanMode,V.sendMessage,V.newLine]},{label:"Questions",shortcuts:[V.selectOption]},{label:"Monitoring",shortcuts:[V.applyFilter]}];function jt(t){return Ut?t.metaKey:t.ctrlKey}function Bs(t){if(!(t instanceof HTMLElement))return!1;if(t.isContentEditable)return!0;const e=t.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"}function Ks(t){const e=R.c(11),{open:s,onOpenChange:a}=t,o=W();let i;e[0]!==o?(i=o("common.keyboardShortcutsDialog.title"),e[0]=o,e[1]=i):i=e[1];let r;e[2]!==i?(r=n.jsx(Lt,{children:n.jsx($t,{children:i})}),e[2]=i,e[3]=r):r=e[3];let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx("div",{className:"flex flex-col gap-4",children:qs.map(Hs)}),e[4]=u):u=e[4];let m;e[5]!==r?(m=n.jsxs(Dt,{className:"sm:max-w-md",children:[r,u]}),e[5]=r,e[6]=m):m=e[6];let h;return e[7]!==a||e[8]!==s||e[9]!==m?(h=n.jsx(Rt,{open:s,onOpenChange:a,children:m}),e[7]=a,e[8]=s,e[9]=m,e[10]=h):h=e[10],h}function Hs(t){return n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",children:t.label}),n.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(Us)})]},t.label)}function Us(t){return n.jsxs("div",{className:"flex items-center justify-between py-1",children:[n.jsx("span",{className:"text-sm",children:t.description}),n.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(Gs)})]},t.description)}function Gs(t){return n.jsx("kbd",{className:"inline-flex items-center justify-center min-w-6 h-6 px-1.5 rounded-sm border border-border bg-muted text-muted-foreground text-xs font-mono",children:t},t)}const kt=8;function Js(t){const{org:e}=ht(),s=Un({connectionId:Pt,orgId:e.id,orgSlug:e.slug}),{data:a}=He({queryKey:Ue.globalSearch(e.id,t,kt),enabled:!!s&&t.trim().length>=2,staleTime:15e3,retry:!1,queryFn:async()=>{if(!s)return[];try{return(await s.callTool({name:"GLOBAL_SEARCH",arguments:{query:t,limit:kt}})).structuredContent?.items??[]}catch{return[]}}});return a??[]}function Vs(t){const e=R.c(195),{open:s,onOpenChange:a}=t,o=W(),i=At(),{org:r}=ht(),{projects:u,hasProjects:m}=In(),[h,v]=G.useState(""),c=G.useDeferredValue(h),x=Js(c);let g;e[0]!==a?(g=()=>{a(!1),v("")},e[0]=a,e[1]=g):g=e[1];const y=g;let l;e[2]!==y?(l=(z,Y)=>{ut("command_palette_used",{kind:Y}),z(),y()},e[2]=y,e[3]=l):l=e[3];const d=l;let p;e[4]!==i||e[5]!==r.id||e[6]!==r.slug?(p=z=>{if(z.type==="connection"){if(!z.slug){i({to:"/$org/settings/connections",params:{org:r.slug},search:{tab:"all"}});return}i({to:"/$org/settings/connections/$appSlug",params:{org:r.slug,appSlug:z.slug}});return}if(z.type==="task"){i({to:ie.tasks,params:{org:r.slug,taskKey:z.key??void 0}});return}const Y=Ct(r.id).id;nn(i,sn({org:r.slug,agentId:z.virtual_mcp_id??Y,superAgentId:Y}),{search:()=>({thread:z.id}),replace:!1})},e[4]=i,e[5]=r.id,e[6]=r.slug,e[7]=p):p=e[7];const b=p;let w;e[8]!==h?(w=[h],e[8]=h,e[9]=w):w=e[9];const S=w;let T,P,A,j,f,N,k,_,E,C,I,O,M;if(e[10]!==y||e[11]!==d||e[12]!==m||e[13]!==x||e[14]!==i||e[15]!==a||e[16]!==s||e[17]!==b||e[18]!==r.slug||e[19]!==u||e[20]!==S||e[21]!==o||e[22]!==h){const z=x.filter(Ys),Y=x.filter(Ws);let ne;e[36]!==r.slug?(ne={org:r.slug},e[36]=r.slug,e[37]=ne):ne=e[37];const D=ne;let ee;e[38]!==o?(ee=o("sidebar.navDestinations.home"),e[38]=o,e[39]=ee):ee=e[39];let Q;e[40]===Symbol.for("react.memo_cache_sentinel")?(Q=n.jsx(Nn,{"aria-hidden":"true"}),e[40]=Q):Q=e[40];let K;e[41]!==D||e[42]!==ee?(K={key:"home",label:ee,icon:Q,to:ie.home,params:D},e[41]=D,e[42]=ee,e[43]=K):K=e[43];let X;e[44]!==o?(X=o("sidebar.navDestinations.reports"),e[44]=o,e[45]=X):X=e[45];let se;e[46]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsx(_n,{"aria-hidden":"true"}),e[46]=se):se=e[46];let H;e[47]!==D||e[48]!==X?(H={key:"reports",label:X,icon:se,to:ie.reports,params:D},e[47]=D,e[48]=X,e[49]=H):H=e[49];let U;e[50]!==o?(U=o("sidebar.navDestinations.tasks"),e[50]=o,e[51]=U):U=e[51];let oe;e[52]===Symbol.for("react.memo_cache_sentinel")?(oe=n.jsx(bt,{"aria-hidden":"true"}),e[52]=oe):oe=e[52];let Z;e[53]!==r.slug?(Z={org:r.slug,taskKey:void 0},e[53]=r.slug,e[54]=Z):Z=e[54];let L;e[55]!==U||e[56]!==Z?(L={key:"tasks",label:U,icon:oe,to:ie.tasks,params:Z},e[55]=U,e[56]=Z,e[57]=L):L=e[57];let q;e[58]!==o?(q=o("sidebar.navDestinations.library"),e[58]=o,e[59]=q):q=e[59];let Qe;e[60]===Symbol.for("react.memo_cache_sentinel")?(Qe=n.jsx(Rn,{"aria-hidden":"true"}),e[60]=Qe):Qe=e[60];let fe;e[61]!==D||e[62]!==q?(fe={key:"library",label:q,icon:Qe,to:ie.library,params:D},e[61]=D,e[62]=q,e[63]=fe):fe=e[63];let he;e[64]!==o?(he=o("sidebar.navDestinations.discover"),e[64]=o,e[65]=he):he=e[65];let Xe;e[66]===Symbol.for("react.memo_cache_sentinel")?(Xe=n.jsx(An,{"aria-hidden":"true"}),e[66]=Xe):Xe=e[66];let ge;e[67]!==D||e[68]!==he?(ge={key:"discover",label:he,icon:Xe,to:ie.discover,params:D},e[67]=D,e[68]=he,e[69]=ge):ge=e[69];let Ze;e[70]!==K||e[71]!==H||e[72]!==L||e[73]!==fe||e[74]!==ge?(Ze=[K,H,L,fe,ge],e[70]=K,e[71]=H,e[72]=L,e[73]=fe,e[74]=ge,e[75]=Ze):Ze=e[75];const rt=Ze;P=Fn,j=s,e[76]!==y||e[77]!==a?(f=$=>$?a(!0):y(),e[76]=y,e[77]=a,e[78]=f):f=e[78],e[79]!==o?(N=o("commandPalette.title"),e[79]=o,e[80]=N):N=e[80],e[81]!==o?(k=o("commandPalette.description"),e[81]=o,e[82]=k):k=e[82];let pe;e[83]!==o?(pe=o("commandPalette.placeholder"),e[83]=o,e[84]=pe):pe=e[84];let ye;e[85]!==o?(ye=o("commandPalette.placeholder"),e[85]=o,e[86]=ye):ye=e[86],e[87]!==pe||e[88]!==ye||e[89]!==h?(_=n.jsx(zn,{placeholder:pe,"aria-label":ye,value:h,onValueChange:v}),e[87]=pe,e[88]=ye,e[89]=h,e[90]=_):_=e[90],T=qn;let be;e[91]!==o?(be=o("commandPalette.empty"),e[91]=o,e[92]=be):be=e[92],e[93]!==be?(E=n.jsx(Bn,{children:be}),e[93]=be,e[94]=E):E=e[94];let xe;e[95]!==o?(xe=o("commandPalette.goTo"),e[95]=o,e[96]=xe):xe=e[96];let we;e[97]!==rt||e[98]!==d||e[99]!==i?(we=rt.map($=>n.jsxs(le,{onSelect:()=>d(()=>i({to:$.to,params:$.params}),"destination"),children:[$.icon,n.jsx("span",{children:$.label})]},$.key)),e[97]=rt,e[98]=d,e[99]=i,e[100]=we):we=e[100],e[101]!==xe||e[102]!==we?(C=n.jsx(Ge,{heading:xe,children:we}),e[101]=xe,e[102]=we,e[103]=C):C=e[103],e[104]!==d||e[105]!==m||e[106]!==i||e[107]!==r.slug||e[108]!==u||e[109]!==o?(I=m&&n.jsx(Ge,{heading:o("commandPalette.projects"),children:u.map($=>n.jsxs(le,{value:`project ${$.title}`,onSelect:()=>d(()=>i({to:ie.projects,params:{org:r.slug,agentId:$.id}}),"project"),children:[n.jsx(Hn,{icon:$.icon,name:$.title,"aria-hidden":"true"}),n.jsx("span",{children:$.title})]},$.id))}),e[104]=d,e[105]=m,e[106]=i,e[107]=r.slug,e[108]=u,e[109]=o,e[110]=I):I=e[110];let Se;e[111]!==o?(Se=o("commandPalette.actions"),e[111]=o,e[112]=Se):Se=e[112];let ve;e[113]!==o?(ve=o("commandPalette.newProject"),e[113]=o,e[114]=ve):ve=e[114];let je;e[115]!==d||e[116]!==i||e[117]!==D?(je=()=>d(()=>i({to:ie.home,params:D}),"new_project"),e[115]=d,e[116]=i,e[117]=D,e[118]=je):je=e[118];let et;e[119]===Symbol.for("react.memo_cache_sentinel")?(et=n.jsx(xt,{"aria-hidden":"true"}),e[119]=et):et=e[119];let ke;e[120]!==o?(ke=o("commandPalette.newProject"),e[120]=o,e[121]=ke):ke=e[121];let Te;e[122]!==ke?(Te=n.jsx("span",{children:ke}),e[122]=ke,e[123]=Te):Te=e[123];let Ne;e[124]!==ve||e[125]!==je||e[126]!==Te?(Ne=n.jsxs(le,{value:ve,onSelect:je,children:[et,Te]}),e[124]=ve,e[125]=je,e[126]=Te,e[127]=Ne):Ne=e[127];let _e;e[128]!==o?(_e=o("commandPalette.inviteTeammate"),e[128]=o,e[129]=_e):_e=e[129];let Ae;e[130]!==d||e[131]!==i||e[132]!==D?(Ae=()=>d(()=>i({to:"/$org/settings/members",params:D}),"invite"),e[130]=d,e[131]=i,e[132]=D,e[133]=Ae):Ae=e[133];let tt;e[134]===Symbol.for("react.memo_cache_sentinel")?(tt=n.jsx(Pn,{"aria-hidden":"true"}),e[134]=tt):tt=e[134];let Pe;e[135]!==o?(Pe=o("commandPalette.inviteTeammate"),e[135]=o,e[136]=Pe):Pe=e[136];let Ce;e[137]!==Pe?(Ce=n.jsx("span",{children:Pe}),e[137]=Pe,e[138]=Ce):Ce=e[138];let Ee;e[139]!==_e||e[140]!==Ae||e[141]!==Ce?(Ee=n.jsxs(le,{value:_e,onSelect:Ae,children:[tt,Ce]}),e[139]=_e,e[140]=Ae,e[141]=Ce,e[142]=Ee):Ee=e[142];let Oe;e[143]!==o?(Oe=o("commandPalette.addConnection"),e[143]=o,e[144]=Oe):Oe=e[144];let Ie;e[145]!==d||e[146]!==i||e[147]!==D?(Ie=()=>d(()=>i({to:"/$org/settings/connections",params:D,search:{tab:"all"}}),"add_connection"),e[145]=d,e[146]=i,e[147]=D,e[148]=Ie):Ie=e[148];let nt;e[149]===Symbol.for("react.memo_cache_sentinel")?(nt=n.jsx(xt,{"aria-hidden":"true"}),e[149]=nt):nt=e[149];let Le;e[150]!==o?(Le=o("commandPalette.addConnection"),e[150]=o,e[151]=Le):Le=e[151];let $e;e[152]!==Le?($e=n.jsx("span",{children:Le}),e[152]=Le,e[153]=$e):$e=e[153];let De;e[154]!==Oe||e[155]!==Ie||e[156]!==$e?(De=n.jsxs(le,{value:Oe,onSelect:Ie,children:[nt,$e]}),e[154]=Oe,e[155]=Ie,e[156]=$e,e[157]=De):De=e[157];let Re;e[158]!==o?(Re=o("commandPalette.settings"),e[158]=o,e[159]=Re):Re=e[159];let Me;e[160]!==d||e[161]!==i||e[162]!==D?(Me=()=>d(()=>i({to:"/$org/settings/general",params:D}),"settings"),e[160]=d,e[161]=i,e[162]=D,e[163]=Me):Me=e[163];let st;e[164]===Symbol.for("react.memo_cache_sentinel")?(st=n.jsx(Mn,{"aria-hidden":"true"}),e[164]=st):st=e[164];let Fe;e[165]!==o?(Fe=o("commandPalette.settings"),e[165]=o,e[166]=Fe):Fe=e[166];let ze;e[167]!==Fe?(ze=n.jsx("span",{children:Fe}),e[167]=Fe,e[168]=ze):ze=e[168];let qe;e[169]!==Re||e[170]!==Me||e[171]!==ze?(qe=n.jsxs(le,{value:Re,onSelect:Me,children:[st,ze]}),e[169]=Re,e[170]=Me,e[171]=ze,e[172]=qe):qe=e[172],e[173]!==Se||e[174]!==Ne||e[175]!==Ee||e[176]!==De||e[177]!==qe?(O=n.jsxs(Ge,{heading:Se,children:[Ne,Ee,De,qe]}),e[173]=Se,e[174]=Ne,e[175]=Ee,e[176]=De,e[177]=qe,e[178]=O):O=e[178],M=z.length>0&&n.jsx(Ge,{heading:o("commandPalette.connections"),children:z.map($=>n.jsxs(le,{value:`${$.title} ${$.id}`,keywords:S,onSelect:()=>d(()=>b($),"connection"),children:[n.jsx(Kn,{icon:$.icon,name:$.title,size:"2xs","aria-hidden":"true"}),n.jsx("span",{className:"truncate",children:$.title})]},`connection:${$.id}`))}),A=Y.length>0&&n.jsx(Ge,{heading:o("commandPalette.results"),children:Y.map($=>n.jsxs(le,{value:`${$.title} ${$.id}`,keywords:S,onSelect:()=>d(()=>b($),$.type),children:[$.type==="thread"?n.jsx(Tn,{"aria-hidden":"true"}):n.jsx(bt,{"aria-hidden":"true"}),n.jsx("span",{className:"truncate",children:$.title}),$.type==="task"&&$.key&&n.jsx("span",{className:"ml-auto shrink-0 font-mono text-xs text-muted-foreground",children:$.key})]},`${$.type}:${$.id}`))}),e[10]=y,e[11]=d,e[12]=m,e[13]=x,e[14]=i,e[15]=a,e[16]=s,e[17]=b,e[18]=r.slug,e[19]=u,e[20]=S,e[21]=o,e[22]=h,e[23]=T,e[24]=P,e[25]=A,e[26]=j,e[27]=f,e[28]=N,e[29]=k,e[30]=_,e[31]=E,e[32]=C,e[33]=I,e[34]=O,e[35]=M}else T=e[23],P=e[24],A=e[25],j=e[26],f=e[27],N=e[28],k=e[29],_=e[30],E=e[31],C=e[32],I=e[33],O=e[34],M=e[35];let B;e[179]!==T||e[180]!==A||e[181]!==E||e[182]!==C||e[183]!==I||e[184]!==O||e[185]!==M?(B=n.jsxs(T,{children:[E,C,I,O,M,A]}),e[179]=T,e[180]=A,e[181]=E,e[182]=C,e[183]=I,e[184]=O,e[185]=M,e[186]=B):B=e[186];let J;return e[187]!==P||e[188]!==j||e[189]!==f||e[190]!==N||e[191]!==k||e[192]!==_||e[193]!==B?(J=n.jsxs(P,{open:j,onOpenChange:f,title:N,description:k,children:[_,B]}),e[187]=P,e[188]=j,e[189]=f,e[190]=N,e[191]=k,e[192]=_,e[193]=B,e[194]=J):J=e[194],J}function Ws(t){return t.type!=="connection"}function Ys(t){return t.type==="connection"}const We=new Jn(!1);function Qs(){We.set(!0)}function Xs(){We.set(!1)}function Zs(){const t=R.c(2),e=G.useSyncExternalStore(We.subscribe,We.get);let s;return t[0]!==e?(s=[e,We.set],t[0]=e,t[1]=s):s=t[1],s}const eo=300*1e3,to=2;function no(t,e,s){return!e||e===s?{version:null,count:0}:t.version===e?{version:e,count:t.count+1}:{version:e,count:1}}function so(t,e){return t.count>=to&&t.version!==null&&t.version!==e}function oo(){const t=R.c(43),e=W(),s=Wn();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={mutationFn:ao},t[0]=a):a=t[0];const o=Ye(a);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={queryKey:Ue.appVersionCheck(),queryFn:io,refetchInterval:eo,refetchIntervalInBackground:!0,staleTime:0},t[1]=i):i=t[1];const{data:r,dataUpdatedAt:u}=He(i),[m,h]=G.useState(0);let v;t[2]===Symbol.for("react.memo_cache_sentinel")?(v={version:null,count:0},t[2]=v):v=t[2];const[c,x]=G.useState(v);u!==m&&(h(u),x(B=>no(B,r,"4.414.0")));const[g,y]=G.useState(null),l=s;let d;t[3]!==s||t[4]!==o?(d=()=>window.location.reload(),t[3]=s,t[4]=o,t[5]=d):d=t[5];const p=d,b="announcements.version.refresh";if(!so(c,g))return null;let w;t[6]!==e?(w=e("announcements.version.ariaLabel"),t[6]=e,t[7]=w):w=t[7];let S;t[8]!==e?(S=e("announcements.version.dismiss"),t[8]=e,t[9]=S):S=t[9];let T;t[10]!==e?(T=e("announcements.version.eyebrow"),t[10]=e,t[11]=T):T=t[11];let P;t[12]!==e?(P=e("announcements.version.title"),t[12]=e,t[13]=P):P=t[13];const A="announcements.version.description";let j;t[14]!==e||t[15]!==A?(j=e(A),t[14]=e,t[15]=A,t[16]=j):j=t[16];let f;t[17]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(yt,{size:16}),t[17]=f):f=t[17];let N;t[18]!==c.version?(N=()=>y(c.version),t[18]=c.version,t[19]=N):N=t[19];let k;t[20]!==e?(k=e("announcements.version.currentSession",{version:"4.414.0"}),t[20]=e,t[21]=k):k=t[21];let _;t[22]!==b||t[23]!==e?(_=e(b),t[22]=b,t[23]=e,t[24]=_):_=t[24];const E=l;let C;t[25]!==E?(C=dt(E),t[25]=E,t[26]=C):C=t[26];let I;t[27]!==C?(I=n.jsx(yt,{size:14,className:C}),t[27]=C,t[28]=I):I=t[28];let O;t[29]!==p||t[30]!==l||t[31]!==_||t[32]!==I?(O=n.jsxs(F,{size:"sm",disabled:l,onClick:p,children:[_,I]}),t[29]=p,t[30]=l,t[31]=_,t[32]=I,t[33]=O):O=t[33];let M;return t[34]!==N||t[35]!==k||t[36]!==O||t[37]!==w||t[38]!==S||t[39]!==T||t[40]!==P||t[41]!==j?(M=n.jsx(Mt,{ariaLabel:w,dismissLabel:S,eyebrow:T,title:P,description:j,icon:f,tone:"system",onDismiss:N,footerLeading:k,actions:O}),t[34]=N,t[35]=k,t[36]=O,t[37]=w,t[38]=S,t[39]=T,t[40]=P,t[41]=j,t[42]=M):M=t[42],M}async function io(){const t=await fetch("/api/config",{cache:"no-store"}),{config:e}=await t.json();return e.version}async function ao(){const t=await fetch("/_local/update/restart",{method:"POST"});if(!t.ok)throw new Error(`restart failed: ${t.status}`)}function ro(t){return{has(){try{return localStorage.getItem(t)==="1"}catch{return!1}},mark(){try{localStorage.setItem(t,"1")}catch{}}}}const lo=Date.parse("2026-07-21T00:00:00Z"),Tt=t=>ro(Be.ptBrAnnouncementSeen(t));function co(){const t=R.c(35),e=W(),[s,a]=on(),{data:o,isPending:i}=Ke.useSession(),r=o?.user,u=r?.id,m=r?.createdAt,h=m!=null&&new Date(m).getTime()<lo,v=an()==="pt-BR",c=!i&&!!u&&h&&v&&s.language==="en"&&!Tt(u).has(),[x,g]=G.useState(!1),[y,l]=G.useState(!1);!x&&!i&&(g(!0),c&&u&&(Tt(u).mark(),a(mo),l(!0),ut("pt_br_auto_switch_shown")));let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=J=>{ut("pt_br_auto_switch_closed",{action:J}),l(!1)},t[0]=d):d=t[0];const p=d;let b;t[1]!==a?(b=()=>{a(uo),p("switch-back")},t[1]=a,t[2]=b):b=t[2];const w=b;let S;t[3]===Symbol.for("react.memo_cache_sentinel")?(S=J=>!J&&p("dismiss"),t[3]=S):S=t[3];let T;t[4]===Symbol.for("react.memo_cache_sentinel")?(T=n.jsx("div",{className:"text-4xl","aria-hidden":"true",children:"🇧🇷"}),t[4]=T):T=t[4];let P;t[5]!==e?(P=e("announcements.ptBr.title"),t[5]=e,t[6]=P):P=t[6];let A;t[7]!==P?(A=n.jsx($t,{children:P}),t[7]=P,t[8]=A):A=t[8];let j;t[9]!==e?(j=e("announcements.ptBr.description"),t[9]=e,t[10]=j):j=t[10];let f;t[11]!==j?(f=n.jsx($n,{children:j}),t[11]=j,t[12]=f):f=t[12];let N;t[13]!==A||t[14]!==f?(N=n.jsxs(Lt,{children:[A,f]}),t[13]=A,t[14]=f,t[15]=N):N=t[15];let k;t[16]!==e?(k=e("announcements.ptBr.switchBack"),t[16]=e,t[17]=k):k=t[17];let _;t[18]!==w||t[19]!==k?(_=n.jsx(F,{variant:"outline",onClick:w,children:k}),t[18]=w,t[19]=k,t[20]=_):_=t[20];let E;t[21]===Symbol.for("react.memo_cache_sentinel")?(E=()=>p("ok"),t[21]=E):E=t[21];let C;t[22]!==e?(C=e("announcements.ptBr.ok"),t[22]=e,t[23]=C):C=t[23];let I;t[24]!==C?(I=n.jsx(F,{onClick:E,children:C}),t[24]=C,t[25]=I):I=t[25];let O;t[26]!==_||t[27]!==I?(O=n.jsxs(Dn,{children:[_,I]}),t[26]=_,t[27]=I,t[28]=O):O=t[28];let M;t[29]!==O||t[30]!==N?(M=n.jsxs(Dt,{className:"sm:max-w-md",children:[T,N,O]}),t[29]=O,t[30]=N,t[31]=M):M=t[31];let B;return t[32]!==y||t[33]!==M?(B=n.jsx(Rt,{open:y,onOpenChange:S,children:M}),t[32]=y,t[33]=M,t[34]=B):B=t[34],B}function uo(t){return{...t,language:"en"}}function mo(t){return{...t,language:"pt-BR"}}function fo(t){const e=rn(t);return typeof e=="string"?e:void 0}function ho(){return fo("experiment-pipeline-check"),null}function go(t){const e=R.c(1),{activeOrg:s}=t;if(!s)return null;ln(s.id,{name:s.name??void 0,slug:s.slug??void 0}),cn();let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(ho,{}),e[0]=a):a=e[0],a}function po(t){const{prev:e,virtualMcpId:s,decopilotId:a,savedLayout:o,opts:i,autosendValue:r}=t,u={mainpanel:void 0};s?u.virtualmcpid=s:e.virtualmcpid&&(u.virtualmcpid=e.virtualmcpid);const m=typeof e.virtualmcpid=="string"?e.virtualmcpid:a,v=(s??m)!==m;let c,x;return i?.panel?x=i.panel:o?(x=o.tab,o.sidepanel!==void 0&&(c=o.sidepanel),o.mainpanel!==void 0&&(u.mainpanel=o.mainpanel)):!v&&e.tabId&&!dn(e.tabId)&&(x=e.tabId),c!==void 0&&(u.sidepanel=c),i?.autosend&&(u.autosend=r),{tabId:x,search:u}}const Gt="studio:thread-layout:v4",yo=50;function Jt(t){const e={};return t===null||typeof t!="object"||(typeof t.tab=="string"&&(e.tab=t.tab),typeof t.mainpanel=="boolean"&&(e.mainpanel=t.mainpanel),typeof t.sidepanel=="boolean"&&(e.sidepanel=t.sidepanel)),e}function bo(t,e,s,a=yo){const o=t.filter(([i])=>i!==e);for(o.push([e,Jt(s)]);o.length>a;)o.shift();return o}function gt(){try{const t=sessionStorage.getItem(Gt);if(!t)return[];const e=JSON.parse(t);return Array.isArray(e)?e.filter(s=>Array.isArray(s)&&s.length===2&&typeof s[0]=="string"):[]}catch{return[]}}function Vt(t){try{sessionStorage.setItem(Gt,JSON.stringify(t))}catch{}}function xo(t,e){t&&Vt(bo(gt(),t,e))}function wo(t){if(!t)return null;const e=gt().find(([s])=>s===t);return e?Jt(e[1]):null}function di(t){if(!t)return;const e=gt(),s=e.filter(([a])=>a!==t);s.length!==e.length&&Vt(s)}function Wt(t){return{queryKey:Ue.homeNextActions(t),queryFn:async()=>{const e=await fetch(`/api/${t}/home-next-actions`,{cache:"no-store"});if(!e.ok)throw new Error("Failed to load home next actions");return await e.json()},staleTime:0,refetchOnWindowFocus:"always"}}function ui(t){const e=R.c(10);let s;e[0]!==t?(s=Wt(t),e[0]=t,e[1]=s):s=e[1];const a=He(s);let o;e[2]!==a.data?.prompts?(o=a.data?.prompts??[],e[2]=a.data?.prompts,e[3]=o):o=e[3];let i;e[4]!==a.data?.tiles?(i=a.data?.tiles??[],e[4]=a.data?.tiles,e[5]=i):i=e[5];let r;return e[6]!==a.isLoading||e[7]!==o||e[8]!==i?(r={isLoading:a.isLoading,prompts:o,tiles:i},e[6]=a.isLoading,e[7]=o,e[8]=i,e[9]=r):r=e[9],r}function So(t){const e=R.c(31),{orgSlug:s,orgName:a,domain:o}=t,i=W();let r;e[0]!==s?(r=()=>{window.location.href=`/api/${encodeURIComponent(s)}/sso/authorize`},e[0]=s,e[1]=r):r=e[1];const u=r,m=vo;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Nt,{className:"h-6 w-6 text-primary"})}),e[2]=h):h=e[2];let v;e[3]!==i?(v=i("common.ssoRequiredScreen.title"),e[3]=i,e[4]=v):v=e[4];let c;e[5]!==v?(c=n.jsx("h3",{className:"text-lg font-medium",children:v}),e[5]=v,e[6]=c):c=e[6];let x;e[7]!==o||e[8]!==a||e[9]!==i?(x=a?n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:a})," ",i("common.ssoRequiredScreen.requiresSsoAuth"),o?` ${i("common.ssoRequiredScreen.via",{domain:o})}`:"","."]}):i("common.ssoRequiredScreen.orgRequiresSsoAuth"),e[7]=o,e[8]=a,e[9]=i,e[10]=x):x=e[10];let g;e[11]!==x?(g=n.jsx("p",{className:"text-sm text-muted-foreground",children:x}),e[11]=x,e[12]=g):g=e[12];let y;e[13]!==c||e[14]!==g?(y=n.jsxs("div",{className:"space-y-2",children:[c,g]}),e[13]=c,e[14]=g,e[15]=y):y=e[15];let l;e[16]!==i?(l=i("common.ssoRequiredScreen.signInWithSso"),e[16]=i,e[17]=l):l=e[17];let d;e[18]!==u||e[19]!==l?(d=n.jsx(F,{onClick:u,children:l}),e[18]=u,e[19]=l,e[20]=d):d=e[20];let p;e[21]!==i?(p=i("common.ssoRequiredScreen.goBack"),e[21]=i,e[22]=p):p=e[22];let b;e[23]!==p?(b=n.jsx(F,{variant:"ghost",onClick:m,children:p}),e[23]=p,e[24]=b):b=e[24];let w;e[25]!==b||e[26]!==d?(w=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[d,b]}),e[25]=b,e[26]=d,e[27]=w):w=e[27];let S;return e[28]!==w||e[29]!==y?(S=n.jsxs(me,{children:[h,y,w]}),e[28]=w,e[29]=y,e[30]=S):S=e[30],S}function vo(){window.location.href="/"}function jo(t){const e=R.c(27),{notice:s,orgSlug:a}=t,o=W();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:n.jsx(un,{className:"h-6 w-6 text-destructive"})}),e[0]=i):i=e[0];let r;e[1]!==s.title?(r=n.jsx("h3",{className:"text-lg font-medium",children:s.title}),e[1]=s.title,e[2]=r):r=e[2];let u;e[3]!==s.message?(u=n.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:s.message}),e[3]=s.message,e[4]=u):u=e[4];let m;e[5]!==r||e[6]!==u?(m=n.jsxs("div",{className:"space-y-2",children:[r,u]}),e[5]=r,e[6]=u,e[7]=m):m=e[7];let h;e[8]!==s.ctaLabel||e[9]!==s.ctaUrl?(h=s.ctaUrl&&s.ctaLabel?n.jsx(F,{asChild:!0,children:n.jsx("a",{href:s.ctaUrl,target:"_blank",rel:"noreferrer noopener",children:s.ctaLabel})}):null,e[8]=s.ctaLabel,e[9]=s.ctaUrl,e[10]=h):h=e[10];const v=`/${encodeURIComponent(a)}/settings/infra-billing`;let c;e[11]!==o?(c=o("common.blockedOrgScreen.goToBilling"),e[11]=o,e[12]=c):c=e[12];let x;e[13]!==v||e[14]!==c?(x=n.jsx(F,{variant:"outline",asChild:!0,children:n.jsx("a",{href:v,children:c})}),e[13]=v,e[14]=c,e[15]=x):x=e[15];let g;e[16]!==o?(g=o("common.blockedOrgScreen.switchOrg"),e[16]=o,e[17]=g):g=e[17];let y;e[18]!==g?(y=n.jsx(F,{variant:"ghost",asChild:!0,children:n.jsx("a",{href:"/",children:g})}),e[18]=g,e[19]=y):y=e[19];let l;e[20]!==y||e[21]!==h||e[22]!==x?(l=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[h,x,y]}),e[20]=y,e[21]=h,e[22]=x,e[23]=l):l=e[23];let d;return e[24]!==l||e[25]!==m?(d=n.jsxs(me,{children:[i,m,l]}),e[24]=l,e[25]=m,e[26]=d):d=e[26],d}function ko(t){const e=R.c(8);let s;e[0]!==t?(s=Ue.orgNotice(t??""),e[0]=t,e[1]=s):s=e[1];let a;e[2]!==t?(a=async()=>{const r=await fetch(`/api/${t}/notice`,{credentials:"include"});return r.ok?(await r.json()).notice??null:null},e[2]=t,e[3]=a):a=e[3];const o=!!t;let i;return e[4]!==s||e[5]!==a||e[6]!==o?(i={queryKey:s,queryFn:a,enabled:o,staleTime:6e4},e[4]=s,e[5]=a,e[6]=o,e[7]=i):i=e[7],He(i)}const To="/settings/infra-billing";function No(t){return(t.endsWith("/")?t.slice(0,-1):t).endsWith(To)}function _o(t){const e=R.c(7),{org:s,children:a}=t;let o;e[0]!==s.id||e[1]!==s.name?(o={id:s.id,organizationId:s.id,slug:"_org",name:s.name,ui:null},e[0]=s.id,e[1]=s.name,e[2]=o):o=e[2];const i=o;let r;return e[3]!==a||e[4]!==s||e[5]!==i?(r=n.jsx(xn,{org:s,project:i,children:a}),e[3]=a,e[4]=s,e[5]=i,e[6]=r):r=e[6],r}function Ao(){const t=At(),e=Vn(),{org:s}=ht(),a=mn({strict:!1}),o=It(),{openPanel:i,closePanel:r}=Ln(),u=Xn(),m=Zn(),h=es(),v=ts(),c=(l,d=!0)=>t({to:".",search:l,replace:d}),x=()=>c(l=>({...l,sidepanel:!0})),g=(l,d,p)=>{const b=!!m&&m===l;m&&!b&&xo(m,{tab:o,mainpanel:a.mainpanel,sidepanel:a.sidepanel});const w=b?null:wo(l),S=Ct(s.id).id,T=po({prev:{virtualmcpid:u,tabId:o},virtualMcpId:d,decopilotId:S,savedLayout:w,opts:p,autosendValue:Qn});return v(l,()=>T.search,{virtualMcpId:d,view:{tabId:T.tabId}})};return{openSidePanel:x,setTaskId:g,createNewTask:async(l,d,p)=>{const b=crypto.randomUUID(),w=l??h;try{await e?.create({id:b,virtual_mcp_id:w,...d?{branch:d}:{}})}catch{}g(b,w,p)},openTab:i,closeTab:r}}const Po=new Set(["/$org/","/$org/home"]);function Co(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={select:Eo},t[0]=e):e=t[0],Et(e)}function Eo(t){const e=t.matches.at(-1)?.fullPath;return e!==void 0&&Po.has(e)}function Oo(){const t=R.c(59);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org",shouldThrow:!1},t[0]=e):e=t[0];const a=fn(e)?.params.org,[o,i]=G.useState(!1),[r,u]=Zs(),m=hn(),h=Co(),v=a??"";let c;t[1]!==v?(c=Wt(v),t[1]=v,t[2]=c):c=t[2];const x=!!a&&h;let g;t[3]!==c||t[4]!==x?(g={...c,enabled:x},t[3]=c,t[4]=x,t[5]=g):g=t[5],He(g);const{data:y}=Ke.useSession(),l=y?.user?.id;let d;t[6]!==a||t[7]!==l?(d=a&&l?gn(l,a):null,t[6]=a,t[7]=l,t[8]=d):d=t[8];const p=d;let b,w;t[9]!==m?(b=()=>{const L=q=>{if(jt(q)&&q.code==="KeyK"){q.preventDefault(),Qs();return}if(q.key==="?"&&!Bs(q.target)){q.preventDefault(),i(!0);return}jt(q)&&q.code==="BracketLeft"&&m.history.canGoBack()&&(q.preventDefault(),m.history.back())};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},w=[m],t[9]=m,t[10]=b,t[11]=w):(b=t[10],w=t[11]),G.useEffect(b,w);let S;t[12]!==a?(S=Ue.activeOrganization(a),t[12]=a,t[13]=S):S=t[13];let T;t[14]!==a||t[15]!==l?(T=async()=>{if(!a)return null;performance.mark("mesh:active-org-fetch:start");const{data:L}=await Ke.organization.getFullOrganization({query:{organizationSlug:a}}).finally(Lo),q=lt(L);return L&&!q&&localStorage.setItem(Be.lastOrgSlug(),a),l&&L&&yn(l,a,L),L},t[14]=a,t[15]=l,t[16]=T):T=t[16];const P=p?p.data:void 0,A=p?.updatedAt;let j;t[17]!==P||t[18]!==A||t[19]!==S||t[20]!==T?(j={queryKey:S,queryFn:T,initialData:P,initialDataUpdatedAt:A,gcTime:1/0,refetchOnWindowFocus:!1},t[17]=P,t[18]=A,t[19]=S,t[20]=T,t[21]=j):j=t[21];const{data:f}=_t(j),N=f?.id,k=f?.slug,{data:_}=ns(N,k),E=!!_?.ssoRequired&&!_.authenticated,{data:C}=ko(k);let I;t[22]===Symbol.for("react.memo_cache_sentinel")?(I={select:Io},t[22]=I):I=t[22];const O=Et(I),M=C?.severity==="block"&&!No(O),B=N??"",J=k??"";let z;t[23]!==B||t[24]!==J?(z=Gn({connectionId:Pt,orgId:B,orgSlug:J}),t[23]=B,t[24]=J,t[25]=z):z=t[25];const Y=!!N&&!!k;let ne;if(t[26]!==z||t[27]!==Y?(ne={...z,enabled:Y},t[26]=z,t[27]=Y,t[28]=ne):ne=t[28],He(ne),(!f||lt(f)||E||M)&&Xs(),!f){let L;return t[29]!==a?(L=n.jsx(fs,{orgSlug:a}),t[29]=a,t[30]=L):L=t[30],L}if(lt(f)){localStorage.getItem(Be.lastOrgSlug())===a&&localStorage.removeItem(Be.lastOrgSlug());let L;return t[31]!==f.name?(L=n.jsx(pn,{orgName:f.name}),t[31]=f.name,t[32]=L):L=t[32],L}if(M&&C){let L;return t[33]!==f.slug||t[34]!==C?(L=n.jsx(jo,{notice:C,orgSlug:f.slug}),t[33]=f.slug,t[34]=C,t[35]=L):L=t[35],L}if(E){let L;return t[36]!==f.id||t[37]!==f.name||t[38]!==f.slug||t[39]!==_.domain?(L=n.jsx(So,{orgId:f.id,orgSlug:f.slug,orgName:f.name,domain:_.domain}),t[36]=f.id,t[37]=f.name,t[38]=f.slug,t[39]=_.domain,t[40]=L):L=t[40],L}const ee=f.logo??null;let Q;t[41]!==f||t[42]!==ee?(Q={...f,logo:ee},t[41]=f,t[42]=ee,t[43]=Q):Q=t[43];let K;t[44]!==f?(K=n.jsx(go,{activeOrg:f}),t[44]=f,t[45]=K):K=t[45];let X;t[46]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(bn,{}),t[46]=X):X=t[46];let se;t[47]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsxs("div",{className:"fixed bottom-6 right-6 z-50 flex w-[min(360px,calc(100vw-3rem))] flex-col gap-3",children:[n.jsx(Fs,{}),n.jsx(oo,{})]}),t[47]=se):se=t[47];let H;t[48]!==r||t[49]!==u?(H=r&&n.jsx(Vs,{open:r,onOpenChange:u}),t[48]=r,t[49]=u,t[50]=H):H=t[50];let U;t[51]!==o?(U=n.jsx(Ks,{open:o,onOpenChange:i}),t[51]=o,t[52]=U):U=t[52];let oe;t[53]===Symbol.for("react.memo_cache_sentinel")?(oe=n.jsx(co,{}),t[53]=oe):oe=t[53];let Z;return t[54]!==Q||t[55]!==K||t[56]!==H||t[57]!==U?(Z=n.jsxs(_o,{org:Q,children:[K,X,se,H,U,oe]}),t[54]=Q,t[55]=K,t[56]=H,t[57]=U,t[58]=Z):Z=t[58],Z}function Io(t){return t.location.pathname}function Lo(){performance.mark("mesh:active-org-fetch:end"),performance.measure("mesh:active-org-fetch","mesh:active-org-fetch:start","mesh:active-org-fetch:end")}function $o(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Yn,{children:n.jsx(Oo,{})}),t[0]=e):e=t[0],e}const mi=Object.freeze(Object.defineProperty({__proto__:null,default:$o,usePanelActions:Ao},Symbol.toStringTag,{value:"Module"}));export{V as K,hs as L,Ao as a,Os as b,jt as c,ks as d,ui as e,di as f,mi as g,qt as i,Qs as o,li as r,ci as s,ko as u};
|