@decocms/mesh 1.0.0-alpha.21 → 1.0.0-alpha.22
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/{alert-dialog-LOlFjjTl.js → alert-dialog-SFOK6jVt.js} +1 -1
- package/dist/client/assets/{auth-CwWr2e4Y.js → auth-DVZysXgn.js} +1 -1
- package/dist/client/assets/{auth-catchall-BEa5H3qI.js → auth-catchall-DnTJzHE6.js} +1 -1
- package/dist/client/assets/{avatar-DMYSx92d.js → avatar-DXWXW2D9.js} +1 -1
- package/dist/client/assets/{badge-_HmQS9RA.js → badge-DdZ6WWL4.js} +1 -1
- package/dist/client/assets/{button-ClXDbbMi.js → button-a-f_QGwE.js} +1 -1
- package/dist/client/assets/{card-b_g2O0__.js → card-CoTR2BRq.js} +1 -1
- package/dist/client/assets/{checkbox-CR-AnfC5.js → checkbox-xUpImUGX.js} +1 -1
- package/dist/client/assets/{circle-alert-BbU4d9mh.js → circle-alert-vRjzHVZa.js} +1 -1
- package/dist/client/assets/{collection-detail-C544Tulj.js → collection-detail-CW3Ypihz.js} +1 -1
- package/dist/client/assets/{collection-display-button-BySMuzWq.js → collection-display-button-CsjbEnNB.js} +1 -1
- package/dist/client/assets/{collection-header-BXd90zRo.js → collection-header-BOidrCph.js} +1 -1
- package/dist/client/assets/{collection-page-Dg7E39Si.js → collection-page-jjfHUK0N.js} +1 -1
- package/dist/client/assets/{collection-search-BjnhZZGk.js → collection-search-mG8LyvuA.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D8f7Qifs.js → collection-table-wrapper-C2C7zUkI.js} +1 -1
- package/dist/client/assets/{connection-card-D7zQGQYz.js → connection-card-FwvHBANG.js} +1 -1
- package/dist/client/assets/{connection-detail-BH0p--Hy.js → connection-detail-B7zugsU8.js} +1 -1
- package/dist/client/assets/{connections-wMsSy4Mm.js → connections-Qm1RDm9i.js} +1 -1
- package/dist/client/assets/core-RpjIO9ve.js +6 -0
- package/dist/client/assets/{create-organization-dialog-BubXK60q.js → create-organization-dialog-DO93gNH_.js} +1 -1
- package/dist/client/assets/{dialog-xPRrmp7z.js → dialog-7Hp_Rfs5.js} +1 -1
- package/dist/client/assets/{dropdown-menu-C-LSqc0S.js → dropdown-menu-BgPAXaVp.js} +1 -1
- package/dist/client/assets/{empty-state-DPOQjIuU.js → empty-state-WNgz9fCm.js} +1 -1
- package/dist/client/assets/{error-boundary-D7WkdRMW.js → error-boundary-BiEWgYTq.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CW6O9gmA.js → extract-connection-data-BxXB87qU.js} +1 -1
- package/dist/client/assets/{form-M-vi9HJy.js → form-DfOMWaCI.js} +1 -1
- package/dist/client/assets/{gateway-detail-BlrCL27J.js → gateway-detail-CekGOa65.js} +1 -1
- package/dist/client/assets/{gateways-CfKdyqGb.js → gateways-D7wgat-S.js} +1 -1
- package/dist/client/assets/{home-DbkWPP-f.js → home-CBscUryL.js} +1 -1
- package/dist/client/assets/{icon-CpE1QQq1.js → icon-OJY1qvap.js} +1 -1
- package/dist/client/assets/{index-DQWn94Sm.js → index-BGqdpa9H.js} +1 -1
- package/dist/client/assets/index-BMLzl8gY.css +1 -0
- package/dist/client/assets/{index-iWvwzdJJ.js → index-CpLt3yXK.js} +2 -2
- package/dist/client/assets/{index-D66zjDTW.js → index-DCBFOKhf.js} +1 -1
- package/dist/client/assets/{index-D7HQTC8F.js → index-mHl2jc64.js} +1 -1
- package/dist/client/assets/{input-D7PefFT1.js → input-DADGlXgX.js} +1 -1
- package/dist/client/assets/json-BESjz4hO.js +1 -0
- package/dist/client/assets/json-DUg1mNkp.js +1 -0
- package/dist/client/assets/{layout-BN6Ub_26.js → layout-D3oF0UXv.js} +1 -1
- package/dist/client/assets/lazy-highlighter-YPXkqk41.js +4 -0
- package/dist/client/assets/{localstorage-keys-COlnduT8.js → localstorage-keys-CLnHFhAZ.js} +1 -1
- package/dist/client/assets/{login-COuwJCat.js → login-nnqyC_26.js} +1 -1
- package/dist/client/assets/{mcp-oauth-D5AjcROD.js → mcp-oauth-I-dydWHT.js} +1 -1
- package/dist/client/assets/{members-WpibmQVt.js → members-DU6eKV9F.js} +1 -1
- package/dist/client/assets/monitoring-DTlGGDV7.js +1 -0
- package/dist/client/assets/{oauth-callback-BjJButzO.js → oauth-callback-CeQyWBYb.js} +1 -1
- package/dist/client/assets/page-vOsPd38r.js +21 -0
- package/dist/client/assets/{popover-X2TCYYoO.js → popover-BLFYmlOn.js} +1 -1
- package/dist/client/assets/prism-light-WgmBP48C.js +1 -0
- package/dist/client/assets/{resource-tabs-DJxrLcw9.js → resource-tabs-DG4A8tWW.js} +1 -1
- package/dist/client/assets/{schema-BlDiNtux.js → schema-D8ew0NM5.js} +1 -1
- package/dist/client/assets/{select-BzKSHZ1p.js → select-z4npQPjw.js} +1 -1
- package/dist/client/assets/{settings-CGbg0Uhj.js → settings-CmmfDzw9.js} +1 -1
- package/dist/client/assets/{shell-layout-5TgCCYHu.js → shell-layout-DlUj14rs.js} +3 -3
- package/dist/client/assets/{spinner-DgsZg1gV.js → spinner-D5s5xc0Q.js} +1 -1
- package/dist/client/assets/store-RIWxa-nd.js +1 -0
- package/dist/client/assets/{store-app-detail-CUVP0G9m.js → store-app-detail-BTgKTQqK.js} +1 -1
- package/dist/client/assets/{switch-B7wMHRyR.js → switch-C9-eZe0E.js} +1 -1
- package/dist/client/assets/{textarea-CN9WqqXs.js → textarea-Dedeyf1a.js} +1 -1
- package/dist/client/assets/{tool-set-selector-CAybF3Fs.js → tool-set-selector-BV79VfYU.js} +1 -1
- package/dist/client/assets/{tooltip-_hZbWxgK.js → tooltip-B2bk3ddo.js} +1 -1
- package/dist/client/assets/types-DtXr_1NB.js +45 -0
- package/dist/client/assets/{upload-DcKqFAI8.js → upload-CS-gkuco.js} +1 -1
- package/dist/client/assets/{use-binding-BkavlI5c.js → use-binding-BUb3VGJz.js} +1 -1
- package/dist/client/assets/{use-connection-Br2g1_CM.js → use-connection-dLAoYo7_.js} +1 -1
- package/dist/client/assets/{use-gateway-Dl3vJTlg.js → use-gateway-BauM1JmV.js} +1 -1
- package/dist/client/assets/{use-list-state-BDAqfcqe.js → use-list-state-8Cb6Qj6h.js} +1 -1
- package/dist/client/assets/{use-mcp-DVKHV8dD.js → use-mcp-QQ5h4Jus.js} +1 -1
- package/dist/client/assets/{use-members-DPWOkgG6.js → use-members-BPiAXAIc.js} +1 -1
- package/dist/client/assets/{use-mobile-Dnm1tIHK.js → use-mobile-Clv5smUY.js} +1 -1
- package/dist/client/assets/{use-organization-settings-TIV8vyJm.js → use-organization-settings-B1r4lAAM.js} +1 -1
- package/dist/client/assets/{use-tool-call-COaWtA3Y.js → use-tool-call-Cbu6Hh2e.js} +1 -1
- package/dist/client/assets/useQuery-Dz8EP3Do.js +1 -0
- package/dist/client/assets/utils-DvXhQGkY.js +1 -0
- package/dist/client/assets/well-known-mcp-Dg77mwx9.js +1 -0
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/client/assets/index-yMf3L_oA.css +0 -1
- package/dist/client/assets/lazy-highlighter-hJ2PAlmJ.js +0 -1
- package/dist/client/assets/monitoring-kuEsi7x-.js +0 -1
- package/dist/client/assets/monitoring-stats-row-C0O2iCrN.js +0 -42
- package/dist/client/assets/page-DWgH6O_a.js +0 -21
- package/dist/client/assets/prism-CF4Q8IpQ.js +0 -9
- package/dist/client/assets/store-ppjlqJwO.js +0 -1
- package/dist/client/assets/useQuery-CrTgBBMI.js +0 -1
- package/dist/client/assets/utils---jHV5W_.js +0 -1
- package/dist/client/assets/well-known-mcp-Dq2j3ucM.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as A,j as s,bc as we,r as le,a5 as be,d as Ce,b as Te,a as _e,a6 as ge}from"./index-iWvwzdJJ.js";import{I}from"./icon-CpE1QQq1.js";import{B as ie}from"./button-ClXDbbMi.js";import{I as ve,d as ke,b as Se,a as Ie,c as Ae}from"./use-connection-Br2g1_CM.js";import{b as Le,D as De,a as Me,c as Ee}from"./dropdown-menu-C-LSqc0S.js";import{E as Ue}from"./empty-state-DPOQjIuU.js";import{R as Ve,T as Pe,a as Re}from"./resource-tabs-DJxrLcw9.js";import{a as $e}from"./use-binding-BkavlI5c.js";import{u as ze}from"./use-tool-call-COaWtA3Y.js";import{u as Be}from"./use-mcp-DVKHV8dD.js";import{u as je}from"./tooltip-_hZbWxgK.js";import{e as Ge}from"./extract-connection-data-CW6O9gmA.js";import{s as Fe}from"./slugify-CEUa2lfQ.js";import{f as Oe,e as He,b as We,c as Ke,g as qe}from"./registry-utils-ulDDT0d8.js";import{e as Je}from"./app-name-gTETL9So.js";import"./utils---jHV5W_.js";import"./useQuery-CrTgBBMI.js";import"./collection-display-button-BySMuzWq.js";import"./collection-search-BjnhZZGk.js";import"./input-D7PefFT1.js";import"./collection-table-wrapper-D8f7Qifs.js";import"./card-b_g2O0__.js";import"./layout-BN6Ub_26.js";import"./badge-_HmQS9RA.js";import"./auth-CwWr2e4Y.js";import"./generate-id-Dyweu44Y.js";function Qe(t){const e=A.c(3),{message:o}=t,n=o===void 0?"Loading app details...":o;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(I,{name:"progress_activity",size:48,className:"animate-spin mb-4"}),e[0]=r):r=e[0];let i;return e[1]!==n?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,s.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}),e[1]=n,e[2]=i):i=e[2],i}function Xe(t){const e=A.c(9),{error:o,onBack:n}=t,r=o instanceof Error?o.message:o;let i,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(I,{name:"error",size:48,className:"text-destructive mb-4"}),d=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading app"}),e[0]=i,e[1]=d):(i=e[0],d=e[1]);let a;e[2]!==r?(a=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:r}),e[2]=r,e[3]=a):a=e[3];let l;e[4]!==n?(l=s.jsx("button",{onClick:n,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=n,e[5]=l):l=e[5];let m;return e[6]!==a||e[7]!==l?(m=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,d,a,l]}),e[6]=a,e[7]=l,e[8]=m):m=e[8],m}function Ye(t){const e=A.c(5),{onBack:o}=t;let n,r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(I,{name:"search_off",size:48,className:"text-muted-foreground mb-4"}),r=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"App not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The app you're looking for doesn't exist in this store."}),e[0]=n,e[1]=r,e[2]=i):(n=e[0],r=e[1],i=e[2]);let d;return e[3]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,r,i,s.jsx("button",{onClick:o,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=o,e[4]=d):d=e[4],d}function Ze(t){const e=A.c(3),{onBack:o}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(we,{}),e[0]=n):n=e[0];let r;return e[1]!==o?(r=s.jsx("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:s.jsx("div",{className:"flex h-full px-2 border-r items-center",children:s.jsx(ie,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:n})})}),e[1]=o,e[2]=r):r=e[2],r}function et(t){const e=A.c(25),{data:o,itemVersions:n,onInstall:r,canInstall:i,isInstalling:d}=t,a=i===void 0?!0:i,l=d===void 0?!1:d,[m,p]=le.useState(0);let x;e[0]!==r?(x=k=>{p(k),r(k)},e[0]=r,e[1]=x):x=e[1];const f=x;let h;e[2]!==o.icon||e[3]!==o.name?(h=s.jsx(ve,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[2]=o.icon,e[3]=o.name,e[4]=h):h=e[4];let g;e[5]!==o.name?(g=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[5]=o.name,e[6]=g):g=e[6];let b;e[7]!==o.verified?(b=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[7]=o.verified,e[8]=b):b=e[8];let y;e[9]!==g||e[10]!==b?(y=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[g,b]})}),e[9]=g,e[10]=b,e[11]=y):y=e[11];let N;e[12]!==a||e[13]!==f||e[14]!==l||e[15]!==n||e[16]!==r||e[17]!==m?(N=a?s.jsx("div",{className:"shrink-0",children:n.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ie,{variant:"brand",onClick:()=>f(0),disabled:l,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(I,{name:"add",size:20}),l?"Connecting...":"Connect MCP Server"]}),s.jsxs(Le,{children:[s.jsx(De,{asChild:!0,children:s.jsx(ie,{variant:"brand",disabled:l,className:"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer",children:s.jsx(I,{name:"expand_more",size:20})})}),s.jsx(Me,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:n.map((k,C)=>{const S=k._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(Ee,{onClick:()=>f(C),disabled:l,className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"font-medium text-sm",children:["v",k.server?.version||"unknown"]}),S?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),C===m&&s.jsx(I,{name:"check_circle",size:16,className:"text-muted-foreground shrink-0"})]})},C)})})]})]}):s.jsxs(ie,{variant:"brand",onClick:()=>r(),disabled:n.length===0||l,className:"shrink-0",children:[s.jsx(I,{name:"add",size:20}),l?"Connecting...":"Connect MCP Server"]})}):s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[12]=a,e[13]=f,e[14]=l,e[15]=n,e[16]=r,e[17]=m,e[18]=N):N=e[18];let w;e[19]!==y||e[20]!==N?(w=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[y,N]}),e[19]=y,e[20]=N,e[21]=w):w=e[21];let _;return e[22]!==h||e[23]!==w?(_=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[h,w]}),e[22]=h,e[23]=w,e[24]=_):_=e[24],_}function tt(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function st(t){const e=A.c(45),{data:o,publisherInfo:n,selectedItem:r}=t;let i;e[0]!==o.description?(i=o.description&&s.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[s.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),s.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:o.description})]}),e[0]=o.description,e[1]=i):i=e[1];const d=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let a;e[2]!==n.logo||e[3]!==d?(a=s.jsx(ve,{icon:n.logo,name:d,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=n.logo,e[3]=d,e[4]=a):a=e[4];let l;e[5]!==o.publisher?(l=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher.charAt(0).toUpperCase()+o.publisher.slice(1),e[5]=o.publisher,e[6]=l):l=e[6];let m;e[7]!==l?(m=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=m):m=e[8];let p;e[9]!==n.count?(p=n.count>0?s.jsxs(s.Fragment,{children:[s.jsx("img",{src:"/globe.svg",alt:"globe",className:"w-3 h-3"}),s.jsxs("span",{children:[n.count," ",n.count===1?"published app":"published apps"]})]}):"Publisher",e[9]=n.count,e[10]=p):p=e[10];let x;e[11]!==p?(x=s.jsx("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:p}),e[11]=p,e[12]=x):x=e[12];let f;e[13]!==m||e[14]!==x?(f=s.jsxs("div",{children:[m,x]}),e[13]=m,e[14]=x,e[15]=f):f=e[15];let h;e[16]!==a||e[17]!==f?(h=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[a,f]})}),e[16]=a,e[17]=f,e[18]=h):h=e[18];let g;e[19]!==o.version?(g=o.version&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Version"}),s.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",o.version]})]}),e[19]=o.version,e[20]=g):g=e[20];let b;e[21]!==o.connectionType?(b=o.connectionType&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:o.connectionType})]}),e[21]=o.connectionType,e[22]=b):b=e[22];let y;e[23]!==o.schemaVersion?(y=o.schemaVersion&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:o.schemaVersion})]}),e[23]=o.schemaVersion,e[24]=y):y=e[24];let N;e[25]!==o.websiteUrl?(N=o.websiteUrl&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Website"}),s.jsxs("a",{href:o.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"Visit"}),s.jsx(I,{name:"open_in_new",size:14})]})]}),e[25]=o.websiteUrl,e[26]=N):N=e[26];let w;e[27]!==o.repository?(w=o.repository?.url&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Source"}),s.jsxs("a",{href:o.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"GitHub"}),s.jsx(I,{name:"open_in_new",size:14})]})]}),e[27]=o.repository,e[28]=w):w=e[28];let _;e[29]!==g||e[30]!==b||e[31]!==y||e[32]!==N||e[33]!==w?(_=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[g,b,y,N,w]}),e[29]=g,e[30]=b,e[31]=y,e[32]=N,e[33]=w,e[34]=_):_=e[34];let k;e[35]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[35]=k):k=e[35];let C;e[36]!==r.updated_at?(C=tt(r.updated_at),e[36]=r.updated_at,e[37]=C):C=e[37];let S;e[38]!==C?(S=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[k,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:C})]}),e[38]=C,e[39]=S):S=e[39];let u;return e[40]!==i||e[41]!==_||e[42]!==S||e[43]!==h?(u=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,h,_,S]}),e[40]=i,e[41]=_,e[42]=S,e[43]=h,e[44]=u):u=e[44],u}function ot(t){const e=A.c(18),{data:o,availableTabs:n,effectiveActiveTabId:r,effectiveTools:i,isLoadingTools:d,onTabChange:a}=t,l=d===void 0?!1:d;let m;e[0]!==i?(m=i.map(rt),e[0]=i,e[1]=m):m=e[1];const p=m;let x;e[2]!==n||e[3]!==r||e[4]!==a?(x=n.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(Ve,{tabs:n,activeTab:r,onTabChange:a})}),e[2]=n,e[3]=r,e[4]=a,e[5]=x):x=e[5];let f;e[6]!==r||e[7]!==i.length||e[8]!==l||e[9]!==p?(f=r==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:l?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(I,{name:"progress_activity",size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(Pe,{tools:p,showToolbar:!1,emptyMessage:"This app doesn't have any tools."}):s.jsx(Ue,{image:null,title:"No tools available",description:"This app doesn't have any tools."})}),e[6]=r,e[7]=i.length,e[8]=l,e[9]=p,e[10]=f):f=e[10];let h;e[11]!==o?.repository||e[12]!==r?(h=r==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Re,{repository:o?.repository})}),e[11]=o?.repository,e[12]=r,e[13]=h):h=e[13];let g;return e[14]!==x||e[15]!==f||e[16]!==h?(g=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[x,f,h]}),e[14]=x,e[15]=f,e[16]=h,e[17]=g):g=e[17],g}function rt(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function nt(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(n=>n.app_name?.toLowerCase()===o||n.app_id?.toLowerCase()===o||n.title.toLowerCase()===o)||t.find(n=>n.title.toLowerCase().includes(o))}function it(t,e,o,n,r){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:n?.icon||void 0,count:r??t.length};const i=e.toLowerCase(),d=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:o?.icon||d[0]?.publisher_logo||d[0]?.icon||void 0,count:d.length}}function lt(t){const e=t.server._meta?.["mcp.mesh/publisher-provided"],o=t._meta?.["mcp.mesh"],n=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,i=We(r.remotes?.[0]?.type),d=Ke(r.$schema),a=n?"io.modelcontextprotocol.registry/official":t.publisher||o?.scopeName||"Unknown",l=qe(r.repository),m=t.icon||t.image||t.logo||r.icons?.[0]?.src||l||null,p=t.name||t.title||t.server?.title||"Unnamed Item";return{name:Je(p),description:t.description||t.summary||t.server?.description||"",icon:m,verified:t.verified||o?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:d??null,connectionType:i,connectionUrl:null,remoteUrl:null,tools:t.tools||r.tools||e?.tools||[],models:t.models||r.models||e?.models||[],emails:t.emails||r.emails||e?.emails||[],analytics:t.analytics||r.analytics||e?.analytics,cdn:t.cdn||r.cdn||e?.cdn}}class at extends le.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store app detail error:",e,o)}render(){return this.state.hasError?s.jsx(Xe,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ct(){const t=A.c(70),{org:e}=je(),o=be();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const{appName:r}=Ce(n);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:d,serverName:a}=Te(i),[l,m]=le.useState("readme"),p=ke(),x=Se(),{data:f}=_e.useSession(),h=$e(x),g=d||h[0]?.id||"",b=Ie(g),y=Oe(b?.tools),N=b?.tools&&b.tools.find(pt)?.name||"",w=b?.tools&&b.tools.find(ut)?.name||"",_=Ae(g),k=!!a;let C,S;k?(C=N||w,S={name:a}):(C=y,S={});const{data:u}=ze({toolCaller:_,toolName:C,toolInputParams:S,scope:g});let E=[],L=[],xe=null;if(u){if(Array.isArray(u))E=u;else if(typeof u=="object"&&u!==null)if("totalCount"in u&&typeof u.totalCount=="number"&&(xe=u.totalCount),"item"in u&&u.item){const c=u.item,T=c.id||"",U=c.server,V=c._meta;let M;t[2]!==c.title||t[3]!==T||t[4]!==U||t[5]!==V?(M=[{id:T,title:c.title,server:U,_meta:V}],t[2]=c.title,t[3]=T,t[4]=U,t[5]=V,t[6]=M):M=t[6],E=M}else{let c;"versions"in u&&Array.isArray(u.versions)?c="versions":"servers"in u&&Array.isArray(u.servers)?c="servers":c=Object.keys(u).find(T=>Array.isArray(u[T])),c&&(E=u[c],(c==="versions"||C?.includes("VERSIONS"))&&(L=E))}}let Y;t[7]!==r?(Y=c=>{const T=c.name||c.title||c.server.title||"";return Fe(T)===r},t[7]=r,t[8]=Y):Y=t[8];let j=E.find(Y);if(!j&&a){let c;t[9]!==a?(c=T=>T.server.name===a||T.name===a||T.title===a,t[9]=a,t[10]=c):c=t[10],j=E.find(c)}const v=j?lt(j):null,ae=(v?.tools?.length||0)>0,ce=j?.server?.remotes?.[0]?.url||null,Q=!ae&&!!ce,X=Be({url:Q?ce:""}),Z=Q&&X.state==="connecting";let ee;t[11]!==X||t[12]!==Q?(ee=Q&&X.state==="ready"?(X.tools||[]).map(ft):[],t[11]=X,t[12]=Q,t[13]=ee):ee=t[13];const he=ee,P=ae?v?.tools||[]:he,ye=nt(x,v?.publisher),de=v?it(E,v.publisher,ye,b??null,xe):{count:0},Ne=v?.repository?He(v.repository):null,me=!!v?.repository&&!!Ne;let R;t[14]!==me?(R={id:"readme",label:"README",visible:me},t[14]=me,t[15]=R):R=t[15];const fe=ae||he.length>0||Z&&!!ce;let $;t[16]!==P.length||t[17]!==fe?($={id:"tools",label:"Tools",count:P.length,visible:fe},t[16]=P.length,t[17]=fe,t[18]=$):$=t[18];let te;t[19]!==R||t[20]!==$?(te=[R,$].filter(mt),t[19]=R,t[20]=$,t[21]=te):te=t[21];const D=te;let se;t[22]!==l||t[23]!==D?(se=D.find(c=>c.id===l)?l:D.find(dt)?.id||D[0]?.id||"overview",t[22]=l,t[23]=D,t[24]=se):se=t[24];const ue=se;let oe;t[25]!==p||t[26]!==L||t[27]!==o||t[28]!==e||t[29]!==j||t[30]!==f?(oe=async c=>{const T=L[c??0]||j;if(!T||!e||!f?.user?.id)return;const U=Ge(T,e.id,f.user.id);if(!U.connection_url){ge.error("This MCP Server cannot be connected: no connection URL available");return}try{const{id:V}=await p.create.mutateAsync(U);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:V}})}catch(V){const M=V;ge.error(`Failed to connect MCP Server: ${M instanceof Error?M.message:String(M)}`)}},t[25]=p,t[26]=L,t[27]=o,t[28]=e,t[29]=j,t[30]=f,t[31]=oe):oe=t[31];const pe=oe;let re;t[32]!==o||t[33]!==e.slug?(re=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[32]=o,t[33]=e.slug,t[34]=re):re=t[34];const z=re;if(!j){let c;return t[35]!==z?(c=s.jsx(Ye,{onBack:z}),t[35]=z,t[36]=c):c=t[36],c}if(!v)return null;const B=(j?.server?.remotes?.length??0)>0;let G;t[37]!==z?(G=s.jsx(Ze,{onBack:z}),t[37]=z,t[38]=G):G=t[38];let F;t[39]!==B?(F=!B&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(I,{name:"info",size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[39]=B,t[40]=F):F=t[40];let O;t[41]!==L||t[42]!==j?(O=L.length>0?L:[j],t[41]=L,t[42]=j,t[43]=O):O=t[43];let H;t[44]!==p.create.isPending||t[45]!==B||t[46]!==v||t[47]!==pe||t[48]!==O?(H=s.jsx(et,{data:v,itemVersions:O,onInstall:pe,canInstall:B,isInstalling:p.create.isPending}),t[44]=p.create.isPending,t[45]=B,t[46]=v,t[47]=pe,t[48]=O,t[49]=H):H=t[49];let W;t[50]!==v||t[51]!==de||t[52]!==j?(W=s.jsx(st,{data:v,publisherInfo:de,selectedItem:j}),t[50]=v,t[51]=de,t[52]=j,t[53]=W):W=t[53];let K;t[54]!==D||t[55]!==v||t[56]!==ue||t[57]!==P||t[58]!==Z?(K=s.jsx(ot,{data:v,availableTabs:D,effectiveActiveTabId:ue,effectiveTools:P,isLoadingTools:Z,onTabChange:m}),t[54]=D,t[55]=v,t[56]=ue,t[57]=P,t[58]=Z,t[59]=K):K=t[59];let q;t[60]!==W||t[61]!==K?(q=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[W,K]}),t[60]=W,t[61]=K,t[62]=q):q=t[62];let J;t[63]!==F||t[64]!==H||t[65]!==q?(J=s.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:s.jsx("div",{className:"h-full",children:s.jsxs("div",{className:"h-full",children:[F,H,q]})})}),t[63]=F,t[64]=H,t[65]=q,t[66]=J):J=t[66];let ne;return t[67]!==G||t[68]!==J?(ne=s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[G,J]}),t[67]=G,t[68]=J,t[69]=ne):ne=t[69],ne}function dt(t){return t.id==="readme"}function mt(t){return t.visible}function ft(t){return{name:t.name,description:t.description}}function ut(t){return t.name.endsWith("_GET")}function pt(t){return t.name.endsWith("_VERSIONS")}function Bt(){const t=A.c(6),{org:e}=je(),o=be();let n;t[0]!==o||t[1]!==e.slug?(n=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=n):n=t[2];const r=n;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(le.Suspense,{fallback:s.jsx(Qe,{}),children:s.jsx(ct,{})}),t[3]=i):i=t[3];let d;return t[4]!==r?(d=s.jsx(at,{onBack:r,children:i}),t[4]=r,t[5]=d):d=t[5],d}export{Bt as default};
|
|
1
|
+
import{c as A,j as s,bc as we,r as le,a5 as be,d as Ce,b as Te,a as _e,a6 as ge}from"./index-CpLt3yXK.js";import{I}from"./icon-OJY1qvap.js";import{B as ie}from"./button-a-f_QGwE.js";import{I as ve,d as ke,b as Se,a as Ie,c as Ae}from"./use-connection-dLAoYo7_.js";import{b as Le,D as De,a as Me,c as Ee}from"./dropdown-menu-BgPAXaVp.js";import{E as Ue}from"./empty-state-WNgz9fCm.js";import{R as Ve,T as Pe,a as Re}from"./resource-tabs-DG4A8tWW.js";import{a as $e}from"./use-binding-BUb3VGJz.js";import{u as ze}from"./use-tool-call-Cbu6Hh2e.js";import{u as Be}from"./use-mcp-QQ5h4Jus.js";import{u as je}from"./tooltip-B2bk3ddo.js";import{e as Ge}from"./extract-connection-data-BxXB87qU.js";import{s as Fe}from"./slugify-CEUa2lfQ.js";import{f as Oe,e as He,b as We,c as Ke,g as qe}from"./registry-utils-ulDDT0d8.js";import{e as Je}from"./app-name-gTETL9So.js";import"./utils-DvXhQGkY.js";import"./useQuery-Dz8EP3Do.js";import"./collection-display-button-CsjbEnNB.js";import"./collection-search-mG8LyvuA.js";import"./input-DADGlXgX.js";import"./collection-table-wrapper-C2C7zUkI.js";import"./card-CoTR2BRq.js";import"./layout-D3oF0UXv.js";import"./badge-DdZ6WWL4.js";import"./auth-DVZysXgn.js";import"./generate-id-Dyweu44Y.js";function Qe(t){const e=A.c(3),{message:o}=t,n=o===void 0?"Loading app details...":o;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(I,{name:"progress_activity",size:48,className:"animate-spin mb-4"}),e[0]=r):r=e[0];let i;return e[1]!==n?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r,s.jsx("p",{className:"text-sm text-muted-foreground",children:n})]}),e[1]=n,e[2]=i):i=e[2],i}function Xe(t){const e=A.c(9),{error:o,onBack:n}=t,r=o instanceof Error?o.message:o;let i,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(I,{name:"error",size:48,className:"text-destructive mb-4"}),d=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Error loading app"}),e[0]=i,e[1]=d):(i=e[0],d=e[1]);let a;e[2]!==r?(a=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:r}),e[2]=r,e[3]=a):a=e[3];let l;e[4]!==n?(l=s.jsx("button",{onClick:n,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back"}),e[4]=n,e[5]=l):l=e[5];let m;return e[6]!==a||e[7]!==l?(m=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[i,d,a,l]}),e[6]=a,e[7]=l,e[8]=m):m=e[8],m}function Ye(t){const e=A.c(5),{onBack:o}=t;let n,r,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(I,{name:"search_off",size:48,className:"text-muted-foreground mb-4"}),r=s.jsx("h3",{className:"text-lg font-medium mb-2",children:"App not found"}),i=s.jsx("p",{className:"text-muted-foreground max-w-md text-center",children:"The app you're looking for doesn't exist in this store."}),e[0]=n,e[1]=r,e[2]=i):(n=e[0],r=e[1],i=e[2]);let d;return e[3]!==o?(d=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n,r,i,s.jsx("button",{onClick:o,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"Go Back to Store"})]}),e[3]=o,e[4]=d):d=e[4],d}function Ze(t){const e=A.c(3),{onBack:o}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(we,{}),e[0]=n):n=e[0];let r;return e[1]!==o?(r=s.jsx("div",{className:"flex items-center h-12 border-b border-border shrink-0",children:s.jsx("div",{className:"flex h-full px-2 border-r items-center",children:s.jsx(ie,{variant:"ghost",size:"icon",className:"items-center size-8 text-muted-foreground",onClick:o,"aria-label":"Go back",children:n})})}),e[1]=o,e[2]=r):r=e[2],r}function et(t){const e=A.c(25),{data:o,itemVersions:n,onInstall:r,canInstall:i,isInstalling:d}=t,a=i===void 0?!0:i,l=d===void 0?!1:d,[m,p]=le.useState(0);let x;e[0]!==r?(x=k=>{p(k),r(k)},e[0]=r,e[1]=x):x=e[1];const f=x;let h;e[2]!==o.icon||e[3]!==o.name?(h=s.jsx(ve,{icon:o.icon,name:o.name,size:"lg",className:"shrink-0 shadow-sm"}),e[2]=o.icon,e[3]=o.name,e[4]=h):h=e[4];let g;e[5]!==o.name?(g=s.jsx("h1",{className:"text-3xl font-medium",children:o.name}),e[5]=o.name,e[6]=g):g=e[6];let b;e[7]!==o.verified?(b=o.verified&&s.jsx("img",{src:"/verified-badge.svg",alt:"Verified",className:"w-5 h-5 shrink-0"}),e[7]=o.verified,e[8]=b):b=e[8];let y;e[9]!==g||e[10]!==b?(y=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[g,b]})}),e[9]=g,e[10]=b,e[11]=y):y=e[11];let N;e[12]!==a||e[13]!==f||e[14]!==l||e[15]!==n||e[16]!==r||e[17]!==m?(N=a?s.jsx("div",{className:"shrink-0",children:n.length>1?s.jsxs("div",{className:"flex",children:[s.jsxs(ie,{variant:"brand",onClick:()=>f(0),disabled:l,className:"shrink-0 rounded-r-none cursor-pointer",children:[s.jsx(I,{name:"add",size:20}),l?"Connecting...":"Connect MCP Server"]}),s.jsxs(Le,{children:[s.jsx(De,{asChild:!0,children:s.jsx(ie,{variant:"brand",disabled:l,className:"shrink-0 rounded-l-none px-2 border-l-2 border-l-white/50 cursor-pointer",children:s.jsx(I,{name:"expand_more",size:20})})}),s.jsx(Me,{align:"end",className:"w-56 max-h-[300px] overflow-y-auto",children:n.map((k,C)=>{const S=k._meta?.["io.modelcontextprotocol.registry/official"];return s.jsx(Ee,{onClick:()=>f(C),disabled:l,className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between gap-2 w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"font-medium text-sm",children:["v",k.server?.version||"unknown"]}),S?.isLatest&&s.jsx("div",{className:"text-xs text-muted-foreground/50 font-semibold",children:"LATEST"})]}),C===m&&s.jsx(I,{name:"check_circle",size:16,className:"text-muted-foreground shrink-0"})]})},C)})})]})]}):s.jsxs(ie,{variant:"brand",onClick:()=>r(),disabled:n.length===0||l,className:"shrink-0",children:[s.jsx(I,{name:"add",size:20}),l?"Connecting...":"Connect MCP Server"]})}):s.jsx("div",{className:"shrink-0 px-4 py-2 text-sm text-muted-foreground bg-muted rounded-lg",children:"Cannot be connected"}),e[12]=a,e[13]=f,e[14]=l,e[15]=n,e[16]=r,e[17]=m,e[18]=N):N=e[18];let w;e[19]!==y||e[20]!==N?(w=s.jsxs("div",{className:"flex-1 min-w-0 flex items-center justify-between",children:[y,N]}),e[19]=y,e[20]=N,e[21]=w):w=e[21];let _;return e[22]!==h||e[23]!==w?(_=s.jsxs("div",{className:"flex items-center gap-4 py-8 px-5 border-b border-border",children:[h,w]}),e[22]=h,e[23]=w,e[24]=_):_=e[24],_}function tt(t){if(!t)return"—";try{const e=new Date(t);return isNaN(e.getTime())?"—":e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return"—"}}function st(t){const e=A.c(45),{data:o,publisherInfo:n,selectedItem:r}=t;let i;e[0]!==o.description?(i=o.description&&s.jsxs("div",{className:"px-5 pb-5 border-b border-border",children:[s.jsx("h2",{className:"text-base font-medium mb-3",children:"Overview"}),s.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:o.description})]}),e[0]=o.description,e[1]=i):i=e[1];const d=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher;let a;e[2]!==n.logo||e[3]!==d?(a=s.jsx(ve,{icon:n.logo,name:d,size:"sm",className:"shrink-0 shadow-sm"}),e[2]=n.logo,e[3]=d,e[4]=a):a=e[4];let l;e[5]!==o.publisher?(l=o.publisher==="io.modelcontextprotocol.registry/official"?"Official Registry":o.publisher.charAt(0).toUpperCase()+o.publisher.slice(1),e[5]=o.publisher,e[6]=l):l=e[6];let m;e[7]!==l?(m=s.jsx("div",{className:"font-medium",children:l}),e[7]=l,e[8]=m):m=e[8];let p;e[9]!==n.count?(p=n.count>0?s.jsxs(s.Fragment,{children:[s.jsx("img",{src:"/globe.svg",alt:"globe",className:"w-3 h-3"}),s.jsxs("span",{children:[n.count," ",n.count===1?"published app":"published apps"]})]}):"Publisher",e[9]=n.count,e[10]=p):p=e[10];let x;e[11]!==p?(x=s.jsx("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:p}),e[11]=p,e[12]=x):x=e[12];let f;e[13]!==m||e[14]!==x?(f=s.jsxs("div",{children:[m,x]}),e[13]=m,e[14]=x,e[15]=f):f=e[15];let h;e[16]!==a||e[17]!==f?(h=s.jsx("div",{className:"px-5 border-b border-border",children:s.jsxs("div",{className:"flex items-center gap-3 py-5",children:[a,f]})}),e[16]=a,e[17]=f,e[18]=h):h=e[18];let g;e[19]!==o.version?(g=o.version&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Version"}),s.jsxs("span",{className:"text-muted-foreground uppercase text-xs",children:["v",o.version]})]}),e[19]=o.version,e[20]=g):g=e[20];let b;e[21]!==o.connectionType?(b=o.connectionType&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Connection Type"}),s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:o.connectionType})]}),e[21]=o.connectionType,e[22]=b):b=e[22];let y;e[23]!==o.schemaVersion?(y=o.schemaVersion&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Schema Version"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:o.schemaVersion})]}),e[23]=o.schemaVersion,e[24]=y):y=e[24];let N;e[25]!==o.websiteUrl?(N=o.websiteUrl&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Website"}),s.jsxs("a",{href:o.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"Visit"}),s.jsx(I,{name:"open_in_new",size:14})]})]}),e[25]=o.websiteUrl,e[26]=N):N=e[26];let w;e[27]!==o.repository?(w=o.repository?.url&&s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"text-foreground text-sm",children:"Source"}),s.jsxs("a",{href:o.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:underline flex items-center gap-1 text-xs",children:[s.jsx("span",{children:"GitHub"}),s.jsx(I,{name:"open_in_new",size:14})]})]}),e[27]=o.repository,e[28]=w):w=e[28];let _;e[29]!==g||e[30]!==b||e[31]!==y||e[32]!==N||e[33]!==w?(_=s.jsxs("div",{className:"px-5 py-5 border-b border-border space-y-4",children:[g,b,y,N,w]}),e[29]=g,e[30]=b,e[31]=y,e[32]=N,e[33]=w,e[34]=_):_=e[34];let k;e[35]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("span",{className:"text-foreground text-sm",children:"Last Updated"}),e[35]=k):k=e[35];let C;e[36]!==r.updated_at?(C=tt(r.updated_at),e[36]=r.updated_at,e[37]=C):C=e[37];let S;e[38]!==C?(S=s.jsxs("div",{className:"px-5 py-5 text-sm flex justify-between items-center border-b border-border",children:[k,s.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:C})]}),e[38]=C,e[39]=S):S=e[39];let u;return e[40]!==i||e[41]!==_||e[42]!==S||e[43]!==h?(u=s.jsxs("div",{className:"lg:col-span-1 flex flex-col pt-5",children:[i,h,_,S]}),e[40]=i,e[41]=_,e[42]=S,e[43]=h,e[44]=u):u=e[44],u}function ot(t){const e=A.c(18),{data:o,availableTabs:n,effectiveActiveTabId:r,effectiveTools:i,isLoadingTools:d,onTabChange:a}=t,l=d===void 0?!1:d;let m;e[0]!==i?(m=i.map(rt),e[0]=i,e[1]=m):m=e[1];const p=m;let x;e[2]!==n||e[3]!==r||e[4]!==a?(x=n.length>0&&s.jsx("div",{className:"px-4 py-2 border-b border-border bg-background",children:s.jsx(Ve,{tabs:n,activeTab:r,onTabChange:a})}),e[2]=n,e[3]=r,e[4]=a,e[5]=x):x=e[5];let f;e[6]!==r||e[7]!==i.length||e[8]!==l||e[9]!==p?(f=r==="tools"&&s.jsx("div",{className:"flex flex-col flex-1",children:l?s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(I,{name:"progress_activity",size:24,className:"animate-spin"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tools..."})]}):i.length>0?s.jsx(Pe,{tools:p,showToolbar:!1,emptyMessage:"This app doesn't have any tools."}):s.jsx(Ue,{image:null,title:"No tools available",description:"This app doesn't have any tools."})}),e[6]=r,e[7]=i.length,e[8]=l,e[9]=p,e[10]=f):f=e[10];let h;e[11]!==o?.repository||e[12]!==r?(h=r==="readme"&&s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(Re,{repository:o?.repository})}),e[11]=o?.repository,e[12]=r,e[13]=h):h=e[13];let g;return e[14]!==x||e[15]!==f||e[16]!==h?(g=s.jsxs("div",{className:"lg:col-span-2 flex flex-col border-l border-border",children:[x,f,h]}),e[14]=x,e[15]=f,e[16]=h,e[17]=g):g=e[17],g}function rt(t){const e=t;return{name:e.name||"",description:e.description||void 0}}function nt(t,e){if(!t||!e)return;const o=e.toLowerCase();return t.find(n=>n.app_name?.toLowerCase()===o||n.app_id?.toLowerCase()===o||n.title.toLowerCase()===o)||t.find(n=>n.title.toLowerCase().includes(o))}function it(t,e,o,n,r){if(!e||e==="Unknown")return{count:0};if(e==="io.modelcontextprotocol.registry/official")return{logo:n?.icon||void 0,count:r??t.length};const i=e.toLowerCase(),d=t.filter(l=>(l._meta?.["io.modelcontextprotocol.registry/official"]?"io.modelcontextprotocol.registry/official":l.publisher||l._meta?.["mcp.mesh"]?.scopeName||"Unknown").toLowerCase()===i);return{logo:o?.icon||d[0]?.publisher_logo||d[0]?.icon||void 0,count:d.length}}function lt(t){const e=t.server._meta?.["mcp.mesh/publisher-provided"],o=t._meta?.["mcp.mesh"],n=t._meta?.["io.modelcontextprotocol.registry/official"],r=t.server,i=We(r.remotes?.[0]?.type),d=Ke(r.$schema),a=n?"io.modelcontextprotocol.registry/official":t.publisher||o?.scopeName||"Unknown",l=qe(r.repository),m=t.icon||t.image||t.logo||r.icons?.[0]?.src||l||null,p=t.name||t.title||t.server?.title||"Unnamed Item";return{name:Je(p),description:t.description||t.summary||t.server?.description||"",icon:m,verified:t.verified||o?.verified,publisher:a,version:r.version||null,websiteUrl:r.websiteUrl||null,repository:r.repository||null,schemaVersion:d??null,connectionType:i,connectionUrl:null,remoteUrl:null,tools:t.tools||r.tools||e?.tools||[],models:t.models||r.models||e?.models||[],emails:t.emails||r.emails||e?.emails||[],analytics:t.analytics||r.analytics||e?.analytics,cdn:t.cdn||r.cdn||e?.cdn}}class at extends le.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("Store app detail error:",e,o)}render(){return this.state.hasError?s.jsx(Xe,{error:this.state.error||new Error("Unknown error"),onBack:this.props.onBack}):this.props.children}}function ct(){const t=A.c(70),{org:e}=je(),o=be();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const{appName:r}=Ce(n);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[1]=i):i=t[1];const{registryId:d,serverName:a}=Te(i),[l,m]=le.useState("readme"),p=ke(),x=Se(),{data:f}=_e.useSession(),h=$e(x),g=d||h[0]?.id||"",b=Ie(g),y=Oe(b?.tools),N=b?.tools&&b.tools.find(pt)?.name||"",w=b?.tools&&b.tools.find(ut)?.name||"",_=Ae(g),k=!!a;let C,S;k?(C=N||w,S={name:a}):(C=y,S={});const{data:u}=ze({toolCaller:_,toolName:C,toolInputParams:S,scope:g});let E=[],L=[],xe=null;if(u){if(Array.isArray(u))E=u;else if(typeof u=="object"&&u!==null)if("totalCount"in u&&typeof u.totalCount=="number"&&(xe=u.totalCount),"item"in u&&u.item){const c=u.item,T=c.id||"",U=c.server,V=c._meta;let M;t[2]!==c.title||t[3]!==T||t[4]!==U||t[5]!==V?(M=[{id:T,title:c.title,server:U,_meta:V}],t[2]=c.title,t[3]=T,t[4]=U,t[5]=V,t[6]=M):M=t[6],E=M}else{let c;"versions"in u&&Array.isArray(u.versions)?c="versions":"servers"in u&&Array.isArray(u.servers)?c="servers":c=Object.keys(u).find(T=>Array.isArray(u[T])),c&&(E=u[c],(c==="versions"||C?.includes("VERSIONS"))&&(L=E))}}let Y;t[7]!==r?(Y=c=>{const T=c.name||c.title||c.server.title||"";return Fe(T)===r},t[7]=r,t[8]=Y):Y=t[8];let j=E.find(Y);if(!j&&a){let c;t[9]!==a?(c=T=>T.server.name===a||T.name===a||T.title===a,t[9]=a,t[10]=c):c=t[10],j=E.find(c)}const v=j?lt(j):null,ae=(v?.tools?.length||0)>0,ce=j?.server?.remotes?.[0]?.url||null,Q=!ae&&!!ce,X=Be({url:Q?ce:""}),Z=Q&&X.state==="connecting";let ee;t[11]!==X||t[12]!==Q?(ee=Q&&X.state==="ready"?(X.tools||[]).map(ft):[],t[11]=X,t[12]=Q,t[13]=ee):ee=t[13];const he=ee,P=ae?v?.tools||[]:he,ye=nt(x,v?.publisher),de=v?it(E,v.publisher,ye,b??null,xe):{count:0},Ne=v?.repository?He(v.repository):null,me=!!v?.repository&&!!Ne;let R;t[14]!==me?(R={id:"readme",label:"README",visible:me},t[14]=me,t[15]=R):R=t[15];const fe=ae||he.length>0||Z&&!!ce;let $;t[16]!==P.length||t[17]!==fe?($={id:"tools",label:"Tools",count:P.length,visible:fe},t[16]=P.length,t[17]=fe,t[18]=$):$=t[18];let te;t[19]!==R||t[20]!==$?(te=[R,$].filter(mt),t[19]=R,t[20]=$,t[21]=te):te=t[21];const D=te;let se;t[22]!==l||t[23]!==D?(se=D.find(c=>c.id===l)?l:D.find(dt)?.id||D[0]?.id||"overview",t[22]=l,t[23]=D,t[24]=se):se=t[24];const ue=se;let oe;t[25]!==p||t[26]!==L||t[27]!==o||t[28]!==e||t[29]!==j||t[30]!==f?(oe=async c=>{const T=L[c??0]||j;if(!T||!e||!f?.user?.id)return;const U=Ge(T,e.id,f.user.id);if(!U.connection_url){ge.error("This MCP Server cannot be connected: no connection URL available");return}try{const{id:V}=await p.create.mutateAsync(U);o({to:"/$org/mcps/$connectionId",params:{org:e.slug,connectionId:V}})}catch(V){const M=V;ge.error(`Failed to connect MCP Server: ${M instanceof Error?M.message:String(M)}`)}},t[25]=p,t[26]=L,t[27]=o,t[28]=e,t[29]=j,t[30]=f,t[31]=oe):oe=t[31];const pe=oe;let re;t[32]!==o||t[33]!==e.slug?(re=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[32]=o,t[33]=e.slug,t[34]=re):re=t[34];const z=re;if(!j){let c;return t[35]!==z?(c=s.jsx(Ye,{onBack:z}),t[35]=z,t[36]=c):c=t[36],c}if(!v)return null;const B=(j?.server?.remotes?.length??0)>0;let G;t[37]!==z?(G=s.jsx(Ze,{onBack:z}),t[37]=z,t[38]=G):G=t[38];let F;t[39]!==B?(F=!B&&s.jsxs("div",{className:"mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-sm text-amber-900",children:[s.jsx(I,{name:"info",size:16,className:"inline mr-2"}),"This MCP Server cannot be connected - no connection method available."]}),t[39]=B,t[40]=F):F=t[40];let O;t[41]!==L||t[42]!==j?(O=L.length>0?L:[j],t[41]=L,t[42]=j,t[43]=O):O=t[43];let H;t[44]!==p.create.isPending||t[45]!==B||t[46]!==v||t[47]!==pe||t[48]!==O?(H=s.jsx(et,{data:v,itemVersions:O,onInstall:pe,canInstall:B,isInstalling:p.create.isPending}),t[44]=p.create.isPending,t[45]=B,t[46]=v,t[47]=pe,t[48]=O,t[49]=H):H=t[49];let W;t[50]!==v||t[51]!==de||t[52]!==j?(W=s.jsx(st,{data:v,publisherInfo:de,selectedItem:j}),t[50]=v,t[51]=de,t[52]=j,t[53]=W):W=t[53];let K;t[54]!==D||t[55]!==v||t[56]!==ue||t[57]!==P||t[58]!==Z?(K=s.jsx(ot,{data:v,availableTabs:D,effectiveActiveTabId:ue,effectiveTools:P,isLoadingTools:Z,onTabChange:m}),t[54]=D,t[55]=v,t[56]=ue,t[57]=P,t[58]=Z,t[59]=K):K=t[59];let q;t[60]!==W||t[61]!==K?(q=s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 min-h-[677px]",children:[W,K]}),t[60]=W,t[61]=K,t[62]=q):q=t[62];let J;t[63]!==F||t[64]!==H||t[65]!==q?(J=s.jsx("div",{className:"flex-1 overflow-y-auto h-full",children:s.jsx("div",{className:"h-full",children:s.jsxs("div",{className:"h-full",children:[F,H,q]})})}),t[63]=F,t[64]=H,t[65]=q,t[66]=J):J=t[66];let ne;return t[67]!==G||t[68]!==J?(ne=s.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[G,J]}),t[67]=G,t[68]=J,t[69]=ne):ne=t[69],ne}function dt(t){return t.id==="readme"}function mt(t){return t.visible}function ft(t){return{name:t.name,description:t.description}}function ut(t){return t.name.endsWith("_GET")}function pt(t){return t.name.endsWith("_VERSIONS")}function Bt(){const t=A.c(6),{org:e}=je(),o=be();let n;t[0]!==o||t[1]!==e.slug?(n=()=>{o({to:"/$org/store",params:{org:e.slug}})},t[0]=o,t[1]=e.slug,t[2]=n):n=t[2];const r=n;let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(le.Suspense,{fallback:s.jsx(Qe,{}),children:s.jsx(ct,{})}),t[3]=i):i=t[3];let d;return t[4]!==r?(d=s.jsx(at,{onBack:r,children:i}),t[4]=r,t[5]=d):d=t[5],d}export{Bt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as c,ax as T,j as i,au as C,aM as y,at as I,av as M,by as z,bz as H,c as A}from"./index-
|
|
1
|
+
import{r as c,ax as T,j as i,au as C,aM as y,at as I,av as M,by as z,bz as H,c as A}from"./index-CpLt3yXK.js";import{c as g}from"./utils-DvXhQGkY.js";var m="Switch",[U]=T(m),[q,L]=U(m),E=c.forwardRef((s,e)=>{const{__scopeSwitch:t,name:r,checked:a,defaultChecked:n,required:o,disabled:d,value:u="on",onCheckedChange:k,form:l,...w}=s,[p,h]=c.useState(null),v=y(e,b=>h(b)),x=c.useRef(!1),S=p?l||!!p.closest("form"):!0,[f,N]=I({prop:a,defaultProp:n??!1,onChange:k,caller:m});return i.jsxs(q,{scope:t,checked:f,disabled:d,children:[i.jsx(C.button,{type:"button",role:"switch","aria-checked":f,"aria-required":o,"data-state":j(f),"data-disabled":d?"":void 0,disabled:d,value:u,...w,ref:v,onClick:M(s.onClick,b=>{N(B=>!B),S&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})}),S&&i.jsx(_,{control:p,bubbles:!x.current,name:r,value:u,checked:f,required:o,disabled:d,form:l,style:{transform:"translateX(-100%)"}})]})});E.displayName=m;var P="SwitchThumb",R=c.forwardRef((s,e)=>{const{__scopeSwitch:t,...r}=s,a=L(P,t);return i.jsx(C.span,{"data-state":j(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:e})});R.displayName=P;var O="SwitchBubbleInput",_=c.forwardRef(({__scopeSwitch:s,control:e,checked:t,bubbles:r=!0,...a},n)=>{const o=c.useRef(null),d=y(o,n),u=z(t),k=H(e);return c.useEffect(()=>{const l=o.current;if(!l)return;const w=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&h){const v=new Event("click",{bubbles:r});h.call(l,t),l.dispatchEvent(v)}},[u,t,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...a,tabIndex:-1,ref:d,style:{...a.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});_.displayName=O;function j(s){return s?"checked":"unchecked"}var $=E,D=R;function X(s){const e=A.c(9);let t,r;e[0]!==s?({className:t,...r}=s,e[0]=s,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let a;e[3]!==t?(a=g("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let n;e[5]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(D,{"data-slot":"switch-thumb",className:g("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")}),e[5]=n):n=e[5];let o;return e[6]!==r||e[7]!==a?(o=i.jsx($,{"data-slot":"switch",className:a,...r,children:n}),e[6]=r,e[7]=a,e[8]=o):o=e[8],o}export{X as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,j as n}from"./index-
|
|
1
|
+
import{c as o,j as n}from"./index-CpLt3yXK.js";import{c as l}from"./utils-DvXhQGkY.js";function u(s){const e=o.c(8);let r,i;e[0]!==s?({className:r,...i}=s,e[0]=s,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let t;e[3]!==r?(t=l("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-xl border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),e[3]=r,e[4]=t):t=e[4];let a;return e[5]!==i||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...i}),e[5]=i,e[6]=t,e[7]=a):a=e[7],a}export{u as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as v,c as E,j as t}from"./index-
|
|
1
|
+
import{r as v,c as E,j as t}from"./index-CpLt3yXK.js";import{I as z,b as R}from"./use-connection-dLAoYo7_.js";import{C as F}from"./checkbox-xUpImUGX.js";import{B as A}from"./button-a-f_QGwE.js";import{I as U}from"./icon-OJY1qvap.js";import{c as T}from"./utils-DvXhQGkY.js";import{C as V}from"./collection-search-mG8LyvuA.js";const q=v.memo(function(S){const e=E.c(21),{connection:o,isSelected:m,hasToolsEnabled:r,activeToolsCount:h,totalToolsCount:p,onSelect:g,onToggle:u}=S,x=m?"bg-accent/50":"hover:bg-muted/50";let i;e[0]!==x?(i=T("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",x),e[0]=x,e[1]=i):i=e[1];let c;e[2]!==o.icon||e[3]!==o.title?(c=t.jsx(z,{icon:o.icon,name:o.title,size:"xs"}),e[2]=o.icon,e[3]=o.title,e[4]=c):c=e[4];let f;e[5]!==o.title?(f=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.title})}),e[5]=o.title,e[6]=f):f=e[6];let n;e[7]!==g||e[8]!==c||e[9]!==f?(n=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:g,children:[c,f]}),e[7]=g,e[8]=c,e[9]=f,e[10]=n):n=e[10];let a;e[11]!==h||e[12]!==o.tools||e[13]!==r||e[14]!==u||e[15]!==p?(a=o.tools&&o.tools.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[h,"/",p]}),t.jsx(F,{checked:r,onCheckedChange:u,onClick:H})]}),e[11]=h,e[12]=o.tools,e[13]=r,e[14]=u,e[15]=p,e[16]=a):a=e[16];let N;return e[17]!==i||e[18]!==n||e[19]!==a?(N=t.jsxs("div",{className:i,children:[n,a]}),e[17]=i,e[18]=n,e[19]=a,e[20]=N):N=e[20],N}),G=v.memo(function(S){const e=E.c(18),{connectionId:o,tool:m,isSelected:r,onToggle:h}=S,p=`tool-${o}-${m.name}`,g=r?"text-foreground":"text-muted-foreground";let u;e[0]!==g?(u=T("text-sm font-medium",g),e[0]=g,e[1]=u):u=e[1];let x;e[2]!==u||e[3]!==m.name?(x=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:u,children:m.name})}),e[2]=u,e[3]=m.name,e[4]=x):x=e[4];let i;e[5]!==m.description?(i=m.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:m.description}),e[5]=m.description,e[6]=i):i=e[6];let c;e[7]!==x||e[8]!==i?(c=t.jsxs("div",{className:"flex-1 min-w-0",children:[x,i]}),e[7]=x,e[8]=i,e[9]=c):c=e[9];const f=`tool-${o}-${m.name}`;let n;e[10]!==r||e[11]!==h||e[12]!==f?(n=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(F,{id:f,checked:r,onCheckedChange:h,onClick:J})}),e[10]=r,e[11]=h,e[12]=f,e[13]=n):n=e[13];let a;return e[14]!==p||e[15]!==c||e[16]!==n?(a=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:p,children:[c,n]}),e[14]=p,e[15]=c,e[16]=n,e[17]=a):a=e[17],a});function ee({toolSet:d,onToolSetChange:S}){const[e,o]=v.useState(""),m=v.useDeferredValue(e),[r,h]=v.useState("all"),[p,g]=v.useState(!1),u=v.useRef(new Set(Object.keys(d))),x=R({searchTerm:m.trim()||void 0}),i=u.current,c=[...i.values()].map(s=>x.find(l=>l.id===s)).filter(s=>s!==void 0),f=x.filter(s=>!i.has(s.id)),n=[...c,...f],a=s=>{const l=d[s];return l!==void 0&&l.length>0},N=n.filter(s=>{if(r==="all")return!0;const l=a(s.id);return r==="selected"?l:r==="unselected"?!l:!0}),[I,M]=v.useState(n[0]?.id??null),b=I?n.find(s=>s.id===I)??null:null,$=b?.tools??[],B=(s,l)=>d[s]?.includes(l)??!1,D=(s,l)=>{const j=d[s]??[],y=j.includes(l),w={...d};if(y){const k=j.filter(C=>C!==l);k.length===0?delete w[s]:w[s]=k}else w[s]=[...j,l];S(w)},O=s=>{const l=n.find(C=>C.id===s);if(!l?.tools)return;const j=d[s]??[],y=l.tools.map(C=>C.name),w=j.length>0&&y.every(C=>j.includes(C)),k={...d};w?delete k[s]:(k[s]=y,M(s)),S(k)},P=s=>{M(s),g(!0)},Q=()=>{g(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:T("w-full md:w-80 border-r border-border flex flex-col",p&&"hidden md:flex"),children:[t.jsx(V,{value:e,onChange:o,placeholder:"Search MCP Servers..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>h("all"),className:T("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>h("selected"),className:T("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>h("unselected"),className:T("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:N.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:e?"No connections found":r==="selected"?"No servers selected":r==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:N.map(s=>{const l=s.tools?.length??0,j=d[s.id]?.length??0;return t.jsx(q,{connection:s,isSelected:I===s.id,hasToolsEnabled:a(s.id),activeToolsCount:j,totalToolsCount:l,onSelect:()=>P(s.id),onToggle:()=>O(s.id)},s.id)})})})]}),t.jsx("div",{className:T("flex-1 flex-col",p?"flex":"hidden md:flex"),children:b?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[t.jsx(A,{variant:"ghost",size:"sm",onClick:Q,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(U,{name:"arrow_back",size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(z,{icon:b.icon,name:b.title,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.title}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:b.description})]})]})]}),t.jsx("div",{className:"flex-1 overflow-auto p-4",children:$.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"This connection has no tools available"}):t.jsx("div",{className:"space-y-2",children:$.map(s=>t.jsx(G,{connectionId:b.id,tool:s,isSelected:B(b.id,s.name),onToggle:()=>D(b.id,s.name)},s.name))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"Select a connection to view its tools"})})})]})}function H(d){return d.stopPropagation()}function J(d){return d.stopPropagation()}export{ee as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,j as d,au as $,c as j,ax as te,aN as G,aT as oe,aP as U,aZ as re,a_ as ne,bS as se,aM as V,aS as ae,av as y,aR as ie,at as le,aQ as ce,a$ as ue}from"./index-iWvwzdJJ.js";import{c as de}from"./utils---jHV5W_.js";var pe=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),fe="VisuallyHidden",B=a.forwardRef((t,e)=>d.jsx($.span,{...t,ref:e,style:{...pe,...t.style}}));B.displayName=fe;var ve=B;const M="org-admin",xe={from({org:t,project:e}){if(t.includes("/")||e.includes("/"))throw new Error("Org or project cannot contain slashes");return`${t}/${e}`},parse(t){t.startsWith("/")&&(t=t.slice(1));const[e,o]=t.split("/");if(!e||!o)throw new Error("Invalid locator");return{org:e,project:o}},isOrgAdminProject(t){return t.split("/")[1]===M},adminProject(t){return`${t}/${M}`}},F=a.createContext(void 0),Fe=()=>{const t=a.useContext(F);if(!t)throw new Error("useProjectContext must be used within a ProjectContextProvider");return t},ze=t=>{const e=j.c(10),{children:o,org:r,project:n}=t;let s;e[0]!==r.slug||e[1]!==n.slug?(s=xe.from({org:r.slug,project:n.slug}),e[0]=r.slug,e[1]=n.slug,e[2]=s):s=e[2];const l=s;let c;e[3]!==l||e[4]!==r||e[5]!==n?(c={org:r,project:n,locator:l},e[3]=l,e[4]=r,e[5]=n,e[6]=c):c=e[6];const i=c;let u;return e[7]!==o||e[8]!==i?(u=d.jsx(F.Provider,{value:i,children:o}),e[7]=o,e[8]=i,e[9]=u):u=e[9],u};const he=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ge=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,o,r)=>r?r.toUpperCase():o.toLowerCase()),H=t=>{const e=ge(t);return e.charAt(0).toUpperCase()+e.slice(1)},z=(...t)=>t.filter((e,o,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===o).join(" ").trim();var me={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Ce=a.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:n="",children:s,iconNode:l,...c},i)=>a.createElement("svg",{ref:i,...me,width:e,height:e,stroke:t,strokeWidth:r?Number(o)*24/Number(e):o,className:z("lucide",n),...c},[...l.map(([u,p])=>a.createElement(u,p)),...Array.isArray(s)?s:[s]]));const Ye=(t,e)=>{const o=a.forwardRef(({className:r,...n},s)=>a.createElement(Ce,{ref:s,iconNode:e,className:z(`lucide-${he(H(t))}`,`lucide-${t}`,r),...n}));return o.displayName=H(t),o};var[O]=te("Tooltip",[U]),L=U(),Y="TooltipProvider",Te=700,A="tooltip.open",[ye,k]=O(Y),W=t=>{const{__scopeTooltip:e,delayDuration:o=Te,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=t,l=a.useRef(!0),c=a.useRef(!1),i=a.useRef(0);return a.useEffect(()=>{const u=i.current;return()=>window.clearTimeout(u)},[]),d.jsx(ye,{scope:e,isOpenDelayedRef:l,delayDuration:o,onOpen:a.useCallback(()=>{window.clearTimeout(i.current),l.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:a.useCallback(u=>{c.current=u},[]),disableHoverableContent:n,children:s})};W.displayName=Y;var R="Tooltip",[we,_]=O(R),Z=t=>{const{__scopeTooltip:e,children:o,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=t,i=k(R,t.__scopeTooltip),u=L(e),[p,v]=a.useState(null),x=ie(),f=a.useRef(0),h=l??i.disableHoverableContent,m=c??i.delayDuration,g=a.useRef(!1),[T,C]=le({prop:r,defaultProp:n??!1,onChange:S=>{S?(i.onOpen(),document.dispatchEvent(new CustomEvent(A))):i.onClose(),s?.(S)},caller:R}),b=a.useMemo(()=>T?g.current?"delayed-open":"instant-open":"closed",[T]),P=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,C(!0)},[C]),E=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,C(!1)},[C]),I=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,C(!0),f.current=0},m)},[m,C]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),d.jsx(ce,{...u,children:d.jsx(we,{scope:e,contentId:x,open:T,stateAttribute:b,trigger:p,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{i.isOpenDelayedRef.current?I():P()},[i.isOpenDelayedRef,I,P]),onTriggerLeave:a.useCallback(()=>{h?E():(window.clearTimeout(f.current),f.current=0)},[E,h]),onOpen:P,onClose:E,disableHoverableContent:h,children:o})})};Z.displayName=R;var D="TooltipTrigger",q=a.forwardRef((t,e)=>{const{__scopeTooltip:o,...r}=t,n=_(D,o),s=k(D,o),l=L(o),c=a.useRef(null),i=V(e,c,n.onTriggerChange),u=a.useRef(!1),p=a.useRef(!1),v=a.useCallback(()=>u.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),d.jsx(ae,{asChild:!0,...l,children:d.jsx($.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:y(t.onPointerMove,x=>{x.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),p.current=!0)}),onPointerLeave:y(t.onPointerLeave,()=>{n.onTriggerLeave(),p.current=!1}),onPointerDown:y(t.onPointerDown,()=>{n.open&&n.onClose(),u.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:y(t.onFocus,()=>{u.current||n.onOpen()}),onBlur:y(t.onBlur,n.onClose),onClick:y(t.onClick,n.onClose)})})});q.displayName=D;var N="TooltipPortal",[be,Pe]=O(N,{forceMount:void 0}),K=t=>{const{__scopeTooltip:e,forceMount:o,children:r,container:n}=t,s=_(N,e);return d.jsx(be,{scope:e,forceMount:o,children:d.jsx(G,{present:o||s.open,children:d.jsx(oe,{asChild:!0,container:n,children:r})})})};K.displayName=N;var w="TooltipContent",X=a.forwardRef((t,e)=>{const o=Pe(w,t.__scopeTooltip),{forceMount:r=o.forceMount,side:n="top",...s}=t,l=_(w,t.__scopeTooltip);return d.jsx(G,{present:r||l.open,children:l.disableHoverableContent?d.jsx(J,{side:n,...s,ref:e}):d.jsx(Ee,{side:n,...s,ref:e})})}),Ee=a.forwardRef((t,e)=>{const o=_(w,t.__scopeTooltip),r=k(w,t.__scopeTooltip),n=a.useRef(null),s=V(e,n),[l,c]=a.useState(null),{trigger:i,onClose:u}=o,p=n.current,{onPointerInTransitChange:v}=r,x=a.useCallback(()=>{c(null),v(!1)},[v]),f=a.useCallback((h,m)=>{const g=h.currentTarget,T={x:h.clientX,y:h.clientY},C=Oe(T,g.getBoundingClientRect()),b=Le(T,C),P=Ae(m.getBoundingClientRect()),E=ke([...b,...P]);c(E),v(!0)},[v]);return a.useEffect(()=>()=>x(),[x]),a.useEffect(()=>{if(i&&p){const h=g=>f(g,p),m=g=>f(g,i);return i.addEventListener("pointerleave",h),p.addEventListener("pointerleave",m),()=>{i.removeEventListener("pointerleave",h),p.removeEventListener("pointerleave",m)}}},[i,p,f,x]),a.useEffect(()=>{if(l){const h=m=>{const g=m.target,T={x:m.clientX,y:m.clientY},C=i?.contains(g)||p?.contains(g),b=!De(T,l);C?x():b&&(x(),u())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[i,p,l,u,x]),d.jsx(J,{...t,ref:s})}),[Re,je]=O(R,{isInside:!1}),_e=se("TooltipContent"),J=a.forwardRef((t,e)=>{const{__scopeTooltip:o,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=t,i=_(w,o),u=L(o),{onClose:p}=i;return a.useEffect(()=>(document.addEventListener(A,p),()=>document.removeEventListener(A,p)),[p]),a.useEffect(()=>{if(i.trigger){const v=x=>{x.target?.contains(i.trigger)&&p()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[i.trigger,p]),d.jsx(re,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:p,children:d.jsxs(ne,{"data-state":i.stateAttribute,...u,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(_e,{children:r}),d.jsx(Re,{scope:o,isInside:!0,children:d.jsx(ve,{id:i.contentId,role:"tooltip",children:n||r})})]})})});X.displayName=w;var Q="TooltipArrow",ee=a.forwardRef((t,e)=>{const{__scopeTooltip:o,...r}=t,n=L(o);return je(Q,o).isInside?null:d.jsx(ue,{...n,...r,ref:e})});ee.displayName=Q;function Oe(t,e){const o=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),n=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(o,r,n,s)){case s:return"left";case n:return"right";case o:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Le(t,e,o=5){const r=[];switch(e){case"top":r.push({x:t.x-o,y:t.y+o},{x:t.x+o,y:t.y+o});break;case"bottom":r.push({x:t.x-o,y:t.y-o},{x:t.x+o,y:t.y-o});break;case"left":r.push({x:t.x+o,y:t.y-o},{x:t.x+o,y:t.y+o});break;case"right":r.push({x:t.x-o,y:t.y-o},{x:t.x-o,y:t.y+o});break}return r}function Ae(t){const{top:e,right:o,bottom:r,left:n}=t;return[{x:n,y:e},{x:o,y:e},{x:o,y:r},{x:n,y:r}]}function De(t,e){const{x:o,y:r}=t;let n=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const c=e[s],i=e[l],u=c.x,p=c.y,v=i.x,x=i.y;p>r!=x>r&&o<(v-u)*(r-p)/(x-p)+u&&(n=!n)}return n}function ke(t){const e=t.slice();return e.sort((o,r)=>o.x<r.x?-1:o.x>r.x?1:o.y<r.y?-1:o.y>r.y?1:0),Ne(e)}function Ne(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const n=t[r];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const o=[];for(let r=t.length-1;r>=0;r--){const n=t[r];for(;o.length>=2;){const s=o[o.length-1],l=o[o.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))o.pop();else break}o.push(n)}return o.pop(),e.length===1&&o.length===1&&e[0].x===o[0].x&&e[0].y===o[0].y?e:e.concat(o)}var Ie=W,Se=Z,Me=q,He=K,$e=X,Ge=ee;function Ue(t){const e=j.c(6);let o,r;e[0]!==t?({delayDuration:r,...o}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==o?(s=d.jsx(Ie,{"data-slot":"tooltip-provider",delayDuration:n,...o}),e[3]=n,e[4]=o,e[5]=s):s=e[5],s}function We(t){const e=j.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=d.jsx(Ue,{children:d.jsx(Se,{"data-slot":"tooltip",...o})}),e[2]=o,e[3]=r):r=e[3],r}function Ze(t){const e=j.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=d.jsx(Me,{"data-slot":"tooltip-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function qe(t){const e=j.c(13);let o,r,n,s;e[0]!==t?({className:r,sideOffset:s,children:o,...n}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let c;e[5]!==r?(c=de("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=c):c=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Ge,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=i):i=e[7];let u;return e[8]!==o||e[9]!==n||e[10]!==l||e[11]!==c?(u=d.jsx(He,{children:d.jsxs($e,{"data-slot":"tooltip-content",sideOffset:l,className:c,...n,children:[o,i]})}),e[8]=o,e[9]=n,e[10]=l,e[11]=c,e[12]=u):u=e[12],u}export{xe as L,M as O,ze as P,qe as T,pe as V,Ze as a,We as b,Ye as c,Ue as d,Fe as u};
|
|
1
|
+
import{r as a,j as d,au as $,c as j,ax as te,aN as G,aT as oe,aP as U,aZ as re,a_ as ne,bS as se,aM as V,aS as ae,av as y,aR as ie,at as le,aQ as ce,a$ as ue}from"./index-CpLt3yXK.js";import{c as de}from"./utils-DvXhQGkY.js";var pe=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),fe="VisuallyHidden",B=a.forwardRef((t,e)=>d.jsx($.span,{...t,ref:e,style:{...pe,...t.style}}));B.displayName=fe;var ve=B;const M="org-admin",xe={from({org:t,project:e}){if(t.includes("/")||e.includes("/"))throw new Error("Org or project cannot contain slashes");return`${t}/${e}`},parse(t){t.startsWith("/")&&(t=t.slice(1));const[e,o]=t.split("/");if(!e||!o)throw new Error("Invalid locator");return{org:e,project:o}},isOrgAdminProject(t){return t.split("/")[1]===M},adminProject(t){return`${t}/${M}`}},F=a.createContext(void 0),Fe=()=>{const t=a.useContext(F);if(!t)throw new Error("useProjectContext must be used within a ProjectContextProvider");return t},ze=t=>{const e=j.c(10),{children:o,org:r,project:n}=t;let s;e[0]!==r.slug||e[1]!==n.slug?(s=xe.from({org:r.slug,project:n.slug}),e[0]=r.slug,e[1]=n.slug,e[2]=s):s=e[2];const l=s;let c;e[3]!==l||e[4]!==r||e[5]!==n?(c={org:r,project:n,locator:l},e[3]=l,e[4]=r,e[5]=n,e[6]=c):c=e[6];const i=c;let u;return e[7]!==o||e[8]!==i?(u=d.jsx(F.Provider,{value:i,children:o}),e[7]=o,e[8]=i,e[9]=u):u=e[9],u};const he=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ge=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,o,r)=>r?r.toUpperCase():o.toLowerCase()),H=t=>{const e=ge(t);return e.charAt(0).toUpperCase()+e.slice(1)},z=(...t)=>t.filter((e,o,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===o).join(" ").trim();var me={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Ce=a.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:n="",children:s,iconNode:l,...c},i)=>a.createElement("svg",{ref:i,...me,width:e,height:e,stroke:t,strokeWidth:r?Number(o)*24/Number(e):o,className:z("lucide",n),...c},[...l.map(([u,p])=>a.createElement(u,p)),...Array.isArray(s)?s:[s]]));const Ye=(t,e)=>{const o=a.forwardRef(({className:r,...n},s)=>a.createElement(Ce,{ref:s,iconNode:e,className:z(`lucide-${he(H(t))}`,`lucide-${t}`,r),...n}));return o.displayName=H(t),o};var[O]=te("Tooltip",[U]),L=U(),Y="TooltipProvider",Te=700,A="tooltip.open",[ye,k]=O(Y),W=t=>{const{__scopeTooltip:e,delayDuration:o=Te,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=t,l=a.useRef(!0),c=a.useRef(!1),i=a.useRef(0);return a.useEffect(()=>{const u=i.current;return()=>window.clearTimeout(u)},[]),d.jsx(ye,{scope:e,isOpenDelayedRef:l,delayDuration:o,onOpen:a.useCallback(()=>{window.clearTimeout(i.current),l.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:a.useCallback(u=>{c.current=u},[]),disableHoverableContent:n,children:s})};W.displayName=Y;var R="Tooltip",[we,_]=O(R),Z=t=>{const{__scopeTooltip:e,children:o,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=t,i=k(R,t.__scopeTooltip),u=L(e),[p,v]=a.useState(null),x=ie(),f=a.useRef(0),h=l??i.disableHoverableContent,m=c??i.delayDuration,g=a.useRef(!1),[T,C]=le({prop:r,defaultProp:n??!1,onChange:S=>{S?(i.onOpen(),document.dispatchEvent(new CustomEvent(A))):i.onClose(),s?.(S)},caller:R}),b=a.useMemo(()=>T?g.current?"delayed-open":"instant-open":"closed",[T]),P=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,C(!0)},[C]),E=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,C(!1)},[C]),I=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,C(!0),f.current=0},m)},[m,C]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),d.jsx(ce,{...u,children:d.jsx(we,{scope:e,contentId:x,open:T,stateAttribute:b,trigger:p,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{i.isOpenDelayedRef.current?I():P()},[i.isOpenDelayedRef,I,P]),onTriggerLeave:a.useCallback(()=>{h?E():(window.clearTimeout(f.current),f.current=0)},[E,h]),onOpen:P,onClose:E,disableHoverableContent:h,children:o})})};Z.displayName=R;var D="TooltipTrigger",q=a.forwardRef((t,e)=>{const{__scopeTooltip:o,...r}=t,n=_(D,o),s=k(D,o),l=L(o),c=a.useRef(null),i=V(e,c,n.onTriggerChange),u=a.useRef(!1),p=a.useRef(!1),v=a.useCallback(()=>u.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),d.jsx(ae,{asChild:!0,...l,children:d.jsx($.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:y(t.onPointerMove,x=>{x.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),p.current=!0)}),onPointerLeave:y(t.onPointerLeave,()=>{n.onTriggerLeave(),p.current=!1}),onPointerDown:y(t.onPointerDown,()=>{n.open&&n.onClose(),u.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:y(t.onFocus,()=>{u.current||n.onOpen()}),onBlur:y(t.onBlur,n.onClose),onClick:y(t.onClick,n.onClose)})})});q.displayName=D;var N="TooltipPortal",[be,Pe]=O(N,{forceMount:void 0}),K=t=>{const{__scopeTooltip:e,forceMount:o,children:r,container:n}=t,s=_(N,e);return d.jsx(be,{scope:e,forceMount:o,children:d.jsx(G,{present:o||s.open,children:d.jsx(oe,{asChild:!0,container:n,children:r})})})};K.displayName=N;var w="TooltipContent",X=a.forwardRef((t,e)=>{const o=Pe(w,t.__scopeTooltip),{forceMount:r=o.forceMount,side:n="top",...s}=t,l=_(w,t.__scopeTooltip);return d.jsx(G,{present:r||l.open,children:l.disableHoverableContent?d.jsx(J,{side:n,...s,ref:e}):d.jsx(Ee,{side:n,...s,ref:e})})}),Ee=a.forwardRef((t,e)=>{const o=_(w,t.__scopeTooltip),r=k(w,t.__scopeTooltip),n=a.useRef(null),s=V(e,n),[l,c]=a.useState(null),{trigger:i,onClose:u}=o,p=n.current,{onPointerInTransitChange:v}=r,x=a.useCallback(()=>{c(null),v(!1)},[v]),f=a.useCallback((h,m)=>{const g=h.currentTarget,T={x:h.clientX,y:h.clientY},C=Oe(T,g.getBoundingClientRect()),b=Le(T,C),P=Ae(m.getBoundingClientRect()),E=ke([...b,...P]);c(E),v(!0)},[v]);return a.useEffect(()=>()=>x(),[x]),a.useEffect(()=>{if(i&&p){const h=g=>f(g,p),m=g=>f(g,i);return i.addEventListener("pointerleave",h),p.addEventListener("pointerleave",m),()=>{i.removeEventListener("pointerleave",h),p.removeEventListener("pointerleave",m)}}},[i,p,f,x]),a.useEffect(()=>{if(l){const h=m=>{const g=m.target,T={x:m.clientX,y:m.clientY},C=i?.contains(g)||p?.contains(g),b=!De(T,l);C?x():b&&(x(),u())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[i,p,l,u,x]),d.jsx(J,{...t,ref:s})}),[Re,je]=O(R,{isInside:!1}),_e=se("TooltipContent"),J=a.forwardRef((t,e)=>{const{__scopeTooltip:o,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=t,i=_(w,o),u=L(o),{onClose:p}=i;return a.useEffect(()=>(document.addEventListener(A,p),()=>document.removeEventListener(A,p)),[p]),a.useEffect(()=>{if(i.trigger){const v=x=>{x.target?.contains(i.trigger)&&p()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[i.trigger,p]),d.jsx(re,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:p,children:d.jsxs(ne,{"data-state":i.stateAttribute,...u,...c,ref:e,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(_e,{children:r}),d.jsx(Re,{scope:o,isInside:!0,children:d.jsx(ve,{id:i.contentId,role:"tooltip",children:n||r})})]})})});X.displayName=w;var Q="TooltipArrow",ee=a.forwardRef((t,e)=>{const{__scopeTooltip:o,...r}=t,n=L(o);return je(Q,o).isInside?null:d.jsx(ue,{...n,...r,ref:e})});ee.displayName=Q;function Oe(t,e){const o=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),n=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(o,r,n,s)){case s:return"left";case n:return"right";case o:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Le(t,e,o=5){const r=[];switch(e){case"top":r.push({x:t.x-o,y:t.y+o},{x:t.x+o,y:t.y+o});break;case"bottom":r.push({x:t.x-o,y:t.y-o},{x:t.x+o,y:t.y-o});break;case"left":r.push({x:t.x+o,y:t.y-o},{x:t.x+o,y:t.y+o});break;case"right":r.push({x:t.x-o,y:t.y-o},{x:t.x-o,y:t.y+o});break}return r}function Ae(t){const{top:e,right:o,bottom:r,left:n}=t;return[{x:n,y:e},{x:o,y:e},{x:o,y:r},{x:n,y:r}]}function De(t,e){const{x:o,y:r}=t;let n=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const c=e[s],i=e[l],u=c.x,p=c.y,v=i.x,x=i.y;p>r!=x>r&&o<(v-u)*(r-p)/(x-p)+u&&(n=!n)}return n}function ke(t){const e=t.slice();return e.sort((o,r)=>o.x<r.x?-1:o.x>r.x?1:o.y<r.y?-1:o.y>r.y?1:0),Ne(e)}function Ne(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const n=t[r];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const o=[];for(let r=t.length-1;r>=0;r--){const n=t[r];for(;o.length>=2;){const s=o[o.length-1],l=o[o.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))o.pop();else break}o.push(n)}return o.pop(),e.length===1&&o.length===1&&e[0].x===o[0].x&&e[0].y===o[0].y?e:e.concat(o)}var Ie=W,Se=Z,Me=q,He=K,$e=X,Ge=ee;function Ue(t){const e=j.c(6);let o,r;e[0]!==t?({delayDuration:r,...o}=t,e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==o?(s=d.jsx(Ie,{"data-slot":"tooltip-provider",delayDuration:n,...o}),e[3]=n,e[4]=o,e[5]=s):s=e[5],s}function We(t){const e=j.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=d.jsx(Ue,{children:d.jsx(Se,{"data-slot":"tooltip",...o})}),e[2]=o,e[3]=r):r=e[3],r}function Ze(t){const e=j.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==o?(r=d.jsx(Me,{"data-slot":"tooltip-trigger",...o}),e[2]=o,e[3]=r):r=e[3],r}function qe(t){const e=j.c(13);let o,r,n,s;e[0]!==t?({className:r,sideOffset:s,children:o,...n}=t,e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=s):(o=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let c;e[5]!==r?(c=de("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=c):c=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(Ge,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=i):i=e[7];let u;return e[8]!==o||e[9]!==n||e[10]!==l||e[11]!==c?(u=d.jsx(He,{children:d.jsxs($e,{"data-slot":"tooltip-content",sideOffset:l,className:c,...n,children:[o,i]})}),e[8]=o,e[9]=n,e[10]=l,e[11]=c,e[12]=u):u=e[12],u}export{xe as L,M as O,ze as P,qe as T,pe as V,Ze as a,We as b,Ye as c,Ue as d,Fe as u};
|