@decocms/mesh 2.109.1 → 2.110.0

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 (178) hide show
  1. package/dist/client/assets/{AlertCircle-BNHu4U_w.js → AlertCircle-54XkBG75.js} +1 -1
  2. package/dist/client/assets/{AlertOctagon-B_77zMvV.js → AlertOctagon-D-n2_Ity.js} +1 -1
  3. package/dist/client/assets/{AlertTriangle-B3iutOXb.js → AlertTriangle-ZoXqH5xx.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BCoINK1a.js → ArrowLeft-CYxjro91.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-BfLZrH4Z.js → ArrowUp-DRhMKIK5.js} +1 -1
  6. package/dist/client/assets/{Check-DG5LOfHE.js → Check-BHtow5c6.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-DXUyPLGJ.js → CheckCircle-DaStCoYU.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-BVECQ061.js → CheckDone01-BkzpeEp8.js} +1 -1
  9. package/dist/client/assets/{ChevronDown-P4XeJ9w5.js → ChevronDown-DIu5de-X.js} +1 -1
  10. package/dist/client/assets/{ChevronRight-CHS1psX7.js → ChevronRight-Ds0FvHp6.js} +1 -1
  11. package/dist/client/assets/{Clock-DbrHehdf.js → Clock-CwhFkG9v.js} +1 -1
  12. package/dist/client/assets/{Code01-Dte9rLPH.js → Code01-CfpShGlI.js} +1 -1
  13. package/dist/client/assets/{Container-DZJok7qt.js → Container-DZaD5nKa.js} +1 -1
  14. package/dist/client/assets/{Copy01-CBdgbqFW.js → Copy01-qW8IV1YX.js} +1 -1
  15. package/dist/client/assets/{Dataflow03-WvCvIAmM.js → Dataflow03-1bin_Ob0.js} +1 -1
  16. package/dist/client/assets/{DotsHorizontal-x234Trom.js → DotsHorizontal-BU6_dxo0.js} +1 -1
  17. package/dist/client/assets/{DotsVertical-BAfOGQhL.js → DotsVertical-BRM5SG1z.js} +1 -1
  18. package/dist/client/assets/{Download01-B_ClGnf8.js → Download01-C-bkrJJ_.js} +1 -1
  19. package/dist/client/assets/{Edit01-BtQjuTbw.js → Edit01-BFKPZm51.js} +1 -1
  20. package/dist/client/assets/{Eye-HNj86q6R.js → Eye-Ci58n8nv.js} +1 -1
  21. package/dist/client/assets/{File02-D7uMen2N.js → File02-nqEm0je3.js} +1 -1
  22. package/dist/client/assets/{File06-CqEjxUxt.js → File06-BrnW1ZQ1.js} +1 -1
  23. package/dist/client/assets/{FilterLines-bS8_Yh-E.js → FilterLines-PVC9VLDF.js} +1 -1
  24. package/dist/client/assets/{Globe01-BijbXV_r.js → Globe01-7CpfXn5N.js} +1 -1
  25. package/dist/client/assets/{Globe02-DKIs5RjV.js → Globe02-B27PYM5b.js} +1 -1
  26. package/dist/client/assets/{Grid01-CgP_l9be.js → Grid01-CCE4xs16.js} +1 -1
  27. package/dist/client/assets/{Home02-SUAjW3nz.js → Home02-BfUb9zF_.js} +1 -1
  28. package/dist/client/assets/{Image01-CTxAUEpv.js → Image01-CbvGPZGr.js} +1 -1
  29. package/dist/client/assets/{Inbox01-IqJkaMzy.js → Inbox01-B8fBrw9y.js} +1 -1
  30. package/dist/client/assets/{InfoCircle-Bb5NzZd-.js → InfoCircle-7KhXK-2T.js} +1 -1
  31. package/dist/client/assets/{Key01-BB3q5OcJ.js → Key01-ZjbbdeBE.js} +1 -1
  32. package/dist/client/assets/{LinkExternal01-BTGVW1Qi.js → LinkExternal01-C6wGiaKd.js} +1 -1
  33. package/dist/client/assets/{List-RSBUWz52.js → List-CnAhQJaO.js} +1 -1
  34. package/dist/client/assets/{Loading01-D-iQ3x6B.js → Loading01-CQxnYIyy.js} +1 -1
  35. package/dist/client/assets/{Lock01-BCf2m01i.js → Lock01-BXsNu63z.js} +1 -1
  36. package/dist/client/assets/{Pin01-I9LdYIlC.js → Pin01-CQimXkz7.js} +1 -1
  37. package/dist/client/assets/{Play-DqomGUHs.js → Play-CCFAjpE1.js} +1 -1
  38. package/dist/client/assets/{Plus-B8rm50Ox.js → Plus-ldykr1Qs.js} +1 -1
  39. package/dist/client/assets/{RefreshCcw01-ByoHxPlX.js → RefreshCcw01-DH9n4JeZ.js} +1 -1
  40. package/dist/client/assets/{RefreshCw01-D5lhZ8mX.js → RefreshCw01-DsWpmHoM.js} +1 -1
  41. package/dist/client/assets/{Save01-9tV2ohjl.js → Save01-DYGYdg7I.js} +1 -1
  42. package/dist/client/assets/{SearchMd-DWE3UxU2.js → SearchMd-CJBYDik4.js} +1 -1
  43. package/dist/client/assets/{Settings01-DKrG7yMR.js → Settings01-DZTt6EoC.js} +1 -1
  44. package/dist/client/assets/{Settings02-OMvHwhZ2.js → Settings02-By12van4.js} +1 -1
  45. package/dist/client/assets/{Share07-DK8c-5Z6.js → Share07-lImhPS0j.js} +1 -1
  46. package/dist/client/assets/{Terminal-DKHY5zjy.js → Terminal-DVM8ToJY.js} +1 -1
  47. package/dist/client/assets/{Tool01-BAR4Pm87.js → Tool01-CKCbyA0K.js} +1 -1
  48. package/dist/client/assets/{Trash01-DOoBIHb_.js → Trash01-DTuEjPqc.js} +1 -1
  49. package/dist/client/assets/{Upload01-DCltlStQ.js → Upload01-CbgKMs6Z.js} +1 -1
  50. package/dist/client/assets/{Users03-Bf7uxoC5.js → Users03-Bn4RTBQO.js} +1 -1
  51. package/dist/client/assets/{X-DA2sDUV2.js → X-PXGrxqUi.js} +1 -1
  52. package/dist/client/assets/{XCircle-D6Zk67At.js → XCircle-DkU1KZH1.js} +1 -1
  53. package/dist/client/assets/{XClose-D-0Eqw-_.js → XClose-CwEytWmM.js} +1 -1
  54. package/dist/client/assets/{agent-connections-preview-N_Bygs3y.js → agent-connections-preview-gRx2v-zj.js} +1 -1
  55. package/dist/client/assets/{agent-detail-B6enUst-.js → agent-detail-xJqhPPyM.js} +1 -1
  56. package/dist/client/assets/{agents-CF1_nQU-.js → agents-U0juIVTU.js} +1 -1
  57. package/dist/client/assets/alert-dialog-DeTFKcxV.js +7 -0
  58. package/dist/client/assets/{auth-catchall-D97a-l8D.js → auth-catchall-BGozAjlz.js} +1 -1
  59. package/dist/client/assets/{avatar-B37qTwXF.js → avatar-BwRAYU0T.js} +1 -1
  60. package/dist/client/assets/{badge-CbuZxOhE.js → badge-D7RdE5x4.js} +1 -1
  61. package/dist/client/assets/{binder-BzuI_xjk.js → binder-D1ZOF1Sc.js} +1 -1
  62. package/dist/client/assets/{breadcrumb-B9K_bdts.js → breadcrumb-C8b5zMor.js} +1 -1
  63. package/dist/client/assets/{button-KbFW4XuN.js → button-B1_AjrAy.js} +1 -1
  64. package/dist/client/assets/{card-CIHNFHDM.js → card-CuDdPQFh.js} +1 -1
  65. package/dist/client/assets/{checkbox-BgvZYkw3.js → checkbox-BAHzYzRq.js} +1 -1
  66. package/dist/client/assets/{circle-alert-Ccks-MAu.js → circle-alert-D8AbrLxa.js} +1 -1
  67. package/dist/client/assets/{collection-detail-C_N0geWQ.js → collection-detail-Dy_G4wsA.js} +1 -1
  68. package/dist/client/assets/{collection-tab-C-RG3I-p.js → collection-tab-aDh_bgum.js} +1 -1
  69. package/dist/client/assets/{collection-table-wrapper-CTALYkV9.js → collection-table-wrapper-7diw-YMI.js} +1 -1
  70. package/dist/client/assets/{collection-tabs-DRICSlCe.js → collection-tabs-CR2V6cwH.js} +1 -1
  71. package/dist/client/assets/{command-TRqwLhQ_.js → command-CgyAO0Ne.js} +1 -1
  72. package/dist/client/assets/{connect-DWSDNHqf.js → connect-tVhvROi8.js} +1 -1
  73. package/dist/client/assets/{connection-card-BBZJ8W3M.js → connection-card-Cg4aLOaW.js} +1 -1
  74. package/dist/client/assets/{connection-detail-BL7CKfM7.js → connection-detail-CPywuZSh.js} +1 -1
  75. package/dist/client/assets/{connections-CTHmnJaG.js → connections-CPTTerhe.js} +1 -1
  76. package/dist/client/assets/{constants-C56FepeM.js → constants-D3TKhQyR.js} +1 -1
  77. package/dist/client/assets/constants-DfKBjJcd.js +1 -0
  78. package/dist/client/assets/{create-organization-dialog-BOVQgbie.js → create-organization-dialog-C5Cn0159.js} +1 -1
  79. package/dist/client/assets/{create-project-dialog-Cbp27b9r.js → create-project-dialog-CbnOarMk.js} +1 -1
  80. package/dist/client/assets/{dialog-CTzYyOCo.js → dialog-BIx4eChJ.js} +1 -1
  81. package/dist/client/assets/{dropdown-menu-COB17A0Z.js → dropdown-menu-Bqe_ZQT7.js} +1 -1
  82. package/dist/client/assets/{dynamic-plugin-layout-CU_9kBh0.js → dynamic-plugin-layout-daiqbOX4.js} +1 -1
  83. package/dist/client/assets/{empty-state-DbrAwFcx.js → empty-state-3DPCxrDd.js} +1 -1
  84. package/dist/client/assets/{empty-state-DYt7iyWe.js → empty-state-BRTEyQic.js} +1 -1
  85. package/dist/client/assets/{env-vars-editor-Dy_wYHf8.js → env-vars-editor-BnFnFKjL.js} +1 -1
  86. package/dist/client/assets/{error-boundary-CNsxzBU5.js → error-boundary-D3lg8C_F.js} +1 -1
  87. package/dist/client/assets/{extract-connection-data-JqSd5LuK.js → extract-connection-data-D-KC8N1g.js} +1 -1
  88. package/dist/client/assets/{file-browser-ZLEw2qLV.js → file-browser-DYQzip2l.js} +2 -2
  89. package/dist/client/assets/{form-3k69lugl.js → form-CSMGXcSP.js} +1 -1
  90. package/dist/client/assets/{grid-view-D__vcP1M.js → grid-view-CvriK_Te.js} +1 -1
  91. package/dist/client/assets/{home-BOWI6wWW.js → home-BHmXDNE_.js} +1 -1
  92. package/dist/client/assets/{index-m3V673uZ.js → index-BEXpTjUJ.js} +6 -6
  93. package/dist/client/assets/{index-BhWwwe4k.js → index-BoIFTJw3.js} +1 -1
  94. package/dist/client/assets/{index-BaKw5S62.js → index-CEEGRjv-.js} +1 -1
  95. package/dist/client/assets/{index-CEBU5ikU.js → index-D0P8wRBl.js} +1 -1
  96. package/dist/client/assets/{index-Db6r-OFW.js → index-D291fSpc.js} +1 -1
  97. package/dist/client/assets/{index-1ZfnT2oW.js → index-DGQeUY5q.js} +1 -1
  98. package/dist/client/assets/{index-52ezqwYc.js → index-DWPOfnC9.js} +1 -1
  99. package/dist/client/assets/{index-CuIrPKu9.js → index-DXIsw0zh.js} +3 -3
  100. package/dist/client/assets/{index-Bs7FV238.js → index-PQ5Y9l5r.js} +1 -1
  101. package/dist/client/assets/{infiniteQueryObserver-60Pvs7lk.js → infiniteQueryObserver-BEZRxvfD.js} +1 -1
  102. package/dist/client/assets/{input-g5LrnBay.js → input-CBsHg1ZU.js} +1 -1
  103. package/dist/client/assets/{integration-icon-CgM-an9b.js → integration-icon-B6mCYbtH.js} +1 -1
  104. package/dist/client/assets/{label-BRqnACHD.js → label-BAn78i4V.js} +1 -1
  105. package/dist/client/assets/{layout-veX2bHTO.js → layout-CJ8IA4Pt.js} +1 -1
  106. package/dist/client/assets/{localstorage-keys-DVialVZJ.js → localstorage-keys-5bqIWFww.js} +1 -1
  107. package/dist/client/assets/{login-Bo_vv91H.js → login-W6QtfXRU.js} +1 -1
  108. package/dist/client/assets/{markdown-B9MVxSX8.js → markdown-CGk5zbs1.js} +1 -1
  109. package/dist/client/assets/{mcp-oauth-CqxFiNor.js → mcp-oauth-CZMbNN44.js} +1 -1
  110. package/dist/client/assets/{mcp-server-card-B7R2dxPn.js → mcp-server-card-e0XUR5Yq.js} +1 -1
  111. package/dist/client/assets/{mcp-server-detail-CgW9CI19.js → mcp-server-detail-Caq-098C.js} +2 -2
  112. package/dist/client/assets/{members-R5hOA6Ln.js → members-zrxPuh2o.js} +1 -1
  113. package/dist/client/assets/{monitoring-C0HiMyW6.js → monitoring-_ny0UhM9.js} +2 -2
  114. package/dist/client/assets/{monitoring-dashboard-edit-CXDrAMd6.js → monitoring-dashboard-edit-DRWSHAcl.js} +1 -1
  115. package/dist/client/assets/{monitoring-dashboard-view-DIquPtHE.js → monitoring-dashboard-view-Dg5Q-4l_.js} +1 -1
  116. package/dist/client/assets/{oauth-callback-C7CG4TvZ.js → oauth-callback-DF4NcQuR.js} +1 -1
  117. package/dist/client/assets/{page-BBuPAnYW.js → page-B6wNBPH1.js} +1 -1
  118. package/dist/client/assets/{page-CmdabCF-.js → page-CuOig4S9.js} +1 -1
  119. package/dist/client/assets/{plugin-empty-state-DB5GFJQB.js → plugin-empty-state-BU6c0L07.js} +1 -1
  120. package/dist/client/assets/{plugin-empty-state-BjravhmS.js → plugin-empty-state-DmaS8xBx.js} +1 -1
  121. package/dist/client/assets/{plugin-header-BoBMp38h.js → plugin-header-Dj0RMbq4.js} +1 -1
  122. package/dist/client/assets/{plugin-header-D4-3EhvX.js → plugin-header-DnM-ONcb.js} +1 -1
  123. package/dist/client/assets/{popover-VJKeuwbC.js → popover-Bb6R9icK.js} +1 -1
  124. package/dist/client/assets/{project-layout-B-2nzLyc.js → project-layout-Dn_PaFa7.js} +1 -1
  125. package/dist/client/assets/{project-settings-Cv631PiB.js → project-settings-C1t3TKB3.js} +1 -1
  126. package/dist/client/assets/{projects-list-VqhVqmHW.js → projects-list-DwR0s7rf.js} +1 -1
  127. package/dist/client/assets/{readme-viewer-CYxESlX8.js → readme-viewer-Dw7Qf_Tx.js} +1 -1
  128. package/dist/client/assets/{registry-layout-DSELVp8O.js → registry-layout-JBbhTkeO.js} +1 -1
  129. package/dist/client/assets/{registry-utils-BDP3t_m0.js → registry-utils-CqH2sLA9.js} +1 -1
  130. package/dist/client/assets/{reports-layout-chWgOVY4.js → reports-layout-CmFSnl69.js} +2 -2
  131. package/dist/client/assets/{reset-password-BepKS7QP.js → reset-password-CVTGYB35.js} +1 -1
  132. package/dist/client/assets/{resizable-DzVs9cF1.js → resizable-CTqqQjcd.js} +1 -1
  133. package/dist/client/assets/{save-actions-C432uq2M.js → save-actions-CwdkcgkS.js} +1 -1
  134. package/dist/client/assets/{scroll-area-BppB61vI.js → scroll-area-CchW-N3-.js} +1 -1
  135. package/dist/client/assets/{select-CjbCdlbs.js → select-Dtkbt4-O.js} +1 -1
  136. package/dist/client/assets/{shell-layout-BNTceB-j.js → shell-layout-eLdU35ux.js} +3 -3
  137. package/dist/client/assets/{spinner-Ys0MZVWU.js → spinner-CQv4OdiY.js} +1 -1
  138. package/dist/client/assets/{store-invite-wi4-CXmp.js → store-invite-D-J92Dqo.js} +1 -1
  139. package/dist/client/assets/{switch-mZQ9VTrI.js → switch-RGSyl6UC.js} +1 -1
  140. package/dist/client/assets/{table-50O0LiWw.js → table-D_QygT6-.js} +1 -1
  141. package/dist/client/assets/{tasks-Knr19XiW.js → tasks-CYirgWP_.js} +1 -1
  142. package/dist/client/assets/{textarea-CaReVd_T.js → textarea-Bs1SDhbD.js} +1 -1
  143. package/dist/client/assets/{time-range-picker-CmEKwRJx.js → time-range-picker-9QegZlTC.js} +1 -1
  144. package/dist/client/assets/{toggle-group-igEKa_l0.js → toggle-group-BMOUBfIJ.js} +1 -1
  145. package/dist/client/assets/{tools-list-DXmYEuhW.js → tools-list-B0vbhECW.js} +1 -1
  146. package/dist/client/assets/{tooltip-0WAr9Tnd.js → tooltip-Dp5lhZb-.js} +1 -1
  147. package/dist/client/assets/{topbar-portal-A-r6dcXk.js → topbar-portal-BMMpyuIo.js} +1 -1
  148. package/dist/client/assets/{typewriter-title-0Ps8bNiF.js → typewriter-title-C_l4tadT.js} +1 -1
  149. package/dist/client/assets/{use-binding-DHUPD73-.js → use-binding-CCMbm9JJ.js} +1 -1
  150. package/dist/client/assets/{use-connection-h_6wlDvG.js → use-connection-BQuQwDk4.js} +1 -1
  151. package/dist/client/assets/{use-copy-DzbutdJX.js → use-copy-B35KQJbq.js} +1 -1
  152. package/dist/client/assets/{use-create-virtual-mcp-BEYGEKPm.js → use-create-virtual-mcp-CExHv6Kc.js} +1 -1
  153. package/dist/client/assets/{use-deco-chat-open-QCitD2jP.js → use-deco-chat-open-XtGRSas5.js} +6 -6
  154. package/dist/client/assets/{use-install-from-registry-CKNWgTjl.js → use-install-from-registry-szNBcx44.js} +1 -1
  155. package/dist/client/assets/{use-list-state-QuR-uYrt.js → use-list-state-qVi7m5eK.js} +1 -1
  156. package/dist/client/assets/{use-llm-BiV3ohz2.js → use-llm-DjuAxzNV.js} +1 -1
  157. package/dist/client/assets/{use-mcp-prompts-BfBaVKeH.js → use-mcp-prompts-BVHx-kiG.js} +1 -1
  158. package/dist/client/assets/{use-mcp-tools-9-0ktUQU.js → use-mcp-tools-DqcNzzRD.js} +1 -1
  159. package/dist/client/assets/{use-mobile-DBbPwq5K.js → use-mobile-DIAoFlrU.js} +1 -1
  160. package/dist/client/assets/{use-organization-settings-Di-WJ99L.js → use-organization-settings-W2sWkYV6.js} +1 -1
  161. package/dist/client/assets/{use-project-CQC3Fx2l.js → use-project-gbXgodP7.js} +1 -1
  162. package/dist/client/assets/{use-view-mode-C4TZAKDl.js → use-view-mode-BBke-t6c.js} +1 -1
  163. package/dist/client/assets/{use-virtual-mcp-B5taJWCy.js → use-virtual-mcp-DaDbSDv1.js} +1 -1
  164. package/dist/client/assets/useInfiniteQuery-1kxc2B4E.js +1 -0
  165. package/dist/client/assets/{useMutation-Zw-bAGx2.js → useMutation-B0HsJHYQ.js} +1 -1
  166. package/dist/client/assets/useQuery-BB1xkDqD.js +1 -0
  167. package/dist/client/assets/useSuspenseInfiniteQuery-NieK84q6.js +1 -0
  168. package/dist/client/assets/{workflow-BrwP_xN6.js → workflow-BJgxWVo7.js} +1 -1
  169. package/dist/client/index.html +1 -1
  170. package/dist/server/cli.js +192 -192
  171. package/dist/server/migrate.js +3 -3
  172. package/dist/server/server.js +174 -174
  173. package/package.json +1 -1
  174. package/dist/client/assets/alert-dialog-Bow6SDVm.js +0 -7
  175. package/dist/client/assets/constants-C6KVRSAR.js +0 -1
  176. package/dist/client/assets/useInfiniteQuery-CGBDp2t8.js +0 -1
  177. package/dist/client/assets/useQuery-eogqvd42.js +0 -1
  178. package/dist/client/assets/useSuspenseInfiniteQuery-DAyAVWU_.js +0 -1
@@ -1 +1 @@
1
- import{c as H,u as W,z as X,O as Y,k as oe,l as ae,j as s,o as ce,s as G,K as U,t as R,r as q,aF as te,bv as ue,b as de,d as ge}from"./index-CuIrPKu9.js";import{P as Z}from"./index-CEBU5ikU.js";import{B as fe,a as pe,b as he,c as xe}from"./breadcrumb-B9K_bdts.js";import{u as ee}from"./useMutation-Zw-bAGx2.js";import{a as ie,u as re}from"./constants-C56FepeM.js";import{B as L,c as je}from"./button-KbFW4XuN.js";import{I as V}from"./input-g5LrnBay.js";import{T as be}from"./textarea-CaReVd_T.js";import{F as Q,d as M,a as me,b as $,c as K,e as se,f as J}from"./form-3k69lugl.js";import{u as ye}from"./useQuery-eogqvd42.js";import{S as ve}from"./switch-mZQ9VTrI.js";import{L as Ne}from"./label-BRqnACHD.js";import{h as Ce}from"./use-connection-h_6wlDvG.js";import{a as Se,c as Pe}from"./use-binding-DHUPD73-.js";import{u as we}from"./use-install-from-registry-CKNWgTjl.js";import{i as Ie}from"./Loading01-D-iQ3x6B.js";import{s as Ee}from"./Plus-B8rm50Ox.js";import{S as Fe,a as De,b as _e,c as Oe,d as le}from"./select-CjbCdlbs.js";import{i as Te}from"./Upload01-DCltlStQ.js";import{i as Ae}from"./X-DA2sDUV2.js";import{c as ze,h as Be,d as ke,b as Re,A as Le,e as Ue,g as qe,a as Me,f as $e}from"./alert-dialog-Bow6SDVm.js";import"./ChevronRight-CHS1psX7.js";import"./binder-BzuI_xjk.js";import"./extract-connection-data-JqSd5LuK.js";import"./constants-C6KVRSAR.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-BDP3t_m0.js";import"./generate-id-Dyweu44Y.js";import"./index-1ZfnT2oW.js";import"./Check-DG5LOfHE.js";import"./ChevronDown-P4XeJ9w5.js";const Ke=ce({name:G().min(1,"Name is required").max(200,"Name is too long"),description:G().max(1e3,"Description is too long").nullable()});function Ge(){const e=H.c(58),{org:t,project:i}=W(),o=X(),d=i.slug===Y;let g;e[0]!==t.id?(g={connectionId:ie,orgId:t.id},e[0]=t.id,e[1]=g):g=e[1];const u=re(g);let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=oe(Ke),e[2]=x):x=e[2];const j=i.name??"",b=i.description??"";let a;e[3]!==j||e[4]!==b?(a={resolver:x,values:{name:j,description:b}},e[3]=j,e[4]=b,e[5]=a):a=e[5];const c=ae(a);let f;e[6]!==u||e[7]!==i.id?(f=async B=>{const _=await u.callTool({name:"PROJECT_UPDATE",arguments:{projectId:i.id,name:B.name,description:B.description||null}});return _.structuredContent??_},e[6]=u,e[7]=i.id,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==t.id||e[11]!==i.slug||e[12]!==o?(p=()=>{o.invalidateQueries({queryKey:U.project(t.id,i.slug)}),o.invalidateQueries({queryKey:U.projects(t.id)}),R.success("Project updated successfully"),c.reset(c.getValues())},e[9]=c,e[10]=t.id,e[11]=i.slug,e[12]=o,e[13]=p):p=e[13];let w;e[14]!==f||e[15]!==p?(w={mutationFn:f,onSuccess:p,onError:Qe},e[14]=f,e[15]=p,e[16]=w):w=e[16];const m=ee(w);let y;e[17]!==m?(y=async B=>{await m.mutateAsync(B)},e[17]=m,e[18]=y):y=e[18];const P=y,C=c.formState.isDirty;let I;e[19]!==c||e[20]!==P?(I=c.handleSubmit(P),e[19]=c,e[20]=P,e[21]=I):I=e[21];let S;e[22]!==d||e[23]!==m.isPending?(S=B=>{const{field:_}=B;return s.jsxs($,{children:[s.jsx(K,{children:"Project Name"}),s.jsx(M,{children:s.jsx(V,{placeholder:"My Project",..._,disabled:d||m.isPending})}),d&&s.jsx(se,{children:"The organization admin project name cannot be changed."}),s.jsx(J,{})]})},e[22]=d,e[23]=m.isPending,e[24]=S):S=e[24];let n;e[25]!==c.control||e[26]!==S?(n=s.jsx(Q,{control:c.control,name:"name",render:S}),e[25]=c.control,e[26]=S,e[27]=n):n=e[27];let r;e[28]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K,{children:"Slug"}),e[28]=r):r=e[28];let l;e[29]!==i.slug?(l=s.jsx(M,{children:s.jsx(V,{value:i.slug,disabled:!0,className:"bg-muted"})}),e[29]=i.slug,e[30]=l):l=e[30];let h;e[31]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(se,{children:"The project slug cannot be changed after creation."}),e[31]=h):h=e[31];let v;e[32]!==l?(v=s.jsxs($,{children:[r,l,h]}),e[32]=l,e[33]=v):v=e[33];let N;e[34]!==m.isPending?(N=B=>{const{field:_}=B;return s.jsxs($,{children:[s.jsx(K,{children:"Description"}),s.jsx(M,{children:s.jsx(be,{placeholder:"Optional project description...",rows:3,..._,value:_.value??"",disabled:m.isPending})}),s.jsx(J,{})]})},e[34]=m.isPending,e[35]=N):N=e[35];let F;e[36]!==c.control||e[37]!==N?(F=s.jsx(Q,{control:c.control,name:"description",render:N}),e[36]=c.control,e[37]=N,e[38]=F):F=e[38];const O=!C||m.isPending,T=m.isPending?"Saving...":"Save Changes";let D;e[39]!==O||e[40]!==T?(D=s.jsx(L,{type:"submit",disabled:O,className:"min-w-24",children:T}),e[39]=O,e[40]=T,e[41]=D):D=e[41];let A;e[42]!==c||e[43]!==C||e[44]!==m.isPending?(A=C&&s.jsx(L,{type:"button",variant:"outline",onClick:()=>c.reset(),disabled:m.isPending,children:"Cancel"}),e[42]=c,e[43]=C,e[44]=m.isPending,e[45]=A):A=e[45];let z;e[46]!==D||e[47]!==A?(z=s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[D,A]}),e[46]=D,e[47]=A,e[48]=z):z=e[48];let E;e[49]!==n||e[50]!==v||e[51]!==F||e[52]!==z||e[53]!==I?(E=s.jsxs("form",{onSubmit:I,className:"space-y-6",children:[n,v,F,z]}),e[49]=n,e[50]=v,e[51]=F,e[52]=z,e[53]=I,e[54]=E):E=e[54];let k;return e[55]!==c||e[56]!==E?(k=s.jsx(me,{...c,children:E}),e[55]=c,e[56]=E,e[57]=k):k=e[57],k}function Qe(e){R.error("Failed to update project: "+(e instanceof Error?e.message:"Unknown error"))}function Je({value:e,onValueChange:t,placeholder:i="Select a connection...",binding:o,bindingType:d,onAddNew:g,className:u,disabled:x=!1}){const[j,b]=q.useState(!1),{installByBinding:a,isInstalling:c}=we(),f=j||c,p=Ce(),w=Se({connections:p,binding:typeof o=="string"?o:void 0}),m=!o||!p?p??[]:typeof o=="string"?w:Array.isArray(o)&&o.length>0?p.filter(n=>Pe(n,o)):p,y=(()=>{if(!d?.startsWith("@"))return null;const[n,r]=d.replace("@","").split("/");return n&&r?{scope:n,appName:r}:null})(),P=(()=>{let n=m;const r=Array.isArray(o)&&o.length>0;if(y&&!r&&(n=n.filter(l=>{const h=l.app_name,v=l.metadata?.scopeName;return h===y.appName&&v===y.scope})),e&&!n.some(l=>l.id===e)){const l=p?.find(h=>h.id===e);if(l)return[l,...n]}return n})(),C=d?.startsWith("@"),I=async()=>{if(C&&d){b(!0);try{const n=await a(d);n&&t(n.id)}finally{b(!1)}return}g?.()},S=P.find(n=>n.id===e);return s.jsxs(Fe,{value:e??"none",onValueChange:n=>t(n==="none"?null:n),disabled:x,children:[s.jsx(De,{size:"sm",className:je("w-[200px]",u),children:s.jsx(_e,{placeholder:i,children:S?s.jsxs("div",{className:"flex items-center gap-2",children:[S.icon?s.jsx("img",{src:S.icon,alt:S.title,className:"w-4 h-4 rounded shrink-0"}):s.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:S.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"truncate",children:S.title})]}):i})}),s.jsxs(Oe,{children:[s.jsx(le,{value:"none",children:"No connection"}),P.length===0?s.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):P.map(n=>s.jsx(le,{value:n.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[n.icon?s.jsx("img",{src:n.icon,alt:n.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:n.title.slice(0,1).toUpperCase()}),s.jsx("span",{children:n.title})]})},n.id)),(g||C)&&s.jsx("div",{className:"border-t border-border",children:s.jsx(L,{onPointerDown:n=>n.stopPropagation(),onClick:n=>{n.preventDefault(),n.stopPropagation(),I()},disabled:f||x,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:f?s.jsxs(s.Fragment,{children:[s.jsx(Ie,{size:16,className:"animate-spin"}),s.jsx("span",{children:"Connecting..."})]}):s.jsxs(s.Fragment,{children:[s.jsx(Ee,{size:16}),s.jsx("span",{children:"Add Connection"})]})})})]})]})}const Ve=e=>{if(!e||typeof e!="object")return!1;const t=e;return t.type==="text"&&typeof t.text=="string"&&t.text.trim().toLowerCase().startsWith("error")},ne=e=>{const t=e.structuredContent??e,i=t&&typeof t=="object"?t:null,o=i?.content?.[0]?.text&&typeof i.content[0].text=="string"?i.content[0].text:null;if(i?.isError)throw new Error(o??"Tool call failed");if(Ve(t))throw new Error(t.text);return t};function He(e){return e.requiresMcpBinding===!0?!0:e.binding!==void 0}function We(e){const t=H.c(48),{plugin:i,isEnabled:o,isSaving:d,pendingBinding:g,description:u,label:x,icon:j,projectId:b,client:a,onBindingChange:c,onToggle:f}=e;let p;t[0]!==i?(p=He(i),t[0]=i,t[1]=p):p=t[1];const w=p;let m;t[2]!==i.id||t[3]!==b?(m=U.projectPluginConfig(b??"",i.id),t[2]=i.id,t[3]=b,t[4]=m):m=t[4];let y;t[5]!==a||t[6]!==i.id||t[7]!==b?(y=async()=>{if(!b)throw new Error("Project ID is required to load plugin config.");const E=await a.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:b,pluginId:i.id}});return ne(E)},t[5]=a,t[6]=i.id,t[7]=b,t[8]=y):y=t[8];const P=!!b&&w;let C;t[9]!==m||t[10]!==y||t[11]!==P?(C={queryKey:m,queryFn:y,enabled:P},t[9]=m,t[10]=y,t[11]=P,t[12]=C):C=t[12];const{data:I,isLoading:S}=ye(C),n=I?.config?.connectionId??null,r=g!==void 0?g:n;let l;t[13]!==j?(l=j&&s.jsx("div",{className:"flex-shrink-0 text-muted-foreground [&>svg]:size-4",children:j}),t[13]=j,t[14]=l):l=t[14];let h;t[15]!==x?(h=s.jsx("div",{className:"text-sm font-medium text-foreground",children:x}),t[15]=x,t[16]=h):h=t[16];let v;t[17]!==u?(v=u&&s.jsx("p",{className:"text-xs text-muted-foreground",children:u}),t[17]=u,t[18]=v):v=t[18];let N;t[19]!==h||t[20]!==v?(N=s.jsxs("div",{className:"min-w-0",children:[h,v]}),t[19]=h,t[20]=v,t[21]=N):N=t[21];let F;t[22]!==l||t[23]!==N?(F=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[l,N]}),t[22]=l,t[23]=N,t[24]=F):F=t[24];let O;t[25]!==f||t[26]!==i.id?(O=E=>f(i.id,E),t[25]=f,t[26]=i.id,t[27]=O):O=t[27];let T;t[28]!==o||t[29]!==d||t[30]!==O?(T=s.jsx(ve,{checked:o,onCheckedChange:O,disabled:d}),t[28]=o,t[29]=d,t[30]=O,t[31]=T):T=t[31];let D;t[32]!==F||t[33]!==T?(D=s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[F,T]}),t[32]=F,t[33]=T,t[34]=D):D=t[34];let A;t[35]!==S||t[36]!==o||t[37]!==d||t[38]!==w||t[39]!==c||t[40]!==i.binding||t[41]!==i.id||t[42]!==r||t[43]!==n?(A=o&&w&&s.jsxs("div",{className:"mt-3 pl-7 flex items-center gap-3",children:[s.jsx(Ne,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),s.jsx(Je,{value:r??null,onValueChange:E=>c(i.id,E,n),binding:i.binding,placeholder:"Select connection...",className:"w-56",disabled:d||S})]}),t[35]=S,t[36]=o,t[37]=d,t[38]=w,t[39]=c,t[40]=i.binding,t[41]=i.id,t[42]=r,t[43]=n,t[44]=A):A=t[44];let z;return t[45]!==D||t[46]!==A?(z=s.jsxs("div",{className:"py-3",children:[D,A]}),t[45]=D,t[46]=A,t[47]=z):z=t[47],z}function Ze(){const{org:e,project:t}=W(),i=X(),o=re({connectionId:ie,orgId:e.id}),[d,g]=q.useState({}),[u,x]=q.useState({}),[j,b]=q.useState(!1),a=t.enabledPlugins??[],c=n=>{const r=d[n];return r!==void 0?r:a.includes(n)},f=()=>{const n=new Set(a);for(const[r,l]of Object.entries(d))l?n.add(r):n.delete(r);return Array.from(n)},p=Object.keys(d).length>0||Object.keys(u).length>0,w=(n,r)=>{const l=a.includes(n);g(r===l?h=>{const{[n]:v,...N}=h;return N}:h=>({...h,[n]:r}))},m=(n,r,l)=>{if(r===l){x(h=>{const{[n]:v,...N}=h;return N});return}x(h=>({...h,[n]:r}))},y=ee({mutationFn:async n=>{const r=[];if(n.updatePlugins){const l=await o.callTool({name:"PROJECT_UPDATE",arguments:{projectId:t.id,enabledPlugins:n.enabledPlugins}});r.push(ne(l))}if(n.bindingUpdates.length>0){const l=await Promise.all(n.bindingUpdates.map(async({pluginId:h,connectionId:v})=>{const N=await o.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:t.id,pluginId:h,connectionId:v}});return ne(N)}));r.push(...l)}return r},onSuccess:(n,r)=>{r.updatePlugins&&(i.invalidateQueries({queryKey:U.project(e.id,t.slug)}),i.invalidateQueries({queryKey:U.projects(e.id)})),r.bindingUpdates.forEach(({pluginId:l})=>{i.invalidateQueries({queryKey:U.projectPluginConfig(t.id??"",l)})}),g({}),x({}),R.success("Plugins updated successfully")},onError:n=>{R.error("Failed to update plugins: "+(n instanceof Error?n.message:"Unknown error"))},onSettled:()=>{b(!1)}}),P=()=>{b(!0),y.mutate({enabledPlugins:f(),updatePlugins:Object.keys(d).length>0,bindingUpdates:Object.entries(u).map(([n,r])=>({pluginId:n,connectionId:r}))})},C=()=>{g({}),x({})},I=n=>ue.find(r=>r.pluginId===n),S=n=>te.find(l=>l.id===n)?.description??null;return te.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable or disable plugins for this project. Enabled plugins will appear in the sidebar."}),s.jsx("div",{className:"divide-y divide-border border-y border-border",children:te.map(n=>{const r=I(n.id),l=S(n.id),h=c(n.id);return s.jsx(We,{plugin:n,isEnabled:h,isSaving:j,pendingBinding:u[n.id],description:l,label:r?.label??n.id,icon:r?.icon,projectId:t.id,client:o,onBindingChange:m,onToggle:w},n.id)})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(L,{variant:"outline",onClick:C,disabled:!p||j,children:"Cancel"}),s.jsx(L,{onClick:P,disabled:!p||j,className:"min-w-24",children:j?"Saving...":"Save Changes"})]})]})}const Ye=ce({name:G().min(1,"Name is required").max(255,"Name is too long"),slug:G().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:G().optional()});function Xe(e){const t=H.c(24),{value:i,onChange:o,name:d}=e,g=q.useRef(null);let u;t[0]!==o?(u=S=>{const n=S.target.files?.[0];if(n){if(n.size>2097152){R.error("Image must be smaller than 2MB");return}const r=new FileReader;r.onerror=()=>{const l=r.error;console.error("FileReader error:",l),R.error(l?.message||"Failed to read image file. Please try again."),g.current&&(g.current.value="")},r.onloadend=()=>{if(r.readyState===FileReader.DONE&&r.result){const l=r.result;o(l)}},r.readAsDataURL(n)}},t[0]=o,t[1]=u):u=t[1];const x=u;let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{g.current?.click()},t[2]=j):j=t[2];const b=j;let a;t[3]!==o?(a=S=>{S.stopPropagation(),o("")},t[3]=o,t[4]=a):a=t[4];const c=a;let f;t[5]!==x?(f=s.jsx("input",{type:"file",ref:g,className:"hidden",accept:"image/*",onChange:x}),t[5]=x,t[6]=f):f=t[6];let p;t[7]!==c||t[8]!==d||t[9]!==i?(p=i?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:i,alt:d||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:c,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(Ae,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:b,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(Te,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),t[7]=c,t[8]=d,t[9]=i,t[10]=p):p=t[10];const w=i?"Change Logo":"Upload Logo";let m;t[11]!==w?(m=s.jsx(L,{type:"button",variant:"outline",size:"sm",onClick:b,className:"mb-2",children:w}),t[11]=w,t[12]=m):m=t[12];let y;t[13]!==c||t[14]!==i?(y=i&&s.jsx(L,{type:"button",variant:"ghost",size:"sm",onClick:c,className:"ml-2",children:"Remove"}),t[13]=c,t[14]=i,t[15]=y):y=t[15];let P;t[16]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),t[16]=P):P=t[16];let C;t[17]!==m||t[18]!==y?(C=s.jsxs("div",{className:"flex-1",children:[m,y,P]}),t[17]=m,t[18]=y,t[19]=C):C=t[19];let I;return t[20]!==C||t[21]!==f||t[22]!==p?(I=s.jsxs("div",{className:"flex items-start gap-4",children:[f,p,C]}),t[20]=C,t[21]=f,t[22]=p,t[23]=I):I=t[23],I}function et(){const e=de(),{org:t,project:i}=W(),o=X(),[d,g]=q.useState(!1),u=ae({resolver:oe(Ye),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),x=ee({mutationFn:async a=>{const c={name:a.name,slug:a.slug};a.logo&&(c.logo=a.logo);const f=await ge.organization.update({organizationId:t.id,data:c});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:a=>{o.invalidateQueries({queryKey:U.organizations()}),o.invalidateQueries({queryKey:U.activeOrganization(t.slug)}),R.success("Organization settings updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/$project/settings",params:{org:a.data.slug,project:i.slug}})},onError:a=>{R.error(a instanceof Error?a.message:"Failed to update organization")},onSettled:()=>{g(!1)}}),j=a=>{g(!0),x.mutate(a)},b=u.formState.isDirty;return s.jsx(me,{...u,children:s.jsxs("form",{onSubmit:u.handleSubmit(j),className:"space-y-6",children:[s.jsx(Q,{control:u.control,name:"name",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Organization Name"}),s.jsx(M,{children:s.jsx(V,{placeholder:"My Organization",...a,disabled:d})}),s.jsx(J,{})]})}),s.jsx(Q,{control:u.control,name:"slug",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Organization Slug"}),s.jsx(M,{children:s.jsx(V,{placeholder:"my-organization",...a,disabled:d,onChange:c=>{const f=c.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.onChange(f)}})}),s.jsx(se,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(J,{})]})}),s.jsx(Q,{control:u.control,name:"logo",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Logo"}),s.jsx(M,{children:s.jsx(Xe,{value:a.value,onChange:a.onChange,name:u.watch("name")})}),s.jsx(J,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(L,{type:"submit",disabled:!b||d,className:"min-w-24",children:d?"Saving...":"Save Changes"}),b&&s.jsx(L,{type:"button",variant:"outline",onClick:()=>u.reset(),disabled:d,children:"Cancel"})]})]})})}function tt(){const e=H.c(44),{org:t,project:i}=W(),o=de(),d=X(),[g,u]=q.useState(""),[x,j]=q.useState(!1),b=i.slug===Y;let a;e[0]!==t.id?(a={connectionId:ie,orgId:t.id},e[0]=t.id,e[1]=a):a=e[1];const c=re(a);let f;e[2]!==c||e[3]!==i.id?(f=async()=>{const _=await c.callTool({name:"PROJECT_DELETE",arguments:{projectId:i.id}});return _.structuredContent??_},e[2]=c,e[3]=i.id,e[4]=f):f=e[4];let p;e[5]!==o||e[6]!==t.id||e[7]!==t.slug||e[8]!==d?(p=_=>{_.success?(d.invalidateQueries({queryKey:U.projects(t.id)}),R.success("Project deleted"),o({to:"/$org/$project",params:{org:t.slug,project:Y}})):R.error(_.message??"Failed to delete project")},e[5]=o,e[6]=t.id,e[7]=t.slug,e[8]=d,e[9]=p):p=e[9];let w;e[10]!==f||e[11]!==p?(w={mutationFn:f,onSuccess:p,onError:st},e[10]=f,e[11]=p,e[12]=w):w=e[12];const m=ee(w);if(b)return null;const y=g===i.name;let P;e[13]!==m?(P=()=>{m.mutate()},e[13]=m,e[14]=P):P=e[14];const C=P;let I;e[15]===Symbol.for("react.memo_cache_sentinel")?(I=_=>{j(_),_||u("")},e[15]=I):I=e[15];const S=I;let n;e[16]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-destructive",children:"Danger Zone"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Irreversible and destructive actions."})]}),e[16]=n):n=e[16];let r;e[17]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Be,{asChild:!0,children:s.jsx(L,{variant:"destructive",children:"Delete Project"})}),e[17]=r):r=e[17];let l;e[18]!==i.name?(l=s.jsxs(ze,{children:['Delete "',i.name,'"?']}),e[18]=i.name,e[19]=l):l=e[19];let h;e[20]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ke,{children:"This action cannot be undone. All project data will be permanently deleted."}),e[20]=h):h=e[20];let v;e[21]!==l?(v=s.jsxs(Re,{children:[l,h]}),e[21]=l,e[22]=v):v=e[22];let N;e[23]!==i.name?(N=s.jsxs("p",{className:"text-sm mb-2",children:["Type ",s.jsx("strong",{children:i.name})," to confirm:"]}),e[23]=i.name,e[24]=N):N=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=_=>u(_.target.value),e[25]=F):F=e[25];let O;e[26]!==g||e[27]!==i.name?(O=s.jsx(V,{value:g,onChange:F,placeholder:i.name}),e[26]=g,e[27]=i.name,e[28]=O):O=e[28];let T;e[29]!==N||e[30]!==O?(T=s.jsxs("div",{className:"py-4",children:[N,O]}),e[29]=N,e[30]=O,e[31]=T):T=e[31];let D;e[32]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Le,{children:"Cancel"}),e[32]=D):D=e[32];const A=!y||m.isPending,z=m.isPending?"Deleting...":"Delete Project";let E;e[33]!==C||e[34]!==A||e[35]!==z?(E=s.jsxs(Ue,{children:[D,s.jsx(qe,{onClick:C,disabled:A,className:"bg-destructive hover:bg-destructive/90 text-destructive-foreground",children:z})]}),e[33]=C,e[34]=A,e[35]=z,e[36]=E):E=e[36];let k;e[37]!==v||e[38]!==T||e[39]!==E?(k=s.jsxs(Me,{children:[v,T,E]}),e[37]=v,e[38]=T,e[39]=E,e[40]=k):k=e[40];let B;return e[41]!==x||e[42]!==k?(B=s.jsxs("div",{className:"border border-destructive/50 rounded-lg p-4 space-y-4",children:[n,s.jsxs($e,{open:x,onOpenChange:S,children:[r,k]})]}),e[41]=x,e[42]=k,e[43]=B):B=e[43],B}function st(e){R.error("Failed to delete project: "+(e instanceof Error?e.message:"Unknown error"))}function At(){const e=H.c(10),{project:t}=W(),i=t.slug===Y;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Z.Header,{children:s.jsx(Z.Header.Left,{children:s.jsx(fe,{children:s.jsx(pe,{children:s.jsx(he,{children:s.jsx(xe,{children:"Settings"})})})})})}),e[0]=o):o=e[0];let d;e[1]!==i?(d=i&&s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),s.jsx(et,{})]}),e[1]=i,e[2]=d):d=e[2];let g;e[3]!==i?(g=!i&&s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"General"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Basic project information."})]}),s.jsx(Ge,{})]}),e[3]=i,e[4]=g):g=e[4];let u,x;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Plugins"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage which plugins are enabled and configure them."})]}),s.jsx(Ze,{})]}),x=s.jsx(tt,{}),e[5]=u,e[6]=x):(u=e[5],x=e[6]);let j;return e[7]!==d||e[8]!==g?(j=s.jsxs(Z,{children:[o,s.jsx(Z.Content,{children:s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"p-5 max-w-2xl",children:s.jsxs("div",{className:"space-y-8",children:[d,g,u,x]})})})})})]}),e[7]=d,e[8]=g,e[9]=j):j=e[9],j}export{At as default};
1
+ import{c as H,u as W,z as X,O as Y,k as oe,l as ae,j as s,o as ce,s as G,K as U,t as R,r as q,aE as te,bu as ue,b as de,d as ge}from"./index-DXIsw0zh.js";import{P as Z}from"./index-D0P8wRBl.js";import{B as fe,a as pe,b as he,c as xe}from"./breadcrumb-C8b5zMor.js";import{u as ee}from"./useMutation-B0HsJHYQ.js";import{a as ie,u as re}from"./constants-D3TKhQyR.js";import{B as L,c as je}from"./button-B1_AjrAy.js";import{I as V}from"./input-CBsHg1ZU.js";import{T as be}from"./textarea-Bs1SDhbD.js";import{F as Q,d as M,a as me,b as $,c as K,e as se,f as J}from"./form-CSMGXcSP.js";import{u as ye}from"./useQuery-BB1xkDqD.js";import{S as ve}from"./switch-RGSyl6UC.js";import{L as Ne}from"./label-BAn78i4V.js";import{h as Ce}from"./use-connection-BQuQwDk4.js";import{a as Se,c as Pe}from"./use-binding-CCMbm9JJ.js";import{u as we}from"./use-install-from-registry-szNBcx44.js";import{i as Ie}from"./Loading01-CQxnYIyy.js";import{s as Ee}from"./Plus-ldykr1Qs.js";import{S as Fe,a as De,b as _e,c as Oe,d as le}from"./select-Dtkbt4-O.js";import{i as Te}from"./Upload01-CbgKMs6Z.js";import{i as Ae}from"./X-PXGrxqUi.js";import{c as ze,h as Be,d as ke,b as Re,A as Le,e as Ue,g as qe,a as Me,f as $e}from"./alert-dialog-DeTFKcxV.js";import"./ChevronRight-Ds0FvHp6.js";import"./binder-D1ZOF1Sc.js";import"./extract-connection-data-D-KC8N1g.js";import"./constants-DfKBjJcd.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-CqH2sLA9.js";import"./generate-id-Dyweu44Y.js";import"./index-DGQeUY5q.js";import"./Check-BHtow5c6.js";import"./ChevronDown-DIu5de-X.js";const Ke=ce({name:G().min(1,"Name is required").max(200,"Name is too long"),description:G().max(1e3,"Description is too long").nullable()});function Ge(){const e=H.c(58),{org:t,project:i}=W(),o=X(),d=i.slug===Y;let g;e[0]!==t.id?(g={connectionId:ie,orgId:t.id},e[0]=t.id,e[1]=g):g=e[1];const u=re(g);let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=oe(Ke),e[2]=x):x=e[2];const j=i.name??"",b=i.description??"";let a;e[3]!==j||e[4]!==b?(a={resolver:x,values:{name:j,description:b}},e[3]=j,e[4]=b,e[5]=a):a=e[5];const c=ae(a);let f;e[6]!==u||e[7]!==i.id?(f=async B=>{const _=await u.callTool({name:"PROJECT_UPDATE",arguments:{projectId:i.id,name:B.name,description:B.description||null}});return _.structuredContent??_},e[6]=u,e[7]=i.id,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==t.id||e[11]!==i.slug||e[12]!==o?(p=()=>{o.invalidateQueries({queryKey:U.project(t.id,i.slug)}),o.invalidateQueries({queryKey:U.projects(t.id)}),R.success("Project updated successfully"),c.reset(c.getValues())},e[9]=c,e[10]=t.id,e[11]=i.slug,e[12]=o,e[13]=p):p=e[13];let w;e[14]!==f||e[15]!==p?(w={mutationFn:f,onSuccess:p,onError:Qe},e[14]=f,e[15]=p,e[16]=w):w=e[16];const m=ee(w);let y;e[17]!==m?(y=async B=>{await m.mutateAsync(B)},e[17]=m,e[18]=y):y=e[18];const P=y,C=c.formState.isDirty;let I;e[19]!==c||e[20]!==P?(I=c.handleSubmit(P),e[19]=c,e[20]=P,e[21]=I):I=e[21];let S;e[22]!==d||e[23]!==m.isPending?(S=B=>{const{field:_}=B;return s.jsxs($,{children:[s.jsx(K,{children:"Project Name"}),s.jsx(M,{children:s.jsx(V,{placeholder:"My Project",..._,disabled:d||m.isPending})}),d&&s.jsx(se,{children:"The organization admin project name cannot be changed."}),s.jsx(J,{})]})},e[22]=d,e[23]=m.isPending,e[24]=S):S=e[24];let n;e[25]!==c.control||e[26]!==S?(n=s.jsx(Q,{control:c.control,name:"name",render:S}),e[25]=c.control,e[26]=S,e[27]=n):n=e[27];let r;e[28]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(K,{children:"Slug"}),e[28]=r):r=e[28];let l;e[29]!==i.slug?(l=s.jsx(M,{children:s.jsx(V,{value:i.slug,disabled:!0,className:"bg-muted"})}),e[29]=i.slug,e[30]=l):l=e[30];let h;e[31]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(se,{children:"The project slug cannot be changed after creation."}),e[31]=h):h=e[31];let v;e[32]!==l?(v=s.jsxs($,{children:[r,l,h]}),e[32]=l,e[33]=v):v=e[33];let N;e[34]!==m.isPending?(N=B=>{const{field:_}=B;return s.jsxs($,{children:[s.jsx(K,{children:"Description"}),s.jsx(M,{children:s.jsx(be,{placeholder:"Optional project description...",rows:3,..._,value:_.value??"",disabled:m.isPending})}),s.jsx(J,{})]})},e[34]=m.isPending,e[35]=N):N=e[35];let F;e[36]!==c.control||e[37]!==N?(F=s.jsx(Q,{control:c.control,name:"description",render:N}),e[36]=c.control,e[37]=N,e[38]=F):F=e[38];const O=!C||m.isPending,T=m.isPending?"Saving...":"Save Changes";let D;e[39]!==O||e[40]!==T?(D=s.jsx(L,{type:"submit",disabled:O,className:"min-w-24",children:T}),e[39]=O,e[40]=T,e[41]=D):D=e[41];let A;e[42]!==c||e[43]!==C||e[44]!==m.isPending?(A=C&&s.jsx(L,{type:"button",variant:"outline",onClick:()=>c.reset(),disabled:m.isPending,children:"Cancel"}),e[42]=c,e[43]=C,e[44]=m.isPending,e[45]=A):A=e[45];let z;e[46]!==D||e[47]!==A?(z=s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[D,A]}),e[46]=D,e[47]=A,e[48]=z):z=e[48];let E;e[49]!==n||e[50]!==v||e[51]!==F||e[52]!==z||e[53]!==I?(E=s.jsxs("form",{onSubmit:I,className:"space-y-6",children:[n,v,F,z]}),e[49]=n,e[50]=v,e[51]=F,e[52]=z,e[53]=I,e[54]=E):E=e[54];let k;return e[55]!==c||e[56]!==E?(k=s.jsx(me,{...c,children:E}),e[55]=c,e[56]=E,e[57]=k):k=e[57],k}function Qe(e){R.error("Failed to update project: "+(e instanceof Error?e.message:"Unknown error"))}function Je({value:e,onValueChange:t,placeholder:i="Select a connection...",binding:o,bindingType:d,onAddNew:g,className:u,disabled:x=!1}){const[j,b]=q.useState(!1),{installByBinding:a,isInstalling:c}=we(),f=j||c,p=Ce(),w=Se({connections:p,binding:typeof o=="string"?o:void 0}),m=!o||!p?p??[]:typeof o=="string"?w:Array.isArray(o)&&o.length>0?p.filter(n=>Pe(n,o)):p,y=(()=>{if(!d?.startsWith("@"))return null;const[n,r]=d.replace("@","").split("/");return n&&r?{scope:n,appName:r}:null})(),P=(()=>{let n=m;const r=Array.isArray(o)&&o.length>0;if(y&&!r&&(n=n.filter(l=>{const h=l.app_name,v=l.metadata?.scopeName;return h===y.appName&&v===y.scope})),e&&!n.some(l=>l.id===e)){const l=p?.find(h=>h.id===e);if(l)return[l,...n]}return n})(),C=d?.startsWith("@"),I=async()=>{if(C&&d){b(!0);try{const n=await a(d);n&&t(n.id)}finally{b(!1)}return}g?.()},S=P.find(n=>n.id===e);return s.jsxs(Fe,{value:e??"none",onValueChange:n=>t(n==="none"?null:n),disabled:x,children:[s.jsx(De,{size:"sm",className:je("w-[200px]",u),children:s.jsx(_e,{placeholder:i,children:S?s.jsxs("div",{className:"flex items-center gap-2",children:[S.icon?s.jsx("img",{src:S.icon,alt:S.title,className:"w-4 h-4 rounded shrink-0"}):s.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:S.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"truncate",children:S.title})]}):i})}),s.jsxs(Oe,{children:[s.jsx(le,{value:"none",children:"No connection"}),P.length===0?s.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No compatible connections found"}):P.map(n=>s.jsx(le,{value:n.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[n.icon?s.jsx("img",{src:n.icon,alt:n.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:n.title.slice(0,1).toUpperCase()}),s.jsx("span",{children:n.title})]})},n.id)),(g||C)&&s.jsx("div",{className:"border-t border-border",children:s.jsx(L,{onPointerDown:n=>n.stopPropagation(),onClick:n=>{n.preventDefault(),n.stopPropagation(),I()},disabled:f||x,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:f?s.jsxs(s.Fragment,{children:[s.jsx(Ie,{size:16,className:"animate-spin"}),s.jsx("span",{children:"Connecting..."})]}):s.jsxs(s.Fragment,{children:[s.jsx(Ee,{size:16}),s.jsx("span",{children:"Add Connection"})]})})})]})]})}const Ve=e=>{if(!e||typeof e!="object")return!1;const t=e;return t.type==="text"&&typeof t.text=="string"&&t.text.trim().toLowerCase().startsWith("error")},ne=e=>{const t=e.structuredContent??e,i=t&&typeof t=="object"?t:null,o=i?.content?.[0]?.text&&typeof i.content[0].text=="string"?i.content[0].text:null;if(i?.isError)throw new Error(o??"Tool call failed");if(Ve(t))throw new Error(t.text);return t};function He(e){return e.requiresMcpBinding===!0?!0:e.binding!==void 0}function We(e){const t=H.c(48),{plugin:i,isEnabled:o,isSaving:d,pendingBinding:g,description:u,label:x,icon:j,projectId:b,client:a,onBindingChange:c,onToggle:f}=e;let p;t[0]!==i?(p=He(i),t[0]=i,t[1]=p):p=t[1];const w=p;let m;t[2]!==i.id||t[3]!==b?(m=U.projectPluginConfig(b??"",i.id),t[2]=i.id,t[3]=b,t[4]=m):m=t[4];let y;t[5]!==a||t[6]!==i.id||t[7]!==b?(y=async()=>{if(!b)throw new Error("Project ID is required to load plugin config.");const E=await a.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:b,pluginId:i.id}});return ne(E)},t[5]=a,t[6]=i.id,t[7]=b,t[8]=y):y=t[8];const P=!!b&&w;let C;t[9]!==m||t[10]!==y||t[11]!==P?(C={queryKey:m,queryFn:y,enabled:P},t[9]=m,t[10]=y,t[11]=P,t[12]=C):C=t[12];const{data:I,isLoading:S}=ye(C),n=I?.config?.connectionId??null,r=g!==void 0?g:n;let l;t[13]!==j?(l=j&&s.jsx("div",{className:"flex-shrink-0 text-muted-foreground [&>svg]:size-4",children:j}),t[13]=j,t[14]=l):l=t[14];let h;t[15]!==x?(h=s.jsx("div",{className:"text-sm font-medium text-foreground",children:x}),t[15]=x,t[16]=h):h=t[16];let v;t[17]!==u?(v=u&&s.jsx("p",{className:"text-xs text-muted-foreground",children:u}),t[17]=u,t[18]=v):v=t[18];let N;t[19]!==h||t[20]!==v?(N=s.jsxs("div",{className:"min-w-0",children:[h,v]}),t[19]=h,t[20]=v,t[21]=N):N=t[21];let F;t[22]!==l||t[23]!==N?(F=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[l,N]}),t[22]=l,t[23]=N,t[24]=F):F=t[24];let O;t[25]!==f||t[26]!==i.id?(O=E=>f(i.id,E),t[25]=f,t[26]=i.id,t[27]=O):O=t[27];let T;t[28]!==o||t[29]!==d||t[30]!==O?(T=s.jsx(ve,{checked:o,onCheckedChange:O,disabled:d}),t[28]=o,t[29]=d,t[30]=O,t[31]=T):T=t[31];let D;t[32]!==F||t[33]!==T?(D=s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[F,T]}),t[32]=F,t[33]=T,t[34]=D):D=t[34];let A;t[35]!==S||t[36]!==o||t[37]!==d||t[38]!==w||t[39]!==c||t[40]!==i.binding||t[41]!==i.id||t[42]!==r||t[43]!==n?(A=o&&w&&s.jsxs("div",{className:"mt-3 pl-7 flex items-center gap-3",children:[s.jsx(Ne,{className:"text-xs text-muted-foreground w-24",children:"Connection"}),s.jsx(Je,{value:r??null,onValueChange:E=>c(i.id,E,n),binding:i.binding,placeholder:"Select connection...",className:"w-56",disabled:d||S})]}),t[35]=S,t[36]=o,t[37]=d,t[38]=w,t[39]=c,t[40]=i.binding,t[41]=i.id,t[42]=r,t[43]=n,t[44]=A):A=t[44];let z;return t[45]!==D||t[46]!==A?(z=s.jsxs("div",{className:"py-3",children:[D,A]}),t[45]=D,t[46]=A,t[47]=z):z=t[47],z}function Ze(){const{org:e,project:t}=W(),i=X(),o=re({connectionId:ie,orgId:e.id}),[d,g]=q.useState({}),[u,x]=q.useState({}),[j,b]=q.useState(!1),a=t.enabledPlugins??[],c=n=>{const r=d[n];return r!==void 0?r:a.includes(n)},f=()=>{const n=new Set(a);for(const[r,l]of Object.entries(d))l?n.add(r):n.delete(r);return Array.from(n)},p=Object.keys(d).length>0||Object.keys(u).length>0,w=(n,r)=>{const l=a.includes(n);g(r===l?h=>{const{[n]:v,...N}=h;return N}:h=>({...h,[n]:r}))},m=(n,r,l)=>{if(r===l){x(h=>{const{[n]:v,...N}=h;return N});return}x(h=>({...h,[n]:r}))},y=ee({mutationFn:async n=>{const r=[];if(n.updatePlugins){const l=await o.callTool({name:"PROJECT_UPDATE",arguments:{projectId:t.id,enabledPlugins:n.enabledPlugins}});r.push(ne(l))}if(n.bindingUpdates.length>0){const l=await Promise.all(n.bindingUpdates.map(async({pluginId:h,connectionId:v})=>{const N=await o.callTool({name:"PROJECT_PLUGIN_CONFIG_UPDATE",arguments:{projectId:t.id,pluginId:h,connectionId:v}});return ne(N)}));r.push(...l)}return r},onSuccess:(n,r)=>{r.updatePlugins&&(i.invalidateQueries({queryKey:U.project(e.id,t.slug)}),i.invalidateQueries({queryKey:U.projects(e.id)})),r.bindingUpdates.forEach(({pluginId:l})=>{i.invalidateQueries({queryKey:U.projectPluginConfig(t.id??"",l)})}),g({}),x({}),R.success("Plugins updated successfully")},onError:n=>{R.error("Failed to update plugins: "+(n instanceof Error?n.message:"Unknown error"))},onSettled:()=>{b(!1)}}),P=()=>{b(!0),y.mutate({enabledPlugins:f(),updatePlugins:Object.keys(d).length>0,bindingUpdates:Object.entries(u).map(([n,r])=>({pluginId:n,connectionId:r}))})},C=()=>{g({}),x({})},I=n=>ue.find(r=>r.pluginId===n),S=n=>te.find(l=>l.id===n)?.description??null;return te.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Enable or disable plugins for this project. Enabled plugins will appear in the sidebar."}),s.jsx("div",{className:"divide-y divide-border border-y border-border",children:te.map(n=>{const r=I(n.id),l=S(n.id),h=c(n.id);return s.jsx(We,{plugin:n,isEnabled:h,isSaving:j,pendingBinding:u[n.id],description:l,label:r?.label??n.id,icon:r?.icon,projectId:t.id,client:o,onBindingChange:m,onToggle:w},n.id)})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(L,{variant:"outline",onClick:C,disabled:!p||j,children:"Cancel"}),s.jsx(L,{onClick:P,disabled:!p||j,className:"min-w-24",children:j?"Saving...":"Save Changes"})]})]})}const Ye=ce({name:G().min(1,"Name is required").max(255,"Name is too long"),slug:G().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:G().optional()});function Xe(e){const t=H.c(24),{value:i,onChange:o,name:d}=e,g=q.useRef(null);let u;t[0]!==o?(u=S=>{const n=S.target.files?.[0];if(n){if(n.size>2097152){R.error("Image must be smaller than 2MB");return}const r=new FileReader;r.onerror=()=>{const l=r.error;console.error("FileReader error:",l),R.error(l?.message||"Failed to read image file. Please try again."),g.current&&(g.current.value="")},r.onloadend=()=>{if(r.readyState===FileReader.DONE&&r.result){const l=r.result;o(l)}},r.readAsDataURL(n)}},t[0]=o,t[1]=u):u=t[1];const x=u;let j;t[2]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{g.current?.click()},t[2]=j):j=t[2];const b=j;let a;t[3]!==o?(a=S=>{S.stopPropagation(),o("")},t[3]=o,t[4]=a):a=t[4];const c=a;let f;t[5]!==x?(f=s.jsx("input",{type:"file",ref:g,className:"hidden",accept:"image/*",onChange:x}),t[5]=x,t[6]=f):f=t[6];let p;t[7]!==c||t[8]!==d||t[9]!==i?(p=i?s.jsxs("div",{className:"relative group",children:[s.jsx("div",{className:"h-20 w-20 rounded-lg border border-border bg-muted/20 overflow-hidden",children:s.jsx("img",{src:i,alt:d||"Organization logo",className:"w-full h-full object-cover"})}),s.jsx("button",{type:"button",onClick:c,className:"absolute -top-2 -right-2 h-6 w-6 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:s.jsx(Ae,{className:"h-3 w-3"})})]}):s.jsxs("button",{type:"button",onClick:b,className:"h-20 w-20 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-1 text-muted-foreground hover:text-foreground",children:[s.jsx(Te,{className:"h-5 w-5"}),s.jsx("span",{className:"text-xs",children:"Upload"})]}),t[7]=c,t[8]=d,t[9]=i,t[10]=p):p=t[10];const w=i?"Change Logo":"Upload Logo";let m;t[11]!==w?(m=s.jsx(L,{type:"button",variant:"outline",size:"sm",onClick:b,className:"mb-2",children:w}),t[11]=w,t[12]=m):m=t[12];let y;t[13]!==c||t[14]!==i?(y=i&&s.jsx(L,{type:"button",variant:"ghost",size:"sm",onClick:c,className:"ml-2",children:"Remove"}),t[13]=c,t[14]=i,t[15]=y):y=t[15];let P;t[16]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Recommended: Square image, at least 200x200px. Max 2MB."}),t[16]=P):P=t[16];let C;t[17]!==m||t[18]!==y?(C=s.jsxs("div",{className:"flex-1",children:[m,y,P]}),t[17]=m,t[18]=y,t[19]=C):C=t[19];let I;return t[20]!==C||t[21]!==f||t[22]!==p?(I=s.jsxs("div",{className:"flex items-start gap-4",children:[f,p,C]}),t[20]=C,t[21]=f,t[22]=p,t[23]=I):I=t[23],I}function et(){const e=de(),{org:t,project:i}=W(),o=X(),[d,g]=q.useState(!1),u=ae({resolver:oe(Ye),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),x=ee({mutationFn:async a=>{const c={name:a.name,slug:a.slug};a.logo&&(c.logo=a.logo);const f=await ge.organization.update({organizationId:t.id,data:c});if(f?.error)throw new Error(f.error.message||"Failed to update organization");return f},onSuccess:a=>{o.invalidateQueries({queryKey:U.organizations()}),o.invalidateQueries({queryKey:U.activeOrganization(t.slug)}),R.success("Organization settings updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/$project/settings",params:{org:a.data.slug,project:i.slug}})},onError:a=>{R.error(a instanceof Error?a.message:"Failed to update organization")},onSettled:()=>{g(!1)}}),j=a=>{g(!0),x.mutate(a)},b=u.formState.isDirty;return s.jsx(me,{...u,children:s.jsxs("form",{onSubmit:u.handleSubmit(j),className:"space-y-6",children:[s.jsx(Q,{control:u.control,name:"name",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Organization Name"}),s.jsx(M,{children:s.jsx(V,{placeholder:"My Organization",...a,disabled:d})}),s.jsx(J,{})]})}),s.jsx(Q,{control:u.control,name:"slug",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Organization Slug"}),s.jsx(M,{children:s.jsx(V,{placeholder:"my-organization",...a,disabled:d,onChange:c=>{const f=c.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");a.onChange(f)}})}),s.jsx(se,{children:"Used in URLs. Only lowercase letters, numbers, and hyphens are allowed."}),s.jsx(J,{})]})}),s.jsx(Q,{control:u.control,name:"logo",render:({field:a})=>s.jsxs($,{children:[s.jsx(K,{children:"Logo"}),s.jsx(M,{children:s.jsx(Xe,{value:a.value,onChange:a.onChange,name:u.watch("name")})}),s.jsx(J,{})]})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[s.jsx(L,{type:"submit",disabled:!b||d,className:"min-w-24",children:d?"Saving...":"Save Changes"}),b&&s.jsx(L,{type:"button",variant:"outline",onClick:()=>u.reset(),disabled:d,children:"Cancel"})]})]})})}function tt(){const e=H.c(44),{org:t,project:i}=W(),o=de(),d=X(),[g,u]=q.useState(""),[x,j]=q.useState(!1),b=i.slug===Y;let a;e[0]!==t.id?(a={connectionId:ie,orgId:t.id},e[0]=t.id,e[1]=a):a=e[1];const c=re(a);let f;e[2]!==c||e[3]!==i.id?(f=async()=>{const _=await c.callTool({name:"PROJECT_DELETE",arguments:{projectId:i.id}});return _.structuredContent??_},e[2]=c,e[3]=i.id,e[4]=f):f=e[4];let p;e[5]!==o||e[6]!==t.id||e[7]!==t.slug||e[8]!==d?(p=_=>{_.success?(d.invalidateQueries({queryKey:U.projects(t.id)}),R.success("Project deleted"),o({to:"/$org/$project",params:{org:t.slug,project:Y}})):R.error(_.message??"Failed to delete project")},e[5]=o,e[6]=t.id,e[7]=t.slug,e[8]=d,e[9]=p):p=e[9];let w;e[10]!==f||e[11]!==p?(w={mutationFn:f,onSuccess:p,onError:st},e[10]=f,e[11]=p,e[12]=w):w=e[12];const m=ee(w);if(b)return null;const y=g===i.name;let P;e[13]!==m?(P=()=>{m.mutate()},e[13]=m,e[14]=P):P=e[14];const C=P;let I;e[15]===Symbol.for("react.memo_cache_sentinel")?(I=_=>{j(_),_||u("")},e[15]=I):I=e[15];const S=I;let n;e[16]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-destructive",children:"Danger Zone"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Irreversible and destructive actions."})]}),e[16]=n):n=e[16];let r;e[17]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Be,{asChild:!0,children:s.jsx(L,{variant:"destructive",children:"Delete Project"})}),e[17]=r):r=e[17];let l;e[18]!==i.name?(l=s.jsxs(ze,{children:['Delete "',i.name,'"?']}),e[18]=i.name,e[19]=l):l=e[19];let h;e[20]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(ke,{children:"This action cannot be undone. All project data will be permanently deleted."}),e[20]=h):h=e[20];let v;e[21]!==l?(v=s.jsxs(Re,{children:[l,h]}),e[21]=l,e[22]=v):v=e[22];let N;e[23]!==i.name?(N=s.jsxs("p",{className:"text-sm mb-2",children:["Type ",s.jsx("strong",{children:i.name})," to confirm:"]}),e[23]=i.name,e[24]=N):N=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=_=>u(_.target.value),e[25]=F):F=e[25];let O;e[26]!==g||e[27]!==i.name?(O=s.jsx(V,{value:g,onChange:F,placeholder:i.name}),e[26]=g,e[27]=i.name,e[28]=O):O=e[28];let T;e[29]!==N||e[30]!==O?(T=s.jsxs("div",{className:"py-4",children:[N,O]}),e[29]=N,e[30]=O,e[31]=T):T=e[31];let D;e[32]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Le,{children:"Cancel"}),e[32]=D):D=e[32];const A=!y||m.isPending,z=m.isPending?"Deleting...":"Delete Project";let E;e[33]!==C||e[34]!==A||e[35]!==z?(E=s.jsxs(Ue,{children:[D,s.jsx(qe,{onClick:C,disabled:A,className:"bg-destructive hover:bg-destructive/90 text-destructive-foreground",children:z})]}),e[33]=C,e[34]=A,e[35]=z,e[36]=E):E=e[36];let k;e[37]!==v||e[38]!==T||e[39]!==E?(k=s.jsxs(Me,{children:[v,T,E]}),e[37]=v,e[38]=T,e[39]=E,e[40]=k):k=e[40];let B;return e[41]!==x||e[42]!==k?(B=s.jsxs("div",{className:"border border-destructive/50 rounded-lg p-4 space-y-4",children:[n,s.jsxs($e,{open:x,onOpenChange:S,children:[r,k]})]}),e[41]=x,e[42]=k,e[43]=B):B=e[43],B}function st(e){R.error("Failed to delete project: "+(e instanceof Error?e.message:"Unknown error"))}function At(){const e=H.c(10),{project:t}=W(),i=t.slug===Y;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(Z.Header,{children:s.jsx(Z.Header.Left,{children:s.jsx(fe,{children:s.jsx(pe,{children:s.jsx(he,{children:s.jsx(xe,{children:"Settings"})})})})})}),e[0]=o):o=e[0];let d;e[1]!==i?(d=i&&s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Organization"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Update your organization's name, slug, and logo."})]}),s.jsx(et,{})]}),e[1]=i,e[2]=d):d=e[2];let g;e[3]!==i?(g=!i&&s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"General"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Basic project information."})]}),s.jsx(Ge,{})]}),e[3]=i,e[4]=g):g=e[4];let u,x;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("section",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Plugins"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage which plugins are enabled and configure them."})]}),s.jsx(Ze,{})]}),x=s.jsx(tt,{}),e[5]=u,e[6]=x):(u=e[5],x=e[6]);let j;return e[7]!==d||e[8]!==g?(j=s.jsxs(Z,{children:[o,s.jsx(Z.Content,{children:s.jsx("div",{className:"flex h-full",children:s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"p-5 max-w-2xl",children:s.jsxs("div",{className:"space-y-8",children:[d,g,u,x]})})})})})]}),e[7]=d,e[8]=g,e[9]=j):j=e[9],j}export{At as default};
@@ -1 +1 @@
1
- import{b4 as U,c as O,u as H,j as s,aE as G,r as I,b as M,O as V}from"./index-CuIrPKu9.js";import{a as q}from"./use-project-CQC3Fx2l.js";import{P as E}from"./index-CEBU5ikU.js";import{E as R,C as F}from"./empty-state-DYt7iyWe.js";import{A as J}from"./avatar-B37qTwXF.js";import{c as K,B as T}from"./button-KbFW4XuN.js";import{f as Q}from"./formatDistanceToNow-Cb2QZZJn.js";import{C as W}from"./create-project-dialog-Cbp27b9r.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-B9K_bdts.js";import"./useQuery-eogqvd42.js";import"./constants-C56FepeM.js";import"./Loading01-D-iQ3x6B.js";import"./SearchMd-DWE3UxU2.js";import"./input-g5LrnBay.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./useMutation-Zw-bAGx2.js";import"./dialog-CTzYyOCo.js";import"./X-DA2sDUV2.js";import"./form-3k69lugl.js";import"./label-BRqnACHD.js";import"./textarea-CaReVd_T.js";import"./Check-DG5LOfHE.js";import"./ChevronRight-CHS1psX7.js";const te=U("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);function se(t){const e=O.c(58),{project:l,onSettingsClick:c}=t,{org:r}=H(),d=l.ui?.themeColor??"#60a5fa",b=l.ui?.bannerColor??d,m=l.ui?.banner?`url(${l.ui.banner})`:void 0;let i;e[0]!==b||e[1]!==m?(i={backgroundColor:b,backgroundImage:m,backgroundSize:"cover",backgroundPosition:"center"},e[0]=b,e[1]=m,e[2]=i):i=e[2];const _=i;let u;e[3]!==r.slug||e[4]!==l.slug?(u={org:r.slug,project:l.slug},e[3]=r.slug,e[4]=l.slug,e[5]=u):u=e[5];let f;e[6]!==c?(f=B=>{B.preventDefault(),B.stopPropagation(),c?.(B)},e[6]=c,e[7]=f):f=e[7];let x,v;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=K("absolute top-3 right-3 size-6 rounded-md flex items-center justify-center","bg-black/20 hover:bg-black/40 transition-colors","opacity-0 group-hover:opacity-100"),v=s.jsx(te,{className:"size-3.5 text-white"}),e[8]=x,e[9]=v):(x=e[8],v=e[9]);let g;e[10]!==f?(g=s.jsx("button",{type:"button",onClick:f,className:x,children:v}),e[10]=f,e[11]=g):g=e[11];let p;e[12]!==_||e[13]!==g?(p=s.jsx("div",{className:"h-20 relative",style:_,children:g}),e[12]=_,e[13]=g,e[14]=p):p=e[14];let n;e[15]!==l.name||e[16]!==l.ui||e[17]!==d?(n=l.ui?.icon?s.jsx("img",{src:l.ui.icon,alt:"",className:"size-8 rounded-md object-cover"}):s.jsx("div",{className:"size-8 rounded-md flex items-center justify-center",style:{backgroundColor:d},children:s.jsx("span",{className:"text-sm font-medium text-white",children:l.name.charAt(0).toUpperCase()})}),e[15]=l.name,e[16]=l.ui,e[17]=d,e[18]=n):n=e[18];let a;e[19]!==l.name?(a=s.jsx("h3",{className:"font-medium text-base text-foreground truncate",children:l.name}),e[19]=l.name,e[20]=a):a=e[20];let h;e[21]!==l.updatedAt?(h=Q(new Date(l.updatedAt),{addSuffix:!0}),e[21]=l.updatedAt,e[22]=h):h=e[22];let j;e[23]!==h?(j=s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Edited"," ",h]}),e[23]=h,e[24]=j):j=e[24];let C;e[25]!==a||e[26]!==j?(C=s.jsxs("div",{className:"flex flex-col",children:[a,j]}),e[25]=a,e[26]=j,e[27]=C):C=e[27];let N;e[28]!==n||e[29]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-4",children:[n,C]}),e[28]=n,e[29]=C,e[30]=N):N=e[30];let k;e[31]!==l.boundConnections?(k=l.boundConnections.slice(0,4).map(le),e[31]=l.boundConnections,e[32]=k):k=e[32];let P;e[33]!==l.boundConnections.length?(P=l.boundConnections.length>4&&s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsxs("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center text-xs text-muted-foreground",children:["+",l.boundConnections.length-4]})}),e[33]=l.boundConnections.length,e[34]=P):P=e[34];let y;e[35]!==k||e[36]!==P?(y=s.jsxs("div",{className:"flex pr-2",children:[k,P]}),e[35]=k,e[36]=P,e[37]=y):y=e[37];const z=r.logo??void 0;let w;e[38]!==r.name||e[39]!==z?(w=s.jsx(J,{url:z,fallback:r.name,size:"2xs",className:"shrink-0 rounded",objectFit:"cover"}),e[38]=r.name,e[39]=z,e[40]=w):w=e[40];let S;e[41]!==r.name?(S=s.jsx("span",{className:"truncate max-w-20",children:r.name}),e[41]=r.name,e[42]=S):S=e[42];let o;e[43]!==w||e[44]!==S?(o=s.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground",children:[w,S]}),e[43]=w,e[44]=S,e[45]=o):o=e[45];let L;e[46]!==y||e[47]!==o?(L=s.jsxs("div",{className:"flex items-center justify-between mt-4",children:[y,o]}),e[46]=y,e[47]=o,e[48]=L):L=e[48];let $;e[49]!==N||e[50]!==L?($=s.jsxs("div",{className:"flex flex-col flex-1 justify-between p-4",children:[N,L]}),e[49]=N,e[50]=L,e[51]=$):$=e[51];let A;e[52]!==$||e[53]!==p?(A=s.jsxs("div",{className:"border border-border rounded-xl overflow-hidden bg-card",children:[p,$]}),e[52]=$,e[53]=p,e[54]=A):A=e[54];let D;return e[55]!==A||e[56]!==u?(D=s.jsx(G,{to:"/$org/$project",params:u,className:"block group",children:A}),e[55]=A,e[56]=u,e[57]=D):D=e[57],D}function le(t){return s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsx(re,{connection:t})},t.id)}function re(t){const e=O.c(13),{connection:l}=t;if(l.icon){let m;e[0]!==l.icon||e[1]!==l.title?(m=s.jsx("img",{src:l.icon,alt:l.title,className:"size-4 object-cover"}),e[0]=l.icon,e[1]=l.title,e[2]=m):m=e[2];let i;return e[3]!==l.title||e[4]!==m?(i=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:l.title,children:m}),e[3]=l.title,e[4]=m,e[5]=i):i=e[5],i}const c=l.title;let r;e[6]!==l.title?(r=l.title.charAt(0).toUpperCase(),e[6]=l.title,e[7]=r):r=e[7];let d;e[8]!==r?(d=s.jsx("span",{className:"text-[10px] text-muted-foreground font-medium",children:r}),e[8]=r,e[9]=d):d=e[9];let b;return e[10]!==l.title||e[11]!==d?(b=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:c,children:d}),e[10]=l.title,e[11]=d,e[12]=b):b=e[12],b}function Le(){const t=O.c(40),{org:e}=H(),{data:l,isLoading:c}=q(e.id),[r,d]=I.useState(""),[b,m]=I.useState(!1),i=M();let _,u,f,x,v,g,p,n,a;if(t[0]!==c||t[1]!==i||t[2]!==e.slug||t[3]!==l||t[4]!==r){const N=l?.filter(ie)?.filter(o=>o.name.toLowerCase().includes(r.toLowerCase())||o.description?.toLowerCase().includes(r.toLowerCase()))??[];let k;t[14]!==i||t[15]!==e.slug?(k=o=>{i({to:"/$org/$project/settings",params:{org:e.slug,project:o}})},t[14]=i,t[15]=e.slug,t[16]=k):k=t[16];const P=k;let y;t[17]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{m(!0)},t[17]=y):y=t[17];const z=y;u=E;let w;t[18]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(E.Header.Left,{children:s.jsx(X,{children:s.jsx(Y,{children:s.jsx(Z,{children:s.jsx(ee,{children:"Projects"})})})})}),t[18]=w):w=t[18],t[19]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(E.Header,{children:[w,s.jsx(E.Header.Right,{children:s.jsx(T,{onClick:z,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Create new project"})})]}),t[19]=n):n=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=o=>{o.key==="Escape"&&(d(""),o.target.blur())},t[20]=S):S=t[20],t[21]!==r?(a=s.jsx(F,{value:r,onChange:d,placeholder:"Search for a project...",onKeyDown:S}),t[21]=r,t[22]=a):a=t[22],_=E.Content,f="@container",t[23]!==c?(x=c&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:[...Array(4)].map(oe)})}),t[23]=c,t[24]=x):x=t[24],v=!c&&N.length===0&&r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(R,{title:"No projects found",description:`No projects match "${r}"`})}),g=!c&&N.length===0&&!r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(R,{title:"No projects yet",description:"Create a project to get started.",actions:s.jsx(T,{onClick:z,children:"Create new project"})})}),p=!c&&N.length>0&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:N.map(o=>s.jsx(se,{project:o,onSettingsClick:()=>P(o.slug)},o.id))})}),t[0]=c,t[1]=i,t[2]=e.slug,t[3]=l,t[4]=r,t[5]=_,t[6]=u,t[7]=f,t[8]=x,t[9]=v,t[10]=g,t[11]=p,t[12]=n,t[13]=a}else _=t[5],u=t[6],f=t[7],x=t[8],v=t[9],g=t[10],p=t[11],n=t[12],a=t[13];let h;t[25]!==_||t[26]!==f||t[27]!==x||t[28]!==v||t[29]!==g||t[30]!==p?(h=s.jsxs(_,{className:f,children:[x,v,g,p]}),t[25]=_,t[26]=f,t[27]=x,t[28]=v,t[29]=g,t[30]=p,t[31]=h):h=t[31];let j;t[32]!==b?(j=s.jsx(W,{open:b,onOpenChange:m}),t[32]=b,t[33]=j):j=t[33];let C;return t[34]!==u||t[35]!==n||t[36]!==a||t[37]!==h||t[38]!==j?(C=s.jsxs(u,{children:[n,a,h,j]}),t[34]=u,t[35]=n,t[36]=a,t[37]=h,t[38]=j,t[39]=C):C=t[39],C}function oe(t,e){return s.jsx("div",{className:"h-[240px] rounded-xl bg-muted animate-pulse"},e)}function ie(t){return t.slug!==V}export{Le as default};
1
+ import{b3 as U,c as O,u as H,j as s,aD as G,r as I,b as M,O as V}from"./index-DXIsw0zh.js";import{a as q}from"./use-project-gbXgodP7.js";import{P as D}from"./index-D0P8wRBl.js";import{E as R,C as F}from"./empty-state-BRTEyQic.js";import{A as J}from"./avatar-BwRAYU0T.js";import{c as K,B as T}from"./button-B1_AjrAy.js";import{f as Q}from"./formatDistanceToNow-Cb2QZZJn.js";import{C as W}from"./create-project-dialog-CbnOarMk.js";import{B as X,a as Y,b as Z,c as ee}from"./breadcrumb-C8b5zMor.js";import"./useQuery-BB1xkDqD.js";import"./constants-D3TKhQyR.js";import"./Loading01-CQxnYIyy.js";import"./SearchMd-CJBYDik4.js";import"./input-CBsHg1ZU.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./useMutation-B0HsJHYQ.js";import"./dialog-BIx4eChJ.js";import"./X-PXGrxqUi.js";import"./form-CSMGXcSP.js";import"./label-BAn78i4V.js";import"./textarea-Bs1SDhbD.js";import"./Check-BHtow5c6.js";import"./ChevronRight-Ds0FvHp6.js";const te=U("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);function se(t){const e=O.c(58),{project:l,onSettingsClick:c}=t,{org:r}=H(),d=l.ui?.themeColor??"#60a5fa",b=l.ui?.bannerColor??d,m=l.ui?.banner?`url(${l.ui.banner})`:void 0;let i;e[0]!==b||e[1]!==m?(i={backgroundColor:b,backgroundImage:m,backgroundSize:"cover",backgroundPosition:"center"},e[0]=b,e[1]=m,e[2]=i):i=e[2];const _=i;let u;e[3]!==r.slug||e[4]!==l.slug?(u={org:r.slug,project:l.slug},e[3]=r.slug,e[4]=l.slug,e[5]=u):u=e[5];let f;e[6]!==c?(f=B=>{B.preventDefault(),B.stopPropagation(),c?.(B)},e[6]=c,e[7]=f):f=e[7];let x,v;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=K("absolute top-3 right-3 size-6 rounded-md flex items-center justify-center","bg-black/20 hover:bg-black/40 transition-colors","opacity-0 group-hover:opacity-100"),v=s.jsx(te,{className:"size-3.5 text-white"}),e[8]=x,e[9]=v):(x=e[8],v=e[9]);let g;e[10]!==f?(g=s.jsx("button",{type:"button",onClick:f,className:x,children:v}),e[10]=f,e[11]=g):g=e[11];let p;e[12]!==_||e[13]!==g?(p=s.jsx("div",{className:"h-20 relative",style:_,children:g}),e[12]=_,e[13]=g,e[14]=p):p=e[14];let n;e[15]!==l.name||e[16]!==l.ui||e[17]!==d?(n=l.ui?.icon?s.jsx("img",{src:l.ui.icon,alt:"",className:"size-8 rounded-md object-cover"}):s.jsx("div",{className:"size-8 rounded-md flex items-center justify-center",style:{backgroundColor:d},children:s.jsx("span",{className:"text-sm font-medium text-white",children:l.name.charAt(0).toUpperCase()})}),e[15]=l.name,e[16]=l.ui,e[17]=d,e[18]=n):n=e[18];let a;e[19]!==l.name?(a=s.jsx("h3",{className:"font-medium text-base text-foreground truncate",children:l.name}),e[19]=l.name,e[20]=a):a=e[20];let h;e[21]!==l.updatedAt?(h=Q(new Date(l.updatedAt),{addSuffix:!0}),e[21]=l.updatedAt,e[22]=h):h=e[22];let j;e[23]!==h?(j=s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Edited"," ",h]}),e[23]=h,e[24]=j):j=e[24];let C;e[25]!==a||e[26]!==j?(C=s.jsxs("div",{className:"flex flex-col",children:[a,j]}),e[25]=a,e[26]=j,e[27]=C):C=e[27];let N;e[28]!==n||e[29]!==C?(N=s.jsxs("div",{className:"flex flex-col gap-4",children:[n,C]}),e[28]=n,e[29]=C,e[30]=N):N=e[30];let k;e[31]!==l.boundConnections?(k=l.boundConnections.slice(0,4).map(le),e[31]=l.boundConnections,e[32]=k):k=e[32];let P;e[33]!==l.boundConnections.length?(P=l.boundConnections.length>4&&s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsxs("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center text-xs text-muted-foreground",children:["+",l.boundConnections.length-4]})}),e[33]=l.boundConnections.length,e[34]=P):P=e[34];let y;e[35]!==k||e[36]!==P?(y=s.jsxs("div",{className:"flex pr-2",children:[k,P]}),e[35]=k,e[36]=P,e[37]=y):y=e[37];const z=r.logo??void 0;let w;e[38]!==r.name||e[39]!==z?(w=s.jsx(J,{url:z,fallback:r.name,size:"2xs",className:"shrink-0 rounded",objectFit:"cover"}),e[38]=r.name,e[39]=z,e[40]=w):w=e[40];let S;e[41]!==r.name?(S=s.jsx("span",{className:"truncate max-w-20",children:r.name}),e[41]=r.name,e[42]=S):S=e[42];let o;e[43]!==w||e[44]!==S?(o=s.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground",children:[w,S]}),e[43]=w,e[44]=S,e[45]=o):o=e[45];let L;e[46]!==y||e[47]!==o?(L=s.jsxs("div",{className:"flex items-center justify-between mt-4",children:[y,o]}),e[46]=y,e[47]=o,e[48]=L):L=e[48];let $;e[49]!==N||e[50]!==L?($=s.jsxs("div",{className:"flex flex-col flex-1 justify-between p-4",children:[N,L]}),e[49]=N,e[50]=L,e[51]=$):$=e[51];let A;e[52]!==$||e[53]!==p?(A=s.jsxs("div",{className:"border border-border rounded-xl overflow-hidden bg-card",children:[p,$]}),e[52]=$,e[53]=p,e[54]=A):A=e[54];let E;return e[55]!==A||e[56]!==u?(E=s.jsx(G,{to:"/$org/$project",params:u,className:"block group",children:A}),e[55]=A,e[56]=u,e[57]=E):E=e[57],E}function le(t){return s.jsx("div",{className:"-mr-2 rounded-md border border-background",children:s.jsx(re,{connection:t})},t.id)}function re(t){const e=O.c(13),{connection:l}=t;if(l.icon){let m;e[0]!==l.icon||e[1]!==l.title?(m=s.jsx("img",{src:l.icon,alt:l.title,className:"size-4 object-cover"}),e[0]=l.icon,e[1]=l.title,e[2]=m):m=e[2];let i;return e[3]!==l.title||e[4]!==m?(i=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:l.title,children:m}),e[3]=l.title,e[4]=m,e[5]=i):i=e[5],i}const c=l.title;let r;e[6]!==l.title?(r=l.title.charAt(0).toUpperCase(),e[6]=l.title,e[7]=r):r=e[7];let d;e[8]!==r?(d=s.jsx("span",{className:"text-[10px] text-muted-foreground font-medium",children:r}),e[8]=r,e[9]=d):d=e[9];let b;return e[10]!==l.title||e[11]!==d?(b=s.jsx("div",{className:"size-6 rounded-md bg-background border border-black/10 shadow-sm flex items-center justify-center overflow-hidden",title:c,children:d}),e[10]=l.title,e[11]=d,e[12]=b):b=e[12],b}function Le(){const t=O.c(40),{org:e}=H(),{data:l,isLoading:c}=q(e.id),[r,d]=I.useState(""),[b,m]=I.useState(!1),i=M();let _,u,f,x,v,g,p,n,a;if(t[0]!==c||t[1]!==i||t[2]!==e.slug||t[3]!==l||t[4]!==r){const N=l?.filter(ie)?.filter(o=>o.name.toLowerCase().includes(r.toLowerCase())||o.description?.toLowerCase().includes(r.toLowerCase()))??[];let k;t[14]!==i||t[15]!==e.slug?(k=o=>{i({to:"/$org/$project/settings",params:{org:e.slug,project:o}})},t[14]=i,t[15]=e.slug,t[16]=k):k=t[16];const P=k;let y;t[17]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{m(!0)},t[17]=y):y=t[17];const z=y;u=D;let w;t[18]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(D.Header.Left,{children:s.jsx(X,{children:s.jsx(Y,{children:s.jsx(Z,{children:s.jsx(ee,{children:"Projects"})})})})}),t[18]=w):w=t[18],t[19]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs(D.Header,{children:[w,s.jsx(D.Header.Right,{children:s.jsx(T,{onClick:z,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Create new project"})})]}),t[19]=n):n=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=o=>{o.key==="Escape"&&(d(""),o.target.blur())},t[20]=S):S=t[20],t[21]!==r?(a=s.jsx(F,{value:r,onChange:d,placeholder:"Search for a project...",onKeyDown:S}),t[21]=r,t[22]=a):a=t[22],_=D.Content,f="@container",t[23]!==c?(x=c&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:[...Array(4)].map(oe)})}),t[23]=c,t[24]=x):x=t[24],v=!c&&N.length===0&&r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(R,{title:"No projects found",description:`No projects match "${r}"`})}),g=!c&&N.length===0&&!r&&s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(R,{title:"No projects yet",description:"Create a project to get started.",actions:s.jsx(T,{onClick:z,children:"Create new project"})})}),p=!c&&N.length>0&&s.jsx("div",{className:"p-5",children:s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:N.map(o=>s.jsx(se,{project:o,onSettingsClick:()=>P(o.slug)},o.id))})}),t[0]=c,t[1]=i,t[2]=e.slug,t[3]=l,t[4]=r,t[5]=_,t[6]=u,t[7]=f,t[8]=x,t[9]=v,t[10]=g,t[11]=p,t[12]=n,t[13]=a}else _=t[5],u=t[6],f=t[7],x=t[8],v=t[9],g=t[10],p=t[11],n=t[12],a=t[13];let h;t[25]!==_||t[26]!==f||t[27]!==x||t[28]!==v||t[29]!==g||t[30]!==p?(h=s.jsxs(_,{className:f,children:[x,v,g,p]}),t[25]=_,t[26]=f,t[27]=x,t[28]=v,t[29]=g,t[30]=p,t[31]=h):h=t[31];let j;t[32]!==b?(j=s.jsx(W,{open:b,onOpenChange:m}),t[32]=b,t[33]=j):j=t[33];let C;return t[34]!==u||t[35]!==n||t[36]!==a||t[37]!==h||t[38]!==j?(C=s.jsxs(u,{children:[n,a,h,j]}),t[34]=u,t[35]=n,t[36]=a,t[37]=h,t[38]=j,t[39]=C):C=t[39],C}function oe(t,e){return s.jsx("div",{className:"h-[240px] rounded-xl bg-muted animate-pulse"},e)}function ie(t){return t.slug!==V}export{Le as default};
@@ -1 +1 @@
1
- import{c as b,K as E,j as l}from"./index-CuIrPKu9.js";import{u as R}from"./useQuery-eogqvd42.js";import{i as j}from"./File06-CqEjxUxt.js";import{i as v}from"./Loading01-D-iQ3x6B.js";import{e as _}from"./github-icon-Dp3wHhYE.js";function w(s){return s.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function A(s){return s.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,r)=>{let t=e;return r.includes("target=")?t=t.replace(/target="[^"]*"/gi,'target="_blank"'):t=t.replace(/>/,' target="_blank">'),r.includes("rel=")?t=t.replace(/rel="[^"]*"/gi,'rel="noopener noreferrer"'):t=t.replace(/>/,' rel="noopener noreferrer">'),t})}function H(s){let e=w(s);return e=A(e),e}async function L(s,e){try{const r=await fetch(`https://api.github.com/repos/${s}/${e}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!r.ok){if(r.status===404)return null;throw new Error(`Failed to fetch README: ${r.statusText}`)}const t=await r.text();return H(t)}catch(r){return console.error("Error fetching README:",r),null}}function D(s){const e=b.c(18),{repository:r,html:t,isLoading:g,queryKey:h}=s;let n,o,a,m;e[0]!==t||e[1]!==h||e[2]!==r?(n=r?_(r):null,o=!!n&&t===void 0,m=R,a=h??E.githubReadme(n?.owner,n?.repo),e[0]=t,e[1]=h,e[2]=r,e[3]=n,e[4]=o,e[5]=a,e[6]=m):(n=e[3],o=e[4],a=e[5],m=e[6]);let c;e[7]!==n?(c=async()=>n?L(n.owner,n.repo):null,e[7]=n,e[8]=c):c=e[8];let u;e[9]!==o||e[10]!==a||e[11]!==c?(u={queryKey:a,queryFn:c,enabled:o,staleTime:36e5,gcTime:864e5},e[9]=o,e[10]=a,e[11]=c,e[12]=u):u=e[12];const{data:x,isLoading:y}=m(u),f=t??x;if(g??(o&&y)){let i;return e[13]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(v,{size:32,className:"animate-spin text-muted-foreground"})}),e[13]=i):i=e[13],i}if(!f){let i;return e[14]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[l.jsx(j,{size:48,className:"text-muted-foreground mb-4"}),l.jsx("h3",{className:"text-lg font-medium mb-2",children:"README not found"}),l.jsx("p",{className:"text-muted-foreground max-w-md",children:"This repository doesn't have a README file, or it's not publicly accessible."})]}),e[14]=i):i=e[14],i}let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d={backgroundColor:"transparent"},e[15]=d):d=e[15];let p;return e[16]!==f?(p=l.jsx("div",{className:"p-5 markdown-body",style:d,dangerouslySetInnerHTML:{__html:f}}),e[16]=f,e[17]=p):p=e[17],p}export{D as R};
1
+ import{c as b,K as E,j as l}from"./index-DXIsw0zh.js";import{u as R}from"./useQuery-BB1xkDqD.js";import{i as j}from"./File06-BrnW1ZQ1.js";import{i as v}from"./Loading01-CQxnYIyy.js";import{e as _}from"./github-icon-Dp3wHhYE.js";function w(s){return s.replace(/<a[^>]*class="[^"]*anchor[^"]*"[^>]*>.*?<\/a>/gi,"")}function A(s){return s.replace(/<a\s+([^>]*href="[^"]*"[^>]*)>/gi,(e,r)=>{let t=e;return r.includes("target=")?t=t.replace(/target="[^"]*"/gi,'target="_blank"'):t=t.replace(/>/,' target="_blank">'),r.includes("rel=")?t=t.replace(/rel="[^"]*"/gi,'rel="noopener noreferrer"'):t=t.replace(/>/,' rel="noopener noreferrer">'),t})}function H(s){let e=w(s);return e=A(e),e}async function L(s,e){try{const r=await fetch(`https://api.github.com/repos/${s}/${e}/readme`,{headers:{Accept:"application/vnd.github.v3.html"}});if(!r.ok){if(r.status===404)return null;throw new Error(`Failed to fetch README: ${r.statusText}`)}const t=await r.text();return H(t)}catch(r){return console.error("Error fetching README:",r),null}}function D(s){const e=b.c(18),{repository:r,html:t,isLoading:g,queryKey:h}=s;let n,o,a,m;e[0]!==t||e[1]!==h||e[2]!==r?(n=r?_(r):null,o=!!n&&t===void 0,m=R,a=h??E.githubReadme(n?.owner,n?.repo),e[0]=t,e[1]=h,e[2]=r,e[3]=n,e[4]=o,e[5]=a,e[6]=m):(n=e[3],o=e[4],a=e[5],m=e[6]);let c;e[7]!==n?(c=async()=>n?L(n.owner,n.repo):null,e[7]=n,e[8]=c):c=e[8];let u;e[9]!==o||e[10]!==a||e[11]!==c?(u={queryKey:a,queryFn:c,enabled:o,staleTime:36e5,gcTime:864e5},e[9]=o,e[10]=a,e[11]=c,e[12]=u):u=e[12];const{data:x,isLoading:y}=m(u),f=t??x;if(g??(o&&y)){let i;return e[13]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx(v,{size:32,className:"animate-spin text-muted-foreground"})}),e[13]=i):i=e[13],i}if(!f){let i;return e[14]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6",children:[l.jsx(j,{size:48,className:"text-muted-foreground mb-4"}),l.jsx("h3",{className:"text-lg font-medium mb-2",children:"README not found"}),l.jsx("p",{className:"text-muted-foreground max-w-md",children:"This repository doesn't have a README file, or it's not publicly accessible."})]}),e[14]=i):i=e[14],i}let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d={backgroundColor:"transparent"},e[15]=d):d=e[15];let p;return e[16]!==f?(p=l.jsx("div",{className:"p-5 markdown-body",style:d,dangerouslySetInnerHTML:{__html:f}}),e[16]=f,e[17]=p):p=e[17],p}export{D as R};
@@ -1,4 +1,4 @@
1
- import{r as M,c as K,u as de,z as Be,bA as et,j as s,t as W,bE as an}from"./index-CuIrPKu9.js";import{B as F,c as J}from"./button-KbFW4XuN.js";import{i as bt}from"./CheckCircle-DXUyPLGJ.js";import{n as on}from"./Container-DZJok7qt.js";import{t as cn}from"./Settings01-DKrG7yMR.js";import{u as Ge}from"./useQuery-eogqvd42.js";import{u as Me}from"./useMutation-Zw-bAGx2.js";import{a as be,u as ge,j as gs}from"./constants-C56FepeM.js";import{u as dn}from"./useInfiniteQuery-CGBDp2t8.js";import{B as U}from"./badge-CbuZxOhE.js";import{I as ye}from"./input-g5LrnBay.js";import{a as kt,c as We,D as St,b as Rt,h as ls,i as as,g as mn}from"./dropdown-menu-COB17A0Z.js";import{e as js,a as ys,b as Tt,T as Ae,d as bs,c as Le}from"./table-50O0LiWw.js";import{a as os,T as un}from"./toggle-group-igEKa_l0.js";import{u as xn}from"./use-view-mode-C4TZAKDl.js";import{i as Xt}from"./DotsVertical-BAfOGQhL.js";import{i as hn}from"./FilterLines-bS8_Yh-E.js";import{i as vs}from"./Globe01-BijbXV_r.js";import{i as mt}from"./Loading01-D-iQ3x6B.js";import{i as Ns}from"./SearchMd-DWE3UxU2.js";import{b as It,c as Mt,d as Pt,e as Et,a as Dt,D as $t}from"./dialog-CTzYyOCo.js";import{i as jt}from"./AlertCircle-BNHu4U_w.js";import{n as pn}from"./Download01-B_ClGnf8.js";import{i as cs}from"./Upload01-DCltlStQ.js";import{c as Lt,b as zt,d as Ot,A as Ut,g as qt,e as Ft,a as Bt,f as Gt}from"./alert-dialog-Bow6SDVm.js";import{C as ne}from"./card-CIHNFHDM.js";import{s as vt}from"./Trash01-DOoBIHb_.js";import{L as ie}from"./label-BRqnACHD.js";import{n as fn,S as ws,a as Cs,b as _s,c as ks,d as Ct}from"./select-CjbCdlbs.js";import{S as _t}from"./switch-mZQ9VTrI.js";import{T as At}from"./textarea-CaReVd_T.js";import{i as gn}from"./ArrowLeft-BCoINK1a.js";import{i as jn,u as Ht,t as yn}from"./use-copy-DzbutdJX.js";import{s as es}from"./RefreshCcw01-ByoHxPlX.js";import{i as bn}from"./X-DA2sDUV2.js";import{t as Ss}from"./ChevronDown-P4XeJ9w5.js";import{s as Rs}from"./Eye-HNj86q6R.js";import{n as vn}from"./LinkExternal01-BTGVW1Qi.js";import{i as Nn}from"./XCircle-D6Zk67At.js";import{h as Ts,e as Is}from"./use-connection-h_6wlDvG.js";import{b as wn,P as Cn,a as _n}from"./popover-VJKeuwbC.js";import{i as Wt}from"./Check-DG5LOfHE.js";import{a as Jt}from"./Copy01-CBdgbqFW.js";import{i as kn,a as Sn}from"./Save01-9tV2ohjl.js";import{i as Rn}from"./Key01-BB3q5OcJ.js";import{s as Tn}from"./Plus-B8rm50Ox.js";import{a as In,b as Mn,T as Pn}from"./tooltip-0WAr9Tnd.js";import{a as En,i as Dn}from"./mcp-oauth-CqxFiNor.js";import{i as $n}from"./Play-DqomGUHs.js";import"./infiniteQueryObserver-60Pvs7lk.js";import"./ChevronRight-CHS1psX7.js";import"./use-mobile-DBbPwq5K.js";import"./index-1ZfnT2oW.js";const Ms=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M10.743 5.092C11.149 5.032 11.569 5 12 5c5.105 0 8.455 4.505 9.58 6.287.137.215.205.323.243.49a1.16 1.16 0 0 1 0 .447c-.038.166-.107.274-.244.492-.3.474-.757 1.141-1.363 1.865M6.724 6.715c-2.162 1.467-3.63 3.504-4.303 4.57-.137.217-.205.325-.243.492a1.173 1.173 0 0 0 0 .446c.038.167.106.274.242.49C3.546 14.495 6.895 19 12 19c2.059 0 3.832-.732 5.289-1.723M3 3l18 18M9.88 9.879a3 3 0 1 0 4.243 4.243"}));Ms.displayName="EyeOff";const Ps=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M12.5 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H17c.93 0 1.395 0 1.776-.102a3 3 0 0 0 2.122-2.122C21 18.395 21 17.93 21 17m-2-9V2m-3 3h6M10.5 8.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm4.49 3.418-8.459 7.69c-.476.433-.714.649-.735.836a.5.5 0 0 0 .167.431C6.105 21 6.426 21 7.07 21h9.387c1.44 0 2.159 0 2.724-.242a3 3 0 0 0 1.578-1.578c.242-.565.242-1.285.242-2.724 0-.484 0-.726-.053-.952a2.001 2.001 0 0 0-.374-.778c-.143-.182-.332-.333-.71-.636l-2.797-2.237c-.379-.303-.568-.454-.776-.508a1 1 0 0 0-.557.018c-.205.066-.384.23-.743.555Z"}));Ps.displayName="ImagePlus";const Es=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"m12.708 18.364-1.415 1.414a5 5 0 1 1-7.07-7.07l1.413-1.415m12.728 1.414 1.415-1.414a5 5 0 0 0-7.071-7.071l-1.415 1.414M8.5 15.5l7-7"}));Es.displayName="Link01";const Ds=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}),M.createElement("path",{d:"M8 9.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 8 9.04 8 9.6 8h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 8.76 16 9.04 16 9.6v4.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C15.24 16 14.96 16 14.4 16H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 15.24 8 14.96 8 14.4V9.6Z"}));Ds.displayName="StopSquare";const ts=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"m6 6 4.5 4.5M6 6H3L2 3l1-1 3 1v3Zm13.259-3.259-2.628 2.628c-.396.396-.594.594-.668.822a1 1 0 0 0 0 .618c.074.228.272.426.668.822l.238.238c.396.396.594.594.822.668a1 1 0 0 0 .618 0c.228-.074.426-.272.822-.668L21.59 5.41a5.5 5.5 0 0 1-6.16 7.485c-.485-.096-.729-.144-.876-.13a.836.836 0 0 0-.373.114c-.13.07-.261.201-.523.463L6.5 20.5a2.121 2.121 0 0 1-3-3l7.157-7.157c.262-.262.393-.393.463-.524a.836.836 0 0 0 .113-.372c.015-.148-.033-.39-.129-.877a5.5 5.5 0 0 1 8.155-5.83ZM12 15l5.5 5.5a2.121 2.121 0 0 0 3-3l-4.525-4.525a5.475 5.475 0 0 1-.934-.17c-.39-.107-.816-.03-1.101.255L12 15Z"}));ts.displayName="Tool02";const G={all:["private-registry"],items:()=>[...G.all,"items"],itemsList:(t,e,n,r)=>[...G.items(),"list",{search:t,tags:e,categories:n,limit:r}],item:t=>[...G.items(),"item",t],filters:()=>[...G.all,"filters"],registryConfig:()=>[...G.all,"registry-config"],registryConfigByPlugin:(t,e)=>[...G.registryConfig(),t,e],publishRequests:()=>[...G.all,"publish-requests"],publishRequestsByOrg:t=>[...G.publishRequests(),"org",t],publishRequestsList:t=>[...G.publishRequests(),"list",{status:t??"all"}],publishRequestsListByOrg:(t,e)=>[...G.publishRequestsByOrg(t),"list",{status:e??"all"}],publishRequestsCount:()=>[...G.publishRequests(),"count"],publishRequestsCountByOrg:t=>[...G.publishRequestsByOrg(t),"count"],publishApiKeys:()=>[...G.all,"publish-api-keys"],monitor:()=>[...G.all,"monitor"],monitorRuns:()=>[...G.monitor(),"runs"],monitorRunsList:t=>[...G.monitorRuns(),"list",{status:t??"all"}],monitorRun:t=>[...G.monitorRuns(),"run",t??"none"],monitorResults:()=>[...G.monitor(),"results"],monitorResultsList:(t,e)=>[...G.monitorResults(),"list",{runId:t??"none",status:e??"all"}],monitorConnections:()=>[...G.monitor(),"connections"],monitorConnectionAuthProbe:t=>[...G.monitorConnections(),"auth-probe",t]};async function ze(t,e,n){const r=await t.callTool({name:e,arguments:n});if(!r||typeof r!="object")throw new Error(`Invalid tool response for ${e}`);if(r.isError){const o=r.content?.find(l=>l.type==="text")?.text??`Tool ${e} returned an error`;throw new Error(o)}return r.structuredContent??r}function An(){const t=K.c(9),e=Be(),{org:n}=de();let r;t[0]!==n.id?(r={connectionId:be,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=ge(r);let l;t[2]!==o?(l=async c=>ze(o,"REGISTRY_MONITOR_RUN_START",{config:c}),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e?(a=async()=>{await Promise.all([e.invalidateQueries({queryKey:G.monitorRuns()}),e.invalidateQueries({queryKey:G.monitorResults()})])},t[4]=e,t[5]=a):a=t[5];let i;return t[6]!==l||t[7]!==a?(i={mutationFn:l,onSuccess:a},t[6]=l,t[7]=a,t[8]=i):i=t[8],Me(i)}function Ln(){const t=K.c(9),e=Be(),{org:n}=de();let r;t[0]!==n.id?(r={connectionId:be,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=ge(r);let l;t[2]!==o?(l=async c=>ze(o,"REGISTRY_MONITOR_RUN_CANCEL",{runId:c}),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e?(a=async(c,m)=>{await Promise.all([e.invalidateQueries({queryKey:G.monitorRuns()}),e.invalidateQueries({queryKey:G.monitorRun(m)})])},t[4]=e,t[5]=a):a=t[5];let i;return t[6]!==l||t[7]!==a?(i={mutationFn:l,onSuccess:a},t[6]=l,t[7]=a,t[8]=i):i=t[8],Me(i)}function Qt(t){const e=K.c(10),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:be,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=ge(r);let l;e[2]!==t?(l=G.monitorRunsList(t),e[2]=t,e[3]=l):l=e[3];let a;e[4]!==o||e[5]!==t?(a=async()=>ze(o,"REGISTRY_MONITOR_RUN_LIST",{status:t,limit:100}),e[4]=o,e[5]=t,e[6]=a):a=e[6];let i;return e[7]!==l||e[8]!==a?(i={queryKey:l,queryFn:a,staleTime:5e3},e[7]=l,e[8]=a,e[9]=i):i=e[9],Ge(i)}function ss(t){const e=K.c(11),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:be,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=ge(r);let l;e[2]!==t?(l=G.monitorRun(t),e[2]=t,e[3]=l):l=e[3];let a;e[4]!==o||e[5]!==t?(a=async()=>ze(o,"REGISTRY_MONITOR_RUN_GET",{runId:t}),e[4]=o,e[5]=t,e[6]=a):a=e[6];const i=!!t;let c;return e[7]!==l||e[8]!==a||e[9]!==i?(c={queryKey:l,queryFn:a,enabled:i,refetchInterval:zn},e[7]=l,e[8]=a,e[9]=i,e[10]=c):c=e[10],Ge(c)}function zn(t){return t.state.data?.run?.status==="running"?5e3:!1}function Nt(t,e,n){const r=K.c(14),{org:o}=de();let l;r[0]!==o.id?(l={connectionId:be,orgId:o.id},r[0]=o.id,r[1]=l):l=r[1];const a=ge(l);let i;r[2]!==t||r[3]!==e?(i=G.monitorResultsList(t,e),r[2]=t,r[3]=e,r[4]=i):i=r[4];let c;r[5]!==a||r[6]!==t||r[7]!==e?(c=async()=>ze(a,"REGISTRY_MONITOR_RESULT_LIST",{runId:t,status:e,limit:200,offset:0}),r[5]=a,r[6]=t,r[7]=e,r[8]=c):c=r[8];const m=!!t,x=n==="running"?2500:!1;let h;return r[9]!==i||r[10]!==c||r[11]!==m||r[12]!==x?(h={queryKey:i,queryFn:c,enabled:m,staleTime:5e3,refetchInterval:x},r[9]=i,r[10]=c,r[11]=m,r[12]=x,r[13]=h):h=r[13],Ge(h)}function $s(){const t=K.c(5),{org:e}=de();let n;t[0]!==e.id?(n={connectionId:be,orgId:e.id},t[0]=e.id,t[1]=n):n=t[1];const r=ge(n);let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=G.monitorConnections(),t[2]=o):o=t[2];let l;return t[3]!==r?(l={queryKey:o,queryFn:async()=>ze(r,"REGISTRY_MONITOR_CONNECTION_LIST",{}),staleTime:1e4},t[3]=r,t[4]=l):l=t[4],Ge(l)}function On(){const t=K.c(9),e=Be(),{org:n}=de();let r;t[0]!==n.id?(r={connectionId:be,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=ge(r);let l;t[2]!==o?(l=async()=>ze(o,"REGISTRY_MONITOR_CONNECTION_SYNC",{}),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:G.monitorConnections()})},t[4]=e,t[5]=a):a=t[5];let i;return t[6]!==l||t[7]!==a?(i={mutationFn:l,onSuccess:a},t[6]=l,t[7]=a,t[8]=i):i=t[8],Me(i)}function Un(){const t=K.c(9),e=Be(),{org:n}=de();let r;t[0]!==n.id?(r={connectionId:be,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=ge(r);let l;t[2]!==o?(l=async c=>{const{connectionId:m,authStatus:x}=c;return ze(o,"REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH",{connectionId:m,authStatus:x})},t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:G.monitorConnections()})},t[4]=e,t[5]=a):a=t[5];let i;return t[6]!==l||t[7]!==a?(i={mutationFn:l,onSuccess:a},t[6]=l,t[7]=a,t[8]=i):i=t[8],Me(i)}const ds={monitorMode:"health_check",onFailure:"none",schedule:"manual",cronExpression:"",scheduleEventId:"",perMcpTimeoutMs:3e4,perToolTimeoutMs:1e4,maxAgentSteps:15,testPublicOnly:!1,testPrivateOnly:!1,includePendingRequests:!1,agentContext:"",llmConnectionId:"",llmModelId:""};function As(){const t=K.c(33),{org:e,project:n}=de();let r;t[0]!==e.id?(r={connectionId:be,orgId:e.id},t[0]=e.id,t[1]=r):r=t[1];const o=ge(r),l=Be();let a;t[2]!==n.id?(a=G.registryConfigByPlugin(n.id??"",et),t[2]=n.id,t[3]=a):a=t[3];let i;t[4]!==o||t[5]!==n.id?(i=async()=>ze(o,"PROJECT_PLUGIN_CONFIG_GET",{projectId:n.id,pluginId:et}),t[4]=o,t[5]=n.id,t[6]=i):i=t[6];const c=!!n.id;let m;t[7]!==a||t[8]!==i||t[9]!==c?(m={queryKey:a,queryFn:i,enabled:c},t[7]=a,t[8]=i,t[9]=c,t[10]=m):m=t[10];const x=Ge(m),h=x.data?.config?.settings,f=h&&typeof h=="object"?h.testConfig:void 0,d=typeof(h?h.monitorMode??h.testMode:void 0)=="string";let y;t[11]!==f?(y=f??{},t[11]=f,t[12]=y):y=t[12];let g;t[13]!==d||t[14]!==h||t[15]!==f?(g=d&&!f?h:{},t[13]=d,t[14]=h,t[15]=f,t[16]=g):g=t[16];let C;t[17]!==y||t[18]!==g?(C={...ds,...y,...g},t[17]=y,t[18]=g,t[19]=C):C=t[19];const _=C;let v;t[20]!==o||t[21]!==n.id?(v=async k=>{const N=(await ze(o,"PROJECT_PLUGIN_CONFIG_GET",{projectId:n.id,pluginId:et}))?.config?.settings??{};return ze(o,"PROJECT_PLUGIN_CONFIG_UPDATE",{projectId:n.id,pluginId:et,settings:{...N,testConfig:{...ds,...N.testConfig??{},...k}}})},t[20]=o,t[21]=n.id,t[22]=v):v=t[22];let b;t[23]!==n.id||t[24]!==l?(b=async()=>{await l.invalidateQueries({queryKey:G.registryConfigByPlugin(n.id??"",et)})},t[23]=n.id,t[24]=l,t[25]=b):b=t[25];let S;t[26]!==v||t[27]!==b?(S={mutationFn:v,onSuccess:b},t[26]=v,t[27]=b,t[28]=S):S=t[28];const u=Me(S);let j;return t[29]!==x.isLoading||t[30]!==u||t[31]!==_?(j={settings:_,isLoading:x.isLoading,saveMutation:u},t[29]=x.isLoading,t[30]=u,t[31]=_,t[32]=j):j=t[32],j}function qn(){const t=K.c(9),e=Be(),{org:n}=de();let r;t[0]!==n.id?(r={connectionId:be,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=ge(r);let l;t[2]!==o?(l=async c=>ze(o,"REGISTRY_MONITOR_SCHEDULE_SET",c),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:G.registryConfig()})},t[4]=e,t[5]=a):a=t[5];let i;return t[6]!==l||t[7]!==a?(i={mutationFn:l,onSuccess:a},t[6]=l,t[7]=a,t[8]=i):i=t[8],Me(i)}function Fn(){const t=K.c(9),e=Be(),{org:n}=de();let r;t[0]!==n.id?(r={connectionId:be,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=ge(r);let l;t[2]!==o?(l=async c=>ze(o,"REGISTRY_MONITOR_SCHEDULE_CANCEL",{scheduleEventId:c}),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:G.registryConfig()})},t[4]=e,t[5]=a):a=t[5];let i;return t[6]!==l||t[7]!==a?(i={mutationFn:l,onSuccess:a},t[6]=l,t[7]=a,t[8]=i):i=t[8],Me(i)}function Bn(){const t=K.c(3),e=Qt("completed"),n=e.data?.items?.[0]?.id,r=e.data?.items?.[0]?.status,o=Nt(n,"failed",r),l=o.data?.items?.length??0,a=e.isLoading||o.isLoading;let i;return t[0]!==l||t[1]!==a?(i={brokenCount:l,isLoading:a},t[0]=l,t[1]=a,t[2]=i):i=t[2],i}const Gn=24;function Qn(t){return t.trim()}async function Pe(t,e,n){const r=await t.callTool({name:e,arguments:n});if(!r||typeof r!="object")throw new Error(`Invalid tool response for ${e}`);if(r.isError){const o=r.content?.find(l=>l.type==="text")?.text??`Tool ${e} returned an error`;throw new Error(o)}return r.structuredContent??r}function Ls(t){const e=K.c(19),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:be,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=ge(r);let l,a,i,c;e[2]!==t.categories||e[3]!==t.limit||e[4]!==t.search||e[5]!==t.tags?(a=Qn(t.search),l=t.limit??Gn,c=dn,i=G.itemsList(a,t.tags,t.categories,l),e[2]=t.categories,e[3]=t.limit,e[4]=t.search,e[5]=t.tags,e[6]=l,e[7]=a,e[8]=i,e[9]=c):(l=e[6],a=e[7],i=e[8],c=e[9]);let m;e[10]!==o||e[11]!==l||e[12]!==t.categories||e[13]!==t.tags||e[14]!==a?(m=async h=>{const{pageParam:f}=h,p=a.length>0?{operator:"or",conditions:[{field:["title"],operator:"contains",value:a},{field:["description"],operator:"contains",value:a},{field:["id"],operator:"contains",value:a},{field:["server","name"],operator:"contains",value:a}]}:void 0;return Pe(o,"REGISTRY_ITEM_LIST",{cursor:f,limit:l,tags:t.tags.length?t.tags:void 0,categories:t.categories.length?t.categories:void 0,where:p})},e[10]=o,e[11]=l,e[12]=t.categories,e[13]=t.tags,e[14]=a,e[15]=m):m=e[15];let x;return e[16]!==i||e[17]!==m?(x={queryKey:i,queryFn:m,initialPageParam:void 0,getNextPageParam:Kn,staleTime:3e4},e[16]=i,e[17]=m,e[18]=x):x=e[18],c(x)}function Kn(t){return t.nextCursor}function Vn(){const t=K.c(8),{org:e}=de();let n;t[0]!==e.id?(n={connectionId:be,orgId:e.id},t[0]=e.id,t[1]=n):n=t[1];const r=ge(n);let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=G.filters(),t[2]=o):o=t[2];let l;t[3]!==r?(l=async()=>Pe(r,"REGISTRY_ITEM_FILTERS",{}),t[3]=r,t[4]=l):l=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a={tags:[],categories:[]},t[5]=a):a=t[5];let i;return t[6]!==l?(i={queryKey:o,queryFn:l,placeholderData:a,staleTime:6e4},t[6]=l,t[7]=i):i=t[7],Ge(i)}function ns(){const t=K.c(29),e=Be(),{org:n}=de();let r;t[0]!==n.id?(r={connectionId:be,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=ge(r);let l;t[2]!==e?(l=async()=>{await Promise.all([e.invalidateQueries({queryKey:G.items()}),e.invalidateQueries({queryKey:G.filters()})])},t[2]=e,t[3]=l):l=t[3];const a=l;let i;t[4]!==o?(i=async b=>(await Pe(o,"REGISTRY_ITEM_CREATE",{data:b})).item,t[4]=o,t[5]=i):i=t[5];let c;t[6]!==a||t[7]!==i?(c={mutationFn:i,onSuccess:a},t[6]=a,t[7]=i,t[8]=c):c=t[8];const m=Me(c);let x;t[9]!==o?(x=async b=>{const{id:S,data:u}=b;return(await Pe(o,"REGISTRY_ITEM_UPDATE",{id:S,data:u})).item},t[9]=o,t[10]=x):x=t[10];let h;t[11]!==a||t[12]!==x?(h={mutationFn:x,onSuccess:a},t[11]=a,t[12]=x,t[13]=h):h=t[13];const f=Me(h);let p;t[14]!==o?(p=async b=>(await Pe(o,"REGISTRY_ITEM_DELETE",{id:b})).item,t[14]=o,t[15]=p):p=t[15];let d;t[16]!==a||t[17]!==p?(d={mutationFn:p,onSuccess:a},t[16]=a,t[17]=p,t[18]=d):d=t[18];const y=Me(d);let g;t[19]!==o?(g=async b=>Pe(o,"REGISTRY_ITEM_BULK_CREATE",{items:b}),t[19]=o,t[20]=g):g=t[20];let C;t[21]!==a||t[22]!==g?(C={mutationFn:g,onSuccess:a},t[21]=a,t[22]=g,t[23]=C):C=t[23];const _=Me(C);let v;return t[24]!==_||t[25]!==m||t[26]!==y||t[27]!==f?(v={createMutation:m,updateMutation:f,deleteMutation:y,bulkCreateMutation:_},t[24]=_,t[25]=m,t[26]=y,t[27]=f,t[28]=v):v=t[28],v}function Kt(t){const e=K.c(34),{org:n,project:r}=de();let o;e[0]!==n.id?(o={connectionId:be,orgId:n.id},e[0]=n.id,e[1]=o):o=e[1];const l=ge(o),a=Be();let i;e[2]!==t||e[3]!==r.id?(i=G.registryConfigByPlugin(r.id??"",t),e[2]=t,e[3]=r.id,e[4]=i):i=e[4];let c;e[5]!==l||e[6]!==t||e[7]!==r.id?(c=async()=>Pe(l,"PROJECT_PLUGIN_CONFIG_GET",{projectId:r.id,pluginId:t}),e[5]=l,e[6]=t,e[7]=r.id,e[8]=c):c=e[8];const m=!!r.id;let x;e[9]!==i||e[10]!==c||e[11]!==m?(x={queryKey:i,queryFn:c,enabled:m,staleTime:6e4},e[9]=i,e[10]=c,e[11]=m,e[12]=x):x=e[12];const h=Ge(x);let f;e[13]!==l||e[14]!==t||e[15]!==r.id?(f=async k=>{const N=(await Pe(l,"PROJECT_PLUGIN_CONFIG_GET",{projectId:r.id,pluginId:t}))?.config?.settings??{};return Pe(l,"PROJECT_PLUGIN_CONFIG_UPDATE",{projectId:r.id,pluginId:t,settings:{...N,...k}})},e[13]=l,e[14]=t,e[15]=r.id,e[16]=f):f=e[16];let p;e[17]!==t||e[18]!==r.id||e[19]!==a?(p=async()=>{await a.invalidateQueries({queryKey:G.registryConfigByPlugin(r.id??"",t)})},e[17]=t,e[18]=r.id,e[19]=a,e[20]=p):p=e[20];let d;e[21]!==f||e[22]!==p?(d={mutationFn:f,onSuccess:p},e[21]=f,e[22]=p,e[23]=d):d=e[23];const y=Me(d),g=h.data?.config?.settings?.registryName??"Private Registry",C=h.data?.config?.settings?.registryIcon??"",_=h.data?.config?.settings?.llmConnectionId??"",v=h.data?.config?.settings?.llmModelId??"",b=h.data?.config?.settings?.acceptPublishRequests??!1,S=h.data?.config?.settings?.requireApiToken??!1,u=h.data?.config?.settings?.storePrivateOnly??!1;let j;return e[24]!==b||e[25]!==h.isLoading||e[26]!==C||e[27]!==_||e[28]!==v||e[29]!==g||e[30]!==S||e[31]!==y||e[32]!==u?(j={registryName:g,registryIcon:C,registryLLMConnectionId:_,registryLLMModelId:v,acceptPublishRequests:b,requireApiToken:S,storePrivateOnly:u,isLoadingConfig:h.isLoading,saveRegistryConfigMutation:y},e[24]=b,e[25]=h.isLoading,e[26]=C,e[27]=_,e[28]=v,e[29]=g,e[30]=S,e[31]=y,e[32]=u,e[33]=j):j=e[33],j}function Yn(t){const e=K.c(11),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:be,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=ge(r);let l;e[2]!==n.id||e[3]!==t?(l=G.publishRequestsListByOrg(n.id,t),e[2]=n.id,e[3]=t,e[4]=l):l=e[4];let a;e[5]!==o||e[6]!==t?(a=async()=>Pe(o,"REGISTRY_PUBLISH_REQUEST_LIST",{status:t}),e[5]=o,e[6]=t,e[7]=a):a=e[7];let i;return e[8]!==l||e[9]!==a?(i={queryKey:l,queryFn:a,staleTime:3e4,refetchOnMount:!0},e[8]=l,e[9]=a,e[10]=i):i=e[10],Ge(i)}function Hn(){const t=K.c(9),{org:e}=de();let n;t[0]!==e.id?(n={connectionId:be,orgId:e.id},t[0]=e.id,t[1]=n):n=t[1];const r=ge(n);let o;t[2]!==e.id?(o=G.publishRequestsCountByOrg(e.id),t[2]=e.id,t[3]=o):o=t[3];let l;t[4]!==r?(l=async()=>Pe(r,"REGISTRY_PUBLISH_REQUEST_COUNT",{}),t[4]=r,t[5]=l):l=t[5];let a;return t[6]!==o||t[7]!==l?(a={queryKey:o,queryFn:l,staleTime:3e4},t[6]=o,t[7]=l,t[8]=a):a=t[8],Ge(a)}function Wn(){const t=K.c(17),e=Be(),{org:n}=de();let r;t[0]!==n.id?(r={connectionId:be,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=ge(r);let l;t[2]!==e?(l=async()=>{await Promise.all([e.invalidateQueries({queryKey:G.publishRequests()})])},t[2]=e,t[3]=l):l=t[3];const a=l;let i;t[4]!==o?(i=async d=>Pe(o,"REGISTRY_PUBLISH_REQUEST_REVIEW",d),t[4]=o,t[5]=i):i=t[5];let c;t[6]!==a||t[7]!==i?(c={mutationFn:i,onSuccess:a},t[6]=a,t[7]=i,t[8]=c):c=t[8];const m=Me(c);let x;t[9]!==o?(x=async d=>Pe(o,"REGISTRY_PUBLISH_REQUEST_DELETE",{id:d}),t[9]=o,t[10]=x):x=t[10];let h;t[11]!==a||t[12]!==x?(h={mutationFn:x,onSuccess:a},t[11]=a,t[12]=x,t[13]=h):h=t[13];const f=Me(h);let p;return t[14]!==f||t[15]!==m?(p={reviewMutation:m,deleteMutation:f},t[14]=f,t[15]=m,t[16]=p):p=t[16],p}function Jn(){const t=K.c(5),{org:e}=de();let n;t[0]!==e.id?(n={connectionId:be,orgId:e.id},t[0]=e.id,t[1]=n):n=t[1];const r=ge(n);let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=G.publishApiKeys(),t[2]=o):o=t[2];let l;return t[3]!==r?(l={queryKey:o,queryFn:async()=>Pe(r,"REGISTRY_PUBLISH_API_KEY_LIST",{}),staleTime:3e4},t[3]=r,t[4]=l):l=t[4],Ge(l)}function Zn(){const t=K.c(19),e=Be(),{org:n}=de();let r;t[0]!==n.id?(r={connectionId:be,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=ge(r);let l;t[2]!==o?(l=async d=>Pe(o,"REGISTRY_PUBLISH_API_KEY_GENERATE",{name:d}),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:G.publishApiKeys()})},t[4]=e,t[5]=a):a=t[5];let i;t[6]!==l||t[7]!==a?(i={mutationFn:l,onSuccess:a},t[6]=l,t[7]=a,t[8]=i):i=t[8];const c=Me(i);let m;t[9]!==o?(m=async d=>Pe(o,"REGISTRY_PUBLISH_API_KEY_REVOKE",{keyId:d}),t[9]=o,t[10]=m):m=t[10];let x;t[11]!==e?(x=async()=>{await e.invalidateQueries({queryKey:G.publishApiKeys()})},t[11]=e,t[12]=x):x=t[12];let h;t[13]!==m||t[14]!==x?(h={mutationFn:m,onSuccess:x},t[13]=m,t[14]=x,t[15]=h):h=t[15];const f=Me(h);let p;return t[16]!==c||t[17]!==f?(p={generateMutation:c,revokeMutation:f},t[16]=c,t[17]=f,t[18]=p):p=t[18],p}function ms(t){return t?t.split(/[;|]/).map(e=>e.trim()).filter(Boolean):[]}function us(t){const e=[];let n="",r=!1;for(let o=0;o<t.length;o+=1){const l=t[o],a=t[o+1];if(l==='"'){r&&a==='"'?(n+='"',o+=1):r=!r;continue}if(l===","&&!r){e.push(n.trim()),n="";continue}n+=l}return e.push(n.trim()),e}const Xn=["id","title"],er=["id","title","description","remote_url","remote_type","tags","categories","is_public"];function tr(t){const e=t.split(/\r?\n/).map(m=>m.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 n=us(e[0]??""),r=new Map,o=[];n.forEach((m,x)=>{const h=m.toLowerCase().trim();h&&r.set(h,x)});for(const m of Xn)r.has(m)||o.push({line:1,message:`Missing required column: "${m}"`});for(const m of n){const x=m.toLowerCase().trim();x&&!er.includes(x)&&o.push({line:1,message:`Unknown column "${m}" will be ignored`})}if(!r.has("id")||!r.has("title"))return{items:[],warnings:o,skipped:0};const l=(m,x)=>{const h=r.get(x);return typeof h=="number"?m[h]??"":""},a=[],i=new Set;let c=0;for(let m=1;m<e.length;m+=1){const x=us(e[m]??""),h=l(x,"id").trim(),f=l(x,"title").trim();if(!h){o.push({line:m+1,message:"Missing id — row skipped"}),c+=1;continue}if(!f){o.push({line:m+1,message:`Missing title for id="${h}" — row skipped`}),c+=1;continue}if(i.has(h)){o.push({line:m+1,message:`Duplicate id="${h}" — row skipped`}),c+=1;continue}i.add(h);const p=l(x,"description").trim(),d=l(x,"remote_url").trim(),g=l(x,"remote_type").trim().toLowerCase()==="sse"?"sse":"http",C=ms(l(x,"tags")),_=ms(l(x,"categories")),v=l(x,"is_public").trim().toLowerCase(),b=v==="true"||v==="1"||v==="yes";a.push({id:h,title:f,description:p||null,is_public:b,_meta:{"mcp.mesh":{...C.length>0?{tags:C}:{},..._.length>0?{categories:_}:{}}},server:{name:h,title:f,description:p||void 0,remotes:d?[{type:g,url:d}]:[]}})}return{items:a,warnings:o,skipped:c}}const sr=`id,title,description,remote_url,remote_type,tags,categories,is_public
1
+ import{r as M,c as K,u as de,z as Be,bz as et,j as s,t as W,bD as an}from"./index-DXIsw0zh.js";import{B as F,c as J}from"./button-B1_AjrAy.js";import{i as bt}from"./CheckCircle-DaStCoYU.js";import{n as on}from"./Container-DZaD5nKa.js";import{t as cn}from"./Settings01-DZTt6EoC.js";import{u as Ge}from"./useQuery-BB1xkDqD.js";import{u as Me}from"./useMutation-B0HsJHYQ.js";import{a as be,u as ge,j as gs}from"./constants-D3TKhQyR.js";import{u as dn}from"./useInfiniteQuery-1kxc2B4E.js";import{B as U}from"./badge-D7RdE5x4.js";import{I as ye}from"./input-CBsHg1ZU.js";import{a as kt,c as We,D as St,b as Rt,h as ls,i as as,g as mn}from"./dropdown-menu-Bqe_ZQT7.js";import{e as js,a as ys,b as Tt,T as Ae,d as bs,c as Le}from"./table-D_QygT6-.js";import{a as os,T as un}from"./toggle-group-BMOUBfIJ.js";import{u as xn}from"./use-view-mode-BBke-t6c.js";import{i as Xt}from"./DotsVertical-BRM5SG1z.js";import{i as hn}from"./FilterLines-PVC9VLDF.js";import{i as vs}from"./Globe01-7CpfXn5N.js";import{i as mt}from"./Loading01-CQxnYIyy.js";import{i as Ns}from"./SearchMd-CJBYDik4.js";import{b as It,c as Mt,d as Pt,e as Et,a as Dt,D as $t}from"./dialog-BIx4eChJ.js";import{i as jt}from"./AlertCircle-54XkBG75.js";import{n as pn}from"./Download01-C-bkrJJ_.js";import{i as cs}from"./Upload01-CbgKMs6Z.js";import{c as Lt,b as zt,d as Ot,A as Ut,g as qt,e as Ft,a as Bt,f as Gt}from"./alert-dialog-DeTFKcxV.js";import{C as ne}from"./card-CuDdPQFh.js";import{s as vt}from"./Trash01-DTuEjPqc.js";import{L as ie}from"./label-BAn78i4V.js";import{n as fn,S as ws,a as Cs,b as _s,c as ks,d as Ct}from"./select-Dtkbt4-O.js";import{S as _t}from"./switch-RGSyl6UC.js";import{T as At}from"./textarea-Bs1SDhbD.js";import{i as gn}from"./ArrowLeft-CYxjro91.js";import{i as jn,u as Ht,t as yn}from"./use-copy-B35KQJbq.js";import{s as es}from"./RefreshCcw01-DH9n4JeZ.js";import{i as bn}from"./X-PXGrxqUi.js";import{t as Ss}from"./ChevronDown-DIu5de-X.js";import{s as Rs}from"./Eye-Ci58n8nv.js";import{n as vn}from"./LinkExternal01-C6wGiaKd.js";import{i as Nn}from"./XCircle-DkU1KZH1.js";import{h as Ts,e as Is}from"./use-connection-BQuQwDk4.js";import{b as wn,P as Cn,a as _n}from"./popover-Bb6R9icK.js";import{i as Wt}from"./Check-BHtow5c6.js";import{a as Jt}from"./Copy01-qW8IV1YX.js";import{i as kn,a as Sn}from"./Save01-DYGYdg7I.js";import{i as Rn}from"./Key01-ZjbbdeBE.js";import{s as Tn}from"./Plus-ldykr1Qs.js";import{a as In,b as Mn,T as Pn}from"./tooltip-Dp5lhZb-.js";import{a as En,i as Dn}from"./mcp-oauth-CZMbNN44.js";import{i as $n}from"./Play-CCFAjpE1.js";import"./infiniteQueryObserver-BEZRxvfD.js";import"./ChevronRight-Ds0FvHp6.js";import"./use-mobile-DIAoFlrU.js";import"./index-DGQeUY5q.js";const Ms=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M10.743 5.092C11.149 5.032 11.569 5 12 5c5.105 0 8.455 4.505 9.58 6.287.137.215.205.323.243.49a1.16 1.16 0 0 1 0 .447c-.038.166-.107.274-.244.492-.3.474-.757 1.141-1.363 1.865M6.724 6.715c-2.162 1.467-3.63 3.504-4.303 4.57-.137.217-.205.325-.243.492a1.173 1.173 0 0 0 0 .446c.038.167.106.274.242.49C3.546 14.495 6.895 19 12 19c2.059 0 3.832-.732 5.289-1.723M3 3l18 18M9.88 9.879a3 3 0 1 0 4.243 4.243"}));Ms.displayName="EyeOff";const Ps=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M12.5 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H17c.93 0 1.395 0 1.776-.102a3 3 0 0 0 2.122-2.122C21 18.395 21 17.93 21 17m-2-9V2m-3 3h6M10.5 8.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm4.49 3.418-8.459 7.69c-.476.433-.714.649-.735.836a.5.5 0 0 0 .167.431C6.105 21 6.426 21 7.07 21h9.387c1.44 0 2.159 0 2.724-.242a3 3 0 0 0 1.578-1.578c.242-.565.242-1.285.242-2.724 0-.484 0-.726-.053-.952a2.001 2.001 0 0 0-.374-.778c-.143-.182-.332-.333-.71-.636l-2.797-2.237c-.379-.303-.568-.454-.776-.508a1 1 0 0 0-.557.018c-.205.066-.384.23-.743.555Z"}));Ps.displayName="ImagePlus";const Es=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"m12.708 18.364-1.415 1.414a5 5 0 1 1-7.07-7.07l1.413-1.415m12.728 1.414 1.415-1.414a5 5 0 0 0-7.071-7.071l-1.415 1.414M8.5 15.5l7-7"}));Es.displayName="Link01";const Ds=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}),M.createElement("path",{d:"M8 9.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C8.76 8 9.04 8 9.6 8h4.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C16 8.76 16 9.04 16 9.6v4.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C15.24 16 14.96 16 14.4 16H9.6c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C8 15.24 8 14.96 8 14.4V9.6Z"}));Ds.displayName="StopSquare";const ts=({size:t=24,color:e="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"m6 6 4.5 4.5M6 6H3L2 3l1-1 3 1v3Zm13.259-3.259-2.628 2.628c-.396.396-.594.594-.668.822a1 1 0 0 0 0 .618c.074.228.272.426.668.822l.238.238c.396.396.594.594.822.668a1 1 0 0 0 .618 0c.228-.074.426-.272.822-.668L21.59 5.41a5.5 5.5 0 0 1-6.16 7.485c-.485-.096-.729-.144-.876-.13a.836.836 0 0 0-.373.114c-.13.07-.261.201-.523.463L6.5 20.5a2.121 2.121 0 0 1-3-3l7.157-7.157c.262-.262.393-.393.463-.524a.836.836 0 0 0 .113-.372c.015-.148-.033-.39-.129-.877a5.5 5.5 0 0 1 8.155-5.83ZM12 15l5.5 5.5a2.121 2.121 0 0 0 3-3l-4.525-4.525a5.475 5.475 0 0 1-.934-.17c-.39-.107-.816-.03-1.101.255L12 15Z"}));ts.displayName="Tool02";const G={all:["private-registry"],items:()=>[...G.all,"items"],itemsList:(t,e,n,r)=>[...G.items(),"list",{search:t,tags:e,categories:n,limit:r}],item:t=>[...G.items(),"item",t],filters:()=>[...G.all,"filters"],registryConfig:()=>[...G.all,"registry-config"],registryConfigByPlugin:(t,e)=>[...G.registryConfig(),t,e],publishRequests:()=>[...G.all,"publish-requests"],publishRequestsByOrg:t=>[...G.publishRequests(),"org",t],publishRequestsList:t=>[...G.publishRequests(),"list",{status:t??"all"}],publishRequestsListByOrg:(t,e)=>[...G.publishRequestsByOrg(t),"list",{status:e??"all"}],publishRequestsCount:()=>[...G.publishRequests(),"count"],publishRequestsCountByOrg:t=>[...G.publishRequestsByOrg(t),"count"],publishApiKeys:()=>[...G.all,"publish-api-keys"],monitor:()=>[...G.all,"monitor"],monitorRuns:()=>[...G.monitor(),"runs"],monitorRunsList:t=>[...G.monitorRuns(),"list",{status:t??"all"}],monitorRun:t=>[...G.monitorRuns(),"run",t??"none"],monitorResults:()=>[...G.monitor(),"results"],monitorResultsList:(t,e)=>[...G.monitorResults(),"list",{runId:t??"none",status:e??"all"}],monitorConnections:()=>[...G.monitor(),"connections"],monitorConnectionAuthProbe:t=>[...G.monitorConnections(),"auth-probe",t]};async function ze(t,e,n){const r=await t.callTool({name:e,arguments:n});if(!r||typeof r!="object")throw new Error(`Invalid tool response for ${e}`);if(r.isError){const o=r.content?.find(l=>l.type==="text")?.text??`Tool ${e} returned an error`;throw new Error(o)}return r.structuredContent??r}function An(){const t=K.c(9),e=Be(),{org:n}=de();let r;t[0]!==n.id?(r={connectionId:be,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=ge(r);let l;t[2]!==o?(l=async c=>ze(o,"REGISTRY_MONITOR_RUN_START",{config:c}),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e?(a=async()=>{await Promise.all([e.invalidateQueries({queryKey:G.monitorRuns()}),e.invalidateQueries({queryKey:G.monitorResults()})])},t[4]=e,t[5]=a):a=t[5];let i;return t[6]!==l||t[7]!==a?(i={mutationFn:l,onSuccess:a},t[6]=l,t[7]=a,t[8]=i):i=t[8],Me(i)}function Ln(){const t=K.c(9),e=Be(),{org:n}=de();let r;t[0]!==n.id?(r={connectionId:be,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=ge(r);let l;t[2]!==o?(l=async c=>ze(o,"REGISTRY_MONITOR_RUN_CANCEL",{runId:c}),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e?(a=async(c,m)=>{await Promise.all([e.invalidateQueries({queryKey:G.monitorRuns()}),e.invalidateQueries({queryKey:G.monitorRun(m)})])},t[4]=e,t[5]=a):a=t[5];let i;return t[6]!==l||t[7]!==a?(i={mutationFn:l,onSuccess:a},t[6]=l,t[7]=a,t[8]=i):i=t[8],Me(i)}function Qt(t){const e=K.c(10),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:be,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=ge(r);let l;e[2]!==t?(l=G.monitorRunsList(t),e[2]=t,e[3]=l):l=e[3];let a;e[4]!==o||e[5]!==t?(a=async()=>ze(o,"REGISTRY_MONITOR_RUN_LIST",{status:t,limit:100}),e[4]=o,e[5]=t,e[6]=a):a=e[6];let i;return e[7]!==l||e[8]!==a?(i={queryKey:l,queryFn:a,staleTime:5e3},e[7]=l,e[8]=a,e[9]=i):i=e[9],Ge(i)}function ss(t){const e=K.c(11),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:be,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=ge(r);let l;e[2]!==t?(l=G.monitorRun(t),e[2]=t,e[3]=l):l=e[3];let a;e[4]!==o||e[5]!==t?(a=async()=>ze(o,"REGISTRY_MONITOR_RUN_GET",{runId:t}),e[4]=o,e[5]=t,e[6]=a):a=e[6];const i=!!t;let c;return e[7]!==l||e[8]!==a||e[9]!==i?(c={queryKey:l,queryFn:a,enabled:i,refetchInterval:zn},e[7]=l,e[8]=a,e[9]=i,e[10]=c):c=e[10],Ge(c)}function zn(t){return t.state.data?.run?.status==="running"?5e3:!1}function Nt(t,e,n){const r=K.c(14),{org:o}=de();let l;r[0]!==o.id?(l={connectionId:be,orgId:o.id},r[0]=o.id,r[1]=l):l=r[1];const a=ge(l);let i;r[2]!==t||r[3]!==e?(i=G.monitorResultsList(t,e),r[2]=t,r[3]=e,r[4]=i):i=r[4];let c;r[5]!==a||r[6]!==t||r[7]!==e?(c=async()=>ze(a,"REGISTRY_MONITOR_RESULT_LIST",{runId:t,status:e,limit:200,offset:0}),r[5]=a,r[6]=t,r[7]=e,r[8]=c):c=r[8];const m=!!t,x=n==="running"?2500:!1;let h;return r[9]!==i||r[10]!==c||r[11]!==m||r[12]!==x?(h={queryKey:i,queryFn:c,enabled:m,staleTime:5e3,refetchInterval:x},r[9]=i,r[10]=c,r[11]=m,r[12]=x,r[13]=h):h=r[13],Ge(h)}function $s(){const t=K.c(5),{org:e}=de();let n;t[0]!==e.id?(n={connectionId:be,orgId:e.id},t[0]=e.id,t[1]=n):n=t[1];const r=ge(n);let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=G.monitorConnections(),t[2]=o):o=t[2];let l;return t[3]!==r?(l={queryKey:o,queryFn:async()=>ze(r,"REGISTRY_MONITOR_CONNECTION_LIST",{}),staleTime:1e4},t[3]=r,t[4]=l):l=t[4],Ge(l)}function On(){const t=K.c(9),e=Be(),{org:n}=de();let r;t[0]!==n.id?(r={connectionId:be,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=ge(r);let l;t[2]!==o?(l=async()=>ze(o,"REGISTRY_MONITOR_CONNECTION_SYNC",{}),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:G.monitorConnections()})},t[4]=e,t[5]=a):a=t[5];let i;return t[6]!==l||t[7]!==a?(i={mutationFn:l,onSuccess:a},t[6]=l,t[7]=a,t[8]=i):i=t[8],Me(i)}function Un(){const t=K.c(9),e=Be(),{org:n}=de();let r;t[0]!==n.id?(r={connectionId:be,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=ge(r);let l;t[2]!==o?(l=async c=>{const{connectionId:m,authStatus:x}=c;return ze(o,"REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH",{connectionId:m,authStatus:x})},t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:G.monitorConnections()})},t[4]=e,t[5]=a):a=t[5];let i;return t[6]!==l||t[7]!==a?(i={mutationFn:l,onSuccess:a},t[6]=l,t[7]=a,t[8]=i):i=t[8],Me(i)}const ds={monitorMode:"health_check",onFailure:"none",schedule:"manual",cronExpression:"",scheduleEventId:"",perMcpTimeoutMs:3e4,perToolTimeoutMs:1e4,maxAgentSteps:15,testPublicOnly:!1,testPrivateOnly:!1,includePendingRequests:!1,agentContext:"",llmConnectionId:"",llmModelId:""};function As(){const t=K.c(33),{org:e,project:n}=de();let r;t[0]!==e.id?(r={connectionId:be,orgId:e.id},t[0]=e.id,t[1]=r):r=t[1];const o=ge(r),l=Be();let a;t[2]!==n.id?(a=G.registryConfigByPlugin(n.id??"",et),t[2]=n.id,t[3]=a):a=t[3];let i;t[4]!==o||t[5]!==n.id?(i=async()=>ze(o,"PROJECT_PLUGIN_CONFIG_GET",{projectId:n.id,pluginId:et}),t[4]=o,t[5]=n.id,t[6]=i):i=t[6];const c=!!n.id;let m;t[7]!==a||t[8]!==i||t[9]!==c?(m={queryKey:a,queryFn:i,enabled:c},t[7]=a,t[8]=i,t[9]=c,t[10]=m):m=t[10];const x=Ge(m),h=x.data?.config?.settings,f=h&&typeof h=="object"?h.testConfig:void 0,d=typeof(h?h.monitorMode??h.testMode:void 0)=="string";let y;t[11]!==f?(y=f??{},t[11]=f,t[12]=y):y=t[12];let g;t[13]!==d||t[14]!==h||t[15]!==f?(g=d&&!f?h:{},t[13]=d,t[14]=h,t[15]=f,t[16]=g):g=t[16];let C;t[17]!==y||t[18]!==g?(C={...ds,...y,...g},t[17]=y,t[18]=g,t[19]=C):C=t[19];const _=C;let v;t[20]!==o||t[21]!==n.id?(v=async k=>{const N=(await ze(o,"PROJECT_PLUGIN_CONFIG_GET",{projectId:n.id,pluginId:et}))?.config?.settings??{};return ze(o,"PROJECT_PLUGIN_CONFIG_UPDATE",{projectId:n.id,pluginId:et,settings:{...N,testConfig:{...ds,...N.testConfig??{},...k}}})},t[20]=o,t[21]=n.id,t[22]=v):v=t[22];let b;t[23]!==n.id||t[24]!==l?(b=async()=>{await l.invalidateQueries({queryKey:G.registryConfigByPlugin(n.id??"",et)})},t[23]=n.id,t[24]=l,t[25]=b):b=t[25];let S;t[26]!==v||t[27]!==b?(S={mutationFn:v,onSuccess:b},t[26]=v,t[27]=b,t[28]=S):S=t[28];const u=Me(S);let j;return t[29]!==x.isLoading||t[30]!==u||t[31]!==_?(j={settings:_,isLoading:x.isLoading,saveMutation:u},t[29]=x.isLoading,t[30]=u,t[31]=_,t[32]=j):j=t[32],j}function qn(){const t=K.c(9),e=Be(),{org:n}=de();let r;t[0]!==n.id?(r={connectionId:be,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=ge(r);let l;t[2]!==o?(l=async c=>ze(o,"REGISTRY_MONITOR_SCHEDULE_SET",c),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:G.registryConfig()})},t[4]=e,t[5]=a):a=t[5];let i;return t[6]!==l||t[7]!==a?(i={mutationFn:l,onSuccess:a},t[6]=l,t[7]=a,t[8]=i):i=t[8],Me(i)}function Fn(){const t=K.c(9),e=Be(),{org:n}=de();let r;t[0]!==n.id?(r={connectionId:be,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=ge(r);let l;t[2]!==o?(l=async c=>ze(o,"REGISTRY_MONITOR_SCHEDULE_CANCEL",{scheduleEventId:c}),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:G.registryConfig()})},t[4]=e,t[5]=a):a=t[5];let i;return t[6]!==l||t[7]!==a?(i={mutationFn:l,onSuccess:a},t[6]=l,t[7]=a,t[8]=i):i=t[8],Me(i)}function Bn(){const t=K.c(3),e=Qt("completed"),n=e.data?.items?.[0]?.id,r=e.data?.items?.[0]?.status,o=Nt(n,"failed",r),l=o.data?.items?.length??0,a=e.isLoading||o.isLoading;let i;return t[0]!==l||t[1]!==a?(i={brokenCount:l,isLoading:a},t[0]=l,t[1]=a,t[2]=i):i=t[2],i}const Gn=24;function Qn(t){return t.trim()}async function Pe(t,e,n){const r=await t.callTool({name:e,arguments:n});if(!r||typeof r!="object")throw new Error(`Invalid tool response for ${e}`);if(r.isError){const o=r.content?.find(l=>l.type==="text")?.text??`Tool ${e} returned an error`;throw new Error(o)}return r.structuredContent??r}function Ls(t){const e=K.c(19),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:be,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=ge(r);let l,a,i,c;e[2]!==t.categories||e[3]!==t.limit||e[4]!==t.search||e[5]!==t.tags?(a=Qn(t.search),l=t.limit??Gn,c=dn,i=G.itemsList(a,t.tags,t.categories,l),e[2]=t.categories,e[3]=t.limit,e[4]=t.search,e[5]=t.tags,e[6]=l,e[7]=a,e[8]=i,e[9]=c):(l=e[6],a=e[7],i=e[8],c=e[9]);let m;e[10]!==o||e[11]!==l||e[12]!==t.categories||e[13]!==t.tags||e[14]!==a?(m=async h=>{const{pageParam:f}=h,p=a.length>0?{operator:"or",conditions:[{field:["title"],operator:"contains",value:a},{field:["description"],operator:"contains",value:a},{field:["id"],operator:"contains",value:a},{field:["server","name"],operator:"contains",value:a}]}:void 0;return Pe(o,"REGISTRY_ITEM_LIST",{cursor:f,limit:l,tags:t.tags.length?t.tags:void 0,categories:t.categories.length?t.categories:void 0,where:p})},e[10]=o,e[11]=l,e[12]=t.categories,e[13]=t.tags,e[14]=a,e[15]=m):m=e[15];let x;return e[16]!==i||e[17]!==m?(x={queryKey:i,queryFn:m,initialPageParam:void 0,getNextPageParam:Kn,staleTime:3e4},e[16]=i,e[17]=m,e[18]=x):x=e[18],c(x)}function Kn(t){return t.nextCursor}function Vn(){const t=K.c(8),{org:e}=de();let n;t[0]!==e.id?(n={connectionId:be,orgId:e.id},t[0]=e.id,t[1]=n):n=t[1];const r=ge(n);let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=G.filters(),t[2]=o):o=t[2];let l;t[3]!==r?(l=async()=>Pe(r,"REGISTRY_ITEM_FILTERS",{}),t[3]=r,t[4]=l):l=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a={tags:[],categories:[]},t[5]=a):a=t[5];let i;return t[6]!==l?(i={queryKey:o,queryFn:l,placeholderData:a,staleTime:6e4},t[6]=l,t[7]=i):i=t[7],Ge(i)}function ns(){const t=K.c(29),e=Be(),{org:n}=de();let r;t[0]!==n.id?(r={connectionId:be,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=ge(r);let l;t[2]!==e?(l=async()=>{await Promise.all([e.invalidateQueries({queryKey:G.items()}),e.invalidateQueries({queryKey:G.filters()})])},t[2]=e,t[3]=l):l=t[3];const a=l;let i;t[4]!==o?(i=async b=>(await Pe(o,"REGISTRY_ITEM_CREATE",{data:b})).item,t[4]=o,t[5]=i):i=t[5];let c;t[6]!==a||t[7]!==i?(c={mutationFn:i,onSuccess:a},t[6]=a,t[7]=i,t[8]=c):c=t[8];const m=Me(c);let x;t[9]!==o?(x=async b=>{const{id:S,data:u}=b;return(await Pe(o,"REGISTRY_ITEM_UPDATE",{id:S,data:u})).item},t[9]=o,t[10]=x):x=t[10];let h;t[11]!==a||t[12]!==x?(h={mutationFn:x,onSuccess:a},t[11]=a,t[12]=x,t[13]=h):h=t[13];const f=Me(h);let p;t[14]!==o?(p=async b=>(await Pe(o,"REGISTRY_ITEM_DELETE",{id:b})).item,t[14]=o,t[15]=p):p=t[15];let d;t[16]!==a||t[17]!==p?(d={mutationFn:p,onSuccess:a},t[16]=a,t[17]=p,t[18]=d):d=t[18];const y=Me(d);let g;t[19]!==o?(g=async b=>Pe(o,"REGISTRY_ITEM_BULK_CREATE",{items:b}),t[19]=o,t[20]=g):g=t[20];let C;t[21]!==a||t[22]!==g?(C={mutationFn:g,onSuccess:a},t[21]=a,t[22]=g,t[23]=C):C=t[23];const _=Me(C);let v;return t[24]!==_||t[25]!==m||t[26]!==y||t[27]!==f?(v={createMutation:m,updateMutation:f,deleteMutation:y,bulkCreateMutation:_},t[24]=_,t[25]=m,t[26]=y,t[27]=f,t[28]=v):v=t[28],v}function Kt(t){const e=K.c(34),{org:n,project:r}=de();let o;e[0]!==n.id?(o={connectionId:be,orgId:n.id},e[0]=n.id,e[1]=o):o=e[1];const l=ge(o),a=Be();let i;e[2]!==t||e[3]!==r.id?(i=G.registryConfigByPlugin(r.id??"",t),e[2]=t,e[3]=r.id,e[4]=i):i=e[4];let c;e[5]!==l||e[6]!==t||e[7]!==r.id?(c=async()=>Pe(l,"PROJECT_PLUGIN_CONFIG_GET",{projectId:r.id,pluginId:t}),e[5]=l,e[6]=t,e[7]=r.id,e[8]=c):c=e[8];const m=!!r.id;let x;e[9]!==i||e[10]!==c||e[11]!==m?(x={queryKey:i,queryFn:c,enabled:m,staleTime:6e4},e[9]=i,e[10]=c,e[11]=m,e[12]=x):x=e[12];const h=Ge(x);let f;e[13]!==l||e[14]!==t||e[15]!==r.id?(f=async k=>{const N=(await Pe(l,"PROJECT_PLUGIN_CONFIG_GET",{projectId:r.id,pluginId:t}))?.config?.settings??{};return Pe(l,"PROJECT_PLUGIN_CONFIG_UPDATE",{projectId:r.id,pluginId:t,settings:{...N,...k}})},e[13]=l,e[14]=t,e[15]=r.id,e[16]=f):f=e[16];let p;e[17]!==t||e[18]!==r.id||e[19]!==a?(p=async()=>{await a.invalidateQueries({queryKey:G.registryConfigByPlugin(r.id??"",t)})},e[17]=t,e[18]=r.id,e[19]=a,e[20]=p):p=e[20];let d;e[21]!==f||e[22]!==p?(d={mutationFn:f,onSuccess:p},e[21]=f,e[22]=p,e[23]=d):d=e[23];const y=Me(d),g=h.data?.config?.settings?.registryName??"Private Registry",C=h.data?.config?.settings?.registryIcon??"",_=h.data?.config?.settings?.llmConnectionId??"",v=h.data?.config?.settings?.llmModelId??"",b=h.data?.config?.settings?.acceptPublishRequests??!1,S=h.data?.config?.settings?.requireApiToken??!1,u=h.data?.config?.settings?.storePrivateOnly??!1;let j;return e[24]!==b||e[25]!==h.isLoading||e[26]!==C||e[27]!==_||e[28]!==v||e[29]!==g||e[30]!==S||e[31]!==y||e[32]!==u?(j={registryName:g,registryIcon:C,registryLLMConnectionId:_,registryLLMModelId:v,acceptPublishRequests:b,requireApiToken:S,storePrivateOnly:u,isLoadingConfig:h.isLoading,saveRegistryConfigMutation:y},e[24]=b,e[25]=h.isLoading,e[26]=C,e[27]=_,e[28]=v,e[29]=g,e[30]=S,e[31]=y,e[32]=u,e[33]=j):j=e[33],j}function Yn(t){const e=K.c(11),{org:n}=de();let r;e[0]!==n.id?(r={connectionId:be,orgId:n.id},e[0]=n.id,e[1]=r):r=e[1];const o=ge(r);let l;e[2]!==n.id||e[3]!==t?(l=G.publishRequestsListByOrg(n.id,t),e[2]=n.id,e[3]=t,e[4]=l):l=e[4];let a;e[5]!==o||e[6]!==t?(a=async()=>Pe(o,"REGISTRY_PUBLISH_REQUEST_LIST",{status:t}),e[5]=o,e[6]=t,e[7]=a):a=e[7];let i;return e[8]!==l||e[9]!==a?(i={queryKey:l,queryFn:a,staleTime:3e4,refetchOnMount:!0},e[8]=l,e[9]=a,e[10]=i):i=e[10],Ge(i)}function Hn(){const t=K.c(9),{org:e}=de();let n;t[0]!==e.id?(n={connectionId:be,orgId:e.id},t[0]=e.id,t[1]=n):n=t[1];const r=ge(n);let o;t[2]!==e.id?(o=G.publishRequestsCountByOrg(e.id),t[2]=e.id,t[3]=o):o=t[3];let l;t[4]!==r?(l=async()=>Pe(r,"REGISTRY_PUBLISH_REQUEST_COUNT",{}),t[4]=r,t[5]=l):l=t[5];let a;return t[6]!==o||t[7]!==l?(a={queryKey:o,queryFn:l,staleTime:3e4},t[6]=o,t[7]=l,t[8]=a):a=t[8],Ge(a)}function Wn(){const t=K.c(17),e=Be(),{org:n}=de();let r;t[0]!==n.id?(r={connectionId:be,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=ge(r);let l;t[2]!==e?(l=async()=>{await Promise.all([e.invalidateQueries({queryKey:G.publishRequests()})])},t[2]=e,t[3]=l):l=t[3];const a=l;let i;t[4]!==o?(i=async d=>Pe(o,"REGISTRY_PUBLISH_REQUEST_REVIEW",d),t[4]=o,t[5]=i):i=t[5];let c;t[6]!==a||t[7]!==i?(c={mutationFn:i,onSuccess:a},t[6]=a,t[7]=i,t[8]=c):c=t[8];const m=Me(c);let x;t[9]!==o?(x=async d=>Pe(o,"REGISTRY_PUBLISH_REQUEST_DELETE",{id:d}),t[9]=o,t[10]=x):x=t[10];let h;t[11]!==a||t[12]!==x?(h={mutationFn:x,onSuccess:a},t[11]=a,t[12]=x,t[13]=h):h=t[13];const f=Me(h);let p;return t[14]!==f||t[15]!==m?(p={reviewMutation:m,deleteMutation:f},t[14]=f,t[15]=m,t[16]=p):p=t[16],p}function Jn(){const t=K.c(5),{org:e}=de();let n;t[0]!==e.id?(n={connectionId:be,orgId:e.id},t[0]=e.id,t[1]=n):n=t[1];const r=ge(n);let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=G.publishApiKeys(),t[2]=o):o=t[2];let l;return t[3]!==r?(l={queryKey:o,queryFn:async()=>Pe(r,"REGISTRY_PUBLISH_API_KEY_LIST",{}),staleTime:3e4},t[3]=r,t[4]=l):l=t[4],Ge(l)}function Zn(){const t=K.c(19),e=Be(),{org:n}=de();let r;t[0]!==n.id?(r={connectionId:be,orgId:n.id},t[0]=n.id,t[1]=r):r=t[1];const o=ge(r);let l;t[2]!==o?(l=async d=>Pe(o,"REGISTRY_PUBLISH_API_KEY_GENERATE",{name:d}),t[2]=o,t[3]=l):l=t[3];let a;t[4]!==e?(a=async()=>{await e.invalidateQueries({queryKey:G.publishApiKeys()})},t[4]=e,t[5]=a):a=t[5];let i;t[6]!==l||t[7]!==a?(i={mutationFn:l,onSuccess:a},t[6]=l,t[7]=a,t[8]=i):i=t[8];const c=Me(i);let m;t[9]!==o?(m=async d=>Pe(o,"REGISTRY_PUBLISH_API_KEY_REVOKE",{keyId:d}),t[9]=o,t[10]=m):m=t[10];let x;t[11]!==e?(x=async()=>{await e.invalidateQueries({queryKey:G.publishApiKeys()})},t[11]=e,t[12]=x):x=t[12];let h;t[13]!==m||t[14]!==x?(h={mutationFn:m,onSuccess:x},t[13]=m,t[14]=x,t[15]=h):h=t[15];const f=Me(h);let p;return t[16]!==c||t[17]!==f?(p={generateMutation:c,revokeMutation:f},t[16]=c,t[17]=f,t[18]=p):p=t[18],p}function ms(t){return t?t.split(/[;|]/).map(e=>e.trim()).filter(Boolean):[]}function us(t){const e=[];let n="",r=!1;for(let o=0;o<t.length;o+=1){const l=t[o],a=t[o+1];if(l==='"'){r&&a==='"'?(n+='"',o+=1):r=!r;continue}if(l===","&&!r){e.push(n.trim()),n="";continue}n+=l}return e.push(n.trim()),e}const Xn=["id","title"],er=["id","title","description","remote_url","remote_type","tags","categories","is_public"];function tr(t){const e=t.split(/\r?\n/).map(m=>m.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 n=us(e[0]??""),r=new Map,o=[];n.forEach((m,x)=>{const h=m.toLowerCase().trim();h&&r.set(h,x)});for(const m of Xn)r.has(m)||o.push({line:1,message:`Missing required column: "${m}"`});for(const m of n){const x=m.toLowerCase().trim();x&&!er.includes(x)&&o.push({line:1,message:`Unknown column "${m}" will be ignored`})}if(!r.has("id")||!r.has("title"))return{items:[],warnings:o,skipped:0};const l=(m,x)=>{const h=r.get(x);return typeof h=="number"?m[h]??"":""},a=[],i=new Set;let c=0;for(let m=1;m<e.length;m+=1){const x=us(e[m]??""),h=l(x,"id").trim(),f=l(x,"title").trim();if(!h){o.push({line:m+1,message:"Missing id — row skipped"}),c+=1;continue}if(!f){o.push({line:m+1,message:`Missing title for id="${h}" — row skipped`}),c+=1;continue}if(i.has(h)){o.push({line:m+1,message:`Duplicate id="${h}" — row skipped`}),c+=1;continue}i.add(h);const p=l(x,"description").trim(),d=l(x,"remote_url").trim(),g=l(x,"remote_type").trim().toLowerCase()==="sse"?"sse":"http",C=ms(l(x,"tags")),_=ms(l(x,"categories")),v=l(x,"is_public").trim().toLowerCase(),b=v==="true"||v==="1"||v==="yes";a.push({id:h,title:f,description:p||null,is_public:b,_meta:{"mcp.mesh":{...C.length>0?{tags:C}:{},..._.length>0?{categories:_}:{}}},server:{name:h,title:f,description:p||void 0,remotes:d?[{type:g,url:d}]:[]}})}return{items:a,warnings:o,skipped:c}}const sr=`id,title,description,remote_url,remote_type,tags,categories,is_public
2
2
  my-mcp-server,My MCP Server,A useful MCP server,https://example.com/mcp,http,ai|tools,productivity,true
3
3
  another-server,Another Server,Another useful server,https://example2.com/mcp,http,data|analytics,data-processing,false`;function nr(){const t=new Blob([sr],{type:"text/csv;charset=utf-8"}),e=URL.createObjectURL(t),n=document.createElement("a");n.href=e,n.download="registry-import-template.csv",n.click(),URL.revokeObjectURL(e)}function rr(t){const e=K.c(63),{open:n,onOpenChange:r,isImporting:o,onImport:l}=t,a=o===void 0?!1:o,[i,c]=M.useState(null),[m,x]=M.useState(null),[h,f]=M.useState(null),p=M.useRef(null);let d;e[0]!==r?(d=ue=>{r(ue),ue||(c(null),x(null),f(null),p.current&&(p.current.value=""))},e[0]=r,e[1]=d):d=e[1];const y=d;let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=async ue=>{if(!ue)return;f(ue.name),x(null);const ve=await ue.text();c(tr(ve))},e[2]=g):g=e[2];const C=g;let _;e[3]!==l||e[4]!==i?(_=async()=>{if(!i?.items.length)return;const ue=await l(i.items);x(ue)},e[3]=l,e[4]=i,e[5]=_):_=e[5];const v=_;let b;e[6]!==i?.items?(b=i?.items??[],e[6]=i?.items,e[7]=b):b=e[7];const S=b;let u;e[8]!==i?.warnings?(u=i?.warnings??[],e[8]=i?.warnings,e[9]=u):u=e[9];const j=u;let k;e[10]!==j?(k=j.some(or),e[10]=j,e[11]=k):k=e[11];const T=k,N=m!==null;let R;e[12]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsxs(It,{children:[s.jsx(Mt,{children:"Import MCP Servers from CSV"}),s.jsx(Pt,{children:"Upload a CSV file to bulk-import MCP servers into the registry."})]}),e[12]=R):R=e[12];let w;e[13]===Symbol.for("react.memo_cache_sentinel")?(w=()=>p.current?.click(),e[13]=w):w=e[13];let P;e[14]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx(cs,{size:14}),e[14]=P):P=e[14];const D=h?"Change file":"Choose CSV file";let I;e[15]!==a||e[16]!==D?(I=s.jsxs(F,{variant:"outline",size:"sm",className:"gap-1.5",onClick:w,disabled:a,children:[P,D]}),e[15]=a,e[16]=D,e[17]=I):I=e[17];let E;e[18]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("input",{ref:p,type:"file",accept:".csv,text/csv",className:"hidden",onChange:ue=>C(ue.target.files?.[0]??null)}),e[18]=E):E=e[18];let $;e[19]!==h?($=h&&s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:h}),e[19]=h,e[20]=$):$=e[20];let z;e[21]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("div",{className:"flex-1"}),e[21]=z):z=e[21];let L;e[22]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsxs(F,{variant:"ghost",size:"sm",className:"gap-1.5 text-xs text-muted-foreground",onClick:nr,children:[s.jsx(pn,{size:14}),"Download template"]}),e[22]=L):L=e[22];let q;e[23]!==I||e[24]!==$?(q=s.jsxs("div",{className:"flex items-center gap-3",children:[I,E,$,z,L]}),e[23]=I,e[24]=$,e[25]=q):q=e[25];let V;e[26]!==j?(V=j.length>0&&s.jsx("div",{className:"rounded-lg border border-yellow-200 bg-yellow-50 dark:border-yellow-900 dark:bg-yellow-950/30 p-3 grid gap-1",children:j.map(ar)}),e[26]=j,e[27]=V):V=e[27];let Y;e[28]!==S||e[29]!==i?(Y=S.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm font-medium",children:"Preview"}),s.jsxs(U,{variant:"secondary",children:[S.length," items"]}),i?.skipped?s.jsxs(U,{variant:"outline",className:"text-yellow-600",children:[i.skipped," skipped"]}):null]}),s.jsx("div",{className:"border rounded-lg overflow-hidden",children:s.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:s.jsxs(js,{children:[s.jsx(ys,{children:s.jsxs(Tt,{children:[s.jsx(Ae,{className:"w-[140px]",children:"ID"}),s.jsx(Ae,{children:"Title"}),s.jsx(Ae,{children:"Remote URL"}),s.jsx(Ae,{className:"w-[80px] text-center",children:"Public"}),s.jsx(Ae,{children:"Tags"})]})}),s.jsx(bs,{children:S.map(lr)})]})})})]}),e[28]=S,e[29]=i,e[30]=Y):Y=e[30];let X;e[31]!==m?(X=m&&s.jsxs("div",{className:"rounded-lg border p-3 grid gap-1.5",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[s.jsx(bt,{size:16,className:"text-emerald-600"}),"Imported ",m.created," item(s) successfully"]}),m.errors.length>0&&s.jsx("div",{className:"grid gap-1 mt-1",children:m.errors.map(ir)})]}),e[31]=m,e[32]=X):X=e[32];let Z;e[33]!==N||e[34]!==i?(Z=!i&&!N&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[s.jsx(cs,{size:32,className:"text-muted-foreground/40 mb-3"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose a CSV file or download the template to get started."}),s.jsxs("p",{className:"text-xs text-muted-foreground/70 mt-1",children:["Required columns: ",s.jsx("code",{children:"id"}),", ",s.jsx("code",{children:"title"}),". Optional:"," ",s.jsx("code",{children:"description"}),", ",s.jsx("code",{children:"remote_url"}),","," ",s.jsx("code",{children:"remote_type"}),", ",s.jsx("code",{children:"tags"}),","," ",s.jsx("code",{children:"categories"}),", ",s.jsx("code",{children:"is_public"}),"."]}),s.jsxs("p",{className:"text-xs text-muted-foreground/70 mt-1",children:["Use ",s.jsx("code",{children:"|"})," or ",s.jsx("code",{children:";"})," to separate multiple tags/categories within a cell."]})]}),e[33]=N,e[34]=i,e[35]=Z):Z=e[35];let te;e[36]!==q||e[37]!==V||e[38]!==Y||e[39]!==X||e[40]!==Z?(te=s.jsxs("div",{className:"flex-1 overflow-y-auto grid gap-4 pr-1",children:[q,V,Y,X,Z]}),e[36]=q,e[37]=V,e[38]=Y,e[39]=X,e[40]=Z,e[41]=te):te=e[41];let se;e[42]!==y?(se=()=>y(!1),e[42]=y,e[43]=se):se=e[43];const he=N?"Done":"Cancel";let re;e[44]!==se||e[45]!==he?(re=s.jsx(F,{variant:"outline",onClick:se,children:he}),e[44]=se,e[45]=he,e[46]=re):re=e[46];let ae;e[47]!==v||e[48]!==T||e[49]!==N||e[50]!==a||e[51]!==S.length?(ae=!N&&s.jsx(F,{onClick:v,disabled:a||S.length===0||T,children:a?"Importing...":`Import ${S.length} item(s)`}),e[47]=v,e[48]=T,e[49]=N,e[50]=a,e[51]=S.length,e[52]=ae):ae=e[52];let oe;e[53]!==re||e[54]!==ae?(oe=s.jsxs(Et,{className:"gap-2 sm:gap-0",children:[re,ae]}),e[53]=re,e[54]=ae,e[55]=oe):oe=e[55];let me;e[56]!==te||e[57]!==oe?(me=s.jsxs(Dt,{className:"sm:max-w-3xl max-h-[85vh] flex flex-col",children:[R,te,oe]}),e[56]=te,e[57]=oe,e[58]=me):me=e[58];let ce;return e[59]!==y||e[60]!==n||e[61]!==me?(ce=s.jsx($t,{open:n,onOpenChange:y,children:me}),e[59]=y,e[60]=n,e[61]=me,e[62]=ce):ce=e[62],ce}function ir(t){return s.jsxs("p",{className:"text-xs text-destructive flex items-start gap-1.5",children:[s.jsx(jt,{size:12,className:"shrink-0 mt-0.5"}),s.jsxs("span",{children:[s.jsx("span",{className:"font-mono",children:t.id}),": ",t.error]})]},t.id)}function lr(t){return s.jsxs(Tt,{children:[s.jsx(Le,{className:"font-mono text-xs",children:t.id}),s.jsx(Le,{className:"text-sm",children:t.title}),s.jsx(Le,{className:"text-xs text-muted-foreground max-w-[200px] truncate",children:t.server.remotes?.[0]?.url??s.jsx("span",{className:"italic",children:"none"})}),s.jsx(Le,{className:"text-center",children:t.is_public?s.jsx(U,{variant:"secondary",className:"text-[10px] bg-emerald-100 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-400",children:"Yes"}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"No"})}),s.jsx(Le,{className:"text-xs text-muted-foreground",children:(t._meta?.["mcp.mesh"]?.tags??[]).join(", ")||"-"})]},t.id)}function ar(t,e){return s.jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-400 flex items-start gap-1.5",children:[s.jsx(jt,{size:12,className:"shrink-0 mt-0.5"}),s.jsxs("span",{children:[t.line>0&&s.jsxs("span",{className:"font-mono text-[10px] mr-1",children:["Line ",t.line,":"]}),t.message]})]},`${t.line}-${e}`)}function or(t){return t.message.startsWith("Missing required column:")}function cr(t){const e=K.c(19),{open:n,onOpenChange:r,title:o,isDeleting:l,onConfirm:a}=t,i=l===void 0?!1:l;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Lt,{children:"Delete registry item?"}),e[0]=c):c=e[0];let m;e[1]!==o?(m=s.jsxs(zt,{children:[c,s.jsxs(Ot,{children:["This action cannot be undone. Item ",s.jsx("strong",{children:o})," will be permanently removed from this private registry."]})]}),e[1]=o,e[2]=m):m=e[2];let x;e[3]!==i?(x=s.jsx(Ut,{disabled:i,children:"Cancel"}),e[3]=i,e[4]=x):x=e[4];const h=i?"Deleting...":"Delete";let f;e[5]!==i||e[6]!==a||e[7]!==h?(f=s.jsx(qt,{disabled:i,onClick:a,children:h}),e[5]=i,e[6]=a,e[7]=h,e[8]=f):f=e[8];let p;e[9]!==x||e[10]!==f?(p=s.jsxs(Ft,{children:[x,f]}),e[9]=x,e[10]=f,e[11]=p):p=e[11];let d;e[12]!==m||e[13]!==p?(d=s.jsxs(Bt,{children:[m,p]}),e[12]=m,e[13]=p,e[14]=d):d=e[14];let y;return e[15]!==r||e[16]!==n||e[17]!==d?(y=s.jsx(Gt,{open:n,onOpenChange:r,children:d}),e[15]=r,e[16]=n,e[17]=d,e[18]=y):y=e[18],y}function dr(t){const[e]=t.id.split("/");return e??"provider"}function mr(t){return t._meta?.["mcp.mesh"]?.tags??[]}function ur(t){return t._meta?.["mcp.mesh"]?.categories??[]}function xr(t){return t.server?.icons?.[0]?.src??null}function hr(t){const e=K.c(56),{item:n,onEdit:r,onDelete:o}=t;let l;e[0]!==n?(l=xr(n),e[0]=n,e[1]=l):l=e[1];const a=l;let i;e[2]!==n?(i=[...mr(n),...ur(n)],e[2]=n,e[3]=i):i=e[3];const c=i;let m;e[4]!==c?(m=c.slice(0,3),e[4]=c,e[5]=m):m=e[5];const x=m,h=Math.max(0,c.length-x.length);let f;e[6]!==a||e[7]!==n.title?(f=s.jsx("div",{className:"size-10 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0 flex items-center justify-center",children:a?s.jsx("img",{src:a,alt:n.title,className:"h-full w-full object-cover",loading:"lazy"}):s.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:n.title.charAt(0).toUpperCase()})}),e[6]=a,e[7]=n.title,e[8]=f):f=e[8];let p;e[9]!==n.title?(p=s.jsx("p",{className:"font-medium truncate",children:n.title}),e[9]=n.title,e[10]=p):p=e[10];let d;e[11]!==n?(d=dr(n),e[11]=n,e[12]=d):d=e[12];let y;e[13]!==d?(y=s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:d}),e[13]=d,e[14]=y):y=e[14];let g;e[15]!==n.is_public?(g=n.is_public?s.jsxs(U,{variant:"default",className:"gap-1",children:[s.jsx(vs,{size:10}),"Public"]}):s.jsx(U,{variant:"secondary",children:"Private"}),e[15]=n.is_public,e[16]=g):g=e[16];let C;e[17]!==y||e[18]!==g?(C=s.jsxs("div",{className:"flex items-center gap-2",children:[y,g]}),e[17]=y,e[18]=g,e[19]=C):C=e[19];let _;e[20]!==p||e[21]!==C?(_=s.jsxs("div",{className:"min-w-0 flex-1",children:[p,C]}),e[20]=p,e[21]=C,e[22]=_):_=e[22];let v;e[23]!==_||e[24]!==f?(v=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[f,_]}),e[23]=_,e[24]=f,e[25]=v):v=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx(kt,{asChild:!0,children:s.jsx(F,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(Xt,{size:18})})}),e[26]=b):b=e[26];let S;e[27]!==n||e[28]!==r?(S=s.jsx(We,{onClick:()=>r(n),children:"Edit"}),e[27]=n,e[28]=r,e[29]=S):S=e[29];let u;e[30]!==n||e[31]!==o?(u=()=>o(n),e[30]=n,e[31]=o,e[32]=u):u=e[32];let j;e[33]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(vt,{size:14}),e[33]=j):j=e[33];let k;e[34]!==u?(k=s.jsxs(We,{variant:"destructive",onClick:u,children:[j,"Delete"]}),e[34]=u,e[35]=k):k=e[35];let T;e[36]!==S||e[37]!==k?(T=s.jsxs(St,{children:[b,s.jsxs(Rt,{align:"end",children:[S,k]})]}),e[36]=S,e[37]=k,e[38]=T):T=e[38];let N;e[39]!==v||e[40]!==T?(N=s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[v,T]}),e[39]=v,e[40]=T,e[41]=N):N=e[41];const R=n._meta?.["mcp.mesh"]?.short_description||n.description||n.server.description||"No description provided.";let w;e[42]!==R?(w=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 min-h-10",children:R}),e[42]=R,e[43]=w):w=e[43];let P;e[44]!==n.id||e[45]!==x?(P=x.map($=>s.jsx(U,{variant:"secondary",children:$},`${n.id}-badge-${$}`)),e[44]=n.id,e[45]=x,e[46]=P):P=e[46];let D;e[47]!==h?(D=h>0&&s.jsxs(U,{variant:"outline",children:["+",h]}),e[47]=h,e[48]=D):D=e[48];let I;e[49]!==P||e[50]!==D?(I=s.jsxs("div",{className:"flex flex-wrap gap-1",children:[P,D]}),e[49]=P,e[50]=D,e[51]=I):I=e[51];let E;return e[52]!==N||e[53]!==w||e[54]!==I?(E=s.jsxs(ne,{className:"p-4 gap-4 transition-colors hover:bg-muted/50",children:[N,w,I]}),e[52]=N,e[53]=w,e[54]=I,e[55]=E):E=e[55],E}function zs(t){const e=K.c(27),{value:n,onChange:r,onFileUpload:o,error:l,isUploading:a}=t,i=a===void 0?!1:a,[c,m]=M.useState(!1),[x,h]=M.useState(!1),f=M.useRef(null);let p;e[0]!==i?(p=R=>{R.preventDefault(),i||m(!0)},e[0]=i,e[1]=p):p=e[1];const d=p;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=R=>{R.preventDefault(),m(!1)},e[2]=y):y=e[2];const g=y;let C;e[3]!==i||e[4]!==o?(C=async R=>{if(R.preventDefault(),m(!1),i)return;const w=R.dataTransfer.files[0];w&&await o(w)},e[3]=i,e[4]=o,e[5]=C):C=e[5];const _=C;let v;e[6]!==i||e[7]!==o?(v=async R=>{const w=R.target.files?.[0];w&&!i&&await o(w),R.target.value=""},e[6]=i,e[7]=o,e[8]=v):v=e[8];const b=v,S=n.length>0;let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(ie,{children:"Image"}),e[9]=u):u=e[9];let j;e[10]!==d||e[11]!==_||e[12]!==S||e[13]!==c||e[14]!==i||e[15]!==r||e[16]!==x||e[17]!==n?(j=S?s.jsx("div",{className:"relative group min-h-[180px] rounded-xl border border-border overflow-hidden bg-muted/10",children:s.jsxs("div",{className:"flex items-center gap-3 p-3 h-full",children:[s.jsx("div",{className:"size-20 rounded-lg border border-border bg-muted/20 overflow-hidden shrink-0",children:s.jsx("img",{src:n,alt:"Preview",className:"w-full h-full object-cover"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n}),s.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[s.jsxs(F,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>f.current?.click(),disabled:i,children:[s.jsx(es,{className:"size-3"}),"Change"]}),s.jsxs(F,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 text-destructive hover:text-destructive",onClick:()=>{r(""),h(!1)},disabled:i,children:[s.jsx(vt,{className:"size-3"}),"Remove"]})]})]})]})}):i?s.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:[s.jsx(mt,{className:"size-8 animate-spin text-muted-foreground"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Uploading image..."})]}):s.jsxs("div",{className:J("relative min-h-[180px] rounded-xl border-2 border-dashed transition-colors cursor-pointer flex flex-col",c?"border-primary bg-primary/5":"border-border hover:border-muted-foreground/40 hover:bg-muted/30"),onDragOver:d,onDragLeave:g,onDrop:_,onClick:()=>f.current?.click(),children:[s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-6 px-4 flex-1",children:[s.jsx("div",{className:J("size-10 rounded-lg flex items-center justify-center transition-colors",c?"bg-primary/10 text-primary":"bg-muted/50 text-muted-foreground"),children:s.jsx(Ps,{size:20})}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:c?"Drop image here":"Click or drag to upload"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"PNG, JPG, SVG up to 2MB"})]})]}),x?s.jsx("div",{className:"border-t border-border px-3 py-2",onClick:pr,children:s.jsx(ye,{placeholder:"https://example.com/logo.png",value:n,className:"text-xs h-8",onChange:R=>r(R.target.value)})}):s.jsx("div",{className:"border-t border-border px-4 py-2",children:s.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:R=>{R.stopPropagation(),h(!0)},children:[s.jsx(Es,{className:"size-3"}),"Or paste an image URL"]})})]}),e[10]=d,e[11]=_,e[12]=S,e[13]=c,e[14]=i,e[15]=r,e[16]=x,e[17]=n,e[18]=j):j=e[18];let k;e[19]!==b?(k=s.jsx("input",{ref:f,type:"file",accept:"image/*",className:"hidden",onChange:b}),e[19]=b,e[20]=k):k=e[20];let T;e[21]!==l?(T=l&&s.jsx("p",{className:"text-xs text-destructive",children:l}),e[21]=l,e[22]=T):T=e[22];let N;return e[23]!==j||e[24]!==k||e[25]!==T?(N=s.jsxs("div",{className:"grid gap-1.5",children:[u,j,k,T]}),e[23]=j,e[24]=k,e[25]=T,e[26]=N):N=e[26],N}function pr(t){return t.stopPropagation()}function Os(){const[t,e]=M.useState("idle"),[n,r]=M.useState(null),{org:o}=de(),l=ge({connectionId:be,orgId:o.id});return{discover:async(c,m)=>{if(!c)return null;e("loading"),r(null);try{const x=await l.callTool({name:"REGISTRY_DISCOVER_TOOLS",arguments:{url:c,type:m==="sse"?"sse":"http"}}),h=x.structuredContent??x;if(x.isError){const f=x.content?.find(p=>p.type==="text")?.text??"Tool returned an error";return r(f),e("error"),null}return h.error?fr(h.error)?(r(h.error),e("auth_required"),null):(r(h.error),e("error"),null):!h.tools||h.tools.length===0?(r("No tools found on this MCP server."),e("error"),null):(e("success"),h.tools)}catch(x){const h=x instanceof Error?x.message:String(x);return r(h||"Could not discover tools."),e("error"),null}},discoverStatus:t,discoverError:n,resetDiscover:()=>{e("idle"),r(null)}}}function fr(t){const e=t.toLowerCase();return e.includes("authentication")||e.includes("unauthorized")||e.includes("credentials")}function gr(t){const e=K.c(54),{tools:n,onChange:r,remoteUrl:o,remoteType:l,externalDiscoverStatus:a,externalDiscoverError:i}=t,[c,m]=M.useState(n.length>0),{discover:x,discoverStatus:h,discoverError:f,resetDiscover:p}=Os(),d=a??h,y=i??f;let g;e[0]!==x||e[1]!==r||e[2]!==l||e[3]!==o?(g=async()=>{if(!o)return;const L=await x(o,l??"http");L&&(r(L),m(!0))},e[0]=x,e[1]=r,e[2]=l,e[3]=o,e[4]=g):g=e[4];const C=g;let _;e[5]!==r||e[6]!==p?(_=()=>{r([]),p()},e[5]=r,e[6]=p,e[7]=_):_=e[7];const v=_;let b;e[8]!==c?(b=()=>m(!c),e[8]=c,e[9]=b):b=e[9];let S,u;e[10]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(ts,{size:14,className:"text-muted-foreground"}),u=s.jsx("span",{children:"Tools"}),e[10]=S,e[11]=u):(S=e[10],u=e[11]);let j;e[12]!==n.length?(j=n.length>0&&s.jsx(U,{variant:"secondary",className:"text-xs px-1.5 py-0",children:n.length}),e[12]=n.length,e[13]=j):j=e[13];let k;e[14]!==c?(k=c?s.jsx(fn,{size:14,className:"text-muted-foreground"}):s.jsx(Ss,{size:14,className:"text-muted-foreground"}),e[14]=c,e[15]=k):k=e[15];let T;e[16]!==b||e[17]!==j||e[18]!==k?(T=s.jsxs("button",{type:"button",className:"flex items-center gap-2 text-sm font-medium cursor-pointer",onClick:b,children:[S,u,j,k]}),e[16]=b,e[17]=j,e[18]=k,e[19]=T):T=e[19];let N;e[20]!==v||e[21]!==n.length?(N=n.length>0&&s.jsxs(F,{type:"button",variant:"ghost",size:"sm",className:"h-7 text-xs gap-1.5 text-muted-foreground",onClick:v,children:[s.jsx(vt,{size:12}),"Clear"]}),e[20]=v,e[21]=n.length,e[22]=N):N=e[22];let R;e[23]!==d||e[24]!==C||e[25]!==o||e[26]!==n.length?(R=o&&s.jsxs(F,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 border-green-500/30 text-green-600 dark:text-green-400 shadow-[0_0_8px_rgba(34,197,94,0.3)] hover:shadow-[0_0_14px_rgba(34,197,94,0.5)] hover:border-green-500/50 transition-all",onClick:C,disabled:d==="loading",children:[d==="loading"?s.jsx(mt,{size:12,className:"animate-spin"}):s.jsx(es,{size:12}),d==="loading"?"Discovering...":n.length>0?"Refresh":"Auto-discover"]}),e[23]=d,e[24]=C,e[25]=o,e[26]=n.length,e[27]=R):R=e[27];let w;e[28]!==R||e[29]!==N?(w=s.jsxs("div",{className:"flex items-center gap-2",children:[N,R]}),e[28]=R,e[29]=N,e[30]=w):w=e[30];let P;e[31]!==w||e[32]!==T?(P=s.jsxs("div",{className:"flex items-center justify-between",children:[T,w]}),e[31]=w,e[32]=T,e[33]=P):P=e[33];let D;e[34]!==d||e[35]!==n.length?(D=d==="success"&&s.jsxs("div",{className:"flex items-center gap-2 text-xs text-green-600 dark:text-green-400 bg-green-50 dark:bg-green-950/30 rounded-lg px-3 py-2",children:[s.jsx(bt,{size:14,className:"shrink-0"}),s.jsxs("span",{children:["Discovered ",n.length," tool",n.length!==1?"s":""," ","successfully."]})]}),e[34]=d,e[35]=n.length,e[36]=D):D=e[36];let I;e[37]!==y||e[38]!==d?(I=d==="error"&&y&&s.jsxs("div",{className:"flex items-center gap-2 text-xs text-destructive bg-destructive/10 rounded-lg px-3 py-2",children:[s.jsx(jt,{size:14,className:"shrink-0"}),s.jsx("span",{children:y})]}),e[37]=y,e[38]=d,e[39]=I):I=e[39];let E;e[40]!==c||e[41]!==n?(E=c&&n.length>0&&s.jsx("div",{className:"rounded-xl border border-border divide-y divide-border overflow-hidden max-h-48 overflow-y-auto",children:n.map(jr)}),e[40]=c,e[41]=n,e[42]=E):E=e[42];let $;e[43]!==d||e[44]!==c||e[45]!==o||e[46]!==n.length?($=c&&n.length===0&&d==="idle"&&s.jsx("p",{className:"text-xs text-muted-foreground px-1",children:o?'Click "Auto-discover" to load tools from the MCP server.':"Add a Remote URL first, then tools can be auto-discovered."}),e[43]=d,e[44]=c,e[45]=o,e[46]=n.length,e[47]=$):$=e[47];let z;return e[48]!==P||e[49]!==D||e[50]!==I||e[51]!==E||e[52]!==$?(z=s.jsxs("div",{className:"space-y-3",children:[P,D,I,E,$]}),e[48]=P,e[49]=D,e[50]=I,e[51]=E,e[52]=$,e[53]=z):z=e[53],z}function jr(t){return s.jsx("div",{className:"flex items-center gap-3 px-3 py-2",children:s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-mono truncate",children:t.name}),t.description&&s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t.description})]})},t.name)}function Us(t){const{org:e}=de(),[n,r]=M.useState(!1),l=typeof window<"u"&&window.location.hostname==="localhost"?`${e.id}_dev-assets`:null,a=ge({connectionId:l??"noop",orgId:e.id});return{uploadImage:async(c,m)=>{if(!l)return W.error("Image upload requires an object-storage connection. Configure one in plugin settings."),null;if(!c.type.startsWith("image/"))return W.error("Only image files are supported"),null;if(c.size>5*1024*1024)return W.error("Image size must be less than 5MB"),null;r(!0);try{const x=await a.callTool({name:"PUT_PRESIGNED_URL",arguments:{key:m,contentType:c.type}}),h=x.structuredContent?.url||x.url;if(!h)throw new Error("Failed to get presigned URL");const f=await fetch(h,{method:"PUT",body:c,headers:{"Content-Type":c.type}});if(!f.ok)throw new Error(`Upload failed: ${f.statusText}`);const p=await a.callTool({name:"GET_PRESIGNED_URL",arguments:{key:m,expiresIn:31536e3}}),d=p.structuredContent?.url||p.url;if(!d)throw new Error("Failed to get public URL");return d}catch(x){return console.error("Image upload failed:",x),W.error(x instanceof Error?x.message:"Failed to upload image. Please try again."),null}finally{r(!1)}},isUploading:n}}function yr(){const{org:t}=de(),[e,n]=M.useState(null),r=M.useRef(0),o=ge({connectionId:be,orgId:t.id});return{generate:async a=>{r.current+=1,n(a.type);try{const i=await o.callTool({name:"REGISTRY_AI_GENERATE",arguments:a});if(i.isError){const c=i.content?.find(m=>m.type==="text")?.text??"Failed to generate content";throw new Error(c)}return i.structuredContent??i}finally{r.current-=1,r.current===0&&n(null)}},loadingType:e,isGenerating:e!==null}}const br=new Set(["http","sse","stdio"]),vr=/^[a-z0-9]+(?:[/-][a-z0-9._-]+)*$/,xs=["internal","automation","support","sales","ops","ai"],qs=["productivity","communication","customer-support","development","data","operations"],Nr=["Essentials","Details","Advanced"],ht="h-7 text-xs border-green-500/30 text-green-600 dark:text-green-400 shadow-[0_0_8px_rgba(34,197,94,0.3)] hover:shadow-[0_0_14px_rgba(34,197,94,0.5)] hover:border-green-500/50 transition-all";function hs(t){return t.replace(/^https?:\/\//i,"").trim()}function pt(t){const e=t.trim();return e?/^https?:\/\//i.test(e)?e:`https://${e}`:""}function lt(t){return t.trim().toLowerCase()}function yt(t){return Array.from(new Set(t.map(lt).filter(e=>e.length>0)))}function dt(t){return t.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9._-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function wr(t){const e=K.c(4),{current:n}=t;let r;e[0]!==n?(r=Nr.map((l,a)=>{const i=a+1,c=i===n,m=i<n;return s.jsxs("div",{className:"flex items-center gap-1.5",children:[a>0&&s.jsx("div",{className:J("w-4 h-px",m?"bg-primary":"bg-border")}),s.jsxs("div",{className:J("flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs transition-colors",c?"bg-primary/10 text-primary font-medium":m?"text-primary":"text-muted-foreground"),children:[s.jsx("span",{className:J("size-5 rounded-full inline-flex items-center justify-center text-[10px] font-semibold shrink-0",c?"bg-primary text-primary-foreground":m?"bg-primary/20 text-primary":"bg-muted text-muted-foreground"),children:i}),s.jsx("span",{className:"hidden sm:inline",children:l})]})]},l)}),e[0]=n,e[1]=r):r=e[1];let o;return e[2]!==r?(o=s.jsx("div",{className:"flex items-center gap-1.5",children:r}),e[2]=r,e[3]=o):o=e[3],o}function Cr(t){const e=K.c(28),{id:n,label:r,values:o,availableOptions:l,placeholder:a,onChange:i}=t,[c,m]=M.useState(""),[x,h]=M.useState(!1);let f,p,d,y,g;if(e[0]!==l||e[1]!==n||e[2]!==c||e[3]!==x||e[4]!==r||e[5]!==i||e[6]!==a||e[7]!==o){const v=yt(l),b=yt(o),S=new Set(b),u=lt(c),j=v.filter(I=>!S.has(I)).filter(I=>u?I.includes(u):!0).slice(0,8),k=I=>{const E=lt(I);!E||S.has(E)||i([...b,E])},T=I=>{i(b.filter(E=>E!==I))},N=()=>{const I=c.split(/[,\n;]/).map(lt).filter(Boolean);if(I.length===0)return;const E=[...b];for(const $ of I)E.includes($)||E.push($);i(E),m("")},R=u;y="grid gap-2",e[13]!==n||e[14]!==r?(g=s.jsx(ie,{htmlFor:n,children:r}),e[13]=n,e[14]=r,e[15]=g):g=e[15],f="relative";let w;e[16]!==n?(w=()=>{const I=document.getElementById(n);I instanceof HTMLInputElement&&I.focus()},e[16]=n,e[17]=w):w=e[17];let P;e[18]===Symbol.for("react.memo_cache_sentinel")?(P=()=>h(!0),e[18]=P):P=e[18];let D;e[19]===Symbol.for("react.memo_cache_sentinel")?(D=I=>m(I.target.value),e[19]=D):D=e[19],p=s.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:w,children:s.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[b.map(I=>s.jsxs(U,{variant:"secondary",className:"gap-1",children:[I,s.jsx("button",{type:"button",onClick:E=>{E.preventDefault(),E.stopPropagation(),T(I)},children:s.jsx(bn,{size:12})})]},`${n}-${I}`)),s.jsx("input",{id:n,className:"flex-1 min-w-[120px] bg-transparent outline-none border-none text-sm",placeholder:b.length?"":a,value:c,onFocus:P,onBlur:()=>{h(!1),N()},onChange:D,onKeyDown:I=>{if(I.key==="Enter"||I.key===","){I.preventDefault(),N();return}I.key==="Backspace"&&!c&&b.length&&T(b[b.length-1]??"")}})]})}),d=x&&s.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:j.length>0?j.map(I=>s.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:kr,onClick:()=>{k(I),m("")},children:I},`${n}-suggestion-${I}`)):R?s.jsxs("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:_r,onClick:()=>{k(R),m("")},children:['Create "',R,'"']}):s.jsx("div",{className:"px-2.5 py-1.5 text-sm text-muted-foreground",children:"Type to search or create."})}),e[0]=l,e[1]=n,e[2]=c,e[3]=x,e[4]=r,e[5]=i,e[6]=a,e[7]=o,e[8]=f,e[9]=p,e[10]=d,e[11]=y,e[12]=g}else f=e[8],p=e[9],d=e[10],y=e[11],g=e[12];let C;e[20]!==f||e[21]!==p||e[22]!==d?(C=s.jsxs("div",{className:f,children:[p,d]}),e[20]=f,e[21]=p,e[22]=d,e[23]=C):C=e[23];let _;return e[24]!==y||e[25]!==g||e[26]!==C?(_=s.jsxs("div",{className:y,children:[g,C]}),e[24]=y,e[25]=g,e[26]=C,e[27]=_):_=e[27],_}function _r(t){return t.preventDefault()}function kr(t){return t.preventDefault()}function Sr({id:t,value:e,availableOptions:n,onChange:r}){const[o,l]=M.useState(e),[a,i]=M.useState(!1),c=M.useRef(e);c.current!==e&&(c.current=e,l(e));const m=yt([...qs,...n,e]).filter(Boolean),x=lt(o),h=m.filter(p=>x?p.includes(x):!0).slice(0,8),f=p=>{const d=lt(p);r(d),l(d),i(!1)};return s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ie,{htmlFor:t,children:"Category"}),s.jsxs("div",{className:"relative",children:[s.jsx(ye,{id:t,className:"h-9 text-sm",placeholder:"Select or create category",value:o,onFocus:()=>{l(e),i(!0)},onBlur:()=>{f(o)},onChange:p=>l(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),f(o))}}),e&&s.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-muted-foreground hover:text-foreground",onMouseDown:p=>p.preventDefault(),onClick:()=>{r(""),l("")},children:"clear"}),a&&s.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(p=>s.jsx("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:d=>d.preventDefault(),onClick:()=>f(p),children:p},`${t}-${p}`)):x?s.jsxs("button",{type:"button",className:"w-full text-left px-2.5 py-1.5 text-sm hover:bg-muted",onMouseDown:p=>p.preventDefault(),onClick:()=>f(x),children:['Create "',x,'"']}):s.jsx("div",{className:"px-2.5 py-1.5 text-sm text-muted-foreground",children:"Type to search or create."})})]})]})}function Rr({open:t,onOpenChange:e,item:n,draft:r,availableTags:o=[],availableCategories:l=[],defaultLLMConnectionId:a="",defaultLLMModelId:i="",isSubmitting:c=!1,onSubmit:m}){const{org:x}=de(),{uploadImage:h,isUploading:f}=Us(),{generate:p,loadingType:d}=yr(),{discover:y,discoverStatus:g,discoverError:C,resetDiscover:_}=Os(),v=!!n,b=r?._meta?.["mcp.mesh"],S=n?.title??r?.title??"",u=n?.id?.split("/")[0]??r?.id?.split("/")[0]??"",j=n?.description??r?.description??"",k=n?._meta?.["mcp.mesh"]?.short_description??b?.short_description??"",T=n?._meta?.["mcp.mesh"]?.owner??b?.owner??"",N=n?.server?.repository?.url??r?.server?.repository?.url??"",R=n?._meta?.["mcp.mesh"]?.readme??b?.readme??"",w=n?._meta?.["mcp.mesh"]?.readme_url??b?.readme_url??"",P=hs(n?.server?.remotes?.[0]?.url??r?.server?.remotes?.[0]?.url??""),D=n?.server?.remotes?.[0]?.type??r?.server?.remotes?.[0]?.type??"http",I=n?._meta?.["mcp.mesh"]?.tags??b?.tags??[],E=n?._meta?.["mcp.mesh"]?.categories?.[0]??b?.categories?.[0]??"",$=n?.server?.icons?.[0]?.src??r?.server?.icons?.[0]?.src??"",z=n?._meta?.["mcp.mesh"]?.tools??b?.tools??[],L=n?.is_public??r?.is_public??!1,[q,V]=M.useState(1),[Y,X]=M.useState(S),[Z,te]=M.useState(u),[se,he]=M.useState(j),[re,ae]=M.useState(k),[oe,me]=M.useState(T),[ce,ue]=M.useState(N),[ve,Se]=M.useState(R),[je,Ie]=M.useState(w),[xe,Ne]=M.useState(R?"content":"link"),[le,_e]=M.useState(P),[H,fe]=M.useState(D),[Re,O]=M.useState(I),[ee,Te]=M.useState(E),[we,Ue]=M.useState($),[Ce,Je]=M.useState(z),[Ze,at]=M.useState(L),[pe,Oe]=M.useState({}),Ee=!!(a&&i),Xe=()=>{V(1),X(S),te(u),he(j),ae(k),me(T),ue(N),Se(R),Ie(w),Ne(R?"content":"link"),_e(P),fe(D),O(I),Te(E),Ue($),Je(z),at(L),Oe({}),_(),qe.current="",De.current&&(clearTimeout(De.current),De.current=null)},ut=async A=>{if(!A)return;const B=v?n?.id:`${Z}/${Y}`.toLowerCase(),$e=dt(B||"temp"),Ve=A.name.split(".").pop()||"png",Ye=`registry/${x.id}/${$e}/icon.${Ve}`,ct=await h(A,Ye);ct?(Ue(ct),Oe(He=>({...He,imageUrl:void 0}))):Oe(He=>({...He,imageUrl:"Failed to upload image. Please try again."}))},De=M.useRef(null),qe=M.useRef(""),tt=M.useRef(H);tt.current=H;const ot=A=>{!A&&De.current&&(clearTimeout(De.current),De.current=null),e(A),A||Xe()},st=async()=>{const A=pt(le);if(!A)return;qe.current=A;const B=await y(A,tt.current);B&&Je(B)},nt=A=>{De.current&&clearTimeout(De.current);const B=pt(A);!B||B===qe.current||A.includes(".")&&(De.current=setTimeout(async()=>{qe.current=B;const $e=await y(B,tt.current);$e&&Je($e)},800))},Qe=()=>Ee?{llmConnectionId:a,modelId:i}:null,Ke=()=>({name:Y.trim(),provider:Z.trim(),url:pt(le),owner:oe.trim(),repositoryUrl:ce.trim(),description:se.trim(),shortDescription:re.trim(),tags:Re,categories:ee?[ee]:[],availableTags:[...xs,...o],availableCategories:[...qs,...l],tools:Ce}),rt=async()=>{const A=Qe();if(!A)return;const B=await p({...A,type:"description",context:Ke()});B.result&&he(B.result.slice(0,1500))},it=async()=>{const A=Qe();if(!A)return;const B=await p({...A,type:"short_description",context:Ke()});B.result&&ae(B.result.slice(0,160))},Q=async()=>{const A=Qe();if(!A)return;const B=await p({...A,type:"tags",context:Ke()});B.items?.length&&O(yt(B.items))},ke=async()=>{const A=Qe();if(!A)return;const B=await p({...A,type:"categories",context:Ke()});B.items?.[0]&&Te(lt(B.items[0]))},xt=async()=>{const A=Qe();if(!A)return;const B=await p({...A,type:"readme",context:Ke()});B.result&&(Se(B.result.slice(0,5e4)),Ne("content"))},rs=A=>{const B={};if(A===1){const $e=dt(Z),Ve=dt(Y),Ye=`${$e}/${Ve}`;Y.trim()||(B.title="Name is required."),v||($e?Ve?vr.test(Ye)||(B.provider="Use lowercase letters/numbers and separators '/' or '-'."):B.title="Name must contain valid characters.":B.provider="Provider is required.");const ct=pt(le),He=H.trim().toLowerCase();if(He!=="stdio"&&ct)try{const ft=new URL(ct);["http:","https:"].includes(ft.protocol)||(B.remoteUrl="Remote URL must be http(s).")}catch{B.remoteUrl="Remote URL is invalid."}if(He&&!br.has(He)&&(B.remoteType="Remote type must be: http, sse or stdio."),we.trim()&&!we.trim().startsWith("data:image/"))try{const Vt=new URL(we.trim());["http:","https:"].includes(Vt.protocol)||(B.imageUrl="Image URL must be http(s).")}catch{B.imageUrl="Image URL is invalid."}}if(A===2&&(se.length>1500&&(B.description="Description must be 1500 characters or less."),re.trim().length>160&&(B.shortDescription="Short description must be 160 characters or less.")),A===3){const $e=je.trim();if($e)try{const Ye=new URL($e);["http:","https:"].includes(Ye.protocol)||(B.readmeUrl="README URL must be http(s).")}catch{B.readmeUrl="README URL is invalid."}ve.trim().length>5e4&&(B.readme="README must be 50 000 characters or less.");const Ve=ce.trim();if(Ve)try{const Ye=new URL(Ve);["http:","https:"].includes(Ye.protocol)||(B.repositoryUrl="Repository URL must be http(s).")}catch{B.repositoryUrl="Repository URL is invalid."}}return Oe(B),Object.values(B).every($e=>$e===void 0)},Vs=()=>{rs(q)&&q<3&&V(q+1)},Ys=()=>{q>1&&V(q-1)},Hs=async()=>{if(!rs(3))return;const A=Y.trim(),B=dt(Z),$e=dt(A),Ve=`${B}/${$e}`,Ye=pt(le),ct=H.trim().toLowerCase(),He=we.trim(),ft=ce.trim(),Vt=re.trim(),Xs=ve.trim(),en=je.trim(),tn=yt(Re),sn=ee?[lt(ee)]:[],nn=n?n.server?.name??n.id:"",rn=(v?nn:Ve).trim(),Yt=se.trim(),ln=oe.trim(),is={title:A,description:Yt.length>0?Yt:null,is_public:Ze,_meta:{"mcp.mesh":{tags:tn,categories:sn,short_description:Vt||null,owner:ln||null,readme:Xs||null,readme_url:en||null,...Ce.length>0?{tools:Ce}:{}}},server:{name:rn,title:A,description:Yt||void 0,icons:He?[{src:He}]:[],repository:ft?{url:ft}:void 0,remotes:Ye?[{type:ct||"http",url:Ye}]:[]}};if(v&&n){await m({id:n.id,data:is}),e(!1);return}await m({id:Ve,...is}),e(!1),Xe()},Ws=s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{className:"row-span-2 grid gap-3 content-start",children:[s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx(ie,{htmlFor:"registry-item-provider",children:"Provider"}),s.jsx(ye,{id:"registry-item-provider",className:"h-9 text-sm",placeholder:"acme",value:Z,onChange:A=>te(A.target.value),disabled:v}),!v&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Item ID:"," ",s.jsx("span",{className:"font-mono",children:`${dt(Z)||"provider"}/${dt(Y)||"name"}`})]}),pe.provider&&s.jsx("p",{className:"text-xs text-destructive",children:pe.provider})]}),s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx(ie,{htmlFor:"registry-item-title",children:"Name"}),s.jsx(ye,{id:"registry-item-title",className:"h-9 text-sm",placeholder:"Internal MCP",value:Y,onChange:A=>X(A.target.value)}),pe.title&&s.jsx("p",{className:"text-xs text-destructive",children:pe.title})]})]}),s.jsx("div",{className:"row-span-2 content-start",children:s.jsx(zs,{value:we,onChange:A=>{Ue(A),Oe(B=>({...B,imageUrl:void 0}))},onFileUpload:ut,error:pe.imageUrl,isUploading:f})}),s.jsxs("div",{className:"col-span-2 grid gap-1.5",children:[s.jsx(ie,{htmlFor:"registry-remote-url",children:"Remote URL"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"flex-1 flex items-center rounded-xl border border-input px-3",children:[s.jsx("span",{className:"text-xs font-semibold text-muted-foreground mr-1",children:"https://"}),s.jsx("input",{id:"registry-remote-url",className:"flex-1 h-9 bg-transparent outline-none text-sm",placeholder:"example.com/mcp",value:le,onChange:A=>{const B=hs(A.target.value);_e(B),nt(B)}})]}),s.jsxs(ws,{value:H,onValueChange:fe,children:[s.jsx(Cs,{id:"registry-remote-type",className:"w-[90px] h-9 shrink-0",children:s.jsx(_s,{placeholder:"Type"})}),s.jsxs(ks,{children:[s.jsx(Ct,{value:"http",children:"http"}),s.jsx(Ct,{value:"sse",children:"sse"}),s.jsx(Ct,{value:"stdio",children:"stdio"})]})]})]}),pe.remoteUrl&&s.jsx("p",{className:"text-xs text-destructive",children:pe.remoteUrl}),pe.remoteType&&s.jsx("p",{className:"text-xs text-destructive",children:pe.remoteType})]}),le.trim()&&s.jsxs("div",{className:"col-span-2 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(F,{type:"button",variant:"outline",size:"sm",className:J(ht,"gap-1.5"),onClick:st,disabled:g==="loading",children:[g==="loading"?s.jsx(mt,{size:12,className:"animate-spin"}):s.jsx(es,{size:12}),g==="loading"?"Discovering tools...":Ce.length>0?"Re-discover tools":"Discover tools from URL"]}),Ce.length>0&&g!=="loading"&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:[Ce.length," tool",Ce.length!==1?"s":""," loaded"]})]}),g==="success"&&Ce.length>0&&s.jsxs("div",{className:"rounded-lg border border-green-500/20 bg-green-50 dark:bg-green-950/20 px-3 py-2 space-y-1.5",children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs text-green-600 dark:text-green-400",children:[s.jsx(bt,{size:14,className:"shrink-0"}),s.jsxs("span",{className:"font-medium",children:[Ce.length," tool",Ce.length!==1?"s":""," discovered"]})]}),s.jsxs("div",{className:"flex flex-wrap gap-1",children:[Ce.slice(0,8).map(A=>s.jsx(U,{variant:"secondary",className:"text-[10px] px-1.5 py-0 font-mono",children:A.name},A.name)),Ce.length>8&&s.jsxs("span",{className:"text-[10px] text-muted-foreground self-center",children:["+",Ce.length-8," more"]})]}),s.jsx("p",{className:"text-[10px] text-muted-foreground",children:"These tools will enrich AI-generated descriptions, tags and categories in the next step."})]}),g==="auth_required"&&C&&s.jsxs("div",{className:"flex items-center gap-2 text-xs text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-950/20 border border-amber-500/20 rounded-lg px-3 py-2",children:[s.jsx(jt,{size:14,className:"shrink-0"}),s.jsx("span",{children:"This server requires authentication. The connection is valid but tools cannot be listed without credentials."})]}),g==="error"&&C&&s.jsxs("div",{className:"flex items-center gap-2 text-xs text-destructive bg-destructive/10 rounded-lg px-3 py-2",children:[s.jsx(jt,{size:14,className:"shrink-0"}),s.jsx("span",{children:C})]})]})]}),Js=s.jsxs("div",{className:"grid gap-3",children:[s.jsxs("div",{className:"grid gap-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(ie,{htmlFor:"registry-item-short-description",children:"Short Description"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:[re.length,"/160"]}),Ee&&s.jsx(F,{type:"button",variant:"outline",size:"sm",className:ht,disabled:d==="short_description",onClick:it,children:d==="short_description"?"Generating...":"AI Generate"})]})]}),s.jsx(ye,{id:"registry-item-short-description",className:"h-9 text-sm",placeholder:"Short summary for the store card",value:re,maxLength:160,onChange:A=>ae(A.target.value)}),pe.shortDescription&&s.jsx("p",{className:"text-xs text-destructive",children:pe.shortDescription})]}),s.jsxs("div",{className:"grid gap-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(ie,{htmlFor:"registry-item-description",children:"Description"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:[se.length,"/1500"]}),Ee&&s.jsx(F,{type:"button",variant:"outline",size:"sm",className:ht,disabled:d==="description",onClick:rt,children:d==="description"?"Generating...":"AI Generate"})]})]}),s.jsx(At,{id:"registry-item-description",className:"text-sm max-h-28 overflow-y-auto resize-none",placeholder:"Brief description of this MCP server",rows:2,value:se,onChange:A=>he(A.target.value)}),pe.description&&s.jsx("p",{className:"text-xs text-destructive",children:pe.description})]}),s.jsx("div",{className:"border-t border-border"}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{className:"grid content-start gap-2",children:[s.jsx(Sr,{id:"registry-category",value:ee,availableOptions:l,onChange:Te}),Ee&&s.jsx(F,{type:"button",variant:"outline",size:"sm",className:J(ht,"justify-self-start"),disabled:d==="categories",onClick:ke,children:d==="categories"?"Suggesting...":"AI Suggest"})]}),s.jsxs("div",{className:"grid content-start gap-2",children:[s.jsx(Cr,{id:"registry-tags",label:"Tags",values:Re,availableOptions:[...xs,...o],placeholder:"Type and press Enter or comma",onChange:O}),Ee&&s.jsx(F,{type:"button",variant:"outline",size:"sm",className:J(ht,"justify-self-start"),disabled:d==="tags",onClick:Q,children:d==="tags"?"Suggesting...":"AI Suggest"})]})]}),s.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-border px-4 py-3",children:[s.jsxs("div",{className:"grid gap-0.5",children:[s.jsx(ie,{htmlFor:"registry-is-public",className:"text-sm",children:"Public"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Make this MCP visible in the public store URL."})]}),s.jsx(_t,{id:"registry-is-public",checked:Ze,onCheckedChange:at})]})]}),Zs=s.jsxs("div",{className:"grid gap-3",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx(ie,{htmlFor:"registry-item-owner",children:"Owner (optional)"}),s.jsx(ye,{id:"registry-item-owner",className:"h-9 text-sm",placeholder:"Team, company, or responsible person",value:oe,onChange:A=>me(A.target.value)})]}),s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx(ie,{htmlFor:"registry-item-repository-url",children:"Repository URL (optional)"}),s.jsx(ye,{id:"registry-item-repository-url",className:"h-9 text-sm",placeholder:"https://github.com/org/repo",value:ce,onChange:A=>ue(A.target.value)}),pe.repositoryUrl&&s.jsx("p",{className:"text-xs text-destructive",children:pe.repositoryUrl})]})]}),s.jsxs("div",{className:"rounded-xl border border-border p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(ie,{children:"README"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ve.length,"/50000"]})]}),s.jsx("div",{className:"inline-flex rounded-lg border border-border p-0.5",children:(Ee?["link","content","generate"]:["link","content"]).map(A=>s.jsx("button",{type:"button",className:J("px-2.5 py-1 text-xs rounded-md",xe===A?"bg-primary text-primary-foreground":"text-muted-foreground"),onClick:()=>Ne(A),children:A==="link"?"Link":A==="content"?"Content":"Generate"},A))}),xe==="link"&&s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx(ye,{className:"h-9 text-sm",placeholder:"https://raw.githubusercontent.com/org/repo/main/README.md",value:je,onChange:A=>Ie(A.target.value)}),pe.readmeUrl&&s.jsx("p",{className:"text-xs text-destructive",children:pe.readmeUrl})]}),xe==="content"&&s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx(At,{className:"text-sm max-h-48 overflow-y-auto resize-none",placeholder:`# README
4
4
 
@@ -1 +1 @@
1
- import"./index-CuIrPKu9.js";import{c as s}from"./constants-C56FepeM.js";function m(t){if(!t)return"";const r=t.find(n=>n.name==="COLLECTION_REGISTRY_APP_LIST");if(r)return r.name;const e=t.find(n=>n.name==="REGISTRY_ITEM_LIST");if(e)return e.name;const i=t.find(n=>n.name.startsWith("COLLECTION_REGISTRY_APP_")&&n.name.endsWith("_LIST"));return i?i.name:""}function o(t){if(!t)return"";const r=t.find(n=>n.name==="COLLECTION_REGISTRY_APP_FILTERS");if(r)return r.name;const e=t.find(n=>n.name==="REGISTRY_ITEM_FILTERS");if(e)return e.name;const i=t.find(n=>n.name.startsWith("COLLECTION_REGISTRY_APP_")&&n.name.endsWith("_FILTERS"));return i?i.name:""}function I(t,r){if(!t)return"";const e=t.find(f=>f.name===`COLLECTION_REGISTRY_APP${r}`);if(e)return e.name;const i={_GET:"REGISTRY_ITEM_GET",_VERSIONS:"REGISTRY_ITEM_VERSIONS",_SEARCH:"REGISTRY_ITEM_SEARCH"},n=t.find(f=>f.name===i[r]);if(n)return n.name;const a=t.find(f=>f.name.startsWith("COLLECTION_REGISTRY_APP_")&&f.name.endsWith(r));return a?a.name:""}function R(t){if(!t)return[];const r=[];for(const e of t){let i=[];if(Array.isArray(e))i=e;else if(typeof e=="object"&&e!==null){const n=Object.keys(e).find(a=>Array.isArray(e[a]));n&&(i=e[n])}r.push(...i)}return r}const c={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function E(t){return t?c[t]??t.toUpperCase():null}function _(t){return t?t.match(/schemas\/([\d-]+)/)?.[1]??null:null}function S(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const r=Object.keys(t).find(e=>Array.isArray(t[e]));if(r)return t[r]}return[]}async function d(t,r,e,i){const n=await s({connectionId:t,orgId:r});try{const a=await n.callTool({name:e,arguments:i});return a.structuredContent??a}finally{await n.close().catch(console.error)}}export{R as a,o as b,d as c,I as d,S as e,m as f,E as g,_ as h};
1
+ import"./index-DXIsw0zh.js";import{c as s}from"./constants-D3TKhQyR.js";function m(t){if(!t)return"";const r=t.find(n=>n.name==="COLLECTION_REGISTRY_APP_LIST");if(r)return r.name;const e=t.find(n=>n.name==="REGISTRY_ITEM_LIST");if(e)return e.name;const i=t.find(n=>n.name.startsWith("COLLECTION_REGISTRY_APP_")&&n.name.endsWith("_LIST"));return i?i.name:""}function o(t){if(!t)return"";const r=t.find(n=>n.name==="COLLECTION_REGISTRY_APP_FILTERS");if(r)return r.name;const e=t.find(n=>n.name==="REGISTRY_ITEM_FILTERS");if(e)return e.name;const i=t.find(n=>n.name.startsWith("COLLECTION_REGISTRY_APP_")&&n.name.endsWith("_FILTERS"));return i?i.name:""}function I(t,r){if(!t)return"";const e=t.find(f=>f.name===`COLLECTION_REGISTRY_APP${r}`);if(e)return e.name;const i={_GET:"REGISTRY_ITEM_GET",_VERSIONS:"REGISTRY_ITEM_VERSIONS",_SEARCH:"REGISTRY_ITEM_SEARCH"},n=t.find(f=>f.name===i[r]);if(n)return n.name;const a=t.find(f=>f.name.startsWith("COLLECTION_REGISTRY_APP_")&&f.name.endsWith(r));return a?a.name:""}function R(t){if(!t)return[];const r=[];for(const e of t){let i=[];if(Array.isArray(e))i=e;else if(typeof e=="object"&&e!==null){const n=Object.keys(e).find(a=>Array.isArray(e[a]));n&&(i=e[n])}r.push(...i)}return r}const c={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function E(t){return t?c[t]??t.toUpperCase():null}function _(t){return t?t.match(/schemas\/([\d-]+)/)?.[1]??null:null}function S(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const r=Object.keys(t).find(e=>Array.isArray(t[e]));if(r)return t[r]}return[]}async function d(t,r,e,i){const n=await s({connectionId:t,orgId:r});try{const a=await n.callTool({name:e,arguments:i});return a.structuredContent??a}finally{await n.close().catch(console.error)}}export{R as a,o as b,d as c,I as d,S as e,m as f,E as g,_ as h};