decocms 4.82.20 → 4.83.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-Bx5VPnCL.js → AlertCircle-D2LEYSUh.js} +1 -1
- package/dist/client/assets/{AreaChart-DKXgsttk.js → AreaChart-DqLYq5VW.js} +1 -1
- package/dist/client/assets/{ArrowUp-CRGMcwjN.js → ArrowUp-D8Znnjoa.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-XjbUsL6J.js → ArrowUpRight-wdyhd7_i.js} +1 -1
- package/dist/client/assets/{CheckCircle-DvTvBvKr.js → CheckCircle-q7whrJQW.js} +1 -1
- package/dist/client/assets/{ChevronDown--710wNet.js → ChevronDown-DoJ-k2NZ.js} +1 -1
- package/dist/client/assets/{ChevronRight-CyX_OwBu.js → ChevronRight-C4hEIfgs.js} +1 -1
- package/dist/client/assets/{ChevronUp-BVwUhVX7.js → ChevronUp-CGTR312P.js} +1 -1
- package/dist/client/assets/{Copy01-BlUuudlp.js → Copy01-CvyYg5ZQ.js} +1 -1
- package/dist/client/assets/{DotsVertical-BHuPkmo3.js → DotsVertical-0e14gdIQ.js} +1 -1
- package/dist/client/assets/{Eye-HqCyXTaB.js → Eye-Def6pxO6.js} +1 -1
- package/dist/client/assets/{FilterLines-CfibCuLd.js → FilterLines-CppNK8_d.js} +1 -1
- package/dist/client/assets/{Globe01-CxXiD__5.js → Globe01-DzGglNry.js} +1 -1
- package/dist/client/assets/{Globe04-CiK6pryU.js → Globe04-bLBNXIps.js} +1 -1
- package/dist/client/assets/{HardDrive-DljyyjQe.js → HardDrive-CKFbwvbY.js} +1 -1
- package/dist/client/assets/{Image01-CCmFaLM6.js → Image01-B2X86JxG.js} +1 -1
- package/dist/client/assets/{Key01-CV8c3aey.js → Key01-3uf0kElN.js} +1 -1
- package/dist/client/assets/{LayoutLeft-D8A_vRpx.js → LayoutLeft-CcADrtuW.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Blg4CFhG.js → LinkExternal01-DmAlYXHu.js} +1 -1
- package/dist/client/assets/{Monitor01-G0XI4AyE.js → Monitor01-Bo-ZNUM_.js} +1 -1
- package/dist/client/assets/{Package-BpnbT20S.js → Package-4efmOaN-.js} +1 -1
- package/dist/client/assets/{Palette-CucSl-Tp.js → Palette-Bpjldwh3.js} +1 -1
- package/dist/client/assets/{Play-J4lAOl0L.js → Play-DygcnDZ9.js} +1 -1
- package/dist/client/assets/{Plus-Be2ZDEMF.js → Plus-sn3sMPWN.js} +1 -1
- package/dist/client/assets/{SearchLg-hF3HTPE5.js → SearchLg-DRzFBnhX.js} +1 -1
- package/dist/client/assets/{SearchMd-BvJfdUAe.js → SearchMd-DvgdHj41.js} +1 -1
- package/dist/client/assets/{Settings02-BND3ad-_.js → Settings02-D5KqlDWC.js} +1 -1
- package/dist/client/assets/{Shield01-CesuQ_f6.js → Shield01-DpQDgtHf.js} +1 -1
- package/dist/client/assets/{Star01-B13g--Yk.js → Star01-DO3nFxrj.js} +1 -1
- package/dist/client/assets/{Stars01-DMCvEOuj.js → Stars01-CM0GEhaD.js} +1 -1
- package/dist/client/assets/{Stars02-Bf5s6jtI.js → Stars02-D-P-9j-l.js} +1 -1
- package/dist/client/assets/{Sun-D4wn6C4e.js → Sun-C6ImKKWE.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-COeWFMnn.js → SwitchHorizontal01-DyVGY9vs.js} +1 -1
- package/dist/client/assets/{Tool01-bTVguty-.js → Tool01-DZAVhVl-.js} +1 -1
- package/dist/client/assets/{Tool02-9uhchTyk.js → Tool02-DiJz5U4h.js} +1 -1
- package/dist/client/assets/{Trash01-Dv6dfSGH.js → Trash01-DknQ9OYs.js} +1 -1
- package/dist/client/assets/{TrendUp01-C-A7bTAN.js → TrendUp01-CwLTY0dJ.js} +1 -1
- package/dist/client/assets/{Upload01-BpEWpOj6.js → Upload01-C8vvf1IS.js} +1 -1
- package/dist/client/assets/{User01-DWXBU7_-.js → User01-CEkSMdwk.js} +1 -1
- package/dist/client/assets/{Users01-DAw96n2a.js → Users01-BWfzl-eM.js} +1 -1
- package/dist/client/assets/{Users03-2_7vN278.js → Users03-BfTrIRmK.js} +1 -1
- package/dist/client/assets/{X-BsyIQyXA.js → X-5pEiZiJA.js} +1 -1
- package/dist/client/assets/{XCircle-CkxSUHFg.js → XCircle-Dthd2Gnh.js} +1 -1
- package/dist/client/assets/{XClose-CUMcIZJo.js → XClose-CM5jhDsd.js} +1 -1
- package/dist/client/assets/{Zap-NvsmBFeg.js → Zap-DoOEDpdm.js} +1 -1
- package/dist/client/assets/{ZapSquare-Ccv-CNqp.js → ZapSquare-BxW8QNCf.js} +1 -1
- package/dist/client/assets/{ZoomOut-DIgycBu9.js → ZoomOut-BPI23qxl.js} +1 -1
- package/dist/client/assets/{access-gate-BRzOXph6.js → access-gate-B0xYeFOT.js} +1 -1
- package/dist/client/assets/{add-section-modal-BuZMOK1d.js → add-section-modal-QAfg520y.js} +1 -1
- package/dist/client/assets/{agent-icon-CQWu7X4M.js → agent-icon-DICx3hBA.js} +1 -1
- package/dist/client/assets/agents-list-CpF2-Mmw.js +1 -0
- package/dist/client/assets/ai-providers-CULIjkDu.js +1 -0
- package/dist/client/assets/{alert-CN8O4eEL.js → alert-DzdKCOTr.js} +1 -1
- package/dist/client/assets/{alert-dialog-B6UQptWc.js → alert-dialog--Wl_Q716.js} +1 -1
- package/dist/client/assets/app-editor-DjSAkLPq.js +1 -0
- package/dist/client/assets/{auth-CL1EKZwd.js → auth-DimuwgkU.js} +1 -1
- package/dist/client/assets/{auth-catchall-DsnXmu1s.js → auth-catchall-BYMJNpIK.js} +1 -1
- package/dist/client/assets/{auth-entry-CHD6OsmF.js → auth-entry-CdIL0xiz.js} +1 -1
- package/dist/client/assets/{auth-split-layout-C5g7KSYo.js → auth-split-layout-qkXHATDZ.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DsuAbKam.js → authenticate-and-persist-oauth-DP7OH-0x.js} +1 -1
- package/dist/client/assets/{automation-list-row-9QEecu1P.js → automation-list-row-Bi2cr-f1.js} +1 -1
- package/dist/client/assets/{automation-runs-CHGY7bEN.js → automation-runs-sn1XZ5te.js} +25 -25
- package/dist/client/assets/automations-BY3X1yDC.js +1 -0
- package/dist/client/assets/{autosend-BR42-er8.js → autosend-VhtZIUZd.js} +1 -1
- package/dist/client/assets/{avatar-D4ZURmpF.js → avatar-DGDAlp6S.js} +1 -1
- package/dist/client/assets/{badge-BaCv5hEo.js → badge-CCCcI3SI.js} +1 -1
- package/dist/client/assets/{block-document-CpVTeUMx.js → block-document-p9lRw5vx.js} +1 -1
- package/dist/client/assets/{brand-context-BDAmWJRA.js → brand-context-CRDzhD5j.js} +1 -1
- package/dist/client/assets/{buckets-CybA-B50.js → buckets-C3oeEEpb.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-DX-Ab1He.js → bulk-category-panel-CBqou1uj.js} +1 -1
- package/dist/client/assets/{calendar-BcT06D8w.js → calendar-DDf-RI1R.js} +1 -1
- package/dist/client/assets/{capability-load-error-BmygI5Wl.js → capability-load-error-BDVdgQRH.js} +1 -1
- package/dist/client/assets/{card-UiTrwBHx.js → card-8x9dhfB5.js} +1 -1
- package/dist/client/assets/category-editor-BySV0yHR.js +1 -0
- package/dist/client/assets/{chat-context-C2HnQcJb.js → chat-context-BUKIQ9Uy.js} +6 -6
- package/dist/client/assets/{checkbox-DypyLGWd.js → checkbox-Dtlv_cuM.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Biu-3dRM.js → cli-auth-success-D8NathVH.js} +1 -1
- package/dist/client/assets/collection-detail-Cvj_FzmH.js +1 -0
- package/dist/client/assets/{collection-display-button-DR8_laa0.js → collection-display-button-DB1XgpsY.js} +1 -1
- package/dist/client/assets/{collection-search-oVrfvvPK.js → collection-search-DiU5iEl5.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BaJEOGx7.js → collection-table-wrapper-Bds1RMIC.js} +1 -1
- package/dist/client/assets/{collection-tabs-BzGvAa7-.js → collection-tabs-Beh83ebn.js} +1 -1
- package/dist/client/assets/{command-QdNoVtsu.js → command-BF6wZHTx.js} +1 -1
- package/dist/client/assets/commerce-onboarding-BP75s2Dk.js +1 -0
- package/dist/client/assets/{companions-core-I50RkMs1.js → companions-core-CtMZ4uem.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-B1psOfPz.js → connect-desktop-dialog-CRY8YFXe.js} +1 -1
- package/dist/client/assets/connection-card-C7d2lD5S.js +1 -0
- package/dist/client/assets/connection-detail-CdPkUHlK.js +1 -0
- package/dist/client/assets/{connection-form-helpers-CkmqwL7L.js → connection-form-helpers-gT2vyvci.js} +1 -1
- package/dist/client/assets/connections-NSyDQ6Q7.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-Ch1Qumbm.js → decopilot-sse-pool-d9CNNZp5.js} +1 -1
- package/dist/client/assets/{dialog-qW-RW6Eb.js → dialog-B3XC2Fem.js} +1 -1
- package/dist/client/assets/{domain-settings-B8ldFr2r.js → domain-settings-CPkp1FtW.js} +1 -1
- package/dist/client/assets/{drawer-Ci9lekJ-.js → drawer-DMmd7qYS.js} +1 -1
- package/dist/client/assets/{dropdown-menu-M4Iyqsr4.js → dropdown-menu-DKKt9Hkl.js} +1 -1
- package/dist/client/assets/{empty-state-BAAsV00B.js → empty-state-Dkw_A4Pa.js} +1 -1
- package/dist/client/assets/extract-connection-data-DKQdJ934.js +1 -0
- package/dist/client/assets/file-explorer-DuhDO9xR.js +2 -0
- package/dist/client/assets/{file-type-icon-Cb5F2Kv5.js → file-type-icon-B7W5aql-.js} +1 -1
- package/dist/client/assets/{files-BuMJgWiq.js → files-LbKJmLK6.js} +1 -1
- package/dist/client/assets/{form-CxHAlAHx.js → form-07ny9vF1.js} +1 -1
- package/dist/client/assets/general-B9Z-Av5B.js +1 -0
- package/dist/client/assets/github-repo-picker-VXOAor7G.js +1 -0
- package/dist/client/assets/{hooks-CfbEEqda.js → hooks-CfXb-GNM.js} +4 -4
- package/dist/client/assets/{index-w3F47_RR.js → index-B3KpIghl.js} +1 -1
- package/dist/client/assets/{index-7BezNFoz.js → index-BLewo5np.js} +2 -2
- package/dist/client/assets/{index-BCg0EIRK.js → index-BRw9UGjF.js} +28 -28
- package/dist/client/assets/{index-CLAxS6F3.js → index-Bo5r9vhN.js} +1 -1
- package/dist/client/assets/index-C-yyDLRu.js +1 -0
- package/dist/client/assets/index-CiXfb9It.js +2 -0
- package/dist/client/assets/{index-B5wBAEvg.js → index-CkALF4KI.js} +1 -1
- package/dist/client/assets/{index-DMziGwwO.js → index-CyuM7rEn.js} +3 -3
- package/dist/client/assets/{index-C3TuMzMV.js → index-DPG8bThA.js} +2 -2
- package/dist/client/assets/{index-o6uO1QaJ.js → index-DeLa-LYI.js} +1 -1
- package/dist/client/assets/index-Du211SsF.js +1 -0
- package/dist/client/assets/{index-DakOweBw.js → index-TSzs123k.js} +1 -1
- package/dist/client/assets/{index-B9PofSU9.js → index-Z-r6rVBU.js} +1 -1
- package/dist/client/assets/{index-b8bN8MBO.js → index-_7ZZ6KHp.js} +1 -1
- package/dist/client/assets/{index-redirect-DvL5DDro.js → index-redirect-najUMrCC.js} +1 -1
- package/dist/client/assets/{input-B9mAD-FD.js → input-o4VGMAG1.js} +1 -1
- package/dist/client/assets/{integration-icon-BQSFPqY7.js → integration-icon-D1Wd5y66.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-De8-xT6a.js → invite-member-dialog-SwESCPvB.js} +1 -1
- package/dist/client/assets/{label-Dw5usZ3s.js → label-Cp1qAc_O.js} +1 -1
- package/dist/client/assets/{layout-QddrRa8I.js → layout-Uz2CO7h9.js} +1 -1
- package/dist/client/assets/{login-BaaqbzaD.js → login-CReEgOAU.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BBC8qIQI.js → mcp-oauth-CXkLjY6n.js} +1 -1
- package/dist/client/assets/{members-DgmyND8B.js → members-f_xknx9b.js} +1 -1
- package/dist/client/assets/{monaco-editor-BlxKl3DU.js → monaco-editor-D0Cz-f05.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-p4nUKL95.js → monitoring-stats-row-D97tffak.js} +1 -1
- package/dist/client/assets/{multi-select-CGZlQjFP.js → multi-select-QjQn7xxx.js} +1 -1
- package/dist/client/assets/{oauth-callback-CUAMF4ay.js → oauth-callback-Xy2OCum6.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CHFT6E6u.js → oauth-callback-ai-provider-HO59Hib1.js} +1 -1
- package/dist/client/assets/{onboarding-CgK1Huxt.js → onboarding-hpqfvA1m.js} +1 -1
- package/dist/client/assets/{org-install-CFlTSXa_.js → org-install-DJcxR66L.js} +1 -1
- package/dist/client/assets/{org-layout-C5P2KBoH.js → org-layout-WanSzVEd.js} +1 -1
- package/dist/client/assets/{organization-choice-SCcE-4Ds.js → organization-choice-Bl3Ca_Hf.js} +1 -1
- package/dist/client/assets/{orgs-MpAFLZ66.js → orgs-C67x5e8Z.js} +1 -1
- package/dist/client/assets/{page-seo-form-CSZ7Y3ej.js → page-seo-form-BM6NNXaU.js} +1 -1
- package/dist/client/assets/page-seo-sheet-DIktSv_X.js +1 -0
- package/dist/client/assets/{popover-CrO_Pfyc.js → popover-C6W8ZY4L.js} +1 -1
- package/dist/client/assets/post-editor-CcXD07Iw.js +1 -0
- package/dist/client/assets/{primitives-tp-ZjAPF.js → primitives-D67KmtUQ.js} +1 -1
- package/dist/client/assets/{profile-C8cnGeHg.js → profile-C4zXNVYU.js} +1 -1
- package/dist/client/assets/project-app-view-CdL-Xe3D.js +1 -0
- package/dist/client/assets/record-editor-DegFqRtz.js +1 -0
- package/dist/client/assets/redirect-editor-M06MPqqu.js +1 -0
- package/dist/client/assets/registry-Bxy6fUrE.js +2 -0
- package/dist/client/assets/{registry-layout-CIlh541C.js → registry-layout-Dc3jKiGl.js} +2 -2
- package/dist/client/assets/{reports-BovH0q0k.js → reports-DlD4jKdQ.js} +1 -1
- package/dist/client/assets/{require-capability-BFPA48Ea.js → require-capability-CFg_jVen.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CAuTE_Ha.js → required-auth-layout-CENlweRO.js} +1 -1
- package/dist/client/assets/{reset-password-DVLvTotL.js → reset-password-Ck7S41pT.js} +1 -1
- package/dist/client/assets/roles-CRB9Uy1H.js +1 -0
- package/dist/client/assets/{search-input-BAsli81d.js → search-input-CY-dgNyz.js} +1 -1
- package/dist/client/assets/{secrets-BrR011u-.js → secrets-BfKEAhLf.js} +1 -1
- package/dist/client/assets/{sections-editor-hWe8pJps.js → sections-editor-D5k1kuC3.js} +2 -2
- package/dist/client/assets/{select-DY2h8ddP.js → select-D35sjC1I.js} +1 -1
- package/dist/client/assets/{select-model-DXVz8VSi.js → select-model-C6NvdYij.js} +1 -1
- package/dist/client/assets/self-tool-result-DHoHVidu.js +1 -0
- package/dist/client/assets/seo-editor-CSt4gfSw.js +1 -0
- package/dist/client/assets/{settings-layout-DQoYYzwG.js → settings-layout-CHHWRz-z.js} +1 -1
- package/dist/client/assets/{settings-section-ATW3P6O6.js → settings-section-4VLllqP4.js} +1 -1
- package/dist/client/assets/{shell-controls-BOk0i4_B.js → shell-controls-zZ7JDYfl.js} +1 -1
- package/dist/client/assets/shell-layout-cmLFtkbA.js +1 -0
- package/dist/client/assets/{sidebar-Dn9hhb22.js → sidebar-DnLUXLHH.js} +1 -1
- package/dist/client/assets/{skeleton-CypjCzyH.js → skeleton-3wI9_Cp3.js} +1 -1
- package/dist/client/assets/{sso-DQrgyUQ5.js → sso-DDaUas1M.js} +1 -1
- package/dist/client/assets/store-CJfMIbtg.js +1 -0
- package/dist/client/assets/store-registry-CpID09If.js +2 -0
- package/dist/client/assets/{studio-tools-D58JPByV.js → studio-tools-CRWhXKLV.js} +1 -1
- package/dist/client/assets/{switch-BYYj1eu3.js → switch-DKD8jTwV.js} +1 -1
- package/dist/client/assets/{table-yhILZeXr.js → table-B3G6ZFdl.js} +1 -1
- package/dist/client/assets/{tabs-CMvxJGz-.js → tabs-DgYirOYT.js} +1 -1
- package/dist/client/assets/{textarea-DkhX0GHx.js → textarea-CFawkka2.js} +1 -1
- package/dist/client/assets/{toggle-group-DycM7-N_.js → toggle-group-DldcGrfI.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-C1nzkZ0O.js → toolbar-icon-button-C-BQlOIA.js} +1 -1
- package/dist/client/assets/{toolbar-BkEAwLUI.js → toolbar-jBTR3791.js} +1 -1
- package/dist/client/assets/{tooltip-BqKyJXAE.js → tooltip-CpOE5nvR.js} +1 -1
- package/dist/client/assets/{use-ai-providers-5Uex2oSr.js → use-ai-providers-DdIX-Xpr.js} +1 -1
- package/dist/client/assets/use-automations-CznkKU7t.js +1 -0
- package/dist/client/assets/{use-autosave-Bl3c8i03.js → use-autosave-DoSudPf1.js} +1 -1
- package/dist/client/assets/{use-capability-DEr7wDGX.js → use-capability-BovP4XU-.js} +1 -1
- package/dist/client/assets/{use-clock-tick-CSY_8HaC.js → use-clock-tick-ChZsdFLh.js} +1 -1
- package/dist/client/assets/{use-collections-DUypxirp.js → use-collections-S6V0IwCi.js} +1 -1
- package/dist/client/assets/use-connection-D6Dwslfb.js +1 -0
- package/dist/client/assets/{use-copy-D3Kq5ZXg.js → use-copy-BfaKF8HI.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-wWKEU4qb.js → use-create-virtual-mcp-Cdzy2DJ5.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-JY3wOk_Q.js → use-debounced-autosave-DFr-y--s.js} +1 -1
- package/dist/client/assets/{use-debounced-value-bL-Oya1Z.js → use-debounced-value-RFTrWCtV.js} +1 -1
- package/dist/client/assets/use-deco-credits-DXyld6r6.js +1 -0
- package/dist/client/assets/{use-decopilot-events-B1D2InIQ.js → use-decopilot-events-BT5VDJfu.js} +1 -1
- package/dist/client/assets/{use-delete-connection-D_oVL8p-.js → use-delete-connection-CuuUkwta.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Dklq6Q3m.js → use-deployment-admin-Dt1BUk6I.js} +1 -1
- package/dist/client/assets/{use-file-configs-COjddq6T.js → use-file-configs-CDPbC_cj.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-JNWuT_ZF.js → use-infinite-scroll-D-SpdQHa.js} +1 -1
- package/dist/client/assets/{use-join-requests-Dn_loBCd.js → use-join-requests-D-sfKqNd.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CYu-P7ZL.js → use-mcp-auth-status-BNFQn9dc.js} +1 -1
- package/dist/client/assets/use-mcp-client-pOz4zopz.js +10 -0
- package/dist/client/assets/{use-mcp-tools-uJVRRujf.js → use-mcp-tools-15u_CgDb.js} +1 -1
- package/dist/client/assets/{use-members-Cf24-Ckt.js → use-members-CedPlYWb.js} +1 -1
- package/dist/client/assets/{use-mobile-BLQxo0Qz.js → use-mobile-D93fuoUn.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DX9RGu8W.js → use-navigate-to-agent-DSm6IUhE.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DN10IV5X.js → use-org-auth-client-B-c5r-I9.js} +1 -1
- package/dist/client/assets/{use-org-sso-Bsdle9Ju.js → use-org-sso-DHWTyEhh.js} +1 -1
- package/dist/client/assets/{use-organization-roles-C1dmcd8L.js → use-organization-roles-B7HrL9iH.js} +1 -1
- package/dist/client/assets/use-organization-settings-B3nks7fT.js +1 -0
- package/dist/client/assets/use-registry-app-CIJpU86G.js +1 -0
- package/dist/client/assets/use-registry-connections-CTr4M4ng.js +1 -0
- package/dist/client/assets/{use-secrets-DuRhDEB-.js → use-secrets-BJqMdSXL.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CdM89JI2.js → use-status-sounds-CEwnbmsu.js} +1 -1
- package/dist/client/assets/{use-view-mode-CPZ_1kNu.js → use-view-mode-8qZQpYmt.js} +1 -1
- package/dist/client/assets/use-virtual-mcp-Cnu2_CEQ.js +1 -0
- package/dist/client/assets/useInfiniteQuery-IKzGAo4c.js +1 -0
- package/dist/client/assets/{useRouterState-BYirp-2v.js → useRouterState-Cu8GUbFN.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-JM6cFEC3.js +1 -0
- package/dist/client/assets/{users-Czfh_Ldy.js → users-BKNT8Pt-.js} +1 -1
- package/dist/client/assets/variant-calendar-CLm59vNC.js +1 -0
- package/dist/client/assets/{view-mode-toggle-D6NSNTM_.js → view-mode-toggle-CgTCB_hD.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +421 -421
- package/dist/server/migrate.js +80 -80
- package/dist/server/server.js +322 -322
- package/package.json +1 -1
- package/dist/client/assets/agents-list-uZ6QsPyJ.js +0 -1
- package/dist/client/assets/ai-providers-akY5IvEe.js +0 -1
- package/dist/client/assets/app-editor-D-7rxszJ.js +0 -1
- package/dist/client/assets/automations-CrrXQk0x.js +0 -1
- package/dist/client/assets/category-editor-BZ1iPsZn.js +0 -1
- package/dist/client/assets/collection-detail-CqQNJY-x.js +0 -1
- package/dist/client/assets/commerce-onboarding-DXLELfyG.js +0 -1
- package/dist/client/assets/connection-card-DjnLwIM-.js +0 -1
- package/dist/client/assets/connection-detail-Dmj7NLds.js +0 -1
- package/dist/client/assets/connections-CrZX9eIp.js +0 -1
- package/dist/client/assets/constants-BHDe7bIw.js +0 -1
- package/dist/client/assets/extract-connection-data-C0qDfuTX.js +0 -1
- package/dist/client/assets/file-explorer-Dx__xcgv.js +0 -2
- package/dist/client/assets/general-BvZcEbfM.js +0 -1
- package/dist/client/assets/github-repo-picker-Dtn_JVi-.js +0 -1
- package/dist/client/assets/index-D276pkfu.js +0 -2
- package/dist/client/assets/index-QfSYYMYy.js +0 -1
- package/dist/client/assets/index-vj1UIDk9.js +0 -1
- package/dist/client/assets/page-seo-sheet-mSGuS0o0.js +0 -1
- package/dist/client/assets/post-editor-CjgnpX45.js +0 -1
- package/dist/client/assets/project-app-view-BJ0hEB-9.js +0 -1
- package/dist/client/assets/record-editor-DxzYImji.js +0 -1
- package/dist/client/assets/redirect-editor-CSQWyuD6.js +0 -1
- package/dist/client/assets/registry-CoEuzgUm.js +0 -2
- package/dist/client/assets/roles-NiJ2qmTH.js +0 -1
- package/dist/client/assets/self-tool-result-B9B3SGAU.js +0 -1
- package/dist/client/assets/seo-editor-BnkeQMbe.js +0 -1
- package/dist/client/assets/shell-layout-BUDxl1va.js +0 -1
- package/dist/client/assets/store-3uQXsGQf.js +0 -1
- package/dist/client/assets/store-registry-BnE356l7.js +0 -2
- package/dist/client/assets/use-automations-DVQ8vBHR.js +0 -1
- package/dist/client/assets/use-connection-ZAfjrw2n.js +0 -1
- package/dist/client/assets/use-deco-credits-zzllCk_4.js +0 -1
- package/dist/client/assets/use-mcp-client-BjL1G4QR.js +0 -10
- package/dist/client/assets/use-organization-settings-diMs3Q13.js +0 -1
- package/dist/client/assets/use-registry-app-BkvGxg0L.js +0 -1
- package/dist/client/assets/use-registry-connections-BEaKKIqL.js +0 -1
- package/dist/client/assets/use-virtual-mcp-BUq9lEJe.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BxBR_av7.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Cdibyh2E.js +0 -1
- package/dist/client/assets/variant-calendar-BRbWSmVd.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as V,c as ne,j as t,B as K,i as ae,p as te,l as ge,E as Ge,C as be,b as _e,u as Qe,a as Ne,z as Je,G as Ye,D as Ze,M as et,J as tt,n as nt,t as R,K as st}from"./index-DMziGwwO.js";import{a as De,b as ot,g as it,e as rt}from"./extract-connection-data-C0qDfuTX.js";import{C as lt}from"./collection-display-button-DR8_laa0.js";import{S as ct}from"./search-input-BAsli81d.js";import{C as at}from"./collection-tabs-BzGvAa7-.js";import{C as Ce,u as dt,a as ke,g as mt}from"./connection-card-DjnLwIM-.js";import{E as ut}from"./empty-state-BAAsV00B.js";import{P as me}from"./index-DakOweBw.js";import{u as pt,D as gt}from"./use-delete-connection-D_oVL8p-.js";import{u as ye}from"./use-capability-DEr7wDGX.js";import{u as ht}from"./use-infinite-scroll-JNWuT_ZF.js";import{u as xt}from"./use-view-mode-CPZ_1kNu.js";import{g as pe}from"./connection-slug-eyAPH6o3.js";import{c as Ae,d as Te,b as we,A as Ie,e as Pe,g as $e,a as Oe,f as Le}from"./alert-dialog-B6UQptWc.js";import{n as he}from"./Tool02-9uhchTyk.js";import{D as Me,a as Fe,h as ze,c as Ve,d as Ee,e as Be}from"./dialog-qW-RW6Eb.js";import{D as ft,a as jt,c as yt,b as Ct,d as vt,e as St,f as bt}from"./drawer-Ci9lekJ-.js";import{u as _t}from"./use-mobile-BLQxo0Qz.js";import{F as Q,b as J,c as Y,d as Z,f as ee,a as ve}from"./form-CxHAlAHx.js";import{I as ie}from"./input-B9mAD-FD.js";import{S as Nt,a as Dt,b as kt,c as At,d as ce}from"./select-DY2h8ddP.js";import{T as Tt}from"./textarea-DkhX0GHx.js";import{b as Ke,u as wt}from"./use-connection-ZAfjrw2n.js";import{u as It}from"./use-virtual-mcp-BUq9lEJe.js";import{u as Pt}from"./studio-tools-D58JPByV.js";import{s as je}from"./Star01-B13g--Yk.js";import{s as He}from"./Plus-Be2ZDEMF.js";import{N as $t,M as Ot,av as Lt,am as Mt}from"./agent-icon-CQWu7X4M.js";import{s as Ue}from"./XClose-CUMcIZJo.js";import{i as ue,a as Se,E as Ft,c as zt,p as Vt,b as Et,d as Bt}from"./connection-form-helpers-CkmqwL7L.js";import{a as Kt}from"./authenticate-and-persist-oauth-DsuAbKam.js";import{I as Ht}from"./integration-icon-BQSFPqY7.js";import{C as Re}from"./checkbox-DypyLGWd.js";import{d as re,a as Ut,D as Rt,c as Wt}from"./dropdown-menu-M4Iyqsr4.js";import{i as Xt}from"./DotsVertical-BHuPkmo3.js";import{s as We}from"./Eye-HqCyXTaB.js";import{s as Xe}from"./Trash01-Dv6dfSGH.js";import"./use-mcp-client-BjL1G4QR.js";import"./constants-BHDe7bIw.js";import"./auth-CL1EKZwd.js";import"./ArrowUp-CRGMcwjN.js";import"./ChevronUp-BVwUhVX7.js";import"./SwitchHorizontal01-COeWFMnn.js";import"./tooltip-BqKyJXAE.js";import"./view-mode-toggle-D6NSNTM_.js";import"./badge-BaCv5hEo.js";import"./SearchMd-BvJfdUAe.js";import"./use-registry-connections-BEaKKIqL.js";import"./use-organization-settings-diMs3Q13.js";import"./useInfiniteQuery-BxBR_av7.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./card-UiTrwBHx.js";import"./sidebar-Dn9hhb22.js";import"./LayoutLeft-D8A_vRpx.js";import"./X-BsyIQyXA.js";import"./label-Dw5usZ3s.js";import"./ChevronDown--710wNet.js";import"./use-collections-DUypxirp.js";import"./AlertCircle-Bx5VPnCL.js";import"./Tool01-bTVguty-.js";import"./Settings02-BND3ad-_.js";import"./XCircle-CkxSUHFg.js";import"./ArrowUpRight-XjbUsL6J.js";import"./TrendUp01-C-A7bTAN.js";import"./ZapSquare-Ccv-CNqp.js";import"./ZoomOut-DIgycBu9.js";import"./Users03-2_7vN278.js";import"./CheckCircle-DvTvBvKr.js";import"./ChevronRight-CyX_OwBu.js";import"./Stars02-Bf5s6jtI.js";import"./Copy01-BlUuudlp.js";import"./Globe01-CxXiD__5.js";import"./FilterLines-CfibCuLd.js";import"./Globe04-CiK6pryU.js";import"./HardDrive-DljyyjQe.js";import"./Image01-CCmFaLM6.js";import"./Key01-CV8c3aey.js";import"./LinkExternal01-Blg4CFhG.js";import"./Monitor01-G0XI4AyE.js";import"./Sun-D4wn6C4e.js";import"./Package-BpnbT20S.js";import"./Palette-CucSl-Tp.js";import"./Play-J4lAOl0L.js";import"./SearchLg-hF3HTPE5.js";import"./Shield01-CesuQ_f6.js";import"./Stars01-DMCvEOuj.js";import"./Upload01-BpEWpOj6.js";import"./User01-DWXBU7_-.js";import"./Users01-DAw96n2a.js";import"./Zap-NvsmBFeg.js";import"./mcp-oauth-BBC8qIQI.js";function qt(f){const e=`deco-filters-${f}`,[n,a]=V.useState(()=>{try{const s=globalThis.localStorage?.getItem(e);if(s)return JSON.parse(s)}catch(s){console.error("Failed to parse stored filters:",s)}return[]});return[n,s=>{a(s);try{globalThis.localStorage?.setItem(e,JSON.stringify(s))}catch(i){console.error("Failed to save filters:",i)}}]}function Gt(f){const e=ne.c(7),[n,a]=V.useState(f),[o,s]=V.useState(f?"desc":null);let i;e[0]!==o||e[1]!==n?(i=j=>{n!==j?(a(j),s("asc")):o==="asc"?s("desc"):o==="desc"&&(a(void 0),s(null))},e[0]=o,e[1]=n,e[2]=i):i=e[2];const l=i;let d;return e[3]!==l||e[4]!==o||e[5]!==n?(d={sortKey:n,sortDirection:o,handleSort:l},e[3]=l,e[4]=o,e[5]=n,e[6]=d):d=e[6],d}function Qt(f){const e=ne.c(20),{namespace:n,resource:a,defaultSortKey:o,defaultViewMode:s}=f,i=o===void 0?"title":o,l=s===void 0?"table":s,[d,j]=V.useState(""),y=V.useDeferredValue(d),C=`${n}-${a}`,[v,u]=qt(C),p=`mesh-${a}-filter-visible-${n}`;let c;e[0]!==p?(c=()=>globalThis.localStorage?.getItem(p)==="true",e[0]=p,e[1]=c):c=e[1];const[S,_]=V.useState(c);let b;e[2]!==p?(b=F=>{_(F),globalThis.localStorage?.setItem(p,String(F))},e[2]=p,e[3]=b):b=e[3];const w=b;let D;e[4]!==S||e[5]!==w?(D=()=>{w(!S)},e[4]=S,e[5]=w,e[6]=D):D=e[6];const r=D,[I,$]=xt(`mesh-${a}-${n}`,l),{sortKey:L,sortDirection:T,handleSort:O}=Gt(i),k=L;let M;return e[7]!==S||e[8]!==v||e[9]!==O||e[10]!==d||e[11]!==y||e[12]!==w||e[13]!==u||e[14]!==$||e[15]!==T||e[16]!==k||e[17]!==r||e[18]!==I?(M={search:d,searchTerm:y,setSearch:j,filters:v,setFilters:u,filterBarVisible:S,setFilterBarVisible:w,toggleFilterBar:r,viewMode:I,setViewMode:$,sortKey:k,sortDirection:T,handleSort:O},e[7]=S,e[8]=v,e[9]=O,e[10]=d,e[11]=y,e[12]=w,e[13]=u,e[14]=$,e[15]=T,e[16]=k,e[17]=r,e[18]=I,e[19]=M):M=e[19],M}function Jt(f){const e=ne.c(20),{open:n,onOpenChange:a,count:o,onConfirm:s}=f,i=o!==1?"s":"";let l;e[0]!==o||e[1]!==i?(l=t.jsxs(Ae,{children:["Delete ",o," connection",i,"?"]}),e[0]=o,e[1]=i,e[2]=l):l=e[2];const d=o!==1?"s":"";let j;e[3]!==d?(j=t.jsxs(Te,{children:["This will permanently delete the selected connection",d,". This action cannot be undone."]}),e[3]=d,e[4]=j):j=e[4];let y;e[5]!==l||e[6]!==j?(y=t.jsxs(we,{children:[l,j]}),e[5]=l,e[6]=j,e[7]=y):y=e[7];let C;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Ie,{children:"Cancel"}),e[8]=C):C=e[8];const v=o!==1?"s":"";let u;e[9]!==o||e[10]!==s||e[11]!==v?(u=t.jsxs(Pe,{children:[C,t.jsxs($e,{onClick:s,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",o," connection",v]})]}),e[9]=o,e[10]=s,e[11]=v,e[12]=u):u=e[12];let p;e[13]!==y||e[14]!==u?(p=t.jsxs(Oe,{children:[y,u]}),e[13]=y,e[14]=u,e[15]=p):p=e[15];let c;return e[16]!==a||e[17]!==n||e[18]!==p?(c=t.jsx(Le,{open:n,onOpenChange:a,children:p}),e[16]=a,e[17]=n,e[18]=p,e[19]=c):c=e[19],c}function Yt(f){return f._registryId?.includes("community-registry")===!0}function Zt(f){const e=ne.c(58),{item:n,canManage:a,allConnections:o,connectedAppNames:s,connectingItemId:i,onNavigateConnected:l,onConnect:d}=f,[j,y]=V.useState(!1),[C,v]=V.useState(null);let u,p;e[0]!==s||e[1]!==n?(u=De(n)??"",p=s.has(u),e[0]=s,e[1]=n,e[2]=u,e[3]=p):(u=e[2],p=e[3]);const c=p,S=n._meta?.["mcp.mesh"],_=S?.friendlyName||S?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",b=n.server?.description||n.description||null;let w;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(w=n.server?.icons?.[0]?.src||ot(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=w):w=e[6];const D=w;let r;if(e[7]!==o||e[8]!==u){let A;e[10]!==u?(A=oe=>oe.connection_type!=="VIRTUAL"&&oe.app_name===u,e[10]=u,e[11]=A):A=e[11],r=o.filter(A),e[7]=o,e[8]=u,e[9]=r}else r=e[9];const I=r;let $;e[12]!==n?($=Yt(n),e[12]=n,e[13]=$):$=e[13];const L=$;let T,O;e[14]!==I||e[15]!==a||e[16]!==L||e[17]!==c||e[18]!==n||e[19]!==d||e[20]!==l?(T=()=>{if(c){const A=I[0];A&&l(A);return}a&&O()},O=()=>{L?(v("connect"),y(!0)):d(n)},e[14]=I,e[15]=a,e[16]=L,e[17]=c,e[18]=n,e[19]=d,e[20]=l,e[21]=T,e[22]=O):(T=e[21],O=e[22]);let k;e[23]!==n||e[24]!==d||e[25]!==C?(k=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),y(!1),C==="connect"&&d(n),v(null)},e[23]=n,e[24]=d,e[25]=C,e[26]=k):k=e[26];const M=k;let F;e[27]!==b||e[28]!==D||e[29]!==_?(F={title:_,description:b,icon:D},e[27]=b,e[28]=D,e[29]=_,e[30]=F):F=e[30];let q;e[31]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx(he,{}),e[31]=q):q=e[31];let U;e[32]!==L||e[33]!==n._sourceIcon?(U=L&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=L,e[33]=n._sourceIcon,e[34]=U):U=e[34];let W;e[35]!==a||e[36]!==i||e[37]!==O||e[38]!==c||e[39]!==n.id?(W=c?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):a&&t.jsx(K,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i!==null,onClick:A=>{A.stopPropagation(),O()},children:i===n.id?t.jsx(ae,{size:14,className:"animate-spin"}):"Connect"}),e[35]=a,e[36]=i,e[37]=O,e[38]=c,e[39]=n.id,e[40]=W):W=e[40];let g;e[41]!==U||e[42]!==W?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[U,W]}),e[41]=U,e[42]=W,e[43]=g):g=e[43];let N;e[44]!==T||e[45]!==g||e[46]!==F?(N=t.jsx(Ce,{connection:F,fallbackIcon:q,onClick:T,headerActionsAlwaysVisible:!0,headerActions:g}),e[44]=T,e[45]=g,e[46]=F,e[47]=N):N=e[47];let z;e[48]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsxs(we,{children:[t.jsx(Ae,{children:"Community MCP Server"}),t.jsx(Te,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=z):z=e[48];let H;e[49]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Ie,{children:"Cancel"}),e[49]=H):H=e[49];let E;e[50]!==M?(E=t.jsxs(Oe,{children:[z,t.jsxs(Pe,{children:[H,t.jsx($e,{onClick:M,children:"Continue"})]})]}),e[50]=M,e[51]=E):E=e[51];let h;e[52]!==j||e[53]!==E?(h=t.jsx(Le,{open:j,onOpenChange:y,children:E}),e[52]=j,e[53]=E,e[54]=h):h=e[54];let P;return e[55]!==N||e[56]!==h?(P=t.jsxs(t.Fragment,{children:[N,h]}),e[55]=N,e[56]=h,e[57]=P):P=e[57],P}function qe(f){const e=ne.c(8),{selectionMode:n,children:a}=f,o=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let s;e[0]!==o?(s=ge("overflow-hidden transition-all duration-150 ease-out",o),e[0]=o,e[1]=s):s=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ut,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:tn,children:t.jsx(Xt,{size:20})})}),e[2]=i):i=e[2];let l;e[3]!==a?(l=t.jsxs(Rt,{children:[i,t.jsx(Wt,{align:"end",onClick:en,children:a})]}),e[3]=a,e[4]=l):l=e[4];let d;return e[5]!==s||e[6]!==l?(d=t.jsx("div",{className:s,children:l}),e[5]=s,e[6]=l,e[7]=d):d=e[7],d}function en(f){return f.stopPropagation()}function tn(f){return f.stopPropagation()}function nn(f){const e=ne.c(49),{group:n,onOpen:a,selectionMode:o,selectedIds:s,onToggleSelect:i}=f;let l;if(e[0]!==n.connections||e[1]!==s){let k;e[3]!==s?(k=M=>s.has(M.id),e[3]=s,e[4]=k):k=e[4],l=n.connections.every(k),e[0]=n.connections,e[1]=s,e[2]=l}else l=e[2];const d=l;let j;if(e[5]!==n.connections||e[6]!==s){let k;e[8]!==s?(k=M=>s.has(M.id),e[8]=s,e[9]=k):k=e[9],j=n.connections.some(k),e[5]=n.connections,e[6]=s,e[7]=j}else j=e[7];const y=j;let C;e[10]!==d||e[11]!==n.connections||e[12]!==i||e[13]!==s?(C=()=>{for(const k of n.connections)d?s.has(k.id)&&i(k.id):s.has(k.id)||i(k.id)},e[10]=d,e[11]=n.connections,e[12]=i,e[13]=s,e[14]=C):C=e[14];const v=C,u=`${n.connections.length} instances`;let p;e[15]!==n.icon||e[16]!==n.title||e[17]!==u?(p={title:n.title,icon:n.icon,description:u},e[15]=n.icon,e[16]=n.title,e[17]=u,e[18]=p):p=e[18];let c;e[19]!==a||e[20]!==o||e[21]!==v?(c=()=>o?v():a(),e[19]=a,e[20]=o,e[21]=v,e[22]=c):c=e[22];const S=o&&d&&"ring-2 ring-primary",_=o&&y&&!d&&"ring-1 ring-primary/50";let b;e[23]!==S||e[24]!==_?(b=ge(S,_),e[23]=S,e[24]=_,e[25]=b):b=e[25];let w;e[26]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(he,{}),e[26]=w):w=e[26];let D;e[27]!==d||e[28]!==n.connections.length||e[29]!==o||e[30]!==y||e[31]!==v?(D=o?t.jsx(Re,{checked:d?!0:y?"indeterminate":!1,onCheckedChange:v}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[27]=d,e[28]=n.connections.length,e[29]=o,e[30]=y,e[31]=v,e[32]=D):D=e[32];let r;e[33]!==a?(r=k=>{k.stopPropagation(),a()},e[33]=a,e[34]=r):r=e[34];let I;e[35]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(We,{size:16}),e[35]=I):I=e[35];let $;e[36]!==r?($=t.jsxs(re,{onClick:r,children:[I,"Open"]}),e[36]=r,e[37]=$):$=e[37];let L;e[38]!==o||e[39]!==$?(L=t.jsx(qe,{selectionMode:o,children:$}),e[38]=o,e[39]=$,e[40]=L):L=e[40];let T;e[41]!==D||e[42]!==L?(T=t.jsxs("div",{className:"flex items-center gap-1",children:[D,L]}),e[41]=D,e[42]=L,e[43]=T):T=e[43];let O;return e[44]!==T||e[45]!==p||e[46]!==c||e[47]!==b?(O=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:p,onClick:c,className:b,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:T})}),e[44]=T,e[45]=p,e[46]=c,e[47]=b,e[48]=O):O=e[48],O}function sn(f){const e=ne.c(29),{connection:n,isSelected:a,selectionMode:o,canManage:s,canManageAgents:i,onToggleSelect:l,onOpen:d,onToggleStatus:j,onDelete:y}=f;let C;e[0]!==a||e[1]!==l||e[2]!==o?(C=o?t.jsx(Re,{checked:a,onCheckedChange:l,onClick:on}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),e[0]=a,e[1]=l,e[2]=o,e[3]=C):C=e[3];let v;e[4]!==d?(v=D=>{D.stopPropagation(),d()},e[4]=d,e[5]=v):v=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(We,{size:16}),e[6]=u):u=e[6];let p;e[7]!==v?(p=t.jsxs(re,{onClick:v,children:[u,"Open"]}),e[7]=v,e[8]=p):p=e[8];let c;e[9]!==s||e[10]!==i||e[11]!==l?(c=(s||i)&&t.jsxs(re,{onClick:D=>{D.stopPropagation(),l()},children:[t.jsx(Lt,{size:16}),"Select"]}),e[9]=s,e[10]=i,e[11]=l,e[12]=c):c=e[12];let S;e[13]!==s||e[14]!==n||e[15]!==j?(S=s&&(n.status==="active"?t.jsxs(re,{onClick:D=>{D.stopPropagation(),j("inactive")},children:[t.jsx($t,{size:16}),"Disable"]}):t.jsxs(re,{onClick:D=>{D.stopPropagation(),j("active")},children:[t.jsx(Ot,{size:16}),"Enable"]})),e[13]=s,e[14]=n,e[15]=j,e[16]=S):S=e[16];let _;e[17]!==s||e[18]!==y?(_=s&&t.jsxs(re,{variant:"destructive",onClick:D=>{D.stopPropagation(),y()},children:[t.jsx(Xe,{size:16}),"Delete"]}),e[17]=s,e[18]=y,e[19]=_):_=e[19];let b;e[20]!==o||e[21]!==p||e[22]!==c||e[23]!==S||e[24]!==_?(b=t.jsxs(qe,{selectionMode:o,children:[p,c,S,_]}),e[20]=o,e[21]=p,e[22]=c,e[23]=S,e[24]=_,e[25]=b):b=e[25];let w;return e[26]!==C||e[27]!==b?(w=t.jsxs("div",{className:"flex items-center gap-1",children:[C,b]}),e[26]=C,e[27]=b,e[28]=w):w=e[28],w}function on(f){return f.stopPropagation()}function rn(f){const e=ne.c(23),{count:n,total:a,canManage:o,canManageAgents:s,onSelectAll:i,onDeselectAll:l,onDelete:d,onAddToAgent:j,onToggleStatus:y,onCancel:C}=f;if(n===0)return null;let v;e[0]!==n?(v=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=v):v=e[1];let u;e[2]!==n||e[3]!==l||e[4]!==i||e[5]!==a?(u=n<a?t.jsxs(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:i,children:["Select all (",a,")"]}):t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:"Clear selection"}),e[2]=n,e[3]=l,e[4]=i,e[5]=a,e[6]=u):u=e[6];let p;e[7]!==s||e[8]!==j?(p=s&&t.jsxs(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:[t.jsx(He,{size:13}),"Add to Agent"]}),e[7]=s,e[8]=j,e[9]=p):p=e[9];let c;e[10]!==o||e[11]!==d||e[12]!==y?(c=o&&t.jsxs(t.Fragment,{children:[t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("active"),children:"Enable"}),t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("inactive"),children:"Disable"}),t.jsxs(K,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(Xe,{size:13}),"Delete"]})]}),e[10]=o,e[11]=d,e[12]=y,e[13]=c):c=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Ue,{size:13}),e[14]=S):S=e[14];let _;e[15]!==C?(_=t.jsx(K,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:C,children:S}),e[15]=C,e[16]=_):_=e[16];let b;return e[17]!==v||e[18]!==u||e[19]!==p||e[20]!==c||e[21]!==_?(b=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[v,u,p,c,_]})}),e[17]=v,e[18]=u,e[19]=p,e[20]=c,e[21]=_,e[22]=b):b=e[22],b}function ln(f){const e=ne.c(25),{open:n,onOpenChange:a,agents:o,onConfirm:s}=f,[i,l]=V.useState(null);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsxs(Me,{children:[t.jsx(Fe,{children:"Add to Agent"}),t.jsx(ze,{children:"Select an agent to add the selected connections to."})]}),e[0]=d):d=e[0];let j;e[1]!==o||e[2]!==i?(j=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):o.map(b=>t.jsxs("button",{type:"button",onClick:()=>l(b.id),className:ge("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",i===b.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Ht,{icon:b.icon,name:b.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:b.title}),b.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b.description})]})]},b.id)),e[1]=o,e[2]=i,e[3]=j):j=e[3];let y;e[4]!==j?(y=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=y):y=e[5];let C;e[6]!==a?(C=t.jsx(K,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e[6]=a,e[7]=C):C=e[7];const v=!i;let u;e[8]!==s||e[9]!==a||e[10]!==i?(u=()=>{i&&(s(i),a(!1),l(null))},e[8]=s,e[9]=a,e[10]=i,e[11]=u):u=e[11];let p;e[12]!==v||e[13]!==u?(p=t.jsx(K,{disabled:v,onClick:u,children:"Add"}),e[12]=v,e[13]=u,e[14]=p):p=e[14];let c;e[15]!==C||e[16]!==p?(c=t.jsxs(Ve,{children:[C,p]}),e[15]=C,e[16]=p,e[17]=c):c=e[17];let S;e[18]!==y||e[19]!==c?(S=t.jsxs(Ee,{className:"sm:max-w-[400px]",children:[d,y,c]}),e[18]=y,e[19]=c,e[20]=S):S=e[20];let _;return e[21]!==a||e[22]!==n||e[23]!==S?(_=t.jsx(Be,{open:n,onOpenChange:a,children:S}),e[21]=a,e[22]=n,e[23]=S,e[24]=_):_=e[24],_}function cn({listState:f,activeTab:e,typeFilter:n,statusFilter:a,registryFilter:o,enabledRegistries:s}){const{org:i}=be(),l=nt(),d=_e(),{data:j}=Ne.useSession(),y=Ke(),C=wt(f),v=pt(),{granted:u}=ye("connections:manage"),{granted:p}=ye("agents:manage"),[c,S]=V.useState(new Set),_=c.size>0,[b,w]=V.useState(!1),[D,r]=V.useState(!1),[I,$]=V.useState(null),L=It(),T=C.filter(m=>!(n!=="ALL"&&m.connection_type!==n||a!=="ALL"&&m.status!==a)),O=mt(T),k=m=>{S(x=>{const B=new Set(x);return B.has(m)?B.delete(m):B.add(m),B})},M=()=>{S(new Set)},F=ke(s,f.searchTerm),q=F.items,U=ht(F.loadMore,F.hasMore,F.isLoadingMore),W=new Set(C.filter(m=>m.app_name).map(m=>m.app_name)),g=o==="ALL"||s.some(m=>m.id===o)?o:"ALL",N=f.search.length>0,z=e==="all"||N?q.filter(m=>{if(g!=="ALL"&&m._registryId!==g)return!1;if(N){const x=De(m);if(x&&W.has(x))return!1}return!0}):[],H=e==="connected"||N?O:[],E=async m=>{if(!(!i||!j?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:m.id,source:"connections_page"}),$(m.id);try{const x=rt(m,i.id,j.user.id,{remoteIndex:0}),B=x.connection_type==="STDIO",G=!!x.connection_url,X=B&&x.connection_headers&&typeof x.connection_headers=="object"&&"command"in x.connection_headers;if(!G&&!X){R.error("This MCP Server cannot be connected: no connection method available"),$(null);return}const{id:se}=await y.create.mutateAsync(x),le=await Kt({connectionId:se,orgId:i.id,orgSlug:i.slug,persistFallback:fe=>y.update.mutateAsync({id:se,data:{connection_token:fe}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:se,flow:"connections_page_connect",error:le.error??"no_token"}),R.error(`Authentication failed: ${le.error??"no token received"}`);return}if(le.ran){te("connection_oauth_succeeded",{connection_id:se,flow:"connections_page_connect"});const fe=new URL(`/api/${i.slug}/mcp/${se}`,window.location.origin);await l.invalidateQueries({queryKey:st.isMCPAuthenticated(fe.href,null)}),P(),R.success("Authentication successful")}R.success("Connected successfully")}catch(x){R.error(`Failed to connect: ${x instanceof Error?x.message:String(x)}`)}finally{$(null)}}},h=Pt(),P=()=>{l.invalidateQueries({predicate:m=>{const x=m.queryKey;return x[1]===i.id&&x[3]==="collection"&&x[4]==="CONNECTIONS"}})},A=async()=>{w(!1);const m=[...c];te("connections_bulk_delete",{count:m.length});let x=0;for(const B of m)try{await h.call("COLLECTION_CONNECTIONS_DELETE",{id:B,force:!0}),x++}catch{}P(),R.success(`Deleted ${x} connection${x!==1?"s":""}`),M()},oe=async(m,x)=>{try{await y.update.mutateAsync({id:m,data:{status:x}}),P(),R.success(x==="active"?"Connection enabled":"Connection disabled")}catch{R.error("Failed to update connection")}},xe=async m=>{const x=[...c];te("connections_bulk_status_toggled",{count:x.length,to_status:m});let B=0;for(const G of x)try{await y.update.mutateAsync({id:G,data:{status:m}}),B++}catch{}P(),R.success(`${m==="active"?"Enabled":"Disabled"} ${B} connection${B!==1?"s":""}`),M()},de=async m=>{const x=L.find(X=>X.id===m);if(!x)return;te("connections_bulk_add_to_agent",{agent_id:m,count:c.size});const B=new Set(x.connections.map(X=>X.connection_id)),G=[...c].filter(X=>!B.has(X)).map(X=>({connection_id:X,selected_tools:null,selected_resources:null,selected_prompts:null}));if(G.length===0){R.info("All selected connections are already in that agent");return}try{await h.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:m,data:{connections:[...x.connections,...G]}}),l.invalidateQueries({predicate:X=>{const se=X.queryKey;return se[1]===i.id&&se[3]==="collection"&&se[4]==="VIRTUAL_MCP"}}),R.success(`Added ${G.length} connection${G.length!==1?"s":""} to "${x.title}"`),M()}catch{R.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(gt,{...v}),t.jsx(Jt,{open:b,onOpenChange:w,count:c.size,onConfirm:A}),t.jsx(ln,{open:D,onOpenChange:r,agents:L,onConfirm:de}),F.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(N?z.length===0&&T.length===0:e==="all"?z.length===0:T.length===0)?t.jsx(ut,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:f.search?`No Connections match "${f.search}"`:u?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[H.map(m=>{if(m.type==="group")return t.jsx(nn,{group:m,onOpen:()=>{d({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:m.key}})},selectionMode:_,selectedIds:c,onToggleSelect:k},m.key);const x=m.connection,B=c.has(x.id);return t.jsx(Ce,{connection:x,fallbackIcon:t.jsx(he,{}),onClick:()=>_?k(x.id):d({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:pe(x)}}),className:ge(B&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsx(sn,{connection:x,isSelected:B,selectionMode:_,canManage:u,canManageAgents:p,onToggleSelect:()=>k(x.id),onOpen:()=>d({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:pe(x)}}),onToggleStatus:G=>oe(x.id,G),onDelete:()=>v.requestDelete(x)})},x.id)}),z.map(m=>t.jsx(Zt,{item:m,canManage:u,allConnections:C,connectedAppNames:W,connectingItemId:I,onNavigateConnected:x=>d({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:pe(x)}}),onConnect:E},`catalog-${m._registryId}:${m.id}`)),(e==="all"||N)&&s.length>0&&t.jsx("div",{ref:U,className:"col-span-full h-4"}),(e==="all"||N)&&F.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ae,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(rn,{count:c.size,total:T.length,canManage:u,canManageAgents:p,onSelectAll:()=>{S(new Set(T.map(m=>m.id)))},onDeselectAll:()=>S(new Set),onDelete:()=>w(!0),onAddToAgent:()=>r(!0),onToggleStatus:xe,onCancel:M})]})}function an(){const{org:f}=be(),e=_e(),n=Qe({strict:!1}),{data:a}=Ne.useSession(),{stdioEnabled:o}=Je(),s=_t(),{granted:i}=ye("connections:manage"),l=Qt({namespace:f.slug,resource:"connections"}),d=Ke(),[j,y]=Ye(Ze.connectionsTab(f.slug),g=>n.tab==="all"||n.tab==="connected"?n.tab:g??"all"),[C,v]=V.useState("ALL"),[u,p]=V.useState("ALL"),[c,S]=V.useState("ALL"),_=dt(),w=ke(_,l.searchTerm).items,D=l.search!==l.searchTerm,r=et({resolver:tt(zt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),I=r.watch("ui_type"),$=r.watch("connection_url"),L=r.watch("npx_package"),T=ue({uiType:I,connectionUrl:$??"",npxPackage:L??""})??Se({uiType:I,connectionUrl:$??"",registryItems:w}),O=i&&n.action==="create",k=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:f.slug},search:{action:"create"}})},M=()=>{e({to:"/$org/settings/connections",params:{org:f.slug},search:{}})},F=async g=>{let N,z=null,H=null,E=null;g.ui_type==="NPX"?(N="STDIO",z="",E=Et(g.npx_package||"",g.env_vars||[])):g.ui_type==="STDIO"?(N="STDIO",z="",E=Bt(g.stdio_command||"",g.stdio_args||"",g.stdio_cwd,g.env_vars||[])):(N=g.ui_type,z=g.connection_url||"",H=g.connection_token||null);const h=it("conn");te("connection_custom_created",{connection_type:N,ui_type:g.ui_type}),await d.create.mutateAsync({id:h,title:g.title,description:g.description||null,connection_type:N,connection_url:z,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:a?.user?.id||"system",organization_id:f.id,icon:g.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),M(),r.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:f.slug,appSlug:pe({app_name:null,connection_url:z,title:g.title,id:h})}})},q=g=>{g||(O&&M(),r.reset())},U=g=>{const N=g.trim();if(!N)return;const z=!!r.formState.dirtyFields.title,H=!!r.formState.dirtyFields.description,E=!!r.formState.dirtyFields.env_vars,h=A=>{if(A&&(!z&&!r.getValues("title").trim()&&A.title&&r.setValue("title",A.title,{shouldDirty:!1}),!H&&!(r.getValues("description")??"").trim()&&A.description&&r.setValue("description",A.description,{shouldDirty:!1}),!E&&A.envVarKeys?.length)){const oe=r.getValues("env_vars")??[],xe=new Set(oe.map(m=>m.key)),de=A.envVarKeys.filter(m=>!xe.has(m));de.length>0&&r.setValue("env_vars",[...oe,...de.map(m=>({key:m,value:""}))],{shouldDirty:!0})}},P=Vt(N);if(P&&o){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",P.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),h(ue({uiType:"NPX",npxPackage:P.packageName}));return}if(N.startsWith("http://")||N.startsWith("https://")){const A=I==="HTTP"||I==="SSE"||I==="Websocket"?I:"HTTP";r.setValue("ui_type",A,{shouldDirty:!0}),r.setValue("connection_url",N,{shouldDirty:!0}),h(ue({uiType:A,connectionUrl:N})??Se({uiType:A,connectionUrl:N,registryItems:w}));return}I==="NPX"&&h(ue({uiType:"NPX",npxPackage:N}))},W=i?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(K,{variant:"outline",onClick:k,children:[t.jsx(He,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(me,{children:[(()=>{const g="Create Connection",N="Create a custom connection in your organization. Fill in the details below.",z=r.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:r.control,name:"ui_type",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Type *"}),t.jsxs(Nt,{value:h.value,onValueChange:h.onChange,children:[t.jsx(Z,{children:t.jsx(Dt,{children:t.jsx(kt,{})})}),t.jsxs(At,{children:[t.jsx(ce,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ce,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ce,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"Websocket"]})}),o&&t.jsxs(t.Fragment,{children:[t.jsx(ce,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(he,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(ce,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),I==="NPX"&&t.jsx(Q,{control:r.control,name:"npx_package",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...h,value:h.value??"",onPaste:P=>{const A=P.clipboardData.getData("text");A&&(P.preventDefault(),r.setValue("npx_package",A.trim(),{shouldDirty:!0}),U(A))},onBlur:P=>{U(P.target.value),h.onBlur()}})}),t.jsx(ee,{})]})}),I==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:r.control,name:"stdio_command",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Command *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"node, bun, python...",...h,value:h.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:r.control,name:"stdio_args",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...h,value:h.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:r.control,name:"stdio_cwd",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...h,value:h.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(I==="NPX"||I==="STDIO")&&t.jsx(Q,{control:r.control,name:"env_vars",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Ft,{value:h.value??[],onChange:h.onChange})}),t.jsx(ee,{})]})}),I!=="NPX"&&I!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:r.control,name:"connection_url",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"URL *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...h,value:h.value??"",onPaste:P=>{const A=P.clipboardData.getData("text");A&&(P.preventDefault(),r.setValue("connection_url",A.trim(),{shouldDirty:!0}),U(A))},onBlur:P=>{U(P.target.value),h.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:r.control,name:"connection_token",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:T?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:T?.token?.placeholder??"Bearer token or API key",...h,value:h.value??""})}),T?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.token.helperText,T.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:r.control,name:"title",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Name *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"My Connection",...h})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:r.control,name:"description",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Description"}),t.jsx(Z,{children:t.jsx(Tt,{placeholder:"A brief description of this connection",rows:3,...h,value:h.value??""})}),t.jsx(ee,{})]})})]}),E=O;return s?t.jsx(ft,{open:E,onOpenChange:q,children:t.jsxs(jt,{className:"max-h-[90vh]",children:[t.jsx(yt,{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(Ct,{children:g}),t.jsx(vt,{className:"mt-1",children:N})]}),t.jsx(St,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Ue,{size:16})})})]})}),t.jsx(ve,{...r,children:t.jsxs("form",{onSubmit:r.handleSubmit(F),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(bt,{children:t.jsx(K,{type:"submit",disabled:r.formState.isSubmitting,className:"w-full",children:z})})]})})]})}):t.jsx(Be,{open:E,onOpenChange:q,children:t.jsxs(Ee,{className:"sm:max-w-[525px]",children:[t.jsxs(Me,{children:[t.jsx(Fe,{children:g}),t.jsx(ze,{children:N})]}),t.jsx(ve,{...r,children:t.jsxs("form",{onSubmit:r.handleSubmit(F),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Ve,{children:[t.jsx(K,{type:"button",variant:"outline",onClick:()=>q(!1),children:"Cancel"}),t.jsx(K,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:z})]})]})})]})})})(),t.jsx(me.Content,{children:t.jsx(me.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(me.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ct,{value:l.search,onChange:l.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:g=>{g.key==="Escape"&&(l.setSearch(""),g.target.blur())}}),t.jsx(lt,{sortKey:l.sortKey,sortDirection:l.sortDirection,onSort:l.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:C,onChange:g=>v(g||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:u,onChange:g=>p(g||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:c,onChange:g=>S(g||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(g=>({id:g.id,label:g.id.includes("community-registry")?"Community MCP Registry":g.title}))]}]:[]]})]}),W]}),t.jsx(at,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:j,onTabChange:g=>{const N=g;N!==j&&te("connections_page_tab_changed",{to_tab:N}),y(N)}}),t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:D?.5:1,transition:D?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:D?"none":"auto"},children:t.jsx(cn,{listState:l,activeTab:j,typeFilter:C,statusFilter:u,registryFilter:c,enabledRegistries:_})})})]})})})]})})}function Gs(){const f=ne.c(1);let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(an,{})})}),f[0]=e):e=f[0],e}export{Gs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const r={SELF:e=>`${e}_self`,REGISTRY:e=>`${e}_registry`,COMMUNITY_REGISTRY:e=>`${e}_community-registry`,DEV_ASSETS:e=>`${e}_dev-assets`,SITE_DIAGNOSTICS:e=>`site-diagnostics_${e}`,COMMERCE_DISCOVERY:e=>`${e}_commerce-discovery`},E="get_my_diagnostic",g="self";function t(e){return{is(i){return!i||!i.startsWith(e)?null:i.slice(e.length)||null},get(i){return`${e}${i}`}}}function A(e){return{id:e.id,organization_id:e.organizationId,title:e.title,description:e.description,icon:e.icon,status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:e.instructions??null,...e.ui?{ui:e.ui}:{}},pinned:!1,connections:[]}}const a=t("decopilot_"),u=a.is,s=a.get,o=t("dev_"),d=o.get,N=o.is,c="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function R(e){return A({id:s(e),organizationId:e,title:"Super Agent",description:"Default agent that aggregates all organization connections",icon:c,ui:{layout:{defaultMainView:{type:"overview"},chatDefaultOpen:!0}}})}const _=t("commerce-discovery_"),l=_.get,n={AGENT_MANAGER:t("studio-agent-manager_"),AUTOMATION_MANAGER:t("studio-automation-manager_"),CONNECTION_MANAGER:t("studio-connection-manager_"),API_KEY_MANAGER:t("studio-api-key-manager_"),STORE_MANAGER:t("studio-store-manager_"),BRAND_MANAGER:t("studio-brand-manager_"),TASK_MANAGER:t("studio-task-manager_"),USAGE_MANAGER:t("studio-usage-manager_")},M={AGENT_MANAGER:n.AGENT_MANAGER.get,AUTOMATION_MANAGER:n.AUTOMATION_MANAGER.get,CONNECTION_MANAGER:n.CONNECTION_MANAGER.get,API_KEY_MANAGER:n.API_KEY_MANAGER.get,STORE_MANAGER:n.STORE_MANAGER.get,BRAND_MANAGER:n.BRAND_MANAGER.get,TASK_MANAGER:n.TASK_MANAGER.get,USAGE_MANAGER:n.USAGE_MANAGER.get};function G(e){return e?Object.values(n).some(i=>i.is(e)!==null):!1}export{E as C,g as S,r as W,R as a,G as b,d as c,M as d,c as e,s as f,l as g,u as i,N as p};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./index-DMziGwwO.js";import{c as O}from"./use-mcp-client-BjL1G4QR.js";import{W as T}from"./constants-BHDe7bIw.js";function x(t){if(!t)return null;const e=typeof t=="string"?t:t.url;if(!e)return null;const n=e.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function U(t){const e=x(t);if(!e)return null;const n=`https://github.com/${e.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function H(t,e){return t===T.REGISTRY(e)||t===T.COMMUNITY_REGISTRY(e)}function B(t,e){return H(t,e)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function J(t){if(!t)return[];const e=[];for(const n of t){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}e.push(...a)}return e}const D={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function L(t){return t?D[t]??t.toUpperCase():null}function Q(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const e=Object.keys(t).find(n=>Array.isArray(t[n]));if(e)return t[e]}return[]}async function X(t,e,n,a,r){const o=await O({connectionId:t,orgId:e,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}const Y="mcp.mesh";let G="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=G[n[t]&63];return e};function j(t){return`${t}_${$()}`}function K(t){return t._meta?.["mcp.mesh"]?.appName||t.server?.name||null}function V(t){if(!t?.url)return"Unknown";try{return new URL(t.url).hostname}catch{return t.url}}function W(t){const e=t?.identifier||t?.name;return e?e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Z(t,e,n,a){const r=t.server,o=t._meta?.[Y],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||t.title||r?.title||r?.name||"Unnamed MCP Server",C=r?.description||null,R=r?.icons?.[0]?.src||U(r?.repository)||null,i=o?.oauth_config,k=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,w=o?.configuration_state,A=o?.configuration_scopes,P=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],g=r?.remotes??[],S=a?.packageIndex??0,v=a?.remoteIndex??0,y=p.length>0&&(a?.packageIndex!==void 0||g.length===0),c=y?p[S]:null,l=y?null:g[v];let u,f,_=null;if(c){const h=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");_={command:"npx",args:h?["-y",h]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=L(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const M=g.length>1,N=p.length>1;let d="";c&&N?d=` (${W(c)})`:l&&M&&(d=` (${V(l)})`);const E=I+d;return{id:j("conn"),title:E,description:C,icon:R,app_name:K(t),app_id:o?.id||t.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:_,oauth_config:k,configuration_state:w??null,configuration_scopes:A??null,metadata:{source:"store",registry_item_id:t.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:P},created_at:s,updated_at:s,created_by:n,organization_id:e,tools:null,bindings:null,status:"inactive"}}export{K as a,U as b,X as c,Q as d,Z as e,J as f,j as g,B as i};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as J,r as u,j as r,i as oe,B as pe,d$ as jt,aO as Nt,aU as re,e0 as St,e1 as Mt,e2 as Dt,e3 as Rt,bL as Pt,e4 as Et,e5 as Be,aQ as kt,e6 as Tt,e7 as Ot,e8 as At,e9 as Lt,ea as Ft,eb as $t,ec as It,ed as _t,ee as zt,l as ie,n as Gt,t as Q,K as Le}from"./index-DMziGwwO.js";import{F as Kt,l as Bt}from"./index-b8bN8MBO.js";import{e as Vt,aJ as Ut,aK as Wt}from"./agent-icon-CQWu7X4M.js";import{s as Qt}from"./XClose-CUMcIZJo.js";import{m as qt}from"./automation-runs-CHGY7bEN.js";import{b as Fe,T as $e,a as Ie}from"./tooltip-BqKyJXAE.js";import{b as Ht}from"./chat-context-C2HnQcJb.js";import{u as Xt}from"./shell-layout-BUDxl1va.js";import{s as de,a as _e,f as Jt}from"./index-BCg0EIRK.js";import{a as Yt,h as Zt,D as en,c as tn,d as nn,e as rn}from"./dialog-qW-RW6Eb.js";import{I as ze}from"./input-B9mAD-FD.js";import{c as on,d as an,b as sn,A as ln,g as cn,e as dn,a as un,f as fn}from"./alert-dialog-B6UQptWc.js";import{t as mn}from"./ChevronDown--710wNet.js";import{i as pn}from"./ChevronRight-CyX_OwBu.js";import{a as xn}from"./ZoomOut-DIgycBu9.js";import{v as hn,E as gn,w as Ge,x as ve,y as vn,z as Cn,A as yn,C as H,D as ue,G as wn,g as Ce,I as ye,J as bn,K as jn,M as we,N as fe,O as be,P as Nn,Q as Sn}from"./index-w3F47_RR.js";import"./AlertCircle-Bx5VPnCL.js";import"./Tool01-bTVguty-.js";import"./ArrowUp-CRGMcwjN.js";import"./Settings02-BND3ad-_.js";import"./Tool02-9uhchTyk.js";import"./XCircle-CkxSUHFg.js";import"./ArrowUpRight-XjbUsL6J.js";import"./TrendUp01-C-A7bTAN.js";import"./ZapSquare-Ccv-CNqp.js";import"./Users03-2_7vN278.js";import"./CheckCircle-DvTvBvKr.js";import"./ChevronUp-BVwUhVX7.js";import"./DotsVertical-BHuPkmo3.js";import"./Stars02-Bf5s6jtI.js";import"./Copy01-BlUuudlp.js";import"./Globe01-CxXiD__5.js";import"./Eye-HqCyXTaB.js";import"./FilterLines-CfibCuLd.js";import"./Star01-B13g--Yk.js";import"./Globe04-CiK6pryU.js";import"./SwitchHorizontal01-COeWFMnn.js";import"./HardDrive-DljyyjQe.js";import"./Image01-CCmFaLM6.js";import"./Key01-CV8c3aey.js";import"./LayoutLeft-D8A_vRpx.js";import"./LinkExternal01-Blg4CFhG.js";import"./Monitor01-G0XI4AyE.js";import"./Sun-D4wn6C4e.js";import"./Package-BpnbT20S.js";import"./Palette-CucSl-Tp.js";import"./Play-J4lAOl0L.js";import"./Plus-Be2ZDEMF.js";import"./SearchLg-hF3HTPE5.js";import"./SearchMd-BvJfdUAe.js";import"./Shield01-CesuQ_f6.js";import"./Stars01-DMCvEOuj.js";import"./Trash01-Dv6dfSGH.js";import"./Upload01-BpEWpOj6.js";import"./User01-DWXBU7_-.js";import"./Users01-DAw96n2a.js";import"./X-BsyIQyXA.js";import"./Zap-NvsmBFeg.js";import"./select-DY2h8ddP.js";import"./useInfiniteQuery-BxBR_av7.js";import"./use-infinite-scroll-JNWuT_ZF.js";import"./use-connection-ZAfjrw2n.js";import"./use-collections-DUypxirp.js";import"./use-mcp-client-BjL1G4QR.js";import"./constants-BHDe7bIw.js";import"./auth-CL1EKZwd.js";import"./use-virtual-mcp-BUq9lEJe.js";import"./card-UiTrwBHx.js";import"./sidebar-Dn9hhb22.js";import"./use-mobile-BLQxo0Qz.js";import"./table-yhILZeXr.js";import"./empty-state-BAAsV00B.js";import"./use-members-Cf24-Ckt.js";import"./use-org-auth-client-DN10IV5X.js";import"./use-clock-tick-CSY_8HaC.js";import"./use-automations-DVQ8vBHR.js";import"./studio-tools-D58JPByV.js";import"./useSuspenseInfiniteQuery-Cdibyh2E.js";import"./avatar-D4ZURmpF.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-D3Kq5ZXg.js";import"./file-type-icon-Cb5F2Kv5.js";import"./tab-id-BijBBRwE.js";import"./hooks-CfbEEqda.js";import"./decopilot-sse-pool-Ch1Qumbm.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./monaco-editor-BlxKl3DU.js";import"./index-B5wBAEvg.js";import"./calendar-BcT06D8w.js";import"./integration-icon-BQSFPqY7.js";import"./use-navigate-to-agent-DX9RGu8W.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-DKXgsttk.js";import"./form-CxHAlAHx.js";import"./label-Dw5usZ3s.js";import"./autosend-BR42-er8.js";import"./use-ai-providers-5Uex2oSr.js";import"./location-BpLtHjTZ.js";import"./use-decopilot-events-B1D2InIQ.js";import"./use-organization-settings-diMs3Q13.js";import"./required-auth-layout-CAuTE_Ha.js";import"./use-org-sso-Bsdle9Ju.js";import"./drawer-Ci9lekJ-.js";import"./collection-search-oVrfvvPK.js";import"./index-D276pkfu.js";import"./get-initials-D-f_fDFw.js";import"./use-registry-app-BkvGxg0L.js";import"./use-mcp-tools-uJVRRujf.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-DsuAbKam.js";import"./mcp-oauth-BBC8qIQI.js";import"./extract-connection-data-C0qDfuTX.js";import"./dropdown-menu-M4Iyqsr4.js";import"./popover-CrO_Pfyc.js";import"./command-QdNoVtsu.js";import"./index-CLAxS6F3.js";import"./tabs-CMvxJGz-.js";import"./toggle-group-DycM7-N_.js";import"./use-deco-credits-zzllCk_4.js";import"./connection-card-DjnLwIM-.js";import"./use-registry-connections-BEaKKIqL.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-DkhX0GHx.js";import"./connection-form-helpers-CkmqwL7L.js";import"./collection-tabs-BzGvAa7-.js";import"./badge-BaCv5hEo.js";import"./connect-desktop-dialog-B1psOfPz.js";import"./select-model-DXVz8VSi.js";import"./checkbox-DypyLGWd.js";import"./skeleton-CypjCzyH.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-ATW3P6O6.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CdM89JI2.js";import"./toolbar-BkEAwLUI.js";import"./use-capability-DEr7wDGX.js";import"./toolbar-icon-button-C1nzkZ0O.js";import"./use-debounced-autosave-JY3wOk_Q.js";import"./index-DakOweBw.js";import"./search-input-BAsli81d.js";import"./use-mcp-auth-status-CYu-P7ZL.js";import"./switch-BYYj1eu3.js";import"./github-repo-picker-Dtn_JVi-.js";import"./use-debounced-value-bL-Oya1Z.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./use-secrets-DuRhDEB-.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-I50RkMs1.js";import"./use-file-configs-COjddq6T.js";import"./automation-list-row-9QEecu1P.js";const Mn={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function Dn(s){const e=J.c(51),{open:i,mode:a,initialName:c,parentLabel:f,isPending:h,onSubmit:p,onOpenChange:v}=s,C=c===void 0?"":c,d=h===void 0?!1:h,[x,y]=u.useState(C),[D,k]=u.useState(i),g=Mn[a];i!==D&&(k(i),i&&y(C));let b;e[0]!==d||e[1]!==v?(b=V=>{!V&&!d&&v(!1)},e[0]=d,e[1]=v,e[2]=b):b=e[2];const U=b;let T;e[3]!==d||e[4]!==x||e[5]!==p?(T=async V=>{V.preventDefault();const q=x.trim();!q||d||await p(q)},e[3]=d,e[4]=x,e[5]=p,e[6]=T):T=e[6];const O=T;let j;e[7]!==g.title?(j=r.jsx(Yt,{children:g.title}),e[7]=g.title,e[8]=j):j=e[8];let w;e[9]!==g.description?(w=r.jsx(Zt,{children:g.description}),e[9]=g.description,e[10]=w):w=e[10];let A;e[11]!==j||e[12]!==w?(A=r.jsxs(en,{children:[j,w]}),e[11]=j,e[12]=w,e[13]=A):A=e[13];let L;e[14]!==f?(L=f&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(ze,{value:f,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=f,e[15]=L):L=e[15];let G;e[16]===Symbol.for("react.memo_cache_sentinel")?(G=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=G):G=e[16];let $;e[17]===Symbol.for("react.memo_cache_sentinel")?($=V=>y(V.target.value),e[17]=$):$=e[17];let I;e[18]!==g.placeholder||e[19]!==d||e[20]!==x?(I=r.jsxs("div",{className:"space-y-1.5",children:[G,r.jsx(ze,{id:"file-explorer-name",value:x,onChange:$,placeholder:g.placeholder,autoFocus:!0,disabled:d})]}),e[18]=g.placeholder,e[19]=d,e[20]=x,e[21]=I):I=e[21];let R;e[22]!==I||e[23]!==L?(R=r.jsxs("div",{className:"space-y-4 py-4",children:[L,I]}),e[22]=I,e[23]=L,e[24]=R):R=e[24];let P;e[25]!==v?(P=()=>v(!1),e[25]=v,e[26]=P):P=e[26];let _;e[27]!==d||e[28]!==P?(_=r.jsx(pe,{type:"button",variant:"outline",onClick:P,disabled:d,children:"Cancel"}),e[27]=d,e[28]=P,e[29]=_):_=e[29];let z;e[30]!==d||e[31]!==x?(z=!x.trim()||d,e[30]=d,e[31]=x,e[32]=z):z=e[32];let N;e[33]!==g.submit||e[34]!==d?(N=d?r.jsxs(r.Fragment,{children:[r.jsx(oe,{size:14,className:"animate-spin"}),"Saving…"]}):g.submit,e[33]=g.submit,e[34]=d,e[35]=N):N=e[35];let K;e[36]!==z||e[37]!==N?(K=r.jsx(pe,{type:"submit",disabled:z,children:N}),e[36]=z,e[37]=N,e[38]=K):K=e[38];let S;e[39]!==_||e[40]!==K?(S=r.jsxs(tn,{children:[_,K]}),e[39]=_,e[40]=K,e[41]=S):S=e[41];let E;e[42]!==O||e[43]!==R||e[44]!==S||e[45]!==A?(E=r.jsx(nn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:O,children:[A,R,S]})}),e[42]=O,e[43]=R,e[44]=S,e[45]=A,e[46]=E):E=e[46];let W;return e[47]!==U||e[48]!==i||e[49]!==E?(W=r.jsx(rn,{open:i,onOpenChange:U,children:E}),e[47]=U,e[48]=i,e[49]=E,e[50]=W):W=e[50],W}function Rn(s){const e=J.c(31),{deleteTarget:i,deleteDirtyPaths:a,fsActionPending:c,onOpenChange:f,onConfirm:h}=s,p=i!==null,v=i?.kind==="directory"?"folder":"file";let C;e[0]!==v?(C=r.jsxs(on,{children:["Delete ",v,"?"]}),e[0]=v,e[1]=C):C=e[1];const d=i?.name;let x;e[2]!==d?(x=r.jsx("span",{className:"font-mono",children:d}),e[2]=d,e[3]=x):x=e[3];const y=i?.kind==="directory"?" and everything inside it.":".";let D;e[4]!==a.length?(D=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?"One open file has unsaved changes that will be lost.":`${a.length} open files have unsaved changes that will be lost.`]}),e[4]=a.length,e[5]=D):D=e[5];let k;e[6]!==x||e[7]!==y||e[8]!==D?(k=r.jsxs(an,{children:["This will permanently delete"," ",x,y,D]}),e[6]=x,e[7]=y,e[8]=D,e[9]=k):k=e[9];let g;e[10]!==C||e[11]!==k?(g=r.jsxs(sn,{children:[C,k]}),e[10]=C,e[11]=k,e[12]=g):g=e[12];let b;e[13]!==c?(b=r.jsx(ln,{disabled:c,children:"Cancel"}),e[13]=c,e[14]=b):b=e[14];const U=c||!i;let T;e[15]!==i||e[16]!==h?(T=L=>{L.preventDefault(),i&&h(i)},e[15]=i,e[16]=h,e[17]=T):T=e[17];let O;e[18]!==U||e[19]!==T?(O=r.jsx(cn,{disabled:U,onClick:T,children:"Delete"}),e[18]=U,e[19]=T,e[20]=O):O=e[20];let j;e[21]!==b||e[22]!==O?(j=r.jsxs(dn,{children:[b,O]}),e[21]=b,e[22]=O,e[23]=j):j=e[23];let w;e[24]!==j||e[25]!==g?(w=r.jsxs(un,{children:[g,j]}),e[24]=j,e[25]=g,e[26]=w):w=e[26];let A;return e[27]!==f||e[28]!==p||e[29]!==w?(A=r.jsx(fn,{open:p,onOpenChange:f,children:w}),e[27]=f,e[28]=p,e[29]=w,e[30]=A):A=e[30],A}var je="ContextMenu",[Pn]=kt(je,[Be]),B=Be(),[En,Ve]=Pn(je),Ue=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:f=!0}=s,[h,p]=u.useState(!1),v=B(e),C=Pt(a),d=u.useCallback(x=>{p(x),C(x)},[C]);return r.jsx(En,{scope:e,open:h,onOpenChange:d,modal:f,children:r.jsx(Et,{...v,dir:c,open:h,onOpenChange:d,modal:f,children:i})})};Ue.displayName=je;var We="ContextMenuTrigger",Qe=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,f=Ve(We,i),h=B(i),p=u.useRef({x:0,y:0}),v=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),C=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(C.current),[]),x=y=>{p.current={x:y.clientX,y:y.clientY},f.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(jt,{...h,virtualRef:v}),r.jsx(Nt.span,{"data-state":f.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:re(s.onContextMenu,y=>{d(),x(y),y.preventDefault()}),onPointerDown:a?s.onPointerDown:re(s.onPointerDown,me(y=>{d(),C.current=window.setTimeout(()=>x(y),700)})),onPointerMove:a?s.onPointerMove:re(s.onPointerMove,me(d)),onPointerCancel:a?s.onPointerCancel:re(s.onPointerCancel,me(d)),onPointerUp:a?s.onPointerUp:re(s.onPointerUp,me(d))})]})});Qe.displayName=We;var kn="ContextMenuPortal",qe=s=>{const{__scopeContextMenu:e,...i}=s,a=B(e);return r.jsx(Dt,{...a,...i})};qe.displayName=kn;var He="ContextMenuContent",Xe=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=Ve(He,i),f=B(i),h=u.useRef(!1);return r.jsx(Rt,{...f,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&h.current&&p.preventDefault(),h.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(h.current=!0)},style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Xe.displayName=He;var Tn="ContextMenuGroup",On=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Tt,{...c,...a,ref:e})});On.displayName=Tn;var An="ContextMenuLabel",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Ot,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuItem",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(St,{...c,...a,ref:e})});Je.displayName=Fn;var $n="ContextMenuCheckboxItem",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(At,{...c,...a,ref:e})});In.displayName=$n;var _n="ContextMenuRadioGroup",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Lt,{...c,...a,ref:e})});zn.displayName=_n;var Gn="ContextMenuRadioItem",Kn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Ft,{...c,...a,ref:e})});Kn.displayName=Gn;var Bn="ContextMenuItemIndicator",Vn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx($t,{...c,...a,ref:e})});Vn.displayName=Bn;var Un="ContextMenuSeparator",Ye=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Mt,{...c,...a,ref:e})});Ye.displayName=Un;var Wn="ContextMenuArrow",Qn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(It,{...c,...a,ref:e})});Qn.displayName=Wn;var qn="ContextMenuSubTrigger",Hn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(_t,{...c,...a,ref:e})});Hn.displayName=qn;var Xn="ContextMenuSubContent",Jn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(zt,{...c,...a,ref:e,style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Jn.displayName=Xn;function me(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var Yn=Ue,Zn=Qe,er=qe,tr=Xe,nr=Je,rr=Ye;function or(s){const e=J.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(Yn,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ir(s){const e=J.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(Zn,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=J.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ie("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",i),e[3]=i,e[4]=c):c=e[4];let f;return e[5]!==a||e[6]!==c?(f=r.jsx(er,{children:r.jsx(tr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=f):f=e[7],f}function ee(s){const e=J.c(12);let i,a,c,f;e[0]!==s?({className:i,inset:a,variant:f,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=f):(i=e[1],a=e[2],c=e[3],f=e[4]);const h=f===void 0?"default":f;let p;e[5]!==i?(p=ie("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),e[5]=i,e[6]=p):p=e[6];let v;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==h?(v=r.jsx(nr,{"data-slot":"context-menu-item","data-inset":a,"data-variant":h,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=h,e[11]=v):v=e[11],v}function Ke(s){const e=J.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ie("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let f;return e[5]!==a||e[6]!==c?(f=r.jsx(rr,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=f):f=e[7],f}const sr="#d9a441";function lr(s){const e=J.c(45),{node:i,depth:a,isExpanded:c,isSelected:f,isLoading:h,fileVisual:p,onOpen:v,onSelect:C,onNewFile:d,onNewFolder:x,onCopyPath:y,onCopyRelativePath:D,onRename:k,onDelete:g}=s,b=h===void 0?!1:h,U=i.kind==="directory",{Icon:T,color:O}=p,j=f&&"bg-accent";let w;e[0]!==j?(w=ie("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",j),e[0]=j,e[1]=w):w=e[1];const A=`${a*14+8}px`;let L;e[2]!==A?(L={paddingLeft:A},e[2]=A,e[3]=L):L=e[3];let G;e[4]!==v||e[5]!==C?(G=()=>{C(),v()},e[4]=v,e[5]=C,e[6]=G):G=e[6];let $;e[7]!==T||e[8]!==O||e[9]!==U||e[10]!==c||e[11]!==b?($=U?r.jsxs(r.Fragment,{children:[b?r.jsx(oe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(mn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(pn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(xn,{size:16,className:"shrink-0",style:{color:sr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(T,{size:16,className:"shrink-0",style:{color:O}})]}),e[7]=T,e[8]=O,e[9]=U,e[10]=c,e[11]=b,e[12]=$):$=e[12];let I;e[13]!==i.name?(I=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=I):I=e[14];let R;e[15]!==w||e[16]!==L||e[17]!==G||e[18]!==$||e[19]!==I?(R=r.jsx(ir,{asChild:!0,children:r.jsxs("button",{type:"button",className:w,style:L,onClick:G,children:[$,I]})}),e[15]=w,e[16]=L,e[17]=G,e[18]=$,e[19]=I,e[20]=R):R=e[20];let P;e[21]!==d?(P=r.jsx(ee,{onSelect:d,children:"New File"}),e[21]=d,e[22]=P):P=e[22];let _;e[23]!==x?(_=r.jsx(ee,{onSelect:x,children:"New Folder"}),e[23]=x,e[24]=_):_=e[24];let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=r.jsx(Ke,{}),e[25]=z):z=e[25];let N;e[26]!==y?(N=r.jsx(ee,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=N):N=e[27];let K;e[28]!==D?(K=r.jsx(ee,{onSelect:D,children:"Copy Relative Path"}),e[28]=D,e[29]=K):K=e[29];let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=r.jsx(Ke,{}),e[30]=S):S=e[30];let E;e[31]!==k?(E=r.jsx(ee,{onSelect:k,children:"Rename"}),e[31]=k,e[32]=E):E=e[32];let W;e[33]!==g?(W=r.jsx(ee,{variant:"destructive",onSelect:g,children:"Delete"}),e[33]=g,e[34]=W):W=e[34];let V;e[35]!==P||e[36]!==_||e[37]!==N||e[38]!==K||e[39]!==E||e[40]!==W?(V=r.jsxs(ar,{className:"w-52",children:[P,_,z,N,K,S,E,W]}),e[35]=P,e[36]=_,e[37]=N,e[38]=K,e[39]=E,e[40]=W,e[41]=V):V=e[41];let q;return e[42]!==V||e[43]!==R?(q=r.jsxs(or,{children:[R,V]}),e[42]=V,e[43]=R,e[44]=q):q=e[44],q}Bt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function cr(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function na({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,f]=u.useState({files:[],directories:[],truncated:!1}),{files:h,directories:p}=c,[v,C]=u.useState(new Set),[d,x]=u.useState(null),[y,D]=u.useState(null),[k,g]=u.useState([]),[b,U]=u.useState(""),[T,O]=u.useState(!1),[j,w]=u.useState(!1),[,A]=u.useState(new Set),[L,G]=u.useState(new Set),$=u.useRef(0),I=u.useRef(null),R=u.useRef(new Set),P=u.useRef(new Map);function _(t){A(n=>{const o=typeof t=="function"?t(n):t;return R.current=o,o})}const[z,N]=u.useState(new Map),K=u.useRef(null),[S,E]=u.useState(null),{sendMessage:W}=Ht(),{openSidePanel:V}=Xt(),q=Gt(),[F,X]=u.useState(null),[xe,he]=u.useState(null),[ae,se]=u.useState(!1);async function Y(t,n){const o=await fetch(cr(s,e,i,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function le(){q.invalidateQueries({queryKey:_e(s,e,i)})}function Ne(t,n){navigator.clipboard.writeText(n).then(()=>Q.success(`${t} copied`),()=>Q.error(`Failed to copy ${t.toLowerCase()}`))}function Ze(t){const n=Nn(t);if(!n)return;const o=`${s}/${e}/${i}`;q.setQueryData(Le.decofile(o),l=>{if(!l)return l;const{[n]:m,...M}=l;return M}),q.invalidateQueries({queryKey:Le.liveMeta(s,e,i)})}function et(t){const n=t.kind==="file"?[t.path]:h.filter(o=>o.startsWith(".deco/blocks/")).map(o=>ue(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)Ze(o)}function tt(t){const n=ue(t);return k.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=z.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Se(t){g(n=>n.map(o=>t(o)).filter(o=>o!==null)),x(n=>n&&t(n)),N(n=>{const o=new Map;for(const[l,m]of n){const M=t(l);M&&o.set(M,m)}return o}),D(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function nt(t){const n=ue(t);D(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Se(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function rt(t){if(!F)return;const n=fe(F.parentDir,t);if(be(n,h,p))throw new Error(`"${t}" already exists`);await Y("write",{path:H(n),content:""}),await te(),await le(),X(null),ge(n)}async function ot(t){if(!F)return;const n=fe(F.parentDir,t);if(be(n,h,p))throw new Error(`"${t}" already exists`);const o=H(n);await Y("mkdir",{path:o}),f(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await te(),await le(),X(null),C(l=>{const m=new Set(l);for(const M of ve(n))m.add(M);return m.add(n),m}),D({name:t,path:n,kind:"directory",children:[]})}async function it(t){if(!F)return;const n=F.node.path,o=we(n),l=fe(o,t);if(l===n){X(null);return}if(be(l,h,p))throw new Error(`"${t}" already exists`);await Y("rename",{from:H(n),to:H(l)}),Se(m=>m===n?l:m.startsWith(`${n}/`)?fe(l,m.slice(n.length+1)):m),await te(),await le(),X(null)}async function at(t){se(!0);try{await Y("unlink",{path:H(t.path),recursive:t.kind==="directory"}),et(t),nt(t.path),await te(),await le(),he(null),Q.success(`Deleted "${t.name}"`)}catch(n){Q.error(n instanceof Error?n.message:"Delete failed")}finally{se(!1)}}async function st(t){const n=jn(t);if(n){Q.error(n);return}se(!0);try{F?.mode==="new-file"?(await rt(t),Q.success(`Created "${t}"`)):F?.mode==="new-folder"?(await ot(t),Q.success(`Created folder "${t}"`)):F?.mode==="rename"&&(await it(t),Q.success(`Renamed to "${t}"`))}catch(o){Q.error(o instanceof Error?o.message:"Operation failed")}finally{se(!1)}}const Me=u.useRef(!1);Me.current||(Me.current=!0,I.current=te());const[lt,ct]=u.useState(null);if(a&&a!==lt){ct(a);const t=a;queueMicrotask(()=>{hn(t)&&ge(t).catch(n=>{Q.error(n instanceof Error?n.message:"Failed to open file")})})}async function De(t){const n=await Y("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Re(t,n,o){if(o!==$.current)return!1;let l=!1;return f(m=>{const M=n?Sn(m.files,m.directories,t,m.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!M.truncated,{files:M.files,directories:M.directories,truncated:l}}),l&&Q.warning("File list truncated — some files may be hidden"),l}async function dt(t){const n=P.current.get(t);if(n)return n;const o=$.current,l=(async()=>{const m=await De({pattern:"**/*",path:H(t),limit:Ge}),M=Re(m,!0,o);return!M&&o===$.current&&_(ne=>{const ce=new Set(ne);return ce.add(t),ce}),M})();P.current.set(t,l);try{return await l}finally{P.current.delete(t)}}async function Pe(t){if(!ye(t,R.current))return!1;G(n=>new Set(n).add(t));try{return await dt(t)}finally{G(n=>{const o=new Set(n);return o.delete(t),o})}}async function ut(t){const n=new Set(R.current);for(const o of ve(t)){if(!ye(o,n))continue;if(await Pe(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function te(){const t=++$.current;P.current.clear(),O(!0),_(new Set),C(new Set),G(new Set);try{const n=await De({pattern:"**/*",limit:Ge,maxDepth:gn});Re(n,!1,t),w(!0)}catch{j&&Q.error("Failed to refresh file tree")}finally{O(!1)}}async function Ee(t){if(!z.get(t)?.loaded){N(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await Y("read",{path:H(t),full:!0}),l=bn(o.content??"");N(m=>{const M=new Map(m);return M.set(t,{savedContent:l,editorValue:l,loaded:!0}),M})}catch{}}}async function ft(t,n){try{await Y("write",{path:H(t),content:n}),de("file saved via sandbox /write",{path:t}),q.invalidateQueries({queryKey:_e(s,e,i)});try{const o=await Jt(s,e,i);de("git status after save",o)}catch(o){de("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}N(o=>{const l=new Map(o),m=l.get(t);return m&&l.set(t,{...m,savedContent:n}),l})}catch(o){de("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function mt(t){x(t),D({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),E(null),k.includes(t)||g(n=>[...n,t]),Ee(t)}function pt(t){g(n=>{const o=n.filter(l=>l!==t);return d===t&&x(o[o.length-1]??null),o}),N(n=>{const o=new Map(n);return o.delete(t),o})}function ke(t){C(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function xt(t){if(ye(t,R.current))try{if(await Pe(t))return}catch(n){Q.error(n instanceof Error?n.message:"Failed to load folder");return}ke(t)}async function ht(t,n){if(n){ke(t);return}await xt(t)}async function ge(t){await I.current,await ut(t);const n=ve(t);C(o=>{const l=new Set(o);for(const m of n)l.add(m);return l}),mt(t)}function gt(){return y?.kind==="directory"?y.path:y?.kind==="file"?we(y.path):d?we(d):"/"}function Te(t){const n=gt();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const vt=vn(h,p),Oe=Cn(vt,v),Ae=b?Oe.filter(t=>t.node.name.toLowerCase().includes(b.toLowerCase())):Oe,Z=d?z.get(d):null,Ct=Z?.loaded&&Z.editorValue!==Z.savedContent,yt=xe?tt(xe.path):[],wt=(t,n)=>{K.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ft(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const m=l.getValueInRange(o);E({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:m})})};function bt(t){if(!S)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${S.filePath}\``,`**Lines:** ${S.lineStart}–${S.lineEnd}`];if(S.selectedCode){const o=Ce(S.filePath),l=S.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),V("chat"),W({parts:[{type:"text",text:n.join(`
|
|
2
|
-
`)}]}),E(null)}return T&&!j?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(oe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(Vt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:b,onChange:t=>U(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(Fe,{children:[r.jsx($e,{asChild:!0,children:r.jsx(pe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Te("new-file"),children:r.jsx(Ut,{size:14})})}),r.jsx(Ie,{side:"bottom",children:"New file"})]}),r.jsxs(Fe,{children:[r.jsx($e,{asChild:!0,children:r.jsx(pe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Te("new-folder"),children:r.jsx(Wt,{size:14})})}),r.jsx(Ie,{side:"bottom",children:"New folder"})]})]}),r.jsx(qt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Ae.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",m=v.has(n.path),M=y?.path===n.path,ne=yn(n.path,n.kind),ce=l&&L.has(n.path);return r.jsx(lr,{node:n,depth:o,isExpanded:m,isSelected:M,isLoading:ce,fileVisual:wn(n.name),onSelect:()=>D(n),onOpen:()=>{l?ht(n.path,m):ge(n.path)},onNewFile:()=>X({mode:"new-file",node:n,parentDir:ne}),onNewFolder:()=>X({mode:"new-folder",node:n,parentDir:ne}),onCopyPath:()=>Ne("Path",ue(n.path)),onCopyRelativePath:()=>Ne("Relative path",H(n.path)),onRename:()=>X({mode:"rename",node:n,parentDir:ne}),onDelete:()=>he(n)},n.path)}),j&&Ae.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:b?`No files match "${b}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[k.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:k.map(t=>{const n=z.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,m=t.split("/").pop()??t;return r.jsxs("div",{className:ie("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",l?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{x(t),Ee(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:m}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:M=>{M.stopPropagation(),pt(t)},children:r.jsx(Qt,{size:12})})]},t)})}),S&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&bt(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&E(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:"Send"}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&Z?.loaded?r.jsx(Kt,{language:Ce(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:d,onChange:t=>{const n=d;n&&N(o=>{const l=new Map(o),m=l.get(n);return m&&l.set(n,{...m,editorValue:t??""}),l})},onMount:wt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(oe,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},d):d&&!Z?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(oe,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[Ct?"Modified":"Saved"," ·"," ",Ce(d)]})]})]}),r.jsx(Dn,{open:F!==null,mode:F?.mode??"new-file",initialName:F?.mode==="rename"?F.node.name:"",parentLabel:F&&F.mode!=="rename"?F.parentDir==="/"?"/":H(F.parentDir):void 0,isPending:ae,onSubmit:st,onOpenChange:t=>{!t&&!ae&&X(null)}}),r.jsx(Rn,{deleteTarget:xe,deleteDirtyPaths:yt,fsActionPending:ae,onOpenChange:t=>{!t&&!ae&&he(null)},onConfirm:t=>{at(t)}})]})}export{na as FileExplorer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as K,C as V,n as M,M as Q,J as Z,d as U,p as F,t as w,K as L,j as n,ah as $,H,I as T,c as D,r as B,B as Y,D as q,s as J}from"./index-DMziGwwO.js";import{P as k}from"./index-DakOweBw.js";import{u as W}from"./use-org-auth-client-DN10IV5X.js";import{u as X}from"./use-debounced-autosave-JY3wOk_Q.js";import{A as ee}from"./avatar-D4ZURmpF.js";import{I as G}from"./input-B9mAD-FD.js";import{S as P,a as I,b as _,c as te}from"./settings-section-ATW3P6O6.js";import{D as ne}from"./domain-settings-B8ldFr2r.js";import{S as ae}from"./switch-BYYj1eu3.js";import{c as se,f as oe}from"./use-organization-settings-diMs3Q13.js";import{u as ie}from"./studio-tools-D58JPByV.js";import{c as re,b as le,d as ce,A as de,e as ue,g as me,a as ge,f as fe}from"./alert-dialog-B6UQptWc.js";import{R as pe}from"./require-capability-BFPA48Ea.js";import"./sidebar-Dn9hhb22.js";import"./LayoutLeft-D8A_vRpx.js";import"./use-mobile-BLQxo0Qz.js";import"./X-BsyIQyXA.js";import"./tooltip-BqKyJXAE.js";import"./User01-DWXBU7_-.js";import"./card-UiTrwBHx.js";import"./ArrowUpRight-XjbUsL6J.js";import"./badge-BaCv5hEo.js";import"./select-DY2h8ddP.js";import"./ChevronUp-BVwUhVX7.js";import"./ChevronDown--710wNet.js";import"./constants-BHDe7bIw.js";import"./use-capability-DEr7wDGX.js";import"./access-gate-BRzOXph6.js";import"./capability-load-error-BmygI5Wl.js";const he=new Set([".well-known","_admin","api","auth","cli","commerce-onboarding","dbos-queue-depth","health","hosted-run-pending","login","mcp","metrics","oauth","oauth-proxy","onboarding","org","report","reset-password"]);function xe(e){return typeof e=="string"&&he.has(e.trim().toLowerCase())}const je=H({name:T().min(1,"Name is required").max(255,"Name is too long"),slug:T().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens").refine(e=>!xe(e),"This organization URL is reserved by Studio"),logo:T().optional()});function be(e){const t=D.c(13),{value:f,onChange:d,name:s,disabled:l}=e,u=B.useRef(null);let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>u.current?.click(),t[0]=c):c=t[0];const r=c;let m;t[1]!==d?(m=j=>{const b=j.target.files?.[0];if(!b)return;if(b.size>2097152){w.error("Image must be smaller than 2MB");return}const g=new FileReader;g.onerror=ye,g.onloadend=()=>{g.result&&d(g.result),u.current&&(u.current.value="")},g.readAsDataURL(b)},t[1]=d,t[2]=m):m=t[2];const a=m;let o;t[3]!==l||t[4]!==a?(o=n.jsx("input",{ref:u,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:l}),t[3]=l,t[4]=a,t[5]=o):o=t[5];const i=f||void 0,x=s??"?";let p;t[6]!==i||t[7]!==x?(p=n.jsx(ee,{url:i,fallback:x,shape:"square",size:"base"}),t[6]=i,t[7]=x,t[8]=p):p=t[8];let h;return t[9]!==l||t[10]!==o||t[11]!==p?(h=n.jsxs("button",{type:"button",onClick:r,disabled:l,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[o,p]}),t[9]=l,t[10]=o,t[11]=p,t[12]=h):h=t[12],h}function ye(){return w.error("Failed to read image")}function ve(){const e=K(),{org:t}=V(),f=W(),d=M(),s=Q({resolver:Z(je),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),l=U({mutationFn:async a=>{const o={name:a.name,slug:a.slug};a.logo&&(o.logo=a.logo);const i=await f.organization.update({data:o});if(i?.error)throw new Error(i.error.message||"Failed to update organization");return i},onSuccess:(a,o)=>{F("organization_settings_updated",{organization_id:t.id,fields:Object.keys(o)}),d.invalidateQueries({queryKey:L.organizations()}),d.invalidateQueries({queryKey:L.activeOrganization(t.slug)}),w.success("Organization updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:a.data.slug}})},onError:(a,o)=>{F("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(o),error:a instanceof Error?a.message:String(a)}),w.error(a instanceof Error?a.message:"Failed to update organization")}}),{schedule:u,flush:c}=X({save:async()=>{const a=s.control._formState.dirtyFields;if(Object.keys(a).length===0||!await s.trigger())return;const i=s.getValues(),x=s.control._defaultValues;s.reset(i,{keepValues:!0});try{await l.mutateAsync(i)}catch{s.reset(x,{keepValues:!0})}}}),r=s.formState.errors,m=typeof window<"u"?`${window.location.host}/`:"";return n.jsx(P,{children:n.jsxs(I,{children:[n.jsx(_,{title:"Logo",description:"Recommended size is 256x256px",action:n.jsx(be,{value:s.watch("logo"),onChange:a=>{s.setValue("logo",a??"",{shouldDirty:!0}),c()},name:s.watch("name")})}),n.jsx(_,{title:"Name",action:n.jsx($,{control:s.control,name:"name",render:({field:a})=>n.jsx(G,{id:"org-name",...a,onChange:o=>{a.onChange(o),u()},onBlur:()=>{a.onBlur(),c()},placeholder:"Organization name",className:"w-[280px]"})})}),n.jsx(_,{title:"URL",action:n.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[m&&n.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:m}),n.jsx($,{control:s.control,name:"slug",render:({field:a})=>n.jsx("input",{id:"org-slug",value:a.value??"",name:a.name,ref:a.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:o=>{const i=o.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");s.setValue("slug",i,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),u()},onBlur:()=>{a.onBlur(),c()}})})]})}),(r.name||r.slug||r.logo)&&n.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&n.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.slug&&n.jsx("p",{className:"text-xs text-destructive",children:r.slug.message}),r.logo&&n.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function Se(){const e=D.c(6),t=se(),{mutate:f,isPending:d}=oe();let s;e[0]!==f?(s=u=>f(u),e[0]=f,e[1]=s):s=e[1];let l;return e[2]!==t||e[3]!==d||e[4]!==s?(l=n.jsx(P,{title:"Task board",description:"A board for tracking org tasks by status, priority, and assignee.",children:n.jsx(I,{children:n.jsx(_,{title:"Enable task board",description:"Adds a Board entry to the sidebar for this organization.",action:n.jsx(ae,{checked:t,disabled:d,onCheckedChange:s})})})}),e[2]=t,e[3]=d,e[4]=s,e[5]=l):l=e[5],l}function ze(){const e=D.c(42),{org:t}=V(),[f,d]=B.useState(!1),[s,l]=B.useState(""),u=ie();let c;e[0]!==t.id||e[1]!==u?(c=async()=>{await u.call("ORGANIZATION_DELETE",{id:t.id})},e[0]=t.id,e[1]=u,e[2]=c):c=e[2];let r;e[3]!==t.id||e[4]!==t.slug?(r=()=>{F("organization_deleted",{organization_id:t.id}),localStorage.getItem(q.lastOrgSlug())===t.slug&&localStorage.removeItem(q.lastOrgSlug()),J(),w.success("Organization deleted"),window.location.href="/"},e[3]=t.id,e[4]=t.slug,e[5]=r):r=e[5];let m;e[6]!==c||e[7]!==r?(m={mutationFn:c,onSuccess:r,onError:Ce},e[6]=c,e[7]=r,e[8]=m):m=e[8];const a=U(m);let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=()=>d(!0),e[9]=o):o=e[9];let i;e[10]!==a.isPending?(i=n.jsx(P,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(I,{className:"border-destructive/40",children:n.jsx(_,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:n.jsx(Y,{variant:"destructive",size:"sm",onClick:o,disabled:a.isPending,children:"Delete"})})})}),e[10]=a.isPending,e[11]=i):i=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=N=>{d(N),N||l("")},e[12]=x):x=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(re,{children:"Delete Organization?"}),e[13]=p):p=e[13];let h;e[14]!==t.name?(h=n.jsxs("p",{children:["This will permanently delete all data associated with"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[14]=t.name,e[15]=h):h=e[15];let j;e[16]!==t.name?(j=n.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[16]=t.name,e[17]=j):j=e[17];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=N=>l(N.target.value),e[18]=b):b=e[18];let g;e[19]!==s||e[20]!==t.name?(g=n.jsx(G,{value:s,onChange:b,placeholder:t.name,autoFocus:!0}),e[19]=s,e[20]=t.name,e[21]=g):g=e[21];let y;e[22]!==g||e[23]!==h||e[24]!==j?(y=n.jsxs(le,{children:[p,n.jsx(ce,{asChild:!0,children:n.jsxs("div",{children:[h,j,g]})})]}),e[22]=g,e[23]=h,e[24]=j,e[25]=y):y=e[25];let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(de,{children:"Cancel"}),e[26]=O):O=e[26];let v;e[27]!==a?(v=()=>a.mutate(),e[27]=a,e[28]=v):v=e[28];const E=s!==t.name||a.isPending,R=a.isPending?"Deleting…":"Delete organization";let S;e[29]!==v||e[30]!==E||e[31]!==R?(S=n.jsxs(ue,{children:[O,n.jsx(me,{onClick:v,disabled:E,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:R})]}),e[29]=v,e[30]=E,e[31]=R,e[32]=S):S=e[32];let z;e[33]!==y||e[34]!==S?(z=n.jsxs(ge,{children:[y,S]}),e[33]=y,e[34]=S,e[35]=z):z=e[35];let C;e[36]!==f||e[37]!==z?(C=n.jsx(fe,{open:f,onOpenChange:x,children:z}),e[36]=f,e[37]=z,e[38]=C):C=e[38];let A;return e[39]!==C||e[40]!==i?(A=n.jsxs(n.Fragment,{children:[i,C]}),e[39]=C,e[40]=i,e[41]=A):A=e[41],A}function Ce(e){w.error(e instanceof Error?e.message:"Failed to delete organization")}function we(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(k,{children:n.jsx(k.Content,{children:n.jsx(k.Body,{children:n.jsxs(te,{children:[n.jsx(k.Title,{children:"Organization"}),n.jsx(ve,{}),n.jsx(ne,{}),n.jsx(Se,{}),n.jsx(ze,{})]})})})}),e[0]=t):t=e[0],t}function tt(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(pe,{capability:"org:manage",area:"general settings",children:n.jsx(we,{})}),e[0]=t):t=e[0],t}export{tt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as B,a as Y,n as $,r as T,ac as H,c as R,j as t,i as z,d as Q,t as O,dF as W,K as G,m as X,B as Z,l as F,v as ee,w as te}from"./index-DMziGwwO.js";import{D as ne,a as se,d as oe,e as ie}from"./dialog-qW-RW6Eb.js";import{C as re}from"./collection-search-oVrfvvPK.js";import{u as le}from"./use-debounced-value-bL-Oya1Z.js";import{b as M,u as ae}from"./use-connection-ZAfjrw2n.js";import{u as U}from"./use-mcp-client-BjL1G4QR.js";import{S as V}from"./constants-BHDe7bIw.js";import{a as K}from"./authenticate-and-persist-oauth-DsuAbKam.js";import{b as J}from"./Settings02-BND3ad-_.js";import{L as ce}from"./agent-icon-CQWu7X4M.js";import{u as ue,G as P}from"./use-registry-app-BkvGxg0L.js";import{e as de}from"./extract-connection-data-C0qDfuTX.js";import{c as me}from"./use-navigate-to-agent-DX9RGu8W.js";import{p as q,f as fe}from"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import{g as xe}from"./github-repo-scope-DjMZbiKa.js";const ge="deco/mcp-github";function pe(N){const{org:e}=B(),{data:i}=Y.useSession(),f=M(),v=$(),[g,s]=T.useState("idle"),[p,x]=T.useState(null),[h,C]=T.useState(null),{data:b,isLoading:l}=ue(ge,{enabled:N.enabled}),o=T.useRef(!1);N.enabled&&b&&!l&&!o.current&&i?.user?.id&&g==="idle"&&(o.current=!0,a());async function a(){if(!(!b||!i?.user?.id||!e))try{s("installing"),x(null);const r=de(b,e.id,i.user.id,{remoteIndex:0});if(!r.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:y}=await f.create.mutateAsync(r);s("authenticating");const d=await K({connectionId:y,orgId:e.id,orgSlug:e.slug,persistFallback:n=>f.update.mutateAsync({id:y,data:{connection_token:n}}).then(()=>{})});if(d.ran&&!d.ok){try{await f.delete.mutateAsync(y)}catch{}throw new Error(d.error&&d.error!=="no token received"?d.error:"No token received from GitHub")}H(v,e.id),C(r),s("ready")}catch(r){x(r instanceof Error?r.message:String(r)),s("error")}}function c(){s("idle"),x(null),C(null),o.current=!1}return N.enabled&&l&&g==="idle"?{status:"installing",error:null,connection:null,retry:c}:{status:g,error:p,connection:h,retry:c}}function Ue(N){const e=R.c(22),{open:i,onOpenChange:f,title:v,onImportComplete:g,mode:s}=N,p=s===void 0?"agent":s,x=v??(p==="connection"?"Add repo":"Import from GitHub"),[h,C]=T.useState(null);let b;e[0]!==x?(b=t.jsx(ne,{className:"sr-only",children:t.jsx(se,{children:x})}),e[0]=x,e[1]=b):b=e[1];let l;e[2]!==x||e[3]!==h?(l=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:h?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>C(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(J,{size:16})}),t.jsx("img",{src:h.avatarUrl,alt:h.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:h.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(P,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:x})]})}),e[2]=x,e[3]=h,e[4]=l):l=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=o):o=e[5];let a;e[6]!==f?(a=()=>f(!1),e[6]=f,e[7]=a):a=e[7];let c;e[8]!==p||e[9]!==g||e[10]!==i||e[11]!==h||e[12]!==a?(c=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(T.Suspense,{fallback:o,children:t.jsx(he,{open:i,onComplete:a,selectedInstallation:h,onSelectInstallation:C,onImportComplete:g,mode:p})})}),e[8]=p,e[9]=g,e[10]=i,e[11]=h,e[12]=a,e[13]=c):c=e[13];let r;e[14]!==b||e[15]!==l||e[16]!==c?(r=t.jsxs(oe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[b,l,c]}),e[14]=b,e[15]=l,e[16]=c,e[17]=r):r=e[17];let u;return e[18]!==f||e[19]!==i||e[20]!==r?(u=t.jsx(ie,{open:i,onOpenChange:f,children:r}),e[18]=f,e[19]=i,e[20]=r,e[21]=u):u=e[21],u}function he({open:N,onComplete:e,selectedInstallation:i,onSelectInstallation:f,onImportComplete:v,mode:g="agent"}){const{org:s}=B(),p=$(),x=me(),[h,C]=T.useState(null),b=ae({slug:"mcp-github"}),l=xe(b),o=pe({enabled:N&&l.length===0}),a=l.length===1?l[0]??null:h,c=U({connectionId:a?.id??"",orgId:s.id,orgSlug:s.slug}),r=U({connectionId:V,orgId:s.id,orgSlug:s.slug}),u=async(n,j)=>{try{const k=await c.callTool({name:"get_file_contents",arguments:{owner:n.owner,repo:n.name,path:j}});if(k.isError)return null;const I=k.content?.find(m=>m.type==="resource")?.resource?.text;if(!I)return null;try{const m=JSON.parse(I);return typeof m=="string"?m:JSON.stringify(m)}catch{return I}}catch{return null}},y=(n,j)=>{Promise.all([u(j,"AGENTS.md"),u(j,"CLAUDE.md")]).then(async([S,k])=>{const w=S??k??null;w&&(await r.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:n,data:{metadata:{instructions:w}}}}),H(p,s.id))}).catch(S=>{console.error("GitHub instructions fetch failed:",S)})},d=Q({mutationFn:async n=>{if(!a||!i)throw new Error("No GitHub connection or installation");const j=i.installationId;if(g==="connection"){const{childConnectionId:w}=await q({orgSlug:s.slug,sourceConnection:a,installationId:j,owner:n.owner,repo:n.name,githubCallTool:I=>c.callTool(I),selfCallTool:I=>r.callTool(I),orgShared:!0});return{virtualMcpId:null,repo:n,connectionId:w,item:null}}const{childConnectionId:S}=await q({orgSlug:s.slug,sourceConnection:a,installationId:j,owner:n.owner,repo:n.name,githubCallTool:w=>c.callTool(w),selfCallTool:w=>r.callTool(w)});let k=null;try{const w=await r.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:n.name,description:n.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:n.owner,name:n.name,url:n.url,installationId:j,connectionId:S},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:S}]}}}),I=w.structuredContent??w,m=I.item?.id;if(!I.item||!m)throw new Error("Failed to create the imported agent");return k=m,{virtualMcpId:m,repo:n,connectionId:S,item:I.item}}catch(w){throw k&&await r.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:k}}).catch(()=>{}),await r.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:S,force:!0}}).catch(()=>{}),w}},onSuccess:({virtualMcpId:n,repo:j,connectionId:S,item:k})=>{if(g==="connection"||!n||!k){H(p,s.id),W(p,s.id),O.success(`Added ${j.name}`),e();return}if(p.setQueryData(G.collectionItem(r,s.id,"","VIRTUAL_MCP",n),{item:k}),H(p,s.id),y(n,j),v){v({virtualMcpId:n,repo:j,connectionId:S});return}O.success(`Imported ${j.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),x(n)},onError:n=>{O.error("Failed to import repo: "+(n instanceof Error?n.message:"Unknown error"))}});return o.status==="installing"||o.status==="authenticating"?t.jsx(D,{status:o.status,error:null,retry:o.retry}):o.status==="error"?t.jsx(D,{status:"error",error:o.error,retry:o.retry}):l.length===0&&o.status==="idle"?t.jsx(D,{status:"installing",error:null,retry:o.retry}):l.length>1&&!a?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),l.map(n=>t.jsxs("button",{type:"button",onClick:()=>C(n),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[n.icon?t.jsx("img",{src:n.icon,alt:n.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(P,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:n.title})]},n.id))]}):a?i?t.jsx(Ne,{connectionId:a.id,orgId:s.id,orgSlug:s.slug,installation:i,onSelectRepo:n=>d.mutate(n),isSaving:d.isPending}):t.jsx(be,{connectionId:a.id,orgId:s.id,orgSlug:s.slug,onSelect:f,showBackButton:l.length>1,onBack:()=>C(null)}):null}function be(N){const e=R.c(47),{connectionId:i,orgId:f,orgSlug:v,onSelect:g,showBackButton:s,onBack:p}=N;let x;e[0]!==f||e[1]!==v?(x={connectionId:V,orgId:f,orgSlug:v},e[0]=f,e[1]=v,e[2]=x):x=e[2];const h=U(x),C=$(),b=M();let l;e[3]!==i||e[4]!==f?(l=G.githubUserOrgs(f,i),e[3]=i,e[4]=f,e[5]=l):l=e[5];let o;e[6]!==i||e[7]!==h?(o=()=>fe(m=>h.callTool(m),i),e[6]=i,e[7]=h,e[8]=o):o=e[8];let a;e[9]!==l||e[10]!==o?(a={queryKey:l,queryFn:o},e[9]=l,e[10]=o,e[11]=a):a=e[11];const c=X(a);let r;e[12]!==b||e[13]!==i||e[14]!==c||e[15]!==f||e[16]!==v||e[17]!==C?(r={mutationFn:async()=>{const m=await K({connectionId:i,orgId:f,orgSlug:v,persistFallback:E=>b.update.mutateAsync({id:i,data:{connection_token:E}}).then(je)});if(m.ran&&!m.ok)throw new Error(m.error??"no token received");const _=new URL(`/api/${v}/mcp/${i}`,window.location.origin);await C.invalidateQueries({queryKey:G.isMCPAuthenticated(_.href,null)}),await C.invalidateQueries({queryKey:G.mcpClientPrefix()}),await c.refetch()},onError:ye},e[12]=b,e[13]=i,e[14]=c,e[15]=f,e[16]=v,e[17]=C,e[18]=r):r=e[18];const u=Q(r);if(c.isLoading){let m;return e[19]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[19]=m):m=e[19],m}if(c.isError){let m,_;e[20]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"}),_=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:"Your GitHub connection may have expired. Reconnect to restore access."}),e[20]=m,e[21]=_):(m=e[20],_=e[21]);let E;e[22]!==u?(E=()=>u.mutate(),e[22]=u,e[23]=E):E=e[23];let A;e[24]!==u.isPending?(A=u.isPending?t.jsx(z,{size:14,className:"animate-spin"}):t.jsx(P,{className:"size-3.5"}),e[24]=u.isPending,e[25]=A):A=e[25];let L;return e[26]!==u.isPending||e[27]!==E||e[28]!==A?(L=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[m,_,t.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:E,disabled:u.isPending,children:[A,"Reconnect GitHub"]})]}),e[26]=u.isPending,e[27]=E,e[28]=A,e[29]=L):L=e[29],L}const y=c.data;if(!y)return null;let d;e[30]!==p||e[31]!==s?(d=s&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:p,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(J,{size:12}),"Change connection"]})}),e[30]=p,e[31]=s,e[32]=d):d=e[32];let n;if(e[33]!==y.installations||e[34]!==g){let m;e[36]!==g?(m=_=>t.jsxs("button",{type:"button",onClick:()=>g(_),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:_.avatarUrl,alt:_.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:_.login}),_.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},_.installationId),e[36]=g,e[37]=m):m=e[37],n=y.installations.map(m),e[33]=y.installations,e[34]=g,e[35]=n}else n=e[35];let j;e[38]!==n?(j=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:n}),e[38]=n,e[39]=j):j=e[39];const S=y.appSlug?`https://github.com/apps/${y.appSlug}/installations/new`:"https://github.com/settings/installations";let k;e[40]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[40]=k):k=e[40];let w;e[41]!==S?(w=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",k]})}),e[41]=S,e[42]=w):w=e[42];let I;return e[43]!==w||e[44]!==d||e[45]!==j?(I=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[d,j,w]}),e[43]=w,e[44]=d,e[45]=j,e[46]=I):I=e[46],I}function ye(N){O.error("Failed to reconnect GitHub: "+(N instanceof Error?N.message:"Unknown error"))}function je(){}function Ne(N){const e=R.c(20),{connectionId:i,orgId:f,orgSlug:v,installation:g,onSelectRepo:s,isSaving:p}=N,[x,h]=T.useState(""),C=le(x,300),b=T.useDeferredValue(C),l=x!==b;let o;e[0]!==l||e[1]!==x?(o=t.jsx(re,{placeholder:"Search repositories...",value:x,onChange:h,isSearching:l}),e[0]=l,e[1]=x,e[2]=o):o=e[2];const a=l?"opacity-40":"opacity-100";let c;e[3]!==a?(c=F("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",a),e[3]=a,e[4]=c):c=e[4];let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=r):r=e[5];let u;e[6]!==i||e[7]!==b||e[8]!==g||e[9]!==p||e[10]!==s||e[11]!==f||e[12]!==v?(u=t.jsx(T.Suspense,{fallback:r,children:t.jsx(ve,{connectionId:i,orgId:f,orgSlug:v,installation:g,query:b,onSelectRepo:s,isSaving:p})}),e[6]=i,e[7]=b,e[8]=g,e[9]=p,e[10]=s,e[11]=f,e[12]=v,e[13]=u):u=e[13];let y;e[14]!==c||e[15]!==u?(y=t.jsx("div",{className:c,children:u}),e[14]=c,e[15]=u,e[16]=y):y=e[16];let d;return e[17]!==o||e[18]!==y?(d=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[o,y]}),e[17]=o,e[18]=y,e[19]=d):d=e[19],d}function ve(N){const e=R.c(29),{connectionId:i,orgId:f,orgSlug:v,installation:g,query:s,onSelectRepo:p,isSaving:x}=N;let h;e[0]!==i||e[1]!==f||e[2]!==v?(h={connectionId:i,orgId:f,orgSlug:v},e[0]=i,e[1]=f,e[2]=v,e[3]=h):h=e[3];const C=U(h),b=g.type==="User"?"user":"org",l=s?`${b}:${g.login} ${s} in:name`:`${b}:${g.login}`;let o;e[4]!==i||e[5]!==g.login||e[6]!==f||e[7]!==s?(o=G.githubOrgRepos(f,i,g.login,s),e[4]=i,e[5]=g.login,e[6]=f,e[7]=s,e[8]=o):o=e[8];let a;e[9]!==C||e[10]!==l?(a=async d=>{const{signal:n}=d,S=(await C.callTool({name:"search_repositories",arguments:{query:l,page:1,perPage:30}},void 0,{signal:n})).content?.[0]?.text;if(!S)throw new Error("No response from search_repositories");return(JSON.parse(S).items??[]).map(we)},e[9]=C,e[10]=l,e[11]=a):a=e[11];let c;e[12]!==o||e[13]!==a?(c={queryKey:o,queryFn:a},e[12]=o,e[13]=a,e[14]=c):c=e[14];const{data:r}=ee(c);if(r.length===0){let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=d):d=e[15];let n;e[16]!==s?(n=s&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=s,e[17]=n):n=e[17];let j;return e[18]!==n?(j=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[d,n]}),e[18]=n,e[19]=j):j=e[19],j}let u;if(e[20]!==x||e[21]!==p||e[22]!==r){let d;e[24]!==x||e[25]!==p?(d=n=>t.jsxs("button",{type:"button",onClick:()=>p(n),disabled:x,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(P,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:n.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[n.private?t.jsx(te,{size:10}):t.jsx(ce,{size:10}),n.private?"Private":"Public"]})]},n.fullName),e[24]=x,e[25]=p,e[26]=d):d=e[26],u=r.map(d),e[20]=x,e[21]=p,e[22]=r,e[23]=u}else u=e[23];let y;return e[27]!==u?(y=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:u}),e[27]=u,e[28]=y):y=e[28],y}function we(N){return{name:N.name,fullName:N.full_name,owner:N.full_name.split("/")[0]??"",url:N.html_url,private:N.private,description:N.description,updatedAt:N.updated_at}}function D(N){const e=R.c(33),{status:i,error:f,retry:v}=N;if(i==="error"){let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(P,{className:"size-5 text-destructive"})}),e[0]=S):S=e[0];let k;e[1]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=k):k=e[1];const w=f??"Something went wrong while connecting to GitHub.";let I;e[2]!==w?(I=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[k,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:w})]}),e[2]=w,e[3]=I):I=e[3];let m;e[4]!==v?(m=t.jsx("button",{type:"button",onClick:v,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=v,e[5]=m):m=e[5];let _;return e[6]!==I||e[7]!==m?(_=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[S,I,m]}),e[6]=I,e[7]=m,e[8]=_):_=e[8],_}const g=i==="authenticating";let s;e[9]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(P,{className:"size-5 text-foreground"})}),e[9]=s):s=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs("div",{className:"relative size-10",children:[s,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(z,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=p):p=e[10];const x=g?"Authenticating with GitHub":"Setting up GitHub";let h;e[11]!==x?(h=t.jsx("p",{className:"text-sm font-medium",children:x}),e[11]=x,e[12]=h):h=e[12];const C=g?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let b;e[13]!==C?(b=t.jsx("p",{className:"text-xs text-muted-foreground",children:C}),e[13]=C,e[14]=b):b=e[14];let l;e[15]!==h||e[16]!==b?(l=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[h,b]}),e[15]=h,e[16]=b,e[17]=l):l=e[17];const o=g?"bg-muted-foreground/30":"bg-foreground animate-pulse";let a;e[18]!==o?(a=F("size-1.5 rounded-full",o),e[18]=o,e[19]=a):a=e[19];let c;e[20]!==a?(c=t.jsx("span",{className:a}),e[20]=a,e[21]=c):c=e[21];const r=g?"bg-foreground animate-pulse":"bg-muted-foreground/30";let u;e[22]!==r?(u=F("size-1.5 rounded-full",r),e[22]=r,e[23]=u):u=e[23];let y;e[24]!==u?(y=t.jsx("span",{className:u}),e[24]=u,e[25]=y):y=e[25];let d;e[26]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=d):d=e[26];let n;e[27]!==c||e[28]!==y?(n=t.jsxs("div",{className:"flex items-center gap-1.5",children:[c,y,d]}),e[27]=c,e[28]=y,e[29]=n):n=e[29];let j;return e[30]!==n||e[31]!==l?(j=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[p,l,n]}),e[30]=n,e[31]=l,e[32]=j):j=e[32],j}export{Ue as G,pe as u};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BCg0EIRK.js","assets/index-DMziGwwO.js","assets/index-C-1vh7Fd.css","assets/ArrowUp-CRGMcwjN.js","assets/chat-context-C2HnQcJb.js","assets/autosend-BR42-er8.js","assets/hooks-CfbEEqda.js","assets/use-mcp-client-BjL1G4QR.js","assets/constants-BHDe7bIw.js","assets/auth-CL1EKZwd.js","assets/decopilot-sse-pool-Ch1Qumbm.js","assets/backoff-CrEUbyZT.js","assets/delay-CnY5UFtP.js","assets/studio-tools-D58JPByV.js","assets/use-virtual-mcp-BUq9lEJe.js","assets/use-collections-DUypxirp.js","assets/use-ai-providers-5Uex2oSr.js","assets/location-BpLtHjTZ.js","assets/tab-id-BijBBRwE.js","assets/use-decopilot-events-B1D2InIQ.js","assets/use-organization-settings-diMs3Q13.js","assets/automation-runs-CHGY7bEN.js","assets/select-DY2h8ddP.js","assets/tooltip-BqKyJXAE.js","assets/ChevronUp-BVwUhVX7.js","assets/ChevronDown--710wNet.js","assets/useInfiniteQuery-BxBR_av7.js","assets/use-infinite-scroll-JNWuT_ZF.js","assets/use-connection-ZAfjrw2n.js","assets/card-UiTrwBHx.js","assets/sidebar-Dn9hhb22.js","assets/LayoutLeft-D8A_vRpx.js","assets/use-mobile-BLQxo0Qz.js","assets/X-BsyIQyXA.js","assets/table-yhILZeXr.js","assets/empty-state-BAAsV00B.js","assets/use-members-Cf24-Ckt.js","assets/use-org-auth-client-DN10IV5X.js","assets/use-clock-tick-CSY_8HaC.js","assets/AlertCircle-Bx5VPnCL.js","assets/CheckCircle-DvTvBvKr.js","assets/DotsVertical-BHuPkmo3.js","assets/agent-icon-CQWu7X4M.js","assets/Tool01-bTVguty-.js","assets/Settings02-BND3ad-_.js","assets/Tool02-9uhchTyk.js","assets/XCircle-CkxSUHFg.js","assets/ArrowUpRight-XjbUsL6J.js","assets/TrendUp01-C-A7bTAN.js","assets/ZapSquare-Ccv-CNqp.js","assets/ZoomOut-DIgycBu9.js","assets/Users03-2_7vN278.js","assets/ChevronRight-CyX_OwBu.js","assets/Stars02-Bf5s6jtI.js","assets/Copy01-BlUuudlp.js","assets/Globe01-CxXiD__5.js","assets/Eye-HqCyXTaB.js","assets/FilterLines-CfibCuLd.js","assets/Star01-B13g--Yk.js","assets/Globe04-CiK6pryU.js","assets/SwitchHorizontal01-COeWFMnn.js","assets/HardDrive-DljyyjQe.js","assets/Image01-CCmFaLM6.js","assets/Key01-CV8c3aey.js","assets/LinkExternal01-Blg4CFhG.js","assets/Monitor01-G0XI4AyE.js","assets/Sun-D4wn6C4e.js","assets/Package-BpnbT20S.js","assets/Palette-CucSl-Tp.js","assets/Play-J4lAOl0L.js","assets/Plus-Be2ZDEMF.js","assets/SearchLg-hF3HTPE5.js","assets/SearchMd-BvJfdUAe.js","assets/Shield01-CesuQ_f6.js","assets/Stars01-DMCvEOuj.js","assets/Trash01-Dv6dfSGH.js","assets/Upload01-BpEWpOj6.js","assets/User01-DWXBU7_-.js","assets/Users01-DAw96n2a.js","assets/XClose-CUMcIZJo.js","assets/Zap-NvsmBFeg.js","assets/use-automations-DVQ8vBHR.js","assets/useSuspenseInfiniteQuery-Cdibyh2E.js","assets/avatar-D4ZURmpF.js","assets/format-time-BnbuEtat.js","assets/differenceInSeconds-NQ4PDo0z.js","assets/use-copy-D3Kq5ZXg.js","assets/file-type-icon-Cb5F2Kv5.js","assets/dialog-qW-RW6Eb.js","assets/monaco-editor-BlxKl3DU.js","assets/index-b8bN8MBO.js","assets/index-B5wBAEvg.js","assets/calendar-BcT06D8w.js","assets/shell-layout-BUDxl1va.js","assets/required-auth-layout-CAuTE_Ha.js","assets/use-org-sso-Bsdle9Ju.js","assets/integration-icon-BQSFPqY7.js","assets/use-navigate-to-agent-DX9RGu8W.js","assets/reusable-new-chat-CouMjkYR.js","assets/AreaChart-DKXgsttk.js","assets/form-CxHAlAHx.js","assets/label-Dw5usZ3s.js","assets/input-B9mAD-FD.js","assets/drawer-Ci9lekJ-.js","assets/collection-search-oVrfvvPK.js","assets/tabs-CMvxJGz-.js","assets/toggle-group-DycM7-N_.js","assets/use-deco-credits-zzllCk_4.js","assets/extract-connection-data-C0qDfuTX.js","assets/connection-card-DjnLwIM-.js","assets/use-registry-connections-BEaKKIqL.js","assets/retry-CErkP7V6.js","assets/connection-slug-eyAPH6o3.js","assets/textarea-DkhX0GHx.js","assets/connection-form-helpers-CkmqwL7L.js","assets/authenticate-and-persist-oauth-DsuAbKam.js","assets/mcp-oauth-BBC8qIQI.js","assets/collection-tabs-BzGvAa7-.js","assets/badge-BaCv5hEo.js","assets/connect-desktop-dialog-B1psOfPz.js","assets/select-model-DXVz8VSi.js","assets/checkbox-DypyLGWd.js","assets/skeleton-CypjCzyH.js","assets/ai-providers-logos-DD3qZ33J.js","assets/settings-section-ATW3P6O6.js","assets/command-QdNoVtsu.js","assets/index-CLAxS6F3.js","assets/popover-CrO_Pfyc.js","assets/dropdown-menu-M4Iyqsr4.js","assets/index-w3F47_RR.js","assets/alert-dialog-B6UQptWc.js","assets/toolbar-BkEAwLUI.js","assets/use-debounced-value-bL-Oya1Z.js","assets/question-004-sINsf4GQ.js","assets/use-status-sounds-CdM89JI2.js","assets/use-mcp-tools-uJVRRujf.js","assets/use-capability-DEr7wDGX.js","assets/toolbar-icon-button-C1nzkZ0O.js","assets/use-debounced-autosave-JY3wOk_Q.js","assets/index-DakOweBw.js","assets/search-input-BAsli81d.js","assets/use-mcp-auth-status-CYu-P7ZL.js","assets/switch-BYYj1eu3.js","assets/use-registry-app-BkvGxg0L.js","assets/github-repo-picker-Dtn_JVi-.js","assets/provision-repo-scoped-github-connection-2iDn-wQ1.js","assets/github-repo-scope-DjMZbiKa.js","assets/use-secrets-DuRhDEB-.js","assets/formatDistanceToNow-Cb2QZZJn.js","assets/companions-core-I50RkMs1.js","assets/use-file-configs-COjddq6T.js","assets/automation-list-row-9QEecu1P.js","assets/index-DDGTF8rc.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{D as Fs,r as I,v as Ms,K as Ot,c as K,C as yt,a as qs,n as Wt,t as gt,ac as Bs,l as U,j as s,m as ms,d as It,B as je,b as Ls,u as Us,aX as Ks,i as xs}from"./index-DMziGwwO.js";import{g as Ne}from"./get-initials-D-f_fDFw.js";import{A as ve}from"./avatar-D4ZURmpF.js";import{aq as Zt,Q as Gs,c as Qs,aj as gs,ar as Hs,as as Ys,at as kt,T as ht,au as Vs,d as Xs,ao as Js,n as Ws}from"./agent-icon-CQWu7X4M.js";import{i as Zs}from"./SwitchHorizontal01-COeWFMnn.js";import{s as es}from"./Plus-Be2ZDEMF.js";import{S as en,e as tn,a as sn}from"./constants-BHDe7bIw.js";import{u as nn,G as ln}from"./use-registry-app-BkvGxg0L.js";import{d as ps,e as hs,a as ys,D as an,h as rn,c as on}from"./dialog-qW-RW6Eb.js";import{b as cn,u as un}from"./use-connection-ZAfjrw2n.js";import{g as dn}from"./github-repo-scope-DjMZbiKa.js";import{u as fn}from"./use-mcp-client-BjL1G4QR.js";import{a as mn}from"./authenticate-and-persist-oauth-DsuAbKam.js";import{e as xn}from"./extract-connection-data-C0qDfuTX.js";import{u as bs}from"./use-members-Cf24-Ckt.js";import{u as ts}from"./studio-tools-D58JPByV.js";import{t as gn,T as pn,S as $e}from"./decopilot-sse-pool-Ch1Qumbm.js";import{u as hn}from"./use-decopilot-events-B1D2InIQ.js";import{a as yn}from"./format-time-BnbuEtat.js";import{i as js}from"./AlertCircle-Bx5VPnCL.js";import{i as Ns}from"./CheckCircle-DvTvBvKr.js";import{a as bn}from"./DotsVertical-BHuPkmo3.js";import{s as jn}from"./Eye-HqCyXTaB.js";import{a as Tt,c as Et,d as ft,D as At}from"./dropdown-menu-M4Iyqsr4.js";import{P as Gt,b as Qt,a as Ht}from"./popover-CrO_Pfyc.js";import{b as vs,C as Ss,a as Ae,e as $t,d as Cs,c as ws}from"./command-QdNoVtsu.js";import{P as Yt,a as Nn,D as vn,h as Sn,j as Cn,C as wn,c as _n}from"./calendar-BcT06D8w.js";import{u as Dn}from"./use-copy-D3Kq5ZXg.js";import{i as In}from"./ChevronUp-BVwUhVX7.js";import{i as kn}from"./ChevronRight-CyX_OwBu.js";import{a as Tn}from"./Copy01-BlUuudlp.js";import{n as En}from"./LinkExternal01-Blg4CFhG.js";import{s as Vt}from"./User01-DWXBU7_-.js";import{i as rs}from"./X-BsyIQyXA.js";import{g as An,b as $n,e as zn,f as On,a as Rn,D as Pn}from"./drawer-Ci9lekJ-.js";import{t as ss}from"./ChevronDown--710wNet.js";import{i as _s}from"./FilterLines-CfibCuLd.js";import{s as Fn}from"./TrendUp01-C-A7bTAN.js";import{u as Mn}from"./shell-layout-BUDxl1va.js";import{u as qn}from"./hooks-CfbEEqda.js";import{u as Bn}from"./use-organization-settings-diMs3Q13.js";function Ln(t){return!t||!t.content||t.content.length===0?!0:t.content.every(e=>e.type==="paragraph"?!e.content||e.content.length===0?!0:e.content.every(n=>n.type==="hardBreak"||n.type==="text"&&(!n.text||n.text.trim()==="")):!1)}const Da="__home__";function ns(t,e){return Fs.chatDraft(t,e)}function Un(t){if(!t)return null;let e;try{e=JSON.parse(t)}catch{return null}if(!e||typeof e!="object"||typeof e.updatedAt!="number")return null;const n=e.tiptapDoc;return!n||typeof n!="object"||n.type!=="doc"||!Array.isArray(n.content)?null:n}function Kn(t,e,n,a,l){const o=ns(e,n);if(Ln(a)){t.removeItem(o);return}const i={tiptapDoc:a,updatedAt:Date.now()},r=JSON.stringify(i);try{t.setItem(o,r)}catch(c){if(Gn(c)){const d=new TextEncoder().encode(r).byteLength;l?.onQuotaExceeded?.({docSizeBytes:d});return}throw c}}function Ia(t,e,n){const a=ns(e,n),l=t.getItem(a),o=Un(l);return l!==null&&o===null&&t.removeItem(a),o}function ka(t,e,n){t.removeItem(ns(e,n))}function Gn(t){if(!t||typeof t!="object")return!1;const e=t.name;return e==="QuotaExceededError"||e==="NS_ERROR_DOM_QUOTA_REACHED"}function Qn(t){var e;const{char:n,allowSpaces:a,allowToIncludeChar:l,allowedPrefixes:o,startOfLine:i,$position:r}=t,c=a&&!l,d=Cn(n),x=new RegExp(`\\s${d}$`),f=i?"^":"",u=l?"":d,m=c?new RegExp(`${f}${d}.*?(?=\\s${u}|$)`,"gm"):new RegExp(`${f}(?:^)?${d}[^\\s${u}]*`,"gm"),j=((e=r.nodeBefore)==null?void 0:e.isText)&&r.nodeBefore.text;if(!j)return null;const p=r.pos-j.length,h=Array.from(j.matchAll(m)).pop();if(!h||h.input===void 0||h.index===void 0)return null;const g=h.input.slice(Math.max(0,h.index-1),h.index),b=new RegExp(`^[${o?.join("")}\0]?$`).test(g);if(o!==null&&!b)return null;const y=p+h.index;let v=y+h[0].length;return c&&x.test(j.slice(v-1,v+1))&&(h[0]+=" ",v+=1),y<r.pos&&v>=r.pos?{range:{from:y,to:v},query:h[0].slice(n.length),text:h[0]}:null}var Hn=new Yt("suggestion");function Yn({pluginKey:t=Hn,editor:e,char:n="@",allowSpaces:a=!1,allowToIncludeChar:l=!1,allowedPrefixes:o=[" "],startOfLine:i=!1,decorationTag:r="span",decorationClass:c="suggestion",decorationContent:d="",decorationEmptyClass:x="is-empty",command:f=()=>null,items:u=()=>[],render:m=()=>({}),allow:j=()=>!0,findSuggestionMatch:p=Qn,shouldShow:h}){let g;const b=m?.(),y=()=>{const N=e.state.selection.$anchor.pos,_=e.view.coordsAtPos(N),{top:D,right:O,bottom:w,left:E}=_;try{return new DOMRect(E,D,O-E,w-D)}catch{return null}},v=(N,_)=>_?()=>{const D=t.getState(e.state),O=D?.decorationId,w=N.dom.querySelector(`[data-decoration-id="${O}"]`);return w?.getBoundingClientRect()||null}:y;function C(N,_){var D;try{const w=t.getState(N.state),E=w?.decorationId?N.dom.querySelector(`[data-decoration-id="${w.decorationId}"]`):null,q={editor:e,range:w?.range||{from:0,to:0},query:w?.query||null,text:w?.text||null,items:[],command:M=>f({editor:e,range:w?.range||{from:0,to:0},props:M}),decorationNode:E,clientRect:v(N,E)};(D=b?.onExit)==null||D.call(b,q)}catch{}const O=N.state.tr.setMeta(_,{exit:!0});N.dispatch(O)}const T=new Nn({key:t,view(){return{update:async(N,_)=>{var D,O,w,E,q,M,L;const S=(D=this.key)==null?void 0:D.getState(_),A=(O=this.key)==null?void 0:O.getState(N.state),$=S.active&&A.active&&S.range.from!==A.range.from,Q=!S.active&&A.active,R=S.active&&!A.active,z=!Q&&!R&&S.query!==A.query,P=Q||$&&z,F=z||$,V=R||$&&z;if(!P&&!F&&!V)return;const H=V&&!P?S:A,Y=N.dom.querySelector(`[data-decoration-id="${H.decorationId}"]`);g={editor:e,range:H.range,query:H.query,text:H.text,items:[],command:ne=>f({editor:e,range:H.range,props:ne}),decorationNode:Y,clientRect:v(N,Y)},P&&((w=b?.onBeforeStart)==null||w.call(b,g)),F&&((E=b?.onBeforeUpdate)==null||E.call(b,g)),(F||P)&&(g.items=await u({editor:e,query:H.query})),V&&((q=b?.onExit)==null||q.call(b,g)),F&&((M=b?.onUpdate)==null||M.call(b,g)),P&&((L=b?.onStart)==null||L.call(b,g))},destroy:()=>{var N;g&&((N=b?.onExit)==null||N.call(b,g))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(N,_,D,O){const{isEditable:w}=e,{composing:E}=e.view,{selection:q}=N,{empty:M,from:L}=q,S={..._},A=N.getMeta(t);if(A&&A.exit)return S.active=!1,S.decorationId=null,S.range={from:0,to:0},S.query=null,S.text=null,S;if(S.composing=E,w&&(M||e.view.composing)){(L<_.range.from||L>_.range.to)&&!E&&!_.composing&&(S.active=!1);const $=p({char:n,allowSpaces:a,allowToIncludeChar:l,allowedPrefixes:o,startOfLine:i,$position:q.$from}),Q=`id_${Math.floor(Math.random()*4294967295)}`;$&&j({editor:e,state:O,range:$.range,isActive:_.active})&&(!h||h({editor:e,range:$.range,query:$.query,text:$.text,transaction:N}))?(S.active=!0,S.decorationId=_.decorationId?_.decorationId:Q,S.range=$.range,S.query=$.query,S.text=$.text):S.active=!1}else S.active=!1;return S.active||(S.decorationId=null,S.range={from:0,to:0},S.query=null,S.text=null),S}},props:{handleKeyDown(N,_){var D,O,w,E;const{active:q,range:M}=T.getState(N.state);if(!q)return!1;if(_.key==="Escape"||_.key==="Esc"){const S=T.getState(N.state),A=(D=g?.decorationNode)!=null?D:null,$=A??(S?.decorationId?N.dom.querySelector(`[data-decoration-id="${S.decorationId}"]`):null);if(((O=b?.onKeyDown)==null?void 0:O.call(b,{view:N,event:_,range:S.range}))||!1)return!0;const R={editor:e,range:S.range,query:S.query,text:S.text,items:[],command:z=>f({editor:e,range:S.range,props:z}),decorationNode:$,clientRect:$?()=>$.getBoundingClientRect()||null:null};return(w=b?.onExit)==null||w.call(b,R),C(N,t),!0}return((E=b?.onKeyDown)==null?void 0:E.call(b,{view:N,event:_,range:M}))||!1},decorations(N){const{active:_,range:D,decorationId:O,query:w}=T.getState(N);if(!_)return null;const E=!w?.length,q=[c];return E&&q.push(x),vn.create(N.doc,[Sn.inline(D.from,D.to,{nodeName:r,class:q.join(" "),"data-decoration-id":O,"data-decoration-content":d})])}}});return T}function Vn(t){const e=K.c(24),{editor:n,query:a,items:l,onSelect:o,onClose:i}=t,[r,c]=I.useState(0),d=I.useRef(l),x=I.useRef(r),f=I.useRef(o),u=I.useRef(i),m=I.useDeferredValue(a);let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{c(0)},e[0]=j):j=e[0];let p;e[1]!==m?(p=[m],e[1]=m,e[2]=p):p=e[2],I.useEffect(j,p);let h,g;e[3]!==l.length||e[4]!==r?(h=()=>{r>=l.length&&l.length>0&&c(0)},g=[l.length,r],e[3]=l.length,e[4]=r,e[5]=h,e[6]=g):(h=e[5],g=e[6]),I.useEffect(h,g);let b,y;e[7]!==l?(b=()=>{d.current=l},y=[l],e[7]=l,e[8]=b,e[9]=y):(b=e[8],y=e[9]),I.useEffect(b,y);let v,C;e[10]!==r?(v=()=>{x.current=r},C=[r],e[10]=r,e[11]=v,e[12]=C):(v=e[11],C=e[12]),I.useEffect(v,C);let T,N;e[13]!==o?(N=()=>{f.current=o},T=[o],e[13]=o,e[14]=T,e[15]=N):(T=e[14],N=e[15]),I.useEffect(N,T);let _,D;e[16]!==i?(_=()=>{u.current=i},D=[i],e[16]=i,e[17]=_,e[18]=D):(_=e[17],D=e[18]),I.useEffect(_,D);let O,w;e[19]!==n?(O=()=>{if(n?.isDestroyed)return;let M;try{M=n.view.dom}catch{return}if(!M)return;const L=A=>{const $=d.current;if(!$.length)return!1;const Q=()=>c(z=>(z+1)%$.length),R=()=>c(z=>(z-1+$.length)%$.length);switch(A.key){case"ArrowUp":return A.preventDefault(),R(),!0;case"ArrowDown":return A.preventDefault(),Q(),!0;case"Tab":return A.preventDefault(),A.shiftKey?R():Q(),!0;case"Home":return A.preventDefault(),c(0),!0;case"End":return A.preventDefault(),c($.length-1),!0;case"Enter":{if(A.isComposing)return!1;A.preventDefault();const z=x.current;return z!==-1&&$[z]&&f.current?.($[z],z),!0}case"Escape":return A.preventDefault(),u.current?.(),!0;default:return!1}},S=A=>{L(A)};return M.addEventListener("keydown",S,!0),()=>{M?.removeEventListener("keydown",S,!0)}},w=[n],e[19]=n,e[20]=O,e[21]=w):(O=e[20],w=e[21]),I.useEffect(O,w);const E=l.length?r:void 0;let q;return e[22]!==E?(q={selectedIndex:E,setSelectedIndex:c},e[22]=E,e[23]=q):q=e[23],q}function Xn(t,e){switch(e.type){case"SET_SELECTED_ITEM":return{...t,selectedItem:e.payload};case"ON_START":return{...t,open:!0,selectedItem:null,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_UPDATE":return{...t,element:e.payload.element,query:e.payload.query,range:e.payload.range};case"ON_EXIT":return{open:!1,element:null,query:"",range:null,selectedItem:null};default:return t}}const Jn=I.createContext(void 0);function Wn(){const t=I.useContext(Jn);if(!t)throw new Error("useSuggestionContext must be used within a SuggestionContext.Provider");return t}function Ta({editor:t,char:e,pluginKey:n,allow:a,onOpenChange:l}){const[o,i]=I.useReducer(Xn,{open:!1,element:null,query:"",range:null,selectedItem:null}),r=I.useRef(l);return r.current=l,I.useEffect(()=>{if(t?.isDestroyed)return;const c=n instanceof Yt?n:new Yt(n);t.state.plugins.find(f=>f.spec.key===c)&&t.unregisterPlugin(c);const x=Yn({pluginKey:c,editor:t,char:e,allow(f){const u=t.state.doc.resolve(f.range.from);for(let m=u.depth;m>0;m--)if(u.node(m).type.name==="image")return!1;return!(a&&!a(f))},command(){},render:()=>({onStart:f=>{i({type:"ON_START",payload:{element:f.decorationNode??null,query:f.query,range:f.range}}),r.current?.(!0)},onUpdate:f=>{i({type:"ON_UPDATE",payload:{element:f.decorationNode??null,query:f.query,range:f.range}})},onKeyDown:f=>f.event.key==="Escape"?(i({type:"ON_EXIT"}),!0):!1,onExit:()=>{i({type:"ON_EXIT"}),r.current?.(!1)}}),items:()=>[]});return t.registerPlugin(x),()=>{t?.isDestroyed||t.unregisterPlugin(c)}},[t,n,e,i,a]),{state:o,dispatch:i}}function Ea({editor:t,queryKey:e,queryFn:n,onSelect:a}){const{state:l,dispatch:o}=Wn(),i=I.useDeferredValue(l.query),{data:r}=Ms({queryKey:Ot.suggestionItems(e,l.open,i),queryFn:()=>l.open?n({query:i}):[]}),c=()=>{o({type:"ON_EXIT"})},d=async(f,u)=>{if(!(l.selectedItem!==null||!l.range)){o({type:"SET_SELECTED_ITEM",payload:f});try{const{view:m}=t,p=m.state.selection.$to.nodeAfter?.text?.startsWith(" "),h=l.range?{...l.range}:{from:0,to:0};p&&l.range&&(h.to+=1),await a({range:h,item:f})===!1?o({type:"SET_SELECTED_ITEM",payload:null}):c()}catch{c()}}},{selectedIndex:x}=Vn({editor:t,query:i,items:r,onSelect:d,onClose:c});return{selectedItem:l.selectedItem,items:r,selectedIndex:x,close:c,onSelect:d}}function Zn(t){const{org:e}=yt(),{data:n}=qs.useSession(),a=cn(),l=Wt(),o=fn({connectionId:en,orgId:e.id,orgSlug:e.slug}),[i,r]=I.useState(!1),c=nn(t,{enabled:!1});return{connect:async()=>{if(!(i||!n?.user?.id||!e)){r(!0);try{const x=c.data??(await c.refetch()).data;if(!x){gt.error("Could not find this integration in the registry");return}const f=xn(x,e.id,n.user.id,{remoteIndex:0});if(!f.connection_url){gt.error("This integration has no connection method available");return}const u=f.app_name?await el(o,f.app_name):null,m=!u,j=u?.id??(await a.create.mutateAsync(f)).id,p=await mn({connectionId:j,orgId:e.id,orgSlug:e.slug,persistFallback:h=>a.update.mutateAsync({id:j,data:{connection_token:h}}).then(()=>{})});if(p.ran&&!p.ok){if(m)try{await a.delete.mutateAsync(j)}catch{}gt.error(`Authentication failed: ${p.error??"no token"}`);return}Bs(l,e.id),gt.success(m?"Connected successfully":"Already connected")}catch(x){gt.error(`Failed to connect: ${x instanceof Error?x.message:String(x)}`)}finally{r(!1)}}},isConnecting:i}}async function el(t,e){return(await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{field:["app_name"],operator:"eq",value:e},limit:1}})).structuredContent?.items?.[0]??null}function ke(t){const e=K.c(8),{size:n,className:a}=t,l=n===void 0?16:n;let o;e[0]!==l?(o={width:l,height:l},e[0]=l,e[1]=o):o=e[1];let i;e[2]!==a?(i=U("shrink-0 rounded-full object-cover",a),e[2]=a,e[3]=i):i=e[3];let r;return e[4]!==l||e[5]!==o||e[6]!==i?(r=s.jsx("img",{src:tn,alt:"Super Agent",width:l,height:l,style:o,className:i}),e[4]=l,e[5]=o,e[6]=i,e[7]=r):r=e[7],r}const os=()=>0;function tl(t){const{orgSlug:e,enabled:n=!0,onUpdate:a,onDelete:l}=t,o=I.useRef(a);o.current=a;const i=I.useRef(l);i.current=l;const r=I.useRef(null),c=I.useRef(n),d=I.useRef(e);(!r.current||c.current!==n||d.current!==e)&&(c.current=n,d.current=e,r.current=f=>{if(!n||!e)return()=>{};const u=m=>{let j;try{j=JSON.parse(m.data)}catch{return}j.data&&(m.type===pn?i.current?.(j.data.id):o.current(j.data)),f()};return gn.subscribe(e,u)}),I.useSyncExternalStore(r.current,os,os)}function sl(){const t=K.c(27),{org:e,locator:n}=yt(),a=ts(),l=Wt();let o;t[0]!==n?(o=Ot.taskBoardItems(n),t[0]=n,t[1]=o):o=t[1];const i=o;let r;t[2]!==a?(r=async()=>(await a.call("TASK_BOARD_ITEM_LIST",{})).items,t[2]=a,t[3]=r):r=t[3];let c;t[4]!==i||t[5]!==r?(c={queryKey:i,queryFn:r},t[4]=i,t[5]=r,t[6]=c):c=t[6];const d=ms(c);let x,f;t[7]!==l||t[8]!==i?(x=g=>{l.setQueryData(i,b=>{const y=b??[],v=g;return y.some(C=>C.id===v.id)?y.map(C=>C.id===v.id?v:C):[v,...y]})},f=g=>{l.setQueryData(i,b=>b?.filter(y=>y.id!==g))},t[7]=l,t[8]=i,t[9]=x,t[10]=f):(x=t[9],f=t[10]);let u;t[11]!==e.slug||t[12]!==x||t[13]!==f?(u={orgSlug:e.slug,onUpdate:x,onDelete:f},t[11]=e.slug,t[12]=x,t[13]=f,t[14]=u):u=t[14],tl(u);let m;t[15]!==l||t[16]!==i?(m=g=>{const b=g.subject,y=g.data.status;l.setQueryData(i,v=>v?.map(C=>C.threads.some(T=>T.threadId===b)?{...C,threads:C.threads.map(T=>T.threadId===b?{...T,status:y}:T)}:C))},t[15]=l,t[16]=i,t[17]=m):m=t[17];let j;t[18]!==e.slug||t[19]!==m?(j={orgSlug:e.slug,onTaskStatus:m},t[18]=e.slug,t[19]=m,t[20]=j):j=t[20],hn(j);let p;t[21]!==d.data?(p=d.data??[],t[21]=d.data,t[22]=p):p=t[22];let h;return t[23]!==d.error||t[24]!==d.isLoading||t[25]!==p?(h={items:p,isLoading:d.isLoading,error:d.error},t[23]=d.error,t[24]=d.isLoading,t[25]=p,t[26]=h):h=t[26],h}function nl(){const t=K.c(36),{locator:e}=yt(),n=ts(),a=Wt();let l;t[0]!==e?(l=Ot.taskBoardItems(e),t[0]=e,t[1]=l):l=t[1];const o=l;let i;t[2]!==a||t[3]!==o?(i=()=>a.invalidateQueries({queryKey:o}),t[2]=a,t[3]=o,t[4]=i):i=t[4];const r=i;let c;t[5]!==n?(c=N=>n.call("TASK_BOARD_ITEM_CREATE",N),t[5]=n,t[6]=c):c=t[6];let d;t[7]!==r||t[8]!==c?(d={mutationFn:c,onSuccess:r},t[7]=r,t[8]=c,t[9]=d):d=t[9];const x=It(d);let f;t[10]!==n?(f=N=>n.call("TASK_BOARD_ITEM_UPDATE",N),t[10]=n,t[11]=f):f=t[11];let u,m;t[12]!==a||t[13]!==o?(u=async N=>{await a.cancelQueries({queryKey:o});const _=a.getQueryData(o);return a.setQueryData(o,D=>D?.map(O=>O.id===N.id?{...O,...N}:O)),{previous:_}},m=(N,_,D)=>{D?.previous&&a.setQueryData(o,D.previous)},t[12]=a,t[13]=o,t[14]=u,t[15]=m):(u=t[14],m=t[15]);let j;t[16]!==r||t[17]!==f||t[18]!==u||t[19]!==m?(j={mutationFn:f,onMutate:u,onError:m,onSettled:r},t[16]=r,t[17]=f,t[18]=u,t[19]=m,t[20]=j):j=t[20];const p=It(j);let h;t[21]!==n?(h=N=>n.call("TASK_BOARD_ITEM_DELETE",{id:N}),t[21]=n,t[22]=h):h=t[22];let g;t[23]!==r||t[24]!==h?(g={mutationFn:h,onSuccess:r},t[23]=r,t[24]=h,t[25]=g):g=t[25];const b=It(g);let y;t[26]!==n?(y=N=>n.call("TASK_BOARD_ITEM_UPDATE",N),t[26]=n,t[27]=y):y=t[27];let v;t[28]!==r||t[29]!==y?(v={mutationFn:y,onSuccess:r},t[28]=r,t[29]=y,t[30]=v):v=t[30];const C=It(v);let T;return t[31]!==x||t[32]!==C||t[33]!==b||t[34]!==p?(T={create:x,update:p,remove:b,link:C},t[31]=x,t[32]=C,t[33]=b,t[34]=p,t[35]=T):T=t[35],T}function Xt(t){return t.threads.some(e=>e.status==="requires_action")}function ll(t){return t.threads[0]}const Ds=["triage","todo","in_progress","in_review","done"],be={triage:{label:"Backlog",icon:js,iconClassName:"text-muted-foreground"},todo:{label:"To Do",icon:bn,iconClassName:"text-muted-foreground"},in_progress:{label:"In Progress",icon:Zt,iconClassName:"text-primary"},in_review:{label:"In Review",icon:jn,iconClassName:"text-warning"},done:{label:"Done",icon:Ns,iconClassName:"text-success"}},Is=["none","low","medium","high","urgent"],Se={none:{label:"No priority",flagClassName:"text-muted-foreground",dotClassName:"border border-muted-foreground/50"},low:{label:"Low",flagClassName:"text-muted-foreground",dotClassName:"bg-muted-foreground/40"},medium:{label:"Medium",flagClassName:"text-blue-500",dotClassName:"bg-blue-500"},high:{label:"High",flagClassName:"text-warning",dotClassName:"bg-warning"},urgent:{label:"Urgent",flagClassName:"text-destructive",dotClassName:"bg-destructive"}};function al(t){const e=K.c(10),{locator:n}=yt(),a=ts();let l;e[0]!==t||e[1]!==n?(l=Ot.taskBoardItemPrs(n,t??""),e[0]=t,e[1]=n,e[2]=l):l=e[2];const o=!!t;let i;e[3]!==t||e[4]!==a?(i=async()=>(await a.call("TASK_BOARD_ITEM_PRS_GET",{taskBoardItemId:t})).prs,e[3]=t,e[4]=a,e[5]=i):i=e[5];let r;return e[6]!==l||e[7]!==o||e[8]!==i?(r={queryKey:l,enabled:o,queryFn:i},e[6]=l,e[7]=o,e[8]=i,e[9]=r):r=e[9],ms(r)}function rl(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59).toISOString()}function is(t){if(!t)return null;const e=new Date(t);return Number.isNaN(e.getTime())?null:e}const ol=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}),pt="inline-flex h-9 items-center gap-2 rounded-lg border border-border px-3 text-sm font-medium text-foreground transition-colors hover:bg-muted sm:border-transparent",il={failed:{label:"Error",className:"text-destructive",icon:Hs},requires_action:{label:"Needs input",className:"text-warning",icon:gs},in_progress:{label:"Running",className:"text-primary",icon:Zt,spin:!0},completed:{label:"Completed",className:"text-success",icon:Ns},expired:{label:"Expired",className:"text-muted-foreground",icon:js}};function cl(t){const e=K.c(188),{open:n,onClose:a,item:l,defaultStatus:o,onSubmit:i,onDelete:r,onOpenThread:c,onNewChat:d,isSaving:x}=t,{data:f}=bs(),u=f?.data?.members??[],{handleCopy:m,copied:j}=Dn(),[p,h]=I.useState(l?.title??""),[g,b]=I.useState(l?.description??""),[y,v]=I.useState(l?.status??o??"triage"),[C,T]=I.useState(l?.priority??"medium"),[N,_]=I.useState(l?.assigneeId??null),D=l?.dueDate;let O;e[0]!==D?(O=is(D),e[0]=D,e[1]=O):O=e[1];const[w,E]=I.useState(O),[q,M]=I.useState(!1),[L,S]=I.useState(!1);let A;e[2]!==o||e[3]!==l?.assigneeId||e[4]!==l?.description||e[5]!==l?.dueDate||e[6]!==l?.priority||e[7]!==l?.status||e[8]!==l?.title||e[9]!==_||e[10]!==E?(A=()=>{h(l?.title??""),b(l?.description??""),v(l?.status??o??"triage"),T(l?.priority??"medium"),_(l?.assigneeId??null),E(is(l?.dueDate))},e[2]=o,e[3]=l?.assigneeId,e[4]=l?.description,e[5]=l?.dueDate,e[6]=l?.priority,e[7]=l?.status,e[8]=l?.title,e[9]=_,e[10]=E,e[11]=A):A=e[11];const $=A;let Q;e[12]!==a||e[13]!==$?(Q=()=>{a(),$()},e[12]=a,e[13]=$,e[14]=Q):Q=e[14];const R=Q;let z;e[15]!==N||e[16]!==g||e[17]!==w||e[18]!==i||e[19]!==C||e[20]!==y||e[21]!==p?(z=()=>{const k=p.trim();k&&i({title:k,description:g.trim()||null,status:y,priority:C,assigneeId:N,dueDate:w?rl(w):null})},e[15]=N,e[16]=g,e[17]=w,e[18]=i,e[19]=C,e[20]=y,e[21]=p,e[22]=z):z=e[22];const P=z,F=N===$e;let V;e[23]!==N?(V=k=>k.userId===N,e[23]=N,e[24]=V):V=e[24];const H=u.find(V),Y=l?.assignedBy?u.find(k=>k.userId===l.assignedBy):void 0,ne=be[y].icon,le=hs;let me;e[25]!==R?(me=k=>!k&&R(),e[25]=R,e[26]=me):me=e[26];const Te=ps,mt="flex max-h-[90vh] flex-col gap-0 overflow-hidden rounded-2xl p-0 sm:h-[85vh] sm:max-h-[640px] sm:max-w-[850px]",xt="hidden",xe=l?"Edit task":"New task";let W;e[27]!==xe?(W=s.jsx(ys,{className:"sr-only",children:xe}),e[27]=xe,e[28]=W):W=e[28];let ae;e[29]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsx(rs,{size:16}),e[29]=ae):ae=e[29];let Z;e[30]!==R?(Z=s.jsx("button",{type:"button","aria-label":"Close",onClick:R,className:"absolute right-2.5 top-2.5 z-10 flex size-10 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:ae}),e[30]=R,e[31]=Z):Z=e[31];const Ce="flex min-h-0 flex-1 flex-col overflow-y-auto sm:flex-row sm:overflow-hidden";let re;e[32]===Symbol.for("react.memo_cache_sentinel")?(re=k=>{h(k.target.value),k.target.style.height="auto",k.target.style.height=`${k.target.scrollHeight}px`},e[32]=re):re=e[32];let oe;e[33]!==p?(oe=s.jsx("textarea",{ref:dl,value:p,onChange:re,onKeyDown:ul,placeholder:"Task title...",autoFocus:!0,rows:1,className:"w-full resize-none overflow-hidden border-0 bg-transparent text-xl font-medium leading-snug text-foreground outline-none placeholder:text-foreground/30"}),e[33]=p,e[34]=oe):oe=e[34];let G;e[35]===Symbol.for("react.memo_cache_sentinel")?(G=k=>b(k.target.value),e[35]=G):G=e[35];let X;e[36]!==g?(X=s.jsx("textarea",{value:g,onChange:G,placeholder:"Describe a task for an agent...",className:"min-h-[96px] w-full flex-1 resize-none border-0 bg-transparent text-[15px] leading-relaxed text-foreground outline-none placeholder:text-muted-foreground/50 sm:min-h-[120px]"}),e[36]=g,e[37]=X):X=e[37];let J;e[38]!==j||e[39]!==g||e[40]!==m?(J=g&&s.jsx(je,{type:"button",variant:"ghost",size:"icon","aria-label":"Copy description",className:"absolute right-0 top-0 size-7 text-muted-foreground opacity-0 transition-opacity hover:text-foreground group-hover:opacity-100",onClick:()=>m(g),children:j?s.jsx(In,{size:14}):s.jsx(Tn,{size:14})}),e[38]=j,e[39]=g,e[40]=m,e[41]=J):J=e[41];let ge;e[42]!==X||e[43]!==J?(ge=s.jsxs("div",{className:"group relative flex flex-1 flex-col",children:[X,J]}),e[42]=X,e[43]=J,e[44]=ge):ge=e[44];const we=l&&l.threads.length>0&&s.jsx("div",{className:"flex flex-col gap-2",children:l.threads.map(k=>s.jsx(fl,{thread:k,startedBy:Y??H,onOpen:c},k.threadId))});let _e;e[45]!==l?(_e=l?.id&&s.jsx(gl,{itemId:l.id}),e[45]=l,e[46]=_e):_e=e[46];let ie;e[47]!==oe||e[48]!==ge||e[49]!==we||e[50]!==_e?(ie=s.jsxs("div",{className:"flex min-w-0 flex-col gap-6 p-6 sm:flex-1 sm:overflow-y-auto sm:p-8",children:[oe,ge,we,_e]}),e[47]=oe,e[48]=ge,e[49]=we,e[50]=_e,e[51]=ie):ie=e[51];const as="flex w-full shrink-0 flex-col gap-4 border-t border-border p-6 sm:w-[220px] sm:border-t-0 sm:border-l sm:px-6 sm:py-10";let ye;e[52]===Symbol.for("react.memo_cache_sentinel")?(ye=s.jsx("span",{className:"hidden px-3 text-sm text-muted-foreground sm:block",children:"Properties"}),e[52]=ye):ye=e[52];const ze="flex flex-wrap gap-2 sm:flex-col",De=be[y];let ee;e[53]!==ne||e[54]!==De.iconClassName?(ee=s.jsx(ne,{size:16,className:De.iconClassName}),e[53]=ne,e[54]=De.iconClassName,e[55]=ee):ee=e[55];const Ee=be[y];let ce;e[56]!==ee||e[57]!==Ee.label?(ce=s.jsx(Tt,{asChild:!0,children:s.jsxs("button",{type:"button",className:pt,children:[ee,Ee.label]})}),e[56]=ee,e[57]=Ee.label,e[58]=ce):ce=e[58];let ue;e[59]===Symbol.for("react.memo_cache_sentinel")?(ue=s.jsx(Et,{align:"start",className:"w-44",children:Ds.map(k=>{const he=be[k].icon;return s.jsxs(ft,{onSelect:()=>v(k),className:"gap-2",children:[s.jsx(he,{size:16,className:be[k].iconClassName}),be[k].label]},k)})}),e[59]=ue):ue=e[59];let pe;e[60]!==ce?(pe=s.jsxs(At,{children:[ce,ue]}),e[60]=ce,e[61]=pe):pe=e[61];const Ie=C==="none"&&"text-muted-foreground";let te;e[62]!==Ie?(te=U(pt,Ie),e[62]=Ie,e[63]=te):te=e[63];let se;e[64]!==C?(se=C==="none"?s.jsxs(s.Fragment,{children:[s.jsx(Gs,{size:16}),"Set priority"]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:U("size-2 rounded-full",Se[C].dotClassName)}),Se[C].label]}),e[64]=C,e[65]=se):se=e[65];let de;e[66]!==te||e[67]!==se?(de=s.jsx(Tt,{asChild:!0,children:s.jsx("button",{type:"button",className:te,children:se})}),e[66]=te,e[67]=se,e[68]=de):de=e[68];let fe;e[69]===Symbol.for("react.memo_cache_sentinel")?(fe=s.jsx(Et,{align:"start",className:"w-40",children:Is.map(k=>s.jsxs(ft,{onSelect:()=>T(k),children:[s.jsx("span",{className:U("size-2 rounded-full",Se[k].dotClassName)}),Se[k].label]},k))}),e[69]=fe):fe=e[69];let B;e[70]!==de?(B=s.jsxs(At,{children:[de,fe]}),e[70]=de,e[71]=B):B=e[71];const Pt="flex flex-col",Ft=Qt,Os=!0,Mt=Gt,Rs=!0,Ps="button",qt=!N&&"text-muted-foreground";let Oe;e[72]!==qt?(Oe=U(pt,qt),e[72]=qt,e[73]=Oe):Oe=e[73];const Bt=F&&Y?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"hidden items-center gap-2 sm:flex",children:[s.jsx(ve,{url:Y.user?.image??void 0,fallback:Ne(Y.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate",children:Y.user?.name??"Super Agent"})]}),s.jsxs("span",{className:"flex items-center gap-2 sm:hidden",children:[s.jsxs("span",{className:"inline-flex items-center",children:[s.jsx(ve,{url:Y.user?.image??void 0,fallback:Ne(Y.user?.name),shape:"circle",size:"2xs",className:"-mr-1.5 ring-2 ring-background"}),s.jsx(ke,{size:16,className:"ring-2 ring-background"})]}),"Super Agent"]})]}):F?s.jsxs(s.Fragment,{children:[s.jsx(ke,{size:16}),"Super Agent"]}):H?s.jsxs(s.Fragment,{children:[s.jsx(ve,{url:H.user?.image??void 0,fallback:Ne(H.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate",children:H.user?.name??"Unassigned"})]}):s.jsxs(s.Fragment,{children:[s.jsx(Qs,{size:16,className:"text-muted-foreground"}),"Assign"]});let Re;e[74]!==Oe||e[75]!==Bt?(Re=s.jsx("button",{type:Ps,className:Oe,children:Bt}),e[74]=Oe,e[75]=Bt,e[76]=Re):Re=e[76];let Pe;e[77]!==Mt||e[78]!==Re?(Pe=s.jsx(Mt,{asChild:Rs,children:Re}),e[77]=Mt,e[78]=Re,e[79]=Pe):Pe=e[79];let bt;e[80]===Symbol.for("react.memo_cache_sentinel")?(bt=s.jsx(vs,{placeholder:"Assign to…",className:"h-9"}),e[80]=bt):bt=e[80];let jt;e[81]===Symbol.for("react.memo_cache_sentinel")?(jt=s.jsx(Ss,{children:"No members found."}),e[81]=jt):jt=e[81];let Fe;e[82]!==_||e[83]!==S?(Fe=()=>{_($e),S(!1)},e[82]=_,e[83]=S,e[84]=Fe):Fe=e[84];let Nt,vt;e[85]===Symbol.for("react.memo_cache_sentinel")?(Nt=s.jsx(ke,{size:16}),vt=s.jsx("span",{className:"truncate",children:"Super Agent"}),e[85]=Nt,e[86]=vt):(Nt=e[85],vt=e[86]);let Me;e[87]!==Fe?(Me=s.jsxs(Ae,{value:"Super Agent",onSelect:Fe,className:"gap-2",children:[Nt,vt]}),e[87]=Fe,e[88]=Me):Me=e[88];let qe;e[89]!==_||e[90]!==S?(qe=()=>{_(null),S(!1)},e[89]=_,e[90]=S,e[91]=qe):qe=e[91];let St,Ct;e[92]===Symbol.for("react.memo_cache_sentinel")?(St=s.jsx(Vt,{size:16,className:"text-muted-foreground"}),Ct=s.jsx("span",{className:"truncate",children:"Unassigned"}),e[92]=St,e[93]=Ct):(St=e[92],Ct=e[93]);let Be;e[94]!==qe?(Be=s.jsxs(Ae,{value:"Unassigned",onSelect:qe,className:"gap-2",children:[St,Ct]}),e[94]=qe,e[95]=Be):Be=e[95];let Le;e[96]!==Me||e[97]!==Be?(Le=s.jsxs($t,{children:[Me,Be]}),e[96]=Me,e[97]=Be,e[98]=Le):Le=e[98];let Ue;if(e[99]!==u||e[100]!==_||e[101]!==S){let k;e[103]!==_||e[104]!==S?(k=he=>s.jsxs(Ae,{value:he.user?.name??he.userId,onSelect:()=>{_(he.userId),S(!1)},className:"gap-2",children:[s.jsx(ve,{url:he.user?.image??void 0,fallback:Ne(he.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate",children:he.user?.name??he.userId})]},he.userId),e[103]=_,e[104]=S,e[105]=k):k=e[105],Ue=u.map(k),e[99]=u,e[100]=_,e[101]=S,e[102]=Ue}else Ue=e[102];let Ke;e[106]!==Ue?(Ke=s.jsx($t,{heading:"Members",children:Ue}),e[106]=Ue,e[107]=Ke):Ke=e[107];let Ge;e[108]!==Le||e[109]!==Ke?(Ge=s.jsx(Ht,{align:"start",className:"w-56 p-0",children:s.jsxs(Cs,{children:[bt,s.jsxs(ws,{children:[jt,Le,Ke]})]})}),e[108]=Le,e[109]=Ke,e[110]=Ge):Ge=e[110];let Qe;e[111]!==Ft||e[112]!==L||e[113]!==S||e[114]!==Pe||e[115]!==Ge?(Qe=s.jsxs(Ft,{open:L,onOpenChange:S,modal:Os,children:[Pe,Ge]}),e[111]=Ft,e[112]=L,e[113]=S,e[114]=Pe,e[115]=Ge,e[116]=Qe):Qe=e[116];let He;e[117]!==Y||e[118]!==F?(He=F&&Y&&s.jsxs("div",{className:"relative mt-1.5 hidden items-center pl-5 sm:flex",children:[s.jsx("span",{className:"absolute -top-1.5 left-5 h-[calc(50%+0.375rem)] w-2.5 rounded-bl-md border-b border-l border-border"}),s.jsxs("span",{className:U(pt,"pointer-events-none"),children:[s.jsx(ke,{size:16}),"Super Agent"]})]}),e[117]=Y,e[118]=F,e[119]=He):He=e[119];let Ye;e[120]!==Qe||e[121]!==He?(Ye=s.jsxs("div",{className:Pt,children:[Qe,He]}),e[120]=Qe,e[121]=He,e[122]=Ye):Ye=e[122];const Lt=!w&&"text-muted-foreground";let Ve;e[123]!==Lt?(Ve=U(pt,Lt),e[123]=Lt,e[124]=Ve):Ve=e[124];let wt;e[125]===Symbol.for("react.memo_cache_sentinel")?(wt=s.jsx(ht,{size:16,className:"text-muted-foreground"}),e[125]=wt):wt=e[125];let Xe;e[126]!==w?(Xe=w?ol.format(w):"Due date",e[126]=w,e[127]=Xe):Xe=e[127];let Je;e[128]!==w||e[129]!==E?(Je=w&&s.jsx("span",{role:"button",tabIndex:0,"aria-label":"Clear due date",className:"-mr-1 ml-0.5 flex size-4 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground",onClick:k=>{k.stopPropagation(),E(null)},onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.stopPropagation(),E(null))},children:s.jsx(rs,{size:12})}),e[128]=w,e[129]=E,e[130]=Je):Je=e[130];let We;e[131]!==Ve||e[132]!==Xe||e[133]!==Je?(We=s.jsx(Gt,{asChild:!0,children:s.jsxs("button",{type:"button",className:Ve,children:[wt,Xe,Je]})}),e[131]=Ve,e[132]=Xe,e[133]=Je,e[134]=We):We=e[134];const Ut=w??void 0;let Ze;e[135]!==E||e[136]!==M?(Ze=k=>{E(k??null),k&&M(!1)},e[135]=E,e[136]=M,e[137]=Ze):Ze=e[137];let et;e[138]!==Ut||e[139]!==Ze?(et=s.jsx(Ht,{className:"w-auto p-0",align:"start",children:s.jsx(wn,{mode:"single",selected:Ut,onSelect:Ze,initialFocus:!0})}),e[138]=Ut,e[139]=Ze,e[140]=et):et=e[140];let tt;e[141]!==q||e[142]!==M||e[143]!==We||e[144]!==et?(tt=s.jsxs(Qt,{open:q,onOpenChange:M,children:[We,et]}),e[141]=q,e[142]=M,e[143]=We,e[144]=et,e[145]=tt):tt=e[145];let st;e[146]!==pe||e[147]!==B||e[148]!==Ye||e[149]!==tt?(st=s.jsxs("div",{className:ze,children:[pe,B,Ye,tt]}),e[146]=pe,e[147]=B,e[148]=Ye,e[149]=tt,e[150]=st):st=e[150];let nt;e[151]!==ye||e[152]!==st?(nt=s.jsxs("div",{className:as,children:[ye,st]}),e[151]=ye,e[152]=st,e[153]=nt):nt=e[153];let lt;e[154]!==ie||e[155]!==nt?(lt=s.jsxs("div",{className:Ce,children:[ie,nt]}),e[154]=ie,e[155]=nt,e[156]=lt):lt=e[156];let at;e[157]!==l||e[158]!==r?(at=l&&r?s.jsx(je,{variant:"ghost",size:"icon","aria-label":"Delete task",className:"size-10 text-muted-foreground hover:text-destructive",onClick:r,children:s.jsx(Vs,{size:16})}):s.jsx("span",{}),e[157]=l,e[158]=r,e[159]=at):at=e[159];let rt;e[160]!==l||e[161]!==d?(rt=l&&d&&s.jsxs(je,{variant:"outline",size:"sm",onClick:d,children:[s.jsx(Xs,{size:16}),"New chat"]}),e[160]=l,e[161]=d,e[162]=rt):rt=e[162];let ot;e[163]!==x||e[164]!==p?(ot=!p.trim()||x,e[163]=x,e[164]=p,e[165]=ot):ot=e[165];let _t;e[166]===Symbol.for("react.memo_cache_sentinel")?(_t=s.jsx(es,{size:16}),e[166]=_t):_t=e[166];const Kt=l?"Save":"Create task";let it;e[167]!==P||e[168]!==ot||e[169]!==Kt?(it=s.jsxs(je,{size:"sm",disabled:ot,onClick:P,children:[_t,Kt]}),e[167]=P,e[168]=ot,e[169]=Kt,e[170]=it):it=e[170];let ct;e[171]!==rt||e[172]!==it?(ct=s.jsxs("div",{className:"flex items-center gap-2",children:[rt,it]}),e[171]=rt,e[172]=it,e[173]=ct):ct=e[173];let ut;e[174]!==at||e[175]!==ct?(ut=s.jsxs("div",{className:"flex h-16 items-center justify-between border-t border-border px-4",children:[at,ct]}),e[174]=at,e[175]=ct,e[176]=ut):ut=e[176];let dt;e[177]!==Te||e[178]!==W||e[179]!==Z||e[180]!==lt||e[181]!==ut?(dt=s.jsxs(Te,{className:mt,closeButtonClassName:xt,children:[W,Z,lt,ut]}),e[177]=Te,e[178]=W,e[179]=Z,e[180]=lt,e[181]=ut,e[182]=dt):dt=e[182];let Dt;return e[183]!==le||e[184]!==n||e[185]!==me||e[186]!==dt?(Dt=s.jsx(le,{open:n,onOpenChange:me,children:dt}),e[183]=le,e[184]=n,e[185]=me,e[186]=dt,e[187]=Dt):Dt=e[187],Dt}function ul(t){t.key==="Enter"&&t.preventDefault()}function dl(t){t&&(t.style.height="auto",t.style.height=`${t.scrollHeight}px`)}function fl(t){const e=K.c(16),{thread:n,startedBy:a,onOpen:l}=t,o=n.status?il[n.status]:null,i=n.lastMessage;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ke,{size:16}),e[0]=r):r=e[0];const c=n.title||"Super Agent";let d;e[1]!==c?(d=s.jsx("span",{className:"truncate text-sm text-foreground",children:c}),e[1]=c,e[2]=d):d=e[2];let x;e[3]!==a?(x=a&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-sm text-muted-foreground/50",children:"started by"}),s.jsx(ve,{url:a.user?.image??void 0,fallback:Ne(a.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate text-sm text-foreground",children:a.user?.name??"someone"})]}),e[3]=a,e[4]=x):x=e[4];let f;e[5]!==d||e[6]!==x?(f=s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3.5",children:[r,d,x]}),e[5]=d,e[6]=x,e[7]=f):f=e[7];let u;e[8]!==i||e[9]!==l||e[10]!==o||e[11]!==n?(u=o&&s.jsxs("button",{type:"button",disabled:!l,onClick:()=>l?.(n),className:"flex items-center gap-2 border-t border-border px-4 py-2 text-left transition-colors enabled:hover:bg-muted disabled:cursor-default",children:[s.jsxs("span",{className:U("flex items-center gap-1.5",o.className),children:[s.jsx(o.icon,{size:16,className:U(o.spin&&"animate-spin")}),s.jsx("span",{className:"text-sm",children:o.label})]}),i&&s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:i}),l&&s.jsx(kn,{size:16,className:"ml-auto shrink-0 text-muted-foreground"})]}),e[8]=i,e[9]=l,e[10]=o,e[11]=n,e[12]=u):u=e[12];let m;return e[13]!==f||e[14]!==u?(m=s.jsxs("div",{className:"flex flex-col overflow-hidden rounded-lg border border-border",children:[f,u]}),e[13]=f,e[14]=u,e[15]=m):m=e[15],m}function ml(t){return t.merged?{label:"Merged",className:"text-special",icon:Ys}:t.state==="closed"?{label:"Closed",className:"text-destructive",icon:kt}:t.draft?{label:"Draft",className:"text-muted-foreground",icon:kt}:{label:"Open",className:"text-success",icon:kt}}function xl(t){const e=K.c(38),{pr:n}=t;let a,l,o,i,r,c,d,x;if(e[0]!==n){l=ml(n);let C;e[9]!==n.body?(C=n.body?.trim(),e[9]=n.body,e[10]=C):C=e[10],a=C,r=n.url,c="_blank",d="noreferrer",x="flex flex-col gap-1 border-t border-border px-4 py-2 transition-colors hover:bg-muted",i="flex items-center gap-2",o=U("flex items-center gap-1.5",l.className),e[0]=n,e[1]=a,e[2]=l,e[3]=o,e[4]=i,e[5]=r,e[6]=c,e[7]=d,e[8]=x}else a=e[1],l=e[2],o=e[3],i=e[4],r=e[5],c=e[6],d=e[7],x=e[8];let f;e[11]!==l.icon?(f=s.jsx(l.icon,{size:16}),e[11]=l.icon,e[12]=f):f=e[12];let u;e[13]!==l.label?(u=s.jsx("span",{className:"text-sm",children:l.label}),e[13]=l.label,e[14]=u):u=e[14];let m;e[15]!==o||e[16]!==f||e[17]!==u?(m=s.jsxs("span",{className:o,children:[f,u]}),e[15]=o,e[16]=f,e[17]=u,e[18]=m):m=e[18];const j=n.title??`${n.repoOwner}/${n.repoName}`;let p;e[19]!==j?(p=s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:j}),e[19]=j,e[20]=p):p=e[20];let h;e[21]!==n.number?(h=s.jsxs("span",{className:"shrink-0 text-sm text-muted-foreground",children:["#",n.number]}),e[21]=n.number,e[22]=h):h=e[22];let g;e[23]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(En,{size:16,className:"shrink-0 text-muted-foreground"}),e[23]=g):g=e[23];let b;e[24]!==p||e[25]!==h||e[26]!==i||e[27]!==m?(b=s.jsxs("span",{className:i,children:[m,p,h,g]}),e[24]=p,e[25]=h,e[26]=i,e[27]=m,e[28]=b):b=e[28];let y;e[29]!==a?(y=a?s.jsx("span",{className:"line-clamp-3 whitespace-pre-line text-xs text-muted-foreground",children:a}):null,e[29]=a,e[30]=y):y=e[30];let v;return e[31]!==b||e[32]!==y||e[33]!==r||e[34]!==c||e[35]!==d||e[36]!==x?(v=s.jsxs("a",{href:r,target:c,rel:d,className:x,children:[b,y]}),e[31]=b,e[32]=y,e[33]=r,e[34]=c,e[35]=d,e[36]=x,e[37]=v):v=e[37],v}function gl(t){const e=K.c(5),{itemId:n}=t,{data:a,isLoading:l}=al(n);if(!l&&(!a||a.length===0))return null;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3.5",children:[s.jsx(kt,{size:16,className:"text-muted-foreground"}),s.jsx("span",{className:"text-sm text-foreground",children:"Pull requests"})]}),e[0]=o):o=e[0];let i;e[1]!==a?(i=a?a.map(pl):s.jsxs("div",{className:"flex items-center gap-2 border-t border-border px-4 py-2 text-sm text-muted-foreground",children:[s.jsx(Zt,{size:16,className:"animate-spin"}),s.jsx("span",{children:"Loading…"})]}),e[1]=a,e[2]=i):i=e[2];let r;return e[3]!==i?(r=s.jsxs("div",{className:"flex flex-col overflow-hidden rounded-lg border border-border",children:[o,i]}),e[3]=i,e[4]=r):r=e[4],r}function pl(t){return s.jsx(xl,{pr:t},t.url)}const Jt="__unassigned__",zt={assignee:null,priority:null,due:null};function hl(t){return t.assignee!==null||t.priority!==null||t.due!==null}function yl(t){return(t.assignee!==null?1:0)+(t.priority!==null?1:0)+(t.due!==null?1:0)}const bl=864e5;function jl(t,e){const n=new Date(t),a=new Date(e);return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()&&n.getDate()===a.getDate()}function Nl(t,e){if(e.assignee!==null){if(e.assignee===Jt){if(t.assigneeId!==null)return!1}else if(t.assigneeId!==e.assignee)return!1}if(e.priority!==null&&t.priority!==e.priority)return!1;if(e.due!==null)if(e.due==="none"){if(t.dueDate)return!1}else{if(!t.dueDate)return!1;const n=new Date(t.dueDate).getTime(),a=Date.now();if(e.due==="overdue"&&n>=a||e.due==="today"&&!jl(n,a)||e.due==="week"&&(n<a||n>a+7*bl))return!1}return!0}const cs=[{value:"overdue",label:"Overdue"},{value:"today",label:"Due today"},{value:"week",label:"Due this week"},{value:"none",label:"No due date"}];function Rt(t,e=!1){return U("inline-flex h-8 items-center gap-1.5 rounded-lg border px-2.5 text-xs font-medium outline-none transition-colors",e&&"h-10 w-full justify-start px-3 text-sm",t?"border-transparent bg-accent text-foreground":"border-border text-muted-foreground hover:bg-muted/60 hover:text-foreground")}function vl(t){const e=K.c(62),{value:n,members:a,onChange:l,block:o}=t,[i,r]=I.useState(!1);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Vt,{size:14,className:"shrink-0"}),e[0]=c):c=e[0];let d=c,x="Assignee";if(n===Jt)x="Unassigned";else if(n===$e){let R;e[1]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(ke,{size:14}),e[1]=R):R=e[1],d=R,x="Super Agent"}else if(n){let R,z,P,F;if(e[2]!==a||e[3]!==n){let H;e[8]!==n?(H=Y=>Y.userId===n,e[8]=n,e[9]=H):H=e[9],z=a.find(H),R=ve,P=z?.user?.image??void 0,F=Ne(z?.user?.name),e[2]=a,e[3]=n,e[4]=R,e[5]=z,e[6]=P,e[7]=F}else R=e[4],z=e[5],P=e[6],F=e[7];let V;e[10]!==R||e[11]!==P||e[12]!==F?(V=s.jsx(R,{url:P,fallback:F,shape:"circle",size:"2xs"}),e[10]=R,e[11]=P,e[12]=F,e[13]=V):V=e[13],d=V,x=z?.user?.name??"Member"}let f;e[14]!==l?(f=R=>{l(R),r(!1)},e[14]=l,e[15]=f):f=e[15];const u=f,m=n!==null;let j;e[16]!==o||e[17]!==m?(j=Rt(m,o),e[16]=o,e[17]=m,e[18]=j):j=e[18];const p=j,h=o&&"ml-auto";let g;e[19]!==h?(g=U("shrink-0 opacity-60",h),e[19]=h,e[20]=g):g=e[20];const b=g;let y;e[21]!==x?(y=s.jsx("span",{className:"max-w-[10rem] truncate",children:x}),e[21]=x,e[22]=y):y=e[22];let v;e[23]!==b?(v=s.jsx(ss,{size:12,className:b}),e[23]=b,e[24]=v):v=e[24];let C;e[25]!==d||e[26]!==y||e[27]!==v||e[28]!==p?(C=s.jsx(Gt,{asChild:!0,children:s.jsxs("button",{type:"button",className:p,children:[d,y,v]})}),e[25]=d,e[26]=y,e[27]=v,e[28]=p,e[29]=C):C=e[29];let T;e[30]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(vs,{placeholder:"Filter by assignee…",className:"h-9"}),e[30]=T):T=e[30];let N;e[31]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Ss,{children:"No members found."}),e[31]=N):N=e[31];let _;e[32]!==u?(_=s.jsx(Ae,{value:"Anyone",onSelect:()=>u(null),children:"Anyone"}),e[32]=u,e[33]=_):_=e[33];let D;e[34]!==u?(D=()=>u(Jt),e[34]=u,e[35]=D):D=e[35];let O;e[36]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(Vt,{size:16,className:"text-muted-foreground"}),e[36]=O):O=e[36];let w;e[37]!==D?(w=s.jsxs(Ae,{value:"Unassigned",onSelect:D,className:"gap-2",children:[O,"Unassigned"]}),e[37]=D,e[38]=w):w=e[38];let E;e[39]!==u?(E=()=>u($e),e[39]=u,e[40]=E):E=e[40];let q;e[41]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(ke,{size:16}),e[41]=q):q=e[41];let M;e[42]!==E?(M=s.jsxs(Ae,{value:"Super Agent",onSelect:E,className:"gap-2",children:[q,"Super Agent"]}),e[42]=E,e[43]=M):M=e[43];let L;e[44]!==_||e[45]!==w||e[46]!==M?(L=s.jsxs($t,{children:[_,w,M]}),e[44]=_,e[45]=w,e[46]=M,e[47]=L):L=e[47];let S;if(e[48]!==a||e[49]!==u){let R;e[51]!==u?(R=z=>s.jsxs(Ae,{value:z.user?.name??z.userId,onSelect:()=>u(z.userId),className:"gap-2",children:[s.jsx(ve,{url:z.user?.image??void 0,fallback:Ne(z.user?.name),shape:"circle",size:"2xs"}),s.jsx("span",{className:"truncate",children:z.user?.name??z.userId})]},z.userId),e[51]=u,e[52]=R):R=e[52],S=a.map(R),e[48]=a,e[49]=u,e[50]=S}else S=e[50];let A;e[53]!==S?(A=s.jsx($t,{heading:"Members",children:S}),e[53]=S,e[54]=A):A=e[54];let $;e[55]!==L||e[56]!==A?($=s.jsx(Ht,{align:"start",className:"w-56 p-0",children:s.jsxs(Cs,{children:[T,s.jsxs(ws,{children:[N,L,A]})]})}),e[55]=L,e[56]=A,e[57]=$):$=e[57];let Q;return e[58]!==i||e[59]!==$||e[60]!==C?(Q=s.jsxs(Qt,{open:i,onOpenChange:r,children:[C,$]}),e[58]=i,e[59]=$,e[60]=C,e[61]=Q):Q=e[61],Q}function Sl(t){const e=K.c(23),{value:n,onChange:a,block:l}=t,o=n!==null;let i;e[0]!==l||e[1]!==o?(i=Rt(o,l),e[0]=l,e[1]=o,e[2]=i):i=e[2];const r=i,c=l&&"ml-auto";let d;e[3]!==c?(d=U("shrink-0 opacity-60",c),e[3]=c,e[4]=d):d=e[4];const x=d;let f;e[5]!==n?(f=n?s.jsx("span",{className:U("size-2 shrink-0 rounded-full",Se[n].dotClassName)}):s.jsx(Fn,{size:14,className:"shrink-0"}),e[5]=n,e[6]=f):f=e[6];const u=n?Se[n].label:"Priority";let m;e[7]!==x?(m=s.jsx(ss,{size:12,className:x}),e[7]=x,e[8]=m):m=e[8];let j;e[9]!==f||e[10]!==u||e[11]!==m||e[12]!==r?(j=s.jsx(Tt,{asChild:!0,children:s.jsxs("button",{type:"button",className:r,children:[f,u,m]})}),e[9]=f,e[10]=u,e[11]=m,e[12]=r,e[13]=j):j=e[13];let p,h;e[14]!==a?(h=s.jsx(ft,{onSelect:()=>a(null),children:"Any priority"}),p=Is.map(y=>s.jsxs(ft,{onSelect:()=>a(y),className:"gap-2",children:[s.jsx("span",{className:U("size-2 rounded-full",Se[y].dotClassName)}),Se[y].label]},y)),e[14]=a,e[15]=p,e[16]=h):(p=e[15],h=e[16]);let g;e[17]!==p||e[18]!==h?(g=s.jsxs(Et,{align:"start",className:"w-40",children:[h,p]}),e[17]=p,e[18]=h,e[19]=g):g=e[19];let b;return e[20]!==g||e[21]!==j?(b=s.jsxs(At,{children:[j,g]}),e[20]=g,e[21]=j,e[22]=b):b=e[22],b}function Cl(t){const e=K.c(27),{value:n,onChange:a,block:l}=t;let o;e[0]!==n?(o=cs.find(N=>N.value===n)?.label,e[0]=n,e[1]=o):o=e[1];const i=o,r=n!==null;let c;e[2]!==l||e[3]!==r?(c=Rt(r,l),e[2]=l,e[3]=r,e[4]=c):c=e[4];const d=c,x=l&&"ml-auto";let f;e[5]!==x?(f=U("shrink-0 opacity-60",x),e[5]=x,e[6]=f):f=e[6];const u=f;let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ht,{size:14,className:"shrink-0"}),e[7]=m):m=e[7];const j=i??"Due date";let p;e[8]!==u?(p=s.jsx(ss,{size:12,className:u}),e[8]=u,e[9]=p):p=e[9];let h;e[10]!==j||e[11]!==p||e[12]!==d?(h=s.jsx(Tt,{asChild:!0,children:s.jsxs("button",{type:"button",className:d,children:[m,j,p]})}),e[10]=j,e[11]=p,e[12]=d,e[13]=h):h=e[13];let g;e[14]!==a?(g=()=>a(null),e[14]=a,e[15]=g):g=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(ht,{size:16,className:"text-muted-foreground"}),e[16]=b):b=e[16];let y;e[17]!==g?(y=s.jsxs(ft,{onSelect:g,className:"gap-2",children:[b,"Any time"]}),e[17]=g,e[18]=y):y=e[18];let v;e[19]!==a?(v=cs.map(N=>{const _=N.value==="overdue";return s.jsxs(ft,{onSelect:()=>a(N.value),className:U("gap-2",_&&"text-destructive"),children:[s.jsx(ht,{size:16,className:U("shrink-0",_?"text-destructive":"text-muted-foreground")}),N.label]},N.value)}),e[19]=a,e[20]=v):v=e[20];let C;e[21]!==y||e[22]!==v?(C=s.jsxs(Et,{align:"start",className:"w-44",children:[y,v]}),e[21]=y,e[22]=v,e[23]=C):C=e[23];let T;return e[24]!==C||e[25]!==h?(T=s.jsxs(At,{children:[h,C]}),e[24]=C,e[25]=h,e[26]=T):T=e[26],T}function ks(t){const e=K.c(26),{filters:n,members:a,onChange:l,block:o}=t;let i;e[0]!==n||e[1]!==l?(i=m=>l({...n,assignee:m}),e[0]=n,e[1]=l,e[2]=i):i=e[2];let r;e[3]!==o||e[4]!==n.assignee||e[5]!==a||e[6]!==i?(r=s.jsx(vl,{block:o,value:n.assignee,members:a,onChange:i}),e[3]=o,e[4]=n.assignee,e[5]=a,e[6]=i,e[7]=r):r=e[7];let c;e[8]!==n||e[9]!==l?(c=m=>l({...n,priority:m}),e[8]=n,e[9]=l,e[10]=c):c=e[10];let d;e[11]!==o||e[12]!==n.priority||e[13]!==c?(d=s.jsx(Sl,{block:o,value:n.priority,onChange:c}),e[11]=o,e[12]=n.priority,e[13]=c,e[14]=d):d=e[14];let x;e[15]!==n||e[16]!==l?(x=m=>l({...n,due:m}),e[15]=n,e[16]=l,e[17]=x):x=e[17];let f;e[18]!==o||e[19]!==n.due||e[20]!==x?(f=s.jsx(Cl,{block:o,value:n.due,onChange:x}),e[18]=o,e[19]=n.due,e[20]=x,e[21]=f):f=e[21];let u;return e[22]!==r||e[23]!==d||e[24]!==f?(u=s.jsxs(s.Fragment,{children:[r,d,f]}),e[22]=r,e[23]=d,e[24]=f,e[25]=u):u=e[25],u}function wl(t){const e=K.c(11),{filters:n,members:a,onChange:l}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(_s,{size:16,className:"mr-0.5 shrink-0 text-muted-foreground"}),e[0]=o):o=e[0];let i;e[1]!==n||e[2]!==a||e[3]!==l?(i=s.jsx(ks,{filters:n,members:a,onChange:l}),e[1]=n,e[2]=a,e[3]=l,e[4]=i):i=e[4];let r;e[5]!==n||e[6]!==l?(r=hl(n)&&s.jsx("button",{type:"button",onClick:()=>l(zt),className:"ml-1 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:"Clear"}),e[5]=n,e[6]=l,e[7]=r):r=e[7];let c;return e[8]!==i||e[9]!==r?(c=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o,i,r]}),e[8]=i,e[9]=r,e[10]=c):c=e[10],c}function _l(t){const e=K.c(26),{filters:n,members:a,onChange:l}=t,[o,i]=I.useState(!1),r=yl(n),c=r>0;let d;e[0]!==c?(d=Rt(c),e[0]=c,e[1]=d):d=e[1];const x=d;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(_s,{size:14,className:"shrink-0"}),e[2]=f):f=e[2];let u;e[3]!==r?(u=r>0&&s.jsx("span",{className:"ml-0.5 flex size-4 items-center justify-center rounded-full bg-foreground text-[10px] font-semibold text-background",children:r}),e[3]=r,e[4]=u):u=e[4];let m;e[5]!==u||e[6]!==x?(m=s.jsx(An,{asChild:!0,children:s.jsxs("button",{type:"button",className:x,children:[f,"Filters",u]})}),e[5]=u,e[6]=x,e[7]=m):m=e[7];let j;e[8]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx($n,{className:"px-4 pt-4 text-base font-medium text-foreground",children:"Filters"}),e[8]=j):j=e[8];let p;e[9]!==n||e[10]!==a||e[11]!==l?(p=s.jsx("div",{className:"flex flex-col gap-2 p-4",children:s.jsx(ks,{block:!0,filters:n,members:a,onChange:l})}),e[9]=n,e[10]=a,e[11]=l,e[12]=p):p=e[12];let h;e[13]!==r||e[14]!==l?(h=r>0&&s.jsx(je,{variant:"outline",className:"flex-1",onClick:()=>l(zt),children:"Clear all"}),e[13]=r,e[14]=l,e[15]=h):h=e[15];let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(zn,{asChild:!0,children:s.jsx(je,{className:"flex-1",children:"Done"})}),e[16]=g):g=e[16];let b;e[17]!==h?(b=s.jsxs(On,{className:"flex-row gap-2",children:[h,g]}),e[17]=h,e[18]=b):b=e[18];let y;e[19]!==b||e[20]!==p?(y=s.jsxs(Rn,{className:"p-0",children:[j,p,b]}),e[19]=b,e[20]=p,e[21]=y):y=e[21];let v;return e[22]!==o||e[23]!==y||e[24]!==m?(v=s.jsxs(Pn,{open:o,onOpenChange:i,direction:"bottom",children:[m,y]}),e[22]=o,e[23]=y,e[24]=m,e[25]=v):v=e[25],v}const us=380,Dl=90,ds=5,Il="cubic-bezier(0.22, 0.61, 0.36, 1)",kl=8;function Tl(t,e){const n=I.useRef(new Map);I.useLayoutEffect(()=>{const a=t.current;if(!a)return;const l=a.querySelectorAll("[data-flip-id]"),o=n.current,i=new Map,r=typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches,c=[];for(const u of l){const m=u.dataset.flipId;if(!m)continue;const j=u.getBoundingClientRect();i.set(m,j);const p=o.get(m);if(!p)continue;const h=p.left-j.left,g=p.top-j.top;(h||g)&&c.push({el:u,dx:h,dy:g,lane:Math.abs(h)>kl})}if(n.current=i,r||c.length===0)return;for(const u of c){const m=u.lane?` rotate(${u.dx>0?ds:-ds}deg)`:"";u.el.style.transition="none",u.el.style.transform=`translate(${u.dx}px, ${u.dy}px)${m}`,u.lane&&(u.el.style.zIndex="10")}let d=0;const x=[],f=requestAnimationFrame(()=>{for(const u of c){const m=u.lane?d++*Dl:0;u.el.style.transition=`transform ${us}ms ${Il} ${m}ms`,u.el.style.transform="",x.push(window.setTimeout(()=>{u.el.style.transition="",u.el.style.transform="",u.el.style.zIndex=""},us+m+30))}});return()=>{cancelAnimationFrame(f);for(const u of x)clearTimeout(u)}},[e,t])}Ks(()=>import("./index-BCg0EIRK.js").then(t=>t.b1),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152])).catch(()=>{});function El(){const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"min-h-0 flex-1 pt-0 pr-1 pb-1 pl-0",children:s.jsx("div",{className:"h-full p-0.5 pt-0.25",children:s.jsx("div",{className:"card-shadow flex h-full flex-col overflow-hidden rounded-[0.75rem] bg-background",children:s.jsx(zs,{})})})}),t[0]=e):e=t[0],e}const Al=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"});function $l(t){const e=new Date(t),n=e.getTime()<Date.now();return{label:Al.format(e),overdue:n}}const ls="inline-flex items-center gap-1.5 rounded-lg border border-border bg-background px-2 py-1 text-xs font-medium text-muted-foreground";function Ts(){const t=K.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=U(ls,"border-warning/30 text-warning"),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("span",{className:e,title:"The agent is waiting for your input",children:[s.jsx(gs,{size:14}),"Needs input"]}),t[1]=n):n=t[1],n}function Es(t){const e=K.c(7),{priority:n}=t,a=Se[n];let l;e[0]!==a.dotClassName?(l=U("size-2 rounded-full",a.dotClassName),e[0]=a.dotClassName,e[1]=l):l=e[1];let o;e[2]!==l?(o=s.jsx("span",{className:l}),e[2]=l,e[3]=o):o=e[3];let i;return e[4]!==a.label||e[5]!==o?(i=s.jsxs("span",{className:ls,children:[o,a.label]}),e[4]=a.label,e[5]=o,e[6]=i):i=e[6],i}function As(t){const e=K.c(7),{iso:n}=t;let a,l;if(e[0]!==n){const{label:r,overdue:c}=$l(n);a=r,l=U(ls,c&&"border-destructive/30 text-destructive"),e[0]=n,e[1]=a,e[2]=l}else a=e[1],l=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ht,{size:14}),e[3]=o):o=e[3];let i;return e[4]!==a||e[5]!==l?(i=s.jsxs("span",{className:l,children:[o,a]}),e[4]=a,e[5]=l,e[6]=i):i=e[6],i}function $s(t){const e=K.c(11),{item:n,assignee:a,assignedBy:l}=t;if(n.assigneeId===$e){const o=l?.user?.name?`Assigned to Super Agent by ${l.user.name}`:"Assigned to Super Agent";let i;e[0]!==l?(i=l&&s.jsx(ve,{url:l.user?.image??void 0,fallback:Ne(l.user?.name),shape:"circle",size:"2xs",className:"-mr-1.5 ring-2 ring-background"}),e[0]=l,e[1]=i):i=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ke,{size:16,className:"ring-2 ring-background"}),e[2]=r):r=e[2];let c;return e[3]!==o||e[4]!==i?(c=s.jsxs("span",{className:"inline-flex items-center",title:o,children:[i,r]}),e[3]=o,e[4]=i,e[5]=c):c=e[5],c}if(a){const o=a.user?.image??void 0,i=a.user?.name;let r;e[6]!==i?(r=Ne(i),e[6]=i,e[7]=r):r=e[7];let c;return e[8]!==o||e[9]!==r?(c=s.jsx(ve,{url:o,fallback:r,shape:"circle",size:"2xs"}),e[8]=o,e[9]=r,e[10]=c):c=e[10],c}return null}function zs(){const t=K.c(102),{items:e,isLoading:n}=sl(),a=nl(),l=Bn();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={slug:"mcp-github"},t[0]=o):o=t[0];const i=un(o);let r;t[1]!==i?(r=dn(i),t[1]=i,t[2]=r):r=t[2];const c=r.length>0,[d,x]=I.useState(!1),{data:f}=bs();let u,m;t[3]!==f?.data?.members?(u=f?.data?.members??[],m=new Map(u.map(zl)),t[3]=f?.data?.members,t[4]=u,t[5]=m):(u=t[4],m=t[5]);const j=m,[p,h]=I.useState("board"),[g,b]=I.useState(zt),[y,v]=I.useState(!1),[C,T]=I.useState(null),[N,_]=I.useState(null),{setTaskId:D}=Mn(),{create:O}=qn(),{org:w,locator:E}=yt(),q=Ls();let M;t[6]===Symbol.for("react.memo_cache_sentinel")?(M={strict:!1},t[6]=M):M=t[6];const{task:L}=Us(M);let S;t[7]!==L||t[8]!==e?(S=L?e.find(G=>G.id===L)??null:null,t[7]=L,t[8]=e,t[9]=S):S=t[9];const A=S;let $;t[10]!==L||t[11]!==q||t[12]!==w?($=()=>{L&&q({to:"/$org/board",params:{org:w.slug},search:{},replace:!0})},t[10]=L,t[11]=q,t[12]=w,t[13]=$):$=t[13];const Q=$;let R;t[14]!==a||t[15]!==O||t[16]!==E||t[17]!==w||t[18]!==D?(R=async G=>{const X=crypto.randomUUID(),J=sn(w.id).id,ge={type:"doc",content:[{type:"paragraph",content:[_n({id:G.id,name:G.title,char:"@",kind:"task",metadata:{title:G.title,description:G.description}}),{type:"text",text:" "}]}]};Kn(sessionStorage,E,X,ge),v(!1);try{await O({id:X,virtual_mcp_id:J}),await a.link.mutateAsync({id:G.id,linkThreadId:X})}catch{}D(X,J)},t[14]=a,t[15]=O,t[16]=E,t[17]=w,t[18]=D,t[19]=R):R=t[19];const z=R;let P,F,V,H,Y,ne,le;if(t[20]!==a||t[21]!==Q||t[22]!==A||t[23]!==y||t[24]!==C||t[25]!==g||t[26]!==c||t[27]!==n||t[28]!==e||t[29]!==p||t[30]!==j||t[31]!==u||t[32]!==l){Y=Symbol.for("react.early_return_sentinel");e:{let G;t[40]!==g?(G=B=>Nl(B,g),t[40]=g,t[41]=G):G=t[41];const X=e.filter(G);let J;t[42]===Symbol.for("react.memo_cache_sentinel")?(J=()=>{T(null),_(null),v(!0)},t[42]=J):J=t[42];const ge=J;let we;t[43]===Symbol.for("react.memo_cache_sentinel")?(we=B=>{T(null),_(B),v(!0)},t[43]=we):we=t[43];const _e=we;let ie;t[44]===Symbol.for("react.memo_cache_sentinel")?(ie=B=>{T(B),v(!0)},t[44]=ie):ie=t[44];const ye=ie;P=C??A,V=y||!!A;let ze;if(t[45]!==Q?(ze=()=>{v(!1),T(null),_(null),Q()},t[45]=Q,t[46]=ze):ze=t[46],F=ze,n&&e.length===0){let B;t[47]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx("div",{className:"flex flex-1 items-center justify-center",children:s.jsx(xs,{size:20,className:"animate-spin text-muted-foreground"})}),t[47]=B):B=t[47],Y=B;break e}ne="flex min-h-0 flex-1 flex-col";let De;t[48]===Symbol.for("react.memo_cache_sentinel")?(De=s.jsx("h1",{className:"text-xl font-medium text-foreground",children:"Tasks"}),t[48]=De):De=t[48];let ee;t[49]!==g||t[50]!==e.length||t[51]!==u?(ee=e.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"sm:hidden",children:s.jsx(_l,{filters:g,members:u,onChange:b})}),s.jsx("div",{className:"hidden sm:block",children:s.jsx(wl,{filters:g,members:u,onChange:b})})]}),t[49]=g,t[50]=e.length,t[51]=u,t[52]=ee):ee=t[52];const Ee=p==="list";let ce;t[53]===Symbol.for("react.memo_cache_sentinel")?(ce=()=>h("list"),t[53]=ce):ce=t[53];let ue;t[54]!==Ee?(ue=s.jsx(fs,{active:Ee,onClick:ce,icon:Zs,label:"List"}),t[54]=Ee,t[55]=ue):ue=t[55];const pe=p==="board";let Ie;t[56]===Symbol.for("react.memo_cache_sentinel")?(Ie=()=>h("board"),t[56]=Ie):Ie=t[56];let te;t[57]!==pe?(te=s.jsx(fs,{active:pe,onClick:Ie,icon:Js,label:"Board"}),t[57]=pe,t[58]=te):te=t[58];let se;t[59]!==ue||t[60]!==te?(se=s.jsxs("div",{className:"inline-flex rounded-lg bg-muted p-0.5",children:[ue,te]}),t[59]=ue,t[60]=te,t[61]=se):se=t[61];let de;t[62]===Symbol.for("react.memo_cache_sentinel")?(de=s.jsxs(je,{size:"sm",onClick:ge,children:[s.jsx(es,{size:16}),"New task"]}),t[62]=de):de=t[62];let fe;t[63]!==se?(fe=s.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[se,de]}),t[63]=se,t[64]=fe):fe=t[64],t[65]!==ee||t[66]!==fe?(le=s.jsxs("div",{className:"mx-auto flex w-full max-w-[1680px] flex-col gap-4 px-4 pt-6 sm:px-8 sm:pt-8",children:[De,s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[ee,fe]})]}),t[65]=ee,t[66]=fe,t[67]=le):le=t[67],H=e.length===0?s.jsx("div",{className:"mx-auto w-full max-w-[1680px] px-4 pt-6 sm:px-8",children:s.jsx("div",{className:"rounded-xl bg-card px-4 py-12 text-center text-sm text-muted-foreground card-shadow",children:"No tasks yet. Start one with New task."})}):X.length===0?s.jsx("div",{className:"mx-auto w-full max-w-[1680px] px-4 pt-6 sm:px-8",children:s.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl bg-card px-4 py-12 text-center text-sm text-muted-foreground card-shadow",children:["No tasks match these filters.",s.jsx(je,{variant:"outline",size:"sm",onClick:()=>b(zt),children:"Clear filters"})]})}):p==="board"?s.jsx(Rl,{items:X,memberByUserId:j,onOpen:ye,onCreate:_e,onMove:(B,Pt)=>a.update.mutate({id:B,status:Pt}),onAutoFix:l?B=>{if(!c){x(!0);return}a.update.mutate({id:B.id,assigneeId:$e})}:void 0}):s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 pt-6 pb-16 sm:px-8",children:s.jsx("div",{className:"mx-auto flex max-w-[820px] flex-col gap-2",children:X.map(B=>s.jsx(Ml,{item:B,assignee:B.assigneeId?j.get(B.assigneeId):void 0,assignedBy:B.assignedBy?j.get(B.assignedBy):void 0,onOpen:()=>ye(B)},B.id))})})}t[20]=a,t[21]=Q,t[22]=A,t[23]=y,t[24]=C,t[25]=g,t[26]=c,t[27]=n,t[28]=e,t[29]=p,t[30]=j,t[31]=u,t[32]=l,t[33]=P,t[34]=F,t[35]=V,t[36]=H,t[37]=Y,t[38]=ne,t[39]=le}else P=t[33],F=t[34],V=t[35],H=t[36],Y=t[37],ne=t[38],le=t[39];if(Y!==Symbol.for("react.early_return_sentinel"))return Y;const me=V?P?.id??`new-${N??"default"}`:"closed",Te=P??void 0,mt=N??void 0,xt=a.create.isPending||a.update.isPending;let xe;t[68]!==a.create||t[69]!==a.update||t[70]!==P||t[71]!==F?(xe=G=>{P?a.update.mutate({id:P.id,...G}):a.create.mutate(G),F()},t[68]=a.create,t[69]=a.update,t[70]=P,t[71]=F,t[72]=xe):xe=t[72];let W;t[73]!==a.remove||t[74]!==P||t[75]!==F?(W=P?()=>{a.remove.mutate(P.id),F()}:void 0,t[73]=a.remove,t[74]=P,t[75]=F,t[76]=W):W=t[76];let ae;t[77]!==P||t[78]!==z?(ae=P?()=>{z(P)}:void 0,t[77]=P,t[78]=z,t[79]=ae):ae=t[79];let Z;t[80]!==F||t[81]!==D?(Z=G=>{G.virtualMcpId&&(F(),D(G.threadId,G.virtualMcpId,{main:G.hasPreview?"preview":"board"}))},t[80]=F,t[81]=D,t[82]=Z):Z=t[82];let Ce;t[83]!==F||t[84]!==V||t[85]!==me||t[86]!==Te||t[87]!==mt||t[88]!==xt||t[89]!==xe||t[90]!==W||t[91]!==ae||t[92]!==Z?(Ce=s.jsx(cl,{open:V,onClose:F,item:Te,defaultStatus:mt,isSaving:xt,onSubmit:xe,onDelete:W,onNewChat:ae,onOpenThread:Z},me),t[83]=F,t[84]=V,t[85]=me,t[86]=Te,t[87]=mt,t[88]=xt,t[89]=xe,t[90]=W,t[91]=ae,t[92]=Z,t[93]=Ce):Ce=t[93];let re;t[94]!==d?(re=s.jsx(Ol,{open:d,onOpenChange:x}),t[94]=d,t[95]=re):re=t[95];let oe;return t[96]!==H||t[97]!==Ce||t[98]!==re||t[99]!==ne||t[100]!==le?(oe=s.jsxs("div",{className:ne,children:[le,H,Ce,re]}),t[96]=H,t[97]=Ce,t[98]=re,t[99]=ne,t[100]=le,t[101]=oe):oe=t[101],oe}function zl(t){return[t.userId,t]}function Ol(t){const e=K.c(14),{open:n,onOpenChange:a}=t,{connect:l,isConnecting:o}=Zn("deco/mcp-github");let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs(an,{children:[s.jsx(ys,{children:"Connect GitHub"}),s.jsx(rn,{children:"Auto-fix hands the task to the Super Agent, which opens a pull request with the change. Connect GitHub so it can push and open PRs."})]}),e[0]=i):i=e[0];let r;e[1]!==l||e[2]!==a?(r=async()=>{await l(),a(!1)},e[1]=l,e[2]=a,e[3]=r):r=e[3];let c;e[4]!==o?(c=o?s.jsx(xs,{size:16,className:"animate-spin"}):s.jsx(ln,{className:"size-4"}),e[4]=o,e[5]=c):c=e[5];let d;e[6]!==o||e[7]!==r||e[8]!==c?(d=s.jsxs(ps,{className:"sm:max-w-md",children:[i,s.jsx(on,{children:s.jsxs(je,{onClick:r,disabled:o,className:"gap-2",children:[c,"Connect GitHub"]})})]}),e[6]=o,e[7]=r,e[8]=c,e[9]=d):d=e[9];let x;return e[10]!==a||e[11]!==n||e[12]!==d?(x=s.jsx(hs,{open:n,onOpenChange:a,children:d}),e[10]=a,e[11]=n,e[12]=d,e[13]=x):x=e[13],x}function fs(t){const e=K.c(11),{active:n,onClick:a,icon:l,label:o}=t,i=`${o} view`,r=n?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground";let c;e[0]!==r?(c=U("flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-medium transition-colors",r),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==l?(d=s.jsx(l,{size:14}),e[2]=l,e[3]=d):d=e[3];let x;return e[4]!==n||e[5]!==o||e[6]!==a||e[7]!==i||e[8]!==c||e[9]!==d?(x=s.jsxs("button",{type:"button",onClick:a,"aria-label":i,"aria-pressed":n,className:c,children:[d,o]}),e[4]=n,e[5]=o,e[6]=a,e[7]=i,e[8]=c,e[9]=d,e[10]=x):x=e[10],x}function Rl(t){const e=K.c(12),{items:n,memberByUserId:a,onOpen:l,onCreate:o,onMove:i,onAutoFix:r}=t,[c,d]=I.useState(null),x=I.useRef(null);let f;e[0]!==n?(f=n.map(Pl).join(","),e[0]=n,e[1]=f):f=e[1],Tl(x,f);let m;e[2]!==n||e[3]!==a||e[4]!==r||e[5]!==o||e[6]!==i||e[7]!==l||e[8]!==c?(m=Ds.map(p=>{const h=n.filter(y=>y.status===p),g=be[p],b=g.icon;return s.jsxs("div",{onDragOver:y=>{y.preventDefault(),d(p)},onDragLeave:y=>{y.currentTarget.contains(y.relatedTarget)||d(null)},onDrop:y=>{y.preventDefault();const v=y.dataTransfer.getData("text/plain");v&&i(v,p),d(null)},className:U("flex w-[300px] shrink-0 flex-col rounded-xl p-1 transition-colors",c===p&&"bg-muted/50"),children:[s.jsxs("div",{className:"sticky top-0 z-10 flex items-center gap-2 bg-background px-2 py-1.5",children:[s.jsx(b,{size:15,className:U("shrink-0",g.iconClassName)}),s.jsx("span",{className:"text-sm font-medium text-foreground",children:g.label}),s.jsx("span",{className:"rounded-md bg-muted px-1.5 text-[11px] font-medium text-muted-foreground",children:h.length}),s.jsx("button",{type:"button","aria-label":`New task in ${g.label}`,title:`New task in ${g.label}`,onClick:()=>o(p),className:"ml-auto flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:s.jsx(es,{size:15})})]}),s.jsx("div",{className:"flex min-h-12 flex-col gap-2 pt-1",children:h.map(y=>s.jsx(Fl,{item:y,assignee:y.assigneeId?a.get(y.assigneeId):void 0,assignedBy:y.assignedBy?a.get(y.assignedBy):void 0,onOpen:()=>l(y),onAutoFix:r?()=>r(y):void 0},y.id))})]},p)}),e[2]=n,e[3]=a,e[4]=r,e[5]=o,e[6]=i,e[7]=l,e[8]=c,e[9]=m):m=e[9];let j;return e[10]!==m?(j=s.jsx("div",{ref:x,className:"min-h-0 flex-1 overflow-x-auto overflow-y-auto",children:s.jsx("div",{className:"mx-auto flex w-full max-w-[1680px] gap-3 px-4 pt-6 pb-16 sm:px-8",children:m})}),e[10]=m,e[11]=j):j=e[11],j}function Pl(t){return`${t.id}:${t.status}`}function Fl(t){const e=K.c(33),{item:n,assignee:a,assignedBy:l,onOpen:o,onAutoFix:i}=t,r=be[n.status],c=r.icon,d=ll(n)?.lastMessage,x=i&&(n.status==="triage"||n.status==="todo")&&n.assigneeId!==$e,f=n.id;let u;e[0]!==n.id?(u=N=>{N.dataTransfer.setData("text/plain",n.id),N.dataTransfer.effectAllowed="move"},e[0]=n.id,e[1]=u):u=e[1];const m=n.title;let j;e[2]!==r.iconClassName?(j=U("mt-px shrink-0",r.iconClassName),e[2]=r.iconClassName,e[3]=j):j=e[3];let p;e[4]!==c||e[5]!==j?(p=s.jsx(c,{size:16,className:j}),e[4]=c,e[5]=j,e[6]=p):p=e[6];let h;e[7]!==n.title?(h=s.jsx("span",{className:"min-w-0 flex-1 text-sm font-medium leading-snug text-foreground line-clamp-2",children:n.title}),e[7]=n.title,e[8]=h):h=e[8];let g;e[9]!==l||e[10]!==a||e[11]!==n?(g=s.jsx($s,{item:n,assignee:a,assignedBy:l}),e[9]=l,e[10]=a,e[11]=n,e[12]=g):g=e[12];let b;e[13]!==p||e[14]!==h||e[15]!==g?(b=s.jsxs("div",{className:"flex items-start gap-2",children:[p,h,g]}),e[13]=p,e[14]=h,e[15]=g,e[16]=b):b=e[16];let y;e[17]!==d?(y=d&&s.jsx("p",{className:"line-clamp-2 pl-6 text-xs leading-snug text-muted-foreground",children:d}),e[17]=d,e[18]=y):y=e[18];let v;e[19]!==n?(v=(Xt(n)||n.priority!=="none"||!!n.dueDate)&&s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pl-6",children:[Xt(n)&&s.jsx(Ts,{}),n.priority!=="none"&&s.jsx(Es,{priority:n.priority}),n.dueDate&&s.jsx(As,{iso:n.dueDate})]}),e[19]=n,e[20]=v):v=e[20];let C;e[21]!==i||e[22]!==x?(C=x&&s.jsxs("button",{type:"button",onClick:N=>{N.stopPropagation(),i()},className:"flex items-center gap-1.5 self-end rounded-md border border-border bg-background px-2 py-1 text-xs font-medium text-foreground transition-colors hover:bg-accent",children:[s.jsx(Ws,{size:12}),"Auto-fix"]}),e[21]=i,e[22]=x,e[23]=C):C=e[23];let T;return e[24]!==n.id||e[25]!==n.title||e[26]!==o||e[27]!==v||e[28]!==C||e[29]!==u||e[30]!==b||e[31]!==y?(T=s.jsxs("button",{type:"button",draggable:!0,"data-flip-id":f,onDragStart:u,onClick:o,className:"group flex cursor-grab flex-col gap-2 rounded-xl bg-card px-3 py-2.5 text-left card-shadow transition-colors will-change-transform hover:bg-accent/60 active:cursor-grabbing",title:m,children:[b,y,v,C]}),e[24]=n.id,e[25]=n.title,e[26]=o,e[27]=v,e[28]=C,e[29]=u,e[30]=b,e[31]=y,e[32]=T):T=e[32],T}function Ml(t){const e=K.c(30),{item:n,assignee:a,assignedBy:l,onOpen:o}=t,i=be[n.status],r=i.icon;let c;e[0]!==i.iconClassName?(c=U("shrink-0",i.iconClassName),e[0]=i.iconClassName,e[1]=c):c=e[1];let d;e[2]!==r||e[3]!==c?(d=s.jsx(r,{size:16,className:c}),e[2]=r,e[3]=c,e[4]=d):d=e[4];let x;e[5]!==n.title?(x=s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-foreground",children:n.title}),e[5]=n.title,e[6]=x):x=e[6];let f;e[7]!==n?(f=Xt(n)&&s.jsx(Ts,{}),e[7]=n,e[8]=f):f=e[8];let u;e[9]!==n.priority?(u=n.priority!=="none"&&s.jsx("span",{className:"hidden sm:inline-flex",children:s.jsx(Es,{priority:n.priority})}),e[9]=n.priority,e[10]=u):u=e[10];let m;e[11]!==n.dueDate?(m=n.dueDate&&s.jsx("span",{className:"hidden sm:inline-flex",children:s.jsx(As,{iso:n.dueDate})}),e[11]=n.dueDate,e[12]=m):m=e[12];let j;e[13]!==l||e[14]!==a||e[15]!==n?(j=s.jsx($s,{item:n,assignee:a,assignedBy:l}),e[13]=l,e[14]=a,e[15]=n,e[16]=j):j=e[16];let p;e[17]!==n.createdAt?(p=yn(new Date(n.createdAt)),e[17]=n.createdAt,e[18]=p):p=e[18];let h;e[19]!==p?(h=s.jsx("span",{className:"hidden shrink-0 text-[11px] text-muted-foreground/70 sm:inline",children:p}),e[19]=p,e[20]=h):h=e[20];let g;return e[21]!==o||e[22]!==d||e[23]!==x||e[24]!==f||e[25]!==u||e[26]!==m||e[27]!==j||e[28]!==h?(g=s.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-xl bg-card px-4 py-3 text-left card-shadow transition-colors hover:bg-accent/60",children:[d,x,f,u,m,j,h]}),e[21]=o,e[22]=d,e[23]=x,e[24]=f,e[25]=u,e[26]=m,e[27]=j,e[28]=h,e[29]=g):g=e[29],g}const Aa=Object.freeze(Object.defineProperty({__proto__:null,TaskBoardPage:zs,default:El},Symbol.toStringTag,{value:"Module"}));export{Da as H,Se as P,Jn as S,cl as T,Wn as a,Ea as b,ka as c,Zn as d,sl as e,nl as f,be as g,ke as h,Ln as i,zs as j,Aa as k,Ia as r,Ta as u,Kn as w};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as h,C as x,a as S,u as j,r as C,j as u,Y as I,N as _}from"./index-DMziGwwO.js";import{a as R}from"./constants-BHDe7bIw.js";import{a as b}from"./hooks-CfbEEqda.js";import{f as k}from"./reusable-new-chat-CouMjkYR.js";import"./use-mcp-client-BjL1G4QR.js";import"./auth-CL1EKZwd.js";import"./decopilot-sse-pool-Ch1Qumbm.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function L(){const t=h.c(12),{org:o}=x(),r=R(o.id).id,{data:p}=S.useSession(),{threads:d,status:f}=b();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[0]=a):a=t[0];const{connect:l,siteUrl:c}=j(a),[g]=C.useState(y);if(f.kind==="loading"){let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=u.jsx(I,{}),t[1]=n):n=t[1],n}const m=k(d,r,p?.user?.id)?.id??g;let e;t[2]!==o.slug||t[3]!==m?(e={org:o.slug,taskId:m},t[2]=o.slug,t[3]=m,t[4]=e):e=t[4];let s;t[5]!==l||t[6]!==r||t[7]!==c?(s={virtualmcpid:r,connect:l,siteUrl:c},t[5]=l,t[6]=r,t[7]=c,t[8]=s):s=t[8];let i;return t[9]!==e||t[10]!==s?(i=u.jsx(_,{to:"/$org/$taskId",params:e,search:s,replace:!0}),t[9]=e,t[10]=s,t[11]=i):i=t[11],i}function y(){return crypto.randomUUID()}export{L as default};
|