decocms 2.367.38 → 2.369.0
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-CVwjiL5t.js → AlertCircle-BCHNBTJj.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BsdiWOZ_.js → ArrowUpRight-DOVZA3k4.js} +1 -1
- package/dist/client/assets/{Check-BIvjG7jh.js → Check-B34N9tsV.js} +1 -1
- package/dist/client/assets/{CheckCircle-naAuY0Am.js → CheckCircle-CFtTCxLL.js} +1 -1
- package/dist/client/assets/{ChevronDown-2DdfyPVo.js → ChevronDown-Dr50fepz.js} +1 -1
- package/dist/client/assets/{ChevronRight-Djwmm7yx.js → ChevronRight-CISMqQmL.js} +1 -1
- package/dist/client/assets/{ChevronUp-CYign-Xr.js → ChevronUp-Caidv6lK.js} +1 -1
- package/dist/client/assets/{Container-BYMVUIOR.js → Container-B1RIjk98.js} +1 -1
- package/dist/client/assets/{DotsVertical-6XBT76_0.js → DotsVertical-rWYOU3RE.js} +1 -1
- package/dist/client/assets/{FilterLines-xU-m-2To.js → FilterLines-Bdqyhomu.js} +1 -1
- package/dist/client/assets/{HardDrive-CPUYFXaj.js → HardDrive-DoscLgG-.js} +1 -1
- package/dist/client/assets/{Key01-CTY2QvpD.js → Key01-BoIyqgwL.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BA4wxcAF.js → LayoutLeft-D7dJReEM.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Dn8eWUjC.js → LinkExternal01-DVJRR2up.js} +1 -1
- package/dist/client/assets/{Lock01-DzYUukb5.js → Lock01-Bk5T6G6y.js} +1 -1
- package/dist/client/assets/{Monitor01-nKIM1K_1.js → Monitor01-5rN-C0di.js} +1 -1
- package/dist/client/assets/{Palette-B6NpJZ9F.js → Palette-B-cRX_Fx.js} +1 -1
- package/dist/client/assets/{Play-qd-MZyD5.js → Play-BsXLejZM.js} +1 -1
- package/dist/client/assets/{Plus-Cq_1PqM9.js → Plus-beS007Js.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-CYXiv82D.js → RefreshCcw01-Dcpv3eTL.js} +1 -1
- package/dist/client/assets/{SearchMd-WZzMz_xm.js → SearchMd-CB2F2Eh5.js} +1 -1
- package/dist/client/assets/{Settings02-BGX5GQSJ.js → Settings02-DB_WZ-LQ.js} +1 -1
- package/dist/client/assets/{Shield01-Dd3PCkCh.js → Shield01-D_j6WQ24.js} +1 -1
- package/dist/client/assets/{Star01-TIrOjEGQ.js → Star01-CH8zsyZS.js} +1 -1
- package/dist/client/assets/{Stars02-BgabhO3x.js → Stars02-CH6m9NsR.js} +1 -1
- package/dist/client/assets/{Sun-BMF5NYnu.js → Sun-vCQYJllf.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-B39nOlBz.js → SwitchHorizontal01-BXOMQbPs.js} +1 -1
- package/dist/client/assets/{Tool01-CAdd6NGF.js → Tool01-B1_kF5r4.js} +1 -1
- package/dist/client/assets/{Trash01-CHrTm5S-.js → Trash01-Dv-uw8l0.js} +1 -1
- package/dist/client/assets/{Upload01-CfhmyOeM.js → Upload01-Dei9Gr0H.js} +1 -1
- package/dist/client/assets/{User01-CnVuEZ_q.js → User01-DuylSQbh.js} +1 -1
- package/dist/client/assets/{Users01-CARILaym.js → Users01-BWQyCQSo.js} +1 -1
- package/dist/client/assets/{Users03-COREII3z.js → Users03-Xhe-Woui.js} +1 -1
- package/dist/client/assets/{X-CexC7CUQ.js → X-DgjPW3BN.js} +1 -1
- package/dist/client/assets/XCircle-Kzv3aw-k.js +1 -0
- package/dist/client/assets/{XClose-BOJwjK3-.js → XClose-C8_9CjoM.js} +1 -1
- package/dist/client/assets/{Zap-DRsZpKeC.js → Zap-Co2SfCXQ.js} +1 -1
- package/dist/client/assets/{ZapSquare-rxLTzaCI.js → ZapSquare-BGWKuepx.js} +1 -1
- package/dist/client/assets/{accordion-DEFWqB9v.js → accordion-Bf2zVAiI.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-CJWirXjW.js → add-connection-dialog-wVzM7TTa.js} +1 -1
- package/dist/client/assets/agent-icon-DAOer5aY.js +1 -0
- package/dist/client/assets/{agent-icons-BMYEM-93.js → agent-icons-DNhkZE7D.js} +1 -1
- package/dist/client/assets/agents-list-DABEUXXh.js +1 -0
- package/dist/client/assets/{ai-providers-DOK2_evy.js → ai-providers-ra9PS9Te.js} +1 -1
- package/dist/client/assets/{alert-DsUJkc45.js → alert-B8IvxWyW.js} +1 -1
- package/dist/client/assets/{alert-dialog-DJnXid5j.js → alert-dialog-CBy2mP5M.js} +3 -3
- package/dist/client/assets/{auth-catchall-D2kMqSF3.js → auth-catchall-DwI_DCPg.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DNx4VwCy.js → auth-split-layout-CPl1Ogax.js} +1 -1
- package/dist/client/assets/{automation-list-row-9h6JxfVT.js → automation-list-row-DPAKg98L.js} +1 -1
- package/dist/client/assets/automations-vmGkl90g.js +1 -0
- package/dist/client/assets/{avatar-ByQQ7GEH.js → avatar-CBIJBj_W.js} +1 -1
- package/dist/client/assets/{badge-Dci-e_Pw.js → badge-CXArobm8.js} +1 -1
- package/dist/client/assets/{brand-context-CQ0JpFGU.js → brand-context-BHVsDYH_.js} +1 -1
- package/dist/client/assets/{card-CqaEJI_U.js → card-CNyFBXf4.js} +1 -1
- package/dist/client/assets/{chat-context-DxSqonhB.js → chat-context-BWXApvuA.js} +1 -1
- package/dist/client/assets/{checkbox-DdM7zWwz.js → checkbox-D1Q1psVt.js} +1 -1
- package/dist/client/assets/{cli-auth-success-W0LeKzND.js → cli-auth-success-Cv251YT1.js} +1 -1
- package/dist/client/assets/collection-detail-4oC2alH8.js +1 -0
- package/dist/client/assets/{collection-display-button-Bb5eYsxS.js → collection-display-button-CxfftABc.js} +1 -1
- package/dist/client/assets/{collection-search-CZPmAdbz.js → collection-search-CtjpA7Tw.js} +1 -1
- package/dist/client/assets/{collection-search-DYkFJwme.js → collection-search-D3hp8frj.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-VrRyg9Ib.js → collection-table-wrapper-htzX5Cc-.js} +1 -1
- package/dist/client/assets/{collection-tabs-BME6pm9f.js → collection-tabs-B9KC7Uhn.js} +1 -1
- package/dist/client/assets/{collections-CuEt9akO.js → collections-CEURDRm7.js} +1 -1
- package/dist/client/assets/{command-DaAuDqUV.js → command-BTA7LUZM.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-v3Y8dgGN.js → connect-desktop-dialog-DygjlLBa.js} +1 -1
- package/dist/client/assets/{connection-card-BY9Z3I7R.js → connection-card-4Md1PbMA.js} +1 -1
- package/dist/client/assets/connection-detail-k_WdL2vk.js +1 -0
- package/dist/client/assets/{connection-form-helpers-M4qUZwhZ.js → connection-form-helpers-DI61y2e0.js} +1 -1
- package/dist/client/assets/connections-CMhBDlPe.js +1 -0
- package/dist/client/assets/{constants-piR0edM1.js → constants-D5RCRPRT.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-DWRmePhE.js → decopilot-sse-pool-BgB0FvkR.js} +1 -1
- package/dist/client/assets/{dialog-Bg6eRMC4.js → dialog-2y75M1_6.js} +1 -1
- package/dist/client/assets/{domain-settings-CHHiS2Vl.js → domain-settings-qIsJxkrR.js} +1 -1
- package/dist/client/assets/{drawer-q5yKuLmY.js → drawer-W7QX6Ax_.js} +1 -1
- package/dist/client/assets/{dropdown-menu-TulqWZOe.js → dropdown-menu-9FoS_14a.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DEIRfHv3.js → dynamic-plugin-layout-DE7Rx2Mh.js} +1 -1
- package/dist/client/assets/{empty-state-CKtqz2A5.js → empty-state-BlF5e09g.js} +1 -1
- package/dist/client/assets/{empty-state-ZqctI9xZ.js → empty-state-CRPtBPjo.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BYGRbWJu.js → extract-connection-data-CtQqD73R.js} +1 -1
- package/dist/client/assets/features-6QwqoSn3.js +1 -0
- package/dist/client/assets/file-explorer-C9P9tLrr.js +2 -0
- package/dist/client/assets/{files-CXeAP3oD.js → files-B8cc-gBv.js} +1 -1
- package/dist/client/assets/{form-B-pClhzT.js → form-BVQywbIc.js} +1 -1
- package/dist/client/assets/general-CnRlBB-m.js +1 -0
- package/dist/client/assets/{generate-id-DfUEx9en.js → generate-id-CpWgmfmA.js} +1 -1
- package/dist/client/assets/{github-repo-picker-A9GOBLjA.js → github-repo-picker-DmuX5zhB.js} +1 -1
- package/dist/client/assets/{hooks-Buro5ByR.js → hooks-18b6g3fs.js} +1 -1
- package/dist/client/assets/{hover-card-CUfoIFQV.js → hover-card-DOoMOMFv.js} +1 -1
- package/dist/client/assets/index-0fMq3-pH.js +1 -0
- package/dist/client/assets/{index-BDOr2buP.js → index-8_y4UNLc.js} +1 -1
- package/dist/client/assets/{index-B_5hPR5_.js → index-B6vP9EOZ.js} +1 -1
- package/dist/client/assets/{index-C_m1_Qyy.js → index-BM33-uTI.js} +27 -27
- package/dist/client/assets/{index-DjuWoEWL.js → index-B_mvEXXb.js} +1 -1
- package/dist/client/assets/{index-Df1UV_SS.js → index-Bn5sNNK8.js} +1 -1
- package/dist/client/assets/{index-zGvFjFjO.js → index-BwE83rPX.js} +1 -1
- package/dist/client/assets/{index-CdCX0F7Y.js → index-C0gY1SEz.js} +4 -4
- package/dist/client/assets/{index-BHpJxImt.js → index-CZU3_Yg-.js} +2 -2
- package/dist/client/assets/{index-Wwb5vGkQ.js → index-Ct4M2Ud6.js} +1 -1
- package/dist/client/assets/index-D6GfXYzs.js +1 -0
- package/dist/client/assets/{index-CKs6rcu1.js → index-DHCuljhb.js} +1 -1
- package/dist/client/assets/{index-DKWbd0LS.js → index-g7KxjIc5.js} +2 -2
- package/dist/client/assets/index-k6iT8Tf1.js +1 -0
- package/dist/client/assets/{index-B55MEl-c.js → index-oIPZXuqi.js} +1 -1
- package/dist/client/assets/{index-DvIjF9DA.js → index-vupo1sDr.js} +13 -13
- package/dist/client/assets/{infiniteQueryObserver-CUomJPae.js → infiniteQueryObserver-DjZk0454.js} +1 -1
- package/dist/client/assets/{input-DHJ18fY7.js → input-DyimJ0YM.js} +1 -1
- package/dist/client/assets/{integration-icon-Bo72bKVV.js → integration-icon-D9qjqDnw.js} +1 -1
- package/dist/client/assets/{label-jUTi8Oc4.js → label-CYBEQrtl.js} +1 -1
- package/dist/client/assets/{layout-PcloJcLR.js → layout-CwSzvRV6.js} +1 -1
- package/dist/client/assets/{login-C1Yqpj4I.js → login-BwJgBWmn.js} +1 -1
- package/dist/client/assets/{members-x8tMmNra.js → members-SZUmLKla.js} +1 -1
- package/dist/client/assets/{monaco-editor-D-22abDQ.js → monaco-editor-BYDkxeGd.js} +3 -3
- package/dist/client/assets/{monitoring-stats-row-DkPBMjPc.js → monitoring-stats-row-8DFwtJdG.js} +1 -1
- package/dist/client/assets/{oauth-callback-5B-GDOKs.js → oauth-callback-D3HQSih9.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-KqAiGkB8.js → oauth-callback-ai-provider-hlYQfy41.js} +1 -1
- package/dist/client/assets/{onboarding-BQaPrCwV.js → onboarding-ClFOQyD0.js} +1 -1
- package/dist/client/assets/{org-layout-DOPcV20w.js → org-layout-CQSZYn7L.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-BlQBf5vT.js → org-plugin-layout-CkozoVe-.js} +1 -1
- package/dist/client/assets/{pair-DgOi01tx.js → pair-XXkclPo3.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-qP6k2hvb.js → plugin-empty-state-DcMxNkqz.js} +1 -1
- package/dist/client/assets/{plugin-header-D3WS6Tch.js → plugin-header-RG7So6zC.js} +1 -1
- package/dist/client/assets/{plugin-layout--Nx4BaLL.js → plugin-layout-1Sg2oR8k.js} +1 -1
- package/dist/client/assets/{popover-COqcQ0Rg.js → popover-DOu91n_v.js} +1 -1
- package/dist/client/assets/{profile-DZu-CjT9.js → profile-Bu4-Eb6R.js} +1 -1
- package/dist/client/assets/project-app-view-yK_XWVMG.js +1 -0
- package/dist/client/assets/registry-D1JNm-Xx.js +2 -0
- package/dist/client/assets/{registry-layout-B6kU_bv7.js → registry-layout-BmtyLpq5.js} +3 -3
- package/dist/client/assets/{required-auth-layout-CJnuX5pr.js → required-auth-layout-tzyLq2cT.js} +1 -1
- package/dist/client/assets/{reset-password-B2Ia2er4.js → reset-password-CsA4hRoj.js} +1 -1
- package/dist/client/assets/roles-dL46UDfg.js +1 -0
- package/dist/client/assets/{search-input-BX9Kn801.js → search-input-DHqGiAAb.js} +1 -1
- package/dist/client/assets/{secrets-BEffGZyZ.js → secrets-CXaOA3bo.js} +1 -1
- package/dist/client/assets/sections-editor-AHG3CG-Y.js +1 -0
- package/dist/client/assets/{select-DAV_VIox.js → select-C7bkDnqt.js} +1 -1
- package/dist/client/assets/settings-layout-MCrWdztj.js +1 -0
- package/dist/client/assets/{settings-section-DLBjUAhp.js → settings-section-DFOkupJ0.js} +1 -1
- package/dist/client/assets/{shell-controls-CNwl3y79.js → shell-controls-jx6fo9En.js} +1 -1
- package/dist/client/assets/shell-layout-BgY4DXFm.js +1 -0
- package/dist/client/assets/{sidebar-BFp8v2I0.js → sidebar-Dne1fKYn.js} +1 -1
- package/dist/client/assets/{skeleton-tYEs8dsN.js → skeleton-BiCcS3UT.js} +1 -1
- package/dist/client/assets/{sortable.esm-vK1UhoBn.js → sortable.esm-BQrMCI5H.js} +1 -1
- package/dist/client/assets/{spinner-DLBC6d93.js → spinner-Bb25iFDc.js} +1 -1
- package/dist/client/assets/{sso-BvpZRsH4.js → sso-MK5Q0tuC.js} +1 -1
- package/dist/client/assets/{store-DMo12WtF.js → store-Cu8faowN.js} +1 -1
- package/dist/client/assets/store-registry-DYz-eLFY.js +2 -0
- package/dist/client/assets/{switch-Bmqleb0M.js → switch-STNewpCh.js} +1 -1
- package/dist/client/assets/{table-Cbi2Lt5J.js → table-BR0ZQG-N.js} +1 -1
- package/dist/client/assets/{tabs-DKgnbdu4.js → tabs-BIXB9X7f.js} +1 -1
- package/dist/client/assets/{task-status-CqP04HQ9.js → task-status-Cpj07cgX.js} +1 -1
- package/dist/client/assets/{textarea-C035ZOMR.js → textarea-Csq7UfFg.js} +1 -1
- package/dist/client/assets/{toggle-group-D_tMezdr.js → toggle-group-Cvm94FnA.js} +1 -1
- package/dist/client/assets/toolbar-BFZ_P1su.js +1 -0
- package/dist/client/assets/{tools-list-DmcpkTFh.js → tools-list-BG_WhFGX.js} +1 -1
- package/dist/client/assets/{tooltip-BeTs1OMg.js → tooltip-GbZ-ULDS.js} +1 -1
- package/dist/client/assets/{types-BZ3eurxp.js → types-BGMjh8Dq.js} +5 -5
- package/dist/client/assets/{use-ai-providers-CgowGcDz.js → use-ai-providers-CaxnWnZW.js} +1 -1
- package/dist/client/assets/{use-collections-D_7JW6dX.js → use-collections-DnQvffUs.js} +1 -1
- package/dist/client/assets/{use-connection-BbCw9KPq.js → use-connection-CRCT5mv0.js} +1 -1
- package/dist/client/assets/{use-copy-DbsD5qK3.js → use-copy-Bx-USwd1.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DJVm-5Gn.js → use-create-virtual-mcp-DgE9-y_o.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-B4_HunOp.js → use-debounced-autosave-BBZX5k0R.js} +1 -1
- package/dist/client/assets/{use-delete-connection-B0yMHUHX.js → use-delete-connection-BXEk19GO.js} +1 -1
- package/dist/client/assets/{use-file-configs-DEsQ0trh.js → use-file-configs-D9H5_-BE.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-XJXa4_f9.js → use-infinite-scroll-D0a1rm12.js} +1 -1
- package/dist/client/assets/{use-list-state-C8eifEnv.js → use-list-state-BN7DRxUQ.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Cxw_xwII.js → use-mcp-prompts-Bn3MJOn8.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Cg4H0QB3.js → use-mcp-tools-BppARYHs.js} +1 -1
- package/dist/client/assets/{use-members-BB2rBOpc.js → use-members-BF_X33y-.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CVbR4ICA.js → use-navigate-to-agent-COcSBZ_P.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Bk4CKLSt.js → use-org-auth-client-Bu3yErl5.js} +1 -1
- package/dist/client/assets/{use-org-sso-Baws_Cb6.js → use-org-sso-Cbun5-U-.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DNG5Wg-t.js → use-organization-roles-BZFkc9QW.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BfJ6uqm2.js → use-organization-settings-BgjGLKnf.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CRI9AlTc.js → use-registry-connections-0IoXir_p.js} +1 -1
- package/dist/client/assets/{use-secrets-CPfeyzy3.js → use-secrets-CUom62Zy.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Ch0BXIj1.js → use-status-sounds-BKNm7I6l.js} +1 -1
- package/dist/client/assets/{use-view-mode-Bzy-dMu6.js → use-view-mode-CWH9EmAt.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DXij_fSZ.js → use-virtual-mcp-DA5BI4_W.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-C-wnWXsR.js +1 -0
- package/dist/client/assets/{useRouterState-DNwJdpeR.js → useRouterState-Rq7IpB5d.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Q-NFKrZT.js +1 -0
- package/dist/client/assets/{user-D0ZUKhOx.js → user-CpeLJRjb.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DPGq5mgK.js → view-mode-toggle-s0VkAFh3.js} +1 -1
- package/dist/client/assets/workflow-DPBHWxQm.js +1 -0
- package/dist/client/assets/workflow-detail-Din6OWiM.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/generated/root.js +36 -6
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/generated/root.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js +15 -0
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/generated/root.js +36 -6
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/generated/root.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/trace/internal.js +15 -0
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/trace/internal.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js +36 -6
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js +15 -0
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js.map +1 -1
- package/dist/server/node_modules/@opentelemetry/otlp-transformer/package.json +12 -14
- package/dist/server/node_modules/protobufjs/dist/light/protobuf.js +13 -10
- package/dist/server/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/dist/server/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/dist/server/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/dist/server/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
- package/dist/server/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
- package/dist/server/node_modules/protobufjs/dist/protobuf.js +14 -55
- package/dist/server/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/dist/server/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/dist/server/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/dist/server/node_modules/protobufjs/package.json +1 -1
- package/dist/server/node_modules/protobufjs/src/message.js +7 -3
- package/dist/server/node_modules/protobufjs/src/object.js +3 -6
- package/dist/server/node_modules/protobufjs/src/parse.js +1 -45
- package/dist/server/node_modules/protobufjs/src/type.js +1 -0
- package/package.json +1 -1
- package/dist/client/assets/ArrowNarrowLeft-C0lNfAd-.js +0 -1
- package/dist/client/assets/XCircle-D5rCjCCo.js +0 -1
- package/dist/client/assets/agent-icon-C3wnlI99.js +0 -1
- package/dist/client/assets/agents-list-B3SpQwX5.js +0 -1
- package/dist/client/assets/automations-r03D9cAA.js +0 -1
- package/dist/client/assets/collection-detail-CGNHV1EW.js +0 -1
- package/dist/client/assets/connection-detail-CGrlvist.js +0 -1
- package/dist/client/assets/connections-BV1UPzfV.js +0 -1
- package/dist/client/assets/features-D7qzU1ah.js +0 -1
- package/dist/client/assets/file-explorer-C4vwodhd.js +0 -2
- package/dist/client/assets/general-BHrzNm6e.js +0 -1
- package/dist/client/assets/index-2vcb4P4k.js +0 -1
- package/dist/client/assets/index-BPYCGyhU.js +0 -1
- package/dist/client/assets/index-RQIiwepL.js +0 -1
- package/dist/client/assets/project-app-view-CbzbFEPu.js +0 -1
- package/dist/client/assets/registry-10Lvnw38.js +0 -2
- package/dist/client/assets/roles-Dnu1ERmI.js +0 -1
- package/dist/client/assets/sections-editor-6afDX4oI.js +0 -1
- package/dist/client/assets/settings-layout-Cs92wKZb.js +0 -1
- package/dist/client/assets/shell-layout-BZaILYv9.js +0 -1
- package/dist/client/assets/store-registry-BzJ2CQJA.js +0 -2
- package/dist/client/assets/toolbar-AIIkxXjs.js +0 -1
- package/dist/client/assets/useInfiniteQuery-D0JT5WrD.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D794zrC9.js +0 -1
- package/dist/client/assets/workflow-DkG9K0We.js +0 -1
- package/dist/client/assets/workflow-detail-CEB6a5Nl.js +0 -1
- package/dist/server/node_modules/ansi-styles/index.d.ts +0 -236
- package/dist/server/node_modules/ansi-styles/index.js +0 -223
- package/dist/server/node_modules/ansi-styles/license +0 -9
- package/dist/server/node_modules/ansi-styles/package.json +0 -54
- package/dist/server/node_modules/ansi-styles/readme.md +0 -173
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as y,r as $,j as s,t as J,q as Ae,T as Rt,W as Dt,b as Re,K as Ft,n as Gt,f as Fe,g as Bt,d as Ds,L as Fs,c as W,X as Gs,Y as Bs,J as Us,P as Ls,G as Hs,F as Ks,a as Ws,B as nt,Z as Ys,o as Pe,$ as qs,D as Xs,a0 as Qs,a1 as Js,a2 as Vs,a3 as Zs,a4 as en,a5 as tn,a6 as Je,a7 as sn,a8 as nn,a9 as rn,aa as on,ab as Ut,ac as ln,ad as an,ae as cn,af as dn,ag as un,ah as mn,ai as fn,aj as xn,ak as hn,al as pn,p as gn,l as bn,E as Lt}from"./index-C_m1_Qyy.js";import{u as jn}from"./useRouterState-DNwJdpeR.js";import{A as De,I as vn,J as vt,K as _t,r as _n,L as Ht,M as yn,N as Sn}from"./agent-icon-C3wnlI99.js";import{u as Ye,f as je,g as Ee,h as ot,i as it,j as Ue,k as Kt,l as Wt,m as Nn,n as Cn,o as ft}from"./sidebar-BFp8v2I0.js";import{T as Oe}from"./toolbar-AIIkxXjs.js";import{S as Te}from"./skeleton-tYEs8dsN.js";import{P as lt,a as Qe,b as at}from"./popover-COqcQ0Rg.js";import{b as Yt,a as qt,D as Xt}from"./drawer-q5yKuLmY.js";import{u as Qt,T as He,a as Ke,c as yt,b as We}from"./tooltip-BeTs1OMg.js";import{C as wn}from"./collection-search-DYkFJwme.js";import{s as kn}from"./Star01-TIrOjEGQ.js";import{s as ze}from"./Plus-Cq_1PqM9.js";import{i as In,S as ct,u as dt,g as An}from"./constants-piR0edM1.js";import{b as Jt,u as Ve}from"./use-virtual-mcp-DXij_fSZ.js";import{u as $n,a as Mn}from"./use-navigate-to-agent-CVbR4ICA.js";import{u as Tn}from"./use-create-virtual-mcp-DJVm-5Gn.js";import{I as zn,a as On,u as En,G as Pn,W as Rn,H as Dn,S as Fn}from"./github-repo-picker-A9GOBLjA.js";import{u as Vt,a as Gn,b as Zt,e as Bn}from"./hooks-Buro5ByR.js";import{r as Un,a as Ln,R as Hn,b as Kn,u as es}from"./shell-layout-BZaILYv9.js";import{A as St}from"./avatar-ByQQ7GEH.js";import{i as ts}from"./Check-BIvjG7jh.js";import{a as Nt,i as Wn,b as Yn}from"./RefreshCcw01-CYXiv82D.js";import{a as qn}from"./XCircle-D5rCjCCo.js";import{i as Xn,a as ss}from"./ZapSquare-rxLTzaCI.js";import{i as Qn}from"./Monitor01-nKIM1K_1.js";import{n as Jn,a as Vn}from"./Sun-BMF5NYnu.js";import{a as Ze}from"./Settings02-BGX5GQSJ.js";import{i as Zn}from"./Shield01-Dd3PCkCh.js";import{a as er}from"./Users03-COREII3z.js";import{f as tr,a as sr,b as nr,c as rr,d as or,e as ir,A as lr}from"./alert-dialog-DJnXid5j.js";import{F as ar,a as cr,b as dr,c as ur,d as mr,e as fr,f as xr}from"./form-B-pClhzT.js";import{I as hr}from"./input-DHJ18fY7.js";import{S as pr}from"./spinner-DLBC6d93.js";import"./index-Df1UV_SS.js";import{n as gt,i as gr}from"./Stars02-BgabhO3x.js";import{A as ns}from"./add-connection-dialog-CJWirXjW.js";import{s as br}from"./XClose-BOJwjK3-.js";import{i as bt}from"./ChevronRight-Djwmm7yx.js";import{u as rs}from"./use-mcp-tools-Cg4H0QB3.js";import{u as os}from"./use-ai-providers-CgowGcDz.js";import{i as jr}from"./FilterLines-xU-m-2To.js";import{t as vr}from"./Users01-CARILaym.js";import{c as Ct,d as is,a as wt,b as kt,S as It}from"./select-DAV_VIox.js";import{c as _r,d as yr,e as Sr,a as Nr,b as Cr}from"./dialog-Bg6eRMC4.js";import{d as wr,a as kr,c as Ir,e as Ar,f as $r}from"./command-DaAuDqUV.js";import{i as ls}from"./Zap-DRsZpKeC.js";import{H as Mr,a as Tr,b as zr}from"./hover-card-CUfoIFQV.js";import{g as Or,S as Er}from"./task-status-CqP04HQ9.js";import{f as Pr}from"./format-time-GeUngI9C.js";import{g as Rr}from"./chat-context-DxSqonhB.js";import{t as as}from"./ChevronDown-2DdfyPVo.js";function Dr(){const t=y.c(5),{enableDecoImport:e}=Dt(),{data:n}=Re.useSession();let r;t[0]!==n?.user?.email?(r=Ft.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:Fr,enabled:o,staleTime:3e5},t[2]=r,t[3]=o,t[4]=i):i=t[4];const{data:l}=Gt(i);return l?.isDecoUser??!1}async function Fr(){const t=await fetch("/api/deco-sites/profile");return t.ok?t.json():{isDecoUser:!1}}function Gr(t){const e=Fe(),{create:n}=Vt(),{locator:r}=Ae(),o=Bt({strict:!1}),i=Ds({strict:!1});return async l=>{const a=crypto.randomUUID(),c=l===i.virtualmcpid?Un(t,r,o.taskId??""):null;try{await n({id:a,virtual_mcp_id:l,...c?{branch:c}:{}})}catch{}e({to:"/$org/$taskId",params:{org:t,taskId:a},search:{virtualmcpid:l}})}}function Br(t){const e=y.c(9),{agent:n,onClick:r}=t;let o;e[0]!==n.icon||e[1]!==n.title?(o=s.jsx(De,{icon:n.icon,name:n.title,size:"md",className:"transition-transform group-hover:scale-105"}),e[0]=n.icon,e[1]=n.title,e[2]=o):o=e[2];let i;e[3]!==n.title?(i=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground line-clamp-2 w-full",children:n.title}),e[3]=n.title,e[4]=i):i=e[4];let l;return e[5]!==r||e[6]!==o||e[7]!==i?(l=s.jsxs("button",{type:"button",onClick:r,className:"flex flex-col items-center gap-2 p-3 rounded-xl transition-colors hover:bg-accent cursor-pointer group",children:[o,i]}),e[5]=r,e[6]=o,e[7]=i,e[8]=l):l=e[8],l}function Ur(t){const e=y.c(100),{onClose:n,onOpenImportDeco:r,onOpenGithubImport:o}=t,[i,l]=$.useState(""),a=Jt(),{org:c}=Ae();let u;e[0]!==a?(u=a.filter(Kr).map(Hr),e[0]=a,e[1]=u):u=e[1];const d=u,{pin:f,isPinned:m}=$n(c.id,d);let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={navigateOnCreate:!0},e[2]=h):h=e[2];const{createVirtualMCP:x,isCreating:p}=Tn(h),{createFromTemplate:g,isCreating:b}=En(),[j]=Rt(),v=Dr(),_=Gr(c.slug);let S,N,w,C,T,M,A,k,E,I,P,z;if(e[3]!==a||e[4]!==g||e[5]!==x||e[6]!==p||e[7]!==b||e[8]!==v||e[9]!==m||e[10]!==_||e[11]!==n||e[12]!==o||e[13]!==r||e[14]!==f||e[15]!==j.experimental_vibecode||e[16]!==i){const be=i.toLowerCase();z=a.filter(Lr).filter(ee=>!i||ee.title.toLowerCase().includes(be));let q;e[29]!==m||e[30]!==_||e[31]!==n||e[32]!==f?(q=ee=>{m(ee.id)||f(ee.id),n(),l(""),_(ee.id)},e[29]=m,e[30]=_,e[31]=n,e[32]=f,e[33]=q):q=e[33];const X=q;w="flex flex-col max-h-[min(640px,80dvh)]",e[34]!==i?(C=s.jsx(wn,{value:i,onChange:l,placeholder:"Search agents..."}),e[34]=i,e[35]=C):C=e[35],S="overflow-y-auto flex-1 min-h-0 px-3 pb-3",e[36]===Symbol.for("react.memo_cache_sentinel")?(N=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[36]=N):N=e[36],T="grid grid-cols-3 gap-1";let V;e[37]!==x||e[38]!==n?(V=async()=>{J("agent_create_new_clicked",{source:"browse_popover"}),await x(),n()},e[37]=x,e[38]=n,e[39]=V):V=e[39];let Q,F;e[40]===Symbol.for("react.memo_cache_sentinel")?(Q=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(ze,{size:16,className:"text-muted-foreground"})}),F=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Create new"}),e[40]=Q,e[41]=F):(Q=e[40],F=e[41]),e[42]!==p||e[43]!==V?(M=s.jsxs("button",{type:"button",disabled:p,onClick:V,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:[Q,F]}),e[42]=p,e[43]=V,e[44]=M):M=e[44];let U;e[45]!==g||e[46]!==n?(U=async()=>{J("agent_create_clicked",{source:"browse_popover",method:"website"}),await g(Rn),n()},e[45]=g,e[46]=n,e[47]=U):U=e[47];let Z,te;e[48]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx("div",{className:"w-12 h-12 rounded-xl border-2 border-border flex items-center justify-center shrink-0 transition-transform group-hover:scale-105",children:s.jsx(kn,{className:"size-5 text-muted-foreground"})}),te=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Start Website"}),e[48]=Z,e[49]=te):(Z=e[48],te=e[49]),e[50]!==b||e[51]!==U?(A=s.jsxs("button",{type:"button",disabled:b,onClick:U,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:[Z,te]}),e[50]=b,e[51]=U,e[52]=A):A=e[52];let se;e[53]!==g||e[54]!==n?(se=async()=>{J("agent_create_clicked",{source:"browse_popover",method:"hydrogen"}),await g(Dn),n()},e[53]=g,e[54]=n,e[55]=se):se=e[55];let ne,oe;e[56]===Symbol.for("react.memo_cache_sentinel")?(ne=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:Fn,alt:"",className:"size-5 object-contain"})}),oe=s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Shopify Headless Store"}),e[56]=ne,e[57]=oe):(ne=e[56],oe=e[57]),e[58]!==b||e[59]!==se?(k=s.jsxs("button",{type:"button",disabled:b,onClick:se,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:[ne,oe]}),e[58]=b,e[59]=se,e[60]=k):k=e[60],e[61]!==n||e[62]!==o||e[63]!==j.experimental_vibecode?(E=j.experimental_vibecode&&s.jsxs("button",{type:"button",onClick:()=>{J("agent_import_clicked",{source:"github"}),o(),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(Pn,{className:"size-5 text-muted-foreground"})}),s.jsx("span",{className:"text-xs leading-tight text-center text-muted-foreground group-hover:text-foreground",children:"Import GitHub"})]}),e[61]=n,e[62]=o,e[63]=j.experimental_vibecode,e[64]=E):E=e[64],e[65]!==v||e[66]!==n||e[67]!==r?(I=v&&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[65]=v,e[66]=n,e[67]=r,e[68]=I):I=e[68];let re;e[69]!==X?(re=ee=>s.jsx(Br,{agent:ee,onClick:()=>X(ee)},ee.id),e[69]=X,e[70]=re):re=e[70],P=z.map(re),e[3]=a,e[4]=g,e[5]=x,e[6]=p,e[7]=b,e[8]=v,e[9]=m,e[10]=_,e[11]=n,e[12]=o,e[13]=r,e[14]=f,e[15]=j.experimental_vibecode,e[16]=i,e[17]=S,e[18]=N,e[19]=w,e[20]=C,e[21]=T,e[22]=M,e[23]=A,e[24]=k,e[25]=E,e[26]=I,e[27]=P,e[28]=z}else S=e[17],N=e[18],w=e[19],C=e[20],T=e[21],M=e[22],A=e[23],k=e[24],E=e[25],I=e[26],P=e[27],z=e[28];let R;e[71]!==T||e[72]!==M||e[73]!==A||e[74]!==k||e[75]!==E||e[76]!==I||e[77]!==P?(R=s.jsxs("div",{className:T,children:[M,A,k,E,I,P]}),e[71]=T,e[72]=M,e[73]=A,e[74]=k,e[75]=E,e[76]=I,e[77]=P,e[78]=R):R=e[78];let L;e[79]!==p||e[80]!==i||e[81]!==z.length?(L=z.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[79]=p,e[80]=i,e[81]=z.length,e[82]=L):L=e[82];let B;e[83]!==S||e[84]!==N||e[85]!==R||e[86]!==L?(B=s.jsxs("div",{className:S,children:[N,R,L]}),e[83]=S,e[84]=N,e[85]=R,e[86]=L,e[87]=B):B=e[87];let G;e[88]!==c.slug?(G={org:c.slug},e[88]=c.slug,e[89]=G):G=e[89];let H;e[90]!==n?(H=()=>n(),e[90]=n,e[91]=H):H=e[91];let D;e[92]!==G||e[93]!==H?(D=s.jsx("div",{className:"border-t border-border px-3 py-2.5",children:s.jsx(Fs,{to:"/$org/settings/agents",params:G,onClick:H,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:"See all agents"})}),e[92]=G,e[93]=H,e[94]=D):D=e[94];let Y;return e[95]!==w||e[96]!==C||e[97]!==B||e[98]!==D?(Y=s.jsxs("div",{className:w,children:[C,B,D]}),e[95]=w,e[96]=C,e[97]=B,e[98]=D,e[99]=Y):Y=e[99],Y}function Lr(t){return!In(t.id)}function Hr(t){return t.id}function Kr(t){return t.pinned}function cs(t){const e=y.c(21);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const{compact:r}=n,o=r===void 0?!1:r,[i,l]=$.useState(!1),[a,c]=$.useState(!1),[u,d]=$.useState(!1),f=Qt(),{setOpenMobile:m}=Ye();let h;e[2]!==f||e[3]!==m?(h=()=>{l(!1),f&&m(!1)},e[2]=f,e[3]=m,e[4]=h):h=e[4];const x=h;let p;e[5]!==x||e[6]!==i?(p=i&&s.jsx($.Suspense,{fallback:s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Te,{className:"h-4 w-24"})}),children:s.jsx(Ur,{onClose:x,onOpenImportDeco:()=>c(!0),onOpenGithubImport:()=>{d(!0),x()}})}),e[5]=x,e[6]=i,e[7]=p):p=e[7];const g=p;let b;e[8]!==o||e[9]!==f||e[10]!==i||e[11]!==g?(b=f?s.jsxs(s.Fragment,{children:[o?s.jsx(Oe,{"aria-label":"Browse agents",onClick:()=>{J("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:s.jsx(ze,{className:"size-4"})}):s.jsx(je,{children:s.jsxs(Ee,{tooltip:"Browse agents",onClick:()=>{J("agent_browser_opened",{surface:"mobile_drawer"}),l(!0)},children:[s.jsx(ze,{}),s.jsx("span",{children:"New agent"})]})}),s.jsx(Yt,{open:i,onOpenChange:l,direction:"bottom",children:s.jsxs(qt,{className:"max-h-[85dvh] p-0",children:[s.jsx(Xt,{className:"sr-only",children:"Browse agents"}),g]})})]}):s.jsxs(lt,{open:i,onOpenChange:S=>{S&&!i&&J("agent_browser_opened",{surface:"desktop_popover"}),l(S)},children:[o?s.jsx(Qe,{asChild:!0,children:s.jsx(Oe,{"aria-label":"Browse agents",children:s.jsx(ze,{className:"size-4"})})}):s.jsx(je,{children:s.jsx(Qe,{asChild:!0,children:s.jsxs(Ee,{tooltip:"Browse agents",children:[s.jsx(ze,{}),s.jsx("span",{children:"New agent"})]})})}),s.jsx(at,{className:"w-[380px] p-0 overflow-hidden",side:"right",align:"start",children:g})]}),e[8]=o,e[9]=f,e[10]=i,e[11]=g,e[12]=b):b=e[12];let j;e[13]!==a?(j=s.jsx(zn,{open:a,onOpenChange:c}),e[13]=a,e[14]=j):j=e[14];let v;e[15]!==u?(v=s.jsx(On,{open:u,onOpenChange:d}),e[15]=u,e[16]=v):v=e[16];let _;return e[17]!==b||e[18]!==j||e[19]!==v?(_=s.jsxs(s.Fragment,{children:[b,j,v]}),e[17]=b,e[18]=j,e[19]=v,e[20]=_):_=e[20],_}function ds(){const t=y.c(13),{org:e}=Ae(),n=Fe(),o=jn().location.pathname,i=e.slug,{state:l,isMobile:a}=Ye(),c=!a&&l==="collapsed";let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(vn,{className:"size-4!"}),t[0]=u):u=t[0];const d=o===`/${i}`||o===`/${i}/`;let f;t[1]!==n||t[2]!==i?(f=()=>{n({to:"/$org",params:{org:i}})},t[1]=n,t[2]=i,t[3]=f):f=t[3];let m;t[4]!==d||t[5]!==f?(m={key:"home",label:"Home",icon:u,isActive:d,onClick:f},t[4]=d,t[5]=f,t[6]=m):m=t[6];const h=m;let x;t[7]!==h?(x={type:"items",items:[h]},t[7]=h,t[8]=x):x=t[8];let p;if(t[9]!==c||t[10]!==x){if(p=[x],c){let g;t[12]===Symbol.for("react.memo_cache_sentinel")?(g={type:"custom",key:"new-task",content:s.jsx(ot,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(it,{children:s.jsx(Ue,{className:"gap-1.5",children:s.jsx(cs,{})})})})},t[12]=g):g=t[12],p.push(g)}t[9]=c,t[10]=x,t[11]=p}else p=t[11];return p}function rt(t){const e=y.c(12);let n,r,o,i;e[0]!==t?({className:n,orientation:o,decorative:i,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=i):(n=e[1],r=e[2],o=e[3],i=e[4]);const l=o===void 0?"horizontal":o,a=i===void 0?!0:i;let c;e[5]!==n?(c=W("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 u;return e[7]!==a||e[8]!==l||e[9]!==r||e[10]!==c?(u=s.jsx(Gs,{"data-slot":"separator-root",decorative:a,orientation:l,className:c,...r}),e[7]=a,e[8]=l,e[9]=r,e[10]=c,e[11]=u):u=e[11],u}function us(t){const e=y.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(ot,{className:"pt-0 pr-0 pb-2 pl-0 mt-2",children:[r,s.jsx(it,{children:s.jsx(Ue,{className:"gap-0.5",children:n})})]}),e[1]=n,e[2]=o):o=e[2],o}function ms(t){const e=y.c(18),{item:n}=t,{isMobile:r,setOpenMobile:o}=Ye();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 l=i,a=n.key,c=n.isActive&&"z-10";let u;e[4]!==c?(u=W(c),e[4]=c,e[5]=u):u=e[5];let d;e[6]!==n.label?(d=s.jsx("span",{children:n.label}),e[6]=n.label,e[7]=d):d=e[7];let f;e[8]!==l||e[9]!==n.icon||e[10]!==n.isActive||e[11]!==n.label||e[12]!==d?(f=s.jsxs(Ee,{onClick:l,isActive:n.isActive,tooltip:n.label,children:[n.icon,d]}),e[8]=l,e[9]=n.icon,e[10]=n.isActive,e[11]=n.label,e[12]=d,e[13]=f):f=e[13];let m;return e[14]!==n.key||e[15]!==u||e[16]!==f?(m=s.jsx(je,{className:u,children:f},a),e[14]=n.key,e[15]=u,e[16]=f,e[17]=m):m=e[17],m}function Wr(t){const e=y.c(12),{section:n}=t;switch(n.type){case"divider":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Kt,{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(qr),e[2]=n.group.items,e[3]=i):i=e[3];let l;return e[4]!==n.group.defaultExpanded||e[5]!==n.group.label||e[6]!==i?(l=s.jsx(us,{label:r,defaultExpanded:o,children:i}),e[4]=n.group.defaultExpanded,e[5]=n.group.label,e[6]=i,e[7]=l):l=e[7],l}case"items":{let r;e[8]!==n.items?(r=n.items.map(Yr),e[8]=n.items,e[9]=r):r=e[9];let o;return e[10]!==r?(o=s.jsx(ot,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(it,{children:s.jsx(Ue,{className:"gap-1.5",children:r})})}),e[10]=r,e[11]=o):o=e[11],o}case"custom":return n.content}}function Yr(t){return s.jsx(ms,{item:t},t.key)}function qr(t){return s.jsx(ms,{item:t},t.key)}function Xr(t){const e=y.c(14),{sections:n,footer:r,additionalContent:o,variant:i,contentClassName:l}=t,a=i===void 0?"sidebar":i;let c;e[0]!==l?(c=W("flex flex-col flex-1 px-2 py-2 gap-0.5",l),e[0]=l,e[1]=c):c=e[1];let u;e[2]!==n?(u=n.map(Qr),e[2]=n,e[3]=u):u=e[3];let d;e[4]!==o?(d=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]=d):d=e[5];let f;e[6]!==c||e[7]!==u||e[8]!==d?(f=s.jsxs(Wt,{className:c,children:[u,d]}),e[6]=c,e[7]=u,e[8]=d,e[9]=f):f=e[9];let m;return e[10]!==r||e[11]!==f||e[12]!==a?(m=s.jsxs(Nn,{variant:a,children:[f,r]}),e[10]=r,e[11]=f,e[12]=a,e[13]=m):m=e[13],m}function Qr(t,e){return s.jsx(Wr,{section:t},e)}function fs(t){const e=y.c(2);let n;return e[0]!==t?(n=s.jsx(Xr,{...t}),e[0]=t,e[1]=n):n=e[1],n}fs.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(Te,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function Jr(){const t=y.c(7),n=Dt().logo??Bs,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 l;t[2]!==o?(l=s.jsx("img",{src:o,alt:"Logo",className:"size-6 object-contain hidden dark:block"}),t[2]=o,t[3]=l):l=t[3];let a;return t[4]!==i||t[5]!==l?(a=s.jsxs(Cn,{className:"flex flex-row items-center shrink-0 h-12 px-3 pb-0",children:[i,l]}),t[4]=i,t[5]=l,t[6]=a):a=t[6],a}function At(t){const e=y.c(18),{item:n,onClose:r}=t,o=n.isActive&&"z-10";let i;e[0]!==o?(i=W(o),e[0]=o,e[1]=i):i=e[1];let l;e[2]!==n||e[3]!==r?(l=()=>{n.onClick?.(),r()},e[2]=n,e[3]=r,e[4]=l):l=e[4];let a;e[5]!==n.icon?(a=s.jsx("span",{className:"[&>svg]:size-5 shrink-0",children:n.icon}),e[5]=n.icon,e[6]=a):a=e[6];let c;e[7]!==n.label?(c=s.jsx("span",{children:n.label}),e[7]=n.label,e[8]=c):c=e[8];let u;e[9]!==n.isActive||e[10]!==n.label||e[11]!==l||e[12]!==a||e[13]!==c?(u=s.jsxs(Ee,{onClick:l,isActive:n.isActive,tooltip:n.label,className:"h-10! text-sm!",children:[a,c]}),e[9]=n.isActive,e[10]=n.label,e[11]=l,e[12]=a,e[13]=c,e[14]=u):u=e[14];let d;return e[15]!==i||e[16]!==u?(d=s.jsx(je,{className:i,children:u}),e[15]=i,e[16]=u,e[17]=d):d=e[17],d}function Vr(t){const e=y.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(Kt,{className:"my-2"}),e[0]=o):o=e[0],o}case"spacer":{let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1"}),e[1]=o):o=e[1],o}case"group":{const o=n.group.label,i=n.group.defaultExpanded;let l;if(e[2]!==r||e[3]!==n.group.items){let c;e[5]!==r?(c=u=>s.jsx(At,{item:u,onClose:r},u.key),e[5]=r,e[6]=c):c=e[6],l=n.group.items.map(c),e[2]=r,e[3]=n.group.items,e[4]=l}else l=e[4];let a;return e[7]!==n.group.defaultExpanded||e[8]!==n.group.label||e[9]!==l?(a=s.jsx(us,{label:o,defaultExpanded:i,children:l}),e[7]=n.group.defaultExpanded,e[8]=n.group.label,e[9]=l,e[10]=a):a=e[10],a}case"items":{let o;if(e[11]!==r||e[12]!==n.items){let l;e[14]!==r?(l=a=>s.jsx(At,{item:a,onClose:r},a.key),e[14]=r,e[15]=l):l=e[15],o=n.items.map(l),e[11]=r,e[12]=n.items,e[13]=o}else o=e[13];let i;return e[16]!==o?(i=s.jsx(ot,{className:"pt-0 pr-0 pb-0 pl-0",children:s.jsx(it,{children:s.jsx(Ue,{className:"gap-1.5",children:o})})}),e[16]=o,e[17]=i):i=e[17],i}case"custom":return n.content}}function Zr(t){const e=y.c(14),{sections:n,onClose:r,footer:o,additionalContent:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx($.Suspense,{fallback:s.jsx("div",{className:"h-10 shrink-0"}),children:s.jsx(Jr,{})}),e[0]=l):l=e[0];let a;if(e[1]!==r||e[2]!==n){let f;e[4]!==r?(f=(m,h)=>s.jsx(Vr,{section:m,onClose:r},h),e[4]=r,e[5]=f):f=e[5],a=n.map(f),e[1]=r,e[2]=n,e[3]=a}else a=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 u;e[8]!==a||e[9]!==c?(u=s.jsxs(Wt,{className:"flex flex-col flex-1 px-2 py-2 gap-0",children:[a,c]}),e[8]=a,e[9]=c,e[10]=u):u=e[10];let d;return e[11]!==o||e[12]!==u?(d=s.jsxs("div",{className:"bg-sidebar flex h-full w-full flex-col","data-sidebar":"sidebar",children:[l,u,o]}),e[11]=o,e[12]=u,e[13]=d):d=e[13],d}function xs(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const eo=Us({name:Ls().min(2,"Organization name is required")});function to(t){const e=y.c(41),{open:n,onOpenChange:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={resolver:Hs(eo),defaultValues:{name:""}},e[0]=o):o=e[0];const i=Ks(o);let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={mutationFn:no,onSuccess:so},e[1]=l):l=e[1];const a=Ws(l),c=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs(nr,{children:[s.jsx(rr,{children:"Create a new organization"}),s.jsx(or,{children:"Set up a new organization to collaborate with others."})]}),e[2]=u):u=e[2];let d;if(e[3]!==a||e[4]!==i){let w;e[6]!==a?(w=C=>a.mutateAsync(C),e[6]=a,e[7]=w):w=e[7],d=i.handleSubmit(w),e[3]=a,e[4]=i,e[5]=d}else d=e[5];let f;e[8]!==i.formState.isSubmitting?(f=w=>{const{field:C}=w;return s.jsxs(dr,{children:[s.jsx(ur,{children:"Organization Name"}),s.jsx(mr,{children:s.jsx(hr,{...C,placeholder:"Acme Inc.",disabled:i.formState.isSubmitting})}),s.jsx(fr,{children:"The name of your company or organization"}),C.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:"","/",xs(C.value)]})]}),s.jsx(xr,{})]})},e[8]=i.formState.isSubmitting,e[9]=f):f=e[9];let m;e[10]!==i.control||e[11]!==f?(m=s.jsx(ar,{control:i.control,name:"name",render:f}),e[10]=i.control,e[11]=f,e[12]=m):m=e[12];let h;e[13]!==c?(h=c&&s.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[13]=c,e[14]=h):h=e[14];let x;e[15]!==a||e[16]!==i?(x=()=>{a.reset(),i.reset()},e[15]=a,e[16]=i,e[17]=x):x=e[17];let p;e[18]!==i.formState.isSubmitting||e[19]!==x?(p=s.jsx(tr,{disabled:i.formState.isSubmitting,onClick:x,children:"Cancel"}),e[18]=i.formState.isSubmitting,e[19]=x,e[20]=p):p=e[20];const g=!i.formState.isValid||i.formState.isSubmitting;let b;e[21]!==i.formState.isSubmitting?(b=i.formState.isSubmitting?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(pr,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=i.formState.isSubmitting,e[22]=b):b=e[22];let j;e[23]!==g||e[24]!==b?(j=s.jsx(nt,{type:"submit",variant:"default",disabled:g,children:b}),e[23]=g,e[24]=b,e[25]=j):j=e[25];let v;e[26]!==j||e[27]!==p?(v=s.jsxs(ir,{children:[p,j]}),e[26]=j,e[27]=p,e[28]=v):v=e[28];let _;e[29]!==v||e[30]!==d||e[31]!==m||e[32]!==h?(_=s.jsxs("form",{className:"space-y-6",onSubmit:d,autoComplete:"off",children:[m,h,v]}),e[29]=v,e[30]=d,e[31]=m,e[32]=h,e[33]=_):_=e[33];let S;e[34]!==i||e[35]!==_?(S=s.jsxs(sr,{children:[u,s.jsx(cr,{...i,children:_})]}),e[34]=i,e[35]=_,e[36]=S):S=e[36];let N;return e[37]!==r||e[38]!==n||e[39]!==S?(N=s.jsx(lr,{open:n,onOpenChange:r,children:S}),e[37]=r,e[38]=n,e[39]=S,e[40]=N):N=e[40],N}function so(t){const{orgSlug:e}=t;window.location.href=`/${e}`}async function no(t){const e=xs(t.name);if(!e)throw new Error("Organization slug is invalid");const n=await Re.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 xt(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 ro(t){const e=y.c(13),{org:n,size:r}=t,o=r===void 0?"sm":r,i=o==="xs"?"size-5":"size-6",l=o==="xs"?"text-[9px]":"text-xs";let a;e[0]!==i?(a=W(i,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==n.logo||e[3]!==n.name?(c=n.logo?void 0:xt(n.name),e[2]=n.logo,e[3]=n.name,e[4]=c):c=e[4];let u;e[5]!==n.logo||e[6]!==n.name||e[7]!==l?(u=n.logo?s.jsx("img",{src:n.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:W("font-semibold leading-none",l),children:n.name.slice(0,2).toUpperCase()}),e[5]=n.logo,e[6]=n.name,e[7]=l,e[8]=u):u=e[8];let d;return e[9]!==a||e[10]!==c||e[11]!==u?(d=s.jsx("div",{className:a,style:c,children:u}),e[9]=a,e[10]=c,e[11]=u,e[12]=d):d=e[12],d}function et(t){const e=y.c(22),{item:n,onClose:r}=t;if(n.href){const c=n.external?"_blank":void 0,u=n.external?"noopener noreferrer":void 0;let d;e[0]!==n.icon?(d=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[0]=n.icon,e[1]=d):d=e[1];let f;e[2]!==n.label?(f=s.jsx("span",{className:"flex-1",children:n.label}),e[2]=n.label,e[3]=f):f=e[3];let m;return e[4]!==n.href||e[5]!==r||e[6]!==c||e[7]!==u||e[8]!==d||e[9]!==f?(m=s.jsxs("a",{href:n.href,target:c,rel:u,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:[d,f]}),e[4]=n.href,e[5]=r,e[6]=c,e[7]=u,e[8]=d,e[9]=f,e[10]=m):m=e[10],m}let o;e[11]!==n||e[12]!==r?(o=()=>{n.onClick?.(),r()},e[11]=n,e[12]=r,e[13]=o):o=e[13];let i;e[14]!==n.icon?(i=s.jsx("span",{className:"shrink-0 text-muted-foreground",children:n.icon}),e[14]=n.icon,e[15]=i):i=e[15];let l;e[16]!==n.label?(l=s.jsx("span",{className:"flex-1",children:n.label}),e[16]=n.label,e[17]=l):l=e[17];let a;return e[18]!==o||e[19]!==i||e[20]!==l?(a=s.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-2.5 px-3 py-2 rounded-md text-sm text-left w-full transition-colors text-foreground/80 hover:bg-sidebar-accent hover:text-foreground",children:[i,l]}),e[18]=o,e[19]=i,e[20]=l,e[21]=a):a=e[21],a}function $t(t){const e=y.c(16),{sortedOrgs:n,orgParam:r,onSelectOrg:o,onCreateOrg:i}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("span",{className:"text-sm font-medium text-muted-foreground/60",children:"Your Organizations"}),e[0]=l):l=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(ze,{size:16}),e[1]=a):a=e[1];let c;e[2]!==i?(c=s.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[l,s.jsx("button",{type:"button",onClick:i,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:a})]}),e[2]=i,e[3]=c):c=e[3];let u;if(e[4]!==o||e[5]!==r||e[6]!==n){let m;e[8]!==o||e[9]!==r?(m=h=>s.jsxs("button",{type:"button",onClick:()=>o(h.slug),className:W("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",h.slug===r?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[s.jsx(ro,{org:h,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:h.name}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:h.slug})]}),h.slug===r&&s.jsx(ts,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},h.id),e[8]=o,e[9]=r,e[10]=m):m=e[10],u=n.map(m),e[4]=o,e[5]=r,e[6]=n,e[7]=u}else u=e[7];let d;e[11]!==u?(d=s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1",children:u}),e[11]=u,e[12]=d):d=e[12];let f;return e[13]!==c||e[14]!==d?(f=s.jsxs(s.Fragment,{children:[c,d]}),e[13]=c,e[14]=d,e[15]=f):f=e[15],f}function Mt(t){const e=y.c(142),{user:n,userImage:r,menuItems:o,signOutItem:i,themeOptions:l,preferences:a,setPreferences:c,sortedOrgs:u,orgParam:d,onSelectOrg:f,onCreateOrg:m,close:h,isMobile:x}=t;if(x){const F=n?.name??"U";let U;e[0]!==F||e[1]!==r?(U=s.jsx(St,{url:r,fallback:F,shape:"circle",size:"sm",className:"shrink-0"}),e[0]=F,e[1]=r,e[2]=U):U=e[2];const Z=n?.name??"User";let te;e[3]!==Z?(te=s.jsx("p",{className:"text-sm font-medium truncate",children:Z}),e[3]=Z,e[4]=te):te=e[4];const se=n?.email;let ne;e[5]!==se?(ne=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:se}),e[5]=se,e[6]=ne):ne=e[6];let oe;e[7]!==te||e[8]!==ne?(oe=s.jsxs("div",{className:"flex-1 min-w-0",children:[te,ne]}),e[7]=te,e[8]=ne,e[9]=oe):oe=e[9];let re;e[10]!==n?(re=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(ao)},e[10]=n,e[11]=re):re=e[11];let ee;e[12]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsx(Nt,{size:14}),e[12]=ee):ee=e[12];let le;e[13]!==re?(le=s.jsx(He,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:re,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:ee})}),e[13]=re,e[14]=le):le=e[14];let ve;e[15]===Symbol.for("react.memo_cache_sentinel")?(ve=s.jsx(Ke,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[15]=ve):ve=e[15];let ae;e[16]!==le?(ae=s.jsx(yt,{delayDuration:300,children:s.jsxs(We,{children:[le,ve]})}),e[16]=le,e[17]=ae):ae=e[17];let _e;e[18]!==ae||e[19]!==U||e[20]!==oe?(_e=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-4 border-b border-border",children:[U,oe,ae]}),e[18]=ae,e[19]=U,e[20]=oe,e[21]=_e):_e=e[21];let ce;e[22]!==m||e[23]!==f||e[24]!==d||e[25]!==u?(ce=s.jsx("div",{className:"border-b border-border pb-2",children:s.jsx($t,{sortedOrgs:u,orgParam:d,onSelectOrg:f,onCreateOrg:m})}),e[22]=m,e[23]=f,e[24]=d,e[25]=u,e[26]=ce):ce=e[26];let de;if(e[27]!==h||e[28]!==o){let ge;e[30]!==h?(ge=Ie=>s.jsx(et,{item:Ie,onClose:h},Ie.key),e[30]=h,e[31]=ge):ge=e[31],de=o.map(ge),e[27]=h,e[28]=o,e[29]=de}else de=e[29];let ye;e[32]!==h||e[33]!==i?(ye=s.jsx(et,{item:i,onClose:h}),e[32]=h,e[33]=i,e[34]=ye):ye=e[34];let Se;e[35]!==de||e[36]!==ye?(Se=s.jsxs("nav",{className:"flex flex-col px-2 pt-2 pb-2 gap-0.5",children:[de,ye]}),e[35]=de,e[36]=ye,e[37]=Se):Se=e[37];let Ne;e[38]!==ce||e[39]!==Se?(Ne=s.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[ce,Se]}),e[38]=ce,e[39]=Se,e[40]=Ne):Ne=e[40];let ue;if(e[41]!==a.theme||e[42]!==c||e[43]!==l){let ge;e[45]!==a.theme||e[46]!==c?(ge=Ie=>{const{value:$e,icon:Xe,label:O}=Ie;return s.jsx("button",{type:"button","aria-label":O,onClick:()=>c(K=>({...K,theme:$e})),className:W("size-8 rounded-md flex items-center justify-center transition-colors",a.theme===$e?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:Xe},$e)},e[45]=a.theme,e[46]=c,e[47]=ge):ge=e[47],ue=l.map(ge),e[41]=a.theme,e[42]=c,e[43]=l,e[44]=ue}else ue=e[44];let me;e[48]!==ue?(me=s.jsx("div",{className:"flex items-center gap-0.5",children:ue}),e[48]=ue,e[49]=me):me=e[49];const Ge=a.enableSounds?"Disable sounds":"Enable sounds";let Ce;e[50]!==c?(Ce=()=>c(lo),e[50]=c,e[51]=Ce):Ce=e[51];const Be=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let fe;e[52]!==Be?(fe=W("size-8 rounded-md flex items-center justify-center transition-colors",Be),e[52]=Be,e[53]=fe):fe=e[53];let xe;e[54]!==a.enableSounds?(xe=a.enableSounds?s.jsx(vt,{size:14}):s.jsx(_t,{size:14}),e[54]=a.enableSounds,e[55]=xe):xe=e[55];let he;e[56]!==Ge||e[57]!==Ce||e[58]!==fe||e[59]!==xe?(he=s.jsx("button",{type:"button","aria-label":Ge,onClick:Ce,className:fe,children:xe}),e[56]=Ge,e[57]=Ce,e[58]=fe,e[59]=xe,e[60]=he):he=e[60];let we;e[61]===Symbol.for("react.memo_cache_sentinel")?(we=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.367.38"]}),e[61]=we):we=e[61];let ke;e[62]!==he?(ke=s.jsxs("div",{className:"flex items-center gap-2",children:[he,we]}),e[62]=he,e[63]=ke):ke=e[63];let pe;e[64]!==me||e[65]!==ke?(pe=s.jsxs("div",{className:"flex items-center justify-between px-3 py-3 border-t border-border/50",children:[me,ke]}),e[64]=me,e[65]=ke,e[66]=pe):pe=e[66];let qe;return e[67]!==_e||e[68]!==Ne||e[69]!==pe?(qe=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[_e,Ne,pe]}),e[67]=_e,e[68]=Ne,e[69]=pe,e[70]=qe):qe=e[70],qe}const p=n?.name??"U";let g;e[71]!==p||e[72]!==r?(g=s.jsx(St,{url:r,fallback:p,shape:"circle",size:"sm",className:"shrink-0"}),e[71]=p,e[72]=r,e[73]=g):g=e[73];const b=n?.name??"User";let j;e[74]!==b?(j=s.jsx("p",{className:"text-sm font-medium truncate",children:b}),e[74]=b,e[75]=j):j=e[75];const v=n?.email;let _;e[76]!==v?(_=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:v}),e[76]=v,e[77]=_):_=e[77];let S;e[78]!==j||e[79]!==_?(S=s.jsxs("div",{className:"flex-1 min-w-0",children:[j,_]}),e[78]=j,e[79]=_,e[80]=S):S=e[80];let N;e[81]!==n?(N=()=>{n?.id&&navigator.clipboard.writeText(n.id).then(io)},e[81]=n,e[82]=N):N=e[82];let w;e[83]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(Nt,{size:14}),e[83]=w):w=e[83];let C;e[84]!==N?(C=s.jsx(He,{asChild:!0,children:s.jsx("button",{type:"button",tabIndex:-1,onClick:N,className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:w})}),e[84]=N,e[85]=C):C=e[85];let T;e[86]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(Ke,{side:"right",children:s.jsx("p",{className:"text-xs",children:"Copy user ID"})}),e[86]=T):T=e[86];let M;e[87]!==C?(M=s.jsx(yt,{delayDuration:300,children:s.jsxs(We,{children:[C,T]})}),e[87]=C,e[88]=M):M=e[88];let A;e[89]!==M||e[90]!==g||e[91]!==S?(A=s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 mx-1 mt-1",children:[g,S,M]}),e[89]=M,e[90]=g,e[91]=S,e[92]=A):A=e[92];let k;if(e[93]!==h||e[94]!==o){let F;e[96]!==h?(F=U=>s.jsx(et,{item:U,onClose:h},U.key),e[96]=h,e[97]=F):F=e[97],k=o.map(F),e[93]=h,e[94]=o,e[95]=k}else k=e[95];let E;e[98]!==h||e[99]!==i?(E=s.jsx(et,{item:i,onClose:h}),e[98]=h,e[99]=i,e[100]=E):E=e[100];let I;e[101]!==k||e[102]!==E?(I=s.jsxs("nav",{className:"flex-1 flex flex-col px-2 pt-1 overflow-y-auto",children:[k,E]}),e[101]=k,e[102]=E,e[103]=I):I=e[103];let P;if(e[104]!==a.theme||e[105]!==c||e[106]!==l){let F;e[108]!==a.theme||e[109]!==c?(F=U=>{const{value:Z,icon:te,label:se}=U;return s.jsx("button",{type:"button","aria-label":se,onClick:()=>c(ne=>({...ne,theme:Z})),className:W("size-7 rounded-md flex items-center justify-center transition-colors",a.theme===Z?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground"),children:te},Z)},e[108]=a.theme,e[109]=c,e[110]=F):F=e[110],P=l.map(F),e[104]=a.theme,e[105]=c,e[106]=l,e[107]=P}else P=e[107];let z;e[111]!==P?(z=s.jsx("div",{className:"flex items-center gap-0.5",children:P}),e[111]=P,e[112]=z):z=e[112];const R=a.enableSounds?"Disable sounds":"Enable sounds";let L;e[113]!==c?(L=()=>c(oo),e[113]=c,e[114]=L):L=e[114];const B=a.enableSounds?"text-foreground hover:bg-sidebar-accent/50":"text-muted-foreground hover:bg-sidebar-accent/50 hover:text-foreground";let G;e[115]!==B?(G=W("size-7 rounded-md flex items-center justify-center transition-colors",B),e[115]=B,e[116]=G):G=e[116];let H;e[117]!==a.enableSounds?(H=a.enableSounds?s.jsx(vt,{size:14}):s.jsx(_t,{size:14}),e[117]=a.enableSounds,e[118]=H):H=e[118];let D;e[119]!==R||e[120]!==L||e[121]!==G||e[122]!==H?(D=s.jsx("button",{type:"button","aria-label":R,onClick:L,className:G,children:H}),e[119]=R,e[120]=L,e[121]=G,e[122]=H,e[123]=D):D=e[123];let Y;e[124]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsxs("span",{className:"text-xs text-muted-foreground/60",children:["v","2.367.38"]}),e[124]=Y):Y=e[124];let be;e[125]!==D?(be=s.jsxs("div",{className:"flex items-center gap-2",children:[D,Y]}),e[125]=D,e[126]=be):be=e[126];let q;e[127]!==z||e[128]!==be?(q=s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-t border-border/50",children:[z,be]}),e[127]=z,e[128]=be,e[129]=q):q=e[129];let X;e[130]!==A||e[131]!==I||e[132]!==q?(X=s.jsxs("div",{className:"w-60 shrink-0 flex flex-col border-r border-border bg-sidebar/75",children:[A,I,q]}),e[130]=A,e[131]=I,e[132]=q,e[133]=X):X=e[133];let V;e[134]!==m||e[135]!==f||e[136]!==d||e[137]!==u?(V=s.jsx("div",{className:"flex-1 flex flex-col min-w-0 min-h-0 overflow-hidden",children:s.jsx($t,{sortedOrgs:u,orgParam:d,onSelectOrg:f,onCreateOrg:m})}),e[134]=m,e[135]=f,e[136]=d,e[137]=u,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 oo(t){return{...t,enableSounds:!t.enableSounds}}function io(){Pe.success("User ID copied")}function lo(t){return{...t,enableSounds:!t.enableSounds}}function ao(){Pe.success("User ID copied")}function ht(){const t=y.c(50),{data:e}=Re.useSession(),{data:n}=Re.useListOrganizations(),r=Fe();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org",shouldThrow:!1},t[0]=o):o=t[0];const l=Ys(o)?.params.org,[a,c]=Rt(),u=Qt(),[d,f]=$.useState(!1),[m,h]=$.useState(!1),x=e?.user,p=x?.image;let g;if(t[1]!==u||t[2]!==r||t[3]!==d||t[4]!==l||t[5]!==n||t[6]!==a||t[7]!==c||t[8]!==x||t[9]!==p){const v=n?.find(Q=>Q.slug===l);let _;if(t[11]!==l||t[12]!==n){let Q;t[14]!==l?(Q=(F,U)=>F.slug===l?-1:U.slug===l?1:F.name.localeCompare(U.name),t[14]=l,t[15]=Q):Q=t[15],_=[...n??[]].sort(Q),t[11]=l,t[12]=n,t[13]=_}else _=t[13];const S=_;let N;t[16]!==r?(N=Q=>{f(!1),r({to:"/$org",params:{org:Q}})},t[16]=r,t[17]=N):N=t[17];const w=N;let C;t[18]===Symbol.for("react.memo_cache_sentinel")?(C=()=>f(!1),t[18]=C):C=t[18];const T=C;let M;t[19]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(Ze,{size:16}),t[19]=M):M=t[19];let A;t[20]!==r||t[21]!==l?(A={key:"preferences",label:"Preferences",icon:M,onClick:()=>{r({to:"/$org/settings/profile",params:{org:l??""}})}},t[20]=r,t[21]=l,t[22]=A):A=t[22];let k;t[23]===Symbol.for("react.memo_cache_sentinel")?(k={key:"terms",label:"Terms of Use",icon:s.jsx(_n,{size:16}),href:"https://www.decocms.com/terms-of-use",external:!0},t[23]=k):k=t[23];let E;t[24]===Symbol.for("react.memo_cache_sentinel")?(E={key:"privacy",label:"Privacy Policy",icon:s.jsx(Zn,{size:16}),href:"https://www.decocms.com/privacy-policy",external:!0},t[24]=E):E=t[24];let I;t[25]===Symbol.for("react.memo_cache_sentinel")?(I={key:"github",label:"decocms/studio",icon:s.jsx(qs,{className:"w-4 h-4"}),href:"https://github.com/decocms/studio",external:!0},t[25]=I):I=t[25];let P;t[26]===Symbol.for("react.memo_cache_sentinel")?(P={key:"community",label:"Community",icon:s.jsx(er,{size:16}),href:"https://decocms.com/discord",external:!0},t[26]=P):P=t[26];let z;t[27]===Symbol.for("react.memo_cache_sentinel")?(z={key:"homepage",label:"Homepage",icon:s.jsx(qn,{size:16}),href:"https://decocms.com",external:!0},t[27]=z):z=t[27];let R;t[28]!==A?(R=[A,k,E,I,P,z],t[28]=A,t[29]=R):R=t[29];const L=R;let B;t[30]===Symbol.for("react.memo_cache_sentinel")?(B={key:"logout",label:"Sign out",icon:s.jsx(Xn,{size:16}),onClick:uo},t[30]=B):B=t[30];const G=B;let H;t[31]===Symbol.for("react.memo_cache_sentinel")?(H={value:"light",icon:s.jsx(Jn,{size:14}),label:"Light theme"},t[31]=H):H=t[31];let D;t[32]===Symbol.for("react.memo_cache_sentinel")?(D={value:"dark",icon:s.jsx(Vn,{size:14}),label:"Dark theme"},t[32]=D):D=t[32];let Y;t[33]===Symbol.for("react.memo_cache_sentinel")?(Y=[H,D,{value:"system",icon:s.jsx(Qn,{size:14}),label:"System theme"}],t[33]=Y):Y=t[33];const be=Y;let q;t[34]===Symbol.for("react.memo_cache_sentinel")?(q=()=>{f(!1),h(!0)},t[34]=q):q=t[34];let X;t[35]!==w||t[36]!==u||t[37]!==L||t[38]!==l||t[39]!==a||t[40]!==c||t[41]!==S||t[42]!==x||t[43]!==p?(X={user:x,userImage:p,menuItems:L,signOutItem:G,themeOptions:be,preferences:a,setPreferences:c,sortedOrgs:S,orgParam:l,onSelectOrg:w,onCreateOrg:q,close:T,isMobile:u},t[35]=w,t[36]=u,t[37]=L,t[38]=l,t[39]=a,t[40]=c,t[41]=S,t[42]=x,t[43]=p,t[44]=X):X=t[44];const V=X;g=u?s.jsxs(Yt,{open:d,onOpenChange:f,direction:"bottom",children:[s.jsxs("button",{type:"button",onClick:()=>f(!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:v?.logo?void 0:xt(v?.name??""),children:v?.logo?s.jsx("img",{src:v.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[8px]",children:(v?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:v?.name??"Account"})]}),s.jsxs(qt,{className:"h-[80dvh] p-0",children:[s.jsx(Xt,{className:"sr-only",children:"Account"}),s.jsx(Mt,{...V})]})]}):s.jsxs(lt,{open:d,onOpenChange:f,children:[s.jsx(Qe,{asChild:!0,children:s.jsxs(Ee,{tooltip:v?.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:v?.logo?void 0:xt(v?.name??""),children:v?.logo?s.jsx("img",{src:v.logo,alt:"",className:"size-full object-cover"}):s.jsx("span",{className:"font-semibold leading-none text-[9px]",children:(v?.name??"?").slice(0,2).toUpperCase()})}),s.jsx("span",{className:"truncate",children:v?.name??"Account"})]})}),s.jsx(at,{side:"right",align:"end",sideOffset:18,collisionPadding:16,className:"w-[520px] p-0 flex max-h-[520px]",onCloseAutoFocus:co,children:s.jsx(Mt,{...V})})]}),t[1]=u,t[2]=r,t[3]=d,t[4]=l,t[5]=n,t[6]=a,t[7]=c,t[8]=x,t[9]=p,t[10]=g}else g=t[10];let b;t[45]!==m?(b=s.jsx(to,{open:m,onOpenChange:h}),t[45]=m,t[46]=b):b=t[46];let j;return t[47]!==g||t[48]!==b?(j=s.jsxs(s.Fragment,{children:[g,b]}),t[47]=g,t[48]=b,t[49]=j):j=t[49],j}function co(t){return t.preventDefault()}function uo(){J("signed_out",{source:"account_popover"}),Re.signOut()}function mo({invitation:t}){const[e,n]=$.useState(!1),[r,o]=$.useState(!1),i=Xs(),l=async()=>{n(!0);try{const u=await Re.organization.acceptInvitation({invitationId:t.id});if(u.error){Pe.error(u.error.message),n(!1);return}}catch{Pe.error("Failed to accept invitation"),n(!1);return}Pe.success("Invitation accepted!"),Qs();let c;try{c=(await Re.organization.getFullOrganization({query:{organizationId:t.organizationId}}))?.data?.slug}catch{}window.location.href=c?`/${c}`:"/"},a=async()=>{o(!0);try{const c=await Re.organization.rejectInvitation({invitationId:t.id});c.error?(Pe.error(c.error.message),o(!1)):(Pe.success("Invitation declined"),i.invalidateQueries())}catch{Pe.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(nt,{size:"icon",variant:"ghost",className:"size-7 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950",onClick:l,disabled:e||r,"aria-label":"Accept invitation",children:s.jsx(ts,{size:14})}),s.jsx(nt,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground hover:text-destructive hover:bg-destructive/10",onClick:a,disabled:e||r,"aria-label":"Decline invitation",children:s.jsx(br,{size:14})})]})]})}function fo(t){const e=y.c(14),{release:n,isSeen:r,onSelect:o}=t;let i;e[0]!==r?(i=!r&&s.jsx("span",{"aria-label":"New release",className:"absolute left-2 top-1/2 -translate-y-1/2 size-1.5 rounded-full bg-primary"}),e[0]=r,e[1]=i):i=e[1];let l;e[2]!==n.eyebrow?(l=n.eyebrow&&s.jsx("p",{className:"text-xs text-muted-foreground",children:n.eyebrow}),e[2]=n.eyebrow,e[3]=l):l=e[3];let a;e[4]!==n.title?(a=s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[4]=n.title,e[5]=a):a=e[5];let c;e[6]!==l||e[7]!==a?(c=s.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[6]=l,e[7]=a,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(bt,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=u):u=e[9];let d;return e[10]!==o||e[11]!==i||e[12]!==c?(d=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,u]}),e[10]=o,e[11]=i,e[12]=c,e[13]=d):d=e[13],d}function xo(){const t=$.useContext(Js),{data:e}=t.hooks.useListUserInvitations();return(e??[]).filter(r=>r.status==="pending"&&new Date(r.expiresAt)>new Date)}function hs(){const t=y.c(10),{isSeen:e,markSeen:n,unseenCount:r}=Ln(),o=xo();let i;if(t[0]!==e||t[1]!==o){const c=[...o].sort(go).map(po);let u;t[3]!==e?(u=f=>({type:"release",release:f,isSeen:e(f.id)}),t[3]=e,t[4]=u):u=t[4];const d=[...Hn].sort(ho).map(u);i=[...c,...d],t[0]=e,t[1]=o,t[2]=i}else i=t[2];const l=r+o.length;let a;return t[5]!==n||t[6]!==o||t[7]!==i||t[8]!==l?(a={items:i,pendingInvitations:o,redDotCount:l,markReleaseSeen:n},t[5]=n,t[6]=o,t[7]=i,t[8]=l,t[9]=a):a=t[9],a}function ho(t,e){return new Date(e.date).getTime()-new Date(t.date).getTime()}function po(t){return{type:"invitation",invitation:t}}function go(t,e){return new Date(t.expiresAt).getTime()-new Date(e.expiresAt).getTime()}class ps 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 gs(t){return t<=1?"text-destructive":t<=5?"text-amber-500 dark:text-amber-400":"text-foreground/70"}function bo(){const t=y.c(25),e=Fe(),{org:n}=Ae();let r;t[0]!==n.id||t[1]!==n.slug?(r={connectionId:ct,orgId:n.id,orgSlug:n.slug},t[0]=n.id,t[1]=n.slug,t[2]=r):r=t[2];const o=dt(r);let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i={providerId:"deco"},t[3]=i):i=t[3];let l;t[4]!==o?(l={client:o,toolName:"AI_PROVIDER_CREDITS",toolArguments:i,staleTime:6e4,select:jo},t[4]=o,t[5]=l):l=t[5];const{data:a,isPending:c,isError:u}=rs(l),d=a?.balanceCents!=null?a.balanceCents/100:null;let f;t[6]!==d||t[7]!==u||t[8]!==c?(f=c||u||d==null?"Credits":`Credits: $${d.toFixed(2)}`,t[6]=d,t[7]=u,t[8]=c,t[9]=f):f=t[9];const m=f;let h;t[10]!==d?(h=W(d!=null&&gs(d)),t[10]=d,t[11]=h):h=t[11];let x;t[12]!==e||t[13]!==n.slug?(x=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[12]=e,t[13]=n.slug,t[14]=x):x=t[14];let p;t[15]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ht,{}),t[15]=p):p=t[15];let g;t[16]!==d?(g=d!=null?`$${d.toFixed(2)}`:"Credits",t[16]=d,t[17]=g):g=t[17];let b;t[18]!==g?(b=s.jsx("span",{children:g}),t[18]=g,t[19]=b):b=t[19];let j;return t[20]!==h||t[21]!==x||t[22]!==b||t[23]!==m?(j=s.jsx(Ue,{children:s.jsx(je,{children:s.jsxs(Ee,{tooltip:m,className:h,onClick:x,children:[p,b]})})}),t[20]=h,t[21]=x,t[22]=b,t[23]=m,t[24]=j):j=t[24],j}function jo(t){return t.structuredContent}function vo(){const t=y.c(1);if(!os().some(_o))return null;let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(bo,{}),t[0]=r):r=t[0],r}function _o(t){return t.providerId==="deco"}function yo(){const t=y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ps,{children:s.jsx($.Suspense,{fallback:null,children:s.jsx(vo,{})})}),t[0]=e):e=t[0],e}function So(){const t=y.c(25),e=Fe(),{org:n}=Ae();let r;t[0]!==n.id||t[1]!==n.slug?(r={connectionId:ct,orgId:n.id,orgSlug:n.slug},t[0]=n.id,t[1]=n.slug,t[2]=r):r=t[2];const o=dt(r);let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i={providerId:"deco"},t[3]=i):i=t[3];let l;t[4]!==o?(l={client:o,toolName:"AI_PROVIDER_CREDITS",toolArguments:i,staleTime:6e4,select:No},t[4]=o,t[5]=l):l=t[5];const{data:a,isPending:c,isError:u}=rs(l),d=a?.balanceCents!=null?a.balanceCents/100:null;let f;t[6]!==d||t[7]!==u||t[8]!==c?(f=c||u||d==null?"Credits":`Credits: $${d.toFixed(2)}`,t[6]=d,t[7]=u,t[8]=c,t[9]=f):f=t[9];const m=f;let h;t[10]!==e||t[11]!==n.slug?(h=()=>e({to:"/$org/settings/ai-providers",params:{org:n.slug}}),t[10]=e,t[11]=n.slug,t[12]=h):h=t[12];let x;t[13]!==d?(x=W(d!=null&&gs(d)),t[13]=d,t[14]=x):x=t[14];let p;t[15]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Ht,{className:"size-4"}),t[15]=p):p=t[15];let g;t[16]!==h||t[17]!==x||t[18]!==m?(g=s.jsx(He,{asChild:!0,children:s.jsx(Oe,{"aria-label":m,onClick:h,className:x,children:p})}),t[16]=h,t[17]=x,t[18]=m,t[19]=g):g=t[19];let b;t[20]!==m?(b=s.jsx(Ke,{side:"top",children:m}),t[20]=m,t[21]=b):b=t[21];let j;return t[22]!==g||t[23]!==b?(j=s.jsxs(We,{delayDuration:300,children:[g,b]}),t[22]=g,t[23]=b,t[24]=j):j=t[24],j}function No(t){return t.structuredContent}function Co(){const t=y.c(1);if(!os().some(wo))return null;let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(So,{}),t[0]=r):r=t[0],r}function wo(t){return t.providerId==="deco"}function ko(){const t=y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ps,{children:s.jsx($.Suspense,{fallback:null,children:s.jsx(Co,{})})}),t[0]=e):e=t[0],e}function bs(t){const e=y.c(15),{children:n}=t,{items:r,markReleaseSeen:o}=hs(),[i,l]=$.useState(null);let a;if(e[0]!==r||e[1]!==i){let p;e[3]!==i?(p=g=>g.type==="release"&&g.release.id===i,e[3]=i,e[4]=p):p=e[4],a=r.find(p),e[0]=r,e[1]=i,e[2]=a}else a=e[2];const c=a,u=c?.type==="release"?c.release:null;let d;e[5]!==o?(d=p=>{l(p),o(p)},e[5]=o,e[6]=d):d=e[6];const f=d;let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=p=>{p||l(null)},e[7]=m):m=e[7];let h;e[8]!==f||e[9]!==r||e[10]!==u?(h=s.jsx(at,{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:u?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(nt,{size:"icon",variant:"ghost","aria-label":"Back to inbox",className:"size-7 text-muted-foreground",onClick:()=>l(null),children:s.jsx(Wn,{size:16})}),s.jsx("h3",{className:"text-sm font-medium truncate",children:u.title})]}),s.jsx("div",{className:"overflow-y-auto flex-1 p-5",children:s.jsx(Kn,{release:u})})]}):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(gt,{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(p=>p.type==="invitation"?s.jsx(mo,{invitation:p.invitation},`inv-${p.invitation.id}`):s.jsx(fo,{release:p.release,isSeen:p.isSeen,onSelect:()=>f(p.release.id)},`rel-${p.release.id}`))})]})}),e[8]=f,e[9]=r,e[10]=u,e[11]=h):h=e[11];let x;return e[12]!==n||e[13]!==h?(x=s.jsxs(lt,{onOpenChange:m,children:[n,h]}),e[12]=n,e[13]=h,e[14]=x):x=e[14],x}function js(){const{redDotCount:t}=hs();return t>0}function Io(){const t=y.c(6),e=js();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(gt,{}),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(bs,{children:s.jsx(Qe,{asChild:!0,children:s.jsxs(Ee,{tooltip:"Inbox",className:"relative",children:[n,r,o]})})}),t[4]=r,t[5]=i):i=t[5],i}function Ao(){const t=y.c(8),e=js();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(gt,{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(Qe,{asChild:!0,children:s.jsx(He,{asChild:!0,children:s.jsxs(Oe,{"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(Ke,{side:"top",children:"Inbox"}),t[5]=i):i=t[5];let l;return t[6]!==o?(l=s.jsx(bs,{children:s.jsxs(We,{delayDuration:300,children:[o,i]})}),t[6]=o,t[7]=l):l=t[7],l}function $o(){const t=y.c(3),[e,n]=$.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(Ee,{tooltip:"Connections",onClick:()=>{J("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:[s.jsx(ss,{}),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(ns,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function Mo(){const t=y.c(3),[e,n]=$.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs(We,{delayDuration:300,children:[s.jsx(He,{asChild:!0,children:s.jsx(Oe,{"aria-label":"Connections",onClick:()=>{J("connections_dialog_opened",{source:"sidebar_footer",mode:"browse"}),n(!0)},children:s.jsx(ss,{className:"size-4"})})}),s.jsx(Ke,{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(ns,{mode:"browse",open:e,onOpenChange:n,defaultTab:"all"})]}),t[1]=e,t[2]=o):o=t[2],o}function To(){const t=y.c(7),e=Fe(),{org:n}=Ae();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(Ze,{}),i=s.jsx("span",{children:"Settings"}),t[3]=o,t[4]=i):(o=t[3],i=t[4]);let l;return t[5]!==r?(l=s.jsxs(Ee,{tooltip:"Settings",onClick:r,children:[o,i]}),t[5]=r,t[6]=l):l=t[6],l}function zo(){const t=y.c(9),e=Fe(),{org:n}=Ae();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(Ze,{className:"size-4"}),t[3]=o):o=t[3];let i;t[4]!==r?(i=s.jsx(He,{asChild:!0,children:s.jsx(Oe,{"aria-label":"Settings",onClick:r,children:o})}),t[4]=r,t[5]=i):i=t[5];let l;t[6]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ke,{side:"top",children:"Settings"}),t[6]=l):l=t[6];let a;return t[7]!==i?(a=s.jsxs(We,{delayDuration:300,children:[i,l]}),t[7]=i,t[8]=a):a=t[8],a}function Oo(){const t=y.c(6),{state:e}=Ye();if(e==="collapsed"){let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(yo,{}),t[0]=o):o=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(je,{children:s.jsx($o,{})}),t[1]=i):i=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(je,{children:s.jsx(Io,{})}),t[2]=l):l=t[2];let a;t[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(je,{children:s.jsx(To,{})}),t[3]=a):a=t[3];let c;return t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsxs(ft,{className:"px-2 pb-3 gap-1",children:[o,s.jsxs(Ue,{children:[i,l,a,s.jsx(je,{children:s.jsx(ht,{})})]})]}),t[4]=c):c=t[4],c}let r;return t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ft,{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(Ue,{children:s.jsx(je,{children:s.jsx(ht,{})})})}),s.jsx(zo,{}),s.jsx(Ao,{}),s.jsx(Mo,{}),s.jsx(ko,{})]})}),t[5]=r):r=t[5],r}function Eo(){const t=y.c(8),e=Fe(),{org:n}=Ae(),{setOpenMobile:r}=Ye();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Ue,{children:s.jsx(je,{children:s.jsx(ht,{})})})}),t[0]=o):o=t[0];let i;t[1]!==e||t[2]!==n.slug||t[3]!==r?(i=()=>{e({to:"/$org/settings",params:{org:n.slug}}),r(!1)},t[1]=e,t[2]=n.slug,t[3]=r,t[4]=i):i=t[4];let l;t[5]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Ze,{className:"size-4"}),t[5]=l):l=t[5];let a;return t[6]!==i?(a=s.jsx(ft,{className:"px-2 pb-3",children:s.jsxs("div",{className:"flex items-center gap-1",children:[o,s.jsx(Oe,{"aria-label":"Settings",onClick:i,children:l})]})}),t[6]=i,t[7]=a):a=t[7],a}function Po(t,e){return t.filter(n=>!(e.ownerUserId!==void 0&&n.created_by!==e.ownerUserId||e.hasTrigger!==void 0&&!!n.trigger_id!==e.hasTrigger||!!n.hidden!==e.hidden))}function Ro(t){const e=y.c(8),{virtualMcpId:n,size:r,showAutomationBadge:o}=t,i=r===void 0?"sm":r;let l;e[0]!==i||e[1]!==n?(l=n?s.jsx(Do,{virtualMcpId:n,size:i}):s.jsx(De,{icon:null,name:"?",size:i}),e[0]=i,e[1]=n,e[2]=l):l=e[2];let a;e[3]!==o?(a=o&&s.jsx("span",{"aria-label":"Automation-triggered",className:"absolute -bottom-0.5 -right-0.5 flex size-4 items-center justify-center rounded-full bg-blue-500 border border-blue-600 text-white",children:s.jsx(ls,{size:10,className:"text-white"})}),e[3]=o,e[4]=a):a=e[4];let c;return e[5]!==l||e[6]!==a?(c=s.jsxs("div",{className:"relative shrink-0",children:[l,a]}),e[5]=l,e[6]=a,e[7]=c):c=e[7],c}function Do(t){const e=y.c(6),{virtualMcpId:n,size:r}=t,o=Ve(n);if(!o){let a;return e[0]!==r?(a=s.jsx(De,{icon:null,name:"?",size:r}),e[0]=r,e[1]=a):a=e[1],a}const i=o.icon??null;let l;return e[2]!==o.title||e[3]!==r||e[4]!==i?(l=s.jsx(De,{icon:i,name:o.title,size:r}),e[2]=o.title,e[3]=r,e[4]=i,e[5]=l):l=e[5],l}function Fo(t){const e=y.c(39),{open:n,onOpenChange:r}=t,[o,i]=$.useState(""),{org:l}=Ae(),{setTaskId:a}=es();let c;e[0]!==l.id||e[1]!==l.slug?(c={connectionId:ct,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=c):c=e[2];const u=dt(c);let d,f,m;e[3]!==l.id||e[4]!==o?(m=o.trim(),f=Gt,d=Ft.globalSearch(l.id,m),e[3]=l.id,e[4]=o,e[5]=d,e[6]=f,e[7]=m):(d=e[5],f=e[6],m=e[7]);const h=n&&m.length>0;let x;e[8]!==u||e[9]!==m?(x=async()=>{if(!u)throw new Error("MCP client unavailable");const I=await u.callTool({name:"GLOBAL_SEARCH",arguments:{query:m,limit:20}});return I.structuredContent??I},e[8]=u,e[9]=m,e[10]=x):x=e[10];let p;e[11]!==d||e[12]!==h||e[13]!==x?(p={queryKey:d,enabled:h,queryFn:x,staleTime:1e4},e[11]=d,e[12]=h,e[13]=x,e[14]=p):p=e[14];const{data:g,isFetching:b}=f(p);let j;e[15]!==g?.items?(j=g?.items??[],e[15]=g?.items,e[16]=j):j=e[16];const v=j;let _;e[17]!==r?(_=I=>{I||i(""),r(I)},e[17]=r,e[18]=_):_=e[18];const S=_;let N;e[19]!==S||e[20]!==a?(N=I=>{S(!1),a(I.id,I.virtual_mcp_id??void 0)},e[19]=S,e[20]=a,e[21]=N):N=e[21];const w=N;let C;e[22]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsxs(_r,{className:"sr-only",children:[s.jsx(yr,{children:"Search"}),s.jsx(Sr,{children:"Search across your organization's resources."})]}),e[22]=C):C=e[22];let T;e[23]!==o?(T=s.jsx(Ir,{value:o,onValueChange:i,placeholder:"Search..."}),e[23]=o,e[24]=T):T=e[24];let M;e[25]!==w||e[26]!==b||e[27]!==v||e[28]!==m?(M=m?b&&v.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Searching…"}):v.length===0?s.jsx(wr,{children:"No results."}):v.map(I=>I.type==="thread"?s.jsxs(kr,{value:`thread:${I.id}:${I.title}`,onSelect:()=>w(I),className:"gap-2.5",children:[s.jsx(Ro,{virtualMcpId:I.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:I.title||"Untitled thread"})}),s.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:new Date(I.updated_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},`thread:${I.id}`):null):s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Start typing to search."}),e[25]=w,e[26]=b,e[27]=v,e[28]=m,e[29]=M):M=e[29];let A;e[30]!==M?(A=s.jsx(Ar,{children:M}),e[30]=M,e[31]=A):A=e[31];let k;e[32]!==T||e[33]!==A?(k=s.jsxs(Nr,{className:"overflow-hidden p-0",closeButtonClassName:"hidden",children:[C,s.jsxs($r,{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:[T,A]})]}),e[32]=T,e[33]=A,e[34]=k):k=e[34];let E;return e[35]!==S||e[36]!==n||e[37]!==k?(E=s.jsx(Cr,{open:n,onOpenChange:S,children:k}),e[35]=S,e[36]=n,e[37]=k,e[38]=E):E=e[38],E}function Go(t){return t==="ephemeral"||t.startsWith("thread:")}const Tt=new Map;function vs(t){let e=Tt.get(t);return e||(e={tick:0,subscribers:new Set,intervalId:null},Tt.set(t,e)),e}function Bo(t,e){const n=vs(t);return n.subscribers.add(e),n.intervalId===null&&(n.intervalId=setInterval(()=>{n.tick+=1;for(const r of n.subscribers)r()},t)),()=>{n.subscribers.delete(e),n.subscribers.size===0&&n.intervalId!==null&&(clearInterval(n.intervalId),n.intervalId=null)}}function Uo(t){const e=y.c(3),n=t;let r,o;return e[0]!==n?(r=i=>Bo(n,i),o=()=>vs(n).tick,e[0]=n,e[1]=r,e[2]=o):(r=e[1],o=e[2]),$.useSyncExternalStore(r,o,Lo)}function Lo(){return 0}function ut(t){const e=y.c(45),{task:n,isActive:r,onClick:o,onArchive:i,showAutomationBadge:l,showAgentIcon:a,hideStatusIdle:c}=t,u=Or(n.status),d=u.icon,f=n.metadata?.kind==="tool_call_run",m=Ve(f?void 0:n.virtual_mcp_id);let h;e[0]!==m?(h=Rr(m),e[0]=m,e[1]=h):h=e[1];const x=h;Uo(6e4);const p=l||!!n.trigger_id,g=n.id,b="button",j=0;let v;e[2]!==o?(v=D=>{D.target===D.currentTarget&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),o())},e[2]=o,e[3]=v):v=e[3];const _=r?"bg-accent text-accent-foreground":"hover:bg-accent/60";let S;e[4]!==_?(S=W("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",_),e[4]=_,e[5]=S):S=e[5];let N;e[6]!==f||e[7]!==a||e[8]!==m?.icon||e[9]!==m?.title?(N=a&&!f&&s.jsx(De,{icon:m?.icon??null,name:m?.title??"?",size:"2xs"}),e[6]=f,e[7]=a,e[8]=m?.icon,e[9]=m?.title,e[10]=N):N=e[10];let w;e[11]!==p?(w=p&&s.jsx(ls,{size:12,"aria-label":"Automation-triggered",className:"shrink-0 text-blue-500"}),e[11]=p,e[12]=w):w=e[12];const C=n.title||"Untitled task";let T;e[13]!==C?(T=s.jsx("div",{className:"text-sm text-foreground truncate",children:C}),e[13]=C,e[14]=T):T=e[14];let M;e[15]!==T||e[16]!==w?(M=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[w,T]}),e[15]=T,e[16]=w,e[17]=M):M=e[17];let A;e[18]!==x||e[19]!==r||e[20]!==n.branch||e[21]!==n.updated_at?(A=n.updated_at&&s.jsxs("div",{className:W("flex items-center gap-1 text-[11px] min-w-0",r?"text-accent-foreground/70":"text-muted-foreground/60"),children:[n.branch&&!Go(n.branch)?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-mono",children:n.branch}),s.jsx("span",{className:"shrink-0",children:"·"})]}):x?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"truncate",children:[x.owner,"/",x.name]}),s.jsx("span",{className:"shrink-0",children:"·"})]}):null,s.jsx("span",{className:"shrink-0",children:Pr(new Date(n.updated_at))})]}),e[18]=x,e[19]=r,e[20]=n.branch,e[21]=n.updated_at,e[22]=A):A=e[22];let k;e[23]!==M||e[24]!==A?(k=s.jsxs("div",{className:"flex-1 min-w-0",children:[M,A]}),e[23]=M,e[24]=A,e[25]=k):k=e[25];const E="shrink-0 grid [grid-template-areas:'slot'] items-center justify-items-center",I=!c&&s.jsx("span",{className:"[grid-area:slot] flex size-7 items-center justify-center pointer-events-none transition-opacity group-hover/row:opacity-0","aria-label":u.label,children:s.jsx(d,{size:14,className:W(u.iconClassName,n.status==="in_progress"&&"animate-spin")})});let P;e[26]!==i?(P=D=>{D.stopPropagation(),i()},e[26]=i,e[27]=P):P=e[27];let z;e[28]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(gr,{size:14}),e[28]=z):z=e[28];let R;e[29]!==P?(R=s.jsx(He,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":"Archive task",onClick:P,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]=P,e[30]=R):R=e[30];let L;e[31]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(Ke,{side:"right",children:"Archive"}),e[31]=L):L=e[31];let B;e[32]!==R?(B=s.jsxs(We,{children:[R,L]}),e[32]=R,e[33]=B):B=e[33];let G;e[34]!==I||e[35]!==B?(G=s.jsxs("div",{className:E,children:[I,B]}),e[34]=I,e[35]=B,e[36]=G):G=e[36];let H;return e[37]!==o||e[38]!==k||e[39]!==G||e[40]!==v||e[41]!==S||e[42]!==N||e[43]!==n.id?(H=s.jsxs("div",{"data-task-id":g,role:b,tabIndex:j,onClick:o,onKeyDown:v,className:S,children:[N,k,G]}),e[37]=o,e[38]=k,e[39]=G,e[40]=v,e[41]=S,e[42]=N,e[43]=n.id,e[44]=H):H=e[44],H}function Ho(t){const e=y.c(39),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a}=t,c=Ve(n),u=r[0];let d;e[0]!==u||e[1]!==a||e[2]!==i||e[3]!==n?(d=()=>{u?i(u):a(n)},e[0]=u,e[1]=a,e[2]=i,e[3]=n,e[4]=d):d=e[4];const f=d;let m;e[5]!==n?(m=k=>{k&&J("sidebar_group_hover_popover_opened",{virtual_mcp_id:n})},e[5]=n,e[6]=m):m=e[6];const h=!!(u&&o&&u.id===o),x=c?.icon??null,p=c?.title??"?";let g;e[7]!==x||e[8]!==p?(g=s.jsx(De,{icon:x,name:p,size:"sm+"}),e[7]=x,e[8]=p,e[9]=g):g=e[9];let b;e[10]!==f||e[11]!==h||e[12]!==g?(b=s.jsx(je,{children:s.jsx(Mr,{asChild:!0,children:s.jsx(Ee,{onClick:f,isActive:h,children:g})})}),e[10]=f,e[11]=h,e[12]=g,e[13]=b):b=e[13];const j=c?.title??"Agent";let v;e[14]!==j?(v=s.jsx("span",{className:"truncate",children:j}),e[14]=j,e[15]=v):v=e[15];let _;e[16]!==a||e[17]!==n?(_=()=>a(n),e[16]=a,e[17]=n,e[18]=_):_=e[18];let S;e[19]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(ze,{size:14}),e[19]=S):S=e[19];let N;e[20]!==_?(N=s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:_,className:"flex size-6 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground",children:S}),e[20]=_,e[21]=N):N=e[21];let w;e[22]!==N||e[23]!==v?(w=s.jsxs("div",{className:"flex items-center justify-between px-1 pb-1 text-xs font-medium",children:[v,N]}),e[22]=N,e[23]=v,e[24]=w):w=e[24];let C;e[25]!==o||e[26]!==l||e[27]!==i||e[28]!==r?(C=r.length===0?s.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No tasks yet"}):r.map(k=>s.jsx(ut,{task:k,isActive:o===k.id,onClick:()=>i(k),onArchive:()=>l(k),showAutomationBadge:!!k.trigger_id},k.id)),e[25]=o,e[26]=l,e[27]=i,e[28]=r,e[29]=C):C=e[29];let T;e[30]!==C?(T=s.jsx("div",{className:"flex flex-col gap-0.5 max-h-[60vh] overflow-y-auto",children:C}),e[30]=C,e[31]=T):T=e[31];let M;e[32]!==w||e[33]!==T?(M=s.jsxs(Tr,{side:"right",align:"start",sideOffset:8,className:"w-72 p-2",children:[w,T]}),e[32]=w,e[33]=T,e[34]=M):M=e[34];let A;return e[35]!==M||e[36]!==m||e[37]!==b?(A=s.jsxs(zr,{openDelay:120,closeDelay:150,onOpenChange:m,children:[b,M]}),e[35]=M,e[36]=m,e[37]=b,e[38]=A):A=e[38],A}const st="__tool_call_runs__",zt=["requires_action","in_progress","failed","expired","completed"];function Ko(t){const e=new Map(zt.map(n=>[n,[]]));for(const n of t){const r=n.status??"completed";(e.get(r)??e.get("completed")).push(n)}return zt.map(n=>({status:n,threads:e.get(n)}))}function Wo(t,e,n){const r=new Map;for(const d of e)r.set(d.id,{virtualMcpId:d.id,threads:[],latestUpdatedAt:""});for(const d of t){if(d.id.startsWith("thrd_welcome_"))continue;const f=d.virtual_mcp_id??st,m=r.get(f);m?(m.threads.push(d),(d.updated_at??"")>m.latestUpdatedAt&&(m.latestUpdatedAt=d.updated_at??"")):r.set(f,{virtualMcpId:f,threads:[d],latestUpdatedAt:d.updated_at??""})}n&&!r.has(n)&&r.set(n,{virtualMcpId:n,threads:[],latestUpdatedAt:""});const o=n!==null?r.get(n):void 0;o&&n&&r.delete(n);const i=r.get(st);i&&r.delete(st);const l=[...r.values()],a=l.filter(d=>d.threads.length>0).sort((d,f)=>f.latestUpdatedAt.localeCompare(d.latestUpdatedAt)),c=l.filter(d=>d.threads.length===0).sort((d,f)=>d.virtualMcpId.localeCompare(f.virtualMcpId)),u=[];return o&&u.push(o),u.push(...a,...c),i&&u.push(i),u}const _s="sidebar.group-order.",pt=new Map;function Yo(t){const e=pt.get(t);if(e)return e;try{const n=localStorage.getItem(`${_s}${t}`),r=n?JSON.parse(n):[],o=Array.isArray(r)?r.filter(i=>typeof i=="string"):[];return pt.set(t,o),o}catch{return[]}}function qo(t,e){pt.set(t,e);try{localStorage.setItem(`${_s}${t}`,JSON.stringify(e))}catch{}}function Xo(t,e,n){let r=Yo(t);const o=new Set(r),l=e.map(c=>c.virtualMcpId).filter(c=>!o.has(c));if(l.length>0){const u=n!==null&&r[0]===n?1:0;r=[...r.slice(0,u),...l,...r.slice(u)],qo(t,r)}const a=new Map(e.map(c=>[c.virtualMcpId,c]));return r.map(c=>{const u=a.get(c);return u||{virtualMcpId:c,threads:[],latestUpdatedAt:""}})}var jt="ContextMenu",[Qo]=ln(jt,[Ut]),ie=Ut(),[Jo,ys]=Qo(jt),Ss=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:o,modal:i=!0}=t,[l,a]=$.useState(!1),c=ie(e),u=Vs(r),d=$.useCallback(f=>{a(f),u(f)},[u]);return s.jsx(Jo,{scope:e,open:l,onOpenChange:d,modal:i,children:s.jsx(Zs,{...c,dir:o,open:l,onOpenChange:d,modal:i,children:n})})};Ss.displayName=jt;var Ns="ContextMenuTrigger",Cs=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=t,i=ys(Ns,n),l=ie(n),a=$.useRef({x:0,y:0}),c=$.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),u=$.useRef(0),d=$.useCallback(()=>window.clearTimeout(u.current),[]),f=m=>{a.current={x:m.clientX,y:m.clientY},i.onOpenChange(!0)};return $.useEffect(()=>d,[d]),$.useEffect(()=>{r&&d()},[r,d]),s.jsxs(s.Fragment,{children:[s.jsx(en,{...l,virtualRef:c}),s.jsx(tn.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:Je(t.onContextMenu,m=>{d(),f(m),m.preventDefault()}),onPointerDown:r?t.onPointerDown:Je(t.onPointerDown,tt(m=>{d(),u.current=window.setTimeout(()=>f(m),700)})),onPointerMove:r?t.onPointerMove:Je(t.onPointerMove,tt(d)),onPointerCancel:r?t.onPointerCancel:Je(t.onPointerCancel,tt(d)),onPointerUp:r?t.onPointerUp:Je(t.onPointerUp,tt(d))})]})});Cs.displayName=Ns;var Vo="ContextMenuPortal",ws=t=>{const{__scopeContextMenu:e,...n}=t,r=ie(e);return s.jsx(sn,{...r,...n})};ws.displayName=Vo;var ks="ContextMenuContent",Is=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ys(ks,n),i=ie(n),l=$.useRef(!1);return s.jsx(nn,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),!a.defaultPrevented&&l.current&&a.preventDefault(),l.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),!a.defaultPrevented&&!o.modal&&(l.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)"}})});Is.displayName=ks;var Zo="ContextMenuGroup",ei=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ie(n);return s.jsx(an,{...o,...r,ref:e})});ei.displayName=Zo;var ti="ContextMenuLabel",si=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ie(n);return s.jsx(cn,{...o,...r,ref:e})});si.displayName=ti;var ni="ContextMenuItem",As=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ie(n);return s.jsx(rn,{...o,...r,ref:e})});As.displayName=ni;var ri="ContextMenuCheckboxItem",oi=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ie(n);return s.jsx(dn,{...o,...r,ref:e})});oi.displayName=ri;var ii="ContextMenuRadioGroup",li=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ie(n);return s.jsx(un,{...o,...r,ref:e})});li.displayName=ii;var ai="ContextMenuRadioItem",ci=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ie(n);return s.jsx(mn,{...o,...r,ref:e})});ci.displayName=ai;var di="ContextMenuItemIndicator",ui=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ie(n);return s.jsx(fn,{...o,...r,ref:e})});ui.displayName=di;var mi="ContextMenuSeparator",$s=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ie(n);return s.jsx(on,{...o,...r,ref:e})});$s.displayName=mi;var fi="ContextMenuArrow",xi=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ie(n);return s.jsx(xn,{...o,...r,ref:e})});xi.displayName=fi;var hi="ContextMenuSubTrigger",pi=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ie(n);return s.jsx(hn,{...o,...r,ref:e})});pi.displayName=hi;var gi="ContextMenuSubContent",bi=$.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=ie(n);return s.jsx(pn,{...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)"}})});bi.displayName=gi;function tt(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var ji=Ss,vi=Cs,_i=ws,yi=Is,Si=As,Ni=$s;function Ci(t){const e=y.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(ji,{"data-slot":"context-menu",...n}),e[2]=n,e[3]=r):r=e[3],r}function wi(t){const e=y.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(vi,{"data-slot":"context-menu-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function ki(t){const e=y.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=W("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(_i,{children:s.jsx(yi,{"data-slot":"context-menu-content",className:o,...r})}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}function mt(t){const e=y.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 l=i===void 0?"default":i;let a;e[5]!==n?(a=W("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]=a):a=e[6];let c;return e[7]!==r||e[8]!==o||e[9]!==a||e[10]!==l?(c=s.jsx(Si,{"data-slot":"context-menu-item","data-inset":r,"data-variant":l,className:a,...o}),e[7]=r,e[8]=o,e[9]=a,e[10]=l,e[11]=c):c=e[11],c}function Ii(t){const e=y.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=W("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(Ni,{"data-slot":"context-menu-separator",className:o,...r}),e[5]=r,e[6]=o,e[7]=i):i=e[7],i}const Ai="sidebar.group.expanded.";function Ms(t,e){const n=y.c(3),[r,o]=gn(`${Ai}${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 Ts(t){const e=y.c(10),{onClick:n,isFetching:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=W("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(bn,{size:14,className:"animate-spin"}),e[1]=r,e[2]=i):i=e[2];const l=r?"Loading…":"Show more";let a;e[3]!==l?(a=s.jsx("span",{children:l}),e[3]=l,e[4]=a):a=e[4];let c;return e[5]!==r||e[6]!==n||e[7]!==i||e[8]!==a?(c=s.jsxs("button",{type:"button","aria-label":"Show more tasks",onClick:n,disabled:r,className:o,children:[i,a]}),e[5]=r,e[6]=n,e[7]=i,e[8]=a,e[9]=c):c=e[9],c}function $i(t,e,n,r,o){const i={};t==="agent"&&(i.virtual_mcp_id=e),r.member==="mine"&&r.currentUserId&&(i.created_by=r.currentUserId),r.type==="automation"&&(i.has_trigger=!0),r.type==="manual"&&(i.has_trigger=!1);const l={where:i,limit:o,offset:n,orderBy:[{field:["updated_at"],direction:"desc"}]};return t==="status"&&(l.status=e),l}function Mi(t,e,n,r){let o=0;for(const i of t)i.hidden||e==="agent"&&i.virtual_mcp_id!==n||e==="status"&&(i.status??"completed")!==n||r.member==="mine"&&r.currentUserId&&i.created_by!==r.currentUserId||r.type==="automation"&&!i.trigger_id||r.type==="manual"&&i.trigger_id||o++;return o}const Ot=10;function Ti(t,e,n){return[t,e,n.type,n.member,n.currentUserId??""].join("|")}function zs(t,e,n){const r=Ti(t,e,n),[o,i]=$.useState({hasMore:!0,isFetching:!1,identity:r});o.identity!==r&&i({hasMore:!0,isFetching:!1,identity:r});const l=Gn(),{threads:a}=Zt(),{org:c}=Ae(),u=dt({connectionId:ct,orgId:c.id,orgSlug:c.slug});async function d(){if(o.isFetching)return;const f=r;i(m=>m.identity===f?{...m,isFetching:!0}:m);try{const m=Mi(a,t,e,n),h=$i(t,e,m,n,Ot),x=await u.callTool({name:"COLLECTION_THREADS_LIST",arguments:h});if(x.isError)throw new Error(Bn(x,"COLLECTION_THREADS_LIST failed"));const p=x.structuredContent?.items,g=Array.isArray(p)?p:[];l.mergeThreads(g),i(b=>b.identity!==f?b:{...b,isFetching:!1,hasMore:g.length===Ot})}catch(m){const h=m instanceof Error?m.message:String(m);Pe.error(`Could not load more tasks: ${h}`),i(x=>x.identity===f?{...x,isFetching:!1}:x)}}return{hasMore:o.hasMore,isFetching:o.isFetching,loadMore:d}}function zi(t){const e=y.c(55),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,onShowSettings:c,onHideGroup:u,dimmed:d,filters:f}=t,[m,h]=Ms(n,!1),x=n===st,p=zs("agent",n,f);let g;e[0]!==m||e[1]!==x||e[2]!==h||e[3]!==p||e[4]!==r?(g=function(){const R=!m;h(R),R&&!x&&r.length===0&&p.hasMore&&!p.isFetching&&p.loadMore()},e[0]=m,e[1]=x,e[2]=h,e[3]=p,e[4]=r,e[5]=g):g=e[5];const b=g;let j;e[6]!==b?(j=z=>{z.target===z.currentTarget&&(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),b())},e[6]=b,e[7]=j):j=e[7];let v;e[8]===Symbol.for("react.memo_cache_sentinel")?(v=W("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"),e[8]=v):v=e[8];let _;e[9]!==x||e[10]!==n?(_=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(Oi,{virtualMcpId:n,isToolCallRuns:x})}),e[9]=x,e[10]=n,e[11]=_):_=e[11];let S;e[12]!==m?(S=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:m?s.jsx(as,{size:14}):s.jsx(bt,{size:14})}),e[12]=m,e[13]=S):S=e[13];let N;e[14]!==_||e[15]!==S?(N=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[_,S]}),e[14]=_,e[15]=S,e[16]=N):N=e[16];let w;e[17]!==x||e[18]!==n?(w=s.jsx("span",{className:"flex-1 truncate",children:s.jsx(Pi,{virtualMcpId:n,isToolCallRuns:x})}),e[17]=x,e[18]=n,e[19]=w):w=e[19];let C;e[20]!==d||e[21]!==x||e[22]!==a||e[23]!==n?(C=!x&&!d&&s.jsx("button",{type:"button","aria-label":"New task in this agent",onClick:z=>{z.stopPropagation(),a(n)},className:"opacity-0 group-hover/group:opacity-100 focus-visible:opacity-100 transition-opacity flex size-7 items-center justify-center rounded-md hover:bg-accent text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:s.jsx(ze,{size:14})}),e[20]=d,e[21]=x,e[22]=a,e[23]=n,e[24]=C):C=e[24];let T;e[25]!==m||e[26]!==b||e[27]!==j||e[28]!==N||e[29]!==w||e[30]!==C?(T=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":m,onClick:b,onKeyDown:j,className:v,children:[N,w,C]}),e[25]=m,e[26]=b,e[27]=j,e[28]=N,e[29]=w,e[30]=C,e[31]=T):T=e[31];const M=T,A=d&&"opacity-50";let k;e[32]!==A?(k=W("flex flex-col gap-0.5",A),e[32]=A,e[33]=k):k=e[33];let E;e[34]!==M||e[35]!==x||e[36]!==u||e[37]!==a||e[38]!==c||e[39]!==n?(E=x?M:s.jsxs(Ci,{children:[s.jsx(wi,{asChild:!0,children:M}),s.jsxs(ki,{className:"w-56",children:[s.jsxs(mt,{onSelect:()=>a(n),children:[s.jsx(ze,{size:14,className:"mr-2"}),"New task"]}),s.jsxs(mt,{onSelect:()=>c(n),children:[s.jsx(Ze,{size:14,className:"mr-2"}),"Settings"]}),s.jsx(Ii,{}),s.jsxs(mt,{onSelect:()=>u(n),children:[s.jsx(Yn,{size:14,className:"mr-2"}),"Hide"]})]})]}),e[34]=M,e[35]=x,e[36]=u,e[37]=a,e[38]=c,e[39]=n,e[40]=E):E=e[40];let I;e[41]!==o||e[42]!==m||e[43]!==x||e[44]!==l||e[45]!==a||e[46]!==i||e[47]!==p||e[48]!==r||e[49]!==n?(I=m&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:x?r.map(z=>s.jsx(ut,{task:z,isActive:o===z.id,onClick:()=>i(z),onArchive:()=>l(z),showAutomationBadge:!!z.trigger_id},z.id)):s.jsx(Di,{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,showMore:p})}),e[41]=o,e[42]=m,e[43]=x,e[44]=l,e[45]=a,e[46]=i,e[47]=p,e[48]=r,e[49]=n,e[50]=I):I=e[50];let P;return e[51]!==k||e[52]!==E||e[53]!==I?(P=s.jsxs("div",{className:k,children:[E,I]}),e[51]=k,e[52]=E,e[53]=I,e[54]=P):P=e[54],P}function Oi(t){const e=y.c(3),{virtualMcpId:n,isToolCallRuns:r}=t;if(r){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(De,{icon:null,name:"⚙",size:"2xs"}),e[0]=i):i=e[0],i}let o;return e[1]!==n?(o=s.jsx(Ei,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function Ei(t){const e=y.c(4),{virtualMcpId:n}=t,r=Ve(n);if(!r){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(De,{icon:null,name:"?",size:"2xs"}),e[0]=l):l=e[0],l}const o=r.icon??null;let i;return e[1]!==r.title||e[2]!==o?(i=s.jsx(De,{icon:o,name:r.title,size:"2xs"}),e[1]=r.title,e[2]=o,e[3]=i):i=e[3],i}function Pi(t){const e=y.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(Ri,{virtualMcpId:n}),e[1]=n,e[2]=o):o=e[2],o}function Ri(t){const e=y.c(2),{virtualMcpId:n}=t,o=Ve(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 Di(t){const e=y.c(9),{virtualMcpId:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,onNewTaskInGroup:a,showMore:c}=t,{isFetching:u,loadMore:d}=c;let f;return e[0]!==o||e[1]!==u||e[2]!==d||e[3]!==l||e[4]!==a||e[5]!==i||e[6]!==r||e[7]!==n?(f=s.jsx(s.Fragment,{children:r.length===0?s.jsxs("button",{type:"button",onClick:()=>a(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(ze,{size:14}),s.jsx("span",{children:"New thread"})]}):s.jsxs(s.Fragment,{children:[r.map(m=>s.jsx(ut,{task:m,isActive:o===m.id,onClick:()=>i(m),onArchive:()=>l(m),showAutomationBadge:!!m.trigger_id},m.id)),s.jsx(Ts,{onClick:()=>{d()},isFetching:u})]})}),e[0]=o,e[1]=u,e[2]=d,e[3]=l,e[4]=a,e[5]=i,e[6]=r,e[7]=n,e[8]=f):f=e[8],f}function Fi(t){const e=y.c(17),{threads:n,activeTaskId:r,onSelectTask:o,onArchiveTask:i,showMore:l}=t,{isFetching:a,loadMore:c}=l;let u;if(e[0]!==r||e[1]!==i||e[2]!==o||e[3]!==n){let h;e[5]!==r||e[6]!==i||e[7]!==o?(h=x=>s.jsx(ut,{task:x,isActive:r===x.id,onClick:()=>o(x),onArchive:()=>i(x),showAutomationBadge:!!x.trigger_id,showAgentIcon:!0,hideStatusIdle:!0},x.id),e[5]=r,e[6]=i,e[7]=o,e[8]=h):h=e[8],u=n.map(h),e[0]=r,e[1]=i,e[2]=o,e[3]=n,e[4]=u}else u=e[4];let d;e[9]!==c?(d=()=>{c()},e[9]=c,e[10]=d):d=e[10];let f;e[11]!==a||e[12]!==d?(f=s.jsx(Ts,{onClick:d,isFetching:a}),e[11]=a,e[12]=d,e[13]=f):f=e[13];let m;return e[14]!==u||e[15]!==f?(m=s.jsxs(s.Fragment,{children:[u,f]}),e[14]=u,e[15]=f,e[16]=m):m=e[16],m}function Gi(t){const e=y.c(36),{status:n,threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,filters:a}=t,c=Er[n],u=c.icon,[d,f]=Ms(`status-${n}`,!1),m=zs("status",n,a);let h;e[0]!==d||e[1]!==f||e[2]!==m||e[3]!==r.length?(h=function(){const T=!d;f(T),T&&r.length===0&&m.hasMore&&!m.isFetching&&m.loadMore()},e[0]=d,e[1]=f,e[2]=m,e[3]=r.length,e[4]=h):h=e[4];const x=h;let p;e[5]!==x?(p=C=>{C.target===C.currentTarget&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),x())},e[5]=x,e[6]=p):p=e[6];let g;e[7]!==u||e[8]!==c.iconClassName?(g=s.jsx("span",{className:"absolute inset-0 flex items-center justify-center transition-opacity group-hover/group:opacity-0",children:s.jsx(u,{size:12,className:c.iconClassName})}),e[7]=u,e[8]=c.iconClassName,e[9]=g):g=e[9];let b;e[10]!==d?(b=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:d?s.jsx(as,{size:14}):s.jsx(bt,{size:14})}),e[10]=d,e[11]=b):b=e[11];let j;e[12]!==g||e[13]!==b?(j=s.jsxs("div",{className:"relative size-5 shrink-0 flex items-center justify-center",children:[g,b]}),e[12]=g,e[13]=b,e[14]=j):j=e[14];let v;e[15]!==c.label?(v=s.jsx("span",{className:"flex-1 truncate",children:c.label}),e[15]=c.label,e[16]=v):v=e[16];let _;e[17]!==r.length?(_=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[17]=r.length,e[18]=_):_=e[18];let S;e[19]!==d||e[20]!==x||e[21]!==p||e[22]!==j||e[23]!==v||e[24]!==_?(S=s.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":d,onClick:x,onKeyDown:p,className:"group/group flex items-center gap-2 px-2 py-1.5 rounded-md text-sm font-medium text-foreground cursor-pointer hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 transition-colors",children:[j,v,_]}),e[19]=d,e[20]=x,e[21]=p,e[22]=j,e[23]=v,e[24]=_,e[25]=S):S=e[25];let N;e[26]!==o||e[27]!==d||e[28]!==l||e[29]!==i||e[30]!==m||e[31]!==r?(N=d&&s.jsx("div",{className:"flex flex-col gap-0.5 pb-1 pl-4",children:s.jsx(Fi,{threads:r,activeTaskId:o,onSelectTask:i,onArchiveTask:l,showMore:m})}),e[26]=o,e[27]=d,e[28]=l,e[29]=i,e[30]=m,e[31]=r,e[32]=N):N=e[32];let w;return e[33]!==S||e[34]!==N?(w=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[S,N]}),e[33]=S,e[34]=N,e[35]=w):w=e[35],w}const Os={all:"All tasks",manual:"Chats",automation:"Automation"},Es={all:"All members",mine:"Mine only"},Et={agent:"Agent",status:"Status"};function Ps(){const t=y.c(73),{data:e}=Re.useSession(),n=e?.user?.id,{org:r}=Ae(),o=An(r.id).id,{threads:i}=Zt(),l=Jt(),a=Po(i,{hidden:!1}),{hide:c}=Vt(),{setTaskId:u,createNewTask:d}=es(),f=Fe();let m;t[0]===Symbol.for("react.memo_cache_sentinel")?(m={strict:!1},t[0]=m):m=t[0];const h=Bt(m),x=h.taskId??null,p=[...a].sort(Ki),[g,b]=$.useState("all"),[j,v]=$.useState("mine"),[_,S]=$.useState("agent"),[N,w]=$.useState(!1),[C,T]=$.useState(!1),{state:M}=Ye(),A=Xo(r.id,Wo(p,l,o),o);let k;t[1]!==n||t[2]!==j?(k=O=>j==="mine"&&n?O.filter(K=>K.created_by===n):O,t[1]=n,t[2]=j,t[3]=k):k=t[3];const E=k;let I;t[4]!==g?(I=O=>g==="automation"?O.filter(Hi):g==="manual"?O.filter(Li):O,t[4]=g,t[5]=I):I=t[5];const P=I,z=O=>{const K=O.id===x;if(c(O.id),!K)return;const Me=p.find(Le=>Le.id!==O.id);Me?u(Me.id,Me.virtual_mcp_id):h.org&&f({to:"/$org",params:{org:h.org}})};let R;t[6]!==d?(R=O=>{J("sidebar_group_new_clicked",{virtual_mcp_id:O}),d(O)},t[6]=d,t[7]=R):R=t[7];const L=R,B=Mn();let G;t[8]!==B?(G=O=>{J("sidebar_group_settings_clicked",{virtual_mcp_id:O}),B(O,{search:{main:"instructions"}})},t[8]=B,t[9]=G):G=t[9];const H=G,D=O=>{J("sidebar_group_hide_clicked",{virtual_mcp_id:O});const K=A.find(Me=>Me.virtualMcpId===O);if(K)for(const Me of K.threads)c(Me.id)},Y=g!=="all"||j!=="mine",be=M==="collapsed",q=n??null;let X;t[10]!==j||t[11]!==q||t[12]!==g?(X={type:g,member:j,currentUserId:q},t[10]=j,t[11]=q,t[12]=g,t[13]=X):X=t[13];const V=X;if(be)return s.jsx("div",{className:"flex flex-col min-h-0 gap-1.5 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:A.map(O=>{const K=P(E(O.threads));return Y&&K.length===0?null:s.jsx(Ho,{virtualMcpId:O.virtualMcpId,threads:K,activeTaskId:x,onSelectTask:Le=>u(Le.id,Le.virtual_mcp_id),onArchiveTask:z,onNewTaskInGroup:L},O.virtualMcpId)})});const Q="flex flex-col h-full min-h-0";let F;t[14]!==w?(F=()=>{J("tasks_panel_search_opened"),T(!0),w(!0)},t[14]=w,t[15]=F):F=t[15];let U;t[16]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(yn,{size:16}),t[16]=U):U=t[16];let Z;t[17]!==F?(Z=s.jsx(Oe,{"aria-label":"Search threads",onClick:F,children:U}),t[17]=F,t[18]=Z):Z=t[18];const te=Et[_==="agent"?"status":"agent"];let se;t[19]!==te?(se=te.toLowerCase(),t[19]=te,t[20]=se):se=t[20];const ne=`Group by ${se}`,oe=Et[_];let re;t[21]!==oe?(re=oe.toLowerCase(),t[21]=oe,t[22]=re):re=t[22];const ee=`Grouped by ${re}`;let le,ve;t[23]!==_?(le=()=>{const O=_==="agent"?"status":"agent";J("tasks_panel_group_by_changed",{to_value:O}),S(O)},ve=_==="agent"?s.jsx(vr,{size:16}):s.jsx(Sn,{size:16}),t[23]=_,t[24]=le,t[25]=ve):(le=t[24],ve=t[25]);let ae;t[26]!==ne||t[27]!==ee||t[28]!==le||t[29]!==ve?(ae=s.jsx(Oe,{"aria-label":ne,title:ee,onClick:le,children:ve}),t[26]=ne,t[27]=ee,t[28]=le,t[29]=ve,t[30]=ae):ae=t[30];let _e;t[31]===Symbol.for("react.memo_cache_sentinel")?(_e=s.jsx(jr,{size:16}),t[31]=_e):_e=t[31];let ce;t[32]!==Y?(ce=s.jsx(Qe,{asChild:!0,children:s.jsx(Oe,{"aria-label":"Filter tasks",active:Y,children:_e})}),t[32]=Y,t[33]=ce):ce=t[33];let de;t[34]!==j?(de=O=>{const K=O;K!==j&&J("tasks_panel_member_filter_changed",{to_value:K}),v(K)},t[34]=j,t[35]=de):de=t[35];let ye;t[36]===Symbol.for("react.memo_cache_sentinel")?(ye=s.jsx(wt,{size:"sm",className:"w-full",children:s.jsx(kt,{})}),t[36]=ye):ye=t[36];let Se;t[37]===Symbol.for("react.memo_cache_sentinel")?(Se=Object.keys(Es),t[37]=Se):Se=t[37];let Ne;t[38]===Symbol.for("react.memo_cache_sentinel")?(Ne=s.jsx(Ct,{children:Se.map(Ui)}),t[38]=Ne):Ne=t[38];let ue;t[39]!==j||t[40]!==de?(ue=s.jsx(Pt,{label:"Members",children:s.jsxs(It,{value:j,onValueChange:de,children:[ye,Ne]})}),t[39]=j,t[40]=de,t[41]=ue):ue=t[41];let me;t[42]!==g?(me=O=>{const K=O;K!==g&&J("tasks_panel_filter_changed",{to_value:K}),b(K)},t[42]=g,t[43]=me):me=t[43];let Ge;t[44]===Symbol.for("react.memo_cache_sentinel")?(Ge=s.jsx(wt,{size:"sm",className:"w-full",children:s.jsx(kt,{})}),t[44]=Ge):Ge=t[44];let Ce;t[45]===Symbol.for("react.memo_cache_sentinel")?(Ce=Object.keys(Os),t[45]=Ce):Ce=t[45];let Be;t[46]===Symbol.for("react.memo_cache_sentinel")?(Be=s.jsx(Ct,{children:Ce.map(Bi)}),t[46]=Be):Be=t[46];let fe;t[47]!==me||t[48]!==g?(fe=s.jsx(Pt,{label:"Type",children:s.jsxs(It,{value:g,onValueChange:me,children:[Ge,Be]})}),t[47]=me,t[48]=g,t[49]=fe):fe=t[49];let xe;t[50]!==ue||t[51]!==fe?(xe=s.jsx(at,{align:"start",sideOffset:8,collisionPadding:16,className:"w-72 p-3",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[ue,fe]})}),t[50]=ue,t[51]=fe,t[52]=xe):xe=t[52];let he;t[53]!==ce||t[54]!==xe?(he=s.jsxs(lt,{children:[ce,xe]}),t[53]=ce,t[54]=xe,t[55]=he):he=t[55];let we;t[56]!==Z||t[57]!==ae||t[58]!==he?(we=s.jsxs("div",{className:"flex items-center gap-0.5",children:[Z,ae,he]}),t[56]=Z,t[57]=ae,t[58]=he,t[59]=we):we=t[59];let ke;t[60]===Symbol.for("react.memo_cache_sentinel")?(ke=s.jsx(cs,{compact:!0}),t[60]=ke):ke=t[60];let pe;t[61]!==we?(pe=s.jsxs("div",{className:"shrink-0 px-1 h-10 md:h-7 mb-2 flex items-center justify-between",children:[we,ke]}),t[61]=we,t[62]=pe):pe=t[62];const qe="flex-1 min-h-0 overflow-y-auto overscroll-contain flex flex-col gap-0.5 -mr-2 pr-2",ge=_==="status"?s.jsx(s.Fragment,{children:Ko(P(E(p))).map(O=>s.jsx(Gi,{status:O.status,threads:O.threads,activeTaskId:x,onSelectTask:K=>u(K.id,K.virtual_mcp_id),onArchiveTask:z,filters:V},O.status))}):s.jsx(s.Fragment,{children:A.map(O=>{const K=P(E(O.threads)),Me=Y&&K.length===0;return s.jsx(zi,{virtualMcpId:O.virtualMcpId,threads:K,activeTaskId:x,onSelectTask:Le=>u(Le.id,Le.virtual_mcp_id),onArchiveTask:z,onNewTaskInGroup:L,onShowSettings:H,onHideGroup:D,dimmed:Me,filters:V},O.virtualMcpId)})});let Ie;t[63]!==ge?(Ie=s.jsx("div",{className:qe,children:ge}),t[63]=ge,t[64]=Ie):Ie=t[64];let $e;t[65]!==C||t[66]!==N||t[67]!==w?($e=C&&s.jsx(Fo,{open:N,onOpenChange:w}),t[65]=C,t[66]=N,t[67]=w,t[68]=$e):$e=t[68];let Xe;return t[69]!==pe||t[70]!==Ie||t[71]!==$e?(Xe=s.jsxs("div",{className:Q,children:[pe,Ie,$e]}),t[69]=pe,t[70]=Ie,t[71]=$e,t[72]=Xe):Xe=t[72],Xe}function Bi(t){return s.jsx(is,{value:t,children:Os[t]},t)}function Ui(t){return s.jsx(is,{value:t,children:Es[t]},t)}function Li(t){return!t.trigger_id}function Hi(t){return!!t.trigger_id}function Ki(t,e){return(e.updated_at??"").localeCompare(t.updated_at??"")}function Pt(t){const e=y.c(7),{label:n,children:r}=t;let o;e[0]!==n?(o=s.jsx("span",{className:"text-sm text-muted-foreground",children:n}),e[0]=n,e[1]=o):o=e[1];let i;e[2]!==r?(i=s.jsx("div",{className:"w-36 shrink-0",children:r}),e[2]=r,e[3]=i):i=e[3];let l;return e[4]!==o||e[5]!==i?(l=s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o,i]}),e[4]=o,e[5]=i,e[6]=l):l=e[6],l}const Wi=5,Yi=[{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 Rs(){const t=y.c(3),{state:e}=Ye();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:Wi}).map(Qi)}),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(Te,{className:"size-6 rounded-md"}),s.jsx(Te,{className:"size-6 rounded-md"}),s.jsx(Te,{className:"size-6 rounded-md"})]}),s.jsx(Te,{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:Yi.map(qi)})]}),t[2]=r):r=t[2],r}function qi(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(Te,{className:"size-5 rounded-full shrink-0"}),s.jsx(Te,{className:W("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(Xi)})]},e)}function Xi(t,e){return s.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5",children:s.jsx(Te,{className:"h-3 flex-1 rounded-sm"})},e)}function Qi(t,e){return s.jsx(Te,{className:"size-10 rounded-lg mx-auto"},e)}function ql(){const t=y.c(4),e=ds();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Oo,{}),t[0]=n):n=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Lt,{children:s.jsxs($.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(rt,{className:"mb-2"}),s.jsx(Rs,{})]}),children:[s.jsx(rt,{className:"mb-2"}),s.jsx(Ps,{})]})}),t[1]=r):r=t[1];let o;return t[2]!==e?(o=s.jsx(fs,{sections:e,footer:n,additionalContent:r}),t[2]=e,t[3]=o):o=t[3],o}function Xl(t){const e=y.c(5),{onClose:n}=t,r=ds();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Eo,{}),e[0]=o):o=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Lt,{children:s.jsxs($.Suspense,{fallback:s.jsxs(s.Fragment,{children:[s.jsx(rt,{className:"mb-2"}),s.jsx(Rs,{})]}),children:[s.jsx(rt,{className:"mb-2"}),s.jsx(Ps,{})]})}),e[1]=i):i=e[1];let l;return e[2]!==n||e[3]!==r?(l=s.jsx(Zr,{sections:r,onClose:n,footer:o,additionalContent:i}),e[2]=n,e[3]=r,e[4]=l):l=e[4],l}export{ql as S,Xl as a,rt as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{q as W,r as O,j as r,o as z,e as A,c as L,E as se,b as re}from"./index-C_m1_Qyy.js";import{u as Q}from"./tooltip-BeTs1OMg.js";import{u as Y,g as oe}from"./constants-piR0edM1.js";import{u as le}from"./use-virtual-mcp-DXij_fSZ.js";import{u as ie,C as F}from"./index-BHpJxImt.js";import{b as ne,c as ae,h as ce}from"./chat-context-DxSqonhB.js";import{N as me}from"./agent-icons-BMYEM-93.js";import{u as de}from"./use-ai-providers-CgowGcDz.js";import{u as fe}from"./connect-desktop-dialog-v3Y8dgGN.js";import{M as pe}from"./types-BZ3eurxp.js";import{A as K}from"./agent-icon-C3wnlI99.js";import{P as ue,j as ge,s as xe,k as he,u as be}from"./pair-DgOi01tx.js";import{g as Ne}from"./use-mcp-prompts-Cxw_xwII.js";import{u as je,w as ve}from"./hooks-Buro5ByR.js";import{u as we}from"./shell-layout-BZaILYv9.js";import"./use-collections-D_7JW6dX.js";import"./spinner-DLBC6d93.js";import"./dialog-Bg6eRMC4.js";import"./X-CexC7CUQ.js";import"./drawer-q5yKuLmY.js";import"./collection-search-CZPmAdbz.js";import"./SearchMd-WZzMz_xm.js";import"./ChevronDown-2DdfyPVo.js";import"./SwitchHorizontal01-B39nOlBz.js";import"./ZapSquare-rxLTzaCI.js";import"./Check-BIvjG7jh.js";import"./Star01-TIrOjEGQ.js";import"./Tool01-CAdd6NGF.js";import"./Lock01-DzYUukb5.js";import"./Upload01-CfhmyOeM.js";import"./AlertCircle-CVwjiL5t.js";import"./form-B-pClhzT.js";import"./label-jUTi8Oc4.js";import"./select-DAV_VIox.js";import"./ChevronUp-CYign-Xr.js";import"./RefreshCcw01-CYXiv82D.js";import"./XCircle-D5rCjCCo.js";import"./tabs-DKgnbdu4.js";import"./toggle-group-D_tMezdr.js";import"./input-DHJ18fY7.js";import"./popover-COqcQ0Rg.js";import"./index-zGvFjFjO.js";import"./index-B55MEl-c.js";import"./dropdown-menu-TulqWZOe.js";import"./ChevronRight-Djwmm7yx.js";import"./DotsVertical-6XBT76_0.js";import"./Plus-Cq_1PqM9.js";import"./question-004-sINsf4GQ.js";import"./add-connection-dialog-CJWirXjW.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BY9Z3I7R.js";import"./use-registry-connections-CRI9AlTc.js";import"./use-connection-BbCw9KPq.js";import"./use-organization-settings-BfJ6uqm2.js";import"./useInfiniteQuery-D0JT5WrD.js";import"./infiniteQueryObserver-CUomJPae.js";import"./extract-connection-data-BYGRbWJu.js";import"./generate-id-DfUEx9en.js";import"./collections-CuEt9akO.js";import"./card-CqaEJI_U.js";import"./integration-icon-Bo72bKVV.js";import"./Container-BYMVUIOR.js";import"./collection-tabs-BME6pm9f.js";import"./badge-Dci-e_Pw.js";import"./textarea-C035ZOMR.js";import"./XClose-BOJwjK3-.js";import"./connection-form-helpers-M4qUZwhZ.js";import"./Trash01-CHrTm5S-.js";import"./use-infinite-scroll-XJXa4_f9.js";import"./useSuspenseInfiniteQuery-D794zrC9.js";import"./checkbox-DdM7zWwz.js";import"./skeleton-tYEs8dsN.js";import"./Key01-CTY2QvpD.js";import"./Settings02-BGX5GQSJ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-nKIM1K_1.js";import"./avatar-ByQQ7GEH.js";import"./User01-CnVuEZ_q.js";import"./settings-section-DLBjUAhp.js";import"./ArrowUpRight-BsdiWOZ_.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./Stars02-BgabhO3x.js";import"./ArrowNarrowLeft-C0lNfAd-.js";import"./Users03-COREII3z.js";import"./CheckCircle-naAuY0Am.js";import"./FilterLines-xU-m-2To.js";import"./Palette-B6NpJZ9F.js";import"./HardDrive-CPUYFXaj.js";import"./LayoutLeft-BA4wxcAF.js";import"./LinkExternal01-Dn8eWUjC.js";import"./Sun-BMF5NYnu.js";import"./Play-qd-MZyD5.js";import"./Shield01-Dd3PCkCh.js";import"./Users01-CARILaym.js";import"./Zap-DRsZpKeC.js";import"./use-copy-DbsD5qK3.js";import"./format-time-GeUngI9C.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./content-blocks-o63cs2vh.js";import"./decopilot-sse-pool-DWRmePhE.js";import"./create-sse-subscription-CjI9SUTI.js";import"./required-auth-layout-CJnuX5pr.js";import"./useRouterState-DNwJdpeR.js";import"./use-org-sso-Baws_Cb6.js";function ee({agentId:t}){const{org:e,locator:s}=W(),l=Y({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:o}=je(),{setTaskId:u}=we(),[i,c]=O.useState(null),[p,d]=O.useState(!1),f=O.useRef(!1),n=async(a,j)=>{if(!l){z.error("MCP client not available");return}if(!f.current){f.current=!0,d(!0);try{const m=await Ne(l,a.name,j),b={type:"doc",content:[{type:"paragraph",content:[ge({id:a.name,name:xe(a.name,he(a._meta)),metadata:m.messages,char:"/",kind:"prompt",args:j}),{type:"text",text:" "}]}]},I=crypto.randomUUID();ve(sessionStorage,s,I,{tiptapDoc:b}),await o({id:I,virtual_mcp_id:t}),u(I,t,{autosend:!0})}catch(m){console.error("[start-thread-from-prompt] failed",m),z.error("Failed to start thread. Please try again.")}finally{f.current=!1,d(!1)}}},h=async a=>{if(!f.current){if(a.arguments&&a.arguments.length>0){c(a);return}await n(a)}},x=async a=>{if(!i)return;const j=i;c(null),await n(j,a)};return{start:h,startBlank:async()=>{if(!f.current){f.current=!0,d(!0);try{const a=crypto.randomUUID();await o({id:a,virtual_mcp_id:t}),u(a,t)}catch(a){console.error("[start-thread-from-prompt] startBlank failed",a),z.error("Failed to start thread. Please try again.")}finally{f.current=!1,d(!1)}}},dialog:r.jsx(ue,{prompt:i,setPrompt:a=>c(a),onSubmit:x}),dialogPrompt:i,starting:p}}function te(t){const e=A.c(17),{entry:s,onClick:l,hideAgent:o,disabled:u}=t,i=o===void 0?!1:o,c=u===void 0?!1:u;let p;e[0]!==s.agentIcon||e[1]!==s.agentName||e[2]!==i?(p=!i&&r.jsx(K,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[0]=s.agentIcon,e[1]=s.agentName,e[2]=i,e[3]=p):p=e[3];let d;e[4]!==s.agentName||e[5]!==i?(d=!i&&r.jsx("div",{className:"w-full truncate text-xs text-muted-foreground",children:s.agentName}),e[4]=s.agentName,e[5]=i,e[6]=d):d=e[6];let f;e[7]!==s.title?(f=r.jsx("div",{className:"line-clamp-2 w-full text-sm font-medium text-foreground",children:s.title}),e[7]=s.title,e[8]=f):f=e[8];let n;e[9]!==d||e[10]!==f?(n=r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[d,f]}),e[9]=d,e[10]=f,e[11]=n):n=e[11];let h;return e[12]!==c||e[13]!==l||e[14]!==p||e[15]!==n?(h=r.jsxs("button",{type:"button",onClick:l,disabled:c,"aria-busy":c,className:"group/row flex w-72 shrink-0 items-center gap-3 rounded-xl border border-border bg-background px-3 py-2.5 text-left outline-none transition-colors hover:border-border hover:bg-accent/40 focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:[p,n]}),e[12]=c,e[13]=l,e[14]=p,e[15]=n,e[16]=h):h=e[16],h}function ye(t){const e=A.c(15),{agentId:s,entries:l}=t;let o;e[0]!==s?(o={agentId:s},e[0]=s,e[1]=o):o=e[1];const{start:u,startBlank:i,dialog:c,starting:p}=ee(o);let d;e[2]!==u||e[3]!==i?(d=x=>{if(!x.promptName){i();return}const g={name:x.promptName,title:x.title,description:x.description,arguments:x.arguments,_meta:x._meta};u(g)},e[2]=u,e[3]=i,e[4]=d):d=e[4];const f=d;let n;if(e[5]!==l||e[6]!==f||e[7]!==p){let x;e[9]!==f||e[10]!==p?(x=g=>r.jsx(te,{entry:g,onClick:()=>f(g),disabled:p},g.promptName||`${g.agentId}:blank`),e[9]=f,e[10]=p,e[11]=x):x=e[11],n=l.map(x),e[5]=l,e[6]=f,e[7]=p,e[8]=n}else n=e[8];let h;return e[12]!==c||e[13]!==n?(h=r.jsxs(r.Fragment,{children:[n,c]}),e[12]=c,e[13]=n,e[14]=h):h=e[14],h}function Ie(t){const e=A.c(2),{entries:s}=t;let l;if(e[0]!==s){const o=new Map;for(const u of s){const i=o.get(u.agentId);i?i.push(u):o.set(u.agentId,[u])}l=r.jsx(r.Fragment,{children:Array.from(o.entries()).map(_e)}),e[0]=s,e[1]=l}else l=e[1];return l}function _e(t){const[e,s]=t;return r.jsx(ye,{agentId:e,entries:s},e)}function ke(t){const e=A.c(55),{tile:s,prompts:l}=t,{org:o}=W();let u;e[0]!==o.id||e[1]!==o.slug||e[2]!==s.connectionId?(u={connectionId:s.connectionId,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=s.connectionId,e[3]=u):u=e[3];const i=Y(u);let c;e[4]!==s.agentId?(c={agentId:s.agentId},e[4]=s.agentId,e[5]=c):c=e[5];const{start:p,startBlank:d,dialog:f,starting:n}=ee(c);let h;e[6]!==p||e[7]!==d?(h=w=>{if(!w.promptName){d();return}p({name:w.promptName,title:w.title,description:w.description,arguments:w.arguments,_meta:w._meta})},e[6]=p,e[7]=d,e[8]=h):h=e[8];const x=h;let g,N,a,j,m;if(e[9]!==i||e[10]!==x||e[11]!==o.id||e[12]!==l||e[13]!==d||e[14]!==n||e[15]!==s.agentIcon||e[16]!==s.agentName||e[17]!==s.maxHeight||e[18]!==s.minHeight||e[19]!==s.resourceUri){const w=l.filter(Ce);j="flex w-full grow basis-80 flex-col gap-3 rounded-xl border border-border bg-background p-3";let _;e[25]!==d?(_=()=>{d()},e[25]=d,e[26]=_):_=e[26];let v;e[27]!==s.agentIcon||e[28]!==s.agentName?(v=r.jsx(K,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[27]=s.agentIcon,e[28]=s.agentName,e[29]=v):v=e[29];let k;e[30]!==s.agentName?(k=r.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[30]=s.agentName,e[31]=k):k=e[31];let C;e[32]===Symbol.for("react.memo_cache_sentinel")?(C=r.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Open chat"}),e[32]=C):C=e[32];let y;e[33]!==k?(y=r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[k,C]}),e[33]=k,e[34]=y):y=e[34],e[35]!==n||e[36]!==v||e[37]!==y||e[38]!==_?(m=r.jsxs("button",{type:"button",onClick:_,disabled:n,"aria-busy":n,className:"flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:[v,y]}),e[35]=n,e[36]=v,e[37]=y,e[38]=_,e[39]=m):m=e[39],g="flex min-h-[420px] flex-col gap-3 lg:flex-row lg:items-stretch";const S=s.minHeight??420,M=s.maxHeight??800;e[40]!==i||e[41]!==o.id||e[42]!==S||e[43]!==M||e[44]!==s.resourceUri?(N=r.jsx("div",{className:"flex-1 overflow-hidden rounded-lg border border-border",children:r.jsx(pe,{resourceURI:s.resourceUri,orgId:o.id,client:i,displayMode:"fullscreen",minHeight:S,maxHeight:M,className:"h-full"})}),e[40]=i,e[41]=o.id,e[42]=S,e[43]=M,e[44]=s.resourceUri,e[45]=N):N=e[45],a=w.length>0&&r.jsx("div",{className:"flex flex-wrap gap-3 lg:w-72 lg:shrink-0 lg:flex-col lg:flex-nowrap",children:w.map(P=>r.jsx(te,{entry:P,onClick:()=>x(P),hideAgent:!0,disabled:n},P.promptName))}),e[9]=i,e[10]=x,e[11]=o.id,e[12]=l,e[13]=d,e[14]=n,e[15]=s.agentIcon,e[16]=s.agentName,e[17]=s.maxHeight,e[18]=s.minHeight,e[19]=s.resourceUri,e[20]=g,e[21]=N,e[22]=a,e[23]=j,e[24]=m}else g=e[20],N=e[21],a=e[22],j=e[23],m=e[24];let b;e[46]!==g||e[47]!==N||e[48]!==a?(b=r.jsxs("div",{className:g,children:[N,a]}),e[46]=g,e[47]=N,e[48]=a,e[49]=b):b=e[49];let I;return e[50]!==f||e[51]!==j||e[52]!==m||e[53]!==b?(I=r.jsxs("div",{className:j,children:[m,b,f]}),e[50]=f,e[51]=j,e[52]=m,e[53]=b,e[54]=I):I=e[54],I}function Ce(t){return!!t.promptName}function V(t){const e=A.c(11),{tile:s}=t;let l;e[0]!==s.agentIcon||e[1]!==s.agentName?(l=r.jsx(K,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[0]=s.agentIcon,e[1]=s.agentName,e[2]=l):l=e[2];let o;e[3]!==s.agentName?(o=r.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[3]=s.agentName,e[4]=o):o=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=r.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Tile unavailable"}),e[5]=u):u=e[5];let i;e[6]!==o?(i=r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[o,u]}),e[6]=o,e[7]=i):i=e[7];let c;return e[8]!==l||e[9]!==i?(c=r.jsx("div",{className:"flex w-full grow basis-80 flex-col gap-3 rounded-xl border border-border bg-background p-3 opacity-60",children:r.jsxs("div",{className:"flex items-center gap-3",children:[l,i]})}),e[8]=l,e[9]=i,e[10]=c):c=e[10],c}function G(){const t=A.c(24),{org:e}=W(),{isLoading:s,prompts:l,tiles:o}=be(e.slug);if(!s&&l.length===0&&o.length===0)return null;let i;t[0]!==o?(i=new Set(o.map(Pe)),t[0]=o,t[1]=i):i=t[1];const c=i;let p;if(t[2]!==l){p=new Map;for(const m of l){const b=p.get(m.agentId);b?b.push(m):p.set(m.agentId,[m])}t[2]=l,t[3]=p}else p=t[3];let d;if(t[4]!==l||t[5]!==c){let m;t[7]!==c?(m=b=>!c.has(b.agentId),t[7]=c,t[8]=m):m=t[8],d=l.filter(m),t[4]=l,t[5]=c,t[6]=d}else d=t[6];const f=d,n=o.length>0,h=s||f.length>0,x=n?"flex-col lg:flex-row lg:items-start":"flex-col";let g;t[9]!==x?(g=L("mt-4 flex w-full max-w-7xl gap-3",x),t[9]=x,t[10]=g):g=t[10];let N;t[11]!==n||t[12]!==p||t[13]!==o?(N=n&&r.jsx("div",{className:"flex min-w-0 flex-col gap-3 lg:flex-1",children:o.map(m=>r.jsx(se,{fallback:r.jsx(V,{tile:m}),children:r.jsx(O.Suspense,{fallback:r.jsx(V,{tile:m}),children:r.jsx(ke,{tile:m,prompts:p.get(m.agentId)??[]})})},m.agentId))}),t[11]=n,t[12]=p,t[13]=o,t[14]=N):N=t[14];let a;t[15]!==n||t[16]!==s||t[17]!==f||t[18]!==h?(a=h&&r.jsx("div",{className:L("flex gap-3",n?"flex-col lg:w-72 lg:shrink-0":"flex-wrap"),children:s?Array.from({length:3},Se):r.jsx(Ie,{entries:f})}),t[15]=n,t[16]=s,t[17]=f,t[18]=h,t[19]=a):a=t[19];let j;return t[20]!==g||t[21]!==N||t[22]!==a?(j=r.jsxs("div",{className:g,children:[N,a]}),t[20]=g,t[21]=N,t[22]=a,t[23]=j):j=t[23],j}function Se(t,e){return r.jsxs("div",{className:"flex w-72 shrink-0 flex-col gap-1.5 rounded-xl border border-border bg-background px-3 py-2.5",children:[r.jsx("div",{className:"h-3 w-2/3 animate-pulse rounded bg-muted"}),r.jsx("div",{className:"h-2.5 w-full animate-pulse rounded bg-muted/70"})]},`skeleton-${e}`)}function Pe(t){return t.agentId}const X=420,q=305;function Z(){const t=A.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:X}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:X}}),t[1]=s):s=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:q}}),t[2]=l):l=t[2];let o;return t[3]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,l,r.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:q}})]}),t[3]=o):o=t[3],o}function J(){const t=A.c(34),{data:e}=re.useSession(),{org:s}=W(),l=Q(),o=de(),u=fe(),{selectedVirtualMcp:i}=ne();let c;t[0]!==s.id?(c=oe(s.id),t[0]=s.id,t[1]=c):c=t[1];const f=le((i??c).id),{hasDecoKey:n,isZeroBalance:h,isInitialFreeCredit:x,balanceDollars:g,hasOnlyDecoProvider:N}=ie(),a=ae(f?.metadata);if(o.length===0&&!(a&&ce(u))){let H;return t[2]===Symbol.for("react.memo_cache_sentinel")?(H=r.jsx("div",{className:"flex-1 overflow-y-auto",children:r.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:r.jsx(me,{})})}),t[2]=H):H=t[2],H}let m;t[3]!==e?.user?.name?(m=e?.user?.name?.split(" ")[0]||"there",t[3]=e?.user?.name,t[4]=m):m=t[4];const b=m,I=n&&x&&g!=null,w=n&&h&&N;let _;t[5]!==g||t[6]!==I||t[7]!==w?(_=I?r.jsx(F.CreditsEyebrow,{balanceDollars:g}):w?r.jsx(F.NoCreditsEyebrow,{}):null,t[5]=g,t[6]=I,t[7]=w,t[8]=_):_=t[8];const v=_;if(l){let H;t[9]===Symbol.for("react.memo_cache_sentinel")?(H=r.jsx(Z,{}),t[9]=H):H=t[9];let E;t[10]!==v?(E=v&&r.jsx("div",{className:"mb-4",children:v}),t[10]=v,t[11]=E):E=t[11];let T;t[12]!==b?(T=r.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",b,"?"]}),t[12]=b,t[13]=T):T=t[13];let D;t[14]!==E||t[15]!==T?(D=r.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[E,T]}),t[14]=E,t[15]=T,t[16]=D):D=t[16];let $;t[17]===Symbol.for("react.memo_cache_sentinel")?($=r.jsxs("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:[r.jsx(F.Input,{showConnectionsBanner:!0}),r.jsx(G,{})]}),t[17]=$):$=t[17];let R;return t[18]!==D?(R=r.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[H,D,$]}),t[18]=D,t[19]=R):R=t[19],R}let k;t[20]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Z,{}),t[20]=k):k=t[20];let C;t[21]!==v?(C=v&&r.jsx("div",{className:"mb-4",children:v}),t[21]=v,t[22]=C):C=t[22];let y;t[23]!==b?(y=r.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",b,"?"]}),t[23]=b,t[24]=y):y=t[24];let S;t[25]!==C||t[26]!==y?(S=r.jsxs("div",{className:"text-center mb-10",children:[C,y]}),t[25]=C,t[26]=y,t[27]=S):S=t[27];let M;t[28]===Symbol.for("react.memo_cache_sentinel")?(M=r.jsxs("div",{className:"relative w-full",children:[r.jsx(Ae,{}),r.jsx(F.Input,{showConnectionsBanner:!0})]}),t[28]=M):M=t[28];let P;t[29]!==S?(P=r.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[S,M]}),t[29]=S,t[30]=P):P=t[30];let B;t[31]===Symbol.for("react.memo_cache_sentinel")?(B=r.jsx(G,{}),t[31]=B):B=t[31];let U;return t[32]!==P?(U=r.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[k,r.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:r.jsxs("div",{className:"relative flex flex-col items-center px-10 pb-4 flex-1 justify-center",children:[P,B]})})]}),t[32]=P,t[33]=U):U=t[33],U}function Ae(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-10 right-6 z-20 h-12 w-auto select-none"}),t[0]=e):e=t[0],e}function Cs(){const t=A.c(2);if(Q()){let l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:r.jsx(J,{})}),t[0]=l):l=t[0],l}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:r.jsx("div",{className:"h-full p-0.5 pt-0.25",children:r.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:r.jsx(J,{})})})}),t[1]=s):s=t[1],s}export{Cs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as N,j as t,p as D,r as k,O as R,l as z}from"./index-C_m1_Qyy.js";import{u as E,S as I,a as L,b as M}from"./sidebar-BFp8v2I0.js";import{T as O,a as $,b as A,u as P}from"./tooltip-BeTs1OMg.js";import{S as W,a as B}from"./index-2vcb4P4k.js";import{C as X}from"./chat-context-DxSqonhB.js";import{T as H}from"./hooks-Buro5ByR.js";import{i as F}from"./Monitor01-nKIM1K_1.js";import{u as q,v as G,C as K}from"./connect-desktop-dialog-v3Y8dgGN.js";import{T as Y,a as b}from"./toolbar-AIIkxXjs.js";import{S as U,M as J}from"./shell-controls-CNwl3y79.js";import"./LayoutLeft-BA4wxcAF.js";import"./X-CexC7CUQ.js";import"./useRouterState-DNwJdpeR.js";import"./agent-icon-C3wnlI99.js";import"./AlertCircle-CVwjiL5t.js";import"./Tool01-CAdd6NGF.js";import"./Stars02-BgabhO3x.js";import"./SwitchHorizontal01-B39nOlBz.js";import"./RefreshCcw01-CYXiv82D.js";import"./ArrowNarrowLeft-C0lNfAd-.js";import"./XCircle-D5rCjCCo.js";import"./ArrowUpRight-BsdiWOZ_.js";import"./ZapSquare-rxLTzaCI.js";import"./Users03-COREII3z.js";import"./CheckCircle-naAuY0Am.js";import"./Check-BIvjG7jh.js";import"./ChevronDown-2DdfyPVo.js";import"./ChevronRight-Djwmm7yx.js";import"./ChevronUp-CYign-Xr.js";import"./DotsVertical-6XBT76_0.js";import"./Container-BYMVUIOR.js";import"./FilterLines-xU-m-2To.js";import"./Star01-TIrOjEGQ.js";import"./Palette-B6NpJZ9F.js";import"./HardDrive-CPUYFXaj.js";import"./Key01-CTY2QvpD.js";import"./LinkExternal01-Dn8eWUjC.js";import"./Lock01-DzYUukb5.js";import"./Sun-BMF5NYnu.js";import"./Play-qd-MZyD5.js";import"./Plus-Cq_1PqM9.js";import"./SearchMd-WZzMz_xm.js";import"./Settings02-BGX5GQSJ.js";import"./Shield01-Dd3PCkCh.js";import"./Trash01-CHrTm5S-.js";import"./Upload01-CfhmyOeM.js";import"./User01-CnVuEZ_q.js";import"./Users01-CARILaym.js";import"./XClose-BOJwjK3-.js";import"./Zap-DRsZpKeC.js";import"./skeleton-tYEs8dsN.js";import"./popover-COqcQ0Rg.js";import"./drawer-q5yKuLmY.js";import"./collection-search-DYkFJwme.js";import"./constants-piR0edM1.js";import"./use-virtual-mcp-DXij_fSZ.js";import"./use-collections-D_7JW6dX.js";import"./use-navigate-to-agent-CVbR4ICA.js";import"./use-create-virtual-mcp-DJVm-5Gn.js";import"./github-repo-picker-A9GOBLjA.js";import"./dialog-Bg6eRMC4.js";import"./collection-search-CZPmAdbz.js";import"./checkbox-DdM7zWwz.js";import"./use-connection-BbCw9KPq.js";import"./use-mcp-tools-Cg4H0QB3.js";import"./extract-connection-data-BYGRbWJu.js";import"./generate-id-DfUEx9en.js";import"./collections-CuEt9akO.js";import"./shell-layout-BZaILYv9.js";import"./avatar-ByQQ7GEH.js";import"./required-auth-layout-CJnuX5pr.js";import"./use-organization-settings-BfJ6uqm2.js";import"./use-org-sso-Baws_Cb6.js";import"./alert-dialog-DJnXid5j.js";import"./form-B-pClhzT.js";import"./label-jUTi8Oc4.js";import"./input-DHJ18fY7.js";import"./spinner-DLBC6d93.js";import"./index-Df1UV_SS.js";import"./add-connection-dialog-CJWirXjW.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BY9Z3I7R.js";import"./use-registry-connections-CRI9AlTc.js";import"./useInfiniteQuery-D0JT5WrD.js";import"./infiniteQueryObserver-CUomJPae.js";import"./card-CqaEJI_U.js";import"./integration-icon-Bo72bKVV.js";import"./collection-tabs-BME6pm9f.js";import"./badge-Dci-e_Pw.js";import"./select-DAV_VIox.js";import"./textarea-C035ZOMR.js";import"./connection-form-helpers-M4qUZwhZ.js";import"./use-infinite-scroll-XJXa4_f9.js";import"./useSuspenseInfiniteQuery-D794zrC9.js";import"./use-ai-providers-CgowGcDz.js";import"./command-DaAuDqUV.js";import"./index-B_5hPR5_.js";import"./hover-card-CUfoIFQV.js";import"./task-status-CqP04HQ9.js";import"./format-time-GeUngI9C.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./decopilot-sse-pool-DWRmePhE.js";import"./create-sse-subscription-CjI9SUTI.js";import"./unwrap-tool-result-BYXdCQMg.js";function Q(e){const o=N.c(5),{onPointerDown:r,onDoubleClick:d}=e,{state:f,isMobile:u}=E();if(u||f==="collapsed")return null;let s,n;o[0]===Symbol.for("react.memo_cache_sentinel")?(s={left:"var(--sidebar-width)"},n=t.jsx("span",{className:"pointer-events-none absolute inset-y-0 left-1/2 w-px -translate-x-1/2 bg-transparent transition-colors duration-150 group-hover/resize:bg-border group-active/resize:bg-border"}),o[0]=s,o[1]=n):(s=o[0],n=o[1]);let i;return o[2]!==d||o[3]!==r?(i=t.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar",title:"Drag to resize, double-click to reset",onPointerDown:r,onDoubleClick:d,className:"group/resize absolute top-0 z-20 h-full w-2 -translate-x-1/2 cursor-col-resize",style:s,children:n}),o[2]=d,o[3]=r,o[4]=i):i=o[4],i}const T=240,V=400,Z="sidebar.width";function _(e){return Math.max(T,Math.min(V,e))}function ee(){const e=N.c(11),[o,r]=D(Z,te),d=k.useRef(null);let f;e[0]!==r||e[1]!==o?(f=a=>{a.preventDefault();const m=a.clientX,c=_(o),p=d.current??(typeof document<"u"?document.querySelector('[data-slot="sidebar-wrapper"]'):null),x=p?Array.from(p.querySelectorAll('[data-slot="sidebar"], [data-slot="sidebar-container"]')):[];for(const h of x)h.style.transition="none";const j=h=>{const g=_(c+(h.clientX-m));p?.style.setProperty("--sidebar-width",`${g}px`)},S=h=>{const g=_(c+(h.clientX-m));r(g);for(const v of x)v.style.transition="";window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",S),document.body.style.userSelect="",document.body.style.cursor=""};document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("pointermove",j),window.addEventListener("pointerup",S)},e[0]=r,e[1]=o,e[2]=f):f=e[2];const u=f;let s;e[3]!==r?(s=()=>{r(T)},e[3]=r,e[4]=s):s=e[4];const n=s;let i;e[5]!==o?(i=_(o),e[5]=o,e[6]=i):i=e[6];let l;return e[7]!==u||e[8]!==n||e[9]!==i?(l={width:i,wrapperRef:d,onStartResize:u,resetWidth:n},e[7]=u,e[8]=n,e[9]=i,e[10]=l):l=e[10],l}function te(e){return typeof e=="number"?_(e):T}function oe(){const e=N.c(22),o=q(),[r,d]=k.useState(!1);let f;if(e[0]!==o.capabilities||e[1]!==o.hostname||e[2]!==o.machineId||e[3]!==o.online){const j=G(o.capabilities);f=o.online?t.jsxs("div",{className:"flex flex-col gap-0.5 text-xs",children:[t.jsx("span",{className:"font-medium",children:o.hostname??o.machineId??"Desktop linked"}),t.jsx("span",{className:"text-muted-foreground",children:j.length>0?`Available: ${j.join(", ")}`:"No CLI agents detected"})]}):t.jsx("span",{className:"text-xs",children:"Desktop disconnected"}),e[0]=o.capabilities,e[1]=o.hostname,e[2]=o.machineId,e[3]=o.online,e[4]=f}else f=e[4];const u=f;let s;e[5]===Symbol.for("react.memo_cache_sentinel")?(s=()=>d(!0),e[5]=s):s=e[5];const n=o.online?"Desktop linked":"Connect your desktop";let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(F,{size:16}),e[6]=i):i=e[6];let l;e[7]!==o.online?(l=o.online&&t.jsx("span",{className:"absolute top-1 right-1 size-2 rounded-full bg-success ring-2 ring-background animate-pulse"}),e[7]=o.online,e[8]=l):l=e[8];let a;e[9]!==n||e[10]!==l?(a=t.jsx(O,{asChild:!0,children:t.jsxs(Y,{onClick:s,"aria-label":n,children:[i,l]})}),e[9]=n,e[10]=l,e[11]=a):a=e[11];let m;e[12]!==u?(m=t.jsx($,{side:"bottom",children:u}),e[12]=u,e[13]=m):m=e[13];let c;e[14]!==a||e[15]!==m?(c=t.jsxs(A,{children:[a,m]}),e[14]=a,e[15]=m,e[16]=c):c=e[16];let p;e[17]!==r?(p=t.jsx(K,{open:r,onOpenChange:d}),e[17]=r,e[18]=p):p=e[18];let x;return e[19]!==c||e[20]!==p?(x=t.jsxs(t.Fragment,{children:[c,p]}),e[19]=c,e[20]=p,e[21]=x):x=e[21],x}const ie="sidebar.open";function re(){const e=N.c(1);let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:20,className:"animate-spin text-muted-foreground"})}),e[0]=o):o=e[0],o}function oo(){const e=N.c(26),o=P(),[r,d]=D(ie,!1),{width:f,wrapperRef:u,onStartResize:s,resetWidth:n}=ee();let i,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(b.Logo,{}),l=t.jsx(U,{}),e[0]=i,e[1]=l):(i=e[0],l=e[1]);let a,m;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs(b.LeftColumn,{children:[i,l,t.jsx("span",{className:"hidden md:contents",children:t.jsx(b.Nav,{})}),t.jsx(b.TogglesSlot,{}),t.jsx(oe,{})]}),m=t.jsx(b.CenterSlot,{}),e[2]=a,e[3]=m):(a=e[2],m=e[3]);let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsxs(b.Header,{children:[a,m,t.jsxs(b.RightColumn,{children:[t.jsx("div",{className:"min-w-0 flex-1 overflow-x-auto [scrollbar-width:none] flex justify-end",children:t.jsx(b.TabsSlot,{})}),t.jsx(b.RightSlot,{})]})]}),e[4]=c):c=e[4];const p=`${f}px`;let x;e[5]!==p?(x={"--sidebar-width":p,"--sidebar-width-icon":"3.5rem"},e[5]=p,e[6]=x):x=e[6];const j=x;let S;e[7]!==o||e[8]!==s||e[9]!==n?(S=!o&&t.jsxs(t.Fragment,{children:[t.jsx(W,{}),t.jsx(Q,{onPointerDown:s,onDoubleClick:n})]}),e[7]=o,e[8]=s,e[9]=n,e[10]=S):S=e[10];let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h={background:"transparent",containerType:"inline-size"},e[11]=h):h=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(I,{className:"flex flex-col",style:h,children:t.jsx("div",{className:"flex flex-col h-full min-h-0",children:t.jsx("div",{className:"flex-1 min-h-0 flex flex-row",children:t.jsx(k.Suspense,{fallback:t.jsx(re,{}),children:t.jsx(R,{})})})})}),e[12]=g):g=e[12];let v;e[13]!==j||e[14]!==S||e[15]!==u?(v=t.jsxs(L,{ref:u,className:"flex-1 bg-sidebar relative min-h-0",style:j,children:[S,g]}),e[13]=j,e[14]=S,e[15]=u,e[16]=v):v=e[16];let y;e[17]!==o?(y=o&&t.jsx(J,{renderSidebar:se}),e[17]=o,e[18]=y):y=e[18];let w;e[19]!==v||e[20]!==y?(w=t.jsx(X,{children:t.jsxs("div",{className:"app-shell-root flex flex-col h-dvh overflow-hidden",children:[c,v,y]})}),e[19]=v,e[20]=y,e[21]=w):w=e[21];let C;return e[22]!==d||e[23]!==r||e[24]!==w?(C=t.jsx(H,{children:t.jsx(b.Provider,{children:t.jsx(M,{open:r,onOpenChange:d,children:w})})}),e[22]=d,e[23]=r,e[24]=w,e[25]=C):C=e[25],C}function se(e){const{onClose:o}=e;return t.jsx("div",{className:"flex h-full",children:t.jsx("div",{className:"w-full bg-sidebar flex flex-col overflow-y-auto group/sidebar","data-state":"expanded",children:t.jsx(B,{onClose:o})})})}export{oo as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as H,q as $,j}from"./index-C_m1_Qyy.js";import{m as q,k as O,s as D}from"./pair-DgOi01tx.js";import{u as v}from"./constants-piR0edM1.js";import{a as L,c as k}from"./use-mcp-tools-Cg4H0QB3.js";import{c as B}from"./content-blocks-o63cs2vh.js";import{g as Y,M as G,b as E}from"./types-BZ3eurxp.js";import{u as V,b as z}from"./chat-context-DxSqonhB.js";import{u as F}from"./shell-layout-BZaILYv9.js";import"./agent-icon-C3wnlI99.js";import"./AlertCircle-CVwjiL5t.js";import"./Tool01-CAdd6NGF.js";import"./Stars02-BgabhO3x.js";import"./SwitchHorizontal01-B39nOlBz.js";import"./RefreshCcw01-CYXiv82D.js";import"./ArrowNarrowLeft-C0lNfAd-.js";import"./XCircle-D5rCjCCo.js";import"./ArrowUpRight-BsdiWOZ_.js";import"./ZapSquare-rxLTzaCI.js";import"./Users03-COREII3z.js";import"./CheckCircle-naAuY0Am.js";import"./Check-BIvjG7jh.js";import"./ChevronDown-2DdfyPVo.js";import"./ChevronRight-Djwmm7yx.js";import"./ChevronUp-CYign-Xr.js";import"./DotsVertical-6XBT76_0.js";import"./Container-BYMVUIOR.js";import"./FilterLines-xU-m-2To.js";import"./Star01-TIrOjEGQ.js";import"./Palette-B6NpJZ9F.js";import"./HardDrive-CPUYFXaj.js";import"./Key01-CTY2QvpD.js";import"./LayoutLeft-BA4wxcAF.js";import"./LinkExternal01-Dn8eWUjC.js";import"./Lock01-DzYUukb5.js";import"./Monitor01-nKIM1K_1.js";import"./Sun-BMF5NYnu.js";import"./Play-qd-MZyD5.js";import"./Plus-Cq_1PqM9.js";import"./SearchMd-WZzMz_xm.js";import"./Settings02-BGX5GQSJ.js";import"./Shield01-Dd3PCkCh.js";import"./Trash01-CHrTm5S-.js";import"./Upload01-CfhmyOeM.js";import"./User01-CnVuEZ_q.js";import"./Users01-CARILaym.js";import"./XClose-BOJwjK3-.js";import"./X-CexC7CUQ.js";import"./Zap-DRsZpKeC.js";import"./index-zGvFjFjO.js";import"./use-copy-DbsD5qK3.js";import"./tooltip-BeTs1OMg.js";import"./format-time-GeUngI9C.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./dialog-Bg6eRMC4.js";import"./hooks-Buro5ByR.js";import"./decopilot-sse-pool-DWRmePhE.js";import"./create-sse-subscription-CjI9SUTI.js";import"./integration-icon-Bo72bKVV.js";import"./use-virtual-mcp-DXij_fSZ.js";import"./use-collections-D_7JW6dX.js";import"./use-mcp-prompts-Cxw_xwII.js";import"./form-B-pClhzT.js";import"./label-jUTi8Oc4.js";import"./input-DHJ18fY7.js";import"./spinner-DLBC6d93.js";import"./use-ai-providers-CgowGcDz.js";import"./use-organization-settings-BfJ6uqm2.js";import"./avatar-ByQQ7GEH.js";import"./required-auth-layout-CJnuX5pr.js";import"./useRouterState-DNwJdpeR.js";import"./use-org-sso-Baws_Cb6.js";const J={};function K(S){const t=H.c(37),{client:r,resourceURI:g,tool:e,connectionId:m,orgId:a,args:c}=S,{sendMessage:u}=V(),{setAppContext:d,clearAppContext:o}=z(),{setChatOpen:f,openTab:s}=F(),n=`${m}:${e.name}`;let l;t[0]!==s?(l=h=>h==="inline"?(s("0"),"inline"):"fullscreen",t[0]=s,t[1]=l):l=t[1];const i=l,p=c??J;let T;t[2]!==r||t[3]!==e.name||t[4]!==p?(T={client:r,toolName:e.name,toolArguments:p},t[2]=r,t[3]=e.name,t[4]=p,t[5]=T):T=t[5];const{data:x}=k(T);let R;if(t[6]!==e._meta||t[7]!==e.name){const h=O(e._meta);R=D(e.name,h),t[6]=e._meta,t[7]=e.name,t[8]=R}else R=t[8];const U=R;let I;t[9]!==e.inputSchema?(I=e.inputSchema??{type:"object"},t[9]=e.inputSchema,t[10]=I):I=t[10];let N;t[11]!==U||t[12]!==I||t[13]!==e?(N={...e,name:U,inputSchema:I},t[11]=U,t[12]=I,t[13]=e,t[14]=N):N=t[14];const b=N;let _;t[15]!==u||t[16]!==f?(_=h=>{const w=B(h.content);w.content.length>0&&(f(!0),u({tiptapDoc:w}))},t[15]=u,t[16]=f,t[17]=_):_=t[17];const y=_;let C;t[18]!==b?(C={tool:b},t[18]=b,t[19]=C):C=t[19];let M;t[20]!==d||t[21]!==n?(M=h=>d(n,h),t[20]=d,t[21]=n,t[22]=M):M=t[22];let P;t[23]!==o||t[24]!==n?(P=()=>o(n),t[23]=o,t[24]=n,t[25]=P):P=t[25];let A;return t[26]!==r||t[27]!==y||t[28]!==i||t[29]!==a||t[30]!==g||t[31]!==C||t[32]!==M||t[33]!==P||t[34]!==p||t[35]!==x?(A=j.jsx(G,{resourceURI:g,orgId:a,toolInfo:C,toolInput:p,toolResult:x,displayMode:"fullscreen",minHeight:E.fullscreen.minHeight,maxHeight:E.fullscreen.maxHeight,client:r,onMessage:y,onUpdateModelContext:M,onTeardown:P,onRequestDisplayMode:i,className:"h-full"}),t[26]=r,t[27]=y,t[28]=i,t[29]=a,t[30]=g,t[31]=C,t[32]=M,t[33]=P,t[34]=p,t[35]=x,t[36]=A):A=t[36],A}function de(S){const t=H.c(20),{connectionId:r,toolName:g,args:e}=S,{org:m}=$();let a;t[0]!==r||t[1]!==m.id||t[2]!==m.slug?(a={connectionId:r,orgId:m.id,orgSlug:m.slug},t[0]=r,t[1]=m.id,t[2]=m.slug,t[3]=a):a=t[3];const c=v(a);let u;t[4]!==c?(u={client:c},t[4]=c,t[5]=u):u=t[5];const{data:d}=L(u);let o,f,s;t[6]!==g||t[7]!==d.tools?(o=q(decodeURIComponent(g)),s=d.tools.find(i=>i.name===o)??d.tools.find(i=>{const p=O(i._meta);if(!p)return!1;if(D(i.name,p)===o)return!0;const x=D(o,p);return x!==o&&i.name===x}),f=s?._meta?Y(s._meta):void 0,t[6]=g,t[7]=d.tools,t[8]=o,t[9]=f,t[10]=s):(o=t[8],f=t[9],s=t[10]);const n=f;if(!s||!n){let i;return t[11]!==o?(i=j.jsx("div",{className:"flex items-center justify-center h-full w-full",children:j.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',o,'" not found or has no UI']})}),t[11]=o,t[12]=i):i=t[12],i}let l;return t[13]!==e||t[14]!==c||t[15]!==r||t[16]!==m.id||t[17]!==n||t[18]!==s?(l=j.jsx(K,{client:c,resourceURI:n,tool:s,connectionId:r,orgId:m.id,args:e}),t[13]=e,t[14]=c,t[15]=r,t[16]=m.id,t[17]=n,t[18]=s,t[19]=l):l=t[19],l}export{de as AppViewContent};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/registry-layout-B6kU_bv7.js","assets/index-C_m1_Qyy.js","assets/index-Di2g24XJ.css","assets/ArrowNarrowLeft-C0lNfAd-.js","assets/CheckCircle-naAuY0Am.js","assets/Container-BYMVUIOR.js","assets/Settings02-BGX5GQSJ.js","assets/XCircle-D5rCjCCo.js","assets/constants-piR0edM1.js","assets/useInfiniteQuery-D0JT5WrD.js","assets/infiniteQueryObserver-CUomJPae.js","assets/badge-Dci-e_Pw.js","assets/input-DHJ18fY7.js","assets/dropdown-menu-TulqWZOe.js","assets/Check-BIvjG7jh.js","assets/ChevronRight-Djwmm7yx.js","assets/DotsVertical-6XBT76_0.js","assets/table-Cbi2Lt5J.js","assets/toggle-group-D_tMezdr.js","assets/use-view-mode-Bzy-dMu6.js","assets/tooltip-BeTs1OMg.js","assets/FilterLines-xU-m-2To.js","assets/SearchMd-WZzMz_xm.js","assets/dialog-Bg6eRMC4.js","assets/X-CexC7CUQ.js","assets/AlertCircle-CVwjiL5t.js","assets/Upload01-CfhmyOeM.js","assets/alert-dialog-DJnXid5j.js","assets/card-CqaEJI_U.js","assets/Trash01-CHrTm5S-.js","assets/label-jUTi8Oc4.js","assets/select-DAV_VIox.js","assets/ChevronDown-2DdfyPVo.js","assets/ChevronUp-CYign-Xr.js","assets/switch-Bmqleb0M.js","assets/textarea-C035ZOMR.js","assets/RefreshCcw01-CYXiv82D.js","assets/checkbox-DdM7zWwz.js","assets/LinkExternal01-Dn8eWUjC.js","assets/use-copy-DbsD5qK3.js","assets/Key01-CTY2QvpD.js","assets/Plus-Cq_1PqM9.js","assets/Play-qd-MZyD5.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{e as a,j as t,r,l as i,_ as o}from"./index-C_m1_Qyy.js";const n=r.lazy(()=>o(()=>import("./registry-layout-B6kU_bv7.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42])));function c(){const s=a.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(r.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(i,{size:20,className:"animate-spin text-muted-foreground"})}),children:t.jsx(n,{})}),s[0]=e):e=s[0],e}export{c as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as B,q as Se,K as re,aO as ft,j as s,c as Q,l as ge,B as ne,e as q,n as Ye,D as $e,F as ht,G as gt,a as Fe,o as ue,t as je,J as Me,ao as _e,P as se,aq as Pe,ar as Le,v as xt,E as pt,f as bt,d as Et}from"./index-C_m1_Qyy.js";import{u as Tt}from"./use-organization-roles-DNG5Wg-t.js";import{u as Re}from"./use-org-auth-client-Bk4CKLSt.js";import{B as fe}from"./badge-Dci-e_Pw.js";import{A as Qe,a as Ke,b as qe,c as He,d as Ze,f as Xe,e as Je,g as We}from"./alert-dialog-DJnXid5j.js";import{D as It,a as _t,b as St,c as Nt}from"./dropdown-menu-TulqWZOe.js";import{i as Ct}from"./DotsVertical-6XBT76_0.js";import{i as et}from"./Lock01-DzYUukb5.js";import{s as Ae}from"./Plus-Cq_1PqM9.js";import{s as At}from"./Trash01-CHrTm5S-.js";import{C as jt}from"./collection-table-wrapper-VrRyg9Ib.js";import{P as te}from"./index-CKs6rcu1.js";import{E as ke}from"./empty-state-CKtqz2A5.js";import{S as Oe}from"./search-input-BX9Kn801.js";import{P as tt,D as st}from"./ai-providers-logos-DD3qZ33J.js";import{I as ve}from"./integration-icon-Bo72bKVV.js";import{u as Rt}from"./use-infinite-scroll-XJXa4_f9.js";import{C as we}from"./checkbox-DdM7zWwz.js";import{i as Ot}from"./RefreshCcw01-CYXiv82D.js";import{u as vt}from"./useSuspenseInfiniteQuery-D794zrC9.js";import{u as wt,S as yt}from"./constants-piR0edM1.js";import{C as Mt}from"./collection-search-CZPmAdbz.js";import{u as nt}from"./use-members-BB2rBOpc.js";import{u as Pt}from"./use-connection-BbCw9KPq.js";import{u as Lt,c as kt}from"./use-ai-providers-CgowGcDz.js";import{A as lt}from"./avatar-ByQQ7GEH.js";import{S as he}from"./switch-Bmqleb0M.js";import{c as xe,b as pe,T as be,a as Ee}from"./tooltip-BeTs1OMg.js";import{S as De,a as Ge,b as Ue}from"./settings-section-DLBjUAhp.js";import{t as Dt}from"./ChevronDown-2DdfyPVo.js";import{i as Gt}from"./ChevronRight-Djwmm7yx.js";import{i as Be}from"./X-CexC7CUQ.js";import"./Check-BIvjG7jh.js";import"./table-Cbi2Lt5J.js";import"./SwitchHorizontal01-B39nOlBz.js";import"./sidebar-BFp8v2I0.js";import"./LayoutLeft-BA4wxcAF.js";import"./SearchMd-WZzMz_xm.js";import"./Container-BYMVUIOR.js";import"./agent-icon-C3wnlI99.js";import"./AlertCircle-CVwjiL5t.js";import"./Tool01-CAdd6NGF.js";import"./Stars02-BgabhO3x.js";import"./ArrowNarrowLeft-C0lNfAd-.js";import"./XCircle-D5rCjCCo.js";import"./ArrowUpRight-BsdiWOZ_.js";import"./ZapSquare-rxLTzaCI.js";import"./Users03-COREII3z.js";import"./CheckCircle-naAuY0Am.js";import"./ChevronUp-CYign-Xr.js";import"./FilterLines-xU-m-2To.js";import"./Star01-TIrOjEGQ.js";import"./Palette-B6NpJZ9F.js";import"./HardDrive-CPUYFXaj.js";import"./Key01-CTY2QvpD.js";import"./LinkExternal01-Dn8eWUjC.js";import"./Monitor01-nKIM1K_1.js";import"./Sun-BMF5NYnu.js";import"./Play-qd-MZyD5.js";import"./Settings02-BGX5GQSJ.js";import"./Shield01-Dd3PCkCh.js";import"./Upload01-CfhmyOeM.js";import"./User01-CnVuEZ_q.js";import"./Users01-CARILaym.js";import"./XClose-BOJwjK3-.js";import"./Zap-DRsZpKeC.js";import"./infiniteQueryObserver-CUomJPae.js";import"./use-collections-D_7JW6dX.js";import"./card-CqaEJI_U.js";const ye="basic-usage",ot=[{id:ye,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","AUTOMATION_GET","AUTOMATION_LIST","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","SANDBOX_START","SANDBOX_DELETE","GLOBAL_SEARCH"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_GET","ORGANIZATION_DOMAIN_SET","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_CLEAR"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH","REGISTRY_MONITOR_SCHEDULE_SET","REGISTRY_MONITOR_SCHEDULE_CANCEL"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"event-bus:use",label:"Use event bus",description:"Publish events and manage subscriptions",section:"Developer",tools:["EVENT_PUBLISH","EVENT_SUBSCRIBE","EVENT_UNSUBSCRIBE","EVENT_CANCEL","EVENT_ACK","EVENT_SUBSCRIPTION_LIST","EVENT_SYNC_SUBSCRIPTIONS"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}],Ut=new Set(ot.find(t=>t.id===ye)?.tools??[]);function Bt(){const t=new Map;for(const e of ot){if(e.id===ye)continue;const n=t.get(e.section)??[];n.push(e),t.set(e.section,n)}return Array.from(t.entries()).map(([e,n])=>({section:e,capabilities:n}))}function Vt(t,e,n){return n?!0:t.tools.every(l=>e.includes(l))}function zt(t,e,n){if(n){const o=new Set(e);for(const a of t.tools)o.add(a);return Array.from(o)}const l=new Set(e);for(const o of t.tools)l.delete(o);return Array.from(l)}const Yt=B.memo(function(e){const n=q.c(21),{connection:l,isSelected:o,hasToolsEnabled:a,activeToolsCount:d,totalToolsCount:p,onSelect:m,onToggle:x}=e,h=o?"bg-accent/50":"hover:bg-muted/50";let r;n[0]!==h?(r=Q("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",h),n[0]=h,n[1]=r):r=n[1];let g;n[2]!==l.icon||n[3]!==l.title?(g=s.jsx(ve,{icon:l.icon,name:l.title,size:"xs"}),n[2]=l.icon,n[3]=l.title,n[4]=g):g=n[4];let i;n[5]!==l.title?(i=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),n[5]=l.title,n[6]=i):i=n[6];let c;n[7]!==m||n[8]!==g||n[9]!==i?(c=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:m,children:[g,i]}),n[7]=m,n[8]=g,n[9]=i,n[10]=c):c=n[10];let T;n[11]!==d||n[12]!==l.tools||n[13]!==a||n[14]!==x||n[15]!==p?(T=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[d,"/",p]}),s.jsx(we,{checked:a,onCheckedChange:x,onClick:Qt})]}),n[11]=d,n[12]=l.tools,n[13]=a,n[14]=x,n[15]=p,n[16]=T):T=n[16];let b;return n[17]!==r||n[18]!==c||n[19]!==T?(b=s.jsxs("div",{className:r,children:[c,T]}),n[17]=r,n[18]=c,n[19]=T,n[20]=b):b=n[20],b}),$t=B.memo(function(e){const n=q.c(18),{connectionId:l,tool:o,isSelected:a,onToggle:d}=e,p=`tool-${l}-${o.name}`,m=a?"text-foreground":"text-muted-foreground";let x;n[0]!==m?(x=Q("text-sm font-medium",m),n[0]=m,n[1]=x):x=n[1];let h;n[2]!==x||n[3]!==o.name?(h=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:x,children:o.name})}),n[2]=x,n[3]=o.name,n[4]=h):h=n[4];let r;n[5]!==o.description?(r=o.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:o.description}),n[5]=o.description,n[6]=r):r=n[6];let g;n[7]!==h||n[8]!==r?(g=s.jsxs("div",{className:"flex-1 min-w-0",children:[h,r]}),n[7]=h,n[8]=r,n[9]=g):g=n[9];const i=`tool-${l}-${o.name}`;let c;n[10]!==a||n[11]!==d||n[12]!==i?(c=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(we,{id:i,checked:a,onCheckedChange:d,onClick:Kt})}),n[10]=a,n[11]=d,n[12]=i,n[13]=c):c=n[13];let T;return n[14]!==p||n[15]!==g||n[16]!==c?(T=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:p,children:[g,c]}),n[14]=p,n[15]=g,n[16]=c,n[17]=T):T=n[17],T});function Ft({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:n,searchQuery:l}){const[o,a]=B.useState(""),d=l!==void 0?l:o,p=B.useDeferredValue(d),[m,x]=B.useState("all"),[h,r]=B.useState(!1),g=B.useRef(new Set(Object.keys(t))),{org:i}=Se(),c=wt({connectionId:yt,orgId:i.id,orgSlug:i.slug}),T=100,b=p.trim(),I=b?{operator:"or",conditions:[{field:["title"],operator:"contains",value:b},{field:["description"],operator:"contains",value:b}]}:void 0,j=!!n,S={...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:T,offset:0,...j&&{include_virtual:!0}},R=JSON.stringify(S),{data:_,fetchNextPage:A,hasNextPage:f,isFetchingNextPage:N}=vt({queryKey:re.collectionListInfinite(c,i.id,"","CONNECTIONS",R),queryFn:async({pageParam:E=0})=>(await c.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:T,offset:E,...j&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(E,k)=>{if(E?.hasMore)return k.reduce((F,ee)=>F+(ee?.items?.length??0),0)},staleTime:3e4}),w=_?.pages.flatMap(E=>E?.items??[])??[],v=Rt(A,f??!1,N),u=n?w.filter(E=>E.connection_type!=="VIRTUAL"?!0:ft(E.connection_url)!==n):w,y=g.current,C=[...y.values()].map(E=>u.find(k=>k.id===E)).filter(E=>E!==void 0),D=u.filter(E=>!y.has(E.id)),G=[...C,...D],$=E=>{const k=t[E];return k!==void 0&&k.length>0},L=G.filter(E=>{if(m==="all")return!0;const k=$(E.id);return m==="selected"?k:m==="unselected"?!k:!0}),[V,z]=B.useState(G[0]?.id??null),O=V?G.find(E=>E.id===V)??null:null,M=O?.tools??[],Y=(E,k)=>t[E]?.includes(k)??!1,K=(E,k)=>{const F=t[E]??[],ee=F.includes(k),H={...t};if(ee){const Z=F.filter(X=>X!==k);Z.length===0?delete H[E]:H[E]=Z}else H[E]=[...F,k];e(H)},J=E=>{const k=G.find(X=>X.id===E);if(!k?.tools)return;const F=t[E]??[],ee=k.tools.map(X=>X.name),H=F.length>0&&ee.every(X=>F.includes(X)),Z={...t};H?delete Z[E]:(Z[E]=ee,z(E)),e(Z)},W=E=>{z(E),r(!0)},le=()=>{r(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:Q("w-full md:w-80 border-r border-border flex flex-col",h&&"hidden md:flex"),children:[l===void 0&&s.jsx(Mt,{value:o,onChange:a,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>x("all"),className:Q("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>x("selected"),className:Q("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>x("unselected"),className:Q("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",m==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:L.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:d?"No connections found":m==="selected"?"No servers selected":m==="unselected"?"No unselected servers":"No connections available"}):s.jsxs("div",{className:"p-2 space-y-1",children:[L.map(E=>{const k=E.tools?.length??0,F=t[E.id]?.length??0;return s.jsx(Yt,{connection:E,isSelected:V===E.id,hasToolsEnabled:$(E.id),activeToolsCount:F,totalToolsCount:k,onSelect:()=>W(E.id),onToggle:()=>J(E.id)},E.id)}),s.jsx("div",{ref:v,className:"h-4"}),N&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(ge,{size:18,className:"animate-spin text-muted-foreground"})})]})})]}),s.jsx("div",{className:Q("flex-1 flex-col",h?"flex":"hidden md:flex"),children:O?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ne,{variant:"ghost",size:"sm",onClick:le,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(Ot,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(ve,{icon:O.icon,name:O.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:O.title}),O.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:O.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:M.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):s.jsx("div",{className:"space-y-2",children:M.map(E=>s.jsx($t,{connectionId:O.id,tool:E,isSelected:Y(O.id,E.name),onToggle:()=>K(O.id,E.name)},E.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}function Qt(t){return t.stopPropagation()}function Kt(t){return t.stopPropagation()}const Ne=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"],qt={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function it(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const o=t.charCodeAt(l);e=(e<<5)-e+o,e=e&e}const n=Math.abs(e)%Ne.length;return Ne[n]??Ne[0]}function Ve(t,e){return e?qt[t]??"bg-neutral-400":it(t)}const Ht=Me({role:Me({id:se().optional(),slug:se().optional(),label:se()}),allowAllStaticPermissions:Le(),staticPermissions:_e(se()),toolSet:Pe(se(),_e(se())),allowAllModels:Le(),modelSet:Pe(se(),_e(se())),memberIds:_e(se())});function rt(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function ze(t,e,n){const l=s.jsx(he,{checked:t,disabled:e,onCheckedChange:n});return e?s.jsx(xe,{children:s.jsxs(pe,{children:[s.jsx(be,{asChild:!0,children:s.jsx("div",{children:l})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):l}function Zt(t){const e=q.c(28),{allowAllStaticPermissions:n,staticPermissions:l,onAllowAllChange:o,onPermissionsChange:a,readOnly:d,searchQuery:p}=t,m=d===void 0?!1:d;let x;e[0]!==p?(x=p.trim().toLowerCase(),e[0]=p,e[1]=x):x=e[1];const h=B.useDeferredValue(x);let r;if(e[2]!==n||e[3]!==h||e[4]!==o||e[5]!==a||e[6]!==m||e[7]!==p||e[8]!==l){const g=Bt(),i=(R,_)=>{if(!m){if(n&&_){const A=g.flatMap(Wt).flatMap(Jt);o(!1),a(A.filter(f=>!R.tools.includes(f)));return}n||a(zt(R,l,!_))}};let c;e[10]!==h?(c=R=>{const{section:_,capabilities:A}=R;return{section:_,capabilities:A.filter(f=>!h||f.label.toLowerCase().includes(h)||f.description.toLowerCase().includes(h))}},e[10]=h,e[11]=c):c=e[11];const T=g.map(c).filter(Xt);let b;e[12]!==n||e[13]!==o||e[14]!==a?(b=()=>{o(!n),a([])},e[12]=n,e[13]=o,e[14]=a,e[15]=b):b=e[15];let I;e[16]!==n||e[17]!==m||e[18]!==b?(I=ze(n,m,b),e[16]=n,e[17]=m,e[18]=b,e[19]=I):I=e[19];let j;e[20]!==n||e[21]!==o||e[22]!==a||e[23]!==m?(j=m?void 0:()=>{o(!n),a([])},e[20]=n,e[21]=o,e[22]=a,e[23]=m,e[24]=j):j=e[24];let S;e[25]!==I||e[26]!==j?(S=s.jsx(De,{title:"General",children:s.jsx(Ge,{children:s.jsx(Ue,{title:"All organization permissions",description:"Grant full access to all features below",action:I,onClick:j})})}),e[25]=I,e[26]=j,e[27]=S):S=e[27],r=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[S,T.length===0&&h?s.jsxs("p",{className:"text-sm text-muted-foreground py-4",children:["No permissions match “",p,"”"]}):T.map(R=>{const{section:_,capabilities:A}=R;return s.jsx(De,{title:_,children:s.jsx(Ge,{children:A.map(f=>{const N=Vt(f,l,n);return s.jsx(Ue,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[f.label,f.dangerous&&s.jsx(xt,{size:12,className:"text-amber-500 shrink-0"})]}),description:f.description,action:ze(N,m,()=>i(f,N)),onClick:m?void 0:()=>i(f,N)},f.id)})})},_)})]})}),e[2]=n,e[3]=h,e[4]=o,e[5]=a,e[6]=m,e[7]=p,e[8]=l,e[9]=r}else r=e[9];return r}function Xt(t){return t.capabilities.length>0}function Jt(t){return t.tools}function Wt(t){return t.capabilities}const at={anthropic:"Anthropic",openrouter:"OpenRouter"},es={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function ts(t,e){const n=t.indexOf("/"),l=n>0?t.slice(0,n):e;return l.startsWith("~")?l.slice(1):l}function ss(t){return es[t]??at[t]??t}function ns(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const ct=30;function ls(t){const e=q.c(44),{connectionId:n,subProviderId:l,subProviderName:o,groupLogo:a,models:d,allConnectionModelIds:p,selectedModels:m,allowAllModels:x,allConnectionModelsSelected:h,onToggleModel:r,onExitAllowAll:g,readOnly:i,defaultExpanded:c}=t,[T,b]=B.useState(c),I=c||T,j=b,[S,R]=B.useState(ct);let _;e[0]!==h||e[1]!==x||e[2]!==m?(_=v=>x||h||m.includes("*")||m.includes(v),e[0]=h,e[1]=x,e[2]=m,e[3]=_):_=e[3];const A=_;let f;if(e[4]!==A||e[5]!==d){let v;e[7]!==A?(v=u=>A(u.id),e[7]=A,e[8]=v):v=e[8],f=d.filter(v),e[4]=A,e[5]=d,e[6]=f}else f=e[6];const N=f.length;let w;if(e[9]!==p||e[10]!==x||e[11]!==n||e[12]!==N||e[13]!==I||e[14]!==a||e[15]!==A||e[16]!==d||e[17]!==g||e[18]!==r||e[19]!==i||e[20]!==l||e[21]!==o||e[22]!==S){const v=d.slice(0,S),u=d.length>S;let y;e[24]===Symbol.for("react.memo_cache_sentinel")?(y=()=>j(as),e[24]=y):y=e[24];const C=a??tt[l]??st;let D;e[25]!==o||e[26]!==C?(D=s.jsx(ve,{icon:C,name:o,size:"sm"}),e[25]=o,e[26]=C,e[27]=D):D=e[27];let G;e[28]!==o?(G=s.jsx("span",{className:"text-sm font-medium truncate",children:o}),e[28]=o,e[29]=G):G=e[29];let $;e[30]!==D||e[31]!==G?($=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[D,G]}),e[30]=D,e[31]=G,e[32]=$):$=e[32];let L;e[33]!==N||e[34]!==d.length?(L=s.jsxs(fe,{variant:"secondary",className:"text-xs text-muted-foreground",children:[N,"/",d.length," enabled"]}),e[33]=N,e[34]=d.length,e[35]=L):L=e[35];let V;e[36]!==I?(V=I?s.jsx(Dt,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(Gt,{size:16,className:"text-muted-foreground shrink-0"}),e[36]=I,e[37]=V):V=e[37];let z;e[38]!==V||e[39]!==L?(z=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[L,V]}),e[38]=V,e[39]=L,e[40]=z):z=e[40];let O;e[41]!==z||e[42]!==$?(O=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:y,children:[$,z]}),e[41]=z,e[42]=$,e[43]=O):O=e[43],w=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[O,I&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[v.map(M=>{const Y=A(M.id),K=()=>{if(!i){if(x){g(n,p,M.id);return}r(n,M.id)}};return s.jsxs("div",{className:Q("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!i&&"hover:bg-muted/50 cursor-pointer"),onClick:K,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:M.title})}),s.jsx("div",{onClick:rs,children:i?s.jsx(xe,{children:s.jsxs(pe,{children:[s.jsx(be,{asChild:!0,children:s.jsx("div",{children:s.jsx(he,{checked:Y,disabled:!0,onCheckedChange:is})})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(he,{checked:Y,onCheckedChange:K})})]},M.id)}),u&&s.jsxs("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>R(os),children:["Show more (",d.length-S," remaining)"]})]})]}),e[9]=p,e[10]=x,e[11]=n,e[12]=N,e[13]=I,e[14]=a,e[15]=A,e[16]=d,e[17]=g,e[18]=r,e[19]=i,e[20]=l,e[21]=o,e[22]=S,e[23]=w}else w=e[23];return w}function os(t){return t+ct}function is(){}function rs(t){return t.stopPropagation()}function as(t){return!t}function cs(t){const e=q.c(33),{connection:n,selectedModels:l,allowAllModels:o,onToggleModel:a,onExitAllowAll:d,allConnectionModelsSelected:p,searchQuery:m,readOnly:x}=t,h=kt(n.id);let r,g,i,c,T;if(e[0]!==p||e[1]!==o||e[2]!==n.id||e[3]!==n.label||e[4]!==n.providerId||e[5]!==d||e[6]!==a||e[7]!==h||e[8]!==x||e[9]!==m||e[10]!==l){T=Symbol.for("react.early_return_sentinel");e:{let j;e[16]!==n.label?(j=C=>({...C,id:C.modelId,provider:n.label}),e[16]=n.label,e[17]=j):j=e[17];const S=h.filter(fs).map(j),R=m.trim().toLowerCase(),_=R?S.filter(C=>C.title.toLowerCase().includes(R)||C.id.toLowerCase().includes(R)||C.provider?.toLowerCase().includes(R)):S;if(_.length===0){T=null;break e}const A=new Map;for(const C of _){const D=ts(C.id,n.providerId),G=A.get(D)??{models:[],logo:null};G.models.push({id:C.id,title:ns(C.title),logo:C.logo}),!G.logo&&C.logo&&(G.logo=C.logo),A.set(D,G)}const f=Array.from(A.entries()).map(us).sort(ms),N=f.length===1||R.length>0;i="flex flex-col gap-3";const w=tt[n.providerId]??st;let v;e[18]!==n.providerId||e[19]!==w?(v=s.jsx("img",{src:w,alt:n.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=n.providerId,e[19]=w,e[20]=v):v=e[20];const u=at[n.providerId]??n.providerId;let y;e[21]!==u?(y=s.jsx("h4",{className:"text-sm font-medium",children:u}),e[21]=u,e[22]=y):y=e[22],e[23]!==y||e[24]!==v?(c=s.jsxs("div",{className:"flex items-center gap-2",children:[v,y]}),e[23]=y,e[24]=v,e[25]=c):c=e[25],r="flex flex-col gap-3",g=f.map(C=>s.jsx(ls,{connectionId:n.id,subProviderId:C.id,subProviderName:C.name,groupLogo:C.logo,models:C.models,allConnectionModelIds:S.map(ds),selectedModels:l,allowAllModels:o,allConnectionModelsSelected:p,onToggleModel:a,onExitAllowAll:d,readOnly:x,defaultExpanded:N},C.id))}e[0]=p,e[1]=o,e[2]=n.id,e[3]=n.label,e[4]=n.providerId,e[5]=d,e[6]=a,e[7]=h,e[8]=x,e[9]=m,e[10]=l,e[11]=r,e[12]=g,e[13]=i,e[14]=c,e[15]=T}else r=e[11],g=e[12],i=e[13],c=e[14],T=e[15];if(T!==Symbol.for("react.early_return_sentinel"))return T;let b;e[26]!==r||e[27]!==g?(b=s.jsx("div",{className:r,children:g}),e[26]=r,e[27]=g,e[28]=b):b=e[28];let I;return e[29]!==i||e[30]!==c||e[31]!==b?(I=s.jsxs("div",{className:i,children:[c,b]}),e[29]=i,e[30]=c,e[31]=b,e[32]=I):I=e[32],I}function ds(t){return t.id}function ms(t,e){return t.name.localeCompare(e.name)}function us(t){const[e,n]=t;return{id:e,name:ss(e),logo:n.logo,models:n.models}}function fs(t,e,n){return n.findIndex(l=>l.modelId===t.modelId)===e}function hs(t){const e=q.c(35),{allowAllModels:n,modelSet:l,onAllowAllChange:o,onModelSetChange:a,readOnly:d,searchQuery:p}=t,m=d===void 0?!1:d,x=B.useDeferredValue(p),h=Lt();let r;e[0]!==l||e[1]!==a?(r=(f,N)=>{const w=l[f]??[],v={...l};if(w.includes(N)){const u=w.filter(y=>y!==N);u.length===0?delete v[f]:v[f]=u}else v[f]=[...w,N];a(v)},e[0]=l,e[1]=a,e[2]=r):r=e[2];const g=r;let i;e[3]!==l||e[4]!==o||e[5]!==a?(i=(f,N,w)=>{o(!1),a({...l,[f]:N.filter(v=>v!==w)})},e[3]=l,e[4]=o,e[5]=a,e[6]=i):i=e[6];const c=i,T=!m&&"hover:bg-muted/50 cursor-pointer";let b;e[7]!==T?(b=Q("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",T),e[7]=T,e[8]=b):b=e[8];let I;e[9]!==n||e[10]!==o||e[11]!==a||e[12]!==m?(I=()=>{if(m)return;const f=!n;o(f),f&&a({})},e[9]=n,e[10]=o,e[11]=a,e[12]=m,e[13]=I):I=e[13];let j;e[14]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("span",{className:"text-sm font-medium",children:"All models"}),e[14]=j):j=e[14];let S;e[15]!==n||e[16]!==o||e[17]!==a||e[18]!==m?(S=s.jsx("div",{onClick:xs,children:m?s.jsx(xe,{children:s.jsxs(pe,{children:[s.jsx(be,{asChild:!0,children:s.jsx("div",{children:s.jsx(he,{checked:n,disabled:!0,onCheckedChange:gs})})}),s.jsx(Ee,{children:s.jsx("p",{children:"Built-in role permissions cannot be changed"})})]})}):s.jsx(he,{checked:n,onCheckedChange:f=>{o(f),f&&a({})}})}),e[15]=n,e[16]=o,e[17]=a,e[18]=m,e[19]=S):S=e[19];let R;e[20]!==b||e[21]!==I||e[22]!==S?(R=s.jsxs("div",{className:b,onClick:I,children:[j,S]}),e[20]=b,e[21]=I,e[22]=S,e[23]=R):R=e[23];let _;e[24]!==h||e[25]!==n||e[26]!==x||e[27]!==c||e[28]!==l||e[29]!==m||e[30]!==g?(_=h.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No LLM connections configured"}):h.map(f=>s.jsx(B.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(ge,{className:"size-4 animate-spin"}),"Loading models..."]}),children:s.jsx(cs,{connection:f,selectedModels:l[f.id]??[],allowAllModels:n,onToggleModel:g,onExitAllowAll:c,allConnectionModelsSelected:(l[f.id]??[]).includes("*"),searchQuery:x,readOnly:m})},f.id)),e[24]=h,e[25]=n,e[26]=x,e[27]=c,e[28]=l,e[29]=m,e[30]=g,e[31]=_):_=e[31];let A;return e[32]!==_||e[33]!==R?(A=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[R,_]}),e[32]=_,e[33]=R,e[34]=A):A=e[34],A}function gs(){}function xs(t){return t.stopPropagation()}function ps(t){const e=q.c(52),{open:n,onOpenChange:l,selectedMemberIds:o,onAddMembers:a}=t,[d,p]=B.useState(""),m=B.useDeferredValue(d);let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[0]=x):x=e[0];const[h,r]=B.useState(x),{data:g}=nt();let i,c,T,b,I,j,S,R,_,A,f;if(e[1]!==g?.data?.members||e[2]!==m||e[3]!==a||e[4]!==l||e[5]!==n||e[6]!==h||e[7]!==d||e[8]!==o){const $=g?.data?.members??[];let L;e[20]!==m?(L=O=>{const M=m.toLowerCase();return O.user?.name?.toLowerCase().includes(M)||O.user?.email?.toLowerCase().includes(M)},e[20]=m,e[21]=L):L=e[21];const V=$.filter(L);let z;e[22]!==a||e[23]!==l||e[24]!==h?(z=()=>{a(h),r([]),l(!1)},e[22]=a,e[23]=l,e[24]=h,e[25]=z):z=e[25],T=z,c=Qe,A=n,f=l,i=Ke,R="sm:max-w-md p-0 overflow-hidden",e[26]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsxs(qe,{className:"px-6 pt-6",children:[s.jsx(He,{children:"Add Members to Role"}),s.jsx(Ze,{children:"Select members to add to this role."})]}),e[26]=_):_=e[26],j="flex flex-col h-80",e[27]!==d?(S=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Oe,{value:d,onChange:p,placeholder:"Search members...",className:"w-full"})}),e[27]=d,e[28]=S):S=e[28],b="flex-1 overflow-auto",I=V.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:d?"No members found":"No members available"})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:V.map(O=>{const M=O.role!=="owner",Y=o.includes(O.id),K=h.includes(O.id);return s.jsxs("label",{className:Q("flex items-center gap-3 p-2 rounded-lg",!M||Y?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(we,{checked:K||Y,onCheckedChange:()=>{!M||Y||r(J=>J.includes(O.id)?J.filter(W=>W!==O.id):[...J,O.id])},disabled:!M||Y}),s.jsx(lt,{url:O.user?.image??void 0,fallback:rt(O.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:O.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:O.user?.email})]}),!M&&s.jsx(fe,{variant:"secondary",className:"shrink-0",children:"Owner"}),Y&&M&&s.jsx(fe,{variant:"outline",className:"shrink-0",children:"Added"})]},O.id)})}),e[1]=g?.data?.members,e[2]=m,e[3]=a,e[4]=l,e[5]=n,e[6]=h,e[7]=d,e[8]=o,e[9]=i,e[10]=c,e[11]=T,e[12]=b,e[13]=I,e[14]=j,e[15]=S,e[16]=R,e[17]=_,e[18]=A,e[19]=f}else i=e[9],c=e[10],T=e[11],b=e[12],I=e[13],j=e[14],S=e[15],R=e[16],_=e[17],A=e[18],f=e[19];let N;e[29]!==b||e[30]!==I?(N=s.jsx("div",{className:b,children:I}),e[29]=b,e[30]=I,e[31]=N):N=e[31];let w;e[32]!==N||e[33]!==j||e[34]!==S?(w=s.jsxs("div",{className:j,children:[S,N]}),e[32]=N,e[33]=j,e[34]=S,e[35]=w):w=e[35];let v;e[36]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Xe,{children:"Cancel"}),e[36]=v):v=e[36];const u=h.length===0,y=h.length>0&&`(${h.length})`;let C;e[37]!==T||e[38]!==u||e[39]!==y?(C=s.jsxs(Je,{className:"px-6 pb-6",children:[v,s.jsxs(We,{onClick:T,disabled:u,children:["Add ",y]})]}),e[37]=T,e[38]=u,e[39]=y,e[40]=C):C=e[40];let D;e[41]!==i||e[42]!==w||e[43]!==C||e[44]!==R||e[45]!==_?(D=s.jsxs(i,{className:R,children:[_,w,C]}),e[41]=i,e[42]=w,e[43]=C,e[44]=R,e[45]=_,e[46]=D):D=e[46];let G;return e[47]!==c||e[48]!==D||e[49]!==A||e[50]!==f?(G=s.jsx(c,{open:A,onOpenChange:f,children:D}),e[47]=c,e[48]=D,e[49]=A,e[50]=f,e[51]=G):G=e[51],G}function bs(t){const e=q.c(28),{memberIds:n,onMemberIdsChange:l,readOnly:o,searchQuery:a,addMemberDialogOpen:d,onAddMemberDialogOpenChange:p}=t,m=o===void 0?!1:o,x=B.useDeferredValue(a),{data:h}=nt();let r,g,i;if(e[0]!==h?.data?.members||e[1]!==x||e[2]!==n||e[3]!==l||e[4]!==m||e[5]!==a){const j=h?.data?.members??[];let S;e[9]!==n?(S=f=>n.includes(f.id),e[9]=n,e[10]=S):S=e[10];const R=j.filter(S);let _;e[11]!==x?(_=f=>{const N=x.toLowerCase();return f.user?.name?.toLowerCase().includes(N)||f.user?.email?.toLowerCase().includes(N)},e[11]=x,e[12]=_):_=e[12];const A=R.filter(_);i="flex flex-col h-full",r="flex-1 overflow-auto",g=R.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:"No members"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add members to grant them the configured permissions."})]})}):A.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("p",{className:"text-sm text-muted-foreground",children:['No members match "',a,'"']})}):s.jsx("div",{className:"p-4 space-y-2",children:A.map(f=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(lt,{url:f.user?.image??void 0,fallback:rt(f.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:f.user?.name||"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:f.user?.email})]}),m?s.jsx(xe,{children:s.jsxs(pe,{children:[s.jsx(be,{asChild:!0,children:s.jsx("div",{children:s.jsx(ne,{variant:"ghost",size:"sm",disabled:!0,children:s.jsx(Be,{size:16})})})}),s.jsx(Ee,{children:s.jsx("p",{children:"Owner membership cannot be changed"})})]})}):s.jsx(ne,{variant:"ghost",size:"sm",onClick:()=>l(n.filter(N=>N!==f.id)),children:s.jsx(Be,{size:16})})]},f.id))}),e[0]=h?.data?.members,e[1]=x,e[2]=n,e[3]=l,e[4]=m,e[5]=a,e[6]=r,e[7]=g,e[8]=i}else r=e[6],g=e[7],i=e[8];let c;e[13]!==r||e[14]!==g?(c=s.jsx("div",{className:r,children:g}),e[13]=r,e[14]=g,e[15]=c):c=e[15];let T;e[16]!==n||e[17]!==l?(T=j=>l([...n,...j]),e[16]=n,e[17]=l,e[18]=T):T=e[18];let b;e[19]!==d||e[20]!==n||e[21]!==p||e[22]!==T?(b=s.jsx(ps,{open:d,onOpenChange:p,selectedMemberIds:n,onAddMembers:T}),e[19]=d,e[20]=n,e[21]=p,e[22]=T,e[23]=b):b=e[23];let I;return e[24]!==i||e[25]!==c||e[26]!==b?(I=s.jsxs("div",{className:i,children:[c,b]}),e[24]=i,e[25]=c,e[26]=b,e[27]=I):I=e[27],I}function Es(t){const e=q.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(ge,{size:24,className:"animate-spin text-muted-foreground"})}),e[0]=n):n=e[0];let l;return e[1]!==t?(l=s.jsx(B.Suspense,{fallback:n,children:s.jsx(bs,{...t})}),e[1]=t,e[2]=l):l=e[2],l}const Ts={owner:[],admin:[],user:[]};function Is(t,e,n,l){if(n?.permission!=null&&l)return dt({id:n.id,role:t,label:t.charAt(0).toUpperCase()+t.slice(1),permission:n.permission},e,l);const o=t==="owner"||t==="admin";return{role:{id:n?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:o,staticPermissions:Ts[t],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:e.filter(a=>a.role===t).map(a=>a.id)}}function dt(t,e,n){const l=t.permission||{},o=l.self||[],a=o.includes("*"),d=a?[]:o.filter(r=>r!=="*"),p={};for(const[r,g]of Object.entries(l))if(!(r==="self"||r==="models"))if(r==="*")for(const i of n)p[i.id]=g.includes("*")?i.tools?.map(c=>c.name)??[]:g;else{const i=n.find(c=>c.id===r);i&&(p[r]=g.includes("*")?i.tools?.map(c=>c.name)??[]:g)}const m=l.models||[],x=m.length===0||m.includes("*:*"),h={};if(!x)for(const r of m){const g=r.indexOf(":");if(g===-1)continue;const i=r.slice(0,g),c=r.slice(g+1);h[i]||(h[i]=[]),h[i].push(c)}return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:a,staticPermissions:d,toolSet:p,allowAllModels:x,modelSet:h,memberIds:e.filter(r=>r.role===t.role).map(r=>r.id)}}function _s(t,e){const n={};if(t.allowAllStaticPermissions)n.self=["*"];else{const l=new Set(t.staticPermissions);for(const o of Ut)l.add(o);l.size>0&&(n.self=Array.from(l))}for(const[l,o]of Object.entries(t.toolSet))if(o.length>0){const d=e.find(p=>p.id===l)?.tools?.map(p=>p.name)??[];n[l]=d.length>0&&d.every(p=>o.includes(p))?["*"]:o}if(t.allowAllModels)n.models=["*:*"];else{const l=[];for(const[o,a]of Object.entries(t.modelSet))for(const d of a)l.push(`${o}:${d}`);l.length>0&&(n.models=l)}return n}function Ss(t,e,n){return t.kind==="builtin"?Is(t.role,e,t.storedId!=null?{id:t.storedId,permission:t.storedPermission}:void 0,n):t.kind==="custom"?dt(t.role,e,n):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},memberIds:[]}}function Ns(t){const e=q.c(5),{readOnly:n,onOpen:l}=t;if(n){let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(be,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ne,{variant:"outline",size:"sm",disabled:!0,children:[s.jsx(Ae,{size:16}),"Add Member"]})})}),e[0]=d):d=e[0];let p;return e[1]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(xe,{children:s.jsxs(pe,{children:[d,s.jsx(Ee,{children:s.jsx("p",{children:"Owner membership cannot be changed"})})]})}),e[1]=p):p=e[1],p}let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Ae,{size:16}),e[2]=o):o=e[2];let a;return e[3]!==l?(a=s.jsxs(ne,{variant:"outline",size:"sm",onClick:l,children:[o,"Add Member"]}),e[3]=l,e[4]=a):a=e[4],a}function Cs(t){const e=q.c(14),{locator:n}=Se(),l=Re(),o=Pt();let a;e[0]!==n?(a=re.members(n),e[0]=n,e[1]=a):a=e[1];let d;e[2]!==l?(d=()=>l.organization.listMembers(),e[2]=l,e[3]=d):d=e[3];let p;e[4]!==a||e[5]!==d?(p={queryKey:a,queryFn:d},e[4]=a,e[5]=d,e[6]=p):p=e[6];const{data:m,isPending:x}=Ye(p);if(x||!o){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})})}),e[7]=i):i=e[7],i}let h;e[8]!==m?.data?.members?(h=m?.data?.members??[],e[8]=m?.data?.members,e[9]=h):h=e[9];const r=h;let g;return e[10]!==o||e[11]!==r||e[12]!==t?(g=s.jsx(As,{...t,members:r,connections:o}),e[10]=o,e[11]=r,e[12]=t,e[13]=g):g=e[13],g}function As({target:t,onBack:e,onSaved:n,members:l,connections:o}){const{locator:a}=Se(),d=Re(),p=$e(),m=t.kind==="builtin",x=t.kind==="builtin"&&t.role==="owner",h=t.kind==="new",[r,g]=B.useState(m?"org":"mcp"),i=ht({resolver:gt(Ht),defaultValues:Ss(t,l,o)}),c=i.formState.isValid,T=i.formState.isDirty,b=Fe({mutationFn:async u=>{const y=_s(u,o),C=u.role.slug||u.role.label.toLowerCase().replace(/\s+/g,"-"),D=u.role.slug==="owner"&&!u.role.id,G=(u.role.slug==="admin"||u.role.slug==="user")&&!u.role.id,$=async L=>{const V=l.filter(M=>M.role===L).map(M=>M.id),z=u.memberIds.filter(M=>!V.includes(M)),O=V.filter(M=>!u.memberIds.includes(M));for(const M of z){const Y=await d.organization.updateMemberRole({memberId:M,role:[L]});if(Y?.error)throw new Error(Y.error.message??"Something went wrong")}for(const M of O){const Y=await d.organization.updateMemberRole({memberId:M,role:["user"]});if(Y?.error)throw new Error(Y.error.message??"Something went wrong")}};if(D)return await $("owner"),u;if(u.role.id){const L=await d.organization.updateRole({roleId:u.role.id,data:{permission:y}});if(L?.error)throw new Error(L.error.message??"Something went wrong");return await $(u.role.slug),u}else if(G){const L=await d.organization.createRole({role:u.role.slug,permission:y});if(L?.error)throw new Error(L.error.message??"Something went wrong");return await $(u.role.slug),{...u,role:{...u.role,id:L.data?.roleData?.id}}}else{const L=await d.organization.createRole({role:C,permission:y});if(L?.error)throw new Error(L.error.message??"Something went wrong");for(const V of u.memberIds){const z=await d.organization.updateMemberRole({memberId:V,role:[C]});if(z?.error)throw new Error(z.error.message)}return{...u,role:{...u.role,id:L.data?.roleData?.id,slug:C}}}},onSuccess:(u,y)=>{p.invalidateQueries({queryKey:re.members(a)}),p.invalidateQueries({queryKey:re.organizationRoles(a)});const C=!y.role.id&&!y.role.slug,D=y.role.slug==="owner"&&!y.role.id;je(D?"role_members_updated":C?"role_created":"role_updated",{role_slug:y.role.slug??null}),ue.success(D?"Members updated successfully!":C?"Role created successfully!":"Role updated successfully!"),i.reset(u),n(u.role.id)},onError:u=>{ue.error(u instanceof Error?u.message:"Failed to save role")}}),I=i.handleSubmit(u=>{if(!u.role.label.trim()){ue.error("Role name is required"),i.setFocus("role.label");return}b.mutate(u)}),j=!x,S=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",R=[...x?[]:[{id:"mcp",label:"MCP Permissions"}],{id:"org",label:"Organization Permissions"},{id:"models",label:"Models"},{id:"members",label:"Members"}],[_,A]=B.useState(""),[f,N]=B.useState(!1),w=u=>{g(u),A("")},v={mcp:"Search MCP servers...",org:"Search permissions...",models:"Search models...",members:"Search members..."};return s.jsx(te,{children:s.jsxs(te.Content,{className:Q("flex flex-col",r!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(te.Title,{actions:j&&s.jsxs(s.Fragment,{children:[s.jsx(ne,{variant:"outline",size:"sm",onClick:e,disabled:b.isPending,children:"Cancel"}),s.jsx(ne,{size:"sm",onClick:I,disabled:b.isPending||!c||!T,children:b.isPending?"Saving...":h?"Create Role":"Save Changes"})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:Q("size-2.5 rounded-full shrink-0",t.kind==="builtin"?Ve(t.role,!0):t.kind==="custom"?Ve(t.role.role,!1):it(i.watch("role.label")))}),x&&s.jsx(et,{size:16,className:"text-muted-foreground shrink-0"}),h?s.jsx("input",{...i.register("role.label"),placeholder:"Role name",className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:!0}):s.jsx("span",{className:"truncate",children:S})]})}),s.jsx("div",{className:"flex items-center gap-2",children:R.map(u=>s.jsx("button",{type:"button",onClick:()=>w(u.id),className:Q("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",r===u.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:u.label},u.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Oe,{value:_,onChange:A,placeholder:v[r]??"Search...",className:"w-full md:w-[375px]"}),r==="members"&&s.jsx(Ns,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>N(!0)})]})]})}),s.jsx("div",{className:Q("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",r!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:Q(r!=="org"&&"h-full overflow-hidden",r!=="models"&&r!=="org"&&"border border-border rounded-xl bg-card"),children:[r==="mcp"&&!x&&s.jsx(Ft,{toolSet:i.watch("toolSet"),onToolSetChange:u=>i.setValue("toolSet",u,{shouldDirty:!0}),searchQuery:_}),r==="org"&&s.jsx(Zt,{allowAllStaticPermissions:i.watch("allowAllStaticPermissions"),staticPermissions:i.watch("staticPermissions"),onAllowAllChange:u=>i.setValue("allowAllStaticPermissions",u,{shouldDirty:!0}),onPermissionsChange:u=>i.setValue("staticPermissions",u,{shouldDirty:!0}),readOnly:x,searchQuery:_}),r==="models"&&s.jsx(hs,{allowAllModels:i.watch("allowAllModels"),modelSet:i.watch("modelSet"),onAllowAllChange:u=>i.setValue("allowAllModels",u,{shouldDirty:!0}),onModelSetChange:u=>i.setValue("modelSet",u,{shouldDirty:!0}),readOnly:x,searchQuery:_}),r==="members"&&s.jsx(Es,{memberIds:i.watch("memberIds"),onMemberIdsChange:u=>i.setValue("memberIds",u,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&t.role==="owner",searchQuery:_,addMemberDialogOpen:f,onAddMemberDialogOpenChange:N})]})})]})})}function js(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}const Rs=[{role:"owner",label:"Owner",color:"bg-red-500"},{role:"admin",label:"Admin",color:"bg-blue-500"},{role:"user",label:"User",color:"bg-green-500"}],Ce=["bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500"];function Os(t){if(!t)return"bg-neutral-400";let e=0;for(let l=0;l<t.length;l++){const o=t.charCodeAt(l);e=(e<<5)-e+o,e=e&e}const n=Math.abs(e)%Ce.length;return Ce[n]??Ce[0]}const vs={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function ws(t,e){return e?vs[t]??"bg-neutral-400":Os(t)}function ys(){const t=q.c(77),[e,n]=B.useState(""),[l,o]=B.useState(null),a=bt();let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},t[0]=d):d=t[0];const{role:p}=Et(d),{locator:m}=Se(),x=Re(),h=$e(),{customRoles:r,refetch:g}=Tt();let i;t[1]!==a?(i=P=>a({to:".",search:U=>({...U,role:P})}),t[1]=a,t[2]=i):i=t[2];const c=i;let T;e:{if(!p){T=null;break e}if(p==="new"){T={kind:"new"};break e}if(p.startsWith("builtin-")){T={kind:"builtin",role:p.slice(8)};break e}let P;t[3]!==p?(P=oe=>oe.id===p,t[3]=p,t[4]=P):P=t[4];const U=r.find(P);T=U?{kind:"custom",role:U}:null}const b=T;let I;t[5]!==m?(I=re.members(m),t[5]=m,t[6]=I):I=t[6];let j;t[7]!==x?(j=()=>x.organization.listMembers(),t[7]=x,t[8]=j):j=t[8];let S;t[9]!==I||t[10]!==j?(S={queryKey:I,queryFn:j},t[9]=I,t[10]=j,t[11]=S):S=t[11];const{data:R}=Ye(S);let _;t[12]!==R?.data?.members?(_=R?.data?.members??[],t[12]=R?.data?.members,t[13]=_):_=t[13];const A=_;let f;t[14]!==A?(f=P=>A.filter(U=>U.role===P).length,t[14]=A,t[15]=f):f=t[15];const N=f;let w;if(t[16]!==r||t[17]!==N||t[18]!==e){let P;t[20]!==N?(P=ie=>({kind:"builtin",role:{...ie,memberCount:N(ie.role)}}),t[20]=N,t[21]=P):P=t[21];const U=Rs.map(P);let oe;t[22]!==N?(oe=ie=>({kind:"custom",role:{...ie,memberCount:N(ie.role)}}),t[22]=N,t[23]=oe):oe=t[23];const mt=r.map(oe);if(w=[...U,...mt],e){const ie=e.toLowerCase();w=w.filter(ut=>ut.role.label.toLowerCase().includes(ie))}t[16]=r,t[17]=N,t[18]=e,t[19]=w}else w=t[19];let v;t[24]!==x?(v=async P=>{const U=await x.organization.deleteRole({roleId:P});if(U?.error)throw new Error(U.error.message);return U?.data},t[24]=x,t[25]=v):v=t[25];const u=Fe({mutationFn:v,onSuccess:(P,U)=>{je("role_deleted",{role_id:U}),h.invalidateQueries({queryKey:re.members(m)}),h.invalidateQueries({queryKey:re.organizationRoles(m)}),ue.success("Role deleted successfully!"),g(),b?.kind==="custom"&&b.role.id===U&&c(void 0)},onError:Us});let y,C,D,G;t[26]===Symbol.for("react.memo_cache_sentinel")?(G={id:"role",header:"Role",render:Gs,cellClassName:"flex-1 min-w-0",sortable:!0},y={id:"type",header:"Type",render:Ds,cellClassName:"w-28 shrink-0"},C={id:"permissions",header:"Permissions",render:ks,cellClassName:"flex-1 min-w-0"},D={id:"members",header:"Members",render:Ls,cellClassName:"w-24 shrink-0"},t[26]=y,t[27]=C,t[28]=D,t[29]=G):(y=t[26],C=t[27],D=t[28],G=t[29]);let $;t[30]===Symbol.for("react.memo_cache_sentinel")?($=[G,y,C,D,{id:"actions",header:"",render:P=>P.kind==="builtin"?null:s.jsxs(It,{children:[s.jsx(_t,{asChild:!0,children:s.jsx(ne,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ps,children:s.jsx(Ct,{size:16})})}),s.jsx(St,{align:"end",onClick:Ms,children:s.jsxs(Nt,{variant:"destructive",onClick:()=>{const U=P.role;U.id&&o({id:U.id,label:U.label})},children:[s.jsx(At,{size:16}),"Delete"]})})]}),cellClassName:"w-12 shrink-0"}],t[30]=$):$=t[30];const L=$;let V;t[31]!==c?(V=P=>{if(P.kind==="builtin")c(`builtin-${P.role.role}`);else{const U=P.role;c(U.id)}},t[31]=c,t[32]=V):V=t[32];const z=V;if(b){let P;t[33]!==c?(P=()=>c(void 0),t[33]=c,t[34]=P):P=t[34];let U;return t[35]!==g||t[36]!==c?(U=()=>{g(),c(void 0)},t[35]=g,t[36]=c,t[37]=U):U=t[37],s.jsx(Cs,{target:b,onBack:P,onSaved:U},js(b))}let O;t[38]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(te.Title,{children:"Roles"}),t[38]=O):O=t[38];let M;t[39]===Symbol.for("react.memo_cache_sentinel")?(M=P=>{P.key==="Escape"&&(n(""),P.target.blur())},t[39]=M):M=t[39];let Y;t[40]!==e?(Y=s.jsx(Oe,{value:e,onChange:n,placeholder:"Search roles...",className:"w-full md:w-[375px]",onKeyDown:M}),t[40]=e,t[41]=Y):Y=t[41];let K;t[42]!==c?(K=()=>c("new"),t[42]=c,t[43]=K):K=t[43];let J;t[44]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx(Ae,{size:16}),t[44]=J):J=t[44];let W;t[45]!==K?(W=s.jsxs(ne,{onClick:K,children:[J,"Create Role"]}),t[45]=K,t[46]=W):W=t[46];let le;t[47]!==Y||t[48]!==W?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[Y,W]}),t[47]=Y,t[48]=W,t[49]=le):le=t[49];let E;t[50]!==e?(E=e?s.jsx(ke,{title:"No roles found",description:`No roles match "${e}"`}):s.jsx(ke,{title:"No roles",description:"Create a role to get started."}),t[50]=e,t[51]=E):E=t[51];let k;t[52]!==w||t[53]!==L||t[54]!==z||t[55]!==E?(k=s.jsx(jt,{columns:L,data:w,isLoading:!1,onRowClick:z,emptyState:E}),t[52]=w,t[53]=L,t[54]=z,t[55]=E,t[56]=k):k=t[56];let F;t[57]!==le||t[58]!==k?(F=s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs("div",{className:"flex flex-col gap-6",children:[O,le,k]})})}),t[57]=le,t[58]=k,t[59]=F):F=t[59];const ee=l!==null;let H;t[60]===Symbol.for("react.memo_cache_sentinel")?(H=P=>!P&&o(null),t[60]=H):H=t[60];let Z;t[61]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx(He,{children:"Delete Role"}),t[61]=Z):Z=t[61];const X=l?.label;let ae;t[62]!==X?(ae=s.jsxs(qe,{children:[Z,s.jsxs(Ze,{children:['Are you sure you want to delete the "',X,'" role? This action cannot be undone.']})]}),t[62]=X,t[63]=ae):ae=t[63];let Te;t[64]===Symbol.for("react.memo_cache_sentinel")?(Te=s.jsx(Xe,{children:"Cancel"}),t[64]=Te):Te=t[64];let ce;t[65]!==u||t[66]!==l?(ce=s.jsxs(Je,{children:[Te,s.jsx(We,{onClick:()=>{l?.id&&u.mutate(l.id),o(null)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[65]=u,t[66]=l,t[67]=ce):ce=t[67];let de;t[68]!==ae||t[69]!==ce?(de=s.jsxs(Ke,{children:[ae,ce]}),t[68]=ae,t[69]=ce,t[70]=de):de=t[70];let me;t[71]!==ee||t[72]!==de?(me=s.jsx(Qe,{open:ee,onOpenChange:H,children:de}),t[71]=ee,t[72]=de,t[73]=me):me=t[73];let Ie;return t[74]!==F||t[75]!==me?(Ie=s.jsxs(te,{children:[F,me]}),t[74]=F,t[75]=me,t[76]=Ie):Ie=t[76],Ie}function Ms(t){return t.stopPropagation()}function Ps(t){return t.stopPropagation()}function Ls(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function ks(t){if(t.kind==="builtin")return t.role.role==="owner"||t.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:"Full access"}):s.jsx("span",{className:"text-sm text-muted-foreground",children:"Basic access"});const e=t.role,n=[];return e.allowsAllStaticPermissions?n.push("Full org access"):e.staticPermissionCount&&e.staticPermissionCount>0&&n.push(`${e.staticPermissionCount} org perm${e.staticPermissionCount!==1?"s":""}`),e.allowsAllConnections?n.push("All connections"):e.connectionCount&&e.connectionCount>0&&n.push(`${e.connectionCount} connection${e.connectionCount!==1?"s":""}`),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:n.length>0?n.join(", "):"No permissions"})}function Ds(t){return t.kind==="builtin"?s.jsx(fe,{variant:"secondary",className:"text-xs",children:"Built-in"}):s.jsx(fe,{variant:"outline",className:"text-xs",children:"Custom"})}function Gs(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:Q("size-2.5 rounded-full shrink-0",ws(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(et,{size:12,className:"text-muted-foreground shrink-0"})]})}function Us(t,e){je("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),ue.error(t instanceof Error?t.message:"Failed to delete role")}function sl(){const t=q.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load roles"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(pt,{fallback:e,children:s.jsx(B.Suspense,{fallback:s.jsx(te,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(ys,{})})}),t[1]=n):n=t[1],n}export{sl as default};
|