decocms 4.127.1 → 4.128.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-Cv1cEOJe.js → AlertCircle-DlOoFExO.js} +1 -1
- package/dist/client/assets/{AreaChart-DN9ThaPs.js → AreaChart-JHxOshdI.js} +1 -1
- package/dist/client/assets/{ArrowRight-C3VYpNmM.js → ArrowRight-Cs_e9wiQ.js} +1 -1
- package/dist/client/assets/{ArrowUp-eLqUqESk.js → ArrowUp-BQkKr-Lk.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DMX-9nwB.js → ArrowUpRight-JMrIiQcC.js} +1 -1
- package/dist/client/assets/{Check-CAxGnOYl.js → Check-Bn6Qlhrx.js} +1 -1
- package/dist/client/assets/{CheckCircle-M7jEAOAU.js → CheckCircle-HzWHBYH9.js} +1 -1
- package/dist/client/assets/{ChevronDown-DHSsapzu.js → ChevronDown-kHmqPzzM.js} +1 -1
- package/dist/client/assets/{ChevronRight-DQzoE5qs.js → ChevronRight-DHNTTug-.js} +1 -1
- package/dist/client/assets/{ChevronUp-p1xFWJaz.js → ChevronUp-jvZ4IhLd.js} +1 -1
- package/dist/client/assets/{Copy01-B9-Tq_iz.js → Copy01-DJioqh9N.js} +1 -1
- package/dist/client/assets/{DotsVertical-DwEU0WcH.js → DotsVertical-CK_VLAF7.js} +1 -1
- package/dist/client/assets/{Eye-Czh37uFH.js → Eye-BgxVnR4L.js} +1 -1
- package/dist/client/assets/{FilterLines-BqLOXSa5.js → FilterLines-CQK_1Sst.js} +1 -1
- package/dist/client/assets/{HardDrive-BsS4E73d.js → HardDrive-BcDlPZzx.js} +1 -1
- package/dist/client/assets/{Key01-CE4eOT1e.js → Key01-C95x4G22.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BMs76MNF.js → LayoutLeft-C_lp5Nls.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CcKBgYd-.js → LinkExternal01-gS1mX97p.js} +1 -1
- package/dist/client/assets/{LogOut01-Dg-ohpP8.js → LogOut01-BjNpkTDp.js} +1 -1
- package/dist/client/assets/{Monitor01-B5dGNrk3.js → Monitor01-BNndh59k.js} +1 -1
- package/dist/client/assets/{Palette-DyAFAQNZ.js → Palette-CRUut8fg.js} +1 -1
- package/dist/client/assets/{Play-B7mU7ki_.js → Play-n8m_c9lJ.js} +1 -1
- package/dist/client/assets/{Plus-CugJyAi-.js → Plus-TT0_uzpn.js} +1 -1
- package/dist/client/assets/{SearchLg-Jx9sl1cA.js → SearchLg-yvgfN-4d.js} +1 -1
- package/dist/client/assets/{SearchMd-CxHCBQtl.js → SearchMd-COqPqxyq.js} +1 -1
- package/dist/client/assets/{Settings02-wbN5N_fj.js → Settings02-BGiKV8zu.js} +1 -1
- package/dist/client/assets/{Shield01-DLsTCnTO.js → Shield01-BAuVcsWW.js} +1 -1
- package/dist/client/assets/{Star01-Bh5N-pS4.js → Star01-ChJYud6w.js} +1 -1
- package/dist/client/assets/{Stars01-De6-QWmu.js → Stars01-aXp5Y2ji.js} +1 -1
- package/dist/client/assets/{Stars02-BU_zAl88.js → Stars02-D1A09nKk.js} +1 -1
- package/dist/client/assets/{Sun-ih4dfaTg.js → Sun-DnmiC_5x.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-MLQQ91yh.js → SwitchHorizontal01-BgRUIEuF.js} +1 -1
- package/dist/client/assets/{Tool01-D0w8RXz3.js → Tool01-D4gQefQ-.js} +1 -1
- package/dist/client/assets/{Tool02-Y87fmFWU.js → Tool02-zAwGBPrM.js} +1 -1
- package/dist/client/assets/{Trash01-0xb1qdPu.js → Trash01-DPVbcKM0.js} +1 -1
- package/dist/client/assets/{TrendUp01-DtSitwhU.js → TrendUp01-C8eAJl7Z.js} +1 -1
- package/dist/client/assets/{Upload01-0eUpnu0O.js → Upload01-B71H7X9g.js} +1 -1
- package/dist/client/assets/{User01-DDI1RZNo.js → User01-BXBBEt4p.js} +1 -1
- package/dist/client/assets/{Users01-Bo9LN8BR.js → Users01-AY9yfaue.js} +1 -1
- package/dist/client/assets/{Users03-nSRmkJKy.js → Users03-CPTzqIRx.js} +1 -1
- package/dist/client/assets/{X-BaIzQ1ZU.js → X-K-Scopt5.js} +1 -1
- package/dist/client/assets/{XCircle-ThoE20us.js → XCircle-BU86Qt1e.js} +1 -1
- package/dist/client/assets/{XClose-b53Y2CiD.js → XClose-KDl77Ytt.js} +1 -1
- package/dist/client/assets/{Zap-B9FxsL0c.js → Zap-CVhhbkhI.js} +1 -1
- package/dist/client/assets/{ZapSquare-CidCNaVn.js → ZapSquare-DxvV-eIn.js} +1 -1
- package/dist/client/assets/{access-gate-Dyw5YxuD.js → access-gate-BEYxzj8I.js} +1 -1
- package/dist/client/assets/{add-section-modal-DUVgaJGt.js → add-section-modal-DIAZUihw.js} +1 -1
- package/dist/client/assets/{agent-icon-DRmZkmeZ.js → agent-icon-DQrqcIhD.js} +1 -1
- package/dist/client/assets/{agents-list-DNzMWnXJ.js → agents-list-DXzIAlkk.js} +1 -1
- package/dist/client/assets/{ai-providers-zEa0jwsI.js → ai-providers-Bs7gjDpu.js} +1 -1
- package/dist/client/assets/{alert-dialog-C7r1JR2l.js → alert-dialog-Dexb9Fmf.js} +1 -1
- package/dist/client/assets/{alert-CdInA2-c.js → alert-ja2dlfJ0.js} +1 -1
- package/dist/client/assets/app-editor-1sSh5sr8.js +1 -0
- package/dist/client/assets/{auth-CajItl6K.js → auth-D23uY8FR.js} +1 -1
- package/dist/client/assets/{auth-catchall--hLLSqje.js → auth-catchall-CtvsALub.js} +1 -1
- package/dist/client/assets/{auth-entry-BobZRiPA.js → auth-entry-BwJ64aWU.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CbkKneI2.js → auth-split-layout-v4Db0YXM.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BB8RkINS.js → authenticate-and-persist-oauth-p82jb0kd.js} +1 -1
- package/dist/client/assets/{automation-list-row-CgSI8a0P.js → automation-list-row-MjQrlmTy.js} +1 -1
- package/dist/client/assets/{automation-runs-BK61ciEK.js → automation-runs-C5WbEF7q.js} +1 -1
- package/dist/client/assets/{automations-CCcb1jc4.js → automations-YbjdcKJh.js} +1 -1
- package/dist/client/assets/{avatar-Bn_vQ7_0.js → avatar-It-1HUju.js} +1 -1
- package/dist/client/assets/{badge-DXWWpM_8.js → badge-_wR-Cj9j.js} +1 -1
- package/dist/client/assets/{block-document-BheQe3TN.js → block-document-Bhd5w0xI.js} +1 -1
- package/dist/client/assets/{brand-context-B0P0KeIE.js → brand-context-DqYQY9zj.js} +1 -1
- package/dist/client/assets/{buckets-DLvx5jEz.js → buckets-CyjY7JXu.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-C4gGeRVN.js → bulk-category-panel-Btx7XD8M.js} +1 -1
- package/dist/client/assets/{calendar-CV5X3KTT.js → calendar-BB8PtdCT.js} +1 -1
- package/dist/client/assets/{capability-load-error-dLKvACIl.js → capability-load-error-xsVDzwiI.js} +1 -1
- package/dist/client/assets/{card-CCc8Ey-X.js → card-DQGMlzo2.js} +1 -1
- package/dist/client/assets/category-editor-BbFkCSeT.js +1 -0
- package/dist/client/assets/{chat-context-CtNzp_qa.js → chat-context-CHOZ22YH.js} +1 -1
- package/dist/client/assets/{checkbox-DyorRprY.js → checkbox-DeESuV7z.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BT677VkP.js → cli-auth-success-BpeUc3Zo.js} +1 -1
- package/dist/client/assets/{collection-detail-B3KQb9zW.js → collection-detail-DSxxQREL.js} +1 -1
- package/dist/client/assets/{collection-display-button-Cu5PWW8M.js → collection-display-button-CoS5MAyI.js} +1 -1
- package/dist/client/assets/{collection-search-Dwcbuc3l.js → collection-search-CU-UVxFT.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DfeKFiP7.js → collection-table-wrapper-UTxG5cNB.js} +1 -1
- package/dist/client/assets/{collection-tabs-BSYCf2on.js → collection-tabs-TDtn5pBg.js} +1 -1
- package/dist/client/assets/{command-DzTBof7m.js → command--rmYFhX5.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-BaKD3ijz.js → commerce-onboarding-CAgcJuRO.js} +1 -1
- package/dist/client/assets/{companions-core-f0Zns_YJ.js → companions-core-Bvjm7zsP.js} +1 -1
- package/dist/client/assets/{connect-BtiZMCXD.js → connect-Dx_O6NqD.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-DH9sQ4WR.js → connect-desktop-dialog-BxI4g61Q.js} +1 -1
- package/dist/client/assets/{connection-DBqeyKJm.js → connection-DWWMOdEo.js} +1 -1
- package/dist/client/assets/{connection-card-CDzhPUIm.js → connection-card-DFiDyTG2.js} +1 -1
- package/dist/client/assets/{connection-detail-Depk5zOn.js → connection-detail-Bv7XQVrK.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CA1YbY4U.js → connection-form-helpers-CfjJquK4.js} +1 -1
- package/dist/client/assets/{connections-vKjCEIuk.js → connections-DA5Tax0y.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-D9zBlIw4.js → decopilot-sse-pool-C15s_ggq.js} +1 -1
- package/dist/client/assets/{dialog-CnNSwssB.js → dialog-Of44eUd0.js} +1 -1
- package/dist/client/assets/{domain-settings-BnFoIcui.js → domain-settings-BJQkm4_p.js} +1 -1
- package/dist/client/assets/{drawer-DJbSlRD6.js → drawer-BymMCu1T.js} +1 -1
- package/dist/client/assets/{dropdown-menu-76o-h9YU.js → dropdown-menu-CbAOPa6H.js} +1 -1
- package/dist/client/assets/{empty-state-BU0STOi_.js → empty-state-BX0PTeD6.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Cxunun-P.js → extract-connection-data-B4zI--kn.js} +1 -1
- package/dist/client/assets/{file-explorer-BGr4J8VA.js → file-explorer-Blo6Fd9R.js} +1 -1
- package/dist/client/assets/{form-C0WLTw-V.js → form-DrWxxWbf.js} +1 -1
- package/dist/client/assets/{general-DUVU33KT.js → general-Dck8XR5L.js} +1 -1
- package/dist/client/assets/{github-repo-picker-YNpy1cMq.js → github-repo-picker-a-JQjcWL.js} +1 -1
- package/dist/client/assets/{hooks-BJXQSgWE.js → hooks-Bj_s_TEL.js} +1 -1
- package/dist/client/assets/{index-Fb-0hMMF.js → index-5hvCqvdR.js} +36 -36
- package/dist/client/assets/index-BHyEVpcy.css +1 -0
- package/dist/client/assets/{index-C2L2_EGk.js → index-BJkP2VNL.js} +1 -1
- package/dist/client/assets/{index-DKz5uAvN.js → index-BM0uownS.js} +1 -1
- package/dist/client/assets/{index-DTpTnIXI.js → index-BkymslL9.js} +4 -4
- package/dist/client/assets/{index-BncCqES9.js → index-BnGSkcn3.js} +3 -3
- package/dist/client/assets/{index-Cfl3pWSI.js → index-C2c3KYG1.js} +1 -1
- package/dist/client/assets/{index-DNSHwkYc.js → index-CdjaWXqK.js} +1 -1
- package/dist/client/assets/{index-lnpm8Xef.js → index-ClR7PVdl.js} +1 -1
- package/dist/client/assets/{index-BLSCN6QZ.js → index-DDRnGMXv.js} +1 -1
- package/dist/client/assets/{index-DvXmQ4bW.js → index-DWg1AuAy.js} +1 -1
- package/dist/client/assets/{index-CcTSYG8G.js → index-DvBW6WKf.js} +1 -1
- package/dist/client/assets/{index-redirect-B7ZDstVX.js → index-redirect-DxWMMY89.js} +1 -1
- package/dist/client/assets/{input-C-PukNCO.js → input-_gEsxqnS.js} +1 -1
- package/dist/client/assets/{integration-icon-CPsgZzSt.js → integration-icon-YO-4xJ7-.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-P32rdcqw.js → invite-member-dialog-Bcap5ivG.js} +1 -1
- package/dist/client/assets/{label-GtZ-2RvW.js → label-lstozZTC.js} +1 -1
- package/dist/client/assets/{layout-Btxdp9hQ.js → layout-sbOFVLyJ.js} +1 -1
- package/dist/client/assets/{login-AOodjKYi.js → login-DMJWlKTb.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BQG3J6Cj.js → mcp-oauth-DOzQiO7r.js} +1 -1
- package/dist/client/assets/{members-BdbFkCxa.js → members-C455x9rD.js} +1 -1
- package/dist/client/assets/{monaco-editor-CxHX1gBA.js → monaco-editor-DPG5wVkF.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Bmc68FPt.js → monitoring-stats-row-BroMB894.js} +1 -1
- package/dist/client/assets/{multi-select-ndENpXxH.js → multi-select-CjF9_5Bs.js} +1 -1
- package/dist/client/assets/{oauth-callback-CqAdDdrZ.js → oauth-callback-CLYjOnMI.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CNg3H5Ef.js → oauth-callback-ai-provider-C_snjpX9.js} +1 -1
- package/dist/client/assets/{onboarding-CEpGn7AW.js → onboarding-CNkTMJvN.js} +1 -1
- package/dist/client/assets/{org-install-CofMpgNi.js → org-install-86imt-Tk.js} +1 -1
- package/dist/client/assets/{org-layout-BShWdygs.js → org-layout-B-tHhiNM.js} +1 -1
- package/dist/client/assets/{organization-choice-Dow-5f5r.js → organization-choice-BqVCW_Kn.js} +1 -1
- package/dist/client/assets/{orgs-DaBm1Sw8.js → orgs-BZhbpQXk.js} +1 -1
- package/dist/client/assets/page-seo-form-yb5d8-re.js +1 -0
- package/dist/client/assets/{popover-WtLnSFSM.js → popover-CKRmtCon.js} +1 -1
- package/dist/client/assets/post-editor-C02dUn_t.js +1 -0
- package/dist/client/assets/{primitives-DlYQU9-T.js → primitives-Do1hXguN.js} +1 -1
- package/dist/client/assets/{profile-CrdraVBR.js → profile-D01mT3fL.js} +1 -1
- package/dist/client/assets/project-app-view-Ba3zNzeM.js +1 -0
- package/dist/client/assets/record-editor-CB6FrATt.js +1 -0
- package/dist/client/assets/redirect-editor-5otjvpMv.js +1 -0
- package/dist/client/assets/registry-f3oF9kYh.js +2 -0
- package/dist/client/assets/{registry-layout-BAW8Ncvt.js → registry-layout-DW0vfkCe.js} +1 -1
- package/dist/client/assets/{reports-BM-SsAgM.js → reports-Bi8brCCl.js} +1 -1
- package/dist/client/assets/{require-capability-Cfqdwu5e.js → require-capability-1AEGhOP2.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Cvjegq6O.js → required-auth-layout-Cmv1qjJR.js} +1 -1
- package/dist/client/assets/{reset-password-Cmv9bBGH.js → reset-password-B-TYrvve.js} +1 -1
- package/dist/client/assets/{roles-BJuFBCDZ.js → roles-TURTFXVU.js} +1 -1
- package/dist/client/assets/{search-input-DWoP-L-e.js → search-input-DtuTjWYk.js} +1 -1
- package/dist/client/assets/{secrets-L_cqBniE.js → secrets-C46aStzE.js} +1 -1
- package/dist/client/assets/{sections-editor-CEPgVa-0.js → sections-editor-BKUDMZvi.js} +2 -2
- package/dist/client/assets/{select-C7i2amFb.js → select-BB81eCTi.js} +1 -1
- package/dist/client/assets/{select-model-BCXzAcb5.js → select-model-DlFKdcjl.js} +1 -1
- package/dist/client/assets/{self-tool-result-D-GrlU0y.js → self-tool-result-D-fn0Wlo.js} +1 -1
- package/dist/client/assets/seo-editor-96-W3wl5.js +1 -0
- package/dist/client/assets/{settings-layout-BcvhggYr.js → settings-layout-DsE_5LbY.js} +1 -1
- package/dist/client/assets/{settings-section-BYeVsb4I.js → settings-section-BjcRSoSw.js} +1 -1
- package/dist/client/assets/{shell-controls-R60AH9I8.js → shell-controls-jVoAcVfr.js} +1 -1
- package/dist/client/assets/{shell-layout-BNXm8_-N.js → shell-layout-BCBAo2_7.js} +1 -1
- package/dist/client/assets/{sidebar-BbNoNoXu.js → sidebar-hgQ-Xr57.js} +1 -1
- package/dist/client/assets/{skeleton-DfKg2Znc.js → skeleton-BWwTBiZw.js} +1 -1
- package/dist/client/assets/{sso-gKGTOMCr.js → sso-DQ2SRi7U.js} +1 -1
- package/dist/client/assets/{store-CjuKUH0F.js → store-B4Wb6ubq.js} +1 -1
- package/dist/client/assets/store-registry-C62bCrsL.js +2 -0
- package/dist/client/assets/{studio-tools-DhaLu8BB.js → studio-tools-BerQESFF.js} +1 -1
- package/dist/client/assets/{switch-CalpC8DX.js → switch-QYFfgjqj.js} +1 -1
- package/dist/client/assets/{tab-id-BdC9XFCA.js → tab-id-BOB4wvau.js} +1 -1
- package/dist/client/assets/{table-Cmk00_Vj.js → table-DUaaqIjW.js} +1 -1
- package/dist/client/assets/{tabs-DmAk82Ih.js → tabs-Dd5JHBOy.js} +1 -1
- package/dist/client/assets/{textarea-B4RJnT2K.js → textarea-csHKKQIv.js} +1 -1
- package/dist/client/assets/{toggle-group-pubsvBb0.js → toggle-group-DVpQjHXL.js} +1 -1
- package/dist/client/assets/{toolbar-BEIe1Ogv.js → toolbar-CjpgP-6l.js} +1 -1
- package/dist/client/assets/{tooltip-T0Wkkern.js → tooltip-BEp2qlKJ.js} +1 -1
- package/dist/client/assets/{use-ai-providers-jwS618eT.js → use-ai-providers-D6SnxUgi.js} +1 -1
- package/dist/client/assets/{use-api-keys-BrHOwjW2.js → use-api-keys-BhS4v3p1.js} +1 -1
- package/dist/client/assets/{use-automations-CBHVa5u3.js → use-automations-CrIUfxAu.js} +1 -1
- package/dist/client/assets/{use-autosave-DmTC1x4K.js → use-autosave-BmcrpoCH.js} +1 -1
- package/dist/client/assets/{use-capability-Cy7Z5V3h.js → use-capability-Oxb87xKU.js} +1 -1
- package/dist/client/assets/{use-clock-tick-Dwrr2be5.js → use-clock-tick-D0eBwcuh.js} +1 -1
- package/dist/client/assets/{use-connection-B22_PyLH.js → use-connection-4sJq7rPE.js} +1 -1
- package/dist/client/assets/{use-copy-B9YnGy__.js → use-copy-DybO3YM7.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BeCogZvK.js → use-create-virtual-mcp-DsEVwCVH.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Cx-8Unyb.js → use-debounced-autosave-BmixtQoG.js} +1 -1
- package/dist/client/assets/{use-debounced-value-DMteVHls.js → use-debounced-value-BBF-ZA86.js} +1 -1
- package/dist/client/assets/{use-deco-credits-M6jD7OLB.js → use-deco-credits-CBMu65fa.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BAmSlT1H.js → use-decopilot-events-D3VIHgjl.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BWt9DC6T.js → use-delete-connection-C-dA1zii.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-B5sXB-_D.js → use-deployment-admin-CdrJL4_N.js} +1 -1
- package/dist/client/assets/{use-file-configs-ABK3rO3z.js → use-file-configs-BVL8EDuk.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-B9ylal0v.js → use-infinite-scroll-o-xRmvTW.js} +1 -1
- package/dist/client/assets/{use-join-requests-9310fhXI.js → use-join-requests-CHKUakSU.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DhEAiLgH.js → use-mcp-auth-status-j64WYNIX.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DDgJ6Kuk.js → use-mcp-client-Ch-glB8L.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DKU8ZqSd.js → use-mcp-tools-CqtzkDAQ.js} +1 -1
- package/dist/client/assets/{use-members-BPFh2bn6.js → use-members-DcnZH5Z4.js} +1 -1
- package/dist/client/assets/{use-mobile-DWXOCvlK.js → use-mobile-_Xd80DiW.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-D0GR98Dc.js → use-navigate-to-agent-DUnpsW4C.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-fYeTx5lp.js → use-org-auth-client-B4zN79MB.js} +1 -1
- package/dist/client/assets/{use-org-sso-BGJoKp8i.js → use-org-sso-BNonH9oE.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BMNHEFdD.js → use-organization-roles-CTJiQrQl.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BNsTOlhZ.js → use-organization-settings-ddTWkqZK.js} +1 -1
- package/dist/client/assets/{use-registry-app-D_cRRKVr.js → use-registry-app-C77O0Jdq.js} +1 -1
- package/dist/client/assets/{use-registry-connections-m2EHDfDB.js → use-registry-connections-DSObwQn8.js} +1 -1
- package/dist/client/assets/{use-secrets-BaT1Qx39.js → use-secrets-BW5yZmk6.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CFzc6usI.js → use-status-sounds-Ca2huGyC.js} +1 -1
- package/dist/client/assets/{use-view-mode-BDc0Lx0w.js → use-view-mode-CkUEtMNm.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-k7Sxby6-.js → use-virtual-mcp-BowpRoGD.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B6Vy9RAt.js +1 -0
- package/dist/client/assets/{useQueries-Q6PLg0wT.js → useQueries-tUANGmRZ.js} +1 -1
- package/dist/client/assets/{useRouterState-BwkF952H.js → useRouterState-BWPa_erj.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B0WgLVO2.js +1 -0
- package/dist/client/assets/{users-mmxYadX5.js → users-B35mH_ej.js} +1 -1
- package/dist/client/assets/{variant-calendar-wEYRBo9T.js → variant-calendar-4-GRWjAr.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BMAJpsU1.js → view-mode-toggle-qh045Sig.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/app-editor-BZytjtCE.js +0 -1
- package/dist/client/assets/category-editor-DtCRZ1l0.js +0 -1
- package/dist/client/assets/index-C-Bio3ii.css +0 -1
- package/dist/client/assets/page-seo-form-n_zO1llz.js +0 -1
- package/dist/client/assets/page-seo-sheet-CJjVzHGp.js +0 -1
- package/dist/client/assets/post-editor-CYJ4KDqd.js +0 -1
- package/dist/client/assets/project-app-view-BLXGpYQR.js +0 -1
- package/dist/client/assets/record-editor-BWICvxKA.js +0 -1
- package/dist/client/assets/redirect-editor-w_04iIhD.js +0 -1
- package/dist/client/assets/registry-BiywP-wu.js +0 -2
- package/dist/client/assets/seo-editor-F_bPFnyM.js +0 -1
- package/dist/client/assets/store-registry-DUWPxEJ_.js +0 -2
- package/dist/client/assets/useInfiniteQuery-B22BxMIM.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DvKQE8Wc.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{W as Kt,X as Ut,c as $,b as V,Y as gt,Z as pt,e as qt,j as t,a as ie,B as ne,r as H,aI as Xt,d as Re,s as Wt,m as X,t as G,w as Qt,k as ke,p as R,F as ae,L as Yt,f as ht,u as xt,D as Jt,I as Zt,G as en,K as ot,o as tn,n as nn}from"./index-DTpTnIXI.js";import{t as jt}from"./ChevronDown-DHSsapzu.js";import{A as vt,l as sn,d as on}from"./agent-icon-DRmZkmeZ.js";import{T as Ce,a as ye,c as Se}from"./tooltip-T0Wkkern.js";import{u as bt,d as Ct,c as yt}from"./sidebar-BbNoNoXu.js";import{a as it,i as an,f as rn,S as cn,u as ln}from"./use-mcp-client-DDgJ6Kuk.js";import{a as dn,u as un}from"./use-virtual-mcp-k7Sxby6-.js";import{a as Be,b as St,P as wt}from"./popover-WtLnSFSM.js";import{i as Ee}from"./Check-CAxGnOYl.js";import{s as we}from"./Plus-CugJyAi-.js";import{i as _t}from"./SearchMd-CxHCBQtl.js";import{s as Nt}from"./XClose-b53Y2CiD.js";import{c as mn,d as fn,b as gn,f as pn,e as hn,a as xn,A as jn}from"./alert-dialog-C7r1JR2l.js";import{F as Q,a as st,b as Y,c as J,d as Z,f as vn,e as ee}from"./form-C0WLTw-V.js";import{I as oe}from"./input-C-PukNCO.js";import{S as bn}from"./chat-context-CtNzp_qa.js";import{T as Dt}from"./toolbar-BEIe1Ogv.js";import{S as Cn}from"./skeleton-DfKg2Znc.js";import{D as kt,a as It,b as At,c as yn,d as Sn,e as wn,f as _n}from"./drawer-DJbSlRD6.js";import{u as Pt}from"./use-mobile-DWXOCvlK.js";import{G as Nn}from"./use-registry-app-D_cRRKVr.js";import{G as Dn}from"./github-repo-picker-YNpy1cMq.js";import{b as kn,a as Tt}from"./hooks-BJXQSgWE.js";import{u as In,g as An,a as Pn,b as Tn}from"./use-navigate-to-agent-D0GR98Dc.js";import{u as Ot}from"./shell-layout-BNXm8_-N.js";import{f as On}from"./reusable-new-chat-CouMjkYR.js";import{C as zn}from"./collection-search-Dwcbuc3l.js";import{g as Mn,a as $n,b as Fn,e as Ln}from"./extract-connection-data-Cxunun-P.js";import{u as zt,a as Mt,g as Bn,C as Je}from"./connection-card-CDzhPUIm.js";import{e as $t,d as Ft,a as Lt,b as Bt,h as En,c as Vn}from"./dialog-CnNSwssB.js";import{S as Rn,a as Hn,b as Gn,c as Kn,d as De}from"./select-C7i2amFb.js";import{T as Un}from"./textarea-B4RJnT2K.js";import{b as Et}from"./use-connection-B22_PyLH.js";import{a as Le,b as Ze}from"./Tool02-Y87fmFWU.js";import{s as et}from"./Star01-Bh5N-pS4.js";import{c as qn,i as $e,a as dt,E as Xn,p as Wn,b as Qn,d as Yn}from"./connection-form-helpers-CA1YbY4U.js";import{a as tt}from"./authenticate-and-persist-oauth-BB8RkINS.js";import{g as Jn}from"./connection-slug-eyAPH6o3.js";import{C as Zn}from"./collection-tabs-BSYCf2on.js";import{u as ut}from"./use-infinite-scroll-B9ylal0v.js";import{B as Fe}from"./badge-DXWWpM_8.js";import{u as es}from"./useSuspenseInfiniteQuery-DvKQE8Wc.js";import{g as Ve}from"./metadata-dUsYcpuu.js";import{u as ts}from"./studio-tools-DhaLu8BB.js";import{u as ns}from"./use-ai-providers-jwS618eT.js";function mt(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ss=Kt({name:Ut().min(2,"Organization name is required")});function os(n){const e=$.c(66),{open:s,onOpenChange:i}=n,o=V();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:gt(ss),defaultValues:{name:""}},e[0]=r):r=e[0];const a=pt(r);let l;e[1]!==o?(l=async E=>{const M=mt(E.name);if(!M)throw new Error(o("common.createOrganizationDialog.invalidSlug"));const U=await ie.organization.create({name:E.name,slug:M});if(U?.error)throw new Error(U.error.message||o("common.createOrganizationDialog.failedToCreate"));const K=U?.data?.slug??M;if(!K)throw new Error(o("common.createOrganizationDialog.failedToCreate"));return{orgSlug:K}},e[1]=o,e[2]=l):l=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=is,e[3]=d):d=e[3];let m;e[4]!==l?(m={mutationFn:l,onSuccess:d},e[4]=l,e[5]=m):m=e[5];const u=qt(m);let p;e[6]!==u.error||e[7]!==o?(p=u.error instanceof Error?u.error.message:u.error?o("common.createOrganizationDialog.failedToCreateGeneric"):null,e[6]=u.error,e[7]=o,e[8]=p):p=e[8];const c=p;let h;e[9]!==o?(h=o("common.createOrganizationDialog.title"),e[9]=o,e[10]=h):h=e[10];let C;e[11]!==h?(C=t.jsx(mn,{children:h}),e[11]=h,e[12]=C):C=e[12];let x;e[13]!==o?(x=o("common.createOrganizationDialog.description"),e[13]=o,e[14]=x):x=e[14];let g;e[15]!==x?(g=t.jsx(fn,{children:x}),e[15]=x,e[16]=g):g=e[16];let j;e[17]!==C||e[18]!==g?(j=t.jsxs(gn,{children:[C,g]}),e[17]=C,e[18]=g,e[19]=j):j=e[19];let b;if(e[20]!==u||e[21]!==a){let E;e[23]!==u?(E=M=>u.mutateAsync(M),e[23]=u,e[24]=E):E=e[24],b=a.handleSubmit(E),e[20]=u,e[21]=a,e[22]=b}else b=e[22];let y;e[25]!==a.formState.isSubmitting||e[26]!==o?(y=E=>{const{field:M}=E;return t.jsxs(Y,{children:[t.jsx(J,{children:o("common.createOrganizationDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(oe,{...M,placeholder:o("common.createOrganizationDialog.namePlaceholder"),disabled:a.formState.isSubmitting})}),t.jsx(vn,{children:o("common.createOrganizationDialog.nameDescription")}),M.value&&t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[o("common.createOrganizationDialog.urlLabel")," ",t.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",mt(M.value)]})]}),t.jsx(ee,{})]})},e[25]=a.formState.isSubmitting,e[26]=o,e[27]=y):y=e[27];let w;e[28]!==a.control||e[29]!==y?(w=t.jsx(Q,{control:a.control,name:"name",render:y}),e[28]=a.control,e[29]=y,e[30]=w):w=e[30];let N;e[31]!==c?(N=c&&t.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[31]=c,e[32]=N):N=e[32];const I=a.formState.isSubmitting;let O;e[33]!==u||e[34]!==a?(O=()=>{u.reset(),a.reset()},e[33]=u,e[34]=a,e[35]=O):O=e[35];let f;e[36]!==o?(f=o("common.createOrganizationDialog.cancel"),e[36]=o,e[37]=f):f=e[37];let _;e[38]!==a.formState.isSubmitting||e[39]!==O||e[40]!==f?(_=t.jsx(pn,{disabled:I,onClick:O,children:f}),e[38]=a.formState.isSubmitting,e[39]=O,e[40]=f,e[41]=_):_=e[41];const T=!a.formState.isValid||a.formState.isSubmitting;let S;e[42]!==a.formState.isSubmitting||e[43]!==o?(S=a.formState.isSubmitting?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(bn,{size:"xs"})," ",o("common.createOrganizationDialog.creating")]}):o("common.createOrganizationDialog.createButton"),e[42]=a.formState.isSubmitting,e[43]=o,e[44]=S):S=e[44];let v;e[45]!==T||e[46]!==S?(v=t.jsx(ne,{type:"submit",variant:"default",disabled:T,children:S}),e[45]=T,e[46]=S,e[47]=v):v=e[47];let P;e[48]!==_||e[49]!==v?(P=t.jsxs(hn,{children:[_,v]}),e[48]=_,e[49]=v,e[50]=P):P=e[50];let k;e[51]!==b||e[52]!==w||e[53]!==N||e[54]!==P?(k=t.jsxs("form",{className:"space-y-6",onSubmit:b,autoComplete:"off",children:[w,N,P]}),e[51]=b,e[52]=w,e[53]=N,e[54]=P,e[55]=k):k=e[55];let A;e[56]!==a||e[57]!==k?(A=t.jsx(st,{...a,children:k}),e[56]=a,e[57]=k,e[58]=A):A=e[58];let z;e[59]!==j||e[60]!==A?(z=t.jsxs(xn,{children:[j,A]}),e[59]=j,e[60]=A,e[61]=z):z=e[61];let B;return e[62]!==i||e[63]!==s||e[64]!==z?(B=t.jsx(jn,{open:s,onOpenChange:i,children:z}),e[62]=i,e[63]=s,e[64]=z,e[65]=B):B=e[65],B}function is(n){const{orgSlug:e}=n;window.location.href=`/${e}`}function Vt(){const n=H.useContext(Xt),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date),refetch:()=>s?.()}}function as(n){let e=0;for(let i=0;i<n.length;i++)e=n.charCodeAt(i)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function at(n){const e=$.c(13),{org:s,size:i}=n,o=i===void 0?"sm":i,r=o==="xs"?"size-5":"size-6",a=o==="xs"?"text-[9px]":"text-xs";let l;e[0]!==r?(l=X(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=l):l=e[1];let d;e[2]!==s.logo||e[3]!==s.name?(d=s.logo?void 0:as(s.name),e[2]=s.logo,e[3]=s.name,e[4]=d):d=e[4];let m;e[5]!==s.logo||e[6]!==s.name||e[7]!==a?(m=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:X("font-semibold leading-none",a),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=a,e[8]=m):m=e[8];let u;return e[9]!==l||e[10]!==d||e[11]!==m?(u=t.jsx("div",{className:l,style:d,children:m}),e[9]=l,e[10]=d,e[11]=m,e[12]=u):u=e[12],u}function rs({invitation:n,onChanged:e}){const s=V(),[i,o]=H.useState(!1),r=n.organizationName??s("header.orgSwitcher.unknownOrganization"),a=async()=>{o(!0);try{const m=await ie.organization.acceptInvitation({invitationId:n.id});if(m.error){G.error(m.error.message),o(!1);return}}catch{G.error(s("header.orgSwitcher.failedToAcceptInvitation")),o(!1);return}G.success(s("header.orgSwitcher.joined",{name:r})),Qt();let d;try{d=(await ie.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=d?`/${d}`:"/"},l=async()=>{o(!0);try{const d=await ie.organization.rejectInvitation({invitationId:n.id});if(d.error){G.error(d.error.message),o(!1);return}G.success(s("header.orgSwitcher.invitationDeclined")),o(!1),e()}catch{G.error(s("header.orgSwitcher.failedToDeclineInvitation")),o(!1)}};return t.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[t.jsx(at,{org:{name:r},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:r}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsx(ne,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:a,disabled:i,children:s("header.orgSwitcher.accept")}),t.jsx(ne,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:l,disabled:i,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:r}),children:t.jsx(Nt,{size:14})})]})]})}function cs(n){const e=$.c(32),{orgParam:s,onSelectOrg:i,onCreateOrg:o}=n,r=V(),{data:a}=Wt(),{invitations:l,refetch:d}=Vt();let m;e[0]!==s?(m=(k,A)=>k.slug===s?-1:A.slug===s?1:k.name.localeCompare(A.name),e[0]=s,e[1]=m):m=e[1];const u=[...a??[]].sort(m),[p,c]=H.useState(""),h=p.toLowerCase(),C=h?u.filter(k=>k.name.toLowerCase().includes(h)||k.slug.toLowerCase().includes(h)):u;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(_t,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=x):x=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=k=>c(k.target.value),e[3]=g):g=e[3];let j;e[4]!==p?(j=k=>k.key==="Escape"&&p&&c(""),e[4]=p,e[5]=j):j=e[5];let b;e[6]!==r?(b=r("header.orgSwitcher.searchOrganizations"),e[6]=r,e[7]=b):b=e[7];let y;e[8]!==p||e[9]!==j||e[10]!==b?(y=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:p,onChange:g,onKeyDown:j,placeholder:b,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=p,e[9]=j,e[10]=b,e[11]=y):y=e[11];let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(we,{size:16}),e[12]=w):w=e[12];let N;e[13]!==o?(N=t.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:w}),e[13]=o,e[14]=N):N=e[14];let I;e[15]!==y||e[16]!==N?(I=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,y,N]}),e[15]=y,e[16]=N,e[17]=I):I=e[17];const O="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let f;e[18]!==l||e[19]!==p||e[20]!==d?(f=!p&&l.map(k=>t.jsx(rs,{invitation:k,onChanged:d},k.id)),e[18]=l,e[19]=p,e[20]=d,e[21]=f):f=e[21];const _=C.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:p?r("header.orgSwitcher.noOrganizationsMatch",{query:p}):r("header.orgSwitcher.noOrganizationsAvailable")});let T;e[22]!==i||e[23]!==s?(T=k=>t.jsxs("button",{type:"button",onClick:()=>i(k.slug),className:X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",k.slug===s?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[t.jsx(at,{org:k,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:k.name}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.slug})]}),k.slug===s&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id),e[22]=i,e[23]=s,e[24]=T):T=e[24];const S=C.map(T);let v;e[25]!==f||e[26]!==_||e[27]!==S?(v=t.jsxs("div",{className:O,children:[f,_,S]}),e[25]=f,e[26]=_,e[27]=S,e[28]=v):v=e[28];let P;return e[29]!==v||e[30]!==I?(P=t.jsxs(t.Fragment,{children:[I,v]}),e[29]=v,e[30]=I,e[31]=P):P=e[31],P}function ls(n){const e=$.c(22),{trigger:s,orgParam:i,align:o,side:r}=n,a=o===void 0?"start":o,l=r===void 0?"bottom":r,d=Re(),[m,u]=H.useState(!1),[p,c]=H.useState(!1);let h;e[0]!==s?(h=t.jsx(Be,{asChild:!0,children:s}),e[0]=s,e[1]=h):h=e[1];const C=String(m);let x;e[2]!==d?(x=I=>{u(!1),d({to:"/$org",params:{org:I}})},e[2]=d,e[3]=x):x=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{u(!1),c(!0)},e[4]=g):g=e[4];let j;e[5]!==i||e[6]!==C||e[7]!==x?(j=t.jsx(cs,{orgParam:i,onSelectOrg:x,onCreateOrg:g},C),e[5]=i,e[6]=C,e[7]=x,e[8]=j):j=e[8];let b;e[9]!==a||e[10]!==l||e[11]!==j?(b=t.jsx(St,{side:l,align:a,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:us,onCloseAutoFocus:ds,children:j}),e[9]=a,e[10]=l,e[11]=j,e[12]=b):b=e[12];let y;e[13]!==m||e[14]!==h||e[15]!==b?(y=t.jsxs(wt,{open:m,onOpenChange:u,children:[h,b]}),e[13]=m,e[14]=h,e[15]=b,e[16]=y):y=e[16];let w;e[17]!==p?(w=t.jsx(os,{open:p,onOpenChange:c}),e[17]=p,e[18]=w):w=e[18];let N;return e[19]!==w||e[20]!==y?(N=t.jsxs(t.Fragment,{children:[y,w]}),e[19]=w,e[20]=y,e[21]=N):N=e[21],N}function ds(n){return n.preventDefault()}function us(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function ms(n){const e=$.c(21),{value:s,onChange:i,placeholder:o,onKeyDown:r,className:a,isSearching:l,disabled:d}=n,m=o===void 0?"Search...":o;let u;e[0]!==a?(u=X("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=u):u=e[1];const p=d?"cursor-not-allowed opacity-50":"cursor-text";let c;e[2]!==p?(c=X("flex items-center gap-2.5 h-12 px-4",p),e[2]=p,e[3]=c):c=e[3];let h;e[4]!==l?(h=l?t.jsx(ke,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(_t,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=l,e[5]=h):h=e[5];let C;e[6]!==i?(C=b=>i(b.target.value),e[6]=i,e[7]=C):C=e[7];let x;e[8]!==d||e[9]!==r||e[10]!==m||e[11]!==C||e[12]!==s?(x=t.jsx("input",{type:"text",value:s,onChange:C,onKeyDown:r,placeholder:m,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=r,e[10]=m,e[11]=C,e[12]=s,e[13]=x):x=e[13];let g;e[14]!==c||e[15]!==h||e[16]!==x?(g=t.jsxs("label",{className:c,children:[h,x]}),e[14]=c,e[15]=h,e[16]=x,e[17]=g):g=e[17];let j;return e[18]!==u||e[19]!==g?(j=t.jsx("div",{className:u,children:g}),e[18]=u,e[19]=g,e[20]=j):j=e[20],j}function rt(n){const e=n?.metadata?.githubRepo;if(!e?.url)return{status:"none"};const s=e.connectionId;return!!s&&!!n?.connections?.some(r=>r.connection_id===s)?{status:"attached",repo:e,connectionId:s}:!!s||e.installationId!=null?{status:"detached",repo:e}:{status:"public-clone",repo:e}}function $o(n){const e=rt(n);return e.status==="attached"||e.status==="public-clone"?e.repo:null}function Rt(n){if(typeof n!="object"||n===null)return!1;const s=n.githubRepo?.url;return typeof s=="string"&&s.length>0}function Fo(n){return rt(n).status==="attached"}function Lo(n){const e=rt(n).status;return e==="attached"||e==="detached"}function fs(n){const e=new Set;for(const s of n??[]){const i=s.metadata?.liveAgentId;typeof i=="string"&&i&&e.add(s.id)}return e}function Bo(n,e){if(!n)return null;const s=n.metadata?.liveAgentId;if(typeof s=="string"&&s)return{mode:"dev",targetId:s};const i=(e??[]).find(o=>o.metadata?.liveAgentId===n.id);return i?{mode:"live",targetId:i.id}:null}function gs(n){const e=$.c(6),{value:s,onChange:i}=n,o=V();let r;e[0]!==o?(r=o("sidebar.agentsSection.searchAgents"),e[0]=o,e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==r||e[4]!==s?(a=t.jsx(ms,{value:s,onChange:i,placeholder:r}),e[2]=i,e[3]=r,e[4]=s,e[5]=a):a=e[5],a}function ps(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=i):i=n[3],i}function hs(n){const e=$.c(10),{org:s,onClose:i}=n,o=V();let r;e[0]!==s.slug?(r={org:s.slug},e[0]=s.slug,e[1]=r):r=e[1];let a;e[2]!==i?(a=()=>i(),e[2]=i,e[3]=a):a=e[3];let l;e[4]!==o?(l=o("sidebar.agentsSection.seeAllAgents"),e[4]=o,e[5]=l):l=e[5];let d;return e[6]!==r||e[7]!==a||e[8]!==l?(d=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(Yt,{to:"/$org/settings/agents",params:r,onClick:a,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:l})}),e[6]=r,e[7]=a,e[8]=l,e[9]=d):d=e[9],d}function xs(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(Ht,{children:s}),n[2]=s,n[3]=i):i=n[3],i}function js(n){const e=$.c(11),{onImportFromGithub:s}=n,i=V();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Nn,{className:"size-3.5"}),e[0]=o):o=e[0];let r;e[1]!==i?(r=i("sidebar.agentsSection.import"),e[1]=i,e[2]=r):r=e[2];let a;e[3]!==s||e[4]!==r?(a=t.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[o,r]}),e[3]=s,e[4]=r,e[5]=a):a=e[5];let l;e[6]!==i?(l=i("sidebar.agentsSection.codeAgents"),e[6]=i,e[7]=l):l=e[7];let d;return e[8]!==a||e[9]!==l?(d=t.jsx(Ht,{action:a,children:l}),e[8]=a,e[9]=l,e[10]=d):d=e[10],d}function vs(n){const e=$.c(11),{setOpen:s,emptyCtaClass:i}=n,o=V();let r;e[0]!==o?(r=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=r):r=e[1];let a;e[2]!==i?(a=X(i),e[2]=i,e[3]=a):a=e[3];let l;e[4]!==s?(l=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=l):l=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(we,{className:"size-4"}),e[6]=d):d=e[6];let m;return e[7]!==r||e[8]!==a||e[9]!==l?(m=t.jsx(Dt,{"aria-label":r,className:a,onClick:l,children:d}),e[7]=r,e[8]=a,e[9]=l,e[10]=m):m=e[10],m}function bs(n){const e=$.c(17),{setOpen:s,highlightEmpty:i,emptyCtaClass:o}=n,r=V();let a;e[0]!==i||e[1]!==r?(a=i?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=r,e[2]=a):a=e[2];let l;e[3]!==o?(l=X(o),e[3]=o,e[4]=l):l=e[4];let d;e[5]!==s?(d=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=d):d=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(we,{}),e[7]=m):m=e[7];let u;e[8]!==r?(u=r("sidebar.agentsSection.newAgent"),e[8]=r,e[9]=u):u=e[9];let p;e[10]!==u?(p=t.jsx("span",{children:u}),e[10]=u,e[11]=p):p=e[11];let c;return e[12]!==a||e[13]!==l||e[14]!==d||e[15]!==p?(c=t.jsx(Ct,{children:t.jsxs(yt,{tooltip:a,className:l,onClick:d,children:[m,p]})}),e[12]=a,e[13]=l,e[14]=d,e[15]=p,e[16]=c):c=e[16],c}function Cs(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(At,{className:"sr-only",children:s}),n[2]=s,n[3]=i):i=n[3],i}function ys(n){const e=$.c(8),{emptyCtaClass:s}=n,i=V();let o;e[0]!==i?(o=i("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=o):o=e[1];let r;e[2]!==s?(r=X(s),e[2]=s,e[3]=r):r=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{className:"size-4"}),e[4]=a):a=e[4];let l;return e[5]!==o||e[6]!==r?(l=t.jsx(Dt,{"aria-label":o,className:r,children:a}),e[5]=o,e[6]=r,e[7]=l):l=e[7],l}function Ss(n){const e=$.c(19),{wrapEmptyHint:s,highlightEmpty:i,emptyCtaClass:o}=n,r=V();let a;e[0]!==i||e[1]!==r?(a=i?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=r,e[2]=a):a=e[2];let l;e[3]!==o?(l=X(o),e[3]=o,e[4]=l):l=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(we,{}),e[5]=d):d=e[5];let m;e[6]!==r?(m=r("sidebar.agentsSection.newAgent"),e[6]=r,e[7]=m):m=e[7];let u;e[8]!==m?(u=t.jsx("span",{children:m}),e[8]=m,e[9]=u):u=e[9];let p;e[10]!==a||e[11]!==l||e[12]!==u?(p=t.jsx(Be,{asChild:!0,children:t.jsxs(yt,{tooltip:a,className:l,children:[d,u]})}),e[10]=a,e[11]=l,e[12]=u,e[13]=p):p=e[13];let c;e[14]!==p||e[15]!==s?(c=s(p),e[14]=p,e[15]=s,e[16]=c):c=e[16];let h;return e[17]!==c?(h=t.jsx(Ct,{children:c}),e[17]=c,e[18]=h):h=e[18],h}function ws(n){const e=$.c(9),{children:s}=n,i=V();let o;e[0]!==s?(o=t.jsx(Ce,{asChild:!0,children:s}),e[0]=s,e[1]=o):o=e[1];let r;e[2]!==i?(r=i("sidebar.agentsSection.selectAnExistingAgent"),e[2]=i,e[3]=r):r=e[3];let a;e[4]!==r?(a=t.jsx(ye,{side:"right",sideOffset:8,children:r}),e[4]=r,e[5]=a):a=e[5];let l;return e[6]!==o||e[7]!==a?(l=t.jsxs(Se,{defaultOpen:!0,delayDuration:0,children:[o,a]}),e[6]=o,e[7]=a,e[8]=l):l=e[8],l}function _s(n){const e=$.c(4),s=Re(),{create:i}=kn();let o;return e[0]!==i||e[1]!==s||e[2]!==n?(o=async r=>{const a=crypto.randomUUID();try{await i({id:a,virtual_mcp_id:r})}catch{}s({to:"/$org/$taskId",params:{org:n,taskId:a},search:{virtualmcpid:r}})},e[0]=i,e[1]=s,e[2]=n,e[3]=o):o=e[3],o}function nt(n){const e=$.c(20),{agent:s,selected:i,onClick:o}=n,r=i?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let a;e[0]!==r?(a=X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=a):a=e[1];let l;e[2]!==s.icon||e[3]!==s.title?(l=t.jsx(vt,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=l):l=e[4];let d;e[5]!==s.title?(d=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=d):d=e[6];let m;e[7]!==s.description?(m=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=m):m=e[8];let u;e[9]!==d||e[10]!==m?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,m]}),e[9]=d,e[10]=m,e[11]=u):u=e[11];let p;e[12]!==i?(p=i&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=i,e[13]=p):p=e[13];let c;return e[14]!==o||e[15]!==a||e[16]!==l||e[17]!==u||e[18]!==p?(c=t.jsxs("button",{type:"button",onClick:o,className:a,children:[l,u,p]}),e[14]=o,e[15]=a,e[16]=l,e[17]=u,e[18]=p,e[19]=c):c=e[19],c}function Ht(n){const e=$.c(5),{children:s,action:i}=n;let o;e[0]!==s?(o=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=o):o=e[1];let r;return e[2]!==i||e[3]!==o?(r=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[o,i]}),e[2]=i,e[3]=o,e[4]=r):r=e[4],r}function Ns(n){const e=$.c(23),{onClose:s,onSelectAgent:i,selectedAgentId:o,onImportFromGithub:r}=n,[a,l]=H.useState(""),d=dn(),m=d??[],{org:u}=ae(),{data:p}=ie.useSession(),c=p?.user?.id??"anon",h=An(d),C=Pn(),x=_s(u.slug),g=fs(d),j=a.toLowerCase(),b=m.filter(As).filter(L=>!g.has(L.id)).filter(Is).filter(L=>!a||L.title.toLowerCase().includes(j)),y=b.filter(ks),w=b.filter(Ds),N=it(u.id),I=!a||N.title.toLowerCase().includes(j),O=!!(i&&I);let f;e[0]!==s||e[1]!==i?(f=()=>{i?.(null),s(),l("")},e[0]=s,e[1]=i,e[2]=f):f=e[2];const _=f,T=L=>{if(i){i(L.id),s(),l("");return}Tn({orgId:u.id,userId:c},L.id,h),C(),s(),l(""),x(L.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let v;e[3]!==a?(v=t.jsx(gs,{value:a,onChange:l}),e[3]=a,e[4]=v):v=e[4];const P="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",k=i&&I&&N&&t.jsx(nt,{agent:N,selected:!o||o===N.id,onClick:_}),A=(y.length>0||!a)&&t.jsx(js,{onImportFromGithub:r}),z=y.map(L=>t.jsx(nt,{agent:L,selected:i?o===L.id:void 0,onClick:()=>T(L)},L.id)),B=w.length>0&&t.jsx(xs,{}),E=w.map(L=>t.jsx(nt,{agent:L,selected:i?o===L.id:void 0,onClick:()=>T(L)},L.id));let M;e[5]!==O||e[6]!==a||e[7]!==b.length?(M=b.length===0&&!O&&a&&t.jsx(ps,{}),e[5]=O,e[6]=a,e[7]=b.length,e[8]=M):M=e[8];let U;e[9]!==M||e[10]!==k||e[11]!==A||e[12]!==z||e[13]!==B||e[14]!==E?(U=t.jsxs("div",{className:P,children:[k,A,z,B,E,M]}),e[9]=M,e[10]=k,e[11]=A,e[12]=z,e[13]=B,e[14]=E,e[15]=U):U=e[15];let K;e[16]!==s||e[17]!==u?(K=t.jsx(hs,{org:u,onClose:s}),e[16]=s,e[17]=u,e[18]=K):K=e[18];let de;return e[19]!==U||e[20]!==K||e[21]!==v?(de=t.jsxs("div",{className:S,children:[v,U,K]}),e[19]=U,e[20]=K,e[21]=v,e[22]=de):de=e[22],de}function Ds(n){return!Rt(n.metadata)}function ks(n){return Rt(n.metadata)}function Is(n){return!rn(n.id)}function As(n){return!an(n.id)}function Ps(n){const e=$.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:i,trigger:o,onSelectAgent:r,selectedAgentId:a,side:l,align:d}=s,m=i===void 0?!1:i,u=l===void 0?"right":l,p=d===void 0?"start":d,[c,h]=H.useState(!1),[C,x]=H.useState(!1),g=Pt(),{setOpenMobile:j}=bt(),b=In(),y=b?"border border-border":void 0;let w;e[2]!==b?(w=A=>b?t.jsx(ws,{children:A}):A,e[2]=b,e[3]=w):w=e[3];const N=w;let I;e[4]!==g||e[5]!==j?(I=()=>{h(!1),g&&j(!1)},e[4]=g,e[5]=j,e[6]=I):I=e[6];const O=I;let f;e[7]!==O?(f=()=>{O(),x(!0)},e[7]=O,e[8]=f):f=e[8];const _=f;let T;e[9]!==O||e[10]!==_||e[11]!==r||e[12]!==c||e[13]!==a?(T=c&&t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(Cn,{className:"h-4 w-24"})}),children:t.jsx(Ns,{onClose:O,onSelectAgent:r,selectedAgentId:a,onImportFromGithub:_})}),e[9]=O,e[10]=_,e[11]=r,e[12]=c,e[13]=a,e[14]=T):T=e[14];const S=T;let v;e[15]!==p||e[16]!==m||e[17]!==y||e[18]!==b||e[19]!==g||e[20]!==c||e[21]!==S||e[22]!==u||e[23]!==o||e[24]!==N?(v=g?t.jsxs(t.Fragment,{children:[o?t.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:o}):m?N(t.jsx(vs,{setOpen:h,emptyCtaClass:y})):t.jsx(bs,{setOpen:h,highlightEmpty:b,emptyCtaClass:y}),t.jsx(kt,{open:c,onOpenChange:h,direction:"bottom",children:t.jsxs(It,{className:"max-h-[85dvh] p-0",children:[t.jsx(Cs,{}),S]})})]}):t.jsxs(wt,{open:c,onOpenChange:A=>{A&&!c&&R("agent_browser_opened",{surface:"desktop_popover"}),h(A)},children:[o?t.jsx(Be,{asChild:!0,children:o}):m?N(t.jsx(Be,{asChild:!0,children:t.jsx(ys,{emptyCtaClass:y})})):t.jsx(Ss,{wrapEmptyHint:N,highlightEmpty:b,emptyCtaClass:y}),t.jsx(St,{className:"w-[380px] p-0 overflow-hidden",side:u,align:p,children:S})]}),e[15]=p,e[16]=m,e[17]=y,e[18]=b,e[19]=g,e[20]=c,e[21]=S,e[22]=u,e[23]=o,e[24]=N,e[25]=v):v=e[25];let P;e[26]!==C?(P=t.jsx(Dn,{open:C,onOpenChange:x,mode:"agent"}),e[26]=C,e[27]=P):P=e[27];let k;return e[28]!==P||e[29]!==v?(k=t.jsxs(t.Fragment,{children:[v,P]}),e[28]=P,e[29]=v,e[30]=k):k=e[30],k}const Ts="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Os(n){const e=$.c(19),{agentId:s,fallback:i,onOpenHome:o,onPick:r}=n,a=un(s)??i??null,l=a?.title??"Super Agent",d=`Open ${l} home`,m=a?.icon??null;let u;e[0]!==m||e[1]!==l?(u=t.jsx(vt,{icon:m,name:l,size:"xs"}),e[0]=m,e[1]=l,e[2]=u):u=e[2];let p;e[3]!==o||e[4]!==d||e[5]!==u?(p=t.jsx("button",{type:"button",onClick:o,"aria-label":d,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:u}),e[3]=o,e[4]=d,e[5]=u,e[6]=p):p=e[6];let c;e[7]!==l?(c=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:l}),e[7]=l,e[8]=c):c=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(jt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=h):h=e[9];let C;e[10]!==c?(C=t.jsxs("button",{type:"button",className:Ts,children:[c,h]}),e[10]=c,e[11]=C):C=e[11];let x;e[12]!==s||e[13]!==r||e[14]!==C?(x=t.jsx(Ps,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:r,trigger:C}),e[12]=s,e[13]=r,e[14]=C,e[15]=x):x=e[15];let g;return e[16]!==p||e[17]!==x?(g=t.jsxs("div",{className:"flex min-w-0 items-center gap-0",children:[p,x]}),e[16]=p,e[17]=x,e[18]=g):g=e[18],g}function Eo(n){const e=$.c(26);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:i}=s,{org:o}=ae(),{state:r,isMobile:a}=bt(),l=Vt().invitations.length>0,d=r==="collapsed"||a,m=l?`${o.name} — switch organization (pending invitation)`:`${o.name} — switch organization`;let u;e[2]!==o?(u=t.jsx(at,{org:o,size:"sm"}),e[2]=o,e[3]=u):u=e[3];let p;e[4]!==l||e[5]!==d?(p=l&&t.jsx("span",{className:X("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",d?"-top-1":"top-1/2 -translate-y-1/2")}),e[4]=l,e[5]=d,e[6]=p):p=e[6];let c;e[7]!==u||e[8]!==p?(c=t.jsxs("span",{className:"relative inline-flex",children:[u,p]}),e[7]=u,e[8]=p,e[9]=c):c=e[9];let h;e[10]!==o.name||e[11]!==i?(h=i&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:o.name}),e[10]=o.name,e[11]=i,e[12]=h):h=e[12];let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(jt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[13]=C):C=e[13];let x;e[14]!==m||e[15]!==c||e[16]!==h?(x=t.jsx(Ce,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":m,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[c,h,C]})}),e[14]=m,e[15]=c,e[16]=h,e[17]=x):x=e[17];let g;e[18]!==o.slug||e[19]!==x?(g=t.jsx(ls,{orgParam:o.slug,trigger:x}),e[18]=o.slug,e[19]=x,e[20]=g):g=e[20];let j;e[21]!==o.name?(j=t.jsx(ye,{side:"bottom",children:o.name}),e[21]=o.name,e[22]=j):j=e[22];let b;return e[23]!==j||e[24]!==g?(b=t.jsxs(Se,{children:[g,j]}),e[23]=j,e[24]=g,e[25]=b):b=e[25],b}function Vo(n){const e=$.c(24);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:i}=s,{org:o}=ae(),r=Re();let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[2]=a):a=e[2];const l=ht(a);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},e[3]=d):d=e[3];const m=xt(d),{threads:u}=Tt(),{data:p}=ie.useSession(),{setTaskId:c,createNewTask:h}=Ot();let C;e[4]!==o.id?(C=it(o.id),e[4]=o.id,e[5]=C):C=e[5];const x=C,g=x.id,j=l.taskId?m.virtualmcpid??g:g;let b;e[6]!==h||e[7]!==g||e[8]!==r||e[9]!==i||e[10]!==o.slug||e[11]!==p?.user?.id||e[12]!==c||e[13]!==u?(b=f=>{if(!f||f===g){r({to:"/$org",params:{org:o.slug}}),i?.();return}const _=On(u,f,p?.user?.id);_?c(_.id,f):h(f),i?.()},e[6]=h,e[7]=g,e[8]=r,e[9]=i,e[10]=o.slug,e[11]=p?.user?.id,e[12]=c,e[13]=u,e[14]=b):b=e[14];const y=b;let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[15]=w):w=e[15];const N=j===g?x:void 0;let I;e[16]!==j||e[17]!==y?(I=()=>y(j),e[16]=j,e[17]=y,e[18]=I):I=e[18];let O;return e[19]!==j||e[20]!==y||e[21]!==N||e[22]!==I?(O=t.jsx(H.Suspense,{fallback:w,children:t.jsx(Os,{agentId:j,fallback:N,onOpenHome:I,onPick:y})}),e[19]=j,e[20]=y,e[21]=N,e[22]=I,e[23]=O):O=e[23],O}function Ro(){const n=$.c(24),e=V(),{org:s}=ae();let i;n[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},n[0]=i):i=n[0];const o=ht(i);let r;n[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},n[1]=r):r=n[1];const a=xt(r),{threads:l}=Tt(),{createNewTask:d}=Ot();let m;n[2]!==s.id?(m=it(s.id),n[2]=s.id,n[3]=m):m=n[3];const u=m.id,p=o.taskId?a.virtualmcpid??u:u;let c;n[4]!==o.taskId||n[5]!==l?(c=(o.taskId?l.find(I=>I.id===o.taskId)?.branch:null)??null,n[4]=o.taskId,n[5]=l,n[6]=c):c=n[6];const h=c;let C;n[7]!==p||n[8]!==d||n[9]!==h?(C=()=>{d(p,h)},n[7]=p,n[8]=d,n[9]=h,n[10]=C):C=n[10];const x=C;let g;n[11]!==e?(g=e("sidebar.taskGroupsList.newChat"),n[11]=e,n[12]=g):g=n[12];let j;n[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(sn,{size:16}),n[13]=j):j=n[13];let b;n[14]!==x||n[15]!==g?(b=t.jsx(Ce,{asChild:!0,children:t.jsx("button",{type:"button",onClick:x,"aria-label":g,className:"wco-no-drag flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:j})}),n[14]=x,n[15]=g,n[16]=b):b=n[16];let y;n[17]!==e?(y=e("sidebar.taskGroupsList.newChat"),n[17]=e,n[18]=y):y=n[18];let w;n[19]!==y?(w=t.jsx(ye,{side:"bottom",children:y}),n[19]=y,n[20]=w):w=n[20];let N;return n[21]!==b||n[22]!==w?(N=t.jsxs(Se,{children:[b,w]}),n[21]=b,n[22]=w,n[23]=N):N=n[23],N}function zs({open:n,onOpenChange:e,onCreated:s}){const i=V(),{org:o}=ae(),{data:r}=ie.useSession(),{stdioEnabled:a}=Jt(),l=Pt(),d=Et(),m=zt(),p=Mt(m,"").items,c=pt({resolver:gt(qn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),h=c.watch("ui_type"),C=c.watch("connection_url"),x=c.watch("npx_package"),g=$e({uiType:h,connectionUrl:C??"",npxPackage:x??""})??dt({uiType:h,connectionUrl:C??"",registryItems:p}),j=f=>{const _=f.trim();if(!_)return;const T=!!c.formState.dirtyFields.title,S=!!c.formState.dirtyFields.description,v=!!c.formState.dirtyFields.env_vars,P=A=>{if(A&&(!T&&!c.getValues("title").trim()&&A.title&&c.setValue("title",A.title,{shouldDirty:!1}),!S&&!(c.getValues("description")??"").trim()&&A.description&&c.setValue("description",A.description,{shouldDirty:!1}),!v&&A.envVarKeys?.length)){const z=c.getValues("env_vars")??[],B=new Set(z.map(M=>M.key)),E=A.envVarKeys.filter(M=>!B.has(M));E.length>0&&c.setValue("env_vars",[...z,...E.map(M=>({key:M,value:""}))],{shouldDirty:!0})}},k=Wn(_);if(k&&a){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",k.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),P($e({uiType:"NPX",npxPackage:k.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const A=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";c.setValue("ui_type",A,{shouldDirty:!0}),c.setValue("connection_url",_,{shouldDirty:!0}),P($e({uiType:A,connectionUrl:_})??dt({uiType:A,connectionUrl:_,registryItems:p}));return}h==="NPX"&&P($e({uiType:"NPX",npxPackage:_}))},b=f=>{f||c.reset(),e(f)},y=async f=>{let _,T=null,S=null,v=null;f.ui_type==="NPX"?(_="STDIO",T="",v=Qn(f.npx_package||"",f.env_vars||[])):f.ui_type==="STDIO"?(_="STDIO",T="",v=Yn(f.stdio_command||"",f.stdio_args||"",f.stdio_cwd,f.env_vars||[])):(_=f.ui_type,T=f.connection_url||"",S=f.connection_token||null);const P=Mn("conn");try{await d.create.mutateAsync({id:P,title:f.title,description:f.description||null,connection_type:_,connection_url:T,connection_token:S,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:r?.user?.id||"system",organization_id:o.id,icon:f.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"}),c.reset(),e(!1),s?.(P)}catch{G.error(i("connections.createConnectionDialog.failedToCreateConnection"))}},w=i("connections.createConnectionDialog.title"),N=i("connections.createConnectionDialog.description"),I=c.formState.isSubmitting?i("connections.createConnectionDialog.saving"):i("connections.createConnectionDialog.createButton"),O=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:c.control,name:"ui_type",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.typeLabel")}),t.jsxs(Rn,{value:f.value,onValueChange:f.onChange,children:[t.jsx(Z,{children:t.jsx(Hn,{children:t.jsx(Gn,{})})}),t.jsxs(Kn,{children:[t.jsx(De,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.httpType")]})}),t.jsx(De,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.sseType")]})}),t.jsx(De,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.websocketType")]})}),a&&t.jsxs(t.Fragment,{children:[t.jsx(De,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Le,{className:"w-4 h-4"}),i("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(De,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(on,{className:"w-4 h-4"}),i("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(ee,{})]})}),h==="NPX"&&t.jsx(Q,{control:c.control,name:"npx_package",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.npmPackagePlaceholder"),...f,value:f.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),c.setValue("npx_package",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),f.onBlur()}})}),t.jsx(ee,{})]})}),h==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:c.control,name:"stdio_command",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.commandLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.commandPlaceholder"),...f,value:f.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:c.control,name:"stdio_args",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.argumentsLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.argumentsPlaceholder"),...f,value:f.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:c.control,name:"stdio_cwd",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.workingDirectoryPlaceholder"),...f,value:f.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(ee,{})]})})]}),(h==="NPX"||h==="STDIO")&&t.jsx(Q,{control:c.control,name:"env_vars",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(Z,{children:t.jsx(Xn,{value:f.value??[],onChange:f.onChange})}),t.jsx(ee,{})]})}),h!=="NPX"&&h!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:c.control,name:"connection_url",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.urlLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.urlPlaceholder"),...f,value:f.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),c.setValue("connection_url",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),f.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:c.control,name:"connection_token",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:g?.token?.label??i("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(Z,{children:t.jsx(oe,{type:"password",placeholder:g?.token?.placeholder??i("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...f,value:f.value??""})}),g?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[g.token.helperText,g.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:i("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:c.control,name:"title",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.namePlaceholder"),...f})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:c.control,name:"description",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.descriptionLabel")}),t.jsx(Z,{children:t.jsx(Un,{placeholder:i("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...f,value:f.value??""})}),t.jsx(ee,{})]})})]});return l?t.jsx(kt,{open:n,onOpenChange:b,children:t.jsxs(It,{className:"max-h-[90vh]",children:[t.jsx(yn,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(At,{children:w}),t.jsx(Sn,{className:"mt-1",children:N})]}),t.jsx(wn,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Nt,{size:16})})})]})}),t.jsx(st,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(y),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:O}),t.jsx(_n,{children:t.jsx(ne,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:I})})]})})]})}):t.jsx($t,{open:n,onOpenChange:b,children:t.jsxs(Ft,{className:"sm:max-w-[525px]",children:[t.jsxs(Lt,{children:[t.jsx(Bt,{children:w}),t.jsx(En,{children:N})]}),t.jsx(st,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(y),children:[t.jsx("div",{className:"py-4",children:O}),t.jsxs(Vn,{children:[t.jsx(ne,{type:"button",variant:"outline",onClick:()=>b(!1),children:i("connections.createConnectionDialog.cancelButton")}),t.jsx(ne,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:I})]})]})})]})})}function Ms(n){const e=$.c(72),{mode:s,agentId:i,addedConnectionIds:o,onAdd:r,onCloneAndAdd:a,onConnectAndAdd:l,connectingItemId:d,search:m,onCreateConnection:u,onBrowseNavigate:p,defaultTab:c}=n,h=s===void 0?"add":s,C=c===void 0?"connected":c,x=V(),{org:g}=ae(),j=H.useDeferredValue(m),b=m!==j;let y;e[0]!==j?(y=j.trim().toLowerCase(),e[0]=j,e[1]=y):y=e[1];const w=y;let N;e[2]!==C?(N=D=>D??C,e[2]=C,e[3]=N):N=e[3];const[I,O]=Zt(en.connectionsTab(g.slug)+(C==="all"?":home-modal":":agent-modal"),N);let f;e[4]!==I||e[5]!==O?(f=D=>{D!==I&&R("connections_dialog_tab_changed",{to_tab:D}),O(D)},e[4]=I,e[5]=O,e[6]=f):f=e[6];const _=f;let T;e[7]!==g.id||e[8]!==g.slug?(T={connectionId:cn,orgId:g.id,orgSlug:g.slug},e[7]=g.id,e[8]=g.slug,e[9]=T):T=e[9];const S=ln(T),v=j?.trim().split(/\s+/).filter(Boolean)??[],P=v.length>0?{operator:"or",conditions:v.flatMap(Hs)}:void 0,k={...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},A=JSON.stringify(k),{data:z,fetchNextPage:B,hasNextPage:E,isFetchingNextPage:M}=es({queryKey:ot.collectionListInfinite(S,g.id,"","CONNECTIONS",A),queryFn:async D=>{const{pageParam:F}=D,se=F===void 0?0:F;return(await S.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:se}})).structuredContent},initialPageParam:0,getNextPageParam:Vs,staleTime:3e4}),U=z?.pages.flatMap(Es)??[],K=Bn(U),de=new Set(U.filter(Bs).map(Ls)),L=zt(),re=Mt(L,j),He=ut(re.loadMore,re.hasMore,re.isLoadingMore),Ge=ut(B,E??!1,M),W=I==="all"||!!w,ct=W?re.items.filter(D=>{const F=$n(D);if(F&&de.has(F))return!1;if(!w)return!0;const se=Ve(D._meta),ce=[D.title,D.description,D.name,D.server?.title,D.server?.description,D.server?.name,se?.friendly_name,se?.friendlyName].filter(Boolean).join(" ").toLowerCase();return v.some(te=>ce.includes(te.toLowerCase()))}):[],_e=ct.filter(Fs),Ne=ct.filter($s);let Ie;e[10]!==o?(Ie=D=>D.some(F=>o.has(F.id)),e[10]=o,e[11]=Ie):Ie=e[11];const Ke=Ie;let Ae;e[12]!==o||e[13]!==i||e[14]!==d||e[15]!==Ke||e[16]!==h||e[17]!==r||e[18]!==p||e[19]!==a||e[20]!==x?(Ae=(D,F,se,ce,te)=>{const Me=Ke(te),be=te.find(le=>!o.has(le.id)),q=te[0];if(h==="browse"){const le=Jn(q);return t.jsx(Je,{connection:{title:F,icon:se,description:te.length>1?`${te.length} instances`:ce??void 0},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",x("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{R("connection_browse_clicked",{app_name:q.app_name??null,connection_id:q.id,instances_count:te.length}),p?.(le)}},D)}return t.jsx(Je,{connection:{title:F,icon:se,description:ce},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Me&&t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",x("virtualMcp.connectionDialogContent.added")]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:le=>{le.stopPropagation(),be?(R("connection_add_clicked",{action:"use_existing",app_name:q.app_name??null,connection_id:be.id}),i&&R("agent_connection_attached",{agent_id:i,connection_id:be.id,app_name:q.app_name??null,mode:"existing"}),r(be.id)):(R("connection_add_clicked",{action:"clone",app_name:q.app_name??null,base_connection_id:q.id}),a(q))},children:x("virtualMcp.connectionDialogContent.add")})]})},D)},e[12]=o,e[13]=i,e[14]=d,e[15]=Ke,e[16]=h,e[17]=r,e[18]=p,e[19]=a,e[20]=x,e[21]=Ae):Ae=e[21];const Pe=Ae;let Te;e[22]!==d||e[23]!==h||e[24]!==l||e[25]!==x?(Te=D=>{const F=Ve(D._meta),se=F?.friendlyName||F?.friendly_name||D.server?.title||D.title||D.server?.name||D.name||D.id||"",ce=D.server?.description||D.description||null,te=D.server?.icons?.[0]?.src||Fn(D.server?.repository)||null,Me=F?.official===!0,be=F?.verified===!0,q=F?.owner==="deco";return t.jsx(Je,{connection:{title:se,description:ce,icon:te},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[q&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:t.jsx("img",{src:"/logos/deco logo.svg",alt:x("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.builtByDeco")})]}),!q&&Me&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Ze,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!q&&!Me&&be&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Ze,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:le=>{le.stopPropagation(),R("connection_add_clicked",{action:"connect_new",registry_item_id:D.id,app_name:F?.friendlyName||D.server?.name||D.name||null}),l(D)},children:d===D.id?t.jsx(ke,{size:14,className:"animate-spin"}):x(h==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${D.id}`)},e[22]=d,e[23]=h,e[24]=l,e[25]=x,e[26]=Te):Te=e[26];const lt=Te;let ue;e[27]!==I||e[28]!==_||e[29]!==u||e[30]!==w||e[31]!==x?(ue=!w&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(Zn,{tabs:[{id:"all",label:x("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:x("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:I,onTabChange:D=>_(D)}),t.jsxs(ne,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{R("connections_dialog_custom_clicked"),u()},children:[t.jsx(we,{size:12}),x("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=I,e[28]=_,e[29]=u,e[30]=w,e[31]=x,e[32]=ue):ue=e[32];const Ue=b&&"opacity-50 pointer-events-none";let me;e[33]!==Ue?(me=X("flex-1 overflow-auto p-5 transition-opacity duration-150",Ue),e[33]=Ue,e[34]=me):me=e[34];const Gt="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Oe;e[35]!==Pe?(Oe=D=>{if(D.type==="group")return Pe(D.key,D.title,D.icon,null,D.connections);const F=D.connection;return Pe(F.id,F.title,F.icon,F.description??null,[F])},e[35]=Pe,e[36]=Oe):Oe=e[36];const qe=K.map(Oe);let fe;e[37]!==Ge?(fe=t.jsx("div",{ref:Ge,className:"col-span-full h-1"}),e[37]=Ge,e[38]=fe):fe=e[38];let ge;e[39]!==M?(ge=M&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),e[39]=M,e[40]=ge):ge=e[40];const Xe=W&&_e.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(Ze,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),We=W&&_e.map(lt),Qe=W&&Ne.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Ye=W&&Ne.map(lt);let pe;e[41]!==He||e[42]!==L||e[43]!==W?(pe=W&&L.length>0&&t.jsx("div",{ref:He,className:"col-span-full h-1"}),e[41]=He,e[42]=L,e[43]=W,e[44]=pe):pe=e[44];let he;e[45]!==re.isLoadingMore||e[46]!==W?(he=W&&re.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),e[45]=re.isLoadingMore,e[46]=W,e[47]=he):he=e[47];let xe;e[48]!==qe||e[49]!==fe||e[50]!==ge||e[51]!==Xe||e[52]!==We||e[53]!==Qe||e[54]!==Ye||e[55]!==pe||e[56]!==he?(xe=t.jsxs("div",{className:Gt,children:[qe,fe,ge,Xe,We,Qe,Ye,pe,he]}),e[48]=qe,e[49]=fe,e[50]=ge,e[51]=Xe,e[52]=We,e[53]=Qe,e[54]=Ye,e[55]=pe,e[56]=he,e[57]=xe):xe=e[57];let je;e[58]!==I||e[59]!==K.length||e[60]!==Ne||e[61]!==m||e[62]!==x||e[63]!==_e?(je=K.length===0&&_e.length===0&&Ne.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:m?x("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:m}):x(I==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=I,e[59]=K.length,e[60]=Ne,e[61]=m,e[62]=x,e[63]=_e,e[64]=je):je=e[64];let ve;e[65]!==me||e[66]!==xe||e[67]!==je?(ve=t.jsxs("div",{className:me,children:[xe,je]}),e[65]=me,e[66]=xe,e[67]=je,e[68]=ve):ve=e[68];let ze;return e[69]!==ue||e[70]!==ve?(ze=t.jsxs(t.Fragment,{children:[ue,ve]}),e[69]=ue,e[70]=ve,e[71]=ze):ze=e[71],ze}function $s(n){return!n.verified&&!Ve(n._meta)?.verified&&!n.meta?.verified}function Fs(n){return n.verified||Ve(n._meta)?.verified||n.meta?.verified}function Ls(n){return n.app_name}function Bs(n){return n.app_name}function Es(n){return n?.items??[]}function Vs(n,e){if(n?.hasMore)return e.reduce(Rs,0)}function Rs(n,e){return n+(e?.items?.length??0)}function Hs(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function Ho({open:n,onOpenChange:e,defaultTab:s,initialSearch:i="",...o}){const r=V(),a=o.mode??"add",l="agentId"in o?o.agentId:void 0,d="addedConnectionIds"in o?o.addedConnectionIds??new Set:new Set,m="onAdd"in o&&o.onAdd?o.onAdd:S=>{},u=(S,v,P)=>{l&&R("agent_connection_attached",{agent_id:l,connection_id:S,app_name:v,mode:P})},[p,c]=H.useState(null),[h,C]=H.useState(i),[x,g]=H.useState(!1),{org:j}=ae(),{data:b}=ie.useSession(),y=Et(),w=tn(),N=Re(),I=S=>{e(!1),N({to:"/$org/settings/connections/$appSlug",params:{org:j.slug,appSlug:S}})},O=()=>{w.invalidateQueries({predicate:S=>{const v=S.queryKey;return v[1]===j.id&&v[3]==="collection"&&v[4]==="CONNECTIONS"}})},f=async(S,v)=>{R("connection_oauth_succeeded",{connection_id:S,flow:v});const P=new URL(`/api/${j.slug}/mcp/${S}`,window.location.origin);await w.invalidateQueries({queryKey:ot.isMCPAuthenticated(P.href,null)}),O()},_=async S=>{c(S.app_name??S.id);try{const P=`${S.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,A=(await y.create.mutateAsync({title:P,description:S.description??null,connection_type:S.connection_type,connection_url:S.connection_url??null,connection_token:null,icon:S.icon??null,app_name:S.app_name??null,app_id:S.app_id??null,connection_headers:S.connection_headers??null})).id,z=await tt({connectionId:A,orgId:j.id,orgSlug:j.slug,persistFallback:B=>y.update.mutateAsync({id:A,data:{connection_token:B}}).then(()=>{})});if(z.ran&&!z.ok){R("connection_oauth_failed",{connection_id:A,flow:"clone",error:z.error??"no_token"}),G.error(r("virtualMcp.addConnectionDialog.authenticationFailedError",{error:z.error??"no token received"})),await y.delete.mutateAsync(A);return}z.ran&&await f(A,"clone"),u(A,S.app_name??null,"clone"),m(A)}catch(v){console.error("Failed to add connection:",v),G.error(r("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{c(null)}},T=async S=>{if(!(!j||!b?.user?.id)){c(S.id);try{const v=Ln(S,j.id,b.user.id,{remoteIndex:0}),P=v.connection_type==="STDIO",k=!!v.connection_url,A=P&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!k&&!A){G.error(r("virtualMcp.addConnectionDialog.mcpServerConnectionError")),c(null);return}const{id:z}=await y.create.mutateAsync(v),B=await tt({connectionId:z,orgId:j.id,orgSlug:j.slug,persistFallback:E=>y.update.mutateAsync({id:z,data:{connection_token:E}}).then(()=>{})});if(B.ran&&!B.ok){R("connection_oauth_failed",{connection_id:z,flow:"connect_new",error:B.error??"no_token"}),G.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:B.error??"no token received"})}),u(z,v.app_name??null,"new"),m(z);return}B.ran?(await f(z,"connect_new"),G.success(r("virtualMcp.addConnectionDialog.connectedAuthenticated"))):G.success(r("virtualMcp.addConnectionDialog.connected")),u(z,v.app_name??null,"new"),m(z)}catch(v){console.error("Failed to connect:",v),G.error(r("virtualMcp.addConnectionDialog.failedToConnect"))}finally{c(null)}}};return t.jsxs($t,{open:n,onOpenChange:e,children:[t.jsxs(Ft,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(Lt,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(Bt,{className:"text-base font-semibold",children:r(a==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(zn,{value:h,onChange:C,placeholder:r("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ms,{mode:a,agentId:l,addedConnectionIds:d,onAdd:m,onCloneAndAdd:_,onConnectAndAdd:T,connectingItemId:p,search:h,onCreateConnection:()=>g(!0),onBrowseNavigate:I,defaultTab:s})})]}),t.jsx(zs,{open:x,onOpenChange:g,onCreated:async S=>{g(!1);const v=await tt({connectionId:S,orgId:j.id,orgSlug:j.slug,persistFallback:P=>y.update.mutateAsync({id:S,data:{connection_token:P}}).then(()=>{})});if(v.ran&&!v.ok){R("connection_oauth_failed",{connection_id:S,flow:"custom_create",error:v.error??"no_token"}),G.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:v.error??"no token received"})}),u(S,null,"custom"),m(S),e(!1);return}v.ran&&await f(S,"custom_create"),u(S,null,"custom"),m(S),e(!1)}})]})}const ft=new Map;function Go(){const{org:n}=ae(),e=ts(),s=ns(),i=s.find(g=>g.providerId==="deco"),{data:o,isLoading:r,refetch:a,isFetching:l}=nn({queryKey:ot.aiProviderCredits(n.id,"deco"),enabled:!!i,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),d=o?.balanceCents??null,m=d!=null?d/100:null,u=H.useRef(new Map);if(d!=null){const g=ft.get(n.id);u.current.get(n.id)&&g!=null&&d>g&&R("credits_topped_up_detected",{organization_id:n.id,delta_cents:d-g,previous_balance_cents:g,new_balance_cents:d}),ft.set(n.id,d),u.current.set(n.id,!0)}const p=!!i,c=d!=null&&d>0,h=d!=null&&d===0,C=d!=null&&d===200,x=s.length>0&&s.every(g=>g.providerId==="deco");return{hasDecoKey:p,decoKeyId:i?.id??null,balanceCents:d,balanceDollars:m,hasCredits:c,isZeroBalance:h,isInitialFreeCredit:C,hasOnlyDecoProvider:x,isLoading:r,isFetching:l,refetch:a}}export{Vo as A,Ro as N,Eo as O,Ho as a,ls as b,at as c,fs as d,Fo as e,Rt as f,$o as g,Bo as h,Lo as i,rt as r,Go as u};
|
|
1
|
+
import{W as Kt,X as Ut,c as $,b as V,Y as gt,Z as pt,e as qt,j as t,a as ie,B as ne,r as H,aI as Xt,d as Re,s as Wt,m as X,t as G,w as Qt,k as ke,p as R,F as ae,L as Yt,f as ht,u as xt,D as Jt,I as Zt,G as en,K as ot,o as tn,n as nn}from"./index-BkymslL9.js";import{t as jt}from"./ChevronDown-kHmqPzzM.js";import{A as vt,l as sn,d as on}from"./agent-icon-DQrqcIhD.js";import{T as Ce,a as ye,c as Se}from"./tooltip-BEp2qlKJ.js";import{u as bt,d as Ct,c as yt}from"./sidebar-hgQ-Xr57.js";import{a as it,i as an,f as rn,S as cn,u as ln}from"./use-mcp-client-Ch-glB8L.js";import{a as dn,u as un}from"./use-virtual-mcp-BowpRoGD.js";import{a as Be,b as St,P as wt}from"./popover-CKRmtCon.js";import{i as Ee}from"./Check-Bn6Qlhrx.js";import{s as we}from"./Plus-TT0_uzpn.js";import{i as _t}from"./SearchMd-COqPqxyq.js";import{s as Nt}from"./XClose-KDl77Ytt.js";import{c as mn,d as fn,b as gn,f as pn,e as hn,a as xn,A as jn}from"./alert-dialog-Dexb9Fmf.js";import{F as Q,a as st,b as Y,c as J,d as Z,f as vn,e as ee}from"./form-DrWxxWbf.js";import{I as oe}from"./input-_gEsxqnS.js";import{S as bn}from"./chat-context-CHOZ22YH.js";import{T as Dt}from"./toolbar-CjpgP-6l.js";import{S as Cn}from"./skeleton-BWwTBiZw.js";import{D as kt,a as It,b as At,c as yn,d as Sn,e as wn,f as _n}from"./drawer-BymMCu1T.js";import{u as Pt}from"./use-mobile-_Xd80DiW.js";import{G as Nn}from"./use-registry-app-C77O0Jdq.js";import{G as Dn}from"./github-repo-picker-a-JQjcWL.js";import{b as kn,a as Tt}from"./hooks-Bj_s_TEL.js";import{u as In,g as An,a as Pn,b as Tn}from"./use-navigate-to-agent-DUnpsW4C.js";import{u as Ot}from"./shell-layout-BCBAo2_7.js";import{f as On}from"./reusable-new-chat-CouMjkYR.js";import{C as zn}from"./collection-search-CU-UVxFT.js";import{g as Mn,a as $n,b as Fn,e as Ln}from"./extract-connection-data-B4zI--kn.js";import{u as zt,a as Mt,g as Bn,C as Je}from"./connection-card-DFiDyTG2.js";import{e as $t,d as Ft,a as Lt,b as Bt,h as En,c as Vn}from"./dialog-Of44eUd0.js";import{S as Rn,a as Hn,b as Gn,c as Kn,d as De}from"./select-BB81eCTi.js";import{T as Un}from"./textarea-csHKKQIv.js";import{b as Et}from"./use-connection-4sJq7rPE.js";import{a as Le,b as Ze}from"./Tool02-zAwGBPrM.js";import{s as et}from"./Star01-ChJYud6w.js";import{c as qn,i as $e,a as dt,E as Xn,p as Wn,b as Qn,d as Yn}from"./connection-form-helpers-CfjJquK4.js";import{a as tt}from"./authenticate-and-persist-oauth-p82jb0kd.js";import{g as Jn}from"./connection-slug-eyAPH6o3.js";import{C as Zn}from"./collection-tabs-TDtn5pBg.js";import{u as ut}from"./use-infinite-scroll-o-xRmvTW.js";import{B as Fe}from"./badge-_wR-Cj9j.js";import{u as es}from"./useSuspenseInfiniteQuery-B0WgLVO2.js";import{g as Ve}from"./metadata-dUsYcpuu.js";import{u as ts}from"./studio-tools-BerQESFF.js";import{u as ns}from"./use-ai-providers-D6SnxUgi.js";function mt(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ss=Kt({name:Ut().min(2,"Organization name is required")});function os(n){const e=$.c(66),{open:s,onOpenChange:i}=n,o=V();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:gt(ss),defaultValues:{name:""}},e[0]=r):r=e[0];const a=pt(r);let l;e[1]!==o?(l=async E=>{const M=mt(E.name);if(!M)throw new Error(o("common.createOrganizationDialog.invalidSlug"));const U=await ie.organization.create({name:E.name,slug:M});if(U?.error)throw new Error(U.error.message||o("common.createOrganizationDialog.failedToCreate"));const K=U?.data?.slug??M;if(!K)throw new Error(o("common.createOrganizationDialog.failedToCreate"));return{orgSlug:K}},e[1]=o,e[2]=l):l=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=is,e[3]=d):d=e[3];let m;e[4]!==l?(m={mutationFn:l,onSuccess:d},e[4]=l,e[5]=m):m=e[5];const u=qt(m);let p;e[6]!==u.error||e[7]!==o?(p=u.error instanceof Error?u.error.message:u.error?o("common.createOrganizationDialog.failedToCreateGeneric"):null,e[6]=u.error,e[7]=o,e[8]=p):p=e[8];const c=p;let h;e[9]!==o?(h=o("common.createOrganizationDialog.title"),e[9]=o,e[10]=h):h=e[10];let C;e[11]!==h?(C=t.jsx(mn,{children:h}),e[11]=h,e[12]=C):C=e[12];let x;e[13]!==o?(x=o("common.createOrganizationDialog.description"),e[13]=o,e[14]=x):x=e[14];let g;e[15]!==x?(g=t.jsx(fn,{children:x}),e[15]=x,e[16]=g):g=e[16];let j;e[17]!==C||e[18]!==g?(j=t.jsxs(gn,{children:[C,g]}),e[17]=C,e[18]=g,e[19]=j):j=e[19];let b;if(e[20]!==u||e[21]!==a){let E;e[23]!==u?(E=M=>u.mutateAsync(M),e[23]=u,e[24]=E):E=e[24],b=a.handleSubmit(E),e[20]=u,e[21]=a,e[22]=b}else b=e[22];let y;e[25]!==a.formState.isSubmitting||e[26]!==o?(y=E=>{const{field:M}=E;return t.jsxs(Y,{children:[t.jsx(J,{children:o("common.createOrganizationDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(oe,{...M,placeholder:o("common.createOrganizationDialog.namePlaceholder"),disabled:a.formState.isSubmitting})}),t.jsx(vn,{children:o("common.createOrganizationDialog.nameDescription")}),M.value&&t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[o("common.createOrganizationDialog.urlLabel")," ",t.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",mt(M.value)]})]}),t.jsx(ee,{})]})},e[25]=a.formState.isSubmitting,e[26]=o,e[27]=y):y=e[27];let w;e[28]!==a.control||e[29]!==y?(w=t.jsx(Q,{control:a.control,name:"name",render:y}),e[28]=a.control,e[29]=y,e[30]=w):w=e[30];let N;e[31]!==c?(N=c&&t.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[31]=c,e[32]=N):N=e[32];const I=a.formState.isSubmitting;let O;e[33]!==u||e[34]!==a?(O=()=>{u.reset(),a.reset()},e[33]=u,e[34]=a,e[35]=O):O=e[35];let f;e[36]!==o?(f=o("common.createOrganizationDialog.cancel"),e[36]=o,e[37]=f):f=e[37];let _;e[38]!==a.formState.isSubmitting||e[39]!==O||e[40]!==f?(_=t.jsx(pn,{disabled:I,onClick:O,children:f}),e[38]=a.formState.isSubmitting,e[39]=O,e[40]=f,e[41]=_):_=e[41];const T=!a.formState.isValid||a.formState.isSubmitting;let S;e[42]!==a.formState.isSubmitting||e[43]!==o?(S=a.formState.isSubmitting?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(bn,{size:"xs"})," ",o("common.createOrganizationDialog.creating")]}):o("common.createOrganizationDialog.createButton"),e[42]=a.formState.isSubmitting,e[43]=o,e[44]=S):S=e[44];let v;e[45]!==T||e[46]!==S?(v=t.jsx(ne,{type:"submit",variant:"default",disabled:T,children:S}),e[45]=T,e[46]=S,e[47]=v):v=e[47];let P;e[48]!==_||e[49]!==v?(P=t.jsxs(hn,{children:[_,v]}),e[48]=_,e[49]=v,e[50]=P):P=e[50];let k;e[51]!==b||e[52]!==w||e[53]!==N||e[54]!==P?(k=t.jsxs("form",{className:"space-y-6",onSubmit:b,autoComplete:"off",children:[w,N,P]}),e[51]=b,e[52]=w,e[53]=N,e[54]=P,e[55]=k):k=e[55];let A;e[56]!==a||e[57]!==k?(A=t.jsx(st,{...a,children:k}),e[56]=a,e[57]=k,e[58]=A):A=e[58];let z;e[59]!==j||e[60]!==A?(z=t.jsxs(xn,{children:[j,A]}),e[59]=j,e[60]=A,e[61]=z):z=e[61];let B;return e[62]!==i||e[63]!==s||e[64]!==z?(B=t.jsx(jn,{open:s,onOpenChange:i,children:z}),e[62]=i,e[63]=s,e[64]=z,e[65]=B):B=e[65],B}function is(n){const{orgSlug:e}=n;window.location.href=`/${e}`}function Vt(){const n=H.useContext(Xt),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date),refetch:()=>s?.()}}function as(n){let e=0;for(let i=0;i<n.length;i++)e=n.charCodeAt(i)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function at(n){const e=$.c(13),{org:s,size:i}=n,o=i===void 0?"sm":i,r=o==="xs"?"size-5":"size-6",a=o==="xs"?"text-[9px]":"text-xs";let l;e[0]!==r?(l=X(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=l):l=e[1];let d;e[2]!==s.logo||e[3]!==s.name?(d=s.logo?void 0:as(s.name),e[2]=s.logo,e[3]=s.name,e[4]=d):d=e[4];let m;e[5]!==s.logo||e[6]!==s.name||e[7]!==a?(m=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:X("font-semibold leading-none",a),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=a,e[8]=m):m=e[8];let u;return e[9]!==l||e[10]!==d||e[11]!==m?(u=t.jsx("div",{className:l,style:d,children:m}),e[9]=l,e[10]=d,e[11]=m,e[12]=u):u=e[12],u}function rs({invitation:n,onChanged:e}){const s=V(),[i,o]=H.useState(!1),r=n.organizationName??s("header.orgSwitcher.unknownOrganization"),a=async()=>{o(!0);try{const m=await ie.organization.acceptInvitation({invitationId:n.id});if(m.error){G.error(m.error.message),o(!1);return}}catch{G.error(s("header.orgSwitcher.failedToAcceptInvitation")),o(!1);return}G.success(s("header.orgSwitcher.joined",{name:r})),Qt();let d;try{d=(await ie.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=d?`/${d}`:"/"},l=async()=>{o(!0);try{const d=await ie.organization.rejectInvitation({invitationId:n.id});if(d.error){G.error(d.error.message),o(!1);return}G.success(s("header.orgSwitcher.invitationDeclined")),o(!1),e()}catch{G.error(s("header.orgSwitcher.failedToDeclineInvitation")),o(!1)}};return t.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[t.jsx(at,{org:{name:r},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:r}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsx(ne,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:a,disabled:i,children:s("header.orgSwitcher.accept")}),t.jsx(ne,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:l,disabled:i,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:r}),children:t.jsx(Nt,{size:14})})]})]})}function cs(n){const e=$.c(32),{orgParam:s,onSelectOrg:i,onCreateOrg:o}=n,r=V(),{data:a}=Wt(),{invitations:l,refetch:d}=Vt();let m;e[0]!==s?(m=(k,A)=>k.slug===s?-1:A.slug===s?1:k.name.localeCompare(A.name),e[0]=s,e[1]=m):m=e[1];const u=[...a??[]].sort(m),[p,c]=H.useState(""),h=p.toLowerCase(),C=h?u.filter(k=>k.name.toLowerCase().includes(h)||k.slug.toLowerCase().includes(h)):u;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(_t,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=x):x=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=k=>c(k.target.value),e[3]=g):g=e[3];let j;e[4]!==p?(j=k=>k.key==="Escape"&&p&&c(""),e[4]=p,e[5]=j):j=e[5];let b;e[6]!==r?(b=r("header.orgSwitcher.searchOrganizations"),e[6]=r,e[7]=b):b=e[7];let y;e[8]!==p||e[9]!==j||e[10]!==b?(y=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:p,onChange:g,onKeyDown:j,placeholder:b,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=p,e[9]=j,e[10]=b,e[11]=y):y=e[11];let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(we,{size:16}),e[12]=w):w=e[12];let N;e[13]!==o?(N=t.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:w}),e[13]=o,e[14]=N):N=e[14];let I;e[15]!==y||e[16]!==N?(I=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,y,N]}),e[15]=y,e[16]=N,e[17]=I):I=e[17];const O="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let f;e[18]!==l||e[19]!==p||e[20]!==d?(f=!p&&l.map(k=>t.jsx(rs,{invitation:k,onChanged:d},k.id)),e[18]=l,e[19]=p,e[20]=d,e[21]=f):f=e[21];const _=C.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:p?r("header.orgSwitcher.noOrganizationsMatch",{query:p}):r("header.orgSwitcher.noOrganizationsAvailable")});let T;e[22]!==i||e[23]!==s?(T=k=>t.jsxs("button",{type:"button",onClick:()=>i(k.slug),className:X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",k.slug===s?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[t.jsx(at,{org:k,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:k.name}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.slug})]}),k.slug===s&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id),e[22]=i,e[23]=s,e[24]=T):T=e[24];const S=C.map(T);let v;e[25]!==f||e[26]!==_||e[27]!==S?(v=t.jsxs("div",{className:O,children:[f,_,S]}),e[25]=f,e[26]=_,e[27]=S,e[28]=v):v=e[28];let P;return e[29]!==v||e[30]!==I?(P=t.jsxs(t.Fragment,{children:[I,v]}),e[29]=v,e[30]=I,e[31]=P):P=e[31],P}function ls(n){const e=$.c(22),{trigger:s,orgParam:i,align:o,side:r}=n,a=o===void 0?"start":o,l=r===void 0?"bottom":r,d=Re(),[m,u]=H.useState(!1),[p,c]=H.useState(!1);let h;e[0]!==s?(h=t.jsx(Be,{asChild:!0,children:s}),e[0]=s,e[1]=h):h=e[1];const C=String(m);let x;e[2]!==d?(x=I=>{u(!1),d({to:"/$org",params:{org:I}})},e[2]=d,e[3]=x):x=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{u(!1),c(!0)},e[4]=g):g=e[4];let j;e[5]!==i||e[6]!==C||e[7]!==x?(j=t.jsx(cs,{orgParam:i,onSelectOrg:x,onCreateOrg:g},C),e[5]=i,e[6]=C,e[7]=x,e[8]=j):j=e[8];let b;e[9]!==a||e[10]!==l||e[11]!==j?(b=t.jsx(St,{side:l,align:a,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:us,onCloseAutoFocus:ds,children:j}),e[9]=a,e[10]=l,e[11]=j,e[12]=b):b=e[12];let y;e[13]!==m||e[14]!==h||e[15]!==b?(y=t.jsxs(wt,{open:m,onOpenChange:u,children:[h,b]}),e[13]=m,e[14]=h,e[15]=b,e[16]=y):y=e[16];let w;e[17]!==p?(w=t.jsx(os,{open:p,onOpenChange:c}),e[17]=p,e[18]=w):w=e[18];let N;return e[19]!==w||e[20]!==y?(N=t.jsxs(t.Fragment,{children:[y,w]}),e[19]=w,e[20]=y,e[21]=N):N=e[21],N}function ds(n){return n.preventDefault()}function us(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function ms(n){const e=$.c(21),{value:s,onChange:i,placeholder:o,onKeyDown:r,className:a,isSearching:l,disabled:d}=n,m=o===void 0?"Search...":o;let u;e[0]!==a?(u=X("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=u):u=e[1];const p=d?"cursor-not-allowed opacity-50":"cursor-text";let c;e[2]!==p?(c=X("flex items-center gap-2.5 h-12 px-4",p),e[2]=p,e[3]=c):c=e[3];let h;e[4]!==l?(h=l?t.jsx(ke,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(_t,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=l,e[5]=h):h=e[5];let C;e[6]!==i?(C=b=>i(b.target.value),e[6]=i,e[7]=C):C=e[7];let x;e[8]!==d||e[9]!==r||e[10]!==m||e[11]!==C||e[12]!==s?(x=t.jsx("input",{type:"text",value:s,onChange:C,onKeyDown:r,placeholder:m,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=r,e[10]=m,e[11]=C,e[12]=s,e[13]=x):x=e[13];let g;e[14]!==c||e[15]!==h||e[16]!==x?(g=t.jsxs("label",{className:c,children:[h,x]}),e[14]=c,e[15]=h,e[16]=x,e[17]=g):g=e[17];let j;return e[18]!==u||e[19]!==g?(j=t.jsx("div",{className:u,children:g}),e[18]=u,e[19]=g,e[20]=j):j=e[20],j}function rt(n){const e=n?.metadata?.githubRepo;if(!e?.url)return{status:"none"};const s=e.connectionId;return!!s&&!!n?.connections?.some(r=>r.connection_id===s)?{status:"attached",repo:e,connectionId:s}:!!s||e.installationId!=null?{status:"detached",repo:e}:{status:"public-clone",repo:e}}function $o(n){const e=rt(n);return e.status==="attached"||e.status==="public-clone"?e.repo:null}function Rt(n){if(typeof n!="object"||n===null)return!1;const s=n.githubRepo?.url;return typeof s=="string"&&s.length>0}function Fo(n){return rt(n).status==="attached"}function Lo(n){const e=rt(n).status;return e==="attached"||e==="detached"}function fs(n){const e=new Set;for(const s of n??[]){const i=s.metadata?.liveAgentId;typeof i=="string"&&i&&e.add(s.id)}return e}function Bo(n,e){if(!n)return null;const s=n.metadata?.liveAgentId;if(typeof s=="string"&&s)return{mode:"dev",targetId:s};const i=(e??[]).find(o=>o.metadata?.liveAgentId===n.id);return i?{mode:"live",targetId:i.id}:null}function gs(n){const e=$.c(6),{value:s,onChange:i}=n,o=V();let r;e[0]!==o?(r=o("sidebar.agentsSection.searchAgents"),e[0]=o,e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==r||e[4]!==s?(a=t.jsx(ms,{value:s,onChange:i,placeholder:r}),e[2]=i,e[3]=r,e[4]=s,e[5]=a):a=e[5],a}function ps(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=i):i=n[3],i}function hs(n){const e=$.c(10),{org:s,onClose:i}=n,o=V();let r;e[0]!==s.slug?(r={org:s.slug},e[0]=s.slug,e[1]=r):r=e[1];let a;e[2]!==i?(a=()=>i(),e[2]=i,e[3]=a):a=e[3];let l;e[4]!==o?(l=o("sidebar.agentsSection.seeAllAgents"),e[4]=o,e[5]=l):l=e[5];let d;return e[6]!==r||e[7]!==a||e[8]!==l?(d=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(Yt,{to:"/$org/settings/agents",params:r,onClick:a,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:l})}),e[6]=r,e[7]=a,e[8]=l,e[9]=d):d=e[9],d}function xs(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(Ht,{children:s}),n[2]=s,n[3]=i):i=n[3],i}function js(n){const e=$.c(11),{onImportFromGithub:s}=n,i=V();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Nn,{className:"size-3.5"}),e[0]=o):o=e[0];let r;e[1]!==i?(r=i("sidebar.agentsSection.import"),e[1]=i,e[2]=r):r=e[2];let a;e[3]!==s||e[4]!==r?(a=t.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[o,r]}),e[3]=s,e[4]=r,e[5]=a):a=e[5];let l;e[6]!==i?(l=i("sidebar.agentsSection.codeAgents"),e[6]=i,e[7]=l):l=e[7];let d;return e[8]!==a||e[9]!==l?(d=t.jsx(Ht,{action:a,children:l}),e[8]=a,e[9]=l,e[10]=d):d=e[10],d}function vs(n){const e=$.c(11),{setOpen:s,emptyCtaClass:i}=n,o=V();let r;e[0]!==o?(r=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=r):r=e[1];let a;e[2]!==i?(a=X(i),e[2]=i,e[3]=a):a=e[3];let l;e[4]!==s?(l=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=l):l=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(we,{className:"size-4"}),e[6]=d):d=e[6];let m;return e[7]!==r||e[8]!==a||e[9]!==l?(m=t.jsx(Dt,{"aria-label":r,className:a,onClick:l,children:d}),e[7]=r,e[8]=a,e[9]=l,e[10]=m):m=e[10],m}function bs(n){const e=$.c(17),{setOpen:s,highlightEmpty:i,emptyCtaClass:o}=n,r=V();let a;e[0]!==i||e[1]!==r?(a=i?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=r,e[2]=a):a=e[2];let l;e[3]!==o?(l=X(o),e[3]=o,e[4]=l):l=e[4];let d;e[5]!==s?(d=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=d):d=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(we,{}),e[7]=m):m=e[7];let u;e[8]!==r?(u=r("sidebar.agentsSection.newAgent"),e[8]=r,e[9]=u):u=e[9];let p;e[10]!==u?(p=t.jsx("span",{children:u}),e[10]=u,e[11]=p):p=e[11];let c;return e[12]!==a||e[13]!==l||e[14]!==d||e[15]!==p?(c=t.jsx(Ct,{children:t.jsxs(yt,{tooltip:a,className:l,onClick:d,children:[m,p]})}),e[12]=a,e[13]=l,e[14]=d,e[15]=p,e[16]=c):c=e[16],c}function Cs(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(At,{className:"sr-only",children:s}),n[2]=s,n[3]=i):i=n[3],i}function ys(n){const e=$.c(8),{emptyCtaClass:s}=n,i=V();let o;e[0]!==i?(o=i("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=o):o=e[1];let r;e[2]!==s?(r=X(s),e[2]=s,e[3]=r):r=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{className:"size-4"}),e[4]=a):a=e[4];let l;return e[5]!==o||e[6]!==r?(l=t.jsx(Dt,{"aria-label":o,className:r,children:a}),e[5]=o,e[6]=r,e[7]=l):l=e[7],l}function Ss(n){const e=$.c(19),{wrapEmptyHint:s,highlightEmpty:i,emptyCtaClass:o}=n,r=V();let a;e[0]!==i||e[1]!==r?(a=i?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=r,e[2]=a):a=e[2];let l;e[3]!==o?(l=X(o),e[3]=o,e[4]=l):l=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(we,{}),e[5]=d):d=e[5];let m;e[6]!==r?(m=r("sidebar.agentsSection.newAgent"),e[6]=r,e[7]=m):m=e[7];let u;e[8]!==m?(u=t.jsx("span",{children:m}),e[8]=m,e[9]=u):u=e[9];let p;e[10]!==a||e[11]!==l||e[12]!==u?(p=t.jsx(Be,{asChild:!0,children:t.jsxs(yt,{tooltip:a,className:l,children:[d,u]})}),e[10]=a,e[11]=l,e[12]=u,e[13]=p):p=e[13];let c;e[14]!==p||e[15]!==s?(c=s(p),e[14]=p,e[15]=s,e[16]=c):c=e[16];let h;return e[17]!==c?(h=t.jsx(Ct,{children:c}),e[17]=c,e[18]=h):h=e[18],h}function ws(n){const e=$.c(9),{children:s}=n,i=V();let o;e[0]!==s?(o=t.jsx(Ce,{asChild:!0,children:s}),e[0]=s,e[1]=o):o=e[1];let r;e[2]!==i?(r=i("sidebar.agentsSection.selectAnExistingAgent"),e[2]=i,e[3]=r):r=e[3];let a;e[4]!==r?(a=t.jsx(ye,{side:"right",sideOffset:8,children:r}),e[4]=r,e[5]=a):a=e[5];let l;return e[6]!==o||e[7]!==a?(l=t.jsxs(Se,{defaultOpen:!0,delayDuration:0,children:[o,a]}),e[6]=o,e[7]=a,e[8]=l):l=e[8],l}function _s(n){const e=$.c(4),s=Re(),{create:i}=kn();let o;return e[0]!==i||e[1]!==s||e[2]!==n?(o=async r=>{const a=crypto.randomUUID();try{await i({id:a,virtual_mcp_id:r})}catch{}s({to:"/$org/$taskId",params:{org:n,taskId:a},search:{virtualmcpid:r}})},e[0]=i,e[1]=s,e[2]=n,e[3]=o):o=e[3],o}function nt(n){const e=$.c(20),{agent:s,selected:i,onClick:o}=n,r=i?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let a;e[0]!==r?(a=X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=a):a=e[1];let l;e[2]!==s.icon||e[3]!==s.title?(l=t.jsx(vt,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=l):l=e[4];let d;e[5]!==s.title?(d=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=d):d=e[6];let m;e[7]!==s.description?(m=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=m):m=e[8];let u;e[9]!==d||e[10]!==m?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,m]}),e[9]=d,e[10]=m,e[11]=u):u=e[11];let p;e[12]!==i?(p=i&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=i,e[13]=p):p=e[13];let c;return e[14]!==o||e[15]!==a||e[16]!==l||e[17]!==u||e[18]!==p?(c=t.jsxs("button",{type:"button",onClick:o,className:a,children:[l,u,p]}),e[14]=o,e[15]=a,e[16]=l,e[17]=u,e[18]=p,e[19]=c):c=e[19],c}function Ht(n){const e=$.c(5),{children:s,action:i}=n;let o;e[0]!==s?(o=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=o):o=e[1];let r;return e[2]!==i||e[3]!==o?(r=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[o,i]}),e[2]=i,e[3]=o,e[4]=r):r=e[4],r}function Ns(n){const e=$.c(23),{onClose:s,onSelectAgent:i,selectedAgentId:o,onImportFromGithub:r}=n,[a,l]=H.useState(""),d=dn(),m=d??[],{org:u}=ae(),{data:p}=ie.useSession(),c=p?.user?.id??"anon",h=An(d),C=Pn(),x=_s(u.slug),g=fs(d),j=a.toLowerCase(),b=m.filter(As).filter(L=>!g.has(L.id)).filter(Is).filter(L=>!a||L.title.toLowerCase().includes(j)),y=b.filter(ks),w=b.filter(Ds),N=it(u.id),I=!a||N.title.toLowerCase().includes(j),O=!!(i&&I);let f;e[0]!==s||e[1]!==i?(f=()=>{i?.(null),s(),l("")},e[0]=s,e[1]=i,e[2]=f):f=e[2];const _=f,T=L=>{if(i){i(L.id),s(),l("");return}Tn({orgId:u.id,userId:c},L.id,h),C(),s(),l(""),x(L.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let v;e[3]!==a?(v=t.jsx(gs,{value:a,onChange:l}),e[3]=a,e[4]=v):v=e[4];const P="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",k=i&&I&&N&&t.jsx(nt,{agent:N,selected:!o||o===N.id,onClick:_}),A=(y.length>0||!a)&&t.jsx(js,{onImportFromGithub:r}),z=y.map(L=>t.jsx(nt,{agent:L,selected:i?o===L.id:void 0,onClick:()=>T(L)},L.id)),B=w.length>0&&t.jsx(xs,{}),E=w.map(L=>t.jsx(nt,{agent:L,selected:i?o===L.id:void 0,onClick:()=>T(L)},L.id));let M;e[5]!==O||e[6]!==a||e[7]!==b.length?(M=b.length===0&&!O&&a&&t.jsx(ps,{}),e[5]=O,e[6]=a,e[7]=b.length,e[8]=M):M=e[8];let U;e[9]!==M||e[10]!==k||e[11]!==A||e[12]!==z||e[13]!==B||e[14]!==E?(U=t.jsxs("div",{className:P,children:[k,A,z,B,E,M]}),e[9]=M,e[10]=k,e[11]=A,e[12]=z,e[13]=B,e[14]=E,e[15]=U):U=e[15];let K;e[16]!==s||e[17]!==u?(K=t.jsx(hs,{org:u,onClose:s}),e[16]=s,e[17]=u,e[18]=K):K=e[18];let de;return e[19]!==U||e[20]!==K||e[21]!==v?(de=t.jsxs("div",{className:S,children:[v,U,K]}),e[19]=U,e[20]=K,e[21]=v,e[22]=de):de=e[22],de}function Ds(n){return!Rt(n.metadata)}function ks(n){return Rt(n.metadata)}function Is(n){return!rn(n.id)}function As(n){return!an(n.id)}function Ps(n){const e=$.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:i,trigger:o,onSelectAgent:r,selectedAgentId:a,side:l,align:d}=s,m=i===void 0?!1:i,u=l===void 0?"right":l,p=d===void 0?"start":d,[c,h]=H.useState(!1),[C,x]=H.useState(!1),g=Pt(),{setOpenMobile:j}=bt(),b=In(),y=b?"border border-border":void 0;let w;e[2]!==b?(w=A=>b?t.jsx(ws,{children:A}):A,e[2]=b,e[3]=w):w=e[3];const N=w;let I;e[4]!==g||e[5]!==j?(I=()=>{h(!1),g&&j(!1)},e[4]=g,e[5]=j,e[6]=I):I=e[6];const O=I;let f;e[7]!==O?(f=()=>{O(),x(!0)},e[7]=O,e[8]=f):f=e[8];const _=f;let T;e[9]!==O||e[10]!==_||e[11]!==r||e[12]!==c||e[13]!==a?(T=c&&t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(Cn,{className:"h-4 w-24"})}),children:t.jsx(Ns,{onClose:O,onSelectAgent:r,selectedAgentId:a,onImportFromGithub:_})}),e[9]=O,e[10]=_,e[11]=r,e[12]=c,e[13]=a,e[14]=T):T=e[14];const S=T;let v;e[15]!==p||e[16]!==m||e[17]!==y||e[18]!==b||e[19]!==g||e[20]!==c||e[21]!==S||e[22]!==u||e[23]!==o||e[24]!==N?(v=g?t.jsxs(t.Fragment,{children:[o?t.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:o}):m?N(t.jsx(vs,{setOpen:h,emptyCtaClass:y})):t.jsx(bs,{setOpen:h,highlightEmpty:b,emptyCtaClass:y}),t.jsx(kt,{open:c,onOpenChange:h,direction:"bottom",children:t.jsxs(It,{className:"max-h-[85dvh] p-0",children:[t.jsx(Cs,{}),S]})})]}):t.jsxs(wt,{open:c,onOpenChange:A=>{A&&!c&&R("agent_browser_opened",{surface:"desktop_popover"}),h(A)},children:[o?t.jsx(Be,{asChild:!0,children:o}):m?N(t.jsx(Be,{asChild:!0,children:t.jsx(ys,{emptyCtaClass:y})})):t.jsx(Ss,{wrapEmptyHint:N,highlightEmpty:b,emptyCtaClass:y}),t.jsx(St,{className:"w-[380px] p-0 overflow-hidden",side:u,align:p,children:S})]}),e[15]=p,e[16]=m,e[17]=y,e[18]=b,e[19]=g,e[20]=c,e[21]=S,e[22]=u,e[23]=o,e[24]=N,e[25]=v):v=e[25];let P;e[26]!==C?(P=t.jsx(Dn,{open:C,onOpenChange:x,mode:"agent"}),e[26]=C,e[27]=P):P=e[27];let k;return e[28]!==P||e[29]!==v?(k=t.jsxs(t.Fragment,{children:[v,P]}),e[28]=P,e[29]=v,e[30]=k):k=e[30],k}const Ts="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Os(n){const e=$.c(19),{agentId:s,fallback:i,onOpenHome:o,onPick:r}=n,a=un(s)??i??null,l=a?.title??"Super Agent",d=`Open ${l} home`,m=a?.icon??null;let u;e[0]!==m||e[1]!==l?(u=t.jsx(vt,{icon:m,name:l,size:"xs"}),e[0]=m,e[1]=l,e[2]=u):u=e[2];let p;e[3]!==o||e[4]!==d||e[5]!==u?(p=t.jsx("button",{type:"button",onClick:o,"aria-label":d,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:u}),e[3]=o,e[4]=d,e[5]=u,e[6]=p):p=e[6];let c;e[7]!==l?(c=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:l}),e[7]=l,e[8]=c):c=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(jt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=h):h=e[9];let C;e[10]!==c?(C=t.jsxs("button",{type:"button",className:Ts,children:[c,h]}),e[10]=c,e[11]=C):C=e[11];let x;e[12]!==s||e[13]!==r||e[14]!==C?(x=t.jsx(Ps,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:r,trigger:C}),e[12]=s,e[13]=r,e[14]=C,e[15]=x):x=e[15];let g;return e[16]!==p||e[17]!==x?(g=t.jsxs("div",{className:"flex min-w-0 items-center gap-0",children:[p,x]}),e[16]=p,e[17]=x,e[18]=g):g=e[18],g}function Eo(n){const e=$.c(26);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:i}=s,{org:o}=ae(),{state:r,isMobile:a}=bt(),l=Vt().invitations.length>0,d=r==="collapsed"||a,m=l?`${o.name} — switch organization (pending invitation)`:`${o.name} — switch organization`;let u;e[2]!==o?(u=t.jsx(at,{org:o,size:"sm"}),e[2]=o,e[3]=u):u=e[3];let p;e[4]!==l||e[5]!==d?(p=l&&t.jsx("span",{className:X("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",d?"-top-1":"top-1/2 -translate-y-1/2")}),e[4]=l,e[5]=d,e[6]=p):p=e[6];let c;e[7]!==u||e[8]!==p?(c=t.jsxs("span",{className:"relative inline-flex",children:[u,p]}),e[7]=u,e[8]=p,e[9]=c):c=e[9];let h;e[10]!==o.name||e[11]!==i?(h=i&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:o.name}),e[10]=o.name,e[11]=i,e[12]=h):h=e[12];let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(jt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[13]=C):C=e[13];let x;e[14]!==m||e[15]!==c||e[16]!==h?(x=t.jsx(Ce,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":m,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[c,h,C]})}),e[14]=m,e[15]=c,e[16]=h,e[17]=x):x=e[17];let g;e[18]!==o.slug||e[19]!==x?(g=t.jsx(ls,{orgParam:o.slug,trigger:x}),e[18]=o.slug,e[19]=x,e[20]=g):g=e[20];let j;e[21]!==o.name?(j=t.jsx(ye,{side:"bottom",children:o.name}),e[21]=o.name,e[22]=j):j=e[22];let b;return e[23]!==j||e[24]!==g?(b=t.jsxs(Se,{children:[g,j]}),e[23]=j,e[24]=g,e[25]=b):b=e[25],b}function Vo(n){const e=$.c(24);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:i}=s,{org:o}=ae(),r=Re();let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[2]=a):a=e[2];const l=ht(a);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},e[3]=d):d=e[3];const m=xt(d),{threads:u}=Tt(),{data:p}=ie.useSession(),{setTaskId:c,createNewTask:h}=Ot();let C;e[4]!==o.id?(C=it(o.id),e[4]=o.id,e[5]=C):C=e[5];const x=C,g=x.id,j=l.taskId?m.virtualmcpid??g:g;let b;e[6]!==h||e[7]!==g||e[8]!==r||e[9]!==i||e[10]!==o.slug||e[11]!==p?.user?.id||e[12]!==c||e[13]!==u?(b=f=>{if(!f||f===g){r({to:"/$org",params:{org:o.slug}}),i?.();return}const _=On(u,f,p?.user?.id);_?c(_.id,f):h(f),i?.()},e[6]=h,e[7]=g,e[8]=r,e[9]=i,e[10]=o.slug,e[11]=p?.user?.id,e[12]=c,e[13]=u,e[14]=b):b=e[14];const y=b;let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[15]=w):w=e[15];const N=j===g?x:void 0;let I;e[16]!==j||e[17]!==y?(I=()=>y(j),e[16]=j,e[17]=y,e[18]=I):I=e[18];let O;return e[19]!==j||e[20]!==y||e[21]!==N||e[22]!==I?(O=t.jsx(H.Suspense,{fallback:w,children:t.jsx(Os,{agentId:j,fallback:N,onOpenHome:I,onPick:y})}),e[19]=j,e[20]=y,e[21]=N,e[22]=I,e[23]=O):O=e[23],O}function Ro(){const n=$.c(24),e=V(),{org:s}=ae();let i;n[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},n[0]=i):i=n[0];const o=ht(i);let r;n[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},n[1]=r):r=n[1];const a=xt(r),{threads:l}=Tt(),{createNewTask:d}=Ot();let m;n[2]!==s.id?(m=it(s.id),n[2]=s.id,n[3]=m):m=n[3];const u=m.id,p=o.taskId?a.virtualmcpid??u:u;let c;n[4]!==o.taskId||n[5]!==l?(c=(o.taskId?l.find(I=>I.id===o.taskId)?.branch:null)??null,n[4]=o.taskId,n[5]=l,n[6]=c):c=n[6];const h=c;let C;n[7]!==p||n[8]!==d||n[9]!==h?(C=()=>{d(p,h)},n[7]=p,n[8]=d,n[9]=h,n[10]=C):C=n[10];const x=C;let g;n[11]!==e?(g=e("sidebar.taskGroupsList.newChat"),n[11]=e,n[12]=g):g=n[12];let j;n[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(sn,{size:16}),n[13]=j):j=n[13];let b;n[14]!==x||n[15]!==g?(b=t.jsx(Ce,{asChild:!0,children:t.jsx("button",{type:"button",onClick:x,"aria-label":g,className:"wco-no-drag flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:j})}),n[14]=x,n[15]=g,n[16]=b):b=n[16];let y;n[17]!==e?(y=e("sidebar.taskGroupsList.newChat"),n[17]=e,n[18]=y):y=n[18];let w;n[19]!==y?(w=t.jsx(ye,{side:"bottom",children:y}),n[19]=y,n[20]=w):w=n[20];let N;return n[21]!==b||n[22]!==w?(N=t.jsxs(Se,{children:[b,w]}),n[21]=b,n[22]=w,n[23]=N):N=n[23],N}function zs({open:n,onOpenChange:e,onCreated:s}){const i=V(),{org:o}=ae(),{data:r}=ie.useSession(),{stdioEnabled:a}=Jt(),l=Pt(),d=Et(),m=zt(),p=Mt(m,"").items,c=pt({resolver:gt(qn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),h=c.watch("ui_type"),C=c.watch("connection_url"),x=c.watch("npx_package"),g=$e({uiType:h,connectionUrl:C??"",npxPackage:x??""})??dt({uiType:h,connectionUrl:C??"",registryItems:p}),j=f=>{const _=f.trim();if(!_)return;const T=!!c.formState.dirtyFields.title,S=!!c.formState.dirtyFields.description,v=!!c.formState.dirtyFields.env_vars,P=A=>{if(A&&(!T&&!c.getValues("title").trim()&&A.title&&c.setValue("title",A.title,{shouldDirty:!1}),!S&&!(c.getValues("description")??"").trim()&&A.description&&c.setValue("description",A.description,{shouldDirty:!1}),!v&&A.envVarKeys?.length)){const z=c.getValues("env_vars")??[],B=new Set(z.map(M=>M.key)),E=A.envVarKeys.filter(M=>!B.has(M));E.length>0&&c.setValue("env_vars",[...z,...E.map(M=>({key:M,value:""}))],{shouldDirty:!0})}},k=Wn(_);if(k&&a){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",k.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),P($e({uiType:"NPX",npxPackage:k.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const A=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";c.setValue("ui_type",A,{shouldDirty:!0}),c.setValue("connection_url",_,{shouldDirty:!0}),P($e({uiType:A,connectionUrl:_})??dt({uiType:A,connectionUrl:_,registryItems:p}));return}h==="NPX"&&P($e({uiType:"NPX",npxPackage:_}))},b=f=>{f||c.reset(),e(f)},y=async f=>{let _,T=null,S=null,v=null;f.ui_type==="NPX"?(_="STDIO",T="",v=Qn(f.npx_package||"",f.env_vars||[])):f.ui_type==="STDIO"?(_="STDIO",T="",v=Yn(f.stdio_command||"",f.stdio_args||"",f.stdio_cwd,f.env_vars||[])):(_=f.ui_type,T=f.connection_url||"",S=f.connection_token||null);const P=Mn("conn");try{await d.create.mutateAsync({id:P,title:f.title,description:f.description||null,connection_type:_,connection_url:T,connection_token:S,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:r?.user?.id||"system",organization_id:o.id,icon:f.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"}),c.reset(),e(!1),s?.(P)}catch{G.error(i("connections.createConnectionDialog.failedToCreateConnection"))}},w=i("connections.createConnectionDialog.title"),N=i("connections.createConnectionDialog.description"),I=c.formState.isSubmitting?i("connections.createConnectionDialog.saving"):i("connections.createConnectionDialog.createButton"),O=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:c.control,name:"ui_type",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.typeLabel")}),t.jsxs(Rn,{value:f.value,onValueChange:f.onChange,children:[t.jsx(Z,{children:t.jsx(Hn,{children:t.jsx(Gn,{})})}),t.jsxs(Kn,{children:[t.jsx(De,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.httpType")]})}),t.jsx(De,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.sseType")]})}),t.jsx(De,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.websocketType")]})}),a&&t.jsxs(t.Fragment,{children:[t.jsx(De,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Le,{className:"w-4 h-4"}),i("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(De,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(on,{className:"w-4 h-4"}),i("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(ee,{})]})}),h==="NPX"&&t.jsx(Q,{control:c.control,name:"npx_package",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.npmPackagePlaceholder"),...f,value:f.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),c.setValue("npx_package",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),f.onBlur()}})}),t.jsx(ee,{})]})}),h==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:c.control,name:"stdio_command",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.commandLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.commandPlaceholder"),...f,value:f.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:c.control,name:"stdio_args",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.argumentsLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.argumentsPlaceholder"),...f,value:f.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:c.control,name:"stdio_cwd",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.workingDirectoryPlaceholder"),...f,value:f.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(ee,{})]})})]}),(h==="NPX"||h==="STDIO")&&t.jsx(Q,{control:c.control,name:"env_vars",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(Z,{children:t.jsx(Xn,{value:f.value??[],onChange:f.onChange})}),t.jsx(ee,{})]})}),h!=="NPX"&&h!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:c.control,name:"connection_url",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.urlLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.urlPlaceholder"),...f,value:f.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),c.setValue("connection_url",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),f.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:c.control,name:"connection_token",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:g?.token?.label??i("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(Z,{children:t.jsx(oe,{type:"password",placeholder:g?.token?.placeholder??i("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...f,value:f.value??""})}),g?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[g.token.helperText,g.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:i("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:c.control,name:"title",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.namePlaceholder"),...f})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:c.control,name:"description",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.descriptionLabel")}),t.jsx(Z,{children:t.jsx(Un,{placeholder:i("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...f,value:f.value??""})}),t.jsx(ee,{})]})})]});return l?t.jsx(kt,{open:n,onOpenChange:b,children:t.jsxs(It,{className:"max-h-[90vh]",children:[t.jsx(yn,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(At,{children:w}),t.jsx(Sn,{className:"mt-1",children:N})]}),t.jsx(wn,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Nt,{size:16})})})]})}),t.jsx(st,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(y),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:O}),t.jsx(_n,{children:t.jsx(ne,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:I})})]})})]})}):t.jsx($t,{open:n,onOpenChange:b,children:t.jsxs(Ft,{className:"sm:max-w-[525px]",children:[t.jsxs(Lt,{children:[t.jsx(Bt,{children:w}),t.jsx(En,{children:N})]}),t.jsx(st,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(y),children:[t.jsx("div",{className:"py-4",children:O}),t.jsxs(Vn,{children:[t.jsx(ne,{type:"button",variant:"outline",onClick:()=>b(!1),children:i("connections.createConnectionDialog.cancelButton")}),t.jsx(ne,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:I})]})]})})]})})}function Ms(n){const e=$.c(72),{mode:s,agentId:i,addedConnectionIds:o,onAdd:r,onCloneAndAdd:a,onConnectAndAdd:l,connectingItemId:d,search:m,onCreateConnection:u,onBrowseNavigate:p,defaultTab:c}=n,h=s===void 0?"add":s,C=c===void 0?"connected":c,x=V(),{org:g}=ae(),j=H.useDeferredValue(m),b=m!==j;let y;e[0]!==j?(y=j.trim().toLowerCase(),e[0]=j,e[1]=y):y=e[1];const w=y;let N;e[2]!==C?(N=D=>D??C,e[2]=C,e[3]=N):N=e[3];const[I,O]=Zt(en.connectionsTab(g.slug)+(C==="all"?":home-modal":":agent-modal"),N);let f;e[4]!==I||e[5]!==O?(f=D=>{D!==I&&R("connections_dialog_tab_changed",{to_tab:D}),O(D)},e[4]=I,e[5]=O,e[6]=f):f=e[6];const _=f;let T;e[7]!==g.id||e[8]!==g.slug?(T={connectionId:cn,orgId:g.id,orgSlug:g.slug},e[7]=g.id,e[8]=g.slug,e[9]=T):T=e[9];const S=ln(T),v=j?.trim().split(/\s+/).filter(Boolean)??[],P=v.length>0?{operator:"or",conditions:v.flatMap(Hs)}:void 0,k={...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},A=JSON.stringify(k),{data:z,fetchNextPage:B,hasNextPage:E,isFetchingNextPage:M}=es({queryKey:ot.collectionListInfinite(S,g.id,"","CONNECTIONS",A),queryFn:async D=>{const{pageParam:F}=D,se=F===void 0?0:F;return(await S.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:se}})).structuredContent},initialPageParam:0,getNextPageParam:Vs,staleTime:3e4}),U=z?.pages.flatMap(Es)??[],K=Bn(U),de=new Set(U.filter(Bs).map(Ls)),L=zt(),re=Mt(L,j),He=ut(re.loadMore,re.hasMore,re.isLoadingMore),Ge=ut(B,E??!1,M),W=I==="all"||!!w,ct=W?re.items.filter(D=>{const F=$n(D);if(F&&de.has(F))return!1;if(!w)return!0;const se=Ve(D._meta),ce=[D.title,D.description,D.name,D.server?.title,D.server?.description,D.server?.name,se?.friendly_name,se?.friendlyName].filter(Boolean).join(" ").toLowerCase();return v.some(te=>ce.includes(te.toLowerCase()))}):[],_e=ct.filter(Fs),Ne=ct.filter($s);let Ie;e[10]!==o?(Ie=D=>D.some(F=>o.has(F.id)),e[10]=o,e[11]=Ie):Ie=e[11];const Ke=Ie;let Ae;e[12]!==o||e[13]!==i||e[14]!==d||e[15]!==Ke||e[16]!==h||e[17]!==r||e[18]!==p||e[19]!==a||e[20]!==x?(Ae=(D,F,se,ce,te)=>{const Me=Ke(te),be=te.find(le=>!o.has(le.id)),q=te[0];if(h==="browse"){const le=Jn(q);return t.jsx(Je,{connection:{title:F,icon:se,description:te.length>1?`${te.length} instances`:ce??void 0},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",x("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{R("connection_browse_clicked",{app_name:q.app_name??null,connection_id:q.id,instances_count:te.length}),p?.(le)}},D)}return t.jsx(Je,{connection:{title:F,icon:se,description:ce},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Me&&t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",x("virtualMcp.connectionDialogContent.added")]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:le=>{le.stopPropagation(),be?(R("connection_add_clicked",{action:"use_existing",app_name:q.app_name??null,connection_id:be.id}),i&&R("agent_connection_attached",{agent_id:i,connection_id:be.id,app_name:q.app_name??null,mode:"existing"}),r(be.id)):(R("connection_add_clicked",{action:"clone",app_name:q.app_name??null,base_connection_id:q.id}),a(q))},children:x("virtualMcp.connectionDialogContent.add")})]})},D)},e[12]=o,e[13]=i,e[14]=d,e[15]=Ke,e[16]=h,e[17]=r,e[18]=p,e[19]=a,e[20]=x,e[21]=Ae):Ae=e[21];const Pe=Ae;let Te;e[22]!==d||e[23]!==h||e[24]!==l||e[25]!==x?(Te=D=>{const F=Ve(D._meta),se=F?.friendlyName||F?.friendly_name||D.server?.title||D.title||D.server?.name||D.name||D.id||"",ce=D.server?.description||D.description||null,te=D.server?.icons?.[0]?.src||Fn(D.server?.repository)||null,Me=F?.official===!0,be=F?.verified===!0,q=F?.owner==="deco";return t.jsx(Je,{connection:{title:se,description:ce,icon:te},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[q&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:t.jsx("img",{src:"/logos/deco logo.svg",alt:x("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.builtByDeco")})]}),!q&&Me&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Ze,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!q&&!Me&&be&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Ze,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:le=>{le.stopPropagation(),R("connection_add_clicked",{action:"connect_new",registry_item_id:D.id,app_name:F?.friendlyName||D.server?.name||D.name||null}),l(D)},children:d===D.id?t.jsx(ke,{size:14,className:"animate-spin"}):x(h==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${D.id}`)},e[22]=d,e[23]=h,e[24]=l,e[25]=x,e[26]=Te):Te=e[26];const lt=Te;let ue;e[27]!==I||e[28]!==_||e[29]!==u||e[30]!==w||e[31]!==x?(ue=!w&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(Zn,{tabs:[{id:"all",label:x("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:x("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:I,onTabChange:D=>_(D)}),t.jsxs(ne,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{R("connections_dialog_custom_clicked"),u()},children:[t.jsx(we,{size:12}),x("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=I,e[28]=_,e[29]=u,e[30]=w,e[31]=x,e[32]=ue):ue=e[32];const Ue=b&&"opacity-50 pointer-events-none";let me;e[33]!==Ue?(me=X("flex-1 overflow-auto p-5 transition-opacity duration-150",Ue),e[33]=Ue,e[34]=me):me=e[34];const Gt="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Oe;e[35]!==Pe?(Oe=D=>{if(D.type==="group")return Pe(D.key,D.title,D.icon,null,D.connections);const F=D.connection;return Pe(F.id,F.title,F.icon,F.description??null,[F])},e[35]=Pe,e[36]=Oe):Oe=e[36];const qe=K.map(Oe);let fe;e[37]!==Ge?(fe=t.jsx("div",{ref:Ge,className:"col-span-full h-1"}),e[37]=Ge,e[38]=fe):fe=e[38];let ge;e[39]!==M?(ge=M&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),e[39]=M,e[40]=ge):ge=e[40];const Xe=W&&_e.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(Ze,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),We=W&&_e.map(lt),Qe=W&&Ne.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Ye=W&&Ne.map(lt);let pe;e[41]!==He||e[42]!==L||e[43]!==W?(pe=W&&L.length>0&&t.jsx("div",{ref:He,className:"col-span-full h-1"}),e[41]=He,e[42]=L,e[43]=W,e[44]=pe):pe=e[44];let he;e[45]!==re.isLoadingMore||e[46]!==W?(he=W&&re.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),e[45]=re.isLoadingMore,e[46]=W,e[47]=he):he=e[47];let xe;e[48]!==qe||e[49]!==fe||e[50]!==ge||e[51]!==Xe||e[52]!==We||e[53]!==Qe||e[54]!==Ye||e[55]!==pe||e[56]!==he?(xe=t.jsxs("div",{className:Gt,children:[qe,fe,ge,Xe,We,Qe,Ye,pe,he]}),e[48]=qe,e[49]=fe,e[50]=ge,e[51]=Xe,e[52]=We,e[53]=Qe,e[54]=Ye,e[55]=pe,e[56]=he,e[57]=xe):xe=e[57];let je;e[58]!==I||e[59]!==K.length||e[60]!==Ne||e[61]!==m||e[62]!==x||e[63]!==_e?(je=K.length===0&&_e.length===0&&Ne.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:m?x("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:m}):x(I==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=I,e[59]=K.length,e[60]=Ne,e[61]=m,e[62]=x,e[63]=_e,e[64]=je):je=e[64];let ve;e[65]!==me||e[66]!==xe||e[67]!==je?(ve=t.jsxs("div",{className:me,children:[xe,je]}),e[65]=me,e[66]=xe,e[67]=je,e[68]=ve):ve=e[68];let ze;return e[69]!==ue||e[70]!==ve?(ze=t.jsxs(t.Fragment,{children:[ue,ve]}),e[69]=ue,e[70]=ve,e[71]=ze):ze=e[71],ze}function $s(n){return!n.verified&&!Ve(n._meta)?.verified&&!n.meta?.verified}function Fs(n){return n.verified||Ve(n._meta)?.verified||n.meta?.verified}function Ls(n){return n.app_name}function Bs(n){return n.app_name}function Es(n){return n?.items??[]}function Vs(n,e){if(n?.hasMore)return e.reduce(Rs,0)}function Rs(n,e){return n+(e?.items?.length??0)}function Hs(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function Ho({open:n,onOpenChange:e,defaultTab:s,initialSearch:i="",...o}){const r=V(),a=o.mode??"add",l="agentId"in o?o.agentId:void 0,d="addedConnectionIds"in o?o.addedConnectionIds??new Set:new Set,m="onAdd"in o&&o.onAdd?o.onAdd:S=>{},u=(S,v,P)=>{l&&R("agent_connection_attached",{agent_id:l,connection_id:S,app_name:v,mode:P})},[p,c]=H.useState(null),[h,C]=H.useState(i),[x,g]=H.useState(!1),{org:j}=ae(),{data:b}=ie.useSession(),y=Et(),w=tn(),N=Re(),I=S=>{e(!1),N({to:"/$org/settings/connections/$appSlug",params:{org:j.slug,appSlug:S}})},O=()=>{w.invalidateQueries({predicate:S=>{const v=S.queryKey;return v[1]===j.id&&v[3]==="collection"&&v[4]==="CONNECTIONS"}})},f=async(S,v)=>{R("connection_oauth_succeeded",{connection_id:S,flow:v});const P=new URL(`/api/${j.slug}/mcp/${S}`,window.location.origin);await w.invalidateQueries({queryKey:ot.isMCPAuthenticated(P.href,null)}),O()},_=async S=>{c(S.app_name??S.id);try{const P=`${S.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,A=(await y.create.mutateAsync({title:P,description:S.description??null,connection_type:S.connection_type,connection_url:S.connection_url??null,connection_token:null,icon:S.icon??null,app_name:S.app_name??null,app_id:S.app_id??null,connection_headers:S.connection_headers??null})).id,z=await tt({connectionId:A,orgId:j.id,orgSlug:j.slug,persistFallback:B=>y.update.mutateAsync({id:A,data:{connection_token:B}}).then(()=>{})});if(z.ran&&!z.ok){R("connection_oauth_failed",{connection_id:A,flow:"clone",error:z.error??"no_token"}),G.error(r("virtualMcp.addConnectionDialog.authenticationFailedError",{error:z.error??"no token received"})),await y.delete.mutateAsync(A);return}z.ran&&await f(A,"clone"),u(A,S.app_name??null,"clone"),m(A)}catch(v){console.error("Failed to add connection:",v),G.error(r("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{c(null)}},T=async S=>{if(!(!j||!b?.user?.id)){c(S.id);try{const v=Ln(S,j.id,b.user.id,{remoteIndex:0}),P=v.connection_type==="STDIO",k=!!v.connection_url,A=P&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!k&&!A){G.error(r("virtualMcp.addConnectionDialog.mcpServerConnectionError")),c(null);return}const{id:z}=await y.create.mutateAsync(v),B=await tt({connectionId:z,orgId:j.id,orgSlug:j.slug,persistFallback:E=>y.update.mutateAsync({id:z,data:{connection_token:E}}).then(()=>{})});if(B.ran&&!B.ok){R("connection_oauth_failed",{connection_id:z,flow:"connect_new",error:B.error??"no_token"}),G.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:B.error??"no token received"})}),u(z,v.app_name??null,"new"),m(z);return}B.ran?(await f(z,"connect_new"),G.success(r("virtualMcp.addConnectionDialog.connectedAuthenticated"))):G.success(r("virtualMcp.addConnectionDialog.connected")),u(z,v.app_name??null,"new"),m(z)}catch(v){console.error("Failed to connect:",v),G.error(r("virtualMcp.addConnectionDialog.failedToConnect"))}finally{c(null)}}};return t.jsxs($t,{open:n,onOpenChange:e,children:[t.jsxs(Ft,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(Lt,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(Bt,{className:"text-base font-semibold",children:r(a==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(zn,{value:h,onChange:C,placeholder:r("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ms,{mode:a,agentId:l,addedConnectionIds:d,onAdd:m,onCloneAndAdd:_,onConnectAndAdd:T,connectingItemId:p,search:h,onCreateConnection:()=>g(!0),onBrowseNavigate:I,defaultTab:s})})]}),t.jsx(zs,{open:x,onOpenChange:g,onCreated:async S=>{g(!1);const v=await tt({connectionId:S,orgId:j.id,orgSlug:j.slug,persistFallback:P=>y.update.mutateAsync({id:S,data:{connection_token:P}}).then(()=>{})});if(v.ran&&!v.ok){R("connection_oauth_failed",{connection_id:S,flow:"custom_create",error:v.error??"no_token"}),G.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:v.error??"no token received"})}),u(S,null,"custom"),m(S),e(!1);return}v.ran&&await f(S,"custom_create"),u(S,null,"custom"),m(S),e(!1)}})]})}const ft=new Map;function Go(){const{org:n}=ae(),e=ts(),s=ns(),i=s.find(g=>g.providerId==="deco"),{data:o,isLoading:r,refetch:a,isFetching:l}=nn({queryKey:ot.aiProviderCredits(n.id,"deco"),enabled:!!i,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),d=o?.balanceCents??null,m=d!=null?d/100:null,u=H.useRef(new Map);if(d!=null){const g=ft.get(n.id);u.current.get(n.id)&&g!=null&&d>g&&R("credits_topped_up_detected",{organization_id:n.id,delta_cents:d-g,previous_balance_cents:g,new_balance_cents:d}),ft.set(n.id,d),u.current.set(n.id,!0)}const p=!!i,c=d!=null&&d>0,h=d!=null&&d===0,C=d!=null&&d===200,x=s.length>0&&s.every(g=>g.providerId==="deco");return{hasDecoKey:p,decoKeyId:i?.id??null,balanceCents:d,balanceDollars:m,hasCredits:c,isZeroBalance:h,isInitialFreeCredit:C,hasOnlyDecoProvider:x,isLoading:r,isFetching:l,refetch:a}}export{Vo as A,Ro as N,Eo as O,Ho as a,ls as b,at as c,fs as d,Fo as e,Rt as f,$o as g,Bo as h,Lo as i,rt as r,Go as u};
|
package/dist/client/assets/{use-decopilot-events-BAmSlT1H.js → use-decopilot-events-D3VIHgjl.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-BkymslL9.js";import{d as R,D as u}from"./decopilot-sse-pool-C15s_ggq.js";const f=()=>0;function g(E){const{orgSlug:t,taskId:a,enabled:n=!0,onStep:o,onFinish:S,onTaskStatus:i}=E,l=s.useRef({taskId:a,onStep:o,onFinish:S,onTaskStatus:i});l.current={taskId:a,onStep:o,onFinish:S,onTaskStatus:i};const c=s.useRef(null),p=s.useRef(n),b=s.useRef(t);(!c.current||p.current!==n||b.current!==t)&&(p.current=n,b.current=t,c.current=d=>{if(!n||!t)return()=>{};const k=T=>{let e;try{e=JSON.parse(T.data)}catch{return}const r=l.current;if(!(r.taskId&&e.subject!==r.taskId)){switch(e.type){case u.STEP:r.onStep?.(e);break;case u.FINISH:r.onFinish?.(e);break;case u.THREAD_STATUS:r.onTaskStatus?.(e);break}d()}};return R.subscribe(t,k)}),s.useSyncExternalStore(c.current,f,f)}export{g as u};
|
package/dist/client/assets/{use-delete-connection-BWt9DC6T.js → use-delete-connection-C-dA1zii.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as oe,b as le,j as n,F as se,o as ie,r as ce,t as Y,b1 as re,b2 as ae}from"./index-
|
|
1
|
+
import{c as oe,b as le,j as n,F as se,o as ie,r as ce,t as Y,b1 as re,b2 as ae}from"./index-BkymslL9.js";import{c as z,d as G,b as V,f as X,g as Z,e as ee,a as te,A as ne}from"./alert-dialog-Dexb9Fmf.js";import{u as de}from"./studio-tools-BerQESFF.js";function ue(B){const e=oe.c(86),{deleteState:s,cancelDelete:a,confirmDelete:d,confirmForceDelete:c}=B,t=le(),w=s.mode==="deleting";let m;e[0]!==a?(m=W=>{W||a()},e[0]=a,e[1]=m):m=e[1];let u;e[2]!==t?(u=t("common.deleteConnectionDialogs.title"),e[2]=t,e[3]=u):u=e[3];let D;e[4]!==u?(D=n.jsx(z,{children:u}),e[4]=u,e[5]=D):D=e[5];let C;e[6]!==t?(C=t("common.deleteConnectionDialogs.description"),e[6]=t,e[7]=C):C=e[7];const H=s.mode==="deleting"&&s.connection.title;let o;e[8]!==H?(o=n.jsx("span",{className:"font-medium text-foreground",children:H}),e[8]=H,e[9]=o):o=e[9];let l;e[10]!==C||e[11]!==o?(l=n.jsxs(G,{children:[C," ",o,"."]}),e[10]=C,e[11]=o,e[12]=l):l=e[12];let i;e[13]!==D||e[14]!==l?(i=n.jsxs(V,{children:[D,l]}),e[13]=D,e[14]=l,e[15]=i):i=e[15];let f;e[16]!==t?(f=t("common.deleteConnectionDialogs.cancel"),e[16]=t,e[17]=f):f=e[17];let r;e[18]!==f?(r=n.jsx(X,{children:f}),e[18]=f,e[19]=r):r=e[19];let g;e[20]!==t?(g=t("common.deleteConnectionDialogs.delete"),e[20]=t,e[21]=g):g=e[21];let x;e[22]!==d||e[23]!==g?(x=n.jsx(Z,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:g}),e[22]=d,e[23]=g,e[24]=x):x=e[24];let h;e[25]!==r||e[26]!==x?(h=n.jsxs(ee,{children:[r,x]}),e[25]=r,e[26]=x,e[27]=h):h=e[27];let j;e[28]!==h||e[29]!==i?(j=n.jsxs(te,{children:[i,h]}),e[28]=h,e[29]=i,e[30]=j):j=e[30];let p;e[31]!==w||e[32]!==j||e[33]!==m?(p=n.jsx(ne,{open:w,onOpenChange:m,children:j}),e[31]=w,e[32]=j,e[33]=m,e[34]=p):p=e[34];const J=s.mode==="force-deleting";let N;e[35]!==a?(N=W=>{W||a()},e[35]=a,e[36]=N):N=e[36];let E;e[37]!==t?(E=t("common.deleteConnectionDialogs.forceDeleteTitle"),e[37]=t,e[38]=E):E=e[38];let y;e[39]!==E?(y=n.jsx(z,{children:E}),e[39]=E,e[40]=y):y=e[40];let O;e[41]!==t?(O=t("common.deleteConnectionDialogs.forceDeleteDescription"),e[41]=t,e[42]=O):O=e[42];const M=s.mode==="force-deleting"&&s.connection.title;let v;e[43]!==M?(v=n.jsx("span",{className:"font-medium text-foreground",children:M}),e[43]=M,e[44]=v):v=e[44];let S;e[45]!==t?(S=t("common.deleteConnectionDialogs.isUsedByAgents"),e[45]=t,e[46]=S):S=e[46];const P=s.mode==="force-deleting"&&s.agentNames;let T;e[47]!==P?(T=n.jsx("span",{className:"font-medium text-foreground",children:P}),e[47]=P,e[48]=T):T=e[48];let A;e[49]!==O||e[50]!==v||e[51]!==S||e[52]!==T?(A=n.jsxs("p",{children:[O," ",v," ",S," ",T,"."]}),e[49]=O,e[50]=v,e[51]=S,e[52]=T,e[53]=A):A=e[53];let _;e[54]!==t?(_=t("common.deleteConnectionDialogs.forceDeleteWarning"),e[54]=t,e[55]=_):_=e[55];let F;e[56]!==_?(F=n.jsx("p",{className:"mt-2",children:_}),e[56]=_,e[57]=F):F=e[57];let b;e[58]!==A||e[59]!==F?(b=n.jsx(G,{asChild:!0,children:n.jsxs("div",{children:[A,F]})}),e[58]=A,e[59]=F,e[60]=b):b=e[60];let I;e[61]!==y||e[62]!==b?(I=n.jsxs(V,{children:[y,b]}),e[61]=y,e[62]=b,e[63]=I):I=e[63];let L;e[64]!==t?(L=t("common.deleteConnectionDialogs.cancel"),e[64]=t,e[65]=L):L=e[65];let R;e[66]!==L?(R=n.jsx(X,{children:L}),e[66]=L,e[67]=R):R=e[67];let q;e[68]!==t?(q=t("common.deleteConnectionDialogs.deleteAnyway"),e[68]=t,e[69]=q):q=e[69];let U;e[70]!==c||e[71]!==q?(U=n.jsx(Z,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:q}),e[70]=c,e[71]=q,e[72]=U):U=e[72];let K;e[73]!==R||e[74]!==U?(K=n.jsxs(ee,{children:[R,U]}),e[73]=R,e[74]=U,e[75]=K):K=e[75];let $;e[76]!==I||e[77]!==K?($=n.jsxs(te,{children:[I,K]}),e[76]=I,e[77]=K,e[78]=$):$=e[78];let k;e[79]!==J||e[80]!==N||e[81]!==$?(k=n.jsx(ne,{open:J,onOpenChange:N,children:$}),e[79]=J,e[80]=N,e[81]=$,e[82]=k):k=e[82];let Q;return e[83]!==p||e[84]!==k?(Q=n.jsxs(n.Fragment,{children:[p,k]}),e[83]=p,e[84]=k,e[85]=Q):Q=e[85],Q}function De({onSuccess:B}={}){const{org:e}=se(),s=ie(),a=de(),[d,c]=ce.useState({mode:"idle"}),t=()=>{s.invalidateQueries({predicate:o=>{const l=o.queryKey;return l[1]===e.id&&l[3]==="collection"&&l[4]==="CONNECTIONS"}})},w=o=>{re(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===ae&&l.queryKey[3]===o})},m=o=>{t(),w(o),Y.success("Connection deleted successfully"),c({mode:"idle"}),B?.()};return{deleteState:d,requestDelete:o=>{c({mode:"deleting",connection:o})},cancelDelete:()=>{c({mode:"idle"})},confirmDelete:async()=>{if(d.mode!=="deleting")return;const o=d.connection;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o.id}),m(o.id)}catch(l){const i=l instanceof Error?l.message:String(l),f=i.replace(/^Error:\s*/,"");try{const r=JSON.parse(f);if(r.code==="CONNECTION_IN_USE"&&r.agentNames){c({mode:"force-deleting",connection:o,agentNames:r.agentNames.map(g=>`"${g}"`).join(", ")});return}}catch{}Y.error(`Failed to delete connection: ${i}`)}},confirmForceDelete:async()=>{if(d.mode!=="force-deleting")return;const o=d.connection.id;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o,force:!0}),m(o)}catch(l){const i=l instanceof Error?l.message:String(l);Y.error(`Failed to delete connection: ${i}`)}}}}export{ue as D,De as u};
|
package/dist/client/assets/{use-deployment-admin-B5sXB-_D.js → use-deployment-admin-CdrJL4_N.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,n as m,K as c}from"./index-
|
|
1
|
+
import{c as s,n as m,K as c}from"./index-BkymslL9.js";function l(){const e=s.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:c.deploymentAdminMe(),queryFn:d,staleTime:1/0,retry:2},e[0]=t):t=e[0];const{data:a,isLoading:i}=m(t),r=a==="admin",o=a==="unverified";let n;return e[1]!==i||e[2]!==r||e[3]!==o?(n={isAdmin:r,loading:i,needsEmailVerification:o},e[1]=i,e[2]=r,e[3]=o,e[4]=n):n=e[4],n}async function d(){const e=await fetch("/api/_admin/me",{credentials:"include"});if(e.status>=500)throw new Error(`admin/me request failed: ${e.status}`);return e.ok?"admin":(await e.json().catch(u)).error==="email_not_verified"?"unverified":"denied"}function u(){return{}}export{l as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,F as c,K as r,n as d,x as y,o as C,e as F}from"./index-
|
|
1
|
+
import{c as u,F as c,K as r,n as d,x as y,o as C,e as F}from"./index-BkymslL9.js";import{u as f}from"./studio-tools-BerQESFF.js";function m(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:l}=y(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6],d(s)}function q(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_CREATE",{...a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],F(l)}function _(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_DELETE",{id:a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],F(l)}export{I as a,q as b,_ as c,m as u};
|
package/dist/client/assets/{use-infinite-scroll-B9ylal0v.js → use-infinite-scroll-o-xRmvTW.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aL as d,dU as l,dV as v,r as i}from"./index-
|
|
1
|
+
import{aL as d,dU as l,dV as v,r as i}from"./index-BkymslL9.js";var p=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,u=super.createResult(e,t),{isFetching:r,isRefetching:h,isError:a,isRefetchError:g}=u,s=n.fetchMeta?.fetchMore?.direction,o=a&&s==="forward",P=r&&s==="forward",c=a&&s==="backward",f=r&&s==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,n.data),hasPreviousPage:l(t,n.data),isFetchNextPageError:o,isFetchingNextPage:P,isFetchPreviousPageError:c,isFetchingPreviousPage:f,isRefetchError:g&&!o&&!c,isRefetching:h&&!P&&!f}}};function b(e,t,n=!1,u){const r=i.useRef(null),h=i.useRef(null),a=i.useRef(e),g=i.useRef(t),s=i.useRef(n),o=i.useRef(u);a.current=e,g.current=t,s.current=n,o.current=u;const[P]=i.useState(()=>c=>{h.current=c,r.current&&(r.current.disconnect(),r.current=null),c&&queueMicrotask(()=>{if(h.current!==c)return;const f=new IntersectionObserver(R=>{R[0]?.isIntersecting&&g.current&&!s.current&&a.current()},{root:o.current?.current??null,rootMargin:"0px 0px 200px 0px"});f.observe(c),r.current=f})});return P}export{p as I,b as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,F as N,K as y,n as _,o as A,e as I,t as q}from"./index-
|
|
1
|
+
import{c as g,F as N,K as y,n as _,o as A,e as I,t as q}from"./index-BkymslL9.js";import{a as S}from"./use-capability-Oxb87xKU.js";import{u as O}from"./studio-tools-BerQESFF.js";function b(){const e=g.c(10),{org:r}=N(),u=O(),{capabilities:a,isPrivileged:c}=S(),d=c||!!a["members:manage"];let t;e[0]!==r.id?(t=y.organizationJoinRequests(r.id),e[0]=r.id,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=u,e[3]=s):s=e[3];const i=!!r.id&&d;let n;e[4]!==t||e[5]!==s||e[6]!==i?(n={queryKey:t,queryFn:s,enabled:i},e[4]=t,e[5]=s,e[6]=i,e[7]=n):n=e[7];const{data:l}=_(n);let o;return e[8]!==l?.requests?(o=l?.requests??[],e[8]=l?.requests,e[9]=o):o=e[9],o}function K(){const e=g.c(21),{org:r,locator:u}=N(),a=O(),c=A();let d;e[0]!==u||e[1]!==r||e[2]!==c?(d=()=>{c.invalidateQueries({queryKey:y.organizationJoinRequests(r.id)}),c.invalidateQueries({queryKey:y.members(u)})},e[0]=u,e[1]=r,e[2]=c,e[3]=d):d=e[3];const t=d;let s;e[4]!==a?(s=R=>a.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:R}),e[4]=a,e[5]=s):s=e[5];let i;e[6]!==t?(i=()=>{t(),q.success("Request approved")},e[6]=t,e[7]=i):i=e[7];let n;e[8]!==s||e[9]!==i?(n={mutationFn:s,onSuccess:i,onError:v},e[8]=s,e[9]=i,e[10]=n):n=e[10];const l=I(n);let o;e[11]!==a?(o=R=>a.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:R}),e[11]=a,e[12]=o):o=e[12];let f;e[13]!==t?(f=()=>{t(),q.success("Request denied")},e[13]=t,e[14]=f):f=e[14];let m;e[15]!==o||e[16]!==f?(m={mutationFn:o,onSuccess:f,onError:T},e[15]=o,e[16]=f,e[17]=m):m=e[17];const E=I(m);let p;return e[18]!==l||e[19]!==E?(p={approve:l,deny:E},e[18]=l,e[19]=E,e[20]=p):p=e[20],p}function T(e){return q.error(e instanceof Error?e.message:"Failed to deny")}function v(e){return q.error(e instanceof Error?e.message:"Failed to approve")}export{K as a,b as u};
|
package/dist/client/assets/{use-mcp-auth-status-DhEAiLgH.js → use-mcp-auth-status-j64WYNIX.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as R,aD as z,aB as V,j as a,bA as W,ay as x,aC as I,bB as Y,aE as C,bC as w,bD as Q,aA as A,bz as X,by as J,c as S,b as Z,z as ee,aw as oe,F as te,K as re,x as se}from"./index-
|
|
1
|
+
import{r as R,aD as z,aB as V,j as a,bA as W,ay as x,aC as I,bB as Y,aE as C,bC as w,bD as Q,aA as A,bz as X,by as J,c as S,b as Z,z as ee,aw as oe,F as te,K as re,x as se}from"./index-BkymslL9.js";import{B as _}from"./badge-_wR-Cj9j.js";import{c as k,T as E,a as P,b as ae}from"./tooltip-BEp2qlKJ.js";import{g as ne}from"./index-BM0uownS.js";import{s as ie}from"./Eye-BgxVnR4L.js";import{s as ce}from"./Star01-ChJYud6w.js";import{aP as le}from"./agent-icon-DQrqcIhD.js";import{i as de}from"./mcp-oauth-DOzQiO7r.js";var g="Radio",[ue,N]=A(g),[pe,fe]=ue(g),T=R.forwardRef((d,e)=>{const{__scopeRadio:t,name:n,checked:o=!1,required:r,disabled:s,value:i="on",onCheck:c,form:l,...f}=d,[u,v]=R.useState(null),p=I(e,h=>v(h)),m=R.useRef(!1),y=u?l||!!u.closest("form"):!0;return a.jsxs(pe,{scope:t,checked:o,disabled:s,children:[a.jsx(x.button,{type:"button",role:"radio","aria-checked":o,"data-state":L(o),"data-disabled":s?"":void 0,disabled:s,value:i,...f,ref:p,onClick:C(d.onClick,h=>{o||c?.(),y&&(m.current=h.isPropagationStopped(),m.current||h.stopPropagation())})}),y&&a.jsx(K,{control:u,bubbles:!m.current,name:n,value:i,checked:o,required:r,disabled:s,form:l,style:{transform:"translateX(-100%)"}})]})});T.displayName=g;var G="RadioIndicator",D=R.forwardRef((d,e)=>{const{__scopeRadio:t,forceMount:n,...o}=d,r=fe(G,t);return a.jsx(Q,{present:n||r.checked,children:a.jsx(x.span,{"data-state":L(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:e})})});D.displayName=G;var ve="RadioBubbleInput",K=R.forwardRef(({__scopeRadio:d,control:e,checked:t,bubbles:n=!0,...o},r)=>{const s=R.useRef(null),i=I(s,r),c=X(t),l=J(e);return R.useEffect(()=>{const f=s.current;if(!f)return;const u=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(u,"checked").set;if(c!==t&&p){const m=new Event("click",{bubbles:n});p.call(f,t),f.dispatchEvent(m)}},[c,t,n]),a.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...o,tabIndex:-1,ref:i,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});K.displayName=ve;function L(d){return d?"checked":"unchecked"}var me=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],b="RadioGroup",[Re]=A(b,[w,N]),O=w(),B=N(),[ye,he]=Re(b),M=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,name:n,defaultValue:o,value:r,required:s=!1,disabled:i=!1,orientation:c,dir:l,loop:f=!0,onValueChange:u,...v}=d,p=O(t),m=z(l),[y,h]=V({prop:r,defaultProp:o??null,onChange:u,caller:b});return a.jsx(ye,{scope:t,name:n,required:s,disabled:i,value:y,onValueChange:h,children:a.jsx(W,{asChild:!0,...p,orientation:c,dir:m,loop:f,children:a.jsx(x.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":i?"":void 0,dir:m,...v,ref:e})})})});M.displayName=b;var U="RadioGroupItem",F=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,disabled:n,...o}=d,r=he(U,t),s=r.disabled||n,i=O(t),c=B(t),l=R.useRef(null),f=I(e,l),u=r.value===o.value,v=R.useRef(!1);return R.useEffect(()=>{const p=y=>{me.includes(y.key)&&(v.current=!0)},m=()=>v.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",m)}},[]),a.jsx(Y,{asChild:!0,...i,focusable:!s,active:u,children:a.jsx(T,{disabled:s,required:r.required,checked:u,...c,...o,name:r.name,ref:f,onCheck:()=>r.onValueChange(o.value),onKeyDown:C(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:C(o.onFocus,()=>{v.current&&l.current?.click()})})})});F.displayName=U;var xe="RadioGroupIndicator",q=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,...n}=d,o=B(t);return a.jsx(D,{...o,...n,ref:e})});q.displayName=xe;var we=M,Ae=F,Se=q;const be=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:ie,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:ee,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:oe,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:ce,variant:"outline"}];function Ne(d){const e=S.c(22),{annotations:t,_meta:n}=d,o=Z();let r;e[0]!==n?(r=ne(n),e[0]=n,e[1]=r):r=e[1];const s=!!r;let i,c,l,f,u;if(e[2]!==t||e[3]!==s||e[4]!==o){u=Symbol.for("react.early_return_sentinel");e:{const m=t?be.filter(h=>t[h.key]===!0):[];if(m.length===0&&!s){u=null;break e}i=ae,c="flex gap-1 flex-nowrap",e[10]!==s||e[11]!==o?(l=s&&a.jsxs(k,{children:[a.jsx(E,{asChild:!0,children:a.jsx(_,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:a.jsx(le,{})})}),a.jsx(P,{children:o("tools.toolsList.interactive")})]}),e[10]=s,e[11]=o,e[12]=l):l=e[12];let y;e[13]!==o?(y=h=>{const{labelKey:j,Icon:H,variant:$}=h;return a.jsxs(k,{children:[a.jsx(E,{asChild:!0,children:a.jsx(_,{asChild:!0,variant:$,className:"size-6 p-1",children:a.jsx(H,{})})}),a.jsx(P,{children:o(j)})]},j)},e[13]=o,e[14]=y):y=e[14],f=m.map(y)}e[2]=t,e[3]=s,e[4]=o,e[5]=i,e[6]=c,e[7]=l,e[8]=f,e[9]=u}else i=e[5],c=e[6],l=e[7],f=e[8],u=e[9];if(u!==Symbol.for("react.early_return_sentinel"))return u;let v;e[15]!==c||e[16]!==l||e[17]!==f?(v=a.jsxs("div",{className:c,children:[l,f]}),e[15]=c,e[16]=l,e[17]=f,e[18]=v):v=e[18];let p;return e[19]!==i||e[20]!==v?(p=a.jsx(i,{children:v}),e[19]=i,e[20]=v,e[21]=p):p=e[21],p}function Te(d){const e=S.c(11),{connectionId:t}=d,{org:n}=te();let o,r,s;e[0]!==t||e[1]!==n.slug?(o=new URL(`/api/${n.slug}/mcp/${t}`,window.location.origin),s=se,r=re.isMCPAuthenticated(o.href,null),e[0]=t,e[1]=n.slug,e[2]=o,e[3]=r,e[4]=s):(o=e[2],r=e[3],s=e[4]);let i;e[5]!==o||e[6]!==n.id?(i=()=>de({url:o.href,token:null,orgId:n.id}),e[5]=o,e[6]=n.id,e[7]=i):i=e[7];let c;e[8]!==r||e[9]!==i?(c={queryKey:r,queryFn:i},e[8]=r,e[9]=i,e[10]=c):c=e[10];const{data:l}=s(c);return l}export{Ae as I,we as R,Ne as T,Se as a,Te as u};
|