decocms 4.131.2 → 4.131.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Dkv2twCy.js → AlertCircle-XYVipozu.js} +1 -1
- package/dist/client/assets/{AreaChart-Drb-WBuc.js → AreaChart-DxhXVk5N.js} +1 -1
- package/dist/client/assets/{ArrowRight-D1F_c8mU.js → ArrowRight-BwYEG81b.js} +1 -1
- package/dist/client/assets/{ArrowUp-CfejN6kE.js → ArrowUp-l-QJZJVq.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-pyqwDg-l.js → ArrowUpRight-Dzxf-lpo.js} +1 -1
- package/dist/client/assets/{Check-Du2CH0Qx.js → Check-BQap7Cpe.js} +1 -1
- package/dist/client/assets/{CheckCircle-pc0wi1b4.js → CheckCircle-CpszjLbT.js} +1 -1
- package/dist/client/assets/{ChevronDown-CIPwphYr.js → ChevronDown-BNTAvoWs.js} +1 -1
- package/dist/client/assets/{ChevronRight-bpU9x4EL.js → ChevronRight-C4GCxTzK.js} +1 -1
- package/dist/client/assets/{ChevronUp-f9GdHpvo.js → ChevronUp-CMJpp_7f.js} +1 -1
- package/dist/client/assets/{Copy01-DBHRmMgp.js → Copy01-D_SKj3JY.js} +1 -1
- package/dist/client/assets/{DotsVertical-Dl3GV1z7.js → DotsVertical-DtxqOkQ-.js} +1 -1
- package/dist/client/assets/{Eye-pDXTSR_y.js → Eye-DDei6OvA.js} +1 -1
- package/dist/client/assets/{FilterLines-BFWPoe09.js → FilterLines-CdZmlIa2.js} +1 -1
- package/dist/client/assets/{HardDrive-BCPMH3VT.js → HardDrive-D5AmniWG.js} +1 -1
- package/dist/client/assets/{Key01-CBwzTn3B.js → Key01-BTOQ7Hsi.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CWKaiAHc.js → LayoutLeft-DAco-6YX.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DsH5I9jm.js → LinkExternal01-BAWgpdxG.js} +1 -1
- package/dist/client/assets/{LogOut01-YgIKEMFw.js → LogOut01-N3kqZQ5B.js} +1 -1
- package/dist/client/assets/{Monitor01-q2Qybp9B.js → Monitor01--AULmP_e.js} +1 -1
- package/dist/client/assets/{Palette-BY72GXhm.js → Palette-Dr6-9ADN.js} +1 -1
- package/dist/client/assets/{Play-9D0sdMED.js → Play-CwRG1pgT.js} +1 -1
- package/dist/client/assets/{Plus-1ztWOFkn.js → Plus-Dc9c0aJB.js} +1 -1
- package/dist/client/assets/{SearchLg-CBRhPi_g.js → SearchLg-CI2UWBkb.js} +1 -1
- package/dist/client/assets/{SearchMd-CoeKfSSe.js → SearchMd-BnuXOyI2.js} +1 -1
- package/dist/client/assets/{Settings02-Dvu63VK8.js → Settings02-kFO_alvx.js} +1 -1
- package/dist/client/assets/{Shield01-ByBFJvxc.js → Shield01-BltVbqU-.js} +1 -1
- package/dist/client/assets/{Star01-B1Kn4-_i.js → Star01-CS45XDsX.js} +1 -1
- package/dist/client/assets/{Stars01-DpgpdjJr.js → Stars01-DkHEjXrS.js} +1 -1
- package/dist/client/assets/{Stars02-D9_55K26.js → Stars02-DW1aL9Gv.js} +1 -1
- package/dist/client/assets/{Sun-DMtwJS6D.js → Sun-1O9WSrfQ.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BAtdmOhb.js → SwitchHorizontal01-DRF2ZDDF.js} +1 -1
- package/dist/client/assets/{Tool01-DMFHdvqO.js → Tool01-DgbxCa0X.js} +1 -1
- package/dist/client/assets/{Tool02-CCso8U2x.js → Tool02-C2mcM2YH.js} +1 -1
- package/dist/client/assets/{Trash01-CTHwttyB.js → Trash01-i0AMIXBp.js} +1 -1
- package/dist/client/assets/{TrendUp01-CnWDWhEF.js → TrendUp01-UqSus9sN.js} +1 -1
- package/dist/client/assets/{Upload01-BY9ftwcq.js → Upload01-DdttVKpO.js} +1 -1
- package/dist/client/assets/{User01-BTBcFc9z.js → User01-BcNtSYpD.js} +1 -1
- package/dist/client/assets/{Users01-Cql_e-31.js → Users01-Dqmzv5Fm.js} +1 -1
- package/dist/client/assets/{Users03-o-LyclnZ.js → Users03-Da6s5Xm-.js} +1 -1
- package/dist/client/assets/{X-DsUhkCER.js → X-BZ-Qrql-.js} +1 -1
- package/dist/client/assets/{XCircle-qpPGG1wt.js → XCircle-CrKimoYU.js} +1 -1
- package/dist/client/assets/{XClose-B6aD5HLV.js → XClose-BHqSO9Fx.js} +1 -1
- package/dist/client/assets/{Zap-u5rNKW8G.js → Zap-Bf6OTD9_.js} +1 -1
- package/dist/client/assets/{ZapSquare-qUxPDGDu.js → ZapSquare-C8CgHzT1.js} +1 -1
- package/dist/client/assets/{access-gate-CKUKLx71.js → access-gate-CVZr_K21.js} +1 -1
- package/dist/client/assets/{add-section-modal-dEKzXkSV.js → add-section-modal-CtCNzcu7.js} +1 -1
- package/dist/client/assets/{agent-icon-Cn-zdV8E.js → agent-icon-DRGNhHDy.js} +1 -1
- package/dist/client/assets/{agents-list-CIQknPiT.js → agents-list-DC5obzzN.js} +1 -1
- package/dist/client/assets/{ai-providers-pcs4cL5s.js → ai-providers-DtiBdGh6.js} +1 -1
- package/dist/client/assets/{alert-BrYvcVNo.js → alert-BR6d3rCa.js} +1 -1
- package/dist/client/assets/{alert-dialog-DdeUN0gs.js → alert-dialog-vMeKz1oj.js} +1 -1
- package/dist/client/assets/{app-editor-BokdYxzt.js → app-editor-6cg9gJwt.js} +1 -1
- package/dist/client/assets/{auth-DxnCXfEr.js → auth-CjPDmXKg.js} +1 -1
- package/dist/client/assets/{auth-catchall-CfgT5x1l.js → auth-catchall-D_PecNHj.js} +1 -1
- package/dist/client/assets/{auth-entry-z-RVgErJ.js → auth-entry-BoU-R1kT.js} +1 -1
- package/dist/client/assets/{auth-split-layout-RjHJpu_H.js → auth-split-layout-BkllSNUH.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BgQP48Df.js → authenticate-and-persist-oauth-CMEBdT9l.js} +1 -1
- package/dist/client/assets/{automation-list-row-BgQ-Sntx.js → automation-list-row-a4o0Za57.js} +1 -1
- package/dist/client/assets/{automation-runs-DJHP3Ebd.js → automation-runs-B0tfP751.js} +1 -1
- package/dist/client/assets/{automations-GH1d56mw.js → automations-C215sLZS.js} +1 -1
- package/dist/client/assets/{avatar-CtA1rHBR.js → avatar-ABBG4Zys.js} +1 -1
- package/dist/client/assets/{badge-DLw-128i.js → badge-DHX2ckQi.js} +1 -1
- package/dist/client/assets/{block-document-BJX5tnOk.js → block-document-BpJ7OMsm.js} +1 -1
- package/dist/client/assets/{brand-context-DkvpqsQ8.js → brand-context-DvgxrNhD.js} +1 -1
- package/dist/client/assets/{buckets-DwZxLwtb.js → buckets-C4DdXxfh.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-BRjHEgsf.js → bulk-category-panel-UScNnMYp.js} +1 -1
- package/dist/client/assets/{calendar-DDOXvi9j.js → calendar-BId5Ov_D.js} +1 -1
- package/dist/client/assets/{capability-load-error-BSRBDTUF.js → capability-load-error-B9ewQDHI.js} +1 -1
- package/dist/client/assets/{card-C_7Dfz9P.js → card-CpyAPk4W.js} +1 -1
- package/dist/client/assets/{category-editor-Q5uFZ0SW.js → category-editor-QJgu0Oa6.js} +1 -1
- package/dist/client/assets/{chat-context-DcyOF_pB.js → chat-context-BrrGaGbH.js} +1 -1
- package/dist/client/assets/{checkbox-CTh8EHLV.js → checkbox-Dyd2bOG3.js} +1 -1
- package/dist/client/assets/{cli-auth-success-wvSiqOx7.js → cli-auth-success-CvuXLOuX.js} +1 -1
- package/dist/client/assets/{collection-detail-BGIhyphq.js → collection-detail-DHixVrfP.js} +1 -1
- package/dist/client/assets/{collection-display-button-BK6TSoeX.js → collection-display-button-VXR-qfSN.js} +1 -1
- package/dist/client/assets/{collection-search-CgPrJD5s.js → collection-search-BXUxGpkT.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BBK5Zjn2.js → collection-table-wrapper-DrsWOFMV.js} +1 -1
- package/dist/client/assets/{collection-tabs-DQPFhmJa.js → collection-tabs-CrFDWpQo.js} +1 -1
- package/dist/client/assets/{command-mkWdNJiA.js → command-p71imMWZ.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-Bs7-iua6.js → commerce-onboarding-DeCCW2Vu.js} +1 -1
- package/dist/client/assets/{companions-core-CCmjJd5y.js → companions-core-BqqXlbWe.js} +1 -1
- package/dist/client/assets/{connect-BteNxC1u.js → connect-DncRr4DD.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-DCNWmwTZ.js → connect-desktop-dialog-CpDi9jEG.js} +1 -1
- package/dist/client/assets/{connection-CaaVbqW9.js → connection-DWdqWsqN.js} +1 -1
- package/dist/client/assets/{connection-card-5582YW8P.js → connection-card-BNd9VNGL.js} +1 -1
- package/dist/client/assets/{connection-detail-XbVgn9MH.js → connection-detail-rsDLNcvr.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-CmY0Q2Uk.js → connection-form-helpers-BRVXGHSF.js} +1 -1
- package/dist/client/assets/{connections-BXNw1IKw.js → connections-NIph2LCs.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-qYgFQjLn.js → decopilot-sse-pool-CSHbnCTw.js} +1 -1
- package/dist/client/assets/{dialog-DRzTNCF2.js → dialog-DgVuLqhS.js} +1 -1
- package/dist/client/assets/{domain-settings-DHJNEbEZ.js → domain-settings-BMc1ZlT9.js} +1 -1
- package/dist/client/assets/{drawer-SsJOHRPA.js → drawer-BAKGed9i.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BokfpNru.js → dropdown-menu-X5GaQfkB.js} +1 -1
- package/dist/client/assets/{empty-state-CiJvvnog.js → empty-state-BTI0jRLN.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Br5Lsj7z.js → extract-connection-data-y9r-PxK0.js} +1 -1
- package/dist/client/assets/{file-explorer-BzAb8PtM.js → file-explorer-DiRIjdTO.js} +1 -1
- package/dist/client/assets/{form-CQNziZWc.js → form-BSs_Wcc9.js} +1 -1
- package/dist/client/assets/{general-Ch6aAbGc.js → general-Q0eMdHbb.js} +1 -1
- package/dist/client/assets/{github-repo-picker-pUO4-UP7.js → github-repo-picker-BcZWgRSG.js} +1 -1
- package/dist/client/assets/{hooks-CAzZfDok.js → hooks-CSzZamSr.js} +1 -1
- package/dist/client/assets/{index-TW5Rc09W.js → index-B9w5ivBW.js} +1 -1
- package/dist/client/assets/{index-CJRST3_Z.js → index-BPUDtemx.js} +5 -5
- package/dist/client/assets/{index-DX_PyEaT.js → index-BYJD8VZD.js} +1 -1
- package/dist/client/assets/{index-DoQWemFd.js → index-CN6o24P1.js} +3 -3
- package/dist/client/assets/{index-Da2mllxf.js → index-ClYqgXfK.js} +1 -1
- package/dist/client/assets/{index-CcuY69gd.js → index-CnMgWn6h.js} +1 -1
- package/dist/client/assets/{index-B5Nibhwf.js → index-D_hlfh5m.js} +1 -1
- package/dist/client/assets/{index-D3OCvKaU.js → index-DnHWblfu.js} +3 -3
- package/dist/client/assets/{index-CCb4vxYi.js → index-R7we9WNO.js} +1 -1
- package/dist/client/assets/{index-L0hE-NEv.js → index-TcWD9It_.js} +1 -1
- package/dist/client/assets/{index-DeO_SMjA.js → index-rNfPhyEe.js} +1 -1
- package/dist/client/assets/{index-redirect-R3JpdyEK.js → index-redirect-B3exj8gg.js} +1 -1
- package/dist/client/assets/{input-Bs4tcVhT.js → input-BKgQbLb7.js} +1 -1
- package/dist/client/assets/{integration-icon-DG6YOOMj.js → integration-icon-Buz6Jy4-.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-DH3jQ_Zb.js → invite-member-dialog-DHospCr-.js} +1 -1
- package/dist/client/assets/{label-DUiPU4TM.js → label-vQvzd2f4.js} +1 -1
- package/dist/client/assets/{layout-DQcUE9z4.js → layout-D1eS19nu.js} +1 -1
- package/dist/client/assets/{login-B9FnuorL.js → login-CV8LNv90.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CVKUYIl9.js → mcp-oauth-DdhiCVGm.js} +1 -1
- package/dist/client/assets/{members-BfVc1Xdw.js → members-B-8bNCz9.js} +1 -1
- package/dist/client/assets/{monaco-editor-G_cJDJ93.js → monaco-editor-CB-Jx900.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BxRM7k9X.js → monitoring-stats-row-D1IsIC5b.js} +1 -1
- package/dist/client/assets/{multi-select-CXzg904j.js → multi-select-siQWidPq.js} +1 -1
- package/dist/client/assets/{oauth-callback-TGwV85BQ.js → oauth-callback-DFzc2Man.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-PgVBkiBN.js → oauth-callback-ai-provider-D5wGdFe8.js} +1 -1
- package/dist/client/assets/{onboarding-DdQNQ4A0.js → onboarding-4x8bdTEE.js} +1 -1
- package/dist/client/assets/{org-install-DAHfRxpD.js → org-install-DaXiGcuv.js} +1 -1
- package/dist/client/assets/{org-layout-CRo4EKIA.js → org-layout-gnhpwzYn.js} +1 -1
- package/dist/client/assets/{organization-choice-CvVH3S_L.js → organization-choice-xe5P_CBM.js} +1 -1
- package/dist/client/assets/{orgs--E_IaGAZ.js → orgs-DKLE5wTt.js} +1 -1
- package/dist/client/assets/{page-seo-form-CJ3NlYkD.js → page-seo-form-CpN8zrtu.js} +1 -1
- package/dist/client/assets/{popover-DqHD4yxd.js → popover-CVp_epYO.js} +1 -1
- package/dist/client/assets/{post-editor-BABr2CJx.js → post-editor-WInb3hhw.js} +1 -1
- package/dist/client/assets/{primitives-DqZjRnu7.js → primitives-DUyfIrNL.js} +1 -1
- package/dist/client/assets/{profile-BdUjk22-.js → profile-DaHHfvaG.js} +1 -1
- package/dist/client/assets/project-app-view-ScyHaVrd.js +1 -0
- package/dist/client/assets/record-editor-C6uQXE53.js +1 -0
- package/dist/client/assets/{redirect-editor-DFcl2X7j.js → redirect-editor-lC0dYN7C.js} +1 -1
- package/dist/client/assets/registry-COiCjfcj.js +2 -0
- package/dist/client/assets/{registry-layout-DGnc-Dtp.js → registry-layout-Cq1dxSDY.js} +1 -1
- package/dist/client/assets/{reports-hna_6ROV.js → reports-DWR1-tvR.js} +1 -1
- package/dist/client/assets/{require-capability-BYjfZMZ1.js → require-capability-E_Dah2u4.js} +1 -1
- package/dist/client/assets/{required-auth-layout-B9TfjBVw.js → required-auth-layout-CPjb3C6W.js} +1 -1
- package/dist/client/assets/{reset-password-twiesJde.js → reset-password-DMWHI75_.js} +1 -1
- package/dist/client/assets/{roles-DT5JKVI3.js → roles-D-8mHCVX.js} +1 -1
- package/dist/client/assets/{search-input-Ce9IROHU.js → search-input-BsjySTQb.js} +1 -1
- package/dist/client/assets/{secrets-DluwaWyV.js → secrets-kx0xefS3.js} +1 -1
- package/dist/client/assets/{sections-editor-DwLNB7L7.js → sections-editor-MsZlD81r.js} +1 -1
- package/dist/client/assets/{select-CPtJAf28.js → select-g0E4j9Tt.js} +1 -1
- package/dist/client/assets/{select-model-D7Ovd4CR.js → select-model-RA4tH7cK.js} +1 -1
- package/dist/client/assets/{self-tool-result-JL1AnTkc.js → self-tool-result-BZrmfYIi.js} +1 -1
- package/dist/client/assets/{seo-editor-BrV87B5V.js → seo-editor-DuuAhCLw.js} +1 -1
- package/dist/client/assets/{settings-layout-7SeTok6D.js → settings-layout-CHrgf1OR.js} +1 -1
- package/dist/client/assets/{settings-section-Dgg5nCua.js → settings-section-DysjSOio.js} +1 -1
- package/dist/client/assets/{shell-controls-CPbdWqkG.js → shell-controls-D9KipuzZ.js} +1 -1
- package/dist/client/assets/{shell-layout-BexOLm1f.js → shell-layout-BBtwtRs8.js} +1 -1
- package/dist/client/assets/{sidebar-BjYwCtXi.js → sidebar-DCTvELfP.js} +1 -1
- package/dist/client/assets/{skeleton-BwfY4sYC.js → skeleton-CQ4Si4tx.js} +1 -1
- package/dist/client/assets/{sso-v56tNQF7.js → sso-CJ8qNqdV.js} +1 -1
- package/dist/client/assets/{store-LUDpSYn5.js → store-Bdlu_O_k.js} +1 -1
- package/dist/client/assets/store-registry-LydU-3AV.js +2 -0
- package/dist/client/assets/{studio-tools-D5UPG7xq.js → studio-tools-1de_48yn.js} +1 -1
- package/dist/client/assets/{switch-Br6uEAbX.js → switch-BTk8KHX6.js} +1 -1
- package/dist/client/assets/{tab-id-YHtlg7gF.js → tab-id-Ckd-ZAMH.js} +1 -1
- package/dist/client/assets/{table-Ciw0rD4-.js → table-CLLWCOW2.js} +1 -1
- package/dist/client/assets/{tabs-BvhudmcJ.js → tabs-D4j_u8lp.js} +1 -1
- package/dist/client/assets/{textarea-dx3oQXX3.js → textarea-CDJ9hAiD.js} +1 -1
- package/dist/client/assets/{toggle-group-BQ-mtOqg.js → toggle-group-BQ95Mzlw.js} +1 -1
- package/dist/client/assets/{toolbar-Ba5XXE-M.js → toolbar-n9I75ths.js} +1 -1
- package/dist/client/assets/{tooltip-DrF8Dycy.js → tooltip-44-2qw6b.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BiLZ6IzA.js → use-ai-providers-CuhkQheE.js} +1 -1
- package/dist/client/assets/{use-api-keys-BMxSi9Mc.js → use-api-keys-D9GX3AqG.js} +1 -1
- package/dist/client/assets/{use-automations-BoP3NYfz.js → use-automations-DOYrLfym.js} +1 -1
- package/dist/client/assets/{use-autosave-DVJxzXG6.js → use-autosave-BkiPj2IU.js} +1 -1
- package/dist/client/assets/{use-capability-hQ0DXv0z.js → use-capability-ZuDMV8i_.js} +1 -1
- package/dist/client/assets/{use-clock-tick-2gdnxIz7.js → use-clock-tick-CF-fW2XN.js} +1 -1
- package/dist/client/assets/{use-connection-BqPnQoRJ.js → use-connection-DNsAtxSX.js} +1 -1
- package/dist/client/assets/{use-copy-D32fta2h.js → use-copy-DVkJpNIE.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BM65v9ER.js → use-create-virtual-mcp-BLDf0ux0.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-3BGJnmLE.js → use-debounced-autosave-rKGkta2N.js} +1 -1
- package/dist/client/assets/{use-debounced-value-B5eH48Lw.js → use-debounced-value-DOFpGJrU.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BzZz8lBr.js → use-deco-credits-nxiVRyXd.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CF5TQ0kC.js → use-decopilot-events-JMTJZeEq.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CSsIa0wR.js → use-delete-connection-pIo0CZXk.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Do0J3fTo.js → use-deployment-admin-CdE4vCx5.js} +1 -1
- package/dist/client/assets/{use-file-configs-Bw1gACmS.js → use-file-configs-BLfsI3Gb.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CLgVcggv.js → use-infinite-scroll-68HpgFc8.js} +1 -1
- package/dist/client/assets/{use-join-requests-CLtr7l1c.js → use-join-requests-KtkcCBVT.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CuDIWjse.js → use-mcp-auth-status-BW-U_Pa6.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DBBu3lpa.js → use-mcp-client-BG7zveIM.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BKx6eQVH.js → use-mcp-tools-DjATUgKD.js} +1 -1
- package/dist/client/assets/{use-members-C1XPdRpt.js → use-members-UKyPZaKn.js} +1 -1
- package/dist/client/assets/{use-mobile-B9xC4LZs.js → use-mobile-ChN0uU-Y.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-B_NFjN6b.js → use-navigate-to-agent-_n3ZB1G-.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BFAUjn-N.js → use-org-auth-client-XykIzcR9.js} +1 -1
- package/dist/client/assets/{use-org-sso-Dx0HxB9Q.js → use-org-sso-C30Nyt4K.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Cw7KjQX3.js → use-organization-roles-YvhVsU1D.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BZ_WlMTx.js → use-organization-settings-Bbc0ktBM.js} +1 -1
- package/dist/client/assets/{use-registry-app-D7Jfc22S.js → use-registry-app-D6fcGueu.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CxLWLJ5V.js → use-registry-connections-CqQgIUl7.js} +1 -1
- package/dist/client/assets/{use-secrets-DmXwh72p.js → use-secrets-C8uvAtFz.js} +1 -1
- package/dist/client/assets/{use-status-sounds-1iMDr_3s.js → use-status-sounds-u5bruqG0.js} +1 -1
- package/dist/client/assets/{use-view-mode-BgyziSsp.js → use-view-mode-Z33nLYON.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Bymtbi-1.js → use-virtual-mcp-D6qbeGCA.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BuKAKdDO.js +1 -0
- package/dist/client/assets/{useQueries-B_FHAwLH.js → useQueries-BkQg5qxY.js} +1 -1
- package/dist/client/assets/{useRouterState-xO3EhEgx.js → useRouterState-Cx-iKGeP.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-n2PIbfd5.js +1 -0
- package/dist/client/assets/{users-C0hZEUyz.js → users-B69hvHRd.js} +1 -1
- package/dist/client/assets/{variant-calendar-DqDgry3x.js → variant-calendar-CjUxdkHi.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-C6H1y3Fg.js → view-mode-toggle-CG5EKfFg.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +275 -275
- package/dist/server/server.js +197 -197
- package/package.json +1 -1
- package/dist/client/assets/project-app-view-N89P5i_H.js +0 -1
- package/dist/client/assets/record-editor-BGUbMaDe.js +0 -1
- package/dist/client/assets/registry-ohfLJ5M4.js +0 -2
- package/dist/client/assets/store-registry-BRGh_j8X.js +0 -2
- package/dist/client/assets/useInfiniteQuery-Cth5f35D.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-C_27-SXB.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,j as c,ay as M,aF as Q,aB as J,cO as Z,aC as H,cP as ee,aE as C,bD as $,cQ as te,cR as G,cS as oe,cT as re,aA as ne,cU as se,cV as ae,c as j,m as ie}from"./index-
|
|
1
|
+
import{r as a,j as c,ay as M,aF as Q,aB as J,cO as Z,aC as H,cP as ee,aE as C,bD as $,cQ as te,cR as G,cS as oe,cT as re,aA as ne,cU as se,cV as ae,c as j,m as ie}from"./index-DnHWblfu.js";var le=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ce="VisuallyHidden",V=a.forwardRef((o,e)=>c.jsx(M.span,{...o,ref:e,style:{...le,...o.style}}));V.displayName=ce;var ue=V,[O]=ne("Tooltip",[G]),D=G(),F="TooltipProvider",de=700,A="tooltip.open",[pe,k]=O(F),z=o=>{const{__scopeTooltip:e,delayDuration:t=de,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=o,l=a.useRef(!0),d=a.useRef(!1),i=a.useRef(0);return a.useEffect(()=>{const p=i.current;return()=>window.clearTimeout(p)},[]),c.jsx(pe,{scope:e,isOpenDelayedRef:l,delayDuration:t,onOpen:a.useCallback(()=>{window.clearTimeout(i.current),l.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:a.useCallback(p=>{d.current=p},[]),disableHoverableContent:n,children:s})};z.displayName=F;var R="Tooltip",[fe,_]=O(R),B=o=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:d}=o,i=k(R,o.__scopeTooltip),p=D(e),[u,v]=a.useState(null),x=Q(),f=a.useRef(0),h=l??i.disableHoverableContent,T=d??i.delayDuration,g=a.useRef(!1),[y,m]=J({prop:r,defaultProp:n??!1,onChange:I=>{I?(i.onOpen(),document.dispatchEvent(new CustomEvent(A))):i.onClose(),s?.(I)},caller:R}),w=a.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),E=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,m(!0)},[m]),P=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,m(!1)},[m]),S=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,m(!0),f.current=0},T)},[T,m]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),c.jsx(Z,{...p,children:c.jsx(fe,{scope:e,contentId:x,open:y,stateAttribute:w,trigger:u,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{i.isOpenDelayedRef.current?S():E()},[i.isOpenDelayedRef,S,E]),onTriggerLeave:a.useCallback(()=>{h?P():(window.clearTimeout(f.current),f.current=0)},[P,h]),onOpen:E,onClose:P,disableHoverableContent:h,children:t})})};B.displayName=R;var L="TooltipTrigger",U=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=_(L,t),s=k(L,t),l=D(t),d=a.useRef(null),i=H(e,d,n.onTriggerChange),p=a.useRef(!1),u=a.useRef(!1),v=a.useCallback(()=>p.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),c.jsx(ee,{asChild:!0,...l,children:c.jsx(M.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:C(o.onPointerMove,x=>{x.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),u.current=!0)}),onPointerLeave:C(o.onPointerLeave,()=>{n.onTriggerLeave(),u.current=!1}),onPointerDown:C(o.onPointerDown,()=>{n.open&&n.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:C(o.onFocus,()=>{p.current||n.onOpen()}),onBlur:C(o.onBlur,n.onClose),onClick:C(o.onClick,n.onClose)})})});U.displayName=L;var N="TooltipPortal",[ve,xe]=O(N,{forceMount:void 0}),Y=o=>{const{__scopeTooltip:e,forceMount:t,children:r,container:n}=o,s=_(N,e);return c.jsx(ve,{scope:e,forceMount:t,children:c.jsx($,{present:t||s.open,children:c.jsx(te,{asChild:!0,container:n,children:r})})})};Y.displayName=N;var b="TooltipContent",q=a.forwardRef((o,e)=>{const t=xe(b,o.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=o,l=_(b,o.__scopeTooltip);return c.jsx($,{present:r||l.open,children:l.disableHoverableContent?c.jsx(W,{side:n,...s,ref:e}):c.jsx(he,{side:n,...s,ref:e})})}),he=a.forwardRef((o,e)=>{const t=_(b,o.__scopeTooltip),r=k(b,o.__scopeTooltip),n=a.useRef(null),s=H(e,n),[l,d]=a.useState(null),{trigger:i,onClose:p}=t,u=n.current,{onPointerInTransitChange:v}=r,x=a.useCallback(()=>{d(null),v(!1)},[v]),f=a.useCallback((h,T)=>{const g=h.currentTarget,y={x:h.clientX,y:h.clientY},m=ye(y,g.getBoundingClientRect()),w=Ce(y,m),E=be(T.getBoundingClientRect()),P=Ee([...w,...E]);d(P),v(!0)},[v]);return a.useEffect(()=>()=>x(),[x]),a.useEffect(()=>{if(i&&u){const h=g=>f(g,u),T=g=>f(g,i);return i.addEventListener("pointerleave",h),u.addEventListener("pointerleave",T),()=>{i.removeEventListener("pointerleave",h),u.removeEventListener("pointerleave",T)}}},[i,u,f,x]),a.useEffect(()=>{if(l){const h=T=>{const g=T.target,y={x:T.clientX,y:T.clientY},m=i?.contains(g)||u?.contains(g),w=!we(y,l);m?x():w&&(x(),p())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[i,u,l,p,x]),c.jsx(W,{...o,ref:s})}),[ge,Te]=O(R,{isInside:!1}),me=se("TooltipContent"),W=a.forwardRef((o,e)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...d}=o,i=_(b,t),p=D(t),{onClose:u}=i;return a.useEffect(()=>(document.addEventListener(A,u),()=>document.removeEventListener(A,u)),[u]),a.useEffect(()=>{if(i.trigger){const v=x=>{x.target?.contains(i.trigger)&&u()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[i.trigger,u]),c.jsx(oe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:u,children:c.jsxs(re,{"data-state":i.stateAttribute,...p,...d,ref:e,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(me,{children:r}),c.jsx(ge,{scope:t,isInside:!0,children:c.jsx(ue,{id:i.contentId,role:"tooltip",children:n||r})})]})})});q.displayName=b;var X="TooltipArrow",K=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=D(t);return Te(X,t).isInside?null:c.jsx(ae,{...n,...r,ref:e})});K.displayName=X;function ye(o,e){const t=Math.abs(e.top-o.y),r=Math.abs(e.bottom-o.y),n=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ce(o,e,t=5){const r=[];switch(e){case"top":r.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":r.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":r.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":r.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return r}function be(o){const{top:e,right:t,bottom:r,left:n}=o;return[{x:n,y:e},{x:t,y:e},{x:t,y:r},{x:n,y:r}]}function we(o,e){const{x:t,y:r}=o;let n=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const d=e[s],i=e[l],p=d.x,u=d.y,v=i.x,x=i.y;u>r!=x>r&&t<(v-p)*(r-u)/(x-u)+p&&(n=!n)}return n}function Ee(o){const e=o.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),Pe(e)}function Pe(o){if(o.length<=1)return o.slice();const e=[];for(let r=0;r<o.length;r++){const n=o[r];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const t=[];for(let r=o.length-1;r>=0;r--){const n=o[r];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var Re=z,_e=B,je=U,Oe=Y,De=q,Ae=K;function Le(o){const e=j.c(6);let t,r;e[0]!==o?({delayDuration:r,...t}=o,e[0]=o,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==t?(s=c.jsx(Re,{"data-slot":"tooltip-provider",delayDuration:n,...t}),e[3]=n,e[4]=t,e[5]=s):s=e[5],s}function Ne(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(Le,{children:c.jsx(_e,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=r):r=e[3],r}function Se(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(je,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function Ie(o){const e=j.c(13);let t,r,n,s;e[0]!==o?({className:r,sideOffset:s,children:t,...n}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=s):(t=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let d;e[5]!==r?(d=ie("notranslate bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=d):d=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(Ae,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=i):i=e[7];let p;return e[8]!==t||e[9]!==n||e[10]!==l||e[11]!==d?(p=c.jsx(Oe,{children:c.jsxs(De,{"data-slot":"tooltip-content",sideOffset:l,translate:"no",className:d,...n,children:[t,i]})}),e[8]=t,e[9]=n,e[10]=l,e[11]=d,e[12]=p):p=e[12],p}export{Se as T,le as V,Ie as a,Le as b,Ne as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,F as f,x as P,K as m,n as K}from"./index-
|
|
1
|
+
import{c as d,F as f,x as P,K as m,n as K}from"./index-DnHWblfu.js";import{u as S,c as T}from"./studio-tools-1de_48yn.js";function g(s,e){return{queryKey:m.aiProviderKeys(e),staleTime:6e4,queryFn:async()=>await T(s,"AI_PROVIDER_KEY_LIST",{})}}function R(){const s=d.c(7),{org:e}=f(),o=S();let i;s[0]!==e.id?(i=m.aiProviders(e.id),s[0]=e.id,s[1]=i):i=s[1];let t;s[2]!==o?(t=async()=>await o.call("AI_PROVIDERS_LIST",{}),s[2]=o,s[3]=t):t=s[3];let l;s[4]!==i||s[5]!==t?(l={queryKey:i,staleTime:1/0,queryFn:t},s[4]=i,s[5]=t,s[6]=l):l=s[6];const{data:n}=P(l);return n}function p(){const s=d.c(5),{org:e}=f();let o;s[0]!==e.id||s[1]!==e.slug?(o=g(e.slug,e.id),s[0]=e.id,s[1]=e.slug,s[2]=o):o=s[2];const{data:i}=P(o);let t;return s[3]!==i?.keys?(t=i?.keys??[],s[3]=i?.keys,s[4]=t):t=s[4],t}function q(s){const e=d.c(15),{org:o}=f(),i=S();let t;e[0]!==s||e[1]!==o.id?(t=m.aiProviderModels(o.id,s??""),e[0]=s,e[1]=o.id,e[2]=t):t=e[2];const l=!!s;let n;e[3]!==s||e[4]!==i?(n=async()=>await i.call("AI_PROVIDERS_LIST_MODELS",{keyId:s??""}),e[3]=s,e[4]=i,e[5]=n):n=e[5];let r;e[6]!==t||e[7]!==l||e[8]!==n?(r={queryKey:t,enabled:l,staleTime:6e4,queryFn:n},e[6]=t,e[7]=l,e[8]=n,e[9]=r):r=e[9];const{data:a,isLoading:_}=K(r);let u;e[10]!==a?.models?(u=a?.models??[],e[10]=a?.models,e[11]=u):u=e[11];const y=!!s&&_;let c;return e[12]!==u||e[13]!==y?(c={models:u,isLoading:y},e[12]=u,e[13]=y,e[14]=c):c=e[14],c}function A(s){const e=d.c(11),{org:o}=f(),i=S();let t;e[0]!==s||e[1]!==o.id?(t=m.aiProviderModels(o.id,s),e[0]=s,e[1]=o.id,e[2]=t):t=e[2];let l;e[3]!==s||e[4]!==i?(l=async()=>await i.call("AI_PROVIDERS_LIST_MODELS",{keyId:s}),e[3]=s,e[4]=i,e[5]=l):l=e[5];let n;e[6]!==t||e[7]!==l?(n={queryKey:t,staleTime:6e4,queryFn:l},e[6]=t,e[7]=l,e[8]=n):n=e[8];const{data:r}=P(n);let a;return e[9]!==r?.models?(a=r?.models??[],e[9]=r?.models,e[10]=a):a=e[10],a}export{q as a,R as b,A as c,p as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,F as d,o as p,e as w,K as g,n as I}from"./index-
|
|
1
|
+
import{c,F as d,o as p,e as w,K as g,n as I}from"./index-DnHWblfu.js";import{S as m,u as f}from"./use-mcp-client-BG7zveIM.js";function K(){return(typeof window>"u"?"":window.location.hostname||"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"studio"}function C(e){return`${typeof window>"u"?"http://localhost:3000":window.location.origin}/api/${e}/mcp/self`}function h(e,t){return`claude mcp add --transport http --scope user ${K()} ${C(e)} --header "Authorization: Bearer ${t}"`}function y(e,t){if(e?.isError)throw new Error(e.content?.[0]?.text??t);if(!e.structuredContent)throw new Error(t);return e.structuredContent}function S(){const e=c.c(10),{org:t}=d();let s;e[0]!==t.id||e[1]!==t.slug?(s={connectionId:m,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=s):s=e[2];const r=f(s);let o;e[3]!==t.id?(o=g.apiKeysList(t.id),e[3]=t.id,e[4]=o):o=e[4];let n;e[5]!==r?(n=async()=>{const l=await r.callTool({name:"API_KEY_LIST",arguments:{}});return y(l,"Failed to list API keys").items},e[5]=r,e[6]=n):n=e[6];let i;return e[7]!==o||e[8]!==n?(i={queryKey:o,queryFn:n,staleTime:3e4},e[7]=o,e[8]=n,e[9]=i):i=e[9],I(i)}function L(){const e=c.c(11),{org:t}=d();let s;e[0]!==t.id||e[1]!==t.slug?(s={connectionId:m,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=s):s=e[2];const r=f(s),o=p();let n;e[3]!==r?(n=async a=>{const u=await r.callTool({name:"API_KEY_CREATE",arguments:{name:a.name,permissions:a.permissions??{"*":["*"]}}});return y(u,"Failed to create API key")},e[3]=r,e[4]=n):n=e[4];let i;e[5]!==t.id||e[6]!==o?(i=()=>{o.invalidateQueries({queryKey:g.apiKeysList(t.id)})},e[5]=t.id,e[6]=o,e[7]=i):i=e[7];let l;return e[8]!==n||e[9]!==i?(l={mutationFn:n,onSuccess:i},e[8]=n,e[9]=i,e[10]=l):l=e[10],w(l)}function P(){const e=c.c(11),{org:t}=d();let s;e[0]!==t.id||e[1]!==t.slug?(s={connectionId:m,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=s):s=e[2];const r=f(s),o=p();let n;e[3]!==r?(n=async a=>{const u=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:a}});return y(u,"Failed to delete API key")},e[3]=r,e[4]=n):n=e[4];let i;e[5]!==t.id||e[6]!==o?(i=()=>{o.invalidateQueries({queryKey:g.apiKeysList(t.id)})},e[5]=t.id,e[6]=o,e[7]=i):i=e[7];let l;return e[8]!==n||e[9]!==i?(l={mutationFn:n,onSuccess:i},e[8]=n,e[9]=i,e[10]=l):l=e[10],w(l)}export{K as a,S as b,h as c,P as d,C as m,L as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as U,F as q,K as T,n as I,o as x,e as y,t as m}from"./index-
|
|
1
|
+
import{c as U,F as q,K as T,n as I,o as x,e as y,t as m}from"./index-DnHWblfu.js";import{S as z,u as J}from"./use-mcp-client-BG7zveIM.js";import{u as Q}from"./studio-tools-1de_48yn.js";function V(t){if(t.paramsSchema&&typeof t.paramsSchema=="object")return t;const e={};if(Array.isArray(t.params))for(const s of t.params)e[s.name]={type:s.type,description:s.description,enum:s.enum};else t.params&&typeof t.params=="object"&&Object.assign(e,t.params);return{type:t.type,description:t.description,paramsSchema:e}}function st(t){const e=U.c(12),{org:s}=q(),l=t??z;let a;e[0]!==s.id||e[1]!==s.slug||e[2]!==l?(a={connectionId:l,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=l,e[3]=a):a=e[3];const i=J(a);let n;e[4]!==t?(n=T.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=n):n=e[5];let o;e[6]!==i?(o=async()=>{const d=await i.callTool({name:"TRIGGER_LIST",arguments:{}});return(d.structuredContent??d).triggers.map(V)},e[6]=i,e[7]=o):o=e[7];const c=!!t;let r;return e[8]!==n||e[9]!==o||e[10]!==c?(r={queryKey:n,queryFn:o,enabled:c,staleTime:3e4},e[8]=n,e[9]=o,e[10]=c,e[11]=r):r=e[11],I(r)}function it(t){const e=U.c(9),{org:s}=q(),l=Q();let a;e[0]!==s.id||e[1]!==t?(a=T.automations(s.id,t),e[0]=s.id,e[1]=t,e[2]=a):a=e[2];let i;e[3]!==l||e[4]!==t?(i=async()=>(await l.call("AUTOMATION_LIST",t!=null?{virtual_mcp_id:t}:{})).automations,e[3]=l,e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==a||e[7]!==i?(n={queryKey:a,queryFn:i,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n):n=e[8],I(n)}function ot(t){const e=U.c(10),{org:s}=q(),l=Q();let a;e[0]!==t||e[1]!==s.id?(a=T.automation(s.id,t),e[0]=t,e[1]=s.id,e[2]=a):a=e[2];let i;e[3]!==t||e[4]!==l?(i=async()=>(await l.call("AUTOMATION_GET",{id:t})).automation,e[3]=t,e[4]=l,e[5]=i):i=e[5];const n=!!t;let o;return e[6]!==a||e[7]!==i||e[8]!==n?(o={queryKey:a,queryFn:i,enabled:n,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n,e[9]=o):o=e[9],I(o)}function at(t,e){const s=U.c(12),{org:l}=q(),a=Q();let i;s[0]!==t||s[1]!==l.id||s[2]!==e?(i=T.automationRunStats(l.id,t,JSON.stringify(e??{})),s[0]=t,s[1]=l.id,s[2]=e,s[3]=i):i=s[3];let n;s[4]!==t||s[5]!==e||s[6]!==a?(n=async()=>await a.call("AUTOMATION_RUN_STATS",{automation_id:t,...e?.startDate?{startDate:e.startDate}:{},...e?.endDate?{endDate:e.endDate}:{}}),s[4]=t,s[5]=e,s[6]=a,s[7]=n):n=s[7];const o=!!t;let c;return s[8]!==i||s[9]!==n||s[10]!==o?(c={queryKey:i,queryFn:n,enabled:o,staleTime:3e4},s[8]=i,s[9]=n,s[10]=o,s[11]=c):c=s[11],I(c)}function nt(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function lt(){const t=U.c(64),{org:e}=q(),s=Q(),l=x();let a;t[0]!==e||t[1]!==l?(a=()=>l.invalidateQueries({queryKey:T.automationsAll(e.id)}),t[0]=e,t[1]=l,t[2]=a):a=t[2];const i=a;let n;t[3]!==e||t[4]!==l?(n=u=>l.invalidateQueries({queryKey:T.automation(e.id,u)}),t[3]=e,t[4]=l,t[5]=n):n=t[5];const o=n;let c;t[6]!==s?(c=async u=>await s.call("AUTOMATION_CREATE",u),t[6]=s,t[7]=c):c=t[7];let r;t[8]!==i?(r=()=>{i(),m.success("Automation created successfully")},t[8]=i,t[9]=r):r=t[9];let d;t[10]!==c||t[11]!==r?(d={mutationFn:c,onSuccess:r,onError:X},t[10]=c,t[11]=r,t[12]=d):d=t[12];const D=y(d);let A;t[13]!==s?(A=async u=>await s.call("AUTOMATION_UPDATE",u),t[13]=s,t[14]=A):A=t[14];let p;t[15]!==i||t[16]!==o?(p=(u,f)=>{i(),typeof f.id=="string"&&o(f.id),m.success("Automation updated successfully")},t[15]=i,t[16]=o,t[17]=p):p=t[17];let G;t[18]!==A||t[19]!==p?(G={mutationFn:A,onSuccess:p,onError:W},t[18]=A,t[19]=p,t[20]=G):G=t[20];const j=y(G);let g;t[21]!==s?(g=async u=>await s.call("AUTOMATION_DELETE",{id:u}),t[21]=s,t[22]=g):g=t[22];let _;t[23]!==i||t[24]!==e||t[25]!==l?(_=(u,f)=>{l.removeQueries({queryKey:T.automation(e.id,f)}),i(),m.success("Automation deleted successfully")},t[23]=i,t[24]=e,t[25]=l,t[26]=_):_=t[26];let $;t[27]!==g||t[28]!==_?($={mutationFn:g,onSuccess:_,onError:H},t[27]=g,t[28]=_,t[29]=$):$=t[29];const k=y($);let S;t[30]!==s?(S=async u=>await s.call("AUTOMATION_TRIGGER_ADD",u),t[30]=s,t[31]=S):S=t[31];let E;t[32]!==i||t[33]!==o?(E=u=>{i(),o(u.automation_id)},t[32]=i,t[33]=o,t[34]=E):E=t[34];let K;t[35]!==S||t[36]!==E?(K={mutationFn:S,onSuccess:E},t[35]=S,t[36]=E,t[37]=K):K=t[37];const P=y(K);let O;t[38]!==s?(O=async u=>await s.call("AUTOMATION_TRIGGER_ROTATE_TOKEN",{trigger_id:u.trigger_id}),t[38]=s,t[39]=O):O=t[39];let R;t[40]!==i||t[41]!==o?(R=(u,f)=>{i(),o(f.automation_id)},t[40]=i,t[41]=o,t[42]=R):R=t[42];let C;t[43]!==O||t[44]!==R?(C={mutationFn:O,onSuccess:R},t[43]=O,t[44]=R,t[45]=C):C=t[45];const h=y(C);let F;t[46]!==s?(F=async u=>await s.call("AUTOMATION_TRIGGER_REMOVE",{trigger_id:u.trigger_id}),t[46]=s,t[47]=F):F=t[47];let N;t[48]!==i||t[49]!==o?(N=(u,f)=>{i(),o(f.automation_id)},t[48]=i,t[49]=o,t[50]=N):N=t[50];let b;t[51]!==F||t[52]!==N?(b={mutationFn:F,onSuccess:N},t[51]=F,t[52]=N,t[53]=b):b=t[53];const v=y(b);let L;t[54]!==s?(L={mutationFn:async u=>await s.call("AUTOMATION_RUN",{id:u}),onSuccess:B,onError:Y},t[54]=s,t[55]=L):L=t[55];const w=y(L);let M;return t[56]!==D||t[57]!==k||t[58]!==w||t[59]!==P||t[60]!==v||t[61]!==h||t[62]!==j?(M={create:D,update:j,remove:k,triggerAdd:P,triggerRemove:v,triggerRotateToken:h,run:w},t[56]=D,t[57]=k,t[58]=w,t[59]=P,t[60]=v,t[61]=h,t[62]=j,t[63]=M):M=t[63],M}function Y(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to run automation: ${e}`)}function B(t){t.skipped?m.info(`Automation skipped: ${t.skipped}`):t.error?m.error(`Automation failed: ${t.error}`):m.success("Automation triggered")}function H(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to delete automation: ${e}`)}function W(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to update automation: ${e}`)}function X(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to create automation: ${e}`)}export{st as a,ot as b,it as c,nt as d,at as e,lt as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as T,r as o}from"./index-
|
|
1
|
+
import{c as T,r as o}from"./index-DnHWblfu.js";const y=700;function x(r,l,_){const e=T.c(7),f=y,[a,m]=o.useState(r),[i,S]=o.useState(r),[A,d]=o.useState(!1),t=o.useRef(null);r!==i&&(S(r),A||m(r));let s;e[0]!==f||e[1]!==l?(s=u=>{m(u),d(!0),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null,d(!1),l(u)},f)},e[0]=f,e[1]=l,e[2]=s):s=e[2];const p=s;let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=u=>{m(u),t.current&&clearTimeout(t.current),t.current=null,d(!1)},e[3]=c):c=e[3];const E=c;let n;return e[4]!==a||e[5]!==p?(n=[a,p,E],e[4]=a,e[5]=p,e[6]=n):n=e[6],n}export{x as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,F as m,n as g,K as p}from"./index-
|
|
1
|
+
import{c as u,F as m,n as g,K as p}from"./index-DnHWblfu.js";const b=new Set(["owner","admin"]);function d(){const e=u.c(11),{org:r,locator:c}=m();let o;e[0]!==c?(o=p.myCapabilities(c),e[0]=c,e[1]=o):o=e[1];let a;e[2]!==r?(a=async()=>{const f=await fetch(`/api/auth/custom/my-capabilities/${encodeURIComponent(r.slug)}`,{credentials:"include"});if(!f.ok)throw new Error(`my-capabilities request failed: ${f.status}`);return await f.json()},e[2]=r,e[3]=a):a=e[3];let i;e[4]!==o||e[5]!==a?(i={queryKey:o,queryFn:a,staleTime:3e4,retry:2},e[4]=o,e[5]=a,e[6]=i):i=e[6];const{data:s,isLoading:l,isError:n}=g(i);let t;return e[7]!==s||e[8]!==n||e[9]!==l?(t={data:s,loading:l,error:n},e[7]=s,e[8]=n,e[9]=l,e[10]=t):t=e[10],t}function _(e){const r=u.c(8),{data:c,loading:o,error:a}=d();if(o){let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!0,error:!1,reason:"loading"},r[0]=t):t=r[0],t}if(a){let t;return r[1]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!1,error:!0,reason:"error"},r[1]=t):t=r[1],t}const i=c?.role??null;if(!i){let t;return r[2]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!1,error:!1,reason:"denied"},r[2]=t):t=r[2],t}if(i==="owner"){let t;return r[3]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!0,loading:!1,error:!1,reason:"owner"},r[3]=t):t=r[3],t}if(i==="admin"){let t;return r[4]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!0,loading:!1,error:!1,reason:"admin"},r[4]=t):t=r[4],t}const s=c?.capabilities?.[e]===!0,l=s?"role":"denied";let n;return r[5]!==s||r[6]!==l?(n={granted:s,loading:!1,error:!1,reason:l},r[5]=s,r[6]=l,r[7]=n):n=r[7],n}function S(){const e=u.c(10),{data:r,loading:c,error:o}=d(),a=r?.role??void 0;let i;e[0]!==a?(i=a?b.has(a):!1,e[0]=a,e[1]=i):i=e[1];const s=i;let l;e[2]!==r?.capabilities?(l=r?.capabilities??{},e[2]=r?.capabilities,e[3]=l):l=e[3];const n=l;let t;return e[4]!==o||e[5]!==s||e[6]!==c||e[7]!==a||e[8]!==n?(t={capabilities:n,loading:c,error:o,isPrivileged:s,roleSlug:a},e[4]=o,e[5]=s,e[6]=c,e[7]=a,e[8]=n,e[9]=t):t=e[9],t}export{S as a,_ as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as a}from"./AlertCircle-
|
|
1
|
+
import{i as a}from"./AlertCircle-XYVipozu.js";import{i as c}from"./CheckCircle-CpszjLbT.js";import{i as u}from"./DotsVertical-DtxqOkQ-.js";import{a_ as m}from"./agent-icon-DRGNhHDy.js";import{k as b,c as d,r as f}from"./index-DnHWblfu.js";import{i as p}from"./XCircle-CrKimoYU.js";const g={requires_action:{label:"Needs review",verb:"Waiting for your review",icon:a,iconClassName:"text-warning",labelColor:"text-warning"},failed:{label:"Failed",verb:"Something went wrong",icon:p,iconClassName:"text-destructive",labelColor:"text-destructive"},expired:{label:"Timed out",verb:"Stopped responding",icon:m,iconClassName:"text-warning",labelColor:"text-warning"},in_progress:{label:"Running",verb:"Agent is working",icon:b,iconClassName:"text-primary",labelColor:"text-primary"},completed:{label:"Done",verb:"Completed",icon:c,iconClassName:"text-muted-foreground/50",labelColor:"text-muted-foreground"}},v={label:"Unknown",verb:"Unknown status",icon:u,iconClassName:"text-muted-foreground",labelColor:"text-muted-foreground"};function $(r){return g[r??"completed"]??v}const i=new Map;function s(r){let t=i.get(r);return t||(t={tick:0,subscribers:new Set,intervalId:null},i.set(r,t)),t}function x(r,t){const e=s(r);return e.subscribers.add(t),e.intervalId===null&&(e.intervalId=setInterval(()=>{e.tick+=1;for(const o of e.subscribers)o()},r)),()=>{e.subscribers.delete(t),e.subscribers.size===0&&e.intervalId!==null&&(clearInterval(e.intervalId),e.intervalId=null)}}function y(r){const t=d.c(3),e=r===void 0?6e4:r;let o,n;return t[0]!==e?(o=l=>x(e,l),n=()=>s(e).tick,t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),f.useSyncExternalStore(o,n,C)}function C(){return 0}export{g as S,$ as g,y as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,F as C,dQ as S,b4 as p,b3 as T}from"./index-
|
|
1
|
+
import{c as f,F as C,dQ as S,b4 as p,b3 as T}from"./index-DnHWblfu.js";import{S as I,u as A}from"./use-mcp-client-BG7zveIM.js";function v(t){const o=f.c(20);let i;o[0]!==t?(i=t===void 0?{}:t,o[0]=t,o[1]=i):i=o[1];const n=i;let l,s,c,d;o[2]!==n?({binding:l,includeVirtual:c,slug:d,...s}=n,o[2]=n,o[3]=l,o[4]=s,o[5]=c,o[6]=d):(l=o[3],s=o[4],c=o[5],d=o[6]);let e;o[7]!==l||o[8]!==s.additionalToolArgs||o[9]!==c||o[10]!==d?(e={...s.additionalToolArgs},l!==void 0&&(e.binding=l),c!==void 0&&(e.include_virtual=c),d!==void 0&&(e.slug=d),o[7]=l,o[8]=s.additionalToolArgs,o[9]=c,o[10]=d,o[11]=e):e=o[11];let g;o[12]!==e?(g=Object.keys(e).length>0?e:void 0,o[12]=e,o[13]=g):g=o[13];let r;o[14]!==s||o[15]!==g?(r={...s,additionalToolArgs:g},o[14]=s,o[15]=g,o[16]=r):r=o[16];const N=r,{org:u}=C();let a;o[17]!==u.id||o[18]!==u.slug?(a={connectionId:I,orgId:u.id,orgSlug:u.slug},o[17]=u.id,o[18]=u.slug,o[19]=a):a=o[19];const O=A(a);return S(u.id,"CONNECTIONS",O,N)}function E(t){const o=f.c(3),{org:i}=C();let n;o[0]!==i.id||o[1]!==i.slug?(n={connectionId:I,orgId:i.id,orgSlug:i.slug},o[0]=i.id,o[1]=i.slug,o[2]=n):n=o[2];const l=A(n);return T(i.id,"CONNECTIONS",t,l)}function _(){const t=f.c(3),{org:o}=C();let i;t[0]!==o.id||t[1]!==o.slug?(i={connectionId:I,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=i):i=t[2];const n=A(i);return p(o.id,"CONNECTIONS",n)}export{E as a,_ as b,v as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as i,r as n}from"./index-
|
|
1
|
+
import{c as i,r as n}from"./index-DnHWblfu.js";function p(){const e=i.c(3),[s,a]=n.useState(!1);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=async c=>{await navigator.clipboard.writeText(c),a(!0),setTimeout(()=>a(!1),2e3)},e[0]=t):t=e[0];const r=t;let o;return e[1]!==s?(o={handleCopy:r,copied:s},e[1]=s,e[2]=o):o=e[2],o}export{p as u};
|
package/dist/client/assets/{use-create-virtual-mcp-BM65v9ER.js → use-create-virtual-mcp-BLDf0ux0.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g}from"./index-
|
|
1
|
+
import{c as g}from"./index-DnHWblfu.js";import{b as f}from"./use-virtual-mcp-D6qbeGCA.js";import{c as p}from"./use-navigate-to-agent-_n3ZB1G-.js";function A(i){const e=g.c(9);let n;e[0]!==i?(n=i===void 0?{}:i,e[0]=i,e[1]=n):n=e[1];const d=n,{navigateOnCreate:u}=d,c=u===void 0?!1:u,t=f(),r=p();let s;e[2]!==t.create||e[3]!==c||e[4]!==r?(s=async()=>{const l=await t.create.mutateAsync({title:"New Agent",description:"AI-driven assistant designed to handle specific tasks",status:"active",connections:[],pinned:!1});return c&&r(l.id,{search:{main:"instructions"}}),{id:l.id,virtualMcp:l}},e[2]=t.create,e[3]=c,e[4]=r,e[5]=s):s=e[5];const o=s;let a;return e[6]!==t.create.isPending||e[7]!==o?(a={createVirtualMCP:o,isCreating:t.create.isPending},e[6]=t.create.isPending,e[7]=o,e[8]=a):a=e[8],a}export{A as u};
|
package/dist/client/assets/{use-debounced-autosave-3BGJnmLE.js → use-debounced-autosave-rKGkta2N.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as u}from"./index-
|
|
1
|
+
import{r as u}from"./index-DnHWblfu.js";function l({save:t,delayMs:n=1e3}){const e=u.useRef(t);e.current=t;const r=u.useRef(null),c=()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,e.current()},n)},o=()=>(r.current&&(clearTimeout(r.current),r.current=null),e.current());return u.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null,e.current())},[]),{schedule:c,flush:o}}export{l as u};
|
package/dist/client/assets/{use-debounced-value-B5eH48Lw.js → use-debounced-value-DOFpGJrU.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,r as n}from"./index-
|
|
1
|
+
import{c as m,r as n}from"./index-DnHWblfu.js";function p(e,o){const t=m.c(4),[s,u]=n.useState(e);let c,r;return t[0]!==o||t[1]!==e?(c=()=>{const i=setTimeout(()=>u(e),o);return()=>clearTimeout(i)},r=[e,o],t[0]=o,t[1]=e,t[2]=c,t[3]=r):(c=t[2],r=t[3]),n.useEffect(c,r),s}export{p as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{W as Kt,X as Ut,c as $,b as V,Y as gt,Z as pt,e as qt,j as t,a as ie,B as ne,r as H,aI as Xt,d as Re,s as Wt,m as X,t as G,w as Qt,k as ke,p as R,F as ae,L as Yt,f as ht,u as xt,D as Jt,I as Zt,G as en,K as ot,o as tn,n as nn}from"./index-D3OCvKaU.js";import{t as jt}from"./ChevronDown-CIPwphYr.js";import{A as vt,l as sn,d as on}from"./agent-icon-Cn-zdV8E.js";import{T as Ce,a as ye,c as Se}from"./tooltip-DrF8Dycy.js";import{u as bt,d as Ct,c as yt}from"./sidebar-BjYwCtXi.js";import{a as it,i as an,f as rn,S as cn,u as ln}from"./use-mcp-client-DBBu3lpa.js";import{a as dn,u as un}from"./use-virtual-mcp-Bymtbi-1.js";import{a as Be,b as St,P as wt}from"./popover-DqHD4yxd.js";import{i as Ee}from"./Check-Du2CH0Qx.js";import{s as we}from"./Plus-1ztWOFkn.js";import{i as _t}from"./SearchMd-CoeKfSSe.js";import{s as Nt}from"./XClose-B6aD5HLV.js";import{c as mn,d as fn,b as gn,f as pn,e as hn,a as xn,A as jn}from"./alert-dialog-DdeUN0gs.js";import{F as Q,a as st,b as Y,c as J,d as Z,f as vn,e as ee}from"./form-CQNziZWc.js";import{I as oe}from"./input-Bs4tcVhT.js";import{S as bn}from"./chat-context-DcyOF_pB.js";import{T as Dt}from"./toolbar-Ba5XXE-M.js";import{S as Cn}from"./skeleton-BwfY4sYC.js";import{D as kt,a as It,b as At,c as yn,e as Sn,f as wn,g as _n}from"./drawer-SsJOHRPA.js";import{u as Pt}from"./use-mobile-B9xC4LZs.js";import{G as Nn}from"./use-registry-app-D7Jfc22S.js";import{G as Dn}from"./github-repo-picker-pUO4-UP7.js";import{b as kn,a as Tt}from"./hooks-CAzZfDok.js";import{u as In,g as An,a as Pn,b as Tn}from"./use-navigate-to-agent-B_NFjN6b.js";import{u as Ot}from"./shell-layout-BexOLm1f.js";import{f as On}from"./reusable-new-chat-CouMjkYR.js";import{C as zn}from"./collection-search-CgPrJD5s.js";import{g as Mn,a as $n,b as Fn,e as Ln}from"./extract-connection-data-Br5Lsj7z.js";import{u as zt,a as Mt,g as Bn,C as Je}from"./connection-card-5582YW8P.js";import{e as $t,d as Ft,a as Lt,b as Bt,h as En,c as Vn}from"./dialog-DRzTNCF2.js";import{S as Rn,a as Hn,b as Gn,c as Kn,d as De}from"./select-CPtJAf28.js";import{T as Un}from"./textarea-dx3oQXX3.js";import{b as Et}from"./use-connection-BqPnQoRJ.js";import{a as Le,b as Ze}from"./Tool02-CCso8U2x.js";import{s as et}from"./Star01-B1Kn4-_i.js";import{c as qn,i as $e,a as dt,E as Xn,p as Wn,b as Qn,d as Yn}from"./connection-form-helpers-CmY0Q2Uk.js";import{a as tt}from"./authenticate-and-persist-oauth-BgQP48Df.js";import{g as Jn}from"./connection-slug-eyAPH6o3.js";import{C as Zn}from"./collection-tabs-DQPFhmJa.js";import{u as ut}from"./use-infinite-scroll-CLgVcggv.js";import{B as Fe}from"./badge-DLw-128i.js";import{u as es}from"./useSuspenseInfiniteQuery-C_27-SXB.js";import{g as Ve}from"./metadata-dUsYcpuu.js";import{u as ts}from"./studio-tools-D5UPG7xq.js";import{u as ns}from"./use-ai-providers-BiLZ6IzA.js";function mt(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ss=Kt({name:Ut().min(2,"Organization name is required")});function os(n){const e=$.c(66),{open:s,onOpenChange:i}=n,o=V();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:gt(ss),defaultValues:{name:""}},e[0]=r):r=e[0];const a=pt(r);let l;e[1]!==o?(l=async E=>{const M=mt(E.name);if(!M)throw new Error(o("common.createOrganizationDialog.invalidSlug"));const U=await ie.organization.create({name:E.name,slug:M});if(U?.error)throw new Error(U.error.message||o("common.createOrganizationDialog.failedToCreate"));const K=U?.data?.slug??M;if(!K)throw new Error(o("common.createOrganizationDialog.failedToCreate"));return{orgSlug:K}},e[1]=o,e[2]=l):l=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=is,e[3]=d):d=e[3];let m;e[4]!==l?(m={mutationFn:l,onSuccess:d},e[4]=l,e[5]=m):m=e[5];const u=qt(m);let p;e[6]!==u.error||e[7]!==o?(p=u.error instanceof Error?u.error.message:u.error?o("common.createOrganizationDialog.failedToCreateGeneric"):null,e[6]=u.error,e[7]=o,e[8]=p):p=e[8];const c=p;let h;e[9]!==o?(h=o("common.createOrganizationDialog.title"),e[9]=o,e[10]=h):h=e[10];let C;e[11]!==h?(C=t.jsx(mn,{children:h}),e[11]=h,e[12]=C):C=e[12];let x;e[13]!==o?(x=o("common.createOrganizationDialog.description"),e[13]=o,e[14]=x):x=e[14];let g;e[15]!==x?(g=t.jsx(fn,{children:x}),e[15]=x,e[16]=g):g=e[16];let j;e[17]!==C||e[18]!==g?(j=t.jsxs(gn,{children:[C,g]}),e[17]=C,e[18]=g,e[19]=j):j=e[19];let b;if(e[20]!==u||e[21]!==a){let E;e[23]!==u?(E=M=>u.mutateAsync(M),e[23]=u,e[24]=E):E=e[24],b=a.handleSubmit(E),e[20]=u,e[21]=a,e[22]=b}else b=e[22];let y;e[25]!==a.formState.isSubmitting||e[26]!==o?(y=E=>{const{field:M}=E;return t.jsxs(Y,{children:[t.jsx(J,{children:o("common.createOrganizationDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(oe,{...M,placeholder:o("common.createOrganizationDialog.namePlaceholder"),disabled:a.formState.isSubmitting})}),t.jsx(vn,{children:o("common.createOrganizationDialog.nameDescription")}),M.value&&t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[o("common.createOrganizationDialog.urlLabel")," ",t.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",mt(M.value)]})]}),t.jsx(ee,{})]})},e[25]=a.formState.isSubmitting,e[26]=o,e[27]=y):y=e[27];let w;e[28]!==a.control||e[29]!==y?(w=t.jsx(Q,{control:a.control,name:"name",render:y}),e[28]=a.control,e[29]=y,e[30]=w):w=e[30];let N;e[31]!==c?(N=c&&t.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[31]=c,e[32]=N):N=e[32];const I=a.formState.isSubmitting;let O;e[33]!==u||e[34]!==a?(O=()=>{u.reset(),a.reset()},e[33]=u,e[34]=a,e[35]=O):O=e[35];let f;e[36]!==o?(f=o("common.createOrganizationDialog.cancel"),e[36]=o,e[37]=f):f=e[37];let _;e[38]!==a.formState.isSubmitting||e[39]!==O||e[40]!==f?(_=t.jsx(pn,{disabled:I,onClick:O,children:f}),e[38]=a.formState.isSubmitting,e[39]=O,e[40]=f,e[41]=_):_=e[41];const T=!a.formState.isValid||a.formState.isSubmitting;let S;e[42]!==a.formState.isSubmitting||e[43]!==o?(S=a.formState.isSubmitting?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(bn,{size:"xs"})," ",o("common.createOrganizationDialog.creating")]}):o("common.createOrganizationDialog.createButton"),e[42]=a.formState.isSubmitting,e[43]=o,e[44]=S):S=e[44];let v;e[45]!==T||e[46]!==S?(v=t.jsx(ne,{type:"submit",variant:"default",disabled:T,children:S}),e[45]=T,e[46]=S,e[47]=v):v=e[47];let P;e[48]!==_||e[49]!==v?(P=t.jsxs(hn,{children:[_,v]}),e[48]=_,e[49]=v,e[50]=P):P=e[50];let k;e[51]!==b||e[52]!==w||e[53]!==N||e[54]!==P?(k=t.jsxs("form",{className:"space-y-6",onSubmit:b,autoComplete:"off",children:[w,N,P]}),e[51]=b,e[52]=w,e[53]=N,e[54]=P,e[55]=k):k=e[55];let A;e[56]!==a||e[57]!==k?(A=t.jsx(st,{...a,children:k}),e[56]=a,e[57]=k,e[58]=A):A=e[58];let z;e[59]!==j||e[60]!==A?(z=t.jsxs(xn,{children:[j,A]}),e[59]=j,e[60]=A,e[61]=z):z=e[61];let B;return e[62]!==i||e[63]!==s||e[64]!==z?(B=t.jsx(jn,{open:s,onOpenChange:i,children:z}),e[62]=i,e[63]=s,e[64]=z,e[65]=B):B=e[65],B}function is(n){const{orgSlug:e}=n;window.location.href=`/${e}`}function Vt(){const n=H.useContext(Xt),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date),refetch:()=>s?.()}}function as(n){let e=0;for(let i=0;i<n.length;i++)e=n.charCodeAt(i)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function at(n){const e=$.c(13),{org:s,size:i}=n,o=i===void 0?"sm":i,r=o==="xs"?"size-5":"size-6",a=o==="xs"?"text-[9px]":"text-xs";let l;e[0]!==r?(l=X(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=l):l=e[1];let d;e[2]!==s.logo||e[3]!==s.name?(d=s.logo?void 0:as(s.name),e[2]=s.logo,e[3]=s.name,e[4]=d):d=e[4];let m;e[5]!==s.logo||e[6]!==s.name||e[7]!==a?(m=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:X("font-semibold leading-none",a),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=a,e[8]=m):m=e[8];let u;return e[9]!==l||e[10]!==d||e[11]!==m?(u=t.jsx("div",{className:l,style:d,children:m}),e[9]=l,e[10]=d,e[11]=m,e[12]=u):u=e[12],u}function rs({invitation:n,onChanged:e}){const s=V(),[i,o]=H.useState(!1),r=n.organizationName??s("header.orgSwitcher.unknownOrganization"),a=async()=>{o(!0);try{const m=await ie.organization.acceptInvitation({invitationId:n.id});if(m.error){G.error(m.error.message),o(!1);return}}catch{G.error(s("header.orgSwitcher.failedToAcceptInvitation")),o(!1);return}G.success(s("header.orgSwitcher.joined",{name:r})),Qt();let d;try{d=(await ie.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=d?`/${d}`:"/"},l=async()=>{o(!0);try{const d=await ie.organization.rejectInvitation({invitationId:n.id});if(d.error){G.error(d.error.message),o(!1);return}G.success(s("header.orgSwitcher.invitationDeclined")),o(!1),e()}catch{G.error(s("header.orgSwitcher.failedToDeclineInvitation")),o(!1)}};return t.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[t.jsx(at,{org:{name:r},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:r}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsx(ne,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:a,disabled:i,children:s("header.orgSwitcher.accept")}),t.jsx(ne,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:l,disabled:i,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:r}),children:t.jsx(Nt,{size:14})})]})]})}function cs(n){const e=$.c(32),{orgParam:s,onSelectOrg:i,onCreateOrg:o}=n,r=V(),{data:a}=Wt(),{invitations:l,refetch:d}=Vt();let m;e[0]!==s?(m=(k,A)=>k.slug===s?-1:A.slug===s?1:k.name.localeCompare(A.name),e[0]=s,e[1]=m):m=e[1];const u=[...a??[]].sort(m),[p,c]=H.useState(""),h=p.toLowerCase(),C=h?u.filter(k=>k.name.toLowerCase().includes(h)||k.slug.toLowerCase().includes(h)):u;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(_t,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=x):x=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=k=>c(k.target.value),e[3]=g):g=e[3];let j;e[4]!==p?(j=k=>k.key==="Escape"&&p&&c(""),e[4]=p,e[5]=j):j=e[5];let b;e[6]!==r?(b=r("header.orgSwitcher.searchOrganizations"),e[6]=r,e[7]=b):b=e[7];let y;e[8]!==p||e[9]!==j||e[10]!==b?(y=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:p,onChange:g,onKeyDown:j,placeholder:b,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=p,e[9]=j,e[10]=b,e[11]=y):y=e[11];let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(we,{size:16}),e[12]=w):w=e[12];let N;e[13]!==o?(N=t.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:w}),e[13]=o,e[14]=N):N=e[14];let I;e[15]!==y||e[16]!==N?(I=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,y,N]}),e[15]=y,e[16]=N,e[17]=I):I=e[17];const O="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let f;e[18]!==l||e[19]!==p||e[20]!==d?(f=!p&&l.map(k=>t.jsx(rs,{invitation:k,onChanged:d},k.id)),e[18]=l,e[19]=p,e[20]=d,e[21]=f):f=e[21];const _=C.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:p?r("header.orgSwitcher.noOrganizationsMatch",{query:p}):r("header.orgSwitcher.noOrganizationsAvailable")});let T;e[22]!==i||e[23]!==s?(T=k=>t.jsxs("button",{type:"button",onClick:()=>i(k.slug),className:X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",k.slug===s?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[t.jsx(at,{org:k,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:k.name}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.slug})]}),k.slug===s&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id),e[22]=i,e[23]=s,e[24]=T):T=e[24];const S=C.map(T);let v;e[25]!==f||e[26]!==_||e[27]!==S?(v=t.jsxs("div",{className:O,children:[f,_,S]}),e[25]=f,e[26]=_,e[27]=S,e[28]=v):v=e[28];let P;return e[29]!==v||e[30]!==I?(P=t.jsxs(t.Fragment,{children:[I,v]}),e[29]=v,e[30]=I,e[31]=P):P=e[31],P}function ls(n){const e=$.c(22),{trigger:s,orgParam:i,align:o,side:r}=n,a=o===void 0?"start":o,l=r===void 0?"bottom":r,d=Re(),[m,u]=H.useState(!1),[p,c]=H.useState(!1);let h;e[0]!==s?(h=t.jsx(Be,{asChild:!0,children:s}),e[0]=s,e[1]=h):h=e[1];const C=String(m);let x;e[2]!==d?(x=I=>{u(!1),d({to:"/$org",params:{org:I}})},e[2]=d,e[3]=x):x=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{u(!1),c(!0)},e[4]=g):g=e[4];let j;e[5]!==i||e[6]!==C||e[7]!==x?(j=t.jsx(cs,{orgParam:i,onSelectOrg:x,onCreateOrg:g},C),e[5]=i,e[6]=C,e[7]=x,e[8]=j):j=e[8];let b;e[9]!==a||e[10]!==l||e[11]!==j?(b=t.jsx(St,{side:l,align:a,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:us,onCloseAutoFocus:ds,children:j}),e[9]=a,e[10]=l,e[11]=j,e[12]=b):b=e[12];let y;e[13]!==m||e[14]!==h||e[15]!==b?(y=t.jsxs(wt,{open:m,onOpenChange:u,children:[h,b]}),e[13]=m,e[14]=h,e[15]=b,e[16]=y):y=e[16];let w;e[17]!==p?(w=t.jsx(os,{open:p,onOpenChange:c}),e[17]=p,e[18]=w):w=e[18];let N;return e[19]!==w||e[20]!==y?(N=t.jsxs(t.Fragment,{children:[y,w]}),e[19]=w,e[20]=y,e[21]=N):N=e[21],N}function ds(n){return n.preventDefault()}function us(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function ms(n){const e=$.c(21),{value:s,onChange:i,placeholder:o,onKeyDown:r,className:a,isSearching:l,disabled:d}=n,m=o===void 0?"Search...":o;let u;e[0]!==a?(u=X("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=u):u=e[1];const p=d?"cursor-not-allowed opacity-50":"cursor-text";let c;e[2]!==p?(c=X("flex items-center gap-2.5 h-12 px-4",p),e[2]=p,e[3]=c):c=e[3];let h;e[4]!==l?(h=l?t.jsx(ke,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(_t,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=l,e[5]=h):h=e[5];let C;e[6]!==i?(C=b=>i(b.target.value),e[6]=i,e[7]=C):C=e[7];let x;e[8]!==d||e[9]!==r||e[10]!==m||e[11]!==C||e[12]!==s?(x=t.jsx("input",{type:"text",value:s,onChange:C,onKeyDown:r,placeholder:m,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=r,e[10]=m,e[11]=C,e[12]=s,e[13]=x):x=e[13];let g;e[14]!==c||e[15]!==h||e[16]!==x?(g=t.jsxs("label",{className:c,children:[h,x]}),e[14]=c,e[15]=h,e[16]=x,e[17]=g):g=e[17];let j;return e[18]!==u||e[19]!==g?(j=t.jsx("div",{className:u,children:g}),e[18]=u,e[19]=g,e[20]=j):j=e[20],j}function rt(n){const e=n?.metadata?.githubRepo;if(!e?.url)return{status:"none"};const s=e.connectionId;return!!s&&!!n?.connections?.some(r=>r.connection_id===s)?{status:"attached",repo:e,connectionId:s}:!!s||e.installationId!=null?{status:"detached",repo:e}:{status:"public-clone",repo:e}}function $o(n){const e=rt(n);return e.status==="attached"||e.status==="public-clone"?e.repo:null}function Rt(n){if(typeof n!="object"||n===null)return!1;const s=n.githubRepo?.url;return typeof s=="string"&&s.length>0}function Fo(n){return rt(n).status==="attached"}function Lo(n){const e=rt(n).status;return e==="attached"||e==="detached"}function fs(n){const e=new Set;for(const s of n??[]){const i=s.metadata?.liveAgentId;typeof i=="string"&&i&&e.add(s.id)}return e}function Bo(n,e){if(!n)return null;const s=n.metadata?.liveAgentId;if(typeof s=="string"&&s)return{mode:"dev",targetId:s};const i=(e??[]).find(o=>o.metadata?.liveAgentId===n.id);return i?{mode:"live",targetId:i.id}:null}function gs(n){const e=$.c(6),{value:s,onChange:i}=n,o=V();let r;e[0]!==o?(r=o("sidebar.agentsSection.searchAgents"),e[0]=o,e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==r||e[4]!==s?(a=t.jsx(ms,{value:s,onChange:i,placeholder:r}),e[2]=i,e[3]=r,e[4]=s,e[5]=a):a=e[5],a}function ps(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=i):i=n[3],i}function hs(n){const e=$.c(10),{org:s,onClose:i}=n,o=V();let r;e[0]!==s.slug?(r={org:s.slug},e[0]=s.slug,e[1]=r):r=e[1];let a;e[2]!==i?(a=()=>i(),e[2]=i,e[3]=a):a=e[3];let l;e[4]!==o?(l=o("sidebar.agentsSection.seeAllAgents"),e[4]=o,e[5]=l):l=e[5];let d;return e[6]!==r||e[7]!==a||e[8]!==l?(d=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(Yt,{to:"/$org/settings/agents",params:r,onClick:a,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:l})}),e[6]=r,e[7]=a,e[8]=l,e[9]=d):d=e[9],d}function xs(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(Ht,{children:s}),n[2]=s,n[3]=i):i=n[3],i}function js(n){const e=$.c(11),{onImportFromGithub:s}=n,i=V();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Nn,{className:"size-3.5"}),e[0]=o):o=e[0];let r;e[1]!==i?(r=i("sidebar.agentsSection.import"),e[1]=i,e[2]=r):r=e[2];let a;e[3]!==s||e[4]!==r?(a=t.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[o,r]}),e[3]=s,e[4]=r,e[5]=a):a=e[5];let l;e[6]!==i?(l=i("sidebar.agentsSection.codeAgents"),e[6]=i,e[7]=l):l=e[7];let d;return e[8]!==a||e[9]!==l?(d=t.jsx(Ht,{action:a,children:l}),e[8]=a,e[9]=l,e[10]=d):d=e[10],d}function vs(n){const e=$.c(11),{setOpen:s,emptyCtaClass:i}=n,o=V();let r;e[0]!==o?(r=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=r):r=e[1];let a;e[2]!==i?(a=X(i),e[2]=i,e[3]=a):a=e[3];let l;e[4]!==s?(l=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=l):l=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(we,{className:"size-4"}),e[6]=d):d=e[6];let m;return e[7]!==r||e[8]!==a||e[9]!==l?(m=t.jsx(Dt,{"aria-label":r,className:a,onClick:l,children:d}),e[7]=r,e[8]=a,e[9]=l,e[10]=m):m=e[10],m}function bs(n){const e=$.c(17),{setOpen:s,highlightEmpty:i,emptyCtaClass:o}=n,r=V();let a;e[0]!==i||e[1]!==r?(a=i?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=r,e[2]=a):a=e[2];let l;e[3]!==o?(l=X(o),e[3]=o,e[4]=l):l=e[4];let d;e[5]!==s?(d=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=d):d=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(we,{}),e[7]=m):m=e[7];let u;e[8]!==r?(u=r("sidebar.agentsSection.newAgent"),e[8]=r,e[9]=u):u=e[9];let p;e[10]!==u?(p=t.jsx("span",{children:u}),e[10]=u,e[11]=p):p=e[11];let c;return e[12]!==a||e[13]!==l||e[14]!==d||e[15]!==p?(c=t.jsx(Ct,{children:t.jsxs(yt,{tooltip:a,className:l,onClick:d,children:[m,p]})}),e[12]=a,e[13]=l,e[14]=d,e[15]=p,e[16]=c):c=e[16],c}function Cs(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(At,{className:"sr-only",children:s}),n[2]=s,n[3]=i):i=n[3],i}function ys(n){const e=$.c(8),{emptyCtaClass:s}=n,i=V();let o;e[0]!==i?(o=i("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=o):o=e[1];let r;e[2]!==s?(r=X(s),e[2]=s,e[3]=r):r=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{className:"size-4"}),e[4]=a):a=e[4];let l;return e[5]!==o||e[6]!==r?(l=t.jsx(Dt,{"aria-label":o,className:r,children:a}),e[5]=o,e[6]=r,e[7]=l):l=e[7],l}function Ss(n){const e=$.c(19),{wrapEmptyHint:s,highlightEmpty:i,emptyCtaClass:o}=n,r=V();let a;e[0]!==i||e[1]!==r?(a=i?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=r,e[2]=a):a=e[2];let l;e[3]!==o?(l=X(o),e[3]=o,e[4]=l):l=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(we,{}),e[5]=d):d=e[5];let m;e[6]!==r?(m=r("sidebar.agentsSection.newAgent"),e[6]=r,e[7]=m):m=e[7];let u;e[8]!==m?(u=t.jsx("span",{children:m}),e[8]=m,e[9]=u):u=e[9];let p;e[10]!==a||e[11]!==l||e[12]!==u?(p=t.jsx(Be,{asChild:!0,children:t.jsxs(yt,{tooltip:a,className:l,children:[d,u]})}),e[10]=a,e[11]=l,e[12]=u,e[13]=p):p=e[13];let c;e[14]!==p||e[15]!==s?(c=s(p),e[14]=p,e[15]=s,e[16]=c):c=e[16];let h;return e[17]!==c?(h=t.jsx(Ct,{children:c}),e[17]=c,e[18]=h):h=e[18],h}function ws(n){const e=$.c(9),{children:s}=n,i=V();let o;e[0]!==s?(o=t.jsx(Ce,{asChild:!0,children:s}),e[0]=s,e[1]=o):o=e[1];let r;e[2]!==i?(r=i("sidebar.agentsSection.selectAnExistingAgent"),e[2]=i,e[3]=r):r=e[3];let a;e[4]!==r?(a=t.jsx(ye,{side:"right",sideOffset:8,children:r}),e[4]=r,e[5]=a):a=e[5];let l;return e[6]!==o||e[7]!==a?(l=t.jsxs(Se,{defaultOpen:!0,delayDuration:0,children:[o,a]}),e[6]=o,e[7]=a,e[8]=l):l=e[8],l}function _s(n){const e=$.c(4),s=Re(),{create:i}=kn();let o;return e[0]!==i||e[1]!==s||e[2]!==n?(o=async r=>{const a=crypto.randomUUID();try{await i({id:a,virtual_mcp_id:r})}catch{}s({to:"/$org/$taskId",params:{org:n,taskId:a},search:{virtualmcpid:r}})},e[0]=i,e[1]=s,e[2]=n,e[3]=o):o=e[3],o}function nt(n){const e=$.c(20),{agent:s,selected:i,onClick:o}=n,r=i?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let a;e[0]!==r?(a=X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=a):a=e[1];let l;e[2]!==s.icon||e[3]!==s.title?(l=t.jsx(vt,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=l):l=e[4];let d;e[5]!==s.title?(d=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=d):d=e[6];let m;e[7]!==s.description?(m=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=m):m=e[8];let u;e[9]!==d||e[10]!==m?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,m]}),e[9]=d,e[10]=m,e[11]=u):u=e[11];let p;e[12]!==i?(p=i&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=i,e[13]=p):p=e[13];let c;return e[14]!==o||e[15]!==a||e[16]!==l||e[17]!==u||e[18]!==p?(c=t.jsxs("button",{type:"button",onClick:o,className:a,children:[l,u,p]}),e[14]=o,e[15]=a,e[16]=l,e[17]=u,e[18]=p,e[19]=c):c=e[19],c}function Ht(n){const e=$.c(5),{children:s,action:i}=n;let o;e[0]!==s?(o=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=o):o=e[1];let r;return e[2]!==i||e[3]!==o?(r=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[o,i]}),e[2]=i,e[3]=o,e[4]=r):r=e[4],r}function Ns(n){const e=$.c(23),{onClose:s,onSelectAgent:i,selectedAgentId:o,onImportFromGithub:r}=n,[a,l]=H.useState(""),d=dn(),m=d??[],{org:u}=ae(),{data:p}=ie.useSession(),c=p?.user?.id??"anon",h=An(d),C=Pn(),x=_s(u.slug),g=fs(d),j=a.toLowerCase(),b=m.filter(As).filter(L=>!g.has(L.id)).filter(Is).filter(L=>!a||L.title.toLowerCase().includes(j)),y=b.filter(ks),w=b.filter(Ds),N=it(u.id),I=!a||N.title.toLowerCase().includes(j),O=!!(i&&I);let f;e[0]!==s||e[1]!==i?(f=()=>{i?.(null),s(),l("")},e[0]=s,e[1]=i,e[2]=f):f=e[2];const _=f,T=L=>{if(i){i(L.id),s(),l("");return}Tn({orgId:u.id,userId:c},L.id,h),C(),s(),l(""),x(L.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let v;e[3]!==a?(v=t.jsx(gs,{value:a,onChange:l}),e[3]=a,e[4]=v):v=e[4];const P="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",k=i&&I&&N&&t.jsx(nt,{agent:N,selected:!o||o===N.id,onClick:_}),A=(y.length>0||!a)&&t.jsx(js,{onImportFromGithub:r}),z=y.map(L=>t.jsx(nt,{agent:L,selected:i?o===L.id:void 0,onClick:()=>T(L)},L.id)),B=w.length>0&&t.jsx(xs,{}),E=w.map(L=>t.jsx(nt,{agent:L,selected:i?o===L.id:void 0,onClick:()=>T(L)},L.id));let M;e[5]!==O||e[6]!==a||e[7]!==b.length?(M=b.length===0&&!O&&a&&t.jsx(ps,{}),e[5]=O,e[6]=a,e[7]=b.length,e[8]=M):M=e[8];let U;e[9]!==M||e[10]!==k||e[11]!==A||e[12]!==z||e[13]!==B||e[14]!==E?(U=t.jsxs("div",{className:P,children:[k,A,z,B,E,M]}),e[9]=M,e[10]=k,e[11]=A,e[12]=z,e[13]=B,e[14]=E,e[15]=U):U=e[15];let K;e[16]!==s||e[17]!==u?(K=t.jsx(hs,{org:u,onClose:s}),e[16]=s,e[17]=u,e[18]=K):K=e[18];let de;return e[19]!==U||e[20]!==K||e[21]!==v?(de=t.jsxs("div",{className:S,children:[v,U,K]}),e[19]=U,e[20]=K,e[21]=v,e[22]=de):de=e[22],de}function Ds(n){return!Rt(n.metadata)}function ks(n){return Rt(n.metadata)}function Is(n){return!rn(n.id)}function As(n){return!an(n.id)}function Ps(n){const e=$.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:i,trigger:o,onSelectAgent:r,selectedAgentId:a,side:l,align:d}=s,m=i===void 0?!1:i,u=l===void 0?"right":l,p=d===void 0?"start":d,[c,h]=H.useState(!1),[C,x]=H.useState(!1),g=Pt(),{setOpenMobile:j}=bt(),b=In(),y=b?"border border-border":void 0;let w;e[2]!==b?(w=A=>b?t.jsx(ws,{children:A}):A,e[2]=b,e[3]=w):w=e[3];const N=w;let I;e[4]!==g||e[5]!==j?(I=()=>{h(!1),g&&j(!1)},e[4]=g,e[5]=j,e[6]=I):I=e[6];const O=I;let f;e[7]!==O?(f=()=>{O(),x(!0)},e[7]=O,e[8]=f):f=e[8];const _=f;let T;e[9]!==O||e[10]!==_||e[11]!==r||e[12]!==c||e[13]!==a?(T=c&&t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(Cn,{className:"h-4 w-24"})}),children:t.jsx(Ns,{onClose:O,onSelectAgent:r,selectedAgentId:a,onImportFromGithub:_})}),e[9]=O,e[10]=_,e[11]=r,e[12]=c,e[13]=a,e[14]=T):T=e[14];const S=T;let v;e[15]!==p||e[16]!==m||e[17]!==y||e[18]!==b||e[19]!==g||e[20]!==c||e[21]!==S||e[22]!==u||e[23]!==o||e[24]!==N?(v=g?t.jsxs(t.Fragment,{children:[o?t.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:o}):m?N(t.jsx(vs,{setOpen:h,emptyCtaClass:y})):t.jsx(bs,{setOpen:h,highlightEmpty:b,emptyCtaClass:y}),t.jsx(kt,{open:c,onOpenChange:h,direction:"bottom",children:t.jsxs(It,{className:"max-h-[85dvh] p-0",children:[t.jsx(Cs,{}),S]})})]}):t.jsxs(wt,{open:c,onOpenChange:A=>{A&&!c&&R("agent_browser_opened",{surface:"desktop_popover"}),h(A)},children:[o?t.jsx(Be,{asChild:!0,children:o}):m?N(t.jsx(Be,{asChild:!0,children:t.jsx(ys,{emptyCtaClass:y})})):t.jsx(Ss,{wrapEmptyHint:N,highlightEmpty:b,emptyCtaClass:y}),t.jsx(St,{className:"w-[380px] p-0 overflow-hidden",side:u,align:p,children:S})]}),e[15]=p,e[16]=m,e[17]=y,e[18]=b,e[19]=g,e[20]=c,e[21]=S,e[22]=u,e[23]=o,e[24]=N,e[25]=v):v=e[25];let P;e[26]!==C?(P=t.jsx(Dn,{open:C,onOpenChange:x,mode:"agent"}),e[26]=C,e[27]=P):P=e[27];let k;return e[28]!==P||e[29]!==v?(k=t.jsxs(t.Fragment,{children:[v,P]}),e[28]=P,e[29]=v,e[30]=k):k=e[30],k}const Ts="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Os(n){const e=$.c(19),{agentId:s,fallback:i,onOpenHome:o,onPick:r}=n,a=un(s)??i??null,l=a?.title??"Super Agent",d=`Open ${l} home`,m=a?.icon??null;let u;e[0]!==m||e[1]!==l?(u=t.jsx(vt,{icon:m,name:l,size:"xs"}),e[0]=m,e[1]=l,e[2]=u):u=e[2];let p;e[3]!==o||e[4]!==d||e[5]!==u?(p=t.jsx("button",{type:"button",onClick:o,"aria-label":d,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:u}),e[3]=o,e[4]=d,e[5]=u,e[6]=p):p=e[6];let c;e[7]!==l?(c=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:l}),e[7]=l,e[8]=c):c=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(jt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=h):h=e[9];let C;e[10]!==c?(C=t.jsxs("button",{type:"button",className:Ts,children:[c,h]}),e[10]=c,e[11]=C):C=e[11];let x;e[12]!==s||e[13]!==r||e[14]!==C?(x=t.jsx(Ps,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:r,trigger:C}),e[12]=s,e[13]=r,e[14]=C,e[15]=x):x=e[15];let g;return e[16]!==p||e[17]!==x?(g=t.jsxs("div",{className:"flex min-w-0 items-center gap-0",children:[p,x]}),e[16]=p,e[17]=x,e[18]=g):g=e[18],g}function Eo(n){const e=$.c(26);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:i}=s,{org:o}=ae(),{state:r,isMobile:a}=bt(),l=Vt().invitations.length>0,d=r==="collapsed"||a,m=l?`${o.name} — switch organization (pending invitation)`:`${o.name} — switch organization`;let u;e[2]!==o?(u=t.jsx(at,{org:o,size:"sm"}),e[2]=o,e[3]=u):u=e[3];let p;e[4]!==l||e[5]!==d?(p=l&&t.jsx("span",{className:X("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",d?"-top-1":"top-1/2 -translate-y-1/2")}),e[4]=l,e[5]=d,e[6]=p):p=e[6];let c;e[7]!==u||e[8]!==p?(c=t.jsxs("span",{className:"relative inline-flex",children:[u,p]}),e[7]=u,e[8]=p,e[9]=c):c=e[9];let h;e[10]!==o.name||e[11]!==i?(h=i&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:o.name}),e[10]=o.name,e[11]=i,e[12]=h):h=e[12];let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(jt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[13]=C):C=e[13];let x;e[14]!==m||e[15]!==c||e[16]!==h?(x=t.jsx(Ce,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":m,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[c,h,C]})}),e[14]=m,e[15]=c,e[16]=h,e[17]=x):x=e[17];let g;e[18]!==o.slug||e[19]!==x?(g=t.jsx(ls,{orgParam:o.slug,trigger:x}),e[18]=o.slug,e[19]=x,e[20]=g):g=e[20];let j;e[21]!==o.name?(j=t.jsx(ye,{side:"bottom",children:o.name}),e[21]=o.name,e[22]=j):j=e[22];let b;return e[23]!==j||e[24]!==g?(b=t.jsxs(Se,{children:[g,j]}),e[23]=j,e[24]=g,e[25]=b):b=e[25],b}function Vo(n){const e=$.c(24);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:i}=s,{org:o}=ae(),r=Re();let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[2]=a):a=e[2];const l=ht(a);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},e[3]=d):d=e[3];const m=xt(d),{threads:u}=Tt(),{data:p}=ie.useSession(),{setTaskId:c,createNewTask:h}=Ot();let C;e[4]!==o.id?(C=it(o.id),e[4]=o.id,e[5]=C):C=e[5];const x=C,g=x.id,j=l.taskId?m.virtualmcpid??g:g;let b;e[6]!==h||e[7]!==g||e[8]!==r||e[9]!==i||e[10]!==o.slug||e[11]!==p?.user?.id||e[12]!==c||e[13]!==u?(b=f=>{if(!f||f===g){r({to:"/$org",params:{org:o.slug}}),i?.();return}const _=On(u,f,p?.user?.id);_?c(_.id,f):h(f),i?.()},e[6]=h,e[7]=g,e[8]=r,e[9]=i,e[10]=o.slug,e[11]=p?.user?.id,e[12]=c,e[13]=u,e[14]=b):b=e[14];const y=b;let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[15]=w):w=e[15];const N=j===g?x:void 0;let I;e[16]!==j||e[17]!==y?(I=()=>y(j),e[16]=j,e[17]=y,e[18]=I):I=e[18];let O;return e[19]!==j||e[20]!==y||e[21]!==N||e[22]!==I?(O=t.jsx(H.Suspense,{fallback:w,children:t.jsx(Os,{agentId:j,fallback:N,onOpenHome:I,onPick:y})}),e[19]=j,e[20]=y,e[21]=N,e[22]=I,e[23]=O):O=e[23],O}function Ro(){const n=$.c(24),e=V(),{org:s}=ae();let i;n[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},n[0]=i):i=n[0];const o=ht(i);let r;n[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},n[1]=r):r=n[1];const a=xt(r),{threads:l}=Tt(),{createNewTask:d}=Ot();let m;n[2]!==s.id?(m=it(s.id),n[2]=s.id,n[3]=m):m=n[3];const u=m.id,p=o.taskId?a.virtualmcpid??u:u;let c;n[4]!==o.taskId||n[5]!==l?(c=(o.taskId?l.find(I=>I.id===o.taskId)?.branch:null)??null,n[4]=o.taskId,n[5]=l,n[6]=c):c=n[6];const h=c;let C;n[7]!==p||n[8]!==d||n[9]!==h?(C=()=>{d(p,h)},n[7]=p,n[8]=d,n[9]=h,n[10]=C):C=n[10];const x=C;let g;n[11]!==e?(g=e("sidebar.taskGroupsList.newChat"),n[11]=e,n[12]=g):g=n[12];let j;n[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(sn,{size:16}),n[13]=j):j=n[13];let b;n[14]!==x||n[15]!==g?(b=t.jsx(Ce,{asChild:!0,children:t.jsx("button",{type:"button",onClick:x,"aria-label":g,className:"wco-no-drag flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:j})}),n[14]=x,n[15]=g,n[16]=b):b=n[16];let y;n[17]!==e?(y=e("sidebar.taskGroupsList.newChat"),n[17]=e,n[18]=y):y=n[18];let w;n[19]!==y?(w=t.jsx(ye,{side:"bottom",children:y}),n[19]=y,n[20]=w):w=n[20];let N;return n[21]!==b||n[22]!==w?(N=t.jsxs(Se,{children:[b,w]}),n[21]=b,n[22]=w,n[23]=N):N=n[23],N}function zs({open:n,onOpenChange:e,onCreated:s}){const i=V(),{org:o}=ae(),{data:r}=ie.useSession(),{stdioEnabled:a}=Jt(),l=Pt(),d=Et(),m=zt(),p=Mt(m,"").items,c=pt({resolver:gt(qn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),h=c.watch("ui_type"),C=c.watch("connection_url"),x=c.watch("npx_package"),g=$e({uiType:h,connectionUrl:C??"",npxPackage:x??""})??dt({uiType:h,connectionUrl:C??"",registryItems:p}),j=f=>{const _=f.trim();if(!_)return;const T=!!c.formState.dirtyFields.title,S=!!c.formState.dirtyFields.description,v=!!c.formState.dirtyFields.env_vars,P=A=>{if(A&&(!T&&!c.getValues("title").trim()&&A.title&&c.setValue("title",A.title,{shouldDirty:!1}),!S&&!(c.getValues("description")??"").trim()&&A.description&&c.setValue("description",A.description,{shouldDirty:!1}),!v&&A.envVarKeys?.length)){const z=c.getValues("env_vars")??[],B=new Set(z.map(M=>M.key)),E=A.envVarKeys.filter(M=>!B.has(M));E.length>0&&c.setValue("env_vars",[...z,...E.map(M=>({key:M,value:""}))],{shouldDirty:!0})}},k=Wn(_);if(k&&a){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",k.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),P($e({uiType:"NPX",npxPackage:k.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const A=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";c.setValue("ui_type",A,{shouldDirty:!0}),c.setValue("connection_url",_,{shouldDirty:!0}),P($e({uiType:A,connectionUrl:_})??dt({uiType:A,connectionUrl:_,registryItems:p}));return}h==="NPX"&&P($e({uiType:"NPX",npxPackage:_}))},b=f=>{f||c.reset(),e(f)},y=async f=>{let _,T=null,S=null,v=null;f.ui_type==="NPX"?(_="STDIO",T="",v=Qn(f.npx_package||"",f.env_vars||[])):f.ui_type==="STDIO"?(_="STDIO",T="",v=Yn(f.stdio_command||"",f.stdio_args||"",f.stdio_cwd,f.env_vars||[])):(_=f.ui_type,T=f.connection_url||"",S=f.connection_token||null);const P=Mn("conn");try{await d.create.mutateAsync({id:P,title:f.title,description:f.description||null,connection_type:_,connection_url:T,connection_token:S,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:r?.user?.id||"system",organization_id:o.id,icon:f.icon??null,app_name:null,app_id:null,connection_headers:v,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),c.reset(),e(!1),s?.(P)}catch{G.error(i("connections.createConnectionDialog.failedToCreateConnection"))}},w=i("connections.createConnectionDialog.title"),N=i("connections.createConnectionDialog.description"),I=c.formState.isSubmitting?i("connections.createConnectionDialog.saving"):i("connections.createConnectionDialog.createButton"),O=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:c.control,name:"ui_type",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.typeLabel")}),t.jsxs(Rn,{value:f.value,onValueChange:f.onChange,children:[t.jsx(Z,{children:t.jsx(Hn,{children:t.jsx(Gn,{})})}),t.jsxs(Kn,{children:[t.jsx(De,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.httpType")]})}),t.jsx(De,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.sseType")]})}),t.jsx(De,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.websocketType")]})}),a&&t.jsxs(t.Fragment,{children:[t.jsx(De,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Le,{className:"w-4 h-4"}),i("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(De,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(on,{className:"w-4 h-4"}),i("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(ee,{})]})}),h==="NPX"&&t.jsx(Q,{control:c.control,name:"npx_package",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.npmPackagePlaceholder"),...f,value:f.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),c.setValue("npx_package",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),f.onBlur()}})}),t.jsx(ee,{})]})}),h==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:c.control,name:"stdio_command",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.commandLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.commandPlaceholder"),...f,value:f.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:c.control,name:"stdio_args",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.argumentsLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.argumentsPlaceholder"),...f,value:f.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:c.control,name:"stdio_cwd",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.workingDirectoryPlaceholder"),...f,value:f.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(ee,{})]})})]}),(h==="NPX"||h==="STDIO")&&t.jsx(Q,{control:c.control,name:"env_vars",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(Z,{children:t.jsx(Xn,{value:f.value??[],onChange:f.onChange})}),t.jsx(ee,{})]})}),h!=="NPX"&&h!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:c.control,name:"connection_url",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.urlLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.urlPlaceholder"),...f,value:f.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),c.setValue("connection_url",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),f.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:c.control,name:"connection_token",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:g?.token?.label??i("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(Z,{children:t.jsx(oe,{type:"password",placeholder:g?.token?.placeholder??i("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...f,value:f.value??""})}),g?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[g.token.helperText,g.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:i("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:c.control,name:"title",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.namePlaceholder"),...f})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:c.control,name:"description",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.descriptionLabel")}),t.jsx(Z,{children:t.jsx(Un,{placeholder:i("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...f,value:f.value??""})}),t.jsx(ee,{})]})})]});return l?t.jsx(kt,{open:n,onOpenChange:b,children:t.jsxs(It,{className:"max-h-[90vh]",children:[t.jsx(yn,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(At,{children:w}),t.jsx(Sn,{className:"mt-1",children:N})]}),t.jsx(wn,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Nt,{size:16})})})]})}),t.jsx(st,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(y),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:O}),t.jsx(_n,{children:t.jsx(ne,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:I})})]})})]})}):t.jsx($t,{open:n,onOpenChange:b,children:t.jsxs(Ft,{className:"sm:max-w-[525px]",children:[t.jsxs(Lt,{children:[t.jsx(Bt,{children:w}),t.jsx(En,{children:N})]}),t.jsx(st,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(y),children:[t.jsx("div",{className:"py-4",children:O}),t.jsxs(Vn,{children:[t.jsx(ne,{type:"button",variant:"outline",onClick:()=>b(!1),children:i("connections.createConnectionDialog.cancelButton")}),t.jsx(ne,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:I})]})]})})]})})}function Ms(n){const e=$.c(72),{mode:s,agentId:i,addedConnectionIds:o,onAdd:r,onCloneAndAdd:a,onConnectAndAdd:l,connectingItemId:d,search:m,onCreateConnection:u,onBrowseNavigate:p,defaultTab:c}=n,h=s===void 0?"add":s,C=c===void 0?"connected":c,x=V(),{org:g}=ae(),j=H.useDeferredValue(m),b=m!==j;let y;e[0]!==j?(y=j.trim().toLowerCase(),e[0]=j,e[1]=y):y=e[1];const w=y;let N;e[2]!==C?(N=D=>D??C,e[2]=C,e[3]=N):N=e[3];const[I,O]=Zt(en.connectionsTab(g.slug)+(C==="all"?":home-modal":":agent-modal"),N);let f;e[4]!==I||e[5]!==O?(f=D=>{D!==I&&R("connections_dialog_tab_changed",{to_tab:D}),O(D)},e[4]=I,e[5]=O,e[6]=f):f=e[6];const _=f;let T;e[7]!==g.id||e[8]!==g.slug?(T={connectionId:cn,orgId:g.id,orgSlug:g.slug},e[7]=g.id,e[8]=g.slug,e[9]=T):T=e[9];const S=ln(T),v=j?.trim().split(/\s+/).filter(Boolean)??[],P=v.length>0?{operator:"or",conditions:v.flatMap(Hs)}:void 0,k={...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},A=JSON.stringify(k),{data:z,fetchNextPage:B,hasNextPage:E,isFetchingNextPage:M}=es({queryKey:ot.collectionListInfinite(S,g.id,"","CONNECTIONS",A),queryFn:async D=>{const{pageParam:F}=D,se=F===void 0?0:F;return(await S.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:se}})).structuredContent},initialPageParam:0,getNextPageParam:Vs,staleTime:3e4}),U=z?.pages.flatMap(Es)??[],K=Bn(U),de=new Set(U.filter(Bs).map(Ls)),L=zt(),re=Mt(L,j),He=ut(re.loadMore,re.hasMore,re.isLoadingMore),Ge=ut(B,E??!1,M),W=I==="all"||!!w,ct=W?re.items.filter(D=>{const F=$n(D);if(F&&de.has(F))return!1;if(!w)return!0;const se=Ve(D._meta),ce=[D.title,D.description,D.name,D.server?.title,D.server?.description,D.server?.name,se?.friendly_name,se?.friendlyName].filter(Boolean).join(" ").toLowerCase();return v.some(te=>ce.includes(te.toLowerCase()))}):[],_e=ct.filter(Fs),Ne=ct.filter($s);let Ie;e[10]!==o?(Ie=D=>D.some(F=>o.has(F.id)),e[10]=o,e[11]=Ie):Ie=e[11];const Ke=Ie;let Ae;e[12]!==o||e[13]!==i||e[14]!==d||e[15]!==Ke||e[16]!==h||e[17]!==r||e[18]!==p||e[19]!==a||e[20]!==x?(Ae=(D,F,se,ce,te)=>{const Me=Ke(te),be=te.find(le=>!o.has(le.id)),q=te[0];if(h==="browse"){const le=Jn(q);return t.jsx(Je,{connection:{title:F,icon:se,description:te.length>1?`${te.length} instances`:ce??void 0},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",x("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{R("connection_browse_clicked",{app_name:q.app_name??null,connection_id:q.id,instances_count:te.length}),p?.(le)}},D)}return t.jsx(Je,{connection:{title:F,icon:se,description:ce},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Me&&t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",x("virtualMcp.connectionDialogContent.added")]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:le=>{le.stopPropagation(),be?(R("connection_add_clicked",{action:"use_existing",app_name:q.app_name??null,connection_id:be.id}),i&&R("agent_connection_attached",{agent_id:i,connection_id:be.id,app_name:q.app_name??null,mode:"existing"}),r(be.id)):(R("connection_add_clicked",{action:"clone",app_name:q.app_name??null,base_connection_id:q.id}),a(q))},children:x("virtualMcp.connectionDialogContent.add")})]})},D)},e[12]=o,e[13]=i,e[14]=d,e[15]=Ke,e[16]=h,e[17]=r,e[18]=p,e[19]=a,e[20]=x,e[21]=Ae):Ae=e[21];const Pe=Ae;let Te;e[22]!==d||e[23]!==h||e[24]!==l||e[25]!==x?(Te=D=>{const F=Ve(D._meta),se=F?.friendlyName||F?.friendly_name||D.server?.title||D.title||D.server?.name||D.name||D.id||"",ce=D.server?.description||D.description||null,te=D.server?.icons?.[0]?.src||Fn(D.server?.repository)||null,Me=F?.official===!0,be=F?.verified===!0,q=F?.owner==="deco";return t.jsx(Je,{connection:{title:se,description:ce,icon:te},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[q&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:t.jsx("img",{src:"/logos/deco logo.svg",alt:x("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.builtByDeco")})]}),!q&&Me&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Ze,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!q&&!Me&&be&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Ze,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:le=>{le.stopPropagation(),R("connection_add_clicked",{action:"connect_new",registry_item_id:D.id,app_name:F?.friendlyName||D.server?.name||D.name||null}),l(D)},children:d===D.id?t.jsx(ke,{size:14,className:"animate-spin"}):x(h==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${D.id}`)},e[22]=d,e[23]=h,e[24]=l,e[25]=x,e[26]=Te):Te=e[26];const lt=Te;let ue;e[27]!==I||e[28]!==_||e[29]!==u||e[30]!==w||e[31]!==x?(ue=!w&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(Zn,{tabs:[{id:"all",label:x("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:x("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:I,onTabChange:D=>_(D)}),t.jsxs(ne,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{R("connections_dialog_custom_clicked"),u()},children:[t.jsx(we,{size:12}),x("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=I,e[28]=_,e[29]=u,e[30]=w,e[31]=x,e[32]=ue):ue=e[32];const Ue=b&&"opacity-50 pointer-events-none";let me;e[33]!==Ue?(me=X("flex-1 overflow-auto p-5 transition-opacity duration-150",Ue),e[33]=Ue,e[34]=me):me=e[34];const Gt="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Oe;e[35]!==Pe?(Oe=D=>{if(D.type==="group")return Pe(D.key,D.title,D.icon,null,D.connections);const F=D.connection;return Pe(F.id,F.title,F.icon,F.description??null,[F])},e[35]=Pe,e[36]=Oe):Oe=e[36];const qe=K.map(Oe);let fe;e[37]!==Ge?(fe=t.jsx("div",{ref:Ge,className:"col-span-full h-1"}),e[37]=Ge,e[38]=fe):fe=e[38];let ge;e[39]!==M?(ge=M&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),e[39]=M,e[40]=ge):ge=e[40];const Xe=W&&_e.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(Ze,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),We=W&&_e.map(lt),Qe=W&&Ne.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Ye=W&&Ne.map(lt);let pe;e[41]!==He||e[42]!==L||e[43]!==W?(pe=W&&L.length>0&&t.jsx("div",{ref:He,className:"col-span-full h-1"}),e[41]=He,e[42]=L,e[43]=W,e[44]=pe):pe=e[44];let he;e[45]!==re.isLoadingMore||e[46]!==W?(he=W&&re.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),e[45]=re.isLoadingMore,e[46]=W,e[47]=he):he=e[47];let xe;e[48]!==qe||e[49]!==fe||e[50]!==ge||e[51]!==Xe||e[52]!==We||e[53]!==Qe||e[54]!==Ye||e[55]!==pe||e[56]!==he?(xe=t.jsxs("div",{className:Gt,children:[qe,fe,ge,Xe,We,Qe,Ye,pe,he]}),e[48]=qe,e[49]=fe,e[50]=ge,e[51]=Xe,e[52]=We,e[53]=Qe,e[54]=Ye,e[55]=pe,e[56]=he,e[57]=xe):xe=e[57];let je;e[58]!==I||e[59]!==K.length||e[60]!==Ne||e[61]!==m||e[62]!==x||e[63]!==_e?(je=K.length===0&&_e.length===0&&Ne.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:m?x("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:m}):x(I==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=I,e[59]=K.length,e[60]=Ne,e[61]=m,e[62]=x,e[63]=_e,e[64]=je):je=e[64];let ve;e[65]!==me||e[66]!==xe||e[67]!==je?(ve=t.jsxs("div",{className:me,children:[xe,je]}),e[65]=me,e[66]=xe,e[67]=je,e[68]=ve):ve=e[68];let ze;return e[69]!==ue||e[70]!==ve?(ze=t.jsxs(t.Fragment,{children:[ue,ve]}),e[69]=ue,e[70]=ve,e[71]=ze):ze=e[71],ze}function $s(n){return!n.verified&&!Ve(n._meta)?.verified&&!n.meta?.verified}function Fs(n){return n.verified||Ve(n._meta)?.verified||n.meta?.verified}function Ls(n){return n.app_name}function Bs(n){return n.app_name}function Es(n){return n?.items??[]}function Vs(n,e){if(n?.hasMore)return e.reduce(Rs,0)}function Rs(n,e){return n+(e?.items?.length??0)}function Hs(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function Ho({open:n,onOpenChange:e,defaultTab:s,initialSearch:i="",...o}){const r=V(),a=o.mode??"add",l="agentId"in o?o.agentId:void 0,d="addedConnectionIds"in o?o.addedConnectionIds??new Set:new Set,m="onAdd"in o&&o.onAdd?o.onAdd:S=>{},u=(S,v,P)=>{l&&R("agent_connection_attached",{agent_id:l,connection_id:S,app_name:v,mode:P})},[p,c]=H.useState(null),[h,C]=H.useState(i),[x,g]=H.useState(!1),{org:j}=ae(),{data:b}=ie.useSession(),y=Et(),w=tn(),N=Re(),I=S=>{e(!1),N({to:"/$org/settings/connections/$appSlug",params:{org:j.slug,appSlug:S}})},O=()=>{w.invalidateQueries({predicate:S=>{const v=S.queryKey;return v[1]===j.id&&v[3]==="collection"&&v[4]==="CONNECTIONS"}})},f=async(S,v)=>{R("connection_oauth_succeeded",{connection_id:S,flow:v});const P=new URL(`/api/${j.slug}/mcp/${S}`,window.location.origin);await w.invalidateQueries({queryKey:ot.isMCPAuthenticated(P.href,null)}),O()},_=async S=>{c(S.app_name??S.id);try{const P=`${S.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,A=(await y.create.mutateAsync({title:P,description:S.description??null,connection_type:S.connection_type,connection_url:S.connection_url??null,connection_token:null,icon:S.icon??null,app_name:S.app_name??null,app_id:S.app_id??null,connection_headers:S.connection_headers??null})).id,z=await tt({connectionId:A,orgId:j.id,orgSlug:j.slug,persistFallback:B=>y.update.mutateAsync({id:A,data:{connection_token:B}}).then(()=>{})});if(z.ran&&!z.ok){R("connection_oauth_failed",{connection_id:A,flow:"clone",error:z.error??"no_token"}),G.error(r("virtualMcp.addConnectionDialog.authenticationFailedError",{error:z.error??"no token received"})),await y.delete.mutateAsync(A);return}z.ran&&await f(A,"clone"),u(A,S.app_name??null,"clone"),m(A)}catch(v){console.error("Failed to add connection:",v),G.error(r("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{c(null)}},T=async S=>{if(!(!j||!b?.user?.id)){c(S.id);try{const v=Ln(S,j.id,b.user.id,{remoteIndex:0}),P=v.connection_type==="STDIO",k=!!v.connection_url,A=P&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!k&&!A){G.error(r("virtualMcp.addConnectionDialog.mcpServerConnectionError")),c(null);return}const{id:z}=await y.create.mutateAsync(v),B=await tt({connectionId:z,orgId:j.id,orgSlug:j.slug,persistFallback:E=>y.update.mutateAsync({id:z,data:{connection_token:E}}).then(()=>{})});if(B.ran&&!B.ok){R("connection_oauth_failed",{connection_id:z,flow:"connect_new",error:B.error??"no_token"}),G.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:B.error??"no token received"})}),u(z,v.app_name??null,"new"),m(z);return}B.ran?(await f(z,"connect_new"),G.success(r("virtualMcp.addConnectionDialog.connectedAuthenticated"))):G.success(r("virtualMcp.addConnectionDialog.connected")),u(z,v.app_name??null,"new"),m(z)}catch(v){console.error("Failed to connect:",v),G.error(r("virtualMcp.addConnectionDialog.failedToConnect"))}finally{c(null)}}};return t.jsxs($t,{open:n,onOpenChange:e,children:[t.jsxs(Ft,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(Lt,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(Bt,{className:"text-base font-semibold",children:r(a==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(zn,{value:h,onChange:C,placeholder:r("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ms,{mode:a,agentId:l,addedConnectionIds:d,onAdd:m,onCloneAndAdd:_,onConnectAndAdd:T,connectingItemId:p,search:h,onCreateConnection:()=>g(!0),onBrowseNavigate:I,defaultTab:s})})]}),t.jsx(zs,{open:x,onOpenChange:g,onCreated:async S=>{g(!1);const v=await tt({connectionId:S,orgId:j.id,orgSlug:j.slug,persistFallback:P=>y.update.mutateAsync({id:S,data:{connection_token:P}}).then(()=>{})});if(v.ran&&!v.ok){R("connection_oauth_failed",{connection_id:S,flow:"custom_create",error:v.error??"no_token"}),G.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:v.error??"no token received"})}),u(S,null,"custom"),m(S),e(!1);return}v.ran&&await f(S,"custom_create"),u(S,null,"custom"),m(S),e(!1)}})]})}const ft=new Map;function Go(){const{org:n}=ae(),e=ts(),s=ns(),i=s.find(g=>g.providerId==="deco"),{data:o,isLoading:r,refetch:a,isFetching:l}=nn({queryKey:ot.aiProviderCredits(n.id,"deco"),enabled:!!i,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),d=o?.balanceCents??null,m=d!=null?d/100:null,u=H.useRef(new Map);if(d!=null){const g=ft.get(n.id);u.current.get(n.id)&&g!=null&&d>g&&R("credits_topped_up_detected",{organization_id:n.id,delta_cents:d-g,previous_balance_cents:g,new_balance_cents:d}),ft.set(n.id,d),u.current.set(n.id,!0)}const p=!!i,c=d!=null&&d>0,h=d!=null&&d===0,C=d!=null&&d===200,x=s.length>0&&s.every(g=>g.providerId==="deco");return{hasDecoKey:p,decoKeyId:i?.id??null,balanceCents:d,balanceDollars:m,hasCredits:c,isZeroBalance:h,isInitialFreeCredit:C,hasOnlyDecoProvider:x,isLoading:r,isFetching:l,refetch:a}}export{Vo as A,Ro as N,Eo as O,Ho as a,ls as b,at as c,fs as d,Fo as e,Rt as f,$o as g,Bo as h,Lo as i,rt as r,Go as u};
|
|
1
|
+
import{W as Kt,X as Ut,c as $,b as V,Y as gt,Z as pt,e as qt,j as t,a as ie,B as ne,r as H,aI as Xt,d as Re,s as Wt,m as X,t as G,w as Qt,k as ke,p as R,F as ae,L as Yt,f as ht,u as xt,D as Jt,I as Zt,G as en,K as ot,o as tn,n as nn}from"./index-DnHWblfu.js";import{t as jt}from"./ChevronDown-BNTAvoWs.js";import{A as vt,l as sn,d as on}from"./agent-icon-DRGNhHDy.js";import{T as Ce,a as ye,c as Se}from"./tooltip-44-2qw6b.js";import{u as bt,d as Ct,c as yt}from"./sidebar-DCTvELfP.js";import{a as it,i as an,f as rn,S as cn,u as ln}from"./use-mcp-client-BG7zveIM.js";import{a as dn,u as un}from"./use-virtual-mcp-D6qbeGCA.js";import{a as Be,b as St,P as wt}from"./popover-CVp_epYO.js";import{i as Ee}from"./Check-BQap7Cpe.js";import{s as we}from"./Plus-Dc9c0aJB.js";import{i as _t}from"./SearchMd-BnuXOyI2.js";import{s as Nt}from"./XClose-BHqSO9Fx.js";import{c as mn,d as fn,b as gn,f as pn,e as hn,a as xn,A as jn}from"./alert-dialog-vMeKz1oj.js";import{F as Q,a as st,b as Y,c as J,d as Z,f as vn,e as ee}from"./form-BSs_Wcc9.js";import{I as oe}from"./input-BKgQbLb7.js";import{S as bn}from"./chat-context-BrrGaGbH.js";import{T as Dt}from"./toolbar-n9I75ths.js";import{S as Cn}from"./skeleton-CQ4Si4tx.js";import{D as kt,a as It,b as At,c as yn,e as Sn,f as wn,g as _n}from"./drawer-BAKGed9i.js";import{u as Pt}from"./use-mobile-ChN0uU-Y.js";import{G as Nn}from"./use-registry-app-D6fcGueu.js";import{G as Dn}from"./github-repo-picker-BcZWgRSG.js";import{b as kn,a as Tt}from"./hooks-CSzZamSr.js";import{u as In,g as An,a as Pn,b as Tn}from"./use-navigate-to-agent-_n3ZB1G-.js";import{u as Ot}from"./shell-layout-BBtwtRs8.js";import{f as On}from"./reusable-new-chat-CouMjkYR.js";import{C as zn}from"./collection-search-BXUxGpkT.js";import{g as Mn,a as $n,b as Fn,e as Ln}from"./extract-connection-data-y9r-PxK0.js";import{u as zt,a as Mt,g as Bn,C as Je}from"./connection-card-BNd9VNGL.js";import{e as $t,d as Ft,a as Lt,b as Bt,h as En,c as Vn}from"./dialog-DgVuLqhS.js";import{S as Rn,a as Hn,b as Gn,c as Kn,d as De}from"./select-g0E4j9Tt.js";import{T as Un}from"./textarea-CDJ9hAiD.js";import{b as Et}from"./use-connection-DNsAtxSX.js";import{a as Le,b as Ze}from"./Tool02-C2mcM2YH.js";import{s as et}from"./Star01-CS45XDsX.js";import{c as qn,i as $e,a as dt,E as Xn,p as Wn,b as Qn,d as Yn}from"./connection-form-helpers-BRVXGHSF.js";import{a as tt}from"./authenticate-and-persist-oauth-CMEBdT9l.js";import{g as Jn}from"./connection-slug-eyAPH6o3.js";import{C as Zn}from"./collection-tabs-CrFDWpQo.js";import{u as ut}from"./use-infinite-scroll-68HpgFc8.js";import{B as Fe}from"./badge-DHX2ckQi.js";import{u as es}from"./useSuspenseInfiniteQuery-n2PIbfd5.js";import{g as Ve}from"./metadata-dUsYcpuu.js";import{u as ts}from"./studio-tools-1de_48yn.js";import{u as ns}from"./use-ai-providers-CuhkQheE.js";function mt(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ss=Kt({name:Ut().min(2,"Organization name is required")});function os(n){const e=$.c(66),{open:s,onOpenChange:i}=n,o=V();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:gt(ss),defaultValues:{name:""}},e[0]=r):r=e[0];const a=pt(r);let l;e[1]!==o?(l=async E=>{const M=mt(E.name);if(!M)throw new Error(o("common.createOrganizationDialog.invalidSlug"));const U=await ie.organization.create({name:E.name,slug:M});if(U?.error)throw new Error(U.error.message||o("common.createOrganizationDialog.failedToCreate"));const K=U?.data?.slug??M;if(!K)throw new Error(o("common.createOrganizationDialog.failedToCreate"));return{orgSlug:K}},e[1]=o,e[2]=l):l=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=is,e[3]=d):d=e[3];let m;e[4]!==l?(m={mutationFn:l,onSuccess:d},e[4]=l,e[5]=m):m=e[5];const u=qt(m);let p;e[6]!==u.error||e[7]!==o?(p=u.error instanceof Error?u.error.message:u.error?o("common.createOrganizationDialog.failedToCreateGeneric"):null,e[6]=u.error,e[7]=o,e[8]=p):p=e[8];const c=p;let h;e[9]!==o?(h=o("common.createOrganizationDialog.title"),e[9]=o,e[10]=h):h=e[10];let C;e[11]!==h?(C=t.jsx(mn,{children:h}),e[11]=h,e[12]=C):C=e[12];let x;e[13]!==o?(x=o("common.createOrganizationDialog.description"),e[13]=o,e[14]=x):x=e[14];let g;e[15]!==x?(g=t.jsx(fn,{children:x}),e[15]=x,e[16]=g):g=e[16];let j;e[17]!==C||e[18]!==g?(j=t.jsxs(gn,{children:[C,g]}),e[17]=C,e[18]=g,e[19]=j):j=e[19];let b;if(e[20]!==u||e[21]!==a){let E;e[23]!==u?(E=M=>u.mutateAsync(M),e[23]=u,e[24]=E):E=e[24],b=a.handleSubmit(E),e[20]=u,e[21]=a,e[22]=b}else b=e[22];let y;e[25]!==a.formState.isSubmitting||e[26]!==o?(y=E=>{const{field:M}=E;return t.jsxs(Y,{children:[t.jsx(J,{children:o("common.createOrganizationDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(oe,{...M,placeholder:o("common.createOrganizationDialog.namePlaceholder"),disabled:a.formState.isSubmitting})}),t.jsx(vn,{children:o("common.createOrganizationDialog.nameDescription")}),M.value&&t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[o("common.createOrganizationDialog.urlLabel")," ",t.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",mt(M.value)]})]}),t.jsx(ee,{})]})},e[25]=a.formState.isSubmitting,e[26]=o,e[27]=y):y=e[27];let w;e[28]!==a.control||e[29]!==y?(w=t.jsx(Q,{control:a.control,name:"name",render:y}),e[28]=a.control,e[29]=y,e[30]=w):w=e[30];let N;e[31]!==c?(N=c&&t.jsx("div",{className:"text-destructive text-sm mt-2",children:c}),e[31]=c,e[32]=N):N=e[32];const I=a.formState.isSubmitting;let O;e[33]!==u||e[34]!==a?(O=()=>{u.reset(),a.reset()},e[33]=u,e[34]=a,e[35]=O):O=e[35];let f;e[36]!==o?(f=o("common.createOrganizationDialog.cancel"),e[36]=o,e[37]=f):f=e[37];let _;e[38]!==a.formState.isSubmitting||e[39]!==O||e[40]!==f?(_=t.jsx(pn,{disabled:I,onClick:O,children:f}),e[38]=a.formState.isSubmitting,e[39]=O,e[40]=f,e[41]=_):_=e[41];const T=!a.formState.isValid||a.formState.isSubmitting;let S;e[42]!==a.formState.isSubmitting||e[43]!==o?(S=a.formState.isSubmitting?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(bn,{size:"xs"})," ",o("common.createOrganizationDialog.creating")]}):o("common.createOrganizationDialog.createButton"),e[42]=a.formState.isSubmitting,e[43]=o,e[44]=S):S=e[44];let v;e[45]!==T||e[46]!==S?(v=t.jsx(ne,{type:"submit",variant:"default",disabled:T,children:S}),e[45]=T,e[46]=S,e[47]=v):v=e[47];let P;e[48]!==_||e[49]!==v?(P=t.jsxs(hn,{children:[_,v]}),e[48]=_,e[49]=v,e[50]=P):P=e[50];let k;e[51]!==b||e[52]!==w||e[53]!==N||e[54]!==P?(k=t.jsxs("form",{className:"space-y-6",onSubmit:b,autoComplete:"off",children:[w,N,P]}),e[51]=b,e[52]=w,e[53]=N,e[54]=P,e[55]=k):k=e[55];let A;e[56]!==a||e[57]!==k?(A=t.jsx(st,{...a,children:k}),e[56]=a,e[57]=k,e[58]=A):A=e[58];let z;e[59]!==j||e[60]!==A?(z=t.jsxs(xn,{children:[j,A]}),e[59]=j,e[60]=A,e[61]=z):z=e[61];let B;return e[62]!==i||e[63]!==s||e[64]!==z?(B=t.jsx(jn,{open:s,onOpenChange:i,children:z}),e[62]=i,e[63]=s,e[64]=z,e[65]=B):B=e[65],B}function is(n){const{orgSlug:e}=n;window.location.href=`/${e}`}function Vt(){const n=H.useContext(Xt),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date),refetch:()=>s?.()}}function as(n){let e=0;for(let i=0;i<n.length;i++)e=n.charCodeAt(i)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function at(n){const e=$.c(13),{org:s,size:i}=n,o=i===void 0?"sm":i,r=o==="xs"?"size-5":"size-6",a=o==="xs"?"text-[9px]":"text-xs";let l;e[0]!==r?(l=X(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=l):l=e[1];let d;e[2]!==s.logo||e[3]!==s.name?(d=s.logo?void 0:as(s.name),e[2]=s.logo,e[3]=s.name,e[4]=d):d=e[4];let m;e[5]!==s.logo||e[6]!==s.name||e[7]!==a?(m=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:X("font-semibold leading-none",a),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=a,e[8]=m):m=e[8];let u;return e[9]!==l||e[10]!==d||e[11]!==m?(u=t.jsx("div",{className:l,style:d,children:m}),e[9]=l,e[10]=d,e[11]=m,e[12]=u):u=e[12],u}function rs({invitation:n,onChanged:e}){const s=V(),[i,o]=H.useState(!1),r=n.organizationName??s("header.orgSwitcher.unknownOrganization"),a=async()=>{o(!0);try{const m=await ie.organization.acceptInvitation({invitationId:n.id});if(m.error){G.error(m.error.message),o(!1);return}}catch{G.error(s("header.orgSwitcher.failedToAcceptInvitation")),o(!1);return}G.success(s("header.orgSwitcher.joined",{name:r})),Qt();let d;try{d=(await ie.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=d?`/${d}`:"/"},l=async()=>{o(!0);try{const d=await ie.organization.rejectInvitation({invitationId:n.id});if(d.error){G.error(d.error.message),o(!1);return}G.success(s("header.orgSwitcher.invitationDeclined")),o(!1),e()}catch{G.error(s("header.orgSwitcher.failedToDeclineInvitation")),o(!1)}};return t.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[t.jsx(at,{org:{name:r},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:r}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsx(ne,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:a,disabled:i,children:s("header.orgSwitcher.accept")}),t.jsx(ne,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:l,disabled:i,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:r}),children:t.jsx(Nt,{size:14})})]})]})}function cs(n){const e=$.c(32),{orgParam:s,onSelectOrg:i,onCreateOrg:o}=n,r=V(),{data:a}=Wt(),{invitations:l,refetch:d}=Vt();let m;e[0]!==s?(m=(k,A)=>k.slug===s?-1:A.slug===s?1:k.name.localeCompare(A.name),e[0]=s,e[1]=m):m=e[1];const u=[...a??[]].sort(m),[p,c]=H.useState(""),h=p.toLowerCase(),C=h?u.filter(k=>k.name.toLowerCase().includes(h)||k.slug.toLowerCase().includes(h)):u;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(_t,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=x):x=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g=k=>c(k.target.value),e[3]=g):g=e[3];let j;e[4]!==p?(j=k=>k.key==="Escape"&&p&&c(""),e[4]=p,e[5]=j):j=e[5];let b;e[6]!==r?(b=r("header.orgSwitcher.searchOrganizations"),e[6]=r,e[7]=b):b=e[7];let y;e[8]!==p||e[9]!==j||e[10]!==b?(y=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:p,onChange:g,onKeyDown:j,placeholder:b,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=p,e[9]=j,e[10]=b,e[11]=y):y=e[11];let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(we,{size:16}),e[12]=w):w=e[12];let N;e[13]!==o?(N=t.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:w}),e[13]=o,e[14]=N):N=e[14];let I;e[15]!==y||e[16]!==N?(I=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,y,N]}),e[15]=y,e[16]=N,e[17]=I):I=e[17];const O="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let f;e[18]!==l||e[19]!==p||e[20]!==d?(f=!p&&l.map(k=>t.jsx(rs,{invitation:k,onChanged:d},k.id)),e[18]=l,e[19]=p,e[20]=d,e[21]=f):f=e[21];const _=C.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:p?r("header.orgSwitcher.noOrganizationsMatch",{query:p}):r("header.orgSwitcher.noOrganizationsAvailable")});let T;e[22]!==i||e[23]!==s?(T=k=>t.jsxs("button",{type:"button",onClick:()=>i(k.slug),className:X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",k.slug===s?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[t.jsx(at,{org:k,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:k.name}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.slug})]}),k.slug===s&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id),e[22]=i,e[23]=s,e[24]=T):T=e[24];const S=C.map(T);let v;e[25]!==f||e[26]!==_||e[27]!==S?(v=t.jsxs("div",{className:O,children:[f,_,S]}),e[25]=f,e[26]=_,e[27]=S,e[28]=v):v=e[28];let P;return e[29]!==v||e[30]!==I?(P=t.jsxs(t.Fragment,{children:[I,v]}),e[29]=v,e[30]=I,e[31]=P):P=e[31],P}function ls(n){const e=$.c(22),{trigger:s,orgParam:i,align:o,side:r}=n,a=o===void 0?"start":o,l=r===void 0?"bottom":r,d=Re(),[m,u]=H.useState(!1),[p,c]=H.useState(!1);let h;e[0]!==s?(h=t.jsx(Be,{asChild:!0,children:s}),e[0]=s,e[1]=h):h=e[1];const C=String(m);let x;e[2]!==d?(x=I=>{u(!1),d({to:"/$org",params:{org:I}})},e[2]=d,e[3]=x):x=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{u(!1),c(!0)},e[4]=g):g=e[4];let j;e[5]!==i||e[6]!==C||e[7]!==x?(j=t.jsx(cs,{orgParam:i,onSelectOrg:x,onCreateOrg:g},C),e[5]=i,e[6]=C,e[7]=x,e[8]=j):j=e[8];let b;e[9]!==a||e[10]!==l||e[11]!==j?(b=t.jsx(St,{side:l,align:a,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:us,onCloseAutoFocus:ds,children:j}),e[9]=a,e[10]=l,e[11]=j,e[12]=b):b=e[12];let y;e[13]!==m||e[14]!==h||e[15]!==b?(y=t.jsxs(wt,{open:m,onOpenChange:u,children:[h,b]}),e[13]=m,e[14]=h,e[15]=b,e[16]=y):y=e[16];let w;e[17]!==p?(w=t.jsx(os,{open:p,onOpenChange:c}),e[17]=p,e[18]=w):w=e[18];let N;return e[19]!==w||e[20]!==y?(N=t.jsxs(t.Fragment,{children:[y,w]}),e[19]=w,e[20]=y,e[21]=N):N=e[21],N}function ds(n){return n.preventDefault()}function us(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function ms(n){const e=$.c(21),{value:s,onChange:i,placeholder:o,onKeyDown:r,className:a,isSearching:l,disabled:d}=n,m=o===void 0?"Search...":o;let u;e[0]!==a?(u=X("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=u):u=e[1];const p=d?"cursor-not-allowed opacity-50":"cursor-text";let c;e[2]!==p?(c=X("flex items-center gap-2.5 h-12 px-4",p),e[2]=p,e[3]=c):c=e[3];let h;e[4]!==l?(h=l?t.jsx(ke,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(_t,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=l,e[5]=h):h=e[5];let C;e[6]!==i?(C=b=>i(b.target.value),e[6]=i,e[7]=C):C=e[7];let x;e[8]!==d||e[9]!==r||e[10]!==m||e[11]!==C||e[12]!==s?(x=t.jsx("input",{type:"text",value:s,onChange:C,onKeyDown:r,placeholder:m,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=r,e[10]=m,e[11]=C,e[12]=s,e[13]=x):x=e[13];let g;e[14]!==c||e[15]!==h||e[16]!==x?(g=t.jsxs("label",{className:c,children:[h,x]}),e[14]=c,e[15]=h,e[16]=x,e[17]=g):g=e[17];let j;return e[18]!==u||e[19]!==g?(j=t.jsx("div",{className:u,children:g}),e[18]=u,e[19]=g,e[20]=j):j=e[20],j}function rt(n){const e=n?.metadata?.githubRepo;if(!e?.url)return{status:"none"};const s=e.connectionId;return!!s&&!!n?.connections?.some(r=>r.connection_id===s)?{status:"attached",repo:e,connectionId:s}:!!s||e.installationId!=null?{status:"detached",repo:e}:{status:"public-clone",repo:e}}function $o(n){const e=rt(n);return e.status==="attached"||e.status==="public-clone"?e.repo:null}function Rt(n){if(typeof n!="object"||n===null)return!1;const s=n.githubRepo?.url;return typeof s=="string"&&s.length>0}function Fo(n){return rt(n).status==="attached"}function Lo(n){const e=rt(n).status;return e==="attached"||e==="detached"}function fs(n){const e=new Set;for(const s of n??[]){const i=s.metadata?.liveAgentId;typeof i=="string"&&i&&e.add(s.id)}return e}function Bo(n,e){if(!n)return null;const s=n.metadata?.liveAgentId;if(typeof s=="string"&&s)return{mode:"dev",targetId:s};const i=(e??[]).find(o=>o.metadata?.liveAgentId===n.id);return i?{mode:"live",targetId:i.id}:null}function gs(n){const e=$.c(6),{value:s,onChange:i}=n,o=V();let r;e[0]!==o?(r=o("sidebar.agentsSection.searchAgents"),e[0]=o,e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==r||e[4]!==s?(a=t.jsx(ms,{value:s,onChange:i,placeholder:r}),e[2]=i,e[3]=r,e[4]=s,e[5]=a):a=e[5],a}function ps(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=i):i=n[3],i}function hs(n){const e=$.c(10),{org:s,onClose:i}=n,o=V();let r;e[0]!==s.slug?(r={org:s.slug},e[0]=s.slug,e[1]=r):r=e[1];let a;e[2]!==i?(a=()=>i(),e[2]=i,e[3]=a):a=e[3];let l;e[4]!==o?(l=o("sidebar.agentsSection.seeAllAgents"),e[4]=o,e[5]=l):l=e[5];let d;return e[6]!==r||e[7]!==a||e[8]!==l?(d=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(Yt,{to:"/$org/settings/agents",params:r,onClick:a,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:l})}),e[6]=r,e[7]=a,e[8]=l,e[9]=d):d=e[9],d}function xs(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(Ht,{children:s}),n[2]=s,n[3]=i):i=n[3],i}function js(n){const e=$.c(11),{onImportFromGithub:s}=n,i=V();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Nn,{className:"size-3.5"}),e[0]=o):o=e[0];let r;e[1]!==i?(r=i("sidebar.agentsSection.import"),e[1]=i,e[2]=r):r=e[2];let a;e[3]!==s||e[4]!==r?(a=t.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[o,r]}),e[3]=s,e[4]=r,e[5]=a):a=e[5];let l;e[6]!==i?(l=i("sidebar.agentsSection.codeAgents"),e[6]=i,e[7]=l):l=e[7];let d;return e[8]!==a||e[9]!==l?(d=t.jsx(Ht,{action:a,children:l}),e[8]=a,e[9]=l,e[10]=d):d=e[10],d}function vs(n){const e=$.c(11),{setOpen:s,emptyCtaClass:i}=n,o=V();let r;e[0]!==o?(r=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=r):r=e[1];let a;e[2]!==i?(a=X(i),e[2]=i,e[3]=a):a=e[3];let l;e[4]!==s?(l=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=l):l=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(we,{className:"size-4"}),e[6]=d):d=e[6];let m;return e[7]!==r||e[8]!==a||e[9]!==l?(m=t.jsx(Dt,{"aria-label":r,className:a,onClick:l,children:d}),e[7]=r,e[8]=a,e[9]=l,e[10]=m):m=e[10],m}function bs(n){const e=$.c(17),{setOpen:s,highlightEmpty:i,emptyCtaClass:o}=n,r=V();let a;e[0]!==i||e[1]!==r?(a=i?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=r,e[2]=a):a=e[2];let l;e[3]!==o?(l=X(o),e[3]=o,e[4]=l):l=e[4];let d;e[5]!==s?(d=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=d):d=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(we,{}),e[7]=m):m=e[7];let u;e[8]!==r?(u=r("sidebar.agentsSection.newAgent"),e[8]=r,e[9]=u):u=e[9];let p;e[10]!==u?(p=t.jsx("span",{children:u}),e[10]=u,e[11]=p):p=e[11];let c;return e[12]!==a||e[13]!==l||e[14]!==d||e[15]!==p?(c=t.jsx(Ct,{children:t.jsxs(yt,{tooltip:a,className:l,onClick:d,children:[m,p]})}),e[12]=a,e[13]=l,e[14]=d,e[15]=p,e[16]=c):c=e[16],c}function Cs(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(At,{className:"sr-only",children:s}),n[2]=s,n[3]=i):i=n[3],i}function ys(n){const e=$.c(8),{emptyCtaClass:s}=n,i=V();let o;e[0]!==i?(o=i("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=o):o=e[1];let r;e[2]!==s?(r=X(s),e[2]=s,e[3]=r):r=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{className:"size-4"}),e[4]=a):a=e[4];let l;return e[5]!==o||e[6]!==r?(l=t.jsx(Dt,{"aria-label":o,className:r,children:a}),e[5]=o,e[6]=r,e[7]=l):l=e[7],l}function Ss(n){const e=$.c(19),{wrapEmptyHint:s,highlightEmpty:i,emptyCtaClass:o}=n,r=V();let a;e[0]!==i||e[1]!==r?(a=i?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=r,e[2]=a):a=e[2];let l;e[3]!==o?(l=X(o),e[3]=o,e[4]=l):l=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(we,{}),e[5]=d):d=e[5];let m;e[6]!==r?(m=r("sidebar.agentsSection.newAgent"),e[6]=r,e[7]=m):m=e[7];let u;e[8]!==m?(u=t.jsx("span",{children:m}),e[8]=m,e[9]=u):u=e[9];let p;e[10]!==a||e[11]!==l||e[12]!==u?(p=t.jsx(Be,{asChild:!0,children:t.jsxs(yt,{tooltip:a,className:l,children:[d,u]})}),e[10]=a,e[11]=l,e[12]=u,e[13]=p):p=e[13];let c;e[14]!==p||e[15]!==s?(c=s(p),e[14]=p,e[15]=s,e[16]=c):c=e[16];let h;return e[17]!==c?(h=t.jsx(Ct,{children:c}),e[17]=c,e[18]=h):h=e[18],h}function ws(n){const e=$.c(9),{children:s}=n,i=V();let o;e[0]!==s?(o=t.jsx(Ce,{asChild:!0,children:s}),e[0]=s,e[1]=o):o=e[1];let r;e[2]!==i?(r=i("sidebar.agentsSection.selectAnExistingAgent"),e[2]=i,e[3]=r):r=e[3];let a;e[4]!==r?(a=t.jsx(ye,{side:"right",sideOffset:8,children:r}),e[4]=r,e[5]=a):a=e[5];let l;return e[6]!==o||e[7]!==a?(l=t.jsxs(Se,{defaultOpen:!0,delayDuration:0,children:[o,a]}),e[6]=o,e[7]=a,e[8]=l):l=e[8],l}function _s(n){const e=$.c(4),s=Re(),{create:i}=kn();let o;return e[0]!==i||e[1]!==s||e[2]!==n?(o=async r=>{const a=crypto.randomUUID();try{await i({id:a,virtual_mcp_id:r})}catch{}s({to:"/$org/$taskId",params:{org:n,taskId:a},search:{virtualmcpid:r}})},e[0]=i,e[1]=s,e[2]=n,e[3]=o):o=e[3],o}function nt(n){const e=$.c(20),{agent:s,selected:i,onClick:o}=n,r=i?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let a;e[0]!==r?(a=X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=a):a=e[1];let l;e[2]!==s.icon||e[3]!==s.title?(l=t.jsx(vt,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=l):l=e[4];let d;e[5]!==s.title?(d=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=d):d=e[6];let m;e[7]!==s.description?(m=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=m):m=e[8];let u;e[9]!==d||e[10]!==m?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,m]}),e[9]=d,e[10]=m,e[11]=u):u=e[11];let p;e[12]!==i?(p=i&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=i,e[13]=p):p=e[13];let c;return e[14]!==o||e[15]!==a||e[16]!==l||e[17]!==u||e[18]!==p?(c=t.jsxs("button",{type:"button",onClick:o,className:a,children:[l,u,p]}),e[14]=o,e[15]=a,e[16]=l,e[17]=u,e[18]=p,e[19]=c):c=e[19],c}function Ht(n){const e=$.c(5),{children:s,action:i}=n;let o;e[0]!==s?(o=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=o):o=e[1];let r;return e[2]!==i||e[3]!==o?(r=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[o,i]}),e[2]=i,e[3]=o,e[4]=r):r=e[4],r}function Ns(n){const e=$.c(23),{onClose:s,onSelectAgent:i,selectedAgentId:o,onImportFromGithub:r}=n,[a,l]=H.useState(""),d=dn(),m=d??[],{org:u}=ae(),{data:p}=ie.useSession(),c=p?.user?.id??"anon",h=An(d),C=Pn(),x=_s(u.slug),g=fs(d),j=a.toLowerCase(),b=m.filter(As).filter(L=>!g.has(L.id)).filter(Is).filter(L=>!a||L.title.toLowerCase().includes(j)),y=b.filter(ks),w=b.filter(Ds),N=it(u.id),I=!a||N.title.toLowerCase().includes(j),O=!!(i&&I);let f;e[0]!==s||e[1]!==i?(f=()=>{i?.(null),s(),l("")},e[0]=s,e[1]=i,e[2]=f):f=e[2];const _=f,T=L=>{if(i){i(L.id),s(),l("");return}Tn({orgId:u.id,userId:c},L.id,h),C(),s(),l(""),x(L.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let v;e[3]!==a?(v=t.jsx(gs,{value:a,onChange:l}),e[3]=a,e[4]=v):v=e[4];const P="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",k=i&&I&&N&&t.jsx(nt,{agent:N,selected:!o||o===N.id,onClick:_}),A=(y.length>0||!a)&&t.jsx(js,{onImportFromGithub:r}),z=y.map(L=>t.jsx(nt,{agent:L,selected:i?o===L.id:void 0,onClick:()=>T(L)},L.id)),B=w.length>0&&t.jsx(xs,{}),E=w.map(L=>t.jsx(nt,{agent:L,selected:i?o===L.id:void 0,onClick:()=>T(L)},L.id));let M;e[5]!==O||e[6]!==a||e[7]!==b.length?(M=b.length===0&&!O&&a&&t.jsx(ps,{}),e[5]=O,e[6]=a,e[7]=b.length,e[8]=M):M=e[8];let U;e[9]!==M||e[10]!==k||e[11]!==A||e[12]!==z||e[13]!==B||e[14]!==E?(U=t.jsxs("div",{className:P,children:[k,A,z,B,E,M]}),e[9]=M,e[10]=k,e[11]=A,e[12]=z,e[13]=B,e[14]=E,e[15]=U):U=e[15];let K;e[16]!==s||e[17]!==u?(K=t.jsx(hs,{org:u,onClose:s}),e[16]=s,e[17]=u,e[18]=K):K=e[18];let de;return e[19]!==U||e[20]!==K||e[21]!==v?(de=t.jsxs("div",{className:S,children:[v,U,K]}),e[19]=U,e[20]=K,e[21]=v,e[22]=de):de=e[22],de}function Ds(n){return!Rt(n.metadata)}function ks(n){return Rt(n.metadata)}function Is(n){return!rn(n.id)}function As(n){return!an(n.id)}function Ps(n){const e=$.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:i,trigger:o,onSelectAgent:r,selectedAgentId:a,side:l,align:d}=s,m=i===void 0?!1:i,u=l===void 0?"right":l,p=d===void 0?"start":d,[c,h]=H.useState(!1),[C,x]=H.useState(!1),g=Pt(),{setOpenMobile:j}=bt(),b=In(),y=b?"border border-border":void 0;let w;e[2]!==b?(w=A=>b?t.jsx(ws,{children:A}):A,e[2]=b,e[3]=w):w=e[3];const N=w;let I;e[4]!==g||e[5]!==j?(I=()=>{h(!1),g&&j(!1)},e[4]=g,e[5]=j,e[6]=I):I=e[6];const O=I;let f;e[7]!==O?(f=()=>{O(),x(!0)},e[7]=O,e[8]=f):f=e[8];const _=f;let T;e[9]!==O||e[10]!==_||e[11]!==r||e[12]!==c||e[13]!==a?(T=c&&t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(Cn,{className:"h-4 w-24"})}),children:t.jsx(Ns,{onClose:O,onSelectAgent:r,selectedAgentId:a,onImportFromGithub:_})}),e[9]=O,e[10]=_,e[11]=r,e[12]=c,e[13]=a,e[14]=T):T=e[14];const S=T;let v;e[15]!==p||e[16]!==m||e[17]!==y||e[18]!==b||e[19]!==g||e[20]!==c||e[21]!==S||e[22]!==u||e[23]!==o||e[24]!==N?(v=g?t.jsxs(t.Fragment,{children:[o?t.jsx("button",{type:"button",onClick:()=>h(!0),className:"contents",children:o}):m?N(t.jsx(vs,{setOpen:h,emptyCtaClass:y})):t.jsx(bs,{setOpen:h,highlightEmpty:b,emptyCtaClass:y}),t.jsx(kt,{open:c,onOpenChange:h,direction:"bottom",children:t.jsxs(It,{className:"max-h-[85dvh] p-0",children:[t.jsx(Cs,{}),S]})})]}):t.jsxs(wt,{open:c,onOpenChange:A=>{A&&!c&&R("agent_browser_opened",{surface:"desktop_popover"}),h(A)},children:[o?t.jsx(Be,{asChild:!0,children:o}):m?N(t.jsx(Be,{asChild:!0,children:t.jsx(ys,{emptyCtaClass:y})})):t.jsx(Ss,{wrapEmptyHint:N,highlightEmpty:b,emptyCtaClass:y}),t.jsx(St,{className:"w-[380px] p-0 overflow-hidden",side:u,align:p,children:S})]}),e[15]=p,e[16]=m,e[17]=y,e[18]=b,e[19]=g,e[20]=c,e[21]=S,e[22]=u,e[23]=o,e[24]=N,e[25]=v):v=e[25];let P;e[26]!==C?(P=t.jsx(Dn,{open:C,onOpenChange:x,mode:"agent"}),e[26]=C,e[27]=P):P=e[27];let k;return e[28]!==P||e[29]!==v?(k=t.jsxs(t.Fragment,{children:[v,P]}),e[28]=P,e[29]=v,e[30]=k):k=e[30],k}const Ts="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Os(n){const e=$.c(19),{agentId:s,fallback:i,onOpenHome:o,onPick:r}=n,a=un(s)??i??null,l=a?.title??"Super Agent",d=`Open ${l} home`,m=a?.icon??null;let u;e[0]!==m||e[1]!==l?(u=t.jsx(vt,{icon:m,name:l,size:"xs"}),e[0]=m,e[1]=l,e[2]=u):u=e[2];let p;e[3]!==o||e[4]!==d||e[5]!==u?(p=t.jsx("button",{type:"button",onClick:o,"aria-label":d,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:u}),e[3]=o,e[4]=d,e[5]=u,e[6]=p):p=e[6];let c;e[7]!==l?(c=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:l}),e[7]=l,e[8]=c):c=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(jt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=h):h=e[9];let C;e[10]!==c?(C=t.jsxs("button",{type:"button",className:Ts,children:[c,h]}),e[10]=c,e[11]=C):C=e[11];let x;e[12]!==s||e[13]!==r||e[14]!==C?(x=t.jsx(Ps,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:r,trigger:C}),e[12]=s,e[13]=r,e[14]=C,e[15]=x):x=e[15];let g;return e[16]!==p||e[17]!==x?(g=t.jsxs("div",{className:"flex min-w-0 items-center gap-0",children:[p,x]}),e[16]=p,e[17]=x,e[18]=g):g=e[18],g}function Eo(n){const e=$.c(26);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:i}=s,{org:o}=ae(),{state:r,isMobile:a}=bt(),l=Vt().invitations.length>0,d=r==="collapsed"||a,m=l?`${o.name} — switch organization (pending invitation)`:`${o.name} — switch organization`;let u;e[2]!==o?(u=t.jsx(at,{org:o,size:"sm"}),e[2]=o,e[3]=u):u=e[3];let p;e[4]!==l||e[5]!==d?(p=l&&t.jsx("span",{className:X("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",d?"-top-1":"top-1/2 -translate-y-1/2")}),e[4]=l,e[5]=d,e[6]=p):p=e[6];let c;e[7]!==u||e[8]!==p?(c=t.jsxs("span",{className:"relative inline-flex",children:[u,p]}),e[7]=u,e[8]=p,e[9]=c):c=e[9];let h;e[10]!==o.name||e[11]!==i?(h=i&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:o.name}),e[10]=o.name,e[11]=i,e[12]=h):h=e[12];let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(jt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[13]=C):C=e[13];let x;e[14]!==m||e[15]!==c||e[16]!==h?(x=t.jsx(Ce,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":m,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[c,h,C]})}),e[14]=m,e[15]=c,e[16]=h,e[17]=x):x=e[17];let g;e[18]!==o.slug||e[19]!==x?(g=t.jsx(ls,{orgParam:o.slug,trigger:x}),e[18]=o.slug,e[19]=x,e[20]=g):g=e[20];let j;e[21]!==o.name?(j=t.jsx(ye,{side:"bottom",children:o.name}),e[21]=o.name,e[22]=j):j=e[22];let b;return e[23]!==j||e[24]!==g?(b=t.jsxs(Se,{children:[g,j]}),e[23]=j,e[24]=g,e[25]=b):b=e[25],b}function Vo(n){const e=$.c(24);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:i}=s,{org:o}=ae(),r=Re();let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[2]=a):a=e[2];const l=ht(a);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},e[3]=d):d=e[3];const m=xt(d),{threads:u}=Tt(),{data:p}=ie.useSession(),{setTaskId:c,createNewTask:h}=Ot();let C;e[4]!==o.id?(C=it(o.id),e[4]=o.id,e[5]=C):C=e[5];const x=C,g=x.id,j=l.taskId?m.virtualmcpid??g:g;let b;e[6]!==h||e[7]!==g||e[8]!==r||e[9]!==i||e[10]!==o.slug||e[11]!==p?.user?.id||e[12]!==c||e[13]!==u?(b=f=>{if(!f||f===g){r({to:"/$org",params:{org:o.slug}}),i?.();return}const _=On(u,f,p?.user?.id);_?c(_.id,f):h(f),i?.()},e[6]=h,e[7]=g,e[8]=r,e[9]=i,e[10]=o.slug,e[11]=p?.user?.id,e[12]=c,e[13]=u,e[14]=b):b=e[14];const y=b;let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[15]=w):w=e[15];const N=j===g?x:void 0;let I;e[16]!==j||e[17]!==y?(I=()=>y(j),e[16]=j,e[17]=y,e[18]=I):I=e[18];let O;return e[19]!==j||e[20]!==y||e[21]!==N||e[22]!==I?(O=t.jsx(H.Suspense,{fallback:w,children:t.jsx(Os,{agentId:j,fallback:N,onOpenHome:I,onPick:y})}),e[19]=j,e[20]=y,e[21]=N,e[22]=I,e[23]=O):O=e[23],O}function Ro(){const n=$.c(24),e=V(),{org:s}=ae();let i;n[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},n[0]=i):i=n[0];const o=ht(i);let r;n[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},n[1]=r):r=n[1];const a=xt(r),{threads:l}=Tt(),{createNewTask:d}=Ot();let m;n[2]!==s.id?(m=it(s.id),n[2]=s.id,n[3]=m):m=n[3];const u=m.id,p=o.taskId?a.virtualmcpid??u:u;let c;n[4]!==o.taskId||n[5]!==l?(c=(o.taskId?l.find(I=>I.id===o.taskId)?.branch:null)??null,n[4]=o.taskId,n[5]=l,n[6]=c):c=n[6];const h=c;let C;n[7]!==p||n[8]!==d||n[9]!==h?(C=()=>{d(p,h)},n[7]=p,n[8]=d,n[9]=h,n[10]=C):C=n[10];const x=C;let g;n[11]!==e?(g=e("sidebar.taskGroupsList.newChat"),n[11]=e,n[12]=g):g=n[12];let j;n[13]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(sn,{size:16}),n[13]=j):j=n[13];let b;n[14]!==x||n[15]!==g?(b=t.jsx(Ce,{asChild:!0,children:t.jsx("button",{type:"button",onClick:x,"aria-label":g,className:"wco-no-drag flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:j})}),n[14]=x,n[15]=g,n[16]=b):b=n[16];let y;n[17]!==e?(y=e("sidebar.taskGroupsList.newChat"),n[17]=e,n[18]=y):y=n[18];let w;n[19]!==y?(w=t.jsx(ye,{side:"bottom",children:y}),n[19]=y,n[20]=w):w=n[20];let N;return n[21]!==b||n[22]!==w?(N=t.jsxs(Se,{children:[b,w]}),n[21]=b,n[22]=w,n[23]=N):N=n[23],N}function zs({open:n,onOpenChange:e,onCreated:s}){const i=V(),{org:o}=ae(),{data:r}=ie.useSession(),{stdioEnabled:a}=Jt(),l=Pt(),d=Et(),m=zt(),p=Mt(m,"").items,c=pt({resolver:gt(qn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),h=c.watch("ui_type"),C=c.watch("connection_url"),x=c.watch("npx_package"),g=$e({uiType:h,connectionUrl:C??"",npxPackage:x??""})??dt({uiType:h,connectionUrl:C??"",registryItems:p}),j=f=>{const _=f.trim();if(!_)return;const T=!!c.formState.dirtyFields.title,S=!!c.formState.dirtyFields.description,v=!!c.formState.dirtyFields.env_vars,P=A=>{if(A&&(!T&&!c.getValues("title").trim()&&A.title&&c.setValue("title",A.title,{shouldDirty:!1}),!S&&!(c.getValues("description")??"").trim()&&A.description&&c.setValue("description",A.description,{shouldDirty:!1}),!v&&A.envVarKeys?.length)){const z=c.getValues("env_vars")??[],B=new Set(z.map(M=>M.key)),E=A.envVarKeys.filter(M=>!B.has(M));E.length>0&&c.setValue("env_vars",[...z,...E.map(M=>({key:M,value:""}))],{shouldDirty:!0})}},k=Wn(_);if(k&&a){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",k.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),P($e({uiType:"NPX",npxPackage:k.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const A=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";c.setValue("ui_type",A,{shouldDirty:!0}),c.setValue("connection_url",_,{shouldDirty:!0}),P($e({uiType:A,connectionUrl:_})??dt({uiType:A,connectionUrl:_,registryItems:p}));return}h==="NPX"&&P($e({uiType:"NPX",npxPackage:_}))},b=f=>{f||c.reset(),e(f)},y=async f=>{let _,T=null,S=null,v=null;f.ui_type==="NPX"?(_="STDIO",T="",v=Qn(f.npx_package||"",f.env_vars||[])):f.ui_type==="STDIO"?(_="STDIO",T="",v=Yn(f.stdio_command||"",f.stdio_args||"",f.stdio_cwd,f.env_vars||[])):(_=f.ui_type,T=f.connection_url||"",S=f.connection_token||null);const P=Mn("conn");try{await d.create.mutateAsync({id:P,title:f.title,description:f.description||null,connection_type:_,connection_url:T,connection_token:S,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:r?.user?.id||"system",organization_id:o.id,icon:f.icon??null,app_name:null,app_id:null,connection_headers:v,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),c.reset(),e(!1),s?.(P)}catch{G.error(i("connections.createConnectionDialog.failedToCreateConnection"))}},w=i("connections.createConnectionDialog.title"),N=i("connections.createConnectionDialog.description"),I=c.formState.isSubmitting?i("connections.createConnectionDialog.saving"):i("connections.createConnectionDialog.createButton"),O=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:c.control,name:"ui_type",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.typeLabel")}),t.jsxs(Rn,{value:f.value,onValueChange:f.onChange,children:[t.jsx(Z,{children:t.jsx(Hn,{children:t.jsx(Gn,{})})}),t.jsxs(Kn,{children:[t.jsx(De,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.httpType")]})}),t.jsx(De,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.sseType")]})}),t.jsx(De,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.websocketType")]})}),a&&t.jsxs(t.Fragment,{children:[t.jsx(De,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Le,{className:"w-4 h-4"}),i("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(De,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(on,{className:"w-4 h-4"}),i("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(ee,{})]})}),h==="NPX"&&t.jsx(Q,{control:c.control,name:"npx_package",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.npmPackagePlaceholder"),...f,value:f.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),c.setValue("npx_package",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),f.onBlur()}})}),t.jsx(ee,{})]})}),h==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:c.control,name:"stdio_command",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.commandLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.commandPlaceholder"),...f,value:f.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:c.control,name:"stdio_args",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.argumentsLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.argumentsPlaceholder"),...f,value:f.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:c.control,name:"stdio_cwd",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.workingDirectoryPlaceholder"),...f,value:f.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(ee,{})]})})]}),(h==="NPX"||h==="STDIO")&&t.jsx(Q,{control:c.control,name:"env_vars",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(Z,{children:t.jsx(Xn,{value:f.value??[],onChange:f.onChange})}),t.jsx(ee,{})]})}),h!=="NPX"&&h!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:c.control,name:"connection_url",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.urlLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.urlPlaceholder"),...f,value:f.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),c.setValue("connection_url",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),f.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:c.control,name:"connection_token",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:g?.token?.label??i("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(Z,{children:t.jsx(oe,{type:"password",placeholder:g?.token?.placeholder??i("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...f,value:f.value??""})}),g?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[g.token.helperText,g.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:i("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:c.control,name:"title",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:i("connections.createConnectionDialog.namePlaceholder"),...f})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:c.control,name:"description",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.descriptionLabel")}),t.jsx(Z,{children:t.jsx(Un,{placeholder:i("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...f,value:f.value??""})}),t.jsx(ee,{})]})})]});return l?t.jsx(kt,{open:n,onOpenChange:b,children:t.jsxs(It,{className:"max-h-[90vh]",children:[t.jsx(yn,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(At,{children:w}),t.jsx(Sn,{className:"mt-1",children:N})]}),t.jsx(wn,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Nt,{size:16})})})]})}),t.jsx(st,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(y),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:O}),t.jsx(_n,{children:t.jsx(ne,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:I})})]})})]})}):t.jsx($t,{open:n,onOpenChange:b,children:t.jsxs(Ft,{className:"sm:max-w-[525px]",children:[t.jsxs(Lt,{children:[t.jsx(Bt,{children:w}),t.jsx(En,{children:N})]}),t.jsx(st,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(y),children:[t.jsx("div",{className:"py-4",children:O}),t.jsxs(Vn,{children:[t.jsx(ne,{type:"button",variant:"outline",onClick:()=>b(!1),children:i("connections.createConnectionDialog.cancelButton")}),t.jsx(ne,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:I})]})]})})]})})}function Ms(n){const e=$.c(72),{mode:s,agentId:i,addedConnectionIds:o,onAdd:r,onCloneAndAdd:a,onConnectAndAdd:l,connectingItemId:d,search:m,onCreateConnection:u,onBrowseNavigate:p,defaultTab:c}=n,h=s===void 0?"add":s,C=c===void 0?"connected":c,x=V(),{org:g}=ae(),j=H.useDeferredValue(m),b=m!==j;let y;e[0]!==j?(y=j.trim().toLowerCase(),e[0]=j,e[1]=y):y=e[1];const w=y;let N;e[2]!==C?(N=D=>D??C,e[2]=C,e[3]=N):N=e[3];const[I,O]=Zt(en.connectionsTab(g.slug)+(C==="all"?":home-modal":":agent-modal"),N);let f;e[4]!==I||e[5]!==O?(f=D=>{D!==I&&R("connections_dialog_tab_changed",{to_tab:D}),O(D)},e[4]=I,e[5]=O,e[6]=f):f=e[6];const _=f;let T;e[7]!==g.id||e[8]!==g.slug?(T={connectionId:cn,orgId:g.id,orgSlug:g.slug},e[7]=g.id,e[8]=g.slug,e[9]=T):T=e[9];const S=ln(T),v=j?.trim().split(/\s+/).filter(Boolean)??[],P=v.length>0?{operator:"or",conditions:v.flatMap(Hs)}:void 0,k={...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},A=JSON.stringify(k),{data:z,fetchNextPage:B,hasNextPage:E,isFetchingNextPage:M}=es({queryKey:ot.collectionListInfinite(S,g.id,"","CONNECTIONS",A),queryFn:async D=>{const{pageParam:F}=D,se=F===void 0?0:F;return(await S.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:se}})).structuredContent},initialPageParam:0,getNextPageParam:Vs,staleTime:3e4}),U=z?.pages.flatMap(Es)??[],K=Bn(U),de=new Set(U.filter(Bs).map(Ls)),L=zt(),re=Mt(L,j),He=ut(re.loadMore,re.hasMore,re.isLoadingMore),Ge=ut(B,E??!1,M),W=I==="all"||!!w,ct=W?re.items.filter(D=>{const F=$n(D);if(F&&de.has(F))return!1;if(!w)return!0;const se=Ve(D._meta),ce=[D.title,D.description,D.name,D.server?.title,D.server?.description,D.server?.name,se?.friendly_name,se?.friendlyName].filter(Boolean).join(" ").toLowerCase();return v.some(te=>ce.includes(te.toLowerCase()))}):[],_e=ct.filter(Fs),Ne=ct.filter($s);let Ie;e[10]!==o?(Ie=D=>D.some(F=>o.has(F.id)),e[10]=o,e[11]=Ie):Ie=e[11];const Ke=Ie;let Ae;e[12]!==o||e[13]!==i||e[14]!==d||e[15]!==Ke||e[16]!==h||e[17]!==r||e[18]!==p||e[19]!==a||e[20]!==x?(Ae=(D,F,se,ce,te)=>{const Me=Ke(te),be=te.find(le=>!o.has(le.id)),q=te[0];if(h==="browse"){const le=Jn(q);return t.jsx(Je,{connection:{title:F,icon:se,description:te.length>1?`${te.length} instances`:ce??void 0},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",x("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{R("connection_browse_clicked",{app_name:q.app_name??null,connection_id:q.id,instances_count:te.length}),p?.(le)}},D)}return t.jsx(Je,{connection:{title:F,icon:se,description:ce},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Me&&t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",x("virtualMcp.connectionDialogContent.added")]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:le=>{le.stopPropagation(),be?(R("connection_add_clicked",{action:"use_existing",app_name:q.app_name??null,connection_id:be.id}),i&&R("agent_connection_attached",{agent_id:i,connection_id:be.id,app_name:q.app_name??null,mode:"existing"}),r(be.id)):(R("connection_add_clicked",{action:"clone",app_name:q.app_name??null,base_connection_id:q.id}),a(q))},children:x("virtualMcp.connectionDialogContent.add")})]})},D)},e[12]=o,e[13]=i,e[14]=d,e[15]=Ke,e[16]=h,e[17]=r,e[18]=p,e[19]=a,e[20]=x,e[21]=Ae):Ae=e[21];const Pe=Ae;let Te;e[22]!==d||e[23]!==h||e[24]!==l||e[25]!==x?(Te=D=>{const F=Ve(D._meta),se=F?.friendlyName||F?.friendly_name||D.server?.title||D.title||D.server?.name||D.name||D.id||"",ce=D.server?.description||D.description||null,te=D.server?.icons?.[0]?.src||Fn(D.server?.repository)||null,Me=F?.official===!0,be=F?.verified===!0,q=F?.owner==="deco";return t.jsx(Je,{connection:{title:se,description:ce,icon:te},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[q&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:t.jsx("img",{src:"/logos/deco logo.svg",alt:x("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.builtByDeco")})]}),!q&&Me&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Ze,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!q&&!Me&&be&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Ze,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:le=>{le.stopPropagation(),R("connection_add_clicked",{action:"connect_new",registry_item_id:D.id,app_name:F?.friendlyName||D.server?.name||D.name||null}),l(D)},children:d===D.id?t.jsx(ke,{size:14,className:"animate-spin"}):x(h==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${D.id}`)},e[22]=d,e[23]=h,e[24]=l,e[25]=x,e[26]=Te):Te=e[26];const lt=Te;let ue;e[27]!==I||e[28]!==_||e[29]!==u||e[30]!==w||e[31]!==x?(ue=!w&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(Zn,{tabs:[{id:"all",label:x("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:x("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:I,onTabChange:D=>_(D)}),t.jsxs(ne,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{R("connections_dialog_custom_clicked"),u()},children:[t.jsx(we,{size:12}),x("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=I,e[28]=_,e[29]=u,e[30]=w,e[31]=x,e[32]=ue):ue=e[32];const Ue=b&&"opacity-50 pointer-events-none";let me;e[33]!==Ue?(me=X("flex-1 overflow-auto p-5 transition-opacity duration-150",Ue),e[33]=Ue,e[34]=me):me=e[34];const Gt="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Oe;e[35]!==Pe?(Oe=D=>{if(D.type==="group")return Pe(D.key,D.title,D.icon,null,D.connections);const F=D.connection;return Pe(F.id,F.title,F.icon,F.description??null,[F])},e[35]=Pe,e[36]=Oe):Oe=e[36];const qe=K.map(Oe);let fe;e[37]!==Ge?(fe=t.jsx("div",{ref:Ge,className:"col-span-full h-1"}),e[37]=Ge,e[38]=fe):fe=e[38];let ge;e[39]!==M?(ge=M&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),e[39]=M,e[40]=ge):ge=e[40];const Xe=W&&_e.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(Ze,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),We=W&&_e.map(lt),Qe=W&&Ne.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Ye=W&&Ne.map(lt);let pe;e[41]!==He||e[42]!==L||e[43]!==W?(pe=W&&L.length>0&&t.jsx("div",{ref:He,className:"col-span-full h-1"}),e[41]=He,e[42]=L,e[43]=W,e[44]=pe):pe=e[44];let he;e[45]!==re.isLoadingMore||e[46]!==W?(he=W&&re.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),e[45]=re.isLoadingMore,e[46]=W,e[47]=he):he=e[47];let xe;e[48]!==qe||e[49]!==fe||e[50]!==ge||e[51]!==Xe||e[52]!==We||e[53]!==Qe||e[54]!==Ye||e[55]!==pe||e[56]!==he?(xe=t.jsxs("div",{className:Gt,children:[qe,fe,ge,Xe,We,Qe,Ye,pe,he]}),e[48]=qe,e[49]=fe,e[50]=ge,e[51]=Xe,e[52]=We,e[53]=Qe,e[54]=Ye,e[55]=pe,e[56]=he,e[57]=xe):xe=e[57];let je;e[58]!==I||e[59]!==K.length||e[60]!==Ne||e[61]!==m||e[62]!==x||e[63]!==_e?(je=K.length===0&&_e.length===0&&Ne.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:m?x("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:m}):x(I==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=I,e[59]=K.length,e[60]=Ne,e[61]=m,e[62]=x,e[63]=_e,e[64]=je):je=e[64];let ve;e[65]!==me||e[66]!==xe||e[67]!==je?(ve=t.jsxs("div",{className:me,children:[xe,je]}),e[65]=me,e[66]=xe,e[67]=je,e[68]=ve):ve=e[68];let ze;return e[69]!==ue||e[70]!==ve?(ze=t.jsxs(t.Fragment,{children:[ue,ve]}),e[69]=ue,e[70]=ve,e[71]=ze):ze=e[71],ze}function $s(n){return!n.verified&&!Ve(n._meta)?.verified&&!n.meta?.verified}function Fs(n){return n.verified||Ve(n._meta)?.verified||n.meta?.verified}function Ls(n){return n.app_name}function Bs(n){return n.app_name}function Es(n){return n?.items??[]}function Vs(n,e){if(n?.hasMore)return e.reduce(Rs,0)}function Rs(n,e){return n+(e?.items?.length??0)}function Hs(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function Ho({open:n,onOpenChange:e,defaultTab:s,initialSearch:i="",...o}){const r=V(),a=o.mode??"add",l="agentId"in o?o.agentId:void 0,d="addedConnectionIds"in o?o.addedConnectionIds??new Set:new Set,m="onAdd"in o&&o.onAdd?o.onAdd:S=>{},u=(S,v,P)=>{l&&R("agent_connection_attached",{agent_id:l,connection_id:S,app_name:v,mode:P})},[p,c]=H.useState(null),[h,C]=H.useState(i),[x,g]=H.useState(!1),{org:j}=ae(),{data:b}=ie.useSession(),y=Et(),w=tn(),N=Re(),I=S=>{e(!1),N({to:"/$org/settings/connections/$appSlug",params:{org:j.slug,appSlug:S}})},O=()=>{w.invalidateQueries({predicate:S=>{const v=S.queryKey;return v[1]===j.id&&v[3]==="collection"&&v[4]==="CONNECTIONS"}})},f=async(S,v)=>{R("connection_oauth_succeeded",{connection_id:S,flow:v});const P=new URL(`/api/${j.slug}/mcp/${S}`,window.location.origin);await w.invalidateQueries({queryKey:ot.isMCPAuthenticated(P.href,null)}),O()},_=async S=>{c(S.app_name??S.id);try{const P=`${S.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,A=(await y.create.mutateAsync({title:P,description:S.description??null,connection_type:S.connection_type,connection_url:S.connection_url??null,connection_token:null,icon:S.icon??null,app_name:S.app_name??null,app_id:S.app_id??null,connection_headers:S.connection_headers??null})).id,z=await tt({connectionId:A,orgId:j.id,orgSlug:j.slug,persistFallback:B=>y.update.mutateAsync({id:A,data:{connection_token:B}}).then(()=>{})});if(z.ran&&!z.ok){R("connection_oauth_failed",{connection_id:A,flow:"clone",error:z.error??"no_token"}),G.error(r("virtualMcp.addConnectionDialog.authenticationFailedError",{error:z.error??"no token received"})),await y.delete.mutateAsync(A);return}z.ran&&await f(A,"clone"),u(A,S.app_name??null,"clone"),m(A)}catch(v){console.error("Failed to add connection:",v),G.error(r("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{c(null)}},T=async S=>{if(!(!j||!b?.user?.id)){c(S.id);try{const v=Ln(S,j.id,b.user.id,{remoteIndex:0}),P=v.connection_type==="STDIO",k=!!v.connection_url,A=P&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!k&&!A){G.error(r("virtualMcp.addConnectionDialog.mcpServerConnectionError")),c(null);return}const{id:z}=await y.create.mutateAsync(v),B=await tt({connectionId:z,orgId:j.id,orgSlug:j.slug,persistFallback:E=>y.update.mutateAsync({id:z,data:{connection_token:E}}).then(()=>{})});if(B.ran&&!B.ok){R("connection_oauth_failed",{connection_id:z,flow:"connect_new",error:B.error??"no_token"}),G.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:B.error??"no token received"})}),u(z,v.app_name??null,"new"),m(z);return}B.ran?(await f(z,"connect_new"),G.success(r("virtualMcp.addConnectionDialog.connectedAuthenticated"))):G.success(r("virtualMcp.addConnectionDialog.connected")),u(z,v.app_name??null,"new"),m(z)}catch(v){console.error("Failed to connect:",v),G.error(r("virtualMcp.addConnectionDialog.failedToConnect"))}finally{c(null)}}};return t.jsxs($t,{open:n,onOpenChange:e,children:[t.jsxs(Ft,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(Lt,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(Bt,{className:"text-base font-semibold",children:r(a==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(zn,{value:h,onChange:C,placeholder:r("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ms,{mode:a,agentId:l,addedConnectionIds:d,onAdd:m,onCloneAndAdd:_,onConnectAndAdd:T,connectingItemId:p,search:h,onCreateConnection:()=>g(!0),onBrowseNavigate:I,defaultTab:s})})]}),t.jsx(zs,{open:x,onOpenChange:g,onCreated:async S=>{g(!1);const v=await tt({connectionId:S,orgId:j.id,orgSlug:j.slug,persistFallback:P=>y.update.mutateAsync({id:S,data:{connection_token:P}}).then(()=>{})});if(v.ran&&!v.ok){R("connection_oauth_failed",{connection_id:S,flow:"custom_create",error:v.error??"no_token"}),G.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:v.error??"no token received"})}),u(S,null,"custom"),m(S),e(!1);return}v.ran&&await f(S,"custom_create"),u(S,null,"custom"),m(S),e(!1)}})]})}const ft=new Map;function Go(){const{org:n}=ae(),e=ts(),s=ns(),i=s.find(g=>g.providerId==="deco"),{data:o,isLoading:r,refetch:a,isFetching:l}=nn({queryKey:ot.aiProviderCredits(n.id,"deco"),enabled:!!i,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),d=o?.balanceCents??null,m=d!=null?d/100:null,u=H.useRef(new Map);if(d!=null){const g=ft.get(n.id);u.current.get(n.id)&&g!=null&&d>g&&R("credits_topped_up_detected",{organization_id:n.id,delta_cents:d-g,previous_balance_cents:g,new_balance_cents:d}),ft.set(n.id,d),u.current.set(n.id,!0)}const p=!!i,c=d!=null&&d>0,h=d!=null&&d===0,C=d!=null&&d===200,x=s.length>0&&s.every(g=>g.providerId==="deco");return{hasDecoKey:p,decoKeyId:i?.id??null,balanceCents:d,balanceDollars:m,hasCredits:c,isZeroBalance:h,isInitialFreeCredit:C,hasOnlyDecoProvider:x,isLoading:r,isFetching:l,refetch:a}}export{Vo as A,Ro as N,Eo as O,Ho as a,ls as b,at as c,fs as d,Fo as e,Rt as f,$o as g,Bo as h,Lo as i,rt as r,Go as u};
|
package/dist/client/assets/{use-decopilot-events-CF5TQ0kC.js → use-decopilot-events-JMTJZeEq.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s}from"./index-
|
|
1
|
+
import{r as s}from"./index-DnHWblfu.js";import{d as R,D as u}from"./decopilot-sse-pool-CSHbnCTw.js";const f=()=>0;function g(E){const{orgSlug:t,taskId:a,enabled:n=!0,onStep:o,onFinish:S,onTaskStatus:i}=E,l=s.useRef({taskId:a,onStep:o,onFinish:S,onTaskStatus:i});l.current={taskId:a,onStep:o,onFinish:S,onTaskStatus:i};const c=s.useRef(null),p=s.useRef(n),b=s.useRef(t);(!c.current||p.current!==n||b.current!==t)&&(p.current=n,b.current=t,c.current=d=>{if(!n||!t)return()=>{};const k=T=>{let e;try{e=JSON.parse(T.data)}catch{return}const r=l.current;if(!(r.taskId&&e.subject!==r.taskId)){switch(e.type){case u.STEP:r.onStep?.(e);break;case u.FINISH:r.onFinish?.(e);break;case u.THREAD_STATUS:r.onTaskStatus?.(e);break}d()}};return R.subscribe(t,k)}),s.useSyncExternalStore(c.current,f,f)}export{g as u};
|
package/dist/client/assets/{use-delete-connection-CSsIa0wR.js → use-delete-connection-pIo0CZXk.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as oe,b as le,j as n,F as se,o as ie,r as ce,t as Y,b1 as re,b2 as ae}from"./index-
|
|
1
|
+
import{c as oe,b as le,j as n,F as se,o as ie,r as ce,t as Y,b1 as re,b2 as ae}from"./index-DnHWblfu.js";import{c as z,d as G,b as V,f as X,g as Z,e as ee,a as te,A as ne}from"./alert-dialog-vMeKz1oj.js";import{u as de}from"./studio-tools-1de_48yn.js";function ue(B){const e=oe.c(86),{deleteState:s,cancelDelete:a,confirmDelete:d,confirmForceDelete:c}=B,t=le(),w=s.mode==="deleting";let m;e[0]!==a?(m=W=>{W||a()},e[0]=a,e[1]=m):m=e[1];let u;e[2]!==t?(u=t("common.deleteConnectionDialogs.title"),e[2]=t,e[3]=u):u=e[3];let D;e[4]!==u?(D=n.jsx(z,{children:u}),e[4]=u,e[5]=D):D=e[5];let C;e[6]!==t?(C=t("common.deleteConnectionDialogs.description"),e[6]=t,e[7]=C):C=e[7];const H=s.mode==="deleting"&&s.connection.title;let o;e[8]!==H?(o=n.jsx("span",{className:"font-medium text-foreground",children:H}),e[8]=H,e[9]=o):o=e[9];let l;e[10]!==C||e[11]!==o?(l=n.jsxs(G,{children:[C," ",o,"."]}),e[10]=C,e[11]=o,e[12]=l):l=e[12];let i;e[13]!==D||e[14]!==l?(i=n.jsxs(V,{children:[D,l]}),e[13]=D,e[14]=l,e[15]=i):i=e[15];let f;e[16]!==t?(f=t("common.deleteConnectionDialogs.cancel"),e[16]=t,e[17]=f):f=e[17];let r;e[18]!==f?(r=n.jsx(X,{children:f}),e[18]=f,e[19]=r):r=e[19];let g;e[20]!==t?(g=t("common.deleteConnectionDialogs.delete"),e[20]=t,e[21]=g):g=e[21];let x;e[22]!==d||e[23]!==g?(x=n.jsx(Z,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:g}),e[22]=d,e[23]=g,e[24]=x):x=e[24];let h;e[25]!==r||e[26]!==x?(h=n.jsxs(ee,{children:[r,x]}),e[25]=r,e[26]=x,e[27]=h):h=e[27];let j;e[28]!==h||e[29]!==i?(j=n.jsxs(te,{children:[i,h]}),e[28]=h,e[29]=i,e[30]=j):j=e[30];let p;e[31]!==w||e[32]!==j||e[33]!==m?(p=n.jsx(ne,{open:w,onOpenChange:m,children:j}),e[31]=w,e[32]=j,e[33]=m,e[34]=p):p=e[34];const J=s.mode==="force-deleting";let N;e[35]!==a?(N=W=>{W||a()},e[35]=a,e[36]=N):N=e[36];let E;e[37]!==t?(E=t("common.deleteConnectionDialogs.forceDeleteTitle"),e[37]=t,e[38]=E):E=e[38];let y;e[39]!==E?(y=n.jsx(z,{children:E}),e[39]=E,e[40]=y):y=e[40];let O;e[41]!==t?(O=t("common.deleteConnectionDialogs.forceDeleteDescription"),e[41]=t,e[42]=O):O=e[42];const M=s.mode==="force-deleting"&&s.connection.title;let v;e[43]!==M?(v=n.jsx("span",{className:"font-medium text-foreground",children:M}),e[43]=M,e[44]=v):v=e[44];let S;e[45]!==t?(S=t("common.deleteConnectionDialogs.isUsedByAgents"),e[45]=t,e[46]=S):S=e[46];const P=s.mode==="force-deleting"&&s.agentNames;let T;e[47]!==P?(T=n.jsx("span",{className:"font-medium text-foreground",children:P}),e[47]=P,e[48]=T):T=e[48];let A;e[49]!==O||e[50]!==v||e[51]!==S||e[52]!==T?(A=n.jsxs("p",{children:[O," ",v," ",S," ",T,"."]}),e[49]=O,e[50]=v,e[51]=S,e[52]=T,e[53]=A):A=e[53];let _;e[54]!==t?(_=t("common.deleteConnectionDialogs.forceDeleteWarning"),e[54]=t,e[55]=_):_=e[55];let F;e[56]!==_?(F=n.jsx("p",{className:"mt-2",children:_}),e[56]=_,e[57]=F):F=e[57];let b;e[58]!==A||e[59]!==F?(b=n.jsx(G,{asChild:!0,children:n.jsxs("div",{children:[A,F]})}),e[58]=A,e[59]=F,e[60]=b):b=e[60];let I;e[61]!==y||e[62]!==b?(I=n.jsxs(V,{children:[y,b]}),e[61]=y,e[62]=b,e[63]=I):I=e[63];let L;e[64]!==t?(L=t("common.deleteConnectionDialogs.cancel"),e[64]=t,e[65]=L):L=e[65];let R;e[66]!==L?(R=n.jsx(X,{children:L}),e[66]=L,e[67]=R):R=e[67];let q;e[68]!==t?(q=t("common.deleteConnectionDialogs.deleteAnyway"),e[68]=t,e[69]=q):q=e[69];let U;e[70]!==c||e[71]!==q?(U=n.jsx(Z,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:q}),e[70]=c,e[71]=q,e[72]=U):U=e[72];let K;e[73]!==R||e[74]!==U?(K=n.jsxs(ee,{children:[R,U]}),e[73]=R,e[74]=U,e[75]=K):K=e[75];let $;e[76]!==I||e[77]!==K?($=n.jsxs(te,{children:[I,K]}),e[76]=I,e[77]=K,e[78]=$):$=e[78];let k;e[79]!==J||e[80]!==N||e[81]!==$?(k=n.jsx(ne,{open:J,onOpenChange:N,children:$}),e[79]=J,e[80]=N,e[81]=$,e[82]=k):k=e[82];let Q;return e[83]!==p||e[84]!==k?(Q=n.jsxs(n.Fragment,{children:[p,k]}),e[83]=p,e[84]=k,e[85]=Q):Q=e[85],Q}function De({onSuccess:B}={}){const{org:e}=se(),s=ie(),a=de(),[d,c]=ce.useState({mode:"idle"}),t=()=>{s.invalidateQueries({predicate:o=>{const l=o.queryKey;return l[1]===e.id&&l[3]==="collection"&&l[4]==="CONNECTIONS"}})},w=o=>{re(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===ae&&l.queryKey[3]===o})},m=o=>{t(),w(o),Y.success("Connection deleted successfully"),c({mode:"idle"}),B?.()};return{deleteState:d,requestDelete:o=>{c({mode:"deleting",connection:o})},cancelDelete:()=>{c({mode:"idle"})},confirmDelete:async()=>{if(d.mode!=="deleting")return;const o=d.connection;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o.id}),m(o.id)}catch(l){const i=l instanceof Error?l.message:String(l),f=i.replace(/^Error:\s*/,"");try{const r=JSON.parse(f);if(r.code==="CONNECTION_IN_USE"&&r.agentNames){c({mode:"force-deleting",connection:o,agentNames:r.agentNames.map(g=>`"${g}"`).join(", ")});return}}catch{}Y.error(`Failed to delete connection: ${i}`)}},confirmForceDelete:async()=>{if(d.mode!=="force-deleting")return;const o=d.connection.id;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o,force:!0}),m(o)}catch(l){const i=l instanceof Error?l.message:String(l);Y.error(`Failed to delete connection: ${i}`)}}}}export{ue as D,De as u};
|
package/dist/client/assets/{use-deployment-admin-Do0J3fTo.js → use-deployment-admin-CdE4vCx5.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,n as m,K as c}from"./index-
|
|
1
|
+
import{c as s,n as m,K as c}from"./index-DnHWblfu.js";function l(){const e=s.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:c.deploymentAdminMe(),queryFn:d,staleTime:1/0,retry:2},e[0]=t):t=e[0];const{data:a,isLoading:i}=m(t),r=a==="admin",o=a==="unverified";let n;return e[1]!==i||e[2]!==r||e[3]!==o?(n={isAdmin:r,loading:i,needsEmailVerification:o},e[1]=i,e[2]=r,e[3]=o,e[4]=n):n=e[4],n}async function d(){const e=await fetch("/api/_admin/me",{credentials:"include"});if(e.status>=500)throw new Error(`admin/me request failed: ${e.status}`);return e.ok?"admin":(await e.json().catch(u)).error==="email_not_verified"?"unverified":"denied"}function u(){return{}}export{l as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,F as c,K as r,n as d,x as y,o as C,e as F}from"./index-
|
|
1
|
+
import{c as u,F as c,K as r,n as d,x as y,o as C,e as F}from"./index-DnHWblfu.js";import{u as f}from"./studio-tools-1de_48yn.js";function m(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6];const{data:l}=y(s);return l.configs}function I(){const e=u.c(7),{org:n}=c(),o=f();let i;e[0]!==n.id?(i=r.fileConfigs(n.id),e[0]=n.id,e[1]=i):i=e[1];let t;e[2]!==o?(t=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=t):t=e[3];let s;return e[4]!==i||e[5]!==t?(s={queryKey:i,staleTime:6e4,queryFn:t},e[4]=i,e[5]=t,e[6]=s):s=e[6],d(s)}function q(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_CREATE",{...a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],F(l)}function _(){const e=u.c(8),{org:n}=c(),o=f(),i=C();let t;e[0]!==o?(t=a=>o.call("FILE_CONFIG_DELETE",{id:a}),e[0]=o,e[1]=t):t=e[1];let s;e[2]!==n||e[3]!==i?(s=()=>{i.invalidateQueries({queryKey:r.fileConfigs(n.id)})},e[2]=n,e[3]=i,e[4]=s):s=e[4];let l;return e[5]!==t||e[6]!==s?(l={mutationFn:t,onSuccess:s},e[5]=t,e[6]=s,e[7]=l):l=e[7],F(l)}export{I as a,q as b,_ as c,m as u};
|
package/dist/client/assets/{use-infinite-scroll-CLgVcggv.js → use-infinite-scroll-68HpgFc8.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aL as d,dU as l,dV as v,r as i}from"./index-
|
|
1
|
+
import{aL as d,dU as l,dV as v,r as i}from"./index-DnHWblfu.js";var p=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,u=super.createResult(e,t),{isFetching:r,isRefetching:h,isError:a,isRefetchError:g}=u,s=n.fetchMeta?.fetchMore?.direction,o=a&&s==="forward",P=r&&s==="forward",c=a&&s==="backward",f=r&&s==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,n.data),hasPreviousPage:l(t,n.data),isFetchNextPageError:o,isFetchingNextPage:P,isFetchPreviousPageError:c,isFetchingPreviousPage:f,isRefetchError:g&&!o&&!c,isRefetching:h&&!P&&!f}}};function b(e,t,n=!1,u){const r=i.useRef(null),h=i.useRef(null),a=i.useRef(e),g=i.useRef(t),s=i.useRef(n),o=i.useRef(u);a.current=e,g.current=t,s.current=n,o.current=u;const[P]=i.useState(()=>c=>{h.current=c,r.current&&(r.current.disconnect(),r.current=null),c&&queueMicrotask(()=>{if(h.current!==c)return;const f=new IntersectionObserver(R=>{R[0]?.isIntersecting&&g.current&&!s.current&&a.current()},{root:o.current?.current??null,rootMargin:"0px 0px 200px 0px"});f.observe(c),r.current=f})});return P}export{p as I,b as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,F as N,K as y,n as _,o as A,e as I,t as q}from"./index-
|
|
1
|
+
import{c as g,F as N,K as y,n as _,o as A,e as I,t as q}from"./index-DnHWblfu.js";import{a as S}from"./use-capability-ZuDMV8i_.js";import{u as O}from"./studio-tools-1de_48yn.js";function b(){const e=g.c(10),{org:r}=N(),u=O(),{capabilities:a,isPrivileged:c}=S(),d=c||!!a["members:manage"];let t;e[0]!==r.id?(t=y.organizationJoinRequests(r.id),e[0]=r.id,e[1]=t):t=e[1];let s;e[2]!==u?(s=()=>u.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=u,e[3]=s):s=e[3];const i=!!r.id&&d;let n;e[4]!==t||e[5]!==s||e[6]!==i?(n={queryKey:t,queryFn:s,enabled:i},e[4]=t,e[5]=s,e[6]=i,e[7]=n):n=e[7];const{data:l}=_(n);let o;return e[8]!==l?.requests?(o=l?.requests??[],e[8]=l?.requests,e[9]=o):o=e[9],o}function K(){const e=g.c(21),{org:r,locator:u}=N(),a=O(),c=A();let d;e[0]!==u||e[1]!==r||e[2]!==c?(d=()=>{c.invalidateQueries({queryKey:y.organizationJoinRequests(r.id)}),c.invalidateQueries({queryKey:y.members(u)})},e[0]=u,e[1]=r,e[2]=c,e[3]=d):d=e[3];const t=d;let s;e[4]!==a?(s=R=>a.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:R}),e[4]=a,e[5]=s):s=e[5];let i;e[6]!==t?(i=()=>{t(),q.success("Request approved")},e[6]=t,e[7]=i):i=e[7];let n;e[8]!==s||e[9]!==i?(n={mutationFn:s,onSuccess:i,onError:v},e[8]=s,e[9]=i,e[10]=n):n=e[10];const l=I(n);let o;e[11]!==a?(o=R=>a.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:R}),e[11]=a,e[12]=o):o=e[12];let f;e[13]!==t?(f=()=>{t(),q.success("Request denied")},e[13]=t,e[14]=f):f=e[14];let m;e[15]!==o||e[16]!==f?(m={mutationFn:o,onSuccess:f,onError:T},e[15]=o,e[16]=f,e[17]=m):m=e[17];const E=I(m);let p;return e[18]!==l||e[19]!==E?(p={approve:l,deny:E},e[18]=l,e[19]=E,e[20]=p):p=e[20],p}function T(e){return q.error(e instanceof Error?e.message:"Failed to deny")}function v(e){return q.error(e instanceof Error?e.message:"Failed to approve")}export{K as a,b as u};
|