@decocms/mesh 2.64.2 → 2.64.4
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.
- package/dist/client/assets/{AlertCircle-CyK0Qw5h.js → AlertCircle-C47UrlAO.js} +1 -1
- package/dist/client/assets/{ArrowUp-BzVEz2lB.js → ArrowUp-NpHWyg3u.js} +1 -1
- package/dist/client/assets/{Calendar-DtGnvM8B.js → Calendar-B649-aT8.js} +1 -1
- package/dist/client/assets/{Check-Dzm8t_lx.js → Check-hF_kXZiK.js} +1 -1
- package/dist/client/assets/{CheckCircle-Dq1sA0pv.js → CheckCircle-BIFyDkzk.js} +1 -1
- package/dist/client/assets/{ChevronDown-Z3Dyyuvx.js → ChevronDown-CwChLZoe.js} +1 -1
- package/dist/client/assets/{ChevronRight-DDdY_PC7.js → ChevronRight-0gQ-Lwyj.js} +1 -1
- package/dist/client/assets/{Code01-BWP8EmsE.js → Code01-DSEEeIpb.js} +1 -1
- package/dist/client/assets/{Copy01-C6IJYSqu.js → Copy01-BY9LQ_eS.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-lop24UEO.js → DotsHorizontal-Bk4oST9u.js} +1 -1
- package/dist/client/assets/{DotsVertical-BpzYqYSl.js → DotsVertical-CcQ5Tk1w.js} +1 -1
- package/dist/client/assets/{Download01-DkL2eEzP.js → Download01-BY55TLNH.js} +1 -1
- package/dist/client/assets/{Edit01-BObRJWWQ.js → Edit01-HUE0OI4J.js} +1 -1
- package/dist/client/assets/{File02-D8LncylE.js → File02-DfFeU8B6.js} +1 -1
- package/dist/client/assets/{File06-Bwnj0Jvb.js → File06-CV2OmgsQ.js} +1 -1
- package/dist/client/assets/{FilterLines-Tzhosng2.js → FilterLines-D6yXcgYG.js} +1 -1
- package/dist/client/assets/{Globe02-DudYvjwY.js → Globe02-DqbzCrT0.js} +1 -1
- package/dist/client/assets/{Grid01-DB4psHwp.js → Grid01-DshI78vi.js} +1 -1
- package/dist/client/assets/{Home02-C9yoONyT.js → Home02-BCiKvL0o.js} +1 -1
- package/dist/client/assets/{Image01-BIunU3ME.js → Image01-BR8oz0fK.js} +1 -1
- package/dist/client/assets/{Inbox01-Dn_ZLwmj.js → Inbox01-DqHW7WgR.js} +1 -1
- package/dist/client/assets/{InfoCircle-p3x1ZyEw.js → InfoCircle-zJUw_W0n.js} +1 -1
- package/dist/client/assets/{Key01-Bycaiiyx.js → Key01-Bzha2Tgh.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DQ9drSdh.js → LinkExternal01-ybeItDxA.js} +1 -1
- package/dist/client/assets/{List-BeVMnZSE.js → List-B7BO0eBJ.js} +1 -1
- package/dist/client/assets/{Loading01-DCWQbhnz.js → Loading01-BpkkTLVp.js} +1 -1
- package/dist/client/assets/{Lock01-Cnn8kQG1.js → Lock01-D4BGdzZt.js} +1 -1
- package/dist/client/assets/{Pin01-WkOPKnTb.js → Pin01-DnWh89mj.js} +1 -1
- package/dist/client/assets/{Play-D6BmScpI.js → Play-COkFzcB7.js} +1 -1
- package/dist/client/assets/{Plus-CG8dB40n.js → Plus-8ovTaJHc.js} +1 -1
- package/dist/client/assets/{SearchMd-BWXZ4bVC.js → SearchMd-SRsVDK9N.js} +1 -1
- package/dist/client/assets/{Share07-DSoplUP9.js → Share07-6unHB4nq.js} +1 -1
- package/dist/client/assets/{Terminal-CdMAejVo.js → Terminal--fMComVX.js} +1 -1
- package/dist/client/assets/{Tool01-BDUyIGto.js → Tool01-BZbzIS2w.js} +1 -1
- package/dist/client/assets/{Trash01-C_hJOK44.js → Trash01-BhWwFORM.js} +1 -1
- package/dist/client/assets/{Upload01-CnMM-V_T.js → Upload01-B2SsaI_Z.js} +1 -1
- package/dist/client/assets/{Users03-DkIVbHWT.js → Users03-8GhqNBdf.js} +1 -1
- package/dist/client/assets/{X-8UbCzOSY.js → X-BNK0mLul.js} +1 -1
- package/dist/client/assets/{XClose-BDdig6o8.js → XClose-CxBh99Dw.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-CC_R-LrZ.js → agent-connections-preview-C9hG7NOc.js} +1 -1
- package/dist/client/assets/{agent-detail-yfEWcbsQ.js → agent-detail-2FW7R_Kw.js} +1 -1
- package/dist/client/assets/{agents-BLmykWZD.js → agents-DLxYaiBc.js} +1 -1
- package/dist/client/assets/{alert-dialog-CHAGlLFb.js → alert-dialog-Cg14vDvh.js} +1 -1
- package/dist/client/assets/{auth-catchall-B-Mu7VlE.js → auth-catchall-oZsZy72p.js} +1 -1
- package/dist/client/assets/{badge-BMiZ-mom.js → badge-tO1xwt4d.js} +1 -1
- package/dist/client/assets/{binder-DC5jbVcK.js → binder-_fA_QfCQ.js} +1 -1
- package/dist/client/assets/{breadcrumb-BjHn0dWR.js → breadcrumb-B1KWdwh9.js} +1 -1
- package/dist/client/assets/{button-nyR0JH2l.js → button-CWzK0IXA.js} +1 -1
- package/dist/client/assets/{card-DVnhjUGd.js → card-uLixd1BQ.js} +1 -1
- package/dist/client/assets/{checkbox-TpL0D3NW.js → checkbox-B81riJiI.js} +1 -1
- package/dist/client/assets/{circle-alert-D0fEJodr.js → circle-alert-CChO7Clp.js} +1 -1
- package/dist/client/assets/{collapsible-DJK4gRv1.js → collapsible-C_w2O0ke.js} +1 -1
- package/dist/client/assets/{collection-detail-GbUt_XKS.js → collection-detail-DWdOXH1z.js} +1 -1
- package/dist/client/assets/{collection-search-DgJbkAZh.js → collection-search-jBfTOehF.js} +1 -1
- package/dist/client/assets/{collection-tab-BTzm3KZ6.js → collection-tab-B_8SPzV6.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Ad_-F1tG.js → collection-table-wrapper-DtjpsgWF.js} +1 -1
- package/dist/client/assets/{collection-tabs-UYd1fkoS.js → collection-tabs-JS9xYoKs.js} +1 -1
- package/dist/client/assets/{connect-BCgu89pq.js → connect-qqRP-4pj.js} +1 -1
- package/dist/client/assets/{connection-card-ByjFlujM.js → connection-card-CYM4Wn_Y.js} +1 -1
- package/dist/client/assets/{connection-detail-CuLe29i_.js → connection-detail-DY6ai_fO.js} +1 -1
- package/dist/client/assets/{connections-BKV3JOBI.js → connections-C29FK0Jd.js} +1 -1
- package/dist/client/assets/constants-Chp3RuVB.js +1 -0
- package/dist/client/assets/constants-DUMQK_Jq.js +1 -0
- package/dist/client/assets/{create-organization-dialog-WB_1M15V.js → create-organization-dialog-CNKyQgDY.js} +1 -1
- package/dist/client/assets/{dialog-DobMZv-a.js → dialog-BiNw4dY-.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BUrC7H_I.js → dropdown-menu-D0wZWcOa.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-yJKJv0tx.js → dynamic-plugin-layout-6AKBQQJO.js} +1 -1
- package/dist/client/assets/{empty-state-C0f9rz3s.js → empty-state-DrSUCtH7.js} +1 -1
- package/dist/client/assets/{empty-state-Z8nGys2S.js → empty-state-yKA0Dnoy.js} +1 -1
- package/dist/client/assets/{env-vars-editor-CGiYkoF6.js → env-vars-editor-BXoRftCH.js} +1 -1
- package/dist/client/assets/{error-boundary-_n4elsYx.js → error-boundary-DMzArMGc.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DS_2GbRy.js → extract-connection-data-Cegvn5cS.js} +1 -1
- package/dist/client/assets/{file-browser-BQ5LNDAg.js → file-browser-CJvaY_Ab.js} +2 -2
- package/dist/client/assets/{form-8XJyhmpO.js → form-3eNCom8C.js} +1 -1
- package/dist/client/assets/{grid-view-D_Aa-emn.js → grid-view-DBknMzh4.js} +1 -1
- package/dist/client/assets/{home-uc024wOV.js → home-D-rgYO4-.js} +1 -1
- package/dist/client/assets/{index-BQzGssjd.js → index-6SKae0YQ.js} +1 -1
- package/dist/client/assets/{index-ZeDSkwHv.js → index-8f9n1Jea.js} +2 -2
- package/dist/client/assets/{index-Dl8GoNj7.js → index-BLFsiDnl.js} +1 -1
- package/dist/client/assets/{index--OStx8iM.js → index-Bgvel9yL.js} +1 -1
- package/dist/client/assets/{index-BAZLm9w0.js → index-DkVMZPZp.js} +2 -2
- package/dist/client/assets/{index-Diri8Ct6.js → index-DyvOt7HW.js} +1 -1
- package/dist/client/assets/{index-LE1qlbhg.js → index-ssfNqXSw.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-yv2IwJ75.js → infiniteQueryObserver-BRy8d1pq.js} +1 -1
- package/dist/client/assets/{input-DHWQboe4.js → input-BKM3goZw.js} +1 -1
- package/dist/client/assets/{layout-DsaX6gcJ.js → layout-B7iU_InR.js} +1 -1
- package/dist/client/assets/{localstorage-keys-Ciabbhpd.js → localstorage-keys-DVhuzRr7.js} +1 -1
- package/dist/client/assets/{login-BoFTpuW0.js → login-BWXaWv5V.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Cik_32Ma.js → mcp-oauth-D7Oz8tNV.js} +1 -1
- package/dist/client/assets/{mcp-server-card-C9lXz3j7.js → mcp-server-card-CfIOHPGJ.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-CKjLUZ8-.js → mcp-server-detail-C78CCQ6k.js} +2 -2
- package/dist/client/assets/{members-B7KaOevg.js → members-duFQ3ptf.js} +1 -1
- package/dist/client/assets/{monaco-editor-CyfxpBLo.js → monaco-editor-DcchC01p.js} +1 -1
- package/dist/client/assets/{monitoring-71UNkDku.js → monitoring-B7FviaI2.js} +1 -1
- package/dist/client/assets/{oauth-callback-B66O8BPw.js → oauth-callback-Cr23Dy5V.js} +1 -1
- package/dist/client/assets/{page-CJ03HOIm.js → page-Ad6Sa48d.js} +1 -1
- package/dist/client/assets/{page-BTGK2JIy.js → page-D37Vnx0X.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-Dn9tQuRR.js → plugin-empty-state-b364WWC7.js} +1 -1
- package/dist/client/assets/{plugin-header-CNqlEglT.js → plugin-header-Cf8zeBUs.js} +1 -1
- package/dist/client/assets/{plugins-Vjr6K9Js.js → plugins-BH2WU-Ku.js} +1 -1
- package/dist/client/assets/{popover-CZsr9YrL.js → popover-C0G-pXcc.js} +1 -1
- package/dist/client/assets/{registry-utils-DGqTJkDv.js → registry-utils-DFPURwxl.js} +1 -1
- package/dist/client/assets/{resizable-kmnSMXLy.js → resizable-DQrwcKJh.js} +1 -1
- package/dist/client/assets/{select-CrjtUXd1.js → select-Df9aMNs1.js} +1 -1
- package/dist/client/assets/{settings-BupAfFFs.js → settings-C0Akd5oR.js} +1 -1
- package/dist/client/assets/shell-layout-pk6n67Pv.js +12 -0
- package/dist/client/assets/{spinner-CQdhmUjg.js → spinner-D8NZVmaU.js} +1 -1
- package/dist/client/assets/{store-invite-C-ESgBdT.js → store-invite-B2dM3aW8.js} +1 -1
- package/dist/client/assets/{switch-DT-s9pj3.js → switch-Cv7KL0jJ.js} +1 -1
- package/dist/client/assets/{table-oiEqEhps.js → table-CWx1lOcJ.js} +1 -1
- package/dist/client/assets/{textarea-wjx2NJJH.js → textarea-BQ5-74yh.js} +1 -1
- package/dist/client/assets/{tools-list-BIhDDkg5.js → tools-list-BIQssT5E.js} +1 -1
- package/dist/client/assets/{typewriter-title-BfWKHlUW.js → typewriter-title-f-tG2rqy.js} +1 -1
- package/dist/client/assets/{use-binding-C5bwm3GP.js → use-binding-CDLcDLTQ.js} +1 -1
- package/dist/client/assets/{use-connection-k5RUrkjP.js → use-connection-BNgYG_2P.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BfrhVnN1.js → use-create-virtual-mcp-DkV_YHpf.js} +1 -1
- package/dist/client/assets/{use-deco-chat-open-BwQGL7z_.js → use-deco-chat-open-LwA291qT.js} +1 -1
- package/dist/client/assets/{use-list-state-CCCWL8bD.js → use-list-state-BfUltaaz.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DeryV1GR.js → use-mcp-prompts-CHXMWYZ1.js} +1 -1
- package/dist/client/assets/{use-members-Brv-Zo51.js → use-members-BfS3S-UM.js} +1 -1
- package/dist/client/assets/{use-mobile-MoR_lOMO.js → use-mobile-BXQipnb5.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DtbIWln6.js → use-organization-settings-DZiQDtex.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DfnzITXx.js → use-virtual-mcp-CEZ5nKxx.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Do9q2S3P.js +1 -0
- package/dist/client/assets/{useMutation-ffySYpQB.js → useMutation-CFQDhqDA.js} +1 -1
- package/dist/client/assets/useQuery-BSKCoFrF.js +1 -0
- package/dist/client/assets/{view-mode-toggle-DsKf8ZTT.js → view-mode-toggle-Cz9APct2.js} +1 -1
- package/dist/client/assets/{workflow-BxPDjOre.js → workflow-CfBvHdI5.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +227 -198
- package/dist/server/migrate.js +210 -181
- package/package.json +1 -1
- package/dist/client/assets/constants-CJQnv32m.js +0 -1
- package/dist/client/assets/constants-DpsR0LZe.js +0 -1
- package/dist/client/assets/shell-layout-Ckg9pQSt.js +0 -12
- package/dist/client/assets/useInfiniteQuery-5yIodymH.js +0 -1
- package/dist/client/assets/useQuery-Da0DsMDg.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bo as Ie,r as u,at as K,bp as F,R as Re,y as Ce,z as $e,x as Me,bq as O}from"./index-BAZLm9w0.js";var Q={exports:{}},h={};var fe;function Ae(){if(fe)return h;fe=1;var t=Symbol.for("react.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),v=Symbol.for("react.server_context"),y=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),$;$=Symbol.for("react.module.reference");function k(n){if(typeof n=="object"&&n!==null){var M=n.$$typeof;switch(M){case t:switch(n=n.type,n){case r:case o:case f:case i:case p:return n;default:switch(n=n&&n.$$typeof,n){case v:case d:case y:case E:case b:case c:return n;default:return M}}case l:return M}}}return h.ContextConsumer=d,h.ContextProvider=c,h.Element=t,h.ForwardRef=y,h.Fragment=r,h.Lazy=E,h.Memo=b,h.Portal=l,h.Profiler=o,h.StrictMode=f,h.Suspense=i,h.SuspenseList=p,h.isAsyncMode=function(){return!1},h.isConcurrentMode=function(){return!1},h.isContextConsumer=function(n){return k(n)===d},h.isContextProvider=function(n){return k(n)===c},h.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===t},h.isForwardRef=function(n){return k(n)===y},h.isFragment=function(n){return k(n)===r},h.isLazy=function(n){return k(n)===E},h.isMemo=function(n){return k(n)===b},h.isPortal=function(n){return k(n)===l},h.isProfiler=function(n){return k(n)===o},h.isStrictMode=function(n){return k(n)===f},h.isSuspense=function(n){return k(n)===i},h.isSuspenseList=function(n){return k(n)===p},h.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===r||n===o||n===f||n===i||n===p||n===x||typeof n=="object"&&n!==null&&(n.$$typeof===E||n.$$typeof===b||n.$$typeof===c||n.$$typeof===d||n.$$typeof===y||n.$$typeof===$||n.getModuleId!==void 0)},h.typeOf=k,h}var me;function Fe(){return me||(me=1,Q.exports=Ae()),Q.exports}var qe=Fe();const lt=Ie(qe);var ve=1,De=.9,Pe=.8,je=.17,Z=.1,ee=.999,Le=.9999,Ke=.99,Ve=/[\\\/_+.#"@\[\(\{&]/,ze=/[\\\/_+.#"@\[\(\{&]/g,Oe=/[\s-]/,be=/[\s-]/g;function re(t,l,r,f,o,c,d){if(c===l.length)return o===t.length?ve:Ke;var v=`${o},${c}`;if(d[v]!==void 0)return d[v];for(var y=f.charAt(c),i=r.indexOf(y,o),p=0,b,E,x,$;i>=0;)b=re(t,l,r,f,i+1,c+1,d),b>p&&(i===o?b*=ve:Ve.test(t.charAt(i-1))?(b*=Pe,x=t.slice(o,i-1).match(ze),x&&o>0&&(b*=Math.pow(ee,x.length))):Oe.test(t.charAt(i-1))?(b*=De,$=t.slice(o,i-1).match(be),$&&o>0&&(b*=Math.pow(ee,$.length))):(b*=je,o>0&&(b*=Math.pow(ee,i-o))),t.charAt(i)!==l.charAt(c)&&(b*=Le)),(b<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(E=re(t,l,r,f,i+1,c+2,d),E*Z>b&&(b=E*Z)),b>p&&(p=b),i=r.indexOf(y,i+1);return d[v]=p,p}function pe(t){return t.toLowerCase().replace(be," ")}function Be(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,re(t,l,pe(t),pe(l),0,0,{})}var z='[cmdk-group=""]',te='[cmdk-group-items=""]',_e='[cmdk-group-heading=""]',ge='[cmdk-item=""]',he=`${ge}:not([aria-disabled="true"])`,ne="cmdk-item-select",j="data-value",Te=(t,l,r)=>Be(t,l,r),ye=u.createContext(void 0),B=()=>u.useContext(ye),Se=u.createContext(void 0),le=()=>u.useContext(Se),we=u.createContext(void 0),Ee=u.forwardRef((t,l)=>{let r=L(()=>{var e,s;return{search:"",value:(s=(e=t.value)!=null?e:t.defaultValue)!=null?s:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=L(()=>new Set),o=L(()=>new Map),c=L(()=>new Map),d=L(()=>new Set),v=xe(t),{label:y,children:i,value:p,onValueChange:b,filter:E,shouldFilter:x,loop:$,disablePointerSelection:k=!1,vimBindings:n=!0,...M}=t,U=K(),ue=K(),H=K(),q=u.useRef(null),w=et();D(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,R.emit()}},[p]),D(()=>{w(6,ae)},[]);let R=u.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,s,m)=>{var a,g,S,C;if(!Object.is(r.current[e],s)){if(r.current[e]=s,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let I=document.getElementById(H);I?I.focus():(a=document.getElementById(U))==null||a.focus()}if(w(7,()=>{var I;r.current.selectedItemId=(I=P())==null?void 0:I.id,R.emit()}),m||w(5,ae),((g=v.current)==null?void 0:g.value)!==void 0){let I=s??"";(C=(S=v.current).onValueChange)==null||C.call(S,I);return}}R.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=u.useMemo(()=>({value:(e,s,m)=>{var a;s!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:s,keywords:m}),r.current.filtered.items.set(e,oe(s,m)),w(2,()=>{W(),R.emit()}))},item:(e,s)=>(f.current.add(e),s&&(o.current.has(s)?o.current.get(s).add(e):o.current.set(s,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),R.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let m=P();w(4,()=>{J(),m?.getAttribute("id")===e&&G(),R.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{c.current.delete(e),o.current.delete(e)}),filter:()=>v.current.shouldFilter,label:y||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:H,labelId:ue,listInnerRef:q}),[]);function oe(e,s){var m,a;let g=(a=(m=v.current)==null?void 0:m.filter)!=null?a:Te;return e?g(e,r.current.search,s):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,s=[];r.current.filtered.groups.forEach(a=>{let g=o.current.get(a),S=0;g.forEach(C=>{let I=e.get(C);S=Math.max(I,S)}),s.push([a,S])});let m=q.current;V().sort((a,g)=>{var S,C;let I=a.getAttribute("id"),_=g.getAttribute("id");return((S=e.get(_))!=null?S:0)-((C=e.get(I))!=null?C:0)}).forEach(a=>{let g=a.closest(te);g?g.appendChild(a.parentElement===g?a:a.closest(`${te} > *`)):m.appendChild(a.parentElement===m?a:a.closest(`${te} > *`))}),s.sort((a,g)=>g[1]-a[1]).forEach(a=>{var g;let S=(g=q.current)==null?void 0:g.querySelector(`${z}[${j}="${encodeURIComponent(a[0])}"]`);S?.parentElement.appendChild(S)})}function G(){let e=V().find(m=>m.getAttribute("aria-disabled")!=="true"),s=e?.getAttribute(j);R.setState("value",s||void 0)}function J(){var e,s,m,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let g=0;for(let S of f.current){let C=(s=(e=c.current.get(S))==null?void 0:e.value)!=null?s:"",I=(a=(m=c.current.get(S))==null?void 0:m.keywords)!=null?a:[],_=oe(C,I);r.current.filtered.items.set(S,_),_>0&&g++}for(let[S,C]of o.current)for(let I of C)if(r.current.filtered.items.get(I)>0){r.current.filtered.groups.add(S);break}r.current.filtered.count=g}function ae(){var e,s,m;let a=P();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((m=(s=a.closest(z))==null?void 0:s.querySelector(_e))==null||m.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function P(){var e;return(e=q.current)==null?void 0:e.querySelector(`${ge}[aria-selected="true"]`)}function V(){var e;return Array.from(((e=q.current)==null?void 0:e.querySelectorAll(he))||[])}function X(e){let s=V()[e];s&&R.setState("value",s.getAttribute(j))}function Y(e){var s;let m=P(),a=V(),g=a.findIndex(C=>C===m),S=a[g+e];(s=v.current)!=null&&s.loop&&(S=g+e<0?a[a.length-1]:g+e===a.length?a[0]:a[g+e]),S&&R.setState("value",S.getAttribute(j))}function ie(e){let s=P(),m=s?.closest(z),a;for(;m&&!a;)m=e>0?Qe(m,z):Ze(m,z),a=m?.querySelector(he);a?R.setState("value",a.getAttribute(j)):Y(e)}let ce=()=>X(V().length-1),se=e=>{e.preventDefault(),e.metaKey?ce():e.altKey?ie(1):Y(1)},de=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ie(-1):Y(-1)};return u.createElement(F.div,{ref:l,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:e=>{var s;(s=M.onKeyDown)==null||s.call(M,e);let m=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||m))switch(e.key){case"n":case"j":{n&&e.ctrlKey&&se(e);break}case"ArrowDown":{se(e);break}case"p":case"k":{n&&e.ctrlKey&&de(e);break}case"ArrowUp":{de(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ce();break}case"Enter":{e.preventDefault();let a=P();if(a){let g=new Event(ne);a.dispatchEvent(g)}}}}},u.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:rt},y),T(t,e=>u.createElement(Se.Provider,{value:R},u.createElement(ye.Provider,{value:N},e))))}),Ue=u.forwardRef((t,l)=>{var r,f;let o=K(),c=u.useRef(null),d=u.useContext(we),v=B(),y=xe(t),i=(f=(r=y.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;D(()=>{if(!i)return v.item(o,d?.id)},[i]);let p=ke(o,c,[t.value,t.children,c],t.keywords),b=le(),E=A(w=>w.value&&w.value===p.current),x=A(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(o)>0:!0);u.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(ne,$),()=>w.removeEventListener(ne,$)},[x,t.onSelect,t.disabled]);function $(){var w,R;k(),(R=(w=y.current).onSelect)==null||R.call(w,p.current)}function k(){b.setState("value",p.current,!0)}if(!x)return null;let{disabled:n,value:M,onSelect:U,forceMount:ue,keywords:H,...q}=t;return u.createElement(F.div,{ref:O(c,l),...q,id:o,"cmdk-item":"",role:"option","aria-disabled":!!n,"aria-selected":!!E,"data-disabled":!!n,"data-selected":!!E,onPointerMove:n||v.getDisablePointerSelection()?void 0:k,onClick:n?void 0:$},t.children)}),He=u.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:o,...c}=t,d=K(),v=u.useRef(null),y=u.useRef(null),i=K(),p=B(),b=A(x=>o||p.filter()===!1?!0:x.search?x.filtered.groups.has(d):!0);D(()=>p.group(d),[]),ke(d,v,[t.value,t.heading,y]);let E=u.useMemo(()=>({id:d,forceMount:o}),[o]);return u.createElement(F.div,{ref:O(v,l),...c,"cmdk-group":"",role:"presentation",hidden:b?void 0:!0},r&&u.createElement("div",{ref:y,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),T(t,x=>u.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},u.createElement(we.Provider,{value:E},x))))}),Ne=u.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,o=u.useRef(null),c=A(d=>!d.search);return!r&&!c?null:u.createElement(F.div,{ref:O(o,l),...f,"cmdk-separator":"",role:"separator"})}),We=u.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,o=t.value!=null,c=le(),d=A(i=>i.search),v=A(i=>i.selectedItemId),y=B();return u.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),u.createElement(F.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":y.listId,"aria-labelledby":y.labelId,"aria-activedescendant":v,id:y.inputId,type:"text",value:o?t.value:d,onChange:i=>{o||c.setState("search",i.target.value),r?.(i.target.value)}})}),Ge=u.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...o}=t,c=u.useRef(null),d=u.useRef(null),v=A(i=>i.selectedItemId),y=B();return u.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,b,E=new ResizeObserver(()=>{b=requestAnimationFrame(()=>{let x=i.offsetHeight;p.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return E.observe(i),()=>{cancelAnimationFrame(b),E.unobserve(i)}}},[]),u.createElement(F.div,{ref:O(c,l),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:y.listId},T(t,i=>u.createElement("div",{ref:O(d,y.listInnerRef),"cmdk-list-sizer":""},i)))}),Je=u.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:o,contentClassName:c,container:d,...v}=t;return u.createElement(Re,{open:r,onOpenChange:f},u.createElement(Ce,{container:d},u.createElement($e,{"cmdk-overlay":"",className:o}),u.createElement(Me,{"aria-label":t.label,"cmdk-dialog":"",className:c},u.createElement(Ee,{ref:l,...v}))))}),Xe=u.forwardRef((t,l)=>A(r=>r.filtered.count===0)?u.createElement(F.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ye=u.forwardRef((t,l)=>{let{progress:r,children:f,label:o="Loading...",...c}=t;return u.createElement(F.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},T(t,d=>u.createElement("div",{"aria-hidden":!0},d)))}),ut=Object.assign(Ee,{List:Ge,Item:Ue,Input:We,Group:He,Separator:Ne,Dialog:Je,Empty:Xe,Loading:Ye});function Qe(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ze(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function xe(t){let l=u.useRef(t);return D(()=>{l.current=t}),l}var D=typeof window>"u"?u.useEffect:u.useLayoutEffect;function L(t){let l=u.useRef();return l.current===void 0&&(l.current=t()),l}function A(t){let l=le(),r=()=>t(l.snapshot());return u.useSyncExternalStore(l.subscribe,r,r)}function ke(t,l,r,f=[]){let o=u.useRef(),c=B();return D(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():o.current}})(),y=f.map(i=>i.trim());c.value(t,v,y),(d=l.current)==null||d.setAttribute(j,v),o.current=v}),o}var et=()=>{let[t,l]=u.useState(),r=L(()=>new Map);return D(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,o)=>{r.current.set(f,o),l({})}};function tt(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function T({asChild:t,children:l},r){return t&&u.isValidElement(l)?u.cloneElement(tt(l),{ref:l.ref},r(l.props.children)):r(l)}var rt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{lt as R,ut as _,qe as r};
|
|
1
|
+
import{bo as Ie,r as u,at as K,bp as F,R as Re,y as Ce,z as $e,x as Me,bq as O}from"./index-DkVMZPZp.js";var Q={exports:{}},h={};var fe;function Ae(){if(fe)return h;fe=1;var t=Symbol.for("react.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),v=Symbol.for("react.server_context"),y=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),$;$=Symbol.for("react.module.reference");function k(n){if(typeof n=="object"&&n!==null){var M=n.$$typeof;switch(M){case t:switch(n=n.type,n){case r:case o:case f:case i:case p:return n;default:switch(n=n&&n.$$typeof,n){case v:case d:case y:case E:case b:case c:return n;default:return M}}case l:return M}}}return h.ContextConsumer=d,h.ContextProvider=c,h.Element=t,h.ForwardRef=y,h.Fragment=r,h.Lazy=E,h.Memo=b,h.Portal=l,h.Profiler=o,h.StrictMode=f,h.Suspense=i,h.SuspenseList=p,h.isAsyncMode=function(){return!1},h.isConcurrentMode=function(){return!1},h.isContextConsumer=function(n){return k(n)===d},h.isContextProvider=function(n){return k(n)===c},h.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===t},h.isForwardRef=function(n){return k(n)===y},h.isFragment=function(n){return k(n)===r},h.isLazy=function(n){return k(n)===E},h.isMemo=function(n){return k(n)===b},h.isPortal=function(n){return k(n)===l},h.isProfiler=function(n){return k(n)===o},h.isStrictMode=function(n){return k(n)===f},h.isSuspense=function(n){return k(n)===i},h.isSuspenseList=function(n){return k(n)===p},h.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===r||n===o||n===f||n===i||n===p||n===x||typeof n=="object"&&n!==null&&(n.$$typeof===E||n.$$typeof===b||n.$$typeof===c||n.$$typeof===d||n.$$typeof===y||n.$$typeof===$||n.getModuleId!==void 0)},h.typeOf=k,h}var me;function Fe(){return me||(me=1,Q.exports=Ae()),Q.exports}var qe=Fe();const lt=Ie(qe);var ve=1,De=.9,Pe=.8,je=.17,Z=.1,ee=.999,Le=.9999,Ke=.99,Ve=/[\\\/_+.#"@\[\(\{&]/,ze=/[\\\/_+.#"@\[\(\{&]/g,Oe=/[\s-]/,be=/[\s-]/g;function re(t,l,r,f,o,c,d){if(c===l.length)return o===t.length?ve:Ke;var v=`${o},${c}`;if(d[v]!==void 0)return d[v];for(var y=f.charAt(c),i=r.indexOf(y,o),p=0,b,E,x,$;i>=0;)b=re(t,l,r,f,i+1,c+1,d),b>p&&(i===o?b*=ve:Ve.test(t.charAt(i-1))?(b*=Pe,x=t.slice(o,i-1).match(ze),x&&o>0&&(b*=Math.pow(ee,x.length))):Oe.test(t.charAt(i-1))?(b*=De,$=t.slice(o,i-1).match(be),$&&o>0&&(b*=Math.pow(ee,$.length))):(b*=je,o>0&&(b*=Math.pow(ee,i-o))),t.charAt(i)!==l.charAt(c)&&(b*=Le)),(b<Z&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(E=re(t,l,r,f,i+1,c+2,d),E*Z>b&&(b=E*Z)),b>p&&(p=b),i=r.indexOf(y,i+1);return d[v]=p,p}function pe(t){return t.toLowerCase().replace(be," ")}function Be(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,re(t,l,pe(t),pe(l),0,0,{})}var z='[cmdk-group=""]',te='[cmdk-group-items=""]',_e='[cmdk-group-heading=""]',ge='[cmdk-item=""]',he=`${ge}:not([aria-disabled="true"])`,ne="cmdk-item-select",j="data-value",Te=(t,l,r)=>Be(t,l,r),ye=u.createContext(void 0),B=()=>u.useContext(ye),Se=u.createContext(void 0),le=()=>u.useContext(Se),we=u.createContext(void 0),Ee=u.forwardRef((t,l)=>{let r=L(()=>{var e,s;return{search:"",value:(s=(e=t.value)!=null?e:t.defaultValue)!=null?s:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=L(()=>new Set),o=L(()=>new Map),c=L(()=>new Map),d=L(()=>new Set),v=xe(t),{label:y,children:i,value:p,onValueChange:b,filter:E,shouldFilter:x,loop:$,disablePointerSelection:k=!1,vimBindings:n=!0,...M}=t,U=K(),ue=K(),H=K(),q=u.useRef(null),w=et();D(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,R.emit()}},[p]),D(()=>{w(6,ae)},[]);let R=u.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,s,m)=>{var a,g,S,C;if(!Object.is(r.current[e],s)){if(r.current[e]=s,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let I=document.getElementById(H);I?I.focus():(a=document.getElementById(U))==null||a.focus()}if(w(7,()=>{var I;r.current.selectedItemId=(I=P())==null?void 0:I.id,R.emit()}),m||w(5,ae),((g=v.current)==null?void 0:g.value)!==void 0){let I=s??"";(C=(S=v.current).onValueChange)==null||C.call(S,I);return}}R.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=u.useMemo(()=>({value:(e,s,m)=>{var a;s!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:s,keywords:m}),r.current.filtered.items.set(e,oe(s,m)),w(2,()=>{W(),R.emit()}))},item:(e,s)=>(f.current.add(e),s&&(o.current.has(s)?o.current.get(s).add(e):o.current.set(s,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),R.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let m=P();w(4,()=>{J(),m?.getAttribute("id")===e&&G(),R.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{c.current.delete(e),o.current.delete(e)}),filter:()=>v.current.shouldFilter,label:y||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:U,inputId:H,labelId:ue,listInnerRef:q}),[]);function oe(e,s){var m,a;let g=(a=(m=v.current)==null?void 0:m.filter)!=null?a:Te;return e?g(e,r.current.search,s):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,s=[];r.current.filtered.groups.forEach(a=>{let g=o.current.get(a),S=0;g.forEach(C=>{let I=e.get(C);S=Math.max(I,S)}),s.push([a,S])});let m=q.current;V().sort((a,g)=>{var S,C;let I=a.getAttribute("id"),_=g.getAttribute("id");return((S=e.get(_))!=null?S:0)-((C=e.get(I))!=null?C:0)}).forEach(a=>{let g=a.closest(te);g?g.appendChild(a.parentElement===g?a:a.closest(`${te} > *`)):m.appendChild(a.parentElement===m?a:a.closest(`${te} > *`))}),s.sort((a,g)=>g[1]-a[1]).forEach(a=>{var g;let S=(g=q.current)==null?void 0:g.querySelector(`${z}[${j}="${encodeURIComponent(a[0])}"]`);S?.parentElement.appendChild(S)})}function G(){let e=V().find(m=>m.getAttribute("aria-disabled")!=="true"),s=e?.getAttribute(j);R.setState("value",s||void 0)}function J(){var e,s,m,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let g=0;for(let S of f.current){let C=(s=(e=c.current.get(S))==null?void 0:e.value)!=null?s:"",I=(a=(m=c.current.get(S))==null?void 0:m.keywords)!=null?a:[],_=oe(C,I);r.current.filtered.items.set(S,_),_>0&&g++}for(let[S,C]of o.current)for(let I of C)if(r.current.filtered.items.get(I)>0){r.current.filtered.groups.add(S);break}r.current.filtered.count=g}function ae(){var e,s,m;let a=P();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((m=(s=a.closest(z))==null?void 0:s.querySelector(_e))==null||m.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function P(){var e;return(e=q.current)==null?void 0:e.querySelector(`${ge}[aria-selected="true"]`)}function V(){var e;return Array.from(((e=q.current)==null?void 0:e.querySelectorAll(he))||[])}function X(e){let s=V()[e];s&&R.setState("value",s.getAttribute(j))}function Y(e){var s;let m=P(),a=V(),g=a.findIndex(C=>C===m),S=a[g+e];(s=v.current)!=null&&s.loop&&(S=g+e<0?a[a.length-1]:g+e===a.length?a[0]:a[g+e]),S&&R.setState("value",S.getAttribute(j))}function ie(e){let s=P(),m=s?.closest(z),a;for(;m&&!a;)m=e>0?Qe(m,z):Ze(m,z),a=m?.querySelector(he);a?R.setState("value",a.getAttribute(j)):Y(e)}let ce=()=>X(V().length-1),se=e=>{e.preventDefault(),e.metaKey?ce():e.altKey?ie(1):Y(1)},de=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ie(-1):Y(-1)};return u.createElement(F.div,{ref:l,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:e=>{var s;(s=M.onKeyDown)==null||s.call(M,e);let m=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||m))switch(e.key){case"n":case"j":{n&&e.ctrlKey&&se(e);break}case"ArrowDown":{se(e);break}case"p":case"k":{n&&e.ctrlKey&&de(e);break}case"ArrowUp":{de(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ce();break}case"Enter":{e.preventDefault();let a=P();if(a){let g=new Event(ne);a.dispatchEvent(g)}}}}},u.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:rt},y),T(t,e=>u.createElement(Se.Provider,{value:R},u.createElement(ye.Provider,{value:N},e))))}),Ue=u.forwardRef((t,l)=>{var r,f;let o=K(),c=u.useRef(null),d=u.useContext(we),v=B(),y=xe(t),i=(f=(r=y.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;D(()=>{if(!i)return v.item(o,d?.id)},[i]);let p=ke(o,c,[t.value,t.children,c],t.keywords),b=le(),E=A(w=>w.value&&w.value===p.current),x=A(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(o)>0:!0);u.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(ne,$),()=>w.removeEventListener(ne,$)},[x,t.onSelect,t.disabled]);function $(){var w,R;k(),(R=(w=y.current).onSelect)==null||R.call(w,p.current)}function k(){b.setState("value",p.current,!0)}if(!x)return null;let{disabled:n,value:M,onSelect:U,forceMount:ue,keywords:H,...q}=t;return u.createElement(F.div,{ref:O(c,l),...q,id:o,"cmdk-item":"",role:"option","aria-disabled":!!n,"aria-selected":!!E,"data-disabled":!!n,"data-selected":!!E,onPointerMove:n||v.getDisablePointerSelection()?void 0:k,onClick:n?void 0:$},t.children)}),He=u.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:o,...c}=t,d=K(),v=u.useRef(null),y=u.useRef(null),i=K(),p=B(),b=A(x=>o||p.filter()===!1?!0:x.search?x.filtered.groups.has(d):!0);D(()=>p.group(d),[]),ke(d,v,[t.value,t.heading,y]);let E=u.useMemo(()=>({id:d,forceMount:o}),[o]);return u.createElement(F.div,{ref:O(v,l),...c,"cmdk-group":"",role:"presentation",hidden:b?void 0:!0},r&&u.createElement("div",{ref:y,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),T(t,x=>u.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},u.createElement(we.Provider,{value:E},x))))}),Ne=u.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,o=u.useRef(null),c=A(d=>!d.search);return!r&&!c?null:u.createElement(F.div,{ref:O(o,l),...f,"cmdk-separator":"",role:"separator"})}),We=u.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,o=t.value!=null,c=le(),d=A(i=>i.search),v=A(i=>i.selectedItemId),y=B();return u.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),u.createElement(F.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":y.listId,"aria-labelledby":y.labelId,"aria-activedescendant":v,id:y.inputId,type:"text",value:o?t.value:d,onChange:i=>{o||c.setState("search",i.target.value),r?.(i.target.value)}})}),Ge=u.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...o}=t,c=u.useRef(null),d=u.useRef(null),v=A(i=>i.selectedItemId),y=B();return u.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,b,E=new ResizeObserver(()=>{b=requestAnimationFrame(()=>{let x=i.offsetHeight;p.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return E.observe(i),()=>{cancelAnimationFrame(b),E.unobserve(i)}}},[]),u.createElement(F.div,{ref:O(c,l),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:y.listId},T(t,i=>u.createElement("div",{ref:O(d,y.listInnerRef),"cmdk-list-sizer":""},i)))}),Je=u.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:o,contentClassName:c,container:d,...v}=t;return u.createElement(Re,{open:r,onOpenChange:f},u.createElement(Ce,{container:d},u.createElement($e,{"cmdk-overlay":"",className:o}),u.createElement(Me,{"aria-label":t.label,"cmdk-dialog":"",className:c},u.createElement(Ee,{ref:l,...v}))))}),Xe=u.forwardRef((t,l)=>A(r=>r.filtered.count===0)?u.createElement(F.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),Ye=u.forwardRef((t,l)=>{let{progress:r,children:f,label:o="Loading...",...c}=t;return u.createElement(F.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},T(t,d=>u.createElement("div",{"aria-hidden":!0},d)))}),ut=Object.assign(Ee,{List:Ge,Item:Ue,Input:We,Group:He,Separator:Ne,Dialog:Je,Empty:Xe,Loading:Ye});function Qe(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ze(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function xe(t){let l=u.useRef(t);return D(()=>{l.current=t}),l}var D=typeof window>"u"?u.useEffect:u.useLayoutEffect;function L(t){let l=u.useRef();return l.current===void 0&&(l.current=t()),l}function A(t){let l=le(),r=()=>t(l.snapshot());return u.useSyncExternalStore(l.subscribe,r,r)}function ke(t,l,r,f=[]){let o=u.useRef(),c=B();return D(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():o.current}})(),y=f.map(i=>i.trim());c.value(t,v,y),(d=l.current)==null||d.setAttribute(j,v),o.current=v}),o}var et=()=>{let[t,l]=u.useState(),r=L(()=>new Map);return D(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,o)=>{r.current.set(f,o),l({})}};function tt(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function T({asChild:t,children:l},r){return t&&u.isValidElement(l)?u.cloneElement(tt(l),{ref:l.ref},r(l.props.children)):r(l)}var rt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{lt as R,ut as _,qe as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,r as u,j as o}from"./index-
|
|
1
|
+
import{c as a,r as u,j as o}from"./index-DkVMZPZp.js";import{c as f}from"./button-CWzK0IXA.js";function x(n,e){const s=u.Children.toArray(n);for(const l of s)if(u.isValidElement(l)&&l.type===e)return l;return null}function b(n){const e=a.c(5),{children:s,className:l}=n;let t;e[0]!==l?(t=f("flex flex-col h-full bg-background overflow-hidden",l),e[0]=l,e[1]=t):t=e[1];let r;return e[2]!==s||e[3]!==t?(r=o.jsx("div",{className:t,children:s}),e[2]=s,e[3]=t,e[4]=r):r=e[4],r}function j(n){const e=a.c(12),{children:s,className:l}=n;let t;e[0]!==s?(t=x(s,g),e[0]=s,e[1]=t):t=e[1];const r=t;let d;e[2]!==s?(d=x(s,p),e[2]=s,e[3]=d):d=e[3];const h=d;let i;e[4]!==l?(i=f("shrink-0 w-full border-b border-border h-12 overflow-x-auto",l),e[4]=l,e[5]=i):i=e[5];let c;e[6]!==r||e[7]!==h?(c=o.jsxs("div",{className:"flex items-center justify-between gap-3 h-12 px-4 min-w-max",children:[r,h]}),e[6]=r,e[7]=h,e[8]=c):c=e[8];let m;return e[9]!==i||e[10]!==c?(m=o.jsx("div",{className:i,children:c}),e[9]=i,e[10]=c,e[11]=m):m=e[11],m}function g(n){const e=a.c(5),{children:s,className:l}=n;let t;e[0]!==l?(t=f("flex items-center gap-2 flex-shrink-0 overflow-hidden",l),e[0]=l,e[1]=t):t=e[1];let r;return e[2]!==s||e[3]!==t?(r=o.jsx("div",{className:t,children:s}),e[2]=s,e[3]=t,e[4]=r):r=e[4],r}function p(n){const e=a.c(5),{children:s,className:l}=n;let t;e[0]!==l?(t=f("flex items-center gap-2 flex-shrink-0 overflow-hidden border-l border-border pl-3",l),e[0]=l,e[1]=t):t=e[1];let r;return e[2]!==s||e[3]!==t?(r=o.jsx("div",{className:t,children:s}),e[2]=s,e[3]=t,e[4]=r):r=e[4],r}function v(n){const e=a.c(5),{children:s,className:l}=n;let t;e[0]!==l?(t=f("flex-1 overflow-auto",l),e[0]=l,e[1]=t):t=e[1];let r;return e[2]!==s||e[3]!==t?(r=o.jsx("div",{className:t,children:s}),e[2]=s,e[3]=t,e[4]=r):r=e[4],r}const P=Object.assign(b,{Header:Object.assign(j,{Left:g,Right:p}),Content:v});export{P};
|
package/dist/client/assets/{infiniteQueryObserver-yv2IwJ75.js → infiniteQueryObserver-BRy8d1pq.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a4 as d,a5 as f,a6 as v,a7 as b}from"./index-
|
|
1
|
+
import{a4 as d,a5 as f,a6 as v,a7 as b}from"./index-DkVMZPZp.js";var N=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:f()})}getOptimisticResult(e){return e.behavior=f(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:P,isError:c,isRefetchError:g}=i,r=s.fetchMeta?.fetchMore?.direction,h=c&&r==="forward",o=a&&r==="forward",n=c&&r==="backward",u=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:b(t,s.data),hasPreviousPage:v(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:u,isRefetchError:g&&!h&&!n,isRefetching:P&&!o&&!u}}};export{N as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,j as a}from"./index-
|
|
1
|
+
import{c as s,j as a}from"./index-DkVMZPZp.js";import{c as d}from"./button-CWzK0IXA.js";function p(l){const e=s.c(10);let i,r,t;e[0]!==l?({className:i,type:t,...r}=l,e[0]=l,e[1]=i,e[2]=r,e[3]=t):(i=e[1],r=e[2],t=e[3]);let n;e[4]!==i?(n=d("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-10 w-full min-w-0 rounded-lg border bg-transparent px-3 py-1 text-base transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] bg-background","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==n||e[8]!==t?(o=a.jsx("input",{type:t,"data-slot":"input",className:n,...r}),e[6]=r,e[7]=n,e[8]=t,e[9]=o):o=e[9],o}export{p as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as x,c as b,$ as j,j as n}from"./index-
|
|
1
|
+
import{r as x,c as b,$ as j,j as n}from"./index-DkVMZPZp.js";import{P as f}from"./index-ssfNqXSw.js";const h=x.createContext(null);function g(u){const e=b.c(3),{children:l}=u,t=x.useContext(h);if(!t?.tabsEl)return null;let s;return e[0]!==l||e[1]!==t.tabsEl?(s=j.createPortal(l,t.tabsEl),e[0]=l,e[1]=t.tabsEl,e[2]=s):s=e[2],s}function v(u){const e=b.c(3),{children:l}=u,t=x.useContext(h);if(!t?.actionsEl)return null;let s;return e[0]!==l||e[1]!==t.actionsEl?(s=j.createPortal(l,t.actionsEl),e[0]=l,e[1]=t.actionsEl,e[2]=s):s=e[2],s}function P(u){const e=b.c(16),{children:l,breadcrumb:t}=u,[s,p]=x.useState(null),[d,w]=x.useState(null);let c;e[0]!==d||e[1]!==s?(c={tabsEl:s,actionsEl:d},e[0]=d,e[1]=s,e[2]=c):c=e[2];let r;e[3]!==t?(r=n.jsx(f.Header.Left,{children:t}),e[3]=t,e[4]=r):r=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs(f.Header.Right,{children:[n.jsx("div",{ref:p,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),n.jsx("div",{ref:w,className:"flex items-center gap-2 shrink-0"})]}),e[5]=m):m=e[5];let a;e[6]!==r?(a=n.jsxs(f.Header,{children:[r,m]}),e[6]=r,e[7]=a):a=e[7];let o;e[8]!==l?(o=n.jsx(f.Content,{children:l}),e[8]=l,e[9]=o):o=e[9];let i;e[10]!==a||e[11]!==o?(i=n.jsxs(f,{children:[a,o]}),e[10]=a,e[11]=o,e[12]=i):i=e[12];let E;return e[13]!==c||e[14]!==i?(E=n.jsx(h,{value:c,children:i}),e[13]=c,e[14]=i,e[15]=E):E=e[15],E}export{v as V,P as a,g as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as O,F as I}from"./index-
|
|
1
|
+
import{c as O,F as I}from"./index-DkVMZPZp.js";import{u as M}from"./useQuery-BSKCoFrF.js";import{u as x}from"./useMutation-CFQDhqDA.js";function L(t){try{return JSON.parse(t)}catch{return}}function y(t,s){const e=localStorage.getItem(t),o=e?L(e):void 0,n=typeof s=="function"?s(o):o??s;if(o===void 0||n!==o)try{const a=JSON.stringify(n);localStorage.setItem(t,a)}catch{}return n}function F(t,s){const e=O.c(25),o=I();let n;e[0]!==t?(n=["localStorage",t],e[0]=t,e[1]=n):n=e[1];const a=n;let r,i;e[2]!==s||e[3]!==t?(r=()=>y(t,s),i=()=>y(t,s),e[2]=s,e[3]=t,e[4]=r,e[5]=i):(r=e[4],i=e[5]);let m;e[6]!==a||e[7]!==r||e[8]!==i?(m={queryKey:a,queryFn:r,initialData:i,staleTime:1/0,gcTime:1/0},e[6]=a,e[7]=r,e[8]=i,e[9]=m):m=e[9];const{data:v}=M(m);let l;e[10]!==t?(l=async c=>{const $=JSON.stringify(c);return localStorage.setItem(t,$),c},e[10]=t,e[11]=l):l=e[11];let h;e[12]!==o||e[13]!==a?(h=c=>{o.setQueryData(a,c)},e[12]=o,e[13]=a,e[14]=h):h=e[14];let u;e[15]!==l||e[16]!==h?(u={mutationFn:l,onSuccess:h},e[15]=l,e[16]=h,e[17]=u):u=e[17];const g=x(u);let d;e[18]!==g||e[19]!==o||e[20]!==a?(d=c=>{const $=o.getQueryData(a),C=typeof c=="function"?c($):c;g.mutate(C)},e[18]=g,e[19]=o,e[20]=a,e[21]=d):d=e[21];const S=d,p=v;let f;return e[22]!==S||e[23]!==p?(f=[p,S],e[22]=S,e[23]=p,e[24]=f):f=e[24],f}const A={assistantChatThreads:t=>`mesh:assistant-chat:threads:${t}`,messages:(t,s)=>`mesh:messages:${t}:${s}`,decoChatOpen:()=>"mesh:decochat:open",chatSelectedModel:t=>`mesh:chat:selectedModel:${t}`,chatSelectedMode:t=>`mesh:chat:selectedMode:${t}`,assistantChatActiveThread:t=>`mesh:assistant-chat:active-thread:${t}`,decoChatPanelWidth:()=>"mesh:decochat:panel-width",sidebarOpen:()=>"mesh:sidebar-open",selectedRegistry:t=>`mesh:store:selected-registry:${t}`,orgHomeQuickstart:t=>`mesh:org-home:quickstart:${t}`,storeShowStdio:()=>"mesh:store:show-stdio",developerMode:()=>"mesh:user:developer-mode",pluginConnection:(t,s)=>`mesh:plugin:connection:${t}:${s}`};export{A as L,F as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ac as k,r as p,g as j,j as e,f as z,S as L,N as R,c as U}from"./index-
|
|
1
|
+
import{ac as k,r as p,g as j,j as e,f as z,S as L,N as R,c as U}from"./index-DkVMZPZp.js";import{u as T}from"./useMutation-CFQDhqDA.js";import{c as b,B as P}from"./button-CWzK0IXA.js";import{I as E}from"./input-BKM3goZw.js";function B({redirectUrl:r}){const{emailAndPassword:t}=k(),[s,d]=p.useState(""),[o,u]=p.useState(""),[l,v]=p.useState(""),[i,N]=p.useState(()=>globalThis.localStorage?.getItem("hasLoggedIn")!=="true"),[m,h]=p.useState(""),g=T({mutationFn:async({email:a,password:n,name:C})=>{try{if(i){const c=await j.signUp.email({email:a,password:n,name:C||""});if(c.error)throw new Error(c.error.message||"Sign up failed");return c}else{const c=await j.signIn.email({email:a,password:n});if(c.error)throw new Error(c.error.message||"Sign in failed");return c}}catch(c){throw c instanceof Error?c:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),r&&(window.location.href=r)}}),y=a=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a),x=()=>{s.trim()&&!y(s)&&h("Invalid email address")},S=a=>{if(a.preventDefault(),!y(s)){h("Invalid email address");return}g.mutate({email:s,password:o,name:l})},_=a=>n=>{a(n.target.value),I&&g.reset(),a===d&&m&&h("")},f=g.isPending,I=g.error,w=i?s.trim()&&o.trim()&&l.trim():s.trim()&&o.trim(),A=a=>{if(!a)return null;const n=a.message.toLowerCase();return n.includes("unauthorized")||n.includes("401")?"Invalid email or password. Please try again.":n.includes("already exists")||n.includes("409")?"An account with this email already exists. Try signing in instead.":n.includes("network")||n.includes("fetch")?"Network error. Please check your connection and try again.":n.includes("rate limit")||n.includes("429")?"Too many attempts. Please wait a moment and try again.":a.message||"An error occurred. Please try again."};return e.jsxs("div",{className:"mx-auto w-full min-w-[400px] max-w-md grid gap-6 bg-card p-10 border border-primary-foreground/20",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12"})}),e.jsx("div",{className:"text-center space-y-1",children:e.jsx("p",{className:"text-sm text-foreground/70",children:i?"Create your account":"Login or signup below"})}),I&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:A(I)}),t.enabled&&e.jsxs("form",{onSubmit:S,className:"grid gap-4",children:[e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",i?"max-h-[200px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsxs("div",{className:b("p-1",!i&&"pointer-events-none"),children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(E,{type:"text",placeholder:"Your name",value:l,onChange:_(v),required:!0,disabled:f||!i,"aria-hidden":!i})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(E,{type:"email",placeholder:"you@example.com",value:s,onChange:_(d),onBlur:x,required:!0,disabled:f,"aria-invalid":!!m}),m&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:m})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Password"}),e.jsx(E,{type:"password",placeholder:"••••••••",value:o,onChange:_(u),required:!0,disabled:f})]}),e.jsx("div",{className:b("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",w?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:b("p-1",!w&&"pointer-events-none"),children:e.jsx(P,{type:"submit",disabled:f||!w,className:b("w-full font-semibold"),size:"lg","aria-hidden":!w,children:f?i?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-center",children:e.jsx(P,{type:"button",variant:"link",onClick:()=>{N(!i),v(""),h(""),g.reset()},disabled:f,className:"text-sm text-muted-foreground hover:text-foreground",children:i?"Already have an account? Sign in":"Don't have an account? Sign up"})}),e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground pt-4",children:[e.jsx("a",{href:"https://www.decocms.com/terms-of-use",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Terms of Service"}),e.jsx("a",{href:"https://www.decocms.com/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground transition-colors",children:"Privacy Policy"})]})]})}function M(r){if(!r.client_id||r.response_type!=="code")return null;const t=new URLSearchParams;return r.client_id&&t.set("client_id",r.client_id),r.redirect_uri&&t.set("redirect_uri",r.redirect_uri),r.response_type&&t.set("response_type",r.response_type),r.state&&t.set("state",r.state),r.scope&&t.set("scope",r.scope),r.code_challenge&&t.set("code_challenge",r.code_challenge),r.code_challenge_method&&t.set("code_challenge_method",r.code_challenge_method),`/api/auth/mcp/authorize?${t.toString()}`}function q(r){const t=U.c(5),{callbackURL:s,providerId:d}=r;let o,u;t[0]!==s||t[1]!==d?(o=()=>{(async()=>await j.signIn.sso({providerId:d,callbackURL:s}))()},u=[d,s],t[0]=s,t[1]=d,t[2]=o,t[3]=u):(o=t[2],u=t[3]),p.useEffect(o,u);let l;return t[4]===Symbol.for("react.memo_cache_sentinel")?(l=e.jsx(L,{}),t[4]=l):l=t[4],l}function Y(){const r=j.useSession(),t=z({from:"/login"}),{next:s="/",client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}=t,{sso:m,emailAndPassword:h,magicLink:g,socialProviders:y}=k(),x=M({client_id:d,redirect_uri:o,response_type:u,state:l,scope:v,code_challenge:i,code_challenge_method:N}),S=x||s;return r.data?x?(window.location.href=x,e.jsx(L,{})):e.jsx(R,{to:s}):m.enabled?e.jsx(q,{callbackURL:S,providerId:m.providerId}):h.enabled||g.enabled||y.enabled?e.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-br from-primary to-primary/75 p-4",children:[e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle, var(--primary-foreground) 1px, transparent 1px)",backgroundSize:"16px 16px",opacity:.15}}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 w-screen h-px bg-primary-foreground/15"}),e.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-px h-screen bg-primary-foreground/15"}),e.jsx(B,{redirectUrl:x})]})]}):e.jsx("div",{children:"No login options available"})}export{Y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a8 as P,a9 as $,aa as V,ab as x}from"./index-
|
|
1
|
+
import{a8 as P,a9 as $,aa as V,ab as x}from"./index-DkVMZPZp.js";function I(n){let e=0;for(let t=0;t<n.length;t++){const r=n.charCodeAt(t);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(16)}const T=new Map,O="mcp:oauth:callback:";class N{serverUrl;_clientMetadata;_redirectUrl;_windowMode;_state=null;_codeVerifier=null;_clientInfo=null;_tokens=null;constructor(e){this.serverUrl=e.serverUrl,this._redirectUrl=e.callbackUrl??`${window.location.origin}/oauth/callback`,this._windowMode=e.windowMode??"popup";const t=e.scope?Array.isArray(e.scope)?e.scope.join(" "):e.scope:void 0;this._clientMetadata={redirect_uris:[this._redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:e.clientName??"@decocms/mesh MCP client",...t&&{scope:t}},T.set(I(this.serverUrl),this)}get redirectUrl(){return this._redirectUrl}get clientMetadata(){return this._clientMetadata}state(){return this._state||(this._state=crypto.randomUUID()),this._state}getStoredState(){return this._state}clientInformation(){return this._clientInfo??void 0}saveClientInformation(e){this._clientInfo=e}tokens(){return this._tokens??void 0}saveTokens(e){this._tokens=e}redirectToAuthorization(e){if(this._windowMode==="tab"){if(!window.open(e.toString(),"_blank"))throw new Error("Tab was blocked")}else{const s=window.screenX+(window.outerWidth-600)/2,o=window.screenY+(window.outerHeight-700)/2;if(!window.open(e.toString(),"mcp-oauth",`width=600,height=700,left=${s},top=${o},popup=yes`)&&!window.open(e.toString(),"_blank"))throw new Error("Popup was blocked")}}saveCodeVerifier(e){this._codeVerifier=e}codeVerifier(){if(!this._codeVerifier)throw new Error("Code verifier not found");return this._codeVerifier}invalidateCredentials(){this._clientInfo=null,this._tokens=null,this._codeVerifier=null,this._state=null}getServerUrl(){return this.serverUrl}cleanup(){T.delete(I(this.serverUrl))}}async function K(n){const e=n.meshUrl??window.location.origin,t=new URL(`/mcp/${n.connectionId}`,e),r=new N({serverUrl:t.href,clientName:n.clientName,clientUri:n.clientUri,callbackUrl:n.callbackUrl,scope:n.scope,windowMode:n.windowMode}),s={fn:null};try{const o=new Promise((l,u)=>{const w=n.timeout||12e4;let m,h=!1;const M=r.state(),g=`${O}${M}`,d=()=>{window.removeEventListener("message",A),window.removeEventListener("storage",b),clearTimeout(m);try{localStorage.removeItem(g)}catch{}};s.fn=a=>{h||(h=!0,d(),u(a))};const S=async a=>{if(h)return;if(h=!0,!a.success){d(),u(new Error(a.error||"OAuth authentication failed"));return}const{code:k,state:C}=a;if(!k){d(),u(new Error("Missing authorization code"));return}if(r.getStoredState()!==C){d(),u(new Error("OAuth state mismatch - possible CSRF attack"));return}try{const y=(await P(t))?.authorization_servers?.[0]||t,U=await $(y),p=r.clientInformation();if(!p){d(),u(new Error("Client information not found"));return}const L=r.codeVerifier(),R=await V(y,{metadata:U,clientInformation:p,authorizationCode:k,codeVerifier:L,redirectUri:r.redirectUrl,resource:new URL(t)});d(),l({tokens:R,clientId:p.client_id??null,clientSecret:"client_secret"in p?p.client_secret:null,tokenEndpoint:U?.token_endpoint??null})}catch(v){d(),u(v)}},A=async a=>{a.origin===window.location.origin&&a.data?.type==="mcp:oauth:callback"&&await S(a.data)},b=async a=>{if(!(a.key!==g||!a.newValue))try{const k=JSON.parse(a.newValue);await S(k)}catch{}};window.addEventListener("message",A),window.addEventListener("storage",b),m=setTimeout(()=>{h||(h=!0,d(),u(new Error("OAuth authentication timeout")))},w)});if(o.catch(()=>{}),await x(r,{serverUrl:t})==="REDIRECT"){const l=await o;return{token:l.tokens.access_token,tokenInfo:{accessToken:l.tokens.access_token,refreshToken:l.tokens.refresh_token??null,expiresIn:l.tokens.expires_in??null,scope:l.tokens.scope??null,clientId:l.clientId,clientSecret:l.clientSecret,tokenEndpoint:l.tokenEndpoint},error:null}}const i=r.tokens(),c=r.clientInformation();return{token:i?.access_token||null,tokenInfo:i?{accessToken:i.access_token,refreshToken:i.refresh_token??null,expiresIn:i.expires_in??null,scope:i.scope??null,clientId:c?.client_id??null,clientSecret:c&&"client_secret"in c?c.client_secret:null,tokenEndpoint:null}:null,error:null}}catch(o){return s.fn&&s.fn(o instanceof Error?o:new Error(String(o))),{token:null,tokenInfo:null,error:o instanceof Error?o.message:String(o)}}finally{r.cleanup()}}function _(n,e){if(window.opener&&!window.opener.closed)return window.opener.postMessage(n,window.location.origin),!0;if(e)try{const t=`${O}${e}`;return localStorage.setItem(t,JSON.stringify(n)),!0}catch{}return!1}async function W(){const n=new URLSearchParams(window.location.search),e=n.get("code");let t=n.get("state");const r=n.get("error"),s=n.get("error_description");let o=t;if(t)try{const i=atob(t),c=JSON.parse(i);c.clientState&&(o=c.clientState)}catch{}if(r){const i=s||r;return _({type:"mcp:oauth:callback",success:!1,error:i},o),{success:!1,error:i}}if(!e||!t){const i="Missing code or state parameter";return _({type:"mcp:oauth:callback",success:!1,error:i},o),{success:!1,error:i}}return t=o||t,_({type:"mcp:oauth:callback",success:!0,code:e,state:t},t)?{success:!0}:{success:!1,error:"Parent window not available"}}function E(){if(typeof window<"u"&&window.location?.origin)return window.location.origin}function z(n){try{const e=E();return(e?new URL(n,e):new URL(n)).pathname.match(/^\/mcp\/([^/]+)/)?.[1]??null}catch{return null}}async function H(n,e){try{const t=`/api/connections/${n}/oauth-token/status`,r=e?new URL(t,e).href:t,s=await fetch(r,{credentials:e?"omit":"include"});return s.ok?{hasToken:(await s.json()).hasToken===!0}:{hasToken:!1}}catch{return{hasToken:!1}}}async function j({url:n,token:e,meshUrl:t}){try{const r=new Headers;r.set("Content-Type","application/json"),r.set("Accept","application/json, text/event-stream");const s=await fetch(n,{method:"POST",headers:r,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"@decocms/mesh MCP client",version:"1.0.0"}}})}),o=z(n),f=E(),i=t??(f?new URL(n,f).origin:new URL(n).origin);if(s.ok)return{isAuthenticated:!0,supportsOAuth:!1,hasOAuthToken:(o?await H(o,i):{hasToken:!1}).hasToken};let c;try{const w=await s.json();c=w.error||w.message}catch{}return s.status>=500?{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:c||`HTTP ${s.status}`,isServerError:!0}:{isAuthenticated:!1,supportsOAuth:!!s.headers.get("WWW-Authenticate"),hasOAuthToken:!1,error:c||`HTTP ${s.status}`}}catch(r){return console.error("[isConnectionAuthenticated] Error:",r),{isAuthenticated:!1,supportsOAuth:!1,hasOAuthToken:!1,error:r.message}}}export{K as a,W as h,j as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as B,c as V,j as a}from"./index-
|
|
1
|
+
import{r as B,c as V,j as a}from"./index-DkVMZPZp.js";import{I as O,T as q,a as J,b as K}from"./empty-state-yKA0Dnoy.js";import{c as M,B as Q}from"./button-CWzK0IXA.js";import{s as X}from"./Globe02-DqbzCrT0.js";import{i as Y}from"./Lock01-D4BGdzZt.js";import{s as ee}from"./Plus-8ovTaJHc.js";import{i as te}from"./Terminal--fMComVX.js";import{C as se}from"./card-uLixd1BQ.js";import{g as le}from"./github-icon-Dp3wHhYE.js";const U=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"m9 12 2 2 4.5-4.5m2.401-4.501a2.03 2.03 0 0 0 1.1 1.1l1.744.723a2.033 2.033 0 0 1 1.1 2.656l-.722 1.744a2.03 2.03 0 0 0 0 1.556l.722 1.744a2.033 2.033 0 0 1-1.1 2.656L19 17.901A2.033 2.033 0 0 0 17.9 19l-.723 1.745a2.032 2.032 0 0 1-2.656 1.1l-1.744-.722a2.032 2.032 0 0 0-1.555 0l-1.745.723a2.033 2.033 0 0 1-2.654-1.1L6.1 19.001A2.033 2.033 0 0 0 5 17.9l-1.744-.723a2.033 2.033 0 0 1-1.1-2.654l.721-1.744a2.033 2.033 0 0 0 0-1.556l-.722-1.746a2.033 2.033 0 0 1 1.1-2.657L5 6.098A2.03 2.03 0 0 0 6.1 5l.723-1.745a2.033 2.033 0 0 1 2.656-1.1l1.744.722a2.033 2.033 0 0 0 1.555-.001l1.746-.72a2.032 2.032 0 0 1 2.655 1.1l.723 1.746v-.003Z"}));U.displayName="CheckVerified02";const W=({size:s=24,color:e="currentColor",...l})=>B.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},B.createElement("path",{d:"M6 6h.01M6 18h.01m-.81-8h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 8.48 22 7.92 22 6.8V5.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 2 19.92 2 18.8 2H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 3.52 2 4.08 2 5.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 10 4.08 10 5.2 10Zm0 12h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 20.48 22 19.92 22 18.8v-1.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 14 19.92 14 18.8 14H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 15.52 2 16.08 2 17.2v1.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 22 4.08 22 5.2 22Z"}));W.displayName="Server01";function ie(s){if(!s.includes("/"))return s;const e=s.split("/"),l=e[0],i=e[1];if(!l||!i)return s;if(l.includes(".")){const n=l.split("."),r=n[n.length-1]||l,o=i.replace(/^mcp-?/,"").replace(/-?mcp$/,"").replace(/^server-?/,"").replace(/-?server$/,"");return!o||o.length<2?r:o}return i}function ae(s){const e=V.c(2),{protocol:l,className:i}=s;let n;return e[0]!==i?(n={http:a.jsx(X,{className:i}),sse:a.jsx(W,{className:i}),stdio:a.jsx(te,{className:i})},e[0]=i,e[1]=n):n=e[1],n[l]}function ne(s){switch(s){case"http":return"HTTP";case"sse":return"SSE";case"stdio":return"STDIO"}}function re(s){const e=V.c(9),{protocol:l}=s;let i;e[0]!==l?(i=M("flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium shrink-0",{http:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",sse:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",stdio:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400"}[l]),e[0]=l,e[1]=i):i=e[1];let n,r;e[2]!==l?(n=a.jsx(ae,{protocol:l,className:"w-3 h-3"}),r=ne(l),e[2]=l,e[3]=n,e[4]=r):(n=e[3],r=e[4]);let o;return e[5]!==i||e[6]!==n||e[7]!==r?(o=a.jsxs("div",{className:i,children:[n,r]}),e[5]=i,e[6]=n,e[7]=r,e[8]=o):o=e[8],o}function oe(s){const e=V.c(68),{icon:l,displayName:i,description:n,onClick:r}=s,t=(s.variant??"store")==="server",f=t?s.hostname:null,d=t?s.protocol:null,c=t?s.isInstalling:!1,m=t?s.actionLabel:void 0,p=t?null:s.scopeName,_=t?!1:s.isVerified,x=t?!0:s.canInstall,H=t?"p-4":"p-6";let u;e[0]!==H?(u=M("cursor-pointer hover:bg-muted/50 transition-colors",H),e[0]=H,e[1]=u):u=e[1];const R=t?"gap-3":"gap-4";let h;e[2]!==R?(h=M("flex flex-col h-full relative",R),e[2]=R,e[3]=h):h=e[3];const Z=t?"sm":"md";let g;e[4]!==i||e[5]!==l||e[6]!==Z?(g=a.jsx(O,{icon:l,name:i,size:Z,className:"shadow-sm shrink-0"}),e[4]=i,e[5]=l,e[6]=Z,e[7]=g):g=e[7];const G=t?"text-sm":"text-base";let v;e[8]!==G?(v=M("flex items-center gap-2 font-medium min-w-0",G),e[8]=G,e[9]=v):v=e[9];let j;e[10]!==i?(j=a.jsx("span",{className:"truncate",children:i}),e[10]=i,e[11]=j):j=e[11];let N;e[12]!==t||e[13]!==_?(N=!t&&_&&a.jsx(U,{size:16,className:"text-success shrink-0"}),e[12]=t,e[13]=_,e[14]=N):N=e[14];let C;e[15]!==x||e[16]!==t?(C=!t&&!x&&a.jsx(Y,{size:16,className:"text-muted-foreground shrink-0"}),e[15]=x,e[16]=t,e[17]=C):C=e[17];let k;e[18]!==t||e[19]!==d?(k=t&&d&&a.jsx(re,{protocol:d}),e[18]=t,e[19]=d,e[20]=k):k=e[20];let b;e[21]!==C||e[22]!==k||e[23]!==v||e[24]!==j||e[25]!==N?(b=a.jsx(q,{asChild:!0,children:a.jsxs("div",{className:v,children:[j,N,C,k]})}),e[21]=C,e[22]=k,e[23]=v,e[24]=j,e[25]=N,e[26]=b):b=e[26];let w;e[27]!==i?(w=a.jsx("p",{children:i}),e[27]=i,e[28]=w):w=e[28];let y;e[29]!==x||e[30]!==t?(y=!t&&!x&&a.jsx("p",{className:"text-xs mt-1",children:"No connection available"}),e[29]=x,e[30]=t,e[31]=y):y=e[31];let I;e[32]!==w||e[33]!==y?(I=a.jsxs(J,{children:[w,y]}),e[32]=w,e[33]=y,e[34]=I):I=e[34];let $;e[35]!==b||e[36]!==I?($=a.jsxs(K,{children:[b,I]}),e[35]=b,e[36]=I,e[37]=$):$=e[37];let L;e[38]!==f||e[39]!==t||e[40]!==p?(L=(p||f)&&a.jsx("div",{className:M("text-muted-foreground truncate",t?"text-xs mt-0.5":"text-sm"),children:p||f}),e[38]=f,e[39]=t,e[40]=p,e[41]=L):L=e[41];let P;e[42]!==$||e[43]!==L?(P=a.jsx("div",{className:"flex gap-2 items-start min-w-0 flex-1",children:a.jsxs("div",{className:"min-w-0 flex-1",children:[$,L]})}),e[42]=$,e[43]=L,e[44]=P):P=e[44];let S;e[45]!==P||e[46]!==g?(S=a.jsxs("div",{className:"flex gap-3",children:[g,P]}),e[45]=P,e[46]=g,e[47]=S):S=e[47];let T;e[48]!==n?(T=n&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:n}),e[48]=n,e[49]=T):T=e[49];let E;e[50]!==n||e[51]!==t?(E=!n&&!t&&a.jsx("div",{className:"text-sm text-muted-foreground line-clamp-2",children:"No description available"}),e[50]=n,e[51]=t,e[52]=E):E=e[52];let z;e[53]!==m||e[54]!==c||e[55]!==t||e[56]!==r?(z=t&&a.jsxs(Q,{variant:"outline",size:"sm",onClick:F=>{F.stopPropagation(),r()},disabled:c,className:"w-full mt-auto cursor-pointer",children:[a.jsx(ee,{size:16}),c?"Connecting...":m||"Connect"]}),e[53]=m,e[54]=c,e[55]=t,e[56]=r,e[57]=z):z=e[57];let D;e[58]!==S||e[59]!==T||e[60]!==E||e[61]!==z||e[62]!==h?(D=a.jsxs("div",{className:h,children:[S,T,E,z]}),e[58]=S,e[59]=T,e[60]=E,e[61]=z,e[62]=h,e[63]=D):D=e[63];let A;return e[64]!==r||e[65]!==u||e[66]!==D?(A=a.jsx(se,{className:u,onClick:r,children:D}),e[64]=r,e[65]=u,e[66]=D,e[67]=A):A=e[67],A}function ce(s){const e=s.title||s.server.title||s.id||"Unnamed Item",l=s._meta?.["mcp.mesh"],i=l?.short_description||l?.mesh_description||s.server.description||null,n=s.server.icons?.[0]?.src||le(s.server.repository)||null,r=l?.verified??!1,o=(s.server.remotes?.length??0)>0,t=(s.server.packages?.length??0)>0,f=o||t;let d=e,c=null;if(e.includes("/")){const m=e.split("/");m.length>=2&&(c=m[0]||null,d=ie(e))}if(!c){const m=l?.scopeName,p=l?.appName;m&&p?c=`${m}/${p}`:m&&(c=m)}return l?.friendly_name&&(d=l.friendly_name),{icon:n,scopeName:c,displayName:d,description:i,isVerified:r,canInstall:f}}function je(s){const e=V.c(12),{items:l,title:i,onItemClick:n}=s;if(l.length===0)return null;let r;e[0]!==i?(r=i&&a.jsx("div",{className:"flex items-center justify-between w-max gap-2",children:a.jsx("h2",{className:"text-lg font-medium",children:i})}),e[0]=i,e[1]=r):r=e[1];let o;if(e[2]!==l||e[3]!==n){let d;e[5]!==n?(d=c=>{const m=ce(c);return a.jsx(oe,{...m,onClick:()=>n(c)},c.id)},e[5]=n,e[6]=d):d=e[6],o=l.map(d),e[2]=l,e[3]=n,e[4]=o}else o=e[4];let t;e[7]!==o?(t=a.jsx("div",{className:"grid grid-cols-4 gap-4",children:o}),e[7]=o,e[8]=t):t=e[8];let f;return e[9]!==r||e[10]!==t?(f=a.jsxs("div",{className:"flex flex-col gap-4",children:[r,t]}),e[9]=r,e[10]=t,e[11]=f):f=e[11],f}export{je as M,oe as a,W as b,ie as e};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{r as F,c as E,j as t,u as he,w as ge,a as ke,f as Le,g as Pe,bl as ce,K as Me,l as Ve,t as de}from"./index-BAZLm9w0.js";import{i as De}from"./AlertCircle-CyK0Qw5h.js";import{i as ve}from"./Loading01-DCWQbhnz.js";import{P as me}from"./index-LE1qlbhg.js";import{I as be,E as Ee}from"./empty-state-Z8nGys2S.js";import{B as te,c as $e}from"./button-nyR0JH2l.js";import{i as Re}from"./CheckCircle-Dq1sA0pv.js";import{t as Ae}from"./ChevronDown-Z3Dyyuvx.js";import{s as fe}from"./Plus-CG8dB40n.js";import{a as Be,c as Ue,b as ze,D as Oe}from"./dropdown-menu-BUrC7H_I.js";import{n as ue}from"./LinkExternal01-DQ9drSdh.js";import{T as Fe,R as He}from"./tools-list-BIhDDkg5.js";import{C as Ge}from"./collection-tabs-UYd1fkoS.js";import{s as We}from"./Globe02-DudYvjwY.js";import{a as qe,b as Ke,e as Qe}from"./mcp-server-card-C9lXz3j7.js";import{i as Ye}from"./Terminal-CdMAejVo.js";import{B as Xe,a as Ze,b as pe,c as Je,d as et,e as tt}from"./breadcrumb-BjHn0dWR.js";import{u as st}from"./use-binding-C5bwm3GP.js";import{u as ot}from"./useQuery-Da0DsMDg.js";import{d as rt,e as nt,c as it,f as lt}from"./use-connection-k5RUrkjP.js";import{u as at}from"./constants-CJQnv32m.js";import{u as ct,L as dt}from"./localstorage-keys-Ciabbhpd.js";import{e as mt}from"./extract-connection-data-DS_2GbRy.js";import{s as ft}from"./slugify-CEUa2lfQ.js";import{e as ut,g as pt}from"./github-icon-Dp3wHhYE.js";import{f as xt,g as ht,c as gt}from"./registry-utils-DGqTJkDv.js";import{i as vt}from"./InfoCircle-p3x1ZyEw.js";import"./ChevronRight-DDdY_PC7.js";import"./File06-Bwnj0Jvb.js";import"./collection-table-wrapper-Ad_-F1tG.js";import"./ArrowUp-BzVEz2lB.js";import"./Check-Dzm8t_lx.js";import"./Grid01-DB4psHwp.js";import"./List-BeVMnZSE.js";import"./view-mode-toggle-DsKf8ZTT.js";import"./table-oiEqEhps.js";import"./collection-search-DgJbkAZh.js";import"./SearchMd-BWXZ4bVC.js";import"./input-DHWQboe4.js";import"./card-DVnhjUGd.js";import"./layout-DsaX6gcJ.js";import"./badge-BMiZ-mom.js";import"./Lock01-Cnn8kQG1.js";import"./binder-DC5jbVcK.js";import"./useMutation-ffySYpQB.js";import"./constants-DpsR0LZe.js";import"./generate-id-Dyweu44Y.js";const je=({size:o=24,color:e="currentColor",...s})=>F.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},F.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"}));je.displayName="SearchLg";function bt(o){const e=E.c(3),{message:s}=o,r=s===void 0?"Loading MCP Server details...":s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(ve,{size:48,className:"animate-spin mb-4"}),e[0]=n):n=e[0];let i;return e[1]!==r?(i=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,t.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),e[1]=r,e[2]=i):i=e[2],i}function jt(o){const e=E.c(9),{error:s,onBack:r}=o,n=s instanceof Error?s.message:s;let i,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(De,{size:48,className:"text-destructive mb-4"}),c=t.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading MCP Server"}),e[0]=i,e[1]=c):(i=e[0],c=e[1]);let u;e[2]!==n?(u=t.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:n}),e[2]=n,e[3]=u):u=e[3];let d;e[4]!==r?(d=t.jsx("button",{onClick:r,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=r,e[5]=d):d=e[5];let m;return e[6]!==u||e[7]!==d?(m=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,c,u,d]}),e[6]=u,e[7]=d,e[8]=m):m=e[8],m}function yt(o){const e=E.c(5),{onBack:s}=o;let r,n,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(je,{size:48,className:"text-muted-foreground mb-4"}),n=t.jsx("h3",{className:"text-lg font-medium mb-2",children:"MCP Server not found"}),i=t.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The MCP Server you're looking for doesn't exist in this store."}),e[0]=r,e[1]=n,e[2]=i):(r=e[0],n=e[1],i=e[2]);let c;return e[3]!==s?(c=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,n,i,t.jsx("button",{onClick:s,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]=s,e[4]=c):c=e[4],c}function Nt(o){const e=E.c(2),{breadcrumb:s}=o;let r;return e[0]!==s?(r=t.jsx(me.Header,{children:t.jsx(me.Header.Left,{children:s})}),e[0]=s,e[1]=r):r=e[1],r}function xe(o){const e=E.c(28),{versions:s,selectedIndex:r,onSelect:n,isInstalling:i,variant:c,showLabel:u}=o,d=i===void 0?!1:i,m=c===void 0?"brand":c,I=u===void 0?!1:u,p=s[r],S=I?"sm":"default",j=m==="brand"&&"rounded-l-none px-2 border-l-2 border-l-white/50";let y;e[0]!==j?(y=$e("shrink-0 cursor-pointer",j),e[0]=j,e[1]=y):y=e[1];let f;e[2]!==p?.server?.version||e[3]!==I?(f=I&&t.jsxs("span",{className:"mr-1",children:["v",p?.server?.version||"unknown"]}),e[2]=p?.server?.version,e[3]=I,e[4]=f):f=e[4];const N=I?14:20;let h;e[5]!==N?(h=t.jsx(Ae,{size:N}),e[5]=N,e[6]=h):h=e[6];let x;e[7]!==d||e[8]!==S||e[9]!==y||e[10]!==f||e[11]!==h||e[12]!==m?(x=t.jsx(Be,{asChild:!0,children:t.jsxs(te,{variant:m,disabled:d,size:S,className:y,children:[f,h]})}),e[7]=d,e[8]=S,e[9]=y,e[10]=f,e[11]=h,e[12]=m,e[13]=x):x=e[13];let g;if(e[14]!==d||e[15]!==n||e[16]!==r||e[17]!==s){let C;e[19]!==d||e[20]!==n||e[21]!==r?(C=(v,b)=>{const P=v._meta?.["io.modelcontextprotocol.registry/official"];return t.jsx(Ue,{onClick:()=>n(b),disabled:d,className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"font-medium text-sm",children:["v",v.server?.version||"unknown"]}),P?.isLatest&&t.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),b===r&&t.jsx(Re,{size:16,className:"text-muted-foreground shrink-0"})]})},b)},e[19]=d,e[20]=n,e[21]=r,e[22]=C):C=e[22],g=s.map(C),e[14]=d,e[15]=n,e[16]=r,e[17]=s,e[18]=g}else g=e[18];let _;e[23]!==g?(_=t.jsx(ze,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:g}),e[23]=g,e[24]=_):_=e[24];let w;return e[25]!==x||e[26]!==_?(w=t.jsxs(Oe,{children:[x,_]}),e[25]=x,e[26]=_,e[27]=w):w=e[27],w}function Ct(o){const e=E.c(46),{data:s,itemVersions:r,onInstall:n,canInstall:i,isInstalling:c,hideInstallControls:u,selectedVersionIndex:d,onVersionChange:m}=o,I=i===void 0?!0:i,p=c===void 0?!1:c,S=u===void 0?!1:u,[j,y]=F.useState(0),f=d??j;let N;e[0]!==m?(N=B=>{y(B),m?.(B)},e[0]=m,e[1]=N):N=e[1];const h=N,x=r[f]||r[0];let g;e[2]!==x?.server?.remotes?(g=x?.server?.remotes??[],e[2]=x?.server?.remotes,e[3]=g):g=e[3];const _=g;let w;e[4]!==x?.server?.packages?(w=x?.server?.packages??[],e[4]=x?.server?.packages,e[5]=w):w=e[5];const v=w.length>0,b=_.length>0,P=_.findIndex(wt),a=P>=0?P:0;let M;e[6]!==a||e[7]!==v||e[8]!==b||e[9]!==n||e[10]!==f?(M=()=>{b?n(f,a,void 0):v&&n(f,void 0,0)},e[6]=a,e[7]=v,e[8]=b,e[9]=n,e[10]=f,e[11]=M):M=e[11];const V=M;let H;e[12]!==r||e[13]!==n||e[14]!==h?(H=B=>{h(B);const X=r[B],Z=X?.server?.remotes??[],se=X?.server?.packages??[];if(Z.length>0){const J=Z.findIndex(St);n(B,J>=0?J:0,void 0)}else se.length>0&&n(B,void 0,0)},e[12]=r,e[13]=n,e[14]=h,e[15]=H):H=e[15];const K=H;let R;e[16]!==s.icon||e[17]!==s.name?(R=t.jsx(be,{icon:s.icon,name:s.name,size:"lg",className:"shrink-0 shadow-sm"}),e[16]=s.icon,e[17]=s.name,e[18]=R):R=e[18];let k;e[19]!==s.name?(k=t.jsx("h1",{className:"text-3xl font-medium",children:s.name}),e[19]=s.name,e[20]=k):k=e[20];let T;e[21]!==s.verified?(T=s.verified&&t.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[21]=s.verified,e[22]=T):T=e[22];let A;e[23]!==k||e[24]!==T?(A=t.jsxs("div",{className:"flex items-center gap-2",children:[k,T]}),e[23]=k,e[24]=T,e[25]=A):A=e[25];let D;e[26]!==s.shortDescription?(D=s.shortDescription&&t.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:s.shortDescription}),e[26]=s.shortDescription,e[27]=D):D=e[27];let U;e[28]!==A||e[29]!==D?(U=t.jsxs("div",{className:"flex-1 min-w-0",children:[A,D]}),e[28]=A,e[29]=D,e[30]=U):U=e[30];let z;e[31]!==I||e[32]!==V||e[33]!==K||e[34]!==S||e[35]!==p||e[36]!==r||e[37]!==f||e[38]!==h?(z=I&&!S?t.jsx("div",{className:"shrink-0 flex items-center gap-2",children:r.length>1?t.jsxs("div",{className:"flex",children:[t.jsxs(te,{variant:"brand",onClick:V,disabled:p,className:"shrink-0 rounded-r-none cursor-pointer",children:[t.jsx(fe,{size:20}),p?"Connecting...":"Connect"]}),t.jsx(xe,{versions:r,selectedIndex:f,onSelect:K,isInstalling:p,variant:"brand"})]}):t.jsxs(te,{variant:"brand",onClick:V,disabled:r.length===0||p,className:"shrink-0 cursor-pointer",children:[t.jsx(fe,{size:20}),p?"Connecting...":"Connect"]})}):S?r.length>1?t.jsx("div",{className:"shrink-0",children:t.jsx(xe,{versions:r,selectedIndex:f,onSelect:h,isInstalling:p,variant:"outline",showLabel:!0})}):null:t.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[31]=I,e[32]=V,e[33]=K,e[34]=S,e[35]=p,e[36]=r,e[37]=f,e[38]=h,e[39]=z):z=e[39];let O;e[40]!==U||e[41]!==z?(O=t.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[U,z]}),e[40]=U,e[41]=z,e[42]=O):O=e[42];let G;return e[43]!==O||e[44]!==R?(G=t.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[R,O]}),e[43]=O,e[44]=R,e[45]=G):G=e[45],G}function St(o){return o.type?.toLowerCase()==="http"||o.type?.toLowerCase()==="streamable-http"}function wt(o){return o.type?.toLowerCase()==="http"||o.type?.toLowerCase()==="streamable-http"}function It(o){if(!o)return"—";try{const e=new Date(o);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function _t(o){const e=E.c(47),{data:s,publisherInfo:r,selectedItem:n}=o;let i;e[0]!==s.description?(i=s.description&&t.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[t.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),t.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:s.description})]}),e[0]=s.description,e[1]=i):i=e[1];const c=s.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":s.publisher;let u;e[2]!==r.logo||e[3]!==c?(u=t.jsx(be,{icon:r.logo,name:c,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=r.logo,e[3]=c,e[4]=u):u=e[4];let d;e[5]!==s.publisher?(d=s.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":s.publisher.charAt(0).toUpperCase()+s.publisher.slice(1),e[5]=s.publisher,e[6]=d):d=e[6];let m;e[7]!==d?(m=t.jsx("div",{className:"font-medium",children:d}),e[7]=d,e[8]=m):m=e[8];let I;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("div",{className:"text-xs text-muted-foreground",children:"Publisher"}),e[9]=I):I=e[9];let p;e[10]!==m?(p=t.jsxs("div",{children:[m,I]}),e[10]=m,e[11]=p):p=e[11];let S;e[12]!==u||e[13]!==p?(S=t.jsx("div",{className:"px-5 border-b border-border",children:t.jsxs("div",{className:"flex items-center gap-3 py-5",children:[u,p]})}),e[12]=u,e[13]=p,e[14]=S):S=e[14];let j;e[15]!==s.version?(j=s.version&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Version"}),t.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",s.version]})]}),e[15]=s.version,e[16]=j):j=e[16];let y;e[17]!==s.tags?(y=s.tags&&s.tags.length>0&&t.jsxs("div",{className:"flex justify-between items-start text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Tags"}),t.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:s.tags.map(kt)})]}),e[17]=s.tags,e[18]=y):y=e[18];let f;e[19]!==s.categories?(f=s.categories&&s.categories.length>0&&t.jsxs("div",{className:"flex justify-between items-start text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Categories"}),t.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:s.categories.map(Tt)})]}),e[19]=s.categories,e[20]=f):f=e[20];let N;e[21]!==s.connectionType?(N=s.connectionType&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:s.connectionType})]}),e[21]=s.connectionType,e[22]=N):N=e[22];let h;e[23]!==s.schemaVersion?(h=s.schemaVersion&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),t.jsx("span",{className:"text-muted-foreground text-xs",children:s.schemaVersion})]}),e[23]=s.schemaVersion,e[24]=h):h=e[24];let x;e[25]!==s.websiteUrl?(x=s.websiteUrl&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Website"}),t.jsxs("a",{href:s.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[t.jsx("span",{children:"Visit"}),t.jsx(ue,{size:14})]})]}),e[25]=s.websiteUrl,e[26]=x):x=e[26];let g;e[27]!==s.repository?(g=s.repository?.url&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Source"}),t.jsxs("a",{href:s.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[t.jsx("span",{children:"GitHub"}),t.jsx(ue,{size:14})]})]}),e[27]=s.repository,e[28]=g):g=e[28];let _;e[29]!==y||e[30]!==f||e[31]!==N||e[32]!==h||e[33]!==x||e[34]!==g||e[35]!==j?(_=t.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[j,y,f,N,h,x,g]}),e[29]=y,e[30]=f,e[31]=N,e[32]=h,e[33]=x,e[34]=g,e[35]=j,e[36]=_):_=e[36];let w;e[37]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[37]=w):w=e[37];let C;e[38]!==n.updated_at?(C=It(n.updated_at),e[38]=n.updated_at,e[39]=C):C=e[39];let v;e[40]!==C?(v=t.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[w,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:C})]}),e[40]=C,e[41]=v):v=e[41];let b;return e[42]!==i||e[43]!==_||e[44]!==v||e[45]!==S?(b=t.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,S,_,v]}),e[42]=i,e[43]=_,e[44]=v,e[45]=S,e[46]=b):b=e[46],b}function Tt(o){return t.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:o},o)}function kt(o){return t.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:o},o)}const Lt=[{value:"http",label:"HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"STDIO"},{value:"all",label:"All"}],Pt={docs:"Documentation",bindings:"Workers Bindings",builds:"Workers Builds",observability:"Observability",radar:"Radar",containers:"Containers",browser:"Browser Rendering",logs:"Logpush",autorag:"AutoRAG",auditlogs:"Audit Logs",graphql:"GraphQL",dex:"DEX Monitoring",casb:"CASB"};function Mt(o){if(!o)return"Local";try{return new URL(o).hostname}catch{return o}}function Vt(o){if(!o)return"local";try{const e=new URL(o).hostname;return e.split(".")[0]||e}catch{return"unknown"}}function Dt(o){const e=Pt[o.toLowerCase()];return e||o.replace(/[-_]/g," ").replace(/\b\w/g,s=>s.toUpperCase())}function Et(o){if(!o)return"http";const e=o.toLowerCase();return e==="sse"?"sse":e==="stdio"?"stdio":"http"}function $t(o){return o.map((e,s)=>{const r=Et(e.type),n=Mt(e.url),i=Vt(e.url),c=e.title||e.name||Dt(i);return{index:s,protocol:r,url:e.url,hostname:n,serviceName:i,displayName:c,name:e.name,title:e.title,description:e.description,_type:e._type,_index:e._index}})}function Rt(o){const e=E.c(2),{protocol:s,className:r}=o;let n;return e[0]!==r?(n={http:t.jsx(We,{className:r}),sse:t.jsx(Ke,{className:r}),stdio:t.jsx(Ye,{className:r})},e[0]=r,e[1]=n):n=e[1],n[s]}function At(o){const e=E.c(10),{options:s,selected:r,onSelect:n}=o;if(s.length<=1)return null;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("span",{className:"text-sm text-muted-foreground",children:"Protocol:"}),e[0]=i):i=e[0];let c;if(e[1]!==n||e[2]!==s||e[3]!==r){let d;e[5]!==n||e[6]!==r?(d=m=>t.jsxs(te,{variant:r===m.value?"default":"outline",size:"sm",onClick:()=>n(m.value),className:"cursor-pointer",children:[t.jsx(Rt,{protocol:m.value==="all"?"http":m.value,className:"w-4 h-4 mr-1"}),m.label]},m.value),e[5]=n,e[6]=r,e[7]=d):d=e[7],c=s.map(d),e[1]=n,e[2]=s,e[3]=r,e[4]=c}else c=e[4];let u;return e[8]!==c?(u=t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[i,t.jsx("div",{className:"flex gap-1",children:c})]}),e[8]=c,e[9]=u):u=e[9],u}function Bt(o){const e=E.c(11),{servers:s,onInstall:r,isInstalling:n,icon:i,mcpName:c,showStdio:u}=o,d=n===void 0?!1:n,m=u===void 0?!1:u,I=m?s:s.filter(Ft),p=$t(I),S=p.length<13?"all":"http",[j,y]=F.useState(S);let f;e:{if(j==="all"){f="all";break e}let a;if(e[0]!==j?(a=V=>V.protocol===j,e[0]=j,e[1]=a):a=e[1],p.some(a)){f=j;break e}if(p.length<13){f="all";break e}f=p[0]?.protocol??"http"}const N=f,h=N==="all"?p:p.filter(a=>a.protocol===N),x=new Set(p.map(Ot));let g=Lt.filter(a=>a.value==="all"||x.has(a.value));m||(g=g.filter(zt));const _=x.size<=1?g.filter(Ut):g,w="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4";let C;e[2]!==i||e[3]!==d||e[4]!==c||e[5]!==r?(C=a=>t.jsx(qe,{variant:"server",icon:i??null,displayName:a.displayName,description:a.description??null,hostname:a.hostname,protocol:a.protocol,isInstalling:d,onClick:()=>r({type:a.protocol,url:a.url,name:a.name,title:a.title,description:a.description,_type:a._type,_index:a._index})},`${a.hostname}-${a.protocol}-${a.index}`),e[2]=i,e[3]=d,e[4]=c,e[5]=r,e[6]=C):C=e[6];const v=h.map(C);let b;e[7]!==v?(b=t.jsx("div",{className:w,children:v}),e[7]=v,e[8]=b):b=e[8];let P;return e[9]!==h.length?(P=h.length===0&&t.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No servers match the selected filter."}),e[9]=h.length,e[10]=P):P=e[10],t.jsxs("div",{className:"p-5",children:[t.jsx(At,{options:_,selected:N,onSelect:y}),b,P]})}function Ut(o){return o.value!=="all"}function zt(o){return o.value!=="stdio"}function Ot(o){return o.protocol}function Ft(o){return o.type?.toLowerCase()!=="stdio"}function Ht(o){const e=E.c(29),{data:s,availableTabs:r,effectiveActiveTabId:n,effectiveTools:i,isLoadingTools:c,onTabChange:u,servers:d,onInstallServer:m,isInstalling:I,mcpIcon:p,mcpName:S,showStdio:j}=o,y=c===void 0?!1:c;let f;e[0]!==d?(f=d===void 0?[]:d,e[0]=d,e[1]=f):f=e[1];const N=f,h=I===void 0?!1:I,x=j===void 0?!1:j;let g;e[2]!==i?(g=i.map(Gt),e[2]=i,e[3]=g):g=e[3];const _=g;let w;e[4]!==r||e[5]!==n||e[6]!==u?(w=r.length>0&&t.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:t.jsx(Ge,{tabs:r,activeTab:n,onTabChange:u})}),e[4]=r,e[5]=n,e[6]=u,e[7]=w):w=e[7];let C;e[8]!==n||e[9]!==h||e[10]!==p||e[11]!==S||e[12]!==m||e[13]!==N||e[14]!==x?(C=n==="servers"&&N.length>0&&t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(Bt,{servers:N,onInstall:a=>m?.(a),isInstalling:h,icon:p,mcpName:S,showStdio:x})}),e[8]=n,e[9]=h,e[10]=p,e[11]=S,e[12]=m,e[13]=N,e[14]=x,e[15]=C):C=e[15];let v;e[16]!==n||e[17]!==i.length||e[18]!==y||e[19]!==_?(v=n==="tools"&&t.jsx("div",{className:"flex flex-col flex-1",children:y?t.jsxs("div",{className:"flex items-center justify-center p-8",children:[t.jsx(ve,{size:24,className:"animate-spin"}),t.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?t.jsx(Fe,{tools:_,showToolbar:!1,emptyMessage:"This MCP Server doesn't have any tools."}):t.jsx(Ee,{image:null,title:"No tools available",description:"This MCP Server doesn't have any tools."})}),e[16]=n,e[17]=i.length,e[18]=y,e[19]=_,e[20]=v):v=e[20];let b;e[21]!==s?.repository||e[22]!==n?(b=n==="readme"&&t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(He,{repository:s?.repository})}),e[21]=s?.repository,e[22]=n,e[23]=b):b=e[23];let P;return e[24]!==b||e[25]!==w||e[26]!==C||e[27]!==v?(P=t.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[w,C,v,b]}),e[24]=b,e[25]=w,e[26]=C,e[27]=v,e[28]=P):P=e[28],P}function Gt(o){const e=o;return{name:e.name||"",description:e.description||void 0}}function Wt(o,e){if(!o||!e)return;const s=e.toLowerCase();return o.find(r=>r.app_name?.toLowerCase()===s||r.app_id?.toLowerCase()===s||r.title.toLowerCase()===s)||o.find(r=>r.title.toLowerCase().includes(s))}function qt(o,e,s,r,n){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:r?.icon||void 0,count:n??o.length};const i=e.toLowerCase(),c=o.filter(d=>(d._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":d.publisher||d._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:s?.icon||c[0]?.publisher_logo||c[0]?.icon||void 0,count:c.length}}function Kt(o){const e=o._meta?.["mcp.mesh"],s=o._meta?.["io.modelcontextprotocol.registry/official"],r=o.server,n=ht(r.remotes?.[0]?.type),i=gt(r.$schema),c=s?"io.modelcontextprotocol.registry/official":o.publisher||e?.scopeName||"Unknown",u=pt(r.repository),d=o.icon||o.image||o.logo||r.icons?.[0]?.src||u||null,m=o.name||o.title||o.server?.title||"Unnamed Item",I=Qe(m),p=e?.friendly_name||I,S=e?.mesh_description||o.description||o.summary||r?.description||"",j=e?.short_description||null,y=e?.tags||[],f=e?.categories||[];return{name:p,description:S,shortDescription:j,icon:d,verified:o.verified||e?.verified,publisher:c,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:i??null,connectionType:n,connectionUrl:null,remoteUrl:null,tags:y,categories:f,tools:o.tools||r.tools||e?.tools||[],models:o.models||r.models||e?.models||[],emails:o.emails||r.emails||e?.emails||[],analytics:o.analytics||r.analytics||e?.analytics,cdn:o.cdn||r.cdn||e?.cdn}}class Qt extends F.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,s){console.error("Store MCP server detail error:",e,s)}render(){return this.state.hasError?t.jsx(jt,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function Yt(){const{org:o}=he(),e=ge(),{appName:s}=ke({strict:!1}),{registryId:r,serverName:n,stdio:i}=Le({strict:!1}),[c,u]=ct(dt.storeShowStdio(),()=>!1),d=i==="true"?!0:i==="false"?!1:c;i!==void 0&&i==="true"!==c&&u(i==="true");const[m,I]=F.useState(null),[p,S]=F.useState(null),j=rt(),y=nt(),{data:f}=Pe.useSession(),N=st(y),h=r||N[0]?.id||"",x=it(h),g=xt(x?.tools),_=x?.tools&&x.tools.find(L=>L.name.endsWith("_VERSIONS"))?.name||"",w=x?.tools&&x.tools.find(L=>L.name.endsWith("_GET"))?.name||"",C=!!n;let v="",b={};C?(v=_||w,b={name:n}):(v=g,b={});const P=at({connectionId:h||null,orgId:o.id}),{data:a}=lt({client:P,toolName:v,toolArguments:b,select:l=>l.structuredContent??l});let M=[],V=[],H=null;if(a){if(Array.isArray(a))M=a;else if(typeof a=="object"&&a!==null)if("totalCount"in a&&typeof a.totalCount=="number"&&(H=a.totalCount),"item"in a&&a.item){const l=a.item;M=[{id:l.id||"",title:l.title,server:l.server,_meta:l._meta}]}else{let l;"versions"in a&&Array.isArray(a.versions)?l="versions":"servers"in a&&Array.isArray(a.servers)?l="servers":l=Object.keys(a).find(L=>Array.isArray(a[L])),l&&(M=a[l],(l==="versions"||v?.includes("VERSIONS"))&&(V=M))}}const K=(()=>{const l=V.findIndex(L=>L._meta?.["io.modelcontextprotocol.registry/official"]?.isLatest===!0);return l>=0?l:0})(),R=p??K;let k=M.find(l=>{const L=l.name||l.title||l.server.title||"";return ft(L)===s});!k&&n&&(k=M.find(l=>l.server.name===n||l.name===n||l.title===n));const T=k?Kt(k):null,A=(T?.tools?.length||0)>0,D=k?.server?.remotes?.[0]?.url||null,U=!A&&!!D,z=ot({queryKey:Me.remoteMcpTools(D),queryFn:async()=>{if(!D)return[];const{Client:l}=await ce(async()=>{const{Client:$}=await import("./index-BAZLm9w0.js").then(q=>q.cp);return{Client:$}},__vite__mapDeps([0,1])),{StreamableHTTPClientTransport:L}=await ce(async()=>{const{StreamableHTTPClientTransport:$}=await import("./index--OStx8iM.js");return{StreamableHTTPClientTransport:$}},__vite__mapDeps([2,0,1,3,4,5,6,7,8,9])),W=new l({name:"mesh-store",version:"1.0.0"}),ee=new L(new URL(D),{requestInit:{headers:{Accept:"application/json, text/event-stream","Content-Type":"application/json"}}});try{return await W.connect(ee),((await W.listTools()).tools||[]).map(q=>({name:q.name,description:q.description}))}finally{await W.close().catch(console.error)}},enabled:U}),O=U&&z.isLoading,G=z.data??[],B=A?T?.tools||[]:G,X=Wt(y,T?.publisher),Z=T?qt(M,T.publisher,X,x??null,H):{count:0},se=T?.repository?ut(T.repository):null,ne=k?.server?.remotes??[],J=k?.server?.packages??[],oe=[...ne.map((l,L)=>({...l,_type:"remote",_index:L})),...J.map((l,L)=>({type:"stdio",url:void 0,name:l.name||l.identifier,title:l.name||l.identifier?.replace(/^@[^/]+\//,""),description:l.environmentVariables?.length?`Requires ${l.environmentVariables.length} environment variable(s)`:void 0,_type:"package",_index:L}))],ie=d?oe:oe.filter(l=>l.type?.toLowerCase()!=="stdio"),le=ie.length>1,Q=[{id:"servers",label:"Servers",count:ie.length,visible:le},{id:"readme",label:"README",visible:!!T?.repository&&!!se},{id:"tools",label:"Tools",count:B.length,visible:A||G.length>0||O&&!!D}].filter(l=>l.visible),ye=Q.find(l=>l.id==="servers")?.id||Q.find(l=>l.id==="readme")?.id||Q[0]?.id||"overview",Ne=m&&Q.find(l=>l.id===m)?m:ye,re=async(l,L,W)=>{const ee=V[l??0]||k;if(!ee||!o||!f?.user?.id)return;const $=mt(ee,o.id,f.user.id,{remoteIndex:W===void 0?L??0:void 0,packageIndex:W}),q=$.connection_type==="STDIO",_e=!!$.connection_url,Te=q&&$.connection_headers&&typeof $.connection_headers=="object"&&"command"in $.connection_headers;if(!_e&&!Te){de.error("This MCP Server cannot be connected: no connection method available");return}try{const{id:Y}=await j.create.mutateAsync($);e({to:"/$org/mcps/$connectionId",params:{org:o.slug,connectionId:Y}})}catch(Y){de.error(`Failed to connect MCP Server: ${Y instanceof Error?Y.message:String(Y)}`)}},Ce=()=>{e({to:"/$org/store",params:{org:o.slug}})};if(!k)return t.jsx(yt,{onBack:Ce});if(!T)return null;const Se=(k?.server?.remotes?.length??0)>0,we=(k?.server?.packages?.length??0)>0,ae=Se||we,Ie=t.jsx(Xe,{children:t.jsxs(Ze,{children:[t.jsx(pe,{children:t.jsx(Je,{asChild:!0,children:t.jsx(Ve,{to:"/$org/store",params:{org:o.slug},children:"Store"})})}),t.jsx(et,{}),t.jsx(pe,{children:t.jsx(tt,{children:T.name})})]})});return t.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[t.jsx(Nt,{breadcrumb:Ie}),t.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:t.jsx("div",{className:"h-full",children:t.jsxs("div",{className:"h-full",children:[!ae&&t.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[t.jsx(vt,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t.jsx(Ct,{data:T,itemVersions:V.length>0?V:[k],onInstall:re,canInstall:ae,isInstalling:j.create.isPending,hideInstallControls:le,selectedVersionIndex:R,onVersionChange:S}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[t.jsx(_t,{data:T,publisherInfo:Z,selectedItem:k}),t.jsx(Ht,{data:T,availableTabs:Q,effectiveActiveTabId:Ne,effectiveTools:B,isLoadingTools:O,onTabChange:I,servers:oe,onInstallServer:l=>{l._type==="remote"?re(R,l._index,void 0):re(R,void 0,l._index)},isInstalling:j.create.isPending,mcpIcon:T.icon,mcpName:T.name,showStdio:d})]})]})})})]})}function Hs(){const o=E.c(6),{org:e}=he(),s=ge();let r;o[0]!==s||o[1]!==e.slug?(r=()=>{s({to:"/$org/store",params:{org:e.slug}})},o[0]=s,o[1]=e.slug,o[2]=r):r=o[2];const n=r;let i;o[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(F.Suspense,{fallback:t.jsx(bt,{}),children:t.jsx(Yt,{})}),o[3]=i):i=o[3];let c;return o[4]!==n?(c=t.jsx(Qt,{onBack:n,children:i}),o[4]=n,o[5]=c):c=o[5],c}export{Hs as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DkVMZPZp.js","assets/index-Bj5Q4dXx.css","assets/index-Bgvel9yL.js","assets/use-connection-BNgYG_2P.js","assets/useMutation-CFQDhqDA.js","assets/constants-Chp3RuVB.js","assets/useQuery-BSKCoFrF.js","assets/use-mcp-prompts-CHXMWYZ1.js","assets/use-virtual-mcp-CEZ5nKxx.js","assets/mcp-oauth-D7Oz8tNV.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as F,c as E,j as t,u as he,w as ge,a as ke,f as Le,g as Pe,bl as ce,K as Me,l as Ve,t as de}from"./index-DkVMZPZp.js";import{i as De}from"./AlertCircle-C47UrlAO.js";import{i as ve}from"./Loading01-BpkkTLVp.js";import{P as me}from"./index-ssfNqXSw.js";import{I as be,E as Ee}from"./empty-state-yKA0Dnoy.js";import{B as te,c as $e}from"./button-CWzK0IXA.js";import{i as Re}from"./CheckCircle-BIFyDkzk.js";import{t as Ae}from"./ChevronDown-CwChLZoe.js";import{s as fe}from"./Plus-8ovTaJHc.js";import{a as Be,c as Ue,b as ze,D as Oe}from"./dropdown-menu-D0wZWcOa.js";import{n as ue}from"./LinkExternal01-ybeItDxA.js";import{T as Fe,R as He}from"./tools-list-BIQssT5E.js";import{C as Ge}from"./collection-tabs-JS9xYoKs.js";import{s as We}from"./Globe02-DqbzCrT0.js";import{a as qe,b as Ke,e as Qe}from"./mcp-server-card-CfIOHPGJ.js";import{i as Ye}from"./Terminal--fMComVX.js";import{B as Xe,a as Ze,b as pe,c as Je,d as et,e as tt}from"./breadcrumb-B1KWdwh9.js";import{u as st}from"./use-binding-CDLcDLTQ.js";import{u as ot}from"./useQuery-BSKCoFrF.js";import{d as rt,e as nt,c as it,f as lt}from"./use-connection-BNgYG_2P.js";import{u as at}from"./constants-Chp3RuVB.js";import{u as ct,L as dt}from"./localstorage-keys-DVhuzRr7.js";import{e as mt}from"./extract-connection-data-Cegvn5cS.js";import{s as ft}from"./slugify-CEUa2lfQ.js";import{e as ut,g as pt}from"./github-icon-Dp3wHhYE.js";import{f as xt,g as ht,c as gt}from"./registry-utils-DFPURwxl.js";import{i as vt}from"./InfoCircle-zJUw_W0n.js";import"./ChevronRight-0gQ-Lwyj.js";import"./File06-CV2OmgsQ.js";import"./collection-table-wrapper-DtjpsgWF.js";import"./ArrowUp-NpHWyg3u.js";import"./Check-hF_kXZiK.js";import"./Grid01-DshI78vi.js";import"./List-B7BO0eBJ.js";import"./view-mode-toggle-Cz9APct2.js";import"./table-CWx1lOcJ.js";import"./collection-search-jBfTOehF.js";import"./SearchMd-SRsVDK9N.js";import"./input-BKM3goZw.js";import"./card-uLixd1BQ.js";import"./layout-B7iU_InR.js";import"./badge-tO1xwt4d.js";import"./Lock01-D4BGdzZt.js";import"./binder-_fA_QfCQ.js";import"./useMutation-CFQDhqDA.js";import"./constants-DUMQK_Jq.js";import"./generate-id-Dyweu44Y.js";const je=({size:o=24,color:e="currentColor",...s})=>F.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},F.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"}));je.displayName="SearchLg";function bt(o){const e=E.c(3),{message:s}=o,r=s===void 0?"Loading MCP Server details...":s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(ve,{size:48,className:"animate-spin mb-4"}),e[0]=n):n=e[0];let i;return e[1]!==r?(i=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,t.jsx("p",{className:"text-sm text-muted-foreground",children:r})]}),e[1]=r,e[2]=i):i=e[2],i}function jt(o){const e=E.c(9),{error:s,onBack:r}=o,n=s instanceof Error?s.message:s;let i,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(De,{size:48,className:"text-destructive mb-4"}),c=t.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading MCP Server"}),e[0]=i,e[1]=c):(i=e[0],c=e[1]);let u;e[2]!==n?(u=t.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:n}),e[2]=n,e[3]=u):u=e[3];let d;e[4]!==r?(d=t.jsx("button",{onClick:r,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=r,e[5]=d):d=e[5];let m;return e[6]!==u||e[7]!==d?(m=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,c,u,d]}),e[6]=u,e[7]=d,e[8]=m):m=e[8],m}function yt(o){const e=E.c(5),{onBack:s}=o;let r,n,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(je,{size:48,className:"text-muted-foreground mb-4"}),n=t.jsx("h3",{className:"text-lg font-medium mb-2",children:"MCP Server not found"}),i=t.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The MCP Server you're looking for doesn't exist in this store."}),e[0]=r,e[1]=n,e[2]=i):(r=e[0],n=e[1],i=e[2]);let c;return e[3]!==s?(c=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,n,i,t.jsx("button",{onClick:s,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]=s,e[4]=c):c=e[4],c}function Nt(o){const e=E.c(2),{breadcrumb:s}=o;let r;return e[0]!==s?(r=t.jsx(me.Header,{children:t.jsx(me.Header.Left,{children:s})}),e[0]=s,e[1]=r):r=e[1],r}function xe(o){const e=E.c(28),{versions:s,selectedIndex:r,onSelect:n,isInstalling:i,variant:c,showLabel:u}=o,d=i===void 0?!1:i,m=c===void 0?"brand":c,I=u===void 0?!1:u,p=s[r],S=I?"sm":"default",j=m==="brand"&&"rounded-l-none px-2 border-l-2 border-l-white/50";let y;e[0]!==j?(y=$e("shrink-0 cursor-pointer",j),e[0]=j,e[1]=y):y=e[1];let f;e[2]!==p?.server?.version||e[3]!==I?(f=I&&t.jsxs("span",{className:"mr-1",children:["v",p?.server?.version||"unknown"]}),e[2]=p?.server?.version,e[3]=I,e[4]=f):f=e[4];const N=I?14:20;let h;e[5]!==N?(h=t.jsx(Ae,{size:N}),e[5]=N,e[6]=h):h=e[6];let x;e[7]!==d||e[8]!==S||e[9]!==y||e[10]!==f||e[11]!==h||e[12]!==m?(x=t.jsx(Be,{asChild:!0,children:t.jsxs(te,{variant:m,disabled:d,size:S,className:y,children:[f,h]})}),e[7]=d,e[8]=S,e[9]=y,e[10]=f,e[11]=h,e[12]=m,e[13]=x):x=e[13];let g;if(e[14]!==d||e[15]!==n||e[16]!==r||e[17]!==s){let C;e[19]!==d||e[20]!==n||e[21]!==r?(C=(v,b)=>{const P=v._meta?.["io.modelcontextprotocol.registry/official"];return t.jsx(Ue,{onClick:()=>n(b),disabled:d,className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"font-medium text-sm",children:["v",v.server?.version||"unknown"]}),P?.isLatest&&t.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),b===r&&t.jsx(Re,{size:16,className:"text-muted-foreground shrink-0"})]})},b)},e[19]=d,e[20]=n,e[21]=r,e[22]=C):C=e[22],g=s.map(C),e[14]=d,e[15]=n,e[16]=r,e[17]=s,e[18]=g}else g=e[18];let _;e[23]!==g?(_=t.jsx(ze,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:g}),e[23]=g,e[24]=_):_=e[24];let w;return e[25]!==x||e[26]!==_?(w=t.jsxs(Oe,{children:[x,_]}),e[25]=x,e[26]=_,e[27]=w):w=e[27],w}function Ct(o){const e=E.c(46),{data:s,itemVersions:r,onInstall:n,canInstall:i,isInstalling:c,hideInstallControls:u,selectedVersionIndex:d,onVersionChange:m}=o,I=i===void 0?!0:i,p=c===void 0?!1:c,S=u===void 0?!1:u,[j,y]=F.useState(0),f=d??j;let N;e[0]!==m?(N=B=>{y(B),m?.(B)},e[0]=m,e[1]=N):N=e[1];const h=N,x=r[f]||r[0];let g;e[2]!==x?.server?.remotes?(g=x?.server?.remotes??[],e[2]=x?.server?.remotes,e[3]=g):g=e[3];const _=g;let w;e[4]!==x?.server?.packages?(w=x?.server?.packages??[],e[4]=x?.server?.packages,e[5]=w):w=e[5];const v=w.length>0,b=_.length>0,P=_.findIndex(wt),a=P>=0?P:0;let M;e[6]!==a||e[7]!==v||e[8]!==b||e[9]!==n||e[10]!==f?(M=()=>{b?n(f,a,void 0):v&&n(f,void 0,0)},e[6]=a,e[7]=v,e[8]=b,e[9]=n,e[10]=f,e[11]=M):M=e[11];const V=M;let H;e[12]!==r||e[13]!==n||e[14]!==h?(H=B=>{h(B);const X=r[B],Z=X?.server?.remotes??[],se=X?.server?.packages??[];if(Z.length>0){const J=Z.findIndex(St);n(B,J>=0?J:0,void 0)}else se.length>0&&n(B,void 0,0)},e[12]=r,e[13]=n,e[14]=h,e[15]=H):H=e[15];const K=H;let R;e[16]!==s.icon||e[17]!==s.name?(R=t.jsx(be,{icon:s.icon,name:s.name,size:"lg",className:"shrink-0 shadow-sm"}),e[16]=s.icon,e[17]=s.name,e[18]=R):R=e[18];let k;e[19]!==s.name?(k=t.jsx("h1",{className:"text-3xl font-medium",children:s.name}),e[19]=s.name,e[20]=k):k=e[20];let T;e[21]!==s.verified?(T=s.verified&&t.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[21]=s.verified,e[22]=T):T=e[22];let A;e[23]!==k||e[24]!==T?(A=t.jsxs("div",{className:"flex items-center gap-2",children:[k,T]}),e[23]=k,e[24]=T,e[25]=A):A=e[25];let D;e[26]!==s.shortDescription?(D=s.shortDescription&&t.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:s.shortDescription}),e[26]=s.shortDescription,e[27]=D):D=e[27];let U;e[28]!==A||e[29]!==D?(U=t.jsxs("div",{className:"flex-1 min-w-0",children:[A,D]}),e[28]=A,e[29]=D,e[30]=U):U=e[30];let z;e[31]!==I||e[32]!==V||e[33]!==K||e[34]!==S||e[35]!==p||e[36]!==r||e[37]!==f||e[38]!==h?(z=I&&!S?t.jsx("div",{className:"shrink-0 flex items-center gap-2",children:r.length>1?t.jsxs("div",{className:"flex",children:[t.jsxs(te,{variant:"brand",onClick:V,disabled:p,className:"shrink-0 rounded-r-none cursor-pointer",children:[t.jsx(fe,{size:20}),p?"Connecting...":"Connect"]}),t.jsx(xe,{versions:r,selectedIndex:f,onSelect:K,isInstalling:p,variant:"brand"})]}):t.jsxs(te,{variant:"brand",onClick:V,disabled:r.length===0||p,className:"shrink-0 cursor-pointer",children:[t.jsx(fe,{size:20}),p?"Connecting...":"Connect"]})}):S?r.length>1?t.jsx("div",{className:"shrink-0",children:t.jsx(xe,{versions:r,selectedIndex:f,onSelect:h,isInstalling:p,variant:"outline",showLabel:!0})}):null:t.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[31]=I,e[32]=V,e[33]=K,e[34]=S,e[35]=p,e[36]=r,e[37]=f,e[38]=h,e[39]=z):z=e[39];let O;e[40]!==U||e[41]!==z?(O=t.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[U,z]}),e[40]=U,e[41]=z,e[42]=O):O=e[42];let G;return e[43]!==O||e[44]!==R?(G=t.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[R,O]}),e[43]=O,e[44]=R,e[45]=G):G=e[45],G}function St(o){return o.type?.toLowerCase()==="http"||o.type?.toLowerCase()==="streamable-http"}function wt(o){return o.type?.toLowerCase()==="http"||o.type?.toLowerCase()==="streamable-http"}function It(o){if(!o)return"—";try{const e=new Date(o);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function _t(o){const e=E.c(47),{data:s,publisherInfo:r,selectedItem:n}=o;let i;e[0]!==s.description?(i=s.description&&t.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[t.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),t.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:s.description})]}),e[0]=s.description,e[1]=i):i=e[1];const c=s.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":s.publisher;let u;e[2]!==r.logo||e[3]!==c?(u=t.jsx(be,{icon:r.logo,name:c,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=r.logo,e[3]=c,e[4]=u):u=e[4];let d;e[5]!==s.publisher?(d=s.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":s.publisher.charAt(0).toUpperCase()+s.publisher.slice(1),e[5]=s.publisher,e[6]=d):d=e[6];let m;e[7]!==d?(m=t.jsx("div",{className:"font-medium",children:d}),e[7]=d,e[8]=m):m=e[8];let I;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("div",{className:"text-xs text-muted-foreground",children:"Publisher"}),e[9]=I):I=e[9];let p;e[10]!==m?(p=t.jsxs("div",{children:[m,I]}),e[10]=m,e[11]=p):p=e[11];let S;e[12]!==u||e[13]!==p?(S=t.jsx("div",{className:"px-5 border-b border-border",children:t.jsxs("div",{className:"flex items-center gap-3 py-5",children:[u,p]})}),e[12]=u,e[13]=p,e[14]=S):S=e[14];let j;e[15]!==s.version?(j=s.version&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Version"}),t.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",s.version]})]}),e[15]=s.version,e[16]=j):j=e[16];let y;e[17]!==s.tags?(y=s.tags&&s.tags.length>0&&t.jsxs("div",{className:"flex justify-between items-start text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Tags"}),t.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:s.tags.map(kt)})]}),e[17]=s.tags,e[18]=y):y=e[18];let f;e[19]!==s.categories?(f=s.categories&&s.categories.length>0&&t.jsxs("div",{className:"flex justify-between items-start text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Categories"}),t.jsx("div",{className:"flex flex-wrap gap-1 justify-end max-w-[60%]",children:s.categories.map(Tt)})]}),e[19]=s.categories,e[20]=f):f=e[20];let N;e[21]!==s.connectionType?(N=s.connectionType&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:s.connectionType})]}),e[21]=s.connectionType,e[22]=N):N=e[22];let h;e[23]!==s.schemaVersion?(h=s.schemaVersion&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),t.jsx("span",{className:"text-muted-foreground text-xs",children:s.schemaVersion})]}),e[23]=s.schemaVersion,e[24]=h):h=e[24];let x;e[25]!==s.websiteUrl?(x=s.websiteUrl&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Website"}),t.jsxs("a",{href:s.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[t.jsx("span",{children:"Visit"}),t.jsx(ue,{size:14})]})]}),e[25]=s.websiteUrl,e[26]=x):x=e[26];let g;e[27]!==s.repository?(g=s.repository?.url&&t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"text-foreground text-sm",children:"Source"}),t.jsxs("a",{href:s.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[t.jsx("span",{children:"GitHub"}),t.jsx(ue,{size:14})]})]}),e[27]=s.repository,e[28]=g):g=e[28];let _;e[29]!==y||e[30]!==f||e[31]!==N||e[32]!==h||e[33]!==x||e[34]!==g||e[35]!==j?(_=t.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[j,y,f,N,h,x,g]}),e[29]=y,e[30]=f,e[31]=N,e[32]=h,e[33]=x,e[34]=g,e[35]=j,e[36]=_):_=e[36];let w;e[37]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[37]=w):w=e[37];let C;e[38]!==n.updated_at?(C=It(n.updated_at),e[38]=n.updated_at,e[39]=C):C=e[39];let v;e[40]!==C?(v=t.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[w,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:C})]}),e[40]=C,e[41]=v):v=e[41];let b;return e[42]!==i||e[43]!==_||e[44]!==v||e[45]!==S?(b=t.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,S,_,v]}),e[42]=i,e[43]=_,e[44]=v,e[45]=S,e[46]=b):b=e[46],b}function Tt(o){return t.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:o},o)}function kt(o){return t.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded",children:o},o)}const Lt=[{value:"http",label:"HTTP"},{value:"sse",label:"SSE"},{value:"stdio",label:"STDIO"},{value:"all",label:"All"}],Pt={docs:"Documentation",bindings:"Workers Bindings",builds:"Workers Builds",observability:"Observability",radar:"Radar",containers:"Containers",browser:"Browser Rendering",logs:"Logpush",autorag:"AutoRAG",auditlogs:"Audit Logs",graphql:"GraphQL",dex:"DEX Monitoring",casb:"CASB"};function Mt(o){if(!o)return"Local";try{return new URL(o).hostname}catch{return o}}function Vt(o){if(!o)return"local";try{const e=new URL(o).hostname;return e.split(".")[0]||e}catch{return"unknown"}}function Dt(o){const e=Pt[o.toLowerCase()];return e||o.replace(/[-_]/g," ").replace(/\b\w/g,s=>s.toUpperCase())}function Et(o){if(!o)return"http";const e=o.toLowerCase();return e==="sse"?"sse":e==="stdio"?"stdio":"http"}function $t(o){return o.map((e,s)=>{const r=Et(e.type),n=Mt(e.url),i=Vt(e.url),c=e.title||e.name||Dt(i);return{index:s,protocol:r,url:e.url,hostname:n,serviceName:i,displayName:c,name:e.name,title:e.title,description:e.description,_type:e._type,_index:e._index}})}function Rt(o){const e=E.c(2),{protocol:s,className:r}=o;let n;return e[0]!==r?(n={http:t.jsx(We,{className:r}),sse:t.jsx(Ke,{className:r}),stdio:t.jsx(Ye,{className:r})},e[0]=r,e[1]=n):n=e[1],n[s]}function At(o){const e=E.c(10),{options:s,selected:r,onSelect:n}=o;if(s.length<=1)return null;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("span",{className:"text-sm text-muted-foreground",children:"Protocol:"}),e[0]=i):i=e[0];let c;if(e[1]!==n||e[2]!==s||e[3]!==r){let d;e[5]!==n||e[6]!==r?(d=m=>t.jsxs(te,{variant:r===m.value?"default":"outline",size:"sm",onClick:()=>n(m.value),className:"cursor-pointer",children:[t.jsx(Rt,{protocol:m.value==="all"?"http":m.value,className:"w-4 h-4 mr-1"}),m.label]},m.value),e[5]=n,e[6]=r,e[7]=d):d=e[7],c=s.map(d),e[1]=n,e[2]=s,e[3]=r,e[4]=c}else c=e[4];let u;return e[8]!==c?(u=t.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[i,t.jsx("div",{className:"flex gap-1",children:c})]}),e[8]=c,e[9]=u):u=e[9],u}function Bt(o){const e=E.c(11),{servers:s,onInstall:r,isInstalling:n,icon:i,mcpName:c,showStdio:u}=o,d=n===void 0?!1:n,m=u===void 0?!1:u,I=m?s:s.filter(Ft),p=$t(I),S=p.length<13?"all":"http",[j,y]=F.useState(S);let f;e:{if(j==="all"){f="all";break e}let a;if(e[0]!==j?(a=V=>V.protocol===j,e[0]=j,e[1]=a):a=e[1],p.some(a)){f=j;break e}if(p.length<13){f="all";break e}f=p[0]?.protocol??"http"}const N=f,h=N==="all"?p:p.filter(a=>a.protocol===N),x=new Set(p.map(Ot));let g=Lt.filter(a=>a.value==="all"||x.has(a.value));m||(g=g.filter(zt));const _=x.size<=1?g.filter(Ut):g,w="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4";let C;e[2]!==i||e[3]!==d||e[4]!==c||e[5]!==r?(C=a=>t.jsx(qe,{variant:"server",icon:i??null,displayName:a.displayName,description:a.description??null,hostname:a.hostname,protocol:a.protocol,isInstalling:d,onClick:()=>r({type:a.protocol,url:a.url,name:a.name,title:a.title,description:a.description,_type:a._type,_index:a._index})},`${a.hostname}-${a.protocol}-${a.index}`),e[2]=i,e[3]=d,e[4]=c,e[5]=r,e[6]=C):C=e[6];const v=h.map(C);let b;e[7]!==v?(b=t.jsx("div",{className:w,children:v}),e[7]=v,e[8]=b):b=e[8];let P;return e[9]!==h.length?(P=h.length===0&&t.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No servers match the selected filter."}),e[9]=h.length,e[10]=P):P=e[10],t.jsxs("div",{className:"p-5",children:[t.jsx(At,{options:_,selected:N,onSelect:y}),b,P]})}function Ut(o){return o.value!=="all"}function zt(o){return o.value!=="stdio"}function Ot(o){return o.protocol}function Ft(o){return o.type?.toLowerCase()!=="stdio"}function Ht(o){const e=E.c(29),{data:s,availableTabs:r,effectiveActiveTabId:n,effectiveTools:i,isLoadingTools:c,onTabChange:u,servers:d,onInstallServer:m,isInstalling:I,mcpIcon:p,mcpName:S,showStdio:j}=o,y=c===void 0?!1:c;let f;e[0]!==d?(f=d===void 0?[]:d,e[0]=d,e[1]=f):f=e[1];const N=f,h=I===void 0?!1:I,x=j===void 0?!1:j;let g;e[2]!==i?(g=i.map(Gt),e[2]=i,e[3]=g):g=e[3];const _=g;let w;e[4]!==r||e[5]!==n||e[6]!==u?(w=r.length>0&&t.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:t.jsx(Ge,{tabs:r,activeTab:n,onTabChange:u})}),e[4]=r,e[5]=n,e[6]=u,e[7]=w):w=e[7];let C;e[8]!==n||e[9]!==h||e[10]!==p||e[11]!==S||e[12]!==m||e[13]!==N||e[14]!==x?(C=n==="servers"&&N.length>0&&t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(Bt,{servers:N,onInstall:a=>m?.(a),isInstalling:h,icon:p,mcpName:S,showStdio:x})}),e[8]=n,e[9]=h,e[10]=p,e[11]=S,e[12]=m,e[13]=N,e[14]=x,e[15]=C):C=e[15];let v;e[16]!==n||e[17]!==i.length||e[18]!==y||e[19]!==_?(v=n==="tools"&&t.jsx("div",{className:"flex flex-col flex-1",children:y?t.jsxs("div",{className:"flex items-center justify-center p-8",children:[t.jsx(ve,{size:24,className:"animate-spin"}),t.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?t.jsx(Fe,{tools:_,showToolbar:!1,emptyMessage:"This MCP Server doesn't have any tools."}):t.jsx(Ee,{image:null,title:"No tools available",description:"This MCP Server doesn't have any tools."})}),e[16]=n,e[17]=i.length,e[18]=y,e[19]=_,e[20]=v):v=e[20];let b;e[21]!==s?.repository||e[22]!==n?(b=n==="readme"&&t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(He,{repository:s?.repository})}),e[21]=s?.repository,e[22]=n,e[23]=b):b=e[23];let P;return e[24]!==b||e[25]!==w||e[26]!==C||e[27]!==v?(P=t.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[w,C,v,b]}),e[24]=b,e[25]=w,e[26]=C,e[27]=v,e[28]=P):P=e[28],P}function Gt(o){const e=o;return{name:e.name||"",description:e.description||void 0}}function Wt(o,e){if(!o||!e)return;const s=e.toLowerCase();return o.find(r=>r.app_name?.toLowerCase()===s||r.app_id?.toLowerCase()===s||r.title.toLowerCase()===s)||o.find(r=>r.title.toLowerCase().includes(s))}function qt(o,e,s,r,n){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:r?.icon||void 0,count:n??o.length};const i=e.toLowerCase(),c=o.filter(d=>(d._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":d.publisher||d._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:s?.icon||c[0]?.publisher_logo||c[0]?.icon||void 0,count:c.length}}function Kt(o){const e=o._meta?.["mcp.mesh"],s=o._meta?.["io.modelcontextprotocol.registry/official"],r=o.server,n=ht(r.remotes?.[0]?.type),i=gt(r.$schema),c=s?"io.modelcontextprotocol.registry/official":o.publisher||e?.scopeName||"Unknown",u=pt(r.repository),d=o.icon||o.image||o.logo||r.icons?.[0]?.src||u||null,m=o.name||o.title||o.server?.title||"Unnamed Item",I=Qe(m),p=e?.friendly_name||I,S=e?.mesh_description||o.description||o.summary||r?.description||"",j=e?.short_description||null,y=e?.tags||[],f=e?.categories||[];return{name:p,description:S,shortDescription:j,icon:d,verified:o.verified||e?.verified,publisher:c,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:i??null,connectionType:n,connectionUrl:null,remoteUrl:null,tags:y,categories:f,tools:o.tools||r.tools||e?.tools||[],models:o.models||r.models||e?.models||[],emails:o.emails||r.emails||e?.emails||[],analytics:o.analytics||r.analytics||e?.analytics,cdn:o.cdn||r.cdn||e?.cdn}}class Qt extends F.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,s){console.error("Store MCP server detail error:",e,s)}render(){return this.state.hasError?t.jsx(jt,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function Yt(){const{org:o}=he(),e=ge(),{appName:s}=ke({strict:!1}),{registryId:r,serverName:n,stdio:i}=Le({strict:!1}),[c,u]=ct(dt.storeShowStdio(),()=>!1),d=i==="true"?!0:i==="false"?!1:c;i!==void 0&&i==="true"!==c&&u(i==="true");const[m,I]=F.useState(null),[p,S]=F.useState(null),j=rt(),y=nt(),{data:f}=Pe.useSession(),N=st(y),h=r||N[0]?.id||"",x=it(h),g=xt(x?.tools),_=x?.tools&&x.tools.find(L=>L.name.endsWith("_VERSIONS"))?.name||"",w=x?.tools&&x.tools.find(L=>L.name.endsWith("_GET"))?.name||"",C=!!n;let v="",b={};C?(v=_||w,b={name:n}):(v=g,b={});const P=at({connectionId:h||null,orgId:o.id}),{data:a}=lt({client:P,toolName:v,toolArguments:b,select:l=>l.structuredContent??l});let M=[],V=[],H=null;if(a){if(Array.isArray(a))M=a;else if(typeof a=="object"&&a!==null)if("totalCount"in a&&typeof a.totalCount=="number"&&(H=a.totalCount),"item"in a&&a.item){const l=a.item;M=[{id:l.id||"",title:l.title,server:l.server,_meta:l._meta}]}else{let l;"versions"in a&&Array.isArray(a.versions)?l="versions":"servers"in a&&Array.isArray(a.servers)?l="servers":l=Object.keys(a).find(L=>Array.isArray(a[L])),l&&(M=a[l],(l==="versions"||v?.includes("VERSIONS"))&&(V=M))}}const K=(()=>{const l=V.findIndex(L=>L._meta?.["io.modelcontextprotocol.registry/official"]?.isLatest===!0);return l>=0?l:0})(),R=p??K;let k=M.find(l=>{const L=l.name||l.title||l.server.title||"";return ft(L)===s});!k&&n&&(k=M.find(l=>l.server.name===n||l.name===n||l.title===n));const T=k?Kt(k):null,A=(T?.tools?.length||0)>0,D=k?.server?.remotes?.[0]?.url||null,U=!A&&!!D,z=ot({queryKey:Me.remoteMcpTools(D),queryFn:async()=>{if(!D)return[];const{Client:l}=await ce(async()=>{const{Client:$}=await import("./index-DkVMZPZp.js").then(q=>q.cp);return{Client:$}},__vite__mapDeps([0,1])),{StreamableHTTPClientTransport:L}=await ce(async()=>{const{StreamableHTTPClientTransport:$}=await import("./index-Bgvel9yL.js");return{StreamableHTTPClientTransport:$}},__vite__mapDeps([2,0,1,3,4,5,6,7,8,9])),W=new l({name:"mesh-store",version:"1.0.0"}),ee=new L(new URL(D),{requestInit:{headers:{Accept:"application/json, text/event-stream","Content-Type":"application/json"}}});try{return await W.connect(ee),((await W.listTools()).tools||[]).map(q=>({name:q.name,description:q.description}))}finally{await W.close().catch(console.error)}},enabled:U}),O=U&&z.isLoading,G=z.data??[],B=A?T?.tools||[]:G,X=Wt(y,T?.publisher),Z=T?qt(M,T.publisher,X,x??null,H):{count:0},se=T?.repository?ut(T.repository):null,ne=k?.server?.remotes??[],J=k?.server?.packages??[],oe=[...ne.map((l,L)=>({...l,_type:"remote",_index:L})),...J.map((l,L)=>({type:"stdio",url:void 0,name:l.name||l.identifier,title:l.name||l.identifier?.replace(/^@[^/]+\//,""),description:l.environmentVariables?.length?`Requires ${l.environmentVariables.length} environment variable(s)`:void 0,_type:"package",_index:L}))],ie=d?oe:oe.filter(l=>l.type?.toLowerCase()!=="stdio"),le=ie.length>1,Q=[{id:"servers",label:"Servers",count:ie.length,visible:le},{id:"readme",label:"README",visible:!!T?.repository&&!!se},{id:"tools",label:"Tools",count:B.length,visible:A||G.length>0||O&&!!D}].filter(l=>l.visible),ye=Q.find(l=>l.id==="servers")?.id||Q.find(l=>l.id==="readme")?.id||Q[0]?.id||"overview",Ne=m&&Q.find(l=>l.id===m)?m:ye,re=async(l,L,W)=>{const ee=V[l??0]||k;if(!ee||!o||!f?.user?.id)return;const $=mt(ee,o.id,f.user.id,{remoteIndex:W===void 0?L??0:void 0,packageIndex:W}),q=$.connection_type==="STDIO",_e=!!$.connection_url,Te=q&&$.connection_headers&&typeof $.connection_headers=="object"&&"command"in $.connection_headers;if(!_e&&!Te){de.error("This MCP Server cannot be connected: no connection method available");return}try{const{id:Y}=await j.create.mutateAsync($);e({to:"/$org/mcps/$connectionId",params:{org:o.slug,connectionId:Y}})}catch(Y){de.error(`Failed to connect MCP Server: ${Y instanceof Error?Y.message:String(Y)}`)}},Ce=()=>{e({to:"/$org/store",params:{org:o.slug}})};if(!k)return t.jsx(yt,{onBack:Ce});if(!T)return null;const Se=(k?.server?.remotes?.length??0)>0,we=(k?.server?.packages?.length??0)>0,ae=Se||we,Ie=t.jsx(Xe,{children:t.jsxs(Ze,{children:[t.jsx(pe,{children:t.jsx(Je,{asChild:!0,children:t.jsx(Ve,{to:"/$org/store",params:{org:o.slug},children:"Store"})})}),t.jsx(et,{}),t.jsx(pe,{children:t.jsx(tt,{children:T.name})})]})});return t.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[t.jsx(Nt,{breadcrumb:Ie}),t.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:t.jsx("div",{className:"h-full",children:t.jsxs("div",{className:"h-full",children:[!ae&&t.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[t.jsx(vt,{size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t.jsx(Ct,{data:T,itemVersions:V.length>0?V:[k],onInstall:re,canInstall:ae,isInstalling:j.create.isPending,hideInstallControls:le,selectedVersionIndex:R,onVersionChange:S}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[t.jsx(_t,{data:T,publisherInfo:Z,selectedItem:k}),t.jsx(Ht,{data:T,availableTabs:Q,effectiveActiveTabId:Ne,effectiveTools:B,isLoadingTools:O,onTabChange:I,servers:oe,onInstallServer:l=>{l._type==="remote"?re(R,l._index,void 0):re(R,void 0,l._index)},isInstalling:j.create.isPending,mcpIcon:T.icon,mcpName:T.name,showStdio:d})]})]})})})]})}function Hs(){const o=E.c(6),{org:e}=he(),s=ge();let r;o[0]!==s||o[1]!==e.slug?(r=()=>{s({to:"/$org/store",params:{org:e.slug}})},o[0]=s,o[1]=e.slug,o[2]=r):r=o[2];const n=r;let i;o[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(F.Suspense,{fallback:t.jsx(bt,{}),children:t.jsx(Yt,{})}),o[3]=i):i=o[3];let c;return o[4]!==n?(c=t.jsx(Qt,{onBack:n,children:i}),o[4]=n,o[5]=c):c=o[5],c}export{Hs as default};
|