@decocms/mesh 1.0.0-alpha.45 → 1.0.0-alpha.46
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-DVbk7l75.js → AlertCircle-Cu9USDUK.js} +1 -1
- package/dist/client/assets/{ArrowLeft-B2q5Ncqe.js → ArrowLeft-nKBVB_NL.js} +1 -1
- package/dist/client/assets/{CheckCircle-2faIvy7x.js → CheckCircle-BogvGi-0.js} +1 -1
- package/dist/client/assets/{ChevronDown-BAEvQsP1.js → ChevronDown-B5vWNgW1.js} +1 -1
- package/dist/client/assets/{Clock-BkOYcDQ1.js → Clock-Ck2lYkyl.js} +1 -1
- package/dist/client/assets/{Copy01-CwQ47sCB.js → Copy01-BeUF9LPk.js} +1 -1
- package/dist/client/assets/{CpuChip02-Bxoen-sS.js → CpuChip02-8BkRby_U.js} +1 -1
- package/dist/client/assets/{DotsVertical-Rjkn1qAc.js → DotsVertical-CmKPHj4W.js} +1 -1
- package/dist/client/assets/{File06-Cml7_jh5.js → File06-Cn7JLPIx.js} +1 -1
- package/dist/client/assets/{Grid01-iXkiGD-C.js → Grid01-4uSGUJjV.js} +1 -1
- package/dist/client/assets/{Inbox01-48LwpeyS.js → Inbox01-C8nofD1D.js} +1 -1
- package/dist/client/assets/{InfoCircle-Db_224Lw.js → InfoCircle-C21KXVBJ.js} +1 -1
- package/dist/client/assets/{Key01-BBl7lwdX.js → Key01-CzDrcb2u.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CGdbeXVa.js → LinkExternal01-DhNFEAza.js} +1 -1
- package/dist/client/assets/{Loading01-EBx-peK5.js → Loading01-BUZAT-Ht.js} +1 -1
- package/dist/client/assets/{Plus-fvCbDfFA.js → Plus-DTWKiMkv.js} +1 -1
- package/dist/client/assets/{SearchMd-CoQHJpld.js → SearchMd-BXC4Yoz_.js} +1 -1
- package/dist/client/assets/{Trash01-B-JvszLz.js → Trash01-KhsmIXrl.js} +1 -1
- package/dist/client/assets/{Upload01-CFmdCG3U.js → Upload01-Dm3ykMHj.js} +1 -1
- package/dist/client/assets/{X-EXSAob0c.js → X-BFstV52u.js} +1 -1
- package/dist/client/assets/{XClose-JKlhATZH.js → XClose-OisY7Sog.js} +1 -1
- package/dist/client/assets/{alert-dialog-BuGENs_x.js → alert-dialog-Ck-TQRXx.js} +2 -2
- package/dist/client/assets/{auth-EiU0mg3W.js → auth-DB_JGgAS.js} +1 -1
- package/dist/client/assets/{auth-catchall-J-s0UOos.js → auth-catchall-DDvXFYk4.js} +1 -1
- package/dist/client/assets/{avatar-ChLJBc_Q.js → avatar-CqnXtnOZ.js} +1 -1
- package/dist/client/assets/{badge-xSWfUH8C.js → badge-RGvdF-cd.js} +1 -1
- package/dist/client/assets/{button-DkKLNB2C.js → button-Chm7HSn5.js} +1 -1
- package/dist/client/assets/{card-pUBjGsjy.js → card-BVamKRXq.js} +1 -1
- package/dist/client/assets/{checkbox-CkDtf7-s.js → checkbox-BMbqVqRo.js} +1 -1
- package/dist/client/assets/{collection-detail-C5kf9NWv.js → collection-detail-UyMhNT0c.js} +1 -1
- package/dist/client/assets/{collection-display-button-DOaNnrf1.js → collection-display-button-DDw_0fW6.js} +1 -1
- package/dist/client/assets/{collection-header-BjOsszVr.js → collection-header-BVYMmoel.js} +1 -1
- package/dist/client/assets/{collection-page-BoULTFo5.js → collection-page-BoS9hpji.js} +1 -1
- package/dist/client/assets/{collection-search-BaQnC0wl.js → collection-search-CBHWh6W9.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CWSD0OK_.js → collection-table-wrapper-CGsO_-78.js} +1 -1
- package/dist/client/assets/{connection-card-ChEGdD3i.js → connection-card-D6fhK6Cn.js} +1 -1
- package/dist/client/assets/connection-detail-ClFH3Tdf.js +1 -0
- package/dist/client/assets/{connections-BcVb3yyx.js → connections-BtC-4KRY.js} +1 -1
- package/dist/client/assets/{core-DEFgD5b5.js → core-BiybLldu.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CJAzmA5E.js → create-organization-dialog-D3ZZuPXS.js} +1 -1
- package/dist/client/assets/{deco-chat-skeleton-DdumS19s.js → deco-chat-skeleton-DHRag8GN.js} +3 -3
- package/dist/client/assets/{dialog-D5ajYIuQ.js → dialog-kXtxooG_.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BwfRJqX3.js → dropdown-menu-MeaPHHuN.js} +1 -1
- package/dist/client/assets/{error-boundary-Ctu3eNTK.js → error-boundary-m5kquR9K.js} +1 -1
- package/dist/client/assets/{extract-connection-data-fIUwUi9M.js → extract-connection-data-BSn-ydRW.js} +1 -1
- package/dist/client/assets/{form-DGgpciyh.js → form-BBS_Tp5l.js} +1 -1
- package/dist/client/assets/formatDistanceToNow-Dkl3nWpl.js +1 -0
- package/dist/client/assets/gateway-detail-B6IgcRfH.js +1 -0
- package/dist/client/assets/{gateways-Ct2Ku_EE.js → gateways-Bu8MP7ql.js} +1 -1
- package/dist/client/assets/{home-Go7erQGg.js → home-BYCoW2D_.js} +1 -1
- package/dist/client/assets/{index-CgAMfaaZ.js → index-BZz7aGs7.js} +1 -1
- package/dist/client/assets/{index-CzwYLjKx.js → index-C4a1DvcM.js} +15 -15
- package/dist/client/assets/index-RS2MPOun.js +1 -0
- package/dist/client/assets/{index-CgmRhymO.js → index-hySmljwG.js} +1 -1
- package/dist/client/assets/{input-BGhWl8yr.js → input-DCV4VviT.js} +1 -1
- package/dist/client/assets/json-CtxcuNHM.js +1 -0
- package/dist/client/assets/{json-syntax-highlighter-eop-YGrL.js → json-syntax-highlighter-VMspUwuH.js} +2 -2
- package/dist/client/assets/{layout-H0Bo8Mbp.js → layout-BkDVhV_I.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-BivZS2NT.js → lazy-highlighter-Bx9tA9px.js} +1 -1
- package/dist/client/assets/{localstorage-keys-T4QN4Ys2.js → localstorage-keys-G21128-2.js} +1 -1
- package/dist/client/assets/{login-s7Y9QERd.js → login-DEwqVT25.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BpODx-Yp.js → mcp-oauth-Cm2UNUay.js} +1 -1
- package/dist/client/assets/{members-YsCX_fsX.js → members-BpGlve-L.js} +1 -1
- package/dist/client/assets/{monitoring-DLmYpM2E.js → monitoring-DHEto-A6.js} +1 -1
- package/dist/client/assets/{oauth-callback-J1YUg9b4.js → oauth-callback-DchNKQy2.js} +1 -1
- package/dist/client/assets/{page-BnR6MH5w.js → page-DGoTXd70.js} +1 -1
- package/dist/client/assets/{popover-C7aR-HSJ.js → popover-Cx3pFfUQ.js} +1 -1
- package/dist/client/assets/prism-light-DhG4KyCm.js +1 -0
- package/dist/client/assets/{resource-tabs-DetRi2Tz.js → resource-tabs-n23Yoxcd.js} +1 -1
- package/dist/client/assets/{schema-DefbPj25.js → schema-DIY49r7a.js} +1 -1
- package/dist/client/assets/{select-C-8wPfQb.js → select-BXHiOY7b.js} +1 -1
- package/dist/client/assets/{settings-lBAYGURO.js → settings-BwVTvZ32.js} +1 -1
- package/dist/client/assets/{shell-layout-BURBkVcQ.js → shell-layout-BqZsnuW0.js} +1 -1
- package/dist/client/assets/{spinner-C91qSR1a.js → spinner-zi1IadXF.js} +1 -1
- package/dist/client/assets/{store-Dbm237Pg.js → store-Bu-y0GHn.js} +1 -1
- package/dist/client/assets/{store-app-detail-YHVcg9Z1.js → store-app-detail-BswrVEFL.js} +1 -1
- package/dist/client/assets/{switch-BYhk4sLo.js → switch-C8nDXRDi.js} +1 -1
- package/dist/client/assets/{textarea-BPpOx-7u.js → textarea-BA6caASm.js} +1 -1
- package/dist/client/assets/{tools-list-De28L5_g.js → tools-list-Cw4QW2l7.js} +1 -1
- package/dist/client/assets/{tooltip-CRtbHuaD.js → tooltip-DZ8PMo3S.js} +1 -1
- package/dist/client/assets/{types-B0H390FJ.js → types-DsEr-_hk.js} +1 -1
- package/dist/client/assets/{use-binding-BZo_dE4c.js → use-binding-C1zXgwae.js} +2 -2
- package/dist/client/assets/{use-connection-D2GoBb_z.js → use-connection-8aFd9ZgQ.js} +1 -1
- package/dist/client/assets/use-connection-resources-BaWWtVSI.js +1 -0
- package/dist/client/assets/{use-gateway-CJINNdSX.js → use-gateway-BGsZlt6a.js} +1 -1
- package/dist/client/assets/{use-list-state-BjDzxCt9.js → use-list-state-DhJWwg48.js} +1 -1
- package/dist/client/assets/{use-mcp-BBboucHu.js → use-mcp-BJzX7M7c.js} +1 -1
- package/dist/client/assets/{use-members-DsKRDzl_.js → use-members-BNSWYzmJ.js} +1 -1
- package/dist/client/assets/{use-mobile-B89ZoGbj.js → use-mobile-BQAr1bEF.js} +1 -1
- package/dist/client/assets/{use-organization-settings-C32KUUMU.js → use-organization-settings-CAOHB7nk.js} +1 -1
- package/dist/client/assets/{use-tool-call-B6UiQKbH.js → use-tool-call-Dxebi6Uq.js} +1 -1
- package/dist/client/assets/useQuery-39cprZL6.js +1 -0
- package/dist/client/assets/utils-BXNVuJET.js +1 -0
- package/dist/client/assets/{well-known-mcp-DBI1FVpY.js → well-known-mcp-DizRQm94.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/connection-detail-BzeSW6yw.js +0 -1
- package/dist/client/assets/formatDistanceToNow-Do6wCvgQ.js +0 -1
- package/dist/client/assets/gateway-detail-dibsJ_Dr.js +0 -1
- package/dist/client/assets/index-Cg6DdXuN.js +0 -1
- package/dist/client/assets/json-xSSJeQ8M.js +0 -1
- package/dist/client/assets/prism-light-qQIH26P8.js +0 -1
- package/dist/client/assets/useQuery-CbqX0Fzv.js +0 -1
- package/dist/client/assets/utils-D1FAHWbf.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as $,c as O,j as L,Z as z,q as k,K as x,t as I}from"./index-
|
|
1
|
+
import{r as $,c as O,j as L,Z as z,q as k,K as x,t as I}from"./index-C4a1DvcM.js";import{c as N}from"./utils-BXNVuJET.js";import{u as b}from"./tooltip-DZ8PMo3S.js";import{u as j}from"./button-Chm7HSn5.js";const Q=({size:n=24,color:e="currentColor",...r})=>$.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},$.createElement("path",{d:"M20.5 7.278 12 12m0 0L3.5 7.278M12 12v9.5m9-5.441V7.942c0-.343 0-.514-.05-.667a1 1 0 0 0-.215-.364c-.109-.119-.258-.202-.558-.368l-7.4-4.111c-.284-.158-.425-.237-.575-.267a1 1 0 0 0-.403 0c-.15.03-.292.11-.576.267l-7.4 4.11c-.3.167-.45.25-.558.369a1 1 0 0 0-.215.364C3 7.428 3 7.599 3 7.942v8.117c0 .342 0 .514.05.666a1 1 0 0 0 .215.364c.109.119.258.202.558.368l7.4 4.111c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l7.4-4.11c.3-.167.45-.25.558-.369a.999.999 0 0 0 .215-.364c.05-.152.05-.324.05-.666Z"}));Q.displayName="Container";const A={xs:"h-6 w-6",sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16"},U={xs:"min-w-6",sm:"min-w-8",md:"min-w-12",lg:"min-w-16"},D={xs:12,sm:16,md:24,lg:32};function ne(n){const e=O.c(7),{icon:r,name:t,size:s,className:i,fallbackIcon:o}=n,a=s===void 0?"md":s,c=r??"no-icon";let l;return e[0]!==i||e[1]!==o||e[2]!==r||e[3]!==t||e[4]!==a||e[5]!==c?(l=L.jsx(W,{icon:r,name:t,size:a,className:i,fallbackIcon:o},c),e[0]=i,e[1]=o,e[2]=r,e[3]=t,e[4]=a,e[5]=c,e[6]=l):l=e[6],l}function W(n){const e=O.c(24),{icon:r,name:t,size:s,className:i,fallbackIcon:o}=n,a=s===void 0?"md":s,[c,l]=$.useState(!1),u=!!r&&c,f=A[a],p=U[a];let w;e[0]!==i||e[1]!==f||e[2]!==p?(w=N("rounded-lg border border-border shrink-0 overflow-hidden",f,p,i),e[0]=i,e[1]=f,e[2]=p,e[3]=w):w=e[3];const h=r||void 0,g=!u&&"hidden";let E;e[4]!==g?(E=N("h-full w-full object-cover",g),e[4]=g,e[5]=E):E=e[5];let T,S;e[6]===Symbol.for("react.memo_cache_sentinel")?(T=()=>l(!1),S=()=>l(!0),e[6]=T,e[7]=S):(T=e[6],S=e[7]);let d;e[8]!==t||e[9]!==h||e[10]!==E?(d=L.jsx("img",{src:h,alt:t,className:E,onError:T,onLoad:S}),e[8]=t,e[9]=h,e[10]=E,e[11]=d):d=e[11];const v=u&&"hidden";let y;e[12]!==v?(y=N("h-full w-full flex items-center justify-center bg-muted/20",v),e[12]=v,e[13]=y):y=e[13];let C;e[14]!==o||e[15]!==a?(C=o??L.jsx(Q,{size:D[a],className:"text-muted-foreground"}),e[14]=o,e[15]=a,e[16]=C):C=e[16];let m;e[17]!==y||e[18]!==C?(m=L.jsx("div",{className:y,children:C}),e[17]=y,e[18]=C,e[19]=m):m=e[19];let _;return e[20]!==d||e[21]!==m||e[22]!==w?(_=L.jsxs("div",{className:w,children:[d,m]}),e[20]=d,e[21]=m,e[22]=w,e[23]=_):_=e[23],_}const B="UNKNOWN_CONNECTION_ID",J=async n=>{const r=(await n.text()).split(`
|
|
2
2
|
`).find(s=>s.startsWith("data: "));if(!r)throw new Error("No data received from the server");return JSON.parse(r.replace("data: ",""))};function q(n){if(n===B)return(async()=>{});const e=n?`/mcp/${n}`:"/mcp";return async(r,t)=>{const s=await fetch(e,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/call",params:{name:r,arguments:t}}),headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream"},credentials:"include"});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);const i=s.headers.get("Content-Type")==="application/json"?await s.json():await J(s);if(i.result?.isError)throw new Error(i.result.content?.[0]?.text||"Tool call failed");return i.result?.structuredContent||i.result}}function M(n,e,r){const t=[];if(n?.trim()){const s=n.trim(),i=r.map(o=>({field:[String(o)],operator:"contains",value:s}));i.length===1&&i[0]?t.push(i[0]):i.length>1&&t.push({operator:"or",conditions:i})}if(e&&e.length>0)for(const s of e)t.push({field:[s.column],operator:"eq",value:s.value});if(t.length!==0)return t.length===1?t[0]:{operator:"and",conditions:t}}function R(n,e,r){const t=n??r,s=e??"asc";return[{field:[String(t)],direction:s}]}function Z(n,e,r,t){const s=O.c(13);let i;s[0]!==e?(i=e.toUpperCase(),s[0]=e,s[1]=i):i=s[1];const a=`COLLECTION_${i}_GET`;let c;s[2]!==e||s[3]!==r||s[4]!==n?(c=x.collectionItem(n,e,r??""),s[2]=e,s[3]=r,s[4]=n,s[5]=c):c=s[5];let l;s[6]!==a||s[7]!==r||s[8]!==t?(l=async()=>r?await t(a,{id:r}):{item:null},s[6]=a,s[7]=r,s[8]=t,s[9]=l):l=s[9];let u;s[10]!==c||s[11]!==l?(u={queryKey:c,queryFn:l,staleTime:6e4},s[10]=c,s[11]=l,s[12]=u):u=s[12];const{data:f}=k(u);return f.item}function H(n,e,r,t){const s=O.c(20);let i,o,a,c,l,u;if(s[0]!==e||s[1]!==n||s[2]!==t){const h=t===void 0?{}:t,{searchTerm:g,filters:E,sortKey:T,sortDirection:S,searchFields:d,defaultSortKey:v,pageSize:y}=h,C=d===void 0?["title","description"]:d,m=v===void 0?"updated_at":v;a=y===void 0?100:y;let _;s[9]!==e?(_=e.toUpperCase(),s[9]=e,s[10]=_):_=s[10],i=`COLLECTION_${_}_LIST`,u=M(g,E,C),o=R(T,S,m);const P=JSON.stringify({where:u,orderBy:o,limit:a});l=k,c=x.collectionList(n,e,P),s[0]=e,s[1]=n,s[2]=t,s[3]=i,s[4]=o,s[5]=a,s[6]=c,s[7]=l,s[8]=u}else i=s[3],o=s[4],a=s[5],c=s[6],l=s[7],u=s[8];let f;s[11]!==i||s[12]!==o||s[13]!==a||s[14]!==r||s[15]!==u?(f=async()=>{const h={...u&&{where:u},...o&&{orderBy:o},limit:a,offset:0};return await r(i,h)??[]},s[11]=i,s[12]=o,s[13]=a,s[14]=r,s[15]=u,s[16]=f):f=s[16];let p;s[17]!==c||s[18]!==f?(p={queryKey:c,queryFn:f},s[17]=c,s[18]=f,s[19]=p):p=s[19];const{data:w}=l(p);return w.items}function G(n,e,r){const t=O.c(36),s=z();let i;t[0]!==e?(i=e.toUpperCase(),t[0]=e,t[1]=i):i=t[1];const o=i,a=`COLLECTION_${o}_CREATE`,c=`COLLECTION_${o}_UPDATE`,l=`COLLECTION_${o}_DELETE`;let u;t[2]!==a||t[3]!==r?(u=async m=>(await r(a,{data:m})).item,t[2]=a,t[3]=r,t[4]=u):u=t[4];let f;t[5]!==e||t[6]!==s||t[7]!==n?(f=()=>{s.invalidateQueries({queryKey:x.collectionListPrefix(n,e)}),s.invalidateQueries({queryKey:x.collectionListInfinitePrefix(n,e)}),I.success("Item created successfully")},t[5]=e,t[6]=s,t[7]=n,t[8]=f):f=t[8];let p;t[9]!==u||t[10]!==f?(p={mutationFn:u,onSuccess:f,onError:Y},t[9]=u,t[10]=f,t[11]=p):p=t[11];const w=j(p);let h;t[12]!==r||t[13]!==c?(h=async m=>{const{id:_,data:F}=m;return(await r(c,{id:_,data:F})).item},t[12]=r,t[13]=c,t[14]=h):h=t[14];let g;t[15]!==e||t[16]!==s||t[17]!==n?(g=m=>{s.invalidateQueries({queryKey:x.collectionListPrefix(n,e)}),s.invalidateQueries({queryKey:x.collectionListInfinitePrefix(n,e)}),s.invalidateQueries({queryKey:x.collectionItem(n,e,m.id)}),I.success("Item updated successfully")},t[15]=e,t[16]=s,t[17]=n,t[18]=g):g=t[18];let E;t[19]!==h||t[20]!==g?(E={mutationFn:h,onSuccess:g,onError:V},t[19]=h,t[20]=g,t[21]=E):E=t[21];const T=j(E);let S;t[22]!==l||t[23]!==r?(S=async m=>(await r(l,{id:m})).item.id,t[22]=l,t[23]=r,t[24]=S):S=t[24];let d;t[25]!==e||t[26]!==s||t[27]!==n?(d=()=>{s.invalidateQueries({queryKey:x.collectionListPrefix(n,e)}),s.invalidateQueries({queryKey:x.collectionListInfinitePrefix(n,e)}),I.success("Item deleted successfully")},t[25]=e,t[26]=s,t[27]=n,t[28]=d):d=t[28];let v;t[29]!==S||t[30]!==d?(v={mutationFn:S,onSuccess:d,onError:K},t[29]=S,t[30]=d,t[31]=v):v=t[31];const y=j(v);let C;return t[32]!==w||t[33]!==y||t[34]!==T?(C={create:w,update:T,delete:y},t[32]=w,t[33]=y,t[34]=T,t[35]=C):C=t[35],C}function K(n){const e=n instanceof Error?n.message:String(n);I.error(`Failed to delete item: ${e}`)}function V(n){const e=n instanceof Error?n.message:String(n);I.error(`Failed to update item: ${e}`)}function Y(n){const e=n instanceof Error?n.message:String(n);I.error(`Failed to create item: ${e}`)}function re(n){const e=O.c(3);let r;e[0]!==n?(r=n===void 0?{}:n,e[0]=n,e[1]=r):r=e[1];const t=r,{org:s}=b();let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=q(),e[2]=i):i=e[2];const o=i;return H(s.slug,"CONNECTIONS",o,t)}function ie(n){const e=O.c(1),{org:r}=b();let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=q(),e[0]=t):t=e[0];const s=t;return Z(r.slug,"CONNECTIONS",n,s)}function oe(){const n=O.c(1),{org:e}=b();let r;n[0]===Symbol.for("react.memo_cache_sentinel")?(r=q(),n[0]=r):r=n[0];const t=r;return G(e.slug,"CONNECTIONS",t)}export{ne as I,B as U,oe as a,ie as b,q as c,G as d,H as e,Z as f,Q as n,re as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as f,K as l}from"./index-C4a1DvcM.js";import{u as y}from"./formatDistanceToNow-Dkl3nWpl.js";async function h(t){const e=`/mcp/${t}`,s={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};try{const o=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-prompts",version:"1.0.0"}}})});if(!o.ok)return[];if((await o.json()).error)return[];const i=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"prompts/list",params:{}})});if(!i.ok)return[];const r=await i.json();return r.error?[]:r.result?.prompts||[]}catch{return[]}}function P(t){const e=f.c(13);let s;e[0]!==t?(s=t.map(q),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s?(o={queries:s},e[2]=s,e[3]=o):o=e[3];const n=y(o);let i,r;if(e[4]!==t||e[5]!==n){r=new Map;let p;e[8]!==n?(p=n.some(j),e[8]=n,e[9]=p):p=e[9],i=p,t.forEach((u,m)=>{const c=n[m];c?.data?r.set(u,c.data.map(d)):r.set(u,[])}),e[4]=t,e[5]=n,e[6]=i,e[7]=r}else i=e[6],r=e[7];let a;return e[10]!==i||e[11]!==r?(a={promptsMap:r,isLoading:i},e[10]=i,e[11]=r,e[12]=a):a=e[12],a}function d(t){return{name:t.name,description:t.description}}function j(t){return t.isLoading}function q(t){return{queryKey:l.connectionPrompts(t),queryFn:()=>h(t),staleTime:6e4,retry:!1}}async function w(t){const e=`/mcp/${t}`,s={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};try{const o=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-resources",version:"1.0.0"}}})});if(!o.ok)return[];if((await o.json()).error)return[];const i=await fetch(e,{method:"POST",headers:s,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"resources/list",params:{}})});if(!i.ok)return[];const r=await i.json();return r.error?[]:r.result?.resources||[]}catch{return[]}}function $(t){const e=f.c(13);let s;e[0]!==t?(s=t.map(O),e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s?(o={queries:s},e[2]=s,e[3]=o):o=e[3];const n=y(o);let i,r;if(e[4]!==t||e[5]!==n){r=new Map;let p;e[8]!==n?(p=n.some(g),e[8]=n,e[9]=p):p=e[9],i=p,t.forEach((u,m)=>{const c=n[m];c?.data?r.set(u,c.data.map(S)):r.set(u,[])}),e[4]=t,e[5]=n,e[6]=i,e[7]=r}else i=e[6],r=e[7];let a;return e[10]!==i||e[11]!==r?(a={resourcesMap:r,isLoading:i},e[10]=i,e[11]=r,e[12]=a):a=e[12],a}function S(t){return{uri:t.uri,name:t.name,description:t.description}}function g(t){return t.isLoading}function O(t){return{queryKey:l.connectionResources(t),queryFn:()=>w(t),staleTime:6e4,retry:!1}}export{$ as a,P as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n}from"./index-
|
|
1
|
+
import{c as n}from"./index-C4a1DvcM.js";import{e as u,d as m,f,c as r}from"./use-connection-8aFd9ZgQ.js";import{u as a}from"./tooltip-DZ8PMo3S.js";function g(t){const e=n.c(3);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const s=o,{org:c}=a();let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=r(),e[2]=l):l=e[2];const i=l;return u(c.slug,"GATEWAY",i,s)}function y(t){const e=n.c(1),{org:o}=a();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=r(),e[0]=s):s=e[0];const c=s;return f(o.slug,"GATEWAY",t,c)}function G(){const t=n.c(1),{org:e}=a();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=r(),t[0]=o):o=t[0];const s=o;return m(e.slug,"GATEWAY",s)}export{G as a,y as b,g as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,c as T}from"./index-
|
|
1
|
+
import{r as a,c as T}from"./index-C4a1DvcM.js";import{u as D}from"./use-mobile-BQAr1bEF.js";const W=({size:l=24,color:e="currentColor",...t})=>a.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},a.createElement("path",{d:"M2.42 12.713c-.136-.215-.204-.323-.242-.49a1.173 1.173 0 0 1 0-.446c.038-.167.106-.274.242-.49C3.546 9.505 6.895 5 12 5s8.455 4.505 9.58 6.287c.137.215.205.323.243.49.029.125.029.322 0 .446-.038.167-.106.274-.242.49C20.455 14.495 17.105 19 12 19c-5.106 0-8.455-4.505-9.58-6.287Z"}),a.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}));W.displayName="Eye";function k(l){const e=`deco-filters-${l}`,[t,c]=a.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[t,o=>{c(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(i){console.error("Failed to save filters:",i)}}]}function C(l){const e=T.c(7),[t,c]=a.useState(l),[s,o]=a.useState(l?"desc":null);let i;e[0]!==s||e[1]!==t?(i=h=>{t!==h?(c(h),o("asc")):s==="asc"?o("desc"):s==="desc"&&(c(void 0),o(null))},e[0]=s,e[1]=t,e[2]=i):i=e[2];const u=i;let r;return e[3]!==u||e[4]!==s||e[5]!==t?(r={sortKey:t,sortDirection:s,handleSort:u},e[3]=u,e[4]=s,e[5]=t,e[6]=r):r=e[6],r}function L(l,e){const t=T.c(12),c=e===void 0?"cards":e,s=D(),o=a.useRef(s),i=l?`deco-view-mode-${l}`:"deco-view-mode";let u;t[0]!==c||t[1]!==i?(u=()=>{const d=globalThis.localStorage?.getItem(i);return d==="cards"||d==="table"?d:c},t[0]=c,t[1]=i,t[2]=u):u=t[2];const[r,h]=a.useState(u);let f;t[3]!==i?(f=d=>{h(d),globalThis.localStorage?.setItem(i,d)},t[3]=i,t[4]=f):f=t[4];const p=f;let S,g;t[5]!==s||t[6]!==r?(S=()=>{!o.current&&s&&r==="table"&&h("cards"),o.current=s},g=[s,r],t[5]=s,t[6]=r,t[7]=S,t[8]=g):(S=t[7],g=t[8]),a.useEffect(S,g);let n;return t[9]!==p||t[10]!==r?(n=[r,p],t[9]=p,t[10]=r,t[11]=n):n=t[11],n}function O(l){const e=T.c(20),{namespace:t,resource:c,defaultSortKey:s,defaultViewMode:o}=l,i=s===void 0?"title":s,u=o===void 0?"table":o,[r,h]=a.useState(""),f=a.useDeferredValue(r),p=`${t}-${c}`,[S,g]=k(p),n=`mesh-${c}-filter-visible-${t}`;let d;e[0]!==n?(d=()=>globalThis.localStorage?.getItem(n)==="true",e[0]=n,e[1]=d):d=e[1];const[m,B]=a.useState(d);let y;e[2]!==n?(y=I=>{B(I),globalThis.localStorage?.setItem(n,String(I))},e[2]=n,e[3]=y):y=e[3];const b=y;let M;e[4]!==m||e[5]!==b?(M=()=>{b(!m)},e[4]=m,e[5]=b,e[6]=M):M=e[6];const w=M,[V,$]=L(`mesh-${c}-${t}`,u),{sortKey:x,sortDirection:F,handleSort:K}=C(i),E=x;let v;return e[7]!==m||e[8]!==S||e[9]!==K||e[10]!==r||e[11]!==f||e[12]!==b||e[13]!==g||e[14]!==$||e[15]!==F||e[16]!==E||e[17]!==w||e[18]!==V?(v={search:r,searchTerm:f,setSearch:h,filters:S,setFilters:g,filterBarVisible:m,setFilterBarVisible:b,toggleFilterBar:w,viewMode:V,setViewMode:$,sortKey:E,sortDirection:F,handleSort:K},e[7]=m,e[8]=S,e[9]=K,e[10]=r,e[11]=f,e[12]=b,e[13]=g,e[14]=$,e[15]=F,e[16]=E,e[17]=w,e[18]=V,e[19]=v):v=e[19],v}export{W as s,O as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as E,K as b}from"./index-
|
|
1
|
+
import{c as E,K as b}from"./index-C4a1DvcM.js";import{u as j}from"./useQuery-39cprZL6.js";function T(g){const e=E.c(18),{url:o,token:r,enabled:w}=g,$=w===void 0?!0:w;let i;e[0]!==r||e[1]!==o?(i=b.mcpTools(o,r),e[0]=r,e[1]=o,e[2]=i):i=e[2];let s;e[3]!==r||e[4]!==o?(s=async()=>{if(!o)return[];const m={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};r&&(m.Authorization=`Bearer ${r}`);const u=await fetch(o,{method:"POST",headers:m,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-mcp",version:"1.0.0"}}})});if(!u.ok)throw new Error(`MCP initialization failed: ${u.status}`);const h=await u.json();if(h.error)throw new Error(`MCP initialization error: ${h.error.message} (code: ${h.error.code})`);const y=await fetch(o,{method:"POST",headers:m,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"tools/list",params:{}})});if(!y.ok)throw new Error(`Failed to list tools: ${y.status}`);const l=await y.json();if(l.error)throw new Error(`Failed to list tools: ${l.error.message} (code: ${l.error.code})`);return l.result?.tools||[]},e[3]=r,e[4]=o,e[5]=s):s=e[5];const d=$&&!!o;let a;e[6]!==i||e[7]!==s||e[8]!==d?(a={queryKey:i,queryFn:s,enabled:d,staleTime:3e4,retry:!1},e[6]=i,e[7]=s,e[8]=d,e[9]=a):a=e[9];const t=j(a),f=o?t.isLoading?"connecting":t.isError?"error":"ready":"disconnected";let n;e[10]!==t.data?(n=t.data||[],e[10]=t.data,e[11]=n):n=e[11];const p=t.error;let c;return e[12]!==t.isLoading||e[13]!==t.refetch||e[14]!==f||e[15]!==n||e[16]!==p?(c={tools:n,state:f,error:p,isLoading:t.isLoading,refetch:t.refetch},e[12]=t.isLoading,e[13]=t.refetch,e[14]=f,e[15]=n,e[16]=p,e[17]=c):c=e[17],c}export{T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,q as n,K as u,a as i}from"./index-
|
|
1
|
+
import{c as o,q as n,K as u,a as i}from"./index-C4a1DvcM.js";import{u as a}from"./tooltip-DZ8PMo3S.js";function p(){const e=o.c(4),{locator:s}=a();let t;e[0]!==s?(t=u.members(s),e[0]=s,e[1]=t):t=e[1];let r;return e[2]!==t?(r={queryKey:t,queryFn:m},e[2]=t,e[3]=r):r=e[3],n(r)}function m(){return i.organization.listMembers()}export{p as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m,r}from"./index-
|
|
1
|
+
import{c as m,r}from"./index-C4a1DvcM.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,q as y,Z as T,K as f}from"./index-
|
|
1
|
+
import{c as o,q as y,Z as T,K as f}from"./index-C4a1DvcM.js";import{u as p}from"./button-Chm7HSn5.js";import{c as m}from"./use-connection-8aFd9ZgQ.js";function N(t){const e=o.c(8);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=m(),e[0]=n):n=e[0];const c=n;let r;e[1]!==t?(r=f.organizationSettings(t),e[1]=t,e[2]=r):r=e[2];let s;e[3]!==t?(s=async()=>{const u=await c("ORGANIZATION_SETTINGS_GET",{});return u||{organizationId:t,sidebar_items:null,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}},e[3]=t,e[4]=s):s=e[4];let l;e[5]!==r||e[6]!==s?(l={queryKey:r,queryFn:s,staleTime:6e4},e[5]=r,e[6]=s,e[7]=l):l=e[7];const{data:i}=y(l);return i}function q(t){const e=o.c(11),n=T();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=m(),e[0]=c):c=e[0];const r=c;let s;e[1]!==t?(s=async S=>await r("ORGANIZATION_SETTINGS_UPDATE",{organizationId:t,...S}),e[1]=t,e[2]=s):s=e[2];let l;e[3]!==t||e[4]!==n?(l=()=>{n.invalidateQueries({queryKey:f.organizationSettings(t)})},e[3]=t,e[4]=n,e[5]=l):l=e[5];let i;e[6]!==s||e[7]!==l?(i={mutationFn:s,onSuccess:l},e[6]=s,e[7]=l,e[8]=i):i=e[8];const u=p(i);let a;return e[9]!==u?(a={update:u},e[9]=u,e[10]=a):a=e[10],a}export{q as a,N as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,q,K}from"./index-
|
|
1
|
+
import{c as f,q,K}from"./index-C4a1DvcM.js";function S(p){const e=f.c(23);let s,o,r,t,l;e[0]!==p?({toolCaller:r,toolName:l,toolInputParams:t,scope:o,...s}=p,e[0]=p,e[1]=s,e[2]=o,e[3]=r,e[4]=t,e[5]=l):(s=e[1],o=e[2],r=e[3],t=e[4],l=e[5]);let a,u,i,c;if(e[6]!==s||e[7]!==o||e[8]!==t||e[9]!==l){const y=JSON.stringify(t);c=q,a=s,u=s.staleTime??6e4,i=K.toolCall(o,l,y),e[6]=s,e[7]=o,e[8]=t,e[9]=l,e[10]=a,e[11]=u,e[12]=i,e[13]=c}else a=e[10],u=e[11],i=e[12],c=e[13];let n;e[14]!==r||e[15]!==t||e[16]!==l?(n=async()=>await r(l,t),e[14]=r,e[15]=t,e[16]=l,e[17]=n):n=e[17];let m;return e[18]!==a||e[19]!==u||e[20]!==i||e[21]!==n?(m={...a,staleTime:u,queryKey:i,queryFn:n},e[18]=a,e[19]=u,e[20]=i,e[21]=n,e[22]=m):m=e[22],c(m)}export{S as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{at as u,ap as s}from"./index-C4a1DvcM.js";function t(e,r){return u(e,s,r)}export{t as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{be as e,V as t}from"./index-C4a1DvcM.js";function n(...r){return e(t(r))}export{n as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n}from"./index-
|
|
1
|
+
import{r as n}from"./index-C4a1DvcM.js";const i=({size:e=24,color:o="currentColor",...c})=>n.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:o,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...c},n.createElement("path",{d:"M17 10V8A5 5 0 0 0 7 8v2m5 4.5v2M8.8 21h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 18.72 20 17.88 20 16.2v-1.4c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C17.72 10 16.88 10 15.2 10H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C4 12.28 4 13.12 4 14.8v1.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C6.28 21 7.12 21 8.8 21Z"}));i.displayName="Lock01";const t={SELF:"self",REGISTRY:"registry",COMMUNITY_REGISTRY:"community-registry"},r={SELF:e=>`${e}_${t.SELF}`,REGISTRY:e=>`${e}_${t.REGISTRY}`,COMMUNITY_REGISTRY:e=>`${e}_${t.COMMUNITY_REGISTRY}`};function a(e){return{id:r.REGISTRY(e),title:"Deco Store",description:"Official deco MCP registry with curated integrations",connection_type:"HTTP",connection_url:"https://api.decocms.com/mcp/registry",icon:"https://assets.decocache.com/decocms/00ccf6c3-9e13-4517-83b0-75ab84554bb9/596364c63320075ca58483660156b6d9de9b526e.png",app_name:"deco-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function l(){return{id:t.COMMUNITY_REGISTRY,title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}export{t as W,l as a,a as g,i};
|
package/dist/client/index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<title>MCP Mesh</title>
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
|
-
<script type="module" crossorigin src="/assets/index-
|
|
6
|
+
<script type="module" crossorigin src="/assets/index-C4a1DvcM.js"></script>
|
|
7
7
|
<link rel="stylesheet" crossorigin href="/assets/index-MyldRbGR.css">
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as ie,c as L,j as t,f as Ee,a as lt,t as rt,d as at,b as ct,av as dt}from"./index-CzwYLjKx.js";import{E as Oe}from"./SearchMd-CoQHJpld.js";import{E as Ue}from"./error-boundary-Ctu3eNTK.js";import{I as Ke,b as We,d as mt,e as ut,c as ft,a as pt}from"./use-connection-D2GoBb_z.js";import{b as ht}from"./use-binding-BZo_dE4c.js";import{E as Re,P as xt,u as gt,S as jt}from"./index-CgAMfaaZ.js";import{B as xe}from"./button-DkKLNB2C.js";import{i as qe}from"./Loading01-EBx-peK5.js";import{R as bt}from"./resource-tabs-DetRi2Tz.js";import{V as Ct,a as vt,b as yt}from"./layout-H0Bo8Mbp.js";import{g as Ve}from"./generate-id-Dyweu44Y.js";import{C as Ge}from"./collection-display-button-DOaNnrf1.js";import{C as wt}from"./collection-search-BaQnC0wl.js";import{C as Nt}from"./card-pUBjGsjy.js";import{b as He,D as Je,a as Ze,c as R}from"./dropdown-menu-BwfRJqX3.js";import{a as Qe}from"./Copy01-CwQ47sCB.js";import{i as Xe}from"./DotsVertical-Rjkn1qAc.js";import{s as Ye,u as St}from"./use-list-state-BjDzxCt9.js";import{s as et}from"./Trash01-B-JvszLz.js";import{C as _t}from"./collection-table-wrapper-CWSD0OK_.js";import{n as Be}from"./Inbox01-48LwpeyS.js";import{B as It}from"./extract-connection-data-fIUwUi9M.js";import{A as Tt,g as At,c as Dt,b as $t,d as Pt,e as kt,a as Et,f as Ot}from"./alert-dialog-BuGENs_x.js";import{s as zt}from"./Plus-fvCbDfFA.js";import{R as Mt,T as Lt}from"./tools-list-De28L5_g.js";import"./utils-D1FAHWbf.js";import"./tooltip-CRtbHuaD.js";import"./auth-EiU0mg3W.js";import"./mcp-oauth-BpODx-Yp.js";import"./use-organization-settings-C32KUUMU.js";import"./use-tool-call-B6UiQKbH.js";import"./File06-Cml7_jh5.js";import"./Key01-BBl7lwdX.js";import"./form-DGgpciyh.js";import"./input-BGhWl8yr.js";import"./select-C-8wPfQb.js";import"./ChevronDown-BAEvQsP1.js";import"./use-gateway-CJINNdSX.js";import"./Grid01-iXkiGD-C.js";import"./CpuChip02-Bxoen-sS.js";import"./formatDistanceToNow-Do6wCvgQ.js";import"./registry-utils-ulDDT0d8.js";import"./index-CgmRhymO.js";import"./index-Cg6DdXuN.js";import"./schema-DefbPj25.js";import"./badge-xSWfUH8C.js";import"./ArrowLeft-B2q5Ncqe.js";import"./use-mobile-B89ZoGbj.js";import"./useQuery-CbqX0Fzv.js";const ze=({size:s=24,color:e="currentColor",...o})=>ie.createElement("svg",{viewBox:"0 0 24 24",width:s,height:s,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},ie.createElement("path",{d:"M2.876 18.116c.046-.414.069-.62.131-.814a2 2 0 0 1 .234-.485c.111-.17.259-.317.553-.61L17 3a2.828 2.828 0 1 1 4 4L7.794 20.206c-.294.294-.442.442-.611.553a2 2 0 0 1-.485.233c-.193.063-.4.086-.814.132L2.5 21.5l.376-3.384Z"}));ze.displayName="Edit01";function Rt(s,e){const o=s.properties||{};for(const n in o){const r=o[n];if(r&&r.type==="string"&&(r.format==="url"||r.format==="uri")&&e&&typeof e=="object"&&n in e&&e[n])return e[n]}const l=["image","img","avatar","icon","logo","thumbnail","cover"];for(const n of l)if(e&&typeof e=="object"&&n in e&&typeof e[n]=="string")return e[n]}function Vt(s){const e=L.c(25),{item:o,schema:l,actions:n}=s;let r;e[0]!==o||e[1]!==l?(r=Rt(l,o),e[0]=o,e[1]=l,e[2]=r):r=e[2];const d=r,f=o&&typeof o=="object"&&"description"in o&&typeof o.description=="string"?o.description:void 0;let C;e[3]!==n?(C=n&&Object.keys(n).length>0,e[3]=n,e[4]=C):C=e[4];const i=C;let c;e[5]!==d||e[6]!==o.title?(c=t.jsx(Ke,{icon:d,name:o.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=d,e[6]=o.title,e[7]=c):c=e[7];let j;e[8]!==o.title?(j=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.title}),e[8]=o.title,e[9]=j):j=e[9];const m=f||"No description";let u;e[10]!==m?(u=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:m}),e[10]=m,e[11]=u):u=e[11];let p;e[12]!==j||e[13]!==u?(p=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[j,u]}),e[12]=j,e[13]=u,e[14]=p):p=e[14];let g;e[15]!==c||e[16]!==p?(g=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[c,p]}),e[15]=c,e[16]=p,e[17]=g):g=e[17];let a;e[18]!==n||e[19]!==i||e[20]!==o?(a=i&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Kt,onMouseDown:Ut,children:t.jsxs(He,{children:[t.jsx(Je,{asChild:!0,children:t.jsx(xe,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Ft,children:t.jsx(Xe,{size:20})})}),t.jsxs(Ze,{align:"end",onClick:Bt,children:[n.open&&t.jsxs(R,{onClick:v=>{v.stopPropagation(),n.open?.(o)},children:[t.jsx(Ye,{size:16}),"Open"]}),n.edit&&t.jsxs(R,{onClick:v=>{v.stopPropagation(),n.edit?.(o)},children:[t.jsx(ze,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(R,{onClick:v=>{v.stopPropagation(),n.duplicate?.(o)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(R,{variant:"destructive",onClick:v=>{v.stopPropagation(),n.delete?.(o)},children:[t.jsx(et,{size:16}),"Delete"]})]})]})}),e[18]=n,e[19]=i,e[20]=o,e[21]=a):a=e[21];let T;return e[22]!==g||e[23]!==a?(T=t.jsxs(Nt,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[g,a]}),e[22]=g,e[23]=a,e[24]=T):T=e[24],T}function Bt(s){return s.stopPropagation()}function Ft(s){return s.stopPropagation()}function Ut(s){return s.stopPropagation()}function Kt(s){return s.stopPropagation()}const Wt=["icon","avatar","logo"],Fe=["created_at","created_by","id"];function qt(s){return Object.keys(s).find(e=>Wt.includes(e.toLowerCase()))}function tt(s,e){return Object.keys(s.properties||{}).filter(o=>["id","created_at","updated_at","created_by","updated_by"].includes(o)?!1:e?e.includes(o):!0).map(o=>({id:o,label:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," ")}))}function Gt(s){const e=L.c(32),{data:o,schema:l,viewMode:n,onViewModeChange:r,search:d,sortKey:f,sortDirection:C,onSort:i,actions:c,onItemClick:j,headerActions:m,emptyState:u,readOnly:p,columns:g,hideToolbar:a,sortableFields:T}=s,v=r===void 0?Xt:r,b=C===void 0?"asc":C,P=i===void 0?Qt:i;let w;e[0]!==c?(w=c===void 0?{}:c,e[0]=c,e[1]=w):w=e[1];const h=w,A=j===void 0?Zt:j,D=m===void 0?null:m,y=u===void 0?null:u,k=p===void 0?!1:p,_=g===void 0?void 0:g,E=a===void 0?!1:a,N=T===void 0?void 0:T;let z;e[2]!==_||e[3]!==l||e[4]!==N?(z=_?_.filter(Jt).filter(M=>!N||N.includes(M.id)).map(Ht):tt(l,N),e[2]=_,e[3]=l,e[4]=N,e[5]=z):z=e[5];const I=z;let S;e[6]!==D||e[7]!==E||e[8]!==P||e[9]!==v||e[10]!==b||e[11]!==f||e[12]!==I||e[13]!==n?(S=!E&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:D}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Ge,{viewMode:n,onViewModeChange:v,sortKey:f,sortDirection:b,onSort:P,sortOptions:I})})]})}),e[6]=D,e[7]=E,e[8]=P,e[9]=v,e[10]=b,e[11]=f,e[12]=I,e[13]=n,e[14]=S):S=e[14];let O;e[15]!==h||e[16]!==_||e[17]!==o||e[18]!==y||e[19]!==A||e[20]!==P||e[21]!==k||e[22]!==l||e[23]!==d||e[24]!==b||e[25]!==f||e[26]!==N||e[27]!==n?(O=n==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:o.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:y||t.jsx(Re,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:d?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.map(M=>t.jsx("div",{onClick:()=>A?.(M),className:"cursor-pointer h-full",children:t.jsx(Vt,{item:M,schema:l,readOnly:k,actions:h})},M.id))})}):t.jsx(_t,{columns:ts(_,l,N,h),data:o,sortKey:f,sortDirection:b,onSort:P,onRowClick:A,emptyState:y||t.jsx(Re,{icon:t.jsx(Be,{size:36,className:"text-muted-foreground"}),title:"No items found",description:d?"Try adjusting your search":"No items to display"})}),e[15]=h,e[16]=_,e[17]=o,e[18]=y,e[19]=A,e[20]=P,e[21]=k,e[22]=l,e[23]=d,e[24]=b,e[25]=f,e[26]=N,e[27]=n,e[28]=O):O=e[28];let x;return e[29]!==S||e[30]!==O?(x=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[S,O]}),e[29]=S,e[30]=O,e[31]=x):x=e[31],x}function Ht(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Jt(s){return s.sortable!==!1}function Zt(){}function Qt(){}function Xt(){}function Yt(s){return{id:"actions",header:"",render:e=>t.jsxs(He,{children:[t.jsx(Je,{asChild:!0,children:t.jsx(xe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:t.jsx(Xe,{size:20})})}),t.jsxs(Ze,{align:"end",onClick:o=>o.stopPropagation(),children:[s.open&&t.jsxs(R,{onClick:o=>{o.stopPropagation(),s.open?.(e)},children:[t.jsx(Ye,{size:16}),"Open"]}),s.edit&&t.jsxs(R,{onClick:o=>{o.stopPropagation(),s.edit?.(e)},children:[t.jsx(ze,{size:16}),"Edit"]}),s.duplicate&&t.jsxs(R,{onClick:o=>{o.stopPropagation(),s.duplicate?.(e)},children:[t.jsx(Qe,{size:16}),"Duplicate"]}),s.delete&&t.jsxs(R,{variant:"destructive",onClick:o=>{o.stopPropagation(),s.delete?.(e)},children:[t.jsx(et,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function st(s){const e=s.type;return Array.isArray(e)?e.every(o=>st({type:o})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function es(s,e){const o=s.properties||{},l=Object.keys(o).filter(i=>{const c=o[i];return c&&st(c)}),n=qt(o),r=[],d=new Set;n&&l.includes(n)&&(r.push(n),d.add(n));const f=["title","description","updated_at","updated_by"];for(const i of f)l.includes(i)&&!d.has(i)&&(r.push(i),d.add(i));const C=l.filter(i=>!d.has(i)&&!Fe.includes(i)).sort((i,c)=>i.localeCompare(c));for(const i of C)r.push(i),d.add(i);for(const i of Fe)l.includes(i)&&!d.has(i)&&(r.push(i),d.add(i));return r.map(i=>{const c=o[i],j=e?e.includes(i):!["id"].includes(i);return i===n?{id:i,header:"",render:m=>{const u=m[i];return t.jsx(Ke,{icon:u,name:m.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:i==="description"?{id:i,header:"Description",render:m=>{const u=m[i];return u==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(u)})},sortable:j,cellClassName:"max-w-[50ch]"}:c?.format==="date-time"||i.endsWith("_at")?{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:m=>{const u=m[i];return u?t.jsx("span",{className:"block truncate max-w-full",children:new Date(u).toLocaleDateString()}):"—"},sortable:j,cellClassName:"max-w-[200px]"}:{id:i,header:i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),render:m=>{const u=m[i];return u==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(u)})},sortable:j,cellClassName:"max-w-[200px]"}})}function ts(s,e,o,l){const n=s||es(e,o);return n.some(f=>f.id==="actions")?n:Object.keys(l).length>0?[...n,Yt(l)]:n}function ss(s){const e=L.c(117),{connectionId:o,org:l,activeCollection:n}=s,r=n.name,d=n.schema??It,f=n.hasCreateTool,C=n.hasUpdateTool,i=n.hasDeleteTool,c=Ee(),{data:j}=lt.useSession(),m=j?.user?.id||"unknown",u=We(o);let p;e[0]!==o?(p=ft(o),e[0]=o,e[1]=p):p=e[1];const g=p,a=mt(o,r,g),T=`${o}-${r}`;let v;e[2]!==l||e[3]!==T?(v={namespace:l,resource:T,defaultSortKey:"updated_at"},e[2]=l,e[3]=T,e[4]=v):v=e[4];const{search:b,searchTerm:P,setSearch:w,viewMode:h,setViewMode:A,sortKey:D,sortDirection:y,handleSort:k}=St(v);let _;e[5]!==P||e[6]!==y||e[7]!==D?(_={searchTerm:P,sortKey:D,sortDirection:y},e[5]=P,e[6]=y,e[7]=D,e[8]=_):_=e[8];const E=ut(o,r,g,_),N=!f&&!C&&!i;let z;e[9]!==r||e[10]!==o||e[11]!==c||e[12]!==l?(z=$=>{c({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:o,collectionName:r,itemId:$.id}})},e[9]=r,e[10]=o,e[11]=c,e[12]=l,e[13]=z):z=e[13];const I=z;let S;e[14]!==a.create||e[15]!==m?(S=async $=>{const he=new Date().toISOString();await a.create.mutateAsync({...$,id:Ve("conn"),title:`${$.title} (Copy)`,created_at:he,updated_at:he,created_by:m,updated_by:m})},e[14]=a.create,e[15]=m,e[16]=S):S=e[16];const O=S,[x,M]=ie.useState(null);let le;e[17]===Symbol.for("react.memo_cache_sentinel")?(le=$=>{M($)},e[17]=le):le=e[17];const ot=le;let V;e[18]!==I||e[19]!==C?(V=C&&{edit:I},e[18]=I,e[19]=C,e[20]=V):V=e[20];let B;e[21]!==O||e[22]!==f?(B=f&&{duplicate:O},e[21]=O,e[22]=f,e[23]=B):B=e[23];let F;e[24]!==i?(F=i&&{delete:ot},e[24]=i,e[25]=F):F=e[25];let re;e[26]!==F||e[27]!==V||e[28]!==B?(re={...V,...B,...F},e[26]=F,e[27]=V,e[28]=B,e[29]=re):re=e[29];const ge=re;let ae;e[30]!==a.delete||e[31]!==x?(ae=async()=>{x&&(await a.delete.mutateAsync(x.id),M(null))},e[30]=a.delete,e[31]=x,e[32]=ae):ae=e[32];const je=ae;let ce;e[33]!==a.create||e[34]!==r||e[35]!==o||e[36]!==f||e[37]!==c||e[38]!==l||e[39]!==m?(ce=async()=>{if(!f){rt.error("Create operation is not available for this collection");return}const $=new Date().toISOString(),he={id:Ve("conn"),title:"New Item",description:"A brief description of the item",created_at:$,updated_at:$,created_by:m,updated_by:m};try{const ke=await a.create.mutateAsync(he);c({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:o,collectionName:r,itemId:ke.id}})}catch(ke){console.error("Failed to create item:",ke)}},e[33]=a.create,e[34]=r,e[35]=o,e[36]=f,e[37]=c,e[38]=l,e[39]=m,e[40]=ce):ce=e[40];const be=ce;let de;e[41]!==d?(de=tt(d),e[41]=d,e[42]=de):de=e[42];const Ce=de,Me=(E?.length??0)>0,nt=f&&Me,it=f&&!Me&&!b;let me;e[43]!==a.create||e[44]!==be||e[45]!==f?(me=f?t.jsxs(xe,{onClick:be,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(zt,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[43]=a.create,e[44]=be,e[45]=f,e[46]=me):me=e[46];const Le=me,ve=D;let U;e[47]!==k||e[48]!==A||e[49]!==y||e[50]!==Ce||e[51]!==ve||e[52]!==h?(U=t.jsx(Ge,{viewMode:h,onViewModeChange:A,sortKey:ve,sortDirection:y,onSort:k,sortOptions:Ce}),e[47]=k,e[48]=A,e[49]=y,e[50]=Ce,e[51]=ve,e[52]=h,e[53]=U):U=e[53];const ye=`${r}s`,we=u?.icon??"grid_view";let K;e[54]!==o||e[55]!==ye||e[56]!==we?(K=t.jsx(xt,{connectionId:o,title:ye,icon:we}),e[54]=o,e[55]=ye,e[56]=we,e[57]=K):K=e[57];const Ne=nt&&Le;let W;e[58]!==U||e[59]!==K||e[60]!==Ne?(W=t.jsxs(Ct,{children:[U,K,Ne]}),e[58]=U,e[59]=K,e[60]=Ne,e[61]=W):W=e[61];const Se=`Search ${r}...`;let q;e[62]!==w?(q=$=>{$.key==="Escape"&&(w(""),$.target.blur())},e[62]=w,e[63]=q):q=e[63];let G;e[64]!==b||e[65]!==w||e[66]!==Se||e[67]!==q?(G=t.jsx(wt,{value:b,onChange:w,placeholder:Se,onKeyDown:q}),e[64]=b,e[65]=w,e[66]=Se,e[67]=q,e[68]=G):G=e[68];let H;e[69]!==E?(H=E??[],e[69]=E,e[70]=H):H=e[70];const _e=D;let J;e[71]!==I?(J=$=>I($),e[71]=I,e[72]=J):J=e[72];const Ie="No items found",Te=b?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ae=it?Le:void 0;let Z;e[73]!==Ie||e[74]!==Te||e[75]!==Ae?(Z=t.jsx(Oe,{image:null,title:Ie,description:Te,actions:Ae}),e[73]=Ie,e[74]=Te,e[75]=Ae,e[76]=Z):Z=e[76];let Q;e[77]!==k||e[78]!==N||e[79]!==ge||e[80]!==d||e[81]!==b||e[82]!==w||e[83]!==A||e[84]!==y||e[85]!==H||e[86]!==_e||e[87]!==J||e[88]!==Z||e[89]!==h?(Q=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Gt,{hideToolbar:!0,data:H,schema:d,viewMode:h,onViewModeChange:A,search:b,onSearchChange:w,sortKey:_e,sortDirection:y,onSort:k,actions:ge,onItemClick:J,readOnly:N,emptyState:Z})}),e[77]=k,e[78]=N,e[79]=ge,e[80]=d,e[81]=b,e[82]=w,e[83]=A,e[84]=y,e[85]=H,e[86]=_e,e[87]=J,e[88]=Z,e[89]=h,e[90]=Q):Q=e[90];let X;e[91]!==G||e[92]!==Q?(X=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,Q]}),e[91]=G,e[92]=Q,e[93]=X):X=e[93];const De=!!x;let ue;e[94]===Symbol.for("react.memo_cache_sentinel")?(ue=$=>{$||M(null)},e[94]=ue):ue=e[94];let fe;e[95]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx(Dt,{children:"Delete item?"}),e[95]=fe):fe=e[95];const $e=x?.title;let Y;e[96]!==$e?(Y=t.jsxs($t,{children:[fe,t.jsxs(Pt,{children:['Are you sure you want to delete "',$e,'"? This action cannot be undone.']})]}),e[96]=$e,e[97]=Y):Y=e[97];let ee;e[98]!==a.delete.isPending?(ee=t.jsx(Tt,{disabled:a.delete.isPending,children:"Cancel"}),e[98]=a.delete.isPending,e[99]=ee):ee=e[99];const Pe=a.delete.isPending?"Deleting...":"Delete";let te;e[100]!==a.delete.isPending||e[101]!==je||e[102]!==Pe?(te=t.jsx(At,{onClick:je,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Pe}),e[100]=a.delete.isPending,e[101]=je,e[102]=Pe,e[103]=te):te=e[103];let se;e[104]!==ee||e[105]!==te?(se=t.jsxs(kt,{children:[ee,te]}),e[104]=ee,e[105]=te,e[106]=se):se=e[106];let oe;e[107]!==Y||e[108]!==se?(oe=t.jsxs(Et,{children:[Y,se]}),e[107]=Y,e[108]=se,e[109]=oe):oe=e[109];let ne;e[110]!==De||e[111]!==oe?(ne=t.jsx(Ot,{open:De,onOpenChange:ue,children:oe}),e[110]=De,e[111]=oe,e[112]=ne):ne=e[112];let pe;return e[113]!==W||e[114]!==X||e[115]!==ne?(pe=t.jsxs(t.Fragment,{children:[W,X,ne]}),e[113]=W,e[114]=X,e[115]=ne,e[116]=pe):pe=e[116],pe}function os(s){const e=L.c(2),{repository:o}=s;let l;return e[0]!==o?(l=t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(Mt,{repository:o})}),e[0]=o,e[1]=l):l=e[1],l}function ns(s){const e=L.c(4),{tools:o,connectionId:l,org:n}=s;let r;return e[0]!==l||e[1]!==n||e[2]!==o?(r=t.jsx(Lt,{tools:o,connectionId:l,org:n}),e[0]=l,e[1]=n,e[2]=o,e[3]=r):r=e[3],r}function is(s){const e=L.c(50),{connection:o,connectionId:l,org:n,requestedTabId:r,collections:d,onUpdate:f,isUpdating:C}=s,i=dt();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={from:"/$org/mcps/$connectionId"},e[0]=c):c=e[0];const j=Ee(c);let m;e[1]!==l?(m={connectionId:l},e[1]=l,e[2]=m):m=e[2];const u=gt(m),p=u.isAuthenticated,g=o?.metadata?.repository,a=!!g?.url,T=o?.tools?.length??0;let v;e[3]===Symbol.for("react.memo_cache_sentinel")?(v={id:"settings",label:"Settings"},e[3]=v):v=e[3];let b;e[4]!==p||e[5]!==T?(b=p&&T>0?[{id:"tools",label:"Tools",count:T}]:[],e[4]=p,e[5]=T,e[6]=b):b=e[6];let P;if(e[7]!==d||e[8]!==a||e[9]!==p||e[10]!==b){let x;e[12]!==a?(x=a?[{id:"readme",label:"README"}]:[],e[12]=a,e[13]=x):x=e[13],P=[v,...b,...p?(d||[]).map(ls):[],...x],e[7]=d,e[8]=a,e[9]=p,e[10]=b,e[11]=P}else P=e[11];const w=P,h=w.some(x=>x.id===r)?r:"settings";let A;e[14]!==j?(A=x=>{j({search:M=>({...M,tab:x}),replace:!0})},e[14]=j,e[15]=A):A=e[15];const D=A;let y;e[16]!==d?(y=d||[],e[16]=d,e[17]=y):y=e[17];let k;if(e[18]!==h||e[19]!==y){let x;e[21]!==h?(x=M=>M.name===h,e[21]=h,e[22]=x):x=e[22],k=y.find(x),e[18]=h,e[19]=y,e[20]=k}else k=e[20];const _=k;let E;e[23]!==i.history?(E=()=>i.history.back(),e[23]=i.history,e[24]=E):E=e[24];let N;e[25]!==h||e[26]!==D||e[27]!==w?(N=t.jsx(vt,{children:t.jsx(bt,{tabs:w,activeTab:h,onTabChange:D})}),e[25]=h,e[26]=D,e[27]=w,e[28]=N):N=e[28];let z;e[29]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(qe,{size:32,className:"animate-spin text-muted-foreground"})}),e[29]=z):z=e[29];let I;e[30]!==_||e[31]!==h||e[32]!==u.supportsOAuth||e[33]!==o||e[34]!==l||e[35]!==D||e[36]!==a||e[37]!==p||e[38]!==C||e[39]!==f||e[40]!==n||e[41]!==g?(I=t.jsx(ie.Suspense,{fallback:z,children:h==="tools"?t.jsx(ns,{tools:o.tools??void 0,connectionId:l,org:n}):h==="settings"?t.jsx(jt,{connection:o,onUpdate:f,isUpdating:C,isMCPAuthenticated:p,supportsOAuth:u.supportsOAuth,onViewReadme:a?()=>D("readme"):void 0}):h==="readme"&&a?t.jsx(os,{repository:g}):_&&p?t.jsx(ss,{connectionId:l,org:n,activeCollection:_},h):t.jsx(Oe,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[30]=_,e[31]=h,e[32]=u.supportsOAuth,e[33]=o,e[34]=l,e[35]=D,e[36]=a,e[37]=p,e[38]=C,e[39]=f,e[40]=n,e[41]=g,e[42]=I):I=e[42];let S;e[43]!==h||e[44]!==I?(S=t.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:t.jsx(Ue,{children:I},h)})}),e[43]=h,e[44]=I,e[45]=S):S=e[45];let O;return e[46]!==N||e[47]!==S||e[48]!==E?(O=t.jsxs(yt,{onBack:E,children:[N,S]}),e[46]=N,e[47]=S,e[48]=E,e[49]=O):O=e[49],O}function ls(s){return{id:s.name,label:s.displayName}}function rs(){const s=L.c(17);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},s[0]=e):e=s[0];const o=Ee(e);let l;s[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/mcps/$connectionId"},s[1]=l):l=s[1];const{connectionId:n,org:r}=at(l);let d;s[2]===Symbol.for("react.memo_cache_sentinel")?(d={from:"/shell/$org/mcps/$connectionId"},s[2]=d):d=s[2];const C=ct(d).tab||"settings",i=We(n),c=pt(),j=ht(i??void 0);let m;s[3]!==c.update||s[4]!==n?(m=async g=>{await c.update.mutateAsync({id:n,data:g})},s[3]=c.update,s[4]=n,s[5]=m):m=s[5];const u=m;if(!i){let g;return s[6]!==o||s[7]!==r?(g=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Oe,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(xe,{variant:"outline",onClick:()=>o({to:"/$org/mcps",params:{org:r}}),children:"Back to connections"})})}),s[6]=o,s[7]=r,s[8]=g):g=s[8],g}let p;return s[9]!==c.update.isPending||s[10]!==j||s[11]!==i||s[12]!==n||s[13]!==u||s[14]!==r||s[15]!==C?(p=t.jsx(is,{org:r,connection:i,connectionId:n,requestedTabId:C,collections:j,onUpdate:u,isUpdating:c.update.isPending}),s[9]=c.update.isPending,s[10]=j,s[11]=i,s[12]=n,s[13]=u,s[14]=r,s[15]=C,s[16]=p):p=s[16],p}function as(){const s=L.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ue,{children:t.jsx(ie.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(qe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(rs,{})})}),s[0]=e):e=s[0],e}function io(){const s=L.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(as,{}),s[0]=e):e=s[0],e}export{io as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bO as X,bP as O,bQ as j,bR as q,ap as A,Z as Y,bS as _,bT as z,r as w,bU as I,bV as L,bW as N,bX as V,bY as k,bZ as x,b_ as H,b$ as J}from"./index-CzwYLjKx.js";function F(t,n){const e=new Set(n);return t.filter(s=>!e.has(s))}function B(t,n,e){const s=t.slice(0);return s[n]=e,s}var U=class extends X{#r;#t;#s;#a;#e;#n;#o;#i;#u=[];constructor(t,n,e){super(),this.#r=t,this.#a=e,this.#s=[],this.#e=[],this.#t=[],this.setQueries(n)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(t=>{t.subscribe(n=>{this.#d(t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(t=>{t.destroy()})}setQueries(t,n){this.#s=t,this.#a=n,O.batch(()=>{const e=this.#e,s=this.#l(this.#s);this.#u=s,s.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions));const r=s.map(u=>u.observer),i=r.map(u=>u.getCurrentResult()),o=e.length!==r.length,a=r.some((u,f)=>u!==e[f]),c=o||a,d=c?!0:i.some((u,f)=>{const h=this.#t[f];return!h||!j(u,h)});!c&&!d||(c&&(this.#e=r),this.#t=i,this.hasListeners()&&(c&&(F(e,r).forEach(u=>{u.destroy()}),F(r,e).forEach(u=>{u.subscribe(f=>{this.#d(u,f)})})),this.#f()))})}getCurrentResult(){return this.#t}getQueries(){return this.#e.map(t=>t.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(t,n){const e=this.#l(t),s=e.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions));return[s,r=>this.#h(r??s,n),()=>this.#c(s,e)]}#c(t,n){return n.map((e,s)=>{const r=t[s];return e.defaultedQueryOptions.notifyOnChangeProps?r:e.observer.trackResult(r,i=>{n.forEach(o=>{o.observer.trackProp(i)})})})}#h(t,n){return n?((!this.#n||this.#t!==this.#i||n!==this.#o)&&(this.#o=n,this.#i=this.#t,this.#n=q(this.#n,n(t))),this.#n):t}#l(t){const n=new Map;this.#e.forEach(s=>{const r=s.options.queryHash;if(!r)return;const i=n.get(r);i?i.push(s):n.set(r,[s])});const e=[];return t.forEach(s=>{const r=this.#r.defaultQueryOptions(s),o=n.get(r.queryHash)?.shift()??new A(this.#r,r);e.push({defaultedQueryOptions:r,observer:o})}),e}#d(t,n){const e=this.#e.indexOf(t);e!==-1&&(this.#t=B(this.#t,e,n),this.#f())}#f(){if(this.hasListeners()){const t=this.#n,n=this.#c(this.#t,this.#u),e=this.#h(n,this.#a?.combine);t!==e&&O.batch(()=>{this.listeners.forEach(s=>{s(this.#t)})})}}};function It({queries:t,...n},e){const s=Y(e),r=_(),i=z(),o=w.useMemo(()=>t.map(l=>{const g=s.defaultQueryOptions(l);return g._optimisticResults=r?"isRestoring":"optimistic",g}),[t,s,r]);o.forEach(l=>{I(l),L(l,i)}),N(i);const[a]=w.useState(()=>new U(s,o,n)),[c,d,u]=a.getOptimisticResult(o,n.combine),f=!r&&n.subscribed!==!1;w.useSyncExternalStore(w.useCallback(l=>f?a.subscribe(O.batchCalls(l)):V,[a,f]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),w.useEffect(()=>{a.setQueries(o,n)},[o,n,a]);const y=c.some((l,g)=>k(o[g],l))?c.flatMap((l,g)=>{const b=o[g];if(b){const C=new A(s,b);if(k(b,l))return x(b,C,i);H(l,r)&&x(b,C,i)}return[]}):[];if(y.length>0)throw Promise.all(y);const m=c.find((l,g)=>{const b=o[g];return b&&J({result:l,errorResetBoundary:i,throwOnError:b.throwOnError,query:s.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(m?.error)throw m.error;return d(u())}const D=43200,E=1440,T=Symbol.for("constructDateFrom");function W(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&T in t?t[T](n):t instanceof Date?new t.constructor(n):new Date(n)}function p(t,n){return W(t,t)}let Z={};function $(){return Z}function Q(t){const n=p(t),e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return e.setUTCFullYear(n.getFullYear()),+t-+e}function R(t,...n){const e=W.bind(null,t||n.find(s=>typeof s=="object"));return n.map(e)}function P(t,n){const e=+p(t)-+p(n);return e<0?-1:e>0?1:e}function K(t){return W(t,Date.now())}function G(t,n,e){const[s,r]=R(e?.in,t,n),i=s.getFullYear()-r.getFullYear(),o=s.getMonth()-r.getMonth();return i*12+o}function tt(t){return n=>{const s=(t?Math[t]:Math.trunc)(n);return s===0?0:s}}function et(t,n){return+p(t)-+p(n)}function nt(t,n){const e=p(t);return e.setHours(23,59,59,999),e}function rt(t,n){const e=p(t),s=e.getMonth();return e.setFullYear(e.getFullYear(),s+1,0),e.setHours(23,59,59,999),e}function st(t,n){const e=p(t);return+nt(e)==+rt(e)}function at(t,n,e){const[s,r,i]=R(e?.in,t,t,n),o=P(r,i),a=Math.abs(G(r,i));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-o*a);let c=P(r,i)===-o;st(s)&&a===1&&P(s,i)===1&&(c=!1);const d=o*(a-+c);return d===0?0:d}function ot(t,n,e){const s=et(t,n)/1e3;return tt(e?.roundingMethod)(s)}const it={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ut=(t,n,e)=>{let s;const r=it[t];return typeof r=="string"?s=r:n===1?s=r.one:s=r.other.replace("{{count}}",n.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+s:s+" ago":s};function S(t){return(n={})=>{const e=n.width?String(n.width):t.defaultWidth;return t.formats[e]||t.formats[t.defaultWidth]}}const ct={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ht={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},lt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dt={date:S({formats:ct,defaultWidth:"full"}),time:S({formats:ht,defaultWidth:"full"}),dateTime:S({formats:lt,defaultWidth:"full"})},ft={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mt=(t,n,e,s)=>ft[t];function M(t){return(n,e)=>{const s=e?.context?String(e.context):"standalone";let r;if(s==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=e?.width?String(e.width):o;r=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=e?.width?String(e.width):t.defaultWidth;r=t.values[a]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(n):n;return r[i]}}const bt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},pt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},wt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vt=(t,n)=>{const e=Number(t),s=e%100;if(s>20||s<10)switch(s%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Dt={ordinalNumber:vt,era:M({values:bt,defaultWidth:"wide"}),quarter:M({values:yt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:M({values:gt,defaultWidth:"wide"}),day:M({values:pt,defaultWidth:"wide"}),dayPeriod:M({values:wt,defaultWidth:"wide",formattingValues:Mt,defaultFormattingWidth:"wide"})};function v(t){return(n,e={})=>{const s=e.width,r=s&&t.matchPatterns[s]||t.matchPatterns[t.defaultMatchWidth],i=n.match(r);if(!i)return null;const o=i[0],a=s&&t.parsePatterns[s]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(a)?St(a,f=>f.test(o)):Pt(a,f=>f.test(o));let d;d=t.valueCallback?t.valueCallback(c):c,d=e.valueCallback?e.valueCallback(d):d;const u=n.slice(o.length);return{value:d,rest:u}}}function Pt(t,n){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&n(t[e]))return e}function St(t,n){for(let e=0;e<t.length;e++)if(n(t[e]))return e}function Ot(t){return(n,e={})=>{const s=n.match(t.matchPattern);if(!s)return null;const r=s[0],i=n.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=e.valueCallback?e.valueCallback(o):o;const a=n.slice(r.length);return{value:o,rest:a}}}const Wt=/^(\d+)(th|st|nd|rd)?/i,Rt=/\d+/i,Ct={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},kt={any:[/^b/i,/^(a|c)/i]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ft={any:[/1/i,/2/i,/3/i,/4/i]},Et={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Tt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Qt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},At={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Xt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},jt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},qt={ordinalNumber:Ot({matchPattern:Wt,parsePattern:Rt,valueCallback:t=>parseInt(t,10)}),era:v({matchPatterns:Ct,defaultMatchWidth:"wide",parsePatterns:kt,defaultParseWidth:"any"}),quarter:v({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:Ft,defaultParseWidth:"any",valueCallback:t=>t+1}),month:v({matchPatterns:Et,defaultMatchWidth:"wide",parsePatterns:Tt,defaultParseWidth:"any"}),day:v({matchPatterns:Qt,defaultMatchWidth:"wide",parsePatterns:At,defaultParseWidth:"any"}),dayPeriod:v({matchPatterns:Xt,defaultMatchWidth:"any",parsePatterns:jt,defaultParseWidth:"any"})},Yt={code:"en-US",formatDistance:ut,formatLong:dt,formatRelative:mt,localize:Dt,match:qt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function _t(t,n,e){const s=$(),r=e?.locale??s.locale??Yt,i=2520,o=P(t,n);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},e,{addSuffix:e?.addSuffix,comparison:o}),[c,d]=R(e?.in,...o>0?[n,t]:[t,n]),u=ot(d,c),f=(Q(d)-Q(c))/1e3,h=Math.round((u-f)/60);let y;if(h<2)return e?.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,a):u<10?r.formatDistance("lessThanXSeconds",10,a):u<20?r.formatDistance("lessThanXSeconds",20,a):u<40?r.formatDistance("halfAMinute",0,a):u<60?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",1,a):h===0?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",h,a);if(h<45)return r.formatDistance("xMinutes",h,a);if(h<90)return r.formatDistance("aboutXHours",1,a);if(h<E){const m=Math.round(h/60);return r.formatDistance("aboutXHours",m,a)}else{if(h<i)return r.formatDistance("xDays",1,a);if(h<D){const m=Math.round(h/E);return r.formatDistance("xDays",m,a)}else if(h<D*2)return y=Math.round(h/D),r.formatDistance("aboutXMonths",y,a)}if(y=at(d,c),y<12){const m=Math.round(h/D);return r.formatDistance("xMonths",m,a)}else{const m=y%12,l=Math.trunc(y/12);return m<3?r.formatDistance("aboutXYears",l,a):m<9?r.formatDistance("overXYears",l,a):r.formatDistance("almostXYears",l+1,a)}}function Lt(t,n){return _t(t,K(t),n)}export{Lt as f,It as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as $,c as M,j as s,K as _e,f as Ne,d as Me,b as Oe,v as Ve,bo as je,w as Se,av as qe,x as Ge,y as Ue,t as Ce}from"./index-CzwYLjKx.js";import{E as Le}from"./SearchMd-CoQHJpld.js";import{E as Te}from"./error-boundary-Ctu3eNTK.js";import{I as ye,u as ke}from"./use-connection-D2GoBb_z.js";import{T as Je,S as Be}from"./switch-BYhk4sLo.js";import{C as $e}from"./checkbox-CkDtf7-s.js";import{B as H}from"./button-DkKLNB2C.js";import{i as Ke}from"./ArrowLeft-B2q5Ncqe.js";import{c as Y}from"./utils-D1FAHWbf.js";import{C as Qe}from"./collection-search-BaQnC0wl.js";import{I as ve}from"./input-BGhWl8yr.js";import{s as We}from"./Plus-fvCbDfFA.js";import{i as Ye}from"./X-EXSAob0c.js";import{b as He,a as Xe}from"./use-gateway-CJINNdSX.js";import{u as Ie,f as Ze}from"./formatDistanceToNow-Do6wCvgQ.js";import{a as ie,c as ae,b as ce,T as de,i as we}from"./tooltip-CRtbHuaD.js";import{a as et}from"./Copy01-CwQ47sCB.js";import{i as tt}from"./CpuChip02-Bxoen-sS.js";import{i as Pe}from"./InfoCircle-Db_224Lw.js";import{i as be}from"./Loading01-EBx-peK5.js";import{F as re,a as st,b as ue,d as fe,f as he,c as Re}from"./form-DGgpciyh.js";import{S as De,a as ze,b as Ae,c as Ee,d as me}from"./select-C-8wPfQb.js";import{R as nt}from"./resource-tabs-DetRi2Tz.js";import{s as ot}from"./slugify-CEUa2lfQ.js";import{a as lt,V as rt,b as it}from"./layout-H0Bo8Mbp.js";import"./ChevronDown-BAEvQsP1.js";import"./badge-xSWfUH8C.js";const at=$.memo(function(e){const t=M.c(20),{connection:o,isSelected:i,hasItemsEnabled:l,activeItemsCount:r,totalItemsCount:u,onSelect:c,onToggle:a}=e,d=i?"bg-accent/50":"hover:bg-muted/50";let m;t[0]!==d?(m=Y("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",d),t[0]=d,t[1]=m):m=t[1];let x;t[2]!==o.icon||t[3]!==o.title?(x=s.jsx(ye,{icon:o.icon,name:o.title,size:"xs"}),t[2]=o.icon,t[3]=o.title,t[4]=x):x=t[4];let j;t[5]!==o.title?(j=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.title})}),t[5]=o.title,t[6]=j):j=t[6];let p;t[7]!==c||t[8]!==x||t[9]!==j?(p=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:c,children:[x,j]}),t[7]=c,t[8]=x,t[9]=j,t[10]=p):p=t[10];let f;t[11]!==r||t[12]!==l||t[13]!==a||t[14]!==u?(f=u>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[r,"/",u]}),s.jsx($e,{checked:l,onCheckedChange:a,onClick:dt})]}),t[11]=r,t[12]=l,t[13]=a,t[14]=u,t[15]=f):f=t[15];let y;return t[16]!==m||t[17]!==p||t[18]!==f?(y=s.jsxs("div",{className:m,children:[p,f]}),t[16]=m,t[17]=p,t[18]=f,t[19]=y):y=t[19],y}),ct=$.memo(function(e){const t=M.c(18),{connectionId:o,item:i,isSelected:l,onToggle:r}=e,u=`item-${o}-${i.id}`,c=l?"text-foreground":"text-muted-foreground";let a;t[0]!==c?(a=Y("text-sm font-medium",c),t[0]=c,t[1]=a):a=t[1];let d;t[2]!==i.name||t[3]!==a?(d=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:a,children:i.name})}),t[2]=i.name,t[3]=a,t[4]=d):d=t[4];let m;t[5]!==i.description?(m=i.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:i.description}),t[5]=i.description,t[6]=m):m=t[6];let x;t[7]!==d||t[8]!==m?(x=s.jsxs("div",{className:"flex-1 min-w-0",children:[d,m]}),t[7]=d,t[8]=m,t[9]=x):x=t[9];const j=`item-${o}-${i.id}`;let p;t[10]!==l||t[11]!==r||t[12]!==j?(p=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx($e,{id:j,checked:l,onCheckedChange:r,onClick:mt})}),t[10]=l,t[11]=r,t[12]=j,t[13]=p):p=t[13];let f;return t[14]!==u||t[15]!==x||t[16]!==p?(f=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:u,children:[x,p]}),t[14]=u,t[15]=x,t[16]=p,t[17]=f):f=t[17],f});function Fe({itemSet:n,onItemSetChange:e,getItems:t,itemLabel:o,emptyItemsMessage:i,extraContent:l}){const[r,u]=$.useState(""),c=$.useDeferredValue(r),[a,d]=$.useState("all"),[m,x]=$.useState(!1),j=$.useRef(new Set(Object.keys(n))),p=ke({searchTerm:c.trim()||void 0}),f=j.current,y=[...f.values()].map(h=>p.find(S=>S.id===h)).filter(h=>h!==void 0),w=p.filter(h=>!f.has(h.id)),N=[...y,...w],g=h=>{const S=n[h];return S!==void 0&&S.length>0},b=N.filter(h=>{if(a==="all")return!0;const S=g(h.id);return a==="selected"?S:a==="unselected"?!S:!0}),[C,_]=$.useState(N[0]?.id??null),v=C?N.find(h=>h.id===C)??null:null,O=v?t(v):[],q=(h,S)=>n[h]?.includes(S)??!1,E=(h,S)=>{const I=n[h]??[],R=I.includes(S),D={...n};if(R){const z=I.filter(P=>P!==S);z.length===0?delete D[h]:D[h]=z}else D[h]=[...I,S];e(D)},V=h=>{const S=N.find(k=>k.id===h);if(!S)return;const I=t(S);if(I.length===0)return;const R=n[h]??[],D=I.map(k=>k.id),z=R.length>0&&D.every(k=>R.includes(k)),P={...n};z?delete P[h]:(P[h]=D,_(h)),e(P)},J=h=>{_(h),x(!0)},F=()=>{x(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:Y("w-full md:w-80 border-r border-border flex flex-col",m&&"hidden md:flex"),children:[s.jsx(Qe,{value:r,onChange:u,placeholder:"Search MCP Servers..."}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>d("all"),className:Y("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",a==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),s.jsx("button",{onClick:()=>d("selected"),className:Y("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",a==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),s.jsx("button",{onClick:()=>d("unselected"),className:Y("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",a==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:b.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:r?"No connections found":a==="selected"?"No servers selected":a==="unselected"?"No unselected servers":"No connections available"}):s.jsx("div",{className:"p-2 space-y-1",children:b.map(h=>{const I=t(h).length,R=n[h.id]?.length??0;return s.jsx(at,{connection:h,isSelected:C===h.id,hasItemsEnabled:g(h.id),activeItemsCount:R,totalItemsCount:I,onSelect:()=>J(h.id),onToggle:()=>V(h.id)},h.id)})})})]}),s.jsx("div",{className:Y("flex-1 flex-col",m?"flex":"hidden md:flex"),children:v?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(H,{variant:"ghost",size:"sm",onClick:F,className:"h-8 w-8 p-0 shrink-0",children:s.jsx(Ke,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx(ye,{icon:v.icon,name:v.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:v.title}),v.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:v.description})]})]})]}),l,s.jsx("div",{className:"flex-1 overflow-auto p-4",children:O.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:i||`This connection has no ${o} available`}):s.jsx("div",{className:"space-y-2",children:O.map(h=>s.jsx(ct,{connectionId:v.id,item:h,isSelected:q(v.id,h.id),onToggle:()=>E(v.id,h.id)},h.id))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",o]})})})]})}function dt(n){return n.stopPropagation()}function mt(n){return n.stopPropagation()}function ut(n){const e=M.c(6),{promptSet:t,onPromptSetChange:o,connectionPrompts:i}=n;let l;e[0]!==i?(l=c=>(i.get(c.id)??[]).map(ft),e[0]=i,e[1]=l):l=e[1];const r=l;let u;return e[2]!==r||e[3]!==o||e[4]!==t?(u=s.jsx(Fe,{itemSet:t,onItemSetChange:o,getItems:r,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=r,e[3]=o,e[4]=t,e[5]=u):u=e[5],u}function ft(n){return{id:n.name,name:n.name,description:n.description}}function ht(n){return n.includes("*")}function xt(n){const e=M.c(27),{patterns:t,onAddPattern:o,onRemovePattern:i}=n,[l,r]=$.useState("");let u;e[0]!==l||e[1]!==o||e[2]!==t?(u=()=>{const x=l.trim();x&&!t.includes(x)&&(o(x),r(""))},e[0]=l,e[1]=o,e[2]=t,e[3]=u):u=e[3];const c=u;let a;e[4]!==c?(a=x=>{x.key==="Enter"&&(x.preventDefault(),c())},e[4]=c,e[5]=a):a=e[5];const d=a;let m;if(e[6]!==c||e[7]!==d||e[8]!==l||e[9]!==i||e[10]!==t){const x=t.filter(ht);let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("code",{children:"*"}),e[12]=j):j=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",j," for single segment and ",s.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=p):p=e[13];let f;e[14]===Symbol.for("react.memo_cache_sentinel")?(f=_=>r(_.target.value),e[14]=f):f=e[14];let y;e[15]!==d||e[16]!==l?(y=s.jsx(ve,{value:l,onChange:f,onKeyDown:d,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=d,e[16]=l,e[17]=y):y=e[17];let w;e[18]!==l?(w=l.trim(),e[18]=l,e[19]=w):w=e[19];const N=!w;let g;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(We,{size:16}),e[20]=g):g=e[20];let b;e[21]!==c||e[22]!==N?(b=s.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:c,disabled:N,children:g}),e[21]=c,e[22]=N,e[23]=b):b=e[23];let C;e[24]!==b||e[25]!==y?(C=s.jsxs("div",{className:"flex gap-2",children:[y,b]}),e[24]=b,e[25]=y,e[26]=C):C=e[26],m=s.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[p,C,x.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2",children:x.map(_=>s.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[s.jsx("code",{className:"text-foreground",children:_}),s.jsx("button",{type:"button",onClick:()=>i(_),className:"text-muted-foreground hover:text-foreground",children:s.jsx(Ye,{size:12})})]},_))})]}),e[6]=c,e[7]=d,e[8]=l,e[9]=i,e[10]=t,e[11]=m}else m=e[11];return m}function pt(n){const e=M.c(23),{resourceSet:t,onResourceSetChange:o,connectionResources:i}=n,[l]=$.useState(null);let r;e[0]!==i?(r=g=>(i.get(g.id)??[]).map(gt),e[0]=i,e[1]=r):r=e[1];const u=r;let c;e[2]!==o||e[3]!==t?(c=(g,b)=>{const C=t[g]??[];C.includes(b)||o({...t,[g]:[...C,b]})},e[2]=o,e[3]=t,e[4]=c):c=e[4];const a=c;let d;e[5]!==o||e[6]!==t?(d=(g,b)=>{const _=(t[g]??[]).filter(v=>v!==b);if(_.length===0){const v={...t};delete v[g],o(v)}else o({...t,[g]:_})},e[5]=o,e[6]=t,e[7]=d):d=e[7];const m=d;let x;e[8]!==o?(x=g=>{o(g)},e[8]=o,e[9]=x):x=e[9];const j=x;let p;e[10]!==t||e[11]!==l?(p=l?t[l]??[]:[],e[10]=t,e[11]=l,e[12]=p):p=e[12];const f=p;let y;e[13]!==a||e[14]!==m||e[15]!==l||e[16]!==f?(y=l?s.jsx(xt,{patterns:f,onAddPattern:g=>a(l,g),onRemovePattern:g=>m(l,g)}):null,e[13]=a,e[14]=m,e[15]=l,e[16]=f,e[17]=y):y=e[17];const w=y;let N;return e[18]!==w||e[19]!==u||e[20]!==j||e[21]!==t?(N=s.jsx("div",{className:"h-full",children:s.jsx(Fe,{itemSet:t,onItemSetChange:j,getItems:u,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:w})}),e[18]=w,e[19]=u,e[20]=j,e[21]=t,e[22]=N):N=e[22],N}function gt(n){return{id:n.uri,name:n.name||n.uri,description:n.description||n.uri}}async function jt(n){const e=`/mcp/${n}`,t={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};try{const o=await fetch(e,{method:"POST",headers:t,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-prompts",version:"1.0.0"}}})});if(!o.ok)return[];if((await o.json()).error)return[];const l=await fetch(e,{method:"POST",headers:t,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"prompts/list",params:{}})});if(!l.ok)return[];const r=await l.json();return r.error?[]:r.result?.prompts||[]}catch{return[]}}function bt(n){const e=M.c(13);let t;e[0]!==n?(t=n.map(St),e[0]=n,e[1]=t):t=e[1];let o;e[2]!==t?(o={queries:t},e[2]=t,e[3]=o):o=e[3];const i=Ie(o);let l,r;if(e[4]!==n||e[5]!==i){r=new Map;let c;e[8]!==i?(c=i.some(vt),e[8]=i,e[9]=c):c=e[9],l=c,n.forEach((a,d)=>{const m=i[d];m?.data?r.set(a,m.data.map(yt)):r.set(a,[])}),e[4]=n,e[5]=i,e[6]=l,e[7]=r}else l=e[6],r=e[7];let u;return e[10]!==l||e[11]!==r?(u={promptsMap:r,isLoading:l},e[10]=l,e[11]=r,e[12]=u):u=e[12],u}function yt(n){return{name:n.name,description:n.description}}function vt(n){return n.isLoading}function St(n){return{queryKey:_e.connectionPrompts(n),queryFn:()=>jt(n),staleTime:6e4,retry:!1}}async function Ct(n){const e=`/mcp/${n}`,t={"Content-Type":"application/json",Accept:"application/json, text/event-stream"};try{const o=await fetch(e,{method:"POST",headers:t,body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{protocolVersion:"2025-06-18",capabilities:{},clientInfo:{name:"mesh-resources",version:"1.0.0"}}})});if(!o.ok)return[];if((await o.json()).error)return[];const l=await fetch(e,{method:"POST",headers:t,body:JSON.stringify({jsonrpc:"2.0",id:2,method:"resources/list",params:{}})});if(!l.ok)return[];const r=await l.json();return r.error?[]:r.result?.resources||[]}catch{return[]}}function wt(n){const e=M.c(13);let t;e[0]!==n?(t=n.map(Tt),e[0]=n,e[1]=t):t=e[1];let o;e[2]!==t?(o={queries:t},e[2]=t,e[3]=o):o=e[3];const i=Ie(o);let l,r;if(e[4]!==n||e[5]!==i){r=new Map;let c;e[8]!==i?(c=i.some(Nt),e[8]=i,e[9]=c):c=e[9],l=c,n.forEach((a,d)=>{const m=i[d];m?.data?r.set(a,m.data.map(_t)):r.set(a,[])}),e[4]=n,e[5]=i,e[6]=l,e[7]=r}else l=e[6],r=e[7];let u;return e[10]!==l||e[11]!==r?(u={resourcesMap:r,isLoading:l},e[10]=l,e[11]=r,e[12]=u):u=e[12],u}function _t(n){return{uri:n.uri,name:n.name,description:n.description}}function Nt(n){return n.isLoading}function Tt(n){return{queryKey:_e.connectionResources(n),queryFn:()=>Ct(n),staleTime:6e4,retry:!1}}function kt(n){const t=new TextEncoder().encode(n),o=Array.from(t,i=>String.fromCharCode(i)).join("");return btoa(o)}function $t(n){const e=M.c(52),{serverName:t,gatewayUrl:o}=n,[i,l]=$.useState(!1),[r,u]=$.useState(null),c=ot(t);let a,d,m,x;if(e[0]!==o||e[1]!==c){const B={type:"http",url:o},L={[c]:B};a=JSON.stringify(L,null,2);const le=Q=>JSON.stringify({...B,headers:{"x-mesh-client":Q}},null,2),A=kt(le("Cursor"));d=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(c)}&config=${encodeURIComponent(A)}`;const X=le("Claude Code");m=c;let K;e[6]===Symbol.for("react.memo_cache_sentinel")?(K=/'/g,e[6]=K):K=e[6],x=X.replace(K,"'\\''"),e[0]=o,e[1]=c,e[2]=a,e[3]=d,e[4]=m,e[5]=x}else a=e[2],d=e[3],m=e[4],x=e[5];const j=`claude mcp add "${m}" --config '${x}'`;let p;e[7]!==a?(p=async()=>{await navigator.clipboard.writeText(a),l(!0),Ce.success("Configuration copied to clipboard"),setTimeout(()=>l(!1),2e3)},e[7]=a,e[8]=p):p=e[8];const f=p;let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=async(B,L)=>{await navigator.clipboard.writeText(B),u(L),Ce.success(`${L} command copied`),setTimeout(()=>u(null),2e3)},e[9]=y):y=e[9];const w=y,N=It;let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("div",{children:s.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[10]=g):g=e[10];let b;e[11]!==i?(b=i?s.jsx(we,{size:14}):s.jsx(et,{size:14}),e[11]=i,e[12]=b):b=e[12];let C;e[13]!==f||e[14]!==b?(C=s.jsx(ce,{asChild:!0,children:s.jsx(H,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:f,children:b})}),e[13]=f,e[14]=b,e[15]=C):C=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(de,{children:"Copy configuration"}),e[16]=_):_=e[16];let v;e[17]!==C?(v=s.jsx("div",{className:"absolute top-2 right-2",children:s.jsx(ie,{children:s.jsxs(ae,{children:[C,_]})})}),e[17]=C,e[18]=v):v=e[18];let O;e[19]!==a||e[20]!==f?(O=s.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:f,children:a}),e[19]=a,e[20]=f,e[21]=O):O=e[21];let q;e[22]!==O||e[23]!==v?(q=s.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[v,O]}),e[22]=O,e[23]=v,e[24]=q):q=e[24];let E;e[25]!==d?(E=()=>N(d),e[25]=d,e[26]=E):E=e[26];let V,J;e[27]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),J=s.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=V,e[28]=J):(V=e[27],J=e[28]);let F;e[29]!==E?(F=s.jsx(ce,{asChild:!0,children:s.jsxs(H,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:E,children:[V,J]})}),e[29]=E,e[30]=F):F=e[30];let h;e[31]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(de,{children:"Add to Cursor"}),e[31]=h):h=e[31];let S;e[32]!==F?(S=s.jsx(ie,{children:s.jsxs(ae,{children:[F,h]})}),e[32]=F,e[33]=S):S=e[33];let I;e[34]!==j?(I=()=>w(j,"Claude"),e[34]=j,e[35]=I):I=e[35];let R,D;e[36]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),D=s.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=R,e[37]=D):(R=e[36],D=e[37]);let z;e[38]!==r?(z=r==="Claude"&&s.jsx(we,{size:14,className:"ml-2 text-green-500"}),e[38]=r,e[39]=z):z=e[39];let P;e[40]!==I||e[41]!==z?(P=s.jsx(ce,{asChild:!0,children:s.jsxs(H,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:I,children:[R,D,z]})}),e[40]=I,e[41]=z,e[42]=P):P=e[42];let k;e[43]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(de,{children:"Add to Claude Code"}),e[43]=k):k=e[43];let W;e[44]!==P?(W=s.jsx(ie,{children:s.jsxs(ae,{children:[P,k]})}),e[44]=P,e[45]=W):W=e[45];let G;e[46]!==S||e[47]!==W?(G=s.jsxs("div",{className:"flex flex-wrap gap-2",children:[S,W]}),e[46]=S,e[47]=W,e[48]=G):G=e[48];let U;return e[49]!==q||e[50]!==G?(U=s.jsxs("div",{className:"flex flex-col gap-4",children:[g,q,G]}),e[49]=q,e[50]=G,e[51]=U):U=e[51],U}function It(n){window.open(n,"_blank")}const Pt=Ve({title:Se().min(1,"Name is required").max(255),description:Se().nullable(),status:je(["active","inactive"]),tool_selection_mode:je(["inclusion","exclusion"]),tool_selection_strategy:je(["passthrough","smart_tool_selection","code_execution"])});function Rt(n,e){const t={};for(const o of n.connections)if(o.selected_tools===null){const i=e.get(o.connection_id)??[];i.length>0&&(t[o.connection_id]=i)}else o.selected_tools.length>0&&(t[o.connection_id]=o.selected_tools);return t}function Dt(n){const e={};for(const t of n.connections)t.selected_resources!==null&&t.selected_resources!==void 0&&t.selected_resources.length>0&&(e[t.connection_id]=t.selected_resources);return e}function zt(n){const e={};for(const t of n.connections)t.selected_prompts!==null&&t.selected_prompts!==void 0&&t.selected_prompts.length>0&&(e[t.connection_id]=t.selected_prompts);return e}function At(n,e,t,o){const i=new Set([...Object.keys(n),...Object.keys(e),...Object.keys(t)]);return Array.from(i).map(l=>{const r=n[l]??[],u=o.get(l)??[],c=u.length>0&&u.every(a=>r.includes(a));return{connection_id:l,selected_tools:r.length===0||c?null:r,selected_resources:e[l]??null,selected_prompts:t[l]??null}})}function Et(n){const e=M.c(41),{form:t,gateway:o,icon:i}=n;let l;e[0]!==t?(l=t.watch("title")||"Gateway",e[0]=t,e[1]=l):l=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(tt,{}),e[2]=r):r=e[2];let u;e[3]!==i||e[4]!==l?(u=s.jsx(ye,{icon:i,name:l,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:r}),e[3]=i,e[4]=l,e[5]=u):u=e[5];let c;e[6]!==t.control?(c=s.jsx(re,{control:t.control,name:"status",render:qt}),e[6]=t.control,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=s.jsxs("div",{className:"flex items-start justify-between",children:[u,c]}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let d;e[11]!==t.control?(d=s.jsxs("div",{className:"flex flex-col",children:[s.jsx(re,{control:t.control,name:"title",render:Vt}),s.jsx(re,{control:t.control,name:"description",render:Ot})]}),e[11]=t.control,e[12]=d):d=e[12];let m;e[13]!==a||e[14]!==d?(m=s.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[a,d]}),e[13]=a,e[14]=d,e[15]=m):m=e[15];let x;e[16]!==t.control?(x=s.jsxs("div",{className:"flex flex-col gap-4 p-5",children:[s.jsx(re,{control:t.control,name:"tool_selection_mode",render:Mt}),s.jsx(re,{control:t.control,name:"tool_selection_strategy",render:Ft})]}),e[16]=t.control,e[17]=x):x=e[17];let j;e[18]!==m||e[19]!==x?(j=s.jsxs("div",{className:"flex flex-col",children:[m,x]}),e[18]=m,e[19]=x,e[20]=j):j=e[20];let p;e[21]!==t||e[22]!==j?(p=s.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:s.jsx(st,{...t,children:j})}),e[21]=t,e[22]=j,e[23]=p):p=e[23];let f;e[24]!==o.id||e[25]!==o.title?(f=o.title||`gateway-${o.id.slice(0,8)}`,e[24]=o.id,e[25]=o.title,e[26]=f):f=e[26];const y=`${window.location.origin}/mcp/gateway/${o.id}`;let w;e[27]!==f||e[28]!==y?(w=s.jsx("div",{className:"p-5",children:s.jsx($t,{serverName:f,gatewayUrl:y})}),e[27]=f,e[28]=y,e[29]=w):w=e[29];let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[30]=N):N=e[30];let g;e[31]!==o.updated_at?(g=o.updated_at?Ze(new Date(o.updated_at),{addSuffix:!1}):"Unknown",e[31]=o.updated_at,e[32]=g):g=e[32];let b;e[33]!==g?(b=s.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[N,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:g})]}),e[33]=g,e[34]=b):b=e[34];let C;e[35]!==w||e[36]!==b?(C=s.jsxs("div",{className:"flex flex-col overflow-auto",children:[w,b]}),e[35]=w,e[36]=b,e[37]=C):C=e[37];let _;return e[38]!==p||e[39]!==C?(_=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[p,C]}),e[38]=p,e[39]=C,e[40]=_):_=e[40],_}function Ft(n){const{field:e}=n;return s.jsxs(ue,{children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Re,{className:"mb-0",children:"Gateway Strategy"}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(ie,{children:s.jsxs(ae,{children:[s.jsx(ce,{asChild:!0,children:s.jsx("button",{type:"button",className:"cursor-help flex items-center",children:s.jsx(Pe,{size:14,className:"text-muted-foreground"})})}),s.jsx(de,{side:"left",className:"max-w-sm",children:s.jsxs("div",{className:"text-xs space-y-1",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Passthrough:"})," Pass tools through as-is (default)."]}),s.jsxs("div",{children:[s.jsx("strong",{children:"Smart Tool Selection:"})," ","Intelligent tool selection behavior."]}),s.jsxs("div",{children:[s.jsx("strong",{children:"Code Execution:"})," Code execution behavior."]})]})})]})}),s.jsxs(De,{value:e.value,onValueChange:e.onChange,children:[s.jsx(fe,{children:s.jsx(ze,{className:"w-[180px]",children:s.jsx(Ae,{})})}),s.jsxs(Ee,{children:[s.jsx(me,{value:"passthrough",children:"Passthrough"}),s.jsx(me,{value:"smart_tool_selection",children:"Smart Tool Selection"}),s.jsx(me,{value:"code_execution",children:"Code Execution"})]})]})]})]}),s.jsx(he,{})]})}function Mt(n){const{field:e}=n;return s.jsxs(ue,{children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Re,{className:"mb-0",children:"Selection Mode"}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(ie,{children:s.jsxs(ae,{children:[s.jsx(ce,{asChild:!0,children:s.jsx("button",{type:"button",className:"cursor-help flex items-center",children:s.jsx(Pe,{size:14,className:"text-muted-foreground"})})}),s.jsx(de,{side:"left",className:"max-w-sm",children:s.jsxs("div",{className:"text-xs space-y-1",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Include:"})," Only selected items are exposed."]}),s.jsxs("div",{children:[s.jsx("strong",{children:"Exclude:"})," All items except selected ones are exposed."]})]})})]})}),s.jsxs(De,{value:e.value,onValueChange:e.onChange,children:[s.jsx(fe,{children:s.jsx(ze,{className:"w-[180px]",children:s.jsx(Ae,{})})}),s.jsxs(Ee,{children:[s.jsx(me,{value:"inclusion",children:"Include Selected"}),s.jsx(me,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),s.jsx(he,{})]})}function Ot(n){const{field:e}=n;return s.jsxs(ue,{className:"w-full space-y-0",children:[s.jsx(fe,{children:s.jsx(ve,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),s.jsx(he,{})]})}function Vt(n){const{field:e}=n;return s.jsxs(ue,{className:"w-full space-y-0",children:[s.jsx(fe,{children:s.jsx(ve,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Gateway Name"})}),s.jsx(he,{})]})}function qt(n){const{field:e}=n;return s.jsxs(ue,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:e.value==="active"?"Active":"Inactive"}),s.jsx(fe,{children:s.jsx(Be,{checked:e.value==="active",onCheckedChange:t=>e.onChange(t?"active":"inactive")})})]}),s.jsx(he,{})]})}function Gt(n){const e=M.c(65),{gateway:t,gatewayId:o,requestedTabId:i}=n,l=qe();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/$org/gateways/$gatewayId"},e[0]=r):r=e[0];const u=Ne(r),c=Xe();let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={},e[1]=a):a=e[1];const d=ke(a);let m;e[2]!==d?(m=d.map(Lt),e[2]=d,e[3]=m):m=e[3];const x=m,{promptsMap:j}=bt(x),{resourcesMap:p}=wt(x);let f;if(e[4]!==d){f=new Map;for(const T of d)T.tools&&T.tools.length>0&&f.set(T.id,T.tools.map(Ut));e[4]=d,e[5]=f}else f=e[5];let y;e[6]!==f||e[7]!==t?(y=()=>Rt(t,f),e[6]=f,e[7]=t,e[8]=y):y=e[8];const[w,N]=$.useState(y);let g;e[9]!==t?(g=()=>Dt(t),e[9]=t,e[10]=g):g=e[10];const[b,C]=$.useState(g);let _;e[11]!==t?(_=()=>zt(t),e[11]=t,e[12]=_):_=e[12];const[v,O]=$.useState(_),[q,E]=$.useState(!1);let V;e[13]===Symbol.for("react.memo_cache_sentinel")?(V=T=>{N(T),E(!0)},e[13]=V):V=e[13];const J=V;let F;e[14]===Symbol.for("react.memo_cache_sentinel")?(F=T=>{C(T),E(!0)},e[14]=F):F=e[14];const h=F;let S;e[15]===Symbol.for("react.memo_cache_sentinel")?(S=T=>{O(T),E(!0)},e[15]=S):S=e[15];const I=S;let R;e[16]===Symbol.for("react.memo_cache_sentinel")?(R=Ge(Pt),e[16]=R):R=e[16];const D=t.tool_selection_mode??"inclusion",z=t.tool_selection_strategy??"passthrough";let P;e[17]!==t.description||e[18]!==t.status||e[19]!==t.title||e[20]!==D||e[21]!==z?(P={resolver:R,defaultValues:{title:t.title,description:t.description,status:t.status,tool_selection_mode:D,tool_selection_strategy:z}},e[17]=t.description,e[18]=t.status,e[19]=t.title,e[20]=D,e[21]=z,e[22]=P):P=e[22];const k=Ue(P),G=k.formState.isDirty||q;let U;e[23]!==c.update||e[24]!==f||e[25]!==k||e[26]!==o||e[27]!==v||e[28]!==b||e[29]!==w?(U=async()=>{const T=k.getValues(),ge=At(w,b,v,f);await c.update.mutateAsync({id:o,data:{title:T.title,description:T.description,status:T.status,tool_selection_mode:T.tool_selection_mode,tool_selection_strategy:T.tool_selection_strategy,connections:ge}}),k.reset(T),E(!1)},e[23]=c.update,e[24]=f,e[25]=k,e[26]=o,e[27]=v,e[28]=b,e[29]=w,e[30]=U):U=e[30];const B=U;let L;e[31]===Symbol.for("react.memo_cache_sentinel")?(L=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[31]=L):L=e[31];const le=L,A=le.some(T=>T.id===i)?i:"settings";let X;e[32]!==u?(X=T=>{u({search:ge=>({...ge,tab:T}),replace:!0})},e[32]=u,e[33]=X):X=e[33];const K=X;let Q;e[34]!==l.history?(Q=()=>l.history.back(),e[34]=l.history,e[35]=Q):Q=e[35];let Z;e[36]!==A||e[37]!==K?(Z=s.jsx(lt,{children:s.jsx(nt,{tabs:le,activeTab:A,onTabChange:K})}),e[36]=A,e[37]=K,e[38]=Z):Z=e[38];let ee;e[39]!==c.update.isPending||e[40]!==B||e[41]!==G?(ee=G&&s.jsxs(H,{onClick:B,disabled:c.update.isPending,size:"sm",className:"h-7",children:[c.update.isPending&&s.jsx(be,{size:16,className:"mr-2 animate-spin"}),"Save Changes"]}),e[39]=c.update.isPending,e[40]=B,e[41]=G,e[42]=ee):ee=e[42];let te;e[43]!==ee?(te=s.jsx(rt,{children:ee}),e[43]=ee,e[44]=te):te=e[44];let xe;e[45]===Symbol.for("react.memo_cache_sentinel")?(xe=s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(be,{size:32,className:"animate-spin text-muted-foreground"})}),e[45]=xe):xe=e[45];let se;e[46]!==A||e[47]!==j||e[48]!==p||e[49]!==k||e[50]!==t||e[51]!==v||e[52]!==b||e[53]!==w?(se=A==="settings"?s.jsx(Et,{form:k,gateway:t,icon:t.icon}):A==="tools"?s.jsx(Je,{toolSet:w,onToolSetChange:J}):A==="resources"?s.jsx(pt,{resourceSet:b,onResourceSetChange:h,connectionResources:p}):A==="prompts"?s.jsx(ut,{promptSet:v,onPromptSetChange:I,connectionPrompts:j}):null,e[46]=A,e[47]=j,e[48]=p,e[49]=k,e[50]=t,e[51]=v,e[52]=b,e[53]=w,e[54]=se):se=e[54];let ne;e[55]!==se?(ne=s.jsx($.Suspense,{fallback:xe,children:se}),e[55]=se,e[56]=ne):ne=e[56];let oe;e[57]!==A||e[58]!==ne?(oe=s.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:s.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:s.jsx(Te,{children:ne},A)})}),e[57]=A,e[58]=ne,e[59]=oe):oe=e[59];let pe;return e[60]!==Q||e[61]!==Z||e[62]!==te||e[63]!==oe?(pe=s.jsxs(it,{onBack:Q,children:[Z,te,oe]}),e[60]=Q,e[61]=Z,e[62]=te,e[63]=oe,e[64]=pe):pe=e[64],pe}function Ut(n){return n.name}function Lt(n){return n.id}function Jt(){const n=M.c(10);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},n[0]=e):e=n[0];const t=Ne(e);let o;n[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/gateways/$gatewayId"},n[1]=o):o=n[1];const{gatewayId:i,org:l}=Me(o);let r;n[2]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/gateways/$gatewayId"},n[2]=r):r=n[2];const c=Oe(r).tab||"settings",a=He(i);if(!a){let m;return n[3]!==t||n[4]!==l?(m=s.jsx("div",{className:"flex h-full w-full bg-background",children:s.jsx(Le,{title:"Gateway not found",description:"This gateway may have been deleted or you may not have access.",actions:s.jsx(H,{variant:"outline",onClick:()=>t({to:"/$org/gateways",params:{org:l}}),children:"Back to gateways"})})}),n[3]=t,n[4]=l,n[5]=m):m=n[5],m}let d;return n[6]!==a||n[7]!==i||n[8]!==c?(d=s.jsx(Gt,{gateway:a,gatewayId:i,requestedTabId:c}),n[6]=a,n[7]=i,n[8]=c,n[9]=d):d=n[9],d}function Bt(){const n=M.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Te,{children:s.jsx($.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:s.jsx(be,{size:32,className:"animate-spin text-muted-foreground"})}),children:s.jsx(Jt,{})})}),n[0]=e):e=n[0],e}function ys(){const n=M.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Bt,{}),n[0]=e):e=n[0],e}export{ys as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,a8 as q,B as R,R as Ee,P as ke,O as Se,C as xe,bq as j}from"./index-CzwYLjKx.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:U=!1,vimBindings:A=!0,...O}=t,H=q(),ne=q(),N=q(),M=n.useRef(null),w=We();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")J(),W(),w(1,G);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(N);y?y.focus():(a=document.getElementById(H))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),T=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{W(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{J(),W(),r.current.value||G(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{J(),s?.getAttribute("id")===e&&G(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:H,inputId:N,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function W(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function G(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function J(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function X(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?Ne(s,V):Te(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>X(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),X(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:T.inputId,id:T.labelId,style:Je},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:T},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;U(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function U(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:H,forceMount:ne,keywords:N,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:U,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ue=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),He=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Be,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:ze,Empty:Ue,Loading:He});function Ne(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Te(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{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():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var We=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Ge(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Ge(l),{ref:l.ref},r(l.props.children)):r(l)}var Je={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ak as o}from"./index-CzwYLjKx.js";import{r}from"./json-BESjz4hO.js";var s=r();const e=o(s);export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,h as i}from"./core-DEFgD5b5.js";import{ak as s}from"./index-CzwYLjKx.js";var g=o();const t=s(g);var e=i(t,{});e.registerLanguage=function(a,r){return t.register(r)};e.alias=function(a,r){return t.alias(a,r)};export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{at as u,ap as s}from"./index-CzwYLjKx.js";function t(e,r){return u(e,s,r)}export{t as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{be as e,V as t}from"./index-CzwYLjKx.js";function n(...r){return e(t(r))}export{n as c};
|