decocms 4.150.21 → 4.150.23
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-BaA3X0Vc.js → AlertCircle-DcJb8iRa.js} +1 -1
- package/dist/client/assets/{AreaChart-B4pcuH23.js → AreaChart-CnXGIMEc.js} +1 -1
- package/dist/client/assets/{ArrowUp-Df4rbgne.js → ArrowUp-D0IVwHrj.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-fq20wgvL.js → ArrowUpRight-BDfLBQkt.js} +1 -1
- package/dist/client/assets/{Check-DdyKCl8O.js → Check-gjVkLyjz.js} +1 -1
- package/dist/client/assets/{CheckCircle-IiUO6eKZ.js → CheckCircle-Brw1At1c.js} +1 -1
- package/dist/client/assets/{ChevronDown-BSVV4L9A.js → ChevronDown-C6lfFArn.js} +1 -1
- package/dist/client/assets/{ChevronRight-CSgj0z6i.js → ChevronRight-D5LzDyDE.js} +1 -1
- package/dist/client/assets/{ChevronUp-GR0-Yt4d.js → ChevronUp-eoLttylI.js} +1 -1
- package/dist/client/assets/{Copy01-Cv0Vuqbe.js → Copy01-xzQ4ogmG.js} +1 -1
- package/dist/client/assets/{CpuChip01-UMJdnf1a.js → CpuChip01-D3yBcvwh.js} +1 -1
- package/dist/client/assets/{DotsVertical-OBlENp_a.js → DotsVertical-B81JSfTm.js} +1 -1
- package/dist/client/assets/{Eye-CkjEvMwH.js → Eye-Bbyfcz3U.js} +1 -1
- package/dist/client/assets/{FilterLines-Ca7W3tHb.js → FilterLines-g4cIObbX.js} +1 -1
- package/dist/client/assets/{HardDrive-B91rzidb.js → HardDrive-BAom8AR4.js} +1 -1
- package/dist/client/assets/{Key01-DVGzNfoY.js → Key01-3KmfaqoQ.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Ciug-ep8.js → LayoutLeft-Cvh2z-Gq.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CbfqV87q.js → LinkExternal01-CZSiz4Ic.js} +1 -1
- package/dist/client/assets/{LogOut01-B0JVxGo4.js → LogOut01-BV9cjMBN.js} +1 -1
- package/dist/client/assets/{Monitor01-CEdUOtdj.js → Monitor01-fc3ZhEXF.js} +1 -1
- package/dist/client/assets/{Palette-DgmLnO_l.js → Palette-B_TkkqR9.js} +1 -1
- package/dist/client/assets/{Play-DcSuTxiG.js → Play-DjHrAgT6.js} +1 -1
- package/dist/client/assets/{Plus-DUvbS-Yy.js → Plus-CikdUs38.js} +1 -1
- package/dist/client/assets/{SearchLg-CSWY8viA.js → SearchLg-JzU424qf.js} +1 -1
- package/dist/client/assets/{SearchMd-D0poZQV_.js → SearchMd-BOfFIRRH.js} +1 -1
- package/dist/client/assets/{Settings02-Sy5kNpSu.js → Settings02-CBDIwie_.js} +1 -1
- package/dist/client/assets/{Shield01-Bcql6hT4.js → Shield01-DefKd0oD.js} +1 -1
- package/dist/client/assets/{Star01-2mO5G0Xw.js → Star01-KVwXdwxj.js} +1 -1
- package/dist/client/assets/{Stars01-DqIThrOc.js → Stars01-C-4SXXn7.js} +1 -1
- package/dist/client/assets/{Stars02-cKtwD-F2.js → Stars02-BoANd6Kf.js} +1 -1
- package/dist/client/assets/{Sun-DsnsEGXF.js → Sun-HcIWpb0y.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BwAs_KcG.js → SwitchHorizontal01-DE5mPN2-.js} +1 -1
- package/dist/client/assets/{Tool01-D2fd-Mg5.js → Tool01-hFe2UsG9.js} +1 -1
- package/dist/client/assets/{Tool02-C17Y4pBP.js → Tool02-Byyk9Vee.js} +1 -1
- package/dist/client/assets/{Trash01-BiVOd2DS.js → Trash01-TtVBqMTN.js} +1 -1
- package/dist/client/assets/{TrendUp01-D1GkdBOV.js → TrendUp01-B2goMTVh.js} +1 -1
- package/dist/client/assets/{Upload01-k2Sn0RXQ.js → Upload01-CbyAB4oE.js} +1 -1
- package/dist/client/assets/{User01-cC3unvvx.js → User01-lSU_Ire_.js} +1 -1
- package/dist/client/assets/{Users01-BdNSg6CC.js → Users01-DwgtBHFJ.js} +1 -1
- package/dist/client/assets/{Users03-CqyDxwt6.js → Users03-Rq4uYvEF.js} +1 -1
- package/dist/client/assets/{X-Baqkpp1k.js → X-3PgyJoHo.js} +1 -1
- package/dist/client/assets/{XCircle-8Wd2-AR5.js → XCircle-j11o8nYG.js} +1 -1
- package/dist/client/assets/{XClose-CBFLmbVP.js → XClose-B5-EL_eq.js} +1 -1
- package/dist/client/assets/{Zap-C4qF8Cn-.js → Zap-YaHmPbs0.js} +1 -1
- package/dist/client/assets/{ZapSquare-BH7ie7zg.js → ZapSquare-BY3CWoiI.js} +1 -1
- package/dist/client/assets/{access-gate-CxXZPkIw.js → access-gate-BrRUOUYq.js} +1 -1
- package/dist/client/assets/{add-section-modal-C7ktQCug.js → add-section-modal-IHIfksTy.js} +1 -1
- package/dist/client/assets/{agent-icon-q4cV7U67.js → agent-icon-D5JzlR5X.js} +1 -1
- package/dist/client/assets/{agents-list-UZwnNOjT.js → agents-list-CaVLSFy6.js} +1 -1
- package/dist/client/assets/{ai-providers-Cput0kVL.js → ai-providers-BeddGROn.js} +1 -1
- package/dist/client/assets/{alert-DjeIAXMV.js → alert-DliKxZ_m.js} +1 -1
- package/dist/client/assets/{alert-dialog-DIwINRgW.js → alert-dialog-BKskXtEG.js} +1 -1
- package/dist/client/assets/{app-editor-DdSH3pAD.js → app-editor-C2ptf1Dh.js} +1 -1
- package/dist/client/assets/{auth-catchall-6cph4qce.js → auth-catchall-CXtu3uVP.js} +1 -1
- package/dist/client/assets/{auth-entry-i0rNcujn.js → auth-entry-CqXrI1mX.js} +1 -1
- package/dist/client/assets/{auth-split-layout-3qPwGE8Z.js → auth-split-layout-C4pHBCKt.js} +1 -1
- package/dist/client/assets/{auth-FouChJbb.js → auth-t69bSn2K.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Dx2DT3YD.js → authenticate-and-persist-oauth-DqnkEHz5.js} +1 -1
- package/dist/client/assets/{automation-list-row-Brn7k31U.js → automation-list-row-B3d7Fa8J.js} +1 -1
- package/dist/client/assets/{automation-runs-CP1cxXFo.js → automation-runs-Bwrqu-lm.js} +1 -1
- package/dist/client/assets/{automations-BlJndOBe.js → automations--79t6PzC.js} +1 -1
- package/dist/client/assets/{avatar-Du8HEobV.js → avatar-CPVdCa-q.js} +1 -1
- package/dist/client/assets/{badge-swCoKQnC.js → badge-PIDJwXZe.js} +1 -1
- package/dist/client/assets/{block-document-DiB0SOp5.js → block-document-D7e2Se-F.js} +1 -1
- package/dist/client/assets/{brand-context-C8l7XNKr.js → brand-context-BPLsCkvC.js} +1 -1
- package/dist/client/assets/{buckets-Bs0sTGAu.js → buckets-B1d9Lx14.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-DE5pUVzi.js → bulk-category-panel-qFVuIjK-.js} +1 -1
- package/dist/client/assets/{calendar-BZcldUNV.js → calendar-BzP-iZOP.js} +1 -1
- package/dist/client/assets/{capability-load-error-CqwI-nav.js → capability-load-error-B7iCz6mL.js} +1 -1
- package/dist/client/assets/{card-9OUE6Bzl.js → card-rdaxkAgx.js} +1 -1
- package/dist/client/assets/{category-editor-JK7DojfI.js → category-editor-Dnug34di.js} +1 -1
- package/dist/client/assets/{chat-context-DYO1ODPB.js → chat-context-DUpUs54F.js} +1 -1
- package/dist/client/assets/{checkbox-Dd_rqLvT.js → checkbox-D-QJq7XZ.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CFsjKhGa.js → cli-auth-success-BD5lLz9y.js} +1 -1
- package/dist/client/assets/{collection-detail-D0rtc2gf.js → collection-detail-wBVCEcj_.js} +1 -1
- package/dist/client/assets/{collection-display-button-iD10GGdW.js → collection-display-button-BCk9o0Bw.js} +1 -1
- package/dist/client/assets/{collection-search-5SFjfCC8.js → collection-search-lkrkOSW6.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-fW-dsmLE.js → collection-table-wrapper-C8UgE-LV.js} +1 -1
- package/dist/client/assets/{collection-tabs-DnykrgWW.js → collection-tabs-CTE8Yg6C.js} +1 -1
- package/dist/client/assets/{command-CDVbjOi5.js → command-D9ijNPQj.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-CAOuADZ6.js → commerce-onboarding-Dqki5bhb.js} +1 -1
- package/dist/client/assets/{companions-core-6m5dy3es.js → companions-core-BQihQDwO.js} +1 -1
- package/dist/client/assets/{connect-B_K53Vaa.js → connect-CIafENMH.js} +1 -1
- package/dist/client/assets/{connection-DhlrJlFw.js → connection-D8Dv76YE.js} +1 -1
- package/dist/client/assets/{connection-card-CzF-xjYn.js → connection-card-B28rU1ux.js} +1 -1
- package/dist/client/assets/{connection-detail-DmWTCewb.js → connection-detail-BMNykvoh.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DRviH-Au.js → connection-form-helpers-LdFIzzLF.js} +1 -1
- package/dist/client/assets/{connections-DGvaZBx3.js → connections-CbFZ_fyr.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-BXMXu1gQ.js → decopilot-sse-pool-6EUNiAy6.js} +1 -1
- package/dist/client/assets/{dialog-C82H2S70.js → dialog-Ezhjz9E0.js} +1 -1
- package/dist/client/assets/{domain-settings-DPn_9rd3.js → domain-settings-DrRRmNHM.js} +1 -1
- package/dist/client/assets/{drawer-lnIGl-vb.js → drawer-2Y1dMuWR.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CRGAwBji.js → dropdown-menu-BmsikUlK.js} +1 -1
- package/dist/client/assets/{empty-state-BKzUesA7.js → empty-state-DEooU27n.js} +1 -1
- package/dist/client/assets/{extract-connection-data-B9TIJ0UC.js → extract-connection-data-DNA7o6q8.js} +1 -1
- package/dist/client/assets/{file-explorer-tNI79jXo.js → file-explorer-D0PiN9vT.js} +1 -1
- package/dist/client/assets/{form-DAiRK0vx.js → form-CdwOvuuM.js} +1 -1
- package/dist/client/assets/{general-CXtIEOrf.js → general-B8KMAgiV.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DUNQ1oJW.js → github-repo-picker-DyeCKBgn.js} +1 -1
- package/dist/client/assets/{hooks-Bom1QoTc.js → hooks-DUfbKzwY.js} +1 -1
- package/dist/client/assets/{index-2KxPRjw5.js → index-30J4z2dD.js} +4 -4
- package/dist/client/assets/{index-D7cNsGmf.js → index-BE_dAky8.js} +3 -3
- package/dist/client/assets/{index-oBYlsJ_o.js → index-BH_MYqNK.js} +1 -1
- package/dist/client/assets/{index-BDQ6Ogmu.js → index-C0-pfybn.js} +5 -5
- package/dist/client/assets/{index-C_5SQGG6.js → index-CJmDrukF.js} +1 -1
- package/dist/client/assets/{index-Dv8k1EHh.js → index-CT4vVVkh.js} +1 -1
- package/dist/client/assets/{index-Df7LGqDK.js → index-CTHVCKuU.js} +1 -1
- package/dist/client/assets/{index-C-JAJ-o5.js → index-D5lX6giL.js} +1 -1
- package/dist/client/assets/{index-Z4CG7jJp.js → index-D97fya3E.js} +1 -1
- package/dist/client/assets/{index-DK8HHLRp.js → index-DsC6nOfN.js} +1 -1
- package/dist/client/assets/{index-redirect-Cj-NIgvU.js → index-redirect-C59786pk.js} +1 -1
- package/dist/client/assets/{index-B_kqSbsO.js → index-wU-cy7bZ.js} +1 -1
- package/dist/client/assets/{input-BAuCATqg.js → input-DO6f6Oyi.js} +1 -1
- package/dist/client/assets/{integration-icon-DKBuU8Fr.js → integration-icon-gnw4DLPa.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BiHY2r7m.js → invite-member-dialog-BptogSTb.js} +1 -1
- package/dist/client/assets/{label-onkw7wrh.js → label-BOL4d07L.js} +1 -1
- package/dist/client/assets/{layout-D8O9_Poo.js → layout-B3JKz_lV.js} +1 -1
- package/dist/client/assets/{login-B0j1yr6w.js → login-BtmJvFnQ.js} +1 -1
- package/dist/client/assets/{mcp-oauth-95IH3VKT.js → mcp-oauth-CxX_EpGC.js} +1 -1
- package/dist/client/assets/{members-Y7A-UiF5.js → members-CbR6NGyc.js} +1 -1
- package/dist/client/assets/{monaco-editor-CSUtCvVX.js → monaco-editor-DRxJlsld.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-Dcug_wR7.js → monitoring-stats-row-DxMqg_RE.js} +1 -1
- package/dist/client/assets/{multi-select-C68tqs9V.js → multi-select-Ds7z77R1.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-C0UAY-58.js → oauth-callback-ai-provider-D3wpalZl.js} +1 -1
- package/dist/client/assets/{oauth-callback-CqH1tIve.js → oauth-callback-o14AOSPq.js} +1 -1
- package/dist/client/assets/{onboarding-2ZJYmqTH.js → onboarding-C1H2Rzr-.js} +1 -1
- package/dist/client/assets/{org-layout-qZcaYBLo.js → org-layout-CYKFkwe2.js} +1 -1
- package/dist/client/assets/{organization-choice-CduZOMP9.js → organization-choice-CwtI_hHl.js} +1 -1
- package/dist/client/assets/{orgs-DU0BEJAc.js → orgs-DU7XL6NJ.js} +1 -1
- package/dist/client/assets/{page-seo-form-nxKDUI-6.js → page-seo-form-CB-OJgf8.js} +1 -1
- package/dist/client/assets/{popover-x1qHvmwD.js → popover-ddNYtuzN.js} +1 -1
- package/dist/client/assets/{post-editor-BhfI7Odx.js → post-editor-pDG0QWkr.js} +1 -1
- package/dist/client/assets/{primitives-DITXbj-2.js → primitives-CgsmqPQU.js} +1 -1
- package/dist/client/assets/{profile-Dl3k4wub.js → profile-D6QujN3h.js} +1 -1
- package/dist/client/assets/project-app-view-EqdJwELN.js +1 -0
- package/dist/client/assets/record-editor-FwZf9H_x.js +1 -0
- package/dist/client/assets/{redirect-editor-BamLe0Vb.js → redirect-editor-DjloRUnO.js} +1 -1
- package/dist/client/assets/{registry-layout-Cfgh3Q9S.js → registry-layout-CoT2siHJ.js} +1 -1
- package/dist/client/assets/registry-o-K-mNuJ.js +2 -0
- package/dist/client/assets/{reports-2omVoMUm.js → reports-CbBUMCyA.js} +1 -1
- package/dist/client/assets/{require-capability-B1pg4EtO.js → require-capability-D9owsYJv.js} +1 -1
- package/dist/client/assets/{required-auth-layout-wB2bMMGI.js → required-auth-layout-C0fEZd67.js} +1 -1
- package/dist/client/assets/{reset-password-BmxFRY37.js → reset-password-CG1TeRN5.js} +1 -1
- package/dist/client/assets/{roles-ClU1umGx.js → roles-BttwbRxs.js} +1 -1
- package/dist/client/assets/{search-input-DtCL1YcZ.js → search-input-Ceaa5r9L.js} +1 -1
- package/dist/client/assets/{secrets-B-dmTgLw.js → secrets-QKqtq4bv.js} +1 -1
- package/dist/client/assets/{sections-editor-DqY5dzLX.js → sections-editor-Df2cLClj.js} +1 -1
- package/dist/client/assets/{select-DfQiZ-4J.js → select-DHyC2wGe.js} +1 -1
- package/dist/client/assets/select-model-C26oRqlD.js +4 -0
- package/dist/client/assets/{self-tool-result-BCgUr0ik.js → self-tool-result-C28rj1Ae.js} +1 -1
- package/dist/client/assets/{seo-editor-CEUCMyKF.js → seo-editor-S5ZqoAxb.js} +1 -1
- package/dist/client/assets/{settings-layout-DJLSOlbv.js → settings-layout-DI56dbNY.js} +1 -1
- package/dist/client/assets/{settings-section-BaFcIjo5.js → settings-section-BgDF_9yt.js} +1 -1
- package/dist/client/assets/{shell-controls-DIMDYHkk.js → shell-controls-BhFgVo2Q.js} +1 -1
- package/dist/client/assets/{shell-layout-B56j-p5N.js → shell-layout-D-c2X1KV.js} +1 -1
- package/dist/client/assets/{sidebar-DpVJgBAa.js → sidebar-Cwhg81Iz.js} +1 -1
- package/dist/client/assets/{skeleton-BtiEyhAl.js → skeleton-I0ZeK4UC.js} +1 -1
- package/dist/client/assets/{spinner-DPfrt4Tp.js → spinner-mEqeXw5u.js} +1 -1
- package/dist/client/assets/{sso-CICOFYfX.js → sso-Bq8zylip.js} +1 -1
- package/dist/client/assets/{store-BJgQ6scG.js → store-F-pcSCHR.js} +1 -1
- package/dist/client/assets/store-registry-CfpNP5E9.js +2 -0
- package/dist/client/assets/{studio-tools-CTJuN7Yy.js → studio-tools-kQ3NEEWO.js} +1 -1
- package/dist/client/assets/{switch-DIwoxI1y.js → switch-BRa8kkrS.js} +1 -1
- package/dist/client/assets/{tab-id-DJIms9m1.js → tab-id-C4bMCjr3.js} +1 -1
- package/dist/client/assets/{table-BbRTH9fF.js → table-x0GONNLh.js} +1 -1
- package/dist/client/assets/{tabs-DKyQ4Qe1.js → tabs-Bq81Vyjl.js} +1 -1
- package/dist/client/assets/{textarea-Y242n44c.js → textarea-CUAzWR5L.js} +1 -1
- package/dist/client/assets/{toggle-group-BBsmjOfV.js → toggle-group-Gmqz3gDK.js} +1 -1
- package/dist/client/assets/{toolbar-BaZp82JP.js → toolbar-BkBl6JIj.js} +1 -1
- package/dist/client/assets/{tooltip-CEu_we5y.js → tooltip-B-SCkbF9.js} +1 -1
- package/dist/client/assets/{use-ai-providers-B2nAOoUO.js → use-ai-providers-DiMxVRip.js} +1 -1
- package/dist/client/assets/{use-automations-irLGHKpI.js → use-automations-XL_0RJHM.js} +1 -1
- package/dist/client/assets/{use-autosave-BAjK3u8R.js → use-autosave-Hi4rlXng.js} +1 -1
- package/dist/client/assets/{use-capability-Y4a4cK2y.js → use-capability-BtPReSHt.js} +1 -1
- package/dist/client/assets/{use-clock-tick-kQx_nmDK.js → use-clock-tick-DXfDu1U2.js} +1 -1
- package/dist/client/assets/{use-connection-CvBcj0iA.js → use-connection-D0ep6AoQ.js} +1 -1
- package/dist/client/assets/{use-copy-POYUhIaM.js → use-copy-BvxfdX6N.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-Df8fpCi4.js → use-create-virtual-mcp-DgvhUI5T.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-EvVOUA6S.js → use-debounced-autosave-CHhWSqXz.js} +1 -1
- package/dist/client/assets/{use-debounced-value-IOz7dnNR.js → use-debounced-value-C8ryVVpy.js} +1 -1
- package/dist/client/assets/{use-deco-credits-CBOWsaT-.js → use-deco-credits-D_UVlDt_.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-Dc8-pFMU.js → use-decopilot-events-BnwcV4U8.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CxX7cCR_.js → use-delete-connection-CphOcDpT.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-ucDRDdNR.js → use-deployment-admin-jnxGa9l6.js} +1 -1
- package/dist/client/assets/{use-file-configs-BsCj6gUu.js → use-file-configs-DwBVeXP6.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-ccrh4_KW.js → use-infinite-scroll-DGDKOGPe.js} +1 -1
- package/dist/client/assets/{use-join-requests-DjYbXyL8.js → use-join-requests-C22v4g-F.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-vzmxIRHi.js → use-mcp-auth-status-CzVoDeIA.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DRwUSZdO.js → use-mcp-client-BsWOvAzd.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-PCSBjtNq.js → use-mcp-tools-C9hT_wdC.js} +1 -1
- package/dist/client/assets/{use-members-DjRi0Onl.js → use-members-DzQELg6H.js} +1 -1
- package/dist/client/assets/{use-mobile-CLE626Yq.js → use-mobile-DKlFMukO.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CXMG3HNZ.js → use-navigate-to-agent-39LPUcH9.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BxtVWNiI.js → use-org-auth-client-JYyEKX5R.js} +1 -1
- package/dist/client/assets/{use-org-sso-DBExuOVV.js → use-org-sso-CMGzDI_I.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DFLLP3Qo.js → use-organization-roles-Ce_u9VNe.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DKSNQ1_z.js → use-organization-settings-CJWrHwUl.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BRZCHKHD.js → use-registry-connections-BnLvWUJS.js} +1 -1
- package/dist/client/assets/{use-secrets-DfGoccAw.js → use-secrets-D5BP08GP.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DcgHuUFX.js → use-status-sounds-CP2AjcIU.js} +1 -1
- package/dist/client/assets/{use-tags-DRM6xsgU.js → use-tags-B4cYgssP.js} +1 -1
- package/dist/client/assets/{use-view-mode-DvgBYhz6.js → use-view-mode-DDu5UVga.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-D7SVi-2E.js → use-virtual-mcp-BWey1L5Y.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CvMEicTQ.js +1 -0
- package/dist/client/assets/{useQueries-DVb_HjzV.js → useQueries-CSD0nmBi.js} +1 -1
- package/dist/client/assets/{useRouterState-CJ97gzOK.js → useRouterState-Cxw9BBYF.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CtTWf1s0.js +1 -0
- package/dist/client/assets/{users-CX6W_kiO.js → users-cdoSh0K6.js} +1 -1
- package/dist/client/assets/{variant-calendar-BSUlgs-W.js → variant-calendar-R7vv4L9Y.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DULJqLEB.js → view-mode-toggle-D8EW-zjw.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +178 -177
- package/dist/server/migrate.js +7 -7
- package/dist/server/server.js +145 -145
- package/package.json +1 -1
- package/dist/client/assets/project-app-view-CrBgtatz.js +0 -1
- package/dist/client/assets/record-editor-DUGdKTe8.js +0 -1
- package/dist/client/assets/registry-B4ci0gM-.js +0 -2
- package/dist/client/assets/select-model-Clf7Hlwn.js +0 -4
- package/dist/client/assets/store-registry-Di0pCo7I.js +0 -2
- package/dist/client/assets/useInfiniteQuery-BWd6o-wh.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DPyRMURT.js +0 -1
|
@@ -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-2KxPRjw5.js";import{t as xt}from"./ChevronDown-BSVV4L9A.js";import{A as jt,j as nn,a5 as sn}from"./agent-icon-q4cV7U67.js";import{T as Ce,a as ye,c as Se}from"./tooltip-CEu_we5y.js";import{u as vt,d as bt,c as Ct}from"./sidebar-DpVJgBAa.js";import{a as rt,i as on,f as an,S as rn,u as ln}from"./use-mcp-client-DRwUSZdO.js";import{a as cn,u as dn}from"./use-virtual-mcp-D7SVi-2E.js";import{a as Le,b as yt,P as St}from"./popover-x1qHvmwD.js";import{i as Ee}from"./Check-DdyKCl8O.js";import{s as we}from"./Plus-DUvbS-Yy.js";import{i as wt}from"./SearchMd-D0poZQV_.js";import{s as Nt}from"./XClose-CBFLmbVP.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-DIwINRgW.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-DAiRK0vx.js";import{I as ie}from"./input-BAuCATqg.js";import{S as vn}from"./spinner-DPfrt4Tp.js";import{T as _t}from"./toolbar-BaZp82JP.js";import{S as bn}from"./skeleton-BtiEyhAl.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-lnIGl-vb.js";import{u as It}from"./use-mobile-CLE626Yq.js";import{a as Nn,G as _n}from"./github-repo-picker-DUNQ1oJW.js";import{g as Dn,b as kn,a as Pt}from"./hooks-Bom1QoTc.js";import{u as An,g as In,a as Pn,b as Tn}from"./use-navigate-to-agent-CXMG3HNZ.js";import{a as On,c as Tt}from"./agent-capabilities-cXfbMfjV.js";import{u as Ot}from"./shell-layout-B56j-p5N.js";import{f as zn}from"./reusable-new-chat-CouMjkYR.js";import{C as Mn}from"./collection-search-5SFjfCC8.js";import{g as Fn,a as $n,b as Bn,e as Ln}from"./extract-connection-data-B9TIJ0UC.js";import{u as zt,a as Mt,g as En,C as Ye}from"./connection-card-CzF-xjYn.js";import{e as Ft,d as $t,a as Bt,b as Lt,h as Vn,c as Rn}from"./dialog-C82H2S70.js";import{S as Hn,a as Kn,b as Un,c as Gn,d as De}from"./select-DfQiZ-4J.js";import{T as qn}from"./textarea-Y242n44c.js";import{b as Et}from"./use-connection-CvBcj0iA.js";import{a as Be,b as Je}from"./Tool02-C17Y4pBP.js";import{s as Ze}from"./Star01-2mO5G0Xw.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-DRviH-Au.js";import{a as et}from"./authenticate-and-persist-oauth-Dx2DT3YD.js";import{g as Zn}from"./connection-slug-eyAPH6o3.js";import{C as es}from"./collection-tabs-DnykrgWW.js";import{u as mt}from"./use-infinite-scroll-ccrh4_KW.js";import{B as $e}from"./badge-swCoKQnC.js";import{u as ts}from"./useSuspenseInfiniteQuery-DPyRMURT.js";import{g as Ve}from"./metadata-dUsYcpuu.js";import{u as ns}from"./studio-tools-CTJuN7Yy.js";import{u as ss}from"./use-ai-providers-B2nAOoUO.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="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:"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:"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:"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-30J4z2dD.js";import{t as xt}from"./ChevronDown-C6lfFArn.js";import{A as jt,j as nn,a5 as sn}from"./agent-icon-D5JzlR5X.js";import{T as Ce,a as ye,c as Se}from"./tooltip-B-SCkbF9.js";import{u as vt,d as bt,c as Ct}from"./sidebar-Cwhg81Iz.js";import{a as rt,i as on,f as an,S as rn,u as ln}from"./use-mcp-client-BsWOvAzd.js";import{a as cn,u as dn}from"./use-virtual-mcp-BWey1L5Y.js";import{a as Le,b as yt,P as St}from"./popover-ddNYtuzN.js";import{i as Ee}from"./Check-gjVkLyjz.js";import{s as we}from"./Plus-CikdUs38.js";import{i as wt}from"./SearchMd-BOfFIRRH.js";import{s as Nt}from"./XClose-B5-EL_eq.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-BKskXtEG.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-CdwOvuuM.js";import{I as ie}from"./input-DO6f6Oyi.js";import{S as vn}from"./spinner-mEqeXw5u.js";import{T as _t}from"./toolbar-BkBl6JIj.js";import{S as bn}from"./skeleton-I0ZeK4UC.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-2Y1dMuWR.js";import{u as It}from"./use-mobile-DKlFMukO.js";import{a as Nn,G as _n}from"./github-repo-picker-DyeCKBgn.js";import{g as Dn,b as kn,a as Pt}from"./hooks-DUfbKzwY.js";import{u as An,g as In,a as Pn,b as Tn}from"./use-navigate-to-agent-39LPUcH9.js";import{a as On,c as Tt}from"./agent-capabilities-cXfbMfjV.js";import{u as Ot}from"./shell-layout-D-c2X1KV.js";import{f as zn}from"./reusable-new-chat-CouMjkYR.js";import{C as Mn}from"./collection-search-lkrkOSW6.js";import{g as Fn,a as $n,b as Bn,e as Ln}from"./extract-connection-data-DNA7o6q8.js";import{u as zt,a as Mt,g as En,C as Ye}from"./connection-card-B28rU1ux.js";import{e as Ft,d as $t,a as Bt,b as Lt,h as Vn,c as Rn}from"./dialog-Ezhjz9E0.js";import{S as Hn,a as Kn,b as Un,c as Gn,d as De}from"./select-DHyC2wGe.js";import{T as qn}from"./textarea-CUAzWR5L.js";import{b as Et}from"./use-connection-D0ep6AoQ.js";import{a as Be,b as Je}from"./Tool02-Byyk9Vee.js";import{s as Ze}from"./Star01-KVwXdwxj.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-LdFIzzLF.js";import{a as et}from"./authenticate-and-persist-oauth-DqnkEHz5.js";import{g as Zn}from"./connection-slug-eyAPH6o3.js";import{C as es}from"./collection-tabs-CTE8Yg6C.js";import{u as mt}from"./use-infinite-scroll-DGDKOGPe.js";import{B as $e}from"./badge-PIDJwXZe.js";import{u as ts}from"./useSuspenseInfiniteQuery-CtTWf1s0.js";import{g as Ve}from"./metadata-dUsYcpuu.js";import{u as ns}from"./studio-tools-kQ3NEEWO.js";import{u as ss}from"./use-ai-providers-DiMxVRip.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="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:"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:"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:"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-Dc8-pFMU.js → use-decopilot-events-BnwcV4U8.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-30J4z2dD.js";import{d as R,D as u}from"./decopilot-sse-pool-6EUNiAy6.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-CxX7cCR_.js → use-delete-connection-CphOcDpT.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,b0 as re,b1 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,b0 as re,b1 as ae}from"./index-30J4z2dD.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-BKskXtEG.js";import{u as de}from"./studio-tools-kQ3NEEWO.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-ucDRDdNR.js → use-deployment-admin-jnxGa9l6.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-30J4z2dD.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-30J4z2dD.js";import{u as f}from"./studio-tools-kQ3NEEWO.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-ccrh4_KW.js → use-infinite-scroll-DGDKOGPe.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-30J4z2dD.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-30J4z2dD.js";import{a as S}from"./use-capability-BtPReSHt.js";import{u as O}from"./studio-tools-kQ3NEEWO.js";function b(){const e=g.c(10),{org:r}=N(),u=O(),{capabilities:a,isPrivileged:c}=S(),d=c||!!a["members:manage"];let t;e[0]!==r.id?(t=y.organizationJoinRequests(r.id),e[0]=r.id,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=u,e[3]=s):s=e[3];const i=!!r.id&&d;let n;e[4]!==t||e[5]!==s||e[6]!==i?(n={queryKey:t,queryFn:s,enabled:i},e[4]=t,e[5]=s,e[6]=i,e[7]=n):n=e[7];const{data:l}=_(n);let o;return e[8]!==l?.requests?(o=l?.requests??[],e[8]=l?.requests,e[9]=o):o=e[9],o}function K(){const e=g.c(21),{org:r,locator:u}=N(),a=O(),c=A();let d;e[0]!==u||e[1]!==r||e[2]!==c?(d=()=>{c.invalidateQueries({queryKey:y.organizationJoinRequests(r.id)}),c.invalidateQueries({queryKey:y.members(u)})},e[0]=u,e[1]=r,e[2]=c,e[3]=d):d=e[3];const t=d;let s;e[4]!==a?(s=R=>a.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:R}),e[4]=a,e[5]=s):s=e[5];let i;e[6]!==t?(i=()=>{t(),q.success("Request approved")},e[6]=t,e[7]=i):i=e[7];let n;e[8]!==s||e[9]!==i?(n={mutationFn:s,onSuccess:i,onError:v},e[8]=s,e[9]=i,e[10]=n):n=e[10];const l=I(n);let o;e[11]!==a?(o=R=>a.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:R}),e[11]=a,e[12]=o):o=e[12];let f;e[13]!==t?(f=()=>{t(),q.success("Request denied")},e[13]=t,e[14]=f):f=e[14];let m;e[15]!==o||e[16]!==f?(m={mutationFn:o,onSuccess:f,onError:T},e[15]=o,e[16]=f,e[17]=m):m=e[17];const E=I(m);let p;return e[18]!==l||e[19]!==E?(p={approve:l,deny:E},e[18]=l,e[19]=E,e[20]=p):p=e[20],p}function T(e){return q.error(e instanceof Error?e.message:"Failed to deny")}function v(e){return q.error(e instanceof Error?e.message:"Failed to approve")}export{K as a,b as u};
|
package/dist/client/assets/{use-mcp-auth-status-vzmxIRHi.js → use-mcp-auth-status-CzVoDeIA.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as R,aD as z,aB as V,j as a,bz as W,ay as x,aC as I,bA as Y,aE as C,bB as P,bC as Q,aA as A,by as X,bx as J,c as S,b as Z,z as ee,aw as oe,F as te,K as re,x as se}from"./index-
|
|
1
|
+
import{r as R,aD as z,aB as V,j as a,bz as W,ay as x,aC as I,bA as Y,aE as C,bB as P,bC as Q,aA as A,by as X,bx as J,c as S,b as Z,z as ee,aw as oe,F as te,K as re,x as se}from"./index-30J4z2dD.js";import{B as _}from"./badge-PIDJwXZe.js";import{c as k,T as E,a as w,b as ae}from"./tooltip-B-SCkbF9.js";import{g as ne}from"./index-CT4vVVkh.js";import{s as ie}from"./Eye-Bbyfcz3U.js";import{s as ce}from"./Star01-KVwXdwxj.js";import{aN as le}from"./agent-icon-D5JzlR5X.js";import{i as de}from"./mcp-oauth-CxX_EpGC.js";var g="Radio",[ue,N]=A(g),[pe,fe]=ue(g),T=R.forwardRef((d,e)=>{const{__scopeRadio:t,name:n,checked:o=!1,required:r,disabled:s,value:i="on",onCheck:c,form:l,...f}=d,[u,v]=R.useState(null),p=I(e,h=>v(h)),m=R.useRef(!1),y=u?l||!!u.closest("form"):!0;return a.jsxs(pe,{scope:t,checked:o,disabled:s,children:[a.jsx(x.button,{type:"button",role:"radio","aria-checked":o,"data-state":D(o),"data-disabled":s?"":void 0,disabled:s,value:i,...f,ref:p,onClick:C(d.onClick,h=>{o||c?.(),y&&(m.current=h.isPropagationStopped(),m.current||h.stopPropagation())})}),y&&a.jsx(L,{control:u,bubbles:!m.current,name:n,value:i,checked:o,required:r,disabled:s,form:l,style:{transform:"translateX(-100%)"}})]})});T.displayName=g;var G="RadioIndicator",K=R.forwardRef((d,e)=>{const{__scopeRadio:t,forceMount:n,...o}=d,r=fe(G,t);return a.jsx(Q,{present:n||r.checked,children:a.jsx(x.span,{"data-state":D(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:e})})});K.displayName=G;var ve="RadioBubbleInput",L=R.forwardRef(({__scopeRadio:d,control:e,checked:t,bubbles:n=!0,...o},r)=>{const s=R.useRef(null),i=I(s,r),c=X(t),l=J(e);return R.useEffect(()=>{const f=s.current;if(!f)return;const u=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(u,"checked").set;if(c!==t&&p){const m=new Event("click",{bubbles:n});p.call(f,t),f.dispatchEvent(m)}},[c,t,n]),a.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...o,tabIndex:-1,ref:i,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});L.displayName=ve;function D(d){return d?"checked":"unchecked"}var me=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],b="RadioGroup",[Re]=A(b,[P,N]),O=P(),B=N(),[ye,he]=Re(b),M=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,name:n,defaultValue:o,value:r,required:s=!1,disabled:i=!1,orientation:c,dir:l,loop:f=!0,onValueChange:u,...v}=d,p=O(t),m=z(l),[y,h]=V({prop:r,defaultProp:o??null,onChange:u,caller:b});return a.jsx(ye,{scope:t,name:n,required:s,disabled:i,value:y,onValueChange:h,children:a.jsx(W,{asChild:!0,...p,orientation:c,dir:m,loop:f,children:a.jsx(x.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":i?"":void 0,dir:m,...v,ref:e})})})});M.displayName=b;var U="RadioGroupItem",F=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,disabled:n,...o}=d,r=he(U,t),s=r.disabled||n,i=O(t),c=B(t),l=R.useRef(null),f=I(e,l),u=r.value===o.value,v=R.useRef(!1);return R.useEffect(()=>{const p=y=>{me.includes(y.key)&&(v.current=!0)},m=()=>v.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",m)}},[]),a.jsx(Y,{asChild:!0,...i,focusable:!s,active:u,children:a.jsx(T,{disabled:s,required:r.required,checked:u,...c,...o,name:r.name,ref:f,onCheck:()=>r.onValueChange(o.value),onKeyDown:C(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:C(o.onFocus,()=>{v.current&&l.current?.click()})})})});F.displayName=U;var xe="RadioGroupIndicator",q=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,...n}=d,o=B(t);return a.jsx(K,{...o,...n,ref:e})});q.displayName=xe;var Pe=M,Ae=F,Se=q;const be=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:ie,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:ee,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:oe,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:ce,variant:"outline"}];function Ne(d){const e=S.c(22),{annotations:t,_meta:n}=d,o=Z();let r;e[0]!==n?(r=ne(n),e[0]=n,e[1]=r):r=e[1];const s=!!r;let i,c,l,f,u;if(e[2]!==t||e[3]!==s||e[4]!==o){u=Symbol.for("react.early_return_sentinel");e:{const m=t?be.filter(h=>t[h.key]===!0):[];if(m.length===0&&!s){u=null;break e}i=ae,c="flex gap-1 flex-nowrap",e[10]!==s||e[11]!==o?(l=s&&a.jsxs(k,{children:[a.jsx(E,{asChild:!0,children:a.jsx(_,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:a.jsx(le,{})})}),a.jsx(w,{children:o("tools.toolsList.interactive")})]}),e[10]=s,e[11]=o,e[12]=l):l=e[12];let y;e[13]!==o?(y=h=>{const{labelKey:j,Icon:H,variant:$}=h;return a.jsxs(k,{children:[a.jsx(E,{asChild:!0,children:a.jsx(_,{asChild:!0,variant:$,className:"size-6 p-1",children:a.jsx(H,{})})}),a.jsx(w,{children:o(j)})]},j)},e[13]=o,e[14]=y):y=e[14],f=m.map(y)}e[2]=t,e[3]=s,e[4]=o,e[5]=i,e[6]=c,e[7]=l,e[8]=f,e[9]=u}else i=e[5],c=e[6],l=e[7],f=e[8],u=e[9];if(u!==Symbol.for("react.early_return_sentinel"))return u;let v;e[15]!==c||e[16]!==l||e[17]!==f?(v=a.jsxs("div",{className:c,children:[l,f]}),e[15]=c,e[16]=l,e[17]=f,e[18]=v):v=e[18];let p;return e[19]!==i||e[20]!==v?(p=a.jsx(i,{children:v}),e[19]=i,e[20]=v,e[21]=p):p=e[21],p}function Te(d){const e=S.c(11),{connectionId:t}=d,{org:n}=te();let o,r,s;e[0]!==t||e[1]!==n.slug?(o=new URL(`/api/${n.slug}/mcp/${t}`,window.location.origin),s=se,r=re.isMCPAuthenticated(o.href,null),e[0]=t,e[1]=n.slug,e[2]=o,e[3]=r,e[4]=s):(o=e[2],r=e[3],s=e[4]);let i;e[5]!==o||e[6]!==n.id?(i=()=>de({url:o.href,token:null,orgId:n.id}),e[5]=o,e[6]=n.id,e[7]=i):i=e[7];let c;e[8]!==r||e[9]!==i?(c={queryKey:r,queryFn:i},e[8]=r,e[9]=i,e[10]=c):c=e[10];const{data:l}=s(c);return l}export{Ae as I,Pe as R,Ne as T,Se as a,Te as u};
|