decocms 4.99.6 → 4.99.7

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.
Files changed (235) hide show
  1. package/dist/client/assets/{AlertCircle-HDf1SdMp.js → AlertCircle-DHJMAy0z.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DBzjQPAs.js → AreaChart-BP3LRAVY.js} +1 -1
  3. package/dist/client/assets/{ArrowRight-BJXle-0w.js → ArrowRight-ZH8AfOrt.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-Dh0BiOXI.js → ArrowUp-BEvOvB39.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-CrR71a1A.js → ArrowUpRight-CB2lmsga.js} +1 -1
  6. package/dist/client/assets/{Check-B1cADIUI.js → Check-8S_h-pNf.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-f1iSH8hB.js → CheckCircle-8lNaIJZX.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-DOs1UnZr.js → ChevronDown-D19e4E2W.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-CgFu9sdx.js → ChevronRight-DMiFqEFB.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-uAvdnVUd.js → ChevronUp-CDr-5amA.js} +1 -1
  11. package/dist/client/assets/{Copy01-CV7iKrTC.js → Copy01-CVgcePVg.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-f9H8H7Yb.js → DotsVertical-Ddcp5zYy.js} +1 -1
  13. package/dist/client/assets/{Eye-8j1uMBcI.js → Eye-DjxTeGvc.js} +1 -1
  14. package/dist/client/assets/{FilterLines-Ds7Z0X1H.js → FilterLines-sMM8U03Q.js} +1 -1
  15. package/dist/client/assets/{Globe01-Du8VyJAD.js → Globe01-ByEypwqT.js} +1 -1
  16. package/dist/client/assets/{Globe04-Dimrs46t.js → Globe04-CLktRX73.js} +1 -1
  17. package/dist/client/assets/{HardDrive-Beq8HBY2.js → HardDrive-LZLUcrQT.js} +1 -1
  18. package/dist/client/assets/{Image01-DuaEC9og.js → Image01-BC4H1plu.js} +1 -1
  19. package/dist/client/assets/{Key01-B--Re1k8.js → Key01-BJ5pxmk5.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-B5BM6eYc.js → LayoutLeft-BY0vokwF.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-BPFggp-6.js → LinkExternal01-BE6iPh6Z.js} +1 -1
  22. package/dist/client/assets/{Monitor01-o18BZ9Nq.js → Monitor01-D5bQ7ld2.js} +1 -1
  23. package/dist/client/assets/{Package-BLDWt75n.js → Package-Dgaviqf5.js} +1 -1
  24. package/dist/client/assets/{Palette-C8bNRhGz.js → Palette-BLetgCYz.js} +1 -1
  25. package/dist/client/assets/{Play-D0L6Enqs.js → Play-D4uEf4_3.js} +1 -1
  26. package/dist/client/assets/{Plus-DUMrP_Ye.js → Plus-B99BOqFt.js} +1 -1
  27. package/dist/client/assets/{SearchLg-Ge42HxvE.js → SearchLg-0vJ_NGT1.js} +1 -1
  28. package/dist/client/assets/{SearchMd-CFyBBHfV.js → SearchMd--QTHPVfW.js} +1 -1
  29. package/dist/client/assets/{Settings02-DxZuRsR8.js → Settings02-Dg48gy-m.js} +1 -1
  30. package/dist/client/assets/{Shield01-CutJo3UY.js → Shield01-XjAbmrcl.js} +1 -1
  31. package/dist/client/assets/{Star01-CZAUM9Rj.js → Star01-DBzet7vh.js} +1 -1
  32. package/dist/client/assets/{Stars01-B_bdJu2V.js → Stars01-DBeF8eO9.js} +1 -1
  33. package/dist/client/assets/{Stars02-B4KvaZbQ.js → Stars02-DF0mhAvh.js} +1 -1
  34. package/dist/client/assets/{Sun-b3BoDZ0m.js → Sun-DWQi7hi9.js} +1 -1
  35. package/dist/client/assets/{SwitchHorizontal01-DbZ_R8He.js → SwitchHorizontal01-g8c5_DAA.js} +1 -1
  36. package/dist/client/assets/{Tool01-JzwwChx7.js → Tool01-BsH7bOGE.js} +1 -1
  37. package/dist/client/assets/{Tool02-BkVxB69y.js → Tool02-CpEmuwVJ.js} +1 -1
  38. package/dist/client/assets/{Trash01-D-qZT79D.js → Trash01-sz1B1ubO.js} +1 -1
  39. package/dist/client/assets/{TrendUp01-MT2Z0dNu.js → TrendUp01-DFaJzXrF.js} +1 -1
  40. package/dist/client/assets/{Upload01-D7dMZnFJ.js → Upload01-DZkj6_Us.js} +1 -1
  41. package/dist/client/assets/{User01-bt6Gy-BV.js → User01-Cy4n4fwd.js} +1 -1
  42. package/dist/client/assets/{Users01-CNmhIaTz.js → Users01-CiJE_Dg-.js} +1 -1
  43. package/dist/client/assets/{Users03-BCiyVfPw.js → Users03-Dqh1PO2N.js} +1 -1
  44. package/dist/client/assets/{X-BwgP8F_p.js → X-BFNxuShY.js} +1 -1
  45. package/dist/client/assets/{XCircle-BHeraOqs.js → XCircle-Cv1eNWoM.js} +1 -1
  46. package/dist/client/assets/{XClose-Dnedv7ma.js → XClose-Ckol2oql.js} +1 -1
  47. package/dist/client/assets/{Zap-DGqev4qD.js → Zap-DTU6QUr-.js} +1 -1
  48. package/dist/client/assets/{ZapSquare-CSfVZjJP.js → ZapSquare-CdnVBk-J.js} +1 -1
  49. package/dist/client/assets/{ZoomOut-DtCIp_Rd.js → ZoomOut-IrGAWsFW.js} +1 -1
  50. package/dist/client/assets/{access-gate-Cv5FQA3e.js → access-gate-DAiHI_Ya.js} +1 -1
  51. package/dist/client/assets/{add-section-modal-BNTtmHap.js → add-section-modal-PTtjM0qv.js} +1 -1
  52. package/dist/client/assets/{agent-icon-BBGul_4P.js → agent-icon-DJ-fLRqx.js} +1 -1
  53. package/dist/client/assets/{agents-list-Cf_qC56x.js → agents-list-Ddn36hvr.js} +1 -1
  54. package/dist/client/assets/{ai-providers-CCPYS5wZ.js → ai-providers-4RQyfXJ9.js} +1 -1
  55. package/dist/client/assets/{alert-wrF4ZDG3.js → alert-D564TwSW.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-Sv185C7F.js → alert-dialog-S-vKrHdP.js} +1 -1
  57. package/dist/client/assets/{app-editor-B8dT0Kia.js → app-editor-BnYQVlSC.js} +1 -1
  58. package/dist/client/assets/{auth-BBubLRKd.js → auth-LsRMSxpZ.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-B5UgKNAb.js → auth-catchall-CdzEQEu6.js} +1 -1
  60. package/dist/client/assets/{auth-entry-1VUyHyCT.js → auth-entry-DcFUSq-U.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-B46TSGwg.js → auth-split-layout-CTdOwwE2.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-D70Ev7Pq.js → authenticate-and-persist-oauth-ccpCvQUL.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-D-Em_vg3.js → automation-list-row-B36cFYnc.js} +1 -1
  64. package/dist/client/assets/{automation-runs-CB1lTVmc.js → automation-runs-C5OD2vNu.js} +1 -1
  65. package/dist/client/assets/{automations-AKtrHhfS.js → automations-_IDwlRt9.js} +1 -1
  66. package/dist/client/assets/{autosend-ImAM0A4d.js → autosend-DwCcNXOp.js} +1 -1
  67. package/dist/client/assets/{avatar-D8al7KMh.js → avatar-CDCXeyeq.js} +1 -1
  68. package/dist/client/assets/{badge-YUqxaABo.js → badge-CLbg8brP.js} +1 -1
  69. package/dist/client/assets/{block-document-P359pXUh.js → block-document-pbbZw2CP.js} +1 -1
  70. package/dist/client/assets/{brand-context-GbWTV-Rh.js → brand-context-CLwWQD4a.js} +1 -1
  71. package/dist/client/assets/{buckets-DUC1zECY.js → buckets-C6jFjZP6.js} +1 -1
  72. package/dist/client/assets/{bulk-category-panel-Dx_mdZmw.js → bulk-category-panel-BJgqFyPw.js} +1 -1
  73. package/dist/client/assets/{calendar-CX4gw4AA.js → calendar-CIg2EEBJ.js} +1 -1
  74. package/dist/client/assets/{capability-load-error-yNSE1JhI.js → capability-load-error-Dx6CWw4N.js} +1 -1
  75. package/dist/client/assets/{card-C5WOx1dB.js → card-CGoHKQKX.js} +1 -1
  76. package/dist/client/assets/{category-editor-CimNpKLA.js → category-editor-CxVEA7RL.js} +1 -1
  77. package/dist/client/assets/{chat-context-Cl7WM-Kk.js → chat-context-BpdINg7c.js} +1 -1
  78. package/dist/client/assets/{checkbox-Bd1cxc3D.js → checkbox-DiEGmfR1.js} +1 -1
  79. package/dist/client/assets/{cli-auth-success-CyDCKAa0.js → cli-auth-success-BGVZ5nYN.js} +1 -1
  80. package/dist/client/assets/{collection-detail-DIGzTuHX.js → collection-detail-DZbpwovT.js} +1 -1
  81. package/dist/client/assets/{collection-display-button-k5YlFt6U.js → collection-display-button-Dn4BN1AT.js} +1 -1
  82. package/dist/client/assets/{collection-search-B-jJ03ES.js → collection-search-DT4BSCdW.js} +1 -1
  83. package/dist/client/assets/{collection-table-wrapper-CnR5SxrW.js → collection-table-wrapper-CXhf1hUH.js} +1 -1
  84. package/dist/client/assets/{collection-tabs-BaRPNn2c.js → collection-tabs-CG0FZsKM.js} +1 -1
  85. package/dist/client/assets/{command-Ddw_RlcV.js → command-KNTOL3kj.js} +1 -1
  86. package/dist/client/assets/{commerce-onboarding-BZivueu2.js → commerce-onboarding-BMEY1DKe.js} +1 -1
  87. package/dist/client/assets/{companions-core-BufblIGl.js → companions-core-FTf4qGMY.js} +1 -1
  88. package/dist/client/assets/{connect-yZ08DB7o.js → connect-BE9doFql.js} +1 -1
  89. package/dist/client/assets/{connect-desktop-dialog-D5TVd_Au.js → connect-desktop-dialog-BoS5Hu9R.js} +1 -1
  90. package/dist/client/assets/{connection-card-B_Iz6s2X.js → connection-card-Dbj_E-0a.js} +1 -1
  91. package/dist/client/assets/{connection-detail-CKYFHqF0.js → connection-detail-V6mFx9e6.js} +1 -1
  92. package/dist/client/assets/{connection-form-helpers-D2TX4f4T.js → connection-form-helpers-D0VhJo5T.js} +1 -1
  93. package/dist/client/assets/{connections-Xw4BwABx.js → connections-fj3C3XzM.js} +1 -1
  94. package/dist/client/assets/{decopilot-sse-pool-DB9TgyZI.js → decopilot-sse-pool-DlsoDrW9.js} +1 -1
  95. package/dist/client/assets/{dialog-kRue8TNr.js → dialog-CwEHiSMU.js} +1 -1
  96. package/dist/client/assets/{domain-settings-DoxrFsSM.js → domain-settings-lLJfdhn2.js} +1 -1
  97. package/dist/client/assets/{drawer-C5ymga6c.js → drawer-NqC3cUty.js} +1 -1
  98. package/dist/client/assets/{dropdown-menu-BJ5MFfne.js → dropdown-menu-Dui6084c.js} +1 -1
  99. package/dist/client/assets/{empty-state-BHgtc18x.js → empty-state--30EXuZG.js} +1 -1
  100. package/dist/client/assets/{extract-connection-data-ClzMQ_W6.js → extract-connection-data-5mcb4Mog.js} +1 -1
  101. package/dist/client/assets/{file-explorer-Cy3bPhN_.js → file-explorer-CgOnjl_S.js} +1 -1
  102. package/dist/client/assets/{file-type-icon-CZ6YgmjJ.js → file-type-icon-P_pN9_xH.js} +1 -1
  103. package/dist/client/assets/{files-BHVssS7B.js → files-BLAFPbYz.js} +1 -1
  104. package/dist/client/assets/{form-BG6IhVis.js → form-5ox058mH.js} +1 -1
  105. package/dist/client/assets/{general-C_v9u7xU.js → general-6JhynIjZ.js} +1 -1
  106. package/dist/client/assets/{github-repo-picker-Blw8OC-v.js → github-repo-picker-BqET8_zQ.js} +1 -1
  107. package/dist/client/assets/{hooks-0cQl1oMF.js → hooks-Dcj3etNr.js} +1 -1
  108. package/dist/client/assets/{index-CzL8HqfG.js → index-BELfS11E.js} +1 -1
  109. package/dist/client/assets/{index-CR8EVYLu.js → index-BGTjziYz.js} +1 -1
  110. package/dist/client/assets/{index-CnaMAXeJ.js → index-BNV2EeGI.js} +1 -1
  111. package/dist/client/assets/{index-D8UtC1tD.js → index-BaeEjqV7.js} +7 -7
  112. package/dist/client/assets/index-BbdMwuvN.js +5 -0
  113. package/dist/client/assets/{index-DKNbamty.js → index-BhPaswkE.js} +26 -26
  114. package/dist/client/assets/{index-IaCzeKVy.js → index-C5X0kiyr.js} +1 -1
  115. package/dist/client/assets/{index-D0Q1X1Pg.js → index-C6ytuOGZ.js} +1 -1
  116. package/dist/client/assets/index-C9qzt0Jn.js +8 -0
  117. package/dist/client/assets/{index-Ckas4buh.js → index-CRmtvsLd.js} +1 -1
  118. package/dist/client/assets/{index-zkg8YPmA.js → index-Cr82fBda.js} +1 -1
  119. package/dist/client/assets/{index-DDQXtrIQ.js → index-CyNeJz90.js} +1 -1
  120. package/dist/client/assets/{index-CHJez2Ew.js → index-DZ0C-1Pb.js} +1 -1
  121. package/dist/client/assets/{index-DcLbVCcI.js → index-qob9QDNh.js} +1 -1
  122. package/dist/client/assets/{index-redirect-C_RNv9yf.js → index-redirect-sMiFiL_K.js} +1 -1
  123. package/dist/client/assets/{input-BnwhVFLX.js → input-PlhR5OQl.js} +1 -1
  124. package/dist/client/assets/{integration-icon-VR8DMR4b.js → integration-icon-DmDjDu1T.js} +1 -1
  125. package/dist/client/assets/{invite-member-dialog-CWwQTuXZ.js → invite-member-dialog-D79xzFG6.js} +1 -1
  126. package/dist/client/assets/{label-TRynenvJ.js → label-Dgx54R9B.js} +1 -1
  127. package/dist/client/assets/{layout-DfeXmrJu.js → layout-kKX1t2sP.js} +1 -1
  128. package/dist/client/assets/{login-nlskvzQb.js → login-wAm8iucL.js} +1 -1
  129. package/dist/client/assets/{mcp-oauth-BG5wWyRd.js → mcp-oauth-uiWOIXGl.js} +1 -1
  130. package/dist/client/assets/{members-QllQbnCX.js → members-Df7bjsef.js} +1 -1
  131. package/dist/client/assets/{monaco-editor-DsjIA8fo.js → monaco-editor-BkhNLbLQ.js} +1 -1
  132. package/dist/client/assets/{monitoring-stats-row-2KzUqM86.js → monitoring-stats-row-C_chKCRP.js} +1 -1
  133. package/dist/client/assets/{multi-select-xGcytaXl.js → multi-select-Ds_o80Ow.js} +1 -1
  134. package/dist/client/assets/{oauth-callback-B92gYhx8.js → oauth-callback-DDD-Q2b4.js} +1 -1
  135. package/dist/client/assets/{oauth-callback-ai-provider-BCEDTYeS.js → oauth-callback-ai-provider-B5_IzB1y.js} +1 -1
  136. package/dist/client/assets/{onboarding-Bc316OQB.js → onboarding-B1v12Kxf.js} +1 -1
  137. package/dist/client/assets/{org-install-C9yApjyE.js → org-install-ix32v6HG.js} +1 -1
  138. package/dist/client/assets/{org-layout-CY596W8J.js → org-layout-D3jsdku6.js} +1 -1
  139. package/dist/client/assets/{organization-choice-Ckt6XIDd.js → organization-choice-DG8veEJJ.js} +1 -1
  140. package/dist/client/assets/{orgs-g4M2D4al.js → orgs-DwwYSo1F.js} +1 -1
  141. package/dist/client/assets/{page-seo-form-BiRcVo3c.js → page-seo-form-B6-Tjapj.js} +1 -1
  142. package/dist/client/assets/page-seo-sheet-CPcGy_lc.js +1 -0
  143. package/dist/client/assets/{popover-COj_IB75.js → popover-Cc-bUxo9.js} +1 -1
  144. package/dist/client/assets/{post-editor-CJ-l76wn.js → post-editor-C4wur674.js} +1 -1
  145. package/dist/client/assets/{primitives-DfC5MU6Q.js → primitives-DzhLuT4o.js} +1 -1
  146. package/dist/client/assets/{profile-P5f67Py6.js → profile-MRaW8Iku.js} +1 -1
  147. package/dist/client/assets/project-app-view-Dp8aqKn9.js +1 -0
  148. package/dist/client/assets/record-editor-DNp_YJwU.js +1 -0
  149. package/dist/client/assets/{redirect-editor-C-fmVHTG.js → redirect-editor-LLRc4D2K.js} +1 -1
  150. package/dist/client/assets/registry-bT72xUUs.js +2 -0
  151. package/dist/client/assets/registry-layout-DkldcL5a.js +27 -0
  152. package/dist/client/assets/{reports-BHr7CcO3.js → reports-B-PUwpKU.js} +1 -1
  153. package/dist/client/assets/{require-capability-CkAszDrz.js → require-capability-DLiPnWvZ.js} +1 -1
  154. package/dist/client/assets/{required-auth-layout-D_Ki2P9p.js → required-auth-layout-BZ6DGJsb.js} +1 -1
  155. package/dist/client/assets/{reset-password-BJ8F97rm.js → reset-password-C9volMkn.js} +1 -1
  156. package/dist/client/assets/{roles-B5o9PX2m.js → roles-CiGDH8Hn.js} +1 -1
  157. package/dist/client/assets/{search-input-ehuup_3i.js → search-input-CXhpX-Xz.js} +1 -1
  158. package/dist/client/assets/{secrets-C9ktuE8d.js → secrets-C5-PbNw_.js} +1 -1
  159. package/dist/client/assets/{sections-editor-Bko-kTwr.js → sections-editor-BYYH09fn.js} +1 -1
  160. package/dist/client/assets/{select-Ci7RZSzd.js → select-BHlpCdw9.js} +1 -1
  161. package/dist/client/assets/{select-model-DZjxvBCc.js → select-model-DiTMTOsS.js} +1 -1
  162. package/dist/client/assets/{self-tool-result-D-j89huE.js → self-tool-result-BYT5inCm.js} +1 -1
  163. package/dist/client/assets/{seo-editor-DJASP0bv.js → seo-editor-BMESJKUG.js} +1 -1
  164. package/dist/client/assets/{settings-layout-BvSHkcpC.js → settings-layout-BEVTWuIu.js} +1 -1
  165. package/dist/client/assets/{settings-section-Bzc6Rwbg.js → settings-section-DYCGsxoQ.js} +1 -1
  166. package/dist/client/assets/{shell-controls-xCDOGRzp.js → shell-controls-CyEjGQVX.js} +1 -1
  167. package/dist/client/assets/{shell-layout-P3HlCDDi.js → shell-layout-DlEDxOSH.js} +1 -1
  168. package/dist/client/assets/{sidebar-DDMN0UUa.js → sidebar-BT5oq5Py.js} +1 -1
  169. package/dist/client/assets/{skeleton-DHDS9MkE.js → skeleton-DR0dV7Rx.js} +1 -1
  170. package/dist/client/assets/{sso-Cg1P8i1A.js → sso-CSnQvRdb.js} +1 -1
  171. package/dist/client/assets/{store-DXEGdfs5.js → store-DCbdRWaM.js} +1 -1
  172. package/dist/client/assets/store-registry-C2gPY7Xh.js +2 -0
  173. package/dist/client/assets/{studio-tools-BVcfAbEY.js → studio-tools-BSpHTnkI.js} +1 -1
  174. package/dist/client/assets/{switch-CdvvL6Gj.js → switch-DNcfs8uV.js} +1 -1
  175. package/dist/client/assets/{table-CvG1Gt8e.js → table-BO7AXCJj.js} +1 -1
  176. package/dist/client/assets/{tabs-vn5ztDQe.js → tabs-BOn-uUO8.js} +1 -1
  177. package/dist/client/assets/{textarea-C13lpBK6.js → textarea-2FS82hTt.js} +1 -1
  178. package/dist/client/assets/{toggle-group-iWDs0t6l.js → toggle-group-Bp5y9M5o.js} +1 -1
  179. package/dist/client/assets/{toolbar-icon-button-D_f12kyv.js → toolbar-icon-button-BX6tvqZL.js} +1 -1
  180. package/dist/client/assets/{toolbar-DjroajCZ.js → toolbar-lB-S2vpV.js} +1 -1
  181. package/dist/client/assets/{tooltip-pFADIDzq.js → tooltip-D9NGFdPV.js} +1 -1
  182. package/dist/client/assets/{use-ai-providers-DE2cntMZ.js → use-ai-providers-BQWD6Fbv.js} +1 -1
  183. package/dist/client/assets/{use-api-keys-CdT5TGLj.js → use-api-keys-B9APB1Uz.js} +1 -1
  184. package/dist/client/assets/{use-automations-BaNT9vbM.js → use-automations-Vb2lhz9-.js} +1 -1
  185. package/dist/client/assets/{use-autosave-CJ2PTNPq.js → use-autosave-0f1y6oqV.js} +1 -1
  186. package/dist/client/assets/{use-capability-D-q43BYn.js → use-capability-COYHR3-p.js} +1 -1
  187. package/dist/client/assets/{use-clock-tick-D6EuNXOr.js → use-clock-tick-BRgf5NQf.js} +1 -1
  188. package/dist/client/assets/{use-connection-DBbVSDXt.js → use-connection-DpuO4fNw.js} +1 -1
  189. package/dist/client/assets/{use-copy-BsTmY8gA.js → use-copy-BeT4l9EL.js} +1 -1
  190. package/dist/client/assets/{use-create-virtual-mcp--SK7XprO.js → use-create-virtual-mcp-41F9ENXu.js} +1 -1
  191. package/dist/client/assets/{use-debounced-autosave-BlXZElQ8.js → use-debounced-autosave-CRjEG81o.js} +1 -1
  192. package/dist/client/assets/{use-debounced-value-TGJ8SdlV.js → use-debounced-value-NzmZPT1j.js} +1 -1
  193. package/dist/client/assets/{use-deco-credits-CeNu-Ko2.js → use-deco-credits-BICXIEvI.js} +1 -1
  194. package/dist/client/assets/{use-decopilot-events-8bs5w4AD.js → use-decopilot-events-B2udrR1E.js} +1 -1
  195. package/dist/client/assets/{use-delete-connection-BAH-lugN.js → use-delete-connection-I4CFeUrd.js} +1 -1
  196. package/dist/client/assets/{use-deployment-admin-DgtqQkNf.js → use-deployment-admin-D5UxXiFy.js} +1 -1
  197. package/dist/client/assets/{use-file-configs-BJFdEtoj.js → use-file-configs-BxxfQuJb.js} +1 -1
  198. package/dist/client/assets/{use-infinite-scroll-CISSXTkf.js → use-infinite-scroll-Czt7JOf8.js} +1 -1
  199. package/dist/client/assets/{use-join-requests-CRQ-VsRM.js → use-join-requests-BAcrUcz7.js} +1 -1
  200. package/dist/client/assets/{use-mcp-auth-status-basL1SDv.js → use-mcp-auth-status-CnFSrLEj.js} +1 -1
  201. package/dist/client/assets/{use-mcp-client-B8-Q-EhH.js → use-mcp-client-tcmKmN21.js} +1 -1
  202. package/dist/client/assets/{use-mcp-tools-Sji4g0bw.js → use-mcp-tools-DIqHvolA.js} +1 -1
  203. package/dist/client/assets/{use-members-C870Ysbt.js → use-members-atWSP-WF.js} +1 -1
  204. package/dist/client/assets/{use-mobile-DNW0WYD1.js → use-mobile-2yLfYt8o.js} +1 -1
  205. package/dist/client/assets/{use-navigate-to-agent-DWTvxd5x.js → use-navigate-to-agent-BAhIUAJc.js} +1 -1
  206. package/dist/client/assets/{use-org-auth-client-D3-pn0NR.js → use-org-auth-client-CF9Xv674.js} +1 -1
  207. package/dist/client/assets/{use-org-sso-DragB5KD.js → use-org-sso-D55i4f0_.js} +1 -1
  208. package/dist/client/assets/{use-organization-roles-D7tyvF0D.js → use-organization-roles-CTaZXibc.js} +1 -1
  209. package/dist/client/assets/{use-organization-settings-Dp3mUEWr.js → use-organization-settings-Coxn0MdD.js} +1 -1
  210. package/dist/client/assets/{use-registry-app-BAuEL7m7.js → use-registry-app-hSt4mgU8.js} +1 -1
  211. package/dist/client/assets/{use-registry-connections-CrWYgFxG.js → use-registry-connections-Mt2VCkjn.js} +1 -1
  212. package/dist/client/assets/{use-secrets-CW6BSksG.js → use-secrets-CgXohDMi.js} +1 -1
  213. package/dist/client/assets/{use-status-sounds-CqVy5a-3.js → use-status-sounds-BADjzMyd.js} +1 -1
  214. package/dist/client/assets/{use-view-mode-DAFg7BUY.js → use-view-mode-h6gpir15.js} +1 -1
  215. package/dist/client/assets/{use-virtual-mcp-v_IAAgB6.js → use-virtual-mcp-MeqW96-1.js} +1 -1
  216. package/dist/client/assets/useInfiniteQuery-C6O0Jfl2.js +1 -0
  217. package/dist/client/assets/{useRouterState-DpM9fYmi.js → useRouterState-N0q5mOQR.js} +1 -1
  218. package/dist/client/assets/useSuspenseInfiniteQuery-DrfctcYn.js +1 -0
  219. package/dist/client/assets/{users-CPbgbhr1.js → users-CJv38_2t.js} +1 -1
  220. package/dist/client/assets/{variant-calendar-DcP4ErMU.js → variant-calendar-erhHGjtK.js} +1 -1
  221. package/dist/client/assets/{view-mode-toggle-Bs001eF7.js → view-mode-toggle-Wr5FnjMg.js} +1 -1
  222. package/dist/client/index.html +1 -1
  223. package/dist/server/cli.js +1 -1
  224. package/dist/server/server.js +1 -1
  225. package/package.json +1 -1
  226. package/dist/client/assets/index-B7kfkue_.js +0 -8
  227. package/dist/client/assets/index-wiK91-B7.js +0 -5
  228. package/dist/client/assets/page-seo-sheet-DojhcVrt.js +0 -1
  229. package/dist/client/assets/project-app-view-25PzzkII.js +0 -1
  230. package/dist/client/assets/record-editor-DXSyFVIm.js +0 -1
  231. package/dist/client/assets/registry-N5G9bX4u.js +0 -2
  232. package/dist/client/assets/registry-layout-w51rnIhZ.js +0 -27
  233. package/dist/client/assets/store-registry-BtFwNRWl.js +0 -2
  234. package/dist/client/assets/useInfiniteQuery-CwrdnI4P.js +0 -1
  235. package/dist/client/assets/useSuspenseInfiniteQuery-RIEYysq5.js +0 -1
@@ -0,0 +1,27 @@
1
+ import{c as Z,F as be,n as Ae,o as Ue,e as _e,t as G,b as ce,r as M,j as t,B as Y,k as Ye,m as te,b8 as Ks,b9 as Hs}from"./index-BaeEjqV7.js";import{i as Xt,a as ms,t as Vs,c as Gs,n as Qs,b as Ys}from"./Tool02-CpEmuwVJ.js";import{i as We}from"./CheckCircle-8lNaIJZX.js";import{s as Lt,c as Ws,b as Js,i as Zs,a as Xs}from"./Settings02-Dg48gy-m.js";import{S as ze,u as Fe,W as er}from"./use-mcp-client-tcmKmN21.js";import{u as gs}from"./useInfiniteQuery-C6O0Jfl2.js";import{u as Te}from"./studio-tools-BSpHTnkI.js";import{B as V}from"./badge-CLbg8brP.js";import{I as ye}from"./input-PlhR5OQl.js";import{D as pt,a as Re,b as ht,c as ft,d as es,k as ts,j as tr}from"./dropdown-menu-Dui6084c.js";import{c as At,e as Ut,a as Je,d as pe,b as Ft,T as he}from"./table-BO7AXCJj.js";import{a as sr,T as ss}from"./toggle-group-Bp5y9M5o.js";import{u as rr}from"./use-view-mode-h6gpir15.js";import{i as $t}from"./DotsVertical-Ddcp5zYy.js";import{i as ir}from"./FilterLines-sMM8U03Q.js";import{n as nr,i as xs}from"./Globe01-ByEypwqT.js";import{i as or}from"./SearchMd--QTHPVfW.js";import{e as yt,d as jt,b as vt,h as bt,a as Nt,c as Ct}from"./dialog-CwEHiSMU.js";import{i as tt}from"./AlertCircle-DHJMAy0z.js";import{i as rs}from"./Upload01-DZkj6_Us.js";import{A as st,a as rt,b as it,c as nt,g as ot,d as at,e as lt,f as ct}from"./alert-dialog-S-vKrHdP.js";import{C as me}from"./card-CGoHKQKX.js";import{s as dt}from"./Trash01-sz1B1ubO.js";import{L as oe}from"./label-Dgx54R9B.js";import{S as ar,a as lr,b as cr,c as dr,d as Dt}from"./select-BHlpCdw9.js";import{S as Ge}from"./switch-DNcfs8uV.js";import{T as wt}from"./textarea-2FS82hTt.js";import{i as ur}from"./ArrowRight-ZH8AfOrt.js";import{i as mr}from"./X-BFNxuShY.js";import{a as gr,i as xr}from"./XCircle-Cv1eNWoM.js";import{t as pr}from"./ChevronDown-D19e4E2W.js";import{n as hr}from"./ChevronUp-CDr-5amA.js";import{C as is}from"./checkbox-DiEGmfR1.js";import{s as ps}from"./Eye-DjxTeGvc.js";import{n as fr}from"./LinkExternal01-BE6iPh6Z.js";import{u as yr}from"./use-infinite-scroll-Czt7JOf8.js";import{u as Tt}from"./use-copy-BeT4l9EL.js";import{i as Mt}from"./Check-8S_h-pNf.js";import{a as qt}from"./Copy01-CVgcePVg.js";import{i as jr}from"./Key01-BJ5pxmk5.js";import{s as vr}from"./Plus-B99BOqFt.js";import{T as br,a as Nr,b as Cr}from"./tooltip-D9NGFdPV.js";import{i as wr,a as _r}from"./mcp-oauth-uiWOIXGl.js";import{i as Pr}from"./Play-D4uEf4_3.js";import"./auth-LsRMSxpZ.js";import"./ChevronRight-DMiFqEFB.js";import"./use-mobile-2yLfYt8o.js";const Ve="private-registry",Rr=`
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(),W={all:["private-registry"],items:()=>[...W.all,"items"],itemsList:(s,e,r,i)=>[...W.items(),"list",{search:s,tags:e,categories:r,limit:i}],item:s=>[...W.items(),"item",s],filters:()=>[...W.all,"filters"],registryConfig:()=>[...W.all,"registry-config"],registryConfigByPlugin:(s,e)=>[...W.registryConfig(),s,e],publishRequests:()=>[...W.all,"publish-requests"],publishRequestsByOrg:s=>[...W.publishRequests(),"org",s],publishRequestsList:(s,e,r)=>[...W.publishRequests(),"list",{status:s??"all",sortBy:e??"created_at",sortDirection:r??"desc"}],publishRequestsListByOrg:(s,e,r,i)=>[...W.publishRequestsByOrg(s),"list",{status:e??"all",sortBy:r??"created_at",sortDirection:i??"desc"}],publishRequestsCount:()=>[...W.publishRequests(),"count"],publishRequestsCountByOrg:s=>[...W.publishRequestsByOrg(s),"count"],publishApiKeys:()=>[...W.all,"publish-api-keys"],monitor:s=>[...W.all,"monitor",s],monitorRuns:s=>[...W.monitor(s),"runs"],monitorRunsList:(s,e)=>[...W.monitorRuns(s),"list",{status:e??"all"}],monitorRun:(s,e)=>[...W.monitorRuns(s),"run",e??"none"],monitorResults:s=>[...W.monitor(s),"results"],monitorResultsList:(s,e,r)=>[...W.monitorResults(s),"list",{runId:e??"none",status:r??"all"}],monitorConnections:s=>[...W.monitor(s),"connections"],monitorConnectionAuthProbe:(s,e)=>[...W.monitorConnections(s),"auth-probe",e]};async function De(s,e,r){const i=await s.callTool({name:e,arguments:r});if(!i||typeof i!="object")throw new Error(`Invalid tool response for ${e}`);if(i.isError){const n=i.content?.find(l=>l.type==="text")?.text??`Tool ${e} returned an error`;throw new Error(n)}return i.structuredContent??i}function Ir(){const s=Z.c(11),e=Ue(),{org:r}=be();let i;s[0]!==r.id||s[1]!==r.slug?(i={connectionId:ze,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=i):i=s[2];const n=Fe(i);let l;s[3]!==n?(l=async o=>De(n,"REGISTRY_MONITOR_RUN_START",{config:o}),s[3]=n,s[4]=l):l=s[4];let c;s[5]!==r.id||s[6]!==e?(c=async()=>{await Promise.all([e.invalidateQueries({queryKey:W.monitorRuns(r.id)}),e.invalidateQueries({queryKey:W.monitorResults(r.id)})])},s[5]=r.id,s[6]=e,s[7]=c):c=s[7];let a;return s[8]!==l||s[9]!==c?(a={mutationFn:l,onSuccess:c},s[8]=l,s[9]=c,s[10]=a):a=s[10],_e(a)}function kr(){const s=Z.c(11),e=Ue(),{org:r}=be();let i;s[0]!==r.id||s[1]!==r.slug?(i={connectionId:ze,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=i):i=s[2];const n=Fe(i);let l;s[3]!==n?(l=async o=>De(n,"REGISTRY_MONITOR_RUN_CANCEL",{runId:o}),s[3]=n,s[4]=l):l=s[4];let c;s[5]!==r.id||s[6]!==e?(c=async(o,u)=>{await Promise.all([e.invalidateQueries({queryKey:W.monitorRuns(r.id)}),e.invalidateQueries({queryKey:W.monitorRun(r.id,u)})])},s[5]=r.id,s[6]=e,s[7]=c):c=s[7];let a;return s[8]!==l||s[9]!==c?(a={mutationFn:l,onSuccess:c},s[8]=l,s[9]=c,s[10]=a):a=s[10],_e(a)}function Pt(s){const e=Z.c(12),{org:r}=be();let i;e[0]!==r.id||e[1]!==r.slug?(i={connectionId:ze,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=i):i=e[2];const n=Fe(i);let l;e[3]!==r.id||e[4]!==s?(l=W.monitorRunsList(r.id,s),e[3]=r.id,e[4]=s,e[5]=l):l=e[5];let c;e[6]!==n||e[7]!==s?(c=async()=>De(n,"REGISTRY_MONITOR_RUN_LIST",{status:s,limit:100}),e[6]=n,e[7]=s,e[8]=c):c=e[8];let a;return e[9]!==l||e[10]!==c?(a={queryKey:l,queryFn:c,staleTime:5e3},e[9]=l,e[10]=c,e[11]=a):a=e[11],Ae(a)}function zt(s){const e=Z.c(13),{org:r}=be();let i;e[0]!==r.id||e[1]!==r.slug?(i={connectionId:ze,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=i):i=e[2];const n=Fe(i);let l;e[3]!==r.id||e[4]!==s?(l=W.monitorRun(r.id,s),e[3]=r.id,e[4]=s,e[5]=l):l=e[5];let c;e[6]!==n||e[7]!==s?(c=async()=>De(n,"REGISTRY_MONITOR_RUN_GET",{runId:s}),e[6]=n,e[7]=s,e[8]=c):c=e[8];const a=!!s;let o;return e[9]!==l||e[10]!==c||e[11]!==a?(o={queryKey:l,queryFn:c,enabled:a,refetchInterval:Sr},e[9]=l,e[10]=c,e[11]=a,e[12]=o):o=e[12],Ae(o)}function Sr(s){return s.state.data?.run?.status==="running"?5e3:!1}function ut(s,e,r){const i=Z.c(16),{org:n}=be();let l;i[0]!==n.id||i[1]!==n.slug?(l={connectionId:ze,orgId:n.id,orgSlug:n.slug},i[0]=n.id,i[1]=n.slug,i[2]=l):l=i[2];const c=Fe(l);let a;i[3]!==n.id||i[4]!==s||i[5]!==e?(a=W.monitorResultsList(n.id,s,e),i[3]=n.id,i[4]=s,i[5]=e,i[6]=a):a=i[6];let o;i[7]!==c||i[8]!==s||i[9]!==e?(o=async()=>De(c,"REGISTRY_MONITOR_RESULT_LIST",{runId:s,status:e,limit:200,offset:0}),i[7]=c,i[8]=s,i[9]=e,i[10]=o):o=i[10];const u=!!s,d=r==="running"?2500:!1;let m;return i[11]!==a||i[12]!==o||i[13]!==u||i[14]!==d?(m={queryKey:a,queryFn:o,enabled:u,staleTime:5e3,refetchInterval:d},i[11]=a,i[12]=o,i[13]=u,i[14]=d,i[15]=m):m=i[15],Ae(m)}function hs(){const s=Z.c(10),{org:e}=be();let r;s[0]!==e.id||s[1]!==e.slug?(r={connectionId:ze,orgId:e.id,orgSlug:e.slug},s[0]=e.id,s[1]=e.slug,s[2]=r):r=s[2];const i=Fe(r);let n;s[3]!==e.id?(n=W.monitorConnections(e.id),s[3]=e.id,s[4]=n):n=s[4];let l;s[5]!==i?(l=async()=>De(i,"REGISTRY_MONITOR_CONNECTION_LIST",{}),s[5]=i,s[6]=l):l=s[6];let c;return s[7]!==n||s[8]!==l?(c={queryKey:n,queryFn:l,staleTime:1e4},s[7]=n,s[8]=l,s[9]=c):c=s[9],Ae(c)}function Dr(){const s=Z.c(11),e=Ue(),{org:r}=be();let i;s[0]!==r.id||s[1]!==r.slug?(i={connectionId:ze,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=i):i=s[2];const n=Fe(i);let l;s[3]!==n?(l=async()=>De(n,"REGISTRY_MONITOR_CONNECTION_SYNC",{}),s[3]=n,s[4]=l):l=s[4];let c;s[5]!==r.id||s[6]!==e?(c=async()=>{await e.invalidateQueries({queryKey:W.monitorConnections(r.id)})},s[5]=r.id,s[6]=e,s[7]=c):c=s[7];let a;return s[8]!==l||s[9]!==c?(a={mutationFn:l,onSuccess:c},s[8]=l,s[9]=c,s[10]=a):a=s[10],_e(a)}function Tr(){const s=Z.c(11),e=Ue(),{org:r}=be();let i;s[0]!==r.id||s[1]!==r.slug?(i={connectionId:ze,orgId:r.id,orgSlug:r.slug},s[0]=r.id,s[1]=r.slug,s[2]=i):i=s[2];const n=Fe(i);let l;s[3]!==n?(l=async o=>{const{connectionId:u,authStatus:d}=o;return De(n,"REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH",{connectionId:u,authStatus:d})},s[3]=n,s[4]=l):l=s[4];let c;s[5]!==r.id||s[6]!==e?(c=async()=>{await e.invalidateQueries({queryKey:W.monitorConnections(r.id)})},s[5]=r.id,s[6]=e,s[7]=c):c=s[7];let a;return s[8]!==l||s[9]!==c?(a={mutationFn:l,onSuccess:c},s[8]=l,s[9]=c,s[10]=a):a=s[10],_e(a)}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=Z.c(34),{org:e,project:r}=be();let i;s[0]!==e.id||s[1]!==e.slug?(i={connectionId:ze,orgId:e.id,orgSlug:e.slug},s[0]=e.id,s[1]=e.slug,s[2]=i):i=s[2];const n=Fe(i),l=Ue();let c;s[3]!==r.id?(c=W.registryConfigByPlugin(r.id??"",Ve),s[3]=r.id,s[4]=c):c=s[4];let a;s[5]!==n||s[6]!==r.id?(a=async()=>De(n,"VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:r.id,pluginId:Ve}),s[5]=n,s[6]=r.id,s[7]=a):a=s[7];const o=!!r.id;let u;s[8]!==c||s[9]!==a||s[10]!==o?(u={queryKey:c,queryFn:a,enabled:o},s[8]=c,s[9]=a,s[10]=o,s[11]=u):u=s[11];const d=Ae(u),m=d.data?.config?.settings,f=m&&typeof m=="object"?m.testConfig:void 0,g=typeof(m?m.monitorMode??m.testMode:void 0)=="string";let x;s[12]!==f?(x=f??{},s[12]=f,s[13]=x):x=s[13];let h;s[14]!==g||s[15]!==m||s[16]!==f?(h=g&&!f?m:{},s[14]=g,s[15]=m,s[16]=f,s[17]=h):h=s[17];let y;s[18]!==x||s[19]!==h?(y={...ns,...x,...h},s[18]=x,s[19]=h,s[20]=y):y=s[20];const N=y;let w;s[21]!==n||s[22]!==r.id?(w=async P=>{const k=(await De(n,"VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:r.id,pluginId:Ve}))?.config?.settings??{};return De(n,"VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE",{virtualMcpId:r.id,pluginId:Ve,settings:{...k,testConfig:{...ns,...k.testConfig??{},...P}}})},s[21]=n,s[22]=r.id,s[23]=w):w=s[23];let _;s[24]!==r.id||s[25]!==l?(_=async()=>{await l.invalidateQueries({queryKey:W.registryConfigByPlugin(r.id??"",Ve)})},s[24]=r.id,s[25]=l,s[26]=_):_=s[26];let b;s[27]!==w||s[28]!==_?(b={mutationFn:w,onSuccess:_},s[27]=w,s[28]=_,s[29]=b):b=s[29];const L=_e(b);let I;return s[30]!==d.isLoading||s[31]!==L||s[32]!==N?(I={settings:N,isLoading:d.isLoading,saveMutation:L},s[30]=d.isLoading,s[31]=L,s[32]=N,s[33]=I):I=s[33],I}function Mr(){const s=Z.c(3),e=Pt("completed"),r=e.data?.items?.[0]?.id,i=e.data?.items?.[0]?.status,n=ut(r,"failed",i),l=n.data?.items?.length??0,c=e.isLoading||n.isLoading;let a;return s[0]!==l||s[1]!==c?(a={brokenCount:l,isLoading:c},s[0]=l,s[1]=c,s[2]=a):a=s[2],a}const ys=24;function qr(s){return s.trim()}async function ve(s,e,r){return s.call(e,r)}function js(s){const e=Z.c(17),r=Te();let i,n,l,c;e[0]!==s.categories||e[1]!==s.limit||e[2]!==s.search||e[3]!==s.tags?(n=qr(s.search),i=s.limit??ys,c=gs,l=W.itemsList(n,s.tags,s.categories,i),e[0]=s.categories,e[1]=s.limit,e[2]=s.search,e[3]=s.tags,e[4]=i,e[5]=n,e[6]=l,e[7]=c):(i=e[4],n=e[5],l=e[6],c=e[7]);let a;e[8]!==i||e[9]!==s.categories||e[10]!==s.tags||e[11]!==n||e[12]!==r?(a=async u=>{const{pageParam:d}=u,m=n.length>0?{operator:"or",conditions:[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n},{field:["id"],operator:"contains",value:n},{field:["server","name"],operator:"contains",value:n}]}:void 0;return ve(r,"REGISTRY_ITEM_LIST",{cursor:d,limit:i,tags:s.tags.length?s.tags:void 0,categories:s.categories.length?s.categories:void 0,where:m})},e[8]=i,e[9]=s.categories,e[10]=s.tags,e[11]=n,e[12]=r,e[13]=a):a=e[13];let o;return e[14]!==l||e[15]!==a?(o={queryKey:l,queryFn:a,initialPageParam:void 0,getNextPageParam:Er,staleTime:3e4},e[14]=l,e[15]=a,e[16]=o):o=e[16],c(o)}function Er(s){return s.nextCursor}function Lr(){const s=Z.c(6),e=Te();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r=W.filters(),s[0]=r):r=s[0];let i;s[1]!==e?(i=async()=>ve(e,"REGISTRY_ITEM_FILTERS",{}),s[1]=e,s[2]=i):i=s[2];let n;s[3]===Symbol.for("react.memo_cache_sentinel")?(n={tags:[],categories:[]},s[3]=n):n=s[3];let l;return s[4]!==i?(l={queryKey:r,queryFn:i,placeholderData:n,staleTime:6e4},s[4]=i,s[5]=l):l=s[5],Ae(l)}function Ot(){const s=Z.c(27),e=Ue(),r=Te();let i;s[0]!==e?(i=async()=>{await Promise.all([e.invalidateQueries({queryKey:W.items()}),e.invalidateQueries({queryKey:W.filters()})])},s[0]=e,s[1]=i):i=s[1];const n=i;let l;s[2]!==r?(l=async N=>(await ve(r,"REGISTRY_ITEM_CREATE",{data:N})).item,s[2]=r,s[3]=l):l=s[3];let c;s[4]!==n||s[5]!==l?(c={mutationFn:l,onSuccess:n},s[4]=n,s[5]=l,s[6]=c):c=s[6];const a=_e(c);let o;s[7]!==r?(o=async N=>{const{id:w,data:_}=N;return(await ve(r,"REGISTRY_ITEM_UPDATE",{id:w,data:_})).item},s[7]=r,s[8]=o):o=s[8];let u;s[9]!==n||s[10]!==o?(u={mutationFn:o,onSuccess:n},s[9]=n,s[10]=o,s[11]=u):u=s[11];const d=_e(u);let m;s[12]!==r?(m=async N=>(await ve(r,"REGISTRY_ITEM_DELETE",{id:N})).item,s[12]=r,s[13]=m):m=s[13];let f;s[14]!==n||s[15]!==m?(f={mutationFn:m,onSuccess:n},s[14]=n,s[15]=m,s[16]=f):f=s[16];const p=_e(f);let g;s[17]!==r?(g=async N=>ve(r,"REGISTRY_ITEM_BULK_CREATE",{items:N}),s[17]=r,s[18]=g):g=s[18];let x;s[19]!==n||s[20]!==g?(x={mutationFn:g,onSuccess:n},s[19]=n,s[20]=g,s[21]=x):x=s[21];const h=_e(x);let y;return s[22]!==h||s[23]!==a||s[24]!==p||s[25]!==d?(y={createMutation:a,updateMutation:d,deleteMutation:p,bulkCreateMutation:h},s[22]=h,s[23]=a,s[24]=p,s[25]=d,s[26]=y):y=s[26],y}function vs(s){const e=Z.c(24),{org:r}=be(),i=Te(),n=Ue(),l=er.SELF(r.id),c=Ae({queryKey:W.registryConfigByPlugin(l,s),queryFn:async()=>ve(i,"VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:l,pluginId:s}),staleTime:6e4}),a=W.registryConfigByPlugin(l,s);let o;e[0]!==s||e[1]!==l||e[2]!==i?(o=async R=>{const A=(await ve(i,"VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:l,pluginId:s}))?.config?.settings??{};return ve(i,"VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE",{virtualMcpId:l,pluginId:s,settings:{...A,...R}})},e[0]=s,e[1]=l,e[2]=i,e[3]=o):o=e[3];let u;e[4]!==n||e[5]!==a?(u=async()=>{await n.invalidateQueries({queryKey:a})},e[4]=n,e[5]=a,e[6]=u):u=e[6];let d;e[7]!==o||e[8]!==u?(d={mutationFn:o,onSuccess:u,onError:Ar},e[7]=o,e[8]=u,e[9]=d):d=e[9];const m=_e(d);let f;e[10]!==m?(f=R=>{m.mutate(R)},e[10]=m,e[11]=f):f=e[11];const p=f,g=c.data?.config?.settings?.registryName??"Private Registry",x=c.data?.config?.settings?.registryIcon??"",h=c.data?.config?.settings?.acceptPublishRequests??!1,y=c.data?.config?.settings?.requireApiToken??!1,N=c.data?.config?.settings?.storePrivateOnly??!1,w=c.data?.config?.settings?.rateLimitEnabled??!0,b=c.data?.config?.settings?.rateLimitWindow==="minute"?"minute":"hour",L=c.data?.config?.settings?.rateLimitMax,I=typeof L=="number"&&L>=1?Math.floor(L):100;let P;return e[12]!==h||e[13]!==m.isPending||e[14]!==c.isLoading||e[15]!==w||e[16]!==I||e[17]!==b||e[18]!==x||e[19]!==g||e[20]!==y||e[21]!==N||e[22]!==p?(P={registryName:g,registryIcon:x,acceptPublishRequests:h,requireApiToken:y,storePrivateOnly:N,rateLimitEnabled:w,rateLimitWindow:b,rateLimitMax:I,isLoadingConfig:c.isLoading,isSaving:m.isPending,updateConfig:p},e[12]=h,e[13]=m.isPending,e[14]=c.isLoading,e[15]=w,e[16]=I,e[17]=b,e[18]=x,e[19]=g,e[20]=y,e[21]=N,e[22]=p,e[23]=P):P=e[23],P}function Ar(s){G.error(s instanceof Error?s.message:"Failed to save registry settings")}function Ur(s){const e=Z.c(13),{org:r}=be(),i=Te();let n;e[0]!==r.id||e[1]!==s.sortBy||e[2]!==s.sortDirection||e[3]!==s.status?(n=W.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]=n):n=e[4];let l;e[5]!==s.sortBy||e[6]!==s.sortDirection||e[7]!==s.status||e[8]!==i?(l=async a=>{const{pageParam:o}=a;return ve(i,"REGISTRY_PUBLISH_REQUEST_LIST",{status:s.status,sortBy:s.sortBy,sortDirection:s.sortDirection,limit:ys,offset:o})},e[5]=s.sortBy,e[6]=s.sortDirection,e[7]=s.status,e[8]=i,e[9]=l):l=e[9];let c;return e[10]!==n||e[11]!==l?(c={queryKey:n,queryFn:l,initialPageParam:0,getNextPageParam:Fr,staleTime:3e4,refetchOnMount:!0},e[10]=n,e[11]=l,e[12]=c):c=e[12],gs(c)}function Fr(s,e){const r=e.reduce($r,0);return r<s.totalCount?r:void 0}function $r(s,e){return s+e.items.length}function zr(){const s=Z.c(7),{org:e}=be(),r=Te();let i;s[0]!==e.id?(i=W.publishRequestsCountByOrg(e.id),s[0]=e.id,s[1]=i):i=s[1];let n;s[2]!==r?(n=async()=>ve(r,"REGISTRY_PUBLISH_REQUEST_COUNT",{}),s[2]=r,s[3]=n):n=s[3];let l;return s[4]!==i||s[5]!==n?(l={queryKey:i,queryFn:n,staleTime:3e4},s[4]=i,s[5]=n,s[6]=l):l=s[6],Ae(l)}function Or(){const s=Z.c(15),e=Ue(),r=Te();let i;s[0]!==e?(i=async()=>{await Promise.all([e.invalidateQueries({queryKey:W.publishRequests()})])},s[0]=e,s[1]=i):i=s[1];const n=i;let l;s[2]!==r?(l=async f=>ve(r,"REGISTRY_PUBLISH_REQUEST_REVIEW",f),s[2]=r,s[3]=l):l=s[3];let c;s[4]!==n||s[5]!==l?(c={mutationFn:l,onSuccess:n},s[4]=n,s[5]=l,s[6]=c):c=s[6];const a=_e(c);let o;s[7]!==r?(o=async f=>ve(r,"REGISTRY_PUBLISH_REQUEST_DELETE",{id:f}),s[7]=r,s[8]=o):o=s[8];let u;s[9]!==n||s[10]!==o?(u={mutationFn:o,onSuccess:n},s[9]=n,s[10]=o,s[11]=u):u=s[11];const d=_e(u);let m;return s[12]!==d||s[13]!==a?(m={reviewMutation:a,deleteMutation:d},s[12]=d,s[13]=a,s[14]=m):m=s[14],m}function Br(){const s=Z.c(3),e=Te();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r=W.publishApiKeys(),s[0]=r):r=s[0];let i;return s[1]!==e?(i={queryKey:r,queryFn:async()=>ve(e,"REGISTRY_PUBLISH_API_KEY_LIST",{}),staleTime:3e4},s[1]=e,s[2]=i):i=s[2],Ae(i)}function Kr(){const s=Z.c(17),e=Ue(),r=Te();let i;s[0]!==r?(i=async f=>ve(r,"REGISTRY_PUBLISH_API_KEY_GENERATE",{name:f}),s[0]=r,s[1]=i):i=s[1];let n;s[2]!==e?(n=async()=>{await e.invalidateQueries({queryKey:W.publishApiKeys()})},s[2]=e,s[3]=n):n=s[3];let l;s[4]!==i||s[5]!==n?(l={mutationFn:i,onSuccess:n},s[4]=i,s[5]=n,s[6]=l):l=s[6];const c=_e(l);let a;s[7]!==r?(a=async f=>ve(r,"REGISTRY_PUBLISH_API_KEY_REVOKE",{keyId:f}),s[7]=r,s[8]=a):a=s[8];let o;s[9]!==e?(o=async()=>{await e.invalidateQueries({queryKey:W.publishApiKeys()})},s[9]=e,s[10]=o):o=s[10];let u;s[11]!==a||s[12]!==o?(u={mutationFn:a,onSuccess:o},s[11]=a,s[12]=o,s[13]=u):u=s[13];const d=_e(u);let m;return s[14]!==c||s[15]!==d?(m={generateMutation:c,revokeMutation:d},s[14]=c,s[15]=d,s[16]=m):m=s[16],m}function os(s){return s?s.split(/[;|]/).map(e=>e.trim()).filter(Boolean):[]}function as(s){const e=[];let r="",i=!1;for(let n=0;n<s.length;n+=1){const l=s[n],c=s[n+1];if(l==='"'){i&&c==='"'?(r+='"',n+=1):i=!i;continue}if(l===","&&!i){e.push(r.trim()),r="";continue}r+=l}return e.push(r.trim()),e}const Hr=["id","title"],Vr=["id","title","description","remote_url","remote_type","tags","categories","is_public"];function Gr(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=as(e[0]??""),i=new Map,n=[];r.forEach((u,d)=>{const m=u.toLowerCase().trim();m&&i.set(m,d)});for(const u of Hr)i.has(u)||n.push({line:1,message:`Missing required column: "${u}"`});for(const u of r){const d=u.toLowerCase().trim();d&&!Vr.includes(d)&&n.push({line:1,message:`Unknown column "${u}" will be ignored`})}if(!i.has("id")||!i.has("title"))return{items:[],warnings:n,skipped:0};const l=(u,d)=>{const m=i.get(d);return typeof m=="number"?u[m]??"":""},c=[],a=new Set;let o=0;for(let u=1;u<e.length;u+=1){const d=as(e[u]??""),m=l(d,"id").trim(),f=l(d,"title").trim();if(!m){n.push({line:u+1,message:"Missing id — row skipped"}),o+=1;continue}if(!f){n.push({line:u+1,message:`Missing title for id="${m}" — row skipped`}),o+=1;continue}if(a.has(m)){n.push({line:u+1,message:`Duplicate id="${m}" — row skipped`}),o+=1;continue}a.add(m);const p=l(d,"description").trim(),g=l(d,"remote_url").trim(),h=l(d,"remote_type").trim().toLowerCase()==="sse"?"sse":"http",y=os(l(d,"tags")),N=os(l(d,"categories")),w=l(d,"is_public").trim().toLowerCase(),_=w==="true"||w==="1"||w==="yes";c.push({id:m,title:f,description:p||null,is_public:_,_meta:{"mcp.mesh":{...y.length>0?{tags:y}:{},...N.length>0?{categories:N}:{}}},server:{name:m,title:f,description:p||void 0,remotes:g?[{type:h,url:g}]:[]}})}return{items:c,warnings:n,skipped:o}}const Qr=`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 Yr(){const s=new Blob([Qr],{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 Wr(s){const e=Z.c(101),{open:r,onOpenChange:i,isImporting:n,onImport:l}=s,c=n===void 0?!1:n,a=ce(),[o,u]=M.useState(null),[d,m]=M.useState(null),[f,p]=M.useState(null),g=M.useRef(null);let x;e[0]!==i?(x=E=>{i(E),E||(u(null),m(null),p(null),g.current&&(g.current.value=""))},e[0]=i,e[1]=x):x=e[1];const h=x;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=async E=>{if(!E)return;p(E.name),m(null);const O=await E.text();u(Gr(O))},e[2]=y):y=e[2];const N=y;let w;e[3]!==l||e[4]!==o?(w=async()=>{if(!o?.items.length)return;const E=await l(o.items);m(E)},e[3]=l,e[4]=o,e[5]=w):w=e[5];const _=w;let b,L,I,P,R,k,A,q,v,S,D;if(e[6]!==f||e[7]!==_||e[8]!==h||e[9]!==d||e[10]!==c||e[11]!==r||e[12]!==o||e[13]!==a){const E=o?.items??[];let O;e[25]!==o?.warnings?(O=o?.warnings??[],e[25]=o?.warnings,e[26]=O):O=e[26];const j=O;let $;e[27]!==j?($=j.some(Zr),e[27]=j,e[28]=$):$=e[28];const B=$,X=d!==null;I=yt,R=r,k=h,L=jt,S="sm:max-w-3xl max-h-[85vh] flex flex-col";let J;e[29]!==a?(J=a("registry.csvImportDialog.title"),e[29]=a,e[30]=J):J=e[30];let de;e[31]!==J?(de=t.jsx(vt,{children:J}),e[31]=J,e[32]=de):de=e[32];let se;e[33]!==a?(se=a("registry.csvImportDialog.description"),e[33]=a,e[34]=se):se=e[34];let ne;e[35]!==se?(ne=t.jsx(bt,{children:se}),e[35]=se,e[36]=ne):ne=e[36],e[37]!==de||e[38]!==ne?(D=t.jsxs(Nt,{children:[de,ne]}),e[37]=de,e[38]=ne,e[39]=D):D=e[39];let ge;e[40]===Symbol.for("react.memo_cache_sentinel")?(ge=()=>g.current?.click(),e[40]=ge):ge=e[40];let ue;e[41]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(rs,{size:14}),e[41]=ue):ue=e[41];let ie;e[42]!==f||e[43]!==a?(ie=a(f?"registry.csvImportDialog.changeFile":"registry.csvImportDialog.chooseCsvFile"),e[42]=f,e[43]=a,e[44]=ie):ie=e[44];let C;e[45]!==c||e[46]!==ie?(C=t.jsxs(Y,{variant:"outline",size:"sm",className:"gap-1.5",onClick:ge,disabled:c,children:[ue,ie]}),e[45]=c,e[46]=ie,e[47]=C):C=e[47];let K;e[48]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx("input",{ref:g,type:"file",accept:".csv,text/csv",className:"hidden",onChange:je=>N(je.target.files?.[0]??null)}),e[48]=K):K=e[48];let H;e[49]!==f?(H=f&&t.jsx("span",{className:"text-sm text-muted-foreground truncate",children:f}),e[49]=f,e[50]=H):H=e[50];let re;e[51]===Symbol.for("react.memo_cache_sentinel")?(re=t.jsx("div",{className:"flex-1"}),e[51]=re):re=e[51];let xe;e[52]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsx(nr,{size:14}),e[52]=xe):xe=e[52];let ae;e[53]!==a?(ae=a("registry.csvImportDialog.downloadTemplate"),e[53]=a,e[54]=ae):ae=e[54];let Ie;e[55]!==ae?(Ie=t.jsxs(Y,{variant:"ghost",size:"sm",className:"gap-1.5 text-xs text-muted-foreground",onClick:Yr,children:[xe,ae]}),e[55]=ae,e[56]=Ie):Ie=e[56];let Ne;e[57]!==C||e[58]!==H||e[59]!==Ie?(Ne=t.jsxs("div",{className:"flex items-center gap-3",children:[C,K,H,re,Ie]}),e[57]=C,e[58]=H,e[59]=Ie,e[60]=Ne):Ne=e[60];let z;e[61]!==a||e[62]!==j?(z=j.length>0&&t.jsx("div",{className:"rounded-lg border border-warning/20 bg-warning/10 p-3 grid gap-1",children:j.map((je,Oe)=>t.jsxs("p",{className:"text-xs text-warning flex items-start gap-1.5",children:[t.jsx(tt,{size:12,className:"shrink-0 mt-0.5"}),t.jsxs("span",{children:[je.line>0&&t.jsx("span",{className:"font-mono text-[10px] mr-1",children:a("registry.csvImportDialog.linePrefix",{line:je.line})}),je.message]})]},`${je.line}-${Oe}`))}),e[61]=a,e[62]=j,e[63]=z):z=e[63];const le=E.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:a("registry.csvImportDialog.preview")}),t.jsx(V,{variant:"secondary",children:a("registry.csvImportDialog.itemsCount",{count:E.length})}),o?.skipped?t.jsx(V,{variant:"outline",className:"text-warning",children:a("registry.csvImportDialog.skippedCount",{count:o.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(At,{children:[t.jsx(Ut,{children:t.jsxs(Je,{children:[t.jsx(pe,{className:"w-[140px]",children:a("registry.csvImportDialog.tableIdHeader")}),t.jsx(pe,{children:a("registry.csvImportDialog.tableTitleHeader")}),t.jsx(pe,{children:a("registry.csvImportDialog.tableUrlHeader")}),t.jsx(pe,{className:"w-[80px] text-center",children:a("registry.csvImportDialog.tablePublicHeader")}),t.jsx(pe,{children:a("registry.csvImportDialog.tableTagsHeader")})]})}),t.jsx(Ft,{children:E.map(je=>t.jsxs(Je,{children:[t.jsx(he,{className:"font-mono text-xs",children:je.id}),t.jsx(he,{className:"text-sm",children:je.title}),t.jsx(he,{className:"text-xs text-muted-foreground max-w-[200px] truncate",children:je.server.remotes?.[0]?.url??t.jsx("span",{className:"italic",children:a("registry.csvImportDialog.tableNoneValue")})}),t.jsx(he,{className:"text-center",children:je.is_public?t.jsx(V,{variant:"secondary",className:"text-[10px] bg-success/10 text-success",children:a("registry.csvImportDialog.tableYesValue")}):t.jsx("span",{className:"text-xs text-muted-foreground",children:a("registry.csvImportDialog.tableNoValue")})}),t.jsx(he,{className:"text-xs text-muted-foreground",children:(je._meta?.["mcp.mesh"]?.tags??[]).join(", ")||"-"})]},je.id))})]})})})]});let ke;e[64]!==d||e[65]!==a?(ke=d&&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(We,{size:16,className:"text-success"}),a("registry.csvImportDialog.importedCount",{count:d.created})]}),d.errors.length>0&&t.jsx("div",{className:"grid gap-1 mt-1",children:d.errors.map(Jr)})]}),e[64]=d,e[65]=a,e[66]=ke):ke=e[66];let Pe;e[67]!==X||e[68]!==o||e[69]!==a?(Pe=!o&&!X&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[t.jsx(rs,{size:32,className:"text-muted-foreground/40 mb-3"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:a("registry.csvImportDialog.emptyStateHint")}),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[67]=X,e[68]=o,e[69]=a,e[70]=Pe):Pe=e[70],e[71]!==Ne||e[72]!==z||e[73]!==le||e[74]!==ke||e[75]!==Pe?(P=t.jsxs("div",{className:"flex-1 overflow-y-auto grid gap-4 pr-1",children:[Ne,z,le,ke,Pe]}),e[71]=Ne,e[72]=z,e[73]=le,e[74]=ke,e[75]=Pe,e[76]=P):P=e[76],b=Ct,A="gap-2 sm:gap-0";let $e;e[77]!==h?($e=()=>h(!1),e[77]=h,e[78]=$e):$e=e[78];let Me;e[79]!==X||e[80]!==a?(Me=a(X?"registry.csvImportDialog.doneButton":"registry.csvImportDialog.cancelButton"),e[79]=X,e[80]=a,e[81]=Me):Me=e[81],e[82]!==$e||e[83]!==Me?(q=t.jsx(Y,{variant:"outline",onClick:$e,children:Me}),e[82]=$e,e[83]=Me,e[84]=q):q=e[84],v=!X&&t.jsx(Y,{onClick:_,disabled:c||E.length===0||B,children:c?a("registry.csvImportDialog.importingButton"):a("registry.csvImportDialog.importButton",{count:E.length})}),e[6]=f,e[7]=_,e[8]=h,e[9]=d,e[10]=c,e[11]=r,e[12]=o,e[13]=a,e[14]=b,e[15]=L,e[16]=I,e[17]=P,e[18]=R,e[19]=k,e[20]=A,e[21]=q,e[22]=v,e[23]=S,e[24]=D}else b=e[14],L=e[15],I=e[16],P=e[17],R=e[18],k=e[19],A=e[20],q=e[21],v=e[22],S=e[23],D=e[24];let F;e[85]!==b||e[86]!==A||e[87]!==q||e[88]!==v?(F=t.jsxs(b,{className:A,children:[q,v]}),e[85]=b,e[86]=A,e[87]=q,e[88]=v,e[89]=F):F=e[89];let T;e[90]!==L||e[91]!==P||e[92]!==F||e[93]!==S||e[94]!==D?(T=t.jsxs(L,{className:S,children:[D,P,F]}),e[90]=L,e[91]=P,e[92]=F,e[93]=S,e[94]=D,e[95]=T):T=e[95];let U;return e[96]!==I||e[97]!==R||e[98]!==k||e[99]!==T?(U=t.jsx(I,{open:R,onOpenChange:k,children:T}),e[96]=I,e[97]=R,e[98]=k,e[99]=T,e[100]=U):U=e[100],U}function Jr(s){return t.jsxs("p",{className:"text-xs text-destructive flex items-start gap-1.5",children:[t.jsx(tt,{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 Zr(s){return s.message.startsWith("Missing required column:")}function Xr(s){const e=Z.c(34),{open:r,onOpenChange:i,title:n,isDeleting:l,onConfirm:c}=s,a=l===void 0?!1:l,o=ce();let u;e[0]!==o?(u=o("registry.deleteConfirmDialog.title"),e[0]=o,e[1]=u):u=e[1];let d;e[2]!==u?(d=t.jsx(st,{children:u}),e[2]=u,e[3]=d):d=e[3];let m;e[4]!==o||e[5]!==n?(m=o("registry.deleteConfirmDialog.description",{title:n}),e[4]=o,e[5]=n,e[6]=m):m=e[6];let f;e[7]!==m?(f=t.jsx(rt,{children:m}),e[7]=m,e[8]=f):f=e[8];let p;e[9]!==d||e[10]!==f?(p=t.jsxs(it,{children:[d,f]}),e[9]=d,e[10]=f,e[11]=p):p=e[11];let g;e[12]!==o?(g=o("registry.deleteConfirmDialog.cancel"),e[12]=o,e[13]=g):g=e[13];let x;e[14]!==a||e[15]!==g?(x=t.jsx(nt,{disabled:a,children:g}),e[14]=a,e[15]=g,e[16]=x):x=e[16];let h;e[17]!==a||e[18]!==o?(h=o(a?"registry.deleteConfirmDialog.deleting":"registry.deleteConfirmDialog.delete"),e[17]=a,e[18]=o,e[19]=h):h=e[19];let y;e[20]!==a||e[21]!==c||e[22]!==h?(y=t.jsx(ot,{disabled:a,onClick:c,children:h}),e[20]=a,e[21]=c,e[22]=h,e[23]=y):y=e[23];let N;e[24]!==y||e[25]!==x?(N=t.jsxs(at,{children:[x,y]}),e[24]=y,e[25]=x,e[26]=N):N=e[26];let w;e[27]!==N||e[28]!==p?(w=t.jsxs(lt,{children:[p,N]}),e[27]=N,e[28]=p,e[29]=w):w=e[29];let _;return e[30]!==i||e[31]!==r||e[32]!==w?(_=t.jsx(ct,{open:r,onOpenChange:i,children:w}),e[30]=i,e[31]=r,e[32]=w,e[33]=_):_=e[33],_}function ei(s){const[e]=s.id.split("/");return e??"provider"}function ti(s){return s._meta?.["mcp.mesh"]?.tags??[]}function si(s){return s._meta?.["mcp.mesh"]?.categories??[]}function ri(s){return s.server?.icons?.[0]?.src??null}function ii(s){const e=Z.c(107),{item:r,onEdit:i,onDelete:n,onToggleVerified:l,onToggleOfficial:c}=s,a=ce();let o;e[0]!==r?(o=ri(r),e[0]=r,e[1]=o):o=e[1];const u=o,d=r._meta?.["mcp.mesh"]?.verified===!0,m=r._meta?.["mcp.mesh"]?.official===!0;let f;e[2]!==r?(f=[...ti(r),...si(r)],e[2]=r,e[3]=f):f=e[3];const p=f;let g;e[4]!==p?(g=p.slice(0,3),e[4]=p,e[5]=g):g=e[5];const x=g,h=Math.max(0,p.length-x.length);let y;e[6]!==u||e[7]!==r.title?(y=t.jsx("div",{className:"size-10 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0 flex items-center justify-center",children:u?t.jsx("img",{src:u,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]=u,e[7]=r.title,e[8]=y):y=e[8];let N;e[9]!==r.title?(N=t.jsx("p",{className:"font-medium truncate",children:r.title}),e[9]=r.title,e[10]=N):N=e[10];let w;e[11]!==r?(w=ei(r),e[11]=r,e[12]=w):w=e[12];let _;e[13]!==w?(_=t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:w}),e[13]=w,e[14]=_):_=e[14];let b;e[15]!==r.is_public||e[16]!==a?(b=r.is_public?t.jsxs(V,{variant:"default",className:"gap-1",children:[t.jsx(xs,{size:10}),a("registry.registryItemCard.public")]}):t.jsx(V,{variant:"secondary",children:a("registry.registryItemCard.private")}),e[15]=r.is_public,e[16]=a,e[17]=b):b=e[17];let L;e[18]!==m||e[19]!==a?(L=m&&t.jsxs(V,{variant:"outline",className:"gap-1 text-primary",children:[t.jsx(Xt,{size:10}),a("registry.registryItemCard.official")]}),e[18]=m,e[19]=a,e[20]=L):L=e[20];let I;e[21]!==m||e[22]!==d||e[23]!==a?(I=!m&&d&&t.jsxs(V,{variant:"outline",className:"gap-1 text-success",children:[t.jsx(Xt,{size:10}),a("registry.registryItemCard.verified")]}),e[21]=m,e[22]=d,e[23]=a,e[24]=I):I=e[24];let P;e[25]!==I||e[26]!==_||e[27]!==b||e[28]!==L?(P=t.jsxs("div",{className:"flex items-center gap-2",children:[_,b,L,I]}),e[25]=I,e[26]=_,e[27]=b,e[28]=L,e[29]=P):P=e[29];let R;e[30]!==P||e[31]!==N?(R=t.jsxs("div",{className:"min-w-0 flex-1",children:[N,P]}),e[30]=P,e[31]=N,e[32]=R):R=e[32];let k;e[33]!==R||e[34]!==y?(k=t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[y,R]}),e[33]=R,e[34]=y,e[35]=k):k=e[35];let A;e[36]!==r.title||e[37]!==a?(A=a("registry.registryItemCard.actionsFor",{title:r.title}),e[36]=r.title,e[37]=a,e[38]=A):A=e[38];let q;e[39]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx($t,{size:18}),e[39]=q):q=e[39];let v;e[40]!==A?(v=t.jsx(pt,{asChild:!0,children:t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0","aria-label":A,children:q})}),e[40]=A,e[41]=v):v=e[41];let S;e[42]!==r||e[43]!==i?(S=()=>i(r),e[42]=r,e[43]=i,e[44]=S):S=e[44];let D;e[45]!==a?(D=a("registry.registryItemCard.edit"),e[45]=a,e[46]=D):D=e[46];let F;e[47]!==S||e[48]!==D?(F=t.jsx(Re,{onClick:S,children:D}),e[47]=S,e[48]=D,e[49]=F):F=e[49];let T;e[50]!==r||e[51]!==l?(T=()=>l(r),e[50]=r,e[51]=l,e[52]=T):T=e[52];let U;e[53]!==d||e[54]!==a?(U=a(d?"registry.registryItemCard.unmarkAsVerified":"registry.registryItemCard.markAsVerified"),e[53]=d,e[54]=a,e[55]=U):U=e[55];let E;e[56]!==T||e[57]!==U?(E=t.jsx(Re,{onClick:T,children:U}),e[56]=T,e[57]=U,e[58]=E):E=e[58];let O;e[59]!==r||e[60]!==c?(O=()=>c(r),e[59]=r,e[60]=c,e[61]=O):O=e[61];let j;e[62]!==m||e[63]!==a?(j=a(m?"registry.registryItemCard.unmarkAsOfficial":"registry.registryItemCard.markAsOfficial"),e[62]=m,e[63]=a,e[64]=j):j=e[64];let $;e[65]!==O||e[66]!==j?($=t.jsx(Re,{onClick:O,children:j}),e[65]=O,e[66]=j,e[67]=$):$=e[67];let B;e[68]!==r||e[69]!==n?(B=()=>n(r),e[68]=r,e[69]=n,e[70]=B):B=e[70];let X;e[71]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(dt,{size:14}),e[71]=X):X=e[71];let J;e[72]!==a?(J=a("registry.registryItemCard.delete"),e[72]=a,e[73]=J):J=e[73];let de;e[74]!==B||e[75]!==J?(de=t.jsxs(Re,{variant:"destructive",onClick:B,children:[X,J]}),e[74]=B,e[75]=J,e[76]=de):de=e[76];let se;e[77]!==F||e[78]!==E||e[79]!==$||e[80]!==de?(se=t.jsxs(ht,{align:"end",children:[F,E,$,de]}),e[77]=F,e[78]=E,e[79]=$,e[80]=de,e[81]=se):se=e[81];let ne;e[82]!==v||e[83]!==se?(ne=t.jsxs(ft,{children:[v,se]}),e[82]=v,e[83]=se,e[84]=ne):ne=e[84];let ge;e[85]!==k||e[86]!==ne?(ge=t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[k,ne]}),e[85]=k,e[86]=ne,e[87]=ge):ge=e[87];let ue;e[88]!==r._meta||e[89]!==r.description||e[90]!==r.server||e[91]!==a?(ue=r._meta?.["mcp.mesh"]?.short_description||r.description||r.server.description||a("registry.registryItemCard.noDescriptionProvided"),e[88]=r._meta,e[89]=r.description,e[90]=r.server,e[91]=a,e[92]=ue):ue=e[92];let ie;e[93]!==ue?(ie=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 min-h-10",children:ue}),e[93]=ue,e[94]=ie):ie=e[94];let C;e[95]!==r.id||e[96]!==x?(C=x.map(xe=>t.jsx(V,{variant:"secondary",children:xe},`${r.id}-badge-${xe}`)),e[95]=r.id,e[96]=x,e[97]=C):C=e[97];let K;e[98]!==h?(K=h>0&&t.jsxs(V,{variant:"outline",children:["+",h]}),e[98]=h,e[99]=K):K=e[99];let H;e[100]!==C||e[101]!==K?(H=t.jsxs("div",{className:"flex flex-wrap gap-1",children:[C,K]}),e[100]=C,e[101]=K,e[102]=H):H=e[102];let re;return e[103]!==ge||e[104]!==ie||e[105]!==H?(re=t.jsxs(me,{className:"p-4 gap-4 transition-colors hover:bg-muted/50",children:[ge,ie,H]}),e[103]=ge,e[104]=ie,e[105]=H,e[106]=re):re=e[106],re}function bs(s){const e=Z.c(33),{value:r,onChange:i,onBlur:n,onFileUpload:l,error:c,isUploading:a}=s,o=a===void 0?!1:a,u=ce(),[d,m]=M.useState(!1),[f,p]=M.useState(!1),g=M.useRef(null);let x;e[0]!==o?(x=S=>{S.preventDefault(),o||m(!0)},e[0]=o,e[1]=x):x=e[1];const h=x;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=S=>{S.preventDefault(),m(!1)},e[2]=y):y=e[2];const N=y;let w;e[3]!==o||e[4]!==l?(w=async S=>{if(S.preventDefault(),m(!1),o)return;const D=S.dataTransfer.files[0];D&&await l(D)},e[3]=o,e[4]=l,e[5]=w):w=e[5];const _=w;let b;e[6]!==o||e[7]!==l?(b=async S=>{const D=S.target.files?.[0];D&&!o&&await l(D),S.target.value=""},e[6]=o,e[7]=l,e[8]=b):b=e[8];const L=b,I=r.length>0;let P;e[9]!==u?(P=u("registry.imageUpload.image"),e[9]=u,e[10]=P):P=e[10];let R;e[11]!==P?(R=t.jsx(oe,{children:P}),e[11]=P,e[12]=R):R=e[12];let k;e[13]!==h||e[14]!==_||e[15]!==I||e[16]!==d||e[17]!==o||e[18]!==n||e[19]!==i||e[20]!==f||e[21]!==u||e[22]!==r?(k=I?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:u("registry.imageUpload.previewAlt"),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(Y,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>g.current?.click(),disabled:o,children:[t.jsx(Lt,{className:"size-3"}),u("registry.imageUpload.change")]}),t.jsxs(Y,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 text-destructive hover:text-destructive",onClick:()=>{i(""),p(!1)},disabled:o,children:[t.jsx(dt,{className:"size-3"}),u("registry.imageUpload.remove")]})]})]})]})}):o?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(Ye,{className:"size-8 animate-spin text-muted-foreground"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:u("registry.imageUpload.uploadingImage")})]}):t.jsxs("div",{className:te("relative min-h-[180px] rounded-xl border-2 border-dashed transition-colors cursor-pointer flex flex-col",d?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/40 hover:bg-muted/30"),onDragOver:h,onDragLeave:N,onDrop:_,onClick:()=>g.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:te("size-10 rounded-lg flex items-center justify-center transition-colors",d?"bg-primary/10 text-primary":"bg-muted/50 text-muted-foreground"),children:t.jsx(Ws,{size:20})}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:u(d?"registry.imageUpload.dropImageHere":"registry.imageUpload.clickOrDragToUpload")}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:u("registry.imageUpload.supportedFormats")})]})]}),f?t.jsx("div",{className:"border-t border-border px-3 py-2",onClick:ni,children:t.jsx(ye,{placeholder:u("registry.imageUpload.urlPlaceholder"),value:r,className:"text-xs h-8",onChange:S=>i(S.target.value),onBlur:n})}):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:S=>{S.stopPropagation(),p(!0)},children:[t.jsx(gr,{className:"size-3"}),u("registry.imageUpload.orPasteImageUrl")]})})]}),e[13]=h,e[14]=_,e[15]=I,e[16]=d,e[17]=o,e[18]=n,e[19]=i,e[20]=f,e[21]=u,e[22]=r,e[23]=k):k=e[23];let A;e[24]!==L?(A=t.jsx("input",{ref:g,type:"file",accept:"image/*",className:"hidden",onChange:L}),e[24]=L,e[25]=A):A=e[25];let q;e[26]!==c?(q=c&&t.jsx("p",{className:"text-xs text-destructive",children:c}),e[26]=c,e[27]=q):q=e[27];let v;return e[28]!==q||e[29]!==R||e[30]!==k||e[31]!==A?(v=t.jsxs("div",{className:"grid gap-1.5",children:[R,k,A,q]}),e[28]=q,e[29]=R,e[30]=k,e[31]=A,e[32]=v):v=e[32],v}function ni(s){return s.stopPropagation()}function Ns(){const[s,e]=M.useState("idle"),[r,i]=M.useState(null),n=Te();return{discover:async(a,o)=>{if(!a)return null;e("loading"),i(null);try{const u=await n.call("REGISTRY_DISCOVER_TOOLS",{url:a,type:o==="sse"?"sse":"http"});return u.error?oi(u.error)?(i(u.error),e("auth_required"),null):(i(u.error),e("error"),null):!u.tools||u.tools.length===0?(i("No tools found on this MCP server."),e("error"),null):(e("success"),u.tools)}catch(u){const d=u instanceof Error?u.message:String(u);return i(d||"Could not discover tools."),e("error"),null}},discoverStatus:s,discoverError:r,resetDiscover:()=>{e("idle"),i(null)}}}function oi(s){const e=s.toLowerCase();return e.includes("authentication")||e.includes("unauthorized")||e.includes("credentials")}function ai(s){const e=Z.c(62),{tools:r,onChange:i,remoteUrl:n,remoteType:l,externalDiscoverStatus:c,externalDiscoverError:a}=s,o=ce(),[u,d]=M.useState(r.length>0),{discover:m,discoverStatus:f,discoverError:p,resetDiscover:g}=Ns(),x=c??f,h=a??p;let y;e[0]!==m||e[1]!==i||e[2]!==l||e[3]!==n?(y=async()=>{if(!n)return;const j=await m(n,l??"http");j&&(i(j),d(!0))},e[0]=m,e[1]=i,e[2]=l,e[3]=n,e[4]=y):y=e[4];const N=y;let w;e[5]!==i||e[6]!==g?(w=()=>{i([]),g()},e[5]=i,e[6]=g,e[7]=w):w=e[7];const _=w;let b;e[8]!==u?(b=()=>d(!u),e[8]=u,e[9]=b):b=e[9];let L;e[10]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(ms,{size:14,className:"text-muted-foreground"}),e[10]=L):L=e[10];let I;e[11]!==o?(I=o("registry.toolsEditor.tools"),e[11]=o,e[12]=I):I=e[12];let P;e[13]!==I?(P=t.jsx("span",{children:I}),e[13]=I,e[14]=P):P=e[14];let R;e[15]!==r.length?(R=r.length>0&&t.jsx(V,{variant:"secondary",className:"text-xs px-1.5 py-0",children:r.length}),e[15]=r.length,e[16]=R):R=e[16];let k;e[17]!==u?(k=u?t.jsx(hr,{size:14,className:"text-muted-foreground"}):t.jsx(pr,{size:14,className:"text-muted-foreground"}),e[17]=u,e[18]=k):k=e[18];let A;e[19]!==b||e[20]!==P||e[21]!==R||e[22]!==k?(A=t.jsxs("button",{type:"button",className:"flex items-center gap-2 text-sm font-medium cursor-pointer",onClick:b,children:[L,P,R,k]}),e[19]=b,e[20]=P,e[21]=R,e[22]=k,e[23]=A):A=e[23];let q;e[24]!==_||e[25]!==o||e[26]!==r.length?(q=r.length>0&&t.jsxs(Y,{type:"button",variant:"ghost",size:"sm",className:"h-7 text-xs gap-1.5 text-muted-foreground",onClick:_,children:[t.jsx(dt,{size:12}),o("registry.toolsEditor.clear")]}),e[24]=_,e[25]=o,e[26]=r.length,e[27]=q):q=e[27];let v;e[28]!==x||e[29]!==N||e[30]!==n||e[31]!==o||e[32]!==r.length?(v=n&&t.jsxs(Y,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 border-success/30 text-success shadow-[0_0_8px_color-mix(in_oklch,var(--success)_30%,transparent)] hover:shadow-[0_0_14px_color-mix(in_oklch,var(--success)_50%,transparent)] hover:border-success/50 transition-all",onClick:N,disabled:x==="loading",children:[x==="loading"?t.jsx(Ye,{size:12,className:"animate-spin"}):t.jsx(Lt,{size:12}),x==="loading"?o("registry.toolsEditor.discovering"):r.length>0?o("registry.toolsEditor.refresh"):o("registry.toolsEditor.autoDiscover")]}),e[28]=x,e[29]=N,e[30]=n,e[31]=o,e[32]=r.length,e[33]=v):v=e[33];let S;e[34]!==q||e[35]!==v?(S=t.jsxs("div",{className:"flex items-center gap-2",children:[q,v]}),e[34]=q,e[35]=v,e[36]=S):S=e[36];let D;e[37]!==S||e[38]!==A?(D=t.jsxs("div",{className:"flex items-center justify-between",children:[A,S]}),e[37]=S,e[38]=A,e[39]=D):D=e[39];let F;e[40]!==x||e[41]!==o||e[42]!==r.length?(F=x==="success"&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-success bg-success/10 rounded-lg px-3 py-2",children:[t.jsx(We,{size:14,className:"shrink-0"}),t.jsx("span",{children:o("registry.toolsEditor.discoveredSuccess",{count:r.length})})]}),e[40]=x,e[41]=o,e[42]=r.length,e[43]=F):F=e[43];let T;e[44]!==h||e[45]!==x?(T=x==="error"&&h&&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(tt,{size:14,className:"shrink-0"}),t.jsx("span",{children:h})]}),e[44]=h,e[45]=x,e[46]=T):T=e[46];let U;e[47]!==u||e[48]!==r?(U=u&&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(li)}),e[47]=u,e[48]=r,e[49]=U):U=e[49];let E;e[50]!==x||e[51]!==u||e[52]!==n||e[53]!==o||e[54]!==r.length?(E=u&&r.length===0&&x==="idle"&&t.jsx("p",{className:"text-xs text-muted-foreground px-1",children:o(n?"registry.toolsEditor.emptyHintWithUrl":"registry.toolsEditor.emptyHintWithoutUrl")}),e[50]=x,e[51]=u,e[52]=n,e[53]=o,e[54]=r.length,e[55]=E):E=e[55];let O;return e[56]!==D||e[57]!==F||e[58]!==T||e[59]!==U||e[60]!==E?(O=t.jsxs("div",{className:"space-y-3",children:[D,F,T,U,E]}),e[56]=D,e[57]=F,e[58]=T,e[59]=U,e[60]=E,e[61]=O):O=e[61],O}function li(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 Cs(s){const{org:e}=be(),[r,i]=M.useState(!1),l=typeof window<"u"&&window.location.hostname==="localhost"?`${e.id}_dev-assets`:null,c=Fe({connectionId:l??"noop",orgId:e.id,orgSlug:e.slug});return{uploadImage:async(o,u)=>{if(!l)return G.error("Image upload requires an object-storage connection. Configure one in plugin settings."),null;if(!o.type.startsWith("image/"))return G.error("Only image files are supported"),null;if(o.size>5*1024*1024)return G.error("Image size must be less than 5MB"),null;i(!0);try{const d=await c.callTool({name:"PUT_PRESIGNED_URL",arguments:{key:u,contentType:o.type}}),m=d.structuredContent?.url||d.url;if(!m)throw new Error("Failed to get presigned URL");const f=await fetch(m,{method:"PUT",body:o,headers:{"Content-Type":o.type}});if(!f.ok)throw new Error(`Upload failed: ${f.statusText}`);const p=await c.callTool({name:"GET_PRESIGNED_URL",arguments:{key:u,expiresIn:31536e3}}),g=p.structuredContent?.url||p.url;if(!g)throw new Error("Failed to get public URL");return g}catch(d){return console.error("Image upload failed:",d),G.error(d instanceof Error?d.message:"Failed to upload image. Please try again."),null}finally{i(!1)}},isUploading:r}}const ci=new Set(["http","sse","stdio"]),di=/^[a-z0-9]+(?:[/-][a-z0-9._-]+)*$/,ui=["internal","automation","support","sales","ops","ai"],mi=["productivity","communication","customer-support","development","data","operations"],gi=["registry.registryItemDialog.essentials","registry.registryItemDialog.details","registry.registryItemDialog.advanced"],xi="h-7 text-xs border-success/30 text-success shadow-[0_0_8px_color-mix(in_oklch,var(--success)_30%,transparent)] hover:shadow-[0_0_14px_color-mix(in_oklch,var(--success)_50%,transparent)] hover:border-success/50 transition-all";function ls(s){return s.replace(/^https?:\/\//i,"").trim()}function et(s){const e=s.trim();return e?/^https?:\/\//i.test(e)?e:`https://${e}`:""}function Qe(s){return s.trim().toLowerCase()}function _t(s){return Array.from(new Set(s.map(Qe).filter(e=>e.length>0)))}function Ke(s){return s.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9._-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function pi(s){const e=Z.c(5),{current:r}=s,i=ce();let n;e[0]!==r||e[1]!==i?(n=gi.map((c,a)=>{const o=a+1,u=o===r,d=o<r;return t.jsxs("div",{className:"flex items-center gap-1.5",children:[a>0&&t.jsx("div",{className:te("w-4 h-px",d?"bg-primary":"bg-border")}),t.jsxs("div",{className:te("flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs transition-colors",u?"bg-primary/10 text-primary font-medium":d?"text-primary":"text-muted-foreground"),children:[t.jsx("span",{className:te("size-5 rounded-full inline-flex items-center justify-center text-[10px] font-semibold shrink-0",u?"bg-primary text-primary-foreground":d?"bg-primary/20 text-primary":"bg-muted text-muted-foreground"),children:o}),t.jsx("span",{className:"hidden sm:inline",children:i(c)})]})]},c)}),e[0]=r,e[1]=i,e[2]=n):n=e[2];let l;return e[3]!==n?(l=t.jsx("div",{className:"flex items-center gap-1.5",children:n}),e[3]=n,e[4]=l):l=e[4],l}function hi(s){const e=Z.c(32),{id:r,labelKey:i,values:n,availableOptions:l,placeholderKey:c,onChange:a}=s,o=ce(),[u,d]=M.useState(""),[m,f]=M.useState(!1);let p,g,x,h,y;if(e[0]!==l||e[1]!==r||e[2]!==u||e[3]!==m||e[4]!==i||e[5]!==a||e[6]!==c||e[7]!==o||e[8]!==n){const _=_t(l),b=_t(n),L=new Set(b),I=Qe(u),P=_.filter(T=>!L.has(T)).filter(T=>I?T.includes(I):!0).slice(0,8),R=T=>{const U=Qe(T);!U||L.has(U)||a([...b,U])},k=T=>{a(b.filter(U=>U!==T))},A=()=>{const T=u.split(/[,\n;]/).map(Qe).filter(Boolean);if(T.length===0)return;const U=[...b];for(const E of T)U.includes(E)||U.push(E);a(U),d("")},q=I;h="grid gap-2";let v;e[14]!==i||e[15]!==o?(v=o(i),e[14]=i,e[15]=o,e[16]=v):v=e[16],e[17]!==r||e[18]!==v?(y=t.jsx(oe,{htmlFor:r,children:v}),e[17]=r,e[18]=v,e[19]=y):y=e[19],p="relative";let S;e[20]!==r?(S=()=>{const T=document.getElementById(r);T instanceof HTMLInputElement&&T.focus()},e[20]=r,e[21]=S):S=e[21];let D;e[22]===Symbol.for("react.memo_cache_sentinel")?(D=()=>f(!0),e[22]=D):D=e[22];let F;e[23]===Symbol.for("react.memo_cache_sentinel")?(F=T=>d(T.target.value),e[23]=F):F=e[23],g=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:S,children:t.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[b.map(T=>t.jsxs(V,{variant:"secondary",className:"gap-1",children:[T,t.jsx("button",{type:"button",onClick:U=>{U.preventDefault(),U.stopPropagation(),k(T)},children:t.jsx(mr,{size:12})})]},`${r}-${T}`)),t.jsx("input",{id:r,className:"flex-1 min-w-[120px] bg-transparent outline-none border-none text-sm",placeholder:b.length?"":o(c),value:u,onFocus:D,onBlur:()=>{f(!1),A()},onChange:F,onKeyDown:T=>{if(T.key==="Enter"||T.key===","){T.preventDefault(),A();return}T.key==="Backspace"&&!u&&b.length&&k(b[b.length-1]??"")}})]})}),x=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:P.length>0?P.map(T=>t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:yi,onClick:()=>{R(T),d("")},children:T},`${r}-suggestion-${T}`)):q?t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:fi,onClick:()=>{R(q),d("")},children:o("registry.registryItemDialog.createTag",{value:q})}):t.jsx("div",{className:"px-2.5 py-1.5 text-sm text-muted-foreground",children:o("registry.registryItemDialog.typeToSearchOrCreate")})}),e[0]=l,e[1]=r,e[2]=u,e[3]=m,e[4]=i,e[5]=a,e[6]=c,e[7]=o,e[8]=n,e[9]=p,e[10]=g,e[11]=x,e[12]=h,e[13]=y}else p=e[9],g=e[10],x=e[11],h=e[12],y=e[13];let N;e[24]!==p||e[25]!==g||e[26]!==x?(N=t.jsxs("div",{className:p,children:[g,x]}),e[24]=p,e[25]=g,e[26]=x,e[27]=N):N=e[27];let w;return e[28]!==h||e[29]!==y||e[30]!==N?(w=t.jsxs("div",{className:h,children:[y,N]}),e[28]=h,e[29]=y,e[30]=N,e[31]=w):w=e[31],w}function fi(s){return s.preventDefault()}function yi(s){return s.preventDefault()}function ji({id:s,value:e,availableOptions:r,onChange:i}){const n=ce(),[l,c]=M.useState(e),[a,o]=M.useState(!1),u=M.useRef(e);u.current!==e&&(u.current=e,c(e));const d=_t([...mi,...r,e]).filter(Boolean),m=Qe(l),f=d.filter(g=>m?g.includes(m):!0).slice(0,8),p=g=>{const x=Qe(g);i(x),c(x),o(!1)};return t.jsxs("div",{className:"grid gap-2",children:[t.jsx(oe,{htmlFor:s,children:n("registry.registryItemDialog.category")}),t.jsxs("div",{className:"relative",children:[t.jsx(ye,{id:s,className:"h-9 text-sm",placeholder:n("registry.registryItemDialog.selectOrCreateCategory"),value:l,onFocus:()=>{c(e),o(!0)},onBlur:()=>{p(l)},onChange:g=>c(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),p(l))}}),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:g=>g.preventDefault(),onClick:()=>{i(""),c("")},children:n("registry.registryItemDialog.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:f.length>0?f.map(g=>t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:x=>x.preventDefault(),onClick:()=>p(g),children:g},`${s}-${g}`)):m?t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:g=>g.preventDefault(),onClick:()=>p(m),children:n("registry.registryItemDialog.createCategory",{value:m})}):t.jsx("div",{className:"px-2.5 py-1.5 text-sm text-muted-foreground",children:n("registry.registryItemDialog.typeToSearchOrCreate")})})]})]})}function vi({open:s,onOpenChange:e,item:r,draft:i,availableTags:n=[],availableCategories:l=[],isSubmitting:c=!1,onSubmit:a}){const o=ce(),{org:u}=be(),{uploadImage:d,isUploading:m}=Cs(),{discover:f,discoverStatus:p,discoverError:g,resetDiscover:x}=Ns(),h=!!r,y=i?._meta?.["mcp.mesh"],N=r?.title??i?.title??"",w=r?.id?.split("/")[0]??i?.id?.split("/")[0]??"",_=r?.description??i?.description??"",b=r?._meta?.["mcp.mesh"]?.short_description??y?.short_description??"",L=r?._meta?.["mcp.mesh"]?.owner??y?.owner??"",I=r?.server?.repository?.url??i?.server?.repository?.url??"",P=r?._meta?.["mcp.mesh"]?.readme??y?.readme??"",R=r?._meta?.["mcp.mesh"]?.readme_url??y?.readme_url??"",k=ls(r?.server?.remotes?.[0]?.url??i?.server?.remotes?.[0]?.url??""),A=r?.server?.remotes?.[0]?.type??i?.server?.remotes?.[0]?.type??"http",q=r?._meta?.["mcp.mesh"]?.tags??y?.tags??[],v=r?._meta?.["mcp.mesh"]?.categories?.[0]??y?.categories?.[0]??"",S=r?.server?.icons?.[0]?.src??i?.server?.icons?.[0]?.src??"",D=r?._meta?.["mcp.mesh"]?.tools??y?.tools??[],F=r?.is_public??i?.is_public??!1,T=r?._meta?.["mcp.mesh"]?.verified??y?.verified??!1,U=r?._meta?.["mcp.mesh"]?.official??y?.official??!1,[E,O]=M.useState(1),[j,$]=M.useState(N),[B,X]=M.useState(w),[J,de]=M.useState(_),[se,ne]=M.useState(b),[ge,ue]=M.useState(L),[ie,C]=M.useState(I),[K,H]=M.useState(P),[re,xe]=M.useState(R),[ae,Ie]=M.useState(P?"content":"link"),[Ne,z]=M.useState(k),[le,ke]=M.useState(A),[Pe,$e]=M.useState(q),[Me,je]=M.useState(v),[Oe,Rt]=M.useState(S),[Se,mt]=M.useState(D),[Bt,Kt]=M.useState(F),[Ht,Vt]=M.useState(T),[Gt,Qt]=M.useState(U),[fe,Ze]=M.useState({}),Yt=()=>{O(1),$(N),X(w),de(_),ne(b),ue(L),C(I),H(P),xe(R),Ie(P?"content":"link"),z(k),ke(A),$e(q),je(v),Rt(S),mt(D),Kt(F),Vt(T),Qt(U),Ze({}),x(),gt.current="",Ce.current&&(clearTimeout(Ce.current),Ce.current=null)},Is=async Q=>{if(!Q)return;const ee=h?r?.id:`${B}/${j}`.toLowerCase(),we=Ke(ee||"temp"),qe=Q.name.split(".").pop()||"png",Ee=`registry/${u.id}/${we}/icon.${qe}`,Be=await d(Q,Ee);Be?(Rt(Be),Ze(Le=>({...Le,imageUrl:void 0}))):Ze(Le=>({...Le,imageUrl:o("registry.registryItemDialog.failedToUploadImage")}))},Ce=M.useRef(null),gt=M.useRef(""),It=M.useRef(le);It.current=le;const Wt=Q=>{!Q&&Ce.current&&(clearTimeout(Ce.current),Ce.current=null),e(Q),Q||Yt()},ks=async()=>{const Q=et(Ne);if(!Q)return;Ce.current&&(clearTimeout(Ce.current),Ce.current=null),gt.current=Q;const ee=await f(Q,It.current);ee&&mt(ee)},Ss=Q=>{Ce.current&&clearTimeout(Ce.current);const ee=et(Q);!ee||ee===gt.current||Q.includes(".")&&(Ce.current=setTimeout(async()=>{gt.current=ee;const we=await f(ee,It.current);we&&mt(we)},800))},Jt=Q=>{const ee={};if(Q===1){const we=Ke(B),qe=Ke(j),Ee=`${we}/${qe}`;j.trim()||(ee.title=o("registry.registryItemDialog.nameIsRequired")),h||(we?qe?di.test(Ee)||(ee.provider=o("registry.registryItemDialog.useValidIdFormat")):ee.title=o("registry.registryItemDialog.nameMustContainValidCharacters"):ee.provider=o("registry.registryItemDialog.providerIsRequired"));const Be=et(Ne),Le=le.trim().toLowerCase();if(Le!=="stdio"&&Be)try{const Xe=new URL(Be);["http:","https:"].includes(Xe.protocol)||(ee.remoteUrl=o("registry.registryItemDialog.remoteUrlMustBeHttps"))}catch{ee.remoteUrl=o("registry.registryItemDialog.remoteUrlIsInvalid")}if(Le&&!ci.has(Le)&&(ee.remoteType=o("registry.registryItemDialog.remoteTypeMustBe")),Oe.trim()&&!Oe.trim().startsWith("data:image/"))try{const kt=new URL(Oe.trim());["http:","https:"].includes(kt.protocol)||(ee.imageUrl=o("registry.registryItemDialog.imageUrlMustBeHttps"))}catch{ee.imageUrl=o("registry.registryItemDialog.imageUrlIsInvalid")}}if(Q===2&&(J.length>1500&&(ee.description=o("registry.registryItemDialog.descriptionMaxLength")),se.trim().length>160&&(ee.shortDescription=o("registry.registryItemDialog.shortDescriptionMaxLength"))),Q===3){const we=re.trim();if(we)try{const Ee=new URL(we);["http:","https:"].includes(Ee.protocol)||(ee.readmeUrl=o("registry.registryItemDialog.readmeUrlMustBeHttps"))}catch{ee.readmeUrl=o("registry.registryItemDialog.readmeUrlIsInvalid")}K.trim().length>5e4&&(ee.readme=o("registry.registryItemDialog.readmeMaxLength"));const qe=ie.trim();if(qe)try{const Ee=new URL(qe);["http:","https:"].includes(Ee.protocol)||(ee.repositoryUrl=o("registry.registryItemDialog.repositoryUrlMustBeHttps"))}catch{ee.repositoryUrl=o("registry.registryItemDialog.repositoryUrlIsInvalid")}}return Ze(ee),Object.values(ee).every(we=>we===void 0)},Ds=()=>{Jt(E)&&(E===1&&Ce.current&&(clearTimeout(Ce.current),Ce.current=null),E<3&&O(E+1))},Ts=()=>{E>1&&O(E-1)},Ms=async()=>{if(!Jt(3))return;const Q=j.trim(),ee=Ke(B),we=Ke(Q),qe=`${ee}/${we}`,Ee=et(Ne),Be=le.trim().toLowerCase(),Le=Oe.trim(),Xe=ie.trim(),kt=se.trim(),As=K.trim(),Us=re.trim(),Fs=_t(Pe),$s=Me?[Qe(Me)]:[],zs=r?r.server?.name??r.id:"",Os=(h?zs:qe).trim(),St=J.trim(),Bs=ge.trim(),Zt={title:Q,description:St.length>0?St:null,is_public:Bt,_meta:{"mcp.mesh":{verified:Ht,official:Gt,tags:Fs,categories:$s,short_description:kt||null,owner:Bs||null,readme:As||null,readme_url:Us||null,...Se.length>0?{tools:Se}:{}}},server:{name:Os,title:Q,description:St||void 0,icons:Le?[{src:Le}]:[],repository:Xe?{url:Xe}:void 0,remotes:Ee?[{type:Be||"http",url:Ee}]:[]}};if(h&&r){await a({id:r.id,data:Zt}),e(!1);return}await a({id:qe,...Zt}),e(!1),Yt()},qs=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(oe,{htmlFor:"registry-item-provider",children:o("registry.registryItemDialog.provider")}),t.jsx(ye,{id:"registry-item-provider",className:"h-9 text-sm",placeholder:"acme",value:B,onChange:Q=>X(Q.target.value),disabled:h}),!h&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[o("registry.registryItemDialog.itemId")," ",t.jsx("span",{className:"font-mono",children:`${Ke(B)||"provider"}/${Ke(j)||"name"}`})]}),fe.provider&&t.jsx("p",{className:"text-xs text-destructive",children:fe.provider})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(oe,{htmlFor:"registry-item-title",children:o("registry.registryItemDialog.name")}),t.jsx(ye,{id:"registry-item-title",className:"h-9 text-sm",placeholder:"Internal MCP",value:j,onChange:Q=>$(Q.target.value)}),fe.title&&t.jsx("p",{className:"text-xs text-destructive",children:fe.title})]})]}),t.jsx("div",{className:"row-span-2 content-start",children:t.jsx(bs,{value:Oe,onChange:Q=>{Rt(Q),Ze(ee=>({...ee,imageUrl:void 0}))},onFileUpload:Is,error:fe.imageUrl,isUploading:m})}),t.jsxs("div",{className:"col-span-2 grid gap-1.5",children:[t.jsx(oe,{htmlFor:"registry-remote-url",children:o("registry.registryItemDialog.remoteUrl")}),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:Ne,onChange:Q=>{const ee=ls(Q.target.value);z(ee),Ss(ee)}})]}),t.jsxs(ar,{value:le,onValueChange:ke,children:[t.jsx(lr,{id:"registry-remote-type",className:"w-[90px] h-9 shrink-0",children:t.jsx(cr,{placeholder:o("registry.registryItemDialog.type")})}),t.jsxs(dr,{children:[t.jsx(Dt,{value:"http",children:"http"}),t.jsx(Dt,{value:"sse",children:"sse"}),t.jsx(Dt,{value:"stdio",children:"stdio"})]})]})]}),fe.remoteUrl&&t.jsx("p",{className:"text-xs text-destructive",children:fe.remoteUrl}),fe.remoteType&&t.jsx("p",{className:"text-xs text-destructive",children:fe.remoteType})]}),Ne.trim()&&t.jsxs("div",{className:"col-span-2 space-y-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(Y,{type:"button",variant:"outline",size:"sm",className:te(xi,"gap-1.5"),onClick:ks,disabled:p==="loading",children:[p==="loading"?t.jsx(Ye,{size:12,className:"animate-spin"}):t.jsx(Lt,{size:12}),p==="loading"?o("registry.registryItemDialog.discoveringTools"):Se.length>0?o("registry.registryItemDialog.rediscoverTools"):o("registry.registryItemDialog.discoverToolsFromUrl")]}),Se.length>0&&p!=="loading"&&t.jsx("span",{className:"text-xs text-muted-foreground",children:o("registry.registryItemDialog.toolsLoaded",{count:Se.length.toString()})})]}),p==="success"&&Se.length>0&&t.jsxs("div",{className:"rounded-lg border border-success/20 bg-success/10 px-3 py-2 space-y-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2 text-xs text-success",children:[t.jsx(We,{size:14,className:"shrink-0"}),t.jsx("span",{className:"font-medium",children:o("registry.registryItemDialog.toolsDiscovered",{count:Se.length.toString()})})]}),t.jsxs("div",{className:"flex flex-wrap gap-1",children:[Se.slice(0,8).map(Q=>t.jsx(V,{variant:"secondary",className:"text-[10px] px-1.5 py-0 font-mono",children:Q.name},Q.name)),Se.length>8&&t.jsx("span",{className:"text-[10px] text-muted-foreground self-center",children:o("registry.registryItemDialog.andMore",{count:(Se.length-8).toString()})})]}),t.jsx("p",{className:"text-[10px] text-muted-foreground",children:o("registry.registryItemDialog.toolsWillEnrich")})]}),p==="auth_required"&&g&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-warning bg-warning/10 border border-warning/20 rounded-lg px-3 py-2",children:[t.jsx(tt,{size:14,className:"shrink-0"}),t.jsx("span",{children:o("registry.registryItemDialog.authRequiredMessage")})]}),p==="error"&&g&&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(tt,{size:14,className:"shrink-0"}),t.jsx("span",{children:g})]})]})]}),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(oe,{htmlFor:"registry-item-short-description",children:o("registry.registryItemDialog.shortDescription")}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[se.length,"/160"]})]}),t.jsx(ye,{id:"registry-item-short-description",className:"h-9 text-sm",placeholder:o("registry.registryItemDialog.shortSummaryForStoreCard"),value:se,maxLength:160,onChange:Q=>ne(Q.target.value)}),fe.shortDescription&&t.jsx("p",{className:"text-xs text-destructive",children:fe.shortDescription})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(oe,{htmlFor:"registry-item-description",children:o("registry.registryItemDialog.description")}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[J.length,"/1500"]})]}),t.jsx(wt,{id:"registry-item-description",className:"text-sm max-h-28 overflow-y-auto resize-none",placeholder:o("registry.registryItemDialog.briefDescription"),rows:2,value:J,onChange:Q=>de(Q.target.value)}),fe.description&&t.jsx("p",{className:"text-xs text-destructive",children:fe.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(ji,{id:"registry-category",value:Me,availableOptions:l,onChange:je})}),t.jsx("div",{className:"grid content-start gap-2",children:t.jsx(hi,{id:"registry-tags",labelKey:"registry.registryItemDialog.tags",values:Pe,availableOptions:[...ui,...n],placeholderKey:"registry.registryItemDialog.typeAndPressEnter",onChange:$e})})]}),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(oe,{htmlFor:"registry-is-public",className:"text-sm",children:o("registry.registryItemDialog.public")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("registry.registryItemDialog.makeThisMcpVisible")})]}),t.jsx(Ge,{id:"registry-is-public",checked:Bt,onCheckedChange:Kt})]}),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(oe,{htmlFor:"registry-is-verified",className:"text-sm",children:o("registry.registryItemDialog.verified")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("registry.registryItemDialog.curatedAndApproved")})]}),t.jsx(Ge,{id:"registry-is-verified",checked:Ht,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(oe,{htmlFor:"registry-is-official",className:"text-sm",children:o("registry.registryItemDialog.official")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("registry.registryItemDialog.madeAndHostedByServiceProvider")})]}),t.jsx(Ge,{id:"registry-is-official",checked:Gt,onCheckedChange:Qt})]})]}),Ls=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(oe,{htmlFor:"registry-item-owner",children:o("registry.registryItemDialog.ownerOptional")}),t.jsx(ye,{id:"registry-item-owner",className:"h-9 text-sm",placeholder:o("registry.registryItemDialog.teamCompanyOrPerson"),value:ge,onChange:Q=>ue(Q.target.value)})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(oe,{htmlFor:"registry-item-repository-url",children:o("registry.registryItemDialog.repositoryUrlOptional")}),t.jsx(ye,{id:"registry-item-repository-url",className:"h-9 text-sm",placeholder:"https://github.com/org/repo",value:ie,onChange:Q=>C(Q.target.value)}),fe.repositoryUrl&&t.jsx("p",{className:"text-xs text-destructive",children:fe.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(oe,{children:o("registry.registryItemDialog.readme")}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[K.length,"/50000"]})]}),t.jsx("div",{className:"inline-flex rounded-lg border border-border p-0.5",children:["link","content"].map(Q=>t.jsx("button",{type:"button",className:te("px-2.5 py-1 text-xs rounded-md",ae===Q?"bg-primary text-primary-foreground":"text-muted-foreground"),onClick:()=>Ie(Q),children:o(Q==="link"?"registry.registryItemDialog.link":"registry.registryItemDialog.content")},Q))}),ae==="link"&&t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ye,{className:"h-9 text-sm",placeholder:"https://raw.githubusercontent.com/org/repo/main/README.md",value:re,onChange:Q=>xe(Q.target.value)}),fe.readmeUrl&&t.jsx("p",{className:"text-xs text-destructive",children:fe.readmeUrl})]}),ae==="content"&&t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(wt,{className:"text-sm max-h-48 overflow-y-auto resize-none",placeholder:`# README
26
+
27
+ Describe your MCP here...`,rows:6,value:K,onChange:Q=>H(Q.target.value)}),fe.readme&&t.jsx("p",{className:"text-xs text-destructive",children:fe.readme})]})]}),t.jsx(ai,{tools:Se,onChange:mt,remoteUrl:et(Ne)||void 0,remoteType:le,externalDiscoverStatus:p,externalDiscoverError:g})]});return t.jsx(yt,{open:s,onOpenChange:Wt,children:t.jsxs(jt,{className:"sm:max-w-[820px] max-h-[90vh] overflow-hidden flex flex-col",children:[t.jsxs(Nt,{className:"space-y-3",children:[t.jsx(vt,{children:o(h?"registry.registryItemDialog.editMcpServer":"registry.registryItemDialog.addMcpServer")}),t.jsx(pi,{current:E}),t.jsxs(bt,{children:[E===1&&o("registry.registryItemDialog.step1Description"),E===2&&o("registry.registryItemDialog.step2Description"),E===3&&o("registry.registryItemDialog.step3Description")]})]}),t.jsxs("div",{className:"flex-1 overflow-y-auto pr-1 py-2",children:[E===1&&qs,E===2&&Es,E===3&&Ls]}),t.jsxs(Ct,{className:"flex items-center justify-between gap-2 sm:justify-between",children:[t.jsx("div",{children:E>1&&t.jsxs(Y,{variant:"ghost",size:"sm",onClick:Ts,children:[t.jsx(Js,{size:14}),o("registry.registryItemDialog.back")]})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Y,{variant:"outline",size:"sm",onClick:()=>Wt(!1),disabled:c,children:o("registry.registryItemDialog.cancel")}),E<3?t.jsxs(Y,{size:"sm",onClick:Ds,children:[o("registry.registryItemDialog.next"),t.jsx(ur,{size:14})]}):t.jsx(Y,{size:"sm",onClick:Ms,disabled:c,children:o(c?"registry.registryItemDialog.saving":h?"registry.registryItemDialog.saveChanges":"registry.registryItemDialog.create")})]})]})]})})}function cs(s,e){return s.includes(e)?s.filter(r=>r!==e):[...s,e]}function bi(s){return s._meta?.["mcp.mesh"]?.tags??[]}function Ni(s){return s._meta?.["mcp.mesh"]?.categories??[]}function Ci(s){return s.server?.remotes?.[0]?.url??"-"}function wi(){const s=ce(),e="h-8",[r,i]=M.useState(""),n=M.useDeferredValue(r),[l,c]=M.useState([]),[a,o]=M.useState([]),[u,d]=M.useState(!1),[m,f]=M.useState(!1),[p,g]=M.useState(null),[x,h]=M.useState(null),[y,N]=rr("private-registry-list","cards"),w=M.useRef(null),_=js({search:n,tags:l,categories:a}),b=Lr(),{createMutation:L,updateMutation:I,deleteMutation:P,bulkCreateMutation:R}=Ot(),k=_.data?.pages.flatMap(j=>j.items??[]).filter(Boolean)??[],A=_.data?.pages[0]?.totalCount??k.length,q=l.length>0||a.length>0||n.length>0,v=b.data,S=Array.isArray(v?.tags)?v.tags:[],D=Array.isArray(v?.categories)?v.categories:[],F=j=>{w.current&&(w.current.disconnect(),w.current=null),!(!j||!_.hasNextPage||_.isFetchingNextPage)&&(w.current=new IntersectionObserver($=>{$[0]?.isIntersecting&&_.hasNextPage&&!_.isFetchingNextPage&&_.fetchNextPage()},{rootMargin:"240px 0px"}),w.current.observe(j))},T=async j=>{try{"data"in j?(await I.mutateAsync(j),G.success(s("registry.registryItemsPage.registryItemUpdated"))):(await L.mutateAsync(j),G.success(s("registry.registryItemsPage.registryItemCreated")))}catch($){throw G.error($ instanceof Error?$.message:s("registry.registryItemsPage.failedToSaveItem")),$}},U=async j=>{const $=j._meta?.["mcp.mesh"]?.verified===!0;try{await I.mutateAsync({id:j.id,data:{_meta:{...j._meta,"mcp.mesh":{...j._meta?.["mcp.mesh"],verified:!$}}}}),G.success(s($?"registry.registryItemsPage.removedVerifiedStatus":"registry.registryItemsPage.markedAsVerified"))}catch(B){G.error(B instanceof Error?B.message:s("registry.registryItemsPage.failedToUpdateItem"))}},E=async j=>{const $=j._meta?.["mcp.mesh"]?.official===!0;try{await I.mutateAsync({id:j.id,data:{_meta:{...j._meta,"mcp.mesh":{...j._meta?.["mcp.mesh"],official:!$}}}}),G.success(s($?"registry.registryItemsPage.removedOfficialStatus":"registry.registryItemsPage.markedAsOfficial"))}catch(B){G.error(B instanceof Error?B.message:s("registry.registryItemsPage.failedToUpdateItem"))}},O=async()=>{if(x)try{await P.mutateAsync(x.id),G.success(s("registry.registryItemsPage.registryItemDeleted")),h(null)}catch(j){G.error(j instanceof Error?j.message:s("registry.registryItemsPage.failedToDeleteItem"))}};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:s("registry.registryItemsPage.items")}),t.jsx(V,{variant:"secondary",className:"text-xs",children:A})]}),t.jsxs("div",{className:"flex items-center gap-2 self-stretch",children:[t.jsxs(ft,{children:[t.jsx(pt,{asChild:!0,children:t.jsxs(Y,{variant:"outline",size:"sm",className:te(e,"gap-1.5"),children:[t.jsx(ir,{size:14}),s("registry.registryItemsPage.filters")]})}),t.jsxs(ht,{align:"end",className:"w-[260px]",children:[t.jsx(es,{children:s("registry.registryItemsPage.tags")}),S.length>0?S.map(j=>t.jsxs(ts,{checked:l.includes(j.value),onCheckedChange:()=>c($=>cs($,j.value)),children:[j.value," (",j.count,")"]},j.value)):t.jsx(Re,{disabled:!0,children:s("registry.registryItemsPage.noTagsAvailable")}),t.jsx(tr,{}),t.jsx(es,{children:s("registry.registryItemsPage.categories")}),D.length>0?D.map(j=>t.jsxs(ts,{checked:a.includes(j.value),onCheckedChange:()=>o($=>cs($,j.value)),children:[j.value," (",j.count,")"]},j.value)):t.jsx(Re,{disabled:!0,children:s("registry.registryItemsPage.noCategoriesAvailable")})]})]}),t.jsxs(sr,{type:"single",value:y,onValueChange:j=>{(j==="cards"||j==="table")&&N(j)},variant:"outline",className:e,children:[t.jsx(ss,{value:"cards","aria-label":s("registry.registryItemsPage.cardsViewAriaLabel"),className:e,children:s("registry.registryItemsPage.cards")}),t.jsx(ss,{value:"table","aria-label":s("registry.registryItemsPage.tableViewAriaLabel"),className:e,children:s("registry.registryItemsPage.table")})]}),t.jsx(Y,{variant:"outline",size:"sm",className:e,onClick:()=>f(!0),children:s("registry.registryItemsPage.importCsv")}),t.jsx(Y,{size:"sm",className:e,onClick:()=>d(!0),children:s("registry.registryItemsPage.addMcpServers")})]})]}),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(or,{size:16,className:"text-muted-foreground shrink-0"}),t.jsx(ye,{value:r,onChange:j=>i(j.target.value),placeholder:s("registry.registryItemsPage.searchPlaceholder"),className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),q&&t.jsxs("div",{className:"border-t border-border px-4 md:px-6 py-2 flex flex-wrap items-center gap-2",children:[l.map(j=>t.jsxs(V,{variant:"default",children:["#",j]},`selected-tag-${j}`)),a.map(j=>t.jsx(V,{variant:"outline",children:j},`selected-category-${j}`)),r.trim()&&t.jsxs(V,{variant:"secondary",className:"max-w-[280px] truncate",children:["Search: ",r]}),t.jsx(Y,{size:"sm",variant:"ghost",className:"h-7 ml-auto",onClick:()=>{i(""),c([]),o([])},children:s("registry.registryItemsPage.clearFilters")})]})]}),t.jsxs("div",{className:"flex-1 overflow-auto px-4 md:px-6 py-4",children:[k.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:_.isLoading?t.jsxs(t.Fragment,{children:[t.jsx(Ye,{className:"size-5 animate-spin text-muted-foreground"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:s("registry.registryItemsPage.loadingItems")})]}):t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"text-base font-medium",children:s(q?"registry.registryItemsPage.noItemsFound":"registry.registryItemsPage.noMcpsInRegistry")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:s(q?"registry.registryItemsPage.tryRemovingFilters":"registry.registryItemsPage.addFirstMcpItem")}),!q&&t.jsx(Y,{size:"lg",onClick:()=>d(!0),children:s("registry.registryItemsPage.addMcpServers")})]})}):y==="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:k.map(j=>t.jsx(ii,{item:j,onEdit:g,onDelete:h,onToggleVerified:U,onToggleOfficial:E},j.id))}),_.hasNextPage&&t.jsx("div",{ref:F,className:"h-2"})]}):t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"border rounded-lg overflow-auto",children:t.jsxs(At,{children:[t.jsx(Ut,{children:t.jsxs(Je,{children:[t.jsx(pe,{className:"w-[56px]",children:s("registry.registryItemsPage.icon")}),t.jsx(pe,{children:s("registry.registryItemsPage.title")}),t.jsx(pe,{children:s("registry.registryItemsPage.id")}),t.jsx(pe,{children:s("registry.registryItemsPage.tags")}),t.jsx(pe,{children:s("registry.registryItemsPage.categories")}),t.jsx(pe,{children:s("registry.registryItemsPage.remoteUrl")}),t.jsx(pe,{children:s("registry.registryItemsPage.visibility")}),t.jsx(pe,{className:"text-right w-[68px]",children:s("registry.registryItemsPage.actions")})]})}),t.jsx(Ft,{children:k.map(j=>t.jsxs(Je,{children:[t.jsx(he,{children:t.jsx("div",{className:"size-8 rounded-md border border-border bg-muted/20 overflow-hidden flex items-center justify-center",children:j.server?.icons?.[0]?.src?t.jsx("img",{src:j.server.icons[0].src,alt:j.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:j.title.charAt(0).toUpperCase()})})}),t.jsx(he,{children:j.title}),t.jsx(he,{className:"font-mono",children:j.id}),t.jsx(he,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:bi(j).slice(0,3).map($=>t.jsx(V,{variant:"outline",children:$},`${j.id}-tag-${$}`))})}),t.jsx(he,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:Ni(j).slice(0,3).map($=>t.jsx(V,{variant:"outline",children:$},`${j.id}-category-${$}`))})}),t.jsx(he,{children:Ci(j)}),t.jsx(he,{children:j.is_public?t.jsxs(V,{variant:"default",className:"gap-1",children:[t.jsx(xs,{size:10}),s("registry.registryItemsPage.public")]}):t.jsx(V,{variant:"secondary",children:s("registry.registryItemsPage.private")})}),t.jsx(he,{className:"text-right",children:t.jsxs(ft,{children:[t.jsx(pt,{asChild:!0,children:t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0","aria-label":s("registry.registryItemsPage.actionsFor",{title:j.title}),children:t.jsx($t,{size:18})})}),t.jsxs(ht,{align:"end",children:[t.jsx(Re,{onClick:()=>g(j),children:s("registry.registryItemsPage.edit")}),t.jsx(Re,{variant:"destructive",onClick:()=>h(j),children:s("registry.registryItemsPage.delete")})]})]})})]},j.id))})]})}),_.hasNextPage&&t.jsx("div",{ref:F,className:"h-2"})]}),_.isFetchingNextPage&&t.jsxs("div",{className:"py-4 flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[t.jsx(Ye,{className:"size-4 animate-spin"}),s("registry.registryItemsPage.loadingMoreItems")]})]}),t.jsx(vi,{open:u||!!p,onOpenChange:j=>{j||(d(!1),g(null))},item:p,availableTags:S.map(j=>j.value),availableCategories:D.map(j=>j.value),isSubmitting:L.isPending||I.isPending,onSubmit:T},p?.id??"create"),t.jsx(Wr,{open:m,onOpenChange:f,isImporting:R.isPending,onImport:async j=>{try{const $=await R.mutateAsync(j);return G.success(s("registry.registryItemsPage.importedItems",{count:$.created})),$}catch($){throw G.error($ instanceof Error?$.message:s("registry.registryItemsPage.failedToImportCsv")),$}}}),t.jsx(Xr,{open:!!x,onOpenChange:j=>{j||h(null)},title:x?.title??x?.id??"",isDeleting:P.isPending,onConfirm:O})]})}const _i=[{value:"pending",labelKey:"registry.registryRequestsPage.statusPending"},{value:"approved",labelKey:"registry.registryRequestsPage.statusApproved"},{value:"rejected",labelKey:"registry.registryRequestsPage.statusRejected"}];function ds(s){const e=new Date(s);return Number.isNaN(e.getTime())?s:e.toLocaleDateString()}function us(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 Et(s){const e=s.server?.icons?.[0]?.src;return typeof e=="string"&&e.length>0?e:null}function xt(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 Pi(){const s=ce(),[e,r]=M.useState("pending"),[i,n]=M.useState("created_at"),[l,c]=M.useState("asc"),[a,o]=M.useState(new Set),[u,d]=M.useState(!1),[m,f]=M.useState("private"),[p,g]=M.useState(!1),[x,h]=M.useState(null),[y,N]=M.useState(null),[w,_]=M.useState(null),[b,L]=M.useState(null),[I,P]=M.useState(""),R=Ur({status:e,sortBy:i,sortDirection:l}),{reviewMutation:k,deleteMutation:A}=Or(),{createMutation:q}=Ot(),v=R.data?.pages.flatMap(C=>C.items)??[],S=R.data?.pages[0]?.totalCount??0,D=R.isFetchingNextPage,F=!!R.hasNextPage,T=yr(()=>{R.isFetchingNextPage||R.fetchNextPage()},F,D),U=new Set(v.filter(C=>C.status==="pending").map(C=>C.id)),E=v.filter(C=>U.has(C.id)),O=a.size,j=E.filter(C=>a.has(C.id)),$=v.filter(C=>a.has(C.id)).length,B=E.length>0&&E.every(C=>a.has(C.id)),X=()=>o(new Set),J=(C,K)=>{o(H=>{const re=new Set(H);return K?re.add(C):re.delete(C),re})},de=C=>{o(K=>{const H=new Set(K);return H.has(C)?H.delete(C):H.add(C),H})},se=()=>{o(C=>{const K=new Set(C);for(const H of E)K.add(H.id);return K})},ne=async()=>{const C=y;if(C){N(null),h(C.id);try{await k.mutateAsync({id:C.id,status:"approved",reviewerNotes:void 0});const K=us(C);await q.mutateAsync({id:K.id,title:K.title,description:K.description,_meta:K._meta,server:K.server,is_public:K.is_public}),G.success(s("registry.registryRequestsPage.requestApprovedAndAdded"))}catch(K){const H=K instanceof Error?K.message:"Failed to approve request";H.includes("UNIQUE constraint")||H.includes("already exists")?G.error(s("registry.registryRequestsPage.itemAlreadyExists")):G.error(H)}finally{h(null)}}},ge=async()=>{if(w)try{await k.mutateAsync({id:w.id,status:"rejected",reviewerNotes:I.trim()||void 0}),G.success(s("registry.registryRequestsPage.requestRejected")),_(null),P("")}catch(C){G.error(C instanceof Error?C.message:"Failed to reject request")}},ue=async C=>{try{await A.mutateAsync(C.id),G.success(s("registry.registryRequestsPage.requestDeleted"))}catch(K){G.error(K instanceof Error?K.message:"Failed to delete request")}},ie=async()=>{if(j.length===0||p)return;g(!0),d(!1);let C=0;const K=new Set;for(const re of j)try{await k.mutateAsync({id:re.id,status:"approved",reviewerNotes:void 0});const xe=us(re);await q.mutateAsync({id:xe.id,title:xe.title,description:xe.description,_meta:xe._meta,server:xe.server,is_public:m==="public"}),C++}catch{K.add(re.id)}const H=K.size;C>0&&H===0?G.success(s("registry.registryRequestsPage.bulkApproveSuccess",{approvedCount:C,bulkVisibility:m})):C>0&&H>0?G.warning(s("registry.registryRequestsPage.bulkApprovePartial",{approvedCount:C,failedCount:H})):G.error(s("registry.registryRequestsPage.bulkApproveFailed")),o(K),g(!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:s("registry.registryRequestsPage.requestsToPublish")}),t.jsx(V,{variant:"secondary",className:"text-xs",children:S})]}),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:_i.map(C=>t.jsx("button",{type:"button",className:te("px-2.5 py-1 text-xs rounded-md transition-colors",e===C.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>r(C.value),onClickCapture:()=>X(),children:s(C.labelKey)},C.value))}),t.jsxs("select",{className:"h-7 rounded-md border border-input bg-background px-2 text-xs",value:`${i}:${l}`,onChange:C=>{const[K,H]=C.target.value.split(":");n(K),c(H)},children:[t.jsx("option",{value:"created_at:asc",children:s("registry.registryRequestsPage.sortCreatedOldest")}),t.jsx("option",{value:"created_at:desc",children:s("registry.registryRequestsPage.sortCreatedNewest")}),t.jsx("option",{value:"title:asc",children:s("registry.registryRequestsPage.sortAlphaAZ")}),t.jsx("option",{value:"title:desc",children:s("registry.registryRequestsPage.sortAlphaZA")})]})]})]})}),t.jsxs("div",{className:"flex-1 overflow-auto px-4 md:px-6 py-4",children:[R.isLoading?t.jsx("div",{className:"text-sm text-muted-foreground",children:s("registry.registryRequestsPage.loadingRequests")}):R.isError?t.jsxs("div",{className:"p-8 text-center rounded-lg border border-border",children:[t.jsx("p",{className:"text-sm text-destructive",children:s("registry.registryRequestsPage.failedLoadRequests")}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:R.error instanceof Error?R.error.message:s("registry.registryRequestsPage.unknownError")})]}):v.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(e==="pending"?"registry.registryRequestsPage.noPendingRequests":e==="approved"?"registry.registryRequestsPage.noApprovedRequests":"registry.registryRequestsPage.noRejectedRequests")})}):t.jsxs(At,{children:[t.jsx(Ut,{children:t.jsxs(Je,{children:[e==="pending"&&t.jsx(pe,{className:"w-10",children:t.jsx(is,{checked:B&&E.length>0,onCheckedChange:C=>{C?se():X()}})}),t.jsx(pe,{children:s("registry.registryRequestsPage.columnName")}),t.jsx(pe,{children:s("registry.registryRequestsPage.columnRequester")}),t.jsx(pe,{children:s("registry.registryRequestsPage.columnTags")}),t.jsx(pe,{children:s("registry.registryRequestsPage.columnStatus")}),t.jsx(pe,{children:s("registry.registryRequestsPage.columnDate")}),t.jsx(pe,{className:"text-right",children:s("registry.registryRequestsPage.columnActions")})]})}),t.jsx(Ft,{children:v.map(C=>{const K=Et(C),H=C._meta?.["mcp.mesh"]?.tags??[],re=U.has(C.id),xe=a.has(C.id);return t.jsxs(Je,{className:te(re&&"cursor-pointer",xe&&"bg-accent/20"),onClick:()=>{re&&de(C.id)},children:[e==="pending"&&t.jsx(he,{children:t.jsx(is,{checked:xe,onCheckedChange:ae=>J(C.id,ae===!0),onClick:ae=>ae.stopPropagation()})}),t.jsx(he,{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:K?t.jsx("img",{src:K,alt:C.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:C.title.slice(0,1).toUpperCase()})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:C.title}),C.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-[300px]",children:C.description})]})]})}),t.jsx(he,{children:t.jsx("span",{className:"text-sm text-muted-foreground truncate",children:C.requester_name||C.requester_email||"-"})}),t.jsx(he,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:H.slice(0,3).map(ae=>t.jsx(V,{variant:"secondary",className:"text-[10px]",children:ae},`${C.id}-tag-${ae}`))})}),t.jsx(he,{children:t.jsx(V,{variant:"secondary",className:"capitalize text-[11px]",children:C.status})}),t.jsx(he,{children:t.jsx("span",{className:"text-sm text-muted-foreground",children:ds(C.created_at)})}),t.jsx(he,{className:"text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[t.jsxs(Y,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:ae=>{ae.stopPropagation(),L(C)},children:[t.jsx(ps,{size:13}),s("registry.registryRequestsPage.buttonView")]}),re?t.jsxs(t.Fragment,{children:[t.jsxs(Y,{size:"sm",className:"h-7 text-xs px-2",onClick:ae=>{ae.stopPropagation(),N(C)},disabled:x!==null||p||xe,children:[t.jsx(We,{size:13}),x===C.id?s("registry.registryRequestsPage.approving"):s(xe?"registry.registryRequestsPage.selected":"registry.registryRequestsPage.buttonApprove")]}),t.jsxs(Y,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:ae=>{ae.stopPropagation(),_(C),P("")},disabled:k.isPending,children:[t.jsx(xr,{size:13}),s("registry.registryRequestsPage.buttonReject")]})]}):t.jsxs(Y,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:ae=>{ae.stopPropagation(),ue(C)},disabled:A.isPending,children:[t.jsx(dt,{size:13}),s("registry.registryRequestsPage.buttonDelete")]})]})})]},C.id)})})]}),v.length>0&&F?t.jsx("div",{ref:T,className:"h-1 w-full"}):null,D&&v.length>0?t.jsx("div",{className:"pt-3 text-xs text-muted-foreground",children:s("registry.registryRequestsPage.loadingMoreRequests")}):null]}),O>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.jsx("div",{className:"text-xs text-muted-foreground pr-1",children:s("registry.registryRequestsPage.selectedCount",{selectedCount:O})}),t.jsx(Y,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:se,disabled:B,children:s("registry.registryRequestsPage.selectAll")}),t.jsx(Y,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:X,children:s("registry.registryRequestsPage.clearSelection")}),t.jsxs(Y,{size:"sm",className:"h-7 text-xs px-2",onClick:()=>d(!0),disabled:p,children:[t.jsx(We,{size:13}),s("registry.registryRequestsPage.approveSelected")]})]})}):null,t.jsx(yt,{open:!!b,onOpenChange:C=>{C||L(null)},children:t.jsxs(jt,{className:"sm:max-w-[720px] max-h-[85vh] overflow-hidden flex flex-col",children:[t.jsxs(Nt,{children:[t.jsx(vt,{children:b?.title??s("registry.registryRequestsPage.requestDetails")}),t.jsx(bt,{children:s("registry.registryRequestsPage.reviewMetadataDescription")})]}),b&&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:Et(b)?t.jsx("img",{src:Et(b)||"",alt:b.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-lg font-semibold text-muted-foreground",children:b.title.slice(0,1).toUpperCase()})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:b.title}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b.server?.name||b.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:s("registry.registryRequestsPage.labelStatus")}),t.jsx("span",{className:"capitalize",children:b.status})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:s("registry.registryRequestsPage.labelSubmitted")}),t.jsx("span",{children:ds(b.created_at)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:s("registry.registryRequestsPage.labelRequester")}),t.jsx("span",{children:b.requester_name||"-"})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:s("registry.registryRequestsPage.labelEmail")}),t.jsx("span",{children:b.requester_email||"-"})]})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(oe,{children:s("registry.registryRequestsPage.labelRemoteURL")}),t.jsx("code",{className:"text-xs rounded-md border border-border bg-muted/30 px-2.5 py-2 break-all",children:b.server?.remotes?.[0]?.url??"-"})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(oe,{children:s("registry.registryRequestsPage.labelDescription")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:b.description||s("registry.registryRequestsPage.noDescriptionProvided")})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(oe,{children:s("registry.registryRequestsPage.labelTags")}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:(b._meta?.["mcp.mesh"]?.tags??[]).length?(b._meta?.["mcp.mesh"]?.tags??[]).map(C=>t.jsx(V,{variant:"secondary",children:C},`${b.id}-detail-tag-${C}`)):t.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(oe,{children:s("registry.registryRequestsPage.labelCategories")}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:(b._meta?.["mcp.mesh"]?.categories??[]).length?(b._meta?.["mcp.mesh"]?.categories??[]).map(C=>t.jsx(V,{variant:"secondary",children:C},`${b.id}-detail-category-${C}`)):t.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(oe,{children:s("registry.registryRequestsPage.labelREADME")}),xt(b).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:xt(b).readmeContent}):xt(b).hasReadmeLink?t.jsxs("a",{href:xt(b).readmeUrl,target:"_blank",rel:"noreferrer",className:"text-sm inline-flex items-center gap-1.5 text-primary hover:underline",children:[s("registry.registryRequestsPage.openREADMELink"),t.jsx(fr,{size:14})]}):t.jsx("span",{className:"text-sm text-muted-foreground",children:s("registry.registryRequestsPage.noREADMEProvided")})]})]}),t.jsx(Ct,{children:t.jsx(Y,{variant:"outline",onClick:()=>L(null),children:s("registry.registryRequestsPage.buttonClose")})})]})}),t.jsx(ct,{open:!!y,onOpenChange:C=>{C||N(null)},children:t.jsxs(lt,{children:[t.jsxs(it,{children:[t.jsx(st,{children:s("registry.registryRequestsPage.approvePublishRequestTitle")}),t.jsx(rt,{children:s("registry.registryRequestsPage.approvePublishRequestDesc",{title:y?.title??""})})]}),t.jsxs(at,{children:[t.jsx(nt,{children:s("registry.registryRequestsPage.buttonCancel")}),t.jsx(ot,{onClick:ne,children:s("registry.registryRequestsPage.buttonApprove")})]})]})}),t.jsx(ct,{open:u,onOpenChange:d,children:t.jsxs(lt,{children:[t.jsxs(it,{children:[t.jsx(st,{children:s("registry.registryRequestsPage.approveSelectedRequestsTitle")}),t.jsx(rt,{children:s("registry.registryRequestsPage.approveSelectedRequestsDesc",{count:j.length})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(oe,{htmlFor:"bulk-visibility",children:s("registry.registryRequestsPage.visibilityForAll")}),t.jsxs("select",{id:"bulk-visibility",className:"h-9 rounded-md border border-input bg-background px-3 text-sm",value:m,onChange:C=>f(C.target.value),children:[t.jsx("option",{value:"private",children:s("registry.registryRequestsPage.visibilityPrivate")}),t.jsx("option",{value:"public",children:s("registry.registryRequestsPage.visibilityPublic")})]})]}),t.jsxs(at,{children:[t.jsx(nt,{disabled:p,children:s("registry.registryRequestsPage.buttonCancel")}),t.jsx(ot,{onClick:ie,disabled:p||$===0,children:s(p?"registry.registryRequestsPage.approving":"registry.registryRequestsPage.approveSelected")})]})]})}),t.jsx(yt,{open:!!w,onOpenChange:C=>{C||(_(null),P(""))},children:t.jsxs(jt,{children:[t.jsxs(Nt,{children:[t.jsx(vt,{children:s("registry.registryRequestsPage.rejectPublishRequestTitle")}),t.jsx(bt,{children:s("registry.registryRequestsPage.rejectPublishRequestDesc")})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(oe,{htmlFor:"reject-notes",children:s("registry.registryRequestsPage.reviewerNotes")}),t.jsx(wt,{id:"reject-notes",rows:4,value:I,onChange:C=>P(C.target.value),placeholder:s("registry.registryRequestsPage.reasonForRejectionPlaceholder")})]}),t.jsxs(Ct,{children:[t.jsx(Y,{variant:"outline",onClick:()=>{_(null),P("")},children:s("registry.registryRequestsPage.buttonCancel")}),t.jsx(Y,{onClick:ge,disabled:k.isPending,children:k.isPending?s("registry.registryRequestsPage.rejecting"):s("registry.registryRequestsPage.buttonReject")})]})]})})]})}function Ri({revealedKey:s,onRevealedKeyChange:e}){const r=ce(),{org:i}=be(),{uploadImage:n,isUploading:l}=Cs(),{registryName:c,registryIcon:a,acceptPublishRequests:o,requireApiToken:u,storePrivateOnly:d,rateLimitEnabled:m,rateLimitWindow:f,rateLimitMax:p,isSaving:g,updateConfig:x}=vs(Ve),[h,y]=M.useState(c),[N,w]=M.useState(c);c!==N&&(w(c),y(c));const[_,b]=M.useState(a),[L,I]=M.useState(a);a!==L&&(I(a),b(a));const[P,R]=M.useState(String(p)),[k,A]=M.useState(p);p!==k&&(A(p),R(String(p)));const q=Br(),{generateMutation:v,revokeMutation:S}=Kr(),[D,F]=M.useState(""),[T,U]=M.useState(!1),[E,O]=M.useState(null),{handleCopy:j,copied:$}=Tt(),{handleCopy:B,copied:X}=Tt(),{handleCopy:J,copied:de}=Tt(),se=js({search:"",tags:[],categories:[],limit:50}),ne=`${window.location.origin}/org/${i.slug}/registry/mcp`,ue=(se.data?.pages.flatMap(z=>z.items??[])??[]).filter(z=>z.is_public).length,ie=`${window.location.origin}/org/${i.slug}/registry/publish-request`,C=s?.slice(0,12)??null,K=!!(C&&(q.data?.items??[]).some(z=>z.prefix===C)),H=g||l,re=()=>{const z=h.trim();!z||z===c||x({registryName:z})},xe=()=>{const z=Number.parseInt(P,10),le=Number.isFinite(z)&&z>=1?z:100;R(String(le)),le!==p&&x({rateLimitMax:le})},ae=async z=>{if(!z)return;const le=z.name.split(".").pop()||"png",ke=`registry/${i.id}/identity/icon.${le}`,Pe=await n(z,ke);Pe?(b(Pe),x({registryIcon:Pe})):G.error(r("registry.registrySettingsPage.failedUploadIcon"))},Ie=async()=>{const z=D.trim();if(z)try{const le=await v.mutateAsync(z);le?.key&&(e(le.key),U(!1),F(""),G.success(r("registry.registrySettingsPage.apiKeyGenerated")))}catch(le){G.error(le instanceof Error?le.message:r("registry.registrySettingsPage.failedGenerateApiKey"))}},Ne=async z=>{try{await S.mutateAsync(z),e(null),O(null),G.success(r("registry.registrySettingsPage.apiKeyRevoked"))}catch(le){G.error(le instanceof Error?le.message:r("registry.registrySettingsPage.failedRevokeApiKey"))}};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(me,{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:r("registry.registrySettingsPage.registryIdentity")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:r("registry.registrySettingsPage.configureNameIcon")})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(oe,{htmlFor:"identity-name",children:r("registry.registrySettingsPage.name")}),t.jsx(ye,{id:"identity-name",value:h,onChange:z=>y(z.target.value),onBlur:re,disabled:H,placeholder:r("registry.registrySettingsPage.namePlaceholder")})]}),t.jsx(bs,{value:_,onChange:b,onBlur:()=>{const z=_.trim();z!==a&&x({registryIcon:z})},onFileUpload:ae,isUploading:l})]})}),t.jsxs("div",{className:"grid gap-4 min-w-0 content-start",children:[t.jsxs(me,{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:r("registry.registrySettingsPage.publicRegistry")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:r("registry.registrySettingsPage.publicRegistryDescription")})]}),t.jsxs(V,{variant:"secondary",children:[ue," ",r(ue===1?"registry.registrySettingsPage.publicItem":"registry.registrySettingsPage.publicItems")]})]}),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:ne}),t.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:()=>j(ne),children:$?t.jsx(Mt,{size:14}):t.jsx(qt,{size:14})})]})]}),t.jsxs(me,{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:r("registry.registrySettingsPage.storeVisibility")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:r("registry.registrySettingsPage.storeVisibilityDescription")})]}),t.jsx(Ge,{id:"store-private-only",checked:d,onCheckedChange:z=>x({storePrivateOnly:z}),disabled:H})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.registrySettingsPage.storeVisibilityHelp")})]}),t.jsxs(me,{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:r("registry.registrySettingsPage.publishRequests")}),t.jsx("p",{className:"text-sm text-muted-foreground",children:r("registry.registrySettingsPage.publishRequestsDescription")})]}),t.jsx(Ge,{id:"accept-publish-requests",checked:o,onCheckedChange:z=>x({acceptPublishRequests:z}),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:ie}),t.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:()=>B(ie),children:X?t.jsx(Mt,{size:14}):t.jsx(qt,{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(oe,{className:"text-sm font-medium",children:r("registry.registrySettingsPage.requireApiToken")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.registrySettingsPage.requireApiTokenHelp")})]}),t.jsx(Ge,{id:"require-api-token",checked:u,onCheckedChange:z=>x({requireApiToken:z}),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(oe,{className:"text-sm font-medium",children:r("registry.registrySettingsPage.rateLimit")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.registrySettingsPage.rateLimitHelp")})]}),t.jsx(Ge,{id:"publish-rate-limit",checked:m,onCheckedChange:z=>x({rateLimitEnabled:z}),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(oe,{htmlFor:"rate-limit-max",className:"text-sm font-medium",children:r("registry.registrySettingsPage.maxRequests")}),t.jsx(ye,{id:"rate-limit-max",inputMode:"numeric",min:1,type:"number",value:P,onChange:z=>R(z.target.value),onBlur:xe,disabled:H,placeholder:r("registry.registrySettingsPage.maxRequestsPlaceholder")})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(oe,{htmlFor:"rate-limit-window",className:"text-sm font-medium",children:r("registry.registrySettingsPage.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:f,onChange:z=>x({rateLimitWindow:z.target.value}),disabled:H,children:[t.jsx("option",{value:"minute",children:r("registry.registrySettingsPage.perMinute")}),t.jsx("option",{value:"hour",children:r("registry.registrySettingsPage.perHour")})]})]})]}),o&&u&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-border",children:[t.jsx(jr,{size:14,className:"text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:r("registry.registrySettingsPage.apiKeys")})]}),s&&!K&&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:r("registry.registrySettingsPage.newKeyRefreshing")}),t.jsx(ye,{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(oe,{htmlFor:"api-key-name",className:"text-xs",children:r("registry.registrySettingsPage.keyName")}),t.jsx(ye,{id:"api-key-name",value:D,onChange:z=>F(z.target.value),placeholder:r("registry.registrySettingsPage.keyNamePlaceholder"),className:"h-8 text-sm"})]}),t.jsxs(Y,{variant:"outline",size:"sm",className:"h-8 gap-1.5",disabled:!D.trim()||v.isPending,onClick:Ie,children:[v.isPending?t.jsx(Ye,{size:14,className:"animate-spin"}):t.jsx(vr,{size:14}),r("registry.registrySettingsPage.generate")]})]}),(q.data?.items?.length??0)>0&&t.jsx("div",{className:"grid gap-2",children:q.data?.items?.map(z=>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:z.name}),C===z.prefix?t.jsx(ye,{readOnly:!0,value:T?s??"":"••••••••••••••••••••••••••••••••••••••••••••••••••••",className:"h-8 text-xs font-mono bg-muted/20"}):t.jsx(ye,{readOnly:!0,value:`${z.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:[C===z.prefix&&t.jsxs(t.Fragment,{children:[t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>U(le=>!le),children:T?t.jsx(Zs,{size:14}):t.jsx(ps,{size:14})}),t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:!s,onClick:()=>s&&J(s),children:de?t.jsx(Mt,{size:14}):t.jsx(qt,{size:14})})]}),t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-destructive hover:text-destructive",disabled:S.isPending,onClick:()=>O({id:z.id,name:z.name}),children:t.jsx(dt,{size:14})})]})]},z.id))})]})]})]})]}),t.jsx(ct,{open:!!E,onOpenChange:z=>{!z&&!S.isPending&&O(null)},children:t.jsxs(lt,{children:[t.jsxs(it,{children:[t.jsx(st,{children:r("registry.registrySettingsPage.revokeApiKeyTitle")}),t.jsx(rt,{children:r("registry.registrySettingsPage.revokeApiKeyDescription",{keyName:E?.name??""})})]}),t.jsxs(at,{children:[t.jsx(nt,{disabled:S.isPending,children:r("registry.registrySettingsPage.cancel")}),t.jsx(ot,{disabled:!E||S.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>E&&Ne(E.id),children:S.isPending?r("registry.registrySettingsPage.revoking"):r("registry.registrySettingsPage.revokeKey")})]})]})})]})}function Ii(s){const e=Z.c(8),{results:r}=s,i=ce();if(r.length===0){let c;e[0]!==i?(c=i("registry.brokenMcpList.noBrokenMcps"),e[0]=i,e[1]=c):c=e[1];let a;return e[2]!==c?(a=t.jsx(me,{className:"p-4 text-sm text-muted-foreground text-center",children:c}),e[2]=c,e[3]=a):a=e[3],a}let n;e[4]!==r?(n=r.map(ki),e[4]=r,e[5]=n):n=e[5];let l;return e[6]!==n?(l=t.jsx("div",{className:"space-y-2",children:n}),e[6]=n,e[7]=l):l=e[7],l}function ki(s){return t.jsx(Si,{result:s},s.id)}function Si(s){const e=Z.c(56),{result:r}=s,i=ce(),[n,l]=M.useState(!1);let c;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||e[10]!==i){const a=r.tool_results.filter(Mi);let o;e[12]!==n?(o=()=>l(!n),e[12]=n,e[13]=o):o=e[13];let u;e[14]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"text-destructive text-sm mt-0.5",children:"✗"}),e[14]=u):u=e[14];let d;e[15]!==r.item_title?(d=t.jsx("h4",{className:"text-sm font-medium truncate",children:r.item_title}),e[15]=r.item_title,e[16]=d):d=e[16];let m;e[17]!==r.status?(m=r.status.replace("_"," "),e[17]=r.status,e[18]=m):m=e[18];let f;e[19]!==m?(f=t.jsx(V,{variant:"destructive",className:"capitalize text-[10px] shrink-0",children:m}),e[19]=m,e[20]=f):f=e[20];let p;e[21]!==d||e[22]!==f?(p=t.jsxs("div",{className:"flex items-center gap-2",children:[d,f]}),e[21]=d,e[22]=f,e[23]=p):p=e[23];let g;e[24]!==i?(g=i("registry.brokenMcpList.connStatus"),e[24]=i,e[25]=g):g=e[25];const x=r.connection_ok?"✓":"✗";let h;e[26]!==g||e[27]!==x?(h=t.jsxs("span",{children:[g,":"," ",x]}),e[26]=g,e[27]=x,e[28]=h):h=e[28];let y;e[29]!==i?(y=i("registry.brokenMcpList.toolsListed"),e[29]=i,e[30]=y):y=e[30];const N=r.tools_listed?"✓":"✗";let w;e[31]!==y||e[32]!==N?(w=t.jsxs("span",{children:[y,":"," ",N]}),e[31]=y,e[32]=N,e[33]=w):w=e[33];let _;e[34]!==r.duration_ms?(_=t.jsxs("span",{children:[r.duration_ms,"ms"]}),e[34]=r.duration_ms,e[35]=_):_=e[35];const b=a.length>0&&t.jsx("span",{className:"text-destructive",children:i("registry.brokenMcpList.toolsFailed",{count:a.length})});let L;e[36]!==r.action_taken?(L=r.action_taken!=="none"&&t.jsx(V,{variant:"destructive",className:"text-[9px] px-1.5 py-0",children:r.action_taken.replace(/_/g," ")}),e[36]=r.action_taken,e[37]=L):L=e[37];let I;e[38]!==h||e[39]!==w||e[40]!==_||e[41]!==b||e[42]!==L?(I=t.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground flex-wrap",children:[h,w,_,b,L]}),e[38]=h,e[39]=w,e[40]=_,e[41]=b,e[42]=L,e[43]=I):I=e[43];let P;e[44]!==r.error_message?(P=r.error_message&&t.jsx("p",{className:"text-xs text-destructive line-clamp-2",children:r.error_message}),e[44]=r.error_message,e[45]=P):P=e[45];let R;e[46]!==I||e[47]!==P||e[48]!==p?(R=t.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[p,I,P]}),e[46]=I,e[47]=P,e[48]=p,e[49]=R):R=e[49];const k=n?"▲":"▼";let A;e[50]!==k?(A=t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0 mt-1",children:k}),e[50]=k,e[51]=A):A=e[51];let q;e[52]!==R||e[53]!==o||e[54]!==A?(q=t.jsxs("button",{type:"button",className:"w-full text-left p-3 flex items-start gap-3 hover:bg-muted/30 transition-colors",onClick:o,children:[u,R,A]}),e[52]=R,e[53]=o,e[54]=A,e[55]=q):q=e[55],c=t.jsxs(me,{className:"overflow-hidden",children:[q,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-destructive",children:i("registry.brokenMcpList.fullError")}),t.jsx("pre",{className:"text-[11px] bg-destructive/5 border border-destructive/10 rounded px-2.5 py-1.5 whitespace-pre-wrap break-all text-destructive",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:i("registry.brokenMcpList.connectionLabel")}),t.jsx("p",{className:te("text-xs font-medium",r.connection_ok?"text-success":"text-destructive"),children:r.connection_ok?i("registry.brokenMcpList.statusOk"):i("registry.brokenMcpList.statusFailed")})]}),t.jsxs("div",{className:"rounded border border-border px-2 py-1.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.brokenMcpList.toolsListedLabel")}),t.jsx("p",{className:te("text-xs font-medium",r.tools_listed?"text-success":"text-destructive"),children:r.tools_listed?i("registry.brokenMcpList.yes"):i("registry.brokenMcpList.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:i("registry.brokenMcpList.durationLabel")}),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.jsx("p",{className:"text-[10px] font-semibold text-destructive",children:i("registry.brokenMcpList.failedToolsHeader",{count:a.length})}),a.map(v=>t.jsxs("div",{className:"rounded border border-destructive/10 bg-destructive/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-destructive",children:v.toolName}),t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[v.durationMs,"ms"]})]}),v.error&&t.jsx("pre",{className:"text-[11px] whitespace-pre-wrap break-all text-destructive",children:v.error})]},`${r.id}-${v.toolName}`))]}),r.tool_results.length>0&&r.tool_results.some(Ti)&&t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.brokenMcpList.passingTools")}),t.jsx("div",{className:"flex flex-wrap gap-1",children:r.tool_results.filter(Di).map(v=>t.jsxs(V,{variant:"secondary",className:"text-[10px]",children:["✓ ",v.toolName]},`${r.id}-${v.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,e[11]=c}else c=e[11];return c}function Di(s){return s.success}function Ti(s){return s.success}function Mi(s){return!s.success}function qi(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??"")}function Ei(){const s=ce(),{settings:e,saveMutation:r}=fs(),i=M.useRef(e),[n,l]=M.useState(e),[c,a]=M.useState(!1),[o,u]=M.useState(!1);i.current!==e&&(i.current=e,l(e));const d=qi(n,e),m=p=>{a(!1),l(g=>({...g,...p}))},f=async()=>{const p={...n,agentContext:(n.agentContext??"").trim()};await r.mutateAsync(p),l(p),a(!0),setTimeout(()=>a(!1),3e3)};return t.jsxs(me,{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:s("registry.monitorConfiguration.qaConfiguration")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("registry.monitorConfiguration.description")})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[d&&t.jsx(V,{className:"bg-warning/10 text-warning border-warning/20 text-[10px]",children:s("registry.monitorConfiguration.unsavedChanges")}),c&&t.jsxs(V,{className:"bg-success/10 text-success border-success/20 text-[10px]",children:["✓ ",s("registry.monitorConfiguration.saved")]}),t.jsx(Y,{size:"sm",onClick:f,disabled:r.isPending||!d,children:r.isPending?s("registry.monitorConfiguration.saving"):s("registry.monitorConfiguration.saveSettings")})]})]}),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(He,{label:s("registry.monitorConfiguration.onFailureLabel"),hint:s("registry.monitorConfiguration.onFailureHint")}),t.jsxs("select",{className:"h-9 rounded-md border border-input bg-background px-3 text-sm",value:n.onFailure,onChange:p=>m({onFailure:p.target.value}),children:[t.jsx("option",{value:"none",children:s("registry.monitorConfiguration.onFailureNone")}),t.jsx("option",{value:"unlisted",children:s("registry.monitorConfiguration.onFailureUnlisted")}),t.jsx("option",{value:"remove_public",children:s("registry.monitorConfiguration.onFailureRemovePublic")}),t.jsx("option",{value:"remove_private",children:s("registry.monitorConfiguration.onFailureRemovePrivate")}),t.jsx("option",{value:"remove_all",children:s("registry.monitorConfiguration.onFailureRemoveAll")})]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.testScopeLabel"),hint:s("registry.monitorConfiguration.testScopeHint")}),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:n.testPublicOnly,onChange:p=>m({testPublicOnly:p.target.checked,testPrivateOnly:p.target.checked?!1:n.testPrivateOnly})}),s("registry.monitorConfiguration.publicOnly")]}),t.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[t.jsx("input",{type:"checkbox",checked:n.testPrivateOnly,onChange:p=>m({testPrivateOnly:p.target.checked,testPublicOnly:p.target.checked?!1:n.testPublicOnly})}),s("registry.monitorConfiguration.privateOnly")]})]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.publishRequestsLabel"),hint:s("registry.monitorConfiguration.publishRequestsHint")}),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:n.includePendingRequests,onChange:p=>m({includePendingRequests:p.target.checked})}),s("registry.monitorConfiguration.includePendingRequests")]})})]}),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(He,{label:s("registry.monitorConfiguration.additionalTestContextLabel"),hint:s("registry.monitorConfiguration.additionalTestContextHint")}),t.jsxs(Y,{size:"sm",variant:"outline",className:"h-7",onClick:()=>u(p=>!p),children:[s(o?"registry.monitorConfiguration.hideDefaultPrompt":"registry.monitorConfiguration.viewDefaultPrompt")," ",s("registry.monitorConfiguration.defaultSystemPrompt")]})]}),t.jsx(wt,{value:n.agentContext??"",onChange:p=>m({agentContext:p.target.value}),placeholder:s("registry.monitorConfiguration.agentContextPlaceholder"),rows:3}),t.jsx("p",{className:"text-[11px] text-muted-foreground",children:s("registry.monitorConfiguration.agentContextHelper")}),o&&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:Rr})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.perMcpTimeoutLabel"),hint:s("registry.monitorConfiguration.perMcpTimeoutHint")}),t.jsx(ye,{type:"number",value:n.perMcpTimeoutMs,onChange:p=>m({perMcpTimeoutMs:Number(p.target.value)})})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.perToolTimeoutLabel"),hint:s("registry.monitorConfiguration.perToolTimeoutHint")}),t.jsx(ye,{type:"number",value:n.perToolTimeoutMs,onChange:p=>m({perToolTimeoutMs:Number(p.target.value)})})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.maxAgentStepsLabel"),hint:s("registry.monitorConfiguration.maxAgentStepsHint")}),t.jsx(ye,{type:"number",value:n.maxAgentSteps,onChange:p=>m({maxAgentSteps:Number(p.target.value)}),min:1,max:30})]})]})]})}function He(s){const e=Z.c(16),{label:r,hint:i}=s,n=ce();let l;e[0]!==r?(l=t.jsx(oe,{children:r}),e[0]=r,e[1]=l):l=e[1];let c;e[2]!==r||e[3]!==n?(c=n("registry.monitorConfiguration.aboutLabel",{label:r}),e[2]=r,e[3]=n,e[4]=c):c=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Vs,{size:14}),e[5]=a):a=e[5];let o;e[6]!==c?(o=t.jsx(br,{asChild:!0,children:t.jsx("button",{type:"button",className:"text-muted-foreground hover:text-foreground transition-colors","aria-label":c,children:a})}),e[6]=c,e[7]=o):o=e[7];let u;e[8]!==i?(u=t.jsx(Nr,{side:"top",className:"max-w-72",children:i}),e[8]=i,e[9]=u):u=e[9];let d;e[10]!==o||e[11]!==u?(d=t.jsxs(Cr,{children:[o,u]}),e[10]=o,e[11]=u,e[12]=d):d=e[12];let m;return e[13]!==l||e[14]!==d?(m=t.jsxs("div",{className:"flex items-center gap-1.5",children:[l,d]}),e[13]=l,e[14]=d,e[15]=m):m=e[15],m}function Li(s){switch(s){case"authenticated":return"bg-success/10 text-success border-success/20";case"needs_auth":return"bg-warning/10 text-warning border-warning/20";default:return"bg-muted text-muted-foreground border-border"}}function Ai(s,e){switch(s){case"authenticated":return e("registry.monitorConnectionsPanel.authenticated");case"needs_auth":return e("registry.monitorConnectionsPanel.needsAuth");default:return e("registry.monitorConnectionsPanel.notChecked")}}function Ui(s){const e=Z.c(4),{icon:r,title:i}=s,[n,l]=M.useState(!1);let c;return e[0]!==r||e[1]!==n||e[2]!==i?(c=t.jsx("div",{className:"size-10 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0 flex items-center justify-center",children:r&&!n?t.jsx("img",{src:r,alt:i,className:"h-full w-full object-cover",loading:"lazy",onError:()=>l(!0)}):t.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:i.charAt(0).toUpperCase()})}),e[0]=r,e[1]=n,e[2]=i,e[3]=c):c=e[3],c}function Fi({entry:s,onAuthChanged:e,failedToolsCount:r,failedResultCount:i}){const[n,l]=M.useState(!1),[c,a]=M.useState(""),[o,u]=M.useState(!1),d=ce(),m=Tr(),{updateMutation:f}=Ot(),{org:p}=be(),g=Te(),x=Ue(),h=s.mapping.connection_id,y=s.mapping.auth_status,N=s.item?.title??s.mapping.item_id,w=s.item?.server?.icons?.[0]?.src??null,_=s.item?.is_public??!1,b=s.item?.is_unlisted??!1,L=s.source==="request",I=Ae({queryKey:W.monitorConnectionAuthProbe(p.id,h),queryFn:async()=>wr({url:`/api/${p.slug}/mcp/${h}`,token:null,orgId:p.id}),staleTime:1e4,retry:1,refetchOnWindowFocus:!1}),P=I.data,R=I.isLoading,k=P?.supportsOAuth??!1,A=P?.hasOAuthToken??!1,q=P?.isServerError??!1,v=P?.isAuthenticated??!1,S=q?void 0:P?.error,D=R?"checking":q?"server_error":S?"unreachable":k?v?A?"oauth_connected":"connected":"oauth_available":v?"connected":"token_required",F=()=>{m.mutate({connectionId:h,authStatus:"authenticated"},{onSuccess:()=>{e(),Ks(h),x.invalidateQueries({predicate:B=>B.queryKey[1]===Hs&&B.queryKey[3]===h})},onError:B=>G.error(d("registry.monitorConnectionsPanel.failedToSaveAuthStatus",{title:N,error:B instanceof Error?B.message:String(B)}))})},T=async()=>{l(!0);try{const X=(await I.refetch()).data;if(!X){G.error(d("registry.monitorConnectionsPanel.couldNotReachConnection",{title:N}));return}if(X.isAuthenticated){G.success(d("registry.monitorConnectionsPanel.connectionReachable",{title:N}));return}if(X.isServerError){G.error(d("registry.monitorConnectionsPanel.serverErrorConnection",{title:N}));return}if(X.error){G.error(d("registry.monitorConnectionsPanel.connectionUnreachable",{title:N,error:X.error}));return}if(!X.supportsOAuth){G.warning(d("registry.monitorConnectionsPanel.noOAuthSupport",{title:N}));return}G.info(d("registry.monitorConnectionsPanel.openingAuthWindow",{title:N}));const J=await _r({connectionId:h,orgSlug:p.slug,clientName:`MCP Test - ${N}`,timeout:18e4,scope:"offline_access"});if(J.error){G.error(d("registry.monitorConnectionsPanel.oauthFailed",{title:N,error:J.error}));return}if(J.tokenInfo){if(!(await fetch(`/api/${p.slug}/connections/${h}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:J.tokenInfo.accessToken,refreshToken:J.tokenInfo.refreshToken,expiresIn:J.tokenInfo.expiresIn,scope:J.tokenInfo.scope,clientId:J.tokenInfo.clientId,clientSecret:J.tokenInfo.clientSecret,tokenEndpoint:J.tokenInfo.tokenEndpoint})})).ok)if(J.token)await U(J.token);else{G.error(d("registry.monitorConnectionsPanel.failedToSaveOAuthTokens",{title:N}));return}}else J.token&&await U(J.token);G.success(d("registry.monitorConnectionsPanel.connectionAuthenticated",{title:N})),F(),await I.refetch()}catch(B){console.error("[MonitorConnectionsPanel] Auth error:",B),G.error(d("registry.monitorConnectionsPanel.authError",{error:B instanceof Error?B.message:String(B)}))}finally{l(!1)}},U=async B=>{await g.call("COLLECTION_CONNECTIONS_UPDATE",{id:h,data:{connection_token:B}})},E=async()=>{if(!c.trim()){G.error(d("registry.monitorConnectionsPanel.tokenCannotBeEmpty"));return}l(!0);try{await U(c),G.success(d("registry.monitorConnectionsPanel.tokenSaved",{title:N})),u(!1),a(""),F(),await I.refetch()}catch(B){G.error(d("registry.monitorConnectionsPanel.errorSavingToken",{error:B instanceof Error?B.message:String(B)}))}finally{l(!1)}},O=!R&&y==="authenticated"&&!A&&!o&&c.length===0,j=R&&y==="authenticated"&&!o&&c.length===0,$=async B=>{if(L){G.info(d("registry.monitorConnectionsPanel.visibilityOnlyForStore"));return}if(!s.item){G.error(d("registry.monitorConnectionsPanel.registryItemNotFound"));return}try{await f.mutateAsync({id:s.item.id,data:B}),G.success(d("registry.monitorConnectionsPanel.visibilityUpdated")),e()}catch(X){G.error(X instanceof Error?X.message:d("registry.monitorConnectionsPanel.failedToUpdateVisibility"))}};return t.jsxs(me,{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(Ui,{icon:w,title:N},w??N),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:N}),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(V,{variant:"outline",className:te("text-[10px]",Li(y)),children:Ai(y,d)}),t.jsx(V,{variant:_?"default":"secondary",className:"text-[10px]",children:d(_?"registry.monitorConnectionsPanel.public":"registry.monitorConnectionsPanel.notPublic")}),t.jsx(V,{variant:"outline",className:"text-[10px]",children:d(L?"registry.monitorConnectionsPanel.request":"registry.monitorConnectionsPanel.store")}),t.jsxs(V,{variant:"outline",className:te("text-[10px]",D==="server_error"||D==="unreachable"?"border-destructive/40 text-destructive":D==="oauth_connected"?"border-success/30 text-success":D==="oauth_available"?"border-sky-500/30 text-sky-600":D==="token_required"?"border-warning/30 text-warning":"text-muted-foreground"),children:[D==="checking"&&d("registry.monitorConnectionsPanel.checkingAuth"),D==="server_error"&&d("registry.monitorConnectionsPanel.serverError"),D==="unreachable"&&d("registry.monitorConnectionsPanel.unreachable"),D==="oauth_connected"&&d("registry.monitorConnectionsPanel.oauthConnected"),D==="oauth_available"&&d("registry.monitorConnectionsPanel.oauthAvailable"),D==="token_required"&&d("registry.monitorConnectionsPanel.tokenManualAuth"),D==="connected"&&d("registry.monitorConnectionsPanel.connected")]}),b&&t.jsx(V,{variant:"outline",className:"text-[10px]",children:d("registry.monitorConnectionsPanel.hiddenInPrivate")}),(i>0||r>0)&&t.jsx(V,{variant:"destructive",className:"text-[10px]",children:d("registry.monitorConnectionsPanel.failedCount",{mcpCount:i,toolsCount:r})})]})]})]}),t.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:t.jsxs(ft,{children:[t.jsx(pt,{asChild:!0,children:t.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0","aria-label":d("registry.monitorConnectionsPanel.actionsFor",{title:N}),children:t.jsx($t,{size:16})})}),t.jsx(ht,{align:"end",children:L?t.jsx(Re,{disabled:!0,children:d("registry.monitorConnectionsPanel.requestItemNoControls")}):t.jsxs(t.Fragment,{children:[t.jsx(Re,{onClick:()=>$({is_public:!1}),children:d("registry.monitorConnectionsPanel.hideFromPublicStore")}),t.jsx(Re,{onClick:()=>$({is_unlisted:!0}),children:d("registry.monitorConnectionsPanel.hideFromPrivateStore")}),t.jsx(Re,{onClick:()=>$({is_public:!0,is_unlisted:!1}),children:d("registry.monitorConnectionsPanel.showInBothStores")})]})})]})})]}),t.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 flex-wrap",children:[k&&t.jsx(Y,{size:"sm",onClick:T,disabled:n,children:n?"...":d(A?"registry.monitorConnectionsPanel.reAuthOAuth":"registry.monitorConnectionsPanel.oauth")}),t.jsx(Y,{size:"sm",variant:"outline",onClick:()=>I.refetch(),disabled:n||R,children:d(R?"registry.monitorConnectionsPanel.checking":"registry.monitorConnectionsPanel.reCheck")})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:d("registry.monitorConnectionsPanel.tokenApiKeyDescription")}),j?t.jsx("div",{className:"h-8 px-3 flex items-center rounded-md border border-border bg-muted/30 text-muted-foreground text-xs",children:d("registry.monitorConnectionsPanel.checkingAuth")}):O?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:d("registry.monitorConnectionsPanel.replaceToken"),children:d("registry.monitorConnectionsPanel.edit")})]}):t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ye,{type:"password",placeholder:d("registry.monitorConnectionsPanel.pasteApiTokenPlaceholder"),value:c,onChange:B=>a(B.target.value),className:"h-8 text-xs flex-1",onKeyDown:B=>{B.key==="Enter"&&E()}}),t.jsx(Y,{size:"sm",className:"h-8 text-xs",onClick:E,disabled:n||!c.trim(),children:d("registry.monitorConnectionsPanel.save")}),t.jsx(Y,{size:"sm",variant:"ghost",className:"h-8 text-xs",onClick:()=>{u(!1),a("")},children:"✕"})]})]})]})}function $i(){const s=Z.c(87),e=ce(),r=hs(),n=Pt("completed").data?.items?.[0],l=ut(n?.id,void 0,n?.status),c=Dr(),[a,o]=M.useState("all");let u,d,m,f,p,g;if(s[0]!==r||s[1]!==l.data?.items||s[2]!==a||s[3]!==c||s[4]!==e){const y=r.data?.items??[];let N;s[11]!==l.data?.items?(N=(l.data?.items??[]).reduce(zi,{}),s[11]=l.data?.items,s[12]=N):N=s[12];const w=N;let _;s[13]!==a?(_=H=>a==="all"?!0:H.source===a,s[13]=a,s[14]=_):_=s[14];const b=y.filter(_);u=me,p="p-4 space-y-3";let L;s[15]!==e?(L=e("registry.monitorConnectionsPanel.title"),s[15]=e,s[16]=L):L=s[16];let I;s[17]!==L?(I=t.jsx("h3",{className:"text-sm font-semibold",children:L}),s[17]=L,s[18]=I):I=s[18];let P;s[19]!==e?(P=e("registry.monitorConnectionsPanel.description1"),s[19]=e,s[20]=P):P=s[20];let R;s[21]!==P?(R=t.jsx("p",{className:"text-[10px] text-muted-foreground",children:P}),s[21]=P,s[22]=R):R=s[22];let k;s[23]!==e?(k=e("registry.monitorConnectionsPanel.description2"),s[23]=e,s[24]=k):k=s[24];let A;s[25]!==k?(A=t.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:k}),s[25]=k,s[26]=A):A=s[26];let q;s[27]!==e?(q=e("registry.monitorConnectionsPanel.description3"),s[27]=e,s[28]=q):q=s[28];let v;s[29]!==q?(v=t.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:q}),s[29]=q,s[30]=v):v=s[30];const S=a==="all"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let D;s[31]!==S?(D=te("px-2.5 py-1 text-xs rounded-md transition-colors",S),s[31]=S,s[32]=D):D=s[32];let F;s[33]===Symbol.for("react.memo_cache_sentinel")?(F=()=>o("all"),s[33]=F):F=s[33];let T;s[34]!==e?(T=e("registry.monitorConnectionsPanel.filterAll"),s[34]=e,s[35]=T):T=s[35];let U;s[36]!==D||s[37]!==T?(U=t.jsx("button",{type:"button",className:D,onClick:F,children:T}),s[36]=D,s[37]=T,s[38]=U):U=s[38];const E=a==="store"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let O;s[39]!==E?(O=te("px-2.5 py-1 text-xs rounded-md transition-colors",E),s[39]=E,s[40]=O):O=s[40];let j;s[41]===Symbol.for("react.memo_cache_sentinel")?(j=()=>o("store"),s[41]=j):j=s[41];let $;s[42]!==e?($=e("registry.monitorConnectionsPanel.filterStore"),s[42]=e,s[43]=$):$=s[43];let B;s[44]!==O||s[45]!==$?(B=t.jsx("button",{type:"button",className:O,onClick:j,children:$}),s[44]=O,s[45]=$,s[46]=B):B=s[46];const X=a==="request"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let J;s[47]!==X?(J=te("px-2.5 py-1 text-xs rounded-md transition-colors",X),s[47]=X,s[48]=J):J=s[48];let de;s[49]===Symbol.for("react.memo_cache_sentinel")?(de=()=>o("request"),s[49]=de):de=s[49];let se;s[50]!==e?(se=e("registry.monitorConnectionsPanel.filterRequests"),s[50]=e,s[51]=se):se=s[51];let ne;s[52]!==J||s[53]!==se?(ne=t.jsx("button",{type:"button",className:J,onClick:de,children:se}),s[52]=J,s[53]=se,s[54]=ne):ne=s[54];let ge;s[55]!==U||s[56]!==B||s[57]!==ne?(ge=t.jsxs("div",{className:"mt-2 inline-flex rounded-lg border border-border p-0.5",children:[U,B,ne]}),s[55]=U,s[56]=B,s[57]=ne,s[58]=ge):ge=s[58];let ue;s[59]!==R||s[60]!==A||s[61]!==v||s[62]!==ge||s[63]!==I?(ue=t.jsxs("div",{children:[I,R,A,v,ge]}),s[59]=R,s[60]=A,s[61]=v,s[62]=ge,s[63]=I,s[64]=ue):ue=s[64];let ie;s[65]!==c||s[66]!==e?(ie=()=>{c.mutate(void 0,{onSuccess:()=>G.success(e("registry.monitorConnectionsPanel.connectionsSynced")),onError:H=>G.error(e("registry.monitorConnectionsPanel.syncFailed",{error:H.message}))})},s[65]=c,s[66]=e,s[67]=ie):ie=s[67];let C;s[68]!==c.isPending||s[69]!==e?(C=c.isPending?e("registry.monitorConnectionsPanel.syncing"):e("registry.monitorConnectionsPanel.sync"),s[68]=c.isPending,s[69]=e,s[70]=C):C=s[70];let K;s[71]!==c.isPending||s[72]!==ie||s[73]!==C?(K=t.jsx(Y,{size:"sm",variant:"outline",onClick:ie,disabled:c.isPending,children:C}),s[71]=c.isPending,s[72]=ie,s[73]=C,s[74]=K):K=s[74],s[75]!==ue||s[76]!==K?(g=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[ue,K]}),s[75]=ue,s[76]=K,s[77]=g):g=s[77],d="space-y-2",m=r.isLoading?t.jsx("p",{className:"text-xs text-muted-foreground text-center py-3",children:e("registry.monitorConnectionsPanel.loadingConnections")}):r.isError?t.jsxs("div",{className:"p-8 text-center rounded-lg border border-border",children:[t.jsx("p",{className:"text-sm text-destructive",children:e("registry.monitorConnectionsPanel.loadFailed")}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:r.error instanceof Error?r.error.message:e("registry.monitorConnectionsPanel.unknownError")})]}):b.length===0&&t.jsx("p",{className:"text-xs text-muted-foreground text-center py-3",children:e("registry.monitorConnectionsPanel.noConnectionsForFilter")}),f=!r.isLoading&&!r.isError&&b.length>0&&t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:b.map(H=>{const re=w[H.mapping.item_id]??{failedTools:0,failedResults:0};return t.jsx(Fi,{entry:H,onAuthChanged:()=>r.refetch(),failedToolsCount:re.failedTools,failedResultCount:re.failedResults},H.mapping.id)})}),s[0]=r,s[1]=l.data?.items,s[2]=a,s[3]=c,s[4]=e,s[5]=u,s[6]=d,s[7]=m,s[8]=f,s[9]=p,s[10]=g}else u=s[5],d=s[6],m=s[7],f=s[8],p=s[9],g=s[10];let x;s[78]!==d||s[79]!==m||s[80]!==f?(x=t.jsxs("div",{className:d,children:[m,f]}),s[78]=d,s[79]=m,s[80]=f,s[81]=x):x=s[81];let h;return s[82]!==u||s[83]!==p||s[84]!==g||s[85]!==x?(h=t.jsxs(u,{className:p,children:[g,x]}),s[82]=u,s[83]=p,s[84]=g,s[85]=x,s[86]=h):h=s[86],h}function zi(s,e){const r=s[e.item_id]??{failedTools:0,failedResults:0},i=e.tool_results.filter(Oi).length;return r.failedTools=r.failedTools+i,(e.status==="failed"||e.status==="error")&&(r.failedResults=r.failedResults+1),s[e.item_id]=r,s}function Oi(s){return!s.success}function ws(s){switch(s){case"running":return"bg-primary/10 text-primary border-primary/20";case"completed":return"bg-success/10 text-success border-success/20";case"failed":return"bg-destructive/10 text-destructive border-destructive/20";case"cancelled":return"bg-muted text-muted-foreground border-border";case"pending":return"bg-warning/10 text-warning border-warning/20";default:return""}}function _s(s,e){if(!s)return null;const r=e?new Date(e).getTime():Date.now(),i=new Date(s).getTime(),n=r-i;return n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${Math.floor(n/6e4)}m ${Math.round(n%6e4/1e3)}s`}function Bi(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 Ps(s){const e=Bi(s),r=e.every(c=>c.outputPreview==="health_check: not called"),i=e.filter(c=>c.outputPreview!=="health_check: not called"),n=i.filter(c=>c.success).length,l=i.filter(c=>!c.success).length;return{latestToolResults:e,realToolTests:i,isHealthCheck:r,passedTools:n,failedTools:l,hasToolTests:i.length>0}}function Ki(s){return s.total_items?Math.min(100,Math.round(s.tested_items/s.total_items*100)):0}function Hi(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 Vi(s){const e=Z.c(45),{result:r,index:i,icon:n}=s,l=ce(),[c,a]=M.useState(!1);let o;if(e[0]!==c||e[1]!==n||e[2]!==i||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){const{latestToolResults:u,realToolTests:d,isHealthCheck:m,passedTools:f,failedTools:p,hasToolTests:g}=Ps(r.tool_results),x=d.length;let h;e[15]!==r.agent_summary?(h=Hi(r.agent_summary),e[15]=r.agent_summary,e[16]=h):h=e[16];const y=h,N=Math.max(u.length,y??0),w=N>0?l("registry.monitorDashboard.toolsTestedCount",{tested:x,discovered:N}):l("registry.monitorDashboard.noTools");let _;e[17]!==c?(_=()=>a(!c),e[17]=c,e[18]=_):_=e[18];const b=i+1;let L;e[19]!==b?(L=t.jsx("span",{className:"text-muted-foreground w-5 text-right shrink-0",children:b}),e[19]=b,e[20]=L):L=e[20];let I;e[21]!==n||e[22]!==r.item_title?(I=t.jsx("div",{className:"size-5 rounded border border-border bg-muted/20 overflow-hidden shrink-0 flex items-center justify-center",children:n?t.jsx("img",{src:n,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[21]=n,e[22]=r.item_title,e[23]=I):I=e[23];const P=r.status==="passed"?"text-success":r.status==="needs_auth"?"text-warning":"text-destructive";let R;e[24]!==P?(R=te("shrink-0",P),e[24]=P,e[25]=R):R=e[25];const k=r.status==="passed"?"✓":r.status==="needs_auth"?"🔑":"✗";let A;e[26]!==R||e[27]!==k?(A=t.jsx("span",{className:R,children:k}),e[26]=R,e[27]=k,e[28]=A):A=e[28];let q;e[29]!==r.item_title?(q=t.jsx("span",{className:"font-medium truncate flex-1 min-w-0",children:r.item_title}),e[29]=r.item_title,e[30]=q):q=e[30];let v;e[31]!==r.duration_ms?(v=t.jsxs("span",{className:"text-muted-foreground shrink-0",children:[r.duration_ms,"ms"]}),e[31]=r.duration_ms,e[32]=v):v=e[32];const S=r.status==="passed"?"text-success border-success/20":r.status==="needs_auth"?"text-warning border-warning/20":"text-destructive border-destructive/20";let D;e[33]!==S?(D=te("text-[9px] capitalize shrink-0",S),e[33]=S,e[34]=D):D=e[34];let F;e[35]!==r.status?(F=r.status.replace("_"," "),e[35]=r.status,e[36]=F):F=e[36];let T;e[37]!==D||e[38]!==F?(T=t.jsx(V,{variant:"outline",className:D,children:F}),e[37]=D,e[38]=F,e[39]=T):T=e[39];let U;e[40]!==r.connection_ok||e[41]!==l?(U=r.connection_ok?t.jsx("span",{className:"text-[10px] text-success shrink-0",title:l("registry.monitorDashboard.connOkTitle"),children:"conn✓"}):t.jsx("span",{className:"text-[10px] text-destructive shrink-0",title:l("registry.monitorDashboard.connFailTitle"),children:"conn✗"}),e[40]=r.connection_ok,e[41]=l,e[42]=U):U=e[42];const E=c?"▲":"▼";let O;e[43]!==E?(O=t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:E}),e[43]=E,e[44]=O):O=e[44],o=t.jsxs("div",{className:"rounded border border-border overflow-hidden",children:[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:_,children:[L,I,A,q,v,T,U,r.tools_listed&&t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:g?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-success",children:[f,"✓"]})," ",t.jsxs("span",{className:te(p>0?"text-destructive":""),children:[p,"✗"]})]}):m&&u.length>0?t.jsx("span",{children:l("registry.monitorDashboard.toolsFoundCount",{count:u.length})}):l("registry.monitorDashboard.noToolsLabel")}),t.jsx(V,{variant:"outline",className:"text-[9px] shrink-0",children:w}),O]}),c&&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-destructive",children:l("registry.monitorDashboard.errorLabel")}),t.jsx("pre",{className:"text-[11px] bg-destructive/5 border border-destructive/10 rounded px-2 py-1.5 whitespace-pre-wrap break-all text-destructive 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:[l("registry.monitorDashboard.connectionLabel")," ",t.jsx("span",{className:te(r.connection_ok?"text-success":"text-destructive"),children:r.connection_ok?l("registry.monitorDashboard.statusOk"):l("registry.monitorDashboard.statusFailed")})]}),t.jsxs("span",{children:[l("registry.monitorDashboard.toolsListedLabel")," ",t.jsx("span",{className:te(r.tools_listed?"text-success":"text-destructive"),children:r.tools_listed?l("registry.monitorDashboard.yes"):l("registry.monitorDashboard.no")})]}),r.action_taken!=="none"&&t.jsxs(V,{variant:"destructive",className:"text-[9px] px-1.5 py-0",children:["action: ",r.action_taken]})]}),g?t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:l("registry.monitorDashboard.toolsTestedDetails",{passed:f,failed:p})}),t.jsx("div",{className:"space-y-0.5",children:d.map((j,$)=>t.jsx(Gi,{tool:j},`${r.id}-${j.toolName}-${$}`))})]}):m&&u.length>0?t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:l("registry.monitorDashboard.toolsDiscoveredHealthCheck",{count:u.length})}),t.jsx("div",{className:"flex flex-wrap gap-1",children:u.map((j,$)=>t.jsx(V,{variant:"outline",className:"text-[10px] font-mono",children:j.toolName},`${r.id}-${j.toolName}-${$}`))})]}):r.tools_listed?t.jsx("p",{className:"text-[10px] text-muted-foreground italic",children:l("registry.monitorDashboard.noToolsFound")}):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]=c,e[1]=n,e[2]=i,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,e[14]=o}else o=e[14];return o}function Gi(s){const e=Z.c(31),{tool:r}=s,i=ce(),[n,l]=M.useState(!1);let c;e[0]!==n?(c=()=>l(!n),e[0]=n,e[1]=c):c=e[1];const a=r.success?"text-success":"text-destructive";let o;e[2]!==a?(o=te("font-bold",a),e[2]=a,e[3]=o):o=e[3];const u=r.success?"✓":"✗";let d;e[4]!==o||e[5]!==u?(d=t.jsx("span",{className:o,children:u}),e[4]=o,e[5]=u,e[6]=d):d=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 f;e[9]!==r.durationMs?(f=t.jsxs("span",{className:"text-muted-foreground shrink-0",children:[r.durationMs,"ms"]}),e[9]=r.durationMs,e[10]=f):f=e[10];let p;e[11]!==r.error?(p=r.error&&t.jsx("span",{className:"text-destructive truncate max-w-28",title:r.error,children:r.error}),e[11]=r.error,e[12]=p):p=e[12];const g=n?"▲":"▼";let x;e[13]!==g?(x=t.jsx("span",{className:"text-muted-foreground",children:g}),e[13]=g,e[14]=x):x=e[14];let h;e[15]!==c||e[16]!==x||e[17]!==d||e[18]!==m||e[19]!==f||e[20]!==p?(h=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:c,children:[d,m,f,p,x]}),e[15]=c,e[16]=x,e[17]=d,e[18]=m,e[19]=f,e[20]=p,e[21]=h):h=e[21];let y;e[22]!==n||e[23]!==i||e[24]!==r.error||e[25]!==r.input||e[26]!==r.outputPreview?(y=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-destructive/5 border border-destructive/10 rounded px-2 py-1 whitespace-pre-wrap break-all text-destructive 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:i("registry.monitorDashboard.inputLabel")}),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:i("registry.monitorDashboard.outputLabel")}),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]=i,e[24]=r.error,e[25]=r.input,e[26]=r.outputPreview,e[27]=y):y=e[27];let N;return e[28]!==h||e[29]!==y?(N=t.jsxs("div",{className:"rounded border border-border overflow-hidden",children:[h,y]}),e[28]=h,e[29]=y,e[30]=N):N=e[30],N}function Qi({activeRunId:s,onRunChange:e}){const r=ce(),{settings:i}=fs(),[n,l]=M.useState(null),[c,a]=M.useState(!1),o=M.useRef(0),u=M.useRef(null),d=Ir(),m=kr(),f=zt(s),p=Pt(),g=hs(),x=f.data?.run??null,h=x?.status,y=x?.config_snapshot?.monitorMode??x?.config_snapshot?.testMode,N=ut(s,void 0,h),w=(p.data?.items??[]).find(v=>v.status==="running"),_=p.data?.items?.[0]?.id;!s&&_&&u.current!==_&&(u.current=_,queueMicrotask(()=>{e(_)}));const b=async()=>{const v=Date.now();if(v-o.current<1e3)return;o.current=v;const S=n??i.monitorMode,D=await d.mutateAsync({...i,monitorMode:S});e(D.run.id)},L=async()=>{if(w&&w.id!==s&&w.status==="running"){a(!0);return}await b()},I=async()=>{s&&await m.mutateAsync(s)},P=x?.status==="running",R=x?_s(x.started_at,x.finished_at):null,k=N.data?.items??[],A=(g.data?.items??[]).reduce((v,S)=>(v[S.mapping.item_id]=S.item?.server?.icons?.[0]?.src??null,v),{}),q=n??i.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(me,{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:r("registry.monitorDashboard.currentQaRunTitle")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.monitorDashboard.currentQaRunDescription")})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[w&&w.id!==s&&t.jsx(V,{variant:"outline",className:"text-[10px]",children:r("registry.monitorDashboard.runInProgressBadge",{runId:w.id.slice(0,8)})}),t.jsxs(Y,{size:"sm",onClick:L,disabled:d.isPending||P,className:"gap-1.5",children:[t.jsx(Pr,{size:14}),d.isPending?r("registry.monitorDashboard.startingButton"):w&&w.id!==s?r("registry.monitorDashboard.startAnotherRunButton"):r("registry.monitorDashboard.startQaRunButton")]}),t.jsxs(Y,{size:"sm",variant:"outline",onClick:I,disabled:!s||!P,className:"gap-1.5",children:[t.jsx(Gs,{size:14}),r("registry.monitorDashboard.cancelButton")]})]})]}),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:r("registry.monitorDashboard.qaModeLabel")}),t.jsxs("select",{className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm",value:q,onChange:v=>l(v.target.value),disabled:P,children:[t.jsx("option",{value:"health_check",children:r("registry.monitorDashboard.modeHealthCheck")}),t.jsx("option",{value:"tool_call",children:r("registry.monitorDashboard.modeToolCall")}),t.jsx("option",{value:"full_agent",children:r("registry.monitorDashboard.modeAgentic")})]})]}),t.jsxs("label",{className:"space-y-1",children:[t.jsx("span",{className:"text-[11px] text-muted-foreground",children:r("registry.monitorDashboard.qaRunHistoryLabel")}),t.jsxs("select",{className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm",value:s??"",onChange:v=>e(v.target.value||void 0),children:[t.jsx("option",{value:"",children:r("registry.monitorDashboard.autoSelectLatestRun")}),(p.data?.items??[]).map(v=>t.jsxs("option",{value:v.id,children:[new Date(v.created_at).toLocaleString()," -"," ",v.status]},v.id))]})]})]}),t.jsx("p",{className:"text-[11px] text-muted-foreground rounded-md bg-muted/30 px-2.5 py-2",children:r(q==="health_check"?"registry.monitorDashboard.modeDescriptionHealthCheck":q==="tool_call"?"registry.monitorDashboard.modeDescriptionToolCall":"registry.monitorDashboard.modeDescriptionAgentic")}),x?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[t.jsx(V,{className:te("capitalize",ws(x.status),x.status==="running"?"animate-pulse":""),children:x.status}),t.jsx("span",{className:"text-xs text-muted-foreground",children:r("registry.monitorDashboard.itemsTestedCount",{tested:x.tested_items,total:x.total_items})}),R&&t.jsx("span",{className:"text-xs text-muted-foreground",children:R}),P&&x.current_item_id&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate max-w-64",children:[r("registry.monitorDashboard.qaOnLabel")," ",t.jsx("span",{className:"font-mono",children:x.current_item_id})]})]}),t.jsx("div",{className:"h-2.5 rounded-full bg-muted overflow-hidden",children:t.jsx("div",{className:te("h-full transition-all duration-500",x.failed_items>0?"bg-warning":"bg-success",P?"animate-pulse":""),style:{width:`${Ki(x)}%`}})}),t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:[t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-success",children:r("registry.monitorDashboard.passedLabel")}),t.jsx("p",{className:"text-lg font-bold text-success",children:x.passed_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-destructive",children:r("registry.monitorDashboard.failedLabel")}),t.jsx("p",{className:"text-lg font-bold text-destructive",children:x.failed_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:r("registry.monitorDashboard.skippedLabel")}),t.jsx("p",{className:"text-lg font-bold",children:x.skipped_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:r("registry.monitorDashboard.totalLabel")}),t.jsx("p",{className:"text-lg font-bold",children:x.total_items})]})]})]}):t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.monitorDashboard.noRunSelectedMessage")})]}),t.jsxs(me,{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.jsx("h3",{className:"text-sm font-semibold",children:r("registry.monitorDashboard.qaResultsLogTitle",{count:k.length})}),t.jsx("p",{className:"text-[11px] text-muted-foreground",children:r("registry.monitorDashboard.qaResultsLogDescription")})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[P&&t.jsx(V,{className:"bg-primary/10 text-primary border-primary/20 animate-pulse",children:r("registry.monitorDashboard.runInProgressLabel")}),x&&t.jsx(V,{variant:"outline",className:"text-[10px]",children:r("registry.monitorDashboard.progressBadge",{tested:x.tested_items,total:x.total_items})}),y&&t.jsx(V,{variant:"outline",className:"text-[10px]",children:r("registry.monitorDashboard.modeBadge",{mode:y.replace("_"," ")})})]})]}),k.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:r("registry.monitorDashboard.noResultsYetMessage")}):t.jsx("div",{ref:v=>{v&&P&&v.scrollHeight-v.scrollTop-v.clientHeight<120&&requestAnimationFrame(()=>{v.scrollTop=v.scrollHeight})},className:"space-y-1 max-h-[60vh] overflow-auto pr-1",children:k.map((v,S)=>t.jsx(Vi,{result:v,index:S,icon:A[v.item_id]},v.id))})]})]}),t.jsx(ct,{open:c,onOpenChange:a,children:t.jsxs(lt,{children:[t.jsxs(it,{children:[t.jsx(st,{children:r("registry.monitorDashboard.confirmStartTitle")}),t.jsx(rt,{children:r("registry.monitorDashboard.confirmStartDescription",{runId:w?` (${w.id})`:""})})]}),t.jsxs(at,{children:[t.jsx(nt,{children:r("registry.monitorDashboard.cancelButtonDialog")}),t.jsx(ot,{onClick:()=>{a(!1),b()},children:r("registry.monitorDashboard.startAnywayButton")})]})]})})]})}function Rs(s){switch(s){case"passed":return"bg-success/10 text-success border-success/20";case"failed":case"error":return"bg-destructive/10 text-destructive border-destructive/20";case"needs_auth":return"bg-warning/10 text-warning border-warning/20";case"skipped":return"bg-muted text-muted-foreground border-border";default:return""}}function Yi(s){switch(s){case"passed":return"✓";case"failed":return"✗";case"error":return"⚠";case"needs_auth":return"🔑";case"skipped":return"⏭";default:return"?"}}function Wi(s){const e=Z.c(28),{tool:r}=s,i=ce(),[n,l]=M.useState(!1);let c;e[0]!==n?(c=()=>l(!n),e[0]=n,e[1]=c):c=e[1];const a=r.success?"text-success":"text-destructive";let o;e[2]!==a?(o=te("text-xs font-bold",a),e[2]=a,e[3]=o):o=e[3];const u=r.success?"✓":"✗";let d;e[4]!==o||e[5]!==u?(d=t.jsx("span",{className:o,children:u}),e[4]=o,e[5]=u,e[6]=d):d=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 f;e[9]!==r.durationMs?(f=t.jsxs("span",{className:"text-[10px] text-muted-foreground shrink-0",children:[r.durationMs,"ms"]}),e[9]=r.durationMs,e[10]=f):f=e[10];const p=n?"▲":"▼";let g;e[11]!==p?(g=t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p}),e[11]=p,e[12]=g):g=e[12];let x;e[13]!==c||e[14]!==d||e[15]!==m||e[16]!==f||e[17]!==g?(x=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:c,children:[d,m,f,g]}),e[13]=c,e[14]=d,e[15]=m,e[16]=f,e[17]=g,e[18]=x):x=e[18];let h;e[19]!==n||e[20]!==i||e[21]!==r.error||e[22]!==r.input||e[23]!==r.outputPreview?(h=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-destructive",children:i("registry.monitorRunDetail.error")}),t.jsx("pre",{className:"text-[11px] bg-destructive/5 border border-destructive/10 rounded px-2 py-1.5 whitespace-pre-wrap break-all text-destructive",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:i("registry.monitorRunDetail.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:i("registry.monitorRunDetail.outputPreview")}),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:i("registry.monitorRunDetail.noAdditionalDetails")})]}),e[19]=n,e[20]=i,e[21]=r.error,e[22]=r.input,e[23]=r.outputPreview,e[24]=h):h=e[24];let y;return e[25]!==x||e[26]!==h?(y=t.jsxs("div",{className:"rounded border border-border",children:[x,h]}),e[25]=x,e[26]=h,e[27]=y):y=e[27],y}function Ji(s){const e=Z.c(60),{result:r}=s,i=ce(),[n,l]=M.useState(r.status!=="passed");let c;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||e[11]!==i){const{latestToolResults:a,realToolTests:o,isHealthCheck:u,passedTools:d,failedTools:m,hasToolTests:f}=Ps(r.tool_results);let p;e[13]!==n?(p=()=>l(!n),e[13]=n,e[14]=p):p=e[14];let g;e[15]!==r.status?(g=Yi(r.status),e[15]=r.status,e[16]=g):g=e[16];let x;e[17]!==g?(x=t.jsx("span",{className:"text-base shrink-0",children:g}),e[17]=g,e[18]=x):x=e[18];let h;e[19]!==r.item_title?(h=t.jsx("p",{className:"text-sm font-medium truncate",children:r.item_title}),e[19]=r.item_title,e[20]=h):h=e[20];let y;e[21]!==r.duration_ms?(y=t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[r.duration_ms,"ms"]}),e[21]=r.duration_ms,e[22]=y):y=e[22];let N;e[23]!==i?(N=i("registry.monitorRunDetail.conn"),e[23]=i,e[24]=N):N=e[24];const w=r.connection_ok?"✓":"✗";let _;e[25]!==N||e[26]!==w?(_=t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[N,":"," ",w]}),e[25]=N,e[26]=w,e[27]=_):_=e[27];let b;e[28]!==i?(b=i("registry.monitorRunDetail.toolsListed"),e[28]=i,e[29]=b):b=e[29];const L=r.tools_listed?"✓":"✗";let I;e[30]!==b||e[31]!==L?(I=t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[b,":"," ",L]}),e[30]=b,e[31]=L,e[32]=I):I=e[32];const P=a.length>0&&t.jsx("span",{className:"text-[10px] text-muted-foreground",children:f?t.jsxs(t.Fragment,{children:[i("registry.monitorRunDetail.tools"),": ",d,"✓"," ",m,"✗"]}):t.jsxs(t.Fragment,{children:[a.length," ",i("registry.monitorRunDetail.toolsFound")]})});let R;e[33]!==r.action_taken||e[34]!==i?(R=r.action_taken!=="none"&&t.jsxs(V,{variant:"destructive",className:"text-[9px] px-1.5 py-0",children:[i("registry.monitorRunDetail.action"),": ",r.action_taken]}),e[33]=r.action_taken,e[34]=i,e[35]=R):R=e[35];let k;e[36]!==I||e[37]!==P||e[38]!==R||e[39]!==y||e[40]!==_?(k=t.jsxs("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[y,_,I,P,R]}),e[36]=I,e[37]=P,e[38]=R,e[39]=y,e[40]=_,e[41]=k):k=e[41];let A;e[42]!==k||e[43]!==h?(A=t.jsxs("div",{className:"min-w-0 flex-1",children:[h,k]}),e[42]=k,e[43]=h,e[44]=A):A=e[44];let q;e[45]!==r.status?(q=te("capitalize shrink-0",Rs(r.status)),e[45]=r.status,e[46]=q):q=e[46];let v;e[47]!==r.status?(v=r.status.replace("_"," "),e[47]=r.status,e[48]=v):v=e[48];let S;e[49]!==q||e[50]!==v?(S=t.jsx(V,{className:q,children:v}),e[49]=q,e[50]=v,e[51]=S):S=e[51];const D=n?"▲":"▼";let F;e[52]!==D?(F=t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:D}),e[52]=D,e[53]=F):F=e[53];let T;e[54]!==A||e[55]!==S||e[56]!==p||e[57]!==F||e[58]!==x?(T=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:p,children:[x,A,S,F]}),e[54]=A,e[55]=S,e[56]=p,e[57]=F,e[58]=x,e[59]=T):T=e[59],c=t.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[T,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:i("registry.monitorRunDetail.connection")}),t.jsx("p",{className:te("text-xs font-medium",r.connection_ok?"text-success":"text-destructive"),children:r.connection_ok?i("registry.monitorRunDetail.connected"):i("registry.monitorRunDetail.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:i("registry.monitorRunDetail.toolsListedLabel")}),t.jsx("p",{className:te("text-xs font-medium",r.tools_listed?"text-success":"text-destructive"),children:r.tools_listed?i("registry.monitorRunDetail.yesWithCount",{count:a.length}):i("registry.monitorRunDetail.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:i("registry.monitorRunDetail.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:i("registry.monitorRunDetail.actionTaken")}),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-destructive",children:i("registry.monitorRunDetail.errorMessage")}),t.jsx("pre",{className:"text-xs bg-destructive/5 border border-destructive/10 rounded px-3 py-2 whitespace-pre-wrap break-all text-destructive",children:r.error_message})]}),f?t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.monitorRunDetail.toolResults",{passed:d,failed:m})}),t.jsx("div",{className:"space-y-1",children:o.map((U,E)=>t.jsx(Wi,{tool:U},`${r.id}-${U.toolName}-${E}`))})]}):u&&a.length>0?t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.monitorRunDetail.toolsDiscovered",{count:a.length})}),t.jsx("div",{className:"flex flex-wrap gap-1",children:a.map((U,E)=>t.jsx(V,{variant:"outline",className:"text-[10px] font-mono",children:U.toolName},`${r.id}-${U.toolName}-${E}`))})]}):null,r.agent_summary&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-[10px] font-semibold text-muted-foreground",children:i("registry.monitorRunDetail.agentSummary")}),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,e[12]=c}else c=e[12];return c}function Zi(s){const e=Z.c(4),{value:r,onChange:i}=s,n=ce();let l;if(e[0]!==i||e[1]!==n||e[2]!==r){const c=[{value:"all",labelKey:"registry.monitorRunDetail.filterAll"},{value:"passed",labelKey:"registry.monitorRunDetail.filterPassed"},{value:"failed",labelKey:"registry.monitorRunDetail.filterFailed"},{value:"error",labelKey:"registry.monitorRunDetail.filterError"},{value:"needs_auth",labelKey:"registry.monitorRunDetail.filterNeedsAuth"},{value:"skipped",labelKey:"registry.monitorRunDetail.filterSkipped"}];l=t.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:c.map(a=>t.jsx("button",{type:"button",className:te("text-[11px] px-2 py-0.5 rounded-full border transition-colors",r===a.value?"bg-primary text-primary-foreground border-primary":"bg-muted/30 border-border hover:bg-muted/50"),onClick:()=>i(a.value),children:n(a.labelKey)},a.value))}),e[0]=i,e[1]=n,e[2]=r,e[3]=l}else l=e[3];return l}function Xi(s){const e=Z.c(81),{runId:r}=s,i=ce(),[n,l]=M.useState("all"),c=zt(r),a=c.data?.run,o=ut(r,void 0,a?.status);let u,d,m,f,p,g,x,h,y,N,w,_,b;if(e[0]!==o||e[1]!==a||e[2]!==r||e[3]!==c||e[4]!==n||e[5]!==i){p=Symbol.for("react.early_return_sentinel");e:{if(u=o.data?.items??[],d=n==="all"?u:u.filter(j=>j.status===n),!r){let j;e[19]!==i?(j=i("registry.monitorRunDetail.selectRunToInspect"),e[19]=i,e[20]=j):j=e[20];let $;e[21]!==j?($=t.jsx(me,{className:"p-6 text-center space-y-2",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:j})}),e[21]=j,e[22]=$):$=e[22],p=$;break e}w="space-y-3";let q;e[23]!==i?(q=i("registry.monitorRunDetail.runDetail"),e[23]=i,e[24]=q):q=e[24];let v;e[25]!==q?(v=t.jsx("h3",{className:"text-sm font-semibold",children:q}),e[25]=q,e[26]=v):v=e[26];let S;e[27]!==r?(S=t.jsx("p",{className:"text-[10px] text-muted-foreground font-mono",children:r}),e[27]=r,e[28]=S):S=e[28];let D;e[29]!==v||e[30]!==S?(D=t.jsxs("div",{children:[v,S]}),e[29]=v,e[30]=S,e[31]=D):D=e[31];let F;e[32]!==a?(F=a&&t.jsx(V,{className:te("capitalize",Rs(a.status)),children:a.status}),e[32]=a,e[33]=F):F=e[33];let T;e[34]!==o||e[35]!==c?(T=()=>{c.refetch(),o.refetch()},e[34]=o,e[35]=c,e[36]=T):T=e[36];let U;e[37]!==i?(U=i("registry.monitorRunDetail.refresh"),e[37]=i,e[38]=U):U=e[38];let E;e[39]!==T||e[40]!==U?(E=t.jsx(Y,{size:"sm",variant:"outline",onClick:T,children:U}),e[39]=T,e[40]=U,e[41]=E):E=e[41];let O;e[42]!==F||e[43]!==E?(O=t.jsxs("div",{className:"flex items-center gap-2",children:[F,E]}),e[42]=F,e[43]=E,e[44]=O):O=e[44],e[45]!==D||e[46]!==O?(_=t.jsx(me,{className:"p-4",children:t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[D,O]})}),e[45]=D,e[46]=O,e[47]=_):_=e[47],e[48]!==a||e[49]!==i?(b=a&&t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 text-xs",children:[t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.total")}),t.jsx("p",{className:"text-lg font-bold",children:a.total_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.tested")}),t.jsx("p",{className:"text-lg font-bold",children:a.tested_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-success",children:i("registry.monitorRunDetail.passed")}),t.jsx("p",{className:"text-lg font-bold text-success",children:a.passed_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-destructive",children:i("registry.monitorRunDetail.failed")}),t.jsx("p",{className:"text-lg font-bold text-destructive",children:a.failed_items})]}),t.jsxs(me,{className:"p-2.5 space-y-0.5",children:[t.jsx("p",{className:"text-[10px] text-muted-foreground",children:i("registry.monitorRunDetail.skipped")}),t.jsx("p",{className:"text-lg font-bold",children:a.skipped_items})]})]}),e[48]=a,e[49]=i,e[50]=b):b=e[50],e[51]!==a||e[52]!==i?(f=a&&(a.started_at||a.finished_at)&&t.jsxs(me,{className:"p-3 flex items-center gap-4 text-xs text-muted-foreground flex-wrap",children:[a.started_at&&t.jsxs("span",{children:[i("registry.monitorRunDetail.started"),":"," ",new Date(a.started_at).toLocaleString()]}),a.finished_at&&t.jsxs("span",{children:[i("registry.monitorRunDetail.finished"),":"," ",new Date(a.finished_at).toLocaleString()]}),a.started_at&&a.finished_at&&t.jsxs("span",{className:"font-medium text-foreground",children:[i("registry.monitorRunDetail.durationLabel"),":"," ",((new Date(a.finished_at).getTime()-new Date(a.started_at).getTime())/1e3).toFixed(1),"s"]})]}),e[51]=a,e[52]=i,e[53]=f):f=e[53],y="flex items-center justify-between gap-2",e[54]!==n?(N=t.jsx(Zi,{value:n,onChange:l}),e[54]=n,e[55]=N):N=e[55],m="text-xs text-muted-foreground",g=d.length,x=" ",h=i("registry.monitorRunDetail.result",{count:d.length})}e[0]=o,e[1]=a,e[2]=r,e[3]=c,e[4]=n,e[5]=i,e[6]=u,e[7]=d,e[8]=m,e[9]=f,e[10]=p,e[11]=g,e[12]=x,e[13]=h,e[14]=y,e[15]=N,e[16]=w,e[17]=_,e[18]=b}else u=e[6],d=e[7],m=e[8],f=e[9],p=e[10],g=e[11],x=e[12],h=e[13],y=e[14],N=e[15],w=e[16],_=e[17],b=e[18];if(p!==Symbol.for("react.early_return_sentinel"))return p;let L;e[56]!==m||e[57]!==g||e[58]!==x||e[59]!==h?(L=t.jsxs("span",{className:m,children:[g,x,h]}),e[56]=m,e[57]=g,e[58]=x,e[59]=h,e[60]=L):L=e[60];let I;e[61]!==L||e[62]!==y||e[63]!==N?(I=t.jsxs("div",{className:y,children:[N,L]}),e[61]=L,e[62]=y,e[63]=N,e[64]=I):I=e[64];let P;e[65]!==u||e[66]!==d.length||e[67]!==i?(P=d.length===0&&t.jsx(me,{className:"p-4 text-sm text-muted-foreground text-center",children:u.length===0?i("registry.monitorRunDetail.noTestResultsYet"):i("registry.monitorRunDetail.noResultsMatchFilter")}),e[65]=u,e[66]=d.length,e[67]=i,e[68]=P):P=e[68];let R;e[69]!==d?(R=d.map(en),e[69]=d,e[70]=R):R=e[70];let k;e[71]!==P||e[72]!==R?(k=t.jsxs("div",{className:"space-y-2",children:[P,R]}),e[71]=P,e[72]=R,e[73]=k):k=e[73];let A;return e[74]!==f||e[75]!==I||e[76]!==k||e[77]!==w||e[78]!==_||e[79]!==b?(A=t.jsxs("div",{className:w,children:[_,b,f,I,k]}),e[74]=f,e[75]=I,e[76]=k,e[77]=w,e[78]=_,e[79]=b,e[80]=A):A=e[80],A}function en(s){return t.jsx(Ji,{result:s},s.id)}function tn(s){return s.tested_items?`${Math.round(s.passed_items/s.tested_items*100)}%`:"-"}function sn(s){const e=Z.c(20),{selectedRunId:r,onSelectRun:i}=s,n=Pt();let l;e[0]!==n.data?.items?(l=n.data?.items??[],e[0]=n.data?.items,e[1]=l):l=e[1];const c=l;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=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]=a):a=e[2];let o;e[3]!==n?(o=t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a,t.jsx(Y,{size:"sm",variant:"outline",onClick:()=>n.refetch(),children:"Refresh"})]}),e[3]=n,e[4]=o):o=e[4];let u;e[5]!==c.length?(u=c.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]=c.length,e[6]=u):u=e[6];let d;if(e[7]!==i||e[8]!==c||e[9]!==r){let p;e[11]!==i||e[12]!==r?(p=g=>{const x=_s(g.started_at,g.finished_at),h=tn(g),y=r===g.id;return t.jsxs("button",{type:"button",onClick:()=>i(g.id),className:te("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(g.created_at).toLocaleString()})}),t.jsx(V,{className:te("capitalize",ws(g.status)),children:g.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:[g.tested_items,"/",g.total_items," tested"]}),t.jsxs("span",{className:"text-success font-medium",children:[g.passed_items," passed"]}),g.failed_items>0&&t.jsxs("span",{className:"text-destructive font-medium",children:[g.failed_items," failed"]}),g.skipped_items>0&&t.jsxs("span",{className:"text-muted-foreground",children:[g.skipped_items," skipped"]}),t.jsxs("span",{className:"text-muted-foreground",children:["pass rate: ",h]}),x&&t.jsx("span",{className:"text-muted-foreground",children:x})]}),g.config_snapshot&&t.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[t.jsx(V,{variant:"outline",className:"text-[9px]",children:(g.config_snapshot.monitorMode??g.config_snapshot.testMode??"health_check").replace("_"," ")}),g.config_snapshot.onFailure!=="none"&&t.jsxs(V,{variant:"outline",className:"text-[9px] text-destructive",children:["on fail:"," ",g.config_snapshot.onFailure.replace(/_/g," ")]})]})]},g.id)},e[11]=i,e[12]=r,e[13]=p):p=e[13],d=c.map(p),e[7]=i,e[8]=c,e[9]=r,e[10]=d}else d=e[10];let m;e[14]!==u||e[15]!==d?(m=t.jsxs("div",{className:"space-y-2 max-h-[520px] overflow-auto",children:[u,d]}),e[14]=u,e[15]=d,e[16]=m):m=e[16];let f;return e[17]!==o||e[18]!==m?(f=t.jsx(me,{className:"p-4",children:t.jsxs("div",{className:"space-y-3",children:[o,m]})}),e[17]=o,e[18]=m,e[19]=f):f=e[19],f}function rn(){const s=Z.c(21),e=ce(),[r,i]=M.useState(void 0),[n,l]=M.useState("tests"),a=zt(r).data?.run?.status,o=ut(r,void 0,a);let u;s[0]!==o.data?.items?(u=o.data?.items??[],s[0]=o.data?.items,s[1]=u):u=s[1];let d;s[2]!==u?(d=u.filter(nn),s[2]=u,s[3]=d):d=s[3];const m=d;let f;s[4]!==n||s[5]!==e?(f=t.jsx("nav",{className:"flex items-center gap-2 overflow-x-auto no-scrollbar",children:[{id:"tests",labelKey:"registry.registryMonitorPage.tabTests"},{id:"configuration",labelKey:"registry.registryMonitorPage.tabConfiguration"},{id:"connections",labelKey:"registry.registryMonitorPage.tabConnections"}].map(y=>{const N=n===y.id;return t.jsx("button",{type:"button",className:te("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:()=>l(y.id),children:t.jsx("span",{children:e(y.labelKey)})},y.id)})}),s[4]=n,s[5]=e,s[6]=f):f=s[6];let p;s[7]!==r||s[8]!==n||s[9]!==m||s[10]!==e?(p=n==="tests"&&t.jsxs("div",{className:"space-y-6",children:[t.jsx(Qi,{activeRunId:r,onRunChange:i}),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:[r&&t.jsx(Xi,{runId:r}),t.jsx(sn,{selectedRunId:r,onSelectRun:i})]}),t.jsxs("div",{className:"xl:col-span-4 space-y-2 min-w-0",children:[t.jsxs("h3",{className:"text-sm font-semibold",children:[e("registry.registryMonitorPage.brokenMcps")," ",m.length>0&&t.jsx(V,{variant:"destructive",className:"text-[10px] ml-1",children:m.length})]}),t.jsx(Ii,{results:m})]})]})]}),s[7]=r,s[8]=n,s[9]=m,s[10]=e,s[11]=p):p=s[11];let g;s[12]!==n?(g=n==="configuration"&&t.jsx(Ei,{}),s[12]=n,s[13]=g):g=s[13];let x;s[14]!==n?(x=n==="connections"&&t.jsx($i,{}),s[14]=n,s[15]=x):x=s[15];let h;return s[16]!==f||s[17]!==p||s[18]!==g||s[19]!==x?(h=t.jsxs("div",{className:"h-full overflow-auto px-4 md:px-6 py-4 space-y-6",children:[f,p,g,x]}),s[16]=f,s[17]=p,s[18]=g,s[19]=x,s[20]=h):h=s[20],h}function nn(s){return s.status==="failed"||s.status==="error"}function on(s){const e=Z.c(9),{activeTab:r,onChange:i,items:n}=s;let l;if(e[0]!==r||e[1]!==n||e[2]!==i){let a;e[4]!==r||e[5]!==i?(a=o=>{const u=r===o.tab,d=o.icon;return t.jsxs("button",{type:"button",className:te("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:()=>i(o.tab),children:[t.jsx(d,{size:14}),t.jsx("span",{children:o.label}),typeof o.count=="number"&&o.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:o.count})]},o.id)},e[4]=r,e[5]=i,e[6]=a):a=e[6],l=n.map(a),e[0]=r,e[1]=n,e[2]=i,e[3]=l}else l=e[3];let c;return e[7]!==l?(c=t.jsx("nav",{className:"flex items-center gap-2 overflow-x-auto no-scrollbar",children:l}),e[7]=l,e[8]=c):c=e[8],c}function eo(s){const e=Z.c(59),{onBack:r}=s,i=ce(),[n,l]=M.useState("items"),[c,a]=M.useState(null),{registryName:o,registryIcon:u,acceptPublishRequests:d}=vs(Ve),m=zr(),f=Mr();!d&&n==="requests"&&l("items");const p=m.data?.pending??0;let g;e[0]!==i?(g=i("registry.registryLayout.itemsTab"),e[0]=i,e[1]=g):g=e[1];const x=f.brokenCount>0?f.brokenCount:void 0;let h;e[2]!==g||e[3]!==x?(h={id:"items",label:g,icon:Qs,tab:"items",count:x},e[2]=g,e[3]=x,e[4]=h):h=e[4];let y;e[5]!==d||e[6]!==p||e[7]!==i?(y=d?[{id:"requests",label:i("registry.registryLayout.requestsTab"),icon:We,tab:"requests",count:p}]:[],e[5]=d,e[6]=p,e[7]=i,e[8]=y):y=e[8];let N;e[9]!==i?(N=i("registry.registryLayout.qaTab"),e[9]=i,e[10]=N):N=e[10];let w;e[11]!==N?(w={id:"qa",label:N,icon:ms,tab:"qa"},e[11]=N,e[12]=w):w=e[12];let _;e[13]!==i?(_=i("registry.registryLayout.settingsTab"),e[13]=i,e[14]=_):_=e[14];let b;e[15]!==_?(b={id:"settings",label:_,icon:Xs,tab:"settings"},e[15]=_,e[16]=b):b=e[16];let L;e[17]!==h||e[18]!==y||e[19]!==w||e[20]!==b?(L=[h,...y,w,b],e[17]=h,e[18]=y,e[19]=w,e[20]=b,e[21]=L):L=e[21];const I=L;let P;e[22]!==r?(P=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(Ys,{size:16})}),e[22]=r,e[23]=P):P=e[23];let R;e[24]===Symbol.for("react.memo_cache_sentinel")?(R=()=>l("settings"),e[24]=R):R=e[24];let k;e[25]!==u||e[26]!==o?(k=t.jsx("div",{className:"size-7 rounded-lg border border-border overflow-hidden bg-muted/20 flex items-center justify-center shrink-0",children:u?t.jsx("img",{src:u,alt:o,className:"h-full w-full object-cover"}):t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:o.slice(0,1).toUpperCase()})}),e[25]=u,e[26]=o,e[27]=k):k=e[27];let A;e[28]!==o?(A=t.jsx("span",{className:"text-sm font-medium truncate max-w-[220px]",children:o}),e[28]=o,e[29]=A):A=e[29];let q;e[30]!==k||e[31]!==A?(q=t.jsxs("button",{type:"button",className:"min-w-0 flex items-center gap-2 hover:opacity-90 transition-opacity cursor-pointer",onClick:R,children:[k,A]}),e[30]=k,e[31]=A,e[32]=q):q=e[32];let v;e[33]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"h-6 w-px bg-border shrink-0"}),e[33]=v):v=e[33];let S;e[34]!==n||e[35]!==I?(S=t.jsx(on,{activeTab:n,onChange:l,items:I}),e[34]=n,e[35]=I,e[36]=S):S=e[36];let D;e[37]!==P||e[38]!==q||e[39]!==S?(D=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:[P,q,v,S]})}),e[37]=P,e[38]=q,e[39]=S,e[40]=D):D=e[40];let F;e[41]!==n?(F=n==="items"&&t.jsx(wi,{}),e[41]=n,e[42]=F):F=e[42];let T;e[43]!==d||e[44]!==n?(T=n==="requests"&&d&&t.jsx(Pi,{}),e[43]=d,e[44]=n,e[45]=T):T=e[45];let U;e[46]!==n?(U=n==="qa"&&t.jsx(rn,{}),e[46]=n,e[47]=U):U=e[47];let E;e[48]!==n||e[49]!==c?(E=n==="settings"&&t.jsx(Ri,{revealedKey:c,onRevealedKeyChange:a}),e[48]=n,e[49]=c,e[50]=E):E=e[50];let O;e[51]!==F||e[52]!==T||e[53]!==U||e[54]!==E?(O=t.jsxs("main",{className:"flex-1 min-w-0 overflow-hidden",children:[F,T,U,E]}),e[51]=F,e[52]=T,e[53]=U,e[54]=E,e[55]=O):O=e[55];let j;return e[56]!==D||e[57]!==O?(j=t.jsxs("div",{className:"h-full flex flex-col bg-background overflow-hidden",children:[D,O]}),e[56]=D,e[57]=O,e[58]=j):j=e[58],j}export{eo as default};