decocms 3.35.5 → 3.35.6
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-31UiSlWs.js → AlertCircle-BdxdLfMZ.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-G1K__Qxa.js → ArrowUpRight-D4WTYONo.js} +1 -1
- package/dist/client/assets/{Check-DMrKOk-W.js → Check-ByG0nAY6.js} +1 -1
- package/dist/client/assets/{CheckCircle-CuJANkMl.js → CheckCircle-C-upsPdg.js} +1 -1
- package/dist/client/assets/{ChevronDown-DSz5ssPm.js → ChevronDown-BnRC7SrH.js} +1 -1
- package/dist/client/assets/{ChevronLeft-CkSAs92L.js → ChevronLeft-C70Azurf.js} +1 -1
- package/dist/client/assets/{ChevronRight-C1PAq-Un.js → ChevronRight--j_9x5Si.js} +1 -1
- package/dist/client/assets/{ChevronUp-BWqHruLj.js → ChevronUp-BQorkh2i.js} +1 -1
- package/dist/client/assets/{Container-1Pc_HrQZ.js → Container-DxN5v3U8.js} +1 -1
- package/dist/client/assets/{DotsVertical-DNK31xsE.js → DotsVertical-C3W2s3WW.js} +1 -1
- package/dist/client/assets/{Eye-CEpp0ZmO.js → Eye-i6HoqOn_.js} +1 -1
- package/dist/client/assets/{FilterLines-DwhZZBde.js → FilterLines-D6io39CJ.js} +1 -1
- package/dist/client/assets/{Globe01-D9mPWR46.js → Globe01-BoP8H_NZ.js} +1 -1
- package/dist/client/assets/{HardDrive-D_47h0Zh.js → HardDrive-DQcSGPZL.js} +1 -1
- package/dist/client/assets/{Key01-CLgAA9v8.js → Key01-BY8TiIH_.js} +1 -1
- package/dist/client/assets/{LayoutLeft-B6ukWLii.js → LayoutLeft-Dk1audj-.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CArzLSWR.js → LinkExternal01-Cv2RkpjT.js} +1 -1
- package/dist/client/assets/{Monitor01-BKZNr1y2.js → Monitor01-CoO9QmCK.js} +1 -1
- package/dist/client/assets/{Palette-BF9pRUee.js → Palette-deno1eEN.js} +1 -1
- package/dist/client/assets/{Play-9jeaOjjI.js → Play-pWfjHR9I.js} +1 -1
- package/dist/client/assets/{Plus-B0pI-EF4.js → Plus-Ca-boKc-.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-fdpiitBO.js → RefreshCcw01-m0oFG4br.js} +1 -1
- package/dist/client/assets/{SearchMd-CkLHWWX8.js → SearchMd-BTjnXp3X.js} +1 -1
- package/dist/client/assets/{Settings02-CFECC-IR.js → Settings02-DQ3JZYho.js} +1 -1
- package/dist/client/assets/{Shield01-B0ODXcZU.js → Shield01-BqgQ6O-B.js} +1 -1
- package/dist/client/assets/{Star01-W-0rzL-U.js → Star01-BI7rxnuz.js} +1 -1
- package/dist/client/assets/{Stars01-BaynVBty.js → Stars01-CbPlZD94.js} +1 -1
- package/dist/client/assets/{Stars02-BF-WR3Hf.js → Stars02-Ba384PUK.js} +1 -1
- package/dist/client/assets/{Sun-Bo0dXdnq.js → Sun-BB5ryFYp.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CHYIr3hf.js → SwitchHorizontal01-C2a9MjMN.js} +1 -1
- package/dist/client/assets/{Tool01-CfeyKXsn.js → Tool01-DiJPRujJ.js} +1 -1
- package/dist/client/assets/{Trash01-C5WgD7p-.js → Trash01-hWwpO1I_.js} +1 -1
- package/dist/client/assets/{Upload01-CRDtP4E8.js → Upload01-tMokiVUz.js} +1 -1
- package/dist/client/assets/{User01-BQUcDlD0.js → User01-qxhPSUm_.js} +1 -1
- package/dist/client/assets/{Users01-BIvCNTO4.js → Users01-DgDkNrBR.js} +1 -1
- package/dist/client/assets/{Users03-C8p6m2i2.js → Users03-dk6WdPnC.js} +1 -1
- package/dist/client/assets/{X-GmOf9On8.js → X-BgQLDqpQ.js} +1 -1
- package/dist/client/assets/{XCircle-DJ0Z1ta2.js → XCircle-Dz_GlHY5.js} +1 -1
- package/dist/client/assets/{XClose-DBvKjQIP.js → XClose-C4uc8l11.js} +1 -1
- package/dist/client/assets/{Zap-CLcQM9Lj.js → Zap-BAnl3IBe.js} +1 -1
- package/dist/client/assets/{ZapSquare-ntafTdnL.js → ZapSquare-CSP4r4PP.js} +1 -1
- package/dist/client/assets/{ZoomOut-C1WJJ4Yu.js → ZoomOut-BANb87-i.js} +1 -1
- package/dist/client/assets/{access-gate-DKAVTAGp.js → access-gate-D8GfJliw.js} +1 -1
- package/dist/client/assets/{accordion-OXCrOz9V.js → accordion-CvUJVGp7.js} +1 -1
- package/dist/client/assets/{add-section-modal-CnFR7Jvo.js → add-section-modal-C8zkVp8O.js} +1 -1
- package/dist/client/assets/{agent-capabilities-Bl046QMJ.js → agent-capabilities-C4o9Cucl.js} +1 -1
- package/dist/client/assets/{agent-icon-CwVKOe-B.js → agent-icon-BZpQDAZU.js} +1 -1
- package/dist/client/assets/{agents-list-D7TWNFAz.js → agents-list-Cy5LjlS-.js} +1 -1
- package/dist/client/assets/{ai-providers-CSkxv_Yc.js → ai-providers-C40CpsyS.js} +1 -1
- package/dist/client/assets/{alert-C-_lRQKh.js → alert-DOmmOyvz.js} +1 -1
- package/dist/client/assets/{alert-dialog-CGdurjbG.js → alert-dialog-RhxX9i57.js} +1 -1
- package/dist/client/assets/app-editor-B8xTj7FL.js +1 -0
- package/dist/client/assets/{auth-BEpSX7Q8.js → auth-BnAEjx9j.js} +1 -1
- package/dist/client/assets/{auth-catchall-sWwZuUW_.js → auth-catchall-DHkZ39dF.js} +1 -1
- package/dist/client/assets/{auth-split-layout-K8jpuXO2.js → auth-split-layout-B2Ec4bNy.js} +1 -1
- package/dist/client/assets/{automation-list-row-CqYTZ9yK.js → automation-list-row-CwvON8r0.js} +1 -1
- package/dist/client/assets/{automation-runs-CQf74tLw.js → automation-runs-BqzjGjNJ.js} +1 -1
- package/dist/client/assets/{automations-B6ZxKlJf.js → automations-D_H0Rurs.js} +1 -1
- package/dist/client/assets/{avatar-BkJDGlfl.js → avatar-B05K9npJ.js} +1 -1
- package/dist/client/assets/{badge-C3P3tlBP.js → badge-DepW8zMP.js} +1 -1
- package/dist/client/assets/{brand-context-DBB5n2Li.js → brand-context-Ded1_fcJ.js} +1 -1
- package/dist/client/assets/{buckets-SEiqieWV.js → buckets-C_lb2aFH.js} +1 -1
- package/dist/client/assets/{calendar-j-vOob4B.js → calendar-cx7Wk4XQ.js} +1 -1
- package/dist/client/assets/{capability-load-error-DgQrAAAc.js → capability-load-error-CXftmPyi.js} +1 -1
- package/dist/client/assets/{card-jKA-euu5.js → card-Dzpiviva.js} +1 -1
- package/dist/client/assets/{chat-context-DsjMikdi.js → chat-context-XxWcMKnK.js} +1 -1
- package/dist/client/assets/{checkbox-e4_po5HP.js → checkbox-CiQiAC_1.js} +1 -1
- package/dist/client/assets/{cli-auth-success-WJNdQhKb.js → cli-auth-success-CEKtx_Vg.js} +1 -1
- package/dist/client/assets/{collection-detail-DG5zKomI.js → collection-detail-BQk4HFTt.js} +1 -1
- package/dist/client/assets/{collection-display-button-syPP49Ut.js → collection-display-button-D3ZkpQKX.js} +1 -1
- package/dist/client/assets/{collection-search-nbxNvWqk.js → collection-search-DGxm46jw.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BRc74VvZ.js → collection-table-wrapper-NdiTX7ev.js} +1 -1
- package/dist/client/assets/{collection-tabs-BKbYeJdR.js → collection-tabs-D8b9Fop0.js} +1 -1
- package/dist/client/assets/{collections-CXoTtMtF.js → collections-DQTIJ43Y.js} +1 -1
- package/dist/client/assets/{command-D_Z2UBVN.js → command-Dw0cdU7u.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-DmEexrvB.js → connect-desktop-dialog-DaREkv_h.js} +1 -1
- package/dist/client/assets/{connection-card-DNKrdo60.js → connection-card-BFSKgi5D.js} +1 -1
- package/dist/client/assets/{connection-detail-D98IvWF5.js → connection-detail-DBWKbL6I.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CCU5G4sF.js → connection-form-helpers-CxYh53Ie.js} +1 -1
- package/dist/client/assets/{connections-3Iki5Fsy.js → connections-BN1ltLel.js} +1 -1
- package/dist/client/assets/{decopilot-BlSXmqcC.js → decopilot-CauvA-RH.js} +1 -1
- package/dist/client/assets/decopilot-sse-pool-sjWpsyX0.js +1 -0
- package/dist/client/assets/{dialog-DcBsN8pA.js → dialog-NbvuzXZV.js} +1 -1
- package/dist/client/assets/{domain-settings-BjMHkMu1.js → domain-settings-9eHrDjOq.js} +1 -1
- package/dist/client/assets/{drawer-BF8jsFPS.js → drawer-5hzhUed3.js} +1 -1
- package/dist/client/assets/{dropdown-menu-84bkXD1e.js → dropdown-menu-DDfjivGs.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-F1V_m8d8.js → dynamic-plugin-layout-Dj2EKcNP.js} +1 -1
- package/dist/client/assets/{empty-state-BxCy5Jed.js → empty-state-DMm5rF2F.js} +1 -1
- package/dist/client/assets/{empty-state-w5S4fPAi.js → empty-state-DgV0_vqZ.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DfBP_Vx6.js → extract-connection-data-EC8TuVkD.js} +1 -1
- package/dist/client/assets/{features-DfwmM51Q.js → features-sC0fOIy5.js} +1 -1
- package/dist/client/assets/{file-explorer-DaC31Uw6.js → file-explorer-DQiHabun.js} +1 -1
- package/dist/client/assets/{file-type-icon-CV4uwJNf.js → file-type-icon-evaVS-14.js} +1 -1
- package/dist/client/assets/{files-9dKCDrVh.js → files-DwL8E8iE.js} +1 -1
- package/dist/client/assets/{form-D8mDeRl7.js → form-W67eg754.js} +1 -1
- package/dist/client/assets/{general-BO5waTVQ.js → general-B8hG16F1.js} +1 -1
- package/dist/client/assets/{generate-id-kBy7vya_.js → generate-id-CtRf6mq5.js} +1 -1
- package/dist/client/assets/{github-repo-picker-BvpkOeud.js → github-repo-picker-C38g29Tm.js} +1 -1
- package/dist/client/assets/{header-tab-button-8Sc8XWve.js → header-tab-button-Dj8caQW7.js} +1 -1
- package/dist/client/assets/{hover-card-BZHgt6ym.js → hover-card-CaSThHdV.js} +1 -1
- package/dist/client/assets/{image-field-Cct-NRLT.js → image-field-C_iu9B-F.js} +1 -1
- package/dist/client/assets/{index-Bi2v8k7C.js → index-01Gl_fY8.js} +1 -1
- package/dist/client/assets/{index-rCN6Ye4g.js → index-B6xiIBRQ.js} +1 -1
- package/dist/client/assets/{index-Nu78oYuC.js → index-BV8QivMR.js} +4 -4
- package/dist/client/assets/{index-Dnto8xfU.js → index-BZnUBmmZ.js} +1 -1
- package/dist/client/assets/{index-BWljFL9N.js → index-BkuSFeLL.js} +1 -1
- package/dist/client/assets/{index-BJyTPOe7.js → index-C4vgVevj.js} +1 -1
- package/dist/client/assets/{index-rGp3doXp.js → index-CBGRBCyz.js} +1 -1
- package/dist/client/assets/{index-DFqdRm0K.js → index-Cdks9-wg.js} +1 -1
- package/dist/client/assets/{index-CQlR4vxi.js → index-DcqdobGw.js} +1 -1
- package/dist/client/assets/{index-9V8HlnBp.js → index-DfRR0hsi.js} +1 -1
- package/dist/client/assets/{index-D3xBGq3E.js → index-Dhab5IT3.js} +1 -1
- package/dist/client/assets/{index-BUcOh30J.js → index-DxsS1HLy.js} +1 -1
- package/dist/client/assets/{index-Bunm6B_R.js → index-Uxmxa28N.js} +3 -3
- package/dist/client/assets/{index-Dp8I5tn7.js → index-k0w22874.js} +1 -1
- package/dist/client/assets/{index-Csw4OUms.js → index-qMRY8iiO.js} +1 -1
- package/dist/client/assets/{index-redirect-BiF4PKjU.js → index-redirect-1lsM3-Qy.js} +1 -1
- package/dist/client/assets/{input-CyOWZBj4.js → input-DV0lJPfu.js} +1 -1
- package/dist/client/assets/{integration-icon-BHB4BDVP.js → integration-icon-DOyf0ghu.js} +1 -1
- package/dist/client/assets/{label-BAIINde3.js → label-DsPCNyuh.js} +1 -1
- package/dist/client/assets/{layout-CMgptt9x.js → layout-UVx5jDOd.js} +1 -1
- package/dist/client/assets/{login-DZNNV5F1.js → login-Bdct1Ii1.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CYt2Zrqm.js → mcp-oauth-DPpOCiR5.js} +1 -1
- package/dist/client/assets/{members-C6D5IlRh.js → members-XFuvp9my.js} +1 -1
- package/dist/client/assets/{monaco-editor-ZR2lAisS.js → monaco-editor-CZjzwq84.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CpOeeH-N.js → monitoring-stats-row-fqGAHQb8.js} +1 -1
- package/dist/client/assets/{oauth-callback-DPClZAji.js → oauth-callback-Bi8QWPMB.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CGwLuPC_.js → oauth-callback-ai-provider-YEsxF-8E.js} +1 -1
- package/dist/client/assets/{onboarding-C88FAjK9.js → onboarding-DGKgKbZG.js} +1 -1
- package/dist/client/assets/{org-install-Cu7DZO4o.js → org-install-_XxJ_9mS.js} +1 -1
- package/dist/client/assets/{org-layout-BIjQFkC_.js → org-layout-Bi6c2nSE.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-BDInPhT1.js → org-plugin-layout-Bu5yRNW-.js} +1 -1
- package/dist/client/assets/{page-seo-form-C4S4h0It.js → page-seo-form-C2Ov8d3q.js} +1 -1
- package/dist/client/assets/page-seo-sheet-C6vH6UJp.js +1 -0
- package/dist/client/assets/{pair-D_5AYlMN.js → pair-QRwOdDMh.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-BymtBQkd.js → plugin-empty-state-CeoKe0Wm.js} +1 -1
- package/dist/client/assets/{plugin-header-BwAtgbi1.js → plugin-header-DZRx90au.js} +1 -1
- package/dist/client/assets/{plugin-layout-7gPT5bds.js → plugin-layout-Bao487f4.js} +1 -1
- package/dist/client/assets/{popover-CrLH6wKL.js → popover-Jfd2eq_a.js} +1 -1
- package/dist/client/assets/{post-editor-CS4o8d4k.js → post-editor-V4KLdisO.js} +1 -1
- package/dist/client/assets/{primitives-CTIOH0kq.js → primitives-DP2nN7Dh.js} +1 -1
- package/dist/client/assets/{profile-CuUuKgRl.js → profile-BCp6U0hU.js} +1 -1
- package/dist/client/assets/project-app-view-ovTBsThp.js +1 -0
- package/dist/client/assets/record-editor-Chg9OiEH.js +1 -0
- package/dist/client/assets/registry-DKSgHOjT.js +2 -0
- package/dist/client/assets/{registry-layout-DP_XX2oQ.js → registry-layout-DAbeFTO4.js} +1 -1
- package/dist/client/assets/{require-capability-CwUZ3ZpN.js → require-capability-5Ip6utE2.js} +1 -1
- package/dist/client/assets/{required-auth-layout-C06pvfa-.js → required-auth-layout-DwO_xi24.js} +1 -1
- package/dist/client/assets/{reset-password-BMNE5AYj.js → reset-password-BuhZ5TrW.js} +1 -1
- package/dist/client/assets/{resizable-DCuZsBlg.js → resizable-BWgnQBO-.js} +1 -1
- package/dist/client/assets/{roles-D5I3S8LX.js → roles-tdagbMJT.js} +1 -1
- package/dist/client/assets/save-referenced-block-CHATKao2.js +1 -0
- package/dist/client/assets/{save-status-CXs50J0L.js → save-status-4ua9-mbv.js} +1 -1
- package/dist/client/assets/{schema-form-1CtN1Af7.js → schema-form-DaHWFhOC.js} +1 -1
- package/dist/client/assets/{scroll-area-BSoiojrs.js → scroll-area-B2oPO2DK.js} +1 -1
- package/dist/client/assets/{search-input-BXkfgyF5.js → search-input-BZZZVgMK.js} +1 -1
- package/dist/client/assets/{secrets-aDtkLJN1.js → secrets-ChCzyWyE.js} +1 -1
- package/dist/client/assets/{sections-editor-DudMoOI-.js → sections-editor-CDpSixQy.js} +1 -1
- package/dist/client/assets/{select-CFUImWa3.js → select-DV1FwAD4.js} +1 -1
- package/dist/client/assets/{select-model-DnWyHzYb.js → select-model-DSDBCN6l.js} +1 -1
- package/dist/client/assets/{seo-editor-g_NLEqG6.js → seo-editor-DRHmtRWo.js} +1 -1
- package/dist/client/assets/{settings-layout-yNEfQ0hX.js → settings-layout-ZDFB-szy.js} +1 -1
- package/dist/client/assets/{settings-section-Cr66nK1f.js → settings-section-BKgS_iJ4.js} +1 -1
- package/dist/client/assets/{sheet-D-Bc7_Zm.js → sheet-6C3p1ZVN.js} +1 -1
- package/dist/client/assets/{shell-controls-BRJxYV6k.js → shell-controls-CqpbaRS4.js} +1 -1
- package/dist/client/assets/{shell-layout-DQg6SF_u.js → shell-layout-OG_nqUcJ.js} +1 -1
- package/dist/client/assets/{shell-route-loading-CvUsiF-g.js → shell-route-loading-sAXWvXuw.js} +1 -1
- package/dist/client/assets/{sidebar-KNLjw0cP.js → sidebar-BThc8k1X.js} +1 -1
- package/dist/client/assets/{skeleton-1CAI_U0G.js → skeleton-7xZf6qTy.js} +1 -1
- package/dist/client/assets/{sortable.esm-ebM_sR4V.js → sortable.esm-D9tZZic5.js} +1 -1
- package/dist/client/assets/{spinner-DMOkK4rN.js → spinner-B4TZJa4Y.js} +1 -1
- package/dist/client/assets/{sso-B49rrps9.js → sso-BDMNdqrW.js} +1 -1
- package/dist/client/assets/{store-CA7nDwB7.js → store-DH5SX4uX.js} +1 -1
- package/dist/client/assets/store-registry-DMx_57j5.js +2 -0
- package/dist/client/assets/{studio-tools-DNrxjNDE.js → studio-tools-DUggrN6-.js} +1 -1
- package/dist/client/assets/{switch-DoZjY2Tt.js → switch-BSvxJWjO.js} +1 -1
- package/dist/client/assets/{tab-id-Dakz9RaE.js → tab-id-C8mEsBYo.js} +1 -1
- package/dist/client/assets/{table-B-2BVhG1.js → table-BzJvNvEf.js} +1 -1
- package/dist/client/assets/{tabs-Be-NM5w0.js → tabs-C6WaEkjB.js} +1 -1
- package/dist/client/assets/{task-status-D37SlJP8.js → task-status-BbAuY8YH.js} +1 -1
- package/dist/client/assets/{textarea-BevvTrh5.js → textarea-CnNOCR0A.js} +1 -1
- package/dist/client/assets/{toggle-group-D4uJyrio.js → toggle-group-DLEgMfd4.js} +1 -1
- package/dist/client/assets/{toolbar-B7jx3pih.js → toolbar-B_2b5mvX.js} +1 -1
- package/dist/client/assets/{tools-list-DEtO0B67.js → tools-list-Dmw1yj09.js} +1 -1
- package/dist/client/assets/{tooltip-GjOZYQ8y.js → tooltip-DIuu50IU.js} +1 -1
- package/dist/client/assets/{types-CWksqEvn.js → types-CKeTg986.js} +1 -1
- package/dist/client/assets/{use-ai-providers-B40EKvwY.js → use-ai-providers-BRyts0Gz.js} +1 -1
- package/dist/client/assets/{use-automations-CrB1TaDi.js → use-automations-BNu4-eYB.js} +1 -1
- package/dist/client/assets/{use-capability-4N7OGpDg.js → use-capability-CRoCvU0G.js} +1 -1
- package/dist/client/assets/{use-clock-tick-wMSMVaYN.js → use-clock-tick-DwZ4ZWpf.js} +1 -1
- package/dist/client/assets/{use-collections-DVr7byR-.js → use-collections-DfWTtTs9.js} +1 -1
- package/dist/client/assets/{use-connection-DW60FZqw.js → use-connection-DYCEDRZX.js} +1 -1
- package/dist/client/assets/{use-copy-DbBT4QKI.js → use-copy-CJfFxS8w.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-uWRf5VOn.js → use-create-virtual-mcp-mUufoSEk.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DNCcqNJD.js → use-debounced-autosave-C3pwZJGN.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CGHhwW8n.js → use-delete-connection-Dhw4ztJ-.js} +1 -1
- package/dist/client/assets/{use-file-configs-B1zo2Pd3.js → use-file-configs-DjBhVOXm.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-B89wcI1M.js → use-infinite-scroll-B_947odd.js} +1 -1
- package/dist/client/assets/{use-list-state-C6L50PlY.js → use-list-state-CP1Tc7ip.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BM3YiSU4.js → use-mcp-client-BcxxumZr.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BOYj54GW.js → use-mcp-prompts-Cy0GX04y.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Wj8cik0l.js → use-mcp-tools-BIoKMuS8.js} +1 -1
- package/dist/client/assets/{use-members-DPdDaD6V.js → use-members-CIJZJNZj.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-B2iVQ50f.js → use-navigate-to-agent-BlAYOqxb.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CbM9kTBH.js → use-org-auth-client-D8P8BtbO.js} +1 -1
- package/dist/client/assets/{use-org-sso-BvOYUCTs.js → use-org-sso-1XMjAhdy.js} +1 -1
- package/dist/client/assets/{use-organization-roles-D6dKeq_K.js → use-organization-roles-gt8o0u0P.js} +1 -1
- package/dist/client/assets/{use-organization-settings-B2apLDOa.js → use-organization-settings-BehduVMv.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BSOQq8Dk.js → use-registry-connections-D2zEHIac.js} +1 -1
- package/dist/client/assets/{use-secrets-Et7KNQ65.js → use-secrets-CdGKuher.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DJYbMhkn.js → use-status-sounds-B5sE5rmz.js} +1 -1
- package/dist/client/assets/{use-view-mode-DHW55QAY.js → use-view-mode-RJKP2uKb.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CP7vxTVw.js → use-virtual-mcp-Baf8z8om.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-2xSwq_xW.js +1 -0
- package/dist/client/assets/{useRouterState-Bo7wuie9.js → useRouterState-CajLqzv1.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CGWm3R_U.js +1 -0
- package/dist/client/assets/{user-mBm34PXf.js → user-BkGqIjD6.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CEt9OP51.js → view-mode-toggle-DsfhMQhu.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-CEb0SCvI.js → watch-sse-pool-B9jIyDHD.js} +1 -1
- package/dist/client/assets/{workflow-DjaQMg5O.js → workflow-DcrLJw-M.js} +1 -1
- package/dist/client/assets/workflow-detail-juad0-Hx.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/app-editor-BOZgdrpc.js +0 -1
- package/dist/client/assets/decopilot-sse-pool-CAMgyPwp.js +0 -1
- package/dist/client/assets/page-seo-sheet-OMzx3gOR.js +0 -1
- package/dist/client/assets/project-app-view-Dhe10uza.js +0 -1
- package/dist/client/assets/record-editor-Dei8zgG6.js +0 -1
- package/dist/client/assets/registry-CEymmNxt.js +0 -2
- package/dist/client/assets/save-referenced-block-7nrBneW-.js +0 -1
- package/dist/client/assets/store-registry-D4z60okB.js +0 -2
- package/dist/client/assets/useInfiniteQuery-D4JIfEjq.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D5py2D0S.js +0 -1
- package/dist/client/assets/workflow-detail-_YCY2MUW.js +0 -1
package/dist/client/assets/{shell-route-loading-CvUsiF-g.js → shell-route-loading-sAXWvXuw.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as N,c as K,j as s,l as Wt,r as $,t as J,p as xe,b as we,T as _s,K as qt,m as Vt,f as Te,g as Ns,d as Pn,I as Rn,U as Dn,W as En,P as Fn,R as Gn,H as Bn,G as Ln,a as Hn,B as $t,X as Un,Y as Kn,n as Ae,Z as Wn,$ as qn,a0 as Vn,F as Yn,a1 as Xn,a2 as Qn,a3 as Zn,a4 as Jn,a5 as xt,a6 as er,a7 as tr,a8 as sr,a9 as nr,aa as rr,ab as or,ac as Cs,ad as ir,ae as lr,af as ar,ag as cr,ah as dr,ai as ur,aj as mr,ak as fr,al as xr,am as hr,an as pr,o as gr,E as ws}from"./index-Bunm6B_R.js";import{u as br}from"./useRouterState-Bo7wuie9.js";import{c as jr,i as vr,a as yr}from"./ZoomOut-C1WJJ4Yu.js";import{u as Xe,c as he,d as Ie,e as zt,f as Pt,g as $e,h as ks,i as Is,j as Sr,k as _r,l as Lt}from"./sidebar-KNLjw0cP.js";import{T as ke}from"./toolbar-B7jx3pih.js";import{u as Ms,T as We,a as qe,b as Ve,c as ts}from"./tooltip-GjOZYQ8y.js";import{S as Ne}from"./skeleton-1CAI_U0G.js";import{P as Rt,a as ut,b as Dt}from"./popover-CrLH6wKL.js";import{b as As,a as $s,D as Os}from"./drawer-BF8jsFPS.js";import{i as Ts}from"./SearchMd-CkLHWWX8.js";import{s as Nr}from"./Star01-W-0rzL-U.js";import{s as Ce}from"./Plus-B0pI-EF4.js";import{i as Cr,g as wr}from"./use-mcp-client-BM3YiSU4.js";import{a as zs,u as ht,b as kr}from"./use-virtual-mcp-CP7vxTVw.js";import{u as Ir}from"./use-create-virtual-mcp-uWRf5VOn.js";import{I as Mr,a as Ar,u as $r,W as Or,H as Tr,S as zr,G as Pr}from"./github-repo-picker-BvpkOeud.js";import{A as Oe,W as ss,X as ns,Y as Ps,Z as Rr,_ as Dr,$ as Er}from"./agent-icon-CwVKOe-B.js";import{u as Rs,d as Fr,k as Ds}from"./tab-id-Dakz9RaE.js";import{r as Gr,a as Br,R as Lr,b as Hr,u as Es}from"./shell-layout-DQg6SF_u.js";import{u as Ur,g as Fs,a as Kr,b as Wr,s as qr,c as Vr,r as Yr,d as Xr,e as Qr,f as Zr,p as Jr,T as Gs,h as eo,i as to,j as so,k as no,l as ro,m as oo,n as io,o as lo,S as rs,q as Bs}from"./use-navigate-to-agent-B2iVQ50f.js";import{A as os}from"./avatar-BkJDGlfl.js";import{i as Ls}from"./Check-DMrKOk-W.js";import{a as is}from"./Eye-CEpp0ZmO.js";import{n as ao,i as co}from"./Globe01-D9mPWR46.js";import{i as uo,a as Hs}from"./ZapSquare-ntafTdnL.js";import{i as mo}from"./Monitor01-BKZNr1y2.js";import{n as fo,a as xo}from"./Sun-Bo0dXdnq.js";import{a as pt}from"./Settings02-CFECC-IR.js";import{i as ho}from"./Shield01-B0ODXcZU.js";import{a as po}from"./Users03-C8p6m2i2.js";import{s as Us}from"./XClose-DBvKjQIP.js";import{f as go,a as bo,b as jo,c as vo,d as yo,e as So,A as _o}from"./alert-dialog-CGdurjbG.js";import{F as No,a as Co,b as wo,c as ko,d as Io,e as Mo,f as Ao}from"./form-D8mDeRl7.js";import{I as $o}from"./input-CyOWZBj4.js";import{S as Oo}from"./spinner-DMOkK4rN.js";import"./index-rGp3doXp.js";import{i as To,a as zo}from"./RefreshCcw01-fdpiitBO.js";import{n as Yt}from"./Stars02-BF-WR3Hf.js";import{u as Ks,A as Ws,g as Po,a as Ro,b as ls,K as Do,P as Eo,s as Fo,S as Go,v as Bo,D as Lo,c as Ho,d as Uo,C as Ko}from"./sortable.esm-ebM_sR4V.js";import{i as Xt}from"./ChevronRight-C1PAq-Un.js";import{i as Wo}from"./FilterLines-DwhZZBde.js";import{t as qo}from"./Users01-BIvCNTO4.js";import{b as as,c as qs,S as cs,a as ds,d as us}from"./select-CFUImWa3.js";import{b as Vo,c as Yo,e as Xo,a as Qo,D as Zo}from"./dialog-DcBsN8pA.js";import{C as Jo,e as ei,c as ti,d as si,b as ni}from"./command-D_Z2UBVN.js";import{u as Vs}from"./studio-tools-DNrxjNDE.js";import{i as Ys}from"./Zap-CLcQM9Lj.js";import{u as ri}from"./use-org-auth-client-CbM9kTBH.js";import{H as oi,a as ii,b as li}from"./hover-card-BZHgt6ym.js";import{g as ai,S as ci}from"./task-status-D37SlJP8.js";import{u as di,f as ui}from"./use-clock-tick-wMSMVaYN.js";import{t as Xs}from"./ChevronDown-DSz5ssPm.js";function mi(t){const e=N.c(21),{value:n,onChange:r,placeholder:o,onKeyDown:i,className:a,isSearching:l,disabled:c}=t,d=o===void 0?"Search...":o;let u;e[0]!==a?(u=K("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=u):u=e[1];const m=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==m?(f=K("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=f):f=e[3];let g;e[4]!==l?(g=l?s.jsx(Wt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(Ts,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=l,e[5]=g):g=e[5];let h;e[6]!==r?(h=b=>r(b.target.value),e[6]=r,e[7]=h):h=e[7];let x;e[8]!==c||e[9]!==i||e[10]!==d||e[11]!==h||e[12]!==n?(x=s.jsx("input",{type:"text",value:n,onChange:h,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]=h,e[12]=n,e[13]=x):x=e[13];let p;e[14]!==f||e[15]!==g||e[16]!==x?(p=s.jsxs("label",{className:f,children:[g,x]}),e[14]=f,e[15]=g,e[16]=x,e[17]=p):p=e[17];let v;return e[18]!==u||e[19]!==p?(v=s.jsx("div",{className:u,children:p}),e[18]=u,e[19]=p,e[20]=v):v=e[20],v}const fi="Select an existing agent";function xi(t){const e=N.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(We,{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(qe,{side:"right",sideOffset:8,children:fi}),e[2]=o):o=e[2];let i;return e[3]!==r?(i=s.jsxs(Ve,{defaultOpen:!0,delayDuration:0,children:[r,o]}),e[3]=r,e[4]=i):i=e[4],i}function hi(){const t=N.c(5),{enableDecoImport:e}=_s(),{data:n}=we.useSession();let r;t[0]!==n?.user?.email?(r=qt.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:pi,enabled:o,staleTime:3e5},t[2]=r,t[3]=o,t[4]=i):i=t[4];const{data:a}=Vt(i);return a?.isDecoUser??!1}async function pi(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function gi(t){const e=Te(),{create:n}=Rs(),{locator:r}=xe(),o=Ns({strict:!1}),i=Pn({strict:!1});return async a=>{const l=crypto.randomUUID(),c=a===i.virtualmcpid?Gr(t,r,o.taskId??""):null;try{await n({id:l,virtual_mcp_id:a,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:l},search:{virtualmcpid:a}})}}function bi(t){const e=N.c(9),{agent:n,onClick:r}=t;let o;e[0]!==n.icon||e[1]!==n.title?(o=s.jsx(Oe,{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 a;return e[5]!==r||e[6]!==o||e[7]!==i?(a=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]=a):a=e[8],a}function ji(t){const e=N.c(65),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:o}=t,[i,a]=$.useState(""),l=zs(),c=l??[],{org:d}=xe(),{data:u}=we.useSession(),m=u?.user?.id??"anon",f=Fs(l),g=Kr();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={navigateOnCreate:!0},e[0]=h):h=e[0];const{createVirtualMCP:x,isCreating:p}=Ir(h),{createFromTemplate:v,isCreating:b}=$r(),y=hi(),j=gi(d.slug),S=i.toLowerCase(),C=c.filter(vi).filter(ie=>!i||ie.title.toLowerCase().includes(S)),_=ie=>{Wr({orgId:d.id,userId:m},ie.id,f),g(),n(),a(""),j(ie.id)},I="flex flex-col max-h-[min(640px,80dvh)]";let k;e[1]!==i?(k=s.jsx(mi,{value:i,onChange:a,placeholder:"Search agents..."}),e[1]=i,e[2]=k):k=e[2];const A="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let O;e[3]===Symbol.for("react.memo_cache_sentinel")?(O=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]=O):O=e[3];const T="grid grid-cols-3 gap-1";let w;e[4]!==x||e[5]!==n?(w=async()=>{J("agent_create_new_clicked",{source:"browse_popover"}),await x(),n()},e[4]=x,e[5]=n,e[6]=w):w=e[6];let P,U;e[7]===Symbol.for("react.memo_cache_sentinel")?(P=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]=P,e[8]=U):(P=e[7],U=e[8]);let z;e[9]!==p||e[10]!==w?(z=s.jsxs("button",{type:"button",disabled:p,onClick:w,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:[P,U]}),e[9]=p,e[10]=w,e[11]=z):z=e[11];let G;e[12]!==v||e[13]!==n?(G=async()=>{J("agent_create_clicked",{source:"browse_popover",method:"website"}),await v(Or),n()},e[12]=v,e[13]=n,e[14]=G):G=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(Nr,{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 D;e[17]!==b||e[18]!==G?(D=s.jsxs("button",{type:"button",disabled:b,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:[R,H]}),e[17]=b,e[18]=G,e[19]=D):D=e[19];let E;e[20]!==v||e[21]!==n?(E=async()=>{J("agent_create_clicked",{source:"browse_popover",method:"hydrogen"}),await v(Tr),n()},e[20]=v,e[21]=n,e[22]=E):E=e[22];let B,F;e[23]===Symbol.for("react.memo_cache_sentinel")?(B=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:zr,alt:"",className:"size-5 object-contain"})}),F=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Shopify Headless Store"}),e[23]=B,e[24]=F):(B=e[23],F=e[24]);let q;e[25]!==b||e[26]!==E?(q=s.jsxs("button",{type:"button",disabled:b,onClick:E,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:[B,F]}),e[25]=b,e[26]=E,e[27]=q):q=e[27];let W;e[28]!==n||e[29]!==o?(W=()=>{J("agent_import_clicked",{source:"github"}),o(),n()},e[28]=n,e[29]=o,e[30]=W):W=e[30];let X,le;e[31]===Symbol.for("react.memo_cache_sentinel")?(X=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(Pr,{className:"size-5 text-muted-foreground"})}),le=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[31]=X,e[32]=le):(X=e[31],le=e[32]);let V;e[33]!==W?(V=s.jsxs("button",{type:"button",onClick:W,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[X,le]}),e[33]=W,e[34]=V):V=e[34];let Q;e[35]!==y||e[36]!==n||e[37]!==r?(Q=y&&s.jsxs("button",{type:"button",onClick:()=>{J("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]=Q):Q=e[38];const Y=C.map(ie=>s.jsx(bi,{agent:ie,onClick:()=>_(ie)},ie.id));let te;e[39]!==z||e[40]!==D||e[41]!==q||e[42]!==V||e[43]!==Q||e[44]!==Y?(te=s.jsxs("div",{className:T,children:[z,D,q,V,Q,Y]}),e[39]=z,e[40]=D,e[41]=q,e[42]=V,e[43]=Q,e[44]=Y,e[45]=te):te=e[45];let Z;e[46]!==p||e[47]!==i||e[48]!==C.length?(Z=C.length===0&&!p&&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]=p,e[47]=i,e[48]=C.length,e[49]=Z):Z=e[49];let se;e[50]!==te||e[51]!==Z||e[52]!==O?(se=s.jsxs("div",{className:A,children:[O,te,Z]}),e[50]=te,e[51]=Z,e[52]=O,e[53]=se):se=e[53];let ne;e[54]!==d.slug?(ne={org:d.slug},e[54]=d.slug,e[55]=ne):ne=e[55];let re;e[56]!==n?(re=()=>n(),e[56]=n,e[57]=re):re=e[57];let ee;e[58]!==ne||e[59]!==re?(ee=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Rn,{to:"/$org/settings/agents",params:ne,onClick:re,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[58]=ne,e[59]=re,e[60]=ee):ee=e[60];let de;return e[61]!==se||e[62]!==k||e[63]!==ee?(de=s.jsxs("div",{className:I,children:[k,se,ee]}),e[61]=se,e[62]=k,e[63]=ee,e[64]=de):de=e[64],de}function vi(t){return!Cr(t.id)}function Qs(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,a]=$.useState(!1),[l,c]=$.useState(!1),[d,u]=$.useState(!1),m=Ms(),{setOpenMobile:f}=Xe(),g=Ur(),h=g?"border border-border":void 0;let x;e[2]!==g?(x=k=>g?s.jsx(xi,{children:k}):k,e[2]=g,e[3]=x):x=e[3];const p=x;let v;e[4]!==m||e[5]!==f?(v=()=>{a(!1),m&&f(!1)},e[4]=m,e[5]=f,e[6]=v):v=e[6];const b=v;let y;e[7]!==b||e[8]!==i?(y=i&&s.jsx($.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(ji,{onClose:b,onOpenImportDeco:()=>c(!0),onOpenGithubImport:()=>{u(!0),b()}})}),e[7]=b,e[8]=i,e[9]=y):y=e[9];const j=y;let S;e[10]!==o||e[11]!==h||e[12]!==g||e[13]!==m||e[14]!==i||e[15]!==j||e[16]!==p?(S=m?s.jsxs(s.Fragment,{children:[o?p(s.jsx(ke,{"aria-label":"Browse agents",className:K(h),onClick:()=>{J("agent_browser_opened",{surface:"mobile_drawer"}),a(!0)},children:s.jsx(Ce,{className:"size-4"})})):s.jsx(he,{children:p(s.jsxs(Ie,{tooltip:g?void 0:"Browse agents",className:K(h),onClick:()=>{J("agent_browser_opened",{surface:"mobile_drawer"}),a(!0)},children:[s.jsx(Ce,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(As,{open:i,onOpenChange:a,direction:"bottom",children:s.jsxs($s,{className:"max-h-[85dvh] p-0",children:[s.jsx(Os,{className:"sr-only",children:"Browse agents"}),j]})})]}):s.jsxs(Rt,{open:i,onOpenChange:k=>{k&&!i&&J("agent_browser_opened",{surface:"desktop_popover"}),a(k)},children:[o?p(s.jsx(ut,{asChild:!0,children:s.jsx(ke,{"aria-label":"Browse agents",className:K(h),children:s.jsx(Ce,{className:"size-4"})})})):s.jsx(he,{children:p(s.jsx(ut,{asChild:!0,children:s.jsxs(Ie,{tooltip:g?void 0:"Browse agents",className:K(h),children:[s.jsx(Ce,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Dt,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:j})]}),e[10]=o,e[11]=h,e[12]=g,e[13]=m,e[14]=i,e[15]=j,e[16]=p,e[17]=S):S=e[17];let C;e[18]!==l?(C=s.jsx(Mr,{open:l,onOpenChange:c}),e[18]=l,e[19]=C):C=e[19];let _;e[20]!==d?(_=s.jsx(Ar,{open:d,onOpenChange:u}),e[20]=d,e[21]=_):_=e[21];let I;return e[22]!==S||e[23]!==C||e[24]!==_?(I=s.jsxs(s.Fragment,{children:[S,C,_]}),e[22]=S,e[23]=C,e[24]=_,e[25]=I):I=e[25],I}function Zs(){const t=N.c(24),{org:e}=xe(),n=Te(),o=br().location.pathname,i=e.slug,{state:a,isMobile:l}=Xe(),c=!l&&a==="collapsed";let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(jr,{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 g=f;let h;t[7]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(vr,{className:"size-4!"}),t[7]=h):h=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 p;t[11]!==n||t[12]!==i?(p=()=>{n({to:"/$org/files",params:{org:i}})},t[11]=n,t[12]=i,t[13]=p):p=t[13];let v;t[14]!==x||t[15]!==p?(v={key:"files",label:"Library",icon:h,isActive:x,onClick:p},t[14]=x,t[15]=p,t[16]=v):v=t[16];const b=v;let y;t[17]!==b||t[18]!==g?(y={type:"items",items:[g,b]},t[17]=b,t[18]=g,t[19]=y):y=t[19];let j;if(t[20]!==c||t[21]!==y){if(j=[y],c){let S;t[23]===Symbol.for("react.memo_cache_sentinel")?(S={type:"custom",key:"new-task",content:s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:s.jsx(Qs,{})})})})},t[23]=S):S=t[23],j.push(S)}t[20]=c,t[21]=y,t[22]=j}else j=t[22];return j}function Ot(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 a=o===void 0?"horizontal":o,l=i===void 0?!0:i;let c;e[5]!==n?(c=K("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]!==l||e[8]!==a||e[9]!==r||e[10]!==c?(d=s.jsx(Dn,{"data-slot":"separator-root",decorative:l,orientation:a,className:c,...r}),e[7]=l,e[8]=a,e[9]=r,e[10]=c,e[11]=d):d=e[11],d}function Js(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(zt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(Pt,{children:s.jsx($e,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function en(t){const e=N.c(18),{item:n}=t,{isMobile:r,setOpenMobile:o}=Xe();let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=()=>{J("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 a=i,l=n.key,c=n.isActive&&"z-10";let d;e[4]!==c?(d=K(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]!==a||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==u?(m=s.jsxs(Ie,{onClick:a,isActive:n.isActive,tooltip:n.label,children:[n.icon,u]}),e[8]=a,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},l),e[14]=n.key,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function yi(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(ks,{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(_i),e[2]=n.group.items,e[3]=i):i=e[3];let a;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(a=s.jsx(Js,{label:r,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=a):a=e[7],a}case"items":{let r;e[8]!==n.items?(r=n.items.map(Si),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}case"custom":return n.content}}function Si(t){return s.jsx(en,{item:t},t.key)}function _i(t){return s.jsx(en,{item:t},t.key)}function Ni(t){const e=N.c(14),{sections:n,footer:r,additionalContent:o,variant:i,contentClassName:a}=t,l=i===void 0?"sidebar":i;let c;e[0]!==a?(c=K("flex flex-col flex-1 px-2 py-2 gap-0.5",a),e[0]=a,e[1]=c):c=e[1];let d;e[2]!==n?(d=n.map(Ci),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(Is,{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]!==l?(f=s.jsxs(Sr,{variant:l,children:[m,r]}),e[10]=r,e[11]=m,e[12]=l,e[13]=f):f=e[13],f}function Ci(t,e){return s.jsx(yi,{section:t},e)}function tn(t){const e=N.c(2);let n;return e[0]!==t?(n=s.jsx(Ni,{...t}),e[0]=t,e[1]=n):n=e[1],n}tn.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 wi(){const t=N.c(7),n=_s().logo??En,r=typeof n=="string"?n:n.light,o=typeof n=="string"?n:n.dark;let i;t[0]!==r?(i=s.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=r,t[1]=i):i=t[1];let a;t[2]!==o?(a=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=o,t[3]=a):a=t[3];let l;return t[4]!==i||t[5]!==a?(l=s.jsxs(_r,{className:"flex flex-row items-center shrink-0 h-12 px-3 pb-0",children:[i,a]}),t[4]=i,t[5]=a,t[6]=l):l=t[6],l}function ms(t){const e=N.c(18),{item:n,onClose:r}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=K(o),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==n||e[3]!==r?(a=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=a):a=e[4];let l;e[5]!==n.icon?(l=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=l):l=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]!==a||e[12]!==l||e[13]!==c?(d=s.jsxs(Ie,{onClick:a,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[l,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=a,e[12]=l,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 ki(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(ks,{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 a;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],a=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=a}else a=e[4];let l;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==a?(l=s.jsx(Js,{label:o,defaultExpanded:i,children:a}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=a,e[10]=l):l=e[10],l}case"items":{let o;if(e[11]!==r||e[12]!==n.items){let a;e[14]!==r?(a=l=>s.jsx(ms,{item:l,onClose:r},l.key),e[14]=r,e[15]=a):a=e[15],o=n.items.map(a),e[11]=r,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function Ii(t){const e=N.c(14),{sections:n,onClose:r,footer:o,additionalContent:i}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx($.Suspense,{fallback:s.jsx("div",{className:"h-10 shrink-0"}),children:s.jsx(wi,{})}),e[0]=a):a=e[0];let l;if(e[1]!==r||e[2]!==n){let m;e[4]!==r?(m=(f,g)=>s.jsx(ki,{section:f,onClose:r},g),e[4]=r,e[5]=m):m=e[5],l=n.map(m),e[1]=r,e[2]=n,e[3]=l}else l=e[3];let c;e[6]!==i?(c=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[6]=i,e[7]=c):c=e[7];let d;e[8]!==l||e[9]!==c?(d=s.jsxs(Is,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[l,c]}),e[8]=l,e[9]=c,e[10]=d):d=e[10];let u;return e[11]!==o||e[12]!==d?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,d,o]}),e[11]=o,e[12]=d,e[13]=u):u=e[13],u}function sn(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Mi=Fn({name:Gn().min(2,"Organization name is required")});function Ai(t){const e=N.c(41),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={resolver:Bn(Mi),defaultValues:{name:""}},e[0]=o):o=e[0];const i=Ln(o);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={mutationFn:Oi,onSuccess:$i},e[1]=a):a=e[1];const l=Hn(a),c=l.error instanceof Error?l.error.message:l.error?"Failed to create organization.":null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(jo,{children:[s.jsx(vo,{children:"Create a new organization"}),s.jsx(yo,{children:"Set up a new organization to collaborate with others."})]}),e[2]=d):d=e[2];let u;if(e[3]!==l||e[4]!==i){let _;e[6]!==l?(_=I=>l.mutateAsync(I),e[6]=l,e[7]=_):_=e[7],u=i.handleSubmit(_),e[3]=l,e[4]=i,e[5]=u}else u=e[5];let m;e[8]!==i.formState.isSubmitting?(m=_=>{const{field:I}=_;return s.jsxs(wo,{children:[s.jsx(ko,{children:"Organization Name"}),s.jsx(Io,{children:s.jsx($o,{...I,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(Mo,{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:"","/",sn(I.value)]})]}),s.jsx(Ao,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==i.control||e[11]!==m?(f=s.jsx(No,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=f):f=e[12];let g;e[13]!==c?(g=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=g):g=e[14];let h;e[15]!==l||e[16]!==i?(h=()=>{l.reset(),i.reset()},e[15]=l,e[16]=i,e[17]=h):h=e[17];let x;e[18]!==i.formState.isSubmitting||e[19]!==h?(x=s.jsx(go,{disabled:i.formState.isSubmitting,onClick:h,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=h,e[20]=x):x=e[20];const p=!i.formState.isValid||i.formState.isSubmitting;let v;e[21]!==i.formState.isSubmitting?(v=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Oo,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=v):v=e[22];let b;e[23]!==p||e[24]!==v?(b=s.jsx($t,{type:"submit",variant:"default",disabled:p,children:v}),e[23]=p,e[24]=v,e[25]=b):b=e[25];let y;e[26]!==b||e[27]!==x?(y=s.jsxs(So,{children:[x,b]}),e[26]=b,e[27]=x,e[28]=y):y=e[28];let j;e[29]!==y||e[30]!==u||e[31]!==f||e[32]!==g?(j=s.jsxs("form",{className:"space-y-6",onSubmit:u,autoComplete:"off",children:[f,g,y]}),e[29]=y,e[30]=u,e[31]=f,e[32]=g,e[33]=j):j=e[33];let S;e[34]!==i||e[35]!==j?(S=s.jsxs(bo,{children:[d,s.jsx(Co,{...i,children:j})]}),e[34]=i,e[35]=j,e[36]=S):S=e[36];let C;return e[37]!==r||e[38]!==n||e[39]!==S?(C=s.jsx(_o,{open:n,onOpenChange:r,children:S}),e[37]=r,e[38]=n,e[39]=S,e[40]=C):C=e[40],C}function $i(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Oi(t){const e=sn(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 Ht(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 Ti(t){const e=N.c(13),{org:n,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",a=o==="xs"?"text-[9px]":"text-xs";let l;e[0]!==i?(l=K(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:Ht(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]!==a?(d=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:K("font-semibold leading-none",a),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=a,e[8]=d):d=e[8];let u;return e[9]!==l||e[10]!==c||e[11]!==d?(u=s.jsx("div",{className:l,style:c,children:d}),e[9]=l,e[10]=c,e[11]=d,e[12]=u):u=e[12],u}function wt(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 a;e[16]!==n.label?(a=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=a):a=e[17];let l;return e[18]!==o||e[19]!==i||e[20]!==a?(l=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,a]}),e[18]=o,e[19]=i,e[20]=a,e[21]=l):l=e[21],l}function fs(t){const e=N.c(31),{orgParam:n,onSelectOrg:r,onCreateOrg:o}=t,{data:i}=Vn();let a;e[0]!==n?(a=(w,P)=>w.slug===n?-1:P.slug===n?1:w.name.localeCompare(P.name),e[0]=n,e[1]=a):a=e[1];const l=[...i??[]].sort(a),[c,d]=$.useState(!1),[u,m]=$.useState(""),f=u.toLowerCase(),g=f?l.filter(w=>w.name.toLowerCase().includes(f)||w.slug.toLowerCase().includes(f)):l;let h;e[2]!==c?(h=function(){c&&m(""),d(zi)},e[2]=c,e[3]=h):h=e[3];const x=h;let p;e[4]!==u||e[5]!==c||e[6]!==x?(p=c?s.jsx("input",{autoFocus:!0,type:"text",value:u,onChange:w=>m(w.target.value),onKeyDown:w=>w.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]=p):p=e[7];let v;e[8]!==c?(v=c?s.jsx(Us,{size:16}):s.jsx(Ts,{size:16}),e[8]=c,e[9]=v):v=e[9];let b;e[10]!==v||e[11]!==x?(b=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:v}),e[10]=v,e[11]=x,e[12]=b):b=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 j;e[14]!==o?(j=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]=j):j=e[15];let S;e[16]!==b||e[17]!==j?(S=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[b,j]}),e[16]=b,e[17]=j,e[18]=S):S=e[18];let C;e[19]!==p||e[20]!==S?(C=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[p,S]}),e[19]=p,e[20]=S,e[21]=C):C=e[21];const _="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",I=g.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 k;e[22]!==r||e[23]!==n?(k=w=>s.jsxs("button",{type:"button",onClick:()=>r(w.slug),className:K("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",w.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(Ti,{org:w,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:w.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:w.slug})]}),w.slug===n&&s.jsx(Ls,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},w.id),e[22]=r,e[23]=n,e[24]=k):k=e[24];const A=g.map(k);let O;e[25]!==I||e[26]!==A?(O=s.jsxs("div",{className:_,children:[I,A]}),e[25]=I,e[26]=A,e[27]=O):O=e[27];let T;return e[28]!==O||e[29]!==C?(T=s.jsxs(s.Fragment,{children:[C,O]}),e[28]=O,e[29]=C,e[30]=T):T=e[30],T}function zi(t){return!t}function xs(t){const e=N.c(142),{user:n,userImage:r,menuItems:o,signOutItem:i,themeOptions:a,preferences:l,setPreferences:c,orgParam:d,onSelectOrg:u,onCreateOrg:m,close:f,isMobile:g,open:h}=t;if(g){const Y=n?.name??"U";let te;e[0]!==Y||e[1]!==r?(te=s.jsx(os,{url:r,fallback:Y,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=Y,e[1]=r,e[2]=te):te=e[2];const Z=n?.name??"User";let se;e[3]!==Z?(se=s.jsx("p",{className:"text-sm font-medium truncate",children:Z}),e[3]=Z,e[4]=se):se=e[4];const ne=n?.email;let re;e[5]!==ne?(re=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ne}),e[5]=ne,e[6]=re):re=e[6];let ee;e[7]!==se||e[8]!==re?(ee=s.jsxs("div",{className:"flex-1 min-w-0",children:[se,re]}),e[7]=se,e[8]=re,e[9]=ee):ee=e[9];let de;e[10]!==n?(de=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ei)},e[10]=n,e[11]=de):de=e[11];let ie;e[12]===Symbol.for("react.memo_cache_sentinel")?(ie=s.jsx(is,{size:14}),e[12]=ie):ie=e[12];let ze;e[13]!==de?(ze=s.jsx(We,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:de,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ie})}),e[13]=de,e[14]=ze):ze=e[14];let Pe;e[15]===Symbol.for("react.memo_cache_sentinel")?(Pe=s.jsx(qe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=Pe):Pe=e[15];let pe;e[16]!==ze?(pe=s.jsx(ts,{delayDuration:300,children:s.jsxs(Ve,{children:[ze,Pe]})}),e[16]=ze,e[17]=pe):pe=e[17];let Re;e[18]!==pe||e[19]!==te||e[20]!==ee?(Re=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[te,ee,pe]}),e[18]=pe,e[19]=te,e[20]=ee,e[21]=Re):Re=e[21];const mt=String(h);let De;e[22]!==m||e[23]!==u||e[24]!==d||e[25]!==mt?(De=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(fs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},mt)}),e[22]=m,e[23]=u,e[24]=d,e[25]=mt,e[26]=De):De=e[26];let Ee;if(e[27]!==f||e[28]!==o){let ue;e[30]!==f?(ue=He=>s.jsx(wt,{item:He,onClose:f},He.key),e[30]=f,e[31]=ue):ue=e[31],Ee=o.map(ue),e[27]=f,e[28]=o,e[29]=Ee}else Ee=e[29];let Me;e[32]!==f||e[33]!==i?(Me=s.jsx(wt,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=Me):Me=e[34];let ae;e[35]!==Ee||e[36]!==Me?(ae=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[Ee,Me]}),e[35]=Ee,e[36]=Me,e[37]=ae):ae=e[37];let Fe;e[38]!==De||e[39]!==ae?(Fe=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[De,ae]}),e[38]=De,e[39]=ae,e[40]=Fe):Fe=e[40];let Ge;if(e[41]!==l.theme||e[42]!==c||e[43]!==a){let ue;e[45]!==l.theme||e[46]!==c?(ue=He=>{const{value:_e,icon:Ue,label:Ke}=He;return s.jsx("button",{type:"button","aria-label":Ke,onClick:()=>c(Qe=>({...Qe,theme:_e})),className:K("size-8 rounded-md flex items-center justify-center transition-colors",l.theme===_e?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Ue},_e)},e[45]=l.theme,e[46]=c,e[47]=ue):ue=e[47],Ge=a.map(ue),e[41]=l.theme,e[42]=c,e[43]=a,e[44]=Ge}else Ge=e[44];let Ye;e[48]!==Ge?(Ye=s.jsx("div",{className:"flex items-center gap-0.5",children:Ge}),e[48]=Ge,e[49]=Ye):Ye=e[49];const ft=l.enableSounds?"Disable sounds":"Enable sounds";let ve;e[50]!==c?(ve=()=>c(Di),e[50]=c,e[51]=ve):ve=e[51];const ye=l.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let me;e[52]!==ye?(me=K("size-8 rounded-md flex items-center justify-center transition-colors",ye),e[52]=ye,e[53]=me):me=e[53];let ge;e[54]!==l.enableSounds?(ge=l.enableSounds?s.jsx(ss,{size:14}):s.jsx(ns,{size:14}),e[54]=l.enableSounds,e[55]=ge):ge=e[55];let fe;e[56]!==ft||e[57]!==ve||e[58]!==me||e[59]!==ge?(fe=s.jsx("button",{type:"button","aria-label":ft,onClick:ve,className:me,children:ge}),e[56]=ft,e[57]=ve,e[58]=me,e[59]=ge,e[60]=fe):fe=e[60];let Be;e[61]===Symbol.for("react.memo_cache_sentinel")?(Be=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.35.5"]}),e[61]=Be):Be=e[61];let be;e[62]!==fe?(be=s.jsxs("div",{className:"flex items-center gap-2",children:[fe,Be]}),e[62]=fe,e[63]=be):be=e[63];let Se;e[64]!==Ye||e[65]!==be?(Se=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ye,be]}),e[64]=Ye,e[65]=be,e[66]=Se):Se=e[66];let Le;return e[67]!==Re||e[68]!==Fe||e[69]!==Se?(Le=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[Re,Fe,Se]}),e[67]=Re,e[68]=Fe,e[69]=Se,e[70]=Le):Le=e[70],Le}const x=n?.name??"U";let p;e[71]!==x||e[72]!==r?(p=s.jsx(os,{url:r,fallback:x,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=x,e[72]=r,e[73]=p):p=e[73];const v=n?.name??"User";let b;e[74]!==v?(b=s.jsx("p",{className:"text-sm font-medium truncate",children:v}),e[74]=v,e[75]=b):b=e[75];const y=n?.email;let j;e[76]!==y?(j=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y}),e[76]=y,e[77]=j):j=e[77];let S;e[78]!==b||e[79]!==j?(S=s.jsxs("div",{className:"flex-1 min-w-0",children:[b,j]}),e[78]=b,e[79]=j,e[80]=S):S=e[80];let C;e[81]!==n?(C=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ri)},e[81]=n,e[82]=C):C=e[82];let _;e[83]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(is,{size:14}),e[83]=_):_=e[83];let I;e[84]!==C?(I=s.jsx(We,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:C,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:_})}),e[84]=C,e[85]=I):I=e[85];let k;e[86]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(qe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=k):k=e[86];let A;e[87]!==I?(A=s.jsx(ts,{delayDuration:300,children:s.jsxs(Ve,{children:[I,k]})}),e[87]=I,e[88]=A):A=e[88];let O;e[89]!==A||e[90]!==p||e[91]!==S?(O=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[p,S,A]}),e[89]=A,e[90]=p,e[91]=S,e[92]=O):O=e[92];let T;if(e[93]!==f||e[94]!==o){let Y;e[96]!==f?(Y=te=>s.jsx(wt,{item:te,onClose:f},te.key),e[96]=f,e[97]=Y):Y=e[97],T=o.map(Y),e[93]=f,e[94]=o,e[95]=T}else T=e[95];let w;e[98]!==f||e[99]!==i?(w=s.jsx(wt,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=w):w=e[100];let P;e[101]!==T||e[102]!==w?(P=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[T,w]}),e[101]=T,e[102]=w,e[103]=P):P=e[103];let U;if(e[104]!==l.theme||e[105]!==c||e[106]!==a){let Y;e[108]!==l.theme||e[109]!==c?(Y=te=>{const{value:Z,icon:se,label:ne}=te;return s.jsx("button",{type:"button","aria-label":ne,onClick:()=>c(re=>({...re,theme:Z})),className:K("size-7 rounded-md flex items-center justify-center transition-colors",l.theme===Z?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:se},Z)},e[108]=l.theme,e[109]=c,e[110]=Y):Y=e[110],U=a.map(Y),e[104]=l.theme,e[105]=c,e[106]=a,e[107]=U}else U=e[107];let z;e[111]!==U?(z=s.jsx("div",{className:"flex items-center gap-0.5",children:U}),e[111]=U,e[112]=z):z=e[112];const G=l.enableSounds?"Disable sounds":"Enable sounds";let R;e[113]!==c?(R=()=>c(Pi),e[113]=c,e[114]=R):R=e[114];const H=l.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let D;e[115]!==H?(D=K("size-7 rounded-md flex items-center justify-center transition-colors",H),e[115]=H,e[116]=D):D=e[116];let E;e[117]!==l.enableSounds?(E=l.enableSounds?s.jsx(ss,{size:14}):s.jsx(ns,{size:14}),e[117]=l.enableSounds,e[118]=E):E=e[118];let B;e[119]!==G||e[120]!==R||e[121]!==D||e[122]!==E?(B=s.jsx("button",{type:"button","aria-label":G,onClick:R,className:D,children:E}),e[119]=G,e[120]=R,e[121]=D,e[122]=E,e[123]=B):B=e[123];let F;e[124]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.35.5"]}),e[124]=F):F=e[124];let q;e[125]!==B?(q=s.jsxs("div",{className:"flex items-center gap-2",children:[B,F]}),e[125]=B,e[126]=q):q=e[126];let W;e[127]!==z||e[128]!==q?(W=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[z,q]}),e[127]=z,e[128]=q,e[129]=W):W=e[129];let X;e[130]!==O||e[131]!==P||e[132]!==W?(X=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[O,P,W]}),e[130]=O,e[131]=P,e[132]=W,e[133]=X):X=e[133];const le=String(h);let V;e[134]!==m||e[135]!==u||e[136]!==d||e[137]!==le?(V=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(fs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},le)}),e[134]=m,e[135]=u,e[136]=d,e[137]=le,e[138]=V):V=e[138];let Q;return e[139]!==X||e[140]!==V?(Q=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[X,V]}),e[139]=X,e[140]=V,e[141]=Q):Q=e[141],Q}function Pi(t){return{...t,enableSounds:!t.enableSounds}}function Ri(){Ae.success("User ID copied")}function Di(t){return{...t,enableSounds:!t.enableSounds}}function Ei(){Ae.success("User ID copied")}function Ut(){const t=N.c(44),{data:e}=we.useSession(),{org:n}=xe(),r=Te();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const a=Un(o)?.params.org,[l,c]=Kn(),d=Ms(),[u,m]=$.useState(!1),[f,g]=$.useState(!1),h=e?.user,x=h?.image;let p;t[1]!==r?(p=X=>{m(!1),r({to:"/$org",params:{org:X}})},t[1]=r,t[2]=p):p=t[2];const v=p;let b;t[3]===Symbol.for("react.memo_cache_sentinel")?(b=()=>m(!1),t[3]=b):b=t[3];const y=b;let j;t[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(pt,{size:16}),t[4]=j):j=t[4];let S;t[5]!==r||t[6]!==a?(S={key:"preferences",label:"Preferences",icon:j,onClick:()=>{r({to:"/$org/settings/profile",params:{org:a??""}})}},t[5]=r,t[6]=a,t[7]=S):S=t[7];let C;t[8]!==n||t[9]!==r?(C=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(ao,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[8]=n,t[9]=r,t[10]=C):C=t[10];let _;t[11]===Symbol.for("react.memo_cache_sentinel")?(_={key:"terms",label:"Terms of Use",icon:s.jsx(yr,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[11]=_):_=t[11];let I;t[12]===Symbol.for("react.memo_cache_sentinel")?(I={key:"privacy",label:"Privacy Policy",icon:s.jsx(ho,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[12]=I):I=t[12];let k;t[13]===Symbol.for("react.memo_cache_sentinel")?(k={key:"github",label:"decocms/studio",icon:s.jsx(Wn,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[13]=k):k=t[13];let A;t[14]===Symbol.for("react.memo_cache_sentinel")?(A={key:"community",label:"Community",icon:s.jsx(po,{size:16}),href:"https://decocms.com/discord",external:!0},t[14]=A):A=t[14];let O;t[15]===Symbol.for("react.memo_cache_sentinel")?(O={key:"homepage",label:"Homepage",icon:s.jsx(co,{size:16}),href:"https://decocms.com",external:!0},t[15]=O):O=t[15];let T;t[16]!==S||t[17]!==C?(T=[S,...C,_,I,k,A,O],t[16]=S,t[17]=C,t[18]=T):T=t[18];const w=T;let P;t[19]===Symbol.for("react.memo_cache_sentinel")?(P={key:"logout",label:"Sign out",icon:s.jsx(uo,{size:16}),onClick:Gi},t[19]=P):P=t[19];const U=P;let z;t[20]===Symbol.for("react.memo_cache_sentinel")?(z={value:"light",icon:s.jsx(fo,{size:14}),label:"Light theme"},t[20]=z):z=t[20];let G;t[21]===Symbol.for("react.memo_cache_sentinel")?(G={value:"dark",icon:s.jsx(xo,{size:14}),label:"Dark theme"},t[21]=G):G=t[21];let R;t[22]===Symbol.for("react.memo_cache_sentinel")?(R=[z,G,{value:"system",icon:s.jsx(mo,{size:14}),label:"System theme"}],t[22]=R):R=t[22];const H=R;let D;t[23]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{m(!1),g(!0)},t[23]=D):D=t[23];let E;t[24]!==v||t[25]!==d||t[26]!==w||t[27]!==u||t[28]!==a||t[29]!==l||t[30]!==c||t[31]!==h||t[32]!==x?(E={user:h,userImage:x,menuItems:w,signOutItem:U,themeOptions:H,preferences:l,setPreferences:c,orgParam:a,onSelectOrg:v,onCreateOrg:D,close:y,isMobile:d,open:u},t[24]=v,t[25]=d,t[26]=w,t[27]=u,t[28]=a,t[29]=l,t[30]=c,t[31]=h,t[32]=x,t[33]=E):E=t[33];const B=E;let F;t[34]!==n||t[35]!==d||t[36]!==u||t[37]!==B?(F=d?s.jsxs(As,{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:Ht(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($s,{className:"h-[80dvh] p-0",children:[s.jsx(Os,{className:"sr-only",children:"Account"}),s.jsx(xs,{...B})]})]}):s.jsxs(Rt,{open:u,onOpenChange:m,children:[s.jsx(ut,{asChild:!0,children:s.jsxs(Ie,{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:Ht(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(Dt,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:Fi,children:s.jsx(xs,{...B})})]}),t[34]=n,t[35]=d,t[36]=u,t[37]=B,t[38]=F):F=t[38];let q;t[39]!==f?(q=s.jsx(Ai,{open:f,onOpenChange:g}),t[39]=f,t[40]=q):q=t[40];let W;return t[41]!==F||t[42]!==q?(W=s.jsxs(s.Fragment,{children:[F,q]}),t[41]=F,t[42]=q,t[43]=W):W=t[43],W}function Fi(t){return t.preventDefault()}function Gi(){J("signed_out",{source:"account_popover"}),qn(),we.signOut()}function Bi({invitation:t}){const[e,n]=$.useState(!1),[r,o]=$.useState(!1),i=Yn(),a=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!"),Xn();let c;try{c=(await we.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},l=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($t,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:a,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(Ls,{size:14})}),s.jsx($t,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:l,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(Us,{size:14})})]})]})}function Li(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 a;e[2]!==n.eyebrow?(a=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=a):a=e[3];let l;e[4]!==n.title?(l=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=l):l=e[5];let c;e[6]!==a||e[7]!==l?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[a,l]}),e[6]=a,e[7]=l,e[8]=c):c=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Xt,{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 Hi(){const t=$.useContext(Qn),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function nn(){const t=N.c(10),{isSeen:e,markSeen:n,unseenCount:r}=Br(),o=Hi();let i;if(t[0]!==e||t[1]!==o){const c=[...o].sort(Wi).map(Ki);let d;t[3]!==e?(d=m=>({type:"release",release:m,isSeen:e(m.id)}),t[3]=e,t[4]=d):d=t[4];const u=[...Lr].sort(Ui).map(d);i=[...c,...u],t[0]=e,t[1]=o,t[2]=i}else i=t[2];const a=r+o.length;let l;return t[5]!==n||t[6]!==o||t[7]!==i||t[8]!==a?(l={items:i,pendingInvitations:o,redDotCount:a,markReleaseSeen:n},t[5]=n,t[6]=o,t[7]=i,t[8]=a,t[9]=l):l=t[9],l}function Ui(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function Ki(t){return{type:"invitation",invitation:t}}function Wi(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}class rn extends $.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 on(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function qi(){const t=N.c(17),e=Te(),{org:n}=xe(),{hasDecoKey:r,balanceDollars:o}=Ks();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 a;t[2]!==o?(a=K(o!=null&&on(o)),t[2]=o,t[3]=a):a=t[3];let l;t[4]!==e||t[5]!==n.slug?(l=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=l):l=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ps,{}),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]!==a||t[14]!==l||t[15]!==u?(m=s.jsx($e,{children:s.jsx(he,{children:s.jsxs(Ie,{tooltip:i,className:a,onClick:l,children:[c,u]})})}),t[12]=i,t[13]=a,t[14]=l,t[15]=u,t[16]=m):m=t[16],m}function Vi(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(rn,{children:s.jsx($.Suspense,{fallback:null,children:s.jsx(qi,{})})}),t[0]=e):e=t[0],e}function Yi(){const t=N.c(17),e=Te(),{org:n}=xe(),{hasDecoKey:r,balanceDollars:o}=Ks();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 a=i;let l;t[2]!==e||t[3]!==n.slug?(l=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[2]=e,t[3]=n.slug,t[4]=l):l=t[4];let c;t[5]!==o?(c=K(o!=null&&on(o)),t[5]=o,t[6]=c):c=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ps,{className:"size-4"}),t[7]=d):d=t[7];let u;t[8]!==l||t[9]!==c||t[10]!==a?(u=s.jsx(We,{asChild:!0,children:s.jsx(ke,{"aria-label":a,onClick:l,className:c,children:d})}),t[8]=l,t[9]=c,t[10]=a,t[11]=u):u=t[11];let m;t[12]!==a?(m=s.jsx(qe,{side:"top",children:a}),t[12]=a,t[13]=m):m=t[13];let f;return t[14]!==u||t[15]!==m?(f=s.jsxs(Ve,{delayDuration:300,children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16],f}function Xi(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(rn,{children:s.jsx($.Suspense,{fallback:null,children:s.jsx(Yi,{})})}),t[0]=e):e=t[0],e}function ln(t){const e=N.c(15),{children:n}=t,{items:r,markReleaseSeen:o}=nn(),[i,a]=$.useState(null);let l;if(e[0]!==r||e[1]!==i){let x;e[3]!==i?(x=p=>p.type==="release"&&p.release.id===i,e[3]=i,e[4]=x):x=e[4],l=r.find(x),e[0]=r,e[1]=i,e[2]=l}else l=e[2];const c=l,d=c?.type==="release"?c.release:null;let u;e[5]!==o?(u=x=>{a(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||a(null)},e[7]=f):f=e[7];let g;e[8]!==m||e[9]!==r||e[10]!==d?(g=s.jsx(Dt,{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($t,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>a(null),children:s.jsx(To,{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(Hr,{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(Yt,{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 and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:r.map(x=>x.type==="invitation"?s.jsx(Bi,{invitation:x.invitation},`inv-${x.invitation.id}`):s.jsx(Li,{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]=g):g=e[11];let h;return e[12]!==n||e[13]!==g?(h=s.jsxs(Rt,{onOpenChange:f,children:[n,g]}),e[12]=n,e[13]=g,e[14]=h):h=e[14],h}function an(){const{redDotCount:t}=nn();return t>0}function Qi(){const t=N.c(6),e=an();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Yt,{}),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(ln,{children:s.jsx(ut,{asChild:!0,children:s.jsxs(Ie,{tooltip:"Inbox",className:"relative",children:[n,r,o]})})}),t[4]=r,t[5]=i):i=t[5],i}function Zi(){const t=N.c(8),e=an();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Yt,{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(ut,{asChild:!0,children:s.jsx(We,{asChild:!0,children:s.jsxs(ke,{"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(qe,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let a;return t[6]!==o?(a=s.jsx(ln,{children:s.jsxs(Ve,{delayDuration:300,children:[o,i]})}),t[6]=o,t[7]=a):a=t[7],a}function Ji(){const t=N.c(3),[e,n]=$.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Ie,{tooltip:"Connections",onClick:()=>{J("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:[s.jsx(Hs,{}),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(Ws,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function el(){const t=N.c(3),[e,n]=$.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Ve,{delayDuration:300,children:[s.jsx(We,{asChild:!0,children:s.jsx(ke,{"aria-label":"Connections",onClick:()=>{J("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(Hs,{className:"size-4"})})}),s.jsx(qe,{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(Ws,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function tl(){const t=N.c(7),e=Te(),{org:n}=xe();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(pt,{}),i=s.jsx("span",{children:"Settings"}),t[3]=o,t[4]=i):(o=t[3],i=t[4]);let a;return t[5]!==r?(a=s.jsxs(Ie,{tooltip:"Settings",onClick:r,children:[o,i]}),t[5]=r,t[6]=a):a=t[6],a}function sl(){const t=N.c(9),e=Te(),{org:n}=xe();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(pt,{className:"size-4"}),t[3]=o):o=t[3];let i;t[4]!==r?(i=s.jsx(We,{asChild:!0,children:s.jsx(ke,{"aria-label":"Settings",onClick:r,children:o})}),t[4]=r,t[5]=i):i=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(qe,{side:"top",children:"Settings"}),t[6]=a):a=t[6];let l;return t[7]!==i?(l=s.jsxs(Ve,{delayDuration:300,children:[i,a]}),t[7]=i,t[8]=l):l=t[8],l}function nl(){const t=N.c(6),{state:e}=Xe();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Vi,{}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(he,{children:s.jsx(Ji,{})}),t[1]=i):i=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(he,{children:s.jsx(Qi,{})}),t[2]=a):a=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(he,{children:s.jsx(tl,{})}),t[3]=l):l=t[3];let c;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(Lt,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs($e,{children:[i,a,l,s.jsx(he,{children:s.jsx(Ut,{})})]})]}),t[4]=c):c=t[4],c}let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Lt,{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($e,{children:s.jsx(he,{children:s.jsx(Ut,{})})})}),s.jsx(sl,{}),s.jsx(Zi,{}),s.jsx(el,{}),s.jsx(Xi,{})]})}),t[5]=r):r=t[5],r}function rl(){const t=N.c(8),e=Te(),{org:n}=xe(),{setOpenMobile:r}=Xe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx($e,{children:s.jsx(he,{children:s.jsx(Ut,{})})})}),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 a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(pt,{className:"size-4"}),t[5]=a):a=t[5];let l;return t[6]!==i?(l=s.jsx(Lt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[o,s.jsx(ke,{"aria-label":"Settings",onClick:i,children:a})]})}),t[6]=i,t[7]=l):l=t[7],l}function ol(t){const e=N.c(8),{virtualMcpId:n,size:r,showAutomationBadge:o}=t,i=r===void 0?"sm":r;let a;e[0]!==i||e[1]!==n?(a=n?s.jsx(il,{virtualMcpId:n,size:i}):s.jsx(Oe,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=a):a=e[2];let l;e[3]!==o?(l=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(Ys,{size:10,className:"text-white"})}),e[3]=o,e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==l?(c=s.jsxs("div",{className:"relative shrink-0",children:[a,l]}),e[5]=a,e[6]=l,e[7]=c):c=e[7],c}function il(t){const e=N.c(6),{virtualMcpId:n,size:r}=t,o=ht(n);if(!o){let l;return e[0]!==r?(l=s.jsx(Oe,{icon:null,name:"?",size:r}),e[0]=r,e[1]=l):l=e[1],l}const i=o.icon??null;let a;return e[2]!==o.title||e[3]!==r||e[4]!==i?(a=s.jsx(Oe,{icon:i,name:o.title,size:r}),e[2]=o.title,e[3]=r,e[4]=i,e[5]=a):a=e[5],a}function ll(t){const e=N.c(36),{open:n,onOpenChange:r}=t,[o,i]=$.useState(""),{org:a}=xe(),{setTaskId:l}=Es(),c=Vs();let d,u,m;e[0]!==a.id||e[1]!==o?(m=o.trim(),u=Vt,d=qt.globalSearch(a.id,m),e[0]=a.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 g;e[5]!==c||e[6]!==m?(g=async()=>await c.call("GLOBAL_SEARCH",{query:m,limit:20}),e[5]=c,e[6]=m,e[7]=g):g=e[7];let h;e[8]!==d||e[9]!==f||e[10]!==g?(h={queryKey:d,enabled:f,queryFn:g,staleTime:1e4},e[8]=d,e[9]=f,e[10]=g,e[11]=h):h=e[11];const{data:x,isFetching:p}=u(h);let v;e[12]!==x?.items?(v=x?.items??[],e[12]=x?.items,e[13]=v):v=e[13];const b=v;let y;e[14]!==r?(y=w=>{w||i(""),r(w)},e[14]=r,e[15]=y):y=e[15];const j=y;let S;e[16]!==j||e[17]!==l?(S=w=>{j(!1),l(w.id,w.virtual_mcp_id??void 0)},e[16]=j,e[17]=l,e[18]=S):S=e[18];const C=S;let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(Vo,{className:"sr-only",children:[s.jsx(Yo,{children:"Search"}),s.jsx(Xo,{children:"Search across your organization's resources."})]}),e[19]=_):_=e[19];let I;e[20]!==o?(I=s.jsx(ti,{value:o,onValueChange:i,placeholder:"Search..."}),e[20]=o,e[21]=I):I=e[21];let k;e[22]!==C||e[23]!==p||e[24]!==b||e[25]!==m?(k=m?p&&b.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):b.length===0?s.jsx(Jo,{children:"No results."}):b.map(w=>w.type==="thread"?s.jsxs(ei,{value:`thread:${w.id}:${w.title}`,onSelect:()=>C(w),className:"gap-2.5",children:[s.jsx(ol,{virtualMcpId:w.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:w.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(w.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${w.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=C,e[23]=p,e[24]=b,e[25]=m,e[26]=k):k=e[26];let A;e[27]!==k?(A=s.jsx(si,{children:k}),e[27]=k,e[28]=A):A=e[28];let O;e[29]!==I||e[30]!==A?(O=s.jsxs(Qo,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[_,s.jsxs(ni,{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,A]})]}),e[29]=I,e[30]=A,e[31]=O):O=e[31];let T;return e[32]!==j||e[33]!==n||e[34]!==O?(T=s.jsx(Zo,{open:n,onOpenChange:j,children:O}),e[32]=j,e[33]=n,e[34]=O,e[35]=T):T=e[35],T}function al(t){return t==="owner"||t==="admin"}function cl(){const t=N.c(11),{locator:e}=xe(),n=ri(),{data:r}=we.useSession(),o=r?.user?.id;let i;t[0]!==e?(i=qt.members(e),t[0]=e,t[1]=i):i=t[1];let a;t[2]!==n?(a=()=>n.organization.listMembers(),t[2]=n,t[3]=a):a=t[3];const l=!!o;let c;t[4]!==i||t[5]!==a||t[6]!==l?(c={queryKey:i,queryFn:a,enabled:l,staleTime:6e4},t[4]=i,t[5]=a,t[6]=l,t[7]=c):c=t[7];const{data:d}=Vt(c);let u;if(t[8]!==d?.data?.members||t[9]!==o){const f=(d?.data?.members??[]).find(g=>g.userId===o)?.role;u=al(f??void 0),t[8]=d?.data?.members,t[9]=o,t[10]=u}else u=t[10];return u}var Qt="ContextMenu",[dl]=ir(Qt,[Cs]),ce=Cs(),[ul,cn]=dl(Qt),dn=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:o,modal:i=!0}=t,[a,l]=$.useState(!1),c=ce(e),d=rr(r),u=$.useCallback(m=>{l(m),d(m)},[d]);return s.jsx(ul,{scope:e,open:a,onOpenChange:u,modal:i,children:s.jsx(or,{...c,dir:o,open:a,onOpenChange:u,modal:i,children:n})})};dn.displayName=Qt;var un="ContextMenuTrigger",mn=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=t,i=cn(un,n),a=ce(n),l=$.useRef({x:0,y:0}),c=$.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),d=$.useRef(0),u=$.useCallback(()=>window.clearTimeout(d.current),[]),m=f=>{l.current={x:f.clientX,y:f.clientY},i.onOpenChange(!0)};return $.useEffect(()=>u,[u]),$.useEffect(()=>{r&&u()},[r,u]),s.jsxs(s.Fragment,{children:[s.jsx(Zn,{...a,virtualRef:c}),s.jsx(Jn.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:xt(t.onContextMenu,f=>{u(),m(f),f.preventDefault()}),onPointerDown:r?t.onPointerDown:xt(t.onPointerDown,kt(f=>{u(),d.current=window.setTimeout(()=>m(f),700)})),onPointerMove:r?t.onPointerMove:xt(t.onPointerMove,kt(u)),onPointerCancel:r?t.onPointerCancel:xt(t.onPointerCancel,kt(u)),onPointerUp:r?t.onPointerUp:xt(t.onPointerUp,kt(u))})]})});mn.displayName=un;var ml="ContextMenuPortal",fn=t=>{const{__scopeContextMenu:e,...n}=t,r=ce(e);return s.jsx(sr,{...r,...n})};fn.displayName=ml;var xn="ContextMenuContent",hn=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=cn(xn,n),i=ce(n),a=$.useRef(!1);return s.jsx(nr,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{t.onCloseAutoFocus?.(l),!l.defaultPrevented&&a.current&&l.preventDefault(),a.current=!1},onInteractOutside:l=>{t.onInteractOutside?.(l),!l.defaultPrevented&&!o.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});hn.displayName=xn;var fl="ContextMenuGroup",xl=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(lr,{...o,...r,ref:e})});xl.displayName=fl;var hl="ContextMenuLabel",pl=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(ar,{...o,...r,ref:e})});pl.displayName=hl;var gl="ContextMenuItem",pn=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(er,{...o,...r,ref:e})});pn.displayName=gl;var bl="ContextMenuCheckboxItem",jl=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(cr,{...o,...r,ref:e})});jl.displayName=bl;var vl="ContextMenuRadioGroup",yl=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(dr,{...o,...r,ref:e})});yl.displayName=vl;var Sl="ContextMenuRadioItem",_l=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(ur,{...o,...r,ref:e})});_l.displayName=Sl;var Nl="ContextMenuItemIndicator",Cl=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(mr,{...o,...r,ref:e})});Cl.displayName=Nl;var wl="ContextMenuSeparator",gn=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(tr,{...o,...r,ref:e})});gn.displayName=wl;var kl="ContextMenuArrow",Il=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(fr,{...o,...r,ref:e})});Il.displayName=kl;var Ml="ContextMenuSubTrigger",Al=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(xr,{...o,...r,ref:e})});Al.displayName=Ml;var $l="ContextMenuSubContent",Ol=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(hr,{...o,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ol.displayName=$l;function kt(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var Tl=dn,zl=mn,Pl=fn,Rl=hn,Dl=pn,El=gn;function bn(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(Tl,{"data-slot":"context-menu",...n}),e[2]=n,e[3]=r):r=e[3],r}function jn(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(zl,{"data-slot":"context-menu-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function vn(t){const e=N.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("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 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==r||e[6]!==o?(i=s.jsx(Pl,{children:s.jsx(Rl,{"data-slot":"context-menu-content",className:o,...r})}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}function It(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,inset:r,variant:i,...o}=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 a=i===void 0?"default":i;let l;e[5]!==n?(l=K("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),e[5]=n,e[6]=l):l=e[6];let c;return e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==a?(c=s.jsx(Dl,{"data-slot":"context-menu-item","data-inset":r,"data-variant":a,className:l,...o}),e[7]=r,e[8]=o,e[9]=l,e[10]=a,e[11]=c):c=e[11],c}function hs(t){const e=N.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("bg-border -mx-1 my-1 h-px",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==r||e[6]!==o?(i=s.jsx(El,{"data-slot":"context-menu-separator",className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}function yn(t){const e=N.c(26),{virtualMcpId:n,isOrgPinned:r,canManageOrgPin:o,onNewTaskInGroup:i,onShowSettings:a,onToggleOrgPin:l,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(It,{onSelect:d,children:[u,"New task"]}),e[4]=d,e[5]=m):m=e[5];let f;e[6]!==a||e[7]!==n?(f=()=>a(n),e[6]=a,e[7]=n,e[8]=f):f=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(pt,{size:14,className:"mr-2"}),e[9]=g):g=e[9];let h;e[10]!==f?(h=s.jsxs(It,{onSelect:f,children:[g,"Settings"]}),e[10]=f,e[11]=h):h=e[11];let x;e[12]!==o||e[13]!==r||e[14]!==l||e[15]!==n?(x=o&&s.jsxs(s.Fragment,{children:[s.jsx(hs,{}),s.jsxs(It,{onSelect:()=>l(n,!r),children:[s.jsx(Rr,{size:14,className:"mr-2"}),r?"Unpin for all members":"Pin for all members"]})]}),e[12]=o,e[13]=r,e[14]=l,e[15]=n,e[16]=x):x=e[16];let p;e[17]!==r||e[18]!==c||e[19]!==n?(p=!r&&s.jsxs(s.Fragment,{children:[s.jsx(hs,{}),s.jsxs(It,{onSelect:()=>c(n),children:[s.jsx(zo,{size:14,className:"mr-2"}),"Hide"]})]}),e[17]=r,e[18]=c,e[19]=n,e[20]=p):p=e[20];let v;return e[21]!==m||e[22]!==h||e[23]!==x||e[24]!==p?(v=s.jsxs(s.Fragment,{children:[m,h,x,p]}),e[21]=m,e[22]=h,e[23]=x,e[24]=p,e[25]=v):v=e[25],v}function Fl(t){return t==="ephemeral"||t.startsWith("thread:")}function Et(t){const e=N.c(45),{task:n,isActive:r,onClick:o,onArchive:i,showAutomationBadge:a,showAgentIcon:l,hideStatusIdle:c}=t,d=ai(n.status),u=d.icon,m=n.metadata?.kind==="tool_call_run",f=ht(m?void 0:n.virtual_mcp_id);let g;e[0]!==f?(g=Po(f),e[0]=f,e[1]=g):g=e[1];const h=g;di(6e4);const x=a||!!n.trigger_id,p=n.id,v="button",b=0;let y;e[2]!==o?(y=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),o())},e[2]=o,e[3]=y):y=e[3];const j=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let S;e[4]!==j?(S=K("group/row flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer transition-colors","focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",j),e[4]=j,e[5]=S):S=e[5];let C;e[6]!==m||e[7]!==l||e[8]!==f?.icon||e[9]!==f?.title?(C=l&&!m&&s.jsx(Oe,{icon:f?.icon??null,name:f?.title??"?",size:"2xs"}),e[6]=m,e[7]=l,e[8]=f?.icon,e[9]=f?.title,e[10]=C):C=e[10];let _;e[11]!==x?(_=x&&s.jsx(Ys,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[11]=x,e[12]=_):_=e[12];const I=n.title||"Untitled task";let k;e[13]!==I?(k=s.jsx("div",{className:"text-sm text-foreground truncate",children:I}),e[13]=I,e[14]=k):k=e[14];let A;e[15]!==k||e[16]!==_?(A=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[_,k]}),e[15]=k,e[16]=_,e[17]=A):A=e[17];let O;e[18]!==h||e[19]!==r||e[20]!==n.branch||e[21]!==n.updated_at?(O=n.updated_at&&s.jsxs("div",{className:K("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Fl(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):h?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[h.owner,"/",h.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:ui(new Date(n.updated_at))})]}),e[18]=h,e[19]=r,e[20]=n.branch,e[21]=n.updated_at,e[22]=O):O=e[22];let T;e[23]!==A||e[24]!==O?(T=s.jsxs("div",{className:"flex-1 min-w-0",children:[A,O]}),e[23]=A,e[24]=O,e[25]=T):T=e[25];const w="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",P=!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":d.label,children:s.jsx(u,{size:14,className:K(d.iconClassName,n.status==="in_progress"&&"animate-spin")})});let U;e[26]!==i?(U=B=>{B.stopPropagation(),i()},e[26]=i,e[27]=U):U=e[27];let z;e[28]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(pr,{size:14}),e[28]=z):z=e[28];let G;e[29]!==U?(G=s.jsx(We,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:U,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:z})}),e[29]=U,e[30]=G):G=e[30];let R;e[31]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(qe,{side:"right",children:"Archive"}),e[31]=R):R=e[31];let H;e[32]!==G?(H=s.jsxs(Ve,{children:[G,R]}),e[32]=G,e[33]=H):H=e[33];let D;e[34]!==P||e[35]!==H?(D=s.jsxs("div",{className:w,children:[P,H]}),e[34]=P,e[35]=H,e[36]=D):D=e[36];let E;return e[37]!==o||e[38]!==T||e[39]!==D||e[40]!==y||e[41]!==S||e[42]!==C||e[43]!==n.id?(E=s.jsxs("div",{"data-task-id":p,role:v,tabIndex:b,onClick:o,onKeyDown:y,className:S,children:[C,T,D]}),e[37]=o,e[38]=T,e[39]=D,e[40]=y,e[41]=S,e[42]=C,e[43]=n.id,e[44]=E):E=e[44],E}function Zt(t){const e=N.c(10),{onClick:n,isFetching:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=K("flex items-center gap-2 px-2 py-1.5 rounded-md 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 disabled:cursor-progress disabled:opacity-60"),e[0]=o):o=e[0];let i;e[1]!==r?(i=r&&s.jsx(Wt,{size:14,className:"animate-spin"}),e[1]=r,e[2]=i):i=e[2];const a=r?"Loading…":"Show more";let l;e[3]!==a?(l=s.jsx("span",{children:a}),e[3]=a,e[4]=l):l=e[4];let c;return e[5]!==r||e[6]!==n||e[7]!==i||e[8]!==l?(c=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:o,children:[i,l]}),e[5]=r,e[6]=n,e[7]=i,e[8]=l,e[9]=c):c=e[9],c}function Gl(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function Bl(t){return t.member==="mine"&&!t.currentUserId}const Sn=4;let At=0;const Kt=[];function Ll(){for(;At<Sn&&Kt.length>0;){const t=Kt.shift();t&&t()}}function _n(t){return new Promise((e,n)=>{const r=()=>{At++,t().then(e,n).finally(()=>{At--,Ll()})};At<Sn?r():Kt.push(r)})}const Ft=10;function ps(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 a={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return t==="status"&&(a.status=e),a}function Hl(t,e,n,r){let o=0;for(const i of t)Jt(i,e,n,r)&&o++;return o}function Bt(t,e,n,r){return Hl(t,e,n,r)}function Ul(t,e,n){const r=new Map;for(const o of t){const i=o.virtual_mcp_id;i&&Jt(o,e,i,n)&&r.set(i,(r.get(i)??0)+1)}return r}function Kl(t,e){return!!(t>=Ft||t===0&&e)}function gs(t,e){return t<e}function Wl(t,e){return e===!1?!1:e===!0?!0:t}function Jt(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 Tt=new Map,Mt=new Map;function ql(t,e){return e?t>=Ft?!0:null:!1}function bs(t){return Tt.get(t)}function Vl(t,e){Tt.set(t,e)}function Yl(t,e,n){const r=Tt.get(t);if(r!==void 0){n(r);return}let o=Mt.get(t);o||(o=_n(e).then(i=>(Tt.set(t,i),Mt.delete(t),i)).catch(()=>(Mt.delete(t),Promise.reject(new Error("group probe failed")))),Mt.set(t,o)),o.then(n,()=>n(!1))}function js(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Ft,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Xl(t,e,n,r,o){let i=0;for(const a of t)e.has(a.id)||Jt(a,n,r,o)&&i++;return i}function es(t,e,n,r){const o=N.c(8),{org:i}=xe(),a=Gl(i.id,t,e,n);let l;o[0]!==n?(l=Bl(n),o[0]=n,o[1]=l):l=o[1];const c=l,[d,u]=$.useState({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==a&&u({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});const m=Fr(),{threads:f,hasMore:g}=Ds(),h=r??Bt(f,t,e,n),x=Kl(h,g),p=ql(h,g),v=Vs();if(d.identity===a&&d.serverHasMore===null){const _=p??bs(a);_!==void 0&&u({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:_})}!c&&d.identity===a&&d.serverHasMore===null&&p===null&&bs(a)===void 0&&d.probeSubscribedIdentity!==a&&(u(_=>_.identity===a?{..._,isProbing:!0,probeSubscribedIdentity:a}:_),Yl(a,async()=>{const _=ps(t,e,0,n,1),I=await v.call("COLLECTION_THREADS_LIST",_),{totalCount:k}=js(I),A=Bt(m.threads.get(),t,e,n);return k===void 0?!1:gs(A,k)},_=>{u(I=>I.identity!==a?I:{...I,isProbing:!1,serverHasMore:_})}));const y=async function(){if(d.isFetching||d.isProbing||c)return;const I=a;u(k=>k.identity===I?{...k,isFetching:!0}:k);try{const k=Bt(f,t,e,n),A=ps(t,e,k,n,Ft),O=await _n(()=>v.call("COLLECTION_THREADS_LIST",A)),{items:T,hasMore:w,totalCount:P}=js(O),U=new Set(f.map(Ql)),z=Xl(T,U,t,e,n),G=k;m.mergeThreads(T),u(R=>{if(R.identity!==I)return R;let H;return P!==void 0?H=gs(G+z,P):H=T.length===0||z===0?!1:w,Vl(I,H),{...R,isFetching:!1,serverHasMore:H}})}catch(k){const A=k,O=A instanceof Error?A.message:String(A);Ae.error(`Could not load more tasks: ${O}`),u(T=>T.identity===I?{...T,isFetching:!1}:T)}},j=d.isFetching||d.isProbing,S=!c&&!j&&Wl(x,d.serverHasMore);let C;return o[2]!==j||o[3]!==y||o[4]!==S||o[5]!==d.isProbing||o[6]!==d.serverHasMore?(C={hasMore:S,isFetching:j,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:y},o[2]=j,o[3]=y,o[4]=S,o[5]=d.isProbing,o[6]=d.serverHasMore,o[7]=C):C=o[7],C}function Ql(t){return t.id}function Nn(t){const e=N.c(61),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,onSelectTask:a,onArchiveTask:l,onNewTaskInGroup:c,onShowSettings:d,onHideGroup:u,isOrgPinned:m,canManageOrgPin:f,onToggleOrgPin:g,sortable:h,groupVisibleCount:x}=t,p=m===void 0?!1:m,v=f===void 0?!1:f,b=ht(n),y=r[0];let j;e[0]!==y||e[1]!==c||e[2]!==a||e[3]!==n?(j=()=>{y?a(y):c(n)},e[0]=y,e[1]=c,e[2]=a,e[3]=n,e[4]=j):j=e[4];const S=j,C=h?.isDragging?!1:void 0;let _;e[5]!==h?.isDragging||e[6]!==n?(_=Y=>{h?.isDragging||Y&&J("sidebar_group_hover_popover_opened",{virtual_mcp_id:n})},e[5]=h?.isDragging,e[6]=n,e[7]=_):_=e[7];const I=!!(y&&o&&y.id===o),k=h?"Drag to reorder":void 0;let A;e[8]!==h?(A=h?{...h.attributes,...h.listeners}:{},e[8]=h,e[9]=A):A=e[9];const O=h&&"cursor-pointer active:cursor-grabbing touch-none",T=h?.isDragging&&"cursor-grabbing";let w;e[10]!==T||e[11]!==O?(w=K("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,T),e[10]=T,e[11]=O,e[12]=w):w=e[12];const P=b?.icon??null,U=b?.title??"?";let z;e[13]!==P||e[14]!==U?(z=s.jsx(Oe,{icon:P,name:U,size:"sm+",className:"rounded-lg"}),e[13]=P,e[14]=U,e[15]=z):z=e[15];let G;e[16]!==S||e[17]!==w||e[18]!==z||e[19]!==I||e[20]!==k||e[21]!==A?(G=s.jsx(he,{children:s.jsx(jn,{asChild:!0,children:s.jsx(oi,{asChild:!0,children:s.jsx(Ie,{onClick:S,isActive:I,title:k,...A,className:w,children:z})})})}),e[16]=S,e[17]=w,e[18]=z,e[19]=I,e[20]=k,e[21]=A,e[22]=G):G=e[22];const R=g??Zl;let H;e[23]!==v||e[24]!==p||e[25]!==u||e[26]!==c||e[27]!==d||e[28]!==R||e[29]!==n?(H=s.jsx(vn,{className:"w-56",children:s.jsx(yn,{virtualMcpId:n,isOrgPinned:p,canManageOrgPin:v,onNewTaskInGroup:c,onShowSettings:d,onToggleOrgPin:R,onHideGroup:u})}),e[23]=v,e[24]=p,e[25]=u,e[26]=c,e[27]=d,e[28]=R,e[29]=n,e[30]=H):H=e[30];let D;e[31]!==G||e[32]!==H?(D=s.jsxs(bn,{children:[G,H]}),e[31]=G,e[32]=H,e[33]=D):D=e[33];const E=b?.title??"Agent";let B;e[34]!==E?(B=s.jsx("span",{className:"truncate",children:E}),e[34]=E,e[35]=B):B=e[35];let F;e[36]!==c||e[37]!==n?(F=()=>c(n),e[36]=c,e[37]=n,e[38]=F):F=e[38];let q;e[39]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Ce,{size:14}),e[39]=q):q=e[39];let W;e[40]!==F?(W=s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:F,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground",children:q}),e[40]=F,e[41]=W):W=e[41];let X;e[42]!==B||e[43]!==W?(X=s.jsxs("div",{className:"flex items-center justify-between px-1 pb-1 text-xs font-medium",children:[B,W]}),e[42]=B,e[43]=W,e[44]=X):X=e[44];let le;e[45]!==o||e[46]!==i||e[47]!==x||e[48]!==l||e[49]!==a||e[50]!==r||e[51]!==n?(le=s.jsx(Jl,{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:x,onSelectTask:a,onArchiveTask:l}),e[45]=o,e[46]=i,e[47]=x,e[48]=l,e[49]=a,e[50]=r,e[51]=n,e[52]=le):le=e[52];let V;e[53]!==X||e[54]!==le?(V=s.jsxs(ii,{side:"right",align:"start",sideOffset:8,className:"w-72 p-2",children:[X,le]}),e[53]=X,e[54]=le,e[55]=V):V=e[55];let Q;return e[56]!==D||e[57]!==V||e[58]!==C||e[59]!==_?(Q=s.jsxs(li,{open:C,openDelay:120,closeDelay:150,onOpenChange:_,children:[D,V]}),e[56]=D,e[57]=V,e[58]=C,e[59]=_,e[60]=Q):Q=e[60],Q}function Zl(){}function Jl(t){const e=N.c(6),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:a,onSelectTask:l,onArchiveTask:c}=t,d=es("agent",n,i,a);let u;return e[0]!==o||e[1]!==c||e[2]!==l||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(Et,{task:m,isActive:o===m.id,onClick:()=>l(m),onArchive:()=>c(m),showAutomationBadge:!!m.trigger_id},m.id)),(d.hasMore||d.isFetching)&&s.jsx(Zt,{onClick:()=>{d.loadMore()},isFetching:d.isFetching})]})}),e[0]=o,e[1]=c,e[2]=l,e[3]=d,e[4]=r,e[5]=u):u=e[5],u}function ea(t,e,n,r,o,i,a){const l=N.c(18),c=a===void 0?"expanded":a;let d;l[0]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:8}},l[0]=d):d=l[0];let u;l[1]===Symbol.for("react.memo_cache_sentinel")?(u={coordinateGetter:Fo},l[1]=u):u=l[1];const m=Ro(ls(Eo,d),ls(Do,u));let f;l[2]!==r||l[3]!==o||l[4]!==e||l[5]!==t?(f=qr(t,e,r,o),l[2]=r,l[3]=o,l[4]=e,l[5]=t,l[6]=f):f=l[6];const g=f;let h;l[7]!==i||l[8]!==n||l[9]!==o||l[10]!==e||l[11]!==g||l[12]!==c?(h=v=>{const{active:b,over:y}=v;if(!y||b.id===y.id)return;const j=String(b.id),S=String(y.id);if(!Vr(j,S,o))return;const C=Yr(g,j,S),_=Xr(e,n,o,C);e==="org"?Qr(n.orgId,_):Zr(n,_),J("sidebar_group_reordered",{virtual_mcp_id:j,over_virtual_mcp_id:S,surface:c,section:e}),i()},l[7]=i,l[8]=n,l[9]=o,l[10]=e,l[11]=g,l[12]=c,l[13]=h):h=l[13];const x=h;let p;return l[14]!==x||l[15]!==m||l[16]!==g?(p={sensors:m,sortableIds:g,handleDragEnd:x},l[14]=x,l[15]=m,l[16]=g,l[17]=p):p=l[17],p}function ta(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 sa(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:a,setNodeRef:l,transform:c,transition:d,isDragging:u}=Uo(o);let m;if(e[2]!==i||e[3]!==r||e[4]!==u||e[5]!==a||e[6]!==l||e[7]!==c||e[8]!==d){const g={transform:Ko.Transform.toString(c),transition:d,zIndex:u?100:void 0};m=r({setNodeRef:l,style:g,isDragging:u,attributes:i,listeners:a}),e[2]=i,e[3]=r,e[4]=u,e[5]=a,e[6]=l,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 vs(t){const e=N.c(18),{section:n,groups:r,orderScope:o,decopilotId:i,orgPinnedIds:a,onReorder:l,surface:c,renderGroup:d,renderSortable:u,renderFixed:m}=t,{sensors:f,sortableIds:g,handleDragEnd:h}=ea(r,n,o,i,a,l,c);if(r.length===0)return null;const x=g;let p;if(e[0]!==r||e[1]!==m||e[2]!==d||e[3]!==u||e[4]!==g){let y;e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==g?(y=j=>{const S=d(j);return g.includes(j.virtualMcpId)?s.jsx(sa,{id:j.virtualMcpId,children:C=>{const{setNodeRef:_,style:I,isDragging:k,attributes:A,listeners:O}=C;return s.jsx("div",{ref:_,style:I,className:K(k&&"opacity-50"),children:u(S,{attributes:A,listeners:O,isDragging:k})})}},j.virtualMcpId):s.jsx("div",{children:m(S)},j.virtualMcpId)},e[6]=m,e[7]=d,e[8]=u,e[9]=g,e[10]=y):y=e[10],p=r.map(y),e[0]=r,e[1]=m,e[2]=d,e[3]=u,e[4]=g,e[5]=p}else p=e[5];let v;e[11]!==x||e[12]!==p?(v=s.jsx(Go,{items:x,strategy:Bo,children:p}),e[11]=x,e[12]=p,e[13]=v):v=e[13];let b;return e[14]!==h||e[15]!==f||e[16]!==v?(b=s.jsx(Lo,{sensors:f,collisionDetection:Ho,onDragEnd:h,children:v}),e[14]=h,e[15]=f,e[16]=v,e[17]=b):b=e[17],b}function Cn(t){const e=N.c(23),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:l,collapsedSeparator:c,renderGroup:d,renderSortable:u,renderFixed:m}=t;let f;if(e[0]!==c||e[1]!==o||e[2]!==n||e[3]!==a||e[4]!==r||e[5]!==i||e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==l){const{decopilot:g,orgPinned:h,user:x,toolCallRuns:p}=Jr(n,o,i),v=h.length>0&&x.length>0;let b;e[11]!==o||e[12]!==a||e[13]!==r||e[14]!==i||e[15]!==m||e[16]!==d||e[17]!==u||e[18]!==l?(b={orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:l,renderGroup:d,renderSortable:u,renderFixed:m},e[11]=o,e[12]=a,e[13]=r,e[14]=i,e[15]=m,e[16]=d,e[17]=u,e[18]=l,e[19]=b):b=e[19];const y=b;let j;e[20]!==c||e[21]!==v?(j=v&&s.jsx(ta,{collapsed:c}),e[20]=c,e[21]=v,e[22]=j):j=e[22],f=s.jsxs(s.Fragment,{children:[g&&m(d(g)),s.jsx(vs,{section:"org",groups:h,...y}),j,s.jsx(vs,{section:"user",groups:x,...y}),p&&m(d(p))]}),e[0]=c,e[1]=o,e[2]=n,e[3]=a,e[4]=r,e[5]=i,e[6]=m,e[7]=d,e[8]=u,e[9]=l,e[10]=f}else f=e[10];return f}function na(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,renderGroup:l}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==a||e[3]!==r||e[4]!==i||e[5]!==l?(c=s.jsx(Cn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:"collapsed_rail",collapsedSeparator:!0,renderGroup:l,renderFixed:oa,renderSortable:ra}),e[0]=o,e[1]=n,e[2]=a,e[3]=r,e[4]=i,e[5]=l,e[6]=c):c=e[6],c}function ra(t,e){return s.jsx(Nn,{...t,sortable:{attributes:e.attributes,listeners:e.listeners,isDragging:e.isDragging}},t.virtualMcpId)}function oa(t){return s.jsx(Nn,{...t},t.virtualMcpId)}const ia="sidebar.group.expanded.";function wn(t,e){const n=N.c(3),[r,o]=gr(`${ia}${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(59),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,onShowSettings:c,onHideGroup:d,isOrgPinned:u,canManageOrgPin:m,onToggleOrgPin:f,filters:g,groupVisibleCount:h,sortable:x}=t,p=u===void 0?!1:u,v=m===void 0?!1:m,[b,y]=wn(n,!1),j=n===Gs,S=x?.isDragging??!1;let C;e[0]!==b||e[1]!==y?(C=function(){y(!b)},e[0]=b,e[1]=y,e[2]=C):C=e[2];const _=C;let I;e[3]!==j||e[4]!==x?(I=x&&!j?{...x.attributes,...x.listeners}:{},e[3]=j,e[4]=x,e[5]=I):I=e[5];let k;e[6]!==_?(k=F=>{F.target===F.currentTarget&&(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),_())},e[6]=_,e[7]=k):k=e[7];const A=x&&!j&&"touch-none active:cursor-grabbing",O=S&&"shadow-md bg-accent/40 cursor-grabbing";let T;e[8]!==A||e[9]!==O?(T=K("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",A,O),e[8]=A,e[9]=O,e[10]=T):T=e[10];let w;e[11]!==j||e[12]!==n?(w=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(aa,{virtualMcpId:n,isToolCallRuns:j})}),e[11]=j,e[12]=n,e[13]=w):w=e[13];let P;e[14]!==b?(P=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:b?s.jsx(Xs,{size:14}):s.jsx(Xt,{size:14})}),e[14]=b,e[15]=P):P=e[15];let U;e[16]!==P||e[17]!==w?(U=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[w,P]}),e[16]=P,e[17]=w,e[18]=U):U=e[18];let z;e[19]!==j||e[20]!==n?(z=s.jsx("span",{className:"flex-1 truncate",children:s.jsx(da,{virtualMcpId:n,isToolCallRuns:j})}),e[19]=j,e[20]=n,e[21]=z):z=e[21];let G;e[22]!==j||e[23]!==l||e[24]!==n?(G=!j&&s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:F=>{F.stopPropagation(),l(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[22]=j,e[23]=l,e[24]=n,e[25]=G):G=e[25];let R;e[26]!==b||e[27]!==_||e[28]!==U||e[29]!==z||e[30]!==G||e[31]!==I||e[32]!==k||e[33]!==T?(R=s.jsxs("div",{...I,role:"button",tabIndex:0,"aria-expanded":b,onClick:_,onKeyDown:k,className:T,children:[U,z,G]}),e[26]=b,e[27]=_,e[28]=U,e[29]=z,e[30]=G,e[31]=I,e[32]=k,e[33]=T,e[34]=R):R=e[34];const H=R;let D;e[35]!==v||e[36]!==H||e[37]!==p||e[38]!==j||e[39]!==d||e[40]!==l||e[41]!==c||e[42]!==f||e[43]!==n?(D=j?H:s.jsxs(bn,{children:[s.jsx(jn,{asChild:!0,children:H}),s.jsx(vn,{className:"w-56",children:s.jsx(yn,{virtualMcpId:n,isOrgPinned:p,canManageOrgPin:v,onNewTaskInGroup:l,onShowSettings:c,onToggleOrgPin:f??la,onHideGroup:d})})]}),e[35]=v,e[36]=H,e[37]=p,e[38]=j,e[39]=d,e[40]=l,e[41]=c,e[42]=f,e[43]=n,e[44]=D):D=e[44];let E;e[45]!==o||e[46]!==b||e[47]!==g||e[48]!==h||e[49]!==j||e[50]!==a||e[51]!==l||e[52]!==i||e[53]!==r||e[54]!==n?(E=b&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:j?r.map(F=>s.jsx(Et,{task:F,isActive:o===F.id,onClick:()=>i(F),onArchive:()=>a(F),showAutomationBadge:!!F.trigger_id},F.id)):s.jsx(ma,{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,filters:g,groupVisibleCount:h})}),e[45]=o,e[46]=b,e[47]=g,e[48]=h,e[49]=j,e[50]=a,e[51]=l,e[52]=i,e[53]=r,e[54]=n,e[55]=E):E=e[55];let B;return e[56]!==D||e[57]!==E?(B=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[D,E]}),e[56]=D,e[57]=E,e[58]=B):B=e[58],B}function la(){}function aa(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(Oe,{icon:null,name:"⚙",size:"2xs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(ca,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function ca(t){const e=N.c(4),{virtualMcpId:n}=t,r=ht(n);if(!r){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Oe,{icon:null,name:"?",size:"2xs"}),e[0]=a):a=e[0],a}const o=r.icon??null;let i;return e[1]!==r.title||e[2]!==o?(i=s.jsx(Oe,{icon:o,name:r.title,size:"2xs"}),e[1]=r.title,e[2]=o,e[3]=i):i=e[3],i}function da(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(ua,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function ua(t){const e=N.c(2),{virtualMcpId:n}=t,o=ht(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 ma(t){const e=N.c(10),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,filters:c,groupVisibleCount:d}=t,u=es("agent",n,c,d),{isFetching:m,isProbing:f,loadMore:g,serverHasMore:h}=u,[x,p]=$.useState(!1);!x&&r.length===0&&h===!0&&!m&&!f&&(p(!0),queueMicrotask(()=>{g()}));const{hasMore:v}=u;let b;return e[0]!==o||e[1]!==v||e[2]!==m||e[3]!==g||e[4]!==a||e[5]!==l||e[6]!==i||e[7]!==r||e[8]!==n?(b=s.jsx(s.Fragment,{children:r.length===0?s.jsxs("button",{type:"button",onClick:()=>l(n),className:"flex items-center gap-2 px-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(Et,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>a(y),showAutomationBadge:!!y.trigger_id},y.id)),(v||m)&&s.jsx(Zt,{onClick:()=>{g()},isFetching:m})]})}),e[0]=o,e[1]=v,e[2]=m,e[3]=g,e[4]=a,e[5]=l,e[6]=i,e[7]=r,e[8]=n,e[9]=b):b=e[9],b}function fa(t){const e=N.c(16),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:m,serverHasMore:f}=es("status",n,l),[g,h]=$.useState(!1);!g&&r.length===0&&f===!0&&!c&&!d&&(h(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==o||e[1]!==a||e[2]!==i||e[3]!==r){let b;e[5]!==o||e[6]!==a||e[7]!==i?(b=y=>s.jsx(Et,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>a(y),showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0},y.id),e[5]=o,e[6]=a,e[7]=i,e[8]=b):b=e[8],x=r.map(b),e[0]=o,e[1]=a,e[2]=i,e[3]=r,e[4]=x}else x=e[4];let p;e[9]!==m||e[10]!==c||e[11]!==u?(p=(m||c)&&s.jsx(Zt,{onClick:()=>{u()},isFetching:c}),e[9]=m,e[10]=c,e[11]=u,e[12]=p):p=e[12];let v;return e[13]!==x||e[14]!==p?(v=s.jsxs(s.Fragment,{children:[x,p]}),e[13]=x,e[14]=p,e[15]=v):v=e[15],v}function xa(t){const e=N.c(35),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l}=t,c=ci[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 g=f;let h;e[3]!==g?(h=_=>{_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),g())},e[3]=g,e[4]=h):h=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 p;e[8]!==u?(p=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(Xs,{size:14}):s.jsx(Xt,{size:14})}),e[8]=u,e[9]=p):p=e[9];let v;e[10]!==x||e[11]!==p?(v=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,p]}),e[10]=x,e[11]=p,e[12]=v):v=e[12];let b;e[13]!==c.label?(b=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=b):b=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 j;e[17]!==u||e[18]!==g||e[19]!==h||e[20]!==v||e[21]!==b||e[22]!==y?(j=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:g,onKeyDown:h,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:[v,b,y]}),e[17]=u,e[18]=g,e[19]=h,e[20]=v,e[21]=b,e[22]=y,e[23]=j):j=e[23];let S;e[24]!==o||e[25]!==u||e[26]!==l||e[27]!==a||e[28]!==i||e[29]!==n||e[30]!==r?(S=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(fa,{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l})}),e[24]=o,e[25]=u,e[26]=l,e[27]=a,e[28]=i,e[29]=n,e[30]=r,e[31]=S):S=e[31];let C;return e[32]!==j||e[33]!==S?(C=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[j,S]}),e[32]=j,e[33]=S,e[34]=C):C=e[34],C}function ha(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,renderGroup:l}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==a||e[3]!==r||e[4]!==i||e[5]!==l?(c=s.jsx(Cn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:"expanded",renderGroup:l,renderFixed:ga,renderSortable:pa}),e[0]=o,e[1]=n,e[2]=a,e[3]=r,e[4]=i,e[5]=l,e[6]=c):c=e[6],c}function pa(t,e){return s.jsx(kn,{...t,sortable:e},t.virtualMcpId)}function ga(t){return s.jsx(kn,{...t},t.virtualMcpId)}function ba(t,e,n,r){return[t.orgId,t.userId,r,n.slice().sort().join(","),e.map(o=>o.virtualMcpId).sort().join(",")].join("|")}function ja(t,e,n,r,o){const i=N.c(5),a=ba(t,e,r,o),[l,c]=$.useState("");l!==a&&(eo(t,e,n,r),c(a));let d;return i[0]!==n||i[1]!==r||i[2]!==t||i[3]!==e?(d=to(t,e,n,r),i[0]=n,i[1]=r,i[2]=t,i[3]=e,i[4]=d):d=i[4],d}const In={all:"All tasks",manual:"Chats",automation:"Automation"},Mn={all:"All members",mine:"Mine only"},ys={agent:"Agent",status:"Status"};function An(){const t=N.c(92),{data:e}=we.useSession(),n=e?.user?.id,r=n??"anon",{org:o}=xe(),i=wr(o.id).id,a=zs(),l=Fs(a),c=cl(),d=kr();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u={},t[0]=u):u=t[0];const[m,f]=$.useState(u),g=new Set(l),h={},x=[];let p;t[1]!==m?(p=Object.entries(m),t[1]=m,t[2]=p):p=t[2];for(const[M,L]of p)g.has(M)!==L?h[M]=L:x.push(M);x.length>0&&f(M=>{const L={...M};for(const oe of x)delete L[oe];return L});const v=new Set(l);for(const[M,L]of Object.entries(h))L?v.add(M):v.delete(M);const b=[...v],y=new Set(b),{threads:j}=Ds(),S=j.filter(Ia),{hide:C}=Rs(),_=Te(),{setTaskId:I,createNewTask:k}=Es();let A;t[3]===Symbol.for("react.memo_cache_sentinel")?(A={strict:!1},t[3]=A):A=t[3];const T=Ns(A).taskId??null,w=[...S].sort(ka),[P,U]=$.useState("all"),[z,G]=$.useState("mine"),[R,H]=$.useState("agent"),[D,E]=$.useState(!1),[B,F]=$.useState(!1),[q,W]=$.useState(0),X=so(),le=q+X;let V;t[4]!==o.id||t[5]!==r?(V={orgId:o.id,userId:r},t[4]=o.id,t[5]=r,t[6]=V):V=t[6];const Q=V,Y={type:P,member:z,currentUserId:n??null},te=Ul(w,"agent",Y),Z=ja(Q,no(w,i),i,b,le);let se;t[7]!==n||t[8]!==z?(se=M=>z==="mine"&&n?M.filter(L=>L.created_by===n):M,t[7]=n,t[8]=z,t[9]=se):se=t[9];const ne=se;let re;t[10]!==P?(re=M=>P==="automation"?M.filter(wa):P==="manual"?M.filter(Ca):M,t[10]=P,t[11]=re):re=t[11];const ee=re,de=M=>{const L=M.id===T;if(C(M.id),!L)return;const oe=w.find(je=>je.id!==M.id&&je.virtual_mcp_id===M.virtual_mcp_id&&je.created_by===n);oe?I(oe.id,oe.virtual_mcp_id):_({to:"/$org",params:{org:o.slug}})};let ie;t[12]!==k?(ie=M=>{J("sidebar_group_new_clicked",{virtual_mcp_id:M}),k(M)},t[12]=k,t[13]=ie):ie=t[13];const ze=ie,Pe=ro();let pe;t[14]!==Pe?(pe=M=>{J("sidebar_group_settings_clicked",{virtual_mcp_id:M}),Pe(M,{search:{main:"instructions"}})},t[14]=Pe,t[15]=pe):pe=t[15];const Re=pe,mt=M=>{if(y.has(M))return;J("sidebar_group_hide_clicked",{virtual_mcp_id:M});const L=Z.find(oe=>oe.virtualMcpId===M);if(L)for(const oe of L.threads)C(oe.id);io(Q,M,b),W(Na)},De=async(M,L)=>{if(c&&h[M]===void 0){J("sidebar_group_org_pin_toggled",{virtual_mcp_id:M,pinned:L}),f(oe=>({...oe,[M]:L}));try{await d.update.mutateAsync({id:M,data:{pinned:L}})}catch{lo(Q,M,!L),f(oe=>{const je={...oe};return delete je[M],je})}}},Ee=M=>{const L=M===i||M===Gs;return{isOrgPinned:y.has(M),canManageOrgPin:L?!1:c,onToggleOrgPin:L?void 0:De}},Me=M=>{const L=ee(ne(M.threads));return{virtualMcpId:M.virtualMcpId,threads:L,activeTaskId:T,filters:Y,groupVisibleCount:te.get(M.virtualMcpId)??0,onSelectTask:oe=>I(oe.id,oe.virtual_mcp_id),onArchiveTask:de,onNewTaskInGroup:ze,onShowSettings:Re,onHideGroup:mt,...Ee(M.virtualMcpId)}},ae=P!=="all"||z!=="mine",{state:Fe,isMobile:Ge}=Xe();if(Fe==="collapsed"&&!Ge){let M;if(t[16]!==ae||t[17]!==Z||t[18]!==ne||t[19]!==ee){let dt;t[21]!==ae||t[22]!==ne||t[23]!==ee?(dt=Tn=>{const zn=ee(ne(Tn.threads));return!(ae&&zn.length===0)},t[21]=ae,t[22]=ne,t[23]=ee,t[24]=dt):dt=t[24],M=Z.filter(dt),t[16]=ae,t[17]=Z,t[18]=ne,t[19]=ee,t[20]=M}else M=t[20];const L=M,oe=R==="agent"&&Z.length===0;let je;t[25]!==oe?(je=s.jsx(rs,{value:oe}),t[25]=oe,t[26]=je):je=t[26];let Ct;return t[27]===Symbol.for("react.memo_cache_sentinel")?(Ct=()=>W(_a),t[27]=Ct):Ct=t[27],s.jsxs(s.Fragment,{children:[je,s.jsx($e,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.jsx(na,{groups:L,orderScope:Q,decopilotId:i,orgPinnedIds:b,onReorder:Ct,renderGroup:dt=>Me(dt)})})]})}const ft="flex flex-col h-full min-h-0",ve=R==="agent"&&Z.length===0;let ye;t[28]!==ve?(ye=s.jsx(rs,{value:ve}),t[28]=ve,t[29]=ye):ye=t[29];let me;t[30]!==E?(me=()=>{J("tasks_panel_search_opened"),F(!0),E(!0)},t[30]=E,t[31]=me):me=t[31];let ge;t[32]===Symbol.for("react.memo_cache_sentinel")?(ge=s.jsx(Dr,{size:16}),t[32]=ge):ge=t[32];let fe;t[33]!==me?(fe=s.jsx(ke,{"aria-label":"Search threads",onClick:me,children:ge}),t[33]=me,t[34]=fe):fe=t[34];const Be=ys[R==="agent"?"status":"agent"];let be;t[35]!==Be?(be=Be.toLowerCase(),t[35]=Be,t[36]=be):be=t[36];const Se=`Group by ${be}`,Le=ys[R];let ue;t[37]!==Le?(ue=Le.toLowerCase(),t[37]=Le,t[38]=ue):ue=t[38];const He=`Grouped by ${ue}`;let _e,Ue;t[39]!==R?(_e=()=>{const M=R==="agent"?"status":"agent";J("tasks_panel_group_by_changed",{to_value:M}),H(M)},Ue=R==="agent"?s.jsx(qo,{size:16}):s.jsx(Er,{size:16}),t[39]=R,t[40]=_e,t[41]=Ue):(_e=t[40],Ue=t[41]);let Ke;t[42]!==Se||t[43]!==He||t[44]!==_e||t[45]!==Ue?(Ke=s.jsx(ke,{"aria-label":Se,title:He,onClick:_e,children:Ue}),t[42]=Se,t[43]=He,t[44]=_e,t[45]=Ue,t[46]=Ke):Ke=t[46];let Qe;t[47]===Symbol.for("react.memo_cache_sentinel")?(Qe=s.jsx(Wo,{size:16}),t[47]=Qe):Qe=t[47];let Ze;t[48]!==ae?(Ze=ae&&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"}),t[48]=ae,t[49]=Ze):Ze=t[49];let Je;t[50]!==Ze?(Je=s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{"aria-label":"Filter tasks",children:[Qe,Ze]})}),t[50]=Ze,t[51]=Je):Je=t[51];let et;t[52]!==z?(et=M=>{const L=M;L!==z&&J("tasks_panel_member_filter_changed",{to_value:L}),G(L)},t[52]=z,t[53]=et):et=t[53];let gt;t[54]===Symbol.for("react.memo_cache_sentinel")?(gt=s.jsx(cs,{size:"sm",className:"w-full",children:s.jsx(ds,{})}),t[54]=gt):gt=t[54];let bt;t[55]===Symbol.for("react.memo_cache_sentinel")?(bt=Object.keys(Mn),t[55]=bt):bt=t[55];let jt;t[56]===Symbol.for("react.memo_cache_sentinel")?(jt=s.jsx(as,{children:bt.map(Sa)}),t[56]=jt):jt=t[56];let tt;t[57]!==z||t[58]!==et?(tt=s.jsx(Ss,{label:"Members",children:s.jsxs(us,{value:z,onValueChange:et,children:[gt,jt]})}),t[57]=z,t[58]=et,t[59]=tt):tt=t[59];let st;t[60]!==P?(st=M=>{const L=M;L!==P&&J("tasks_panel_filter_changed",{to_value:L}),U(L)},t[60]=P,t[61]=st):st=t[61];let vt;t[62]===Symbol.for("react.memo_cache_sentinel")?(vt=s.jsx(cs,{size:"sm",className:"w-full",children:s.jsx(ds,{})}),t[62]=vt):vt=t[62];let yt;t[63]===Symbol.for("react.memo_cache_sentinel")?(yt=Object.keys(In),t[63]=yt):yt=t[63];let St;t[64]===Symbol.for("react.memo_cache_sentinel")?(St=s.jsx(as,{children:yt.map(ya)}),t[64]=St):St=t[64];let nt;t[65]!==st||t[66]!==P?(nt=s.jsx(Ss,{label:"Type",children:s.jsxs(us,{value:P,onValueChange:st,children:[vt,St]})}),t[65]=st,t[66]=P,t[67]=nt):nt=t[67];let rt;t[68]!==tt||t[69]!==nt?(rt=s.jsx(Dt,{align:"start",sideOffset:8,collisionPadding:16,className:"w-72 p-3",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[tt,nt]})}),t[68]=tt,t[69]=nt,t[70]=rt):rt=t[70];let ot;t[71]!==Je||t[72]!==rt?(ot=s.jsxs(Rt,{children:[Je,rt]}),t[71]=Je,t[72]=rt,t[73]=ot):ot=t[73];let it;t[74]!==fe||t[75]!==Ke||t[76]!==ot?(it=s.jsxs("div",{className:"flex items-center gap-0.5",children:[fe,Ke,ot]}),t[74]=fe,t[75]=Ke,t[76]=ot,t[77]=it):it=t[77];let _t;t[78]===Symbol.for("react.memo_cache_sentinel")?(_t=s.jsx(Qs,{compact:!0}),t[78]=_t):_t=t[78];let lt;t[79]!==it?(lt=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[it,_t]}),t[79]=it,t[80]=lt):lt=t[80];const On="flex-1 min-h-0 overflow-y-auto overscroll-contain flex flex-col gap-0.5 -mr-2 pr-2",Gt=R==="status"?s.jsx(s.Fragment,{children:oo(ee(ne(w))).map(M=>s.jsx(xa,{status:M.status,threads:M.threads,activeTaskId:T,onSelectTask:L=>I(L.id,L.virtual_mcp_id),onArchiveTask:de,filters:Y},M.status))}):s.jsx(ha,{groups:Z,orderScope:Q,decopilotId:i,orgPinnedIds:b,onReorder:()=>W(va),renderGroup:M=>({...Me(M)})});let at;t[81]!==Gt?(at=s.jsx("div",{className:On,children:Gt}),t[81]=Gt,t[82]=at):at=t[82];let ct;t[83]!==B||t[84]!==D||t[85]!==E?(ct=B&&s.jsx(ll,{open:D,onOpenChange:E}),t[83]=B,t[84]=D,t[85]=E,t[86]=ct):ct=t[86];let Nt;return t[87]!==ye||t[88]!==lt||t[89]!==at||t[90]!==ct?(Nt=s.jsxs("div",{className:ft,children:[ye,lt,at,ct]}),t[87]=ye,t[88]=lt,t[89]=at,t[90]=ct,t[91]=Nt):Nt=t[91],Nt}function va(t){return t+1}function ya(t){return s.jsx(qs,{value:t,children:In[t]},t)}function Sa(t){return s.jsx(qs,{value:t,children:Mn[t]},t)}function _a(t){return t+1}function Na(t){return t+1}function Ca(t){return!t.trigger_id}function wa(t){return!!t.trigger_id}function ka(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Ia(t){return!t.hidden}function Ss(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 a;return e[4]!==o||e[5]!==i?(a=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,i]}),e[4]=o,e[5]=i,e[6]=a):a=e[6],a}const Ma=5,Aa=[{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 $n(){const t=N.c(3),{state:e}=Xe();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:Ma}).map(Ta)}),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:Aa.map($a)})]}),t[2]=r):r=t[2],r}function $a(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:K("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(Oa)})]},e)}function Oa(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 Ta(t,e){return s.jsx(Ne,{className:"size-10 rounded-lg mx-auto"},e)}function Oc(){const t=N.c(4),e=Zs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(nl,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ws,{children:s.jsxs($.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Ot,{className:"mb-2"}),s.jsx($n,{})]}),children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(An,{})]})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsx(Bs,{children:s.jsx(tn,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=o):o=t[3],o}function Tc(t){const e=N.c(5),{onClose:n}=t,r=Zs();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(rl,{}),e[0]=o):o=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ws,{children:s.jsxs($.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Ot,{className:"mb-2"}),s.jsx($n,{})]}),children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(An,{})]})}),e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==r?(a=s.jsx(Bs,{children:s.jsx(Ii,{sections:r,onClose:n,footer:o,additionalContent:i})}),e[2]=n,e[3]=r,e[4]=a):a=e[4],a}function zc(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{"data-testid":"shell-route-loading",className:"absolute inset-0 flex items-center justify-center",children:s.jsx(Wt,{size:20,className:"animate-spin text-muted-foreground"})}),t[0]=e):e=t[0],e}export{jn as C,Oc as S,Tc as a,zc as b,It as c,hs as d,vn as e,bn as f};
|
|
1
|
+
import{e as N,c as K,j as s,l as Wt,r as $,t as J,p as xe,b as we,T as _s,K as qt,m as Vt,f as Te,g as Ns,d as Pn,I as Rn,U as Dn,W as En,P as Fn,R as Gn,H as Bn,G as Ln,a as Hn,B as $t,X as Un,Y as Kn,n as Ae,Z as Wn,$ as qn,a0 as Vn,F as Yn,a1 as Xn,a2 as Qn,a3 as Zn,a4 as Jn,a5 as xt,a6 as er,a7 as tr,a8 as sr,a9 as nr,aa as rr,ab as or,ac as Cs,ad as ir,ae as lr,af as ar,ag as cr,ah as dr,ai as ur,aj as mr,ak as fr,al as xr,am as hr,an as pr,o as gr,E as ws}from"./index-Uxmxa28N.js";import{u as br}from"./useRouterState-CajLqzv1.js";import{c as jr,i as vr,a as yr}from"./ZoomOut-BANb87-i.js";import{u as Xe,c as he,d as Ie,e as zt,f as Pt,g as $e,h as ks,i as Is,j as Sr,k as _r,l as Lt}from"./sidebar-BThc8k1X.js";import{T as ke}from"./toolbar-B_2b5mvX.js";import{u as Ms,T as We,a as qe,b as Ve,c as ts}from"./tooltip-DIuu50IU.js";import{S as Ne}from"./skeleton-7xZf6qTy.js";import{P as Rt,a as ut,b as Dt}from"./popover-Jfd2eq_a.js";import{b as As,a as $s,D as Os}from"./drawer-5hzhUed3.js";import{i as Ts}from"./SearchMd-BTjnXp3X.js";import{s as Nr}from"./Star01-BI7rxnuz.js";import{s as Ce}from"./Plus-Ca-boKc-.js";import{i as Cr,g as wr}from"./use-mcp-client-BcxxumZr.js";import{a as zs,u as ht,b as kr}from"./use-virtual-mcp-Baf8z8om.js";import{u as Ir}from"./use-create-virtual-mcp-mUufoSEk.js";import{I as Mr,a as Ar,u as $r,W as Or,H as Tr,S as zr,G as Pr}from"./github-repo-picker-C38g29Tm.js";import{A as Oe,W as ss,X as ns,Y as Ps,Z as Rr,_ as Dr,$ as Er}from"./agent-icon-BZpQDAZU.js";import{u as Rs,d as Fr,k as Ds}from"./tab-id-C8mEsBYo.js";import{r as Gr,a as Br,R as Lr,b as Hr,u as Es}from"./shell-layout-OG_nqUcJ.js";import{u as Ur,g as Fs,a as Kr,b as Wr,s as qr,c as Vr,r as Yr,d as Xr,e as Qr,f as Zr,p as Jr,T as Gs,h as eo,i as to,j as so,k as no,l as ro,m as oo,n as io,o as lo,S as rs,q as Bs}from"./use-navigate-to-agent-BlAYOqxb.js";import{A as os}from"./avatar-B05K9npJ.js";import{i as Ls}from"./Check-ByG0nAY6.js";import{a as is}from"./Eye-i6HoqOn_.js";import{n as ao,i as co}from"./Globe01-BoP8H_NZ.js";import{i as uo,a as Hs}from"./ZapSquare-CSP4r4PP.js";import{i as mo}from"./Monitor01-CoO9QmCK.js";import{n as fo,a as xo}from"./Sun-BB5ryFYp.js";import{a as pt}from"./Settings02-DQ3JZYho.js";import{i as ho}from"./Shield01-BqgQ6O-B.js";import{a as po}from"./Users03-dk6WdPnC.js";import{s as Us}from"./XClose-C4uc8l11.js";import{f as go,a as bo,b as jo,c as vo,d as yo,e as So,A as _o}from"./alert-dialog-RhxX9i57.js";import{F as No,a as Co,b as wo,c as ko,d as Io,e as Mo,f as Ao}from"./form-W67eg754.js";import{I as $o}from"./input-DV0lJPfu.js";import{S as Oo}from"./spinner-B4TZJa4Y.js";import"./index-CBGRBCyz.js";import{i as To,a as zo}from"./RefreshCcw01-m0oFG4br.js";import{n as Yt}from"./Stars02-Ba384PUK.js";import{u as Ks,A as Ws,g as Po,a as Ro,b as ls,K as Do,P as Eo,s as Fo,S as Go,v as Bo,D as Lo,c as Ho,d as Uo,C as Ko}from"./sortable.esm-D9tZZic5.js";import{i as Xt}from"./ChevronRight--j_9x5Si.js";import{i as Wo}from"./FilterLines-D6io39CJ.js";import{t as qo}from"./Users01-DgDkNrBR.js";import{b as as,c as qs,S as cs,a as ds,d as us}from"./select-DV1FwAD4.js";import{b as Vo,c as Yo,e as Xo,a as Qo,D as Zo}from"./dialog-NbvuzXZV.js";import{C as Jo,e as ei,c as ti,d as si,b as ni}from"./command-Dw0cdU7u.js";import{u as Vs}from"./studio-tools-DUggrN6-.js";import{i as Ys}from"./Zap-BAnl3IBe.js";import{u as ri}from"./use-org-auth-client-D8P8BtbO.js";import{H as oi,a as ii,b as li}from"./hover-card-CaSThHdV.js";import{g as ai,S as ci}from"./task-status-BbAuY8YH.js";import{u as di,f as ui}from"./use-clock-tick-DwZ4ZWpf.js";import{t as Xs}from"./ChevronDown-BnRC7SrH.js";function mi(t){const e=N.c(21),{value:n,onChange:r,placeholder:o,onKeyDown:i,className:a,isSearching:l,disabled:c}=t,d=o===void 0?"Search...":o;let u;e[0]!==a?(u=K("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=u):u=e[1];const m=c?"cursor-not-allowed opacity-50":"cursor-text";let f;e[2]!==m?(f=K("flex items-center gap-2.5 h-12 px-4",m),e[2]=m,e[3]=f):f=e[3];let g;e[4]!==l?(g=l?s.jsx(Wt,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):s.jsx(Ts,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=l,e[5]=g):g=e[5];let h;e[6]!==r?(h=b=>r(b.target.value),e[6]=r,e[7]=h):h=e[7];let x;e[8]!==c||e[9]!==i||e[10]!==d||e[11]!==h||e[12]!==n?(x=s.jsx("input",{type:"text",value:n,onChange:h,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]=h,e[12]=n,e[13]=x):x=e[13];let p;e[14]!==f||e[15]!==g||e[16]!==x?(p=s.jsxs("label",{className:f,children:[g,x]}),e[14]=f,e[15]=g,e[16]=x,e[17]=p):p=e[17];let v;return e[18]!==u||e[19]!==p?(v=s.jsx("div",{className:u,children:p}),e[18]=u,e[19]=p,e[20]=v):v=e[20],v}const fi="Select an existing agent";function xi(t){const e=N.c(5),{children:n}=t;let r;e[0]!==n?(r=s.jsx(We,{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(qe,{side:"right",sideOffset:8,children:fi}),e[2]=o):o=e[2];let i;return e[3]!==r?(i=s.jsxs(Ve,{defaultOpen:!0,delayDuration:0,children:[r,o]}),e[3]=r,e[4]=i):i=e[4],i}function hi(){const t=N.c(5),{enableDecoImport:e}=_s(),{data:n}=we.useSession();let r;t[0]!==n?.user?.email?(r=qt.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:pi,enabled:o,staleTime:3e5},t[2]=r,t[3]=o,t[4]=i):i=t[4];const{data:a}=Vt(i);return a?.isDecoUser??!1}async function pi(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function gi(t){const e=Te(),{create:n}=Rs(),{locator:r}=xe(),o=Ns({strict:!1}),i=Pn({strict:!1});return async a=>{const l=crypto.randomUUID(),c=a===i.virtualmcpid?Gr(t,r,o.taskId??""):null;try{await n({id:l,virtual_mcp_id:a,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:l},search:{virtualmcpid:a}})}}function bi(t){const e=N.c(9),{agent:n,onClick:r}=t;let o;e[0]!==n.icon||e[1]!==n.title?(o=s.jsx(Oe,{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 a;return e[5]!==r||e[6]!==o||e[7]!==i?(a=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]=a):a=e[8],a}function ji(t){const e=N.c(65),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:o}=t,[i,a]=$.useState(""),l=zs(),c=l??[],{org:d}=xe(),{data:u}=we.useSession(),m=u?.user?.id??"anon",f=Fs(l),g=Kr();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={navigateOnCreate:!0},e[0]=h):h=e[0];const{createVirtualMCP:x,isCreating:p}=Ir(h),{createFromTemplate:v,isCreating:b}=$r(),y=hi(),j=gi(d.slug),S=i.toLowerCase(),C=c.filter(vi).filter(ie=>!i||ie.title.toLowerCase().includes(S)),_=ie=>{Wr({orgId:d.id,userId:m},ie.id,f),g(),n(),a(""),j(ie.id)},I="flex flex-col max-h-[min(640px,80dvh)]";let k;e[1]!==i?(k=s.jsx(mi,{value:i,onChange:a,placeholder:"Search agents..."}),e[1]=i,e[2]=k):k=e[2];const A="overflow-y-auto flex-1 min-h-0 px-3 pb-3";let O;e[3]===Symbol.for("react.memo_cache_sentinel")?(O=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]=O):O=e[3];const T="grid grid-cols-3 gap-1";let w;e[4]!==x||e[5]!==n?(w=async()=>{J("agent_create_new_clicked",{source:"browse_popover"}),await x(),n()},e[4]=x,e[5]=n,e[6]=w):w=e[6];let P,U;e[7]===Symbol.for("react.memo_cache_sentinel")?(P=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]=P,e[8]=U):(P=e[7],U=e[8]);let z;e[9]!==p||e[10]!==w?(z=s.jsxs("button",{type:"button",disabled:p,onClick:w,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:[P,U]}),e[9]=p,e[10]=w,e[11]=z):z=e[11];let G;e[12]!==v||e[13]!==n?(G=async()=>{J("agent_create_clicked",{source:"browse_popover",method:"website"}),await v(Or),n()},e[12]=v,e[13]=n,e[14]=G):G=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(Nr,{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 D;e[17]!==b||e[18]!==G?(D=s.jsxs("button",{type:"button",disabled:b,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:[R,H]}),e[17]=b,e[18]=G,e[19]=D):D=e[19];let E;e[20]!==v||e[21]!==n?(E=async()=>{J("agent_create_clicked",{source:"browse_popover",method:"hydrogen"}),await v(Tr),n()},e[20]=v,e[21]=n,e[22]=E):E=e[22];let B,F;e[23]===Symbol.for("react.memo_cache_sentinel")?(B=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:zr,alt:"",className:"size-5 object-contain"})}),F=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Shopify Headless Store"}),e[23]=B,e[24]=F):(B=e[23],F=e[24]);let q;e[25]!==b||e[26]!==E?(q=s.jsxs("button",{type:"button",disabled:b,onClick:E,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:[B,F]}),e[25]=b,e[26]=E,e[27]=q):q=e[27];let W;e[28]!==n||e[29]!==o?(W=()=>{J("agent_import_clicked",{source:"github"}),o(),n()},e[28]=n,e[29]=o,e[30]=W):W=e[30];let X,le;e[31]===Symbol.for("react.memo_cache_sentinel")?(X=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(Pr,{className:"size-5 text-muted-foreground"})}),le=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"}),e[31]=X,e[32]=le):(X=e[31],le=e[32]);let V;e[33]!==W?(V=s.jsxs("button",{type:"button",onClick:W,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[X,le]}),e[33]=W,e[34]=V):V=e[34];let Q;e[35]!==y||e[36]!==n||e[37]!==r?(Q=y&&s.jsxs("button",{type:"button",onClick:()=>{J("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]=Q):Q=e[38];const Y=C.map(ie=>s.jsx(bi,{agent:ie,onClick:()=>_(ie)},ie.id));let te;e[39]!==z||e[40]!==D||e[41]!==q||e[42]!==V||e[43]!==Q||e[44]!==Y?(te=s.jsxs("div",{className:T,children:[z,D,q,V,Q,Y]}),e[39]=z,e[40]=D,e[41]=q,e[42]=V,e[43]=Q,e[44]=Y,e[45]=te):te=e[45];let Z;e[46]!==p||e[47]!==i||e[48]!==C.length?(Z=C.length===0&&!p&&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]=p,e[47]=i,e[48]=C.length,e[49]=Z):Z=e[49];let se;e[50]!==te||e[51]!==Z||e[52]!==O?(se=s.jsxs("div",{className:A,children:[O,te,Z]}),e[50]=te,e[51]=Z,e[52]=O,e[53]=se):se=e[53];let ne;e[54]!==d.slug?(ne={org:d.slug},e[54]=d.slug,e[55]=ne):ne=e[55];let re;e[56]!==n?(re=()=>n(),e[56]=n,e[57]=re):re=e[57];let ee;e[58]!==ne||e[59]!==re?(ee=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Rn,{to:"/$org/settings/agents",params:ne,onClick:re,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[58]=ne,e[59]=re,e[60]=ee):ee=e[60];let de;return e[61]!==se||e[62]!==k||e[63]!==ee?(de=s.jsxs("div",{className:I,children:[k,se,ee]}),e[61]=se,e[62]=k,e[63]=ee,e[64]=de):de=e[64],de}function vi(t){return!Cr(t.id)}function Qs(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,a]=$.useState(!1),[l,c]=$.useState(!1),[d,u]=$.useState(!1),m=Ms(),{setOpenMobile:f}=Xe(),g=Ur(),h=g?"border border-border":void 0;let x;e[2]!==g?(x=k=>g?s.jsx(xi,{children:k}):k,e[2]=g,e[3]=x):x=e[3];const p=x;let v;e[4]!==m||e[5]!==f?(v=()=>{a(!1),m&&f(!1)},e[4]=m,e[5]=f,e[6]=v):v=e[6];const b=v;let y;e[7]!==b||e[8]!==i?(y=i&&s.jsx($.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(ji,{onClose:b,onOpenImportDeco:()=>c(!0),onOpenGithubImport:()=>{u(!0),b()}})}),e[7]=b,e[8]=i,e[9]=y):y=e[9];const j=y;let S;e[10]!==o||e[11]!==h||e[12]!==g||e[13]!==m||e[14]!==i||e[15]!==j||e[16]!==p?(S=m?s.jsxs(s.Fragment,{children:[o?p(s.jsx(ke,{"aria-label":"Browse agents",className:K(h),onClick:()=>{J("agent_browser_opened",{surface:"mobile_drawer"}),a(!0)},children:s.jsx(Ce,{className:"size-4"})})):s.jsx(he,{children:p(s.jsxs(Ie,{tooltip:g?void 0:"Browse agents",className:K(h),onClick:()=>{J("agent_browser_opened",{surface:"mobile_drawer"}),a(!0)},children:[s.jsx(Ce,{}),s.jsx("span",{children:"New agent"})]}))}),s.jsx(As,{open:i,onOpenChange:a,direction:"bottom",children:s.jsxs($s,{className:"max-h-[85dvh] p-0",children:[s.jsx(Os,{className:"sr-only",children:"Browse agents"}),j]})})]}):s.jsxs(Rt,{open:i,onOpenChange:k=>{k&&!i&&J("agent_browser_opened",{surface:"desktop_popover"}),a(k)},children:[o?p(s.jsx(ut,{asChild:!0,children:s.jsx(ke,{"aria-label":"Browse agents",className:K(h),children:s.jsx(Ce,{className:"size-4"})})})):s.jsx(he,{children:p(s.jsx(ut,{asChild:!0,children:s.jsxs(Ie,{tooltip:g?void 0:"Browse agents",className:K(h),children:[s.jsx(Ce,{}),s.jsx("span",{children:"New agent"})]})}))}),s.jsx(Dt,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:j})]}),e[10]=o,e[11]=h,e[12]=g,e[13]=m,e[14]=i,e[15]=j,e[16]=p,e[17]=S):S=e[17];let C;e[18]!==l?(C=s.jsx(Mr,{open:l,onOpenChange:c}),e[18]=l,e[19]=C):C=e[19];let _;e[20]!==d?(_=s.jsx(Ar,{open:d,onOpenChange:u}),e[20]=d,e[21]=_):_=e[21];let I;return e[22]!==S||e[23]!==C||e[24]!==_?(I=s.jsxs(s.Fragment,{children:[S,C,_]}),e[22]=S,e[23]=C,e[24]=_,e[25]=I):I=e[25],I}function Zs(){const t=N.c(24),{org:e}=xe(),n=Te(),o=br().location.pathname,i=e.slug,{state:a,isMobile:l}=Xe(),c=!l&&a==="collapsed";let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(jr,{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 g=f;let h;t[7]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(vr,{className:"size-4!"}),t[7]=h):h=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 p;t[11]!==n||t[12]!==i?(p=()=>{n({to:"/$org/files",params:{org:i}})},t[11]=n,t[12]=i,t[13]=p):p=t[13];let v;t[14]!==x||t[15]!==p?(v={key:"files",label:"Library",icon:h,isActive:x,onClick:p},t[14]=x,t[15]=p,t[16]=v):v=t[16];const b=v;let y;t[17]!==b||t[18]!==g?(y={type:"items",items:[g,b]},t[17]=b,t[18]=g,t[19]=y):y=t[19];let j;if(t[20]!==c||t[21]!==y){if(j=[y],c){let S;t[23]===Symbol.for("react.memo_cache_sentinel")?(S={type:"custom",key:"new-task",content:s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:s.jsx(Qs,{})})})})},t[23]=S):S=t[23],j.push(S)}t[20]=c,t[21]=y,t[22]=j}else j=t[22];return j}function Ot(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 a=o===void 0?"horizontal":o,l=i===void 0?!0:i;let c;e[5]!==n?(c=K("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]!==l||e[8]!==a||e[9]!==r||e[10]!==c?(d=s.jsx(Dn,{"data-slot":"separator-root",decorative:l,orientation:a,className:c,...r}),e[7]=l,e[8]=a,e[9]=r,e[10]=c,e[11]=d):d=e[11],d}function Js(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(zt,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(Pt,{children:s.jsx($e,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function en(t){const e=N.c(18),{item:n}=t,{isMobile:r,setOpenMobile:o}=Xe();let i;e[0]!==r||e[1]!==n||e[2]!==o?(i=()=>{J("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 a=i,l=n.key,c=n.isActive&&"z-10";let d;e[4]!==c?(d=K(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]!==a||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==u?(m=s.jsxs(Ie,{onClick:a,isActive:n.isActive,tooltip:n.label,children:[n.icon,u]}),e[8]=a,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},l),e[14]=n.key,e[15]=d,e[16]=m,e[17]=f):f=e[17],f}function yi(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(ks,{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(_i),e[2]=n.group.items,e[3]=i):i=e[3];let a;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(a=s.jsx(Js,{label:r,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=a):a=e[7],a}case"items":{let r;e[8]!==n.items?(r=n.items.map(Si),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}case"custom":return n.content}}function Si(t){return s.jsx(en,{item:t},t.key)}function _i(t){return s.jsx(en,{item:t},t.key)}function Ni(t){const e=N.c(14),{sections:n,footer:r,additionalContent:o,variant:i,contentClassName:a}=t,l=i===void 0?"sidebar":i;let c;e[0]!==a?(c=K("flex flex-col flex-1 px-2 py-2 gap-0.5",a),e[0]=a,e[1]=c):c=e[1];let d;e[2]!==n?(d=n.map(Ci),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(Is,{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]!==l?(f=s.jsxs(Sr,{variant:l,children:[m,r]}),e[10]=r,e[11]=m,e[12]=l,e[13]=f):f=e[13],f}function Ci(t,e){return s.jsx(yi,{section:t},e)}function tn(t){const e=N.c(2);let n;return e[0]!==t?(n=s.jsx(Ni,{...t}),e[0]=t,e[1]=n):n=e[1],n}tn.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 wi(){const t=N.c(7),n=_s().logo??En,r=typeof n=="string"?n:n.light,o=typeof n=="string"?n:n.dark;let i;t[0]!==r?(i=s.jsx("img",{src:r,alt:"Logo",className:"size-6 object-contain dark:hidden"}),t[0]=r,t[1]=i):i=t[1];let a;t[2]!==o?(a=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=o,t[3]=a):a=t[3];let l;return t[4]!==i||t[5]!==a?(l=s.jsxs(_r,{className:"flex flex-row items-center shrink-0 h-12 px-3 pb-0",children:[i,a]}),t[4]=i,t[5]=a,t[6]=l):l=t[6],l}function ms(t){const e=N.c(18),{item:n,onClose:r}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=K(o),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==n||e[3]!==r?(a=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=a):a=e[4];let l;e[5]!==n.icon?(l=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=l):l=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]!==a||e[12]!==l||e[13]!==c?(d=s.jsxs(Ie,{onClick:a,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[l,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=a,e[12]=l,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 ki(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(ks,{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 a;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],a=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=a}else a=e[4];let l;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==a?(l=s.jsx(Js,{label:o,defaultExpanded:i,children:a}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=a,e[10]=l):l=e[10],l}case"items":{let o;if(e[11]!==r||e[12]!==n.items){let a;e[14]!==r?(a=l=>s.jsx(ms,{item:l,onClose:r},l.key),e[14]=r,e[15]=a):a=e[15],o=n.items.map(a),e[11]=r,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(zt,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(Pt,{children:s.jsx($e,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function Ii(t){const e=N.c(14),{sections:n,onClose:r,footer:o,additionalContent:i}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx($.Suspense,{fallback:s.jsx("div",{className:"h-10 shrink-0"}),children:s.jsx(wi,{})}),e[0]=a):a=e[0];let l;if(e[1]!==r||e[2]!==n){let m;e[4]!==r?(m=(f,g)=>s.jsx(ki,{section:f,onClose:r},g),e[4]=r,e[5]=m):m=e[5],l=n.map(m),e[1]=r,e[2]=n,e[3]=l}else l=e[3];let c;e[6]!==i?(c=i&&s.jsx("div",{className:"mt-3 flex flex-col flex-1 min-h-0",children:i}),e[6]=i,e[7]=c):c=e[7];let d;e[8]!==l||e[9]!==c?(d=s.jsxs(Is,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[l,c]}),e[8]=l,e[9]=c,e[10]=d):d=e[10];let u;return e[11]!==o||e[12]!==d?(u=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[a,d,o]}),e[11]=o,e[12]=d,e[13]=u):u=e[13],u}function sn(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Mi=Fn({name:Gn().min(2,"Organization name is required")});function Ai(t){const e=N.c(41),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={resolver:Bn(Mi),defaultValues:{name:""}},e[0]=o):o=e[0];const i=Ln(o);let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={mutationFn:Oi,onSuccess:$i},e[1]=a):a=e[1];const l=Hn(a),c=l.error instanceof Error?l.error.message:l.error?"Failed to create organization.":null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsxs(jo,{children:[s.jsx(vo,{children:"Create a new organization"}),s.jsx(yo,{children:"Set up a new organization to collaborate with others."})]}),e[2]=d):d=e[2];let u;if(e[3]!==l||e[4]!==i){let _;e[6]!==l?(_=I=>l.mutateAsync(I),e[6]=l,e[7]=_):_=e[7],u=i.handleSubmit(_),e[3]=l,e[4]=i,e[5]=u}else u=e[5];let m;e[8]!==i.formState.isSubmitting?(m=_=>{const{field:I}=_;return s.jsxs(wo,{children:[s.jsx(ko,{children:"Organization Name"}),s.jsx(Io,{children:s.jsx($o,{...I,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(Mo,{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:"","/",sn(I.value)]})]}),s.jsx(Ao,{})]})},e[8]=i.formState.isSubmitting,e[9]=m):m=e[9];let f;e[10]!==i.control||e[11]!==m?(f=s.jsx(No,{control:i.control,name:"name",render:m}),e[10]=i.control,e[11]=m,e[12]=f):f=e[12];let g;e[13]!==c?(g=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=g):g=e[14];let h;e[15]!==l||e[16]!==i?(h=()=>{l.reset(),i.reset()},e[15]=l,e[16]=i,e[17]=h):h=e[17];let x;e[18]!==i.formState.isSubmitting||e[19]!==h?(x=s.jsx(go,{disabled:i.formState.isSubmitting,onClick:h,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=h,e[20]=x):x=e[20];const p=!i.formState.isValid||i.formState.isSubmitting;let v;e[21]!==i.formState.isSubmitting?(v=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Oo,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=v):v=e[22];let b;e[23]!==p||e[24]!==v?(b=s.jsx($t,{type:"submit",variant:"default",disabled:p,children:v}),e[23]=p,e[24]=v,e[25]=b):b=e[25];let y;e[26]!==b||e[27]!==x?(y=s.jsxs(So,{children:[x,b]}),e[26]=b,e[27]=x,e[28]=y):y=e[28];let j;e[29]!==y||e[30]!==u||e[31]!==f||e[32]!==g?(j=s.jsxs("form",{className:"space-y-6",onSubmit:u,autoComplete:"off",children:[f,g,y]}),e[29]=y,e[30]=u,e[31]=f,e[32]=g,e[33]=j):j=e[33];let S;e[34]!==i||e[35]!==j?(S=s.jsxs(bo,{children:[d,s.jsx(Co,{...i,children:j})]}),e[34]=i,e[35]=j,e[36]=S):S=e[36];let C;return e[37]!==r||e[38]!==n||e[39]!==S?(C=s.jsx(_o,{open:n,onOpenChange:r,children:S}),e[37]=r,e[38]=n,e[39]=S,e[40]=C):C=e[40],C}function $i(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function Oi(t){const e=sn(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 Ht(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 Ti(t){const e=N.c(13),{org:n,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",a=o==="xs"?"text-[9px]":"text-xs";let l;e[0]!==i?(l=K(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=l):l=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:Ht(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]!==a?(d=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:K("font-semibold leading-none",a),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=a,e[8]=d):d=e[8];let u;return e[9]!==l||e[10]!==c||e[11]!==d?(u=s.jsx("div",{className:l,style:c,children:d}),e[9]=l,e[10]=c,e[11]=d,e[12]=u):u=e[12],u}function wt(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 a;e[16]!==n.label?(a=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=a):a=e[17];let l;return e[18]!==o||e[19]!==i||e[20]!==a?(l=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,a]}),e[18]=o,e[19]=i,e[20]=a,e[21]=l):l=e[21],l}function fs(t){const e=N.c(31),{orgParam:n,onSelectOrg:r,onCreateOrg:o}=t,{data:i}=Vn();let a;e[0]!==n?(a=(w,P)=>w.slug===n?-1:P.slug===n?1:w.name.localeCompare(P.name),e[0]=n,e[1]=a):a=e[1];const l=[...i??[]].sort(a),[c,d]=$.useState(!1),[u,m]=$.useState(""),f=u.toLowerCase(),g=f?l.filter(w=>w.name.toLowerCase().includes(f)||w.slug.toLowerCase().includes(f)):l;let h;e[2]!==c?(h=function(){c&&m(""),d(zi)},e[2]=c,e[3]=h):h=e[3];const x=h;let p;e[4]!==u||e[5]!==c||e[6]!==x?(p=c?s.jsx("input",{autoFocus:!0,type:"text",value:u,onChange:w=>m(w.target.value),onKeyDown:w=>w.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]=p):p=e[7];let v;e[8]!==c?(v=c?s.jsx(Us,{size:16}):s.jsx(Ts,{size:16}),e[8]=c,e[9]=v):v=e[9];let b;e[10]!==v||e[11]!==x?(b=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:v}),e[10]=v,e[11]=x,e[12]=b):b=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 j;e[14]!==o?(j=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]=j):j=e[15];let S;e[16]!==b||e[17]!==j?(S=s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[b,j]}),e[16]=b,e[17]=j,e[18]=S):S=e[18];let C;e[19]!==p||e[20]!==S?(C=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[p,S]}),e[19]=p,e[20]=S,e[21]=C):C=e[21];const _="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",I=g.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 k;e[22]!==r||e[23]!==n?(k=w=>s.jsxs("button",{type:"button",onClick:()=>r(w.slug),className:K("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",w.slug===n?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(Ti,{org:w,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:w.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:w.slug})]}),w.slug===n&&s.jsx(Ls,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},w.id),e[22]=r,e[23]=n,e[24]=k):k=e[24];const A=g.map(k);let O;e[25]!==I||e[26]!==A?(O=s.jsxs("div",{className:_,children:[I,A]}),e[25]=I,e[26]=A,e[27]=O):O=e[27];let T;return e[28]!==O||e[29]!==C?(T=s.jsxs(s.Fragment,{children:[C,O]}),e[28]=O,e[29]=C,e[30]=T):T=e[30],T}function zi(t){return!t}function xs(t){const e=N.c(142),{user:n,userImage:r,menuItems:o,signOutItem:i,themeOptions:a,preferences:l,setPreferences:c,orgParam:d,onSelectOrg:u,onCreateOrg:m,close:f,isMobile:g,open:h}=t;if(g){const Y=n?.name??"U";let te;e[0]!==Y||e[1]!==r?(te=s.jsx(os,{url:r,fallback:Y,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=Y,e[1]=r,e[2]=te):te=e[2];const Z=n?.name??"User";let se;e[3]!==Z?(se=s.jsx("p",{className:"text-sm font-medium truncate",children:Z}),e[3]=Z,e[4]=se):se=e[4];const ne=n?.email;let re;e[5]!==ne?(re=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ne}),e[5]=ne,e[6]=re):re=e[6];let ee;e[7]!==se||e[8]!==re?(ee=s.jsxs("div",{className:"flex-1 min-w-0",children:[se,re]}),e[7]=se,e[8]=re,e[9]=ee):ee=e[9];let de;e[10]!==n?(de=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ei)},e[10]=n,e[11]=de):de=e[11];let ie;e[12]===Symbol.for("react.memo_cache_sentinel")?(ie=s.jsx(is,{size:14}),e[12]=ie):ie=e[12];let ze;e[13]!==de?(ze=s.jsx(We,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:de,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ie})}),e[13]=de,e[14]=ze):ze=e[14];let Pe;e[15]===Symbol.for("react.memo_cache_sentinel")?(Pe=s.jsx(qe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=Pe):Pe=e[15];let pe;e[16]!==ze?(pe=s.jsx(ts,{delayDuration:300,children:s.jsxs(Ve,{children:[ze,Pe]})}),e[16]=ze,e[17]=pe):pe=e[17];let Re;e[18]!==pe||e[19]!==te||e[20]!==ee?(Re=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[te,ee,pe]}),e[18]=pe,e[19]=te,e[20]=ee,e[21]=Re):Re=e[21];const mt=String(h);let De;e[22]!==m||e[23]!==u||e[24]!==d||e[25]!==mt?(De=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx(fs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},mt)}),e[22]=m,e[23]=u,e[24]=d,e[25]=mt,e[26]=De):De=e[26];let Ee;if(e[27]!==f||e[28]!==o){let ue;e[30]!==f?(ue=He=>s.jsx(wt,{item:He,onClose:f},He.key),e[30]=f,e[31]=ue):ue=e[31],Ee=o.map(ue),e[27]=f,e[28]=o,e[29]=Ee}else Ee=e[29];let Me;e[32]!==f||e[33]!==i?(Me=s.jsx(wt,{item:i,onClose:f}),e[32]=f,e[33]=i,e[34]=Me):Me=e[34];let ae;e[35]!==Ee||e[36]!==Me?(ae=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[Ee,Me]}),e[35]=Ee,e[36]=Me,e[37]=ae):ae=e[37];let Fe;e[38]!==De||e[39]!==ae?(Fe=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[De,ae]}),e[38]=De,e[39]=ae,e[40]=Fe):Fe=e[40];let Ge;if(e[41]!==l.theme||e[42]!==c||e[43]!==a){let ue;e[45]!==l.theme||e[46]!==c?(ue=He=>{const{value:_e,icon:Ue,label:Ke}=He;return s.jsx("button",{type:"button","aria-label":Ke,onClick:()=>c(Qe=>({...Qe,theme:_e})),className:K("size-8 rounded-md flex items-center justify-center transition-colors",l.theme===_e?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Ue},_e)},e[45]=l.theme,e[46]=c,e[47]=ue):ue=e[47],Ge=a.map(ue),e[41]=l.theme,e[42]=c,e[43]=a,e[44]=Ge}else Ge=e[44];let Ye;e[48]!==Ge?(Ye=s.jsx("div",{className:"flex items-center gap-0.5",children:Ge}),e[48]=Ge,e[49]=Ye):Ye=e[49];const ft=l.enableSounds?"Disable sounds":"Enable sounds";let ve;e[50]!==c?(ve=()=>c(Di),e[50]=c,e[51]=ve):ve=e[51];const ye=l.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let me;e[52]!==ye?(me=K("size-8 rounded-md flex items-center justify-center transition-colors",ye),e[52]=ye,e[53]=me):me=e[53];let ge;e[54]!==l.enableSounds?(ge=l.enableSounds?s.jsx(ss,{size:14}):s.jsx(ns,{size:14}),e[54]=l.enableSounds,e[55]=ge):ge=e[55];let fe;e[56]!==ft||e[57]!==ve||e[58]!==me||e[59]!==ge?(fe=s.jsx("button",{type:"button","aria-label":ft,onClick:ve,className:me,children:ge}),e[56]=ft,e[57]=ve,e[58]=me,e[59]=ge,e[60]=fe):fe=e[60];let Be;e[61]===Symbol.for("react.memo_cache_sentinel")?(Be=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.35.6"]}),e[61]=Be):Be=e[61];let be;e[62]!==fe?(be=s.jsxs("div",{className:"flex items-center gap-2",children:[fe,Be]}),e[62]=fe,e[63]=be):be=e[63];let Se;e[64]!==Ye||e[65]!==be?(Se=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[Ye,be]}),e[64]=Ye,e[65]=be,e[66]=Se):Se=e[66];let Le;return e[67]!==Re||e[68]!==Fe||e[69]!==Se?(Le=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[Re,Fe,Se]}),e[67]=Re,e[68]=Fe,e[69]=Se,e[70]=Le):Le=e[70],Le}const x=n?.name??"U";let p;e[71]!==x||e[72]!==r?(p=s.jsx(os,{url:r,fallback:x,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=x,e[72]=r,e[73]=p):p=e[73];const v=n?.name??"User";let b;e[74]!==v?(b=s.jsx("p",{className:"text-sm font-medium truncate",children:v}),e[74]=v,e[75]=b):b=e[75];const y=n?.email;let j;e[76]!==y?(j=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:y}),e[76]=y,e[77]=j):j=e[77];let S;e[78]!==b||e[79]!==j?(S=s.jsxs("div",{className:"flex-1 min-w-0",children:[b,j]}),e[78]=b,e[79]=j,e[80]=S):S=e[80];let C;e[81]!==n?(C=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(Ri)},e[81]=n,e[82]=C):C=e[82];let _;e[83]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(is,{size:14}),e[83]=_):_=e[83];let I;e[84]!==C?(I=s.jsx(We,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:C,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:_})}),e[84]=C,e[85]=I):I=e[85];let k;e[86]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(qe,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=k):k=e[86];let A;e[87]!==I?(A=s.jsx(ts,{delayDuration:300,children:s.jsxs(Ve,{children:[I,k]})}),e[87]=I,e[88]=A):A=e[88];let O;e[89]!==A||e[90]!==p||e[91]!==S?(O=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[p,S,A]}),e[89]=A,e[90]=p,e[91]=S,e[92]=O):O=e[92];let T;if(e[93]!==f||e[94]!==o){let Y;e[96]!==f?(Y=te=>s.jsx(wt,{item:te,onClose:f},te.key),e[96]=f,e[97]=Y):Y=e[97],T=o.map(Y),e[93]=f,e[94]=o,e[95]=T}else T=e[95];let w;e[98]!==f||e[99]!==i?(w=s.jsx(wt,{item:i,onClose:f}),e[98]=f,e[99]=i,e[100]=w):w=e[100];let P;e[101]!==T||e[102]!==w?(P=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[T,w]}),e[101]=T,e[102]=w,e[103]=P):P=e[103];let U;if(e[104]!==l.theme||e[105]!==c||e[106]!==a){let Y;e[108]!==l.theme||e[109]!==c?(Y=te=>{const{value:Z,icon:se,label:ne}=te;return s.jsx("button",{type:"button","aria-label":ne,onClick:()=>c(re=>({...re,theme:Z})),className:K("size-7 rounded-md flex items-center justify-center transition-colors",l.theme===Z?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:se},Z)},e[108]=l.theme,e[109]=c,e[110]=Y):Y=e[110],U=a.map(Y),e[104]=l.theme,e[105]=c,e[106]=a,e[107]=U}else U=e[107];let z;e[111]!==U?(z=s.jsx("div",{className:"flex items-center gap-0.5",children:U}),e[111]=U,e[112]=z):z=e[112];const G=l.enableSounds?"Disable sounds":"Enable sounds";let R;e[113]!==c?(R=()=>c(Pi),e[113]=c,e[114]=R):R=e[114];const H=l.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let D;e[115]!==H?(D=K("size-7 rounded-md flex items-center justify-center transition-colors",H),e[115]=H,e[116]=D):D=e[116];let E;e[117]!==l.enableSounds?(E=l.enableSounds?s.jsx(ss,{size:14}):s.jsx(ns,{size:14}),e[117]=l.enableSounds,e[118]=E):E=e[118];let B;e[119]!==G||e[120]!==R||e[121]!==D||e[122]!==E?(B=s.jsx("button",{type:"button","aria-label":G,onClick:R,className:D,children:E}),e[119]=G,e[120]=R,e[121]=D,e[122]=E,e[123]=B):B=e[123];let F;e[124]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","3.35.6"]}),e[124]=F):F=e[124];let q;e[125]!==B?(q=s.jsxs("div",{className:"flex items-center gap-2",children:[B,F]}),e[125]=B,e[126]=q):q=e[126];let W;e[127]!==z||e[128]!==q?(W=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[z,q]}),e[127]=z,e[128]=q,e[129]=W):W=e[129];let X;e[130]!==O||e[131]!==P||e[132]!==W?(X=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[O,P,W]}),e[130]=O,e[131]=P,e[132]=W,e[133]=X):X=e[133];const le=String(h);let V;e[134]!==m||e[135]!==u||e[136]!==d||e[137]!==le?(V=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx(fs,{orgParam:d,onSelectOrg:u,onCreateOrg:m},le)}),e[134]=m,e[135]=u,e[136]=d,e[137]=le,e[138]=V):V=e[138];let Q;return e[139]!==X||e[140]!==V?(Q=s.jsxs("div",{className:"flex min-h-[380px] w-full overflow-hidden",children:[X,V]}),e[139]=X,e[140]=V,e[141]=Q):Q=e[141],Q}function Pi(t){return{...t,enableSounds:!t.enableSounds}}function Ri(){Ae.success("User ID copied")}function Di(t){return{...t,enableSounds:!t.enableSounds}}function Ei(){Ae.success("User ID copied")}function Ut(){const t=N.c(44),{data:e}=we.useSession(),{org:n}=xe(),r=Te();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const a=Un(o)?.params.org,[l,c]=Kn(),d=Ms(),[u,m]=$.useState(!1),[f,g]=$.useState(!1),h=e?.user,x=h?.image;let p;t[1]!==r?(p=X=>{m(!1),r({to:"/$org",params:{org:X}})},t[1]=r,t[2]=p):p=t[2];const v=p;let b;t[3]===Symbol.for("react.memo_cache_sentinel")?(b=()=>m(!1),t[3]=b):b=t[3];const y=b;let j;t[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(pt,{size:16}),t[4]=j):j=t[4];let S;t[5]!==r||t[6]!==a?(S={key:"preferences",label:"Preferences",icon:j,onClick:()=>{r({to:"/$org/settings/profile",params:{org:a??""}})}},t[5]=r,t[6]=a,t[7]=S):S=t[7];let C;t[8]!==n||t[9]!==r?(C=n?[{key:"install-app",label:"Add to Home Screen",icon:s.jsx(ao,{size:16}),onClick:()=>{r({to:"/$org/install",params:{org:n.slug}})}}]:[],t[8]=n,t[9]=r,t[10]=C):C=t[10];let _;t[11]===Symbol.for("react.memo_cache_sentinel")?(_={key:"terms",label:"Terms of Use",icon:s.jsx(yr,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[11]=_):_=t[11];let I;t[12]===Symbol.for("react.memo_cache_sentinel")?(I={key:"privacy",label:"Privacy Policy",icon:s.jsx(ho,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[12]=I):I=t[12];let k;t[13]===Symbol.for("react.memo_cache_sentinel")?(k={key:"github",label:"decocms/studio",icon:s.jsx(Wn,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[13]=k):k=t[13];let A;t[14]===Symbol.for("react.memo_cache_sentinel")?(A={key:"community",label:"Community",icon:s.jsx(po,{size:16}),href:"https://decocms.com/discord",external:!0},t[14]=A):A=t[14];let O;t[15]===Symbol.for("react.memo_cache_sentinel")?(O={key:"homepage",label:"Homepage",icon:s.jsx(co,{size:16}),href:"https://decocms.com",external:!0},t[15]=O):O=t[15];let T;t[16]!==S||t[17]!==C?(T=[S,...C,_,I,k,A,O],t[16]=S,t[17]=C,t[18]=T):T=t[18];const w=T;let P;t[19]===Symbol.for("react.memo_cache_sentinel")?(P={key:"logout",label:"Sign out",icon:s.jsx(uo,{size:16}),onClick:Gi},t[19]=P):P=t[19];const U=P;let z;t[20]===Symbol.for("react.memo_cache_sentinel")?(z={value:"light",icon:s.jsx(fo,{size:14}),label:"Light theme"},t[20]=z):z=t[20];let G;t[21]===Symbol.for("react.memo_cache_sentinel")?(G={value:"dark",icon:s.jsx(xo,{size:14}),label:"Dark theme"},t[21]=G):G=t[21];let R;t[22]===Symbol.for("react.memo_cache_sentinel")?(R=[z,G,{value:"system",icon:s.jsx(mo,{size:14}),label:"System theme"}],t[22]=R):R=t[22];const H=R;let D;t[23]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{m(!1),g(!0)},t[23]=D):D=t[23];let E;t[24]!==v||t[25]!==d||t[26]!==w||t[27]!==u||t[28]!==a||t[29]!==l||t[30]!==c||t[31]!==h||t[32]!==x?(E={user:h,userImage:x,menuItems:w,signOutItem:U,themeOptions:H,preferences:l,setPreferences:c,orgParam:a,onSelectOrg:v,onCreateOrg:D,close:y,isMobile:d,open:u},t[24]=v,t[25]=d,t[26]=w,t[27]=u,t[28]=a,t[29]=l,t[30]=c,t[31]=h,t[32]=x,t[33]=E):E=t[33];const B=E;let F;t[34]!==n||t[35]!==d||t[36]!==u||t[37]!==B?(F=d?s.jsxs(As,{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:Ht(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($s,{className:"h-[80dvh] p-0",children:[s.jsx(Os,{className:"sr-only",children:"Account"}),s.jsx(xs,{...B})]})]}):s.jsxs(Rt,{open:u,onOpenChange:m,children:[s.jsx(ut,{asChild:!0,children:s.jsxs(Ie,{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:Ht(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(Dt,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:Fi,children:s.jsx(xs,{...B})})]}),t[34]=n,t[35]=d,t[36]=u,t[37]=B,t[38]=F):F=t[38];let q;t[39]!==f?(q=s.jsx(Ai,{open:f,onOpenChange:g}),t[39]=f,t[40]=q):q=t[40];let W;return t[41]!==F||t[42]!==q?(W=s.jsxs(s.Fragment,{children:[F,q]}),t[41]=F,t[42]=q,t[43]=W):W=t[43],W}function Fi(t){return t.preventDefault()}function Gi(){J("signed_out",{source:"account_popover"}),qn(),we.signOut()}function Bi({invitation:t}){const[e,n]=$.useState(!1),[r,o]=$.useState(!1),i=Yn(),a=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!"),Xn();let c;try{c=(await we.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},l=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($t,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:a,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(Ls,{size:14})}),s.jsx($t,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:l,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(Us,{size:14})})]})]})}function Li(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 a;e[2]!==n.eyebrow?(a=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=a):a=e[3];let l;e[4]!==n.title?(l=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=l):l=e[5];let c;e[6]!==a||e[7]!==l?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[a,l]}),e[6]=a,e[7]=l,e[8]=c):c=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Xt,{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 Hi(){const t=$.useContext(Qn),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function nn(){const t=N.c(10),{isSeen:e,markSeen:n,unseenCount:r}=Br(),o=Hi();let i;if(t[0]!==e||t[1]!==o){const c=[...o].sort(Wi).map(Ki);let d;t[3]!==e?(d=m=>({type:"release",release:m,isSeen:e(m.id)}),t[3]=e,t[4]=d):d=t[4];const u=[...Lr].sort(Ui).map(d);i=[...c,...u],t[0]=e,t[1]=o,t[2]=i}else i=t[2];const a=r+o.length;let l;return t[5]!==n||t[6]!==o||t[7]!==i||t[8]!==a?(l={items:i,pendingInvitations:o,redDotCount:a,markReleaseSeen:n},t[5]=n,t[6]=o,t[7]=i,t[8]=a,t[9]=l):l=t[9],l}function Ui(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function Ki(t){return{type:"invitation",invitation:t}}function Wi(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}class rn extends $.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 on(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function qi(){const t=N.c(17),e=Te(),{org:n}=xe(),{hasDecoKey:r,balanceDollars:o}=Ks();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 a;t[2]!==o?(a=K(o!=null&&on(o)),t[2]=o,t[3]=a):a=t[3];let l;t[4]!==e||t[5]!==n.slug?(l=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[4]=e,t[5]=n.slug,t[6]=l):l=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ps,{}),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]!==a||t[14]!==l||t[15]!==u?(m=s.jsx($e,{children:s.jsx(he,{children:s.jsxs(Ie,{tooltip:i,className:a,onClick:l,children:[c,u]})})}),t[12]=i,t[13]=a,t[14]=l,t[15]=u,t[16]=m):m=t[16],m}function Vi(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(rn,{children:s.jsx($.Suspense,{fallback:null,children:s.jsx(qi,{})})}),t[0]=e):e=t[0],e}function Yi(){const t=N.c(17),e=Te(),{org:n}=xe(),{hasDecoKey:r,balanceDollars:o}=Ks();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 a=i;let l;t[2]!==e||t[3]!==n.slug?(l=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[2]=e,t[3]=n.slug,t[4]=l):l=t[4];let c;t[5]!==o?(c=K(o!=null&&on(o)),t[5]=o,t[6]=c):c=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ps,{className:"size-4"}),t[7]=d):d=t[7];let u;t[8]!==l||t[9]!==c||t[10]!==a?(u=s.jsx(We,{asChild:!0,children:s.jsx(ke,{"aria-label":a,onClick:l,className:c,children:d})}),t[8]=l,t[9]=c,t[10]=a,t[11]=u):u=t[11];let m;t[12]!==a?(m=s.jsx(qe,{side:"top",children:a}),t[12]=a,t[13]=m):m=t[13];let f;return t[14]!==u||t[15]!==m?(f=s.jsxs(Ve,{delayDuration:300,children:[u,m]}),t[14]=u,t[15]=m,t[16]=f):f=t[16],f}function Xi(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(rn,{children:s.jsx($.Suspense,{fallback:null,children:s.jsx(Yi,{})})}),t[0]=e):e=t[0],e}function ln(t){const e=N.c(15),{children:n}=t,{items:r,markReleaseSeen:o}=nn(),[i,a]=$.useState(null);let l;if(e[0]!==r||e[1]!==i){let x;e[3]!==i?(x=p=>p.type==="release"&&p.release.id===i,e[3]=i,e[4]=x):x=e[4],l=r.find(x),e[0]=r,e[1]=i,e[2]=l}else l=e[2];const c=l,d=c?.type==="release"?c.release:null;let u;e[5]!==o?(u=x=>{a(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||a(null)},e[7]=f):f=e[7];let g;e[8]!==m||e[9]!==r||e[10]!==d?(g=s.jsx(Dt,{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($t,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>a(null),children:s.jsx(To,{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(Hr,{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(Yt,{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 and release updates will appear here"})]}):s.jsx("div",{className:"overflow-y-auto flex-1",children:r.map(x=>x.type==="invitation"?s.jsx(Bi,{invitation:x.invitation},`inv-${x.invitation.id}`):s.jsx(Li,{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]=g):g=e[11];let h;return e[12]!==n||e[13]!==g?(h=s.jsxs(Rt,{onOpenChange:f,children:[n,g]}),e[12]=n,e[13]=g,e[14]=h):h=e[14],h}function an(){const{redDotCount:t}=nn();return t>0}function Qi(){const t=N.c(6),e=an();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Yt,{}),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(ln,{children:s.jsx(ut,{asChild:!0,children:s.jsxs(Ie,{tooltip:"Inbox",className:"relative",children:[n,r,o]})})}),t[4]=r,t[5]=i):i=t[5],i}function Zi(){const t=N.c(8),e=an();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Yt,{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(ut,{asChild:!0,children:s.jsx(We,{asChild:!0,children:s.jsxs(ke,{"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(qe,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let a;return t[6]!==o?(a=s.jsx(ln,{children:s.jsxs(Ve,{delayDuration:300,children:[o,i]})}),t[6]=o,t[7]=a):a=t[7],a}function Ji(){const t=N.c(3),[e,n]=$.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Ie,{tooltip:"Connections",onClick:()=>{J("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:[s.jsx(Hs,{}),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(Ws,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function el(){const t=N.c(3),[e,n]=$.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Ve,{delayDuration:300,children:[s.jsx(We,{asChild:!0,children:s.jsx(ke,{"aria-label":"Connections",onClick:()=>{J("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(Hs,{className:"size-4"})})}),s.jsx(qe,{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(Ws,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function tl(){const t=N.c(7),e=Te(),{org:n}=xe();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(pt,{}),i=s.jsx("span",{children:"Settings"}),t[3]=o,t[4]=i):(o=t[3],i=t[4]);let a;return t[5]!==r?(a=s.jsxs(Ie,{tooltip:"Settings",onClick:r,children:[o,i]}),t[5]=r,t[6]=a):a=t[6],a}function sl(){const t=N.c(9),e=Te(),{org:n}=xe();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(pt,{className:"size-4"}),t[3]=o):o=t[3];let i;t[4]!==r?(i=s.jsx(We,{asChild:!0,children:s.jsx(ke,{"aria-label":"Settings",onClick:r,children:o})}),t[4]=r,t[5]=i):i=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(qe,{side:"top",children:"Settings"}),t[6]=a):a=t[6];let l;return t[7]!==i?(l=s.jsxs(Ve,{delayDuration:300,children:[i,a]}),t[7]=i,t[8]=l):l=t[8],l}function nl(){const t=N.c(6),{state:e}=Xe();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Vi,{}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(he,{children:s.jsx(Ji,{})}),t[1]=i):i=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(he,{children:s.jsx(Qi,{})}),t[2]=a):a=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(he,{children:s.jsx(tl,{})}),t[3]=l):l=t[3];let c;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(Lt,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs($e,{children:[i,a,l,s.jsx(he,{children:s.jsx(Ut,{})})]})]}),t[4]=c):c=t[4],c}let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Lt,{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($e,{children:s.jsx(he,{children:s.jsx(Ut,{})})})}),s.jsx(sl,{}),s.jsx(Zi,{}),s.jsx(el,{}),s.jsx(Xi,{})]})}),t[5]=r):r=t[5],r}function rl(){const t=N.c(8),e=Te(),{org:n}=xe(),{setOpenMobile:r}=Xe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx($e,{children:s.jsx(he,{children:s.jsx(Ut,{})})})}),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 a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(pt,{className:"size-4"}),t[5]=a):a=t[5];let l;return t[6]!==i?(l=s.jsx(Lt,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[o,s.jsx(ke,{"aria-label":"Settings",onClick:i,children:a})]})}),t[6]=i,t[7]=l):l=t[7],l}function ol(t){const e=N.c(8),{virtualMcpId:n,size:r,showAutomationBadge:o}=t,i=r===void 0?"sm":r;let a;e[0]!==i||e[1]!==n?(a=n?s.jsx(il,{virtualMcpId:n,size:i}):s.jsx(Oe,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=a):a=e[2];let l;e[3]!==o?(l=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(Ys,{size:10,className:"text-white"})}),e[3]=o,e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==l?(c=s.jsxs("div",{className:"relative shrink-0",children:[a,l]}),e[5]=a,e[6]=l,e[7]=c):c=e[7],c}function il(t){const e=N.c(6),{virtualMcpId:n,size:r}=t,o=ht(n);if(!o){let l;return e[0]!==r?(l=s.jsx(Oe,{icon:null,name:"?",size:r}),e[0]=r,e[1]=l):l=e[1],l}const i=o.icon??null;let a;return e[2]!==o.title||e[3]!==r||e[4]!==i?(a=s.jsx(Oe,{icon:i,name:o.title,size:r}),e[2]=o.title,e[3]=r,e[4]=i,e[5]=a):a=e[5],a}function ll(t){const e=N.c(36),{open:n,onOpenChange:r}=t,[o,i]=$.useState(""),{org:a}=xe(),{setTaskId:l}=Es(),c=Vs();let d,u,m;e[0]!==a.id||e[1]!==o?(m=o.trim(),u=Vt,d=qt.globalSearch(a.id,m),e[0]=a.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 g;e[5]!==c||e[6]!==m?(g=async()=>await c.call("GLOBAL_SEARCH",{query:m,limit:20}),e[5]=c,e[6]=m,e[7]=g):g=e[7];let h;e[8]!==d||e[9]!==f||e[10]!==g?(h={queryKey:d,enabled:f,queryFn:g,staleTime:1e4},e[8]=d,e[9]=f,e[10]=g,e[11]=h):h=e[11];const{data:x,isFetching:p}=u(h);let v;e[12]!==x?.items?(v=x?.items??[],e[12]=x?.items,e[13]=v):v=e[13];const b=v;let y;e[14]!==r?(y=w=>{w||i(""),r(w)},e[14]=r,e[15]=y):y=e[15];const j=y;let S;e[16]!==j||e[17]!==l?(S=w=>{j(!1),l(w.id,w.virtual_mcp_id??void 0)},e[16]=j,e[17]=l,e[18]=S):S=e[18];const C=S;let _;e[19]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(Vo,{className:"sr-only",children:[s.jsx(Yo,{children:"Search"}),s.jsx(Xo,{children:"Search across your organization's resources."})]}),e[19]=_):_=e[19];let I;e[20]!==o?(I=s.jsx(ti,{value:o,onValueChange:i,placeholder:"Search..."}),e[20]=o,e[21]=I):I=e[21];let k;e[22]!==C||e[23]!==p||e[24]!==b||e[25]!==m?(k=m?p&&b.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):b.length===0?s.jsx(Jo,{children:"No results."}):b.map(w=>w.type==="thread"?s.jsxs(ei,{value:`thread:${w.id}:${w.title}`,onSelect:()=>C(w),className:"gap-2.5",children:[s.jsx(ol,{virtualMcpId:w.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:w.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(w.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${w.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[22]=C,e[23]=p,e[24]=b,e[25]=m,e[26]=k):k=e[26];let A;e[27]!==k?(A=s.jsx(si,{children:k}),e[27]=k,e[28]=A):A=e[28];let O;e[29]!==I||e[30]!==A?(O=s.jsxs(Qo,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[_,s.jsxs(ni,{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,A]})]}),e[29]=I,e[30]=A,e[31]=O):O=e[31];let T;return e[32]!==j||e[33]!==n||e[34]!==O?(T=s.jsx(Zo,{open:n,onOpenChange:j,children:O}),e[32]=j,e[33]=n,e[34]=O,e[35]=T):T=e[35],T}function al(t){return t==="owner"||t==="admin"}function cl(){const t=N.c(11),{locator:e}=xe(),n=ri(),{data:r}=we.useSession(),o=r?.user?.id;let i;t[0]!==e?(i=qt.members(e),t[0]=e,t[1]=i):i=t[1];let a;t[2]!==n?(a=()=>n.organization.listMembers(),t[2]=n,t[3]=a):a=t[3];const l=!!o;let c;t[4]!==i||t[5]!==a||t[6]!==l?(c={queryKey:i,queryFn:a,enabled:l,staleTime:6e4},t[4]=i,t[5]=a,t[6]=l,t[7]=c):c=t[7];const{data:d}=Vt(c);let u;if(t[8]!==d?.data?.members||t[9]!==o){const f=(d?.data?.members??[]).find(g=>g.userId===o)?.role;u=al(f??void 0),t[8]=d?.data?.members,t[9]=o,t[10]=u}else u=t[10];return u}var Qt="ContextMenu",[dl]=ir(Qt,[Cs]),ce=Cs(),[ul,cn]=dl(Qt),dn=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:o,modal:i=!0}=t,[a,l]=$.useState(!1),c=ce(e),d=rr(r),u=$.useCallback(m=>{l(m),d(m)},[d]);return s.jsx(ul,{scope:e,open:a,onOpenChange:u,modal:i,children:s.jsx(or,{...c,dir:o,open:a,onOpenChange:u,modal:i,children:n})})};dn.displayName=Qt;var un="ContextMenuTrigger",mn=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=t,i=cn(un,n),a=ce(n),l=$.useRef({x:0,y:0}),c=$.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),d=$.useRef(0),u=$.useCallback(()=>window.clearTimeout(d.current),[]),m=f=>{l.current={x:f.clientX,y:f.clientY},i.onOpenChange(!0)};return $.useEffect(()=>u,[u]),$.useEffect(()=>{r&&u()},[r,u]),s.jsxs(s.Fragment,{children:[s.jsx(Zn,{...a,virtualRef:c}),s.jsx(Jn.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:xt(t.onContextMenu,f=>{u(),m(f),f.preventDefault()}),onPointerDown:r?t.onPointerDown:xt(t.onPointerDown,kt(f=>{u(),d.current=window.setTimeout(()=>m(f),700)})),onPointerMove:r?t.onPointerMove:xt(t.onPointerMove,kt(u)),onPointerCancel:r?t.onPointerCancel:xt(t.onPointerCancel,kt(u)),onPointerUp:r?t.onPointerUp:xt(t.onPointerUp,kt(u))})]})});mn.displayName=un;var ml="ContextMenuPortal",fn=t=>{const{__scopeContextMenu:e,...n}=t,r=ce(e);return s.jsx(sr,{...r,...n})};fn.displayName=ml;var xn="ContextMenuContent",hn=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=cn(xn,n),i=ce(n),a=$.useRef(!1);return s.jsx(nr,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{t.onCloseAutoFocus?.(l),!l.defaultPrevented&&a.current&&l.preventDefault(),a.current=!1},onInteractOutside:l=>{t.onInteractOutside?.(l),!l.defaultPrevented&&!o.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});hn.displayName=xn;var fl="ContextMenuGroup",xl=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(lr,{...o,...r,ref:e})});xl.displayName=fl;var hl="ContextMenuLabel",pl=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(ar,{...o,...r,ref:e})});pl.displayName=hl;var gl="ContextMenuItem",pn=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(er,{...o,...r,ref:e})});pn.displayName=gl;var bl="ContextMenuCheckboxItem",jl=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(cr,{...o,...r,ref:e})});jl.displayName=bl;var vl="ContextMenuRadioGroup",yl=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(dr,{...o,...r,ref:e})});yl.displayName=vl;var Sl="ContextMenuRadioItem",_l=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(ur,{...o,...r,ref:e})});_l.displayName=Sl;var Nl="ContextMenuItemIndicator",Cl=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(mr,{...o,...r,ref:e})});Cl.displayName=Nl;var wl="ContextMenuSeparator",gn=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(tr,{...o,...r,ref:e})});gn.displayName=wl;var kl="ContextMenuArrow",Il=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(fr,{...o,...r,ref:e})});Il.displayName=kl;var Ml="ContextMenuSubTrigger",Al=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(xr,{...o,...r,ref:e})});Al.displayName=Ml;var $l="ContextMenuSubContent",Ol=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ce(n);return s.jsx(hr,{...o,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ol.displayName=$l;function kt(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var Tl=dn,zl=mn,Pl=fn,Rl=hn,Dl=pn,El=gn;function bn(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(Tl,{"data-slot":"context-menu",...n}),e[2]=n,e[3]=r):r=e[3],r}function jn(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(zl,{"data-slot":"context-menu-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function vn(t){const e=N.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("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 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==r||e[6]!==o?(i=s.jsx(Pl,{children:s.jsx(Rl,{"data-slot":"context-menu-content",className:o,...r})}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}function It(t){const e=N.c(12);let n,r,o,i;e[0]!==t?({className:n,inset:r,variant:i,...o}=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 a=i===void 0?"default":i;let l;e[5]!==n?(l=K("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),e[5]=n,e[6]=l):l=e[6];let c;return e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==a?(c=s.jsx(Dl,{"data-slot":"context-menu-item","data-inset":r,"data-variant":a,className:l,...o}),e[7]=r,e[8]=o,e[9]=l,e[10]=a,e[11]=c):c=e[11],c}function hs(t){const e=N.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=K("bg-border -mx-1 my-1 h-px",n),e[3]=n,e[4]=o):o=e[4];let i;return e[5]!==r||e[6]!==o?(i=s.jsx(El,{"data-slot":"context-menu-separator",className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}function yn(t){const e=N.c(26),{virtualMcpId:n,isOrgPinned:r,canManageOrgPin:o,onNewTaskInGroup:i,onShowSettings:a,onToggleOrgPin:l,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(It,{onSelect:d,children:[u,"New task"]}),e[4]=d,e[5]=m):m=e[5];let f;e[6]!==a||e[7]!==n?(f=()=>a(n),e[6]=a,e[7]=n,e[8]=f):f=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(pt,{size:14,className:"mr-2"}),e[9]=g):g=e[9];let h;e[10]!==f?(h=s.jsxs(It,{onSelect:f,children:[g,"Settings"]}),e[10]=f,e[11]=h):h=e[11];let x;e[12]!==o||e[13]!==r||e[14]!==l||e[15]!==n?(x=o&&s.jsxs(s.Fragment,{children:[s.jsx(hs,{}),s.jsxs(It,{onSelect:()=>l(n,!r),children:[s.jsx(Rr,{size:14,className:"mr-2"}),r?"Unpin for all members":"Pin for all members"]})]}),e[12]=o,e[13]=r,e[14]=l,e[15]=n,e[16]=x):x=e[16];let p;e[17]!==r||e[18]!==c||e[19]!==n?(p=!r&&s.jsxs(s.Fragment,{children:[s.jsx(hs,{}),s.jsxs(It,{onSelect:()=>c(n),children:[s.jsx(zo,{size:14,className:"mr-2"}),"Hide"]})]}),e[17]=r,e[18]=c,e[19]=n,e[20]=p):p=e[20];let v;return e[21]!==m||e[22]!==h||e[23]!==x||e[24]!==p?(v=s.jsxs(s.Fragment,{children:[m,h,x,p]}),e[21]=m,e[22]=h,e[23]=x,e[24]=p,e[25]=v):v=e[25],v}function Fl(t){return t==="ephemeral"||t.startsWith("thread:")}function Et(t){const e=N.c(45),{task:n,isActive:r,onClick:o,onArchive:i,showAutomationBadge:a,showAgentIcon:l,hideStatusIdle:c}=t,d=ai(n.status),u=d.icon,m=n.metadata?.kind==="tool_call_run",f=ht(m?void 0:n.virtual_mcp_id);let g;e[0]!==f?(g=Po(f),e[0]=f,e[1]=g):g=e[1];const h=g;di(6e4);const x=a||!!n.trigger_id,p=n.id,v="button",b=0;let y;e[2]!==o?(y=B=>{B.target===B.currentTarget&&(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),o())},e[2]=o,e[3]=y):y=e[3];const j=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let S;e[4]!==j?(S=K("group/row flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer transition-colors","focus-visible:outline-none focus-visible:inset-ring-2 focus-visible:inset-ring-ring/50",j),e[4]=j,e[5]=S):S=e[5];let C;e[6]!==m||e[7]!==l||e[8]!==f?.icon||e[9]!==f?.title?(C=l&&!m&&s.jsx(Oe,{icon:f?.icon??null,name:f?.title??"?",size:"2xs"}),e[6]=m,e[7]=l,e[8]=f?.icon,e[9]=f?.title,e[10]=C):C=e[10];let _;e[11]!==x?(_=x&&s.jsx(Ys,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[11]=x,e[12]=_):_=e[12];const I=n.title||"Untitled task";let k;e[13]!==I?(k=s.jsx("div",{className:"text-sm text-foreground truncate",children:I}),e[13]=I,e[14]=k):k=e[14];let A;e[15]!==k||e[16]!==_?(A=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[_,k]}),e[15]=k,e[16]=_,e[17]=A):A=e[17];let O;e[18]!==h||e[19]!==r||e[20]!==n.branch||e[21]!==n.updated_at?(O=n.updated_at&&s.jsxs("div",{className:K("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Fl(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):h?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[h.owner,"/",h.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:ui(new Date(n.updated_at))})]}),e[18]=h,e[19]=r,e[20]=n.branch,e[21]=n.updated_at,e[22]=O):O=e[22];let T;e[23]!==A||e[24]!==O?(T=s.jsxs("div",{className:"flex-1 min-w-0",children:[A,O]}),e[23]=A,e[24]=O,e[25]=T):T=e[25];const w="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",P=!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":d.label,children:s.jsx(u,{size:14,className:K(d.iconClassName,n.status==="in_progress"&&"animate-spin")})});let U;e[26]!==i?(U=B=>{B.stopPropagation(),i()},e[26]=i,e[27]=U):U=e[27];let z;e[28]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(pr,{size:14}),e[28]=z):z=e[28];let G;e[29]!==U?(G=s.jsx(We,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:U,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:z})}),e[29]=U,e[30]=G):G=e[30];let R;e[31]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(qe,{side:"right",children:"Archive"}),e[31]=R):R=e[31];let H;e[32]!==G?(H=s.jsxs(Ve,{children:[G,R]}),e[32]=G,e[33]=H):H=e[33];let D;e[34]!==P||e[35]!==H?(D=s.jsxs("div",{className:w,children:[P,H]}),e[34]=P,e[35]=H,e[36]=D):D=e[36];let E;return e[37]!==o||e[38]!==T||e[39]!==D||e[40]!==y||e[41]!==S||e[42]!==C||e[43]!==n.id?(E=s.jsxs("div",{"data-task-id":p,role:v,tabIndex:b,onClick:o,onKeyDown:y,className:S,children:[C,T,D]}),e[37]=o,e[38]=T,e[39]=D,e[40]=y,e[41]=S,e[42]=C,e[43]=n.id,e[44]=E):E=e[44],E}function Zt(t){const e=N.c(10),{onClick:n,isFetching:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=K("flex items-center gap-2 px-2 py-1.5 rounded-md 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 disabled:cursor-progress disabled:opacity-60"),e[0]=o):o=e[0];let i;e[1]!==r?(i=r&&s.jsx(Wt,{size:14,className:"animate-spin"}),e[1]=r,e[2]=i):i=e[2];const a=r?"Loading…":"Show more";let l;e[3]!==a?(l=s.jsx("span",{children:a}),e[3]=a,e[4]=l):l=e[4];let c;return e[5]!==r||e[6]!==n||e[7]!==i||e[8]!==l?(c=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:o,children:[i,l]}),e[5]=r,e[6]=n,e[7]=i,e[8]=l,e[9]=c):c=e[9],c}function Gl(t,e,n,r){return[t,e,n,r.type,r.member,r.currentUserId??""].join("|")}function Bl(t){return t.member==="mine"&&!t.currentUserId}const Sn=4;let At=0;const Kt=[];function Ll(){for(;At<Sn&&Kt.length>0;){const t=Kt.shift();t&&t()}}function _n(t){return new Promise((e,n)=>{const r=()=>{At++,t().then(e,n).finally(()=>{At--,Ll()})};At<Sn?r():Kt.push(r)})}const Ft=10;function ps(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 a={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return t==="status"&&(a.status=e),a}function Hl(t,e,n,r){let o=0;for(const i of t)Jt(i,e,n,r)&&o++;return o}function Bt(t,e,n,r){return Hl(t,e,n,r)}function Ul(t,e,n){const r=new Map;for(const o of t){const i=o.virtual_mcp_id;i&&Jt(o,e,i,n)&&r.set(i,(r.get(i)??0)+1)}return r}function Kl(t,e){return!!(t>=Ft||t===0&&e)}function gs(t,e){return t<e}function Wl(t,e){return e===!1?!1:e===!0?!0:t}function Jt(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 Tt=new Map,Mt=new Map;function ql(t,e){return e?t>=Ft?!0:null:!1}function bs(t){return Tt.get(t)}function Vl(t,e){Tt.set(t,e)}function Yl(t,e,n){const r=Tt.get(t);if(r!==void 0){n(r);return}let o=Mt.get(t);o||(o=_n(e).then(i=>(Tt.set(t,i),Mt.delete(t),i)).catch(()=>(Mt.delete(t),Promise.reject(new Error("group probe failed")))),Mt.set(t,o)),o.then(n,()=>n(!1))}function js(t){const e=t,n=Array.isArray(e.items)?e.items:[];return{items:n,hasMore:e.hasMore??n.length===Ft,totalCount:typeof e.totalCount=="number"?e.totalCount:void 0}}function Xl(t,e,n,r,o){let i=0;for(const a of t)e.has(a.id)||Jt(a,n,r,o)&&i++;return i}function es(t,e,n,r){const o=N.c(8),{org:i}=xe(),a=Gl(i.id,t,e,n);let l;o[0]!==n?(l=Bl(n),o[0]=n,o[1]=l):l=o[1];const c=l,[d,u]=$.useState({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});d.identity!==a&&u({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:null,serverHasMore:null});const m=Fr(),{threads:f,hasMore:g}=Ds(),h=r??Bt(f,t,e,n),x=Kl(h,g),p=ql(h,g),v=Vs();if(d.identity===a&&d.serverHasMore===null){const _=p??bs(a);_!==void 0&&u({isFetching:!1,isProbing:!1,identity:a,probeSubscribedIdentity:d.probeSubscribedIdentity,serverHasMore:_})}!c&&d.identity===a&&d.serverHasMore===null&&p===null&&bs(a)===void 0&&d.probeSubscribedIdentity!==a&&(u(_=>_.identity===a?{..._,isProbing:!0,probeSubscribedIdentity:a}:_),Yl(a,async()=>{const _=ps(t,e,0,n,1),I=await v.call("COLLECTION_THREADS_LIST",_),{totalCount:k}=js(I),A=Bt(m.threads.get(),t,e,n);return k===void 0?!1:gs(A,k)},_=>{u(I=>I.identity!==a?I:{...I,isProbing:!1,serverHasMore:_})}));const y=async function(){if(d.isFetching||d.isProbing||c)return;const I=a;u(k=>k.identity===I?{...k,isFetching:!0}:k);try{const k=Bt(f,t,e,n),A=ps(t,e,k,n,Ft),O=await _n(()=>v.call("COLLECTION_THREADS_LIST",A)),{items:T,hasMore:w,totalCount:P}=js(O),U=new Set(f.map(Ql)),z=Xl(T,U,t,e,n),G=k;m.mergeThreads(T),u(R=>{if(R.identity!==I)return R;let H;return P!==void 0?H=gs(G+z,P):H=T.length===0||z===0?!1:w,Vl(I,H),{...R,isFetching:!1,serverHasMore:H}})}catch(k){const A=k,O=A instanceof Error?A.message:String(A);Ae.error(`Could not load more tasks: ${O}`),u(T=>T.identity===I?{...T,isFetching:!1}:T)}},j=d.isFetching||d.isProbing,S=!c&&!j&&Wl(x,d.serverHasMore);let C;return o[2]!==j||o[3]!==y||o[4]!==S||o[5]!==d.isProbing||o[6]!==d.serverHasMore?(C={hasMore:S,isFetching:j,isProbing:d.isProbing,serverHasMore:d.serverHasMore,loadMore:y},o[2]=j,o[3]=y,o[4]=S,o[5]=d.isProbing,o[6]=d.serverHasMore,o[7]=C):C=o[7],C}function Ql(t){return t.id}function Nn(t){const e=N.c(61),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,onSelectTask:a,onArchiveTask:l,onNewTaskInGroup:c,onShowSettings:d,onHideGroup:u,isOrgPinned:m,canManageOrgPin:f,onToggleOrgPin:g,sortable:h,groupVisibleCount:x}=t,p=m===void 0?!1:m,v=f===void 0?!1:f,b=ht(n),y=r[0];let j;e[0]!==y||e[1]!==c||e[2]!==a||e[3]!==n?(j=()=>{y?a(y):c(n)},e[0]=y,e[1]=c,e[2]=a,e[3]=n,e[4]=j):j=e[4];const S=j,C=h?.isDragging?!1:void 0;let _;e[5]!==h?.isDragging||e[6]!==n?(_=Y=>{h?.isDragging||Y&&J("sidebar_group_hover_popover_opened",{virtual_mcp_id:n})},e[5]=h?.isDragging,e[6]=n,e[7]=_):_=e[7];const I=!!(y&&o&&y.id===o),k=h?"Drag to reorder":void 0;let A;e[8]!==h?(A=h?{...h.attributes,...h.listeners}:{},e[8]=h,e[9]=A):A=e[9];const O=h&&"cursor-pointer active:cursor-grabbing touch-none",T=h?.isDragging&&"cursor-grabbing";let w;e[10]!==T||e[11]!==O?(w=K("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,T),e[10]=T,e[11]=O,e[12]=w):w=e[12];const P=b?.icon??null,U=b?.title??"?";let z;e[13]!==P||e[14]!==U?(z=s.jsx(Oe,{icon:P,name:U,size:"sm+",className:"rounded-lg"}),e[13]=P,e[14]=U,e[15]=z):z=e[15];let G;e[16]!==S||e[17]!==w||e[18]!==z||e[19]!==I||e[20]!==k||e[21]!==A?(G=s.jsx(he,{children:s.jsx(jn,{asChild:!0,children:s.jsx(oi,{asChild:!0,children:s.jsx(Ie,{onClick:S,isActive:I,title:k,...A,className:w,children:z})})})}),e[16]=S,e[17]=w,e[18]=z,e[19]=I,e[20]=k,e[21]=A,e[22]=G):G=e[22];const R=g??Zl;let H;e[23]!==v||e[24]!==p||e[25]!==u||e[26]!==c||e[27]!==d||e[28]!==R||e[29]!==n?(H=s.jsx(vn,{className:"w-56",children:s.jsx(yn,{virtualMcpId:n,isOrgPinned:p,canManageOrgPin:v,onNewTaskInGroup:c,onShowSettings:d,onToggleOrgPin:R,onHideGroup:u})}),e[23]=v,e[24]=p,e[25]=u,e[26]=c,e[27]=d,e[28]=R,e[29]=n,e[30]=H):H=e[30];let D;e[31]!==G||e[32]!==H?(D=s.jsxs(bn,{children:[G,H]}),e[31]=G,e[32]=H,e[33]=D):D=e[33];const E=b?.title??"Agent";let B;e[34]!==E?(B=s.jsx("span",{className:"truncate",children:E}),e[34]=E,e[35]=B):B=e[35];let F;e[36]!==c||e[37]!==n?(F=()=>c(n),e[36]=c,e[37]=n,e[38]=F):F=e[38];let q;e[39]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Ce,{size:14}),e[39]=q):q=e[39];let W;e[40]!==F?(W=s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:F,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground",children:q}),e[40]=F,e[41]=W):W=e[41];let X;e[42]!==B||e[43]!==W?(X=s.jsxs("div",{className:"flex items-center justify-between px-1 pb-1 text-xs font-medium",children:[B,W]}),e[42]=B,e[43]=W,e[44]=X):X=e[44];let le;e[45]!==o||e[46]!==i||e[47]!==x||e[48]!==l||e[49]!==a||e[50]!==r||e[51]!==n?(le=s.jsx(Jl,{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:x,onSelectTask:a,onArchiveTask:l}),e[45]=o,e[46]=i,e[47]=x,e[48]=l,e[49]=a,e[50]=r,e[51]=n,e[52]=le):le=e[52];let V;e[53]!==X||e[54]!==le?(V=s.jsxs(ii,{side:"right",align:"start",sideOffset:8,className:"w-72 p-2",children:[X,le]}),e[53]=X,e[54]=le,e[55]=V):V=e[55];let Q;return e[56]!==D||e[57]!==V||e[58]!==C||e[59]!==_?(Q=s.jsxs(li,{open:C,openDelay:120,closeDelay:150,onOpenChange:_,children:[D,V]}),e[56]=D,e[57]=V,e[58]=C,e[59]=_,e[60]=Q):Q=e[60],Q}function Zl(){}function Jl(t){const e=N.c(6),{virtualMcpId:n,threads:r,activeTaskId:o,filters:i,groupVisibleCount:a,onSelectTask:l,onArchiveTask:c}=t,d=es("agent",n,i,a);let u;return e[0]!==o||e[1]!==c||e[2]!==l||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(Et,{task:m,isActive:o===m.id,onClick:()=>l(m),onArchive:()=>c(m),showAutomationBadge:!!m.trigger_id},m.id)),(d.hasMore||d.isFetching)&&s.jsx(Zt,{onClick:()=>{d.loadMore()},isFetching:d.isFetching})]})}),e[0]=o,e[1]=c,e[2]=l,e[3]=d,e[4]=r,e[5]=u):u=e[5],u}function ea(t,e,n,r,o,i,a){const l=N.c(18),c=a===void 0?"expanded":a;let d;l[0]===Symbol.for("react.memo_cache_sentinel")?(d={activationConstraint:{distance:8}},l[0]=d):d=l[0];let u;l[1]===Symbol.for("react.memo_cache_sentinel")?(u={coordinateGetter:Fo},l[1]=u):u=l[1];const m=Ro(ls(Eo,d),ls(Do,u));let f;l[2]!==r||l[3]!==o||l[4]!==e||l[5]!==t?(f=qr(t,e,r,o),l[2]=r,l[3]=o,l[4]=e,l[5]=t,l[6]=f):f=l[6];const g=f;let h;l[7]!==i||l[8]!==n||l[9]!==o||l[10]!==e||l[11]!==g||l[12]!==c?(h=v=>{const{active:b,over:y}=v;if(!y||b.id===y.id)return;const j=String(b.id),S=String(y.id);if(!Vr(j,S,o))return;const C=Yr(g,j,S),_=Xr(e,n,o,C);e==="org"?Qr(n.orgId,_):Zr(n,_),J("sidebar_group_reordered",{virtual_mcp_id:j,over_virtual_mcp_id:S,surface:c,section:e}),i()},l[7]=i,l[8]=n,l[9]=o,l[10]=e,l[11]=g,l[12]=c,l[13]=h):h=l[13];const x=h;let p;return l[14]!==x||l[15]!==m||l[16]!==g?(p={sensors:m,sortableIds:g,handleDragEnd:x},l[14]=x,l[15]=m,l[16]=g,l[17]=p):p=l[17],p}function ta(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 sa(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:a,setNodeRef:l,transform:c,transition:d,isDragging:u}=Uo(o);let m;if(e[2]!==i||e[3]!==r||e[4]!==u||e[5]!==a||e[6]!==l||e[7]!==c||e[8]!==d){const g={transform:Ko.Transform.toString(c),transition:d,zIndex:u?100:void 0};m=r({setNodeRef:l,style:g,isDragging:u,attributes:i,listeners:a}),e[2]=i,e[3]=r,e[4]=u,e[5]=a,e[6]=l,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 vs(t){const e=N.c(18),{section:n,groups:r,orderScope:o,decopilotId:i,orgPinnedIds:a,onReorder:l,surface:c,renderGroup:d,renderSortable:u,renderFixed:m}=t,{sensors:f,sortableIds:g,handleDragEnd:h}=ea(r,n,o,i,a,l,c);if(r.length===0)return null;const x=g;let p;if(e[0]!==r||e[1]!==m||e[2]!==d||e[3]!==u||e[4]!==g){let y;e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==g?(y=j=>{const S=d(j);return g.includes(j.virtualMcpId)?s.jsx(sa,{id:j.virtualMcpId,children:C=>{const{setNodeRef:_,style:I,isDragging:k,attributes:A,listeners:O}=C;return s.jsx("div",{ref:_,style:I,className:K(k&&"opacity-50"),children:u(S,{attributes:A,listeners:O,isDragging:k})})}},j.virtualMcpId):s.jsx("div",{children:m(S)},j.virtualMcpId)},e[6]=m,e[7]=d,e[8]=u,e[9]=g,e[10]=y):y=e[10],p=r.map(y),e[0]=r,e[1]=m,e[2]=d,e[3]=u,e[4]=g,e[5]=p}else p=e[5];let v;e[11]!==x||e[12]!==p?(v=s.jsx(Go,{items:x,strategy:Bo,children:p}),e[11]=x,e[12]=p,e[13]=v):v=e[13];let b;return e[14]!==h||e[15]!==f||e[16]!==v?(b=s.jsx(Lo,{sensors:f,collisionDetection:Ho,onDragEnd:h,children:v}),e[14]=h,e[15]=f,e[16]=v,e[17]=b):b=e[17],b}function Cn(t){const e=N.c(23),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:l,collapsedSeparator:c,renderGroup:d,renderSortable:u,renderFixed:m}=t;let f;if(e[0]!==c||e[1]!==o||e[2]!==n||e[3]!==a||e[4]!==r||e[5]!==i||e[6]!==m||e[7]!==d||e[8]!==u||e[9]!==l){const{decopilot:g,orgPinned:h,user:x,toolCallRuns:p}=Jr(n,o,i),v=h.length>0&&x.length>0;let b;e[11]!==o||e[12]!==a||e[13]!==r||e[14]!==i||e[15]!==m||e[16]!==d||e[17]!==u||e[18]!==l?(b={orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:l,renderGroup:d,renderSortable:u,renderFixed:m},e[11]=o,e[12]=a,e[13]=r,e[14]=i,e[15]=m,e[16]=d,e[17]=u,e[18]=l,e[19]=b):b=e[19];const y=b;let j;e[20]!==c||e[21]!==v?(j=v&&s.jsx(ta,{collapsed:c}),e[20]=c,e[21]=v,e[22]=j):j=e[22],f=s.jsxs(s.Fragment,{children:[g&&m(d(g)),s.jsx(vs,{section:"org",groups:h,...y}),j,s.jsx(vs,{section:"user",groups:x,...y}),p&&m(d(p))]}),e[0]=c,e[1]=o,e[2]=n,e[3]=a,e[4]=r,e[5]=i,e[6]=m,e[7]=d,e[8]=u,e[9]=l,e[10]=f}else f=e[10];return f}function na(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,renderGroup:l}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==a||e[3]!==r||e[4]!==i||e[5]!==l?(c=s.jsx(Cn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:"collapsed_rail",collapsedSeparator:!0,renderGroup:l,renderFixed:oa,renderSortable:ra}),e[0]=o,e[1]=n,e[2]=a,e[3]=r,e[4]=i,e[5]=l,e[6]=c):c=e[6],c}function ra(t,e){return s.jsx(Nn,{...t,sortable:{attributes:e.attributes,listeners:e.listeners,isDragging:e.isDragging}},t.virtualMcpId)}function oa(t){return s.jsx(Nn,{...t},t.virtualMcpId)}const ia="sidebar.group.expanded.";function wn(t,e){const n=N.c(3),[r,o]=gr(`${ia}${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(59),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,onShowSettings:c,onHideGroup:d,isOrgPinned:u,canManageOrgPin:m,onToggleOrgPin:f,filters:g,groupVisibleCount:h,sortable:x}=t,p=u===void 0?!1:u,v=m===void 0?!1:m,[b,y]=wn(n,!1),j=n===Gs,S=x?.isDragging??!1;let C;e[0]!==b||e[1]!==y?(C=function(){y(!b)},e[0]=b,e[1]=y,e[2]=C):C=e[2];const _=C;let I;e[3]!==j||e[4]!==x?(I=x&&!j?{...x.attributes,...x.listeners}:{},e[3]=j,e[4]=x,e[5]=I):I=e[5];let k;e[6]!==_?(k=F=>{F.target===F.currentTarget&&(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),_())},e[6]=_,e[7]=k):k=e[7];const A=x&&!j&&"touch-none active:cursor-grabbing",O=S&&"shadow-md bg-accent/40 cursor-grabbing";let T;e[8]!==A||e[9]!==O?(T=K("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",A,O),e[8]=A,e[9]=O,e[10]=T):T=e[10];let w;e[11]!==j||e[12]!==n?(w=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(aa,{virtualMcpId:n,isToolCallRuns:j})}),e[11]=j,e[12]=n,e[13]=w):w=e[13];let P;e[14]!==b?(P=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:b?s.jsx(Xs,{size:14}):s.jsx(Xt,{size:14})}),e[14]=b,e[15]=P):P=e[15];let U;e[16]!==P||e[17]!==w?(U=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[w,P]}),e[16]=P,e[17]=w,e[18]=U):U=e[18];let z;e[19]!==j||e[20]!==n?(z=s.jsx("span",{className:"flex-1 truncate",children:s.jsx(da,{virtualMcpId:n,isToolCallRuns:j})}),e[19]=j,e[20]=n,e[21]=z):z=e[21];let G;e[22]!==j||e[23]!==l||e[24]!==n?(G=!j&&s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:F=>{F.stopPropagation(),l(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[22]=j,e[23]=l,e[24]=n,e[25]=G):G=e[25];let R;e[26]!==b||e[27]!==_||e[28]!==U||e[29]!==z||e[30]!==G||e[31]!==I||e[32]!==k||e[33]!==T?(R=s.jsxs("div",{...I,role:"button",tabIndex:0,"aria-expanded":b,onClick:_,onKeyDown:k,className:T,children:[U,z,G]}),e[26]=b,e[27]=_,e[28]=U,e[29]=z,e[30]=G,e[31]=I,e[32]=k,e[33]=T,e[34]=R):R=e[34];const H=R;let D;e[35]!==v||e[36]!==H||e[37]!==p||e[38]!==j||e[39]!==d||e[40]!==l||e[41]!==c||e[42]!==f||e[43]!==n?(D=j?H:s.jsxs(bn,{children:[s.jsx(jn,{asChild:!0,children:H}),s.jsx(vn,{className:"w-56",children:s.jsx(yn,{virtualMcpId:n,isOrgPinned:p,canManageOrgPin:v,onNewTaskInGroup:l,onShowSettings:c,onToggleOrgPin:f??la,onHideGroup:d})})]}),e[35]=v,e[36]=H,e[37]=p,e[38]=j,e[39]=d,e[40]=l,e[41]=c,e[42]=f,e[43]=n,e[44]=D):D=e[44];let E;e[45]!==o||e[46]!==b||e[47]!==g||e[48]!==h||e[49]!==j||e[50]!==a||e[51]!==l||e[52]!==i||e[53]!==r||e[54]!==n?(E=b&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:j?r.map(F=>s.jsx(Et,{task:F,isActive:o===F.id,onClick:()=>i(F),onArchive:()=>a(F),showAutomationBadge:!!F.trigger_id},F.id)):s.jsx(ma,{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,filters:g,groupVisibleCount:h})}),e[45]=o,e[46]=b,e[47]=g,e[48]=h,e[49]=j,e[50]=a,e[51]=l,e[52]=i,e[53]=r,e[54]=n,e[55]=E):E=e[55];let B;return e[56]!==D||e[57]!==E?(B=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[D,E]}),e[56]=D,e[57]=E,e[58]=B):B=e[58],B}function la(){}function aa(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(Oe,{icon:null,name:"⚙",size:"2xs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(ca,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function ca(t){const e=N.c(4),{virtualMcpId:n}=t,r=ht(n);if(!r){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Oe,{icon:null,name:"?",size:"2xs"}),e[0]=a):a=e[0],a}const o=r.icon??null;let i;return e[1]!==r.title||e[2]!==o?(i=s.jsx(Oe,{icon:o,name:r.title,size:"2xs"}),e[1]=r.title,e[2]=o,e[3]=i):i=e[3],i}function da(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(ua,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function ua(t){const e=N.c(2),{virtualMcpId:n}=t,o=ht(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 ma(t){const e=N.c(10),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,onNewTaskInGroup:l,filters:c,groupVisibleCount:d}=t,u=es("agent",n,c,d),{isFetching:m,isProbing:f,loadMore:g,serverHasMore:h}=u,[x,p]=$.useState(!1);!x&&r.length===0&&h===!0&&!m&&!f&&(p(!0),queueMicrotask(()=>{g()}));const{hasMore:v}=u;let b;return e[0]!==o||e[1]!==v||e[2]!==m||e[3]!==g||e[4]!==a||e[5]!==l||e[6]!==i||e[7]!==r||e[8]!==n?(b=s.jsx(s.Fragment,{children:r.length===0?s.jsxs("button",{type:"button",onClick:()=>l(n),className:"flex items-center gap-2 px-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(Et,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>a(y),showAutomationBadge:!!y.trigger_id},y.id)),(v||m)&&s.jsx(Zt,{onClick:()=>{g()},isFetching:m})]})}),e[0]=o,e[1]=v,e[2]=m,e[3]=g,e[4]=a,e[5]=l,e[6]=i,e[7]=r,e[8]=n,e[9]=b):b=e[9],b}function fa(t){const e=N.c(16),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l}=t,{isFetching:c,isProbing:d,loadMore:u,hasMore:m,serverHasMore:f}=es("status",n,l),[g,h]=$.useState(!1);!g&&r.length===0&&f===!0&&!c&&!d&&(h(!0),queueMicrotask(()=>{u()}));let x;if(e[0]!==o||e[1]!==a||e[2]!==i||e[3]!==r){let b;e[5]!==o||e[6]!==a||e[7]!==i?(b=y=>s.jsx(Et,{task:y,isActive:o===y.id,onClick:()=>i(y),onArchive:()=>a(y),showAutomationBadge:!!y.trigger_id,showAgentIcon:!0,hideStatusIdle:!0},y.id),e[5]=o,e[6]=a,e[7]=i,e[8]=b):b=e[8],x=r.map(b),e[0]=o,e[1]=a,e[2]=i,e[3]=r,e[4]=x}else x=e[4];let p;e[9]!==m||e[10]!==c||e[11]!==u?(p=(m||c)&&s.jsx(Zt,{onClick:()=>{u()},isFetching:c}),e[9]=m,e[10]=c,e[11]=u,e[12]=p):p=e[12];let v;return e[13]!==x||e[14]!==p?(v=s.jsxs(s.Fragment,{children:[x,p]}),e[13]=x,e[14]=p,e[15]=v):v=e[15],v}function xa(t){const e=N.c(35),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l}=t,c=ci[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 g=f;let h;e[3]!==g?(h=_=>{_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),g())},e[3]=g,e[4]=h):h=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 p;e[8]!==u?(p=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(Xs,{size:14}):s.jsx(Xt,{size:14})}),e[8]=u,e[9]=p):p=e[9];let v;e[10]!==x||e[11]!==p?(v=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[x,p]}),e[10]=x,e[11]=p,e[12]=v):v=e[12];let b;e[13]!==c.label?(b=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[13]=c.label,e[14]=b):b=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 j;e[17]!==u||e[18]!==g||e[19]!==h||e[20]!==v||e[21]!==b||e[22]!==y?(j=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":u,onClick:g,onKeyDown:h,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:[v,b,y]}),e[17]=u,e[18]=g,e[19]=h,e[20]=v,e[21]=b,e[22]=y,e[23]=j):j=e[23];let S;e[24]!==o||e[25]!==u||e[26]!==l||e[27]!==a||e[28]!==i||e[29]!==n||e[30]!==r?(S=u&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(fa,{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:a,filters:l})}),e[24]=o,e[25]=u,e[26]=l,e[27]=a,e[28]=i,e[29]=n,e[30]=r,e[31]=S):S=e[31];let C;return e[32]!==j||e[33]!==S?(C=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[j,S]}),e[32]=j,e[33]=S,e[34]=C):C=e[34],C}function ha(t){const e=N.c(7),{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,renderGroup:l}=t;let c;return e[0]!==o||e[1]!==n||e[2]!==a||e[3]!==r||e[4]!==i||e[5]!==l?(c=s.jsx(Cn,{groups:n,orderScope:r,decopilotId:o,orgPinnedIds:i,onReorder:a,surface:"expanded",renderGroup:l,renderFixed:ga,renderSortable:pa}),e[0]=o,e[1]=n,e[2]=a,e[3]=r,e[4]=i,e[5]=l,e[6]=c):c=e[6],c}function pa(t,e){return s.jsx(kn,{...t,sortable:e},t.virtualMcpId)}function ga(t){return s.jsx(kn,{...t},t.virtualMcpId)}function ba(t,e,n,r){return[t.orgId,t.userId,r,n.slice().sort().join(","),e.map(o=>o.virtualMcpId).sort().join(",")].join("|")}function ja(t,e,n,r,o){const i=N.c(5),a=ba(t,e,r,o),[l,c]=$.useState("");l!==a&&(eo(t,e,n,r),c(a));let d;return i[0]!==n||i[1]!==r||i[2]!==t||i[3]!==e?(d=to(t,e,n,r),i[0]=n,i[1]=r,i[2]=t,i[3]=e,i[4]=d):d=i[4],d}const In={all:"All tasks",manual:"Chats",automation:"Automation"},Mn={all:"All members",mine:"Mine only"},ys={agent:"Agent",status:"Status"};function An(){const t=N.c(92),{data:e}=we.useSession(),n=e?.user?.id,r=n??"anon",{org:o}=xe(),i=wr(o.id).id,a=zs(),l=Fs(a),c=cl(),d=kr();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u={},t[0]=u):u=t[0];const[m,f]=$.useState(u),g=new Set(l),h={},x=[];let p;t[1]!==m?(p=Object.entries(m),t[1]=m,t[2]=p):p=t[2];for(const[M,L]of p)g.has(M)!==L?h[M]=L:x.push(M);x.length>0&&f(M=>{const L={...M};for(const oe of x)delete L[oe];return L});const v=new Set(l);for(const[M,L]of Object.entries(h))L?v.add(M):v.delete(M);const b=[...v],y=new Set(b),{threads:j}=Ds(),S=j.filter(Ia),{hide:C}=Rs(),_=Te(),{setTaskId:I,createNewTask:k}=Es();let A;t[3]===Symbol.for("react.memo_cache_sentinel")?(A={strict:!1},t[3]=A):A=t[3];const T=Ns(A).taskId??null,w=[...S].sort(ka),[P,U]=$.useState("all"),[z,G]=$.useState("mine"),[R,H]=$.useState("agent"),[D,E]=$.useState(!1),[B,F]=$.useState(!1),[q,W]=$.useState(0),X=so(),le=q+X;let V;t[4]!==o.id||t[5]!==r?(V={orgId:o.id,userId:r},t[4]=o.id,t[5]=r,t[6]=V):V=t[6];const Q=V,Y={type:P,member:z,currentUserId:n??null},te=Ul(w,"agent",Y),Z=ja(Q,no(w,i),i,b,le);let se;t[7]!==n||t[8]!==z?(se=M=>z==="mine"&&n?M.filter(L=>L.created_by===n):M,t[7]=n,t[8]=z,t[9]=se):se=t[9];const ne=se;let re;t[10]!==P?(re=M=>P==="automation"?M.filter(wa):P==="manual"?M.filter(Ca):M,t[10]=P,t[11]=re):re=t[11];const ee=re,de=M=>{const L=M.id===T;if(C(M.id),!L)return;const oe=w.find(je=>je.id!==M.id&&je.virtual_mcp_id===M.virtual_mcp_id&&je.created_by===n);oe?I(oe.id,oe.virtual_mcp_id):_({to:"/$org",params:{org:o.slug}})};let ie;t[12]!==k?(ie=M=>{J("sidebar_group_new_clicked",{virtual_mcp_id:M}),k(M)},t[12]=k,t[13]=ie):ie=t[13];const ze=ie,Pe=ro();let pe;t[14]!==Pe?(pe=M=>{J("sidebar_group_settings_clicked",{virtual_mcp_id:M}),Pe(M,{search:{main:"instructions"}})},t[14]=Pe,t[15]=pe):pe=t[15];const Re=pe,mt=M=>{if(y.has(M))return;J("sidebar_group_hide_clicked",{virtual_mcp_id:M});const L=Z.find(oe=>oe.virtualMcpId===M);if(L)for(const oe of L.threads)C(oe.id);io(Q,M,b),W(Na)},De=async(M,L)=>{if(c&&h[M]===void 0){J("sidebar_group_org_pin_toggled",{virtual_mcp_id:M,pinned:L}),f(oe=>({...oe,[M]:L}));try{await d.update.mutateAsync({id:M,data:{pinned:L}})}catch{lo(Q,M,!L),f(oe=>{const je={...oe};return delete je[M],je})}}},Ee=M=>{const L=M===i||M===Gs;return{isOrgPinned:y.has(M),canManageOrgPin:L?!1:c,onToggleOrgPin:L?void 0:De}},Me=M=>{const L=ee(ne(M.threads));return{virtualMcpId:M.virtualMcpId,threads:L,activeTaskId:T,filters:Y,groupVisibleCount:te.get(M.virtualMcpId)??0,onSelectTask:oe=>I(oe.id,oe.virtual_mcp_id),onArchiveTask:de,onNewTaskInGroup:ze,onShowSettings:Re,onHideGroup:mt,...Ee(M.virtualMcpId)}},ae=P!=="all"||z!=="mine",{state:Fe,isMobile:Ge}=Xe();if(Fe==="collapsed"&&!Ge){let M;if(t[16]!==ae||t[17]!==Z||t[18]!==ne||t[19]!==ee){let dt;t[21]!==ae||t[22]!==ne||t[23]!==ee?(dt=Tn=>{const zn=ee(ne(Tn.threads));return!(ae&&zn.length===0)},t[21]=ae,t[22]=ne,t[23]=ee,t[24]=dt):dt=t[24],M=Z.filter(dt),t[16]=ae,t[17]=Z,t[18]=ne,t[19]=ee,t[20]=M}else M=t[20];const L=M,oe=R==="agent"&&Z.length===0;let je;t[25]!==oe?(je=s.jsx(rs,{value:oe}),t[25]=oe,t[26]=je):je=t[26];let Ct;return t[27]===Symbol.for("react.memo_cache_sentinel")?(Ct=()=>W(_a),t[27]=Ct):Ct=t[27],s.jsxs(s.Fragment,{children:[je,s.jsx($e,{className:"min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.jsx(na,{groups:L,orderScope:Q,decopilotId:i,orgPinnedIds:b,onReorder:Ct,renderGroup:dt=>Me(dt)})})]})}const ft="flex flex-col h-full min-h-0",ve=R==="agent"&&Z.length===0;let ye;t[28]!==ve?(ye=s.jsx(rs,{value:ve}),t[28]=ve,t[29]=ye):ye=t[29];let me;t[30]!==E?(me=()=>{J("tasks_panel_search_opened"),F(!0),E(!0)},t[30]=E,t[31]=me):me=t[31];let ge;t[32]===Symbol.for("react.memo_cache_sentinel")?(ge=s.jsx(Dr,{size:16}),t[32]=ge):ge=t[32];let fe;t[33]!==me?(fe=s.jsx(ke,{"aria-label":"Search threads",onClick:me,children:ge}),t[33]=me,t[34]=fe):fe=t[34];const Be=ys[R==="agent"?"status":"agent"];let be;t[35]!==Be?(be=Be.toLowerCase(),t[35]=Be,t[36]=be):be=t[36];const Se=`Group by ${be}`,Le=ys[R];let ue;t[37]!==Le?(ue=Le.toLowerCase(),t[37]=Le,t[38]=ue):ue=t[38];const He=`Grouped by ${ue}`;let _e,Ue;t[39]!==R?(_e=()=>{const M=R==="agent"?"status":"agent";J("tasks_panel_group_by_changed",{to_value:M}),H(M)},Ue=R==="agent"?s.jsx(qo,{size:16}):s.jsx(Er,{size:16}),t[39]=R,t[40]=_e,t[41]=Ue):(_e=t[40],Ue=t[41]);let Ke;t[42]!==Se||t[43]!==He||t[44]!==_e||t[45]!==Ue?(Ke=s.jsx(ke,{"aria-label":Se,title:He,onClick:_e,children:Ue}),t[42]=Se,t[43]=He,t[44]=_e,t[45]=Ue,t[46]=Ke):Ke=t[46];let Qe;t[47]===Symbol.for("react.memo_cache_sentinel")?(Qe=s.jsx(Wo,{size:16}),t[47]=Qe):Qe=t[47];let Ze;t[48]!==ae?(Ze=ae&&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"}),t[48]=ae,t[49]=Ze):Ze=t[49];let Je;t[50]!==Ze?(Je=s.jsx(ut,{asChild:!0,children:s.jsxs(ke,{"aria-label":"Filter tasks",children:[Qe,Ze]})}),t[50]=Ze,t[51]=Je):Je=t[51];let et;t[52]!==z?(et=M=>{const L=M;L!==z&&J("tasks_panel_member_filter_changed",{to_value:L}),G(L)},t[52]=z,t[53]=et):et=t[53];let gt;t[54]===Symbol.for("react.memo_cache_sentinel")?(gt=s.jsx(cs,{size:"sm",className:"w-full",children:s.jsx(ds,{})}),t[54]=gt):gt=t[54];let bt;t[55]===Symbol.for("react.memo_cache_sentinel")?(bt=Object.keys(Mn),t[55]=bt):bt=t[55];let jt;t[56]===Symbol.for("react.memo_cache_sentinel")?(jt=s.jsx(as,{children:bt.map(Sa)}),t[56]=jt):jt=t[56];let tt;t[57]!==z||t[58]!==et?(tt=s.jsx(Ss,{label:"Members",children:s.jsxs(us,{value:z,onValueChange:et,children:[gt,jt]})}),t[57]=z,t[58]=et,t[59]=tt):tt=t[59];let st;t[60]!==P?(st=M=>{const L=M;L!==P&&J("tasks_panel_filter_changed",{to_value:L}),U(L)},t[60]=P,t[61]=st):st=t[61];let vt;t[62]===Symbol.for("react.memo_cache_sentinel")?(vt=s.jsx(cs,{size:"sm",className:"w-full",children:s.jsx(ds,{})}),t[62]=vt):vt=t[62];let yt;t[63]===Symbol.for("react.memo_cache_sentinel")?(yt=Object.keys(In),t[63]=yt):yt=t[63];let St;t[64]===Symbol.for("react.memo_cache_sentinel")?(St=s.jsx(as,{children:yt.map(ya)}),t[64]=St):St=t[64];let nt;t[65]!==st||t[66]!==P?(nt=s.jsx(Ss,{label:"Type",children:s.jsxs(us,{value:P,onValueChange:st,children:[vt,St]})}),t[65]=st,t[66]=P,t[67]=nt):nt=t[67];let rt;t[68]!==tt||t[69]!==nt?(rt=s.jsx(Dt,{align:"start",sideOffset:8,collisionPadding:16,className:"w-72 p-3",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[tt,nt]})}),t[68]=tt,t[69]=nt,t[70]=rt):rt=t[70];let ot;t[71]!==Je||t[72]!==rt?(ot=s.jsxs(Rt,{children:[Je,rt]}),t[71]=Je,t[72]=rt,t[73]=ot):ot=t[73];let it;t[74]!==fe||t[75]!==Ke||t[76]!==ot?(it=s.jsxs("div",{className:"flex items-center gap-0.5",children:[fe,Ke,ot]}),t[74]=fe,t[75]=Ke,t[76]=ot,t[77]=it):it=t[77];let _t;t[78]===Symbol.for("react.memo_cache_sentinel")?(_t=s.jsx(Qs,{compact:!0}),t[78]=_t):_t=t[78];let lt;t[79]!==it?(lt=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[it,_t]}),t[79]=it,t[80]=lt):lt=t[80];const On="flex-1 min-h-0 overflow-y-auto overscroll-contain flex flex-col gap-0.5 -mr-2 pr-2",Gt=R==="status"?s.jsx(s.Fragment,{children:oo(ee(ne(w))).map(M=>s.jsx(xa,{status:M.status,threads:M.threads,activeTaskId:T,onSelectTask:L=>I(L.id,L.virtual_mcp_id),onArchiveTask:de,filters:Y},M.status))}):s.jsx(ha,{groups:Z,orderScope:Q,decopilotId:i,orgPinnedIds:b,onReorder:()=>W(va),renderGroup:M=>({...Me(M)})});let at;t[81]!==Gt?(at=s.jsx("div",{className:On,children:Gt}),t[81]=Gt,t[82]=at):at=t[82];let ct;t[83]!==B||t[84]!==D||t[85]!==E?(ct=B&&s.jsx(ll,{open:D,onOpenChange:E}),t[83]=B,t[84]=D,t[85]=E,t[86]=ct):ct=t[86];let Nt;return t[87]!==ye||t[88]!==lt||t[89]!==at||t[90]!==ct?(Nt=s.jsxs("div",{className:ft,children:[ye,lt,at,ct]}),t[87]=ye,t[88]=lt,t[89]=at,t[90]=ct,t[91]=Nt):Nt=t[91],Nt}function va(t){return t+1}function ya(t){return s.jsx(qs,{value:t,children:In[t]},t)}function Sa(t){return s.jsx(qs,{value:t,children:Mn[t]},t)}function _a(t){return t+1}function Na(t){return t+1}function Ca(t){return!t.trigger_id}function wa(t){return!!t.trigger_id}function ka(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Ia(t){return!t.hidden}function Ss(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 a;return e[4]!==o||e[5]!==i?(a=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,i]}),e[4]=o,e[5]=i,e[6]=a):a=e[6],a}const Ma=5,Aa=[{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 $n(){const t=N.c(3),{state:e}=Xe();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:Ma}).map(Ta)}),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:Aa.map($a)})]}),t[2]=r):r=t[2],r}function $a(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:K("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(Oa)})]},e)}function Oa(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 Ta(t,e){return s.jsx(Ne,{className:"size-10 rounded-lg mx-auto"},e)}function Oc(){const t=N.c(4),e=Zs();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(nl,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ws,{children:s.jsxs($.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Ot,{className:"mb-2"}),s.jsx($n,{})]}),children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(An,{})]})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsx(Bs,{children:s.jsx(tn,{sections:e,footer:n,additionalContent:r})}),t[2]=e,t[3]=o):o=t[3],o}function Tc(t){const e=N.c(5),{onClose:n}=t,r=Zs();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(rl,{}),e[0]=o):o=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ws,{children:s.jsxs($.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(Ot,{className:"mb-2"}),s.jsx($n,{})]}),children:[s.jsx(Ot,{className:"mb-2"}),s.jsx(An,{})]})}),e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==r?(a=s.jsx(Bs,{children:s.jsx(Ii,{sections:r,onClose:n,footer:o,additionalContent:i})}),e[2]=n,e[3]=r,e[4]=a):a=e[4],a}function zc(){const t=N.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{"data-testid":"shell-route-loading",className:"absolute inset-0 flex items-center justify-center",children:s.jsx(Wt,{size:20,className:"animate-spin text-muted-foreground"})}),t[0]=e):e=t[0],e}export{jn as C,Oc as S,Tc as a,zc as b,It as c,hs as d,vn as e,bn as f};
|