decocms 3.99.3 → 3.100.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Bgopcarv.js → AlertCircle-qsmFLzIS.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-7XR-z7Ge.js → ArrowUpRight-yJehGCq_.js} +1 -1
- package/dist/client/assets/{CheckCircle-DsdDhP4L.js → CheckCircle-B6MW1yw_.js} +1 -1
- package/dist/client/assets/{ChevronDown-CpzTl0cf.js → ChevronDown-C6GKFdlz.js} +1 -1
- package/dist/client/assets/{ChevronLeft-BuOnLJw9.js → ChevronLeft-B_g3Odoj.js} +1 -1
- package/dist/client/assets/{ChevronRight-DqDeYsel.js → ChevronRight-_T91Ki1i.js} +1 -1
- package/dist/client/assets/{ChevronUp-Cr2g1GDa.js → ChevronUp-C73sdCjg.js} +1 -1
- package/dist/client/assets/{DotsVertical-BGprjE03.js → DotsVertical-BOTJmIm_.js} +1 -1
- package/dist/client/assets/{Eye-B9uHZVsM.js → Eye-CmIsbgje.js} +1 -1
- package/dist/client/assets/{FilterLines-DgCFEQWk.js → FilterLines-Br0k3Gt9.js} +1 -1
- package/dist/client/assets/{Globe01-H40eMg8D.js → Globe01-jb99gJfY.js} +1 -1
- package/dist/client/assets/{Globe04-BNaAcUBp.js → Globe04-BoJpZpky.js} +1 -1
- package/dist/client/assets/{HardDrive-l0WQMFU9.js → HardDrive-tK8cadSs.js} +1 -1
- package/dist/client/assets/{Key01-BDd1iQS4.js → Key01--rf2r0q7.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DQOl0C9j.js → LayoutLeft-Dpq1l3Cs.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BAME6PCB.js → LinkExternal01-DgKre-XN.js} +1 -1
- package/dist/client/assets/{Monitor01-CaJkUXyc.js → Monitor01-DLOF_NPZ.js} +1 -1
- package/dist/client/assets/{Palette-C1u1Sxuh.js → Palette-B13aA9KG.js} +1 -1
- package/dist/client/assets/{Play-DSjj50Z1.js → Play-CAoWwsoA.js} +1 -1
- package/dist/client/assets/{Plus-rHk0VScG.js → Plus-DaRhyqSH.js} +1 -1
- package/dist/client/assets/SearchLg-C7PlcyS-.js +1 -0
- package/dist/client/assets/{SearchMd-Bc8RVvtx.js → SearchMd-TIrNRuOw.js} +1 -1
- package/dist/client/assets/{Settings02-bfgJ4jKJ.js → Settings02-B1ys_QsX.js} +1 -1
- package/dist/client/assets/{Shield01-C0erkp7L.js → Shield01-cnNeKMKA.js} +1 -1
- package/dist/client/assets/{Star01-DnRxcrb2.js → Star01-DPd1XEvi.js} +1 -1
- package/dist/client/assets/{Stars01-DN0i_OuW.js → Stars01-CFQgPhA5.js} +1 -1
- package/dist/client/assets/{Stars02-DXKYKZ_y.js → Stars02-BBfjmRkO.js} +1 -1
- package/dist/client/assets/{Sun-BvgQbAIe.js → Sun-D1BAkaT6.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CTCDUfta.js → SwitchHorizontal01-BPwURr_K.js} +1 -1
- package/dist/client/assets/{Tool01-Dvmkyh1g.js → Tool01-UFRB7Gn8.js} +1 -1
- package/dist/client/assets/{Trash01-BrvLbqQk.js → Trash01-2mnBLeel.js} +1 -1
- package/dist/client/assets/{Upload01-Cghimx9V.js → Upload01-BxxwdIAZ.js} +1 -1
- package/dist/client/assets/{User01-BPjc8LiD.js → User01-D61Pj0Jp.js} +1 -1
- package/dist/client/assets/{Users01-DKr-dGyn.js → Users01-enhuFvLY.js} +1 -1
- package/dist/client/assets/{Users03-CBNK0aq-.js → Users03-CsRyhHB5.js} +1 -1
- package/dist/client/assets/{X-BZf8Ua-f.js → X-D_jt_5zi.js} +1 -1
- package/dist/client/assets/{XCircle-CxfDN97v.js → XCircle-Cr_Uaxeq.js} +1 -1
- package/dist/client/assets/{XClose-Ca4NBXw9.js → XClose-C6a8uvfS.js} +1 -1
- package/dist/client/assets/{Zap-D8ndRUQT.js → Zap-CkUSEY1J.js} +1 -1
- package/dist/client/assets/{ZapSquare-BY_c_0SN.js → ZapSquare-CwzduoBx.js} +1 -1
- package/dist/client/assets/{ZoomOut-C9_8nvys.js → ZoomOut-N-7VqfhT.js} +1 -1
- package/dist/client/assets/{access-gate-CCm9ALRG.js → access-gate-CKBNVhhp.js} +1 -1
- package/dist/client/assets/{add-section-modal-BsBYigCm.js → add-section-modal-DCuBNkTr.js} +1 -1
- package/dist/client/assets/agent-icon-CDWUrKO6.js +1 -0
- package/dist/client/assets/agents-list-ulDX0H44.js +1 -0
- package/dist/client/assets/{ai-providers-P6gTuznf.js → ai-providers-DEa83FLl.js} +1 -1
- package/dist/client/assets/{alert-DpnpKBfm.js → alert-DXQz40c2.js} +1 -1
- package/dist/client/assets/{alert-dialog-CWTgvZp_.js → alert-dialog-DwrOZyIa.js} +1 -1
- package/dist/client/assets/app-editor-tXdvtxk6.js +1 -0
- package/dist/client/assets/{auth-DtR4b91D.js → auth-DnFlop4R.js} +1 -1
- package/dist/client/assets/{auth-catchall-BfgSkxA3.js → auth-catchall-CLwyMXPx.js} +1 -1
- package/dist/client/assets/{auth-entry-DiMotG9E.js → auth-entry-DxRJaJWz.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Bithe63j.js → auth-split-layout-CrmHdTXS.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BYDKbSTj.js → authenticate-and-persist-oauth-7MZHsMGS.js} +1 -1
- package/dist/client/assets/{automation-list-row-DmMT-Lmk.js → automation-list-row-D88Ulzbg.js} +1 -1
- package/dist/client/assets/{automation-runs-CglgtIyd.js → automation-runs-BJ__6yJz.js} +1 -1
- package/dist/client/assets/automations-DrzVSDDD.js +1 -0
- package/dist/client/assets/{avatar-DosbYSVo.js → avatar-C765fdJ7.js} +1 -1
- package/dist/client/assets/{badge-7eW-Y90w.js → badge-CgUoAb0G.js} +1 -1
- package/dist/client/assets/{block-document-CU1UWO2l.js → block-document-DMH0RbkS.js} +1 -1
- package/dist/client/assets/{brand-context-Bc4eOtey.js → brand-context-CE1MWp0U.js} +1 -1
- package/dist/client/assets/{buckets-C0c0s9n9.js → buckets-DoNYdWNk.js} +1 -1
- package/dist/client/assets/{capability-load-error-BQe9cGJ_.js → capability-load-error-Cr5M8jid.js} +1 -1
- package/dist/client/assets/{card-ChgC15JC.js → card-CYYTvdp-.js} +1 -1
- package/dist/client/assets/category-editor-Cz0M4CjQ.js +1 -0
- package/dist/client/assets/{chat-context-C7e3nmPB.js → chat-context-CcIPgTva.js} +1 -1
- package/dist/client/assets/{checkbox-D1J6-HGS.js → checkbox-D9k8y94F.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Biv357Zc.js → cli-auth-success-BEhGmeMb.js} +1 -1
- package/dist/client/assets/collection-detail-DwEhzsQm.js +1 -0
- package/dist/client/assets/{collection-display-button-zkui4HfF.js → collection-display-button-D-VHSw0A.js} +1 -1
- package/dist/client/assets/{collection-search-SCB2wfQm.js → collection-search-OPVOwF6w.js} +1 -1
- package/dist/client/assets/{collection-tabs-CasRXW3s.js → collection-tabs-CRf8Ijmq.js} +1 -1
- package/dist/client/assets/{command-BP2NK5GV.js → command-gl-L1UMo.js} +1 -1
- package/dist/client/assets/commerce-onboarding-D-kTt4mI.js +1 -0
- package/dist/client/assets/{connect-desktop-dialog-CUoIMZ9P.js → connect-desktop-dialog-C95eK0uT.js} +1 -1
- package/dist/client/assets/{connection-card-Cw-v3-1B.js → connection-card-DQuoMZlF.js} +1 -1
- package/dist/client/assets/connection-detail-BTmjhXSR.js +1 -0
- package/dist/client/assets/{connection-form-helpers-BE_9JHz-.js → connection-form-helpers-Bjlqqa5J.js} +1 -1
- package/dist/client/assets/connections-kvdl_r4C.js +1 -0
- package/dist/client/assets/{context-menu-Cbyc6J5M.js → context-menu-DqNcAhnr.js} +1 -1
- package/dist/client/assets/{decopilot-D1XiRpB_.js → decopilot-CdQeVtVh.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DsG4E7i_.js → decopilot-sse-pool-BxlWS7lz.js} +1 -1
- package/dist/client/assets/{dialog-DKiQlf0Y.js → dialog-Hh5ovGLY.js} +1 -1
- package/dist/client/assets/{domain-settings-DZg105GS.js → domain-settings-D0sFUhGm.js} +1 -1
- package/dist/client/assets/{drawer-UishvVn_.js → drawer-SgGGijSm.js} +1 -1
- package/dist/client/assets/{dropdown-menu-B_TYOovI.js → dropdown-menu-CVNL6sbF.js} +1 -1
- package/dist/client/assets/{empty-state-BVh7wBPS.js → empty-state-C5ufqcxL.js} +1 -1
- package/dist/client/assets/{extract-connection-data-C9MdxGy0.js → extract-connection-data-Dl7BC58q.js} +1 -1
- package/dist/client/assets/file-explorer-DBztAiIo.js +2 -0
- package/dist/client/assets/{file-type-icon-DouhlgA1.js → file-type-icon-b6CTHv4I.js} +1 -1
- package/dist/client/assets/{files-pYWmrODj.js → files-vqgO8Hmh.js} +1 -1
- package/dist/client/assets/{form-B4g755Hl.js → form-vkZSNPAt.js} +1 -1
- package/dist/client/assets/{general-5Yc9vnsv.js → general-VCh3bTjA.js} +1 -1
- package/dist/client/assets/github-repo-picker-DjgoP8zv.js +1 -0
- package/dist/client/assets/{hooks-DWc2KmvK.js → hooks-Cm8G1vlN.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-Bih2Fm5A.js → import-from-deco-dialog-lvJBG1l4.js} +1 -1
- package/dist/client/assets/{index-BSPCA2yy.js → index-5EogW27n.js} +1 -1
- package/dist/client/assets/{index-BgnTiSnU.js → index-BA1nWkqk.js} +1 -1
- package/dist/client/assets/{index-tHbNbVHJ.js → index-BEjmlKPl.js} +4 -4
- package/dist/client/assets/index-BQrms0i2.js +1 -0
- package/dist/client/assets/index-BgeHuUkH.js +169 -0
- package/dist/client/assets/{index-GbBrtIUx.js → index-C5C-UKU4.js} +1 -1
- package/dist/client/assets/{index-Blw_ez7B.js → index-CYNIQ2LP.js} +1 -1
- package/dist/client/assets/{index-DJGRW9ro.js → index-DMwgNM3s.js} +1 -1
- package/dist/client/assets/{index-DZqx_Cnp.js → index-DVWXva_V.js} +1 -1
- package/dist/client/assets/index-DcwF1_eH.js +1 -0
- package/dist/client/assets/{index-V36Mlak_.js → index-Dg4__lD-.js} +2 -2
- package/dist/client/assets/{index-CQ5sDlCR.js → index-b3uLeNQ7.js} +1 -1
- package/dist/client/assets/index-h9qXUa58.css +1 -0
- package/dist/client/assets/{index-87hVDe9f.js → index-kmrmjjsI.js} +1 -1
- package/dist/client/assets/{index-redirect-DwYyA5dK.js → index-redirect-BgY_k9Gz.js} +1 -1
- package/dist/client/assets/index-xtrjWgZh.js +503 -0
- package/dist/client/assets/{input-C1uF2dQ1.js → input-Csk5e2yH.js} +1 -1
- package/dist/client/assets/{integration-icon-DOeD9Yy1.js → integration-icon-BubYo_JB.js} +1 -1
- package/dist/client/assets/{label-Bg0TZhOq.js → label-P9D2uSqZ.js} +1 -1
- package/dist/client/assets/{login-C4tPjUdy.js → login-Cl-Vlxwz.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DxJiJ187.js → mcp-oauth-C9EbOVQM.js} +1 -1
- package/dist/client/assets/{members-DwE4NR-t.js → members-TxM32jPh.js} +1 -1
- package/dist/client/assets/{monaco-editor-C6tm250p.js → monaco-editor-Bk0ouh6L.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BF3MVgko.js → monitoring-stats-row-ytgPYn-j.js} +1 -1
- package/dist/client/assets/{oauth-callback-DDvAz-C3.js → oauth-callback-D6v0ajK5.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-PWS5W0qh.js → oauth-callback-ai-provider-CDDtW8tk.js} +1 -1
- package/dist/client/assets/{onboarding-BfXFCDPk.js → onboarding-J4ivY9wp.js} +1 -1
- package/dist/client/assets/{org-install-CRksScXH.js → org-install-R5bN1TE2.js} +1 -1
- package/dist/client/assets/{org-layout-D3Fm0DP7.js → org-layout-PPkGFokn.js} +1 -1
- package/dist/client/assets/{organization-choice-D0-tUZZw.js → organization-choice-CD_4VGlb.js} +1 -1
- package/dist/client/assets/{page-seo-form-BvkRv9HV.js → page-seo-form-B2_5Qimo.js} +1 -1
- package/dist/client/assets/page-seo-sheet-DDlWrFZb.js +1 -0
- package/dist/client/assets/{popover-eHXpDYJ1.js → popover-CXYDmYeq.js} +1 -1
- package/dist/client/assets/post-editor-B1H7keyM.js +1 -0
- package/dist/client/assets/preview-dialog-DPmt4gXJ.js +5 -0
- package/dist/client/assets/{primitives-CkRAfBR-.js → primitives-FsBU_d9l.js} +1 -1
- package/dist/client/assets/{profile-CEx7RbYh.js → profile-Bb6W32P_.js} +1 -1
- package/dist/client/assets/project-app-view-9qSeXqiM.js +1 -0
- package/dist/client/assets/record-editor-CeITAW1G.js +1 -0
- package/dist/client/assets/registry-BjqN-pIh.js +2 -0
- package/dist/client/assets/{registry-layout-BlqjOMOH.js → registry-layout-CgN5p_12.js} +1 -1
- package/dist/client/assets/{require-capability-BOr4zKTd.js → require-capability-BaWVSsgq.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DCkraGAX.js → required-auth-layout-BfuMObCG.js} +1 -1
- package/dist/client/assets/{reset-password-BJpJyj5W.js → reset-password-DGoLN-pp.js} +1 -1
- package/dist/client/assets/roles-BLgs8rry.js +1 -0
- package/dist/client/assets/{scroll-area-IfNZ394n.js → scroll-area-DCf9FU8S.js} +1 -1
- package/dist/client/assets/{search-input-DWWTgewM.js → search-input-Cec8OPCx.js} +1 -1
- package/dist/client/assets/{secrets-BKFEeATT.js → secrets-D78lmb-N.js} +1 -1
- package/dist/client/assets/{sections-editor-uQUAGEex.js → sections-editor-CVFa_v55.js} +2 -2
- package/dist/client/assets/{select-Ufh1328y.js → select-f-UK5_IH.js} +1 -1
- package/dist/client/assets/{select-model-CQ-f9ftL.js → select-model-DXfyq6oG.js} +1 -1
- package/dist/client/assets/seo-editor-8EgzsFKu.js +1 -0
- package/dist/client/assets/settings-layout-D8fkj6t7.js +1 -0
- package/dist/client/assets/{settings-section-B4a4SAqB.js → settings-section-LAhWYbh9.js} +1 -1
- package/dist/client/assets/{sheet-DW12PvFQ.js → sheet-Dz5C6OGo.js} +1 -1
- package/dist/client/assets/{shell-controls-xlIGzcZ3.js → shell-controls-CEhcbJHE.js} +1 -1
- package/dist/client/assets/shell-layout-R4zDjERM.js +1 -0
- package/dist/client/assets/{shell-route-loading-B_CHvxTG.js → shell-route-loading-DHNvhkbM.js} +1 -1
- package/dist/client/assets/{sidebar-Cy5GVw74.js → sidebar-CFbvOGM6.js} +1 -1
- package/dist/client/assets/{skeleton-CpSca80L.js → skeleton-DLjQYeS_.js} +1 -1
- package/dist/client/assets/{sortable.esm-CoB59DXJ.js → sortable.esm-DHABQEKH.js} +1 -1
- package/dist/client/assets/{sso-DMV0Y_YX.js → sso-lZztM25h.js} +1 -1
- package/dist/client/assets/{store-B6JtITOy.js → store-CY1YTiO_.js} +1 -1
- package/dist/client/assets/store-registry-Cq3I32Lc.js +2 -0
- package/dist/client/assets/{studio-tools-Dd7dXWQL.js → studio-tools-E6eV6Arx.js} +1 -1
- package/dist/client/assets/{switch-CuKs1fR0.js → switch-CIDHMPBy.js} +1 -1
- package/dist/client/assets/{table-BfyoFEgz.js → table-FWIaAi69.js} +1 -1
- package/dist/client/assets/{tabs-C3buIvx_.js → tabs-DCWgt9U2.js} +1 -1
- package/dist/client/assets/{task-status-DXhUoFwL.js → task-status-CBSgsj9C.js} +1 -1
- package/dist/client/assets/{textarea-BiYr__3G.js → textarea-cMx1Sjw5.js} +1 -1
- package/dist/client/assets/{toggle-group-DFSFo_vP.js → toggle-group-DqYtGmOf.js} +1 -1
- package/dist/client/assets/{toolbar-DMYgRw5l.js → toolbar-C5mHjU06.js} +1 -1
- package/dist/client/assets/{tooltip-DW1HpudV.js → tooltip-vrtDbf-F.js} +1 -1
- package/dist/client/assets/{types-BpY6lzqy.js → types-Cpxi5nja.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DS_7m4pz.js → use-ai-providers-SEySB86N.js} +1 -1
- package/dist/client/assets/{use-automations-BOSdn9Us.js → use-automations-BWMuOB-g.js} +1 -1
- package/dist/client/assets/{use-capability-CeF0OpPy.js → use-capability-BF81OxAF.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DLGdZmyk.js → use-clock-tick-v8inwCL3.js} +1 -1
- package/dist/client/assets/{use-collections-GNpTGYUv.js → use-collections-DkNJNG6n.js} +1 -1
- package/dist/client/assets/{use-connection-B65sInnd.js → use-connection-DUBWvt9B.js} +1 -1
- package/dist/client/assets/{use-copy-I4sZTiJp.js → use-copy-BGZ8Ttn0.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-mtRixRQv.js → use-create-virtual-mcp-hBSqW_CF.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Hw4VW15I.js → use-debounced-autosave-BwLKL-15.js} +1 -1
- package/dist/client/assets/use-debounced-value-BMcX8uyD.js +1 -0
- package/dist/client/assets/{use-delete-connection-DV4DJUaY.js → use-delete-connection-oIOCPNow.js} +1 -1
- package/dist/client/assets/{use-file-configs-DObQhPxD.js → use-file-configs-BLZ83KSj.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Bk__8TxT.js → use-infinite-scroll-DUbloeNA.js} +1 -1
- package/dist/client/assets/{use-join-requests-D-QyHVW_.js → use-join-requests-DABqJWZf.js} +1 -1
- package/dist/client/assets/{use-mcp-client-0BRd9S75.js → use-mcp-client-DdEyuuWo.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-D4ll_rda.js → use-mcp-prompts-DqUyy9S8.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-UJVs9gTs.js → use-mcp-tools-CgsqmnJG.js} +1 -1
- package/dist/client/assets/{use-members-BAva2zEC.js → use-members-BhBptkRX.js} +1 -1
- package/dist/client/assets/{use-mobile-BD2-gXK-.js → use-mobile-C7loFyQ0.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CFNRRTVg.js → use-navigate-to-agent-C3I5i4Gg.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-7sV0tnvK.js → use-org-auth-client-B9guhhqA.js} +1 -1
- package/dist/client/assets/{use-org-sso-CWJ7VJxn.js → use-org-sso-SRgmMZqR.js} +1 -1
- package/dist/client/assets/{use-organization-roles-GhUkwr8O.js → use-organization-roles-Aw74Iw_d.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CLeV359D.js → use-organization-settings-CyhRZcil.js} +1 -1
- package/dist/client/assets/{use-registry-connections-D7ZBIfwl.js → use-registry-connections-JP-nn714.js} +1 -1
- package/dist/client/assets/{use-secrets-_avq30K6.js → use-secrets-f-qJA1xx.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DAUtYLJA.js → use-status-sounds-D8xk5cTm.js} +1 -1
- package/dist/client/assets/{use-view-mode-DROl2yq4.js → use-view-mode-CsrgTSxk.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CI9qouIO.js → use-virtual-mcp-CytuWVRm.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Cm9C_gzI.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-Dl9xywRE.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-DuDQjlvx.js → useSuspenseQueries-CGmxp5yX.js} +1 -1
- package/dist/client/assets/variant-calendar-cvUhqu-8.js +1 -0
- package/dist/client/assets/{view-mode-toggle-Del-VZlp.js → view-mode-toggle-B0C659uf.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +439 -429
- package/dist/server/server.js +268 -268
- package/package.json +1 -1
- package/dist/client/assets/agent-icon-BbjKuSxW.js +0 -1
- package/dist/client/assets/agents-list-g0HlqLD8.js +0 -1
- package/dist/client/assets/app-editor-CJVdYBr2.js +0 -1
- package/dist/client/assets/automations-DfhbzTi8.js +0 -1
- package/dist/client/assets/category-editor-BWGJADot.js +0 -1
- package/dist/client/assets/collection-detail-B-FYgzNz.js +0 -1
- package/dist/client/assets/commerce-onboarding-CCTWN0Dv.js +0 -1
- package/dist/client/assets/connection-detail-D66t6r8n.js +0 -1
- package/dist/client/assets/connections-B7dKDvRD.js +0 -1
- package/dist/client/assets/file-explorer-Dvmu_Dcb.js +0 -2
- package/dist/client/assets/github-repo-picker-DDcB4OPT.js +0 -1
- package/dist/client/assets/index-BQjoq239.js +0 -1
- package/dist/client/assets/index-C0RjSTYg.js +0 -169
- package/dist/client/assets/index-CkflryUu.js +0 -503
- package/dist/client/assets/index-Cl3nu1dQ.js +0 -1
- package/dist/client/assets/index-NVhaWgyE.css +0 -1
- package/dist/client/assets/page-seo-sheet-DTF7F_WK.js +0 -1
- package/dist/client/assets/post-editor-DOULNreh.js +0 -1
- package/dist/client/assets/preview-dialog-QbgIb_4T.js +0 -5
- package/dist/client/assets/project-app-view-DHWSkD1u.js +0 -1
- package/dist/client/assets/record-editor-Dq4SLOu9.js +0 -1
- package/dist/client/assets/registry-fpLTXF0f.js +0 -2
- package/dist/client/assets/roles-C6kCiv-A.js +0 -1
- package/dist/client/assets/save-status-DVA4IHRx.js +0 -1
- package/dist/client/assets/seo-editor-BuTMaAaQ.js +0 -1
- package/dist/client/assets/settings-layout-DZdRUGWz.js +0 -1
- package/dist/client/assets/shell-layout-C09jnc4C.js +0 -1
- package/dist/client/assets/store-registry-BoPJCgP8.js +0 -2
- package/dist/client/assets/useInfiniteQuery-jWCtindg.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CwejNwQJ.js +0 -1
- package/dist/client/assets/variant-calendar-2pJ_kR62.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as E,c as oe,j as t,E as Ye,i as ce,D as be,b as _e,u as Ze,a as Ne,z as et,C as tt,L as nt,p as st,n as ot,B as U,w as te,m as it,l as de,t as W,K as rt}from"./index-tHbNbVHJ.js";import{a as lt,b as De,g as at,e as ct}from"./extract-connection-data-C9MdxGy0.js";import{C as dt}from"./collection-display-button-zkui4HfF.js";import{S as mt}from"./search-input-DWWTgewM.js";import{C as ut}from"./collection-tabs-CasRXW3s.js";import{u as pt,a as ke,g as ht,C as Ce}from"./connection-card-Cw-v3-1B.js";import{E as gt}from"./empty-state-BVh7wBPS.js";import{I as xt}from"./integration-icon-DOeD9Yy1.js";import{P as ue}from"./index-87hVDe9f.js";import{u as ft,D as jt}from"./use-delete-connection-DV4DJUaY.js";import{u as ye}from"./use-capability-CeF0OpPy.js";import{u as yt}from"./use-infinite-scroll-Bk__8TxT.js";import{u as Ct}from"./use-view-mode-DROl2yq4.js";import{g as he}from"./connection-slug-eyAPH6o3.js";import{c as Ae,d as we,b as Te,A as Ie,e as Pe,g as $e,a as Le,f as Oe}from"./alert-dialog-CWTgvZp_.js";import{C as Fe}from"./checkbox-D1J6-HGS.js";import{a as ze,b as Me,c as Ve,d as Ee,e as Be,D as Ke}from"./dialog-DKiQlf0Y.js";import{D as vt,a as St,c as bt,b as _t,d as Nt,e as Dt,f as kt}from"./drawer-UishvVn_.js";import{u as At}from"./use-mobile-BD2-gXK-.js";import{D as Ue,a as Re,b as He,c as re}from"./dropdown-menu-B_TYOovI.js";import{F as Q,b as J,c as Y,d as Z,e as ee,a as ve}from"./form-B4g755Hl.js";import{I as ie}from"./input-C1uF2dQ1.js";import{d as wt,b as Tt,c as It,S as Pt,a as ae}from"./select-Ufh1328y.js";import{T as $t}from"./textarea-BiYr__3G.js";import{b as We,u as Lt}from"./use-connection-B65sInnd.js";import{u as Ot}from"./use-virtual-mcp-CI9qouIO.js";import{u as Ft}from"./studio-tools-Dd7dXWQL.js";import{a5 as zt,af as Mt,C as Vt,z as Et}from"./agent-icon-BbjKuSxW.js";import{n as ge}from"./XCircle-CxfDN97v.js";import{a as Xe}from"./DotsVertical-BGprjE03.js";import{s as qe}from"./Eye-B9uHZVsM.js";import{s as je}from"./Star01-DnRxcrb2.js";import{s as Ge}from"./Plus-rHk0VScG.js";import{s as Qe}from"./Trash01-BrvLbqQk.js";import{s as Je}from"./XClose-Ca4NBXw9.js";import{i as pe,a as Se,E as Bt,c as Kt,p as Ut,b as Rt,d as Ht}from"./connection-form-helpers-BE_9JHz-.js";import{a as Wt}from"./authenticate-and-persist-oauth-BYDKbSTj.js";import"./use-mcp-client-0BRd9S75.js";import"./auth-DtR4b91D.js";import"./SwitchHorizontal01-CTCDUfta.js";import"./ChevronUp-Cr2g1GDa.js";import"./tooltip-DW1HpudV.js";import"./view-mode-toggle-Del-VZlp.js";import"./badge-7eW-Y90w.js";import"./SearchMd-Bc8RVvtx.js";import"./use-registry-connections-D7ZBIfwl.js";import"./use-organization-settings-CLeV359D.js";import"./useInfiniteQuery-jWCtindg.js";import"./card-ChgC15JC.js";import"./sidebar-Cy5GVw74.js";import"./LayoutLeft-DQOl0C9j.js";import"./sheet-DW12PvFQ.js";import"./X-BZf8Ua-f.js";import"./ChevronRight-DqDeYsel.js";import"./label-Bg0TZhOq.js";import"./ChevronDown-CpzTl0cf.js";import"./use-collections-GNpTGYUv.js";import"./AlertCircle-Bgopcarv.js";import"./Tool01-Dvmkyh1g.js";import"./Settings02-bfgJ4jKJ.js";import"./ArrowUpRight-7XR-z7Ge.js";import"./ZapSquare-BY_c_0SN.js";import"./Users03-CBNK0aq-.js";import"./CheckCircle-DsdDhP4L.js";import"./ChevronLeft-BuOnLJw9.js";import"./Stars02-DXKYKZ_y.js";import"./ZoomOut-C9_8nvys.js";import"./Globe01-H40eMg8D.js";import"./FilterLines-DgCFEQWk.js";import"./Globe04-BNaAcUBp.js";import"./HardDrive-l0WQMFU9.js";import"./Key01-BDd1iQS4.js";import"./LinkExternal01-BAME6PCB.js";import"./Monitor01-CaJkUXyc.js";import"./Sun-BvgQbAIe.js";import"./Palette-C1u1Sxuh.js";import"./Play-DSjj50Z1.js";import"./Shield01-C0erkp7L.js";import"./Stars01-DN0i_OuW.js";import"./Upload01-Cghimx9V.js";import"./User01-BPjc8LiD.js";import"./Users01-DKr-dGyn.js";import"./Zap-D8ndRUQT.js";import"./mcp-oauth-DxJiJ187.js";function Xt(f){const e=`deco-filters-${f}`,[n,p]=E.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[n,o=>{p(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(i){console.error("Failed to save filters:",i)}}]}function qt(f){const e=oe.c(7),[n,p]=E.useState(f),[l,o]=E.useState(f?"desc":null);let i;e[0]!==l||e[1]!==n?(i=j=>{n!==j?(p(j),o("asc")):l==="asc"?o("desc"):l==="desc"&&(p(void 0),o(null))},e[0]=l,e[1]=n,e[2]=i):i=e[2];const g=i;let h;return e[3]!==g||e[4]!==l||e[5]!==n?(h={sortKey:n,sortDirection:l,handleSort:g},e[3]=g,e[4]=l,e[5]=n,e[6]=h):h=e[6],h}function Gt(f){const e=oe.c(20),{namespace:n,resource:p,defaultSortKey:l,defaultViewMode:o}=f,i=l===void 0?"title":l,g=o===void 0?"table":o,[h,j]=E.useState(""),y=E.useDeferredValue(h),N=`${n}-${p}`,[b,a]=Xt(N),x=`mesh-${p}-filter-visible-${n}`;let m;e[0]!==x?(m=()=>globalThis.localStorage?.getItem(x)==="true",e[0]=x,e[1]=m):m=e[1];const[v,_]=E.useState(m);let D;e[2]!==x?(D=T=>{_(T),globalThis.localStorage?.setItem(x,String(T))},e[2]=x,e[3]=D):D=e[3];const L=D;let O;e[4]!==v||e[5]!==L?(O=()=>{L(!v)},e[4]=v,e[5]=L,e[6]=O):O=e[6];const s=O,[A,F]=Ct(`mesh-${p}-${n}`,g),{sortKey:z,sortDirection:w,handleSort:P}=qt(i),M=z;let C;return e[7]!==v||e[8]!==b||e[9]!==P||e[10]!==h||e[11]!==y||e[12]!==L||e[13]!==a||e[14]!==F||e[15]!==w||e[16]!==M||e[17]!==s||e[18]!==A?(C={search:h,searchTerm:y,setSearch:j,filters:b,setFilters:a,filterBarVisible:v,setFilterBarVisible:L,toggleFilterBar:s,viewMode:A,setViewMode:F,sortKey:M,sortDirection:w,handleSort:P},e[7]=v,e[8]=b,e[9]=P,e[10]=h,e[11]=y,e[12]=L,e[13]=a,e[14]=F,e[15]=w,e[16]=M,e[17]=s,e[18]=A,e[19]=C):C=e[19],C}function Qt(f){const e=oe.c(51),{group:n,onOpen:p,selectionMode:l,selectedIds:o,onToggleSelect:i}=f;let g;if(e[0]!==n.connections||e[1]!==o){let C;e[3]!==o?(C=T=>o.has(T.id),e[3]=o,e[4]=C):C=e[4],g=n.connections.every(C),e[0]=n.connections,e[1]=o,e[2]=g}else g=e[2];const h=g;let j;if(e[5]!==n.connections||e[6]!==o){let C;e[8]!==o?(C=T=>o.has(T.id),e[8]=o,e[9]=C):C=e[9],j=n.connections.some(C),e[5]=n.connections,e[6]=o,e[7]=j}else j=e[7];const y=j,N=`${n.connections.length} instances`;let b;e[10]!==n.icon||e[11]!==n.title||e[12]!==N?(b={title:n.title,icon:n.icon,description:N},e[10]=n.icon,e[11]=n.title,e[12]=N,e[13]=b):b=e[13];let a;e[14]!==h||e[15]!==n.connections||e[16]!==p||e[17]!==i||e[18]!==o||e[19]!==l?(a=()=>l?(()=>{for(const C of n.connections)h?o.has(C.id)&&i(C.id):o.has(C.id)||i(C.id)})():p(),e[14]=h,e[15]=n.connections,e[16]=p,e[17]=i,e[18]=o,e[19]=l,e[20]=a):a=e[20];const x=l&&h&&"ring-2 ring-primary",m=l&&y&&!h&&"ring-1 ring-primary/50";let v;e[21]!==x||e[22]!==m?(v=de(x,m),e[21]=x,e[22]=m,e[23]=v):v=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==h||e[26]!==n.connections||e[27]!==i||e[28]!==o||e[29]!==l||e[30]!==y?(D=l?t.jsx(Fe,{checked:h?!0:y?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)h?o.has(C.id)&&i(C.id):o.has(C.id)||i(C.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=h,e[26]=n.connections,e[27]=i,e[28]=o,e[29]=l,e[30]=y,e[31]=D):D=e[31];const L=l?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let O;e[32]!==L?(O=de("overflow-hidden transition-all duration-150 ease-out",L),e[32]=L,e[33]=O):O=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Re,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Yt,children:t.jsx(Xe,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let F;e[37]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(qe,{size:16}),e[37]=F):F=e[37];let z;e[38]!==A?(z=t.jsxs(Ue,{children:[s,t.jsx(He,{align:"end",onClick:Jt,children:t.jsxs(re,{onClick:A,children:[F,"Open"]})})]}),e[38]=A,e[39]=z):z=e[39];let w;e[40]!==O||e[41]!==z?(w=t.jsx("div",{className:O,children:z}),e[40]=O,e[41]=z,e[42]=w):w=e[42];let P;e[43]!==D||e[44]!==w?(P=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=P):P=e[45];let M;return e[46]!==P||e[47]!==b||e[48]!==a||e[49]!==v?(M=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:b,onClick:a,className:v,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:P})}),e[46]=P,e[47]=b,e[48]=a,e[49]=v,e[50]=M):M=e[50],M}function Jt(f){return f.stopPropagation()}function Yt(f){return f.stopPropagation()}function Zt(f){const e=oe.c(23),{count:n,total:p,canManage:l,canManageAgents:o,onSelectAll:i,onDeselectAll:g,onDelete:h,onAddToAgent:j,onToggleStatus:y,onCancel:N}=f;if(n===0)return null;let b;e[0]!==n?(b=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=b):b=e[1];let a;e[2]!==n||e[3]!==g||e[4]!==i||e[5]!==p?(a=n<p?t.jsxs(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:i,children:["Select all (",p,")"]}):t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:"Clear selection"}),e[2]=n,e[3]=g,e[4]=i,e[5]=p,e[6]=a):a=e[6];let x;e[7]!==o||e[8]!==j?(x=o&&t.jsxs(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:[t.jsx(Ge,{size:13}),"Add to Agent"]}),e[7]=o,e[8]=j,e[9]=x):x=e[9];let m;e[10]!==l||e[11]!==h||e[12]!==y?(m=l&&t.jsxs(t.Fragment,{children:[t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("active"),children:"Enable"}),t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("inactive"),children:"Disable"}),t.jsxs(U,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:[t.jsx(Qe,{size:13}),"Delete"]})]}),e[10]=l,e[11]=h,e[12]=y,e[13]=m):m=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Je,{size:13}),e[14]=v):v=e[14];let _;e[15]!==N?(_=t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:N,children:v}),e[15]=N,e[16]=_):_=e[16];let D;return e[17]!==b||e[18]!==a||e[19]!==x||e[20]!==m||e[21]!==_?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[b,a,x,m,_]})}),e[17]=b,e[18]=a,e[19]=x,e[20]=m,e[21]=_,e[22]=D):D=e[22],D}function en(f){const e=oe.c(25),{open:n,onOpenChange:p,agents:l,onConfirm:o}=f,[i,g]=E.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(Ve,{children:[t.jsx(Ee,{children:"Add to Agent"}),t.jsx(Be,{children:"Select an agent to add the selected connections to."})]}),e[0]=h):h=e[0];let j;e[1]!==l||e[2]!==i?(j=l.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):l.map(D=>t.jsxs("button",{type:"button",onClick:()=>g(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",i===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(xt,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=l,e[2]=i,e[3]=j):j=e[3];let y;e[4]!==j?(y=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=y):y=e[5];let N;e[6]!==p?(N=t.jsx(U,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=N):N=e[7];const b=!i;let a;e[8]!==o||e[9]!==p||e[10]!==i?(a=()=>{i&&(o(i),p(!1),g(null))},e[8]=o,e[9]=p,e[10]=i,e[11]=a):a=e[11];let x;e[12]!==b||e[13]!==a?(x=t.jsx(U,{disabled:b,onClick:a,children:"Add"}),e[12]=b,e[13]=a,e[14]=x):x=e[14];let m;e[15]!==N||e[16]!==x?(m=t.jsxs(Ke,{children:[N,x]}),e[15]=N,e[16]=x,e[17]=m):m=e[17];let v;e[18]!==y||e[19]!==m?(v=t.jsxs(Me,{className:"sm:max-w-[400px]",children:[h,y,m]}),e[18]=y,e[19]=m,e[20]=v):v=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==v?(_=t.jsx(ze,{open:n,onOpenChange:p,children:v}),e[21]=p,e[22]=n,e[23]=v,e[24]=_):_=e[24],_}function tn(f){const e=oe.c(20),{open:n,onOpenChange:p,count:l,onConfirm:o}=f,i=l!==1?"s":"";let g;e[0]!==l||e[1]!==i?(g=t.jsxs(Ae,{children:["Delete ",l," connection",i,"?"]}),e[0]=l,e[1]=i,e[2]=g):g=e[2];const h=l!==1?"s":"";let j;e[3]!==h?(j=t.jsxs(we,{children:["This will permanently delete the selected connection",h,". This action cannot be undone."]}),e[3]=h,e[4]=j):j=e[4];let y;e[5]!==g||e[6]!==j?(y=t.jsxs(Te,{children:[g,j]}),e[5]=g,e[6]=j,e[7]=y):y=e[7];let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Ie,{children:"Cancel"}),e[8]=N):N=e[8];const b=l!==1?"s":"";let a;e[9]!==l||e[10]!==o||e[11]!==b?(a=t.jsxs(Pe,{children:[N,t.jsxs($e,{onClick:o,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",l," connection",b]})]}),e[9]=l,e[10]=o,e[11]=b,e[12]=a):a=e[12];let x;e[13]!==y||e[14]!==a?(x=t.jsxs(Le,{children:[y,a]}),e[13]=y,e[14]=a,e[15]=x):x=e[15];let m;return e[16]!==p||e[17]!==n||e[18]!==x?(m=t.jsx(Oe,{open:n,onOpenChange:p,children:x}),e[16]=p,e[17]=n,e[18]=x,e[19]=m):m=e[19],m}function nn(f){return f._registryId?.includes("community-registry")===!0}function sn(f){const e=oe.c(58),{item:n,canManage:p,allConnections:l,connectedAppNames:o,connectingItemId:i,onNavigateConnected:g,onConnect:h}=f,[j,y]=E.useState(!1),[N,b]=E.useState(null);let a,x;e[0]!==o||e[1]!==n?(a=De(n)??"",x=o.has(a),e[0]=o,e[1]=n,e[2]=a,e[3]=x):(a=e[2],x=e[3]);const m=x,v=n._meta?.["mcp.mesh"],_=v?.friendlyName||v?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let L;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(L=n.server?.icons?.[0]?.src||at(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=L):L=e[6];const O=L;let s;if(e[7]!==l||e[8]!==a){let k;e[10]!==a?(k=se=>se.connection_type!=="VIRTUAL"&&se.app_name===a,e[10]=a,e[11]=k):k=e[11],s=l.filter(k),e[7]=l,e[8]=a,e[9]=s}else s=e[9];const A=s;let F;e[12]!==n?(F=nn(n),e[12]=n,e[13]=F):F=e[13];const z=F;let w,P;e[14]!==A||e[15]!==p||e[16]!==z||e[17]!==m||e[18]!==n||e[19]!==h||e[20]!==g?(w=()=>{if(m){const k=A[0];k&&g(k);return}p&&P()},P=()=>{z?(b("connect"),y(!0)):h(n)},e[14]=A,e[15]=p,e[16]=z,e[17]=m,e[18]=n,e[19]=h,e[20]=g,e[21]=w,e[22]=P):(w=e[21],P=e[22]);let M;e[23]!==n||e[24]!==h||e[25]!==N?(M=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),y(!1),N==="connect"&&h(n),b(null)},e[23]=n,e[24]=h,e[25]=N,e[26]=M):M=e[26];const C=M;let T;e[27]!==D||e[28]!==O||e[29]!==_?(T={title:_,description:D,icon:O},e[27]=D,e[28]=O,e[29]=_,e[30]=T):T=e[30];let G;e[31]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(ge,{}),e[31]=G):G=e[31];let H;e[32]!==z||e[33]!==n._sourceIcon?(H=z&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=z,e[33]=n._sourceIcon,e[34]=H):H=e[34];let X;e[35]!==p||e[36]!==i||e[37]!==P||e[38]!==m||e[39]!==n.id?(X=m?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(U,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i!==null,onClick:k=>{k.stopPropagation(),P()},children:i===n.id?t.jsx(ce,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=i,e[37]=P,e[38]=m,e[39]=n.id,e[40]=X):X=e[40];let c;e[41]!==H||e[42]!==X?(c=t.jsxs("div",{className:"flex items-center gap-2",children:[H,X]}),e[41]=H,e[42]=X,e[43]=c):c=e[43];let S;e[44]!==w||e[45]!==c||e[46]!==T?(S=t.jsx(Ce,{connection:T,fallbackIcon:G,onClick:w,headerActionsAlwaysVisible:!0,headerActions:c}),e[44]=w,e[45]=c,e[46]=T,e[47]=S):S=e[47];let V;e[48]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(Te,{children:[t.jsx(Ae,{children:"Community MCP Server"}),t.jsx(we,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=V):V=e[48];let R;e[49]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(Ie,{children:"Cancel"}),e[49]=R):R=e[49];let B;e[50]!==C?(B=t.jsxs(Le,{children:[V,t.jsxs(Pe,{children:[R,t.jsx($e,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=B):B=e[51];let u;e[52]!==j||e[53]!==B?(u=t.jsx(Oe,{open:j,onOpenChange:y,children:B}),e[52]=j,e[53]=B,e[54]=u):u=e[54];let $;return e[55]!==S||e[56]!==u?($=t.jsxs(t.Fragment,{children:[S,u]}),e[55]=S,e[56]=u,e[57]=$):$=e[57],$}function on({listState:f,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:l,enabledRegistries:o}){const{org:i}=be(),g=it(),h=_e(),{data:j}=Ne.useSession(),y=We(),N=Lt(f),b=ft(),{granted:a}=ye("connections:manage"),{granted:x}=ye("agents:manage"),[m,v]=E.useState(new Set),_=m.size>0,[D,L]=E.useState(!1),[O,s]=E.useState(!1),[A,F]=E.useState(null),z=Ot(),w=N.filter(r=>!(n!=="ALL"&&r.connection_type!==n||p!=="ALL"&&r.status!==p)),P=ht(w),M=r=>{v(d=>{const K=new Set(d);return K.has(r)?K.delete(r):K.add(r),K})},C=()=>{v(new Set)},T=ke(o,f.searchTerm),G=T.items,H=yt(T.loadMore,T.hasMore,T.isLoadingMore),X=new Set(N.filter(r=>r.app_name).map(r=>r.app_name)),c=l==="ALL"||o.some(r=>r.id===l)?l:"ALL",S=f.search.length>0,V=e==="all"||S?G.filter(r=>{if(c!=="ALL"&&r._registryId!==c)return!1;if(S){const d=De(r);if(d&&X.has(d))return!1}return!0}):[],R=e==="connected"||S?P:[],B=async r=>{if(!(!i||!j?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:r.id,source:"connections_page"}),F(r.id);try{const d=ct(r,i.id,j.user.id,{remoteIndex:0}),K=d.connection_type==="STDIO",I=!!d.connection_url,q=K&&d.connection_headers&&typeof d.connection_headers=="object"&&"command"in d.connection_headers;if(!I&&!q){W.error("This MCP Server cannot be connected: no connection method available"),F(null);return}const{id:ne}=await y.create.mutateAsync(d),le=await Wt({connectionId:ne,orgId:i.id,orgSlug:i.slug,persistFallback:fe=>y.update.mutateAsync({id:ne,data:{connection_token:fe}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ne,flow:"connections_page_connect",error:le.error??"no_token"}),W.error(`Authentication failed: ${le.error??"no token received"}`);return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ne,flow:"connections_page_connect"});const fe=new URL(`/api/${i.slug}/mcp/${ne}`,window.location.origin);await g.invalidateQueries({queryKey:rt.isMCPAuthenticated(fe.href,null)}),$(),W.success("Authentication successful")}W.success("Connected successfully")}catch(d){W.error(`Failed to connect: ${d instanceof Error?d.message:String(d)}`)}finally{F(null)}}},u=Ft(),$=()=>{g.invalidateQueries({predicate:r=>{const d=r.queryKey;return d[1]===i.id&&d[3]==="collection"&&d[4]==="CONNECTIONS"}})},k=async()=>{L(!1);const r=[...m];te("connections_bulk_delete",{count:r.length});let d=0;for(const K of r)try{await u.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0}),d++}catch{}$(),W.success(`Deleted ${d} connection${d!==1?"s":""}`),C()},se=async(r,d)=>{try{await y.update.mutateAsync({id:r,data:{status:d}}),$(),W.success(d==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},xe=async r=>{const d=[...m];te("connections_bulk_status_toggled",{count:d.length,to_status:r});let K=0;for(const I of d)try{await y.update.mutateAsync({id:I,data:{status:r}}),K++}catch{}$(),W.success(`${r==="active"?"Enabled":"Disabled"} ${K} connection${K!==1?"s":""}`),C()},me=async r=>{const d=z.find(q=>q.id===r);if(!d)return;te("connections_bulk_add_to_agent",{agent_id:r,count:m.size});const K=new Set(d.connections.map(q=>q.connection_id)),I=[...m].filter(q=>!K.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(I.length===0){W.info("All selected connections are already in that agent");return}try{await u.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:r,data:{connections:[...d.connections,...I]}}),g.invalidateQueries({predicate:q=>{const ne=q.queryKey;return ne[1]===i.id&&ne[3]==="collection"&&ne[4]==="VIRTUAL_MCP"}}),W.success(`Added ${I.length} connection${I.length!==1?"s":""} to "${d.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(jt,{...b}),t.jsx(tn,{open:D,onOpenChange:L,count:m.size,onConfirm:k}),t.jsx(en,{open:O,onOpenChange:s,agents:z,onConfirm:me}),T.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(S?V.length===0&&w.length===0:e==="all"?V.length===0:w.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:f.search?`No Connections match "${f.search}"`:a?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(r=>{if(r.type==="group")return t.jsx(Qt,{group:r,onOpen:()=>{h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:r.key}})},selectionMode:_,selectedIds:m,onToggleSelect:M},r.key);const d=r.connection,K=m.has(d.id);return t.jsx(Ce,{connection:d,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?M(d.id):h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}}),className:de(K&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:K,onCheckedChange:()=>M(d.id),onClick:I=>I.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:de("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(Ue,{children:[t.jsx(Re,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:I=>I.stopPropagation(),children:t.jsx(Xe,{size:20})})}),t.jsxs(He,{align:"end",onClick:I=>I.stopPropagation(),children:[t.jsxs(re,{onClick:I=>{I.stopPropagation(),h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}})},children:[t.jsx(qe,{size:16}),"Open"]}),(a||x)&&t.jsxs(re,{onClick:I=>{I.stopPropagation(),M(d.id)},children:[t.jsx(Mt,{size:16}),"Select"]}),a&&(d.status==="active"?t.jsxs(re,{onClick:I=>{I.stopPropagation(),se(d.id,"inactive")},children:[t.jsx(Vt,{size:16}),"Disable"]}):t.jsxs(re,{onClick:I=>{I.stopPropagation(),se(d.id,"active")},children:[t.jsx(Et,{size:16}),"Enable"]})),a&&t.jsxs(re,{variant:"destructive",onClick:I=>{I.stopPropagation(),b.requestDelete(d)},children:[t.jsx(Qe,{size:16}),"Delete"]})]})]})})]})},d.id)}),V.map(r=>t.jsx(sn,{item:r,canManage:a,allConnections:N,connectedAppNames:X,connectingItemId:A,onNavigateConnected:d=>h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}}),onConnect:B},`catalog-${r._registryId}:${r.id}`)),(e==="all"||S)&&o.length>0&&t.jsx("div",{ref:H,className:"col-span-full h-4"}),(e==="all"||S)&&T.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ce,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(Zt,{count:m.size,total:w.length,canManage:a,canManageAgents:x,onSelectAll:()=>{v(new Set(w.map(r=>r.id)))},onDeselectAll:()=>v(new Set),onDelete:()=>L(!0),onAddToAgent:()=>s(!0),onToggleStatus:xe,onCancel:C})]})}function rn(){const{org:f}=be(),e=_e(),n=Ze({strict:!1}),{data:p}=Ne.useSession(),{stdioEnabled:l}=et(),o=At(),{granted:i}=ye("connections:manage"),g=Gt({namespace:f.slug,resource:"connections"}),h=We(),[j,y]=tt(nt.connectionsTab(f.slug),c=>n.tab==="all"||n.tab==="connected"?n.tab:c??"all"),[N,b]=E.useState("ALL"),[a,x]=E.useState("ALL"),[m,v]=E.useState("ALL"),_=pt(),L=ke(_,g.searchTerm).items,O=g.search!==g.searchTerm,s=st({resolver:ot(Kt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),F=s.watch("connection_url"),z=s.watch("npx_package"),w=pe({uiType:A,connectionUrl:F??"",npxPackage:z??""})??Se({uiType:A,connectionUrl:F??"",registryItems:L}),P=i&&n.action==="create",M=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:f.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:f.slug},search:{}})},T=async c=>{let S,V=null,R=null,B=null;c.ui_type==="NPX"?(S="STDIO",V="",B=Rt(c.npx_package||"",c.env_vars||[])):c.ui_type==="STDIO"?(S="STDIO",V="",B=Ht(c.stdio_command||"",c.stdio_args||"",c.stdio_cwd,c.env_vars||[])):(S=c.ui_type,V=c.connection_url||"",R=c.connection_token||null);const u=lt("conn");te("connection_custom_created",{connection_type:S,ui_type:c.ui_type}),await h.create.mutateAsync({id:u,title:c.title,description:c.description||null,connection_type:S,connection_url:V,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:f.id,icon:c.icon??null,app_name:null,app_id:null,connection_headers:B,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:f.slug,appSlug:he({app_name:null,connection_url:V,title:c.title,id:u})}})},G=c=>{c||(P&&C(),s.reset())},H=c=>{const S=c.trim();if(!S)return;const V=!!s.formState.dirtyFields.title,R=!!s.formState.dirtyFields.description,B=!!s.formState.dirtyFields.env_vars,u=k=>{if(k&&(!V&&!s.getValues("title").trim()&&k.title&&s.setValue("title",k.title,{shouldDirty:!1}),!R&&!(s.getValues("description")??"").trim()&&k.description&&s.setValue("description",k.description,{shouldDirty:!1}),!B&&k.envVarKeys?.length)){const se=s.getValues("env_vars")??[],xe=new Set(se.map(r=>r.key)),me=k.envVarKeys.filter(r=>!xe.has(r));me.length>0&&s.setValue("env_vars",[...se,...me.map(r=>({key:r,value:""}))],{shouldDirty:!0})}},$=Ut(S);if($&&l){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",$.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),u(pe({uiType:"NPX",npxPackage:$.packageName}));return}if(S.startsWith("http://")||S.startsWith("https://")){const k=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",k,{shouldDirty:!0}),s.setValue("connection_url",S,{shouldDirty:!0}),u(pe({uiType:k,connectionUrl:S})??Se({uiType:k,connectionUrl:S,registryItems:L}));return}A==="NPX"&&u(pe({uiType:"NPX",npxPackage:S}))},X=i?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(U,{variant:"outline",onClick:M,children:[t.jsx(Ge,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(ue,{children:[(()=>{const c="Create Connection",S="Create a custom connection in your organization. Fill in the details below.",V=s.formState.isSubmitting?"Saving...":"Create Connection",R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Type *"}),t.jsxs(wt,{value:u.value,onValueChange:u.onChange,children:[t.jsx(Z,{children:t.jsx(Tt,{children:t.jsx(It,{})})}),t.jsxs(Pt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(zt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),A==="NPX"&&t.jsx(Q,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...u,value:u.value??"",onPaste:$=>{const k=$.clipboardData.getData("text");k&&($.preventDefault(),s.setValue("npx_package",k.trim(),{shouldDirty:!0}),H(k))},onBlur:$=>{H($.target.value),u.onBlur()}})}),t.jsx(ee,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Command *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"node, bun, python...",...u,value:u.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...u,value:u.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...u,value:u.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(Q,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Bt,{value:u.value??[],onChange:u.onChange})}),t.jsx(ee,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:s.control,name:"connection_url",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"URL *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...u,value:u.value??"",onPaste:$=>{const k=$.clipboardData.getData("text");k&&($.preventDefault(),s.setValue("connection_url",k.trim(),{shouldDirty:!0}),H(k))},onBlur:$=>{H($.target.value),u.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:w?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...u,value:u.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.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:"Open GitHub PAT settings"})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"title",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Name *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"My Connection",...u})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"description",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Description"}),t.jsx(Z,{children:t.jsx($t,{placeholder:"A brief description of this connection",rows:3,...u,value:u.value??""})}),t.jsx(ee,{})]})})]}),B=P;return o?t.jsx(vt,{open:B,onOpenChange:G,children:t.jsxs(St,{className:"max-h-[90vh]",children:[t.jsx(bt,{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(_t,{children:c}),t.jsx(Nt,{className:"mt-1",children:S})]}),t.jsx(Dt,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Je,{size:16})})})]})}),t.jsx(ve,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(T),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(kt,{children:t.jsx(U,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(ze,{open:B,onOpenChange:G,children:t.jsxs(Me,{className:"sm:max-w-[525px]",children:[t.jsxs(Ve,{children:[t.jsx(Ee,{children:c}),t.jsx(Be,{children:S})]}),t.jsx(ve,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(T),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(Ke,{children:[t.jsx(U,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),t.jsx(U,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(ue.Content,{children:t.jsx(ue.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ue.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(mt,{value:g.search,onChange:g.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:c=>{c.key==="Escape"&&(g.setSearch(""),c.target.blur())}}),t.jsx(dt,{sortKey:g.sortKey,sortDirection:g.sortDirection,onSort:g.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:N,onChange:c=>b(c||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:a,onChange:c=>x(c||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:m,onChange:c=>v(c||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(c=>({id:c.id,label:c.id.includes("community-registry")?"Community MCP Registry":c.title}))]}]:[]]})]}),X]}),t.jsx(ut,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:j,onTabChange:c=>{const S=c;S!==j&&te("connections_page_tab_changed",{to_tab:S}),y(S)}}),t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:O?.5:1,transition:O?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:O?"none":"auto"},children:t.jsx(on,{listState:g,activeTab:j,typeFilter:N,statusFilter:a,registryFilter:m,enabledRegistries:_})})})]})})})]})})}function zs(){const f=oe.c(1);let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(rn,{})})}),f[0]=e):e=f[0],e}export{zs as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as Ke,r as l,j as i,i as re,B as fe,l as Ve,m as ut,t as $,K as Te}from"./index-tHbNbVHJ.js";import{F as mt,l as pt}from"./index-BSPCA2yy.js";import{i as ht,au as xt,av as gt,aw as ae,ax as yt,U as $e}from"./agent-icon-BbjKuSxW.js";import{a as wt}from"./Tool01-Dvmkyh1g.js";import{s as jt}from"./XClose-Ca4NBXw9.js";import{S as bt}from"./scroll-area-IfNZ394n.js";import{T as Oe,a as Re,b as ze}from"./tooltip-DW1HpudV.js";import{f as vt,a as Ct,b as Nt,c as St,d as Dt,e as kt,A as Ft,g as Lt}from"./alert-dialog-CWTgvZp_.js";import{u as Et}from"./chat-context-C7e3nmPB.js";import{b as Pt}from"./shell-layout-C09jnc4C.js";import{al as le,am as Ae,an as Tt}from"./index-CkflryUu.js";import{d as $t,e as Ot,c as Rt,D as zt,b as At,a as Wt}from"./dialog-DKiQlf0Y.js";import{I as We}from"./input-C1uF2dQ1.js";import{b as It,C as _,a as Ie,c as Mt,d as Kt}from"./context-menu-Cbyc6J5M.js";import{t as Vt}from"./ChevronDown-CpzTl0cf.js";import{i as Bt}from"./ChevronRight-DqDeYsel.js";import{b as Gt}from"./ZoomOut-C9_8nvys.js";import{E as qt,z as Me,A as he,B as Qt,C as Ut,D as Jt,G as M,I as ce,g as xe,J as ge,K as Ht,M as Xt,N as ye,O as de,P as we,Q as Yt,U as Zt}from"./preview-dialog-QbgIb_4T.js";import"./AlertCircle-Bgopcarv.js";import"./SwitchHorizontal01-CTCDUfta.js";import"./Settings02-bfgJ4jKJ.js";import"./XCircle-CxfDN97v.js";import"./ArrowUpRight-7XR-z7Ge.js";import"./ZapSquare-BY_c_0SN.js";import"./Users03-CBNK0aq-.js";import"./CheckCircle-DsdDhP4L.js";import"./ChevronUp-Cr2g1GDa.js";import"./ChevronLeft-BuOnLJw9.js";import"./DotsVertical-BGprjE03.js";import"./Stars02-DXKYKZ_y.js";import"./Eye-B9uHZVsM.js";import"./Globe01-H40eMg8D.js";import"./FilterLines-DgCFEQWk.js";import"./Star01-DnRxcrb2.js";import"./Globe04-BNaAcUBp.js";import"./HardDrive-l0WQMFU9.js";import"./Key01-BDd1iQS4.js";import"./LayoutLeft-DQOl0C9j.js";import"./LinkExternal01-BAME6PCB.js";import"./Monitor01-CaJkUXyc.js";import"./Sun-BvgQbAIe.js";import"./Palette-C1u1Sxuh.js";import"./Play-DSjj50Z1.js";import"./Plus-rHk0VScG.js";import"./SearchMd-Bc8RVvtx.js";import"./Shield01-C0erkp7L.js";import"./Stars01-DN0i_OuW.js";import"./Trash01-BrvLbqQk.js";import"./Upload01-Cghimx9V.js";import"./User01-BPjc8LiD.js";import"./Users01-DKr-dGyn.js";import"./X-BZf8Ua-f.js";import"./Zap-D8ndRUQT.js";import"./use-clock-tick-DLGdZmyk.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-I4sZTiJp.js";import"./file-type-icon-DouhlgA1.js";import"./use-mobile-BD2-gXK-.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-BpY6lzqy.js";import"./use-mcp-client-0BRd9S75.js";import"./auth-DtR4b91D.js";import"./hooks-DWc2KmvK.js";import"./decopilot-sse-pool-DsG4E7i_.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./studio-tools-Dd7dXWQL.js";import"./sheet-DW12PvFQ.js";import"./integration-icon-DOeD9Yy1.js";import"./use-virtual-mcp-CI9qouIO.js";import"./use-collections-GNpTGYUv.js";import"./use-navigate-to-agent-CFNRRTVg.js";import"./use-connection-B65sInnd.js";import"./use-mcp-prompts-D4ll_rda.js";import"./form-B4g755Hl.js";import"./label-Bg0TZhOq.js";import"./select-Ufh1328y.js";import"./use-ai-providers-DS_7m4pz.js";import"./use-organization-settings-CLeV359D.js";import"./avatar-DosbYSVo.js";import"./required-auth-layout-DCkraGAX.js";import"./use-org-sso-CWJ7VJxn.js";import"./index-DJGRW9ro.js";import"./drawer-UishvVn_.js";import"./collection-search-SCB2wfQm.js";import"./tabs-C3buIvx_.js";import"./toggle-group-DFSFo_vP.js";import"./sortable.esm-CoB59DXJ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Cw-v3-1B.js";import"./use-registry-connections-D7ZBIfwl.js";import"./useInfiniteQuery-jWCtindg.js";import"./use-infinite-scroll-Bk__8TxT.js";import"./extract-connection-data-C9MdxGy0.js";import"./card-ChgC15JC.js";import"./collection-tabs-CasRXW3s.js";import"./badge-7eW-Y90w.js";import"./textarea-BiYr__3G.js";import"./connection-form-helpers-BE_9JHz-.js";import"./authenticate-and-persist-oauth-BYDKbSTj.js";import"./mcp-oauth-DxJiJ187.js";import"./useSuspenseInfiniteQuery-CwejNwQJ.js";import"./connect-desktop-dialog-CUoIMZ9P.js";import"./decopilot-D1XiRpB_.js";import"./checkbox-D1J6-HGS.js";import"./skeleton-CpSca80L.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B4a4SAqB.js";import"./popover-eHXpDYJ1.js";import"./command-BP2NK5GV.js";import"./index-CQ5sDlCR.js";import"./dropdown-menu-B_TYOovI.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DAUtYLJA.js";import"./empty-state-BVh7wBPS.js";import"./toolbar-DMYgRw5l.js";import"./use-mcp-tools-UJVs9gTs.js";import"./use-capability-CeF0OpPy.js";import"./shell-route-loading-B_CHvxTG.js";import"./index-BgnTiSnU.js";import"./switch-CuKs1fR0.js";import"./use-debounced-autosave-Hw4VW15I.js";import"./index-87hVDe9f.js";import"./sidebar-Cy5GVw74.js";import"./search-input-DWWTgewM.js";import"./github-repo-picker-DDcB4OPT.js";import"./use-secrets-_avq30K6.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-Del-VZlp.js";import"./automation-runs-CglgtIyd.js";import"./table-BfyoFEgz.js";import"./use-members-BAva2zEC.js";import"./use-org-auth-client-7sV0tnvK.js";import"./task-status-DXhUoFwL.js";import"./use-automations-BOSdn9Us.js";import"./use-file-configs-DObQhPxD.js";import"./monaco-editor-C6tm250p.js";import"./select-model-CQ-f9ftL.js";import"./automation-list-row-DmMT-Lmk.js";const _t={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function en(y){const e=Ke.c(51),{open:c,mode:K,initialName:X,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,W=X===void 0?"":X,o=A===void 0?!1:A,[p,O]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&O(W));let F;e[0]!==o||e[1]!==P?(F=E=>{!E&&!o&&P(!1)},e[0]=o,e[1]=P,e[2]=F):F=e[2];const U=F;let G;e[3]!==o||e[4]!==p||e[5]!==V?(G=async E=>{E.preventDefault();const z=p.trim();!z||o||await V(z)},e[3]=o,e[4]=p,e[5]=V,e[6]=G):G=e[6];const q=G;let L;e[7]!==f.title?(L=i.jsx($t,{children:f.title}),e[7]=f.title,e[8]=L):L=e[8];let N;e[9]!==f.description?(N=i.jsx(Ot,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let R;e[11]!==L||e[12]!==N?(R=i.jsxs(Rt,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=R):R=e[13];let S;e[14]!==Q?(S=Q&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),i.jsx(We,{value:Q,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=Q,e[15]=S):S=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=E=>O(E.target.value),e[17]=j):j=e[17];let b;e[18]!==f.placeholder||e[19]!==o||e[20]!==p?(b=i.jsxs("div",{className:"space-y-1.5",children:[D,i.jsx(We,{id:"file-explorer-name",value:p,onChange:j,placeholder:f.placeholder,autoFocus:!0,disabled:o})]}),e[18]=f.placeholder,e[19]=o,e[20]=p,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==S?(h=i.jsxs("div",{className:"space-y-4 py-4",children:[S,b]}),e[22]=b,e[23]=S,e[24]=h):h=e[24];let x;e[25]!==P?(x=()=>P(!1),e[25]=P,e[26]=x):x=e[26];let v;e[27]!==o||e[28]!==x?(v=i.jsx(fe,{type:"button",variant:"outline",onClick:x,disabled:o,children:"Cancel"}),e[27]=o,e[28]=x,e[29]=v):v=e[29];let C;e[30]!==o||e[31]!==p?(C=!p.trim()||o,e[30]=o,e[31]=p,e[32]=C):C=e[32];let u;e[33]!==f.submit||e[34]!==o?(u=o?i.jsxs(i.Fragment,{children:[i.jsx(re,{size:14,className:"animate-spin"}),"Saving…"]}):f.submit,e[33]=f.submit,e[34]=o,e[35]=u):u=e[35];let k;e[36]!==C||e[37]!==u?(k=i.jsx(fe,{type:"submit",disabled:C,children:u}),e[36]=C,e[37]=u,e[38]=k):k=e[38];let m;e[39]!==v||e[40]!==k?(m=i.jsxs(zt,{children:[v,k]}),e[39]=v,e[40]=k,e[41]=m):m=e[41];let g;e[42]!==q||e[43]!==h||e[44]!==m||e[45]!==R?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[R,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=R,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(Wt,{open:c,onOpenChange:U,children:g}),e[47]=U,e[48]=c,e[49]=g,e[50]=T):T=e[50],T}const tn="#d9a441";function nn(y){const e=Ke.c(45),{node:c,depth:K,isExpanded:X,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:W,onNewFile:o,onNewFolder:p,onCopyPath:O,onCopyRelativePath:I,onRename:B,onDelete:f}=y,F=A===void 0?!1:A,U=c.kind==="directory",{Icon:G,color:q}=V,L=Q&&"bg-accent";let N;e[0]!==L?(N=Ve("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",L),e[0]=L,e[1]=N):N=e[1];const R=`${K*14+8}px`;let S;e[2]!==R?(S={paddingLeft:R},e[2]=R,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==W?(D=()=>{W(),P()},e[4]=P,e[5]=W,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==X||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):X?i.jsx(Vt,{size:14,className:"shrink-0 text-muted-foreground"}):i.jsx(Bt,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx(Gt,{size:16,className:"shrink-0",style:{color:tn}})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-3.5 shrink-0"}),i.jsx(G,{size:16,className:"shrink-0",style:{color:q}})]}),e[7]=G,e[8]=q,e[9]=U,e[10]=X,e[11]=F,e[12]=j):j=e[12];let b;e[13]!==c.name?(b=i.jsx("span",{className:"truncate",children:c.name}),e[13]=c.name,e[14]=b):b=e[14];let h;e[15]!==N||e[16]!==S||e[17]!==D||e[18]!==j||e[19]!==b?(h=i.jsx(It,{asChild:!0,children:i.jsxs("button",{type:"button",className:N,style:S,onClick:D,children:[j,b]})}),e[15]=N,e[16]=S,e[17]=D,e[18]=j,e[19]=b,e[20]=h):h=e[20];let x;e[21]!==o?(x=i.jsx(_,{onSelect:o,children:"New File"}),e[21]=o,e[22]=x):x=e[22];let v;e[23]!==p?(v=i.jsx(_,{onSelect:p,children:"New Folder"}),e[23]=p,e[24]=v):v=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ie,{}),e[25]=C):C=e[25];let u;e[26]!==O?(u=i.jsx(_,{onSelect:O,children:"Copy Path"}),e[26]=O,e[27]=u):u=e[27];let k;e[28]!==I?(k=i.jsx(_,{onSelect:I,children:"Copy Relative Path"}),e[28]=I,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ie,{}),e[30]=m):m=e[30];let g;e[31]!==B?(g=i.jsx(_,{onSelect:B,children:"Rename"}),e[31]=B,e[32]=g):g=e[32];let T;e[33]!==f?(T=i.jsx(_,{variant:"destructive",onSelect:f,children:"Delete"}),e[33]=f,e[34]=T):T=e[34];let E;e[35]!==x||e[36]!==v||e[37]!==u||e[38]!==k||e[39]!==g||e[40]!==T?(E=i.jsxs(Mt,{className:"w-52",children:[x,v,C,u,k,m,g,T]}),e[35]=x,e[36]=v,e[37]=u,e[38]=k,e[39]=g,e[40]=T,e[41]=E):E=e[41];let z;return e[42]!==E||e[43]!==h?(z=i.jsxs(Kt,{children:[h,E]}),e[42]=E,e[43]=h,e[44]=z):z=e[44],z}pt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function je(y,e,c,K){return`/api/${y}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(c)}/${K}`}function rn(y){const e=M(y);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const sn="#94a3b8";function on(y){const e=y.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ae,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ae,color:"#d9a441"}:e.endsWith(".json")?{Icon:yt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ae,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ae,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:wt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:$e,color:"#64748b"}:{Icon:$e,color:sn}}function Ii({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[X,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=X,[P,W]=l.useState(new Set),[o,p]=l.useState(null),[O,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,R]=l.useState(new Set),[S,D]=l.useState(new Set),j=l.useRef(0),b=l.useRef(null),h=l.useRef(new Set),x=l.useRef(new Map);function v(t){R(n=>{const r=typeof t=="function"?t(n):t;return h.current=r,r})}const[C,u]=l.useState(new Map),k=l.useRef(null),[m,g]=l.useState(null),{sendMessage:T}=Et(),{setChatOpen:E}=Pt(),z=ut(),[w,J]=l.useState(null),[H,ue]=l.useState(null),[ee,ie]=l.useState(!1);async function te(t,n){const r=await fetch(je(y,e,c,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`Request failed (${r.status})`)}return r.json()}async function se(){z.invalidateQueries({queryKey:Ae(y,e,c)})}function be(t,n){navigator.clipboard.writeText(n).then(()=>$.success(`${t} copied`),()=>$.error(`Failed to copy ${t.toLowerCase()}`))}function Be(t){const n=Yt(t);if(!n)return;const r=`${y}/${e}/${c}`;z.setQueryData(Te.decofile(r),s=>{if(!s)return s;const{[n]:a,...d}=s;return d}),z.invalidateQueries({queryKey:Te.liveMeta(r)})}function Ge(t){const n=t.kind==="file"?[t.path]:A.filter(r=>r.startsWith(".deco/blocks/")).map(r=>ce(r)).filter(r=>r===t.path||r.startsWith(`${t.path}/`));for(const r of n)Be(r)}function qe(t){const n=ce(t);return B.filter(r=>{if(r!==n&&!r.startsWith(`${n}/`))return!1;const s=C.get(r);return!!(s?.loaded&&s.editorValue!==s.savedContent)})}function ve(t){f(n=>n.map(r=>t(r)).filter(r=>r!==null)),p(n=>n&&t(n)),u(n=>{const r=new Map;for(const[s,a]of n){const d=t(s);d&&r.set(d,a)}return r}),I(n=>{if(!n)return n;const r=t(n.path);return r?r===n.path?n:{...n,path:r,name:r.split("/").pop()??r}:null})}function Qe(t){const n=ce(t);I(r=>r&&(r.path===n||r.path.startsWith(`${n}/`)?null:r)),ve(r=>r===n||r.startsWith(`${n}/`)?null:r)}async function Ue(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);await te("write",{path:M(n),content:""}),await ne(),await se(),J(null),me(n)}async function Je(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);const r=M(n);await te("mkdir",{path:r}),Q(s=>({...s,directories:s.directories.includes(r)?s.directories:[...s.directories,r]})),await ne(),await se(),J(null),W(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),I({name:t,path:n,kind:"directory",children:[]})}async function He(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){J(null);return}if(we(s,A,V))throw new Error(`"${t}" already exists`);await te("rename",{from:M(n),to:M(s)}),ve(a=>a===n?s:a.startsWith(`${n}/`)?de(s,a.slice(n.length+1)):a),await ne(),await se(),J(null)}async function Xe(t){ie(!0);try{await te("unlink",{path:M(t.path),recursive:t.kind==="directory"}),Ge(t),Qe(t.path),await ne(),await se(),ue(null),$.success(`Deleted "${t.name}"`)}catch(n){$.error(n instanceof Error?n.message:"Delete failed")}finally{ie(!1)}}async function Ye(t){const n=Xt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await Je(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await He(t),$.success(`Renamed to "${t}"`))}catch(r){$.error(r instanceof Error?r.message:"Operation failed")}finally{ie(!1)}}const Ce=l.useRef(!1);Ce.current||(Ce.current=!0,b.current=ne());const[Ze,_e]=l.useState(null);if(K&&K!==Ze){_e(K);const t=K;queueMicrotask(()=>{rn(t)&&me(t).catch(n=>{$.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ne(t){const n=await te("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Se(t,n,r){if(r!==j.current)return!1;let s=!1;return Q(a=>{const d=n?Zt(a.files,a.directories,t,a.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return s=!!d.truncated,{files:d.files,directories:d.directories,truncated:s}}),s&&$.warning("File list truncated — some files may be hidden"),s}async function et(t){const n=x.current.get(t);if(n)return n;const r=j.current,s=(async()=>{const a=await Ne({pattern:"**/*",path:M(t),limit:Me}),d=Se(a,!0,r);return!d&&r===j.current&&v(Y=>{const oe=new Set(Y);return oe.add(t),oe}),d})();x.current.set(t,s);try{return await s}finally{x.current.delete(t)}}async function De(t){if(!ge(t,h.current))return!1;D(n=>new Set(n).add(t));try{return await et(t)}finally{D(n=>{const r=new Set(n);return r.delete(t),r})}}async function tt(t){const n=new Set(h.current);for(const r of he(t)){if(!ge(r,n))continue;if(await De(r))throw new Error("Folder listing truncated — expand again to load more");n.add(r)}}async function ne(){const t=++j.current;x.current.clear(),q(!0),v(new Set),W(new Set),D(new Set);try{const n=await Ne({pattern:"**/*",limit:Me,maxDepth:qt});Se(n,!1,t),N(!0)}catch{L&&$.error("Failed to refresh file tree")}finally{q(!1)}}async function ke(t){if(!C.get(t)?.loaded){u(r=>{const s=new Map(r);return s.set(t,{savedContent:"",editorValue:"",loaded:!1}),s});try{const r=await fetch(je(y,e,c,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),full:!0})});if(!r.ok)return;const s=await r.json(),a=Ht(s.content??"");u(d=>{const Y=new Map(d);return Y.set(t,{savedContent:a,editorValue:a,loaded:!0}),Y})}catch{}}}async function nt(t,n){try{const r=await fetch(je(y,e,c,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),content:n})});if(!r.ok){le("file save failed",{path:t,status:r.status});return}le("file saved via sandbox /write",{path:t}),z.invalidateQueries({queryKey:Ae(y,e,c)});try{const s=await Tt(y,e,c);le("git status after save",s)}catch(s){le("git status after save failed",{path:t,error:s instanceof Error?s.message:String(s)})}u(s=>{const a=new Map(s),d=a.get(t);return d&&a.set(t,{...d,savedContent:n}),a})}catch{}}function rt(t){p(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),g(null),B.includes(t)||f(n=>[...n,t]),ke(t)}function it(t){f(n=>{const r=n.filter(s=>s!==t);return o===t&&p(r[r.length-1]??null),r}),u(n=>{const r=new Map(n);return r.delete(t),r})}function Fe(t){W(n=>{const r=new Set(n);return r.has(t)?r.delete(t):r.add(t),r})}async function st(t){if(ge(t,h.current))try{if(await De(t))return}catch(n){$.error(n instanceof Error?n.message:"Failed to load folder");return}Fe(t)}async function ot(t,n){if(n){Fe(t);return}await st(t)}async function me(t){await b.current,await tt(t);const n=he(t);W(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return O?.kind==="directory"?O.path:O?.kind==="file"?ye(O.path):o?ye(o):"/"}function Le(t){const n=at();J({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const lt=Qt(A,V),Ee=Ut(lt,P),Pe=F?Ee.filter(t=>t.node.name.toLowerCase().includes(F.toLowerCase())):Ee,Z=o?C.get(o):null,ct=Z?.loaded&&Z.editorValue!==Z.savedContent,pe=H?qe(H.path):[],dt=(t,n)=>{k.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!o)return;const r=t.getValue();await nt(o,r)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const r=t.getSelection(),s=t.getModel();if(!r||!s||!o)return;const a=s.getValueInRange(r);g({filePath:o,lineStart:r.startLineNumber,lineEnd:r.endLineNumber,selectedCode:a})})};function ft(t){if(!m)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${m.filePath}\``,`**Lines:** ${m.lineStart}–${m.lineEnd}`];if(m.selectedCode){const r=xe(m.filePath),s=m.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+r,s,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),E(!0),T({parts:[{type:"text",text:n.join(`
|
|
2
|
-
`)}]}),g(null)}return G&&!L?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[i.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[i.jsxs("div",{className:"relative min-w-0 flex-1",children:[i.jsx(ht,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{type:"text",value:F,onChange:t=>U(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),i.jsxs(Oe,{children:[i.jsx(Re,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:i.jsx(xt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New file"})]}),i.jsxs(Oe,{children:[i.jsx(Re,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:i.jsx(gt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New folder"})]})]}),i.jsx(bt,{className:"flex-1",children:i.jsxs("div",{className:"py-1",children:[Pe.map(t=>{const{node:n,depth:r}=t,s=n.kind==="directory",a=P.has(n.path),d=O?.path===n.path,Y=Jt(n.path,n.kind),oe=s&&S.has(n.path);return i.jsx(nn,{node:n,depth:r,isExpanded:a,isSelected:d,isLoading:oe,fileVisual:on(n.name),onSelect:()=>I(n),onOpen:()=>{s?ot(n.path,a):me(n.path)},onNewFile:()=>J({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>J({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>be("Path",ce(n.path)),onCopyRelativePath:()=>be("Relative path",M(n.path)),onRename:()=>J({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ue(n)},n.path)}),L&&Pe.length===0&&i.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:F?`No files match "${F}"`:"No files found"})]})})]}),i.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[B.length>0&&i.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:B.map(t=>{const n=C.get(t),r=n?.loaded&&n.editorValue!==n.savedContent,s=o===t,a=t.split("/").pop()??t;return i.jsxs("div",{className:Ve("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",s?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{p(t),ke(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":s,children:[i.jsx("span",{className:"truncate max-w-32",children:a}),r&&i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),i.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:d=>{d.stopPropagation(),it(t)},children:i.jsx(jt,{size:12})})]},t)})}),m&&i.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:i.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const r=t.currentTarget.elements.namedItem("askAiInput");r.value.trim()&&ft(r.value)},children:[i.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&g(null)}}),i.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[i.jsx("title",{children:"Send"}),i.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),i.jsx("div",{className:"flex-1 overflow-hidden",children:o&&Z?.loaded?i.jsx(mt,{language:xe(o),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:o,onChange:t=>{const n=o;n&&u(r=>{const s=new Map(r),a=s.get(n);return a&&s.set(n,{...a,editorValue:t??""}),s})},onMount:dt,loading:i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},o):o&&!Z?.loaded?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),o&&i.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[i.jsx("span",{className:"truncate",children:o}),i.jsxs("span",{children:[ct?"Modified":"Saved"," ·"," ",xe(o)]})]})]}),i.jsx(en,{open:w!==null,mode:w?.mode??"new-file",initialName:w?.mode==="rename"?w.node.name:"",parentLabel:w&&w.mode!=="rename"?w.parentDir==="/"?"/":M(w.parentDir):void 0,isPending:ee,onSubmit:Ye,onOpenChange:t=>{!t&&!ee&&J(null)}}),i.jsx(vt,{open:H!==null,onOpenChange:t=>{!t&&!ee&&ue(null)},children:i.jsxs(Ct,{children:[i.jsxs(Nt,{children:[i.jsxs(St,{children:["Delete ",H?.kind==="directory"?"folder":"file","?"]}),i.jsxs(Dt,{children:["This will permanently delete"," ",i.jsx("span",{className:"font-mono",children:H?.name}),H?.kind==="directory"?" and everything inside it.":".",pe.length>0&&i.jsxs(i.Fragment,{children:[" ",pe.length===1?"One open file has unsaved changes that will be lost.":`${pe.length} open files have unsaved changes that will be lost.`]})]})]}),i.jsxs(kt,{children:[i.jsx(Ft,{disabled:ee,children:"Cancel"}),i.jsx(Lt,{disabled:ee||!H,onClick:t=>{t.preventDefault(),H&&Xe(H)},children:"Delete"})]})]})})]})}export{Ii as FileExplorer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as L,j as t,D as Q,a as te,m as W,r as A,a7 as B,i as F,d as ne,t as z,K as V,k as se,l as K,q as oe,ag as re}from"./index-tHbNbVHJ.js";import{c as ie,d as ae,b as le,a as ce}from"./dialog-DKiQlf0Y.js";import{C as J}from"./checkbox-D1J6-HGS.js";import{C as ue}from"./collection-search-SCB2wfQm.js";import{b as de,u as me}from"./use-connection-B65sInnd.js";import{W as fe,u as H,S as X}from"./use-mcp-client-0BRd9S75.js";import{b as Z}from"./Settings02-bfgJ4jKJ.js";import{v as pe}from"./agent-icon-BbjKuSxW.js";import{a as ge}from"./authenticate-and-persist-oauth-BYDKbSTj.js";import{u as xe}from"./use-mcp-tools-UJVs9gTs.js";import{e as he}from"./extract-connection-data-C9MdxGy0.js";import{m as be}from"./use-navigate-to-agent-CFNRRTVg.js";function U(s){const e=L.c(4),{size:n,className:o}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=c):c=e[0];let a;return e[1]!==o||e[2]!==n?(a=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:o,children:c}),e[1]=o,e[2]=n,e[3]=a):a=e[3],a}function ye(s,e){const n=L.c(12),{org:o}=Q();let c;n[0]!==o.id?(c=fe.REGISTRY(o.id),n[0]=o.id,n[1]=c):c=n[1];const a=c;let r;n[2]!==o.id||n[3]!==o.slug||n[4]!==a?(r={connectionId:a,orgId:o.id,orgSlug:o.slug},n[2]=o.id,n[3]=o.slug,n[4]=a,n[5]=r):r=n[5];const m=H(r);let f;n[6]!==s?(f={name:s},n[6]=s,n[7]=f):f=n[7];const i=e?.enabled??!0;let h;return n[8]!==m||n[9]!==f||n[10]!==i?(h={client:m,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:f,enabled:i,staleTime:3e5,select:we},n[8]=m,n[9]=f,n[10]=i,n[11]=h):h=n[11],xe(h)}function we(s){return s.structuredContent?.item??null}const Ne="deco/mcp-github";function Ie(s){const{org:e}=Q(),{data:n}=te.useSession(),o=de(),c=W(),[a,r]=A.useState("idle"),[m,f]=A.useState(null),[i,h]=A.useState(null),{data:x,isLoading:l}=ye(Ne,{enabled:s.enabled}),w=A.useRef(!1);s.enabled&&x&&!l&&!w.current&&n?.user?.id&&a==="idle"&&(w.current=!0,y());async function y(){if(!(!x||!n?.user?.id||!e))try{r("installing"),f(null);const b=he(x,e.id,n.user.id,{remoteIndex:0});if(!b.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:S}=await o.create.mutateAsync(b);r("authenticating");const p=await ge({connectionId:S,orgId:e.id,orgSlug:e.slug,persistFallback:d=>o.update.mutateAsync({id:S,data:{connection_token:d}}).then(()=>{})});if(p.ran&&!p.ok){try{await o.delete.mutateAsync(S)}catch{}throw new Error(p.error&&p.error!=="no token received"?p.error:"No token received from GitHub")}B(c,e.id),h(b),r("ready")}catch(b){f(b instanceof Error?b.message:String(b)),r("error")}}function N(){r("idle"),f(null),h(null),w.current=!1}return s.enabled&&l&&a==="idle"?{status:"installing",error:null,connection:null,retry:N}:{status:a,error:m,connection:i,retry:N}}const M={contents:"write",metadata:"read",pull_requests:"write",issues:"write"};function Se(s){if(!s||typeof s!="object"||Array.isArray(s))return M;const e=s;return Object.values(e).some(n=>typeof n!="string")?M:e}function je(s){if(!(typeof s!="number"||!Number.isFinite(s)||!Number.isInteger(s)||s<=0))return s}function Ce(s){const e=s.metadata?.repoScope;if(!e||typeof e.installationId!="number"||!Number.isFinite(e.installationId)||!Number.isInteger(e.installationId)||e.installationId<=0||typeof e.owner!="string"||typeof e.repo!="string"||e.owner.length===0||e.repo.length===0)return null;const n=je(e.repositoryId);return{sourceConnectionId:typeof e.sourceConnectionId=="string"?e.sourceConnectionId:void 0,installationId:e.installationId,repositoryId:n,owner:e.owner,repo:e.repo,permissions:Se(e.permissions),grantProvider:e.grantProvider==="github-mcp"?"github-mcp":void 0}}function ve(s){return(s??[]).filter(e=>Ce(e)===null)}async function Ee(s,e){const o=(await s({name:"GITHUB_LIST_USER_ORGS",arguments:{connectionId:e}})).content?.[0]?.text;if(!o)throw new Error("No response from GITHUB_LIST_USER_ORGS");try{return JSON.parse(o)}catch{throw new Error("Invalid response from GITHUB_LIST_USER_ORGS")}}function We(s,e){const n=e.toLowerCase();return s.find(o=>o.login.toLowerCase()===n)}const Y="GitHub MCP did not return refreshable repo grant metadata";function $(s){if(typeof s!="string")return null;const e=s.trim();return e.length>0?e:null}function Te(s){try{const e=new URL(s);return(e.protocol==="http:"||e.protocol==="https:")&&!e.username&&!e.password}catch{return!1}}function _e(s){return typeof s=="number"&&Number.isFinite(s)&&Number.isInteger(s)&&s>0?s:void 0}async function ke(s){const{orgSlug:e,sourceConnection:n,installationId:o,owner:c,repo:a,githubCallTool:r,selfCallTool:m}=s,f=await r({name:"MINT_REPO_TOKEN",arguments:{installationId:o,owner:c,repo:a,permissions:M}}),i=f.structuredContent;if(f.isError||!i?.token){const T=f.content?.find(v=>v.type==="text")?.text;throw new Error(T?`Failed to mint a repo-scoped GitHub token: ${T}`:"Failed to mint a repo-scoped GitHub token")}const h=$(i.refreshToken),x=$(i.tokenEndpoint),l=$(i.clientId);if(!h||!x||!l)throw new Error(Y);if(!Te(x))throw new Error(Y);const w=$(i.repository?.owner),y=$(i.repository?.name),N="GitHub MCP returned refresh metadata for a different repository";if(i.repository?.owner!==void 0&&(!w||w.toLowerCase()!==c.toLowerCase()))throw new Error(N);if(i.repository?.name!==void 0&&(!y||y.toLowerCase()!==a.toLowerCase()))throw new Error(N);const b=_e(i.repository?.id),I=i.expiresAt?Date.parse(i.expiresAt):NaN,S=Number.isFinite(I)?Math.max(0,Math.floor((I-Date.now())/1e3)):null,d=(typeof i.expiresIn=="number"&&Number.isFinite(i.expiresIn)&&Number.isInteger(i.expiresIn)&&i.expiresIn>0?i.expiresIn:null)??S,j=await m({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:{title:`GitHub: ${c}/${a}`,description:`Repo-scoped GitHub access for ${c}/${a}`,icon:n.icon,app_name:n.app_name,app_id:n.app_id,connection_type:n.connection_type,connection_url:n.connection_url,metadata:{repoScope:{installationId:o,repositoryId:b,owner:c,repo:a,permissions:M,grantProvider:"github-mcp"}}}}}),g=j.structuredContent??j,C=g.item?.id??g.id;if(!C)throw new Error("Failed to create the repo-scoped GitHub connection");if(!(await fetch(`/api/${e}/connections/${C}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:i.token,refreshToken:h,expiresIn:d,scope:i.scope??null,clientId:l,tokenEndpoint:x})})).ok)throw await m({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:C,force:!0}}).catch(()=>{}),new Error("Failed to persist the repo-scoped token");return{childConnectionId:C}}function Re(s,e){const n=L.c(4),[o,c]=A.useState(s);let a,r;return n[0]!==e||n[1]!==s?(a=()=>{const m=setTimeout(()=>c(s),e);return()=>clearTimeout(m)},r=[s,e],n[0]=e,n[1]=s,n[2]=a,n[3]=r):(a=n[2],r=n[3]),A.useEffect(a,r),o}const D=[{key:"auto-respond-to-issues",triggerType:"github.issues.opened",nameSuffix:"auto-respond to issues",label:"Auto-respond to new issues",defaultEnabled:!0,instructions:({owner:s,name:e})=>`A new GitHub issue has been opened in ${s}/${e}. Read the issue, explore relevant code, create a branch, implement the fix, and open a PR referencing the issue number.`},{key:"review-incoming-prs",triggerType:"github.pull_request.opened",nameSuffix:"review incoming PRs",label:"Review incoming pull requests",defaultEnabled:!0,instructions:({owner:s,name:e})=>`A pull request was opened in ${s}/${e}. Read the diff, summarize what changed, flag risks (security, perf, breaking changes), and leave a review comment.`},{key:"note-merged-prs",triggerType:"github.pull_request.closed",nameSuffix:"note merged/closed PRs",label:"Note merged or closed PRs",defaultEnabled:!1,instructions:({owner:s,name:e})=>`A pull request was closed in ${s}/${e}. If it was merged, update changelog/release notes as appropriate.`}];function Ae(s,e){const n=new Set;if(s.paramsSchema)for(const c of Object.keys(s.paramsSchema))n.add(c);if(Array.isArray(s.params))for(const c of s.params)n.add(c.name);else if(s.params&&typeof s.params=="object")for(const c of Object.keys(s.params))n.add(c);if(n.has("repo"))return{repo:`${e.owner}/${e.name}`};const o={};return n.has("owner")&&(o.owner=e.owner),n.has("name")&&(o.name=e.name),n.has("repository")&&(o.repository=`${e.owner}/${e.name}`),o}async function Oe({githubCallTool:s,selfCallTool:e,virtualMcpId:n,repo:o,connectionId:c,selectedKeys:a}){const r=await s({name:"TRIGGER_LIST",arguments:{}}),m=r.structuredContent??r,f=new Map((m.triggers??[]).map(l=>[l.type,l])),i=D.filter(l=>a.has(l.key)),h=await Promise.allSettled(i.map(async l=>{const w=f.get(l.triggerType);if(!w)throw new Error(`Trigger ${l.triggerType} not exposed`);const y=await e({name:"AUTOMATION_CREATE",arguments:{name:`${o.name}: ${l.nameSuffix}`,virtual_mcp_id:n,messages:l.instructions(o),active:!0}}),N=(y.structuredContent??y).id;if(!N)throw new Error(`AUTOMATION_CREATE returned no id for ${l.key}`);await e({name:"AUTOMATION_TRIGGER_ADD",arguments:{automation_id:N,type:"event",connection_id:c,event_type:l.triggerType,params:Ae(w,o)}})})),x=h.filter(l=>l.status==="rejected").length;return x>0&&console.error("Some GitHub automations failed to set up:",h.filter(l=>l.status==="rejected")),{total:h.length,failed:x}}function Xe(s){const e=L.c(22),{open:n,onOpenChange:o,title:c,hideAutoRespondCheckbox:a,onImportComplete:r}=s,m=c===void 0?"Import from GitHub":c,f=a===void 0?!1:a,[i,h]=A.useState(null);let x;e[0]!==m?(x=t.jsx(ie,{className:"sr-only",children:t.jsx(ae,{children:m})}),e[0]=m,e[1]=x):x=e[1];let l;e[2]!==i||e[3]!==m?(l=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:i?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>h(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(Z,{size:16})}),t.jsx("img",{src:i.avatarUrl,alt:i.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:i.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(U,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:m})]})}),e[2]=i,e[3]=m,e[4]=l):l=e[4];let w;e[5]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=w):w=e[5];let y;e[6]!==o?(y=()=>o(!1),e[6]=o,e[7]=y):y=e[7];let N;e[8]!==f||e[9]!==r||e[10]!==n||e[11]!==i||e[12]!==y?(N=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(A.Suspense,{fallback:w,children:t.jsx(Ge,{open:n,onComplete:y,selectedInstallation:i,onSelectInstallation:h,hideAutoRespondCheckbox:f,onImportComplete:r})})}),e[8]=f,e[9]=r,e[10]=n,e[11]=i,e[12]=y,e[13]=N):N=e[13];let b;e[14]!==x||e[15]!==l||e[16]!==N?(b=t.jsxs(le,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[x,l,N]}),e[14]=x,e[15]=l,e[16]=N,e[17]=b):b=e[17];let I;return e[18]!==o||e[19]!==n||e[20]!==b?(I=t.jsx(ce,{open:n,onOpenChange:o,children:b}),e[18]=o,e[19]=n,e[20]=b,e[21]=I):I=e[21],I}function Ge({open:s,onComplete:e,selectedInstallation:n,onSelectInstallation:o,hideAutoRespondCheckbox:c,onImportComplete:a}){const{org:r}=Q(),m=W(),f=be(),[i,h]=A.useState(null),[x,l]=A.useState(!0),[w,y]=A.useState(()=>new Set(D.filter(u=>u.defaultEnabled).map(u=>u.key))),N=D.filter(u=>u.defaultEnabled).map(u=>u.key),b=c?new Set(N):x?w:new Set,I=me({slug:"mcp-github"}),S=ve(I),p=Ie({enabled:s&&S.length===0}),d=S.length===1?S[0]??null:i,j=H({connectionId:d?.id??"",orgId:r.id,orgSlug:r.slug}),g=H({connectionId:X,orgId:r.id,orgSlug:r.slug}),C=async(u,E)=>{try{const G=await j.callTool({name:"get_file_contents",arguments:{owner:u.owner,repo:u.name,path:E}});if(G.isError)return null;const P=G.content?.find(R=>R.type==="resource")?.resource?.text;if(!P)return null;try{const R=JSON.parse(P);return typeof R=="string"?R:JSON.stringify(R)}catch{return P}}catch{return null}},O=(u,E)=>{Promise.all([C(E,"AGENTS.md"),C(E,"CLAUDE.md")]).then(async([k,G])=>{const _=k??G??null;_&&(await g.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:u,data:{metadata:{instructions:_}}}}),B(m,r.id))}).catch(k=>{console.error("GitHub instructions fetch failed:",k)})},T=async({virtualMcpId:u,repo:E,connectionId:k,selectedKeys:G})=>{const{total:_,failed:P}=await Oe({githubCallTool:R=>j.callTool(R),selfCallTool:R=>g.callTool(R),virtualMcpId:u,repo:E,connectionId:k,selectedKeys:G});P>0&&z.warning(`Set up ${_-P}/${_} GitHub automations. Add the rest from the automations view.`)},v=ne({mutationFn:async u=>{if(!d||!n)throw new Error("No GitHub connection or installation");const E=n.installationId,{childConnectionId:k}=await ke({orgSlug:r.slug,sourceConnection:d,installationId:E,owner:u.owner,repo:u.name,githubCallTool:_=>j.callTool(_),selfCallTool:_=>g.callTool(_)});let G=null;try{const _=await g.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:u.name,description:u.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:u.owner,name:u.name,url:u.url,installationId:E,connectionId:k},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:k}]}}}),P=_.structuredContent??_,R=P.item?.id;if(!P.item||!R)throw new Error("Failed to create the imported agent");return G=R,b.size>0&&await T({virtualMcpId:R,repo:u,connectionId:k,selectedKeys:b}).catch(ee=>{console.error("Failed to set up GitHub automations:",ee),z.warning("Imported repo, but failed to set up GitHub automations. You can add triggers manually from the automations view.")}),{virtualMcpId:R,repo:u,connectionId:k,item:P.item}}catch(_){throw G&&await g.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:G}}).catch(()=>{}),await g.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:k,force:!0}}).catch(()=>{}),_}},onSuccess:({virtualMcpId:u,repo:E,connectionId:k,item:G})=>{if(m.setQueryData(V.collectionItem(g,r.id,"","VIRTUAL_MCP",u),{item:G}),B(m,r.id),O(u,E),a){a({virtualMcpId:u,repo:E,connectionId:k});return}z.success(`Imported ${E.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),f(u)},onError:u=>{z.error("Failed to import repo: "+(u instanceof Error?u.message:"Unknown error"))}});return p.status==="installing"||p.status==="authenticating"?t.jsx(q,{status:p.status,error:null,retry:p.retry}):p.status==="error"?t.jsx(q,{status:"error",error:p.error,retry:p.retry}):S.length===0&&p.status==="idle"?t.jsx(q,{status:"installing",error:null,retry:p.retry}):S.length>1&&!d?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),S.map(u=>t.jsxs("button",{type:"button",onClick:()=>h(u),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[u.icon?t.jsx("img",{src:u.icon,alt:u.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(U,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:u.title})]},u.id))]}):d?n?t.jsx(Le,{connectionId:d.id,orgId:r.id,orgSlug:r.slug,installation:n,onSelectRepo:u=>v.mutate(u),isSaving:v.isPending,autoRespondEnabled:x,onAutoRespondChange:l,selectedAutomationKeys:w,onAutomationKeysChange:y,hideAutoRespondCheckbox:c}):t.jsx(Pe,{connectionId:d.id,orgId:r.id,orgSlug:r.slug,onSelect:o,showBackButton:S.length>1,onBack:()=>h(null)}):null}function Pe(s){const e=L.c(31),{connectionId:n,orgId:o,orgSlug:c,onSelect:a,showBackButton:r,onBack:m}=s;let f;e[0]!==o||e[1]!==c?(f={connectionId:X,orgId:o,orgSlug:c},e[0]=o,e[1]=c,e[2]=f):f=e[2];const i=H(f);let h;e[3]!==n||e[4]!==o?(h=V.githubUserOrgs(o,n),e[3]=n,e[4]=o,e[5]=h):h=e[5];let x;e[6]!==n||e[7]!==i?(x=()=>Ee(g=>i.callTool(g),n),e[6]=n,e[7]=i,e[8]=x):x=e[8];let l;e[9]!==h||e[10]!==x?(l={queryKey:h,queryFn:x},e[9]=h,e[10]=x,e[11]=l):l=e[11];const w=se(l);if(w.isLoading){let g;return e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[12]=g):g=e[12],g}if(w.isError){let g;return e[13]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"})}),e[13]=g):g=e[13],g}const y=w.data;if(!y)return null;let N;e[14]!==m||e[15]!==r?(N=r&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:m,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(Z,{size:12}),"Change connection"]})}),e[14]=m,e[15]=r,e[16]=N):N=e[16];let b;if(e[17]!==y.installations||e[18]!==a){let g;e[20]!==a?(g=C=>t.jsxs("button",{type:"button",onClick:()=>a(C),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:C.avatarUrl,alt:C.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:C.login}),C.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},C.installationId),e[20]=a,e[21]=g):g=e[21],b=y.installations.map(g),e[17]=y.installations,e[18]=a,e[19]=b}else b=e[19];let I;e[22]!==b?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:b}),e[22]=b,e[23]=I):I=e[23];const S=y.appSlug?`https://github.com/apps/${y.appSlug}/installations/new`:"https://github.com/settings/installations";let p;e[24]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[24]=p):p=e[24];let d;e[25]!==S?(d=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",p]})}),e[25]=S,e[26]=d):d=e[26];let j;return e[27]!==d||e[28]!==N||e[29]!==I?(j=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[N,I,d]}),e[27]=d,e[28]=N,e[29]=I,e[30]=j):j=e[30],j}function Le(s){const e=L.c(27),{connectionId:n,orgId:o,orgSlug:c,installation:a,onSelectRepo:r,isSaving:m,autoRespondEnabled:f,onAutoRespondChange:i,selectedAutomationKeys:h,onAutomationKeysChange:x,hideAutoRespondCheckbox:l}=s,[w,y]=A.useState(""),N=Re(w,300),b=A.useDeferredValue(N),I=w!==b;let S;e[0]!==I||e[1]!==w?(S=t.jsx(ue,{placeholder:"Search repositories...",value:w,onChange:y,isSearching:I}),e[0]=I,e[1]=w,e[2]=S):S=e[2];const p=I?"opacity-40":"opacity-100";let d;e[3]!==p?(d=K("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",p),e[3]=p,e[4]=d):d=e[4];let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(F,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=j):j=e[5];let g;e[6]!==n||e[7]!==b||e[8]!==a||e[9]!==m||e[10]!==r||e[11]!==o||e[12]!==c?(g=t.jsx(A.Suspense,{fallback:j,children:t.jsx($e,{connectionId:n,orgId:o,orgSlug:c,installation:a,query:b,onSelectRepo:r,isSaving:m})}),e[6]=n,e[7]=b,e[8]=a,e[9]=m,e[10]=r,e[11]=o,e[12]=c,e[13]=g):g=e[13];let C;e[14]!==d||e[15]!==g?(C=t.jsx("div",{className:d,children:g}),e[14]=d,e[15]=g,e[16]=C):C=e[16];let O;e[17]!==f||e[18]!==l||e[19]!==i||e[20]!==x||e[21]!==h?(O=!l&&t.jsxs("div",{className:"border-t border-border shrink-0",children:[t.jsxs("label",{className:"flex items-center gap-2 px-4 py-3 cursor-pointer select-none",children:[t.jsx(J,{checked:f,onCheckedChange:v=>i(v===!0)}),t.jsx("span",{className:"text-xs text-foreground",children:"Set up GitHub automations for this repo"})]}),f&&t.jsx("div",{className:"px-4 pb-3 pl-9 flex flex-col gap-1.5",children:D.map(v=>t.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[t.jsx(J,{checked:h.has(v.key),onCheckedChange:u=>{const E=new Set(h);u===!0?E.add(v.key):E.delete(v.key),x(E)}}),t.jsx("span",{className:"text-xs text-muted-foreground",children:v.label})]},v.key))})]}),e[17]=f,e[18]=l,e[19]=i,e[20]=x,e[21]=h,e[22]=O):O=e[22];let T;return e[23]!==S||e[24]!==C||e[25]!==O?(T=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[S,C,O]}),e[23]=S,e[24]=C,e[25]=O,e[26]=T):T=e[26],T}function $e(s){const e=L.c(29),{connectionId:n,orgId:o,orgSlug:c,installation:a,query:r,onSelectRepo:m,isSaving:f}=s;let i;e[0]!==n||e[1]!==o||e[2]!==c?(i={connectionId:n,orgId:o,orgSlug:c},e[0]=n,e[1]=o,e[2]=c,e[3]=i):i=e[3];const h=H(i),x=a.type==="User"?"user":"org",l=r?`${x}:${a.login} ${r} in:name`:`${x}:${a.login}`;let w;e[4]!==n||e[5]!==a.login||e[6]!==o||e[7]!==r?(w=V.githubOrgRepos(o,n,a.login,r),e[4]=n,e[5]=a.login,e[6]=o,e[7]=r,e[8]=w):w=e[8];let y;e[9]!==h||e[10]!==l?(y=async p=>{const{signal:d}=p,g=(await h.callTool({name:"search_repositories",arguments:{query:l,page:1,perPage:30}},void 0,{signal:d})).content?.[0]?.text;if(!g)throw new Error("No response from search_repositories");return(JSON.parse(g).items??[]).map(He)},e[9]=h,e[10]=l,e[11]=y):y=e[11];let N;e[12]!==w||e[13]!==y?(N={queryKey:w,queryFn:y},e[12]=w,e[13]=y,e[14]=N):N=e[14];const{data:b}=oe(N);if(b.length===0){let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=p):p=e[15];let d;e[16]!==r?(d=r&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=r,e[17]=d):d=e[17];let j;return e[18]!==d?(j=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[p,d]}),e[18]=d,e[19]=j):j=e[19],j}let I;if(e[20]!==f||e[21]!==m||e[22]!==b){let p;e[24]!==f||e[25]!==m?(p=d=>t.jsxs("button",{type:"button",onClick:()=>m(d),disabled:f,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(U,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:d.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[d.private?t.jsx(re,{size:10}):t.jsx(pe,{size:10}),d.private?"Private":"Public"]})]},d.fullName),e[24]=f,e[25]=m,e[26]=p):p=e[26],I=b.map(p),e[20]=f,e[21]=m,e[22]=b,e[23]=I}else I=e[23];let S;return e[27]!==I?(S=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:I}),e[27]=I,e[28]=S):S=e[28],S}function He(s){return{name:s.name,fullName:s.full_name,owner:s.full_name.split("/")[0]??"",url:s.html_url,private:s.private,description:s.description,updatedAt:s.updated_at}}function q(s){const e=L.c(33),{status:n,error:o,retry:c}=s;if(n==="error"){let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(U,{className:"size-5 text-destructive"})}),e[0]=g):g=e[0];let C;e[1]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=C):C=e[1];const O=o??"Something went wrong while connecting to GitHub.";let T;e[2]!==O?(T=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[C,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:O})]}),e[2]=O,e[3]=T):T=e[3];let v;e[4]!==c?(v=t.jsx("button",{type:"button",onClick:c,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=c,e[5]=v):v=e[5];let u;return e[6]!==T||e[7]!==v?(u=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[g,T,v]}),e[6]=T,e[7]=v,e[8]=u):u=e[8],u}const a=n==="authenticating";let r;e[9]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(U,{className:"size-5 text-foreground"})}),e[9]=r):r=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"relative size-10",children:[r,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(F,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=m):m=e[10];const f=a?"Authenticating with GitHub":"Setting up GitHub";let i;e[11]!==f?(i=t.jsx("p",{className:"text-sm font-medium",children:f}),e[11]=f,e[12]=i):i=e[12];const h=a?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let x;e[13]!==h?(x=t.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[13]=h,e[14]=x):x=e[14];let l;e[15]!==i||e[16]!==x?(l=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[i,x]}),e[15]=i,e[16]=x,e[17]=l):l=e[17];const w=a?"bg-muted-foreground/30":"bg-foreground animate-pulse";let y;e[18]!==w?(y=K("size-1.5 rounded-full",w),e[18]=w,e[19]=y):y=e[19];let N;e[20]!==y?(N=t.jsx("span",{className:y}),e[20]=y,e[21]=N):N=e[21];const b=a?"bg-foreground animate-pulse":"bg-muted-foreground/30";let I;e[22]!==b?(I=K("size-1.5 rounded-full",b),e[22]=b,e[23]=I):I=e[23];let S;e[24]!==I?(S=t.jsx("span",{className:I}),e[24]=I,e[25]=S):S=e[25];let p;e[26]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=p):p=e[26];let d;e[27]!==N||e[28]!==S?(d=t.jsxs("div",{className:"flex items-center gap-1.5",children:[N,S,p]}),e[27]=N,e[28]=S,e[29]=d):d=e[29];let j;return e[30]!==d||e[31]!==l?(j=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[m,l,d]}),e[30]=d,e[31]=l,e[32]=j):j=e[32],j}export{Xe as G,U as a,Ie as b,We as c,Ee as f,ve as g,ke as p,Re as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as N,j as s,C as us,r as z,l as Q,i as Ks,w as ee,D as ue,a as we,F as Vs,K as ms,k as fs,b as Ee,e as Ys,u as er,G as tr,R as sr,H as nr,o as rr,s as or,n as ir,p as lr,d as ar,B as pt,I as cr,J as dr,t as Ae,M as ur,P as mr,x as fr,m as pr,y as xr,T as hr,U as gr,V as br,W as ze,X as Xs,Y as jr,Z as Qs,_ as vr,$ as yr,a0 as Sr,a1 as _r,a2 as Nr,a3 as Cr,a4 as wr,a5 as kr,E as Js,O as Ir}from"./index-tHbNbVHJ.js";import{u as Qe,S as he,a as ke,b as Lt,c as Ht,d as Oe,e as Zs,f as en,g as Tr,h as $r,i as rs,j as Ar,k as zr,l as Or}from"./sidebar-Cy5GVw74.js";import{u as ps}from"./use-mobile-BD2-gXK-.js";import{u as Pr,S as Ns,M as Dr}from"./shell-controls-xlIGzcZ3.js";import{a as Mr,b as Rr,c as Er}from"./ZoomOut-C9_8nvys.js";import{T as ge,a as ae}from"./toolbar-DMYgRw5l.js";import{a as Pe,b as De,T as Me,c as Cs}from"./tooltip-DW1HpudV.js";import{S as Ne}from"./skeleton-CpSca80L.js";import{P as Bt,a as xt,b as Ut}from"./popover-eHXpDYJ1.js";import{D as tn,a as sn,b as nn}from"./drawer-UishvVn_.js";import{i as rn}from"./SearchMd-Bc8RVvtx.js";import{s as Fr}from"./Star01-DnRxcrb2.js";import{s as Ce}from"./Plus-rHk0VScG.js";import{i as Gr,a as Lr}from"./use-mcp-client-0BRd9S75.js";import{u as on,a as jt,b as Hr}from"./use-virtual-mcp-CI9qouIO.js";import{u as Br}from"./use-create-virtual-mcp-mtRixRQv.js";import{I as Ur,u as qr,W as Wr,H as Kr,S as Vr}from"./import-from-deco-dialog-Bih2Fm5A.js";import{A as Re,a as ws,b as ks,c as ln,d as Yr,e as Xr,i as Qr,f as Jr}from"./agent-icon-BbjKuSxW.js";import{G as Zr,a as eo}from"./github-repo-picker-DDcB4OPT.js";import{u as an,a as to,b as cn,T as so}from"./hooks-DWc2KmvK.js";import{r as no,u as ro,R as oo,a as io,b as dn}from"./shell-layout-C09jnc4C.js";import{u as lo,g as un,a as ao,b as co,s as uo,c as mo,r as fo,d as po,e as xo,f as ho,p as go,T as os,h as bo,i as jo,j as vo,k as yo,l as So,m as _o,n as No,o as Co,q as wo,S as Is,t as mn}from"./use-navigate-to-agent-CFNRRTVg.js";import{g as ko,u as fn,A as pn,a as Io,b as To,c as Ts,K as $o,P as Ao,s as zo,S as Oo,v as Po,D as Do,d as Mo,e as Ro,C as Eo,f as Fo}from"./sortable.esm-CoB59DXJ.js";import{i as Go}from"./LayoutLeft-DQOl0C9j.js";import{i as xn}from"./Monitor01-CaJkUXyc.js";import{u as Lo,v as Ho,C as Bo}from"./connect-desktop-dialog-CUoIMZ9P.js";import{A as is}from"./avatar-DosbYSVo.js";import{i as xs}from"./ChevronUp-Cr2g1GDa.js";import{a as $s}from"./Eye-B9uHZVsM.js";import{n as Uo,i as qo}from"./Globe01-H40eMg8D.js";import{i as Wo,a as hn}from"./ZapSquare-BY_c_0SN.js";import{n as Ko,a as Vo}from"./Sun-BvgQbAIe.js";import{a as vt,b as Yo,i as Xo}from"./Settings02-bfgJ4jKJ.js";import{i as Qo}from"./Shield01-C0erkp7L.js";import{a as Jo}from"./Users03-CBNK0aq-.js";import{s as hs}from"./XClose-Ca4NBXw9.js";import{A as Zo,a as ei,b as ti,c as si,d as ni,e as ri,f as oi}from"./alert-dialog-CWTgvZp_.js";import{F as ii,a as li,b as ai,c as ci,d as di,f as ui,e as mi}from"./form-B4g755Hl.js";import{I as fi}from"./input-C1uF2dQ1.js";import{S as pi,C as xi}from"./chat-context-C7e3nmPB.js";import"./index-DZqx_Cnp.js";import{n as gs}from"./Stars02-DXKYKZ_y.js";import{u as hi,a as gi}from"./use-join-requests-D-QyHVW_.js";import{i as bs}from"./ChevronRight-DqDeYsel.js";import{i as bi}from"./FilterLines-DgCFEQWk.js";import{t as ji}from"./Users01-DKr-dGyn.js";import{S as As,a as gn,b as zs,c as Os,d as Ps}from"./select-Ufh1328y.js";import{c as vi,d as yi,e as Si,b as _i,a as Ni}from"./dialog-DKiQlf0Y.js";import{C as Ci,a as wi,b as ki,c as Ii,d as Ti}from"./command-BP2NK5GV.js";import{u as bn}from"./studio-tools-Dd7dXWQL.js";import{i as jn}from"./Zap-D8ndRUQT.js";import{u as $i}from"./use-org-auth-client-7sV0tnvK.js";import{C as Ot,a as Ds,b as vn,c as yn,d as Sn}from"./context-menu-Cbyc6J5M.js";import{g as Ai,S as zi}from"./task-status-DXhUoFwL.js";import{u as Oi,f as Pi}from"./use-clock-tick-DLGdZmyk.js";import{t as _n}from"./ChevronDown-CpzTl0cf.js";import{S as Di}from"./shell-route-loading-B_CHvxTG.js";import"./sheet-DW12PvFQ.js";import"./X-BZf8Ua-f.js";import"./ChevronLeft-BuOnLJw9.js";import"./auth-DtR4b91D.js";import"./use-collections-GNpTGYUv.js";import"./use-connection-B65sInnd.js";import"./collection-search-SCB2wfQm.js";import"./AlertCircle-Bgopcarv.js";import"./Tool01-Dvmkyh1g.js";import"./SwitchHorizontal01-CTCDUfta.js";import"./XCircle-CxfDN97v.js";import"./ArrowUpRight-7XR-z7Ge.js";import"./CheckCircle-DsdDhP4L.js";import"./DotsVertical-BGprjE03.js";import"./Globe04-BNaAcUBp.js";import"./HardDrive-l0WQMFU9.js";import"./Key01-BDd1iQS4.js";import"./LinkExternal01-BAME6PCB.js";import"./Palette-C1u1Sxuh.js";import"./Play-DSjj50Z1.js";import"./Stars01-DN0i_OuW.js";import"./Trash01-BrvLbqQk.js";import"./Upload01-Cghimx9V.js";import"./User01-BPjc8LiD.js";import"./checkbox-D1J6-HGS.js";import"./authenticate-and-persist-oauth-BYDKbSTj.js";import"./mcp-oauth-DxJiJ187.js";import"./use-mcp-tools-UJVs9gTs.js";import"./extract-connection-data-C9MdxGy0.js";import"./decopilot-sse-pool-DsG4E7i_.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./required-auth-layout-DCkraGAX.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-CLeV359D.js";import"./use-org-sso-CWJ7VJxn.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Cw-v3-1B.js";import"./use-registry-connections-D7ZBIfwl.js";import"./useInfiniteQuery-jWCtindg.js";import"./use-infinite-scroll-Bk__8TxT.js";import"./card-ChgC15JC.js";import"./integration-icon-DOeD9Yy1.js";import"./collection-tabs-CasRXW3s.js";import"./badge-7eW-Y90w.js";import"./textarea-BiYr__3G.js";import"./connection-form-helpers-BE_9JHz-.js";import"./useSuspenseInfiniteQuery-CwejNwQJ.js";import"./use-ai-providers-DS_7m4pz.js";import"./label-Bg0TZhOq.js";import"./use-capability-CeF0OpPy.js";import"./index-CQ5sDlCR.js";import"./differenceInSeconds-NQ4PDo0z.js";function Mi(t){const e=N.c(5),{onPointerDown:n,onDoubleClick:r}=t,{state:o,isMobile:i}=Qe();if(i||o==="collapsed")return null;let l,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={left:"var(--sidebar-width)"},a=s.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),e[0]=l,e[1]=a):(l=e[0],a=e[1]);let c;return e[2]!==r||e[3]!==n?(c=s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:n,onDoubleClick:r,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:l,children:a}),e[2]=r,e[3]=n,e[4]=c):c=e[4],c}const js=240,Ri=400,Ei="sidebar.width";function bt(t){return Math.max(js,Math.min(Ri,t))}function Fi(){const t=N.c(11),[e,n]=us(Ei,Gi),r=z.useRef(null);let o;t[0]!==n||t[1]!==e?(o=u=>{u.preventDefault();const m=u.clientX,f=bt(e),h=r.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),p=h?Array.from(h.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const b of p)b.style.transition="none";const x=b=>{const j=bt(f+(b.clientX-m));h?.style.setProperty("--sidebar-width",`${j}px`)},g=b=>{const j=bt(f+(b.clientX-m));n(j);for(const y of p)y.style.transition="";window.removeEventListener("pointermove",x),window.removeEventListener("pointerup",g),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",x),window.addEventListener("pointerup",g)},t[0]=n,t[1]=e,t[2]=o):o=t[2];const i=o;let l;t[3]!==n?(l=()=>{n(js)},t[3]=n,t[4]=l):l=t[4];const a=l;let c;t[5]!==e?(c=bt(e),t[5]=e,t[6]=c):c=t[6];let d;return t[7]!==i||t[8]!==a||t[9]!==c?(d={width:c,wrapperRef:r,onStartResize:i,resetWidth:a},t[7]=i,t[8]=a,t[9]=c,t[10]=d):d=t[10],d}function Gi(t){return typeof t=="number"?bt(t):js}function Li(t){const e=N.c(21),{value:n,onChange:r,placeholder:o,onKeyDown:i,className:l,isSearching:a,disabled:c}=t,d=o===void 0?"Search...":o;let u;e[0]!==l?(u=Q("shrink-0 w-full border-b border-border h-12",l),e[0]=l,e[1]=u):u=e[1];const m=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==m?(f=Q("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=f):f=e[3];let h;e[4]!==a?(h=a?s.jsx(Ks,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(rn,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=a,e[5]=h):h=e[5];let p;e[6]!==r?(p=j=>r(j.target.value),e[6]=r,e[7]=p):p=e[7];let x;e[8]!==c||e[9]!==i||e[10]!==d||e[11]!==p||e[12]!==n?(x=s.jsx("input",{type:"text",value:n,onChange:p,onKeyDown:i,placeholder:d,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]=i,e[10]=d,e[11]=p,e[12]=n,e[13]=x):x=e[13];let g;e[14]!==f||e[15]!==h||e[16]!==x?(g=s.jsxs("label",{className:f,children:[h,x]}),e[14]=f,e[15]=h,e[16]=x,e[17]=g):g=e[17];let b;return e[18]!==u||e[19]!==g?(b=s.jsx("div",{className:u,children:g}),e[18]=u,e[19]=g,e[20]=b):b=e[20],b}const Hi="Select an existing agent";function Bi(t){const e=N.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(Pe,{asChild:!0,children:n}),e[0]=n,e[1]=r):r=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(De,{side:"right",sideOffset:8,children:Hi}),e[2]=o):o=e[2];let i;return e[3]!==r?(i=s.jsxs(Me,{defaultOpen:!0,delayDuration:0,children:[r,o]}),e[3]=r,e[4]=i):i=e[4],i}function Ui(){const t=N.c(5),{enableDecoImport:e}=Vs(),{data:n}=we.useSession();let r;t[0]!==n?.user?.email?(r=ms.decoProfile(n?.user?.email),t[0]=n?.user?.email,t[1]=r):r=t[1];const o=!!e&&!!n?.user?.email;let i;t[2]!==r||t[3]!==o?(i={queryKey:r,queryFn:qi,enabled:o,staleTime:3e5},t[2]=r,t[3]=o,t[4]=i):i=t[4];const{data:l}=fs(i);return l?.isDecoUser??!1}async function qi(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function Wi(t){const e=Ee(),{create:n}=an(),{locator:r}=ue(),o=Ys({strict:!1}),i=er({strict:!1});return async l=>{const a=crypto.randomUUID(),c=l===i.virtualmcpid?no(t,r,o.taskId??""):null;try{await n({id:a,virtual_mcp_id:l,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:l}})}}function Ki(t){const e=N.c(9),{agent:n,onClick:r}=t;let o;e[0]!==n.icon||e[1]!==n.title?(o=s.jsx(Re,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=n.icon,e[1]=n.title,e[2]=o):o=e[2];let i;e[3]!==n.title?(i=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:n.title}),e[3]=n.title,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==o||e[7]!==i?(l=s.jsxs("button",{type:"button",onClick:r,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[o,i]}),e[5]=r,e[6]=o,e[7]=i,e[8]=l):l=e[8],l}function Vi(t){const e=N.c(65),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:o}=t,[i,l]=z.useState(""),a=on(),c=a??[],{org:d}=ue(),{data:u}=we.useSession(),m=u?.user?.id??"anon",f=un(a),h=ao();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={navigateOnCreate:!0},e[0]=p):p=e[0];const{createVirtualMCP:x,isCreating:g}=Br(p),{createFromTemplate:b,isCreating:j}=qr(),y=Ui(),v=Wi(d.slug),_=ko(a),k=i.toLowerCase(),S=c.filter(Yi).filter(oe=>!_.has(oe.id)).filter(oe=>!i||oe.title.toLowerCase().includes(k)),I=oe=>{co({orgId:d.id,userId:m},oe.id,f),h(),n(),l(""),v(oe.id)},T="flex flex-col max-h-[min(640px,80dvh)]";let $;e[1]!==i?($=s.jsx(Li,{value:i,onChange:l,placeholder:"Search agents..."}),e[1]=i,e[2]=$):$=e[2];const O="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let A;e[3]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx("div",{className:"px-1 pt-3 pb-2",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Agents"})}),e[3]=A):A=e[3];const C="grid grid-cols-3 gap-1";let M;e[4]!==x||e[5]!==n?(M=async()=>{ee("agent_create_new_clicked",{source:"browse_popover"}),await x(),n()},e[4]=x,e[5]=n,e[6]=M):M=e[6];let K,U;e[7]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-dashed border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Ce,{size:16,className:"text-muted-foreground"})}),U=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[7]=K,e[8]=U):(K=e[7],U=e[8]);let E;e[9]!==g||e[10]!==M?(E=s.jsxs("button",{type:"button",disabled:g,onClick:M,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[K,U]}),e[9]=g,e[10]=M,e[11]=E):E=e[11];let L;e[12]!==b||e[13]!==n?(L=async()=>{ee("agent_create_clicked",{source:"browse_popover",method:"website"}),await b(Wr),n()},e[12]=b,e[13]=n,e[14]=L):L=e[14];let R,H;e[15]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(Fr,{className:"size-5 text-muted-foreground"})}),H=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[15]=R,e[16]=H):(R=e[15],H=e[16]);let P;e[17]!==j||e[18]!==L?(P=s.jsxs("button",{type:"button",disabled:j,onClick:L,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[R,H]}),e[17]=j,e[18]=L,e[19]=P):P=e[19];let G;e[20]!==b||e[21]!==n?(G=async()=>{ee("agent_create_clicked",{source:"browse_popover",method:"hydrogen"}),await b(Kr),n()},e[20]=b,e[21]=n,e[22]=G):G=e[22];let D,B;e[23]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:Vr,alt:"",className:"size-5 object-contain"})}),B=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Shopify Headless Store"}),e[23]=D,e[24]=B):(D=e[23],B=e[24]);let F;e[25]!==j||e[26]!==G?(F=s.jsxs("button",{type:"button",disabled:j,onClick:G,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group disabled:opacity-50 disabled:cursor-not-allowed",children:[D,B]}),e[25]=j,e[26]=G,e[27]=F):F=e[27];let Y;e[28]!==n||e[29]!==o?(Y=()=>{ee("agent_import_clicked",{source:"github"}),o(),n()},e[28]=n,e[29]=o,e[30]=Y):Y=e[30];let Z,V;e[31]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(eo,{className:"size-5 text-muted-foreground"})}),V=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[31]=Z,e[32]=V):(Z=e[31],V=e[32]);let J;e[33]!==Y?(J=s.jsxs("button",{type:"button",onClick:Y,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[Z,V]}),e[33]=Y,e[34]=J):J=e[34];let X;e[35]!==y||e[36]!==n||e[37]!==r?(X=y&&s.jsxs("button",{type:"button",onClick:()=>{ee("agent_import_clicked",{source:"deco"}),r(),n()},className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"",className:"size-5 object-contain"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import deco.cx"})]}),e[35]=y,e[36]=n,e[37]=r,e[38]=X):X=e[38];const W=S.map(oe=>s.jsx(Ki,{agent:oe,onClick:()=>I(oe)},oe.id));let ne;e[39]!==E||e[40]!==P||e[41]!==F||e[42]!==J||e[43]!==X||e[44]!==W?(ne=s.jsxs("div",{className:C,children:[E,P,F,J,X,W]}),e[39]=E,e[40]=P,e[41]=F,e[42]=J,e[43]=X,e[44]=W,e[45]=ne):ne=e[45];let ie;e[46]!==g||e[47]!==i||e[48]!==S.length?(ie=S.length===0&&!g&&s.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:i?"No agents found":"No agents yet"}),e[46]=g,e[47]=i,e[48]=S.length,e[49]=ie):ie=e[49];let ce;e[50]!==ne||e[51]!==ie||e[52]!==A?(ce=s.jsxs("div",{className:O,children:[A,ne,ie]}),e[50]=ne,e[51]=ie,e[52]=A,e[53]=ce):ce=e[53];let se;e[54]!==d.slug?(se={org:d.slug},e[54]=d.slug,e[55]=se):se=e[55];let re;e[56]!==n?(re=()=>n(),e[56]=n,e[57]=re):re=e[57];let le;e[58]!==se||e[59]!==re?(le=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(tr,{to:"/$org/settings/agents",params:se,onClick:re,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[58]=se,e[59]=re,e[60]=le):le=e[60];let me;return e[61]!==ce||e[62]!==$||e[63]!==le?(me=s.jsxs("div",{className:T,children:[$,ce,le]}),e[61]=ce,e[62]=$,e[63]=le,e[64]=me):me=e[64],me}function Yi(t){return!Gr(t.id)}function Nn(t){const e=N.c(26);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:r}=n,o=r===void 0?!1:r,[i,l]=z.useState(!1),[a,c]=z.useState(!1),[d,u]=z.useState(!1),m=ps(),{setOpenMobile:f}=Qe(),h=lo(),p=h?"border border-border":void 0;let x;e[2]!==h?(x=T=>h?s.jsx(Bi,{children:T}):T,e[2]=h,e[3]=x):x=e[3];const g=x;let b;e[4]!==m||e[5]!==f?(b=()=>{l(!1),m&&f(!1)},e[4]=m,e[5]=f,e[6]=b):b=e[6];const j=b;let y;e[7]!==j||e[8]!==i?(y=i&&s.jsx(z.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Ne,{className:"h-4 w-24"})}),children:s.jsx(Vi,{onClose:j,onOpenImportDeco:()=>c(!0),onOpenGithubImport:()=>{u(!0),j()}})}),e[7]=j,e[8]=i,e[9]=y):y=e[9];const v=y;let _;e[10]!==o||e[11]!==p||e[12]!==h||e[13]!==m||e[14]!==i||e[15]!==v||e[16]!==g?(_=m?s.jsxs(s.Fragment,{children:[o?g(s.jsx(ge,{"aria-label":"Browse agents",className:Q(p),onClick:()=>{ee("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:s.jsx(Ce,{className:"size-4"})})):s.jsx(he,{children:g(s.jsxs(ke,{tooltip:h?void 0:"Browse agents",className:Q(p),onClick:()=>{ee("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:[s.jsx(Ce,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(tn,{open:i,onOpenChange:l,direction:"bottom",children:s.jsxs(sn,{className:"max-h-[85dvh] p-0",children:[s.jsx(nn,{className:"sr-only",children:"Browse agents"}),v]})})]}):s.jsxs(Bt,{open:i,onOpenChange:T=>{T&&!i&&ee("agent_browser_opened",{surface:"desktop_popover"}),l(T)},children:[o?g(s.jsx(xt,{asChild:!0,children:s.jsx(ge,{"aria-label":"Browse agents",className:Q(p),children:s.jsx(Ce,{className:"size-4"})})})):s.jsx(he,{children:g(s.jsx(xt,{asChild:!0,children:s.jsxs(ke,{tooltip:h?void 0:"Browse agents",className:Q(p),children:[s.jsx(Ce,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Ut,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:v})]}),e[10]=o,e[11]=p,e[12]=h,e[13]=m,e[14]=i,e[15]=v,e[16]=g,e[17]=_):_=e[17];let k;e[18]!==a?(k=s.jsx(Ur,{open:a,onOpenChange:c}),e[18]=a,e[19]=k):k=e[19];let S;e[20]!==d?(S=s.jsx(Zr,{open:d,onOpenChange:u}),e[20]=d,e[21]=S):S=e[21];let I;return e[22]!==_||e[23]!==k||e[24]!==S?(I=s.jsxs(s.Fragment,{children:[_,k,S]}),e[22]=_,e[23]=k,e[24]=S,e[25]=I):I=e[25],I}function Cn(){const t=N.c(24),{org:e}=ue(),n=Ee(),o=Pr().location.pathname,i=e.slug,{state:l,isMobile:a}=Qe(),c=!a&&l==="collapsed";let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Mr,{className:"size-4!"}),t[0]=d):d=t[0];const u=o===`/${i}`||o===`/${i}/`;let m;t[1]!==n||t[2]!==i?(m=()=>{n({to:"/$org",params:{org:i}})},t[1]=n,t[2]=i,t[3]=m):m=t[3];let f;t[4]!==u||t[5]!==m?(f={key:"home",label:"Home",icon:d,isActive:u,onClick:m},t[4]=u,t[5]=m,t[6]=f):f=t[6];const h=f;let p;t[7]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Rr,{className:"size-4!"}),t[7]=p):p=t[7];let x;t[8]!==o||t[9]!==i?(x=o.startsWith(`/${i}/files`),t[8]=o,t[9]=i,t[10]=x):x=t[10];let g;t[11]!==n||t[12]!==i?(g=()=>{n({to:"/$org/files",params:{org:i}})},t[11]=n,t[12]=i,t[13]=g):g=t[13];let b;t[14]!==x||t[15]!==g?(b={key:"files",label:"Library",icon:p,isActive:x,onClick:g},t[14]=x,t[15]=g,t[16]=b):b=t[16];const j=b;let y;t[17]!==j||t[18]!==h?(y={type:"items",items:[h,j]},t[17]=j,t[18]=h,t[19]=y):y=t[19];let v;if(t[20]!==c||t[21]!==y){if(v=[y],c){let _;t[23]===Symbol.for("react.memo_cache_sentinel")?(_={type:"custom",key:"new-task",content:s.jsx(Lt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ht,{children:s.jsx(Oe,{className:"gap-1.5",children:s.jsx(Nn,{})})})})},t[23]=_):_=t[23],v.push(_)}t[20]=c,t[21]=y,t[22]=v}else v=t[22];return v}function Rt(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,orientation:o,decorative:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const l=o===void 0?"horizontal":o,a=i===void 0?!0:i;let c;e[5]!==n?(c=Q("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==a||e[8]!==l||e[9]!==r||e[10]!==c?(d=s.jsx(sr,{"data-slot":"separator-root",decorative:a,orientation:l,className:c,...r}),e[7]=a,e[8]=l,e[9]=r,e[10]=c,e[11]=d):d=e[11],d}function wn(t){const e=N.c(3),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex h-6 items-center",children:s.jsx("div",{className:"h-0.5 w-16 rounded-full bg-sidebar-foreground/15"})}),e[0]=r):r=e[0];let o;return e[1]!==n?(o=s.jsxs(Lt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(Ht,{children:s.jsx(Oe,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function kn(t){const e=N.c(18),{item:n}=t,{isMobile:r,setOpenMobile:o}=Qe();let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=()=>{ee("nav_item_clicked",{nav_key:n.key,nav_label:n.label,is_active:!!n.isActive,is_mobile:r}),n.onClick?.(),r&&o(!1)},e[0]=r,e[1]=n,e[2]=o,e[3]=i):i=e[3];const l=i,a=n.key,c=n.isActive&&"z-10";let d;e[4]!==c?(d=Q(c),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==n.label?(u=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=u):u=e[7];let m;e[8]!==l||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==u?(m=s.jsxs(ke,{onClick:l,isActive:n.isActive,tooltip:n.label,children:[n.icon,u]}),e[8]=l,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=u,e[13]=m):m=e[13];let f;return e[14]!==n.key||e[15]!==d||e[16]!==m?(f=s.jsx(he,{className:d,children:m},a),e[14]=n.key,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function Xi(t){const e=N.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Zs,{className:"my-2"}),e[0]=r):r=e[0],r}case"spacer":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex-1"}),e[1]=r):r=e[1],r}case"group":{const r=n.group.label,o=n.group.defaultExpanded;let i;e[2]!==n.group.items?(i=n.group.items.map(Ji),e[2]=n.group.items,e[3]=i):i=e[3];let l;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(l=s.jsx(wn,{label:r,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=l):l=e[7],l}case"items":{let r;e[8]!==n.items?(r=n.items.map(Qi),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(Lt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ht,{children:s.jsx(Oe,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}case"custom":return n.content}}function Qi(t){return s.jsx(kn,{item:t},t.key)}function Ji(t){return s.jsx(kn,{item:t},t.key)}function Zi(t){const e=N.c(14),{sections:n,footer:r,additionalContent:o,variant:i,contentClassName:l}=t,a=i===void 0?"sidebar":i;let c;e[0]!==l?(c=Q("flex flex-col flex-1 px-2 py-2 gap-0.5",l),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==n?(d=n.map(el),e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o?(u=o&&s.jsx("div",{className:"flex flex-col flex-1 min-h-0 group-data-[state=collapsed]/sidebar:mt-1 group-data-[state=expanded]/sidebar:mt-2",children:o}),e[4]=o,e[5]=u):u=e[5];let m;e[6]!==c||e[7]!==d||e[8]!==u?(m=s.jsxs(en,{className:c,children:[d,u]}),e[6]=c,e[7]=d,e[8]=u,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m||e[12]!==a?(f=s.jsxs(Tr,{variant:a,children:[m,r]}),e[10]=r,e[11]=m,e[12]=a,e[13]=f):f=e[13],f}function el(t,e){return s.jsx(Xi,{section:t},e)}function In(t){const e=N.c(2);let n;return e[0]!==t?(n=s.jsx(Zi,{...t}),e[0]=t,e[1]=n):n=e[1],n}In.Skeleton=function(){return s.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>s.jsx("div",{className:"w-full h-8",children:s.jsx(Ne,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function ls(){const t=N.c(22),e=Lo(),[n,r]=z.useState(!1);let o;if(t[0]!==e.capabilities||t[1]!==e.hostname||t[2]!==e.machineId||t[3]!==e.online){const x=Ho(e.capabilities);o=e.online?s.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[s.jsx("span",{className:"font-medium",children:e.hostname??e.machineId??"Desktop linked"}),s.jsx("span",{className:"text-muted-foreground",children:x.length>0?`Available: ${x.join(", ")}`:"No CLI agents detected"})]}):s.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),t[0]=e.capabilities,t[1]=e.hostname,t[2]=e.machineId,t[3]=e.online,t[4]=o}else o=t[4];const i=o;let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=()=>r(!0),t[5]=l):l=t[5];const a=e.online?"Desktop linked":"Connect your desktop";let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(xn,{size:16}),t[6]=c):c=t[6];let d;t[7]!==e.online?(d=e.online&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),t[7]=e.online,t[8]=d):d=t[8];let u;t[9]!==a||t[10]!==d?(u=s.jsx(Pe,{asChild:!0,children:s.jsxs(ge,{onClick:l,"aria-label":a,children:[c,d]})}),t[9]=a,t[10]=d,t[11]=u):u=t[11];let m;t[12]!==i?(m=s.jsx(De,{side:"bottom",children:i}),t[12]=i,t[13]=m):m=t[13];let f;t[14]!==u||t[15]!==m?(f=s.jsxs(Me,{children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16];let h;t[17]!==n?(h=s.jsx(Bo,{open:n,onOpenChange:r}),t[17]=n,t[18]=h):h=t[18];let p;return t[19]!==f||t[20]!==h?(p=s.jsxs(s.Fragment,{children:[f,h]}),t[19]=f,t[20]=h,t[21]=p):p=t[21],p}function tl(t){const e=N.c(17),{onToggle:n,className:r}=t,i=Vs().logo??nr,l=typeof i=="string"?i:i.light,a=typeof i=="string"?i:i.dark;let c;e[0]!==r?(c=Q("flex flex-row items-center gap-2 md:gap-0.5 shrink-0 h-12 pl-1 pr-2 pt-0.25 pb-0","group-data-[collapsible=icon]/sidebar:hidden",r),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==l?(d=s.jsx("img",{src:l,alt:"Logo",className:"size-6 object-contain dark:hidden"}),e[2]=l,e[3]=d):d=e[3];let u;e[4]!==a?(u=s.jsx("img",{src:a,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),e[4]=a,e[5]=u):u=e[5];let m;e[6]!==d||e[7]!==u?(m=s.jsx("span",{className:"flex items-center shrink-0 pl-1",children:s.jsxs("span",{className:"flex items-center shrink-0 px-2",children:[d,u]})}),e[6]=d,e[7]=u,e[8]=m):m=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(Go,{size:16}),e[9]=f):f=e[9];let h;e[10]!==n?(h=s.jsx(ge,{onClick:n,"aria-label":"Toggle sidebar",children:f}),e[10]=n,e[11]=h):h=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ls,{}),e[12]=p):p=e[12];let x;return e[13]!==c||e[14]!==m||e[15]!==h?(x=s.jsxs($r,{className:c,children:[m,h,p]}),e[13]=c,e[14]=m,e[15]=h,e[16]=x):x=e[16],x}function Ms(t){const e=N.c(18),{item:n,onClose:r}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=Q(o),e[0]=o,e[1]=i):i=e[1];let l;e[2]!==n||e[3]!==r?(l=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=l):l=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let c;e[7]!==n.label?(c=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=c):c=e[8];let d;e[9]!==n.isActive||e[10]!==n.label||e[11]!==l||e[12]!==a||e[13]!==c?(d=s.jsxs(ke,{onClick:l,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=l,e[12]=a,e[13]=c,e[14]=d):d=e[14];let u;return e[15]!==i||e[16]!==d?(u=s.jsx(he,{className:i,children:d}),e[15]=i,e[16]=d,e[17]=u):u=e[17],u}function sl(t){const e=N.c(18),{section:n,onClose:r}=t;switch(n.type){case"divider":{let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Zs,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let l;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=d=>s.jsx(Ms,{item:d,onClose:r},d.key),e[5]=r,e[6]=c):c=e[6],l=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=l}else l=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==l?(a=s.jsx(wn,{label:o,defaultExpanded:i,children:l}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let o;if(e[11]!==r||e[12]!==n.items){let l;e[14]!==r?(l=a=>s.jsx(Ms,{item:a,onClose:r},a.key),e[14]=r,e[15]=l):l=e[15],o=n.items.map(l),e[11]=r,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(Lt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Ht,{children:s.jsx(Oe,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function nl(t){const e=N.c(17),{sections:n,onClose:r,footer:o,additionalContent:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"h-12 shrink-0"}),e[0]=l):l=e[0];let a;e[1]!==r?(a=s.jsx(z.Suspense,{fallback:l,children:s.jsx(tl,{onToggle:r})}),e[1]=r,e[2]=a):a=e[2];let c;if(e[3]!==r||e[4]!==n){let f;e[6]!==r?(f=(h,p)=>s.jsx(sl,{section:h,onClose:r},p),e[6]=r,e[7]=f):f=e[7],c=n.map(f),e[3]=r,e[4]=n,e[5]=c}else c=e[5];let d;e[8]!==i?(d=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[8]=i,e[9]=d):d=e[9];let u;e[10]!==c||e[11]!==d?(u=s.jsxs(en,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[c,d]}),e[10]=c,e[11]=d,e[12]=u):u=e[12];let m;return e[13]!==o||e[14]!==a||e[15]!==u?(m=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,u,o]}),e[13]=o,e[14]=a,e[15]=u,e[16]=m):m=e[16],m}function Tn(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const rl=rr({name:or().min(2,"Organization name is required")});function ol(t){const e=N.c(41),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={resolver:ir(rl),defaultValues:{name:""}},e[0]=o):o=e[0];const i=lr(o);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:ll,onSuccess:il},e[1]=l):l=e[1];const a=ar(l),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(ti,{children:[s.jsx(si,{children:"Create a new organization"}),s.jsx(ni,{children:"Set up a new organization to collaborate with others."})]}),e[2]=d):d=e[2];let u;if(e[3]!==a||e[4]!==i){let S;e[6]!==a?(S=I=>a.mutateAsync(I),e[6]=a,e[7]=S):S=e[7],u=i.handleSubmit(S),e[3]=a,e[4]=i,e[5]=u}else u=e[5];let m;e[8]!==i.formState.isSubmitting?(m=S=>{const{field:I}=S;return s.jsxs(ai,{children:[s.jsx(ci,{children:"Organization Name"}),s.jsx(di,{children:s.jsx(fi,{...I,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(ui,{children:"The name of your company or organization"}),I.value&&s.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",s.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",Tn(I.value)]})]}),s.jsx(mi,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==i.control||e[11]!==m?(f=s.jsx(ii,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=f):f=e[12];let h;e[13]!==c?(h=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=h):h=e[14];let p;e[15]!==a||e[16]!==i?(p=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=p):p=e[17];let x;e[18]!==i.formState.isSubmitting||e[19]!==p?(x=s.jsx(Zo,{disabled:i.formState.isSubmitting,onClick:p,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=p,e[20]=x):x=e[20];const g=!i.formState.isValid||i.formState.isSubmitting;let b;e[21]!==i.formState.isSubmitting?(b=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(pi,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==g||e[24]!==b?(j=s.jsx(pt,{type:"submit",variant:"default",disabled:g,children:b}),e[23]=g,e[24]=b,e[25]=j):j=e[25];let y;e[26]!==j||e[27]!==x?(y=s.jsxs(ri,{children:[x,j]}),e[26]=j,e[27]=x,e[28]=y):y=e[28];let v;e[29]!==y||e[30]!==u||e[31]!==f||e[32]!==h?(v=s.jsxs("form",{className:"space-y-6",onSubmit:u,autoComplete:"off",children:[f,h,y]}),e[29]=y,e[30]=u,e[31]=f,e[32]=h,e[33]=v):v=e[33];let _;e[34]!==i||e[35]!==v?(_=s.jsxs(ei,{children:[d,s.jsx(li,{...i,children:v})]}),e[34]=i,e[35]=v,e[36]=_):_=e[36];let k;return e[37]!==r||e[38]!==n||e[39]!==_?(k=s.jsx(oi,{open:n,onOpenChange:r,children:_}),e[37]=r,e[38]=n,e[39]=_,e[40]=k):k=e[40],k}function il(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function ll(t){const e=Tn(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await we.organization.create({name:t.name,slug:e});if(n?.error)throw new Error(n.error.message||"Failed to create organization");const r=n?.data?.slug??e;if(!r)throw new Error("Failed to create organization");return{orgSlug:r}}function as(t){let e=0;for(let r=0;r<t.length;r++)e=t.charCodeAt(r)+((e<<5)-e);const n=Math.abs(e)%360;return{backgroundColor:`hsl(${n} 55% 70%)`,color:`hsl(${n} 55% 20%)`}}function al(t){const e=N.c(13),{org:n,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",l=o==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=Q(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:as(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let d;e[5]!==n.logo||e[6]!==n.name||e[7]!==l?(d=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:Q("font-semibold leading-none",l),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=l,e[8]=d):d=e[8];let u;return e[9]!==a||e[10]!==c||e[11]!==d?(u=s.jsx("div",{className:a,style:c,children:d}),e[9]=a,e[10]=c,e[11]=d,e[12]=u):u=e[12],u}function Pt(t){const e=N.c(22),{item:n,onClose:r}=t;if(n.href){const c=n.external?"_blank":void 0,d=n.external?"noopener noreferrer":void 0;let u;e[0]!==n.icon?(u=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=u):u=e[1];let m;e[2]!==n.label?(m=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=m):m=e[3];let f;return e[4]!==n.href||e[5]!==r||e[6]!==c||e[7]!==d||e[8]!==u||e[9]!==m?(f=s.jsxs("a",{href:n.href,target:c,rel:d,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",onClick:r,children:[u,m]}),e[4]=n.href,e[5]=r,e[6]=c,e[7]=d,e[8]=u,e[9]=m,e[10]=f):f=e[10],f}let o;e[11]!==n||e[12]!==r?(o=()=>{n.onClick?.(),r()},e[11]=n,e[12]=r,e[13]=o):o=e[13];let i;e[14]!==n.icon?(i=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=i):i=e[15];let l;e[16]!==n.label?(l=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=l):l=e[17];let a;return e[18]!==o||e[19]!==i||e[20]!==l?(a=s.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[i,l]}),e[18]=o,e[19]=i,e[20]=l,e[21]=a):a=e[21],a}function Rs(t){const e=N.c(31),{orgParam:n,onSelectOrg:r,onCreateOrg:o}=t,{data:i}=fr();let l;e[0]!==n?(l=(C,M)=>C.slug===n?-1:M.slug===n?1:C.name.localeCompare(M.name),e[0]=n,e[1]=l):l=e[1];const a=[...i??[]].sort(l),[c,d]=z.useState(!1),[u,m]=z.useState(""),f=u.toLowerCase(),h=f?a.filter(C=>C.name.toLowerCase().includes(f)||C.slug.toLowerCase().includes(f)):a;let p;e[2]!==c?(p=function(){c&&m(""),d(cl)},e[2]=c,e[3]=p):p=e[3];const x=p;let g;e[4]!==u||e[5]!==c||e[6]!==x?(g=c?s.jsx("input",{autoFocus:!0,type:"text",value:u,onChange:C=>m(C.target.value),onKeyDown:C=>C.key==="Escape"&&x(),placeholder:"Search organizations...",className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}):s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[4]=u,e[5]=c,e[6]=x,e[7]=g):g=e[7];let b;e[8]!==c?(b=c?s.jsx(hs,{size:16}):s.jsx(rn,{size:16}),e[8]=c,e[9]=b):b=e[9];let j;e[10]!==b||e[11]!==x?(j=s.jsx("button",{type:"button",onClick:x,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:b}),e[10]=b,e[11]=x,e[12]=j):j=e[12];let y;e[13]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ce,{size:16}),e[13]=y):y=e[13];let v;e[14]!==o?(v=s.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:y}),e[14]=o,e[15]=v):v=e[15];let _;e[16]!==j||e[17]!==v?(_=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[j,v]}),e[16]=j,e[17]=v,e[18]=_):_=e[18];let k;e[19]!==g||e[20]!==_?(k=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[g,_]}),e[19]=g,e[20]=_,e[21]=k):k=e[21];const S="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",I=h.length===0&&s.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:u?`No organizations match "${u}"`:"No organizations available"});let T;e[22]!==r||e[23]!==n?(T=C=>s.jsxs("button",{type:"button",onClick:()=>r(C.slug),className:Q("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",C.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(al,{org:C,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:C.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:C.slug})]}),C.slug===n&&s.jsx(xs,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},C.id),e[22]=r,e[23]=n,e[24]=T):T=e[24];const $=h.map(T);let O;e[25]!==I||e[26]!==$?(O=s.jsxs("div",{className:S,children:[I,$]}),e[25]=I,e[26]=$,e[27]=O):O=e[27];let A;return e[28]!==O||e[29]!==k?(A=s.jsxs(s.Fragment,{children:[k,O]}),e[28]=O,e[29]=k,e[30]=A):A=e[30],A}function cl(t){return!t}function Es(t){const e=N.c(142),{user:n,userImage:r,menuItems:o,signOutItem:i,themeOptions:l,preferences:a,setPreferences:c,orgParam:d,onSelectOrg:u,onCreateOrg:m,close:f,isMobile:h,open:p}=t;if(h){const X=n?.name??"U";let W;e[0]!==X||e[1]!==r?(W=s.jsx(is,{url:r,fallback:X,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=X,e[1]=r,e[2]=W):W=e[2];const ne=n?.name??"User";let ie;e[3]!==ne?(ie=s.jsx("p",{className:"text-sm font-medium truncate",children:ne}),e[3]=ne,e[4]=ie):ie=e[4];const ce=n?.email;let se;e[5]!==ce?(se=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ce}),e[5]=ce,e[6]=se):se=e[6];let re;e[7]!==ie||e[8]!==se?(re=s.jsxs("div",{className:"flex-1 min-w-0",children:[ie,se]}),e[7]=ie,e[8]=se,e[9]=re):re=e[9];let le;e[10]!==n?(le=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(fl)},e[10]=n,e[11]=le):le=e[11];let me;e[12]===Symbol.for("react.memo_cache_sentinel")?(me=s.jsx($s,{size:14}),e[12]=me):me=e[12];let oe;e[13]!==le?(oe=s.jsx(Pe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:le,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:me})}),e[13]=le,e[14]=oe):oe=e[14];let Ie;e[15]===Symbol.for("react.memo_cache_sentinel")?(Ie=s.jsx(De,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=Ie):Ie=e[15];let Fe;e[16]!==oe?(Fe=s.jsx(Cs,{delayDuration:300,children:s.jsxs(Me,{children:[oe,Ie]})}),e[16]=oe,e[17]=Fe):Fe=e[17];let fe;e[18]!==Fe||e[19]!==W||e[20]!==re?(fe=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[W,re,Fe]}),e[18]=Fe,e[19]=W,e[20]=re,e[21]=fe):fe=e[21];const Ge=String(p);let pe;e[22]!==m||e[23]!==u||e[24]!==d||e[25]!==Ge?(pe=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(Rs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},Ge)}),e[22]=m,e[23]=u,e[24]=d,e[25]=Ge,e[26]=pe):pe=e[26];let be;if(e[27]!==f||e[28]!==o){let ye;e[30]!==f?(ye=Ve=>s.jsx(Pt,{item:Ve,onClose:f},Ve.key),e[30]=f,e[31]=ye):ye=e[31],be=o.map(ye),e[27]=f,e[28]=o,e[29]=be}else be=e[29];let xe;e[32]!==f||e[33]!==i?(xe=s.jsx(Pt,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=xe):xe=e[34];let Te;e[35]!==be||e[36]!==xe?(Te=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[be,xe]}),e[35]=be,e[36]=xe,e[37]=Te):Te=e[37];let je;e[38]!==pe||e[39]!==Te?(je=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[pe,Te]}),e[38]=pe,e[39]=Te,e[40]=je):je=e[40];let Le;if(e[41]!==a.theme||e[42]!==c||e[43]!==l){let ye;e[45]!==a.theme||e[46]!==c?(ye=Ve=>{const{value:_e,icon:Ye,label:Je}=Ve;return s.jsx("button",{type:"button","aria-label":Je,onClick:()=>c(Xe=>({...Xe,theme:_e})),className:Q("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===_e?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Ye},_e)},e[45]=a.theme,e[46]=c,e[47]=ye):ye=e[47],Le=l.map(ye),e[41]=a.theme,e[42]=c,e[43]=l,e[44]=Le}else Le=e[44];let Se;e[48]!==Le?(Se=s.jsx("div",{className:"flex items-center gap-0.5",children:Le}),e[48]=Le,e[49]=Se):Se=e[49];const He=a.enableSounds?"Disable sounds":"Enable sounds";let Be;e[50]!==c?(Be=()=>c(ml),e[50]=c,e[51]=Be):Be=e[51];const ht=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let Ue;e[52]!==ht?(Ue=Q("size-8 rounded-md flex items-center justify-center transition-colors",ht),e[52]=ht,e[53]=Ue):Ue=e[53];let qe;e[54]!==a.enableSounds?(qe=a.enableSounds?s.jsx(ws,{size:14}):s.jsx(ks,{size:14}),e[54]=a.enableSounds,e[55]=qe):qe=e[55];let $e;e[56]!==He||e[57]!==Be||e[58]!==Ue||e[59]!==qe?($e=s.jsx("button",{type:"button","aria-label":He,onClick:Be,className:Ue,children:qe}),e[56]=He,e[57]=Be,e[58]=Ue,e[59]=qe,e[60]=$e):$e=e[60];let ve;e[61]===Symbol.for("react.memo_cache_sentinel")?(ve=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.99.3"]}),e[61]=ve):ve=e[61];let We;e[62]!==$e?(We=s.jsxs("div",{className:"flex items-center gap-2",children:[$e,ve]}),e[62]=$e,e[63]=We):We=e[63];let Ke;e[64]!==Se||e[65]!==We?(Ke=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Se,We]}),e[64]=Se,e[65]=We,e[66]=Ke):Ke=e[66];let gt;return e[67]!==fe||e[68]!==je||e[69]!==Ke?(gt=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[fe,je,Ke]}),e[67]=fe,e[68]=je,e[69]=Ke,e[70]=gt):gt=e[70],gt}const x=n?.name??"U";let g;e[71]!==x||e[72]!==r?(g=s.jsx(is,{url:r,fallback:x,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=x,e[72]=r,e[73]=g):g=e[73];const b=n?.name??"User";let j;e[74]!==b?(j=s.jsx("p",{className:"text-sm font-medium truncate",children:b}),e[74]=b,e[75]=j):j=e[75];const y=n?.email;let v;e[76]!==y?(v=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y}),e[76]=y,e[77]=v):v=e[77];let _;e[78]!==j||e[79]!==v?(_=s.jsxs("div",{className:"flex-1 min-w-0",children:[j,v]}),e[78]=j,e[79]=v,e[80]=_):_=e[80];let k;e[81]!==n?(k=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(ul)},e[81]=n,e[82]=k):k=e[82];let S;e[83]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx($s,{size:14}),e[83]=S):S=e[83];let I;e[84]!==k?(I=s.jsx(Pe,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:k,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:S})}),e[84]=k,e[85]=I):I=e[85];let T;e[86]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(De,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=T):T=e[86];let $;e[87]!==I?($=s.jsx(Cs,{delayDuration:300,children:s.jsxs(Me,{children:[I,T]})}),e[87]=I,e[88]=$):$=e[88];let O;e[89]!==$||e[90]!==g||e[91]!==_?(O=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[g,_,$]}),e[89]=$,e[90]=g,e[91]=_,e[92]=O):O=e[92];let A;if(e[93]!==f||e[94]!==o){let X;e[96]!==f?(X=W=>s.jsx(Pt,{item:W,onClose:f},W.key),e[96]=f,e[97]=X):X=e[97],A=o.map(X),e[93]=f,e[94]=o,e[95]=A}else A=e[95];let C;e[98]!==f||e[99]!==i?(C=s.jsx(Pt,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=C):C=e[100];let M;e[101]!==A||e[102]!==C?(M=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[A,C]}),e[101]=A,e[102]=C,e[103]=M):M=e[103];let K;if(e[104]!==a.theme||e[105]!==c||e[106]!==l){let X;e[108]!==a.theme||e[109]!==c?(X=W=>{const{value:ne,icon:ie,label:ce}=W;return s.jsx("button",{type:"button","aria-label":ce,onClick:()=>c(se=>({...se,theme:ne})),className:Q("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===ne?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:ie},ne)},e[108]=a.theme,e[109]=c,e[110]=X):X=e[110],K=l.map(X),e[104]=a.theme,e[105]=c,e[106]=l,e[107]=K}else K=e[107];let U;e[111]!==K?(U=s.jsx("div",{className:"flex items-center gap-0.5",children:K}),e[111]=K,e[112]=U):U=e[112];const E=a.enableSounds?"Disable sounds":"Enable sounds";let L;e[113]!==c?(L=()=>c(dl),e[113]=c,e[114]=L):L=e[114];const R=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let H;e[115]!==R?(H=Q("size-7 rounded-md flex items-center justify-center transition-colors",R),e[115]=R,e[116]=H):H=e[116];let P;e[117]!==a.enableSounds?(P=a.enableSounds?s.jsx(ws,{size:14}):s.jsx(ks,{size:14}),e[117]=a.enableSounds,e[118]=P):P=e[118];let G;e[119]!==E||e[120]!==L||e[121]!==H||e[122]!==P?(G=s.jsx("button",{type:"button","aria-label":E,onClick:L,className:H,children:P}),e[119]=E,e[120]=L,e[121]=H,e[122]=P,e[123]=G):G=e[123];let D;e[124]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.99.3"]}),e[124]=D):D=e[124];let B;e[125]!==G?(B=s.jsxs("div",{className:"flex items-center gap-2",children:[G,D]}),e[125]=G,e[126]=B):B=e[126];let F;e[127]!==U||e[128]!==B?(F=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[U,B]}),e[127]=U,e[128]=B,e[129]=F):F=e[129];let Y;e[130]!==O||e[131]!==M||e[132]!==F?(Y=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[O,M,F]}),e[130]=O,e[131]=M,e[132]=F,e[133]=Y):Y=e[133];const Z=String(p);let V;e[134]!==m||e[135]!==u||e[136]!==d||e[137]!==Z?(V=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(Rs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},Z)}),e[134]=m,e[135]=u,e[136]=d,e[137]=Z,e[138]=V):V=e[138];let J;return e[139]!==Y||e[140]!==V?(J=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[Y,V]}),e[139]=Y,e[140]=V,e[141]=J):J=e[141],J}function dl(t){return{...t,enableSounds:!t.enableSounds}}function ul(){Ae.success("User ID copied")}function ml(t){return{...t,enableSounds:!t.enableSounds}}function fl(){Ae.success("User ID copied")}function cs(){const t=N.c(44),{data:e}=we.useSession(),{org:n}=ue(),r=Ee();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const l=cr(o)?.params.org,[a,c]=dr(),d=ps(),[u,m]=z.useState(!1),[f,h]=z.useState(!1),p=e?.user,x=p?.image;let g;t[1]!==r?(g=Y=>{m(!1),r({to:"/$org",params:{org:Y}})},t[1]=r,t[2]=g):g=t[2];const b=g;let j;t[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>m(!1),t[3]=j):j=t[3];const y=j;let v;t[4]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(vt,{size:16}),t[4]=v):v=t[4];let _;t[5]!==r||t[6]!==l?(_={key:"preferences",label:"Preferences",icon:v,onClick:()=>{r({to:"/$org/settings/profile",params:{org:l??""}})}},t[5]=r,t[6]=l,t[7]=_):_=t[7];let k;t[8]!==n||t[9]!==r?(k=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(Uo,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[8]=n,t[9]=r,t[10]=k):k=t[10];let S;t[11]===Symbol.for("react.memo_cache_sentinel")?(S={key:"terms",label:"Terms of Use",icon:s.jsx(Er,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[11]=S):S=t[11];let I;t[12]===Symbol.for("react.memo_cache_sentinel")?(I={key:"privacy",label:"Privacy Policy",icon:s.jsx(Qo,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[12]=I):I=t[12];let T;t[13]===Symbol.for("react.memo_cache_sentinel")?(T={key:"github",label:"decocms/studio",icon:s.jsx(ur,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[13]=T):T=t[13];let $;t[14]===Symbol.for("react.memo_cache_sentinel")?($={key:"community",label:"Community",icon:s.jsx(Jo,{size:16}),href:"https://decocms.com/discord",external:!0},t[14]=$):$=t[14];let O;t[15]===Symbol.for("react.memo_cache_sentinel")?(O={key:"homepage",label:"Homepage",icon:s.jsx(qo,{size:16}),href:"https://decocms.com",external:!0},t[15]=O):O=t[15];let A;t[16]!==_||t[17]!==k?(A=[_,...k,S,I,T,$,O],t[16]=_,t[17]=k,t[18]=A):A=t[18];const C=A;let M;t[19]===Symbol.for("react.memo_cache_sentinel")?(M={key:"logout",label:"Sign out",icon:s.jsx(Wo,{size:16}),onClick:xl},t[19]=M):M=t[19];const K=M;let U;t[20]===Symbol.for("react.memo_cache_sentinel")?(U={value:"light",icon:s.jsx(Ko,{size:14}),label:"Light theme"},t[20]=U):U=t[20];let E;t[21]===Symbol.for("react.memo_cache_sentinel")?(E={value:"dark",icon:s.jsx(Vo,{size:14}),label:"Dark theme"},t[21]=E):E=t[21];let L;t[22]===Symbol.for("react.memo_cache_sentinel")?(L=[U,E,{value:"system",icon:s.jsx(xn,{size:14}),label:"System theme"}],t[22]=L):L=t[22];const R=L;let H;t[23]===Symbol.for("react.memo_cache_sentinel")?(H=()=>{m(!1),h(!0)},t[23]=H):H=t[23];let P;t[24]!==b||t[25]!==d||t[26]!==C||t[27]!==u||t[28]!==l||t[29]!==a||t[30]!==c||t[31]!==p||t[32]!==x?(P={user:p,userImage:x,menuItems:C,signOutItem:K,themeOptions:R,preferences:a,setPreferences:c,orgParam:l,onSelectOrg:b,onCreateOrg:H,close:y,isMobile:d,open:u},t[24]=b,t[25]=d,t[26]=C,t[27]=u,t[28]=l,t[29]=a,t[30]=c,t[31]=p,t[32]=x,t[33]=P):P=t[33];const G=P;let D;t[34]!==n||t[35]!==d||t[36]!==u||t[37]!==G?(D=d?s.jsxs(tn,{open:u,onOpenChange:m,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>m(!0),className:"flex items-center gap-3 w-full px-3 py-2.5 rounded-lg transition-colors text-sm text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground",children:[s.jsx("div",{className:"shrink-0 size-5 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:as(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]}),s.jsxs(sn,{className:"h-[80dvh] p-0",children:[s.jsx(nn,{className:"sr-only",children:"Account"}),s.jsx(Es,{...G})]})]}):s.jsxs(Bt,{open:u,onOpenChange:m,children:[s.jsx(xt,{asChild:!0,children:s.jsxs(ke,{tooltip:n?.name??"Account",className:"rounded-md",children:[s.jsx("div",{className:"shrink-0 size-6 rounded-md flex items-center justify-center border border-border/50 overflow-hidden",style:n?.logo?void 0:as(n?.name??""),children:n?.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(n?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:n?.name??"Account"})]})}),s.jsx(Ut,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:pl,children:s.jsx(Es,{...G})})]}),t[34]=n,t[35]=d,t[36]=u,t[37]=G,t[38]=D):D=t[38];let B;t[39]!==f?(B=s.jsx(ol,{open:f,onOpenChange:h}),t[39]=f,t[40]=B):B=t[40];let F;return t[41]!==D||t[42]!==B?(F=s.jsxs(s.Fragment,{children:[D,B]}),t[41]=D,t[42]=B,t[43]=F):F=t[43],F}function pl(t){return t.preventDefault()}function xl(){ee("signed_out",{source:"account_popover"}),mr(),we.signOut()}function hl({invitation:t}){const[e,n]=z.useState(!1),[r,o]=z.useState(!1),i=pr(),l=async()=>{n(!0);try{const d=await we.organization.acceptInvitation({invitationId:t.id});if(d.error){Ae.error(d.error.message),n(!1);return}}catch{Ae.error("Failed to accept invitation"),n(!1);return}Ae.success("Invitation accepted!"),xr();let c;try{c=(await we.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{o(!0);try{const c=await we.organization.rejectInvitation({invitationId:t.id});c.error?(Ae.error(c.error.message),o(!1)):(Ae.success("Invitation declined"),i.invalidateQueries())}catch{Ae.error("Failed to decline invitation"),o(!1)}};return s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"You've been invited to join"}),s.jsx("p",{className:"text-sm font-medium truncate",children:t.organizationName??"Unknown organization"})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsx(pt,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:l,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(xs,{size:14})}),s.jsx(pt,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(hs,{size:14})})]})]})}function gl(t){const e=N.c(29),{request:n}=t,{approve:r,deny:o}=hi(),i=r.isPending||o.isPending,l=n.user?.name??n.user?.email??n.userId,a=n.user?.image??void 0;let c;e[0]!==l?(c=l.charAt(0).toUpperCase(),e[0]=l,e[1]=c):c=e[1];let d;e[2]!==a||e[3]!==c?(d=s.jsx(is,{url:a,fallback:c,shape:"circle",size:"sm"}),e[2]=a,e[3]=c,e[4]=d):d=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Requested to join"}),e[5]=u):u=e[5];let m;e[6]!==l?(m=s.jsxs("div",{className:"flex-1 min-w-0",children:[u,s.jsx("p",{className:"text-sm font-medium truncate",children:l})]}),e[6]=l,e[7]=m):m=e[7];let f;e[8]!==r||e[9]!==n.id?(f=()=>r.mutate(n.id),e[8]=r,e[9]=n.id,e[10]=f):f=e[10];let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(xs,{size:14}),e[11]=h):h=e[11];let p;e[12]!==i||e[13]!==f?(p=s.jsx(pt,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:f,disabled:i,"aria-label":"Approve join request",children:h}),e[12]=i,e[13]=f,e[14]=p):p=e[14];let x;e[15]!==o||e[16]!==n.id?(x=()=>o.mutate(n.id),e[15]=o,e[16]=n.id,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(hs,{size:14}),e[18]=g):g=e[18];let b;e[19]!==i||e[20]!==x?(b=s.jsx(pt,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:x,disabled:i,"aria-label":"Deny join request",children:g}),e[19]=i,e[20]=x,e[21]=b):b=e[21];let j;e[22]!==b||e[23]!==p?(j=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[p,b]}),e[22]=b,e[23]=p,e[24]=j):j=e[24];let y;return e[25]!==j||e[26]!==d||e[27]!==m?(y=s.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors",children:[d,m,j]}),e[25]=j,e[26]=d,e[27]=m,e[28]=y):y=e[28],y}function bl(t){const e=N.c(14),{release:n,isSeen:r,onSelect:o}=t;let i;e[0]!==r?(i=!r&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=r,e[1]=i):i=e[1];let l;e[2]!==n.eyebrow?(l=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=l):l=e[3];let a;e[4]!==n.title?(a=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let c;e[6]!==l||e[7]!==a?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[6]=l,e[7]=a,e[8]=c):c=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(bs,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=d):d=e[9];let u;return e[10]!==o||e[11]!==i||e[12]!==c?(u=s.jsxs("button",{type:"button",onClick:o,className:"relative w-full flex items-center gap-3 px-5 py-4 border-b border-border last:border-0 hover:bg-muted/25 transition-colors text-left",children:[i,c,d]}),e[10]=o,e[11]=i,e[12]=c,e[13]=u):u=e[13],u}function jl(){const t=z.useContext(hr),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function $n(){const t=N.c(11),{isSeen:e,markSeen:n,unseenCount:r}=ro(),o=jl(),i=gi();let l;if(t[0]!==e||t[1]!==o||t[2]!==i){const d=[...i].sort(Nl).map(_l),u=[...o].sort(Sl).map(yl);let m;t[4]!==e?(m=h=>({type:"release",release:h,isSeen:e(h.id)}),t[4]=e,t[5]=m):m=t[5];const f=[...oo].sort(vl).map(m);l=[...d,...u,...f],t[0]=e,t[1]=o,t[2]=i,t[3]=l}else l=t[3];const a=r+o.length+i.length;let c;return t[6]!==n||t[7]!==o||t[8]!==l||t[9]!==a?(c={items:l,pendingInvitations:o,redDotCount:a,markReleaseSeen:n},t[6]=n,t[7]=o,t[8]=l,t[9]=a,t[10]=c):c=t[10],c}function vl(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function yl(t){return{type:"invitation",invitation:t}}function Sl(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}function _l(t){return{type:"join-request",request:t}}function Nl(t,e){return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}class An extends z.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,n){}render(){return this.state.hasError?null:this.props.children}}function zn(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function Cl(){const t=N.c(17),e=Ee(),{org:n}=ue(),{hasDecoKey:r,balanceDollars:o}=fn();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];let l;t[2]!==o?(l=Q(o!=null&&zn(o)),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e||t[5]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=a):a=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ln,{}),t[7]=c):c=t[7];let d;t[8]!==o?(d=o!=null?`$${o.toFixed(2)}`:"Credits",t[8]=o,t[9]=d):d=t[9];let u;t[10]!==d?(u=s.jsx("span",{children:d}),t[10]=d,t[11]=u):u=t[11];let m;return t[12]!==i||t[13]!==l||t[14]!==a||t[15]!==u?(m=s.jsx(Oe,{children:s.jsx(he,{children:s.jsxs(ke,{tooltip:i,className:l,onClick:a,children:[c,u]})})}),t[12]=i,t[13]=l,t[14]=a,t[15]=u,t[16]=m):m=t[16],m}function wl(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(An,{children:s.jsx(z.Suspense,{fallback:null,children:s.jsx(Cl,{})})}),t[0]=e):e=t[0],e}function kl(){const t=N.c(17),e=Ee(),{org:n}=ue(),{hasDecoKey:r,balanceDollars:o}=fn();if(!r)return null;let i;t[0]!==o?(i=o!=null?`Credits: $${o.toFixed(2)}`:"Credits",t[0]=o,t[1]=i):i=t[1];const l=i;let a;t[2]!==e||t[3]!==n.slug?(a=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[2]=e,t[3]=n.slug,t[4]=a):a=t[4];let c;t[5]!==o?(c=Q(o!=null&&zn(o)),t[5]=o,t[6]=c):c=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ln,{className:"size-4"}),t[7]=d):d=t[7];let u;t[8]!==a||t[9]!==c||t[10]!==l?(u=s.jsx(Pe,{asChild:!0,children:s.jsx(ge,{"aria-label":l,onClick:a,className:c,children:d})}),t[8]=a,t[9]=c,t[10]=l,t[11]=u):u=t[11];let m;t[12]!==l?(m=s.jsx(De,{side:"top",children:l}),t[12]=l,t[13]=m):m=t[13];let f;return t[14]!==u||t[15]!==m?(f=s.jsxs(Me,{delayDuration:300,children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16],f}function Il(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(An,{children:s.jsx(z.Suspense,{fallback:null,children:s.jsx(kl,{})})}),t[0]=e):e=t[0],e}function On(t){const e=N.c(15),{children:n}=t,{items:r,markReleaseSeen:o}=$n(),[i,l]=z.useState(null);let a;if(e[0]!==r||e[1]!==i){let x;e[3]!==i?(x=g=>g.type==="release"&&g.release.id===i,e[3]=i,e[4]=x):x=e[4],a=r.find(x),e[0]=r,e[1]=i,e[2]=a}else a=e[2];const c=a,d=c?.type==="release"?c.release:null;let u;e[5]!==o?(u=x=>{l(x),o(x)},e[5]=o,e[6]=u):u=e[6];const m=u;let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=x=>{x||l(null)},e[7]=f):f=e[7];let h;e[8]!==m||e[9]!==r||e[10]!==d?(h=s.jsx(Ut,{side:"right",align:"start",sideOffset:16,collisionPadding:16,className:"w-[min(400px,calc(100vw-2rem))] p-0 h-[min(650px,calc(100dvh-4rem))] flex flex-col",children:d?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-border shrink-0",children:[s.jsx(pt,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>l(null),children:s.jsx(Yo,{size:16})}),s.jsx("h3",{className:"text-sm font-medium truncate",children:d.title})]}),s.jsx("div",{className:"overflow-y-auto flex-1 p-5",children:s.jsx(io,{release:d})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-4 py-3 border-b border-border shrink-0",children:s.jsx("h3",{className:"text-sm font-medium",children:"Inbox"})}),r.length===0?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 px-6 text-center",children:[s.jsx(gs,{size:24,className:"text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Nothing here yet"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Invitations, join requests, and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:r.map(x=>x.type==="join-request"?s.jsx(gl,{request:x.request},`req-${x.request.id}`):x.type==="invitation"?s.jsx(hl,{invitation:x.invitation},`inv-${x.invitation.id}`):s.jsx(bl,{release:x.release,isSeen:x.isSeen,onSelect:()=>m(x.release.id)},`rel-${x.release.id}`))})]})}),e[8]=m,e[9]=r,e[10]=d,e[11]=h):h=e[11];let p;return e[12]!==n||e[13]!==h?(p=s.jsxs(Bt,{onOpenChange:f,children:[n,h]}),e[12]=n,e[13]=h,e[14]=p):p=e[14],p}function Pn(){const{redDotCount:t}=$n();return t>0}function Tl(){const t=N.c(6),e=Pn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(gs,{}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("span",{children:"Inbox"}),t[3]=o):o=t[3];let i;return t[4]!==r?(i=s.jsx(On,{children:s.jsx(xt,{asChild:!0,children:s.jsxs(ke,{tooltip:"Inbox",className:"relative",children:[n,r,o]})})}),t[4]=r,t[5]=i):i=t[5],i}function $l(){const t=N.c(8),e=Pn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(gs,{className:"size-4"}),t[0]=n):n=t[0];let r;t[1]!==e?(r=e&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 pointer-events-none"}),t[1]=e,t[2]=r):r=t[2];let o;t[3]!==r?(o=s.jsx(xt,{asChild:!0,children:s.jsx(Pe,{asChild:!0,children:s.jsxs(ge,{"aria-label":"Inbox",children:[n,r]})})}),t[3]=r,t[4]=o):o=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(De,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let l;return t[6]!==o?(l=s.jsx(On,{children:s.jsxs(Me,{delayDuration:300,children:[o,i]})}),t[6]=o,t[7]=l):l=t[7],l}function Al(){const t=N.c(3),[e,n]=z.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(ke,{tooltip:"Connections",onClick:()=>{ee("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:[s.jsx(hn,{}),s.jsx("span",{children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(pn,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function zl(){const t=N.c(3),[e,n]=z.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Me,{delayDuration:300,children:[s.jsx(Pe,{asChild:!0,children:s.jsx(ge,{"aria-label":"Connections",onClick:()=>{ee("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(hn,{className:"size-4"})})}),s.jsx(De,{side:"top",children:"Connections"})]}),t[0]=r):r=t[0];let o;return t[1]!==e?(o=s.jsxs(s.Fragment,{children:[r,s.jsx(pn,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function Ol(){const t=N.c(7),e=Ee(),{org:n}=ue();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o,i;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(vt,{}),i=s.jsx("span",{children:"Settings"}),t[3]=o,t[4]=i):(o=t[3],i=t[4]);let l;return t[5]!==r?(l=s.jsxs(ke,{tooltip:"Settings",onClick:r,children:[o,i]}),t[5]=r,t[6]=l):l=t[6],l}function Pl(){const t=N.c(9),e=Ee(),{org:n}=ue();let r;t[0]!==e||t[1]!==n.slug?(r=()=>e({to:"/$org/settings",params:{org:n.slug}}),t[0]=e,t[1]=n.slug,t[2]=r):r=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(vt,{className:"size-4"}),t[3]=o):o=t[3];let i;t[4]!==r?(i=s.jsx(Pe,{asChild:!0,children:s.jsx(ge,{"aria-label":"Settings",onClick:r,children:o})}),t[4]=r,t[5]=i):i=t[5];let l;t[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(De,{side:"top",children:"Settings"}),t[6]=l):l=t[6];let a;return t[7]!==i?(a=s.jsxs(Me,{delayDuration:300,children:[i,l]}),t[7]=i,t[8]=a):a=t[8],a}function Dl(){const t=N.c(6),{state:e}=Qe();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(wl,{}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(he,{children:s.jsx(Al,{})}),t[1]=i):i=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(he,{children:s.jsx(Tl,{})}),t[2]=l):l=t[2];let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(he,{children:s.jsx(Ol,{})}),t[3]=a):a=t[3];let c;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(rs,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs(Oe,{children:[i,l,a,s.jsx(he,{children:s.jsx(cs,{})})]})]}),t[4]=c):c=t[4],c}let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(rs,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Oe,{children:s.jsx(he,{children:s.jsx(cs,{})})})}),s.jsx(Pl,{}),s.jsx($l,{}),s.jsx(zl,{}),s.jsx(Il,{})]})}),t[5]=r):r=t[5],r}function Ml(){const t=N.c(8),e=Ee(),{org:n}=ue(),{setOpenMobile:r}=Qe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Oe,{children:s.jsx(he,{children:s.jsx(cs,{})})})}),t[0]=o):o=t[0];let i;t[1]!==e||t[2]!==n.slug||t[3]!==r?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),r(!1)},t[1]=e,t[2]=n.slug,t[3]=r,t[4]=i):i=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(vt,{className:"size-4"}),t[5]=l):l=t[5];let a;return t[6]!==i?(a=s.jsx(rs,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[o,s.jsx(ge,{"aria-label":"Settings",onClick:i,children:l})]})}),t[6]=i,t[7]=a):a=t[7],a}function Rl(t){const e=N.c(8),{virtualMcpId:n,size:r,showAutomationBadge:o}=t,i=r===void 0?"sm":r;let l;e[0]!==i||e[1]!==n?(l=n?s.jsx(El,{virtualMcpId:n,size:i}):s.jsx(Re,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=l):l=e[2];let a;e[3]!==o?(a=o&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(jn,{size:10,className:"text-white"})}),e[3]=o,e[4]=a):a=e[4];let c;return e[5]!==l||e[6]!==a?(c=s.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=c):c=e[7],c}function El(t){const e=N.c(6),{virtualMcpId:n,size:r}=t,o=jt(n);if(!o){let a;return e[0]!==r?(a=s.jsx(Re,{icon:null,name:"?",size:r}),e[0]=r,e[1]=a):a=e[1],a}const i=o.icon??null;let l;return e[2]!==o.title||e[3]!==r||e[4]!==i?(l=s.jsx(Re,{icon:i,name:o.title,size:r}),e[2]=o.title,e[3]=r,e[4]=i,e[5]=l):l=e[5],l}function Fl(t){const e=N.c(36),{open:n,onOpenChange:r}=t,[o,i]=z.useState(""),{org:l}=ue(),{setTaskId:a}=dn(),c=bn();let d,u,m;e[0]!==l.id||e[1]!==o?(m=o.trim(),u=fs,d=ms.globalSearch(l.id,m),e[0]=l.id,e[1]=o,e[2]=d,e[3]=u,e[4]=m):(d=e[2],u=e[3],m=e[4]);const f=n&&m.length>0;let h;e[5]!==c||e[6]!==m?(h=async()=>await c.call("GLOBAL_SEARCH",{query:m,limit:20}),e[5]=c,e[6]=m,e[7]=h):h=e[7];let p;e[8]!==d||e[9]!==f||e[10]!==h?(p={queryKey:d,enabled:f,queryFn:h,staleTime:1e4},e[8]=d,e[9]=f,e[10]=h,e[11]=p):p=e[11];const{data:x,isFetching:g}=u(p);let b;e[12]!==x?.items?(b=x?.items??[],e[12]=x?.items,e[13]=b):b=e[13];const j=b;let y;e[14]!==r?(y=C=>{C||i(""),r(C)},e[14]=r,e[15]=y):y=e[15];const v=y;let _;e[16]!==v||e[17]!==a?(_=C=>{v(!1),a(C.id,C.virtual_mcp_id??void 0)},e[16]=v,e[17]=a,e[18]=_):_=e[18];const k=_;let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsxs(vi,{className:"sr-only",children:[s.jsx(yi,{children:"Search"}),s.jsx(Si,{children:"Search across your organization's resources."})]}),e[19]=S):S=e[19];let I;e[20]!==o?(I=s.jsx(ki,{value:o,onValueChange:i,placeholder:"Search..."}),e[20]=o,e[21]=I):I=e[21];let T;e[22]!==k||e[23]!==g||e[24]!==j||e[25]!==m?(T=m?g&&j.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):j.length===0?s.jsx(Ci,{children:"No results."}):j.map(C=>C.type==="thread"?s.jsxs(wi,{value:`thread:${C.id}:${C.title}`,onSelect:()=>k(C),className:"gap-2.5",children:[s.jsx(Rl,{virtualMcpId:C.virtual_mcp_id,size:"xs"}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"text-sm text-foreground truncate",children:C.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(C.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${C.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=k,e[23]=g,e[24]=j,e[25]=m,e[26]=T):T=e[26];let $;e[27]!==T?($=s.jsx(Ii,{children:T}),e[27]=T,e[28]=$):$=e[28];let O;e[29]!==I||e[30]!==$?(O=s.jsxs(_i,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[S,s.jsxs(Ti,{shouldFilter:!1,className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:[I,$]})]}),e[29]=I,e[30]=$,e[31]=O):O=e[31];let A;return e[32]!==v||e[33]!==n||e[34]!==O?(A=s.jsx(Ni,{open:n,onOpenChange:v,children:O}),e[32]=v,e[33]=n,e[34]=O,e[35]=A):A=e[35],A}function Gl(t){return t==="owner"||t==="admin"}function Ll(){const t=N.c(11),{locator:e}=ue(),n=$i(),{data:r}=we.useSession(),o=r?.user?.id;let i;t[0]!==e?(i=ms.members(e),t[0]=e,t[1]=i):i=t[1];let l;t[2]!==n?(l=()=>n.organization.listMembers(),t[2]=n,t[3]=l):l=t[3];const a=!!o;let c;t[4]!==i||t[5]!==l||t[6]!==a?(c={queryKey:i,queryFn:l,enabled:a,staleTime:6e4},t[4]=i,t[5]=l,t[6]=a,t[7]=c):c=t[7];const{data:d}=fs(c);let u;if(t[8]!==d?.data?.members||t[9]!==o){const f=(d?.data?.members??[]).find(h=>h.userId===o)?.role;u=Gl(f??void 0),t[8]=d?.data?.members,t[9]=o,t[10]=u}else u=t[10];return u}var ss,qt="HoverCard",[Dn]=jr(qt,[Xs]),Wt=Xs(),[Hl,Kt]=Dn(qt),Mn=t=>{const{__scopeHoverCard:e,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:l=700,closeDelay:a=300}=t,c=Wt(e),d=z.useRef(0),u=z.useRef(0),m=z.useRef(!1),f=z.useRef(!1),[h,p]=Cr({prop:r,defaultProp:o??!1,onChange:i,caller:qt}),x=z.useCallback(()=>{clearTimeout(u.current),d.current=window.setTimeout(()=>p(!0),l)},[l,p]),g=z.useCallback(()=>{clearTimeout(d.current),!m.current&&!f.current&&(u.current=window.setTimeout(()=>p(!1),a))},[a,p]),b=z.useCallback(()=>p(!1),[p]);return z.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(u.current)},[]),s.jsx(Hl,{scope:e,open:h,onOpenChange:p,onOpen:x,onClose:g,onDismiss:b,hasSelectionRef:m,isPointerDownOnContentRef:f,children:s.jsx(wr,{...c,children:n})})};Mn.displayName=qt;var Rn="HoverCardTrigger",En=z.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,o=Kt(Rn,n),i=Wt(n);return s.jsx(gr,{asChild:!0,...i,children:s.jsx(br.a,{"data-state":o.open?"open":"closed",...r,ref:e,onPointerEnter:ze(t.onPointerEnter,Ft(o.onOpen)),onPointerLeave:ze(t.onPointerLeave,Ft(o.onClose)),onFocus:ze(t.onFocus,o.onOpen),onBlur:ze(t.onBlur,o.onClose),onTouchStart:ze(t.onTouchStart,l=>l.preventDefault())})})});En.displayName=Rn;var vs="HoverCardPortal",[Bl,Ul]=Dn(vs,{forceMount:void 0}),Fn=t=>{const{__scopeHoverCard:e,forceMount:n,children:r,container:o}=t,i=Kt(vs,e);return s.jsx(Bl,{scope:e,forceMount:n,children:s.jsx(Qs,{present:n||i.open,children:s.jsx(Nr,{asChild:!0,container:o,children:r})})})};Fn.displayName=vs;var Et="HoverCardContent",Gn=z.forwardRef((t,e)=>{const n=Ul(Et,t.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=t,i=Kt(Et,t.__scopeHoverCard);return s.jsx(Qs,{present:r||i.open,children:s.jsx(ql,{"data-state":i.open?"open":"closed",...o,onPointerEnter:ze(t.onPointerEnter,Ft(i.onOpen)),onPointerLeave:ze(t.onPointerLeave,Ft(i.onClose)),ref:e})})});Gn.displayName=Et;var ql=z.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:l,...a}=t,c=Kt(Et,n),d=Wt(n),u=z.useRef(null),m=vr(e,u),[f,h]=z.useState(!1);return z.useEffect(()=>{if(f){const p=document.body;return ss=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=ss,p.style.webkitUserSelect=ss}}},[f]),z.useEffect(()=>{if(u.current){const p=()=>{h(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),z.useEffect(()=>{u.current&&Vl(u.current).forEach(x=>x.setAttribute("tabindex","-1"))}),s.jsx(yr,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:ze(i,p=>{p.preventDefault()}),onDismiss:c.onDismiss,children:s.jsx(Sr,{...d,...a,onPointerDown:ze(a.onPointerDown,p=>{p.currentTarget.contains(p.target)&&h(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:m,style:{...a.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Wl="HoverCardArrow",Kl=z.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,o=Wt(n);return s.jsx(_r,{...o,...r,ref:e})});Kl.displayName=Wl;function Ft(t){return e=>e.pointerType==="touch"?void 0:t()}function Vl(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)e.push(n.currentNode);return e}var Yl=Mn,Xl=En,Ql=Fn,Jl=Gn;function Zl(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(Yl,{"data-slot":"hover-card",...n}),e[2]=n,e[3]=r):r=e[3],r}function ea(t){const e=N.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=s.jsx(Xl,{"data-slot":"hover-card-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function ta(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,align:o,sideOffset:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const l=o===void 0?"center":o,a=i===void 0?4:i;let c;e[5]!==n?(c=Q("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",n),e[5]=n,e[6]=c):c=e[6];let d;return e[7]!==l||e[8]!==r||e[9]!==a||e[10]!==c?(d=s.jsx(Ql,{"data-slot":"hover-card-portal",children:s.jsx(Jl,{"data-slot":"hover-card-content",align:l,sideOffset:a,className:c,...r})}),e[7]=l,e[8]=r,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function Ln(t){const e=N.c(26),{virtualMcpId:n,isOrgPinned:r,canManageOrgPin:o,onNewTaskInGroup:i,onShowSettings:l,onToggleOrgPin:a,onHideGroup:c}=t;let d;e[0]!==i||e[1]!==n?(d=()=>i(n),e[0]=i,e[1]=n,e[2]=d):d=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ce,{size:14,className:"mr-2"}),e[3]=u):u=e[3];let m;e[4]!==d?(m=s.jsxs(Ot,{onSelect:d,children:[u,"New task"]}),e[4]=d,e[5]=m):m=e[5];let f;e[6]!==l||e[7]!==n?(f=()=>l(n),e[6]=l,e[7]=n,e[8]=f):f=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(vt,{size:14,className:"mr-2"}),e[9]=h):h=e[9];let p;e[10]!==f?(p=s.jsxs(Ot,{onSelect:f,children:[h,"Settings"]}),e[10]=f,e[11]=p):p=e[11];let x;e[12]!==o||e[13]!==r||e[14]!==a||e[15]!==n?(x=o&&s.jsxs(s.Fragment,{children:[s.jsx(Ds,{}),s.jsxs(Ot,{onSelect:()=>a(n,!r),children:[s.jsx(Yr,{size:14,className:"mr-2"}),r?"Unpin for all members":"Pin for all members"]})]}),e[12]=o,e[13]=r,e[14]=a,e[15]=n,e[16]=x):x=e[16];let g;e[17]!==r||e[18]!==c||e[19]!==n?(g=!r&&s.jsxs(s.Fragment,{children:[s.jsx(Ds,{}),s.jsxs(Ot,{onSelect:()=>c(n),children:[s.jsx(Xo,{size:14,className:"mr-2"}),"Hide"]})]}),e[17]=r,e[18]=c,e[19]=n,e[20]=g):g=e[20];let b;return e[21]!==m||e[22]!==p||e[23]!==x||e[24]!==g?(b=s.jsxs(s.Fragment,{children:[m,p,x,g]}),e[21]=m,e[22]=p,e[23]=x,e[24]=g,e[25]=b):b=e[25],b}function sa(t){return t==="ephemeral"||t.startsWith("thread:")}function Vt(t){const e=N.c(46),{task:n,isActive:r,onClick:o,onArchive:i,showAutomationBadge:l,showAgentIcon:a,hideStatusIdle:c,indented:d}=t,u=Ai(n.status),m=u.icon,f=n.metadata?.kind==="tool_call_run",h=jt(f?void 0:n.virtual_mcp_id);let p;e[0]!==h?(p=Io(h),e[0]=h,e[1]=p):p=e[1];const x=p;Oi(6e4);const g=l||!!n.trigger_id,b=n.id,j="button",y=0;let v;e[2]!==o?(v=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),o())},e[2]=o,e[3]=v):v=e[3];const _=d?"-ml-4 pl-6":"pl-2",k=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let S;e[4]!==_||e[5]!==k?(S=Q("group/row flex items-center gap-2 py-1.5 pr-2 rounded-md cursor-pointer transition-colors",_,"focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",k),e[4]=_,e[5]=k,e[6]=S):S=e[6];let I;e[7]!==f||e[8]!==a||e[9]!==h?.icon||e[10]!==h?.title?(I=a&&!f&&s.jsx(Re,{icon:h?.icon??null,name:h?.title??"?",size:"2xs"}),e[7]=f,e[8]=a,e[9]=h?.icon,e[10]=h?.title,e[11]=I):I=e[11];let T;e[12]!==g?(T=g&&s.jsx(jn,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[12]=g,e[13]=T):T=e[13];const $=n.title||"Untitled task";let O;e[14]!==$?(O=s.jsx("div",{className:"text-sm text-foreground truncate",children:$}),e[14]=$,e[15]=O):O=e[15];let A;e[16]!==T||e[17]!==O?(A=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[T,O]}),e[16]=T,e[17]=O,e[18]=A):A=e[18];let C;e[19]!==x||e[20]!==r||e[21]!==n.branch||e[22]!==n.updated_at?(C=n.updated_at&&s.jsxs("div",{className:Q("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!sa(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):x?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[x.owner,"/",x.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Pi(new Date(n.updated_at))})]}),e[19]=x,e[20]=r,e[21]=n.branch,e[22]=n.updated_at,e[23]=C):C=e[23];let M;e[24]!==A||e[25]!==C?(M=s.jsxs("div",{className:"flex-1 min-w-0",children:[A,C]}),e[24]=A,e[25]=C,e[26]=M):M=e[26];const K="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",U=!c&&s.jsx("span",{className:"[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity group-hover/row:opacity-0","aria-label":u.label,children:s.jsx(m,{size:14,className:Q(u.iconClassName,n.status==="in_progress"&&"animate-spin")})});let E;e[27]!==i?(E=B=>{B.stopPropagation(),i()},e[27]=i,e[28]=E):E=e[28];let L;e[29]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(kr,{size:14}),e[29]=L):L=e[29];let R;e[30]!==E?(R=s.jsx(Pe,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:E,className:"[grid-area:slot] opacity-0 pointer-events-none group-hover/row:opacity-100 group-hover/row:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto transition-opacity flex size-7 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:L})}),e[30]=E,e[31]=R):R=e[31];let H;e[32]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(De,{side:"right",children:"Archive"}),e[32]=H):H=e[32];let P;e[33]!==R?(P=s.jsxs(Me,{children:[R,H]}),e[33]=R,e[34]=P):P=e[34];let G;e[35]!==U||e[36]!==P?(G=s.jsxs("div",{className:K,children:[U,P]}),e[35]=U,e[36]=P,e[37]=G):G=e[37];let D;return e[38]!==o||e[39]!==M||e[40]!==G||e[41]!==v||e[42]!==S||e[43]!==I||e[44]!==n.id?(D=s.jsxs("div",{"data-task-id":b,role:j,tabIndex:y,onClick:o,onKeyDown:v,className:S,children:[I,M,G]}),e[38]=o,e[39]=M,e[40]=G,e[41]=v,e[42]=S,e[43]=I,e[44]=n.id,e[45]=D):D=e[45],D}function ys(t){const e=N.c(12),{onClick:n,isFetching:r,indented:o}=t,i=o?"-ml-4 pl-6 pr-2":"px-2";let l;e[0]!==i?(l=Q("flex items-center gap-2 py-1.5 rounded-md text-sm text-muted-foreground",i,"hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50","transition-colors disabled:cursor-progress disabled:opacity-60"),e[0]=i,e[1]=l):l=e[1];let a;e[2]!==r?(a=r&&s.jsx(Ks,{size:14,className:"animate-spin"}),e[2]=r,e[3]=a):a=e[3];const c=r?"Loading…":"Show more";let d;e[4]!==c?(d=s.jsx("span",{children:c}),e[4]=c,e[5]=d):d=e[5];let u;return e[6]!==r||e[7]!==n||e[8]!==l||e[9]!==a||e[10]!==d?(u=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:l,children:[a,d]}),e[6]=r,e[7]=n,e[8]=l,e[9]=a,e[10]=d,e[11]=u):u=e[11],u}function na(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function ra(t){return t.member==="mine"&&!t.currentUserId}const Hn=4;let Mt=0;const ds=[];function oa(){for(;Mt<Hn&&ds.length>0;){const t=ds.shift();t&&t()}}function Bn(t){return new Promise((e,n)=>{const r=()=>{Mt++,t().then(e,n).finally(()=>{Mt--,oa()})};Mt<Hn?r():ds.push(r)})}const Yt=10;function Fs(t,e,n,r,o){const i={hidden:!1};t==="agent"&&(i.virtual_mcp_id=e),r.member==="mine"&&r.currentUserId&&(i.created_by=r.currentUserId),r.type==="automation"&&(i.has_trigger=!0),r.type==="manual"&&(i.has_trigger=!1);const l={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return t==="status"&&(l.status=e),l}function ia(t,e,n,r){let o=0;for(const i of t)Ss(i,e,n,r)&&o++;return o}function ns(t,e,n,r){return ia(t,e,n,r)}function la(t,e,n){const r=new Map;for(const o of t){const i=o.virtual_mcp_id;i&&Ss(o,e,i,n)&&r.set(i,(r.get(i)??0)+1)}return r}function aa(t,e){return!!(t>=Yt||t===0&&e)}function Gs(t,e){return t<e}function ca(t,e){return e===!1?!1:e===!0?!0:t}function Ss(t,e,n,r){return!(t.hidden||e==="agent"&&t.virtual_mcp_id!==n||e==="status"&&(t.status??"completed")!==n||r.member==="mine"&&r.currentUserId&&t.created_by!==r.currentUserId||r.type==="automation"&&!t.trigger_id||r.type==="manual"&&t.trigger_id)}const Gt=new Map,Dt=new Map;function da(t,e){return e?t>=Yt?!0:null:!1}function Ls(t){return Gt.get(t)}function ua(t,e){Gt.set(t,e)}function ma(t,e,n){const r=Gt.get(t);if(r!==void 0){n(r);return}let o=Dt.get(t);o||(o=Bn(e).then(i=>(Gt.set(t,i),Dt.delete(t),i)).catch(()=>(Dt.delete(t),Promise.reject(new Error("group probe failed")))),Dt.set(t,o)),o.then(n,()=>n(!1))}function Hs(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Yt,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function fa(t,e,n,r,o){let i=0;for(const l of t)e.has(l.id)||Ss(l,n,r,o)&&i++;return i}function _s(t,e,n,r){const o=N.c(8),{org:i}=ue(),l=na(i.id,t,e,n);let a;o[0]!==n?(a=ra(n),o[0]=n,o[1]=a):a=o[1];const c=a,[d,u]=z.useState({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==l&&u({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:null,serverHasMore:null});const m=to(),{threads:f,hasMore:h}=cn(),p=r??ns(f,t,e,n),x=aa(p,h),g=da(p,h),b=bn();if(d.identity===l&&d.serverHasMore===null){const S=g??Ls(l);S!==void 0&&u({isFetching:!1,isProbing:!1,identity:l,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:S})}!c&&d.identity===l&&d.serverHasMore===null&&g===null&&Ls(l)===void 0&&d.probeSubscribedIdentity!==l&&(u(S=>S.identity===l?{...S,isProbing:!0,probeSubscribedIdentity:l}:S),ma(l,async()=>{const S=Fs(t,e,0,n,1),I=await b.call("COLLECTION_THREADS_LIST",S),{totalCount:T}=Hs(I),$=ns(m.threads.get(),t,e,n);return T===void 0?!1:Gs($,T)},S=>{u(I=>I.identity!==l?I:{...I,isProbing:!1,serverHasMore:S})}));const y=async function(){if(d.isFetching||d.isProbing||c)return;const I=l;u(T=>T.identity===I?{...T,isFetching:!0}:T);try{const T=ns(f,t,e,n),$=Fs(t,e,T,n,Yt),O=await Bn(()=>b.call("COLLECTION_THREADS_LIST",$)),{items:A,hasMore:C,totalCount:M}=Hs(O),K=new Set(f.map(pa)),U=fa(A,K,t,e,n),E=T;m.mergeThreads(A),u(L=>{if(L.identity!==I)return L;let R;return M!==void 0?R=Gs(E+U,M):R=A.length===0||U===0?!1:C,ua(I,R),{...L,isFetching:!1,serverHasMore:R}})}catch(T){const $=T,O=$ instanceof Error?$.message:String($);Ae.error(`Could not load more tasks: ${O}`),u(A=>A.identity===I?{...A,isFetching:!1}:A)}},v=d.isFetching||d.isProbing,_=!c&&!v&&ca(x,d.serverHasMore);let k;return o[2]!==v||o[3]!==y||o[4]!==_||o[5]!==d.isProbing||o[6]!==d.serverHasMore?(k={hasMore:_,isFetching:v,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:y},o[2]=v,o[3]=y,o[4]=_,o[5]=d.isProbing,o[6]=d.serverHasMore,o[7]=k):k=o[7],k}function pa(t){return t.id}function Un(t){const e=N.c(61),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,onSelectTask:l,onArchiveTask:a,onNewTaskInGroup:c,onShowSettings:d,onHideGroup:u,isOrgPinned:m,canManageOrgPin:f,onToggleOrgPin:h,sortable:p,groupVisibleCount:x}=t,g=m===void 0?!1:m,b=f===void 0?!1:f,j=jt(n),y=r[0];let v;e[0]!==y||e[1]!==c||e[2]!==l||e[3]!==n?(v=()=>{y?l(y):c(n)},e[0]=y,e[1]=c,e[2]=l,e[3]=n,e[4]=v):v=e[4];const _=v,k=p?.isDragging?!1:void 0;let S;e[5]!==p?.isDragging||e[6]!==n?(S=X=>{p?.isDragging||X&&ee("sidebar_group_hover_popover_opened",{virtual_mcp_id:n})},e[5]=p?.isDragging,e[6]=n,e[7]=S):S=e[7];const I=!!(y&&o&&y.id===o),T=p?"Drag to reorder":void 0;let $;e[8]!==p?($=p?{...p.attributes,...p.listeners}:{},e[8]=p,e[9]=$):$=e[9];const O=p&&"cursor-pointer active:cursor-grabbing touch-none",A=p?.isDragging&&"cursor-grabbing";let C;e[10]!==A||e[11]!==O?(C=Q("group-data-[state=collapsed]/sidebar:!size-10 group-data-[state=collapsed]/sidebar:!max-w-none group-data-[state=collapsed]/sidebar:!overflow-visible group-data-[state=collapsed]/sidebar:[&_svg]:opacity-100",O,A),e[10]=A,e[11]=O,e[12]=C):C=e[12];const M=j?.icon??null,K=j?.title??"?";let U;e[13]!==M||e[14]!==K?(U=s.jsx(Re,{icon:M,name:K,size:"sm+",className:"rounded-lg"}),e[13]=M,e[14]=K,e[15]=U):U=e[15];let E;e[16]!==_||e[17]!==C||e[18]!==U||e[19]!==I||e[20]!==T||e[21]!==$?(E=s.jsx(he,{children:s.jsx(vn,{asChild:!0,children:s.jsx(ea,{asChild:!0,children:s.jsx(ke,{onClick:_,isActive:I,title:T,...$,className:C,children:U})})})}),e[16]=_,e[17]=C,e[18]=U,e[19]=I,e[20]=T,e[21]=$,e[22]=E):E=e[22];const L=h??xa;let R;e[23]!==b||e[24]!==g||e[25]!==u||e[26]!==c||e[27]!==d||e[28]!==L||e[29]!==n?(R=s.jsx(yn,{className:"w-56",children:s.jsx(Ln,{virtualMcpId:n,isOrgPinned:g,canManageOrgPin:b,onNewTaskInGroup:c,onShowSettings:d,onToggleOrgPin:L,onHideGroup:u})}),e[23]=b,e[24]=g,e[25]=u,e[26]=c,e[27]=d,e[28]=L,e[29]=n,e[30]=R):R=e[30];let H;e[31]!==E||e[32]!==R?(H=s.jsxs(Sn,{children:[E,R]}),e[31]=E,e[32]=R,e[33]=H):H=e[33];const P=j?.title??"Agent";let G;e[34]!==P?(G=s.jsx("span",{className:"truncate",children:P}),e[34]=P,e[35]=G):G=e[35];let D;e[36]!==c||e[37]!==n?(D=()=>c(n),e[36]=c,e[37]=n,e[38]=D):D=e[38];let B;e[39]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(Ce,{size:14}),e[39]=B):B=e[39];let F;e[40]!==D?(F=s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:D,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground",children:B}),e[40]=D,e[41]=F):F=e[41];let Y;e[42]!==G||e[43]!==F?(Y=s.jsxs("div",{className:"flex items-center justify-between px-1 pb-1 text-xs font-medium",children:[G,F]}),e[42]=G,e[43]=F,e[44]=Y):Y=e[44];let Z;e[45]!==o||e[46]!==i||e[47]!==x||e[48]!==a||e[49]!==l||e[50]!==r||e[51]!==n?(Z=s.jsx(ha,{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:x,onSelectTask:l,onArchiveTask:a}),e[45]=o,e[46]=i,e[47]=x,e[48]=a,e[49]=l,e[50]=r,e[51]=n,e[52]=Z):Z=e[52];let V;e[53]!==Y||e[54]!==Z?(V=s.jsxs(ta,{side:"right",align:"start",sideOffset:8,className:"w-72 p-2",children:[Y,Z]}),e[53]=Y,e[54]=Z,e[55]=V):V=e[55];let J;return e[56]!==H||e[57]!==V||e[58]!==k||e[59]!==S?(J=s.jsxs(Zl,{open:k,openDelay:120,closeDelay:150,onOpenChange:S,children:[H,V]}),e[56]=H,e[57]=V,e[58]=k,e[59]=S,e[60]=J):J=e[60],J}function xa(){}function ha(t){const e=N.c(6),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:l,onSelectTask:a,onArchiveTask:c}=t,d=_s("agent",n,i,l);let u;return e[0]!==o||e[1]!==c||e[2]!==a||e[3]!==d||e[4]!==r?(u=s.jsx("div",{className:"flex flex-col gap-0.5 max-h-[60vh] overflow-y-auto",children:r.length===0&&!d.hasMore&&!d.isFetching?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No tasks yet"}):s.jsxs(s.Fragment,{children:[r.map(m=>s.jsx(Vt,{task:m,isActive:o===m.id,onClick:()=>a(m),onArchive:()=>c(m),showAutomationBadge:!!m.trigger_id},m.id)),(d.hasMore||d.isFetching)&&s.jsx(ys,{onClick:()=>{d.loadMore()},isFetching:d.isFetching})]})}),e[0]=o,e[1]=c,e[2]=a,e[3]=d,e[4]=r,e[5]=u):u=e[5],u}function ga(t,e,n,r,o,i,l){const a=N.c(18),c=l===void 0?"expanded":l;let d;a[0]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:8}},a[0]=d):d=a[0];let u;a[1]===Symbol.for("react.memo_cache_sentinel")?(u={coordinateGetter:zo},a[1]=u):u=a[1];const m=To(Ts(Ao,d),Ts($o,u));let f;a[2]!==r||a[3]!==o||a[4]!==e||a[5]!==t?(f=uo(t,e,r,o),a[2]=r,a[3]=o,a[4]=e,a[5]=t,a[6]=f):f=a[6];const h=f;let p;a[7]!==i||a[8]!==n||a[9]!==o||a[10]!==e||a[11]!==h||a[12]!==c?(p=b=>{const{active:j,over:y}=b;if(!y||j.id===y.id)return;const v=String(j.id),_=String(y.id);if(!mo(v,_,o))return;const k=fo(h,v,_),S=po(e,n,o,k);e==="org"?xo(n.orgId,S):ho(n,S),ee("sidebar_group_reordered",{virtual_mcp_id:v,over_virtual_mcp_id:_,surface:c,section:e}),i()},a[7]=i,a[8]=n,a[9]=o,a[10]=e,a[11]=h,a[12]=c,a[13]=p):p=a[13];const x=p;let g;return a[14]!==x||a[15]!==m||a[16]!==h?(g={sensors:m,sortableIds:h,handleDragEnd:x},a[14]=x,a[15]=m,a[16]=h,a[17]=g):g=a[17],g}function ba(t){const e=N.c(2),{collapsed:n}=t;if(n===void 0?!1:n){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"mx-auto my-1 h-px w-6 shrink-0 bg-border"}),e[0]=i):i=e[0],i}let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{role:"separator","aria-orientation":"horizontal",className:"my-1.5 h-px w-full shrink-0 bg-border"}),e[1]=o):o=e[1],o}function ja(t){const e=N.c(12),{id:n,children:r}=t;let o;e[0]!==n?(o={id:n},e[0]=n,e[1]=o):o=e[1];const{attributes:i,listeners:l,setNodeRef:a,transform:c,transition:d,isDragging:u}=Ro(o);let m;if(e[2]!==i||e[3]!==r||e[4]!==u||e[5]!==l||e[6]!==a||e[7]!==c||e[8]!==d){const h={transform:Eo.Transform.toString(c),transition:d,zIndex:u?100:void 0};m=r({setNodeRef:a,style:h,isDragging:u,attributes:i,listeners:l}),e[2]=i,e[3]=r,e[4]=u,e[5]=l,e[6]=a,e[7]=c,e[8]=d,e[9]=m}else m=e[9];let f;return e[10]!==m?(f=s.jsx(s.Fragment,{children:m}),e[10]=m,e[11]=f):f=e[11],f}function Bs(t){const e=N.c(18),{section:n,groups:r,orderScope:o,decopilotId:i,orgPinnedIds:l,onReorder:a,surface:c,renderGroup:d,renderSortable:u,renderFixed:m}=t,{sensors:f,sortableIds:h,handleDragEnd:p}=ga(r,n,o,i,l,a,c);if(r.length===0)return null;const x=h;let g;if(e[0]!==r||e[1]!==m||e[2]!==d||e[3]!==u||e[4]!==h){let y;e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==h?(y=v=>{const _=d(v);return h.includes(v.virtualMcpId)?s.jsx(ja,{id:v.virtualMcpId,children:k=>{const{setNodeRef:S,style:I,isDragging:T,attributes:$,listeners:O}=k;return s.jsx("div",{ref:S,style:I,className:Q(T&&"opacity-50"),children:u(_,{attributes:$,listeners:O,isDragging:T})})}},v.virtualMcpId):s.jsx("div",{children:m(_)},v.virtualMcpId)},e[6]=m,e[7]=d,e[8]=u,e[9]=h,e[10]=y):y=e[10],g=r.map(y),e[0]=r,e[1]=m,e[2]=d,e[3]=u,e[4]=h,e[5]=g}else g=e[5];let b;e[11]!==x||e[12]!==g?(b=s.jsx(Oo,{items:x,strategy:Po,children:g}),e[11]=x,e[12]=g,e[13]=b):b=e[13];let j;return e[14]!==p||e[15]!==f||e[16]!==b?(j=s.jsx(Do,{sensors:f,collisionDetection:Mo,onDragEnd:p,children:b}),e[14]=p,e[15]=f,e[16]=b,e[17]=j):j=e[17],j}function qn(t){const e=N.c(23),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:a,collapsedSeparator:c,renderGroup:d,renderSortable:u,renderFixed:m}=t;let f;if(e[0]!==c||e[1]!==o||e[2]!==n||e[3]!==l||e[4]!==r||e[5]!==i||e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==a){const{decopilot:h,orgPinned:p,user:x,toolCallRuns:g}=go(n,o,i),b=p.length>0&&x.length>0;let j;e[11]!==o||e[12]!==l||e[13]!==r||e[14]!==i||e[15]!==m||e[16]!==d||e[17]!==u||e[18]!==a?(j={orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:a,renderGroup:d,renderSortable:u,renderFixed:m},e[11]=o,e[12]=l,e[13]=r,e[14]=i,e[15]=m,e[16]=d,e[17]=u,e[18]=a,e[19]=j):j=e[19];const y=j;let v;e[20]!==c||e[21]!==b?(v=b&&s.jsx(ba,{collapsed:c}),e[20]=c,e[21]=b,e[22]=v):v=e[22],f=s.jsxs(s.Fragment,{children:[h&&m(d(h)),s.jsx(Bs,{section:"org",groups:p,...y}),v,s.jsx(Bs,{section:"user",groups:x,...y}),g&&m(d(g))]}),e[0]=c,e[1]=o,e[2]=n,e[3]=l,e[4]=r,e[5]=i,e[6]=m,e[7]=d,e[8]=u,e[9]=a,e[10]=f}else f=e[10];return f}function va(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,renderGroup:a}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==a?(c=s.jsx(qn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:"collapsed_rail",collapsedSeparator:!0,renderGroup:a,renderFixed:Sa,renderSortable:ya}),e[0]=o,e[1]=n,e[2]=l,e[3]=r,e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function ya(t,e){return s.jsx(Un,{...t,sortable:{attributes:e.attributes,listeners:e.listeners,isDragging:e.isDragging}},t.virtualMcpId)}function Sa(t){return s.jsx(Un,{...t},t.virtualMcpId)}const _a="sidebar.group.expanded.";function Wn(t,e){const n=N.c(3),[r,o]=us(`${_a}${t}`,e);let i;return n[0]!==r||n[1]!==o?(i=[r,o],n[0]=r,n[1]=o,n[2]=i):i=n[2],i}function Kn(t){const e=N.c(70),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,onShowSettings:c,onHideGroup:d,isOrgPinned:u,canManageOrgPin:m,onToggleOrgPin:f,filters:h,groupVisibleCount:p,devPartnerId:x,devGroupVisibleCount:g,sortable:b}=t,j=u===void 0?!1:u,y=m===void 0?!1:m,v=x===void 0?null:x,[_,k]=Wn(n,!1),S=n===os,I=b?.isDragging??!1;let T;e[0]!==v||e[1]!==r?(T=v?r.filter(W=>W.virtual_mcp_id===v):[],e[0]=v,e[1]=r,e[2]=T):T=e[2];const $=T;let O;e[3]!==v||e[4]!==r?(O=v?r.filter(W=>W.virtual_mcp_id!==v):r,e[3]=v,e[4]=r,e[5]=O):O=e[5];const A=O,C=!!v&&($.length>0||(g??0)>0);let M;e[6]!==_||e[7]!==k?(M=function(){k(!_)},e[6]=_,e[7]=k,e[8]=M):M=e[8];const K=M;let U;e[9]!==S||e[10]!==b?(U=b&&!S?{...b.attributes,...b.listeners}:{},e[9]=S,e[10]=b,e[11]=U):U=e[11];let E;e[12]!==K?(E=W=>{W.target===W.currentTarget&&(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),K())},e[12]=K,e[13]=E):E=e[13];const L=b&&!S&&"touch-none active:cursor-grabbing",R=I&&"shadow-md bg-accent/40 cursor-grabbing";let H;e[14]!==R||e[15]!==L?(H=Q("group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground","cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",L,R),e[14]=R,e[15]=L,e[16]=H):H=e[16];let P;e[17]!==S||e[18]!==n?(P=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(Ca,{virtualMcpId:n,isToolCallRuns:S})}),e[17]=S,e[18]=n,e[19]=P):P=e[19];let G;e[20]!==_?(G=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:_?s.jsx(_n,{size:14}):s.jsx(bs,{size:14})}),e[20]=_,e[21]=G):G=e[21];let D;e[22]!==P||e[23]!==G?(D=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[P,G]}),e[22]=P,e[23]=G,e[24]=D):D=e[24];let B;e[25]!==S||e[26]!==n?(B=s.jsx("span",{className:"flex-1 truncate",children:s.jsx(ka,{virtualMcpId:n,isToolCallRuns:S})}),e[25]=S,e[26]=n,e[27]=B):B=e[27];let F;e[28]!==S||e[29]!==a||e[30]!==n?(F=!S&&s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:W=>{W.stopPropagation(),a(n)},className:"opacity-0 group-hover/group:opacity-100 focus-visible:opacity-100 transition-opacity flex size-7 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(Ce,{size:14})}),e[28]=S,e[29]=a,e[30]=n,e[31]=F):F=e[31];let Y;e[32]!==_||e[33]!==K||e[34]!==H||e[35]!==D||e[36]!==B||e[37]!==F||e[38]!==U||e[39]!==E?(Y=s.jsxs("div",{...U,role:"button",tabIndex:0,"aria-expanded":_,onClick:K,onKeyDown:E,className:H,children:[D,B,F]}),e[32]=_,e[33]=K,e[34]=H,e[35]=D,e[36]=B,e[37]=F,e[38]=U,e[39]=E,e[40]=Y):Y=e[40];const Z=Y;let V;e[41]!==y||e[42]!==Z||e[43]!==j||e[44]!==S||e[45]!==d||e[46]!==a||e[47]!==c||e[48]!==f||e[49]!==n?(V=S?Z:s.jsxs(Sn,{children:[s.jsx(vn,{asChild:!0,children:Z}),s.jsx(yn,{className:"w-56",children:s.jsx(Ln,{virtualMcpId:n,isOrgPinned:j,canManageOrgPin:y,onNewTaskInGroup:a,onShowSettings:c,onToggleOrgPin:f??Na,onHideGroup:d})})]}),e[41]=y,e[42]=Z,e[43]=j,e[44]=S,e[45]=d,e[46]=a,e[47]=c,e[48]=f,e[49]=n,e[50]=V):V=e[50];let J;e[51]!==o||e[52]!==g||e[53]!==v||e[54]!==$||e[55]!==_||e[56]!==h||e[57]!==p||e[58]!==S||e[59]!==A||e[60]!==l||e[61]!==a||e[62]!==i||e[63]!==C||e[64]!==r||e[65]!==n?(J=_&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:S?r.map(W=>s.jsx(Vt,{task:W,isActive:o===W.id,onClick:()=>i(W),onArchive:()=>l(W),showAutomationBadge:!!W.trigger_id,indented:!0},W.id)):s.jsxs(s.Fragment,{children:[s.jsx(Us,{virtualMcpId:n,threads:A,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,filters:h,groupVisibleCount:p}),C&&v&&s.jsxs("div",{className:"flex flex-col gap-0.5 mt-1.5",children:[s.jsxs("div",{className:"flex items-center gap-1.5 px-2 pb-0.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground/80",children:[s.jsx(Xr,{size:11}),"Develop"]}),s.jsx(Us,{virtualMcpId:v,threads:$,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,filters:h,groupVisibleCount:g})]})]})}),e[51]=o,e[52]=g,e[53]=v,e[54]=$,e[55]=_,e[56]=h,e[57]=p,e[58]=S,e[59]=A,e[60]=l,e[61]=a,e[62]=i,e[63]=C,e[64]=r,e[65]=n,e[66]=J):J=e[66];let X;return e[67]!==V||e[68]!==J?(X=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[V,J]}),e[67]=V,e[68]=J,e[69]=X):X=e[69],X}function Na(){}function Ca(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Re,{icon:null,name:"⚙",size:"2xs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(wa,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function wa(t){const e=N.c(4),{virtualMcpId:n}=t,r=jt(n);if(!r){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Re,{icon:null,name:"?",size:"2xs"}),e[0]=l):l=e[0],l}const o=r.icon??null;let i;return e[1]!==r.title||e[2]!==o?(i=s.jsx(Re,{icon:o,name:r.title,size:"2xs"}),e[1]=r.title,e[2]=o,e[3]=i):i=e[3],i}function ka(t){const e=N.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(s.Fragment,{children:"Automation runs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(Ia,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function Ia(t){const e=N.c(2),{virtualMcpId:n}=t,o=jt(n)?.title??"Agent";let i;return e[0]!==o?(i=s.jsx(s.Fragment,{children:o}),e[0]=o,e[1]=i):i=e[1],i}function Us(t){const e=N.c(10),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,filters:c,groupVisibleCount:d}=t,u=_s("agent",n,c,d),{isFetching:m,isProbing:f,loadMore:h,serverHasMore:p}=u,[x,g]=z.useState(!1);!x&&r.length===0&&p===!0&&!m&&!f&&(g(!0),queueMicrotask(()=>{h()}));const{hasMore:b}=u;let j;return e[0]!==o||e[1]!==b||e[2]!==m||e[3]!==h||e[4]!==l||e[5]!==a||e[6]!==i||e[7]!==r||e[8]!==n?(j=s.jsx(s.Fragment,{children:r.length===0?s.jsxs("button",{type:"button",onClick:()=>a(n),className:"flex items-center gap-2 -ml-4 pl-6 pr-2 py-1.5 rounded-md cursor-pointer text-sm text-muted-foreground hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[s.jsx(Ce,{size:14}),s.jsx("span",{children:"New thread"})]}):s.jsxs(s.Fragment,{children:[r.map(y=>s.jsx(Vt,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>l(y),showAutomationBadge:!!y.trigger_id,indented:!0},y.id)),(b||m)&&s.jsx(ys,{onClick:()=>{h()},isFetching:m,indented:!0})]})}),e[0]=o,e[1]=b,e[2]=m,e[3]=h,e[4]=l,e[5]=a,e[6]=i,e[7]=r,e[8]=n,e[9]=j):j=e[9],j}function Ta(t){const e=N.c(16),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:m,serverHasMore:f}=_s("status",n,a),[h,p]=z.useState(!1);!h&&r.length===0&&f===!0&&!c&&!d&&(p(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==o||e[1]!==l||e[2]!==i||e[3]!==r){let j;e[5]!==o||e[6]!==l||e[7]!==i?(j=y=>s.jsx(Vt,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>l(y),showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0,indented:!0},y.id),e[5]=o,e[6]=l,e[7]=i,e[8]=j):j=e[8],x=r.map(j),e[0]=o,e[1]=l,e[2]=i,e[3]=r,e[4]=x}else x=e[4];let g;e[9]!==m||e[10]!==c||e[11]!==u?(g=(m||c)&&s.jsx(ys,{onClick:()=>{u()},isFetching:c,indented:!0}),e[9]=m,e[10]=c,e[11]=u,e[12]=g):g=e[12];let b;return e[13]!==x||e[14]!==g?(b=s.jsxs(s.Fragment,{children:[x,g]}),e[13]=x,e[14]=g,e[15]=b):b=e[15],b}function $a(t){const e=N.c(35),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,c=zi[n],d=c.icon,[u,m]=Wn(`status-${n}`,!1);let f;e[0]!==u||e[1]!==m?(f=function(){m(!u)},e[0]=u,e[1]=m,e[2]=f):f=e[2];const h=f;let p;e[3]!==h?(p=S=>{S.target===S.currentTarget&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),h())},e[3]=h,e[4]=p):p=e[4];let x;e[5]!==d||e[6]!==c.iconClassName?(x=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(d,{size:12,className:c.iconClassName})}),e[5]=d,e[6]=c.iconClassName,e[7]=x):x=e[7];let g;e[8]!==u?(g=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover/group:opacity-100",children:u?s.jsx(_n,{size:14}):s.jsx(bs,{size:14})}),e[8]=u,e[9]=g):g=e[9];let b;e[10]!==x||e[11]!==g?(b=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,g]}),e[10]=x,e[11]=g,e[12]=b):b=e[12];let j;e[13]!==c.label?(j=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=j):j=e[14];let y;e[15]!==r.length?(y=s.jsx("div",{className:"size-5 shrink-0 flex items-center justify-center",children:s.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.length})}),e[15]=r.length,e[16]=y):y=e[16];let v;e[17]!==u||e[18]!==h||e[19]!==p||e[20]!==b||e[21]!==j||e[22]!==y?(v=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:h,onKeyDown:p,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[b,j,y]}),e[17]=u,e[18]=h,e[19]=p,e[20]=b,e[21]=j,e[22]=y,e[23]=v):v=e[23];let _;e[24]!==o||e[25]!==u||e[26]!==a||e[27]!==l||e[28]!==i||e[29]!==n||e[30]!==r?(_=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(Ta,{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a})}),e[24]=o,e[25]=u,e[26]=a,e[27]=l,e[28]=i,e[29]=n,e[30]=r,e[31]=_):_=e[31];let k;return e[32]!==v||e[33]!==_?(k=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[v,_]}),e[32]=v,e[33]=_,e[34]=k):k=e[34],k}function Aa(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,renderGroup:a}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==l||e[3]!==r||e[4]!==i||e[5]!==a?(c=s.jsx(qn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:l,surface:"expanded",renderGroup:a,renderFixed:Oa,renderSortable:za}),e[0]=o,e[1]=n,e[2]=l,e[3]=r,e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function za(t,e){return s.jsx(Kn,{...t,sortable:e},t.virtualMcpId)}function Oa(t){return s.jsx(Kn,{...t},t.virtualMcpId)}function Pa(t,e,n,r){return[t.orgId,t.userId,r,n.slice().sort().join(","),e.map(o=>o.virtualMcpId).sort().join(",")].join("|")}function Da(t,e,n,r,o){const i=N.c(5),l=Pa(t,e,r,o),[a,c]=z.useState("");a!==l&&(bo(t,e,n,r),c(l));let d;return i[0]!==n||i[1]!==r||i[2]!==t||i[3]!==e?(d=jo(t,e,n,r),i[0]=n,i[1]=r,i[2]=t,i[3]=e,i[4]=d):d=i[4],d}const Vn={all:"All tasks",manual:"Chats",automation:"Automation"},Yn={all:"All members",mine:"Mine only"},qs={agent:"Agent",status:"Status"};function Xn(t){const e=N.c(95);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{onNavigate:r}=n,{data:o}=we.useSession(),i=o?.user?.id,l=i??"anon",{org:a}=ue(),c=Lr(a.id).id,d=on(),{liveToDev:u,devToLive:m}=Fo(d),f=un(d),h=Ll(),p=Hr();let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x={},e[2]=x):x=e[2];const[g,b]=z.useState(x),j=new Set(f),y={},v=[];let _;e[3]!==g?(_=Object.entries(g),e[3]=g,e[4]=_):_=e[4];for(const[w,q]of _)j.has(w)!==q?y[w]=q:v.push(w);v.length>0&&b(w=>{const q={...w};for(const te of v)delete q[te];return q});const k=new Set(f);for(const[w,q]of Object.entries(y))q?k.add(w):k.delete(w);const S=[...k],I=new Set(S),{threads:T}=cn(),$=T.filter(Wa),{hide:O}=an(),A=Ee(),{setTaskId:C,createNewTask:M}=dn();let K;e[5]===Symbol.for("react.memo_cache_sentinel")?(K={strict:!1},e[5]=K):K=e[5];const E=Ys(K).taskId??null;let L;e[6]!==r?(L=()=>{r?.()},e[6]=r,e[7]=L):L=e[7];const R=L,H=[...$].sort(qa),[P,G]=z.useState("all"),[D,B]=z.useState("mine"),[F,Y]=z.useState("agent"),[Z,V]=z.useState(!1),[J,X]=z.useState(!1),[W,ne]=z.useState(0),ie=vo(),ce=W+ie;let se;e[8]!==a.id||e[9]!==l?(se={orgId:a.id,userId:l},e[8]=a.id,e[9]=l,e[10]=se):se=e[10];const re=se,le={type:P,member:D,currentUserId:i??null},me=la(H,"agent",le),oe=Da(re,yo(So(H,c),m),c,S,ce);let Ie;e[11]!==d?(Ie=new Set(d.map(Ua).filter(Ba)),e[11]=d,e[12]=Ie):Ie=e[12];const Fe=Ie,fe=oe.filter(w=>w.virtualMcpId===c||w.virtualMcpId===os||Fe.has(w.virtualMcpId));let Ge;e[13]!==i||e[14]!==D?(Ge=w=>D==="mine"&&i?w.filter(q=>q.created_by===i):w,e[13]=i,e[14]=D,e[15]=Ge):Ge=e[15];const pe=Ge;let be;e[16]!==P?(be=w=>P==="automation"?w.filter(Ha):P==="manual"?w.filter(La):w,e[16]=P,e[17]=be):be=e[17];const xe=be,Te=w=>{const q=w.id===E;if(O(w.id),!q)return;const te=H.find(de=>de.id!==w.id&&de.virtual_mcp_id===w.virtual_mcp_id&&de.created_by===i);R(),te?C(te.id,te.virtual_mcp_id):A({to:"/$org",params:{org:a.slug}})};let je;e[18]!==R||e[19]!==M?(je=w=>{ee("sidebar_group_new_clicked",{virtual_mcp_id:w}),R(),M(w)},e[18]=R,e[19]=M,e[20]=je):je=e[20];const Le=je,Se=_o();let He;e[21]!==R||e[22]!==Se?(He=w=>{ee("sidebar_group_settings_clicked",{virtual_mcp_id:w}),R(),Se(w,{search:{main:"instructions"}})},e[21]=R,e[22]=Se,e[23]=He):He=e[23];const Be=He,ht=w=>{if(I.has(w))return;ee("sidebar_group_hide_clicked",{virtual_mcp_id:w});const q=fe.find(te=>te.virtualMcpId===w);if(q)for(const te of q.threads)O(te.id);Co(re,w,S),ne(Ga)},Ue=async(w,q)=>{if(h&&y[w]===void 0){ee("sidebar_group_org_pin_toggled",{virtual_mcp_id:w,pinned:q}),b(te=>({...te,[w]:q}));try{await p.update.mutateAsync({id:w,data:{pinned:q}})}catch{wo(re,w,!q),b(te=>{const de={...te};return delete de[w],de})}}},qe=w=>{const q=w===c||w===os;return{isOrgPinned:q||I.has(w),canManageOrgPin:q?!1:h,onToggleOrgPin:q?void 0:Ue}},$e=w=>{const q=xe(pe(w.threads)),te=u.get(w.virtualMcpId)??null;return{virtualMcpId:w.virtualMcpId,threads:q,devPartnerId:te,devGroupVisibleCount:te?me.get(te)??0:0,activeTaskId:E,filters:le,groupVisibleCount:me.get(w.virtualMcpId)??0,onSelectTask:de=>{R(),C(de.id,de.virtual_mcp_id)},onArchiveTask:Te,onNewTaskInGroup:Le,onShowSettings:Be,onHideGroup:ht,...qe(w.virtualMcpId)}},ve=P!=="all"||D!=="mine",{state:We,isMobile:Ke}=Qe();if(We==="collapsed"&&!Ke){let w;e[24]!==ve||e[25]!==pe||e[26]!==xe?(w=ts=>{const Zn=xe(pe(ts.threads));return!(ve&&Zn.length===0)},e[24]=ve,e[25]=pe,e[26]=xe,e[27]=w):w=e[27];const q=fe.filter(w),te=F==="agent"&&fe.length===0;let de;e[28]!==te?(de=s.jsx(Is,{value:te}),e[28]=te,e[29]=de):de=e[29];let zt;return e[30]===Symbol.for("react.memo_cache_sentinel")?(zt=()=>ne(Fa),e[30]=zt):zt=e[30],s.jsxs(s.Fragment,{children:[de,s.jsx(Oe,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.jsx(va,{groups:q,orderScope:re,decopilotId:c,orgPinnedIds:S,onReorder:zt,renderGroup:ts=>$e(ts)})})]})}const ye="flex flex-col h-full min-h-0",Ve=F==="agent"&&fe.length===0;let _e;e[31]!==Ve?(_e=s.jsx(Is,{value:Ve}),e[31]=Ve,e[32]=_e):_e=e[32];let Ye;e[33]!==V?(Ye=()=>{ee("tasks_panel_search_opened"),X(!0),V(!0)},e[33]=V,e[34]=Ye):Ye=e[34];let Je;e[35]===Symbol.for("react.memo_cache_sentinel")?(Je=s.jsx(Qr,{size:16}),e[35]=Je):Je=e[35];let Xe;e[36]!==Ye?(Xe=s.jsx(ge,{"aria-label":"Search threads",onClick:Ye,children:Je}),e[36]=Ye,e[37]=Xe):Xe=e[37];const Xt=qs[F==="agent"?"status":"agent"];let yt;e[38]!==Xt?(yt=Xt.toLowerCase(),e[38]=Xt,e[39]=yt):yt=e[39];const Qt=`Group by ${yt}`,Jt=qs[F];let St;e[40]!==Jt?(St=Jt.toLowerCase(),e[40]=Jt,e[41]=St):St=e[41];const Zt=`Grouped by ${St}`;let Ze,et;e[42]!==F?(Ze=()=>{const w=F==="agent"?"status":"agent";ee("tasks_panel_group_by_changed",{to_value:w}),Y(w)},et=F==="agent"?s.jsx(ji,{size:16}):s.jsx(Jr,{size:16}),e[42]=F,e[43]=Ze,e[44]=et):(Ze=e[43],et=e[44]);let tt;e[45]!==Qt||e[46]!==Zt||e[47]!==Ze||e[48]!==et?(tt=s.jsx(ge,{"aria-label":Qt,title:Zt,onClick:Ze,children:et}),e[45]=Qt,e[46]=Zt,e[47]=Ze,e[48]=et,e[49]=tt):tt=e[49];let _t;e[50]===Symbol.for("react.memo_cache_sentinel")?(_t=s.jsx(bi,{size:16}),e[50]=_t):_t=e[50];let st;e[51]!==ve?(st=ve&&s.jsx("span",{className:"absolute top-0.5 right-0.5 size-2 rounded-full bg-red-500 ring-1 ring-sidebar pointer-events-none"}),e[51]=ve,e[52]=st):st=e[52];let nt;e[53]!==st?(nt=s.jsx(xt,{asChild:!0,children:s.jsxs(ge,{"aria-label":"Filter tasks",children:[_t,st]})}),e[53]=st,e[54]=nt):nt=e[54];let rt;e[55]!==D?(rt=w=>{const q=w;q!==D&&ee("tasks_panel_member_filter_changed",{to_value:q}),B(q)},e[55]=D,e[56]=rt):rt=e[56];let Nt;e[57]===Symbol.for("react.memo_cache_sentinel")?(Nt=s.jsx(zs,{size:"sm",className:"w-full",children:s.jsx(Os,{})}),e[57]=Nt):Nt=e[57];let Ct;e[58]===Symbol.for("react.memo_cache_sentinel")?(Ct=Object.keys(Yn),e[58]=Ct):Ct=e[58];let wt;e[59]===Symbol.for("react.memo_cache_sentinel")?(wt=s.jsx(As,{children:Ct.map(Ea)}),e[59]=wt):wt=e[59];let ot;e[60]!==D||e[61]!==rt?(ot=s.jsx(Ws,{label:"Members",children:s.jsxs(Ps,{value:D,onValueChange:rt,children:[Nt,wt]})}),e[60]=D,e[61]=rt,e[62]=ot):ot=e[62];let it;e[63]!==P?(it=w=>{const q=w;q!==P&&ee("tasks_panel_filter_changed",{to_value:q}),G(q)},e[63]=P,e[64]=it):it=e[64];let kt;e[65]===Symbol.for("react.memo_cache_sentinel")?(kt=s.jsx(zs,{size:"sm",className:"w-full",children:s.jsx(Os,{})}),e[65]=kt):kt=e[65];let It;e[66]===Symbol.for("react.memo_cache_sentinel")?(It=Object.keys(Vn),e[66]=It):It=e[66];let Tt;e[67]===Symbol.for("react.memo_cache_sentinel")?(Tt=s.jsx(As,{children:It.map(Ra)}),e[67]=Tt):Tt=e[67];let lt;e[68]!==it||e[69]!==P?(lt=s.jsx(Ws,{label:"Type",children:s.jsxs(Ps,{value:P,onValueChange:it,children:[kt,Tt]})}),e[68]=it,e[69]=P,e[70]=lt):lt=e[70];let at;e[71]!==ot||e[72]!==lt?(at=s.jsx(Ut,{align:"start",sideOffset:8,collisionPadding:16,className:"w-72 p-3",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[ot,lt]})}),e[71]=ot,e[72]=lt,e[73]=at):at=e[73];let ct;e[74]!==nt||e[75]!==at?(ct=s.jsxs(Bt,{children:[nt,at]}),e[74]=nt,e[75]=at,e[76]=ct):ct=e[76];let dt;e[77]!==Xe||e[78]!==tt||e[79]!==ct?(dt=s.jsxs("div",{className:"flex items-center gap-0.5",children:[Xe,tt,ct]}),e[77]=Xe,e[78]=tt,e[79]=ct,e[80]=dt):dt=e[80];let $t;e[81]===Symbol.for("react.memo_cache_sentinel")?($t=s.jsx(Nn,{compact:!0}),e[81]=$t):$t=e[81];let ut;e[82]!==dt?(ut=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[dt,$t]}),e[82]=dt,e[83]=ut):ut=e[83];const Jn="flex-1 min-h-0 overflow-y-auto overscroll-contain flex flex-col gap-0.5 -mr-2 pr-2",es=F==="status"?s.jsx(s.Fragment,{children:No(xe(pe(H))).map(w=>s.jsx($a,{status:w.status,threads:w.threads,activeTaskId:E,onSelectTask:q=>{R(),C(q.id,q.virtual_mcp_id)},onArchiveTask:Te,filters:le},w.status))}):s.jsx(Aa,{groups:fe,orderScope:re,decopilotId:c,orgPinnedIds:S,onReorder:()=>ne(Ma),renderGroup:w=>({...$e(w)})});let mt;e[84]!==es?(mt=s.jsx("div",{className:Jn,children:es}),e[84]=es,e[85]=mt):mt=e[85];let ft;e[86]!==J||e[87]!==Z||e[88]!==V?(ft=J&&s.jsx(Fl,{open:Z,onOpenChange:V}),e[86]=J,e[87]=Z,e[88]=V,e[89]=ft):ft=e[89];let At;return e[90]!==_e||e[91]!==ut||e[92]!==mt||e[93]!==ft?(At=s.jsxs("div",{className:ye,children:[_e,ut,mt,ft]}),e[90]=_e,e[91]=ut,e[92]=mt,e[93]=ft,e[94]=At):At=e[94],At}function Ma(t){return t+1}function Ra(t){return s.jsx(gn,{value:t,children:Vn[t]},t)}function Ea(t){return s.jsx(gn,{value:t,children:Yn[t]},t)}function Fa(t){return t+1}function Ga(t){return t+1}function La(t){return!t.trigger_id}function Ha(t){return!!t.trigger_id}function Ba(t){return!!t}function Ua(t){return t.id}function qa(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Wa(t){return!t.hidden}function Ws(t){const e=N.c(7),{label:n,children:r}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==r?(i=s.jsx("div",{className:"w-36 shrink-0",children:r}),e[2]=r,e[3]=i):i=e[3];let l;return e[4]!==o||e[5]!==i?(l=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,i]}),e[4]=o,e[5]=i,e[6]=l):l=e[6],l}const Ka=5,Va=[{nameWidth:"w-24",taskRows:2},{nameWidth:"w-28",taskRows:0},{nameWidth:"w-20",taskRows:1},{nameWidth:"w-32",taskRows:0},{nameWidth:"w-24",taskRows:0}];function Qn(){const t=N.c(3),{state:e}=Qe();if(e==="collapsed"){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex flex-col gap-1.5",children:Array.from({length:Ka}).map(Qa)}),t[0]=o):o=t[0],o}let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Ne,{className:"size-6 rounded-md"}),s.jsx(Ne,{className:"size-6 rounded-md"}),s.jsx(Ne,{className:"size-6 rounded-md"})]}),s.jsx(Ne,{className:"h-6 w-20 rounded-md"})]}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[n,s.jsx("div",{className:"flex flex-col gap-0.5",children:Va.map(Ya)})]}),t[2]=r):r=t[2],r}function Ya(t,e){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx(Ne,{className:"size-5 rounded-full shrink-0"}),s.jsx(Ne,{className:Q("h-3",t.nameWidth,"rounded-sm")})]}),t.taskRows>0&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:Array.from({length:t.taskRows}).map(Xa)})]},e)}function Xa(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(Ne,{className:"h-3 flex-1 rounded-sm"})},e)}function Qa(t,e){return s.jsx(Ne,{className:"size-10 rounded-lg mx-auto"},e)}function Ja(){const t=N.c(4),e=Cn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Dl,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Js,{children:s.jsxs(z.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Rt,{className:"mb-2"}),s.jsx(Qn,{})]}),children:[s.jsx(Rt,{className:"mb-2"}),s.jsx(Xn,{})]})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsx(mn,{children:s.jsx(In,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=o):o=t[3],o}function Za(t){const e=N.c(9),{onClose:n}=t,r=Cn();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ml,{}),e[0]=o):o=e[0];let i,l;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(s.Fragment,{children:[s.jsx(Rt,{className:"mb-2"}),s.jsx(Qn,{})]}),l=s.jsx(Rt,{className:"mb-2"}),e[1]=i,e[2]=l):(i=e[1],l=e[2]);let a;e[3]!==n?(a=s.jsx(Js,{children:s.jsxs(z.Suspense,{fallback:i,children:[l,s.jsx(Xn,{onNavigate:n})]})}),e[3]=n,e[4]=a):a=e[4];let c;return e[5]!==n||e[6]!==r||e[7]!==a?(c=s.jsx(mn,{children:s.jsx(nl,{sections:r,onClose:n,footer:o,additionalContent:a})}),e[5]=n,e[6]=r,e[7]=a,e[8]=c):c=e[8],c}const ec="sidebar.open";function tc(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Di,{}),t[0]=e):e=t[0],e}function ou(){const t=N.c(24),e=ps(),[n,r]=us(ec,!1),{width:o,wrapperRef:i,onStartResize:l,resetWidth:a}=Fi();let c;t[0]!==e?(c=e?s.jsxs(ae.Header,{className:"grid-cols-1 px-1 pr-1",children:[s.jsxs("div",{className:"grid w-full grid-cols-[auto_auto_auto_1fr_auto_auto_auto] items-center gap-2",children:[s.jsx(ae.LogoLink,{}),s.jsx(Ns,{}),s.jsx(ls,{}),s.jsx("div",{"aria-hidden":!0,className:"min-w-0"}),s.jsx(ae.TogglesSlot,{}),s.jsx(ae.TabsSlot,{className:"min-w-0 justify-self-end"})]}),s.jsx(ae.CenterSlot,{}),s.jsx(ae.RightSlot,{})]}):s.jsxs(ae.Header,{children:[s.jsxs(ae.LeftColumn,{children:[s.jsx(ae.LogoLink,{}),s.jsx(Ns,{}),s.jsx("span",{className:"hidden md:contents",children:s.jsx(ae.Nav,{})}),s.jsx(ae.TogglesSlot,{}),s.jsx(ls,{})]}),s.jsx(ae.CenterSlot,{}),s.jsxs(ae.RightColumn,{children:[s.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end",children:s.jsx(ae.TabsSlot,{})}),s.jsx(ae.RightSlot,{})]})]}),t[0]=e,t[1]=c):c=t[1];const d=`${o}px`;let u;t[2]!==d?(u={"--sidebar-width":d,"--sidebar-width-icon":"3.5rem"},t[2]=d,t[3]=u):u=t[3];const m=u;let f;t[4]!==e||t[5]!==l||t[6]!==a?(f=!e&&s.jsxs(s.Fragment,{children:[s.jsx(Ja,{}),s.jsx(Mi,{onPointerDown:l,onDoubleClick:a})]}),t[4]=e,t[5]=l,t[6]=a,t[7]=f):f=t[7];let h;t[8]===Symbol.for("react.memo_cache_sentinel")?(h={background:"transparent",containerType:"inline-size"},t[8]=h):h=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ar,{className:"flex flex-col",style:h,children:s.jsx("div",{className:"flex flex-col h-full min-h-0",children:s.jsx("div",{className:"relative flex-1 min-h-0 flex flex-row",children:s.jsx(z.Suspense,{fallback:s.jsx(tc,{}),children:s.jsx(Ir,{})})})})}),t[9]=p):p=t[9];let x;t[10]!==m||t[11]!==f||t[12]!==i?(x=s.jsxs(zr,{ref:i,className:"flex-1 bg-sidebar relative min-h-0",style:m,children:[f,p]}),t[10]=m,t[11]=f,t[12]=i,t[13]=x):x=t[13];let g;t[14]!==e?(g=e&&s.jsx(Dr,{renderSidebar:sc}),t[14]=e,t[15]=g):g=t[15];let b;t[16]!==c||t[17]!==x||t[18]!==g?(b=s.jsx(xi,{children:s.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[c,x,g]})}),t[16]=c,t[17]=x,t[18]=g,t[19]=b):b=t[19];let j;return t[20]!==r||t[21]!==n||t[22]!==b?(j=s.jsx(so,{children:s.jsx(ae.Provider,{children:s.jsx(Or,{open:n,onOpenChange:r,children:b})})}),t[20]=r,t[21]=n,t[22]=b,t[23]=j):j=t[23],j}function sc(t){const{onClose:e}=t;return s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:s.jsx(Za,{onClose:e})})})}export{ou as default};
|