decocms 4.198.0 → 4.198.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/dist/client/assets/{AlertCircle-C8SY5iRK.js → AlertCircle-BWppLd8c.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BykRw1vR.js → AreaChart-CMqdqW-X.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DUpOl6Js.js → ArrowLeft-cFWJcCye.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-DZGjkGkh.js → ArrowUp-CK7po7JD.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-BdcALqtV.js → ArrowUpRight-7JgIYGFf.js} +1 -1
  6. package/dist/client/assets/{Check-C_ZW4dMG.js → Check-Dc66au0h.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-CJr8ykHV.js → CheckCircle-UOyFv4rE.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-YGt15NDz.js → ChevronDown-LNz16DWG.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-Ti1DNRwg.js → ChevronRight-DjBVHQoY.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-BMKTxhtV.js → ChevronUp-DZ-mKv_H.js} +1 -1
  11. package/dist/client/assets/{Copy01-CfJtVQX8.js → Copy01-DPPY_ooc.js} +1 -1
  12. package/dist/client/assets/{CpuChip01-C6J5o_WD.js → CpuChip01-DyWba75a.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-sm5uN1al.js → CreditCard01-e79FUmFN.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-DwsPX2c8.js → DotsVertical-CILzGe_q.js} +1 -1
  15. package/dist/client/assets/{Eye-D3pFPZtG.js → Eye-BT74JrOy.js} +1 -1
  16. package/dist/client/assets/{FilterLines-Dw8azjNW.js → FilterLines-DcRWfBwT.js} +1 -1
  17. package/dist/client/assets/{Globe01-gmiwWV2R.js → Globe01-W4lyjKuH.js} +1 -1
  18. package/dist/client/assets/{Globe04-aKKjTpe3.js → Globe04-_uS8YiyQ.js} +1 -1
  19. package/dist/client/assets/{HardDrive-KXYb8oGz.js → HardDrive-D7RLSuvq.js} +1 -1
  20. package/dist/client/assets/{Key01-OAo9mPW5.js → Key01-Bk2QhvNY.js} +1 -1
  21. package/dist/client/assets/{LayoutLeft-L0QKFsvj.js → LayoutLeft-P7wDvRlA.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-5zhWp-5h.js → LinkExternal01-CP1N0ekO.js} +1 -1
  23. package/dist/client/assets/{LogOut01--xowgLO0.js → LogOut01-BNm98lqM.js} +1 -1
  24. package/dist/client/assets/{Monitor01-hnS39xvO.js → Monitor01-D9pvMYQd.js} +1 -1
  25. package/dist/client/assets/{Palette-Bx9aEMJ1.js → Palette-DJfFKmjP.js} +1 -1
  26. package/dist/client/assets/{Play-B32e2Xb_.js → Play-DrC9uZbx.js} +1 -1
  27. package/dist/client/assets/{Plus-BDl2qzjU.js → Plus-9KDBMlCX.js} +1 -1
  28. package/dist/client/assets/{SearchLg-Ckqq0cHp.js → SearchLg-BSg_Ve-L.js} +1 -1
  29. package/dist/client/assets/{SearchMd-BLcdKvuz.js → SearchMd-CDwUuDyr.js} +1 -1
  30. package/dist/client/assets/{Settings02-C7ZM_51J.js → Settings02-D_by58BO.js} +1 -1
  31. package/dist/client/assets/{Share07-Cdl4nAT0.js → Share07-DFtUk4DH.js} +1 -1
  32. package/dist/client/assets/{Shield01-wATI85Ji.js → Shield01-2VpHyEx6.js} +1 -1
  33. package/dist/client/assets/{Star01-BiRYulu5.js → Star01-YV_bqOAU.js} +1 -1
  34. package/dist/client/assets/{Stars01-8kaUVt1Q.js → Stars01-CyMHMvzU.js} +1 -1
  35. package/dist/client/assets/{Stars02-CdSdmgrJ.js → Stars02-D6uxt7rn.js} +1 -1
  36. package/dist/client/assets/{Sun-DD5QWbOS.js → Sun-CvD6V1mt.js} +1 -1
  37. package/dist/client/assets/{SwitchHorizontal01-ICtOJ5QG.js → SwitchHorizontal01-BJcUWOrf.js} +1 -1
  38. package/dist/client/assets/{Tool01-poJm20KG.js → Tool01-BsXkza2k.js} +1 -1
  39. package/dist/client/assets/{Tool02-CgKntXm0.js → Tool02-Bk0Wi_jc.js} +1 -1
  40. package/dist/client/assets/{Trash01-Dmkz9YvS.js → Trash01-Dk2U_er_.js} +1 -1
  41. package/dist/client/assets/{TrendUp01-C1XYgKML.js → TrendUp01-BQPOQTfU.js} +1 -1
  42. package/dist/client/assets/{Upload01-D0nuuz04.js → Upload01-De1aQPW9.js} +1 -1
  43. package/dist/client/assets/{User01-CGG-DKuM.js → User01-DZLXXgFt.js} +1 -1
  44. package/dist/client/assets/{Users01-D9w3T_dV.js → Users01-D-f87RLp.js} +1 -1
  45. package/dist/client/assets/{Users03-DthhgefL.js → Users03-CmtC3U6j.js} +1 -1
  46. package/dist/client/assets/{X-BZGIgNvY.js → X-DmV-M3--.js} +1 -1
  47. package/dist/client/assets/{XCircle-BOAiv6Zc.js → XCircle-Cj1jhbDm.js} +1 -1
  48. package/dist/client/assets/{XClose-C_7R4-TY.js → XClose-8V-NoWeD.js} +1 -1
  49. package/dist/client/assets/{Zap-Bp29Ikr4.js → Zap-BxOODR1h.js} +1 -1
  50. package/dist/client/assets/{ZapSquare-ycQJc7bI.js → ZapSquare-BesqE3Kv.js} +1 -1
  51. package/dist/client/assets/{access-gate-CdRPCReq.js → access-gate-CcFlUK4A.js} +1 -1
  52. package/dist/client/assets/{agent-icon-LPvK1059.js → agent-icon-DrJqDdNd.js} +1 -1
  53. package/dist/client/assets/{agents-list-CDPMCErh.js → agents-list-B1lrsW_H.js} +1 -1
  54. package/dist/client/assets/{ai-providers-BeJAwnxA.js → ai-providers-Kv5WIAV1.js} +1 -1
  55. package/dist/client/assets/{alert-DgRfAuC5.js → alert-C4a51Bkg.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-DrQn8XjO.js → alert-dialog-Bpd-0p4I.js} +1 -1
  57. package/dist/client/assets/{app-editor-BE_yNkVZ.js → app-editor-wt5YFcqv.js} +1 -1
  58. package/dist/client/assets/{auth-DDiuYHCk.js → auth-B56MWIKT.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-DGMLdtc_.js → auth-catchall-B_zCiAnJ.js} +1 -1
  60. package/dist/client/assets/{auth-entry-CSEQWvot.js → auth-entry-BcKY1S7E.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-DM_qc_Ek.js → auth-split-layout-D_earcwe.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-BH2wumYo.js → authenticate-and-persist-oauth-DgNMLRjT.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-WtSrToJ4.js → automation-list-row-CF0CYhrz.js} +1 -1
  64. package/dist/client/assets/{automation-runs-D5KxWL-0.js → automation-runs-DkpIo76-.js} +1 -1
  65. package/dist/client/assets/{automations-DLVxippr.js → automations-DFe_tV_r.js} +1 -1
  66. package/dist/client/assets/{avatar-BsURgP8Z.js → avatar-BN3TMI7O.js} +1 -1
  67. package/dist/client/assets/{badge-CGqdv3pi.js → badge-CXZR0JJ6.js} +1 -1
  68. package/dist/client/assets/{billing-DxR0c_P7.js → billing-CYgiUsj0.js} +1 -1
  69. package/dist/client/assets/{block-document-DcqEkLJr.js → block-document-DTEuQoSM.js} +1 -1
  70. package/dist/client/assets/{brand-context-DZx3ob7g.js → brand-context-1EzU2len.js} +1 -1
  71. package/dist/client/assets/{buckets-Don0qB35.js → buckets-BFKqGOhH.js} +1 -1
  72. package/dist/client/assets/{bulk-category-panel-k9ICfNOp.js → bulk-category-panel-CsOSjWnO.js} +1 -1
  73. package/dist/client/assets/{capability-load-error-UWmmGCEf.js → capability-load-error-CKW0147S.js} +1 -1
  74. package/dist/client/assets/{card-ClcwuDin.js → card-B-Mzv0lS.js} +1 -1
  75. package/dist/client/assets/{cards-CUx5NsvF.js → cards-BfTjTHpY.js} +1 -1
  76. package/dist/client/assets/{category-editor-DQQFG64v.js → category-editor-BbGetzYN.js} +1 -1
  77. package/dist/client/assets/{chat-context-CrZFK-7i.js → chat-context-B91LcyJ6.js} +1 -1
  78. package/dist/client/assets/{checkbox-DBG4u_fO.js → checkbox-DU-r9RK1.js} +1 -1
  79. package/dist/client/assets/{cli-auth-success-CRduEaZF.js → cli-auth-success-Cm6QoDUK.js} +1 -1
  80. package/dist/client/assets/{collection-detail-D5QTNVav.js → collection-detail-tAe3Dmgp.js} +1 -1
  81. package/dist/client/assets/{collection-display-button-LH8fvP3X.js → collection-display-button-BLCZ2vkr.js} +1 -1
  82. package/dist/client/assets/{collection-search-BInF7Ytk.js → collection-search-yhxjYY4J.js} +1 -1
  83. package/dist/client/assets/{collection-table-wrapper-BtxQ_2T0.js → collection-table-wrapper-B10YZ9u0.js} +1 -1
  84. package/dist/client/assets/{collection-tabs-BVJ6vBjZ.js → collection-tabs-SNVmmaXX.js} +1 -1
  85. package/dist/client/assets/{command-_pFnaP7B.js → command-Cz9Vx3RB.js} +1 -1
  86. package/dist/client/assets/{commerce-onboarding-2OQc2aUH.js → commerce-onboarding-CcIJiyl8.js} +1 -1
  87. package/dist/client/assets/{connect-CI-FFPbt.js → connect-BfBt9RNI.js} +1 -1
  88. package/dist/client/assets/{connection-jrhzHrwR.js → connection-BUKTSmLs.js} +1 -1
  89. package/dist/client/assets/{connection-card-CTXYU6NY.js → connection-card-m4tgOItf.js} +1 -1
  90. package/dist/client/assets/{connection-detail-C8foHE7j.js → connection-detail-BkPBxKFf.js} +1 -1
  91. package/dist/client/assets/{connection-form-helpers-p5xXKunb.js → connection-form-helpers-BkrR5b_e.js} +1 -1
  92. package/dist/client/assets/{connections-_8-kndEu.js → connections-Elpblskc.js} +1 -1
  93. package/dist/client/assets/{decopilot-sse-pool-C47eaXg_.js → decopilot-sse-pool-DjQPpjDZ.js} +1 -1
  94. package/dist/client/assets/{dialog-C1pWvbSS.js → dialog-Cg0277WK.js} +1 -1
  95. package/dist/client/assets/{domain-settings-p3m-ogGU.js → domain-settings-BraWpz77.js} +1 -1
  96. package/dist/client/assets/{drawer-DSq15Wq8.js → drawer-Dfn3cqSh.js} +1 -1
  97. package/dist/client/assets/{dropdown-menu-DwsBHhdy.js → dropdown-menu-DPde1UkW.js} +1 -1
  98. package/dist/client/assets/{empty-state-CHvnW8r-.js → empty-state-BvR4kC3B.js} +1 -1
  99. package/dist/client/assets/{extract-connection-data-C9RG4h96.js → extract-connection-data-BudtEuf9.js} +1 -1
  100. package/dist/client/assets/{file-explorer-Bgh8S5n4.js → file-explorer-CEqyHkOE.js} +1 -1
  101. package/dist/client/assets/{file-type-icon-DP_7rt6E.js → file-type-icon-DjpfQdvY.js} +1 -1
  102. package/dist/client/assets/{form-DalEUP2m.js → form-PWBx8QQq.js} +1 -1
  103. package/dist/client/assets/{general-BWbyxFD4.js → general-aWH4SlEd.js} +1 -1
  104. package/dist/client/assets/{github-repo-picker-BI2NCSqn.js → github-repo-picker-x1X872QG.js} +1 -1
  105. package/dist/client/assets/{hooks-DR_lYoD7.js → hooks-DE78iZyB.js} +1 -1
  106. package/dist/client/assets/{index-CNLGJHNt.js → index-BQFOspRh.js} +3 -3
  107. package/dist/client/assets/{index-CQ2RadJN.js → index-BZrHlw0j.js} +1 -1
  108. package/dist/client/assets/{index-fjYYky3S.js → index-BfE9EYhg.js} +36 -36
  109. package/dist/client/assets/{index-KRubq2AR.js → index-BfpQCjmG.js} +1 -1
  110. package/dist/client/assets/{index-Cf3DzhTt.js → index-BqKCSZFF.js} +1 -1
  111. package/dist/client/assets/{index-Bm7FRioN.js → index-Dh6yRBua.js} +1 -1
  112. package/dist/client/assets/{index-DwDkC-Nl.js → index-GlvqvXVJ.js} +1 -1
  113. package/dist/client/assets/{index-BX-jkCjI.js → index-SRgwcnf7.js} +1 -1
  114. package/dist/client/assets/{index-o9v9gPbF.js → index-X6wqL5Rn.js} +1 -1
  115. package/dist/client/assets/{index-_2Geeoov.js → index-YHwob8Sm.js} +1 -1
  116. package/dist/client/assets/{index-redirect-DCUQv88i.js → index-redirect-BdzOsvXL.js} +1 -1
  117. package/dist/client/assets/{input-CnORcq3w.js → input-DLmq-Bri.js} +1 -1
  118. package/dist/client/assets/{integration-icon-Cv1PlDhh.js → integration-icon-FPSluFwK.js} +1 -1
  119. package/dist/client/assets/{invite-member-dialog-Bk4TB_oD.js → invite-member-dialog-BjF0_uLE.js} +1 -1
  120. package/dist/client/assets/{label-BgE1QCwJ.js → label-B1DonsU-.js} +1 -1
  121. package/dist/client/assets/{layout-BTKrMhu_.js → layout-BV0PSd_m.js} +1 -1
  122. package/dist/client/assets/{login-C235-ne2.js → login-BnLip_s5.js} +1 -1
  123. package/dist/client/assets/{mcp-oauth-Cki4VKX_.js → mcp-oauth-0Wpz4XYZ.js} +1 -1
  124. package/dist/client/assets/{members-RQST5rLo.js → members-CdtAdhlo.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-BTa8pVGH.js → monaco-editor-CrpwfOtU.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-xSIY1MZZ.js → monitoring-stats-row-Bf4ASMnO.js} +1 -1
  127. package/dist/client/assets/{multi-select-CCUHIRrV.js → multi-select-DegmZzJM.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-BwG_RDHh.js → oauth-callback-ai-provider-hu1Pvh_J.js} +1 -1
  129. package/dist/client/assets/{oauth-callback-Cena7qJB.js → oauth-callback-iu-wcPts.js} +1 -1
  130. package/dist/client/assets/{onboarding-Dwktxnk7.js → onboarding-DLQPdZwW.js} +1 -1
  131. package/dist/client/assets/{org-layout-BbbhfvYV.js → org-layout-DTN_XooU.js} +1 -1
  132. package/dist/client/assets/{organization-choice-Bdjdkprb.js → organization-choice-D1zMzhki.js} +1 -1
  133. package/dist/client/assets/{orgs-Cy0Msnks.js → orgs-7aGZzQVk.js} +1 -1
  134. package/dist/client/assets/{page-seo-form-C7hpsmSt.js → page-seo-form-M3-RVvpj.js} +1 -1
  135. package/dist/client/assets/{popover-CS616JEv.js → popover-BYTopHKb.js} +1 -1
  136. package/dist/client/assets/{post-editor-eJTncgFW.js → post-editor-z0QRZmIL.js} +1 -1
  137. package/dist/client/assets/{primitives-BxE9KtlN.js → primitives-S2CqucHt.js} +1 -1
  138. package/dist/client/assets/{profile-D3eV9fvK.js → profile-Hutoer3r.js} +1 -1
  139. package/dist/client/assets/{project-app-view-C7G70sCo.js → project-app-view-BVmBtQTJ.js} +1 -1
  140. package/dist/client/assets/record-editor-7pz_uGMj.js +1 -0
  141. package/dist/client/assets/{redirect-editor-Dx1xeXgF.js → redirect-editor-Dd2TDz4G.js} +1 -1
  142. package/dist/client/assets/registry-Cn1toh1T.js +2 -0
  143. package/dist/client/assets/{registry-layout-BWBO0cwu.js → registry-layout-Cm227W9R.js} +4 -4
  144. package/dist/client/assets/{reports-BUuYPpCn.js → reports-ab0wxN51.js} +1 -1
  145. package/dist/client/assets/{require-capability-DRL4tfer.js → require-capability-B3XvoArB.js} +1 -1
  146. package/dist/client/assets/{required-auth-layout-CIb6VVsG.js → required-auth-layout-D4xEI9J8.js} +1 -1
  147. package/dist/client/assets/{reset-password-BVgR8Pua.js → reset-password-BAG9ZsbJ.js} +1 -1
  148. package/dist/client/assets/{roles-wGMOH9-A.js → roles-BKn8lA_3.js} +1 -1
  149. package/dist/client/assets/{search-input-BPma-uS3.js → search-input-C9pC3WrF.js} +1 -1
  150. package/dist/client/assets/{secrets-EKx5w8-4.js → secrets-DVNv8yxX.js} +1 -1
  151. package/dist/client/assets/sections-editor-Cq6s5Oed.js +2 -0
  152. package/dist/client/assets/{select-QT6EhBK9.js → select-BoHatn08.js} +1 -1
  153. package/dist/client/assets/{select-model-CI7PIhFW.js → select-model-CaoH2ToV.js} +1 -1
  154. package/dist/client/assets/{self-tool-result-BVlLkjQc.js → self-tool-result-m7izFHM4.js} +1 -1
  155. package/dist/client/assets/{seo-editor-DKjkVH6n.js → seo-editor-BmA8_Ouc.js} +1 -1
  156. package/dist/client/assets/{settings-layout-geR9gLa0.js → settings-layout-CtQk6Z90.js} +1 -1
  157. package/dist/client/assets/{settings-section-D-EYP4ul.js → settings-section-XmYJ6Nk2.js} +1 -1
  158. package/dist/client/assets/{shell-controls-BkN5yiE5.js → shell-controls-DtrTq4G_.js} +1 -1
  159. package/dist/client/assets/{shell-layout-D6BYDaXT.js → shell-layout-Cd3V9av7.js} +1 -1
  160. package/dist/client/assets/{sidebar-BGib2vQQ.js → sidebar-nvbJrgVY.js} +1 -1
  161. package/dist/client/assets/{skeleton-vNRcNgUE.js → skeleton-DxXAcunF.js} +1 -1
  162. package/dist/client/assets/{spinner-B7MHDe6g.js → spinner-BoBi9JH7.js} +1 -1
  163. package/dist/client/assets/{sso-DVVGDTh8.js → sso-BwhmanKT.js} +1 -1
  164. package/dist/client/assets/{store-DMrV7xfX.js → store-CFuLGHOE.js} +1 -1
  165. package/dist/client/assets/store-registry-ZIu_RLpB.js +2 -0
  166. package/dist/client/assets/{studio-tools-CrdPQqWl.js → studio-tools-BETupmQh.js} +1 -1
  167. package/dist/client/assets/{switch-DFtBlkd_.js → switch-D5nHMM9-.js} +1 -1
  168. package/dist/client/assets/{synced-repos-uaJb0gdv.js → synced-repos-BC7dcdDm.js} +1 -1
  169. package/dist/client/assets/{tab-id-BrPzbiFK.js → tab-id-BdQ_M6R3.js} +1 -1
  170. package/dist/client/assets/{table-DPNST0df.js → table-DHyF1BO5.js} +1 -1
  171. package/dist/client/assets/{tabs-C0OaM7EA.js → tabs-bgoBmYh1.js} +1 -1
  172. package/dist/client/assets/{textarea-C9wG3Z-z.js → textarea-DLfz9L-W.js} +1 -1
  173. package/dist/client/assets/{toggle-group-DMXt56-2.js → toggle-group-DVALkDJ2.js} +1 -1
  174. package/dist/client/assets/{toolbar-OXl5jnSh.js → toolbar-BseEnCPh.js} +1 -1
  175. package/dist/client/assets/{tooltip-3t0rZx41.js → tooltip-CpPLj5ml.js} +1 -1
  176. package/dist/client/assets/{use-ai-providers-BohE9Odn.js → use-ai-providers-DFLh4od7.js} +1 -1
  177. package/dist/client/assets/{use-automations-DIaiQwDa.js → use-automations-xk7Cu5D8.js} +1 -1
  178. package/dist/client/assets/{use-autosave-CXlG3JMt.js → use-autosave-BkJZ15dZ.js} +1 -1
  179. package/dist/client/assets/{use-capability-BdRtF5xR.js → use-capability-CxUt0m8I.js} +1 -1
  180. package/dist/client/assets/{use-clock-tick-BMT1sGFb.js → use-clock-tick--4azGxeb.js} +1 -1
  181. package/dist/client/assets/{use-connection-BENaTXf0.js → use-connection-B7w0W3ts.js} +1 -1
  182. package/dist/client/assets/{use-copy-WK3laWsp.js → use-copy-C6oZHBaC.js} +1 -1
  183. package/dist/client/assets/{use-create-virtual-mcp-DjzSEPVP.js → use-create-virtual-mcp-BfVXbnRO.js} +1 -1
  184. package/dist/client/assets/{use-debounced-autosave-MSCj0o29.js → use-debounced-autosave-BMFBm4Py.js} +1 -1
  185. package/dist/client/assets/{use-debounced-value-DZ51uCua.js → use-debounced-value-usyjdfzM.js} +1 -1
  186. package/dist/client/assets/{use-deco-credits-QeC4b93u.js → use-deco-credits-CGRraY5U.js} +1 -1
  187. package/dist/client/assets/{use-decopilot-events-DbrKzoUr.js → use-decopilot-events-CfIikgvk.js} +1 -1
  188. package/dist/client/assets/{use-delete-connection-BwHxKbLh.js → use-delete-connection-WvDQKt5f.js} +1 -1
  189. package/dist/client/assets/{use-deployment-admin-C0JhF-1i.js → use-deployment-admin-Rs8yRNEE.js} +1 -1
  190. package/dist/client/assets/{use-file-configs-DGNI5Ogl.js → use-file-configs-Bp6CR8ct.js} +1 -1
  191. package/dist/client/assets/{use-infinite-scroll-DAXVCvAz.js → use-infinite-scroll-Bct8OYtv.js} +1 -1
  192. package/dist/client/assets/{use-join-requests-Dj2xiAWL.js → use-join-requests-1tzcg5D1.js} +1 -1
  193. package/dist/client/assets/{use-mcp-client-b2C0aMJl.js → use-mcp-client-B9fn1TBn.js} +1 -1
  194. package/dist/client/assets/{use-mcp-tools-B2dsPExT.js → use-mcp-tools-Cry83Gza.js} +1 -1
  195. package/dist/client/assets/{use-members-C84tiGc_.js → use-members-HbYBEeJu.js} +1 -1
  196. package/dist/client/assets/{use-mobile-BFF1W7dr.js → use-mobile-CnfmCPF3.js} +1 -1
  197. package/dist/client/assets/{use-navigate-to-agent-BUdpxraz.js → use-navigate-to-agent-BKt6uZhU.js} +1 -1
  198. package/dist/client/assets/{use-open-billing-url-z7FTgCyW.js → use-open-billing-url-DJ4izovt.js} +1 -1
  199. package/dist/client/assets/{use-org-auth-client-DgAMGuej.js → use-org-auth-client-DDDMIikQ.js} +1 -1
  200. package/dist/client/assets/{use-org-sso-BppOiyDL.js → use-org-sso-TyWjgGeP.js} +1 -1
  201. package/dist/client/assets/{use-organization-roles-r7jHYYqE.js → use-organization-roles-C0bVuJXK.js} +1 -1
  202. package/dist/client/assets/{use-organization-settings-NNUSxQ3V.js → use-organization-settings-BN4kKknX.js} +1 -1
  203. package/dist/client/assets/{use-registry-connections-BmoR-1Bp.js → use-registry-connections-VTJBa0En.js} +1 -1
  204. package/dist/client/assets/{use-secrets-DS0rpghc.js → use-secrets-D6-WGKvN.js} +1 -1
  205. package/dist/client/assets/{use-section-preview-base-CPMKpV41.js → use-section-preview-base-DcK97OvO.js} +1 -1
  206. package/dist/client/assets/{use-status-sounds-V4dngC1b.js → use-status-sounds-CzyM6HAc.js} +1 -1
  207. package/dist/client/assets/{use-tags-B_Th-dAy.js → use-tags-BS8JieCa.js} +1 -1
  208. package/dist/client/assets/{use-view-mode-Bcs1DCpc.js → use-view-mode-Qv39nezx.js} +1 -1
  209. package/dist/client/assets/{use-virtual-mcp-CoUnV_d7.js → use-virtual-mcp-C7NRfPhc.js} +1 -1
  210. package/dist/client/assets/useInfiniteQuery-C-kiHDyf.js +1 -0
  211. package/dist/client/assets/{useRouterState-D5SizHvD.js → useRouterState-CjR4UZBL.js} +1 -1
  212. package/dist/client/assets/useSuspenseInfiniteQuery-9epNuRWF.js +1 -0
  213. package/dist/client/assets/{users-CsVEwC_b.js → users-BF3gSgZn.js} +1 -1
  214. package/dist/client/assets/{variant-calendar-BwYz-0iI.js → variant-calendar-By4-97I2.js} +1 -1
  215. package/dist/client/assets/{view-mode-toggle-BV-YxzQ-.js → view-mode-toggle-DGzElltC.js} +1 -1
  216. package/dist/client/index.html +1 -1
  217. package/dist/server/cli.js +187 -187
  218. package/dist/server/server.js +182 -182
  219. package/package.json +1 -1
  220. package/dist/client/assets/record-editor-DOD_YyGt.js +0 -1
  221. package/dist/client/assets/registry-b9FTrvme.js +0 -2
  222. package/dist/client/assets/sections-editor-B30VUMU7.js +0 -2
  223. package/dist/client/assets/store-registry-Bh6HctLA.js +0 -2
  224. package/dist/client/assets/useInfiniteQuery-B_PvBDpZ.js +0 -1
  225. package/dist/client/assets/useSuspenseInfiniteQuery-Bd-pDwwP.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as Z,F as Ne,n as Ae,o as Ue,e as Pe,t as V,b as de,r as q,j as t,B as Q,k as Ye,m as te,ba as Gs,bb as Qs}from"./index-CNLGJHNt.js";import{i as ss,a as ps,t as Ys,c as Ws,n as Js,b as Zs}from"./Tool02-CgKntXm0.js";import{i as We}from"./CheckCircle-CJr8ykHV.js";import{s as Ft,b as Xs,i as er,a as tr}from"./Settings02-C7ZM_51J.js";import{S as Oe,u as Fe,W as sr}from"./use-mcp-client-b2C0aMJl.js";import{u as hs}from"./useInfiniteQuery-B_PvBDpZ.js";import{u as Me}from"./studio-tools-CrdPQqWl.js";import{B as H}from"./badge-CGqdv3pi.js";import{I as je}from"./input-CnORcq3w.js";import{D as ft,a as ke,b as yt,c as jt,j as rs,k as is,i as rr}from"./dropdown-menu-DwsBHhdy.js";import{c as $t,e as zt,a as Je,d as he,b as Ot,T as fe}from"./table-DPNST0df.js";import{a as ir,T as ns}from"./toggle-group-DMXt56-2.js";import{u as nr}from"./use-view-mode-Bcs1DCpc.js";import{a as Bt}from"./DotsVertical-DwsPX2c8.js";import{i as or}from"./FilterLines-Dw8azjNW.js";import{n as ar,i as fs}from"./Globe01-gmiwWV2R.js";import{i as lr}from"./SearchMd-BLcdKvuz.js";import{e as vt,d as bt,b as Nt,h as Ct,a as wt,c as _t}from"./dialog-C1pWvbSS.js";import{i as st}from"./AlertCircle-C8SY5iRK.js";import{i as os}from"./Upload01-D0nuuz04.js";import{g as Ie,w as Pt}from"./metadata-dUsYcpuu.js";import{A as rt,a as it,b as nt,c as ot,d as at,e as lt,f as ct,g as dt}from"./alert-dialog-DrQn8XjO.js";import{C as ge}from"./card-ClcwuDin.js";import{s as ut}from"./Trash01-Dmkz9YvS.js";import{L as ae}from"./label-BgE1QCwJ.js";import{S as cr,a as dr,b as ur,c as mr,d as qt}from"./select-QT6EhBK9.js";import{S as Ge}from"./switch-DFtBlkd_.js";import{T as Rt}from"./textarea-C9wG3Z-z.js";import{i as gr}from"./ArrowLeft-DUpOl6Js.js";import{b as xr,i as pr,a as hr}from"./XCircle-BOAiv6Zc.js";import{i as fr}from"./X-BZGIgNvY.js";import{t as yr}from"./ChevronDown-YGt15NDz.js";import{n as jr}from"./ChevronUp-BMKTxhtV.js";import{C as as}from"./checkbox-DBG4u_fO.js";import{s as ys}from"./Eye-D3pFPZtG.js";import{n as vr}from"./LinkExternal01-5zhWp-5h.js";import{u as br}from"./use-infinite-scroll-DAXVCvAz.js";import{u as Et}from"./use-copy-WK3laWsp.js";import{i as Lt}from"./Check-C_ZW4dMG.js";import{a as At}from"./Copy01-CfJtVQX8.js";import{i as Nr}from"./Key01-OAo9mPW5.js";import{s as Cr}from"./Plus-BDl2qzjU.js";import{T as wr,a as _r,c as Pr}from"./tooltip-3t0rZx41.js";import{i as Rr,a as Ir}from"./mcp-oauth-Cki4VKX_.js";import{i as kr}from"./Play-B32e2Xb_.js";import"./auth-DDiuYHCk.js";import"./ChevronRight-Ti1DNRwg.js";import"./use-mobile-BFF1W7dr.js";const Ve="private-registry",Sr=`
1
+ import{c as Z,F as Ne,n as Ae,o as Ue,e as Pe,t as V,b as de,r as q,j as t,B as Q,k as Ye,m as te,ba as Gs,bb as Qs}from"./index-BQFOspRh.js";import{i as ss,a as ps,t as Ys,c as Ws,n as Js,b as Zs}from"./Tool02-Bk0Wi_jc.js";import{i as We}from"./CheckCircle-UOyFv4rE.js";import{s as Ft,b as Xs,i as er,a as tr}from"./Settings02-D_by58BO.js";import{S as Oe,u as Fe,W as sr}from"./use-mcp-client-B9fn1TBn.js";import{u as hs}from"./useInfiniteQuery-C-kiHDyf.js";import{u as Me}from"./studio-tools-BETupmQh.js";import{B as H}from"./badge-CXZR0JJ6.js";import{I as je}from"./input-DLmq-Bri.js";import{D as ft,a as ke,b as yt,c as jt,j as rs,k as is,i as rr}from"./dropdown-menu-DPde1UkW.js";import{c as $t,e as zt,a as Je,d as he,b as Ot,T as fe}from"./table-DHyF1BO5.js";import{a as ir,T as ns}from"./toggle-group-DVALkDJ2.js";import{u as nr}from"./use-view-mode-Qv39nezx.js";import{a as Bt}from"./DotsVertical-CILzGe_q.js";import{i as or}from"./FilterLines-DcRWfBwT.js";import{n as ar,i as fs}from"./Globe01-W4lyjKuH.js";import{i as lr}from"./SearchMd-CDwUuDyr.js";import{e as vt,d as bt,b as Nt,h as Ct,a as wt,c as _t}from"./dialog-Cg0277WK.js";import{i as st}from"./AlertCircle-BWppLd8c.js";import{i as os}from"./Upload01-De1aQPW9.js";import{g as Ie,w as Pt}from"./metadata-dUsYcpuu.js";import{A as rt,a as it,b as nt,c as ot,d as at,e as lt,f as ct,g as dt}from"./alert-dialog-Bpd-0p4I.js";import{C as ge}from"./card-B-Mzv0lS.js";import{s as ut}from"./Trash01-Dk2U_er_.js";import{L as ae}from"./label-B1DonsU-.js";import{S as cr,a as dr,b as ur,c as mr,d as qt}from"./select-BoHatn08.js";import{S as Ge}from"./switch-D5nHMM9-.js";import{T as Rt}from"./textarea-DLfz9L-W.js";import{i as gr}from"./ArrowLeft-cFWJcCye.js";import{b as xr,i as pr,a as hr}from"./XCircle-Cj1jhbDm.js";import{i as fr}from"./X-DmV-M3--.js";import{t as yr}from"./ChevronDown-LNz16DWG.js";import{n as jr}from"./ChevronUp-DZ-mKv_H.js";import{C as as}from"./checkbox-DU-r9RK1.js";import{s as ys}from"./Eye-BT74JrOy.js";import{n as vr}from"./LinkExternal01-CP1N0ekO.js";import{u as br}from"./use-infinite-scroll-Bct8OYtv.js";import{u as Et}from"./use-copy-C6oZHBaC.js";import{i as Lt}from"./Check-Dc66au0h.js";import{a as At}from"./Copy01-DPPY_ooc.js";import{i as Nr}from"./Key01-Bk2QhvNY.js";import{s as Cr}from"./Plus-9KDBMlCX.js";import{T as wr,a as _r,c as Pr}from"./tooltip-CpPLj5ml.js";import{i as Rr,a as Ir}from"./mcp-oauth-0Wpz4XYZ.js";import{i as kr}from"./Play-DrC9uZbx.js";import"./auth-B56MWIKT.js";import"./ChevronRight-DjBVHQoY.js";import"./use-mobile-CnfmCPF3.js";const Ve="private-registry",Sr=`
2
2
  You are an MCP tool tester running automated integration checks.
3
3
 
4
4
  Goal:
@@ -20,8 +20,8 @@ At the end, provide a concise summary of:
20
20
  - What failed
21
21
  - What could not be tested and why
22
22
  - If some tool needs user-specific context (email/account/tenant), explicitly output a "CONTEXT_REQUIRED" note with what is needed.
23
- `.trim(),Y={all:["private-registry"],items:()=>[...Y.all,"items"],itemsList:(s,e,r,i)=>[...Y.items(),"list",{search:s,tags:e,categories:r,limit:i}],item:s=>[...Y.items(),"item",s],filters:()=>[...Y.all,"filters"],registryConfig:()=>[...Y.all,"registry-config"],registryConfigByPlugin:(s,e)=>[...Y.registryConfig(),s,e],publishRequests:()=>[...Y.all,"publish-requests"],publishRequestsByOrg:s=>[...Y.publishRequests(),"org",s],publishRequestsList:(s,e,r)=>[...Y.publishRequests(),"list",{status:s??"all",sortBy:e??"created_at",sortDirection:r??"desc"}],publishRequestsListByOrg:(s,e,r,i)=>[...Y.publishRequestsByOrg(s),"list",{status:e??"all",sortBy:r??"created_at",sortDirection:i??"desc"}],publishRequestsCount:()=>[...Y.publishRequests(),"count"],publishRequestsCountByOrg:s=>[...Y.publishRequestsByOrg(s),"count"],publishApiKeys:()=>[...Y.all,"publish-api-keys"],monitor:s=>[...Y.all,"monitor",s],monitorRuns:s=>[...Y.monitor(s),"runs"],monitorRunsList:(s,e)=>[...Y.monitorRuns(s),"list",{status:e??"all"}],monitorRun:(s,e)=>[...Y.monitorRuns(s),"run",e??"none"],monitorResults:s=>[...Y.monitor(s),"results"],monitorResultsList:(s,e,r)=>[...Y.monitorResults(s),"list",{runId:e??"none",status:r??"all"}],monitorConnections:s=>[...Y.monitor(s),"connections"],monitorConnectionAuthProbe:(s,e)=>[...Y.monitorConnections(s),"auth-probe",e]};async function Te(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 Dr(){const s=Z.c(11),e=Ue(),{org:r}=Ne();let i;s[0]!==r.id||s[1]!==r.slug?(i={connectionId:Oe,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=>Te(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:Y.monitorRuns(r.id)}),e.invalidateQueries({queryKey:Y.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],Pe(a)}function Tr(){const s=Z.c(11),e=Ue(),{org:r}=Ne();let i;s[0]!==r.id||s[1]!==r.slug?(i={connectionId:Oe,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=>Te(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:Y.monitorRuns(r.id)}),e.invalidateQueries({queryKey:Y.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],Pe(a)}function kt(s){const e=Z.c(12),{org:r}=Ne();let i;e[0]!==r.id||e[1]!==r.slug?(i={connectionId:Oe,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=Y.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()=>Te(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 Kt(s){const e=Z.c(13),{org:r}=Ne();let i;e[0]!==r.id||e[1]!==r.slug?(i={connectionId:Oe,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=Y.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()=>Te(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:Mr},e[9]=l,e[10]=c,e[11]=a,e[12]=o):o=e[12],Ae(o)}function Mr(s){return s.state.data?.run?.status==="running"?5e3:!1}function mt(s,e,r){const i=Z.c(16),{org:n}=Ne();let l;i[0]!==n.id||i[1]!==n.slug?(l={connectionId:Oe,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=Y.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()=>Te(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 js(){const s=Z.c(10),{org:e}=Ne();let r;s[0]!==e.id||s[1]!==e.slug?(r={connectionId:Oe,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=Y.monitorConnections(e.id),s[3]=e.id,s[4]=n):n=s[4];let l;s[5]!==i?(l=async()=>Te(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 qr(){const s=Z.c(11),e=Ue(),{org:r}=Ne();let i;s[0]!==r.id||s[1]!==r.slug?(i={connectionId:Oe,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()=>Te(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:Y.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],Pe(a)}function Er(){const s=Z.c(11),e=Ue(),{org:r}=Ne();let i;s[0]!==r.id||s[1]!==r.slug?(i={connectionId:Oe,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 Te(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:Y.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],Pe(a)}const ls={monitorMode:"health_check",onFailure:"none",schedule:"manual",cronExpression:"",scheduleEventId:"",perMcpTimeoutMs:3e4,perToolTimeoutMs:1e4,maxAgentSteps:15,testPublicOnly:!1,testPrivateOnly:!1,includePendingRequests:!1,agentContext:""};function vs(){const s=Z.c(34),{org:e,project:r}=Ne();let i;s[0]!==e.id||s[1]!==e.slug?(i={connectionId:Oe,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=Y.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()=>Te(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,h=m&&typeof m=="object"?m.testConfig:void 0,x=typeof(m?m.monitorMode??m.testMode:void 0)=="string";let p;s[12]!==h?(p=h??{},s[12]=h,s[13]=p):p=s[13];let f;s[14]!==x||s[15]!==m||s[16]!==h?(f=x&&!h?m:{},s[14]=x,s[15]=m,s[16]=h,s[17]=f):f=s[17];let y;s[18]!==p||s[19]!==f?(y={...ls,...p,...f},s[18]=p,s[19]=f,s[20]=y):y=s[20];const v=y;let C;s[21]!==n||s[22]!==r.id?(C=async R=>{const k=(await Te(n,"VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:r.id,pluginId:Ve}))?.config?.settings??{};return Te(n,"VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE",{virtualMcpId:r.id,pluginId:Ve,settings:{...k,testConfig:{...ls,...k.testConfig??{},...R}}})},s[21]=n,s[22]=r.id,s[23]=C):C=s[23];let _;s[24]!==r.id||s[25]!==l?(_=async()=>{await l.invalidateQueries({queryKey:Y.registryConfigByPlugin(r.id??"",Ve)})},s[24]=r.id,s[25]=l,s[26]=_):_=s[26];let b;s[27]!==C||s[28]!==_?(b={mutationFn:C,onSuccess:_},s[27]=C,s[28]=_,s[29]=b):b=s[29];const L=Pe(b);let I;return s[30]!==d.isLoading||s[31]!==L||s[32]!==v?(I={settings:v,isLoading:d.isLoading,saveMutation:L},s[30]=d.isLoading,s[31]=L,s[32]=v,s[33]=I):I=s[33],I}function Lr(){const s=Z.c(3),e=kt("completed"),r=e.data?.items?.[0]?.id,i=e.data?.items?.[0]?.status,n=mt(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 bs=24;function Ar(s){return s.trim()}async function be(s,e,r){return s.call(e,r)}function Ns(s){const e=Z.c(17),r=Me();let i,n,l,c;e[0]!==s.categories||e[1]!==s.limit||e[2]!==s.search||e[3]!==s.tags?(n=Ar(s.search),i=s.limit??bs,c=hs,l=Y.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 be(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:Ur,staleTime:3e4},e[14]=l,e[15]=a,e[16]=o):o=e[16],c(o)}function Ur(s){return s.nextCursor}function Fr(){const s=Z.c(6),e=Me();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r=Y.filters(),s[0]=r):r=s[0];let i;s[1]!==e?(i=async()=>be(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 Ht(){const s=Z.c(27),e=Ue(),r=Me();let i;s[0]!==e?(i=async()=>{await Promise.all([e.invalidateQueries({queryKey:Y.items()}),e.invalidateQueries({queryKey:Y.filters()})])},s[0]=e,s[1]=i):i=s[1];const n=i;let l;s[2]!==r?(l=async v=>(await be(r,"REGISTRY_ITEM_CREATE",{data:v})).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=Pe(c);let o;s[7]!==r?(o=async v=>{const{id:C,data:_}=v;return(await be(r,"REGISTRY_ITEM_UPDATE",{id:C,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=Pe(u);let m;s[12]!==r?(m=async v=>(await be(r,"REGISTRY_ITEM_DELETE",{id:v})).item,s[12]=r,s[13]=m):m=s[13];let h;s[14]!==n||s[15]!==m?(h={mutationFn:m,onSuccess:n},s[14]=n,s[15]=m,s[16]=h):h=s[16];const g=Pe(h);let x;s[17]!==r?(x=async v=>be(r,"REGISTRY_ITEM_BULK_CREATE",{items:v}),s[17]=r,s[18]=x):x=s[18];let p;s[19]!==n||s[20]!==x?(p={mutationFn:x,onSuccess:n},s[19]=n,s[20]=x,s[21]=p):p=s[21];const f=Pe(p);let y;return s[22]!==f||s[23]!==a||s[24]!==g||s[25]!==d?(y={createMutation:a,updateMutation:d,deleteMutation:g,bulkCreateMutation:f},s[22]=f,s[23]=a,s[24]=g,s[25]=d,s[26]=y):y=s[26],y}function Cs(s){const e=Z.c(24),{org:r}=Ne(),i=Me(),n=Ue(),l=sr.SELF(r.id),c=Ae({queryKey:Y.registryConfigByPlugin(l,s),queryFn:async()=>be(i,"VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:l,pluginId:s}),staleTime:6e4}),a=Y.registryConfigByPlugin(l,s);let o;e[0]!==s||e[1]!==l||e[2]!==i?(o=async P=>{const E=(await be(i,"VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:l,pluginId:s}))?.config?.settings??{};return be(i,"VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE",{virtualMcpId:l,pluginId:s,settings:{...E,...P}})},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:$r},e[7]=o,e[8]=u,e[9]=d):d=e[9];const m=Pe(d);let h;e[10]!==m?(h=P=>{m.mutate(P)},e[10]=m,e[11]=h):h=e[11];const g=h,x=c.data?.config?.settings?.registryName??"Private Registry",p=c.data?.config?.settings?.registryIcon??"",f=c.data?.config?.settings?.acceptPublishRequests??!1,y=c.data?.config?.settings?.requireApiToken??!1,v=c.data?.config?.settings?.storePrivateOnly??!1,C=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 R;return e[12]!==f||e[13]!==m.isPending||e[14]!==c.isLoading||e[15]!==C||e[16]!==I||e[17]!==b||e[18]!==p||e[19]!==x||e[20]!==y||e[21]!==v||e[22]!==g?(R={registryName:x,registryIcon:p,acceptPublishRequests:f,requireApiToken:y,storePrivateOnly:v,rateLimitEnabled:C,rateLimitWindow:b,rateLimitMax:I,isLoadingConfig:c.isLoading,isSaving:m.isPending,updateConfig:g},e[12]=f,e[13]=m.isPending,e[14]=c.isLoading,e[15]=C,e[16]=I,e[17]=b,e[18]=p,e[19]=x,e[20]=y,e[21]=v,e[22]=g,e[23]=R):R=e[23],R}function $r(s){V.error(s instanceof Error?s.message:"Failed to save registry settings")}function zr(s){const e=Z.c(13),{org:r}=Ne(),i=Me();let n;e[0]!==r.id||e[1]!==s.sortBy||e[2]!==s.sortDirection||e[3]!==s.status?(n=Y.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 be(i,"REGISTRY_PUBLISH_REQUEST_LIST",{status:s.status,sortBy:s.sortBy,sortDirection:s.sortDirection,limit:bs,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:Or,staleTime:3e4,refetchOnMount:!0},e[10]=n,e[11]=l,e[12]=c):c=e[12],hs(c)}function Or(s,e){const r=e.reduce(Br,0);return r<s.totalCount?r:void 0}function Br(s,e){return s+e.items.length}function Kr(){const s=Z.c(7),{org:e}=Ne(),r=Me();let i;s[0]!==e.id?(i=Y.publishRequestsCountByOrg(e.id),s[0]=e.id,s[1]=i):i=s[1];let n;s[2]!==r?(n=async()=>be(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 Hr(){const s=Z.c(15),e=Ue(),r=Me();let i;s[0]!==e?(i=async()=>{await Promise.all([e.invalidateQueries({queryKey:Y.publishRequests()})])},s[0]=e,s[1]=i):i=s[1];const n=i;let l;s[2]!==r?(l=async h=>be(r,"REGISTRY_PUBLISH_REQUEST_REVIEW",h),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=Pe(c);let o;s[7]!==r?(o=async h=>be(r,"REGISTRY_PUBLISH_REQUEST_DELETE",{id:h}),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=Pe(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 Vr(){const s=Z.c(3),e=Me();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r=Y.publishApiKeys(),s[0]=r):r=s[0];let i;return s[1]!==e?(i={queryKey:r,queryFn:async()=>be(e,"REGISTRY_PUBLISH_API_KEY_LIST",{}),staleTime:3e4},s[1]=e,s[2]=i):i=s[2],Ae(i)}function Gr(){const s=Z.c(17),e=Ue(),r=Me();let i;s[0]!==r?(i=async h=>be(r,"REGISTRY_PUBLISH_API_KEY_GENERATE",{name:h}),s[0]=r,s[1]=i):i=s[1];let n;s[2]!==e?(n=async()=>{await e.invalidateQueries({queryKey:Y.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=Pe(l);let a;s[7]!==r?(a=async h=>be(r,"REGISTRY_PUBLISH_API_KEY_REVOKE",{keyId:h}),s[7]=r,s[8]=a):a=s[8];let o;s[9]!==e?(o=async()=>{await e.invalidateQueries({queryKey:Y.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=Pe(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 cs(s){return s?s.split(/[;|]/).map(e=>e.trim()).filter(Boolean):[]}function ds(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 Qr=["id","title"],Yr=["id","title","description","remote_url","remote_type","tags","categories","is_public"];function Wr(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=ds(e[0]??""),i=new Map,n=[];r.forEach((u,d)=>{const m=u.toLowerCase().trim();m&&i.set(m,d)});for(const u of Qr)i.has(u)||n.push({line:1,message:`Missing required column: "${u}"`});for(const u of r){const d=u.toLowerCase().trim();d&&!Yr.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=ds(e[u]??""),m=l(d,"id").trim(),h=l(d,"title").trim();if(!m){n.push({line:u+1,message:"Missing id — row skipped"}),o+=1;continue}if(!h){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 g=l(d,"description").trim(),x=l(d,"remote_url").trim(),f=l(d,"remote_type").trim().toLowerCase()==="sse"?"sse":"http",y=cs(l(d,"tags")),v=cs(l(d,"categories")),C=l(d,"is_public").trim().toLowerCase(),_=C==="true"||C==="1"||C==="yes";c.push({id:m,title:h,description:g||null,is_public:_,_meta:Pt(void 0,{...y.length>0?{tags:y}:{},...v.length>0?{categories:v}:{}}),server:{name:m,title:h,description:g||void 0,remotes:x?[{type:f,url:x}]:[]}})}return{items:c,warnings:n,skipped:o}}const Jr=`id,title,description,remote_url,remote_type,tags,categories,is_public
23
+ `.trim(),Y={all:["private-registry"],items:()=>[...Y.all,"items"],itemsList:(s,e,r,i)=>[...Y.items(),"list",{search:s,tags:e,categories:r,limit:i}],item:s=>[...Y.items(),"item",s],filters:()=>[...Y.all,"filters"],registryConfig:()=>[...Y.all,"registry-config"],registryConfigByPlugin:(s,e)=>[...Y.registryConfig(),s,e],publishRequests:()=>[...Y.all,"publish-requests"],publishRequestsByOrg:s=>[...Y.publishRequests(),"org",s],publishRequestsList:(s,e,r)=>[...Y.publishRequests(),"list",{status:s??"all",sortBy:e??"created_at",sortDirection:r??"desc"}],publishRequestsListByOrg:(s,e,r,i)=>[...Y.publishRequestsByOrg(s),"list",{status:e??"all",sortBy:r??"created_at",sortDirection:i??"desc"}],publishRequestsCount:()=>[...Y.publishRequests(),"count"],publishRequestsCountByOrg:s=>[...Y.publishRequestsByOrg(s),"count"],publishApiKeys:()=>[...Y.all,"publish-api-keys"],monitor:s=>[...Y.all,"monitor",s],monitorRuns:s=>[...Y.monitor(s),"runs"],monitorRunsList:(s,e)=>[...Y.monitorRuns(s),"list",{status:e??"all"}],monitorRun:(s,e)=>[...Y.monitorRuns(s),"run",e??"none"],monitorResults:s=>[...Y.monitor(s),"results"],monitorResultsList:(s,e,r)=>[...Y.monitorResults(s),"list",{runId:e??"none",status:r??"all"}],monitorConnections:s=>[...Y.monitor(s),"connections"],monitorConnectionAuthProbe:(s,e)=>[...Y.monitorConnections(s),"auth-probe",e]};async function Te(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 Dr(){const s=Z.c(11),e=Ue(),{org:r}=Ne();let i;s[0]!==r.id||s[1]!==r.slug?(i={connectionId:Oe,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=>Te(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:Y.monitorRuns(r.id)}),e.invalidateQueries({queryKey:Y.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],Pe(a)}function Tr(){const s=Z.c(11),e=Ue(),{org:r}=Ne();let i;s[0]!==r.id||s[1]!==r.slug?(i={connectionId:Oe,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=>Te(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:Y.monitorRuns(r.id)}),e.invalidateQueries({queryKey:Y.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],Pe(a)}function kt(s){const e=Z.c(12),{org:r}=Ne();let i;e[0]!==r.id||e[1]!==r.slug?(i={connectionId:Oe,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=Y.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()=>Te(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 Kt(s){const e=Z.c(13),{org:r}=Ne();let i;e[0]!==r.id||e[1]!==r.slug?(i={connectionId:Oe,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=Y.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()=>Te(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:Mr},e[9]=l,e[10]=c,e[11]=a,e[12]=o):o=e[12],Ae(o)}function Mr(s){return s.state.data?.run?.status==="running"?5e3:!1}function mt(s,e,r){const i=Z.c(16),{org:n}=Ne();let l;i[0]!==n.id||i[1]!==n.slug?(l={connectionId:Oe,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=Y.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()=>Te(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 js(){const s=Z.c(10),{org:e}=Ne();let r;s[0]!==e.id||s[1]!==e.slug?(r={connectionId:Oe,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=Y.monitorConnections(e.id),s[3]=e.id,s[4]=n):n=s[4];let l;s[5]!==i?(l=async()=>Te(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 qr(){const s=Z.c(11),e=Ue(),{org:r}=Ne();let i;s[0]!==r.id||s[1]!==r.slug?(i={connectionId:Oe,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()=>Te(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:Y.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],Pe(a)}function Er(){const s=Z.c(11),e=Ue(),{org:r}=Ne();let i;s[0]!==r.id||s[1]!==r.slug?(i={connectionId:Oe,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 Te(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:Y.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],Pe(a)}const ls={monitorMode:"health_check",onFailure:"none",schedule:"manual",cronExpression:"",scheduleEventId:"",perMcpTimeoutMs:3e4,perToolTimeoutMs:1e4,maxAgentSteps:15,testPublicOnly:!1,testPrivateOnly:!1,includePendingRequests:!1,agentContext:""};function vs(){const s=Z.c(34),{org:e,project:r}=Ne();let i;s[0]!==e.id||s[1]!==e.slug?(i={connectionId:Oe,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=Y.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()=>Te(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,h=m&&typeof m=="object"?m.testConfig:void 0,x=typeof(m?m.monitorMode??m.testMode:void 0)=="string";let p;s[12]!==h?(p=h??{},s[12]=h,s[13]=p):p=s[13];let f;s[14]!==x||s[15]!==m||s[16]!==h?(f=x&&!h?m:{},s[14]=x,s[15]=m,s[16]=h,s[17]=f):f=s[17];let y;s[18]!==p||s[19]!==f?(y={...ls,...p,...f},s[18]=p,s[19]=f,s[20]=y):y=s[20];const v=y;let C;s[21]!==n||s[22]!==r.id?(C=async R=>{const S=(await Te(n,"VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:r.id,pluginId:Ve}))?.config?.settings??{};return Te(n,"VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE",{virtualMcpId:r.id,pluginId:Ve,settings:{...S,testConfig:{...ls,...S.testConfig??{},...R}}})},s[21]=n,s[22]=r.id,s[23]=C):C=s[23];let _;s[24]!==r.id||s[25]!==l?(_=async()=>{await l.invalidateQueries({queryKey:Y.registryConfigByPlugin(r.id??"",Ve)})},s[24]=r.id,s[25]=l,s[26]=_):_=s[26];let b;s[27]!==C||s[28]!==_?(b={mutationFn:C,onSuccess:_},s[27]=C,s[28]=_,s[29]=b):b=s[29];const L=Pe(b);let k;return s[30]!==d.isLoading||s[31]!==L||s[32]!==v?(k={settings:v,isLoading:d.isLoading,saveMutation:L},s[30]=d.isLoading,s[31]=L,s[32]=v,s[33]=k):k=s[33],k}function Lr(){const s=Z.c(3),e=kt("completed"),r=e.data?.items?.[0]?.id,i=e.data?.items?.[0]?.status,n=mt(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 bs=24;function Ar(s){return s.trim()}async function be(s,e,r){return s.call(e,r)}function Ns(s){const e=Z.c(17),r=Me();let i,n,l,c;e[0]!==s.categories||e[1]!==s.limit||e[2]!==s.search||e[3]!==s.tags?(n=Ar(s.search),i=s.limit??bs,c=hs,l=Y.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 be(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:Ur,staleTime:3e4},e[14]=l,e[15]=a,e[16]=o):o=e[16],c(o)}function Ur(s){return s.nextCursor}function Fr(){const s=Z.c(6),e=Me();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r=Y.filters(),s[0]=r):r=s[0];let i;s[1]!==e?(i=async()=>be(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 Ht(){const s=Z.c(27),e=Ue(),r=Me();let i;s[0]!==e?(i=async()=>{await Promise.all([e.invalidateQueries({queryKey:Y.items()}),e.invalidateQueries({queryKey:Y.filters()})])},s[0]=e,s[1]=i):i=s[1];const n=i;let l;s[2]!==r?(l=async v=>(await be(r,"REGISTRY_ITEM_CREATE",{data:v})).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=Pe(c);let o;s[7]!==r?(o=async v=>{const{id:C,data:_}=v;return(await be(r,"REGISTRY_ITEM_UPDATE",{id:C,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=Pe(u);let m;s[12]!==r?(m=async v=>(await be(r,"REGISTRY_ITEM_DELETE",{id:v})).item,s[12]=r,s[13]=m):m=s[13];let h;s[14]!==n||s[15]!==m?(h={mutationFn:m,onSuccess:n},s[14]=n,s[15]=m,s[16]=h):h=s[16];const g=Pe(h);let x;s[17]!==r?(x=async v=>be(r,"REGISTRY_ITEM_BULK_CREATE",{items:v}),s[17]=r,s[18]=x):x=s[18];let p;s[19]!==n||s[20]!==x?(p={mutationFn:x,onSuccess:n},s[19]=n,s[20]=x,s[21]=p):p=s[21];const f=Pe(p);let y;return s[22]!==f||s[23]!==a||s[24]!==g||s[25]!==d?(y={createMutation:a,updateMutation:d,deleteMutation:g,bulkCreateMutation:f},s[22]=f,s[23]=a,s[24]=g,s[25]=d,s[26]=y):y=s[26],y}function Cs(s){const e=Z.c(24),{org:r}=Ne(),i=Me(),n=Ue(),l=sr.SELF(r.id),c=Ae({queryKey:Y.registryConfigByPlugin(l,s),queryFn:async()=>be(i,"VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:l,pluginId:s}),staleTime:6e4}),a=Y.registryConfigByPlugin(l,s);let o;e[0]!==s||e[1]!==l||e[2]!==i?(o=async P=>{const E=(await be(i,"VIRTUAL_MCP_PLUGIN_CONFIG_GET",{virtualMcpId:l,pluginId:s}))?.config?.settings??{};return be(i,"VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE",{virtualMcpId:l,pluginId:s,settings:{...E,...P}})},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:$r},e[7]=o,e[8]=u,e[9]=d):d=e[9];const m=Pe(d);let h;e[10]!==m?(h=P=>{m.mutate(P)},e[10]=m,e[11]=h):h=e[11];const g=h,x=c.data?.config?.settings?.registryName??"Private Registry",p=c.data?.config?.settings?.registryIcon??"",f=c.data?.config?.settings?.acceptPublishRequests??!1,y=c.data?.config?.settings?.requireApiToken??!1,v=c.data?.config?.settings?.storePrivateOnly??!1,C=c.data?.config?.settings?.rateLimitEnabled??!0,b=c.data?.config?.settings?.rateLimitWindow==="minute"?"minute":"hour",L=c.data?.config?.settings?.rateLimitMax,k=typeof L=="number"&&L>=1?Math.floor(L):100;let R;return e[12]!==f||e[13]!==m.isPending||e[14]!==c.isLoading||e[15]!==C||e[16]!==k||e[17]!==b||e[18]!==p||e[19]!==x||e[20]!==y||e[21]!==v||e[22]!==g?(R={registryName:x,registryIcon:p,acceptPublishRequests:f,requireApiToken:y,storePrivateOnly:v,rateLimitEnabled:C,rateLimitWindow:b,rateLimitMax:k,isLoadingConfig:c.isLoading,isSaving:m.isPending,updateConfig:g},e[12]=f,e[13]=m.isPending,e[14]=c.isLoading,e[15]=C,e[16]=k,e[17]=b,e[18]=p,e[19]=x,e[20]=y,e[21]=v,e[22]=g,e[23]=R):R=e[23],R}function $r(s){V.error(s instanceof Error?s.message:"Failed to save registry settings")}function zr(s){const e=Z.c(13),{org:r}=Ne(),i=Me();let n;e[0]!==r.id||e[1]!==s.sortBy||e[2]!==s.sortDirection||e[3]!==s.status?(n=Y.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 be(i,"REGISTRY_PUBLISH_REQUEST_LIST",{status:s.status,sortBy:s.sortBy,sortDirection:s.sortDirection,limit:bs,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:Or,staleTime:3e4,refetchOnMount:!0},e[10]=n,e[11]=l,e[12]=c):c=e[12],hs(c)}function Or(s,e){const r=e.reduce(Br,0);return r<s.totalCount?r:void 0}function Br(s,e){return s+e.items.length}function Kr(){const s=Z.c(7),{org:e}=Ne(),r=Me();let i;s[0]!==e.id?(i=Y.publishRequestsCountByOrg(e.id),s[0]=e.id,s[1]=i):i=s[1];let n;s[2]!==r?(n=async()=>be(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 Hr(){const s=Z.c(15),e=Ue(),r=Me();let i;s[0]!==e?(i=async()=>{await Promise.all([e.invalidateQueries({queryKey:Y.publishRequests()})])},s[0]=e,s[1]=i):i=s[1];const n=i;let l;s[2]!==r?(l=async h=>be(r,"REGISTRY_PUBLISH_REQUEST_REVIEW",h),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=Pe(c);let o;s[7]!==r?(o=async h=>be(r,"REGISTRY_PUBLISH_REQUEST_DELETE",{id:h}),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=Pe(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 Vr(){const s=Z.c(3),e=Me();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r=Y.publishApiKeys(),s[0]=r):r=s[0];let i;return s[1]!==e?(i={queryKey:r,queryFn:async()=>be(e,"REGISTRY_PUBLISH_API_KEY_LIST",{}),staleTime:3e4},s[1]=e,s[2]=i):i=s[2],Ae(i)}function Gr(){const s=Z.c(17),e=Ue(),r=Me();let i;s[0]!==r?(i=async h=>be(r,"REGISTRY_PUBLISH_API_KEY_GENERATE",{name:h}),s[0]=r,s[1]=i):i=s[1];let n;s[2]!==e?(n=async()=>{await e.invalidateQueries({queryKey:Y.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=Pe(l);let a;s[7]!==r?(a=async h=>be(r,"REGISTRY_PUBLISH_API_KEY_REVOKE",{keyId:h}),s[7]=r,s[8]=a):a=s[8];let o;s[9]!==e?(o=async()=>{await e.invalidateQueries({queryKey:Y.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=Pe(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 cs(s){return s?s.split(/[;|]/).map(e=>e.trim()).filter(Boolean):[]}function ds(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 Qr=["id","title"],Yr=["id","title","description","remote_url","remote_type","tags","categories","is_public"];function Wr(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=ds(e[0]??""),i=new Map,n=[];r.forEach((u,d)=>{const m=u.toLowerCase().trim();m&&i.set(m,d)});for(const u of Qr)i.has(u)||n.push({line:1,message:`Missing required column: "${u}"`});for(const u of r){const d=u.toLowerCase().trim();d&&!Yr.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=ds(e[u]??""),m=l(d,"id").trim(),h=l(d,"title").trim();if(!m){n.push({line:u+1,message:"Missing id — row skipped"}),o+=1;continue}if(!h){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 g=l(d,"description").trim(),x=l(d,"remote_url").trim(),f=l(d,"remote_type").trim().toLowerCase()==="sse"?"sse":"http",y=cs(l(d,"tags")),v=cs(l(d,"categories")),C=l(d,"is_public").trim().toLowerCase(),_=C==="true"||C==="1"||C==="yes";c.push({id:m,title:h,description:g||null,is_public:_,_meta:Pt(void 0,{...y.length>0?{tags:y}:{},...v.length>0?{categories:v}:{}}),server:{name:m,title:h,description:g||void 0,remotes:x?[{type:f,url:x}]:[]}})}return{items:c,warnings:n,skipped:o}}const Jr=`id,title,description,remote_url,remote_type,tags,categories,is_public
24
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 Zr(){const s=new Blob([Jr],{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 Xr(s){const e=Z.c(101),{open:r,onOpenChange:i,isImporting:n,onImport:l}=s,c=n===void 0?!1:n,a=de(),[o,u]=q.useState(null),[d,m]=q.useState(null),[h,g]=q.useState(null),x=q.useRef(null);let p;e[0]!==i?(p=U=>{i(U),U||(u(null),m(null),g(null),x.current&&(x.current.value=""))},e[0]=i,e[1]=p):p=e[1];const f=p;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=async U=>{if(!U)return;g(U.name),m(null);const F=await U.text();u(Wr(F))},e[2]=y):y=e[2];const v=y;let C;e[3]!==l||e[4]!==o?(C=async()=>{if(!o?.items.length)return;const U=await l(o.items);m(U)},e[3]=l,e[4]=o,e[5]=C):C=e[5];const _=C;let b,L,I,R,P,k,E,D,N,S,T;if(e[6]!==h||e[7]!==_||e[8]!==f||e[9]!==d||e[10]!==c||e[11]!==r||e[12]!==o||e[13]!==a){const U=o?.items??[];let F;e[25]!==o?.warnings?(F=o?.warnings??[],e[25]=o?.warnings,e[26]=F):F=e[26];const j=F;let z;e[27]!==j?(z=j.some(ti),e[27]=j,e[28]=z):z=e[28];const K=z,W=d!==null;I=vt,P=r,k=f,L=bt,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 ue;e[31]!==J?(ue=t.jsx(Nt,{children:J}),e[31]=J,e[32]=ue):ue=e[32];let le;e[33]!==a?(le=a("registry.csvImportDialog.description"),e[33]=a,e[34]=le):le=e[34];let se;e[35]!==le?(se=t.jsx(Ct,{children:le}),e[35]=le,e[36]=se):se=e[36],e[37]!==ue||e[38]!==se?(T=t.jsxs(wt,{children:[ue,se]}),e[37]=ue,e[38]=se,e[39]=T):T=e[39];let xe;e[40]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>x.current?.click(),e[40]=xe):xe=e[40];let me;e[41]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(os,{size:14}),e[41]=me):me=e[41];let oe;e[42]!==h||e[43]!==a?(oe=a(h?"registry.csvImportDialog.changeFile":"registry.csvImportDialog.chooseCsvFile"),e[42]=h,e[43]=a,e[44]=oe):oe=e[44];let re;e[45]!==c||e[46]!==oe?(re=t.jsxs(Q,{variant:"outline",size:"sm",className:"gap-1.5",onClick:xe,disabled:c,children:[me,oe]}),e[45]=c,e[46]=oe,e[47]=re):re=e[47];let w;e[48]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("input",{ref:x,type:"file",accept:".csv,text/csv",className:"hidden",onChange:ve=>v(ve.target.files?.[0]??null)}),e[48]=w):w=e[48];let B;e[49]!==h?(B=h&&t.jsx("span",{className:"text-sm text-muted-foreground truncate",children:h}),e[49]=h,e[50]=B):B=e[50];let X;e[51]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx("div",{className:"flex-1"}),e[51]=X):X=e[51];let ne;e[52]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(ar,{size:14}),e[52]=ne):ne=e[52];let ce;e[53]!==a?(ce=a("registry.csvImportDialog.downloadTemplate"),e[53]=a,e[54]=ce):ce=e[54];let ie;e[55]!==ce?(ie=t.jsxs(Q,{variant:"ghost",size:"sm",className:"gap-1.5 text-xs text-muted-foreground",onClick:Zr,children:[ne,ce]}),e[55]=ce,e[56]=ie):ie=e[56];let Se;e[57]!==re||e[58]!==B||e[59]!==ie?(Se=t.jsxs("div",{className:"flex items-center gap-3",children:[re,w,B,X,ie]}),e[57]=re,e[58]=B,e[59]=ie,e[60]=Se):Se=e[60];let O;e[61]!==a||e[62]!==j?(O=j.length>0&&t.jsx("div",{className:"rounded-lg border border-warning/20 bg-warning/10 p-3 grid gap-1",children:j.map((ve,gt)=>t.jsxs("p",{className:"text-xs text-warning flex items-start gap-1.5",children:[t.jsx(st,{size:12,className:"shrink-0 mt-0.5"}),t.jsxs("span",{children:[ve.line>0&&t.jsx("span",{className:"font-mono text-[10px] mr-1",children:a("registry.csvImportDialog.linePrefix",{line:ve.line})}),ve.message]})]},`${ve.line}-${gt}`))}),e[61]=a,e[62]=j,e[63]=O):O=e[63];const pe=U.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(H,{variant:"secondary",children:a("registry.csvImportDialog.itemsCount",{count:U.length})}),o?.skipped?t.jsx(H,{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($t,{children:[t.jsx(zt,{children:t.jsxs(Je,{children:[t.jsx(he,{className:"w-[140px]",children:a("registry.csvImportDialog.tableIdHeader")}),t.jsx(he,{children:a("registry.csvImportDialog.tableTitleHeader")}),t.jsx(he,{children:a("registry.csvImportDialog.tableUrlHeader")}),t.jsx(he,{className:"w-[80px] text-center",children:a("registry.csvImportDialog.tablePublicHeader")}),t.jsx(he,{children:a("registry.csvImportDialog.tableTagsHeader")})]})}),t.jsx(Ot,{children:U.map(ve=>t.jsxs(Je,{children:[t.jsx(fe,{className:"font-mono text-xs",children:ve.id}),t.jsx(fe,{className:"text-sm",children:ve.title}),t.jsx(fe,{className:"text-xs text-muted-foreground max-w-[200px] truncate",children:ve.server.remotes?.[0]?.url??t.jsx("span",{className:"italic",children:a("registry.csvImportDialog.tableNoneValue")})}),t.jsx(fe,{className:"text-center",children:ve.is_public?t.jsx(H,{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(fe,{className:"text-xs text-muted-foreground",children:(Ie(ve._meta)?.tags??[]).join(", ")||"-"})]},ve.id))})]})})})]});let Ce;e[64]!==d||e[65]!==a?(Ce=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(ei)})]}),e[64]=d,e[65]=a,e[66]=Ce):Ce=e[66];let Re;e[67]!==W||e[68]!==o||e[69]!==a?(Re=!o&&!W&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[t.jsx(os,{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]=W,e[68]=o,e[69]=a,e[70]=Re):Re=e[70],e[71]!==Se||e[72]!==O||e[73]!==pe||e[74]!==Ce||e[75]!==Re?(R=t.jsxs("div",{className:"flex-1 overflow-y-auto grid gap-4 pr-1",children:[Se,O,pe,Ce,Re]}),e[71]=Se,e[72]=O,e[73]=pe,e[74]=Ce,e[75]=Re,e[76]=R):R=e[76],b=_t,E="gap-2 sm:gap-0";let $e;e[77]!==f?($e=()=>f(!1),e[77]=f,e[78]=$e):$e=e[78];let ze;e[79]!==W||e[80]!==a?(ze=a(W?"registry.csvImportDialog.doneButton":"registry.csvImportDialog.cancelButton"),e[79]=W,e[80]=a,e[81]=ze):ze=e[81],e[82]!==$e||e[83]!==ze?(D=t.jsx(Q,{variant:"outline",onClick:$e,children:ze}),e[82]=$e,e[83]=ze,e[84]=D):D=e[84],N=!W&&t.jsx(Q,{onClick:_,disabled:c||U.length===0||K,children:c?a("registry.csvImportDialog.importingButton"):a("registry.csvImportDialog.importButton",{count:U.length})}),e[6]=h,e[7]=_,e[8]=f,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]=R,e[18]=P,e[19]=k,e[20]=E,e[21]=D,e[22]=N,e[23]=S,e[24]=T}else b=e[14],L=e[15],I=e[16],R=e[17],P=e[18],k=e[19],E=e[20],D=e[21],N=e[22],S=e[23],T=e[24];let $;e[85]!==b||e[86]!==E||e[87]!==D||e[88]!==N?($=t.jsxs(b,{className:E,children:[D,N]}),e[85]=b,e[86]=E,e[87]=D,e[88]=N,e[89]=$):$=e[89];let M;e[90]!==L||e[91]!==R||e[92]!==$||e[93]!==S||e[94]!==T?(M=t.jsxs(L,{className:S,children:[T,R,$]}),e[90]=L,e[91]=R,e[92]=$,e[93]=S,e[94]=T,e[95]=M):M=e[95];let A;return e[96]!==I||e[97]!==P||e[98]!==k||e[99]!==M?(A=t.jsx(I,{open:P,onOpenChange:k,children:M}),e[96]=I,e[97]=P,e[98]=k,e[99]=M,e[100]=A):A=e[100],A}function ei(s){return t.jsxs("p",{className:"text-xs text-destructive flex items-start gap-1.5",children:[t.jsx(st,{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 ti(s){return s.message.startsWith("Missing required column:")}function si(s){const e=Z.c(34),{open:r,onOpenChange:i,title:n,isDeleting:l,onConfirm:c}=s,a=l===void 0?!1:l,o=de();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(rt,{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 h;e[7]!==m?(h=t.jsx(it,{children:m}),e[7]=m,e[8]=h):h=e[8];let g;e[9]!==d||e[10]!==h?(g=t.jsxs(nt,{children:[d,h]}),e[9]=d,e[10]=h,e[11]=g):g=e[11];let x;e[12]!==o?(x=o("registry.deleteConfirmDialog.cancel"),e[12]=o,e[13]=x):x=e[13];let p;e[14]!==a||e[15]!==x?(p=t.jsx(ot,{disabled:a,children:x}),e[14]=a,e[15]=x,e[16]=p):p=e[16];let f;e[17]!==a||e[18]!==o?(f=o(a?"registry.deleteConfirmDialog.deleting":"registry.deleteConfirmDialog.delete"),e[17]=a,e[18]=o,e[19]=f):f=e[19];let y;e[20]!==a||e[21]!==c||e[22]!==f?(y=t.jsx(at,{disabled:a,onClick:c,children:f}),e[20]=a,e[21]=c,e[22]=f,e[23]=y):y=e[23];let v;e[24]!==y||e[25]!==p?(v=t.jsxs(lt,{children:[p,y]}),e[24]=y,e[25]=p,e[26]=v):v=e[26];let C;e[27]!==v||e[28]!==g?(C=t.jsxs(ct,{children:[g,v]}),e[27]=v,e[28]=g,e[29]=C):C=e[29];let _;return e[30]!==i||e[31]!==r||e[32]!==C?(_=t.jsx(dt,{open:r,onOpenChange:i,children:C}),e[30]=i,e[31]=r,e[32]=C,e[33]=_):_=e[33],_}function ri(s){const[e]=s.id.split("/");return e??"provider"}function ii(s){return Ie(s._meta)?.tags??[]}function ni(s){return Ie(s._meta)?.categories??[]}function oi(s){return s.server?.icons?.[0]?.src??null}function ai(s){const e=Z.c(109),{item:r,onEdit:i,onDelete:n,onToggleVerified:l,onToggleOfficial:c}=s,a=de();let o;e[0]!==r?(o=oi(r),e[0]=r,e[1]=o):o=e[1];const u=o;let d;e[2]!==r._meta?(d=Ie(r._meta),e[2]=r._meta,e[3]=d):d=e[3];const m=d,h=m?.verified===!0,g=m?.official===!0;let x;e[4]!==r?(x=[...ii(r),...ni(r)],e[4]=r,e[5]=x):x=e[5];const p=x;let f;e[6]!==p?(f=p.slice(0,3),e[6]=p,e[7]=f):f=e[7];const y=f,v=Math.max(0,p.length-y.length);let C;e[8]!==u||e[9]!==r.title?(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: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[8]=u,e[9]=r.title,e[10]=C):C=e[10];let _;e[11]!==r.title?(_=t.jsx("p",{className:"font-medium truncate",children:r.title}),e[11]=r.title,e[12]=_):_=e[12];let b;e[13]!==r?(b=ri(r),e[13]=r,e[14]=b):b=e[14];let L;e[15]!==b?(L=t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b}),e[15]=b,e[16]=L):L=e[16];let I;e[17]!==r.is_public||e[18]!==a?(I=r.is_public?t.jsxs(H,{variant:"default",className:"gap-1",children:[t.jsx(fs,{size:10}),a("registry.registryItemCard.public")]}):t.jsx(H,{variant:"secondary",children:a("registry.registryItemCard.private")}),e[17]=r.is_public,e[18]=a,e[19]=I):I=e[19];let R;e[20]!==g||e[21]!==a?(R=g&&t.jsxs(H,{variant:"outline",className:"gap-1 text-primary",children:[t.jsx(ss,{size:10}),a("registry.registryItemCard.official")]}),e[20]=g,e[21]=a,e[22]=R):R=e[22];let P;e[23]!==g||e[24]!==h||e[25]!==a?(P=!g&&h&&t.jsxs(H,{variant:"outline",className:"gap-1 text-success",children:[t.jsx(ss,{size:10}),a("registry.registryItemCard.verified")]}),e[23]=g,e[24]=h,e[25]=a,e[26]=P):P=e[26];let k;e[27]!==R||e[28]!==P||e[29]!==L||e[30]!==I?(k=t.jsxs("div",{className:"flex items-center gap-2",children:[L,I,R,P]}),e[27]=R,e[28]=P,e[29]=L,e[30]=I,e[31]=k):k=e[31];let E;e[32]!==k||e[33]!==_?(E=t.jsxs("div",{className:"min-w-0 flex-1",children:[_,k]}),e[32]=k,e[33]=_,e[34]=E):E=e[34];let D;e[35]!==E||e[36]!==C?(D=t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[C,E]}),e[35]=E,e[36]=C,e[37]=D):D=e[37];let N;e[38]!==r.title||e[39]!==a?(N=a("registry.registryItemCard.actionsFor",{title:r.title}),e[38]=r.title,e[39]=a,e[40]=N):N=e[40];let S;e[41]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Bt,{size:18}),e[41]=S):S=e[41];let T;e[42]!==N?(T=t.jsx(ft,{asChild:!0,children:t.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0","aria-label":N,children:S})}),e[42]=N,e[43]=T):T=e[43];let $;e[44]!==r||e[45]!==i?($=()=>i(r),e[44]=r,e[45]=i,e[46]=$):$=e[46];let M;e[47]!==a?(M=a("registry.registryItemCard.edit"),e[47]=a,e[48]=M):M=e[48];let A;e[49]!==$||e[50]!==M?(A=t.jsx(ke,{onClick:$,children:M}),e[49]=$,e[50]=M,e[51]=A):A=e[51];let U;e[52]!==r||e[53]!==l?(U=()=>l(r),e[52]=r,e[53]=l,e[54]=U):U=e[54];let F;e[55]!==h||e[56]!==a?(F=a(h?"registry.registryItemCard.unmarkAsVerified":"registry.registryItemCard.markAsVerified"),e[55]=h,e[56]=a,e[57]=F):F=e[57];let j;e[58]!==U||e[59]!==F?(j=t.jsx(ke,{onClick:U,children:F}),e[58]=U,e[59]=F,e[60]=j):j=e[60];let z;e[61]!==r||e[62]!==c?(z=()=>c(r),e[61]=r,e[62]=c,e[63]=z):z=e[63];let K;e[64]!==g||e[65]!==a?(K=a(g?"registry.registryItemCard.unmarkAsOfficial":"registry.registryItemCard.markAsOfficial"),e[64]=g,e[65]=a,e[66]=K):K=e[66];let W;e[67]!==z||e[68]!==K?(W=t.jsx(ke,{onClick:z,children:K}),e[67]=z,e[68]=K,e[69]=W):W=e[69];let J;e[70]!==r||e[71]!==n?(J=()=>n(r),e[70]=r,e[71]=n,e[72]=J):J=e[72];let ue;e[73]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(ut,{size:14}),e[73]=ue):ue=e[73];let le;e[74]!==a?(le=a("registry.registryItemCard.delete"),e[74]=a,e[75]=le):le=e[75];let se;e[76]!==J||e[77]!==le?(se=t.jsxs(ke,{variant:"destructive",onClick:J,children:[ue,le]}),e[76]=J,e[77]=le,e[78]=se):se=e[78];let xe;e[79]!==A||e[80]!==j||e[81]!==W||e[82]!==se?(xe=t.jsxs(yt,{align:"end",children:[A,j,W,se]}),e[79]=A,e[80]=j,e[81]=W,e[82]=se,e[83]=xe):xe=e[83];let me;e[84]!==T||e[85]!==xe?(me=t.jsxs(jt,{children:[T,xe]}),e[84]=T,e[85]=xe,e[86]=me):me=e[86];let oe;e[87]!==D||e[88]!==me?(oe=t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[D,me]}),e[87]=D,e[88]=me,e[89]=oe):oe=e[89];let re;e[90]!==r.description||e[91]!==r.server||e[92]!==m?.short_description||e[93]!==a?(re=m?.short_description||r.description||r.server.description||a("registry.registryItemCard.noDescriptionProvided"),e[90]=r.description,e[91]=r.server,e[92]=m?.short_description,e[93]=a,e[94]=re):re=e[94];let w;e[95]!==re?(w=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 min-h-10",children:re}),e[95]=re,e[96]=w):w=e[96];let B;e[97]!==r.id||e[98]!==y?(B=y.map(ie=>t.jsx(H,{variant:"secondary",children:ie},`${r.id}-badge-${ie}`)),e[97]=r.id,e[98]=y,e[99]=B):B=e[99];let X;e[100]!==v?(X=v>0&&t.jsxs(H,{variant:"outline",children:["+",v]}),e[100]=v,e[101]=X):X=e[101];let ne;e[102]!==B||e[103]!==X?(ne=t.jsxs("div",{className:"flex flex-wrap gap-1",children:[B,X]}),e[102]=B,e[103]=X,e[104]=ne):ne=e[104];let ce;return e[105]!==oe||e[106]!==w||e[107]!==ne?(ce=t.jsxs(ge,{className:"p-4 gap-4 transition-colors hover:bg-muted/50",children:[oe,w,ne]}),e[105]=oe,e[106]=w,e[107]=ne,e[108]=ce):ce=e[108],ce}function ws(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=de(),[d,m]=q.useState(!1),[h,g]=q.useState(!1),x=q.useRef(null);let p;e[0]!==o?(p=S=>{S.preventDefault(),o||m(!0)},e[0]=o,e[1]=p):p=e[1];const f=p;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=S=>{S.preventDefault(),m(!1)},e[2]=y):y=e[2];const v=y;let C;e[3]!==o||e[4]!==l?(C=async S=>{if(S.preventDefault(),m(!1),o)return;const T=S.dataTransfer.files[0];T&&await l(T)},e[3]=o,e[4]=l,e[5]=C):C=e[5];const _=C;let b;e[6]!==o||e[7]!==l?(b=async S=>{const T=S.target.files?.[0];T&&!o&&await l(T),S.target.value=""},e[6]=o,e[7]=l,e[8]=b):b=e[8];const L=b,I=r.length>0;let R;e[9]!==u?(R=u("registry.imageUpload.image"),e[9]=u,e[10]=R):R=e[10];let P;e[11]!==R?(P=t.jsx(ae,{children:R}),e[11]=R,e[12]=P):P=e[12];let k;e[13]!==f||e[14]!==_||e[15]!==I||e[16]!==d||e[17]!==o||e[18]!==n||e[19]!==i||e[20]!==h||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(Q,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>x.current?.click(),disabled:o,children:[t.jsx(Ft,{className:"size-3"}),u("registry.imageUpload.change")]}),t.jsxs(Q,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 text-destructive hover:text-destructive",onClick:()=>{i(""),g(!1)},disabled:o,children:[t.jsx(ut,{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:f,onDragLeave:v,onDrop:_,onClick:()=>x.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(Xs,{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")})]})]}),h?t.jsx("div",{className:"border-t border-border px-3 py-2",onClick:li,children:t.jsx(je,{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(),g(!0)},children:[t.jsx(xr,{className:"size-3"}),u("registry.imageUpload.orPasteImageUrl")]})})]}),e[13]=f,e[14]=_,e[15]=I,e[16]=d,e[17]=o,e[18]=n,e[19]=i,e[20]=h,e[21]=u,e[22]=r,e[23]=k):k=e[23];let E;e[24]!==L?(E=t.jsx("input",{ref:x,type:"file",accept:"image/*",className:"hidden",onChange:L}),e[24]=L,e[25]=E):E=e[25];let D;e[26]!==c?(D=c&&t.jsx("p",{className:"text-xs text-destructive",children:c}),e[26]=c,e[27]=D):D=e[27];let N;return e[28]!==D||e[29]!==P||e[30]!==k||e[31]!==E?(N=t.jsxs("div",{className:"grid gap-1.5",children:[P,k,E,D]}),e[28]=D,e[29]=P,e[30]=k,e[31]=E,e[32]=N):N=e[32],N}function li(s){return s.stopPropagation()}function _s(){const[s,e]=q.useState("idle"),[r,i]=q.useState(null),n=Me();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?ci(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 ci(s){const e=s.toLowerCase();return e.includes("authentication")||e.includes("unauthorized")||e.includes("credentials")}function di(s){const e=Z.c(62),{tools:r,onChange:i,remoteUrl:n,remoteType:l,externalDiscoverStatus:c,externalDiscoverError:a}=s,o=de(),[u,d]=q.useState(r.length>0),{discover:m,discoverStatus:h,discoverError:g,resetDiscover:x}=_s(),p=c??h,f=a??g;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 v=y;let C;e[5]!==i||e[6]!==x?(C=()=>{i([]),x()},e[5]=i,e[6]=x,e[7]=C):C=e[7];const _=C;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(ps,{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 R;e[13]!==I?(R=t.jsx("span",{children:I}),e[13]=I,e[14]=R):R=e[14];let P;e[15]!==r.length?(P=r.length>0&&t.jsx(H,{variant:"secondary",className:"text-xs px-1.5 py-0",children:r.length}),e[15]=r.length,e[16]=P):P=e[16];let k;e[17]!==u?(k=u?t.jsx(jr,{size:14,className:"text-muted-foreground"}):t.jsx(yr,{size:14,className:"text-muted-foreground"}),e[17]=u,e[18]=k):k=e[18];let E;e[19]!==b||e[20]!==R||e[21]!==P||e[22]!==k?(E=t.jsxs("button",{type:"button",className:"flex items-center gap-2 text-sm font-medium cursor-pointer",onClick:b,children:[L,R,P,k]}),e[19]=b,e[20]=R,e[21]=P,e[22]=k,e[23]=E):E=e[23];let D;e[24]!==_||e[25]!==o||e[26]!==r.length?(D=r.length>0&&t.jsxs(Q,{type:"button",variant:"ghost",size:"sm",className:"h-7 text-xs gap-1.5 text-muted-foreground",onClick:_,children:[t.jsx(ut,{size:12}),o("registry.toolsEditor.clear")]}),e[24]=_,e[25]=o,e[26]=r.length,e[27]=D):D=e[27];let N;e[28]!==p||e[29]!==v||e[30]!==n||e[31]!==o||e[32]!==r.length?(N=n&&t.jsxs(Q,{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:v,disabled:p==="loading",children:[p==="loading"?t.jsx(Ye,{size:12,className:"animate-spin"}):t.jsx(Ft,{size:12}),p==="loading"?o("registry.toolsEditor.discovering"):r.length>0?o("registry.toolsEditor.refresh"):o("registry.toolsEditor.autoDiscover")]}),e[28]=p,e[29]=v,e[30]=n,e[31]=o,e[32]=r.length,e[33]=N):N=e[33];let S;e[34]!==D||e[35]!==N?(S=t.jsxs("div",{className:"flex items-center gap-2",children:[D,N]}),e[34]=D,e[35]=N,e[36]=S):S=e[36];let T;e[37]!==S||e[38]!==E?(T=t.jsxs("div",{className:"flex items-center justify-between",children:[E,S]}),e[37]=S,e[38]=E,e[39]=T):T=e[39];let $;e[40]!==p||e[41]!==o||e[42]!==r.length?($=p==="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]=p,e[41]=o,e[42]=r.length,e[43]=$):$=e[43];let M;e[44]!==f||e[45]!==p?(M=p==="error"&&f&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-destructive bg-destructive/10 rounded-lg px-3 py-2",children:[t.jsx(st,{size:14,className:"shrink-0"}),t.jsx("span",{children:f})]}),e[44]=f,e[45]=p,e[46]=M):M=e[46];let A;e[47]!==u||e[48]!==r?(A=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(ui)}),e[47]=u,e[48]=r,e[49]=A):A=e[49];let U;e[50]!==p||e[51]!==u||e[52]!==n||e[53]!==o||e[54]!==r.length?(U=u&&r.length===0&&p==="idle"&&t.jsx("p",{className:"text-xs text-muted-foreground px-1",children:o(n?"registry.toolsEditor.emptyHintWithUrl":"registry.toolsEditor.emptyHintWithoutUrl")}),e[50]=p,e[51]=u,e[52]=n,e[53]=o,e[54]=r.length,e[55]=U):U=e[55];let F;return e[56]!==T||e[57]!==$||e[58]!==M||e[59]!==A||e[60]!==U?(F=t.jsxs("div",{className:"space-y-3",children:[T,$,M,A,U]}),e[56]=T,e[57]=$,e[58]=M,e[59]=A,e[60]=U,e[61]=F):F=e[61],F}function ui(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 Ps(s){const{org:e}=Ne(),[r,i]=q.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 V.error("Image upload requires an object-storage connection. Configure one in plugin settings."),null;if(!o.type.startsWith("image/"))return V.error("Only image files are supported"),null;if(o.size>5*1024*1024)return V.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 h=await fetch(m,{method:"PUT",body:o,headers:{"Content-Type":o.type}});if(!h.ok)throw new Error(`Upload failed: ${h.statusText}`);const g=await c.callTool({name:"GET_PRESIGNED_URL",arguments:{key:u,expiresIn:31536e3}}),x=g.structuredContent?.url||g.url;if(!x)throw new Error("Failed to get public URL");return x}catch(d){return console.error("Image upload failed:",d),V.error(d instanceof Error?d.message:"Failed to upload image. Please try again."),null}finally{i(!1)}},isUploading:r}}const mi=new Set(["http","sse","stdio"]),gi=/^[a-z0-9]+(?:[/-][a-z0-9._-]+)*$/,xi=["internal","automation","support","sales","ops","ai"],pi=["productivity","communication","customer-support","development","data","operations"],hi=["registry.registryItemDialog.essentials","registry.registryItemDialog.details","registry.registryItemDialog.advanced"],fi="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 us(s){return s.replace(/^https?:\/\//i,"").trim()}function tt(s){const e=s.trim();return e?/^https?:\/\//i.test(e)?e:`https://${e}`:""}function Qe(s){return s.trim().toLowerCase()}function It(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 yi(s){const e=Z.c(5),{current:r}=s,i=de();let n;e[0]!==r||e[1]!==i?(n=hi.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 ji(s){const e=Z.c(32),{id:r,labelKey:i,values:n,availableOptions:l,placeholderKey:c,onChange:a}=s,o=de(),[u,d]=q.useState(""),[m,h]=q.useState(!1);let g,x,p,f,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 _=It(l),b=It(n),L=new Set(b),I=Qe(u),R=_.filter(M=>!L.has(M)).filter(M=>I?M.includes(I):!0).slice(0,8),P=M=>{const A=Qe(M);!A||L.has(A)||a([...b,A])},k=M=>{a(b.filter(A=>A!==M))},E=()=>{const M=u.split(/[,\n;]/).map(Qe).filter(Boolean);if(M.length===0)return;const A=[...b];for(const U of M)A.includes(U)||A.push(U);a(A),d("")},D=I;f="grid gap-2";let N;e[14]!==i||e[15]!==o?(N=o(i),e[14]=i,e[15]=o,e[16]=N):N=e[16],e[17]!==r||e[18]!==N?(y=t.jsx(ae,{htmlFor:r,children:N}),e[17]=r,e[18]=N,e[19]=y):y=e[19],g="relative";let S;e[20]!==r?(S=()=>{const M=document.getElementById(r);M instanceof HTMLInputElement&&M.focus()},e[20]=r,e[21]=S):S=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=()=>h(!0),e[22]=T):T=e[22];let $;e[23]===Symbol.for("react.memo_cache_sentinel")?($=M=>d(M.target.value),e[23]=$):$=e[23],x=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(M=>t.jsxs(H,{variant:"secondary",className:"gap-1",children:[M,t.jsx("button",{type:"button",onClick:A=>{A.preventDefault(),A.stopPropagation(),k(M)},children:t.jsx(fr,{size:12})})]},`${r}-${M}`)),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:T,onBlur:()=>{h(!1),E()},onChange:$,onKeyDown:M=>{if(M.key==="Enter"||M.key===","){M.preventDefault(),E();return}M.key==="Backspace"&&!u&&b.length&&k(b[b.length-1]??"")}})]})}),p=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:R.length>0?R.map(M=>t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:bi,onClick:()=>{P(M),d("")},children:M},`${r}-suggestion-${M}`)):D?t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:vi,onClick:()=>{P(D),d("")},children:o("registry.registryItemDialog.createTag",{value:D})}):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]=g,e[10]=x,e[11]=p,e[12]=f,e[13]=y}else g=e[9],x=e[10],p=e[11],f=e[12],y=e[13];let v;e[24]!==g||e[25]!==x||e[26]!==p?(v=t.jsxs("div",{className:g,children:[x,p]}),e[24]=g,e[25]=x,e[26]=p,e[27]=v):v=e[27];let C;return e[28]!==f||e[29]!==y||e[30]!==v?(C=t.jsxs("div",{className:f,children:[y,v]}),e[28]=f,e[29]=y,e[30]=v,e[31]=C):C=e[31],C}function vi(s){return s.preventDefault()}function bi(s){return s.preventDefault()}function Ni({id:s,value:e,availableOptions:r,onChange:i}){const n=de(),[l,c]=q.useState(e),[a,o]=q.useState(!1),u=q.useRef(e);u.current!==e&&(u.current=e,c(e));const d=It([...pi,...r,e]).filter(Boolean),m=Qe(l),h=d.filter(x=>m?x.includes(m):!0).slice(0,8),g=x=>{const p=Qe(x);i(p),c(p),o(!1)};return t.jsxs("div",{className:"grid gap-2",children:[t.jsx(ae,{htmlFor:s,children:n("registry.registryItemDialog.category")}),t.jsxs("div",{className:"relative",children:[t.jsx(je,{id:s,className:"h-9 text-sm",placeholder:n("registry.registryItemDialog.selectOrCreateCategory"),value:l,onFocus:()=>{c(e),o(!0)},onBlur:()=>{g(l)},onChange:x=>c(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),g(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:x=>x.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:h.length>0?h.map(x=>t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:p=>p.preventDefault(),onClick:()=>g(x),children:x},`${s}-${x}`)):m?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:()=>g(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 Ci({open:s,onOpenChange:e,item:r,draft:i,availableTags:n=[],availableCategories:l=[],isSubmitting:c=!1,onSubmit:a}){const o=de(),{org:u}=Ne(),{uploadImage:d,isUploading:m}=Ps(),{discover:h,discoverStatus:g,discoverError:x,resetDiscover:p}=_s(),f=!!r,y=Ie(r?._meta),v=Ie(i?._meta),C=r?.title??i?.title??"",_=r?.id?.split("/")[0]??i?.id?.split("/")[0]??"",b=r?.description??i?.description??"",L=y?.short_description??v?.short_description??"",I=y?.owner??v?.owner??"",R=r?.server?.repository?.url??i?.server?.repository?.url??"",P=y?.readme??v?.readme??"",k=y?.readme_url??v?.readme_url??"",E=us(r?.server?.remotes?.[0]?.url??i?.server?.remotes?.[0]?.url??""),D=r?.server?.remotes?.[0]?.type??i?.server?.remotes?.[0]?.type??"http",N=y?.tags??v?.tags??[],S=y?.categories?.[0]??v?.categories?.[0]??"",T=r?.server?.icons?.[0]?.src??i?.server?.icons?.[0]?.src??"",$=y?.tools??v?.tools??[],M=r?.is_public??i?.is_public??!1,A=y?.verified??v?.verified??!1,U=y?.official??v?.official??!1,[F,j]=q.useState(1),[z,K]=q.useState(C),[W,J]=q.useState(_),[ue,le]=q.useState(b),[se,xe]=q.useState(L),[me,oe]=q.useState(I),[re,w]=q.useState(R),[B,X]=q.useState(P),[ne,ce]=q.useState(k),[ie,Se]=q.useState(P?"content":"link"),[O,pe]=q.useState(E),[Ce,Re]=q.useState(D),[$e,ze]=q.useState(N),[ve,gt]=q.useState(S),[Ze,St]=q.useState(T),[De,xt]=q.useState($),[Vt,Gt]=q.useState(M),[Qt,Yt]=q.useState(A),[Wt,Jt]=q.useState(U),[ye,Xe]=q.useState({}),Zt=()=>{j(1),K(C),J(_),le(b),xe(L),oe(I),w(R),X(P),ce(k),Se(P?"content":"link"),pe(E),Re(D),ze(N),gt(S),St(T),xt($),Gt(M),Yt(A),Jt(U),Xe({}),p(),pt.current="",we.current&&(clearTimeout(we.current),we.current=null)},Ds=async G=>{if(!G)return;const ee=f?r?.id:`${W}/${z}`.toLowerCase(),_e=Ke(ee||"temp"),qe=G.name.split(".").pop()||"png",Ee=`registry/${u.id}/${_e}/icon.${qe}`,Be=await d(G,Ee);Be?(St(Be),Xe(Le=>({...Le,imageUrl:void 0}))):Xe(Le=>({...Le,imageUrl:o("registry.registryItemDialog.failedToUploadImage")}))},we=q.useRef(null),pt=q.useRef(""),Dt=q.useRef(Ce);Dt.current=Ce;const Xt=G=>{!G&&we.current&&(clearTimeout(we.current),we.current=null),e(G),G||Zt()},Ts=async()=>{const G=tt(O);if(!G)return;we.current&&(clearTimeout(we.current),we.current=null),pt.current=G;const ee=await h(G,Dt.current);ee&&xt(ee)},Ms=G=>{we.current&&clearTimeout(we.current);const ee=tt(G);!ee||ee===pt.current||G.includes(".")&&(we.current=setTimeout(async()=>{pt.current=ee;const _e=await h(ee,Dt.current);_e&&xt(_e)},800))},es=G=>{const ee={};if(G===1){const _e=Ke(W),qe=Ke(z),Ee=`${_e}/${qe}`;z.trim()||(ee.title=o("registry.registryItemDialog.nameIsRequired")),f||(_e?qe?gi.test(Ee)||(ee.provider=o("registry.registryItemDialog.useValidIdFormat")):ee.title=o("registry.registryItemDialog.nameMustContainValidCharacters"):ee.provider=o("registry.registryItemDialog.providerIsRequired"));const Be=tt(O),Le=Ce.trim().toLowerCase();if(Le!=="stdio"&&Be)try{const et=new URL(Be);["http:","https:"].includes(et.protocol)||(ee.remoteUrl=o("registry.registryItemDialog.remoteUrlMustBeHttps"))}catch{ee.remoteUrl=o("registry.registryItemDialog.remoteUrlIsInvalid")}if(Le&&!mi.has(Le)&&(ee.remoteType=o("registry.registryItemDialog.remoteTypeMustBe")),Ze.trim()&&!Ze.trim().startsWith("data:image/"))try{const Tt=new URL(Ze.trim());["http:","https:"].includes(Tt.protocol)||(ee.imageUrl=o("registry.registryItemDialog.imageUrlMustBeHttps"))}catch{ee.imageUrl=o("registry.registryItemDialog.imageUrlIsInvalid")}}if(G===2&&(ue.length>1500&&(ee.description=o("registry.registryItemDialog.descriptionMaxLength")),se.trim().length>160&&(ee.shortDescription=o("registry.registryItemDialog.shortDescriptionMaxLength"))),G===3){const _e=ne.trim();if(_e)try{const Ee=new URL(_e);["http:","https:"].includes(Ee.protocol)||(ee.readmeUrl=o("registry.registryItemDialog.readmeUrlMustBeHttps"))}catch{ee.readmeUrl=o("registry.registryItemDialog.readmeUrlIsInvalid")}B.trim().length>5e4&&(ee.readme=o("registry.registryItemDialog.readmeMaxLength"));const qe=re.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 Xe(ee),Object.values(ee).every(_e=>_e===void 0)},qs=()=>{es(F)&&(F===1&&we.current&&(clearTimeout(we.current),we.current=null),F<3&&j(F+1))},Es=()=>{F>1&&j(F-1)},Ls=async()=>{if(!es(3))return;const G=z.trim(),ee=Ke(W),_e=Ke(G),qe=`${ee}/${_e}`,Ee=tt(O),Be=Ce.trim().toLowerCase(),Le=Ze.trim(),et=re.trim(),Tt=se.trim(),$s=B.trim(),zs=ne.trim(),Os=It($e),Bs=ve?[Qe(ve)]:[],Ks=r?r.server?.name??r.id:"",Hs=(f?Ks:qe).trim(),Mt=ue.trim(),Vs=me.trim(),ts={title:G,description:Mt.length>0?Mt:null,is_public:Vt,_meta:Pt(void 0,{verified:Qt,official:Wt,tags:Os,categories:Bs,short_description:Tt||null,owner:Vs||null,readme:$s||null,readme_url:zs||null,...De.length>0?{tools:De}:{}}),server:{name:Hs,title:G,description:Mt||void 0,icons:Le?[{src:Le}]:[],repository:et?{url:et}:void 0,remotes:Ee?[{type:Be||"http",url:Ee}]:[]}};if(f&&r){await a({id:r.id,data:ts}),e(!1);return}await a({id:qe,...ts}),e(!1),Zt()},As=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(ae,{htmlFor:"registry-item-provider",children:o("registry.registryItemDialog.provider")}),t.jsx(je,{id:"registry-item-provider",className:"h-9 text-sm",placeholder:"acme",value:W,onChange:G=>J(G.target.value),disabled:f}),!f&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[o("registry.registryItemDialog.itemId")," ",t.jsx("span",{className:"font-mono",children:`${Ke(W)||"provider"}/${Ke(z)||"name"}`})]}),ye.provider&&t.jsx("p",{className:"text-xs text-destructive",children:ye.provider})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{htmlFor:"registry-item-title",children:o("registry.registryItemDialog.name")}),t.jsx(je,{id:"registry-item-title",className:"h-9 text-sm",placeholder:"Internal MCP",value:z,onChange:G=>K(G.target.value)}),ye.title&&t.jsx("p",{className:"text-xs text-destructive",children:ye.title})]})]}),t.jsx("div",{className:"row-span-2 content-start",children:t.jsx(ws,{value:Ze,onChange:G=>{St(G),Xe(ee=>({...ee,imageUrl:void 0}))},onFileUpload:Ds,error:ye.imageUrl,isUploading:m})}),t.jsxs("div",{className:"col-span-2 grid gap-1.5",children:[t.jsx(ae,{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:O,onChange:G=>{const ee=us(G.target.value);pe(ee),Ms(ee)}})]}),t.jsxs(cr,{value:Ce,onValueChange:Re,children:[t.jsx(dr,{id:"registry-remote-type",className:"w-[90px] h-9 shrink-0",children:t.jsx(ur,{placeholder:o("registry.registryItemDialog.type")})}),t.jsxs(mr,{children:[t.jsx(qt,{value:"http",children:"http"}),t.jsx(qt,{value:"sse",children:"sse"}),t.jsx(qt,{value:"stdio",children:"stdio"})]})]})]}),ye.remoteUrl&&t.jsx("p",{className:"text-xs text-destructive",children:ye.remoteUrl}),ye.remoteType&&t.jsx("p",{className:"text-xs text-destructive",children:ye.remoteType})]}),O.trim()&&t.jsxs("div",{className:"col-span-2 space-y-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(Q,{type:"button",variant:"outline",size:"sm",className:te(fi,"gap-1.5"),onClick:Ts,disabled:g==="loading",children:[g==="loading"?t.jsx(Ye,{size:12,className:"animate-spin"}):t.jsx(Ft,{size:12}),g==="loading"?o("registry.registryItemDialog.discoveringTools"):De.length>0?o("registry.registryItemDialog.rediscoverTools"):o("registry.registryItemDialog.discoverToolsFromUrl")]}),De.length>0&&g!=="loading"&&t.jsx("span",{className:"text-xs text-muted-foreground",children:o("registry.registryItemDialog.toolsLoaded",{count:De.length.toString()})})]}),g==="success"&&De.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:De.length.toString()})})]}),t.jsxs("div",{className:"flex flex-wrap gap-1",children:[De.slice(0,8).map(G=>t.jsx(H,{variant:"secondary",className:"text-[10px] px-1.5 py-0 font-mono",children:G.name},G.name)),De.length>8&&t.jsx("span",{className:"text-[10px] text-muted-foreground self-center",children:o("registry.registryItemDialog.andMore",{count:(De.length-8).toString()})})]}),t.jsx("p",{className:"text-[10px] text-muted-foreground",children:o("registry.registryItemDialog.toolsWillEnrich")})]}),g==="auth_required"&&x&&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(st,{size:14,className:"shrink-0"}),t.jsx("span",{children:o("registry.registryItemDialog.authRequiredMessage")})]}),g==="error"&&x&&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(st,{size:14,className:"shrink-0"}),t.jsx("span",{children:x})]})]})]}),Us=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(ae,{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(je,{id:"registry-item-short-description",className:"h-9 text-sm",placeholder:o("registry.registryItemDialog.shortSummaryForStoreCard"),value:se,maxLength:160,onChange:G=>xe(G.target.value)}),ye.shortDescription&&t.jsx("p",{className:"text-xs text-destructive",children:ye.shortDescription})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(ae,{htmlFor:"registry-item-description",children:o("registry.registryItemDialog.description")}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[ue.length,"/1500"]})]}),t.jsx(Rt,{id:"registry-item-description",className:"text-sm max-h-28 overflow-y-auto resize-none",placeholder:o("registry.registryItemDialog.briefDescription"),rows:2,value:ue,onChange:G=>le(G.target.value)}),ye.description&&t.jsx("p",{className:"text-xs text-destructive",children:ye.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(Ni,{id:"registry-category",value:ve,availableOptions:l,onChange:gt})}),t.jsx("div",{className:"grid content-start gap-2",children:t.jsx(ji,{id:"registry-tags",labelKey:"registry.registryItemDialog.tags",values:$e,availableOptions:[...xi,...n],placeholderKey:"registry.registryItemDialog.typeAndPressEnter",onChange:ze})})]}),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(ae,{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:Vt,onCheckedChange:Gt})]}),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(ae,{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:Qt,onCheckedChange:Yt})]}),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(ae,{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:Wt,onCheckedChange:Jt})]})]}),Fs=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(ae,{htmlFor:"registry-item-owner",children:o("registry.registryItemDialog.ownerOptional")}),t.jsx(je,{id:"registry-item-owner",className:"h-9 text-sm",placeholder:o("registry.registryItemDialog.teamCompanyOrPerson"),value:me,onChange:G=>oe(G.target.value)})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{htmlFor:"registry-item-repository-url",children:o("registry.registryItemDialog.repositoryUrlOptional")}),t.jsx(je,{id:"registry-item-repository-url",className:"h-9 text-sm",placeholder:"https://github.com/org/repo",value:re,onChange:G=>w(G.target.value)}),ye.repositoryUrl&&t.jsx("p",{className:"text-xs text-destructive",children:ye.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(ae,{children:o("registry.registryItemDialog.readme")}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[B.length,"/50000"]})]}),t.jsx("div",{className:"inline-flex rounded-lg border border-border p-0.5",children:["link","content"].map(G=>t.jsx("button",{type:"button",className:te("px-2.5 py-1 text-xs rounded-md",ie===G?"bg-primary text-primary-foreground":"text-muted-foreground"),onClick:()=>Se(G),children:o(G==="link"?"registry.registryItemDialog.link":"registry.registryItemDialog.content")},G))}),ie==="link"&&t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(je,{className:"h-9 text-sm",placeholder:"https://raw.githubusercontent.com/org/repo/main/README.md",value:ne,onChange:G=>ce(G.target.value)}),ye.readmeUrl&&t.jsx("p",{className:"text-xs text-destructive",children:ye.readmeUrl})]}),ie==="content"&&t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(Rt,{className:"text-sm max-h-48 overflow-y-auto resize-none",placeholder:`# README
25
+ another-server,Another Server,Another useful server,https://example2.com/mcp,http,data|analytics,data-processing,false`;function Zr(){const s=new Blob([Jr],{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 Xr(s){const e=Z.c(101),{open:r,onOpenChange:i,isImporting:n,onImport:l}=s,c=n===void 0?!1:n,a=de(),[o,u]=q.useState(null),[d,m]=q.useState(null),[h,g]=q.useState(null),x=q.useRef(null);let p;e[0]!==i?(p=U=>{i(U),U||(u(null),m(null),g(null),x.current&&(x.current.value=""))},e[0]=i,e[1]=p):p=e[1];const f=p;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=async U=>{if(!U)return;g(U.name),m(null);const F=await U.text();u(Wr(F))},e[2]=y):y=e[2];const v=y;let C;e[3]!==l||e[4]!==o?(C=async()=>{if(!o?.items.length)return;const U=await l(o.items);m(U)},e[3]=l,e[4]=o,e[5]=C):C=e[5];const _=C;let b,L,k,R,P,S,E,D,N,I,T;if(e[6]!==h||e[7]!==_||e[8]!==f||e[9]!==d||e[10]!==c||e[11]!==r||e[12]!==o||e[13]!==a){const U=o?.items??[];let F;e[25]!==o?.warnings?(F=o?.warnings??[],e[25]=o?.warnings,e[26]=F):F=e[26];const j=F;let z;e[27]!==j?(z=j.some(ti),e[27]=j,e[28]=z):z=e[28];const K=z,W=d!==null;k=vt,P=r,S=f,L=bt,I="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 ue;e[31]!==J?(ue=t.jsx(Nt,{children:J}),e[31]=J,e[32]=ue):ue=e[32];let le;e[33]!==a?(le=a("registry.csvImportDialog.description"),e[33]=a,e[34]=le):le=e[34];let se;e[35]!==le?(se=t.jsx(Ct,{children:le}),e[35]=le,e[36]=se):se=e[36],e[37]!==ue||e[38]!==se?(T=t.jsxs(wt,{children:[ue,se]}),e[37]=ue,e[38]=se,e[39]=T):T=e[39];let xe;e[40]===Symbol.for("react.memo_cache_sentinel")?(xe=()=>x.current?.click(),e[40]=xe):xe=e[40];let me;e[41]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(os,{size:14}),e[41]=me):me=e[41];let oe;e[42]!==h||e[43]!==a?(oe=a(h?"registry.csvImportDialog.changeFile":"registry.csvImportDialog.chooseCsvFile"),e[42]=h,e[43]=a,e[44]=oe):oe=e[44];let re;e[45]!==c||e[46]!==oe?(re=t.jsxs(Q,{variant:"outline",size:"sm",className:"gap-1.5",onClick:xe,disabled:c,children:[me,oe]}),e[45]=c,e[46]=oe,e[47]=re):re=e[47];let w;e[48]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("input",{ref:x,type:"file",accept:".csv,text/csv",className:"hidden",onChange:ve=>v(ve.target.files?.[0]??null)}),e[48]=w):w=e[48];let B;e[49]!==h?(B=h&&t.jsx("span",{className:"text-sm text-muted-foreground truncate",children:h}),e[49]=h,e[50]=B):B=e[50];let X;e[51]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx("div",{className:"flex-1"}),e[51]=X):X=e[51];let ne;e[52]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(ar,{size:14}),e[52]=ne):ne=e[52];let ce;e[53]!==a?(ce=a("registry.csvImportDialog.downloadTemplate"),e[53]=a,e[54]=ce):ce=e[54];let ie;e[55]!==ce?(ie=t.jsxs(Q,{variant:"ghost",size:"sm",className:"gap-1.5 text-xs text-muted-foreground",onClick:Zr,children:[ne,ce]}),e[55]=ce,e[56]=ie):ie=e[56];let Se;e[57]!==re||e[58]!==B||e[59]!==ie?(Se=t.jsxs("div",{className:"flex items-center gap-3",children:[re,w,B,X,ie]}),e[57]=re,e[58]=B,e[59]=ie,e[60]=Se):Se=e[60];let O;e[61]!==a||e[62]!==j?(O=j.length>0&&t.jsx("div",{className:"rounded-lg border border-warning/20 bg-warning/10 p-3 grid gap-1",children:j.map((ve,gt)=>t.jsxs("p",{className:"text-xs text-warning flex items-start gap-1.5",children:[t.jsx(st,{size:12,className:"shrink-0 mt-0.5"}),t.jsxs("span",{children:[ve.line>0&&t.jsx("span",{className:"font-mono text-[10px] mr-1",children:a("registry.csvImportDialog.linePrefix",{line:ve.line})}),ve.message]})]},`${ve.line}-${gt}`))}),e[61]=a,e[62]=j,e[63]=O):O=e[63];const pe=U.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(H,{variant:"secondary",children:a("registry.csvImportDialog.itemsCount",{count:U.length})}),o?.skipped?t.jsx(H,{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($t,{children:[t.jsx(zt,{children:t.jsxs(Je,{children:[t.jsx(he,{className:"w-[140px]",children:a("registry.csvImportDialog.tableIdHeader")}),t.jsx(he,{children:a("registry.csvImportDialog.tableTitleHeader")}),t.jsx(he,{children:a("registry.csvImportDialog.tableUrlHeader")}),t.jsx(he,{className:"w-[80px] text-center",children:a("registry.csvImportDialog.tablePublicHeader")}),t.jsx(he,{children:a("registry.csvImportDialog.tableTagsHeader")})]})}),t.jsx(Ot,{children:U.map(ve=>t.jsxs(Je,{children:[t.jsx(fe,{className:"font-mono text-xs",children:ve.id}),t.jsx(fe,{className:"text-sm",children:ve.title}),t.jsx(fe,{className:"text-xs text-muted-foreground max-w-[200px] truncate",children:ve.server.remotes?.[0]?.url??t.jsx("span",{className:"italic",children:a("registry.csvImportDialog.tableNoneValue")})}),t.jsx(fe,{className:"text-center",children:ve.is_public?t.jsx(H,{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(fe,{className:"text-xs text-muted-foreground",children:(Ie(ve._meta)?.tags??[]).join(", ")||"-"})]},ve.id))})]})})})]});let Ce;e[64]!==d||e[65]!==a?(Ce=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(ei)})]}),e[64]=d,e[65]=a,e[66]=Ce):Ce=e[66];let Re;e[67]!==W||e[68]!==o||e[69]!==a?(Re=!o&&!W&&t.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[t.jsx(os,{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]=W,e[68]=o,e[69]=a,e[70]=Re):Re=e[70],e[71]!==Se||e[72]!==O||e[73]!==pe||e[74]!==Ce||e[75]!==Re?(R=t.jsxs("div",{className:"flex-1 overflow-y-auto grid gap-4 pr-1",children:[Se,O,pe,Ce,Re]}),e[71]=Se,e[72]=O,e[73]=pe,e[74]=Ce,e[75]=Re,e[76]=R):R=e[76],b=_t,E="gap-2 sm:gap-0";let $e;e[77]!==f?($e=()=>f(!1),e[77]=f,e[78]=$e):$e=e[78];let ze;e[79]!==W||e[80]!==a?(ze=a(W?"registry.csvImportDialog.doneButton":"registry.csvImportDialog.cancelButton"),e[79]=W,e[80]=a,e[81]=ze):ze=e[81],e[82]!==$e||e[83]!==ze?(D=t.jsx(Q,{variant:"outline",onClick:$e,children:ze}),e[82]=$e,e[83]=ze,e[84]=D):D=e[84],N=!W&&t.jsx(Q,{onClick:_,disabled:c||U.length===0||K,children:c?a("registry.csvImportDialog.importingButton"):a("registry.csvImportDialog.importButton",{count:U.length})}),e[6]=h,e[7]=_,e[8]=f,e[9]=d,e[10]=c,e[11]=r,e[12]=o,e[13]=a,e[14]=b,e[15]=L,e[16]=k,e[17]=R,e[18]=P,e[19]=S,e[20]=E,e[21]=D,e[22]=N,e[23]=I,e[24]=T}else b=e[14],L=e[15],k=e[16],R=e[17],P=e[18],S=e[19],E=e[20],D=e[21],N=e[22],I=e[23],T=e[24];let $;e[85]!==b||e[86]!==E||e[87]!==D||e[88]!==N?($=t.jsxs(b,{className:E,children:[D,N]}),e[85]=b,e[86]=E,e[87]=D,e[88]=N,e[89]=$):$=e[89];let M;e[90]!==L||e[91]!==R||e[92]!==$||e[93]!==I||e[94]!==T?(M=t.jsxs(L,{className:I,children:[T,R,$]}),e[90]=L,e[91]=R,e[92]=$,e[93]=I,e[94]=T,e[95]=M):M=e[95];let A;return e[96]!==k||e[97]!==P||e[98]!==S||e[99]!==M?(A=t.jsx(k,{open:P,onOpenChange:S,children:M}),e[96]=k,e[97]=P,e[98]=S,e[99]=M,e[100]=A):A=e[100],A}function ei(s){return t.jsxs("p",{className:"text-xs text-destructive flex items-start gap-1.5",children:[t.jsx(st,{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 ti(s){return s.message.startsWith("Missing required column:")}function si(s){const e=Z.c(34),{open:r,onOpenChange:i,title:n,isDeleting:l,onConfirm:c}=s,a=l===void 0?!1:l,o=de();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(rt,{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 h;e[7]!==m?(h=t.jsx(it,{children:m}),e[7]=m,e[8]=h):h=e[8];let g;e[9]!==d||e[10]!==h?(g=t.jsxs(nt,{children:[d,h]}),e[9]=d,e[10]=h,e[11]=g):g=e[11];let x;e[12]!==o?(x=o("registry.deleteConfirmDialog.cancel"),e[12]=o,e[13]=x):x=e[13];let p;e[14]!==a||e[15]!==x?(p=t.jsx(ot,{disabled:a,children:x}),e[14]=a,e[15]=x,e[16]=p):p=e[16];let f;e[17]!==a||e[18]!==o?(f=o(a?"registry.deleteConfirmDialog.deleting":"registry.deleteConfirmDialog.delete"),e[17]=a,e[18]=o,e[19]=f):f=e[19];let y;e[20]!==a||e[21]!==c||e[22]!==f?(y=t.jsx(at,{disabled:a,onClick:c,children:f}),e[20]=a,e[21]=c,e[22]=f,e[23]=y):y=e[23];let v;e[24]!==y||e[25]!==p?(v=t.jsxs(lt,{children:[p,y]}),e[24]=y,e[25]=p,e[26]=v):v=e[26];let C;e[27]!==v||e[28]!==g?(C=t.jsxs(ct,{children:[g,v]}),e[27]=v,e[28]=g,e[29]=C):C=e[29];let _;return e[30]!==i||e[31]!==r||e[32]!==C?(_=t.jsx(dt,{open:r,onOpenChange:i,children:C}),e[30]=i,e[31]=r,e[32]=C,e[33]=_):_=e[33],_}function ri(s){const[e]=s.id.split("/");return e??"provider"}function ii(s){return Ie(s._meta)?.tags??[]}function ni(s){return Ie(s._meta)?.categories??[]}function oi(s){return s.server?.icons?.[0]?.src??null}function ai(s){const e=Z.c(109),{item:r,onEdit:i,onDelete:n,onToggleVerified:l,onToggleOfficial:c}=s,a=de();let o;e[0]!==r?(o=oi(r),e[0]=r,e[1]=o):o=e[1];const u=o;let d;e[2]!==r._meta?(d=Ie(r._meta),e[2]=r._meta,e[3]=d):d=e[3];const m=d,h=m?.verified===!0,g=m?.official===!0;let x;e[4]!==r?(x=[...ii(r),...ni(r)],e[4]=r,e[5]=x):x=e[5];const p=x;let f;e[6]!==p?(f=p.slice(0,3),e[6]=p,e[7]=f):f=e[7];const y=f,v=Math.max(0,p.length-y.length);let C;e[8]!==u||e[9]!==r.title?(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: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[8]=u,e[9]=r.title,e[10]=C):C=e[10];let _;e[11]!==r.title?(_=t.jsx("p",{className:"font-medium truncate",children:r.title}),e[11]=r.title,e[12]=_):_=e[12];let b;e[13]!==r?(b=ri(r),e[13]=r,e[14]=b):b=e[14];let L;e[15]!==b?(L=t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b}),e[15]=b,e[16]=L):L=e[16];let k;e[17]!==r.is_public||e[18]!==a?(k=r.is_public?t.jsxs(H,{variant:"default",className:"gap-1",children:[t.jsx(fs,{size:10}),a("registry.registryItemCard.public")]}):t.jsx(H,{variant:"secondary",children:a("registry.registryItemCard.private")}),e[17]=r.is_public,e[18]=a,e[19]=k):k=e[19];let R;e[20]!==g||e[21]!==a?(R=g&&t.jsxs(H,{variant:"outline",className:"gap-1 text-primary",children:[t.jsx(ss,{size:10}),a("registry.registryItemCard.official")]}),e[20]=g,e[21]=a,e[22]=R):R=e[22];let P;e[23]!==g||e[24]!==h||e[25]!==a?(P=!g&&h&&t.jsxs(H,{variant:"outline",className:"gap-1 text-success",children:[t.jsx(ss,{size:10}),a("registry.registryItemCard.verified")]}),e[23]=g,e[24]=h,e[25]=a,e[26]=P):P=e[26];let S;e[27]!==R||e[28]!==P||e[29]!==L||e[30]!==k?(S=t.jsxs("div",{className:"flex items-center gap-2",children:[L,k,R,P]}),e[27]=R,e[28]=P,e[29]=L,e[30]=k,e[31]=S):S=e[31];let E;e[32]!==S||e[33]!==_?(E=t.jsxs("div",{className:"min-w-0 flex-1",children:[_,S]}),e[32]=S,e[33]=_,e[34]=E):E=e[34];let D;e[35]!==E||e[36]!==C?(D=t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[C,E]}),e[35]=E,e[36]=C,e[37]=D):D=e[37];let N;e[38]!==r.title||e[39]!==a?(N=a("registry.registryItemCard.actionsFor",{title:r.title}),e[38]=r.title,e[39]=a,e[40]=N):N=e[40];let I;e[41]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(Bt,{size:18}),e[41]=I):I=e[41];let T;e[42]!==N?(T=t.jsx(ft,{asChild:!0,children:t.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0","aria-label":N,children:I})}),e[42]=N,e[43]=T):T=e[43];let $;e[44]!==r||e[45]!==i?($=()=>i(r),e[44]=r,e[45]=i,e[46]=$):$=e[46];let M;e[47]!==a?(M=a("registry.registryItemCard.edit"),e[47]=a,e[48]=M):M=e[48];let A;e[49]!==$||e[50]!==M?(A=t.jsx(ke,{onClick:$,children:M}),e[49]=$,e[50]=M,e[51]=A):A=e[51];let U;e[52]!==r||e[53]!==l?(U=()=>l(r),e[52]=r,e[53]=l,e[54]=U):U=e[54];let F;e[55]!==h||e[56]!==a?(F=a(h?"registry.registryItemCard.unmarkAsVerified":"registry.registryItemCard.markAsVerified"),e[55]=h,e[56]=a,e[57]=F):F=e[57];let j;e[58]!==U||e[59]!==F?(j=t.jsx(ke,{onClick:U,children:F}),e[58]=U,e[59]=F,e[60]=j):j=e[60];let z;e[61]!==r||e[62]!==c?(z=()=>c(r),e[61]=r,e[62]=c,e[63]=z):z=e[63];let K;e[64]!==g||e[65]!==a?(K=a(g?"registry.registryItemCard.unmarkAsOfficial":"registry.registryItemCard.markAsOfficial"),e[64]=g,e[65]=a,e[66]=K):K=e[66];let W;e[67]!==z||e[68]!==K?(W=t.jsx(ke,{onClick:z,children:K}),e[67]=z,e[68]=K,e[69]=W):W=e[69];let J;e[70]!==r||e[71]!==n?(J=()=>n(r),e[70]=r,e[71]=n,e[72]=J):J=e[72];let ue;e[73]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(ut,{size:14}),e[73]=ue):ue=e[73];let le;e[74]!==a?(le=a("registry.registryItemCard.delete"),e[74]=a,e[75]=le):le=e[75];let se;e[76]!==J||e[77]!==le?(se=t.jsxs(ke,{variant:"destructive",onClick:J,children:[ue,le]}),e[76]=J,e[77]=le,e[78]=se):se=e[78];let xe;e[79]!==A||e[80]!==j||e[81]!==W||e[82]!==se?(xe=t.jsxs(yt,{align:"end",children:[A,j,W,se]}),e[79]=A,e[80]=j,e[81]=W,e[82]=se,e[83]=xe):xe=e[83];let me;e[84]!==T||e[85]!==xe?(me=t.jsxs(jt,{children:[T,xe]}),e[84]=T,e[85]=xe,e[86]=me):me=e[86];let oe;e[87]!==D||e[88]!==me?(oe=t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[D,me]}),e[87]=D,e[88]=me,e[89]=oe):oe=e[89];let re;e[90]!==r.description||e[91]!==r.server||e[92]!==m?.short_description||e[93]!==a?(re=m?.short_description||r.description||r.server.description||a("registry.registryItemCard.noDescriptionProvided"),e[90]=r.description,e[91]=r.server,e[92]=m?.short_description,e[93]=a,e[94]=re):re=e[94];let w;e[95]!==re?(w=t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 min-h-10",children:re}),e[95]=re,e[96]=w):w=e[96];let B;e[97]!==r.id||e[98]!==y?(B=y.map(ie=>t.jsx(H,{variant:"secondary",children:ie},`${r.id}-badge-${ie}`)),e[97]=r.id,e[98]=y,e[99]=B):B=e[99];let X;e[100]!==v?(X=v>0&&t.jsxs(H,{variant:"outline",children:["+",v]}),e[100]=v,e[101]=X):X=e[101];let ne;e[102]!==B||e[103]!==X?(ne=t.jsxs("div",{className:"flex flex-wrap gap-1",children:[B,X]}),e[102]=B,e[103]=X,e[104]=ne):ne=e[104];let ce;return e[105]!==oe||e[106]!==w||e[107]!==ne?(ce=t.jsxs(ge,{className:"p-4 gap-4 transition-colors hover:bg-muted/50",children:[oe,w,ne]}),e[105]=oe,e[106]=w,e[107]=ne,e[108]=ce):ce=e[108],ce}function ws(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=de(),[d,m]=q.useState(!1),[h,g]=q.useState(!1),x=q.useRef(null);let p;e[0]!==o?(p=I=>{I.preventDefault(),o||m(!0)},e[0]=o,e[1]=p):p=e[1];const f=p;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=I=>{I.preventDefault(),m(!1)},e[2]=y):y=e[2];const v=y;let C;e[3]!==o||e[4]!==l?(C=async I=>{if(I.preventDefault(),I.stopPropagation(),m(!1),o)return;const T=I.dataTransfer.files[0];T&&await l(T)},e[3]=o,e[4]=l,e[5]=C):C=e[5];const _=C;let b;e[6]!==o||e[7]!==l?(b=async I=>{const T=I.target.files?.[0];T&&!o&&await l(T),I.target.value=""},e[6]=o,e[7]=l,e[8]=b):b=e[8];const L=b,k=r.length>0;let R;e[9]!==u?(R=u("registry.imageUpload.image"),e[9]=u,e[10]=R):R=e[10];let P;e[11]!==R?(P=t.jsx(ae,{children:R}),e[11]=R,e[12]=P):P=e[12];let S;e[13]!==f||e[14]!==_||e[15]!==k||e[16]!==d||e[17]!==o||e[18]!==n||e[19]!==i||e[20]!==h||e[21]!==u||e[22]!==r?(S=k?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(Q,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>x.current?.click(),disabled:o,children:[t.jsx(Ft,{className:"size-3"}),u("registry.imageUpload.change")]}),t.jsxs(Q,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 text-destructive hover:text-destructive",onClick:()=>{i(""),g(!1)},disabled:o,children:[t.jsx(ut,{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:f,onDragLeave:v,onDrop:_,onClick:()=>x.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(Xs,{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")})]})]}),h?t.jsx("div",{className:"border-t border-border px-3 py-2",onClick:li,children:t.jsx(je,{placeholder:u("registry.imageUpload.urlPlaceholder"),value:r,className:"text-xs h-8",onChange:I=>i(I.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:I=>{I.stopPropagation(),g(!0)},children:[t.jsx(xr,{className:"size-3"}),u("registry.imageUpload.orPasteImageUrl")]})})]}),e[13]=f,e[14]=_,e[15]=k,e[16]=d,e[17]=o,e[18]=n,e[19]=i,e[20]=h,e[21]=u,e[22]=r,e[23]=S):S=e[23];let E;e[24]!==L?(E=t.jsx("input",{ref:x,type:"file",accept:"image/*",className:"hidden",onChange:L}),e[24]=L,e[25]=E):E=e[25];let D;e[26]!==c?(D=c&&t.jsx("p",{className:"text-xs text-destructive",children:c}),e[26]=c,e[27]=D):D=e[27];let N;return e[28]!==D||e[29]!==P||e[30]!==S||e[31]!==E?(N=t.jsxs("div",{className:"grid gap-1.5",children:[P,S,E,D]}),e[28]=D,e[29]=P,e[30]=S,e[31]=E,e[32]=N):N=e[32],N}function li(s){return s.stopPropagation()}function _s(){const[s,e]=q.useState("idle"),[r,i]=q.useState(null),n=Me();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?ci(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 ci(s){const e=s.toLowerCase();return e.includes("authentication")||e.includes("unauthorized")||e.includes("credentials")}function di(s){const e=Z.c(62),{tools:r,onChange:i,remoteUrl:n,remoteType:l,externalDiscoverStatus:c,externalDiscoverError:a}=s,o=de(),[u,d]=q.useState(r.length>0),{discover:m,discoverStatus:h,discoverError:g,resetDiscover:x}=_s(),p=c??h,f=a??g;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 v=y;let C;e[5]!==i||e[6]!==x?(C=()=>{i([]),x()},e[5]=i,e[6]=x,e[7]=C):C=e[7];const _=C;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(ps,{size:14,className:"text-muted-foreground"}),e[10]=L):L=e[10];let k;e[11]!==o?(k=o("registry.toolsEditor.tools"),e[11]=o,e[12]=k):k=e[12];let R;e[13]!==k?(R=t.jsx("span",{children:k}),e[13]=k,e[14]=R):R=e[14];let P;e[15]!==r.length?(P=r.length>0&&t.jsx(H,{variant:"secondary",className:"text-xs px-1.5 py-0",children:r.length}),e[15]=r.length,e[16]=P):P=e[16];let S;e[17]!==u?(S=u?t.jsx(jr,{size:14,className:"text-muted-foreground"}):t.jsx(yr,{size:14,className:"text-muted-foreground"}),e[17]=u,e[18]=S):S=e[18];let E;e[19]!==b||e[20]!==R||e[21]!==P||e[22]!==S?(E=t.jsxs("button",{type:"button",className:"flex items-center gap-2 text-sm font-medium cursor-pointer",onClick:b,children:[L,R,P,S]}),e[19]=b,e[20]=R,e[21]=P,e[22]=S,e[23]=E):E=e[23];let D;e[24]!==_||e[25]!==o||e[26]!==r.length?(D=r.length>0&&t.jsxs(Q,{type:"button",variant:"ghost",size:"sm",className:"h-7 text-xs gap-1.5 text-muted-foreground",onClick:_,children:[t.jsx(ut,{size:12}),o("registry.toolsEditor.clear")]}),e[24]=_,e[25]=o,e[26]=r.length,e[27]=D):D=e[27];let N;e[28]!==p||e[29]!==v||e[30]!==n||e[31]!==o||e[32]!==r.length?(N=n&&t.jsxs(Q,{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:v,disabled:p==="loading",children:[p==="loading"?t.jsx(Ye,{size:12,className:"animate-spin"}):t.jsx(Ft,{size:12}),p==="loading"?o("registry.toolsEditor.discovering"):r.length>0?o("registry.toolsEditor.refresh"):o("registry.toolsEditor.autoDiscover")]}),e[28]=p,e[29]=v,e[30]=n,e[31]=o,e[32]=r.length,e[33]=N):N=e[33];let I;e[34]!==D||e[35]!==N?(I=t.jsxs("div",{className:"flex items-center gap-2",children:[D,N]}),e[34]=D,e[35]=N,e[36]=I):I=e[36];let T;e[37]!==I||e[38]!==E?(T=t.jsxs("div",{className:"flex items-center justify-between",children:[E,I]}),e[37]=I,e[38]=E,e[39]=T):T=e[39];let $;e[40]!==p||e[41]!==o||e[42]!==r.length?($=p==="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]=p,e[41]=o,e[42]=r.length,e[43]=$):$=e[43];let M;e[44]!==f||e[45]!==p?(M=p==="error"&&f&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-destructive bg-destructive/10 rounded-lg px-3 py-2",children:[t.jsx(st,{size:14,className:"shrink-0"}),t.jsx("span",{children:f})]}),e[44]=f,e[45]=p,e[46]=M):M=e[46];let A;e[47]!==u||e[48]!==r?(A=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(ui)}),e[47]=u,e[48]=r,e[49]=A):A=e[49];let U;e[50]!==p||e[51]!==u||e[52]!==n||e[53]!==o||e[54]!==r.length?(U=u&&r.length===0&&p==="idle"&&t.jsx("p",{className:"text-xs text-muted-foreground px-1",children:o(n?"registry.toolsEditor.emptyHintWithUrl":"registry.toolsEditor.emptyHintWithoutUrl")}),e[50]=p,e[51]=u,e[52]=n,e[53]=o,e[54]=r.length,e[55]=U):U=e[55];let F;return e[56]!==T||e[57]!==$||e[58]!==M||e[59]!==A||e[60]!==U?(F=t.jsxs("div",{className:"space-y-3",children:[T,$,M,A,U]}),e[56]=T,e[57]=$,e[58]=M,e[59]=A,e[60]=U,e[61]=F):F=e[61],F}function ui(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 Ps(s){const{org:e}=Ne(),[r,i]=q.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 V.error("Image upload requires an object-storage connection. Configure one in plugin settings."),null;if(!o.type.startsWith("image/"))return V.error("Only image files are supported"),null;if(o.size>5*1024*1024)return V.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 h=await fetch(m,{method:"PUT",body:o,headers:{"Content-Type":o.type}});if(!h.ok)throw new Error(`Upload failed: ${h.statusText}`);const g=await c.callTool({name:"GET_PRESIGNED_URL",arguments:{key:u,expiresIn:31536e3}}),x=g.structuredContent?.url||g.url;if(!x)throw new Error("Failed to get public URL");return x}catch(d){return console.error("Image upload failed:",d),V.error(d instanceof Error?d.message:"Failed to upload image. Please try again."),null}finally{i(!1)}},isUploading:r}}const mi=new Set(["http","sse","stdio"]),gi=/^[a-z0-9]+(?:[/-][a-z0-9._-]+)*$/,xi=["internal","automation","support","sales","ops","ai"],pi=["productivity","communication","customer-support","development","data","operations"],hi=["registry.registryItemDialog.essentials","registry.registryItemDialog.details","registry.registryItemDialog.advanced"],fi="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 us(s){return s.replace(/^https?:\/\//i,"").trim()}function tt(s){const e=s.trim();return e?/^https?:\/\//i.test(e)?e:`https://${e}`:""}function Qe(s){return s.trim().toLowerCase()}function It(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 yi(s){const e=Z.c(5),{current:r}=s,i=de();let n;e[0]!==r||e[1]!==i?(n=hi.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 ji(s){const e=Z.c(32),{id:r,labelKey:i,values:n,availableOptions:l,placeholderKey:c,onChange:a}=s,o=de(),[u,d]=q.useState(""),[m,h]=q.useState(!1);let g,x,p,f,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 _=It(l),b=It(n),L=new Set(b),k=Qe(u),R=_.filter(M=>!L.has(M)).filter(M=>k?M.includes(k):!0).slice(0,8),P=M=>{const A=Qe(M);!A||L.has(A)||a([...b,A])},S=M=>{a(b.filter(A=>A!==M))},E=()=>{const M=u.split(/[,\n;]/).map(Qe).filter(Boolean);if(M.length===0)return;const A=[...b];for(const U of M)A.includes(U)||A.push(U);a(A),d("")},D=k;f="grid gap-2";let N;e[14]!==i||e[15]!==o?(N=o(i),e[14]=i,e[15]=o,e[16]=N):N=e[16],e[17]!==r||e[18]!==N?(y=t.jsx(ae,{htmlFor:r,children:N}),e[17]=r,e[18]=N,e[19]=y):y=e[19],g="relative";let I;e[20]!==r?(I=()=>{const M=document.getElementById(r);M instanceof HTMLInputElement&&M.focus()},e[20]=r,e[21]=I):I=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=()=>h(!0),e[22]=T):T=e[22];let $;e[23]===Symbol.for("react.memo_cache_sentinel")?($=M=>d(M.target.value),e[23]=$):$=e[23],x=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:I,children:t.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[b.map(M=>t.jsxs(H,{variant:"secondary",className:"gap-1",children:[M,t.jsx("button",{type:"button",onClick:A=>{A.preventDefault(),A.stopPropagation(),S(M)},children:t.jsx(fr,{size:12})})]},`${r}-${M}`)),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:T,onBlur:()=>{h(!1),E()},onChange:$,onKeyDown:M=>{if(M.key==="Enter"||M.key===","){M.preventDefault(),E();return}M.key==="Backspace"&&!u&&b.length&&S(b[b.length-1]??"")}})]})}),p=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:R.length>0?R.map(M=>t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:bi,onClick:()=>{P(M),d("")},children:M},`${r}-suggestion-${M}`)):D?t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:vi,onClick:()=>{P(D),d("")},children:o("registry.registryItemDialog.createTag",{value:D})}):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]=g,e[10]=x,e[11]=p,e[12]=f,e[13]=y}else g=e[9],x=e[10],p=e[11],f=e[12],y=e[13];let v;e[24]!==g||e[25]!==x||e[26]!==p?(v=t.jsxs("div",{className:g,children:[x,p]}),e[24]=g,e[25]=x,e[26]=p,e[27]=v):v=e[27];let C;return e[28]!==f||e[29]!==y||e[30]!==v?(C=t.jsxs("div",{className:f,children:[y,v]}),e[28]=f,e[29]=y,e[30]=v,e[31]=C):C=e[31],C}function vi(s){return s.preventDefault()}function bi(s){return s.preventDefault()}function Ni({id:s,value:e,availableOptions:r,onChange:i}){const n=de(),[l,c]=q.useState(e),[a,o]=q.useState(!1),u=q.useRef(e);u.current!==e&&(u.current=e,c(e));const d=It([...pi,...r,e]).filter(Boolean),m=Qe(l),h=d.filter(x=>m?x.includes(m):!0).slice(0,8),g=x=>{const p=Qe(x);i(p),c(p),o(!1)};return t.jsxs("div",{className:"grid gap-2",children:[t.jsx(ae,{htmlFor:s,children:n("registry.registryItemDialog.category")}),t.jsxs("div",{className:"relative",children:[t.jsx(je,{id:s,className:"h-9 text-sm",placeholder:n("registry.registryItemDialog.selectOrCreateCategory"),value:l,onFocus:()=>{c(e),o(!0)},onBlur:()=>{g(l)},onChange:x=>c(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),g(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:x=>x.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:h.length>0?h.map(x=>t.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:p=>p.preventDefault(),onClick:()=>g(x),children:x},`${s}-${x}`)):m?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:()=>g(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 Ci({open:s,onOpenChange:e,item:r,draft:i,availableTags:n=[],availableCategories:l=[],isSubmitting:c=!1,onSubmit:a}){const o=de(),{org:u}=Ne(),{uploadImage:d,isUploading:m}=Ps(),{discover:h,discoverStatus:g,discoverError:x,resetDiscover:p}=_s(),f=!!r,y=Ie(r?._meta),v=Ie(i?._meta),C=r?.title??i?.title??"",_=r?.id?.split("/")[0]??i?.id?.split("/")[0]??"",b=r?.description??i?.description??"",L=y?.short_description??v?.short_description??"",k=y?.owner??v?.owner??"",R=r?.server?.repository?.url??i?.server?.repository?.url??"",P=y?.readme??v?.readme??"",S=y?.readme_url??v?.readme_url??"",E=us(r?.server?.remotes?.[0]?.url??i?.server?.remotes?.[0]?.url??""),D=r?.server?.remotes?.[0]?.type??i?.server?.remotes?.[0]?.type??"http",N=y?.tags??v?.tags??[],I=y?.categories?.[0]??v?.categories?.[0]??"",T=r?.server?.icons?.[0]?.src??i?.server?.icons?.[0]?.src??"",$=y?.tools??v?.tools??[],M=r?.is_public??i?.is_public??!1,A=y?.verified??v?.verified??!1,U=y?.official??v?.official??!1,[F,j]=q.useState(1),[z,K]=q.useState(C),[W,J]=q.useState(_),[ue,le]=q.useState(b),[se,xe]=q.useState(L),[me,oe]=q.useState(k),[re,w]=q.useState(R),[B,X]=q.useState(P),[ne,ce]=q.useState(S),[ie,Se]=q.useState(P?"content":"link"),[O,pe]=q.useState(E),[Ce,Re]=q.useState(D),[$e,ze]=q.useState(N),[ve,gt]=q.useState(I),[Ze,St]=q.useState(T),[De,xt]=q.useState($),[Vt,Gt]=q.useState(M),[Qt,Yt]=q.useState(A),[Wt,Jt]=q.useState(U),[ye,Xe]=q.useState({}),Zt=()=>{j(1),K(C),J(_),le(b),xe(L),oe(k),w(R),X(P),ce(S),Se(P?"content":"link"),pe(E),Re(D),ze(N),gt(I),St(T),xt($),Gt(M),Yt(A),Jt(U),Xe({}),p(),pt.current="",we.current&&(clearTimeout(we.current),we.current=null)},Ds=async G=>{if(!G)return;const ee=f?r?.id:`${W}/${z}`.toLowerCase(),_e=Ke(ee||"temp"),qe=G.name.split(".").pop()||"png",Ee=`registry/${u.id}/${_e}/icon.${qe}`,Be=await d(G,Ee);Be?(St(Be),Xe(Le=>({...Le,imageUrl:void 0}))):Xe(Le=>({...Le,imageUrl:o("registry.registryItemDialog.failedToUploadImage")}))},we=q.useRef(null),pt=q.useRef(""),Dt=q.useRef(Ce);Dt.current=Ce;const Xt=G=>{!G&&we.current&&(clearTimeout(we.current),we.current=null),e(G),G||Zt()},Ts=async()=>{const G=tt(O);if(!G)return;we.current&&(clearTimeout(we.current),we.current=null),pt.current=G;const ee=await h(G,Dt.current);ee&&xt(ee)},Ms=G=>{we.current&&clearTimeout(we.current);const ee=tt(G);!ee||ee===pt.current||G.includes(".")&&(we.current=setTimeout(async()=>{pt.current=ee;const _e=await h(ee,Dt.current);_e&&xt(_e)},800))},es=G=>{const ee={};if(G===1){const _e=Ke(W),qe=Ke(z),Ee=`${_e}/${qe}`;z.trim()||(ee.title=o("registry.registryItemDialog.nameIsRequired")),f||(_e?qe?gi.test(Ee)||(ee.provider=o("registry.registryItemDialog.useValidIdFormat")):ee.title=o("registry.registryItemDialog.nameMustContainValidCharacters"):ee.provider=o("registry.registryItemDialog.providerIsRequired"));const Be=tt(O),Le=Ce.trim().toLowerCase();if(Le!=="stdio"&&Be)try{const et=new URL(Be);["http:","https:"].includes(et.protocol)||(ee.remoteUrl=o("registry.registryItemDialog.remoteUrlMustBeHttps"))}catch{ee.remoteUrl=o("registry.registryItemDialog.remoteUrlIsInvalid")}if(Le&&!mi.has(Le)&&(ee.remoteType=o("registry.registryItemDialog.remoteTypeMustBe")),Ze.trim()&&!Ze.trim().startsWith("data:image/"))try{const Tt=new URL(Ze.trim());["http:","https:"].includes(Tt.protocol)||(ee.imageUrl=o("registry.registryItemDialog.imageUrlMustBeHttps"))}catch{ee.imageUrl=o("registry.registryItemDialog.imageUrlIsInvalid")}}if(G===2&&(ue.length>1500&&(ee.description=o("registry.registryItemDialog.descriptionMaxLength")),se.trim().length>160&&(ee.shortDescription=o("registry.registryItemDialog.shortDescriptionMaxLength"))),G===3){const _e=ne.trim();if(_e)try{const Ee=new URL(_e);["http:","https:"].includes(Ee.protocol)||(ee.readmeUrl=o("registry.registryItemDialog.readmeUrlMustBeHttps"))}catch{ee.readmeUrl=o("registry.registryItemDialog.readmeUrlIsInvalid")}B.trim().length>5e4&&(ee.readme=o("registry.registryItemDialog.readmeMaxLength"));const qe=re.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 Xe(ee),Object.values(ee).every(_e=>_e===void 0)},qs=()=>{es(F)&&(F===1&&we.current&&(clearTimeout(we.current),we.current=null),F<3&&j(F+1))},Es=()=>{F>1&&j(F-1)},Ls=async()=>{if(!es(3))return;const G=z.trim(),ee=Ke(W),_e=Ke(G),qe=`${ee}/${_e}`,Ee=tt(O),Be=Ce.trim().toLowerCase(),Le=Ze.trim(),et=re.trim(),Tt=se.trim(),$s=B.trim(),zs=ne.trim(),Os=It($e),Bs=ve?[Qe(ve)]:[],Ks=r?r.server?.name??r.id:"",Hs=(f?Ks:qe).trim(),Mt=ue.trim(),Vs=me.trim(),ts={title:G,description:Mt.length>0?Mt:null,is_public:Vt,_meta:Pt(void 0,{verified:Qt,official:Wt,tags:Os,categories:Bs,short_description:Tt||null,owner:Vs||null,readme:$s||null,readme_url:zs||null,...De.length>0?{tools:De}:{}}),server:{name:Hs,title:G,description:Mt||void 0,icons:Le?[{src:Le}]:[],repository:et?{url:et}:void 0,remotes:Ee?[{type:Be||"http",url:Ee}]:[]}};if(f&&r){await a({id:r.id,data:ts}),e(!1);return}await a({id:qe,...ts}),e(!1),Zt()},As=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(ae,{htmlFor:"registry-item-provider",children:o("registry.registryItemDialog.provider")}),t.jsx(je,{id:"registry-item-provider",className:"h-9 text-sm",placeholder:"acme",value:W,onChange:G=>J(G.target.value),disabled:f}),!f&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[o("registry.registryItemDialog.itemId")," ",t.jsx("span",{className:"font-mono",children:`${Ke(W)||"provider"}/${Ke(z)||"name"}`})]}),ye.provider&&t.jsx("p",{className:"text-xs text-destructive",children:ye.provider})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{htmlFor:"registry-item-title",children:o("registry.registryItemDialog.name")}),t.jsx(je,{id:"registry-item-title",className:"h-9 text-sm",placeholder:"Internal MCP",value:z,onChange:G=>K(G.target.value)}),ye.title&&t.jsx("p",{className:"text-xs text-destructive",children:ye.title})]})]}),t.jsx("div",{className:"row-span-2 content-start",children:t.jsx(ws,{value:Ze,onChange:G=>{St(G),Xe(ee=>({...ee,imageUrl:void 0}))},onFileUpload:Ds,error:ye.imageUrl,isUploading:m})}),t.jsxs("div",{className:"col-span-2 grid gap-1.5",children:[t.jsx(ae,{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:O,onChange:G=>{const ee=us(G.target.value);pe(ee),Ms(ee)}})]}),t.jsxs(cr,{value:Ce,onValueChange:Re,children:[t.jsx(dr,{id:"registry-remote-type",className:"w-[90px] h-9 shrink-0",children:t.jsx(ur,{placeholder:o("registry.registryItemDialog.type")})}),t.jsxs(mr,{children:[t.jsx(qt,{value:"http",children:"http"}),t.jsx(qt,{value:"sse",children:"sse"}),t.jsx(qt,{value:"stdio",children:"stdio"})]})]})]}),ye.remoteUrl&&t.jsx("p",{className:"text-xs text-destructive",children:ye.remoteUrl}),ye.remoteType&&t.jsx("p",{className:"text-xs text-destructive",children:ye.remoteType})]}),O.trim()&&t.jsxs("div",{className:"col-span-2 space-y-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(Q,{type:"button",variant:"outline",size:"sm",className:te(fi,"gap-1.5"),onClick:Ts,disabled:g==="loading",children:[g==="loading"?t.jsx(Ye,{size:12,className:"animate-spin"}):t.jsx(Ft,{size:12}),g==="loading"?o("registry.registryItemDialog.discoveringTools"):De.length>0?o("registry.registryItemDialog.rediscoverTools"):o("registry.registryItemDialog.discoverToolsFromUrl")]}),De.length>0&&g!=="loading"&&t.jsx("span",{className:"text-xs text-muted-foreground",children:o("registry.registryItemDialog.toolsLoaded",{count:De.length.toString()})})]}),g==="success"&&De.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:De.length.toString()})})]}),t.jsxs("div",{className:"flex flex-wrap gap-1",children:[De.slice(0,8).map(G=>t.jsx(H,{variant:"secondary",className:"text-[10px] px-1.5 py-0 font-mono",children:G.name},G.name)),De.length>8&&t.jsx("span",{className:"text-[10px] text-muted-foreground self-center",children:o("registry.registryItemDialog.andMore",{count:(De.length-8).toString()})})]}),t.jsx("p",{className:"text-[10px] text-muted-foreground",children:o("registry.registryItemDialog.toolsWillEnrich")})]}),g==="auth_required"&&x&&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(st,{size:14,className:"shrink-0"}),t.jsx("span",{children:o("registry.registryItemDialog.authRequiredMessage")})]}),g==="error"&&x&&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(st,{size:14,className:"shrink-0"}),t.jsx("span",{children:x})]})]})]}),Us=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(ae,{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(je,{id:"registry-item-short-description",className:"h-9 text-sm",placeholder:o("registry.registryItemDialog.shortSummaryForStoreCard"),value:se,maxLength:160,onChange:G=>xe(G.target.value)}),ye.shortDescription&&t.jsx("p",{className:"text-xs text-destructive",children:ye.shortDescription})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(ae,{htmlFor:"registry-item-description",children:o("registry.registryItemDialog.description")}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[ue.length,"/1500"]})]}),t.jsx(Rt,{id:"registry-item-description",className:"text-sm max-h-28 overflow-y-auto resize-none",placeholder:o("registry.registryItemDialog.briefDescription"),rows:2,value:ue,onChange:G=>le(G.target.value)}),ye.description&&t.jsx("p",{className:"text-xs text-destructive",children:ye.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(Ni,{id:"registry-category",value:ve,availableOptions:l,onChange:gt})}),t.jsx("div",{className:"grid content-start gap-2",children:t.jsx(ji,{id:"registry-tags",labelKey:"registry.registryItemDialog.tags",values:$e,availableOptions:[...xi,...n],placeholderKey:"registry.registryItemDialog.typeAndPressEnter",onChange:ze})})]}),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(ae,{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:Vt,onCheckedChange:Gt})]}),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(ae,{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:Qt,onCheckedChange:Yt})]}),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(ae,{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:Wt,onCheckedChange:Jt})]})]}),Fs=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(ae,{htmlFor:"registry-item-owner",children:o("registry.registryItemDialog.ownerOptional")}),t.jsx(je,{id:"registry-item-owner",className:"h-9 text-sm",placeholder:o("registry.registryItemDialog.teamCompanyOrPerson"),value:me,onChange:G=>oe(G.target.value)})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{htmlFor:"registry-item-repository-url",children:o("registry.registryItemDialog.repositoryUrlOptional")}),t.jsx(je,{id:"registry-item-repository-url",className:"h-9 text-sm",placeholder:"https://github.com/org/repo",value:re,onChange:G=>w(G.target.value)}),ye.repositoryUrl&&t.jsx("p",{className:"text-xs text-destructive",children:ye.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(ae,{children:o("registry.registryItemDialog.readme")}),t.jsxs("span",{className:"text-xs text-muted-foreground",children:[B.length,"/50000"]})]}),t.jsx("div",{className:"inline-flex rounded-lg border border-border p-0.5",children:["link","content"].map(G=>t.jsx("button",{type:"button",className:te("px-2.5 py-1 text-xs rounded-md",ie===G?"bg-primary text-primary-foreground":"text-muted-foreground"),onClick:()=>Se(G),children:o(G==="link"?"registry.registryItemDialog.link":"registry.registryItemDialog.content")},G))}),ie==="link"&&t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(je,{className:"h-9 text-sm",placeholder:"https://raw.githubusercontent.com/org/repo/main/README.md",value:ne,onChange:G=>ce(G.target.value)}),ye.readmeUrl&&t.jsx("p",{className:"text-xs text-destructive",children:ye.readmeUrl})]}),ie==="content"&&t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(Rt,{className:"text-sm max-h-48 overflow-y-auto resize-none",placeholder:`# README
26
26
 
27
- Describe your MCP here...`,rows:6,value:B,onChange:G=>X(G.target.value)}),ye.readme&&t.jsx("p",{className:"text-xs text-destructive",children:ye.readme})]})]}),t.jsx(di,{tools:De,onChange:xt,remoteUrl:tt(O)||void 0,remoteType:Ce,externalDiscoverStatus:g,externalDiscoverError:x})]});return t.jsx(vt,{open:s,onOpenChange:Xt,children:t.jsxs(bt,{className:"sm:max-w-[820px] max-h-[90vh] overflow-hidden flex flex-col",children:[t.jsxs(wt,{className:"space-y-3",children:[t.jsx(Nt,{children:o(f?"registry.registryItemDialog.editMcpServer":"registry.registryItemDialog.addMcpServer")}),t.jsx(yi,{current:F}),t.jsxs(Ct,{children:[F===1&&o("registry.registryItemDialog.step1Description"),F===2&&o("registry.registryItemDialog.step2Description"),F===3&&o("registry.registryItemDialog.step3Description")]})]}),t.jsxs("div",{className:"flex-1 overflow-y-auto pr-1 py-2",children:[F===1&&As,F===2&&Us,F===3&&Fs]}),t.jsxs(_t,{className:"flex items-center justify-between gap-2 sm:justify-between",children:[t.jsx("div",{children:F>1&&t.jsxs(Q,{variant:"ghost",size:"sm",onClick:Es,children:[t.jsx(gr,{size:14}),o("registry.registryItemDialog.back")]})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Q,{variant:"outline",size:"sm",onClick:()=>Xt(!1),disabled:c,children:o("registry.registryItemDialog.cancel")}),F<3?t.jsxs(Q,{size:"sm",onClick:qs,children:[o("registry.registryItemDialog.next"),t.jsx(pr,{size:14})]}):t.jsx(Q,{size:"sm",onClick:Ls,disabled:c,children:o(c?"registry.registryItemDialog.saving":f?"registry.registryItemDialog.saveChanges":"registry.registryItemDialog.create")})]})]})]})})}function ms(s,e){return s.includes(e)?s.filter(r=>r!==e):[...s,e]}function wi(s){return Ie(s._meta)?.tags??[]}function _i(s){return Ie(s._meta)?.categories??[]}function Pi(s){return s.server?.remotes?.[0]?.url??"-"}function Ri(){const s=de(),e="h-8",[r,i]=q.useState(""),n=q.useDeferredValue(r),[l,c]=q.useState([]),[a,o]=q.useState([]),[u,d]=q.useState(!1),[m,h]=q.useState(!1),[g,x]=q.useState(null),[p,f]=q.useState(null),[y,v]=nr("private-registry-list","cards"),C=q.useRef(null),_=Ns({search:n,tags:l,categories:a}),b=Fr(),{createMutation:L,updateMutation:I,deleteMutation:R,bulkCreateMutation:P}=Ht(),k=_.data?.pages.flatMap(j=>j.items??[]).filter(Boolean)??[],E=_.data?.pages[0]?.totalCount??k.length,D=l.length>0||a.length>0||n.length>0,N=b.data,S=Array.isArray(N?.tags)?N.tags:[],T=Array.isArray(N?.categories)?N.categories:[],$=j=>{C.current&&(C.current.disconnect(),C.current=null),!(!j||!_.hasNextPage||_.isFetchingNextPage)&&(C.current=new IntersectionObserver(z=>{z[0]?.isIntersecting&&_.hasNextPage&&!_.isFetchingNextPage&&_.fetchNextPage()},{rootMargin:"240px 0px"}),C.current.observe(j))},M=async j=>{try{"data"in j?(await I.mutateAsync(j),V.success(s("registry.registryItemsPage.registryItemUpdated"))):(await L.mutateAsync(j),V.success(s("registry.registryItemsPage.registryItemCreated")))}catch(z){throw V.error(z instanceof Error?z.message:s("registry.registryItemsPage.failedToSaveItem")),z}},A=async j=>{const z=Ie(j._meta),K=z?.verified===!0;try{await I.mutateAsync({id:j.id,data:{_meta:Pt(j._meta,{...z,verified:!K})}}),V.success(s(K?"registry.registryItemsPage.removedVerifiedStatus":"registry.registryItemsPage.markedAsVerified"))}catch(W){V.error(W instanceof Error?W.message:s("registry.registryItemsPage.failedToUpdateItem"))}},U=async j=>{const z=Ie(j._meta),K=z?.official===!0;try{await I.mutateAsync({id:j.id,data:{_meta:Pt(j._meta,{...z,official:!K})}}),V.success(s(K?"registry.registryItemsPage.removedOfficialStatus":"registry.registryItemsPage.markedAsOfficial"))}catch(W){V.error(W instanceof Error?W.message:s("registry.registryItemsPage.failedToUpdateItem"))}},F=async()=>{if(p)try{await R.mutateAsync(p.id),V.success(s("registry.registryItemsPage.registryItemDeleted")),f(null)}catch(j){V.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(H,{variant:"secondary",className:"text-xs",children:E})]}),t.jsxs("div",{className:"flex items-center gap-2 self-stretch",children:[t.jsxs(jt,{children:[t.jsx(ft,{asChild:!0,children:t.jsxs(Q,{variant:"outline",size:"sm",className:te(e,"gap-1.5"),children:[t.jsx(or,{size:14}),s("registry.registryItemsPage.filters")]})}),t.jsxs(yt,{align:"end",className:"w-[260px]",children:[t.jsx(rs,{children:s("registry.registryItemsPage.tags")}),S.length>0?S.map(j=>t.jsxs(is,{checked:l.includes(j.value),onCheckedChange:()=>c(z=>ms(z,j.value)),children:[j.value," (",j.count,")"]},j.value)):t.jsx(ke,{disabled:!0,children:s("registry.registryItemsPage.noTagsAvailable")}),t.jsx(rr,{}),t.jsx(rs,{children:s("registry.registryItemsPage.categories")}),T.length>0?T.map(j=>t.jsxs(is,{checked:a.includes(j.value),onCheckedChange:()=>o(z=>ms(z,j.value)),children:[j.value," (",j.count,")"]},j.value)):t.jsx(ke,{disabled:!0,children:s("registry.registryItemsPage.noCategoriesAvailable")})]})]}),t.jsxs(ir,{type:"single",value:y,onValueChange:j=>{(j==="cards"||j==="table")&&v(j)},variant:"outline",className:e,children:[t.jsx(ns,{value:"cards","aria-label":s("registry.registryItemsPage.cardsViewAriaLabel"),className:e,children:s("registry.registryItemsPage.cards")}),t.jsx(ns,{value:"table","aria-label":s("registry.registryItemsPage.tableViewAriaLabel"),className:e,children:s("registry.registryItemsPage.table")})]}),t.jsx(Q,{variant:"outline",size:"sm",className:e,onClick:()=>h(!0),children:s("registry.registryItemsPage.importCsv")}),t.jsx(Q,{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(lr,{size:16,className:"text-muted-foreground shrink-0"}),t.jsx(je,{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"})]})}),D&&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(H,{variant:"default",children:["#",j]},`selected-tag-${j}`)),a.map(j=>t.jsx(H,{variant:"outline",children:j},`selected-category-${j}`)),r.trim()&&t.jsxs(H,{variant:"secondary",className:"max-w-[280px] truncate",children:["Search: ",r]}),t.jsx(Q,{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(D?"registry.registryItemsPage.noItemsFound":"registry.registryItemsPage.noMcpsInRegistry")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:s(D?"registry.registryItemsPage.tryRemovingFilters":"registry.registryItemsPage.addFirstMcpItem")}),!D&&t.jsx(Q,{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(ai,{item:j,onEdit:x,onDelete:f,onToggleVerified:A,onToggleOfficial:U},j.id))}),_.hasNextPage&&t.jsx("div",{ref:$,className:"h-2"})]}):t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"border rounded-lg overflow-auto",children:t.jsxs($t,{children:[t.jsx(zt,{children:t.jsxs(Je,{children:[t.jsx(he,{className:"w-[56px]",children:s("registry.registryItemsPage.icon")}),t.jsx(he,{children:s("registry.registryItemsPage.title")}),t.jsx(he,{children:s("registry.registryItemsPage.id")}),t.jsx(he,{children:s("registry.registryItemsPage.tags")}),t.jsx(he,{children:s("registry.registryItemsPage.categories")}),t.jsx(he,{children:s("registry.registryItemsPage.remoteUrl")}),t.jsx(he,{children:s("registry.registryItemsPage.visibility")}),t.jsx(he,{className:"text-right w-[68px]",children:s("registry.registryItemsPage.actions")})]})}),t.jsx(Ot,{children:k.map(j=>t.jsxs(Je,{children:[t.jsx(fe,{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(fe,{children:j.title}),t.jsx(fe,{className:"font-mono",children:j.id}),t.jsx(fe,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:wi(j).slice(0,3).map(z=>t.jsx(H,{variant:"outline",children:z},`${j.id}-tag-${z}`))})}),t.jsx(fe,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:_i(j).slice(0,3).map(z=>t.jsx(H,{variant:"outline",children:z},`${j.id}-category-${z}`))})}),t.jsx(fe,{children:Pi(j)}),t.jsx(fe,{children:j.is_public?t.jsxs(H,{variant:"default",className:"gap-1",children:[t.jsx(fs,{size:10}),s("registry.registryItemsPage.public")]}):t.jsx(H,{variant:"secondary",children:s("registry.registryItemsPage.private")})}),t.jsx(fe,{className:"text-right",children:t.jsxs(jt,{children:[t.jsx(ft,{asChild:!0,children:t.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0","aria-label":s("registry.registryItemsPage.actionsFor",{title:j.title}),children:t.jsx(Bt,{size:18})})}),t.jsxs(yt,{align:"end",children:[t.jsx(ke,{onClick:()=>x(j),children:s("registry.registryItemsPage.edit")}),t.jsx(ke,{variant:"destructive",onClick:()=>f(j),children:s("registry.registryItemsPage.delete")})]})]})})]},j.id))})]})}),_.hasNextPage&&t.jsx("div",{ref:$,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(Ci,{open:u||!!g,onOpenChange:j=>{j||(d(!1),x(null))},item:g,availableTags:S.map(j=>j.value),availableCategories:T.map(j=>j.value),isSubmitting:L.isPending||I.isPending,onSubmit:M},g?.id??"create"),t.jsx(Xr,{open:m,onOpenChange:h,isImporting:P.isPending,onImport:async j=>{try{const z=await P.mutateAsync(j);return V.success(s("registry.registryItemsPage.importedItems",{count:z.created})),z}catch(z){throw V.error(z instanceof Error?z.message:s("registry.registryItemsPage.failedToImportCsv")),z}}}),t.jsx(si,{open:!!p,onOpenChange:j=>{j||f(null)},title:p?.title??p?.id??"",isDeleting:R.isPending,onConfirm:F})]})}const Ii=[{value:"pending",labelKey:"registry.registryRequestsPage.statusPending"},{value:"approved",labelKey:"registry.registryRequestsPage.statusApproved"},{value:"rejected",labelKey:"registry.registryRequestsPage.statusRejected"}];function gs(s){const e=new Date(s);return Number.isNaN(e.getTime())?s:e.toLocaleDateString()}function xs(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 Ut(s){const e=s.server?.icons?.[0]?.src;return typeof e=="string"&&e.length>0?e:null}function ht(s){const e=Ie(s._meta);return{hasReadmeContent:!!e?.readme?.trim(),hasReadmeLink:!!e?.readme_url?.trim(),readmeContent:e?.readme?.trim()??"",readmeUrl:e?.readme_url?.trim()??""}}function ki(){const s=de(),[e,r]=q.useState("pending"),[i,n]=q.useState("created_at"),[l,c]=q.useState("asc"),[a,o]=q.useState(new Set),[u,d]=q.useState(!1),[m,h]=q.useState("private"),[g,x]=q.useState(!1),[p,f]=q.useState(null),[y,v]=q.useState(null),[C,_]=q.useState(null),[b,L]=q.useState(null),I=Ie(b?._meta),[R,P]=q.useState(""),k=zr({status:e,sortBy:i,sortDirection:l}),{reviewMutation:E,deleteMutation:D}=Hr(),{createMutation:N}=Ht(),S=k.data?.pages.flatMap(w=>w.items)??[],T=k.data?.pages[0]?.totalCount??0,$=k.isFetchingNextPage,M=!!k.hasNextPage,A=br(()=>{k.isFetchingNextPage||k.fetchNextPage()},M,$),U=new Set(S.filter(w=>w.status==="pending").map(w=>w.id)),F=S.filter(w=>U.has(w.id)),j=a.size,z=F.filter(w=>a.has(w.id)),K=S.filter(w=>a.has(w.id)).length,W=F.length>0&&F.every(w=>a.has(w.id)),J=()=>o(new Set),ue=(w,B)=>{o(X=>{const ne=new Set(X);return B?ne.add(w):ne.delete(w),ne})},le=w=>{o(B=>{const X=new Set(B);return X.has(w)?X.delete(w):X.add(w),X})},se=()=>{o(w=>{const B=new Set(w);for(const X of F)B.add(X.id);return B})},xe=async()=>{const w=y;if(w){v(null),f(w.id);try{await E.mutateAsync({id:w.id,status:"approved",reviewerNotes:void 0});const B=xs(w);await N.mutateAsync({id:B.id,title:B.title,description:B.description,_meta:B._meta,server:B.server,is_public:B.is_public}),V.success(s("registry.registryRequestsPage.requestApprovedAndAdded"))}catch(B){const X=B instanceof Error?B.message:"Failed to approve request";X.includes("UNIQUE constraint")||X.includes("already exists")?V.error(s("registry.registryRequestsPage.itemAlreadyExists")):V.error(X)}finally{f(null)}}},me=async()=>{if(C)try{await E.mutateAsync({id:C.id,status:"rejected",reviewerNotes:R.trim()||void 0}),V.success(s("registry.registryRequestsPage.requestRejected")),_(null),P("")}catch(w){V.error(w instanceof Error?w.message:"Failed to reject request")}},oe=async w=>{try{await D.mutateAsync(w.id),V.success(s("registry.registryRequestsPage.requestDeleted"))}catch(B){V.error(B instanceof Error?B.message:"Failed to delete request")}},re=async()=>{if(z.length===0||g)return;x(!0),d(!1);let w=0;const B=new Set;for(const ne of z)try{await E.mutateAsync({id:ne.id,status:"approved",reviewerNotes:void 0});const ce=xs(ne);await N.mutateAsync({id:ce.id,title:ce.title,description:ce.description,_meta:ce._meta,server:ce.server,is_public:m==="public"}),w++}catch{B.add(ne.id)}const X=B.size;w>0&&X===0?V.success(s("registry.registryRequestsPage.bulkApproveSuccess",{approvedCount:w,bulkVisibility:m})):w>0&&X>0?V.warning(s("registry.registryRequestsPage.bulkApprovePartial",{approvedCount:w,failedCount:X})):V.error(s("registry.registryRequestsPage.bulkApproveFailed")),o(B),x(!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(H,{variant:"secondary",className:"text-xs",children:T})]}),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:Ii.map(w=>t.jsx("button",{type:"button",className:te("px-2.5 py-1 text-xs rounded-md transition-colors",e===w.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>r(w.value),onClickCapture:()=>J(),children:s(w.labelKey)},w.value))}),t.jsxs("select",{className:"h-7 rounded-md border border-input bg-background px-2 text-xs",value:`${i}:${l}`,onChange:w=>{const[B,X]=w.target.value.split(":");n(B),c(X)},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:[k.isLoading?t.jsx("div",{className:"text-sm text-muted-foreground",children:s("registry.registryRequestsPage.loadingRequests")}):k.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:k.error instanceof Error?k.error.message:s("registry.registryRequestsPage.unknownError")})]}):S.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($t,{children:[t.jsx(zt,{children:t.jsxs(Je,{children:[e==="pending"&&t.jsx(he,{className:"w-10",children:t.jsx(as,{checked:W&&F.length>0,onCheckedChange:w=>{w?se():J()}})}),t.jsx(he,{children:s("registry.registryRequestsPage.columnName")}),t.jsx(he,{children:s("registry.registryRequestsPage.columnRequester")}),t.jsx(he,{children:s("registry.registryRequestsPage.columnTags")}),t.jsx(he,{children:s("registry.registryRequestsPage.columnStatus")}),t.jsx(he,{children:s("registry.registryRequestsPage.columnDate")}),t.jsx(he,{className:"text-right",children:s("registry.registryRequestsPage.columnActions")})]})}),t.jsx(Ot,{children:S.map(w=>{const B=Ut(w),X=Ie(w._meta)?.tags??[],ne=U.has(w.id),ce=a.has(w.id);return t.jsxs(Je,{className:te(ne&&"cursor-pointer",ce&&"bg-accent/20"),onClick:()=>{ne&&le(w.id)},children:[e==="pending"&&t.jsx(fe,{children:t.jsx(as,{checked:ce,onCheckedChange:ie=>ue(w.id,ie===!0),onClick:ie=>ie.stopPropagation()})}),t.jsx(fe,{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:B?t.jsx("img",{src:B,alt:w.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:w.title.slice(0,1).toUpperCase()})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:w.title}),w.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-[300px]",children:w.description})]})]})}),t.jsx(fe,{children:t.jsx("span",{className:"text-sm text-muted-foreground truncate",children:w.requester_name||w.requester_email||"-"})}),t.jsx(fe,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:X.slice(0,3).map(ie=>t.jsx(H,{variant:"secondary",className:"text-[10px]",children:ie},`${w.id}-tag-${ie}`))})}),t.jsx(fe,{children:t.jsx(H,{variant:"secondary",className:"capitalize text-[11px]",children:w.status})}),t.jsx(fe,{children:t.jsx("span",{className:"text-sm text-muted-foreground",children:gs(w.created_at)})}),t.jsx(fe,{className:"text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[t.jsxs(Q,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:ie=>{ie.stopPropagation(),L(w)},children:[t.jsx(ys,{size:13}),s("registry.registryRequestsPage.buttonView")]}),ne?t.jsxs(t.Fragment,{children:[t.jsxs(Q,{size:"sm",className:"h-7 text-xs px-2",onClick:ie=>{ie.stopPropagation(),v(w)},disabled:p!==null||g||ce,children:[t.jsx(We,{size:13}),p===w.id?s("registry.registryRequestsPage.approving"):s(ce?"registry.registryRequestsPage.selected":"registry.registryRequestsPage.buttonApprove")]}),t.jsxs(Q,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:ie=>{ie.stopPropagation(),_(w),P("")},disabled:E.isPending,children:[t.jsx(hr,{size:13}),s("registry.registryRequestsPage.buttonReject")]})]}):t.jsxs(Q,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:ie=>{ie.stopPropagation(),oe(w)},disabled:D.isPending,children:[t.jsx(ut,{size:13}),s("registry.registryRequestsPage.buttonDelete")]})]})})]},w.id)})})]}),S.length>0&&M?t.jsx("div",{ref:A,className:"h-1 w-full"}):null,$&&S.length>0?t.jsx("div",{className:"pt-3 text-xs text-muted-foreground",children:s("registry.registryRequestsPage.loadingMoreRequests")}):null]}),j>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:j})}),t.jsx(Q,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:se,disabled:W,children:s("registry.registryRequestsPage.selectAll")}),t.jsx(Q,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:J,children:s("registry.registryRequestsPage.clearSelection")}),t.jsxs(Q,{size:"sm",className:"h-7 text-xs px-2",onClick:()=>d(!0),disabled:g,children:[t.jsx(We,{size:13}),s("registry.registryRequestsPage.approveSelected")]})]})}):null,t.jsx(vt,{open:!!b,onOpenChange:w=>{w||L(null)},children:t.jsxs(bt,{className:"sm:max-w-[720px] max-h-[85vh] overflow-hidden flex flex-col",children:[t.jsxs(wt,{children:[t.jsx(Nt,{children:b?.title??s("registry.registryRequestsPage.requestDetails")}),t.jsx(Ct,{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:Ut(b)?t.jsx("img",{src:Ut(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:gs(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(ae,{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(ae,{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(ae,{children:s("registry.registryRequestsPage.labelTags")}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:(I?.tags??[]).length?(I?.tags??[]).map(w=>t.jsx(H,{variant:"secondary",children:w},`${b.id}-detail-tag-${w}`)):t.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{children:s("registry.registryRequestsPage.labelCategories")}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:(I?.categories??[]).length?(I?.categories??[]).map(w=>t.jsx(H,{variant:"secondary",children:w},`${b.id}-detail-category-${w}`)):t.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{children:s("registry.registryRequestsPage.labelREADME")}),ht(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:ht(b).readmeContent}):ht(b).hasReadmeLink?t.jsxs("a",{href:ht(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(vr,{size:14})]}):t.jsx("span",{className:"text-sm text-muted-foreground",children:s("registry.registryRequestsPage.noREADMEProvided")})]})]}),t.jsx(_t,{children:t.jsx(Q,{variant:"outline",onClick:()=>L(null),children:s("registry.registryRequestsPage.buttonClose")})})]})}),t.jsx(dt,{open:!!y,onOpenChange:w=>{w||v(null)},children:t.jsxs(ct,{children:[t.jsxs(nt,{children:[t.jsx(rt,{children:s("registry.registryRequestsPage.approvePublishRequestTitle")}),t.jsx(it,{children:s("registry.registryRequestsPage.approvePublishRequestDesc",{title:y?.title??""})})]}),t.jsxs(lt,{children:[t.jsx(ot,{children:s("registry.registryRequestsPage.buttonCancel")}),t.jsx(at,{onClick:xe,children:s("registry.registryRequestsPage.buttonApprove")})]})]})}),t.jsx(dt,{open:u,onOpenChange:d,children:t.jsxs(ct,{children:[t.jsxs(nt,{children:[t.jsx(rt,{children:s("registry.registryRequestsPage.approveSelectedRequestsTitle")}),t.jsx(it,{children:s("registry.registryRequestsPage.approveSelectedRequestsDesc",{count:z.length})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{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:w=>h(w.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(lt,{children:[t.jsx(ot,{disabled:g,children:s("registry.registryRequestsPage.buttonCancel")}),t.jsx(at,{onClick:re,disabled:g||K===0,children:s(g?"registry.registryRequestsPage.approving":"registry.registryRequestsPage.approveSelected")})]})]})}),t.jsx(vt,{open:!!C,onOpenChange:w=>{w||(_(null),P(""))},children:t.jsxs(bt,{children:[t.jsxs(wt,{children:[t.jsx(Nt,{children:s("registry.registryRequestsPage.rejectPublishRequestTitle")}),t.jsx(Ct,{children:s("registry.registryRequestsPage.rejectPublishRequestDesc")})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{htmlFor:"reject-notes",children:s("registry.registryRequestsPage.reviewerNotes")}),t.jsx(Rt,{id:"reject-notes",rows:4,value:R,onChange:w=>P(w.target.value),placeholder:s("registry.registryRequestsPage.reasonForRejectionPlaceholder")})]}),t.jsxs(_t,{children:[t.jsx(Q,{variant:"outline",onClick:()=>{_(null),P("")},children:s("registry.registryRequestsPage.buttonCancel")}),t.jsx(Q,{onClick:me,disabled:E.isPending,children:E.isPending?s("registry.registryRequestsPage.rejecting"):s("registry.registryRequestsPage.buttonReject")})]})]})})]})}function Si({revealedKey:s,onRevealedKeyChange:e}){const r=de(),{org:i}=Ne(),{uploadImage:n,isUploading:l}=Ps(),{registryName:c,registryIcon:a,acceptPublishRequests:o,requireApiToken:u,storePrivateOnly:d,rateLimitEnabled:m,rateLimitWindow:h,rateLimitMax:g,isSaving:x,updateConfig:p}=Cs(Ve),[f,y]=q.useState(c),[v,C]=q.useState(c);c!==v&&(C(c),y(c));const[_,b]=q.useState(a),[L,I]=q.useState(a);a!==L&&(I(a),b(a));const[R,P]=q.useState(String(g)),[k,E]=q.useState(g);g!==k&&(E(g),P(String(g)));const D=Vr(),{generateMutation:N,revokeMutation:S}=Gr(),[T,$]=q.useState(""),[M,A]=q.useState(!1),[U,F]=q.useState(null),{handleCopy:j,copied:z}=Et(),{handleCopy:K,copied:W}=Et(),{handleCopy:J,copied:ue}=Et(),le=Ns({search:"",tags:[],categories:[],limit:50}),se=`${window.location.origin}/org/${i.slug}/registry/mcp`,me=(le.data?.pages.flatMap(O=>O.items??[])??[]).filter(O=>O.is_public).length,oe=`${window.location.origin}/org/${i.slug}/registry/publish-request`,re=s?.slice(0,12)??null,w=!!(re&&(D.data?.items??[]).some(O=>O.prefix===re)),B=x||l,X=()=>{const O=f.trim();!O||O===c||p({registryName:O})},ne=()=>{const O=Number.parseInt(R,10),pe=Number.isFinite(O)&&O>=1?O:100;P(String(pe)),pe!==g&&p({rateLimitMax:pe})},ce=async O=>{if(!O)return;const pe=O.name.split(".").pop()||"png",Ce=`registry/${i.id}/identity/icon.${pe}`,Re=await n(O,Ce);Re?(b(Re),p({registryIcon:Re})):V.error(r("registry.registrySettingsPage.failedUploadIcon"))},ie=async()=>{const O=T.trim();if(O)try{const pe=await N.mutateAsync(O);pe?.key&&(e(pe.key),A(!1),$(""),V.success(r("registry.registrySettingsPage.apiKeyGenerated")))}catch(pe){V.error(pe instanceof Error?pe.message:r("registry.registrySettingsPage.failedGenerateApiKey"))}},Se=async O=>{try{await S.mutateAsync(O),e(null),F(null),V.success(r("registry.registrySettingsPage.apiKeyRevoked"))}catch(pe){V.error(pe instanceof Error?pe.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(ge,{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(ae,{htmlFor:"identity-name",children:r("registry.registrySettingsPage.name")}),t.jsx(je,{id:"identity-name",value:f,onChange:O=>y(O.target.value),onBlur:X,disabled:B,placeholder:r("registry.registrySettingsPage.namePlaceholder")})]}),t.jsx(ws,{value:_,onChange:b,onBlur:()=>{const O=_.trim();O!==a&&p({registryIcon:O})},onFileUpload:ce,isUploading:l})]})}),t.jsxs("div",{className:"grid gap-4 min-w-0 content-start",children:[t.jsxs(ge,{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(H,{variant:"secondary",children:[me," ",r(me===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:se}),t.jsx(Q,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:()=>j(se),children:z?t.jsx(Lt,{size:14}):t.jsx(At,{size:14})})]})]}),t.jsxs(ge,{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:O=>p({storePrivateOnly:O}),disabled:B})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.registrySettingsPage.storeVisibilityHelp")})]}),t.jsxs(ge,{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:O=>p({acceptPublishRequests:O}),disabled:B})]}),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:oe}),t.jsx(Q,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:()=>K(oe),children:W?t.jsx(Lt,{size:14}):t.jsx(At,{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(ae,{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:O=>p({requireApiToken:O}),disabled:B})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-2 border-t border-border",children:[t.jsxs("div",{children:[t.jsx(ae,{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:O=>p({rateLimitEnabled:O}),disabled:B})]}),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(ae,{htmlFor:"rate-limit-max",className:"text-sm font-medium",children:r("registry.registrySettingsPage.maxRequests")}),t.jsx(je,{id:"rate-limit-max",inputMode:"numeric",min:1,type:"number",value:R,onChange:O=>P(O.target.value),onBlur:ne,disabled:B,placeholder:r("registry.registrySettingsPage.maxRequestsPlaceholder")})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{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:h,onChange:O=>p({rateLimitWindow:O.target.value}),disabled:B,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(Nr,{size:14,className:"text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:r("registry.registrySettingsPage.apiKeys")})]}),s&&!w&&t.jsxs("div",{className:"rounded-md border border-border bg-muted/20 px-3 py-2 grid gap-1.5",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("registry.registrySettingsPage.newKeyRefreshing")}),t.jsx(je,{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(ae,{htmlFor:"api-key-name",className:"text-xs",children:r("registry.registrySettingsPage.keyName")}),t.jsx(je,{id:"api-key-name",value:T,onChange:O=>$(O.target.value),placeholder:r("registry.registrySettingsPage.keyNamePlaceholder"),className:"h-8 text-sm"})]}),t.jsxs(Q,{variant:"outline",size:"sm",className:"h-8 gap-1.5",disabled:!T.trim()||N.isPending,onClick:ie,children:[N.isPending?t.jsx(Ye,{size:14,className:"animate-spin"}):t.jsx(Cr,{size:14}),r("registry.registrySettingsPage.generate")]})]}),(D.data?.items?.length??0)>0&&t.jsx("div",{className:"grid gap-2",children:D.data?.items?.map(O=>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:O.name}),re===O.prefix?t.jsx(je,{readOnly:!0,value:M?s??"":"••••••••••••••••••••••••••••••••••••••••••••••••••••",className:"h-8 text-xs font-mono bg-muted/20"}):t.jsx(je,{readOnly:!0,value:`${O.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:[re===O.prefix&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>A(pe=>!pe),children:M?t.jsx(er,{size:14}):t.jsx(ys,{size:14})}),t.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:!s,onClick:()=>s&&J(s),children:ue?t.jsx(Lt,{size:14}):t.jsx(At,{size:14})})]}),t.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-destructive hover:text-destructive",disabled:S.isPending,onClick:()=>F({id:O.id,name:O.name}),children:t.jsx(ut,{size:14})})]})]},O.id))})]})]})]})]}),t.jsx(dt,{open:!!U,onOpenChange:O=>{!O&&!S.isPending&&F(null)},children:t.jsxs(ct,{children:[t.jsxs(nt,{children:[t.jsx(rt,{children:r("registry.registrySettingsPage.revokeApiKeyTitle")}),t.jsx(it,{children:r("registry.registrySettingsPage.revokeApiKeyDescription",{keyName:U?.name??""})})]}),t.jsxs(lt,{children:[t.jsx(ot,{disabled:S.isPending,children:r("registry.registrySettingsPage.cancel")}),t.jsx(at,{disabled:!U||S.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>U&&Se(U.id),children:S.isPending?r("registry.registrySettingsPage.revoking"):r("registry.registrySettingsPage.revokeKey")})]})]})})]})}function Di(s){const e=Z.c(8),{results:r}=s,i=de();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(ge,{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(Ti),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 Ti(s){return t.jsx(Mi,{result:s},s.id)}function Mi(s){const e=Z.c(56),{result:r}=s,i=de(),[n,l]=q.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(Li);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 h;e[19]!==m?(h=t.jsx(H,{variant:"destructive",className:"capitalize text-[10px] shrink-0",children:m}),e[19]=m,e[20]=h):h=e[20];let g;e[21]!==d||e[22]!==h?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[d,h]}),e[21]=d,e[22]=h,e[23]=g):g=e[23];let x;e[24]!==i?(x=i("registry.brokenMcpList.connStatus"),e[24]=i,e[25]=x):x=e[25];const p=r.connection_ok?"✓":"✗";let f;e[26]!==x||e[27]!==p?(f=t.jsxs("span",{children:[x,":"," ",p]}),e[26]=x,e[27]=p,e[28]=f):f=e[28];let y;e[29]!==i?(y=i("registry.brokenMcpList.toolsListed"),e[29]=i,e[30]=y):y=e[30];const v=r.tools_listed?"✓":"✗";let C;e[31]!==y||e[32]!==v?(C=t.jsxs("span",{children:[y,":"," ",v]}),e[31]=y,e[32]=v,e[33]=C):C=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(H,{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]!==f||e[39]!==C||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:[f,C,_,b,L]}),e[38]=f,e[39]=C,e[40]=_,e[41]=b,e[42]=L,e[43]=I):I=e[43];let R;e[44]!==r.error_message?(R=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]=R):R=e[45];let P;e[46]!==I||e[47]!==R||e[48]!==g?(P=t.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[g,I,R]}),e[46]=I,e[47]=R,e[48]=g,e[49]=P):P=e[49];const k=n?"▲":"▼";let E;e[50]!==k?(E=t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0 mt-1",children:k}),e[50]=k,e[51]=E):E=e[51];let D;e[52]!==P||e[53]!==o||e[54]!==E?(D=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,P,E]}),e[52]=P,e[53]=o,e[54]=E,e[55]=D):D=e[55],c=t.jsxs(ge,{className:"overflow-hidden",children:[D,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(N=>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:N.toolName}),t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[N.durationMs,"ms"]})]}),N.error&&t.jsx("pre",{className:"text-[11px] whitespace-pre-wrap break-all text-destructive",children:N.error})]},`${r.id}-${N.toolName}`))]}),r.tool_results.length>0&&r.tool_results.some(Ei)&&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(qi).map(N=>t.jsxs(H,{variant:"secondary",className:"text-[10px]",children:["✓ ",N.toolName]},`${r.id}-${N.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 qi(s){return s.success}function Ei(s){return s.success}function Li(s){return!s.success}function Ai(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 Ui(){const s=de(),{settings:e,saveMutation:r}=vs(),i=q.useRef(e),[n,l]=q.useState(e),[c,a]=q.useState(!1),[o,u]=q.useState(!1);i.current!==e&&(i.current=e,l(e));const d=Ai(n,e),m=g=>{a(!1),l(x=>({...x,...g}))},h=async()=>{const g={...n,agentContext:(n.agentContext??"").trim()};await r.mutateAsync(g),l(g),a(!0),setTimeout(()=>a(!1),3e3)};return t.jsxs(ge,{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(H,{className:"bg-warning/10 text-warning border-warning/20 text-[10px]",children:s("registry.monitorConfiguration.unsavedChanges")}),c&&t.jsxs(H,{className:"bg-success/10 text-success border-success/20 text-[10px]",children:["✓ ",s("registry.monitorConfiguration.saved")]}),t.jsx(Q,{size:"sm",onClick:h,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:g=>m({onFailure:g.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:g=>m({testPublicOnly:g.target.checked,testPrivateOnly:g.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:g=>m({testPrivateOnly:g.target.checked,testPublicOnly:g.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:g=>m({includePendingRequests:g.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(Q,{size:"sm",variant:"outline",className:"h-7",onClick:()=>u(g=>!g),children:[s(o?"registry.monitorConfiguration.hideDefaultPrompt":"registry.monitorConfiguration.viewDefaultPrompt")," ",s("registry.monitorConfiguration.defaultSystemPrompt")]})]}),t.jsx(Rt,{value:n.agentContext??"",onChange:g=>m({agentContext:g.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:Sr})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.perMcpTimeoutLabel"),hint:s("registry.monitorConfiguration.perMcpTimeoutHint")}),t.jsx(je,{type:"number",value:n.perMcpTimeoutMs,onChange:g=>m({perMcpTimeoutMs:Number(g.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(je,{type:"number",value:n.perToolTimeoutMs,onChange:g=>m({perToolTimeoutMs:Number(g.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(je,{type:"number",value:n.maxAgentSteps,onChange:g=>m({maxAgentSteps:Number(g.target.value)}),min:1,max:30})]})]})]})}function He(s){const e=Z.c(16),{label:r,hint:i}=s,n=de();let l;e[0]!==r?(l=t.jsx(ae,{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(Ys,{size:14}),e[5]=a):a=e[5];let o;e[6]!==c?(o=t.jsx(wr,{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(_r,{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(Pr,{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 Fi(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 $i(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 zi(s){const e=Z.c(4),{icon:r,title:i}=s,[n,l]=q.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 Oi({entry:s,onAuthChanged:e,failedToolsCount:r,failedResultCount:i}){const[n,l]=q.useState(!1),[c,a]=q.useState(""),[o,u]=q.useState(!1),d=de(),m=Er(),{updateMutation:h}=Ht(),{org:g}=Ne(),x=Me(),p=Ue(),f=s.mapping.connection_id,y=s.mapping.auth_status,v=s.item?.title??s.mapping.item_id,C=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:Y.monitorConnectionAuthProbe(g.id,f),queryFn:async()=>Rr({url:`/api/${g.slug}/mcp/${f}`,token:null,orgId:g.id}),staleTime:1e4,retry:1,refetchOnWindowFocus:!1}),R=I.data,P=I.isLoading,k=R?.supportsOAuth??!1,E=R?.hasOAuthToken??!1,D=R?.isServerError??!1,N=R?.isAuthenticated??!1,S=D?void 0:R?.error,T=P?"checking":D?"server_error":S?"unreachable":k?N?E?"oauth_connected":"connected":"oauth_available":N?"connected":"token_required",$=()=>{m.mutate({connectionId:f,authStatus:"authenticated"},{onSuccess:()=>{e(),Gs(f),p.invalidateQueries({predicate:K=>K.queryKey[1]===Qs&&K.queryKey[3]===f})},onError:K=>V.error(d("registry.monitorConnectionsPanel.failedToSaveAuthStatus",{title:v,error:K instanceof Error?K.message:String(K)}))})},M=async()=>{l(!0);try{const W=(await I.refetch()).data;if(!W){V.error(d("registry.monitorConnectionsPanel.couldNotReachConnection",{title:v}));return}if(W.isAuthenticated){V.success(d("registry.monitorConnectionsPanel.connectionReachable",{title:v}));return}if(W.isServerError){V.error(d("registry.monitorConnectionsPanel.serverErrorConnection",{title:v}));return}if(W.error){V.error(d("registry.monitorConnectionsPanel.connectionUnreachable",{title:v,error:W.error}));return}if(!W.supportsOAuth){V.warning(d("registry.monitorConnectionsPanel.noOAuthSupport",{title:v}));return}V.info(d("registry.monitorConnectionsPanel.openingAuthWindow",{title:v}));const J=await Ir({connectionId:f,orgSlug:g.slug,clientName:`MCP Test - ${v}`,timeout:18e4,scope:"offline_access"});if(J.error){V.error(d("registry.monitorConnectionsPanel.oauthFailed",{title:v,error:J.error}));return}if(J.tokenInfo){if(!(await fetch(`/api/${g.slug}/connections/${f}/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 A(J.token);else{V.error(d("registry.monitorConnectionsPanel.failedToSaveOAuthTokens",{title:v}));return}}else J.token&&await A(J.token);V.success(d("registry.monitorConnectionsPanel.connectionAuthenticated",{title:v})),$(),await I.refetch()}catch(K){console.error("[MonitorConnectionsPanel] Auth error:",K),V.error(d("registry.monitorConnectionsPanel.authError",{error:K instanceof Error?K.message:String(K)}))}finally{l(!1)}},A=async K=>{await x.call("COLLECTION_CONNECTIONS_UPDATE",{id:f,data:{connection_token:K}})},U=async()=>{if(!c.trim()){V.error(d("registry.monitorConnectionsPanel.tokenCannotBeEmpty"));return}l(!0);try{await A(c),V.success(d("registry.monitorConnectionsPanel.tokenSaved",{title:v})),u(!1),a(""),$(),await I.refetch()}catch(K){V.error(d("registry.monitorConnectionsPanel.errorSavingToken",{error:K instanceof Error?K.message:String(K)}))}finally{l(!1)}},F=!P&&y==="authenticated"&&!E&&!o&&c.length===0,j=P&&y==="authenticated"&&!o&&c.length===0,z=async K=>{if(L){V.info(d("registry.monitorConnectionsPanel.visibilityOnlyForStore"));return}if(!s.item){V.error(d("registry.monitorConnectionsPanel.registryItemNotFound"));return}try{await h.mutateAsync({id:s.item.id,data:K}),V.success(d("registry.monitorConnectionsPanel.visibilityUpdated")),e()}catch(W){V.error(W instanceof Error?W.message:d("registry.monitorConnectionsPanel.failedToUpdateVisibility"))}};return t.jsxs(ge,{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(zi,{icon:C,title:v},C??v),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:v}),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(H,{variant:"outline",className:te("text-[10px]",Fi(y)),children:$i(y,d)}),t.jsx(H,{variant:_?"default":"secondary",className:"text-[10px]",children:d(_?"registry.monitorConnectionsPanel.public":"registry.monitorConnectionsPanel.notPublic")}),t.jsx(H,{variant:"outline",className:"text-[10px]",children:d(L?"registry.monitorConnectionsPanel.request":"registry.monitorConnectionsPanel.store")}),t.jsxs(H,{variant:"outline",className:te("text-[10px]",T==="server_error"||T==="unreachable"?"border-destructive/40 text-destructive":T==="oauth_connected"?"border-success/30 text-success":T==="oauth_available"?"border-sky-500/30 text-sky-600":T==="token_required"?"border-warning/30 text-warning":"text-muted-foreground"),children:[T==="checking"&&d("registry.monitorConnectionsPanel.checkingAuth"),T==="server_error"&&d("registry.monitorConnectionsPanel.serverError"),T==="unreachable"&&d("registry.monitorConnectionsPanel.unreachable"),T==="oauth_connected"&&d("registry.monitorConnectionsPanel.oauthConnected"),T==="oauth_available"&&d("registry.monitorConnectionsPanel.oauthAvailable"),T==="token_required"&&d("registry.monitorConnectionsPanel.tokenManualAuth"),T==="connected"&&d("registry.monitorConnectionsPanel.connected")]}),b&&t.jsx(H,{variant:"outline",className:"text-[10px]",children:d("registry.monitorConnectionsPanel.hiddenInPrivate")}),(i>0||r>0)&&t.jsx(H,{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(jt,{children:[t.jsx(ft,{asChild:!0,children:t.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0","aria-label":d("registry.monitorConnectionsPanel.actionsFor",{title:v}),children:t.jsx(Bt,{size:16})})}),t.jsx(yt,{align:"end",children:L?t.jsx(ke,{disabled:!0,children:d("registry.monitorConnectionsPanel.requestItemNoControls")}):t.jsxs(t.Fragment,{children:[t.jsx(ke,{onClick:()=>z({is_public:!1}),children:d("registry.monitorConnectionsPanel.hideFromPublicStore")}),t.jsx(ke,{onClick:()=>z({is_unlisted:!0}),children:d("registry.monitorConnectionsPanel.hideFromPrivateStore")}),t.jsx(ke,{onClick:()=>z({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(Q,{size:"sm",onClick:M,disabled:n,children:n?"...":d(E?"registry.monitorConnectionsPanel.reAuthOAuth":"registry.monitorConnectionsPanel.oauth")}),t.jsx(Q,{size:"sm",variant:"outline",onClick:()=>I.refetch(),disabled:n||P,children:d(P?"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")}):F?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(je,{type:"password",placeholder:d("registry.monitorConnectionsPanel.pasteApiTokenPlaceholder"),value:c,onChange:K=>a(K.target.value),className:"h-8 text-xs flex-1",onKeyDown:K=>{K.key==="Enter"&&!n&&c.trim()&&U()}}),t.jsx(Q,{size:"sm",className:"h-8 text-xs",onClick:U,disabled:n||!c.trim(),children:d("registry.monitorConnectionsPanel.save")}),t.jsx(Q,{size:"sm",variant:"ghost",className:"h-8 text-xs","aria-label":d("registry.monitorConnectionsPanel.cancelReplaceToken"),onClick:()=>{u(!1),a("")},children:"✕"})]})]})]})}function Bi(){const s=Z.c(87),e=de(),r=js(),n=kt("completed").data?.items?.[0],l=mt(n?.id,void 0,n?.status),c=qr(),[a,o]=q.useState("all");let u,d,m,h,g,x;if(s[0]!==r||s[1]!==l.data?.items||s[2]!==a||s[3]!==c||s[4]!==e){const y=r.data?.items??[];let v;s[11]!==l.data?.items?(v=(l.data?.items??[]).reduce(Ki,{}),s[11]=l.data?.items,s[12]=v):v=s[12];const C=v;let _;s[13]!==a?(_=B=>a==="all"?!0:B.source===a,s[13]=a,s[14]=_):_=s[14];const b=y.filter(_);u=ge,g="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 R;s[19]!==e?(R=e("registry.monitorConnectionsPanel.description1"),s[19]=e,s[20]=R):R=s[20];let P;s[21]!==R?(P=t.jsx("p",{className:"text-[10px] text-muted-foreground",children:R}),s[21]=R,s[22]=P):P=s[22];let k;s[23]!==e?(k=e("registry.monitorConnectionsPanel.description2"),s[23]=e,s[24]=k):k=s[24];let E;s[25]!==k?(E=t.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:k}),s[25]=k,s[26]=E):E=s[26];let D;s[27]!==e?(D=e("registry.monitorConnectionsPanel.description3"),s[27]=e,s[28]=D):D=s[28];let N;s[29]!==D?(N=t.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:D}),s[29]=D,s[30]=N):N=s[30];const S=a==="all"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let T;s[31]!==S?(T=te("px-2.5 py-1 text-xs rounded-md transition-colors",S),s[31]=S,s[32]=T):T=s[32];let $;s[33]===Symbol.for("react.memo_cache_sentinel")?($=()=>o("all"),s[33]=$):$=s[33];let M;s[34]!==e?(M=e("registry.monitorConnectionsPanel.filterAll"),s[34]=e,s[35]=M):M=s[35];let A;s[36]!==T||s[37]!==M?(A=t.jsx("button",{type:"button",className:T,onClick:$,children:M}),s[36]=T,s[37]=M,s[38]=A):A=s[38];const U=a==="store"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let F;s[39]!==U?(F=te("px-2.5 py-1 text-xs rounded-md transition-colors",U),s[39]=U,s[40]=F):F=s[40];let j;s[41]===Symbol.for("react.memo_cache_sentinel")?(j=()=>o("store"),s[41]=j):j=s[41];let z;s[42]!==e?(z=e("registry.monitorConnectionsPanel.filterStore"),s[42]=e,s[43]=z):z=s[43];let K;s[44]!==F||s[45]!==z?(K=t.jsx("button",{type:"button",className:F,onClick:j,children:z}),s[44]=F,s[45]=z,s[46]=K):K=s[46];const W=a==="request"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let J;s[47]!==W?(J=te("px-2.5 py-1 text-xs rounded-md transition-colors",W),s[47]=W,s[48]=J):J=s[48];let ue;s[49]===Symbol.for("react.memo_cache_sentinel")?(ue=()=>o("request"),s[49]=ue):ue=s[49];let le;s[50]!==e?(le=e("registry.monitorConnectionsPanel.filterRequests"),s[50]=e,s[51]=le):le=s[51];let se;s[52]!==J||s[53]!==le?(se=t.jsx("button",{type:"button",className:J,onClick:ue,children:le}),s[52]=J,s[53]=le,s[54]=se):se=s[54];let xe;s[55]!==A||s[56]!==K||s[57]!==se?(xe=t.jsxs("div",{className:"mt-2 inline-flex rounded-lg border border-border p-0.5",children:[A,K,se]}),s[55]=A,s[56]=K,s[57]=se,s[58]=xe):xe=s[58];let me;s[59]!==P||s[60]!==E||s[61]!==N||s[62]!==xe||s[63]!==I?(me=t.jsxs("div",{children:[I,P,E,N,xe]}),s[59]=P,s[60]=E,s[61]=N,s[62]=xe,s[63]=I,s[64]=me):me=s[64];let oe;s[65]!==c||s[66]!==e?(oe=()=>{c.mutate(void 0,{onSuccess:()=>V.success(e("registry.monitorConnectionsPanel.connectionsSynced")),onError:B=>V.error(e("registry.monitorConnectionsPanel.syncFailed",{error:B.message}))})},s[65]=c,s[66]=e,s[67]=oe):oe=s[67];let re;s[68]!==c.isPending||s[69]!==e?(re=c.isPending?e("registry.monitorConnectionsPanel.syncing"):e("registry.monitorConnectionsPanel.sync"),s[68]=c.isPending,s[69]=e,s[70]=re):re=s[70];let w;s[71]!==c.isPending||s[72]!==oe||s[73]!==re?(w=t.jsx(Q,{size:"sm",variant:"outline",onClick:oe,disabled:c.isPending,children:re}),s[71]=c.isPending,s[72]=oe,s[73]=re,s[74]=w):w=s[74],s[75]!==me||s[76]!==w?(x=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[me,w]}),s[75]=me,s[76]=w,s[77]=x):x=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")}),h=!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(B=>{const X=C[B.mapping.item_id]??{failedTools:0,failedResults:0};return t.jsx(Oi,{entry:B,onAuthChanged:()=>r.refetch(),failedToolsCount:X.failedTools,failedResultCount:X.failedResults},B.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]=h,s[9]=g,s[10]=x}else u=s[5],d=s[6],m=s[7],h=s[8],g=s[9],x=s[10];let p;s[78]!==d||s[79]!==m||s[80]!==h?(p=t.jsxs("div",{className:d,children:[m,h]}),s[78]=d,s[79]=m,s[80]=h,s[81]=p):p=s[81];let f;return s[82]!==u||s[83]!==g||s[84]!==x||s[85]!==p?(f=t.jsxs(u,{className:g,children:[x,p]}),s[82]=u,s[83]=g,s[84]=x,s[85]=p,s[86]=f):f=s[86],f}function Ki(s,e){const r=s[e.item_id]??{failedTools:0,failedResults:0},i=e.tool_results.filter(Hi).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 Hi(s){return!s.success}function Rs(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 Is(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 Vi(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 ks(s){const e=Vi(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 Gi(s){return s.total_items?Math.min(100,Math.round(s.tested_items/s.total_items*100)):0}function Qi(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 Yi(s){const e=Z.c(45),{result:r,index:i,icon:n}=s,l=de(),[c,a]=q.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:h,failedTools:g,hasToolTests:x}=ks(r.tool_results),p=d.length;let f;e[15]!==r.agent_summary?(f=Qi(r.agent_summary),e[15]=r.agent_summary,e[16]=f):f=e[16];const y=f,v=Math.max(u.length,y??0),C=v>0?l("registry.monitorDashboard.toolsTestedCount",{tested:p,discovered:v}):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 R=r.status==="passed"?"text-success":r.status==="needs_auth"?"text-warning":"text-destructive";let P;e[24]!==R?(P=te("shrink-0",R),e[24]=R,e[25]=P):P=e[25];const k=r.status==="passed"?"✓":r.status==="needs_auth"?"🔑":"✗";let E;e[26]!==P||e[27]!==k?(E=t.jsx("span",{className:P,children:k}),e[26]=P,e[27]=k,e[28]=E):E=e[28];let D;e[29]!==r.item_title?(D=t.jsx("span",{className:"font-medium truncate flex-1 min-w-0",children:r.item_title}),e[29]=r.item_title,e[30]=D):D=e[30];let N;e[31]!==r.duration_ms?(N=t.jsxs("span",{className:"text-muted-foreground shrink-0",children:[r.duration_ms,"ms"]}),e[31]=r.duration_ms,e[32]=N):N=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 T;e[33]!==S?(T=te("text-[9px] capitalize shrink-0",S),e[33]=S,e[34]=T):T=e[34];let $;e[35]!==r.status?($=r.status.replace("_"," "),e[35]=r.status,e[36]=$):$=e[36];let M;e[37]!==T||e[38]!==$?(M=t.jsx(H,{variant:"outline",className:T,children:$}),e[37]=T,e[38]=$,e[39]=M):M=e[39];let A;e[40]!==r.connection_ok||e[41]!==l?(A=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]=A):A=e[42];const U=c?"▲":"▼";let F;e[43]!==U?(F=t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:U}),e[43]=U,e[44]=F):F=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,E,D,N,M,A,r.tools_listed&&t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:x?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-success",children:[h,"✓"]})," ",t.jsxs("span",{className:te(g>0?"text-destructive":""),children:[g,"✗"]})]}):m&&u.length>0?t.jsx("span",{children:l("registry.monitorDashboard.toolsFoundCount",{count:u.length})}):l("registry.monitorDashboard.noToolsLabel")}),t.jsx(H,{variant:"outline",className:"text-[9px] shrink-0",children:C}),F]}),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(H,{variant:"destructive",className:"text-[9px] px-1.5 py-0",children:["action: ",r.action_taken]})]}),x?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:h,failed:g})}),t.jsx("div",{className:"space-y-0.5",children:d.map((j,z)=>t.jsx(Wi,{tool:j},`${r.id}-${j.toolName}-${z}`))})]}):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,z)=>t.jsx(H,{variant:"outline",className:"text-[10px] font-mono",children:j.toolName},`${r.id}-${j.toolName}-${z}`))})]}):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 Wi(s){const e=Z.c(31),{tool:r}=s,i=de(),[n,l]=q.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 h;e[9]!==r.durationMs?(h=t.jsxs("span",{className:"text-muted-foreground shrink-0",children:[r.durationMs,"ms"]}),e[9]=r.durationMs,e[10]=h):h=e[10];let g;e[11]!==r.error?(g=r.error&&t.jsx("span",{className:"text-destructive truncate max-w-28",title:r.error,children:r.error}),e[11]=r.error,e[12]=g):g=e[12];const x=n?"▲":"▼";let p;e[13]!==x?(p=t.jsx("span",{className:"text-muted-foreground",children:x}),e[13]=x,e[14]=p):p=e[14];let f;e[15]!==c||e[16]!==p||e[17]!==d||e[18]!==m||e[19]!==h||e[20]!==g?(f=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,h,g,p]}),e[15]=c,e[16]=p,e[17]=d,e[18]=m,e[19]=h,e[20]=g,e[21]=f):f=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 v;return e[28]!==f||e[29]!==y?(v=t.jsxs("div",{className:"rounded border border-border overflow-hidden",children:[f,y]}),e[28]=f,e[29]=y,e[30]=v):v=e[30],v}function Ji({activeRunId:s,onRunChange:e}){const r=de(),{settings:i}=vs(),[n,l]=q.useState(null),[c,a]=q.useState(!1),o=q.useRef(0),u=q.useRef(null),d=Dr(),m=Tr(),h=Kt(s),g=kt(),x=js(),p=h.data?.run??null,f=p?.status,y=p?.config_snapshot?.monitorMode??p?.config_snapshot?.testMode,v=mt(s,void 0,f),C=(g.data?.items??[]).find(N=>N.status==="running"),_=g.data?.items?.[0]?.id;!s&&_&&u.current!==_&&(u.current=_,queueMicrotask(()=>{e(_)}));const b=async()=>{const N=Date.now();if(N-o.current<1e3)return;o.current=N;const S=n??i.monitorMode,T=await d.mutateAsync({...i,monitorMode:S});e(T.run.id)},L=async()=>{if(C&&C.id!==s&&C.status==="running"){a(!0);return}await b()},I=async()=>{s&&await m.mutateAsync(s)},R=p?.status==="running",P=p?Is(p.started_at,p.finished_at):null,k=v.data?.items??[],E=(x.data?.items??[]).reduce((N,S)=>(N[S.mapping.item_id]=S.item?.server?.icons?.[0]?.src??null,N),{}),D=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(ge,{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:[C&&C.id!==s&&t.jsx(H,{variant:"outline",className:"text-[10px]",children:r("registry.monitorDashboard.runInProgressBadge",{runId:C.id.slice(0,8)})}),t.jsxs(Q,{size:"sm",onClick:L,disabled:d.isPending||R,className:"gap-1.5",children:[t.jsx(kr,{size:14}),d.isPending?r("registry.monitorDashboard.startingButton"):C&&C.id!==s?r("registry.monitorDashboard.startAnotherRunButton"):r("registry.monitorDashboard.startQaRunButton")]}),t.jsxs(Q,{size:"sm",variant:"outline",onClick:I,disabled:!s||!R,className:"gap-1.5",children:[t.jsx(Ws,{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:D,onChange:N=>l(N.target.value),disabled:R,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:N=>e(N.target.value||void 0),children:[t.jsx("option",{value:"",children:r("registry.monitorDashboard.autoSelectLatestRun")}),(g.data?.items??[]).map(N=>t.jsxs("option",{value:N.id,children:[new Date(N.created_at).toLocaleString()," -"," ",N.status]},N.id))]})]})]}),t.jsx("p",{className:"text-[11px] text-muted-foreground rounded-md bg-muted/30 px-2.5 py-2",children:r(D==="health_check"?"registry.monitorDashboard.modeDescriptionHealthCheck":D==="tool_call"?"registry.monitorDashboard.modeDescriptionToolCall":"registry.monitorDashboard.modeDescriptionAgentic")}),p?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[t.jsx(H,{className:te("capitalize",Rs(p.status),p.status==="running"?"animate-pulse":""),children:p.status}),t.jsx("span",{className:"text-xs text-muted-foreground",children:r("registry.monitorDashboard.itemsTestedCount",{tested:p.tested_items,total:p.total_items})}),P&&t.jsx("span",{className:"text-xs text-muted-foreground",children:P}),R&&p.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:p.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",p.failed_items>0?"bg-warning":"bg-success",R?"animate-pulse":""),style:{width:`${Gi(p)}%`}})}),t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:[t.jsxs(ge,{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:p.passed_items})]}),t.jsxs(ge,{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:p.failed_items})]}),t.jsxs(ge,{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:p.skipped_items})]}),t.jsxs(ge,{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:p.total_items})]})]})]}):t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.monitorDashboard.noRunSelectedMessage")})]}),t.jsxs(ge,{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:[R&&t.jsx(H,{className:"bg-primary/10 text-primary border-primary/20 animate-pulse",children:r("registry.monitorDashboard.runInProgressLabel")}),p&&t.jsx(H,{variant:"outline",className:"text-[10px]",children:r("registry.monitorDashboard.progressBadge",{tested:p.tested_items,total:p.total_items})}),y&&t.jsx(H,{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:N=>{N&&R&&N.scrollHeight-N.scrollTop-N.clientHeight<120&&requestAnimationFrame(()=>{N.scrollTop=N.scrollHeight})},className:"space-y-1 max-h-[60vh] overflow-auto pr-1",children:k.map((N,S)=>t.jsx(Yi,{result:N,index:S,icon:E[N.item_id]},N.id))})]})]}),t.jsx(dt,{open:c,onOpenChange:a,children:t.jsxs(ct,{children:[t.jsxs(nt,{children:[t.jsx(rt,{children:r("registry.monitorDashboard.confirmStartTitle")}),t.jsx(it,{children:r("registry.monitorDashboard.confirmStartDescription",{runId:C?` (${C.id})`:""})})]}),t.jsxs(lt,{children:[t.jsx(ot,{children:r("registry.monitorDashboard.cancelButtonDialog")}),t.jsx(at,{onClick:()=>{a(!1),b()},children:r("registry.monitorDashboard.startAnywayButton")})]})]})})]})}function Ss(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 Zi(s){switch(s){case"passed":return"✓";case"failed":return"✗";case"error":return"⚠";case"needs_auth":return"🔑";case"skipped":return"⏭";default:return"?"}}function Xi(s){const e=Z.c(28),{tool:r}=s,i=de(),[n,l]=q.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 h;e[9]!==r.durationMs?(h=t.jsxs("span",{className:"text-[10px] text-muted-foreground shrink-0",children:[r.durationMs,"ms"]}),e[9]=r.durationMs,e[10]=h):h=e[10];const g=n?"▲":"▼";let x;e[11]!==g?(x=t.jsx("span",{className:"text-[10px] text-muted-foreground",children:g}),e[11]=g,e[12]=x):x=e[12];let p;e[13]!==c||e[14]!==d||e[15]!==m||e[16]!==h||e[17]!==x?(p=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,h,x]}),e[13]=c,e[14]=d,e[15]=m,e[16]=h,e[17]=x,e[18]=p):p=e[18];let f;e[19]!==n||e[20]!==i||e[21]!==r.error||e[22]!==r.input||e[23]!==r.outputPreview?(f=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]=f):f=e[24];let y;return e[25]!==p||e[26]!==f?(y=t.jsxs("div",{className:"rounded border border-border",children:[p,f]}),e[25]=p,e[26]=f,e[27]=y):y=e[27],y}function en(s){const e=Z.c(60),{result:r}=s,i=de(),[n,l]=q.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:h}=ks(r.tool_results);let g;e[13]!==n?(g=()=>l(!n),e[13]=n,e[14]=g):g=e[14];let x;e[15]!==r.status?(x=Zi(r.status),e[15]=r.status,e[16]=x):x=e[16];let p;e[17]!==x?(p=t.jsx("span",{className:"text-base shrink-0",children:x}),e[17]=x,e[18]=p):p=e[18];let f;e[19]!==r.item_title?(f=t.jsx("p",{className:"text-sm font-medium truncate",children:r.item_title}),e[19]=r.item_title,e[20]=f):f=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 v;e[23]!==i?(v=i("registry.monitorRunDetail.conn"),e[23]=i,e[24]=v):v=e[24];const C=r.connection_ok?"✓":"✗";let _;e[25]!==v||e[26]!==C?(_=t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[v,":"," ",C]}),e[25]=v,e[26]=C,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 R=a.length>0&&t.jsx("span",{className:"text-[10px] text-muted-foreground",children:h?t.jsxs(t.Fragment,{children:[i("registry.monitorRunDetail.tools"),": ",d,"✓"," ",m,"✗"]}):t.jsxs(t.Fragment,{children:[a.length," ",i("registry.monitorRunDetail.toolsFound")]})});let P;e[33]!==r.action_taken||e[34]!==i?(P=r.action_taken!=="none"&&t.jsxs(H,{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]=P):P=e[35];let k;e[36]!==I||e[37]!==R||e[38]!==P||e[39]!==y||e[40]!==_?(k=t.jsxs("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[y,_,I,R,P]}),e[36]=I,e[37]=R,e[38]=P,e[39]=y,e[40]=_,e[41]=k):k=e[41];let E;e[42]!==k||e[43]!==f?(E=t.jsxs("div",{className:"min-w-0 flex-1",children:[f,k]}),e[42]=k,e[43]=f,e[44]=E):E=e[44];let D;e[45]!==r.status?(D=te("capitalize shrink-0",Ss(r.status)),e[45]=r.status,e[46]=D):D=e[46];let N;e[47]!==r.status?(N=r.status.replace("_"," "),e[47]=r.status,e[48]=N):N=e[48];let S;e[49]!==D||e[50]!==N?(S=t.jsx(H,{className:D,children:N}),e[49]=D,e[50]=N,e[51]=S):S=e[51];const T=n?"▲":"▼";let $;e[52]!==T?($=t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:T}),e[52]=T,e[53]=$):$=e[53];let M;e[54]!==E||e[55]!==S||e[56]!==g||e[57]!==$||e[58]!==p?(M=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:g,children:[p,E,S,$]}),e[54]=E,e[55]=S,e[56]=g,e[57]=$,e[58]=p,e[59]=M):M=e[59],c=t.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[M,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})]}),h?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((A,U)=>t.jsx(Xi,{tool:A},`${r.id}-${A.toolName}-${U}`))})]}):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((A,U)=>t.jsx(H,{variant:"outline",className:"text-[10px] font-mono",children:A.toolName},`${r.id}-${A.toolName}-${U}`))})]}):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 tn(s){const e=Z.c(4),{value:r,onChange:i}=s,n=de();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 sn(s){const e=Z.c(81),{runId:r}=s,i=de(),[n,l]=q.useState("all"),c=Kt(r),a=c.data?.run,o=mt(r,void 0,a?.status);let u,d,m,h,g,x,p,f,y,v,C,_,b;if(e[0]!==o||e[1]!==a||e[2]!==r||e[3]!==c||e[4]!==n||e[5]!==i){g=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 z;e[21]!==j?(z=t.jsx(ge,{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]=z):z=e[22],g=z;break e}C="space-y-3";let D;e[23]!==i?(D=i("registry.monitorRunDetail.runDetail"),e[23]=i,e[24]=D):D=e[24];let N;e[25]!==D?(N=t.jsx("h3",{className:"text-sm font-semibold",children:D}),e[25]=D,e[26]=N):N=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 T;e[29]!==N||e[30]!==S?(T=t.jsxs("div",{children:[N,S]}),e[29]=N,e[30]=S,e[31]=T):T=e[31];let $;e[32]!==a?($=a&&t.jsx(H,{className:te("capitalize",Ss(a.status)),children:a.status}),e[32]=a,e[33]=$):$=e[33];let M;e[34]!==o||e[35]!==c?(M=()=>{c.refetch(),o.refetch()},e[34]=o,e[35]=c,e[36]=M):M=e[36];let A;e[37]!==i?(A=i("registry.monitorRunDetail.refresh"),e[37]=i,e[38]=A):A=e[38];let U;e[39]!==M||e[40]!==A?(U=t.jsx(Q,{size:"sm",variant:"outline",onClick:M,children:A}),e[39]=M,e[40]=A,e[41]=U):U=e[41];let F;e[42]!==$||e[43]!==U?(F=t.jsxs("div",{className:"flex items-center gap-2",children:[$,U]}),e[42]=$,e[43]=U,e[44]=F):F=e[44],e[45]!==T||e[46]!==F?(_=t.jsx(ge,{className:"p-4",children:t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[T,F]})}),e[45]=T,e[46]=F,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(ge,{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(ge,{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(ge,{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(ge,{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(ge,{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?(h=a&&(a.started_at||a.finished_at)&&t.jsxs(ge,{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]=h):h=e[53],y="flex items-center justify-between gap-2",e[54]!==n?(v=t.jsx(tn,{value:n,onChange:l}),e[54]=n,e[55]=v):v=e[55],m="text-xs text-muted-foreground",x=d.length,p=" ",f=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]=h,e[10]=g,e[11]=x,e[12]=p,e[13]=f,e[14]=y,e[15]=v,e[16]=C,e[17]=_,e[18]=b}else u=e[6],d=e[7],m=e[8],h=e[9],g=e[10],x=e[11],p=e[12],f=e[13],y=e[14],v=e[15],C=e[16],_=e[17],b=e[18];if(g!==Symbol.for("react.early_return_sentinel"))return g;let L;e[56]!==m||e[57]!==x||e[58]!==p||e[59]!==f?(L=t.jsxs("span",{className:m,children:[x,p,f]}),e[56]=m,e[57]=x,e[58]=p,e[59]=f,e[60]=L):L=e[60];let I;e[61]!==L||e[62]!==y||e[63]!==v?(I=t.jsxs("div",{className:y,children:[v,L]}),e[61]=L,e[62]=y,e[63]=v,e[64]=I):I=e[64];let R;e[65]!==u||e[66]!==d.length||e[67]!==i?(R=d.length===0&&t.jsx(ge,{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]=R):R=e[68];let P;e[69]!==d?(P=d.map(rn),e[69]=d,e[70]=P):P=e[70];let k;e[71]!==R||e[72]!==P?(k=t.jsxs("div",{className:"space-y-2",children:[R,P]}),e[71]=R,e[72]=P,e[73]=k):k=e[73];let E;return e[74]!==h||e[75]!==I||e[76]!==k||e[77]!==C||e[78]!==_||e[79]!==b?(E=t.jsxs("div",{className:C,children:[_,b,h,I,k]}),e[74]=h,e[75]=I,e[76]=k,e[77]=C,e[78]=_,e[79]=b,e[80]=E):E=e[80],E}function rn(s){return t.jsx(en,{result:s},s.id)}function nn(s){return s.tested_items?`${Math.round(s.passed_items/s.tested_items*100)}%`:"-"}function on(s){const e=Z.c(20),{selectedRunId:r,onSelectRun:i}=s,n=kt();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(Q,{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 g;e[11]!==i||e[12]!==r?(g=x=>{const p=Is(x.started_at,x.finished_at),f=nn(x),y=r===x.id;return t.jsxs("button",{type:"button",onClick:()=>i(x.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(x.created_at).toLocaleString()})}),t.jsx(H,{className:te("capitalize",Rs(x.status)),children:x.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:[x.tested_items,"/",x.total_items," tested"]}),t.jsxs("span",{className:"text-success font-medium",children:[x.passed_items," passed"]}),x.failed_items>0&&t.jsxs("span",{className:"text-destructive font-medium",children:[x.failed_items," failed"]}),x.skipped_items>0&&t.jsxs("span",{className:"text-muted-foreground",children:[x.skipped_items," skipped"]}),t.jsxs("span",{className:"text-muted-foreground",children:["pass rate: ",f]}),p&&t.jsx("span",{className:"text-muted-foreground",children:p})]}),x.config_snapshot&&t.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[t.jsx(H,{variant:"outline",className:"text-[9px]",children:(x.config_snapshot.monitorMode??x.config_snapshot.testMode??"health_check").replace("_"," ")}),x.config_snapshot.onFailure!=="none"&&t.jsxs(H,{variant:"outline",className:"text-[9px] text-destructive",children:["on fail:"," ",x.config_snapshot.onFailure.replace(/_/g," ")]})]})]},x.id)},e[11]=i,e[12]=r,e[13]=g):g=e[13],d=c.map(g),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 h;return e[17]!==o||e[18]!==m?(h=t.jsx(ge,{className:"p-4",children:t.jsxs("div",{className:"space-y-3",children:[o,m]})}),e[17]=o,e[18]=m,e[19]=h):h=e[19],h}function an(){const s=Z.c(21),e=de(),[r,i]=q.useState(void 0),[n,l]=q.useState("tests"),a=Kt(r).data?.run?.status,o=mt(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(ln),s[2]=u,s[3]=d):d=s[3];const m=d;let h;s[4]!==n||s[5]!==e?(h=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 v=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",v?"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]=h):h=s[6];let g;s[7]!==r||s[8]!==n||s[9]!==m||s[10]!==e?(g=n==="tests"&&t.jsxs("div",{className:"space-y-6",children:[t.jsx(Ji,{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(sn,{runId:r}),t.jsx(on,{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(H,{variant:"destructive",className:"text-[10px] ml-1",children:m.length})]}),t.jsx(Di,{results:m})]})]})]}),s[7]=r,s[8]=n,s[9]=m,s[10]=e,s[11]=g):g=s[11];let x;s[12]!==n?(x=n==="configuration"&&t.jsx(Ui,{}),s[12]=n,s[13]=x):x=s[13];let p;s[14]!==n?(p=n==="connections"&&t.jsx(Bi,{}),s[14]=n,s[15]=p):p=s[15];let f;return s[16]!==h||s[17]!==g||s[18]!==x||s[19]!==p?(f=t.jsxs("div",{className:"h-full overflow-auto px-4 md:px-6 py-4 space-y-6",children:[h,g,x,p]}),s[16]=h,s[17]=g,s[18]=x,s[19]=p,s[20]=f):f=s[20],f}function ln(s){return s.status==="failed"||s.status==="error"}function cn(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 io(s){const e=Z.c(59),{onBack:r}=s,i=de(),[n,l]=q.useState("items"),[c,a]=q.useState(null),{registryName:o,registryIcon:u,acceptPublishRequests:d}=Cs(Ve),m=Kr(),h=Lr();!d&&n==="requests"&&l("items");const g=m.data?.pending??0;let x;e[0]!==i?(x=i("registry.registryLayout.itemsTab"),e[0]=i,e[1]=x):x=e[1];const p=h.brokenCount>0?h.brokenCount:void 0;let f;e[2]!==x||e[3]!==p?(f={id:"items",label:x,icon:Js,tab:"items",count:p},e[2]=x,e[3]=p,e[4]=f):f=e[4];let y;e[5]!==d||e[6]!==g||e[7]!==i?(y=d?[{id:"requests",label:i("registry.registryLayout.requestsTab"),icon:We,tab:"requests",count:g}]:[],e[5]=d,e[6]=g,e[7]=i,e[8]=y):y=e[8];let v;e[9]!==i?(v=i("registry.registryLayout.qaTab"),e[9]=i,e[10]=v):v=e[10];let C;e[11]!==v?(C={id:"qa",label:v,icon:ps,tab:"qa"},e[11]=v,e[12]=C):C=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:tr,tab:"settings"},e[15]=_,e[16]=b):b=e[16];let L;e[17]!==f||e[18]!==y||e[19]!==C||e[20]!==b?(L=[f,...y,C,b],e[17]=f,e[18]=y,e[19]=C,e[20]=b,e[21]=L):L=e[21];const I=L;let R;e[22]!==r?(R=r&&t.jsx("button",{type:"button",className:"shrink-0 p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors cursor-pointer",onClick:r,children:t.jsx(Zs,{size:16})}),e[22]=r,e[23]=R):R=e[23];let P;e[24]===Symbol.for("react.memo_cache_sentinel")?(P=()=>l("settings"),e[24]=P):P=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 E;e[28]!==o?(E=t.jsx("span",{className:"text-sm font-medium truncate max-w-[220px]",children:o}),e[28]=o,e[29]=E):E=e[29];let D;e[30]!==k||e[31]!==E?(D=t.jsxs("button",{type:"button",className:"min-w-0 flex items-center gap-2 hover:opacity-90 transition-opacity cursor-pointer",onClick:P,children:[k,E]}),e[30]=k,e[31]=E,e[32]=D):D=e[32];let N;e[33]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"h-6 w-px bg-border shrink-0"}),e[33]=N):N=e[33];let S;e[34]!==n||e[35]!==I?(S=t.jsx(cn,{activeTab:n,onChange:l,items:I}),e[34]=n,e[35]=I,e[36]=S):S=e[36];let T;e[37]!==R||e[38]!==D||e[39]!==S?(T=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:[R,D,N,S]})}),e[37]=R,e[38]=D,e[39]=S,e[40]=T):T=e[40];let $;e[41]!==n?($=n==="items"&&t.jsx(Ri,{}),e[41]=n,e[42]=$):$=e[42];let M;e[43]!==d||e[44]!==n?(M=n==="requests"&&d&&t.jsx(ki,{}),e[43]=d,e[44]=n,e[45]=M):M=e[45];let A;e[46]!==n?(A=n==="qa"&&t.jsx(an,{}),e[46]=n,e[47]=A):A=e[47];let U;e[48]!==n||e[49]!==c?(U=n==="settings"&&t.jsx(Si,{revealedKey:c,onRevealedKeyChange:a}),e[48]=n,e[49]=c,e[50]=U):U=e[50];let F;e[51]!==$||e[52]!==M||e[53]!==A||e[54]!==U?(F=t.jsxs("main",{className:"flex-1 min-w-0 overflow-hidden",children:[$,M,A,U]}),e[51]=$,e[52]=M,e[53]=A,e[54]=U,e[55]=F):F=e[55];let j;return e[56]!==T||e[57]!==F?(j=t.jsxs("div",{className:"h-full flex flex-col bg-background overflow-hidden",children:[T,F]}),e[56]=T,e[57]=F,e[58]=j):j=e[58],j}export{io as default};
27
+ Describe your MCP here...`,rows:6,value:B,onChange:G=>X(G.target.value)}),ye.readme&&t.jsx("p",{className:"text-xs text-destructive",children:ye.readme})]})]}),t.jsx(di,{tools:De,onChange:xt,remoteUrl:tt(O)||void 0,remoteType:Ce,externalDiscoverStatus:g,externalDiscoverError:x})]});return t.jsx(vt,{open:s,onOpenChange:Xt,children:t.jsxs(bt,{className:"sm:max-w-[820px] max-h-[90vh] overflow-hidden flex flex-col",children:[t.jsxs(wt,{className:"space-y-3",children:[t.jsx(Nt,{children:o(f?"registry.registryItemDialog.editMcpServer":"registry.registryItemDialog.addMcpServer")}),t.jsx(yi,{current:F}),t.jsxs(Ct,{children:[F===1&&o("registry.registryItemDialog.step1Description"),F===2&&o("registry.registryItemDialog.step2Description"),F===3&&o("registry.registryItemDialog.step3Description")]})]}),t.jsxs("div",{className:"flex-1 overflow-y-auto pr-1 py-2",children:[F===1&&As,F===2&&Us,F===3&&Fs]}),t.jsxs(_t,{className:"flex items-center justify-between gap-2 sm:justify-between",children:[t.jsx("div",{children:F>1&&t.jsxs(Q,{variant:"ghost",size:"sm",onClick:Es,children:[t.jsx(gr,{size:14}),o("registry.registryItemDialog.back")]})}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Q,{variant:"outline",size:"sm",onClick:()=>Xt(!1),disabled:c,children:o("registry.registryItemDialog.cancel")}),F<3?t.jsxs(Q,{size:"sm",onClick:qs,children:[o("registry.registryItemDialog.next"),t.jsx(pr,{size:14})]}):t.jsx(Q,{size:"sm",onClick:Ls,disabled:c,children:o(c?"registry.registryItemDialog.saving":f?"registry.registryItemDialog.saveChanges":"registry.registryItemDialog.create")})]})]})]})})}function ms(s,e){return s.includes(e)?s.filter(r=>r!==e):[...s,e]}function wi(s){return Ie(s._meta)?.tags??[]}function _i(s){return Ie(s._meta)?.categories??[]}function Pi(s){return s.server?.remotes?.[0]?.url??"-"}function Ri(){const s=de(),e="h-8",[r,i]=q.useState(""),n=q.useDeferredValue(r),[l,c]=q.useState([]),[a,o]=q.useState([]),[u,d]=q.useState(!1),[m,h]=q.useState(!1),[g,x]=q.useState(null),[p,f]=q.useState(null),[y,v]=nr("private-registry-list","cards"),C=q.useRef(null),_=Ns({search:n,tags:l,categories:a}),b=Fr(),{createMutation:L,updateMutation:k,deleteMutation:R,bulkCreateMutation:P}=Ht(),S=_.data?.pages.flatMap(j=>j.items??[]).filter(Boolean)??[],E=_.data?.pages[0]?.totalCount??S.length,D=l.length>0||a.length>0||n.length>0,N=b.data,I=Array.isArray(N?.tags)?N.tags:[],T=Array.isArray(N?.categories)?N.categories:[],$=j=>{C.current&&(C.current.disconnect(),C.current=null),!(!j||!_.hasNextPage||_.isFetchingNextPage)&&(C.current=new IntersectionObserver(z=>{z[0]?.isIntersecting&&_.hasNextPage&&!_.isFetchingNextPage&&_.fetchNextPage()},{rootMargin:"240px 0px"}),C.current.observe(j))},M=async j=>{try{"data"in j?(await k.mutateAsync(j),V.success(s("registry.registryItemsPage.registryItemUpdated"))):(await L.mutateAsync(j),V.success(s("registry.registryItemsPage.registryItemCreated")))}catch(z){throw V.error(z instanceof Error?z.message:s("registry.registryItemsPage.failedToSaveItem")),z}},A=async j=>{const z=Ie(j._meta),K=z?.verified===!0;try{await k.mutateAsync({id:j.id,data:{_meta:Pt(j._meta,{...z,verified:!K})}}),V.success(s(K?"registry.registryItemsPage.removedVerifiedStatus":"registry.registryItemsPage.markedAsVerified"))}catch(W){V.error(W instanceof Error?W.message:s("registry.registryItemsPage.failedToUpdateItem"))}},U=async j=>{const z=Ie(j._meta),K=z?.official===!0;try{await k.mutateAsync({id:j.id,data:{_meta:Pt(j._meta,{...z,official:!K})}}),V.success(s(K?"registry.registryItemsPage.removedOfficialStatus":"registry.registryItemsPage.markedAsOfficial"))}catch(W){V.error(W instanceof Error?W.message:s("registry.registryItemsPage.failedToUpdateItem"))}},F=async()=>{if(p)try{await R.mutateAsync(p.id),V.success(s("registry.registryItemsPage.registryItemDeleted")),f(null)}catch(j){V.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(H,{variant:"secondary",className:"text-xs",children:E})]}),t.jsxs("div",{className:"flex items-center gap-2 self-stretch",children:[t.jsxs(jt,{children:[t.jsx(ft,{asChild:!0,children:t.jsxs(Q,{variant:"outline",size:"sm",className:te(e,"gap-1.5"),children:[t.jsx(or,{size:14}),s("registry.registryItemsPage.filters")]})}),t.jsxs(yt,{align:"end",className:"w-[260px]",children:[t.jsx(rs,{children:s("registry.registryItemsPage.tags")}),I.length>0?I.map(j=>t.jsxs(is,{checked:l.includes(j.value),onCheckedChange:()=>c(z=>ms(z,j.value)),children:[j.value," (",j.count,")"]},j.value)):t.jsx(ke,{disabled:!0,children:s("registry.registryItemsPage.noTagsAvailable")}),t.jsx(rr,{}),t.jsx(rs,{children:s("registry.registryItemsPage.categories")}),T.length>0?T.map(j=>t.jsxs(is,{checked:a.includes(j.value),onCheckedChange:()=>o(z=>ms(z,j.value)),children:[j.value," (",j.count,")"]},j.value)):t.jsx(ke,{disabled:!0,children:s("registry.registryItemsPage.noCategoriesAvailable")})]})]}),t.jsxs(ir,{type:"single",value:y,onValueChange:j=>{(j==="cards"||j==="table")&&v(j)},variant:"outline",className:e,children:[t.jsx(ns,{value:"cards","aria-label":s("registry.registryItemsPage.cardsViewAriaLabel"),className:e,children:s("registry.registryItemsPage.cards")}),t.jsx(ns,{value:"table","aria-label":s("registry.registryItemsPage.tableViewAriaLabel"),className:e,children:s("registry.registryItemsPage.table")})]}),t.jsx(Q,{variant:"outline",size:"sm",className:e,onClick:()=>h(!0),children:s("registry.registryItemsPage.importCsv")}),t.jsx(Q,{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(lr,{size:16,className:"text-muted-foreground shrink-0"}),t.jsx(je,{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"})]})}),D&&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(H,{variant:"default",children:["#",j]},`selected-tag-${j}`)),a.map(j=>t.jsx(H,{variant:"outline",children:j},`selected-category-${j}`)),r.trim()&&t.jsxs(H,{variant:"secondary",className:"max-w-[280px] truncate",children:["Search: ",r]}),t.jsx(Q,{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:[S.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(D?"registry.registryItemsPage.noItemsFound":"registry.registryItemsPage.noMcpsInRegistry")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:s(D?"registry.registryItemsPage.tryRemovingFilters":"registry.registryItemsPage.addFirstMcpItem")}),!D&&t.jsx(Q,{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:S.map(j=>t.jsx(ai,{item:j,onEdit:x,onDelete:f,onToggleVerified:A,onToggleOfficial:U},j.id))}),_.hasNextPage&&t.jsx("div",{ref:$,className:"h-2"})]}):t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"border rounded-lg overflow-auto",children:t.jsxs($t,{children:[t.jsx(zt,{children:t.jsxs(Je,{children:[t.jsx(he,{className:"w-[56px]",children:s("registry.registryItemsPage.icon")}),t.jsx(he,{children:s("registry.registryItemsPage.title")}),t.jsx(he,{children:s("registry.registryItemsPage.id")}),t.jsx(he,{children:s("registry.registryItemsPage.tags")}),t.jsx(he,{children:s("registry.registryItemsPage.categories")}),t.jsx(he,{children:s("registry.registryItemsPage.remoteUrl")}),t.jsx(he,{children:s("registry.registryItemsPage.visibility")}),t.jsx(he,{className:"text-right w-[68px]",children:s("registry.registryItemsPage.actions")})]})}),t.jsx(Ot,{children:S.map(j=>t.jsxs(Je,{children:[t.jsx(fe,{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(fe,{children:j.title}),t.jsx(fe,{className:"font-mono",children:j.id}),t.jsx(fe,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:wi(j).slice(0,3).map(z=>t.jsx(H,{variant:"outline",children:z},`${j.id}-tag-${z}`))})}),t.jsx(fe,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:_i(j).slice(0,3).map(z=>t.jsx(H,{variant:"outline",children:z},`${j.id}-category-${z}`))})}),t.jsx(fe,{children:Pi(j)}),t.jsx(fe,{children:j.is_public?t.jsxs(H,{variant:"default",className:"gap-1",children:[t.jsx(fs,{size:10}),s("registry.registryItemsPage.public")]}):t.jsx(H,{variant:"secondary",children:s("registry.registryItemsPage.private")})}),t.jsx(fe,{className:"text-right",children:t.jsxs(jt,{children:[t.jsx(ft,{asChild:!0,children:t.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0","aria-label":s("registry.registryItemsPage.actionsFor",{title:j.title}),children:t.jsx(Bt,{size:18})})}),t.jsxs(yt,{align:"end",children:[t.jsx(ke,{onClick:()=>x(j),children:s("registry.registryItemsPage.edit")}),t.jsx(ke,{variant:"destructive",onClick:()=>f(j),children:s("registry.registryItemsPage.delete")})]})]})})]},j.id))})]})}),_.hasNextPage&&t.jsx("div",{ref:$,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(Ci,{open:u||!!g,onOpenChange:j=>{j||(d(!1),x(null))},item:g,availableTags:I.map(j=>j.value),availableCategories:T.map(j=>j.value),isSubmitting:L.isPending||k.isPending,onSubmit:M},g?.id??"create"),t.jsx(Xr,{open:m,onOpenChange:h,isImporting:P.isPending,onImport:async j=>{try{const z=await P.mutateAsync(j);return V.success(s("registry.registryItemsPage.importedItems",{count:z.created})),z}catch(z){throw V.error(z instanceof Error?z.message:s("registry.registryItemsPage.failedToImportCsv")),z}}}),t.jsx(si,{open:!!p,onOpenChange:j=>{j||f(null)},title:p?.title??p?.id??"",isDeleting:R.isPending,onConfirm:F})]})}const Ii=[{value:"pending",labelKey:"registry.registryRequestsPage.statusPending"},{value:"approved",labelKey:"registry.registryRequestsPage.statusApproved"},{value:"rejected",labelKey:"registry.registryRequestsPage.statusRejected"}];function gs(s){const e=new Date(s);return Number.isNaN(e.getTime())?s:e.toLocaleDateString()}function xs(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 Ut(s){const e=s.server?.icons?.[0]?.src;return typeof e=="string"&&e.length>0?e:null}function ht(s){const e=Ie(s._meta);return{hasReadmeContent:!!e?.readme?.trim(),hasReadmeLink:!!e?.readme_url?.trim(),readmeContent:e?.readme?.trim()??"",readmeUrl:e?.readme_url?.trim()??""}}function ki(){const s=de(),[e,r]=q.useState("pending"),[i,n]=q.useState("created_at"),[l,c]=q.useState("asc"),[a,o]=q.useState(new Set),[u,d]=q.useState(!1),[m,h]=q.useState("private"),[g,x]=q.useState(!1),[p,f]=q.useState(null),[y,v]=q.useState(null),[C,_]=q.useState(null),[b,L]=q.useState(null),k=Ie(b?._meta),[R,P]=q.useState(""),S=zr({status:e,sortBy:i,sortDirection:l}),{reviewMutation:E,deleteMutation:D}=Hr(),{createMutation:N}=Ht(),I=S.data?.pages.flatMap(w=>w.items)??[],T=S.data?.pages[0]?.totalCount??0,$=S.isFetchingNextPage,M=!!S.hasNextPage,A=br(()=>{S.isFetchingNextPage||S.fetchNextPage()},M,$),U=new Set(I.filter(w=>w.status==="pending").map(w=>w.id)),F=I.filter(w=>U.has(w.id)),j=a.size,z=F.filter(w=>a.has(w.id)),K=I.filter(w=>a.has(w.id)).length,W=F.length>0&&F.every(w=>a.has(w.id)),J=()=>o(new Set),ue=(w,B)=>{o(X=>{const ne=new Set(X);return B?ne.add(w):ne.delete(w),ne})},le=w=>{o(B=>{const X=new Set(B);return X.has(w)?X.delete(w):X.add(w),X})},se=()=>{o(w=>{const B=new Set(w);for(const X of F)B.add(X.id);return B})},xe=async()=>{const w=y;if(w){v(null),f(w.id);try{await E.mutateAsync({id:w.id,status:"approved",reviewerNotes:void 0});const B=xs(w);await N.mutateAsync({id:B.id,title:B.title,description:B.description,_meta:B._meta,server:B.server,is_public:B.is_public}),V.success(s("registry.registryRequestsPage.requestApprovedAndAdded"))}catch(B){const X=B instanceof Error?B.message:"Failed to approve request";X.includes("UNIQUE constraint")||X.includes("already exists")?V.error(s("registry.registryRequestsPage.itemAlreadyExists")):V.error(X)}finally{f(null)}}},me=async()=>{if(C)try{await E.mutateAsync({id:C.id,status:"rejected",reviewerNotes:R.trim()||void 0}),V.success(s("registry.registryRequestsPage.requestRejected")),_(null),P("")}catch(w){V.error(w instanceof Error?w.message:"Failed to reject request")}},oe=async w=>{try{await D.mutateAsync(w.id),V.success(s("registry.registryRequestsPage.requestDeleted"))}catch(B){V.error(B instanceof Error?B.message:"Failed to delete request")}},re=async()=>{if(z.length===0||g)return;x(!0),d(!1);let w=0;const B=new Set;for(const ne of z)try{await E.mutateAsync({id:ne.id,status:"approved",reviewerNotes:void 0});const ce=xs(ne);await N.mutateAsync({id:ce.id,title:ce.title,description:ce.description,_meta:ce._meta,server:ce.server,is_public:m==="public"}),w++}catch{B.add(ne.id)}const X=B.size;w>0&&X===0?V.success(s("registry.registryRequestsPage.bulkApproveSuccess",{approvedCount:w,bulkVisibility:m})):w>0&&X>0?V.warning(s("registry.registryRequestsPage.bulkApprovePartial",{approvedCount:w,failedCount:X})):V.error(s("registry.registryRequestsPage.bulkApproveFailed")),o(B),x(!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(H,{variant:"secondary",className:"text-xs",children:T})]}),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:Ii.map(w=>t.jsx("button",{type:"button",className:te("px-2.5 py-1 text-xs rounded-md transition-colors",e===w.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),onClick:()=>r(w.value),onClickCapture:()=>J(),children:s(w.labelKey)},w.value))}),t.jsxs("select",{className:"h-7 rounded-md border border-input bg-background px-2 text-xs",value:`${i}:${l}`,onChange:w=>{const[B,X]=w.target.value.split(":");n(B),c(X)},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:[S.isLoading?t.jsx("div",{className:"text-sm text-muted-foreground",children:s("registry.registryRequestsPage.loadingRequests")}):S.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:S.error instanceof Error?S.error.message:s("registry.registryRequestsPage.unknownError")})]}):I.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($t,{children:[t.jsx(zt,{children:t.jsxs(Je,{children:[e==="pending"&&t.jsx(he,{className:"w-10",children:t.jsx(as,{checked:W&&F.length>0,onCheckedChange:w=>{w?se():J()}})}),t.jsx(he,{children:s("registry.registryRequestsPage.columnName")}),t.jsx(he,{children:s("registry.registryRequestsPage.columnRequester")}),t.jsx(he,{children:s("registry.registryRequestsPage.columnTags")}),t.jsx(he,{children:s("registry.registryRequestsPage.columnStatus")}),t.jsx(he,{children:s("registry.registryRequestsPage.columnDate")}),t.jsx(he,{className:"text-right",children:s("registry.registryRequestsPage.columnActions")})]})}),t.jsx(Ot,{children:I.map(w=>{const B=Ut(w),X=Ie(w._meta)?.tags??[],ne=U.has(w.id),ce=a.has(w.id);return t.jsxs(Je,{className:te(ne&&"cursor-pointer",ce&&"bg-accent/20"),onClick:()=>{ne&&le(w.id)},children:[e==="pending"&&t.jsx(fe,{children:t.jsx(as,{checked:ce,onCheckedChange:ie=>ue(w.id,ie===!0),onClick:ie=>ie.stopPropagation()})}),t.jsx(fe,{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:B?t.jsx("img",{src:B,alt:w.title,className:"h-full w-full object-cover",loading:"lazy"}):t.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:w.title.slice(0,1).toUpperCase()})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:w.title}),w.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-[300px]",children:w.description})]})]})}),t.jsx(fe,{children:t.jsx("span",{className:"text-sm text-muted-foreground truncate",children:w.requester_name||w.requester_email||"-"})}),t.jsx(fe,{children:t.jsx("div",{className:"flex flex-wrap gap-1",children:X.slice(0,3).map(ie=>t.jsx(H,{variant:"secondary",className:"text-[10px]",children:ie},`${w.id}-tag-${ie}`))})}),t.jsx(fe,{children:t.jsx(H,{variant:"secondary",className:"capitalize text-[11px]",children:w.status})}),t.jsx(fe,{children:t.jsx("span",{className:"text-sm text-muted-foreground",children:gs(w.created_at)})}),t.jsx(fe,{className:"text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[t.jsxs(Q,{size:"sm",variant:"ghost",className:"h-7 text-xs px-2",onClick:ie=>{ie.stopPropagation(),L(w)},children:[t.jsx(ys,{size:13}),s("registry.registryRequestsPage.buttonView")]}),ne?t.jsxs(t.Fragment,{children:[t.jsxs(Q,{size:"sm",className:"h-7 text-xs px-2",onClick:ie=>{ie.stopPropagation(),v(w)},disabled:p!==null||g||ce,children:[t.jsx(We,{size:13}),p===w.id?s("registry.registryRequestsPage.approving"):s(ce?"registry.registryRequestsPage.selected":"registry.registryRequestsPage.buttonApprove")]}),t.jsxs(Q,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:ie=>{ie.stopPropagation(),_(w),P("")},disabled:E.isPending,children:[t.jsx(hr,{size:13}),s("registry.registryRequestsPage.buttonReject")]})]}):t.jsxs(Q,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:ie=>{ie.stopPropagation(),oe(w)},disabled:D.isPending,children:[t.jsx(ut,{size:13}),s("registry.registryRequestsPage.buttonDelete")]})]})})]},w.id)})})]}),I.length>0&&M?t.jsx("div",{ref:A,className:"h-1 w-full"}):null,$&&I.length>0?t.jsx("div",{className:"pt-3 text-xs text-muted-foreground",children:s("registry.registryRequestsPage.loadingMoreRequests")}):null]}),j>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:j})}),t.jsx(Q,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:se,disabled:W,children:s("registry.registryRequestsPage.selectAll")}),t.jsx(Q,{size:"sm",variant:"outline",className:"h-7 text-xs px-2",onClick:J,children:s("registry.registryRequestsPage.clearSelection")}),t.jsxs(Q,{size:"sm",className:"h-7 text-xs px-2",onClick:()=>d(!0),disabled:g,children:[t.jsx(We,{size:13}),s("registry.registryRequestsPage.approveSelected")]})]})}):null,t.jsx(vt,{open:!!b,onOpenChange:w=>{w||L(null)},children:t.jsxs(bt,{className:"sm:max-w-[720px] max-h-[85vh] overflow-hidden flex flex-col",children:[t.jsxs(wt,{children:[t.jsx(Nt,{children:b?.title??s("registry.registryRequestsPage.requestDetails")}),t.jsx(Ct,{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:Ut(b)?t.jsx("img",{src:Ut(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:gs(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(ae,{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(ae,{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(ae,{children:s("registry.registryRequestsPage.labelTags")}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:(k?.tags??[]).length?(k?.tags??[]).map(w=>t.jsx(H,{variant:"secondary",children:w},`${b.id}-detail-tag-${w}`)):t.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{children:s("registry.registryRequestsPage.labelCategories")}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:(k?.categories??[]).length?(k?.categories??[]).map(w=>t.jsx(H,{variant:"secondary",children:w},`${b.id}-detail-category-${w}`)):t.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{children:s("registry.registryRequestsPage.labelREADME")}),ht(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:ht(b).readmeContent}):ht(b).hasReadmeLink?t.jsxs("a",{href:ht(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(vr,{size:14})]}):t.jsx("span",{className:"text-sm text-muted-foreground",children:s("registry.registryRequestsPage.noREADMEProvided")})]})]}),t.jsx(_t,{children:t.jsx(Q,{variant:"outline",onClick:()=>L(null),children:s("registry.registryRequestsPage.buttonClose")})})]})}),t.jsx(dt,{open:!!y,onOpenChange:w=>{w||v(null)},children:t.jsxs(ct,{children:[t.jsxs(nt,{children:[t.jsx(rt,{children:s("registry.registryRequestsPage.approvePublishRequestTitle")}),t.jsx(it,{children:s("registry.registryRequestsPage.approvePublishRequestDesc",{title:y?.title??""})})]}),t.jsxs(lt,{children:[t.jsx(ot,{children:s("registry.registryRequestsPage.buttonCancel")}),t.jsx(at,{onClick:xe,children:s("registry.registryRequestsPage.buttonApprove")})]})]})}),t.jsx(dt,{open:u,onOpenChange:d,children:t.jsxs(ct,{children:[t.jsxs(nt,{children:[t.jsx(rt,{children:s("registry.registryRequestsPage.approveSelectedRequestsTitle")}),t.jsx(it,{children:s("registry.registryRequestsPage.approveSelectedRequestsDesc",{count:z.length})})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{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:w=>h(w.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(lt,{children:[t.jsx(ot,{disabled:g,children:s("registry.registryRequestsPage.buttonCancel")}),t.jsx(at,{onClick:re,disabled:g||K===0,children:s(g?"registry.registryRequestsPage.approving":"registry.registryRequestsPage.approveSelected")})]})]})}),t.jsx(vt,{open:!!C,onOpenChange:w=>{w||(_(null),P(""))},children:t.jsxs(bt,{children:[t.jsxs(wt,{children:[t.jsx(Nt,{children:s("registry.registryRequestsPage.rejectPublishRequestTitle")}),t.jsx(Ct,{children:s("registry.registryRequestsPage.rejectPublishRequestDesc")})]}),t.jsxs("div",{className:"grid gap-1.5",children:[t.jsx(ae,{htmlFor:"reject-notes",children:s("registry.registryRequestsPage.reviewerNotes")}),t.jsx(Rt,{id:"reject-notes",rows:4,value:R,onChange:w=>P(w.target.value),placeholder:s("registry.registryRequestsPage.reasonForRejectionPlaceholder")})]}),t.jsxs(_t,{children:[t.jsx(Q,{variant:"outline",onClick:()=>{_(null),P("")},children:s("registry.registryRequestsPage.buttonCancel")}),t.jsx(Q,{onClick:me,disabled:E.isPending,children:E.isPending?s("registry.registryRequestsPage.rejecting"):s("registry.registryRequestsPage.buttonReject")})]})]})})]})}function Si({revealedKey:s,onRevealedKeyChange:e}){const r=de(),{org:i}=Ne(),{uploadImage:n,isUploading:l}=Ps(),{registryName:c,registryIcon:a,acceptPublishRequests:o,requireApiToken:u,storePrivateOnly:d,rateLimitEnabled:m,rateLimitWindow:h,rateLimitMax:g,isSaving:x,updateConfig:p}=Cs(Ve),[f,y]=q.useState(c),[v,C]=q.useState(c);c!==v&&(C(c),y(c));const[_,b]=q.useState(a),[L,k]=q.useState(a);a!==L&&(k(a),b(a));const[R,P]=q.useState(String(g)),[S,E]=q.useState(g);g!==S&&(E(g),P(String(g)));const D=Vr(),{generateMutation:N,revokeMutation:I}=Gr(),[T,$]=q.useState(""),[M,A]=q.useState(!1),[U,F]=q.useState(null),{handleCopy:j,copied:z}=Et(),{handleCopy:K,copied:W}=Et(),{handleCopy:J,copied:ue}=Et(),le=Ns({search:"",tags:[],categories:[],limit:50}),se=`${window.location.origin}/org/${i.slug}/registry/mcp`,me=(le.data?.pages.flatMap(O=>O.items??[])??[]).filter(O=>O.is_public).length,oe=`${window.location.origin}/org/${i.slug}/registry/publish-request`,re=s?.slice(0,12)??null,w=!!(re&&(D.data?.items??[]).some(O=>O.prefix===re)),B=x||l,X=()=>{const O=f.trim();!O||O===c||p({registryName:O})},ne=()=>{const O=Number.parseInt(R,10),pe=Number.isFinite(O)&&O>=1?O:100;P(String(pe)),pe!==g&&p({rateLimitMax:pe})},ce=async O=>{if(!O)return;const pe=O.name.split(".").pop()||"png",Ce=`registry/${i.id}/identity/icon.${pe}`,Re=await n(O,Ce);Re?(b(Re),p({registryIcon:Re})):V.error(r("registry.registrySettingsPage.failedUploadIcon"))},ie=async()=>{const O=T.trim();if(O)try{const pe=await N.mutateAsync(O);pe?.key&&(e(pe.key),A(!1),$(""),V.success(r("registry.registrySettingsPage.apiKeyGenerated")))}catch(pe){V.error(pe instanceof Error?pe.message:r("registry.registrySettingsPage.failedGenerateApiKey"))}},Se=async O=>{try{await I.mutateAsync(O),e(null),F(null),V.success(r("registry.registrySettingsPage.apiKeyRevoked"))}catch(pe){V.error(pe instanceof Error?pe.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(ge,{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(ae,{htmlFor:"identity-name",children:r("registry.registrySettingsPage.name")}),t.jsx(je,{id:"identity-name",value:f,onChange:O=>y(O.target.value),onBlur:X,disabled:B,placeholder:r("registry.registrySettingsPage.namePlaceholder")})]}),t.jsx(ws,{value:_,onChange:b,onBlur:()=>{const O=_.trim();O!==a&&p({registryIcon:O})},onFileUpload:ce,isUploading:l})]})}),t.jsxs("div",{className:"grid gap-4 min-w-0 content-start",children:[t.jsxs(ge,{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(H,{variant:"secondary",children:[me," ",r(me===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:se}),t.jsx(Q,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:()=>j(se),children:z?t.jsx(Lt,{size:14}):t.jsx(At,{size:14})})]})]}),t.jsxs(ge,{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:O=>p({storePrivateOnly:O}),disabled:B})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.registrySettingsPage.storeVisibilityHelp")})]}),t.jsxs(ge,{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:O=>p({acceptPublishRequests:O}),disabled:B})]}),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:oe}),t.jsx(Q,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:()=>K(oe),children:W?t.jsx(Lt,{size:14}):t.jsx(At,{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(ae,{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:O=>p({requireApiToken:O}),disabled:B})]}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-2 border-t border-border",children:[t.jsxs("div",{children:[t.jsx(ae,{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:O=>p({rateLimitEnabled:O}),disabled:B})]}),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(ae,{htmlFor:"rate-limit-max",className:"text-sm font-medium",children:r("registry.registrySettingsPage.maxRequests")}),t.jsx(je,{id:"rate-limit-max",inputMode:"numeric",min:1,type:"number",value:R,onChange:O=>P(O.target.value),onBlur:ne,disabled:B,placeholder:r("registry.registrySettingsPage.maxRequestsPlaceholder")})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(ae,{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:h,onChange:O=>p({rateLimitWindow:O.target.value}),disabled:B,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(Nr,{size:14,className:"text-muted-foreground"}),t.jsx("span",{className:"text-sm font-medium",children:r("registry.registrySettingsPage.apiKeys")})]}),s&&!w&&t.jsxs("div",{className:"rounded-md border border-border bg-muted/20 px-3 py-2 grid gap-1.5",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("registry.registrySettingsPage.newKeyRefreshing")}),t.jsx(je,{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(ae,{htmlFor:"api-key-name",className:"text-xs",children:r("registry.registrySettingsPage.keyName")}),t.jsx(je,{id:"api-key-name",value:T,onChange:O=>$(O.target.value),placeholder:r("registry.registrySettingsPage.keyNamePlaceholder"),className:"h-8 text-sm"})]}),t.jsxs(Q,{variant:"outline",size:"sm",className:"h-8 gap-1.5",disabled:!T.trim()||N.isPending,onClick:ie,children:[N.isPending?t.jsx(Ye,{size:14,className:"animate-spin"}):t.jsx(Cr,{size:14}),r("registry.registrySettingsPage.generate")]})]}),(D.data?.items?.length??0)>0&&t.jsx("div",{className:"grid gap-2",children:D.data?.items?.map(O=>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:O.name}),re===O.prefix?t.jsx(je,{readOnly:!0,value:M?s??"":"••••••••••••••••••••••••••••••••••••••••••••••••••••",className:"h-8 text-xs font-mono bg-muted/20"}):t.jsx(je,{readOnly:!0,value:`${O.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:[re===O.prefix&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>A(pe=>!pe),children:M?t.jsx(er,{size:14}):t.jsx(ys,{size:14})}),t.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:!s,onClick:()=>s&&J(s),children:ue?t.jsx(Lt,{size:14}):t.jsx(At,{size:14})})]}),t.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-destructive hover:text-destructive",disabled:I.isPending,onClick:()=>F({id:O.id,name:O.name}),children:t.jsx(ut,{size:14})})]})]},O.id))})]})]})]})]}),t.jsx(dt,{open:!!U,onOpenChange:O=>{!O&&!I.isPending&&F(null)},children:t.jsxs(ct,{children:[t.jsxs(nt,{children:[t.jsx(rt,{children:r("registry.registrySettingsPage.revokeApiKeyTitle")}),t.jsx(it,{children:r("registry.registrySettingsPage.revokeApiKeyDescription",{keyName:U?.name??""})})]}),t.jsxs(lt,{children:[t.jsx(ot,{disabled:I.isPending,children:r("registry.registrySettingsPage.cancel")}),t.jsx(at,{disabled:!U||I.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>U&&Se(U.id),children:I.isPending?r("registry.registrySettingsPage.revoking"):r("registry.registrySettingsPage.revokeKey")})]})]})})]})}function Di(s){const e=Z.c(8),{results:r}=s,i=de();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(ge,{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(Ti),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 Ti(s){return t.jsx(Mi,{result:s},s.id)}function Mi(s){const e=Z.c(56),{result:r}=s,i=de(),[n,l]=q.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(Li);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 h;e[19]!==m?(h=t.jsx(H,{variant:"destructive",className:"capitalize text-[10px] shrink-0",children:m}),e[19]=m,e[20]=h):h=e[20];let g;e[21]!==d||e[22]!==h?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[d,h]}),e[21]=d,e[22]=h,e[23]=g):g=e[23];let x;e[24]!==i?(x=i("registry.brokenMcpList.connStatus"),e[24]=i,e[25]=x):x=e[25];const p=r.connection_ok?"✓":"✗";let f;e[26]!==x||e[27]!==p?(f=t.jsxs("span",{children:[x,":"," ",p]}),e[26]=x,e[27]=p,e[28]=f):f=e[28];let y;e[29]!==i?(y=i("registry.brokenMcpList.toolsListed"),e[29]=i,e[30]=y):y=e[30];const v=r.tools_listed?"✓":"✗";let C;e[31]!==y||e[32]!==v?(C=t.jsxs("span",{children:[y,":"," ",v]}),e[31]=y,e[32]=v,e[33]=C):C=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(H,{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 k;e[38]!==f||e[39]!==C||e[40]!==_||e[41]!==b||e[42]!==L?(k=t.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground flex-wrap",children:[f,C,_,b,L]}),e[38]=f,e[39]=C,e[40]=_,e[41]=b,e[42]=L,e[43]=k):k=e[43];let R;e[44]!==r.error_message?(R=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]=R):R=e[45];let P;e[46]!==k||e[47]!==R||e[48]!==g?(P=t.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[g,k,R]}),e[46]=k,e[47]=R,e[48]=g,e[49]=P):P=e[49];const S=n?"▲":"▼";let E;e[50]!==S?(E=t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0 mt-1",children:S}),e[50]=S,e[51]=E):E=e[51];let D;e[52]!==P||e[53]!==o||e[54]!==E?(D=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,P,E]}),e[52]=P,e[53]=o,e[54]=E,e[55]=D):D=e[55],c=t.jsxs(ge,{className:"overflow-hidden",children:[D,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(N=>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:N.toolName}),t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[N.durationMs,"ms"]})]}),N.error&&t.jsx("pre",{className:"text-[11px] whitespace-pre-wrap break-all text-destructive",children:N.error})]},`${r.id}-${N.toolName}`))]}),r.tool_results.length>0&&r.tool_results.some(Ei)&&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(qi).map(N=>t.jsxs(H,{variant:"secondary",className:"text-[10px]",children:["✓ ",N.toolName]},`${r.id}-${N.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 qi(s){return s.success}function Ei(s){return s.success}function Li(s){return!s.success}function Ai(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 Ui(){const s=de(),{settings:e,saveMutation:r}=vs(),i=q.useRef(e),[n,l]=q.useState(e),[c,a]=q.useState(!1),[o,u]=q.useState(!1);i.current!==e&&(i.current=e,l(e));const d=Ai(n,e),m=g=>{a(!1),l(x=>({...x,...g}))},h=async()=>{const g={...n,agentContext:(n.agentContext??"").trim()};await r.mutateAsync(g),l(g),a(!0),setTimeout(()=>a(!1),3e3)};return t.jsxs(ge,{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(H,{className:"bg-warning/10 text-warning border-warning/20 text-[10px]",children:s("registry.monitorConfiguration.unsavedChanges")}),c&&t.jsxs(H,{className:"bg-success/10 text-success border-success/20 text-[10px]",children:["✓ ",s("registry.monitorConfiguration.saved")]}),t.jsx(Q,{size:"sm",onClick:h,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:g=>m({onFailure:g.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:g=>m({testPublicOnly:g.target.checked,testPrivateOnly:g.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:g=>m({testPrivateOnly:g.target.checked,testPublicOnly:g.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:g=>m({includePendingRequests:g.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(Q,{size:"sm",variant:"outline",className:"h-7",onClick:()=>u(g=>!g),children:[s(o?"registry.monitorConfiguration.hideDefaultPrompt":"registry.monitorConfiguration.viewDefaultPrompt")," ",s("registry.monitorConfiguration.defaultSystemPrompt")]})]}),t.jsx(Rt,{value:n.agentContext??"",onChange:g=>m({agentContext:g.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:Sr})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx(He,{label:s("registry.monitorConfiguration.perMcpTimeoutLabel"),hint:s("registry.monitorConfiguration.perMcpTimeoutHint")}),t.jsx(je,{type:"number",value:n.perMcpTimeoutMs,onChange:g=>m({perMcpTimeoutMs:Number(g.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(je,{type:"number",value:n.perToolTimeoutMs,onChange:g=>m({perToolTimeoutMs:Number(g.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(je,{type:"number",value:n.maxAgentSteps,onChange:g=>m({maxAgentSteps:Number(g.target.value)}),min:1,max:30})]})]})]})}function He(s){const e=Z.c(16),{label:r,hint:i}=s,n=de();let l;e[0]!==r?(l=t.jsx(ae,{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(Ys,{size:14}),e[5]=a):a=e[5];let o;e[6]!==c?(o=t.jsx(wr,{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(_r,{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(Pr,{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 Fi(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 $i(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 zi(s){const e=Z.c(4),{icon:r,title:i}=s,[n,l]=q.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 Oi({entry:s,onAuthChanged:e,failedToolsCount:r,failedResultCount:i}){const[n,l]=q.useState(!1),[c,a]=q.useState(""),[o,u]=q.useState(!1),d=de(),m=Er(),{updateMutation:h}=Ht(),{org:g}=Ne(),x=Me(),p=Ue(),f=s.mapping.connection_id,y=s.mapping.auth_status,v=s.item?.title??s.mapping.item_id,C=s.item?.server?.icons?.[0]?.src??null,_=s.item?.is_public??!1,b=s.item?.is_unlisted??!1,L=s.source==="request",k=Ae({queryKey:Y.monitorConnectionAuthProbe(g.id,f),queryFn:async()=>Rr({url:`/api/${g.slug}/mcp/${f}`,token:null,orgId:g.id}),staleTime:1e4,retry:1,refetchOnWindowFocus:!1}),R=k.data,P=k.isLoading,S=R?.supportsOAuth??!1,E=R?.hasOAuthToken??!1,D=R?.isServerError??!1,N=R?.isAuthenticated??!1,I=D?void 0:R?.error,T=P?"checking":D?"server_error":I?"unreachable":S?N?E?"oauth_connected":"connected":"oauth_available":N?"connected":"token_required",$=()=>{m.mutate({connectionId:f,authStatus:"authenticated"},{onSuccess:()=>{e(),Gs(f),p.invalidateQueries({predicate:K=>K.queryKey[1]===Qs&&K.queryKey[3]===f})},onError:K=>V.error(d("registry.monitorConnectionsPanel.failedToSaveAuthStatus",{title:v,error:K instanceof Error?K.message:String(K)}))})},M=async()=>{l(!0);try{const W=(await k.refetch()).data;if(!W){V.error(d("registry.monitorConnectionsPanel.couldNotReachConnection",{title:v}));return}if(W.isAuthenticated){V.success(d("registry.monitorConnectionsPanel.connectionReachable",{title:v}));return}if(W.isServerError){V.error(d("registry.monitorConnectionsPanel.serverErrorConnection",{title:v}));return}if(W.error){V.error(d("registry.monitorConnectionsPanel.connectionUnreachable",{title:v,error:W.error}));return}if(!W.supportsOAuth){V.warning(d("registry.monitorConnectionsPanel.noOAuthSupport",{title:v}));return}V.info(d("registry.monitorConnectionsPanel.openingAuthWindow",{title:v}));const J=await Ir({connectionId:f,orgSlug:g.slug,clientName:`MCP Test - ${v}`,timeout:18e4,scope:"offline_access"});if(J.error){V.error(d("registry.monitorConnectionsPanel.oauthFailed",{title:v,error:J.error}));return}if(J.tokenInfo){if(!(await fetch(`/api/${g.slug}/connections/${f}/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 A(J.token);else{V.error(d("registry.monitorConnectionsPanel.failedToSaveOAuthTokens",{title:v}));return}}else J.token&&await A(J.token);V.success(d("registry.monitorConnectionsPanel.connectionAuthenticated",{title:v})),$(),await k.refetch()}catch(K){console.error("[MonitorConnectionsPanel] Auth error:",K),V.error(d("registry.monitorConnectionsPanel.authError",{error:K instanceof Error?K.message:String(K)}))}finally{l(!1)}},A=async K=>{await x.call("COLLECTION_CONNECTIONS_UPDATE",{id:f,data:{connection_token:K}})},U=async()=>{if(!c.trim()){V.error(d("registry.monitorConnectionsPanel.tokenCannotBeEmpty"));return}l(!0);try{await A(c),V.success(d("registry.monitorConnectionsPanel.tokenSaved",{title:v})),u(!1),a(""),$(),await k.refetch()}catch(K){V.error(d("registry.monitorConnectionsPanel.errorSavingToken",{error:K instanceof Error?K.message:String(K)}))}finally{l(!1)}},F=!P&&y==="authenticated"&&!E&&!o&&c.length===0,j=P&&y==="authenticated"&&!o&&c.length===0,z=async K=>{if(L){V.info(d("registry.monitorConnectionsPanel.visibilityOnlyForStore"));return}if(!s.item){V.error(d("registry.monitorConnectionsPanel.registryItemNotFound"));return}try{await h.mutateAsync({id:s.item.id,data:K}),V.success(d("registry.monitorConnectionsPanel.visibilityUpdated")),e()}catch(W){V.error(W instanceof Error?W.message:d("registry.monitorConnectionsPanel.failedToUpdateVisibility"))}};return t.jsxs(ge,{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(zi,{icon:C,title:v},C??v),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:v}),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(H,{variant:"outline",className:te("text-[10px]",Fi(y)),children:$i(y,d)}),t.jsx(H,{variant:_?"default":"secondary",className:"text-[10px]",children:d(_?"registry.monitorConnectionsPanel.public":"registry.monitorConnectionsPanel.notPublic")}),t.jsx(H,{variant:"outline",className:"text-[10px]",children:d(L?"registry.monitorConnectionsPanel.request":"registry.monitorConnectionsPanel.store")}),t.jsxs(H,{variant:"outline",className:te("text-[10px]",T==="server_error"||T==="unreachable"?"border-destructive/40 text-destructive":T==="oauth_connected"?"border-success/30 text-success":T==="oauth_available"?"border-sky-500/30 text-sky-600":T==="token_required"?"border-warning/30 text-warning":"text-muted-foreground"),children:[T==="checking"&&d("registry.monitorConnectionsPanel.checkingAuth"),T==="server_error"&&d("registry.monitorConnectionsPanel.serverError"),T==="unreachable"&&d("registry.monitorConnectionsPanel.unreachable"),T==="oauth_connected"&&d("registry.monitorConnectionsPanel.oauthConnected"),T==="oauth_available"&&d("registry.monitorConnectionsPanel.oauthAvailable"),T==="token_required"&&d("registry.monitorConnectionsPanel.tokenManualAuth"),T==="connected"&&d("registry.monitorConnectionsPanel.connected")]}),b&&t.jsx(H,{variant:"outline",className:"text-[10px]",children:d("registry.monitorConnectionsPanel.hiddenInPrivate")}),(i>0||r>0)&&t.jsx(H,{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(jt,{children:[t.jsx(ft,{asChild:!0,children:t.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0","aria-label":d("registry.monitorConnectionsPanel.actionsFor",{title:v}),children:t.jsx(Bt,{size:16})})}),t.jsx(yt,{align:"end",children:L?t.jsx(ke,{disabled:!0,children:d("registry.monitorConnectionsPanel.requestItemNoControls")}):t.jsxs(t.Fragment,{children:[t.jsx(ke,{onClick:()=>z({is_public:!1}),children:d("registry.monitorConnectionsPanel.hideFromPublicStore")}),t.jsx(ke,{onClick:()=>z({is_unlisted:!0}),children:d("registry.monitorConnectionsPanel.hideFromPrivateStore")}),t.jsx(ke,{onClick:()=>z({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:[S&&t.jsx(Q,{size:"sm",onClick:M,disabled:n,children:n?"...":d(E?"registry.monitorConnectionsPanel.reAuthOAuth":"registry.monitorConnectionsPanel.oauth")}),t.jsx(Q,{size:"sm",variant:"outline",onClick:()=>k.refetch(),disabled:n||P,children:d(P?"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")}):F?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(je,{type:"password",placeholder:d("registry.monitorConnectionsPanel.pasteApiTokenPlaceholder"),value:c,onChange:K=>a(K.target.value),className:"h-8 text-xs flex-1",onKeyDown:K=>{K.key==="Enter"&&!n&&c.trim()&&U()}}),t.jsx(Q,{size:"sm",className:"h-8 text-xs",onClick:U,disabled:n||!c.trim(),children:d("registry.monitorConnectionsPanel.save")}),t.jsx(Q,{size:"sm",variant:"ghost",className:"h-8 text-xs","aria-label":d("registry.monitorConnectionsPanel.cancelReplaceToken"),onClick:()=>{u(!1),a("")},children:"✕"})]})]})]})}function Bi(){const s=Z.c(87),e=de(),r=js(),n=kt("completed").data?.items?.[0],l=mt(n?.id,void 0,n?.status),c=qr(),[a,o]=q.useState("all");let u,d,m,h,g,x;if(s[0]!==r||s[1]!==l.data?.items||s[2]!==a||s[3]!==c||s[4]!==e){const y=r.data?.items??[];let v;s[11]!==l.data?.items?(v=(l.data?.items??[]).reduce(Ki,{}),s[11]=l.data?.items,s[12]=v):v=s[12];const C=v;let _;s[13]!==a?(_=B=>a==="all"?!0:B.source===a,s[13]=a,s[14]=_):_=s[14];const b=y.filter(_);u=ge,g="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 k;s[17]!==L?(k=t.jsx("h3",{className:"text-sm font-semibold",children:L}),s[17]=L,s[18]=k):k=s[18];let R;s[19]!==e?(R=e("registry.monitorConnectionsPanel.description1"),s[19]=e,s[20]=R):R=s[20];let P;s[21]!==R?(P=t.jsx("p",{className:"text-[10px] text-muted-foreground",children:R}),s[21]=R,s[22]=P):P=s[22];let S;s[23]!==e?(S=e("registry.monitorConnectionsPanel.description2"),s[23]=e,s[24]=S):S=s[24];let E;s[25]!==S?(E=t.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:S}),s[25]=S,s[26]=E):E=s[26];let D;s[27]!==e?(D=e("registry.monitorConnectionsPanel.description3"),s[27]=e,s[28]=D):D=s[28];let N;s[29]!==D?(N=t.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:D}),s[29]=D,s[30]=N):N=s[30];const I=a==="all"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let T;s[31]!==I?(T=te("px-2.5 py-1 text-xs rounded-md transition-colors",I),s[31]=I,s[32]=T):T=s[32];let $;s[33]===Symbol.for("react.memo_cache_sentinel")?($=()=>o("all"),s[33]=$):$=s[33];let M;s[34]!==e?(M=e("registry.monitorConnectionsPanel.filterAll"),s[34]=e,s[35]=M):M=s[35];let A;s[36]!==T||s[37]!==M?(A=t.jsx("button",{type:"button",className:T,onClick:$,children:M}),s[36]=T,s[37]=M,s[38]=A):A=s[38];const U=a==="store"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let F;s[39]!==U?(F=te("px-2.5 py-1 text-xs rounded-md transition-colors",U),s[39]=U,s[40]=F):F=s[40];let j;s[41]===Symbol.for("react.memo_cache_sentinel")?(j=()=>o("store"),s[41]=j):j=s[41];let z;s[42]!==e?(z=e("registry.monitorConnectionsPanel.filterStore"),s[42]=e,s[43]=z):z=s[43];let K;s[44]!==F||s[45]!==z?(K=t.jsx("button",{type:"button",className:F,onClick:j,children:z}),s[44]=F,s[45]=z,s[46]=K):K=s[46];const W=a==="request"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground";let J;s[47]!==W?(J=te("px-2.5 py-1 text-xs rounded-md transition-colors",W),s[47]=W,s[48]=J):J=s[48];let ue;s[49]===Symbol.for("react.memo_cache_sentinel")?(ue=()=>o("request"),s[49]=ue):ue=s[49];let le;s[50]!==e?(le=e("registry.monitorConnectionsPanel.filterRequests"),s[50]=e,s[51]=le):le=s[51];let se;s[52]!==J||s[53]!==le?(se=t.jsx("button",{type:"button",className:J,onClick:ue,children:le}),s[52]=J,s[53]=le,s[54]=se):se=s[54];let xe;s[55]!==A||s[56]!==K||s[57]!==se?(xe=t.jsxs("div",{className:"mt-2 inline-flex rounded-lg border border-border p-0.5",children:[A,K,se]}),s[55]=A,s[56]=K,s[57]=se,s[58]=xe):xe=s[58];let me;s[59]!==P||s[60]!==E||s[61]!==N||s[62]!==xe||s[63]!==k?(me=t.jsxs("div",{children:[k,P,E,N,xe]}),s[59]=P,s[60]=E,s[61]=N,s[62]=xe,s[63]=k,s[64]=me):me=s[64];let oe;s[65]!==c||s[66]!==e?(oe=()=>{c.mutate(void 0,{onSuccess:()=>V.success(e("registry.monitorConnectionsPanel.connectionsSynced")),onError:B=>V.error(e("registry.monitorConnectionsPanel.syncFailed",{error:B.message}))})},s[65]=c,s[66]=e,s[67]=oe):oe=s[67];let re;s[68]!==c.isPending||s[69]!==e?(re=c.isPending?e("registry.monitorConnectionsPanel.syncing"):e("registry.monitorConnectionsPanel.sync"),s[68]=c.isPending,s[69]=e,s[70]=re):re=s[70];let w;s[71]!==c.isPending||s[72]!==oe||s[73]!==re?(w=t.jsx(Q,{size:"sm",variant:"outline",onClick:oe,disabled:c.isPending,children:re}),s[71]=c.isPending,s[72]=oe,s[73]=re,s[74]=w):w=s[74],s[75]!==me||s[76]!==w?(x=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[me,w]}),s[75]=me,s[76]=w,s[77]=x):x=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")}),h=!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(B=>{const X=C[B.mapping.item_id]??{failedTools:0,failedResults:0};return t.jsx(Oi,{entry:B,onAuthChanged:()=>r.refetch(),failedToolsCount:X.failedTools,failedResultCount:X.failedResults},B.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]=h,s[9]=g,s[10]=x}else u=s[5],d=s[6],m=s[7],h=s[8],g=s[9],x=s[10];let p;s[78]!==d||s[79]!==m||s[80]!==h?(p=t.jsxs("div",{className:d,children:[m,h]}),s[78]=d,s[79]=m,s[80]=h,s[81]=p):p=s[81];let f;return s[82]!==u||s[83]!==g||s[84]!==x||s[85]!==p?(f=t.jsxs(u,{className:g,children:[x,p]}),s[82]=u,s[83]=g,s[84]=x,s[85]=p,s[86]=f):f=s[86],f}function Ki(s,e){const r=s[e.item_id]??{failedTools:0,failedResults:0},i=e.tool_results.filter(Hi).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 Hi(s){return!s.success}function Rs(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 Is(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 Vi(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 ks(s){const e=Vi(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 Gi(s){return s.total_items?Math.min(100,Math.round(s.tested_items/s.total_items*100)):0}function Qi(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 Yi(s){const e=Z.c(45),{result:r,index:i,icon:n}=s,l=de(),[c,a]=q.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:h,failedTools:g,hasToolTests:x}=ks(r.tool_results),p=d.length;let f;e[15]!==r.agent_summary?(f=Qi(r.agent_summary),e[15]=r.agent_summary,e[16]=f):f=e[16];const y=f,v=Math.max(u.length,y??0),C=v>0?l("registry.monitorDashboard.toolsTestedCount",{tested:p,discovered:v}):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 k;e[21]!==n||e[22]!==r.item_title?(k=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]=k):k=e[23];const R=r.status==="passed"?"text-success":r.status==="needs_auth"?"text-warning":"text-destructive";let P;e[24]!==R?(P=te("shrink-0",R),e[24]=R,e[25]=P):P=e[25];const S=r.status==="passed"?"✓":r.status==="needs_auth"?"🔑":"✗";let E;e[26]!==P||e[27]!==S?(E=t.jsx("span",{className:P,children:S}),e[26]=P,e[27]=S,e[28]=E):E=e[28];let D;e[29]!==r.item_title?(D=t.jsx("span",{className:"font-medium truncate flex-1 min-w-0",children:r.item_title}),e[29]=r.item_title,e[30]=D):D=e[30];let N;e[31]!==r.duration_ms?(N=t.jsxs("span",{className:"text-muted-foreground shrink-0",children:[r.duration_ms,"ms"]}),e[31]=r.duration_ms,e[32]=N):N=e[32];const I=r.status==="passed"?"text-success border-success/20":r.status==="needs_auth"?"text-warning border-warning/20":"text-destructive border-destructive/20";let T;e[33]!==I?(T=te("text-[9px] capitalize shrink-0",I),e[33]=I,e[34]=T):T=e[34];let $;e[35]!==r.status?($=r.status.replace("_"," "),e[35]=r.status,e[36]=$):$=e[36];let M;e[37]!==T||e[38]!==$?(M=t.jsx(H,{variant:"outline",className:T,children:$}),e[37]=T,e[38]=$,e[39]=M):M=e[39];let A;e[40]!==r.connection_ok||e[41]!==l?(A=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]=A):A=e[42];const U=c?"▲":"▼";let F;e[43]!==U?(F=t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:U}),e[43]=U,e[44]=F):F=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,k,E,D,N,M,A,r.tools_listed&&t.jsx("span",{className:"text-[10px] text-muted-foreground shrink-0",children:x?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-success",children:[h,"✓"]})," ",t.jsxs("span",{className:te(g>0?"text-destructive":""),children:[g,"✗"]})]}):m&&u.length>0?t.jsx("span",{children:l("registry.monitorDashboard.toolsFoundCount",{count:u.length})}):l("registry.monitorDashboard.noToolsLabel")}),t.jsx(H,{variant:"outline",className:"text-[9px] shrink-0",children:C}),F]}),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(H,{variant:"destructive",className:"text-[9px] px-1.5 py-0",children:["action: ",r.action_taken]})]}),x?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:h,failed:g})}),t.jsx("div",{className:"space-y-0.5",children:d.map((j,z)=>t.jsx(Wi,{tool:j},`${r.id}-${j.toolName}-${z}`))})]}):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,z)=>t.jsx(H,{variant:"outline",className:"text-[10px] font-mono",children:j.toolName},`${r.id}-${j.toolName}-${z}`))})]}):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 Wi(s){const e=Z.c(31),{tool:r}=s,i=de(),[n,l]=q.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 h;e[9]!==r.durationMs?(h=t.jsxs("span",{className:"text-muted-foreground shrink-0",children:[r.durationMs,"ms"]}),e[9]=r.durationMs,e[10]=h):h=e[10];let g;e[11]!==r.error?(g=r.error&&t.jsx("span",{className:"text-destructive truncate max-w-28",title:r.error,children:r.error}),e[11]=r.error,e[12]=g):g=e[12];const x=n?"▲":"▼";let p;e[13]!==x?(p=t.jsx("span",{className:"text-muted-foreground",children:x}),e[13]=x,e[14]=p):p=e[14];let f;e[15]!==c||e[16]!==p||e[17]!==d||e[18]!==m||e[19]!==h||e[20]!==g?(f=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,h,g,p]}),e[15]=c,e[16]=p,e[17]=d,e[18]=m,e[19]=h,e[20]=g,e[21]=f):f=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 v;return e[28]!==f||e[29]!==y?(v=t.jsxs("div",{className:"rounded border border-border overflow-hidden",children:[f,y]}),e[28]=f,e[29]=y,e[30]=v):v=e[30],v}function Ji({activeRunId:s,onRunChange:e}){const r=de(),{settings:i}=vs(),[n,l]=q.useState(null),[c,a]=q.useState(!1),o=q.useRef(0),u=q.useRef(null),d=Dr(),m=Tr(),h=Kt(s),g=kt(),x=js(),p=h.data?.run??null,f=p?.status,y=p?.config_snapshot?.monitorMode??p?.config_snapshot?.testMode,v=mt(s,void 0,f),C=(g.data?.items??[]).find(N=>N.status==="running"),_=g.data?.items?.[0]?.id;!s&&_&&u.current!==_&&(u.current=_,queueMicrotask(()=>{e(_)}));const b=async()=>{const N=Date.now();if(N-o.current<1e3)return;o.current=N;const I=n??i.monitorMode,T=await d.mutateAsync({...i,monitorMode:I});e(T.run.id)},L=async()=>{if(C&&C.id!==s&&C.status==="running"){a(!0);return}await b()},k=async()=>{s&&await m.mutateAsync(s)},R=p?.status==="running",P=p?Is(p.started_at,p.finished_at):null,S=v.data?.items??[],E=(x.data?.items??[]).reduce((N,I)=>(N[I.mapping.item_id]=I.item?.server?.icons?.[0]?.src??null,N),{}),D=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(ge,{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:[C&&C.id!==s&&t.jsx(H,{variant:"outline",className:"text-[10px]",children:r("registry.monitorDashboard.runInProgressBadge",{runId:C.id.slice(0,8)})}),t.jsxs(Q,{size:"sm",onClick:L,disabled:d.isPending||R,className:"gap-1.5",children:[t.jsx(kr,{size:14}),d.isPending?r("registry.monitorDashboard.startingButton"):C&&C.id!==s?r("registry.monitorDashboard.startAnotherRunButton"):r("registry.monitorDashboard.startQaRunButton")]}),t.jsxs(Q,{size:"sm",variant:"outline",onClick:k,disabled:!s||!R,className:"gap-1.5",children:[t.jsx(Ws,{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:D,onChange:N=>l(N.target.value),disabled:R,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:N=>e(N.target.value||void 0),children:[t.jsx("option",{value:"",children:r("registry.monitorDashboard.autoSelectLatestRun")}),(g.data?.items??[]).map(N=>t.jsxs("option",{value:N.id,children:[new Date(N.created_at).toLocaleString()," -"," ",N.status]},N.id))]})]})]}),t.jsx("p",{className:"text-[11px] text-muted-foreground rounded-md bg-muted/30 px-2.5 py-2",children:r(D==="health_check"?"registry.monitorDashboard.modeDescriptionHealthCheck":D==="tool_call"?"registry.monitorDashboard.modeDescriptionToolCall":"registry.monitorDashboard.modeDescriptionAgentic")}),p?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[t.jsx(H,{className:te("capitalize",Rs(p.status),p.status==="running"?"animate-pulse":""),children:p.status}),t.jsx("span",{className:"text-xs text-muted-foreground",children:r("registry.monitorDashboard.itemsTestedCount",{tested:p.tested_items,total:p.total_items})}),P&&t.jsx("span",{className:"text-xs text-muted-foreground",children:P}),R&&p.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:p.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",p.failed_items>0?"bg-warning":"bg-success",R?"animate-pulse":""),style:{width:`${Gi(p)}%`}})}),t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:[t.jsxs(ge,{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:p.passed_items})]}),t.jsxs(ge,{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:p.failed_items})]}),t.jsxs(ge,{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:p.skipped_items})]}),t.jsxs(ge,{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:p.total_items})]})]})]}):t.jsx("p",{className:"text-xs text-muted-foreground",children:r("registry.monitorDashboard.noRunSelectedMessage")})]}),t.jsxs(ge,{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:S.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:[R&&t.jsx(H,{className:"bg-primary/10 text-primary border-primary/20 animate-pulse",children:r("registry.monitorDashboard.runInProgressLabel")}),p&&t.jsx(H,{variant:"outline",className:"text-[10px]",children:r("registry.monitorDashboard.progressBadge",{tested:p.tested_items,total:p.total_items})}),y&&t.jsx(H,{variant:"outline",className:"text-[10px]",children:r("registry.monitorDashboard.modeBadge",{mode:y.replace("_"," ")})})]})]}),S.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:N=>{N&&R&&N.scrollHeight-N.scrollTop-N.clientHeight<120&&requestAnimationFrame(()=>{N.scrollTop=N.scrollHeight})},className:"space-y-1 max-h-[60vh] overflow-auto pr-1",children:S.map((N,I)=>t.jsx(Yi,{result:N,index:I,icon:E[N.item_id]},N.id))})]})]}),t.jsx(dt,{open:c,onOpenChange:a,children:t.jsxs(ct,{children:[t.jsxs(nt,{children:[t.jsx(rt,{children:r("registry.monitorDashboard.confirmStartTitle")}),t.jsx(it,{children:r("registry.monitorDashboard.confirmStartDescription",{runId:C?` (${C.id})`:""})})]}),t.jsxs(lt,{children:[t.jsx(ot,{children:r("registry.monitorDashboard.cancelButtonDialog")}),t.jsx(at,{onClick:()=>{a(!1),b()},children:r("registry.monitorDashboard.startAnywayButton")})]})]})})]})}function Ss(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 Zi(s){switch(s){case"passed":return"✓";case"failed":return"✗";case"error":return"⚠";case"needs_auth":return"🔑";case"skipped":return"⏭";default:return"?"}}function Xi(s){const e=Z.c(28),{tool:r}=s,i=de(),[n,l]=q.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 h;e[9]!==r.durationMs?(h=t.jsxs("span",{className:"text-[10px] text-muted-foreground shrink-0",children:[r.durationMs,"ms"]}),e[9]=r.durationMs,e[10]=h):h=e[10];const g=n?"▲":"▼";let x;e[11]!==g?(x=t.jsx("span",{className:"text-[10px] text-muted-foreground",children:g}),e[11]=g,e[12]=x):x=e[12];let p;e[13]!==c||e[14]!==d||e[15]!==m||e[16]!==h||e[17]!==x?(p=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,h,x]}),e[13]=c,e[14]=d,e[15]=m,e[16]=h,e[17]=x,e[18]=p):p=e[18];let f;e[19]!==n||e[20]!==i||e[21]!==r.error||e[22]!==r.input||e[23]!==r.outputPreview?(f=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]=f):f=e[24];let y;return e[25]!==p||e[26]!==f?(y=t.jsxs("div",{className:"rounded border border-border",children:[p,f]}),e[25]=p,e[26]=f,e[27]=y):y=e[27],y}function en(s){const e=Z.c(60),{result:r}=s,i=de(),[n,l]=q.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:h}=ks(r.tool_results);let g;e[13]!==n?(g=()=>l(!n),e[13]=n,e[14]=g):g=e[14];let x;e[15]!==r.status?(x=Zi(r.status),e[15]=r.status,e[16]=x):x=e[16];let p;e[17]!==x?(p=t.jsx("span",{className:"text-base shrink-0",children:x}),e[17]=x,e[18]=p):p=e[18];let f;e[19]!==r.item_title?(f=t.jsx("p",{className:"text-sm font-medium truncate",children:r.item_title}),e[19]=r.item_title,e[20]=f):f=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 v;e[23]!==i?(v=i("registry.monitorRunDetail.conn"),e[23]=i,e[24]=v):v=e[24];const C=r.connection_ok?"✓":"✗";let _;e[25]!==v||e[26]!==C?(_=t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[v,":"," ",C]}),e[25]=v,e[26]=C,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 k;e[30]!==b||e[31]!==L?(k=t.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[b,":"," ",L]}),e[30]=b,e[31]=L,e[32]=k):k=e[32];const R=a.length>0&&t.jsx("span",{className:"text-[10px] text-muted-foreground",children:h?t.jsxs(t.Fragment,{children:[i("registry.monitorRunDetail.tools"),": ",d,"✓"," ",m,"✗"]}):t.jsxs(t.Fragment,{children:[a.length," ",i("registry.monitorRunDetail.toolsFound")]})});let P;e[33]!==r.action_taken||e[34]!==i?(P=r.action_taken!=="none"&&t.jsxs(H,{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]=P):P=e[35];let S;e[36]!==k||e[37]!==R||e[38]!==P||e[39]!==y||e[40]!==_?(S=t.jsxs("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[y,_,k,R,P]}),e[36]=k,e[37]=R,e[38]=P,e[39]=y,e[40]=_,e[41]=S):S=e[41];let E;e[42]!==S||e[43]!==f?(E=t.jsxs("div",{className:"min-w-0 flex-1",children:[f,S]}),e[42]=S,e[43]=f,e[44]=E):E=e[44];let D;e[45]!==r.status?(D=te("capitalize shrink-0",Ss(r.status)),e[45]=r.status,e[46]=D):D=e[46];let N;e[47]!==r.status?(N=r.status.replace("_"," "),e[47]=r.status,e[48]=N):N=e[48];let I;e[49]!==D||e[50]!==N?(I=t.jsx(H,{className:D,children:N}),e[49]=D,e[50]=N,e[51]=I):I=e[51];const T=n?"▲":"▼";let $;e[52]!==T?($=t.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:T}),e[52]=T,e[53]=$):$=e[53];let M;e[54]!==E||e[55]!==I||e[56]!==g||e[57]!==$||e[58]!==p?(M=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:g,children:[p,E,I,$]}),e[54]=E,e[55]=I,e[56]=g,e[57]=$,e[58]=p,e[59]=M):M=e[59],c=t.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[M,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})]}),h?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((A,U)=>t.jsx(Xi,{tool:A},`${r.id}-${A.toolName}-${U}`))})]}):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((A,U)=>t.jsx(H,{variant:"outline",className:"text-[10px] font-mono",children:A.toolName},`${r.id}-${A.toolName}-${U}`))})]}):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 tn(s){const e=Z.c(4),{value:r,onChange:i}=s,n=de();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 sn(s){const e=Z.c(81),{runId:r}=s,i=de(),[n,l]=q.useState("all"),c=Kt(r),a=c.data?.run,o=mt(r,void 0,a?.status);let u,d,m,h,g,x,p,f,y,v,C,_,b;if(e[0]!==o||e[1]!==a||e[2]!==r||e[3]!==c||e[4]!==n||e[5]!==i){g=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 z;e[21]!==j?(z=t.jsx(ge,{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]=z):z=e[22],g=z;break e}C="space-y-3";let D;e[23]!==i?(D=i("registry.monitorRunDetail.runDetail"),e[23]=i,e[24]=D):D=e[24];let N;e[25]!==D?(N=t.jsx("h3",{className:"text-sm font-semibold",children:D}),e[25]=D,e[26]=N):N=e[26];let I;e[27]!==r?(I=t.jsx("p",{className:"text-[10px] text-muted-foreground font-mono",children:r}),e[27]=r,e[28]=I):I=e[28];let T;e[29]!==N||e[30]!==I?(T=t.jsxs("div",{children:[N,I]}),e[29]=N,e[30]=I,e[31]=T):T=e[31];let $;e[32]!==a?($=a&&t.jsx(H,{className:te("capitalize",Ss(a.status)),children:a.status}),e[32]=a,e[33]=$):$=e[33];let M;e[34]!==o||e[35]!==c?(M=()=>{c.refetch(),o.refetch()},e[34]=o,e[35]=c,e[36]=M):M=e[36];let A;e[37]!==i?(A=i("registry.monitorRunDetail.refresh"),e[37]=i,e[38]=A):A=e[38];let U;e[39]!==M||e[40]!==A?(U=t.jsx(Q,{size:"sm",variant:"outline",onClick:M,children:A}),e[39]=M,e[40]=A,e[41]=U):U=e[41];let F;e[42]!==$||e[43]!==U?(F=t.jsxs("div",{className:"flex items-center gap-2",children:[$,U]}),e[42]=$,e[43]=U,e[44]=F):F=e[44],e[45]!==T||e[46]!==F?(_=t.jsx(ge,{className:"p-4",children:t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[T,F]})}),e[45]=T,e[46]=F,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(ge,{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(ge,{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(ge,{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(ge,{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(ge,{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?(h=a&&(a.started_at||a.finished_at)&&t.jsxs(ge,{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]=h):h=e[53],y="flex items-center justify-between gap-2",e[54]!==n?(v=t.jsx(tn,{value:n,onChange:l}),e[54]=n,e[55]=v):v=e[55],m="text-xs text-muted-foreground",x=d.length,p=" ",f=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]=h,e[10]=g,e[11]=x,e[12]=p,e[13]=f,e[14]=y,e[15]=v,e[16]=C,e[17]=_,e[18]=b}else u=e[6],d=e[7],m=e[8],h=e[9],g=e[10],x=e[11],p=e[12],f=e[13],y=e[14],v=e[15],C=e[16],_=e[17],b=e[18];if(g!==Symbol.for("react.early_return_sentinel"))return g;let L;e[56]!==m||e[57]!==x||e[58]!==p||e[59]!==f?(L=t.jsxs("span",{className:m,children:[x,p,f]}),e[56]=m,e[57]=x,e[58]=p,e[59]=f,e[60]=L):L=e[60];let k;e[61]!==L||e[62]!==y||e[63]!==v?(k=t.jsxs("div",{className:y,children:[v,L]}),e[61]=L,e[62]=y,e[63]=v,e[64]=k):k=e[64];let R;e[65]!==u||e[66]!==d.length||e[67]!==i?(R=d.length===0&&t.jsx(ge,{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]=R):R=e[68];let P;e[69]!==d?(P=d.map(rn),e[69]=d,e[70]=P):P=e[70];let S;e[71]!==R||e[72]!==P?(S=t.jsxs("div",{className:"space-y-2",children:[R,P]}),e[71]=R,e[72]=P,e[73]=S):S=e[73];let E;return e[74]!==h||e[75]!==k||e[76]!==S||e[77]!==C||e[78]!==_||e[79]!==b?(E=t.jsxs("div",{className:C,children:[_,b,h,k,S]}),e[74]=h,e[75]=k,e[76]=S,e[77]=C,e[78]=_,e[79]=b,e[80]=E):E=e[80],E}function rn(s){return t.jsx(en,{result:s},s.id)}function nn(s){return s.tested_items?`${Math.round(s.passed_items/s.tested_items*100)}%`:"-"}function on(s){const e=Z.c(20),{selectedRunId:r,onSelectRun:i}=s,n=kt();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(Q,{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 g;e[11]!==i||e[12]!==r?(g=x=>{const p=Is(x.started_at,x.finished_at),f=nn(x),y=r===x.id;return t.jsxs("button",{type:"button",onClick:()=>i(x.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(x.created_at).toLocaleString()})}),t.jsx(H,{className:te("capitalize",Rs(x.status)),children:x.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:[x.tested_items,"/",x.total_items," tested"]}),t.jsxs("span",{className:"text-success font-medium",children:[x.passed_items," passed"]}),x.failed_items>0&&t.jsxs("span",{className:"text-destructive font-medium",children:[x.failed_items," failed"]}),x.skipped_items>0&&t.jsxs("span",{className:"text-muted-foreground",children:[x.skipped_items," skipped"]}),t.jsxs("span",{className:"text-muted-foreground",children:["pass rate: ",f]}),p&&t.jsx("span",{className:"text-muted-foreground",children:p})]}),x.config_snapshot&&t.jsxs("div",{className:"mt-1.5 flex items-center gap-1.5",children:[t.jsx(H,{variant:"outline",className:"text-[9px]",children:(x.config_snapshot.monitorMode??x.config_snapshot.testMode??"health_check").replace("_"," ")}),x.config_snapshot.onFailure!=="none"&&t.jsxs(H,{variant:"outline",className:"text-[9px] text-destructive",children:["on fail:"," ",x.config_snapshot.onFailure.replace(/_/g," ")]})]})]},x.id)},e[11]=i,e[12]=r,e[13]=g):g=e[13],d=c.map(g),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 h;return e[17]!==o||e[18]!==m?(h=t.jsx(ge,{className:"p-4",children:t.jsxs("div",{className:"space-y-3",children:[o,m]})}),e[17]=o,e[18]=m,e[19]=h):h=e[19],h}function an(){const s=Z.c(21),e=de(),[r,i]=q.useState(void 0),[n,l]=q.useState("tests"),a=Kt(r).data?.run?.status,o=mt(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(ln),s[2]=u,s[3]=d):d=s[3];const m=d;let h;s[4]!==n||s[5]!==e?(h=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 v=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",v?"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]=h):h=s[6];let g;s[7]!==r||s[8]!==n||s[9]!==m||s[10]!==e?(g=n==="tests"&&t.jsxs("div",{className:"space-y-6",children:[t.jsx(Ji,{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(sn,{runId:r}),t.jsx(on,{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(H,{variant:"destructive",className:"text-[10px] ml-1",children:m.length})]}),t.jsx(Di,{results:m})]})]})]}),s[7]=r,s[8]=n,s[9]=m,s[10]=e,s[11]=g):g=s[11];let x;s[12]!==n?(x=n==="configuration"&&t.jsx(Ui,{}),s[12]=n,s[13]=x):x=s[13];let p;s[14]!==n?(p=n==="connections"&&t.jsx(Bi,{}),s[14]=n,s[15]=p):p=s[15];let f;return s[16]!==h||s[17]!==g||s[18]!==x||s[19]!==p?(f=t.jsxs("div",{className:"h-full overflow-auto px-4 md:px-6 py-4 space-y-6",children:[h,g,x,p]}),s[16]=h,s[17]=g,s[18]=x,s[19]=p,s[20]=f):f=s[20],f}function ln(s){return s.status==="failed"||s.status==="error"}function cn(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 io(s){const e=Z.c(59),{onBack:r}=s,i=de(),[n,l]=q.useState("items"),[c,a]=q.useState(null),{registryName:o,registryIcon:u,acceptPublishRequests:d}=Cs(Ve),m=Kr(),h=Lr();!d&&n==="requests"&&l("items");const g=m.data?.pending??0;let x;e[0]!==i?(x=i("registry.registryLayout.itemsTab"),e[0]=i,e[1]=x):x=e[1];const p=h.brokenCount>0?h.brokenCount:void 0;let f;e[2]!==x||e[3]!==p?(f={id:"items",label:x,icon:Js,tab:"items",count:p},e[2]=x,e[3]=p,e[4]=f):f=e[4];let y;e[5]!==d||e[6]!==g||e[7]!==i?(y=d?[{id:"requests",label:i("registry.registryLayout.requestsTab"),icon:We,tab:"requests",count:g}]:[],e[5]=d,e[6]=g,e[7]=i,e[8]=y):y=e[8];let v;e[9]!==i?(v=i("registry.registryLayout.qaTab"),e[9]=i,e[10]=v):v=e[10];let C;e[11]!==v?(C={id:"qa",label:v,icon:ps,tab:"qa"},e[11]=v,e[12]=C):C=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:tr,tab:"settings"},e[15]=_,e[16]=b):b=e[16];let L;e[17]!==f||e[18]!==y||e[19]!==C||e[20]!==b?(L=[f,...y,C,b],e[17]=f,e[18]=y,e[19]=C,e[20]=b,e[21]=L):L=e[21];const k=L;let R;e[22]!==r?(R=r&&t.jsx("button",{type:"button",className:"shrink-0 p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors cursor-pointer",onClick:r,children:t.jsx(Zs,{size:16})}),e[22]=r,e[23]=R):R=e[23];let P;e[24]===Symbol.for("react.memo_cache_sentinel")?(P=()=>l("settings"),e[24]=P):P=e[24];let S;e[25]!==u||e[26]!==o?(S=t.jsx("div",{className:"size-7 rounded-lg border border-border overflow-hidden bg-muted/20 flex items-center justify-center shrink-0",children: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]=S):S=e[27];let E;e[28]!==o?(E=t.jsx("span",{className:"text-sm font-medium truncate max-w-[220px]",children:o}),e[28]=o,e[29]=E):E=e[29];let D;e[30]!==S||e[31]!==E?(D=t.jsxs("button",{type:"button",className:"min-w-0 flex items-center gap-2 hover:opacity-90 transition-opacity cursor-pointer",onClick:P,children:[S,E]}),e[30]=S,e[31]=E,e[32]=D):D=e[32];let N;e[33]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"h-6 w-px bg-border shrink-0"}),e[33]=N):N=e[33];let I;e[34]!==n||e[35]!==k?(I=t.jsx(cn,{activeTab:n,onChange:l,items:k}),e[34]=n,e[35]=k,e[36]=I):I=e[36];let T;e[37]!==R||e[38]!==D||e[39]!==I?(T=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:[R,D,N,I]})}),e[37]=R,e[38]=D,e[39]=I,e[40]=T):T=e[40];let $;e[41]!==n?($=n==="items"&&t.jsx(Ri,{}),e[41]=n,e[42]=$):$=e[42];let M;e[43]!==d||e[44]!==n?(M=n==="requests"&&d&&t.jsx(ki,{}),e[43]=d,e[44]=n,e[45]=M):M=e[45];let A;e[46]!==n?(A=n==="qa"&&t.jsx(an,{}),e[46]=n,e[47]=A):A=e[47];let U;e[48]!==n||e[49]!==c?(U=n==="settings"&&t.jsx(Si,{revealedKey:c,onRevealedKeyChange:a}),e[48]=n,e[49]=c,e[50]=U):U=e[50];let F;e[51]!==$||e[52]!==M||e[53]!==A||e[54]!==U?(F=t.jsxs("main",{className:"flex-1 min-w-0 overflow-hidden",children:[$,M,A,U]}),e[51]=$,e[52]=M,e[53]=A,e[54]=U,e[55]=F):F=e[55];let j;return e[56]!==T||e[57]!==F?(j=t.jsxs("div",{className:"h-full flex flex-col bg-background overflow-hidden",children:[T,F]}),e[56]=T,e[57]=F,e[58]=j):j=e[58],j}export{io as default};