@decocms/mesh 2.20.1 → 2.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/dist/client/assets/{AlertCircle-DeGhTF84.js → AlertCircle-CI2U-jkN.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-m6KeIjPT.js → ArrowLeft-B3km7toT.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-BDjaIiFu.js → ArrowUp-BF7mM4C2.js} +1 -1
  4. package/dist/client/assets/{Check-Cs5AiVxS.js → Check-BQkm1TiP.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-7pGjkuTY.js → ChevronDown-DP6jvip7.js} +1 -1
  6. package/dist/client/assets/{Code01-BdN1qNoI.js → Code01-qXTn9GK9.js} +1 -1
  7. package/dist/client/assets/{Copy01-B_oHlu2-.js → Copy01-CEYn2daS.js} +1 -1
  8. package/dist/client/assets/{DotsHorizontal-B-RZHKDt.js → DotsHorizontal-C2Nr-D-f.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-HKe7Lpcg.js → DotsVertical-BPP4U4GQ.js} +1 -1
  10. package/dist/client/assets/{Download01-4uLxYlt-.js → Download01-BkDXja2z.js} +1 -1
  11. package/dist/client/assets/{Edit01-CcxqoKWW.js → Edit01-Cq0mQDLh.js} +1 -1
  12. package/dist/client/assets/{File06-K5gpmB1y.js → File06-KMD38I-q.js} +1 -1
  13. package/dist/client/assets/{FilterLines-BCus583X.js → FilterLines-Bojt6HPl.js} +1 -1
  14. package/dist/client/assets/{FlipBackward-MuxfY5vX.js → FlipBackward-C-K9FamE.js} +1 -1
  15. package/dist/client/assets/{GitBranch01-ClkRJDdk.js → GitBranch01-DGTCzEh5.js} +1 -1
  16. package/dist/client/assets/{Grid01-XLGz76ym.js → Grid01-D4lXvveX.js} +1 -1
  17. package/dist/client/assets/{Home02-CeVIG1t0.js → Home02-DPdZvu8L.js} +1 -1
  18. package/dist/client/assets/{Image01-CycaMeSm.js → Image01-C0R6SF_P.js} +1 -1
  19. package/dist/client/assets/{Inbox01-1DQwZbO-.js → Inbox01-BsOUYwQZ.js} +1 -1
  20. package/dist/client/assets/{InfoCircle-DXvgKrQ3.js → InfoCircle-BgIkbjJr.js} +1 -1
  21. package/dist/client/assets/{Key01-B8mxyE2f.js → Key01-DTwk4FpG.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-B4WpWXG7.js → LinkExternal01-DmruqAb9.js} +1 -1
  23. package/dist/client/assets/{List-DWWQESNh.js → List-BsSZz32j.js} +1 -1
  24. package/dist/client/assets/{Loading01-BtKovu_m.js → Loading01-Ae5ezbtD.js} +1 -1
  25. package/dist/client/assets/{Lock01-CDOVc6ZJ.js → Lock01-BuQSktMF.js} +1 -1
  26. package/dist/client/assets/{Play-DYDE6oE1.js → Play-DKlNHVjf.js} +1 -1
  27. package/dist/client/assets/{Plus-CPExS1G1.js → Plus-CdG75X26.js} +1 -1
  28. package/dist/client/assets/{SearchMd-DwKDi1yz.js → SearchMd-GFaonOaJ.js} +1 -1
  29. package/dist/client/assets/{Terminal-LP4GeLJv.js → Terminal-C6mZx-5A.js} +1 -1
  30. package/dist/client/assets/{Trash01-DCb3R_1E.js → Trash01-BWIN9RL_.js} +1 -1
  31. package/dist/client/assets/{Upload01-BKDlh_J7.js → Upload01-CaBE4VYK.js} +1 -1
  32. package/dist/client/assets/{X-DWXiZn3v.js → X-C18ho617.js} +1 -1
  33. package/dist/client/assets/{XClose-s9vu-dQj.js → XClose-CfwoKknl.js} +1 -1
  34. package/dist/client/assets/{alert-dialog-CNXrLp-S.js → alert-dialog-CCJCsKzK.js} +1 -1
  35. package/dist/client/assets/{auth-catchall-M9fqis8u.js → auth-catchall-C33VWmDE.js} +1 -1
  36. package/dist/client/assets/{avatar-noXapmql.js → avatar-B7xnPXuk.js} +1 -1
  37. package/dist/client/assets/{badge-ChGpQW0J.js → badge-BVO6I0sW.js} +1 -1
  38. package/dist/client/assets/{binder-DZT62WgB.js → binder-By0LBK9Y.js} +1 -1
  39. package/dist/client/assets/{button-Dh_UOMtF.js → button-CGmrzkpY.js} +1 -1
  40. package/dist/client/assets/{card-Bjs7HBa2.js → card-DIjMh1NO.js} +1 -1
  41. package/dist/client/assets/{checkbox-DiEhrfCa.js → checkbox-DYViXeUc.js} +1 -1
  42. package/dist/client/assets/{collection-detail-BHOMTlVb.js → collection-detail-DtlOJm8P.js} +1 -1
  43. package/dist/client/assets/{collection-display-button-DKfm8yFW.js → collection-display-button-CtkxsCB_.js} +1 -1
  44. package/dist/client/assets/{collection-header-Cn-YMrm9.js → collection-header-B4qcjEt5.js} +1 -1
  45. package/dist/client/assets/{collection-page-A6cy4ewQ.js → collection-page-s-RR5fU6.js} +1 -1
  46. package/dist/client/assets/{collection-search-Bm9HY_m8.js → collection-search-BVb42O45.js} +1 -1
  47. package/dist/client/assets/{collection-tab-BQzpUnQW.js → collection-tab-CvrhLJCU.js} +1 -1
  48. package/dist/client/assets/{collection-table-wrapper-CnCS_a8f.js → collection-table-wrapper-BohFZqii.js} +1 -1
  49. package/dist/client/assets/{connection-DuIRkEvB.js → connection-ChwHK0-S.js} +1 -1
  50. package/dist/client/assets/{connection-card-Db71-JIc.js → connection-card-DMMfNQUo.js} +1 -1
  51. package/dist/client/assets/{connection-detail-C1yH43Km.js → connection-detail-D9bORT-_.js} +1 -1
  52. package/dist/client/assets/{connections-Bd35VTO7.js → connections-CRhyn7eO.js} +1 -1
  53. package/dist/client/assets/constants-J0aH6mLs.js +1 -0
  54. package/dist/client/assets/{create-organization-dialog-B19KPYZ1.js → create-organization-dialog-CtbMd6S_.js} +1 -1
  55. package/dist/client/assets/{dialog-BFNjB_wS.js → dialog-DJJ2cvEE.js} +1 -1
  56. package/dist/client/assets/{dropdown-menu-T7u8fl7N.js → dropdown-menu-CAeD2aIb.js} +1 -1
  57. package/dist/client/assets/{dynamic-plugin-layout-CaPvL2ak.js → dynamic-plugin-layout-BeSg8wRq.js} +1 -1
  58. package/dist/client/assets/{empty-state-ylKJe6-v.js → empty-state-BkAB-hls.js} +1 -1
  59. package/dist/client/assets/{empty-state-DhpaMqQD.js → empty-state-wP9uukGJ.js} +1 -1
  60. package/dist/client/assets/{env-vars-editor-BwDtTYE8.js → env-vars-editor-DuH6BBdA.js} +1 -1
  61. package/dist/client/assets/{error-boundary-_npCfvs4.js → error-boundary-BUvK8Sry.js} +1 -1
  62. package/dist/client/assets/{extract-connection-data-DfFE7uXb.js → extract-connection-data-BLs0SRok.js} +1 -1
  63. package/dist/client/assets/{file-browser-NWpg0oN1.js → file-browser-DuR45yyf.js} +2 -2
  64. package/dist/client/assets/{form-BEM8UzSv.js → form-DiGzBnRK.js} +1 -1
  65. package/dist/client/assets/{gateway-detail-BrjbS3jo.js → gateway-detail-BCBmyW-G.js} +1 -1
  66. package/dist/client/assets/{gateways-DhcOJhD5.js → gateways-BgSVXbfx.js} +1 -1
  67. package/dist/client/assets/{grid-view-BUF5kath.js → grid-view-Db741zGU.js} +1 -1
  68. package/dist/client/assets/{home-DyK0jpSk.js → home-BtJc_wcZ.js} +1 -1
  69. package/dist/client/assets/{index-Dh8Y3NBs.js → index-CL_rL7XJ.js} +4 -4
  70. package/dist/client/assets/{index-DanqEyuv.js → index-D4QCsSzb.js} +1 -1
  71. package/dist/client/assets/index-DUA-vRuy.js +1 -0
  72. package/dist/client/assets/{index-skH-OUyO.js → index-Diww4UW3.js} +2 -2
  73. package/dist/client/assets/{index-BRipTsvS.js → index-DjRWdLI4.js} +1 -1
  74. package/dist/client/assets/{infiniteQueryObserver-Dvgbvv4A.js → infiniteQueryObserver-BmbQcWdI.js} +1 -1
  75. package/dist/client/assets/{input-CdlPz8Vq.js → input-CrURMEZe.js} +1 -1
  76. package/dist/client/assets/{layout-DopLDDPE.js → layout-kp8TTJc9.js} +1 -1
  77. package/dist/client/assets/{lazy-highlighter-CQ8gN0d3.js → lazy-highlighter-dN3WcL6s.js} +1 -1
  78. package/dist/client/assets/{localstorage-keys-B_H3St2R.js → localstorage-keys-BVANkONM.js} +1 -1
  79. package/dist/client/assets/{login-1cuD6_Oo.js → login-CnuJ6k4x.js} +1 -1
  80. package/dist/client/assets/{mcp-oauth-B6eUt4Mr.js → mcp-oauth-CdcIczUJ.js} +1 -1
  81. package/dist/client/assets/{mcp-server-card-DTQIT3pj.js → mcp-server-card-VZUBDTRj.js} +1 -1
  82. package/dist/client/assets/{mcp-server-detail-BB_FT5IH.js → mcp-server-detail-CIR0FKMd.js} +1 -1
  83. package/dist/client/assets/{members-Cy4UaFKY.js → members-bQTH1spX.js} +1 -1
  84. package/dist/client/assets/{monaco-editor-CKUC5K4P.js → monaco-editor-CDRbE4GY.js} +1 -1
  85. package/dist/client/assets/{monitoring-DOZ3Tm1E.js → monitoring-Cb41cf-X.js} +1 -1
  86. package/dist/client/assets/{oauth-callback-DxWqmOqk.js → oauth-callback-z6t0OToi.js} +1 -1
  87. package/dist/client/assets/{page-wGlLXgmM.js → page-CcKdSzCp.js} +1 -1
  88. package/dist/client/assets/{page-zq0-MjKt.js → page-SWPgLEpC.js} +1 -1
  89. package/dist/client/assets/{pin-to-sidebar-button-C5qdidS1.js → pin-to-sidebar-button-DIwkO0Tx.js} +1 -1
  90. package/dist/client/assets/{plugin-empty-state-cSLsH0S-.js → plugin-empty-state-B-glkOMH.js} +1 -1
  91. package/dist/client/assets/{plugin-header-CzG38AxU.js → plugin-header-BA0z5mBU.js} +1 -1
  92. package/dist/client/assets/{plugins-BqbdQ0eM.js → plugins-Cq62fkYj.js} +1 -1
  93. package/dist/client/assets/{popover-B4iU4oXK.js → popover-Bx7diZ86.js} +1 -1
  94. package/dist/client/assets/{project-context-provider-Ci1EHyGR.js → project-context-provider-DulCVL2k.js} +1 -1
  95. package/dist/client/assets/{registry-utils-8goOeMwE.js → registry-utils-8Lvx2XTy.js} +1 -1
  96. package/dist/client/assets/{resizable-BteAr06H.js → resizable-Gk1RjNnW.js} +1 -1
  97. package/dist/client/assets/{resource-tabs-Dzc9tSXU.js → resource-tabs-ACbF96qo.js} +1 -1
  98. package/dist/client/assets/{select-B4aq4vxk.js → select-C8LOz7vA.js} +1 -1
  99. package/dist/client/assets/{settings-B6nAEWR5.js → settings-BXJ6BGel.js} +1 -1
  100. package/dist/client/assets/{shell-layout-CNkO6ROG.js → shell-layout-CFRw9Ru3.js} +1 -1
  101. package/dist/client/assets/{spinner-DwVZzFPC.js → spinner-BF56RAKQ.js} +1 -1
  102. package/dist/client/assets/{switch-PB1r01nO.js → switch-DJBd8Fzb.js} +1 -1
  103. package/dist/client/assets/{textarea-B7no0HbU.js → textarea-C_zgj3Sp.js} +1 -1
  104. package/dist/client/assets/{tool-set-selector-Cl3nu1df.js → tool-set-selector-B9rTBahU.js} +1 -1
  105. package/dist/client/assets/{tools-list-DNdG8U23.js → tools-list-mr-l2d8l.js} +1 -1
  106. package/dist/client/assets/{tooltip-DgJ4R-G6.js → tooltip-Suu_Gpqh.js} +1 -1
  107. package/dist/client/assets/{typewriter-title-YmbwonUg.js → typewriter-title-DM-oRxie.js} +1 -1
  108. package/dist/client/assets/{use-binding-R6SoNecZ.js → use-binding-D6wv_5fO.js} +1 -1
  109. package/dist/client/assets/{use-collections-CC15C_nK.js → use-collections-CXETocKO.js} +1 -1
  110. package/dist/client/assets/{use-connection-BY9aOm7H.js → use-connection-CCXutWLD.js} +1 -1
  111. package/dist/client/assets/{use-connection-resources-D2N-7Fdh.js → use-connection-resources-D0st76bP.js} +1 -1
  112. package/dist/client/assets/{use-create-gateway-D4_8vfl-.js → use-create-gateway-BlLsktgc.js} +1 -1
  113. package/dist/client/assets/{use-gateway-CmDE4xLF.js → use-gateway-DD-xEZju.js} +1 -1
  114. package/dist/client/assets/{use-gateway-system-prompt-nzDoNyO-.js → use-gateway-system-prompt-zGJSEzce.js} +1 -1
  115. package/dist/client/assets/{use-list-state-B0HVVNOr.js → use-list-state-AndcW8aD.js} +1 -1
  116. package/dist/client/assets/{use-mcp-DUgnx05H.js → use-mcp-D9llr83X.js} +1 -1
  117. package/dist/client/assets/{use-members-DEeTkVb7.js → use-members-CB2ebBfn.js} +1 -1
  118. package/dist/client/assets/{use-mobile-CZeMkOxo.js → use-mobile-DssCtDl6.js} +1 -1
  119. package/dist/client/assets/{use-organization-settings-8tWqPbhq.js → use-organization-settings-CQXtXtZs.js} +1 -1
  120. package/dist/client/assets/{use-tool-call-_jHZu2qb.js → use-tool-call-BmvKn7jp.js} +1 -1
  121. package/dist/client/assets/useInfiniteQuery-BttwTOfK.js +1 -0
  122. package/dist/client/assets/{useMutation-n0xwrWOz.js → useMutation-Dl1MMkEC.js} +1 -1
  123. package/dist/client/assets/useQuery-Bvk0U2ed.js +1 -0
  124. package/dist/client/assets/{value-BOu8imSs.js → value-DaPOjTmC.js} +1 -1
  125. package/dist/client/assets/{view-mode-toggle-Z5AVjYj0.js → view-mode-toggle-BLClM-0g.js} +1 -1
  126. package/dist/client/assets/{workflow-CZ2JUtj_.js → workflow-CQ7PQ7Dg.js} +1 -1
  127. package/dist/client/index.html +1 -1
  128. package/dist/server/cli.js +1 -1
  129. package/dist/server/node_modules/kysely/README.md +3 -1
  130. package/dist/server/node_modules/kysely/dist/cjs/index.d.ts +3 -1
  131. package/dist/server/node_modules/kysely/dist/cjs/migration/migrator.d.ts +1 -1
  132. package/dist/server/node_modules/kysely/dist/cjs/migration/migrator.js +75 -68
  133. package/dist/server/node_modules/kysely/dist/esm/index.d.ts +3 -1
  134. package/dist/server/node_modules/kysely/dist/esm/migration/migrator.d.ts +1 -1
  135. package/dist/server/node_modules/kysely/dist/esm/migration/migrator.js +75 -68
  136. package/dist/server/node_modules/kysely/package.json +13 -13
  137. package/dist/server/server.js +1 -1
  138. package/package.json +1 -1
  139. package/dist/client/assets/constants-C1rpewgJ.js +0 -1
  140. package/dist/client/assets/index-C6eYxyql.js +0 -1
  141. package/dist/client/assets/useInfiniteQuery-x4_y1w34.js +0 -1
  142. package/dist/client/assets/useQuery-FRehIqtM.js +0 -1
@@ -1 +1 @@
1
- import{c as E,r as f,$ as v,j as l}from"./index-skH-OUyO.js";import{B as w}from"./button-Dh_UOMtF.js";import{i as k}from"./ArrowLeft-m6KeIjPT.js";const j=f.createContext(null);function S(x){const e=E.c(3),{children:r}=x,s=f.useContext(j);if(!s?.tabsEl)return null;let t;return e[0]!==r||e[1]!==s.tabsEl?(t=v.createPortal(r,s.tabsEl),e[0]=r,e[1]=s.tabsEl,e[2]=t):t=e[2],t}function _(x){const e=E.c(3),{children:r}=x,s=f.useContext(j);if(!s?.actionsEl)return null;let t;return e[0]!==r||e[1]!==s.actionsEl?(t=v.createPortal(r,s.actionsEl),e[0]=r,e[1]=s.actionsEl,e[2]=t):t=e[2],t}function $(x){const e=E.c(20),{children:r,onBack:s,title:t}=x,[h,N]=f.useState(null),[p,g]=f.useState(null);let n;e[0]!==p||e[1]!==h?(n={tabsEl:h,actionsEl:p},e[0]=p,e[1]=h,e[2]=n):n=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx(k,{}),e[3]=u):u=e[3];let i;e[4]!==s?(i=l.jsx("div",{className:"flex h-full px-2 border-r items-center",children:l.jsx(w,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:s,children:u})}),e[4]=s,e[5]=i):i=e[5];let c;e[6]!==t?(c=t&&l.jsx("div",{className:"flex items-center gap-2 px-2",children:l.jsx("p",{className:"text-sm font-medium",children:t})}),e[6]=t,e[7]=c):c=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsxs("div",{className:"flex px-4 items-center gap-0 flex-1 min-w-0",children:[l.jsx("div",{ref:N,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),l.jsx("div",{ref:g,className:"flex items-center gap-2 ml-auto shrink-0 border-l border-border pl-4"})]}),e[8]=d):d=e[8];let o;e[9]!==i||e[10]!==c?(o=l.jsxs("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:[i,c,d]}),e[9]=i,e[10]=c,e[11]=o):o=e[11];let a;e[12]!==r?(a=l.jsx("div",{className:"flex-1 overflow-auto",children:r}),e[12]=r,e[13]=a):a=e[13];let m;e[14]!==o||e[15]!==a?(m=l.jsxs("div",{className:"flex flex-col h-full bg-background",children:[o,a]}),e[14]=o,e[15]=a,e[16]=m):m=e[16];let b;return e[17]!==n||e[18]!==m?(b=l.jsx(j,{value:n,children:m}),e[17]=n,e[18]=m,e[19]=b):b=e[19],b}export{_ as V,S as a,$ as b};
1
+ import{c as E,r as f,$ as v,j as l}from"./index-Diww4UW3.js";import{B as w}from"./button-CGmrzkpY.js";import{i as k}from"./ArrowLeft-B3km7toT.js";const j=f.createContext(null);function S(x){const e=E.c(3),{children:r}=x,s=f.useContext(j);if(!s?.tabsEl)return null;let t;return e[0]!==r||e[1]!==s.tabsEl?(t=v.createPortal(r,s.tabsEl),e[0]=r,e[1]=s.tabsEl,e[2]=t):t=e[2],t}function _(x){const e=E.c(3),{children:r}=x,s=f.useContext(j);if(!s?.actionsEl)return null;let t;return e[0]!==r||e[1]!==s.actionsEl?(t=v.createPortal(r,s.actionsEl),e[0]=r,e[1]=s.actionsEl,e[2]=t):t=e[2],t}function $(x){const e=E.c(20),{children:r,onBack:s,title:t}=x,[h,N]=f.useState(null),[p,g]=f.useState(null);let n;e[0]!==p||e[1]!==h?(n={tabsEl:h,actionsEl:p},e[0]=p,e[1]=h,e[2]=n):n=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=l.jsx(k,{}),e[3]=u):u=e[3];let i;e[4]!==s?(i=l.jsx("div",{className:"flex h-full px-2 border-r items-center",children:l.jsx(w,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:s,children:u})}),e[4]=s,e[5]=i):i=e[5];let c;e[6]!==t?(c=t&&l.jsx("div",{className:"flex items-center gap-2 px-2",children:l.jsx("p",{className:"text-sm font-medium",children:t})}),e[6]=t,e[7]=c):c=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=l.jsxs("div",{className:"flex px-4 items-center gap-0 flex-1 min-w-0",children:[l.jsx("div",{ref:N,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),l.jsx("div",{ref:g,className:"flex items-center gap-2 ml-auto shrink-0 border-l border-border pl-4"})]}),e[8]=d):d=e[8];let o;e[9]!==i||e[10]!==c?(o=l.jsxs("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:[i,c,d]}),e[9]=i,e[10]=c,e[11]=o):o=e[11];let a;e[12]!==r?(a=l.jsx("div",{className:"flex-1 overflow-auto",children:r}),e[12]=r,e[13]=a):a=e[13];let m;e[14]!==o||e[15]!==a?(m=l.jsxs("div",{className:"flex flex-col h-full bg-background",children:[o,a]}),e[14]=o,e[15]=a,e[16]=m):m=e[16];let b;return e[17]!==n||e[18]!==m?(b=l.jsx(j,{value:n,children:m}),e[17]=n,e[18]=m,e[19]=b):b=e[19],b}export{_ as V,S as a,$ as b};
@@ -1,4 +1,4 @@
1
- import{H as ae,W as Ie,X as Xp,c as Zp,j as Qp}from"./index-skH-OUyO.js";function To(){return To=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},To.apply(null,arguments)}function Jp(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function eg(e,t){if(e==null)return{};var r,a,n=Jp(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ao(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r<t;r++)a[r]=e[r];return a}function tg(e){if(Array.isArray(e))return Ao(e)}function rg(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ag(e,t){if(e){if(typeof e=="string")return Ao(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ao(e,t):void 0}}function ng(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ import{H as ae,W as Ie,X as Xp,c as Zp,j as Qp}from"./index-Diww4UW3.js";function To(){return To=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},To.apply(null,arguments)}function Jp(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function eg(e,t){if(e==null)return{};var r,a,n=Jp(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ao(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r<t;r++)a[r]=e[r];return a}function tg(e){if(Array.isArray(e))return Ao(e)}function rg(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ag(e,t){if(e){if(typeof e=="string")return Ao(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ao(e,t):void 0}}function ng(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ro(e){return tg(e)||rg(e)||ag(e)||ng()}function Se(e){"@babel/helpers - typeof";return Se=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Se(e)}function ig(e,t){if(Se(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(Se(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function og(e){var t=ig(e,"string");return Se(t)=="symbol"?t:t+""}function kp(e,t,r){return(t=og(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Go(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,a)}return r}function me(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Go(Object(r),!0).forEach(function(a){kp(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Go(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function sg(e){var t=e.length;if(t===0||t===1)return e;if(t===2)return[e[0],e[1],"".concat(e[0],".").concat(e[1]),"".concat(e[1],".").concat(e[0])];if(t===3)return[e[0],e[1],e[2],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0])];if(t>=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]}var Ue={};function lg(e){if(e.length===0||e.length===1)return e;var t=e.join(".");return Ue[t]||(Ue[t]=sg(e)),Ue[t]}function ug(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,a=e.filter(function(i){return i!=="token"}),n=lg(a);return n.reduce(function(i,o){return me(me({},i),r[o])},t)}function $o(e){return e.join(" ")}function cg(e,t){var r=0;return function(a){return r+=1,a.map(function(n,i){return Cp({node:n,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(r,"-").concat(i)})})}}function Cp(e){var t=e.node,r=e.stylesheet,a=e.style,n=a===void 0?{}:a,i=e.useInlineStyles,o=e.key,s=t.properties,l=t.type,c=t.tagName,u=t.value;if(l==="text")return u;if(c){var p=cg(r,i),m;if(!i)m=me(me({},s),{},{className:$o(s.className)});else{var f=Object.keys(r).reduce(function(R,b){return b.split(".").forEach(function(g){R.includes(g)||R.push(g)}),R},[]),T=s.className&&s.className.includes("token")?["token"]:[],E=s.className&&T.concat(s.className.filter(function(R){return!f.includes(R)}));m=me(me({},s),{},{className:$o(E)||void 0,style:ug(s.className,Object.assign({},s.style,n),r)})}var A=p(t.children);return ae.createElement(c,To({key:o},m),A)}}const dg=(function(e,t){var r=e.listLanguages();return r.indexOf(t)!==-1});var pg=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function Ho(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,a)}return r}function ne(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ho(Object(r),!0).forEach(function(a){kp(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ho(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}var gg=/\n/g;function bg(e){return e.match(gg)}function mg(e){var t=e.lines,r=e.startingLineNumber,a=e.style;return t.map(function(n,i){var o=i+r;return ae.createElement("span",{key:"line-".concat(i),className:"react-syntax-highlighter-line-number",style:typeof a=="function"?a(o):a},"".concat(o,`
3
3
  `))})}function fg(e){var t=e.codeString,r=e.codeStyle,a=e.containerStyle,n=a===void 0?{float:"left",paddingRight:"10px"}:a,i=e.numberStyle,o=i===void 0?{}:i,s=e.startingLineNumber;return ae.createElement("code",{style:Object.assign({},r,n)},mg({lines:t.replace(/\n$/,"").split(`
4
4
  `),style:o,startingLineNumber:s}))}function hg(e){return"".concat(e.toString().length,".25em")}function Op(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function Lp(e,t,r){var a={display:"inline-block",minWidth:hg(r),paddingRight:"1em",textAlign:"right",userSelect:"none"},n=typeof e=="function"?e(t):e,i=ne(ne({},a),n);return i}function _e(e){var t=e.children,r=e.lineNumber,a=e.lineNumberStyle,n=e.largestLineNumber,i=e.showInlineLineNumbers,o=e.lineProps,s=o===void 0?{}:o,l=e.className,c=l===void 0?[]:l,u=e.showLineNumbers,p=e.wrapLongLines,m=e.wrapLines,f=m===void 0?!1:m,T=f?ne({},typeof s=="function"?s(r):s):{};if(T.className=T.className?[].concat(Ro(T.className.trim().split(/\s+/)),Ro(c)):c,r&&i){var E=Lp(a,r,n);t.unshift(Op(r,E))}return p&u&&(T.style=ne({display:"flex"},T.style)),{type:"element",tagName:"span",properties:T,children:t}}function Dp(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],a=0;a<e.length;a++){var n=e[a];if(n.type==="text")r.push(_e({children:[n],className:Ro(new Set(t))}));else if(n.children){var i=t.concat(n.properties.className);Dp(n.children,i).forEach(function(o){return r.push(o)})}}return r}function Eg(e,t,r,a,n,i,o,s,l){var c,u=Dp(e.value),p=[],m=-1,f=0;function T(S,d){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return _e({children:S,lineNumber:d,lineNumberStyle:s,largestLineNumber:o,showInlineLineNumbers:n,lineProps:r,className:y,showLineNumbers:a,wrapLongLines:l,wrapLines:t})}function E(S,d){if(a&&d&&n){var y=Lp(s,d,o);S.unshift(Op(d,y))}return S}function A(S,d){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||y.length>0?T(S,d,y):E(S,d)}for(var R=function(){var d=u[f],y=d.children[0].value,_=bg(y);if(_){var v=y.split(`
@@ -1 +1 @@
1
- import{c as O,x as w}from"./index-skH-OUyO.js";import{u as x}from"./useQuery-FRehIqtM.js";import{u as I}from"./useMutation-n0xwrWOz.js";function L(e){try{return JSON.parse(e)}catch{return}}function $(e,s){const t=localStorage.getItem(e),o=t?L(t):void 0,n=typeof s=="function"?s(o):o??s;if(o===void 0||n!==o)try{const a=JSON.stringify(n);localStorage.setItem(e,a)}catch{}return n}function q(e,s){const t=O.c(25),o=w();let n;t[0]!==e?(n=["localStorage",e],t[0]=e,t[1]=n):n=t[1];const a=n;let r,i;t[2]!==s||t[3]!==e?(r=()=>$(e,s),i=()=>$(e,s),t[2]=s,t[3]=e,t[4]=r,t[5]=i):(r=t[4],i=t[5]);let h;t[6]!==a||t[7]!==r||t[8]!==i?(h={queryKey:a,queryFn:r,initialData:i,staleTime:1/0,gcTime:1/0},t[6]=a,t[7]=r,t[8]=i,t[9]=h):h=t[9];const{data:v}=x(h);let l;t[10]!==e?(l=async c=>{const y=JSON.stringify(c);return localStorage.setItem(e,y),c},t[10]=e,t[11]=l):l=t[11];let m;t[12]!==o||t[13]!==a?(m=c=>{o.setQueryData(a,c)},t[12]=o,t[13]=a,t[14]=m):m=t[14];let u;t[15]!==l||t[16]!==m?(u={mutationFn:l,onSuccess:m},t[15]=l,t[16]=m,t[17]=u):u=t[17];const f=I(u);let d;t[18]!==f||t[19]!==o||t[20]!==a?(d=c=>{const y=o.getQueryData(a),C=typeof c=="function"?c(y):c;f.mutate(C)},t[18]=f,t[19]=o,t[20]=a,t[21]=d):d=t[21];const p=d,S=v;let g;return t[22]!==p||t[23]!==S?(g=[S,p],t[22]=p,t[23]=S,t[24]=g):g=t[24],g}const A={decoChatOpen:()=>"mesh:decochat:open",threadManagerState:e=>`mesh:thread-manager-state:${e}`,chatSelectedModel:e=>`mesh:chat:selectedModel:${e}`,assistantChatActiveThread:(e,s)=>`mesh:assistant-chat:active-thread:${e}:${s}`,gatewayChatActiveThread:(e,s)=>`mesh:gateway-chat:active-thread:${e}:${s}`,decoChatPanelWidth:()=>"mesh:decochat:panel-width",sidebarOpen:()=>"mesh:sidebar-open",selectedRegistry:e=>`mesh:store:selected-registry:${e}`,orgHomeQuickstart:e=>`mesh:org-home:quickstart:${e}`,gatewaySystemPrompts:e=>`mesh:gateway:system-prompts:${e}`,storeShowStdio:()=>"mesh:store:show-stdio",developerMode:()=>"mesh:user:developer-mode",pluginConnection:(e,s)=>`mesh:plugin:connection:${e}:${s}`};export{A as L,q as u};
1
+ import{c as O,x as w}from"./index-Diww4UW3.js";import{u as x}from"./useQuery-Bvk0U2ed.js";import{u as I}from"./useMutation-Dl1MMkEC.js";function L(e){try{return JSON.parse(e)}catch{return}}function $(e,s){const t=localStorage.getItem(e),o=t?L(t):void 0,n=typeof s=="function"?s(o):o??s;if(o===void 0||n!==o)try{const a=JSON.stringify(n);localStorage.setItem(e,a)}catch{}return n}function q(e,s){const t=O.c(25),o=w();let n;t[0]!==e?(n=["localStorage",e],t[0]=e,t[1]=n):n=t[1];const a=n;let r,i;t[2]!==s||t[3]!==e?(r=()=>$(e,s),i=()=>$(e,s),t[2]=s,t[3]=e,t[4]=r,t[5]=i):(r=t[4],i=t[5]);let h;t[6]!==a||t[7]!==r||t[8]!==i?(h={queryKey:a,queryFn:r,initialData:i,staleTime:1/0,gcTime:1/0},t[6]=a,t[7]=r,t[8]=i,t[9]=h):h=t[9];const{data:v}=x(h);let l;t[10]!==e?(l=async c=>{const y=JSON.stringify(c);return localStorage.setItem(e,y),c},t[10]=e,t[11]=l):l=t[11];let m;t[12]!==o||t[13]!==a?(m=c=>{o.setQueryData(a,c)},t[12]=o,t[13]=a,t[14]=m):m=t[14];let u;t[15]!==l||t[16]!==m?(u={mutationFn:l,onSuccess:m},t[15]=l,t[16]=m,t[17]=u):u=t[17];const f=I(u);let d;t[18]!==f||t[19]!==o||t[20]!==a?(d=c=>{const y=o.getQueryData(a),C=typeof c=="function"?c(y):c;f.mutate(C)},t[18]=f,t[19]=o,t[20]=a,t[21]=d):d=t[21];const p=d,S=v;let g;return t[22]!==p||t[23]!==S?(g=[S,p],t[22]=p,t[23]=S,t[24]=g):g=t[24],g}const A={decoChatOpen:()=>"mesh:decochat:open",threadManagerState:e=>`mesh:thread-manager-state:${e}`,chatSelectedModel:e=>`mesh:chat:selectedModel:${e}`,assistantChatActiveThread:(e,s)=>`mesh:assistant-chat:active-thread:${e}:${s}`,gatewayChatActiveThread:(e,s)=>`mesh:gateway-chat:active-thread:${e}:${s}`,decoChatPanelWidth:()=>"mesh:decochat:panel-width",sidebarOpen:()=>"mesh:sidebar-open",selectedRegistry:e=>`mesh:store:selected-registry:${e}`,orgHomeQuickstart:e=>`mesh:org-home:quickstart:${e}`,gatewaySystemPrompts:e=>`mesh:gateway:system-prompts:${e}`,storeShowStdio:()=>"mesh:store:show-stdio",developerMode:()=>"mesh:user:developer-mode",pluginConnection:(e,s)=>`mesh:plugin:connection:${e}:${s}`};export{A as L,q as u};
@@ -1 +1 @@
1
- import{u as k,r as p,a as j,j as e,b as z,S as L,N as R,c as U}from"./index-skH-OUyO.js";import{u as T}from"./useMutation-n0xwrWOz.js";import{c as b,B as P}from"./button-Dh_UOMtF.js";import{I as E}from"./input-CdlPz8Vq.js";function B({redirectUrl:r}){const{emailAndPassword:t}=k(),[s,d]=p.useState(""),[o,u]=p.useState(""),[l,v]=p.useState(""),[i,N]=p.useState(()=>globalThis.localStorage?.getItem("hasLoggedIn")!=="true"),[m,h]=p.useState(""),g=T({mutationFn:async({email:a,password:n,name:C})=>{try{if(i){const c=await j.signUp.email({email:a,password:n,name:C||""});if(c.error)throw new Error(c.error.message||"Sign up failed");return c}else{const c=await j.signIn.email({email:a,password:n});if(c.error)throw new Error(c.error.message||"Sign in failed");return c}}catch(c){throw c instanceof Error?c:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),r&&(window.location.href=r)}}),y=a=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a),x=()=>{s.trim()&&!y(s)&&h("Invalid email address")},S=a=>{if(a.preventDefault(),!y(s)){h("Invalid email address");return}g.mutate({email:s,password:o,name:l})},_=a=>n=>{a(n.target.value),I&&g.reset(),a===d&&m&&h("")},f=g.isPending,I=g.error,w=i?s.trim()&&o.trim()&&l.trim():s.trim()&&o.trim(),A=a=>{if(!a)return null;const n=a.message.toLowerCase();return n.includes("unauthorized")||n.includes("401")?"Invalid email or password. Please try again.":n.includes("already exists")||n.includes("409")?"An account with this email already exists. Try signing in instead.":n.includes("network")||n.includes("fetch")?"Network error. Please check your connection and try again.":n.includes("rate limit")||n.includes("429")?"Too many attempts. Please wait a moment and try again.":a.message||"An error occurred. Please try again."};return e.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e.jsx("div",{className:"text-center space-y-1",children:e.jsx("p",{className:"text-sm text-foreground/70",children:i?"Create your account":"Login or signup below"})}),I&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:A(I)}),t.enabled&&e.jsxs("form",{onSubmit:S,className:"grid gap-4",children:[e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",i?"max-h-[200px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsxs("div",{className:b("p-1",!i&&"pointer-events-none"),children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(E,{type:"text",placeholder:"Your name",value:l,onChange:_(v),required:!0,disabled:f||!i,"aria-hidden":!i})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(E,{type:"email",placeholder:"you@example.com",value:s,onChange:_(d),onBlur:x,required:!0,disabled:f,"aria-invalid":!!m}),m&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:m})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Password"}),e.jsx(E,{type:"password",placeholder:"••••••••",value:o,onChange:_(u),required:!0,disabled:f})]}),e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",w?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:b("p-1",!w&&"pointer-events-none"),children:e.jsx(P,{type:"submit",disabled:f||!w,className:b("w-full font-semibold"),size:"lg","aria-hidden":!w,children:f?i?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-center",children:e.jsx(P,{type:"button",variant:"link",onClick:()=>{N(!i),v(""),h(""),g.reset()},disabled:f,className:"text-sm text-muted-foreground hover:text-foreground",children:i?"Already have an account? Sign in":"Don't have an account? Sign up"})}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground pt-4",children:[e.jsx("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Terms of Service"}),e.jsx("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Privacy Policy"})]})]})}function M(r){if(!r.client_id||r.response_type!=="code")return null;const t=new URLSearchParams;return r.client_id&&t.set("client_id",r.client_id),r.redirect_uri&&t.set("redirect_uri",r.redirect_uri),r.response_type&&t.set("response_type",r.response_type),r.state&&t.set("state",r.state),r.scope&&t.set("scope",r.scope),r.code_challenge&&t.set("code_challenge",r.code_challenge),r.code_challenge_method&&t.set("code_challenge_method",r.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function q(r){const t=U.c(5),{callbackURL:s,providerId:d}=r;let o,u;t[0]!==s||t[1]!==d?(o=()=>{(async()=>await j.signIn.sso({providerId:d,callbackURL:s}))()},u=[d,s],t[0]=s,t[1]=d,t[2]=o,t[3]=u):(o=t[2],u=t[3]),p.useEffect(o,u);let l;return t[4]===Symbol.for("react.memo_cache_sentinel")?(l=e.jsx(L,{}),t[4]=l):l=t[4],l}function Y(){const r=j.useSession(),t=z({from:"/login"}),{next:s="/",client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}=t,{sso:m,emailAndPassword:h,magicLink:g,socialProviders:y}=k(),x=M({client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}),S=x||s;return r.data?x?(window.location.href=x,e.jsx(L,{})):e.jsx(R,{to:s}):m.enabled?e.jsx(q,{callbackURL:S,providerId:m.providerId}):h.enabled||g.enabled||y.enabled?e.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx(B,{redirectUrl:x})]})]}):e.jsx("div",{children:"No login options available"})}export{Y as default};
1
+ import{u as k,r as p,a as j,j as e,b as z,S as L,N as R,c as U}from"./index-Diww4UW3.js";import{u as T}from"./useMutation-Dl1MMkEC.js";import{c as b,B as P}from"./button-CGmrzkpY.js";import{I as E}from"./input-CrURMEZe.js";function B({redirectUrl:r}){const{emailAndPassword:t}=k(),[s,d]=p.useState(""),[o,u]=p.useState(""),[l,v]=p.useState(""),[i,N]=p.useState(()=>globalThis.localStorage?.getItem("hasLoggedIn")!=="true"),[m,h]=p.useState(""),g=T({mutationFn:async({email:a,password:n,name:C})=>{try{if(i){const c=await j.signUp.email({email:a,password:n,name:C||""});if(c.error)throw new Error(c.error.message||"Sign up failed");return c}else{const c=await j.signIn.email({email:a,password:n});if(c.error)throw new Error(c.error.message||"Sign in failed");return c}}catch(c){throw c instanceof Error?c:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),r&&(window.location.href=r)}}),y=a=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a),x=()=>{s.trim()&&!y(s)&&h("Invalid email address")},S=a=>{if(a.preventDefault(),!y(s)){h("Invalid email address");return}g.mutate({email:s,password:o,name:l})},_=a=>n=>{a(n.target.value),I&&g.reset(),a===d&&m&&h("")},f=g.isPending,I=g.error,w=i?s.trim()&&o.trim()&&l.trim():s.trim()&&o.trim(),A=a=>{if(!a)return null;const n=a.message.toLowerCase();return n.includes("unauthorized")||n.includes("401")?"Invalid email or password. Please try again.":n.includes("already exists")||n.includes("409")?"An account with this email already exists. Try signing in instead.":n.includes("network")||n.includes("fetch")?"Network error. Please check your connection and try again.":n.includes("rate limit")||n.includes("429")?"Too many attempts. Please wait a moment and try again.":a.message||"An error occurred. Please try again."};return e.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e.jsx("div",{className:"text-center space-y-1",children:e.jsx("p",{className:"text-sm text-foreground/70",children:i?"Create your account":"Login or signup below"})}),I&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:A(I)}),t.enabled&&e.jsxs("form",{onSubmit:S,className:"grid gap-4",children:[e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",i?"max-h-[200px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsxs("div",{className:b("p-1",!i&&"pointer-events-none"),children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(E,{type:"text",placeholder:"Your name",value:l,onChange:_(v),required:!0,disabled:f||!i,"aria-hidden":!i})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(E,{type:"email",placeholder:"you@example.com",value:s,onChange:_(d),onBlur:x,required:!0,disabled:f,"aria-invalid":!!m}),m&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:m})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Password"}),e.jsx(E,{type:"password",placeholder:"••••••••",value:o,onChange:_(u),required:!0,disabled:f})]}),e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",w?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:b("p-1",!w&&"pointer-events-none"),children:e.jsx(P,{type:"submit",disabled:f||!w,className:b("w-full font-semibold"),size:"lg","aria-hidden":!w,children:f?i?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-center",children:e.jsx(P,{type:"button",variant:"link",onClick:()=>{N(!i),v(""),h(""),g.reset()},disabled:f,className:"text-sm text-muted-foreground hover:text-foreground",children:i?"Already have an account? Sign in":"Don't have an account? Sign up"})}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground pt-4",children:[e.jsx("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Terms of Service"}),e.jsx("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Privacy Policy"})]})]})}function M(r){if(!r.client_id||r.response_type!=="code")return null;const t=new URLSearchParams;return r.client_id&&t.set("client_id",r.client_id),r.redirect_uri&&t.set("redirect_uri",r.redirect_uri),r.response_type&&t.set("response_type",r.response_type),r.state&&t.set("state",r.state),r.scope&&t.set("scope",r.scope),r.code_challenge&&t.set("code_challenge",r.code_challenge),r.code_challenge_method&&t.set("code_challenge_method",r.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function q(r){const t=U.c(5),{callbackURL:s,providerId:d}=r;let o,u;t[0]!==s||t[1]!==d?(o=()=>{(async()=>await j.signIn.sso({providerId:d,callbackURL:s}))()},u=[d,s],t[0]=s,t[1]=d,t[2]=o,t[3]=u):(o=t[2],u=t[3]),p.useEffect(o,u);let l;return t[4]===Symbol.for("react.memo_cache_sentinel")?(l=e.jsx(L,{}),t[4]=l):l=t[4],l}function Y(){const r=j.useSession(),t=z({from:"/login"}),{next:s="/",client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}=t,{sso:m,emailAndPassword:h,magicLink:g,socialProviders:y}=k(),x=M({client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}),S=x||s;return r.data?x?(window.location.href=x,e.jsx(L,{})):e.jsx(R,{to:s}):m.enabled?e.jsx(q,{callbackURL:S,providerId:m.providerId}):h.enabled||g.enabled||y.enabled?e.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx(B,{redirectUrl:x})]})]}):e.jsx("div",{children:"No login options available"})}export{Y as default};
@@ -1 +1 @@
1
- import{bH as M,bI as $,bJ as P,bK as V}from"./index-skH-OUyO.js";function y(n){let e=0;for(let t=0;t<n.length;t++){const o=n.charCodeAt(t);e=(e<<5)-e+o,e=e&e}return Math.abs(e).toString(16)}const U=new Map,I="mcp:oauth:callback:";class L{serverUrl;_clientMetadata;_redirectUrl;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${window.location.origin}/oauth/callback`;const t=e.scope?Array.isArray(e.scope)?e.scope.join(" "):e.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",...t&&{scope:t}},U.set(y(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){const c=window.screenX+(window.outerWidth-600)/2,s=window.screenY+(window.outerHeight-700)/2;window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${c},top=${s},popup=yes`)}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){U.delete(y(this.serverUrl))}}async function H(n){const e=new URL(`/mcp/${n.connectionId}`,window.location.origin),t=new L({serverUrl:e.href,clientName:n.clientName,clientUri:n.clientUri,callbackUrl:n.callbackUrl,scope:n.scope});try{const o=new Promise((r,a)=>{const T=n.timeout||12e4;let w,d=!1;const O=t.state(),k=`${I}${O}`,l=()=>{window.removeEventListener("message",_),window.removeEventListener("storage",g),clearTimeout(w);try{localStorage.removeItem(k)}catch{}},m=async i=>{if(d)return;if(d=!0,!i.success){l(),a(new Error(i.error||"OAuth authentication failed"));return}const{code:f,state:b}=i;if(!f){l(),a(new Error("Missing authorization code"));return}if(t.getStoredState()!==b){l(),a(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const A=(await M(e))?.authorization_servers?.[0]||e,v=await $(A),h=t.clientInformation();if(!h){l(),a(new Error("Client information not found"));return}const E=t.codeVerifier(),C=await P(A,{metadata:v,clientInformation:h,authorizationCode:f,codeVerifier:E,redirectUri:t.redirectUrl,resource:new URL(e)});l(),r({tokens:C,clientId:h.client_id??null,clientSecret:"client_secret"in h?h.client_secret:null,tokenEndpoint:v?.token_endpoint??null})}catch(S){l(),a(S)}},_=async i=>{i.origin===window.location.origin&&i.data?.type==="mcp:oauth:callback"&&await m(i.data)},g=async i=>{if(!(i.key!==k||!i.newValue))try{const f=JSON.parse(i.newValue);await m(f)}catch{}};window.addEventListener("message",_),window.addEventListener("storage",g),w=setTimeout(()=>{d||(d=!0,l(),a(new Error("OAuth authentication timeout")))},T)});if(await V(t,{serverUrl:e})==="REDIRECT"){const r=await o;return{token:r.tokens.access_token,tokenInfo:{accessToken:r.tokens.access_token,refreshToken:r.tokens.refresh_token??null,expiresIn:r.tokens.expires_in??null,scope:r.tokens.scope??null,clientId:r.clientId,clientSecret:r.clientSecret,tokenEndpoint:r.tokenEndpoint},error:null}}const s=t.tokens(),u=t.clientInformation();return{token:s?.access_token||null,tokenInfo:s?{accessToken:s.access_token,refreshToken:s.refresh_token??null,expiresIn:s.expires_in??null,scope:s.scope??null,clientId:u?.client_id??null,clientSecret:u&&"client_secret"in u?u.client_secret:null,tokenEndpoint:null}:null,error:null}}catch(o){return{token:null,tokenInfo:null,error:o instanceof Error?o.message:String(o)}}finally{t.cleanup()}}function p(n,e){if(window.opener&&!window.opener.closed)return window.opener.postMessage(n,window.location.origin),!0;if(e)try{const t=`${I}${e}`;return localStorage.setItem(t,JSON.stringify(n)),!0}catch{}return!1}async function J(){const n=new URLSearchParams(window.location.search),e=n.get("code");let t=n.get("state");const o=n.get("error"),c=n.get("error_description");let s=t;if(t)try{const r=atob(t),a=JSON.parse(r);a.clientState&&(s=a.clientState)}catch{}if(o){const r=c||o;return p({type:"mcp:oauth:callback",success:!1,error:r},s),{success:!1,error:r}}if(!e||!t){const r="Missing code or state parameter";return p({type:"mcp:oauth:callback",success:!1,error:r},s),{success:!1,error:r}}return t=s||t,p({type:"mcp:oauth:callback",success:!0,code:e,state:t},t)?{success:!0}:{success:!1,error:"Parent window not available"}}function R(n){try{return new URL(n).pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}async function x(n){try{const e=await fetch(`/api/connections/${n}/oauth-token/status`,{credentials:"include"});return e.ok?{hasToken:(await e.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function K({url:n,token:e}){try{const t=new Headers;t.set("Content-Type","application/json"),t.set("Accept","application/json, text/event-stream");const o=await fetch(n,{method:"POST",headers:t,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})}),c=R(n);if(o.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(c?await x(c):{hasToken:!1}).hasToken};let s;try{const a=await o.json();s=a.error||a.message}catch{}return o.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:s||`HTTP ${o.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!o.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:s||`HTTP ${o.status}`}}catch(t){return console.error("[isConnectionAuthenticated] Error:",t),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:t.message}}}export{H as a,J as h,K as i};
1
+ import{bH as M,bI as $,bJ as P,bK as V}from"./index-Diww4UW3.js";function y(n){let e=0;for(let t=0;t<n.length;t++){const o=n.charCodeAt(t);e=(e<<5)-e+o,e=e&e}return Math.abs(e).toString(16)}const U=new Map,I="mcp:oauth:callback:";class L{serverUrl;_clientMetadata;_redirectUrl;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${window.location.origin}/oauth/callback`;const t=e.scope?Array.isArray(e.scope)?e.scope.join(" "):e.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",...t&&{scope:t}},U.set(y(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){const c=window.screenX+(window.outerWidth-600)/2,s=window.screenY+(window.outerHeight-700)/2;window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${c},top=${s},popup=yes`)}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){U.delete(y(this.serverUrl))}}async function H(n){const e=new URL(`/mcp/${n.connectionId}`,window.location.origin),t=new L({serverUrl:e.href,clientName:n.clientName,clientUri:n.clientUri,callbackUrl:n.callbackUrl,scope:n.scope});try{const o=new Promise((r,a)=>{const T=n.timeout||12e4;let w,d=!1;const O=t.state(),k=`${I}${O}`,l=()=>{window.removeEventListener("message",_),window.removeEventListener("storage",g),clearTimeout(w);try{localStorage.removeItem(k)}catch{}},m=async i=>{if(d)return;if(d=!0,!i.success){l(),a(new Error(i.error||"OAuth authentication failed"));return}const{code:f,state:b}=i;if(!f){l(),a(new Error("Missing authorization code"));return}if(t.getStoredState()!==b){l(),a(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const A=(await M(e))?.authorization_servers?.[0]||e,v=await $(A),h=t.clientInformation();if(!h){l(),a(new Error("Client information not found"));return}const E=t.codeVerifier(),C=await P(A,{metadata:v,clientInformation:h,authorizationCode:f,codeVerifier:E,redirectUri:t.redirectUrl,resource:new URL(e)});l(),r({tokens:C,clientId:h.client_id??null,clientSecret:"client_secret"in h?h.client_secret:null,tokenEndpoint:v?.token_endpoint??null})}catch(S){l(),a(S)}},_=async i=>{i.origin===window.location.origin&&i.data?.type==="mcp:oauth:callback"&&await m(i.data)},g=async i=>{if(!(i.key!==k||!i.newValue))try{const f=JSON.parse(i.newValue);await m(f)}catch{}};window.addEventListener("message",_),window.addEventListener("storage",g),w=setTimeout(()=>{d||(d=!0,l(),a(new Error("OAuth authentication timeout")))},T)});if(await V(t,{serverUrl:e})==="REDIRECT"){const r=await o;return{token:r.tokens.access_token,tokenInfo:{accessToken:r.tokens.access_token,refreshToken:r.tokens.refresh_token??null,expiresIn:r.tokens.expires_in??null,scope:r.tokens.scope??null,clientId:r.clientId,clientSecret:r.clientSecret,tokenEndpoint:r.tokenEndpoint},error:null}}const s=t.tokens(),u=t.clientInformation();return{token:s?.access_token||null,tokenInfo:s?{accessToken:s.access_token,refreshToken:s.refresh_token??null,expiresIn:s.expires_in??null,scope:s.scope??null,clientId:u?.client_id??null,clientSecret:u&&"client_secret"in u?u.client_secret:null,tokenEndpoint:null}:null,error:null}}catch(o){return{token:null,tokenInfo:null,error:o instanceof Error?o.message:String(o)}}finally{t.cleanup()}}function p(n,e){if(window.opener&&!window.opener.closed)return window.opener.postMessage(n,window.location.origin),!0;if(e)try{const t=`${I}${e}`;return localStorage.setItem(t,JSON.stringify(n)),!0}catch{}return!1}async function J(){const n=new URLSearchParams(window.location.search),e=n.get("code");let t=n.get("state");const o=n.get("error"),c=n.get("error_description");let s=t;if(t)try{const r=atob(t),a=JSON.parse(r);a.clientState&&(s=a.clientState)}catch{}if(o){const r=c||o;return p({type:"mcp:oauth:callback",success:!1,error:r},s),{success:!1,error:r}}if(!e||!t){const r="Missing code or state parameter";return p({type:"mcp:oauth:callback",success:!1,error:r},s),{success:!1,error:r}}return t=s||t,p({type:"mcp:oauth:callback",success:!0,code:e,state:t},t)?{success:!0}:{success:!1,error:"Parent window not available"}}function R(n){try{return new URL(n).pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}async function x(n){try{const e=await fetch(`/api/connections/${n}/oauth-token/status`,{credentials:"include"});return e.ok?{hasToken:(await e.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function K({url:n,token:e}){try{const t=new Headers;t.set("Content-Type","application/json"),t.set("Accept","application/json, text/event-stream");const o=await fetch(n,{method:"POST",headers:t,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})}),c=R(n);if(o.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(c?await x(c):{hasToken:!1}).hasToken};let s;try{const a=await o.json();s=a.error||a.message}catch{}return o.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:s||`HTTP ${o.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!o.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:s||`HTTP ${o.status}`}}catch(t){return console.error("[isConnectionAuthenticated] Error:",t),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:t.message}}}export{H as a,J as h,K as i};
@@ -1 +1 @@
1
- import{r as B,c as V,j as a}from"./index-skH-OUyO.js";import{b as O,T as q,c as J}from"./tooltip-DgJ4R-G6.js";import{c as M,B as K}from"./button-Dh_UOMtF.js";import{s as Q}from"./registry-utils-8goOeMwE.js";import{i as X}from"./Lock01-CDOVc6ZJ.js";import{s as Y}from"./Plus-CPExS1G1.js";import{i as ee}from"./Terminal-LP4GeLJv.js";import{C as te}from"./card-Bjs7HBa2.js";import{I as se}from"./empty-state-DhpaMqQD.js";import{g as le}from"./github-icon-Dp3wHhYE.js";const U=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"m9 12 2 2 4.5-4.5m2.401-4.501a2.03 2.03 0 0 0 1.1 1.1l1.744.723a2.033 2.033 0 0 1 1.1 2.656l-.722 1.744a2.03 2.03 0 0 0 0 1.556l.722 1.744a2.033 2.033 0 0 1-1.1 2.656L19 17.901A2.033 2.033 0 0 0 17.9 19l-.723 1.745a2.032 2.032 0 0 1-2.656 1.1l-1.744-.722a2.032 2.032 0 0 0-1.555 0l-1.745.723a2.033 2.033 0 0 1-2.654-1.1L6.1 19.001A2.033 2.033 0 0 0 5 17.9l-1.744-.723a2.033 2.033 0 0 1-1.1-2.654l.721-1.744a2.033 2.033 0 0 0 0-1.556l-.722-1.746a2.033 2.033 0 0 1 1.1-2.657L5 6.098A2.03 2.03 0 0 0 6.1 5l.723-1.745a2.033 2.033 0 0 1 2.656-1.1l1.744.722a2.033 2.033 0 0 0 1.555-.001l1.746-.72a2.032 2.032 0 0 1 2.655 1.1l.723 1.746v-.003Z"}));U.displayName="CheckVerified02";const W=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"M6 6h.01M6 18h.01m-.81-8h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 8.48 22 7.92 22 6.8V5.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 2 19.92 2 18.8 2H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 3.52 2 4.08 2 5.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 10 4.08 10 5.2 10Zm0 12h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 20.48 22 19.92 22 18.8v-1.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 14 19.92 14 18.8 14H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 15.52 2 16.08 2 17.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 22 4.08 22 5.2 22Z"}));W.displayName="Server01";function ie(s){if(!s.includes("/"))return s;const e=s.split("/"),l=e[0],i=e[1];if(!l||!i)return s;if(l.includes(".")){const n=l.split("."),r=n[n.length-1]||l,o=i.replace(/^mcp-?/,"").replace(/-?mcp$/,"").replace(/^server-?/,"").replace(/-?server$/,"");return!o||o.length<2?r:o}return i}function ae(s){const e=V.c(2),{protocol:l,className:i}=s;let n;return e[0]!==i?(n={http:a.jsx(Q,{className:i}),sse:a.jsx(W,{className:i}),stdio:a.jsx(ee,{className:i})},e[0]=i,e[1]=n):n=e[1],n[l]}function ne(s){switch(s){case"http":return"HTTP";case"sse":return"SSE";case"stdio":return"STDIO"}}function re(s){const e=V.c(9),{protocol:l}=s;let i;e[0]!==l?(i=M("flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium shrink-0",{http:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",sse:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",stdio:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400"}[l]),e[0]=l,e[1]=i):i=e[1];let n,r;e[2]!==l?(n=a.jsx(ae,{protocol:l,className:"w-3 h-3"}),r=ne(l),e[2]=l,e[3]=n,e[4]=r):(n=e[3],r=e[4]);let o;return e[5]!==i||e[6]!==n||e[7]!==r?(o=a.jsxs("div",{className:i,children:[n,r]}),e[5]=i,e[6]=n,e[7]=r,e[8]=o):o=e[8],o}function oe(s){const e=V.c(68),{icon:l,displayName:i,description:n,onClick:r}=s,t=(s.variant??"store")==="server",f=t?s.hostname:null,m=t?s.protocol:null,c=t?s.isInstalling:!1,d=t?s.actionLabel:void 0,p=t?null:s.scopeName,_=t?!1:s.isVerified,x=t?!0:s.canInstall,H=t?"p-4":"p-6";let u;e[0]!==H?(u=M("cursor-pointer hover:bg-muted/50 transition-colors",H),e[0]=H,e[1]=u):u=e[1];const R=t?"gap-3":"gap-4";let h;e[2]!==R?(h=M("flex flex-col h-full relative",R),e[2]=R,e[3]=h):h=e[3];const Z=t?"sm":"md";let g;e[4]!==i||e[5]!==l||e[6]!==Z?(g=a.jsx(se,{icon:l,name:i,size:Z,className:"shadow-sm shrink-0"}),e[4]=i,e[5]=l,e[6]=Z,e[7]=g):g=e[7];const G=t?"text-sm":"text-base";let v;e[8]!==G?(v=M("flex items-center gap-2 font-medium min-w-0",G),e[8]=G,e[9]=v):v=e[9];let j;e[10]!==i?(j=a.jsx("span",{className:"truncate",children:i}),e[10]=i,e[11]=j):j=e[11];let N;e[12]!==t||e[13]!==_?(N=!t&&_&&a.jsx(U,{size:16,className:"text-success shrink-0"}),e[12]=t,e[13]=_,e[14]=N):N=e[14];let C;e[15]!==x||e[16]!==t?(C=!t&&!x&&a.jsx(X,{size:16,className:"text-muted-foreground shrink-0"}),e[15]=x,e[16]=t,e[17]=C):C=e[17];let k;e[18]!==t||e[19]!==m?(k=t&&m&&a.jsx(re,{protocol:m}),e[18]=t,e[19]=m,e[20]=k):k=e[20];let b;e[21]!==C||e[22]!==k||e[23]!==v||e[24]!==j||e[25]!==N?(b=a.jsx(O,{asChild:!0,children:a.jsxs("div",{className:v,children:[j,N,C,k]})}),e[21]=C,e[22]=k,e[23]=v,e[24]=j,e[25]=N,e[26]=b):b=e[26];let w;e[27]!==i?(w=a.jsx("p",{children:i}),e[27]=i,e[28]=w):w=e[28];let y;e[29]!==x||e[30]!==t?(y=!t&&!x&&a.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[29]=x,e[30]=t,e[31]=y):y=e[31];let I;e[32]!==w||e[33]!==y?(I=a.jsxs(q,{children:[w,y]}),e[32]=w,e[33]=y,e[34]=I):I=e[34];let $;e[35]!==b||e[36]!==I?($=a.jsxs(J,{children:[b,I]}),e[35]=b,e[36]=I,e[37]=$):$=e[37];let L;e[38]!==f||e[39]!==t||e[40]!==p?(L=(p||f)&&a.jsx("div",{className:M("text-muted-foreground truncate",t?"text-xs mt-0.5":"text-sm"),children:p||f}),e[38]=f,e[39]=t,e[40]=p,e[41]=L):L=e[41];let P;e[42]!==$||e[43]!==L?(P=a.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:a.jsxs("div",{className:"min-w-0 flex-1",children:[$,L]})}),e[42]=$,e[43]=L,e[44]=P):P=e[44];let S;e[45]!==P||e[46]!==g?(S=a.jsxs("div",{className:"flex gap-3",children:[g,P]}),e[45]=P,e[46]=g,e[47]=S):S=e[47];let T;e[48]!==n?(T=n&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:n}),e[48]=n,e[49]=T):T=e[49];let E;e[50]!==n||e[51]!==t?(E=!n&&!t&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:"No description available"}),e[50]=n,e[51]=t,e[52]=E):E=e[52];let z;e[53]!==d||e[54]!==c||e[55]!==t||e[56]!==r?(z=t&&a.jsxs(K,{variant:"outline",size:"sm",onClick:F=>{F.stopPropagation(),r()},disabled:c,className:"w-full mt-auto cursor-pointer",children:[a.jsx(Y,{size:16}),c?"Connecting...":d||"Connect"]}),e[53]=d,e[54]=c,e[55]=t,e[56]=r,e[57]=z):z=e[57];let D;e[58]!==S||e[59]!==T||e[60]!==E||e[61]!==z||e[62]!==h?(D=a.jsxs("div",{className:h,children:[S,T,E,z]}),e[58]=S,e[59]=T,e[60]=E,e[61]=z,e[62]=h,e[63]=D):D=e[63];let A;return e[64]!==r||e[65]!==u||e[66]!==D?(A=a.jsx(te,{className:u,onClick:r,children:D}),e[64]=r,e[65]=u,e[66]=D,e[67]=A):A=e[67],A}function ce(s){const e=s.title||s.server.title||s.id||"Unnamed Item",l=s._meta?.["mcp.mesh"],i=l?.short_description||l?.mesh_description||s.server.description||null,n=s.server.icons?.[0]?.src||le(s.server.repository)||null,r=l?.verified??!1,o=(s.server.remotes?.length??0)>0,t=(s.server.packages?.length??0)>0,f=o||t;let m=e,c=null;if(e.includes("/")){const d=e.split("/");d.length>=2&&(c=d[0]||null,m=ie(e))}if(!c){const d=l?.scopeName,p=l?.appName;d&&p?c=`${d}/${p}`:d&&(c=d)}return l?.friendly_name&&(m=l.friendly_name),{icon:n,scopeName:c,displayName:m,description:i,isVerified:r,canInstall:f}}function Ne(s){const e=V.c(12),{items:l,title:i,onItemClick:n}=s;if(l.length===0)return null;let r;e[0]!==i?(r=i&&a.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:a.jsx("h2",{className:"text-lg font-medium",children:i})}),e[0]=i,e[1]=r):r=e[1];let o;if(e[2]!==l||e[3]!==n){let m;e[5]!==n?(m=c=>{const d=ce(c);return a.jsx(oe,{...d,onClick:()=>n(c)},c.id)},e[5]=n,e[6]=m):m=e[6],o=l.map(m),e[2]=l,e[3]=n,e[4]=o}else o=e[4];let t;e[7]!==o?(t=a.jsx("div",{className:"grid grid-cols-4 gap-4",children:o}),e[7]=o,e[8]=t):t=e[8];let f;return e[9]!==r||e[10]!==t?(f=a.jsxs("div",{className:"flex flex-col gap-4",children:[r,t]}),e[9]=r,e[10]=t,e[11]=f):f=e[11],f}export{Ne as M,oe as a,W as b,ie as e};
1
+ import{r as B,c as V,j as a}from"./index-Diww4UW3.js";import{b as O,T as q,c as J}from"./tooltip-Suu_Gpqh.js";import{c as M,B as K}from"./button-CGmrzkpY.js";import{s as Q}from"./registry-utils-8Lvx2XTy.js";import{i as X}from"./Lock01-BuQSktMF.js";import{s as Y}from"./Plus-CdG75X26.js";import{i as ee}from"./Terminal-C6mZx-5A.js";import{C as te}from"./card-DIjMh1NO.js";import{I as se}from"./empty-state-wP9uukGJ.js";import{g as le}from"./github-icon-Dp3wHhYE.js";const U=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"m9 12 2 2 4.5-4.5m2.401-4.501a2.03 2.03 0 0 0 1.1 1.1l1.744.723a2.033 2.033 0 0 1 1.1 2.656l-.722 1.744a2.03 2.03 0 0 0 0 1.556l.722 1.744a2.033 2.033 0 0 1-1.1 2.656L19 17.901A2.033 2.033 0 0 0 17.9 19l-.723 1.745a2.032 2.032 0 0 1-2.656 1.1l-1.744-.722a2.032 2.032 0 0 0-1.555 0l-1.745.723a2.033 2.033 0 0 1-2.654-1.1L6.1 19.001A2.033 2.033 0 0 0 5 17.9l-1.744-.723a2.033 2.033 0 0 1-1.1-2.654l.721-1.744a2.033 2.033 0 0 0 0-1.556l-.722-1.746a2.033 2.033 0 0 1 1.1-2.657L5 6.098A2.03 2.03 0 0 0 6.1 5l.723-1.745a2.033 2.033 0 0 1 2.656-1.1l1.744.722a2.033 2.033 0 0 0 1.555-.001l1.746-.72a2.032 2.032 0 0 1 2.655 1.1l.723 1.746v-.003Z"}));U.displayName="CheckVerified02";const W=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"M6 6h.01M6 18h.01m-.81-8h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 8.48 22 7.92 22 6.8V5.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 2 19.92 2 18.8 2H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 3.52 2 4.08 2 5.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 10 4.08 10 5.2 10Zm0 12h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 20.48 22 19.92 22 18.8v-1.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 14 19.92 14 18.8 14H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 15.52 2 16.08 2 17.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 22 4.08 22 5.2 22Z"}));W.displayName="Server01";function ie(s){if(!s.includes("/"))return s;const e=s.split("/"),l=e[0],i=e[1];if(!l||!i)return s;if(l.includes(".")){const n=l.split("."),r=n[n.length-1]||l,o=i.replace(/^mcp-?/,"").replace(/-?mcp$/,"").replace(/^server-?/,"").replace(/-?server$/,"");return!o||o.length<2?r:o}return i}function ae(s){const e=V.c(2),{protocol:l,className:i}=s;let n;return e[0]!==i?(n={http:a.jsx(Q,{className:i}),sse:a.jsx(W,{className:i}),stdio:a.jsx(ee,{className:i})},e[0]=i,e[1]=n):n=e[1],n[l]}function ne(s){switch(s){case"http":return"HTTP";case"sse":return"SSE";case"stdio":return"STDIO"}}function re(s){const e=V.c(9),{protocol:l}=s;let i;e[0]!==l?(i=M("flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium shrink-0",{http:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",sse:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",stdio:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400"}[l]),e[0]=l,e[1]=i):i=e[1];let n,r;e[2]!==l?(n=a.jsx(ae,{protocol:l,className:"w-3 h-3"}),r=ne(l),e[2]=l,e[3]=n,e[4]=r):(n=e[3],r=e[4]);let o;return e[5]!==i||e[6]!==n||e[7]!==r?(o=a.jsxs("div",{className:i,children:[n,r]}),e[5]=i,e[6]=n,e[7]=r,e[8]=o):o=e[8],o}function oe(s){const e=V.c(68),{icon:l,displayName:i,description:n,onClick:r}=s,t=(s.variant??"store")==="server",f=t?s.hostname:null,m=t?s.protocol:null,c=t?s.isInstalling:!1,d=t?s.actionLabel:void 0,p=t?null:s.scopeName,_=t?!1:s.isVerified,x=t?!0:s.canInstall,H=t?"p-4":"p-6";let u;e[0]!==H?(u=M("cursor-pointer hover:bg-muted/50 transition-colors",H),e[0]=H,e[1]=u):u=e[1];const R=t?"gap-3":"gap-4";let h;e[2]!==R?(h=M("flex flex-col h-full relative",R),e[2]=R,e[3]=h):h=e[3];const Z=t?"sm":"md";let g;e[4]!==i||e[5]!==l||e[6]!==Z?(g=a.jsx(se,{icon:l,name:i,size:Z,className:"shadow-sm shrink-0"}),e[4]=i,e[5]=l,e[6]=Z,e[7]=g):g=e[7];const G=t?"text-sm":"text-base";let v;e[8]!==G?(v=M("flex items-center gap-2 font-medium min-w-0",G),e[8]=G,e[9]=v):v=e[9];let j;e[10]!==i?(j=a.jsx("span",{className:"truncate",children:i}),e[10]=i,e[11]=j):j=e[11];let N;e[12]!==t||e[13]!==_?(N=!t&&_&&a.jsx(U,{size:16,className:"text-success shrink-0"}),e[12]=t,e[13]=_,e[14]=N):N=e[14];let C;e[15]!==x||e[16]!==t?(C=!t&&!x&&a.jsx(X,{size:16,className:"text-muted-foreground shrink-0"}),e[15]=x,e[16]=t,e[17]=C):C=e[17];let k;e[18]!==t||e[19]!==m?(k=t&&m&&a.jsx(re,{protocol:m}),e[18]=t,e[19]=m,e[20]=k):k=e[20];let b;e[21]!==C||e[22]!==k||e[23]!==v||e[24]!==j||e[25]!==N?(b=a.jsx(O,{asChild:!0,children:a.jsxs("div",{className:v,children:[j,N,C,k]})}),e[21]=C,e[22]=k,e[23]=v,e[24]=j,e[25]=N,e[26]=b):b=e[26];let w;e[27]!==i?(w=a.jsx("p",{children:i}),e[27]=i,e[28]=w):w=e[28];let y;e[29]!==x||e[30]!==t?(y=!t&&!x&&a.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[29]=x,e[30]=t,e[31]=y):y=e[31];let I;e[32]!==w||e[33]!==y?(I=a.jsxs(q,{children:[w,y]}),e[32]=w,e[33]=y,e[34]=I):I=e[34];let $;e[35]!==b||e[36]!==I?($=a.jsxs(J,{children:[b,I]}),e[35]=b,e[36]=I,e[37]=$):$=e[37];let L;e[38]!==f||e[39]!==t||e[40]!==p?(L=(p||f)&&a.jsx("div",{className:M("text-muted-foreground truncate",t?"text-xs mt-0.5":"text-sm"),children:p||f}),e[38]=f,e[39]=t,e[40]=p,e[41]=L):L=e[41];let P;e[42]!==$||e[43]!==L?(P=a.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:a.jsxs("div",{className:"min-w-0 flex-1",children:[$,L]})}),e[42]=$,e[43]=L,e[44]=P):P=e[44];let S;e[45]!==P||e[46]!==g?(S=a.jsxs("div",{className:"flex gap-3",children:[g,P]}),e[45]=P,e[46]=g,e[47]=S):S=e[47];let T;e[48]!==n?(T=n&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:n}),e[48]=n,e[49]=T):T=e[49];let E;e[50]!==n||e[51]!==t?(E=!n&&!t&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:"No description available"}),e[50]=n,e[51]=t,e[52]=E):E=e[52];let z;e[53]!==d||e[54]!==c||e[55]!==t||e[56]!==r?(z=t&&a.jsxs(K,{variant:"outline",size:"sm",onClick:F=>{F.stopPropagation(),r()},disabled:c,className:"w-full mt-auto cursor-pointer",children:[a.jsx(Y,{size:16}),c?"Connecting...":d||"Connect"]}),e[53]=d,e[54]=c,e[55]=t,e[56]=r,e[57]=z):z=e[57];let D;e[58]!==S||e[59]!==T||e[60]!==E||e[61]!==z||e[62]!==h?(D=a.jsxs("div",{className:h,children:[S,T,E,z]}),e[58]=S,e[59]=T,e[60]=E,e[61]=z,e[62]=h,e[63]=D):D=e[63];let A;return e[64]!==r||e[65]!==u||e[66]!==D?(A=a.jsx(te,{className:u,onClick:r,children:D}),e[64]=r,e[65]=u,e[66]=D,e[67]=A):A=e[67],A}function ce(s){const e=s.title||s.server.title||s.id||"Unnamed Item",l=s._meta?.["mcp.mesh"],i=l?.short_description||l?.mesh_description||s.server.description||null,n=s.server.icons?.[0]?.src||le(s.server.repository)||null,r=l?.verified??!1,o=(s.server.remotes?.length??0)>0,t=(s.server.packages?.length??0)>0,f=o||t;let m=e,c=null;if(e.includes("/")){const d=e.split("/");d.length>=2&&(c=d[0]||null,m=ie(e))}if(!c){const d=l?.scopeName,p=l?.appName;d&&p?c=`${d}/${p}`:d&&(c=d)}return l?.friendly_name&&(m=l.friendly_name),{icon:n,scopeName:c,displayName:m,description:i,isVerified:r,canInstall:f}}function Ne(s){const e=V.c(12),{items:l,title:i,onItemClick:n}=s;if(l.length===0)return null;let r;e[0]!==i?(r=i&&a.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:a.jsx("h2",{className:"text-lg font-medium",children:i})}),e[0]=i,e[1]=r):r=e[1];let o;if(e[2]!==l||e[3]!==n){let m;e[5]!==n?(m=c=>{const d=ce(c);return a.jsx(oe,{...d,onClick:()=>n(c)},c.id)},e[5]=n,e[6]=m):m=e[6],o=l.map(m),e[2]=l,e[3]=n,e[4]=o}else o=e[4];let t;e[7]!==o?(t=a.jsx("div",{className:"grid grid-cols-4 gap-4",children:o}),e[7]=o,e[8]=t):t=e[8];let f;return e[9]!==r||e[10]!==t?(f=a.jsxs("div",{className:"flex flex-col gap-4",children:[r,t]}),e[9]=r,e[10]=t,e[11]=f):f=e[11],f}export{Ne as M,oe as a,W as b,ie as e};
@@ -1 +1 @@
1
- import{r as q,c as R,j as s,f as $e,d as Qe,b as Xe,a as Ye,t as Le}from"./index-skH-OUyO.js";import{i as Ze}from"./AlertCircle-DeGhTF84.js";import{i as De}from"./Loading01-BtKovu_m.js";import{B as ae,c as Je}from"./button-Dh_UOMtF.js";import{i as et}from"./ArrowLeft-m6KeIjPT.js";import{I as Re,E as tt}from"./empty-state-DhpaMqQD.js";import{i as st,e as ot}from"./extract-connection-data-DfFE7uXb.js";import{t as rt}from"./ChevronDown-7pGjkuTY.js";import{s as Pe}from"./Plus-CPExS1G1.js";import{D as nt,c as it,a as lt,b as at}from"./dropdown-menu-T7u8fl7N.js";import{n as Me}from"./LinkExternal01-B4WpWXG7.js";import{T as ct,R as dt}from"./tools-list-DNdG8U23.js";import{R as mt}from"./resource-tabs-Dzc9tSXU.js";import{s as ft,f as ut,g as pt,c as xt}from"./registry-utils-8goOeMwE.js";import{a as ht,b as gt,e as vt}from"./mcp-server-card-DTQIT3pj.js";import{i as bt}from"./Terminal-LP4GeLJv.js";import{a as jt,u as yt,b as Nt}from"./use-connection-BY9aOm7H.js";import{u as St}from"./use-binding-R6SoNecZ.js";import{u as Ct}from"./use-tool-call-_jHZu2qb.js";import{u as wt}from"./use-mcp-DUgnx05H.js";import{u as _t,L as It}from"./localstorage-keys-B_H3St2R.js";import{u as Ee}from"./project-context-provider-Ci1EHyGR.js";import{s as kt}from"./slugify-CEUa2lfQ.js";import{e as Tt,g as Lt}from"./github-icon-Dp3wHhYE.js";import{i as Pt}from"./InfoCircle-DXvgKrQ3.js";import{c as Mt}from"./connection-DuIRkEvB.js";import"./constants-C1rpewgJ.js";import"./generate-id-Dyweu44Y.js";import"./Grid01-XLGz76ym.js";import"./useQuery-FRehIqtM.js";import"./File06-K5gpmB1y.js";import"./collection-display-button-DKfm8yFW.js";import"./ArrowUp-BDjaIiFu.js";import"./Check-Cs5AiVxS.js";import"./List-DWWQESNh.js";import"./tooltip-DgJ4R-G6.js";import"./view-mode-toggle-Z5AVjYj0.js";import"./collection-search-Bm9HY_m8.js";import"./SearchMd-DwKDi1yz.js";import"./input-CdlPz8Vq.js";import"./collection-table-wrapper-CnCS_a8f.js";import"./card-Bjs7HBa2.js";import"./layout-DopLDDPE.js";import"./badge-ChGpQW0J.js";import"./Lock01-CDOVc6ZJ.js";import"./use-collections-CC15C_nK.js";import"./useMutation-n0xwrWOz.js";import"./binder-DZT62WgB.js";const Ae=({size:t=24,color:e="currentColor",...o})=>q.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},q.createElement("path",{d:"m21 21-3.5-3.5m2.5-6a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z"}));Ae.displayName="SearchLg";function Vt(t){const e=R.c(3),{message:o}=t,r=o===void 0?"Loading MCP Server details...":o;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(De,{size:48,className:"animate-spin mb-4"}),e[0]=n):n=e[0];let i;return e[1]!==r?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,s.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),e[1]=r,e[2]=i):i=e[2],i}function $t(t){const e=R.c(9),{error:o,onBack:r}=t,n=o instanceof Error?o.message:o;let i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ze,{size:48,className:"text-destructive mb-4"}),a=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading MCP Server"}),e[0]=i,e[1]=a):(i=e[0],a=e[1]);let c;e[2]!==n?(c=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:n}),e[2]=n,e[3]=c):c=e[3];let l;e[4]!==r?(l=s.jsx("button",{onClick:r,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=r,e[5]=l):l=e[5];let d;return e[6]!==c||e[7]!==l?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,a,c,l]}),e[6]=c,e[7]=l,e[8]=d):d=e[8],d}function Dt(t){const e=R.c(5),{onBack:o}=t;let r,n,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ae,{size:48,className:"text-muted-foreground mb-4"}),n=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"MCP Server not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The MCP Server you're looking for doesn't exist in this store."}),e[0]=r,e[1]=n,e[2]=i):(r=e[0],n=e[1],i=e[2]);let a;return e[3]!==o?(a=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,n,i,s.jsx("button",{onClick:o,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=o,e[4]=a):a=e[4],a}function Rt(t){const e=R.c(3),{onBack:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(et,{}),e[0]=r):r=e[0];let n;return e[1]!==o?(n=s.jsx("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:s.jsx("div",{className:"flex h-full px-2 border-r items-center",children:s.jsx(ae,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:r})})}),e[1]=o,e[2]=n):n=e[2],n}function Ve(t){const e=R.c(28),{versions:o,selectedIndex:r,onSelect:n,isInstalling:i,variant:a,showLabel:c}=t,l=i===void 0?!1:i,d=a===void 0?"brand":a,_=c===void 0?!1:c,p=o[r],y=_?"sm":"default",b=d==="brand"&&"rounded-l-none px-2 border-l-2 border-l-white/50";let I;e[0]!==b?(I=Je("shrink-0 cursor-pointer",b),e[0]=b,e[1]=I):I=e[1];let m;e[2]!==p?.server?.version||e[3]!==_?(m=_&&s.jsxs("span",{className:"mr-1",children:["v",p?.server?.version||"unknown"]}),e[2]=p?.server?.version,e[3]=_,e[4]=m):m=e[4];const N=_?14:20;let f;e[5]!==N?(f=s.jsx(rt,{size:N}),e[5]=N,e[6]=f):f=e[6];let v;e[7]!==l||e[8]!==y||e[9]!==I||e[10]!==m||e[11]!==f||e[12]!==d?(v=s.jsx(nt,{asChild:!0,children:s.jsxs(ae,{variant:d,disabled:l,size:y,className:I,children:[m,f]})}),e[7]=l,e[8]=y,e[9]=I,e[10]=m,e[11]=f,e[12]=d,e[13]=v):v=e[13];let x;if(e[14]!==l||e[15]!==n||e[16]!==r||e[17]!==o){let g;e[19]!==l||e[20]!==n||e[21]!==r?(g=(S,C)=>{const P=S._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(it,{onClick:()=>n(C),disabled:l,className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"font-medium text-sm",children:["v",S.server?.version||"unknown"]}),P?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),C===r&&s.jsx(st,{size:16,className:"text-muted-foreground shrink-0"})]})},C)},e[19]=l,e[20]=n,e[21]=r,e[22]=g):g=e[22],x=o.map(g),e[14]=l,e[15]=n,e[16]=r,e[17]=o,e[18]=x}else x=e[18];let k;e[23]!==x?(k=s.jsx(lt,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:x}),e[23]=x,e[24]=k):k=e[24];let j;return e[25]!==v||e[26]!==k?(j=s.jsxs(at,{children:[v,k]}),e[25]=v,e[26]=k,e[27]=j):j=e[27],j}function Et(t){const e=R.c(46),{data:o,itemVersions:r,onInstall:n,canInstall:i,isInstalling:a,hideInstallControls:c,selectedVersionIndex:l,onVersionChange:d}=t,_=i===void 0?!0:i,p=a===void 0?!1:a,y=c===void 0?!1:c,[b,I]=q.useState(0),m=l??b;let N;e[0]!==d?(N=U=>{I(U),d?.(U)},e[0]=d,e[1]=N):N=e[1];const f=N,v=r[m]||r[0];let x;e[2]!==v?.server?.remotes?(x=v?.server?.remotes??[],e[2]=v?.server?.remotes,e[3]=x):x=e[3];const k=x;let j;e[4]!==v?.server?.packages?(j=v?.server?.packages??[],e[4]=v?.server?.packages,e[5]=j):j=e[5];const S=j.length>0,C=k.length>0,P=k.findIndex(Ut),h=P>=0?P:0;let K;e[6]!==h||e[7]!==S||e[8]!==C||e[9]!==n||e[10]!==m?(K=()=>{C?n(m,h,void 0):S&&n(m,void 0,0)},e[6]=h,e[7]=S,e[8]=C,e[9]=n,e[10]=m,e[11]=K):K=e[11];const E=K;let G;e[12]!==r||e[13]!==n||e[14]!==f?(G=U=>{f(U);const J=r[U],W=J?.server?.remotes??[],Q=J?.server?.packages??[];if(W.length>0){const X=W.findIndex(At);n(U,X>=0?X:0,void 0)}else Q.length>0&&n(U,void 0,0)},e[12]=r,e[13]=n,e[14]=f,e[15]=G):G=e[15];const L=G;let V;e[16]!==o.icon||e[17]!==o.name?(V=s.jsx(Re,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[16]=o.icon,e[17]=o.name,e[18]=V):V=e[18];let M;e[19]!==o.name?(M=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[19]=o.name,e[20]=M):M=e[20];let z;e[21]!==o.verified?(z=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[21]=o.verified,e[22]=z):z=e[22];let O;e[23]!==M||e[24]!==z?(O=s.jsxs("div",{className:"flex items-center gap-2",children:[M,z]}),e[23]=M,e[24]=z,e[25]=O):O=e[25];let H;e[26]!==o.shortDescription?(H=o.shortDescription&&s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:o.shortDescription}),e[26]=o.shortDescription,e[27]=H):H=e[27];let $;e[28]!==O||e[29]!==H?($=s.jsxs("div",{className:"flex-1 min-w-0",children:[O,H]}),e[28]=O,e[29]=H,e[30]=$):$=e[30];let A;e[31]!==_||e[32]!==E||e[33]!==L||e[34]!==y||e[35]!==p||e[36]!==r||e[37]!==m||e[38]!==f?(A=_&&!y?s.jsx("div",{className:"shrink-0 flex items-center gap-2",children:r.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ae,{variant:"brand",onClick:E,disabled:p,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(Pe,{size:20}),p?"Connecting...":"Connect"]}),s.jsx(Ve,{versions:r,selectedIndex:m,onSelect:L,isInstalling:p,variant:"brand"})]}):s.jsxs(ae,{variant:"brand",onClick:E,disabled:r.length===0||p,className:"shrink-0 cursor-pointer",children:[s.jsx(Pe,{size:20}),p?"Connecting...":"Connect"]})}):y?r.length>1?s.jsx("div",{className:"shrink-0",children:s.jsx(Ve,{versions:r,selectedIndex:m,onSelect:f,isInstalling:p,variant:"outline",showLabel:!0})}):null:s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[31]=_,e[32]=E,e[33]=L,e[34]=y,e[35]=p,e[36]=r,e[37]=m,e[38]=f,e[39]=A):A=e[39];let w;e[40]!==$||e[41]!==A?(w=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[$,A]}),e[40]=$,e[41]=A,e[42]=w):w=e[42];let T;return e[43]!==w||e[44]!==V?(T=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[V,w]}),e[43]=w,e[44]=V,e[45]=T):T=e[45],T}function At(t){return t.type?.toLowerCase()==="http"||t.type?.toLowerCase()==="streamable-http"}function Ut(t){return t.type?.toLowerCase()==="http"||t.type?.toLowerCase()==="streamable-http"}function Bt(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function zt(t){const e=R.c(47),{data:o,publisherInfo:r,selectedItem:n}=t;let i;e[0]!==o.description?(i=o.description&&s.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[s.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),s.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:o.description})]}),e[0]=o.description,e[1]=i):i=e[1];const a=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let c;e[2]!==r.logo||e[3]!==a?(c=s.jsx(Re,{icon:r.logo,name:a,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=r.logo,e[3]=a,e[4]=c):c=e[4];let l;e[5]!==o.publisher?(l=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher.charAt(0).toUpperCase()+o.publisher.slice(1),e[5]=o.publisher,e[6]=l):l=e[6];let d;e[7]!==l?(d=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=d):d=e[8];let _;e[9]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("div",{className:"text-xs text-muted-foreground",children:"Publisher"}),e[9]=_):_=e[9];let p;e[10]!==d?(p=s.jsxs("div",{children:[d,_]}),e[10]=d,e[11]=p):p=e[11];let y;e[12]!==c||e[13]!==p?(y=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[c,p]})}),e[12]=c,e[13]=p,e[14]=y):y=e[14];let b;e[15]!==o.version?(b=o.version&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Version"}),s.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",o.version]})]}),e[15]=o.version,e[16]=b):b=e[16];let I;e[17]!==o.tags?(I=o.tags&&o.tags.length>0&&s.jsxs("div",{className:"flex justify-between items-start text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Tags"}),s.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:o.tags.map(Ft)})]}),e[17]=o.tags,e[18]=I):I=e[18];let m;e[19]!==o.categories?(m=o.categories&&o.categories.length>0&&s.jsxs("div",{className:"flex justify-between items-start text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Categories"}),s.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:o.categories.map(Ot)})]}),e[19]=o.categories,e[20]=m):m=e[20];let N;e[21]!==o.connectionType?(N=o.connectionType&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:o.connectionType})]}),e[21]=o.connectionType,e[22]=N):N=e[22];let f;e[23]!==o.schemaVersion?(f=o.schemaVersion&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:o.schemaVersion})]}),e[23]=o.schemaVersion,e[24]=f):f=e[24];let v;e[25]!==o.websiteUrl?(v=o.websiteUrl&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Website"}),s.jsxs("a",{href:o.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"Visit"}),s.jsx(Me,{size:14})]})]}),e[25]=o.websiteUrl,e[26]=v):v=e[26];let x;e[27]!==o.repository?(x=o.repository?.url&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Source"}),s.jsxs("a",{href:o.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"GitHub"}),s.jsx(Me,{size:14})]})]}),e[27]=o.repository,e[28]=x):x=e[28];let k;e[29]!==I||e[30]!==m||e[31]!==N||e[32]!==f||e[33]!==v||e[34]!==x||e[35]!==b?(k=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[b,I,m,N,f,v,x]}),e[29]=I,e[30]=m,e[31]=N,e[32]=f,e[33]=v,e[34]=x,e[35]=b,e[36]=k):k=e[36];let j;e[37]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[37]=j):j=e[37];let g;e[38]!==n.updated_at?(g=Bt(n.updated_at),e[38]=n.updated_at,e[39]=g):g=e[39];let S;e[40]!==g?(S=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[j,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:g})]}),e[40]=g,e[41]=S):S=e[41];let C;return e[42]!==i||e[43]!==k||e[44]!==S||e[45]!==y?(C=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,y,k,S]}),e[42]=i,e[43]=k,e[44]=S,e[45]=y,e[46]=C):C=e[46],C}function Ot(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}function Ft(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}const Gt=[{value:"http",label:"HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"STDIO"},{value:"all",label:"All"}],Ht={docs:"Documentation",bindings:"Workers Bindings",builds:"Workers Builds",observability:"Observability",radar:"Radar",containers:"Containers",browser:"Browser Rendering",logs:"Logpush",autorag:"AutoRAG",auditlogs:"Audit Logs",graphql:"GraphQL",dex:"DEX Monitoring",casb:"CASB"};function Wt(t){if(!t)return"Local";try{return new URL(t).hostname}catch{return t}}function qt(t){if(!t)return"local";try{const e=new URL(t).hostname;return e.split(".")[0]||e}catch{return"unknown"}}function Kt(t){const e=Ht[t.toLowerCase()];return e||t.replace(/[-_]/g," ").replace(/\b\w/g,o=>o.toUpperCase())}function Qt(t){if(!t)return"http";const e=t.toLowerCase();return e==="sse"?"sse":e==="stdio"?"stdio":"http"}function Xt(t){return t.map((e,o)=>{const r=Qt(e.type),n=Wt(e.url),i=qt(e.url),a=e.title||e.name||Kt(i);return{index:o,protocol:r,url:e.url,hostname:n,serviceName:i,displayName:a,name:e.name,title:e.title,description:e.description,_type:e._type,_index:e._index}})}function Yt(t){const e=R.c(2),{protocol:o,className:r}=t;let n;return e[0]!==r?(n={http:s.jsx(ft,{className:r}),sse:s.jsx(gt,{className:r}),stdio:s.jsx(bt,{className:r})},e[0]=r,e[1]=n):n=e[1],n[o]}function Zt(t){const e=R.c(10),{options:o,selected:r,onSelect:n}=t;if(o.length<=1)return null;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"text-sm text-muted-foreground",children:"Protocol:"}),e[0]=i):i=e[0];let a;if(e[1]!==n||e[2]!==o||e[3]!==r){let l;e[5]!==n||e[6]!==r?(l=d=>s.jsxs(ae,{variant:r===d.value?"default":"outline",size:"sm",onClick:()=>n(d.value),className:"cursor-pointer",children:[s.jsx(Yt,{protocol:d.value==="all"?"http":d.value,className:"w-4 h-4 mr-1"}),d.label]},d.value),e[5]=n,e[6]=r,e[7]=l):l=e[7],a=o.map(l),e[1]=n,e[2]=o,e[3]=r,e[4]=a}else a=e[4];let c;return e[8]!==a?(c=s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[i,s.jsx("div",{className:"flex gap-1",children:a})]}),e[8]=a,e[9]=c):c=e[9],c}function Jt(t){const e=R.c(11),{servers:o,onInstall:r,isInstalling:n,icon:i,mcpName:a,showStdio:c}=t,l=n===void 0?!1:n,d=c===void 0?!1:c,_=d?o:o.filter(os),p=Xt(_),y=p.length<13?"all":"http",[b,I]=q.useState(y);let m;e:{if(b==="all"){m="all";break e}let h;if(e[0]!==b?(h=E=>E.protocol===b,e[0]=b,e[1]=h):h=e[1],p.some(h)){m=b;break e}if(p.length<13){m="all";break e}m=p[0]?.protocol??"http"}const N=m,f=N==="all"?p:p.filter(h=>h.protocol===N),v=new Set(p.map(ss));let x=Gt.filter(h=>h.value==="all"||v.has(h.value));d||(x=x.filter(ts));const k=v.size<=1?x.filter(es):x,j="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4";let g;e[2]!==i||e[3]!==l||e[4]!==a||e[5]!==r?(g=h=>s.jsx(ht,{variant:"server",icon:i??null,displayName:h.displayName,description:h.description??null,hostname:h.hostname,protocol:h.protocol,isInstalling:l,onClick:()=>r({type:h.protocol,url:h.url,name:h.name,title:h.title,description:h.description,_type:h._type,_index:h._index})},`${h.hostname}-${h.protocol}-${h.index}`),e[2]=i,e[3]=l,e[4]=a,e[5]=r,e[6]=g):g=e[6];const S=f.map(g);let C;e[7]!==S?(C=s.jsx("div",{className:j,children:S}),e[7]=S,e[8]=C):C=e[8];let P;return e[9]!==f.length?(P=f.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No servers match the selected filter."}),e[9]=f.length,e[10]=P):P=e[10],s.jsxs("div",{className:"p-5",children:[s.jsx(Zt,{options:k,selected:N,onSelect:I}),C,P]})}function es(t){return t.value!=="all"}function ts(t){return t.value!=="stdio"}function ss(t){return t.protocol}function os(t){return t.type?.toLowerCase()!=="stdio"}function rs(t){const e=R.c(29),{data:o,availableTabs:r,effectiveActiveTabId:n,effectiveTools:i,isLoadingTools:a,onTabChange:c,servers:l,onInstallServer:d,isInstalling:_,mcpIcon:p,mcpName:y,showStdio:b}=t,I=a===void 0?!1:a;let m;e[0]!==l?(m=l===void 0?[]:l,e[0]=l,e[1]=m):m=e[1];const N=m,f=_===void 0?!1:_,v=b===void 0?!1:b;let x;e[2]!==i?(x=i.map(ns),e[2]=i,e[3]=x):x=e[3];const k=x;let j;e[4]!==r||e[5]!==n||e[6]!==c?(j=r.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(mt,{tabs:r,activeTab:n,onTabChange:c})}),e[4]=r,e[5]=n,e[6]=c,e[7]=j):j=e[7];let g;e[8]!==n||e[9]!==f||e[10]!==p||e[11]!==y||e[12]!==d||e[13]!==N||e[14]!==v?(g=n==="servers"&&N.length>0&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Jt,{servers:N,onInstall:h=>d?.(h),isInstalling:f,icon:p,mcpName:y,showStdio:v})}),e[8]=n,e[9]=f,e[10]=p,e[11]=y,e[12]=d,e[13]=N,e[14]=v,e[15]=g):g=e[15];let S;e[16]!==n||e[17]!==i.length||e[18]!==I||e[19]!==k?(S=n==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:I?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(De,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(ct,{tools:k,showToolbar:!1,emptyMessage:"This MCP Server doesn't have any tools."}):s.jsx(tt,{image:null,title:"No tools available",description:"This MCP Server doesn't have any tools."})}),e[16]=n,e[17]=i.length,e[18]=I,e[19]=k,e[20]=S):S=e[20];let C;e[21]!==o?.repository||e[22]!==n?(C=n==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(dt,{repository:o?.repository})}),e[21]=o?.repository,e[22]=n,e[23]=C):C=e[23];let P;return e[24]!==C||e[25]!==j||e[26]!==g||e[27]!==S?(P=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[j,g,S,C]}),e[24]=C,e[25]=j,e[26]=g,e[27]=S,e[28]=P):P=e[28],P}function ns(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function is(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(r=>r.app_name?.toLowerCase()===o||r.app_id?.toLowerCase()===o||r.title.toLowerCase()===o)||t.find(r=>r.title.toLowerCase().includes(o))}function ls(t,e,o,r,n){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:r?.icon||void 0,count:n??t.length};const i=e.toLowerCase(),a=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:o?.icon||a[0]?.publisher_logo||a[0]?.icon||void 0,count:a.length}}function as(t){const e=t._meta?.["mcp.mesh"],o=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,n=pt(r.remotes?.[0]?.type),i=xt(r.$schema),a=o?"io.modelcontextprotocol.registry/official":t.publisher||e?.scopeName||"Unknown",c=Lt(r.repository),l=t.icon||t.image||t.logo||r.icons?.[0]?.src||c||null,d=t.name||t.title||t.server?.title||"Unnamed Item",_=vt(d),p=e?.friendly_name||_,y=e?.mesh_description||t.description||t.summary||r?.description||"",b=e?.short_description||null,I=e?.tags||[],m=e?.categories||[];return{name:p,description:y,shortDescription:b,icon:l,verified:t.verified||e?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:i??null,connectionType:n,connectionUrl:null,remoteUrl:null,tags:I,categories:m,tools:t.tools||r.tools||e?.tools||[],models:t.models||r.models||e?.models||[],emails:t.emails||r.emails||e?.emails||[],analytics:t.analytics||r.analytics||e?.analytics,cdn:t.cdn||r.cdn||e?.cdn}}class cs extends q.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store MCP server detail error:",e,o)}render(){return this.state.hasError?s.jsx($t,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ds(){const t=R.c(67),{org:e}=Ee(),o=$e();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{appName:n}=Qe(r);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:a,serverName:c,stdio:l}=Xe(i);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=It.storeShowStdio(),t[2]=d):d=t[2];const[_,p]=_t(d,ys),y=l==="true"?!0:l==="false"?!1:_;l!==void 0&&l==="true"!==_&&p(l==="true");const[b,I]=q.useState(null),[m,N]=q.useState(null),f=jt(),v=yt(),{data:x}=Ye.useSession(),k=St(v),j=a||k[0]?.id||"",g=Nt(j),S=ut(g?.tools),C=g?.tools&&g.tools.find(js)?.name||"",P=g?.tools&&g.tools.find(bs)?.name||"",h=Mt(j),K=!!c;let E,G;K?(E=C||P,G={name:c}):(E=S,G={});const{data:L}=Ct({toolCaller:h,toolName:E,toolInputParams:G,scope:j});let V=[],M=[],z=null;if(L){if(Array.isArray(L))V=L;else if(typeof L=="object"&&L!==null)if("totalCount"in L&&typeof L.totalCount=="number"&&(z=L.totalCount),"item"in L&&L.item){const u=L.item,D=u.id||"",Z=u.server,le=u._meta;let B;t[3]!==u.title||t[4]!==D||t[5]!==Z||t[6]!==le?(B=[{id:D,title:u.title,server:Z,_meta:le}],t[3]=u.title,t[4]=D,t[5]=Z,t[6]=le,t[7]=B):B=t[7],V=B}else{let u;"versions"in L&&Array.isArray(L.versions)?u="versions":"servers"in L&&Array.isArray(L.servers)?u="servers":u=Object.keys(L).find(D=>Array.isArray(L[D])),u&&(V=L[u],(u==="versions"||E?.includes("VERSIONS"))&&(M=V))}}const O=M.findIndex(vs),H=O>=0?O:0,$=m??H;let A;t[8]!==n?(A=u=>{const D=u.name||u.title||u.server.title||"";return kt(D)===n},t[8]=n,t[9]=A):A=t[9];let w=V.find(A);if(!w&&c){let u;t[10]!==c?(u=D=>D.server.name===c||D.name===c||D.title===c,t[10]=c,t[11]=u):u=t[11],w=V.find(u)}const T=w?as(w):null,U=(T?.tools?.length||0)>0,J=w?.server?.remotes?.[0]?.url||null,W=!U&&!!J,Q=wt({url:W?J:""}),ye=W&&Q.state==="connecting";let X;t[12]!==Q||t[13]!==W?(X=W&&Q.state==="ready"?(Q.tools||[]).map(gs):[],t[12]=Q,t[13]=W,t[14]=X):X=t[14];const Te=X,ce=U?T?.tools||[]:Te,Ue=is(v,T?.publisher),Ne=T?ls(V,T.publisher,Ue,g??null,z):{count:0},Be=T?.repository?Tt(T.repository):null,ze=w?.server?.remotes??[],Oe=w?.server?.packages??[],Se=[...ze.map(hs),...Oe.map(xs)],de=y?Se:Se.filter(ps),ee=de.length>1;let te;t[15]!==ee||t[16]!==de.length?(te={id:"servers",label:"Servers",count:de.length,visible:ee},t[15]=ee,t[16]=de.length,t[17]=te):te=t[17];const Ce=!!T?.repository&&!!Be;let se;t[18]!==Ce?(se={id:"readme",label:"README",visible:Ce},t[18]=Ce,t[19]=se):se=t[19];const we=U||Te.length>0||ye&&!!J;let oe;t[20]!==ce.length||t[21]!==we?(oe={id:"tools",label:"Tools",count:ce.length,visible:we},t[20]=ce.length,t[21]=we,t[22]=oe):oe=t[22];let me;t[23]!==te||t[24]!==se||t[25]!==oe?(me=[te,se,oe].filter(us),t[23]=te,t[24]=se,t[25]=oe,t[26]=me):me=t[26];const F=me;let fe;t[27]!==F?(fe=F.find(fs)?.id||F.find(ms)?.id||F[0]?.id||"overview",t[27]=F,t[28]=fe):fe=t[28];const _e=fe;let ue;t[29]!==b||t[30]!==F||t[31]!==_e?(ue=b&&F.find(u=>u.id===b)?b:_e,t[29]=b,t[30]=F,t[31]=_e,t[32]=ue):ue=t[32];const Fe=ue;let pe;t[33]!==f||t[34]!==M||t[35]!==o||t[36]!==e||t[37]!==w||t[38]!==x?(pe=async(u,D,Z)=>{const le=M[u??0]||w;if(!le||!e||!x?.user?.id)return;const B=ot(le,e.id,x.user.id,{remoteIndex:Z===void 0?D??0:void 0,packageIndex:Z}),We=B.connection_type==="STDIO",qe=!!B.connection_url,Ke=We&&B.connection_headers&&typeof B.connection_headers=="object"&&"command"in B.connection_headers;if(!qe&&!Ke){Le.error("This MCP Server cannot be connected: no connection method available");return}try{const{id:Ie}=await f.create.mutateAsync(B);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:Ie}})}catch(Ie){const ke=Ie;Le.error(`Failed to connect MCP Server: ${ke instanceof Error?ke.message:String(ke)}`)}},t[33]=f,t[34]=M,t[35]=o,t[36]=e,t[37]=w,t[38]=x,t[39]=pe):pe=t[39];const Y=pe;let xe;t[40]!==o||t[41]!==e.slug?(xe=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[40]=o,t[41]=e.slug,t[42]=xe):xe=t[42];const re=xe;if(!w){let u;return t[43]!==re?(u=s.jsx(Dt,{onBack:re}),t[43]=re,t[44]=u):u=t[44],u}if(!T)return null;const Ge=(w?.server?.remotes?.length??0)>0,He=(w?.server?.packages?.length??0)>0,ne=Ge||He;let he;t[45]!==re?(he=s.jsx(Rt,{onBack:re}),t[45]=re,t[46]=he):he=t[46];let ge;t[47]!==ne?(ge=!ne&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(Pt,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[47]=ne,t[48]=ge):ge=t[48];let ie;t[49]!==M||t[50]!==w?(ie=M.length>0?M:[w],t[49]=M,t[50]=w,t[51]=ie):ie=t[51];let ve;t[52]!==f.create.isPending||t[53]!==ne||t[54]!==T||t[55]!==$||t[56]!==Y||t[57]!==ee||t[58]!==ie?(ve=s.jsx(Et,{data:T,itemVersions:ie,onInstall:Y,canInstall:ne,isInstalling:f.create.isPending,hideInstallControls:ee,selectedVersionIndex:$,onVersionChange:N}),t[52]=f.create.isPending,t[53]=ne,t[54]=T,t[55]=$,t[56]=Y,t[57]=ee,t[58]=ie,t[59]=ve):ve=t[59];let be;t[60]!==T||t[61]!==Ne||t[62]!==w?(be=s.jsx(zt,{data:T,publisherInfo:Ne,selectedItem:w}),t[60]=T,t[61]=Ne,t[62]=w,t[63]=be):be=t[63];let je;return t[64]!==$||t[65]!==Y?(je=u=>{u._type==="remote"?Y($,u._index,void 0):Y($,void 0,u._index)},t[64]=$,t[65]=Y,t[66]=je):je=t[66],s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[he,s.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:s.jsx("div",{className:"h-full",children:s.jsxs("div",{className:"h-full",children:[ge,ve,s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[be,s.jsx(rs,{data:T,availableTabs:F,effectiveActiveTabId:Fe,effectiveTools:ce,isLoadingTools:ye,onTabChange:I,servers:Se,onInstallServer:je,isInstalling:f.create.isPending,mcpIcon:T.icon,mcpName:T.name,showStdio:y})]})]})})})]})}function ms(t){return t.id==="readme"}function fs(t){return t.id==="servers"}function us(t){return t.visible}function ps(t){return t.type?.toLowerCase()!=="stdio"}function xs(t,e){return{type:"stdio",url:void 0,name:t.name||t.identifier,title:t.name||t.identifier?.replace(/^@[^/]+\//,""),description:t.environmentVariables?.length?`Requires ${t.environmentVariables.length} environment variable(s)`:void 0,_type:"package",_index:e}}function hs(t,e){return{...t,_type:"remote",_index:e}}function gs(t){return{name:t.name,description:t.description}}function vs(t){return t._meta?.["io.modelcontextprotocol.registry/official"]?.isLatest===!0}function bs(t){return t.name.endsWith("_GET")}function js(t){return t.name.endsWith("_VERSIONS")}function ys(){return!1}function go(){const t=R.c(6),{org:e}=Ee(),o=$e();let r;t[0]!==o||t[1]!==e.slug?(r=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=r):r=t[2];const n=r;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(q.Suspense,{fallback:s.jsx(Vt,{}),children:s.jsx(ds,{})}),t[3]=i):i=t[3];let a;return t[4]!==n?(a=s.jsx(cs,{onBack:n,children:i}),t[4]=n,t[5]=a):a=t[5],a}export{go as default};
1
+ import{r as q,c as R,j as s,f as $e,d as Qe,b as Xe,a as Ye,t as Le}from"./index-Diww4UW3.js";import{i as Ze}from"./AlertCircle-CI2U-jkN.js";import{i as De}from"./Loading01-Ae5ezbtD.js";import{B as ae,c as Je}from"./button-CGmrzkpY.js";import{i as et}from"./ArrowLeft-B3km7toT.js";import{I as Re,E as tt}from"./empty-state-wP9uukGJ.js";import{i as st,e as ot}from"./extract-connection-data-BLs0SRok.js";import{t as rt}from"./ChevronDown-DP6jvip7.js";import{s as Pe}from"./Plus-CdG75X26.js";import{D as nt,c as it,a as lt,b as at}from"./dropdown-menu-CAeD2aIb.js";import{n as Me}from"./LinkExternal01-DmruqAb9.js";import{T as ct,R as dt}from"./tools-list-mr-l2d8l.js";import{R as mt}from"./resource-tabs-ACbF96qo.js";import{s as ft,f as ut,g as pt,c as xt}from"./registry-utils-8Lvx2XTy.js";import{a as ht,b as gt,e as vt}from"./mcp-server-card-VZUBDTRj.js";import{i as bt}from"./Terminal-C6mZx-5A.js";import{a as jt,u as yt,b as Nt}from"./use-connection-CCXutWLD.js";import{u as St}from"./use-binding-D6wv_5fO.js";import{u as Ct}from"./use-tool-call-BmvKn7jp.js";import{u as wt}from"./use-mcp-D9llr83X.js";import{u as _t,L as It}from"./localstorage-keys-BVANkONM.js";import{u as Ee}from"./project-context-provider-DulCVL2k.js";import{s as kt}from"./slugify-CEUa2lfQ.js";import{e as Tt,g as Lt}from"./github-icon-Dp3wHhYE.js";import{i as Pt}from"./InfoCircle-BgIkbjJr.js";import{c as Mt}from"./connection-ChwHK0-S.js";import"./constants-J0aH6mLs.js";import"./generate-id-Dyweu44Y.js";import"./Grid01-D4lXvveX.js";import"./useQuery-Bvk0U2ed.js";import"./File06-KMD38I-q.js";import"./collection-display-button-CtkxsCB_.js";import"./ArrowUp-BF7mM4C2.js";import"./Check-BQkm1TiP.js";import"./List-BsSZz32j.js";import"./tooltip-Suu_Gpqh.js";import"./view-mode-toggle-BLClM-0g.js";import"./collection-search-BVb42O45.js";import"./SearchMd-GFaonOaJ.js";import"./input-CrURMEZe.js";import"./collection-table-wrapper-BohFZqii.js";import"./card-DIjMh1NO.js";import"./layout-kp8TTJc9.js";import"./badge-BVO6I0sW.js";import"./Lock01-BuQSktMF.js";import"./use-collections-CXETocKO.js";import"./useMutation-Dl1MMkEC.js";import"./binder-By0LBK9Y.js";const Ae=({size:t=24,color:e="currentColor",...o})=>q.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},q.createElement("path",{d:"m21 21-3.5-3.5m2.5-6a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z"}));Ae.displayName="SearchLg";function Vt(t){const e=R.c(3),{message:o}=t,r=o===void 0?"Loading MCP Server details...":o;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(De,{size:48,className:"animate-spin mb-4"}),e[0]=n):n=e[0];let i;return e[1]!==r?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,s.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),e[1]=r,e[2]=i):i=e[2],i}function $t(t){const e=R.c(9),{error:o,onBack:r}=t,n=o instanceof Error?o.message:o;let i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Ze,{size:48,className:"text-destructive mb-4"}),a=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading MCP Server"}),e[0]=i,e[1]=a):(i=e[0],a=e[1]);let c;e[2]!==n?(c=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:n}),e[2]=n,e[3]=c):c=e[3];let l;e[4]!==r?(l=s.jsx("button",{onClick:r,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=r,e[5]=l):l=e[5];let d;return e[6]!==c||e[7]!==l?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,a,c,l]}),e[6]=c,e[7]=l,e[8]=d):d=e[8],d}function Dt(t){const e=R.c(5),{onBack:o}=t;let r,n,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ae,{size:48,className:"text-muted-foreground mb-4"}),n=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"MCP Server not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The MCP Server you're looking for doesn't exist in this store."}),e[0]=r,e[1]=n,e[2]=i):(r=e[0],n=e[1],i=e[2]);let a;return e[3]!==o?(a=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,n,i,s.jsx("button",{onClick:o,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=o,e[4]=a):a=e[4],a}function Rt(t){const e=R.c(3),{onBack:o}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(et,{}),e[0]=r):r=e[0];let n;return e[1]!==o?(n=s.jsx("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:s.jsx("div",{className:"flex h-full px-2 border-r items-center",children:s.jsx(ae,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:r})})}),e[1]=o,e[2]=n):n=e[2],n}function Ve(t){const e=R.c(28),{versions:o,selectedIndex:r,onSelect:n,isInstalling:i,variant:a,showLabel:c}=t,l=i===void 0?!1:i,d=a===void 0?"brand":a,_=c===void 0?!1:c,p=o[r],y=_?"sm":"default",b=d==="brand"&&"rounded-l-none px-2 border-l-2 border-l-white/50";let I;e[0]!==b?(I=Je("shrink-0 cursor-pointer",b),e[0]=b,e[1]=I):I=e[1];let m;e[2]!==p?.server?.version||e[3]!==_?(m=_&&s.jsxs("span",{className:"mr-1",children:["v",p?.server?.version||"unknown"]}),e[2]=p?.server?.version,e[3]=_,e[4]=m):m=e[4];const N=_?14:20;let f;e[5]!==N?(f=s.jsx(rt,{size:N}),e[5]=N,e[6]=f):f=e[6];let v;e[7]!==l||e[8]!==y||e[9]!==I||e[10]!==m||e[11]!==f||e[12]!==d?(v=s.jsx(nt,{asChild:!0,children:s.jsxs(ae,{variant:d,disabled:l,size:y,className:I,children:[m,f]})}),e[7]=l,e[8]=y,e[9]=I,e[10]=m,e[11]=f,e[12]=d,e[13]=v):v=e[13];let x;if(e[14]!==l||e[15]!==n||e[16]!==r||e[17]!==o){let g;e[19]!==l||e[20]!==n||e[21]!==r?(g=(S,C)=>{const P=S._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(it,{onClick:()=>n(C),disabled:l,className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"font-medium text-sm",children:["v",S.server?.version||"unknown"]}),P?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),C===r&&s.jsx(st,{size:16,className:"text-muted-foreground shrink-0"})]})},C)},e[19]=l,e[20]=n,e[21]=r,e[22]=g):g=e[22],x=o.map(g),e[14]=l,e[15]=n,e[16]=r,e[17]=o,e[18]=x}else x=e[18];let k;e[23]!==x?(k=s.jsx(lt,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:x}),e[23]=x,e[24]=k):k=e[24];let j;return e[25]!==v||e[26]!==k?(j=s.jsxs(at,{children:[v,k]}),e[25]=v,e[26]=k,e[27]=j):j=e[27],j}function Et(t){const e=R.c(46),{data:o,itemVersions:r,onInstall:n,canInstall:i,isInstalling:a,hideInstallControls:c,selectedVersionIndex:l,onVersionChange:d}=t,_=i===void 0?!0:i,p=a===void 0?!1:a,y=c===void 0?!1:c,[b,I]=q.useState(0),m=l??b;let N;e[0]!==d?(N=U=>{I(U),d?.(U)},e[0]=d,e[1]=N):N=e[1];const f=N,v=r[m]||r[0];let x;e[2]!==v?.server?.remotes?(x=v?.server?.remotes??[],e[2]=v?.server?.remotes,e[3]=x):x=e[3];const k=x;let j;e[4]!==v?.server?.packages?(j=v?.server?.packages??[],e[4]=v?.server?.packages,e[5]=j):j=e[5];const S=j.length>0,C=k.length>0,P=k.findIndex(Ut),h=P>=0?P:0;let K;e[6]!==h||e[7]!==S||e[8]!==C||e[9]!==n||e[10]!==m?(K=()=>{C?n(m,h,void 0):S&&n(m,void 0,0)},e[6]=h,e[7]=S,e[8]=C,e[9]=n,e[10]=m,e[11]=K):K=e[11];const E=K;let G;e[12]!==r||e[13]!==n||e[14]!==f?(G=U=>{f(U);const J=r[U],W=J?.server?.remotes??[],Q=J?.server?.packages??[];if(W.length>0){const X=W.findIndex(At);n(U,X>=0?X:0,void 0)}else Q.length>0&&n(U,void 0,0)},e[12]=r,e[13]=n,e[14]=f,e[15]=G):G=e[15];const L=G;let V;e[16]!==o.icon||e[17]!==o.name?(V=s.jsx(Re,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[16]=o.icon,e[17]=o.name,e[18]=V):V=e[18];let M;e[19]!==o.name?(M=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[19]=o.name,e[20]=M):M=e[20];let z;e[21]!==o.verified?(z=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[21]=o.verified,e[22]=z):z=e[22];let O;e[23]!==M||e[24]!==z?(O=s.jsxs("div",{className:"flex items-center gap-2",children:[M,z]}),e[23]=M,e[24]=z,e[25]=O):O=e[25];let H;e[26]!==o.shortDescription?(H=o.shortDescription&&s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:o.shortDescription}),e[26]=o.shortDescription,e[27]=H):H=e[27];let $;e[28]!==O||e[29]!==H?($=s.jsxs("div",{className:"flex-1 min-w-0",children:[O,H]}),e[28]=O,e[29]=H,e[30]=$):$=e[30];let A;e[31]!==_||e[32]!==E||e[33]!==L||e[34]!==y||e[35]!==p||e[36]!==r||e[37]!==m||e[38]!==f?(A=_&&!y?s.jsx("div",{className:"shrink-0 flex items-center gap-2",children:r.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ae,{variant:"brand",onClick:E,disabled:p,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(Pe,{size:20}),p?"Connecting...":"Connect"]}),s.jsx(Ve,{versions:r,selectedIndex:m,onSelect:L,isInstalling:p,variant:"brand"})]}):s.jsxs(ae,{variant:"brand",onClick:E,disabled:r.length===0||p,className:"shrink-0 cursor-pointer",children:[s.jsx(Pe,{size:20}),p?"Connecting...":"Connect"]})}):y?r.length>1?s.jsx("div",{className:"shrink-0",children:s.jsx(Ve,{versions:r,selectedIndex:m,onSelect:f,isInstalling:p,variant:"outline",showLabel:!0})}):null:s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[31]=_,e[32]=E,e[33]=L,e[34]=y,e[35]=p,e[36]=r,e[37]=m,e[38]=f,e[39]=A):A=e[39];let w;e[40]!==$||e[41]!==A?(w=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[$,A]}),e[40]=$,e[41]=A,e[42]=w):w=e[42];let T;return e[43]!==w||e[44]!==V?(T=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[V,w]}),e[43]=w,e[44]=V,e[45]=T):T=e[45],T}function At(t){return t.type?.toLowerCase()==="http"||t.type?.toLowerCase()==="streamable-http"}function Ut(t){return t.type?.toLowerCase()==="http"||t.type?.toLowerCase()==="streamable-http"}function Bt(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function zt(t){const e=R.c(47),{data:o,publisherInfo:r,selectedItem:n}=t;let i;e[0]!==o.description?(i=o.description&&s.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[s.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),s.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:o.description})]}),e[0]=o.description,e[1]=i):i=e[1];const a=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let c;e[2]!==r.logo||e[3]!==a?(c=s.jsx(Re,{icon:r.logo,name:a,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=r.logo,e[3]=a,e[4]=c):c=e[4];let l;e[5]!==o.publisher?(l=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher.charAt(0).toUpperCase()+o.publisher.slice(1),e[5]=o.publisher,e[6]=l):l=e[6];let d;e[7]!==l?(d=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=d):d=e[8];let _;e[9]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("div",{className:"text-xs text-muted-foreground",children:"Publisher"}),e[9]=_):_=e[9];let p;e[10]!==d?(p=s.jsxs("div",{children:[d,_]}),e[10]=d,e[11]=p):p=e[11];let y;e[12]!==c||e[13]!==p?(y=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[c,p]})}),e[12]=c,e[13]=p,e[14]=y):y=e[14];let b;e[15]!==o.version?(b=o.version&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Version"}),s.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",o.version]})]}),e[15]=o.version,e[16]=b):b=e[16];let I;e[17]!==o.tags?(I=o.tags&&o.tags.length>0&&s.jsxs("div",{className:"flex justify-between items-start text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Tags"}),s.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:o.tags.map(Ft)})]}),e[17]=o.tags,e[18]=I):I=e[18];let m;e[19]!==o.categories?(m=o.categories&&o.categories.length>0&&s.jsxs("div",{className:"flex justify-between items-start text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Categories"}),s.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:o.categories.map(Ot)})]}),e[19]=o.categories,e[20]=m):m=e[20];let N;e[21]!==o.connectionType?(N=o.connectionType&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:o.connectionType})]}),e[21]=o.connectionType,e[22]=N):N=e[22];let f;e[23]!==o.schemaVersion?(f=o.schemaVersion&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:o.schemaVersion})]}),e[23]=o.schemaVersion,e[24]=f):f=e[24];let v;e[25]!==o.websiteUrl?(v=o.websiteUrl&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Website"}),s.jsxs("a",{href:o.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"Visit"}),s.jsx(Me,{size:14})]})]}),e[25]=o.websiteUrl,e[26]=v):v=e[26];let x;e[27]!==o.repository?(x=o.repository?.url&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Source"}),s.jsxs("a",{href:o.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"GitHub"}),s.jsx(Me,{size:14})]})]}),e[27]=o.repository,e[28]=x):x=e[28];let k;e[29]!==I||e[30]!==m||e[31]!==N||e[32]!==f||e[33]!==v||e[34]!==x||e[35]!==b?(k=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[b,I,m,N,f,v,x]}),e[29]=I,e[30]=m,e[31]=N,e[32]=f,e[33]=v,e[34]=x,e[35]=b,e[36]=k):k=e[36];let j;e[37]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[37]=j):j=e[37];let g;e[38]!==n.updated_at?(g=Bt(n.updated_at),e[38]=n.updated_at,e[39]=g):g=e[39];let S;e[40]!==g?(S=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[j,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:g})]}),e[40]=g,e[41]=S):S=e[41];let C;return e[42]!==i||e[43]!==k||e[44]!==S||e[45]!==y?(C=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,y,k,S]}),e[42]=i,e[43]=k,e[44]=S,e[45]=y,e[46]=C):C=e[46],C}function Ot(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}function Ft(t){return s.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:t},t)}const Gt=[{value:"http",label:"HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"STDIO"},{value:"all",label:"All"}],Ht={docs:"Documentation",bindings:"Workers Bindings",builds:"Workers Builds",observability:"Observability",radar:"Radar",containers:"Containers",browser:"Browser Rendering",logs:"Logpush",autorag:"AutoRAG",auditlogs:"Audit Logs",graphql:"GraphQL",dex:"DEX Monitoring",casb:"CASB"};function Wt(t){if(!t)return"Local";try{return new URL(t).hostname}catch{return t}}function qt(t){if(!t)return"local";try{const e=new URL(t).hostname;return e.split(".")[0]||e}catch{return"unknown"}}function Kt(t){const e=Ht[t.toLowerCase()];return e||t.replace(/[-_]/g," ").replace(/\b\w/g,o=>o.toUpperCase())}function Qt(t){if(!t)return"http";const e=t.toLowerCase();return e==="sse"?"sse":e==="stdio"?"stdio":"http"}function Xt(t){return t.map((e,o)=>{const r=Qt(e.type),n=Wt(e.url),i=qt(e.url),a=e.title||e.name||Kt(i);return{index:o,protocol:r,url:e.url,hostname:n,serviceName:i,displayName:a,name:e.name,title:e.title,description:e.description,_type:e._type,_index:e._index}})}function Yt(t){const e=R.c(2),{protocol:o,className:r}=t;let n;return e[0]!==r?(n={http:s.jsx(ft,{className:r}),sse:s.jsx(gt,{className:r}),stdio:s.jsx(bt,{className:r})},e[0]=r,e[1]=n):n=e[1],n[o]}function Zt(t){const e=R.c(10),{options:o,selected:r,onSelect:n}=t;if(o.length<=1)return null;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"text-sm text-muted-foreground",children:"Protocol:"}),e[0]=i):i=e[0];let a;if(e[1]!==n||e[2]!==o||e[3]!==r){let l;e[5]!==n||e[6]!==r?(l=d=>s.jsxs(ae,{variant:r===d.value?"default":"outline",size:"sm",onClick:()=>n(d.value),className:"cursor-pointer",children:[s.jsx(Yt,{protocol:d.value==="all"?"http":d.value,className:"w-4 h-4 mr-1"}),d.label]},d.value),e[5]=n,e[6]=r,e[7]=l):l=e[7],a=o.map(l),e[1]=n,e[2]=o,e[3]=r,e[4]=a}else a=e[4];let c;return e[8]!==a?(c=s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[i,s.jsx("div",{className:"flex gap-1",children:a})]}),e[8]=a,e[9]=c):c=e[9],c}function Jt(t){const e=R.c(11),{servers:o,onInstall:r,isInstalling:n,icon:i,mcpName:a,showStdio:c}=t,l=n===void 0?!1:n,d=c===void 0?!1:c,_=d?o:o.filter(os),p=Xt(_),y=p.length<13?"all":"http",[b,I]=q.useState(y);let m;e:{if(b==="all"){m="all";break e}let h;if(e[0]!==b?(h=E=>E.protocol===b,e[0]=b,e[1]=h):h=e[1],p.some(h)){m=b;break e}if(p.length<13){m="all";break e}m=p[0]?.protocol??"http"}const N=m,f=N==="all"?p:p.filter(h=>h.protocol===N),v=new Set(p.map(ss));let x=Gt.filter(h=>h.value==="all"||v.has(h.value));d||(x=x.filter(ts));const k=v.size<=1?x.filter(es):x,j="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4";let g;e[2]!==i||e[3]!==l||e[4]!==a||e[5]!==r?(g=h=>s.jsx(ht,{variant:"server",icon:i??null,displayName:h.displayName,description:h.description??null,hostname:h.hostname,protocol:h.protocol,isInstalling:l,onClick:()=>r({type:h.protocol,url:h.url,name:h.name,title:h.title,description:h.description,_type:h._type,_index:h._index})},`${h.hostname}-${h.protocol}-${h.index}`),e[2]=i,e[3]=l,e[4]=a,e[5]=r,e[6]=g):g=e[6];const S=f.map(g);let C;e[7]!==S?(C=s.jsx("div",{className:j,children:S}),e[7]=S,e[8]=C):C=e[8];let P;return e[9]!==f.length?(P=f.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No servers match the selected filter."}),e[9]=f.length,e[10]=P):P=e[10],s.jsxs("div",{className:"p-5",children:[s.jsx(Zt,{options:k,selected:N,onSelect:I}),C,P]})}function es(t){return t.value!=="all"}function ts(t){return t.value!=="stdio"}function ss(t){return t.protocol}function os(t){return t.type?.toLowerCase()!=="stdio"}function rs(t){const e=R.c(29),{data:o,availableTabs:r,effectiveActiveTabId:n,effectiveTools:i,isLoadingTools:a,onTabChange:c,servers:l,onInstallServer:d,isInstalling:_,mcpIcon:p,mcpName:y,showStdio:b}=t,I=a===void 0?!1:a;let m;e[0]!==l?(m=l===void 0?[]:l,e[0]=l,e[1]=m):m=e[1];const N=m,f=_===void 0?!1:_,v=b===void 0?!1:b;let x;e[2]!==i?(x=i.map(ns),e[2]=i,e[3]=x):x=e[3];const k=x;let j;e[4]!==r||e[5]!==n||e[6]!==c?(j=r.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(mt,{tabs:r,activeTab:n,onTabChange:c})}),e[4]=r,e[5]=n,e[6]=c,e[7]=j):j=e[7];let g;e[8]!==n||e[9]!==f||e[10]!==p||e[11]!==y||e[12]!==d||e[13]!==N||e[14]!==v?(g=n==="servers"&&N.length>0&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Jt,{servers:N,onInstall:h=>d?.(h),isInstalling:f,icon:p,mcpName:y,showStdio:v})}),e[8]=n,e[9]=f,e[10]=p,e[11]=y,e[12]=d,e[13]=N,e[14]=v,e[15]=g):g=e[15];let S;e[16]!==n||e[17]!==i.length||e[18]!==I||e[19]!==k?(S=n==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:I?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(De,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(ct,{tools:k,showToolbar:!1,emptyMessage:"This MCP Server doesn't have any tools."}):s.jsx(tt,{image:null,title:"No tools available",description:"This MCP Server doesn't have any tools."})}),e[16]=n,e[17]=i.length,e[18]=I,e[19]=k,e[20]=S):S=e[20];let C;e[21]!==o?.repository||e[22]!==n?(C=n==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(dt,{repository:o?.repository})}),e[21]=o?.repository,e[22]=n,e[23]=C):C=e[23];let P;return e[24]!==C||e[25]!==j||e[26]!==g||e[27]!==S?(P=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[j,g,S,C]}),e[24]=C,e[25]=j,e[26]=g,e[27]=S,e[28]=P):P=e[28],P}function ns(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function is(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(r=>r.app_name?.toLowerCase()===o||r.app_id?.toLowerCase()===o||r.title.toLowerCase()===o)||t.find(r=>r.title.toLowerCase().includes(o))}function ls(t,e,o,r,n){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:r?.icon||void 0,count:n??t.length};const i=e.toLowerCase(),a=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:o?.icon||a[0]?.publisher_logo||a[0]?.icon||void 0,count:a.length}}function as(t){const e=t._meta?.["mcp.mesh"],o=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,n=pt(r.remotes?.[0]?.type),i=xt(r.$schema),a=o?"io.modelcontextprotocol.registry/official":t.publisher||e?.scopeName||"Unknown",c=Lt(r.repository),l=t.icon||t.image||t.logo||r.icons?.[0]?.src||c||null,d=t.name||t.title||t.server?.title||"Unnamed Item",_=vt(d),p=e?.friendly_name||_,y=e?.mesh_description||t.description||t.summary||r?.description||"",b=e?.short_description||null,I=e?.tags||[],m=e?.categories||[];return{name:p,description:y,shortDescription:b,icon:l,verified:t.verified||e?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:i??null,connectionType:n,connectionUrl:null,remoteUrl:null,tags:I,categories:m,tools:t.tools||r.tools||e?.tools||[],models:t.models||r.models||e?.models||[],emails:t.emails||r.emails||e?.emails||[],analytics:t.analytics||r.analytics||e?.analytics,cdn:t.cdn||r.cdn||e?.cdn}}class cs extends q.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store MCP server detail error:",e,o)}render(){return this.state.hasError?s.jsx($t,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ds(){const t=R.c(67),{org:e}=Ee(),o=$e();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const{appName:n}=Qe(r);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:a,serverName:c,stdio:l}=Xe(i);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=It.storeShowStdio(),t[2]=d):d=t[2];const[_,p]=_t(d,ys),y=l==="true"?!0:l==="false"?!1:_;l!==void 0&&l==="true"!==_&&p(l==="true");const[b,I]=q.useState(null),[m,N]=q.useState(null),f=jt(),v=yt(),{data:x}=Ye.useSession(),k=St(v),j=a||k[0]?.id||"",g=Nt(j),S=ut(g?.tools),C=g?.tools&&g.tools.find(js)?.name||"",P=g?.tools&&g.tools.find(bs)?.name||"",h=Mt(j),K=!!c;let E,G;K?(E=C||P,G={name:c}):(E=S,G={});const{data:L}=Ct({toolCaller:h,toolName:E,toolInputParams:G,scope:j});let V=[],M=[],z=null;if(L){if(Array.isArray(L))V=L;else if(typeof L=="object"&&L!==null)if("totalCount"in L&&typeof L.totalCount=="number"&&(z=L.totalCount),"item"in L&&L.item){const u=L.item,D=u.id||"",Z=u.server,le=u._meta;let B;t[3]!==u.title||t[4]!==D||t[5]!==Z||t[6]!==le?(B=[{id:D,title:u.title,server:Z,_meta:le}],t[3]=u.title,t[4]=D,t[5]=Z,t[6]=le,t[7]=B):B=t[7],V=B}else{let u;"versions"in L&&Array.isArray(L.versions)?u="versions":"servers"in L&&Array.isArray(L.servers)?u="servers":u=Object.keys(L).find(D=>Array.isArray(L[D])),u&&(V=L[u],(u==="versions"||E?.includes("VERSIONS"))&&(M=V))}}const O=M.findIndex(vs),H=O>=0?O:0,$=m??H;let A;t[8]!==n?(A=u=>{const D=u.name||u.title||u.server.title||"";return kt(D)===n},t[8]=n,t[9]=A):A=t[9];let w=V.find(A);if(!w&&c){let u;t[10]!==c?(u=D=>D.server.name===c||D.name===c||D.title===c,t[10]=c,t[11]=u):u=t[11],w=V.find(u)}const T=w?as(w):null,U=(T?.tools?.length||0)>0,J=w?.server?.remotes?.[0]?.url||null,W=!U&&!!J,Q=wt({url:W?J:""}),ye=W&&Q.state==="connecting";let X;t[12]!==Q||t[13]!==W?(X=W&&Q.state==="ready"?(Q.tools||[]).map(gs):[],t[12]=Q,t[13]=W,t[14]=X):X=t[14];const Te=X,ce=U?T?.tools||[]:Te,Ue=is(v,T?.publisher),Ne=T?ls(V,T.publisher,Ue,g??null,z):{count:0},Be=T?.repository?Tt(T.repository):null,ze=w?.server?.remotes??[],Oe=w?.server?.packages??[],Se=[...ze.map(hs),...Oe.map(xs)],de=y?Se:Se.filter(ps),ee=de.length>1;let te;t[15]!==ee||t[16]!==de.length?(te={id:"servers",label:"Servers",count:de.length,visible:ee},t[15]=ee,t[16]=de.length,t[17]=te):te=t[17];const Ce=!!T?.repository&&!!Be;let se;t[18]!==Ce?(se={id:"readme",label:"README",visible:Ce},t[18]=Ce,t[19]=se):se=t[19];const we=U||Te.length>0||ye&&!!J;let oe;t[20]!==ce.length||t[21]!==we?(oe={id:"tools",label:"Tools",count:ce.length,visible:we},t[20]=ce.length,t[21]=we,t[22]=oe):oe=t[22];let me;t[23]!==te||t[24]!==se||t[25]!==oe?(me=[te,se,oe].filter(us),t[23]=te,t[24]=se,t[25]=oe,t[26]=me):me=t[26];const F=me;let fe;t[27]!==F?(fe=F.find(fs)?.id||F.find(ms)?.id||F[0]?.id||"overview",t[27]=F,t[28]=fe):fe=t[28];const _e=fe;let ue;t[29]!==b||t[30]!==F||t[31]!==_e?(ue=b&&F.find(u=>u.id===b)?b:_e,t[29]=b,t[30]=F,t[31]=_e,t[32]=ue):ue=t[32];const Fe=ue;let pe;t[33]!==f||t[34]!==M||t[35]!==o||t[36]!==e||t[37]!==w||t[38]!==x?(pe=async(u,D,Z)=>{const le=M[u??0]||w;if(!le||!e||!x?.user?.id)return;const B=ot(le,e.id,x.user.id,{remoteIndex:Z===void 0?D??0:void 0,packageIndex:Z}),We=B.connection_type==="STDIO",qe=!!B.connection_url,Ke=We&&B.connection_headers&&typeof B.connection_headers=="object"&&"command"in B.connection_headers;if(!qe&&!Ke){Le.error("This MCP Server cannot be connected: no connection method available");return}try{const{id:Ie}=await f.create.mutateAsync(B);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:Ie}})}catch(Ie){const ke=Ie;Le.error(`Failed to connect MCP Server: ${ke instanceof Error?ke.message:String(ke)}`)}},t[33]=f,t[34]=M,t[35]=o,t[36]=e,t[37]=w,t[38]=x,t[39]=pe):pe=t[39];const Y=pe;let xe;t[40]!==o||t[41]!==e.slug?(xe=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[40]=o,t[41]=e.slug,t[42]=xe):xe=t[42];const re=xe;if(!w){let u;return t[43]!==re?(u=s.jsx(Dt,{onBack:re}),t[43]=re,t[44]=u):u=t[44],u}if(!T)return null;const Ge=(w?.server?.remotes?.length??0)>0,He=(w?.server?.packages?.length??0)>0,ne=Ge||He;let he;t[45]!==re?(he=s.jsx(Rt,{onBack:re}),t[45]=re,t[46]=he):he=t[46];let ge;t[47]!==ne?(ge=!ne&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(Pt,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[47]=ne,t[48]=ge):ge=t[48];let ie;t[49]!==M||t[50]!==w?(ie=M.length>0?M:[w],t[49]=M,t[50]=w,t[51]=ie):ie=t[51];let ve;t[52]!==f.create.isPending||t[53]!==ne||t[54]!==T||t[55]!==$||t[56]!==Y||t[57]!==ee||t[58]!==ie?(ve=s.jsx(Et,{data:T,itemVersions:ie,onInstall:Y,canInstall:ne,isInstalling:f.create.isPending,hideInstallControls:ee,selectedVersionIndex:$,onVersionChange:N}),t[52]=f.create.isPending,t[53]=ne,t[54]=T,t[55]=$,t[56]=Y,t[57]=ee,t[58]=ie,t[59]=ve):ve=t[59];let be;t[60]!==T||t[61]!==Ne||t[62]!==w?(be=s.jsx(zt,{data:T,publisherInfo:Ne,selectedItem:w}),t[60]=T,t[61]=Ne,t[62]=w,t[63]=be):be=t[63];let je;return t[64]!==$||t[65]!==Y?(je=u=>{u._type==="remote"?Y($,u._index,void 0):Y($,void 0,u._index)},t[64]=$,t[65]=Y,t[66]=je):je=t[66],s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[he,s.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:s.jsx("div",{className:"h-full",children:s.jsxs("div",{className:"h-full",children:[ge,ve,s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[be,s.jsx(rs,{data:T,availableTabs:F,effectiveActiveTabId:Fe,effectiveTools:ce,isLoadingTools:ye,onTabChange:I,servers:Se,onInstallServer:je,isInstalling:f.create.isPending,mcpIcon:T.icon,mcpName:T.name,showStdio:y})]})]})})})]})}function ms(t){return t.id==="readme"}function fs(t){return t.id==="servers"}function us(t){return t.visible}function ps(t){return t.type?.toLowerCase()!=="stdio"}function xs(t,e){return{type:"stdio",url:void 0,name:t.name||t.identifier,title:t.name||t.identifier?.replace(/^@[^/]+\//,""),description:t.environmentVariables?.length?`Requires ${t.environmentVariables.length} environment variable(s)`:void 0,_type:"package",_index:e}}function hs(t,e){return{...t,_type:"remote",_index:e}}function gs(t){return{name:t.name,description:t.description}}function vs(t){return t._meta?.["io.modelcontextprotocol.registry/official"]?.isLatest===!0}function bs(t){return t.name.endsWith("_GET")}function js(t){return t.name.endsWith("_VERSIONS")}function ys(){return!1}function go(){const t=R.c(6),{org:e}=Ee(),o=$e();let r;t[0]!==o||t[1]!==e.slug?(r=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=r):r=t[2];const n=r;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(q.Suspense,{fallback:s.jsx(Vt,{}),children:s.jsx(ds,{})}),t[3]=i):i=t[3];let a;return t[4]!==n?(a=s.jsx(cs,{onBack:n,children:i}),t[4]=n,t[5]=a):a=t[5],a}export{go as default};