decocms 4.363.0 → 4.363.1
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-Df7Uu4Sr.js → AlertCircle-CgERhdh6.js} +1 -1
- package/dist/client/assets/{AreaChart-BRLjJaJt.js → AreaChart-kU4sTinA.js} +2 -2
- package/dist/client/assets/{ArrowLeft-Ce4LVTaQ.js → ArrowLeft-BVx6AQzq.js} +1 -1
- package/dist/client/assets/{ArrowRight-CuO69upc.js → ArrowRight-DZQert3q.js} +1 -1
- package/dist/client/assets/{ArrowUp-DmWBbOjK.js → ArrowUp-lpfNBlP2.js} +1 -1
- package/dist/client/assets/{Check-C1wq38_E.js → Check-DClZtAIP.js} +1 -1
- package/dist/client/assets/{CheckCircle-DWvslkKl.js → CheckCircle-BGqFZ8sM.js} +1 -1
- package/dist/client/assets/{ChevronRight-B76sbAXC.js → ChevronRight-BNfU55ld.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-C4wJ3zDR.js → ChevronSelectorVertical-ilm76_0p.js} +1 -1
- package/dist/client/assets/{ChevronUp-B0KEDz5f.js → ChevronUp-CbF1Gmeo.js} +1 -1
- package/dist/client/assets/{Copy01-rsN5AnPv.js → Copy01-DiITYBuR.js} +1 -1
- package/dist/client/assets/{CreditCard01-Cqs_Biv7.js → CreditCard01-Zpy-4Wu9.js} +1 -1
- package/dist/client/assets/Database01-zcGUPFsG.js +1 -0
- package/dist/client/assets/{DotsVertical-CBmzJDPB.js → DotsVertical-LmkOTjL4.js} +1 -1
- package/dist/client/assets/{Download01-zZEPtQ0U.js → Download01-C4blLpML.js} +1 -1
- package/dist/client/assets/ErrorBarContext-KbkdtIBU.js +1 -0
- package/dist/client/assets/{Eye-DFgd5114.js → Eye-Cd7v-liN.js} +1 -1
- package/dist/client/assets/File02-CceuR6rF.js +1 -0
- package/dist/client/assets/{GitBranch01-B7iymaqC.js → GitBranch01-Dil6c2wv.js} +1 -1
- package/dist/client/assets/{Globe01-Df6dZmsR.js → Globe01-BVji6jXS.js} +1 -1
- package/dist/client/assets/{HardDrive-CiahcooN.js → HardDrive-B4UY5qYp.js} +1 -1
- package/dist/client/assets/{Image01-CMpSR3RQ.js → Image01-CpXdMb8x.js} +1 -1
- package/dist/client/assets/{Key01-t3bX5YI3.js → Key01-BsAAVoJx.js} +1 -1
- package/dist/client/assets/{Link01-pX5C3rEv.js → Link01-OqB-2yPE.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CzRiacvQ.js → LinkExternal01-DobnLseV.js} +1 -1
- package/dist/client/assets/{Monitor01-jzbehxNG.js → Monitor01-BTqHf-K4.js} +1 -1
- package/dist/client/assets/{Package-CiAH049d.js → Package-CCkk0w5h.js} +1 -1
- package/dist/client/assets/{Palette-CmMvG40G.js → Palette-BBWt8owf.js} +1 -1
- package/dist/client/assets/{Play-k9_JCuZW.js → Play-CPeIBqH_.js} +1 -1
- package/dist/client/assets/{Plus-Bac7Bl-V.js → Plus-DaErdsG1.js} +1 -1
- package/dist/client/assets/Printer-BG6NfeSZ.js +1 -0
- package/dist/client/assets/{SearchLg-iYej-M-S.js → SearchLg-DxQfk550.js} +1 -1
- package/dist/client/assets/{SearchMd-hxPQERkg.js → SearchMd-BNXjQ2BV.js} +1 -1
- package/dist/client/assets/Sector-D2wxgDkd.js +28 -0
- package/dist/client/assets/{Settings02-t15FjJbr.js → Settings02-DL8f5fN1.js} +1 -1
- package/dist/client/assets/{Share07-CJrTonmW.js → Share07-D1Sv14jA.js} +1 -1
- package/dist/client/assets/{Shield01-DS-tpugO.js → Shield01-BsobIEfQ.js} +1 -1
- package/dist/client/assets/{Stars01-ByE0-f1z.js → Stars01-f37Q7vDf.js} +1 -1
- package/dist/client/assets/{Sun-vdviKSpi.js → Sun-DjKz3VjB.js} +1 -1
- package/dist/client/assets/{XClose-DvenHyNp.js → SwitchHorizontal01-BIyO34Jw.js} +1 -1
- package/dist/client/assets/{Tool01-CmpQe3MS.js → Tool01-D6HOM_aJ.js} +1 -1
- package/dist/client/assets/{Tool02-BAA6OFl0.js → Tool02-BrfQeZRx.js} +1 -1
- package/dist/client/assets/{Trash01-C6vCLvEw.js → Trash01-DQjprOwc.js} +1 -1
- package/dist/client/assets/{TrendUp01-fHRYAiew.js → TrendUp01-DIz6JZwT.js} +1 -1
- package/dist/client/assets/{Upload01-lE597uPz.js → Upload01-BDeLrRhf.js} +1 -1
- package/dist/client/assets/{User01-BPodfm7s.js → User01-B8a5ssx2.js} +1 -1
- package/dist/client/assets/{UserSquare-CXhk4rLY.js → UserSquare-yIpHwPSn.js} +1 -1
- package/dist/client/assets/{Users01-Dgbd4CM_.js → Users01-BCRhQsCX.js} +1 -1
- package/dist/client/assets/{Users03-B4Km0_9u.js → Users03-DWh3D2_T.js} +1 -1
- package/dist/client/assets/{XCircle-BK1898xU.js → XCircle-DudPVYQR.js} +1 -1
- package/dist/client/assets/XClose-DpDcHm9Y.js +1 -0
- package/dist/client/assets/{Zap-nPZGKdXf.js → Zap-C5eiFR0N.js} +1 -1
- package/dist/client/assets/ZoomOut-DdupjPFF.js +1 -0
- package/dist/client/assets/access-gate-Dnh0JyKy.js +1 -0
- package/dist/client/assets/add-connection-dialog-BSihy3_s.js +1 -0
- package/dist/client/assets/agent-analytics-C1OAYjbt.js +2 -0
- package/dist/client/assets/agent-app-62cavSHy.js +1 -0
- package/dist/client/assets/agent-assets-vYQq8qui.js +1 -0
- package/dist/client/assets/agent-automation-BPNX454_.js +20 -0
- package/dist/client/assets/agent-automations-BLOXID0N.js +1 -0
- package/dist/client/assets/agent-connect-sources-BzEccd4r.js +1 -0
- package/dist/client/assets/agent-deck-DVW32bsA.js +1 -0
- package/dist/client/assets/agent-e2e-DM8adI3E.js +1 -0
- package/dist/client/assets/agent-file-C7nywZCe.js +1 -0
- package/dist/client/assets/agent-git-DarQSTRH.js +3 -0
- package/dist/client/assets/agent-hosting-Dnr2S-TT.js +1 -0
- package/dist/client/assets/agent-icon-vDfwuZu4.js +1 -0
- package/dist/client/assets/agent-library-file-D4p-8dXS.js +1 -0
- package/dist/client/assets/agent-monitor-DpaaBIhL.js +1 -0
- package/dist/client/assets/agent-overview-D9IrP622.js +1 -0
- package/dist/client/assets/agent-settings-CxGAsqqN.js +1 -0
- package/dist/client/assets/agent-site-editor-DTFbZmEY.js +1 -0
- package/dist/client/assets/agent-site-editor-code-Dcgjtfwk.js +2 -0
- package/dist/client/assets/agent-site-editor-content-BE26aik7.js +2 -0
- package/dist/client/assets/agent-site-editor-preview-ki_D8wtP.js +504 -0
- package/dist/client/assets/agent-view-DYYYDEW_.js +1 -0
- package/dist/client/assets/agent-view-guard-DomQyuot.js +1 -0
- package/dist/client/assets/agents-list-B0vnsITA.js +1 -0
- package/dist/client/assets/ai-providers-CxaMjUP7.js +1 -0
- package/dist/client/assets/{alert-D8igu3TO.js → alert-DcFgIKLk.js} +1 -1
- package/dist/client/assets/{alert-dialog-CFCsKBpN.js → alert-dialog-CiKfgw9r.js} +2 -2
- package/dist/client/assets/{api-keys-BIjM5sVA.js → api-keys-CEPWE1iS.js} +1 -1
- package/dist/client/assets/api-keys-DoGNEUpY.js +1 -0
- package/dist/client/assets/app-editor-CRjlYU-M.js +1 -0
- package/dist/client/assets/asset-utils-DJXdpjr9.js +1 -0
- package/dist/client/assets/{auth-catchall-E5QBtigN.js → auth-catchall-DV5KEwZ2.js} +1 -1
- package/dist/client/assets/{auth-entry-C91RF11H.js → auth-entry-Fe8qT_kq.js} +1 -1
- package/dist/client/assets/{auth-DeD0YpKg.js → auth-ksbj4Esa.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BFF9n_Qv.js → auth-split-layout-CFJK_BXW.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-6UYdTwrd.js → authenticate-and-persist-oauth-DMvGjBUE.js} +1 -1
- package/dist/client/assets/{automation-list-row-Ba1cMA4W.js → automation-list-row-CkrObNhq.js} +1 -1
- package/dist/client/assets/automation-runs-C-5kRp10.js +1 -0
- package/dist/client/assets/automations-CKhgbURI.js +1 -0
- package/dist/client/assets/{autosend-DI1ZpOT0.js → autosend-BzUVLyEq.js} +1 -1
- package/dist/client/assets/{avatar-CfO1mReu.js → avatar-CW4PxBuN.js} +1 -1
- package/dist/client/assets/{badge-GP_pc1i_.js → badge-C5Ilvf_J.js} +1 -1
- package/dist/client/assets/{block-document-B_vPvGLi.js → block-document-Zfk-C1Kp.js} +3 -3
- package/dist/client/assets/breadcrumb-BajFgW5V.js +1 -0
- package/dist/client/assets/{buckets-BeX-azQt.js → buckets-CyNocIPE.js} +1 -1
- package/dist/client/assets/build-improve-prompt-doc-BrRLOIlw.js +2 -0
- package/dist/client/assets/bulk-category-panel-e217-dmm.js +1 -0
- package/dist/client/assets/calendar-DGiOuDgZ.js +1 -0
- package/dist/client/assets/{capability-load-error-BoR9RbMs.js → capability-load-error-DFv8gs5U.js} +1 -1
- package/dist/client/assets/{cards-m7YgOjsz.js → cards-XHNjVWeh.js} +3 -3
- package/dist/client/assets/category-editor-zLRtagcy.js +1 -0
- package/dist/client/assets/{chart-BanyRqbL.js → chart-C7CmtzOp.js} +2 -2
- package/dist/client/assets/chat-context-HB_KOUNM.js +35 -0
- package/dist/client/assets/{checkbox-ZsR1Bced.js → checkbox-Dg_GkeBT.js} +1 -1
- package/dist/client/assets/choose-editor-DO1mGCL1.js +1 -0
- package/dist/client/assets/{cli-auth-success-sB1yOlRg.js → cli-auth-success-e-RADpiN.js} +1 -1
- package/dist/client/assets/{client-icons-DHLFDmNu.js → client-icons-tt6oaVA2.js} +1 -1
- package/dist/client/assets/collapsible-CycyYnXe.js +1 -0
- package/dist/client/assets/collection-detail-DhtfN_Wl.js +1 -0
- package/dist/client/assets/collection-display-button-BRbx9UhH.js +1 -0
- package/dist/client/assets/{collection-search-7NUVJQfN.js → collection-search-j4HjYlys.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D0kCJcbB.js → collection-table-wrapper-0LZ9BKlr.js} +1 -1
- package/dist/client/assets/{collection-tabs-MvaIz7gt.js → collection-tabs-Bc9QOlJ8.js} +1 -1
- package/dist/client/assets/{command-CF7nzIN2.js → command-BpjWfGyr.js} +1 -1
- package/dist/client/assets/command-palette-store-D19nXDNm.js +1 -0
- package/dist/client/assets/commerce-onboarding-CdG4FfWS.js +1 -0
- package/dist/client/assets/companion-mcps-section-CVcicsr9.js +1 -0
- package/dist/client/assets/companions-core-CZwGf1b1.js +1 -0
- package/dist/client/assets/{connect-G-ytX-wq.js → connect-COU6F3Do.js} +2 -2
- package/dist/client/assets/connect-layout-Bl-ol5HH.js +1 -0
- package/dist/client/assets/{connection-D885aDuM.js → connection-By77bjvj.js} +1 -1
- package/dist/client/assets/{connection-card-Nc1w-XCq.js → connection-card-Br8jDKgZ.js} +1 -1
- package/dist/client/assets/connection-detail-vVdPGlxv.js +1 -0
- package/dist/client/assets/{connection-form-helpers-B4IwDJJQ.js → connection-form-helpers-CFXh6BoJ.js} +1 -1
- package/dist/client/assets/connections-BBNFmXEe.js +1 -0
- package/dist/client/assets/content-blocks-o63cs2vh.js +1 -0
- package/dist/client/assets/{create-organization-dialog-gO5G25gp.js → create-organization-dialog-CRl8hry2.js} +1 -1
- package/dist/client/assets/decode-html-entities-Cf7wUEql.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-Bm_3HC4t.js → decopilot-sse-pool-D2Qtyl-A.js} +1 -1
- package/dist/client/assets/{dialog-CyDGwxcX.js → dialog-DJBpjJnY.js} +1 -1
- package/dist/client/assets/discover-y7BsppSE.js +1 -0
- package/dist/client/assets/{domain-settings-Cx6UibuZ.js → domain-settings-B_cuGCF0.js} +1 -1
- package/dist/client/assets/download-app-dialog-DYhv8XsJ.js +1 -0
- package/dist/client/assets/{drawer-CqSEztKC.js → drawer-B5NRhNfW.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CgwRqOnX.js → dropdown-menu-DzwCPltk.js} +1 -1
- package/dist/client/assets/{editor-D7S6MtwI.js → editor-BHnwprUT.js} +1 -1
- package/dist/client/assets/{empty-state-SN5mEPhX.js → empty-state-CJ95hR0w.js} +1 -1
- package/dist/client/assets/{empty-state-DfBha5W6.js → empty-state-CXolWOTn.js} +1 -1
- package/dist/client/assets/extract-connection-data-B1nPGa4h.js +1 -0
- package/dist/client/assets/{file-explorer-paPAvOUA.js → file-explorer-Dj1zqDxa.js} +2 -2
- package/dist/client/assets/file-preview-kRDXQYfi.js +1 -0
- package/dist/client/assets/file-share-button-P5GnoZYM.js +3 -0
- package/dist/client/assets/{file-type-icon--TvA6C0i.js → file-type-icon-Cg81au_Z.js} +1 -1
- package/dist/client/assets/folder-icon-Bey_C_xd.js +2 -0
- package/dist/client/assets/{form-BnUN8JhF.js → form-EGCuUtdG.js} +1 -1
- package/dist/client/assets/{general-DhiseHhA.js → general-BJ_Ksgnn.js} +1 -1
- package/dist/client/assets/github-D4UJ99TO.js +1 -0
- package/dist/client/assets/{github-icon-7BmoW2Y2.js → github-icon-CiNkodR8.js} +1 -1
- package/dist/client/assets/{github-repo-CTPv5ZM2.js → github-repo-C0igpkr9.js} +1 -1
- package/dist/client/assets/github-repo-scope-C8GSbvaz.js +1 -0
- package/dist/client/assets/home-Cmddezu3.js +1 -0
- package/dist/client/assets/{hooks-Bv30myGB.js → hooks-BSkeWBV7.js} +2 -2
- package/dist/client/assets/hooks-Bb9SArul.js +2 -0
- package/dist/client/assets/{index-y6Z5iMfg.js → index-6GXqHE0w.js} +42 -42
- package/dist/client/assets/{index-C2fs5Fhc.js → index-9FQARZdh.js} +1 -1
- package/dist/client/assets/index-B7ENeoW4.js +4 -0
- package/dist/client/assets/index-B9bOVdMd.js +90 -0
- package/dist/client/assets/index-BVRQ9yUZ.js +1 -0
- package/dist/client/assets/index-BaItIL-_.js +1 -0
- package/dist/client/assets/index-CUa7fAjf.js +24 -0
- package/dist/client/assets/index-CY40-aHW.js +1 -0
- package/dist/client/assets/{index-CnV8Y6tV.js → index-Cu77hgR2.js} +1 -1
- package/dist/client/assets/index-DCQ3taiG.js +1 -0
- package/dist/client/assets/{index-DD_a39Sy.js → index-Dg14Zpi9.js} +2 -2
- package/dist/client/assets/{index-B_j4TgZF.js → index-cEqwHhEg.js} +1 -1
- package/dist/client/assets/{index-Cf5RfBo5.js → index-hC6VOnUm.js} +2 -2
- package/dist/client/assets/index-qEipD_7S.js +1 -0
- package/dist/client/assets/index-redirect-BRL1uQPT.js +1 -0
- package/dist/client/assets/{infiniteQueryObserver-CvFtTJPb.js → infiniteQueryObserver-C7FrFXuf.js} +1 -1
- package/dist/client/assets/infra-billing-B0e93_qz.js +1 -0
- package/dist/client/assets/input-BRqLi1TH.js +8 -0
- package/dist/client/assets/input-D8xrvlz-.js +1 -0
- package/dist/client/assets/{input-DRjCNSPN.js → input-TvernbmY.js} +1 -1
- package/dist/client/assets/{integration-icon-CFGOsRgH.js → integration-icon-B6H5J7sl.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-qtYgFNfF.js → invite-member-dialog-CsolElt3.js} +1 -1
- package/dist/client/assets/{label-DGsSvY2I.js → label-aWEsDmHM.js} +1 -1
- package/dist/client/assets/{layout-C7iOarOb.js → layout-CAwe_kK2.js} +1 -1
- package/dist/client/assets/legacy-agents-deep-DJ_t0QLc.js +1 -0
- package/dist/client/assets/legacy-main-redirect-CySqEohs.js +1 -0
- package/dist/client/assets/library-DRmbr8Ht.js +161 -0
- package/dist/client/assets/{login-B4RHcX-Z.js → login-DQDbHhI7.js} +1 -1
- package/dist/client/assets/{markdown-Y6owwpHy.js → markdown-CBvmi8AF.js} +30 -30
- package/dist/client/assets/match-site-slug-config-D3fUJ6vX.js +1 -0
- package/dist/client/assets/{mcp-app-renderer-Cy31bAY0.js → mcp-app-renderer-BQ7hPzlx.js} +2 -2
- package/dist/client/assets/{mcp-oauth-Bm9ijvfC.js → mcp-oauth-DhRKpyTH.js} +1 -1
- package/dist/client/assets/members-NHaXKGgP.js +1 -0
- package/dist/client/assets/mini-report-page-BcG9QHwQ.js +1 -0
- package/dist/client/assets/monaco-editor-C5zvkMO4.js +9 -0
- package/dist/client/assets/monitoring-stats-row-CWqusnLf.js +1 -0
- package/dist/client/assets/{multi-select-kzt94BG4.js → multi-select-CvACpZbb.js} +1 -1
- package/dist/client/assets/mustache-DQXz9E52.js +4 -0
- package/dist/client/assets/{oauth-callback-CsYpPVhX.js → oauth-callback-BHJTnNxG.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CkroR0wl.js → oauth-callback-ai-provider-wF0_7wc5.js} +1 -1
- package/dist/client/assets/omit-sandbox-map-jj4lCB2U.js +1 -0
- package/dist/client/assets/{onboarding-DN_VeGxV.js → onboarding-20FUHLvO.js} +1 -1
- package/dist/client/assets/optimistic-project-sidebar-views-DKtRXqQ0.js +1 -0
- package/dist/client/assets/org-layout-DRrVivAL.js +1 -0
- package/dist/client/assets/{organization-choice-Bugd-m5W.js → organization-choice-BmSYuBSE.js} +1 -1
- package/dist/client/assets/{orgs-Bv7LuXwC.js → orgs-1ZlqeM-y.js} +1 -1
- package/dist/client/assets/page-seo-form-Cpi2Oike.js +1 -0
- package/dist/client/assets/pair-CD8Vxcvs.js +47 -0
- package/dist/client/assets/{popover-DrJcYe9C.js → popover-Ci-k968-.js} +1 -1
- package/dist/client/assets/post-calendar-CgTLYrrU.js +1 -0
- package/dist/client/assets/post-editor-DyayPm7u.js +1 -0
- package/dist/client/assets/preview-content-DhEgigNG.js +1 -0
- package/dist/client/assets/preview-dialog-CKWnRekk.js +1 -0
- package/dist/client/assets/primitives-1lR28duD.js +1 -0
- package/dist/client/assets/{profile-Bs-irLLH.js → profile-DixSbE4L.js} +1 -1
- package/dist/client/assets/project-app-view-DBHiU3Rg.js +1 -0
- package/dist/client/assets/project-feed-boKgu_TR.js +1 -0
- package/dist/client/assets/project-icon-DIXBuD-A.js +1 -0
- package/dist/client/assets/project-reports-ChLta7_v.js +1 -0
- package/dist/client/assets/project-tasks-nUWazd1g.js +1 -0
- package/dist/client/assets/{prompts-wjQ-EFKj.js → prompts-BROxvafI.js} +1 -1
- package/dist/client/assets/provision-repo-scoped-github-connection-B6zdkC6p.js +1 -0
- package/dist/client/assets/record-editor-FqHaN2k4.js +1 -0
- package/dist/client/assets/redirect-editor-CWYZom_C.js +1 -0
- package/dist/client/assets/registry-C3_EEMj-.js +2 -0
- package/dist/client/assets/{registry-layout-DHYm94rU.js → registry-layout-BUEF9YqP.js} +4 -4
- package/dist/client/assets/{reports-D4elpaqK.js → reports-B1C9NU2m.js} +1 -1
- package/dist/client/assets/reports-BY7Ca1Ey.js +1 -0
- package/dist/client/assets/reports-tab-uLMivl2p.js +2 -0
- package/dist/client/assets/{repositories-3ia_V4sE.js → repositories-BgD13VwL.js} +1 -1
- package/dist/client/assets/repository-import-picker-DVnadPZ8.js +1 -0
- package/dist/client/assets/{repository-picker-s01uE4_E.js → repository-picker-BGpoa_g_.js} +1 -1
- package/dist/client/assets/require-capability-DSFKKTc-.js +1 -0
- package/dist/client/assets/{required-auth-layout-mSUodrzA.js → required-auth-layout-DMNBbcf3.js} +1 -1
- package/dist/client/assets/{reset-password-B_-cD_PK.js → reset-password-GCDcBOjo.js} +1 -1
- package/dist/client/assets/review-settings-VwYzzjCc.js +1 -0
- package/dist/client/assets/rich-text-link-control-C6A8Q9Jd.js +5 -0
- package/dist/client/assets/roles-PgEO9KN-.js +1 -0
- package/dist/client/assets/runnable-block-editor-Db2XbJYi.js +16 -0
- package/dist/client/assets/sandbox-lifecycle-context-DxbfUbxP.js +2 -0
- package/dist/client/assets/sandbox-url-D3mC8qhT.js +1 -0
- package/dist/client/assets/{schema-BDy_4D7A.js → schema-Cnskrzk1.js} +1 -1
- package/dist/client/assets/{scroll-area-C18Y2v3L.js → scroll-area-CaE3a4_T.js} +1 -1
- package/dist/client/assets/{search-input-L0lrukmF.js → search-input-lFP9sD3O.js} +1 -1
- package/dist/client/assets/{secrets-CdpkfmHa.js → secrets-BU_daRxy.js} +1 -1
- package/dist/client/assets/sections-editor-D-W8vM7g.js +2 -0
- package/dist/client/assets/{select-BGnwGqnU.js → select-Ce9NznPv.js} +1 -1
- package/dist/client/assets/select-model-CjTijsS7.js +1 -0
- package/dist/client/assets/self-tool-result-8OxPN9Nm.js +1 -0
- package/dist/client/assets/seo-editor-O94He1NF.js +1 -0
- package/dist/client/assets/serial-task-queue-CGOeQgpr.js +1 -0
- package/dist/client/assets/settings-layout-CWQI71Tg.js +1 -0
- package/dist/client/assets/settings-sidebar-BcAe-WS4.js +1 -0
- package/dist/client/assets/settings-tab-Cg5CqTki.js +5 -0
- package/dist/client/assets/shell-controls-gkZZS07l.js +1 -0
- package/dist/client/assets/shell-layout-C3IRibnI.js +1 -0
- package/dist/client/assets/site-url-en5df9c-.js +1 -0
- package/dist/client/assets/skill-preview-MIddvDZe.js +1 -0
- package/dist/client/assets/skills-hRnVKZ5K.js +1 -0
- package/dist/client/assets/{sso-CVpMpJ2m.js → sso-BePH_NId.js} +1 -1
- package/dist/client/assets/store-CqeIEwHN.js +1 -0
- package/dist/client/assets/store-registry-BCokMLik.js +2 -0
- package/dist/client/assets/switch-D5GcuD9Z.js +1 -0
- package/dist/client/assets/synced-repos-Cnp4m7yg.js +1 -0
- package/dist/client/assets/{table-DSIbUmyY.js → table-O0SpY8ZO.js} +1 -1
- package/dist/client/assets/{tabs-BVFMEVzk.js → tabs-DQoXHeZr.js} +1 -1
- package/dist/client/assets/{task-board-By8eCqZc.js → task-board-DyZE7mH1.js} +1 -1
- package/dist/client/assets/task-route-CayeX6cv.js +1 -0
- package/dist/client/assets/task-status-CyTozLxL.js +1 -0
- package/dist/client/assets/tasks-DGTMeQBa.js +1 -0
- package/dist/client/assets/{tasks-kFCSziTb.js → tasks-Da-h-zLm.js} +1 -1
- package/dist/client/assets/{textarea-CuF3aDTE.js → textarea-BpFOmm9_.js} +1 -1
- package/dist/client/assets/{thread-intent-q_RVjRN0.js → thread-intent-AJKohiRy.js} +1 -1
- package/dist/client/assets/thread-route-CEvVLI2K.js +1 -0
- package/dist/client/assets/thread-sheet-body-Bs4b4fMK.js +1 -0
- package/dist/client/assets/toggle-group-Cs1yIHkK.js +1 -0
- package/dist/client/assets/tool-namespace-ySa3S1AM.js +1 -0
- package/dist/client/assets/{toolbar-B5cewwJb.js → toolbar-DOOz2W24.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BtBUZ8nA.js → toolbar-icon-button-Dp-AbzNZ.js} +1 -1
- package/dist/client/assets/{track-BYunSel2.js → track-Dns1NpdC.js} +1 -1
- package/dist/client/assets/{types-BB_Up-3A.js → types-C1gRrnQe.js} +6 -6
- package/dist/client/assets/usage-stats-D5mXC24B.js +141 -0
- package/dist/client/assets/{use-ai-providers-BMexfNaB.js → use-ai-providers-Bg_y9f3x.js} +1 -1
- package/dist/client/assets/{use-automations-BgzAjzua.js → use-automations-BI_yIok-.js} +1 -1
- package/dist/client/assets/{use-autosave-D70NA0HD.js → use-autosave-BB0U2eiK.js} +1 -1
- package/dist/client/assets/use-commerce-diagnostic-DqKipeip.js +1 -0
- package/dist/client/assets/use-connect-companion-Mci4Y6hu.js +1 -0
- package/dist/client/assets/{use-connection-ClORxmw4.js → use-connection-DCUpGmsb.js} +1 -1
- package/dist/client/assets/{use-copy-DUxpBqXm.js → use-copy-GVBAvo9n.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DBeldBRq.js → use-create-virtual-mcp-CizXpVyQ.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-40K6SzJD.js → use-date-fns-locale-CcPpBz8y.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-kf66WQZj.js → use-debounced-autosave-wCEzYUZh.js} +1 -1
- package/dist/client/assets/{use-debounced-value-v41IOreQ.js → use-debounced-value-D0SYNQsR.js} +1 -1
- package/dist/client/assets/use-deco-credits-DjxZxHMq.js +1 -0
- package/dist/client/assets/{use-decopilot-events-C0NWoSQc.js → use-decopilot-events-zpeu2MCG.js} +1 -1
- package/dist/client/assets/{use-delete-connection-qmqqgsKa.js → use-delete-connection-B-DNpbCU.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-C7c9x0vv.js → use-deployment-admin-Dpkh4HgH.js} +1 -1
- package/dist/client/assets/{use-file-configs-Dm3fOdMk.js → use-file-configs-B1FdrMZJ.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Bw5rNIGx.js → use-infinite-scroll-BXOEU8Y7.js} +1 -1
- package/dist/client/assets/{use-join-requests-DbtrL0Pl.js → use-join-requests-1Ow065Yq.js} +1 -1
- package/dist/client/assets/use-main-panel-tabs-CeyJWpQP.js +1 -0
- package/dist/client/assets/{use-mcp-auth-status-kHe3lJRg.js → use-mcp-auth-status-CSQiZCDG.js} +1 -1
- package/dist/client/assets/use-mcp-client-Bq-mjhw3.js +10 -0
- package/dist/client/assets/{use-mcp-prompts-CtjkJFfg.js → use-mcp-prompts-CWmeNLXn.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DRBItGTD.js → use-mcp-tools-DGdyHn8U.js} +1 -1
- package/dist/client/assets/{use-members-C23rfxcZ.js → use-members-Dnee1tF2.js} +1 -1
- package/dist/client/assets/use-navigate-to-agent-Drdqs1cr.js +1 -0
- package/dist/client/assets/use-open-billing-url-Cju1isPI.js +1 -0
- package/dist/client/assets/{use-org-auth-client-DvlpnDFO.js → use-org-auth-client-CVFBkaiI.js} +1 -1
- package/dist/client/assets/use-org-fs-DG1oJieK.js +1 -0
- package/dist/client/assets/{use-org-notice-DlsdC1WA.js → use-org-notice-PUfO84YR.js} +1 -1
- package/dist/client/assets/{use-org-sso-xd-5IiLc.js → use-org-sso-uleG21Aq.js} +1 -1
- package/dist/client/assets/{use-organization-roles-B3neE_6D.js → use-organization-roles-yO3kgQbK.js} +1 -1
- package/dist/client/assets/use-organization-settings-DrJN-E78.js +1 -0
- package/dist/client/assets/use-panel-navigate-CCqZdv2O.js +1 -0
- package/dist/client/assets/use-project-native-view-presence-01L5j4lu.js +1 -0
- package/dist/client/assets/use-project-scope-DZ9tacAx.js +1 -0
- package/dist/client/assets/use-registry-connections-cro5WL6A.js +1 -0
- package/dist/client/assets/{use-secrets-PkTonlJ_.js → use-secrets-w6G8jtp4.js} +1 -1
- package/dist/client/assets/use-section-preview-base-lro_p1nx.js +1 -0
- package/dist/client/assets/use-session-runtime-TS34dEJv.js +1 -0
- package/dist/client/assets/{use-status-sounds-C-6LEj0t.js → use-status-sounds-DQ2pMmh0.js} +1 -1
- package/dist/client/assets/{use-tags-BuxETA7b.js → use-tags-B6zE47mm.js} +1 -1
- package/dist/client/assets/use-task-metadata-C4MfiHBQ.js +1 -0
- package/dist/client/assets/use-thread-outputs-CpCqTMOi.js +1 -0
- package/dist/client/assets/{use-view-mode-BGsTNFK8.js → use-view-mode-B9wUn2ad.js} +1 -1
- package/dist/client/assets/use-virtual-mcp-CMlCV8Oj.js +1 -0
- package/dist/client/assets/useInfiniteQuery-CM35R0yt.js +1 -0
- package/dist/client/assets/useQueries-C6OAJOs7.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DWyGwvh9.js +1 -0
- package/dist/client/assets/{users-CuqlxLsH.js → users-CYflDdFv.js} +1 -1
- package/dist/client/assets/utils-B-5U5Z26.js +4 -0
- package/dist/client/assets/utils-CVEq3hMx.js +1 -0
- package/dist/client/assets/variant-calendar-BsFwTl3D.js +1 -0
- package/dist/client/assets/variant-matcher-override-CRlEf4IL.js +1 -0
- package/dist/client/assets/{view-mode-toggle-BlEO3gFJ.js → view-mode-toggle-kY4gR8CN.js} +1 -1
- package/dist/client/assets/virtual-mcp-CKi1xJsO.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/ErrorBarContext-CQj5vlL8.js +0 -1
- package/dist/client/assets/Sector-CD1ykt0B.js +0 -28
- package/dist/client/assets/ZoomOut-DhJWoynj.js +0 -1
- package/dist/client/assets/access-gate-OgewzCmd.js +0 -1
- package/dist/client/assets/agent-icon-6EllA70W.js +0 -1
- package/dist/client/assets/agents-list-BY0vT0Wn.js +0 -1
- package/dist/client/assets/ai-providers-vUA1qSht.js +0 -1
- package/dist/client/assets/analytics-tab-Do-IciVD.js +0 -2
- package/dist/client/assets/api-keys-pPtOUmL_.js +0 -1
- package/dist/client/assets/app-editor-CSGywsTY.js +0 -1
- package/dist/client/assets/automation-runs-CoIkXCsB.js +0 -187
- package/dist/client/assets/automations-CJ2EIlox.js +0 -1
- package/dist/client/assets/breadcrumb-CAKgWNOZ.js +0 -1
- package/dist/client/assets/bulk-category-panel-BenSOwl7.js +0 -1
- package/dist/client/assets/category-editor-iK-flfht.js +0 -1
- package/dist/client/assets/cdn-tab-Ck8xjhCA.js +0 -1
- package/dist/client/assets/chat-context-C6UT7ht1.js +0 -35
- package/dist/client/assets/choose-editor-B8v8x2gP.js +0 -1
- package/dist/client/assets/collection-detail-CZicQp0E.js +0 -1
- package/dist/client/assets/collection-display-button-BiBiEJPp.js +0 -1
- package/dist/client/assets/commerce-onboarding-DKWZMrBI.js +0 -1
- package/dist/client/assets/connect-layout-BLwdQBWt.js +0 -1
- package/dist/client/assets/connection-detail-BboxJXTl.js +0 -1
- package/dist/client/assets/connections-H_c0ER6v.js +0 -1
- package/dist/client/assets/e2e-tab-DbA_PByD.js +0 -1
- package/dist/client/assets/extract-connection-data-DkL3Oqhk.js +0 -1
- package/dist/client/assets/folder-icon-C46JPU0-.js +0 -2
- package/dist/client/assets/index-9Wn-1DpE.js +0 -1
- package/dist/client/assets/index-BEyFhSeZ.js +0 -834
- package/dist/client/assets/index-DHHqS3nT.js +0 -1
- package/dist/client/assets/index-DR6uwZdc.js +0 -1
- package/dist/client/assets/index-I7v7d4v2.js +0 -1
- package/dist/client/assets/index-SmsG_b1w.js +0 -1
- package/dist/client/assets/index-redirect-C3gwJ6Fh.js +0 -1
- package/dist/client/assets/infra-billing-Ch_WWq-u.js +0 -1
- package/dist/client/assets/members-ypEfbto9.js +0 -1
- package/dist/client/assets/monaco-editor-D3QSLeam.js +0 -9
- package/dist/client/assets/monitoring-stats-row--wR3KC6f.js +0 -1
- package/dist/client/assets/org-layout-DzsJ720P.js +0 -1
- package/dist/client/assets/page-seo-form-DPrfWQ94.js +0 -1
- package/dist/client/assets/post-calendar-DyncB6BE.js +0 -1
- package/dist/client/assets/post-editor-FfaApBeX.js +0 -1
- package/dist/client/assets/primitives-DZEMS67c.js +0 -1
- package/dist/client/assets/project-app-view-C1W5Uv5V.js +0 -1
- package/dist/client/assets/project-icon-DQTfNALl.js +0 -1
- package/dist/client/assets/provision-repo-scoped-github-connection-WQFARyHG.js +0 -1
- package/dist/client/assets/record-editor-DaGE-E4Q.js +0 -1
- package/dist/client/assets/redirect-editor-BgylW9YL.js +0 -1
- package/dist/client/assets/registry-YIdSAHGV.js +0 -2
- package/dist/client/assets/repository-import-picker-DN9Nn9yd.js +0 -1
- package/dist/client/assets/require-capability-BVMwcBeZ.js +0 -1
- package/dist/client/assets/review-settings-BN9py8rz.js +0 -1
- package/dist/client/assets/roles-CGT8NKA4.js +0 -1
- package/dist/client/assets/sections-editor-BIoyRz1G.js +0 -2
- package/dist/client/assets/select-model-BNDe5FJr.js +0 -4
- package/dist/client/assets/self-tool-result-DM7xixxP.js +0 -1
- package/dist/client/assets/seo-editor-EIeTDSnb.js +0 -1
- package/dist/client/assets/settings-layout-CwJp96nZ.js +0 -1
- package/dist/client/assets/settings-sidebar-BvIIdmkC.js +0 -1
- package/dist/client/assets/shell-controls-nVElTnLJ.js +0 -1
- package/dist/client/assets/shell-layout-CTNVA2t4.js +0 -1
- package/dist/client/assets/skill-preview-BswJw8Eb.js +0 -4
- package/dist/client/assets/skills-DXWVIfB4.js +0 -1
- package/dist/client/assets/store-BUUS-eER.js +0 -1
- package/dist/client/assets/store-registry-DxfEOZiI.js +0 -2
- package/dist/client/assets/switch-CPLM-IZy.js +0 -1
- package/dist/client/assets/synced-repos-Bl-1vG4K.js +0 -1
- package/dist/client/assets/task-route-B8aecmdq.js +0 -1
- package/dist/client/assets/thread-route-jI9qvJe_.js +0 -1
- package/dist/client/assets/toggle-group-WfRpP-dB.js +0 -1
- package/dist/client/assets/use-destination-route-CY15sZqw.js +0 -1
- package/dist/client/assets/use-mcp-client-Cw1fcLqm.js +0 -10
- package/dist/client/assets/use-navigate-to-agent-COVw0ub8.js +0 -1
- package/dist/client/assets/use-organization-settings-DucmPYOE.js +0 -1
- package/dist/client/assets/use-panel-navigate-C6Ga2vR8.js +0 -1
- package/dist/client/assets/use-registry-connections-DBp-MS3e.js +0 -1
- package/dist/client/assets/use-section-preview-base-B4s2_IK6.js +0 -1
- package/dist/client/assets/use-virtual-mcp-Bnfc4yEo.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DThUrotQ.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Dsg0_SX3.js +0 -1
- package/dist/client/assets/variant-calendar-BhJlQ5r6.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b_ as wn,b as ae,G as je,a as Yt,F as Dn,J as Tn,aq as Fn,ar as An,j as s,B as be,t as ce,c as Y,r as H,I as Bn,M as In,K as ue,l as re,h as Xe,o as ie,a4 as Je,a1 as Ze,a2 as et,n as it,d as Pn,a7 as kt,m as rt,bz as En,e as Oe,bp as Vn,ap as Mn}from"./index-y6Z5iMfg.js";import{C as On}from"./collection-search-7NUVJQfN.js";import{g as Ln,b as Rn,a as $n,e as Kn}from"./extract-connection-data-DkL3Oqhk.js";import{u as Wt,a as Xt,g as zn,C as pt}from"./connection-card-Nc1w-XCq.js";import{D as Jt,b as Zt,c as en,d as tn,h as Un,e as Qn}from"./dialog-CyDGwxcX.js";import{D as nn,a as sn,c as qn,b as on,e as Gn,f as rn,g as an,d as Hn}from"./drawer-CqSEztKC.js";import{d as me,a as pe,e as ge,b as he,c as xe,F as Et}from"./form-BnUN8JhF.js";import{I as _e}from"./input-DRjCNSPN.js";import{S as Yn,b as Wn,a as Xn,d as Jn,c as $e}from"./select-BGnwGqnU.js";import{T as Zn}from"./textarea-CuF3aDTE.js";import{b as ln}from"./use-connection-ClORxmw4.js";import{n as tt,a as gt,i as cn}from"./Tool02-BAA6OFl0.js";import{j as ht,aN as es,aO as ts,aP as Vt,aQ as ns,t as ss,aR as os,aa as is,aS as rs,p as as,aT as ls,a8 as xt,a7 as cs,ae as ds}from"./agent-icon-6EllA70W.js";import{b as us,d as fs}from"./UserSquare-CXhk4rLY.js";import{s as ms}from"./XClose-DvenHyNp.js";import{c as ps,i as Ge,a as Mt,E as gs,p as hs,b as xs,d as js}from"./connection-form-helpers-B4IwDJJQ.js";import{a as jt}from"./authenticate-and-persist-oauth-6UYdTwrd.js";import{g as ys}from"./connection-slug-CITJ0kGN.js";import{C as bs}from"./collection-tabs-MvaIz7gt.js";import{u as Ot}from"./use-infinite-scroll-Bw5rNIGx.js";import{B as He}from"./badge-GP_pc1i_.js";import{u as vs}from"./useSuspenseInfiniteQuery-Dsg0_SX3.js";import{S as Cs,u as ks,f as Ns}from"./use-mcp-client-Cw1fcLqm.js";import{i as nt}from"./Check-C1wq38_E.js";import{s as _s}from"./Plus-Bac7Bl-V.js";import{g as st}from"./metadata-dUsYcpuu.js";import{u as Ss}from"./use-ai-providers-BMexfNaB.js";import{a as ws}from"./use-file-configs-Dm3fOdMk.js";import{d as Ds}from"./use-organization-settings-DucmPYOE.js";import{r as Ts}from"./site-slug-uya6Wp4-.js";import{T as Fs,C as Nt,c as As,d as Bs,S as yt}from"./task-board-By8eCqZc.js";import{a as Is}from"./decopilot-sse-pool-Bm_3HC4t.js";import{u as Ps}from"./use-decopilot-events-C0NWoSQc.js";import{A as Lt}from"./avatar-CfO1mReu.js";import{h as ot,D as dn,b as un,g as fn,c as mn}from"./dropdown-menu-CgwRqOnX.js";import{a as _t,b as St,P as wt}from"./popover-DrJcYe9C.js";import{e as Le,a as Dt,c as Tt,d as Ce,b as Ft,C as At}from"./command-CF7nzIN2.js";import{t as ze}from"./ChevronUp-B0KEDz5f.js";import{s as Es}from"./TrendUp01-fHRYAiew.js";import{a as Vs}from"./Settings02-t15FjJbr.js";import{s as Rt}from"./User01-BPodfm7s.js";import{G as Ms}from"./github-icon-7BmoW2Y2.js";import{P as Os}from"./project-icon-DQTfNALl.js";import{g as $t}from"./get-initials-D-f_fDFw.js";import{p as Ls,a as Rs}from"./github-repo-CTPv5ZM2.js";import{i as $s}from"./AlertCircle-Df7Uu4Sr.js";import{i as Ks}from"./CheckCircle-DWvslkKl.js";import{a as pn}from"./DotsVertical-CBmzJDPB.js";import{s as zs}from"./Eye-DFgd5114.js";import{i as Us}from"./Shield01-DS-tpugO.js";const Qs=wn("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);function qs({open:t,onOpenChange:e,onCreated:n}){const o=ae(),{org:r}=je(),{data:a}=Yt.useSession(),{stdioEnabled:i}=Dn(),m=Tn(),c=ln(),d=Wt(),p=Xt(d,"").items,l=Fn({resolver:An(ps),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),f=l.watch("ui_type"),j=l.watch("connection_url"),g=l.watch("npx_package"),x=Ge({uiType:f,connectionUrl:j??"",npxPackage:g??""})??Mt({uiType:f,connectionUrl:j??"",registryItems:p}),y=h=>{const _=h.trim();if(!_)return;const w=!!l.formState.dirtyFields.title,P=!!l.formState.dirtyFields.description,V=!!l.formState.dirtyFields.env_vars,N=F=>{if(F&&(!w&&!l.getValues("title").trim()&&F.title&&l.setValue("title",F.title,{shouldDirty:!1}),!P&&!(l.getValues("description")??"").trim()&&F.description&&l.setValue("description",F.description,{shouldDirty:!1}),!V&&F.envVarKeys?.length)){const $=l.getValues("env_vars")??[],I=new Set($.map(R=>R.key)),B=F.envVarKeys.filter(R=>!I.has(R));B.length>0&&l.setValue("env_vars",[...$,...B.map(R=>({key:R,value:""}))],{shouldDirty:!0})}},T=hs(_);if(T&&i){l.setValue("ui_type","NPX",{shouldDirty:!0}),l.setValue("npx_package",T.packageName,{shouldDirty:!0}),l.setValue("connection_url","",{shouldDirty:!0}),l.setValue("connection_token",null,{shouldDirty:!0}),N(Ge({uiType:"NPX",npxPackage:T.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const F=f==="HTTP"||f==="SSE"||f==="Websocket"?f:"HTTP";l.setValue("ui_type",F,{shouldDirty:!0}),l.setValue("connection_url",_,{shouldDirty:!0}),N(Ge({uiType:F,connectionUrl:_})??Mt({uiType:F,connectionUrl:_,registryItems:p}));return}f==="NPX"&&N(Ge({uiType:"NPX",npxPackage:_}))},S=h=>{h||l.reset(),e(h)},b=async h=>{let _,w=null,P=null,V=null;h.ui_type==="NPX"?(_="STDIO",w="",V=xs(h.npx_package||"",h.env_vars||[])):h.ui_type==="STDIO"?(_="STDIO",w="",V=js(h.stdio_command||"",h.stdio_args||"",h.stdio_cwd,h.env_vars||[])):(_=h.ui_type,w=h.connection_url||"",P=h.connection_token||null);const N=Ln("conn");try{await c.create.mutateAsync({id:N,title:h.title,description:h.description||null,connection_type:_,connection_url:w,connection_token:P,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:a?.user?.id||"system",organization_id:r.id,icon:h.icon??null,app_name:null,app_id:null,connection_headers:V,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),l.reset(),e(!1),n?.(N)}catch{ce.error(o("connections.createConnectionDialog.failedToCreateConnection"))}},k=o("connections.createConnectionDialog.title"),v=o("connections.createConnectionDialog.description"),C=l.formState.isSubmitting?o("connections.createConnectionDialog.saving"):o("connections.createConnectionDialog.createButton"),D=s.jsxs("div",{className:"grid gap-4",children:[s.jsx(me,{control:l.control,name:"ui_type",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.typeLabel")}),s.jsxs(Yn,{value:h.value,onValueChange:h.onChange,children:[s.jsx(he,{children:s.jsx(Wn,{children:s.jsx(Xn,{})})}),s.jsxs(Jn,{children:[s.jsx($e,{value:"HTTP",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ht,{className:"w-4 h-4"}),o("connections.createConnectionDialog.httpType")]})}),s.jsx($e,{value:"SSE",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ht,{className:"w-4 h-4"}),o("connections.createConnectionDialog.sseType")]})}),s.jsx($e,{value:"Websocket",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ht,{className:"w-4 h-4"}),o("connections.createConnectionDialog.websocketType")]})}),i&&s.jsxs(s.Fragment,{children:[s.jsx($e,{value:"NPX",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(tt,{className:"w-4 h-4"}),o("connections.createConnectionDialog.npxPackageType")]})}),s.jsx($e,{value:"STDIO",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(us,{className:"w-4 h-4"}),o("connections.createConnectionDialog.customCommandType")]})})]})]})]}),s.jsx(xe,{})]})}),f==="NPX"&&s.jsx(me,{control:l.control,name:"npx_package",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.npmPackageLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.npmPackagePlaceholder"),...h,value:h.value??"",onPaste:_=>{const w=_.clipboardData.getData("text");w&&(_.preventDefault(),l.setValue("npx_package",w.trim(),{shouldDirty:!0}),y(w))},onBlur:_=>{y(_.target.value),h.onBlur()}})}),s.jsx(xe,{})]})}),f==="STDIO"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[s.jsx(me,{control:l.control,name:"stdio_command",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.commandLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.commandPlaceholder"),...h,value:h.value??""})}),s.jsx(xe,{})]})}),s.jsx(me,{control:l.control,name:"stdio_args",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.argumentsLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.argumentsPlaceholder"),...h,value:h.value??""})}),s.jsx(xe,{})]})})]}),s.jsx(me,{control:l.control,name:"stdio_cwd",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.workingDirectoryLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.workingDirectoryPlaceholder"),...h,value:h.value??""})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:o("connections.createConnectionDialog.workingDirectoryDescription")}),s.jsx(xe,{})]})})]}),(f==="NPX"||f==="STDIO")&&s.jsx(me,{control:l.control,name:"env_vars",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.environmentVariablesLabel")}),s.jsx(he,{children:s.jsx(gs,{value:h.value??[],onChange:h.onChange})}),s.jsx(xe,{})]})}),f!=="NPX"&&f!=="STDIO"&&s.jsxs(s.Fragment,{children:[s.jsx(me,{control:l.control,name:"connection_url",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.urlLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.urlPlaceholder"),...h,value:h.value??"",onPaste:_=>{const w=_.clipboardData.getData("text");w&&(_.preventDefault(),l.setValue("connection_url",w.trim(),{shouldDirty:!0}),y(w))},onBlur:_=>{y(_.target.value),h.onBlur()}})}),s.jsx(xe,{})]})}),s.jsx(me,{control:l.control,name:"connection_token",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:x?.token?.label??o("connections.createConnectionDialog.tokenLabelDefault")}),s.jsx(he,{children:s.jsx(_e,{type:"password",placeholder:x?.token?.placeholder??o("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...h,value:h.value??""})}),x?.token?.helperText&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.token.helperText,x.id==="github"&&s.jsxs(s.Fragment,{children:[" ","·"," ",s.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:o("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),s.jsx(xe,{})]})})]}),s.jsx(me,{control:l.control,name:"title",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.nameLabel")}),s.jsx(he,{children:s.jsx(_e,{placeholder:o("connections.createConnectionDialog.namePlaceholder"),...h})}),s.jsx(xe,{})]})}),s.jsx(me,{control:l.control,name:"description",render:({field:h})=>s.jsxs(pe,{children:[s.jsx(ge,{children:o("connections.createConnectionDialog.descriptionLabel")}),s.jsx(he,{children:s.jsx(Zn,{placeholder:o("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...h,value:h.value??""})}),s.jsx(xe,{})]})})]});return m?s.jsx(nn,{open:t,onOpenChange:S,children:s.jsxs(sn,{className:"max-h-[90vh]",children:[s.jsx(qn,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex-1 text-left",children:[s.jsx(on,{children:k}),s.jsx(Gn,{className:"mt-1",children:v})]}),s.jsx(rn,{asChild:!0,children:s.jsx(be,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:s.jsx(ms,{size:16})})})]})}),s.jsx(Et,{...l,children:s.jsxs("form",{onSubmit:l.handleSubmit(b),children:[s.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:D}),s.jsx(an,{children:s.jsx(be,{type:"submit",disabled:l.formState.isSubmitting,className:"w-full",children:C})})]})})]})}):s.jsx(Jt,{open:t,onOpenChange:S,children:s.jsxs(Zt,{className:"sm:max-w-[525px]",children:[s.jsxs(en,{children:[s.jsx(tn,{children:k}),s.jsx(Un,{children:v})]}),s.jsx(Et,{...l,children:s.jsxs("form",{onSubmit:l.handleSubmit(b),children:[s.jsx("div",{className:"py-4",children:D}),s.jsxs(Qn,{children:[s.jsx(be,{type:"button",variant:"outline",onClick:()=>S(!1),children:o("connections.createConnectionDialog.cancelButton")}),s.jsx(be,{type:"submit",disabled:l.formState.isSubmitting,className:"min-w-40",children:C})]})]})})]})})}function Gs(t){const e=Y.c(72),{mode:n,agentId:o,addedConnectionIds:r,onAdd:a,onCloneAndAdd:i,onConnectAndAdd:m,connectingItemId:c,search:d,onCreateConnection:u,onBrowseNavigate:p,defaultTab:l}=t,f=n===void 0?"add":n,j=l===void 0?"connected":l,g=ae(),{org:x}=je(),y=H.useDeferredValue(d),S=d!==y;let b;e[0]!==y?(b=y.trim().toLowerCase(),e[0]=y,e[1]=b):b=e[1];const k=b;let v;e[2]!==j?(v=A=>A??j,e[2]=j,e[3]=v):v=e[3];const[C,D]=Bn(In.connectionsTab(x.slug)+(j==="all"?":home-modal":":agent-modal"),v);let h;e[4]!==C||e[5]!==D?(h=A=>{A!==C&&ie("connections_dialog_tab_changed",{to_tab:A}),D(A)},e[4]=C,e[5]=D,e[6]=h):h=e[6];const _=h;let w;e[7]!==x.id||e[8]!==x.slug?(w={connectionId:Cs,orgId:x.id,orgSlug:x.slug},e[7]=x.id,e[8]=x.slug,e[9]=w):w=e[9];const P=ks(w),V=y?.trim().split(/\s+/).filter(Boolean)??[],N=V.length>0?{operator:"or",conditions:V.flatMap(to)}:void 0,T={...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},F=JSON.stringify(T),{data:$,fetchNextPage:I,hasNextPage:B,isFetchingNextPage:R}=vs({queryKey:ue.collectionListInfinite(P,x.id,"","CONNECTIONS",F),queryFn:async A=>{const{pageParam:q}=A,ye=q===void 0?0:q;return(await P.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...N&&{where:N},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:ye}})).structuredContent},initialPageParam:0,getNextPageParam:Zs,staleTime:3e4}),G=$?.pages.flatMap(Js)??[],E=zn(G),U=new Set(G.filter(Xs).map(Ws)),M=Wt(),Q=Xt(M,y),Z=Ot(Q.loadMore,Q.hasMore,Q.isLoadingMore),ee=Ot(I,B??!1,R),K=C==="all"||!!k,ne=K?Q.items.filter(A=>{const q=Rn(A);if(q&&U.has(q))return!1;if(!k)return!0;const ye=st(A._meta),ke=[A.title,A.description,A.name,A.server?.title,A.server?.description,A.server?.name,ye?.friendly_name,ye?.friendlyName].filter(Boolean).join(" ").toLowerCase();return V.some(fe=>ke.includes(fe.toLowerCase()))}):[],W=ne.filter(Ys),X=ne.filter(Hs);let J;e[10]!==r?(J=A=>A.some(q=>r.has(q.id)),e[10]=r,e[11]=J):J=e[11];const te=J;let se;e[12]!==r||e[13]!==o||e[14]!==c||e[15]!==te||e[16]!==f||e[17]!==a||e[18]!==p||e[19]!==i||e[20]!==g?(se=(A,q,ye,ke,fe)=>{const qe=te(fe),Me=fe.find(Ne=>!r.has(Ne.id)),le=fe[0];if(f==="browse"){const Ne=ys(le);return s.jsx(pt,{connection:{title:q,icon:ye,description:fe.length>1?`${fe.length} instances`:ke??void 0},fallbackIcon:s.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs(He,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[s.jsx(nt,{size:11})," ",g("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{ie("connection_browse_clicked",{app_name:le.app_name??null,connection_id:le.id,instances_count:fe.length}),p?.(Ne)}},A)}return s.jsx(pt,{connection:{title:q,icon:ye,description:ke},fallbackIcon:s.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs("div",{className:"flex items-center gap-1.5",children:[qe&&s.jsxs(He,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[s.jsx(nt,{size:11})," ",g("virtualMcp.connectionDialogContent.added")]}),s.jsx(be,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:Ne=>{Ne.stopPropagation(),Me?(ie("connection_add_clicked",{action:"use_existing",app_name:le.app_name??null,connection_id:Me.id}),o&&ie("agent_connection_attached",{agent_id:o,connection_id:Me.id,app_name:le.app_name??null,mode:"existing"}),a(Me.id)):(ie("connection_add_clicked",{action:"clone",app_name:le.app_name??null,base_connection_id:le.id}),i(le))},children:g("virtualMcp.connectionDialogContent.add")})]})},A)},e[12]=r,e[13]=o,e[14]=c,e[15]=te,e[16]=f,e[17]=a,e[18]=p,e[19]=i,e[20]=g,e[21]=se):se=e[21];const O=se;let L;e[22]!==c||e[23]!==f||e[24]!==m||e[25]!==g?(L=A=>{const q=st(A._meta),ye=q?.friendlyName||q?.friendly_name||A.server?.title||A.title||A.server?.name||A.name||A.id||"",ke=A.server?.description||A.description||null,fe=A.server?.icons?.[0]?.src||$n(A.server?.repository)||null,qe=q?.official===!0,Me=q?.verified===!0,le=q?.owner==="deco";return s.jsx(pt,{connection:{title:ye,description:ke,icon:fe},fallbackIcon:s.jsx(tt,{}),headerActionsAlwaysVisible:!0,headerActions:s.jsxs("div",{className:"flex items-center gap-1.5",children:[le&&s.jsxs(Je,{children:[s.jsx(Ze,{asChild:!0,children:s.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:g("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),s.jsx(et,{children:g("virtualMcp.connectionDialogContent.builtByDeco")})]}),!le&&qe&&s.jsxs(Je,{children:[s.jsx(Ze,{asChild:!0,children:s.jsx(He,{variant:"outline",size:"icon",children:s.jsx(gt,{})})}),s.jsx(et,{children:g("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!le&&!qe&&Me&&s.jsxs(Je,{children:[s.jsx(Ze,{asChild:!0,children:s.jsx(He,{variant:"outline",size:"icon",children:s.jsx(gt,{})})}),s.jsx(et,{children:g("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),s.jsx(be,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:Ne=>{Ne.stopPropagation(),ie("connection_add_clicked",{action:"connect_new",registry_item_id:A.id,app_name:q?.friendlyName||A.server?.name||A.name||null}),m(A)},children:c===A.id?s.jsx(Xe,{className:"size-3.5"}):g(f==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${A.id}`)},e[22]=c,e[23]=f,e[24]=m,e[25]=g,e[26]=L):L=e[26];const oe=L;let z;e[27]!==C||e[28]!==_||e[29]!==u||e[30]!==k||e[31]!==g?(z=!k&&s.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[s.jsx(bs,{tabs:[{id:"all",label:g("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:g("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:C,onTabChange:A=>_(A)}),s.jsxs(be,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{ie("connections_dialog_custom_clicked"),u()},children:[s.jsx(_s,{size:12}),g("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=C,e[28]=_,e[29]=u,e[30]=k,e[31]=g,e[32]=z):z=e[32];const ve=S&&"opacity-50 pointer-events-none";let de;e[33]!==ve?(de=re("flex-1 overflow-auto p-5 transition-opacity duration-150",ve),e[33]=ve,e[34]=de):de=e[34];const De="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Te;e[35]!==O?(Te=A=>{if(A.type==="group")return O(A.key,A.title,A.icon,null,A.connections);const q=A.connection;return O(q.id,q.title,q.icon,q.description??null,[q])},e[35]=O,e[36]=Te):Te=e[36];const ct=E.map(Te);let Fe;e[37]!==ee?(Fe=s.jsx("div",{ref:ee,className:"col-span-full h-1"}),e[37]=ee,e[38]=Fe):Fe=e[38];let Ae;e[39]!==R?(Ae=R&&s.jsx("div",{className:"col-span-full flex justify-center py-6",children:s.jsx(Xe,{className:"size-6 text-muted-foreground"})}),e[39]=R,e[40]=Ae):Ae=e[40];const dt=K&&W.length>0&&s.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[s.jsx(gt,{size:13,className:"text-muted-foreground shrink-0"}),s.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:g("virtualMcp.connectionDialogContent.sectionVerified")}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),ut=K&&W.map(oe),ft=K&&X.length>0&&s.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[s.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:g("virtualMcp.connectionDialogContent.sectionAllConnections")}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),mt=K&&X.map(oe);let Be;e[41]!==Z||e[42]!==M||e[43]!==K?(Be=K&&M.length>0&&s.jsx("div",{ref:Z,className:"col-span-full h-1"}),e[41]=Z,e[42]=M,e[43]=K,e[44]=Be):Be=e[44];let Ie;e[45]!==Q.isLoadingMore||e[46]!==K?(Ie=K&&Q.isLoadingMore&&s.jsx("div",{className:"col-span-full flex justify-center py-6",children:s.jsx(Xe,{className:"size-6 text-muted-foreground"})}),e[45]=Q.isLoadingMore,e[46]=K,e[47]=Ie):Ie=e[47];let Pe;e[48]!==ct||e[49]!==Fe||e[50]!==Ae||e[51]!==dt||e[52]!==ut||e[53]!==ft||e[54]!==mt||e[55]!==Be||e[56]!==Ie?(Pe=s.jsxs("div",{className:De,children:[ct,Fe,Ae,dt,ut,ft,mt,Be,Ie]}),e[48]=ct,e[49]=Fe,e[50]=Ae,e[51]=dt,e[52]=ut,e[53]=ft,e[54]=mt,e[55]=Be,e[56]=Ie,e[57]=Pe):Pe=e[57];let Ee;e[58]!==C||e[59]!==E.length||e[60]!==X||e[61]!==d||e[62]!==g||e[63]!==W?(Ee=E.length===0&&W.length===0&&X.length===0&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:d?g("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:d}):g(C==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=C,e[59]=E.length,e[60]=X,e[61]=d,e[62]=g,e[63]=W,e[64]=Ee):Ee=e[64];let Ve;e[65]!==de||e[66]!==Pe||e[67]!==Ee?(Ve=s.jsxs("div",{className:de,children:[Pe,Ee]}),e[65]=de,e[66]=Pe,e[67]=Ee,e[68]=Ve):Ve=e[68];let Qe;return e[69]!==z||e[70]!==Ve?(Qe=s.jsxs(s.Fragment,{children:[z,Ve]}),e[69]=z,e[70]=Ve,e[71]=Qe):Qe=e[71],Qe}function Hs(t){return!t.verified&&!st(t._meta)?.verified&&!t.meta?.verified}function Ys(t){return t.verified||st(t._meta)?.verified||t.meta?.verified}function Ws(t){return t.app_name}function Xs(t){return t.app_name}function Js(t){return t?.items??[]}function Zs(t,e){if(t?.hasMore)return e.reduce(eo,0)}function eo(t,e){return t+(e?.items?.length??0)}function to(t){return[{field:["title"],operator:"contains",value:t},{field:["description"],operator:"contains",value:t}]}function Ji({open:t,onOpenChange:e,defaultTab:n,initialSearch:o="",...r}){const a=ae(),i=r.mode??"add",m="agentId"in r?r.agentId:void 0,c="addedConnectionIds"in r?r.addedConnectionIds??new Set:new Set,d="onAdd"in r&&r.onAdd?r.onAdd:N=>{},u=(N,T,F)=>{m&&ie("agent_connection_attached",{agent_id:m,connection_id:N,app_name:T,mode:F})},[p,l]=H.useState(null),[f,j]=H.useState(o),[g,x]=H.useState(!1),[y,S]=H.useState(t);t!==y&&(S(t),t&&j(o));const{org:b}=je(),{data:k}=Yt.useSession(),v=ln(),C=it(),D=Pn(),h=N=>{e(!1),D({to:"/$org/settings/connections/$appSlug",params:{org:b.slug,appSlug:N}})},_=()=>{C.invalidateQueries({predicate:N=>{const T=N.queryKey;return T[1]===b.id&&T[3]==="collection"&&T[4]==="CONNECTIONS"}})},w=async(N,T)=>{ie("connection_oauth_succeeded",{connection_id:N,flow:T});const F=new URL(`/api/${b.slug}/mcp/${N}`,window.location.origin);await C.invalidateQueries({queryKey:ue.isMCPAuthenticated(F.href,null)}),_()},P=async N=>{l(N.app_name??N.id);try{const F=`${N.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,I=(await v.create.mutateAsync({title:F,description:N.description??null,connection_type:N.connection_type,connection_url:N.connection_url??null,connection_token:null,icon:N.icon??null,app_name:N.app_name??null,app_id:N.app_id??null,connection_headers:N.connection_headers??null})).id,B=await jt({connectionId:I,orgId:b.id,orgSlug:b.slug,persistFallback:R=>v.update.mutateAsync({id:I,data:{connection_token:R}}).then(()=>{})});if(B.ran&&!B.ok){ie("connection_oauth_failed",{connection_id:I,flow:"clone",error:B.error??"no_token"}),ce.error(a("virtualMcp.addConnectionDialog.authenticationFailedError",{error:B.error??"no token received"})),await v.delete.mutateAsync(I);return}B.ran&&await w(I,"clone"),u(I,N.app_name??null,"clone"),d(I)}catch(T){console.error("Failed to add connection:",T),ce.error(a("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{l(null)}},V=async N=>{if(!(!b||!k?.user?.id)){l(N.id);try{const T=Kn(N,b.id,k.user.id,{remoteIndex:0}),F=T.connection_type==="STDIO",$=!!T.connection_url,I=F&&T.connection_headers&&typeof T.connection_headers=="object"&&"command"in T.connection_headers;if(!$&&!I){ce.error(a("virtualMcp.addConnectionDialog.mcpServerConnectionError")),l(null);return}const{id:B}=await v.create.mutateAsync(T),R=await jt({connectionId:B,orgId:b.id,orgSlug:b.slug,persistFallback:G=>v.update.mutateAsync({id:B,data:{connection_token:G}}).then(()=>{})});if(R.ran&&!R.ok){ie("connection_oauth_failed",{connection_id:B,flow:"connect_new",error:R.error??"no_token"}),ce.warning(a("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:a("virtualMcp.addConnectionDialog.signInFailedDescription",{error:R.error??"no token received"})}),u(B,T.app_name??null,"new"),d(B);return}R.ran?(await w(B,"connect_new"),ce.success(a("virtualMcp.addConnectionDialog.connectedAuthenticated"))):ce.success(a("virtualMcp.addConnectionDialog.connected")),u(B,T.app_name??null,"new"),d(B)}catch(T){console.error("Failed to connect:",T),ce.error(a("virtualMcp.addConnectionDialog.failedToConnect"))}finally{l(null)}}};return s.jsxs(Jt,{open:t,onOpenChange:e,children:[s.jsxs(Zt,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[s.jsx(en,{className:"px-6 pt-5 pb-0 shrink-0",children:s.jsx(tn,{className:"text-base font-semibold",children:a(i==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),s.jsx("div",{className:"pt-3 shrink-0",children:s.jsx(On,{value:f,onChange:j,placeholder:a("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),s.jsx(H.Suspense,{fallback:s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(Xe,{className:"size-6 text-muted-foreground"})}),children:s.jsx(Gs,{mode:i,agentId:m,addedConnectionIds:c,onAdd:d,onCloneAndAdd:P,onConnectAndAdd:V,connectingItemId:p,search:f,onCreateConnection:()=>x(!0),onBrowseNavigate:h,defaultTab:n})})]}),s.jsx(qs,{open:g,onOpenChange:x,onCreated:async N=>{x(!1);const T=await jt({connectionId:N,orgId:b.id,orgSlug:b.slug,persistFallback:F=>v.update.mutateAsync({id:N,data:{connection_token:F}}).then(()=>{})});if(T.ran&&!T.ok){ie("connection_oauth_failed",{connection_id:N,flow:"custom_create",error:T.error??"no_token"}),ce.warning(a("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:a("virtualMcp.addConnectionDialog.signInFailedDescription",{error:T.error??"no token received"})}),u(N,null,"custom"),d(N),e(!1);return}T.ran&&await w(N,"custom_create"),u(N,null,"custom"),d(N),e(!1)}})]})}const Kt=new Map;function Zi(){const{org:t}=je(),e=kt(),n=Ss(),o=n.find(x=>x.providerId==="deco"),{data:r,isLoading:a,refetch:i,isFetching:m}=rt({queryKey:ue.aiProviderCredits(t.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),c=r?.balanceCents??null,d=c!=null?c/100:null,u=H.useRef(new Map);if(c!=null){const x=Kt.get(t.id);u.current.get(t.id)&&x!=null&&c>x&&ie("credits_topped_up_detected",{organization_id:t.id,delta_cents:c-x,previous_balance_cents:x,new_balance_cents:c}),Kt.set(t.id,c),u.current.set(t.id,!0)}const p=!!o,l=c!=null&&c>0,f=c!=null&&c===0,j=c!=null&&c===200,g=n.length>0&&n.every(x=>x.providerId==="deco");return{hasDecoKey:p,decoKeyId:o?.id??null,balanceCents:c,balanceDollars:d,hasCredits:l,isZeroBalance:f,isInitialFreeCredit:j,hasOnlyDecoProvider:g,isLoading:a,isFetching:m,refetch:i}}const no=4,so="TASK";function oo(t){return t.replace(/[^a-zA-Z]/g,"").toUpperCase().slice(0,no)||so}function io(t,e){return e==null?null:`${oo(t)}-${String(e).padStart(2,"0")}`}const ro=/^(?:[a-z]{1,8}-)?0*(\d+)$/i;function ao(t){const e=ro.exec(t.trim())?.[1];return e===void 0?null:Number(e)}function zt(t){const e=Y.c(8),{size:n,className:o}=t,r=n===void 0?16:n;let a;e[0]!==r?(a={width:r,height:r},e[0]=r,e[1]=a):a=e[1];let i;e[2]!==o?(i=re("shrink-0 rounded-full object-cover",o),e[2]=o,e[3]=i):i=e[3];let m;return e[4]!==r||e[5]!==a||e[6]!==i?(m=s.jsx("img",{src:Ns,alt:"Super Agent",width:r,height:r,style:a,className:i}),e[4]=r,e[5]=a,e[6]=i,e[7]=m):m=e[7],m}const Ue=["overview","reports","board","site-editor","assets","hosting","e2e","analytics","cdn","automations"],lo=["overview","reports","board","site-editor"],Bt=1,co=["assets","hosting","e2e","analytics","cdn"];function er(t,e,n){if(!t)return{project:n??null,resolvedScopeId:null};const o=e?.id===t?e:n?.id===t?n:null;return{project:o,resolvedScopeId:o?t:null}}function tr(t){return t?.sidebarViews!==void 0?t.sidebarViews:t?.ui?.layout?.sidebarViews}function gn(t,e){const n=new Set(t??[]);if(e!==Bt)for(const o of lo)n.add(o);return Ue.filter(o=>n.has(o))}function uo(t){return Ue.some(e=>e===t)}function fo(t){return co.some(e=>e===t)}function mo(t,e){return{overview:t,reports:t,board:t,"site-editor":t,assets:e.assets,hosting:e.hosting,e2e:e.e2e,analytics:e.analytics,cdn:e.cdn,automations:!0}}function nr(t,e,n){const o=mo(e,n);return t?o:{...o,overview:!0,reports:!0,board:!0}}function sr(t,e,n){const o=new Set(gn(t,n));return Ue.filter(r=>e[r]&&o.has(r))}function or(t,e,n){return n||!t?t:(t.type==="preview"||t.type==="content"||t.type==="code"?"site-editor":t.type)===e?{type:"settings"}:t}function ir(t){return Ue.filter(e=>t[e])}function po(t,e,n){return!uo(t)||e[t]?!1:fo(t)?!(t==="assets"?n.assets:n.siteAccess):!0}function rr(t,e,n,o,r){return po(t==="preview"||t==="content"||t==="code"?"site-editor":t,e,n)||t==="content"&&!o.includes("content")||t==="code"&&r&&!o.includes("code")}function ar(t,e,n,o){const r=new Set(gn(t,o));return n?r.add(e):r.delete(e),Ue.filter(a=>r.has(a))}function Ke(t,e){return ue.optimisticProjectSidebarViews(t,e)}function Ye(t){return typeof t=="object"&&t!==null}function hn(t,e){return t[1]===e&&t[3]==="collection"&&t[4]==="VIRTUAL_MCP"}function go(t,e){if(!Ye(t))return t;if("item"in t&&Ye(t.item)&&t.item.id===e.id)return{...t,item:e};if(!("structuredContent"in t)||!Ye(t.structuredContent))return t;const n=t.structuredContent.items;if(!Array.isArray(n))return t;let o=!1;const r=n.map(a=>!Ye(a)||a.id!==e.id?a:(o=!0,e));return o?{...t,structuredContent:{...t.structuredContent,items:r}}:t}function lr(t,e,n){t.setQueriesData({predicate:o=>hn(o.queryKey,e)},o=>go(o,n))}function cr(t,e,n){const o=t.getQueriesData({predicate:r=>hn(r.queryKey,e)&&r.queryKey[5]===n});for(const[,r]of o)if(r?.item?.id===n)return r.item;return null}function It(t,e,n){return t.getQueryData(Ke(e,n))??null}function ho(t,e){if(e)return{sidebarViews:[...e.views],sidebarViewsVersion:Bt};const n=t?.sidebarViews;return{sidebarViews:n===null?null:n?[...n]:void 0,sidebarViewsVersion:t?.sidebarViewsVersion}}function dr(t,e,n){return e?{sidebarViews:[...e.views],sidebarViewsVersion:Bt}:n===void 0?{sidebarViews:t.sidebarViews===null?null:t.sidebarViews?[...t.sidebarViews]:void 0,sidebarViewsVersion:t.sidebarViewsVersion}:ho(n,null)}function xo(t,e,n,o,r){const a=It(t,e,n),i={revision:(a?.revision??0)+1,views:[...o],rollbackViews:a?[...a.rollbackViews]:[...r]};return t.setQueryData(Ke(e,n),i),{revision:i.revision,views:[...i.views],persistedViews:[...i.rollbackViews]}}function jo(t,e,n){const o=It(t,e,n);return o?{revision:o.revision,views:[...o.views],persistedViews:[...o.rollbackViews]}:null}function xn(t,e){const n=new Set(t),o=new Set(e);return n.size===o.size&&[...n].every(r=>o.has(r))}function ur(t){return t?!xn(t.views,t.persistedViews):!1}function yo(t,e,n,{snapshot:o,saved:r,authoritativeViews:a}){if(!o)return{settledLatest:!1,reconciledViews:null};const i=It(t,e,n);if(!i||o.revision>i.revision)return{settledLatest:!1,reconciledViews:null};const m=a!==void 0?[...a]:r?[...o.views]:null,c={...i,rollbackViews:m??i.rollbackViews};return c.rollbackViews!==i.rollbackViews&&t.setQueryData(Ke(e,n),c),o.revision!==i.revision?{settledLatest:!1,reconciledViews:null}:(t.setQueryData(Ke(e,n),null),{settledLatest:!0,reconciledViews:r?m&&!xn(m,o.views)?m:null:[...c.rollbackViews]})}function fr(t){const e=Y.c(5),{org:n}=je(),o=t??"";let r;e[0]!==n.id||e[1]!==o?(r=Ke(n.id,o),e[0]=n.id,e[1]=o,e[2]=r):r=e[2];let a;e[3]!==r?(a={queryKey:r,queryFn:bo,enabled:!1,staleTime:Number.POSITIVE_INFINITY},e[3]=r,e[4]=a):a=e[4];const{data:i}=rt(a);return i?.views}async function bo(){return null}function mr(t){const e=Y.c(4),{org:n}=je(),o=it();let r;return e[0]!==n||e[1]!==o||e[2]!==t?(r={stage:(a,i)=>xo(o,n.id,t,a,i),snapshot:()=>jo(o,n.id,t),settle:a=>yo(o,n.id,t,a)},e[0]=n,e[1]=o,e[2]=t,e[3]=r):r=e[3],r}function vo(t,e){if(!e)return null;const n=e.toLowerCase();return t.find(o=>{const r=o.bucket.toLowerCase();return o.siteSlug?.toLowerCase()===n||r===n||r===`deco-assets-${n}`})??null}function pr(t){const e=Y.c(10),{org:n}=je(),o=En(),r=Ds(),a=ws(),i=Ts(t),m=o.hostingEnabled===!0,c=o.monitorEnabled===!0||o.auth.localMode===!0,d=(m||c)&&!!i,u=rt({queryKey:ue.hostingAccess(n.slug,i??""),queryFn:async()=>{const v=await fetch(`/api/${n.slug}/hosting/${encodeURIComponent(i??"")}/access`);return v.ok?await v.json():{owned:!1,canWrite:!1}},enabled:d,staleTime:6e4}),p=u.data?.owned===!0,l=!!vo(a.data?.configs??[],i),f=m&&p&&r.hosting,j=m&&p&&r.e2e,g=m&&p&&r.analytics,x=c&&p&&r.monitor;let y;e[0]!==l||e[1]!==f||e[2]!==j||e[3]!==g||e[4]!==x?(y={assets:l,hosting:f,e2e:j,analytics:g,cdn:x},e[0]=l,e[1]=f,e[2]=j,e[3]=g,e[4]=x,e[5]=y):y=e[5];const S=!!i&&a.isPending,b=d&&u.isPending;let k;return e[6]!==y||e[7]!==S||e[8]!==b?(k={presence:y,assetsPending:S,siteAccessPending:b},e[6]=y,e[7]=S,e[8]=b,e[9]=k):k=e[9],k}const Ut=()=>0;function Co(t){const{orgSlug:e,enabled:n=!0,onUpdate:o,onDelete:r,onResync:a}=t,i=H.useRef(o);i.current=o;const m=H.useRef(r);m.current=r;const c=H.useRef(a);c.current=a;const d=H.useRef(null),u=H.useRef(n),p=H.useRef(e);(!d.current||u.current!==n||p.current!==e)&&(u.current=n,p.current=e,d.current=f=>{if(!n||!e)return()=>{};const j=g=>{let x;try{x=JSON.parse(g.data)}catch{return}x.data&&(g.type===Fs?m.current?.(x.data.id):i.current(x.data)),f()};return Is.subscribe(e,j,()=>c.current?.())}),H.useSyncExternalStore(d.current,Ut,Ut)}function ko(t,e){return{queryKey:ue.taskBoardItems(t),refetchInterval:6e4,queryFn:async()=>{const{items:n}=await e.call("TASK_BOARD_ITEM_LIST",{});return{items:n}}}}function No(){const t=Y.c(21),{org:e,locator:n}=je(),o=it();let r;t[0]!==n?(r=ue.taskBoardItems(n),t[0]=n,t[1]=r):r=t[1];const a=r;let i;t[2]!==n||t[3]!==o||t[4]!==a?(i=l=>{o.cancelQueries({queryKey:a}),o.setQueryData(a,f=>f&&{...f,items:f.items.some(j=>j.id===l.id)?f.items.map(j=>j.id===l.id?l:j):[l,...f.items]}),o.invalidateQueries({queryKey:ue.taskBoardActivity(n,l.id)})},t[2]=n,t[3]=o,t[4]=a,t[5]=i):i=t[5];let m,c;t[6]!==o||t[7]!==a?(m=()=>{o.invalidateQueries({queryKey:a})},c=l=>{o.cancelQueries({queryKey:a}),o.setQueryData(a,f=>f&&{...f,items:f.items.filter(j=>j.id!==l)})},t[6]=o,t[7]=a,t[8]=m,t[9]=c):(m=t[8],c=t[9]);let d;t[10]!==e.slug||t[11]!==i||t[12]!==m||t[13]!==c?(d={orgSlug:e.slug,onUpdate:i,onResync:m,onDelete:c},t[10]=e.slug,t[11]=i,t[12]=m,t[13]=c,t[14]=d):d=t[14],Co(d);let u;t[15]!==o||t[16]!==a?(u=l=>{const f=l.subject,j=l.data.status;o.cancelQueries({queryKey:a}),o.setQueryData(a,g=>g&&{...g,items:g.items.map(x=>x.threads.some(y=>y.threadId===f)?{...x,threads:x.threads.map(y=>y.threadId===f?{...y,status:j}:y)}:x)})},t[15]=o,t[16]=a,t[17]=u):u=t[17];let p;t[18]!==e.slug||t[19]!==u?(p={orgSlug:e.slug,onTaskStatus:u},t[18]=e.slug,t[19]=u,t[20]=p):p=t[20],Ps(p)}function gr(){const t=Y.c(9),{locator:e}=je(),n=kt();let o;t[0]!==e||t[1]!==n?(o=ko(e,n),t[0]=e,t[1]=n,t[2]=o):o=t[2];const r=rt(o);No();let a;t[3]!==r.data?.items?(a=r.data?.items??[],t[3]=r.data?.items,t[4]=a):a=t[4];let i;return t[5]!==r.error||t[6]!==r.isLoading||t[7]!==a?(i={items:a,isLoading:r.isLoading,error:r.error},t[5]=r.error,t[6]=r.isLoading,t[7]=a,t[8]=i):i=t[8],i}function hr(){const t=Y.c(70),{org:e,locator:n}=je(),o=kt(),r=it(),a=ae();let i;t[0]!==n?(i=ue.taskBoardItems(n),t[0]=n,t[1]=i):i=t[1];const m=i;let c;t[2]!==r||t[3]!==m?(c=()=>r.invalidateQueries({queryKey:m}),t[2]=r,t[3]=m,t[4]=c):c=t[4];const d=c;let u;t[5]!==o?(u=E=>o.call("TASK_BOARD_ITEM_CREATE",E),t[5]=o,t[6]=u):u=t[6];let p;t[7]!==d||t[8]!==u?(p={mutationFn:u,onSuccess:d},t[7]=d,t[8]=u,t[9]=p):p=t[9];const l=Oe(p);let f;t[10]!==o?(f=E=>o.call("TASK_BOARD_ITEM_UPDATE",E),t[10]=o,t[11]=f):f=t[11];let j;t[12]!==r||t[13]!==m?(j=async E=>{await r.cancelQueries({queryKey:m});const U=r.getQueryData(m);return r.setQueryData(m,M=>M&&{...M,items:M.items.map(Q=>Q.id===E.id?{...Q,...E}:Q)}),{previous:U}},t[12]=r,t[13]=m,t[14]=j):j=t[14];let g;t[15]!==e?(g=(E,U)=>{U.status==="done"&&ie("task_marked_done",{organization_id:e.id,task_board_item_id:U.id})},t[15]=e,t[16]=g):g=t[16];let x;t[17]!==r||t[18]!==m?(x=(E,U,M)=>{M?.previous&&r.setQueryData(m,M.previous)},t[17]=r,t[18]=m,t[19]=x):x=t[19];let y;t[20]!==d||t[21]!==n||t[22]!==r?(y=(E,U,M)=>{d(),r.invalidateQueries({queryKey:ue.taskBoardActivity(n,M.id)})},t[20]=d,t[21]=n,t[22]=r,t[23]=y):y=t[23];let S;t[24]!==f||t[25]!==j||t[26]!==g||t[27]!==x||t[28]!==y?(S={mutationFn:f,onMutate:j,onSuccess:g,onError:x,onSettled:y},t[24]=f,t[25]=j,t[26]=g,t[27]=x,t[28]=y,t[29]=S):S=t[29];const b=Oe(S);let k;t[30]!==o?(k=E=>o.call("TASK_BOARD_ITEM_DELETE",{id:E}),t[30]=o,t[31]=k):k=t[31];let v;t[32]!==d||t[33]!==a?(v=E=>{ce.error(E instanceof Error&&E.message?E.message:a("taskBoard.taskBoard.deleteError")),d()},t[32]=d,t[33]=a,t[34]=v):v=t[34];let C;t[35]!==d||t[36]!==k||t[37]!==v?(C={mutationFn:k,onSuccess:d,onError:v},t[35]=d,t[36]=k,t[37]=v,t[38]=C):C=t[38];const D=Oe(C);let h;t[39]!==o?(h=async E=>{const U=await Promise.allSettled(E.map(M=>o.call("TASK_BOARD_ITEM_DELETE",{id:M})));return{total:E.length,failed:U.filter(_o).length}},t[39]=o,t[40]=h):h=t[40];let _,w;t[41]!==a?(_=E=>{const{total:U,failed:M}=E;M!==0&&ce.error(a("taskBoard.taskBoard.deleteBulkError",{failed:String(M),total:String(U)}))},w=()=>ce.error(a("taskBoard.taskBoard.deleteError")),t[41]=a,t[42]=_,t[43]=w):(_=t[42],w=t[43]);let P;t[44]!==d||t[45]!==h||t[46]!==_||t[47]!==w?(P={mutationFn:h,onSuccess:_,onError:w,onSettled:d},t[44]=d,t[45]=h,t[46]=_,t[47]=w,t[48]=P):P=t[48];const V=Oe(P);let N;t[49]!==o?(N=E=>o.call("TASK_BOARD_ITEM_UPDATE",E),t[49]=o,t[50]=N):N=t[50];let T;t[51]!==d||t[52]!==N?(T={mutationFn:N,onSuccess:d},t[51]=d,t[52]=N,t[53]=T):T=t[53];const F=Oe(T);let $;t[54]!==o?($=E=>o.call("TASK_BOARD_ITEM_RERUN",E),t[54]=o,t[55]=$):$=t[55];let I;t[56]!==d||t[57]!==n||t[58]!==r?(I=(E,U,M)=>{d(),r.invalidateQueries({queryKey:ue.taskBoardActivity(n,M.id)})},t[56]=d,t[57]=n,t[58]=r,t[59]=I):I=t[59];let B;t[60]!==$||t[61]!==I?(B={mutationFn:$,onSettled:I},t[60]=$,t[61]=I,t[62]=B):B=t[62];const R=Oe(B);let G;return t[63]!==l||t[64]!==F||t[65]!==D||t[66]!==V||t[67]!==R||t[68]!==b?(G={create:l,update:b,remove:D,removeMany:V,link:F,rerun:R},t[63]=l,t[64]=F,t[65]=D,t[66]=V,t[67]=R,t[68]=b,t[69]=G):G=t[69],G}function _o(t){return t.status==="rejected"}const So=["ended_after_delivery","superseded"];function wo(t){return!!t&&So.includes(t)}function xr(t){return!(t.action==="status_changed"&&typeof t.data?.retry=="number")}function jr(t){return t.failureKind!=="superseded"}function jn(t){return t.threads.some(e=>e.status==="requires_action")}function yr(t){return t.status==="in_review"&&!t.assigneeId}function br(t){return jn(t)}function vr(t){return t.status==="in_progress"&&jn(t)?"text-warning animate-pulse":bn(t.status).iconClassName}function Cr(t){return t.threads.some(n=>n.status==="in_progress")?"running":t.threads.some(n=>n.status==="failed"&&!wo(n.failureKind))?"failed":null}function kr(t,e,n){const o=t.findIndex(u=>u.id===n),r=e===n?t[o+1]?.id??null:e,a=t.filter(u=>u.id!==n),i=r?a.findIndex(u=>u.id===r):-1,m=i===-1?a.length:i,c=a[m-1],d=a[m];return c&&d?(c.sortOrder+d.sortOrder)/2:c?c.sortOrder+1:d?d.sortOrder-1:0}function Nr(t,e){return Array.from({length:e},(n,o)=>t-(e-1-o)*1e-4)}const Do=["archived"],yn={triage:{labelKey:"taskBoard.config.statusBacklog",icon:$s,iconClassName:"text-muted-foreground"},todo:{labelKey:"taskBoard.config.statusTodo",icon:pn,iconClassName:"text-muted-foreground"},in_progress:{labelKey:"taskBoard.config.statusInProgress",icon:is,iconClassName:"text-primary"},in_review:{labelKey:"taskBoard.config.statusInReview",icon:zs,iconClassName:"text-warning"},approved:{labelKey:"taskBoard.config.statusApproved",icon:os,iconClassName:"text-success"},merged:{labelKey:"taskBoard.config.statusMerged",icon:fs,iconClassName:"text-primary"},post_deploy_validation:{labelKey:"taskBoard.config.statusPostDeployValidation",icon:ss,iconClassName:"text-warning"},done:{labelKey:"taskBoard.config.statusDone",icon:Ks,iconClassName:"text-success"},archived:{labelKey:"taskBoard.config.statusArchived",icon:Vn,iconClassName:"text-muted-foreground"}},To={icon:pn,iconClassName:"text-muted-foreground"},Fo=yn;function bn(t){return Fo[t]??To}function _r(t,e){const n=yn[t];return{label:n?e(n.labelKey):t,visual:bn(t)}}const Sr=["bug","feature","chore","spike","security"],wr={bug:{labelKey:"taskBoard.config.typeBug",icon:Qs,iconClassName:"text-destructive"},feature:{labelKey:"taskBoard.config.typeFeature",icon:ls,iconClassName:"text-success"},chore:{labelKey:"taskBoard.config.typeChore",icon:as,iconClassName:"text-muted-foreground"},spike:{labelKey:"taskBoard.config.typeSpike",icon:rs,iconClassName:"text-yellow-500"},security:{labelKey:"taskBoard.config.typeSecurity",icon:Us,iconClassName:"text-purple-500"}};function bt(t){return Bs.includes(t)}function Dr(t){return Nt.filter(e=>t||!bt(e))}function Tr({deliveryEnabled:t,shownLanes:e,occupied:n}){const o=Nt.filter(i=>t||!bt(i)||n.includes(i)),r=o.filter(i=>Do.includes(i)||!t&&bt(i)),a=r.filter(i=>!e.includes(i));return{lanes:o.filter(i=>!a.includes(i)),hidden:a,hideable:r}}const Qt="lane:";function Ao(t){return Nt.includes(t)}function Fr({overId:t,statusOf:e}){if(t===void 0)return null;const n=String(t),o=n.startsWith(Qt)?n.slice(Qt.length):e(n);return o!==void 0&&Ao(o)?o:null}const Bo=["none","low","medium","high","urgent"],We={none:{labelKey:"taskBoard.config.priorityNone",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50",icon:Vt,iconClassName:"text-muted-foreground/40"},low:{labelKey:"taskBoard.config.priorityLow",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40",icon:ns,iconClassName:"text-muted-foreground"},medium:{labelKey:"taskBoard.config.priorityMedium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500",icon:Vt,iconClassName:"text-blue-500"},high:{labelKey:"taskBoard.config.priorityHigh",flagClassName:"text-warning",dotClassName:"bg-warning",icon:ts,iconClassName:"text-warning"},urgent:{labelKey:"taskBoard.config.priorityUrgent",flagClassName:"text-destructive",dotClassName:"bg-destructive",icon:es,iconClassName:"text-destructive"}};function Ar(t,e=Date.now()){const n=new Date(t).getTime();return Number.isNaN(n)?null:n<e?"overdue":n-e<=Io*864e5?"soon":null}const Io=3;function qt(t){return`color-mix(in oklab, ${t??As} var(--user-color-strength), transparent)`}function vn(t){return t?.projects.length===1?t.projects[0]:void 0}function Po(t){return vn(t)?t.repo:t.projects.length>1?t.projects.map(e=>e.title).join(", "):null}function Cn(t){const e=Y.c(6),{entry:n}=t;let o;e[0]!==n?(o=vn(n),e[0]=n,e[1]=o):o=e[1];const r=o;if(r){let i;return e[2]!==r.icon||e[3]!==r.title?(i=s.jsx(Os,{icon:r.icon,name:r.title}),e[2]=r.icon,e[3]=r.title,e[4]=i):i=e[4],i}let a;return e[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:s.jsx(Ms,{className:"size-3"})}),e[5]=a):a=e[5],a}function Eo(t){const e=Y.c(14),{entry:n}=t;let o;e[0]!==n?(o=Po(n),e[0]=n,e[1]=o):o=e[1];const r=o;let a;e[2]!==n?(a=s.jsx(Cn,{entry:n}),e[2]=n,e[3]=a):a=e[3];let i;e[4]!==n.title?(i=s.jsx("span",{className:"truncate",children:n.title}),e[4]=n.title,e[5]=i):i=e[5];let m;e[6]!==r?(m=r&&s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:r}),e[6]=r,e[7]=m):m=e[7];let c;e[8]!==i||e[9]!==m?(c=s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[i,m]}),e[8]=i,e[9]=m,e[10]=c):c=e[10];let d;return e[11]!==a||e[12]!==c?(d=s.jsxs(s.Fragment,{children:[a,c]}),e[11]=a,e[12]=c,e[13]=d):d=e[13],d}const at="__no_repo__";function Se(t){return(t??"").trim().toLowerCase()}function Vo(t,e){const n=(t.created_at??"").localeCompare(e.created_at??"");return n!==0?n:t.id.localeCompare(e.id)}function Mo(t){return t.projects.length===1?t.projects[0]?.title??t.repo??t.id:t.repo??t.id}function Br(t,e=[]){const n=new Map,o=new Map,r=[],a=u=>{const p=Se(u),l=n.get(p);if(l)return l;const f={id:p,kind:"repo",repo:u.trim(),title:u.trim(),projects:[]};return n.set(p,f),f};for(const u of t){const p=Ls(u);if(p){const f=a(p);f.projects.push(u),o.set(u.id,f);continue}const l={id:u.id,kind:"project",repo:null,title:u.title,projects:[u]};r.push(l),o.set(u.id,l)}for(const u of e){const p=(u??"").trim();p&&a(p)}for(const u of n.values())u.projects.sort(Vo),u.title=Mo(u);const i=[...n.values()].filter(u=>u.projects.length>0),m=[...n.values()].filter(u=>u.projects.length===0),c=(u,p)=>u.title.localeCompare(p.title),d=[...[...i,...r].sort(c),...m.sort(c)];return{entries:d,byId:new Map(d.map(u=>[u.id,u])),byRepo:n,byProject:o}}function vt(t,e){for(const o of t.threads??[]){const r=o.virtualMcpId?e.byProject.get(o.virtualMcpId):void 0;if(r)return r}const n=Se(t.repo);return(n?e.byRepo.get(n):void 0)??null}function Oo(t,e){const n=vt(t,e);if(!n)return[];if(n.projects.length<=1)return n.projects;for(const o of t.threads??[]){const r=o.virtualMcpId?n.projects.find(a=>a.id===o.virtualMcpId):void 0;if(r)return[r]}return n.projects}function Ir(t,e){const n=Oo(t,e);return n.length===1?n[0]??null:null}function Pt(t,e){return e.byId.get(t)??e.byRepo.get(Se(t))??e.byProject.get(t)}function kn(t,e,n){if(e===null)return!0;if(e===at)return vt(t,n)===null;const o=Pt(e,n);return o?o.repo&&Se(t.repo)===Se(o.repo)?!0:vt(t,n)===o:e.includes("/")?Se(t.repo)===Se(e):!0}function lt(t,e){return t===null?!1:t===at?!0:!!Pt(t,e)||t.includes("/")}function Pr(t,e,n){return e===null?null:kn(t,e,n)?e:null}function Er(t){return t.entries.filter(e=>e.repo!==null&&(e.projects.length===0||e.projects.some(n=>Rs(n).status!=="detached")))}const Ct="__unassigned__",Re="__any__",Nn={assignee:null,priority:null,due:null,tags:[],project:null,search:""};function Lo(t,e){return t.assignee!==null||t.priority!==null||t.due!==null||t.tags.length>0||lt(t.project,e)||t.search.trim()!==""}function Ro(t,e){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)+(t.tags.length>0?1:0)+(lt(t.project,e)?1:0)+(t.search.trim()!==""?1:0)}const $o=864e5;function Ko(t,e){const n=new Date(t),o=new Date(e);return n.getFullYear()===o.getFullYear()&&n.getMonth()===o.getMonth()&&n.getDate()===o.getDate()}function _n(t,e){const n=t.trim();return n===""?!1:e!=null&&ao(n)===e}function zo(t,e){return t.assigneeId===e?!0:t.assigneeId===yt&&t.assignedBy===e}function Vr(t,e,n){const o=e.search.trim().toLowerCase();if(o!==""&&!`${t.title} ${t.description??""}`.toLowerCase().includes(o)&&!_n(o,t.keySeq))return!1;if(e.assignee!==null){if(e.assignee===Ct){if(t.assigneeId!==null)return!1}else if(!zo(t,e.assignee))return!1}if(e.priority!==null&&t.priority!==e.priority)return!1;if(e.due!==null)if(e.due==="none"){if(t.dueDate)return!1}else{if(!t.dueDate)return!1;const r=new Date(t.dueDate).getTime(),a=Date.now();if(e.due==="overdue"&&r>=a||e.due==="today"&&!Ko(r,a)||e.due==="week"&&(r<a||r>a+7*$o))return!1}if(e.tags.length>0){const r=t.tags.map(a=>a.id);if(!e.tags.some(a=>r.includes(a)))return!1}return!!kn(t,e.project,n)}const Gt={overdue:"taskBoard.taskFilters.dueDateFilterOverdue",today:"taskBoard.taskFilters.dueDateFilterDueToday",week:"taskBoard.taskFilters.dueDateFilterDueThisWeek",none:"taskBoard.taskFilters.dueDateFilterNoDueDate"};function we(t,e=!1){return re("inline-flex h-8 items-center gap-1.5 rounded-lg border px-2.5 text-xs font-medium outline-none transition-colors focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/20",e&&"h-10 w-full justify-start px-3 text-sm",t?"border-transparent bg-accent text-foreground":"border-border text-muted-foreground hover:bg-muted/60 hover:text-foreground")}function Uo(t){const e=Y.c(107),{value:n,members:o,onChange:r,block:a}=t,i=ae(),[m,c]=H.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Rt,{size:14,className:"shrink-0"}),e[0]=d):d=e[0];let u=d,p;e[1]!==i?(p=i("taskBoard.taskFilters.assigneeLabel"),e[1]=i,e[2]=p):p=e[2];let l=p;if(n===Ct){let O;e[3]!==i?(O=i("taskBoard.taskFilters.assigneeUnassigned"),e[3]=i,e[4]=O):O=e[4],l=O}else if(n===yt){let O;e[5]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(zt,{size:14}),e[5]=O):O=e[5],u=O;let L;e[6]!==i?(L=i("taskBoard.taskFilters.assigneeSuperAgent"),e[6]=i,e[7]=L):L=e[7],l=L}else if(n){let O,L,oe,z;if(e[8]!==o||e[9]!==n){let De;e[14]!==n?(De=Te=>Te.userId===n,e[14]=n,e[15]=De):De=e[15],L=o.find(De),O=Lt,oe=L?.user?.image??void 0,z=$t(L?.user?.name),e[8]=o,e[9]=n,e[10]=O,e[11]=L,e[12]=oe,e[13]=z}else O=e[10],L=e[11],oe=e[12],z=e[13];let ve;e[16]!==O||e[17]!==oe||e[18]!==z?(ve=s.jsx(O,{url:oe,fallback:z,shape:"circle",size:"2xs"}),e[16]=O,e[17]=oe,e[18]=z,e[19]=ve):ve=e[19],u=ve;let de;e[20]!==L?.user?.name||e[21]!==i?(de=L?.user?.name??i("taskBoard.taskFilters.assigneeMember"),e[20]=L?.user?.name,e[21]=i,e[22]=de):de=e[22],l=de}let f;e[23]!==r?(f=O=>{r(O),c(!1)},e[23]=r,e[24]=f):f=e[24];const j=f,g=n!==null;let x;e[25]!==a||e[26]!==g?(x=we(g,a),e[25]=a,e[26]=g,e[27]=x):x=e[27];const y=x,S=a&&"ml-auto";let b;e[28]!==S?(b=re("shrink-0 opacity-60",S),e[28]=S,e[29]=b):b=e[29];const k=b;let v;e[30]!==l?(v=s.jsx("span",{className:"max-w-[10rem] truncate",children:l}),e[30]=l,e[31]=v):v=e[31];let C;e[32]!==k?(C=s.jsx(ze,{size:12,className:k}),e[32]=k,e[33]=C):C=e[33];let D;e[34]!==u||e[35]!==v||e[36]!==C||e[37]!==y?(D=s.jsx(_t,{asChild:!0,children:s.jsxs("button",{type:"button",className:y,children:[u,v,C]})}),e[34]=u,e[35]=v,e[36]=C,e[37]=y,e[38]=D):D=e[38];let h;e[39]!==i?(h=i("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[39]=i,e[40]=h):h=e[40];let _;e[41]!==i?(_=i("taskBoard.taskFilters.assigneeFilterPlaceholder"),e[41]=i,e[42]=_):_=e[42];let w;e[43]!==h||e[44]!==_?(w=s.jsx(Dt,{placeholder:h,"aria-label":_,className:"h-9"}),e[43]=h,e[44]=_,e[45]=w):w=e[45];let P;e[46]!==i?(P=i("taskBoard.taskFilters.assigneeNoMembersFound"),e[46]=i,e[47]=P):P=e[47];let V;e[48]!==P?(V=s.jsx(Tt,{children:P}),e[48]=P,e[49]=V):V=e[49];let N;e[50]!==i?(N=i("taskBoard.taskFilters.assigneeAnyone"),e[50]=i,e[51]=N):N=e[51];let T;e[52]!==j?(T=()=>j(null),e[52]=j,e[53]=T):T=e[53];let F;e[54]!==i?(F=i("taskBoard.taskFilters.assigneeAnyone"),e[54]=i,e[55]=F):F=e[55];let $;e[56]!==N||e[57]!==T||e[58]!==F?($=s.jsx(Ce,{value:N,onSelect:T,children:F}),e[56]=N,e[57]=T,e[58]=F,e[59]=$):$=e[59];let I;e[60]!==i?(I=i("taskBoard.taskFilters.assigneeUnassigned"),e[60]=i,e[61]=I):I=e[61];let B;e[62]!==j?(B=()=>j(Ct),e[62]=j,e[63]=B):B=e[63];let R;e[64]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Rt,{size:16,className:"text-muted-foreground"}),e[64]=R):R=e[64];let G;e[65]!==i?(G=i("taskBoard.taskFilters.assigneeUnassigned"),e[65]=i,e[66]=G):G=e[66];let E;e[67]!==I||e[68]!==B||e[69]!==G?(E=s.jsxs(Ce,{value:I,onSelect:B,className:"gap-2",children:[R,G]}),e[67]=I,e[68]=B,e[69]=G,e[70]=E):E=e[70];let U;e[71]!==i?(U=i("taskBoard.taskFilters.assigneeSuperAgent"),e[71]=i,e[72]=U):U=e[72];let M;e[73]!==j?(M=()=>j(yt),e[73]=j,e[74]=M):M=e[74];let Q;e[75]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(zt,{size:16}),e[75]=Q):Q=e[75];let Z;e[76]!==i?(Z=i("taskBoard.taskFilters.assigneeSuperAgent"),e[76]=i,e[77]=Z):Z=e[77];let ee;e[78]!==U||e[79]!==M||e[80]!==Z?(ee=s.jsxs(Ce,{value:U,onSelect:M,className:"gap-2",children:[Q,Z]}),e[78]=U,e[79]=M,e[80]=Z,e[81]=ee):ee=e[81];let K;e[82]!==$||e[83]!==E||e[84]!==ee?(K=s.jsxs(Le,{children:[$,E,ee]}),e[82]=$,e[83]=E,e[84]=ee,e[85]=K):K=e[85];let ne;e[86]!==i?(ne=i("taskBoard.taskFilters.assigneeGroupMembers"),e[86]=i,e[87]=ne):ne=e[87];let W;if(e[88]!==o||e[89]!==j){let O;e[91]!==j?(O=L=>s.jsxs(Ce,{value:L.user?.name??L.userId,onSelect:()=>j(L.userId),className:"gap-2",children:[s.jsx(Lt,{url:L.user?.image??void 0,fallback:$t(L.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate",children:L.user?.name??L.userId})]},L.userId),e[91]=j,e[92]=O):O=e[92],W=o.map(O),e[88]=o,e[89]=j,e[90]=W}else W=e[90];let X;e[93]!==ne||e[94]!==W?(X=s.jsx(Le,{heading:ne,children:W}),e[93]=ne,e[94]=W,e[95]=X):X=e[95];let J;e[96]!==V||e[97]!==K||e[98]!==X?(J=s.jsxs(Ft,{children:[V,K,X]}),e[96]=V,e[97]=K,e[98]=X,e[99]=J):J=e[99];let te;e[100]!==w||e[101]!==J?(te=s.jsx(St,{align:"start",className:"w-56 p-0",children:s.jsxs(At,{children:[w,J]})}),e[100]=w,e[101]=J,e[102]=te):te=e[102];let se;return e[103]!==m||e[104]!==D||e[105]!==te?(se=s.jsxs(wt,{open:m,onOpenChange:c,children:[D,te]}),e[103]=m,e[104]=D,e[105]=te,e[106]=se):se=e[106],se}function Qo(t){const e=Y.c(33),{value:n,onChange:o,block:r}=t,a=ae(),i=n!==null;let m;e[0]!==r||e[1]!==i?(m=we(i,r),e[0]=r,e[1]=i,e[2]=m):m=e[2];const c=m,d=r&&"ml-auto";let u;e[3]!==d?(u=re("shrink-0 opacity-60",d),e[3]=d,e[4]=u):u=e[4];const p=u;let l;e[5]!==n?(l=n?s.jsx("span",{className:re("size-2 shrink-0 rounded-full",We[n].dotClassName)}):s.jsx(Es,{size:14,className:"shrink-0"}),e[5]=n,e[6]=l):l=e[6];let f;e[7]!==a||e[8]!==n?(f=a(n?We[n].labelKey:"taskBoard.taskFilters.priorityLabel"),e[7]=a,e[8]=n,e[9]=f):f=e[9];let j;e[10]!==p?(j=s.jsx(ze,{size:12,className:p}),e[10]=p,e[11]=j):j=e[11];let g;e[12]!==l||e[13]!==f||e[14]!==j||e[15]!==c?(g=s.jsx(dn,{asChild:!0,children:s.jsxs("button",{type:"button",className:c,children:[l,f,j]})}),e[12]=l,e[13]=f,e[14]=j,e[15]=c,e[16]=g):g=e[16];const x=n??Re;let y;e[17]!==o?(y=D=>o(D===Re?null:D),e[17]=o,e[18]=y):y=e[18];let S;e[19]!==a?(S=a("taskBoard.taskFilters.priorityAnyPriority"),e[19]=a,e[20]=S):S=e[20];let b;e[21]!==S?(b=s.jsx(ot,{value:Re,children:S}),e[21]=S,e[22]=b):b=e[22];let k;e[23]!==a?(k=Bo.map(D=>s.jsxs(ot,{value:D,className:"gap-2",children:[s.jsx("span",{className:re("size-2 rounded-full",We[D].dotClassName)}),a(We[D].labelKey)]},D)),e[23]=a,e[24]=k):k=e[24];let v;e[25]!==y||e[26]!==b||e[27]!==k||e[28]!==x?(v=s.jsx(un,{align:"start",className:"w-40",children:s.jsxs(fn,{value:x,onValueChange:y,children:[b,k]})}),e[25]=y,e[26]=b,e[27]=k,e[28]=x,e[29]=v):v=e[29];let C;return e[30]!==v||e[31]!==g?(C=s.jsxs(mn,{children:[g,v]}),e[30]=v,e[31]=g,e[32]=C):C=e[32],C}function qo(t){const e=Y.c(35),{value:n,onChange:o,block:r}=t,a=ae();let i;e[0]!==a||e[1]!==n?(i=n?a(Gt[n]):void 0,e[0]=a,e[1]=n,e[2]=i):i=e[2];const m=i,c=n!==null;let d;e[3]!==r||e[4]!==c?(d=we(c,r),e[3]=r,e[4]=c,e[5]=d):d=e[5];const u=d,p=r&&"ml-auto";let l;e[6]!==p?(l=re("shrink-0 opacity-60",p),e[6]=p,e[7]=l):l=e[7];const f=l;let j;e[8]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(xt,{size:14,className:"shrink-0"}),e[8]=j):j=e[8];let g;e[9]!==m||e[10]!==a?(g=m??a("taskBoard.taskFilters.dueDateLabel"),e[9]=m,e[10]=a,e[11]=g):g=e[11];let x;e[12]!==f?(x=s.jsx(ze,{size:12,className:f}),e[12]=f,e[13]=x):x=e[13];let y;e[14]!==g||e[15]!==x||e[16]!==u?(y=s.jsx(dn,{asChild:!0,children:s.jsxs("button",{type:"button",className:u,children:[j,g,x]})}),e[14]=g,e[15]=x,e[16]=u,e[17]=y):y=e[17];const S=n??Re;let b;e[18]!==o?(b=w=>o(w===Re?null:w),e[18]=o,e[19]=b):b=e[19];let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(xt,{size:16,className:"text-muted-foreground"}),e[20]=k):k=e[20];let v;e[21]!==a?(v=a("taskBoard.taskFilters.dueDateAnyTime"),e[21]=a,e[22]=v):v=e[22];let C;e[23]!==v?(C=s.jsxs(ot,{value:Re,className:"gap-2",children:[k,v]}),e[23]=v,e[24]=C):C=e[24];let D;e[25]!==a?(D=Object.entries(Gt).map(w=>{const[P,V]=w,N=P==="overdue";return s.jsxs(ot,{value:P,className:re("gap-2",N&&"text-destructive"),children:[s.jsx(xt,{size:16,className:re("shrink-0",N?"text-destructive":"text-muted-foreground")}),a(V)]},P)}),e[25]=a,e[26]=D):D=e[26];let h;e[27]!==S||e[28]!==b||e[29]!==C||e[30]!==D?(h=s.jsx(un,{align:"start",className:"w-44",children:s.jsxs(fn,{value:S,onValueChange:b,children:[C,D]})}),e[27]=S,e[28]=b,e[29]=C,e[30]=D,e[31]=h):h=e[31];let _;return e[32]!==h||e[33]!==y?(_=s.jsxs(mn,{children:[y,h]}),e[32]=h,e[33]=y,e[34]=_):_=e[34],_}function Go(t){const e=Y.c(56),{value:n,tags:o,onChange:r,block:a}=t,i=ae(),[m,c]=H.useState(!1);let d;e[0]!==r||e[1]!==n?(d=I=>r(n.includes(I)?n.filter(B=>B!==I):[...n,I]),e[0]=r,e[1]=n,e[2]=d):d=e[2];const u=d;let p;e[3]!==i||e[4]!==o||e[5]!==n[0]||e[6]!==n.length?(p=n.length===0?i("taskBoard.taskFilters.tagsLabel"):n.length===1?o.find(I=>I.id===n[0])?.name??i("taskBoard.taskFilters.tagsLabel"):i("taskBoard.taskFilters.tagsSelectedCount",{count:n.length}),e[3]=i,e[4]=o,e[5]=n[0],e[6]=n.length,e[7]=p):p=e[7];const l=p,f=n.length>0;let j;e[8]!==a||e[9]!==f?(j=we(f,a),e[8]=a,e[9]=f,e[10]=j):j=e[10];const g=j,x=a&&"ml-auto";let y;e[11]!==x?(y=re("shrink-0 opacity-60",x),e[11]=x,e[12]=y):y=e[12];const S=y;let b;e[13]!==o||e[14]!==n[0]||e[15]!==n.length?(b=n.length===1?s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:qt(o.find(I=>I.id===n[0])?.color)}}):s.jsx(cs,{size:14,className:"shrink-0"}),e[13]=o,e[14]=n[0],e[15]=n.length,e[16]=b):b=e[16];let k;e[17]!==l?(k=s.jsx("span",{className:"max-w-[10rem] truncate",children:l}),e[17]=l,e[18]=k):k=e[18];let v;e[19]!==S?(v=s.jsx(ze,{size:12,className:S}),e[19]=S,e[20]=v):v=e[20];let C;e[21]!==b||e[22]!==k||e[23]!==v||e[24]!==g?(C=s.jsx(_t,{asChild:!0,children:s.jsxs("button",{type:"button",className:g,children:[b,k,v]})}),e[21]=b,e[22]=k,e[23]=v,e[24]=g,e[25]=C):C=e[25];let D;e[26]!==i?(D=i("taskBoard.taskFilters.tagsFilterPlaceholder"),e[26]=i,e[27]=D):D=e[27];let h;e[28]!==i?(h=i("taskBoard.taskFilters.tagsFilterPlaceholder"),e[28]=i,e[29]=h):h=e[29];let _;e[30]!==D||e[31]!==h?(_=s.jsx(Dt,{placeholder:D,"aria-label":h,className:"h-9"}),e[30]=D,e[31]=h,e[32]=_):_=e[32];let w;e[33]!==i?(w=i("taskBoard.taskFilters.tagsNoTagsFound"),e[33]=i,e[34]=w):w=e[34];let P;e[35]!==w?(P=s.jsx(Tt,{children:w}),e[35]=w,e[36]=P):P=e[36];let V;if(e[37]!==o||e[38]!==u||e[39]!==n){let I;e[41]!==u||e[42]!==n?(I=B=>s.jsxs(Ce,{value:B.name,onSelect:()=>u(B.id),className:"gap-2",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:qt(B.color)}}),s.jsx("span",{className:"flex-1 truncate",children:B.name}),n.includes(B.id)&&s.jsx(nt,{size:14,className:"shrink-0 text-foreground"})]},B.id),e[41]=u,e[42]=n,e[43]=I):I=e[43],V=o.map(I),e[37]=o,e[38]=u,e[39]=n,e[40]=V}else V=e[40];let N;e[44]!==V?(N=s.jsx(Le,{children:V}),e[44]=V,e[45]=N):N=e[45];let T;e[46]!==P||e[47]!==N?(T=s.jsxs(Ft,{children:[P,N]}),e[46]=P,e[47]=N,e[48]=T):T=e[48];let F;e[49]!==_||e[50]!==T?(F=s.jsx(St,{align:"start",className:"w-56 p-0",children:s.jsxs(At,{children:[_,T]})}),e[49]=_,e[50]=T,e[51]=F):F=e[51];let $;return e[52]!==m||e[53]!==C||e[54]!==F?($=s.jsxs(wt,{open:m,onOpenChange:c,children:[C,F]}),e[52]=m,e[53]=C,e[54]=F,e[55]=$):$=e[55],$}function Ht(t){const e=Y.c(11),{entry:n,selected:o,onSelect:r}=t,a=n.id,i=n.title;let m;e[0]!==n.projects?(m=n.projects.map(Ho).join(" "),e[0]=n.projects,e[1]=m):m=e[1];const c=`${a} ${i} ${n.repo??""} ${m}`;let d;e[2]!==n?(d=s.jsx(Eo,{entry:n}),e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o?(u=o&&s.jsx(nt,{size:14,className:"shrink-0 text-foreground"}),e[4]=o,e[5]=u):u=e[5];let p;return e[6]!==r||e[7]!==c||e[8]!==d||e[9]!==u?(p=s.jsxs(Ce,{value:c,onSelect:r,className:"gap-2",children:[d,u]}),e[6]=r,e[7]=c,e[8]=d,e[9]=u,e[10]=p):p=e[10],p}function Ho(t){return t.title}function Yo(t,e,n,o){return t===null||!n?o("taskBoard.taskFilters.projectLabel"):t===at?o("taskBoard.taskFilters.projectNone"):e?.title??t}function Wo(t){const e=Y.c(90),{value:n,index:o,onChange:r,block:a}=t,i=ae(),[m,c]=H.useState(!1);let d,u,p,l,f,j,g,x,y,S,b,k,v,C;if(e[0]!==a||e[1]!==o||e[2]!==r||e[3]!==m||e[4]!==i||e[5]!==n){const P=n===null?void 0:Pt(n,o),V=lt(n,o),N=Yo(n,P,V,i);let T;e[20]!==r?(T=z=>{r(z),c(!1)},e[20]=r,e[21]=T):T=e[21];const F=T,$=o.entries.filter(Jo),I=o.entries.filter(Xo),B=we(V,a),R=a&&"ml-auto";let G;e[22]!==R?(G=re("shrink-0 opacity-60",R),e[22]=R,e[23]=G):G=e[23];const E=G;l=wt,v=m,C=c;const U=V?P:void 0;let M;e[24]!==U?(M=s.jsx(Cn,{entry:U}),e[24]=U,e[25]=M):M=e[25];let Q;e[26]!==N?(Q=s.jsx("span",{className:"max-w-[12rem] truncate",children:N}),e[26]=N,e[27]=Q):Q=e[27];let Z;e[28]!==E?(Z=s.jsx(ze,{size:12,className:E}),e[28]=E,e[29]=Z):Z=e[29],e[30]!==M||e[31]!==Q||e[32]!==Z||e[33]!==B?(j=s.jsx(_t,{asChild:!0,children:s.jsxs("button",{type:"button",className:B,children:[M,Q,Z]})}),e[30]=M,e[31]=Q,e[32]=Z,e[33]=B,e[34]=j):j=e[34],p=St,b="start",k="w-72 p-0",u=At;let ee;e[35]!==i?(ee=i("taskBoard.taskFilters.projectFilterPlaceholder"),e[35]=i,e[36]=ee):ee=e[36];let K;e[37]!==i?(K=i("taskBoard.taskFilters.projectFilterPlaceholder"),e[37]=i,e[38]=K):K=e[38],e[39]!==ee||e[40]!==K?(S=s.jsx(Dt,{placeholder:ee,"aria-label":K,className:"h-9"}),e[39]=ee,e[40]=K,e[41]=S):S=e[41],d=Ft;let ne;e[42]!==i?(ne=i("taskBoard.taskFilters.projectNoneFound"),e[42]=i,e[43]=ne):ne=e[43],e[44]!==ne?(f=s.jsx(Tt,{children:ne}),e[44]=ne,e[45]=f):f=e[45];let W;e[46]!==i?(W=i("taskBoard.taskFilters.projectAny"),e[46]=i,e[47]=W):W=e[47];let X;e[48]!==F?(X=()=>F(null),e[48]=F,e[49]=X):X=e[49];let J;e[50]!==i?(J=i("taskBoard.taskFilters.projectAny"),e[50]=i,e[51]=J):J=e[51];let te;e[52]!==W||e[53]!==X||e[54]!==J?(te=s.jsx(Ce,{value:W,onSelect:X,children:J}),e[52]=W,e[53]=X,e[54]=J,e[55]=te):te=e[55];let se;e[56]!==i?(se=i("taskBoard.taskFilters.projectNone"),e[56]=i,e[57]=se):se=e[57];let O;e[58]!==F?(O=()=>F(at),e[58]=F,e[59]=O):O=e[59];let L;e[60]!==i?(L=i("taskBoard.taskFilters.projectNone"),e[60]=i,e[61]=L):L=e[61];let oe;e[62]!==se||e[63]!==O||e[64]!==L?(oe=s.jsx(Ce,{value:se,onSelect:O,children:L}),e[62]=se,e[63]=O,e[64]=L,e[65]=oe):oe=e[65],e[66]!==te||e[67]!==oe?(g=s.jsxs(Le,{children:[te,oe]}),e[66]=te,e[67]=oe,e[68]=g):g=e[68],x=$.length>0&&s.jsx(Le,{heading:i("taskBoard.taskFilters.projectGroupProjects"),children:$.map(z=>s.jsx(Ht,{entry:z,selected:P===z,onSelect:()=>F(z.id)},z.id))}),y=I.length>0&&s.jsx(Le,{heading:i("taskBoard.taskFilters.projectGroupRepos"),children:I.map(z=>s.jsx(Ht,{entry:z,selected:P===z,onSelect:()=>F(z.id)},z.id))}),e[0]=a,e[1]=o,e[2]=r,e[3]=m,e[4]=i,e[5]=n,e[6]=d,e[7]=u,e[8]=p,e[9]=l,e[10]=f,e[11]=j,e[12]=g,e[13]=x,e[14]=y,e[15]=S,e[16]=b,e[17]=k,e[18]=v,e[19]=C}else d=e[6],u=e[7],p=e[8],l=e[9],f=e[10],j=e[11],g=e[12],x=e[13],y=e[14],S=e[15],b=e[16],k=e[17],v=e[18],C=e[19];let D;e[69]!==d||e[70]!==f||e[71]!==g||e[72]!==x||e[73]!==y?(D=s.jsxs(d,{children:[f,g,x,y]}),e[69]=d,e[70]=f,e[71]=g,e[72]=x,e[73]=y,e[74]=D):D=e[74];let h;e[75]!==u||e[76]!==D||e[77]!==S?(h=s.jsxs(u,{children:[S,D]}),e[75]=u,e[76]=D,e[77]=S,e[78]=h):h=e[78];let _;e[79]!==p||e[80]!==h||e[81]!==b||e[82]!==k?(_=s.jsx(p,{align:b,className:k,children:h}),e[79]=p,e[80]=h,e[81]=b,e[82]=k,e[83]=_):_=e[83];let w;return e[84]!==l||e[85]!==j||e[86]!==_||e[87]!==v||e[88]!==C?(w=s.jsxs(l,{open:v,onOpenChange:C,children:[j,_]}),e[84]=l,e[85]=j,e[86]=_,e[87]=v,e[88]=C,e[89]=w):w=e[89],w}function Xo(t){return t.projects.length===0}function Jo(t){return t.projects.length>0}function Zo(t){const e=Y.c(25),{value:n,onChange:o,block:r}=t,a=ae(),[i,m]=H.useState(n!==""),[c,d]=H.useState(!1),[u,p]=H.useState(n);n!==u&&(p(n),n===""&&!c&&m(!1));const l=i||r,f=l?"w-32 sm:w-44":"w-8 px-0 justify-center",j=r&&"h-10 w-full px-3 text-sm sm:w-full";let g;e[0]!==f||e[1]!==j?(g=re("inline-flex h-8 shrink-0 items-center gap-1.5 overflow-hidden rounded-lg border border-border px-2.5 text-xs text-foreground transition-all duration-200 ease-out",f,j),e[0]=f,e[1]=j,e[2]=g):g=e[2];let x;e[3]!==a?(x=a("taskBoard.taskFilters.searchLabel"),e[3]=a,e[4]=x):x=e[4];let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=()=>m(!0),e[5]=y):y=e[5];let S;e[6]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(ds,{size:14}),e[6]=S):S=e[6];let b;e[7]!==x?(b=s.jsx("button",{type:"button","aria-label":x,onClick:y,className:"shrink-0 text-muted-foreground transition-colors hover:text-foreground",children:S}),e[7]=x,e[8]=b):b=e[8];let k;e[9]!==r||e[10]!==l||e[11]!==o||e[12]!==a||e[13]!==n?(k=l&&s.jsx("input",{autoFocus:!r,value:n,onChange:D=>o(D.target.value),onFocus:()=>d(!0),onBlur:()=>{d(!1),n===""&&m(!1)},placeholder:a("taskBoard.taskFilters.searchPlaceholder"),"aria-label":a("taskBoard.taskFilters.searchPlaceholder"),className:"w-full min-w-0 bg-transparent text-xs outline-none placeholder:text-muted-foreground"}),e[9]=r,e[10]=l,e[11]=o,e[12]=a,e[13]=n,e[14]=k):k=e[14];let v;e[15]!==r||e[16]!==o||e[17]!==a||e[18]!==n?(v=n!==""&&s.jsx("button",{type:"button","aria-label":a("taskBoard.taskFilters.searchClearLabel"),onMouseDown:ei,onClick:()=>{o(""),r||m(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:s.jsx(Mn,{size:14})}),e[15]=r,e[16]=o,e[17]=a,e[18]=n,e[19]=v):v=e[19];let C;return e[20]!==g||e[21]!==b||e[22]!==k||e[23]!==v?(C=s.jsxs("div",{className:g,children:[b,k,v]}),e[20]=g,e[21]=b,e[22]=k,e[23]=v,e[24]=C):C=e[24],C}function ei(t){return t.preventDefault()}function ti(t){const e=Y.c(20),{block:n,onClick:o}=t,r=ae();let a;e[0]!==r?(a=r("taskBoard.taskFilters.boardSettingsLabel"),e[0]=r,e[1]=a):a=e[1];const i=a;let m;e[2]!==n?(m=re(we(!1,n),n?"h-10 w-full":"w-8 justify-center px-0"),e[2]=n,e[3]=m):m=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Vs,{size:14,className:"shrink-0"}),e[4]=c):c=e[4];let d;e[5]!==n||e[6]!==i?(d=n&&s.jsx("span",{children:i}),e[5]=n,e[6]=i,e[7]=d):d=e[7];let u;e[8]!==i||e[9]!==o||e[10]!==m||e[11]!==d?(u=s.jsxs("button",{type:"button",onClick:o,"aria-label":i,className:m,children:[c,d]}),e[8]=i,e[9]=o,e[10]=m,e[11]=d,e[12]=u):u=e[12];const p=u;if(n)return p;let l;e[13]!==p?(l=s.jsx(Ze,{asChild:!0,children:p}),e[13]=p,e[14]=l):l=e[14];let f;e[15]!==i?(f=s.jsx(et,{side:"top",children:i}),e[15]=i,e[16]=f):f=e[16];let j;return e[17]!==l||e[18]!==f?(j=s.jsxs(Je,{children:[l,f]}),e[17]=l,e[18]=f,e[19]=j):j=e[19],j}function Sn(t){const e=Y.c(53),{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m,block:c}=t;let d;e[0]!==n||e[1]!==i?(d=C=>i({...n,search:C}),e[0]=n,e[1]=i,e[2]=d):d=e[2];let u;e[3]!==c||e[4]!==n.search||e[5]!==d?(u=s.jsx(Zo,{block:c,value:n.search,onChange:d}),e[3]=c,e[4]=n.search,e[5]=d,e[6]=u):u=e[6];let p;e[7]!==n||e[8]!==i?(p=C=>i({...n,assignee:C}),e[7]=n,e[8]=i,e[9]=p):p=e[9];let l;e[10]!==c||e[11]!==n.assignee||e[12]!==o||e[13]!==p?(l=s.jsx(Uo,{block:c,value:n.assignee,members:o,onChange:p}),e[10]=c,e[11]=n.assignee,e[12]=o,e[13]=p,e[14]=l):l=e[14];let f;e[15]!==n||e[16]!==i?(f=C=>i({...n,priority:C}),e[15]=n,e[16]=i,e[17]=f):f=e[17];let j;e[18]!==c||e[19]!==n.priority||e[20]!==f?(j=s.jsx(Qo,{block:c,value:n.priority,onChange:f}),e[18]=c,e[19]=n.priority,e[20]=f,e[21]=j):j=e[21];let g;e[22]!==n||e[23]!==i?(g=C=>i({...n,due:C}),e[22]=n,e[23]=i,e[24]=g):g=e[24];let x;e[25]!==c||e[26]!==n.due||e[27]!==g?(x=s.jsx(qo,{block:c,value:n.due,onChange:g}),e[25]=c,e[26]=n.due,e[27]=g,e[28]=x):x=e[28];let y;e[29]!==n||e[30]!==i?(y=C=>i({...n,tags:C}),e[29]=n,e[30]=i,e[31]=y):y=e[31];let S;e[32]!==c||e[33]!==n.tags||e[34]!==y||e[35]!==r?(S=s.jsx(Go,{block:c,value:n.tags,tags:r,onChange:y}),e[32]=c,e[33]=n.tags,e[34]=y,e[35]=r,e[36]=S):S=e[36];let b;e[37]!==c||e[38]!==n||e[39]!==a||e[40]!==i?(b=(a.entries.length>0||lt(n.project,a))&&s.jsx(Wo,{block:c,value:n.project,index:a,onChange:C=>i({...n,project:C})}),e[37]=c,e[38]=n,e[39]=a,e[40]=i,e[41]=b):b=e[41];let k;e[42]!==c||e[43]!==m?(k=s.jsx(ti,{block:c,onClick:m}),e[42]=c,e[43]=m,e[44]=k):k=e[44];let v;return e[45]!==S||e[46]!==b||e[47]!==k||e[48]!==u||e[49]!==l||e[50]!==j||e[51]!==x?(v=s.jsxs(s.Fragment,{children:[u,l,j,x,S,b,k]}),e[45]=S,e[46]=b,e[47]=k,e[48]=u,e[49]=l,e[50]=j,e[51]=x,e[52]=v):v=e[52],v}function Mr(t){const e=Y.c(16),{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m}=t,c=ae();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(cn,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=d):d=e[0];let u;e[1]!==n||e[2]!==a||e[3]!==o||e[4]!==i||e[5]!==m||e[6]!==r?(u=s.jsx(Sn,{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m}),e[1]=n,e[2]=a,e[3]=o,e[4]=i,e[5]=m,e[6]=r,e[7]=u):u=e[7];let p;e[8]!==n||e[9]!==a||e[10]!==i||e[11]!==c?(p=Lo(n,a)&&s.jsx("button",{type:"button",onClick:()=>i(Nn),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:c("taskBoard.taskFilters.clearButton")}),e[8]=n,e[9]=a,e[10]=i,e[11]=c,e[12]=p):p=e[12];let l;return e[13]!==u||e[14]!==p?(l=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d,u,p]}),e[13]=u,e[14]=p,e[15]=l):l=e[15],l}function Or(t){const e=Y.c(41),{filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m}=t,c=ae(),[d,u]=H.useState(!1),p=Ro(n,a),l=p>0;let f;e[0]!==l?(f=we(l),e[0]=l,e[1]=f):f=e[1];const j=f;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(cn,{size:14,className:"shrink-0"}),e[2]=g):g=e[2];let x;e[3]!==c?(x=c("taskBoard.taskFilters.filterDrawerButtonLabel"),e[3]=c,e[4]=x):x=e[4];let y;e[5]!==p?(y=p>0&&s.jsx("span",{className:"ml-0.5 flex size-4 items-center justify-center rounded-full bg-foreground text-[10px] font-semibold text-background",children:p}),e[5]=p,e[6]=y):y=e[6];let S;e[7]!==x||e[8]!==y||e[9]!==j?(S=s.jsx(Hn,{asChild:!0,children:s.jsxs("button",{type:"button",className:j,children:[g,x,y]})}),e[7]=x,e[8]=y,e[9]=j,e[10]=S):S=e[10];let b;e[11]!==c?(b=c("taskBoard.taskFilters.filterDrawerTitle"),e[11]=c,e[12]=b):b=e[12];let k;e[13]!==b?(k=s.jsx(on,{className:"px-4 pt-4 text-base font-medium text-foreground",children:b}),e[13]=b,e[14]=k):k=e[14];let v;e[15]!==n||e[16]!==a||e[17]!==o||e[18]!==i||e[19]!==m||e[20]!==r?(v=s.jsx("div",{className:"flex flex-col gap-2 p-4",children:s.jsx(Sn,{block:!0,filters:n,members:o,tags:r,index:a,onChange:i,onOpenBoardSettings:m})}),e[15]=n,e[16]=a,e[17]=o,e[18]=i,e[19]=m,e[20]=r,e[21]=v):v=e[21];let C;e[22]!==p||e[23]!==i||e[24]!==c?(C=p>0&&s.jsx(be,{variant:"outline",className:"flex-1",onClick:()=>i(Nn),children:c("taskBoard.taskFilters.clearAllButton")}),e[22]=p,e[23]=i,e[24]=c,e[25]=C):C=e[25];let D;e[26]!==c?(D=c("taskBoard.taskFilters.doneButton"),e[26]=c,e[27]=D):D=e[27];let h;e[28]!==D?(h=s.jsx(rn,{asChild:!0,children:s.jsx(be,{className:"flex-1",children:D})}),e[28]=D,e[29]=h):h=e[29];let _;e[30]!==C||e[31]!==h?(_=s.jsxs(an,{className:"flex-row gap-2",children:[C,h]}),e[30]=C,e[31]=h,e[32]=_):_=e[32];let w;e[33]!==_||e[34]!==k||e[35]!==v?(w=s.jsxs(sn,{className:"p-0",children:[k,v,_]}),e[33]=_,e[34]=k,e[35]=v,e[36]=w):w=e[36];let P;return e[37]!==d||e[38]!==w||e[39]!==S?(P=s.jsxs(nn,{open:d,onOpenChange:u,direction:"bottom",children:[S,w]}),e[37]=d,e[38]=w,e[39]=S,e[40]=P):P=e[40],P}function Lr(t,e){return io(t,e.keySeq)??e.id}function Rr(t,e){const n=e?.trim();if(n)return t.find(o=>_n(n,o.keySeq))??t.find(o=>o.id===n)}export{gr as $,Ji as A,lr as B,hn as C,Bt as D,No as E,vt as F,Ir as G,_r as H,We as I,Pt as J,hr as K,Bo as L,Sr as M,qt as N,Er as O,co as P,vr as Q,bn as R,zt as S,wr as T,Dr as U,Cn as V,Eo as W,xr as X,jr as Y,wo as Z,yn as _,fr as a,Rr as a0,Or as a1,Mr as a2,Nr as a3,Tr as a4,Nn as a5,Cr as a6,br as a7,Qt as a8,kr as a9,Fr as aa,Vr as ab,Do as ac,Pr as ad,Ar as ae,vo as af,pr as b,Br as c,Oo as d,gn as e,Lr as f,yr as g,ko as h,jn as i,er as j,nr as k,rr as l,po as m,mr as n,ir as o,mo as p,ar as q,tr as r,sr as s,io as t,Zi as u,or as v,ho as w,ur as x,cr as y,dr as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as j,b as D,j as n,B as T,r as C,u as R,f as k,G as L,d as E,Z as H,y as V,dx as z}from"./index-y6Z5iMfg.js";import{d as B,h as O,c as U,b as F,D as G}from"./dialog-CyDGwxcX.js";import{i as K}from"./Check-C1wq38_E.js";import{a as W}from"./Copy01-rsN5AnPv.js";import{n as Z}from"./Download01-zZEPtQ0U.js";import{u as $,D as A}from"./use-destination-route-CY15sZqw.js";import{a as N}from"./use-mcp-client-Cw1fcLqm.js";const q="https://github.com/decocms/studio/releases";function J(){return`curl -fsSL ${window.location.origin}/install.sh | sh`}function Q(e){return`https://github.com/decocms/studio/releases/download/native-v${e}/deco-${e}-linux-x86_64.AppImage`}function ve(){return typeof navigator<"u"&&/Mac/.test(navigator.platform)&&!("ontouchend"in document)}function X(){return typeof navigator<"u"&&/Linux/.test(navigator.platform)&&!/Android/.test(navigator.userAgent)&&!("ontouchend"in document)}async function Y(e,t){if(!e)return!1;try{return await e.writeText(t),!0}catch{return!1}}function M(e){const t=j.c(12),{copiedLabel:o}=e,l=D(),[s,a]=C.useState(!1);let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=J(),t[0]=c):c=t[0];const r=c;let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("code",{className:"block rounded-md border bg-muted px-3 py-2.5 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap select-all",children:r}),t[1]=i):i=t[1];let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{Y(navigator.clipboard,r).then(p=>{p&&(a(!0),setTimeout(()=>a(!1),2e3))})},t[2]=d):d=t[2];let f;t[3]!==s?(f=s?n.jsx(K,{size:16}):n.jsx(W,{size:16}),t[3]=s,t[4]=f):f=t[4];let u;t[5]!==s||t[6]!==o||t[7]!==l?(u=s?o:l("downloadApp.copyLabel"),t[5]=s,t[6]=o,t[7]=l,t[8]=u):u=t[8];let m;return t[9]!==f||t[10]!==u?(m=n.jsxs("div",{className:"flex flex-col gap-3",children:[i,n.jsxs(T,{type:"button",className:"w-full gap-2",onClick:d,children:[f,u]})]}),t[9]=f,t[10]=u,t[11]=m):m=t[11],m}function ee(){const e=j.c(18),t=D();let o;e[0]!==t?(o=t("downloadApp.copiedLabel"),e[0]=t,e[1]=o):o=e[1];let l;e[2]!==o?(l=n.jsx(M,{copiedLabel:o}),e[2]=o,e[3]=l):l=e[3];let s;e[4]!==t?(s=t("downloadApp.terminalHint"),e[4]=t,e[5]=s):s=e[5];let a;e[6]!==s?(a=n.jsx("p",{children:s}),e[6]=s,e[7]=a):a=e[7];let c;e[8]!==t?(c=t("downloadApp.appleSiliconNote"),e[8]=t,e[9]=c):c=e[9];let r;e[10]!==c?(r=n.jsx("p",{children:c}),e[10]=c,e[11]=r):r=e[11];let i;e[12]!==a||e[13]!==r?(i=n.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[a,r]}),e[12]=a,e[13]=r,e[14]=i):i=e[14];let d;return e[15]!==l||e[16]!==i?(d=n.jsxs(n.Fragment,{children:[l,i]}),e[15]=l,e[16]=i,e[17]=d):d=e[17],d}function te(){const e=j.c(42),t=D();let o;e[0]!==t?(o=t("downloadApp.copiedLabelLinux"),e[0]=t,e[1]=o):o=e[1];let l;e[2]!==o?(l=n.jsx(M,{copiedLabel:o}),e[2]=o,e[3]=l):l=e[3];let s;e[4]!==t?(s=t("downloadApp.linuxInstallerHint"),e[4]=t,e[5]=s):s=e[5];let a;e[6]!==s?(a=n.jsx("p",{children:s}),e[6]=s,e[7]=a):a=e[7];let c;e[8]!==t?(c=t("downloadApp.linuxArchNote"),e[8]=t,e[9]=c):c=e[9];let r;e[10]!==c?(r=n.jsx("p",{children:c}),e[10]=c,e[11]=r):r=e[11];let i;e[12]!==a||e[13]!==r?(i=n.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[a,r]}),e[12]=a,e[13]=r,e[14]=i):i=e[14];let d;e[15]!==t?(d=t("downloadApp.linuxDirectDownloadHint"),e[15]=t,e[16]=d):d=e[16];let f;e[17]!==d?(f=n.jsx("p",{children:d}),e[17]=d,e[18]=f):f=e[18];let u;e[19]===Symbol.for("react.memo_cache_sentinel")?(u=Q("4.363.0"),e[19]=u):u=e[19];let m;e[20]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Z,{size:14}),e[20]=m):m=e[20];let p;e[21]!==t?(p=t("downloadApp.downloadAppImage"),e[21]=t,e[22]=p):p=e[22];let h;e[23]!==p?(h=n.jsx(T,{asChild:!0,variant:"outline",size:"sm",className:"gap-2",children:n.jsxs("a",{href:u,rel:"noreferrer",children:[m,p]})}),e[23]=p,e[24]=h):h=e[24];let w;e[25]!==t?(w=t("downloadApp.linuxChmodHint"),e[25]=t,e[26]=w):w=e[26];let b;e[27]!==w?(b=n.jsx("p",{children:w}),e[27]=w,e[28]=b):b=e[28];let g;e[29]!==t?(g=t("downloadApp.allReleases"),e[29]=t,e[30]=g):g=e[30];let x;e[31]!==g?(x=n.jsx("a",{href:q,target:"_blank",rel:"noreferrer",className:"underline-offset-2 hover:text-foreground hover:underline",children:g}),e[31]=g,e[32]=x):x=e[32];let v;e[33]!==h||e[34]!==b||e[35]!==x||e[36]!==f?(v=n.jsxs("div",{className:"flex flex-col items-start gap-2 border-t pt-4 text-xs text-muted-foreground",children:[f,h,b,x]}),e[33]=h,e[34]=b,e[35]=x,e[36]=f,e[37]=v):v=e[37];let S;return e[38]!==l||e[39]!==v||e[40]!==i?(S=n.jsxs(n.Fragment,{children:[l,i,v]}),e[38]=l,e[39]=v,e[40]=i,e[41]=S):S=e[41],S}function Ie(e){const t=j.c(19),{open:o,onOpenChange:l}=e,s=D();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=X(),t[0]=a):a=t[0];const c=a;let r;t[1]!==s?(r=s("downloadApp.title"),t[1]=s,t[2]=r):r=t[2];let i;t[3]!==r?(i=n.jsx(B,{children:r}),t[3]=r,t[4]=i):i=t[4];let d;t[5]!==s?(d=s(c?"downloadApp.linuxDescription":"downloadApp.description"),t[5]=s,t[6]=d):d=t[6];let f;t[7]!==d?(f=n.jsx(O,{children:d}),t[7]=d,t[8]=f):f=t[8];let u;t[9]!==i||t[10]!==f?(u=n.jsxs(U,{children:[i,f]}),t[9]=i,t[10]=f,t[11]=u):u=t[11];let m;t[12]===Symbol.for("react.memo_cache_sentinel")?(m=c?n.jsx(te,{}):n.jsx(ee,{}),t[12]=m):m=t[12];let p;t[13]!==u?(p=n.jsxs(F,{className:"sm:max-w-md",children:[u,m]}),t[13]=u,t[14]=p):p=t[14];let h;return t[15]!==l||t[16]!==o||t[17]!==p?(h=n.jsx(G,{open:o,onOpenChange:l,children:p}),t[15]=l,t[16]=o,t[17]=p,t[18]=h):h=t[18],h}const oe="/shell/$org/org-shell/agent-shell";function le(e){return e.threadInSearch||!e.threadId?{to:"."}:{to:"/$org/$taskId",params:{org:e.orgSlug,taskId:e.threadId}}}function se(e){return e.taskIdParam??e.threadSearch??null}function je(){const e=j.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const o=k(t);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},e[1]=l):l=e[1];const s=R(l);let a;return e[2]!==o.taskId||e[3]!==s.thread?(a=se({taskIdParam:o.taskId,threadSearch:s.thread}),e[2]=o.taskId,e[3]=s.thread,e[4]=a):a=e[4],a}function ae(e){return(e.onAgentsRoute||e.onHomeRoute||e.legacyRoute)&&e.virtualMcpIdSearch||void 0}function re(){const e=j.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0],k(t).taskId!==void 0}function ne(){const e=j.c(6);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const o=R(t),l=$(),s=re(),a=l===A.agents,c=l===A.home;let r;return e[1]!==s||e[2]!==o.virtualmcpid||e[3]!==a||e[4]!==c?(r=ae({virtualMcpIdSearch:o.virtualmcpid,onAgentsRoute:a,onHomeRoute:c,legacyRoute:s}),e[1]=s,e[2]=o.virtualmcpid,e[3]=a,e[4]=c,e[5]=r):r=e[5],r}function we(){const e=j.c(3),{org:t}=L(),o=ne();let l;return e[0]!==t||e[1]!==o?(l=o??N(t.id).id,e[0]=t,e[1]=o,e[2]=l):l=e[2],l}function ce(e){const{virtualmcpid:t,...o}=e.changes;return{...e.prev,...o,thread:e.threadId}}function be(e){return e.routeAgentId??e.threadVirtualMcpId??null}function ie(e){if(e.targetVirtualMcpId===void 0)return{kind:"stay",project:e.currentProject};const t=e.targetVirtualMcpId===e.decopilotId?void 0:e.targetVirtualMcpId;return t!==void 0&&e.currentProject===void 0?{kind:"relocate",project:t}:{kind:"stay",project:t}}function de(){const e=j.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const o=k(t);let l;return e[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:oe,shouldThrow:!1},e[1]=l):l=e[1],!!H(l)&&o.taskId===void 0}function Se(){const e=j.c(12),t=E();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},e[0]=o):o=e[0];const l=k(o),s=de(),{org:a}=L(),c=l.org??"",r=$()===A.agents;let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},e[1]=i):i=e[1];const d=R(i),f=r?d.virtualmcpid:void 0,u=l.panel;let m;e[2]!==a.id?(m=N(a.id),e[2]=a.id,e[3]=m):m=e[3];const p=m.id;let h;return e[4]!==u||e[5]!==f||e[6]!==p||e[7]!==t||e[8]!==r||e[9]!==c||e[10]!==s?(h=(w,b,g)=>{const x=le({threadInSearch:s,orgSlug:c,threadId:w}),v=g?.replace??!1;if(x.to==="/$org/$taskId")return t({to:x.to,params:x.params,search:b,replace:v});const S=ie({currentProject:f,targetVirtualMcpId:g?.virtualMcpId,decopilotId:p}),y=g?.view&&g.view.tabId!==void 0?V(g.view.tabId):g?.view?{panel:void 0,payload:z()}:null,P=S.kind==="relocate"&&!r,_=I=>ce({prev:P?{sidepanel:I.sidepanel}:I,changes:{...b(I),...y?.payload??{}},threadId:w});return S.kind==="relocate"?t({to:A.agents,params:{org:c,panel:y?y.panel:u},search:I=>({...typeof _=="function"?_(I):_,virtualmcpid:S.project}),replace:v}):t({to:".",params:I=>y?{...I,panel:y.panel}:I,search:I=>({...typeof _=="function"?_(I):_,...r?{virtualmcpid:S.project}:{}}),replace:v})},e[4]=u,e[5]=f,e[6]=p,e[7]=t,e[8]=r,e[9]=c,e[10]=s,e[11]=h):h=e[11],h}export{Ie as D,X as a,Se as b,je as c,we as d,ve as i,be as r,ne as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as x,bu as b,j as c,br as m,bx as k,be as p,dt as M,du as T,bw as S,dv as A,bt as F,bH as $,c as P,l as C}from"./index-y6Z5iMfg.js";var j="Toggle",_=x.forwardRef((r,e)=>{const{pressed:l,defaultPressed:s,onPressedChange:n,...a}=r,[t,o]=b({prop:l,onChange:n,defaultProp:s??!1,caller:j});return c.jsx(m.button,{type:"button","aria-pressed":t,"data-state":t?"on":"off","data-disabled":r.disabled?"":void 0,...a,ref:e,onClick:k(r.onClick,()=>{r.disabled||o(!t)})})});_.displayName=j;var v="ToggleGroup",[w]=F(v,[T]),I=T(),h=p.forwardRef((r,e)=>{const{type:l,...s}=r;if(l==="single"){const n=s;return c.jsx(D,{...n,ref:e})}if(l==="multiple"){const n=s;return c.jsx(B,{...n,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${v}\``)});h.displayName=v;var[z,y]=w(v),D=p.forwardRef((r,e)=>{const{value:l,defaultValue:s,onValueChange:n=()=>{},...a}=r,[t,o]=b({prop:l,defaultProp:s??"",onChange:n,caller:v});return c.jsx(z,{scope:r.__scopeToggleGroup,type:"single",value:p.useMemo(()=>t?[t]:[],[t]),onItemActivate:o,onItemDeactivate:p.useCallback(()=>o(""),[o]),children:c.jsx(R,{...a,ref:e})})}),B=p.forwardRef((r,e)=>{const{value:l,defaultValue:s,onValueChange:n=()=>{},...a}=r,[t,o]=b({prop:l,defaultProp:s??[],onChange:n,caller:v}),i=p.useCallback(u=>o((g=[])=>[...g,u]),[o]),d=p.useCallback(u=>o((g=[])=>g.filter(V=>V!==u)),[o]);return c.jsx(z,{scope:r.__scopeToggleGroup,type:"multiple",value:t,onItemActivate:i,onItemDeactivate:d,children:c.jsx(R,{...a,ref:e})})});h.displayName=v;var[H,O]=w(v),R=p.forwardRef((r,e)=>{const{__scopeToggleGroup:l,disabled:s=!1,rovingFocus:n=!0,orientation:a,dir:t,loop:o=!0,...i}=r,d=I(l),u=S(t),g={role:"group",dir:u,...i};return c.jsx(H,{scope:l,rovingFocus:n,disabled:s,children:n?c.jsx(A,{asChild:!0,...d,orientation:a,dir:u,loop:o,children:c.jsx(m.div,{...g,ref:e})}):c.jsx(m.div,{...g,ref:e})})}),f="ToggleGroupItem",N=p.forwardRef((r,e)=>{const l=y(f,r.__scopeToggleGroup),s=O(f,r.__scopeToggleGroup),n=I(r.__scopeToggleGroup),a=l.value.includes(r.value),t=s.disabled||r.disabled,o={...r,pressed:a,disabled:t},i=p.useRef(null);return s.rovingFocus?c.jsx(M,{asChild:!0,...n,focusable:!t,active:a,ref:i,children:c.jsx(G,{...o,ref:e})}):c.jsx(G,{...o,ref:e})});N.displayName=f;var G=p.forwardRef((r,e)=>{const{__scopeToggleGroup:l,value:s,...n}=r,a=y(f,l),t={role:"radio","aria-checked":r.pressed,"aria-pressed":void 0},o=a.type==="single"?t:void 0;return c.jsx(_,{...o,...n,ref:e,onPressedChange:i=>{i?a.onItemActivate(s):a.onItemDeactivate(s)}})}),L=h,U=N;const q=$("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-2 min-w-9",sm:"h-7 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),E=x.createContext({size:"default",variant:"default"});function K(r){const e=P.c(20);let l,s,n,a,t;e[0]!==r?({className:s,variant:t,size:a,children:l,...n}=r,e[0]=r,e[1]=l,e[2]=s,e[3]=n,e[4]=a,e[5]=t):(l=e[1],s=e[2],n=e[3],a=e[4],t=e[5]);let o;e[6]!==s?(o=C("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",s),e[6]=s,e[7]=o):o=e[7];let i;e[8]!==a||e[9]!==t?(i={variant:t,size:a},e[8]=a,e[9]=t,e[10]=i):i=e[10];let d;e[11]!==l||e[12]!==i?(d=c.jsx(E.Provider,{value:i,children:l}),e[11]=l,e[12]=i,e[13]=d):d=e[13];let u;return e[14]!==n||e[15]!==a||e[16]!==o||e[17]!==d||e[18]!==t?(u=c.jsx(L,{"data-slot":"toggle-group","data-variant":t,"data-size":a,className:o,...n,children:d}),e[14]=n,e[15]=a,e[16]=o,e[17]=d,e[18]=t,e[19]=u):u=e[19],u}function Q(r){const e=P.c(18);let l,s,n,a,t;e[0]!==r?({className:s,children:l,variant:t,size:a,...n}=r,e[0]=r,e[1]=l,e[2]=s,e[3]=n,e[4]=a,e[5]=t):(l=e[1],s=e[2],n=e[3],a=e[4],t=e[5]);const o=x.useContext(E),i=o.variant||t,d=o.size||a;let u;e[6]!==s||e[7]!==o.size||e[8]!==o.variant||e[9]!==a||e[10]!==t?(u=C(q({variant:o.variant||t,size:o.size||a}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",s),e[6]=s,e[7]=o.size,e[8]=o.variant,e[9]=a,e[10]=t,e[11]=u):u=e[11];let g;return e[12]!==l||e[13]!==n||e[14]!==i||e[15]!==d||e[16]!==u?(g=c.jsx(U,{"data-slot":"toggle-group-item","data-variant":i,"data-size":d,className:u,...n,children:l}),e[12]=l,e[13]=n,e[14]=i,e[15]=d,e[16]=u,e[17]=g):g=e[17],g}export{K as T,Q as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as n,k as s,b4 as a}from"./index-y6Z5iMfg.js";const o={home:"/$org/home",agents:"/$org/agents/{-$panel}",tasks:"/$org/tasks/{-$taskKey}",reports:"/$org/reports",library:"/$org/library",discover:"/$org/discover",orgIndex:"/$org/"};function m(){const t=n.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={select:c},t[0]=e):e=t[0],s(e)}function c(t){return t.matches.at(-1)?.fullPath??""}function p(){const t=n.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={select:l},t[0]=e):e=t[0],s(e)}function l(t){const e=t.matches.at(-1)?.params?.panel;return e===void 0?void 0:a(e)}const i=new Map([[o.reports,"project-only"],[o.library,"org-only"]]);function g(t,e){const r=i.get(t);return r===void 0?!0:r==="project-only"?e!==null:e===null}export{o as D,p as a,g as r,m as u};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{ef as pe,eg as me,eh as _e,dd as ge,ei as we,cP as _,cQ as w,ej as Te,ek as ye,el as ve,em as O,en as ke,eo as V,ep as Se,eq as P,er as Re,es as G,et as Ce,eu as Ee,ev as Ie,ew as J,cx as be,cz as Ae,cu as qe,d8 as oe,dk as Pe,dr as Me,dp as $e,dG as Oe,ex as Ne,ey as He,ez as N,eA as Ue,eB as De,dq as xe,dl as je,dm as Fe,dn as Le,cv as Ve,eC as Ge,eD as ze,eE as Qe,df as We,eF as Ke,eG as Je,dC as D,eH as Be,ct as j,c as Q,x as ae,K as W,m as Ye}from"./index-y6Z5iMfg.js";import{U as M,a as H,e as B}from"./auth-DeD0YpKg.js";const Mt={SELF:o=>`${o}_self`,REGISTRY:o=>`${o}_registry`,COMMUNITY_REGISTRY:o=>`${o}_community-registry`,DEV_ASSETS:o=>`${o}_dev-assets`,SITE_DIAGNOSTICS:o=>`site-diagnostics_${o}`,COMMERCE_DISCOVERY:o=>`${o}_commerce-discovery`},$t="get_my_diagnostic",Ze="self";function R(o){return{is(e){return!e||!e.startsWith(o)?null:e.slice(o.length)||null},get(e){return`${o}${e}`}}}function Xe(o){return{id:o.id,organization_id:o.organizationId,title:o.title,description:o.description,icon:o.icon,status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:o.instructions??null,...o.ui?{ui:o.ui}:{}},pinned:!1,connections:[]}}const ne=R("decopilot_"),Ot=ne.is,et=ne.get,ie=R("dev_"),Nt=ie.get,Ht=ie.is,tt="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",st="#6366f1",Ut=`https://api.iconify.design/lucide:file-search.svg?color=${encodeURIComponent(st)}`;function Dt(o){return Xe({id:et(o),organizationId:o,title:"Super Agent",description:"Default agent that aggregates all organization connections",icon:tt,ui:{layout:{defaultMainView:{type:"overview"},chatDefaultOpen:!0}}})}const rt=R("commerce-discovery_"),xt=rt.get,A={AUTOMATION_MANAGER:R("studio-automation-manager_"),CONNECTION_MANAGER:R("studio-connection-manager_"),API_KEY_MANAGER:R("studio-api-key-manager_"),STORE_MANAGER:R("studio-store-manager_"),BRAND_MANAGER:R("studio-brand-manager_"),USAGE_MANAGER:R("studio-usage-manager_")},jt={AUTOMATION_MANAGER:A.AUTOMATION_MANAGER.get,CONNECTION_MANAGER:A.CONNECTION_MANAGER.get,API_KEY_MANAGER:A.API_KEY_MANAGER.get,STORE_MANAGER:A.STORE_MANAGER.get,BRAND_MANAGER:A.BRAND_MANAGER.get,USAGE_MANAGER:A.USAGE_MANAGER.get};function Ft(o){return o?Object.values(A).some(e=>e.is(o)!==null):!1}const ot=["studio-agent-manager_","studio-task-manager_"],at=ot.map(R);function Lt(o){return o?at.some(e=>e.is(o)!==null):!1}function x(o){return!!o._zod}function E(o,e){return x(o)?pe(o,e):o.safeParse(e)}function ce(o){if(!o)return;let e;if(x(o)?e=o._zod?.def?.shape:e=o.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function nt(o){if(x(o)){const a=o._zod?.def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}}const t=o._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=o.value;if(s!==void 0)return s}function I(o){return o==="completed"||o==="failed"||o==="cancelled"}function Y(o){const t=ce(o)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=nt(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function Z(o,e){const t=E(o,e);if(!t.success)throw t.error;return t.data}const it=6e4;class ct{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(me,t=>{this._oncancel(t)}),this.setNotificationHandler(_e,t=>{this._onprogress(t)}),this.setRequestHandler(ge,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(we,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(w.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(Te,async(t,s)=>{const r=async()=>{const a=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(a,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const d=u,f=new _(d.error.code,d.error.message,d.error.data);l(f)}else{const d=i.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(a,s.sessionId);if(!n)throw new _(w.InvalidParams,`Task not found: ${a}`);if(!I(n.status))return await this._waitForTaskUpdate(a,s.signal),await r();if(I(n.status)){const i=await this._taskStore.getTaskResult(a,s.sessionId);return this._clearTaskQueue(a),{...i,_meta:{...i._meta,[P]:{taskId:a}}}}return await r()};return await r()}),this.setRequestHandler(ye,async(t,s)=>{try{const{tasks:r,nextCursor:a}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:a,_meta:{}}}catch(r){throw new _(w.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(ve,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new _(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(I(r.status))throw new _(w.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const a=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!a)throw new _(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...a}}catch(r){throw r instanceof _?r:new _(w.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,a=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:a,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),_.fromError(w.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=a=>{s?.(a),this._onerror(a)};const r=this._transport?.onmessage;this._transport.onmessage=(a,n)=>{r?.(a,n),O(a)||ke(a)?this._onresponse(a):V(a)?this._onrequest(a,n):Se(a)?this._onnotification(a):this._onerror(new Error(`Unknown message type: ${JSON.stringify(a)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=_.fromError(w.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,a=e.params?._meta?.[P]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:w.MethodNotFound,message:"Method not found"}};a&&this._taskMessageQueue?this._enqueueTaskMessage(a,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):r?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=Re(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const d={relatedRequestId:e.id};a&&(d.relatedTask={taskId:a}),await this.notification(l,d)},sendRequest:async(l,d,f)=>{if(n.signal.aborted)throw new _(w.ConnectionClosed,"Request was cancelled");const m={...f,relatedRequestId:e.id};a&&!m.relatedTask&&(m.relatedTask={taskId:a});const T=m.relatedTask?.taskId??a;return T&&u&&await u.updateTaskStatus(T,"input_required"),await this.request(l,d,m)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:a,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const d={result:l,jsonrpc:"2.0",id:e.id};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"response",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)},async l=>{if(n.signal.aborted)return;const d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:w.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"error",message:d,timestamp:Date.now()},r?.sessionId):await r?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),a=this._progressHandlers.get(r);if(!a){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}a(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),O(e))s(e);else{const n=new _(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let a=!1;if(O(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(a=!0,this._taskProgressTokens.set(i.taskId,t))}}if(a||this._progressHandlers.delete(t),O(e))r(e);else{const n=_.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof _?n:new _(w.InternalError,String(n))}}return}let a;try{const n=await this.request(e,G,s);if(n.task)a=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new _(w.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:a},s);if(yield{type:"taskStatus",task:i},I(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:a},t,s)}:i.status==="failed"?yield{type:"error",error:new _(w.InternalError,`Task ${a} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new _(w.InternalError,`Task ${a} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:a},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof _?n:new _(w.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:a,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const d=c=>{l(c)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){d(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(m.params={...m.params,task:i}),u&&(m.params={...m.params,_meta:{...m.params?._meta||{},[P]:u}});const T=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:a,onresumptiontoken:n}).catch(k=>this._onerror(new Error(`Failed to send cancellation: ${k}`)));const g=c instanceof _?c:new _(w.RequestTimeout,String(c));l(g)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const g=E(t,c.result);g.success?p(g.data):l(g.error)}catch(g){l(g)}}}),s?.signal?.addEventListener("abort",()=>{T(s?.signal?.reason)});const y=s?.timeout??it,v=()=>T(_.fromError(w.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s?.maxTotalTimeout,v,s?.resetTimeoutOnProgress??!1);const h=u?.taskId;if(h){const c=g=>{const k=this._responseHandlers.get(f);k?k(g):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(h,{type:"request",message:m,timestamp:Date.now()}).catch(g=>{this._cleanupTimeout(f),l(g)})}else this._transport.send(m,{relatedRequestId:r,resumptionToken:a,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Ce,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},Ee,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},Ie,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[P]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[P]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[P]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=Y(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,a)=>{const n=Z(e,r);return Promise.resolve(t(n,a))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=Y(e);this._notificationHandlers.set(s,r=>{const a=Z(e,r);return Promise.resolve(t(a))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&V(r.message)){const a=r.message.id,n=this._requestResolvers.get(a);n?(n(new _(w.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(a)):this._onerror(new Error(`Resolver missing for request ${a} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,a)=>{if(t.aborted){a(new _(w.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),a(new _(w.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const a=await s.getTask(r,t);if(!a)throw new _(w.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(r,a,n)=>{await s.storeTaskResult(r,a,n,t);const i=await s.getTask(r,t);if(i){const u=J.parse({method:"notifications/tasks/status",params:i});await this.notification(u),I(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,a,n)=>{const i=await s.getTask(r,t);if(!i)throw new _(w.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(I(i.status))throw new _(w.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,a,n,t);const u=await s.getTask(r,t);if(u){const p=J.parse({method:"notifications/tasks/status",params:u});await this.notification(p),I(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function X(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}function lt(o,e){const t={...o};for(const s in e){const r=s,a=e[r];if(a===void 0)continue;const n=t[r];X(n)&&X(a)?t[r]={...n,...a}:t[r]=a}return t}var ut=Ae();const dt=be(ut);function ht(){const o=new dt({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return qe(o),o}class ft{constructor(e){this._ajv=e??ht()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class pt{constructor(e){this._client=e}async*callToolStream(e,t=oe,s){const r=this._client,a={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,a),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new _(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new _(w.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof _){yield{type:"error",error:l};return}yield{type:"error",error:new _(w.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function mt(o,e,t){if(!o)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!o.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function _t(o,e,t){if(!o)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!o.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!o.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function U(o,e){if(!(!o||e===null||typeof e!="object")){if(o.type==="object"&&o.properties&&typeof o.properties=="object"){const t=e,s=o.properties;for(const r of Object.keys(s)){const a=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(a,"default")&&(t[r]=a.default),t[r]!==void 0&&U(a,t[r])}}if(Array.isArray(o.anyOf))for(const t of o.anyOf)typeof t!="boolean"&&U(t,e);if(Array.isArray(o.oneOf))for(const t of o.oneOf)typeof t!="boolean"&&U(t,e)}}function gt(o){if(!o)return{supportsFormMode:!1,supportsUrlMode:!1};const e=o.form!==void 0,t=o.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let wt=class extends ct{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new ft,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",Pe,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Me,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",$e,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new pt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=lt(this._capabilities,e)}setRequestHandler(e,t){const r=ce(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let a;if(x(r)){const i=r;a=i._zod?.def?.value??i.value}else{const i=r;a=i._def?.value??i.value}if(typeof a!="string")throw new Error("Schema method literal must be a string");const n=a;if(n==="elicitation/create"){const i=async(u,p)=>{const l=E(ze,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new _(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:d}=l.data;d.mode=d.mode??"form";const{supportsFormMode:f,supportsUrlMode:m}=gt(this._capabilities.elicitation);if(d.mode==="form"&&!f)throw new _(w.InvalidParams,"Client does not support form-mode elicitation requests");if(d.mode==="url"&&!m)throw new _(w.InvalidParams,"Client does not support URL-mode elicitation requests");const T=await Promise.resolve(t(u,p));if(d.task){const c=E(G,T);if(!c.success){const g=c.error instanceof Error?c.error.message:String(c.error);throw new _(w.InvalidParams,`Invalid task creation result: ${g}`)}return c.data}const y=E(Qe,T);if(!y.success){const c=y.error instanceof Error?y.error.message:String(y.error);throw new _(w.InvalidParams,`Invalid elicitation result: ${c}`)}const v=y.data,h=d.mode==="form"?d.requestedSchema:void 0;if(d.mode==="form"&&v.action==="accept"&&v.content&&h&&this._capabilities.elicitation?.form?.applyDefaults)try{U(h,v.content)}catch{}return v};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=E(We,u);if(!l.success){const v=l.error instanceof Error?l.error.message:String(l.error);throw new _(w.InvalidParams,`Invalid sampling request: ${v}`)}const{params:d}=l.data,f=await Promise.resolve(t(u,p));if(d.task){const v=E(G,f);if(!v.success){const h=v.error instanceof Error?v.error.message:String(v.error);throw new _(w.InvalidParams,`Invalid task creation result: ${h}`)}return v.data}const T=d.tools||d.toolChoice?Ke:Je,y=E(T,f);if(!y.success){const v=y.error instanceof Error?y.error.message:String(y.error);throw new _(w.InvalidParams,`Invalid sampling result: ${v}`)}return y.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Oe,capabilities:this._capabilities,clientInfo:this._clientInfo}},Ne,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!He.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){mt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&_t(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},N,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Ue,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},N,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},De,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},xe,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},je,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Fe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Le,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},N,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},N,t)}async callTool(e,t=oe,s){if(this.isToolTaskRequired(e.name))throw new _(w.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),a=this.getToolOutputValidator(e.name);if(a){if(!r.structuredContent&&!r.isError)throw new _(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=a(r.structuredContent);if(!n.valid)throw new _(w.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof _?n:new _(w.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},Ve,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const a=Ge.safeParse(s);if(!a.success)throw new Error(`Invalid ${e} listChanged options: ${a.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=a.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const d=await r();u(null,d)}catch(d){const f=d instanceof Error?d:new Error(String(d));u(f,null)}},l=()=>{if(i){const d=this._listChangedDebounceTimers.get(e);d&&clearTimeout(d);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const F=o=>[{type:"text",text:o}];function Tt(o){const e=D(o,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...o.token?{Authorization:`Bearer ${o.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(o.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(d){const f=d instanceof Error?d.message:"Network error";return{content:F(f),isError:!0}}if(!p.ok){let d=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(d=f.error)}catch{}return{content:F(d),isError:!0}}const l=await p.json().catch(()=>({}));return{content:F(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},a=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:a,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>o.toJSONString}}function z(o){return o?o instanceof Headers?Object.fromEntries(o.entries()):Array.isArray(o)?Object.fromEntries(o):{...o}:{}}function yt(o=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...z(e.headers),...z(s.headers)}:e.headers};return o(t,r)}:o}class ee extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const te=10,vt=13,b=32;function L(o){}function kt(o){if(typeof o=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=L,onError:t=L,onRetry:s=L,onComment:r}=o,a=[];let n=!0,i,u="",p=0,l;function d(h){if(n&&(n=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),a.length===0){const k=f(h);k!==""&&a.push(k);return}if(h.indexOf(`
|
|
2
|
-
`)===-1&&h.indexOf("\r")===-1){a.push(h);return}a.push(h);const c=a.join("");a.length=0;const g=f(c);g!==""&&a.push(g)}function f(h){let c=0;if(h.indexOf("\r")===-1){let g=h.indexOf(`
|
|
3
|
-
`,c);for(;g!==-1;){if(c===g){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0,c=g+1,g=h.indexOf(`
|
|
4
|
-
`,c);continue}const k=h.charCodeAt(c);if(se(h,c,k)){const S=h.charCodeAt(c+5)===b?c+6:c+5,C=h.slice(S,g);if(p===0&&h.charCodeAt(g+1)===te){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=g+2,g=h.indexOf(`
|
|
5
|
-
`,c);continue}u=p===0?C:`${u}
|
|
6
|
-
${C}`,p++}else re(h,c,k)?l=h.slice(h.charCodeAt(c+6)===b?c+7:c+6,g)||void 0:m(h,c,g);c=g+1,g=h.indexOf(`
|
|
7
|
-
`,c)}return h.slice(c)}for(;c<h.length;){const g=h.indexOf("\r",c),k=h.indexOf(`
|
|
8
|
-
`,c);let S=-1;if(g!==-1&&k!==-1?S=g<k?g:k:g!==-1?g===h.length-1?S=-1:S=g:k!==-1&&(S=k),S===-1)break;m(h,c,S),c=S+1,h.charCodeAt(c-1)===vt&&h.charCodeAt(c)===te&&c++}return h.slice(c)}function m(h,c,g){if(c===g){y();return}const k=h.charCodeAt(c);if(se(h,c,k)){const q=h.charCodeAt(c+5)===b?c+6:c+5,K=h.slice(q,g);u=p===0?K:`${u}
|
|
9
|
-
${K}`,p++;return}if(re(h,c,k)){l=h.slice(h.charCodeAt(c+6)===b?c+7:c+6,g)||void 0;return}if(k===105&&h.charCodeAt(c+1)===100&&h.charCodeAt(c+2)===58){const q=h.slice(h.charCodeAt(c+3)===b?c+4:c+3,g);i=q.includes("\0")?void 0:q;return}if(k===58){if(r){const q=h.slice(c,g);r(q.slice(h.charCodeAt(c+1)===b?2:1))}return}const S=h.slice(c,g),C=S.indexOf(":");if(C===-1){T(S,"",S);return}const de=S.slice(0,C),he=S.charCodeAt(C+1)===b?2:1,fe=S.slice(C+he);T(de,fe,S)}function T(h,c,g){switch(h){case"event":l=c||void 0;break;case"data":u=p===0?c:`${u}
|
|
10
|
-
${c}`,p++;break;case"id":i=c.includes("\0")?void 0:c;break;case"retry":/^\d+$/.test(c)?s(parseInt(c,10)):t(new ee(`Invalid \`retry\` value: "${c}"`,{type:"invalid-retry",value:c,line:g}));break;default:t(new ee(`Unknown field "${h.length>20?`${h.slice(0,20)}…`:h}"`,{type:"unknown-field",field:h,value:c,line:g}));break}}function y(){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0}function v(h={}){if(h.consume&&a.length>0){const c=a.join("");m(c,0,c.length)}n=!0,i=void 0,u="",p=0,l=void 0,a.length=0}return{feed:d,reset:v}}function se(o,e,t){return t===100&&o.charCodeAt(e+1)===97&&o.charCodeAt(e+2)===116&&o.charCodeAt(e+3)===97&&o.charCodeAt(e+4)===58}function re(o,e,t){return t===101&&o.charCodeAt(e+1)===118&&o.charCodeAt(e+2)===101&&o.charCodeAt(e+3)===110&&o.charCodeAt(e+4)===116&&o.charCodeAt(e+5)===58}class St extends TransformStream{constructor({onError:e,onRetry:t,onComment:s}={}){let r;super({start(a){r=kt({onEvent:n=>{a.enqueue(n)},onError(n){e==="terminate"?a.error(n):typeof e=="function"&&e(n)},onRetry:t,onComment:s})},transform(a){r.feed(a)}})}}const Rt={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class $ extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}}let Ct=class{constructor(e,t){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=yt(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._reconnectionOptions=t?.reconnectionOptions??Rt}async _authThenStart(){if(!this._authProvider)throw new M("No auth provider");let e;try{e=await H(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(t){throw this.onerror?.(t),t}if(e!=="AUTHORIZED")throw new M;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const e={};if(this._authProvider){const s=await this._authProvider.tokens();s&&(e.Authorization=`Bearer ${s.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);const t=z(this._requestInit?.headers);return new Headers({...e,...t})}async _startOrAuthSse(e){const{resumptionToken:t}=e;try{const s=await this._commonHeaders();s.set("Accept","text/event-stream"),t&&s.set("last-event-id",t);const r=await(this._fetch??fetch)(this._url,{method:"GET",headers:s,signal:this._abortController?.signal});if(!r.ok){if(await r.body?.cancel(),r.status===401&&this._authProvider)return await this._authThenStart();if(r.status===405)return;throw new $(r.status,`Failed to open SSE stream: ${r.statusText}`)}this._handleSseStream(r.body,e,!0)}catch(s){throw this.onerror?.(s),s}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const t=this._reconnectionOptions.initialReconnectionDelay,s=this._reconnectionOptions.reconnectionDelayGrowFactor,r=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*Math.pow(s,e),r)}_scheduleReconnection(e,t=0){const s=this._reconnectionOptions.maxRetries;if(t>=s){this.onerror?.(new Error(`Maximum reconnection attempts (${s}) exceeded.`));return}const r=this._getNextReconnectionDelay(t);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(a=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${a instanceof Error?a.message:String(a)}`)),this._scheduleReconnection(e,t+1)})},r)}_handleSseStream(e,t,s){if(!e)return;const{onresumptiontoken:r,replayMessageId:a}=t;let n,i=!1,u=!1;(async()=>{try{const l=e.pipeThrough(new TextDecoderStream).pipeThrough(new St({onRetry:m=>{this._serverRetryMs=m}})).getReader();for(;;){const{value:m,done:T}=await l.read();if(T)break;if(m.id&&(n=m.id,i=!0,r?.(m.id)),!!m.data&&(!m.event||m.event==="message"))try{const y=j.parse(JSON.parse(m.data));O(y)&&(u=!0,a!==void 0&&(y.id=a)),this.onmessage?.(y)}catch(y){this.onerror?.(y)}}(s||i)&&!u&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:n,onresumptiontoken:r,replayMessageId:a},0)}catch(l){if(this.onerror?.(new Error(`SSE stream disconnected: ${l}`)),(s||i)&&!u&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:n,onresumptiontoken:r,replayMessageId:a},0)}catch(m){this.onerror?.(new Error(`Failed to reconnect: ${m instanceof Error?m.message:String(m)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new M("No auth provider");if(await H(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new M("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,t){try{const{resumptionToken:s,onresumptiontoken:r}=t||{};if(s){this._startOrAuthSse({resumptionToken:s,replayMessageId:V(e)?e.id:void 0}).catch(f=>this.onerror?.(f));return}const a=await this._commonHeaders();a.set("content-type","application/json"),a.set("accept","application/json, text/event-stream");const n={...this._requestInit,method:"POST",headers:a,body:JSON.stringify(e),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._url,n),u=i.headers.get("mcp-session-id");if(u&&(this._sessionId=u),!i.ok){const f=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new $(401,"Server returned 401 after successful authentication");const{resourceMetadataUrl:m,scope:T}=B(i);if(this._resourceMetadataUrl=m,this._scope=T,await H(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new M;return this._hasCompletedAuthFlow=!0,this.send(e)}if(i.status===403&&this._authProvider){const{resourceMetadataUrl:m,scope:T,error:y}=B(i);if(y==="insufficient_scope"){const v=i.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===v)throw new $(403,"Server returned 403 after trying upscoping");if(T&&(this._scope=T),m&&(this._resourceMetadataUrl=m),this._lastUpscopingHeader=v??void 0,await H(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new M;return this.send(e)}}throw new $(i.status,`Error POSTing to endpoint: ${f}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,i.status===202){await i.body?.cancel(),Be(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(f=>this.onerror?.(f));return}const l=(Array.isArray(e)?e:[e]).filter(f=>"method"in f&&"id"in f&&f.id!==void 0).length>0,d=i.headers.get("content-type");if(l)if(d?.includes("text/event-stream"))this._handleSseStream(i.body,{onresumptiontoken:r},!1);else if(d?.includes("application/json")){const f=await i.json(),m=Array.isArray(f)?f.map(T=>j.parse(T)):[j.parse(f)];for(const T of m)this.onmessage?.(T)}else throw await i.body?.cancel(),new $(-1,`Unexpected content type: ${d}`);else await i.body?.cancel()}catch(s){throw this.onerror?.(s),s}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{const e=await this._commonHeaders(),t={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},s=await(this._fetch??fetch)(this._url,t);if(await s.body?.cancel(),!s.ok&&s.status!==405)throw new $(s.status,`Failed to terminate session: ${s.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,t){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:t?.onresumptiontoken})}};class Et extends Ct{constructor(e,t){super(e,t)}send(e,t){const s=It(e);return s?.type==="emit"?(this.onmessage?.(s.message),Promise.resolve()):s?.type==="suppress"?Promise.resolve():super.send(e,t)}}function It(o){const e=o;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const t=e?.params?.protocolVersion;return t?{type:"emit",message:{result:{protocolVersion:t,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"studio-virtual-mcp",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const bt={name:"studio-sdk",version:"1.0.0"};function At(o,e,t){const s=t??(typeof window<"u"?window.location.origin:void 0);if(!s)throw new Error("MCP client requires either studioUrl or a browser environment.");const r=`/api/${encodeURIComponent(e)}`,a=o?`${r}/mcp/${o}`:`${r}/mcp`;return new URL(a,s).href}async function le({connectionId:o,orgId:e,orgSlug:t,token:s,studioUrl:r,meshUrl:a,mcpUrl:n}){const i=D({studioUrl:r,meshUrl:a}),u=W.mcpClient(e,o??"self",s??"",n??i??"");if(!n&&(!o||o===Ze))return Tt({orgSlug:t,token:s,studioUrl:i,toJSONString:`mcp-client:${u.join(":")}`});const p=n??At(o,t,i),l=new wt(bt,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),d=new Et(new URL(p),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream",...s?{Authorization:`Bearer ${s}`}:{}}}});return await l.connect(d),l.toJSON=()=>`mcp-client:${u.join(":")}`,l}function ue(o){const{connectionId:e,token:t,studioUrl:s,meshUrl:r,mcpUrl:a,orgId:n}=o,i=D({studioUrl:s,meshUrl:r});return{queryKey:W.mcpClient(n,e??"self",t??"",a??i??""),queryFn:()=>le(o),staleTime:1/0,gcTime:6e4}}function zt(o){const e=Q.c(2);let t;e[0]!==o?(t=ue(o),e[0]=o,e[1]=t):t=e[1];const{data:s}=ae(t);return s}function Qt(o){const e=Q.c(2);let t;e[0]!==o?(t=ue(o),e[0]=o,e[1]=t):t=e[1];const{data:s}=Ye(t);return s??null}function Wt(o){const e=Q.c(19),{connectionId:t,orgId:s,orgSlug:r,token:a,studioUrl:n,meshUrl:i,mcpUrl:u}=o;let p;e[0]!==i||e[1]!==n?(p=D({studioUrl:n,meshUrl:i}),e[0]=i,e[1]=n,e[2]=p):p=e[2];const l=p;let d;e[3]!==t||e[4]!==u||e[5]!==s||e[6]!==l||e[7]!==a?(d=t!==void 0?W.mcpClient(s,t??"self",a??"",u??l??""):["mcp","client","skip",s],e[3]=t,e[4]=u,e[5]=s,e[6]=l,e[7]=a,e[8]=d):d=e[8];const f=d;let m;e[9]!==t||e[10]!==u||e[11]!==s||e[12]!==r||e[13]!==l||e[14]!==a?(m=async()=>t===void 0?null:le({connectionId:t,orgId:s,orgSlug:r,token:a,studioUrl:l,mcpUrl:u}),e[9]=t,e[10]=u,e[11]=s,e[12]=r,e[13]=l,e[14]=a,e[15]=m):m=e[15];let T;e[16]!==f||e[17]!==m?(T={queryKey:f,queryFn:m,staleTime:1/0,gcTime:6e4},e[16]=f,e[17]=m,e[18]=T):T=e[18];const{data:y}=ae(T);return y??null}export{dt as A,$t as C,ct as P,st as R,Ze as S,Mt as W,Dt as a,Nt as b,Wt as c,Ut as d,jt as e,tt as f,xt as g,le as h,Ot as i,kt as j,yt as k,Ct as l,ue as m,z as n,wt as o,Ft as p,Qt as q,Lt as r,et as s,Ht as t,zt as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as m,m as g,bI as T,K as E,G as k,d as K,n as $,a as D,y as H}from"./index-y6Z5iMfg.js";import{D as O}from"./use-destination-route-CY15sZqw.js";import{d as Q,g as I}from"./use-virtual-mcp-Bnfc4yEo.js";import{a as V}from"./hooks-Bv30myGB.js";import{p as j,d as A,w as x}from"./thread-intent-q_RVjRN0.js";import{h as P,b as R,g as B,r as Y}from"./github-repo-CTPv5ZM2.js";function F(t,e){if(!e)return!0;if(t.partial)return!1;const n=j(t.metadata?.runtime);return n===null||n===e}function U(t,e,n,a,r){let o=null;for(const s of t)s.virtual_mcp_id===e&&s.created_by===n&&(s.hidden||F(s,a)&&(r&&s.branch===r||(!o||s.updated_at>o.updated_at)&&(o=s)));return o}function pe(t,e,n,a){return t.find(r=>!r.hidden&&r.virtual_mcp_id===e&&r.created_by===n&&r.title==="New chat"&&!r.harness_id&&F(r,a))}function z(t,e,n,a,r,o){return r?U(t,e,n,a,o?.baseBranch)??void 0:U(t,e,n,a)??void 0}const J=6e4,C=3e4;function q(t){return{number:t.number,title:t.title,body:t.body,state:t.state==="open"?"open":"closed",merged:t.state==="merged",mergedAt:t.mergedAt,base:t.base,head:t.head,headSha:t.headSha,headRepoFullName:t.headRepoPath,htmlUrl:t.url,author:t.author,changedFiles:t.changedFiles}}function M(t){return{id:t.id,name:t.name,status:t.state==="running"?"in_progress":t.state,conclusion:t.conclusion,htmlUrl:t.url??"",durationMs:t.durationMs}}function N(t){const{orgSlug:e,target:n,owner:a,repo:r,branch:o}=t;return{queryKey:E.githubPrState(e,R(n),a,r,o),queryFn:()=>T(e,"CHANGE_REQUEST_STATE",{...n,branch:o}),enabled:!!o&&P(n)&&!!a&&!!r,refetchInterval:J,refetchIntervalInBackground:!1,staleTime:C}}function W(t){const e=m.c(4);let n;e[0]!==t?(n=N(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:X},e[2]=n,e[3]=a):a=e[3],g(a)}function X(t){return t.changeRequest?q(t.changeRequest):null}function be(t){const e=m.c(4);let n;e[0]!==t?(n=N(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:Z},e[2]=n,e[3]=a):a=e[3],g(a)}function Z(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(M):[]}function ye(t){const e=m.c(4);let n;e[0]!==t?(n=N(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:ee},e[2]=n,e[3]=a):a=e[3],g(a)}function ee(t){return(t.changeRequest?.comments??[]).map(te)}function te(t){return{id:t.id,author:t.author,body:t.body,createdAt:t.createdAt,htmlUrl:t.url}}const ne=5*6e4;function Te(t){const e=m.c(20),{orgSlug:n,target:a,owner:r,repo:o,base:s}=t;let u;e[0]!==s||e[1]!==n||e[2]!==r||e[3]!==o||e[4]!==a?(u=E.githubLastPublishedPr(n,R(a),r,o,s),e[0]=s,e[1]=n,e[2]=r,e[3]=o,e[4]=a,e[5]=u):u=e[5];let i;e[6]!==s||e[7]!==n||e[8]!==a?(i=()=>T(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:s}),e[6]=s,e[7]=n,e[8]=a,e[9]=i):i=e[9];let l;e[10]!==t.enabled||e[11]!==s||e[12]!==r||e[13]!==o||e[14]!==a?(l=(t.enabled??!0)&&!!s&&P(a)&&!!r&&!!o,e[10]=t.enabled,e[11]=s,e[12]=r,e[13]=o,e[14]=a,e[15]=l):l=e[15];let c;return e[16]!==u||e[17]!==i||e[18]!==l?(c={queryKey:u,queryFn:i,enabled:l,staleTime:ne,select:ae},e[16]=u,e[17]=i,e[18]=l,e[19]=c):c=e[19],g(c)}function ae(t){return t.changeRequest?q(t.changeRequest):null}const re=50;function Ee(t){const e=m.c(17),{orgSlug:n,target:a,owner:r,repo:o}=t;let s;e[0]!==n||e[1]!==r||e[2]!==o||e[3]!==a?(s=E.githubOpenPrs(n,R(a),r,o),e[0]=n,e[1]=r,e[2]=o,e[3]=a,e[4]=s):s=e[4];let u;e[5]!==n||e[6]!==a?(u=()=>T(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:re}),e[5]=n,e[6]=a,e[7]=u):u=e[7];let i;e[8]!==t.enabled||e[9]!==r||e[10]!==o||e[11]!==a?(i=(t.enabled??!0)&&P(a)&&!!r&&!!o,e[8]=t.enabled,e[9]=r,e[10]=o,e[11]=a,e[12]=i):i=e[12];let l;return e[13]!==s||e[14]!==u||e[15]!==i?(l={queryKey:s,queryFn:u,enabled:i,staleTime:C,select:se},e[13]=s,e[14]=u,e[15]=i,e[16]=l):l=e[16],g(l)}function se(t){return t.changeRequests.map(q)}function Re(t){const e=m.c(14),{orgSlug:n,target:a,owner:r,repo:o,checkRunId:s}=t;let u;e[0]!==s||e[1]!==n||e[2]!==r||e[3]!==o||e[4]!==a?(u=E.githubCheckRun(n,R(a),r,o,s),e[0]=s,e[1]=n,e[2]=r,e[3]=o,e[4]=a,e[5]=u):u=e[5];let i;e[6]!==s||e[7]!==n||e[8]!==a?(i=()=>T(n,"CHANGE_REQUEST_CHECK_LOG",{...a,checkId:s}),e[6]=s,e[7]=n,e[8]=a,e[9]=i):i=e[9];const l=t.enabled&&!!s;let c;return e[10]!==u||e[11]!==i||e[12]!==l?(c={queryKey:u,queryFn:i,enabled:l,staleTime:C,select:oe},e[10]=u,e[11]=i,e[12]=l,e[13]=c):c=e[13],g(c)}function oe(t){return{title:null,summary:t.report,text:null}}function ue(t,e){const{org:n}=k(),a=B(t);return W({orgId:n.id,orgSlug:n.slug,target:Y(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const ie=[];function Se(){const t=m.c(13),e=K(),{org:n,locator:a}=k(),r=$(),o=Q(),{data:s}=D.useSession(),u=V(),i=ue(void 0,null);let l;t[0]!==i||t[1]!==o||t[2]!==a||t[3]!==u?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==s?.user?.id?(l=(f,d,b)=>{const h=(o??[]).find(G=>G.id===f),S=!!(h&&B(h)),L=!d?.runtime,v=L?void 0:z(u?.threads.get()??ie,f,s?.user?.id,b??(h?A(h.metadata):void 0),S,{baseBranch:i}),y=L?void 0:v?.id??crypto.randomUUID();y&&!v&&d?.runtime&&x(sessionStorage,a,y,{runtime:d.runtime});const w=y?{thread:y}:{},_=d?.panel?H(d.panel):null;if(!_?.panel){e({to:O.home,params:{org:n.slug},search:{virtualmcpid:f,...w}});return}e({to:O.agents,params:{org:n.slug,panel:_.panel},search:{..._.payload,virtualmcpid:f,...w}})},t[0]=i,t[1]=o,t[2]=a,t[3]=u?.threads,t[4]=e,t[5]=n.slug,t[6]=s?.user?.id,t[7]=l):l=t[7];const c=l;let p;return t[8]!==o||t[9]!==c||t[10]!==n||t[11]!==r?(p=(f,d)=>{const b=o.find(h=>h.id===f);if(d?.runtime)return c(f,d,d.runtime);if(b)return c(f,d,A(b.metadata));I(r,n).then(h=>h.find(S=>S.id===f)).catch(le).then(h=>c(f,d,h?A(h.metadata):void 0))},t[8]=o,t[9]=c,t[10]=n,t[11]=r,t[12]=p):p=t[12],p}function le(){}export{W as a,be as b,Re as c,ye as d,Te as e,Ee as f,ue as g,pe as h,z as i,N as p,Se as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as E,c as r,G as S,m as h,bI as M,K as T,bz as R,a7 as w,n as N,e as z}from"./index-y6Z5iMfg.js";import{W as F}from"./use-mcp-client-Cw1fcLqm.js";import{D as P,o as $,a as x}from"./schema-BDy_4D7A.js";import{r as D}from"./task-board-By8eCqZc.js";const b={organizationId:"",sidebar_items:null,enabled_plugins:null,coding_agent_mcp_excluded:null,registry_config:null,simple_mode:null,default_home_agents:null,flags:null},A={tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}};function O(t,e){return{queryKey:T.organizationSettings(e),queryFn:async()=>{try{return await M(t,"ORGANIZATION_SETTINGS_GET",{})}catch{return{...b,organizationId:e}}},staleTime:6e4}}function c(t){const e=r.c(6),{org:n}=S();let s;e[0]!==n.id||e[1]!==n.slug?(s=O(n.slug,n.id),e[0]=n.id,e[1]=n.slug,e[2]=s):s=e[2];const o=t;let i;return e[3]!==s||e[4]!==o?(i={...s,select:o},e[3]=s,e[4]=o,e[5]=i):i=e[5],h(i)}function B(t,e){const n=r.c(3);let s;n[0]!==t||n[1]!==e?(s=O(e,t),n[0]=t,n[1]=e,n[2]=s):s=n[2];const{data:o}=h(s);return o??null}function m(){const t=r.c(9),{org:e}=S(),n=w(),s=N();let o;t[0]!==e||t[1]!==n?(o=async l=>{const u=await n.call("ORGANIZATION_SETTINGS_UPDATE",{organizationId:e.id,...l});if(!u)throw new Error("ORGANIZATION_SETTINGS_UPDATE returned no payload");return u},t[0]=e,t[1]=n,t[2]=o):o=t[2];let i;t[3]!==e||t[4]!==s?(i=l=>{s.setQueryData(T.organizationSettings(e.id),u=>({...u??b,...l}))},t[3]=e,t[4]=s,t[5]=i):i=t[5];let a;return t[6]!==o||t[7]!==i?(a={mutationFn:o,onSuccess:i},t[6]=o,t[7]=i,t[8]=a):a=t[8],z(a)}function U(t){return t?.tiers?{tiers:{fast:t.tiers.fast??null,smart:t.tiers.smart??null,thinking:t.tiers.thinking??null,image:t.tiers.image??null,web_search:t.tiers.web_search??null,deep_research:t.tiers.deep_research??null}}:A}function V(){const{data:t}=c(k);return t??A}function k(t){return U(t.simple_mode)}function H(){const t=r.c(7),e=m();let n,s;t[0]!==e?(n=(i,a)=>e.mutate({simple_mode:i},a),s=(i,a)=>e.mutateAsync({simple_mode:i},a),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function J(){return d("reports_only")}function d(t){const e=r.c(5);let n;e[0]!==t?(n=i=>$(i.flags,t),e[0]=t,e[1]=n):n=e[1];const{data:s}=c(n);let o;return e[2]!==s||e[3]!==t?(o=s??P.has(t),e[2]=s,e[3]=t,e[4]=o):o=e[4],o}function C(t){return!!t&&t.trim().toLowerCase().endsWith("@deco.cx")}function X(){const{data:t}=E.useSession();return C(t?.user?.email)}function tt(){const t=r.c(8),{data:e}=E.useSession(),n=R();let s;t[0]!==n.auth.localMode||t[1]!==e?.user?.email?(s=n.auth.localMode===!0||C(e?.user?.email),t[0]=n.auth.localMode,t[1]=e?.user?.email,t[2]=s):s=t[2];const o=s,i=n.hostingControlPlaneGa===!0,a=n.monitorGa===!0,l=d("hosting_enabled"),u=d("deco_analytics_enabled"),G=d("e2e_enabled"),I=d("monitor_enabled"),g=o||i||l,_=o||i||u,p=o||i||G,y=o||a||I;let f;return t[3]!==g||t[4]!==_||t[5]!==p||t[6]!==y?(f={hosting:g,analytics:_,e2e:p,monitor:y},t[3]=g,t[4]=_,t[5]=p,t[6]=y,t[7]=f):f=t[7],f}function et(){const{data:t}=c(L);return t??!1}function L(t){return x(t.flags)}function nt(){const{data:t}=c(v);return t??!0}function v(t){return D(t.flags)}function st(){const t=r.c(7),e=m();let n,s;t[0]!==e?(n=(i,a,l)=>e.mutate({flags:{[i]:a}},l),s=(i,a,l)=>e.mutateAsync({flags:{[i]:a}},l),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function ot(){const t=r.c(2),{data:e}=c(K);let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function K(t){return t.coding_agent_mcp_excluded}function it(){const t=r.c(5),e=m();let n;t[0]!==e?(n=(o,i)=>e.mutate({coding_agent_mcp_excluded:o},i),t[0]=e,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s={...e,mutate:n},t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function Q(){const{data:t}=c(Y);return t??null}function Y(t){return t.registry_config}function at(){const t=r.c(7),e=m();let n,s;t[0]!==e?(n=(i,a)=>e.mutate({registry_config:i},a),s=(i,a)=>e.mutateAsync({registry_config:i},a),t[0]=e,t[1]=n,t[2]=s):(n=t[1],s=t[2]);let o;return t[3]!==e||t[4]!==n||t[5]!==s?(o={...e,mutate:n,mutateAsync:s},t[3]=e,t[4]=n,t[5]=s,t[6]=o):o=t[6],o}function lt(){const t=r.c(5),{org:e}=S(),n=Q();let s;t[0]!==e.id?(s=F.REGISTRY(e.id),t[0]=e.id,t[1]=s):s=t[1];const o=s;let i;return t[2]!==o||t[3]!==n?(i=a=>{if(!n)return a===o;const l=n.registries[a];return l?l.enabled:a===o},t[2]=o,t[3]=n,t[4]=i):i=t[4],i}export{J as a,V as b,nt as c,tt as d,lt as e,B as f,H as g,Q as h,et as i,st as j,ot as k,it as l,at as m,X as n,d as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as g,k as E,f as R,u as N,eN as O,d as k,y as x,eO as $,aS as L}from"./index-y6Z5iMfg.js";import{u as M,D as l}from"./use-destination-route-CY15sZqw.js";function F(){const e=g.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t={select:U},e[0]=t):t=e[0],E(t)}function U(e){for(let t=e.matches.length-1;t>=0;t--){const a=e.matches[t]?.staticData.defaultMain;if(a)return a}return null}const j={board:l.tasks,files:l.library,reports:l.reports,overview:l.home,discover:l.discover};function w(){const e=g.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const a=R(t);let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[1]=r):r=e[1];const s=N(r);let n;return e[2]!==a.panel||e[3]!==s?(n=O(a.panel,s),e[2]=a.panel,e[3]=s,e[4]=n):n=e[4],n}function Y(e){const t=g.c(6),a=w(),r=F();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},t[0]=s):s=t[0];const n=N(s);let c;return t[1]!==e||t[2]!==a||t[3]!==r||t[4]!==n.mainpanel?(c=L({panelTabId:a,mainPanelParam:n.mainpanel,routeDefaultMain:r,metadata:e}),t[1]=e,t[2]=a,t[3]=r,t[4]=n.mainpanel,t[5]=c):c=t[5],c.activeTab}function q(){const e=g.c(15),t=k();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const r=R(a);let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[1]=s):s=e[1];const n=N(s).virtualmcpid,c=r.org??"",S=M()===l.agents,d=r.taskId;let h;e[2]!==d?(h=(m,u,o)=>f=>{const i=u?{...f}:{thread:f.thread,sidepanel:f.sidepanel};return d&&(i.thread=d),{...o?.search?o.search(i):i,...m,mainpanel:void 0}},e[2]=d,e[3]=h):h=e[3];const T=h;let b;e[4]!==n||e[5]!==t||e[6]!==T||e[7]!==S||e[8]!==c?(b=(m,u)=>{const{panel:o,payload:f}=x(m),i=u?.replace??!0,I=!!o&&$(o),D=T(f,S&&!I,u);if(o&&I){const p=j[o];if(p===l.tasks){t({to:p,params:{org:c,taskKey:void 0},search:D,replace:i});return}t({to:p,params:{org:c},search:D,replace:i});return}const A=u?.virtualmcpid??n;t({to:l.agents,params:{org:c,panel:o},search:p=>({...D(p),virtualmcpid:A}),replace:i})},e[4]=n,e[5]=t,e[6]=T,e[7]=S,e[8]=c,e[9]=b):b=e[9];const P=b;let _;e[10]!==t?(_=m=>t({to:".",search:B,replace:m?.replace??!0}),e[10]=t,e[11]=_):_=e[11];const y=_;let v;return e[12]!==y||e[13]!==P?(v={openPanel:P,closePanel:y},e[12]=y,e[13]=P,e[14]=v):v=e[14],v}function B(e){return{...e,mainpanel:!1}}export{q as a,F as b,Y as c,w as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as C,G as R}from"./index-y6Z5iMfg.js";import{u as p}from"./use-connection-ClORxmw4.js";import{W as a}from"./use-mcp-client-Cw1fcLqm.js";import{h as y}from"./use-organization-settings-DucmPYOE.js";function G(){const e=C.c(19),{org:i}=R(),o=y();let l;e[0]!==i.id?(l=a.REGISTRY(i.id),e[0]=i.id,e[1]=l):l=e[1];const d=l;let f;e[2]!==i.id?(f=a.COMMUNITY_REGISTRY(i.id),e[2]=i.id,e[3]=f):f=e[3];const g=f;let r;e[4]!==g||e[5]!==d?(r=[d,g],e[4]=g,e[5]=d,e[6]=r):r=e[6];let t;if(e[7]!==o||e[8]!==r){if(t=new Set(r),o?.registries){let s;e[10]!==o.registries?(s=Object.keys(o.registries),e[10]=o.registries,e[11]=s):s=e[11];for(const u of s)t.add(u)}e[7]=o,e[8]=r,e[9]=t}else t=e[9];const m=p();let n;e[12]!==m?(n=m??[],e[12]=m,e[13]=n):n=e[13];let c;if(e[14]!==t||e[15]!==n){let s;e[17]!==t?(s=u=>t.has(u.id),e[17]=t,e[18]=s):s=e[18],c=n.filter(s),e[14]=t,e[15]=n,e[16]=c}else c=e[16];return c}export{G as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as q,b as K,r as w,j as s,l as Q}from"./index-y6Z5iMfg.js";import{al as _}from"./agent-icon-6EllA70W.js";import{i as Y}from"./SearchMd-hxPQERkg.js";import{D as Z,b as ee,d as te,c as se}from"./dialog-CyDGwxcX.js";import{I as re}from"./input-DRjCNSPN.js";import{k as le,l as oe,m as ie,o as X,G as ne,p as ce,q as ae}from"./index-BEyFhSeZ.js";const fe=12,D=new Set,F=new Set;function ue(){for(const r of F)r()}function de(r){return D.has(r)?!0:D.size>=fe?!1:(D.add(r),!0)}function J(r){D.delete(r)&&ue()}function me(r){return F.add(r),()=>{F.delete(r)}}function ve(r,e){const t=w.useRef(!1),[d,i]=w.useState(!1),o=w.useRef(null),f=w.useRef(null),c=w.useRef(null),l=w.useRef(r);l.current=r;const[a]=w.useState(()=>{const n=()=>{c.current?.(),c.current=null},u=()=>t.current?!0:de(e)?(t.current=!0,i(!0),n(),!0):!1;return v=>{if(f.current=v,o.current&&(o.current.disconnect(),o.current=null),n(),!v){t.current&&(J(e),t.current=!1,i(!1));return}queueMicrotask(()=>{if(f.current!==v)return;const x=new IntersectionObserver(m=>{if(m[0]?.isIntersecting??!1){!u()&&!c.current&&(c.current=me(()=>{f.current===v&&u()}));return}n(),t.current&&(J(e),t.current=!1,i(!1))},{root:l.current.current,rootMargin:"160px 0px"});x.observe(v),o.current=x})}});return{ref:a,iframeActive:d}}function pe(r){const e=q.c(8),{previewUrl:t,title:d,scrollRootRef:i,slotId:o}=r,{ref:f,iframeActive:c}=ve(i,o),[l,a]=w.useState(!1);let n;e[0]!==c||e[1]!==l||e[2]!==t||e[3]!==d?(n=c?s.jsxs(s.Fragment,{children:[!l&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:s.jsx(_,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),s.jsx("iframe",{src:t,title:`Preview ${d}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>a(!0)})]}):s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(_,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=c,e[1]=l,e[2]=t,e[3]=d,e[4]=n):n=e[4];let u;return e[5]!==f||e[6]!==n?(u=s.jsx("div",{ref:f,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:n}),e[5]=f,e[6]=n,e[7]=u):u=e[7],u}function xe(r){const e=q.c(26),{entry:t,previewUrl:d,scrollRootRef:i,onSelect:o}=r,f=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let c;e[0]!==f?(c=Q("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",f),e[0]=f,e[1]=c):c=e[1];let l;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==d||e[5]!==i?(l=s.jsx(pe,{previewUrl:d,title:t.title,scrollRootRef:i,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=d,e[5]=i,e[6]=l):l=e[6];let a;e[7]!==t.isSavedBlock?(a=t.isSavedBlock?{color:ne}:void 0,e[7]=t.isSavedBlock,e[8]=a):a=e[8];let n;e[9]!==a?(n=s.jsx(_,{className:"h-4 w-4 shrink-0",style:a}),e[9]=a,e[10]=n):n=e[10];let u;e[11]!==t.title?(u=s.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=u):u=e[12];let v;e[13]!==t.description?(v=t.description&&s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=v):v=e[14];let x;e[15]!==u||e[16]!==v?(x=s.jsxs("div",{className:"min-w-0 flex-1",children:[u,v]}),e[15]=u,e[16]=v,e[17]=x):x=e[17];let m;e[18]!==n||e[19]!==x?(m=s.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[n,x]}),e[18]=n,e[19]=x,e[20]=m):m=e[20];let h;return e[21]!==o||e[22]!==c||e[23]!==l||e[24]!==m?(h=s.jsxs("button",{type:"button",onClick:o,className:c,children:[l,m]}),e[21]=o,e[22]=c,e[23]=l,e[24]=m,e[25]=h):h=e[25],h}function Ne(r){const e=q.c(51),{open:t,onOpenChange:d,meta:i,decofile:o,previewBaseUrl:f,onSelect:c}=r,l=K(),[a,n]=w.useState(""),[u,v]=w.useState(t),x=w.useRef(null);t!==u&&(v(t),t&&n(""));let m,h,S,b,j,N,R,y,g,C,T;if(e[0]!==o||e[1]!==i||e[2]!==d||e[3]!==c||e[4]!==t||e[5]!==f||e[6]!==a||e[7]!==l){const z=t&&i&&o?le(i,o):[],W=i?oe(i):"",G=o?ie(o):void 0,H=new Map;if(t&&W)for(const p of z)H.set(p.resolveType,X(f,W,p.previewBlock,G));const M=a.trim().toLowerCase(),V=M?z.filter(p=>p.title.toLowerCase().includes(M)||p.resolveType.toLowerCase().includes(M)||p.description?.toLowerCase().includes(M)):z;h=Z,C=t,T=d,m=ee,R="top-3 right-3",y="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let U;e[19]!==l?(U=l("sectionsEditor.addSectionModal.title"),e[19]=l,e[20]=U):U=e[20];let A;e[21]!==U?(A=s.jsx(te,{children:U}),e[21]=U,e[22]=A):A=e[22];let O;e[23]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Y,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[23]=O):O=e[23];let $;e[24]===Symbol.for("react.memo_cache_sentinel")?($=p=>n(p.target.value),e[24]=$):$=e[24];let B;e[25]!==l?(B=l("sectionsEditor.addSectionModal.searchPlaceholder"),e[25]=l,e[26]=B):B=e[26];let k;e[27]!==a||e[28]!==B?(k=s.jsxs("div",{className:"relative pt-2",children:[O,s.jsx(re,{value:a,onChange:$,placeholder:B,className:"h-9 pl-8"})]}),e[27]=a,e[28]=B,e[29]=k):k=e[29],e[30]!==A||e[31]!==k?(g=s.jsxs(se,{className:"shrink-0 border-b px-4 py-3 text-left",children:[A,k]}),e[30]=A,e[31]=k,e[32]=g):g=e[32],j=x,N="min-h-0 flex-1 overflow-y-auto",S="p-4",b=V.length===0?s.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:l("sectionsEditor.addSectionModal.noSectionsFound")}):s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:V.map(p=>s.jsx(xe,{entry:p,scrollRootRef:x,previewUrl:H.get(p.resolveType)??X(f,W,p.previewBlock,G),onSelect:()=>c(p)},p.resolveType))}),e[0]=o,e[1]=i,e[2]=d,e[3]=c,e[4]=t,e[5]=f,e[6]=a,e[7]=l,e[8]=m,e[9]=h,e[10]=S,e[11]=b,e[12]=j,e[13]=N,e[14]=R,e[15]=y,e[16]=g,e[17]=C,e[18]=T}else m=e[8],h=e[9],S=e[10],b=e[11],j=e[12],N=e[13],R=e[14],y=e[15],g=e[16],C=e[17],T=e[18];let P;e[33]!==S||e[34]!==b?(P=s.jsx("div",{className:S,children:b}),e[33]=S,e[34]=b,e[35]=P):P=e[35];let I;e[36]!==P||e[37]!==j||e[38]!==N?(I=s.jsx("div",{ref:j,className:N,children:P}),e[36]=P,e[37]=j,e[38]=N,e[39]=I):I=e[39];let L;e[40]!==m||e[41]!==I||e[42]!==R||e[43]!==y||e[44]!==g?(L=s.jsxs(m,{closeButtonClassName:R,className:y,children:[g,I]}),e[40]=m,e[41]=I,e[42]=R,e[43]=y,e[44]=g,e[45]=L):L=e[45];let E;return e[46]!==h||e[47]!==L||e[48]!==C||e[49]!==T?(E=s.jsx(h,{open:C,onOpenChange:T,children:L}),e[46]=h,e[47]=L,e[48]=C,e[49]=T,e[50]=E):E=e[50],E}function Re(r){const e=q.c(4),{previewServerUrl:t,runtime:d}=ce(r.virtualMcpId),i=d==="cms";let o;return e[0]!==i||e[1]!==r.sandboxUrl||e[2]!==t?(o=ae({sandboxUrl:r.sandboxUrl,previewServerUrl:t,fastPreviewActive:i}),e[0]=i,e[1]=r.sandboxUrl,e[2]=t,e[3]=o):o=e[3],o}export{Ne as A,Re as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as C,G as I,eP as S,cd as _,K as A,eQ as y,m,eR as L,cc as T,eS as U}from"./index-y6Z5iMfg.js";import{S as g,u as V,q as p,m as R}from"./use-mcp-client-Cw1fcLqm.js";function $(o){const t=C.c(5);let e;t[0]!==o?(e=o===void 0?{}:o,t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=V(i);return S(s.id,"VIRTUAL_MCP",l,n)}function h(o){const t=C.c(14);let e;t[0]!==o?(e={},t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=p(i);let c;t[5]!==l||t[6]!==n||t[7]!==s.id?(c=L(s.id,"VIRTUAL_MCP",l,n),t[5]=l,t[6]=n,t[7]=s.id,t[8]=c):c=t[8];const r=!!l;let u;t[9]!==c||t[10]!==r?(u={...c,enabled:r},t[9]=c,t[10]=r,t[11]=u):u=t[11];const{data:d}=m(u);let a;return t[12]!==d?(a=d??[],t[12]=d,t[13]=a):a=t[13],a}function O(o){const t=C.c(10),{org:e}=I();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const s=p(n),i=o??void 0;let l;t[3]!==s||t[4]!==e.id||t[5]!==i?(l=y(e.id,"VIRTUAL_MCP",i,s),t[3]=s,t[4]=e.id,t[5]=i,t[6]=l):l=t[6];const c=!!s&&!!o;let r;t[7]!==l||t[8]!==c?(r={...l,enabled:c},t[7]=l,t[8]=c,t[9]=r):r=t[9];const{data:u}=m(r);return u?.item??null}async function w(o,t,e={}){const n=await o.fetchQuery(R({connectionId:g,orgId:t.id,orgSlug:t.slug})),s=L(t.id,"VIRTUAL_MCP",n,e);return s.select(await o.fetchQuery(s))}function E(o){const t=C.c(18);let e;t[0]!==o?(e={},t[0]=o,t[1]=e):e=t[1];const n=e,{org:s}=I();let i;t[2]!==s.id||t[3]!==s.slug?(i={connectionId:g,orgId:s.id,orgSlug:s.slug},t[2]=s.id,t[3]=s.slug,t[4]=i):i=t[4];const l=p(i);let c;t[5]!==l||t[6]!==n||t[7]!==s.id?(c=U(s.id,"VIRTUAL_MCP",l,n),t[5]=l,t[6]=n,t[7]=s.id,t[8]=c):c=t[8];const r=!!l;let u;t[9]!==c||t[10]!==r?(u={...c,enabled:r},t[9]=c,t[10]=r,t[11]=u):u=t[11];const{data:d}=m(u);let a;t[12]!==d?.items?(a=d?.items??[],t[12]=d?.items,t[13]=a):a=t[13];const M=d?.totalCount,P=d?.hasMore;let f;return t[14]!==a||t[15]!==M||t[16]!==P?(f={items:a,totalCount:M,hasMore:P},t[14]=a,t[15]=M,t[16]=P,t[17]=f):f=t[17],f}function k(o){const t=C.c(3),{org:e}=I();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const s=V(n);return T(e.id,"VIRTUAL_MCP",o??void 0,s)}function v(o){const t=C.c(15),{org:e}=I();let n;t[0]!==e.id||t[1]!==e.slug?(n={connectionId:g,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=n):n=t[2];const s=V(n);let i,l,c;t[3]!==o||t[4]!==e.id?(i=[...o].sort(),c=m,l=A.virtualMcpLastUsed(e.id,i),t[3]=o,t[4]=e.id,t[5]=i,t[6]=l,t[7]=c):(i=t[5],l=t[6],c=t[7]);const r=i.length>0;let u;t[8]!==s||t[9]!==i?(u=async()=>{const M=(await s.callTool({name:"VIRTUAL_MCP_LAST_USED_LIST",arguments:{ids:i}})).structuredContent??{items:[]},P=new Map;for(const f of M.items)P.set(f.id,f);return P},t[8]=s,t[9]=i,t[10]=u):u=t[10];let d;return t[11]!==l||t[12]!==r||t[13]!==u?(d={queryKey:l,enabled:r,staleTime:3e4,queryFn:u},t[11]=l,t[12]=r,t[13]=u,t[14]=d):d=t[14],c(d)}function x(){const o=C.c(3),{org:t}=I();let e;o[0]!==t.id||o[1]!==t.slug?(e={connectionId:g,orgId:t.id,orgSlug:t.slug},o[0]=t.id,o[1]=t.slug,o[2]=e):e=o[2];const n=V(e);return _(t.id,"VIRTUAL_MCP",n)}export{$ as a,x as b,v as c,h as d,E as e,O as f,w as g,k as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as u}from"./infiniteQueryObserver-CvFtTJPb.js";import{fd as i}from"./index-y6Z5iMfg.js";function t(e,r){return i(e,u,r)}export{t as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{I as s}from"./infiniteQueryObserver-CvFtTJPb.js";import{fd as u,bY as n}from"./index-y6Z5iMfg.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as K,b as X,r as Z,j as n,l as rt,a1 as ut,a4 as ht,B as tt,a2 as xt}from"./index-y6Z5iMfg.js";import{z as gt,a8 as at,aJ as bt}from"./agent-icon-6EllA70W.js";import{i as vt}from"./ChevronRight-B76sbAXC.js";import{L as yt}from"./label-DGsSvY2I.js";import{S as lt}from"./scroll-area-C18Y2v3L.js";import{S as jt}from"./switch-CPLM-IZy.js";import{V as Tt}from"./view-mode-toggle-BlEO3gFJ.js";import{bu as ct,bv as mt,bw as Nt,bx as _t,by as kt,bz as U,bA as wt}from"./index-BEyFhSeZ.js";import"./AlertCircle-Df7Uu4Sr.js";import"./Tool01-CmpQe3MS.js";import"./ArrowUp-DmWBbOjK.js";import"./ArrowLeft-Ce4LVTaQ.js";import"./Tool02-BAA6OFl0.js";import"./ArrowRight-CuO69upc.js";import"./TrendUp01-fHRYAiew.js";import"./ZoomOut-DhJWoynj.js";import"./Users03-B4Km0_9u.js";import"./CheckCircle-DWvslkKl.js";import"./Check-C1wq38_E.js";import"./ChevronUp-B0KEDz5f.js";import"./ChevronSelectorVertical-C4wJ3zDR.js";import"./DotsVertical-CBmzJDPB.js";import"./UserSquare-CXhk4rLY.js";import"./Copy01-rsN5AnPv.js";import"./CreditCard01-Cqs_Biv7.js";import"./Download01-zZEPtQ0U.js";import"./Settings02-t15FjJbr.js";import"./Eye-DFgd5114.js";import"./Share07-CJrTonmW.js";import"./GitBranch01-B7iymaqC.js";import"./Globe01-Df6dZmsR.js";import"./XClose-DvenHyNp.js";import"./HardDrive-CiahcooN.js";import"./Image01-CMpSR3RQ.js";import"./Key01-t3bX5YI3.js";import"./Link01-pX5C3rEv.js";import"./LinkExternal01-CzRiacvQ.js";import"./Monitor01-jzbehxNG.js";import"./Sun-vdviKSpi.js";import"./Package-CiAH049d.js";import"./Palette-CmMvG40G.js";import"./Play-k9_JCuZW.js";import"./Plus-Bac7Bl-V.js";import"./SearchLg-iYej-M-S.js";import"./SearchMd-hxPQERkg.js";import"./Shield01-DS-tpugO.js";import"./Stars01-ByE0-f1z.js";import"./Trash01-C6vCLvEw.js";import"./Upload01-lE597uPz.js";import"./User01-BPodfm7s.js";import"./Users01-Dgbd4CM_.js";import"./XCircle-BK1898xU.js";import"./Zap-nPZGKdXf.js";import"./select-BGnwGqnU.js";import"./chat-context-C6UT7ht1.js";import"./use-panel-navigate-C6Ga2vR8.js";import"./use-destination-route-CY15sZqw.js";import"./autosend-DI1ZpOT0.js";import"./thread-intent-q_RVjRN0.js";import"./slugify-CEUa2lfQ.js";import"./hooks-Bv30myGB.js";import"./use-mcp-client-Cw1fcLqm.js";import"./auth-DeD0YpKg.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-Bm_3HC4t.js";import"./task-board-By8eCqZc.js";import"./schema-BDy_4D7A.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Bnfc4yEo.js";import"./use-ai-providers-BMexfNaB.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-C0NWoSQc.js";import"./thread-route-jI9qvJe_.js";import"./dialog-CyDGwxcX.js";import"./use-organization-settings-DucmPYOE.js";import"./automation-runs-CoIkXCsB.js";import"./useInfiniteQuery-DThUrotQ.js";import"./infiniteQueryObserver-CvFtTJPb.js";import"./use-connection-ClORxmw4.js";import"./table-DSIbUmyY.js";import"./empty-state-DfBha5W6.js";import"./use-infinite-scroll-Bw5rNIGx.js";import"./use-members-C23rfxcZ.js";import"./use-org-auth-client-DvlpnDFO.js";import"./use-automations-BgzAjzua.js";import"./useSuspenseInfiniteQuery-Dsg0_SX3.js";import"./avatar-CfO1mReu.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-copy-DUxpBqXm.js";import"./markdown-Y6owwpHy.js";import"./monaco-editor-D3QSLeam.js";import"./editor-D7S6MtwI.js";import"./mcp-app-renderer-Cy31bAY0.js";import"./types-BB_Up-3A.js";import"./shell-layout-CTNVA2t4.js";import"./anchors-yqDzZN4K.js";import"./project-icon-DQTfNALl.js";import"./github-repo-CTPv5ZM2.js";import"./source-system-tabs-CnEGUb4r.js";import"./command-CF7nzIN2.js";import"./index-B_j4TgZF.js";import"./integration-icon-CFGOsRgH.js";import"./required-auth-layout-mSUodrzA.js";import"./use-org-sso-xd-5IiLc.js";import"./use-org-notice-DlsdC1WA.js";import"./use-navigate-to-agent-COVw0ub8.js";import"./use-mcp-prompts-CtjkJFfg.js";import"./form-BnUN8JhF.js";import"./input-DRjCNSPN.js";import"./file-type-icon--TvA6C0i.js";import"./drawer-CqSEztKC.js";import"./collection-search-7NUVJQfN.js";import"./tabs-BVFMEVzk.js";import"./toggle-group-WfRpP-dB.js";import"./task-route-B8aecmdq.js";import"./extract-connection-data-DkL3Oqhk.js";import"./metadata-dUsYcpuu.js";import"./connection-D885aDuM.js";import"./connection-card-Nc1w-XCq.js";import"./use-registry-connections-DBp-MS3e.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-CuF3aDTE.js";import"./connection-form-helpers-B4IwDJJQ.js";import"./authenticate-and-persist-oauth-6UYdTwrd.js";import"./mcp-oauth-Bm9ijvfC.js";import"./collection-tabs-MvaIz7gt.js";import"./badge-GP_pc1i_.js";import"./use-file-configs-Dm3fOdMk.js";import"./site-slug-uya6Wp4-.js";import"./dropdown-menu-CgwRqOnX.js";import"./popover-DrJcYe9C.js";import"./github-icon-7BmoW2Y2.js";import"./get-initials-D-f_fDFw.js";import"./select-model-BNDe5FJr.js";import"./checkbox-ZsR1Bced.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-C46JPU0-.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-C-6LEj0t.js";import"./toolbar-B5cewwJb.js";import"./use-mcp-tools-DRBItGTD.js";import"./skill-preview-BswJw8Eb.js";import"./use-date-fns-locale-40K6SzJD.js";import"./alert-dialog-CFCsKBpN.js";import"./use-debounced-autosave-kf66WQZj.js";import"./search-input-L0lrukmF.js";import"./use-mcp-auth-status-kHe3lJRg.js";import"./breadcrumb-CAKgWNOZ.js";import"./repository-import-picker-DN9Nn9yd.js";import"./repository-picker-s01uE4_E.js";import"./use-debounced-value-v41IOreQ.js";import"./use-secrets-PkTonlJ_.js";import"./client-icons-DHLFDmNu.js";import"./connect-layout-BLwdQBWt.js";import"./self-tool-result-DM7xixxP.js";import"./provision-repo-scoped-github-connection-WQFARyHG.js";import"./track-BYunSel2.js";import"./use-tags-BuxETA7b.js";import"./toolbar-icon-button-BtBUZ8nA.js";import"./safe-image-url-D5z803Ot.js";import"./automation-list-row-Ba1cMA4W.js";import"./site-error--i37Vnuw.js";import"./cards-m7YgOjsz.js";const Et=new Set(["website/matchers/date.ts","$live/matchers/MatchDate.ts"]),St=new Set(["website/matchers/multi.ts","$live/matchers/MatchMulti.ts"]),Ct=new Date(-864e13),Mt=new Date(864e13),At=/\/flags\/multivariate(?:\/[^/]+)?\.ts$/,$t=/\/flags\/multivariate\.ts$/;function Lt(e){let t=e;t.startsWith("pages-")&&(t=t.slice(6).replace(/-\d+$/,""));try{t=decodeURIComponent(t)}catch{}return t}function Rt(e){if(!e||typeof e!="object")return null;const{start:t,end:r}=e,o=typeof t=="string",s=typeof r=="string";if(!o&&!s)return null;const i=o?new Date(t):Ct,a=s?new Date(r):Mt;return Number.isNaN(i.getTime())||Number.isNaN(a.getTime())||o&&s&&a.getTime()<=i.getTime()?null:{start:i,end:a,openStart:!o,openEnd:!s}}function pt(e,t){if(!e||typeof e!="object")return;const r=e.__resolveType;if(typeof r=="string"){if(Et.has(r)){const o=Rt(e);o&&t.push(o);return}if(St.has(r)){const o=e.matchers;if(Array.isArray(o))for(const s of o)pt(s,t)}}}function Dt(e){if(!e||typeof e!="object")return!1;const t=e.__resolveType;if(typeof t!="string"||!At.test(t))return!1;const r=e.variants;return Array.isArray(r)}function Ot(e){if(typeof e=="string"){const c=e.trim();if(c.length===0)return null;try{const m=new URL(c).pathname.split("/").filter(Boolean),p=m[m.length-1];if(p)return decodeURIComponent(p)}catch{}return c.length>80?`${c.slice(0,77)}…`:c}if(!e||typeof e!="object")return null;const t=e,r=t.config,s=t.desktop?.media,i=[t.title,t.name,t.label,t.alt,r?.title,r?.name,r?.typeAlert?.message,s?.alt,Array.isArray(t.matcher)?t.matcher[0]:void 0];for(const c of i)if(typeof c=="string"&&c.trim().length>0)return c.trim();const a=t.__resolveType;if(typeof a=="string"){const l=(a.split("/").pop()??a).replace(/\.(tsx?|jsx?)$/i,"");if(l.length>0)return l}return null}function Pt(e){const t=[];for(let r=0;r<e.length;r++){const o=e[r];typeof o=="number"?t.length>0?t[t.length-1]+=`[${o}]`:t.push(`[${o}]`):t.push(o)}return t.join(" · ")}function Q(e,t,r,o,s){if(Dt(e)){const i=e.variants,a=e.__resolveType,c=$t.test(a)?"":Pt(o);i.forEach((l,m)=>{if(!l||typeof l!="object")return;const p=l,h=[];if(pt(p.rule,h),h.length===0)return;const g=Ot(p.value)??(c||r);for(const u of h)s.push({blockKey:t,blockLabel:r,innerPath:c,variantIndex:m,start:u.start,end:u.end,openStart:u.openStart,openEnd:u.openEnd,label:g,flagResolveType:a})});for(let l=0;l<i.length;l++){const m=i[l];m&&typeof m=="object"&&Q(m.value,t,r,[...o,"variants",l,"value"],s)}return}if(Array.isArray(e)){for(let i=0;i<e.length;i++)Q(e[i],t,r,[...o,i],s);return}if(e&&typeof e=="object")for(const[i,a]of Object.entries(e))i!=="__resolveType"&&Q(a,t,r,[...o,i],s)}function It(e){if(!e)return[];const t=[];for(const[r,o]of Object.entries(e))Q(o,r,Lt(r),[],t);return t.sort((r,o)=>r.start.getTime()-o.start.getTime())}function Vt(e){const t=[...new Set(e)].sort(),r=new Map;return t.forEach((o,s)=>{const i=s*137.508%360;r.set(o,{bg:`oklch(0.62 0.14 ${i})`,text:"white",border:`oklch(0.50 0.14 ${i})`})}),r}const Ht={bg:"oklch(0.62 0.14 0)",text:"white",border:"oklch(0.50 0.14 0)"};function dt(e,t){return e.get(t)??Ht}const ot=new Intl.DateTimeFormat("en",{dateStyle:"medium",timeStyle:"short"});function Bt(e,t){const r=e.openStart?t("sandbox.variantCalendar.always"):ot.format(e.start),o=e.openEnd?t("sandbox.variantCalendar.ongoing"):ot.format(e.end);return`${r} → ${o}`}function zt(e){const t=K.c(18),{variant:r}=e,o=X();let s;t[0]!==r.blockLabel?(s=n.jsx("div",{className:"font-semibold",children:r.blockLabel}),t[0]=r.blockLabel,t[1]=s):s=t[1];let i;t[2]!==r.innerPath?(i=r.innerPath&&n.jsx("div",{className:"text-muted-foreground",children:r.innerPath}),t[2]=r.innerPath,t[3]=i):i=t[3];let a;t[4]!==r.blockLabel||t[5]!==r.innerPath||t[6]!==r.label?(a=r.label!==r.blockLabel&&r.label!==r.innerPath&&n.jsx("div",{className:"text-muted-foreground",children:r.label}),t[4]=r.blockLabel,t[5]=r.innerPath,t[6]=r.label,t[7]=a):a=t[7];let c;t[8]!==o||t[9]!==r?(c=Bt(r,o),t[8]=o,t[9]=r,t[10]=c):c=t[10];let l;t[11]!==c?(l=n.jsx("div",{className:"mt-1",children:c}),t[11]=c,t[12]=l):l=t[12];let m;return t[13]!==s||t[14]!==i||t[15]!==a||t[16]!==l?(m=n.jsx(xt,{children:n.jsxs("div",{className:"text-xs",children:[s,i,a,l]})}),t[13]=s,t[14]=i,t[15]=a,t[16]=l,t[17]=m):m=t[17],m}const nt=16;function Ft(e,t){const r=e?"transparent":"#000 0",o=t?"transparent":"#000 100%";if(!(!e&&!t))return`linear-gradient(to right, ${r}, #000 ${nt}px, #000 calc(100% - ${nt}px), ${o})`}function ft(e){const t=K.c(26),{variant:r,color:o,style:s,children:i,fadeStart:a,fadeEnd:c}=e,l=a===void 0?!1:a,m=c===void 0?!1:c;let p;t[0]!==m||t[1]!==l?(p=Ft(l,m),t[0]=m,t[1]=l,t[2]=p):p=t[2];const h=p;let f;t[3]!==l?(f=l&&{borderTopLeftRadius:0,borderBottomLeftRadius:0},t[3]=l,t[4]=f):f=t[4];let g;t[5]!==m?(g=m&&{borderTopRightRadius:0,borderBottomRightRadius:0},t[5]=m,t[6]=g):g=t[6];let u;t[7]!==h?(u=h&&{maskImage:h,WebkitMaskImage:h},t[7]=h,t[8]=u):u=t[8];let x;t[9]!==o.bg||t[10]!==o.text||t[11]!==s||t[12]!==f||t[13]!==g||t[14]!==u?(x={background:o.bg,color:o.text,borderRadius:4,...f,...g,...u,...s},t[9]=o.bg,t[10]=o.text,t[11]=s,t[12]=f,t[13]=g,t[14]=u,t[15]=x):x=t[15];let b;t[16]!==i?(b=n.jsx("span",{className:"truncate",children:i}),t[16]=i,t[17]=b):b=t[17];let E;t[18]!==x||t[19]!==b?(E=n.jsx(ut,{asChild:!0,children:n.jsx("div",{className:"absolute flex items-center px-2 text-[11px] font-medium truncate cursor-default",style:x,children:b})}),t[18]=x,t[19]=b,t[20]=E):E=t[20];let T;t[21]!==r?(T=n.jsx(zt,{variant:r}),t[21]=r,t[22]=T):T=t[22];let d;return t[23]!==T||t[24]!==E?(d=n.jsxs(ht,{children:[E,T]}),t[23]=T,t[24]=E,t[25]=d):d=t[25],d}function mn(e){const t=K.c(72),{decofile:r}=e,o=X(),[s,i]=Z.useState("calendar"),[a,c]=Z.useState(Kt),[l,m]=Z.useState(!1);let p,h,f;if(t[0]!==r||t[1]!==l){const I=It(r);p=I.filter(Ut).length,f=l?I:I.filter(Gt),h=Vt(f.map(Wt)),t[0]=r,t[1]=l,t[2]=p,t[3]=h,t[4]=f}else p=t[2],h=t[3],f=t[4];const g=h;let u;t[5]===Symbol.for("react.memo_cache_sentinel")?(u=()=>c(mt(new Date)),t[5]=u):u=t[5];const x=u;let b;t[6]!==s?(b=()=>c(I=>s==="calendar"?U(I,-1):U(I,-3)),t[6]=s,t[7]=b):b=t[7];const E=b;let T;t[8]!==s?(T=()=>c(I=>s==="calendar"?U(I,1):U(I,3)),t[8]=s,t[9]=T):T=t[9];const d=T;let v;t[10]!==o?(v=o("sandbox.variantCalendar.today"),t[10]=o,t[11]=v):v=t[11];let y;t[12]!==v?(y=n.jsx(tt,{variant:"outline",size:"sm",onClick:x,children:v}),t[12]=v,t[13]=y):y=t[13];let N;t[14]!==o?(N=o("sandbox.variantCalendar.previous"),t[14]=o,t[15]=N):N=t[15];let A;t[16]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(gt,{size:16}),t[16]=A):A=t[16];let _;t[17]!==E||t[18]!==N?(_=n.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:E,"aria-label":N,children:A}),t[17]=E,t[18]=N,t[19]=_):_=t[19];let k;t[20]!==o?(k=o("sandbox.variantCalendar.next"),t[20]=o,t[21]=k):k=t[21];let C;t[22]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx(vt,{size:16}),t[22]=C):C=t[22];let $;t[23]!==d||t[24]!==k?($=n.jsx(tt,{variant:"ghost",size:"icon",className:"size-8",onClick:d,"aria-label":k,children:C}),t[23]=d,t[24]=k,t[25]=$):$=t[25];const L=ct[a.getMonth()];let M;t[26]!==a?(M=a.getFullYear(),t[26]=a,t[27]=M):M=t[27];let w;t[28]!==L||t[29]!==M?(w=n.jsxs("h2",{className:"ml-2 text-base font-semibold",children:[L," ",M]}),t[28]=L,t[29]=M,t[30]=w):w=t[30];let j;t[31]!==$||t[32]!==w||t[33]!==y||t[34]!==_?(j=n.jsxs("div",{className:"flex items-center gap-2",children:[y,_,$,w]}),t[31]=$,t[32]=w,t[33]=y,t[34]=_,t[35]=j):j=t[35];let R;t[36]!==p||t[37]!==l||t[38]!==o?(R=p>0&&n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(jt,{id:"show-ongoing",checked:l,onCheckedChange:m}),n.jsx(yt,{htmlFor:"show-ongoing",className:"text-xs text-muted-foreground cursor-pointer",children:o("sandbox.variantCalendar.showOngoing",{count:p})})]}),t[36]=p,t[37]=l,t[38]=o,t[39]=R):R=t[39];let B;t[40]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx(at,{}),t[40]=B):B=t[40];let V;t[41]!==o?(V=o("sandbox.variantCalendar.calendarMode"),t[41]=o,t[42]=V):V=t[42];let S;t[43]!==V?(S={value:"calendar",icon:B,label:V},t[43]=V,t[44]=S):S=t[44];let z;t[45]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsx(bt,{}),t[45]=z):z=t[45];let D;t[46]!==o?(D=o("sandbox.variantCalendar.timelineMode"),t[46]=o,t[47]=D):D=t[47];let O;t[48]!==D?(O={value:"timeline",icon:z,label:D},t[48]=D,t[49]=O):O=t[49];let P;t[50]!==S||t[51]!==O?(P=[S,O],t[50]=S,t[51]=O,t[52]=P):P=t[52];let H;t[53]!==P||t[54]!==s?(H=n.jsx(Tt,{value:s,onValueChange:i,options:P}),t[53]=P,t[54]=s,t[55]=H):H=t[55];let F;t[56]!==R||t[57]!==H?(F=n.jsxs("div",{className:"flex items-center gap-4",children:[R,H]}),t[56]=R,t[57]=H,t[58]=F):F=t[58];let W;t[59]!==j||t[60]!==F?(W=n.jsxs("div",{className:"flex items-center justify-between px-4 h-12 border-b shrink-0",children:[j,F]}),t[59]=j,t[60]=F,t[61]=W):W=t[61];let G;t[62]!==g||t[63]!==a||t[64]!==p||t[65]!==l||t[66]!==f||t[67]!==s?(G=f.length===0?n.jsx(Yt,{hiddenOngoing:l?0:p}):s==="calendar"?n.jsx(qt,{monthStart:a,variants:f,colorMap:g}):n.jsx(te,{monthStart:a,variants:f,colorMap:g}),t[62]=g,t[63]=a,t[64]=p,t[65]=l,t[66]=f,t[67]=s,t[68]=G):G=t[68];let J;return t[69]!==W||t[70]!==G?(J=n.jsxs("div",{className:"flex h-full w-full flex-col",children:[W,G]}),t[69]=W,t[70]=G,t[71]=J):J=t[71],J}function Wt(e){return e.blockKey}function Gt(e){return!e.openEnd}function Ut(e){return e.openEnd}function Kt(){return mt(new Date)}function Yt(e){const t=K.c(4),{hiddenOngoing:r}=e,o=r===void 0?0:r,s=X();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(at,{size:24,className:"text-muted-foreground/60"}),t[0]=i):i=t[0];let a;return t[1]!==o||t[2]!==s?(a=n.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 text-center text-sm text-muted-foreground p-6",children:[i,o>0?n.jsxs(n.Fragment,{children:[n.jsx("div",{children:s("sandbox.variantCalendar.noDatedVariants")}),n.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.hiddenOngoingVariants",{count:o})})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{children:s("sandbox.variantCalendar.noScheduledVariants")}),n.jsx("div",{className:"text-xs text-muted-foreground/80",children:s("sandbox.variantCalendar.dateMatcherInfo")})]})]}),t[1]=o,t[2]=s,t[3]=a):a=t[3],a}const et=20,it=2,st=28,Jt=6;function qt(e){const t=K.c(17),{monthStart:r,variants:o,colorMap:s}=e;let i,a,c,l,m;if(t[0]!==s||t[1]!==r||t[2]!==o){const f=Nt(r),g=_t(new Date);i=lt,m="flex-1 min-h-0",a="min-w-[840px]",t[8]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"grid grid-cols-7 border-b text-xs text-muted-foreground sticky top-0 bg-background z-10",children:wt.map(Xt)}),t[8]=c):c=t[8],l=f.map((u,x)=>{const b=kt(u,o),E=b.reduce(Qt,0),T=st+E*(et+it)+8;return n.jsxs("div",{className:"grid grid-cols-7 relative border-b",style:{height:T},children:[u.map((d,v)=>{const y=d.getMonth()===r.getMonth(),N=d.getTime()===g.getTime();return n.jsx("div",{className:rt("border-r last:border-r-0 px-2 pt-1.5 text-xs",y?"bg-background":"bg-muted/30 text-muted-foreground"),children:n.jsx("span",{className:rt("inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1",N&&"bg-primary text-primary-foreground font-semibold"),children:d.getDate()})},v)}),b.map((d,v)=>{const y=dt(s,d.variant.blockKey),N=st+d.lane*(et+it),A=d.leftUnits/7*100,_=d.widthUnits/7*100,k=d.variant.openStart&&x===0,C=d.variant.openEnd&&x===f.length-1;return n.jsxs(ft,{variant:d.variant,color:y,fadeStart:k,fadeEnd:C,style:{top:N,left:`calc(${A}% + 2px)`,width:`calc(${_}% - 4px)`,minWidth:Jt,height:et},children:[d.variant.blockLabel,d.variant.label!==d.variant.blockLabel&&n.jsxs("span",{className:"opacity-70",children:[" · ",d.variant.label]})]},`${x}-${v}`)})]},x)}),t[0]=s,t[1]=r,t[2]=o,t[3]=i,t[4]=a,t[5]=c,t[6]=l,t[7]=m}else i=t[3],a=t[4],c=t[5],l=t[6],m=t[7];let p;t[9]!==a||t[10]!==c||t[11]!==l?(p=n.jsxs("div",{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=p):p=t[12];let h;return t[13]!==i||t[14]!==m||t[15]!==p?(h=n.jsx(i,{className:m,children:p}),t[13]=i,t[14]=m,t[15]=p,t[16]=h):h=t[16],h}function Qt(e,t){return Math.max(e,t.lane+1)}function Xt(e){return n.jsx("div",{className:"px-2 py-2 text-center uppercase tracking-wide",children:e},e)}const q=4,Zt=32,Y=240;function te(e){const t=K.c(23),{monthStart:r,variants:o,colorMap:s}=e,i=r,a=U(r,q),c=new Date,l=new Map;for(const w of o){const j=l.get(w.blockKey)??[];j.push(w),l.set(w.blockKey,j)}const m=Array.from(l.entries()).sort(oe),p=a.getTime()-i.getTime(),h=w=>(Math.max(i.getTime(),Math.min(a.getTime(),w.getTime()))-i.getTime())/p*100;let f;t[0]!==i?(f=(w,j)=>U(i,j),t[0]=i,t[1]=f):f=t[1];const g=Array.from({length:q},f),u=c.getTime()>=i.getTime()&&c.getTime()<=a.getTime()?h(c):null,x=X(),b=lt,E="flex-1 min-h-0",T="min-w-[900px] relative";let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d={width:Y},t[2]=d):d=t[2];let v;t[3]!==x?(v=x("sandbox.variantCalendar.variantBlock"),t[3]=x,t[4]=v):v=t[4];let y;t[5]!==v?(y=n.jsx("div",{className:"shrink-0 px-3 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground border-r",style:d,children:v}),t[5]=v,t[6]=y):y=t[6];let N;t[7]===Symbol.for("react.memo_cache_sentinel")?(N={gridTemplateColumns:`repeat(${q}, minmax(0, 1fr))`},t[7]=N):N=t[7];const A=g.map(re);let _;t[8]!==A?(_=n.jsx("div",{className:"flex-1 grid",style:N,children:A}),t[8]=A,t[9]=_):_=t[9];let k;t[10]!==y||t[11]!==_?(k=n.jsxs("div",{className:"flex border-b sticky top-0 bg-background z-10",children:[y,_]}),t[10]=y,t[11]=_,t[12]=k):k=t[12];let C;t[13]!==x||t[14]!==u?(C=u!==null&&n.jsx("div",{className:"pointer-events-none absolute top-0 bottom-0 w-px bg-primary/70 z-[5]",style:{left:`calc(${Y}px + (100% - ${Y}px) * ${u} / 100)`},children:n.jsx("span",{className:"absolute -top-0.5 -translate-x-1/2 rounded-sm bg-primary px-1.5 py-px text-[10px] font-medium text-primary-foreground",children:x("sandbox.variantCalendar.todayLabel")})}),t[13]=x,t[14]=u,t[15]=C):C=t[15];const $=m.map(w=>{const[j,R]=w,B=dt(s,j),V=R[0]?.blockLabel??j;return n.jsxs("div",{children:[n.jsx("div",{className:"flex items-center bg-muted/40 border-b text-xs font-semibold uppercase tracking-wide text-muted-foreground",style:{height:28},children:n.jsx("div",{className:"px-3 truncate",style:{width:Y},children:V})}),R.map((S,z)=>n.jsxs("div",{className:"flex border-b items-center",style:{height:Zt},children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 text-sm border-r shrink-0",style:{width:Y},children:[n.jsx("span",{className:"inline-block h-2 w-2 rounded-full shrink-0",style:{background:B.bg}}),n.jsx("span",{className:"truncate text-foreground/80",children:S.label})]}),n.jsxs("div",{className:"relative flex-1 h-full",children:[n.jsx("div",{className:"absolute inset-0 grid",style:{gridTemplateColumns:`repeat(${q}, minmax(0, 1fr))`},children:g.map(ee)}),(()=>{const D=Math.max(S.start.getTime(),i.getTime()),O=Math.min(S.end.getTime(),a.getTime());if(O<=D)return null;const P=h(new Date(D)),H=h(new Date(O))-P;return n.jsx(ft,{variant:S,color:B,fadeStart:S.openStart,fadeEnd:S.openEnd,style:{top:"50%",transform:"translateY(-50%)",left:`${P}%`,width:`calc(${H}% - 2px)`,height:22},children:S.label})})()]})]},z))]},j)});let L;t[16]!==k||t[17]!==C||t[18]!==$?(L=n.jsxs("div",{className:T,children:[k,C,$]}),t[16]=k,t[17]=C,t[18]=$,t[19]=L):L=t[19];let M;return t[20]!==b||t[21]!==L?(M=n.jsx(b,{className:E,children:L}),t[20]=b,t[21]=L,t[22]=M):M=t[22],M}function ee(e,t){return n.jsx("div",{className:"border-r last:border-r-0 border-border/40"},t)}function re(e,t){return n.jsxs("div",{className:"px-2 py-2 text-xs uppercase tracking-wide text-muted-foreground border-r last:border-r-0",children:[ct[e.getMonth()]?.slice(0,3)," ",e.getFullYear()]},t)}function oe(e,t){return e[0].localeCompare(t[0])}export{mn as VariantCalendar};
|