decocms 3.31.0 → 3.31.2
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-A2M1Yk61.js → AlertCircle-B4gYnOPQ.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CjvxrowT.js → ArrowUpRight-D0kjnBU3.js} +1 -1
- package/dist/client/assets/{Check-Cl07asRj.js → Check-Cy2gwr8C.js} +1 -1
- package/dist/client/assets/{CheckCircle-Ck9u9W7w.js → CheckCircle-CNdjtGTh.js} +1 -1
- package/dist/client/assets/{ChevronDown-Ce3UdjOo.js → ChevronDown-3x5m66Bs.js} +1 -1
- package/dist/client/assets/{ChevronLeft-SeayBU0G.js → ChevronLeft-2_IuBsKu.js} +1 -1
- package/dist/client/assets/{ChevronRight-C8KzXj8H.js → ChevronRight-CeIr4WsE.js} +1 -1
- package/dist/client/assets/{ChevronUp-zA2iz0JQ.js → ChevronUp-Bh0YaH7H.js} +1 -1
- package/dist/client/assets/{Container-B3y5dlGc.js → Container-CYA7KoET.js} +1 -1
- package/dist/client/assets/{DotsVertical-_g_anHKb.js → DotsVertical-FCIPj2jh.js} +1 -1
- package/dist/client/assets/{Eye-lcuSJE4l.js → Eye-BEaX-nOW.js} +1 -1
- package/dist/client/assets/{FilterLines-EpjZnXUA.js → FilterLines-PIiHcomo.js} +1 -1
- package/dist/client/assets/{Globe01-CfZP4vCY.js → Globe01-DCcLGAPs.js} +1 -1
- package/dist/client/assets/{HardDrive-75MAycL-.js → HardDrive-DF3wR4Ey.js} +1 -1
- package/dist/client/assets/{Key01-DyeMqFvi.js → Key01-DOICf9Yf.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DwKLO_V_.js → LayoutLeft-XvA4efJR.js} +1 -1
- package/dist/client/assets/{LinkExternal01-r7kaLetr.js → LinkExternal01-kEaZ-3VP.js} +1 -1
- package/dist/client/assets/{Monitor01-C_pzVd4h.js → Monitor01-BQ2ab3I8.js} +1 -1
- package/dist/client/assets/{Palette-DdA_ILd6.js → Palette-BvgmCjcf.js} +1 -1
- package/dist/client/assets/{Play-CnkDDouZ.js → Play-CgnBFM99.js} +1 -1
- package/dist/client/assets/{Plus-Dx1SIiMT.js → Plus-CZoFo8m3.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-C3I3Y9Tu.js → RefreshCcw01-CoOu-1-t.js} +1 -1
- package/dist/client/assets/{SearchMd-DFhUmylG.js → SearchMd-Cd3g9OHi.js} +1 -1
- package/dist/client/assets/{Settings02-CWkfxXGQ.js → Settings02-h4KhooA8.js} +1 -1
- package/dist/client/assets/{Shield01-CbvWDrmE.js → Shield01-CxluyAom.js} +1 -1
- package/dist/client/assets/{Star01-DkpG4lGE.js → Star01-BQu9_hS7.js} +1 -1
- package/dist/client/assets/{Stars01-CJ8FecuG.js → Stars01-D3E_UsFP.js} +1 -1
- package/dist/client/assets/{Stars02-bH2-rrrk.js → Stars02-DQPSVMUP.js} +1 -1
- package/dist/client/assets/{Sun-CLmK6D64.js → Sun-CGlOqn-C.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CDVzg25U.js → SwitchHorizontal01-DruCuOB9.js} +1 -1
- package/dist/client/assets/{Tool01-Cm1sVqXs.js → Tool01-DXZCxrW7.js} +1 -1
- package/dist/client/assets/{Trash01-CA4jg9ww.js → Trash01-CdVc63JX.js} +1 -1
- package/dist/client/assets/{Upload01-BbVOBYlS.js → Upload01-hFtvGOKc.js} +1 -1
- package/dist/client/assets/{User01-CMz2xYx2.js → User01-DkghkjfJ.js} +1 -1
- package/dist/client/assets/{Users01-DBOuOgB6.js → Users01-DSIM6pEW.js} +1 -1
- package/dist/client/assets/{Users03-DIxLvYmx.js → Users03-cwi85RQL.js} +1 -1
- package/dist/client/assets/{X-8-D5pATw.js → X-CiRjfhfc.js} +1 -1
- package/dist/client/assets/{XCircle-D0Uf6feY.js → XCircle-m30sBtwe.js} +1 -1
- package/dist/client/assets/{XClose-Cnj8fI9u.js → XClose-DEtxBka1.js} +1 -1
- package/dist/client/assets/{Zap-mYMK3ZBL.js → Zap-BqoFLQhx.js} +1 -1
- package/dist/client/assets/{ZapSquare-qMfSZ8L9.js → ZapSquare-88gaWy0c.js} +1 -1
- package/dist/client/assets/{ZoomOut-aYAC7hBe.js → ZoomOut-OQ9XVMLx.js} +1 -1
- package/dist/client/assets/{access-gate-daLhvTar.js → access-gate-DADwk2R8.js} +1 -1
- package/dist/client/assets/{accordion-Cm248afD.js → accordion-67DY3M-J.js} +1 -1
- package/dist/client/assets/add-section-modal-CAjwD6Pd.js +1 -0
- package/dist/client/assets/agent-capabilities-f1C_QUMa.js +3 -0
- package/dist/client/assets/{agent-icon-cetEWq0Z.js → agent-icon-DRs2sxx6.js} +1 -1
- package/dist/client/assets/{agent-icons-CK-xDflz.js → agent-icons-4ZuoYvOM.js} +2 -2
- package/dist/client/assets/{agents-list-Da1iRt5l.js → agents-list-BawKTAIq.js} +1 -1
- package/dist/client/assets/{ai-providers-BJhgs18P.js → ai-providers-Cw6JIdBf.js} +1 -1
- package/dist/client/assets/{alert-BBTJrkK5.js → alert-DvSgp-Ux.js} +1 -1
- package/dist/client/assets/{alert-dialog-DokKbPq-.js → alert-dialog-CvpxH7Lf.js} +2 -2
- package/dist/client/assets/app-editor-DFjSiVlG.js +1 -0
- package/dist/client/assets/{auth-catchall-CVFro2W9.js → auth-catchall-DYNGMvE3.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Bsctr1_-.js → auth-split-layout-NbrrlaWV.js} +1 -1
- package/dist/client/assets/{automation-list-row-D23Bvwkx.js → automation-list-row-DUFXJruv.js} +1 -1
- package/dist/client/assets/{automation-runs-BMMJyRtq.js → automation-runs-CAmeSsSa.js} +1 -1
- package/dist/client/assets/{automations-DoosX3yK.js → automations-CgeuUTLU.js} +1 -1
- package/dist/client/assets/{avatar-Bg8Fajzf.js → avatar-CWn5LER_.js} +1 -1
- package/dist/client/assets/{badge-CWyTrVve.js → badge-CIMelj9a.js} +1 -1
- package/dist/client/assets/{brand-context-D5dCbA6y.js → brand-context-H1clX-er.js} +1 -1
- package/dist/client/assets/{buckets-C3jVEHjb.js → buckets-CC7y0QTv.js} +1 -1
- package/dist/client/assets/{calendar-D2buY6we.js → calendar-YPBFp_E0.js} +1 -1
- package/dist/client/assets/{capability-load-error-Co02--jW.js → capability-load-error-mbutkBah.js} +1 -1
- package/dist/client/assets/{card-BVDRUeiB.js → card-CPe96wry.js} +1 -1
- package/dist/client/assets/{chat-context-CpxV-LEc.js → chat-context-BjxJIMHx.js} +1 -1
- package/dist/client/assets/{checkbox-C0OD5DTK.js → checkbox-CMfBi1P9.js} +1 -1
- package/dist/client/assets/{cli-auth-success-pLKti1nS.js → cli-auth-success-DYhb7-ie.js} +1 -1
- package/dist/client/assets/{collection-detail-Bx5cx6Tv.js → collection-detail-BxKQrABJ.js} +1 -1
- package/dist/client/assets/{collection-display-button-Dpa_fFcT.js → collection-display-button-CT3gbaW0.js} +1 -1
- package/dist/client/assets/{collection-search-DHln9QoJ.js → collection-search-CR7VmYXP.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CTiIT2dF.js → collection-table-wrapper-8RUKrDnB.js} +1 -1
- package/dist/client/assets/{collection-tabs-BaiyS1az.js → collection-tabs-DyRPz2M0.js} +1 -1
- package/dist/client/assets/{collections-Deko--Yp.js → collections-D3ATOWCI.js} +1 -1
- package/dist/client/assets/{command-3qLn4P52.js → command-DwAn8s0z.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-BoRQM4OA.js → connect-desktop-dialog-CUd_SkHU.js} +1 -1
- package/dist/client/assets/{connection-card-ZCt-smg_.js → connection-card-0Tyv2fap.js} +1 -1
- package/dist/client/assets/{connection-detail-DipDTh4H.js → connection-detail-Ci7FJpsv.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-B6JNJh-A.js → connection-form-helpers-Csat880R.js} +1 -1
- package/dist/client/assets/connections-CCuMprHu.js +1 -0
- package/dist/client/assets/decopilot-sse-pool-Qs-1EY0r.js +1 -0
- package/dist/client/assets/{dialog-BnOLdErK.js → dialog-BgALXZ6h.js} +1 -1
- package/dist/client/assets/{domain-settings-CwC_r-qt.js → domain-settings-AaPYLR4t.js} +1 -1
- package/dist/client/assets/{drawer-Be_zu0QX.js → drawer-DLAFbROZ.js} +1 -1
- package/dist/client/assets/{dropdown-menu-mHDT-XH7.js → dropdown-menu-uYsl4z-0.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-BGkekAkH.js → dynamic-plugin-layout-OZf-s4Vh.js} +1 -1
- package/dist/client/assets/{empty-state-CpfaS4oL.js → empty-state-CzSsahKD.js} +1 -1
- package/dist/client/assets/{empty-state-CeDRg4Pp.js → empty-state-DaQUj4WW.js} +1 -1
- package/dist/client/assets/{extract-connection-data-bN8kltS6.js → extract-connection-data-8yLRil2N.js} +1 -1
- package/dist/client/assets/{features-4Hsf4UEQ.js → features-BUlOTs5u.js} +1 -1
- package/dist/client/assets/file-explorer-1z_jfh76.js +2 -0
- package/dist/client/assets/{file-type-icon-DHQvk0za.js → file-type-icon-BI-57QdR.js} +1 -1
- package/dist/client/assets/{files-Bp_B54JG.js → files-CXNJllw8.js} +1 -1
- package/dist/client/assets/{form-C_FOfVah.js → form-BSWyFOE3.js} +1 -1
- package/dist/client/assets/{general-Dwpcwhzc.js → general-D0FEa5ER.js} +1 -1
- package/dist/client/assets/{generate-id-CQZwmjfI.js → generate-id-Cx2Cl6ns.js} +1 -1
- package/dist/client/assets/{github-repo-picker-Cd_kXw_v.js → github-repo-picker-DFc58L4T.js} +1 -1
- package/dist/client/assets/{header-tab-button-yQ_OLTia.js → header-tab-button-EU-XSa1F.js} +1 -1
- package/dist/client/assets/{hover-card-CHj7OURi.js → hover-card-B2Xe1JoR.js} +1 -1
- package/dist/client/assets/{image-field-D7PJzfsZ.js → image-field-D5MmzFT-.js} +1 -1
- package/dist/client/assets/index-8eGpjmNk.js +8 -0
- package/dist/client/assets/{index-bcXz_XDV.js → index-9-_G5hYz.js} +1 -1
- package/dist/client/assets/{index-DhrBeRkU.js → index-BHORPjEK.js} +1 -1
- package/dist/client/assets/{index-CXrzfY3D.js → index-BK9zbgCs.js} +1 -1
- package/dist/client/assets/{index-DHxOddsj.js → index-BPnG82q8.js} +3 -3
- package/dist/client/assets/index-B_KbH-mb.js +1 -0
- package/dist/client/assets/{index-CVroQ5fV.js → index-BpKJI7Dd.js} +1 -1
- package/dist/client/assets/{index-Cvm5sLsh.js → index-C0KuwIPp.js} +1 -1
- package/dist/client/assets/{index-D0AW3RJr.js → index-CUVr6lcg.js} +1 -1
- package/dist/client/assets/{index-DdL0ZJ74.js → index-CUWw06mX.js} +1 -1
- package/dist/client/assets/{index-Dw2PpfWw.js → index-CU_dpGl4.js} +1 -1
- package/dist/client/assets/{index-CR5thpY0.js → index-CYt0V3AS.js} +1 -1
- package/dist/client/assets/{index-C93oJ98C.js → index-DMmuIje2.js} +1 -1
- package/dist/client/assets/index-DaOT4XJB.js +1 -0
- package/dist/client/assets/{index-fYs9lCK5.js → index-Nndg_EdX.js} +19 -19
- package/dist/client/assets/{index-redirect-CNjnlL2S.js → index-redirect--1iDHaDV.js} +1 -1
- package/dist/client/assets/{input-C3YblD3D.js → input-Dp561wvu.js} +1 -1
- package/dist/client/assets/{integration-icon-DNnbE81S.js → integration-icon-CcFsasgm.js} +1 -1
- package/dist/client/assets/{label-g7a72jJD.js → label-BSaEPU5n.js} +1 -1
- package/dist/client/assets/{layout-Bac2NmXP.js → layout-DhLz9U2X.js} +1 -1
- package/dist/client/assets/{login-Dy8BMo_0.js → login-KELNaPBJ.js} +1 -1
- package/dist/client/assets/{members-DnAomETO.js → members-W8grzhWu.js} +1 -1
- package/dist/client/assets/monaco-editor-BR_tbU8a.js +9 -0
- package/dist/client/assets/{monitoring-stats-row-BXLdNMMZ.js → monitoring-stats-row-5K-iNny9.js} +1 -1
- package/dist/client/assets/{oauth-callback-1VcaC9dS.js → oauth-callback-8KL4StZE.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-MiK5yD8w.js → oauth-callback-ai-provider-N8VomC_I.js} +1 -1
- package/dist/client/assets/{onboarding-BGq8QKH-.js → onboarding-DtdxPB0K.js} +1 -1
- package/dist/client/assets/{org-install-DZd3jGKm.js → org-install-D5FbkY3j.js} +1 -1
- package/dist/client/assets/{org-layout-BsR_SirN.js → org-layout-KSFpSPTk.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-DiqJAM1g.js → org-plugin-layout-DJo1Z-Pr.js} +1 -1
- package/dist/client/assets/{page-seo-form-D30yiy8Q.js → page-seo-form-DJY-iA3B.js} +1 -1
- package/dist/client/assets/page-seo-sheet-BmGMfOzX.js +1 -0
- package/dist/client/assets/{pair-CV7DGW5V.js → pair-B6H2XHda.js} +6 -6
- package/dist/client/assets/{plugin-empty-state-rraryswS.js → plugin-empty-state-APGWpnYe.js} +1 -1
- package/dist/client/assets/{plugin-header-B1uUxTrr.js → plugin-header-CfyEfwUD.js} +1 -1
- package/dist/client/assets/{plugin-layout-DmiyMdB_.js → plugin-layout-Bu5dLcrn.js} +1 -1
- package/dist/client/assets/{popover-8cVh6gq0.js → popover-BYJBybY_.js} +1 -1
- package/dist/client/assets/{post-editor-C7P1dXNH.js → post-editor-CYVdmKp6.js} +2 -2
- package/dist/client/assets/{primitives-BsgolKyl.js → primitives-H10wZI-E.js} +1 -1
- package/dist/client/assets/{profile-D4w-Z3ol.js → profile-CRrSZ5vD.js} +1 -1
- package/dist/client/assets/project-app-view-Dy7VlptC.js +1 -0
- package/dist/client/assets/record-editor-BnPSQQYA.js +1 -0
- package/dist/client/assets/registry-CX-ET0zi.js +2 -0
- package/dist/client/assets/registry-layout-B7ptEXAi.js +27 -0
- package/dist/client/assets/{require-capability-skg99hPH.js → require-capability-C4c85-CT.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Cidb--Hk.js → required-auth-layout-BApuEUpI.js} +1 -1
- package/dist/client/assets/{reset-password-CNhRvj5g.js → reset-password-CAbJ7zW-.js} +1 -1
- package/dist/client/assets/{resizable-BT48Uzms.js → resizable-D7pt8dup.js} +1 -1
- package/dist/client/assets/roles-xJLawXZj.js +1 -0
- package/dist/client/assets/save-referenced-block-ShdGpmDs.js +1 -0
- package/dist/client/assets/{save-status-DsIS1sld.js → save-status-oczKxF1W.js} +1 -1
- package/dist/client/assets/{schema-form-oJE4kcAX.js → schema-form-974itnxa.js} +1 -1
- package/dist/client/assets/{scroll-area-D2NfEZKG.js → scroll-area-DuFY4R5d.js} +1 -1
- package/dist/client/assets/{search-input-wg0ktmKr.js → search-input-DACBbzIk.js} +1 -1
- package/dist/client/assets/{secrets-YPZEWZE9.js → secrets-DMWeEvqW.js} +1 -1
- package/dist/client/assets/{sections-editor-CDk8QiTt.js → sections-editor-DM97T9Hx.js} +2 -2
- package/dist/client/assets/{select-LvZkQCcv.js → select-gqSNOxQD.js} +1 -1
- package/dist/client/assets/{select-model-Bvdn_l3a.js → select-model-CbdvfMbD.js} +1 -1
- package/dist/client/assets/seo-editor-BNi1XNxf.js +1 -0
- package/dist/client/assets/{settings-layout-Cn8PAm-f.js → settings-layout-XPdklskX.js} +1 -1
- package/dist/client/assets/{settings-section-BiebCtcC.js → settings-section-BgPOTco2.js} +1 -1
- package/dist/client/assets/{sheet-4GES45T2.js → sheet-J-5zCitH.js} +1 -1
- package/dist/client/assets/{shell-controls-pFVNS2Vn.js → shell-controls-BB8JT3cu.js} +1 -1
- package/dist/client/assets/{shell-layout-DtkuyxW9.js → shell-layout-B1bpQmja.js} +1 -1
- package/dist/client/assets/shell-route-loading-BL818aqT.js +1 -0
- package/dist/client/assets/{sidebar-BY-0S2nV.js → sidebar-DpznaqAr.js} +1 -1
- package/dist/client/assets/{skeleton-B2rX4p4v.js → skeleton-BrZY2U4q.js} +1 -1
- package/dist/client/assets/{sortable.esm-C0tZpwHI.js → sortable.esm-DAdL_KCM.js} +1 -1
- package/dist/client/assets/{spinner-WtoCvpNX.js → spinner-DWj9d3Oy.js} +1 -1
- package/dist/client/assets/{sso-4MYeJHQK.js → sso-_Gw_BXbF.js} +1 -1
- package/dist/client/assets/{store-BTeo8TpT.js → store-C4geYRDc.js} +1 -1
- package/dist/client/assets/store-registry-WC9BumXE.js +2 -0
- package/dist/client/assets/{studio-tools-CH7dZ7HT.js → studio-tools-YbndxaJx.js} +1 -1
- package/dist/client/assets/{switch-BOtiDaPh.js → switch-CWe9x1dO.js} +1 -1
- package/dist/client/assets/{tab-id-DaQY5Du1.js → tab-id-Bc_4nZgl.js} +1 -1
- package/dist/client/assets/{table-kq85oeWE.js → table-MDhW4B8D.js} +1 -1
- package/dist/client/assets/{tabs-D_XRbq3N.js → tabs-9ZkZ5CXu.js} +1 -1
- package/dist/client/assets/{task-status-BlpPmTT-.js → task-status-BNkxxOv6.js} +1 -1
- package/dist/client/assets/{textarea-CxRmk2pV.js → textarea-CimG5sWW.js} +1 -1
- package/dist/client/assets/{toggle-group-B_ZhC8rH.js → toggle-group-BqOsII08.js} +1 -1
- package/dist/client/assets/{toolbar-BptUton3.js → toolbar-oWPvqwRC.js} +1 -1
- package/dist/client/assets/{tools-list-BXxC0BJ6.js → tools-list-C2in0sGo.js} +1 -1
- package/dist/client/assets/{tooltip-6OktDyzD.js → tooltip-BwiZr2GD.js} +1 -1
- package/dist/client/assets/{types-k3mlT_jb.js → types-BYtVTpDQ.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Czs3LwMV.js → use-ai-providers-B4z2G4rP.js} +1 -1
- package/dist/client/assets/{use-automations-6FHnA6mT.js → use-automations-Cgz4YKs5.js} +1 -1
- package/dist/client/assets/{use-capability-B2GMKCxl.js → use-capability-CtdbYGMh.js} +1 -1
- package/dist/client/assets/{use-clock-tick-DRfafiJJ.js → use-clock-tick-CPPdyWgW.js} +1 -1
- package/dist/client/assets/{use-collections-3gcbdMo5.js → use-collections-D52tQdGt.js} +1 -1
- package/dist/client/assets/{use-connection-Cygt3JAU.js → use-connection-DyyYYs8L.js} +1 -1
- package/dist/client/assets/{use-copy-BzO5OLbn.js → use-copy-BEZFUgho.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BJIgmNjf.js → use-create-virtual-mcp-w-CGYLKc.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-rTdfYQSA.js → use-debounced-autosave-7GLgaJXq.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BwHDAibo.js → use-delete-connection-6bfkbwg3.js} +1 -1
- package/dist/client/assets/{use-file-configs-C_uUU82K.js → use-file-configs-fZ_0pNgv.js} +1 -1
- package/dist/client/assets/use-infinite-scroll-D2-BvjXC.js +1 -0
- package/dist/client/assets/{use-list-state-CAT0PD89.js → use-list-state-BiQdeo-3.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Bbkq-Btq.js → use-mcp-client-iXdxenz3.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-C2IR7B-B.js → use-mcp-prompts-BZ3M88pO.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BiO0x3bS.js → use-mcp-tools-BFte_Z9f.js} +1 -1
- package/dist/client/assets/{use-members-Ct7TKvLy.js → use-members-lO5UPidt.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-7jnPTeCV.js → use-navigate-to-agent-DIjWe8In.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DwSMx4xq.js → use-org-auth-client-CjM9gfPH.js} +1 -1
- package/dist/client/assets/{use-org-sso-HULZXLZY.js → use-org-sso-Sk1A6q8-.js} +1 -1
- package/dist/client/assets/{use-organization-roles-C24SP1RJ.js → use-organization-roles-C5mxX9Rk.js} +1 -1
- package/dist/client/assets/{use-organization-settings-6ykeD7wG.js → use-organization-settings-MrnwSgAR.js} +1 -1
- package/dist/client/assets/{use-registry-connections-Cw0Uu9HN.js → use-registry-connections-CC-YLphz.js} +1 -1
- package/dist/client/assets/{use-secrets-Dn7Z2olr.js → use-secrets-CajEM27b.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BMl-h7wF.js → use-status-sounds-BwNN0Dt-.js} +1 -1
- package/dist/client/assets/{use-view-mode-DS8kaEq4.js → use-view-mode-B5-wFbmS.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-C6pMpGrR.js → use-virtual-mcp-Cw_yVFMO.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DHhL-q8j.js +1 -0
- package/dist/client/assets/{useRouterState-Dnb9kW5z.js → useRouterState-IhZ1SxRm.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-oHftqcSU.js +1 -0
- package/dist/client/assets/{user-TO91q8is.js → user-CJUwgqvV.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-X2TTOWIg.js → view-mode-toggle-CMrO4dTZ.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-CuN8_Ws2.js → watch-sse-pool-BZQA3Ki3.js} +1 -1
- package/dist/client/assets/{workflow-Bof_Hi_L.js → workflow-CrJS-2vt.js} +1 -1
- package/dist/client/assets/workflow-detail-CBOkNhJP.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +387 -387
- package/dist/server/migrate.js +52 -52
- package/dist/server/server.js +265 -265
- package/package.json +1 -1
- package/dist/client/assets/add-section-modal-BEtlbcy-.js +0 -1
- package/dist/client/assets/agent-capabilities-CFuGvMed.js +0 -3
- package/dist/client/assets/app-editor-DqK_iwlT.js +0 -1
- package/dist/client/assets/connections-DzNM9iR8.js +0 -1
- package/dist/client/assets/decopilot-sse-pool-8baykh62.js +0 -1
- package/dist/client/assets/file-explorer-Bm3G3AJO.js +0 -2
- package/dist/client/assets/index-Bq-oI4jf.js +0 -8
- package/dist/client/assets/index-DeWy5Ckp.js +0 -1
- package/dist/client/assets/index-jA2TneF4.js +0 -1
- package/dist/client/assets/infiniteQueryObserver-Da-l1Mrb.js +0 -1
- package/dist/client/assets/monaco-editor-CVjkFUXK.js +0 -9
- package/dist/client/assets/page-seo-sheet-DHjVYqZY.js +0 -1
- package/dist/client/assets/project-app-view-MmHyDgpb.js +0 -1
- package/dist/client/assets/record-editor-LCb43Ehs.js +0 -1
- package/dist/client/assets/registry-DRQ1oW7y.js +0 -2
- package/dist/client/assets/registry-layout-C-3QWp3D.js +0 -27
- package/dist/client/assets/roles-9lGr_fMG.js +0 -1
- package/dist/client/assets/save-referenced-block-Uk3HPmEZ.js +0 -1
- package/dist/client/assets/seo-editor-CZ4NCpV7.js +0 -1
- package/dist/client/assets/shell-route-loading-B6fsTD_h.js +0 -1
- package/dist/client/assets/store-registry-B8aDVYEg.js +0 -2
- package/dist/client/assets/use-infinite-scroll-D7Lz32GP.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DnxNK7B2.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Bdpr4GcQ.js +0 -1
- package/dist/client/assets/workflow-detail-xblJkXWm.js +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{e as Y,q as xe,n as Pe,G as _e,a as fe,o as V,r as M,j as t,B as G,l as Le,c as Z,M as Bs,J as Qs,bl as Vs,bm as Gs}from"./index-BPnG82q8.js";import{c as Zt,b as Ks,d as us,a as Ys,i as Hs,t as Ws,f as Js,e as Zs}from"./XCircle-m30sBtwe.js";import{i as Fe}from"./CheckCircle-CNdjtGTh.js";import{n as Xs}from"./Container-CYA7KoET.js";import{a as er}from"./Settings02-h4KhooA8.js";import{a as ke,u as Ce,W as tr}from"./use-mcp-client-iXdxenz3.js";import{u as ms}from"./useInfiniteQuery-DHhL-q8j.js";import{u as Se}from"./studio-tools-YbndxaJx.js";import{B as F}from"./badge-CIMelj9a.js";import{I as le}from"./input-Dp561wvu.js";import{a as ut,c as we,D as mt,b as xt,j as Xt,k as es,g as sr}from"./dropdown-menu-uYsl4z-0.js";import{c as Dt,d as Et,a as Be,e as oe,b as At,T as ce}from"./table-MDhW4B8D.js";import{T as rr,a as ts}from"./toggle-group-BqOsII08.js";import{u as nr}from"./use-view-mode-B5-wFbmS.js";import{i as $t}from"./DotsVertical-FCIPj2jh.js";import{i as ir}from"./FilterLines-PIiHcomo.js";import{n as lr,i as xs}from"./Globe01-DCcLGAPs.js";import{i as ar}from"./SearchMd-Cd3g9OHi.js";import{b as ht,c as pt,e as ft,d as gt,a as jt,D as vt}from"./dialog-BgALXZ6h.js";import{i as Ye}from"./AlertCircle-B4gYnOPQ.js";import{i as ss}from"./Upload01-hFtvGOKc.js";import{c as He,b as We,d as Je,f as Ze,g as Xe,e as et,a as tt,A as st}from"./alert-dialog-CvpxH7Lf.js";import{C as ne}from"./card-CPe96wry.js";import{s as rt}from"./Trash01-CdVc63JX.js";import{L as X}from"./label-BSaEPU5n.js";import{d as or,S as cr,a as dr,b as ur,c as Rt}from"./select-gqSNOxQD.js";import{S as Ue}from"./switch-CWe9x1dO.js";import{T as bt}from"./textarea-CimG5sWW.js";import{s as Ot,b as mr,i as xr,a as hr}from"./RefreshCcw01-CoOu-1-t.js";import{i as pr}from"./X-CiRjfhfc.js";import{t as fr}from"./ChevronDown-3x5m66Bs.js";import{n as gr}from"./ChevronUp-Bh0YaH7H.js";import{C as rs}from"./checkbox-CMfBi1P9.js";import{s as hs,a as Tt}from"./Eye-BEaX-nOW.js";import{n as jr}from"./LinkExternal01-kEaZ-3VP.js";import{u as vr}from"./use-infinite-scroll-D2-BvjXC.js";import{u as It}from"./use-copy-BEZFUgho.js";import{i as Pt}from"./Check-Cy2gwr8C.js";import{i as br}from"./Key01-DOICf9Yf.js";import{s as yr}from"./Plus-CZoFo8m3.js";import{T as Nr,a as wr,b as _r}from"./tooltip-BwiZr2GD.js";import{i as Cr}from"./Play-CgnBFM99.js";import"./ChevronRight-CeIr4WsE.js";const Oe="private-registry",kr=`
|
|
2
|
+
You are an MCP tool tester running automated integration checks.
|
|
3
|
+
|
|
4
|
+
Goal:
|
|
5
|
+
- Validate that this MCP and its tools work end-to-end.
|
|
6
|
+
- Prefer realistic sequences where one tool output feeds the next tool input.
|
|
7
|
+
- Example chain: list -> pick id -> get/update/delete.
|
|
8
|
+
|
|
9
|
+
Rules:
|
|
10
|
+
- Try to execute as many tools as possible.
|
|
11
|
+
- If a tool requires context, first call discovery/list tools to obtain valid IDs.
|
|
12
|
+
- If you create test data, clean it up when possible.
|
|
13
|
+
- If one tool fails, continue testing the remaining tools.
|
|
14
|
+
- If a tool returns input validation errors, fix the arguments and retry that tool.
|
|
15
|
+
- For tools that require identifiers (fileId, folderId, etc), always get IDs from previous list/get calls.
|
|
16
|
+
- Keep calls focused and safe.
|
|
17
|
+
|
|
18
|
+
At the end, provide a concise summary of:
|
|
19
|
+
- What passed
|
|
20
|
+
- What failed
|
|
21
|
+
- What could not be tested and why
|
|
22
|
+
- If some tool needs user-specific context (email/account/tenant), explicitly output a "CONTEXT_REQUIRED" note with what is needed.
|
|
23
|
+
`.trim(),Q={all:["private-registry"],items:()=>[...Q.all,"items"],itemsList:(s,e,r,n)=>[...Q.items(),"list",{search:s,tags:e,categories:r,limit:n}],item:s=>[...Q.items(),"item",s],filters:()=>[...Q.all,"filters"],registryConfig:()=>[...Q.all,"registry-config"],registryConfigByPlugin:(s,e)=>[...Q.registryConfig(),s,e],publishRequests:()=>[...Q.all,"publish-requests"],publishRequestsByOrg:s=>[...Q.publishRequests(),"org",s],publishRequestsList:(s,e,r)=>[...Q.publishRequests(),"list",{status:s??"all",sortBy:e??"created_at",sortDirection:r??"desc"}],publishRequestsListByOrg:(s,e,r,n)=>[...Q.publishRequestsByOrg(s),"list",{status:e??"all",sortBy:r??"created_at",sortDirection:n??"desc"}],publishRequestsCount:()=>[...Q.publishRequests(),"count"],publishRequestsCountByOrg:s=>[...Q.publishRequestsByOrg(s),"count"],publishApiKeys:()=>[...Q.all,"publish-api-keys"],monitor:()=>[...Q.all,"monitor"],monitorRuns:()=>[...Q.monitor(),"runs"],monitorRunsList:s=>[...Q.monitorRuns(),"list",{status:s??"all"}],monitorRun:s=>[...Q.monitorRuns(),"run",s??"none"],monitorResults:()=>[...Q.monitor(),"results"],monitorResultsList:(s,e)=>[...Q.monitorResults(),"list",{runId:s??"none",status:e??"all"}],monitorConnections:()=>[...Q.monitor(),"connections"],monitorConnectionAuthProbe:s=>[...Q.monitorConnections(),"auth-probe",s]};async function Ne(s,e,r){const n=await s.callTool({name:e,arguments:r});if(!n||typeof n!="object")throw new Error(`Invalid tool response for ${e}`);if(n.isError){const o=n.content?.find(i=>i.type==="text")?.text??`Tool ${e} returned an error`;throw new Error(o)}return n.structuredContent??n}function Sr(){const s=Y.c(10),e=_e(),{org:r}=xe();let n;s[0]!==r.id||s[1]!==r.slug?(n={connectionId:ke,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=n):n=s[2];const o=Ce(n);let i;s[3]!==o?(i=async d=>Ne(o,"REGISTRY_MONITOR_RUN_START",{config:d}),s[3]=o,s[4]=i):i=s[4];let a;s[5]!==e?(a=async()=>{await Promise.all([e.invalidateQueries({queryKey:Q.monitorRuns()}),e.invalidateQueries({queryKey:Q.monitorResults()})])},s[5]=e,s[6]=a):a=s[6];let l;return s[7]!==i||s[8]!==a?(l={mutationFn:i,onSuccess:a},s[7]=i,s[8]=a,s[9]=l):l=s[9],fe(l)}function Rr(){const s=Y.c(10),e=_e(),{org:r}=xe();let n;s[0]!==r.id||s[1]!==r.slug?(n={connectionId:ke,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=n):n=s[2];const o=Ce(n);let i;s[3]!==o?(i=async d=>Ne(o,"REGISTRY_MONITOR_RUN_CANCEL",{runId:d}),s[3]=o,s[4]=i):i=s[4];let a;s[5]!==e?(a=async(d,u)=>{await Promise.all([e.invalidateQueries({queryKey:Q.monitorRuns()}),e.invalidateQueries({queryKey:Q.monitorRun(u)})])},s[5]=e,s[6]=a):a=s[6];let l;return s[7]!==i||s[8]!==a?(l={mutationFn:i,onSuccess:a},s[7]=i,s[8]=a,s[9]=l):l=s[9],fe(l)}function Nt(s){const e=Y.c(11),{org:r}=xe();let n;e[0]!==r.id||e[1]!==r.slug?(n={connectionId:ke,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=n):n=e[2];const o=Ce(n);let i;e[3]!==s?(i=Q.monitorRunsList(s),e[3]=s,e[4]=i):i=e[4];let a;e[5]!==o||e[6]!==s?(a=async()=>Ne(o,"REGISTRY_MONITOR_RUN_LIST",{status:s,limit:100}),e[5]=o,e[6]=s,e[7]=a):a=e[7];let l;return e[8]!==i||e[9]!==a?(l={queryKey:i,queryFn:a,staleTime:5e3},e[8]=i,e[9]=a,e[10]=l):l=e[10],Pe(l)}function Ut(s){const e=Y.c(12),{org:r}=xe();let n;e[0]!==r.id||e[1]!==r.slug?(n={connectionId:ke,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=n):n=e[2];const o=Ce(n);let i;e[3]!==s?(i=Q.monitorRun(s),e[3]=s,e[4]=i):i=e[4];let a;e[5]!==o||e[6]!==s?(a=async()=>Ne(o,"REGISTRY_MONITOR_RUN_GET",{runId:s}),e[5]=o,e[6]=s,e[7]=a):a=e[7];const l=!!s;let d;return e[8]!==i||e[9]!==a||e[10]!==l?(d={queryKey:i,queryFn:a,enabled:l,refetchInterval:Tr},e[8]=i,e[9]=a,e[10]=l,e[11]=d):d=e[11],Pe(d)}function Tr(s){return s.state.data?.run?.status==="running"?5e3:!1}function nt(s,e,r){const n=Y.c(15),{org:o}=xe();let i;n[0]!==o.id||n[1]!==o.slug?(i={connectionId:ke,orgId:o.id,orgSlug:o.slug},n[0]=o.id,n[1]=o.slug,n[2]=i):i=n[2];const a=Ce(i);let l;n[3]!==s||n[4]!==e?(l=Q.monitorResultsList(s,e),n[3]=s,n[4]=e,n[5]=l):l=n[5];let d;n[6]!==a||n[7]!==s||n[8]!==e?(d=async()=>Ne(a,"REGISTRY_MONITOR_RESULT_LIST",{runId:s,status:e,limit:200,offset:0}),n[6]=a,n[7]=s,n[8]=e,n[9]=d):d=n[9];const u=!!s,m=r==="running"?2500:!1;let h;return n[10]!==l||n[11]!==d||n[12]!==u||n[13]!==m?(h={queryKey:l,queryFn:d,enabled:u,staleTime:5e3,refetchInterval:m},n[10]=l,n[11]=d,n[12]=u,n[13]=m,n[14]=h):h=n[14],Pe(h)}function ps(){const s=Y.c(6),{org:e}=xe();let r;s[0]!==e.id||s[1]!==e.slug?(r={connectionId:ke,orgId:e.id,orgSlug:e.slug},s[0]=e.id,s[1]=e.slug,s[2]=r):r=s[2];const n=Ce(r);let o;s[3]===Symbol.for("react.memo_cache_sentinel")?(o=Q.monitorConnections(),s[3]=o):o=s[3];let i;return s[4]!==n?(i={queryKey:o,queryFn:async()=>Ne(n,"REGISTRY_MONITOR_CONNECTION_LIST",{}),staleTime:1e4},s[4]=n,s[5]=i):i=s[5],Pe(i)}function Ir(){const s=Y.c(10),e=_e(),{org:r}=xe();let n;s[0]!==r.id||s[1]!==r.slug?(n={connectionId:ke,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=n):n=s[2];const o=Ce(n);let i;s[3]!==o?(i=async()=>Ne(o,"REGISTRY_MONITOR_CONNECTION_SYNC",{}),s[3]=o,s[4]=i):i=s[4];let a;s[5]!==e?(a=async()=>{await e.invalidateQueries({queryKey:Q.monitorConnections()})},s[5]=e,s[6]=a):a=s[6];let l;return s[7]!==i||s[8]!==a?(l={mutationFn:i,onSuccess:a},s[7]=i,s[8]=a,s[9]=l):l=s[9],fe(l)}function Pr(){const s=Y.c(10),e=_e(),{org:r}=xe();let n;s[0]!==r.id||s[1]!==r.slug?(n={connectionId:ke,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=n):n=s[2];const o=Ce(n);let i;s[3]!==o?(i=async d=>{const{connectionId:u,authStatus:m}=d;return Ne(o,"REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH",{connectionId:u,authStatus:m})},s[3]=o,s[4]=i):i=s[4];let a;s[5]!==e?(a=async()=>{await e.invalidateQueries({queryKey:Q.monitorConnections()})},s[5]=e,s[6]=a):a=s[6];let l;return s[7]!==i||s[8]!==a?(l={mutationFn:i,onSuccess:a},s[7]=i,s[8]=a,s[9]=l):l=s[9],fe(l)}const ns={monitorMode:"health_check",onFailure:"none",schedule:"manual",cronExpression:"",scheduleEventId:"",perMcpTimeoutMs:3e4,perToolTimeoutMs:1e4,maxAgentSteps:15,testPublicOnly:!1,testPrivateOnly:!1,includePendingRequests:!1,agentContext:""};function fs(){const s=Y.c(34),{org:e,project:r}=xe();let n;s[0]!==e.id||s[1]!==e.slug?(n={connectionId:ke,orgId:e.id,orgSlug:e.slug},s[0]=e.id,s[1]=e.slug,s[2]=n):n=s[2];const o=Ce(n),i=_e();let a;s[3]!==r.id?(a=Q.registryConfigByPlugin(r.id??"",Oe),s[3]=r.id,s[4]=a):a=s[4];let l;s[5]!==o||s[6]!==r.id?(l=async()=>Ne(o,"VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:r.id,pluginId:Oe}),s[5]=o,s[6]=r.id,s[7]=l):l=s[7];const d=!!r.id;let u;s[8]!==a||s[9]!==l||s[10]!==d?(u={queryKey:a,queryFn:l,enabled:d},s[8]=a,s[9]=l,s[10]=d,s[11]=u):u=s[11];const m=Pe(u),h=m.data?.config?.settings,x=h&&typeof h=="object"?h.testConfig:void 0,c=typeof(h?h.monitorMode??h.testMode:void 0)=="string";let p;s[12]!==x?(p=x??{},s[12]=x,s[13]=p):p=s[13];let j;s[14]!==c||s[15]!==h||s[16]!==x?(j=c&&!x?h:{},s[14]=c,s[15]=h,s[16]=x,s[17]=j):j=s[17];let y;s[18]!==p||s[19]!==j?(y={...ns,...p,...j},s[18]=p,s[19]=j,s[20]=y):y=s[20];const N=y;let w;s[21]!==o||s[22]!==r.id?(w=async C=>{const R=(await Ne(o,"VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:r.id,pluginId:Oe}))?.config?.settings??{};return Ne(o,"VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE",{virtualMcpId:r.id,pluginId:Oe,settings:{...R,testConfig:{...ns,...R.testConfig??{},...C}}})},s[21]=o,s[22]=r.id,s[23]=w):w=s[23];let v;s[24]!==r.id||s[25]!==i?(v=async()=>{await i.invalidateQueries({queryKey:Q.registryConfigByPlugin(r.id??"",Oe)})},s[24]=r.id,s[25]=i,s[26]=v):v=s[26];let I;s[27]!==w||s[28]!==v?(I={mutationFn:w,onSuccess:v},s[27]=w,s[28]=v,s[29]=I):I=s[29];const S=fe(I);let _;return s[30]!==m.isLoading||s[31]!==S||s[32]!==N?(_={settings:N,isLoading:m.isLoading,saveMutation:S},s[30]=m.isLoading,s[31]=S,s[32]=N,s[33]=_):_=s[33],_}function Mr(){const s=Y.c(10),e=_e(),{org:r}=xe();let n;s[0]!==r.id||s[1]!==r.slug?(n={connectionId:ke,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=n):n=s[2];const o=Ce(n);let i;s[3]!==o?(i=async d=>Ne(o,"REGISTRY_MONITOR_SCHEDULE_SET",d),s[3]=o,s[4]=i):i=s[4];let a;s[5]!==e?(a=async()=>{await e.invalidateQueries({queryKey:Q.registryConfig()})},s[5]=e,s[6]=a):a=s[6];let l;return s[7]!==i||s[8]!==a?(l={mutationFn:i,onSuccess:a},s[7]=i,s[8]=a,s[9]=l):l=s[9],fe(l)}function Dr(){const s=Y.c(10),e=_e(),{org:r}=xe();let n;s[0]!==r.id||s[1]!==r.slug?(n={connectionId:ke,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=n):n=s[2];const o=Ce(n);let i;s[3]!==o?(i=async d=>Ne(o,"REGISTRY_MONITOR_SCHEDULE_CANCEL",{scheduleEventId:d}),s[3]=o,s[4]=i):i=s[4];let a;s[5]!==e?(a=async()=>{await e.invalidateQueries({queryKey:Q.registryConfig()})},s[5]=e,s[6]=a):a=s[6];let l;return s[7]!==i||s[8]!==a?(l={mutationFn:i,onSuccess:a},s[7]=i,s[8]=a,s[9]=l):l=s[9],fe(l)}function Er(){const s=Y.c(3),e=Nt("completed"),r=e.data?.items?.[0]?.id,n=e.data?.items?.[0]?.status,o=nt(r,"failed",n),i=o.data?.items?.length??0,a=e.isLoading||o.isLoading;let l;return s[0]!==i||s[1]!==a?(l={brokenCount:i,isLoading:a},s[0]=i,s[1]=a,s[2]=l):l=s[2],l}const gs=24;function Ar(s){return s.trim()}async function ge(s,e,r){return s.call(e,r)}function js(s){const e=Y.c(17),r=Se();let n,o,i,a;e[0]!==s.categories||e[1]!==s.limit||e[2]!==s.search||e[3]!==s.tags?(o=Ar(s.search),n=s.limit??gs,a=ms,i=Q.itemsList(o,s.tags,s.categories,n),e[0]=s.categories,e[1]=s.limit,e[2]=s.search,e[3]=s.tags,e[4]=n,e[5]=o,e[6]=i,e[7]=a):(n=e[4],o=e[5],i=e[6],a=e[7]);let l;e[8]!==n||e[9]!==s.categories||e[10]!==s.tags||e[11]!==o||e[12]!==r?(l=async u=>{const{pageParam:m}=u,h=o.length>0?{operator:"or",conditions:[{field:["title"],operator:"contains",value:o},{field:["description"],operator:"contains",value:o},{field:["id"],operator:"contains",value:o},{field:["server","name"],operator:"contains",value:o}]}:void 0;return ge(r,"REGISTRY_ITEM_LIST",{cursor:m,limit:n,tags:s.tags.length?s.tags:void 0,categories:s.categories.length?s.categories:void 0,where:h})},e[8]=n,e[9]=s.categories,e[10]=s.tags,e[11]=o,e[12]=r,e[13]=l):l=e[13];let d;return e[14]!==i||e[15]!==l?(d={queryKey:i,queryFn:l,initialPageParam:void 0,getNextPageParam:$r,staleTime:3e4},e[14]=i,e[15]=l,e[16]=d):d=e[16],a(d)}function $r(s){return s.nextCursor}function Or(){const s=Y.c(6),e=Se();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r=Q.filters(),s[0]=r):r=s[0];let n;s[1]!==e?(n=async()=>ge(e,"REGISTRY_ITEM_FILTERS",{}),s[1]=e,s[2]=n):n=s[2];let o;s[3]===Symbol.for("react.memo_cache_sentinel")?(o={tags:[],categories:[]},s[3]=o):o=s[3];let i;return s[4]!==n?(i={queryKey:r,queryFn:n,placeholderData:o,staleTime:6e4},s[4]=n,s[5]=i):i=s[5],Pe(i)}function qt(){const s=Y.c(27),e=_e(),r=Se();let n;s[0]!==e?(n=async()=>{await Promise.all([e.invalidateQueries({queryKey:Q.items()}),e.invalidateQueries({queryKey:Q.filters()})])},s[0]=e,s[1]=n):n=s[1];const o=n;let i;s[2]!==r?(i=async N=>(await ge(r,"REGISTRY_ITEM_CREATE",{data:N})).item,s[2]=r,s[3]=i):i=s[3];let a;s[4]!==o||s[5]!==i?(a={mutationFn:i,onSuccess:o},s[4]=o,s[5]=i,s[6]=a):a=s[6];const l=fe(a);let d;s[7]!==r?(d=async N=>{const{id:w,data:v}=N;return(await ge(r,"REGISTRY_ITEM_UPDATE",{id:w,data:v})).item},s[7]=r,s[8]=d):d=s[8];let u;s[9]!==o||s[10]!==d?(u={mutationFn:d,onSuccess:o},s[9]=o,s[10]=d,s[11]=u):u=s[11];const m=fe(u);let h;s[12]!==r?(h=async N=>(await ge(r,"REGISTRY_ITEM_DELETE",{id:N})).item,s[12]=r,s[13]=h):h=s[13];let x;s[14]!==o||s[15]!==h?(x={mutationFn:h,onSuccess:o},s[14]=o,s[15]=h,s[16]=x):x=s[16];const f=fe(x);let c;s[17]!==r?(c=async N=>ge(r,"REGISTRY_ITEM_BULK_CREATE",{items:N}),s[17]=r,s[18]=c):c=s[18];let p;s[19]!==o||s[20]!==c?(p={mutationFn:c,onSuccess:o},s[19]=o,s[20]=c,s[21]=p):p=s[21];const j=fe(p);let y;return s[22]!==j||s[23]!==l||s[24]!==f||s[25]!==m?(y={createMutation:l,updateMutation:m,deleteMutation:f,bulkCreateMutation:j},s[22]=j,s[23]=l,s[24]=f,s[25]=m,s[26]=y):y=s[26],y}function vs(s){const e=Y.c(24),{org:r}=xe(),n=Se(),o=_e(),i=tr.SELF(r.id),a=Pe({queryKey:Q.registryConfigByPlugin(i,s),queryFn:async()=>ge(n,"VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:i,pluginId:s}),staleTime:6e4}),l=Q.registryConfigByPlugin(i,s);let d;e[0]!==s||e[1]!==i||e[2]!==n?(d=async T=>{const E=(await ge(n,"VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:i,pluginId:s}))?.config?.settings??{};return ge(n,"VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE",{virtualMcpId:i,pluginId:s,settings:{...E,...T}})},e[0]=s,e[1]=i,e[2]=n,e[3]=d):d=e[3];let u;e[4]!==o||e[5]!==l?(u=async()=>{await o.invalidateQueries({queryKey:l})},e[4]=o,e[5]=l,e[6]=u):u=e[6];let m;e[7]!==d||e[8]!==u?(m={mutationFn:d,onSuccess:u,onError:Ur},e[7]=d,e[8]=u,e[9]=m):m=e[9];const h=fe(m);let x;e[10]!==h?(x=T=>{h.mutate(T)},e[10]=h,e[11]=x):x=e[11];const f=x,c=a.data?.config?.settings?.registryName??"Private Registry",p=a.data?.config?.settings?.registryIcon??"",j=a.data?.config?.settings?.acceptPublishRequests??!1,y=a.data?.config?.settings?.requireApiToken??!1,N=a.data?.config?.settings?.storePrivateOnly??!1,w=a.data?.config?.settings?.rateLimitEnabled??!0,I=a.data?.config?.settings?.rateLimitWindow==="minute"?"minute":"hour",S=a.data?.config?.settings?.rateLimitMax,_=typeof S=="number"&&S>=1?Math.floor(S):100;let C;return e[12]!==j||e[13]!==h.isPending||e[14]!==a.isLoading||e[15]!==w||e[16]!==_||e[17]!==I||e[18]!==p||e[19]!==c||e[20]!==y||e[21]!==N||e[22]!==f?(C={registryName:c,registryIcon:p,acceptPublishRequests:j,requireApiToken:y,storePrivateOnly:N,rateLimitEnabled:w,rateLimitWindow:I,rateLimitMax:_,isLoadingConfig:a.isLoading,isSaving:h.isPending,updateConfig:f},e[12]=j,e[13]=h.isPending,e[14]=a.isLoading,e[15]=w,e[16]=_,e[17]=I,e[18]=p,e[19]=c,e[20]=y,e[21]=N,e[22]=f,e[23]=C):C=e[23],C}function Ur(s){V.error(s instanceof Error?s.message:"Failed to save registry settings")}function qr(s){const e=Y.c(13),{org:r}=xe(),n=Se();let o;e[0]!==r.id||e[1]!==s.sortBy||e[2]!==s.sortDirection||e[3]!==s.status?(o=Q.publishRequestsListByOrg(r.id,s.status,s.sortBy,s.sortDirection),e[0]=r.id,e[1]=s.sortBy,e[2]=s.sortDirection,e[3]=s.status,e[4]=o):o=e[4];let i;e[5]!==s.sortBy||e[6]!==s.sortDirection||e[7]!==s.status||e[8]!==n?(i=async l=>{const{pageParam:d}=l;return ge(n,"REGISTRY_PUBLISH_REQUEST_LIST",{status:s.status,sortBy:s.sortBy,sortDirection:s.sortDirection,limit:gs,offset:d})},e[5]=s.sortBy,e[6]=s.sortDirection,e[7]=s.status,e[8]=n,e[9]=i):i=e[9];let a;return e[10]!==o||e[11]!==i?(a={queryKey:o,queryFn:i,initialPageParam:0,getNextPageParam:zr,staleTime:3e4,refetchOnMount:!0},e[10]=o,e[11]=i,e[12]=a):a=e[12],ms(a)}function zr(s,e){const r=e.reduce(Lr,0);return r<s.totalCount?r:void 0}function Lr(s,e){return s+e.items.length}function Fr(){const s=Y.c(7),{org:e}=xe(),r=Se();let n;s[0]!==e.id?(n=Q.publishRequestsCountByOrg(e.id),s[0]=e.id,s[1]=n):n=s[1];let o;s[2]!==r?(o=async()=>ge(r,"REGISTRY_PUBLISH_REQUEST_COUNT",{}),s[2]=r,s[3]=o):o=s[3];let i;return s[4]!==n||s[5]!==o?(i={queryKey:n,queryFn:o,staleTime:3e4},s[4]=n,s[5]=o,s[6]=i):i=s[6],Pe(i)}function Br(){const s=Y.c(15),e=_e(),r=Se();let n;s[0]!==e?(n=async()=>{await Promise.all([e.invalidateQueries({queryKey:Q.publishRequests()})])},s[0]=e,s[1]=n):n=s[1];const o=n;let i;s[2]!==r?(i=async x=>ge(r,"REGISTRY_PUBLISH_REQUEST_REVIEW",x),s[2]=r,s[3]=i):i=s[3];let a;s[4]!==o||s[5]!==i?(a={mutationFn:i,onSuccess:o},s[4]=o,s[5]=i,s[6]=a):a=s[6];const l=fe(a);let d;s[7]!==r?(d=async x=>ge(r,"REGISTRY_PUBLISH_REQUEST_DELETE",{id:x}),s[7]=r,s[8]=d):d=s[8];let u;s[9]!==o||s[10]!==d?(u={mutationFn:d,onSuccess:o},s[9]=o,s[10]=d,s[11]=u):u=s[11];const m=fe(u);let h;return s[12]!==m||s[13]!==l?(h={reviewMutation:l,deleteMutation:m},s[12]=m,s[13]=l,s[14]=h):h=s[14],h}function Qr(){const s=Y.c(3),e=Se();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r=Q.publishApiKeys(),s[0]=r):r=s[0];let n;return s[1]!==e?(n={queryKey:r,queryFn:async()=>ge(e,"REGISTRY_PUBLISH_API_KEY_LIST",{}),staleTime:3e4},s[1]=e,s[2]=n):n=s[2],Pe(n)}function Vr(){const s=Y.c(17),e=_e(),r=Se();let n;s[0]!==r?(n=async x=>ge(r,"REGISTRY_PUBLISH_API_KEY_GENERATE",{name:x}),s[0]=r,s[1]=n):n=s[1];let o;s[2]!==e?(o=async()=>{await e.invalidateQueries({queryKey:Q.publishApiKeys()})},s[2]=e,s[3]=o):o=s[3];let i;s[4]!==n||s[5]!==o?(i={mutationFn:n,onSuccess:o},s[4]=n,s[5]=o,s[6]=i):i=s[6];const a=fe(i);let l;s[7]!==r?(l=async x=>ge(r,"REGISTRY_PUBLISH_API_KEY_REVOKE",{keyId:x}),s[7]=r,s[8]=l):l=s[8];let d;s[9]!==e?(d=async()=>{await e.invalidateQueries({queryKey:Q.publishApiKeys()})},s[9]=e,s[10]=d):d=s[10];let u;s[11]!==l||s[12]!==d?(u={mutationFn:l,onSuccess:d},s[11]=l,s[12]=d,s[13]=u):u=s[13];const m=fe(u);let h;return s[14]!==a||s[15]!==m?(h={generateMutation:a,revokeMutation:m},s[14]=a,s[15]=m,s[16]=h):h=s[16],h}function is(s){return s?s.split(/[;|]/).map(e=>e.trim()).filter(Boolean):[]}function ls(s){const e=[];let r="",n=!1;for(let o=0;o<s.length;o+=1){const i=s[o],a=s[o+1];if(i==='"'){n&&a==='"'?(r+='"',o+=1):n=!n;continue}if(i===","&&!n){e.push(r.trim()),r="";continue}r+=i}return e.push(r.trim()),e}const Gr=["id","title"],Kr=["id","title","description","remote_url","remote_type","tags","categories","is_public"];function Yr(s){const e=s.split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(e.length<2)return{items:[],warnings:[{line:0,message:"CSV must have a header row and at least one data row"}],skipped:0};const r=ls(e[0]??""),n=new Map,o=[];r.forEach((u,m)=>{const h=u.toLowerCase().trim();h&&n.set(h,m)});for(const u of Gr)n.has(u)||o.push({line:1,message:`Missing required column: "${u}"`});for(const u of r){const m=u.toLowerCase().trim();m&&!Kr.includes(m)&&o.push({line:1,message:`Unknown column "${u}" will be ignored`})}if(!n.has("id")||!n.has("title"))return{items:[],warnings:o,skipped:0};const i=(u,m)=>{const h=n.get(m);return typeof h=="number"?u[h]??"":""},a=[],l=new Set;let d=0;for(let u=1;u<e.length;u+=1){const m=ls(e[u]??""),h=i(m,"id").trim(),x=i(m,"title").trim();if(!h){o.push({line:u+1,message:"Missing id — row skipped"}),d+=1;continue}if(!x){o.push({line:u+1,message:`Missing title for id="${h}" — row skipped`}),d+=1;continue}if(l.has(h)){o.push({line:u+1,message:`Duplicate id="${h}" — row skipped`}),d+=1;continue}l.add(h);const f=i(m,"description").trim(),c=i(m,"remote_url").trim(),j=i(m,"remote_type").trim().toLowerCase()==="sse"?"sse":"http",y=is(i(m,"tags")),N=is(i(m,"categories")),w=i(m,"is_public").trim().toLowerCase(),v=w==="true"||w==="1"||w==="yes";a.push({id:h,title:x,description:f||null,is_public:v,_meta:{"mcp.mesh":{...y.length>0?{tags:y}:{},...N.length>0?{categories:N}:{}}},server:{name:h,title:x,description:f||void 0,remotes:c?[{type:j,url:c}]:[]}})}return{items:a,warnings:o,skipped:d}}const Hr=`id,title,description,remote_url,remote_type,tags,categories,is_public
|
|
24
|
+
my-mcp-server,My MCP Server,A useful MCP server,https://example.com/mcp,http,ai|tools,productivity,true
|
|
25
|
+
another-server,Another Server,Another useful server,https://example2.com/mcp,http,data|analytics,data-processing,false`;function Wr(){const s=new Blob([Hr],{type:"text/csv;charset=utf-8"}),e=URL.createObjectURL(s),r=document.createElement("a");r.href=e,r.download="registry-import-template.csv",r.click(),URL.revokeObjectURL(e)}function Jr(s){const e=Y.c(63),{open:r,onOpenChange:n,isImporting:o,onImport:i}=s,a=o===void 0?!1:o,[l,d]=M.useState(null),[u,m]=M.useState(null),[h,x]=M.useState(null),f=M.useRef(null);let c;e[0]!==n?(c=H=>{n(H),H||(d(null),m(null),x(null),f.current&&(f.current.value=""))},e[0]=n,e[1]=c):c=e[1];const p=c;let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=async H=>{if(!H)return;x(H.name),m(null);const de=await H.text();d(Yr(de))},e[2]=j):j=e[2];const y=j;let N;e[3]!==i||e[4]!==l?(N=async()=>{if(!l?.items.length)return;const H=await i(l.items);m(H)},e[3]=i,e[4]=l,e[5]=N):N=e[5];const w=N;let v;e[6]!==l?.items?(v=l?.items??[],e[6]=l?.items,e[7]=v):v=e[7];const I=v;let S;e[8]!==l?.warnings?(S=l?.warnings??[],e[8]=l?.warnings,e[9]=S):S=e[9];const _=S;let C;e[10]!==_?(C=_.some(tn),e[10]=_,e[11]=C):C=e[11];const T=C,R=u!==null;let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsxs(ht,{children:[t.jsx(pt,{children:"Import MCP Servers from CSV"}),t.jsx(ft,{children:"Upload a CSV file to bulk-import MCP servers into the registry."})]}),e[12]=E):E=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=()=>f.current?.click(),e[13]=b):b=e[13];let D;e[14]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(ss,{size:14}),e[14]=D):D=e[14];const $=h?"Change file":"Choose CSV file";let P;e[15]!==a||e[16]!==$?(P=t.jsxs(G,{variant:"outline",size:"sm",className:"gap-1.5",onClick:b,disabled:a,children:[D,$]}),e[15]=a,e[16]=$,e[17]=P):P=e[17];let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("input",{ref:f,type:"file",accept:".csv,text/csv",className:"hidden",onChange:H=>y(H.target.files?.[0]??null)}),e[18]=A):A=e[18];let q;e[19]!==h?(q=h&&t.jsx("span",{className:"text-sm text-muted-foreground truncate",children:h}),e[19]=h,e[20]=q):q=e[20];let U;e[21]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx("div",{className:"flex-1"}),e[21]=U):U=e[21];let K;e[22]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsxs(G,{variant:"ghost",size:"sm",className:"gap-1.5 text-xs text-muted-foreground",onClick:Wr,children:[t.jsx(lr,{size:14}),"Download template"]}),e[22]=K):K=e[22];let g;e[23]!==P||e[24]!==q?(g=t.jsxs("div",{className:"flex items-center gap-3",children:[P,A,q,U,K]}),e[23]=P,e[24]=q,e[25]=g):g=e[25];let O;e[26]!==_?(O=_.length>0&&t.jsx("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 dark:border-yellow-900 dark:bg-yellow-950/30 p-3 grid gap-1",children:_.map(en)}),e[26]=_,e[27]=O):O=e[27];let z;e[28]!==I||e[29]!==l?(z=I.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-medium",children:"Preview"}),t.jsxs(F,{variant:"secondary",children:[I.length," items"]}),l?.skipped?t.jsxs(F,{variant:"outline",className:"text-yellow-600",children:[l.skipped," skipped"]}):null]}),t.jsx("div",{className:"border rounded-lg overflow-hidden",children:t.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:t.jsxs(Dt,{children:[t.jsx(Et,{children:t.jsxs(Be,{children:[t.jsx(oe,{className:"w-[140px]",children:"ID"}),t.jsx(oe,{children:"Title"}),t.jsx(oe,{children:"Remote URL"}),t.jsx(oe,{className:"w-[80px] text-center",children:"Public"}),t.jsx(oe,{children:"Tags"})]})}),t.jsx(At,{children:I.map(Xr)})]})})})]}),e[28]=I,e[29]=l,e[30]=z):z=e[30];let te;e[31]!==u?(te=u&&t.jsxs("div",{className:"rounded-lg border p-3 grid gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[t.jsx(Fe,{size:16,className:"text-emerald-600"}),"Imported ",u.created," item(s) successfully"]}),u.errors.length>0&&t.jsx("div",{className:"grid gap-1 mt-1",children:u.errors.map(Zr)})]}),e[31]=u,e[32]=te):te=e[32];let ee;e[33]!==R||e[34]!==l?(ee=!l&&!R&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[t.jsx(ss,{size:32,className:"text-muted-foreground/40 mb-3"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose a CSV file or download the template to get started."}),t.jsxs("p",{className:"text-xs text-muted-foreground/70 mt-1",children:["Required columns: ",t.jsx("code",{children:"id"}),", ",t.jsx("code",{children:"title"}),". Optional:"," ",t.jsx("code",{children:"description"}),", ",t.jsx("code",{children:"remote_url"}),","," ",t.jsx("code",{children:"remote_type"}),", ",t.jsx("code",{children:"tags"}),","," ",t.jsx("code",{children:"categories"}),", ",t.jsx("code",{children:"is_public"}),"."]}),t.jsxs("p",{className:"text-xs text-muted-foreground/70 mt-1",children:["Use ",t.jsx("code",{children:"|"})," or ",t.jsx("code",{children:";"})," to separate multiple tags/categories within a cell."]})]}),e[33]=R,e[34]=l,e[35]=ee):ee=e[35];let se;e[36]!==g||e[37]!==O||e[38]!==z||e[39]!==te||e[40]!==ee?(se=t.jsxs("div",{className:"flex-1 overflow-y-auto grid gap-4 pr-1",children:[g,O,z,te,ee]}),e[36]=g,e[37]=O,e[38]=z,e[39]=te,e[40]=ee,e[41]=se):se=e[41];let re;e[42]!==p?(re=()=>p(!1),e[42]=p,e[43]=re):re=e[43];const me=R?"Done":"Cancel";let he;e[44]!==re||e[45]!==me?(he=t.jsx(G,{variant:"outline",onClick:re,children:me}),e[44]=re,e[45]=me,e[46]=he):he=e[46];let pe;e[47]!==w||e[48]!==T||e[49]!==R||e[50]!==a||e[51]!==I.length?(pe=!R&&t.jsx(G,{onClick:w,disabled:a||I.length===0||T,children:a?"Importing...":`Import ${I.length} item(s)`}),e[47]=w,e[48]=T,e[49]=R,e[50]=a,e[51]=I.length,e[52]=pe):pe=e[52];let je;e[53]!==he||e[54]!==pe?(je=t.jsxs(gt,{className:"gap-2 sm:gap-0",children:[he,pe]}),e[53]=he,e[54]=pe,e[55]=je):je=e[55];let k;e[56]!==se||e[57]!==je?(k=t.jsxs(jt,{className:"sm:max-w-3xl max-h-[85vh] flex flex-col",children:[E,se,je]}),e[56]=se,e[57]=je,e[58]=k):k=e[58];let W;return e[59]!==p||e[60]!==r||e[61]!==k?(W=t.jsx(vt,{open:r,onOpenChange:p,children:k}),e[59]=p,e[60]=r,e[61]=k,e[62]=W):W=e[62],W}function Zr(s){return t.jsxs("p",{className:"text-xs text-destructive flex items-start gap-1.5",children:[t.jsx(Ye,{size:12,className:"shrink-0 mt-0.5"}),t.jsxs("span",{children:[t.jsx("span",{className:"font-mono",children:s.id}),": ",s.error]})]},s.id)}function Xr(s){return t.jsxs(Be,{children:[t.jsx(ce,{className:"font-mono text-xs",children:s.id}),t.jsx(ce,{className:"text-sm",children:s.title}),t.jsx(ce,{className:"text-xs text-muted-foreground max-w-[200px] truncate",children:s.server.remotes?.[0]?.url??t.jsx("span",{className:"italic",children:"none"})}),t.jsx(ce,{className:"text-center",children:s.is_public?t.jsx(F,{variant:"secondary",className:"text-[10px] bg-emerald-100 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-400",children:"Yes"}):t.jsx("span",{className:"text-xs text-muted-foreground",children:"No"})}),t.jsx(ce,{className:"text-xs text-muted-foreground",children:(s._meta?.["mcp.mesh"]?.tags??[]).join(", ")||"-"})]},s.id)}function en(s,e){return t.jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-400 flex items-start gap-1.5",children:[t.jsx(Ye,{size:12,className:"shrink-0 mt-0.5"}),t.jsxs("span",{children:[s.line>0&&t.jsxs("span",{className:"font-mono text-[10px] mr-1",children:["Line ",s.line,":"]}),s.message]})]},`${s.line}-${e}`)}function tn(s){return s.message.startsWith("Missing required column:")}function sn(s){const e=Y.c(19),{open:r,onOpenChange:n,title:o,isDeleting:i,onConfirm:a}=s,l=i===void 0?!1:i;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(He,{children:"Delete registry item?"}),e[0]=d):d=e[0];let u;e[1]!==o?(u=t.jsxs(We,{children:[d,t.jsxs(Je,{children:["This action cannot be undone. Item ",t.jsx("strong",{children:o})," will be permanently removed from this private registry."]})]}),e[1]=o,e[2]=u):u=e[2];let m;e[3]!==l?(m=t.jsx(Ze,{disabled:l,children:"Cancel"}),e[3]=l,e[4]=m):m=e[4];const h=l?"Deleting...":"Delete";let x;e[5]!==l||e[6]!==a||e[7]!==h?(x=t.jsx(Xe,{disabled:l,onClick:a,children:h}),e[5]=l,e[6]=a,e[7]=h,e[8]=x):x=e[8];let f;e[9]!==m||e[10]!==x?(f=t.jsxs(et,{children:[m,x]}),e[9]=m,e[10]=x,e[11]=f):f=e[11];let c;e[12]!==u||e[13]!==f?(c=t.jsxs(tt,{children:[u,f]}),e[12]=u,e[13]=f,e[14]=c):c=e[14];let p;return e[15]!==n||e[16]!==r||e[17]!==c?(p=t.jsx(st,{open:r,onOpenChange:n,children:c}),e[15]=n,e[16]=r,e[17]=c,e[18]=p):p=e[18],p}function rn(s){const[e]=s.id.split("/");return e??"provider"}function nn(s){return s._meta?.["mcp.mesh"]?.tags??[]}function ln(s){return s._meta?.["mcp.mesh"]?.categories??[]}function an(s){return s.server?.icons?.[0]?.src??null}function on(s){const e=Y.c(77),{item:r,onEdit:n,onDelete:o,onToggleVerified:i,onToggleOfficial:a}=s;let l;e[0]!==r?(l=an(r),e[0]=r,e[1]=l):l=e[1];const d=l,u=r._meta?.["mcp.mesh"]?.verified===!0,m=r._meta?.["mcp.mesh"]?.official===!0;let h;e[2]!==r?(h=[...nn(r),...ln(r)],e[2]=r,e[3]=h):h=e[3];const x=h;let f;e[4]!==x?(f=x.slice(0,3),e[4]=x,e[5]=f):f=e[5];const c=f,p=Math.max(0,x.length-c.length);let j;e[6]!==d||e[7]!==r.title?(j=t.jsx("div",{className:"size-10 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0 flex items-center justify-center",children:d?t.jsx("img",{src:d,alt:r.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:r.title.charAt(0).toUpperCase()})}),e[6]=d,e[7]=r.title,e[8]=j):j=e[8];let y;e[9]!==r.title?(y=t.jsx("p",{className:"font-medium truncate",children:r.title}),e[9]=r.title,e[10]=y):y=e[10];let N;e[11]!==r?(N=rn(r),e[11]=r,e[12]=N):N=e[12];let w;e[13]!==N?(w=t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:N}),e[13]=N,e[14]=w):w=e[14];let v;e[15]!==r.is_public?(v=r.is_public?t.jsxs(F,{variant:"default",className:"gap-1",children:[t.jsx(xs,{size:10}),"Public"]}):t.jsx(F,{variant:"secondary",children:"Private"}),e[15]=r.is_public,e[16]=v):v=e[16];let I;e[17]!==m?(I=m&&t.jsxs(F,{variant:"outline",className:"gap-1 text-primary",children:[t.jsx(Zt,{size:10}),"Official"]}),e[17]=m,e[18]=I):I=e[18];let S;e[19]!==m||e[20]!==u?(S=!m&&u&&t.jsxs(F,{variant:"outline",className:"gap-1 text-success",children:[t.jsx(Zt,{size:10}),"Verified"]}),e[19]=m,e[20]=u,e[21]=S):S=e[21];let _;e[22]!==S||e[23]!==w||e[24]!==v||e[25]!==I?(_=t.jsxs("div",{className:"flex items-center gap-2",children:[w,v,I,S]}),e[22]=S,e[23]=w,e[24]=v,e[25]=I,e[26]=_):_=e[26];let C;e[27]!==_||e[28]!==y?(C=t.jsxs("div",{className:"min-w-0 flex-1",children:[y,_]}),e[27]=_,e[28]=y,e[29]=C):C=e[29];let T;e[30]!==C||e[31]!==j?(T=t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[j,C]}),e[30]=C,e[31]=j,e[32]=T):T=e[32];let R;e[33]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(ut,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:t.jsx($t,{size:18})})}),e[33]=R):R=e[33];let E;e[34]!==r||e[35]!==n?(E=t.jsx(we,{onClick:()=>n(r),children:"Edit"}),e[34]=r,e[35]=n,e[36]=E):E=e[36];let b;e[37]!==r||e[38]!==i?(b=()=>i(r),e[37]=r,e[38]=i,e[39]=b):b=e[39];const D=u?"Unmark as Verified":"Mark as Verified";let $;e[40]!==b||e[41]!==D?($=t.jsx(we,{onClick:b,children:D}),e[40]=b,e[41]=D,e[42]=$):$=e[42];let P;e[43]!==r||e[44]!==a?(P=()=>a(r),e[43]=r,e[44]=a,e[45]=P):P=e[45];const A=m?"Unmark as Official":"Mark as Official";let q;e[46]!==P||e[47]!==A?(q=t.jsx(we,{onClick:P,children:A}),e[46]=P,e[47]=A,e[48]=q):q=e[48];let U;e[49]!==r||e[50]!==o?(U=()=>o(r),e[49]=r,e[50]=o,e[51]=U):U=e[51];let K;e[52]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx(rt,{size:14}),e[52]=K):K=e[52];let g;e[53]!==U?(g=t.jsxs(we,{variant:"destructive",onClick:U,children:[K,"Delete"]}),e[53]=U,e[54]=g):g=e[54];let O;e[55]!==E||e[56]!==$||e[57]!==q||e[58]!==g?(O=t.jsxs(mt,{children:[R,t.jsxs(xt,{align:"end",children:[E,$,q,g]})]}),e[55]=E,e[56]=$,e[57]=q,e[58]=g,e[59]=O):O=e[59];let z;e[60]!==T||e[61]!==O?(z=t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[T,O]}),e[60]=T,e[61]=O,e[62]=z):z=e[62];const te=r._meta?.["mcp.mesh"]?.short_description||r.description||r.server.description||"No description provided.";let ee;e[63]!==te?(ee=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 min-h-10",children:te}),e[63]=te,e[64]=ee):ee=e[64];let se;e[65]!==r.id||e[66]!==c?(se=c.map(pe=>t.jsx(F,{variant:"secondary",children:pe},`${r.id}-badge-${pe}`)),e[65]=r.id,e[66]=c,e[67]=se):se=e[67];let re;e[68]!==p?(re=p>0&&t.jsxs(F,{variant:"outline",children:["+",p]}),e[68]=p,e[69]=re):re=e[69];let me;e[70]!==se||e[71]!==re?(me=t.jsxs("div",{className:"flex flex-wrap gap-1",children:[se,re]}),e[70]=se,e[71]=re,e[72]=me):me=e[72];let he;return e[73]!==z||e[74]!==ee||e[75]!==me?(he=t.jsxs(ne,{className:"p-4 gap-4 transition-colors hover:bg-muted/50",children:[z,ee,me]}),e[73]=z,e[74]=ee,e[75]=me,e[76]=he):he=e[76],he}function bs(s){const e=Y.c(28),{value:r,onChange:n,onBlur:o,onFileUpload:i,error:a,isUploading:l}=s,d=l===void 0?!1:l,[u,m]=M.useState(!1),[h,x]=M.useState(!1),f=M.useRef(null);let c;e[0]!==d?(c=b=>{b.preventDefault(),d||m(!0)},e[0]=d,e[1]=c):c=e[1];const p=c;let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=b=>{b.preventDefault(),m(!1)},e[2]=j):j=e[2];const y=j;let N;e[3]!==d||e[4]!==i?(N=async b=>{if(b.preventDefault(),m(!1),d)return;const D=b.dataTransfer.files[0];D&&await i(D)},e[3]=d,e[4]=i,e[5]=N):N=e[5];const w=N;let v;e[6]!==d||e[7]!==i?(v=async b=>{const D=b.target.files?.[0];D&&!d&&await i(D),b.target.value=""},e[6]=d,e[7]=i,e[8]=v):v=e[8];const I=v,S=r.length>0;let _;e[9]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(X,{children:"Image"}),e[9]=_):_=e[9];let C;e[10]!==p||e[11]!==w||e[12]!==S||e[13]!==u||e[14]!==d||e[15]!==o||e[16]!==n||e[17]!==h||e[18]!==r?(C=S?t.jsx("div",{className:"relative group min-h-[180px] rounded-xl border border-border overflow-hidden bg-muted/10",children:t.jsxs("div",{className:"flex items-center gap-3 p-3 h-full",children:[t.jsx("div",{className:"size-20 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0",children:t.jsx("img",{src:r,alt:"Preview",className:"w-full h-full object-cover"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:r}),t.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[t.jsxs(G,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>f.current?.click(),disabled:d,children:[t.jsx(Ot,{className:"size-3"}),"Change"]}),t.jsxs(G,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 text-destructive hover:text-destructive",onClick:()=>{n(""),x(!1)},disabled:d,children:[t.jsx(rt,{className:"size-3"}),"Remove"]})]})]})]})}):d?t.jsxs("div",{className:"relative min-h-[180px] rounded-xl border border-border bg-muted/10 flex flex-col items-center justify-center gap-3",children:[t.jsx(Le,{className:"size-8 animate-spin text-muted-foreground"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Uploading image..."})]}):t.jsxs("div",{className:Z("relative min-h-[180px] rounded-xl border-2 border-dashed transition-colors cursor-pointer flex flex-col",u?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/40 hover:bg-muted/30"),onDragOver:p,onDragLeave:y,onDrop:w,onClick:()=>f.current?.click(),children:[t.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-6 px-4 flex-1",children:[t.jsx("div",{className:Z("size-10 rounded-lg flex items-center justify-center transition-colors",u?"bg-primary/10 text-primary":"bg-muted/50 text-muted-foreground"),children:t.jsx(mr,{size:20})}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:u?"Drop image here":"Click or drag to upload"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"PNG, JPG, SVG up to 2MB"})]})]}),h?t.jsx("div",{className:"border-t border-border px-3 py-2",onClick:cn,children:t.jsx(le,{placeholder:"https://example.com/logo.png",value:r,className:"text-xs h-8",onChange:b=>n(b.target.value),onBlur:o})}):t.jsx("div",{className:"border-t border-border px-4 py-2",children:t.jsxs("button",{type:"button",className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors w-full justify-center",onClick:b=>{b.stopPropagation(),x(!0)},children:[t.jsx(Ks,{className:"size-3"}),"Or paste an image URL"]})})]}),e[10]=p,e[11]=w,e[12]=S,e[13]=u,e[14]=d,e[15]=o,e[16]=n,e[17]=h,e[18]=r,e[19]=C):C=e[19];let T;e[20]!==I?(T=t.jsx("input",{ref:f,type:"file",accept:"image/*",className:"hidden",onChange:I}),e[20]=I,e[21]=T):T=e[21];let R;e[22]!==a?(R=a&&t.jsx("p",{className:"text-xs text-destructive",children:a}),e[22]=a,e[23]=R):R=e[23];let E;return e[24]!==C||e[25]!==T||e[26]!==R?(E=t.jsxs("div",{className:"grid gap-1.5",children:[_,C,T,R]}),e[24]=C,e[25]=T,e[26]=R,e[27]=E):E=e[27],E}function cn(s){return s.stopPropagation()}function ys(){const[s,e]=M.useState("idle"),[r,n]=M.useState(null),o=Se();return{discover:async(l,d)=>{if(!l)return null;e("loading"),n(null);try{const u=await o.call("REGISTRY_DISCOVER_TOOLS",{url:l,type:d==="sse"?"sse":"http"});return u.error?dn(u.error)?(n(u.error),e("auth_required"),null):(n(u.error),e("error"),null):!u.tools||u.tools.length===0?(n("No tools found on this MCP server."),e("error"),null):(e("success"),u.tools)}catch(u){const m=u instanceof Error?u.message:String(u);return n(m||"Could not discover tools."),e("error"),null}},discoverStatus:s,discoverError:r,resetDiscover:()=>{e("idle"),n(null)}}}function dn(s){const e=s.toLowerCase();return e.includes("authentication")||e.includes("unauthorized")||e.includes("credentials")}function un(s){const e=Y.c(54),{tools:r,onChange:n,remoteUrl:o,remoteType:i,externalDiscoverStatus:a,externalDiscoverError:l}=s,[d,u]=M.useState(r.length>0),{discover:m,discoverStatus:h,discoverError:x,resetDiscover:f}=ys(),c=a??h,p=l??x;let j;e[0]!==m||e[1]!==n||e[2]!==i||e[3]!==o?(j=async()=>{if(!o)return;const K=await m(o,i??"http");K&&(n(K),u(!0))},e[0]=m,e[1]=n,e[2]=i,e[3]=o,e[4]=j):j=e[4];const y=j;let N;e[5]!==n||e[6]!==f?(N=()=>{n([]),f()},e[5]=n,e[6]=f,e[7]=N):N=e[7];const w=N;let v;e[8]!==d?(v=()=>u(!d),e[8]=d,e[9]=v):v=e[9];let I,S;e[10]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(us,{size:14,className:"text-muted-foreground"}),S=t.jsx("span",{children:"Tools"}),e[10]=I,e[11]=S):(I=e[10],S=e[11]);let _;e[12]!==r.length?(_=r.length>0&&t.jsx(F,{variant:"secondary",className:"text-xs px-1.5 py-0",children:r.length}),e[12]=r.length,e[13]=_):_=e[13];let C;e[14]!==d?(C=d?t.jsx(gr,{size:14,className:"text-muted-foreground"}):t.jsx(fr,{size:14,className:"text-muted-foreground"}),e[14]=d,e[15]=C):C=e[15];let T;e[16]!==v||e[17]!==_||e[18]!==C?(T=t.jsxs("button",{type:"button",className:"flex items-center gap-2 text-sm font-medium cursor-pointer",onClick:v,children:[I,S,_,C]}),e[16]=v,e[17]=_,e[18]=C,e[19]=T):T=e[19];let R;e[20]!==w||e[21]!==r.length?(R=r.length>0&&t.jsxs(G,{type:"button",variant:"ghost",size:"sm",className:"h-7 text-xs gap-1.5 text-muted-foreground",onClick:w,children:[t.jsx(rt,{size:12}),"Clear"]}),e[20]=w,e[21]=r.length,e[22]=R):R=e[22];let E;e[23]!==c||e[24]!==y||e[25]!==o||e[26]!==r.length?(E=o&&t.jsxs(G,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 border-green-500/30 text-green-600 dark:text-green-400 shadow-[0_0_8px_rgba(34,197,94,0.3)] hover:shadow-[0_0_14px_rgba(34,197,94,0.5)] hover:border-green-500/50 transition-all",onClick:y,disabled:c==="loading",children:[c==="loading"?t.jsx(Le,{size:12,className:"animate-spin"}):t.jsx(Ot,{size:12}),c==="loading"?"Discovering...":r.length>0?"Refresh":"Auto-discover"]}),e[23]=c,e[24]=y,e[25]=o,e[26]=r.length,e[27]=E):E=e[27];let b;e[28]!==E||e[29]!==R?(b=t.jsxs("div",{className:"flex items-center gap-2",children:[R,E]}),e[28]=E,e[29]=R,e[30]=b):b=e[30];let D;e[31]!==b||e[32]!==T?(D=t.jsxs("div",{className:"flex items-center justify-between",children:[T,b]}),e[31]=b,e[32]=T,e[33]=D):D=e[33];let $;e[34]!==c||e[35]!==r.length?($=c==="success"&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-green-600 dark:text-green-400 bg-green-50 dark:bg-green-950/30 rounded-lg px-3 py-2",children:[t.jsx(Fe,{size:14,className:"shrink-0"}),t.jsxs("span",{children:["Discovered ",r.length," tool",r.length!==1?"s":""," ","successfully."]})]}),e[34]=c,e[35]=r.length,e[36]=$):$=e[36];let P;e[37]!==p||e[38]!==c?(P=c==="error"&&p&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-destructive bg-destructive/10 rounded-lg px-3 py-2",children:[t.jsx(Ye,{size:14,className:"shrink-0"}),t.jsx("span",{children:p})]}),e[37]=p,e[38]=c,e[39]=P):P=e[39];let A;e[40]!==d||e[41]!==r?(A=d&&r.length>0&&t.jsx("div",{className:"rounded-xl border border-border divide-y divide-border overflow-hidden max-h-48 overflow-y-auto",children:r.map(mn)}),e[40]=d,e[41]=r,e[42]=A):A=e[42];let q;e[43]!==c||e[44]!==d||e[45]!==o||e[46]!==r.length?(q=d&&r.length===0&&c==="idle"&&t.jsx("p",{className:"text-xs text-muted-foreground px-1",children:o?'Click "Auto-discover" to load tools from the MCP server.':"Add a Remote URL first, then tools can be auto-discovered."}),e[43]=c,e[44]=d,e[45]=o,e[46]=r.length,e[47]=q):q=e[47];let U;return e[48]!==D||e[49]!==$||e[50]!==P||e[51]!==A||e[52]!==q?(U=t.jsxs("div",{className:"space-y-3",children:[D,$,P,A,q]}),e[48]=D,e[49]=$,e[50]=P,e[51]=A,e[52]=q,e[53]=U):U=e[53],U}function mn(s){return t.jsx("div",{className:"flex items-center gap-3 px-3 py-2",children:t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-mono truncate",children:s.name}),s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description})]})},s.name)}function Ns(s){const{org:e}=xe(),[r,n]=M.useState(!1),i=typeof window<"u"&&window.location.hostname==="localhost"?`${e.id}_dev-assets`:null,a=Ce({connectionId:i??"noop",orgId:e.id,orgSlug:e.slug});return{uploadImage:async(d,u)=>{if(!i)return V.error("Image upload requires an object-storage connection. Configure one in plugin settings."),null;if(!d.type.startsWith("image/"))return V.error("Only image files are supported"),null;if(d.size>5*1024*1024)return V.error("Image size must be less than 5MB"),null;n(!0);try{const m=await a.callTool({name:"PUT_PRESIGNED_URL",arguments:{key:u,contentType:d.type}}),h=m.structuredContent?.url||m.url;if(!h)throw new Error("Failed to get presigned URL");const x=await fetch(h,{method:"PUT",body:d,headers:{"Content-Type":d.type}});if(!x.ok)throw new Error(`Upload failed: ${x.statusText}`);const f=await a.callTool({name:"GET_PRESIGNED_URL",arguments:{key:u,expiresIn:31536e3}}),c=f.structuredContent?.url||f.url;if(!c)throw new Error("Failed to get public URL");return c}catch(m){return console.error("Image upload failed:",m),V.error(m instanceof Error?m.message:"Failed to upload image. Please try again."),null}finally{n(!1)}},isUploading:r}}const xn=new Set(["http","sse","stdio"]),hn=/^[a-z0-9]+(?:[/-][a-z0-9._-]+)*$/,pn=["internal","automation","support","sales","ops","ai"],fn=["productivity","communication","customer-support","development","data","operations"],gn=["Essentials","Details","Advanced"],jn="h-7 text-xs border-green-500/30 text-green-600 dark:text-green-400 shadow-[0_0_8px_rgba(34,197,94,0.3)] hover:shadow-[0_0_14px_rgba(34,197,94,0.5)] hover:border-green-500/50 transition-all";function as(s){return s.replace(/^https?:\/\//i,"").trim()}function Ke(s){const e=s.trim();return e?/^https?:\/\//i.test(e)?e:`https://${e}`:""}function qe(s){return s.trim().toLowerCase()}function yt(s){return Array.from(new Set(s.map(qe).filter(e=>e.length>0)))}function $e(s){return s.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9._-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function vn(s){const e=Y.c(4),{current:r}=s;let n;e[0]!==r?(n=gn.map((i,a)=>{const l=a+1,d=l===r,u=l<r;return t.jsxs("div",{className:"flex items-center gap-1.5",children:[a>0&&t.jsx("div",{className:Z("w-4 h-px",u?"bg-primary":"bg-border")}),t.jsxs("div",{className:Z("flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs transition-colors",d?"bg-primary/10 text-primary font-medium":u?"text-primary":"text-muted-foreground"),children:[t.jsx("span",{className:Z("size-5 rounded-full inline-flex items-center justify-center text-[10px] font-semibold shrink-0",d?"bg-primary text-primary-foreground":u?"bg-primary/20 text-primary":"bg-muted text-muted-foreground"),children:l}),t.jsx("span",{className:"hidden sm:inline",children:i})]})]},i)}),e[0]=r,e[1]=n):n=e[1];let o;return e[2]!==n?(o=t.jsx("div",{className:"flex items-center gap-1.5",children:n}),e[2]=n,e[3]=o):o=e[3],o}function bn(s){const e=Y.c(28),{id:r,label:n,values:o,availableOptions:i,placeholder:a,onChange:l}=s,[d,u]=M.useState(""),[m,h]=M.useState(!1);let x,f,c,p,j;if(e[0]!==i||e[1]!==r||e[2]!==d||e[3]!==m||e[4]!==n||e[5]!==l||e[6]!==a||e[7]!==o){const w=yt(i),v=yt(o),I=new Set(v),S=qe(d),_=w.filter(P=>!I.has(P)).filter(P=>S?P.includes(S):!0).slice(0,8),C=P=>{const A=qe(P);!A||I.has(A)||l([...v,A])},T=P=>{l(v.filter(A=>A!==P))},R=()=>{const P=d.split(/[,\n;]/).map(qe).filter(Boolean);if(P.length===0)return;const A=[...v];for(const q of P)A.includes(q)||A.push(q);l(A),u("")},E=S;p="grid gap-2",e[13]!==r||e[14]!==n?(j=t.jsx(X,{htmlFor:r,children:n}),e[13]=r,e[14]=n,e[15]=j):j=e[15],x="relative";let b;e[16]!==r?(b=()=>{const P=document.getElementById(r);P instanceof HTMLInputElement&&P.focus()},e[16]=r,e[17]=b):b=e[17];let D;e[18]===Symbol.for("react.memo_cache_sentinel")?(D=()=>h(!0),e[18]=D):D=e[18];let $;e[19]===Symbol.for("react.memo_cache_sentinel")?($=P=>u(P.target.value),e[19]=$):$=e[19],f=t.jsx("div",{className:"min-h-9 w-full rounded-xl border border-input bg-background px-2.5 py-1.5 text-sm focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",onClick:b,children:t.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[v.map(P=>t.jsxs(F,{variant:"secondary",className:"gap-1",children:[P,t.jsx("button",{type:"button",onClick:A=>{A.preventDefault(),A.stopPropagation(),T(P)},children:t.jsx(pr,{size:12})})]},`${r}-${P}`)),t.jsx("input",{id:r,className:"flex-1 min-w-[120px] bg-transparent outline-none border-none text-sm",placeholder:v.length?"":a,value:d,onFocus:D,onBlur:()=>{h(!1),R()},onChange:$,onKeyDown:P=>{if(P.key==="Enter"||P.key===","){P.preventDefault(),R();return}P.key==="Backspace"&&!d&&v.length&&T(v[v.length-1]??"")}})]})}),c=m&&t.jsx("div",{className:"absolute z-50 mt-1 w-full rounded-xl border border-border bg-background shadow-lg max-h-56 overflow-y-auto",children:_.length>0?_.map(P=>t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:Nn,onClick:()=>{C(P),u("")},children:P},`${r}-suggestion-${P}`)):E?t.jsxs("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:yn,onClick:()=>{C(E),u("")},children:['Create "',E,'"']}):t.jsx("div",{className:"px-2.5 py-1.5 text-sm text-muted-foreground",children:"Type to search or create."})}),e[0]=i,e[1]=r,e[2]=d,e[3]=m,e[4]=n,e[5]=l,e[6]=a,e[7]=o,e[8]=x,e[9]=f,e[10]=c,e[11]=p,e[12]=j}else x=e[8],f=e[9],c=e[10],p=e[11],j=e[12];let y;e[20]!==x||e[21]!==f||e[22]!==c?(y=t.jsxs("div",{className:x,children:[f,c]}),e[20]=x,e[21]=f,e[22]=c,e[23]=y):y=e[23];let N;return e[24]!==p||e[25]!==j||e[26]!==y?(N=t.jsxs("div",{className:p,children:[j,y]}),e[24]=p,e[25]=j,e[26]=y,e[27]=N):N=e[27],N}function yn(s){return s.preventDefault()}function Nn(s){return s.preventDefault()}function wn({id:s,value:e,availableOptions:r,onChange:n}){const[o,i]=M.useState(e),[a,l]=M.useState(!1),d=M.useRef(e);d.current!==e&&(d.current=e,i(e));const u=yt([...fn,...r,e]).filter(Boolean),m=qe(o),h=u.filter(f=>m?f.includes(m):!0).slice(0,8),x=f=>{const c=qe(f);n(c),i(c),l(!1)};return t.jsxs("div",{className:"grid gap-2",children:[t.jsx(X,{htmlFor:s,children:"Category"}),t.jsxs("div",{className:"relative",children:[t.jsx(le,{id:s,className:"h-9 text-sm",placeholder:"Select or create category",value:o,onFocus:()=>{i(e),l(!0)},onBlur:()=>{x(o)},onChange:f=>i(f.target.value),onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),x(o))}}),e&&t.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-muted-foreground hover:text-foreground",onMouseDown:f=>f.preventDefault(),onClick:()=>{n(""),i("")},children:"clear"}),a&&t.jsx("div",{className:"absolute z-50 mt-1 w-full rounded-xl border border-border bg-background shadow-lg max-h-56 overflow-y-auto",children:h.length>0?h.map(f=>t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:c=>c.preventDefault(),onClick:()=>x(f),children:f},`${s}-${f}`)):m?t.jsxs("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:f=>f.preventDefault(),onClick:()=>x(m),children:['Create "',m,'"']}):t.jsx("div",{className:"px-2.5 py-1.5 text-sm text-muted-foreground",children:"Type to search or create."})})]})]})}function _n({open:s,onOpenChange:e,item:r,draft:n,availableTags:o=[],availableCategories:i=[],isSubmitting:a=!1,onSubmit:l}){const{org:d}=xe(),{uploadImage:u,isUploading:m}=Ns(),{discover:h,discoverStatus:x,discoverError:f,resetDiscover:c}=ys(),p=!!r,j=n?._meta?.["mcp.mesh"],y=r?.title??n?.title??"",N=r?.id?.split("/")[0]??n?.id?.split("/")[0]??"",w=r?.description??n?.description??"",v=r?._meta?.["mcp.mesh"]?.short_description??j?.short_description??"",I=r?._meta?.["mcp.mesh"]?.owner??j?.owner??"",S=r?.server?.repository?.url??n?.server?.repository?.url??"",_=r?._meta?.["mcp.mesh"]?.readme??j?.readme??"",C=r?._meta?.["mcp.mesh"]?.readme_url??j?.readme_url??"",T=as(r?.server?.remotes?.[0]?.url??n?.server?.remotes?.[0]?.url??""),R=r?.server?.remotes?.[0]?.type??n?.server?.remotes?.[0]?.type??"http",E=r?._meta?.["mcp.mesh"]?.tags??j?.tags??[],b=r?._meta?.["mcp.mesh"]?.categories?.[0]??j?.categories?.[0]??"",D=r?.server?.icons?.[0]?.src??n?.server?.icons?.[0]?.src??"",$=r?._meta?.["mcp.mesh"]?.tools??j?.tools??[],P=r?.is_public??n?.is_public??!1,A=r?._meta?.["mcp.mesh"]?.verified??j?.verified??!1,q=r?._meta?.["mcp.mesh"]?.official??j?.official??!1,[U,K]=M.useState(1),[g,O]=M.useState(y),[z,te]=M.useState(N),[ee,se]=M.useState(w),[re,me]=M.useState(v),[he,pe]=M.useState(I),[je,k]=M.useState(S),[W,H]=M.useState(_),[de,ve]=M.useState(C),[ae,it]=M.useState(_?"content":"link"),[De,L]=M.useState(T),[ie,lt]=M.useState(R),[ze,zt]=M.useState(E),[wt,Lt]=M.useState(b),[Qe,_t]=M.useState(D),[ye,at]=M.useState($),[Ft,Bt]=M.useState(P),[Qt,Vt]=M.useState(A),[Gt,Kt]=M.useState(q),[ue,Ve]=M.useState({}),Yt=()=>{K(1),O(y),te(N),se(w),me(v),pe(I),k(S),H(_),ve(C),it(_?"content":"link"),L(T),lt(R),zt(E),Lt(b),_t(D),at($),Bt(P),Vt(A),Kt(q),Ve({}),c(),ot.current="",Me.current&&(clearTimeout(Me.current),Me.current=null)},Ss=async B=>{if(!B)return;const J=p?r?.id:`${z}/${g}`.toLowerCase(),be=$e(J||"temp"),Re=B.name.split(".").pop()||"png",Te=`registry/${d.id}/${be}/icon.${Re}`,Ae=await u(B,Te);Ae?(_t(Ae),Ve(Ie=>({...Ie,imageUrl:void 0}))):Ve(Ie=>({...Ie,imageUrl:"Failed to upload image. Please try again."}))},Me=M.useRef(null),ot=M.useRef(""),Ct=M.useRef(ie);Ct.current=ie;const Ht=B=>{!B&&Me.current&&(clearTimeout(Me.current),Me.current=null),e(B),B||Yt()},Rs=async()=>{const B=Ke(De);if(!B)return;ot.current=B;const J=await h(B,Ct.current);J&&at(J)},Ts=B=>{Me.current&&clearTimeout(Me.current);const J=Ke(B);!J||J===ot.current||B.includes(".")&&(Me.current=setTimeout(async()=>{ot.current=J;const be=await h(J,Ct.current);be&&at(be)},800))},Wt=B=>{const J={};if(B===1){const be=$e(z),Re=$e(g),Te=`${be}/${Re}`;g.trim()||(J.title="Name is required."),p||(be?Re?hn.test(Te)||(J.provider="Use lowercase letters/numbers and separators '/' or '-'."):J.title="Name must contain valid characters.":J.provider="Provider is required.");const Ae=Ke(De),Ie=ie.trim().toLowerCase();if(Ie!=="stdio"&&Ae)try{const Ge=new URL(Ae);["http:","https:"].includes(Ge.protocol)||(J.remoteUrl="Remote URL must be http(s).")}catch{J.remoteUrl="Remote URL is invalid."}if(Ie&&!xn.has(Ie)&&(J.remoteType="Remote type must be: http, sse or stdio."),Qe.trim()&&!Qe.trim().startsWith("data:image/"))try{const kt=new URL(Qe.trim());["http:","https:"].includes(kt.protocol)||(J.imageUrl="Image URL must be http(s).")}catch{J.imageUrl="Image URL is invalid."}}if(B===2&&(ee.length>1500&&(J.description="Description must be 1500 characters or less."),re.trim().length>160&&(J.shortDescription="Short description must be 160 characters or less.")),B===3){const be=de.trim();if(be)try{const Te=new URL(be);["http:","https:"].includes(Te.protocol)||(J.readmeUrl="README URL must be http(s).")}catch{J.readmeUrl="README URL is invalid."}W.trim().length>5e4&&(J.readme="README must be 50 000 characters or less.");const Re=je.trim();if(Re)try{const Te=new URL(Re);["http:","https:"].includes(Te.protocol)||(J.repositoryUrl="Repository URL must be http(s).")}catch{J.repositoryUrl="Repository URL is invalid."}}return Ve(J),Object.values(J).every(be=>be===void 0)},Is=()=>{Wt(U)&&U<3&&K(U+1)},Ps=()=>{U>1&&K(U-1)},Ms=async()=>{if(!Wt(3))return;const B=g.trim(),J=$e(z),be=$e(B),Re=`${J}/${be}`,Te=Ke(De),Ae=ie.trim().toLowerCase(),Ie=Qe.trim(),Ge=je.trim(),kt=re.trim(),$s=W.trim(),Os=de.trim(),Us=yt(ze),qs=wt?[qe(wt)]:[],zs=r?r.server?.name??r.id:"",Ls=(p?zs:Re).trim(),St=ee.trim(),Fs=he.trim(),Jt={title:B,description:St.length>0?St:null,is_public:Ft,_meta:{"mcp.mesh":{verified:Qt,official:Gt,tags:Us,categories:qs,short_description:kt||null,owner:Fs||null,readme:$s||null,readme_url:Os||null,...ye.length>0?{tools:ye}:{}}},server:{name:Ls,title:B,description:St||void 0,icons:Ie?[{src:Ie}]:[],repository:Ge?{url:Ge}:void 0,remotes:Te?[{type:Ae||"http",url:Te}]:[]}};if(p&&r){await l({id:r.id,data:Jt}),e(!1);return}await l({id:Re,...Jt}),e(!1),Yt()},Ds=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"row-span-2 grid gap-3 content-start",children:[t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{htmlFor:"registry-item-provider",children:"Provider"}),t.jsx(le,{id:"registry-item-provider",className:"h-9 text-sm",placeholder:"acme",value:z,onChange:B=>te(B.target.value),disabled:p}),!p&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Item ID:"," ",t.jsx("span",{className:"font-mono",children:`${$e(z)||"provider"}/${$e(g)||"name"}`})]}),ue.provider&&t.jsx("p",{className:"text-xs text-destructive",children:ue.provider})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{htmlFor:"registry-item-title",children:"Name"}),t.jsx(le,{id:"registry-item-title",className:"h-9 text-sm",placeholder:"Internal MCP",value:g,onChange:B=>O(B.target.value)}),ue.title&&t.jsx("p",{className:"text-xs text-destructive",children:ue.title})]})]}),t.jsx("div",{className:"row-span-2 content-start",children:t.jsx(bs,{value:Qe,onChange:B=>{_t(B),Ve(J=>({...J,imageUrl:void 0}))},onFileUpload:Ss,error:ue.imageUrl,isUploading:m})}),t.jsxs("div",{className:"col-span-2 grid gap-1.5",children:[t.jsx(X,{htmlFor:"registry-remote-url",children:"Remote URL"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"flex-1 flex items-center rounded-xl border border-input px-3",children:[t.jsx("span",{className:"text-xs font-semibold text-muted-foreground mr-1",children:"https://"}),t.jsx("input",{id:"registry-remote-url",className:"flex-1 h-9 bg-transparent outline-none text-sm",placeholder:"example.com/mcp",value:De,onChange:B=>{const J=as(B.target.value);L(J),Ts(J)}})]}),t.jsxs(or,{value:ie,onValueChange:lt,children:[t.jsx(cr,{id:"registry-remote-type",className:"w-[90px] h-9 shrink-0",children:t.jsx(dr,{placeholder:"Type"})}),t.jsxs(ur,{children:[t.jsx(Rt,{value:"http",children:"http"}),t.jsx(Rt,{value:"sse",children:"sse"}),t.jsx(Rt,{value:"stdio",children:"stdio"})]})]})]}),ue.remoteUrl&&t.jsx("p",{className:"text-xs text-destructive",children:ue.remoteUrl}),ue.remoteType&&t.jsx("p",{className:"text-xs text-destructive",children:ue.remoteType})]}),De.trim()&&t.jsxs("div",{className:"col-span-2 space-y-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(G,{type:"button",variant:"outline",size:"sm",className:Z(jn,"gap-1.5"),onClick:Rs,disabled:x==="loading",children:[x==="loading"?t.jsx(Le,{size:12,className:"animate-spin"}):t.jsx(Ot,{size:12}),x==="loading"?"Discovering tools...":ye.length>0?"Re-discover tools":"Discover tools from URL"]}),ye.length>0&&x!=="loading"&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[ye.length," tool",ye.length!==1?"s":""," loaded"]})]}),x==="success"&&ye.length>0&&t.jsxs("div",{className:"rounded-lg border border-green-500/20 bg-green-50 dark:bg-green-950/20 px-3 py-2 space-y-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2 text-xs text-green-600 dark:text-green-400",children:[t.jsx(Fe,{size:14,className:"shrink-0"}),t.jsxs("span",{className:"font-medium",children:[ye.length," tool",ye.length!==1?"s":""," discovered"]})]}),t.jsxs("div",{className:"flex flex-wrap gap-1",children:[ye.slice(0,8).map(B=>t.jsx(F,{variant:"secondary",className:"text-[10px] px-1.5 py-0 font-mono",children:B.name},B.name)),ye.length>8&&t.jsxs("span",{className:"text-[10px] text-muted-foreground self-center",children:["+",ye.length-8," more"]})]}),t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"These tools will enrich AI-generated descriptions, tags and categories in the next step."})]}),x==="auth_required"&&f&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-950/20 border border-amber-500/20 rounded-lg px-3 py-2",children:[t.jsx(Ye,{size:14,className:"shrink-0"}),t.jsx("span",{children:"This server requires authentication. The connection is valid but tools cannot be listed without credentials."})]}),x==="error"&&f&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-destructive bg-destructive/10 rounded-lg px-3 py-2",children:[t.jsx(Ye,{size:14,className:"shrink-0"}),t.jsx("span",{children:f})]})]})]}),Es=t.jsxs("div",{className:"grid gap-3",children:[t.jsxs("div",{className:"grid gap-1.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(X,{htmlFor:"registry-item-short-description",children:"Short Description"}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[re.length,"/160"]})]}),t.jsx(le,{id:"registry-item-short-description",className:"h-9 text-sm",placeholder:"Short summary for the store card",value:re,maxLength:160,onChange:B=>me(B.target.value)}),ue.shortDescription&&t.jsx("p",{className:"text-xs text-destructive",children:ue.shortDescription})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(X,{htmlFor:"registry-item-description",children:"Description"}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[ee.length,"/1500"]})]}),t.jsx(bt,{id:"registry-item-description",className:"text-sm max-h-28 overflow-y-auto resize-none",placeholder:"Brief description of this MCP server",rows:2,value:ee,onChange:B=>se(B.target.value)}),ue.description&&t.jsx("p",{className:"text-xs text-destructive",children:ue.description})]}),t.jsx("div",{className:"border-t border-border"}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsx("div",{className:"grid content-start gap-2",children:t.jsx(wn,{id:"registry-category",value:wt,availableOptions:i,onChange:Lt})}),t.jsx("div",{className:"grid content-start gap-2",children:t.jsx(bn,{id:"registry-tags",label:"Tags",values:ze,availableOptions:[...pn,...o],placeholder:"Type and press Enter or comma",onChange:zt})})]}),t.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-border px-4 py-3",children:[t.jsxs("div",{className:"grid gap-0.5",children:[t.jsx(X,{htmlFor:"registry-is-public",className:"text-sm",children:"Public"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Make this MCP visible in the public store URL."})]}),t.jsx(Ue,{id:"registry-is-public",checked:Ft,onCheckedChange:Bt})]}),t.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-border px-4 py-3",children:[t.jsxs("div",{className:"grid gap-0.5",children:[t.jsx(X,{htmlFor:"registry-is-verified",className:"text-sm",children:"Verified"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Curated and approved by deco."})]}),t.jsx(Ue,{id:"registry-is-verified",checked:Qt,onCheckedChange:Vt})]}),t.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-border px-4 py-3",children:[t.jsxs("div",{className:"grid gap-0.5",children:[t.jsx(X,{htmlFor:"registry-is-official",className:"text-sm",children:"Official"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Made and hosted by the service provider."})]}),t.jsx(Ue,{id:"registry-is-official",checked:Gt,onCheckedChange:Kt})]})]}),As=t.jsxs("div",{className:"grid gap-3",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{htmlFor:"registry-item-owner",children:"Owner (optional)"}),t.jsx(le,{id:"registry-item-owner",className:"h-9 text-sm",placeholder:"Team, company, or responsible person",value:he,onChange:B=>pe(B.target.value)})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{htmlFor:"registry-item-repository-url",children:"Repository URL (optional)"}),t.jsx(le,{id:"registry-item-repository-url",className:"h-9 text-sm",placeholder:"https://github.com/org/repo",value:je,onChange:B=>k(B.target.value)}),ue.repositoryUrl&&t.jsx("p",{className:"text-xs text-destructive",children:ue.repositoryUrl})]})]}),t.jsxs("div",{className:"rounded-xl border border-border p-4 space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(X,{children:"README"}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[W.length,"/50000"]})]}),t.jsx("div",{className:"inline-flex rounded-lg border border-border p-0.5",children:["link","content"].map(B=>t.jsx("button",{type:"button",className:Z("px-2.5 py-1 text-xs rounded-md",ae===B?"bg-primary text-primary-foreground":"text-muted-foreground"),onClick:()=>it(B),children:B==="link"?"Link":"Content"},B))}),ae==="link"&&t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(le,{className:"h-9 text-sm",placeholder:"https://raw.githubusercontent.com/org/repo/main/README.md",value:de,onChange:B=>ve(B.target.value)}),ue.readmeUrl&&t.jsx("p",{className:"text-xs text-destructive",children:ue.readmeUrl})]}),ae==="content"&&t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(bt,{className:"text-sm max-h-48 overflow-y-auto resize-none",placeholder:`# README
|
|
26
|
+
|
|
27
|
+
Describe your MCP here...`,rows:6,value:W,onChange:B=>H(B.target.value)}),ue.readme&&t.jsx("p",{className:"text-xs text-destructive",children:ue.readme})]})]}),t.jsx(un,{tools:ye,onChange:at,remoteUrl:Ke(De)||void 0,remoteType:ie,externalDiscoverStatus:x,externalDiscoverError:f})]});return t.jsx(vt,{open:s,onOpenChange:Ht,children:t.jsxs(jt,{className:"sm:max-w-[820px] max-h-[90vh] overflow-hidden flex flex-col",children:[t.jsxs(ht,{className:"space-y-3",children:[t.jsx(pt,{children:p?"Edit MCP Server":"Add MCP Server"}),t.jsx(vn,{current:U}),t.jsxs(ft,{children:[U===1&&"Set up the identity, connection and discover available tools.",U===2&&"Add descriptions, categories and tags to help discovery.",U===3&&"Configure optional metadata, README and tools."]})]}),t.jsxs("div",{className:"flex-1 overflow-y-auto pr-1 py-2",children:[U===1&&Ds,U===2&&Es,U===3&&As]}),t.jsxs(gt,{className:"flex items-center justify-between gap-2 sm:justify-between",children:[t.jsx("div",{children:U>1&&t.jsxs(G,{variant:"ghost",size:"sm",onClick:Ps,children:[t.jsx(xr,{size:14}),"Back"]})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(G,{variant:"outline",size:"sm",onClick:()=>Ht(!1),disabled:a,children:"Cancel"}),U<3?t.jsxs(G,{size:"sm",onClick:Is,children:["Next",t.jsx(Ys,{size:14})]}):t.jsx(G,{size:"sm",onClick:Ms,disabled:a,children:a?"Saving...":p?"Save changes":"Create"})]})]})]})})}function os(s,e){return s.includes(e)?s.filter(r=>r!==e):[...s,e]}function Cn(s){return s._meta?.["mcp.mesh"]?.tags??[]}function kn(s){return s._meta?.["mcp.mesh"]?.categories??[]}function Sn(s){return s.server?.remotes?.[0]?.url??"-"}function Rn(){const[e,r]=M.useState(""),n=M.useDeferredValue(e),[o,i]=M.useState([]),[a,l]=M.useState([]),[d,u]=M.useState(!1),[m,h]=M.useState(!1),[x,f]=M.useState(null),[c,p]=M.useState(null),[j,y]=nr("private-registry-list","cards"),N=M.useRef(null),w=js({search:n,tags:o,categories:a}),v=Or(),{createMutation:I,updateMutation:S,deleteMutation:_,bulkCreateMutation:C}=qt(),T=w.data?.pages.flatMap(g=>g.items??[]).filter(Boolean)??[],R=w.data?.pages[0]?.totalCount??T.length,E=o.length>0||a.length>0||n.length>0,b=v.data,D=Array.isArray(b?.tags)?b.tags:[],$=Array.isArray(b?.categories)?b.categories:[],P=g=>{N.current&&(N.current.disconnect(),N.current=null),!(!g||!w.hasNextPage||w.isFetchingNextPage)&&(N.current=new IntersectionObserver(O=>{O[0]?.isIntersecting&&w.hasNextPage&&!w.isFetchingNextPage&&w.fetchNextPage()},{rootMargin:"240px 0px"}),N.current.observe(g))},A=async g=>{try{"data"in g?(await S.mutateAsync(g),V.success("Registry item updated")):(await I.mutateAsync(g),V.success("Registry item created"))}catch(O){throw V.error(O instanceof Error?O.message:"Failed to save item"),O}},q=async g=>{const O=g._meta?.["mcp.mesh"]?.verified===!0;try{await S.mutateAsync({id:g.id,data:{_meta:{...g._meta,"mcp.mesh":{...g._meta?.["mcp.mesh"],verified:!O}}}}),V.success(O?"Removed verified status":"Marked as verified")}catch(z){V.error(z instanceof Error?z.message:"Failed to update item")}},U=async g=>{const O=g._meta?.["mcp.mesh"]?.official===!0;try{await S.mutateAsync({id:g.id,data:{_meta:{...g._meta,"mcp.mesh":{...g._meta?.["mcp.mesh"],official:!O}}}}),V.success(O?"Removed official status":"Marked as official")}catch(z){V.error(z instanceof Error?z.message:"Failed to update item")}},K=async()=>{if(c)try{await _.mutateAsync(c.id),V.success("Registry item deleted"),p(null)}catch(g){V.error(g instanceof Error?g.message:"Failed to delete item")}};return t.jsxs("div",{className:"h-full flex flex-col",children:[t.jsxs("div",{className:"shrink-0 border-b border-border",children:[t.jsxs("div",{className:"h-12 px-4 md:px-6 flex items-center justify-between gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("h2",{className:"text-sm font-medium",children:"Items"}),t.jsx(F,{variant:"secondary",className:"text-xs",children:R})]}),t.jsxs("div",{className:"flex items-center gap-2 self-stretch",children:[t.jsxs(mt,{children:[t.jsx(ut,{asChild:!0,children:t.jsxs(G,{variant:"outline",size:"sm",className:Z("h-8","gap-1.5"),children:[t.jsx(ir,{size:14}),"Filters"]})}),t.jsxs(xt,{align:"end",className:"w-[260px]",children:[t.jsx(Xt,{children:"Tags"}),D.length>0?D.map(g=>t.jsxs(es,{checked:o.includes(g.value),onCheckedChange:()=>i(O=>os(O,g.value)),children:[g.value," (",g.count,")"]},g.value)):t.jsx(we,{disabled:!0,children:"No tags available"}),t.jsx(sr,{}),t.jsx(Xt,{children:"Categories"}),$.length>0?$.map(g=>t.jsxs(es,{checked:a.includes(g.value),onCheckedChange:()=>l(O=>os(O,g.value)),children:[g.value," (",g.count,")"]},g.value)):t.jsx(we,{disabled:!0,children:"No categories available"})]})]}),t.jsxs(rr,{type:"single",value:j,onValueChange:g=>{(g==="cards"||g==="table")&&y(g)},variant:"outline",className:"h-8",children:[t.jsx(ts,{value:"cards","aria-label":"Cards view",className:"h-8",children:"Cards"}),t.jsx(ts,{value:"table","aria-label":"Table view",className:"h-8",children:"Table"})]}),t.jsx(G,{variant:"outline",size:"sm",className:"h-8",onClick:()=>h(!0),children:"Import CSV"}),t.jsx(G,{size:"sm",className:"h-8",onClick:()=>u(!0),children:"Add MCP Servers"})]})]}),t.jsx("div",{className:"border-t border-border h-12 px-4 md:px-6 flex items-center",children:t.jsxs("label",{className:"flex items-center gap-2.5 h-12 w-full cursor-text",children:[t.jsx(ar,{size:16,className:"text-muted-foreground shrink-0"}),t.jsx(le,{value:e,onChange:g=>r(g.target.value),placeholder:"Search by id, title, description, or server name",className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),E&&t.jsxs("div",{className:"border-t border-border px-4 md:px-6 py-2 flex flex-wrap items-center gap-2",children:[o.map(g=>t.jsxs(F,{variant:"default",children:["#",g]},`selected-tag-${g}`)),a.map(g=>t.jsx(F,{variant:"outline",children:g},`selected-category-${g}`)),e.trim()&&t.jsxs(F,{variant:"secondary",className:"max-w-[280px] truncate",children:["Search: ",e]}),t.jsx(G,{size:"sm",variant:"ghost",className:"h-7 ml-auto",onClick:()=>{r(""),i([]),l([])},children:"Clear filters"})]})]}),t.jsxs("div",{className:"flex-1 overflow-auto px-4 md:px-6 py-4",children:[T.length===0?t.jsx("div",{className:"min-h-[320px] rounded-xl border border-dashed border-border flex flex-col items-center justify-center gap-3 p-6 text-center",children:w.isLoading?t.jsxs(t.Fragment,{children:[t.jsx(Le,{className:"size-5 animate-spin text-muted-foreground"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"text-base font-medium",children:E?"No items found":"No MCPs in your registry"}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:E?"Try removing filters or changing your search to find matching MCPs.":"Add your first MCP item to start building your private registry catalog."}),!E&&t.jsx(G,{size:"lg",onClick:()=>u(!0),children:"Add MCP Servers"})]})}):j==="cards"?t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:T.map(g=>t.jsx(on,{item:g,onEdit:f,onDelete:p,onToggleVerified:q,onToggleOfficial:U},g.id))}),w.hasNextPage&&t.jsx("div",{ref:P,className:"h-2"})]}):t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"border rounded-lg overflow-auto",children:t.jsxs(Dt,{children:[t.jsx(Et,{children:t.jsxs(Be,{children:[t.jsx(oe,{className:"w-[56px]",children:"Icon"}),t.jsx(oe,{children:"Title"}),t.jsx(oe,{children:"ID"}),t.jsx(oe,{children:"Tags"}),t.jsx(oe,{children:"Categories"}),t.jsx(oe,{children:"Remote URL"}),t.jsx(oe,{children:"Visibility"}),t.jsx(oe,{className:"text-right w-[68px]",children:"Actions"})]})}),t.jsx(At,{children:T.map(g=>t.jsxs(Be,{children:[t.jsx(ce,{children:t.jsx("div",{className:"size-8 rounded-md border border-border bg-muted/20 overflow-hidden flex items-center justify-center",children:g.server?.icons?.[0]?.src?t.jsx("img",{src:g.server.icons[0].src,alt:g.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:g.title.charAt(0).toUpperCase()})})}),t.jsx(ce,{children:g.title}),t.jsx(ce,{className:"font-mono",children:g.id}),t.jsx(ce,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:Cn(g).slice(0,3).map(O=>t.jsx(F,{variant:"outline",children:O},`${g.id}-tag-${O}`))})}),t.jsx(ce,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:kn(g).slice(0,3).map(O=>t.jsx(F,{variant:"outline",children:O},`${g.id}-category-${O}`))})}),t.jsx(ce,{children:Sn(g)}),t.jsx(ce,{children:g.is_public?t.jsxs(F,{variant:"default",className:"gap-1",children:[t.jsx(xs,{size:10}),"Public"]}):t.jsx(F,{variant:"secondary",children:"Private"})}),t.jsx(ce,{className:"text-right",children:t.jsxs(mt,{children:[t.jsx(ut,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:t.jsx($t,{size:18})})}),t.jsxs(xt,{align:"end",children:[t.jsx(we,{onClick:()=>f(g),children:"Edit"}),t.jsx(we,{variant:"destructive",onClick:()=>p(g),children:"Delete"})]})]})})]},g.id))})]})}),w.hasNextPage&&t.jsx("div",{ref:P,className:"h-2"})]}),w.isFetchingNextPage&&t.jsxs("div",{className:"py-4 flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[t.jsx(Le,{className:"size-4 animate-spin"}),"Loading more items..."]})]}),t.jsx(_n,{open:d||!!x,onOpenChange:g=>{g||(u(!1),f(null))},item:x,availableTags:D.map(g=>g.value),availableCategories:$.map(g=>g.value),isSubmitting:I.isPending||S.isPending,onSubmit:A},x?.id??"create"),t.jsx(Jr,{open:m,onOpenChange:h,isImporting:C.isPending,onImport:async g=>{try{const O=await C.mutateAsync(g);return V.success(`Imported ${O.created} item(s)`),O}catch(O){throw V.error(O instanceof Error?O.message:"Failed to import CSV"),O}}}),t.jsx(sn,{open:!!c,onOpenChange:g=>{g||p(null)},title:c?.title??c?.id??"",isDeleting:_.isPending,onConfirm:K})]})}const Tn=[{value:"pending",label:"Pending"},{value:"approved",label:"Approved"},{value:"rejected",label:"Rejected"}];function cs(s){const e=new Date(s);return Number.isNaN(e.getTime())?s:e.toLocaleDateString()}function ds(s){return{id:s.requested_id??s.server?.name,title:s.title,description:s.description??"",_meta:s._meta,server:s.server,is_public:!1}}function Mt(s){const e=s.server?.icons?.[0]?.src;return typeof e=="string"&&e.length>0?e:null}function ct(s){const e=s._meta?.["mcp.mesh"];return{hasReadmeContent:!!e?.readme?.trim(),hasReadmeLink:!!e?.readme_url?.trim(),readmeContent:e?.readme?.trim()??"",readmeUrl:e?.readme_url?.trim()??""}}function In(){const[s,e]=M.useState("pending"),[r,n]=M.useState("created_at"),[o,i]=M.useState("asc"),[a,l]=M.useState(new Set),[d,u]=M.useState(!1),[m,h]=M.useState("private"),[x,f]=M.useState(!1),[c,p]=M.useState(null),[j,y]=M.useState(null),[N,w]=M.useState(null),[v,I]=M.useState(null),[S,_]=M.useState(""),C=qr({status:s,sortBy:r,sortDirection:o}),{reviewMutation:T,deleteMutation:R}=Br(),{createMutation:E}=qt(),b=C.data?.pages.flatMap(k=>k.items)??[],D=C.data?.pages[0]?.totalCount??0,$=C.isFetchingNextPage,P=!!C.hasNextPage,A=vr(()=>{C.isFetchingNextPage||C.fetchNextPage()},P,$),q=new Set(b.filter(k=>k.status==="pending").map(k=>k.id)),U=b.filter(k=>q.has(k.id)),K=a.size,g=U.filter(k=>a.has(k.id)),O=b.filter(k=>a.has(k.id)).length,z=U.length>0&&U.every(k=>a.has(k.id)),te=()=>l(new Set),ee=(k,W)=>{l(H=>{const de=new Set(H);return W?de.add(k):de.delete(k),de})},se=k=>{l(W=>{const H=new Set(W);return H.has(k)?H.delete(k):H.add(k),H})},re=()=>{l(k=>{const W=new Set(k);for(const H of U)W.add(H.id);return W})},me=async()=>{const k=j;if(k){y(null),p(k.id);try{await T.mutateAsync({id:k.id,status:"approved",reviewerNotes:void 0});const W=ds(k);await E.mutateAsync({id:W.id,title:W.title,description:W.description,_meta:W._meta,server:W.server,is_public:W.is_public}),V.success("Request approved and added to registry")}catch(W){const H=W instanceof Error?W.message:"Failed to approve request";H.includes("UNIQUE constraint")||H.includes("already exists")?V.error("An item with this ID already exists in the registry. Delete or rename it first."):V.error(H)}finally{p(null)}}},he=async()=>{if(N)try{await T.mutateAsync({id:N.id,status:"rejected",reviewerNotes:S.trim()||void 0}),V.success("Request rejected"),w(null),_("")}catch(k){V.error(k instanceof Error?k.message:"Failed to reject request")}},pe=async k=>{try{await R.mutateAsync(k.id),V.success("Request deleted")}catch(W){V.error(W instanceof Error?W.message:"Failed to delete request")}},je=async()=>{if(g.length===0||x)return;f(!0),u(!1);let k=0;const W=new Set;for(const de of g)try{await T.mutateAsync({id:de.id,status:"approved",reviewerNotes:void 0});const ve=ds(de);await E.mutateAsync({id:ve.id,title:ve.title,description:ve.description,_meta:ve._meta,server:ve.server,is_public:m==="public"}),k++}catch{W.add(de.id)}const H=W.size;k>0&&H===0?V.success(`${k} request${k>1?"s":""} approved as ${m}.`):k>0&&H>0?V.warning(`Approved ${k}. Failed ${H}. Failed items remain selected for retry.`):V.error("Bulk approve failed. Selected items were kept for retry."),l(W),f(!1)};return t.jsxs("div",{className:"h-full flex flex-col",children:[t.jsx("div",{className:"shrink-0 border-b border-border",children:t.jsxs("div",{className:"h-12 px-4 md:px-6 flex items-center justify-between gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("h2",{className:"text-sm font-medium",children:"Requests to Publish"}),t.jsx(F,{variant:"secondary",className:"text-xs",children:D})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"inline-flex rounded-lg border border-border p-0.5",children:Tn.map(k=>t.jsx("button",{type:"button",className:Z("px-2.5 py-1 text-xs rounded-md transition-colors",s===k.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>e(k.value),onClickCapture:()=>te(),children:k.label},k.value))}),t.jsxs("select",{className:"h-7 rounded-md border border-input bg-background px-2 text-xs",value:`${r}:${o}`,onChange:k=>{const[W,H]=k.target.value.split(":");n(W),i(H)},children:[t.jsx("option",{value:"created_at:asc",children:"Created at (oldest first)"}),t.jsx("option",{value:"created_at:desc",children:"Created at (newest first)"}),t.jsx("option",{value:"title:asc",children:"Alphabetical (A-Z)"}),t.jsx("option",{value:"title:desc",children:"Alphabetical (Z-A)"})]})]})]})}),t.jsxs("div",{className:"flex-1 overflow-auto px-4 md:px-6 py-4",children:[C.isLoading?t.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading requests..."}):C.isError?t.jsxs("div",{className:"p-8 text-center rounded-lg border border-border",children:[t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load publish requests."}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:C.error instanceof Error?C.error.message:"Unknown error"})]}):b.length===0?t.jsx("div",{className:"p-8 text-center rounded-lg border border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:s==="pending"?"No pending publish requests.":s==="approved"?"No approved publish requests.":"No rejected publish requests."})}):t.jsxs(Dt,{children:[t.jsx(Et,{children:t.jsxs(Be,{children:[s==="pending"&&t.jsx(oe,{className:"w-10",children:t.jsx(rs,{checked:z&&U.length>0,onCheckedChange:k=>{k?re():te()}})}),t.jsx(oe,{children:"Name"}),t.jsx(oe,{children:"Requester"}),t.jsx(oe,{children:"Tags"}),t.jsx(oe,{children:"Status"}),t.jsx(oe,{children:"Date"}),t.jsx(oe,{className:"text-right",children:"Actions"})]})}),t.jsx(At,{children:b.map(k=>{const W=Mt(k),H=k._meta?.["mcp.mesh"]?.tags??[],de=q.has(k.id),ve=a.has(k.id);return t.jsxs(Be,{className:Z(de&&"cursor-pointer",ve&&"bg-accent/20"),onClick:()=>{de&&se(k.id)},children:[s==="pending"&&t.jsx(ce,{children:t.jsx(rs,{checked:ve,onCheckedChange:ae=>ee(k.id,ae===!0),onClick:ae=>ae.stopPropagation()})}),t.jsx(ce,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("div",{className:"size-7 rounded-md border border-border bg-muted/30 overflow-hidden shrink-0 flex items-center justify-center",children:W?t.jsx("img",{src:W,alt:k.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:k.title.slice(0,1).toUpperCase()})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:k.title}),k.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-[300px]",children:k.description})]})]})}),t.jsx(ce,{children:t.jsx("span",{className:"text-sm text-muted-foreground truncate",children:k.requester_name||k.requester_email||"-"})}),t.jsx(ce,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:H.slice(0,3).map(ae=>t.jsx(F,{variant:"secondary",className:"text-[10px]",children:ae},`${k.id}-tag-${ae}`))})}),t.jsx(ce,{children:t.jsx(F,{variant:"secondary",className:"capitalize text-[11px]",children:k.status})}),t.jsx(ce,{children:t.jsx("span",{className:"text-sm text-muted-foreground",children:cs(k.created_at)})}),t.jsx(ce,{className:"text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[t.jsxs(G,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:ae=>{ae.stopPropagation(),I(k)},children:[t.jsx(hs,{size:13}),"View"]}),de?t.jsxs(t.Fragment,{children:[t.jsxs(G,{size:"sm",className:"h-7 text-xs px-2",onClick:ae=>{ae.stopPropagation(),y(k)},disabled:c!==null||x||ve,children:[t.jsx(Fe,{size:13}),c===k.id?"Approving...":ve?"Selected":"Approve"]}),t.jsxs(G,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:ae=>{ae.stopPropagation(),w(k),_("")},disabled:T.isPending,children:[t.jsx(Hs,{size:13}),"Reject"]})]}):t.jsxs(G,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:ae=>{ae.stopPropagation(),pe(k)},disabled:R.isPending,children:[t.jsx(rt,{size:13}),"Delete"]})]})})]},k.id)})})]}),b.length>0&&P?t.jsx("div",{ref:A,className:"h-1 w-full"}):null,$&&b.length>0?t.jsx("div",{className:"pt-3 text-xs text-muted-foreground",children:"Loading more requests..."}):null]}),K>0?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:[t.jsxs("div",{className:"text-xs text-muted-foreground pr-1",children:[K," selected"]}),t.jsx(G,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:re,disabled:z,children:"Select all"}),t.jsx(G,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:te,children:"Clear selection"}),t.jsxs(G,{size:"sm",className:"h-7 text-xs px-2",onClick:()=>u(!0),disabled:x,children:[t.jsx(Fe,{size:13}),"Approve selected"]})]})}):null,t.jsx(vt,{open:!!v,onOpenChange:k=>{k||I(null)},children:t.jsxs(jt,{className:"sm:max-w-[720px] max-h-[85vh] overflow-hidden flex flex-col",children:[t.jsxs(ht,{children:[t.jsx(pt,{children:v?.title??"Request details"}),t.jsx(ft,{children:"Review all metadata sent by the requester before approving."})]}),v&&t.jsxs("div",{className:"flex-1 overflow-y-auto pr-1 space-y-4",children:[t.jsxs("div",{className:"rounded-lg border border-border bg-muted/20 p-3 flex items-center gap-3",children:[t.jsx("div",{className:"size-16 rounded-lg border border-border bg-muted/30 overflow-hidden shrink-0 flex items-center justify-center",children:Mt(v)?t.jsx("img",{src:Mt(v)||"",alt:v.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-lg font-semibold text-muted-foreground",children:v.title.slice(0,1).toUpperCase()})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:v.title}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:v.server?.name||v.id})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Status"}),t.jsx("span",{className:"capitalize",children:v.status})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Submitted"}),t.jsx("span",{children:cs(v.created_at)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Requester"}),t.jsx("span",{children:v.requester_name||"-"})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Email"}),t.jsx("span",{children:v.requester_email||"-"})]})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{children:"Remote URL"}),t.jsx("code",{className:"text-xs rounded-md border border-border bg-muted/30 px-2.5 py-2 break-all",children:v.server?.remotes?.[0]?.url??"-"})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{children:"Description"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:v.description||"No description provided."})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{children:"Tags"}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:(v._meta?.["mcp.mesh"]?.tags??[]).length?(v._meta?.["mcp.mesh"]?.tags??[]).map(k=>t.jsx(F,{variant:"secondary",children:k},`${v.id}-detail-tag-${k}`)):t.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{children:"Categories"}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:(v._meta?.["mcp.mesh"]?.categories??[]).length?(v._meta?.["mcp.mesh"]?.categories??[]).map(k=>t.jsx(F,{variant:"secondary",children:k},`${v.id}-detail-category-${k}`)):t.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{children:"README"}),ct(v).hasReadmeContent?t.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap max-h-40 overflow-y-auto rounded-md border border-border bg-muted/20 px-2.5 py-2",children:ct(v).readmeContent}):ct(v).hasReadmeLink?t.jsxs("a",{href:ct(v).readmeUrl,target:"_blank",rel:"noreferrer",className:"text-sm inline-flex items-center gap-1.5 text-primary hover:underline",children:["Open README link",t.jsx(jr,{size:14})]}):t.jsx("span",{className:"text-sm text-muted-foreground",children:"No README provided."})]})]}),t.jsx(gt,{children:t.jsx(G,{variant:"outline",onClick:()=>I(null),children:"Close"})})]})}),t.jsx(st,{open:!!j,onOpenChange:k=>{k||y(null)},children:t.jsxs(tt,{children:[t.jsxs(We,{children:[t.jsx(He,{children:"Approve publish request?"}),t.jsxs(Je,{children:["This will add"," ",t.jsx("span",{className:"font-medium text-foreground",children:j?.title})," ","to your private registry. The requester will be notified of the approval."]})]}),t.jsxs(et,{children:[t.jsx(Ze,{children:"Cancel"}),t.jsx(Xe,{onClick:me,children:"Approve"})]})]})}),t.jsx(st,{open:d,onOpenChange:u,children:t.jsxs(tt,{children:[t.jsxs(We,{children:[t.jsx(He,{children:"Approve selected requests?"}),t.jsxs(Je,{children:["This will approve ",g.length," request",g.length>1?"s":""," and create all resulting apps with the same visibility setting."]})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{htmlFor:"bulk-visibility",children:"Visibility for all selected"}),t.jsxs("select",{id:"bulk-visibility",className:"h-9 rounded-md border border-input bg-background px-3 text-sm",value:m,onChange:k=>h(k.target.value),children:[t.jsx("option",{value:"private",children:"Private"}),t.jsx("option",{value:"public",children:"Public"})]})]}),t.jsxs(et,{children:[t.jsx(Ze,{disabled:x,children:"Cancel"}),t.jsx(Xe,{onClick:je,disabled:x||O===0,children:x?"Approving...":"Approve selected"})]})]})}),t.jsx(vt,{open:!!N,onOpenChange:k=>{k||(w(null),_(""))},children:t.jsxs(jt,{children:[t.jsxs(ht,{children:[t.jsx(pt,{children:"Reject publish request?"}),t.jsx(ft,{children:"This request will move to rejected status. You can leave optional notes for context."})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{htmlFor:"reject-notes",children:"Reviewer notes (optional)"}),t.jsx(bt,{id:"reject-notes",rows:4,value:S,onChange:k=>_(k.target.value),placeholder:"Reason for rejection..."})]}),t.jsxs(gt,{children:[t.jsx(G,{variant:"outline",onClick:()=>{w(null),_("")},children:"Cancel"}),t.jsx(G,{onClick:he,disabled:T.isPending,children:T.isPending?"Rejecting...":"Reject"})]})]})})]})}function Pn({revealedKey:s,onRevealedKeyChange:e}){const{org:r}=xe(),{uploadImage:n,isUploading:o}=Ns(),{registryName:i,registryIcon:a,acceptPublishRequests:l,requireApiToken:d,storePrivateOnly:u,rateLimitEnabled:m,rateLimitWindow:h,rateLimitMax:x,isSaving:f,updateConfig:c}=vs(Oe),[p,j]=M.useState(i),[y,N]=M.useState(i);i!==y&&(N(i),j(i));const[w,v]=M.useState(a),[I,S]=M.useState(a);a!==I&&(S(a),v(a));const[_,C]=M.useState(String(x)),[T,R]=M.useState(x);x!==T&&(R(x),C(String(x)));const E=Qr(),{generateMutation:b,revokeMutation:D}=Vr(),[$,P]=M.useState(""),[A,q]=M.useState(!1),[U,K]=M.useState(null),{handleCopy:g,copied:O}=It(),{handleCopy:z,copied:te}=It(),{handleCopy:ee,copied:se}=It(),re=js({search:"",tags:[],categories:[],limit:50}),me=`${window.location.origin}/org/${r.slug}/registry/mcp`,pe=(re.data?.pages.flatMap(L=>L.items??[])??[]).filter(L=>L.is_public).length,je=`${window.location.origin}/org/${r.slug}/registry/publish-request`,k=s?.slice(0,12)??null,W=!!(k&&(E.data?.items??[]).some(L=>L.prefix===k)),H=f||o,de=()=>{const L=p.trim();!L||L===i||c({registryName:L})},ve=()=>{const L=Number.parseInt(_,10),ie=Number.isFinite(L)&&L>=1?L:100;C(String(ie)),ie!==x&&c({rateLimitMax:ie})},ae=async L=>{if(!L)return;const ie=L.name.split(".").pop()||"png",lt=`registry/${r.id}/identity/icon.${ie}`,ze=await n(L,lt);ze?(v(ze),c({registryIcon:ze})):V.error("Failed to upload icon. Please try again.")},it=async()=>{const L=$.trim();if(L)try{const ie=await b.mutateAsync(L);ie?.key&&(e(ie.key),q(!1),P(""),V.success("API key generated. Copy it now — it won't be shown again!"))}catch(ie){V.error(ie instanceof Error?ie.message:"Failed to generate API key")}},De=async L=>{try{await D.mutateAsync(L),e(null),K(null),V.success("API key revoked")}catch(ie){V.error(ie instanceof Error?ie.message:"Failed to revoke API key")}};return t.jsxs("div",{className:"h-full overflow-auto px-4 md:px-6 py-4",children:[t.jsxs("div",{className:"grid grid-cols-1 gap-4 items-start xl:grid-cols-2",children:[t.jsx("div",{className:"grid gap-4 min-w-0 content-start",children:t.jsxs(ne,{className:"min-w-0 p-4 grid gap-4 content-start",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-semibold",children:"Registry Identity"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure the name and icon shown in the store selector."})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(X,{htmlFor:"identity-name",children:"Name"}),t.jsx(le,{id:"identity-name",value:p,onChange:L=>j(L.target.value),onBlur:de,disabled:H,placeholder:"Private Registry"})]}),t.jsx(bs,{value:w,onChange:v,onBlur:()=>{const L=w.trim();L!==a&&c({registryIcon:L})},onFileUpload:ae,isUploading:o})]})}),t.jsxs("div",{className:"grid gap-4 min-w-0 content-start",children:[t.jsxs(ne,{className:"min-w-0 p-4 grid gap-3 content-start",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-semibold",children:"Public Registry"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Public URL to consume this registry as an MCP."})]}),t.jsxs(F,{variant:"secondary",children:[pe," ",pe===1?"public item":"public items"]})]}),t.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 flex items-center gap-2 min-w-0",children:[t.jsx("code",{className:"text-xs font-mono break-all leading-5 min-w-0 flex-1 select-all",children:me}),t.jsx(G,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:()=>g(me),children:O?t.jsx(Pt,{size:14}):t.jsx(Tt,{size:14})})]})]}),t.jsxs(ne,{className:"min-w-0 p-4 grid gap-3 content-start",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-semibold",children:"Store Visibility"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose what appears when users browse this registry in Store."})]}),t.jsx(Ue,{id:"store-private-only",checked:u,onCheckedChange:L=>c({storePrivateOnly:L}),disabled:H})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Enabled: show only private apps. Disabled: show public and private apps together."})]}),t.jsxs(ne,{className:"min-w-0 p-4 grid gap-3 content-start",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-base font-semibold",children:"Publish Requests"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Allow external users to submit MCP servers for review."})]}),t.jsx(Ue,{id:"accept-publish-requests",checked:l,onCheckedChange:L=>c({acceptPublishRequests:L}),disabled:H})]}),t.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 flex items-center gap-2 min-w-0",children:[t.jsx("code",{className:"text-xs font-mono break-all leading-5 min-w-0 flex-1 select-all",children:je}),t.jsx(G,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:()=>z(je),children:te?t.jsx(Pt,{size:14}):t.jsx(Tt,{size:14})})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-2 border-t border-border",children:[t.jsxs("div",{children:[t.jsx(X,{className:"text-sm font-medium",children:"Require API Token"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Requests without a valid token will be rejected."})]}),t.jsx(Ue,{id:"require-api-token",checked:d,onCheckedChange:L=>c({requireApiToken:L}),disabled:H})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-2 border-t border-border",children:[t.jsxs("div",{children:[t.jsx(X,{className:"text-sm font-medium",children:"Rate Limit"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Limit publish requests per organization by time window."})]}),t.jsx(Ue,{id:"publish-rate-limit",checked:m,onCheckedChange:L=>c({rateLimitEnabled:L}),disabled:H})]}),m&&t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx(X,{htmlFor:"rate-limit-max",className:"text-sm font-medium",children:"Max requests"}),t.jsx(le,{id:"rate-limit-max",inputMode:"numeric",min:1,type:"number",value:_,onChange:L=>C(L.target.value),onBlur:ve,disabled:H,placeholder:"100"})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(X,{htmlFor:"rate-limit-window",className:"text-sm font-medium",children:"Window"}),t.jsxs("select",{id:"rate-limit-window",className:"h-9 rounded-md border border-input bg-background px-3 text-sm disabled:opacity-50",value:h,onChange:L=>c({rateLimitWindow:L.target.value}),disabled:H,children:[t.jsx("option",{value:"minute",children:"Per minute"}),t.jsx("option",{value:"hour",children:"Per hour"})]})]})]}),l&&d&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-border",children:[t.jsx(br,{size:14,className:"text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:"API Keys"})]}),s&&!W&&t.jsxs("div",{className:"rounded-md border border-border bg-muted/20 px-3 py-2 grid gap-1.5",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"New key (refreshing list...)"}),t.jsx(le,{readOnly:!0,value:s,className:"h-8 text-xs font-mono bg-background"})]}),t.jsxs("div",{className:"flex items-end gap-2",children:[t.jsxs("div",{className:"grid gap-1.5 flex-1",children:[t.jsx(X,{htmlFor:"api-key-name",className:"text-xs",children:"Key name"}),t.jsx(le,{id:"api-key-name",value:$,onChange:L=>P(L.target.value),placeholder:"e.g. CI/CD Pipeline",className:"h-8 text-sm"})]}),t.jsxs(G,{variant:"outline",size:"sm",className:"h-8 gap-1.5",disabled:!$.trim()||b.isPending,onClick:it,children:[b.isPending?t.jsx(Le,{size:14,className:"animate-spin"}):t.jsx(yr,{size:14}),"Generate"]})]}),(E.data?.items?.length??0)>0&&t.jsx("div",{className:"grid gap-2",children:E.data?.items?.map(L=>t.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-background px-3 py-2",children:[t.jsxs("div",{className:"grid gap-1 min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium truncate leading-none",children:L.name}),k===L.prefix?t.jsx(le,{readOnly:!0,value:A?s??"":"••••••••••••••••••••••••••••••••••••••••••••••••••••",className:"h-8 text-xs font-mono bg-muted/20"}):t.jsx(le,{readOnly:!0,value:`${L.prefix}••••••••`,className:"h-8 text-xs font-mono bg-muted/20 text-muted-foreground"})]}),t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[k===L.prefix&&t.jsxs(t.Fragment,{children:[t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>q(ie=>!ie),children:A?t.jsx(hr,{size:14}):t.jsx(hs,{size:14})}),t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:!s,onClick:()=>s&&ee(s),children:se?t.jsx(Pt,{size:14}):t.jsx(Tt,{size:14})})]}),t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-destructive hover:text-destructive",disabled:D.isPending,onClick:()=>K({id:L.id,name:L.name}),children:t.jsx(rt,{size:14})})]})]},L.id))})]})]})]})]}),t.jsx(st,{open:!!U,onOpenChange:L=>{!L&&!D.isPending&&K(null)},children:t.jsxs(tt,{children:[t.jsxs(We,{children:[t.jsx(He,{children:"Revoke API key?"}),t.jsxs(Je,{children:["This action cannot be undone. The key",U?` "${U.name}"`:""," will stop working immediately."]})]}),t.jsxs(et,{children:[t.jsx(Ze,{disabled:D.isPending,children:"Cancel"}),t.jsx(Xe,{disabled:!U||D.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>U&&De(U.id),children:D.isPending?"Revoking...":"Revoke key"})]})]})})]})}function Mn(s){const e=Y.c(5),{results:r}=s;if(r.length===0){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ne,{className:"p-4 text-sm text-muted-foreground text-center",children:"No broken MCPs in this run. All healthy! ✓"}),e[0]=i):i=e[0],i}let n;e[1]!==r?(n=r.map(Dn),e[1]=r,e[2]=n):n=e[2];let o;return e[3]!==n?(o=t.jsx("div",{className:"space-y-2",children:n}),e[3]=n,e[4]=o):o=e[4],o}function Dn(s){return t.jsx(En,{result:s},s.id)}function En(s){const e=Y.c(49),{result:r}=s,[n,o]=M.useState(!1);let i;if(e[0]!==n||e[1]!==r.action_taken||e[2]!==r.connection_ok||e[3]!==r.duration_ms||e[4]!==r.error_message||e[5]!==r.id||e[6]!==r.item_title||e[7]!==r.status||e[8]!==r.tool_results||e[9]!==r.tools_listed){const a=r.tool_results.filter(On);let l;e[11]!==n?(l=()=>o(!n),e[11]=n,e[12]=l):l=e[12];let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("span",{className:"text-red-500 text-sm mt-0.5",children:"✗"}),e[13]=d):d=e[13];let u;e[14]!==r.item_title?(u=t.jsx("h4",{className:"text-sm font-medium truncate",children:r.item_title}),e[14]=r.item_title,e[15]=u):u=e[15];let m;e[16]!==r.status?(m=r.status.replace("_"," "),e[16]=r.status,e[17]=m):m=e[17];let h;e[18]!==m?(h=t.jsx(F,{variant:"destructive",className:"capitalize text-[10px] shrink-0",children:m}),e[18]=m,e[19]=h):h=e[19];let x;e[20]!==u||e[21]!==h?(x=t.jsxs("div",{className:"flex items-center gap-2",children:[u,h]}),e[20]=u,e[21]=h,e[22]=x):x=e[22];const f=r.connection_ok?"✓":"✗";let c;e[23]!==f?(c=t.jsxs("span",{children:["conn: ",f]}),e[23]=f,e[24]=c):c=e[24];const p=r.tools_listed?"✓":"✗";let j;e[25]!==p?(j=t.jsxs("span",{children:["tools listed: ",p]}),e[25]=p,e[26]=j):j=e[26];let y;e[27]!==r.duration_ms?(y=t.jsxs("span",{children:[r.duration_ms,"ms"]}),e[27]=r.duration_ms,e[28]=y):y=e[28];const N=a.length>0&&t.jsxs("span",{className:"text-red-600",children:[a.length," tool",a.length>1?"s":""," ","failed"]});let w;e[29]!==r.action_taken?(w=r.action_taken!=="none"&&t.jsx(F,{variant:"destructive",className:"text-[9px] px-1.5 py-0",children:r.action_taken.replace(/_/g," ")}),e[29]=r.action_taken,e[30]=w):w=e[30];let v;e[31]!==j||e[32]!==y||e[33]!==N||e[34]!==w||e[35]!==c?(v=t.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground flex-wrap",children:[c,j,y,N,w]}),e[31]=j,e[32]=y,e[33]=N,e[34]=w,e[35]=c,e[36]=v):v=e[36];let I;e[37]!==r.error_message?(I=r.error_message&&t.jsx("p",{className:"text-xs text-red-600 line-clamp-2",children:r.error_message}),e[37]=r.error_message,e[38]=I):I=e[38];let S;e[39]!==v||e[40]!==I||e[41]!==x?(S=t.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[x,v,I]}),e[39]=v,e[40]=I,e[41]=x,e[42]=S):S=e[42];const _=n?"▲":"▼";let C;e[43]!==_?(C=t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0 mt-1",children:_}),e[43]=_,e[44]=C):C=e[44];let T;e[45]!==S||e[46]!==C||e[47]!==l?(T=t.jsxs("button",{type:"button",className:"w-full text-left p-3 flex items-start gap-3 hover:bg-muted/30 transition-colors",onClick:l,children:[d,S,C]}),e[45]=S,e[46]=C,e[47]=l,e[48]=T):T=e[48],i=t.jsxs(ne,{className:"overflow-hidden",children:[T,n&&t.jsxs("div",{className:"border-t border-border p-3 space-y-2 bg-muted/10",children:[r.error_message&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-red-600",children:"Full Error"}),t.jsx("pre",{className:"text-[11px] bg-red-500/5 border border-red-500/10 rounded px-2.5 py-1.5 whitespace-pre-wrap break-all text-red-700",children:r.error_message})]}),t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Connection"}),t.jsx("p",{className:Z("text-xs font-medium",r.connection_ok?"text-emerald-600":"text-red-600"),children:r.connection_ok?"OK":"Failed"})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Tools Listed"}),t.jsx("p",{className:Z("text-xs font-medium",r.tools_listed?"text-emerald-600":"text-red-600"),children:r.tools_listed?"Yes":"No"})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Duration"}),t.jsxs("p",{className:"text-xs font-medium",children:[r.duration_ms,"ms"]})]})]}),a.length>0&&t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"text-[10px] font-semibold text-red-600",children:["Failed Tools (",a.length,")"]}),a.map(R=>t.jsxs("div",{className:"rounded border border-red-500/10 bg-red-500/5 px-2.5 py-1.5 space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-xs font-mono font-medium text-red-700",children:R.toolName}),t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[R.durationMs,"ms"]})]}),R.error&&t.jsx("pre",{className:"text-[11px] whitespace-pre-wrap break-all text-red-600",children:R.error})]},`${r.id}-${R.toolName}`))]}),r.tool_results.length>0&&r.tool_results.some($n)&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:"Passing Tools"}),t.jsx("div",{className:"flex flex-wrap gap-1",children:r.tool_results.filter(An).map(R=>t.jsxs(F,{variant:"secondary",className:"text-[10px]",children:["✓ ",R.toolName]},`${r.id}-${R.toolName}-pass`))})]})]})]}),e[0]=n,e[1]=r.action_taken,e[2]=r.connection_ok,e[3]=r.duration_ms,e[4]=r.error_message,e[5]=r.id,e[6]=r.item_title,e[7]=r.status,e[8]=r.tool_results,e[9]=r.tools_listed,e[10]=i}else i=e[10];return i}function An(s){return s.success}function $n(s){return s.success}function On(s){return!s.success}const Un=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"}];function qn(s){const r=s.trim().split(/\s+/);if(r.length!==5)return{frequency:"custom",minute:0,hour:9,weekDay:1,dayOfMonth:1};const[n,o,i,a,l]=r,d=Number(n),u=Number(o),m=Number(i),h=Number(l);return Number.isInteger(d)&&Number.isInteger(u)&&d>=0&&d<=59&&u>=0&&u<=23?i==="*"&&l==="*"?{frequency:"daily",minute:d,hour:u,weekDay:1,dayOfMonth:1}:i==="*/14"&&l==="*"?{frequency:"biweekly",minute:d,hour:u,weekDay:1,dayOfMonth:1}:i==="*"&&Number.isInteger(h)&&h>=0&&h<=6?{frequency:"weekly",minute:d,hour:u,weekDay:h,dayOfMonth:1}:l==="*"&&Number.isInteger(m)&&m>=1&&m<=31?{frequency:"monthly",minute:d,hour:u,weekDay:1,dayOfMonth:m}:{frequency:"custom",minute:d,hour:u,weekDay:1,dayOfMonth:1}:{frequency:"custom",minute:0,hour:9,weekDay:1,dayOfMonth:1}}function zn(s,e){return`${String(s).padStart(2,"0")}:${String(e).padStart(2,"0")}`}function dt(s){return s.frequency==="daily"?`${s.minute} ${s.hour} * * *`:s.frequency==="weekly"?`${s.minute} ${s.hour} * * ${s.weekDay}`:s.frequency==="biweekly"?`${s.minute} ${s.hour} */14 * *`:s.frequency==="monthly"?`${s.minute} ${s.hour} ${s.dayOfMonth} * *`:s.currentValue}function Ln(s){const e=Y.c(60),{value:r,onChange:n,disabled:o}=s,i=o===void 0?!1:o;let a;e[0]!==r?(a=qn(r),e[0]=r,e[1]=a):a=e[1];const l=a,d=l.frequency==="custom";let u;e[2]!==n||e[3]!==l.dayOfMonth||e[4]!==l.hour||e[5]!==l.minute||e[6]!==l.weekDay||e[7]!==r?(u=A=>{if(A==="custom"){n(r);return}n(dt({frequency:A,hour:l.hour,minute:l.minute,weekDay:l.weekDay,dayOfMonth:l.dayOfMonth,currentValue:r}))},e[2]=n,e[3]=l.dayOfMonth,e[4]=l.hour,e[5]=l.minute,e[6]=l.weekDay,e[7]=r,e[8]=u):u=e[8];const m=u;let h;e[9]!==n||e[10]!==l.dayOfMonth||e[11]!==l.frequency||e[12]!==l.weekDay||e[13]!==r?(h=A=>{const[q,U]=A.split(":"),K=Number(q),g=Number(U);!Number.isInteger(K)||!Number.isInteger(g)||n(dt({frequency:l.frequency,hour:K,minute:g,weekDay:l.weekDay,dayOfMonth:l.dayOfMonth,currentValue:r}))},e[9]=n,e[10]=l.dayOfMonth,e[11]=l.frequency,e[12]=l.weekDay,e[13]=r,e[14]=h):h=e[14];const x=h;let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(X,{children:"Frequency"}),e[15]=f):f=e[15];let c;e[16]!==m?(c=A=>m(A.target.value),e[16]=m,e[17]=c):c=e[17];let p,j,y,N,w;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("option",{value:"daily",children:"Daily"}),N=t.jsx("option",{value:"weekly",children:"Weekly"}),w=t.jsx("option",{value:"biweekly",children:"Every 2 weeks"}),p=t.jsx("option",{value:"monthly",children:"Monthly"}),j=t.jsx("option",{value:"custom",children:"Custom (raw cron)"}),e[18]=p,e[19]=j,e[20]=y,e[21]=N,e[22]=w):(p=e[18],j=e[19],y=e[20],N=e[21],w=e[22]);let v;e[23]!==i||e[24]!==l.frequency||e[25]!==c?(v=t.jsxs("label",{className:"space-y-1",children:[f,t.jsxs("select",{className:"h-9 rounded-md border border-input bg-background px-3 text-sm",value:l.frequency,onChange:c,disabled:i,children:[y,N,w,p,j]})]}),e[23]=i,e[24]=l.frequency,e[25]=c,e[26]=v):v=e[26];let I;e[27]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(X,{children:"Time"}),e[27]=I):I=e[27];let S;e[28]!==l.hour||e[29]!==l.minute?(S=zn(l.hour,l.minute),e[28]=l.hour,e[29]=l.minute,e[30]=S):S=e[30];let _;e[31]!==x?(_=A=>x(A.target.value),e[31]=x,e[32]=_):_=e[32];const C=i||d;let T;e[33]!==S||e[34]!==_||e[35]!==C?(T=t.jsxs("label",{className:"space-y-1",children:[I,t.jsx(le,{type:"time",value:S,onChange:_,disabled:C})]}),e[33]=S,e[34]=_,e[35]=C,e[36]=T):T=e[36];let R;e[37]!==i||e[38]!==n||e[39]!==l.dayOfMonth||e[40]!==l.frequency||e[41]!==l.hour||e[42]!==l.minute||e[43]!==l.weekDay||e[44]!==r?(R=l.frequency==="weekly"?t.jsxs("label",{className:"space-y-1",children:[t.jsx(X,{children:"Day of week"}),t.jsx("select",{className:"h-9 rounded-md border border-input bg-background px-3 text-sm",value:l.weekDay,onChange:A=>n(dt({frequency:"weekly",hour:l.hour,minute:l.minute,weekDay:Number(A.target.value),dayOfMonth:l.dayOfMonth,currentValue:r})),disabled:i,children:Un.map(Fn)})]}):l.frequency==="monthly"?t.jsxs("label",{className:"space-y-1",children:[t.jsx(X,{children:"Day of month"}),t.jsx(le,{type:"number",min:1,max:31,value:l.dayOfMonth,onChange:A=>{const q=Number(A.target.value);!Number.isInteger(q)||q<1||q>31||n(dt({frequency:"monthly",hour:l.hour,minute:l.minute,weekDay:l.weekDay,dayOfMonth:q,currentValue:r}))},disabled:i})]}):t.jsxs("div",{className:"space-y-1",children:[t.jsx(X,{children:"Schedule notes"}),t.jsx("div",{className:"h-9 rounded-md border border-input bg-muted/20 px-3 text-xs text-muted-foreground flex items-center",children:l.frequency==="biweekly"?"Biweekly uses an every-14-days cron approximation.":l.frequency==="custom"?"Edit raw cron directly below.":"Runs in your server timezone."})]}),e[37]=i,e[38]=n,e[39]=l.dayOfMonth,e[40]=l.frequency,e[41]=l.hour,e[42]=l.minute,e[43]=l.weekDay,e[44]=r,e[45]=R):R=e[45];let E;e[46]!==v||e[47]!==T||e[48]!==R?(E=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2",children:[v,T,R]}),e[46]=v,e[47]=T,e[48]=R,e[49]=E):E=e[49];let b;e[50]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(X,{children:"Raw cron expression"}),e[50]=b):b=e[50];let D;e[51]!==n?(D=A=>n(A.target.value),e[51]=n,e[52]=D):D=e[52];let $;e[53]!==i||e[54]!==D||e[55]!==r?($=t.jsxs("label",{className:"space-y-1 block",children:[b,t.jsx(le,{value:r,onChange:D,disabled:i,placeholder:"*/15 * * * *"})]}),e[53]=i,e[54]=D,e[55]=r,e[56]=$):$=e[56];let P;return e[57]!==E||e[58]!==$?(P=t.jsxs("div",{className:"space-y-2",children:[E,$]}),e[57]=E,e[58]=$,e[59]=P):P=e[59],P}function Fn(s){return t.jsx("option",{value:s.value,children:s.label},s.value)}function Bn(s,e){return s.onFailure!==e.onFailure||s.perMcpTimeoutMs!==e.perMcpTimeoutMs||s.perToolTimeoutMs!==e.perToolTimeoutMs||s.maxAgentSteps!==e.maxAgentSteps||s.testPublicOnly!==e.testPublicOnly||s.testPrivateOnly!==e.testPrivateOnly||s.includePendingRequests!==e.includePendingRequests||(s.agentContext??"")!==(e.agentContext??"")||s.schedule!==e.schedule||s.cronExpression!==e.cronExpression}function Qn(){const{settings:s,saveMutation:e}=fs(),r=Mr(),n=Dr(),o=M.useRef(s),[i,a]=M.useState(s),[l,d]=M.useState(!1),[u,m]=M.useState(!1);o.current!==s&&(o.current=s,a(s));const h=Bn(i,s),x=c=>{d(!1),a(p=>({...p,...c}))},f=async()=>{const c=i.cronExpression?.trim()??"";let p=s.scheduleEventId??"";if(i.schedule==="cron"&&c.length>0){const y=c!==(s.cronExpression??"");y&&p&&await n.mutateAsync(p),(y||!p)&&(p=(await r.mutateAsync({cronExpression:c,config:i})).scheduleEventId)}else p&&(await n.mutateAsync(p),p="");const j={...i,cronExpression:c,scheduleEventId:p,agentContext:(i.agentContext??"").trim()};await e.mutateAsync(j),a(j),d(!0),setTimeout(()=>d(!1),3e3)};return t.jsxs(ne,{className:"p-4 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:"QA Configuration"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Configure how the MCP QA agent validates registry entries."})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[h&&t.jsx(F,{className:"bg-amber-500/10 text-amber-600 border-amber-500/20 text-[10px]",children:"Unsaved changes"}),l&&t.jsx(F,{className:"bg-emerald-500/10 text-emerald-600 border-emerald-500/20 text-[10px]",children:"✓ Saved"}),t.jsx(G,{size:"sm",onClick:f,disabled:e.isPending||r.isPending||n.isPending||!h,children:e.isPending||r.isPending||n.isPending?"Saving...":"Save settings"})]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx(Ee,{label:"On failure",hint:"Automatic action to apply when an MCP fails tests in a run."}),t.jsxs("select",{className:"h-9 rounded-md border border-input bg-background px-3 text-sm",value:i.onFailure,onChange:c=>x({onFailure:c.target.value}),children:[t.jsx("option",{value:"none",children:"Do nothing"}),t.jsx("option",{value:"unlisted",children:"Unlist from store (keep in registry)"}),t.jsx("option",{value:"remove_public",children:"Remove from public store"}),t.jsx("option",{value:"remove_private",children:"Remove from private registry"}),t.jsx("option",{value:"remove_all",children:"Remove from all (public + private)"})]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(Ee,{label:"Test scope",hint:"Choose whether tests should run for public items, private items, or both."}),t.jsxs("div",{className:"flex items-center gap-4 rounded-md border border-input px-3 py-2",children:[t.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[t.jsx("input",{type:"checkbox",checked:i.testPublicOnly,onChange:c=>x({testPublicOnly:c.target.checked,testPrivateOnly:c.target.checked?!1:i.testPrivateOnly})}),"Public only"]}),t.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[t.jsx("input",{type:"checkbox",checked:i.testPrivateOnly,onChange:c=>x({testPrivateOnly:c.target.checked,testPublicOnly:c.target.checked?!1:i.testPublicOnly})}),"Private only"]})]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(Ee,{label:"Publish requests",hint:"Include pending publish requests in QA runs to validate them before publishing to the store."}),t.jsx("div",{className:"flex items-center gap-4 rounded-md border border-input px-3 py-2",children:t.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[t.jsx("input",{type:"checkbox",checked:i.includePendingRequests,onChange:c=>x({includePendingRequests:c.target.checked})}),"Include pending requests in tests"]})})]}),t.jsxs("div",{className:"space-y-1 md:col-span-2",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx(Ee,{label:"Additional test context (prompt)",hint:"Extra runtime context passed to the agent, such as valid emails, tenant IDs, or known test entities."}),t.jsxs(G,{size:"sm",variant:"outline",className:"h-7",onClick:()=>m(c=>!c),children:[u?"Hide":"View"," default system prompt"]})]}),t.jsx(bt,{value:i.agentContext??"",onChange:c=>x({agentContext:c.target.value}),placeholder:'Example: Use "my-user@company.com" as a valid email for Google Drive share/create_permission tests.',rows:3}),t.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Use this field for real data required by some tools (valid email, fixed IDs, test environment details, etc)."}),u&&t.jsx("pre",{className:"text-[11px] bg-muted/50 border border-border rounded px-3 py-2 whitespace-pre-wrap max-h-64 overflow-auto",children:kr})]}),t.jsxs("div",{className:"space-y-1 md:col-span-2",children:[t.jsx(Ee,{label:"Schedule",hint:"Set automatic test runs. Manual mode runs only when you click Start QA run."}),t.jsxs("select",{className:"h-9 rounded-md border border-input bg-background px-3 text-sm",value:i.schedule??"manual",onChange:c=>x({schedule:c.target.value}),children:[t.jsx("option",{value:"manual",children:"Manual only"}),t.jsx("option",{value:"cron",children:"Cron schedule"})]}),(i.schedule??"manual")==="cron"&&t.jsx(Ln,{value:i.cronExpression??"",onChange:c=>x({cronExpression:c})})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(Ee,{label:"Per MCP timeout (ms)",hint:"Max total time allowed to validate one MCP."}),t.jsx(le,{type:"number",value:i.perMcpTimeoutMs,onChange:c=>x({perMcpTimeoutMs:Number(c.target.value)})})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(Ee,{label:"Per tool timeout (ms)",hint:"Max time allowed for each individual tool call."}),t.jsx(le,{type:"number",value:i.perToolTimeoutMs,onChange:c=>x({perToolTimeoutMs:Number(c.target.value)})})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(Ee,{label:"Max agent steps",hint:"Maximum number of reasoning/tool steps in Agentic mode."}),t.jsx(le,{type:"number",value:i.maxAgentSteps,onChange:c=>x({maxAgentSteps:Number(c.target.value)}),min:1,max:30})]})]})]})}function Ee(s){const e=Y.c(13),{label:r,hint:n}=s;let o;e[0]!==r?(o=t.jsx(X,{children:r}),e[0]=r,e[1]=o):o=e[1];const i=`About ${r}`;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Ws,{size:14}),e[2]=a):a=e[2];let l;e[3]!==i?(l=t.jsx(Nr,{asChild:!0,children:t.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground transition-colors","aria-label":i,children:a})}),e[3]=i,e[4]=l):l=e[4];let d;e[5]!==n?(d=t.jsx(wr,{side:"top",className:"max-w-72",children:n}),e[5]=n,e[6]=d):d=e[6];let u;e[7]!==l||e[8]!==d?(u=t.jsxs(_r,{children:[l,d]}),e[7]=l,e[8]=d,e[9]=u):u=e[9];let m;return e[10]!==o||e[11]!==u?(m=t.jsxs("div",{className:"flex items-center gap-1.5",children:[o,u]}),e[10]=o,e[11]=u,e[12]=m):m=e[12],m}function Vn(s){switch(s){case"authenticated":return"bg-emerald-500/10 text-emerald-600 border-emerald-500/20";case"needs_auth":return"bg-amber-500/10 text-amber-600 border-amber-500/20";default:return"bg-zinc-500/10 text-zinc-500 border-zinc-500/20"}}function Gn(s){switch(s){case"authenticated":return"Authenticated";case"needs_auth":return"Needs Auth";default:return"Not checked"}}function Kn({entry:s,onAuthChanged:e,failedToolsCount:r,failedResultCount:n}){const[o,i]=M.useState(!1),[a,l]=M.useState(""),[d,u]=M.useState(!1),m=Pr(),{updateMutation:h}=qt(),{org:x}=xe(),f=Se(),c=_e(),p=s.mapping.connection_id,j=s.mapping.auth_status,y=s.item?.title??s.mapping.item_id,N=s.item?.server?.icons?.[0]?.src??null,w=s.item?.is_public??!1,v=s.item?.is_unlisted??!1,I=s.source==="request",S=Pe({queryKey:Q.monitorConnectionAuthProbe(p),queryFn:async()=>Bs({url:`/api/${x.slug}/mcp/${p}`,token:null,orgId:x.id}),staleTime:1e4,retry:1,refetchOnWindowFocus:!1}),_=S.data,C=S.isLoading,T=_?.supportsOAuth??!1,R=_?.hasOAuthToken??!1,E=_?.isServerError??!1,b=_?.isAuthenticated??!1,D=C?"checking":E?"server_error":T?b?R?"oauth_connected":"connected":"oauth_available":b?"connected":"token_required",$=()=>{m.mutate({connectionId:p,authStatus:"authenticated"},{onSuccess:()=>e()})},P=async()=>{i(!0);try{const O=(await S.refetch()).data;if(!O){V.error(`Could not reach "${y}". The remote MCP may be down.`);return}if(O.isAuthenticated){V.success(`"${y}" is reachable. You can re-authenticate if needed.`);return}if(O.isServerError){V.error(`Server error for "${y}". The remote MCP may be down.`);return}if(!O.supportsOAuth){V.warning(`"${y}" does not support OAuth. Use the Token field to paste an API key.`);return}V.info(`Opening authentication window for "${y}"...`);const z=await Qs({connectionId:p,orgSlug:x.slug,clientName:`MCP Test - ${y}`,timeout:18e4,scope:"offline_access"});if(z.error){V.error(`OAuth failed for "${y}": ${z.error}`);return}z.tokenInfo?(await fetch(`/api/${x.slug}/connections/${p}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:z.tokenInfo.accessToken,refreshToken:z.tokenInfo.refreshToken,expiresIn:z.tokenInfo.expiresIn,scope:z.tokenInfo.scope,clientId:z.tokenInfo.clientId,clientSecret:z.tokenInfo.clientSecret,tokenEndpoint:z.tokenInfo.tokenEndpoint})})).ok||z.token&&await A(z.token):z.token&&await A(z.token),V.success(`"${y}" authenticated!`),$(),await S.refetch()}catch(g){console.error("[MonitorConnectionsPanel] Auth error:",g),V.error(`Error: ${g instanceof Error?g.message:String(g)}`)}finally{i(!1)}},A=async g=>{await f.call("COLLECTION_CONNECTIONS_UPDATE",{id:p,data:{connection_token:g}})},q=async()=>{if(!a.trim()){V.error("Token cannot be empty.");return}i(!0);try{await A(a),V.success(`Token saved for "${y}"!`),u(!1),l(""),$(),Vs(p),c.invalidateQueries({predicate:g=>g.queryKey[1]===Gs&&g.queryKey[3]===p}),await S.refetch()}catch(g){V.error(`Error saving token: ${g instanceof Error?g.message:String(g)}`)}finally{i(!1)}},U=j==="authenticated"&&!R&&!d&&a.length===0,K=async g=>{if(I){V.info("Visibility controls are available only for store items.");return}if(!s.item){V.error("Registry item not found for this connection.");return}try{await h.mutateAsync({id:s.item.id,data:g}),V.success("Visibility updated"),e()}catch(O){V.error(O instanceof Error?O.message:"Failed to update visibility")}};return t.jsxs(ne,{className:"p-3 space-y-3 h-full",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[t.jsx("div",{className:"size-10 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0 flex items-center justify-center",children:N?t.jsx("img",{src:N,alt:y,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:y.charAt(0).toUpperCase()})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:y}),t.jsx("p",{className:"text-xs text-muted-foreground break-all",children:s.remoteUrl??"-"}),t.jsxs("div",{className:"mt-1 flex items-center gap-1.5 flex-wrap",children:[t.jsx(F,{variant:"outline",className:Z("text-[10px]",Vn(j)),children:Gn(j)}),t.jsx(F,{variant:w?"default":"secondary",className:"text-[10px]",children:w?"Public":"Not public"}),t.jsx(F,{variant:"outline",className:"text-[10px]",children:I?"Request":"Store"}),t.jsxs(F,{variant:"outline",className:Z("text-[10px]",D==="server_error"?"border-destructive/40 text-destructive":D==="oauth_connected"?"border-emerald-500/30 text-emerald-600":D==="oauth_available"?"border-sky-500/30 text-sky-600":D==="token_required"?"border-amber-500/30 text-amber-600":"text-muted-foreground"),children:[D==="checking"&&"Checking auth...",D==="server_error"&&"Server error",D==="oauth_connected"&&"OAuth connected",D==="oauth_available"&&"OAuth available",D==="token_required"&&"Token/manual auth",D==="connected"&&"Connected"]}),v&&t.jsx(F,{variant:"outline",className:"text-[10px]",children:"Hidden in private"}),(n>0||r>0)&&t.jsxs(F,{variant:"destructive",className:"text-[10px]",children:[n," failed MCP / ",r," failed tools"]})]})]})]}),t.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:t.jsxs(mt,{children:[t.jsx(ut,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:t.jsx($t,{size:16})})}),t.jsx(xt,{align:"end",children:I?t.jsx(we,{disabled:!0,children:"Request item (no store visibility controls)"}):t.jsxs(t.Fragment,{children:[t.jsx(we,{onClick:()=>K({is_public:!1}),children:"Hide from public store"}),t.jsx(we,{onClick:()=>K({is_unlisted:!0}),children:"Hide from private store"}),t.jsx(we,{onClick:()=>K({is_public:!0,is_unlisted:!1}),children:"Show in both stores"})]})})]})})]}),t.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 flex-wrap",children:[T&&t.jsx(G,{size:"sm",onClick:P,disabled:o,children:o?"...":R?"Re-auth OAuth":"OAuth"}),t.jsx(G,{size:"sm",variant:"outline",onClick:()=>S.refetch(),disabled:o||C,children:C?"Checking...":"Re-check"})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Token/API key (for MCPs that require manual auth)"}),U?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-8 px-3 flex items-center rounded-md border border-border bg-muted/50 text-muted-foreground font-mono text-xs",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>u(!0),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted",title:"Replace token",children:"Edit"})]}):t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(le,{type:"password",placeholder:"Paste API token / key...",value:a,onChange:g=>l(g.target.value),className:"h-8 text-xs flex-1",onKeyDown:g=>{g.key==="Enter"&&q()}}),t.jsx(G,{size:"sm",className:"h-8 text-xs",onClick:q,disabled:o||!a.trim(),children:"Save"}),t.jsx(G,{size:"sm",variant:"ghost",className:"h-8 text-xs",onClick:()=>{u(!1),l("")},children:"✕"})]})]})]})}function Yn(){const s=Y.c(55),e=ps(),n=Nt("completed").data?.items?.[0],o=nt(n?.id,void 0,n?.status),i=Ir(),[a,l]=M.useState("all");let d,u,m,h,x,f;if(s[0]!==e||s[1]!==o.data?.items||s[2]!==a||s[3]!==i){const j=e.data?.items??[];let y;s[10]!==o.data?.items?(y=(o.data?.items??[]).reduce(Jn,{}),s[10]=o.data?.items,s[11]=y):y=s[11];const N=y;let w;s[12]!==a?(w=se=>a==="all"?!0:se.source===a,s[12]=a,s[13]=w):w=s[13];const v=j.filter(w);d=ne,x="p-4 space-y-3";let I,S,_,C;s[14]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("h3",{className:"text-sm font-semibold",children:"QA Connections"}),_=t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"We auto-detect auth type. Use OAuth when available, or always paste a Token/API key for manual auth MCPs."}),C=t.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"Listing tools alone does not imply authenticated status."}),I=t.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:"Cards show MCP icon, auth status, and latest failed test counters."}),s[14]=I,s[15]=S,s[16]=_,s[17]=C):(I=s[14],S=s[15],_=s[16],C=s[17]);const T=a==="all"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let R;s[18]!==T?(R=Z("px-2.5 py-1 text-xs rounded-md transition-colors",T),s[18]=T,s[19]=R):R=s[19];let E;s[20]===Symbol.for("react.memo_cache_sentinel")?(E=()=>l("all"),s[20]=E):E=s[20];let b;s[21]!==R?(b=t.jsx("button",{type:"button",className:R,onClick:E,children:"All"}),s[21]=R,s[22]=b):b=s[22];const D=a==="store"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let $;s[23]!==D?($=Z("px-2.5 py-1 text-xs rounded-md transition-colors",D),s[23]=D,s[24]=$):$=s[24];let P;s[25]===Symbol.for("react.memo_cache_sentinel")?(P=()=>l("store"),s[25]=P):P=s[25];let A;s[26]!==$?(A=t.jsx("button",{type:"button",className:$,onClick:P,children:"Store"}),s[26]=$,s[27]=A):A=s[27];const q=a==="request"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let U;s[28]!==q?(U=Z("px-2.5 py-1 text-xs rounded-md transition-colors",q),s[28]=q,s[29]=U):U=s[29];let K;s[30]===Symbol.for("react.memo_cache_sentinel")?(K=()=>l("request"),s[30]=K):K=s[30];let g;s[31]!==U?(g=t.jsx("button",{type:"button",className:U,onClick:K,children:"Requests"}),s[31]=U,s[32]=g):g=s[32];let O;s[33]!==b||s[34]!==A||s[35]!==g?(O=t.jsxs("div",{children:[S,_,C,I,t.jsxs("div",{className:"mt-2 inline-flex rounded-lg border border-border p-0.5",children:[b,A,g]})]}),s[33]=b,s[34]=A,s[35]=g,s[36]=O):O=s[36];let z;s[37]!==i?(z=()=>{i.mutate(void 0,{onSuccess:Wn,onError:Hn})},s[37]=i,s[38]=z):z=s[38];const te=i.isPending?"Syncing...":"Sync";let ee;s[39]!==i.isPending||s[40]!==z||s[41]!==te?(ee=t.jsx(G,{size:"sm",variant:"outline",onClick:z,disabled:i.isPending,children:te}),s[39]=i.isPending,s[40]=z,s[41]=te,s[42]=ee):ee=s[42],s[43]!==O||s[44]!==ee?(f=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[O,ee]}),s[43]=O,s[44]=ee,s[45]=f):f=s[45],u="space-y-2",m=v.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground text-center py-3",children:'No QA connections for this filter. Click "Sync" to create mappings from store items and pending requests.'}),h=v.length>0&&t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:v.map(se=>{const re=N[se.mapping.item_id]??{failedTools:0,failedResults:0};return t.jsx(Kn,{entry:se,onAuthChanged:()=>e.refetch(),failedToolsCount:re.failedTools,failedResultCount:re.failedResults},se.mapping.id)})}),s[0]=e,s[1]=o.data?.items,s[2]=a,s[3]=i,s[4]=d,s[5]=u,s[6]=m,s[7]=h,s[8]=x,s[9]=f}else d=s[4],u=s[5],m=s[6],h=s[7],x=s[8],f=s[9];let c;s[46]!==u||s[47]!==m||s[48]!==h?(c=t.jsxs("div",{className:u,children:[m,h]}),s[46]=u,s[47]=m,s[48]=h,s[49]=c):c=s[49];let p;return s[50]!==d||s[51]!==x||s[52]!==f||s[53]!==c?(p=t.jsxs(d,{className:x,children:[f,c]}),s[50]=d,s[51]=x,s[52]=f,s[53]=c,s[54]=p):p=s[54],p}function Hn(s){return V.error(`Sync failed: ${s.message}`)}function Wn(){return V.success("Connections synced (store + pending requests)")}function Jn(s,e){const r=s[e.item_id]??{failedTools:0,failedResults:0},n=e.tool_results.filter(Zn).length;return r.failedTools=r.failedTools+n,(e.status==="failed"||e.status==="error")&&(r.failedResults=r.failedResults+1),s[e.item_id]=r,s}function Zn(s){return!s.success}function ws(s){switch(s){case"running":return"bg-blue-500/10 text-blue-600 border-blue-500/20";case"completed":return"bg-emerald-500/10 text-emerald-600 border-emerald-500/20";case"failed":return"bg-red-500/10 text-red-600 border-red-500/20";case"cancelled":return"bg-zinc-500/10 text-zinc-500 border-zinc-500/20";case"pending":return"bg-amber-500/10 text-amber-600 border-amber-500/20";default:return""}}function _s(s,e){if(!s)return null;const r=e?new Date(e).getTime():Date.now(),n=new Date(s).getTime(),o=r-n;return o<1e3?`${o}ms`:o<6e4?`${(o/1e3).toFixed(1)}s`:`${Math.floor(o/6e4)}m ${Math.round(o%6e4/1e3)}s`}function Cs(s){const e=new Map;for(const r of s)e.has(r.toolName)&&e.delete(r.toolName),e.set(r.toolName,r);return Array.from(e.values())}function Xn(s){return s.total_items?Math.min(100,Math.round(s.tested_items/s.total_items*100)):0}function ei(s){if(!s)return null;const e=s.match(/Not executed tools \((\d+)\/(\d+)\):/i);if(!e)return null;const r=Number(e[2]);return Number.isFinite(r)&&r>=0?r:null}function ti(s){const e=Y.c(57),{result:r,index:n,icon:o}=s,[i,a]=M.useState(!1);let l;if(e[0]!==i||e[1]!==o||e[2]!==n||e[3]!==r.action_taken||e[4]!==r.agent_summary||e[5]!==r.connection_ok||e[6]!==r.duration_ms||e[7]!==r.error_message||e[8]!==r.id||e[9]!==r.item_title||e[10]!==r.status||e[11]!==r.tool_results||e[12]!==r.tools_listed){const d=Cs(r.tool_results),u=d.every(ii),m=d.filter(ni),h=m.filter(ri).length,x=m.filter(si).length,f=m.length>0,c=m.length;let p;e[14]!==r.agent_summary?(p=ei(r.agent_summary),e[14]=r.agent_summary,e[15]=p):p=e[15];const j=p,y=Math.max(d.length,j??0),N=y>0?`${c}/${y} tools tested`:"0 tools";let w;e[16]!==i?(w=()=>a(!i),e[16]=i,e[17]=w):w=e[17];const v=n+1;let I;e[18]!==v?(I=t.jsx("span",{className:"text-muted-foreground w-5 text-right shrink-0",children:v}),e[18]=v,e[19]=I):I=e[19];let S;e[20]!==o||e[21]!==r.item_title?(S=t.jsx("div",{className:"size-5 rounded border border-border bg-muted/20 overflow-hidden shrink-0 flex items-center justify-center",children:o?t.jsx("img",{src:o,alt:r.item_title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-[9px] font-semibold text-muted-foreground",children:r.item_title.charAt(0).toUpperCase()})}),e[20]=o,e[21]=r.item_title,e[22]=S):S=e[22];const _=r.status==="passed"?"text-emerald-600":r.status==="needs_auth"?"text-amber-600":"text-red-600";let C;e[23]!==_?(C=Z("shrink-0",_),e[23]=_,e[24]=C):C=e[24];const T=r.status==="passed"?"✓":r.status==="needs_auth"?"🔑":"✗";let R;e[25]!==C||e[26]!==T?(R=t.jsx("span",{className:C,children:T}),e[25]=C,e[26]=T,e[27]=R):R=e[27];let E;e[28]!==r.item_title?(E=t.jsx("span",{className:"font-medium truncate flex-1 min-w-0",children:r.item_title}),e[28]=r.item_title,e[29]=E):E=e[29];let b;e[30]!==r.duration_ms?(b=t.jsxs("span",{className:"text-muted-foreground shrink-0",children:[r.duration_ms,"ms"]}),e[30]=r.duration_ms,e[31]=b):b=e[31];const D=r.status==="passed"?"text-emerald-600 border-emerald-500/20":r.status==="needs_auth"?"text-amber-600 border-amber-500/20":"text-red-600 border-red-500/20";let $;e[32]!==D?($=Z("text-[9px] capitalize shrink-0",D),e[32]=D,e[33]=$):$=e[33];let P;e[34]!==r.status?(P=r.status.replace("_"," "),e[34]=r.status,e[35]=P):P=e[35];let A;e[36]!==$||e[37]!==P?(A=t.jsx(F,{variant:"outline",className:$,children:P}),e[36]=$,e[37]=P,e[38]=A):A=e[38];let q;e[39]!==r.connection_ok?(q=r.connection_ok?t.jsx("span",{className:"text-[10px] text-emerald-600 shrink-0",children:"conn✓"}):t.jsx("span",{className:"text-[10px] text-red-600 shrink-0",children:"conn✗"}),e[39]=r.connection_ok,e[40]=q):q=e[40];const U=r.tools_listed&&t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:f?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-emerald-600",children:[h,"✓"]})," ",t.jsxs("span",{className:Z(x>0?"text-red-600":""),children:[x,"✗"]})]}):u&&d.length>0?t.jsxs("span",{children:[d.length," tools found"]}):"no tools"});let K;e[41]!==N?(K=t.jsx(F,{variant:"outline",className:"text-[9px] shrink-0",children:N}),e[41]=N,e[42]=K):K=e[42];const g=i?"▲":"▼";let O;e[43]!==g?(O=t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:g}),e[43]=g,e[44]=O):O=e[44];let z;e[45]!==R||e[46]!==E||e[47]!==b||e[48]!==A||e[49]!==q||e[50]!==U||e[51]!==K||e[52]!==O||e[53]!==w||e[54]!==I||e[55]!==S?(z=t.jsxs("button",{type:"button",className:"w-full text-left flex items-center gap-2 px-2 py-1.5 text-xs hover:bg-muted/30 transition-colors",onClick:w,children:[I,S,R,E,b,A,q,U,K,O]}),e[45]=R,e[46]=E,e[47]=b,e[48]=A,e[49]=q,e[50]=U,e[51]=K,e[52]=O,e[53]=w,e[54]=I,e[55]=S,e[56]=z):z=e[56],l=t.jsxs("div",{className:"rounded border border-border overflow-hidden",children:[z,i&&t.jsxs("div",{className:"border-t border-border px-3 py-2 space-y-2 bg-muted/10",children:[r.error_message&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-red-600",children:"Error"}),t.jsx("pre",{className:"text-[11px] bg-red-500/5 border border-red-500/10 rounded px-2 py-1.5 whitespace-pre-wrap break-all text-red-700 max-h-20 overflow-auto",children:r.error_message})]}),t.jsxs("div",{className:"flex items-center gap-3 text-[10px] flex-wrap",children:[t.jsxs("span",{children:["Connection:"," ",t.jsx("span",{className:Z(r.connection_ok?"text-emerald-600":"text-red-600"),children:r.connection_ok?"OK":"Failed"})]}),t.jsxs("span",{children:["Tools listed:"," ",t.jsx("span",{className:Z(r.tools_listed?"text-emerald-600":"text-red-600"),children:r.tools_listed?"Yes":"No"})]}),r.action_taken!=="none"&&t.jsxs(F,{variant:"destructive",className:"text-[9px] px-1.5 py-0",children:["action: ",r.action_taken]})]}),f?t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"text-[10px] font-semibold text-muted-foreground",children:["Tools tested: ",h," passed, ",x," failed"]}),t.jsx("div",{className:"space-y-0.5",children:m.map((te,ee)=>t.jsx(li,{tool:te},`${r.id}-${te.toolName}-${ee}`))})]}):u&&d.length>0?t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"text-[10px] font-semibold text-muted-foreground",children:["Tools discovered (",d.length,") - not individually tested (health-check mode)"]}),t.jsx("div",{className:"flex flex-wrap gap-1",children:d.map((te,ee)=>t.jsx(F,{variant:"outline",className:"text-[10px] font-mono",children:te.toolName},`${r.id}-${te.toolName}-${ee}`))})]}):r.tools_listed?t.jsx("p",{className:"text-[10px] text-muted-foreground italic",children:"No tools found on this server."}):null,r.agent_summary&&t.jsx("p",{className:"text-[11px] bg-muted/50 rounded px-2 py-1.5",children:r.agent_summary})]})]}),e[0]=i,e[1]=o,e[2]=n,e[3]=r.action_taken,e[4]=r.agent_summary,e[5]=r.connection_ok,e[6]=r.duration_ms,e[7]=r.error_message,e[8]=r.id,e[9]=r.item_title,e[10]=r.status,e[11]=r.tool_results,e[12]=r.tools_listed,e[13]=l}else l=e[13];return l}function si(s){return!s.success}function ri(s){return s.success}function ni(s){return s.outputPreview!=="health_check: not called"}function ii(s){return s.outputPreview==="health_check: not called"}function li(s){const e=Y.c(30),{tool:r}=s,[n,o]=M.useState(!1);let i;e[0]!==n?(i=()=>o(!n),e[0]=n,e[1]=i):i=e[1];const a=r.success?"text-emerald-600":"text-red-600";let l;e[2]!==a?(l=Z("font-bold",a),e[2]=a,e[3]=l):l=e[3];const d=r.success?"✓":"✗";let u;e[4]!==l||e[5]!==d?(u=t.jsx("span",{className:l,children:d}),e[4]=l,e[5]=d,e[6]=u):u=e[6];let m;e[7]!==r.toolName?(m=t.jsx("span",{className:"font-mono truncate flex-1",children:r.toolName}),e[7]=r.toolName,e[8]=m):m=e[8];let h;e[9]!==r.durationMs?(h=t.jsxs("span",{className:"text-muted-foreground shrink-0",children:[r.durationMs,"ms"]}),e[9]=r.durationMs,e[10]=h):h=e[10];let x;e[11]!==r.error?(x=r.error&&t.jsx("span",{className:"text-red-500 truncate max-w-28",title:r.error,children:r.error}),e[11]=r.error,e[12]=x):x=e[12];const f=n?"▲":"▼";let c;e[13]!==f?(c=t.jsx("span",{className:"text-muted-foreground",children:f}),e[13]=f,e[14]=c):c=e[14];let p;e[15]!==i||e[16]!==c||e[17]!==u||e[18]!==m||e[19]!==h||e[20]!==x?(p=t.jsxs("button",{type:"button",className:"w-full text-left flex items-center gap-2 px-2 py-1 text-[11px] hover:bg-muted/30 transition-colors",onClick:i,children:[u,m,h,x,c]}),e[15]=i,e[16]=c,e[17]=u,e[18]=m,e[19]=h,e[20]=x,e[21]=p):p=e[21];let j;e[22]!==n||e[23]!==r.error||e[24]!==r.input||e[25]!==r.outputPreview?(j=n&&t.jsxs("div",{className:"border-t border-border px-2 py-1.5 space-y-1 bg-muted/10 text-[11px]",children:[r.error&&t.jsx("pre",{className:"bg-red-500/5 border border-red-500/10 rounded px-2 py-1 whitespace-pre-wrap break-all text-red-700 max-h-20 overflow-auto",children:r.error}),r.input&&Object.keys(r.input).length>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:"Input"}),t.jsx("pre",{className:"bg-muted/50 rounded px-2 py-1 whitespace-pre-wrap break-all max-h-16 overflow-auto",children:JSON.stringify(r.input,null,2)})]}),r.outputPreview&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:"Output"}),t.jsx("pre",{className:"bg-muted/50 rounded px-2 py-1 whitespace-pre-wrap break-all max-h-16 overflow-auto",children:r.outputPreview})]})]}),e[22]=n,e[23]=r.error,e[24]=r.input,e[25]=r.outputPreview,e[26]=j):j=e[26];let y;return e[27]!==p||e[28]!==j?(y=t.jsxs("div",{className:"rounded border border-border overflow-hidden",children:[p,j]}),e[27]=p,e[28]=j,e[29]=y):y=e[29],y}function ai({activeRunId:s,onRunChange:e}){const{settings:r}=fs(),[n,o]=M.useState(null),[i,a]=M.useState(!1),l=M.useRef(0),d=M.useRef(null),u=Sr(),m=Rr(),h=Ut(s),x=Nt(),f=ps(),c=h.data?.run??null,p=c?.status,j=c?.config_snapshot?.monitorMode??c?.config_snapshot?.testMode,y=nt(s,void 0,p),N=(x.data?.items??[]).find(b=>b.status==="running"),w=x.data?.items?.[0]?.id;!s&&w&&d.current!==w&&(d.current=w,queueMicrotask(()=>{e(w)}));const v=async()=>{const b=Date.now();if(b-l.current<1e3)return;l.current=b;const D=n??r.monitorMode,$=await u.mutateAsync({...r,monitorMode:D});e($.run.id)},I=async()=>{if(N&&N.id!==s&&N.status==="running"){a(!0);return}await v()},S=async()=>{s&&await m.mutateAsync(s)},_=c?.status==="running",C=c?_s(c.started_at,c.finished_at):null,T=y.data?.items??[],R=(f.data?.items??[]).reduce((b,D)=>(b[D.mapping.item_id]=D.item?.server?.icons?.[0]?.src??null,b),{}),E=n??r.monitorMode;return t.jsxs("div",{className:"space-y-4 min-w-0",children:[t.jsxs("div",{className:"space-y-4 min-w-0",children:[t.jsxs(ne,{className:"p-4 space-y-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3 flex-wrap",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:"Current QA Run"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Start a full QA validation run and track results in real time."})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[N&&N.id!==s&&t.jsxs(F,{variant:"outline",className:"text-[10px]",children:["Run in progress: ",N.id.slice(0,8)]}),t.jsxs(G,{size:"sm",onClick:I,disabled:u.isPending||_,className:"gap-1.5",children:[t.jsx(Cr,{size:14}),u.isPending?"Starting...":N&&N.id!==s?"Start another run":"Start QA run"]}),t.jsxs(G,{size:"sm",variant:"outline",onClick:S,disabled:!s||!_,className:"gap-1.5",children:[t.jsx(Js,{size:14}),"Cancel"]})]})]}),t.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[t.jsxs("label",{className:"space-y-1",children:[t.jsx("span",{className:"text-[11px] text-muted-foreground",children:"QA mode"}),t.jsxs("select",{className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm",value:E,onChange:b=>o(b.target.value),disabled:_,children:[t.jsx("option",{value:"health_check",children:"Health check"}),t.jsx("option",{value:"tool_call",children:"Tool call"}),t.jsx("option",{value:"full_agent",children:"Agentic (LLM model)"})]})]}),t.jsxs("label",{className:"space-y-1",children:[t.jsx("span",{className:"text-[11px] text-muted-foreground",children:"QA run history (pick a previous run)"}),t.jsxs("select",{className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm",value:s??"",onChange:b=>e(b.target.value||void 0),children:[t.jsx("option",{value:"",children:"Auto-select latest run"}),(x.data?.items??[]).map(b=>t.jsxs("option",{value:b.id,children:[new Date(b.created_at).toLocaleString()," -"," ",b.status]},b.id))]})]})]}),t.jsx("p",{className:"text-[11px] text-muted-foreground rounded-md bg-muted/30 px-2.5 py-2",children:E==="health_check"?"Checks connectivity and tool listing only — no tool calls are made.":E==="tool_call"?"Calls each tool with empty inputs to verify it responds without errors.":"Uses an LLM model to execute chained tool calls and validate outputs."}),c?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[t.jsx(F,{className:Z("capitalize",ws(c.status),c.status==="running"?"animate-pulse":""),children:c.status}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[c.tested_items,"/",c.total_items," tested"]}),C&&t.jsx("span",{className:"text-xs text-muted-foreground",children:C}),_&&c.current_item_id&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate max-w-64",children:["QA on:"," ",t.jsx("span",{className:"font-mono",children:c.current_item_id})]})]}),t.jsx("div",{className:"h-2.5 rounded-full bg-muted overflow-hidden",children:t.jsx("div",{className:Z("h-full transition-all duration-500",c.failed_items>0?"bg-orange-500":"bg-emerald-500",_?"animate-pulse":""),style:{width:`${Xn(c)}%`}})}),t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:[t.jsxs(ne,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-emerald-600",children:"Passed"}),t.jsx("p",{className:"text-lg font-bold text-emerald-600",children:c.passed_items})]}),t.jsxs(ne,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-red-600",children:"Failed"}),t.jsx("p",{className:"text-lg font-bold text-red-600",children:c.failed_items})]}),t.jsxs(ne,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Skipped"}),t.jsx("p",{className:"text-lg font-bold",children:c.skipped_items})]}),t.jsxs(ne,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Total"}),t.jsx("p",{className:"text-lg font-bold",children:c.total_items})]})]})]}):t.jsx("p",{className:"text-xs text-muted-foreground",children:"No run selected yet. Start a new run to begin."})]}),t.jsxs(ne,{className:"p-4 space-y-2 min-h-[360px]",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsxs("div",{children:[t.jsxs("h3",{className:"text-sm font-semibold",children:["QA results log (",T.length,")"]}),t.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Live per-MCP test output for the selected run."})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[_&&t.jsx(F,{className:"bg-blue-500/10 text-blue-600 border-blue-500/20 animate-pulse",children:"run in progress"}),c&&t.jsxs(F,{variant:"outline",className:"text-[10px]",children:["progress: ",c.tested_items," of ",c.total_items," MCPs"]}),j&&t.jsxs(F,{variant:"outline",className:"text-[10px]",children:["mode: ",j.replace("_"," ")]})]})]}),T.length===0?t.jsx("div",{className:"h-[280px] rounded border border-dashed border-border flex items-center justify-center text-xs text-muted-foreground",children:"No results yet. Start a run to see live logs here."}):t.jsx("div",{ref:b=>{b&&_&&b.scrollHeight-b.scrollTop-b.clientHeight<120&&requestAnimationFrame(()=>{b.scrollTop=b.scrollHeight})},className:"space-y-1 max-h-[60vh] overflow-auto pr-1",children:T.map((b,D)=>t.jsx(ti,{result:b,index:D,icon:R[b.item_id]},b.id))})]})]}),t.jsx(st,{open:i,onOpenChange:a,children:t.jsxs(tt,{children:[t.jsxs(We,{children:[t.jsx(He,{children:"Start another test run?"}),t.jsxs(Je,{children:["There is already a run in progress",N?` (${N.id})`:"",". Starting another run may increase database load and slow down both executions."]})]}),t.jsxs(et,{children:[t.jsx(Ze,{children:"Cancel"}),t.jsx(Xe,{onClick:()=>{a(!1),v()},children:"Start anyway"})]})]})})]})}function ks(s){switch(s){case"passed":return"bg-emerald-500/10 text-emerald-600 border-emerald-500/20";case"failed":return"bg-red-500/10 text-red-600 border-red-500/20";case"error":return"bg-orange-500/10 text-orange-600 border-orange-500/20";case"needs_auth":return"bg-amber-500/10 text-amber-600 border-amber-500/20";case"skipped":return"bg-zinc-500/10 text-zinc-500 border-zinc-500/20";default:return""}}function oi(s){switch(s){case"passed":return"✓";case"failed":return"✗";case"error":return"⚠";case"needs_auth":return"🔑";case"skipped":return"⏭";default:return"?"}}function ci(s){const e=Y.c(27),{tool:r}=s,[n,o]=M.useState(!1);let i;e[0]!==n?(i=()=>o(!n),e[0]=n,e[1]=i):i=e[1];const a=r.success?"text-emerald-600":"text-red-600";let l;e[2]!==a?(l=Z("text-xs font-bold",a),e[2]=a,e[3]=l):l=e[3];const d=r.success?"✓":"✗";let u;e[4]!==l||e[5]!==d?(u=t.jsx("span",{className:l,children:d}),e[4]=l,e[5]=d,e[6]=u):u=e[6];let m;e[7]!==r.toolName?(m=t.jsx("span",{className:"text-xs font-mono truncate flex-1",children:r.toolName}),e[7]=r.toolName,e[8]=m):m=e[8];let h;e[9]!==r.durationMs?(h=t.jsxs("span",{className:"text-[10px] text-muted-foreground shrink-0",children:[r.durationMs,"ms"]}),e[9]=r.durationMs,e[10]=h):h=e[10];const x=n?"▲":"▼";let f;e[11]!==x?(f=t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x}),e[11]=x,e[12]=f):f=e[12];let c;e[13]!==i||e[14]!==u||e[15]!==m||e[16]!==h||e[17]!==f?(c=t.jsxs("button",{type:"button",className:"w-full text-left px-3 py-2 flex items-center gap-2 hover:bg-muted/30 transition-colors",onClick:i,children:[u,m,h,f]}),e[13]=i,e[14]=u,e[15]=m,e[16]=h,e[17]=f,e[18]=c):c=e[18];let p;e[19]!==n||e[20]!==r.error||e[21]!==r.input||e[22]!==r.outputPreview?(p=n&&t.jsxs("div",{className:"border-t border-border px-3 py-2 space-y-1.5 bg-muted/20",children:[r.error&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-red-600",children:"Error"}),t.jsx("pre",{className:"text-[11px] bg-red-500/5 border border-red-500/10 rounded px-2 py-1.5 whitespace-pre-wrap break-all text-red-700",children:r.error})]}),r.input&&Object.keys(r.input).length>0&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:"Input"}),t.jsx("pre",{className:"text-[11px] bg-muted/50 rounded px-2 py-1.5 whitespace-pre-wrap break-all max-h-24 overflow-auto",children:JSON.stringify(r.input,null,2)})]}),r.outputPreview&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:"Output preview"}),t.jsx("pre",{className:"text-[11px] bg-muted/50 rounded px-2 py-1.5 whitespace-pre-wrap break-all max-h-24 overflow-auto",children:r.outputPreview})]}),!r.error&&!r.outputPreview&&(!r.input||Object.keys(r.input).length===0)&&t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"No additional details."})]}),e[19]=n,e[20]=r.error,e[21]=r.input,e[22]=r.outputPreview,e[23]=p):p=e[23];let j;return e[24]!==c||e[25]!==p?(j=t.jsxs("div",{className:"rounded border border-border",children:[c,p]}),e[24]=c,e[25]=p,e[26]=j):j=e[26],j}function di(s){const e=Y.c(52),{result:r}=s,[n,o]=M.useState(r.status!=="passed");let i;if(e[0]!==n||e[1]!==r.action_taken||e[2]!==r.agent_summary||e[3]!==r.connection_ok||e[4]!==r.duration_ms||e[5]!==r.error_message||e[6]!==r.id||e[7]!==r.item_title||e[8]!==r.status||e[9]!==r.tool_results||e[10]!==r.tools_listed){const a=Cs(r.tool_results),l=a.every(hi),d=a.filter(xi),u=d.filter(mi).length,m=d.filter(ui).length,h=d.length>0;let x;e[12]!==n?(x=()=>o(!n),e[12]=n,e[13]=x):x=e[13];let f;e[14]!==r.status?(f=oi(r.status),e[14]=r.status,e[15]=f):f=e[15];let c;e[16]!==f?(c=t.jsx("span",{className:"text-base shrink-0",children:f}),e[16]=f,e[17]=c):c=e[17];let p;e[18]!==r.item_title?(p=t.jsx("p",{className:"text-sm font-medium truncate",children:r.item_title}),e[18]=r.item_title,e[19]=p):p=e[19];let j;e[20]!==r.duration_ms?(j=t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[r.duration_ms,"ms"]}),e[20]=r.duration_ms,e[21]=j):j=e[21];const y=r.connection_ok?"✓":"✗";let N;e[22]!==y?(N=t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["conn: ",y]}),e[22]=y,e[23]=N):N=e[23];const w=r.tools_listed?"✓":"✗";let v;e[24]!==w?(v=t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["tools listed: ",w]}),e[24]=w,e[25]=v):v=e[25];const I=a.length>0&&t.jsx("span",{className:"text-[10px] text-muted-foreground",children:h?t.jsxs(t.Fragment,{children:["tools: ",u,"✓ ",m,"✗"]}):t.jsxs(t.Fragment,{children:[a.length," tools found"]})});let S;e[26]!==r.action_taken?(S=r.action_taken!=="none"&&t.jsxs(F,{variant:"destructive",className:"text-[9px] px-1.5 py-0",children:["action: ",r.action_taken]}),e[26]=r.action_taken,e[27]=S):S=e[27];let _;e[28]!==v||e[29]!==I||e[30]!==S||e[31]!==j||e[32]!==N?(_=t.jsxs("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[j,N,v,I,S]}),e[28]=v,e[29]=I,e[30]=S,e[31]=j,e[32]=N,e[33]=_):_=e[33];let C;e[34]!==_||e[35]!==p?(C=t.jsxs("div",{className:"min-w-0 flex-1",children:[p,_]}),e[34]=_,e[35]=p,e[36]=C):C=e[36];let T;e[37]!==r.status?(T=Z("capitalize shrink-0",ks(r.status)),e[37]=r.status,e[38]=T):T=e[38];let R;e[39]!==r.status?(R=r.status.replace("_"," "),e[39]=r.status,e[40]=R):R=e[40];let E;e[41]!==T||e[42]!==R?(E=t.jsx(F,{className:T,children:R}),e[41]=T,e[42]=R,e[43]=E):E=e[43];const b=n?"▲":"▼";let D;e[44]!==b?(D=t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:b}),e[44]=b,e[45]=D):D=e[45];let $;e[46]!==C||e[47]!==E||e[48]!==D||e[49]!==x||e[50]!==c?($=t.jsxs("button",{type:"button",className:"w-full text-left px-4 py-3 flex items-center gap-3 hover:bg-muted/30 transition-colors",onClick:x,children:[c,C,E,D]}),e[46]=C,e[47]=E,e[48]=D,e[49]=x,e[50]=c,e[51]=$):$=e[51],i=t.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[$,n&&t.jsxs("div",{className:"border-t border-border px-4 py-3 space-y-2 bg-muted/10",children:[t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:[t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Connection"}),t.jsx("p",{className:Z("text-xs font-medium",r.connection_ok?"text-emerald-600":"text-red-600"),children:r.connection_ok?"Connected":"Failed"})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Tools Listed"}),t.jsx("p",{className:Z("text-xs font-medium",r.tools_listed?"text-emerald-600":"text-red-600"),children:r.tools_listed?`Yes (${a.length})`:"No"})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Duration"}),t.jsxs("p",{className:"text-xs font-medium",children:[r.duration_ms,"ms"]})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Action Taken"}),t.jsx("p",{className:"text-xs font-medium capitalize",children:r.action_taken.replace(/_/g," ")})]})]}),r.error_message&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-red-600",children:"Error Message"}),t.jsx("pre",{className:"text-xs bg-red-500/5 border border-red-500/10 rounded px-3 py-2 whitespace-pre-wrap break-all text-red-700",children:r.error_message})]}),h?t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"text-[10px] font-semibold text-muted-foreground",children:["Tool Results (",u," passed, ",m," failed)"]}),t.jsx("div",{className:"space-y-1",children:d.map((P,A)=>t.jsx(ci,{tool:P},`${r.id}-${P.toolName}-${A}`))})]}):l&&a.length>0?t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"text-[10px] font-semibold text-muted-foreground",children:["Tools discovered (",a.length,") — not individually tested (health-check mode)"]}),t.jsx("div",{className:"flex flex-wrap gap-1",children:a.map((P,A)=>t.jsx(F,{variant:"outline",className:"text-[10px] font-mono",children:P.toolName},`${r.id}-${P.toolName}-${A}`))})]}):null,r.agent_summary&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:"Agent Summary"}),t.jsx("p",{className:"text-xs bg-muted/50 rounded px-3 py-2",children:r.agent_summary})]})]})]}),e[0]=n,e[1]=r.action_taken,e[2]=r.agent_summary,e[3]=r.connection_ok,e[4]=r.duration_ms,e[5]=r.error_message,e[6]=r.id,e[7]=r.item_title,e[8]=r.status,e[9]=r.tool_results,e[10]=r.tools_listed,e[11]=i}else i=e[11];return i}function ui(s){return!s.success}function mi(s){return s.success}function xi(s){return s.outputPreview!=="health_check: not called"}function hi(s){return s.outputPreview==="health_check: not called"}function pi(s){const e=Y.c(4),{value:r,onChange:n}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=[{value:"all",label:"All"},{value:"passed",label:"Passed"},{value:"failed",label:"Failed"},{value:"error",label:"Error"},{value:"needs_auth",label:"Needs Auth"},{value:"skipped",label:"Skipped"}],e[0]=o):o=e[0];const i=o;let a;return e[1]!==n||e[2]!==r?(a=t.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:i.map(l=>t.jsx("button",{type:"button",className:Z("text-[11px] px-2 py-0.5 rounded-full border transition-colors",r===l.value?"bg-primary text-primary-foreground border-primary":"bg-muted/30 border-border hover:bg-muted/50"),onClick:()=>n(l.value),children:l.label},l.value))}),e[1]=n,e[2]=r,e[3]=a):a=e[3],a}function fi(s){const e=Y.c(46),{runId:r}=s,[n,o]=M.useState("all"),i=Ut(r),a=i.data?.run,l=nt(r,void 0,a?.status);let d;e[0]!==l.data?.items?(d=l.data?.items??[],e[0]=l.data?.items,e[1]=d):d=e[1];const u=d;let m;e[2]!==u||e[3]!==n?(m=n==="all"?u:u.filter(b=>b.status===n),e[2]=u,e[3]=n,e[4]=m):m=e[4];const h=m;if(!r){let b;return e[5]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(ne,{className:"p-6 text-center space-y-2",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a run to inspect details."})}),e[5]=b):b=e[5],b}let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("h3",{className:"text-sm font-semibold",children:"Run Detail"}),e[6]=x):x=e[6];let f;e[7]!==r?(f=t.jsxs("div",{children:[x,t.jsx("p",{className:"text-[10px] text-muted-foreground font-mono",children:r})]}),e[7]=r,e[8]=f):f=e[8];let c;e[9]!==a?(c=a&&t.jsx(F,{className:Z("capitalize",ks(a.status)),children:a.status}),e[9]=a,e[10]=c):c=e[10];let p;e[11]!==l||e[12]!==i?(p=t.jsx(G,{size:"sm",variant:"outline",onClick:()=>{i.refetch(),l.refetch()},children:"Refresh"}),e[11]=l,e[12]=i,e[13]=p):p=e[13];let j;e[14]!==c||e[15]!==p?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[c,p]}),e[14]=c,e[15]=p,e[16]=j):j=e[16];let y;e[17]!==f||e[18]!==j?(y=t.jsx(ne,{className:"p-4",children:t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f,j]})}),e[17]=f,e[18]=j,e[19]=y):y=e[19];let N;e[20]!==a?(N=a&&t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 text-xs",children:[t.jsxs(ne,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Total"}),t.jsx("p",{className:"text-lg font-bold",children:a.total_items})]}),t.jsxs(ne,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Tested"}),t.jsx("p",{className:"text-lg font-bold",children:a.tested_items})]}),t.jsxs(ne,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-emerald-600",children:"Passed"}),t.jsx("p",{className:"text-lg font-bold text-emerald-600",children:a.passed_items})]}),t.jsxs(ne,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-red-600",children:"Failed"}),t.jsx("p",{className:"text-lg font-bold text-red-600",children:a.failed_items})]}),t.jsxs(ne,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Skipped"}),t.jsx("p",{className:"text-lg font-bold",children:a.skipped_items})]})]}),e[20]=a,e[21]=N):N=e[21];let w;e[22]!==a?(w=a&&(a.started_at||a.finished_at)&&t.jsxs(ne,{className:"p-3 flex items-center gap-4 text-xs text-muted-foreground flex-wrap",children:[a.started_at&&t.jsxs("span",{children:["Started: ",new Date(a.started_at).toLocaleString()]}),a.finished_at&&t.jsxs("span",{children:["Finished: ",new Date(a.finished_at).toLocaleString()]}),a.started_at&&a.finished_at&&t.jsxs("span",{className:"font-medium text-foreground",children:["Duration:"," ",((new Date(a.finished_at).getTime()-new Date(a.started_at).getTime())/1e3).toFixed(1),"s"]})]}),e[22]=a,e[23]=w):w=e[23];let v;e[24]!==n?(v=t.jsx(pi,{value:n,onChange:o}),e[24]=n,e[25]=v):v=e[25];const I=h.length!==1?"s":"";let S;e[26]!==h.length||e[27]!==I?(S=t.jsxs("span",{className:"text-xs text-muted-foreground",children:[h.length," result",I]}),e[26]=h.length,e[27]=I,e[28]=S):S=e[28];let _;e[29]!==v||e[30]!==S?(_=t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[v,S]}),e[29]=v,e[30]=S,e[31]=_):_=e[31];let C;e[32]!==u||e[33]!==h.length?(C=h.length===0&&t.jsx(ne,{className:"p-4 text-sm text-muted-foreground text-center",children:u.length===0?"No test results yet.":"No results match the current filter."}),e[32]=u,e[33]=h.length,e[34]=C):C=e[34];let T;e[35]!==h?(T=h.map(gi),e[35]=h,e[36]=T):T=e[36];let R;e[37]!==C||e[38]!==T?(R=t.jsxs("div",{className:"space-y-2",children:[C,T]}),e[37]=C,e[38]=T,e[39]=R):R=e[39];let E;return e[40]!==w||e[41]!==_||e[42]!==R||e[43]!==y||e[44]!==N?(E=t.jsxs("div",{className:"space-y-3",children:[y,N,w,_,R]}),e[40]=w,e[41]=_,e[42]=R,e[43]=y,e[44]=N,e[45]=E):E=e[45],E}function gi(s){return t.jsx(di,{result:s},s.id)}function ji(s){return s.tested_items?`${Math.round(s.passed_items/s.tested_items*100)}%`:"-"}function vi(s){const e=Y.c(20),{selectedRunId:r,onSelectRun:n}=s,o=Nt();let i;e[0]!==o.data?.items?(i=o.data?.items??[],e[0]=o.data?.items,e[1]=i):i=e[1];const a=i;let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{children:[t.jsx("h3",{className:"text-sm font-semibold",children:"QA run history"}),t.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Browse previous QA executions and reopen their logs."})]}),e[2]=l):l=e[2];let d;e[3]!==o?(d=t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l,t.jsx(G,{size:"sm",variant:"outline",onClick:()=>o.refetch(),children:"Refresh"})]}),e[3]=o,e[4]=d):d=e[4];let u;e[5]!==a.length?(u=a.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No runs yet. Start QA from the Dashboard tab."}),e[5]=a.length,e[6]=u):u=e[6];let m;if(e[7]!==n||e[8]!==a||e[9]!==r){let f;e[11]!==n||e[12]!==r?(f=c=>{const p=_s(c.started_at,c.finished_at),j=ji(c),y=r===c.id;return t.jsxs("button",{type:"button",onClick:()=>n(c.id),className:Z("w-full text-left rounded-lg border p-3 transition-colors",y?"border-primary bg-primary/5":"border-border hover:bg-muted/30"),children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("div",{className:"min-w-0 flex-1",children:t.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(c.created_at).toLocaleString()})}),t.jsx(F,{className:Z("capitalize",ws(c.status)),children:c.status})]}),t.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs flex-wrap",children:[t.jsxs("span",{className:"text-muted-foreground",children:[c.tested_items,"/",c.total_items," tested"]}),t.jsxs("span",{className:"text-emerald-600 font-medium",children:[c.passed_items," passed"]}),c.failed_items>0&&t.jsxs("span",{className:"text-red-600 font-medium",children:[c.failed_items," failed"]}),c.skipped_items>0&&t.jsxs("span",{className:"text-muted-foreground",children:[c.skipped_items," skipped"]}),t.jsxs("span",{className:"text-muted-foreground",children:["pass rate: ",j]}),p&&t.jsx("span",{className:"text-muted-foreground",children:p})]}),c.config_snapshot&&t.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[t.jsx(F,{variant:"outline",className:"text-[9px]",children:(c.config_snapshot.monitorMode??c.config_snapshot.testMode??"health_check").replace("_"," ")}),c.config_snapshot.onFailure!=="none"&&t.jsxs(F,{variant:"outline",className:"text-[9px] text-red-600",children:["on fail:"," ",c.config_snapshot.onFailure.replace(/_/g," ")]})]})]},c.id)},e[11]=n,e[12]=r,e[13]=f):f=e[13],m=a.map(f),e[7]=n,e[8]=a,e[9]=r,e[10]=m}else m=e[10];let h;e[14]!==u||e[15]!==m?(h=t.jsxs("div",{className:"space-y-2 max-h-[520px] overflow-auto",children:[u,m]}),e[14]=u,e[15]=m,e[16]=h):h=e[16];let x;return e[17]!==d||e[18]!==h?(x=t.jsx(ne,{className:"p-4",children:t.jsxs("div",{className:"space-y-3",children:[d,h]})}),e[17]=d,e[18]=h,e[19]=x):x=e[19],x}function bi(){const s=Y.c(20),[e,r]=M.useState(void 0),[n,o]=M.useState("tests"),a=Ut(e).data?.run?.status,l=nt(e,void 0,a);let d;s[0]!==l.data?.items?(d=l.data?.items??[],s[0]=l.data?.items,s[1]=d):d=s[1];let u;s[2]!==d?(u=d.filter(yi),s[2]=d,s[3]=u):u=s[3];const m=u;let h;s[4]===Symbol.for("react.memo_cache_sentinel")?(h=[{id:"tests",label:"Tests"},{id:"configuration",label:"Configuration"},{id:"connections",label:"Connections"}],s[4]=h):h=s[4];let x;s[5]!==n?(x=t.jsx("nav",{className:"flex items-center gap-2 overflow-x-auto no-scrollbar",children:h.map(y=>{const N=n===y.id;return t.jsx("button",{type:"button",className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center whitespace-nowrap",N?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),onClick:()=>o(y.id),children:t.jsx("span",{children:y.label})},y.id)})}),s[5]=n,s[6]=x):x=s[6];let f;s[7]!==e||s[8]!==n||s[9]!==m?(f=n==="tests"&&t.jsxs("div",{className:"space-y-6",children:[t.jsx(ai,{activeRunId:e,onRunChange:r}),t.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-12 gap-4 items-start",children:[t.jsxs("div",{className:"xl:col-span-8 space-y-6 min-w-0",children:[e&&t.jsx(fi,{runId:e}),t.jsx(vi,{selectedRunId:e,onSelectRun:r})]}),t.jsxs("div",{className:"xl:col-span-4 space-y-2 min-w-0",children:[t.jsxs("h3",{className:"text-sm font-semibold",children:["Broken MCPs"," ",m.length>0&&t.jsx(F,{variant:"destructive",className:"text-[10px] ml-1",children:m.length})]}),t.jsx(Mn,{results:m})]})]})]}),s[7]=e,s[8]=n,s[9]=m,s[10]=f):f=s[10];let c;s[11]!==n?(c=n==="configuration"&&t.jsx(Qn,{}),s[11]=n,s[12]=c):c=s[12];let p;s[13]!==n?(p=n==="connections"&&t.jsx(Yn,{}),s[13]=n,s[14]=p):p=s[14];let j;return s[15]!==x||s[16]!==f||s[17]!==c||s[18]!==p?(j=t.jsxs("div",{className:"h-full overflow-auto px-4 md:px-6 py-4 space-y-6",children:[x,f,c,p]}),s[15]=x,s[16]=f,s[17]=c,s[18]=p,s[19]=j):j=s[19],j}function yi(s){return s.status==="failed"||s.status==="error"}function Ni(s){const e=Y.c(9),{activeTab:r,onChange:n,items:o}=s;let i;if(e[0]!==r||e[1]!==o||e[2]!==n){let l;e[4]!==r||e[5]!==n?(l=d=>{const u=r===d.tab,m=d.icon;return t.jsxs("button",{type:"button",className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center whitespace-nowrap",u?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),onClick:()=>n(d.tab),children:[t.jsx(m,{size:14}),t.jsx("span",{children:d.label}),typeof d.count=="number"&&d.count>0&&t.jsx("span",{className:"min-w-4 h-4 px-1 inline-flex items-center justify-center rounded-full bg-primary/15 text-[10px] font-semibold",children:d.count})]},d.id)},e[4]=r,e[5]=n,e[6]=l):l=e[6],i=o.map(l),e[0]=r,e[1]=o,e[2]=n,e[3]=i}else i=e[3];let a;return e[7]!==i?(a=t.jsx("nav",{className:"flex items-center gap-2 overflow-x-auto no-scrollbar",children:i}),e[7]=i,e[8]=a):a=e[8],a}function ml(s){const e=Y.c(47),{onBack:r}=s,[n,o]=M.useState("items"),[i,a]=M.useState(null),{registryName:l,registryIcon:d,acceptPublishRequests:u}=vs(Oe),m=Fr(),h=Er();!u&&n==="requests"&&o("items");const x=m.data?.pending??0,f=h.brokenCount>0?h.brokenCount:void 0;let c;e[0]!==f?(c={id:"items",label:"Items",icon:Xs,tab:"items",count:f},e[0]=f,e[1]=c):c=e[1];let p;e[2]!==u||e[3]!==x?(p=u?[{id:"requests",label:"Requests",icon:Fe,tab:"requests",count:x}]:[],e[2]=u,e[3]=x,e[4]=p):p=e[4];let j,y;e[5]===Symbol.for("react.memo_cache_sentinel")?(j={id:"qa",label:"QA",icon:us,tab:"qa"},y={id:"settings",label:"Settings",icon:er,tab:"settings"},e[5]=j,e[6]=y):(j=e[5],y=e[6]);let N;e[7]!==c||e[8]!==p?(N=[c,...p,j,y],e[7]=c,e[8]=p,e[9]=N):N=e[9];const w=N;let v;e[10]!==r?(v=r&&t.jsx("button",{type:"button",className:"shrink-0 p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors cursor-pointer",onClick:r,children:t.jsx(Zs,{size:16})}),e[10]=r,e[11]=v):v=e[11];let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=()=>o("settings"),e[12]=I):I=e[12];let S;e[13]!==d||e[14]!==l?(S=t.jsx("div",{className:"size-7 rounded-lg border border-border overflow-hidden bg-muted/20 flex items-center justify-center shrink-0",children:d?t.jsx("img",{src:d,alt:l,className:"h-full w-full object-cover"}):t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:l.slice(0,1).toUpperCase()})}),e[13]=d,e[14]=l,e[15]=S):S=e[15];let _;e[16]!==l?(_=t.jsx("span",{className:"text-sm font-medium truncate max-w-[220px]",children:l}),e[16]=l,e[17]=_):_=e[17];let C;e[18]!==_||e[19]!==S?(C=t.jsxs("button",{type:"button",className:"min-w-0 flex items-center gap-2 hover:opacity-90 transition-opacity cursor-pointer",onClick:I,children:[S,_]}),e[18]=_,e[19]=S,e[20]=C):C=e[20];let T;e[21]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("div",{className:"h-6 w-px bg-border shrink-0"}),e[21]=T):T=e[21];let R;e[22]!==n||e[23]!==w?(R=t.jsx(Ni,{activeTab:n,onChange:o,items:w}),e[22]=n,e[23]=w,e[24]=R):R=e[24];let E;e[25]!==C||e[26]!==R||e[27]!==v?(E=t.jsx("header",{className:"shrink-0 w-full border-b border-border h-12 overflow-x-auto flex items-center justify-between gap-3 px-4 min-w-max",children:t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[v,C,T,R]})}),e[25]=C,e[26]=R,e[27]=v,e[28]=E):E=e[28];let b;e[29]!==n?(b=n==="items"&&t.jsx(Rn,{}),e[29]=n,e[30]=b):b=e[30];let D;e[31]!==u||e[32]!==n?(D=n==="requests"&&u&&t.jsx(In,{}),e[31]=u,e[32]=n,e[33]=D):D=e[33];let $;e[34]!==n?($=n==="qa"&&t.jsx(bi,{}),e[34]=n,e[35]=$):$=e[35];let P;e[36]!==n||e[37]!==i?(P=n==="settings"&&t.jsx(Pn,{revealedKey:i,onRevealedKeyChange:a}),e[36]=n,e[37]=i,e[38]=P):P=e[38];let A;e[39]!==b||e[40]!==D||e[41]!==$||e[42]!==P?(A=t.jsxs("main",{className:"flex-1 min-w-0 overflow-hidden",children:[b,D,$,P]}),e[39]=b,e[40]=D,e[41]=$,e[42]=P,e[43]=A):A=e[43];let q;return e[44]!==E||e[45]!==A?(q=t.jsxs("div",{className:"h-full flex flex-col bg-background overflow-hidden",children:[E,A]}),e[44]=E,e[45]=A,e[46]=q):q=e[46],q}export{ml as default};
|
package/dist/client/assets/{require-capability-skg99hPH.js → require-capability-C4c85-CT.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as p,j as m}from"./index-
|
|
1
|
+
import{e as p,j as m}from"./index-BPnG82q8.js";import{u as l}from"./use-capability-CtdbYGMh.js";import{A as u}from"./access-gate-DADwk2R8.js";function b(n){const t=p.c(6),{capability:c,area:e,children:i}=n,{granted:a,loading:o,error:s}=l(c);let r;return t[0]!==e||t[1]!==i||t[2]!==s||t[3]!==a||t[4]!==o?(r=m.jsx(u,{granted:a,loading:o,error:s,area:e,children:i}),t[0]=e,t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=r):r=t[5],r}export{b as R};
|
package/dist/client/assets/{required-auth-layout-Cidb--Hk.js → required-auth-layout-BApuEUpI.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as c,j as i,A as a,S as u,h as m,k as f,N as h}from"./index-
|
|
1
|
+
import{e as c,j as i,A as a,S as u,h as m,k as f,N as h}from"./index-BPnG82q8.js";import{u as x}from"./useRouterState-IhZ1SxRm.js";function g(){const t=c.c(5),s=x().location.href;let n;t[0]!==s?(n=s==="/login"||s.startsWith("/login?"),t[0]=s,t[1]=n):n=t[1];const r=n;let o;if(t[2]!==s||t[3]!==r){const l=r?{}:{next:s};o=i.jsx(h,{to:"/login",search:l,replace:!0}),t[2]=s,t[3]=r,t[4]=o}else o=t[4];return o}function j(t){const e=c.c(6),{children:s}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(a,{children:i.jsx(u,{})}),e[0]=n):n=e[0];let r;e[1]!==s?(r=i.jsx(m,{children:s}),e[1]=s,e[2]=r):r=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(f,{children:i.jsx(g,{})}),e[3]=o):o=e[3];let l;return e[4]!==r?(l=i.jsxs(i.Fragment,{children:[n,r,o]}),e[4]=r,e[5]=l):l=e[5],l}export{j as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as q,d as Y,f as A,r as B,a as G,j as s,B as z,b as K}from"./index-
|
|
1
|
+
import{e as q,d as Y,f as A,r as B,a as G,j as s,B as z,b as K}from"./index-BPnG82q8.js";import{I as L}from"./input-Dp561wvu.js";function H(){const e=q.c(45);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/reset-password"},e[0]=n):n=e[0];const{token:r,error:h}=Y(n),a=A(),[o,D]=B.useState(""),[l,M]=B.useState(""),[t,T]=B.useState(!1),i=h==="INVALID_TOKEN";let j;e[1]===Symbol.for("react.memo_cache_sentinel")?(j={mutationFn:O,onSuccess:()=>{T(!0)}},e[1]=j):j=e[1];const w=G(j),v=o===l,c=o.length>=8&&l.length>=8&&v,d=w.isPending,N=w.error;let y;e[2]!==c||e[3]!==o||e[4]!==w||e[5]!==r?(y=b=>{b.preventDefault(),!(!r||!c)&&w.mutate({newPassword:o,token:r})},e[2]=c,e[3]=o,e[4]=w,e[5]=r,e[6]=y):y=e[6];const F=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e[7]=k):k=e[7];let S,_,P,C;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),_=s.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),P=s.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),C=s.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e[8]=S,e[9]=_,e[10]=P,e[11]=C):(S=e[8],_=e[9],P=e[10],C=e[11]);let E;e[12]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e[12]=E):E=e[12];const I=t?"Password reset successful":"Set a new password";let m;e[13]!==I?(m=s.jsx("div",{className:"text-center space-y-1",children:s.jsx("p",{className:"text-sm text-foreground/70",children:I})}),e[13]=I,e[14]=m):m=e[14];let u;e[15]!==i||e[16]!==a||e[17]!==t||e[18]!==r?(u=(i||!r&&!t)&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:"This reset link is invalid or has expired."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Back to login"})]}),e[15]=i,e[16]=a,e[17]=t,e[18]=r,e[19]=u):u=e[19];let x;e[20]!==N?(x=N&&s.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:N.message||"Failed to reset password. Please try again."}),e[20]=N,e[21]=x):x=e[21];let f;e[22]!==a||e[23]!==t?(f=t&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Your password has been reset. You can now sign in with your new password."}),s.jsx(z,{onClick:()=>a({to:"/login"}),className:"w-full font-semibold",size:"lg",children:"Go to login"})]}),e[22]=a,e[23]=t,e[24]=f):f=e[24];let g;e[25]!==c||e[26]!==l||e[27]!==F||e[28]!==i||e[29]!==d||e[30]!==o||e[31]!==v||e[32]!==t||e[33]!==r?(g=r&&!i&&!t&&s.jsxs("form",{onSubmit:F,className:"grid gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"New password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:o,onChange:b=>D(b.target.value),required:!0,minLength:8,disabled:d})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Confirm password"}),s.jsx(L,{type:"password",placeholder:"••••••••",value:l,onChange:b=>M(b.target.value),required:!0,minLength:8,disabled:d}),l&&!v&&s.jsx("p",{className:"text-xs text-destructive mt-1.5",children:"Passwords do not match"})]}),s.jsx(z,{type:"submit",disabled:d||!c,className:"w-full font-semibold",size:"lg",children:d?"Resetting...":"Reset password"})]}),e[25]=c,e[26]=l,e[27]=F,e[28]=i,e[29]=d,e[30]=o,e[31]=v,e[32]=t,e[33]=r,e[34]=g):g=e[34];let p;e[35]!==a||e[36]!==t?(p=!t&&s.jsx("div",{className:"text-center",children:s.jsx(z,{type:"button",variant:"link",onClick:()=>a({to:"/login"}),className:"text-sm text-muted-foreground hover:text-foreground",children:"Back to sign in"})}),e[35]=a,e[36]=t,e[37]=p):p=e[37];let R;return e[38]!==m||e[39]!==u||e[40]!==x||e[41]!==f||e[42]!==g||e[43]!==p?(R=s.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[k,s.jsxs("div",{className:"relative z-10",children:[S,_,P,C,s.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[E,m,u,x,f,g,p]})]})]}),e[38]=m,e[39]=u,e[40]=x,e[41]=f,e[42]=g,e[43]=p,e[44]=R):R=e[44],R}async function O(e){const{newPassword:n,token:r}=e,h=await K.resetPassword({newPassword:n,token:r});if(h.error)throw new Error(h.error.message||"Failed to reset password");return h}export{H as default};
|