decocms 4.149.2 → 4.149.3
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-IVSYIkmZ.js → AlertCircle-DCV-J_17.js} +1 -1
- package/dist/client/assets/{AreaChart-BOENTeXP.js → AreaChart-4o5_QIMN.js} +1 -1
- package/dist/client/assets/{ArrowUp-Bgfikl5w.js → ArrowUp-BlWwKW4L.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CWv6_9Ex.js → ArrowUpRight-CJ_7mRw-.js} +1 -1
- package/dist/client/assets/{Check-DkFHuFLF.js → Check-qJLO8g4w.js} +1 -1
- package/dist/client/assets/{CheckCircle-C9WSvoea.js → CheckCircle-DUp67_eI.js} +1 -1
- package/dist/client/assets/{ChevronDown-0c4JTfKo.js → ChevronDown-3-gbZo8q.js} +1 -1
- package/dist/client/assets/{ChevronRight-algpPtg8.js → ChevronRight-CJOIJTmS.js} +1 -1
- package/dist/client/assets/{ChevronUp-ymps59FJ.js → ChevronUp-B3CtolQ8.js} +1 -1
- package/dist/client/assets/{Copy01-WldK5CoB.js → Copy01-DOfL1Wyb.js} +1 -1
- package/dist/client/assets/{DotsVertical-CVj50rsj.js → DotsVertical-DpBcrugn.js} +1 -1
- package/dist/client/assets/{Eye-DonKIxOm.js → Eye-CK6s5DvS.js} +1 -1
- package/dist/client/assets/{FilterLines-CpeI2bD4.js → FilterLines-DzH0NKwR.js} +1 -1
- package/dist/client/assets/{HardDrive-DcHXjsFw.js → HardDrive-CwqHmUxc.js} +1 -1
- package/dist/client/assets/{Key01-CLOLix4l.js → Key01-CKSbFlEj.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DFsJ98hA.js → LayoutLeft-CrFA9fWe.js} +1 -1
- package/dist/client/assets/{LinkExternal01-jR5ZfK1-.js → LinkExternal01-BeqUZ5mh.js} +1 -1
- package/dist/client/assets/{LogOut01-4-ptiWqt.js → LogOut01-Cx0bCNIs.js} +1 -1
- package/dist/client/assets/{Monitor01-B8RuQ38U.js → Monitor01-BWjooWlk.js} +1 -1
- package/dist/client/assets/{Palette-Ck2khsiN.js → Palette-B2ca0bVn.js} +1 -1
- package/dist/client/assets/{Play-3qsqsZZi.js → Play-C68U-efL.js} +1 -1
- package/dist/client/assets/{Plus-DkFmTenT.js → Plus-B8mhYaf-.js} +1 -1
- package/dist/client/assets/{SearchLg-BLKFUXxm.js → SearchLg-CcqZwpgI.js} +1 -1
- package/dist/client/assets/{SearchMd-Dw__bMQL.js → SearchMd-BoHX07tM.js} +1 -1
- package/dist/client/assets/{Settings02-CKgP2rvh.js → Settings02-CQm8x-Mo.js} +1 -1
- package/dist/client/assets/{Shield01-D6-vuV6x.js → Shield01-BZ0gGCjQ.js} +1 -1
- package/dist/client/assets/{Star01-D41babtl.js → Star01-b9CKRdDr.js} +1 -1
- package/dist/client/assets/{Stars01-BZOYQZwI.js → Stars01-DBbpvSkt.js} +1 -1
- package/dist/client/assets/{Stars02-Be0nbgEF.js → Stars02-CEkp7b-G.js} +1 -1
- package/dist/client/assets/{Sun-VDw7wsMw.js → Sun-tN9skZqx.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BC3tjYtW.js → SwitchHorizontal01-CX0zzRKH.js} +1 -1
- package/dist/client/assets/{Tool01-BngJhgPB.js → Tool01-J1ZnkFdg.js} +1 -1
- package/dist/client/assets/{Tool02--hye3IZs.js → Tool02-CAeGe_oA.js} +1 -1
- package/dist/client/assets/{Trash01-tWz-jd5I.js → Trash01-DimX9kYZ.js} +1 -1
- package/dist/client/assets/{TrendUp01-D2ZT0gcL.js → TrendUp01-CDPaEeJa.js} +1 -1
- package/dist/client/assets/{Upload01-Bwa0YRg5.js → Upload01-B6ohqCNy.js} +1 -1
- package/dist/client/assets/{User01-BSgA21Pe.js → User01-DyigsrSz.js} +1 -1
- package/dist/client/assets/{Users01-Ct93scOb.js → Users01-P5l8QOnd.js} +1 -1
- package/dist/client/assets/{Users03-Bplp_Ccg.js → Users03-_2DmtKO7.js} +1 -1
- package/dist/client/assets/{X-B69fzX_x.js → X-Bb4zY2_f.js} +1 -1
- package/dist/client/assets/{XCircle-DEyoQKkX.js → XCircle-CsSTNWPK.js} +1 -1
- package/dist/client/assets/{XClose-CVsPcXcu.js → XClose-BcoCd49U.js} +1 -1
- package/dist/client/assets/{Zap-yvJz3thR.js → Zap-Ba39SNX5.js} +1 -1
- package/dist/client/assets/{ZapSquare-BbUmVu6O.js → ZapSquare-BtQYmRZ9.js} +1 -1
- package/dist/client/assets/{access-gate-CPH0eP3b.js → access-gate-DsDJYJZV.js} +1 -1
- package/dist/client/assets/{add-section-modal-C64K70dY.js → add-section-modal-Dju3VdVM.js} +1 -1
- package/dist/client/assets/{agent-icon-DWi24TTu.js → agent-icon-dfCTMRkW.js} +1 -1
- package/dist/client/assets/{agents-list-B-pgMXCw.js → agents-list-DT63BWyV.js} +1 -1
- package/dist/client/assets/{ai-providers-N0hzPenO.js → ai-providers-CKNR4ej6.js} +1 -1
- package/dist/client/assets/{alert-BXmazUt-.js → alert-CVSN7Bm8.js} +1 -1
- package/dist/client/assets/{alert-dialog-B-llqpWI.js → alert-dialog-nUW7phRB.js} +1 -1
- package/dist/client/assets/{app-editor-BglQP9Fd.js → app-editor-CKC8Hoa1.js} +1 -1
- package/dist/client/assets/{auth-06luBOeF.js → auth-DuesnJ3t.js} +1 -1
- package/dist/client/assets/{auth-catchall-rgXuAT0W.js → auth-catchall-CWGo7UBJ.js} +1 -1
- package/dist/client/assets/{auth-entry-DM_mQ1UN.js → auth-entry-Bx4WiEa3.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BCSc1fVV.js → auth-split-layout-CgefhgE9.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CcvwqhHu.js → authenticate-and-persist-oauth-Dgw0_gxc.js} +1 -1
- package/dist/client/assets/{automation-list-row-Blm1ZDLh.js → automation-list-row-CyTbS1So.js} +1 -1
- package/dist/client/assets/{automation-runs-Bpy5oG3_.js → automation-runs-C0ZOyXG3.js} +1 -1
- package/dist/client/assets/{automations-C8qDaiwa.js → automations-BEg5iRbe.js} +1 -1
- package/dist/client/assets/{avatar-AmSJQ7xe.js → avatar-DzM4poL0.js} +1 -1
- package/dist/client/assets/{badge-DtF9O2dM.js → badge-Dq0vpO1O.js} +1 -1
- package/dist/client/assets/{block-document-D83VPo_O.js → block-document-BFH2Px7h.js} +1 -1
- package/dist/client/assets/{brand-context-IBNEKJuH.js → brand-context-BwDrJEm5.js} +1 -1
- package/dist/client/assets/{buckets-RMXD0LKM.js → buckets-zcb9jEMz.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-B1qvl109.js → bulk-category-panel-CEsqU29t.js} +1 -1
- package/dist/client/assets/{calendar-D74ZQKoY.js → calendar-uC55ym82.js} +1 -1
- package/dist/client/assets/{capability-load-error-h0jTjRJS.js → capability-load-error-tYGfRV_T.js} +1 -1
- package/dist/client/assets/{card-CVFnRshr.js → card-By2Ftpqp.js} +1 -1
- package/dist/client/assets/{category-editor-DwKMBHFx.js → category-editor-DIYBCzVI.js} +1 -1
- package/dist/client/assets/{chat-context-CyqVD46W.js → chat-context-Dq62Fbos.js} +1 -1
- package/dist/client/assets/{checkbox-uOnAgvvJ.js → checkbox-DPh66MwY.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Cd2M2C-A.js → cli-auth-success-BJv9WFxD.js} +1 -1
- package/dist/client/assets/{collection-detail-69owlTQ3.js → collection-detail-C6G20fcE.js} +1 -1
- package/dist/client/assets/{collection-display-button-DUTaOT3L.js → collection-display-button-Z8-mPncU.js} +1 -1
- package/dist/client/assets/{collection-search-C3BI3cuC.js → collection-search-CsezHOBI.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-SHLkXmJm.js → collection-table-wrapper-CUrV0vvM.js} +1 -1
- package/dist/client/assets/{collection-tabs-CEjSI5Dj.js → collection-tabs-CDebuN4_.js} +1 -1
- package/dist/client/assets/{command-r8xGJsC0.js → command-CrmRZzqe.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-D0sSicvE.js → commerce-onboarding-DMrmVsQQ.js} +1 -1
- package/dist/client/assets/{companions-core-tM3wRH0g.js → companions-core-BjX3dRag.js} +1 -1
- package/dist/client/assets/{connect-D1ov1sRt.js → connect-DokClhA1.js} +1 -1
- package/dist/client/assets/{connection-onitdx9x.js → connection-BI_qURfG.js} +1 -1
- package/dist/client/assets/{connection-card-_xuRZak3.js → connection-card-Je9fGr_D.js} +1 -1
- package/dist/client/assets/{connection-detail-CoXlhj8a.js → connection-detail-DDmX4c7f.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CjHyiwck.js → connection-form-helpers-DeHqNHEG.js} +1 -1
- package/dist/client/assets/{connections-mFO4KxEX.js → connections-C6VaPq5Y.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-CuTenkEY.js → decopilot-sse-pool-DF2dyY7L.js} +1 -1
- package/dist/client/assets/{dialog-n-VT2LyW.js → dialog-C35xFAax.js} +1 -1
- package/dist/client/assets/{domain-settings-B_M2Q07G.js → domain-settings-D0QKeLfw.js} +1 -1
- package/dist/client/assets/{drawer-DlBnFiCv.js → drawer-DSvvDd5I.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BHHLwKxN.js → dropdown-menu-Bvkevh-y.js} +1 -1
- package/dist/client/assets/{empty-state-Bli1FVUm.js → empty-state-CPUkCVkl.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Tgh5h2_A.js → extract-connection-data-D61ZU_rY.js} +1 -1
- package/dist/client/assets/{file-explorer-q5crKwqp.js → file-explorer-CJE8KGRH.js} +1 -1
- package/dist/client/assets/{form-D8QeZ7pX.js → form-B2wEFCds.js} +1 -1
- package/dist/client/assets/{general-DGnBTHKj.js → general-7-W3ReTB.js} +1 -1
- package/dist/client/assets/{github-repo-picker-OygxwRVl.js → github-repo-picker-aJ_szzF7.js} +1 -1
- package/dist/client/assets/{hooks-CECShH7l.js → hooks-DKTnjQ7p.js} +1 -1
- package/dist/client/assets/{index-CjWyBWff.js → index-1MK4_xnA.js} +1 -1
- package/dist/client/assets/{index-CVut346_.js → index-BUFbCCKt.js} +1 -1
- package/dist/client/assets/{index-DhQ57Kmj.js → index-CpB-IlaU.js} +3 -3
- package/dist/client/assets/{index-Vy8egzeH.js → index-CtpeLpoX.js} +3 -3
- package/dist/client/assets/{index-CV_oIb7D.js → index-DD4yxjnF.js} +1 -1
- package/dist/client/assets/{index-DAtHJSAj.js → index-DLbh8nXf.js} +1 -1
- package/dist/client/assets/{index-CHyPH0R-.js → index-Dp3D61B6.js} +1 -1
- package/dist/client/assets/{index-DkLwpdfI.js → index-UMCVtGoa.js} +1 -1
- package/dist/client/assets/{index-Bqa1-3ok.js → index-UjzAqu9a.js} +1 -1
- package/dist/client/assets/{index-DT08MibC.js → index-_X8Hu152.js} +5 -5
- package/dist/client/assets/{index-_FxW-yOj.js → index-dIdebTuj.js} +1 -1
- package/dist/client/assets/{index-redirect-Do64sJrG.js → index-redirect-DzA1VdGX.js} +1 -1
- package/dist/client/assets/{input-BGezAoQv.js → input-d_-U8Dix.js} +1 -1
- package/dist/client/assets/{integration-icon-COWf6-b-.js → integration-icon-CVpCqCkL.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-CLZZBI5z.js → invite-member-dialog--nCU6Y0Q.js} +1 -1
- package/dist/client/assets/{label-B2xQGR4s.js → label-COIo3JhO.js} +1 -1
- package/dist/client/assets/{layout-5sQfsgET.js → layout--AGh5VKe.js} +1 -1
- package/dist/client/assets/{login-CoFLIETU.js → login-C_jjURjk.js} +1 -1
- package/dist/client/assets/{mcp-oauth-NlZobh1G.js → mcp-oauth-BVFmcwr5.js} +1 -1
- package/dist/client/assets/{members-CwVLCUEz.js → members-DeZ029Iq.js} +1 -1
- package/dist/client/assets/{monaco-editor-C3t-gRmw.js → monaco-editor-D9qPRIzl.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-B5JT2tnz.js → monitoring-stats-row-DdLVibYe.js} +1 -1
- package/dist/client/assets/{multi-select-DC1nXIUm.js → multi-select-DuWhKen8.js} +1 -1
- package/dist/client/assets/{oauth-callback-DSkqIaQO.js → oauth-callback-DvtVRzgD.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-R_DGquTf.js → oauth-callback-ai-provider-DbXvFhcI.js} +1 -1
- package/dist/client/assets/{onboarding-D5FE-UEj.js → onboarding-Bq71rgvk.js} +1 -1
- package/dist/client/assets/{org-install-Dt-eUlBV.js → org-install-DNHnYiu7.js} +1 -1
- package/dist/client/assets/{org-layout-Ch41MD2c.js → org-layout-fxNEOaXk.js} +1 -1
- package/dist/client/assets/{organization-choice-BWzH0m8O.js → organization-choice-DMLt4JYU.js} +1 -1
- package/dist/client/assets/{orgs--v8yTBDu.js → orgs-m75GBcFO.js} +1 -1
- package/dist/client/assets/{page-seo-form-Ckutuv3l.js → page-seo-form-DYXIHsX2.js} +1 -1
- package/dist/client/assets/{popover-BS1i8F97.js → popover-C5wy-cA4.js} +1 -1
- package/dist/client/assets/{post-editor-CLA6Kl3F.js → post-editor-DG8uKeD_.js} +1 -1
- package/dist/client/assets/{primitives-z891UU6S.js → primitives-CXWzNxwl.js} +1 -1
- package/dist/client/assets/{profile-mU98vr9g.js → profile-CLWJOyrN.js} +1 -1
- package/dist/client/assets/project-app-view-D45FUhON.js +1 -0
- package/dist/client/assets/record-editor-CSkH0gmr.js +1 -0
- package/dist/client/assets/{redirect-editor-D3Ua4K26.js → redirect-editor-DByf9Hd-.js} +1 -1
- package/dist/client/assets/registry-B0eVM6t4.js +2 -0
- package/dist/client/assets/{registry-layout-3HW4mOj2.js → registry-layout-Dkqycgq-.js} +1 -1
- package/dist/client/assets/{reports-DSDYyTIT.js → reports-CfkBm7aH.js} +1 -1
- package/dist/client/assets/{require-capability-BY46PHIL.js → require-capability-CwWZRwbh.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DLN4kddx.js → required-auth-layout-V20CMUEy.js} +1 -1
- package/dist/client/assets/{reset-password-Dumh2xI1.js → reset-password-CwBtSk7M.js} +1 -1
- package/dist/client/assets/{roles-Bd-WDKry.js → roles-ap1OrJxI.js} +1 -1
- package/dist/client/assets/{search-input-BbFuHUW8.js → search-input-0aFemSaC.js} +1 -1
- package/dist/client/assets/{secrets-DwKmo6lX.js → secrets-ChJjKPOt.js} +1 -1
- package/dist/client/assets/{sections-editor-YEGc6doG.js → sections-editor-CyyZzqz7.js} +1 -1
- package/dist/client/assets/{select-Dr9e7ugT.js → select-lph10Txc.js} +1 -1
- package/dist/client/assets/{select-model-CyNorObe.js → select-model-Bj885jOc.js} +1 -1
- package/dist/client/assets/{self-tool-result-DKTxpWKk.js → self-tool-result-MFBkD0_q.js} +1 -1
- package/dist/client/assets/{seo-editor-D21Ekrw1.js → seo-editor-CcobaQNX.js} +1 -1
- package/dist/client/assets/{settings-layout-DTvNWF_-.js → settings-layout-CWL8UH3n.js} +1 -1
- package/dist/client/assets/{settings-section-Dt8yXC6Y.js → settings-section-DFb19YyU.js} +1 -1
- package/dist/client/assets/{shell-controls-DBVU4c9B.js → shell-controls-C5rbO6lk.js} +1 -1
- package/dist/client/assets/{shell-layout-BSJLlqlV.js → shell-layout-BUCFxsPz.js} +1 -1
- package/dist/client/assets/{sidebar-D2O9mFrR.js → sidebar-LfWRhUzl.js} +1 -1
- package/dist/client/assets/{skeleton-DfGDbM3d.js → skeleton-TLHNqNsZ.js} +1 -1
- package/dist/client/assets/{sso-inkYovPZ.js → sso-BEn4hNCx.js} +1 -1
- package/dist/client/assets/{store-CyrOxkR3.js → store-D1bCZhBr.js} +1 -1
- package/dist/client/assets/store-registry-Boslb8E0.js +2 -0
- package/dist/client/assets/{studio-tools-BYeIs48m.js → studio-tools-D5VF1LfT.js} +1 -1
- package/dist/client/assets/{switch-DhQ77FgB.js → switch-YFaKLIre.js} +1 -1
- package/dist/client/assets/{tab-id-DCu4dPcB.js → tab-id-Dcig-y_b.js} +1 -1
- package/dist/client/assets/{table-Xl3Zj--g.js → table-BJpE1-_1.js} +1 -1
- package/dist/client/assets/{tabs-Deo2XEgS.js → tabs-BW1O983z.js} +1 -1
- package/dist/client/assets/{textarea-Cx10FRoR.js → textarea-DGduoLl0.js} +1 -1
- package/dist/client/assets/{toggle-group-CR4d9V89.js → toggle-group-C54zcybT.js} +1 -1
- package/dist/client/assets/{toolbar-JAAWukon.js → toolbar-D9Mu1f21.js} +1 -1
- package/dist/client/assets/{tooltip-6w046nYq.js → tooltip-DIgwzaVn.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DMroHl1L.js → use-ai-providers-EGRXEeM0.js} +1 -1
- package/dist/client/assets/{use-automations-Dnc404Eq.js → use-automations-BiKKZ5DB.js} +1 -1
- package/dist/client/assets/{use-autosave-D_qx_0Z_.js → use-autosave-CyFOk-3c.js} +1 -1
- package/dist/client/assets/{use-capability-CbVvU2R8.js → use-capability-DBGC11nS.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CM1thBKF.js → use-clock-tick-D_qXyi-a.js} +1 -1
- package/dist/client/assets/{use-connection-C7HDIsYy.js → use-connection-DZ9yH8AT.js} +1 -1
- package/dist/client/assets/{use-copy-dE3JXEQ3.js → use-copy-Cgp1WREv.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DRsz9AB6.js → use-create-virtual-mcp-Csg7y6O0.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BIQxdqd3.js → use-debounced-autosave-DKkHA0__.js} +1 -1
- package/dist/client/assets/{use-debounced-value-C_bgLTBF.js → use-debounced-value-CbBPU7zd.js} +1 -1
- package/dist/client/assets/{use-deco-credits-DVXAD6Sj.js → use-deco-credits-BTyCYUEI.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-rxVRItI-.js → use-decopilot-events-CoPRmIh1.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B_FlrK-N.js → use-delete-connection-_Rvwmzkz.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-C-egalAw.js → use-deployment-admin-Bdv9ISo-.js} +1 -1
- package/dist/client/assets/{use-file-configs-C4WFe_78.js → use-file-configs-f4stKVI8.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BoPeF6JW.js → use-infinite-scroll-Cjxmjx6A.js} +1 -1
- package/dist/client/assets/{use-join-requests-D1DhJa5e.js → use-join-requests-CeLDT3kg.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-Bb-dRWw_.js → use-mcp-auth-status-DZSlpAEm.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DwSe9g39.js → use-mcp-client-nWQQesMe.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BukrrnA7.js → use-mcp-tools-DszGK-_z.js} +1 -1
- package/dist/client/assets/{use-members-C-pppXvS.js → use-members-fLGpkGSl.js} +1 -1
- package/dist/client/assets/{use-mobile-CG_e5dV7.js → use-mobile-Z2zaMHdo.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BS49KKxO.js → use-navigate-to-agent-DuvGIrZp.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-lLIFAZbd.js → use-org-auth-client-B4AXfjB6.js} +1 -1
- package/dist/client/assets/{use-org-sso-8yhP2M4X.js → use-org-sso-Dj03JEgE.js} +1 -1
- package/dist/client/assets/{use-organization-roles-8Lyb8DK_.js → use-organization-roles-1OcndSR7.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CvG6csjF.js → use-organization-settings-CRMcF-sH.js} +1 -1
- package/dist/client/assets/{use-registry-connections-C_FwRD7r.js → use-registry-connections-BUZ4K3em.js} +1 -1
- package/dist/client/assets/{use-secrets-CGf3VlgB.js → use-secrets-Dv5Alqqh.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BKJ91mSi.js → use-status-sounds-mFeaoy3i.js} +1 -1
- package/dist/client/assets/{use-tags-BoMhscxI.js → use-tags-4lM6_uxA.js} +1 -1
- package/dist/client/assets/{use-view-mode-DvwInOlv.js → use-view-mode-DkR4rAMi.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CJk53fJS.js → use-virtual-mcp-BWv80DLH.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DK5SQ5J_.js +1 -0
- package/dist/client/assets/{useQueries-BarMPJnK.js → useQueries-BHykKmN9.js} +1 -1
- package/dist/client/assets/{useRouterState-D7943tSM.js → useRouterState-CIzA3viz.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-ZdkbsRBz.js +1 -0
- package/dist/client/assets/{users-B3sZ4Xml.js → users-DHCJC9Zu.js} +1 -1
- package/dist/client/assets/{variant-calendar-BILf2d5L.js → variant-calendar-Bs_8SibF.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Bw4qkgPS.js → view-mode-toggle-BAAe34Q5.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +411 -409
- package/dist/server/server.js +279 -279
- package/package.json +1 -1
- package/dist/client/assets/project-app-view-CPdzeiiD.js +0 -1
- package/dist/client/assets/record-editor-CEsHb5_i.js +0 -1
- package/dist/client/assets/registry-CCsXcJWr.js +0 -2
- package/dist/client/assets/store-registry-CHkK4OS3.js +0 -2
- package/dist/client/assets/useInfiniteQuery-D9Tmht7w.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BFsn9Uf-.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,j as c,ay as M,aF as Q,aB as J,cP as Z,aC as H,cQ as ee,aE as C,bE as $,cR as te,cS as G,cT as oe,cU as re,aA as ne,cV as se,cW as ae,c as j,m as ie}from"./index-
|
|
1
|
+
import{r as a,j as c,ay as M,aF as Q,aB as J,cP as Z,aC as H,cQ as ee,aE as C,bE as $,cR as te,cS as G,cT as oe,cU as re,aA as ne,cV as se,cW as ae,c as j,m as ie}from"./index-CpB-IlaU.js";var le=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ce="VisuallyHidden",V=a.forwardRef((o,e)=>c.jsx(M.span,{...o,ref:e,style:{...le,...o.style}}));V.displayName=ce;var ue=V,[O]=ne("Tooltip",[G]),D=G(),F="TooltipProvider",de=700,A="tooltip.open",[pe,k]=O(F),z=o=>{const{__scopeTooltip:e,delayDuration:t=de,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=o,l=a.useRef(!0),d=a.useRef(!1),i=a.useRef(0);return a.useEffect(()=>{const p=i.current;return()=>window.clearTimeout(p)},[]),c.jsx(pe,{scope:e,isOpenDelayedRef:l,delayDuration:t,onOpen:a.useCallback(()=>{window.clearTimeout(i.current),l.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:a.useCallback(p=>{d.current=p},[]),disableHoverableContent:n,children:s})};z.displayName=F;var R="Tooltip",[fe,_]=O(R),B=o=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:d}=o,i=k(R,o.__scopeTooltip),p=D(e),[u,v]=a.useState(null),x=Q(),f=a.useRef(0),h=l??i.disableHoverableContent,T=d??i.delayDuration,g=a.useRef(!1),[y,m]=J({prop:r,defaultProp:n??!1,onChange:I=>{I?(i.onOpen(),document.dispatchEvent(new CustomEvent(A))):i.onClose(),s?.(I)},caller:R}),w=a.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),E=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,m(!0)},[m]),P=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,m(!1)},[m]),S=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,m(!0),f.current=0},T)},[T,m]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),c.jsx(Z,{...p,children:c.jsx(fe,{scope:e,contentId:x,open:y,stateAttribute:w,trigger:u,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{i.isOpenDelayedRef.current?S():E()},[i.isOpenDelayedRef,S,E]),onTriggerLeave:a.useCallback(()=>{h?P():(window.clearTimeout(f.current),f.current=0)},[P,h]),onOpen:E,onClose:P,disableHoverableContent:h,children:t})})};B.displayName=R;var L="TooltipTrigger",U=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=_(L,t),s=k(L,t),l=D(t),d=a.useRef(null),i=H(e,d,n.onTriggerChange),p=a.useRef(!1),u=a.useRef(!1),v=a.useCallback(()=>p.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),c.jsx(ee,{asChild:!0,...l,children:c.jsx(M.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:C(o.onPointerMove,x=>{x.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),u.current=!0)}),onPointerLeave:C(o.onPointerLeave,()=>{n.onTriggerLeave(),u.current=!1}),onPointerDown:C(o.onPointerDown,()=>{n.open&&n.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:C(o.onFocus,()=>{p.current||n.onOpen()}),onBlur:C(o.onBlur,n.onClose),onClick:C(o.onClick,n.onClose)})})});U.displayName=L;var N="TooltipPortal",[ve,xe]=O(N,{forceMount:void 0}),Y=o=>{const{__scopeTooltip:e,forceMount:t,children:r,container:n}=o,s=_(N,e);return c.jsx(ve,{scope:e,forceMount:t,children:c.jsx($,{present:t||s.open,children:c.jsx(te,{asChild:!0,container:n,children:r})})})};Y.displayName=N;var b="TooltipContent",W=a.forwardRef((o,e)=>{const t=xe(b,o.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=o,l=_(b,o.__scopeTooltip);return c.jsx($,{present:r||l.open,children:l.disableHoverableContent?c.jsx(q,{side:n,...s,ref:e}):c.jsx(he,{side:n,...s,ref:e})})}),he=a.forwardRef((o,e)=>{const t=_(b,o.__scopeTooltip),r=k(b,o.__scopeTooltip),n=a.useRef(null),s=H(e,n),[l,d]=a.useState(null),{trigger:i,onClose:p}=t,u=n.current,{onPointerInTransitChange:v}=r,x=a.useCallback(()=>{d(null),v(!1)},[v]),f=a.useCallback((h,T)=>{const g=h.currentTarget,y={x:h.clientX,y:h.clientY},m=ye(y,g.getBoundingClientRect()),w=Ce(y,m),E=be(T.getBoundingClientRect()),P=Ee([...w,...E]);d(P),v(!0)},[v]);return a.useEffect(()=>()=>x(),[x]),a.useEffect(()=>{if(i&&u){const h=g=>f(g,u),T=g=>f(g,i);return i.addEventListener("pointerleave",h),u.addEventListener("pointerleave",T),()=>{i.removeEventListener("pointerleave",h),u.removeEventListener("pointerleave",T)}}},[i,u,f,x]),a.useEffect(()=>{if(l){const h=T=>{const g=T.target,y={x:T.clientX,y:T.clientY},m=i?.contains(g)||u?.contains(g),w=!we(y,l);m?x():w&&(x(),p())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[i,u,l,p,x]),c.jsx(q,{...o,ref:s})}),[ge,Te]=O(R,{isInside:!1}),me=se("TooltipContent"),q=a.forwardRef((o,e)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...d}=o,i=_(b,t),p=D(t),{onClose:u}=i;return a.useEffect(()=>(document.addEventListener(A,u),()=>document.removeEventListener(A,u)),[u]),a.useEffect(()=>{if(i.trigger){const v=x=>{x.target?.contains(i.trigger)&&u()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[i.trigger,u]),c.jsx(oe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:u,children:c.jsxs(re,{"data-state":i.stateAttribute,...p,...d,ref:e,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(me,{children:r}),c.jsx(ge,{scope:t,isInside:!0,children:c.jsx(ue,{id:i.contentId,role:"tooltip",children:n||r})})]})})});W.displayName=b;var X="TooltipArrow",K=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=D(t);return Te(X,t).isInside?null:c.jsx(ae,{...n,...r,ref:e})});K.displayName=X;function ye(o,e){const t=Math.abs(e.top-o.y),r=Math.abs(e.bottom-o.y),n=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ce(o,e,t=5){const r=[];switch(e){case"top":r.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":r.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":r.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":r.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return r}function be(o){const{top:e,right:t,bottom:r,left:n}=o;return[{x:n,y:e},{x:t,y:e},{x:t,y:r},{x:n,y:r}]}function we(o,e){const{x:t,y:r}=o;let n=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const d=e[s],i=e[l],p=d.x,u=d.y,v=i.x,x=i.y;u>r!=x>r&&t<(v-p)*(r-u)/(x-u)+p&&(n=!n)}return n}function Ee(o){const e=o.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),Pe(e)}function Pe(o){if(o.length<=1)return o.slice();const e=[];for(let r=0;r<o.length;r++){const n=o[r];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const t=[];for(let r=o.length-1;r>=0;r--){const n=o[r];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var Re=z,_e=B,je=U,Oe=Y,De=W,Ae=K;function Le(o){const e=j.c(6);let t,r;e[0]!==o?({delayDuration:r,...t}=o,e[0]=o,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==t?(s=c.jsx(Re,{"data-slot":"tooltip-provider",delayDuration:n,...t}),e[3]=n,e[4]=t,e[5]=s):s=e[5],s}function Ne(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(Le,{children:c.jsx(_e,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=r):r=e[3],r}function Se(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(je,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function Ie(o){const e=j.c(13);let t,r,n,s;e[0]!==o?({className:r,sideOffset:s,children:t,...n}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=s):(t=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let d;e[5]!==r?(d=ie("notranslate bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=d):d=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(Ae,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=i):i=e[7];let p;return e[8]!==t||e[9]!==n||e[10]!==l||e[11]!==d?(p=c.jsx(Oe,{children:c.jsxs(De,{"data-slot":"tooltip-content",sideOffset:l,translate:"no",className:d,...n,children:[t,i]})}),e[8]=t,e[9]=n,e[10]=l,e[11]=d,e[12]=p):p=e[12],p}export{Se as T,le as V,Ie as a,Le as b,Ne as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,F as m,x as R,K as h,n as M}from"./index-
|
|
1
|
+
import{c as p,F as m,x as R,K as h,n as M}from"./index-CpB-IlaU.js";import{u as S,c as I}from"./studio-tools-D5VF1LfT.js";const x={anthropic:["claude-haiku-4-5","claude-haiku"],openrouter:["qwen/qwen3.5-flash","anthropic/claude-haiku-4.5","anthropic/claude-haiku","google/gemini-3-flash"],deco:["qwen/qwen3.5-flash","anthropic/claude-haiku"],llmapi:["claude-haiku-4-5","claude-haiku","gpt-4o-mini"],google:["gemini-2.5-flash","gemini-3-flash"],"claude-code":["claude-code:haiku","claude-code:sonnet"],codex:["codex:gpt-5.6-luna"]},P={anthropic:["claude-sonnet-5","claude-sonnet"],openrouter:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude-opus-4.8","google/gemini-3-pro"],deco:["anthropic/claude-sonnet-5","anthropic/claude-sonnet","anthropic/claude"],llmapi:["claude-sonnet-4-6","claude-sonnet"],google:["gemini-3-pro","gemini-3-flash"],"claude-code":["claude-code:sonnet"],codex:["codex:gpt-5.6-terra"]},D={anthropic:["claude-opus-4-8","claude-sonnet-5","claude-sonnet","claude-fable-5"],openrouter:["anthropic/claude-opus-4.8:extended","anthropic/claude-opus-4.8","anthropic/claude-sonnet-5:extended","anthropic/claude-sonnet-5","google/gemini-3-pro","anthropic/claude-fable-5"],deco:["anthropic/claude-opus","anthropic/claude-sonnet-4.6","anthropic/claude-sonnet","anthropic/claude-fable"],llmapi:["claude-opus-4-8","claude-opus","claude-sonnet-4-6"],google:["gemini-3-pro"],"claude-code":["claude-code:opus-1m","claude-code:opus","claude-code:sonnet"],codex:["codex:gpt-5.6-sol"]},A={openrouter:["openai/gpt-image-1","google/gemini-2.0-flash-image"],deco:["openai/gpt-image-1","google/gemini-2.0-flash-image"],llmapi:["gemini-2.5-flash-image","gpt-image-1"],google:["gemini-2.0-flash-image"]},L={openrouter:["perplexity/sonar","perplexity/sonar-pro"],deco:["perplexity/sonar","perplexity/sonar-pro"]},K={openrouter:["perplexity/deep-research","perplexity/sonar-pro"],deco:["perplexity/deep-research","perplexity/sonar-pro"]};function _(o){return o.toLowerCase().replace(/[^a-z0-9]/g,"")}function O(o){return _(o).includes("deepresearch")}const v=["sonar","searchpreview","online"];function y(o){const e=_(o);return e.includes("deepresearch")?!1:v.some(i=>e.includes(i))}function w(o){return o.asyncResearch!==!0&&y(o.modelId)}function T(o){return o.asyncResearch===!0||O(o.modelId)||y(o.modelId)}function u(o,e,i,n){for(const t of i){const a=o.find(s=>s.modelId===t);if(a)return{keyId:e,modelId:a.modelId,title:a.title}}for(const t of i){const a=o.find(s=>s.modelId.includes(t));if(a)return{keyId:e,modelId:a.modelId,title:a.title}}if(n){const t=o.find(n);if(t)return{keyId:e,modelId:t.modelId,title:t.title}}return null}function q(o,e){const i={chat:{fast:null,smart:null,thinking:null},image:null,webSearch:null,deepResearch:null};for(const n of o){const t=e[n.id]??[],a=n.providerId;i.chat.fast||(i.chat.fast=u(t,n.id,x[a]??[])),i.chat.smart||(i.chat.smart=u(t,n.id,P[a]??[])),i.chat.thinking||(i.chat.thinking=u(t,n.id,D[a]??[])),i.image||(i.image=u(t,n.id,A[a]??[],s=>s.capabilities?.includes("image")===!0)),i.webSearch||(i.webSearch=u(t,n.id,L[a]??[],w)),i.deepResearch||(i.deepResearch=u(t,n.id,K[a]??[],T))}return i}function C(o,e){return{queryKey:h.aiProviderKeys(e),staleTime:6e4,queryFn:async()=>await I(o,"AI_PROVIDER_KEY_LIST",{})}}function N(){const o=p.c(7),{org:e}=m(),i=S();let n;o[0]!==e.id?(n=h.aiProviders(e.id),o[0]=e.id,o[1]=n):n=o[1];let t;o[2]!==i?(t=async()=>await i.call("AI_PROVIDERS_LIST",{}),o[2]=i,o[3]=t):t=o[3];let a;o[4]!==n||o[5]!==t?(a={queryKey:n,staleTime:1/0,queryFn:t},o[4]=n,o[5]=t,o[6]=a):a=o[6];const{data:s}=R(a);return s}function Q(){const o=p.c(5),{org:e}=m();let i;o[0]!==e.id||o[1]!==e.slug?(i=C(e.slug,e.id),o[0]=e.id,o[1]=e.slug,o[2]=i):i=o[2];const{data:n}=R(i);let t;return o[3]!==n?.keys?(t=n?.keys??[],o[3]=n?.keys,o[4]=t):t=o[4],t}function E(o){const e=p.c(15),{org:i}=m(),n=S();let t;e[0]!==o||e[1]!==i.id?(t=h.aiProviderModels(i.id,o??""),e[0]=o,e[1]=i.id,e[2]=t):t=e[2];const a=!!o;let s;e[3]!==o||e[4]!==n?(s=async()=>await n.call("AI_PROVIDERS_LIST_MODELS",{keyId:o??""}),e[3]=o,e[4]=n,e[5]=s):s=e[5];let c;e[6]!==t||e[7]!==a||e[8]!==s?(c={queryKey:t,enabled:a,staleTime:6e4,queryFn:s},e[6]=t,e[7]=a,e[8]=s,e[9]=c):c=e[9];const{data:l,isLoading:d}=M(c);let r;e[10]!==l?.models?(r=l?.models??[],e[10]=l?.models,e[11]=r):r=e[11];const g=!!o&&d;let f;return e[12]!==r||e[13]!==g?(f={models:r,isLoading:g},e[12]=r,e[13]=g,e[14]=f):f=e[14],f}function $(o){const e=p.c(8),i=o[0],n=o[1],t=o[2],{models:a}=E(i?.id),{models:s}=E(n?.id),{models:c}=E(t?.id);let l;if(e[0]!==i||e[1]!==n||e[2]!==t||e[3]!==o||e[4]!==a||e[5]!==s||e[6]!==c){const d={};i?.id&&(d[i.id]=a),n?.id&&(d[n.id]=s),t?.id&&(d[t.id]=c),l=q(o,d),e[0]=i,e[1]=n,e[2]=t,e[3]=o,e[4]=a,e[5]=s,e[6]=c,e[7]=l}else l=e[7];return l}function H(o){const e=p.c(11),{org:i}=m(),n=S();let t;e[0]!==o||e[1]!==i.id?(t=h.aiProviderModels(i.id,o),e[0]=o,e[1]=i.id,e[2]=t):t=e[2];let a;e[3]!==o||e[4]!==n?(a=async()=>await n.call("AI_PROVIDERS_LIST_MODELS",{keyId:o}),e[3]=o,e[4]=n,e[5]=a):a=e[5];let s;e[6]!==t||e[7]!==a?(s={queryKey:t,staleTime:6e4,queryFn:a},e[6]=t,e[7]=a,e[8]=s):s=e[8];const{data:c}=R(s);let l;return e[9]!==c?.models?(l=c?.models??[],e[9]=c?.models,e[10]=l):l=e[10],l}export{$ as a,E as b,T as c,N as d,H as e,w as i,q as p,Q as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as U,F as q,K as T,n as I,o as x,e as y,t as m}from"./index-
|
|
1
|
+
import{c as U,F as q,K as T,n as I,o as x,e as y,t as m}from"./index-CpB-IlaU.js";import{S as z,u as J}from"./use-mcp-client-nWQQesMe.js";import{u as Q}from"./studio-tools-D5VF1LfT.js";function V(t){if(t.paramsSchema&&typeof t.paramsSchema=="object")return t;const e={};if(Array.isArray(t.params))for(const s of t.params)e[s.name]={type:s.type,description:s.description,enum:s.enum};else t.params&&typeof t.params=="object"&&Object.assign(e,t.params);return{type:t.type,description:t.description,paramsSchema:e}}function st(t){const e=U.c(12),{org:s}=q(),l=t??z;let a;e[0]!==s.id||e[1]!==s.slug||e[2]!==l?(a={connectionId:l,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=l,e[3]=a):a=e[3];const i=J(a);let n;e[4]!==t?(n=T.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=n):n=e[5];let o;e[6]!==i?(o=async()=>{const d=await i.callTool({name:"TRIGGER_LIST",arguments:{}});return(d.structuredContent??d).triggers.map(V)},e[6]=i,e[7]=o):o=e[7];const c=!!t;let r;return e[8]!==n||e[9]!==o||e[10]!==c?(r={queryKey:n,queryFn:o,enabled:c,staleTime:3e4},e[8]=n,e[9]=o,e[10]=c,e[11]=r):r=e[11],I(r)}function it(t){const e=U.c(9),{org:s}=q(),l=Q();let a;e[0]!==s.id||e[1]!==t?(a=T.automations(s.id,t),e[0]=s.id,e[1]=t,e[2]=a):a=e[2];let i;e[3]!==l||e[4]!==t?(i=async()=>(await l.call("AUTOMATION_LIST",t!=null?{virtual_mcp_id:t}:{})).automations,e[3]=l,e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==a||e[7]!==i?(n={queryKey:a,queryFn:i,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n):n=e[8],I(n)}function ot(t){const e=U.c(10),{org:s}=q(),l=Q();let a;e[0]!==t||e[1]!==s.id?(a=T.automation(s.id,t),e[0]=t,e[1]=s.id,e[2]=a):a=e[2];let i;e[3]!==t||e[4]!==l?(i=async()=>(await l.call("AUTOMATION_GET",{id:t})).automation,e[3]=t,e[4]=l,e[5]=i):i=e[5];const n=!!t;let o;return e[6]!==a||e[7]!==i||e[8]!==n?(o={queryKey:a,queryFn:i,enabled:n,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n,e[9]=o):o=e[9],I(o)}function at(t,e){const s=U.c(12),{org:l}=q(),a=Q();let i;s[0]!==t||s[1]!==l.id||s[2]!==e?(i=T.automationRunStats(l.id,t,JSON.stringify(e??{})),s[0]=t,s[1]=l.id,s[2]=e,s[3]=i):i=s[3];let n;s[4]!==t||s[5]!==e||s[6]!==a?(n=async()=>await a.call("AUTOMATION_RUN_STATS",{automation_id:t,...e?.startDate?{startDate:e.startDate}:{},...e?.endDate?{endDate:e.endDate}:{}}),s[4]=t,s[5]=e,s[6]=a,s[7]=n):n=s[7];const o=!!t;let c;return s[8]!==i||s[9]!==n||s[10]!==o?(c={queryKey:i,queryFn:n,enabled:o,staleTime:3e4},s[8]=i,s[9]=n,s[10]=o,s[11]=c):c=s[11],I(c)}function nt(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function lt(){const t=U.c(64),{org:e}=q(),s=Q(),l=x();let a;t[0]!==e||t[1]!==l?(a=()=>l.invalidateQueries({queryKey:T.automationsAll(e.id)}),t[0]=e,t[1]=l,t[2]=a):a=t[2];const i=a;let n;t[3]!==e||t[4]!==l?(n=u=>l.invalidateQueries({queryKey:T.automation(e.id,u)}),t[3]=e,t[4]=l,t[5]=n):n=t[5];const o=n;let c;t[6]!==s?(c=async u=>await s.call("AUTOMATION_CREATE",u),t[6]=s,t[7]=c):c=t[7];let r;t[8]!==i?(r=()=>{i(),m.success("Automation created successfully")},t[8]=i,t[9]=r):r=t[9];let d;t[10]!==c||t[11]!==r?(d={mutationFn:c,onSuccess:r,onError:X},t[10]=c,t[11]=r,t[12]=d):d=t[12];const D=y(d);let A;t[13]!==s?(A=async u=>await s.call("AUTOMATION_UPDATE",u),t[13]=s,t[14]=A):A=t[14];let p;t[15]!==i||t[16]!==o?(p=(u,f)=>{i(),typeof f.id=="string"&&o(f.id),m.success("Automation updated successfully")},t[15]=i,t[16]=o,t[17]=p):p=t[17];let G;t[18]!==A||t[19]!==p?(G={mutationFn:A,onSuccess:p,onError:W},t[18]=A,t[19]=p,t[20]=G):G=t[20];const j=y(G);let g;t[21]!==s?(g=async u=>await s.call("AUTOMATION_DELETE",{id:u}),t[21]=s,t[22]=g):g=t[22];let _;t[23]!==i||t[24]!==e||t[25]!==l?(_=(u,f)=>{l.removeQueries({queryKey:T.automation(e.id,f)}),i(),m.success("Automation deleted successfully")},t[23]=i,t[24]=e,t[25]=l,t[26]=_):_=t[26];let $;t[27]!==g||t[28]!==_?($={mutationFn:g,onSuccess:_,onError:H},t[27]=g,t[28]=_,t[29]=$):$=t[29];const k=y($);let S;t[30]!==s?(S=async u=>await s.call("AUTOMATION_TRIGGER_ADD",u),t[30]=s,t[31]=S):S=t[31];let E;t[32]!==i||t[33]!==o?(E=u=>{i(),o(u.automation_id)},t[32]=i,t[33]=o,t[34]=E):E=t[34];let K;t[35]!==S||t[36]!==E?(K={mutationFn:S,onSuccess:E},t[35]=S,t[36]=E,t[37]=K):K=t[37];const P=y(K);let O;t[38]!==s?(O=async u=>await s.call("AUTOMATION_TRIGGER_ROTATE_TOKEN",{trigger_id:u.trigger_id}),t[38]=s,t[39]=O):O=t[39];let R;t[40]!==i||t[41]!==o?(R=(u,f)=>{i(),o(f.automation_id)},t[40]=i,t[41]=o,t[42]=R):R=t[42];let C;t[43]!==O||t[44]!==R?(C={mutationFn:O,onSuccess:R},t[43]=O,t[44]=R,t[45]=C):C=t[45];const h=y(C);let F;t[46]!==s?(F=async u=>await s.call("AUTOMATION_TRIGGER_REMOVE",{trigger_id:u.trigger_id}),t[46]=s,t[47]=F):F=t[47];let N;t[48]!==i||t[49]!==o?(N=(u,f)=>{i(),o(f.automation_id)},t[48]=i,t[49]=o,t[50]=N):N=t[50];let b;t[51]!==F||t[52]!==N?(b={mutationFn:F,onSuccess:N},t[51]=F,t[52]=N,t[53]=b):b=t[53];const v=y(b);let L;t[54]!==s?(L={mutationFn:async u=>await s.call("AUTOMATION_RUN",{id:u}),onSuccess:B,onError:Y},t[54]=s,t[55]=L):L=t[55];const w=y(L);let M;return t[56]!==D||t[57]!==k||t[58]!==w||t[59]!==P||t[60]!==v||t[61]!==h||t[62]!==j?(M={create:D,update:j,remove:k,triggerAdd:P,triggerRemove:v,triggerRotateToken:h,run:w},t[56]=D,t[57]=k,t[58]=w,t[59]=P,t[60]=v,t[61]=h,t[62]=j,t[63]=M):M=t[63],M}function Y(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to run automation: ${e}`)}function B(t){t.skipped?m.info(`Automation skipped: ${t.skipped}`):t.error?m.error(`Automation failed: ${t.error}`):m.success("Automation triggered")}function H(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to delete automation: ${e}`)}function W(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to update automation: ${e}`)}function X(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to create automation: ${e}`)}export{st as a,ot as b,it as c,nt as d,at as e,lt as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as T,r as o}from"./index-
|
|
1
|
+
import{c as T,r as o}from"./index-CpB-IlaU.js";const y=700;function x(r,l,_){const e=T.c(7),f=y,[a,m]=o.useState(r),[i,S]=o.useState(r),[A,d]=o.useState(!1),t=o.useRef(null);r!==i&&(S(r),A||m(r));let s;e[0]!==f||e[1]!==l?(s=u=>{m(u),d(!0),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null,d(!1),l(u)},f)},e[0]=f,e[1]=l,e[2]=s):s=e[2];const p=s;let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=u=>{m(u),t.current&&clearTimeout(t.current),t.current=null,d(!1)},e[3]=c):c=e[3];const E=c;let n;return e[4]!==a||e[5]!==p?(n=[a,p,E],e[4]=a,e[5]=p,e[6]=n):n=e[6],n}export{x as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,F as m,n as g,K as p}from"./index-
|
|
1
|
+
import{c as u,F as m,n as g,K as p}from"./index-CpB-IlaU.js";const b=new Set(["owner","admin"]);function d(){const e=u.c(11),{org:r,locator:c}=m();let o;e[0]!==c?(o=p.myCapabilities(c),e[0]=c,e[1]=o):o=e[1];let a;e[2]!==r?(a=async()=>{const f=await fetch(`/api/auth/custom/my-capabilities/${encodeURIComponent(r.slug)}`,{credentials:"include"});if(!f.ok)throw new Error(`my-capabilities request failed: ${f.status}`);return await f.json()},e[2]=r,e[3]=a):a=e[3];let i;e[4]!==o||e[5]!==a?(i={queryKey:o,queryFn:a,staleTime:3e4,retry:2},e[4]=o,e[5]=a,e[6]=i):i=e[6];const{data:s,isLoading:l,isError:n}=g(i);let t;return e[7]!==s||e[8]!==n||e[9]!==l?(t={data:s,loading:l,error:n},e[7]=s,e[8]=n,e[9]=l,e[10]=t):t=e[10],t}function _(e){const r=u.c(8),{data:c,loading:o,error:a}=d();if(o){let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!0,error:!1,reason:"loading"},r[0]=t):t=r[0],t}if(a){let t;return r[1]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!1,error:!0,reason:"error"},r[1]=t):t=r[1],t}const i=c?.role??null;if(!i){let t;return r[2]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!1,error:!1,reason:"denied"},r[2]=t):t=r[2],t}if(i==="owner"){let t;return r[3]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!0,loading:!1,error:!1,reason:"owner"},r[3]=t):t=r[3],t}if(i==="admin"){let t;return r[4]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!0,loading:!1,error:!1,reason:"admin"},r[4]=t):t=r[4],t}const s=c?.capabilities?.[e]===!0,l=s?"role":"denied";let n;return r[5]!==s||r[6]!==l?(n={granted:s,loading:!1,error:!1,reason:l},r[5]=s,r[6]=l,r[7]=n):n=r[7],n}function S(){const e=u.c(10),{data:r,loading:c,error:o}=d(),a=r?.role??void 0;let i;e[0]!==a?(i=a?b.has(a):!1,e[0]=a,e[1]=i):i=e[1];const s=i;let l;e[2]!==r?.capabilities?(l=r?.capabilities??{},e[2]=r?.capabilities,e[3]=l):l=e[3];const n=l;let t;return e[4]!==o||e[5]!==s||e[6]!==c||e[7]!==a||e[8]!==n?(t={capabilities:n,loading:c,error:o,isPrivileged:s,roleSlug:a},e[4]=o,e[5]=s,e[6]=c,e[7]=a,e[8]=n,e[9]=t):t=e[9],t}export{S as a,_ as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as a}from"./AlertCircle-
|
|
1
|
+
import{i as a}from"./AlertCircle-DCV-J_17.js";import{i as c}from"./CheckCircle-DUp67_eI.js";import{i as u}from"./DotsVertical-DpBcrugn.js";import{aY as m}from"./agent-icon-dfCTMRkW.js";import{k as b,c as d,r as f}from"./index-CpB-IlaU.js";import{a as p}from"./XCircle-CsSTNWPK.js";const g={requires_action:{label:"Needs review",verb:"Waiting for your review",icon:a,iconClassName:"text-warning",labelColor:"text-warning"},failed:{label:"Failed",verb:"Something went wrong",icon:p,iconClassName:"text-destructive",labelColor:"text-destructive"},expired:{label:"Timed out",verb:"Stopped responding",icon:m,iconClassName:"text-warning",labelColor:"text-warning"},in_progress:{label:"Running",verb:"Agent is working",icon:b,iconClassName:"text-primary",labelColor:"text-primary"},completed:{label:"Done",verb:"Completed",icon:c,iconClassName:"text-muted-foreground/50",labelColor:"text-muted-foreground"}},v={label:"Unknown",verb:"Unknown status",icon:u,iconClassName:"text-muted-foreground",labelColor:"text-muted-foreground"};function y(r){return g[r??"completed"]??v}const i=new Map;function s(r){let t=i.get(r);return t||(t={tick:0,subscribers:new Set,intervalId:null},i.set(r,t)),t}function x(r,t){const e=s(r);return e.subscribers.add(t),e.intervalId===null&&(e.intervalId=setInterval(()=>{e.tick+=1;for(const o of e.subscribers)o()},r)),()=>{e.subscribers.delete(t),e.subscribers.size===0&&e.intervalId!==null&&(clearInterval(e.intervalId),e.intervalId=null)}}function T(r){const t=d.c(3),e=r===void 0?6e4:r;let o,n;return t[0]!==e?(o=l=>x(e,l),n=()=>s(e).tick,t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),f.useSyncExternalStore(o,n,C)}function C(){return 0}export{g as S,y as g,T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,F as C,dR as S,b5 as p,b4 as T}from"./index-
|
|
1
|
+
import{c as f,F as C,dR as S,b5 as p,b4 as T}from"./index-CpB-IlaU.js";import{S as I,u as A}from"./use-mcp-client-nWQQesMe.js";function v(t){const o=f.c(20);let i;o[0]!==t?(i=t===void 0?{}:t,o[0]=t,o[1]=i):i=o[1];const n=i;let l,s,c,d;o[2]!==n?({binding:l,includeVirtual:c,slug:d,...s}=n,o[2]=n,o[3]=l,o[4]=s,o[5]=c,o[6]=d):(l=o[3],s=o[4],c=o[5],d=o[6]);let e;o[7]!==l||o[8]!==s.additionalToolArgs||o[9]!==c||o[10]!==d?(e={...s.additionalToolArgs},l!==void 0&&(e.binding=l),c!==void 0&&(e.include_virtual=c),d!==void 0&&(e.slug=d),o[7]=l,o[8]=s.additionalToolArgs,o[9]=c,o[10]=d,o[11]=e):e=o[11];let g;o[12]!==e?(g=Object.keys(e).length>0?e:void 0,o[12]=e,o[13]=g):g=o[13];let r;o[14]!==s||o[15]!==g?(r={...s,additionalToolArgs:g},o[14]=s,o[15]=g,o[16]=r):r=o[16];const N=r,{org:u}=C();let a;o[17]!==u.id||o[18]!==u.slug?(a={connectionId:I,orgId:u.id,orgSlug:u.slug},o[17]=u.id,o[18]=u.slug,o[19]=a):a=o[19];const O=A(a);return S(u.id,"CONNECTIONS",O,N)}function E(t){const o=f.c(3),{org:i}=C();let n;o[0]!==i.id||o[1]!==i.slug?(n={connectionId:I,orgId:i.id,orgSlug:i.slug},o[0]=i.id,o[1]=i.slug,o[2]=n):n=o[2];const l=A(n);return T(i.id,"CONNECTIONS",t,l)}function _(){const t=f.c(3),{org:o}=C();let i;t[0]!==o.id||t[1]!==o.slug?(i={connectionId:I,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=i):i=t[2];const n=A(i);return p(o.id,"CONNECTIONS",n)}export{E as a,_ as b,v as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as i,r as n}from"./index-
|
|
1
|
+
import{c as i,r as n}from"./index-CpB-IlaU.js";function p(){const e=i.c(3),[s,a]=n.useState(!1);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=async c=>{await navigator.clipboard.writeText(c),a(!0),setTimeout(()=>a(!1),2e3)},e[0]=t):t=e[0];const r=t;let o;return e[1]!==s?(o={handleCopy:r,copied:s},e[1]=s,e[2]=o):o=e[2],o}export{p as u};
|
package/dist/client/assets/{use-create-virtual-mcp-DRsz9AB6.js → use-create-virtual-mcp-Csg7y6O0.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g}from"./index-
|
|
1
|
+
import{c as g}from"./index-CpB-IlaU.js";import{b as f}from"./use-virtual-mcp-BWv80DLH.js";import{c as p}from"./use-navigate-to-agent-DuvGIrZp.js";function A(i){const e=g.c(9);let n;e[0]!==i?(n=i===void 0?{}:i,e[0]=i,e[1]=n):n=e[1];const d=n,{navigateOnCreate:u}=d,c=u===void 0?!1:u,t=f(),r=p();let s;e[2]!==t.create||e[3]!==c||e[4]!==r?(s=async()=>{const l=await t.create.mutateAsync({title:"New Agent",description:"AI-driven assistant designed to handle specific tasks",status:"active",connections:[],pinned:!1});return c&&r(l.id,{search:{main:"instructions"}}),{id:l.id,virtualMcp:l}},e[2]=t.create,e[3]=c,e[4]=r,e[5]=s):s=e[5];const o=s;let a;return e[6]!==t.create.isPending||e[7]!==o?(a={createVirtualMCP:o,isCreating:t.create.isPending},e[6]=t.create.isPending,e[7]=o,e[8]=a):a=e[8],a}export{A as u};
|
package/dist/client/assets/{use-debounced-autosave-BIQxdqd3.js → use-debounced-autosave-DKkHA0__.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u}from"./index-
|
|
1
|
+
import{r as u}from"./index-CpB-IlaU.js";function l({save:t,delayMs:n=1e3}){const e=u.useRef(t);e.current=t;const r=u.useRef(null),c=()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,e.current()},n)},o=()=>(r.current&&(clearTimeout(r.current),r.current=null),e.current());return u.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null,e.current())},[]),{schedule:c,flush:o}}export{l as u};
|
package/dist/client/assets/{use-debounced-value-C_bgLTBF.js → use-debounced-value-CbBPU7zd.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,r as n}from"./index-
|
|
1
|
+
import{c as m,r as n}from"./index-CpB-IlaU.js";function p(e,o){const t=m.c(4),[s,u]=n.useState(e);let c,r;return t[0]!==o||t[1]!==e?(c=()=>{const i=setTimeout(()=>u(e),o);return()=>clearTimeout(i)},r=[e,o],t[0]=o,t[1]=e,t[2]=c,t[3]=r):(c=t[2],r=t[3]),n.useEffect(c,r),s}export{p as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{X as Kt,Y as Ut,c as F,b as V,Z as pt,_ as ht,e as Gt,j as t,a as ae,B as ne,r as H,aJ as qt,d as st,s as Xt,m as X,t as K,w as Wt,k as ke,p as R,F as oe,f as ot,u as it,L as Qt,D as Yt,I as Jt,G as Zt,K as at,o as en,n as tn}from"./index-DhQ57Kmj.js";import{t as xt}from"./ChevronDown-0c4JTfKo.js";import{A as jt,j as nn,a5 as sn}from"./agent-icon-DWi24TTu.js";import{T as Ce,a as ye,c as Se}from"./tooltip-6w046nYq.js";import{u as vt,d as bt,c as Ct}from"./sidebar-D2O9mFrR.js";import{a as rt,i as on,f as an,S as rn,u as ln}from"./use-mcp-client-DwSe9g39.js";import{a as cn,u as dn}from"./use-virtual-mcp-CJk53fJS.js";import{a as Le,b as yt,P as St}from"./popover-BS1i8F97.js";import{i as Ee}from"./Check-DkFHuFLF.js";import{s as we}from"./Plus-DkFmTenT.js";import{i as wt}from"./SearchMd-Dw__bMQL.js";import{s as Nt}from"./XClose-CVsPcXcu.js";import{c as un,d as mn,b as fn,f as gn,e as pn,a as hn,A as xn}from"./alert-dialog-B-llqpWI.js";import{F as Q,a as nt,b as Y,c as J,d as Z,f as jn,e as ee}from"./form-D8QeZ7pX.js";import{I as ie}from"./input-BGezAoQv.js";import{S as vn}from"./chat-context-CyqVD46W.js";import{T as _t}from"./toolbar-JAAWukon.js";import{S as bn}from"./skeleton-DfGDbM3d.js";import{D as Dt,a as kt,b as At,c as Cn,e as yn,f as Sn,g as wn}from"./drawer-DlBnFiCv.js";import{u as It}from"./use-mobile-CG_e5dV7.js";import{a as Nn,G as _n}from"./github-repo-picker-OygxwRVl.js";import{g as Dn,b as kn,a as Pt}from"./hooks-CECShH7l.js";import{u as An,g as In,a as Pn,b as Tn}from"./use-navigate-to-agent-BS49KKxO.js";import{a as On,c as Tt}from"./agent-capabilities-cXfbMfjV.js";import{u as Ot}from"./shell-layout-BSJLlqlV.js";import{f as zn}from"./reusable-new-chat-CouMjkYR.js";import{C as Mn}from"./collection-search-C3BI3cuC.js";import{g as Fn,a as $n,b as Bn,e as Ln}from"./extract-connection-data-Tgh5h2_A.js";import{u as zt,a as Mt,g as En,C as Ye}from"./connection-card-_xuRZak3.js";import{e as Ft,d as $t,a as Bt,b as Lt,h as Vn,c as Rn}from"./dialog-n-VT2LyW.js";import{S as Hn,a as Kn,b as Un,c as Gn,d as De}from"./select-Dr9e7ugT.js";import{T as qn}from"./textarea-Cx10FRoR.js";import{b as Et}from"./use-connection-C7HDIsYy.js";import{a as Be,b as Je}from"./Tool02--hye3IZs.js";import{s as Ze}from"./Star01-D41babtl.js";import{c as Xn,i as Fe,a as ut,E as Wn,p as Qn,b as Yn,d as Jn}from"./connection-form-helpers-CjHyiwck.js";import{a as et}from"./authenticate-and-persist-oauth-CcvwqhHu.js";import{g as Zn}from"./connection-slug-eyAPH6o3.js";import{C as es}from"./collection-tabs-CEjSI5Dj.js";import{u as mt}from"./use-infinite-scroll-BoPeF6JW.js";import{B as $e}from"./badge-DtF9O2dM.js";import{u as ts}from"./useSuspenseInfiniteQuery-BFsn9Uf-.js";import{g as Ve}from"./metadata-dUsYcpuu.js";import{u as ns}from"./studio-tools-BYeIs48m.js";import{u as ss}from"./use-ai-providers-DMroHl1L.js";function ft(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const os=Kt({name:Ut().min(2,"Organization name is required")});function is(n){const e=F.c(66),{open:s,onOpenChange:o}=n,i=V();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={resolver:pt(os),defaultValues:{name:""}},e[0]=a):a=e[0];const r=ht(a);let d;e[1]!==i?(d=async E=>{const M=ft(E.name);if(!M)throw new Error(i("common.createOrganizationDialog.invalidSlug"));const G=await ae.organization.create({name:E.name,slug:M});if(G?.error)throw new Error(G.error.message||i("common.createOrganizationDialog.failedToCreate"));const U=G?.data?.slug??M;if(!U)throw new Error(i("common.createOrganizationDialog.failedToCreate"));return{orgSlug:U}},e[1]=i,e[2]=d):d=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=as,e[3]=c):c=e[3];let m;e[4]!==d?(m={mutationFn:d,onSuccess:c},e[4]=d,e[5]=m):m=e[5];const u=Gt(m);let p;e[6]!==u.error||e[7]!==i?(p=u.error instanceof Error?u.error.message:u.error?i("common.createOrganizationDialog.failedToCreateGeneric"):null,e[6]=u.error,e[7]=i,e[8]=p):p=e[8];const l=p;let x;e[9]!==i?(x=i("common.createOrganizationDialog.title"),e[9]=i,e[10]=x):x=e[10];let y;e[11]!==x?(y=t.jsx(un,{children:x}),e[11]=x,e[12]=y):y=e[12];let h;e[13]!==i?(h=i("common.createOrganizationDialog.description"),e[13]=i,e[14]=h):h=e[14];let f;e[15]!==h?(f=t.jsx(mn,{children:h}),e[15]=h,e[16]=f):f=e[16];let j;e[17]!==y||e[18]!==f?(j=t.jsxs(fn,{children:[y,f]}),e[17]=y,e[18]=f,e[19]=j):j=e[19];let v;if(e[20]!==u||e[21]!==r){let E;e[23]!==u?(E=M=>u.mutateAsync(M),e[23]=u,e[24]=E):E=e[24],v=r.handleSubmit(E),e[20]=u,e[21]=r,e[22]=v}else v=e[22];let b;e[25]!==r.formState.isSubmitting||e[26]!==i?(b=E=>{const{field:M}=E;return t.jsxs(Y,{children:[t.jsx(J,{children:i("common.createOrganizationDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(ie,{...M,placeholder:i("common.createOrganizationDialog.namePlaceholder"),disabled:r.formState.isSubmitting})}),t.jsx(jn,{children:i("common.createOrganizationDialog.nameDescription")}),M.value&&t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[i("common.createOrganizationDialog.urlLabel")," ",t.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",ft(M.value)]})]}),t.jsx(ee,{})]})},e[25]=r.formState.isSubmitting,e[26]=i,e[27]=b):b=e[27];let w;e[28]!==r.control||e[29]!==b?(w=t.jsx(Q,{control:r.control,name:"name",render:b}),e[28]=r.control,e[29]=b,e[30]=w):w=e[30];let N;e[31]!==l?(N=l&&t.jsx("div",{className:"text-destructive text-sm mt-2",children:l}),e[31]=l,e[32]=N):N=e[32];const P=r.formState.isSubmitting;let O;e[33]!==u||e[34]!==r?(O=()=>{u.reset(),r.reset()},e[33]=u,e[34]=r,e[35]=O):O=e[35];let g;e[36]!==i?(g=i("common.createOrganizationDialog.cancel"),e[36]=i,e[37]=g):g=e[37];let _;e[38]!==r.formState.isSubmitting||e[39]!==O||e[40]!==g?(_=t.jsx(gn,{disabled:P,onClick:O,children:g}),e[38]=r.formState.isSubmitting,e[39]=O,e[40]=g,e[41]=_):_=e[41];const T=!r.formState.isValid||r.formState.isSubmitting;let S;e[42]!==r.formState.isSubmitting||e[43]!==i?(S=r.formState.isSubmitting?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(vn,{size:"xs"})," ",i("common.createOrganizationDialog.creating")]}):i("common.createOrganizationDialog.createButton"),e[42]=r.formState.isSubmitting,e[43]=i,e[44]=S):S=e[44];let C;e[45]!==T||e[46]!==S?(C=t.jsx(ne,{type:"submit",variant:"default",disabled:T,children:S}),e[45]=T,e[46]=S,e[47]=C):C=e[47];let I;e[48]!==_||e[49]!==C?(I=t.jsxs(pn,{children:[_,C]}),e[48]=_,e[49]=C,e[50]=I):I=e[50];let k;e[51]!==v||e[52]!==w||e[53]!==N||e[54]!==I?(k=t.jsxs("form",{className:"space-y-6",onSubmit:v,autoComplete:"off",children:[w,N,I]}),e[51]=v,e[52]=w,e[53]=N,e[54]=I,e[55]=k):k=e[55];let A;e[56]!==r||e[57]!==k?(A=t.jsx(nt,{...r,children:k}),e[56]=r,e[57]=k,e[58]=A):A=e[58];let z;e[59]!==j||e[60]!==A?(z=t.jsxs(hn,{children:[j,A]}),e[59]=j,e[60]=A,e[61]=z):z=e[61];let L;return e[62]!==o||e[63]!==s||e[64]!==z?(L=t.jsx(xn,{open:s,onOpenChange:o,children:z}),e[62]=o,e[63]=s,e[64]=z,e[65]=L):L=e[65],L}function as(n){const{orgSlug:e}=n;window.location.href=`/${e}`}function Vt(){const n=H.useContext(qt),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(i=>i.status==="pending"&&new Date(i.expiresAt)>new Date),refetch:()=>s?.()}}function rs(n){let e=0;for(let o=0;o<n.length;o++)e=n.charCodeAt(o)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function lt(n){const e=F.c(13),{org:s,size:o}=n,i=o===void 0?"sm":o,a=i==="xs"?"size-5":"size-6",r=i==="xs"?"text-[9px]":"text-xs";let d;e[0]!==a?(d=X(a,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=a,e[1]=d):d=e[1];let c;e[2]!==s.logo||e[3]!==s.name?(c=s.logo?void 0:rs(s.name),e[2]=s.logo,e[3]=s.name,e[4]=c):c=e[4];let m;e[5]!==s.logo||e[6]!==s.name||e[7]!==r?(m=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:X("font-semibold leading-none",r),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=r,e[8]=m):m=e[8];let u;return e[9]!==d||e[10]!==c||e[11]!==m?(u=t.jsx("div",{className:d,style:c,children:m}),e[9]=d,e[10]=c,e[11]=m,e[12]=u):u=e[12],u}function ls({invitation:n,onChanged:e}){const s=V(),[o,i]=H.useState(!1),a=n.organizationName??s("header.orgSwitcher.unknownOrganization"),r=async()=>{i(!0);try{const m=await ae.organization.acceptInvitation({invitationId:n.id});if(m.error){K.error(m.error.message),i(!1);return}}catch{K.error(s("header.orgSwitcher.failedToAcceptInvitation")),i(!1);return}K.success(s("header.orgSwitcher.joined",{name:a})),Wt();let c;try{c=(await ae.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},d=async()=>{i(!0);try{const c=await ae.organization.rejectInvitation({invitationId:n.id});if(c.error){K.error(c.error.message),i(!1);return}K.success(s("header.orgSwitcher.invitationDeclined")),i(!1),e()}catch{K.error(s("header.orgSwitcher.failedToDeclineInvitation")),i(!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(lt,{org:{name:a},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:a}),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:r,disabled:o,children:s("header.orgSwitcher.accept")}),t.jsx(ne,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:d,disabled:o,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:a}),children:t.jsx(Nt,{size:14})})]})]})}function cs(n){const e=F.c(32),{orgParam:s,onSelectOrg:o,onCreateOrg:i}=n,a=V(),{data:r}=Xt(),{invitations:d,refetch:c}=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=[...r??[]].sort(m),[p,l]=H.useState(""),x=p.toLowerCase(),y=x?u.filter(k=>k.name.toLowerCase().includes(x)||k.slug.toLowerCase().includes(x)):u;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(wt,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=h):h=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=k=>l(k.target.value),e[3]=f):f=e[3];let j;e[4]!==p?(j=k=>k.key==="Escape"&&p&&l(""),e[4]=p,e[5]=j):j=e[5];let v;e[6]!==a?(v=a("header.orgSwitcher.searchOrganizations"),e[6]=a,e[7]=v):v=e[7];let b;e[8]!==p||e[9]!==j||e[10]!==v?(b=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:p,onChange:f,onKeyDown:j,placeholder:v,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]=v,e[11]=b):b=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]!==i?(N=t.jsx("button",{type:"button",onClick:i,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]=i,e[14]=N):N=e[14];let P;e[15]!==b||e[16]!==N?(P=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[h,b,N]}),e[15]=b,e[16]=N,e[17]=P):P=e[17];const O="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let g;e[18]!==d||e[19]!==p||e[20]!==c?(g=!p&&d.map(k=>t.jsx(ls,{invitation:k,onChanged:c},k.id)),e[18]=d,e[19]=p,e[20]=c,e[21]=g):g=e[21];const _=y.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:p?a("header.orgSwitcher.noOrganizationsMatch",{query:p}):a("header.orgSwitcher.noOrganizationsAvailable")});let T;e[22]!==o||e[23]!==s?(T=k=>t.jsxs("button",{type:"button",onClick:()=>o(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(lt,{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]=o,e[23]=s,e[24]=T):T=e[24];const S=y.map(T);let C;e[25]!==g||e[26]!==_||e[27]!==S?(C=t.jsxs("div",{className:O,children:[g,_,S]}),e[25]=g,e[26]=_,e[27]=S,e[28]=C):C=e[28];let I;return e[29]!==C||e[30]!==P?(I=t.jsxs(t.Fragment,{children:[P,C]}),e[29]=C,e[30]=P,e[31]=I):I=e[31],I}function ds(n){const e=F.c(22),{trigger:s,orgParam:o,align:i,side:a}=n,r=i===void 0?"start":i,d=a===void 0?"bottom":a,c=st(),[m,u]=H.useState(!1),[p,l]=H.useState(!1);let x;e[0]!==s?(x=t.jsx(Le,{asChild:!0,children:s}),e[0]=s,e[1]=x):x=e[1];const y=String(m);let h;e[2]!==c?(h=P=>{u(!1),c({to:"/$org",params:{org:P}})},e[2]=c,e[3]=h):h=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{u(!1),l(!0)},e[4]=f):f=e[4];let j;e[5]!==o||e[6]!==y||e[7]!==h?(j=t.jsx(cs,{orgParam:o,onSelectOrg:h,onCreateOrg:f},y),e[5]=o,e[6]=y,e[7]=h,e[8]=j):j=e[8];let v;e[9]!==r||e[10]!==d||e[11]!==j?(v=t.jsx(yt,{side:d,align:r,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:ms,onCloseAutoFocus:us,children:j}),e[9]=r,e[10]=d,e[11]=j,e[12]=v):v=e[12];let b;e[13]!==m||e[14]!==x||e[15]!==v?(b=t.jsxs(St,{open:m,onOpenChange:u,children:[x,v]}),e[13]=m,e[14]=x,e[15]=v,e[16]=b):b=e[16];let w;e[17]!==p?(w=t.jsx(is,{open:p,onOpenChange:l}),e[17]=p,e[18]=w):w=e[18];let N;return e[19]!==w||e[20]!==b?(N=t.jsxs(t.Fragment,{children:[b,w]}),e[19]=w,e[20]=b,e[21]=N):N=e[21],N}function us(n){return n.preventDefault()}function ms(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function fs(n){const e=F.c(21),{value:s,onChange:o,placeholder:i,onKeyDown:a,className:r,isSearching:d,disabled:c}=n,m=i===void 0?"Search...":i;let u;e[0]!==r?(u=X("shrink-0 w-full border-b border-border h-12",r),e[0]=r,e[1]=u):u=e[1];const p=c?"cursor-not-allowed opacity-50":"cursor-text";let l;e[2]!==p?(l=X("flex items-center gap-2.5 h-12 px-4",p),e[2]=p,e[3]=l):l=e[3];let x;e[4]!==d?(x=d?t.jsx(ke,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(wt,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=d,e[5]=x):x=e[5];let y;e[6]!==o?(y=v=>o(v.target.value),e[6]=o,e[7]=y):y=e[7];let h;e[8]!==c||e[9]!==a||e[10]!==m||e[11]!==y||e[12]!==s?(h=t.jsx("input",{type:"text",value:s,onChange:y,onKeyDown:a,placeholder:m,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=a,e[10]=m,e[11]=y,e[12]=s,e[13]=h):h=e[13];let f;e[14]!==l||e[15]!==x||e[16]!==h?(f=t.jsxs("label",{className:l,children:[x,h]}),e[14]=l,e[15]=x,e[16]=h,e[17]=f):f=e[17];let j;return e[18]!==u||e[19]!==f?(j=t.jsx("div",{className:u,children:f}),e[18]=u,e[19]=f,e[20]=j):j=e[20],j}function gs(n,e,s){if(!s)return null;const o=Dn(n,e);return o?o.threads.get().find(a=>a.id===s)?.branch??null:null}function ps(n){const e=F.c(6),{value:s,onChange:o}=n,i=V();let a;e[0]!==i?(a=i("sidebar.agentsSection.searchAgents"),e[0]=i,e[1]=a):a=e[1];let r;return e[2]!==o||e[3]!==a||e[4]!==s?(r=t.jsx(fs,{value:s,onChange:o,placeholder:a}),e[2]=o,e[3]=a,e[4]=s,e[5]=r):r=e[5],r}function hs(){const n=F.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=o):o=n[3],o}function xs(n){const e=F.c(10),{org:s,onClose:o}=n,i=V();let a;e[0]!==s.slug?(a={org:s.slug},e[0]=s.slug,e[1]=a):a=e[1];let r;e[2]!==o?(r=()=>o(),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==i?(d=i("sidebar.agentsSection.seeAllAgents"),e[4]=i,e[5]=d):d=e[5];let c;return e[6]!==a||e[7]!==r||e[8]!==d?(c=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(Qt,{to:"/$org/settings/agents",params:a,onClick:r,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:d})}),e[6]=a,e[7]=r,e[8]=d,e[9]=c):c=e[9],c}function js(){const n=F.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(Rt,{children:s}),n[2]=s,n[3]=o):o=n[3],o}function vs(n){const e=F.c(11),{onImportFromGithub:s}=n,o=V();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(_n,{className:"size-3.5"}),e[0]=i):i=e[0];let a;e[1]!==o?(a=o("sidebar.agentsSection.import"),e[1]=o,e[2]=a):a=e[2];let r;e[3]!==s||e[4]!==a?(r=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:[i,a]}),e[3]=s,e[4]=a,e[5]=r):r=e[5];let d;e[6]!==o?(d=o("sidebar.agentsSection.codeAgents"),e[6]=o,e[7]=d):d=e[7];let c;return e[8]!==r||e[9]!==d?(c=t.jsx(Rt,{action:r,children:d}),e[8]=r,e[9]=d,e[10]=c):c=e[10],c}function bs(n){const e=F.c(11),{setOpen:s,emptyCtaClass:o}=n,i=V();let a;e[0]!==i?(a=i("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=a):a=e[1];let r;e[2]!==o?(r=X(o),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==s?(d=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=d):d=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(we,{className:"size-4"}),e[6]=c):c=e[6];let m;return e[7]!==a||e[8]!==r||e[9]!==d?(m=t.jsx(_t,{"aria-label":a,className:r,onClick:d,children:c}),e[7]=a,e[8]=r,e[9]=d,e[10]=m):m=e[10],m}function Cs(n){const e=F.c(17),{setOpen:s,highlightEmpty:o,emptyCtaClass:i}=n,a=V();let r;e[0]!==o||e[1]!==a?(r=o?void 0:a("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=a,e[2]=r):r=e[2];let d;e[3]!==i?(d=X(i),e[3]=i,e[4]=d):d=e[4];let c;e[5]!==s?(c=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=c):c=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]!==a?(u=a("sidebar.agentsSection.newAgent"),e[8]=a,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 l;return e[12]!==r||e[13]!==d||e[14]!==c||e[15]!==p?(l=t.jsx(bt,{children:t.jsxs(Ct,{tooltip:r,className:d,onClick:c,children:[m,p]})}),e[12]=r,e[13]=d,e[14]=c,e[15]=p,e[16]=l):l=e[16],l}function ys(){const n=F.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(At,{className:"sr-only",children:s}),n[2]=s,n[3]=o):o=n[3],o}function Ss(n){const e=F.c(8),{emptyCtaClass:s}=n,o=V();let i;e[0]!==o?(i=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==s?(a=X(s),e[2]=s,e[3]=a):a=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(we,{className:"size-4"}),e[4]=r):r=e[4];let d;return e[5]!==i||e[6]!==a?(d=t.jsx(_t,{"aria-label":i,className:a,children:r}),e[5]=i,e[6]=a,e[7]=d):d=e[7],d}function ws(n){const e=F.c(19),{wrapEmptyHint:s,highlightEmpty:o,emptyCtaClass:i}=n,a=V();let r;e[0]!==o||e[1]!==a?(r=o?void 0:a("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=a,e[2]=r):r=e[2];let d;e[3]!==i?(d=X(i),e[3]=i,e[4]=d):d=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(we,{}),e[5]=c):c=e[5];let m;e[6]!==a?(m=a("sidebar.agentsSection.newAgent"),e[6]=a,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]!==r||e[11]!==d||e[12]!==u?(p=t.jsx(Le,{asChild:!0,children:t.jsxs(Ct,{tooltip:r,className:d,children:[c,u]})}),e[10]=r,e[11]=d,e[12]=u,e[13]=p):p=e[13];let l;e[14]!==p||e[15]!==s?(l=s(p),e[14]=p,e[15]=s,e[16]=l):l=e[16];let x;return e[17]!==l?(x=t.jsx(bt,{children:l}),e[17]=l,e[18]=x):x=e[18],x}function Ns(n){const e=F.c(9),{children:s}=n,o=V();let i;e[0]!==s?(i=t.jsx(Ce,{asChild:!0,children:s}),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==o?(a=o("sidebar.agentsSection.selectAnExistingAgent"),e[2]=o,e[3]=a):a=e[3];let r;e[4]!==a?(r=t.jsx(ye,{side:"right",sideOffset:8,children:a}),e[4]=a,e[5]=r):r=e[5];let d;return e[6]!==i||e[7]!==r?(d=t.jsxs(Se,{defaultOpen:!0,delayDuration:0,children:[i,r]}),e[6]=i,e[7]=r,e[8]=d):d=e[8],d}function _s(n){const e=st(),{create:s}=kn(),{locator:o}=oe(),i=ot({strict:!1}),a=it({strict:!1});return async r=>{const d=crypto.randomUUID(),c=r===a.virtualmcpid?gs(n,o,i.taskId??""):null;try{await s({id:d,virtual_mcp_id:r,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:n,taskId:d},search:{virtualmcpid:r}})}}function tt(n){const e=F.c(20),{agent:s,selected:o,onClick:i}=n,a=o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let r;e[0]!==a?(r=X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",a),e[0]=a,e[1]=r):r=e[1];let d;e[2]!==s.icon||e[3]!==s.title?(d=t.jsx(jt,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=d):d=e[4];let c;e[5]!==s.title?(c=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=c):c=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]!==c||e[10]!==m?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,m]}),e[9]=c,e[10]=m,e[11]=u):u=e[11];let p;e[12]!==o?(p=o&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=o,e[13]=p):p=e[13];let l;return e[14]!==i||e[15]!==r||e[16]!==d||e[17]!==u||e[18]!==p?(l=t.jsxs("button",{type:"button",onClick:i,className:r,children:[d,u,p]}),e[14]=i,e[15]=r,e[16]=d,e[17]=u,e[18]=p,e[19]=l):l=e[19],l}function Rt(n){const e=F.c(5),{children:s,action:o}=n;let i;e[0]!==s?(i=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==o||e[3]!==i?(a=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,o]}),e[2]=o,e[3]=i,e[4]=a):a=e[4],a}function Ds(n){const e=F.c(23),{onClose:s,onSelectAgent:o,selectedAgentId:i,onImportFromGithub:a}=n,[r,d]=H.useState(""),c=cn(),m=c??[],{org:u}=oe(),{data:p}=ae.useSession(),l=p?.user?.id??"anon",x=In(c),y=Pn(),h=_s(u.slug),f=On(c),j=r.toLowerCase(),v=m.filter(Ps).filter(B=>!f.has(B.id)).filter(Is).filter(B=>!r||B.title.toLowerCase().includes(j)),b=v.filter(As),w=v.filter(ks),N=rt(u.id),P=!r||N.title.toLowerCase().includes(j),O=!!(o&&P);let g;e[0]!==s||e[1]!==o?(g=()=>{o?.(null),s(),d("")},e[0]=s,e[1]=o,e[2]=g):g=e[2];const _=g,T=B=>{if(o){o(B.id),s(),d("");return}Tn({orgId:u.id,userId:l},B.id,x),y(),s(),d(""),h(B.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let C;e[3]!==r?(C=t.jsx(ps,{value:r,onChange:d}),e[3]=r,e[4]=C):C=e[4];const I="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",k=o&&P&&N&&t.jsx(tt,{agent:N,selected:!i||i===N.id,onClick:_}),A=(b.length>0||!r)&&t.jsx(vs,{onImportFromGithub:a}),z=b.map(B=>t.jsx(tt,{agent:B,selected:o?i===B.id:void 0,onClick:()=>T(B)},B.id)),L=w.length>0&&t.jsx(js,{}),E=w.map(B=>t.jsx(tt,{agent:B,selected:o?i===B.id:void 0,onClick:()=>T(B)},B.id));let M;e[5]!==O||e[6]!==r||e[7]!==v.length?(M=v.length===0&&!O&&r&&t.jsx(hs,{}),e[5]=O,e[6]=r,e[7]=v.length,e[8]=M):M=e[8];let G;e[9]!==M||e[10]!==k||e[11]!==A||e[12]!==z||e[13]!==L||e[14]!==E?(G=t.jsxs("div",{className:I,children:[k,A,z,L,E,M]}),e[9]=M,e[10]=k,e[11]=A,e[12]=z,e[13]=L,e[14]=E,e[15]=G):G=e[15];let U;e[16]!==s||e[17]!==u?(U=t.jsx(xs,{org:u,onClose:s}),e[16]=s,e[17]=u,e[18]=U):U=e[18];let de;return e[19]!==G||e[20]!==U||e[21]!==C?(de=t.jsxs("div",{className:S,children:[C,G,U]}),e[19]=G,e[20]=U,e[21]=C,e[22]=de):de=e[22],de}function ks(n){return!Tt(n.metadata)}function As(n){return Tt(n.metadata)}function Is(n){return!an(n.id)}function Ps(n){return!on(n.id)}function Ts(n){const e=F.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:o,trigger:i,onSelectAgent:a,selectedAgentId:r,side:d,align:c}=s,m=o===void 0?!1:o,u=d===void 0?"right":d,p=c===void 0?"start":c,[l,x]=H.useState(!1),[y,h]=H.useState(!1),f=It(),{setOpenMobile:j}=vt(),v=An(),b=v?"border border-border":void 0;let w;e[2]!==v?(w=A=>v?t.jsx(Ns,{children:A}):A,e[2]=v,e[3]=w):w=e[3];const N=w;let P;e[4]!==f||e[5]!==j?(P=()=>{x(!1),f&&j(!1)},e[4]=f,e[5]=j,e[6]=P):P=e[6];const O=P;let g;e[7]!==O?(g=()=>{O(),h(!0)},e[7]=O,e[8]=g):g=e[8];const _=g;let T;e[9]!==O||e[10]!==_||e[11]!==a||e[12]!==l||e[13]!==r?(T=l&&t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(bn,{className:"h-4 w-24"})}),children:t.jsx(Ds,{onClose:O,onSelectAgent:a,selectedAgentId:r,onImportFromGithub:_})}),e[9]=O,e[10]=_,e[11]=a,e[12]=l,e[13]=r,e[14]=T):T=e[14];const S=T;let C;e[15]!==p||e[16]!==m||e[17]!==b||e[18]!==v||e[19]!==f||e[20]!==l||e[21]!==S||e[22]!==u||e[23]!==i||e[24]!==N?(C=f?t.jsxs(t.Fragment,{children:[i?t.jsx("button",{type:"button",onClick:()=>x(!0),className:"contents",children:i}):m?N(t.jsx(bs,{setOpen:x,emptyCtaClass:b})):t.jsx(Cs,{setOpen:x,highlightEmpty:v,emptyCtaClass:b}),t.jsx(Dt,{open:l,onOpenChange:x,direction:"bottom",children:t.jsxs(kt,{className:"max-h-[85dvh] p-0",children:[t.jsx(ys,{}),S]})})]}):t.jsxs(St,{open:l,onOpenChange:A=>{A&&!l&&R("agent_browser_opened",{surface:"desktop_popover"}),x(A)},children:[i?t.jsx(Le,{asChild:!0,children:i}):m?N(t.jsx(Le,{asChild:!0,children:t.jsx(Ss,{emptyCtaClass:b})})):t.jsx(ws,{wrapEmptyHint:N,highlightEmpty:v,emptyCtaClass:b}),t.jsx(yt,{className:"w-[380px] p-0 overflow-hidden",side:u,align:p,children:S})]}),e[15]=p,e[16]=m,e[17]=b,e[18]=v,e[19]=f,e[20]=l,e[21]=S,e[22]=u,e[23]=i,e[24]=N,e[25]=C):C=e[25];let I;e[26]!==y?(I=t.jsx(Nn,{open:y,onOpenChange:h,mode:"agent"}),e[26]=y,e[27]=I):I=e[27];let k;return e[28]!==I||e[29]!==C?(k=t.jsxs(t.Fragment,{children:[C,I]}),e[28]=I,e[29]=C,e[30]=k):k=e[30],k}const Os="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 zs(n){const e=F.c(29),{agentId:s,fallback:o,onOpenHome:i,onPick:a}=n,r=V(),d=dn(s)??o??null;let c,m,u,p,l;e[0]!==d?.title||e[1]!==i||e[2]!==r?(l=d?.title??r("header.shellBreadcrumb.superAgentDefaultName"),p="flex min-w-0 items-center gap-0",c="button",m=i,u=r("header.shellBreadcrumb.openAgentHome",{name:l}),e[0]=d?.title,e[1]=i,e[2]=r,e[3]=c,e[4]=m,e[5]=u,e[6]=p,e[7]=l):(c=e[3],m=e[4],u=e[5],p=e[6],l=e[7]);const x=d?.icon??null;let y;e[8]!==x||e[9]!==l?(y=t.jsx(jt,{icon:x,name:l,size:"xs"}),e[8]=x,e[9]=l,e[10]=y):y=e[10];let h;e[11]!==c||e[12]!==m||e[13]!==u||e[14]!==y?(h=t.jsx("button",{type:c,onClick:m,"aria-label":u,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:y}),e[11]=c,e[12]=m,e[13]=u,e[14]=y,e[15]=h):h=e[15];let f;e[16]!==l?(f=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:l}),e[16]=l,e[17]=f):f=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(xt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=j):j=e[18];let v;e[19]!==f?(v=t.jsxs("button",{type:"button",className:Os,children:[f,j]}),e[19]=f,e[20]=v):v=e[20];let b;e[21]!==s||e[22]!==a||e[23]!==v?(b=t.jsx(Ts,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:a,trigger:v}),e[21]=s,e[22]=a,e[23]=v,e[24]=b):b=e[24];let w;return e[25]!==b||e[26]!==p||e[27]!==h?(w=t.jsxs("div",{className:p,children:[h,b]}),e[25]=b,e[26]=p,e[27]=h,e[28]=w):w=e[28],w}function $o(n){const e=F.c(30);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:o}=s,i=V(),{org:a}=oe(),{state:r,isMobile:d}=vt(),c=Vt().invitations.length>0,m=r==="collapsed"||d;let u;e[2]!==c||e[3]!==a.name||e[4]!==i?(u=c?i("header.shellBreadcrumb.switchOrganizationPendingInvitation",{name:a.name}):i("header.shellBreadcrumb.switchOrganization",{name:a.name}),e[2]=c,e[3]=a.name,e[4]=i,e[5]=u):u=e[5];let p;e[6]!==a?(p=t.jsx(lt,{org:a,size:"sm"}),e[6]=a,e[7]=p):p=e[7];let l;e[8]!==c||e[9]!==m?(l=c&&t.jsx("span",{className:X("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",m?"-top-1":"top-1/2 -translate-y-1/2")}),e[8]=c,e[9]=m,e[10]=l):l=e[10];let x;e[11]!==p||e[12]!==l?(x=t.jsxs("span",{className:"relative inline-flex",children:[p,l]}),e[11]=p,e[12]=l,e[13]=x):x=e[13];let y;e[14]!==a.name||e[15]!==o?(y=o&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:a.name}),e[14]=a.name,e[15]=o,e[16]=y):y=e[16];let h;e[17]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(xt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[17]=h):h=e[17];let f;e[18]!==u||e[19]!==x||e[20]!==y?(f=t.jsx(Ce,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":u,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:[x,y,h]})}),e[18]=u,e[19]=x,e[20]=y,e[21]=f):f=e[21];let j;e[22]!==a.slug||e[23]!==f?(j=t.jsx(ds,{orgParam:a.slug,trigger:f}),e[22]=a.slug,e[23]=f,e[24]=j):j=e[24];let v;e[25]!==a.name?(v=t.jsx(ye,{side:"bottom",children:a.name}),e[25]=a.name,e[26]=v):v=e[26];let b;return e[27]!==v||e[28]!==j?(b=t.jsxs(Se,{children:[j,v]}),e[27]=v,e[28]=j,e[29]=b):b=e[29],b}function Bo(n){const e=F.c(22);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:o}=s,{org:i}=oe();let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[2]=a):a=e[2];const r=ot(a);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},e[3]=d):d=e[3];const c=it(d),{threads:m}=Pt(),{data:u}=ae.useSession(),{setTaskId:p,createNewTask:l}=Ot();let x;e[4]!==i.id?(x=rt(i.id),e[4]=i.id,e[5]=x):x=e[5];const y=x,h=y.id,f=r.taskId?c.virtualmcpid??h:h;let j;e[6]!==l||e[7]!==h||e[8]!==o||e[9]!==u?.user?.id||e[10]!==p||e[11]!==m?(j=O=>{const g=O??h,_=zn(m,g,u?.user?.id);_?p(_.id,g):l(g),o?.()},e[6]=l,e[7]=h,e[8]=o,e[9]=u?.user?.id,e[10]=p,e[11]=m,e[12]=j):j=e[12];const v=j;let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[13]=b):b=e[13];const w=f===h?y:void 0;let N;e[14]!==f||e[15]!==v?(N=()=>v(f),e[14]=f,e[15]=v,e[16]=N):N=e[16];let P;return e[17]!==f||e[18]!==v||e[19]!==w||e[20]!==N?(P=t.jsx(H.Suspense,{fallback:b,children:t.jsx(zs,{agentId:f,fallback:w,onOpenHome:N,onPick:v})}),e[17]=f,e[18]=v,e[19]=w,e[20]=N,e[21]=P):P=e[21],P}function Lo(){const n=F.c(24),e=V(),{org:s}=oe();let o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},n[0]=o):o=n[0];const i=ot(o);let a;n[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},n[1]=a):a=n[1];const r=it(a),{threads:d}=Pt(),{createNewTask:c}=Ot();let m;n[2]!==s.id?(m=rt(s.id),n[2]=s.id,n[3]=m):m=n[3];const u=m.id,p=i.taskId?r.virtualmcpid??u:u;let l;n[4]!==i.taskId||n[5]!==d?(l=(i.taskId?d.find(P=>P.id===i.taskId)?.branch:null)??null,n[4]=i.taskId,n[5]=d,n[6]=l):l=n[6];const x=l;let y;n[7]!==p||n[8]!==c||n[9]!==x?(y=()=>{c(p,x)},n[7]=p,n[8]=c,n[9]=x,n[10]=y):y=n[10];const h=y;let f;n[11]!==e?(f=e("sidebar.taskGroupsList.newChat"),n[11]=e,n[12]=f):f=n[12];let j;n[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(nn,{size:16}),n[13]=j):j=n[13];let v;n[14]!==h||n[15]!==f?(v=t.jsx(Ce,{asChild:!0,children:t.jsx("button",{type:"button",onClick:h,"aria-label":f,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]=h,n[15]=f,n[16]=v):v=n[16];let b;n[17]!==e?(b=e("sidebar.taskGroupsList.newChat"),n[17]=e,n[18]=b):b=n[18];let w;n[19]!==b?(w=t.jsx(ye,{side:"bottom",children:b}),n[19]=b,n[20]=w):w=n[20];let N;return n[21]!==v||n[22]!==w?(N=t.jsxs(Se,{children:[v,w]}),n[21]=v,n[22]=w,n[23]=N):N=n[23],N}function Ms({open:n,onOpenChange:e,onCreated:s}){const o=V(),{org:i}=oe(),{data:a}=ae.useSession(),{stdioEnabled:r}=Yt(),d=It(),c=Et(),m=zt(),p=Mt(m,"").items,l=ht({resolver:pt(Xn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),x=l.watch("ui_type"),y=l.watch("connection_url"),h=l.watch("npx_package"),f=Fe({uiType:x,connectionUrl:y??"",npxPackage:h??""})??ut({uiType:x,connectionUrl:y??"",registryItems:p}),j=g=>{const _=g.trim();if(!_)return;const T=!!l.formState.dirtyFields.title,S=!!l.formState.dirtyFields.description,C=!!l.formState.dirtyFields.env_vars,I=A=>{if(A&&(!T&&!l.getValues("title").trim()&&A.title&&l.setValue("title",A.title,{shouldDirty:!1}),!S&&!(l.getValues("description")??"").trim()&&A.description&&l.setValue("description",A.description,{shouldDirty:!1}),!C&&A.envVarKeys?.length)){const z=l.getValues("env_vars")??[],L=new Set(z.map(M=>M.key)),E=A.envVarKeys.filter(M=>!L.has(M));E.length>0&&l.setValue("env_vars",[...z,...E.map(M=>({key:M,value:""}))],{shouldDirty:!0})}},k=Qn(_);if(k&&r){l.setValue("ui_type","NPX",{shouldDirty:!0}),l.setValue("npx_package",k.packageName,{shouldDirty:!0}),l.setValue("connection_url","",{shouldDirty:!0}),l.setValue("connection_token",null,{shouldDirty:!0}),I(Fe({uiType:"NPX",npxPackage:k.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const A=x==="HTTP"||x==="SSE"||x==="Websocket"?x:"HTTP";l.setValue("ui_type",A,{shouldDirty:!0}),l.setValue("connection_url",_,{shouldDirty:!0}),I(Fe({uiType:A,connectionUrl:_})??ut({uiType:A,connectionUrl:_,registryItems:p}));return}x==="NPX"&&I(Fe({uiType:"NPX",npxPackage:_}))},v=g=>{g||l.reset(),e(g)},b=async g=>{let _,T=null,S=null,C=null;g.ui_type==="NPX"?(_="STDIO",T="",C=Yn(g.npx_package||"",g.env_vars||[])):g.ui_type==="STDIO"?(_="STDIO",T="",C=Jn(g.stdio_command||"",g.stdio_args||"",g.stdio_cwd,g.env_vars||[])):(_=g.ui_type,T=g.connection_url||"",S=g.connection_token||null);const I=Fn("conn");try{await c.create.mutateAsync({id:I,title:g.title,description:g.description||null,connection_type:_,connection_url:T,connection_token:S,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:a?.user?.id||"system",organization_id:i.id,icon:g.icon??null,app_name:null,app_id:null,connection_headers:C,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),l.reset(),e(!1),s?.(I)}catch{K.error(o("connections.createConnectionDialog.failedToCreateConnection"))}},w=o("connections.createConnectionDialog.title"),N=o("connections.createConnectionDialog.description"),P=l.formState.isSubmitting?o("connections.createConnectionDialog.saving"):o("connections.createConnectionDialog.createButton"),O=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:l.control,name:"ui_type",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.typeLabel")}),t.jsxs(Hn,{value:g.value,onValueChange:g.onChange,children:[t.jsx(Z,{children:t.jsx(Kn,{children:t.jsx(Un,{})})}),t.jsxs(Gn,{children:[t.jsx(De,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.httpType")]})}),t.jsx(De,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.sseType")]})}),t.jsx(De,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.websocketType")]})}),r&&t.jsxs(t.Fragment,{children:[t.jsx(De,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Be,{className:"w-4 h-4"}),o("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(De,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(sn,{className:"w-4 h-4"}),o("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(ee,{})]})}),x==="NPX"&&t.jsx(Q,{control:l.control,name:"npx_package",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:o("connections.createConnectionDialog.npmPackagePlaceholder"),...g,value:g.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),l.setValue("npx_package",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),g.onBlur()}})}),t.jsx(ee,{})]})}),x==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:l.control,name:"stdio_command",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.commandLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:o("connections.createConnectionDialog.commandPlaceholder"),...g,value:g.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"stdio_args",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.argumentsLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:o("connections.createConnectionDialog.argumentsPlaceholder"),...g,value:g.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:l.control,name:"stdio_cwd",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:o("connections.createConnectionDialog.workingDirectoryPlaceholder"),...g,value:g.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(ee,{})]})})]}),(x==="NPX"||x==="STDIO")&&t.jsx(Q,{control:l.control,name:"env_vars",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(Z,{children:t.jsx(Wn,{value:g.value??[],onChange:g.onChange})}),t.jsx(ee,{})]})}),x!=="NPX"&&x!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:l.control,name:"connection_url",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.urlLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:o("connections.createConnectionDialog.urlPlaceholder"),...g,value:g.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),l.setValue("connection_url",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),g.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"connection_token",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:f?.token?.label??o("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:f?.token?.placeholder??o("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...g,value:g.value??""})}),f?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[f.token.helperText,f.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:o("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:l.control,name:"title",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:o("connections.createConnectionDialog.namePlaceholder"),...g})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"description",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.descriptionLabel")}),t.jsx(Z,{children:t.jsx(qn,{placeholder:o("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...g,value:g.value??""})}),t.jsx(ee,{})]})})]});return d?t.jsx(Dt,{open:n,onOpenChange:v,children:t.jsxs(kt,{className:"max-h-[90vh]",children:[t.jsx(Cn,{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(yn,{className:"mt-1",children:N})]}),t.jsx(Sn,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Nt,{size:16})})})]})}),t.jsx(nt,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(b),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:O}),t.jsx(wn,{children:t.jsx(ne,{type:"submit",disabled:l.formState.isSubmitting,className:"w-full",children:P})})]})})]})}):t.jsx(Ft,{open:n,onOpenChange:v,children:t.jsxs($t,{className:"sm:max-w-[525px]",children:[t.jsxs(Bt,{children:[t.jsx(Lt,{children:w}),t.jsx(Vn,{children:N})]}),t.jsx(nt,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(b),children:[t.jsx("div",{className:"py-4",children:O}),t.jsxs(Rn,{children:[t.jsx(ne,{type:"button",variant:"outline",onClick:()=>v(!1),children:o("connections.createConnectionDialog.cancelButton")}),t.jsx(ne,{type:"submit",disabled:l.formState.isSubmitting,className:"min-w-40",children:P})]})]})})]})})}function Fs(n){const e=F.c(72),{mode:s,agentId:o,addedConnectionIds:i,onAdd:a,onCloneAndAdd:r,onConnectAndAdd:d,connectingItemId:c,search:m,onCreateConnection:u,onBrowseNavigate:p,defaultTab:l}=n,x=s===void 0?"add":s,y=l===void 0?"connected":l,h=V(),{org:f}=oe(),j=H.useDeferredValue(m),v=m!==j;let b;e[0]!==j?(b=j.trim().toLowerCase(),e[0]=j,e[1]=b):b=e[1];const w=b;let N;e[2]!==y?(N=D=>D??y,e[2]=y,e[3]=N):N=e[3];const[P,O]=Jt(Zt.connectionsTab(f.slug)+(y==="all"?":home-modal":":agent-modal"),N);let g;e[4]!==P||e[5]!==O?(g=D=>{D!==P&&R("connections_dialog_tab_changed",{to_tab:D}),O(D)},e[4]=P,e[5]=O,e[6]=g):g=e[6];const _=g;let T;e[7]!==f.id||e[8]!==f.slug?(T={connectionId:rn,orgId:f.id,orgSlug:f.slug},e[7]=f.id,e[8]=f.slug,e[9]=T):T=e[9];const S=ln(T),C=j?.trim().split(/\s+/).filter(Boolean)??[],I=C.length>0?{operator:"or",conditions:C.flatMap(Ks)}:void 0,k={...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},A=JSON.stringify(k),{data:z,fetchNextPage:L,hasNextPage:E,isFetchingNextPage:M}=ts({queryKey:at.collectionListInfinite(S,f.id,"","CONNECTIONS",A),queryFn:async D=>{const{pageParam:$}=D,se=$===void 0?0:$;return(await S.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:se}})).structuredContent},initialPageParam:0,getNextPageParam:Rs,staleTime:3e4}),G=z?.pages.flatMap(Vs)??[],U=En(G),de=new Set(G.filter(Es).map(Ls)),B=zt(),re=Mt(B,j),Re=mt(re.loadMore,re.hasMore,re.isLoadingMore),He=mt(L,E??!1,M),W=P==="all"||!!w,ct=W?re.items.filter(D=>{const $=$n(D);if($&&de.has($))return!1;if(!w)return!0;const se=Ve(D._meta),le=[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 C.some(te=>le.includes(te.toLowerCase()))}):[],Ne=ct.filter(Bs),_e=ct.filter($s);let Ae;e[10]!==i?(Ae=D=>D.some($=>i.has($.id)),e[10]=i,e[11]=Ae):Ae=e[11];const Ke=Ae;let Ie;e[12]!==i||e[13]!==o||e[14]!==c||e[15]!==Ke||e[16]!==x||e[17]!==a||e[18]!==p||e[19]!==r||e[20]!==h?(Ie=(D,$,se,le,te)=>{const Me=Ke(te),be=te.find(ce=>!i.has(ce.id)),q=te[0];if(x==="browse"){const ce=Zn(q);return t.jsx(Ye,{connection:{title:$,icon:se,description:te.length>1?`${te.length} instances`:le??void 0},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs($e,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",h("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{R("connection_browse_clicked",{app_name:q.app_name??null,connection_id:q.id,instances_count:te.length}),p?.(ce)}},D)}return t.jsx(Ye,{connection:{title:$,icon:se,description:le},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Me&&t.jsxs($e,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",h("virtualMcp.connectionDialogContent.added")]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:ce=>{ce.stopPropagation(),be?(R("connection_add_clicked",{action:"use_existing",app_name:q.app_name??null,connection_id:be.id}),o&&R("agent_connection_attached",{agent_id:o,connection_id:be.id,app_name:q.app_name??null,mode:"existing"}),a(be.id)):(R("connection_add_clicked",{action:"clone",app_name:q.app_name??null,base_connection_id:q.id}),r(q))},children:h("virtualMcp.connectionDialogContent.add")})]})},D)},e[12]=i,e[13]=o,e[14]=c,e[15]=Ke,e[16]=x,e[17]=a,e[18]=p,e[19]=r,e[20]=h,e[21]=Ie):Ie=e[21];const Pe=Ie;let Te;e[22]!==c||e[23]!==x||e[24]!==d||e[25]!==h?(Te=D=>{const $=Ve(D._meta),se=$?.friendlyName||$?.friendly_name||D.server?.title||D.title||D.server?.name||D.name||D.id||"",le=D.server?.description||D.description||null,te=D.server?.icons?.[0]?.src||Bn(D.server?.repository)||null,Me=$?.official===!0,be=$?.verified===!0,q=$?.owner==="deco";return t.jsx(Ye,{connection:{title:se,description:le,icon:te},fallbackIcon:t.jsx(Be,{}),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:h("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(ye,{children:h("virtualMcp.connectionDialogContent.builtByDeco")})]}),!q&&Me&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx($e,{variant:"outline",size:"icon",children:t.jsx(Je,{})})}),t.jsx(ye,{children:h("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!q&&!Me&&be&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx($e,{variant:"outline",size:"icon",children:t.jsx(Je,{})})}),t.jsx(ye,{children:h("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:ce=>{ce.stopPropagation(),R("connection_add_clicked",{action:"connect_new",registry_item_id:D.id,app_name:$?.friendlyName||D.server?.name||D.name||null}),d(D)},children:c===D.id?t.jsx(ke,{size:14,className:"animate-spin"}):h(x==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${D.id}`)},e[22]=c,e[23]=x,e[24]=d,e[25]=h,e[26]=Te):Te=e[26];const dt=Te;let ue;e[27]!==P||e[28]!==_||e[29]!==u||e[30]!==w||e[31]!==h?(ue=!w&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(es,{tabs:[{id:"all",label:h("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:h("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:P,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}),h("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=P,e[28]=_,e[29]=u,e[30]=w,e[31]=h,e[32]=ue):ue=e[32];const Ue=v&&"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 Ht="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 $=D.connection;return Pe($.id,$.title,$.icon,$.description??null,[$])},e[35]=Pe,e[36]=Oe):Oe=e[36];const Ge=U.map(Oe);let fe;e[37]!==He?(fe=t.jsx("div",{ref:He,className:"col-span-full h-1"}),e[37]=He,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 qe=W&&Ne.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(Je,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:h("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Xe=W&&Ne.map(dt),We=W&&_e.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:h("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Qe=W&&_e.map(dt);let pe;e[41]!==Re||e[42]!==B||e[43]!==W?(pe=W&&B.length>0&&t.jsx("div",{ref:Re,className:"col-span-full h-1"}),e[41]=Re,e[42]=B,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]!==Ge||e[49]!==fe||e[50]!==ge||e[51]!==qe||e[52]!==Xe||e[53]!==We||e[54]!==Qe||e[55]!==pe||e[56]!==he?(xe=t.jsxs("div",{className:Ht,children:[Ge,fe,ge,qe,Xe,We,Qe,pe,he]}),e[48]=Ge,e[49]=fe,e[50]=ge,e[51]=qe,e[52]=Xe,e[53]=We,e[54]=Qe,e[55]=pe,e[56]=he,e[57]=xe):xe=e[57];let je;e[58]!==P||e[59]!==U.length||e[60]!==_e||e[61]!==m||e[62]!==h||e[63]!==Ne?(je=U.length===0&&Ne.length===0&&_e.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:m?h("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:m}):h(P==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=P,e[59]=U.length,e[60]=_e,e[61]=m,e[62]=h,e[63]=Ne,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 Bs(n){return n.verified||Ve(n._meta)?.verified||n.meta?.verified}function Ls(n){return n.app_name}function Es(n){return n.app_name}function Vs(n){return n?.items??[]}function Rs(n,e){if(n?.hasMore)return e.reduce(Hs,0)}function Hs(n,e){return n+(e?.items?.length??0)}function Ks(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function Eo({open:n,onOpenChange:e,defaultTab:s,initialSearch:o="",...i}){const a=V(),r=i.mode??"add",d="agentId"in i?i.agentId:void 0,c="addedConnectionIds"in i?i.addedConnectionIds??new Set:new Set,m="onAdd"in i&&i.onAdd?i.onAdd:S=>{},u=(S,C,I)=>{d&&R("agent_connection_attached",{agent_id:d,connection_id:S,app_name:C,mode:I})},[p,l]=H.useState(null),[x,y]=H.useState(o),[h,f]=H.useState(!1),{org:j}=oe(),{data:v}=ae.useSession(),b=Et(),w=en(),N=st(),P=S=>{e(!1),N({to:"/$org/settings/connections/$appSlug",params:{org:j.slug,appSlug:S}})},O=()=>{w.invalidateQueries({predicate:S=>{const C=S.queryKey;return C[1]===j.id&&C[3]==="collection"&&C[4]==="CONNECTIONS"}})},g=async(S,C)=>{R("connection_oauth_succeeded",{connection_id:S,flow:C});const I=new URL(`/api/${j.slug}/mcp/${S}`,window.location.origin);await w.invalidateQueries({queryKey:at.isMCPAuthenticated(I.href,null)}),O()},_=async S=>{l(S.app_name??S.id);try{const I=`${S.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,A=(await b.create.mutateAsync({title:I,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 et({connectionId:A,orgId:j.id,orgSlug:j.slug,persistFallback:L=>b.update.mutateAsync({id:A,data:{connection_token:L}}).then(()=>{})});if(z.ran&&!z.ok){R("connection_oauth_failed",{connection_id:A,flow:"clone",error:z.error??"no_token"}),K.error(a("virtualMcp.addConnectionDialog.authenticationFailedError",{error:z.error??"no token received"})),await b.delete.mutateAsync(A);return}z.ran&&await g(A,"clone"),u(A,S.app_name??null,"clone"),m(A)}catch(C){console.error("Failed to add connection:",C),K.error(a("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{l(null)}},T=async S=>{if(!(!j||!v?.user?.id)){l(S.id);try{const C=Ln(S,j.id,v.user.id,{remoteIndex:0}),I=C.connection_type==="STDIO",k=!!C.connection_url,A=I&&C.connection_headers&&typeof C.connection_headers=="object"&&"command"in C.connection_headers;if(!k&&!A){K.error(a("virtualMcp.addConnectionDialog.mcpServerConnectionError")),l(null);return}const{id:z}=await b.create.mutateAsync(C),L=await et({connectionId:z,orgId:j.id,orgSlug:j.slug,persistFallback:E=>b.update.mutateAsync({id:z,data:{connection_token:E}}).then(()=>{})});if(L.ran&&!L.ok){R("connection_oauth_failed",{connection_id:z,flow:"connect_new",error:L.error??"no_token"}),K.warning(a("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:a("virtualMcp.addConnectionDialog.signInFailedDescription",{error:L.error??"no token received"})}),u(z,C.app_name??null,"new"),m(z);return}L.ran?(await g(z,"connect_new"),K.success(a("virtualMcp.addConnectionDialog.connectedAuthenticated"))):K.success(a("virtualMcp.addConnectionDialog.connected")),u(z,C.app_name??null,"new"),m(z)}catch(C){console.error("Failed to connect:",C),K.error(a("virtualMcp.addConnectionDialog.failedToConnect"))}finally{l(null)}}};return t.jsxs(Ft,{open:n,onOpenChange:e,children:[t.jsxs($t,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(Bt,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(Lt,{className:"text-base font-semibold",children:a(r==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(Mn,{value:x,onChange:y,placeholder:a("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(Fs,{mode:r,agentId:d,addedConnectionIds:c,onAdd:m,onCloneAndAdd:_,onConnectAndAdd:T,connectingItemId:p,search:x,onCreateConnection:()=>f(!0),onBrowseNavigate:P,defaultTab:s})})]}),t.jsx(Ms,{open:h,onOpenChange:f,onCreated:async S=>{f(!1);const C=await et({connectionId:S,orgId:j.id,orgSlug:j.slug,persistFallback:I=>b.update.mutateAsync({id:S,data:{connection_token:I}}).then(()=>{})});if(C.ran&&!C.ok){R("connection_oauth_failed",{connection_id:S,flow:"custom_create",error:C.error??"no_token"}),K.warning(a("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:a("virtualMcp.addConnectionDialog.signInFailedDescription",{error:C.error??"no token received"})}),u(S,null,"custom"),m(S),e(!1);return}C.ran&&await g(S,"custom_create"),u(S,null,"custom"),m(S),e(!1)}})]})}const gt=new Map;function Vo(){const{org:n}=oe(),e=ns(),s=ss(),o=s.find(f=>f.providerId==="deco"),{data:i,isLoading:a,refetch:r,isFetching:d}=tn({queryKey:at.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),c=i?.balanceCents??null,m=c!=null?c/100:null,u=H.useRef(new Map);if(c!=null){const f=gt.get(n.id);u.current.get(n.id)&&f!=null&&c>f&&R("credits_topped_up_detected",{organization_id:n.id,delta_cents:c-f,previous_balance_cents:f,new_balance_cents:c}),gt.set(n.id,c),u.current.set(n.id,!0)}const p=!!o,l=c!=null&&c>0,x=c!=null&&c===0,y=c!=null&&c===200,h=s.length>0&&s.every(f=>f.providerId==="deco");return{hasDecoKey:p,decoKeyId:o?.id??null,balanceCents:c,balanceDollars:m,hasCredits:l,isZeroBalance:x,isInitialFreeCredit:y,hasOnlyDecoProvider:h,isLoading:a,isFetching:d,refetch:r}}export{Bo as A,Lo as N,$o as O,Eo as a,ds as b,lt as c,Vo as u};
|
|
1
|
+
import{X as Kt,Y as Ut,c as F,b as V,Z as pt,_ as ht,e as Gt,j as t,a as ae,B as ne,r as H,aJ as qt,d as st,s as Xt,m as X,t as K,w as Wt,k as ke,p as R,F as oe,f as ot,u as it,L as Qt,D as Yt,I as Jt,G as Zt,K as at,o as en,n as tn}from"./index-CpB-IlaU.js";import{t as xt}from"./ChevronDown-3-gbZo8q.js";import{A as jt,j as nn,a5 as sn}from"./agent-icon-dfCTMRkW.js";import{T as Ce,a as ye,c as Se}from"./tooltip-DIgwzaVn.js";import{u as vt,d as bt,c as Ct}from"./sidebar-LfWRhUzl.js";import{a as rt,i as on,f as an,S as rn,u as ln}from"./use-mcp-client-nWQQesMe.js";import{a as cn,u as dn}from"./use-virtual-mcp-BWv80DLH.js";import{a as Le,b as yt,P as St}from"./popover-C5wy-cA4.js";import{i as Ee}from"./Check-qJLO8g4w.js";import{s as we}from"./Plus-B8mhYaf-.js";import{i as wt}from"./SearchMd-BoHX07tM.js";import{s as Nt}from"./XClose-BcoCd49U.js";import{c as un,d as mn,b as fn,f as gn,e as pn,a as hn,A as xn}from"./alert-dialog-nUW7phRB.js";import{F as Q,a as nt,b as Y,c as J,d as Z,f as jn,e as ee}from"./form-B2wEFCds.js";import{I as ie}from"./input-d_-U8Dix.js";import{S as vn}from"./chat-context-Dq62Fbos.js";import{T as _t}from"./toolbar-D9Mu1f21.js";import{S as bn}from"./skeleton-TLHNqNsZ.js";import{D as Dt,a as kt,b as At,c as Cn,e as yn,f as Sn,g as wn}from"./drawer-DSvvDd5I.js";import{u as It}from"./use-mobile-Z2zaMHdo.js";import{a as Nn,G as _n}from"./github-repo-picker-aJ_szzF7.js";import{g as Dn,b as kn,a as Pt}from"./hooks-DKTnjQ7p.js";import{u as An,g as In,a as Pn,b as Tn}from"./use-navigate-to-agent-DuvGIrZp.js";import{a as On,c as Tt}from"./agent-capabilities-cXfbMfjV.js";import{u as Ot}from"./shell-layout-BUCFxsPz.js";import{f as zn}from"./reusable-new-chat-CouMjkYR.js";import{C as Mn}from"./collection-search-CsezHOBI.js";import{g as Fn,a as $n,b as Bn,e as Ln}from"./extract-connection-data-D61ZU_rY.js";import{u as zt,a as Mt,g as En,C as Ye}from"./connection-card-Je9fGr_D.js";import{e as Ft,d as $t,a as Bt,b as Lt,h as Vn,c as Rn}from"./dialog-C35xFAax.js";import{S as Hn,a as Kn,b as Un,c as Gn,d as De}from"./select-lph10Txc.js";import{T as qn}from"./textarea-DGduoLl0.js";import{b as Et}from"./use-connection-DZ9yH8AT.js";import{a as Be,b as Je}from"./Tool02-CAeGe_oA.js";import{s as Ze}from"./Star01-b9CKRdDr.js";import{c as Xn,i as Fe,a as ut,E as Wn,p as Qn,b as Yn,d as Jn}from"./connection-form-helpers-DeHqNHEG.js";import{a as et}from"./authenticate-and-persist-oauth-Dgw0_gxc.js";import{g as Zn}from"./connection-slug-eyAPH6o3.js";import{C as es}from"./collection-tabs-CDebuN4_.js";import{u as mt}from"./use-infinite-scroll-Cjxmjx6A.js";import{B as $e}from"./badge-Dq0vpO1O.js";import{u as ts}from"./useSuspenseInfiniteQuery-ZdkbsRBz.js";import{g as Ve}from"./metadata-dUsYcpuu.js";import{u as ns}from"./studio-tools-D5VF1LfT.js";import{u as ss}from"./use-ai-providers-EGRXEeM0.js";function ft(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const os=Kt({name:Ut().min(2,"Organization name is required")});function is(n){const e=F.c(66),{open:s,onOpenChange:o}=n,i=V();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={resolver:pt(os),defaultValues:{name:""}},e[0]=a):a=e[0];const r=ht(a);let d;e[1]!==i?(d=async E=>{const M=ft(E.name);if(!M)throw new Error(i("common.createOrganizationDialog.invalidSlug"));const G=await ae.organization.create({name:E.name,slug:M});if(G?.error)throw new Error(G.error.message||i("common.createOrganizationDialog.failedToCreate"));const U=G?.data?.slug??M;if(!U)throw new Error(i("common.createOrganizationDialog.failedToCreate"));return{orgSlug:U}},e[1]=i,e[2]=d):d=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=as,e[3]=c):c=e[3];let m;e[4]!==d?(m={mutationFn:d,onSuccess:c},e[4]=d,e[5]=m):m=e[5];const u=Gt(m);let p;e[6]!==u.error||e[7]!==i?(p=u.error instanceof Error?u.error.message:u.error?i("common.createOrganizationDialog.failedToCreateGeneric"):null,e[6]=u.error,e[7]=i,e[8]=p):p=e[8];const l=p;let x;e[9]!==i?(x=i("common.createOrganizationDialog.title"),e[9]=i,e[10]=x):x=e[10];let y;e[11]!==x?(y=t.jsx(un,{children:x}),e[11]=x,e[12]=y):y=e[12];let h;e[13]!==i?(h=i("common.createOrganizationDialog.description"),e[13]=i,e[14]=h):h=e[14];let f;e[15]!==h?(f=t.jsx(mn,{children:h}),e[15]=h,e[16]=f):f=e[16];let j;e[17]!==y||e[18]!==f?(j=t.jsxs(fn,{children:[y,f]}),e[17]=y,e[18]=f,e[19]=j):j=e[19];let v;if(e[20]!==u||e[21]!==r){let E;e[23]!==u?(E=M=>u.mutateAsync(M),e[23]=u,e[24]=E):E=e[24],v=r.handleSubmit(E),e[20]=u,e[21]=r,e[22]=v}else v=e[22];let b;e[25]!==r.formState.isSubmitting||e[26]!==i?(b=E=>{const{field:M}=E;return t.jsxs(Y,{children:[t.jsx(J,{children:i("common.createOrganizationDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(ie,{...M,placeholder:i("common.createOrganizationDialog.namePlaceholder"),disabled:r.formState.isSubmitting})}),t.jsx(jn,{children:i("common.createOrganizationDialog.nameDescription")}),M.value&&t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[i("common.createOrganizationDialog.urlLabel")," ",t.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",ft(M.value)]})]}),t.jsx(ee,{})]})},e[25]=r.formState.isSubmitting,e[26]=i,e[27]=b):b=e[27];let w;e[28]!==r.control||e[29]!==b?(w=t.jsx(Q,{control:r.control,name:"name",render:b}),e[28]=r.control,e[29]=b,e[30]=w):w=e[30];let N;e[31]!==l?(N=l&&t.jsx("div",{className:"text-destructive text-sm mt-2",children:l}),e[31]=l,e[32]=N):N=e[32];const P=r.formState.isSubmitting;let O;e[33]!==u||e[34]!==r?(O=()=>{u.reset(),r.reset()},e[33]=u,e[34]=r,e[35]=O):O=e[35];let g;e[36]!==i?(g=i("common.createOrganizationDialog.cancel"),e[36]=i,e[37]=g):g=e[37];let _;e[38]!==r.formState.isSubmitting||e[39]!==O||e[40]!==g?(_=t.jsx(gn,{disabled:P,onClick:O,children:g}),e[38]=r.formState.isSubmitting,e[39]=O,e[40]=g,e[41]=_):_=e[41];const T=!r.formState.isValid||r.formState.isSubmitting;let S;e[42]!==r.formState.isSubmitting||e[43]!==i?(S=r.formState.isSubmitting?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(vn,{size:"xs"})," ",i("common.createOrganizationDialog.creating")]}):i("common.createOrganizationDialog.createButton"),e[42]=r.formState.isSubmitting,e[43]=i,e[44]=S):S=e[44];let C;e[45]!==T||e[46]!==S?(C=t.jsx(ne,{type:"submit",variant:"default",disabled:T,children:S}),e[45]=T,e[46]=S,e[47]=C):C=e[47];let I;e[48]!==_||e[49]!==C?(I=t.jsxs(pn,{children:[_,C]}),e[48]=_,e[49]=C,e[50]=I):I=e[50];let k;e[51]!==v||e[52]!==w||e[53]!==N||e[54]!==I?(k=t.jsxs("form",{className:"space-y-6",onSubmit:v,autoComplete:"off",children:[w,N,I]}),e[51]=v,e[52]=w,e[53]=N,e[54]=I,e[55]=k):k=e[55];let A;e[56]!==r||e[57]!==k?(A=t.jsx(nt,{...r,children:k}),e[56]=r,e[57]=k,e[58]=A):A=e[58];let z;e[59]!==j||e[60]!==A?(z=t.jsxs(hn,{children:[j,A]}),e[59]=j,e[60]=A,e[61]=z):z=e[61];let L;return e[62]!==o||e[63]!==s||e[64]!==z?(L=t.jsx(xn,{open:s,onOpenChange:o,children:z}),e[62]=o,e[63]=s,e[64]=z,e[65]=L):L=e[65],L}function as(n){const{orgSlug:e}=n;window.location.href=`/${e}`}function Vt(){const n=H.useContext(qt),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(i=>i.status==="pending"&&new Date(i.expiresAt)>new Date),refetch:()=>s?.()}}function rs(n){let e=0;for(let o=0;o<n.length;o++)e=n.charCodeAt(o)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function lt(n){const e=F.c(13),{org:s,size:o}=n,i=o===void 0?"sm":o,a=i==="xs"?"size-5":"size-6",r=i==="xs"?"text-[9px]":"text-xs";let d;e[0]!==a?(d=X(a,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=a,e[1]=d):d=e[1];let c;e[2]!==s.logo||e[3]!==s.name?(c=s.logo?void 0:rs(s.name),e[2]=s.logo,e[3]=s.name,e[4]=c):c=e[4];let m;e[5]!==s.logo||e[6]!==s.name||e[7]!==r?(m=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:X("font-semibold leading-none",r),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=r,e[8]=m):m=e[8];let u;return e[9]!==d||e[10]!==c||e[11]!==m?(u=t.jsx("div",{className:d,style:c,children:m}),e[9]=d,e[10]=c,e[11]=m,e[12]=u):u=e[12],u}function ls({invitation:n,onChanged:e}){const s=V(),[o,i]=H.useState(!1),a=n.organizationName??s("header.orgSwitcher.unknownOrganization"),r=async()=>{i(!0);try{const m=await ae.organization.acceptInvitation({invitationId:n.id});if(m.error){K.error(m.error.message),i(!1);return}}catch{K.error(s("header.orgSwitcher.failedToAcceptInvitation")),i(!1);return}K.success(s("header.orgSwitcher.joined",{name:a})),Wt();let c;try{c=(await ae.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},d=async()=>{i(!0);try{const c=await ae.organization.rejectInvitation({invitationId:n.id});if(c.error){K.error(c.error.message),i(!1);return}K.success(s("header.orgSwitcher.invitationDeclined")),i(!1),e()}catch{K.error(s("header.orgSwitcher.failedToDeclineInvitation")),i(!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(lt,{org:{name:a},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:a}),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:r,disabled:o,children:s("header.orgSwitcher.accept")}),t.jsx(ne,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:d,disabled:o,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:a}),children:t.jsx(Nt,{size:14})})]})]})}function cs(n){const e=F.c(32),{orgParam:s,onSelectOrg:o,onCreateOrg:i}=n,a=V(),{data:r}=Xt(),{invitations:d,refetch:c}=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=[...r??[]].sort(m),[p,l]=H.useState(""),x=p.toLowerCase(),y=x?u.filter(k=>k.name.toLowerCase().includes(x)||k.slug.toLowerCase().includes(x)):u;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(wt,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=h):h=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=k=>l(k.target.value),e[3]=f):f=e[3];let j;e[4]!==p?(j=k=>k.key==="Escape"&&p&&l(""),e[4]=p,e[5]=j):j=e[5];let v;e[6]!==a?(v=a("header.orgSwitcher.searchOrganizations"),e[6]=a,e[7]=v):v=e[7];let b;e[8]!==p||e[9]!==j||e[10]!==v?(b=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:p,onChange:f,onKeyDown:j,placeholder:v,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]=v,e[11]=b):b=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]!==i?(N=t.jsx("button",{type:"button",onClick:i,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]=i,e[14]=N):N=e[14];let P;e[15]!==b||e[16]!==N?(P=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[h,b,N]}),e[15]=b,e[16]=N,e[17]=P):P=e[17];const O="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let g;e[18]!==d||e[19]!==p||e[20]!==c?(g=!p&&d.map(k=>t.jsx(ls,{invitation:k,onChanged:c},k.id)),e[18]=d,e[19]=p,e[20]=c,e[21]=g):g=e[21];const _=y.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:p?a("header.orgSwitcher.noOrganizationsMatch",{query:p}):a("header.orgSwitcher.noOrganizationsAvailable")});let T;e[22]!==o||e[23]!==s?(T=k=>t.jsxs("button",{type:"button",onClick:()=>o(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(lt,{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]=o,e[23]=s,e[24]=T):T=e[24];const S=y.map(T);let C;e[25]!==g||e[26]!==_||e[27]!==S?(C=t.jsxs("div",{className:O,children:[g,_,S]}),e[25]=g,e[26]=_,e[27]=S,e[28]=C):C=e[28];let I;return e[29]!==C||e[30]!==P?(I=t.jsxs(t.Fragment,{children:[P,C]}),e[29]=C,e[30]=P,e[31]=I):I=e[31],I}function ds(n){const e=F.c(22),{trigger:s,orgParam:o,align:i,side:a}=n,r=i===void 0?"start":i,d=a===void 0?"bottom":a,c=st(),[m,u]=H.useState(!1),[p,l]=H.useState(!1);let x;e[0]!==s?(x=t.jsx(Le,{asChild:!0,children:s}),e[0]=s,e[1]=x):x=e[1];const y=String(m);let h;e[2]!==c?(h=P=>{u(!1),c({to:"/$org",params:{org:P}})},e[2]=c,e[3]=h):h=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{u(!1),l(!0)},e[4]=f):f=e[4];let j;e[5]!==o||e[6]!==y||e[7]!==h?(j=t.jsx(cs,{orgParam:o,onSelectOrg:h,onCreateOrg:f},y),e[5]=o,e[6]=y,e[7]=h,e[8]=j):j=e[8];let v;e[9]!==r||e[10]!==d||e[11]!==j?(v=t.jsx(yt,{side:d,align:r,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:ms,onCloseAutoFocus:us,children:j}),e[9]=r,e[10]=d,e[11]=j,e[12]=v):v=e[12];let b;e[13]!==m||e[14]!==x||e[15]!==v?(b=t.jsxs(St,{open:m,onOpenChange:u,children:[x,v]}),e[13]=m,e[14]=x,e[15]=v,e[16]=b):b=e[16];let w;e[17]!==p?(w=t.jsx(is,{open:p,onOpenChange:l}),e[17]=p,e[18]=w):w=e[18];let N;return e[19]!==w||e[20]!==b?(N=t.jsxs(t.Fragment,{children:[b,w]}),e[19]=w,e[20]=b,e[21]=N):N=e[21],N}function us(n){return n.preventDefault()}function ms(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function fs(n){const e=F.c(21),{value:s,onChange:o,placeholder:i,onKeyDown:a,className:r,isSearching:d,disabled:c}=n,m=i===void 0?"Search...":i;let u;e[0]!==r?(u=X("shrink-0 w-full border-b border-border h-12",r),e[0]=r,e[1]=u):u=e[1];const p=c?"cursor-not-allowed opacity-50":"cursor-text";let l;e[2]!==p?(l=X("flex items-center gap-2.5 h-12 px-4",p),e[2]=p,e[3]=l):l=e[3];let x;e[4]!==d?(x=d?t.jsx(ke,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(wt,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=d,e[5]=x):x=e[5];let y;e[6]!==o?(y=v=>o(v.target.value),e[6]=o,e[7]=y):y=e[7];let h;e[8]!==c||e[9]!==a||e[10]!==m||e[11]!==y||e[12]!==s?(h=t.jsx("input",{type:"text",value:s,onChange:y,onKeyDown:a,placeholder:m,disabled:c,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=c,e[9]=a,e[10]=m,e[11]=y,e[12]=s,e[13]=h):h=e[13];let f;e[14]!==l||e[15]!==x||e[16]!==h?(f=t.jsxs("label",{className:l,children:[x,h]}),e[14]=l,e[15]=x,e[16]=h,e[17]=f):f=e[17];let j;return e[18]!==u||e[19]!==f?(j=t.jsx("div",{className:u,children:f}),e[18]=u,e[19]=f,e[20]=j):j=e[20],j}function gs(n,e,s){if(!s)return null;const o=Dn(n,e);return o?o.threads.get().find(a=>a.id===s)?.branch??null:null}function ps(n){const e=F.c(6),{value:s,onChange:o}=n,i=V();let a;e[0]!==i?(a=i("sidebar.agentsSection.searchAgents"),e[0]=i,e[1]=a):a=e[1];let r;return e[2]!==o||e[3]!==a||e[4]!==s?(r=t.jsx(fs,{value:s,onChange:o,placeholder:a}),e[2]=o,e[3]=a,e[4]=s,e[5]=r):r=e[5],r}function hs(){const n=F.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=o):o=n[3],o}function xs(n){const e=F.c(10),{org:s,onClose:o}=n,i=V();let a;e[0]!==s.slug?(a={org:s.slug},e[0]=s.slug,e[1]=a):a=e[1];let r;e[2]!==o?(r=()=>o(),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==i?(d=i("sidebar.agentsSection.seeAllAgents"),e[4]=i,e[5]=d):d=e[5];let c;return e[6]!==a||e[7]!==r||e[8]!==d?(c=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(Qt,{to:"/$org/settings/agents",params:a,onClick:r,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:d})}),e[6]=a,e[7]=r,e[8]=d,e[9]=c):c=e[9],c}function js(){const n=F.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(Rt,{children:s}),n[2]=s,n[3]=o):o=n[3],o}function vs(n){const e=F.c(11),{onImportFromGithub:s}=n,o=V();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(_n,{className:"size-3.5"}),e[0]=i):i=e[0];let a;e[1]!==o?(a=o("sidebar.agentsSection.import"),e[1]=o,e[2]=a):a=e[2];let r;e[3]!==s||e[4]!==a?(r=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:[i,a]}),e[3]=s,e[4]=a,e[5]=r):r=e[5];let d;e[6]!==o?(d=o("sidebar.agentsSection.codeAgents"),e[6]=o,e[7]=d):d=e[7];let c;return e[8]!==r||e[9]!==d?(c=t.jsx(Rt,{action:r,children:d}),e[8]=r,e[9]=d,e[10]=c):c=e[10],c}function bs(n){const e=F.c(11),{setOpen:s,emptyCtaClass:o}=n,i=V();let a;e[0]!==i?(a=i("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=a):a=e[1];let r;e[2]!==o?(r=X(o),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==s?(d=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=d):d=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(we,{className:"size-4"}),e[6]=c):c=e[6];let m;return e[7]!==a||e[8]!==r||e[9]!==d?(m=t.jsx(_t,{"aria-label":a,className:r,onClick:d,children:c}),e[7]=a,e[8]=r,e[9]=d,e[10]=m):m=e[10],m}function Cs(n){const e=F.c(17),{setOpen:s,highlightEmpty:o,emptyCtaClass:i}=n,a=V();let r;e[0]!==o||e[1]!==a?(r=o?void 0:a("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=a,e[2]=r):r=e[2];let d;e[3]!==i?(d=X(i),e[3]=i,e[4]=d):d=e[4];let c;e[5]!==s?(c=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=c):c=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]!==a?(u=a("sidebar.agentsSection.newAgent"),e[8]=a,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 l;return e[12]!==r||e[13]!==d||e[14]!==c||e[15]!==p?(l=t.jsx(bt,{children:t.jsxs(Ct,{tooltip:r,className:d,onClick:c,children:[m,p]})}),e[12]=r,e[13]=d,e[14]=c,e[15]=p,e[16]=l):l=e[16],l}function ys(){const n=F.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let o;return n[2]!==s?(o=t.jsx(At,{className:"sr-only",children:s}),n[2]=s,n[3]=o):o=n[3],o}function Ss(n){const e=F.c(8),{emptyCtaClass:s}=n,o=V();let i;e[0]!==o?(i=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==s?(a=X(s),e[2]=s,e[3]=a):a=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(we,{className:"size-4"}),e[4]=r):r=e[4];let d;return e[5]!==i||e[6]!==a?(d=t.jsx(_t,{"aria-label":i,className:a,children:r}),e[5]=i,e[6]=a,e[7]=d):d=e[7],d}function ws(n){const e=F.c(19),{wrapEmptyHint:s,highlightEmpty:o,emptyCtaClass:i}=n,a=V();let r;e[0]!==o||e[1]!==a?(r=o?void 0:a("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=a,e[2]=r):r=e[2];let d;e[3]!==i?(d=X(i),e[3]=i,e[4]=d):d=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(we,{}),e[5]=c):c=e[5];let m;e[6]!==a?(m=a("sidebar.agentsSection.newAgent"),e[6]=a,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]!==r||e[11]!==d||e[12]!==u?(p=t.jsx(Le,{asChild:!0,children:t.jsxs(Ct,{tooltip:r,className:d,children:[c,u]})}),e[10]=r,e[11]=d,e[12]=u,e[13]=p):p=e[13];let l;e[14]!==p||e[15]!==s?(l=s(p),e[14]=p,e[15]=s,e[16]=l):l=e[16];let x;return e[17]!==l?(x=t.jsx(bt,{children:l}),e[17]=l,e[18]=x):x=e[18],x}function Ns(n){const e=F.c(9),{children:s}=n,o=V();let i;e[0]!==s?(i=t.jsx(Ce,{asChild:!0,children:s}),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==o?(a=o("sidebar.agentsSection.selectAnExistingAgent"),e[2]=o,e[3]=a):a=e[3];let r;e[4]!==a?(r=t.jsx(ye,{side:"right",sideOffset:8,children:a}),e[4]=a,e[5]=r):r=e[5];let d;return e[6]!==i||e[7]!==r?(d=t.jsxs(Se,{defaultOpen:!0,delayDuration:0,children:[i,r]}),e[6]=i,e[7]=r,e[8]=d):d=e[8],d}function _s(n){const e=st(),{create:s}=kn(),{locator:o}=oe(),i=ot({strict:!1}),a=it({strict:!1});return async r=>{const d=crypto.randomUUID(),c=r===a.virtualmcpid?gs(n,o,i.taskId??""):null;try{await s({id:d,virtual_mcp_id:r,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:n,taskId:d},search:{virtualmcpid:r}})}}function tt(n){const e=F.c(20),{agent:s,selected:o,onClick:i}=n,a=o?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let r;e[0]!==a?(r=X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",a),e[0]=a,e[1]=r):r=e[1];let d;e[2]!==s.icon||e[3]!==s.title?(d=t.jsx(jt,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=d):d=e[4];let c;e[5]!==s.title?(c=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=c):c=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]!==c||e[10]!==m?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,m]}),e[9]=c,e[10]=m,e[11]=u):u=e[11];let p;e[12]!==o?(p=o&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=o,e[13]=p):p=e[13];let l;return e[14]!==i||e[15]!==r||e[16]!==d||e[17]!==u||e[18]!==p?(l=t.jsxs("button",{type:"button",onClick:i,className:r,children:[d,u,p]}),e[14]=i,e[15]=r,e[16]=d,e[17]=u,e[18]=p,e[19]=l):l=e[19],l}function Rt(n){const e=F.c(5),{children:s,action:o}=n;let i;e[0]!==s?(i=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==o||e[3]!==i?(a=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[i,o]}),e[2]=o,e[3]=i,e[4]=a):a=e[4],a}function Ds(n){const e=F.c(23),{onClose:s,onSelectAgent:o,selectedAgentId:i,onImportFromGithub:a}=n,[r,d]=H.useState(""),c=cn(),m=c??[],{org:u}=oe(),{data:p}=ae.useSession(),l=p?.user?.id??"anon",x=In(c),y=Pn(),h=_s(u.slug),f=On(c),j=r.toLowerCase(),v=m.filter(Ps).filter(B=>!f.has(B.id)).filter(Is).filter(B=>!r||B.title.toLowerCase().includes(j)),b=v.filter(As),w=v.filter(ks),N=rt(u.id),P=!r||N.title.toLowerCase().includes(j),O=!!(o&&P);let g;e[0]!==s||e[1]!==o?(g=()=>{o?.(null),s(),d("")},e[0]=s,e[1]=o,e[2]=g):g=e[2];const _=g,T=B=>{if(o){o(B.id),s(),d("");return}Tn({orgId:u.id,userId:l},B.id,x),y(),s(),d(""),h(B.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let C;e[3]!==r?(C=t.jsx(ps,{value:r,onChange:d}),e[3]=r,e[4]=C):C=e[4];const I="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",k=o&&P&&N&&t.jsx(tt,{agent:N,selected:!i||i===N.id,onClick:_}),A=(b.length>0||!r)&&t.jsx(vs,{onImportFromGithub:a}),z=b.map(B=>t.jsx(tt,{agent:B,selected:o?i===B.id:void 0,onClick:()=>T(B)},B.id)),L=w.length>0&&t.jsx(js,{}),E=w.map(B=>t.jsx(tt,{agent:B,selected:o?i===B.id:void 0,onClick:()=>T(B)},B.id));let M;e[5]!==O||e[6]!==r||e[7]!==v.length?(M=v.length===0&&!O&&r&&t.jsx(hs,{}),e[5]=O,e[6]=r,e[7]=v.length,e[8]=M):M=e[8];let G;e[9]!==M||e[10]!==k||e[11]!==A||e[12]!==z||e[13]!==L||e[14]!==E?(G=t.jsxs("div",{className:I,children:[k,A,z,L,E,M]}),e[9]=M,e[10]=k,e[11]=A,e[12]=z,e[13]=L,e[14]=E,e[15]=G):G=e[15];let U;e[16]!==s||e[17]!==u?(U=t.jsx(xs,{org:u,onClose:s}),e[16]=s,e[17]=u,e[18]=U):U=e[18];let de;return e[19]!==G||e[20]!==U||e[21]!==C?(de=t.jsxs("div",{className:S,children:[C,G,U]}),e[19]=G,e[20]=U,e[21]=C,e[22]=de):de=e[22],de}function ks(n){return!Tt(n.metadata)}function As(n){return Tt(n.metadata)}function Is(n){return!an(n.id)}function Ps(n){return!on(n.id)}function Ts(n){const e=F.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:o,trigger:i,onSelectAgent:a,selectedAgentId:r,side:d,align:c}=s,m=o===void 0?!1:o,u=d===void 0?"right":d,p=c===void 0?"start":c,[l,x]=H.useState(!1),[y,h]=H.useState(!1),f=It(),{setOpenMobile:j}=vt(),v=An(),b=v?"border border-border":void 0;let w;e[2]!==v?(w=A=>v?t.jsx(Ns,{children:A}):A,e[2]=v,e[3]=w):w=e[3];const N=w;let P;e[4]!==f||e[5]!==j?(P=()=>{x(!1),f&&j(!1)},e[4]=f,e[5]=j,e[6]=P):P=e[6];const O=P;let g;e[7]!==O?(g=()=>{O(),h(!0)},e[7]=O,e[8]=g):g=e[8];const _=g;let T;e[9]!==O||e[10]!==_||e[11]!==a||e[12]!==l||e[13]!==r?(T=l&&t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(bn,{className:"h-4 w-24"})}),children:t.jsx(Ds,{onClose:O,onSelectAgent:a,selectedAgentId:r,onImportFromGithub:_})}),e[9]=O,e[10]=_,e[11]=a,e[12]=l,e[13]=r,e[14]=T):T=e[14];const S=T;let C;e[15]!==p||e[16]!==m||e[17]!==b||e[18]!==v||e[19]!==f||e[20]!==l||e[21]!==S||e[22]!==u||e[23]!==i||e[24]!==N?(C=f?t.jsxs(t.Fragment,{children:[i?t.jsx("button",{type:"button",onClick:()=>x(!0),className:"contents",children:i}):m?N(t.jsx(bs,{setOpen:x,emptyCtaClass:b})):t.jsx(Cs,{setOpen:x,highlightEmpty:v,emptyCtaClass:b}),t.jsx(Dt,{open:l,onOpenChange:x,direction:"bottom",children:t.jsxs(kt,{className:"max-h-[85dvh] p-0",children:[t.jsx(ys,{}),S]})})]}):t.jsxs(St,{open:l,onOpenChange:A=>{A&&!l&&R("agent_browser_opened",{surface:"desktop_popover"}),x(A)},children:[i?t.jsx(Le,{asChild:!0,children:i}):m?N(t.jsx(Le,{asChild:!0,children:t.jsx(Ss,{emptyCtaClass:b})})):t.jsx(ws,{wrapEmptyHint:N,highlightEmpty:v,emptyCtaClass:b}),t.jsx(yt,{className:"w-[380px] p-0 overflow-hidden",side:u,align:p,children:S})]}),e[15]=p,e[16]=m,e[17]=b,e[18]=v,e[19]=f,e[20]=l,e[21]=S,e[22]=u,e[23]=i,e[24]=N,e[25]=C):C=e[25];let I;e[26]!==y?(I=t.jsx(Nn,{open:y,onOpenChange:h,mode:"agent"}),e[26]=y,e[27]=I):I=e[27];let k;return e[28]!==I||e[29]!==C?(k=t.jsxs(t.Fragment,{children:[C,I]}),e[28]=I,e[29]=C,e[30]=k):k=e[30],k}const Os="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 zs(n){const e=F.c(29),{agentId:s,fallback:o,onOpenHome:i,onPick:a}=n,r=V(),d=dn(s)??o??null;let c,m,u,p,l;e[0]!==d?.title||e[1]!==i||e[2]!==r?(l=d?.title??r("header.shellBreadcrumb.superAgentDefaultName"),p="flex min-w-0 items-center gap-0",c="button",m=i,u=r("header.shellBreadcrumb.openAgentHome",{name:l}),e[0]=d?.title,e[1]=i,e[2]=r,e[3]=c,e[4]=m,e[5]=u,e[6]=p,e[7]=l):(c=e[3],m=e[4],u=e[5],p=e[6],l=e[7]);const x=d?.icon??null;let y;e[8]!==x||e[9]!==l?(y=t.jsx(jt,{icon:x,name:l,size:"xs"}),e[8]=x,e[9]=l,e[10]=y):y=e[10];let h;e[11]!==c||e[12]!==m||e[13]!==u||e[14]!==y?(h=t.jsx("button",{type:c,onClick:m,"aria-label":u,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:y}),e[11]=c,e[12]=m,e[13]=u,e[14]=y,e[15]=h):h=e[15];let f;e[16]!==l?(f=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:l}),e[16]=l,e[17]=f):f=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(xt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[18]=j):j=e[18];let v;e[19]!==f?(v=t.jsxs("button",{type:"button",className:Os,children:[f,j]}),e[19]=f,e[20]=v):v=e[20];let b;e[21]!==s||e[22]!==a||e[23]!==v?(b=t.jsx(Ts,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:a,trigger:v}),e[21]=s,e[22]=a,e[23]=v,e[24]=b):b=e[24];let w;return e[25]!==b||e[26]!==p||e[27]!==h?(w=t.jsxs("div",{className:p,children:[h,b]}),e[25]=b,e[26]=p,e[27]=h,e[28]=w):w=e[28],w}function $o(n){const e=F.c(30);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:o}=s,i=V(),{org:a}=oe(),{state:r,isMobile:d}=vt(),c=Vt().invitations.length>0,m=r==="collapsed"||d;let u;e[2]!==c||e[3]!==a.name||e[4]!==i?(u=c?i("header.shellBreadcrumb.switchOrganizationPendingInvitation",{name:a.name}):i("header.shellBreadcrumb.switchOrganization",{name:a.name}),e[2]=c,e[3]=a.name,e[4]=i,e[5]=u):u=e[5];let p;e[6]!==a?(p=t.jsx(lt,{org:a,size:"sm"}),e[6]=a,e[7]=p):p=e[7];let l;e[8]!==c||e[9]!==m?(l=c&&t.jsx("span",{className:X("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",m?"-top-1":"top-1/2 -translate-y-1/2")}),e[8]=c,e[9]=m,e[10]=l):l=e[10];let x;e[11]!==p||e[12]!==l?(x=t.jsxs("span",{className:"relative inline-flex",children:[p,l]}),e[11]=p,e[12]=l,e[13]=x):x=e[13];let y;e[14]!==a.name||e[15]!==o?(y=o&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:a.name}),e[14]=a.name,e[15]=o,e[16]=y):y=e[16];let h;e[17]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(xt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[17]=h):h=e[17];let f;e[18]!==u||e[19]!==x||e[20]!==y?(f=t.jsx(Ce,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":u,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:[x,y,h]})}),e[18]=u,e[19]=x,e[20]=y,e[21]=f):f=e[21];let j;e[22]!==a.slug||e[23]!==f?(j=t.jsx(ds,{orgParam:a.slug,trigger:f}),e[22]=a.slug,e[23]=f,e[24]=j):j=e[24];let v;e[25]!==a.name?(v=t.jsx(ye,{side:"bottom",children:a.name}),e[25]=a.name,e[26]=v):v=e[26];let b;return e[27]!==v||e[28]!==j?(b=t.jsxs(Se,{children:[j,v]}),e[27]=v,e[28]=j,e[29]=b):b=e[29],b}function Bo(n){const e=F.c(22);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:o}=s,{org:i}=oe();let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[2]=a):a=e[2];const r=ot(a);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},e[3]=d):d=e[3];const c=it(d),{threads:m}=Pt(),{data:u}=ae.useSession(),{setTaskId:p,createNewTask:l}=Ot();let x;e[4]!==i.id?(x=rt(i.id),e[4]=i.id,e[5]=x):x=e[5];const y=x,h=y.id,f=r.taskId?c.virtualmcpid??h:h;let j;e[6]!==l||e[7]!==h||e[8]!==o||e[9]!==u?.user?.id||e[10]!==p||e[11]!==m?(j=O=>{const g=O??h,_=zn(m,g,u?.user?.id);_?p(_.id,g):l(g),o?.()},e[6]=l,e[7]=h,e[8]=o,e[9]=u?.user?.id,e[10]=p,e[11]=m,e[12]=j):j=e[12];const v=j;let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[13]=b):b=e[13];const w=f===h?y:void 0;let N;e[14]!==f||e[15]!==v?(N=()=>v(f),e[14]=f,e[15]=v,e[16]=N):N=e[16];let P;return e[17]!==f||e[18]!==v||e[19]!==w||e[20]!==N?(P=t.jsx(H.Suspense,{fallback:b,children:t.jsx(zs,{agentId:f,fallback:w,onOpenHome:N,onPick:v})}),e[17]=f,e[18]=v,e[19]=w,e[20]=N,e[21]=P):P=e[21],P}function Lo(){const n=F.c(24),e=V(),{org:s}=oe();let o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},n[0]=o):o=n[0];const i=ot(o);let a;n[1]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},n[1]=a):a=n[1];const r=it(a),{threads:d}=Pt(),{createNewTask:c}=Ot();let m;n[2]!==s.id?(m=rt(s.id),n[2]=s.id,n[3]=m):m=n[3];const u=m.id,p=i.taskId?r.virtualmcpid??u:u;let l;n[4]!==i.taskId||n[5]!==d?(l=(i.taskId?d.find(P=>P.id===i.taskId)?.branch:null)??null,n[4]=i.taskId,n[5]=d,n[6]=l):l=n[6];const x=l;let y;n[7]!==p||n[8]!==c||n[9]!==x?(y=()=>{c(p,x)},n[7]=p,n[8]=c,n[9]=x,n[10]=y):y=n[10];const h=y;let f;n[11]!==e?(f=e("sidebar.taskGroupsList.newChat"),n[11]=e,n[12]=f):f=n[12];let j;n[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(nn,{size:16}),n[13]=j):j=n[13];let v;n[14]!==h||n[15]!==f?(v=t.jsx(Ce,{asChild:!0,children:t.jsx("button",{type:"button",onClick:h,"aria-label":f,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]=h,n[15]=f,n[16]=v):v=n[16];let b;n[17]!==e?(b=e("sidebar.taskGroupsList.newChat"),n[17]=e,n[18]=b):b=n[18];let w;n[19]!==b?(w=t.jsx(ye,{side:"bottom",children:b}),n[19]=b,n[20]=w):w=n[20];let N;return n[21]!==v||n[22]!==w?(N=t.jsxs(Se,{children:[v,w]}),n[21]=v,n[22]=w,n[23]=N):N=n[23],N}function Ms({open:n,onOpenChange:e,onCreated:s}){const o=V(),{org:i}=oe(),{data:a}=ae.useSession(),{stdioEnabled:r}=Yt(),d=It(),c=Et(),m=zt(),p=Mt(m,"").items,l=ht({resolver:pt(Xn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),x=l.watch("ui_type"),y=l.watch("connection_url"),h=l.watch("npx_package"),f=Fe({uiType:x,connectionUrl:y??"",npxPackage:h??""})??ut({uiType:x,connectionUrl:y??"",registryItems:p}),j=g=>{const _=g.trim();if(!_)return;const T=!!l.formState.dirtyFields.title,S=!!l.formState.dirtyFields.description,C=!!l.formState.dirtyFields.env_vars,I=A=>{if(A&&(!T&&!l.getValues("title").trim()&&A.title&&l.setValue("title",A.title,{shouldDirty:!1}),!S&&!(l.getValues("description")??"").trim()&&A.description&&l.setValue("description",A.description,{shouldDirty:!1}),!C&&A.envVarKeys?.length)){const z=l.getValues("env_vars")??[],L=new Set(z.map(M=>M.key)),E=A.envVarKeys.filter(M=>!L.has(M));E.length>0&&l.setValue("env_vars",[...z,...E.map(M=>({key:M,value:""}))],{shouldDirty:!0})}},k=Qn(_);if(k&&r){l.setValue("ui_type","NPX",{shouldDirty:!0}),l.setValue("npx_package",k.packageName,{shouldDirty:!0}),l.setValue("connection_url","",{shouldDirty:!0}),l.setValue("connection_token",null,{shouldDirty:!0}),I(Fe({uiType:"NPX",npxPackage:k.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const A=x==="HTTP"||x==="SSE"||x==="Websocket"?x:"HTTP";l.setValue("ui_type",A,{shouldDirty:!0}),l.setValue("connection_url",_,{shouldDirty:!0}),I(Fe({uiType:A,connectionUrl:_})??ut({uiType:A,connectionUrl:_,registryItems:p}));return}x==="NPX"&&I(Fe({uiType:"NPX",npxPackage:_}))},v=g=>{g||l.reset(),e(g)},b=async g=>{let _,T=null,S=null,C=null;g.ui_type==="NPX"?(_="STDIO",T="",C=Yn(g.npx_package||"",g.env_vars||[])):g.ui_type==="STDIO"?(_="STDIO",T="",C=Jn(g.stdio_command||"",g.stdio_args||"",g.stdio_cwd,g.env_vars||[])):(_=g.ui_type,T=g.connection_url||"",S=g.connection_token||null);const I=Fn("conn");try{await c.create.mutateAsync({id:I,title:g.title,description:g.description||null,connection_type:_,connection_url:T,connection_token:S,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:a?.user?.id||"system",organization_id:i.id,icon:g.icon??null,app_name:null,app_id:null,connection_headers:C,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),l.reset(),e(!1),s?.(I)}catch{K.error(o("connections.createConnectionDialog.failedToCreateConnection"))}},w=o("connections.createConnectionDialog.title"),N=o("connections.createConnectionDialog.description"),P=l.formState.isSubmitting?o("connections.createConnectionDialog.saving"):o("connections.createConnectionDialog.createButton"),O=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:l.control,name:"ui_type",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.typeLabel")}),t.jsxs(Hn,{value:g.value,onValueChange:g.onChange,children:[t.jsx(Z,{children:t.jsx(Kn,{children:t.jsx(Un,{})})}),t.jsxs(Gn,{children:[t.jsx(De,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.httpType")]})}),t.jsx(De,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.sseType")]})}),t.jsx(De,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ze,{className:"w-4 h-4"}),o("connections.createConnectionDialog.websocketType")]})}),r&&t.jsxs(t.Fragment,{children:[t.jsx(De,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Be,{className:"w-4 h-4"}),o("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(De,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(sn,{className:"w-4 h-4"}),o("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(ee,{})]})}),x==="NPX"&&t.jsx(Q,{control:l.control,name:"npx_package",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:o("connections.createConnectionDialog.npmPackagePlaceholder"),...g,value:g.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),l.setValue("npx_package",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),g.onBlur()}})}),t.jsx(ee,{})]})}),x==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:l.control,name:"stdio_command",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.commandLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:o("connections.createConnectionDialog.commandPlaceholder"),...g,value:g.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"stdio_args",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.argumentsLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:o("connections.createConnectionDialog.argumentsPlaceholder"),...g,value:g.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:l.control,name:"stdio_cwd",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:o("connections.createConnectionDialog.workingDirectoryPlaceholder"),...g,value:g.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(ee,{})]})})]}),(x==="NPX"||x==="STDIO")&&t.jsx(Q,{control:l.control,name:"env_vars",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(Z,{children:t.jsx(Wn,{value:g.value??[],onChange:g.onChange})}),t.jsx(ee,{})]})}),x!=="NPX"&&x!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:l.control,name:"connection_url",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.urlLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:o("connections.createConnectionDialog.urlPlaceholder"),...g,value:g.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),l.setValue("connection_url",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),g.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"connection_token",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:f?.token?.label??o("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:f?.token?.placeholder??o("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...g,value:g.value??""})}),f?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[f.token.helperText,f.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:o("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:l.control,name:"title",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:o("connections.createConnectionDialog.namePlaceholder"),...g})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"description",render:({field:g})=>t.jsxs(Y,{children:[t.jsx(J,{children:o("connections.createConnectionDialog.descriptionLabel")}),t.jsx(Z,{children:t.jsx(qn,{placeholder:o("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...g,value:g.value??""})}),t.jsx(ee,{})]})})]});return d?t.jsx(Dt,{open:n,onOpenChange:v,children:t.jsxs(kt,{className:"max-h-[90vh]",children:[t.jsx(Cn,{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(yn,{className:"mt-1",children:N})]}),t.jsx(Sn,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Nt,{size:16})})})]})}),t.jsx(nt,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(b),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:O}),t.jsx(wn,{children:t.jsx(ne,{type:"submit",disabled:l.formState.isSubmitting,className:"w-full",children:P})})]})})]})}):t.jsx(Ft,{open:n,onOpenChange:v,children:t.jsxs($t,{className:"sm:max-w-[525px]",children:[t.jsxs(Bt,{children:[t.jsx(Lt,{children:w}),t.jsx(Vn,{children:N})]}),t.jsx(nt,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(b),children:[t.jsx("div",{className:"py-4",children:O}),t.jsxs(Rn,{children:[t.jsx(ne,{type:"button",variant:"outline",onClick:()=>v(!1),children:o("connections.createConnectionDialog.cancelButton")}),t.jsx(ne,{type:"submit",disabled:l.formState.isSubmitting,className:"min-w-40",children:P})]})]})})]})})}function Fs(n){const e=F.c(72),{mode:s,agentId:o,addedConnectionIds:i,onAdd:a,onCloneAndAdd:r,onConnectAndAdd:d,connectingItemId:c,search:m,onCreateConnection:u,onBrowseNavigate:p,defaultTab:l}=n,x=s===void 0?"add":s,y=l===void 0?"connected":l,h=V(),{org:f}=oe(),j=H.useDeferredValue(m),v=m!==j;let b;e[0]!==j?(b=j.trim().toLowerCase(),e[0]=j,e[1]=b):b=e[1];const w=b;let N;e[2]!==y?(N=D=>D??y,e[2]=y,e[3]=N):N=e[3];const[P,O]=Jt(Zt.connectionsTab(f.slug)+(y==="all"?":home-modal":":agent-modal"),N);let g;e[4]!==P||e[5]!==O?(g=D=>{D!==P&&R("connections_dialog_tab_changed",{to_tab:D}),O(D)},e[4]=P,e[5]=O,e[6]=g):g=e[6];const _=g;let T;e[7]!==f.id||e[8]!==f.slug?(T={connectionId:rn,orgId:f.id,orgSlug:f.slug},e[7]=f.id,e[8]=f.slug,e[9]=T):T=e[9];const S=ln(T),C=j?.trim().split(/\s+/).filter(Boolean)??[],I=C.length>0?{operator:"or",conditions:C.flatMap(Ks)}:void 0,k={...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},A=JSON.stringify(k),{data:z,fetchNextPage:L,hasNextPage:E,isFetchingNextPage:M}=ts({queryKey:at.collectionListInfinite(S,f.id,"","CONNECTIONS",A),queryFn:async D=>{const{pageParam:$}=D,se=$===void 0?0:$;return(await S.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:se}})).structuredContent},initialPageParam:0,getNextPageParam:Rs,staleTime:3e4}),G=z?.pages.flatMap(Vs)??[],U=En(G),de=new Set(G.filter(Es).map(Ls)),B=zt(),re=Mt(B,j),Re=mt(re.loadMore,re.hasMore,re.isLoadingMore),He=mt(L,E??!1,M),W=P==="all"||!!w,ct=W?re.items.filter(D=>{const $=$n(D);if($&&de.has($))return!1;if(!w)return!0;const se=Ve(D._meta),le=[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 C.some(te=>le.includes(te.toLowerCase()))}):[],Ne=ct.filter(Bs),_e=ct.filter($s);let Ae;e[10]!==i?(Ae=D=>D.some($=>i.has($.id)),e[10]=i,e[11]=Ae):Ae=e[11];const Ke=Ae;let Ie;e[12]!==i||e[13]!==o||e[14]!==c||e[15]!==Ke||e[16]!==x||e[17]!==a||e[18]!==p||e[19]!==r||e[20]!==h?(Ie=(D,$,se,le,te)=>{const Me=Ke(te),be=te.find(ce=>!i.has(ce.id)),q=te[0];if(x==="browse"){const ce=Zn(q);return t.jsx(Ye,{connection:{title:$,icon:se,description:te.length>1?`${te.length} instances`:le??void 0},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs($e,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",h("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{R("connection_browse_clicked",{app_name:q.app_name??null,connection_id:q.id,instances_count:te.length}),p?.(ce)}},D)}return t.jsx(Ye,{connection:{title:$,icon:se,description:le},fallbackIcon:t.jsx(Be,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Me&&t.jsxs($e,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",h("virtualMcp.connectionDialogContent.added")]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:ce=>{ce.stopPropagation(),be?(R("connection_add_clicked",{action:"use_existing",app_name:q.app_name??null,connection_id:be.id}),o&&R("agent_connection_attached",{agent_id:o,connection_id:be.id,app_name:q.app_name??null,mode:"existing"}),a(be.id)):(R("connection_add_clicked",{action:"clone",app_name:q.app_name??null,base_connection_id:q.id}),r(q))},children:h("virtualMcp.connectionDialogContent.add")})]})},D)},e[12]=i,e[13]=o,e[14]=c,e[15]=Ke,e[16]=x,e[17]=a,e[18]=p,e[19]=r,e[20]=h,e[21]=Ie):Ie=e[21];const Pe=Ie;let Te;e[22]!==c||e[23]!==x||e[24]!==d||e[25]!==h?(Te=D=>{const $=Ve(D._meta),se=$?.friendlyName||$?.friendly_name||D.server?.title||D.title||D.server?.name||D.name||D.id||"",le=D.server?.description||D.description||null,te=D.server?.icons?.[0]?.src||Bn(D.server?.repository)||null,Me=$?.official===!0,be=$?.verified===!0,q=$?.owner==="deco";return t.jsx(Ye,{connection:{title:se,description:le,icon:te},fallbackIcon:t.jsx(Be,{}),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:h("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(ye,{children:h("virtualMcp.connectionDialogContent.builtByDeco")})]}),!q&&Me&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx($e,{variant:"outline",size:"icon",children:t.jsx(Je,{})})}),t.jsx(ye,{children:h("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!q&&!Me&&be&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx($e,{variant:"outline",size:"icon",children:t.jsx(Je,{})})}),t.jsx(ye,{children:h("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:c!==null,onClick:ce=>{ce.stopPropagation(),R("connection_add_clicked",{action:"connect_new",registry_item_id:D.id,app_name:$?.friendlyName||D.server?.name||D.name||null}),d(D)},children:c===D.id?t.jsx(ke,{size:14,className:"animate-spin"}):h(x==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${D.id}`)},e[22]=c,e[23]=x,e[24]=d,e[25]=h,e[26]=Te):Te=e[26];const dt=Te;let ue;e[27]!==P||e[28]!==_||e[29]!==u||e[30]!==w||e[31]!==h?(ue=!w&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(es,{tabs:[{id:"all",label:h("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:h("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:P,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}),h("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=P,e[28]=_,e[29]=u,e[30]=w,e[31]=h,e[32]=ue):ue=e[32];const Ue=v&&"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 Ht="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 $=D.connection;return Pe($.id,$.title,$.icon,$.description??null,[$])},e[35]=Pe,e[36]=Oe):Oe=e[36];const Ge=U.map(Oe);let fe;e[37]!==He?(fe=t.jsx("div",{ref:He,className:"col-span-full h-1"}),e[37]=He,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 qe=W&&Ne.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(Je,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:h("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Xe=W&&Ne.map(dt),We=W&&_e.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:h("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Qe=W&&_e.map(dt);let pe;e[41]!==Re||e[42]!==B||e[43]!==W?(pe=W&&B.length>0&&t.jsx("div",{ref:Re,className:"col-span-full h-1"}),e[41]=Re,e[42]=B,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]!==Ge||e[49]!==fe||e[50]!==ge||e[51]!==qe||e[52]!==Xe||e[53]!==We||e[54]!==Qe||e[55]!==pe||e[56]!==he?(xe=t.jsxs("div",{className:Ht,children:[Ge,fe,ge,qe,Xe,We,Qe,pe,he]}),e[48]=Ge,e[49]=fe,e[50]=ge,e[51]=qe,e[52]=Xe,e[53]=We,e[54]=Qe,e[55]=pe,e[56]=he,e[57]=xe):xe=e[57];let je;e[58]!==P||e[59]!==U.length||e[60]!==_e||e[61]!==m||e[62]!==h||e[63]!==Ne?(je=U.length===0&&Ne.length===0&&_e.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:m?h("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:m}):h(P==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=P,e[59]=U.length,e[60]=_e,e[61]=m,e[62]=h,e[63]=Ne,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 Bs(n){return n.verified||Ve(n._meta)?.verified||n.meta?.verified}function Ls(n){return n.app_name}function Es(n){return n.app_name}function Vs(n){return n?.items??[]}function Rs(n,e){if(n?.hasMore)return e.reduce(Hs,0)}function Hs(n,e){return n+(e?.items?.length??0)}function Ks(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function Eo({open:n,onOpenChange:e,defaultTab:s,initialSearch:o="",...i}){const a=V(),r=i.mode??"add",d="agentId"in i?i.agentId:void 0,c="addedConnectionIds"in i?i.addedConnectionIds??new Set:new Set,m="onAdd"in i&&i.onAdd?i.onAdd:S=>{},u=(S,C,I)=>{d&&R("agent_connection_attached",{agent_id:d,connection_id:S,app_name:C,mode:I})},[p,l]=H.useState(null),[x,y]=H.useState(o),[h,f]=H.useState(!1),{org:j}=oe(),{data:v}=ae.useSession(),b=Et(),w=en(),N=st(),P=S=>{e(!1),N({to:"/$org/settings/connections/$appSlug",params:{org:j.slug,appSlug:S}})},O=()=>{w.invalidateQueries({predicate:S=>{const C=S.queryKey;return C[1]===j.id&&C[3]==="collection"&&C[4]==="CONNECTIONS"}})},g=async(S,C)=>{R("connection_oauth_succeeded",{connection_id:S,flow:C});const I=new URL(`/api/${j.slug}/mcp/${S}`,window.location.origin);await w.invalidateQueries({queryKey:at.isMCPAuthenticated(I.href,null)}),O()},_=async S=>{l(S.app_name??S.id);try{const I=`${S.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,A=(await b.create.mutateAsync({title:I,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 et({connectionId:A,orgId:j.id,orgSlug:j.slug,persistFallback:L=>b.update.mutateAsync({id:A,data:{connection_token:L}}).then(()=>{})});if(z.ran&&!z.ok){R("connection_oauth_failed",{connection_id:A,flow:"clone",error:z.error??"no_token"}),K.error(a("virtualMcp.addConnectionDialog.authenticationFailedError",{error:z.error??"no token received"})),await b.delete.mutateAsync(A);return}z.ran&&await g(A,"clone"),u(A,S.app_name??null,"clone"),m(A)}catch(C){console.error("Failed to add connection:",C),K.error(a("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{l(null)}},T=async S=>{if(!(!j||!v?.user?.id)){l(S.id);try{const C=Ln(S,j.id,v.user.id,{remoteIndex:0}),I=C.connection_type==="STDIO",k=!!C.connection_url,A=I&&C.connection_headers&&typeof C.connection_headers=="object"&&"command"in C.connection_headers;if(!k&&!A){K.error(a("virtualMcp.addConnectionDialog.mcpServerConnectionError")),l(null);return}const{id:z}=await b.create.mutateAsync(C),L=await et({connectionId:z,orgId:j.id,orgSlug:j.slug,persistFallback:E=>b.update.mutateAsync({id:z,data:{connection_token:E}}).then(()=>{})});if(L.ran&&!L.ok){R("connection_oauth_failed",{connection_id:z,flow:"connect_new",error:L.error??"no_token"}),K.warning(a("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:a("virtualMcp.addConnectionDialog.signInFailedDescription",{error:L.error??"no token received"})}),u(z,C.app_name??null,"new"),m(z);return}L.ran?(await g(z,"connect_new"),K.success(a("virtualMcp.addConnectionDialog.connectedAuthenticated"))):K.success(a("virtualMcp.addConnectionDialog.connected")),u(z,C.app_name??null,"new"),m(z)}catch(C){console.error("Failed to connect:",C),K.error(a("virtualMcp.addConnectionDialog.failedToConnect"))}finally{l(null)}}};return t.jsxs(Ft,{open:n,onOpenChange:e,children:[t.jsxs($t,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(Bt,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(Lt,{className:"text-base font-semibold",children:a(r==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(Mn,{value:x,onChange:y,placeholder:a("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(Fs,{mode:r,agentId:d,addedConnectionIds:c,onAdd:m,onCloneAndAdd:_,onConnectAndAdd:T,connectingItemId:p,search:x,onCreateConnection:()=>f(!0),onBrowseNavigate:P,defaultTab:s})})]}),t.jsx(Ms,{open:h,onOpenChange:f,onCreated:async S=>{f(!1);const C=await et({connectionId:S,orgId:j.id,orgSlug:j.slug,persistFallback:I=>b.update.mutateAsync({id:S,data:{connection_token:I}}).then(()=>{})});if(C.ran&&!C.ok){R("connection_oauth_failed",{connection_id:S,flow:"custom_create",error:C.error??"no_token"}),K.warning(a("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:a("virtualMcp.addConnectionDialog.signInFailedDescription",{error:C.error??"no token received"})}),u(S,null,"custom"),m(S),e(!1);return}C.ran&&await g(S,"custom_create"),u(S,null,"custom"),m(S),e(!1)}})]})}const gt=new Map;function Vo(){const{org:n}=oe(),e=ns(),s=ss(),o=s.find(f=>f.providerId==="deco"),{data:i,isLoading:a,refetch:r,isFetching:d}=tn({queryKey:at.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),c=i?.balanceCents??null,m=c!=null?c/100:null,u=H.useRef(new Map);if(c!=null){const f=gt.get(n.id);u.current.get(n.id)&&f!=null&&c>f&&R("credits_topped_up_detected",{organization_id:n.id,delta_cents:c-f,previous_balance_cents:f,new_balance_cents:c}),gt.set(n.id,c),u.current.set(n.id,!0)}const p=!!o,l=c!=null&&c>0,x=c!=null&&c===0,y=c!=null&&c===200,h=s.length>0&&s.every(f=>f.providerId==="deco");return{hasDecoKey:p,decoKeyId:o?.id??null,balanceCents:c,balanceDollars:m,hasCredits:l,isZeroBalance:x,isInitialFreeCredit:y,hasOnlyDecoProvider:h,isLoading:a,isFetching:d,refetch:r}}export{Bo as A,Lo as N,$o as O,Eo as a,ds as b,lt as c,Vo as u};
|
package/dist/client/assets/{use-decopilot-events-rxVRItI-.js → use-decopilot-events-CoPRmIh1.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-CpB-IlaU.js";import{d as R,D as u}from"./decopilot-sse-pool-DF2dyY7L.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-B_FlrK-N.js → use-delete-connection-_Rvwmzkz.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,b2 as re,b3 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,b2 as re,b3 as ae}from"./index-CpB-IlaU.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-nUW7phRB.js";import{u as de}from"./studio-tools-D5VF1LfT.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-C-egalAw.js → use-deployment-admin-Bdv9ISo-.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-CpB-IlaU.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-CpB-IlaU.js";import{u as f}from"./studio-tools-D5VF1LfT.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-BoPeF6JW.js → use-infinite-scroll-Cjxmjx6A.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aM as d,dV as l,dW as v,r as i}from"./index-
|
|
1
|
+
import{aM as d,dV as l,dW as v,r as i}from"./index-CpB-IlaU.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-CpB-IlaU.js";import{a as S}from"./use-capability-DBGC11nS.js";import{u as O}from"./studio-tools-D5VF1LfT.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};
|