decocms 2.304.15 → 2.304.16
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-CbUYZGF-.js → AlertCircle-YdvcZKe8.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-DHj5-FLY.js → ArrowNarrowLeft-spQjUruy.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BK_iYZ-J.js → ArrowUpRight-B1ajIZNC.js} +1 -1
- package/dist/client/assets/Check-D7cmovlU.js +1 -0
- package/dist/client/assets/{CheckCircle-D9qlmIve.js → CheckCircle-BQ3_L_yP.js} +1 -1
- package/dist/client/assets/ChevronDown-BfDxcbjR.js +1 -0
- package/dist/client/assets/{ChevronRight-BIm0-OSp.js → ChevronRight-BoDMW1uU.js} +1 -1
- package/dist/client/assets/{ChevronUp-ClqSoLtD.js → ChevronUp-CRQBEG-R.js} +1 -1
- package/dist/client/assets/{Container-BCDxdJoG.js → Container-B6Z-4M-T.js} +1 -1
- package/dist/client/assets/{DotsVertical-DEE8M0V4.js → DotsVertical-BxlMGXPv.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DM7IwrPj.js → LinkExternal01-Dmf65eFo.js} +1 -1
- package/dist/client/assets/{Lock01-BmjkKSvK.js → Lock01-CHWOYjbh.js} +1 -1
- package/dist/client/assets/{Palette-BrJL0UcN.js → Palette-96pDg1d-.js} +1 -1
- package/dist/client/assets/{Play-DSYx2GJ2.js → Play-ChzLrbkr.js} +1 -1
- package/dist/client/assets/{Plus-BrBimbff.js → Plus-Cd4I0_d-.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-Cr84gVY8.js → RefreshCcw01-BBhbyLOk.js} +1 -1
- package/dist/client/assets/{SearchMd-IP-R-mtT.js → SearchMd-cj9P259i.js} +1 -1
- package/dist/client/assets/{Settings02-BOckjEVU.js → Settings02-Cx39xFqG.js} +1 -1
- package/dist/client/assets/{Shield01-CJggUHAQ.js → Shield01-DDhNoo0b.js} +1 -1
- package/dist/client/assets/Star01-UQZ7hTDj.js +1 -0
- package/dist/client/assets/{Sun-B7BWJEHb.js → Sun-Cr3NKiIh.js} +1 -1
- package/dist/client/assets/{Tool01-D1Rvo01i.js → Tool01-DXbOwd1n.js} +1 -1
- package/dist/client/assets/{Trash01-DaGrAtTq.js → Trash01-DqDMVyTa.js} +1 -1
- package/dist/client/assets/{User01-DmtseI1g.js → User01-C7C_-f57.js} +1 -1
- package/dist/client/assets/{Users03-DH9QAbco.js → Users03-DGRxeg5O.js} +1 -1
- package/dist/client/assets/{X-viKat0oa.js → X-8IHaEYtM.js} +1 -1
- package/dist/client/assets/{XCircle-DZEMwZj2.js → XCircle-kdEx_GGF.js} +1 -1
- package/dist/client/assets/{XClose-DY7O9VST.js → XClose-D8EpU_uy.js} +1 -1
- package/dist/client/assets/{Zap-BMzMPNv3.js → Zap-DdUb_mPC.js} +1 -1
- package/dist/client/assets/{ZapSquare-BDbWe-zU.js → ZapSquare-Biix1-55.js} +1 -1
- package/dist/client/assets/{accordion-YgNI8iqn.js → accordion-MNTOVO1w.js} +1 -1
- package/dist/client/assets/agent-icon-BBG09Kki.js +1 -0
- package/dist/client/assets/agents-list-Cd2ZNqCV.js +1 -0
- package/dist/client/assets/ai-providers-BM3nrPzC.js +1 -0
- package/dist/client/assets/{alert-dialog-BvuFarFf.js → alert-dialog-ChbEbjde.js} +1 -1
- package/dist/client/assets/{auth-catchall-DQeYnh5P.js → auth-catchall-CBAL823O.js} +1 -1
- package/dist/client/assets/automation-list-row-ZDJkdIwJ.js +1 -0
- package/dist/client/assets/automations-_nxja9xP.js +1 -0
- package/dist/client/assets/{avatar-C4FRugJb.js → avatar-97M2j8Mc.js} +1 -1
- package/dist/client/assets/{badge-_ZGDO29b.js → badge-CGsQT5nT.js} +1 -1
- package/dist/client/assets/brand-context-D6w2oIn3.js +1 -0
- package/dist/client/assets/{card-oSxwoJvZ.js → card-DfJe5L79.js} +1 -1
- package/dist/client/assets/{chat-context-C4Hx_rZK.js → chat-context-Cmy5JYgW.js} +1 -1
- package/dist/client/assets/checkbox-C1M4-v1p.js +1 -0
- package/dist/client/assets/collection-detail-Bwwayl0Z.js +1 -0
- package/dist/client/assets/collection-display-button-C5vtHGnK.js +1 -0
- package/dist/client/assets/{collection-search-u94VKjvs.js → collection-search-CzQYdsP4.js} +1 -1
- package/dist/client/assets/{collection-search-D_DqZCmL.js → collection-search-DT89ZZmI.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-LzV9CSI7.js → collection-table-wrapper-Bna3sxAQ.js} +1 -1
- package/dist/client/assets/{collection-tabs-DW1xYGdq.js → collection-tabs-ComzcUW9.js} +1 -1
- package/dist/client/assets/{collections-Cn7VbUFT.js → collections-CTGZthcG.js} +1 -1
- package/dist/client/assets/{command-CgMn1LbK.js → command-DjJw7GWb.js} +1 -1
- package/dist/client/assets/{connection-card-BPUe3B60.js → connection-card-DQlGg9mJ.js} +1 -1
- package/dist/client/assets/connection-detail-Z4nXqSbX.js +1 -0
- package/dist/client/assets/{connection-form-helpers-CUlzSClK.js → connection-form-helpers-DiGKAKlz.js} +1 -1
- package/dist/client/assets/connections-DAoFEFST.js +1 -0
- package/dist/client/assets/{constants-CfwGLQ49.js → constants-B9wErdMg.js} +1 -1
- package/dist/client/assets/{constants-CVDNjJTw.js → constants-XC36TPvL.js} +1 -1
- package/dist/client/assets/{dialog-CoECADf1.js → dialog-B9n71g4e.js} +1 -1
- package/dist/client/assets/{domain-settings-D6RV8b16.js → domain-settings-DAaCjfZg.js} +1 -1
- package/dist/client/assets/{drawer-DTk8g2vK.js → drawer-Dy5NJxEk.js} +1 -1
- package/dist/client/assets/dropdown-menu-bofOMeLm.js +1 -0
- package/dist/client/assets/{dynamic-plugin-layout-DCoYGhHP.js → dynamic-plugin-layout-DdC9w75r.js} +1 -1
- package/dist/client/assets/{empty-state-Be0X9mox.js → empty-state-Bl1VCnIe.js} +1 -1
- package/dist/client/assets/{empty-state-DoKR-jUX.js → empty-state-iSyeAylK.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CuIeY90s.js → extract-connection-data-BmWiFxHJ.js} +1 -1
- package/dist/client/assets/{features-38ZozsmE.js → features-BKkpnrxu.js} +1 -1
- package/dist/client/assets/{form-BC40Nvzi.js → form-DABXYYeF.js} +1 -1
- package/dist/client/assets/general-DukQ3tYy.js +1 -0
- package/dist/client/assets/{index-CvarGBFr.js → index-B40-ao-L.js} +1 -1
- package/dist/client/assets/{index-Bcf94soS.js → index-BBoaHd8c.js} +1 -1
- package/dist/client/assets/{index-CbBINyFK.js → index-BOl2sMex.js} +1 -1
- package/dist/client/assets/{index-DXHNyf1g.css → index-B_4-KoG_.css} +1 -1
- package/dist/client/assets/{index-B0TkoX1b.js → index-BscyP7Up.js} +1 -1
- package/dist/client/assets/{index-DjgN9qrV.js → index-C77ixooi.js} +1 -1
- package/dist/client/assets/index-C7yEMUwG.js +1 -0
- package/dist/client/assets/{index-nmtbWm5V.js → index-CA228xnt.js} +2 -2
- package/dist/client/assets/{index-M_qlHNIS.js → index-CeXie2Ys.js} +1 -1
- package/dist/client/assets/{index-Dl2t23Jt.js → index-CzhKzgtD.js} +2 -2
- package/dist/client/assets/index-D3A4ePI7.js +1 -0
- package/dist/client/assets/index-DI9Yp0oo.js +1 -0
- package/dist/client/assets/{index-CwBiuTbX.js → index-DT7Nf9M6.js} +25 -25
- package/dist/client/assets/{index-BBrIielu.js → index-DTr35K1t.js} +1 -1
- package/dist/client/assets/{index-_TsJo9Ju.js → index-DtIEOBO6.js} +5 -5
- package/dist/client/assets/{index-CFyIm5CH.js → index-abagjRmB.js} +1 -1
- package/dist/client/assets/index-iDFI-Ppt.js +1 -0
- package/dist/client/assets/{infiniteQueryObserver-cqTNhL_G.js → infiniteQueryObserver-d4mpZ_Ot.js} +1 -1
- package/dist/client/assets/{input-CluxDyoT.js → input-CNEsKnKX.js} +1 -1
- package/dist/client/assets/{integration-icon-BipCD_m-.js → integration-icon-CSgHR76X.js} +1 -1
- package/dist/client/assets/{label-CHKFYnQo.js → label-9fjD1g94.js} +1 -1
- package/dist/client/assets/{layout-CV5Wi0Ex.js → layout-DEdN-ZCr.js} +1 -1
- package/dist/client/assets/{lean-canvas-recruit-modal-CnBIlbd0.js → lean-canvas-recruit-modal-CEK7JzdS.js} +1 -1
- package/dist/client/assets/{login-DdkQloeb.js → login-C6yxrHRy.js} +1 -1
- package/dist/client/assets/{members-BgSG3QM0.js → members-D68Ow5uj.js} +2 -2
- package/dist/client/assets/{monaco-editor-BfaMmupR.js → monaco-editor-Dndvvjot.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C8V4hqSK.js → monitoring-stats-row-CKay1MEI.js} +1 -1
- package/dist/client/assets/{oauth-callback-BaZqye0L.js → oauth-callback-CaaulaeP.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-oz8YNRBq.js → oauth-callback-ai-provider-ChlN62-d.js} +1 -1
- package/dist/client/assets/{onboarding-WJDxBlF8.js → onboarding-Dx3oU4tF.js} +1 -1
- package/dist/client/assets/{org-layout-Ax0KGzlT.js → org-layout-UCoBgLht.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-C5mxyCcm.js → org-plugin-layout-CqAgklZh.js} +1 -1
- package/dist/client/assets/{pair-JxQa_xAh.js → pair-D1mFwARy.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-C_q24wh6.js → plugin-empty-state-B0cmsL9S.js} +1 -1
- package/dist/client/assets/plugin-header-BI8T-ddq.js +1 -0
- package/dist/client/assets/{plugin-layout-NPftDH-k.js → plugin-layout-B1I7qSQF.js} +1 -1
- package/dist/client/assets/{popover-vU5pf5HQ.js → popover-DJiufSUD.js} +1 -1
- package/dist/client/assets/profile-CGXuDNln.js +1 -0
- package/dist/client/assets/project-app-view-DP_-ui4r.js +1 -0
- package/dist/client/assets/registry-CFvs_APs.js +2 -0
- package/dist/client/assets/{registry-layout-D-sbU1qd.js → registry-layout-DIzJFcIj.js} +2 -2
- package/dist/client/assets/{required-auth-layout-BYto5m3H.js → required-auth-layout-sXjdshcq.js} +1 -1
- package/dist/client/assets/{reset-password-DL944kGr.js → reset-password-cZPjvgcJ.js} +1 -1
- package/dist/client/assets/roles-CkThyhxD.js +1 -0
- package/dist/client/assets/{scroll-area-D4F3EM5Z.js → scroll-area-DM7jZQf0.js} +1 -1
- package/dist/client/assets/{search-input-CslwpPEh.js → search-input-BfUlR4kV.js} +1 -1
- package/dist/client/assets/select-WtZOfOpo.js +1 -0
- package/dist/client/assets/select-model-Cy_Vxqx-.js +4 -0
- package/dist/client/assets/{settings-layout-CFCdg7G4.js → settings-layout-CbLLwkfV.js} +1 -1
- package/dist/client/assets/{settings-section-qcMAXuoQ.js → settings-section-R1g2TNeE.js} +1 -1
- package/dist/client/assets/{shell-layout-CzPr_0c2.js → shell-layout-I_eJIv1K.js} +1 -1
- package/dist/client/assets/{skeleton-eOgaLAHa.js → skeleton-DLLoz0n0.js} +1 -1
- package/dist/client/assets/{sso-Dozga0JK.js → sso-CzSINRFs.js} +1 -1
- package/dist/client/assets/{store-BA7fLJKJ.js → store-BCviRvz9.js} +1 -1
- package/dist/client/assets/store-registry-C9ivXmwu.js +2 -0
- package/dist/client/assets/{switch-W_Nrj6rK.js → switch-BH6A3p0g.js} +1 -1
- package/dist/client/assets/{table-rVVQNhet.js → table-qL_Cu6WT.js} +1 -1
- package/dist/client/assets/{tabs-6T1N4Szc.js → tabs-DIK24gms.js} +1 -1
- package/dist/client/assets/{task-status-DsmpMdW6.js → task-status-Bjp5sDvq.js} +1 -1
- package/dist/client/assets/{textarea-Cld3tG5R.js → textarea-DVl7iYt4.js} +1 -1
- package/dist/client/assets/{toggle-group-COcCk4lG.js → toggle-group-WOk-6cmR.js} +1 -1
- package/dist/client/assets/{tools-list-COvHAWAZ.js → tools-list-BAADgwcR.js} +1 -1
- package/dist/client/assets/{tooltip-CxizQODk.js → tooltip-DSuAs--v.js} +1 -1
- package/dist/client/assets/{types-CvYZZZog.js → types-bCWMch03.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Bt2yRX0n.js → use-ai-providers-B7R2KmGt.js} +1 -1
- package/dist/client/assets/{use-collections-CwD8DZNY.js → use-collections-DFXlD5a6.js} +1 -1
- package/dist/client/assets/{use-connection-pSv7eY2y.js → use-connection-mkdAsO3d.js} +1 -1
- package/dist/client/assets/{use-copy-CHAuyAMC.js → use-copy-C4DghPLz.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-1DfbQRRy.js → use-create-virtual-mcp-ksck6WCZ.js} +1 -1
- package/dist/client/assets/use-debounced-autosave-CLtNf_EP.js +1 -0
- package/dist/client/assets/{use-decopilot-events-CXVUS53e.js → use-decopilot-events-BqnGpCsr.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BNRuOYcY.js → use-delete-connection-CJCTY6PR.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Ca5zEcXn.js → use-infinite-scroll-DyWtuvVN.js} +1 -1
- package/dist/client/assets/{use-list-state-Jttwyvy3.js → use-list-state-DJhZm6uG.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BdYIFx9S.js → use-mcp-tools-CZiN_apo.js} +1 -1
- package/dist/client/assets/{use-members-s6X83kyp.js → use-members-XoLKujIR.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Tn-rhKXX.js → use-navigate-to-agent-BJZA0vn3.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CS0Acn4M.js → use-org-auth-client-DFDdOgNz.js} +1 -1
- package/dist/client/assets/{use-org-sso-CPzDtjox.js → use-org-sso-ntNZ64id.js} +1 -1
- package/dist/client/assets/{use-organization-roles-TW9At1F2.js → use-organization-roles-DvvUCO6J.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Dak2xww8.js → use-organization-settings-BcP9GxNe.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CMFnR2M3.js → use-registry-connections-C3Shxtge.js} +1 -1
- package/dist/client/assets/{use-status-sounds-D0-nlwJm.js → use-status-sounds-BhmdTf72.js} +1 -1
- package/dist/client/assets/{use-tasks-yxuEm5KK.js → use-tasks-CFKcirif.js} +1 -1
- package/dist/client/assets/{use-view-mode-w75x4zz0.js → use-view-mode-DPFNPRhw.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BHEEZv3B.js → use-virtual-mcp-D6IJdvj4.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-nrn6q72G.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BQugVIVu.js +1 -0
- package/dist/client/assets/{user-QrqGbmQG.js → user-s33U8vUh.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-C9HAxT_f.js → view-mode-toggle-DTQbwKIC.js} +1 -1
- package/dist/client/assets/workflow-BNc2v09H.js +1 -0
- package/dist/client/assets/workflow-detail-Dh3EHXZU.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/node_modules/ansi-styles/index.d.ts +236 -0
- package/dist/server/node_modules/ansi-styles/index.js +223 -0
- package/dist/server/node_modules/ansi-styles/package.json +54 -0
- package/dist/server/node_modules/ansi-styles/readme.md +173 -0
- package/dist/server/node_modules/environment/index.d.ts +74 -0
- package/dist/server/node_modules/environment/index.js +47 -0
- package/dist/server/node_modules/environment/package.json +74 -0
- package/dist/server/node_modules/environment/readme.md +94 -0
- package/dist/server/node_modules/escape-string-regexp/index.d.ts +18 -0
- package/dist/server/node_modules/escape-string-regexp/index.js +11 -0
- package/dist/server/node_modules/escape-string-regexp/license +9 -0
- package/dist/server/node_modules/escape-string-regexp/package.json +43 -0
- package/dist/server/node_modules/escape-string-regexp/readme.md +29 -0
- package/dist/server/node_modules/is-unicode-supported/index.d.ts +12 -0
- package/dist/server/node_modules/is-unicode-supported/index.js +21 -0
- package/dist/server/node_modules/is-unicode-supported/license +9 -0
- package/dist/server/node_modules/is-unicode-supported/package.json +47 -0
- package/dist/server/node_modules/is-unicode-supported/readme.md +35 -0
- package/dist/server/node_modules/restore-cursor/index.d.ts +11 -0
- package/dist/server/node_modules/restore-cursor/index.js +11 -0
- package/dist/server/node_modules/restore-cursor/license +9 -0
- package/dist/server/node_modules/restore-cursor/package.json +55 -0
- package/dist/server/node_modules/restore-cursor/readme.md +31 -0
- package/dist/server/node_modules/string-width/index.d.ts +39 -0
- package/dist/server/node_modules/string-width/index.js +82 -0
- package/dist/server/node_modules/string-width/license +9 -0
- package/dist/server/node_modules/string-width/package.json +64 -0
- package/dist/server/node_modules/string-width/readme.md +66 -0
- package/package.json +1 -1
- package/dist/client/assets/ChevronDown-tb8ftSUO.js +0 -1
- package/dist/client/assets/Star01-PFA-ZRDO.js +0 -1
- package/dist/client/assets/agent-icon-BXkkrCT3.js +0 -1
- package/dist/client/assets/agents-list-pk00bfJc.js +0 -1
- package/dist/client/assets/ai-providers-Dveb48ZT.js +0 -1
- package/dist/client/assets/automation-list-row-Uxaz0oZ0.js +0 -1
- package/dist/client/assets/automations-D7r6frZo.js +0 -1
- package/dist/client/assets/brand-context-5BxhNz9E.js +0 -1
- package/dist/client/assets/checkbox-CzxaEVzA.js +0 -1
- package/dist/client/assets/collection-detail-Be4vkD6s.js +0 -1
- package/dist/client/assets/collection-display-button-CPI0oCFf.js +0 -1
- package/dist/client/assets/connection-detail-CPlnEGaw.js +0 -1
- package/dist/client/assets/connections-BhKrBMUX.js +0 -1
- package/dist/client/assets/dropdown-menu-C6XDnng5.js +0 -1
- package/dist/client/assets/general-CvDecDeA.js +0 -1
- package/dist/client/assets/index-B1-8qqRf.js +0 -1
- package/dist/client/assets/index-BycfnvwM.js +0 -1
- package/dist/client/assets/index-DHF2V7ZS.js +0 -1
- package/dist/client/assets/index-DQfkXdA9.js +0 -1
- package/dist/client/assets/plugin-header-CBh0Saol.js +0 -1
- package/dist/client/assets/profile-CW9gorWX.js +0 -1
- package/dist/client/assets/project-app-view-DZI64J4I.js +0 -1
- package/dist/client/assets/registry-Q3WKF7CA.js +0 -2
- package/dist/client/assets/roles-CJua0nhs.js +0 -1
- package/dist/client/assets/select-C0JTp_6a.js +0 -1
- package/dist/client/assets/select-model-D0i0wiFX.js +0 -4
- package/dist/client/assets/store-registry-D0a7tFCj.js +0 -2
- package/dist/client/assets/useInfiniteQuery-3jN4yA7O.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CEYJOeyf.js +0 -1
- package/dist/client/assets/workflow-D70YjEfw.js +0 -1
- package/dist/client/assets/workflow-detail-1NvP9qC0.js +0 -1
- package/dist/server/node_modules/get-east-asian-width/index.d.ts +0 -60
- package/dist/server/node_modules/get-east-asian-width/index.js +0 -30
- package/dist/server/node_modules/get-east-asian-width/lookup-data.js +0 -18
- package/dist/server/node_modules/get-east-asian-width/lookup.js +0 -135
- package/dist/server/node_modules/get-east-asian-width/package.json +0 -71
- package/dist/server/node_modules/get-east-asian-width/readme.md +0 -65
- package/dist/server/node_modules/get-east-asian-width/utilities.js +0 -24
- package/dist/server/node_modules/onetime/index.d.ts +0 -64
- package/dist/server/node_modules/onetime/index.js +0 -44
- package/dist/server/node_modules/onetime/package.json +0 -43
- package/dist/server/node_modules/onetime/readme.md +0 -94
- /package/dist/server/node_modules/{get-east-asian-width → ansi-styles}/license +0 -0
- /package/dist/server/node_modules/{onetime → environment}/license +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as ge,P as ke,j as s,B as pe,s as Ae,r as P,t as w,x as we}from"./index-Dl2t23Jt.js";import{c as U,b as Ce,a as ue,D as xe}from"./dropdown-menu-C6XDnng5.js";import{a as Pe}from"./Users03-DH9QAbco.js";import{G as Te,a as Me,I as Oe,S as ze,L as Le,b as Ie}from"./lean-canvas-recruit-modal-CnBIlbd0.js";import{W as Ee,b as Ge}from"./constants-CfwGLQ49.js";import{b as Be,a as He}from"./use-virtual-mcp-BHEEZv3B.js";import{P as ne}from"./index-Bcf94soS.js";import{i as $e}from"./DotsVertical-DEE8M0V4.js";import{a as Re}from"./Settings02-BOckjEVU.js";import{s as Fe}from"./Trash01-DaGrAtTq.js";import{A as ve,ai as Ve}from"./agent-icon-BXkkrCT3.js";import{a as be}from"./use-navigate-to-agent-Tn-rhKXX.js";import{C as Ne}from"./card-oSxwoJvZ.js";import{f as We}from"./formatDistanceToNow-Cb2QZZJn.js";import{E as Ke}from"./empty-state-Be0X9mox.js";import{u as qe}from"./use-create-virtual-mcp-1DfbQRRy.js";import{c as Je,b as Qe,d as Ue,f as Xe,e as Ye,g as Ze,a as et,A as tt}from"./alert-dialog-BvuFarFf.js";import{S as st}from"./search-input-CslwpPEh.js";import{s as je}from"./Plus-BrBimbff.js";import"./ChevronDown-tb8ftSUO.js";import"./ChevronRight-BIm0-OSp.js";import"./dialog-CoECADf1.js";import"./X-viKat0oa.js";import"./RefreshCcw01-Cr84gVY8.js";import"./collection-search-u94VKjvs.js";import"./SearchMd-IP-R-mtT.js";import"./checkbox-CzxaEVzA.js";import"./use-connection-pSv7eY2y.js";import"./use-collections-CwD8DZNY.js";import"./Lock01-BmjkKSvK.js";import"./extract-connection-data-CuIeY90s.js";import"./constants-CVDNjJTw.js";import"./collections-Cn7VbUFT.js";import"./drawer-DTk8g2vK.js";import"./tooltip-CxizQODk.js";import"./integration-icon-BipCD_m-.js";import"./Container-BCDxdJoG.js";import"./use-mcp-tools-BdYIFx9S.js";import"./AlertCircle-CbUYZGF-.js";import"./Tool01-D1Rvo01i.js";import"./XClose-DY7O9VST.js";import"./ArrowNarrowLeft-DHj5-FLY.js";import"./XCircle-DZEMwZj2.js";import"./ArrowUpRight-BK_iYZ-J.js";import"./ZapSquare-BDbWe-zU.js";import"./CheckCircle-D9qlmIve.js";import"./ChevronUp-ClqSoLtD.js";import"./Star01-PFA-ZRDO.js";import"./Palette-BrJL0UcN.js";import"./LinkExternal01-DM7IwrPj.js";import"./Sun-B7BWJEHb.js";import"./Play-DSYx2GJ2.js";import"./Shield01-CJggUHAQ.js";import"./User01-DmtseI1g.js";import"./Zap-BMzMPNv3.js";import"./differenceInSeconds-NQ4PDo0z.js";function _e(e){const t=ge.c(17),{onCreateFromScratch:i,onImportGitHub:g,onImportDeco:d,isCreating:o,align:j,side:f,showBetaBadge:p}=e,r=j===void 0?"end":j,[n]=ke();let u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Pe,{size:14}),t[0]=u):u=t[0];let c;t[1]!==o||t[2]!==i?(c=s.jsxs(U,{disabled:o,onClick:i,children:[u,"Create from scratch"]}),t[1]=o,t[2]=i,t[3]=c):c=t[3];let a;t[4]!==g||t[5]!==n.experimental_vibecode||t[6]!==p?(a=n.experimental_vibecode&&s.jsxs(U,{onClick:g,children:[s.jsx(Te,{className:"size-3.5"}),"Import from GitHub",p&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"})]}),t[4]=g,t[5]=n.experimental_vibecode,t[6]=p,t[7]=a):a=t[7];let x;t[8]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),t[8]=x):x=t[8];let m;t[9]!==d?(m=s.jsxs(U,{onClick:d,children:[x,"Import from deco.cx"]}),t[9]=d,t[10]=m):m=t[10];let _;return t[11]!==r||t[12]!==f||t[13]!==c||t[14]!==a||t[15]!==m?(_=s.jsxs(Ce,{side:f,align:r,className:"w-48",children:[c,a,m]}),t[11]=r,t[12]=f,t[13]=c,t[14]=a,t[15]=m,t[16]=_):_=t[16],_}function it(e){const t=ge.c(44),{project:i,onDeleteClick:g}=e,d=be();let o;t[0]!==d||t[1]!==i.id?(o=()=>d(i.id),t[0]=d,t[1]=i.id,t[2]=o):o=t[2];let j;t[3]!==i.title||t[4]!==o?(j=s.jsx("button",{type:"button",onClick:o,className:"absolute inset-0 z-0","aria-label":i.title}),t[3]=i.title,t[4]=o,t[5]=j):j=t[5];let f;t[6]!==i.icon||t[7]!==i.title?(f=s.jsx(ve,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),t[6]=i.icon,t[7]=i.title,t[8]=f):f=t[8];let p;t[9]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ue,{asChild:!0,children:s.jsx(pe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx($e,{size:20})})}),t[9]=p):p=t[9];let r;t[10]!==d||t[11]!==i.id?(r=()=>d(i.id,{search:{main:"settings"}}),t[10]=d,t[11]=i.id,t[12]=r):r=t[12];let n;t[13]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Re,{size:16}),t[13]=n):n=t[13];let u;t[14]!==r?(u=s.jsxs(U,{onClick:r,children:[n,"Settings"]}),t[14]=r,t[15]=u):u=t[15];let c;t[16]!==g?(c=g&&s.jsxs(U,{variant:"destructive",onClick:y=>{y.stopPropagation(),g(y)},children:[s.jsx(Fe,{size:16}),"Delete"]}),t[16]=g,t[17]=c):c=t[17];let a;t[18]!==u||t[19]!==c?(a=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(xe,{children:[p,s.jsxs(Ce,{align:"end",children:[u,c]})]})}),t[18]=u,t[19]=c,t[20]=a):a=t[20];let x;t[21]!==f||t[22]!==a?(x=s.jsxs("div",{className:"flex items-start justify-between",children:[f,a]}),t[21]=f,t[22]=a,t[23]=x):x=t[23];let m;t[24]!==i.title?(m=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),t[24]=i.title,t[25]=m):m=t[25];const _=i.description||"No description";let N;t[26]!==_?(N=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:_}),t[26]=_,t[27]=N):N=t[27];let v;t[28]!==m||t[29]!==N?(v=s.jsxs("div",{className:"flex flex-col gap-1",children:[m,N]}),t[28]=m,t[29]=N,t[30]=v):v=t[30];let D;t[31]!==x||t[32]!==v?(D=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[x,v]}),t[31]=x,t[32]=v,t[33]=D):D=t[33];let b;t[34]!==i.updated_at?(b=We(new Date(i.updated_at),{addSuffix:!0}),t[34]=i.updated_at,t[35]=b):b=t[35];let S;t[36]!==b?(S=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:b})})}),t[36]=b,t[37]=S):S=t[37];let h;t[38]!==D||t[39]!==S?(h=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[D,S]}),t[38]=D,t[39]=S,t[40]=h):h=t[40];let C;return t[41]!==h||t[42]!==j?(C=s.jsxs(Ne,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[j,h]}),t[41]=h,t[42]=j,t[43]=C):C=t[43],C}function cs(){const e=ge.c(80),{org:t}=Ae(),i=Be(),g=He(),d=be(),[o,j]=P.useState("");let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},e[0]=f):f=e[0];const{createVirtualMCP:p,isCreating:r}=qe(f),[n,u]=P.useState(null),[c,a]=P.useState(!1),[x,m]=P.useState(!1),[_,N]=P.useState(!1),[v,D]=P.useState(!1),[b,S]=P.useState(!1);let h,C,y,T,k,A,M,O,z;if(e[1]!==g||e[2]!==i||e[3]!==p||e[4]!==n||e[5]!==r||e[6]!==d||e[7]!==t||e[8]!==o){const Q=o.toLowerCase(),de=i.filter(l=>l.id!==t.id&&(l.title.toLowerCase().includes(Q)||l.description?.toLowerCase().includes(Q)));let te;e[18]!==i?(te=i.some(at),e[18]=i,e[19]=te):te=e[19];const De=te,fe=Ee.filter(l=>(!o||l.title.toLowerCase().includes(Q))&&!(l.id==="studio-pack"&&De)),he=i.find(ot);k=i.find(lt);const Se=l=>{w("agents_list_template_clicked",{template_id:l}),l==="site-editor"?a(!0):l==="site-diagnostics"?he?d(he.id):N(!0):l==="lean-canvas"?k?d(k.id):S(!0):l==="studio-pack"&&D(!0)};let se;e[20]!==g||e[21]!==n?(se=async()=>{if(!n)return;const{id:l,title:ye}=n;u(null);try{await g.delete.mutateAsync(l),w("agent_deleted",{agent_id:l,source:"agents_list"}),we.success(`Deleted "${ye}"`)}catch{}},e[20]=g,e[21]=n,e[22]=se):se=e[22],T=se,y=ne,C=ne.Content,h=ne.Body;let ie;e[23]===Symbol.for("react.memo_cache_sentinel")?(ie=s.jsx(ne.Title,{children:"Agents"}),e[23]=ie):ie=e[23];let le;e[24]===Symbol.for("react.memo_cache_sentinel")?(le=l=>{l.key==="Escape"&&(j(""),l.target.blur())},e[24]=le):le=e[24];let K;e[25]!==o?(K=s.jsx(st,{value:o,onChange:j,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:le}),e[25]=o,e[26]=K):K=e[26];let oe;e[27]===Symbol.for("react.memo_cache_sentinel")?(oe=s.jsx(ue,{asChild:!0,children:s.jsxs(pe,{size:"sm",children:[s.jsx(je,{size:14}),"Create Agent"]})}),e[27]=oe):oe=e[27];let q;e[28]!==p?(q=()=>{w("agent_create_clicked",{source:"agents_list",method:"scratch"}),p()},e[28]=p,e[29]=q):q=e[29];let ae,re;e[30]===Symbol.for("react.memo_cache_sentinel")?(ae=()=>{w("agent_create_clicked",{source:"agents_list",method:"github"}),m(!0)},re=()=>{w("agent_create_clicked",{source:"agents_list",method:"deco"}),a(!0)},e[30]=ae,e[31]=re):(ae=e[30],re=e[31]);let J;e[32]!==r||e[33]!==q?(J=s.jsxs(xe,{children:[oe,s.jsx(_e,{onCreateFromScratch:q,onImportGitHub:ae,onImportDeco:re,isCreating:r,align:"end"})]}),e[32]=r,e[33]=q,e[34]=J):J=e[34],e[35]!==J||e[36]!==K?(A=s.jsxs("div",{className:"flex flex-col gap-6",children:[ie,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[K,J]})]}),e[35]=J,e[36]=K,e[37]=A):A=e[37],M=de.length===0&&fe.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Ke,{image:s.jsx(Ve,{size:48,className:"text-muted-foreground"}),title:o?"No agents found":"No agents yet",description:o?`No agents match "${o}"`:"Create an agent to get started.",actions:!o&&s.jsxs(xe,{children:[s.jsx(ue,{asChild:!0,children:s.jsxs(pe,{size:"sm",children:[s.jsx(je,{size:14}),"Create Agent"]})}),s.jsx(_e,{onCreateFromScratch:()=>{w("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),p()},onImportGitHub:()=>{w("agent_create_clicked",{source:"agents_list_empty",method:"github"}),m(!0)},onImportDeco:()=>{w("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),a(!0)},isCreating:r,align:"center",showBetaBadge:!0})]})})}),O=de.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:de.map(l=>s.jsx(it,{project:l,onDeleteClick:()=>u({id:l.id,title:l.title})},l.id))})]}),z=fe.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agent Templates"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:fe.map(l=>s.jsx(Ne,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50 cursor-pointer",onClick:()=>Se(l.id),children:s.jsx("div",{className:"flex flex-col flex-1",children:s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[s.jsx(ve,{icon:l.icon,name:l.title,size:"sm",className:"shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:l.title}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Click to set up"})]})]})})},l.id))})]}),e[1]=g,e[2]=i,e[3]=p,e[4]=n,e[5]=r,e[6]=d,e[7]=t,e[8]=o,e[9]=h,e[10]=C,e[11]=y,e[12]=T,e[13]=k,e[14]=A,e[15]=M,e[16]=O,e[17]=z}else h=e[9],C=e[10],y=e[11],T=e[12],k=e[13],A=e[14],M=e[15],O=e[16],z=e[17];let L;e[38]!==h||e[39]!==A||e[40]!==M||e[41]!==O||e[42]!==z?(L=s.jsxs(h,{children:[A,M,O,z]}),e[38]=h,e[39]=A,e[40]=M,e[41]=O,e[42]=z,e[43]=L):L=e[43];let I;e[44]!==C||e[45]!==L?(I=s.jsx(C,{children:L}),e[44]=C,e[45]=L,e[46]=I):I=e[46];let E;e[47]!==x?(E=s.jsx(Me,{open:x,onOpenChange:m}),e[47]=x,e[48]=E):E=e[48];let G;e[49]!==c?(G=s.jsx(Oe,{open:c,onOpenChange:a}),e[49]=c,e[50]=G):G=e[50];let B;e[51]!==_?(B=s.jsx(ze,{open:_,onOpenChange:N}),e[51]=_,e[52]=B):B=e[52];let H;e[53]!==k||e[54]!==b?(H=s.jsx(Le,{open:b,onOpenChange:S,existingAgent:k}),e[53]=k,e[54]=b,e[55]=H):H=e[55];let $;e[56]!==v?($=s.jsx(Ie,{open:v,onOpenChange:D}),e[56]=v,e[57]=$):$=e[57];const ce=!!n;let X;e[58]===Symbol.for("react.memo_cache_sentinel")?(X=Q=>!Q&&u(null),e[58]=X):X=e[58];let Y;e[59]===Symbol.for("react.memo_cache_sentinel")?(Y=s.jsx(Je,{children:"Delete Agent?"}),e[59]=Y):Y=e[59];const me=n?.title;let R;e[60]!==me?(R=s.jsxs(Qe,{children:[Y,s.jsxs(Ue,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:me}),"."]})]}),e[60]=me,e[61]=R):R=e[61];let Z;e[62]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsx(Xe,{children:"Cancel"}),e[62]=Z):Z=e[62];let F;e[63]!==T?(F=s.jsxs(Ye,{children:[Z,s.jsx(Ze,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[63]=T,e[64]=F):F=e[64];let V;e[65]!==R||e[66]!==F?(V=s.jsxs(et,{children:[R,F]}),e[65]=R,e[66]=F,e[67]=V):V=e[67];let W;e[68]!==ce||e[69]!==V?(W=s.jsx(tt,{open:ce,onOpenChange:X,children:V}),e[68]=ce,e[69]=V,e[70]=W):W=e[70];let ee;return e[71]!==y||e[72]!==H||e[73]!==$||e[74]!==W||e[75]!==I||e[76]!==E||e[77]!==G||e[78]!==B?(ee=s.jsxs(y,{children:[I,E,G,B,H,$,W]}),e[71]=y,e[72]=H,e[73]=$,e[74]=W,e[75]=I,e[76]=E,e[77]=G,e[78]=B,e[79]=ee):ee=e[79],ee}function lt(e){return e.metadata?.type==="lean-canvas"}function ot(e){return e.metadata?.type==="site-diagnostics"}function at(e){return Ge(e.id)}export{cs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as t,j as i}from"./index-Dl2t23Jt.js";import{O as m}from"./select-model-D0i0wiFX.js";import"./checkbox-CzxaEVzA.js";import"./ChevronDown-tb8ftSUO.js";import"./input-CluxDyoT.js";import"./dialog-CoECADf1.js";import"./X-viKat0oa.js";import"./drawer-DTk8g2vK.js";import"./tooltip-CxizQODk.js";import"./select-C0JTp_6a.js";import"./ChevronUp-ClqSoLtD.js";import"./skeleton-eOgaLAHa.js";import"./Tool01-D1Rvo01i.js";import"./RefreshCcw01-Cr84gVY8.js";import"./SearchMd-IP-R-mtT.js";import"./Settings02-BOckjEVU.js";import"./use-ai-providers-Bt2yRX0n.js";import"./constants-CfwGLQ49.js";import"./chat-context-C4Hx_rZK.js";import"./use-virtual-mcp-BHEEZv3B.js";import"./use-collections-CwD8DZNY.js";import"./use-decopilot-events-CXVUS53e.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-yxuEm5KK.js";import"./use-organization-settings-Dak2xww8.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Zap-BMzMPNv3.js";import"./AlertCircle-CbUYZGF-.js";import"./CheckCircle-D9qlmIve.js";import"./Trash01-DaGrAtTq.js";import"./index-Bcf94soS.js";import"./settings-section-qcMAXuoQ.js";import"./card-oSxwoJvZ.js";import"./ArrowUpRight-BK_iYZ-J.js";import"./switch-W_Nrj6rK.js";import"./toggle-group-COcCk4lG.js";import"./avatar-C4FRugJb.js";import"./User01-DmtseI1g.js";import"./alert-dialog-BvuFarFf.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./unwrap-tool-result-BYXdCQMg.js";function T(){const o=t.c(1);let r;return o[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(m,{}),o[0]=r):r=o[0],r}export{T as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as P,s as q,K as k,n as L,o as z,a as K,x as M,r as U,c as Q,j as o,B}from"./index-Dl2t23Jt.js";import{b as V,d as H,e as Y,g as J,c as W,f as X,a as Z,A as ee}from"./alert-dialog-BvuFarFf.js";import{a as te,D as se,b as ne,c as ie}from"./dropdown-menu-C6XDnng5.js";import{A as oe,x as re}from"./agent-icon-BXkkrCT3.js";import{i as ae}from"./DotsVertical-DEE8M0V4.js";import{s as le}from"./Trash01-DaGrAtTq.js";import{i as ce}from"./Zap-BMzMPNv3.js";import{u as ue}from"./use-virtual-mcp-BHEEZv3B.js";import{S as $,u as G}from"./constants-CfwGLQ49.js";function me(t){if(t.paramsSchema&&typeof t.paramsSchema=="object")return t;const e={};if(Array.isArray(t.params))for(const s of t.params)e[s.name]={type:s.type,description:s.description,enum:s.enum};else t.params&&typeof t.params=="object"&&Object.assign(e,t.params);return{type:t.type,description:t.description,paramsSchema:e}}function Ee(t){const e=P.c(12),{org:s}=q(),n=t??$;let r;e[0]!==s.id||e[1]!==s.slug||e[2]!==n?(r={connectionId:n,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=n,e[3]=r):r=e[3];const a=G(r);let i;e[4]!==t?(i=k.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=i):i=e[5];let u;e[6]!==a?(u=async()=>{const g=await a.callTool({name:"TRIGGER_LIST",arguments:{}});return(g.structuredContent??g).triggers.map(me)},e[6]=a,e[7]=u):u=e[7];const l=!!t;let d;return e[8]!==i||e[9]!==u||e[10]!==l?(d={queryKey:i,queryFn:u,enabled:l,staleTime:3e4},e[8]=i,e[9]=u,e[10]=l,e[11]=d):d=e[11],L(d)}function Se(t){const e=P.c(12),{org:s}=q();let n;e[0]!==s.id||e[1]!==s.slug?(n={connectionId:$,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const r=G(n);let a;e[3]!==s.id||e[4]!==t?(a=k.automations(s.id,t),e[3]=s.id,e[4]=t,e[5]=a):a=e[5];let i;e[6]!==r||e[7]!==t?(i=async()=>{const l=t!=null?{virtual_mcp_id:t}:{},d=await r.callTool({name:"AUTOMATION_LIST",arguments:l});return(d.structuredContent??d).automations},e[6]=r,e[7]=t,e[8]=i):i=e[8];let u;return e[9]!==a||e[10]!==i?(u={queryKey:a,queryFn:i,staleTime:1e4},e[9]=a,e[10]=i,e[11]=u):u=e[11],L(u)}function Oe(t){const e=P.c(13),{org:s}=q();let n;e[0]!==s.id||e[1]!==s.slug?(n={connectionId:$,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=n):n=e[2];const r=G(n);let a;e[3]!==t||e[4]!==s.id?(a=k.automation(s.id,t),e[3]=t,e[4]=s.id,e[5]=a):a=e[5];let i;e[6]!==r||e[7]!==t?(i=async()=>{const d=await r.callTool({name:"AUTOMATION_GET",arguments:{id:t}});return(d.structuredContent??d).automation},e[6]=r,e[7]=t,e[8]=i):i=e[8];const u=!!t;let l;return e[9]!==a||e[10]!==i||e[11]!==u?(l={queryKey:a,queryFn:i,enabled:u,staleTime:1e4},e[9]=a,e[10]=i,e[11]=u,e[12]=l):l=e[12],L(l)}function we(t){return{name:"New Automation",messages:[],models:{credentialId:"",thinking:{id:""}},temperature:.5,active:!0,virtual_mcp_id:t}}function de(){const t=P.c(55),{org:e}=q();let s;t[0]!==e.id||t[1]!==e.slug?(s={connectionId:$,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=s):s=t[2];const n=G(s),r=z();let a;t[3]!==e.id||t[4]!==r?(a=()=>r.invalidateQueries({queryKey:k.automationsAll(e.id)}),t[3]=e.id,t[4]=r,t[5]=a):a=t[5];const i=a;let u;t[6]!==e.id||t[7]!==r?(u=m=>r.invalidateQueries({queryKey:k.automation(e.id,m)}),t[6]=e.id,t[7]=r,t[8]=u):u=t[8];const l=u;let d;t[9]!==n?(d=async m=>{const c=await n.callTool({name:"AUTOMATION_CREATE",arguments:m});return c.structuredContent??c},t[9]=n,t[10]=d):d=t[10];let g;t[11]!==i?(g=()=>{i()},t[11]=i,t[12]=g):g=t[12];let C;t[13]!==d||t[14]!==g?(C={mutationFn:d,onSuccess:g,onError:pe},t[13]=d,t[14]=g,t[15]=C):C=t[15];const F=K(C);let D;t[16]!==n?(D=async m=>{const c=await n.callTool({name:"AUTOMATION_UPDATE",arguments:m});return c.structuredContent??c},t[16]=n,t[17]=D):D=t[17];let f;t[18]!==i||t[19]!==l?(f=(m,c)=>{i(),typeof c.id=="string"&&l(c.id)},t[18]=i,t[19]=l,t[20]=f):f=t[20];let S;t[21]!==D||t[22]!==f?(S={mutationFn:D,onSuccess:f,onError:fe},t[21]=D,t[22]=f,t[23]=S):S=t[23];const v=K(S);let p;t[24]!==n?(p=async m=>{const c=await n.callTool({name:"AUTOMATION_DELETE",arguments:{id:m}});return c.structuredContent??c},t[24]=n,t[25]=p):p=t[25];let x;t[26]!==i||t[27]!==e.id||t[28]!==r?(x=(m,c)=>{r.removeQueries({queryKey:k.automation(e.id,c)}),i()},t[26]=i,t[27]=e.id,t[28]=r,t[29]=x):x=t[29];let A;t[30]!==x||t[31]!==p?(A={mutationFn:p,onSuccess:x,onError:ge},t[30]=x,t[31]=p,t[32]=A):A=t[32];const N=K(A);let _;t[33]!==n?(_=async m=>{const c=await n.callTool({name:"AUTOMATION_TRIGGER_ADD",arguments:m});if(c.isError){const R=c.content?.[0]?.text??"Failed to add trigger";throw new Error(R)}return c.structuredContent??c},t[33]=n,t[34]=_):_=t[34];let y;t[35]!==i||t[36]!==l?(y=m=>{i(),l(m.automation_id)},t[35]=i,t[36]=l,t[37]=y):y=t[37];let E;t[38]!==_||t[39]!==y?(E={mutationFn:_,onSuccess:y},t[38]=_,t[39]=y,t[40]=E):E=t[40];const O=K(E);let h;t[41]!==n?(h=async m=>{const c=await n.callTool({name:"AUTOMATION_TRIGGER_REMOVE",arguments:{trigger_id:m.trigger_id}});return c.structuredContent??c},t[41]=n,t[42]=h):h=t[42];let T;t[43]!==i||t[44]!==l?(T=(m,c)=>{i(),l(c.automation_id)},t[43]=i,t[44]=l,t[45]=T):T=t[45];let j;t[46]!==h||t[47]!==T?(j={mutationFn:h,onSuccess:T},t[46]=h,t[47]=T,t[48]=j):j=t[48];const w=K(j);let b;return t[49]!==F||t[50]!==N||t[51]!==O||t[52]!==w||t[53]!==v?(b={create:F,update:v,remove:N,triggerAdd:O,triggerRemove:w},t[49]=F,t[50]=N,t[51]=O,t[52]=w,t[53]=v,t[54]=b):b=t[54],b}function ge(t){M.error(t instanceof Error?t.message:"Failed to delete automation")}function fe(t){M.error(t instanceof Error?t.message:"Failed to update automation")}function pe(t){M.error(t instanceof Error?t.message:"Failed to create automation")}function Fe(t){const e=P.c(51),{automation:s,showAgent:n,onClick:r}=t,{remove:a}=de(),[i,u]=U.useState(!1),l=ue(n?s.virtual_mcp_id:void 0);let d;e[0]!==s.id||e[1]!==a?(d=()=>{a.mutate(s.id),u(!1)},e[0]=s.id,e[1]=a,e[2]=d):d=e[2];const g=d;let C;e[3]!==r?(C=I=>{I.target===I.currentTarget&&(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),r())},e[3]=r,e[4]=C):C=e[4];const F=C,D=s.active&&s.trigger_count>0?"bg-emerald-500":"bg-muted-foreground/40";let f;e[5]!==D?(f=Q("inline-block size-2 rounded-full shrink-0",D),e[5]=D,e[6]=f):f=e[6];const S=s.active&&s.trigger_count>0?"Active":s.active?"No triggers configured":"Paused";let v;e[7]!==f||e[8]!==S?(v=o.jsx("span",{className:f,"aria-label":S}),e[7]=f,e[8]=S,e[9]=v):v=e[9];let p;e[10]!==l||e[11]!==n?(p=n&&l&&o.jsx(oe,{icon:l.icon??null,name:l.title,size:"xs",className:"shrink-0"}),e[10]=l,e[11]=n,e[12]=p):p=e[12];let x;e[13]!==s.name?(x=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[13]=s.name,e[14]=x):x=e[14];let A;e[15]!==l||e[16]!==n?(A=n&&l&&o.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",l.title]}),e[15]=l,e[16]=n,e[17]=A):A=e[17];let N;e[18]!==x||e[19]!==A?(N=o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,A]}),e[18]=x,e[19]=A,e[20]=N):N=e[20];let _;e[21]!==s.nearest_next_run_at||e[22]!==s.trigger_count?(_=o.jsx(ye,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[21]=s.nearest_next_run_at,e[22]=s.trigger_count,e[23]=_):_=e[23];let y;e[24]!==N||e[25]!==_?(y=o.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[N,_]}),e[24]=N,e[25]=_,e[26]=y):y=e[26];let E;e[27]===Symbol.for("react.memo_cache_sentinel")?(E=o.jsx(te,{asChild:!0,children:o.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:o.jsx(ae,{size:16})})}),e[27]=E):E=e[27];let O;e[28]===Symbol.for("react.memo_cache_sentinel")?(O=o.jsx("div",{onClick:_e,onKeyDown:xe,role:"presentation",className:"shrink-0",children:o.jsxs(se,{children:[E,o.jsx(ne,{align:"end",children:o.jsxs(ie,{variant:"destructive",onClick:I=>{I.stopPropagation(),u(!0)},children:[o.jsx(le,{size:16}),"Delete"]})})]})}),e[28]=O):O=e[28];let h;e[29]!==F||e[30]!==r||e[31]!==y||e[32]!==v||e[33]!==p?(h=o.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:F,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[v,p,y,O]}),e[29]=F,e[30]=r,e[31]=y,e[32]=v,e[33]=p,e[34]=h):h=e[34];let T;e[35]===Symbol.for("react.memo_cache_sentinel")?(T=o.jsx(W,{children:"Delete automation?"}),e[35]=T):T=e[35];let j;e[36]!==s.name?(j=o.jsxs(V,{children:[T,o.jsxs(H,{children:["This removes"," ",o.jsx("span",{className:"font-medium text-foreground",children:s.name})," ","and all of its triggers. This action cannot be undone."]})]}),e[36]=s.name,e[37]=j):j=e[37];let w;e[38]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(X,{children:"Cancel"}),e[38]=w):w=e[38];let b;e[39]!==g||e[40]!==a.isPending?(b=o.jsxs(Y,{children:[w,o.jsx(J,{onClick:g,disabled:a.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[39]=g,e[40]=a.isPending,e[41]=b):b=e[41];let m;e[42]!==j||e[43]!==b?(m=o.jsxs(Z,{children:[j,b]}),e[42]=j,e[43]=b,e[44]=m):m=e[44];let c;e[45]!==i||e[46]!==m?(c=o.jsx(ee,{open:i,onOpenChange:u,children:m}),e[45]=i,e[46]=m,e[47]=c):c=e[47];let R;return e[48]!==h||e[49]!==c?(R=o.jsxs(o.Fragment,{children:[h,c]}),e[48]=h,e[49]=c,e[50]=R):R=e[50],R}function xe(t){return t.stopPropagation()}function _e(t){return t.stopPropagation()}function ye(t){const e=P.c(4),{triggerCount:s,nextRunAt:n}=t;if(s===0){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx("span",{className:"text-xs text-muted-foreground",children:"No triggers configured"}),e[0]=a):a=e[0],a}let r;return e[1]!==n||e[2]!==s?(r=o.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:n?o.jsxs(o.Fragment,{children:[o.jsx(re,{size:12,className:"shrink-0"}),o.jsxs("span",{className:"truncate",children:["Next run ",new Date(n).toLocaleString()]})]}):o.jsxs(o.Fragment,{children:[o.jsx(ce,{size:12,className:"shrink-0"}),o.jsxs("span",{className:"truncate",children:[s," trigger",s===1?"":"s"]})]})}),e[1]=n,e[2]=s,e[3]=r):r=e[3],r}export{Fe as A,Ee as a,Oe as b,Se as c,we as d,de as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as L,s as R,f as T,r as M,j as e,B as $,t as A}from"./index-Dl2t23Jt.js";import{s as O}from"./Plus-BrBimbff.js";import{i as S}from"./Zap-BMzMPNv3.js";import{S as V}from"./search-input-CslwpPEh.js";import{P as p}from"./index-Bcf94soS.js";import{E as b}from"./empty-state-Be0X9mox.js";import{c as q,A as D}from"./automation-list-row-Uxaz0oZ0.js";import{a as F}from"./use-navigate-to-agent-Tn-rhKXX.js";import{b as G}from"./use-virtual-mcp-BHEEZv3B.js";import"./SearchMd-IP-R-mtT.js";import"./tooltip-CxizQODk.js";import"./X-viKat0oa.js";import"./alert-dialog-BvuFarFf.js";import"./dropdown-menu-C6XDnng5.js";import"./ChevronDown-tb8ftSUO.js";import"./ChevronRight-BIm0-OSp.js";import"./DotsVertical-DEE8M0V4.js";import"./agent-icon-BXkkrCT3.js";import"./AlertCircle-CbUYZGF-.js";import"./Tool01-D1Rvo01i.js";import"./XClose-DY7O9VST.js";import"./RefreshCcw01-Cr84gVY8.js";import"./ArrowNarrowLeft-DHj5-FLY.js";import"./XCircle-DZEMwZj2.js";import"./ArrowUpRight-BK_iYZ-J.js";import"./ZapSquare-BDbWe-zU.js";import"./Users03-DH9QAbco.js";import"./CheckCircle-D9qlmIve.js";import"./ChevronUp-ClqSoLtD.js";import"./Container-BCDxdJoG.js";import"./Star01-PFA-ZRDO.js";import"./Palette-BrJL0UcN.js";import"./LinkExternal01-DM7IwrPj.js";import"./Lock01-BmjkKSvK.js";import"./Sun-B7BWJEHb.js";import"./Play-DSYx2GJ2.js";import"./Settings02-BOckjEVU.js";import"./Shield01-CJggUHAQ.js";import"./Trash01-DaGrAtTq.js";import"./User01-DmtseI1g.js";import"./constants-CfwGLQ49.js";import"./use-collections-CwD8DZNY.js";function Lt(){const t=L.c(18),{org:u}=R(),{data:N}=q(void 0),d=N===void 0?[]:N,B=G(),f=F(),g=T(),[x,k]=M.useState(""),h=x.toLowerCase(),E=new Map(B.map(H)),y=d.filter(o=>{if(!h||o.name.toLowerCase().includes(h))return!0;const a=E.get(o.virtual_mcp_id);return!!(a&&a.title.toLowerCase().includes(h))});let n;t[0]!==f?(n=(o,a)=>{A("automations_list_row_clicked",{automation_id:o,agent_id:a,source:"settings_automations"}),f(a,{search:{main:"automation:"+o}})},t[0]=f,t[1]=n):n=t[1];const P=n;let m;t[2]!==g||t[3]!==u.slug?(m=()=>{A("automations_empty_state_browse_agents_clicked"),g({to:"/$org/settings/agents",params:{org:u.slug}})},t[2]=g,t[3]=u.slug,t[4]=m):m=t[4];const z=m,j=p,w=p,v=p;let c;t[5]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsx(p.Title,{children:"Automations"}),t[5]=c):c=t[5];const _=d.length>0&&e.jsx(V,{value:x,onChange:k,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let s;t[6]!==_?(s=e.jsxs("div",{className:"flex flex-col gap-6",children:[c,_]}),t[6]=_,t[7]=s):s=t[7];const C=d.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(b,{image:e.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:e.jsxs($,{size:"sm",onClick:z,children:[e.jsx(O,{size:14}),"Browse agents"]})})}):y.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(b,{image:e.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${x}"`})}):e.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:y.map(o=>e.jsx(D,{automation:o,showAgent:!0,onClick:()=>P(o.id,o.virtual_mcp_id)},o.id))});let i;t[8]!==v.Body||t[9]!==s||t[10]!==C?(i=e.jsxs(v.Body,{children:[s,C]}),t[8]=v.Body,t[9]=s,t[10]=C,t[11]=i):i=t[11];let r;t[12]!==w.Content||t[13]!==i?(r=e.jsx(w.Content,{children:i}),t[12]=w.Content,t[13]=i,t[14]=r):r=t[14];let l;return t[15]!==j||t[16]!==r?(l=e.jsx(j,{children:r}),t[15]=j,t[16]=r,t[17]=l):l=t[17],l}function H(t){return[t.id,t]}export{Lt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as q,$ as ke,s as we,o as Se,K as je,n as Ee,a as ce,j as n,B as ve,t as Y,x as K,r as C,c as xe}from"./index-Dl2t23Jt.js";import{S as De,u as Ae}from"./constants-CfwGLQ49.js";import{t as Be,i as Oe}from"./ChevronDown-tb8ftSUO.js";import{i as Te}from"./ChevronRight-BIm0-OSp.js";import{s as Ie,t as Fe,i as Pe}from"./Star01-PFA-ZRDO.js";import{n as Re}from"./LinkExternal01-DM7IwrPj.js";import{s as ye}from"./Plus-BrBimbff.js";import{s as $e}from"./Trash01-DaGrAtTq.js";import{i as ze}from"./X-viKat0oa.js";import{i as Le}from"./Zap-BMzMPNv3.js";import{c as Ue,b as Ke,d as Xe,f as qe,g as Ge,e as Me,a as He,A as Qe}from"./alert-dialog-BvuFarFf.js";import{I as M}from"./input-CluxDyoT.js";import{T as Ye}from"./textarea-Cld3tG5R.js";import{P as ue}from"./index-Bcf94soS.js";import{u as Ne}from"./unwrap-tool-result-BYXdCQMg.js";import"./tooltip-CxizQODk.js";function ge(s){const e=q.c(17),{title:t,children:m,onEdit:o,editing:f,onSave:u,onCancel:l,className:p}=s,v=f&&"ring-2 ring-ring/30";let c;e[0]!==p||e[1]!==v?(c=xe("group relative rounded-2xl border border-border/60 bg-background p-5",v,p),e[0]=p,e[1]=v,e[2]=c):c=e[2];let h;e[3]!==t?(h=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:t}),e[3]=t,e[4]=h):h=e[4];let d;e[5]!==f||e[6]!==l||e[7]!==o||e[8]!==u?(d=f?n.jsxs("div",{className:"flex gap-1",children:[n.jsx("button",{type:"button",onClick:l,className:"flex h-7 w-7 items-center justify-center rounded-lg bg-muted hover:bg-muted-foreground/15",children:n.jsx(ze,{size:13,className:"text-muted-foreground"})}),n.jsx("button",{type:"button",onClick:u,className:"flex h-7 w-7 items-center justify-center rounded-lg bg-primary/10 hover:bg-primary/20",children:n.jsx(Oe,{size:13,className:"text-primary"})})]}):o&&n.jsx("button",{type:"button",onClick:o,className:"flex h-7 w-7 items-center justify-center rounded-lg bg-muted opacity-0 transition-opacity duration-150 hover:bg-muted-foreground/15 group-hover:opacity-100",children:n.jsx(Pe,{size:13,className:"text-muted-foreground"})}),e[5]=f,e[6]=l,e[7]=o,e[8]=u,e[9]=d):d=e[9];let a;e[10]!==h||e[11]!==d?(a=n.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[h,d]}),e[10]=h,e[11]=d,e[12]=a):a=e[12];let x;return e[13]!==m||e[14]!==c||e[15]!==a?(x=n.jsxs("div",{className:c,children:[a,m]}),e[13]=m,e[14]=c,e[15]=a,e[16]=x):x=e[16],x}function Je(s){const e=q.c(25),{onExtract:t,isExtracting:m}=s,[o,f]=C.useState("");let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(Le,{size:18,className:"text-primary"})}),e[0]=u):u=e[0];let l,p;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Auto-extract brand context"}),p=n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Enter your website URL and we'll automatically extract your brand colors, fonts, logos, and company overview."}),e[1]=l,e[2]=p):(l=e[1],p=e[2]);let v;e[3]===Symbol.for("react.memo_cache_sentinel")?(v=r=>f(r.target.value),e[3]=v):v=e[3];let c;e[4]!==o||e[5]!==m||e[6]!==t?(c=r=>{r.key==="Enter"&&o.trim()&&!m&&t(o.trim())},e[4]=o,e[5]=m,e[6]=t,e[7]=c):c=e[7];let h;e[8]!==o||e[9]!==c?(h=n.jsx(M,{placeholder:"acme.com",value:o,onChange:v,className:"max-w-xs",onKeyDown:c}),e[8]=o,e[9]=c,e[10]=h):h=e[10];let d;e[11]!==o||e[12]!==m?(d=!o.trim()||m,e[11]=o,e[12]=m,e[13]=d):d=e[13];let a;e[14]!==o||e[15]!==t?(a=()=>t(o.trim()),e[14]=o,e[15]=t,e[16]=a):a=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Ie,{size:14}),e[17]=x):x=e[17];const j=m?"Extracting...":"Extract";let b;e[18]!==j||e[19]!==d||e[20]!==a?(b=n.jsxs(ve,{variant:"outline",disabled:d,onClick:a,children:[x,j]}),e[18]=j,e[19]=d,e[20]=a,e[21]=b):b=e[21];let g;return e[22]!==b||e[23]!==h?(g=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[u,n.jsxs("div",{className:"flex-1",children:[l,p,n.jsxs("div",{className:"mt-3 flex gap-2",children:[h,b]})]})]})}),e[22]=b,e[23]=h,e[24]=g):g=e[24],g}function Ve(s){const e=q.c(24),{brand:t,onSave:m}=s,[o,f]=C.useState(!1),[u,l]=C.useState(t.name??""),[p,v]=C.useState(t.domain??""),[c,h]=C.useState(t.overview??"");let d;e[0]!==t.domain||e[1]!==t.name||e[2]!==t.overview?(d=()=>{l(t.name??""),v(t.domain??""),h(t.overview??""),f(!0)},e[0]=t.domain,e[1]=t.name,e[2]=t.overview,e[3]=d):d=e[3];const a=d;let x;e[4]!==p||e[5]!==u||e[6]!==m||e[7]!==c?(x=()=>{m({name:u,domain:p,overview:c}),f(!1)},e[4]=p,e[5]=u,e[6]=m,e[7]=c,e[8]=x):x=e[8];const j=x,b=!t.name&&!t.domain&&!t.overview;let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=()=>f(!1),e[9]=g):g=e[9];let r;e[10]!==t.domain||e[11]!==t.name||e[12]!==t.overview||e[13]!==p||e[14]!==o||e[15]!==b||e[16]!==u||e[17]!==c?(r=o?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Company name"}),n.jsx(M,{value:u,onChange:y=>l(y.target.value),placeholder:"Acme Corp"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Domain"}),n.jsx(M,{value:p,onChange:y=>v(y.target.value),placeholder:"acme.com"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Overview"}),n.jsx(Ye,{value:c,onChange:y=>h(y.target.value),placeholder:"Brief description of what the company does...",rows:3})]})]}):b?n.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No company info yet. Click edit to add your company name, domain, and overview."}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mb-3 flex items-start justify-between gap-4",children:[n.jsx("h2",{className:"text-xl font-semibold leading-tight text-foreground",children:t.name}),t.domain&&n.jsxs("a",{href:`https://${t.domain}`,target:"_blank",rel:"noopener noreferrer",className:"mt-0.5 flex shrink-0 items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[n.jsx(Re,{size:11}),t.domain]})]}),t.overview&&n.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground",children:t.overview})]}),e[10]=t.domain,e[11]=t.name,e[12]=t.overview,e[13]=p,e[14]=o,e[15]=b,e[16]=u,e[17]=c,e[18]=r):r=e[18];let i;return e[19]!==o||e[20]!==j||e[21]!==a||e[22]!==r?(i=n.jsx(ge,{title:"Company Overview",onEdit:a,editing:o,onSave:j,onCancel:g,children:r}),e[19]=o,e[20]=j,e[21]=a,e[22]=r,e[23]=i):i=e[23],i}function We(s){const e=q.c(24),{brand:t,onSave:m}=s,[o,f]=C.useState(!1),[u,l]=C.useState(t.logo??""),[p,v]=C.useState(t.favicon??""),[c,h]=C.useState(t.ogImage??"");let d;e[0]!==t.favicon||e[1]!==t.logo||e[2]!==t.ogImage?(d=()=>{l(t.logo??""),v(t.favicon??""),h(t.ogImage??""),f(!0)},e[0]=t.favicon,e[1]=t.logo,e[2]=t.ogImage,e[3]=d):d=e[3];const a=d;let x;e[4]!==p||e[5]!==u||e[6]!==c||e[7]!==m?(x=()=>{m({logo:u||null,favicon:p||null,ogImage:c||null}),f(!1)},e[4]=p,e[5]=u,e[6]=c,e[7]=m,e[8]=x):x=e[8];const j=x,b=t.logo||t.favicon||t.ogImage;let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=()=>f(!1),e[9]=g):g=e[9];let r;e[10]!==t.favicon||e[11]!==t.logo||e[12]!==t.ogImage||e[13]!==o||e[14]!==p||e[15]!==b||e[16]!==u||e[17]!==c?(r=o?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{children:[n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Logo URL"}),n.jsx(M,{value:u,onChange:y=>l(y.target.value),placeholder:"https://..."})]}),n.jsxs("div",{children:[n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Favicon URL"}),n.jsx(M,{value:p,onChange:y=>v(y.target.value),placeholder:"https://..."})]}),n.jsxs("div",{children:[n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"OG Image URL"}),n.jsx(M,{value:c,onChange:y=>h(y.target.value),placeholder:"https://..."})]})]}):b?n.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[n.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.jsx("div",{className:"flex aspect-video w-full items-center justify-center overflow-hidden rounded-xl",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"},children:t.logo?n.jsx("img",{src:t.logo,alt:"Logo",className:"h-full w-full object-contain p-3"}):n.jsx("span",{className:"text-[10px] text-muted-foreground/70",children:"No logo"})}),n.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Logo"})]}),n.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.jsx("div",{className:"flex aspect-video w-full items-center justify-center overflow-hidden rounded-xl",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"},children:t.favicon?n.jsx("img",{src:t.favicon,alt:"Favicon",className:"h-12 w-12 object-contain"}):n.jsx("span",{className:"text-[10px] text-muted-foreground/70",children:"No favicon"})}),n.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Favicon"})]}),n.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.jsx("div",{className:"flex aspect-video w-full items-center justify-center overflow-hidden rounded-xl",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"},children:t.ogImage?n.jsx("img",{src:t.ogImage,alt:"OG",className:"h-full w-full object-contain",loading:"lazy"}):n.jsx("span",{className:"text-[10px] text-muted-foreground/70",children:"No SEO image"})}),n.jsx("span",{className:"text-[10px] text-muted-foreground",children:"SEO / OG image"})]})]}):n.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No logos added yet. Click edit to add logo, favicon, and OG image URLs."}),e[10]=t.favicon,e[11]=t.logo,e[12]=t.ogImage,e[13]=o,e[14]=p,e[15]=b,e[16]=u,e[17]=c,e[18]=r):r=e[18];let i;return e[19]!==o||e[20]!==j||e[21]!==a||e[22]!==r?(i=n.jsx(ge,{title:"Logos & Images",onEdit:a,editing:o,onSave:j,onCancel:g,children:r}),e[19]=o,e[20]=j,e[21]=a,e[22]=r,e[23]=i):i=e[23],i}const _e=[{key:"heading",label:"Headings"},{key:"body",label:"Body"},{key:"code",label:"Code"}];function Ze(s){const e=q.c(20),{brand:t,onSave:m}=s,[o,f]=C.useState(!1);let u;e[0]!==t.fonts?(u=t.fonts??{},e[0]=t.fonts,e[1]=u):u=e[1];const[l,p]=C.useState(u);let v;e[2]!==t.fonts?(v=()=>{p(t.fonts??{}),f(!0)},e[2]=t.fonts,e[3]=v):v=e[3];const c=v;let h;e[4]!==l||e[5]!==m?(h=()=>{const r=Object.values(l).some(tt);m({fonts:r?l:null}),f(!1)},e[4]=l,e[5]=m,e[6]=h):h=e[6];const d=h;let a;e[7]!==t.fonts?(a=t.fonts&&Object.values(t.fonts).some(et),e[7]=t.fonts,e[8]=a):a=e[8];const x=a;let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=()=>f(!1),e[9]=j):j=e[9];let b;e[10]!==t.fonts||e[11]!==o||e[12]!==l||e[13]!==x?(b=o?n.jsx("div",{className:"space-y-2",children:_e.map(r=>{const{key:i,label:y}=r;return n.jsxs("div",{children:[n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:y}),n.jsx(M,{value:l[i]??"",onChange:_=>p({...l,[i]:_.target.value}),placeholder:`Font family for ${y.toLowerCase()}`})]},i)})}):x?n.jsx("div",{className:"space-y-3",children:_e.filter(r=>{const{key:i}=r;return t.fonts?.[i]}).map(r=>{const{key:i,label:y}=r;return n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"w-9 text-xl font-medium leading-none text-foreground",children:"Aa"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium leading-none text-foreground",children:t.fonts[i]}),n.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:y})]})]},i)})}):n.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No fonts defined. Click edit to add your brand fonts."}),e[10]=t.fonts,e[11]=o,e[12]=l,e[13]=x,e[14]=b):b=e[14];let g;return e[15]!==o||e[16]!==d||e[17]!==c||e[18]!==b?(g=n.jsx(ge,{title:"Fonts",onEdit:c,editing:o,onSave:d,onCancel:j,children:b}),e[15]=o,e[16]=d,e[17]=c,e[18]=b,e[19]=g):g=e[19],g}function et(s){return s?.trim()}function tt(s){return s?.trim()}const Ce=[{key:"primary",label:"Primary"},{key:"secondary",label:"Secondary"},{key:"accent",label:"Accent"},{key:"background",label:"Background"},{key:"foreground",label:"Foreground"}];function st(s){const e=q.c(20),{brand:t,onSave:m}=s,[o,f]=C.useState(!1);let u;e[0]!==t.colors?(u=t.colors??{},e[0]=t.colors,e[1]=u):u=e[1];const[l,p]=C.useState(u);let v;e[2]!==t.colors?(v=()=>{p(t.colors??{}),f(!0)},e[2]=t.colors,e[3]=v):v=e[3];const c=v;let h;e[4]!==l||e[5]!==m?(h=()=>{const r=Object.values(l).some(ot);m({colors:r?l:null}),f(!1)},e[4]=l,e[5]=m,e[6]=h):h=e[6];const d=h;let a;e[7]!==t.colors?(a=t.colors&&Object.values(t.colors).some(nt),e[7]=t.colors,e[8]=a):a=e[8];const x=a;let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=()=>f(!1),e[9]=j):j=e[9];let b;e[10]!==t.colors||e[11]!==l||e[12]!==o||e[13]!==x?(b=o?n.jsx("div",{className:"space-y-2",children:Ce.map(r=>{const{key:i,label:y}=r;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:l[i]??"#000000",onChange:_=>p({...l,[i]:_.target.value}),className:"h-9 w-9 shrink-0 cursor-pointer rounded-lg border border-border bg-transparent p-0.5"}),n.jsx(M,{value:l[i]??"",onChange:_=>p({...l,[i]:_.target.value}),placeholder:"#000000",className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:y})]},i)})}):x?n.jsx("div",{className:"flex flex-wrap gap-4",children:Ce.filter(r=>{const{key:i}=r;return t.colors?.[i]}).map(r=>{const{key:i,label:y}=r;return n.jsxs("div",{className:"flex flex-col items-center gap-2",children:[n.jsx("div",{className:"h-14 w-14 rounded-full shadow-sm",style:{backgroundColor:t.colors[i],border:t.colors[i]==="#FFFFFF"?"1px solid #e5e7eb":void 0}}),n.jsx("p",{className:"font-mono text-[10px] text-muted-foreground",children:t.colors[i]}),n.jsx("p",{className:"text-[10px] text-muted-foreground",children:y})]},i)})}):n.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No colors defined. Click edit to add your brand palette."}),e[10]=t.colors,e[11]=l,e[12]=o,e[13]=x,e[14]=b):b=e[14];let g;return e[15]!==o||e[16]!==d||e[17]!==c||e[18]!==b?(g=n.jsx(ge,{title:"Colors",onEdit:c,editing:o,onSave:d,onCancel:j,children:b}),e[15]=o,e[16]=d,e[17]=c,e[18]=b,e[19]=g):g=e[19],g}function nt(s){return s?.trim()}function ot(s){return s?.trim()}function at(s){const e=q.c(123),{brand:t,client:m,onChanged:o}=s,[f,u]=C.useState(t.isDefault??!1),[l,p]=C.useState(!1);let v;e[0]!==t.colors||e[1]!==t.domain||e[2]!==t.favicon||e[3]!==t.fonts||e[4]!==t.id||e[5]!==t.images||e[6]!==t.logo||e[7]!==t.name||e[8]!==t.ogImage||e[9]!==t.overview||e[10]!==m?(v=async N=>{const be={id:t.id,name:N.name??t.name??"",domain:N.domain??t.domain??"",overview:N.overview??t.overview??"",logo:"logo"in N?N.logo:t.logo,favicon:"favicon"in N?N.favicon:t.favicon,ogImage:"ogImage"in N?N.ogImage:t.ogImage,fonts:"fonts"in N?N.fonts:t.fonts,colors:"colors"in N?N.colors:t.colors,images:"images"in N?N.images:t.images};await m.callTool({name:"BRAND_CONTEXT_UPDATE",arguments:be})},e[0]=t.colors,e[1]=t.domain,e[2]=t.favicon,e[3]=t.fonts,e[4]=t.id,e[5]=t.images,e[6]=t.logo,e[7]=t.name,e[8]=t.ogImage,e[9]=t.overview,e[10]=m,e[11]=v):v=e[11];let c;e[12]!==t.id||e[13]!==o?(c=(N,be)=>{Y("brand_updated",{brand_id:t.id,fields:Object.keys(be)}),o(),K.success("Brand context saved")},e[12]=t.id,e[13]=o,e[14]=c):c=e[14];let h;e[15]!==v||e[16]!==c?(h={mutationFn:v,onSuccess:c,onError:ut},e[15]=v,e[16]=c,e[17]=h):h=e[17];const{mutate:d}=ce(h);let a;e[18]!==t.id||e[19]!==m?(a=async()=>{await m.callTool({name:"BRAND_CONTEXT_DELETE",arguments:{id:t.id}})},e[18]=t.id,e[19]=m,e[20]=a):a=e[20];let x;e[21]!==t.id||e[22]!==o?(x=()=>{Y("brand_deleted",{brand_id:t.id}),p(!1),o(),K.success("Brand deleted")},e[21]=t.id,e[22]=o,e[23]=x):x=e[23];let j;e[24]!==a||e[25]!==x?(j={mutationFn:a,onSuccess:x,onError:ft},e[24]=a,e[25]=x,e[26]=j):j=e[26];const{mutate:b,isPending:g}=ce(j);let r;e[27]!==t.id||e[28]!==t.isDefault||e[29]!==m?(r=async()=>{await m.callTool({name:"BRAND_CONTEXT_UPDATE",arguments:{id:t.id,isDefault:!t.isDefault}})},e[27]=t.id,e[28]=t.isDefault,e[29]=m,e[30]=r):r=e[30];let i;e[31]!==t.id||e[32]!==t.isDefault||e[33]!==o?(i=()=>{Y(t.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:t.id}),o(),K.success(t.isDefault?"Removed as default brand":"Set as default brand")},e[31]=t.id,e[32]=t.isDefault,e[33]=o,e[34]=i):i=e[34];let y;e[35]!==r||e[36]!==i?(y={mutationFn:r,onSuccess:i,onError:mt},e[35]=r,e[36]=i,e[37]=y):y=e[37];const{mutate:_}=ce(y),H=t.isDefault?"border-primary/30":"border-border/60";let F;e[38]!==H?(F=xe("rounded-2xl border bg-background",H),e[38]=H,e[39]=F):F=e[39];let P;e[40]!==f?(P=()=>u(!f),e[40]=f,e[41]=P):P=e[41];let R;e[42]!==f?(R=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:f?n.jsx(Be,{size:14}):n.jsx(Te,{size:14})}),e[42]=f,e[43]=R):R=e[43];let $;e[44]!==t.logo||e[45]!==t.name?($=t.logo?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px",backgroundColor:"#fff"},children:n.jsx("img",{src:t.logo,alt:"",className:"h-full w-full object-contain p-1",onError:dt})}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:t.name?.charAt(0)?.toUpperCase()||"?"})}),e[44]=t.logo,e[45]=t.name,e[46]=$):$=e[46];const ie=t.name||"Untitled Brand";let B;e[47]!==ie?(B=n.jsx("span",{className:"text-sm font-medium text-foreground",children:ie}),e[47]=ie,e[48]=B):B=e[48];let w;e[49]!==t.domain?(w=t.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:t.domain}),e[49]=t.domain,e[50]=w):w=e[50];let O;e[51]!==B||e[52]!==w?(O=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[B,w]}),e[51]=B,e[52]=w,e[53]=O):O=e[53];let S;e[54]!==t.colors||e[55]!==f?(S=!f&&t.colors&&Object.values(t.colors).some(ct)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(t.colors).filter(it).map(rt)}),e[54]=t.colors,e[55]=f,e[56]=S):S=e[56];let E;e[57]!==t.fonts||e[58]!==f?(E=!f&&t.fonts&&Object.values(t.fonts).some(lt)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(t.fonts).filter(Boolean).join(", ")}),e[57]=t.fonts,e[58]=f,e[59]=E):E=e[59];const Q=t.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let G;e[60]!==Q?(G=xe("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",Q),e[60]=Q,e[61]=G):G=e[61];let T,z;e[62]!==_?(T=N=>{N.stopPropagation(),_()},z=N=>{N.key==="Enter"&&(N.stopPropagation(),_())},e[62]=_,e[63]=T,e[64]=z):(T=e[63],z=e[64]);const L=t.isDefault?"Unset as default":"Set as default",U=t.isDefault?"text-primary fill-primary":"text-muted-foreground";let D;e[65]!==U?(D=xe(U),e[65]=U,e[66]=D):D=e[66];let A;e[67]!==D?(A=n.jsx(Fe,{size:13,className:D}),e[67]=D,e[68]=A):A=e[68];let I;e[69]!==G||e[70]!==T||e[71]!==z||e[72]!==L||e[73]!==A?(I=n.jsx("span",{role:"button",tabIndex:0,className:G,onClick:T,onKeyDown:z,title:L,children:A}),e[69]=G,e[70]=T,e[71]=z,e[72]=L,e[73]=A,e[74]=I):I=e[74];let k,X;e[75]===Symbol.for("react.memo_cache_sentinel")?(k=N=>{N.stopPropagation(),p(!0)},X=N=>{N.key==="Enter"&&(N.stopPropagation(),p(!0))},e[75]=k,e[76]=X):(k=e[75],X=e[76]);let de;e[77]===Symbol.for("react.memo_cache_sentinel")?(de=n.jsx("span",{role:"button",tabIndex:0,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg opacity-0 transition-opacity hover:bg-destructive/10 group-hover:opacity-100",onClick:k,onKeyDown:X,title:"Delete brand",children:n.jsx($e,{size:13,className:"text-muted-foreground"})}),e[77]=de):de=e[77];let J;e[78]!==P||e[79]!==R||e[80]!==$||e[81]!==O||e[82]!==S||e[83]!==E||e[84]!==I?(J=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:P,children:[R,$,O,S,E,I,de]}),e[78]=P,e[79]=R,e[80]=$,e[81]=O,e[82]=S,e[83]=E,e[84]=I,e[85]=J):J=e[85];let V;e[86]!==t||e[87]!==f||e[88]!==d?(V=f&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(Ve,{brand:t,onSave:d}),n.jsx(We,{brand:t,onSave:d}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(st,{brand:t,onSave:d}),n.jsx(Ze,{brand:t,onSave:d})]})]}),e[86]=t,e[87]=f,e[88]=d,e[89]=V):V=e[89];let W;e[90]!==g?(W=N=>{!N&&!g&&p(!1)},e[90]=g,e[91]=W):W=e[91];let me;e[92]===Symbol.for("react.memo_cache_sentinel")?(me=n.jsx(Ue,{children:"Delete brand?"}),e[92]=me):me=e[92];const pe=t.name||"this brand";let Z;e[93]!==pe?(Z=n.jsxs("p",{children:["This will permanently delete"," ",n.jsx("span",{className:"font-medium text-foreground",children:pe}),". This action cannot be undone."]}),e[93]=pe,e[94]=Z):Z=e[94];let ee;e[95]!==t.isDefault?(ee=t.isDefault&&n.jsxs("p",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/5 p-2 text-destructive",children:[n.jsx("span",{className:"font-medium",children:"Heads up:"})," this is your organization's default brand. Deleting it will leave your organization without a default brand until you set another."]}),e[95]=t.isDefault,e[96]=ee):ee=e[96];let te;e[97]!==Z||e[98]!==ee?(te=n.jsxs(Ke,{children:[me,n.jsx(Xe,{asChild:!0,children:n.jsxs("div",{children:[Z,ee]})})]}),e[97]=Z,e[98]=ee,e[99]=te):te=e[99];let se;e[100]!==g?(se=n.jsx(qe,{disabled:g,children:"Cancel"}),e[100]=g,e[101]=se):se=e[101];let ne;e[102]!==b?(ne=N=>{N.preventDefault(),b()},e[102]=b,e[103]=ne):ne=e[103];const he=g?"Deleting...":"Delete";let oe;e[104]!==g||e[105]!==ne||e[106]!==he?(oe=n.jsx(Ge,{onClick:ne,disabled:g,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:he}),e[104]=g,e[105]=ne,e[106]=he,e[107]=oe):oe=e[107];let ae;e[108]!==se||e[109]!==oe?(ae=n.jsxs(Me,{children:[se,oe]}),e[108]=se,e[109]=oe,e[110]=ae):ae=e[110];let le;e[111]!==te||e[112]!==ae?(le=n.jsxs(He,{children:[te,ae]}),e[111]=te,e[112]=ae,e[113]=le):le=e[113];let re;e[114]!==l||e[115]!==W||e[116]!==le?(re=n.jsx(Qe,{open:l,onOpenChange:W,children:le}),e[114]=l,e[115]=W,e[116]=le,e[117]=re):re=e[117];let fe;return e[118]!==F||e[119]!==J||e[120]!==V||e[121]!==re?(fe=n.jsxs("div",{className:F,children:[J,V,re]}),e[118]=F,e[119]=J,e[120]=V,e[121]=re,e[122]=fe):fe=e[122],fe}function lt(s){return s}function rt(s){const[e,t]=s;return n.jsx("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{backgroundColor:t},title:`${e}: ${t}`},e)}function it(s){const[,e]=s;return e}function ct(s){return s}function dt(s){s.target.style.display="none"}function mt(){return K.error("Failed to update default brand")}function ft(){return K.error("Failed to delete brand")}function ut(){return K.error("Failed to save brand context")}function xt(){const s=q.c(57),{brandExtractEnabled:e}=ke(),{org:t}=we();let m;s[0]!==t.id||s[1]!==t.slug?(m={connectionId:De,orgId:t.id,orgSlug:t.slug},s[0]=t.id,s[1]=t.slug,s[2]=m):m=s[2];const o=Ae(m),f=Se();let u;s[3]!==t.id?(u=je.brandContext(t.id),s[3]=t.id,s[4]=u):u=s[4];let l;s[5]!==o?(l=async()=>{const k=await o.callTool({name:"BRAND_CONTEXT_LIST",arguments:{includeArchived:!1}}),X=Ne(k);return Array.isArray(X?.items)?X.items:[]},s[5]=o,s[6]=l):l=s[6];let p;s[7]!==u||s[8]!==l?(p={queryKey:u,queryFn:l},s[7]=u,s[8]=l,s[9]=p):p=s[9];const{data:v}=Ee(p),h=(v===void 0?[]:v).filter(ht);let d;s[10]!==t.id||s[11]!==f?(d=()=>f.invalidateQueries({queryKey:je.brandContext(t.id),refetchType:"all"}),s[10]=t.id,s[11]=f,s[12]=d):d=s[12];const a=d;let x;s[13]!==o?(x=async()=>{await o.callTool({name:"BRAND_CONTEXT_CREATE",arguments:{name:"New Brand",domain:"example.com",overview:""}})},s[13]=o,s[14]=x):x=s[14];let j;s[15]!==a?(j=()=>{Y("brand_created"),a(),K.success("Brand created")},s[15]=a,s[16]=j):j=s[16];let b;s[17]!==x||s[18]!==j?(b={mutationFn:x,onSuccess:j,onError:pt},s[17]=x,s[18]=j,s[19]=b):b=s[19];const{mutate:g,isPending:r}=ce(b);let i;s[20]!==o?(i=async k=>{Y("brand_extract_started",{domain:k});const X=await o.callTool({name:"BRAND_CONTEXT_EXTRACT",arguments:{domain:k}});Ne(X)},s[20]=o,s[21]=i):i=s[21];let y;s[22]!==a?(y=()=>{Y("brand_extract_succeeded"),a(),K.success("Brand extracted successfully")},s[22]=a,s[23]=y):y=s[23];let _;s[24]!==y||s[25]!==i?(_={mutationFn:i,onSuccess:y,onError:gt},s[24]=y,s[25]=i,s[26]=_):_=s[26];const{mutate:H,isPending:F}=ce(_),P=ue,R=ue,$=ue,ie="flex flex-col gap-6";let B;s[27]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsxs("div",{children:[n.jsx(ue.Title,{children:"Brand Context"}),n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Define your brand profiles. Each brand is available as an MCP prompt for AI clients."})]}),s[27]=B):B=s[27];let w;s[28]!==g?(w=()=>g(),s[28]=g,s[29]=w):w=s[29];let O;s[30]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(ye,{size:14}),s[30]=O):O=s[30];let S;s[31]!==r||s[32]!==w?(S=n.jsxs("div",{className:"flex items-center justify-between",children:[B,n.jsxs(ve,{variant:"outline",onClick:w,disabled:r,children:[O,"Add Brand"]})]}),s[31]=r,s[32]=w,s[33]=S):S=s[33];let E;s[34]!==e||s[35]!==H||s[36]!==F?(E=e&&n.jsx(Je,{onExtract:k=>H(k),isExtracting:F}),s[34]=e,s[35]=H,s[36]=F,s[37]=E):E=s[37];const Q=h.length===0&&n.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-8 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"No brands configured yet."}),n.jsxs(ve,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>g(),disabled:r,children:[n.jsx(ye,{size:14}),"Add your first brand"]})]}),G="group space-y-3";let T;s[38]!==o||s[39]!==a?(T=k=>n.jsx(at,{brand:k,client:o,onChanged:a},k.id),s[38]=o,s[39]=a,s[40]=T):T=s[40];const z=h.map(T);let L;s[41]!==z?(L=n.jsx("div",{className:G,children:z}),s[41]=z,s[42]=L):L=s[42];let U;s[43]!==S||s[44]!==E||s[45]!==Q||s[46]!==L?(U=n.jsxs("div",{className:ie,children:[S,E,Q,L]}),s[43]=S,s[44]=E,s[45]=Q,s[46]=L,s[47]=U):U=s[47];let D;s[48]!==$.Body||s[49]!==U?(D=n.jsx($.Body,{children:U}),s[48]=$.Body,s[49]=U,s[50]=D):D=s[50];let A;s[51]!==R.Content||s[52]!==D?(A=n.jsx(R.Content,{children:D}),s[51]=R.Content,s[52]=D,s[53]=A):A=s[53];let I;return s[54]!==P||s[55]!==A?(I=n.jsx(P,{children:A}),s[54]=P,s[55]=A,s[56]=I):I=s[56],I}function gt(s){Y("brand_extract_failed",{error:s instanceof Error?s.message:"unknown"}),K.error(s instanceof Error?s.message:"Failed to extract brand")}function pt(){return K.error("Failed to create brand")}function ht(s){return!s.archivedAt}function It(){const s=q.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(xt,{}),s[0]=e):e=s[0],e}export{It as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as n,c as d,j as c,b3 as l,b4 as b}from"./index-Dl2t23Jt.js";import{i as m}from"./ChevronDown-tb8ftSUO.js";function u(o){const e=n.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=d("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[2px] disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(b,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(m,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(l,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{u as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{H as Ke,J as te,e as N,j as t,E as Te,r as C,s as le,z as Ge,c as U,aX as Qe,aY as Xe,l as ie,d as Ye,L as G,B as q,x as Ze,g as ae,aZ as ke}from"./index-Dl2t23Jt.js";import{E as Pe}from"./empty-state-Be0X9mox.js";import{u as et,a as Ee}from"./use-collections-CwD8DZNY.js";import{u as ce}from"./constants-CfwGLQ49.js";import{F as se,a as tt,b as de,d as me}from"./form-BC40Nvzi.js";import{I as ue}from"./input-CluxDyoT.js";import{T as re}from"./textarea-Cld3tG5R.js";import{a as st,b as nt,V as xe}from"./layout-CV5Wi0Ex.js";import{S as ot,W as rt,a as lt}from"./index-CbBINyFK.js";import{g as it,M as at,b as je}from"./types-CvYZZZog.js";import{S as be,a as Ne,b as ve,c as Se,d as ne}from"./select-C0JTp_6a.js";import{c as ct,T as ye,a as we,b as Ce}from"./tooltip-CxizQODk.js";import{i as dt}from"./AlertCircle-CbUYZGF-.js";import{v as mt,x as ut,U as xt,V as pt,W as ft,X as Ie}from"./agent-icon-BXkkrCT3.js";import{c as ht}from"./XCircle-DZEMwZj2.js";import{i as gt}from"./Play-DSYx2GJ2.js";import{i as jt}from"./ChevronRight-BIm0-OSp.js";import{O as bt,M as Nt}from"./index-BycfnvwM.js";import{g as vt}from"./connection-slug-eyAPH6o3.js";import{u as St,T as yt}from"./tools-list-COvHAWAZ.js";import{a as _e,u as Oe}from"./use-connection-pSv7eY2y.js";import{b as wt}from"./use-mcp-tools-BdYIFx9S.js";import{c as Ct}from"./content-blocks-o63cs2vh.js";import{I as $e}from"./integration-icon-BipCD_m-.js";import{g as It,k as $t}from"./chat-context-C4Hx_rZK.js";import{u as Tt}from"./shell-layout-CzPr_0c2.js";import{M as kt}from"./monaco-editor-BfaMmupR.js";import{E as Pt}from"./empty-state-DoKR-jUX.js";import{n as Et}from"./Container-BCDxdJoG.js";import"./label-CHKFYnQo.js";import"./index-Bcf94soS.js";import"./X-viKat0oa.js";import"./index-M_qlHNIS.js";import"./collections-Cn7VbUFT.js";import"./index-CFyIm5CH.js";import"./use-virtual-mcp-BHEEZv3B.js";import"./accordion-YgNI8iqn.js";import"./index-BBrIielu.js";import"./badge-_ZGDO29b.js";import"./view-mode-toggle-C9HAxT_f.js";import"./dialog-CoECADf1.js";import"./index-CvarGBFr.js";import"./dropdown-menu-C6XDnng5.js";import"./ChevronDown-tb8ftSUO.js";import"./DotsVertical-DEE8M0V4.js";import"./Plus-BrBimbff.js";import"./Tool01-D1Rvo01i.js";import"./XClose-DY7O9VST.js";import"./scroll-area-D4F3EM5Z.js";import"./index-DjgN9qrV.js";import"./create-sse-subscription-CxkOgzKf.js";import"./ChevronUp-ClqSoLtD.js";import"./RefreshCcw01-Cr84gVY8.js";import"./ArrowNarrowLeft-DHj5-FLY.js";import"./ArrowUpRight-BK_iYZ-J.js";import"./ZapSquare-BDbWe-zU.js";import"./Users03-DH9QAbco.js";import"./CheckCircle-D9qlmIve.js";import"./Star01-PFA-ZRDO.js";import"./Palette-BrJL0UcN.js";import"./SearchMd-IP-R-mtT.js";import"./LinkExternal01-DM7IwrPj.js";import"./Lock01-BmjkKSvK.js";import"./Sun-B7BWJEHb.js";import"./Settings02-BOckjEVU.js";import"./Shield01-CJggUHAQ.js";import"./Trash01-DaGrAtTq.js";import"./User01-DmtseI1g.js";import"./Zap-BMzMPNv3.js";import"./extract-connection-data-CuIeY90s.js";import"./constants-CVDNjJTw.js";import"./use-registry-connections-CMFnR2M3.js";import"./use-organization-settings-Dak2xww8.js";import"./index-B0TkoX1b.js";import"./popover-vU5pf5HQ.js";import"./use-create-virtual-mcp-1DfbQRRy.js";import"./use-navigate-to-agent-Tn-rhKXX.js";import"./use-ai-providers-Bt2yRX0n.js";import"./use-decopilot-events-CXVUS53e.js";import"./use-tasks-yxuEm5KK.js";import"./required-auth-layout-BYto5m3H.js";import"./use-org-sso-CPzDtjox.js";Ke({title:te().min(1),description:te().nullable(),body:te()});function oe(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function _t(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function Ot(s){const e=N.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let r;e[1]!==o.control?(r=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(se,{control:o.control,name:"title",render:Dt}),t.jsx(se,{control:o.control,name:"description",render:Rt})]})]}),e[1]=o.control,e[2]=r):r=e[2];let l,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=l,e[4]=a):(l=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[l,a,t.jsx(se,{control:o.control,name:"body",render:At})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==r||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[r,c]}),e[7]=r,e[8]=c,e[9]=i):i=e[9];let x;return e[10]!==o||e[11]!==i?(x=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=x):x=e[12],x}function At(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function Rt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Mt(s){const e=N.c(36),{providerId:o,promptId:n}=s,{org:r}=le(),l=o||null;let a;e[0]!==r.id||e[1]!==r.slug||e[2]!==l?(a={connectionId:l,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=l,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),x=Ee(o,"PROMPT",c),f=x.update.isPending;let u;e[4]!==i?(u=i?{title:i.title,description:i.description??null,body:oe(i)}:void 0,e[4]=i,e[5]=u):u=e[5];let h;e[6]!==u?(h={values:u},e[6]=u,e[7]=h):h=e[7];const v=Ge(h);let T;e[8]!==v||e[9]!==i?(T=()=>{i&&v.reset({title:i.title,description:i.description??null,body:oe(i)})},e[8]=v,e[9]=i,e[10]=T):T=e[10];const _=T;let O;e[11]!==x.update||e[12]!==v||e[13]!==n?(O=v.handleSubmit(async j=>{const P=await x.update.mutateAsync({id:n,data:{title:j.title,description:j.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:j.body}}]}});v.reset({title:P.title,description:P.description??null,body:oe(P)})}),e[11]=x.update,e[12]=v,e[13]=n,e[14]=O):O=e[14];const A=O;if(!i){let j;return e[15]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Pe,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=j):j=e[15],j}let w;e[16]!==i.title?(w=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=w):w=e[17];let k;e[18]!==i.description?(k=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=k):k=e[19];let I;e[20]!==w||e[21]!==k?(I=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[w,k]})}),e[20]=w,e[21]=k,e[22]=I):I=e[22];let g;e[23]!==A?(g=()=>{A()},e[23]=A,e[24]=g):g=e[24];let S;e[25]!==v.formState.isDirty||e[26]!==f||e[27]!==_||e[28]!==g?(S=t.jsx(st,{children:t.jsx(ot,{onSave:g,onUndo:_,isDirty:v.formState.isDirty,isSaving:f})}),e[25]=v.formState.isDirty,e[26]=f,e[27]=_,e[28]=g,e[29]=S):S=e[29];let y;e[30]!==v?(y=t.jsx("div",{className:"h-full",children:t.jsx(Ot,{form:v})}),e[30]=v,e[31]=y):y=e[31];let $;return e[32]!==S||e[33]!==y||e[34]!==I?($=t.jsxs(xe,{children:[I,S,y]}),e[32]=S,e[33]=y,e[34]=I,e[35]=$):$=e[35],$}function zt(s){const e=N.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=_t(),e[0]=n):n=e[0];const r=n;if(!r){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Pe,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let l;return e[2]!==o?(l=t.jsx(Te,{children:t.jsx(C.Suspense,{fallback:null,children:t.jsx(Mt,{providerId:r,promptId:o})})}),e[2]=o,e[3]=l):l=e[3],l}const Ut=Qe("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function Lt(s){const e=N.c(10);let o,n,r;e[0]!==s?({className:o,variant:r,...n}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=r):(o=e[1],n=e[2],r=e[3]);let l;e[4]!==o||e[5]!==r?(l=U(Ut({variant:r}),o),e[4]=o,e[5]=r,e[6]=l):l=e[6];let a;return e[7]!==n||e[8]!==l?(a=t.jsx("div",{"data-slot":"alert",role:"alert",className:l,...n}),e[7]=n,e[8]=l,e[9]=a):a=e[9],a}function Vt(s){const e=N.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=U("line-clamp-1 min-h-4 font-medium tracking-tight",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("div",{"data-slot":"alert-title",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Bt(s){const e=N.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=U("text-muted-foreground leading-relaxed",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("div",{"data-slot":"alert-description",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Ae(s){const e=N.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=U("min-w-0 overflow-hidden",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Re(s){const e=N.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=U("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("ol",{"data-slot":"breadcrumb-list",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function J(s){const e=N.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=U("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("li",{"data-slot":"breadcrumb-item",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function Q(s){const e=N.c(10);let o,n,r;e[0]!==s?({asChild:o,className:n,...r}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=r):(o=e[1],n=e[2],r=e[3]);const l=o?Xe:"a";let a;e[4]!==n?(a=U("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==l||e[7]!==r||e[8]!==a?(c=t.jsx(l,{"data-slot":"breadcrumb-link",className:a,...r}),e[6]=l,e[7]=r,e[8]=a,e[9]=c):c=e[9],c}function De(s){const e=N.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let r;e[3]!==o?(r=U("text-foreground font-medium truncate",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==n||e[6]!==r?(l=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:r,...n}),e[5]=n,e[6]=r,e[7]=l):l=e[7],l}function X(s){const e=N.c(12);let o,n,r;e[0]!==s?({children:o,className:n,...r}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=r):(o=e[1],n=e[2],r=e[3]);let l;e[4]!==n?(l=U("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=l):l=e[5];let a;e[6]!==o?(a=o??t.jsx(jt,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==r||e[9]!==l||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l,...r,children:a}),e[8]=r,e[9]=l,e[10]=a,e[11]=c):c=e[11],c}const Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Jt(s){const e=N.c(11),{toolName:o,connectionId:n,siblings:r,onSelectInstance:l,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=St(c);if(!i.isAuthenticated){let u;return e[2]!==i.supportsOAuth||e[3]!==a?(u=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(bt,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(Nt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=u):u=e[4],u}const x=`${n}:${o}`;let f;return e[5]!==n||e[6]!==l||e[7]!==r||e[8]!==x||e[9]!==o?(f=t.jsx(Wt,{toolName:o,connectionId:n,siblings:r,onSelectInstance:l},x),e[5]=n,e[6]=l,e[7]=r,e[8]=x,e[9]=o,e[10]=f):f=e[10],f}function Wt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:r}=Ye({strict:!1}),l=(()=>{if(!r)return null;const d=`replay-${r}`,m=sessionStorage.getItem(d);if(!m)return null;sessionStorage.removeItem(d);try{return JSON.parse(m)}catch{return null}})(),a=(()=>{if(!l)return null;const d={};for(const[m,b]of Object.entries(l))b!==null&&typeof b=="object"?d[m]=JSON.stringify(b,null,2):d[m]=b;return d})(),[c,i]=C.useState(a??{}),[x,f]=C.useState(l?JSON.stringify(l,null,2):"{}"),[u,h]=C.useState(null),[v,T]=C.useState(null),[_,O]=C.useState(null),[A,w]=C.useState(null),[k,I]=C.useState(!1),[g,S]=C.useState(null),{org:y}=le(),$=_e(e),j=It(),P=$t(),{setChatOpen:L}=Tt(),M=`${e}:${s}`,R=ce({connectionId:e,orgId:y.id,orgSlug:y.slug}),z=wt({client:R}),p=z.data?.tools?.find(d=>d.name===s),E=it(p?._meta),V=d=>{if(!j)return;const m=Ct(d.content);m.content.length>0&&(L(!0),j.sendMessage({tiptapDoc:m}))},[D,Y]=C.useState("json"),[Me,ze]=C.useState(!1);E&&!Me&&(Y("ui"),ze(!0));const pe=p?.inputSchema?.properties,fe=pe?Object.keys(pe):[],W=fe.length>0,H={};if(W&&p?.inputSchema?.properties)for(const d of fe)H[d]=p.inputSchema.required?.includes(d)?"":void 0;const Z=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{I(!0),w(null),h(null),T(null),O(null),S(null);const d=performance.now();try{if(!R)throw new Error("MCP client is not available");const m=W?{...H,...c}:(()=>{const B=x.trim();if(!B)return{};const F=JSON.parse(B);if(F&&typeof F=="object")return F;throw new Error("Raw JSON input must be an object.")})();W&&p?.inputSchema?.properties&&Object.entries(p.inputSchema.properties).forEach(([B,F])=>{if((F.type==="object"||F.type==="array")&&typeof m[B]=="string")try{m[B]=JSON.parse(m[B])}catch{}});const b=await R.callTool({name:s,arguments:m}),K=b.structuredContent??b,We=performance.now(),qe=Math.round(We-d);h(K),T(b),O(m);const He=JSON.stringify(K),ge=new TextEncoder().encode(He).length;S({duration:`${qe}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(m){const b=m instanceof Error?m.message:String(m);w(b||"Unknown error occurred");const K=performance.now();S({duration:`${Math.round(K-d)}ms`})}finally{I(!1)}},ee=(d,m)=>{i(b=>({...b,[d]:m}))},Le=()=>{h(null),T(null),O(null),w(null),S(null)},Ve=p?.name??Ft(s),Be=t.jsx(Ae,{children:t.jsxs(Re,{children:[t.jsx(J,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:y.slug},children:"Connections"})})}),t.jsx(X,{}),$&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:y.slug,appSlug:vt($)},search:{tab:"tools"},children:$.title})})}),t.jsx(X,{})]}),t.jsx(J,{children:t.jsx(De,{children:Ve})})]})}),he=o.length>1&&t.jsxs(be,{value:e,onValueChange:n,children:[t.jsx(Ne,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ve,{})}),t.jsx(Se,{children:o.map(d=>t.jsx(ne,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx($e,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Fe=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),p?.inputSchema?.required&&p.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:W&&p?.inputSchema?.properties?Object.entries(p.inputSchema.properties).map(([d,m])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,p.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:m.type})]}),m.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:m.description}),m.type==="object"||m.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:Z(d)?c[d]??"":H[d]??"",onChange:b=>ee(d,b.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):m.type==="boolean"?t.jsxs(be,{value:Z(d)?String(c[d]??""):"",onValueChange:b=>ee(d,b==="true"),children:[t.jsx(Ne,{children:t.jsx(ve,{placeholder:"Select true or false..."})}),t.jsxs(Se,{children:[t.jsx(ne,{value:"true",children:"true"}),t.jsx(ne,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:Z(d)?c[d]??"":H[d]??"",onChange:b=>ee(d,b.target.value),placeholder:`Enter ${d}...`})]},d)):p?.inputSchema&&!W?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:x,onChange:d=>f(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:k?t.jsxs(q,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Le,children:[t.jsx(mt,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(q,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(gt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),Je=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[g&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ut,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:g.duration})]}),g.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(xt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:g.tokens})]}),g.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(pt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:g.bytes})]}),g.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:g.cost})})]}),E&&t.jsx(ct,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(ye,{children:[t.jsx(we,{asChild:!0,children:t.jsx(q,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Y("ui"),children:t.jsx(ft,{size:14})})}),t.jsx(Ce,{children:"Interactive view"})]}),t.jsxs(ye,{children:[t.jsx(we,{asChild:!0,children:t.jsx(q,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Y("json"),children:t.jsx(Ie,{size:14})})}),t.jsx(Ce,{children:"JSON view"})]})]})})]})]}),A&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(Lt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(dt,{className:"h-4 w-4"}),t.jsx(Vt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(Bt,{className:"text-xs text-destructive",children:A})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:E&&D==="ui"&&R?t.jsx(C.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(at,{resourceURI:E,toolInfo:p?{tool:p}:void 0,toolInput:_??void 0,toolResult:v??void 0,displayMode:"fullscreen",minHeight:je.view.minHeight,maxHeight:je.view.maxHeight,client:R,onMessage:V,onUpdateModelContext:d=>P?.setAppContext(M,d),onTeardown:()=>P?.clearAppContext(M),className:"h-full"})}):u?t.jsxs(t.Fragment,{children:[t.jsx(kt,{code:JSON.stringify(u,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(q,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(u,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(ht,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(Ie,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Be,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx($e,{icon:$?.icon||null,name:$?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[z.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):z.isLoading?t.jsx(ie,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:z.isSuccess?"ready":z.isLoading?"connecting":"error"})]}),t.jsx(yt,{annotations:p?.annotations,_meta:p?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:p?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Fe}),Je]})})]})})}function qt(s){const e=N.c(10),{itemId:o,siblings:n,onBack:r}=s,[l,a]=C.useState(n[0]?.id??"");let c;e[0]!==l||e[1]!==n?(c=n.find(h=>h.id===l)?.id??n[0]?.id??"",e[0]=l,e[1]=n,e[2]=c):c=e[2];const i=c;if(!_e(i||void 0)||!i){let h;return e[3]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=h):h=e[3],h}let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ie,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=f):f=e[4];let u;return e[5]!==i||e[6]!==r||e[7]!==n||e[8]!==o?(u=t.jsx(C.Suspense,{fallback:f,children:t.jsx(Jt,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:r})}),e[5]=i,e[6]=r,e[7]=n,e[8]=o,e[9]=u):u=e[9],u}const Ht={workflow:lt,workflow_execution:rt,prompt:zt};function Kt(){const s=N.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),r=decodeURIComponent(n.itemId);let l;s[1]!==n.appSlug?(l={slug:n.appSlug},s[1]=n.appSlug,s[2]=l):l=s[2];const a=Oe(l);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,x=Gt;let f;return s[5]!==i||s[6]!==r||s[7]!==a?(f=t.jsx(qt,{itemId:r,siblings:a,onBack:i,onUpdate:x}),s[5]=i,s[6]=r,s[7]=a,s[8]=f):f=s[8],f}async function Gt(s){return Promise.resolve()}function Qt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Xt(){const s=N.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),r=decodeURIComponent(n.collectionName),l=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=le();let x;s[3]!==n.appSlug?(x={slug:n.appSlug},s[3]=n.appSlug,s[4]=x):x=s[4];const u=Oe(x)[0]??null,h=u?.id??"",v=h||"no-connection",T=h??null;let _;s[5]!==i.id||s[6]!==i.slug||s[7]!==T?(_={connectionId:T,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=T,s[8]=_):_=s[8];const O=ce(_),A=Ee(v,r,O);let w;s[9]!==A||s[10]!==l?(w=async D=>{l&&await A.update.mutateAsync({id:l,data:D})},s[9]=A,s[10]=l,s[11]=w):w=s[11];const k=w;let I;s[12]!==r?(I=r?.toLowerCase(),s[12]=r,s[13]=I):I=s[13];const g=I,S=g&&Ht[g];let y;s[14]!==r?(y=Qt(r),s[14]=r,s[15]=y):y=s[15];const $=y;let j;s[16]!==i.slug?(j=t.jsx(J,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=j):j=s[17];let P;s[18]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(X,{}),s[18]=P):P=s[18];let L;s[19]!==r||s[20]!==u||s[21]!==i.slug||s[22]!==n.appSlug?(L=u&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:r},children:u.title})})}),t.jsx(X,{})]}),s[19]=r,s[20]=u,s[21]=i.slug,s[22]=n.appSlug,s[23]=L):L=s[23];let M;s[24]!==$?(M=t.jsx(J,{children:t.jsx(De,{children:$})}),s[24]=$,s[25]=M):M=s[25];let R;s[26]!==L||s[27]!==M||s[28]!==j?(R=t.jsx(Ae,{children:t.jsxs(Re,{children:[j,P,L,M]})}),s[26]=L,s[27]=M,s[28]=j,s[29]=R):R=s[29];const z=R;if(S){let D;return s[30]!==S||s[31]!==c||s[32]!==k||s[33]!==l?(D=t.jsx(S,{itemId:l,onBack:c,onUpdate:k}),s[30]=S,s[31]=c,s[32]=k,s[33]=l,s[34]=D):D=s[34],D}let p;s[35]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Et,{size:36,className:"text-muted-foreground"}),s[35]=p):p=s[35];let E;s[36]!==c?(E=t.jsx(Pt,{icon:p,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=E):E=s[37];let V;return s[38]!==z||s[39]!==E?(V=t.jsx(xe,{breadcrumb:z,children:E}),s[38]=z,s[39]=E,s[40]=V):V=s[40],V}function Yt(){const s=N.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let l;return s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Xt,{}),s[2]=l):l=s[2],l}function Tn(){const s=N.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Te,{children:t.jsx(C.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ie,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Tn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as B,j as s,c as M,B as V}from"./index-Dl2t23Jt.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-C6XDnng5.js";import{i as L,n as O,b as R,d as A,c as F}from"./XClose-DY7O9VST.js";import{i as S}from"./ChevronDown-tb8ftSUO.js";import{a as I,b as K,c as P,T as W}from"./tooltip-CxizQODk.js";import{V as q}from"./view-mode-toggle-C9HAxT_f.js";import{B as G}from"./badge-_ZGDO29b.js";function te(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(A,{})},{value:"cards",icon:s.jsx(F,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{te as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{H as ge,aI as Ie,aJ as Ae,J as ce,aK as $e,e as P,j as t,l as je,B as G,r as X,c as ve,s as J,w as De,K as ie,f as Y,aL as de,u as Pe,aM as Oe,E as Me,g as ze,o as Ve,z as Ee,C as Ue,G as Fe,aN as Le,x as Q,F as Re}from"./index-Dl2t23Jt.js";import{g as He}from"./constants-CVDNjJTw.js";import{E as be}from"./empty-state-Be0X9mox.js";import{E as Be,c as Ge,r as We,b as Xe,d as Ke}from"./connection-form-helpers-CUlzSClK.js";import{c as qe,S as Qe}from"./index-BycfnvwM.js";import{u as Ne,T as Je}from"./tools-list-COvHAWAZ.js";import{u as Ye}from"./use-members-s6X83kyp.js";import{A as Ze}from"./avatar-C4FRugJb.js";import{a as ye,b as _e,u as et}from"./use-connection-pSv7eY2y.js";import{u as ae,S as tt}from"./constants-CfwGLQ49.js";import{b as st}from"./use-mcp-tools-BdYIFx9S.js";import{g as re,M as nt,a as ot}from"./types-CvYZZZog.js";import{T as ee,b as it,c as te,a as at,d as rt}from"./tabs-6T1N4Szc.js";import{I as ne}from"./integration-icon-BipCD_m-.js";import{s as lt}from"./Plus-BrBimbff.js";import{a as Se}from"./Settings02-BOckjEVU.js";import{s as le}from"./Trash01-DaGrAtTq.js";import{e as ct,d as dt,r as mt,c as ut,s as xt}from"./index-Bcf94soS.js";import{F as L,b as R,c as H,d as V,f as B,e as pt,a as ft}from"./form-BC40Nvzi.js";import{I as W}from"./input-CluxDyoT.js";import{u as ht,D as gt}from"./use-delete-connection-BNRuOYcY.js";import{V as jt}from"./layout-CV5Wi0Ex.js";import{c as vt,C as bt,B as Nt,a as yt,b as _t,d as St,e as Ct}from"./monitoring-stats-row-C8V4hqSK.js";import{b as wt}from"./use-virtual-mcp-BHEEZv3B.js";import{i as Ce}from"./ChevronRight-BIm0-OSp.js";import{a as we}from"./Users03-DH9QAbco.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{c as kt}from"./ZapSquare-BDbWe-zU.js";import{T as Tt,a as It}from"./agent-icon-BXkkrCT3.js";import{b as At}from"./Tool01-D1Rvo01i.js";import{C as $t}from"./collection-search-u94VKjvs.js";import{C as Dt}from"./card-oSxwoJvZ.js";import{B as Pt}from"./badge-_ZGDO29b.js";import{D as Ot,a as Mt,b as zt,c as me}from"./dropdown-menu-C6XDnng5.js";import{S as ue,a as xe,b as pe,c as fe,d as F}from"./select-C0JTp_6a.js";import{i as Vt}from"./CheckCircle-D9qlmIve.js";import{t as Et}from"./ChevronDown-tb8ftSUO.js";import{n as Ut}from"./Container-BCDxdJoG.js";import{s as se}from"./Star01-PFA-ZRDO.js";import{a as Ft}from"./RefreshCcw01-Cr84gVY8.js";import{s as Lt}from"./XClose-DY7O9VST.js";import"./collections-Cn7VbUFT.js";import"./SearchMd-IP-R-mtT.js";import"./index-M_qlHNIS.js";import"./index-CFyIm5CH.js";import"./extract-connection-data-CuIeY90s.js";import"./use-registry-connections-CMFnR2M3.js";import"./use-organization-settings-Dak2xww8.js";import"./index-B0TkoX1b.js";import"./popover-vU5pf5HQ.js";import"./tooltip-CxizQODk.js";import"./use-create-virtual-mcp-1DfbQRRy.js";import"./use-navigate-to-agent-Tn-rhKXX.js";import"./use-org-auth-client-CS0Acn4M.js";import"./User01-DmtseI1g.js";import"./use-collections-CwD8DZNY.js";import"./X-viKat0oa.js";import"./label-CHKFYnQo.js";import"./alert-dialog-BvuFarFf.js";import"./AlertCircle-CbUYZGF-.js";import"./ArrowNarrowLeft-DHj5-FLY.js";import"./XCircle-DZEMwZj2.js";import"./ArrowUpRight-BK_iYZ-J.js";import"./ChevronUp-ClqSoLtD.js";import"./DotsVertical-DEE8M0V4.js";import"./Palette-BrJL0UcN.js";import"./LinkExternal01-DM7IwrPj.js";import"./Lock01-BmjkKSvK.js";import"./Sun-B7BWJEHb.js";import"./Play-DSYx2GJ2.js";import"./Shield01-CJggUHAQ.js";import"./Zap-BMzMPNv3.js";const Rt=ge({scopes:$e(ce()).describe("List of scopes available"),stateSchema:Ie(ce(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Ht=[{name:"MCP_CONFIGURATION",inputSchema:ge({}),outputSchema:Rt}];function Bt(s){const e=P.c(39),{instance:n,onConfigure:i,onAuthenticate:r,onDelete:o}=s;let a;e[0]!==n.id?(a={connectionId:n.id},e[0]=n.id,e[1]=a):a=e[1];const c=Ne(a),d=!(n.connection_type==="VIRTUAL")&&c.supportsOAuth&&!c.isAuthenticated,u=d?"border-destructive/50 bg-destructive/5":"border-transparent";let p;e[2]!==u?(p=ve("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=p):p=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(ne,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=e[6];let f;e[7]!==n.title?(f=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=f):f=e[8];let g;e[9]!==d?(g=d&&t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}),e[9]=d,e[10]=g):g=e[10];let v;e[11]!==f||e[12]!==g?(v=t.jsxs("div",{className:"flex-1 min-w-0",children:[f,g]}),e[11]=f,e[12]=g,e[13]=v):v=e[13];let b;e[14]!==n||e[15]!==d||e[16]!==r?(b=d&&t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[14]=n,e[15]=d,e[16]=r,e[17]=b):b=e[17];let j;e[18]!==n||e[19]!==i?(j=()=>i(n),e[18]=n,e[19]=i,e[20]=j):j=e[20];let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Se,{size:13}),e[21]=_):_=e[21];let w;e[22]!==j?(w=t.jsx(G,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,title:"Configure",children:_}),e[22]=j,e[23]=w):w=e[23];let S;e[24]!==n||e[25]!==o?(S=()=>o(n),e[24]=n,e[25]=o,e[26]=S):S=e[26];let N;e[27]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(le,{size:13}),e[27]=N):N=e[27];let k;e[28]!==S?(k=t.jsx(G,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:S,title:"Delete",children:N}),e[28]=S,e[29]=k):k=e[29];let y;e[30]!==w||e[31]!==k||e[32]!==b?(y=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[b,w,k]}),e[30]=w,e[31]=k,e[32]=b,e[33]=y):y=e[33];let C;return e[34]!==y||e[35]!==p||e[36]!==l||e[37]!==v?(C=t.jsxs("div",{className:p,children:[l,v,y]}),e[34]=y,e[35]=p,e[36]=l,e[37]=v,e[38]=C):C=e[38],C}function Gt(s){const e=P.c(15),{instance:n,onConfigure:i}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(ne,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let a;e[5]!==n||e[6]!==i?(a=()=>i(n),e[5]=n,e[6]=i,e[7]=a):a=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Se,{size:13}),e[8]=c):c=e[8];let m;e[9]!==a?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(G,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a,title:"Configure",children:c})}),e[9]=a,e[10]=m):m=e[10];let d;return e[11]!==r||e[12]!==o||e[13]!==m?(d=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,m]}),e[11]=r,e[12]=o,e[13]=m,e[14]=d):d=e[14],d}function Wt(s){const e=P.c(25),{instances:n,onConfigure:i,onAuthenticate:r,onDelete:o,onAdd:a,isAdding:c}=s;if(n.length===0)return null;const m=n.length===1?"Instance":"Instances";let d;e[0]!==m?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[0]=m,e[1]=d):d=e[1];let u;e[2]!==c?(u=c?t.jsx(je,{size:13,className:"animate-spin"}):t.jsx(lt,{size:13}),e[2]=c,e[3]=u):u=e[3];let p;e[4]!==c||e[5]!==a||e[6]!==u?(p=t.jsxs(G,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:a,disabled:c,children:[u,"Add instance"]}),e[4]=c,e[5]=a,e[6]=u,e[7]=p):p=e[7];let l;e[8]!==d||e[9]!==p?(l=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,p]}),e[8]=d,e[9]=p,e[10]=l):l=e[10];let f;if(e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==o){let b;e[16]!==r||e[17]!==i||e[18]!==o?(b=j=>t.jsx(X.Suspense,{fallback:t.jsx(Gt,{instance:j,onConfigure:i}),children:t.jsx(Bt,{instance:j,onConfigure:i,onAuthenticate:r,onDelete:o})},j.id),e[16]=r,e[17]=i,e[18]=o,e[19]=b):b=e[19],f=n.map(b),e[11]=n,e[12]=r,e[13]=i,e[14]=o,e[15]=f}else f=e[15];let g;e[20]!==f?(g=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:f}),e[20]=f,e[21]=g):g=e[21];let v;return e[22]!==l||e[23]!==g?(v=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,g]}),e[22]=l,e[23]=g,e[24]=v):v=e[24],v}const Xt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Kt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const qt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Qt(s){const e=P.c(4),{connectionId:n,orgId:i,orgSlug:r,timeframe:o}=s;let a;e[0]!==i||e[1]!==r?(a={connectionId:tt,orgId:i,orgSlug:r},e[0]=i,e[1]=r,e[2]=a):a=e[2];const c=ae(a),m=Kt(o),{data:d}=De({queryKey:ie.connectionActivity(n,o,i),queryFn:async()=>{const g=await c.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:m.startDate.toISOString(),endDate:m.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return g.structuredContent??g},staleTime:3e5}),u=vt(d?.logs??[],m),p=u.data,l=u.totalCalls>0;let f;return e[3]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[3]=f):f=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),f]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),l?t.jsxs("div",{children:[t.jsx(bt,{config:qt,className:"h-16 w-full",children:t.jsxs(Nt,{data:p,barCategoryGap:"4%",children:[t.jsx(yt,{content:t.jsx(_t,{labelFormatter:Yt}),cursor:{fill:"var(--muted)"}}),t.jsx(St,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:p.map(Jt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[p.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Jt(s,e){return t.jsx(Ct,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function Yt(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function Zt(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function es(s){const e=P.c(14),{connectionId:n}=s,[i,r]=X.useState("14d"),{org:o}=J();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=a):a=e[0];let c;e[1]!==i?(c=Xt.map(l=>t.jsx("button",{type:"button",onClick:()=>r(l.value),className:ve("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===l.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:l.label},l.value)),e[1]=i,e[2]=c):c=e[2];let m;e[3]!==c?(m=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[a,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:c})]}),e[3]=c,e[4]=m):m=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Zt,{}),e[5]=d):d=e[5];let u;e[6]!==n||e[7]!==o.id||e[8]!==o.slug||e[9]!==i?(u=t.jsx(X.Suspense,{fallback:d,children:t.jsx(Qt,{connectionId:n,orgId:o.id,orgSlug:o.slug,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=o.slug,e[9]=i,e[10]=u):u=e[10];let p;return e[11]!==m||e[12]!==u?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,u]}),e[11]=m,e[12]=u,e[13]=p):p=e[13],p}function ts(s){const e=P.c(15),{virtualMcp:n,org:i}=s,r=Y();let o;e[0]!==r||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{size:16}),e[4]=a):a=e[4];let c;e[5]!==n.icon||e[6]!==n.title?(c=t.jsx(ne,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[5]=n.icon,e[6]=n.title,e[7]=c):c=e[7];let m;e[8]!==n.title?(m=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=m):m=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==o||e[12]!==c||e[13]!==m?(u=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[c,m,d]}),e[11]=o,e[12]=c,e[13]=m,e[14]=u):u=e[14],u}function ss(s){const e=P.c(7),{virtualMcps:n,org:i}=s;let r;if(e[0]!==i||e[1]!==n){let a;e[3]!==i?(a=c=>t.jsx(ts,{virtualMcp:c,org:i},c.id),e[3]=i,e[4]=a):a=e[4],r=n.map(a),e[0]=i,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function ns(s){const e=P.c(7),{connection:n}=s,{org:i}=J();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=wt(r);if(!(o.length>0)){let d;return e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(t.Fragment,{}),e[2]=d):d=e[2],d}let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=c):c=e[3];let m;return e[4]!==i.slug||e[5]!==o?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[c,t.jsx("div",{className:"px-5 py-4",children:t.jsx(ss,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=m):m=e[6],m}function os(s){const e=P.c(31),{tools:n,connectionId:i,org:r}=s,o=Y(),{org:a}=J();let c;e[0]!==i||e[1]!==a.id||e[2]!==a.slug?(c={connectionId:i,orgId:a.id,orgSlug:a.slug},e[0]=i,e[1]=a.id,e[2]=a.slug,e[3]=c):c=e[3];const m=ae(c),d=ye(i);let u;e[4]!==d||e[5]!==i?(u=d?ke(d):i,e[4]=d,e[5]=i,e[6]=u):u=e[6];const p=u,[l,f]=X.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==m||e[9]!==o||e[10]!==r||e[11]!==l||e[12]!==n){const S=(n??[]).filter(is),N=l.toLowerCase().trim(),k=N?S.filter(h=>h.name.toLowerCase().includes(N)||h.description&&h.description.toLowerCase().includes(N)):S;let y;e[17]!==p||e[18]!==o||e[19]!==r?(y=h=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[17]=p,e[18]=o,e[19]=r,e[20]=y):y=e[20];const C=y;b="flex flex-col h-full overflow-hidden";let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[21]=I):I=e[21],e[22]!==l?(j=t.jsx($t,{value:l,onChange:f,placeholder:"Search apps...",onKeyDown:I}),e[22]=l,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=k.length===0?t.jsx(be,{image:null,title:l?"No apps found":"No apps available",description:l?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:k.map(h=>{const A=re(h._meta);return t.jsxs(Dt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>C(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(nt,{resourceURI:A,toolInfo:{tool:h},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),t.jsx(Je,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.name)})}),e[7]=p,e[8]=m,e[9]=o,e[10]=r,e[11]=l,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let _;e[24]!==g||e[25]!==v?(_=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=_):_=e[26];let w;return e[27]!==b||e[28]!==j||e[29]!==_?(w=t.jsxs("div",{className:b,children:[j,_]}),e[27]=b,e[28]=j,e[29]=_,e[30]=w):w=e[30],w}function is(s){return!!re(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=a=>a.charAt(0).toUpperCase()+a.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&i.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function oe(s){const e=P.c(2),{label:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=i):i=e[1],i}function as(s){const e=P.c(50),{tools:n,prompts:i,resources:r,connectionId:o,org:a}=s;let c;e[0]!==i?(c=i===void 0?[]:i,e[0]=i,e[1]=c):c=e[1];const m=c;let d;e[2]!==r?(d=r===void 0?[]:r,e[2]=r,e[3]=d):d=e[3];const u=d,p=Y(),l=ye(o??"");let f;e[4]!==l||e[5]!==o?(f=l?ke(l):o,e[4]=l,e[5]=o,e[6]=f):f=e[6];const g=f;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==a?(v=function($){!o||!a||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:g,collectionName:"tools",itemId:encodeURIComponent($)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=a,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==a||e[14]!==n?(j=o&&a&&n.some(cs),e[12]=o,e[13]=a,e[14]=n,e[15]=j):j=e[15];const _=j;if(n.length+m.length+u.length===0){let x;return e[16]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=x):x=e[16],x}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let N;e[19]!==_?(N=_&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=_,e[20]=N):N=e[20];let k,y;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),y=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=k,e[22]=y):(k=e[21],y=e[22]);let C;e[23]!==S||e[24]!==N?(C=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(it,{variant:"underline",className:"gap-1",children:[S,N,k,y]})}),e[23]=S,e[24]=N,e[25]=C):C=e[25];let I;e[26]!==b||e[27]!==n?(I=n.length>0?n.map(x=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(x.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(At,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(x.name)}),x.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:x.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},x.name)):t.jsx(oe,{label:"tools"}),e[26]=b,e[27]=n,e[28]=I):I=e[28];let h;e[29]!==I?(h=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:I})}),e[29]=I,e[30]=h):h=e[30];let A;e[31]!==o||e[32]!==_||e[33]!==a||e[34]!==n?(A=_&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(os,{tools:n,connectionId:o,org:a})}),e[31]=o,e[32]=_,e[33]=a,e[34]=n,e[35]=A):A=e[35];let M;e[36]!==m?(M=m.length>0?m.map(ls):t.jsx(oe,{label:"prompts"}),e[36]=m,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let T;e[40]!==u?(T=u.length>0?u.map(rs):t.jsx(oe,{label:"resources"}),e[40]=u,e[41]=T):T=e[41];let z;e[42]!==T?(z=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:T})}),e[42]=T,e[43]=z):z=e[43];let E;return e[44]!==C||e[45]!==h||e[46]!==A||e[47]!==O||e[48]!==z?(E=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(at,{defaultValue:"tools",variant:"underline",children:[C,h,A,O,z]})}),e[44]=C,e[45]=h,e[46]=A,e[47]=O,e[48]=z,e[49]=E):E=e[49],E}function rs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Tt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function ls(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(kt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function cs(s){return re(s._meta)}function ds(s){const e=P.c(13),{connection:n,displayTitle:i}=s,r=i??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(ne,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let a;e[3]!==r?(a=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=a):a=e[4];let c;e[5]!==n.description?(c=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=c):c=e[6];let m;e[7]!==a||e[8]!==c?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,c]}),e[7]=a,e[8]=c,e[9]=m):m=e[9];let d;return e[10]!==o||e[11]!==m?(d=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,m]}),e[10]=o,e[11]=m,e[12]=d):d=e[12],d}function ms({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:r}){const o=de({control:s.control,name:"ui_type"}),a=de({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Pe(),m=(()=>{if(typeof a!="string"||!a)return!1;try{const l=new URL(a);return l.hostname==="api.githubcopilot.com"&&l.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),d=c||e.connection_type==="STDIO",u=e.connection_type==="VIRTUAL",p=u?Oe(e.connection_url):null;return u?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(ue,{value:l.value,onValueChange:l.onChange,children:[t.jsx(V,{children:t.jsxs(xe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(pe,{})]})}),t.jsxs(fe,{children:[t.jsx(F,{value:"HTTP",children:"HTTP"}),t.jsx(F,{value:"SSE",children:"SSE"}),t.jsx(F,{value:"Websocket",children:"Websocket"}),d&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:"NPX Package"}),t.jsx(F,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(R,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(W,{placeholder:"https://example.com/mcp",...f,value:f.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(ue,{value:l.value,onValueChange:l.onChange,children:[t.jsx(V,{children:t.jsx(xe,{className:"h-10",children:t.jsx(pe,{})})}),t.jsxs(fe,{children:[t.jsx(F,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(F,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(F,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),d&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(F,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(It,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(B,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(V,{children:t.jsx(W,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(V,{children:t.jsx(W,{placeholder:"node, bun, python...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(V,{children:t.jsx(W,{placeholder:"arg1 arg2 --flag value",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(B,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(V,{children:t.jsx(W,{placeholder:"/path/to/project (optional)",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(V,{children:t.jsx(Be,{value:l.value??[],onChange:l.onChange})}),t.jsx(B,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(R,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:m?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ot,{children:[t.jsx(Mt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Pt,{variant:"success",className:"gap-1.5",children:[t.jsx(Vt,{size:12}),"Authenticated via OAuth",t.jsx(Et,{size:12})]})})}),t.jsxs(zt,{align:"start",children:[t.jsxs(me,{onClick:i,children:[t.jsx(Ft,{size:16}),"Re-authenticate"]}),t.jsxs(me,{variant:"destructive",onClick:r,children:[t.jsx(le,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&l.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>l.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Lt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(W,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(pt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(B,{})]})})]})}function us(s){return s.command==="npx"}function xs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function ps(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function he(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Le(s.connection_headers)){const i=s.connection_headers,r=We(i.envVars);if(us(i)){const a=xs(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=ps(i);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function fs(s){let e,n=null,i=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Ke(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function hs({connection:s,connectionId:e,org:n,isUpdating:i,tools:r,prompts:o,resources:a,siblings:c}){const m=Y({from:"/$org/settings/connections/$appSlug"}),d=Ve(),u=_e(),{org:p}=J(),l=ht({onSuccess:()=>{c.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[f,g]=X.useState(null),[v,b]=X.useState(!1),j=Ne({connectionId:e}),{data:_}=Ye(),w=_?.data?.members??[],S=f??s,N=w.find(x=>x.userId===S.created_by),y=s?.connection_type==="VIRTUAL"||j.isAuthenticated,C={...s,tools:r},I=qe(C,Ht),h=Ee({resolver:Ue(Ge),values:he(f??s)}),A=h.formState.isDirty,M=async()=>{if(!await h.trigger())return;const $=h.getValues(),D=fs($),U=f?.id??e;await u.update.mutateAsync({id:U,data:D}),h.reset($)},O=()=>{h.reset(he(f??s))},T=async x=>{const{token:$,tokenInfo:D,error:U}=await Re({connectionId:x,orgSlug:p.slug,scope:"offline_access"});if(U||!$){Q.error(`Authentication failed: ${U}`);return}if(D)try{const K=await fetch(`/api/${p.slug}/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await u.update.mutateAsync({id:x,data:{connection_token:$}});else try{await u.update.mutateAsync({id:x,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await u.update.mutateAsync({id:x,data:{connection_token:$}})}else await u.update.mutateAsync({id:x,data:{connection_token:$}});const q=new URL(`/api/${p.slug}/mcp/${x}`,window.location.origin);await d.invalidateQueries({queryKey:ie.isMCPAuthenticated(q.href,null)}),Q.success("Authentication successful")},z=()=>T(s.id),E=async()=>{try{const x=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const D=await x.text();Q.error(`Failed to remove OAuth: ${D}`);return}const $=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await d.invalidateQueries({queryKey:ie.isMCPAuthenticated($.href,null)}),Q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(x){console.error("Error removing OAuth token:",x),Q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(gt,{...l}),t.jsx(ct,{open:f!==null,onOpenChange:x=>{x||g(null)},children:t.jsxs(dt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(mt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(ut,{className:"text-base",children:f?.title??s.title}),t.jsx(xt,{className:"text-xs",children:"Update URL, authentication, and other settings"}),N&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:N.user?.image??void 0,fallback:N.user?.name??N.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:N.user?.name||N.user?.email})]})]}),t.jsxs(ft,{...h,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(L,{control:h.control,name:"title",render:({field:x})=>t.jsxs(R,{children:[t.jsx(H,{children:"Name"}),t.jsx(V,{children:t.jsx(W,{...x})}),t.jsx(B,{})]})}),t.jsx(L,{control:h.control,name:"description",render:({field:x})=>t.jsxs(R,{children:[t.jsx(H,{children:"Description"}),t.jsx(V,{children:t.jsx(W,{...x,value:x.value||""})}),t.jsx(B,{})]})})]}),t.jsx(ms,{form:h,connection:f??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:z,onRemoveOAuth:E}),t.jsx(Qe,{connection:f??s,form:h,hasMcpBinding:I,isMCPAuthenticated:y,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:z,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(G,{onClick:M,disabled:!A||i,className:"flex-1",children:i?"Saving…":"Save changes"}),A&&t.jsx(G,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(G,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const x=f??s;g(null),l.requestDelete(x)},children:[t.jsx(le,{size:15}),"Delete"]})]})]},f?.id??s.id)]})}),t.jsx(jt,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(ds,{connection:s,displayTitle:(()=>{const x=c[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(es,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Wt,{instances:c,onConfigure:x=>g(x),onAuthenticate:x=>T(x.id),onDelete:x=>l.requestDelete(x),isAdding:v,onAdd:async()=>{b(!0);try{const x=c[0]??s,$=x.title.replace(/\s*\(\d+\)\s*$/,""),D=c.length+1,U=`${$} (${D})`,q=He("conn");await u.create.mutateAsync({id:q,title:U,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${q}`,window.location.origin),Z=await Fe({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await T(q)}finally{b(!1)}}}),t.jsx(ns,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(as,{tools:r,prompts:o,resources:a,connectionId:e,org:n})})]})})]})})]})}function gs(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:r,org:o}=ze(i),{org:a}=J(),c=_e();let m;s[2]!==r?(m={slug:r},s[2]=r,s[3]=m):m=s[3];const d=et(m),u=d[0]??null,p=u?.id??"",l=p||null;let f;s[4]!==a.id||s[5]!==a.slug||s[6]!==l?(f={connectionId:l,orgId:a.id,orgSlug:a.slug},s[4]=a.id,s[5]=a.slug,s[6]=l,s[7]=f):f=s[7];const g=ae(f);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=st(v);let j;if(s[10]!==u?.tools||s[11]!==p||s[12]!==d||s[13]!==b){const T=b?b.tools.map(_s):(u?.tools??[]).map(ys);e:{if(d.length<=1){j=T;break e}const z=new Set,E=[],x=bs;for(const $ of d){const D=$.id===p?T:x($.tools);for(const U of D)z.has(U.name)||(z.add(U.name),E.push(U))}j=E.length>0?E:T}s[10]=u?.tools,s[11]=p,s[12]=d,s[13]=b,s[14]=j}else j=s[14];const _=j;let w;s[15]!==g?(w={client:g},s[15]=g,s[16]=w):w=s[16];const{data:S}=rt(w);let N;s[17]!==g?(N={client:g},s[17]=g,s[18]=N):N=s[18];const{data:k}=ot(N);let y;s[19]!==S?.prompts?(y=S?.prompts??[],s[19]=S?.prompts,s[20]=y):y=s[20];let C;s[21]!==y?(C=y.map(vs),s[21]=y,s[22]=C):C=s[22];const I=C;let h;s[23]!==k?.resources?(h=k?.resources??[],s[23]=k?.resources,s[24]=h):h=s[24];let A;s[25]!==h?(A=h.map(js),s[25]=h,s[26]=A):A=s[26];const M=A;if(!u){let T;return s[27]!==n||s[28]!==o?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(be,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(G,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=T):T=s[29],T}let O;return s[30]!==c.update.isPending||s[31]!==_||s[32]!==u||s[33]!==p||s[34]!==o||s[35]!==I||s[36]!==M||s[37]!==d?(O=t.jsx(hs,{org:o,connection:u,connectionId:p,isUpdating:c.update.isPending,tools:_,prompts:I,resources:M,siblings:d}),s[30]=c.update.isPending,s[31]=_,s[32]=u,s[33]=p,s[34]=o,s[35]=I,s[36]=M,s[37]=d,s[38]=O):O=s[38],O}function js(s){return{name:s.name,description:s.description,uri:s.uri}}function vs(s){return{name:s.name,description:s.description}}function bs(s){return(s??[]).map(Ns)}function Ns(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ys(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function _s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ss(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(gs,{})})}),s[0]=e):e=s[0],e}function Bn(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ss,{}),s[0]=e):e=s[0],e}export{Bn as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as ie,j as t,E as Ye,r as W,l as ce,s as _e,f as Se,d as Je,b as be,u as Ze,Q as et,R as tt,z as nt,C as st,B,t as te,o as ot,c as re,x as G,G as it,F as lt,K as ct}from"./index-Dl2t23Jt.js";import{g as rt}from"./constants-CVDNjJTw.js";import{C as at}from"./collection-display-button-CPI0oCFf.js";import{S as dt}from"./search-input-CslwpPEh.js";import{C as mt}from"./collection-tabs-DW1xYGdq.js";import{u as ut,a as Ne,g as pt,C as fe}from"./connection-card-BPUe3B60.js";import{E as ht}from"./empty-state-Be0X9mox.js";import{I as xt}from"./integration-icon-BipCD_m-.js";import{P as de}from"./index-Bcf94soS.js";import{u as gt,D as ft}from"./use-delete-connection-BNRuOYcY.js";import{u as jt}from"./use-infinite-scroll-Ca5zEcXn.js";import{u as yt}from"./use-list-state-Jttwyvy3.js";import{g as ke,a as Ct,e as vt}from"./extract-connection-data-CuIeY90s.js";import{g as ue}from"./connection-slug-eyAPH6o3.js";import{c as De,d as Ae,b as we,f as Te,e as Ie,g as Pe,a as Le,A as Oe}from"./alert-dialog-BvuFarFf.js";import{C as $e}from"./checkbox-CzxaEVzA.js";import{b as Ee,a as ze,c as Fe,d as Me,e as Ve,D as Be}from"./dialog-CoECADf1.js";import{b as _t,a as St,c as bt,D as Nt,d as kt,e as Dt,f as At}from"./drawer-DTk8g2vK.js";import{u as wt}from"./tooltip-CxizQODk.js";import{D as Re,a as Ue,b as He,c as pe}from"./dropdown-menu-C6XDnng5.js";import{F as Q,b as Y,c as J,d as Z,f as ee,a as Ce}from"./form-BC40Nvzi.js";import{I as oe}from"./input-CluxDyoT.js";import{S as Tt,a as It,b as Pt,c as Lt,d as le}from"./select-C0JTp_6a.js";import{T as Ot}from"./textarea-Cld3tG5R.js";import{b as Ke,u as $t}from"./use-connection-pSv7eY2y.js";import{u as Et,S as zt}from"./constants-CfwGLQ49.js";import{b as Ft}from"./use-virtual-mcp-BHEEZv3B.js";import{a as Mt,S as Vt}from"./agent-icon-BXkkrCT3.js";import{n as he}from"./Container-BCDxdJoG.js";import{i as We}from"./DotsVertical-DEE8M0V4.js";import{s as Xe}from"./RefreshCcw01-Cr84gVY8.js";import{s as ge}from"./Star01-PFA-ZRDO.js";import{s as qe}from"./Plus-BrBimbff.js";import{s as Ge}from"./Trash01-DaGrAtTq.js";import{s as Qe}from"./XClose-DY7O9VST.js";import{i as me,a as ve,E as Bt,c as Rt,p as Ut,b as Ht,d as Kt}from"./connection-form-helpers-CUlzSClK.js";import"./collections-Cn7VbUFT.js";import"./ChevronDown-tb8ftSUO.js";import"./view-mode-toggle-C9HAxT_f.js";import"./badge-_ZGDO29b.js";import"./SearchMd-IP-R-mtT.js";import"./use-registry-connections-CMFnR2M3.js";import"./use-organization-settings-Dak2xww8.js";import"./useInfiniteQuery-3jN4yA7O.js";import"./infiniteQueryObserver-cqTNhL_G.js";import"./card-oSxwoJvZ.js";import"./X-viKat0oa.js";import"./use-view-mode-w75x4zz0.js";import"./ChevronRight-BIm0-OSp.js";import"./label-CHKFYnQo.js";import"./ChevronUp-ClqSoLtD.js";import"./use-collections-CwD8DZNY.js";import"./AlertCircle-CbUYZGF-.js";import"./Tool01-D1Rvo01i.js";import"./ArrowNarrowLeft-DHj5-FLY.js";import"./XCircle-DZEMwZj2.js";import"./ArrowUpRight-BK_iYZ-J.js";import"./ZapSquare-BDbWe-zU.js";import"./Users03-DH9QAbco.js";import"./CheckCircle-D9qlmIve.js";import"./Palette-BrJL0UcN.js";import"./LinkExternal01-DM7IwrPj.js";import"./Lock01-BmjkKSvK.js";import"./Sun-B7BWJEHb.js";import"./Play-DSYx2GJ2.js";import"./Settings02-BOckjEVU.js";import"./Shield01-CJggUHAQ.js";import"./User01-DmtseI1g.js";import"./Zap-BMzMPNv3.js";function Wt(y){const e=ie.c(51),{group:n,onOpen:g,selectionMode:m,selectedIds:d,onToggleSelect:o}=y;let v;if(e[0]!==n.connections||e[1]!==d){let j;e[3]!==d?(j=R=>d.has(R.id),e[3]=d,e[4]=j):j=e[4],v=n.connections.every(j),e[0]=n.connections,e[1]=d,e[2]=v}else v=e[2];const h=v;let _;if(e[5]!==n.connections||e[6]!==d){let j;e[8]!==d?(j=R=>d.has(R.id),e[8]=d,e[9]=j):j=e[9],_=n.connections.some(j),e[5]=n.connections,e[6]=d,e[7]=_}else _=e[7];const u=_,S=`${n.connections.length} instances`;let x;e[10]!==n.icon||e[11]!==n.title||e[12]!==S?(x={title:n.title,icon:n.icon,description:S},e[10]=n.icon,e[11]=n.title,e[12]=S,e[13]=x):x=e[13];let a;e[14]!==h||e[15]!==n.connections||e[16]!==g||e[17]!==o||e[18]!==d||e[19]!==m?(a=()=>m?(()=>{for(const j of n.connections)h?d.has(j.id)&&o(j.id):d.has(j.id)||o(j.id)})():g(),e[14]=h,e[15]=n.connections,e[16]=g,e[17]=o,e[18]=d,e[19]=m,e[20]=a):a=e[20];const p=m&&h&&"ring-2 ring-primary",f=m&&u&&!h&&"ring-1 ring-primary/50";let k;e[21]!==p||e[22]!==f?(k=re(p,f),e[21]=p,e[22]=f,e[23]=k):k=e[23];let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(he,{}),e[24]=A):A=e[24];let N;e[25]!==h||e[26]!==n.connections||e[27]!==o||e[28]!==d||e[29]!==m||e[30]!==u?(N=m?t.jsx($e,{checked:h?!0:u?"indeterminate":!1,onCheckedChange:()=>{for(const j of n.connections)h?d.has(j.id)&&o(j.id):d.has(j.id)||o(j.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=h,e[26]=n.connections,e[27]=o,e[28]=d,e[29]=m,e[30]=u,e[31]=N):N=e[31];const I=m?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let s;e[32]!==I?(s=re("overflow-hidden transition-all duration-150 ease-out",I),e[32]=I,e[33]=s):s=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(Ue,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qt,children:t.jsx(We,{size:20})})}),e[34]=D):D=e[34];let M;e[35]!==g?(M=j=>{j.stopPropagation(),g()},e[35]=g,e[36]=M):M=e[36];let $;e[37]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Xe,{size:16}),e[37]=$):$=e[37];let P;e[38]!==M?(P=t.jsxs(Re,{children:[D,t.jsx(He,{align:"end",onClick:Xt,children:t.jsxs(pe,{onClick:M,children:[$,"Open"]})})]}),e[38]=M,e[39]=P):P=e[39];let T;e[40]!==s||e[41]!==P?(T=t.jsx("div",{className:s,children:P}),e[40]=s,e[41]=P,e[42]=T):T=e[42];let z;e[43]!==N||e[44]!==T?(z=t.jsxs("div",{className:"flex items-center gap-1",children:[N,T]}),e[43]=N,e[44]=T,e[45]=z):z=e[45];let F;return e[46]!==z||e[47]!==x||e[48]!==a||e[49]!==k?(F=t.jsx(t.Fragment,{children:t.jsx(fe,{connection:x,onClick:a,className:k,fallbackIcon:A,headerActionsAlwaysVisible:!0,headerActions:z})}),e[46]=z,e[47]=x,e[48]=a,e[49]=k,e[50]=F):F=e[50],F}function Xt(y){return y.stopPropagation()}function qt(y){return y.stopPropagation()}function Gt(y){const e=ie.c(28),{count:n,total:g,onSelectAll:m,onDeselectAll:d,onDelete:o,onAddToAgent:v,onToggleStatus:h,onCancel:_}=y;if(n===0)return null;let u;e[0]!==n?(u=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=u):u=e[1];let S;e[2]!==n||e[3]!==d||e[4]!==m||e[5]!==g?(S=n<g?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:["Select all (",g,")"]}):t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:"Clear selection"}),e[2]=n,e[3]=d,e[4]=m,e[5]=g,e[6]=S):S=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(qe,{size:13}),e[7]=x):x=e[7];let a;e[8]!==v?(a=t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:v,children:[x,"Add to Agent"]}),e[8]=v,e[9]=a):a=e[9];let p;e[10]!==h?(p=t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("active"),children:"Enable"}),e[10]=h,e[11]=p):p=e[11];let f;e[12]!==h?(f=t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("inactive"),children:"Disable"}),e[12]=h,e[13]=f):f=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ge,{size:13}),e[14]=k):k=e[14];let A;e[15]!==o?(A=t.jsxs(B,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:o,children:[k,"Delete"]}),e[15]=o,e[16]=A):A=e[16];let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Qe,{size:13}),e[17]=N):N=e[17];let I;e[18]!==_?(I=t.jsx(B,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:_,children:N}),e[18]=_,e[19]=I):I=e[19];let s;return e[20]!==u||e[21]!==I||e[22]!==S||e[23]!==a||e[24]!==p||e[25]!==f||e[26]!==A?(s=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:[u,S,a,p,f,A,I]})}),e[20]=u,e[21]=I,e[22]=S,e[23]=a,e[24]=p,e[25]=f,e[26]=A,e[27]=s):s=e[27],s}function Qt(y){const e=ie.c(25),{open:n,onOpenChange:g,agents:m,onConfirm:d}=y,[o,v]=W.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(Fe,{children:[t.jsx(Me,{children:"Add to Agent"}),t.jsx(Ve,{children:"Select an agent to add the selected connections to."})]}),e[0]=h):h=e[0];let _;e[1]!==m||e[2]!==o?(_=m.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):m.map(N=>t.jsxs("button",{type:"button",onClick:()=>v(N.id),className:re("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",o===N.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(xt,{icon:N.icon,name:N.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:N.title}),N.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:N.description})]})]},N.id)),e[1]=m,e[2]=o,e[3]=_):_=e[3];let u;e[4]!==_?(u=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:_}),e[4]=_,e[5]=u):u=e[5];let S;e[6]!==g?(S=t.jsx(B,{variant:"outline",onClick:()=>g(!1),children:"Cancel"}),e[6]=g,e[7]=S):S=e[7];const x=!o;let a;e[8]!==d||e[9]!==g||e[10]!==o?(a=()=>{o&&(d(o),g(!1),v(null))},e[8]=d,e[9]=g,e[10]=o,e[11]=a):a=e[11];let p;e[12]!==x||e[13]!==a?(p=t.jsx(B,{disabled:x,onClick:a,children:"Add"}),e[12]=x,e[13]=a,e[14]=p):p=e[14];let f;e[15]!==S||e[16]!==p?(f=t.jsxs(Be,{children:[S,p]}),e[15]=S,e[16]=p,e[17]=f):f=e[17];let k;e[18]!==u||e[19]!==f?(k=t.jsxs(ze,{className:"sm:max-w-[400px]",children:[h,u,f]}),e[18]=u,e[19]=f,e[20]=k):k=e[20];let A;return e[21]!==g||e[22]!==n||e[23]!==k?(A=t.jsx(Ee,{open:n,onOpenChange:g,children:k}),e[21]=g,e[22]=n,e[23]=k,e[24]=A):A=e[24],A}function Yt(y){const e=ie.c(20),{open:n,onOpenChange:g,count:m,onConfirm:d}=y,o=m!==1?"s":"";let v;e[0]!==m||e[1]!==o?(v=t.jsxs(De,{children:["Delete ",m," connection",o,"?"]}),e[0]=m,e[1]=o,e[2]=v):v=e[2];const h=m!==1?"s":"";let _;e[3]!==h?(_=t.jsxs(Ae,{children:["This will permanently delete the selected connection",h,". This action cannot be undone."]}),e[3]=h,e[4]=_):_=e[4];let u;e[5]!==v||e[6]!==_?(u=t.jsxs(we,{children:[v,_]}),e[5]=v,e[6]=_,e[7]=u):u=e[7];let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Te,{children:"Cancel"}),e[8]=S):S=e[8];const x=m!==1?"s":"";let a;e[9]!==m||e[10]!==d||e[11]!==x?(a=t.jsxs(Ie,{children:[S,t.jsxs(Pe,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",m," connection",x]})]}),e[9]=m,e[10]=d,e[11]=x,e[12]=a):a=e[12];let p;e[13]!==u||e[14]!==a?(p=t.jsxs(Le,{children:[u,a]}),e[13]=u,e[14]=a,e[15]=p):p=e[15];let f;return e[16]!==g||e[17]!==n||e[18]!==p?(f=t.jsx(Oe,{open:n,onOpenChange:g,children:p}),e[16]=g,e[17]=n,e[18]=p,e[19]=f):f=e[19],f}function Jt(y){return y._registryId?.includes("community-registry")===!0}function Zt(y){const e=ie.c(56),{item:n,allConnections:g,connectedAppNames:m,connectingItemId:d,onNavigateConnected:o,onConnect:v}=y,[h,_]=W.useState(!1),[u,S]=W.useState(null);let x,a;e[0]!==m||e[1]!==n?(x=ke(n)??"",a=m.has(x),e[0]=m,e[1]=n,e[2]=x,e[3]=a):(x=e[2],a=e[3]);const p=a,f=n._meta?.["mcp.mesh"],k=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",A=n.server?.description||n.description||null;let N;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(N=n.server?.icons?.[0]?.src||Ct(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=N):N=e[6];const I=N;let s;if(e[7]!==g||e[8]!==x){let b;e[10]!==x?(b=se=>se.connection_type!=="VIRTUAL"&&se.app_name===x,e[10]=x,e[11]=b):b=e[11],s=g.filter(b),e[7]=g,e[8]=x,e[9]=s}else s=e[9];const D=s;let M;e[12]!==n?(M=Jt(n),e[12]=n,e[13]=M):M=e[13];const $=M;let P,T;e[14]!==D||e[15]!==$||e[16]!==p||e[17]!==n||e[18]!==v||e[19]!==o?(P=()=>{if(p){const b=D[0];b&&o(b);return}T()},T=()=>{$?(S("connect"),_(!0)):v(n)},e[14]=D,e[15]=$,e[16]=p,e[17]=n,e[18]=v,e[19]=o,e[20]=P,e[21]=T):(P=e[20],T=e[21]);let z;e[22]!==n||e[23]!==v||e[24]!==u?(z=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),_(!1),u==="connect"&&v(n),S(null)},e[22]=n,e[23]=v,e[24]=u,e[25]=z):z=e[25];const F=z;let j;e[26]!==A||e[27]!==I||e[28]!==k?(j={title:k,description:A,icon:I},e[26]=A,e[27]=I,e[28]=k,e[29]=j):j=e[29];let R;e[30]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(he,{}),e[30]=R):R=e[30];let U;e[31]!==$||e[32]!==n._sourceIcon?(U=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[31]=$,e[32]=n._sourceIcon,e[33]=U):U=e[33];let X;e[34]!==d||e[35]!==T||e[36]!==p||e[37]!==n.id?(X=p?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):t.jsx(B,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:d!==null,onClick:b=>{b.stopPropagation(),T()},children:d===n.id?t.jsx(ce,{size:14,className:"animate-spin"}):"Connect"}),e[34]=d,e[35]=T,e[36]=p,e[37]=n.id,e[38]=X):X=e[38];let i;e[39]!==U||e[40]!==X?(i=t.jsxs("div",{className:"flex items-center gap-2",children:[U,X]}),e[39]=U,e[40]=X,e[41]=i):i=e[41];let C;e[42]!==P||e[43]!==i||e[44]!==j?(C=t.jsx(fe,{connection:j,fallbackIcon:R,onClick:P,headerActionsAlwaysVisible:!0,headerActions:i}),e[42]=P,e[43]=i,e[44]=j,e[45]=C):C=e[45];let V;e[46]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(we,{children:[t.jsx(De,{children:"Community MCP Server"}),t.jsx(Ae,{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[46]=V):V=e[46];let H;e[47]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Te,{children:"Cancel"}),e[47]=H):H=e[47];let E;e[48]!==F?(E=t.jsxs(Le,{children:[V,t.jsxs(Ie,{children:[H,t.jsx(Pe,{onClick:F,children:"Continue"})]})]}),e[48]=F,e[49]=E):E=e[49];let l;e[50]!==h||e[51]!==E?(l=t.jsx(Oe,{open:h,onOpenChange:_,children:E}),e[50]=h,e[51]=E,e[52]=l):l=e[52];let O;return e[53]!==C||e[54]!==l?(O=t.jsxs(t.Fragment,{children:[C,l]}),e[53]=C,e[54]=l,e[55]=O):O=e[55],O}function en({listState:y,activeTab:e,typeFilter:n,statusFilter:g,registryFilter:m,enabledRegistries:d}){const{org:o}=_e(),v=ot(),h=Se(),{data:_}=be.useSession(),u=Ke(),S=$t(y),x=gt(),[a,p]=W.useState(new Set),f=a.size>0,[k,A]=W.useState(!1),[N,I]=W.useState(!1),[s,D]=W.useState(null),M=Ft(),$=S.filter(c=>!(n!=="ALL"&&c.connection_type!==n||g!=="ALL"&&c.status!==g)),P=pt($),T=c=>{p(r=>{const w=new Set(r);return w.has(c)?w.delete(c):w.add(c),w})},z=()=>{p(new Set)},F=Ne(d,y.searchTerm),j=F.items,R=jt(F.loadMore,F.hasMore,F.isLoadingMore),U=new Set(S.filter(c=>c.app_name).map(c=>c.app_name)),X=m==="ALL"||d.some(c=>c.id===m)?m:"ALL",i=y.search.length>0,C=e==="all"||i?j.filter(c=>{if(X!=="ALL"&&c._registryId!==X)return!1;if(i){const r=ke(c);if(r&&U.has(r))return!1}return!0}):[],V=e==="connected"||i?P:[],H=async c=>{if(!(!o||!_?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:c.id,source:"connections_page"}),D(c.id);try{const r=vt(c,o.id,_.user.id,{remoteIndex:0}),w=r.connection_type==="STDIO",L=!!r.connection_url,q=w&&r.connection_headers&&typeof r.connection_headers=="object"&&"command"in r.connection_headers;if(!L&&!q){G.error("This MCP Server cannot be connected: no connection method available"),D(null);return}const{id:K}=await u.create.mutateAsync(r),je=new URL(`/api/${o.slug}/mcp/${K}`,window.location.origin),ye=await it({url:je.href,token:null,orgId:o.id});if(ye.supportsOAuth&&!ye.isAuthenticated){const{token:ae,tokenInfo:ne,error:xe}=await lt({connectionId:K,orgSlug:o.slug,scope:"offline_access"});if(xe||!ae){te("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:xe??"no_token"}),G.error(`Authentication failed: ${xe??"no token received"}`);return}else{if(te("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),ne)try{(await fetch(`/api/${o.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:ne.accessToken,refreshToken:ne.refreshToken,expiresIn:ne.expiresIn,scope:ne.scope,clientId:ne.clientId,clientSecret:ne.clientSecret,tokenEndpoint:ne.tokenEndpoint})})).ok?await u.update.mutateAsync({id:K,data:{}}):await u.update.mutateAsync({id:K,data:{connection_token:ae}})}catch{await u.update.mutateAsync({id:K,data:{connection_token:ae}})}else await u.update.mutateAsync({id:K,data:{connection_token:ae}});await v.invalidateQueries({queryKey:ct.isMCPAuthenticated(je.href,null)}),G.success("Authentication successful")}}G.success("Connected successfully")}catch(r){G.error(`Failed to connect: ${r instanceof Error?r.message:String(r)}`)}finally{D(null)}}},E=Et({connectionId:zt,orgId:o.id,orgSlug:o.slug}),l=()=>{v.invalidateQueries({predicate:c=>{const r=c.queryKey;return r[1]===o.id&&r[3]==="collection"&&r[4]==="CONNECTIONS"}})},O=async()=>{A(!1);const c=[...a];te("connections_bulk_delete",{count:c.length});let r=0;for(const w of c)try{(await E.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:w,force:!0}})).isError||r++}catch{}l(),G.success(`Deleted ${r} connection${r!==1?"s":""}`),z()},b=async c=>{const r=[...a];te("connections_bulk_status_toggled",{count:r.length,to_status:c});let w=0;for(const L of r)try{await u.update.mutateAsync({id:L,data:{status:c}}),w++}catch{}l(),G.success(`${c==="active"?"Enabled":"Disabled"} ${w} connection${w!==1?"s":""}`),z()},se=async c=>{const r=M.find(q=>q.id===c);if(!r||!E)return;te("connections_bulk_add_to_agent",{agent_id:c,count:a.size});const w=new Set(r.connections.map(q=>q.connection_id)),L=[...a].filter(q=>!w.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(L.length===0){G.info("All selected connections are already in that agent");return}try{await E.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:c,data:{connections:[...r.connections,...L]}}}),v.invalidateQueries({predicate:q=>{const K=q.queryKey;return K[1]===o.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),G.success(`Added ${L.length} connection${L.length!==1?"s":""} to "${r.title}"`),z()}catch{G.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(ft,{...x}),t.jsx(Yt,{open:k,onOpenChange:A,count:a.size,onConfirm:O}),t.jsx(Qt,{open:N,onOpenChange:I,agents:M,onConfirm:se}),F.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(i?C.length===0&&$.length===0:e==="all"?C.length===0:$.length===0)?t.jsx(ht,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:y.search?`No Connections match "${y.search}"`:"Create a connection to get started."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[V.map(c=>{if(c.type==="group")return t.jsx(Wt,{group:c,onOpen:()=>{h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:c.key}})},selectionMode:f,selectedIds:a,onToggleSelect:T},c.key);const r=c.connection,w=a.has(r.id);return t.jsx(fe,{connection:r,fallbackIcon:t.jsx(he,{}),onClick:()=>f?T(r.id):h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(r)}}),className:re(w&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[f?t.jsx($e,{checked:w,onCheckedChange:()=>T(r.id),onClick:L=>L.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:re("overflow-hidden transition-all duration-150 ease-out",f?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(Re,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:L=>L.stopPropagation(),children:t.jsx(We,{size:20})})}),t.jsxs(He,{align:"end",onClick:L=>L.stopPropagation(),children:[t.jsxs(pe,{onClick:L=>{L.stopPropagation(),h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(r)}})},children:[t.jsx(Xe,{size:16}),"Open"]}),t.jsxs(pe,{onClick:L=>{L.stopPropagation(),T(r.id)},children:[t.jsx(Vt,{size:16}),"Select"]}),t.jsxs(pe,{variant:"destructive",onClick:L=>{L.stopPropagation(),x.requestDelete(r)},children:[t.jsx(Ge,{size:16}),"Delete"]})]})]})})]})},r.id)}),C.map(c=>t.jsx(Zt,{item:c,allConnections:S,connectedAppNames:U,connectingItemId:s,onNavigateConnected:r=>h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(r)}}),onConnect:H},`catalog-${c._registryId}:${c.id}`)),(e==="all"||i)&&d.length>0&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||i)&&F.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ce,{size:24,className:"animate-spin text-muted-foreground"})})]})}),f&&t.jsx(Gt,{count:a.size,total:$.length,onSelectAll:()=>{p(new Set($.map(c=>c.id)))},onDeselectAll:()=>p(new Set),onDelete:()=>A(!0),onAddToAgent:()=>I(!0),onToggleStatus:b,onCancel:z})]})}function tn(){const{org:y}=_e(),e=Se(),n=Je({strict:!1}),{data:g}=be.useSession(),{stdioEnabled:m}=Ze(),d=wt(),o=yt({namespace:y.slug,resource:"connections"}),v=Ke(),[h,_]=et(tt.connectionsTab(y.slug),i=>n.tab==="all"||n.tab==="connected"?n.tab:i??"all"),[u,S]=W.useState("ALL"),[x,a]=W.useState("ALL"),[p,f]=W.useState("ALL"),k=ut(),N=Ne(k,o.searchTerm).items,I=o.search!==o.searchTerm,s=nt({resolver:st(Rt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),D=s.watch("ui_type"),M=s.watch("connection_url"),$=s.watch("npx_package"),P=me({uiType:D,connectionUrl:M??"",npxPackage:$??""})??ve({uiType:D,connectionUrl:M??"",registryItems:N}),T=n.action==="create",z=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:y.slug},search:{action:"create"}})},F=()=>{e({to:"/$org/settings/connections",params:{org:y.slug},search:{}})},j=async i=>{let C,V=null,H=null,E=null;i.ui_type==="NPX"?(C="STDIO",V="",E=Ht(i.npx_package||"",i.env_vars||[])):i.ui_type==="STDIO"?(C="STDIO",V="",E=Kt(i.stdio_command||"",i.stdio_args||"",i.stdio_cwd,i.env_vars||[])):(C=i.ui_type,V=i.connection_url||"",H=i.connection_token||null);const l=rt("conn");te("connection_custom_created",{connection_type:C,ui_type:i.ui_type}),await v.create.mutateAsync({id:l,title:i.title,description:i.description||null,connection_type:C,connection_url:V,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:g?.user?.id||"system",organization_id:y.id,icon:i.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"}),F(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:y.slug,appSlug:ue({app_name:null,connection_url:V,title:i.title,id:l})}})},R=i=>{i||(T&&F(),s.reset())},U=i=>{const C=i.trim();if(!C)return;const V=!!s.formState.dirtyFields.title,H=!!s.formState.dirtyFields.description,E=!!s.formState.dirtyFields.env_vars,l=b=>{if(b&&(!V&&!s.getValues("title").trim()&&b.title&&s.setValue("title",b.title,{shouldDirty:!1}),!H&&!(s.getValues("description")??"").trim()&&b.description&&s.setValue("description",b.description,{shouldDirty:!1}),!E&&b.envVarKeys?.length)){const se=s.getValues("env_vars")??[],c=new Set(se.map(w=>w.key)),r=b.envVarKeys.filter(w=>!c.has(w));r.length>0&&s.setValue("env_vars",[...se,...r.map(w=>({key:w,value:""}))],{shouldDirty:!0})}},O=Ut(C);if(O&&m){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",O.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),l(me({uiType:"NPX",npxPackage:O.packageName}));return}if(C.startsWith("http://")||C.startsWith("https://")){const b=D==="HTTP"||D==="SSE"||D==="Websocket"?D:"HTTP";s.setValue("ui_type",b,{shouldDirty:!0}),s.setValue("connection_url",C,{shouldDirty:!0}),l(me({uiType:b,connectionUrl:C})??ve({uiType:b,connectionUrl:C,registryItems:N}));return}D==="NPX"&&l(me({uiType:"NPX",npxPackage:C}))},X=t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(B,{variant:"outline",onClick:z,children:[t.jsx(qe,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})});return t.jsx(t.Fragment,{children:t.jsxs(de,{children:[(()=>{const i="Create Connection",C="Create a custom connection in your organization. Fill in the details below.",V=s.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Type *"}),t.jsxs(Tt,{value:l.value,onValueChange:l.onChange,children:[t.jsx(Z,{children:t.jsx(It,{children:t.jsx(Pt,{})})}),t.jsxs(Lt,{children:[t.jsx(le,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(le,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(le,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(le,{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(le,{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,{})]})}),D==="NPX"&&t.jsx(Q,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value??"",onPaste:O=>{const b=O.clipboardData.getData("text");b&&(O.preventDefault(),s.setValue("npx_package",b.trim(),{shouldDirty:!0}),U(b))},onBlur:O=>{U(O.target.value),l.onBlur()}})}),t.jsx(ee,{})]})}),D==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Command *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"node, bun, python...",...l,value:l.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"arg1 arg2 --flag value",...l,value:l.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"/path/to/project (optional)",...l,value:l.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(D==="NPX"||D==="STDIO")&&t.jsx(Q,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Bt,{value:l.value??[],onChange:l.onChange})}),t.jsx(ee,{})]})}),D!=="NPX"&&D!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:s.control,name:"connection_url",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"URL *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"https://example.com/mcp",...l,value:l.value??"",onPaste:O=>{const b=O.clipboardData.getData("text");b&&(O.preventDefault(),s.setValue("connection_url",b.trim(),{shouldDirty:!0}),U(b))},onBlur:O=>{U(O.target.value),l.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:P?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(oe,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...l,value:l.value??""})}),P?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"title",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Name *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"My Connection",...l})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"description",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Description"}),t.jsx(Z,{children:t.jsx(Ot,{placeholder:"A brief description of this connection",rows:3,...l,value:l.value??""})}),t.jsx(ee,{})]})})]}),E=T;return d?t.jsx(_t,{open:E,onOpenChange:R,children:t.jsxs(St,{className:"max-h-[90vh]",children:[t.jsx(bt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Nt,{children:i}),t.jsx(kt,{className:"mt-1",children:C})]}),t.jsx(Dt,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Qe,{size:16})})})]})}),t.jsx(Ce,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(j),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(At,{children:t.jsx(B,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Ee,{open:E,onOpenChange:R,children:t.jsxs(ze,{className:"sm:max-w-[525px]",children:[t.jsxs(Fe,{children:[t.jsx(Me,{children:i}),t.jsx(Ve,{children:C})]}),t.jsx(Ce,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(j),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Be,{children:[t.jsx(B,{type:"button",variant:"outline",onClick:()=>R(!1),children:"Cancel"}),t.jsx(B,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(de.Content,{children:t.jsx(de.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(de.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(dt,{value:o.search,onChange:o.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(o.setSearch(""),i.target.blur())}}),t.jsx(at,{sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.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:u,onChange:i=>S(i||"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:x,onChange:i=>a(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},...k.length>1?[{label:"Registry",value:p,onChange:i=>f(i||"ALL"),options:[{id:"ALL",label:"All registries"},...k.map(i=>({id:i.id,label:i.id.includes("community-registry")?"Community MCP Registry":i.title}))]}]:[]]})]}),X]}),t.jsx(mt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:h,onTabChange:i=>{const C=i;C!==h&&te("connections_page_tab_changed",{to_tab:C}),_(C)}}),t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:I?.5:1,transition:I?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:I?"none":"auto"},children:t.jsx(en,{listState:o,activeTab:h,typeFilter:u,statusFilter:x,registryFilter:p,enabledRegistries:k})})})]})})})]})})}function ys(){const y=ie.c(1);let e;return y[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(tn,{})})}),y[0]=e):e=y[0],e}export{ys as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as c,j as d,dg as f,dh as m,c as u,di as g,dj as x,dk as v,dl as b,dm as h,dn as w,dp as j,dq as N,dr as p,aF as z,ds as _,dt as y}from"./index-Dl2t23Jt.js";import{i as $}from"./ChevronDown-tb8ftSUO.js";import{i as D}from"./ChevronRight-BIm0-OSp.js";import{a as M}from"./DotsVertical-DEE8M0V4.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function E(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("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-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==n||e[8]!==r?(i=d.jsx(x,{children:d.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=i):i=e[9],i}function G(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let i;e[5]!==t?(i=u("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-pointer items-center gap-2 rounded-lg 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",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==r?(l=d.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...o}),e[7]=s,e[8]=o,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function L(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx($,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=d.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[i,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function O(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(y,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function q(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let i;return e[7]!==t||e[8]!==o||e[9]!==n?(i=d.jsxs(_,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=i):i=e[10],i}function F(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function P(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function A(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function B(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(D,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=d.jsxs(z,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,i]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function H(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("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 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(N,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,E as b,G as c,B as d,A as e,H as f,q as g,O as h,P as i,F as j,L as k};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as re,s as ce,o as de,r as U,z as me,C as ue,a as fe,t as Y,x as q,K as te,j as s,B as K,H as ge,J as W,e as L,c as xe,M as pe}from"./index-Dl2t23Jt.js";import{P as V}from"./index-Bcf94soS.js";import{u as he}from"./use-org-auth-client-CS0Acn4M.js";import{A as be}from"./avatar-C4FRugJb.js";import{I as je}from"./input-CluxDyoT.js";import{S as X,a as Z,b as Q,c as ie,d as ve}from"./settings-section-qcMAXuoQ.js";import{D as Se}from"./domain-settings-D6RV8b16.js";import{u as ye,a as se,D as Ne,c as Ce,S as we,v as _e,K as ze,P as De,d as Ae,C as Pe,s as ke,b as Ie,e as Ee}from"./collection-search-D_DqZCmL.js";import{W as ee,i as Oe}from"./constants-CfwGLQ49.js";import{b as le}from"./use-virtual-mcp-BHEEZv3B.js";import{b as Te,P as Re,a as Fe}from"./popover-vU5pf5HQ.js";import{S as Le}from"./skeleton-eOgaLAHa.js";import{z as $e}from"./agent-icon-BXkkrCT3.js";import{s as Me}from"./Plus-BrBimbff.js";import{a as ae}from"./Users03-DH9QAbco.js";import{i as He}from"./X-viKat0oa.js";import{I as J}from"./integration-icon-BipCD_m-.js";import{u as Ke,c as Ue}from"./use-organization-settings-Dak2xww8.js";import"./tooltip-CxizQODk.js";import"./User01-DmtseI1g.js";import"./card-oSxwoJvZ.js";import"./ArrowUpRight-BK_iYZ-J.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./switch-W_Nrj6rK.js";import"./SearchMd-IP-R-mtT.js";import"./use-collections-CwD8DZNY.js";import"./AlertCircle-CbUYZGF-.js";import"./Tool01-D1Rvo01i.js";import"./XClose-DY7O9VST.js";import"./RefreshCcw01-Cr84gVY8.js";import"./ArrowNarrowLeft-DHj5-FLY.js";import"./XCircle-DZEMwZj2.js";import"./ZapSquare-BDbWe-zU.js";import"./CheckCircle-D9qlmIve.js";import"./ChevronDown-tb8ftSUO.js";import"./ChevronRight-BIm0-OSp.js";import"./ChevronUp-ClqSoLtD.js";import"./DotsVertical-DEE8M0V4.js";import"./Container-BCDxdJoG.js";import"./Star01-PFA-ZRDO.js";import"./Palette-BrJL0UcN.js";import"./LinkExternal01-DM7IwrPj.js";import"./Lock01-BmjkKSvK.js";import"./Sun-B7BWJEHb.js";import"./Play-DSYx2GJ2.js";import"./Settings02-BOckjEVU.js";import"./Shield01-CJggUHAQ.js";import"./Trash01-DaGrAtTq.js";import"./Zap-BMzMPNv3.js";const qe=ge({name:W().min(1,"Name is required").max(255,"Name is too long"),slug:W().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:W().optional()});function Be(t){const e=L.c(13),{value:l,onChange:i,name:u,disabled:a}=t,n=U.useRef(null);let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=()=>n.current?.click(),e[0]=v):v=e[0];const _=v;let S;e[1]!==i?(S=z=>{const x=z.target.files?.[0];if(!x)return;if(x.size>2097152){q.error("Image must be smaller than 2MB");return}const h=new FileReader;h.onerror=Ge,h.onloadend=()=>{h.result&&i(h.result),n.current&&(n.current.value="")},h.readAsDataURL(x)},e[1]=i,e[2]=S):S=e[2];const r=S;let d;e[3]!==a||e[4]!==r?(d=s.jsx("input",{ref:n,type:"file",accept:"image/*",onChange:r,className:"hidden",disabled:a}),e[3]=a,e[4]=r,e[5]=d):d=e[5];const o=l||void 0,f=u??"?";let m;e[6]!==o||e[7]!==f?(m=s.jsx(be,{url:o,fallback:f,shape:"square",size:"base"}),e[6]=o,e[7]=f,e[8]=m):m=e[8];let g;return e[9]!==a||e[10]!==d||e[11]!==m?(g=s.jsxs("button",{type:"button",onClick:_,disabled:a,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[d,m]}),e[9]=a,e[10]=d,e[11]=m,e[12]=g):g=e[12],g}function Ge(){return q.error("Failed to read image")}function Ve(){const t=re(),{org:e}=ce(),l=he(),i=de(),[u,a]=U.useState(!1),n=me({resolver:ue(qe),values:{name:e.name??"",slug:e.slug??"",logo:e.logo??""}}),v=fe({mutationFn:async o=>{const f={name:o.name,slug:o.slug};o.logo&&(f.logo=o.logo);const m=await l.organization.update({data:f});if(m?.error)throw new Error(m.error.message||"Failed to update organization");return m},onSuccess:o=>{Y("organization_settings_updated",{organization_id:e.id,fields:Object.keys(n.formState.dirtyFields)}),i.invalidateQueries({queryKey:te.organizations()}),i.invalidateQueries({queryKey:te.activeOrganization(e.slug)}),q.success("Organization settings updated successfully"),o?.data?.slug&&o.data.slug!==e.slug&&t({to:"/$org/settings/general",params:{org:o.data.slug}})},onError:o=>{Y("organization_settings_update_failed",{organization_id:e.id,fields:Object.keys(n.formState.dirtyFields),error:o instanceof Error?o.message:String(o)}),q.error(o instanceof Error?o.message:"Failed to update organization")},onSettled:()=>{a(!1)}}),_=o=>{a(!0),v.mutate(o)},S=n.formState.isDirty,r=n.formState.errors,d=typeof window<"u"?`${window.location.host}/`:"";return s.jsx("form",{onSubmit:n.handleSubmit(_),className:"flex flex-col gap-3",children:s.jsx(X,{children:s.jsxs(Z,{children:[s.jsx(Q,{title:"Logo",description:"Recommended size is 256x256px",action:s.jsx(Be,{value:n.watch("logo"),onChange:o=>n.setValue("logo",o??"",{shouldDirty:!0}),name:n.watch("name"),disabled:u})}),s.jsx(Q,{title:"Name",action:s.jsx(je,{id:"org-name",...n.register("name"),placeholder:"Organization name",disabled:u,className:"w-[280px]"})}),s.jsx(Q,{title:"URL",action:s.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:[d&&s.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:d}),s.jsx("input",{id:"org-slug",...n.register("slug"),placeholder:"my-organization",disabled:u,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 f=o.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");n.setValue("slug",f,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}})]})}),(r.name||r.slug||r.logo)&&s.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&s.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.slug&&s.jsx("p",{className:"text-xs text-destructive",children:r.slug.message}),r.logo&&s.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]}),S&&s.jsxs(ie,{children:[s.jsx(K,{type:"button",variant:"outline",size:"sm",onClick:()=>n.reset(),disabled:u,children:"Cancel"}),s.jsx(K,{type:"submit",disabled:u,size:"sm",children:u?"Saving…":"Save"})]})]})})})}const ne=["site-editor","site-diagnostics","ai-image","ai-research"],oe=8;function We(t,e,l){const i=e.find(a=>a.id===t);if(i)return{id:i.id,title:i.title,icon:i.icon,kind:"template"};const u=l.find(a=>a.id===t);return u?{id:t,title:u.title,icon:u.icon??null,kind:"custom"}:{id:t,title:t,icon:null,kind:"missing"}}function Qe(t){const e=L.c(39),{agent:l,onRemove:i}=t;let u;e[0]!==l.id?(u={id:l.id},e[0]=l.id,e[1]=u):u=e[1];const{attributes:a,listeners:n,setNodeRef:v,transform:_,transition:S,isDragging:r}=Ae(u);let d;e[2]!==_?(d=Pe.Transform.toString(_),e[2]=_,e[3]=d):d=e[3];const o=r?.5:void 0,f=r?100:void 0;let m;e[4]!==d||e[5]!==o||e[6]!==f||e[7]!==S?(m={transform:d,transition:S,opacity:o,zIndex:f},e[4]=d,e[5]=o,e[6]=f,e[7]=S,e[8]=m):m=e[8];const g=m,z=r&&"shadow-lg";let x;e[9]!==z?(x=xe("flex items-center gap-3 px-3 py-2 rounded-lg border border-border bg-background",z),e[9]=z,e[10]=x):x=e[10];const h=`Drag to reorder ${l.title}`;let D;e[11]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx($e,{size:14}),e[11]=D):D=e[11];let k;e[12]!==a||e[13]!==n||e[14]!==h?(k=s.jsx("button",{type:"button",...a,...n,className:"text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing","aria-label":h,children:D}),e[12]=a,e[13]=n,e[14]=h,e[15]=k):k=e[15];let y;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ae,{size:14}),e[16]=y):y=e[16];let C;e[17]!==l.icon||e[18]!==l.title?(C=s.jsx(J,{icon:l.icon,name:l.title,size:"xs",fallbackIcon:y}),e[17]=l.icon,e[18]=l.title,e[19]=C):C=e[19];let b;e[20]!==l.title?(b=s.jsx("span",{className:"text-sm text-foreground truncate",children:l.title}),e[20]=l.title,e[21]=b):b=e[21];const w=l.kind==="template"?"Template":l.kind==="custom"?"Custom agent":"Unavailable";let p;e[22]!==w?(p=s.jsx("span",{className:"text-xs text-muted-foreground",children:w}),e[22]=w,e[23]=p):p=e[23];let j;e[24]!==b||e[25]!==p?(j=s.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[b,p]}),e[24]=b,e[25]=p,e[26]=j):j=e[26];const I=`Remove ${l.title}`;let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(He,{size:14}),e[27]=A):A=e[27];let N;e[28]!==i||e[29]!==I?(N=s.jsx("button",{type:"button",onClick:i,className:"text-muted-foreground hover:text-foreground p-1 rounded","aria-label":I,children:A}),e[28]=i,e[29]=I,e[30]=N):N=e[30];let P;return e[31]!==v||e[32]!==g||e[33]!==k||e[34]!==C||e[35]!==j||e[36]!==N||e[37]!==x?(P=s.jsxs("div",{ref:v,style:g,className:x,children:[k,C,j,N]}),e[31]=v,e[32]=g,e[33]=k,e[34]=C,e[35]=j,e[36]=N,e[37]=x,e[38]=P):P=e[38],P}function Ye(t){const e=L.c(48),{selectedIds:l,onAdd:i}=t,[u,a]=U.useState(!1),[n,v]=U.useState(""),_=le();let S;e[0]!==l?(S=new Set(l),e[0]=l,e[1]=S):S=e[1];const r=S;let d,o,f,m,g,z,x,h,D,k,y,C,b;if(e[2]!==_||e[3]!==i||e[4]!==u||e[5]!==n||e[6]!==r){const A=n.toLowerCase();m=ee.filter(c=>!r.has(c.id)&&(!n||c.title.toLowerCase().includes(A)));let N;e[20]!==r?(N=c=>c.id!==null&&!Oe(c.id)&&!r.has(c.id),e[20]=r,e[21]=N):N=e[21],f=_.filter(N).filter(c=>!n||c.title.toLowerCase().includes(A));let P;e[22]!==i?(P=c=>{i(c),a(!1),v("")},e[22]=i,e[23]=P):P=e[23];const O=P;o=Te,C=u,b=a,e[24]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Re,{asChild:!0,children:s.jsxs(K,{type:"button",variant:"outline",size:"sm",children:[s.jsx(Me,{size:14}),"Add agent"]})}),e[24]=g):g=e[24],d=Fe,D="w-[320px] p-0 overflow-hidden",k="start",e[25]!==n?(y=s.jsx(Ee,{value:n,onChange:v,placeholder:"Search agents..."}),e[25]=n,e[26]=y):y=e[26],z="max-h-[320px] overflow-y-auto p-2 flex flex-col gap-3",x=m.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Templates"}),m.map(c=>s.jsxs("button",{type:"button",onClick:()=>O(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(J,{icon:c.icon,name:c.title,size:"xs"}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),h=f.length>0&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground px-1",children:"Custom agents"}),f.map(c=>s.jsxs("button",{type:"button",onClick:()=>O(c.id),className:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-accent text-left",children:[s.jsx(J,{icon:c.icon,name:c.title,size:"xs",fallbackIcon:s.jsx(ae,{size:14})}),s.jsx("span",{className:"text-sm truncate",children:c.title})]},c.id))]}),e[2]=_,e[3]=i,e[4]=u,e[5]=n,e[6]=r,e[7]=d,e[8]=o,e[9]=f,e[10]=m,e[11]=g,e[12]=z,e[13]=x,e[14]=h,e[15]=D,e[16]=k,e[17]=y,e[18]=C,e[19]=b}else d=e[7],o=e[8],f=e[9],m=e[10],g=e[11],z=e[12],x=e[13],h=e[14],D=e[15],k=e[16],y=e[17],C=e[18],b=e[19];let w;e[27]!==f||e[28]!==m.length||e[29]!==n?(w=m.length===0&&f.length===0&&s.jsx("div",{className:"text-xs text-muted-foreground text-center py-6",children:n?"No agents found":"All agents are already added"}),e[27]=f,e[28]=m.length,e[29]=n,e[30]=w):w=e[30];let p;e[31]!==w||e[32]!==z||e[33]!==x||e[34]!==h?(p=s.jsxs("div",{className:z,children:[x,h,w]}),e[31]=w,e[32]=z,e[33]=x,e[34]=h,e[35]=p):p=e[35];let j;e[36]!==d||e[37]!==p||e[38]!==D||e[39]!==k||e[40]!==y?(j=s.jsxs(d,{className:D,align:k,children:[y,p]}),e[36]=d,e[37]=p,e[38]=D,e[39]=k,e[40]=y,e[41]=j):j=e[41];let I;return e[42]!==o||e[43]!==g||e[44]!==j||e[45]!==C||e[46]!==b?(I=s.jsxs(o,{open:C,onOpenChange:b,children:[g,j]}),e[42]=o,e[43]=g,e[44]=j,e[45]=C,e[46]=b,e[47]=I):I=e[47],I}function Je(){const t=L.c(61),e=Ke(),l=le(),i=Ue();let u;t[0]!==e?.ids?(u=e?.ids??[...ne],t[0]=e?.ids,t[1]=u):u=t[1];const a=u,[n,v]=U.useState(a);let _;t[2]!==n||t[3]!==a?(_=n.length!==a.length||n.some((E,T)=>E!==a[T]),t[2]=n,t[3]=a,t[4]=_):_=t[4];const S=_;let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r={activationConstraint:{distance:5}},t[5]=r):r=t[5];let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d={coordinateGetter:ke},t[6]=d):d=t[6];const o=ye(se(De,r),se(ze,d));let f;t[7]!==n?(f=E=>{const{active:T,over:R}=E;if(!R||T.id===R.id)return;const F=n.indexOf(T.id),G=n.indexOf(R.id);F===-1||G===-1||v(Ie([...n],F,G))},t[7]=n,t[8]=f):f=t[8];const m=f;let g;t[9]!==n?(g=E=>{n.includes(E)||v([...n,E])},t[9]=n,t[10]=g):g=t[10];const z=g;let x;t[11]!==n?(x=E=>{v(n.filter(T=>T!==E))},t[11]=n,t[12]=x):x=t[12];const h=x;let D;t[13]===Symbol.for("react.memo_cache_sentinel")?(D=()=>{v([...ne])},t[13]=D):D=t[13];const k=D;let y;t[14]!==n||t[15]!==i?(y=()=>{i.mutate({ids:n},{onSuccess:()=>{Y("default_home_agents_updated",{count:n.length,template_count:n.filter(Ze).length}),q.success("Default home agents updated")},onError:Xe})},t[14]=n,t[15]=i,t[16]=y):y=t[16];const C=y;let b,w,p,j,I,A,N;if(t[17]!==l||t[18]!==n||t[19]!==m||t[20]!==h||t[21]!==o||t[22]!==i.isPending){let E;t[30]!==l?(E=F=>We(F,ee,l),t[30]=l,t[31]=E):E=t[31];const T=n.map(E);p=Math.max(0,n.length-oe),w=X,I="Default home agents";let R;t[32]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(pe,{size:14}),t[32]=R):R=t[32],t[33]!==i.isPending?(A=s.jsxs(K,{type:"button",variant:"ghost",size:"sm",onClick:k,disabled:i.isPending,children:[R,"Reset defaults"]}),t[33]=i.isPending,t[34]=A):A=t[34],b=Z,N="px-5 py-5 flex flex-col gap-3",j=T.length===0?s.jsx("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-xs text-muted-foreground",children:'No agents selected. The home view will only show "Create agent".'}):s.jsx(Ne,{sensors:o,collisionDetection:Ce,onDragEnd:m,children:s.jsx(we,{items:n,strategy:_e,children:s.jsx("div",{className:"flex flex-col gap-1.5",children:T.map((F,G)=>s.jsxs("div",{className:"flex flex-col gap-1.5",children:[G===oe&&s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1 text-xs text-muted-foreground",children:[s.jsx("div",{className:"flex-1 h-px bg-border"}),s.jsx("span",{children:"Below this line is hidden on the home view"}),s.jsx("div",{className:"flex-1 h-px bg-border"})]}),s.jsx(Qe,{agent:F,onRemove:()=>h(F.id)})]},F.id))})})}),t[17]=l,t[18]=n,t[19]=m,t[20]=h,t[21]=o,t[22]=i.isPending,t[23]=b,t[24]=w,t[25]=p,t[26]=j,t[27]=I,t[28]=A,t[29]=N}else b=t[23],w=t[24],p=t[25],j=t[26],I=t[27],A=t[28],N=t[29];let P;t[35]!==n||t[36]!==z?(P=s.jsx(Ye,{selectedIds:n,onAdd:z}),t[35]=n,t[36]=z,t[37]=P):P=t[37];let O;t[38]!==p?(O=p>0&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[p," agent",p===1?"":"s"," won't fit on the home view"]}),t[38]=p,t[39]=O):O=t[39];let c;t[40]!==P||t[41]!==O?(c=s.jsxs("div",{className:"flex items-center justify-between",children:[P,O]}),t[40]=P,t[41]=O,t[42]=c):c=t[42];let $;t[43]!==j||t[44]!==c||t[45]!==N?($=s.jsxs("div",{className:N,children:[j,c]}),t[43]=j,t[44]=c,t[45]=N,t[46]=$):$=t[46];let M;t[47]!==C||t[48]!==a||t[49]!==S||t[50]!==i.isPending?(M=S&&s.jsxs(ie,{children:[s.jsx(K,{type:"button",variant:"outline",onClick:()=>v(a),disabled:i.isPending,children:"Cancel"}),s.jsx(K,{type:"button",onClick:C,disabled:i.isPending,children:i.isPending?"Saving…":"Save"})]}),t[47]=C,t[48]=a,t[49]=S,t[50]=i.isPending,t[51]=M):M=t[51];let H;t[52]!==b||t[53]!==$||t[54]!==M?(H=s.jsxs(b,{children:[$,M]}),t[52]=b,t[53]=$,t[54]=M,t[55]=H):H=t[55];let B;return t[56]!==w||t[57]!==I||t[58]!==A||t[59]!==H?(B=s.jsx(w,{title:I,actions:A,children:H}),t[56]=w,t[57]=I,t[58]=A,t[59]=H,t[60]=B):B=t[60],B}function Xe(t){q.error(t instanceof Error?t.message:"Failed to update default home agents")}function Ze(t){return ee.some(e=>e.id===t)}function et(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(X,{title:"Default home agents",children:s.jsx(Z,{children:s.jsx("div",{className:"px-5 py-5 flex flex-col gap-2",children:Array.from({length:4}).map(tt)})})}),t[0]=e):e=t[0],e}function tt(t,e){return s.jsx(Le,{className:"h-12 w-full rounded-lg"},e)}function st(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(U.Suspense,{fallback:s.jsx(et,{}),children:s.jsx(Je,{})}),t[0]=e):e=t[0],e}function nt(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(V,{children:s.jsx(V.Content,{children:s.jsx(V.Body,{children:s.jsxs(ve,{children:[s.jsx(V.Title,{children:"Organization"}),s.jsx(Ve,{}),s.jsx(Se,{}),s.jsx(st,{})]})})})}),t[0]=e):e=t[0],e}function Zt(){const t=L.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(nt,{}),t[0]=e):e=t[0],e}export{Zt as default};
|