@decocms/mesh 1.8.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/client/assets/{AlertCircle-CoA9j9_b.js → AlertCircle-BrGqb-qb.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-Bu1JR7vY.js → ArrowLeft-B6h573ak.js} +1 -1
  3. package/dist/client/assets/{ChevronDown-BmUd-Gap.js → ChevronDown-BuogCeI0.js} +1 -1
  4. package/dist/client/assets/{Clock-BGOqsAv_.js → Clock-LzAlJ-1R.js} +1 -1
  5. package/dist/client/assets/{Code01-C4I9q0rm.js → Code01-Wll8WS4F.js} +1 -1
  6. package/dist/client/assets/{Copy01-D_YhbDiF.js → Copy01-_s71W2Ph.js} +1 -1
  7. package/dist/client/assets/{CpuChip02-BkDt7iNK.js → CpuChip02-BwTl0fBj.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-CxdZClGh.js → DotsVertical-BQk5hPxb.js} +1 -1
  9. package/dist/client/assets/{File06-BdMasDPT.js → File06-CpSSTggW.js} +1 -1
  10. package/dist/client/assets/{FlipBackward-B34yEzR2.js → FlipBackward-C0O2fx27.js} +1 -1
  11. package/dist/client/assets/{GitBranch01-D2Rua42v.js → GitBranch01-DjmPf135.js} +1 -1
  12. package/dist/client/assets/{Grid01-Bom2qqwm.js → Grid01-CmB5R6oU.js} +1 -1
  13. package/dist/client/assets/{Inbox01-Arx8J2Oq.js → Inbox01-Ct-8Lwpv.js} +1 -1
  14. package/dist/client/assets/{InfoCircle-BYXT4R1l.js → InfoCircle-D6JXYJn_.js} +1 -1
  15. package/dist/client/assets/{Key01-D0WGLaST.js → Key01-ZVAVplBN.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-LVkx-wZF.js → LinkExternal01-DfHTXuZ9.js} +1 -1
  17. package/dist/client/assets/{Loading01-Dw6V1r3u.js → Loading01-0wYmSKV6.js} +1 -1
  18. package/dist/client/assets/{Lock01-Dw2P1WZh.js → Lock01-D5nrmOSx.js} +1 -1
  19. package/dist/client/assets/{Play-BRRssd_q.js → Play-BedrzKsi.js} +1 -1
  20. package/dist/client/assets/{Plus-CQSfshmp.js → Plus-DofiSAMU.js} +1 -1
  21. package/dist/client/assets/{SearchMd-CGUWNVUr.js → SearchMd-D70t5LVP.js} +1 -1
  22. package/dist/client/assets/{Terminal-CIo_ltVk.js → Terminal-CStBCUAd.js} +1 -1
  23. package/dist/client/assets/{Trash01-BgGiU9JZ.js → Trash01-DnTS63e5.js} +1 -1
  24. package/dist/client/assets/{X-CsW5kmRT.js → X-DeVUfdHG.js} +1 -1
  25. package/dist/client/assets/{XClose-D2IdV8gs.js → XClose-5A0s2w1d.js} +1 -1
  26. package/dist/client/assets/{alert-dialog-rSIOP2OM.js → alert-dialog-BU8uTWb8.js} +1 -1
  27. package/dist/client/assets/{auth-D6vm_lfk.js → auth-DpA5_jth.js} +1 -1
  28. package/dist/client/assets/{auth-catchall-lDj0BXu4.js → auth-catchall-2WBu6I6H.js} +1 -1
  29. package/dist/client/assets/{avatar-C45Lgbwv.js → avatar-KDpJ2jsd.js} +1 -1
  30. package/dist/client/assets/{badge-Z-ujar-h.js → badge-CStgouQf.js} +1 -1
  31. package/dist/client/assets/{button-DMnSM5FV.js → button-IijH0wdI.js} +1 -1
  32. package/dist/client/assets/{card-DL_e-uTF.js → card-BnWpolEI.js} +1 -1
  33. package/dist/client/assets/{checkbox-SCLb_n1h.js → checkbox-BYeNlYdH.js} +1 -1
  34. package/dist/client/assets/collection-detail-DnxFiEu9.js +165 -0
  35. package/dist/client/assets/{collection-display-button-BbSV76WH.js → collection-display-button-2ZQ5sQTW.js} +1 -1
  36. package/dist/client/assets/{collection-header-CqO1LmKH.js → collection-header-DBUE7n6H.js} +1 -1
  37. package/dist/client/assets/{collection-page-DDVR6yeu.js → collection-page-BHk1uJKe.js} +1 -1
  38. package/dist/client/assets/{collection-search-BOBOP2ro.js → collection-search-CM9rltH6.js} +1 -1
  39. package/dist/client/assets/{collection-tab-CNlP707v.js → collection-tab-ClOnLgHC.js} +1 -1
  40. package/dist/client/assets/{collection-table-wrapper-ByX0J-nn.js → collection-table-wrapper-BRI7T6RJ.js} +1 -1
  41. package/dist/client/assets/{connection-card-CZFyOgeO.js → connection-card-DMv3uM_n.js} +1 -1
  42. package/dist/client/assets/{connection-detail-oL5IGO2h.js → connection-detail-Cs5NpuH7.js} +1 -1
  43. package/dist/client/assets/{connections-BKlzJU2y.js → connections-DSbytdP0.js} +1 -1
  44. package/dist/client/assets/constants-TKUQnnwA.js +1 -0
  45. package/dist/client/assets/{create-organization-dialog-lmQ3mepV.js → create-organization-dialog-DbNHSUuq.js} +1 -1
  46. package/dist/client/assets/{dialog-B1fXXmBI.js → dialog-CJsBFVDy.js} +1 -1
  47. package/dist/client/assets/{dropdown-menu-gRHakuHp.js → dropdown-menu-BvLCKekW.js} +1 -1
  48. package/dist/client/assets/{empty-state-BiqF__Lu.js → empty-state-Bg-FRZa4.js} +1 -1
  49. package/dist/client/assets/{env-vars-editor-Br0Q2jee.js → env-vars-editor-Z7SwcUr8.js} +1 -1
  50. package/dist/client/assets/{error-boundary-CUq8HVcH.js → error-boundary-CsEoagci.js} +1 -1
  51. package/dist/client/assets/{extract-connection-data-DsJuSGHU.js → extract-connection-data-BgA1QcA6.js} +1 -1
  52. package/dist/client/assets/{form-BbwJs-Od.js → form-BjarY-Jq.js} +1 -1
  53. package/dist/client/assets/{formatDistanceToNow-jHI_IOun.js → formatDistanceToNow-fhdySMxO.js} +1 -1
  54. package/dist/client/assets/gateway-detail-DeFxNps5.js +1 -0
  55. package/dist/client/assets/{gateways-BfCNNBIO.js → gateways-CXlSFkKr.js} +1 -1
  56. package/dist/client/assets/{home-oGaB9rtf.js → home-BXCs6vTQ.js} +1 -1
  57. package/dist/client/assets/index-9pHY4m3c.css +1 -0
  58. package/dist/client/assets/{index-B1eBXzBF.js → index-BGEzzv-W.js} +1 -1
  59. package/dist/client/assets/{index-BVHhSH8M.js → index-BLgTJ8o3.js} +2 -2
  60. package/dist/client/assets/{index-BbK2Byrj.js → index-B_OB0BCO.js} +1 -1
  61. package/dist/client/assets/{index-BMIizA12.js → index-CRGUNI2v.js} +1 -1
  62. package/dist/client/assets/{input-C6vwKKeq.js → input-BxywPo2X.js} +1 -1
  63. package/dist/client/assets/{layout-m8iq6RWE.js → layout-Dfp1nH3g.js} +1 -1
  64. package/dist/client/assets/lazy-highlighter-DYlTa9LA.js +9 -0
  65. package/dist/client/assets/{localstorage-keys-BB9xpX5T.js → localstorage-keys-Bj9V9Nbd.js} +1 -1
  66. package/dist/client/assets/{login-CevUioqo.js → login-BfaeBzql.js} +1 -1
  67. package/dist/client/assets/{mcp-oauth-CE6Gg3ul.js → mcp-oauth-Vd_yzV5S.js} +1 -1
  68. package/dist/client/assets/{members-CAJLI1Ui.js → members-fIe1QSNh.js} +1 -1
  69. package/dist/client/assets/monaco-editor-mQfzbJMr.js +19 -0
  70. package/dist/client/assets/monitoring-I1RqzeAN.js +4 -0
  71. package/dist/client/assets/{oauth-callback-DnSysdpG.js → oauth-callback-Cwog6Jzh.js} +1 -1
  72. package/dist/client/assets/{page-jzi_ERcf.js → page-BVptnX4j.js} +2 -2
  73. package/dist/client/assets/{pin-to-sidebar-button-DonhySMf.js → pin-to-sidebar-button-C8t5xznu.js} +1 -1
  74. package/dist/client/assets/{popover-BO5GT9tA.js → popover-CwHNob2q.js} +1 -1
  75. package/dist/client/assets/{resizable-DpISfhV6.js → resizable-DybyPt6-.js} +1 -1
  76. package/dist/client/assets/{resource-tabs-JMDBPJhv.js → resource-tabs-s0IiCCzU.js} +1 -1
  77. package/dist/client/assets/{responsive-select-BZGantuu.js → responsive-select-INSf3elv.js} +1 -1
  78. package/dist/client/assets/{select-mD7lFwRj.js → select-C0rvNlZx.js} +1 -1
  79. package/dist/client/assets/{settings-iXHGs-4V.js → settings-3Or8ShnF.js} +1 -1
  80. package/dist/client/assets/{shell-layout-C1VOF_px.js → shell-layout-4x0MHQQc.js} +1 -1
  81. package/dist/client/assets/{spinner-D7to-RHc.js → spinner-D7ZAVJCR.js} +1 -1
  82. package/dist/client/assets/{store-C7bepdKu.js → store-Bl_0XUq8.js} +1 -1
  83. package/dist/client/assets/{store-app-detail-dqrfmC2K.js → store-app-detail--3qLKygc.js} +1 -1
  84. package/dist/client/assets/{switch-CpJO-7Kf.js → switch-D37mVt_9.js} +1 -1
  85. package/dist/client/assets/{textarea-Dma5FaAA.js → textarea-DNeEC-Sl.js} +1 -1
  86. package/dist/client/assets/{thread-history-popover-DTmh-wTW.js → thread-history-popover-CykPOF9f.js} +14 -14
  87. package/dist/client/assets/{tools-list-DJTZFgWM.js → tools-list-CFmwpEf4.js} +1 -1
  88. package/dist/client/assets/{tooltip-DiQ9SlNX.js → tooltip-CSuczTFq.js} +1 -1
  89. package/dist/client/assets/{types-Bq0bBlbx.js → types-CJK7iTsI.js} +2 -2
  90. package/dist/client/assets/{use-binding-DQTEUjPl.js → use-binding-C5e_Y70M.js} +1 -1
  91. package/dist/client/assets/{use-connection-DUMeVexv.js → use-connection-CsPrFY0x.js} +1 -1
  92. package/dist/client/assets/{use-connection-resources-GqC2zg91.js → use-connection-resources-CjjFKWSM.js} +1 -1
  93. package/dist/client/assets/{use-gateway-pQG4iSzq.js → use-gateway-Bz_y7oh7.js} +1 -1
  94. package/dist/client/assets/{use-list-state-DKjekACN.js → use-list-state-B13SO1z3.js} +1 -1
  95. package/dist/client/assets/{use-mcp-CaAgRxkf.js → use-mcp-CPBDJGOj.js} +1 -1
  96. package/dist/client/assets/{use-members-Cxbw-nUt.js → use-members-b3tDRslY.js} +1 -1
  97. package/dist/client/assets/{use-mobile-C2teUdDI.js → use-mobile-VYFif8jU.js} +1 -1
  98. package/dist/client/assets/{use-organization-settings-B-bw0Nsb.js → use-organization-settings-i4aS_Egu.js} +1 -1
  99. package/dist/client/assets/{use-tool-call-BwHyofVZ.js → use-tool-call-BdbJ3oy8.js} +1 -1
  100. package/dist/client/assets/useQuery-DXchCtgN.js +1 -0
  101. package/dist/client/assets/{useSuspenseInfiniteQuery-WWHYgeeq.js → useSuspenseInfiniteQuery-BLpBJxLd.js} +1 -1
  102. package/dist/client/assets/{view-mode-toggle-DCDdw_zu.js → view-mode-toggle-BXo-WMnB.js} +1 -1
  103. package/dist/client/assets/{workflow-nViVDMOR.js → workflow-wGJTSVc-.js} +1 -1
  104. package/dist/client/index.html +2 -2
  105. package/package.json +1 -3
  106. package/dist/client/assets/collection-detail-DZRR92ph.js +0 -183
  107. package/dist/client/assets/constants-C4MXZrmv.js +0 -1
  108. package/dist/client/assets/core-D9xILP6l.js +0 -6
  109. package/dist/client/assets/gateway-detail-CvVf3uBW.js +0 -1
  110. package/dist/client/assets/index-B3GsxHkT.css +0 -1
  111. package/dist/client/assets/json-BESjz4hO.js +0 -1
  112. package/dist/client/assets/json-GXJs871j.js +0 -1
  113. package/dist/client/assets/json-syntax-highlighter-C3W2DACo.js +0 -2
  114. package/dist/client/assets/lazy-highlighter-C7qLCeM-.js +0 -4
  115. package/dist/client/assets/monitoring-_9gwma-O.js +0 -4
  116. package/dist/client/assets/prism-light-WCI-7yyK.js +0 -1
  117. package/dist/client/assets/useQuery-C3iXPPho.js +0 -1
@@ -1 +1 @@
1
- import{r as K,c as $,j as s,f as F,K as H,a as G,g as q,s as Y}from"./index-BVHhSH8M.js";import{g as Z,a as J}from"./well-known-mcp-VNRT0JrW.js";import{C as Q}from"./collection-header-CqO1LmKH.js";import{I as X,b as ee,c as te,a as W,u as se}from"./use-connection-DUMeVexv.js";import{b as le,T as ie,c as ne,u as V}from"./tooltip-DiQ9SlNX.js";import{s as oe}from"./slugify-CEUa2lfQ.js";import{n as re}from"./Inbox01-Arx8J2Oq.js";import{i as O}from"./Loading01-Dw6V1r3u.js";import{i as ae,E as ce}from"./SearchMd-CGUWNVUr.js";import{C as me}from"./collection-search-BOBOP2ro.js";import{i as de}from"./Lock01-Dw2P1WZh.js";import{C as fe}from"./card-DL_e-uTF.js";import{g as ue,f as pe,a as xe}from"./registry-utils-ulDDT0d8.js";import{e as he}from"./app-name-gTETL9So.js";import{u as ge}from"./useSuspenseInfiniteQuery-WWHYgeeq.js";import{d as je,a as ve,b as Ne,c as ye,S as Ce}from"./select-mD7lFwRj.js";import{s as we}from"./Plus-CQSfshmp.js";import{B as _}from"./button-DMnSM5FV.js";import{a as Se}from"./use-binding-DQTEUjPl.js";import{L as be,u as Ie}from"./localstorage-keys-BB9xpX5T.js";import"./collection-display-button-BbSV76WH.js";import"./dropdown-menu-gRHakuHp.js";import"./Grid01-Bom2qqwm.js";import"./view-mode-toggle-DCDdw_zu.js";import"./input-C6vwKKeq.js";import"./ChevronDown-BmUd-Gap.js";import"./auth-D6vm_lfk.js";import"./useQuery-C3iXPPho.js";const U=({size:t=24,color:e="currentColor",...i})=>K.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},K.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";function Re(t){const e=t.title||t.server.title||t.id||"Unnamed Item",i=t.server.description||null,f=t.server.icons?.[0]?.src||ue(t.server.repository)||null,a=t._meta?.["mcp.mesh"]?.verified??!1,p=t.server.version,r=(t.server.remotes?.length??0)>0;let c=e,l=null;if(e.includes("/")){const n=e.split("/");n.length>=2&&(l=n[0]||null,c=he(e))}if(!l){const n=t._meta?.["mcp.mesh"]?.scopeName,m=t._meta?.["mcp.mesh"]?.appName;n&&m?l=`${n}/${m}`:n&&(l=n)}return{icon:f,scopeName:l,displayName:c,description:i,version:p||null,isVerified:a,canInstall:r}}function Le(t){const e=$.c(39),{icon:i,scopeName:f,displayName:a,description:p,isVerified:o,canInstall:r,onClick:c}=t;let l;e[0]!==a||e[1]!==i?(l=s.jsx(X,{icon:i,name:a,size:"md",className:"shadow-sm"}),e[0]=a,e[1]=i,e[2]=l):l=e[2];let n;e[3]!==a?(n=s.jsx("span",{className:"truncate",children:a}),e[3]=a,e[4]=n):n=e[4];let m;e[5]!==o?(m=o&&s.jsx(U,{size:16,className:"text-success shrink-0"}),e[5]=o,e[6]=m):m=e[6];let x;e[7]!==r?(x=!r&&s.jsx(de,{size:16,className:"text-muted-foreground shrink-0"}),e[7]=r,e[8]=x):x=e[8];let j;e[9]!==n||e[10]!==m||e[11]!==x?(j=s.jsx(le,{asChild:!0,children:s.jsxs("div",{className:"flex items-center gap-2 text-base font-medium min-w-0",children:[n,m,x]})}),e[9]=n,e[10]=m,e[11]=x,e[12]=j):j=e[12];let d;e[13]!==a?(d=s.jsx("p",{children:a}),e[13]=a,e[14]=d):d=e[14];let h;e[15]!==r?(h=!r&&s.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[15]=r,e[16]=h):h=e[16];let g;e[17]!==d||e[18]!==h?(g=s.jsxs(ie,{children:[d,h]}),e[17]=d,e[18]=h,e[19]=g):g=e[19];let y;e[20]!==j||e[21]!==g?(y=s.jsxs(ne,{children:[j,g]}),e[20]=j,e[21]=g,e[22]=y):y=e[22];let C;e[23]!==f?(C=f&&s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:f}),e[23]=f,e[24]=C):C=e[24];let b;e[25]!==C||e[26]!==y?(b=s.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:s.jsxs("div",{className:"min-w-0 flex-1",children:[y,C]})}),e[25]=C,e[26]=y,e[27]=b):b=e[27];let w;e[28]!==l||e[29]!==b?(w=s.jsxs("div",{className:"flex gap-3",children:[l,b]}),e[28]=l,e[29]=b,e[30]=w):w=e[30];const I=p||"No description available";let v;e[31]!==I?(v=s.jsx("div",{className:"grid grid-cols-1 gap-1 min-w-0",children:s.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:I})}),e[31]=I,e[32]=v):v=e[32];let u;e[33]!==w||e[34]!==v?(u=s.jsxs("div",{className:"flex flex-col gap-4 h-full relative",children:[w,v]}),e[33]=w,e[34]=v,e[35]=u):u=e[35];let S;return e[36]!==c||e[37]!==u?(S=s.jsx(fe,{className:"p-6 cursor-pointer hover:bg-muted/50 transition-colors",onClick:c,children:u}),e[36]=c,e[37]=u,e[38]=S):S=e[38],S}function B(t){const e=$.c(12),{items:i,title:f,onItemClick:a}=t;if(i.length===0)return null;let p;e[0]!==f?(p=f&&s.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:s.jsx("h2",{className:"text-lg font-medium",children:f})}),e[0]=f,e[1]=p):p=e[1];let o;if(e[2]!==i||e[3]!==a){let l;e[5]!==a?(l=n=>{const m=Re(n);return s.jsx(Le,{...m,onClick:()=>a(n)},n.id)},e[5]=a,e[6]=l):l=e[6],o=i.map(l),e[2]=i,e[3]=a,e[4]=o}else o=e[4];let r;e[7]!==o?(r=s.jsx("div",{className:"grid grid-cols-4 gap-4",children:o}),e[7]=o,e[8]=r):r=e[8];let c;return e[9]!==p||e[10]!==r?(c=s.jsxs("div",{className:"flex flex-col gap-4",children:[p,r]}),e[9]=p,e[10]=r,e[11]=c):c=e[11],c}function ke(t,e){if(!e)return t;const i=e.toLowerCase();return t.filter(f=>(f.name||f.title||"").toLowerCase().includes(i)||(f.description||f.server.description||"").toLowerCase().includes(i))}function Te(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0||t.server._meta?.["mcp.mesh"]?.verified===!0}function Ee(t){const e=$.c(32),{items:i,isLoadingMore:f,registryId:a,hasMore:p,onLoadMore:o}=t,r=f===void 0?!1:f,c=p===void 0?!1:p,[l,n]=K.useState(""),m=F(),{org:x}=V(),j=K.useRef(null);let d,h,g;e[0]!==i||e[1]!==l?(d=ke(i,l),g=d.filter(Te),h=d.filter(R=>!g.find(L=>L.id===R.id)),e[0]=i,e[1]=l,e[2]=d,e[3]=h,e[4]=g):(d=e[2],h=e[3],g=e[4]);const y=h;let C;e[5]!==m||e[6]!==x.slug||e[7]!==a?(C=R=>{const L=oe(R.name||R.title||R.server.title||""),E=R.server.name;m({to:"/$org/store/$appName",params:{org:x.slug,appName:L},search:{registryId:a,serverName:E}})},e[5]=m,e[6]=x.slug,e[7]=a,e[8]=C):C=e[8];const b=C;let w;e[9]!==c||e[10]!==r||e[11]!==o||e[12]!==l?(w=R=>{if(!c||!o||l||r)return;const L=R.currentTarget;L.scrollHeight-L.scrollTop-L.clientHeight<200&&o()},e[9]=c,e[10]=r,e[11]=o,e[12]=l,e[13]=w):w=e[13];const I=w;let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=R=>{R.key==="Enter"&&n(R.currentTarget.value)},e[14]=v):v=e[14];let u;e[15]!==l?(u=s.jsx(me,{value:l,onChange:n,placeholder:"Search for an MCP Server...",onKeyDown:v}),e[15]=l,e[16]=u):u=e[16];let S;e[17]!==y||e[18]!==d||e[19]!==b||e[20]!==c||e[21]!==r||e[22]!==i.length||e[23]!==l||e[24]!==g?(S=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:i.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(re,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),s.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):l&&d.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ae,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):s.jsxs("div",{className:"flex flex-col gap-8",children:[g.length>0&&s.jsx(B,{items:g,title:"Verified",onItemClick:b}),y.length>0&&s.jsx(B,{items:y,title:g.length>0?"All":"",onItemClick:b}),c&&!l&&r&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(O,{size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[17]=y,e[18]=d,e[19]=b,e[20]=c,e[21]=r,e[22]=i.length,e[23]=l,e[24]=g,e[25]=S):S=e[25];let k;e[26]!==I||e[27]!==S?(k=s.jsx("div",{ref:j,className:"flex-1 overflow-y-auto",onScroll:I,children:S}),e[26]=I,e[27]=S,e[28]=k):k=e[28];let T;return e[29]!==u||e[30]!==k?(T=s.jsxs("div",{className:"flex flex-col h-full",children:[u,k]}),e[29]=u,e[30]=k,e[31]=T):T=e[31],T}const D=24;function Ae(t){const e=$.c(27),{registryId:i}=t,f=ee(i);let a,p,o,r;if(e[0]!==f?.tools||e[1]!==i){if(a=pe(f?.tools),!a)throw new Error("This registry does not support listing store items.");let u;e[6]!==i?(u=te(i),e[6]=i,e[7]=u):u=e[7],r=u,o=ge,p=H.toolCall(i,a,JSON.stringify({limit:D})),e[0]=f?.tools,e[1]=i,e[2]=a,e[3]=p,e[4]=o,e[5]=r}else a=e[2],p=e[3],o=e[4],r=e[5];let c;e[8]!==a||e[9]!==r?(c=async u=>{const{pageParam:S}=u;return await r(a,S?{cursor:S,limit:D}:{limit:D})},e[8]=a,e[9]=r,e[10]=c):c=e[10];let l;e[11]!==p||e[12]!==c?(l={queryKey:p,queryFn:c,initialPageParam:void 0,getNextPageParam:Ke,staleTime:36e5},e[11]=p,e[12]=c,e[13]=l):l=e[13];const{data:n,fetchNextPage:m,hasNextPage:x,isFetchingNextPage:j}=o(l);let d;e:{if(!n?.pages||n.pages.length===0){d=null;break e}const u=n.pages[0];if(typeof u=="object"&&u!==null&&"totalCount"in u&&typeof u.totalCount=="number"){d=u.totalCount;break e}d=null}const h=d,g=n?.pages;let y;e[14]!==g?(y=xe(g),e[14]=g,e[15]=y):y=e[15];const C=y;let b;e[16]!==m||e[17]!==x||e[18]!==j?(b=()=>{x&&!j&&m()},e[16]=m,e[17]=x,e[18]=j,e[19]=b):b=e[19];const w=b,I=x??!1;let v;return e[20]!==C||e[21]!==w||e[22]!==j||e[23]!==i||e[24]!==I||e[25]!==h?(v=s.jsx(Ee,{items:C,isLoadingMore:j,registryId:i,hasMore:I,onLoadMore:w,totalCount:h}),e[20]=C,e[21]=w,e[22]=j,e[23]=i,e[24]=I,e[25]=h,e[26]=v):v=e[26],v}function Ke(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function $e(t){const e=$.c(15),{registries:i,value:f,onValueChange:a,onAddWellKnown:p,wellKnownRegistries:o,placeholder:r}=t,c=r===void 0?"Select a registry...":r;let l;e[0]!==c?(l=s.jsx(ve,{size:"sm",className:"w-auto min-w-[160px]",children:s.jsx(Ne,{placeholder:c})}),e[0]=c,e[1]=l):l=e[1];let n;e[2]!==i?(n=i.map(ze),e[2]=i,e[3]=n):n=e[3];let m;e[4]!==p||e[5]!==o?(m=o.length>0&&s.jsxs("div",{className:"border-t border-border pt-1",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),o.map(d=>s.jsxs("button",{onClick:h=>{h.preventDefault(),h.stopPropagation(),p(d)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[d.icon?s.jsx("img",{src:d.icon,alt:d.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:d.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:d.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(we,{size:16})})]},d.id??d.title))]}),e[4]=p,e[5]=o,e[6]=m):m=e[6];let x;e[7]!==n||e[8]!==m?(x=s.jsxs(ye,{children:[n,m]}),e[7]=n,e[8]=m,e[9]=x):x=e[9];let j;return e[10]!==a||e[11]!==l||e[12]!==x||e[13]!==f?(j=s.jsxs(Ce,{value:f,onValueChange:a,children:[l,x]}),e[10]=a,e[11]=l,e[12]=x,e[13]=f,e[14]=j):j=e[14],j}function ze(t){return s.jsx(je,{className:"cursor-pointer",value:t.id??t.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?s.jsx("img",{src:t.icon,alt:t.name,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:t.name})]})},t.id??t.name)}function Pe({registries:t,onConnected:e}){const i=W(),{org:{slug:f}}=V(),{data:a}=G.useSession(),p=F(),[o,r]=K.useState(!1),c=t[0],l=async()=>{if(!(!c||!a?.user?.id)){r(!0);try{const m=await i.create.mutateAsync(c);e?.(m.id)}finally{r(!1)}}},n=()=>{p({to:"/$org/mcps",params:{org:f},search:{action:"create"}})};return s.jsx(ce,{image:s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:s.jsxs(s.Fragment,{children:[s.jsxs(_,{variant:"outline",onClick:l,disabled:o||!c,children:[c?.icon&&s.jsx("img",{src:c.icon,alt:"",className:"size-4"}),o?"Installing...":"Install Registry"]}),s.jsx(_,{variant:"outline",onClick:n,children:"Custom Connection"})]})})}function pt(){const t=$.c(41),{org:e}=V(),i=se(),f=W(),a=q(),p=a.location.pathname.includes("/store/")&&a.location.pathname.split("/").length>3,o=Se(i);let r;t[0]!==o?(r=o.map(Ve),t[0]=o,t[1]=r):r=t[1];const c=r;let l;t[2]!==e.slug?(l=be.selectedRegistry(e.slug),t[2]=e.slug,t[3]=l):l=t[3];const[n,m]=Ie(l,De);let x;if(t[4]!==o||t[5]!==n){let N;t[7]!==n?(N=M=>M.id===n,t[7]=n,t[8]=N):N=t[8],x=o.find(N),t[4]=o,t[5]=n,t[6]=x}else x=t[6];const d=x?.id||o[0]?.id||"";let h;t[9]!==e.id?(h=Z(e.id),t[9]=e.id,t[10]=h):h=t[10];let g;t[11]!==h?(g=[h],t[11]=h,t[12]=g):g=t[12];const y=g;let C;t[13]===Symbol.for("react.memo_cache_sentinel")?(C=[J()],t[13]=C):C=t[13];const b=C;let w;t[14]!==f.create||t[15]!==m?(w=async N=>{const M=await f.create.mutateAsync(N);m(M.id)},t[14]=f.create,t[15]=m,t[16]=w):w=t[16];const I=w;let v;t[17]!==o?(v=new Set(o.map(Me)),t[17]=o,t[18]=v):v=t[18];const u=v;let S;t[19]!==u||t[20]!==y?(S=y.filter(N=>N.id&&!u.has(N.id)),t[19]=u,t[20]=y,t[21]=S):S=t[21];const k=S;let T;t[22]!==u?(T=b.filter(N=>N.id&&!u.has(N.id)),t[22]=u,t[23]=T):T=t[23];const R=T;if(p){let N;return t[24]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Y,{}),t[24]=N):N=t[24],N}let L;t[25]!==I?(L=async N=>I(N),t[25]=I,t[26]=L):L=t[26];let E;t[27]!==k||t[28]!==d||t[29]!==c||t[30]!==m||t[31]!==L?(E=s.jsx(Q,{title:"Store",ctaButton:s.jsx($e,{wellKnownRegistries:k,registries:c,value:d,onValueChange:m,onAddWellKnown:L,placeholder:"Select store..."})}),t[27]=k,t[28]=d,t[29]=c,t[30]=m,t[31]=L,t[32]=E):E=t[32];let z;t[33]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(O,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[33]=z):z=t[33];let A;t[34]!==R||t[35]!==d||t[36]!==m?(A=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx(K.Suspense,{fallback:z,children:d?s.jsx(Ae,{registryId:d}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(Pe,{registries:R,onConnected:N=>{m(N)}})})})}),t[34]=R,t[35]=d,t[36]=m,t[37]=A):A=t[37];let P;return t[38]!==E||t[39]!==A?(P=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[E,A]}),t[38]=E,t[39]=A,t[40]=P):P=t[40],P}function Me(t){return t.id}function De(){return""}function Ve(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{pt as default};
1
+ import{r as K,c as $,j as s,f as F,K as H,a as G,g as q,s as Y}from"./index-BLgTJ8o3.js";import{g as Z,a as J}from"./well-known-mcp-VNRT0JrW.js";import{C as Q}from"./collection-header-DBUE7n6H.js";import{I as X,b as ee,c as te,a as W,u as se}from"./use-connection-CsPrFY0x.js";import{b as le,T as ie,c as ne,u as V}from"./tooltip-CSuczTFq.js";import{s as oe}from"./slugify-CEUa2lfQ.js";import{n as re}from"./Inbox01-Ct-8Lwpv.js";import{i as O}from"./Loading01-0wYmSKV6.js";import{i as ae,E as ce}from"./SearchMd-D70t5LVP.js";import{C as me}from"./collection-search-CM9rltH6.js";import{i as de}from"./Lock01-D5nrmOSx.js";import{C as fe}from"./card-BnWpolEI.js";import{g as ue,f as pe,a as xe}from"./registry-utils-ulDDT0d8.js";import{e as he}from"./app-name-gTETL9So.js";import{u as ge}from"./useSuspenseInfiniteQuery-BLpBJxLd.js";import{d as je,a as ve,b as Ne,c as ye,S as Ce}from"./select-C0rvNlZx.js";import{s as we}from"./Plus-DofiSAMU.js";import{B as _}from"./button-IijH0wdI.js";import{a as Se}from"./use-binding-C5e_Y70M.js";import{L as be,u as Ie}from"./localstorage-keys-Bj9V9Nbd.js";import"./collection-display-button-2ZQ5sQTW.js";import"./dropdown-menu-BvLCKekW.js";import"./Grid01-CmB5R6oU.js";import"./view-mode-toggle-BXo-WMnB.js";import"./input-BxywPo2X.js";import"./ChevronDown-BuogCeI0.js";import"./auth-DpA5_jth.js";import"./useQuery-DXchCtgN.js";const U=({size:t=24,color:e="currentColor",...i})=>K.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},K.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";function Re(t){const e=t.title||t.server.title||t.id||"Unnamed Item",i=t.server.description||null,f=t.server.icons?.[0]?.src||ue(t.server.repository)||null,a=t._meta?.["mcp.mesh"]?.verified??!1,p=t.server.version,r=(t.server.remotes?.length??0)>0;let c=e,l=null;if(e.includes("/")){const n=e.split("/");n.length>=2&&(l=n[0]||null,c=he(e))}if(!l){const n=t._meta?.["mcp.mesh"]?.scopeName,m=t._meta?.["mcp.mesh"]?.appName;n&&m?l=`${n}/${m}`:n&&(l=n)}return{icon:f,scopeName:l,displayName:c,description:i,version:p||null,isVerified:a,canInstall:r}}function Le(t){const e=$.c(39),{icon:i,scopeName:f,displayName:a,description:p,isVerified:o,canInstall:r,onClick:c}=t;let l;e[0]!==a||e[1]!==i?(l=s.jsx(X,{icon:i,name:a,size:"md",className:"shadow-sm"}),e[0]=a,e[1]=i,e[2]=l):l=e[2];let n;e[3]!==a?(n=s.jsx("span",{className:"truncate",children:a}),e[3]=a,e[4]=n):n=e[4];let m;e[5]!==o?(m=o&&s.jsx(U,{size:16,className:"text-success shrink-0"}),e[5]=o,e[6]=m):m=e[6];let x;e[7]!==r?(x=!r&&s.jsx(de,{size:16,className:"text-muted-foreground shrink-0"}),e[7]=r,e[8]=x):x=e[8];let j;e[9]!==n||e[10]!==m||e[11]!==x?(j=s.jsx(le,{asChild:!0,children:s.jsxs("div",{className:"flex items-center gap-2 text-base font-medium min-w-0",children:[n,m,x]})}),e[9]=n,e[10]=m,e[11]=x,e[12]=j):j=e[12];let d;e[13]!==a?(d=s.jsx("p",{children:a}),e[13]=a,e[14]=d):d=e[14];let h;e[15]!==r?(h=!r&&s.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[15]=r,e[16]=h):h=e[16];let g;e[17]!==d||e[18]!==h?(g=s.jsxs(ie,{children:[d,h]}),e[17]=d,e[18]=h,e[19]=g):g=e[19];let y;e[20]!==j||e[21]!==g?(y=s.jsxs(ne,{children:[j,g]}),e[20]=j,e[21]=g,e[22]=y):y=e[22];let C;e[23]!==f?(C=f&&s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:f}),e[23]=f,e[24]=C):C=e[24];let b;e[25]!==C||e[26]!==y?(b=s.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:s.jsxs("div",{className:"min-w-0 flex-1",children:[y,C]})}),e[25]=C,e[26]=y,e[27]=b):b=e[27];let w;e[28]!==l||e[29]!==b?(w=s.jsxs("div",{className:"flex gap-3",children:[l,b]}),e[28]=l,e[29]=b,e[30]=w):w=e[30];const I=p||"No description available";let v;e[31]!==I?(v=s.jsx("div",{className:"grid grid-cols-1 gap-1 min-w-0",children:s.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:I})}),e[31]=I,e[32]=v):v=e[32];let u;e[33]!==w||e[34]!==v?(u=s.jsxs("div",{className:"flex flex-col gap-4 h-full relative",children:[w,v]}),e[33]=w,e[34]=v,e[35]=u):u=e[35];let S;return e[36]!==c||e[37]!==u?(S=s.jsx(fe,{className:"p-6 cursor-pointer hover:bg-muted/50 transition-colors",onClick:c,children:u}),e[36]=c,e[37]=u,e[38]=S):S=e[38],S}function B(t){const e=$.c(12),{items:i,title:f,onItemClick:a}=t;if(i.length===0)return null;let p;e[0]!==f?(p=f&&s.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:s.jsx("h2",{className:"text-lg font-medium",children:f})}),e[0]=f,e[1]=p):p=e[1];let o;if(e[2]!==i||e[3]!==a){let l;e[5]!==a?(l=n=>{const m=Re(n);return s.jsx(Le,{...m,onClick:()=>a(n)},n.id)},e[5]=a,e[6]=l):l=e[6],o=i.map(l),e[2]=i,e[3]=a,e[4]=o}else o=e[4];let r;e[7]!==o?(r=s.jsx("div",{className:"grid grid-cols-4 gap-4",children:o}),e[7]=o,e[8]=r):r=e[8];let c;return e[9]!==p||e[10]!==r?(c=s.jsxs("div",{className:"flex flex-col gap-4",children:[p,r]}),e[9]=p,e[10]=r,e[11]=c):c=e[11],c}function ke(t,e){if(!e)return t;const i=e.toLowerCase();return t.filter(f=>(f.name||f.title||"").toLowerCase().includes(i)||(f.description||f.server.description||"").toLowerCase().includes(i))}function Te(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0||t.server._meta?.["mcp.mesh"]?.verified===!0}function Ee(t){const e=$.c(32),{items:i,isLoadingMore:f,registryId:a,hasMore:p,onLoadMore:o}=t,r=f===void 0?!1:f,c=p===void 0?!1:p,[l,n]=K.useState(""),m=F(),{org:x}=V(),j=K.useRef(null);let d,h,g;e[0]!==i||e[1]!==l?(d=ke(i,l),g=d.filter(Te),h=d.filter(R=>!g.find(L=>L.id===R.id)),e[0]=i,e[1]=l,e[2]=d,e[3]=h,e[4]=g):(d=e[2],h=e[3],g=e[4]);const y=h;let C;e[5]!==m||e[6]!==x.slug||e[7]!==a?(C=R=>{const L=oe(R.name||R.title||R.server.title||""),E=R.server.name;m({to:"/$org/store/$appName",params:{org:x.slug,appName:L},search:{registryId:a,serverName:E}})},e[5]=m,e[6]=x.slug,e[7]=a,e[8]=C):C=e[8];const b=C;let w;e[9]!==c||e[10]!==r||e[11]!==o||e[12]!==l?(w=R=>{if(!c||!o||l||r)return;const L=R.currentTarget;L.scrollHeight-L.scrollTop-L.clientHeight<200&&o()},e[9]=c,e[10]=r,e[11]=o,e[12]=l,e[13]=w):w=e[13];const I=w;let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=R=>{R.key==="Enter"&&n(R.currentTarget.value)},e[14]=v):v=e[14];let u;e[15]!==l?(u=s.jsx(me,{value:l,onChange:n,placeholder:"Search for an MCP Server...",onKeyDown:v}),e[15]=l,e[16]=u):u=e[16];let S;e[17]!==y||e[18]!==d||e[19]!==b||e[20]!==c||e[21]!==r||e[22]!==i.length||e[23]!==l||e[24]!==g?(S=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:i.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(re,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),s.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):l&&d.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ae,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):s.jsxs("div",{className:"flex flex-col gap-8",children:[g.length>0&&s.jsx(B,{items:g,title:"Verified",onItemClick:b}),y.length>0&&s.jsx(B,{items:y,title:g.length>0?"All":"",onItemClick:b}),c&&!l&&r&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(O,{size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[17]=y,e[18]=d,e[19]=b,e[20]=c,e[21]=r,e[22]=i.length,e[23]=l,e[24]=g,e[25]=S):S=e[25];let k;e[26]!==I||e[27]!==S?(k=s.jsx("div",{ref:j,className:"flex-1 overflow-y-auto",onScroll:I,children:S}),e[26]=I,e[27]=S,e[28]=k):k=e[28];let T;return e[29]!==u||e[30]!==k?(T=s.jsxs("div",{className:"flex flex-col h-full",children:[u,k]}),e[29]=u,e[30]=k,e[31]=T):T=e[31],T}const D=24;function Ae(t){const e=$.c(27),{registryId:i}=t,f=ee(i);let a,p,o,r;if(e[0]!==f?.tools||e[1]!==i){if(a=pe(f?.tools),!a)throw new Error("This registry does not support listing store items.");let u;e[6]!==i?(u=te(i),e[6]=i,e[7]=u):u=e[7],r=u,o=ge,p=H.toolCall(i,a,JSON.stringify({limit:D})),e[0]=f?.tools,e[1]=i,e[2]=a,e[3]=p,e[4]=o,e[5]=r}else a=e[2],p=e[3],o=e[4],r=e[5];let c;e[8]!==a||e[9]!==r?(c=async u=>{const{pageParam:S}=u;return await r(a,S?{cursor:S,limit:D}:{limit:D})},e[8]=a,e[9]=r,e[10]=c):c=e[10];let l;e[11]!==p||e[12]!==c?(l={queryKey:p,queryFn:c,initialPageParam:void 0,getNextPageParam:Ke,staleTime:36e5},e[11]=p,e[12]=c,e[13]=l):l=e[13];const{data:n,fetchNextPage:m,hasNextPage:x,isFetchingNextPage:j}=o(l);let d;e:{if(!n?.pages||n.pages.length===0){d=null;break e}const u=n.pages[0];if(typeof u=="object"&&u!==null&&"totalCount"in u&&typeof u.totalCount=="number"){d=u.totalCount;break e}d=null}const h=d,g=n?.pages;let y;e[14]!==g?(y=xe(g),e[14]=g,e[15]=y):y=e[15];const C=y;let b;e[16]!==m||e[17]!==x||e[18]!==j?(b=()=>{x&&!j&&m()},e[16]=m,e[17]=x,e[18]=j,e[19]=b):b=e[19];const w=b,I=x??!1;let v;return e[20]!==C||e[21]!==w||e[22]!==j||e[23]!==i||e[24]!==I||e[25]!==h?(v=s.jsx(Ee,{items:C,isLoadingMore:j,registryId:i,hasMore:I,onLoadMore:w,totalCount:h}),e[20]=C,e[21]=w,e[22]=j,e[23]=i,e[24]=I,e[25]=h,e[26]=v):v=e[26],v}function Ke(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function $e(t){const e=$.c(15),{registries:i,value:f,onValueChange:a,onAddWellKnown:p,wellKnownRegistries:o,placeholder:r}=t,c=r===void 0?"Select a registry...":r;let l;e[0]!==c?(l=s.jsx(ve,{size:"sm",className:"w-auto min-w-[160px]",children:s.jsx(Ne,{placeholder:c})}),e[0]=c,e[1]=l):l=e[1];let n;e[2]!==i?(n=i.map(ze),e[2]=i,e[3]=n):n=e[3];let m;e[4]!==p||e[5]!==o?(m=o.length>0&&s.jsxs("div",{className:"border-t border-border pt-1",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),o.map(d=>s.jsxs("button",{onClick:h=>{h.preventDefault(),h.stopPropagation(),p(d)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[d.icon?s.jsx("img",{src:d.icon,alt:d.title,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:d.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:d.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(we,{size:16})})]},d.id??d.title))]}),e[4]=p,e[5]=o,e[6]=m):m=e[6];let x;e[7]!==n||e[8]!==m?(x=s.jsxs(ye,{children:[n,m]}),e[7]=n,e[8]=m,e[9]=x):x=e[9];let j;return e[10]!==a||e[11]!==l||e[12]!==x||e[13]!==f?(j=s.jsxs(Ce,{value:f,onValueChange:a,children:[l,x]}),e[10]=a,e[11]=l,e[12]=x,e[13]=f,e[14]=j):j=e[14],j}function ze(t){return s.jsx(je,{className:"cursor-pointer",value:t.id??t.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?s.jsx("img",{src:t.icon,alt:t.name,className:"w-4 h-4 rounded"}):s.jsx("div",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:t.name})]})},t.id??t.name)}function Pe({registries:t,onConnected:e}){const i=W(),{org:{slug:f}}=V(),{data:a}=G.useSession(),p=F(),[o,r]=K.useState(!1),c=t[0],l=async()=>{if(!(!c||!a?.user?.id)){r(!0);try{const m=await i.create.mutateAsync(c);e?.(m.id)}finally{r(!1)}}},n=()=>{p({to:"/$org/mcps",params:{org:f},search:{action:"create"}})};return s.jsx(ce,{image:s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:s.jsxs(s.Fragment,{children:[s.jsxs(_,{variant:"outline",onClick:l,disabled:o||!c,children:[c?.icon&&s.jsx("img",{src:c.icon,alt:"",className:"size-4"}),o?"Installing...":"Install Registry"]}),s.jsx(_,{variant:"outline",onClick:n,children:"Custom Connection"})]})})}function pt(){const t=$.c(41),{org:e}=V(),i=se(),f=W(),a=q(),p=a.location.pathname.includes("/store/")&&a.location.pathname.split("/").length>3,o=Se(i);let r;t[0]!==o?(r=o.map(Ve),t[0]=o,t[1]=r):r=t[1];const c=r;let l;t[2]!==e.slug?(l=be.selectedRegistry(e.slug),t[2]=e.slug,t[3]=l):l=t[3];const[n,m]=Ie(l,De);let x;if(t[4]!==o||t[5]!==n){let N;t[7]!==n?(N=M=>M.id===n,t[7]=n,t[8]=N):N=t[8],x=o.find(N),t[4]=o,t[5]=n,t[6]=x}else x=t[6];const d=x?.id||o[0]?.id||"";let h;t[9]!==e.id?(h=Z(e.id),t[9]=e.id,t[10]=h):h=t[10];let g;t[11]!==h?(g=[h],t[11]=h,t[12]=g):g=t[12];const y=g;let C;t[13]===Symbol.for("react.memo_cache_sentinel")?(C=[J()],t[13]=C):C=t[13];const b=C;let w;t[14]!==f.create||t[15]!==m?(w=async N=>{const M=await f.create.mutateAsync(N);m(M.id)},t[14]=f.create,t[15]=m,t[16]=w):w=t[16];const I=w;let v;t[17]!==o?(v=new Set(o.map(Me)),t[17]=o,t[18]=v):v=t[18];const u=v;let S;t[19]!==u||t[20]!==y?(S=y.filter(N=>N.id&&!u.has(N.id)),t[19]=u,t[20]=y,t[21]=S):S=t[21];const k=S;let T;t[22]!==u?(T=b.filter(N=>N.id&&!u.has(N.id)),t[22]=u,t[23]=T):T=t[23];const R=T;if(p){let N;return t[24]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Y,{}),t[24]=N):N=t[24],N}let L;t[25]!==I?(L=async N=>I(N),t[25]=I,t[26]=L):L=t[26];let E;t[27]!==k||t[28]!==d||t[29]!==c||t[30]!==m||t[31]!==L?(E=s.jsx(Q,{title:"Store",ctaButton:s.jsx($e,{wellKnownRegistries:k,registries:c,value:d,onValueChange:m,onAddWellKnown:L,placeholder:"Select store..."})}),t[27]=k,t[28]=d,t[29]=c,t[30]=m,t[31]=L,t[32]=E):E=t[32];let z;t[33]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(O,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[33]=z):z=t[33];let A;t[34]!==R||t[35]!==d||t[36]!==m?(A=s.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:s.jsx(K.Suspense,{fallback:z,children:d?s.jsx(Ae,{registryId:d}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(Pe,{registries:R,onConnected:N=>{m(N)}})})})}),t[34]=R,t[35]=d,t[36]=m,t[37]=A):A=t[37];let P;return t[38]!==E||t[39]!==A?(P=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[E,A]}),t[38]=E,t[39]=A,t[40]=P):P=t[40],P}function Me(t){return t.id}function De(){return""}function Ve(t){return{id:t.id,name:t.title,icon:t.icon||void 0}}export{pt as default};
@@ -1 +1 @@
1
- import{r as D,c as _,j as s,f as ve,d as Se,b as Ie,a as _e,t as he}from"./index-BVHhSH8M.js";import{i as Le}from"./AlertCircle-CoA9j9_b.js";import{i as je}from"./Loading01-Dw6V1r3u.js";import{B as ie}from"./button-DMnSM5FV.js";import{i as Ae}from"./ArrowLeft-Bu1JR7vY.js";import{I as ye,a as Ee,u as De,b as Me,c as Ue}from"./use-connection-DUMeVexv.js";import{t as Ve}from"./ChevronDown-BmUd-Gap.js";import{s as ge}from"./Plus-CQSfshmp.js";import{b as $e,D as Re,a as ze,c as Be}from"./dropdown-menu-gRHakuHp.js";import{n as be}from"./LinkExternal01-LVkx-wZF.js";import{E as Pe}from"./SearchMd-CGUWNVUr.js";import{T as Ge,R as Fe}from"./tools-list-DJTZFgWM.js";import{R as Oe}from"./resource-tabs-JMDBPJhv.js";import{a as We}from"./use-binding-DQTEUjPl.js";import{u as He}from"./use-tool-call-BwHyofVZ.js";import{u as Ze}from"./use-mcp-CaAgRxkf.js";import{u as Ne}from"./tooltip-DiQ9SlNX.js";import{e as Ke}from"./extract-connection-data-DsJuSGHU.js";import{s as qe}from"./slugify-CEUa2lfQ.js";import{f as Je,e as Qe,b as Xe,c as Ye,g as et}from"./registry-utils-ulDDT0d8.js";import{e as tt}from"./app-name-gTETL9So.js";import{i as st}from"./InfoCircle-BYXT4R1l.js";import"./useQuery-C3iXPPho.js";import"./File06-BdMasDPT.js";import"./collection-display-button-BbSV76WH.js";import"./Grid01-Bom2qqwm.js";import"./view-mode-toggle-DCDdw_zu.js";import"./collection-search-BOBOP2ro.js";import"./input-C6vwKKeq.js";import"./collection-table-wrapper-ByX0J-nn.js";import"./card-DL_e-uTF.js";import"./layout-m8iq6RWE.js";import"./badge-Z-ujar-h.js";import"./auth-D6vm_lfk.js";import"./constants-C4MXZrmv.js";import"./generate-id-Dyweu44Y.js";const Ce=({size:t=24,color:e="currentColor",...o})=>D.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},D.createElement("path",{d:"m7.5 12 3 3 6-6m5.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Ce.displayName="CheckCircle";const we=({size:t=24,color:e="currentColor",...o})=>D.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},D.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"}));we.displayName="SearchLg";function ot(t){const e=_.c(3),{message:o}=t,n=o===void 0?"Loading app details...":o;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(je,{size:48,className:"animate-spin mb-4"}),e[0]=r):r=e[0];let i;return e[1]!==n?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,s.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}),e[1]=n,e[2]=i):i=e[2],i}function rt(t){const e=_.c(9),{error:o,onBack:n}=t,r=o instanceof Error?o.message:o;let i,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Le,{size:48,className:"text-destructive mb-4"}),d=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading app"}),e[0]=i,e[1]=d):(i=e[0],d=e[1]);let a;e[2]!==r?(a=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:r}),e[2]=r,e[3]=a):a=e[3];let l;e[4]!==n?(l=s.jsx("button",{onClick:n,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]=n,e[5]=l):l=e[5];let m;return e[6]!==a||e[7]!==l?(m=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,d,a,l]}),e[6]=a,e[7]=l,e[8]=m):m=e[8],m}function nt(t){const e=_.c(5),{onBack:o}=t;let n,r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(we,{size:48,className:"text-muted-foreground mb-4"}),r=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"App not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The app you're looking for doesn't exist in this store."}),e[0]=n,e[1]=r,e[2]=i):(n=e[0],r=e[1],i=e[2]);let d;return e[3]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,r,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]=d):d=e[4],d}function it(t){const e=_.c(3),{onBack:o}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ae,{}),e[0]=n):n=e[0];let r;return e[1]!==o?(r=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(ie,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:n})})}),e[1]=o,e[2]=r):r=e[2],r}function lt(t){const e=_.c(25),{data:o,itemVersions:n,onInstall:r,canInstall:i,isInstalling:d}=t,a=i===void 0?!0:i,l=d===void 0?!1:d,[m,p]=D.useState(0);let x;e[0]!==r?(x=S=>{p(S),r(S)},e[0]=r,e[1]=x):x=e[1];const f=x;let h;e[2]!==o.icon||e[3]!==o.name?(h=s.jsx(ye,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[2]=o.icon,e[3]=o.name,e[4]=h):h=e[4];let g;e[5]!==o.name?(g=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[5]=o.name,e[6]=g):g=e[6];let b;e[7]!==o.verified?(b=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[7]=o.verified,e[8]=b):b=e[8];let y;e[9]!==g||e[10]!==b?(y=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[g,b]})}),e[9]=g,e[10]=b,e[11]=y):y=e[11];let N;e[12]!==a||e[13]!==f||e[14]!==l||e[15]!==n||e[16]!==r||e[17]!==m?(N=a?s.jsx("div",{className:"shrink-0",children:n.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ie,{variant:"brand",onClick:()=>f(0),disabled:l,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(ge,{size:20}),l?"Connecting...":"Connect MCP Server"]}),s.jsxs($e,{children:[s.jsx(Re,{asChild:!0,children:s.jsx(ie,{variant:"brand",disabled:l,className:"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer",children:s.jsx(Ve,{size:20})})}),s.jsx(ze,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:n.map((S,w)=>{const I=S._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(Be,{onClick:()=>f(w),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"]}),I?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),w===m&&s.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0"})]})},w)})})]})]}):s.jsxs(ie,{variant:"brand",onClick:()=>r(),disabled:n.length===0||l,className:"shrink-0",children:[s.jsx(ge,{size:20}),l?"Connecting...":"Connect MCP Server"]})}):s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[12]=a,e[13]=f,e[14]=l,e[15]=n,e[16]=r,e[17]=m,e[18]=N):N=e[18];let C;e[19]!==y||e[20]!==N?(C=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[y,N]}),e[19]=y,e[20]=N,e[21]=C):C=e[21];let T;return e[22]!==h||e[23]!==C?(T=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[h,C]}),e[22]=h,e[23]=C,e[24]=T):T=e[24],T}function at(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 ct(t){const e=_.c(45),{data:o,publisherInfo:n,selectedItem:r}=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 d=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let a;e[2]!==n.logo||e[3]!==d?(a=s.jsx(ye,{icon:n.logo,name:d,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=n.logo,e[3]=d,e[4]=a):a=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 m;e[7]!==l?(m=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=m):m=e[8];let p;e[9]!==n.count?(p=n.count>0?s.jsxs(s.Fragment,{children:[s.jsx("img",{src:"/globe.svg",alt:"globe",className:"w-3 h-3"}),s.jsxs("span",{children:[n.count," ",n.count===1?"published app":"published apps"]})]}):"Publisher",e[9]=n.count,e[10]=p):p=e[10];let x;e[11]!==p?(x=s.jsx("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:p}),e[11]=p,e[12]=x):x=e[12];let f;e[13]!==m||e[14]!==x?(f=s.jsxs("div",{children:[m,x]}),e[13]=m,e[14]=x,e[15]=f):f=e[15];let h;e[16]!==a||e[17]!==f?(h=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[a,f]})}),e[16]=a,e[17]=f,e[18]=h):h=e[18];let g;e[19]!==o.version?(g=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[19]=o.version,e[20]=g):g=e[20];let b;e[21]!==o.connectionType?(b=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]=b):b=e[22];let y;e[23]!==o.schemaVersion?(y=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]=y):y=e[24];let N;e[25]!==o.websiteUrl?(N=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(be,{size:14})]})]}),e[25]=o.websiteUrl,e[26]=N):N=e[26];let C;e[27]!==o.repository?(C=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(be,{size:14})]})]}),e[27]=o.repository,e[28]=C):C=e[28];let T;e[29]!==g||e[30]!==b||e[31]!==y||e[32]!==N||e[33]!==C?(T=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[g,b,y,N,C]}),e[29]=g,e[30]=b,e[31]=y,e[32]=N,e[33]=C,e[34]=T):T=e[34];let S;e[35]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[35]=S):S=e[35];let w;e[36]!==r.updated_at?(w=at(r.updated_at),e[36]=r.updated_at,e[37]=w):w=e[37];let I;e[38]!==w?(I=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[S,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:w})]}),e[38]=w,e[39]=I):I=e[39];let u;return e[40]!==i||e[41]!==T||e[42]!==I||e[43]!==h?(u=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,h,T,I]}),e[40]=i,e[41]=T,e[42]=I,e[43]=h,e[44]=u):u=e[44],u}function dt(t){const e=_.c(18),{data:o,availableTabs:n,effectiveActiveTabId:r,effectiveTools:i,isLoadingTools:d,onTabChange:a}=t,l=d===void 0?!1:d;let m;e[0]!==i?(m=i.map(mt),e[0]=i,e[1]=m):m=e[1];const p=m;let x;e[2]!==n||e[3]!==r||e[4]!==a?(x=n.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(Oe,{tabs:n,activeTab:r,onTabChange:a})}),e[2]=n,e[3]=r,e[4]=a,e[5]=x):x=e[5];let f;e[6]!==r||e[7]!==i.length||e[8]!==l||e[9]!==p?(f=r==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:l?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(je,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(Ge,{tools:p,showToolbar:!1,emptyMessage:"This app doesn't have any tools."}):s.jsx(Pe,{image:null,title:"No tools available",description:"This app doesn't have any tools."})}),e[6]=r,e[7]=i.length,e[8]=l,e[9]=p,e[10]=f):f=e[10];let h;e[11]!==o?.repository||e[12]!==r?(h=r==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Fe,{repository:o?.repository})}),e[11]=o?.repository,e[12]=r,e[13]=h):h=e[13];let g;return e[14]!==x||e[15]!==f||e[16]!==h?(g=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[x,f,h]}),e[14]=x,e[15]=f,e[16]=h,e[17]=g):g=e[17],g}function mt(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function ft(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(n=>n.app_name?.toLowerCase()===o||n.app_id?.toLowerCase()===o||n.title.toLowerCase()===o)||t.find(n=>n.title.toLowerCase().includes(o))}function ut(t,e,o,n,r){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:n?.icon||void 0,count:r??t.length};const i=e.toLowerCase(),d=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||d[0]?.publisher_logo||d[0]?.icon||void 0,count:d.length}}function pt(t){const e=t.server._meta?.["mcp.mesh/publisher-provided"],o=t._meta?.["mcp.mesh"],n=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,i=Xe(r.remotes?.[0]?.type),d=Ye(r.$schema),a=n?"io.modelcontextprotocol.registry/official":t.publisher||o?.scopeName||"Unknown",l=et(r.repository),m=t.icon||t.image||t.logo||r.icons?.[0]?.src||l||null,p=t.name||t.title||t.server?.title||"Unnamed Item";return{name:tt(p),description:t.description||t.summary||t.server?.description||"",icon:m,verified:t.verified||o?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:d??null,connectionType:i,connectionUrl:null,remoteUrl:null,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 xt extends D.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store app detail error:",e,o)}render(){return this.state.hasError?s.jsx(rt,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ht(){const t=_.c(70),{org:e}=Ne(),o=ve();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const{appName:r}=Se(n);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:d,serverName:a}=Ie(i),[l,m]=D.useState("readme"),p=Ee(),x=De(),{data:f}=_e.useSession(),h=We(x),g=d||h[0]?.id||"",b=Me(g),y=Je(b?.tools),N=b?.tools&&b.tools.find(yt)?.name||"",C=b?.tools&&b.tools.find(jt)?.name||"",T=Ue(g),S=!!a;let w,I;S?(w=N||C,I={name:a}):(w=y,I={});const{data:u}=He({toolCaller:T,toolName:w,toolInputParams:I,scope:g});let M=[],L=[],pe=null;if(u){if(Array.isArray(u))M=u;else if(typeof u=="object"&&u!==null)if("totalCount"in u&&typeof u.totalCount=="number"&&(pe=u.totalCount),"item"in u&&u.item){const c=u.item,k=c.id||"",U=c.server,V=c._meta;let E;t[2]!==c.title||t[3]!==k||t[4]!==U||t[5]!==V?(E=[{id:k,title:c.title,server:U,_meta:V}],t[2]=c.title,t[3]=k,t[4]=U,t[5]=V,t[6]=E):E=t[6],M=E}else{let c;"versions"in u&&Array.isArray(u.versions)?c="versions":"servers"in u&&Array.isArray(u.servers)?c="servers":c=Object.keys(u).find(k=>Array.isArray(u[k])),c&&(M=u[c],(c==="versions"||w?.includes("VERSIONS"))&&(L=M))}}let X;t[7]!==r?(X=c=>{const k=c.name||c.title||c.server.title||"";return qe(k)===r},t[7]=r,t[8]=X):X=t[8];let j=M.find(X);if(!j&&a){let c;t[9]!==a?(c=k=>k.server.name===a||k.name===a||k.title===a,t[9]=a,t[10]=c):c=t[10],j=M.find(c)}const v=j?pt(j):null,le=(v?.tools?.length||0)>0,ae=j?.server?.remotes?.[0]?.url||null,J=!le&&!!ae,Q=Ze({url:J?ae:""}),Y=J&&Q.state==="connecting";let ee;t[11]!==Q||t[12]!==J?(ee=J&&Q.state==="ready"?(Q.tools||[]).map(vt):[],t[11]=Q,t[12]=J,t[13]=ee):ee=t[13];const xe=ee,$=le?v?.tools||[]:xe,ke=ft(x,v?.publisher),ce=v?ut(M,v.publisher,ke,b??null,pe):{count:0},Te=v?.repository?Qe(v.repository):null,de=!!v?.repository&&!!Te;let R;t[14]!==de?(R={id:"readme",label:"README",visible:de},t[14]=de,t[15]=R):R=t[15];const me=le||xe.length>0||Y&&!!ae;let z;t[16]!==$.length||t[17]!==me?(z={id:"tools",label:"Tools",count:$.length,visible:me},t[16]=$.length,t[17]=me,t[18]=z):z=t[18];let te;t[19]!==R||t[20]!==z?(te=[R,z].filter(bt),t[19]=R,t[20]=z,t[21]=te):te=t[21];const A=te;let se;t[22]!==l||t[23]!==A?(se=A.find(c=>c.id===l)?l:A.find(gt)?.id||A[0]?.id||"overview",t[22]=l,t[23]=A,t[24]=se):se=t[24];const fe=se;let oe;t[25]!==p||t[26]!==L||t[27]!==o||t[28]!==e||t[29]!==j||t[30]!==f?(oe=async c=>{const k=L[c??0]||j;if(!k||!e||!f?.user?.id)return;const U=Ke(k,e.id,f.user.id);if(!U.connection_url){he.error("This MCP Server cannot be connected: no connection URL available");return}try{const{id:V}=await p.create.mutateAsync(U);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:V}})}catch(V){const E=V;he.error(`Failed to connect MCP Server: ${E instanceof Error?E.message:String(E)}`)}},t[25]=p,t[26]=L,t[27]=o,t[28]=e,t[29]=j,t[30]=f,t[31]=oe):oe=t[31];const ue=oe;let re;t[32]!==o||t[33]!==e.slug?(re=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[32]=o,t[33]=e.slug,t[34]=re):re=t[34];const B=re;if(!j){let c;return t[35]!==B?(c=s.jsx(nt,{onBack:B}),t[35]=B,t[36]=c):c=t[36],c}if(!v)return null;const P=(j?.server?.remotes?.length??0)>0;let G;t[37]!==B?(G=s.jsx(it,{onBack:B}),t[37]=B,t[38]=G):G=t[38];let F;t[39]!==P?(F=!P&&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(st,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[39]=P,t[40]=F):F=t[40];let O;t[41]!==L||t[42]!==j?(O=L.length>0?L:[j],t[41]=L,t[42]=j,t[43]=O):O=t[43];let W;t[44]!==p.create.isPending||t[45]!==P||t[46]!==v||t[47]!==ue||t[48]!==O?(W=s.jsx(lt,{data:v,itemVersions:O,onInstall:ue,canInstall:P,isInstalling:p.create.isPending}),t[44]=p.create.isPending,t[45]=P,t[46]=v,t[47]=ue,t[48]=O,t[49]=W):W=t[49];let H;t[50]!==v||t[51]!==ce||t[52]!==j?(H=s.jsx(ct,{data:v,publisherInfo:ce,selectedItem:j}),t[50]=v,t[51]=ce,t[52]=j,t[53]=H):H=t[53];let Z;t[54]!==A||t[55]!==v||t[56]!==fe||t[57]!==$||t[58]!==Y?(Z=s.jsx(dt,{data:v,availableTabs:A,effectiveActiveTabId:fe,effectiveTools:$,isLoadingTools:Y,onTabChange:m}),t[54]=A,t[55]=v,t[56]=fe,t[57]=$,t[58]=Y,t[59]=Z):Z=t[59];let K;t[60]!==H||t[61]!==Z?(K=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[H,Z]}),t[60]=H,t[61]=Z,t[62]=K):K=t[62];let q;t[63]!==F||t[64]!==W||t[65]!==K?(q=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:[F,W,K]})})}),t[63]=F,t[64]=W,t[65]=K,t[66]=q):q=t[66];let ne;return t[67]!==G||t[68]!==q?(ne=s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[G,q]}),t[67]=G,t[68]=q,t[69]=ne):ne=t[69],ne}function gt(t){return t.id==="readme"}function bt(t){return t.visible}function vt(t){return{name:t.name,description:t.description}}function jt(t){return t.name.endsWith("_GET")}function yt(t){return t.name.endsWith("_VERSIONS")}function rs(){const t=_.c(6),{org:e}=Ne(),o=ve();let n;t[0]!==o||t[1]!==e.slug?(n=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=n):n=t[2];const r=n;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(D.Suspense,{fallback:s.jsx(ot,{}),children:s.jsx(ht,{})}),t[3]=i):i=t[3];let d;return t[4]!==r?(d=s.jsx(xt,{onBack:r,children:i}),t[4]=r,t[5]=d):d=t[5],d}export{rs as default};
1
+ import{r as D,c as _,j as s,f as ve,d as Se,b as Ie,a as _e,t as he}from"./index-BLgTJ8o3.js";import{i as Le}from"./AlertCircle-BrGqb-qb.js";import{i as je}from"./Loading01-0wYmSKV6.js";import{B as ie}from"./button-IijH0wdI.js";import{i as Ae}from"./ArrowLeft-B6h573ak.js";import{I as ye,a as Ee,u as De,b as Me,c as Ue}from"./use-connection-CsPrFY0x.js";import{t as Ve}from"./ChevronDown-BuogCeI0.js";import{s as ge}from"./Plus-DofiSAMU.js";import{b as $e,D as Re,a as ze,c as Be}from"./dropdown-menu-BvLCKekW.js";import{n as be}from"./LinkExternal01-DfHTXuZ9.js";import{E as Pe}from"./SearchMd-D70t5LVP.js";import{T as Ge,R as Fe}from"./tools-list-CFmwpEf4.js";import{R as Oe}from"./resource-tabs-s0IiCCzU.js";import{a as We}from"./use-binding-C5e_Y70M.js";import{u as He}from"./use-tool-call-BdbJ3oy8.js";import{u as Ze}from"./use-mcp-CPBDJGOj.js";import{u as Ne}from"./tooltip-CSuczTFq.js";import{e as Ke}from"./extract-connection-data-BgA1QcA6.js";import{s as qe}from"./slugify-CEUa2lfQ.js";import{f as Je,e as Qe,b as Xe,c as Ye,g as et}from"./registry-utils-ulDDT0d8.js";import{e as tt}from"./app-name-gTETL9So.js";import{i as st}from"./InfoCircle-D6JXYJn_.js";import"./useQuery-DXchCtgN.js";import"./File06-CpSSTggW.js";import"./collection-display-button-2ZQ5sQTW.js";import"./Grid01-CmB5R6oU.js";import"./view-mode-toggle-BXo-WMnB.js";import"./collection-search-CM9rltH6.js";import"./input-BxywPo2X.js";import"./collection-table-wrapper-BRI7T6RJ.js";import"./card-BnWpolEI.js";import"./layout-Dfp1nH3g.js";import"./badge-CStgouQf.js";import"./auth-DpA5_jth.js";import"./constants-TKUQnnwA.js";import"./generate-id-Dyweu44Y.js";const Ce=({size:t=24,color:e="currentColor",...o})=>D.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},D.createElement("path",{d:"m7.5 12 3 3 6-6m5.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Ce.displayName="CheckCircle";const we=({size:t=24,color:e="currentColor",...o})=>D.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},D.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"}));we.displayName="SearchLg";function ot(t){const e=_.c(3),{message:o}=t,n=o===void 0?"Loading app details...":o;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(je,{size:48,className:"animate-spin mb-4"}),e[0]=r):r=e[0];let i;return e[1]!==n?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,s.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}),e[1]=n,e[2]=i):i=e[2],i}function rt(t){const e=_.c(9),{error:o,onBack:n}=t,r=o instanceof Error?o.message:o;let i,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(Le,{size:48,className:"text-destructive mb-4"}),d=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading app"}),e[0]=i,e[1]=d):(i=e[0],d=e[1]);let a;e[2]!==r?(a=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:r}),e[2]=r,e[3]=a):a=e[3];let l;e[4]!==n?(l=s.jsx("button",{onClick:n,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]=n,e[5]=l):l=e[5];let m;return e[6]!==a||e[7]!==l?(m=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,d,a,l]}),e[6]=a,e[7]=l,e[8]=m):m=e[8],m}function nt(t){const e=_.c(5),{onBack:o}=t;let n,r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(we,{size:48,className:"text-muted-foreground mb-4"}),r=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"App not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The app you're looking for doesn't exist in this store."}),e[0]=n,e[1]=r,e[2]=i):(n=e[0],r=e[1],i=e[2]);let d;return e[3]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,r,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]=d):d=e[4],d}function it(t){const e=_.c(3),{onBack:o}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ae,{}),e[0]=n):n=e[0];let r;return e[1]!==o?(r=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(ie,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:n})})}),e[1]=o,e[2]=r):r=e[2],r}function lt(t){const e=_.c(25),{data:o,itemVersions:n,onInstall:r,canInstall:i,isInstalling:d}=t,a=i===void 0?!0:i,l=d===void 0?!1:d,[m,p]=D.useState(0);let x;e[0]!==r?(x=S=>{p(S),r(S)},e[0]=r,e[1]=x):x=e[1];const f=x;let h;e[2]!==o.icon||e[3]!==o.name?(h=s.jsx(ye,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[2]=o.icon,e[3]=o.name,e[4]=h):h=e[4];let g;e[5]!==o.name?(g=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[5]=o.name,e[6]=g):g=e[6];let b;e[7]!==o.verified?(b=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[7]=o.verified,e[8]=b):b=e[8];let y;e[9]!==g||e[10]!==b?(y=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[g,b]})}),e[9]=g,e[10]=b,e[11]=y):y=e[11];let N;e[12]!==a||e[13]!==f||e[14]!==l||e[15]!==n||e[16]!==r||e[17]!==m?(N=a?s.jsx("div",{className:"shrink-0",children:n.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ie,{variant:"brand",onClick:()=>f(0),disabled:l,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(ge,{size:20}),l?"Connecting...":"Connect MCP Server"]}),s.jsxs($e,{children:[s.jsx(Re,{asChild:!0,children:s.jsx(ie,{variant:"brand",disabled:l,className:"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer",children:s.jsx(Ve,{size:20})})}),s.jsx(ze,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:n.map((S,w)=>{const I=S._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(Be,{onClick:()=>f(w),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"]}),I?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),w===m&&s.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0"})]})},w)})})]})]}):s.jsxs(ie,{variant:"brand",onClick:()=>r(),disabled:n.length===0||l,className:"shrink-0",children:[s.jsx(ge,{size:20}),l?"Connecting...":"Connect MCP Server"]})}):s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[12]=a,e[13]=f,e[14]=l,e[15]=n,e[16]=r,e[17]=m,e[18]=N):N=e[18];let C;e[19]!==y||e[20]!==N?(C=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[y,N]}),e[19]=y,e[20]=N,e[21]=C):C=e[21];let T;return e[22]!==h||e[23]!==C?(T=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[h,C]}),e[22]=h,e[23]=C,e[24]=T):T=e[24],T}function at(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 ct(t){const e=_.c(45),{data:o,publisherInfo:n,selectedItem:r}=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 d=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let a;e[2]!==n.logo||e[3]!==d?(a=s.jsx(ye,{icon:n.logo,name:d,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=n.logo,e[3]=d,e[4]=a):a=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 m;e[7]!==l?(m=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=m):m=e[8];let p;e[9]!==n.count?(p=n.count>0?s.jsxs(s.Fragment,{children:[s.jsx("img",{src:"/globe.svg",alt:"globe",className:"w-3 h-3"}),s.jsxs("span",{children:[n.count," ",n.count===1?"published app":"published apps"]})]}):"Publisher",e[9]=n.count,e[10]=p):p=e[10];let x;e[11]!==p?(x=s.jsx("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:p}),e[11]=p,e[12]=x):x=e[12];let f;e[13]!==m||e[14]!==x?(f=s.jsxs("div",{children:[m,x]}),e[13]=m,e[14]=x,e[15]=f):f=e[15];let h;e[16]!==a||e[17]!==f?(h=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[a,f]})}),e[16]=a,e[17]=f,e[18]=h):h=e[18];let g;e[19]!==o.version?(g=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[19]=o.version,e[20]=g):g=e[20];let b;e[21]!==o.connectionType?(b=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]=b):b=e[22];let y;e[23]!==o.schemaVersion?(y=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]=y):y=e[24];let N;e[25]!==o.websiteUrl?(N=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(be,{size:14})]})]}),e[25]=o.websiteUrl,e[26]=N):N=e[26];let C;e[27]!==o.repository?(C=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(be,{size:14})]})]}),e[27]=o.repository,e[28]=C):C=e[28];let T;e[29]!==g||e[30]!==b||e[31]!==y||e[32]!==N||e[33]!==C?(T=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[g,b,y,N,C]}),e[29]=g,e[30]=b,e[31]=y,e[32]=N,e[33]=C,e[34]=T):T=e[34];let S;e[35]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[35]=S):S=e[35];let w;e[36]!==r.updated_at?(w=at(r.updated_at),e[36]=r.updated_at,e[37]=w):w=e[37];let I;e[38]!==w?(I=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[S,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:w})]}),e[38]=w,e[39]=I):I=e[39];let u;return e[40]!==i||e[41]!==T||e[42]!==I||e[43]!==h?(u=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,h,T,I]}),e[40]=i,e[41]=T,e[42]=I,e[43]=h,e[44]=u):u=e[44],u}function dt(t){const e=_.c(18),{data:o,availableTabs:n,effectiveActiveTabId:r,effectiveTools:i,isLoadingTools:d,onTabChange:a}=t,l=d===void 0?!1:d;let m;e[0]!==i?(m=i.map(mt),e[0]=i,e[1]=m):m=e[1];const p=m;let x;e[2]!==n||e[3]!==r||e[4]!==a?(x=n.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(Oe,{tabs:n,activeTab:r,onTabChange:a})}),e[2]=n,e[3]=r,e[4]=a,e[5]=x):x=e[5];let f;e[6]!==r||e[7]!==i.length||e[8]!==l||e[9]!==p?(f=r==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:l?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(je,{size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(Ge,{tools:p,showToolbar:!1,emptyMessage:"This app doesn't have any tools."}):s.jsx(Pe,{image:null,title:"No tools available",description:"This app doesn't have any tools."})}),e[6]=r,e[7]=i.length,e[8]=l,e[9]=p,e[10]=f):f=e[10];let h;e[11]!==o?.repository||e[12]!==r?(h=r==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Fe,{repository:o?.repository})}),e[11]=o?.repository,e[12]=r,e[13]=h):h=e[13];let g;return e[14]!==x||e[15]!==f||e[16]!==h?(g=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[x,f,h]}),e[14]=x,e[15]=f,e[16]=h,e[17]=g):g=e[17],g}function mt(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function ft(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(n=>n.app_name?.toLowerCase()===o||n.app_id?.toLowerCase()===o||n.title.toLowerCase()===o)||t.find(n=>n.title.toLowerCase().includes(o))}function ut(t,e,o,n,r){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:n?.icon||void 0,count:r??t.length};const i=e.toLowerCase(),d=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||d[0]?.publisher_logo||d[0]?.icon||void 0,count:d.length}}function pt(t){const e=t.server._meta?.["mcp.mesh/publisher-provided"],o=t._meta?.["mcp.mesh"],n=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,i=Xe(r.remotes?.[0]?.type),d=Ye(r.$schema),a=n?"io.modelcontextprotocol.registry/official":t.publisher||o?.scopeName||"Unknown",l=et(r.repository),m=t.icon||t.image||t.logo||r.icons?.[0]?.src||l||null,p=t.name||t.title||t.server?.title||"Unnamed Item";return{name:tt(p),description:t.description||t.summary||t.server?.description||"",icon:m,verified:t.verified||o?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:d??null,connectionType:i,connectionUrl:null,remoteUrl:null,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 xt extends D.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store app detail error:",e,o)}render(){return this.state.hasError?s.jsx(rt,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ht(){const t=_.c(70),{org:e}=Ne(),o=ve();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const{appName:r}=Se(n);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:d,serverName:a}=Ie(i),[l,m]=D.useState("readme"),p=Ee(),x=De(),{data:f}=_e.useSession(),h=We(x),g=d||h[0]?.id||"",b=Me(g),y=Je(b?.tools),N=b?.tools&&b.tools.find(yt)?.name||"",C=b?.tools&&b.tools.find(jt)?.name||"",T=Ue(g),S=!!a;let w,I;S?(w=N||C,I={name:a}):(w=y,I={});const{data:u}=He({toolCaller:T,toolName:w,toolInputParams:I,scope:g});let M=[],L=[],pe=null;if(u){if(Array.isArray(u))M=u;else if(typeof u=="object"&&u!==null)if("totalCount"in u&&typeof u.totalCount=="number"&&(pe=u.totalCount),"item"in u&&u.item){const c=u.item,k=c.id||"",U=c.server,V=c._meta;let E;t[2]!==c.title||t[3]!==k||t[4]!==U||t[5]!==V?(E=[{id:k,title:c.title,server:U,_meta:V}],t[2]=c.title,t[3]=k,t[4]=U,t[5]=V,t[6]=E):E=t[6],M=E}else{let c;"versions"in u&&Array.isArray(u.versions)?c="versions":"servers"in u&&Array.isArray(u.servers)?c="servers":c=Object.keys(u).find(k=>Array.isArray(u[k])),c&&(M=u[c],(c==="versions"||w?.includes("VERSIONS"))&&(L=M))}}let X;t[7]!==r?(X=c=>{const k=c.name||c.title||c.server.title||"";return qe(k)===r},t[7]=r,t[8]=X):X=t[8];let j=M.find(X);if(!j&&a){let c;t[9]!==a?(c=k=>k.server.name===a||k.name===a||k.title===a,t[9]=a,t[10]=c):c=t[10],j=M.find(c)}const v=j?pt(j):null,le=(v?.tools?.length||0)>0,ae=j?.server?.remotes?.[0]?.url||null,J=!le&&!!ae,Q=Ze({url:J?ae:""}),Y=J&&Q.state==="connecting";let ee;t[11]!==Q||t[12]!==J?(ee=J&&Q.state==="ready"?(Q.tools||[]).map(vt):[],t[11]=Q,t[12]=J,t[13]=ee):ee=t[13];const xe=ee,$=le?v?.tools||[]:xe,ke=ft(x,v?.publisher),ce=v?ut(M,v.publisher,ke,b??null,pe):{count:0},Te=v?.repository?Qe(v.repository):null,de=!!v?.repository&&!!Te;let R;t[14]!==de?(R={id:"readme",label:"README",visible:de},t[14]=de,t[15]=R):R=t[15];const me=le||xe.length>0||Y&&!!ae;let z;t[16]!==$.length||t[17]!==me?(z={id:"tools",label:"Tools",count:$.length,visible:me},t[16]=$.length,t[17]=me,t[18]=z):z=t[18];let te;t[19]!==R||t[20]!==z?(te=[R,z].filter(bt),t[19]=R,t[20]=z,t[21]=te):te=t[21];const A=te;let se;t[22]!==l||t[23]!==A?(se=A.find(c=>c.id===l)?l:A.find(gt)?.id||A[0]?.id||"overview",t[22]=l,t[23]=A,t[24]=se):se=t[24];const fe=se;let oe;t[25]!==p||t[26]!==L||t[27]!==o||t[28]!==e||t[29]!==j||t[30]!==f?(oe=async c=>{const k=L[c??0]||j;if(!k||!e||!f?.user?.id)return;const U=Ke(k,e.id,f.user.id);if(!U.connection_url){he.error("This MCP Server cannot be connected: no connection URL available");return}try{const{id:V}=await p.create.mutateAsync(U);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:V}})}catch(V){const E=V;he.error(`Failed to connect MCP Server: ${E instanceof Error?E.message:String(E)}`)}},t[25]=p,t[26]=L,t[27]=o,t[28]=e,t[29]=j,t[30]=f,t[31]=oe):oe=t[31];const ue=oe;let re;t[32]!==o||t[33]!==e.slug?(re=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[32]=o,t[33]=e.slug,t[34]=re):re=t[34];const B=re;if(!j){let c;return t[35]!==B?(c=s.jsx(nt,{onBack:B}),t[35]=B,t[36]=c):c=t[36],c}if(!v)return null;const P=(j?.server?.remotes?.length??0)>0;let G;t[37]!==B?(G=s.jsx(it,{onBack:B}),t[37]=B,t[38]=G):G=t[38];let F;t[39]!==P?(F=!P&&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(st,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[39]=P,t[40]=F):F=t[40];let O;t[41]!==L||t[42]!==j?(O=L.length>0?L:[j],t[41]=L,t[42]=j,t[43]=O):O=t[43];let W;t[44]!==p.create.isPending||t[45]!==P||t[46]!==v||t[47]!==ue||t[48]!==O?(W=s.jsx(lt,{data:v,itemVersions:O,onInstall:ue,canInstall:P,isInstalling:p.create.isPending}),t[44]=p.create.isPending,t[45]=P,t[46]=v,t[47]=ue,t[48]=O,t[49]=W):W=t[49];let H;t[50]!==v||t[51]!==ce||t[52]!==j?(H=s.jsx(ct,{data:v,publisherInfo:ce,selectedItem:j}),t[50]=v,t[51]=ce,t[52]=j,t[53]=H):H=t[53];let Z;t[54]!==A||t[55]!==v||t[56]!==fe||t[57]!==$||t[58]!==Y?(Z=s.jsx(dt,{data:v,availableTabs:A,effectiveActiveTabId:fe,effectiveTools:$,isLoadingTools:Y,onTabChange:m}),t[54]=A,t[55]=v,t[56]=fe,t[57]=$,t[58]=Y,t[59]=Z):Z=t[59];let K;t[60]!==H||t[61]!==Z?(K=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[H,Z]}),t[60]=H,t[61]=Z,t[62]=K):K=t[62];let q;t[63]!==F||t[64]!==W||t[65]!==K?(q=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:[F,W,K]})})}),t[63]=F,t[64]=W,t[65]=K,t[66]=q):q=t[66];let ne;return t[67]!==G||t[68]!==q?(ne=s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[G,q]}),t[67]=G,t[68]=q,t[69]=ne):ne=t[69],ne}function gt(t){return t.id==="readme"}function bt(t){return t.visible}function vt(t){return{name:t.name,description:t.description}}function jt(t){return t.name.endsWith("_GET")}function yt(t){return t.name.endsWith("_VERSIONS")}function rs(){const t=_.c(6),{org:e}=Ne(),o=ve();let n;t[0]!==o||t[1]!==e.slug?(n=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=n):n=t[2];const r=n;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(D.Suspense,{fallback:s.jsx(ot,{}),children:s.jsx(ht,{})}),t[3]=i):i=t[3];let d;return t[4]!==r?(d=s.jsx(xt,{onBack:r,children:i}),t[4]=r,t[5]=d):d=t[5],d}export{rs as default};
@@ -1 +1 @@
1
- import{r as j,c as I,j as t,H as X,B as M,Z as z,z as Z,E as _,aH as G,aI as J}from"./index-BVHhSH8M.js";import{I as $,u as K}from"./use-connection-DUMeVexv.js";import{C as H}from"./checkbox-SCLb_n1h.js";import{c as S,B as Y}from"./button-DMnSM5FV.js";import{i as ee}from"./ArrowLeft-Bu1JR7vY.js";import{C as te}from"./collection-search-BOBOP2ro.js";const se=j.memo(function(o){const e=I.c(21),{connection:n,isSelected:r,hasToolsEnabled:c,activeToolsCount:i,totalToolsCount:x,onSelect:b,onToggle:g}=o,d=r?"bg-accent/50":"hover:bg-muted/50";let u;e[0]!==d?(u=S("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),e[0]=d,e[1]=u):u=e[1];let m;e[2]!==n.icon||e[3]!==n.title?(m=t.jsx($,{icon:n.icon,name:n.title,size:"xs"}),e[2]=n.icon,e[3]=n.title,e[4]=m):m=e[4];let p;e[5]!==n.title?(p=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title})}),e[5]=n.title,e[6]=p):p=e[6];let a;e[7]!==b||e[8]!==m||e[9]!==p?(a=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:b,children:[m,p]}),e[7]=b,e[8]=m,e[9]=p,e[10]=a):a=e[10];let f;e[11]!==i||e[12]!==n.tools||e[13]!==c||e[14]!==g||e[15]!==x?(f=n.tools&&n.tools.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[i,"/",x]}),t.jsx(H,{checked:c,onCheckedChange:g,onClick:ne})]}),e[11]=i,e[12]=n.tools,e[13]=c,e[14]=g,e[15]=x,e[16]=f):f=e[16];let C;return e[17]!==u||e[18]!==a||e[19]!==f?(C=t.jsxs("div",{className:u,children:[a,f]}),e[17]=u,e[18]=a,e[19]=f,e[20]=C):C=e[20],C}),oe=j.memo(function(o){const e=I.c(18),{connectionId:n,tool:r,isSelected:c,onToggle:i}=o,x=`tool-${n}-${r.name}`,b=c?"text-foreground":"text-muted-foreground";let g;e[0]!==b?(g=S("text-sm font-medium",b),e[0]=b,e[1]=g):g=e[1];let d;e[2]!==g||e[3]!==r.name?(d=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:g,children:r.name})}),e[2]=g,e[3]=r.name,e[4]=d):d=e[4];let u;e[5]!==r.description?(u=r.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.description}),e[5]=r.description,e[6]=u):u=e[6];let m;e[7]!==d||e[8]!==u?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,u]}),e[7]=d,e[8]=u,e[9]=m):m=e[9];const p=`tool-${n}-${r.name}`;let a;e[10]!==c||e[11]!==i||e[12]!==p?(a=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(H,{id:p,checked:c,onCheckedChange:i,onClick:re})}),e[10]=c,e[11]=i,e[12]=p,e[13]=a):a=e[13];let f;return e[14]!==x||e[15]!==m||e[16]!==a?(f=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:x,children:[m,a]}),e[14]=x,e[15]=m,e[16]=a,e[17]=f):f=e[17],f});function ge({toolSet:l,onToolSetChange:o}){const[e,n]=j.useState(""),r=j.useDeferredValue(e),[c,i]=j.useState("all"),[x,b]=j.useState(!1),g=j.useRef(new Set(Object.keys(l))),d=K({searchTerm:r.trim()||void 0}),u=g.current,m=[...u.values()].map(s=>d.find(h=>h.id===s)).filter(s=>s!==void 0),p=d.filter(s=>!u.has(s.id)),a=[...m,...p],f=s=>{const h=l[s];return h!==void 0&&h.length>0},C=a.filter(s=>{if(c==="all")return!0;const h=f(s.id);return c==="selected"?h:c==="unselected"?!h:!0}),[w,E]=j.useState(a[0]?.id??null),v=w?a.find(s=>s.id===w)??null:null,P=v?.tools??[],Q=(s,h)=>l[s]?.includes(h)??!1,q=(s,h)=>{const N=l[s]??[],R=N.includes(h),T={...l};if(R){const y=N.filter(k=>k!==h);y.length===0?delete T[s]:T[s]=y}else T[s]=[...N,h];o(T)},L=s=>{const h=a.find(k=>k.id===s);if(!h?.tools)return;const N=l[s]??[],R=h.tools.map(k=>k.name),T=N.length>0&&R.every(k=>N.includes(k)),y={...l};T?delete y[s]:(y[s]=R,E(s)),o(y)},V=s=>{E(s),b(!0)},W=()=>{b(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:S("w-full md:w-80 border-r border-border flex flex-col",x&&"hidden md:flex"),children:[t.jsx(te,{value:e,onChange:n,placeholder:"Search MCP Servers..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>i("all"),className:S("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>i("selected"),className:S("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>i("unselected"),className:S("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:C.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:e?"No connections found":c==="selected"?"No servers selected":c==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:C.map(s=>{const h=s.tools?.length??0,N=l[s.id]?.length??0;return t.jsx(se,{connection:s,isSelected:w===s.id,hasToolsEnabled:f(s.id),activeToolsCount:N,totalToolsCount:h,onSelect:()=>V(s.id),onToggle:()=>L(s.id)},s.id)})})})]}),t.jsx("div",{className:S("flex-1 flex-col",x?"flex":"hidden md:flex"),children:v?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[t.jsx(Y,{variant:"ghost",size:"sm",onClick:W,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(ee,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx($,{icon:v.icon,name:v.title,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:v.title}),v.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:v.description})]})]})]}),t.jsx("div",{className:"flex-1 overflow-auto p-4",children:P.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):t.jsx("div",{className:"space-y-2",children:P.map(s=>t.jsx(oe,{connectionId:v.id,tool:s,isSelected:Q(v.id,s.name),onToggle:()=>q(v.id,s.name)},s.name))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}function ne(l){return l.stopPropagation()}function re(l){return l.stopPropagation()}var B="Switch",[le]=X(B),[ce,ie]=le(B),F=j.forwardRef((l,o)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:c,required:i,disabled:x,value:b="on",onCheckedChange:g,form:d,...u}=l,[m,p]=j.useState(null),a=z(o,v=>p(v)),f=j.useRef(!1),C=m?d||!!m.closest("form"):!0,[w,E]=Z({prop:r,defaultProp:c??!1,onChange:g,caller:B});return t.jsxs(ce,{scope:e,checked:w,disabled:x,children:[t.jsx(M.button,{type:"button",role:"switch","aria-checked":w,"aria-required":i,"data-state":U(w),"data-disabled":x?"":void 0,disabled:x,value:b,...u,ref:a,onClick:_(l.onClick,v=>{E(P=>!P),C&&(f.current=v.isPropagationStopped(),f.current||v.stopPropagation())})}),C&&t.jsx(D,{control:m,bubbles:!f.current,name:n,value:b,checked:w,required:i,disabled:x,form:d,style:{transform:"translateX(-100%)"}})]})});F.displayName=B;var O="SwitchThumb",A=j.forwardRef((l,o)=>{const{__scopeSwitch:e,...n}=l,r=ie(O,e);return t.jsx(M.span,{"data-state":U(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:o})});A.displayName=O;var ae="SwitchBubbleInput",D=j.forwardRef(({__scopeSwitch:l,control:o,checked:e,bubbles:n=!0,...r},c)=>{const i=j.useRef(null),x=z(i,c),b=G(e),g=J(o);return j.useEffect(()=>{const d=i.current;if(!d)return;const u=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(u,"checked").set;if(b!==e&&p){const a=new Event("click",{bubbles:n});p.call(d,e),d.dispatchEvent(a)}},[b,e,n]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:x,style:{...r.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});D.displayName=ae;function U(l){return l?"checked":"unchecked"}var de=F,ue=A;function ve(l){const o=I.c(9);let e,n;o[0]!==l?({className:e,...n}=l,o[0]=l,o[1]=e,o[2]=n):(e=o[1],n=o[2]);let r;o[3]!==e?(r=S("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),o[3]=e,o[4]=r):r=o[4];let c;o[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(ue,{"data-slot":"switch-thumb",className:S("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),o[5]=c):c=o[5];let i;return o[6]!==n||o[7]!==r?(i=t.jsx(de,{"data-slot":"switch",className:r,...n,children:c}),o[6]=n,o[7]=r,o[8]=i):i=o[8],i}export{ve as S,ge as T};
1
+ import{r as j,c as M,j as t,H as W,B as I,Z as z,z as X,E as Z,aG as _,aH as J}from"./index-BLgTJ8o3.js";import{I as $,u as K}from"./use-connection-CsPrFY0x.js";import{C as H}from"./checkbox-BYeNlYdH.js";import{c as S,B as Y}from"./button-IijH0wdI.js";import{i as ee}from"./ArrowLeft-B6h573ak.js";import{C as te}from"./collection-search-CM9rltH6.js";const se=j.memo(function(o){const e=M.c(21),{connection:n,isSelected:r,hasToolsEnabled:c,activeToolsCount:i,totalToolsCount:x,onSelect:b,onToggle:g}=o,d=r?"bg-accent/50":"hover:bg-muted/50";let u;e[0]!==d?(u=S("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),e[0]=d,e[1]=u):u=e[1];let m;e[2]!==n.icon||e[3]!==n.title?(m=t.jsx($,{icon:n.icon,name:n.title,size:"xs"}),e[2]=n.icon,e[3]=n.title,e[4]=m):m=e[4];let p;e[5]!==n.title?(p=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:n.title})}),e[5]=n.title,e[6]=p):p=e[6];let a;e[7]!==b||e[8]!==m||e[9]!==p?(a=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:b,children:[m,p]}),e[7]=b,e[8]=m,e[9]=p,e[10]=a):a=e[10];let f;e[11]!==i||e[12]!==n.tools||e[13]!==c||e[14]!==g||e[15]!==x?(f=n.tools&&n.tools.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[i,"/",x]}),t.jsx(H,{checked:c,onCheckedChange:g,onClick:ne})]}),e[11]=i,e[12]=n.tools,e[13]=c,e[14]=g,e[15]=x,e[16]=f):f=e[16];let C;return e[17]!==u||e[18]!==a||e[19]!==f?(C=t.jsxs("div",{className:u,children:[a,f]}),e[17]=u,e[18]=a,e[19]=f,e[20]=C):C=e[20],C}),oe=j.memo(function(o){const e=M.c(18),{connectionId:n,tool:r,isSelected:c,onToggle:i}=o,x=`tool-${n}-${r.name}`,b=c?"text-foreground":"text-muted-foreground";let g;e[0]!==b?(g=S("text-sm font-medium",b),e[0]=b,e[1]=g):g=e[1];let d;e[2]!==g||e[3]!==r.name?(d=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:g,children:r.name})}),e[2]=g,e[3]=r.name,e[4]=d):d=e[4];let u;e[5]!==r.description?(u=r.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.description}),e[5]=r.description,e[6]=u):u=e[6];let m;e[7]!==d||e[8]!==u?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,u]}),e[7]=d,e[8]=u,e[9]=m):m=e[9];const p=`tool-${n}-${r.name}`;let a;e[10]!==c||e[11]!==i||e[12]!==p?(a=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(H,{id:p,checked:c,onCheckedChange:i,onClick:re})}),e[10]=c,e[11]=i,e[12]=p,e[13]=a):a=e[13];let f;return e[14]!==x||e[15]!==m||e[16]!==a?(f=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:x,children:[m,a]}),e[14]=x,e[15]=m,e[16]=a,e[17]=f):f=e[17],f});function ge({toolSet:l,onToolSetChange:o}){const[e,n]=j.useState(""),r=j.useDeferredValue(e),[c,i]=j.useState("all"),[x,b]=j.useState(!1),g=j.useRef(new Set(Object.keys(l))),d=K({searchTerm:r.trim()||void 0}),u=g.current,m=[...u.values()].map(s=>d.find(h=>h.id===s)).filter(s=>s!==void 0),p=d.filter(s=>!u.has(s.id)),a=[...m,...p],f=s=>{const h=l[s];return h!==void 0&&h.length>0},C=a.filter(s=>{if(c==="all")return!0;const h=f(s.id);return c==="selected"?h:c==="unselected"?!h:!0}),[w,E]=j.useState(a[0]?.id??null),v=w?a.find(s=>s.id===w)??null:null,P=v?.tools??[],Q=(s,h)=>l[s]?.includes(h)??!1,q=(s,h)=>{const N=l[s]??[],R=N.includes(h),T={...l};if(R){const y=N.filter(k=>k!==h);y.length===0?delete T[s]:T[s]=y}else T[s]=[...N,h];o(T)},L=s=>{const h=a.find(k=>k.id===s);if(!h?.tools)return;const N=l[s]??[],R=h.tools.map(k=>k.name),T=N.length>0&&R.every(k=>N.includes(k)),y={...l};T?delete y[s]:(y[s]=R,E(s)),o(y)},G=s=>{E(s),b(!0)},V=()=>{b(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:S("w-full md:w-80 border-r border-border flex flex-col",x&&"hidden md:flex"),children:[t.jsx(te,{value:e,onChange:n,placeholder:"Search MCP Servers..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>i("all"),className:S("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>i("selected"),className:S("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>i("unselected"),className:S("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:C.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:e?"No connections found":c==="selected"?"No servers selected":c==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:C.map(s=>{const h=s.tools?.length??0,N=l[s.id]?.length??0;return t.jsx(se,{connection:s,isSelected:w===s.id,hasToolsEnabled:f(s.id),activeToolsCount:N,totalToolsCount:h,onSelect:()=>G(s.id),onToggle:()=>L(s.id)},s.id)})})})]}),t.jsx("div",{className:S("flex-1 flex-col",x?"flex":"hidden md:flex"),children:v?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[t.jsx(Y,{variant:"ghost",size:"sm",onClick:V,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(ee,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx($,{icon:v.icon,name:v.title,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:v.title}),v.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:v.description})]})]})]}),t.jsx("div",{className:"flex-1 overflow-auto p-4",children:P.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):t.jsx("div",{className:"space-y-2",children:P.map(s=>t.jsx(oe,{connectionId:v.id,tool:s,isSelected:Q(v.id,s.name),onToggle:()=>q(v.id,s.name)},s.name))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}function ne(l){return l.stopPropagation()}function re(l){return l.stopPropagation()}var B="Switch",[le]=W(B),[ce,ie]=le(B),F=j.forwardRef((l,o)=>{const{__scopeSwitch:e,name:n,checked:r,defaultChecked:c,required:i,disabled:x,value:b="on",onCheckedChange:g,form:d,...u}=l,[m,p]=j.useState(null),a=z(o,v=>p(v)),f=j.useRef(!1),C=m?d||!!m.closest("form"):!0,[w,E]=X({prop:r,defaultProp:c??!1,onChange:g,caller:B});return t.jsxs(ce,{scope:e,checked:w,disabled:x,children:[t.jsx(I.button,{type:"button",role:"switch","aria-checked":w,"aria-required":i,"data-state":U(w),"data-disabled":x?"":void 0,disabled:x,value:b,...u,ref:a,onClick:Z(l.onClick,v=>{E(P=>!P),C&&(f.current=v.isPropagationStopped(),f.current||v.stopPropagation())})}),C&&t.jsx(D,{control:m,bubbles:!f.current,name:n,value:b,checked:w,required:i,disabled:x,form:d,style:{transform:"translateX(-100%)"}})]})});F.displayName=B;var O="SwitchThumb",A=j.forwardRef((l,o)=>{const{__scopeSwitch:e,...n}=l,r=ie(O,e);return t.jsx(I.span,{"data-state":U(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:o})});A.displayName=O;var ae="SwitchBubbleInput",D=j.forwardRef(({__scopeSwitch:l,control:o,checked:e,bubbles:n=!0,...r},c)=>{const i=j.useRef(null),x=z(i,c),b=_(e),g=J(o);return j.useEffect(()=>{const d=i.current;if(!d)return;const u=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(u,"checked").set;if(b!==e&&p){const a=new Event("click",{bubbles:n});p.call(d,e),d.dispatchEvent(a)}},[b,e,n]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...r,tabIndex:-1,ref:x,style:{...r.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});D.displayName=ae;function U(l){return l?"checked":"unchecked"}var de=F,ue=A;function ve(l){const o=M.c(9);let e,n;o[0]!==l?({className:e,...n}=l,o[0]=l,o[1]=e,o[2]=n):(e=o[1],n=o[2]);let r;o[3]!==e?(r=S("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),o[3]=e,o[4]=r):r=o[4];let c;o[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(ue,{"data-slot":"switch-thumb",className:S("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),o[5]=c):c=o[5];let i;return o[6]!==n||o[7]!==r?(i=t.jsx(de,{"data-slot":"switch",className:r,...n,children:c}),o[6]=n,o[7]=r,o[8]=i):i=o[8],i}export{ve as S,ge as T};
@@ -1 +1 @@
1
- import{c as o,j as n}from"./index-BVHhSH8M.js";import{c as l}from"./button-DMnSM5FV.js";function u(s){const e=o.c(8);let r,i;e[0]!==s?({className:r,...i}=s,e[0]=s,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let t;e[3]!==r?(t=l("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-xl border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),e[3]=r,e[4]=t):t=e[4];let a;return e[5]!==i||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...i}),e[5]=i,e[6]=t,e[7]=a):a=e[7],a}export{u as T};
1
+ import{c as o,j as n}from"./index-BLgTJ8o3.js";import{c as l}from"./button-IijH0wdI.js";function u(s){const e=o.c(8);let r,i;e[0]!==s?({className:r,...i}=s,e[0]=s,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let t;e[3]!==r?(t=l("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-xl border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),e[3]=r,e[4]=t):t=e[4];let a;return e[5]!==i||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...i}),e[5]=i,e[6]=t,e[7]=a):a=e[7],a}export{u as T};