@decocms/mesh 2.38.2 → 2.38.3

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 (131) hide show
  1. package/dist/client/assets/{AlertCircle-z3xwiUwg.js → AlertCircle-DwLOjdfH.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-BkoJglZy.js → ArrowLeft-kGx3Y-zX.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-BAMBJKzk.js → ArrowUp-DWcXOBpz.js} +1 -1
  4. package/dist/client/assets/{Check-BK9-0hKa.js → Check-B2vj72U5.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-PIP2u0bO.js → ChevronDown-Vb06lc-B.js} +1 -1
  6. package/dist/client/assets/{Code01-Bur40qHc.js → Code01-DwHTWnoR.js} +1 -1
  7. package/dist/client/assets/{Copy01-BOhF0ZEB.js → Copy01-BAk05E9H.js} +1 -1
  8. package/dist/client/assets/{CpuChip02-BTAUjBs1.js → CpuChip02-DbAeAdPe.js} +1 -1
  9. package/dist/client/assets/{DotsHorizontal-DxGrUc9a.js → DotsHorizontal-Cj7CLHDn.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-D61roAg3.js → DotsVertical-XYYRNoTX.js} +1 -1
  11. package/dist/client/assets/{Download01-DH0bL3Nt.js → Download01-CHXxU49K.js} +1 -1
  12. package/dist/client/assets/{Edit01-DINJ246_.js → Edit01-B9xu7jSw.js} +1 -1
  13. package/dist/client/assets/{File06-DVkrNas0.js → File06-D7bjpxHc.js} +1 -1
  14. package/dist/client/assets/{FilterLines-so_Nzmiv.js → FilterLines-CIEdE4Wb.js} +1 -1
  15. package/dist/client/assets/{FlipBackward-iQ8t51Yv.js → FlipBackward-CRoccaVQ.js} +1 -1
  16. package/dist/client/assets/{GitBranch01-T4MUtqYK.js → GitBranch01-B_LsZRsF.js} +1 -1
  17. package/dist/client/assets/{Grid01-CN_8958k.js → Grid01-DvrY1gt1.js} +1 -1
  18. package/dist/client/assets/{Home02-DuEnlN2j.js → Home02-_JdnGU0Y.js} +1 -1
  19. package/dist/client/assets/{Image01-CAZIUcM5.js → Image01-WlrQGekP.js} +1 -1
  20. package/dist/client/assets/{Inbox01-CM3kHNUT.js → Inbox01-Cx7mk7qN.js} +1 -1
  21. package/dist/client/assets/{InfoCircle-yeMjcoma.js → InfoCircle-BV74k_Yn.js} +1 -1
  22. package/dist/client/assets/{Key01-9yBwokED.js → Key01-CRs4BGmx.js} +1 -1
  23. package/dist/client/assets/{LinkExternal01-DVQPzyFK.js → LinkExternal01-H-oJkxYN.js} +1 -1
  24. package/dist/client/assets/{List-BuWxjuK8.js → List-BCcNlZrf.js} +1 -1
  25. package/dist/client/assets/{Loading01-D1yLQLik.js → Loading01-Dul6ue0E.js} +1 -1
  26. package/dist/client/assets/{Lock01-RqyglEYd.js → Lock01-Cy1pPqT8.js} +1 -1
  27. package/dist/client/assets/{Play-DVdw4qV-.js → Play-BpLCryum.js} +1 -1
  28. package/dist/client/assets/{Plus-Je-soon7.js → Plus-BVDMzeyp.js} +1 -1
  29. package/dist/client/assets/{SearchMd-CbtolPap.js → SearchMd-jGEmiNrX.js} +1 -1
  30. package/dist/client/assets/{Terminal-DYGeKWvi.js → Terminal-CE84-sCv.js} +1 -1
  31. package/dist/client/assets/{Trash01-CZvA_s0Y.js → Trash01-B0ak1X_N.js} +1 -1
  32. package/dist/client/assets/{Upload01-DhaDMFFD.js → Upload01-C0kHDVw4.js} +1 -1
  33. package/dist/client/assets/{X-sxVQmAsr.js → X-BLWQxpEf.js} +1 -1
  34. package/dist/client/assets/{XClose-zzu-jidq.js → XClose-DB-yTUBg.js} +1 -1
  35. package/dist/client/assets/{agent-detail-BlRpinmR.js → agent-detail-DmNNNO27.js} +1 -1
  36. package/dist/client/assets/{agents-DknJreAQ.js → agents-Cc3M23qv.js} +1 -1
  37. package/dist/client/assets/{alert-dialog-CVkwkecf.js → alert-dialog-djFlPxmw.js} +1 -1
  38. package/dist/client/assets/{auth-catchall-w4I8mOfz.js → auth-catchall-BJHCOfwt.js} +1 -1
  39. package/dist/client/assets/{avatar-C9tVSVlv.js → avatar-B5p9MTms.js} +1 -1
  40. package/dist/client/assets/{badge-C7J4I2Hj.js → badge-BSYGnPtt.js} +1 -1
  41. package/dist/client/assets/{binder-CbjhFDGc.js → binder-DWCHeQZ9.js} +1 -1
  42. package/dist/client/assets/{button-CceSuFKi.js → button-AdEzXtPt.js} +1 -1
  43. package/dist/client/assets/{card-BGHb8OmC.js → card-CQNrgAR3.js} +1 -1
  44. package/dist/client/assets/{checkbox-Cu04V43g.js → checkbox-3cM8_JBb.js} +1 -1
  45. package/dist/client/assets/{collection-detail-D2oIsKq-.js → collection-detail-BOnOtOYD.js} +1 -1
  46. package/dist/client/assets/{collection-display-button-Df_9WgFb.js → collection-display-button-DpjzbbIn.js} +1 -1
  47. package/dist/client/assets/{collection-header-COgMCOx8.js → collection-header-B4-DpfAL.js} +1 -1
  48. package/dist/client/assets/{collection-page-DVakSZpa.js → collection-page-b5lRP5ne.js} +1 -1
  49. package/dist/client/assets/{collection-search-Fe3W5Myr.js → collection-search-DqVEDOqS.js} +1 -1
  50. package/dist/client/assets/{collection-tab-_C4vj95J.js → collection-tab-BQhJW6AS.js} +1 -1
  51. package/dist/client/assets/{collection-table-wrapper-VkF3O5dC.js → collection-table-wrapper-B8ubC3Sh.js} +1 -1
  52. package/dist/client/assets/{connection-card-Bq9AH0T5.js → connection-card-C7f1dOrX.js} +1 -1
  53. package/dist/client/assets/{connection-detail-CbrkwDLO.js → connection-detail-RVxHc67u.js} +1 -1
  54. package/dist/client/assets/{connections-unSJ25xy.js → connections-Bv_34Usi.js} +1 -1
  55. package/dist/client/assets/{constants-DqnLzZpL.js → constants-BEKdbCo6.js} +1 -1
  56. package/dist/client/assets/constants-C88aG7V1.js +1 -0
  57. package/dist/client/assets/{create-organization-dialog-DCA75BPi.js → create-organization-dialog-BW4DOW5y.js} +1 -1
  58. package/dist/client/assets/{dialog-CL6M-Xmi.js → dialog-DLbo5T8N.js} +1 -1
  59. package/dist/client/assets/{dropdown-menu-BMu3zBVo.js → dropdown-menu-CM0mCcd3.js} +1 -1
  60. package/dist/client/assets/{dynamic-plugin-layout-CKzehx9R.js → dynamic-plugin-layout-DQFkQzWH.js} +1 -1
  61. package/dist/client/assets/{empty-state-BHdJzPJs.js → empty-state-BrUv9lsZ.js} +1 -1
  62. package/dist/client/assets/{empty-state-B0xeJKH5.js → empty-state-DZFeepnb.js} +1 -1
  63. package/dist/client/assets/{env-vars-editor-CtvDpSON.js → env-vars-editor-BAOHiLu2.js} +1 -1
  64. package/dist/client/assets/{error-boundary-vgLVbtql.js → error-boundary-DaCO9OCg.js} +1 -1
  65. package/dist/client/assets/{extract-connection-data-w2VKbBVM.js → extract-connection-data-C1X2zeqi.js} +1 -1
  66. package/dist/client/assets/{file-browser-C_o-XRN_.js → file-browser-DW6TJdZX.js} +2 -2
  67. package/dist/client/assets/{form-DWBp_92q.js → form-D8bvI4tc.js} +1 -1
  68. package/dist/client/assets/{grid-view-D4uG2rz_.js → grid-view-BLOYnzFT.js} +1 -1
  69. package/dist/client/assets/{home-tcH3yRYZ.js → home-DlKoJ54P.js} +1 -1
  70. package/dist/client/assets/{index-CQ6L3uZi.js → index-By7Mca_U.js} +1 -1
  71. package/dist/client/assets/{index-DimTMp-G.js → index-Ck_HNGGd.js} +2 -2
  72. package/dist/client/assets/{index-CUpy3pKS.js → index-CtrgR5Sj.js} +1 -1
  73. package/dist/client/assets/{index-D4QmV-sc.js → index-DSyGEqnv.js} +1 -1
  74. package/dist/client/assets/{index-D1MpJYf1.js → index-Dpe1Ly1c.js} +1 -1
  75. package/dist/client/assets/{index-BfBspZNA.js → index-I1CjKwfa.js} +1 -1
  76. package/dist/client/assets/{infiniteQueryObserver-DeWE7Mv6.js → infiniteQueryObserver-yBeVIl9y.js} +1 -1
  77. package/dist/client/assets/{input-BzZt5UMQ.js → input-BD07TV73.js} +1 -1
  78. package/dist/client/assets/{layout-DqvUpliw.js → layout-CtPQmm1R.js} +1 -1
  79. package/dist/client/assets/{localstorage-keys-Pb1bSOSH.js → localstorage-keys-bIhPsHqu.js} +1 -1
  80. package/dist/client/assets/{login-Bw3mNwou.js → login-DsME5Q78.js} +1 -1
  81. package/dist/client/assets/{mcp-oauth-DVTAVhIy.js → mcp-oauth-nsjatGUX.js} +1 -1
  82. package/dist/client/assets/{mcp-server-card-BOsrfsoy.js → mcp-server-card-Bhmbue9c.js} +1 -1
  83. package/dist/client/assets/{mcp-server-detail-DL4a0l-I.js → mcp-server-detail-B4am-5Te.js} +2 -2
  84. package/dist/client/assets/{members-CaWwLwBY.js → members-BB0T9TqV.js} +1 -1
  85. package/dist/client/assets/{monaco-editor-C3l8YLnM.js → monaco-editor-CP1tDtbL.js} +1 -1
  86. package/dist/client/assets/{monitoring-BXzU__Q2.js → monitoring-PT-sW85P.js} +2 -2
  87. package/dist/client/assets/{oauth-callback-C29sykPI.js → oauth-callback-B-DW0xRP.js} +1 -1
  88. package/dist/client/assets/{page-D9f3s0Zn.js → page-Cc8e_HoP.js} +1 -1
  89. package/dist/client/assets/{page-DFTluz6T.js → page-rhO8Ndm_.js} +2 -2
  90. package/dist/client/assets/{pin-to-sidebar-button-a3_Q5PIg.js → pin-to-sidebar-button-C0LI8OyX.js} +1 -1
  91. package/dist/client/assets/{plugin-empty-state-gioOq0db.js → plugin-empty-state-Snmmscpf.js} +1 -1
  92. package/dist/client/assets/{plugin-header-OS_VhXuY.js → plugin-header-CQUxkpkP.js} +1 -1
  93. package/dist/client/assets/{plugins-6jaAX9OI.js → plugins-Z6bDUs1U.js} +1 -1
  94. package/dist/client/assets/{popover-DCXtR4UV.js → popover-C2dO17KJ.js} +1 -1
  95. package/dist/client/assets/{registry-utils-B1EtgBkU.js → registry-utils-BE0ZphJL.js} +1 -1
  96. package/dist/client/assets/{resizable-C5jfRumR.js → resizable-C65jXR9m.js} +1 -1
  97. package/dist/client/assets/{resource-tabs-BNBJ-3ue.js → resource-tabs-CMKv9MLy.js} +1 -1
  98. package/dist/client/assets/{select-DVxy4dZt.js → select-DjQ5i8qH.js} +1 -1
  99. package/dist/client/assets/{settings-DlMrUAFl.js → settings-B6WkV5Xi.js} +1 -1
  100. package/dist/client/assets/{shell-layout-C02QmtDM.js → shell-layout-BAq9UL-m.js} +1 -1
  101. package/dist/client/assets/{spinner-BK_gptNQ.js → spinner-D1jlVRw-.js} +1 -1
  102. package/dist/client/assets/{switch-BEUY1ZkG.js → switch-VxY_iYFv.js} +1 -1
  103. package/dist/client/assets/{textarea-Dok2BUMd.js → textarea-Ca9yvCmH.js} +1 -1
  104. package/dist/client/assets/{tool-set-selector-BPpD_gne.js → tool-set-selector-Gam2FuD6.js} +1 -1
  105. package/dist/client/assets/{tools-list-eucrhDw_.js → tools-list-NAnIcc4C.js} +1 -1
  106. package/dist/client/assets/{tooltip-BotDoy6T.js → tooltip-CXbR3les.js} +1 -1
  107. package/dist/client/assets/{typewriter-title-C0AyXxMG.js → typewriter-title-C-fZ8H0Y.js} +1 -1
  108. package/dist/client/assets/{use-binding-Dj1HVNst.js → use-binding-Bio_IG23.js} +1 -1
  109. package/dist/client/assets/{use-collections-Vpvt2q4e.js → use-collections-BtupqZP_.js} +1 -1
  110. package/dist/client/assets/{use-connection-DTjI_RtQ.js → use-connection-Dd7Yvjif.js} +1 -1
  111. package/dist/client/assets/{use-create-virtual-mcp-Jf2xsGTe.js → use-create-virtual-mcp-fvY3FmjO.js} +1 -1
  112. package/dist/client/assets/{use-list-state-Bzarl2oM.js → use-list-state-D5d2Dsd0.js} +1 -1
  113. package/dist/client/assets/{use-members-BtNqo2oh.js → use-members-fszl9icN.js} +1 -1
  114. package/dist/client/assets/{use-mobile-CcOC6HBd.js → use-mobile-jDYVRPrZ.js} +1 -1
  115. package/dist/client/assets/{use-organization-settings-CwiS3zFY.js → use-organization-settings-DjIJdwlh.js} +1 -1
  116. package/dist/client/assets/{use-virtual-mcp-hN6G5B_j.js → use-virtual-mcp-wPhrZ9RR.js} +1 -1
  117. package/dist/client/assets/useInfiniteQuery-BVNnXO_N.js +1 -0
  118. package/dist/client/assets/{useMutation-d4_WWA7-.js → useMutation-BucpIOAt.js} +1 -1
  119. package/dist/client/assets/useQuery-Zp-sAZMS.js +1 -0
  120. package/dist/client/assets/{value-BHid2kuo.js → value-E9Fqy7St.js} +1 -1
  121. package/dist/client/assets/{view-mode-toggle-DhWV5fbM.js → view-mode-toggle-CR_cIdX-.js} +1 -1
  122. package/dist/client/assets/{virtual-mcp-Dyh0Ag7o.js → virtual-mcp-CLFdFi_E.js} +1 -1
  123. package/dist/client/assets/{workflow-Bw7jESqY.js → workflow-DJOiUaHZ.js} +1 -1
  124. package/dist/client/index.html +1 -1
  125. package/dist/server/cli.js +2 -2
  126. package/dist/server/migrate.js +2 -2
  127. package/dist/server/server.js +2 -2
  128. package/package.json +1 -1
  129. package/dist/client/assets/constants-CrS7edVE.js +0 -1
  130. package/dist/client/assets/useInfiniteQuery-B-B7Ix7h.js +0 -1
  131. package/dist/client/assets/useQuery-BMYUlGUP.js +0 -1
@@ -1 +1 @@
1
- import{r as i,j as e}from"./index-DimTMp-G.js";import{i as n}from"./Loading01-D1yLQLik.js";import{h as l}from"./mcp-oauth-DVTAVhIy.js";function h(){const[s,c]=i.useState(null),[r,a]=i.useState(!1);return i.useEffect(()=>{(async()=>{try{const t=await l();if(!t.success){c(t.error||"MCP authentication failed"),setTimeout(()=>{window.close()},3e3);return}a(!0),setTimeout(()=>{window.close()},1500)}catch(t){c(t instanceof Error?t.message:String(t)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!s&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{size:32,className:"animate-spin text-primary"})}),s&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:s?"Authentication Failed":r?"Authentication Successful":"Authentication in progress..."}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:s}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),"This window will close automatically."]})]}):r?e.jsxs("p",{children:["Authentication complete.",e.jsx("br",{}),"This window will close automatically."]}):e.jsx("p",{children:"Processing authentication..."})})]})]})})}export{h as default};
1
+ import{r as i,j as e}from"./index-Ck_HNGGd.js";import{i as n}from"./Loading01-Dul6ue0E.js";import{h as l}from"./mcp-oauth-nsjatGUX.js";function h(){const[s,c]=i.useState(null),[r,a]=i.useState(!1);return i.useEffect(()=>{(async()=>{try{const t=await l();if(!t.success){c(t.error||"MCP authentication failed"),setTimeout(()=>{window.close()},3e3);return}a(!0),setTimeout(()=>{window.close()},1500)}catch(t){c(t instanceof Error?t.message:String(t)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!s&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{size:32,className:"animate-spin text-primary"})}),s&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:s?"Authentication Failed":r?"Authentication Successful":"Authentication in progress..."}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:s}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),"This window will close automatically."]})]}):r?e.jsxs("p",{children:["Authentication complete.",e.jsx("br",{}),"This window will close automatically."]}):e.jsx("p",{children:"Processing authentication..."})})]})]})})}export{h as default};
@@ -1 +1 @@
1
- import{c as G,r as M,i as de,K as se,bp as fe,j as s,e as oe,d as ue,b8 as xe,aD as pe}from"./index-DimTMp-G.js";import{C as ge}from"./collection-header-COgMCOx8.js";import{i as ne}from"./FilterLines-so_Nzmiv.js";import{n as he}from"./Inbox01-CM3kHNUT.js";import{i as J}from"./Loading01-D1yLQLik.js";import{i as ie}from"./SearchMd-CbtolPap.js";import{u as je}from"./useInfiniteQuery-B-B7Ix7h.js";import{a as ve,f as ye,b as Ne}from"./registry-utils-B1EtgBkU.js";import{u as Z}from"./virtual-mcp-Dyh0Ag7o.js";import{u as Ce,a as be,b as Se}from"./constants-DqnLzZpL.js";import{b as we,u as ae,a as Te}from"./use-connection-DTjI_RtQ.js";import{s as Ie}from"./slugify-CEUa2lfQ.js";import{C as Re}from"./collection-search-Fe3W5Myr.js";import{M as le}from"./mcp-server-card-BOsrfsoy.js";import{c as ce,B as Q}from"./button-CceSuFKi.js";import{I as Pe}from"./input-BzZt5UMQ.js";import{P as $e,a as ke,b as ze}from"./popover-DCXtR4UV.js";import{i as Fe}from"./Check-BK9-0hKa.js";import{t as Le}from"./ChevronDown-PIP2u0bO.js";import{s as Y}from"./XClose-zzu-jidq.js";import{d as Ke,a as Ae,b as Ee,c as De,S as Me}from"./select-DVxy4dZt.js";import{s as Be}from"./Plus-Je-soon7.js";import{E as Ve}from"./empty-state-B0xeJKH5.js";import{u as Oe}from"./use-binding-Dj1HVNst.js";import{L as We,u as qe}from"./localstorage-keys-Pb1bSOSH.js";import"./collection-display-button-Df_9WgFb.js";import"./dropdown-menu-BMu3zBVo.js";import"./Grid01-CN_8958k.js";import"./ArrowUp-BAMBJKzk.js";import"./List-BuWxjuK8.js";import"./tooltip-BotDoy6T.js";import"./view-mode-toggle-DhWV5fbM.js";import"./infiniteQueryObserver-DeWE7Mv6.js";import"./use-collections-Vpvt2q4e.js";import"./useMutation-d4_WWA7-.js";import"./useQuery-BMYUlGUP.js";import"./Lock01-RqyglEYd.js";import"./Terminal-DYGeKWvi.js";import"./card-BGHb8OmC.js";import"./github-icon-Dp3wHhYE.js";import"./binder-CbjhFDGc.js";function _e(t,e){const l=G.c(4),[o,c]=M.useState(t),r=M.useRef(null),a=M.useRef(!0);let i,d;return l[0]!==e||l[1]!==t?(i=()=>{if(a.current){a.current=!1;return}return r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{c(t)},e),()=>{r.current&&clearTimeout(r.current)}},d=[t,e],l[0]=e,l[1]=t,l[2]=i,l[3]=d):(i=l[2],d=l[3]),M.useEffect(i,d),o}function Ge(t){const e=G.c(14),l=M.useRef(null),o=`scroll-position:${t}`,c=M.useRef(null);let r;e[0]!==o?(r=()=>{l.current&&sessionStorage.setItem(o,String(l.current.scrollTop))},e[0]=o,e[1]=r):r=e[1];const a=r;let i;e[2]!==o?(i=()=>{if(c.current===o)return;const f=sessionStorage.getItem(o);if(f&&l.current){const j=Number.parseInt(f,10);l.current.scrollTop=j}c.current=o},e[2]=o,e[3]=i):i=e[3];const d=i;let y;e[4]!==d||e[5]!==o?(y=()=>{c.current!==o&&d()},e[4]=d,e[5]=o,e[6]=y):y=e[6];const h=y;let n;e[7]!==d||e[8]!==o?(n=f=>{l.current=f,f&&c.current!==o&&requestAnimationFrame(()=>{d()})},e[7]=d,e[8]=o,e[9]=n):n=e[9];const N=n;let u;return e[10]!==h||e[11]!==a||e[12]!==N?(u={scrollRef:N,saveScrollPosition:a,handleScroll:h},e[10]=h,e[11]=a,e[12]=N,e[13]=u):u=e[13],u}const He=24;function Qe(t){const e=G.c(53),{registryId:l,listToolName:o,filtersToolName:c,search:r}=t,{org:a}=Z();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[0]=i):i=e[0];const[d,y]=M.useState(i);let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[1]=h):h=e[1];const[n,N]=M.useState(h),u=l||null;let f;e[2]!==a.id||e[3]!==u?(f={connectionId:u,orgId:a.id},e[2]=a.id,e[3]=u,e[4]=f):f=e[4];const j=Ce(f),R=!!c;let C;e[5]!==c||e[6]!==l?(C=se.toolCall(l,c||"no-filters","{}"),e[5]=c,e[6]=l,e[7]=C):C=e[7];let b;e[8]!==j||e[9]!==c?(b=async()=>{if(!c)return{tags:[],categories:[]};const D=await j.callTool({name:c,arguments:{}});return D.structuredContent??D},e[8]=j,e[9]=c,e[10]=b):b=e[10];let k;e[11]!==C||e[12]!==b?(k={queryKey:C,queryFn:b,staleTime:36e5},e[11]=C,e[12]=b,e[13]=k):k=e[13];const{data:P}=de(k);let v,S,T;if(e[14]!==o||e[15]!==l||e[16]!==r||e[17]!==n||e[18]!==d){const D=r?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:r},{field:["title"],operator:"contains",value:r},{field:["description"],operator:"contains",value:r}]}:void 0;v={limit:He,...d.length>0&&{tags:d},...n.length>0&&{categories:n},...D&&{where:D}},T=je,S=se.toolCall(l,o,JSON.stringify(v)),e[14]=o,e[15]=l,e[16]=r,e[17]=n,e[18]=d,e[19]=v,e[20]=S,e[21]=T}else v=e[19],S=e[20],T=e[21];let I;e[22]!==j||e[23]!==v||e[24]!==o?(I=async D=>{const{pageParam:ee}=D,me=ee?{...v,cursor:ee}:v,te=await j.callTool({name:o,arguments:me});return te.structuredContent??te},e[22]=j,e[23]=v,e[24]=o,e[25]=I):I=e[25];let z;e[26]!==I||e[27]!==S?(z={queryKey:S,queryFn:I,initialPageParam:void 0,getNextPageParam:Ue,staleTime:36e5,placeholderData:fe},e[26]=I,e[27]=S,e[28]=z):z=e[28];const{data:L,fetchNextPage:$,hasNextPage:m,isFetchingNextPage:x,isFetching:p,isLoading:w}=T(z);let F;e:{if(!L?.pages||L.pages.length===0){F=null;break e}const D=L.pages[0];if(typeof D=="object"&&D!==null&&"totalCount"in D&&typeof D.totalCount=="number"){F=D.totalCount;break e}F=null}const g=F,K=L?.pages;let A;e[29]!==K?(A=ve(K),e[29]=K,e[30]=A):A=e[30];const E=A;let V;e[31]!==r||e[32]!==n.length||e[33]!==d.length?(V=d.length>0||n.length>0||!!r?.trim(),e[31]=r,e[32]=n.length,e[33]=d.length,e[34]=V):V=e[34];const O=V,q=p&&!x&&!w&&O;let _;e[35]!==$||e[36]!==m||e[37]!==x?(_=()=>{m&&!x&&$()},e[35]=$,e[36]=m,e[37]=x,e[38]=_):_=e[38];const B=_,W=m??!1,H=R?P?.tags:void 0,X=R?P?.categories:void 0;let U;return e[39]!==O||e[40]!==p||e[41]!==x||e[42]!==q||e[43]!==w||e[44]!==E||e[45]!==B||e[46]!==n||e[47]!==d||e[48]!==W||e[49]!==H||e[50]!==X||e[51]!==g?(U={items:E,totalCount:g,hasMore:W,isLoadingMore:x,isFiltering:q,isInitialLoading:w,isFetching:p,loadMore:B,availableTags:H,availableCategories:X,selectedTags:d,selectedCategories:n,setSelectedTags:y,setSelectedCategories:N,hasActiveFilters:O},e[39]=O,e[40]=p,e[41]=x,e[42]=q,e[43]=w,e[44]=E,e[45]=B,e[46]=n,e[47]=d,e[48]=W,e[49]=H,e[50]=X,e[51]=g,e[52]=U):U=e[52],U}function Ue(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function Ye(t,e){return[...t].sort((l,o)=>o.count-l.count).slice(0,e)}function re(t){const e=G.c(52),{label:l,items:o,selectedItems:c,onToggle:r,onClear:a}=t,[i,d]=M.useState(""),[y,h]=M.useState(!1);let n,N,u,f,j,R,C,b,k,P,v;if(e[0]!==o||e[1]!==l||e[2]!==r||e[3]!==y||e[4]!==i||e[5]!==c){const $=[...i?o.filter(A=>A.value.toLowerCase().includes(i.toLowerCase())):o].sort(Je);u=c.length,N=$e,k=y,P=h;let m;e[17]!==l?(m=s.jsx("span",{children:l}),e[17]=l,e[18]=m):m=e[18];let x;e[19]!==u?(x=u>0&&s.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:u}),e[19]=u,e[20]=x):x=e[20];let p;e[21]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Le,{size:14,className:"opacity-50"}),e[21]=p):p=e[21],e[22]!==x||e[23]!==m?(v=s.jsx(ke,{asChild:!0,children:s.jsxs(Q,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[m,x,p]})}),e[22]=x,e[23]=m,e[24]=v):v=e[24],n=ze,R="w-64 p-0",C="start";let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(ie,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=w):w=e[25];let F;e[26]!==l?(F=l.toLowerCase(),e[26]=l,e[27]=F):F=e[27];const g=`Search ${F}...`;let K;e[28]===Symbol.for("react.memo_cache_sentinel")?(K=A=>d(A.target.value),e[28]=K):K=e[28],e[29]!==i||e[30]!==g?(b=s.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[w,s.jsx(Pe,{type:"text",placeholder:g,value:i,onChange:K,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=i,e[30]=g,e[31]=b):b=e[31],f="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",j=$.length===0?s.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):$.map(A=>{const E=c.includes(A.value);return s.jsxs("button",{onClick:()=>r(A.value),className:ce("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",E?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[s.jsxs("span",{className:"truncate flex items-center gap-2",children:[E&&s.jsx(Fe,{size:16,className:"text-muted-foreground shrink-0"}),A.value]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:A.count})]},A.value)}),e[0]=o,e[1]=l,e[2]=r,e[3]=y,e[4]=i,e[5]=c,e[6]=n,e[7]=N,e[8]=u,e[9]=f,e[10]=j,e[11]=R,e[12]=C,e[13]=b,e[14]=k,e[15]=P,e[16]=v}else n=e[6],N=e[7],u=e[8],f=e[9],j=e[10],R=e[11],C=e[12],b=e[13],k=e[14],P=e[15],v=e[16];let S;e[32]!==f||e[33]!==j?(S=s.jsx("div",{className:f,children:j}),e[32]=f,e[33]=j,e[34]=S):S=e[34];let T;e[35]!==l||e[36]!==a||e[37]!==u?(T=u>0&&s.jsx("div",{className:"p-2 border-t border-border",children:s.jsxs(Q,{variant:"ghost",size:"sm",onClick:a,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",l.toLowerCase()]})}),e[35]=l,e[36]=a,e[37]=u,e[38]=T):T=e[38];let I;e[39]!==n||e[40]!==T||e[41]!==R||e[42]!==C||e[43]!==b||e[44]!==S?(I=s.jsxs(n,{className:R,align:C,children:[b,S,T]}),e[39]=n,e[40]=T,e[41]=R,e[42]=C,e[43]=b,e[44]=S,e[45]=I):I=e[45];let z;return e[46]!==N||e[47]!==I||e[48]!==k||e[49]!==P||e[50]!==v?(z=s.jsxs(N,{open:k,onOpenChange:P,children:[v,I]}),e[46]=N,e[47]=I,e[48]=k,e[49]=P,e[50]=v,e[51]=z):z=e[51],z}function Je(t,e){return e.count-t.count}function Ze(t){const e=G.c(67),{availableTags:l,availableCategories:o,selectedTags:c,selectedCategories:r,onTagChange:a,onCategoryChange:i}=t,d=l&&l.length>0||o&&o.length>0,y=c.length>0||r.length>0;if(!d)return null;let h;e[0]!==a||e[1]!==c?(h=m=>{c.includes(m)?a(c.filter(x=>x!==m)):a([...c,m])},e[0]=a,e[1]=c,e[2]=h):h=e[2];const n=h;let N;e[3]!==i||e[4]!==r?(N=m=>{r.includes(m)?i(r.filter(x=>x!==m)):i([...r,m])},e[3]=i,e[4]=r,e[5]=N):N=e[5];const u=N;let f;e[6]!==i||e[7]!==a?(f=()=>{a([]),i([])},e[6]=i,e[7]=a,e[8]=f):f=e[8];const j=f;let R,C,b,k,P,v,S;if(e[9]!==o||e[10]!==l||e[11]!==i||e[12]!==a||e[13]!==r||e[14]!==c||e[15]!==u||e[16]!==n){const m=o?Ye(o,6):[];R=r,C=c,S=new Set(m.map(Xe)),P="flex items-center border-b border-border";let x;e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:s.jsx(ne,{size:16})}),e[24]=x):x=e[24];let p;e[25]!==o||e[26]!==i||e[27]!==r||e[28]!==u?(p=o&&o.length>0&&s.jsx(re,{label:"Categories",items:o,selectedItems:r,onToggle:u,onClear:()=>i([])}),e[25]=o,e[26]=i,e[27]=r,e[28]=u,e[29]=p):p=e[29];let w;e[30]!==l||e[31]!==a||e[32]!==c||e[33]!==n?(w=l&&l.length>0&&s.jsx(re,{label:"Tags",items:l,selectedItems:c,onToggle:n,onClear:()=>a([])}),e[30]=l,e[31]=a,e[32]=c,e[33]=n,e[34]=w):w=e[34],e[35]!==w||e[36]!==p?(v=s.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[x,p,w]}),e[35]=w,e[36]=p,e[37]=v):v=e[37],b="flex items-center gap-3 flex-wrap px-5 py-3";let F;e[38]!==r||e[39]!==u?(F=g=>{const K=r.includes(g.value);return s.jsxs("div",{onClick:()=>u(g.value),className:ce("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",K?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[s.jsx("span",{children:g.value}),K&&s.jsx("span",{onClick:A=>{A.stopPropagation(),u(g.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},g.value)},e[38]=r,e[39]=u,e[40]=F):F=e[40],k=m.map(F),e[9]=o,e[10]=l,e[11]=i,e[12]=a,e[13]=r,e[14]=c,e[15]=u,e[16]=n,e[17]=R,e[18]=C,e[19]=b,e[20]=k,e[21]=P,e[22]=v,e[23]=S}else R=e[17],C=e[18],b=e[19],k=e[20],P=e[21],v=e[22],S=e[23];let T;if(e[41]!==R||e[42]!==u||e[43]!==S){let m;e[45]!==S?(m=p=>!S.has(p),e[45]=S,e[46]=m):m=e[46];let x;e[47]!==u?(x=p=>s.jsxs("div",{onClick:()=>u(p),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:p}),s.jsx("span",{onClick:w=>{w.stopPropagation(),u(p)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},`cat-${p}`),e[47]=u,e[48]=x):x=e[48],T=R.filter(m).map(x),e[41]=R,e[42]=u,e[43]=S,e[44]=T}else T=e[44];let I;if(e[49]!==C||e[50]!==n){let m;e[52]!==n?(m=x=>s.jsxs("div",{onClick:()=>n(x),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:x}),s.jsx("span",{onClick:p=>{p.stopPropagation(),n(x)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},`tag-${x}`),e[52]=n,e[53]=m):m=e[53],I=C.map(m),e[49]=C,e[50]=n,e[51]=I}else I=e[51];let z;e[54]!==j||e[55]!==y?(z=y&&s.jsxs(Q,{variant:"ghost",size:"sm",onClick:j,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[s.jsx(Y,{size:14}),"Clear all"]}),e[54]=j,e[55]=y,e[56]=z):z=e[56];let L;e[57]!==z||e[58]!==b||e[59]!==k||e[60]!==T||e[61]!==I?(L=s.jsxs("div",{className:b,children:[k,T,I,z]}),e[57]=z,e[58]=b,e[59]=k,e[60]=T,e[61]=I,e[62]=L):L=e[62];let $;return e[63]!==L||e[64]!==P||e[65]!==v?($=s.jsxs("div",{className:P,children:[v,L]}),e[63]=L,e[64]=P,e[65]=v,e[66]=$):$=e[66],$}function Xe(t){return t.value}function et(t,e){if(!e)return t;const l=e.toLowerCase();return t.filter(o=>(o.name||o.title||"").toLowerCase().includes(l)||(o.description||o.server.description||"").toLowerCase().includes(l))}function tt(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0}function st(t){const e=G.c(54),{registryId:l,listToolName:o,filtersToolName:c}=t,[r,a]=M.useState(""),i=_e(r,300),d=oe(),{org:y}=Z(),{scrollRef:h,saveScrollPosition:n,handleScroll:N}=Ge(`store-discovery:${l}`);let u;e[0]!==i||e[1]!==c||e[2]!==o||e[3]!==l?(u={registryId:l,listToolName:o,filtersToolName:c,search:i},e[0]=i,e[1]=c,e[2]=o,e[3]=l,e[4]=u):u=e[4];const{items:f,hasMore:j,isLoadingMore:R,isInitialLoading:C,isFetching:b,loadMore:k,availableTags:P,availableCategories:v,selectedTags:S,selectedCategories:T,setSelectedTags:I,setSelectedCategories:z,hasActiveFilters:L}=Qe(u);let $,m,x,p;e[5]!==i||e[6]!==b||e[7]!==C||e[8]!==f||e[9]!==r?($=r?et(f,r):f,m=(r!==i||b)&&!C&&!!r,p=$.filter(tt),x=$.filter(B=>!p.find(W=>W.id===B.id)),e[5]=i,e[6]=b,e[7]=C,e[8]=f,e[9]=r,e[10]=$,e[11]=m,e[12]=x,e[13]=p):($=e[10],m=e[11],x=e[12],p=e[13]);const w=x;let F;e[14]!==d||e[15]!==y.slug||e[16]!==l||e[17]!==n?(F=B=>{n();const W=Ie(B.name||B.title||B.server.title||""),H=B.server.name;d({to:"/$org/store/$appName",params:{org:y.slug,appName:W},search:{registryId:l,serverName:H}})},e[14]=d,e[15]=y.slug,e[16]=l,e[17]=n,e[18]=F):F=e[18];const g=F;let K;e[19]!==N||e[20]!==j||e[21]!==R||e[22]!==k?(K=B=>{if(N(),!j||R)return;const W=B.currentTarget;W.scrollHeight-W.scrollTop-W.clientHeight<200&&k()},e[19]=N,e[20]=j,e[21]=R,e[22]=k,e[23]=K):K=e[23];const A=K;let E;e[24]!==m||e[25]!==r?(E=s.jsx(Re,{value:r,onChange:a,placeholder:"Search for an MCP Server...",isSearching:m}),e[24]=m,e[25]=r,e[26]=E):E=e[26];let V;e[27]!==v||e[28]!==P||e[29]!==T||e[30]!==S||e[31]!==z||e[32]!==I?(V=s.jsx(Ze,{availableTags:P,availableCategories:v,selectedTags:S,selectedCategories:T,onTagChange:I,onCategoryChange:z}),e[27]=v,e[28]=P,e[29]=T,e[30]=S,e[31]=z,e[32]=I,e[33]=V):V=e[33];let O;e[34]!==w||e[35]!==$||e[36]!==g||e[37]!==L||e[38]!==j||e[39]!==C||e[40]!==R||e[41]!==m||e[42]!==f||e[43]!==r||e[44]!==p?(O=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:C?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(J,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):f.length===0&&!L?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(he,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),s.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):f.length===0&&L&&!r?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ne,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):r&&$.length===0&&!m?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ie,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):s.jsxs("div",{className:"flex flex-col gap-8",children:[m&&$.length===0&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(J,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),p.length>0&&s.jsx(le,{items:p,title:"Verified",onItemClick:g}),w.length>0&&s.jsx(le,{items:w,title:p.length>0?"All":"",onItemClick:g}),j&&R&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(J,{size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[34]=w,e[35]=$,e[36]=g,e[37]=L,e[38]=j,e[39]=C,e[40]=R,e[41]=m,e[42]=f,e[43]=r,e[44]=p,e[45]=O):O=e[45];let q;e[46]!==A||e[47]!==h||e[48]!==O?(q=s.jsx("div",{ref:h,className:"flex-1 overflow-y-auto",onScroll:A,children:O}),e[46]=A,e[47]=h,e[48]=O,e[49]=q):q=e[49];let _;return e[50]!==E||e[51]!==V||e[52]!==q?(_=s.jsxs("div",{className:"flex flex-col h-full",children:[E,V,q]}),e[50]=E,e[51]=V,e[52]=q,e[53]=_):_=e[53],_}function lt(t){const e=G.c(8),{registryId:l}=t,o=we(l),c=o?.tools;let r;e[0]!==c?(r=ye(c),e[0]=c,e[1]=r):r=e[1];const a=r;if(!a)throw new Error("This registry does not support listing store items.");const i=o?.tools;let d;e[2]!==i?(d=Ne(i),e[2]=i,e[3]=d):d=e[3];const h=d||void 0;let n;return e[4]!==a||e[5]!==l||e[6]!==h?(n=s.jsx(st,{registryId:l,listToolName:a,filtersToolName:h}),e[4]=a,e[5]=l,e[6]=h,e[7]=n):n=e[7],n}function rt(t){const e=G.c(15),{registries:l,value:o,onValueChange:c,onAddWellKnown:r,wellKnownRegistries:a,placeholder:i}=t,d=i===void 0?"Select a registry...":i;let y;e[0]!==d?(y=s.jsx(Ae,{size:"sm",className:"w-auto min-w-[160px]",children:s.jsx(Ee,{placeholder:d})}),e[0]=d,e[1]=y):y=e[1];let h;e[2]!==l?(h=l.map(ot),e[2]=l,e[3]=h):h=e[3];let n;e[4]!==r||e[5]!==a?(n=a.length>0&&s.jsxs("div",{className:"border-t border-border pt-1",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),a.map(f=>s.jsxs("button",{onClick:j=>{j.preventDefault(),j.stopPropagation(),r(f)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[f.icon?s.jsx("img",{src:f.icon,alt:f.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:f.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:f.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(Be,{size:16})})]},f.id??f.title))]}),e[4]=r,e[5]=a,e[6]=n):n=e[6];let N;e[7]!==h||e[8]!==n?(N=s.jsxs(De,{children:[h,n]}),e[7]=h,e[8]=n,e[9]=N):N=e[9];let u;return e[10]!==c||e[11]!==y||e[12]!==N||e[13]!==o?(u=s.jsxs(Me,{value:o,onValueChange:c,children:[y,N]}),e[10]=c,e[11]=y,e[12]=N,e[13]=o,e[14]=u):u=e[14],u}function ot(t){return s.jsx(Ke,{className:"cursor-pointer",value:t.id??t.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?s.jsx("img",{src:t.icon,alt:t.name,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:t.name})]})},t.id??t.name)}function nt({registries:t,onConnected:e}){const l=ae(),{org:{slug:o}}=Z(),{data:c}=ue.useSession(),r=oe(),[a,i]=M.useState(!1),d=t[0],y=async()=>{if(!(!d||!c?.user?.id)){i(!0);try{const n=await l.create.mutateAsync(d);e?.(n.id)}finally{i(!1)}}},h=()=>{r({to:"/$org/mcps",params:{org:o},search:{action:"create"}})};return s.jsx(Ve,{image:s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:s.jsxs(s.Fragment,{children:[s.jsxs(Q,{variant:"outline",onClick:y,disabled:a||!d,children:[d?.icon&&s.jsx("img",{src:d.icon,alt:"",className:"size-4"}),a?"Installing...":"Install Registry"]}),s.jsx(Q,{variant:"outline",onClick:h,children:"Custom Connection"})]})})}function Jt(){const t=G.c(41),{org:e}=Z(),l=Te(),o=ae(),c=xe(),r=c.location.pathname.includes("/store/")&&c.location.pathname.split("/").length>3,a=Oe(l);let i;t[0]!==a?(i=a.map(ct),t[0]=a,t[1]=i):i=t[1];const d=i;let y;t[2]!==e.slug?(y=We.selectedRegistry(e.slug),t[2]=e.slug,t[3]=y):y=t[3];const[h,n]=qe(y,at);let N;if(t[4]!==a||t[5]!==h){let g;t[7]!==h?(g=K=>K.id===h,t[7]=h,t[8]=g):g=t[8],N=a.find(g),t[4]=a,t[5]=h,t[6]=N}else N=t[6];const f=N?.id||a[0]?.id||"";let j;t[9]!==e.id?(j=be(e.id),t[9]=e.id,t[10]=j):j=t[10];let R;t[11]!==j?(R=[j],t[11]=j,t[12]=R):R=t[12];const C=R;let b;t[13]===Symbol.for("react.memo_cache_sentinel")?(b=[Se()],t[13]=b):b=t[13];const k=b;let P;t[14]!==o.create||t[15]!==n?(P=async g=>{const K=await o.create.mutateAsync(g);n(K.id)},t[14]=o.create,t[15]=n,t[16]=P):P=t[16];const v=P;let S;t[17]!==a?(S=new Set(a.map(it)),t[17]=a,t[18]=S):S=t[18];const T=S;let I;t[19]!==T||t[20]!==C?(I=C.filter(g=>g.id&&!T.has(g.id)),t[19]=T,t[20]=C,t[21]=I):I=t[21];const z=I;let L;t[22]!==T?(L=k.filter(g=>g.id&&!T.has(g.id)),t[22]=T,t[23]=L):L=t[23];const $=L;if(r){let g;return t[24]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(pe,{}),t[24]=g):g=t[24],g}let m;t[25]!==v?(m=async g=>v(g),t[25]=v,t[26]=m):m=t[26];let x;t[27]!==z||t[28]!==f||t[29]!==d||t[30]!==n||t[31]!==m?(x=s.jsx(ge,{title:"Store",ctaButton:s.jsx(rt,{wellKnownRegistries:z,registries:d,value:f,onValueChange:n,onAddWellKnown:m,placeholder:"Select store..."})}),t[27]=z,t[28]=f,t[29]=d,t[30]=n,t[31]=m,t[32]=x):x=t[32];let p;t[33]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(J,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[33]=p):p=t[33];let w;t[34]!==$||t[35]!==f||t[36]!==n?(w=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx(M.Suspense,{fallback:p,children:f?s.jsx(lt,{registryId:f}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(nt,{registries:$,onConnected:g=>{n(g)}})})})}),t[34]=$,t[35]=f,t[36]=n,t[37]=w):w=t[37];let F;return t[38]!==x||t[39]!==w?(F=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[x,w]}),t[38]=x,t[39]=w,t[40]=F):F=t[40],F}function it(t){return t.id}function at(t){return t??""}function ct(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{Jt as default};
1
+ import{c as G,r as M,i as de,K as se,bp as fe,j as s,e as oe,d as ue,b8 as xe,aD as pe}from"./index-Ck_HNGGd.js";import{C as ge}from"./collection-header-B4-DpfAL.js";import{i as ne}from"./FilterLines-CIEdE4Wb.js";import{n as he}from"./Inbox01-Cx7mk7qN.js";import{i as J}from"./Loading01-Dul6ue0E.js";import{i as ie}from"./SearchMd-jGEmiNrX.js";import{u as je}from"./useInfiniteQuery-BVNnXO_N.js";import{a as ve,f as ye,b as Ne}from"./registry-utils-BE0ZphJL.js";import{u as Z}from"./virtual-mcp-CLFdFi_E.js";import{u as Ce,a as be,b as Se}from"./constants-BEKdbCo6.js";import{b as we,u as ae,a as Te}from"./use-connection-Dd7Yvjif.js";import{s as Ie}from"./slugify-CEUa2lfQ.js";import{C as Re}from"./collection-search-DqVEDOqS.js";import{M as le}from"./mcp-server-card-Bhmbue9c.js";import{c as ce,B as Q}from"./button-AdEzXtPt.js";import{I as Pe}from"./input-BD07TV73.js";import{P as $e,a as ke,b as ze}from"./popover-C2dO17KJ.js";import{i as Fe}from"./Check-B2vj72U5.js";import{t as Le}from"./ChevronDown-Vb06lc-B.js";import{s as Y}from"./XClose-DB-yTUBg.js";import{d as Ke,a as Ae,b as Ee,c as De,S as Me}from"./select-DjQ5i8qH.js";import{s as Be}from"./Plus-BVDMzeyp.js";import{E as Ve}from"./empty-state-DZFeepnb.js";import{u as Oe}from"./use-binding-Bio_IG23.js";import{L as We,u as qe}from"./localstorage-keys-bIhPsHqu.js";import"./collection-display-button-DpjzbbIn.js";import"./dropdown-menu-CM0mCcd3.js";import"./Grid01-DvrY1gt1.js";import"./ArrowUp-DWcXOBpz.js";import"./List-BCcNlZrf.js";import"./tooltip-CXbR3les.js";import"./view-mode-toggle-CR_cIdX-.js";import"./infiniteQueryObserver-yBeVIl9y.js";import"./use-collections-BtupqZP_.js";import"./useMutation-BucpIOAt.js";import"./useQuery-Zp-sAZMS.js";import"./Lock01-Cy1pPqT8.js";import"./Terminal-CE84-sCv.js";import"./card-CQNrgAR3.js";import"./github-icon-Dp3wHhYE.js";import"./binder-DWCHeQZ9.js";function _e(t,e){const l=G.c(4),[o,c]=M.useState(t),r=M.useRef(null),a=M.useRef(!0);let i,d;return l[0]!==e||l[1]!==t?(i=()=>{if(a.current){a.current=!1;return}return r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{c(t)},e),()=>{r.current&&clearTimeout(r.current)}},d=[t,e],l[0]=e,l[1]=t,l[2]=i,l[3]=d):(i=l[2],d=l[3]),M.useEffect(i,d),o}function Ge(t){const e=G.c(14),l=M.useRef(null),o=`scroll-position:${t}`,c=M.useRef(null);let r;e[0]!==o?(r=()=>{l.current&&sessionStorage.setItem(o,String(l.current.scrollTop))},e[0]=o,e[1]=r):r=e[1];const a=r;let i;e[2]!==o?(i=()=>{if(c.current===o)return;const f=sessionStorage.getItem(o);if(f&&l.current){const j=Number.parseInt(f,10);l.current.scrollTop=j}c.current=o},e[2]=o,e[3]=i):i=e[3];const d=i;let y;e[4]!==d||e[5]!==o?(y=()=>{c.current!==o&&d()},e[4]=d,e[5]=o,e[6]=y):y=e[6];const h=y;let n;e[7]!==d||e[8]!==o?(n=f=>{l.current=f,f&&c.current!==o&&requestAnimationFrame(()=>{d()})},e[7]=d,e[8]=o,e[9]=n):n=e[9];const N=n;let u;return e[10]!==h||e[11]!==a||e[12]!==N?(u={scrollRef:N,saveScrollPosition:a,handleScroll:h},e[10]=h,e[11]=a,e[12]=N,e[13]=u):u=e[13],u}const He=24;function Qe(t){const e=G.c(53),{registryId:l,listToolName:o,filtersToolName:c,search:r}=t,{org:a}=Z();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[0]=i):i=e[0];const[d,y]=M.useState(i);let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[1]=h):h=e[1];const[n,N]=M.useState(h),u=l||null;let f;e[2]!==a.id||e[3]!==u?(f={connectionId:u,orgId:a.id},e[2]=a.id,e[3]=u,e[4]=f):f=e[4];const j=Ce(f),R=!!c;let C;e[5]!==c||e[6]!==l?(C=se.toolCall(l,c||"no-filters","{}"),e[5]=c,e[6]=l,e[7]=C):C=e[7];let b;e[8]!==j||e[9]!==c?(b=async()=>{if(!c)return{tags:[],categories:[]};const D=await j.callTool({name:c,arguments:{}});return D.structuredContent??D},e[8]=j,e[9]=c,e[10]=b):b=e[10];let k;e[11]!==C||e[12]!==b?(k={queryKey:C,queryFn:b,staleTime:36e5},e[11]=C,e[12]=b,e[13]=k):k=e[13];const{data:P}=de(k);let v,S,T;if(e[14]!==o||e[15]!==l||e[16]!==r||e[17]!==n||e[18]!==d){const D=r?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:r},{field:["title"],operator:"contains",value:r},{field:["description"],operator:"contains",value:r}]}:void 0;v={limit:He,...d.length>0&&{tags:d},...n.length>0&&{categories:n},...D&&{where:D}},T=je,S=se.toolCall(l,o,JSON.stringify(v)),e[14]=o,e[15]=l,e[16]=r,e[17]=n,e[18]=d,e[19]=v,e[20]=S,e[21]=T}else v=e[19],S=e[20],T=e[21];let I;e[22]!==j||e[23]!==v||e[24]!==o?(I=async D=>{const{pageParam:ee}=D,me=ee?{...v,cursor:ee}:v,te=await j.callTool({name:o,arguments:me});return te.structuredContent??te},e[22]=j,e[23]=v,e[24]=o,e[25]=I):I=e[25];let z;e[26]!==I||e[27]!==S?(z={queryKey:S,queryFn:I,initialPageParam:void 0,getNextPageParam:Ue,staleTime:36e5,placeholderData:fe},e[26]=I,e[27]=S,e[28]=z):z=e[28];const{data:L,fetchNextPage:$,hasNextPage:m,isFetchingNextPage:x,isFetching:p,isLoading:w}=T(z);let F;e:{if(!L?.pages||L.pages.length===0){F=null;break e}const D=L.pages[0];if(typeof D=="object"&&D!==null&&"totalCount"in D&&typeof D.totalCount=="number"){F=D.totalCount;break e}F=null}const g=F,K=L?.pages;let A;e[29]!==K?(A=ve(K),e[29]=K,e[30]=A):A=e[30];const E=A;let V;e[31]!==r||e[32]!==n.length||e[33]!==d.length?(V=d.length>0||n.length>0||!!r?.trim(),e[31]=r,e[32]=n.length,e[33]=d.length,e[34]=V):V=e[34];const O=V,q=p&&!x&&!w&&O;let _;e[35]!==$||e[36]!==m||e[37]!==x?(_=()=>{m&&!x&&$()},e[35]=$,e[36]=m,e[37]=x,e[38]=_):_=e[38];const B=_,W=m??!1,H=R?P?.tags:void 0,X=R?P?.categories:void 0;let U;return e[39]!==O||e[40]!==p||e[41]!==x||e[42]!==q||e[43]!==w||e[44]!==E||e[45]!==B||e[46]!==n||e[47]!==d||e[48]!==W||e[49]!==H||e[50]!==X||e[51]!==g?(U={items:E,totalCount:g,hasMore:W,isLoadingMore:x,isFiltering:q,isInitialLoading:w,isFetching:p,loadMore:B,availableTags:H,availableCategories:X,selectedTags:d,selectedCategories:n,setSelectedTags:y,setSelectedCategories:N,hasActiveFilters:O},e[39]=O,e[40]=p,e[41]=x,e[42]=q,e[43]=w,e[44]=E,e[45]=B,e[46]=n,e[47]=d,e[48]=W,e[49]=H,e[50]=X,e[51]=g,e[52]=U):U=e[52],U}function Ue(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function Ye(t,e){return[...t].sort((l,o)=>o.count-l.count).slice(0,e)}function re(t){const e=G.c(52),{label:l,items:o,selectedItems:c,onToggle:r,onClear:a}=t,[i,d]=M.useState(""),[y,h]=M.useState(!1);let n,N,u,f,j,R,C,b,k,P,v;if(e[0]!==o||e[1]!==l||e[2]!==r||e[3]!==y||e[4]!==i||e[5]!==c){const $=[...i?o.filter(A=>A.value.toLowerCase().includes(i.toLowerCase())):o].sort(Je);u=c.length,N=$e,k=y,P=h;let m;e[17]!==l?(m=s.jsx("span",{children:l}),e[17]=l,e[18]=m):m=e[18];let x;e[19]!==u?(x=u>0&&s.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:u}),e[19]=u,e[20]=x):x=e[20];let p;e[21]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Le,{size:14,className:"opacity-50"}),e[21]=p):p=e[21],e[22]!==x||e[23]!==m?(v=s.jsx(ke,{asChild:!0,children:s.jsxs(Q,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[m,x,p]})}),e[22]=x,e[23]=m,e[24]=v):v=e[24],n=ze,R="w-64 p-0",C="start";let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(ie,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=w):w=e[25];let F;e[26]!==l?(F=l.toLowerCase(),e[26]=l,e[27]=F):F=e[27];const g=`Search ${F}...`;let K;e[28]===Symbol.for("react.memo_cache_sentinel")?(K=A=>d(A.target.value),e[28]=K):K=e[28],e[29]!==i||e[30]!==g?(b=s.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[w,s.jsx(Pe,{type:"text",placeholder:g,value:i,onChange:K,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=i,e[30]=g,e[31]=b):b=e[31],f="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",j=$.length===0?s.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):$.map(A=>{const E=c.includes(A.value);return s.jsxs("button",{onClick:()=>r(A.value),className:ce("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",E?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[s.jsxs("span",{className:"truncate flex items-center gap-2",children:[E&&s.jsx(Fe,{size:16,className:"text-muted-foreground shrink-0"}),A.value]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:A.count})]},A.value)}),e[0]=o,e[1]=l,e[2]=r,e[3]=y,e[4]=i,e[5]=c,e[6]=n,e[7]=N,e[8]=u,e[9]=f,e[10]=j,e[11]=R,e[12]=C,e[13]=b,e[14]=k,e[15]=P,e[16]=v}else n=e[6],N=e[7],u=e[8],f=e[9],j=e[10],R=e[11],C=e[12],b=e[13],k=e[14],P=e[15],v=e[16];let S;e[32]!==f||e[33]!==j?(S=s.jsx("div",{className:f,children:j}),e[32]=f,e[33]=j,e[34]=S):S=e[34];let T;e[35]!==l||e[36]!==a||e[37]!==u?(T=u>0&&s.jsx("div",{className:"p-2 border-t border-border",children:s.jsxs(Q,{variant:"ghost",size:"sm",onClick:a,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",l.toLowerCase()]})}),e[35]=l,e[36]=a,e[37]=u,e[38]=T):T=e[38];let I;e[39]!==n||e[40]!==T||e[41]!==R||e[42]!==C||e[43]!==b||e[44]!==S?(I=s.jsxs(n,{className:R,align:C,children:[b,S,T]}),e[39]=n,e[40]=T,e[41]=R,e[42]=C,e[43]=b,e[44]=S,e[45]=I):I=e[45];let z;return e[46]!==N||e[47]!==I||e[48]!==k||e[49]!==P||e[50]!==v?(z=s.jsxs(N,{open:k,onOpenChange:P,children:[v,I]}),e[46]=N,e[47]=I,e[48]=k,e[49]=P,e[50]=v,e[51]=z):z=e[51],z}function Je(t,e){return e.count-t.count}function Ze(t){const e=G.c(67),{availableTags:l,availableCategories:o,selectedTags:c,selectedCategories:r,onTagChange:a,onCategoryChange:i}=t,d=l&&l.length>0||o&&o.length>0,y=c.length>0||r.length>0;if(!d)return null;let h;e[0]!==a||e[1]!==c?(h=m=>{c.includes(m)?a(c.filter(x=>x!==m)):a([...c,m])},e[0]=a,e[1]=c,e[2]=h):h=e[2];const n=h;let N;e[3]!==i||e[4]!==r?(N=m=>{r.includes(m)?i(r.filter(x=>x!==m)):i([...r,m])},e[3]=i,e[4]=r,e[5]=N):N=e[5];const u=N;let f;e[6]!==i||e[7]!==a?(f=()=>{a([]),i([])},e[6]=i,e[7]=a,e[8]=f):f=e[8];const j=f;let R,C,b,k,P,v,S;if(e[9]!==o||e[10]!==l||e[11]!==i||e[12]!==a||e[13]!==r||e[14]!==c||e[15]!==u||e[16]!==n){const m=o?Ye(o,6):[];R=r,C=c,S=new Set(m.map(Xe)),P="flex items-center border-b border-border";let x;e[24]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:s.jsx(ne,{size:16})}),e[24]=x):x=e[24];let p;e[25]!==o||e[26]!==i||e[27]!==r||e[28]!==u?(p=o&&o.length>0&&s.jsx(re,{label:"Categories",items:o,selectedItems:r,onToggle:u,onClear:()=>i([])}),e[25]=o,e[26]=i,e[27]=r,e[28]=u,e[29]=p):p=e[29];let w;e[30]!==l||e[31]!==a||e[32]!==c||e[33]!==n?(w=l&&l.length>0&&s.jsx(re,{label:"Tags",items:l,selectedItems:c,onToggle:n,onClear:()=>a([])}),e[30]=l,e[31]=a,e[32]=c,e[33]=n,e[34]=w):w=e[34],e[35]!==w||e[36]!==p?(v=s.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[x,p,w]}),e[35]=w,e[36]=p,e[37]=v):v=e[37],b="flex items-center gap-3 flex-wrap px-5 py-3";let F;e[38]!==r||e[39]!==u?(F=g=>{const K=r.includes(g.value);return s.jsxs("div",{onClick:()=>u(g.value),className:ce("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",K?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[s.jsx("span",{children:g.value}),K&&s.jsx("span",{onClick:A=>{A.stopPropagation(),u(g.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},g.value)},e[38]=r,e[39]=u,e[40]=F):F=e[40],k=m.map(F),e[9]=o,e[10]=l,e[11]=i,e[12]=a,e[13]=r,e[14]=c,e[15]=u,e[16]=n,e[17]=R,e[18]=C,e[19]=b,e[20]=k,e[21]=P,e[22]=v,e[23]=S}else R=e[17],C=e[18],b=e[19],k=e[20],P=e[21],v=e[22],S=e[23];let T;if(e[41]!==R||e[42]!==u||e[43]!==S){let m;e[45]!==S?(m=p=>!S.has(p),e[45]=S,e[46]=m):m=e[46];let x;e[47]!==u?(x=p=>s.jsxs("div",{onClick:()=>u(p),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:p}),s.jsx("span",{onClick:w=>{w.stopPropagation(),u(p)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},`cat-${p}`),e[47]=u,e[48]=x):x=e[48],T=R.filter(m).map(x),e[41]=R,e[42]=u,e[43]=S,e[44]=T}else T=e[44];let I;if(e[49]!==C||e[50]!==n){let m;e[52]!==n?(m=x=>s.jsxs("div",{onClick:()=>n(x),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:x}),s.jsx("span",{onClick:p=>{p.stopPropagation(),n(x)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(Y,{size:12})})]},`tag-${x}`),e[52]=n,e[53]=m):m=e[53],I=C.map(m),e[49]=C,e[50]=n,e[51]=I}else I=e[51];let z;e[54]!==j||e[55]!==y?(z=y&&s.jsxs(Q,{variant:"ghost",size:"sm",onClick:j,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[s.jsx(Y,{size:14}),"Clear all"]}),e[54]=j,e[55]=y,e[56]=z):z=e[56];let L;e[57]!==z||e[58]!==b||e[59]!==k||e[60]!==T||e[61]!==I?(L=s.jsxs("div",{className:b,children:[k,T,I,z]}),e[57]=z,e[58]=b,e[59]=k,e[60]=T,e[61]=I,e[62]=L):L=e[62];let $;return e[63]!==L||e[64]!==P||e[65]!==v?($=s.jsxs("div",{className:P,children:[v,L]}),e[63]=L,e[64]=P,e[65]=v,e[66]=$):$=e[66],$}function Xe(t){return t.value}function et(t,e){if(!e)return t;const l=e.toLowerCase();return t.filter(o=>(o.name||o.title||"").toLowerCase().includes(l)||(o.description||o.server.description||"").toLowerCase().includes(l))}function tt(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0}function st(t){const e=G.c(54),{registryId:l,listToolName:o,filtersToolName:c}=t,[r,a]=M.useState(""),i=_e(r,300),d=oe(),{org:y}=Z(),{scrollRef:h,saveScrollPosition:n,handleScroll:N}=Ge(`store-discovery:${l}`);let u;e[0]!==i||e[1]!==c||e[2]!==o||e[3]!==l?(u={registryId:l,listToolName:o,filtersToolName:c,search:i},e[0]=i,e[1]=c,e[2]=o,e[3]=l,e[4]=u):u=e[4];const{items:f,hasMore:j,isLoadingMore:R,isInitialLoading:C,isFetching:b,loadMore:k,availableTags:P,availableCategories:v,selectedTags:S,selectedCategories:T,setSelectedTags:I,setSelectedCategories:z,hasActiveFilters:L}=Qe(u);let $,m,x,p;e[5]!==i||e[6]!==b||e[7]!==C||e[8]!==f||e[9]!==r?($=r?et(f,r):f,m=(r!==i||b)&&!C&&!!r,p=$.filter(tt),x=$.filter(B=>!p.find(W=>W.id===B.id)),e[5]=i,e[6]=b,e[7]=C,e[8]=f,e[9]=r,e[10]=$,e[11]=m,e[12]=x,e[13]=p):($=e[10],m=e[11],x=e[12],p=e[13]);const w=x;let F;e[14]!==d||e[15]!==y.slug||e[16]!==l||e[17]!==n?(F=B=>{n();const W=Ie(B.name||B.title||B.server.title||""),H=B.server.name;d({to:"/$org/store/$appName",params:{org:y.slug,appName:W},search:{registryId:l,serverName:H}})},e[14]=d,e[15]=y.slug,e[16]=l,e[17]=n,e[18]=F):F=e[18];const g=F;let K;e[19]!==N||e[20]!==j||e[21]!==R||e[22]!==k?(K=B=>{if(N(),!j||R)return;const W=B.currentTarget;W.scrollHeight-W.scrollTop-W.clientHeight<200&&k()},e[19]=N,e[20]=j,e[21]=R,e[22]=k,e[23]=K):K=e[23];const A=K;let E;e[24]!==m||e[25]!==r?(E=s.jsx(Re,{value:r,onChange:a,placeholder:"Search for an MCP Server...",isSearching:m}),e[24]=m,e[25]=r,e[26]=E):E=e[26];let V;e[27]!==v||e[28]!==P||e[29]!==T||e[30]!==S||e[31]!==z||e[32]!==I?(V=s.jsx(Ze,{availableTags:P,availableCategories:v,selectedTags:S,selectedCategories:T,onTagChange:I,onCategoryChange:z}),e[27]=v,e[28]=P,e[29]=T,e[30]=S,e[31]=z,e[32]=I,e[33]=V):V=e[33];let O;e[34]!==w||e[35]!==$||e[36]!==g||e[37]!==L||e[38]!==j||e[39]!==C||e[40]!==R||e[41]!==m||e[42]!==f||e[43]!==r||e[44]!==p?(O=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:C?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(J,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):f.length===0&&!L?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(he,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),s.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):f.length===0&&L&&!r?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ne,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):r&&$.length===0&&!m?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ie,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):s.jsxs("div",{className:"flex flex-col gap-8",children:[m&&$.length===0&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(J,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),p.length>0&&s.jsx(le,{items:p,title:"Verified",onItemClick:g}),w.length>0&&s.jsx(le,{items:w,title:p.length>0?"All":"",onItemClick:g}),j&&R&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(J,{size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[34]=w,e[35]=$,e[36]=g,e[37]=L,e[38]=j,e[39]=C,e[40]=R,e[41]=m,e[42]=f,e[43]=r,e[44]=p,e[45]=O):O=e[45];let q;e[46]!==A||e[47]!==h||e[48]!==O?(q=s.jsx("div",{ref:h,className:"flex-1 overflow-y-auto",onScroll:A,children:O}),e[46]=A,e[47]=h,e[48]=O,e[49]=q):q=e[49];let _;return e[50]!==E||e[51]!==V||e[52]!==q?(_=s.jsxs("div",{className:"flex flex-col h-full",children:[E,V,q]}),e[50]=E,e[51]=V,e[52]=q,e[53]=_):_=e[53],_}function lt(t){const e=G.c(8),{registryId:l}=t,o=we(l),c=o?.tools;let r;e[0]!==c?(r=ye(c),e[0]=c,e[1]=r):r=e[1];const a=r;if(!a)throw new Error("This registry does not support listing store items.");const i=o?.tools;let d;e[2]!==i?(d=Ne(i),e[2]=i,e[3]=d):d=e[3];const h=d||void 0;let n;return e[4]!==a||e[5]!==l||e[6]!==h?(n=s.jsx(st,{registryId:l,listToolName:a,filtersToolName:h}),e[4]=a,e[5]=l,e[6]=h,e[7]=n):n=e[7],n}function rt(t){const e=G.c(15),{registries:l,value:o,onValueChange:c,onAddWellKnown:r,wellKnownRegistries:a,placeholder:i}=t,d=i===void 0?"Select a registry...":i;let y;e[0]!==d?(y=s.jsx(Ae,{size:"sm",className:"w-auto min-w-[160px]",children:s.jsx(Ee,{placeholder:d})}),e[0]=d,e[1]=y):y=e[1];let h;e[2]!==l?(h=l.map(ot),e[2]=l,e[3]=h):h=e[3];let n;e[4]!==r||e[5]!==a?(n=a.length>0&&s.jsxs("div",{className:"border-t border-border pt-1",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),a.map(f=>s.jsxs("button",{onClick:j=>{j.preventDefault(),j.stopPropagation(),r(f)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[f.icon?s.jsx("img",{src:f.icon,alt:f.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:f.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:f.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(Be,{size:16})})]},f.id??f.title))]}),e[4]=r,e[5]=a,e[6]=n):n=e[6];let N;e[7]!==h||e[8]!==n?(N=s.jsxs(De,{children:[h,n]}),e[7]=h,e[8]=n,e[9]=N):N=e[9];let u;return e[10]!==c||e[11]!==y||e[12]!==N||e[13]!==o?(u=s.jsxs(Me,{value:o,onValueChange:c,children:[y,N]}),e[10]=c,e[11]=y,e[12]=N,e[13]=o,e[14]=u):u=e[14],u}function ot(t){return s.jsx(Ke,{className:"cursor-pointer",value:t.id??t.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?s.jsx("img",{src:t.icon,alt:t.name,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:t.name})]})},t.id??t.name)}function nt({registries:t,onConnected:e}){const l=ae(),{org:{slug:o}}=Z(),{data:c}=ue.useSession(),r=oe(),[a,i]=M.useState(!1),d=t[0],y=async()=>{if(!(!d||!c?.user?.id)){i(!0);try{const n=await l.create.mutateAsync(d);e?.(n.id)}finally{i(!1)}}},h=()=>{r({to:"/$org/mcps",params:{org:o},search:{action:"create"}})};return s.jsx(Ve,{image:s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:s.jsxs(s.Fragment,{children:[s.jsxs(Q,{variant:"outline",onClick:y,disabled:a||!d,children:[d?.icon&&s.jsx("img",{src:d.icon,alt:"",className:"size-4"}),a?"Installing...":"Install Registry"]}),s.jsx(Q,{variant:"outline",onClick:h,children:"Custom Connection"})]})})}function Jt(){const t=G.c(41),{org:e}=Z(),l=Te(),o=ae(),c=xe(),r=c.location.pathname.includes("/store/")&&c.location.pathname.split("/").length>3,a=Oe(l);let i;t[0]!==a?(i=a.map(ct),t[0]=a,t[1]=i):i=t[1];const d=i;let y;t[2]!==e.slug?(y=We.selectedRegistry(e.slug),t[2]=e.slug,t[3]=y):y=t[3];const[h,n]=qe(y,at);let N;if(t[4]!==a||t[5]!==h){let g;t[7]!==h?(g=K=>K.id===h,t[7]=h,t[8]=g):g=t[8],N=a.find(g),t[4]=a,t[5]=h,t[6]=N}else N=t[6];const f=N?.id||a[0]?.id||"";let j;t[9]!==e.id?(j=be(e.id),t[9]=e.id,t[10]=j):j=t[10];let R;t[11]!==j?(R=[j],t[11]=j,t[12]=R):R=t[12];const C=R;let b;t[13]===Symbol.for("react.memo_cache_sentinel")?(b=[Se()],t[13]=b):b=t[13];const k=b;let P;t[14]!==o.create||t[15]!==n?(P=async g=>{const K=await o.create.mutateAsync(g);n(K.id)},t[14]=o.create,t[15]=n,t[16]=P):P=t[16];const v=P;let S;t[17]!==a?(S=new Set(a.map(it)),t[17]=a,t[18]=S):S=t[18];const T=S;let I;t[19]!==T||t[20]!==C?(I=C.filter(g=>g.id&&!T.has(g.id)),t[19]=T,t[20]=C,t[21]=I):I=t[21];const z=I;let L;t[22]!==T?(L=k.filter(g=>g.id&&!T.has(g.id)),t[22]=T,t[23]=L):L=t[23];const $=L;if(r){let g;return t[24]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(pe,{}),t[24]=g):g=t[24],g}let m;t[25]!==v?(m=async g=>v(g),t[25]=v,t[26]=m):m=t[26];let x;t[27]!==z||t[28]!==f||t[29]!==d||t[30]!==n||t[31]!==m?(x=s.jsx(ge,{title:"Store",ctaButton:s.jsx(rt,{wellKnownRegistries:z,registries:d,value:f,onValueChange:n,onAddWellKnown:m,placeholder:"Select store..."})}),t[27]=z,t[28]=f,t[29]=d,t[30]=n,t[31]=m,t[32]=x):x=t[32];let p;t[33]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(J,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[33]=p):p=t[33];let w;t[34]!==$||t[35]!==f||t[36]!==n?(w=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx(M.Suspense,{fallback:p,children:f?s.jsx(lt,{registryId:f}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(nt,{registries:$,onConnected:g=>{n(g)}})})})}),t[34]=$,t[35]=f,t[36]=n,t[37]=w):w=t[37];let F;return t[38]!==x||t[39]!==w?(F=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[x,w]}),t[38]=x,t[39]=w,t[40]=F):F=t[40],F}function it(t){return t.id}function at(t){return t??""}function ct(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{Jt as default};