@decocms/mesh 1.0.0-alpha.32 → 1.0.0-alpha.33
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-CCDQTgck.js → alert-dialog-Bj3sxji2.js} +1 -1
- package/dist/client/assets/{auth-DcsMEwUL.js → auth-bF2_ysdG.js} +1 -1
- package/dist/client/assets/{auth-catchall-CcVurtOz.js → auth-catchall-BRnZAoYY.js} +1 -1
- package/dist/client/assets/{avatar-4ymdPXa_.js → avatar-B9zSDca0.js} +1 -1
- package/dist/client/assets/{badge-M2zkAPfT.js → badge-Ba7oj8pn.js} +1 -1
- package/dist/client/assets/{button-DpN85Po0.js → button-8a8UdvyR.js} +1 -1
- package/dist/client/assets/{card-CjmS8q7G.js → card-Cyeg7tCo.js} +1 -1
- package/dist/client/assets/{checkbox-DWHTP51a.js → checkbox-DCjoNloy.js} +1 -1
- package/dist/client/assets/{circle-alert-nIYjC1xl.js → circle-alert-DVLBfxyX.js} +1 -1
- package/dist/client/assets/{collection-detail-BEA961Ga.js → collection-detail-ieEvVULW.js} +1 -1
- package/dist/client/assets/{collection-display-button-Cq_29P0W.js → collection-display-button-CGcY64sw.js} +1 -1
- package/dist/client/assets/{collection-header-CP7DLL6n.js → collection-header-B92Inaku.js} +1 -1
- package/dist/client/assets/{collection-page-C1jzPNDj.js → collection-page-BfXTrpEI.js} +1 -1
- package/dist/client/assets/{collection-search-CrkK01Ci.js → collection-search-C7G2QK3t.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DtI6Q7NT.js → collection-table-wrapper-DdGYlOCN.js} +1 -1
- package/dist/client/assets/{connection-card-CvYHrR5S.js → connection-card-xMF7zskf.js} +1 -1
- package/dist/client/assets/{connection-detail-8UBUICjc.js → connection-detail-CKuTnq-B.js} +1 -1
- package/dist/client/assets/{connections-B3SNLZTA.js → connections-Bm36z6Kn.js} +1 -1
- package/dist/client/assets/{core-C84vbQ6C.js → core-DHnxmqjc.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DXWcXd5o.js → create-organization-dialog-Cz9P_oQD.js} +1 -1
- package/dist/client/assets/{dialog-CfKieCBd.js → dialog-DOdwpjqP.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Bvf4p8xE.js → dropdown-menu-BTTzlaf4.js} +1 -1
- package/dist/client/assets/{empty-state-jtBjSgAJ.js → empty-state-CwiQR0XJ.js} +1 -1
- package/dist/client/assets/{error-boundary-BjLQDRan.js → error-boundary-8a3_at8W.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CbCjXz3B.js → extract-connection-data-BpMaEsIX.js} +1 -1
- package/dist/client/assets/{form-C-tSv2Q6.js → form-DU90-O_I.js} +1 -1
- package/dist/client/assets/{gateway-detail-ho3nacsQ.js → gateway-detail-B2bI_bIU.js} +1 -1
- package/dist/client/assets/{gateways-BMuRXxz2.js → gateways-BxMjTmO6.js} +1 -1
- package/dist/client/assets/{home-MLX9b5zd.js → home-CSzEs1Rf.js} +1 -1
- package/dist/client/assets/{icon-CBAJ1FOz.js → icon-CzxeHWBl.js} +1 -1
- package/dist/client/assets/{index-DysuQWmq.js → index-Bgo9U3qs.js} +1 -1
- package/dist/client/assets/index-ChN7etWB.css +1 -0
- package/dist/client/assets/{index-BHlakCJ5.js → index-DCY07ujJ.js} +1 -1
- package/dist/client/assets/{index-WOQ13cP6.js → index-HoRNE_Oj.js} +2 -2
- package/dist/client/assets/{index-DV_-45hJ.js → index-jKafgZHH.js} +1 -1
- package/dist/client/assets/{input-DRMFvIcp.js → input-GtBoan0u.js} +1 -1
- package/dist/client/assets/json-CFpQXyKn.js +1 -0
- package/dist/client/assets/{layout-C7PMXMWr.js → layout-DtdXVJv4.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-lg0C_alN.js → lazy-highlighter-BAj2Mxm0.js} +1 -1
- package/dist/client/assets/{localstorage-keys-D9JCFoUA.js → localstorage-keys-DdRmNbGe.js} +1 -1
- package/dist/client/assets/{login-BBdlWaUa.js → login-DHkcl1CZ.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CF0djzC4.js → mcp-oauth-pvU53iS3.js} +1 -1
- package/dist/client/assets/{members-D_0pxXiL.js → members-CX-ziwX2.js} +1 -1
- package/dist/client/assets/{monitoring-dAXFetG3.js → monitoring-5rf2nLo0.js} +1 -1
- package/dist/client/assets/{oauth-callback-VTrUtdoZ.js → oauth-callback-NjwvQ7fr.js} +1 -1
- package/dist/client/assets/{page-BR8BRWlW.js → page-DQXzmwPi.js} +1 -1
- package/dist/client/assets/{popover-DIDe1tAI.js → popover-DdVvJgdl.js} +1 -1
- package/dist/client/assets/prism-light-CixH9adM.js +1 -0
- package/dist/client/assets/{resource-tabs-e5WwAHct.js → resource-tabs-D-d1_s9d.js} +1 -1
- package/dist/client/assets/{schema-DaJ1vGek.js → schema-zp4LhQ6R.js} +1 -1
- package/dist/client/assets/{select-DzEOHgSq.js → select-gKhGAtmi.js} +1 -1
- package/dist/client/assets/{settings-DCv43rTD.js → settings-DOjDcDAR.js} +1 -1
- package/dist/client/assets/{shell-layout-CE6a48bs.js → shell-layout-BDhhfHrp.js} +44 -44
- package/dist/client/assets/{spinner-DCnW_hcw.js → spinner-Uc4IX4M6.js} +1 -1
- package/dist/client/assets/{store-w0RourHd.js → store-B09vXexU.js} +1 -1
- package/dist/client/assets/{store-app-detail-Boq9PC3_.js → store-app-detail-BqI8KTAM.js} +1 -1
- package/dist/client/assets/{switch-P43q-fGo.js → switch-8wTpXb1-.js} +1 -1
- package/dist/client/assets/{textarea-BNSwm2Uw.js → textarea-CTPqKmyI.js} +1 -1
- package/dist/client/assets/{tool-set-selector-M0YnbcFP.js → tool-set-selector-B9UyeKAH.js} +1 -1
- package/dist/client/assets/{tooltip-D5O925Gp.js → tooltip-ocFCU6ZE.js} +1 -1
- package/dist/client/assets/{types-8p_ZLQNY.js → types-CqJfCRYk.js} +3 -3
- package/dist/client/assets/{upload-RqBSTCRA.js → upload-CXce3aGG.js} +1 -1
- package/dist/client/assets/{use-binding-BxKMNjmS.js → use-binding-BPQhbEIl.js} +1 -1
- package/dist/client/assets/{use-connection-B5VryFm7.js → use-connection-DbdMBpCj.js} +1 -1
- package/dist/client/assets/{use-gateway-Bcl96GTS.js → use-gateway-DN4bQAAB.js} +1 -1
- package/dist/client/assets/{use-list-state-BvxCVBXg.js → use-list-state-DhZmck5D.js} +1 -1
- package/dist/client/assets/{use-mcp-BXroRbt9.js → use-mcp-CQqxPDky.js} +1 -1
- package/dist/client/assets/{use-members--7RkMxwe.js → use-members-C17JGpEk.js} +1 -1
- package/dist/client/assets/{use-mobile-D09YPI1X.js → use-mobile-BnwnARpl.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Ctjt5GGI.js → use-organization-settings-CTBiXWgx.js} +1 -1
- package/dist/client/assets/{use-tool-call-DMT2JJQo.js → use-tool-call-BxgOuqkM.js} +1 -1
- package/dist/client/assets/useQuery-CeKP0W1d.js +1 -0
- package/dist/client/assets/utils-oBMoklwF.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/index-BMLzl8gY.css +0 -1
- package/dist/client/assets/json-CNPNTT1T.js +0 -1
- package/dist/client/assets/prism-light-DJ9E6c7l.js +0 -1
- package/dist/client/assets/useQuery-XS-ILlMf.js +0 -1
- package/dist/client/assets/utils-E9aiNDpO.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as V,j as s,a5 as ke,a as Ye,r as ze,a6 as Ze,d as et,b as tt,bd as st}from"./index-WOQ13cP6.js";import{E as Ee}from"./empty-state-jtBjSgAJ.js";import{E as Fe}from"./error-boundary-BjLQDRan.js";import{I as ot,a as Ke,e as nt,u as it,c as lt,d as at}from"./use-connection-B5VryFm7.js";import{b as rt}from"./use-binding-BxKMNjmS.js";import{E as Ve,P as ct,a as dt,u as mt,S as ut}from"./index-DV_-45hJ.js";import{B as ge}from"./button-DpN85Po0.js";import{I as U}from"./icon-CBAJ1FOz.js";import{a as ft,T as pt,R as ht}from"./resource-tabs-e5WwAHct.js";import{V as gt,a as xt,b as jt}from"./layout-C7PMXMWr.js";import{g as Re}from"./generate-id-Dyweu44Y.js";import{C as Le}from"./collection-display-button-Cq_29P0W.js";import{C as bt}from"./collection-search-CrkK01Ci.js";import{C as Ct}from"./card-CjmS8q7G.js";import{b as We,D as qe,a as He,c as R}from"./dropdown-menu-Bvf4p8xE.js";import{C as vt}from"./collection-table-wrapper-DtI6Q7NT.js";import{u as yt}from"./use-list-state-BvxCVBXg.js";import{B as wt}from"./extract-connection-data-CbCjXz3B.js";import{A as St,g as _t,c as Nt,b as Tt,d as It,e as At,a as Dt,f as $t}from"./alert-dialog-CCDQTgck.js";import"./utils-E9aiNDpO.js";import"./tooltip-D5O925Gp.js";import"./auth-DcsMEwUL.js";import"./mcp-oauth-CF0djzC4.js";import"./use-organization-settings-Ctjt5GGI.js";import"./use-tool-call-DMT2JJQo.js";import"./form-C-tSv2Q6.js";import"./input-DRMFvIcp.js";import"./select-DzEOHgSq.js";import"./use-gateway-Bcl96GTS.js";import"./formatDistanceToNow-Ctx6mZEP.js";import"./registry-utils-ulDDT0d8.js";import"./index-BHlakCJ5.js";import"./index-DysuQWmq.js";import"./schema-DaJ1vGek.js";import"./useQuery-XS-ILlMf.js";import"./badge-M2zkAPfT.js";import"./use-mobile-D09YPI1X.js";function Pt(t,e){const o=t.properties||{};for(const i in o){const a=o[i];if(a&&a.type==="string"&&(a.format==="url"||a.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const l=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of l)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function Ot(t){const e=V.c(25),{item:o,schema:l,actions:i}=t;let a;e[0]!==o||e[1]!==l?(a=Pt(l,o),e[0]=o,e[1]=l,e[2]=a):a=e[2];const m=a,n=o&&typeof o=="object"&&"description"in o&&typeof o.description=="string"?o.description:void 0;let u;e[3]!==i?(u=i&&Object.keys(i).length>0,e[3]=i,e[4]=u):u=e[4];const h=u;let c;e[5]!==m||e[6]!==o.title?(c=s.jsx(ot,{icon:m,name:o.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=m,e[6]=o.title,e[7]=c):c=e[7];let d;e[8]!==o.title?(d=s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.title}),e[8]=o.title,e[9]=d):d=e[9];const g=n||"No description";let y;e[10]!==g?(y=s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:g}),e[10]=g,e[11]=y):y=e[11];let f;e[12]!==d||e[13]!==y?(f=s.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[d,y]}),e[12]=d,e[13]=y,e[14]=f):f=e[14];let j;e[15]!==c||e[16]!==f?(j=s.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[c,f]}),e[15]=c,e[16]=f,e[17]=j):j=e[17];let r;e[18]!==i||e[19]!==h||e[20]!==o?(r=h&&s.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Mt,onMouseDown:Et,children:s.jsxs(We,{children:[s.jsx(qe,{asChild:!0,children:s.jsx(ge,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:zt,children:s.jsx(U,{name:"more_vert",size:20})})}),s.jsxs(He,{align:"end",onClick:kt,children:[i.open&&s.jsxs(R,{onClick:C=>{C.stopPropagation(),i.open?.(o)},children:[s.jsx(U,{name:"visibility",size:16}),"Open"]}),i.edit&&s.jsxs(R,{onClick:C=>{C.stopPropagation(),i.edit?.(o)},children:[s.jsx(U,{name:"edit",size:16}),"Edit"]}),i.duplicate&&s.jsxs(R,{onClick:C=>{C.stopPropagation(),i.duplicate?.(o)},children:[s.jsx(U,{name:"content_copy",size:16}),"Duplicate"]}),i.delete&&s.jsxs(R,{variant:"destructive",onClick:C=>{C.stopPropagation(),i.delete?.(o)},children:[s.jsx(U,{name:"delete",size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=h,e[20]=o,e[21]=r):r=e[21];let I;return e[22]!==j||e[23]!==r?(I=s.jsxs(Ct,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[j,r]}),e[22]=j,e[23]=r,e[24]=I):I=e[24],I}function kt(t){return t.stopPropagation()}function zt(t){return t.stopPropagation()}function Et(t){return t.stopPropagation()}function Mt(t){return t.stopPropagation()}function Je(t,e){return Object.keys(t.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 Ut(t){const e=V.c(32),{data:o,schema:l,viewMode:i,onViewModeChange:a,search:m,sortKey:n,sortDirection:u,onSort:h,actions:c,onItemClick:d,headerActions:g,emptyState:y,readOnly:f,columns:j,hideToolbar:r,sortableFields:I}=t,C=a===void 0?Kt:a,b=u===void 0?"asc":u,P=h===void 0?Ft:h;let w;e[0]!==c?(w=c===void 0?{}:c,e[0]=c,e[1]=w):w=e[1];const p=w,A=d===void 0?Bt:d,D=g===void 0?null:g,v=y===void 0?null:y,O=f===void 0?!1:f,N=j===void 0?void 0:j,k=r===void 0?!1:r,S=I===void 0?void 0:I;let E;e[2]!==N||e[3]!==l||e[4]!==S?(E=N?N.filter(Rt).filter(M=>!S||S.includes(M.id)).map(Vt):Je(l,S),e[2]=N,e[3]=l,e[4]=S,e[5]=E):E=e[5];const T=E;let _;e[6]!==D||e[7]!==k||e[8]!==P||e[9]!==C||e[10]!==b||e[11]!==n||e[12]!==T||e[13]!==i?(_=!k&&s.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:s.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[s.jsx("div",{className:"flex items-center gap-2 flex-1",children:D}),s.jsx("div",{className:"flex items-center gap-2 shrink-0",children:s.jsx(Le,{viewMode:i,onViewModeChange:C,sortKey:n,sortDirection:b,onSort:P,sortOptions:T})})]})}),e[6]=D,e[7]=k,e[8]=P,e[9]=C,e[10]=b,e[11]=n,e[12]=T,e[13]=i,e[14]=_):_=e[14];let z;e[15]!==p||e[16]!==N||e[17]!==o||e[18]!==v||e[19]!==A||e[20]!==P||e[21]!==O||e[22]!==l||e[23]!==m||e[24]!==b||e[25]!==n||e[26]!==S||e[27]!==i?(z=i==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:o.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:v||s.jsx(Ve,{icon:"inbox",title:"No items found",description:m?"Try adjusting your search":"No items to display"})}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.map(M=>s.jsx("div",{onClick:()=>A?.(M),className:"cursor-pointer h-full",children:s.jsx(Ot,{item:M,schema:l,readOnly:O,actions:p})},M.id))})}):s.jsx(vt,{columns:Ht(N,l,S,p),data:o,sortKey:n,sortDirection:b,onSort:P,onRowClick:A,emptyState:v||s.jsx(Ve,{icon:"inbox",title:"No items found",description:m?"Try adjusting your search":"No items to display"})}),e[15]=p,e[16]=N,e[17]=o,e[18]=v,e[19]=A,e[20]=P,e[21]=O,e[22]=l,e[23]=m,e[24]=b,e[25]=n,e[26]=S,e[27]=i,e[28]=z):z=e[28];let x;return e[29]!==_||e[30]!==z?(x=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[_,z]}),e[29]=_,e[30]=z,e[31]=x):x=e[31],x}function Vt(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Rt(t){return t.sortable!==!1}function Bt(){}function Ft(){}function Kt(){}function Lt(t){return{id:"actions",header:"",render:e=>s.jsxs(We,{children:[s.jsx(qe,{asChild:!0,children:s.jsx(ge,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:s.jsx(U,{name:"more_vert",size:20})})}),s.jsxs(He,{align:"end",onClick:o=>o.stopPropagation(),children:[t.open&&s.jsxs(R,{onClick:o=>{o.stopPropagation(),t.open?.(e)},children:[s.jsx(U,{name:"visibility",size:16}),"Open"]}),t.edit&&s.jsxs(R,{onClick:o=>{o.stopPropagation(),t.edit?.(e)},children:[s.jsx(U,{name:"edit",size:16}),"Edit"]}),t.duplicate&&s.jsxs(R,{onClick:o=>{o.stopPropagation(),t.duplicate?.(e)},children:[s.jsx(U,{name:"content_copy",size:16}),"Duplicate"]}),t.delete&&s.jsxs(R,{variant:"destructive",onClick:o=>{o.stopPropagation(),t.delete?.(e)},children:[s.jsx(U,{name:"delete",size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function Wt(t){const e=t.type;return e==="string"||e==="number"||e==="integer"||e==="boolean"}function Be(t){return t.type==="string"&&(t.format==="url"||t.format==="uri")}function qt(t,e){const o=t.properties||{},l=Object.keys(o).filter(n=>{const u=o[n];return u&&Wt(u)}),i=l.find(n=>{const u=o[n];return u&&Be(u)}),a=new Set;i&&a.add(i);const m=["title","description","updated_at","updated_by"];for(const n of m)l.includes(n)&&i!==n&&!a.has(n)&&a.add(n);for(const n of l)a.has(n)||a.add(n);return[...a.values()].map(n=>{const u=o[n];if(!u)return{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:c=>{const d=c[n];return d==null?"—":s.jsx("span",{className:"block truncate max-w-full",children:String(d)})},sortable:e?e.includes(n):!["id"].includes(n),cellClassName:"max-w-[200px]"};const h=e?e.includes(n):!["id"].includes(n);return u.format==="date-time"||n.endsWith("_at")?{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:c=>{const d=c[n];return d?s.jsx("span",{className:"block truncate max-w-full",children:new Date(d).toLocaleDateString()}):"—"},sortable:h,cellClassName:"max-w-[200px]"}:i===n&&Be(u)?{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:c=>{const d=c[n];return d?s.jsx("img",{src:String(d),alt:n,className:"h-8 w-8 rounded object-cover"}):"—"},sortable:h,cellClassName:"max-w-[200px]"}:{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:c=>{const d=c[n];return d==null?"—":s.jsx("span",{className:"block truncate max-w-full",children:String(d)})},sortable:h,cellClassName:"max-w-[100px]"}})}function Ht(t,e,o,l){const i=t||qt(e,o);return i.some(n=>n.id==="actions")?i:Object.keys(l).length>0?[...i,Lt(l)]:i}function Jt(t){const e=V.c(117),{connectionId:o,org:l,activeCollection:i}=t,a=i.name,m=i.schema??wt,n=i.hasCreateTool,u=i.hasUpdateTool,h=i.hasDeleteTool,c=ke(),{data:d}=Ye.useSession(),g=d?.user?.id||"unknown",y=Ke(o);let f;e[0]!==o?(f=lt(o),e[0]=o,e[1]=f):f=e[1];const j=f,r=nt(o,a,j),I=`${o}-${a}`;let C;e[2]!==l||e[3]!==I?(C={namespace:l,resource:I,defaultSortKey:"updated_at"},e[2]=l,e[3]=I,e[4]=C):C=e[4];const{search:b,searchTerm:P,setSearch:w,viewMode:p,setViewMode:A,sortKey:D,sortDirection:v,handleSort:O}=yt(C);let N;e[5]!==P||e[6]!==v||e[7]!==D?(N={searchTerm:P,sortKey:D,sortDirection:v},e[5]=P,e[6]=v,e[7]=D,e[8]=N):N=e[8];const k=it(o,a,j,N),S=!n&&!u&&!h;let E;e[9]!==a||e[10]!==o||e[11]!==c||e[12]!==l?(E=$=>{c({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:o,collectionName:a,itemId:$.id}})},e[9]=a,e[10]=o,e[11]=c,e[12]=l,e[13]=E):E=e[13];const T=E;let _;e[14]!==r.create||e[15]!==g?(_=async $=>{const he=new Date().toISOString();await r.create.mutateAsync({...$,id:Re("conn"),title:`${$.title} (Copy)`,created_at:he,updated_at:he,created_by:g,updated_by:g})},e[14]=r.create,e[15]=g,e[16]=_):_=e[16];const z=_,[x,M]=ze.useState(null);let le;e[17]===Symbol.for("react.memo_cache_sentinel")?(le=$=>{M($)},e[17]=le):le=e[17];const Ge=le;let B;e[18]!==T||e[19]!==u?(B=u&&{edit:T},e[18]=T,e[19]=u,e[20]=B):B=e[20];let F;e[21]!==z||e[22]!==n?(F=n&&{duplicate:z},e[21]=z,e[22]=n,e[23]=F):F=e[23];let K;e[24]!==h?(K=h&&{delete:Ge},e[24]=h,e[25]=K):K=e[25];let ae;e[26]!==K||e[27]!==B||e[28]!==F?(ae={...B,...F,...K},e[26]=K,e[27]=B,e[28]=F,e[29]=ae):ae=e[29];const xe=ae;let re;e[30]!==r.delete||e[31]!==x?(re=async()=>{x&&(await r.delete.mutateAsync(x.id),M(null))},e[30]=r.delete,e[31]=x,e[32]=re):re=e[32];const je=re;let ce;e[33]!==r.create||e[34]!==a||e[35]!==o||e[36]!==n||e[37]!==c||e[38]!==l||e[39]!==g?(ce=async()=>{if(!n){Ze.error("Create operation is not available for this collection");return}const $=new Date().toISOString(),he={id:Re("conn"),title:"New Item",created_at:$,updated_at:$,created_by:g,updated_by:g};try{const Oe=await r.create.mutateAsync(he);c({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:o,collectionName:a,itemId:Oe.id}})}catch(Oe){console.error("Failed to create item:",Oe)}},e[33]=r.create,e[34]=a,e[35]=o,e[36]=n,e[37]=c,e[38]=l,e[39]=g,e[40]=ce):ce=e[40];const be=ce;let de;e[41]!==m?(de=Je(m),e[41]=m,e[42]=de):de=e[42];const Ce=de,Me=(k?.length??0)>0,Qe=n&&Me,Xe=n&&!Me&&!b;let me;e[43]!==r.create||e[44]!==be||e[45]!==n?(me=n?s.jsxs(ge,{onClick:be,size:"sm",disabled:r.create.isPending,className:"h-7",children:[s.jsx(ct,{className:"mr-2 h-4 w-4"}),r.create.isPending?"Creating...":"Create"]}):null,e[43]=r.create,e[44]=be,e[45]=n,e[46]=me):me=e[46];const Ue=me,ve=D;let L;e[47]!==O||e[48]!==A||e[49]!==v||e[50]!==Ce||e[51]!==ve||e[52]!==p?(L=s.jsx(Le,{viewMode:p,onViewModeChange:A,sortKey:ve,sortDirection:v,onSort:O,sortOptions:Ce}),e[47]=O,e[48]=A,e[49]=v,e[50]=Ce,e[51]=ve,e[52]=p,e[53]=L):L=e[53];const ye=`${a}s`,we=y?.icon??"grid_view";let W;e[54]!==o||e[55]!==ye||e[56]!==we?(W=s.jsx(dt,{connectionId:o,title:ye,icon:we}),e[54]=o,e[55]=ye,e[56]=we,e[57]=W):W=e[57];const Se=Qe&&Ue;let q;e[58]!==L||e[59]!==W||e[60]!==Se?(q=s.jsxs(gt,{children:[L,W,Se]}),e[58]=L,e[59]=W,e[60]=Se,e[61]=q):q=e[61];const _e=`Search ${a}...`;let H;e[62]!==w?(H=$=>{$.key==="Escape"&&(w(""),$.target.blur())},e[62]=w,e[63]=H):H=e[63];let J;e[64]!==b||e[65]!==w||e[66]!==_e||e[67]!==H?(J=s.jsx(bt,{value:b,onChange:w,placeholder:_e,onKeyDown:H}),e[64]=b,e[65]=w,e[66]=_e,e[67]=H,e[68]=J):J=e[68];let G;e[69]!==k?(G=k??[],e[69]=k,e[70]=G):G=e[70];const Ne=D;let Q;e[71]!==T?(Q=$=>T($),e[71]=T,e[72]=Q):Q=e[72];const Te="No items found",Ie=b?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ae=Xe?Ue:void 0;let X;e[73]!==Te||e[74]!==Ie||e[75]!==Ae?(X=s.jsx(Ee,{image:null,title:Te,description:Ie,actions:Ae}),e[73]=Te,e[74]=Ie,e[75]=Ae,e[76]=X):X=e[76];let Y;e[77]!==O||e[78]!==S||e[79]!==xe||e[80]!==m||e[81]!==b||e[82]!==w||e[83]!==A||e[84]!==v||e[85]!==G||e[86]!==Ne||e[87]!==Q||e[88]!==X||e[89]!==p?(Y=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(Ut,{hideToolbar:!0,data:G,schema:m,viewMode:p,onViewModeChange:A,search:b,onSearchChange:w,sortKey:Ne,sortDirection:v,onSort:O,actions:xe,onItemClick:Q,readOnly:S,emptyState:X})}),e[77]=O,e[78]=S,e[79]=xe,e[80]=m,e[81]=b,e[82]=w,e[83]=A,e[84]=v,e[85]=G,e[86]=Ne,e[87]=Q,e[88]=X,e[89]=p,e[90]=Y):Y=e[90];let Z;e[91]!==J||e[92]!==Y?(Z=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[J,Y]}),e[91]=J,e[92]=Y,e[93]=Z):Z=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=s.jsx(Nt,{children:"Delete item?"}),e[95]=fe):fe=e[95];const $e=x?.title;let ee;e[96]!==$e?(ee=s.jsxs(Tt,{children:[fe,s.jsxs(It,{children:['Are you sure you want to delete "',$e,'"? This action cannot be undone.']})]}),e[96]=$e,e[97]=ee):ee=e[97];let te;e[98]!==r.delete.isPending?(te=s.jsx(St,{disabled:r.delete.isPending,children:"Cancel"}),e[98]=r.delete.isPending,e[99]=te):te=e[99];const Pe=r.delete.isPending?"Deleting...":"Delete";let se;e[100]!==r.delete.isPending||e[101]!==je||e[102]!==Pe?(se=s.jsx(_t,{onClick:je,disabled:r.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Pe}),e[100]=r.delete.isPending,e[101]=je,e[102]=Pe,e[103]=se):se=e[103];let oe;e[104]!==te||e[105]!==se?(oe=s.jsxs(At,{children:[te,se]}),e[104]=te,e[105]=se,e[106]=oe):oe=e[106];let ne;e[107]!==ee||e[108]!==oe?(ne=s.jsxs(Dt,{children:[ee,oe]}),e[107]=ee,e[108]=oe,e[109]=ne):ne=e[109];let ie;e[110]!==De||e[111]!==ne?(ie=s.jsx($t,{open:De,onOpenChange:ue,children:ne}),e[110]=De,e[111]=ne,e[112]=ie):ie=e[112];let pe;return e[113]!==q||e[114]!==Z||e[115]!==ie?(pe=s.jsxs(s.Fragment,{children:[q,Z,ie]}),e[113]=q,e[114]=Z,e[115]=ie,e[116]=pe):pe=e[116],pe}function Gt(t){const e=V.c(2),{repository:o}=t;let l;return e[0]!==o?(l=s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(ft,{repository:o})}),e[0]=o,e[1]=l):l=e[1],l}function Qt(t){const e=V.c(4),{tools:o,connectionId:l,org:i}=t;let a;return e[0]!==l||e[1]!==i||e[2]!==o?(a=s.jsx(pt,{tools:o,connectionId:l,org:i}),e[0]=l,e[1]=i,e[2]=o,e[3]=a):a=e[3],a}function Xt(t){const e=V.c(50),{connection:o,connectionId:l,org:i,requestedTabId:a,collections:m,onUpdate:n,isUpdating:u}=t,h=st();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={from:"/$org/mcps/$connectionId"},e[0]=c):c=e[0];const d=ke(c);let g;e[1]!==l?(g={connectionId:l},e[1]=l,e[2]=g):g=e[2];const y=mt(g),f=y.isAuthenticated,j=o?.metadata?.repository,r=!!j?.url,I=o?.tools?.length??0;let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={id:"settings",label:"Settings"},e[3]=C):C=e[3];let b;e[4]!==f||e[5]!==I?(b=f&&I>0?[{id:"tools",label:"Tools",count:I}]:[],e[4]=f,e[5]=I,e[6]=b):b=e[6];let P;if(e[7]!==m||e[8]!==r||e[9]!==f||e[10]!==b){let x;e[12]!==r?(x=r?[{id:"readme",label:"README"}]:[],e[12]=r,e[13]=x):x=e[13],P=[C,...b,...f?(m||[]).map(Yt):[],...x],e[7]=m,e[8]=r,e[9]=f,e[10]=b,e[11]=P}else P=e[11];const w=P,p=w.some(x=>x.id===a)?a:"settings";let A;e[14]!==d?(A=x=>{d({search:M=>({...M,tab:x}),replace:!0})},e[14]=d,e[15]=A):A=e[15];const D=A;let v;e[16]!==m?(v=m||[],e[16]=m,e[17]=v):v=e[17];let O;if(e[18]!==p||e[19]!==v){let x;e[21]!==p?(x=M=>M.name===p,e[21]=p,e[22]=x):x=e[22],O=v.find(x),e[18]=p,e[19]=v,e[20]=O}else O=e[20];const N=O;let k;e[23]!==h.history?(k=()=>h.history.back(),e[23]=h.history,e[24]=k):k=e[24];let S;e[25]!==p||e[26]!==D||e[27]!==w?(S=s.jsx(xt,{children:s.jsx(ht,{tabs:w,activeTab:p,onTabChange:D})}),e[25]=p,e[26]=D,e[27]=w,e[28]=S):S=e[28];let E;e[29]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(U,{size:32,name:"progress_activity",className:"animate-spin text-muted-foreground"})}),e[29]=E):E=e[29];let T;e[30]!==N||e[31]!==p||e[32]!==y.supportsOAuth||e[33]!==o||e[34]!==l||e[35]!==D||e[36]!==r||e[37]!==f||e[38]!==u||e[39]!==n||e[40]!==i||e[41]!==j?(T=s.jsx(ze.Suspense,{fallback:E,children:p==="tools"?s.jsx(Qt,{tools:o.tools??void 0,connectionId:l,org:i}):p==="settings"?s.jsx(ut,{connection:o,onUpdate:n,isUpdating:u,isMCPAuthenticated:f,supportsOAuth:y.supportsOAuth,onViewReadme:r?()=>D("readme"):void 0}):p==="readme"&&r?s.jsx(Gt,{repository:j}):N&&f?s.jsx(Jt,{connectionId:l,org:i,activeCollection:N},p):s.jsx(Ee,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[30]=N,e[31]=p,e[32]=y.supportsOAuth,e[33]=o,e[34]=l,e[35]=D,e[36]=r,e[37]=f,e[38]=u,e[39]=n,e[40]=i,e[41]=j,e[42]=T):T=e[42];let _;e[43]!==p||e[44]!==T?(_=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(Fe,{children:T},p)})}),e[43]=p,e[44]=T,e[45]=_):_=e[45];let z;return e[46]!==S||e[47]!==_||e[48]!==k?(z=s.jsxs(jt,{onBack:k,children:[S,_]}),e[46]=S,e[47]=_,e[48]=k,e[49]=z):z=e[49],z}function Yt(t){return{id:t.name,label:t.displayName}}function Zt(){const t=V.c(17);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const o=ke(e);let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/mcps/$connectionId"},t[1]=l):l=t[1];const{connectionId:i,org:a}=et(l);let m;t[2]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/shell/$org/mcps/$connectionId"},t[2]=m):m=t[2];const u=tt(m).tab||"settings",h=Ke(i),c=at(),d=rt(h??void 0);let g;t[3]!==c.update||t[4]!==i?(g=async j=>{await c.update.mutateAsync({id:i,data:j})},t[3]=c.update,t[4]=i,t[5]=g):g=t[5];const y=g;if(!h){let j;return t[6]!==o||t[7]!==a?(j=s.jsx("div",{className:"flex h-full w-full bg-background",children:s.jsx(Ee,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:s.jsx(ge,{variant:"outline",onClick:()=>o({to:"/$org/mcps",params:{org:a}}),children:"Back to connections"})})}),t[6]=o,t[7]=a,t[8]=j):j=t[8],j}let f;return t[9]!==c.update.isPending||t[10]!==d||t[11]!==h||t[12]!==i||t[13]!==y||t[14]!==a||t[15]!==u?(f=s.jsx(Xt,{org:a,connection:h,connectionId:i,requestedTabId:u,collections:d,onUpdate:y,isUpdating:c.update.isPending}),t[9]=c.update.isPending,t[10]=d,t[11]=h,t[12]=i,t[13]=y,t[14]=a,t[15]=u,t[16]=f):f=t[16],f}function es(){const t=V.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fe,{children:s.jsx(ze.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:s.jsx(U,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:s.jsx(Zt,{})})}),t[0]=e):e=t[0],e}function Vs(){const t=V.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(es,{}),t[0]=e):e=t[0],e}export{Vs as default};
|
|
1
|
+
import{c as V,j as s,a5 as ke,a as Ye,r as ze,a6 as Ze,d as et,b as tt,bd as st}from"./index-HoRNE_Oj.js";import{E as Ee}from"./empty-state-CwiQR0XJ.js";import{E as Fe}from"./error-boundary-8a3_at8W.js";import{I as ot,a as Ke,e as nt,u as it,c as lt,d as at}from"./use-connection-DbdMBpCj.js";import{b as rt}from"./use-binding-BPQhbEIl.js";import{E as Ve,P as ct,a as dt,u as mt,S as ut}from"./index-jKafgZHH.js";import{B as ge}from"./button-8a8UdvyR.js";import{I as U}from"./icon-CzxeHWBl.js";import{a as ft,T as pt,R as ht}from"./resource-tabs-D-d1_s9d.js";import{V as gt,a as xt,b as jt}from"./layout-DtdXVJv4.js";import{g as Re}from"./generate-id-Dyweu44Y.js";import{C as Le}from"./collection-display-button-CGcY64sw.js";import{C as bt}from"./collection-search-C7G2QK3t.js";import{C as Ct}from"./card-Cyeg7tCo.js";import{b as We,D as qe,a as He,c as R}from"./dropdown-menu-BTTzlaf4.js";import{C as vt}from"./collection-table-wrapper-DdGYlOCN.js";import{u as yt}from"./use-list-state-DhZmck5D.js";import{B as wt}from"./extract-connection-data-BpMaEsIX.js";import{A as St,g as _t,c as Nt,b as Tt,d as It,e as At,a as Dt,f as $t}from"./alert-dialog-Bj3sxji2.js";import"./utils-oBMoklwF.js";import"./tooltip-ocFCU6ZE.js";import"./auth-bF2_ysdG.js";import"./mcp-oauth-pvU53iS3.js";import"./use-organization-settings-CTBiXWgx.js";import"./use-tool-call-BxgOuqkM.js";import"./form-DU90-O_I.js";import"./input-GtBoan0u.js";import"./select-gKhGAtmi.js";import"./use-gateway-DN4bQAAB.js";import"./formatDistanceToNow-Ctx6mZEP.js";import"./registry-utils-ulDDT0d8.js";import"./index-DCY07ujJ.js";import"./index-Bgo9U3qs.js";import"./schema-zp4LhQ6R.js";import"./useQuery-CeKP0W1d.js";import"./badge-Ba7oj8pn.js";import"./use-mobile-BnwnARpl.js";function Pt(t,e){const o=t.properties||{};for(const i in o){const a=o[i];if(a&&a.type==="string"&&(a.format==="url"||a.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const l=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of l)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function Ot(t){const e=V.c(25),{item:o,schema:l,actions:i}=t;let a;e[0]!==o||e[1]!==l?(a=Pt(l,o),e[0]=o,e[1]=l,e[2]=a):a=e[2];const m=a,n=o&&typeof o=="object"&&"description"in o&&typeof o.description=="string"?o.description:void 0;let u;e[3]!==i?(u=i&&Object.keys(i).length>0,e[3]=i,e[4]=u):u=e[4];const h=u;let c;e[5]!==m||e[6]!==o.title?(c=s.jsx(ot,{icon:m,name:o.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=m,e[6]=o.title,e[7]=c):c=e[7];let d;e[8]!==o.title?(d=s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.title}),e[8]=o.title,e[9]=d):d=e[9];const g=n||"No description";let y;e[10]!==g?(y=s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:g}),e[10]=g,e[11]=y):y=e[11];let f;e[12]!==d||e[13]!==y?(f=s.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[d,y]}),e[12]=d,e[13]=y,e[14]=f):f=e[14];let j;e[15]!==c||e[16]!==f?(j=s.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[c,f]}),e[15]=c,e[16]=f,e[17]=j):j=e[17];let r;e[18]!==i||e[19]!==h||e[20]!==o?(r=h&&s.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Mt,onMouseDown:Et,children:s.jsxs(We,{children:[s.jsx(qe,{asChild:!0,children:s.jsx(ge,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:zt,children:s.jsx(U,{name:"more_vert",size:20})})}),s.jsxs(He,{align:"end",onClick:kt,children:[i.open&&s.jsxs(R,{onClick:C=>{C.stopPropagation(),i.open?.(o)},children:[s.jsx(U,{name:"visibility",size:16}),"Open"]}),i.edit&&s.jsxs(R,{onClick:C=>{C.stopPropagation(),i.edit?.(o)},children:[s.jsx(U,{name:"edit",size:16}),"Edit"]}),i.duplicate&&s.jsxs(R,{onClick:C=>{C.stopPropagation(),i.duplicate?.(o)},children:[s.jsx(U,{name:"content_copy",size:16}),"Duplicate"]}),i.delete&&s.jsxs(R,{variant:"destructive",onClick:C=>{C.stopPropagation(),i.delete?.(o)},children:[s.jsx(U,{name:"delete",size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=h,e[20]=o,e[21]=r):r=e[21];let I;return e[22]!==j||e[23]!==r?(I=s.jsxs(Ct,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[j,r]}),e[22]=j,e[23]=r,e[24]=I):I=e[24],I}function kt(t){return t.stopPropagation()}function zt(t){return t.stopPropagation()}function Et(t){return t.stopPropagation()}function Mt(t){return t.stopPropagation()}function Je(t,e){return Object.keys(t.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 Ut(t){const e=V.c(32),{data:o,schema:l,viewMode:i,onViewModeChange:a,search:m,sortKey:n,sortDirection:u,onSort:h,actions:c,onItemClick:d,headerActions:g,emptyState:y,readOnly:f,columns:j,hideToolbar:r,sortableFields:I}=t,C=a===void 0?Kt:a,b=u===void 0?"asc":u,P=h===void 0?Ft:h;let w;e[0]!==c?(w=c===void 0?{}:c,e[0]=c,e[1]=w):w=e[1];const p=w,A=d===void 0?Bt:d,D=g===void 0?null:g,v=y===void 0?null:y,O=f===void 0?!1:f,N=j===void 0?void 0:j,k=r===void 0?!1:r,S=I===void 0?void 0:I;let E;e[2]!==N||e[3]!==l||e[4]!==S?(E=N?N.filter(Rt).filter(M=>!S||S.includes(M.id)).map(Vt):Je(l,S),e[2]=N,e[3]=l,e[4]=S,e[5]=E):E=e[5];const T=E;let _;e[6]!==D||e[7]!==k||e[8]!==P||e[9]!==C||e[10]!==b||e[11]!==n||e[12]!==T||e[13]!==i?(_=!k&&s.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:s.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[s.jsx("div",{className:"flex items-center gap-2 flex-1",children:D}),s.jsx("div",{className:"flex items-center gap-2 shrink-0",children:s.jsx(Le,{viewMode:i,onViewModeChange:C,sortKey:n,sortDirection:b,onSort:P,sortOptions:T})})]})}),e[6]=D,e[7]=k,e[8]=P,e[9]=C,e[10]=b,e[11]=n,e[12]=T,e[13]=i,e[14]=_):_=e[14];let z;e[15]!==p||e[16]!==N||e[17]!==o||e[18]!==v||e[19]!==A||e[20]!==P||e[21]!==O||e[22]!==l||e[23]!==m||e[24]!==b||e[25]!==n||e[26]!==S||e[27]!==i?(z=i==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:o.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:v||s.jsx(Ve,{icon:"inbox",title:"No items found",description:m?"Try adjusting your search":"No items to display"})}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.map(M=>s.jsx("div",{onClick:()=>A?.(M),className:"cursor-pointer h-full",children:s.jsx(Ot,{item:M,schema:l,readOnly:O,actions:p})},M.id))})}):s.jsx(vt,{columns:Ht(N,l,S,p),data:o,sortKey:n,sortDirection:b,onSort:P,onRowClick:A,emptyState:v||s.jsx(Ve,{icon:"inbox",title:"No items found",description:m?"Try adjusting your search":"No items to display"})}),e[15]=p,e[16]=N,e[17]=o,e[18]=v,e[19]=A,e[20]=P,e[21]=O,e[22]=l,e[23]=m,e[24]=b,e[25]=n,e[26]=S,e[27]=i,e[28]=z):z=e[28];let x;return e[29]!==_||e[30]!==z?(x=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[_,z]}),e[29]=_,e[30]=z,e[31]=x):x=e[31],x}function Vt(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Rt(t){return t.sortable!==!1}function Bt(){}function Ft(){}function Kt(){}function Lt(t){return{id:"actions",header:"",render:e=>s.jsxs(We,{children:[s.jsx(qe,{asChild:!0,children:s.jsx(ge,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:s.jsx(U,{name:"more_vert",size:20})})}),s.jsxs(He,{align:"end",onClick:o=>o.stopPropagation(),children:[t.open&&s.jsxs(R,{onClick:o=>{o.stopPropagation(),t.open?.(e)},children:[s.jsx(U,{name:"visibility",size:16}),"Open"]}),t.edit&&s.jsxs(R,{onClick:o=>{o.stopPropagation(),t.edit?.(e)},children:[s.jsx(U,{name:"edit",size:16}),"Edit"]}),t.duplicate&&s.jsxs(R,{onClick:o=>{o.stopPropagation(),t.duplicate?.(e)},children:[s.jsx(U,{name:"content_copy",size:16}),"Duplicate"]}),t.delete&&s.jsxs(R,{variant:"destructive",onClick:o=>{o.stopPropagation(),t.delete?.(e)},children:[s.jsx(U,{name:"delete",size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function Wt(t){const e=t.type;return e==="string"||e==="number"||e==="integer"||e==="boolean"}function Be(t){return t.type==="string"&&(t.format==="url"||t.format==="uri")}function qt(t,e){const o=t.properties||{},l=Object.keys(o).filter(n=>{const u=o[n];return u&&Wt(u)}),i=l.find(n=>{const u=o[n];return u&&Be(u)}),a=new Set;i&&a.add(i);const m=["title","description","updated_at","updated_by"];for(const n of m)l.includes(n)&&i!==n&&!a.has(n)&&a.add(n);for(const n of l)a.has(n)||a.add(n);return[...a.values()].map(n=>{const u=o[n];if(!u)return{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:c=>{const d=c[n];return d==null?"—":s.jsx("span",{className:"block truncate max-w-full",children:String(d)})},sortable:e?e.includes(n):!["id"].includes(n),cellClassName:"max-w-[200px]"};const h=e?e.includes(n):!["id"].includes(n);return u.format==="date-time"||n.endsWith("_at")?{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:c=>{const d=c[n];return d?s.jsx("span",{className:"block truncate max-w-full",children:new Date(d).toLocaleDateString()}):"—"},sortable:h,cellClassName:"max-w-[200px]"}:i===n&&Be(u)?{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:c=>{const d=c[n];return d?s.jsx("img",{src:String(d),alt:n,className:"h-8 w-8 rounded object-cover"}):"—"},sortable:h,cellClassName:"max-w-[200px]"}:{id:n,header:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," "),render:c=>{const d=c[n];return d==null?"—":s.jsx("span",{className:"block truncate max-w-full",children:String(d)})},sortable:h,cellClassName:"max-w-[100px]"}})}function Ht(t,e,o,l){const i=t||qt(e,o);return i.some(n=>n.id==="actions")?i:Object.keys(l).length>0?[...i,Lt(l)]:i}function Jt(t){const e=V.c(117),{connectionId:o,org:l,activeCollection:i}=t,a=i.name,m=i.schema??wt,n=i.hasCreateTool,u=i.hasUpdateTool,h=i.hasDeleteTool,c=ke(),{data:d}=Ye.useSession(),g=d?.user?.id||"unknown",y=Ke(o);let f;e[0]!==o?(f=lt(o),e[0]=o,e[1]=f):f=e[1];const j=f,r=nt(o,a,j),I=`${o}-${a}`;let C;e[2]!==l||e[3]!==I?(C={namespace:l,resource:I,defaultSortKey:"updated_at"},e[2]=l,e[3]=I,e[4]=C):C=e[4];const{search:b,searchTerm:P,setSearch:w,viewMode:p,setViewMode:A,sortKey:D,sortDirection:v,handleSort:O}=yt(C);let N;e[5]!==P||e[6]!==v||e[7]!==D?(N={searchTerm:P,sortKey:D,sortDirection:v},e[5]=P,e[6]=v,e[7]=D,e[8]=N):N=e[8];const k=it(o,a,j,N),S=!n&&!u&&!h;let E;e[9]!==a||e[10]!==o||e[11]!==c||e[12]!==l?(E=$=>{c({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:o,collectionName:a,itemId:$.id}})},e[9]=a,e[10]=o,e[11]=c,e[12]=l,e[13]=E):E=e[13];const T=E;let _;e[14]!==r.create||e[15]!==g?(_=async $=>{const he=new Date().toISOString();await r.create.mutateAsync({...$,id:Re("conn"),title:`${$.title} (Copy)`,created_at:he,updated_at:he,created_by:g,updated_by:g})},e[14]=r.create,e[15]=g,e[16]=_):_=e[16];const z=_,[x,M]=ze.useState(null);let le;e[17]===Symbol.for("react.memo_cache_sentinel")?(le=$=>{M($)},e[17]=le):le=e[17];const Ge=le;let B;e[18]!==T||e[19]!==u?(B=u&&{edit:T},e[18]=T,e[19]=u,e[20]=B):B=e[20];let F;e[21]!==z||e[22]!==n?(F=n&&{duplicate:z},e[21]=z,e[22]=n,e[23]=F):F=e[23];let K;e[24]!==h?(K=h&&{delete:Ge},e[24]=h,e[25]=K):K=e[25];let ae;e[26]!==K||e[27]!==B||e[28]!==F?(ae={...B,...F,...K},e[26]=K,e[27]=B,e[28]=F,e[29]=ae):ae=e[29];const xe=ae;let re;e[30]!==r.delete||e[31]!==x?(re=async()=>{x&&(await r.delete.mutateAsync(x.id),M(null))},e[30]=r.delete,e[31]=x,e[32]=re):re=e[32];const je=re;let ce;e[33]!==r.create||e[34]!==a||e[35]!==o||e[36]!==n||e[37]!==c||e[38]!==l||e[39]!==g?(ce=async()=>{if(!n){Ze.error("Create operation is not available for this collection");return}const $=new Date().toISOString(),he={id:Re("conn"),title:"New Item",created_at:$,updated_at:$,created_by:g,updated_by:g};try{const Oe=await r.create.mutateAsync(he);c({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:l,connectionId:o,collectionName:a,itemId:Oe.id}})}catch(Oe){console.error("Failed to create item:",Oe)}},e[33]=r.create,e[34]=a,e[35]=o,e[36]=n,e[37]=c,e[38]=l,e[39]=g,e[40]=ce):ce=e[40];const be=ce;let de;e[41]!==m?(de=Je(m),e[41]=m,e[42]=de):de=e[42];const Ce=de,Me=(k?.length??0)>0,Qe=n&&Me,Xe=n&&!Me&&!b;let me;e[43]!==r.create||e[44]!==be||e[45]!==n?(me=n?s.jsxs(ge,{onClick:be,size:"sm",disabled:r.create.isPending,className:"h-7",children:[s.jsx(ct,{className:"mr-2 h-4 w-4"}),r.create.isPending?"Creating...":"Create"]}):null,e[43]=r.create,e[44]=be,e[45]=n,e[46]=me):me=e[46];const Ue=me,ve=D;let L;e[47]!==O||e[48]!==A||e[49]!==v||e[50]!==Ce||e[51]!==ve||e[52]!==p?(L=s.jsx(Le,{viewMode:p,onViewModeChange:A,sortKey:ve,sortDirection:v,onSort:O,sortOptions:Ce}),e[47]=O,e[48]=A,e[49]=v,e[50]=Ce,e[51]=ve,e[52]=p,e[53]=L):L=e[53];const ye=`${a}s`,we=y?.icon??"grid_view";let W;e[54]!==o||e[55]!==ye||e[56]!==we?(W=s.jsx(dt,{connectionId:o,title:ye,icon:we}),e[54]=o,e[55]=ye,e[56]=we,e[57]=W):W=e[57];const Se=Qe&&Ue;let q;e[58]!==L||e[59]!==W||e[60]!==Se?(q=s.jsxs(gt,{children:[L,W,Se]}),e[58]=L,e[59]=W,e[60]=Se,e[61]=q):q=e[61];const _e=`Search ${a}...`;let H;e[62]!==w?(H=$=>{$.key==="Escape"&&(w(""),$.target.blur())},e[62]=w,e[63]=H):H=e[63];let J;e[64]!==b||e[65]!==w||e[66]!==_e||e[67]!==H?(J=s.jsx(bt,{value:b,onChange:w,placeholder:_e,onKeyDown:H}),e[64]=b,e[65]=w,e[66]=_e,e[67]=H,e[68]=J):J=e[68];let G;e[69]!==k?(G=k??[],e[69]=k,e[70]=G):G=e[70];const Ne=D;let Q;e[71]!==T?(Q=$=>T($),e[71]=T,e[72]=Q):Q=e[72];const Te="No items found",Ie=b?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ae=Xe?Ue:void 0;let X;e[73]!==Te||e[74]!==Ie||e[75]!==Ae?(X=s.jsx(Ee,{image:null,title:Te,description:Ie,actions:Ae}),e[73]=Te,e[74]=Ie,e[75]=Ae,e[76]=X):X=e[76];let Y;e[77]!==O||e[78]!==S||e[79]!==xe||e[80]!==m||e[81]!==b||e[82]!==w||e[83]!==A||e[84]!==v||e[85]!==G||e[86]!==Ne||e[87]!==Q||e[88]!==X||e[89]!==p?(Y=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(Ut,{hideToolbar:!0,data:G,schema:m,viewMode:p,onViewModeChange:A,search:b,onSearchChange:w,sortKey:Ne,sortDirection:v,onSort:O,actions:xe,onItemClick:Q,readOnly:S,emptyState:X})}),e[77]=O,e[78]=S,e[79]=xe,e[80]=m,e[81]=b,e[82]=w,e[83]=A,e[84]=v,e[85]=G,e[86]=Ne,e[87]=Q,e[88]=X,e[89]=p,e[90]=Y):Y=e[90];let Z;e[91]!==J||e[92]!==Y?(Z=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[J,Y]}),e[91]=J,e[92]=Y,e[93]=Z):Z=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=s.jsx(Nt,{children:"Delete item?"}),e[95]=fe):fe=e[95];const $e=x?.title;let ee;e[96]!==$e?(ee=s.jsxs(Tt,{children:[fe,s.jsxs(It,{children:['Are you sure you want to delete "',$e,'"? This action cannot be undone.']})]}),e[96]=$e,e[97]=ee):ee=e[97];let te;e[98]!==r.delete.isPending?(te=s.jsx(St,{disabled:r.delete.isPending,children:"Cancel"}),e[98]=r.delete.isPending,e[99]=te):te=e[99];const Pe=r.delete.isPending?"Deleting...":"Delete";let se;e[100]!==r.delete.isPending||e[101]!==je||e[102]!==Pe?(se=s.jsx(_t,{onClick:je,disabled:r.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Pe}),e[100]=r.delete.isPending,e[101]=je,e[102]=Pe,e[103]=se):se=e[103];let oe;e[104]!==te||e[105]!==se?(oe=s.jsxs(At,{children:[te,se]}),e[104]=te,e[105]=se,e[106]=oe):oe=e[106];let ne;e[107]!==ee||e[108]!==oe?(ne=s.jsxs(Dt,{children:[ee,oe]}),e[107]=ee,e[108]=oe,e[109]=ne):ne=e[109];let ie;e[110]!==De||e[111]!==ne?(ie=s.jsx($t,{open:De,onOpenChange:ue,children:ne}),e[110]=De,e[111]=ne,e[112]=ie):ie=e[112];let pe;return e[113]!==q||e[114]!==Z||e[115]!==ie?(pe=s.jsxs(s.Fragment,{children:[q,Z,ie]}),e[113]=q,e[114]=Z,e[115]=ie,e[116]=pe):pe=e[116],pe}function Gt(t){const e=V.c(2),{repository:o}=t;let l;return e[0]!==o?(l=s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(ft,{repository:o})}),e[0]=o,e[1]=l):l=e[1],l}function Qt(t){const e=V.c(4),{tools:o,connectionId:l,org:i}=t;let a;return e[0]!==l||e[1]!==i||e[2]!==o?(a=s.jsx(pt,{tools:o,connectionId:l,org:i}),e[0]=l,e[1]=i,e[2]=o,e[3]=a):a=e[3],a}function Xt(t){const e=V.c(50),{connection:o,connectionId:l,org:i,requestedTabId:a,collections:m,onUpdate:n,isUpdating:u}=t,h=st();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={from:"/$org/mcps/$connectionId"},e[0]=c):c=e[0];const d=ke(c);let g;e[1]!==l?(g={connectionId:l},e[1]=l,e[2]=g):g=e[2];const y=mt(g),f=y.isAuthenticated,j=o?.metadata?.repository,r=!!j?.url,I=o?.tools?.length??0;let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={id:"settings",label:"Settings"},e[3]=C):C=e[3];let b;e[4]!==f||e[5]!==I?(b=f&&I>0?[{id:"tools",label:"Tools",count:I}]:[],e[4]=f,e[5]=I,e[6]=b):b=e[6];let P;if(e[7]!==m||e[8]!==r||e[9]!==f||e[10]!==b){let x;e[12]!==r?(x=r?[{id:"readme",label:"README"}]:[],e[12]=r,e[13]=x):x=e[13],P=[C,...b,...f?(m||[]).map(Yt):[],...x],e[7]=m,e[8]=r,e[9]=f,e[10]=b,e[11]=P}else P=e[11];const w=P,p=w.some(x=>x.id===a)?a:"settings";let A;e[14]!==d?(A=x=>{d({search:M=>({...M,tab:x}),replace:!0})},e[14]=d,e[15]=A):A=e[15];const D=A;let v;e[16]!==m?(v=m||[],e[16]=m,e[17]=v):v=e[17];let O;if(e[18]!==p||e[19]!==v){let x;e[21]!==p?(x=M=>M.name===p,e[21]=p,e[22]=x):x=e[22],O=v.find(x),e[18]=p,e[19]=v,e[20]=O}else O=e[20];const N=O;let k;e[23]!==h.history?(k=()=>h.history.back(),e[23]=h.history,e[24]=k):k=e[24];let S;e[25]!==p||e[26]!==D||e[27]!==w?(S=s.jsx(xt,{children:s.jsx(ht,{tabs:w,activeTab:p,onTabChange:D})}),e[25]=p,e[26]=D,e[27]=w,e[28]=S):S=e[28];let E;e[29]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(U,{size:32,name:"progress_activity",className:"animate-spin text-muted-foreground"})}),e[29]=E):E=e[29];let T;e[30]!==N||e[31]!==p||e[32]!==y.supportsOAuth||e[33]!==o||e[34]!==l||e[35]!==D||e[36]!==r||e[37]!==f||e[38]!==u||e[39]!==n||e[40]!==i||e[41]!==j?(T=s.jsx(ze.Suspense,{fallback:E,children:p==="tools"?s.jsx(Qt,{tools:o.tools??void 0,connectionId:l,org:i}):p==="settings"?s.jsx(ut,{connection:o,onUpdate:n,isUpdating:u,isMCPAuthenticated:f,supportsOAuth:y.supportsOAuth,onViewReadme:r?()=>D("readme"):void 0}):p==="readme"&&r?s.jsx(Gt,{repository:j}):N&&f?s.jsx(Jt,{connectionId:l,org:i,activeCollection:N},p):s.jsx(Ee,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[30]=N,e[31]=p,e[32]=y.supportsOAuth,e[33]=o,e[34]=l,e[35]=D,e[36]=r,e[37]=f,e[38]=u,e[39]=n,e[40]=i,e[41]=j,e[42]=T):T=e[42];let _;e[43]!==p||e[44]!==T?(_=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(Fe,{children:T},p)})}),e[43]=p,e[44]=T,e[45]=_):_=e[45];let z;return e[46]!==S||e[47]!==_||e[48]!==k?(z=s.jsxs(jt,{onBack:k,children:[S,_]}),e[46]=S,e[47]=_,e[48]=k,e[49]=z):z=e[49],z}function Yt(t){return{id:t.name,label:t.displayName}}function Zt(){const t=V.c(17);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const o=ke(e);let l;t[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/mcps/$connectionId"},t[1]=l):l=t[1];const{connectionId:i,org:a}=et(l);let m;t[2]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/shell/$org/mcps/$connectionId"},t[2]=m):m=t[2];const u=tt(m).tab||"settings",h=Ke(i),c=at(),d=rt(h??void 0);let g;t[3]!==c.update||t[4]!==i?(g=async j=>{await c.update.mutateAsync({id:i,data:j})},t[3]=c.update,t[4]=i,t[5]=g):g=t[5];const y=g;if(!h){let j;return t[6]!==o||t[7]!==a?(j=s.jsx("div",{className:"flex h-full w-full bg-background",children:s.jsx(Ee,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:s.jsx(ge,{variant:"outline",onClick:()=>o({to:"/$org/mcps",params:{org:a}}),children:"Back to connections"})})}),t[6]=o,t[7]=a,t[8]=j):j=t[8],j}let f;return t[9]!==c.update.isPending||t[10]!==d||t[11]!==h||t[12]!==i||t[13]!==y||t[14]!==a||t[15]!==u?(f=s.jsx(Xt,{org:a,connection:h,connectionId:i,requestedTabId:u,collections:d,onUpdate:y,isUpdating:c.update.isPending}),t[9]=c.update.isPending,t[10]=d,t[11]=h,t[12]=i,t[13]=y,t[14]=a,t[15]=u,t[16]=f):f=t[16],f}function es(){const t=V.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Fe,{children:s.jsx(ze.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:s.jsx(U,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:s.jsx(Zt,{})})}),t[0]=e):e=t[0],e}function Vs(){const t=V.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(es,{}),t[0]=e):e=t[0],e}export{Vs as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ze,j as t,r as Me,a5 as Fe,b as Ke,a as Be,ar as He,as as Oe}from"./index-WOQ13cP6.js";import{C as Re}from"./schema-DaJ1vGek.js";import{C as Ve}from"./collection-header-CP7DLL6n.js";import{C as Le}from"./collection-page-C1jzPNDj.js";import{C as Ue}from"./collection-search-CrkK01Ci.js";import{C as We}from"./collection-table-wrapper-DtI6Q7NT.js";import{C as qe}from"./connection-card-CvYHrR5S.js";import{E as Ne}from"./empty-state-jtBjSgAJ.js";import{E as Ge}from"./error-boundary-BjLQDRan.js";import{d as Je,b as Qe,I as Xe}from"./use-connection-B5VryFm7.js";import{u as Ye}from"./use-list-state-BvxCVBXg.js";import{u as Ze}from"./tooltip-D5O925Gp.js";import{c as et,b as tt,d as nt,A as ot,e as st,g as it,a as rt,f as lt}from"./alert-dialog-CCDQTgck.js";import{B as ct}from"./badge-M2zkAPfT.js";import{B as F}from"./button-DpN85Po0.js";import{a as at,b as dt,D as mt,f as ut,c as pt,d as ht}from"./dialog-CfKieCBd.js";import{b as Te,D as Ae,a as $e,c as fe}from"./dropdown-menu-Bvf4p8xE.js";import{F as B,a as ft,b as H,c as O,d as R,f as V}from"./form-C-tSv2Q6.js";import{I as m}from"./icon-CBAJ1FOz.js";import{I as Pe}from"./input-DRMFvIcp.js";import{c as gt,a as xt,S as jt,b as Ct,d as Ie}from"./select-DzEOHgSq.js";import{T as _t}from"./textarea-BNSwm2Uw.js";import{g as St}from"./generate-id-Dyweu44Y.js";import"./collection-display-button-Cq_29P0W.js";import"./utils-E9aiNDpO.js";import"./card-CjmS8q7G.js";import"./use-mobile-D09YPI1X.js";const yt=Re.pick({title:!0,description:!0,connection_type:!0,connection_url:!0,connection_token:!0}).partial({description:!0,connection_token:!0});function vt(e,n){switch(n.type){case"edit":return{mode:"editing",connection:n.connection};case"delete":return{mode:"deleting",connection:n.connection};case"close":return{mode:"idle"}}}function bt(){const e=ze.c(126),{org:n}=Ze(),r=Fe();let L;e[0]===Symbol.for("react.memo_cache_sentinel")?(L={strict:!1},e[0]=L):L=e[0];const Ee=Ke(L),{data:ge}=Be.useSession();let U;e[1]!==n.slug?(U={namespace:n.slug,resource:"connections"},e[1]=n.slug,e[2]=U):U=e[2];const o=Ye(U),d=Je(),K=Qe(o);let W;e[3]===Symbol.for("react.memo_cache_sentinel")?(W={mode:"idle"},e[3]=W):W=e[3];const[c,u]=Me.useReducer(vt,W),q=Ee.action==="create";let G;e[4]!==r||e[5]!==n.slug?(G=()=>{r({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},e[4]=r,e[5]=n.slug,e[6]=G):G=e[6];const xe=G;let J;e[7]!==r||e[8]!==n.slug?(J=()=>{r({to:"/$org/mcps",params:{org:n.slug},search:{}})},e[7]=r,e[8]=n.slug,e[9]=J):J=e[9];const p=J;let Q;e[10]===Symbol.for("react.memo_cache_sentinel")?(Q={resolver:He(yt),defaultValues:{title:"",description:null,connection_type:"HTTP",connection_url:"",connection_token:null}},e[10]=Q):Q=e[10];const i=Oe(Q),l=c.mode==="editing"?c.connection:null;let X,Y;e[11]!==l||e[12]!==i?(X=()=>{l?i.reset({title:l.title,description:l.description,connection_type:l.connection_type,connection_url:l.connection_url,connection_token:null}):i.reset({title:"",description:null,connection_type:"HTTP",connection_url:"",connection_token:null})},Y=[l,i],e[11]=l,e[12]=i,e[13]=X,e[14]=Y):(X=e[13],Y=e[14]),Me.useEffect(X,Y);let Z;e[15]!==d||e[16]!==c.connection||e[17]!==c.mode?(Z=async()=>{if(c.mode!=="deleting")return;const s=c.connection.id;u({type:"close"});try{await d.delete.mutateAsync(s)}catch{}},e[15]=d,e[16]=c.connection,e[17]=c.mode,e[18]=Z):Z=e[18];const je=Z;let ee;e[19]!==d||e[20]!==p||e[21]!==l||e[22]!==i||e[23]!==r||e[24]!==n.id||e[25]!==n.slug||e[26]!==ge?.user?.id?(ee=async s=>{if(l){await d.update.mutateAsync({id:l.id,data:{title:s.title,description:s.description||null,connection_type:s.connection_type,connection_url:s.connection_url,...s.connection_token&&{connection_token:s.connection_token}}}),u({type:"close"}),i.reset();return}const a=St("conn");await d.create.mutateAsync({id:a,title:s.title,description:s.description||null,connection_type:s.connection_type,connection_url:s.connection_url,connection_token:s.connection_token||null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:ge?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:null,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),p(),i.reset(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:a}})},e[19]=d,e[20]=p,e[21]=l,e[22]=i,e[23]=r,e[24]=n.id,e[25]=n.slug,e[26]=ge?.user?.id,e[27]=ee):ee=e[27];const Ce=ee;let te;e[28]!==p||e[29]!==i||e[30]!==q?(te=s=>{s||(q?p():u({type:"close"}),i.reset())},e[28]=p,e[29]=i,e[30]=q,e[31]=te):te=e[31];const h=te;let ne,oe,se,ie,re,le;e[32]===Symbol.for("react.memo_cache_sentinel")?(ne={id:"icon",header:"",render:Bt,cellClassName:"w-16 shrink-0",wrap:!0},oe={id:"title",header:"Name",render:Kt,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},se={id:"description",header:"Description",render:Ft,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},ie={id:"connection_type",header:"Type",accessor:Et,cellClassName:"w-24 shrink-0",sortable:!0},re={id:"connection_url",header:"URL",render:zt,wrap:!0,cellClassName:"w-48 min-w-0 shrink-0"},le={id:"status",header:"Status",render:$t,cellClassName:"w-24 shrink-0",sortable:!0},e[32]=ne,e[33]=oe,e[34]=se,e[35]=ie,e[36]=re,e[37]=le):(ne=e[32],oe=e[33],se=e[34],ie=e[35],re=e[36],le=e[37]);let ce;e[38]!==r||e[39]!==n.slug?(ce=[ne,oe,se,ie,re,le,{id:"actions",header:"",render:s=>t.jsxs(Te,{children:[t.jsx(Ae,{asChild:!0,children:t.jsx(F,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:At,children:t.jsx(m,{name:"more_vert",size:20})})}),t.jsxs($e,{align:"end",onClick:Tt,children:[t.jsxs(fe,{onClick:a=>{a.stopPropagation(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}})},children:[t.jsx(m,{name:"visibility",size:16}),"Inspect"]}),t.jsxs(fe,{variant:"destructive",onClick:a=>{a.stopPropagation(),u({type:"delete",connection:s})},children:[t.jsx(m,{name:"delete",size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[38]=r,e[39]=n.slug,e[40]=ce):ce=e[40];const _e=ce;let f;e[41]!==r||e[42]!==n.slug?(f=t.jsx(F,{variant:"outline",onClick:()=>r({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e[41]=r,e[42]=n.slug,e[43]=f):f=e[43];let g;e[44]!==xe?(g=t.jsx(F,{onClick:xe,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Connect MCP Server"}),e[44]=xe,e[45]=g):g=e[45];let ae;e[46]!==f||e[47]!==g?(ae=t.jsxs("div",{className:"flex items-center gap-2",children:[f,g]}),e[46]=f,e[47]=g,e[48]=ae):ae=e[48];const Se=ae,ye=q||c.mode==="editing",ve=l?"Edit Connection":"Create New Connection";let x;e[49]!==ve?(x=t.jsx(at,{children:ve}),e[49]=ve,e[50]=x):x=e[50];const be=l?"Update the connection details below.":"Add a new connection to your organization. Fill in the details below.";let j;e[51]!==be?(j=t.jsx(dt,{children:be}),e[51]=be,e[52]=j):j=e[52];let C;e[53]!==x||e[54]!==j?(C=t.jsxs(mt,{children:[x,j]}),e[53]=x,e[54]=j,e[55]=C):C=e[55];let _;e[56]!==i||e[57]!==Ce?(_=i.handleSubmit(Ce),e[56]=i,e[57]=Ce,e[58]=_):_=e[58];let S;e[59]!==i.control?(S=t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsx(B,{control:i.control,name:"title",render:Pt}),t.jsx(B,{control:i.control,name:"description",render:Mt}),t.jsx(B,{control:i.control,name:"connection_type",render:It}),t.jsx(B,{control:i.control,name:"connection_url",render:Nt}),t.jsx(B,{control:i.control,name:"connection_token",render:kt})]}),e[59]=i.control,e[60]=S):S=e[60];let y;e[61]!==h?(y=t.jsx(F,{type:"button",variant:"outline",onClick:()=>h(!1),children:"Cancel"}),e[61]=h,e[62]=y):y=e[62];const we=i.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection";let v;e[63]!==i.formState.isSubmitting||e[64]!==we?(v=t.jsx(F,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:we}),e[63]=i.formState.isSubmitting,e[64]=we,e[65]=v):v=e[65];let b;e[66]!==y||e[67]!==v?(b=t.jsxs(ut,{children:[y,v]}),e[66]=y,e[67]=v,e[68]=b):b=e[68];let w;e[69]!==_||e[70]!==S||e[71]!==b?(w=t.jsxs("form",{onSubmit:_,children:[S,b]}),e[69]=_,e[70]=S,e[71]=b,e[72]=w):w=e[72];let D;e[73]!==i||e[74]!==w?(D=t.jsx(ft,{...i,children:w}),e[73]=i,e[74]=w,e[75]=D):D=e[75];let k;e[76]!==C||e[77]!==D?(k=t.jsxs(pt,{className:"sm:max-w-[525px]",children:[C,D]}),e[76]=C,e[77]=D,e[78]=k):k=e[78];let N;e[79]!==h||e[80]!==ye||e[81]!==k?(N=t.jsx(ht,{open:ye,onOpenChange:h,children:k}),e[79]=h,e[80]=ye,e[81]=k,e[82]=N):N=e[82];const De=c.mode==="deleting";let de;e[83]===Symbol.for("react.memo_cache_sentinel")?(de=s=>!s&&u({type:"close"}),e[83]=de):de=e[83];let me;e[84]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(et,{children:"Delete Connection?"}),e[84]=me):me=e[84];const ke=c.mode==="deleting"&&c.connection.title;let I;e[85]!==ke?(I=t.jsxs(tt,{children:[me,t.jsxs(nt,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:ke}),"."]})]}),e[85]=ke,e[86]=I):I=e[86];let ue;e[87]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(ot,{children:"Cancel"}),e[87]=ue):ue=e[87];let M;e[88]!==je?(M=t.jsxs(st,{children:[ue,t.jsx(it,{onClick:je,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[88]=je,e[89]=M):M=e[89];let P;e[90]!==I||e[91]!==M?(P=t.jsxs(rt,{children:[I,M]}),e[90]=I,e[91]=M,e[92]=P):P=e[92];let T;e[93]!==De||e[94]!==P?(T=t.jsx(lt,{open:De,onOpenChange:de,children:P}),e[93]=De,e[94]=P,e[95]=T):T=e[95];let pe;e[96]===Symbol.for("react.memo_cache_sentinel")?(pe=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],e[96]=pe):pe=e[96];let A;e[97]!==Se||e[98]!==o.handleSort||e[99]!==o.setViewMode||e[100]!==o.sortDirection||e[101]!==o.sortKey||e[102]!==o.viewMode?(A=t.jsx(Ve,{title:"MCP Servers",viewMode:o.viewMode,onViewModeChange:o.setViewMode,sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,sortOptions:pe,ctaButton:Se}),e[97]=Se,e[98]=o.handleSort,e[99]=o.setViewMode,e[100]=o.sortDirection,e[101]=o.sortKey,e[102]=o.viewMode,e[103]=A):A=e[103];let $;e[104]!==o?($=s=>{s.key==="Escape"&&(o.setSearch(""),s.target.blur())},e[104]=o,e[105]=$):$=e[105];let z;e[106]!==o.search||e[107]!==o.setSearch||e[108]!==$?(z=t.jsx(Ue,{value:o.search,onChange:o.setSearch,placeholder:"Search for an MCP Server...",onKeyDown:$}),e[106]=o.search,e[107]=o.setSearch,e[108]=$,e[109]=z):z=e[109];let E;e[110]!==_e||e[111]!==K||e[112]!==o.handleSort||e[113]!==o.search||e[114]!==o.sortDirection||e[115]!==o.sortKey||e[116]!==o.viewMode||e[117]!==r||e[118]!==n.slug?(E=o.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:K.length===0?t.jsx(Ne,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:(o.search,"No MCP Servers found"),description:o.search?`No MCP Servers match "${o.search}"`:"Create a connection to get started."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:K.map(s=>t.jsx(qe,{connection:s,fallbackIcon:"extension",onClick:()=>r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}}),headerActions:t.jsxs(Te,{children:[t.jsx(Ae,{asChild:!0,children:t.jsx(F,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Dt,children:t.jsx(m,{name:"more_vert",size:20})})}),t.jsxs($e,{align:"end",onClick:wt,children:[t.jsxs(fe,{onClick:a=>{a.stopPropagation(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}})},children:[t.jsx(m,{name:"visibility",size:16}),"Inspect"]}),t.jsxs(fe,{variant:"destructive",onClick:a=>{a.stopPropagation(),u({type:"delete",connection:s})},children:[t.jsx(m,{name:"delete",size:16}),"Delete"]})]})]})},s.id))})}):t.jsx(We,{columns:_e,data:K,isLoading:!1,sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,onRowClick:s=>r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}}),emptyState:o.search?t.jsx(Ne,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:`No MCP Servers match "${o.search}"`}):t.jsx(Ne,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:"Create a connection to get started."})}),e[110]=_e,e[111]=K,e[112]=o.handleSort,e[113]=o.search,e[114]=o.sortDirection,e[115]=o.sortKey,e[116]=o.viewMode,e[117]=r,e[118]=n.slug,e[119]=E):E=e[119];let he;return e[120]!==N||e[121]!==T||e[122]!==A||e[123]!==z||e[124]!==E?(he=t.jsxs(Le,{children:[N,T,A,z,E]}),e[120]=N,e[121]=T,e[122]=A,e[123]=z,e[124]=E,e[125]=he):he=e[125],he}function wt(e){return e.stopPropagation()}function Dt(e){return e.stopPropagation()}function kt(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"Token (optional)"}),t.jsx(R,{children:t.jsx(Pe,{type:"password",placeholder:"Bearer token or API key",...n,value:n.value??""})}),t.jsx(V,{})]})}function Nt(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"URL *"}),t.jsx(R,{children:t.jsx(Pe,{placeholder:"https://example.com/mcp",...n})}),t.jsx(V,{})]})}function It(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"Type *"}),t.jsxs(gt,{value:n.value,onValueChange:n.onChange,children:[t.jsx(R,{children:t.jsx(xt,{children:t.jsx(jt,{})})}),t.jsxs(Ct,{children:[t.jsx(Ie,{value:"HTTP",children:"HTTP"}),t.jsx(Ie,{value:"SSE",children:"SSE"}),t.jsx(Ie,{value:"Websocket",children:"Websocket"})]})]}),t.jsx(V,{})]})}function Mt(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"Description"}),t.jsx(R,{children:t.jsx(_t,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),t.jsx(V,{})]})}function Pt(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"Name *"}),t.jsx(R,{children:t.jsx(Pe,{placeholder:"My Connection",...n})}),t.jsx(V,{})]})}function Tt(e){return e.stopPropagation()}function At(e){return e.stopPropagation()}function $t(e){return t.jsx(ct,{variant:e.status==="active"?"success":"outline",children:e.status})}function zt(e){return t.jsx("span",{className:"text-sm text-muted-foreground block truncate",children:e.connection_url})}function Et(e){return t.jsx("span",{className:"text-sm font-medium",children:e.connection_type})}function Ft(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Kt(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Bt(e){return t.jsx(Xe,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:"extension"})}function hn(){const e=ze.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Ge,{children:t.jsx(Me.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(m,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(bt,{})})}),e[0]=n):n=e[0],n}export{hn as default};
|
|
1
|
+
import{c as ze,j as t,r as Me,a5 as Fe,b as Ke,a as Be,ar as He,as as Oe}from"./index-HoRNE_Oj.js";import{C as Re}from"./schema-zp4LhQ6R.js";import{C as Ve}from"./collection-header-B92Inaku.js";import{C as Le}from"./collection-page-BfXTrpEI.js";import{C as Ue}from"./collection-search-C7G2QK3t.js";import{C as We}from"./collection-table-wrapper-DdGYlOCN.js";import{C as qe}from"./connection-card-xMF7zskf.js";import{E as Ne}from"./empty-state-CwiQR0XJ.js";import{E as Ge}from"./error-boundary-8a3_at8W.js";import{d as Je,b as Qe,I as Xe}from"./use-connection-DbdMBpCj.js";import{u as Ye}from"./use-list-state-DhZmck5D.js";import{u as Ze}from"./tooltip-ocFCU6ZE.js";import{c as et,b as tt,d as nt,A as ot,e as st,g as it,a as rt,f as lt}from"./alert-dialog-Bj3sxji2.js";import{B as ct}from"./badge-Ba7oj8pn.js";import{B as F}from"./button-8a8UdvyR.js";import{a as at,b as dt,D as mt,f as ut,c as pt,d as ht}from"./dialog-DOdwpjqP.js";import{b as Te,D as Ae,a as $e,c as fe}from"./dropdown-menu-BTTzlaf4.js";import{F as B,a as ft,b as H,c as O,d as R,f as V}from"./form-DU90-O_I.js";import{I as m}from"./icon-CzxeHWBl.js";import{I as Pe}from"./input-GtBoan0u.js";import{c as gt,a as xt,S as jt,b as Ct,d as Ie}from"./select-gKhGAtmi.js";import{T as _t}from"./textarea-CTPqKmyI.js";import{g as St}from"./generate-id-Dyweu44Y.js";import"./collection-display-button-CGcY64sw.js";import"./utils-oBMoklwF.js";import"./card-Cyeg7tCo.js";import"./use-mobile-BnwnARpl.js";const yt=Re.pick({title:!0,description:!0,connection_type:!0,connection_url:!0,connection_token:!0}).partial({description:!0,connection_token:!0});function vt(e,n){switch(n.type){case"edit":return{mode:"editing",connection:n.connection};case"delete":return{mode:"deleting",connection:n.connection};case"close":return{mode:"idle"}}}function bt(){const e=ze.c(126),{org:n}=Ze(),r=Fe();let L;e[0]===Symbol.for("react.memo_cache_sentinel")?(L={strict:!1},e[0]=L):L=e[0];const Ee=Ke(L),{data:ge}=Be.useSession();let U;e[1]!==n.slug?(U={namespace:n.slug,resource:"connections"},e[1]=n.slug,e[2]=U):U=e[2];const o=Ye(U),d=Je(),K=Qe(o);let W;e[3]===Symbol.for("react.memo_cache_sentinel")?(W={mode:"idle"},e[3]=W):W=e[3];const[c,u]=Me.useReducer(vt,W),q=Ee.action==="create";let G;e[4]!==r||e[5]!==n.slug?(G=()=>{r({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},e[4]=r,e[5]=n.slug,e[6]=G):G=e[6];const xe=G;let J;e[7]!==r||e[8]!==n.slug?(J=()=>{r({to:"/$org/mcps",params:{org:n.slug},search:{}})},e[7]=r,e[8]=n.slug,e[9]=J):J=e[9];const p=J;let Q;e[10]===Symbol.for("react.memo_cache_sentinel")?(Q={resolver:He(yt),defaultValues:{title:"",description:null,connection_type:"HTTP",connection_url:"",connection_token:null}},e[10]=Q):Q=e[10];const i=Oe(Q),l=c.mode==="editing"?c.connection:null;let X,Y;e[11]!==l||e[12]!==i?(X=()=>{l?i.reset({title:l.title,description:l.description,connection_type:l.connection_type,connection_url:l.connection_url,connection_token:null}):i.reset({title:"",description:null,connection_type:"HTTP",connection_url:"",connection_token:null})},Y=[l,i],e[11]=l,e[12]=i,e[13]=X,e[14]=Y):(X=e[13],Y=e[14]),Me.useEffect(X,Y);let Z;e[15]!==d||e[16]!==c.connection||e[17]!==c.mode?(Z=async()=>{if(c.mode!=="deleting")return;const s=c.connection.id;u({type:"close"});try{await d.delete.mutateAsync(s)}catch{}},e[15]=d,e[16]=c.connection,e[17]=c.mode,e[18]=Z):Z=e[18];const je=Z;let ee;e[19]!==d||e[20]!==p||e[21]!==l||e[22]!==i||e[23]!==r||e[24]!==n.id||e[25]!==n.slug||e[26]!==ge?.user?.id?(ee=async s=>{if(l){await d.update.mutateAsync({id:l.id,data:{title:s.title,description:s.description||null,connection_type:s.connection_type,connection_url:s.connection_url,...s.connection_token&&{connection_token:s.connection_token}}}),u({type:"close"}),i.reset();return}const a=St("conn");await d.create.mutateAsync({id:a,title:s.title,description:s.description||null,connection_type:s.connection_type,connection_url:s.connection_url,connection_token:s.connection_token||null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:ge?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:null,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),p(),i.reset(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:a}})},e[19]=d,e[20]=p,e[21]=l,e[22]=i,e[23]=r,e[24]=n.id,e[25]=n.slug,e[26]=ge?.user?.id,e[27]=ee):ee=e[27];const Ce=ee;let te;e[28]!==p||e[29]!==i||e[30]!==q?(te=s=>{s||(q?p():u({type:"close"}),i.reset())},e[28]=p,e[29]=i,e[30]=q,e[31]=te):te=e[31];const h=te;let ne,oe,se,ie,re,le;e[32]===Symbol.for("react.memo_cache_sentinel")?(ne={id:"icon",header:"",render:Bt,cellClassName:"w-16 shrink-0",wrap:!0},oe={id:"title",header:"Name",render:Kt,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},se={id:"description",header:"Description",render:Ft,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},ie={id:"connection_type",header:"Type",accessor:Et,cellClassName:"w-24 shrink-0",sortable:!0},re={id:"connection_url",header:"URL",render:zt,wrap:!0,cellClassName:"w-48 min-w-0 shrink-0"},le={id:"status",header:"Status",render:$t,cellClassName:"w-24 shrink-0",sortable:!0},e[32]=ne,e[33]=oe,e[34]=se,e[35]=ie,e[36]=re,e[37]=le):(ne=e[32],oe=e[33],se=e[34],ie=e[35],re=e[36],le=e[37]);let ce;e[38]!==r||e[39]!==n.slug?(ce=[ne,oe,se,ie,re,le,{id:"actions",header:"",render:s=>t.jsxs(Te,{children:[t.jsx(Ae,{asChild:!0,children:t.jsx(F,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:At,children:t.jsx(m,{name:"more_vert",size:20})})}),t.jsxs($e,{align:"end",onClick:Tt,children:[t.jsxs(fe,{onClick:a=>{a.stopPropagation(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}})},children:[t.jsx(m,{name:"visibility",size:16}),"Inspect"]}),t.jsxs(fe,{variant:"destructive",onClick:a=>{a.stopPropagation(),u({type:"delete",connection:s})},children:[t.jsx(m,{name:"delete",size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[38]=r,e[39]=n.slug,e[40]=ce):ce=e[40];const _e=ce;let f;e[41]!==r||e[42]!==n.slug?(f=t.jsx(F,{variant:"outline",onClick:()=>r({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e[41]=r,e[42]=n.slug,e[43]=f):f=e[43];let g;e[44]!==xe?(g=t.jsx(F,{onClick:xe,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Connect MCP Server"}),e[44]=xe,e[45]=g):g=e[45];let ae;e[46]!==f||e[47]!==g?(ae=t.jsxs("div",{className:"flex items-center gap-2",children:[f,g]}),e[46]=f,e[47]=g,e[48]=ae):ae=e[48];const Se=ae,ye=q||c.mode==="editing",ve=l?"Edit Connection":"Create New Connection";let x;e[49]!==ve?(x=t.jsx(at,{children:ve}),e[49]=ve,e[50]=x):x=e[50];const be=l?"Update the connection details below.":"Add a new connection to your organization. Fill in the details below.";let j;e[51]!==be?(j=t.jsx(dt,{children:be}),e[51]=be,e[52]=j):j=e[52];let C;e[53]!==x||e[54]!==j?(C=t.jsxs(mt,{children:[x,j]}),e[53]=x,e[54]=j,e[55]=C):C=e[55];let _;e[56]!==i||e[57]!==Ce?(_=i.handleSubmit(Ce),e[56]=i,e[57]=Ce,e[58]=_):_=e[58];let S;e[59]!==i.control?(S=t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsx(B,{control:i.control,name:"title",render:Pt}),t.jsx(B,{control:i.control,name:"description",render:Mt}),t.jsx(B,{control:i.control,name:"connection_type",render:It}),t.jsx(B,{control:i.control,name:"connection_url",render:Nt}),t.jsx(B,{control:i.control,name:"connection_token",render:kt})]}),e[59]=i.control,e[60]=S):S=e[60];let y;e[61]!==h?(y=t.jsx(F,{type:"button",variant:"outline",onClick:()=>h(!1),children:"Cancel"}),e[61]=h,e[62]=y):y=e[62];const we=i.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection";let v;e[63]!==i.formState.isSubmitting||e[64]!==we?(v=t.jsx(F,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:we}),e[63]=i.formState.isSubmitting,e[64]=we,e[65]=v):v=e[65];let b;e[66]!==y||e[67]!==v?(b=t.jsxs(ut,{children:[y,v]}),e[66]=y,e[67]=v,e[68]=b):b=e[68];let w;e[69]!==_||e[70]!==S||e[71]!==b?(w=t.jsxs("form",{onSubmit:_,children:[S,b]}),e[69]=_,e[70]=S,e[71]=b,e[72]=w):w=e[72];let D;e[73]!==i||e[74]!==w?(D=t.jsx(ft,{...i,children:w}),e[73]=i,e[74]=w,e[75]=D):D=e[75];let k;e[76]!==C||e[77]!==D?(k=t.jsxs(pt,{className:"sm:max-w-[525px]",children:[C,D]}),e[76]=C,e[77]=D,e[78]=k):k=e[78];let N;e[79]!==h||e[80]!==ye||e[81]!==k?(N=t.jsx(ht,{open:ye,onOpenChange:h,children:k}),e[79]=h,e[80]=ye,e[81]=k,e[82]=N):N=e[82];const De=c.mode==="deleting";let de;e[83]===Symbol.for("react.memo_cache_sentinel")?(de=s=>!s&&u({type:"close"}),e[83]=de):de=e[83];let me;e[84]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(et,{children:"Delete Connection?"}),e[84]=me):me=e[84];const ke=c.mode==="deleting"&&c.connection.title;let I;e[85]!==ke?(I=t.jsxs(tt,{children:[me,t.jsxs(nt,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:ke}),"."]})]}),e[85]=ke,e[86]=I):I=e[86];let ue;e[87]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx(ot,{children:"Cancel"}),e[87]=ue):ue=e[87];let M;e[88]!==je?(M=t.jsxs(st,{children:[ue,t.jsx(it,{onClick:je,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[88]=je,e[89]=M):M=e[89];let P;e[90]!==I||e[91]!==M?(P=t.jsxs(rt,{children:[I,M]}),e[90]=I,e[91]=M,e[92]=P):P=e[92];let T;e[93]!==De||e[94]!==P?(T=t.jsx(lt,{open:De,onOpenChange:de,children:P}),e[93]=De,e[94]=P,e[95]=T):T=e[95];let pe;e[96]===Symbol.for("react.memo_cache_sentinel")?(pe=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],e[96]=pe):pe=e[96];let A;e[97]!==Se||e[98]!==o.handleSort||e[99]!==o.setViewMode||e[100]!==o.sortDirection||e[101]!==o.sortKey||e[102]!==o.viewMode?(A=t.jsx(Ve,{title:"MCP Servers",viewMode:o.viewMode,onViewModeChange:o.setViewMode,sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,sortOptions:pe,ctaButton:Se}),e[97]=Se,e[98]=o.handleSort,e[99]=o.setViewMode,e[100]=o.sortDirection,e[101]=o.sortKey,e[102]=o.viewMode,e[103]=A):A=e[103];let $;e[104]!==o?($=s=>{s.key==="Escape"&&(o.setSearch(""),s.target.blur())},e[104]=o,e[105]=$):$=e[105];let z;e[106]!==o.search||e[107]!==o.setSearch||e[108]!==$?(z=t.jsx(Ue,{value:o.search,onChange:o.setSearch,placeholder:"Search for an MCP Server...",onKeyDown:$}),e[106]=o.search,e[107]=o.setSearch,e[108]=$,e[109]=z):z=e[109];let E;e[110]!==_e||e[111]!==K||e[112]!==o.handleSort||e[113]!==o.search||e[114]!==o.sortDirection||e[115]!==o.sortKey||e[116]!==o.viewMode||e[117]!==r||e[118]!==n.slug?(E=o.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:K.length===0?t.jsx(Ne,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:(o.search,"No MCP Servers found"),description:o.search?`No MCP Servers match "${o.search}"`:"Create a connection to get started."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:K.map(s=>t.jsx(qe,{connection:s,fallbackIcon:"extension",onClick:()=>r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}}),headerActions:t.jsxs(Te,{children:[t.jsx(Ae,{asChild:!0,children:t.jsx(F,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Dt,children:t.jsx(m,{name:"more_vert",size:20})})}),t.jsxs($e,{align:"end",onClick:wt,children:[t.jsxs(fe,{onClick:a=>{a.stopPropagation(),r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}})},children:[t.jsx(m,{name:"visibility",size:16}),"Inspect"]}),t.jsxs(fe,{variant:"destructive",onClick:a=>{a.stopPropagation(),u({type:"delete",connection:s})},children:[t.jsx(m,{name:"delete",size:16}),"Delete"]})]})]})},s.id))})}):t.jsx(We,{columns:_e,data:K,isLoading:!1,sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.handleSort,onRowClick:s=>r({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:s.id}}),emptyState:o.search?t.jsx(Ne,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:`No MCP Servers match "${o.search}"`}):t.jsx(Ne,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:"Create a connection to get started."})}),e[110]=_e,e[111]=K,e[112]=o.handleSort,e[113]=o.search,e[114]=o.sortDirection,e[115]=o.sortKey,e[116]=o.viewMode,e[117]=r,e[118]=n.slug,e[119]=E):E=e[119];let he;return e[120]!==N||e[121]!==T||e[122]!==A||e[123]!==z||e[124]!==E?(he=t.jsxs(Le,{children:[N,T,A,z,E]}),e[120]=N,e[121]=T,e[122]=A,e[123]=z,e[124]=E,e[125]=he):he=e[125],he}function wt(e){return e.stopPropagation()}function Dt(e){return e.stopPropagation()}function kt(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"Token (optional)"}),t.jsx(R,{children:t.jsx(Pe,{type:"password",placeholder:"Bearer token or API key",...n,value:n.value??""})}),t.jsx(V,{})]})}function Nt(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"URL *"}),t.jsx(R,{children:t.jsx(Pe,{placeholder:"https://example.com/mcp",...n})}),t.jsx(V,{})]})}function It(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"Type *"}),t.jsxs(gt,{value:n.value,onValueChange:n.onChange,children:[t.jsx(R,{children:t.jsx(xt,{children:t.jsx(jt,{})})}),t.jsxs(Ct,{children:[t.jsx(Ie,{value:"HTTP",children:"HTTP"}),t.jsx(Ie,{value:"SSE",children:"SSE"}),t.jsx(Ie,{value:"Websocket",children:"Websocket"})]})]}),t.jsx(V,{})]})}function Mt(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"Description"}),t.jsx(R,{children:t.jsx(_t,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),t.jsx(V,{})]})}function Pt(e){const{field:n}=e;return t.jsxs(H,{children:[t.jsx(O,{children:"Name *"}),t.jsx(R,{children:t.jsx(Pe,{placeholder:"My Connection",...n})}),t.jsx(V,{})]})}function Tt(e){return e.stopPropagation()}function At(e){return e.stopPropagation()}function $t(e){return t.jsx(ct,{variant:e.status==="active"?"success":"outline",children:e.status})}function zt(e){return t.jsx("span",{className:"text-sm text-muted-foreground block truncate",children:e.connection_url})}function Et(e){return t.jsx("span",{className:"text-sm font-medium",children:e.connection_type})}function Ft(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Kt(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Bt(e){return t.jsx(Xe,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:"extension"})}function hn(){const e=ze.c(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Ge,{children:t.jsx(Me.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(m,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(bt,{})})}),e[0]=n):n=e[0],n}export{hn as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aw as te,b0 as Ae}from"./index-
|
|
1
|
+
import{aw as te,b0 as Ae}from"./index-HoRNE_Oj.js";function fn(){return fn=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},fn.apply(null,arguments)}function bt(e,n){if(e==null)return{};var a={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(n.indexOf(t)!==-1)continue;a[t]=e[t]}return a}function wt(e,n){if(e==null)return{};var a,t,c=bt(e,n);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(e);for(t=0;t<d.length;t++)a=d[t],n.indexOf(a)===-1&&{}.propertyIsEnumerable.call(e,a)&&(c[a]=e[a])}return c}function dn(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,t=Array(n);a<n;a++)t[a]=e[a];return t}function xt(e){if(Array.isArray(e))return dn(e)}function St(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kt(e,n){if(e){if(typeof e=="string")return dn(e,n);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?dn(e,n):void 0}}function At(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pn(e){return xt(e)||St(e)||kt(e)||At()}function me(e){"@babel/helpers - typeof";return me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},me(e)}function Ct(e,n){if(me(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var t=a.call(e,n);if(me(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Ft(e){var n=Ct(e,"string");return me(n)=="symbol"?n:n+""}function it(e,n,a){return(n=Ft(n))in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function Sn(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),a.push.apply(a,t)}return a}function pe(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?Sn(Object(a),!0).forEach(function(t){it(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Sn(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function Lt(e){var n=e.length;if(n===0||n===1)return e;if(n===2)return[e[0],e[1],"".concat(e[0],".").concat(e[1]),"".concat(e[1],".").concat(e[0])];if(n===3)return[e[0],e[1],e[2],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0])];if(n>=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]}var Ee={};function Nt(e){if(e.length===0||e.length===1)return e;var n=e.join(".");return Ee[n]||(Ee[n]=Lt(e)),Ee[n]}function Ot(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0,t=e.filter(function(d){return d!=="token"}),c=Nt(t);return c.reduce(function(d,g){return pe(pe({},d),a[g])},n)}function kn(e){return e.join(" ")}function Tt(e,n){var a=0;return function(t){return a+=1,t.map(function(c,d){return lt({node:c,stylesheet:e,useInlineStyles:n,key:"code-segment-".concat(a,"-").concat(d)})})}}function lt(e){var n=e.node,a=e.stylesheet,t=e.style,c=t===void 0?{}:t,d=e.useInlineStyles,g=e.key,o=n.properties,h=n.type,k=n.tagName,A=n.value;if(h==="text")return A;if(k){var m=Tt(a,d),b;if(!d)b=pe(pe({},o),{},{className:kn(o.className)});else{var y=Object.keys(a).reduce(function(F,l){return l.split(".").forEach(function(i){F.includes(i)||F.push(i)}),F},[]),w=o.className&&o.className.includes("token")?["token"]:[],x=o.className&&w.concat(o.className.filter(function(F){return!y.includes(F)}));b=pe(pe({},o),{},{className:kn(x)||void 0,style:Ot(o.className,Object.assign({},o.style,c),a)})}var S=m(n.children);return te.createElement(k,fn({key:g},b),S)}}const Et=(function(e,n){var a=e.listLanguages();return a.indexOf(n)!==-1});var qt=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function An(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),a.push.apply(a,t)}return a}function ae(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?An(Object(a),!0).forEach(function(t){it(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):An(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}var jt=/\n/g;function $t(e){return e.match(jt)}function It(e){var n=e.lines,a=e.startingLineNumber,t=e.style;return n.map(function(c,d){var g=d+a;return te.createElement("span",{key:"line-".concat(d),className:"react-syntax-highlighter-line-number",style:typeof t=="function"?t(g):t},"".concat(g,`
|
|
3
3
|
`))})}function Pt(e){var n=e.codeString,a=e.codeStyle,t=e.containerStyle,c=t===void 0?{float:"left",paddingRight:"10px"}:t,d=e.numberStyle,g=d===void 0?{}:d,o=e.startingLineNumber;return te.createElement("code",{style:Object.assign({},a,c)},It({lines:n.replace(/\n$/,"").split(`
|
|
4
4
|
`),style:g,startingLineNumber:o}))}function Rt(e){return"".concat(e.toString().length,".25em")}function ct(e,n){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:n},children:[{type:"text",value:e}]}}function st(e,n,a){var t={display:"inline-block",minWidth:Rt(a),paddingRight:"1em",textAlign:"right",userSelect:"none"},c=typeof e=="function"?e(n):e,d=ae(ae({},t),c);return d}function ke(e){var n=e.children,a=e.lineNumber,t=e.lineNumberStyle,c=e.largestLineNumber,d=e.showInlineLineNumbers,g=e.lineProps,o=g===void 0?{}:g,h=e.className,k=h===void 0?[]:h,A=e.showLineNumbers,m=e.wrapLongLines,b=e.wrapLines,y=b===void 0?!1:b,w=y?ae({},typeof o=="function"?o(a):o):{};if(w.className=w.className?[].concat(pn(w.className.trim().split(/\s+/)),pn(k)):k,a&&d){var x=st(t,a,c);n.unshift(ct(a,x))}return m&A&&(w.style=ae({display:"flex"},w.style)),{type:"element",tagName:"span",properties:w,children:n}}function ut(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],t=0;t<e.length;t++){var c=e[t];if(c.type==="text")a.push(ke({children:[c],className:pn(new Set(n))}));else if(c.children){var d=n.concat(c.properties.className);ut(c.children,d).forEach(function(g){return a.push(g)})}}return a}function Dt(e,n,a,t,c,d,g,o,h){var k,A=ut(e.value),m=[],b=-1,y=0;function w(u,r){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return ke({children:u,lineNumber:r,lineNumberStyle:o,largestLineNumber:g,showInlineLineNumbers:c,lineProps:a,className:s,showLineNumbers:t,wrapLongLines:h,wrapLines:n})}function x(u,r){if(t&&r&&c){var s=st(o,r,g);u.unshift(ct(r,s))}return u}function S(u,r){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return n||s.length>0?w(u,r,s):x(u,r)}for(var F=function(){var r=A[y],s=r.children[0].value,v=$t(s);if(v){var f=s.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ap as D,aq as O,c as _,a5 as N,ar as E,as as T,j as r,a as I}from"./index-
|
|
1
|
+
import{ap as D,aq as O,c as _,a5 as N,ar as E,as as T,j as r,a as I}from"./index-HoRNE_Oj.js";import{A as M,a as L,b as R,c as $,d as q,e as B,f as V}from"./alert-dialog-Bj3sxji2.js";import{u as k,B as H}from"./button-8a8UdvyR.js";import{F as U,a as G,b as J,c as K,d as P,e as Q,f as W}from"./form-DU90-O_I.js";import{I as X}from"./input-GtBoan0u.js";import{S as Y}from"./spinner-Uc4IX4M6.js";function A(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Z=D({name:O().min(2,"Organization name is required")});function ne(n){const e=_.c(42),{open:o,onOpenChange:l}=n,y=N();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={resolver:E(Z),defaultValues:{name:""}},e[0]=b):b=e[0];const t=T(b);let z;e[1]!==y?(z={mutationFn:ee,onSuccess:i=>{const{orgSlug:s}=i;y({to:"/$org",params:{org:s}})}},e[1]=y,e[2]=z):z=e[2];const a=k(z),F=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C=r.jsxs(R,{children:[r.jsx($,{children:"Create a new organization"}),r.jsx(q,{children:"Set up a new organization to collaborate with others."})]}),e[3]=C):C=e[3];let m;if(e[4]!==a||e[5]!==t){let i;e[7]!==a?(i=s=>a.mutateAsync(s),e[7]=a,e[8]=i):i=e[8],m=t.handleSubmit(i),e[4]=a,e[5]=t,e[6]=m}else m=e[6];let c;e[9]!==t.formState.isSubmitting?(c=i=>{const{field:s}=i;return r.jsxs(J,{children:[r.jsx(K,{children:"Organization Name"}),r.jsx(P,{children:r.jsx(X,{...s,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(Q,{children:"The name of your company or organization"}),s.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",A(s.value)]})]}),r.jsx(W,{})]})},e[9]=t.formState.isSubmitting,e[10]=c):c=e[10];let g;e[11]!==t.control||e[12]!==c?(g=r.jsx(U,{control:t.control,name:"name",render:c}),e[11]=t.control,e[12]=c,e[13]=g):g=e[13];let f;e[14]!==F?(f=F&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:F}),e[14]=F,e[15]=f):f=e[15];let u;e[16]!==a||e[17]!==t?(u=()=>{a.reset(),t.reset()},e[16]=a,e[17]=t,e[18]=u):u=e[18];let d;e[19]!==t.formState.isSubmitting||e[20]!==u?(d=r.jsx(M,{disabled:t.formState.isSubmitting,onClick:u,children:"Cancel"}),e[19]=t.formState.isSubmitting,e[20]=u,e[21]=d):d=e[21];const v=!t.formState.isValid||t.formState.isSubmitting;let p;e[22]!==t.formState.isSubmitting?(p=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Y,{size:"xs"})," Creating..."]}):"Create Organization",e[22]=t.formState.isSubmitting,e[23]=p):p=e[23];let S;e[24]!==v||e[25]!==p?(S=r.jsx(H,{type:"submit",variant:"default",disabled:v,children:p}),e[24]=v,e[25]=p,e[26]=S):S=e[26];let x;e[27]!==S||e[28]!==d?(x=r.jsxs(B,{children:[d,S]}),e[27]=S,e[28]=d,e[29]=x):x=e[29];let h;e[30]!==x||e[31]!==m||e[32]!==g||e[33]!==f?(h=r.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[g,f,x]}),e[30]=x,e[31]=m,e[32]=g,e[33]=f,e[34]=h):h=e[34];let j;e[35]!==t||e[36]!==h?(j=r.jsxs(L,{children:[C,r.jsx(G,{...t,children:h})]}),e[35]=t,e[36]=h,e[37]=j):j=e[37];let w;return e[38]!==l||e[39]!==o||e[40]!==j?(w=r.jsx(V,{open:o,onOpenChange:l,children:j}),e[38]=l,e[39]=o,e[40]=j,e[41]=w):w=e[41],w}async function ee(n){const e=A(n.name);if(!e)throw new Error("Organization slug is invalid");const o=await I.organization.create({name:n.name,slug:e});if(o?.error)throw new Error(o.error.message||"Failed to create organization");const l=o?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}export{ne as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,j as i,a8 as m,aK as u,ab as g,a9 as x,ac as b,aa as j,ae as N,ad as h}from"./index-
|
|
1
|
+
import{c as n,j as i,a8 as m,aK as u,ab as g,a9 as x,ac as b,aa as j,ae as N,ad as h}from"./index-HoRNE_Oj.js";import{c}from"./utils-oBMoklwF.js";import{c as D}from"./tooltip-ocFCU6ZE.js";const v=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],y=D("x",v);function T(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function R(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function $(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function _(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-background/60 backdrop-blur-[0.5px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(N,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function k(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(y,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(h,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function B(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(_,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx(k,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs($,{"data-slot":"dialog-portal",children:[r,i.jsxs(g,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function S(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{E as D,y as X,P as a,S as b,B as c,T as d,R as e,O as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,j as i,bT as p,bU as f,bV as m,bW as g,bX as x,bY as b,bZ as v,b_ as w,b$ as h}from"./index-
|
|
1
|
+
import{c,j as i,bT as p,bU as f,bV as m,bW as g,bX as x,bY as b,bZ as v,b_ as w,b$ as h}from"./index-HoRNE_Oj.js";import{c as u}from"./utils-oBMoklwF.js";import{c as j}from"./tooltip-ocFCU6ZE.js";const N=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],z=j("chevron-right",N);function $(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function M(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function y(s){const e=c.c(10);let t,o,a;e[0]!==s?({className:t,sideOffset:a,...o}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a):(t=e[1],o=e[2],a=e[3]);const n=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==o||e[7]!==n||e[8]!==r?(d=i.jsx(m,{children:i.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function C(s){const e=c.c(12);let t,o,a,n;e[0]!==s?({className:t,inset:o,variant:n,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==d||e[10]!==r?(l=i.jsx(x,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:d,...a}),e[7]=o,e[8]=a,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function T(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}function R(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(b,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function k(s){const e=c.c(13);let t,o,a,n;e[0]!==s?({className:o,inset:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-xl px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(z,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==n||e[11]!==r?(l=i.jsxs(v,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...n,children:[t,d]}),e[8]=t,e[9]=a,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function I(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}export{z as C,M as D,y as a,$ as b,C as c,T as d,R as e,k as f,I as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,j as t}from"./index-
|
|
1
|
+
import{c as v,j as t}from"./index-HoRNE_Oj.js";import{c as N}from"./utils-oBMoklwF.js";function y(){const f=v.c(1);let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:218,height:190,"aria-hidden":"true"}),f[0]=e):e=f[0],e}function S(f){const e=v.c(24),{image:o,title:p,description:u,actions:x,className:h,descriptionClassName:j,actionsClassName:g}=f;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==o?(l=o!==null&&t.jsx("div",{className:"flex items-center justify-center",children:o??t.jsx(y,{})}),e[2]=o,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let r;e[11]!==i||e[12]!==a?(r=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=r):r=e[13];let n;e[14]!==x||e[15]!==g?(n=x&&t.jsx("div",{className:N("flex items-center gap-2",g),children:x}),e[14]=x,e[15]=g,e[16]=n):n=e[16];let m;e[17]!==r||e[18]!==n?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[r,n]}),e[17]=r,e[18]=n,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{S as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{be as s,r as a,j as e}from"./index-
|
|
1
|
+
import{be as s,r as a,j as e}from"./index-HoRNE_Oj.js";import{B as o}from"./button-8a8UdvyR.js";const n=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],l=s("triangle-alert",n);class h extends a.Component{state={hasError:!1,error:null};static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,t){console.error("Uncaught error:",r,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[e.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:e.jsx(l,{className:"h-6 w-6 text-destructive"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),e.jsx(o,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:"Try again"})]}):this.props.children}}export{h as E};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Z as o}from"./index-
|
|
1
|
+
import{Z as o}from"./index-HoRNE_Oj.js";import{B as F}from"./use-binding-BPQhbEIl.js";import{b as R,g as C}from"./registry-utils-ulDDT0d8.js";import{g as B}from"./generate-id-Dyweu44Y.js";const U=Symbol("Let zodToJsonSchema decide on which parser to use"),A={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},K=e=>typeof e=="string"?{...A,name:e}:{...A,...e},V=e=>{const t=K(e),a=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}};function T(e,t,a,n){n?.errorMessages&&a&&(e.errorMessage={...e.errorMessage,[t]:a})}function p(e,t,a,n,r){e[t]=a,T(e,t,n,r)}const N=(e,t)=>{let a=0;for(;a<e.length&&a<t.length&&e[a]===t[a];a++);return[(e.length-a).toString(),...t.slice(a)].join("/")};function d(e){if(e.target!=="openAi")return{};const t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?N(t,e.currentPath):t.join("/")}}function q(e,t){const a={type:"array"};return e.type?._def&&e.type?._def?.typeName!==o.ZodAny&&(a.items=l(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&p(a,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&p(a,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(p(a,"minItems",e.exactLength.value,e.exactLength.message,t),p(a,"maxItems",e.exactLength.value,e.exactLength.message,t)),a}function G(e,t){const a={type:"integer",format:"int64"};if(!e.checks)return a;for(const n of e.checks)switch(n.kind){case"min":t.target==="jsonSchema7"?n.inclusive?p(a,"minimum",n.value,n.message,t):p(a,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(a.exclusiveMinimum=!0),p(a,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?p(a,"maximum",n.value,n.message,t):p(a,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(a.exclusiveMaximum=!0),p(a,"maximum",n.value,n.message,t));break;case"multipleOf":p(a,"multipleOf",n.value,n.message,t);break}return a}function H(){return{type:"boolean"}}function j(e,t){return l(e.type._def,t)}const J=(e,t)=>l(e.innerType._def,t);function M(e,t,a){const n=a??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,i)=>M(e,t,r))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return W(e,t)}}const W=(e,t)=>{const a={type:"integer",format:"unix-time"};if(t.target==="openApi3")return a;for(const n of e.checks)switch(n.kind){case"min":p(a,"minimum",n.value,n.message,t);break;case"max":p(a,"maximum",n.value,n.message,t);break}return a};function Y(e,t){return{...l(e.innerType._def,t),default:e.defaultValue()}}function Q(e,t){return t.effectStrategy==="input"?l(e.schema._def,t):d(t)}function X(e){return{type:"string",enum:Array.from(e.values)}}const ee=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function te(e,t){const a=[l(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),l(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(i=>!!i);let n=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const r=[];return a.forEach(i=>{if(ee(i))r.push(...i.allOf),i.unevaluatedProperties===void 0&&(n=void 0);else{let s=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:c,...u}=i;s=u}else n=void 0;r.push(s)}}),r.length?{allOf:r,...n}:void 0}function ne(e,t){const a=typeof e.value;return a!=="bigint"&&a!=="number"&&a!=="boolean"&&a!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:a==="bigint"?"integer":a,enum:[e.value]}:{type:a==="bigint"?"integer":a,const:e.value}}let P;const g={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(P===void 0&&(P=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),P),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function D(e,t){const a={type:"string"};if(e.checks)for(const n of e.checks)switch(n.kind){case"min":p(a,"minLength",typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value,n.message,t);break;case"max":p(a,"maxLength",typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":y(a,"email",n.message,t);break;case"format:idn-email":y(a,"idn-email",n.message,t);break;case"pattern:zod":m(a,g.email,n.message,t);break}break;case"url":y(a,"uri",n.message,t);break;case"uuid":y(a,"uuid",n.message,t);break;case"regex":m(a,n.regex,n.message,t);break;case"cuid":m(a,g.cuid,n.message,t);break;case"cuid2":m(a,g.cuid2,n.message,t);break;case"startsWith":m(a,RegExp(`^${_(n.value,t)}`),n.message,t);break;case"endsWith":m(a,RegExp(`${_(n.value,t)}$`),n.message,t);break;case"datetime":y(a,"date-time",n.message,t);break;case"date":y(a,"date",n.message,t);break;case"time":y(a,"time",n.message,t);break;case"duration":y(a,"duration",n.message,t);break;case"length":p(a,"minLength",typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value,n.message,t),p(a,"maxLength",typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value,n.message,t);break;case"includes":{m(a,RegExp(_(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&y(a,"ipv4",n.message,t),n.version!=="v4"&&y(a,"ipv6",n.message,t);break}case"base64url":m(a,g.base64url,n.message,t);break;case"jwt":m(a,g.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&m(a,g.ipv4Cidr,n.message,t),n.version!=="v4"&&m(a,g.ipv6Cidr,n.message,t);break}case"emoji":m(a,g.emoji(),n.message,t);break;case"ulid":{m(a,g.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{y(a,"binary",n.message,t);break}case"contentEncoding:base64":{p(a,"contentEncoding","base64",n.message,t);break}case"pattern:zod":{m(a,g.base64,n.message,t);break}}break}case"nanoid":m(a,g.nanoid,n.message,t)}return a}function _(e,t){return t.patternStrategy==="escape"?re(e):e}const ae=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function re(e){let t="";for(let a=0;a<e.length;a++)ae.has(e[a])||(t+="\\"),t+=e[a];return t}function y(e,t,a,n){e.format||e.anyOf?.some(r=>r.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&n.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...a&&n.errorMessages&&{errorMessage:{format:a}}})):p(e,"format",t,a,n)}function m(e,t,a,n){e.pattern||e.allOf?.some(r=>r.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&n.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:k(t,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):p(e,"pattern",k(t,n),a,n)}function k(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;const a={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},n=a.i?e.source.toLowerCase():e.source;let r="",i=!1,s=!1,c=!1;for(let u=0;u<n.length;u++){if(i){r+=n[u],i=!1;continue}if(a.i){if(s){if(n[u].match(/[a-z]/)){c?(r+=n[u],r+=`${n[u-2]}-${n[u]}`.toUpperCase(),c=!1):n[u+1]==="-"&&n[u+2]?.match(/[a-z]/)?(r+=n[u],c=!0):r+=`${n[u]}${n[u].toUpperCase()}`;continue}}else if(n[u].match(/[a-z]/)){r+=`[${n[u]}${n[u].toUpperCase()}]`;continue}}if(a.m){if(n[u]==="^"){r+=`(^|(?<=[\r
|
|
2
2
|
]))`;continue}else if(n[u]==="$"){r+=`($|(?=[\r
|
|
3
3
|
]))`;continue}}if(a.s&&n[u]==="."){r+=s?`${n[u]}\r
|
|
4
4
|
`:`[${n[u]}\r
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d,j as c,bx as $,c0 as j,c1 as C,r as f,ag as v,c2 as N,c3 as h}from"./index-
|
|
1
|
+
import{c as d,j as c,bx as $,c0 as j,c1 as C,r as f,ag as v,c2 as N,c3 as h}from"./index-HoRNE_Oj.js";import{c as u}from"./utils-oBMoklwF.js";function S(t){const e=d.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let l;e[3]!==s?(l=u("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r=c.jsx($,{"data-slot":"label",className:l,...o}),e[5]=o,e[6]=l,e[7]=r):r=e[7],r}const D=j,I=f.createContext({}),E=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let l;e[4]!==s?(l=c.jsx(C,{...s}),e[4]=s,e[5]=l):l=e[5];let r;return e[6]!==o||e[7]!==l?(r=c.jsx(I.Provider,{value:o,children:l}),e[6]=o,e[7]=l,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(I),s=f.useContext(b),{getFieldState:o}=N();let l;t[0]!==e.name?(l={name:e.name},t[0]=e.name,t[1]=l):l=t[1];const r=h(l);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const n=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,g=`${i}-form-item-message`;let p;return t[6]!==e.name||t[7]!==n||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==g?(p={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:g,...n},t[6]=e.name,t[7]=n,t[8]=i,t[9]=m,t[10]=F,t[11]=g,t[12]=p):p=t[12],p},b=f.createContext({});function M(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const l=f.useId();let r;e[3]!==l?(r={id:l},e[3]=l,e[4]=r):r=e[4];let a;e[5]!==s?(a=u("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let n;e[7]!==o||e[8]!==a?(n=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=n):n=e[9];let i;return e[10]!==r||e[11]!==n?(i=c.jsx(b.Provider,{value:r,children:n}),e[10]=r,e[11]=n,e[12]=i):i=e[12],i}function P(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formItemId:r}=x(),a=!!l;let n;e[3]!==s?(n=u("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==n?(i=c.jsx(S,{"data-slot":"form-label","data-error":a,className:n,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=n,e[9]=i):i=e[9],i}function R(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:l,formDescriptionId:r,formMessageId:a}=x(),n=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==l||e[3]!==s||e[4]!==n||e[5]!==i?(m=c.jsx(v,{"data-slot":"form-control",id:l,"aria-describedby":n,"aria-invalid":i,...s}),e[2]=l,e[3]=s,e[4]=n,e[5]=i,e[6]=m):m=e[6],m}function L(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:l}=x();let r;e[3]!==s?(r=u("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:l,className:r,...o}),e[5]=l,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function k(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formMessageId:r}=x(),a=l?String(l?.message??""):o.children;if(!a)return null;let n;e[3]!==s?(n=u("text-destructive text-sm",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==n?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:n,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=n,e[9]=i):i=e[9],i}export{E as F,D as a,M as b,P as c,R as d,L as e,k as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as R,j as t,r as O,a5 as ye,d as _e,ap as be,bB as ne,aq as ie,bd as ve,ar as we,as as Ce,a6 as re}from"./index-WOQ13cP6.js";import{E as Ne}from"./empty-state-jtBjSgAJ.js";import{E as ce}from"./error-boundary-BjLQDRan.js";import{b as Se,I as Te}from"./use-connection-B5VryFm7.js";import{T as ke}from"./tool-set-selector-M0YnbcFP.js";import{b as Ie,a as $e}from"./use-gateway-Bcl96GTS.js";import{B as q}from"./button-DpN85Po0.js";import{I as B}from"./icon-CBAJ1FOz.js";import{I as de}from"./input-DRMFvIcp.js";import{S as Ee}from"./switch-P43q-fGo.js";import{F as M,a as Fe,b as Y,d as Z,f as ee,c as me}from"./form-C-tSv2Q6.js";import{c as fe,a as ue,S as xe,b as he,d as W}from"./select-DzEOHgSq.js";import{d as H,b as K,a as Q,T as X}from"./tooltip-D5O925Gp.js";import{s as Ge}from"./slugify-CEUa2lfQ.js";import{V as Ae,b as Ve}from"./layout-C7PMXMWr.js";import{f as ze}from"./formatDistanceToNow-Ctx6mZEP.js";import"./utils-E9aiNDpO.js";import"./checkbox-DWHTP51a.js";import"./collection-search-CrkK01Ci.js";function De(o){const s=new TextEncoder().encode(o),l=Array.from(s,a=>String.fromCharCode(a)).join("");return btoa(l)}function Pe(o){const e=R.c(52),{serverName:s,gatewayUrl:l}=o,[a,c]=O.useState(!1),[i,m]=O.useState(null),n=Ge(s);let r,d,p,g;if(e[0]!==l||e[1]!==n){const se={type:"http",url:l},oe={[n]:se};r=JSON.stringify(oe,null,2);const ae=je=>JSON.stringify({...se,headers:{"x-mesh-client":je}},null,2),pe=De(ae("Cursor"));d=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(n)}&config=${encodeURIComponent(pe)}`;const ge=ae("Claude Code");p=n;let le;e[6]===Symbol.for("react.memo_cache_sentinel")?(le=/'/g,e[6]=le):le=e[6],g=ge.replace(le,"'\\''"),e[0]=l,e[1]=n,e[2]=r,e[3]=d,e[4]=p,e[5]=g}else r=e[2],d=e[3],p=e[4],g=e[5];const C=`claude mcp add "${p}" --config '${g}'`;let u;e[7]!==r?(u=async()=>{await navigator.clipboard.writeText(r),c(!0),re.success("Configuration copied to clipboard"),setTimeout(()=>c(!1),2e3)},e[7]=r,e[8]=u):u=e[8];const x=u;let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=async(se,oe)=>{await navigator.clipboard.writeText(se),m(oe),re.success(`${oe} command copied`),setTimeout(()=>m(null),2e3)},e[9]=h):h=e[9];const J=h,L=Be;let V;e[10]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[10]=V):V=e[10];const w=a?"check":"content_copy";let P;e[11]!==w?(P=t.jsx(B,{name:w,size:14}),e[11]=w,e[12]=P):P=e[12];let F;e[13]!==x||e[14]!==P?(F=t.jsx(Q,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:x,children:P})}),e[13]=x,e[14]=P,e[15]=F):F=e[15];let z;e[16]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(X,{children:"Copy configuration"}),e[16]=z):z=e[16];let G;e[17]!==F?(G=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(H,{children:t.jsxs(K,{children:[F,z]})})}),e[17]=F,e[18]=G):G=e[18];let j;e[19]!==r||e[20]!==x?(j=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:x,children:r}),e[19]=r,e[20]=x,e[21]=j):j=e[21];let y;e[22]!==G||e[23]!==j?(y=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[G,j]}),e[22]=G,e[23]=j,e[24]=y):y=e[24];let _;e[25]!==d?(_=()=>L(d),e[25]=d,e[26]=_):_=e[26];let N,S;e[27]===Symbol.for("react.memo_cache_sentinel")?(N=t.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%)"}}),S=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=N,e[28]=S):(N=e[27],S=e[28]);let A;e[29]!==_?(A=t.jsx(Q,{asChild:!0,children:t.jsxs(q,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:_,children:[N,S]})}),e[29]=_,e[30]=A):A=e[30];let T;e[31]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(X,{children:"Add to Cursor"}),e[31]=T):T=e[31];let k;e[32]!==A?(k=t.jsx(H,{children:t.jsxs(K,{children:[A,T]})}),e[32]=A,e[33]=k):k=e[33];let b;e[34]!==C?(b=()=>J(C,"Claude"),e[34]=C,e[35]=b):b=e[35];let I,$;e[36]===Symbol.for("react.memo_cache_sentinel")?(I=t.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%)"}}),$=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=I,e[37]=$):(I=e[36],$=e[37]);let v;e[38]!==i?(v=i==="Claude"&&t.jsx(B,{name:"check",size:14,className:"ml-2 text-green-500"}),e[38]=i,e[39]=v):v=e[39];let E;e[40]!==b||e[41]!==v?(E=t.jsx(Q,{asChild:!0,children:t.jsxs(q,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:b,children:[I,$,v]})}),e[40]=b,e[41]=v,e[42]=E):E=e[42];let f;e[43]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(X,{children:"Add to Claude Code"}),e[43]=f):f=e[43];let D;e[44]!==E?(D=t.jsx(H,{children:t.jsxs(K,{children:[E,f]})}),e[44]=E,e[45]=D):D=e[45];let U;e[46]!==k||e[47]!==D?(U=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[k,D]}),e[46]=k,e[47]=D,e[48]=U):U=e[48];let te;return e[49]!==y||e[50]!==U?(te=t.jsxs("div",{className:"flex flex-col gap-4",children:[V,y,U]}),e[49]=y,e[50]=U,e[51]=te):te=e[51],te}function Be(o){window.open(o,"_blank")}const Ue=be({title:ie().min(1,"Name is required").max(255),description:ie().nullable(),status:ne(["active","inactive"]),tool_selection_mode:ne(["inclusion","exclusion"]),tool_selection_strategy:ne(["passthrough","smart_tool_selection","code_execution"])});function Oe(o,e){const s={};for(const l of o.connections)if(l.selected_tools===null){const a=e.get(l.connection_id)??[];a.length>0&&(s[l.connection_id]=a)}else l.selected_tools.length>0&&(s[l.connection_id]=l.selected_tools);return s}function Re(o,e){return Object.entries(o).map(([s,l])=>{const a=e.get(s)??[],c=a.length>0&&a.every(i=>l.includes(i));return{connection_id:s,selected_tools:c?null:l}})}function Je(o){const e=R.c(28),{form:s,toolSet:l,onToolSetChange:a,icon:c}=o;let i;e[0]!==s?(i=s.watch("title")||"Gateway",e[0]=s,e[1]=i):i=e[1];let m;e[2]!==c||e[3]!==i?(m=t.jsx(Te,{icon:c,name:i,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:"network_node"}),e[2]=c,e[3]=i,e[4]=m):m=e[4];let n;e[5]!==s.control?(n=t.jsx(M,{control:s.control,name:"status",render:He}),e[5]=s.control,e[6]=n):n=e[6];let r;e[7]!==m||e[8]!==n?(r=t.jsxs("div",{className:"flex items-start justify-between",children:[m,n]}),e[7]=m,e[8]=n,e[9]=r):r=e[9];let d;e[10]!==s.control?(d=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(M,{control:s.control,name:"title",render:We}),t.jsx(M,{control:s.control,name:"description",render:qe})]}),e[10]=s.control,e[11]=d):d=e[11];let p;e[12]!==r||e[13]!==d?(p=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[r,d]}),e[12]=r,e[13]=d,e[14]=p):p=e[14];let g;e[15]!==s.control?(g=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(M,{control:s.control,name:"tool_selection_mode",render:Me}),t.jsx(M,{control:s.control,name:"tool_selection_strategy",render:Le})]}),e[15]=s.control,e[16]=g):g=e[16];let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("div",{className:"flex-1 flex items-center justify-center p-5",children:t.jsx(B,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),e[17]=C):C=e[17];let u;e[18]!==a||e[19]!==l?(u=t.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:t.jsx(ce,{children:t.jsx(O.Suspense,{fallback:C,children:t.jsx(ke,{toolSet:l,onToolSetChange:a})})})}),e[18]=a,e[19]=l,e[20]=u):u=e[20];let x;e[21]!==p||e[22]!==g||e[23]!==u?(x=t.jsxs("div",{className:"flex flex-col h-full",children:[p,g,u]}),e[21]=p,e[22]=g,e[23]=u,e[24]=x):x=e[24];let h;return e[25]!==s||e[26]!==x?(h=t.jsx(Fe,{...s,children:x}),e[25]=s,e[26]=x,e[27]=h):h=e[27],h}function Le(o){const{field:e}=o;return t.jsxs(Y,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(me,{className:"mb-0",children:"Gateway Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(H,{children:t.jsxs(K,{children:[t.jsx(Q,{asChild:!0,children:t.jsx("button",{type:"button",className:"cursor-help flex items-center",children:t.jsx(B,{name:"info",size:14,className:"text-muted-foreground"})})}),t.jsx(X,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Passthrough:"})," Pass tools through as-is (default)."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Smart Tool Selection:"})," Intelligent tool selection behavior."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Code Execution:"})," Code execution behavior."]})]})})]})}),t.jsxs(fe,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Z,{children:t.jsx(ue,{className:"w-[180px]",children:t.jsx(xe,{})})}),t.jsxs(he,{children:[t.jsx(W,{value:"passthrough",children:"Passthrough"}),t.jsx(W,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(W,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(ee,{})]})}function Me(o){const{field:e}=o;return t.jsxs(Y,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(me,{className:"mb-0",children:"Tool Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(H,{children:t.jsxs(K,{children:[t.jsx(Q,{asChild:!0,children:t.jsx("button",{type:"button",className:"cursor-help flex items-center",children:t.jsx(B,{name:"info",size:14,className:"text-muted-foreground"})})}),t.jsx(X,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected connections/tools are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All connections/tools except selected ones are exposed."]})]})})]})}),t.jsxs(fe,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Z,{children:t.jsx(ue,{className:"w-[180px]",children:t.jsx(xe,{})})}),t.jsxs(he,{children:[t.jsx(W,{value:"inclusion",children:"Include Selected"}),t.jsx(W,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(ee,{})]})}function qe(o){const{field:e}=o;return t.jsxs(Y,{className:"w-full space-y-0",children:[t.jsx(Z,{children:t.jsx(de,{...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..."})}),t.jsx(ee,{})]})}function We(o){const{field:e}=o;return t.jsxs(Y,{className:"w-full space-y-0",children:[t.jsx(Z,{children:t.jsx(de,{...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"})}),t.jsx(ee,{})]})}function He(o){const{field:e}=o;return t.jsxs(Y,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:e.value==="active"?"Active":"Inactive"}),t.jsx(Z,{children:t.jsx(Ee,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(ee,{})]})}function Ke(o){const e=R.c(53),{gateway:s,gatewayId:l}=o,a=ve(),c=$e();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];const m=Se(i);let n;if(e[1]!==m){n=new Map;for(const f of m)f.tools&&f.tools.length>0&&n.set(f.id,f.tools.map(Qe));e[1]=m,e[2]=n}else n=e[2];let r;e[3]!==n||e[4]!==s?(r=()=>Oe(s,n),e[3]=n,e[4]=s,e[5]=r):r=e[5];const[d,p]=O.useState(r),[g,C]=O.useState(!1);let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=f=>{p(f),C(!0)},e[6]=u):u=e[6];const x=u;let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=we(Ue),e[7]=h):h=e[7];const J=s.tool_selection_mode??"inclusion",L=s.tool_selection_strategy??"passthrough";let V;e[8]!==s.description||e[9]!==s.status||e[10]!==s.title||e[11]!==J||e[12]!==L?(V={resolver:h,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:J,tool_selection_strategy:L}},e[8]=s.description,e[9]=s.status,e[10]=s.title,e[11]=J,e[12]=L,e[13]=V):V=e[13];const w=Ce(V),F=w.formState.isDirty||g;let z;e[14]!==c.update||e[15]!==n||e[16]!==w||e[17]!==l||e[18]!==d?(z=async()=>{const f=w.getValues(),D=Re(d,n);await c.update.mutateAsync({id:l,data:{title:f.title,description:f.description,status:f.status,tool_selection_mode:f.tool_selection_mode,tool_selection_strategy:f.tool_selection_strategy,connections:D}}),w.reset(f),C(!1)},e[14]=c.update,e[15]=n,e[16]=w,e[17]=l,e[18]=d,e[19]=z):z=e[19];const G=z;let j;e[20]!==a.history?(j=()=>a.history.back(),e[20]=a.history,e[21]=j):j=e[21];let y;e[22]!==c.update.isPending||e[23]!==G||e[24]!==F?(y=F&&t.jsxs(q,{onClick:G,disabled:c.update.isPending,size:"sm",className:"h-7",children:[c.update.isPending&&t.jsx(B,{name:"progress_activity",size:16,className:"mr-2 animate-spin"}),"Save Changes"]}),e[22]=c.update.isPending,e[23]=G,e[24]=F,e[25]=y):y=e[25];let _;e[26]!==y?(_=t.jsx(Ae,{children:y}),e[26]=y,e[27]=_):_=e[27];let N;e[28]!==w||e[29]!==s.icon||e[30]!==d?(N=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(Je,{form:w,toolSet:d,onToolSetChange:x,icon:s.icon})}),e[28]=w,e[29]=s.icon,e[30]=d,e[31]=N):N=e[31];let S;e[32]!==s.id||e[33]!==s.title?(S=s.title||`gateway-${s.id.slice(0,8)}`,e[32]=s.id,e[33]=s.title,e[34]=S):S=e[34];const A=`${window.location.origin}/mcp/gateway/${s.id}`;let T;e[35]!==S||e[36]!==A?(T=t.jsx("div",{className:"p-5",children:t.jsx(Pe,{serverName:S,gatewayUrl:A})}),e[35]=S,e[36]=A,e[37]=T):T=e[37];let k;e[38]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[38]=k):k=e[38];let b;e[39]!==s.updated_at?(b=s.updated_at?ze(new Date(s.updated_at),{addSuffix:!1}):"Unknown",e[39]=s.updated_at,e[40]=b):b=e[40];let I;e[41]!==b?(I=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[k,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:b})]}),e[41]=b,e[42]=I):I=e[42];let $;e[43]!==T||e[44]!==I?($=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[T,I]}),e[43]=T,e[44]=I,e[45]=$):$=e[45];let v;e[46]!==N||e[47]!==$?(v=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[N,$]}),e[46]=N,e[47]=$,e[48]=v):v=e[48];let E;return e[49]!==_||e[50]!==v||e[51]!==j?(E=t.jsxs(Ve,{onBack:j,children:[_,v]}),e[49]=_,e[50]=v,e[51]=j,e[52]=E):E=e[52],E}function Qe(o){return o.name}function Xe(){const o=R.c(8);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},o[0]=e):e=o[0];const s=ye(e);let l;o[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/gateways/$gatewayId"},o[1]=l):l=o[1];const{gatewayId:a,org:c}=_e(l),i=Ie(a);if(!i){let n;return o[2]!==s||o[3]!==c?(n=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ne,{title:"Gateway not found",description:"This gateway may have been deleted or you may not have access.",actions:t.jsx(q,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:c}}),children:"Back to gateways"})})}),o[2]=s,o[3]=c,o[4]=n):n=o[4],n}let m;return o[5]!==i||o[6]!==a?(m=t.jsx(Ke,{gateway:i,gatewayId:a}),o[5]=i,o[6]=a,o[7]=m):m=o[7],m}function Ye(){const o=R.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ce,{children:t.jsx(O.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(B,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Xe,{})})}),o[0]=e):e=o[0],e}function jt(){const o=R.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{}),o[0]=e):e=o[0],e}export{jt as default};
|
|
1
|
+
import{c as R,j as t,r as O,a5 as ye,d as _e,ap as be,bB as ne,aq as ie,bd as ve,ar as we,as as Ce,a6 as re}from"./index-HoRNE_Oj.js";import{E as Ne}from"./empty-state-CwiQR0XJ.js";import{E as ce}from"./error-boundary-8a3_at8W.js";import{b as Se,I as Te}from"./use-connection-DbdMBpCj.js";import{T as ke}from"./tool-set-selector-B9UyeKAH.js";import{b as Ie,a as $e}from"./use-gateway-DN4bQAAB.js";import{B as q}from"./button-8a8UdvyR.js";import{I as B}from"./icon-CzxeHWBl.js";import{I as de}from"./input-GtBoan0u.js";import{S as Ee}from"./switch-8wTpXb1-.js";import{F as M,a as Fe,b as Y,d as Z,f as ee,c as me}from"./form-DU90-O_I.js";import{c as fe,a as ue,S as xe,b as he,d as W}from"./select-gKhGAtmi.js";import{d as H,b as K,a as Q,T as X}from"./tooltip-ocFCU6ZE.js";import{s as Ge}from"./slugify-CEUa2lfQ.js";import{V as Ae,b as Ve}from"./layout-DtdXVJv4.js";import{f as ze}from"./formatDistanceToNow-Ctx6mZEP.js";import"./utils-oBMoklwF.js";import"./checkbox-DCjoNloy.js";import"./collection-search-C7G2QK3t.js";function De(o){const s=new TextEncoder().encode(o),l=Array.from(s,a=>String.fromCharCode(a)).join("");return btoa(l)}function Pe(o){const e=R.c(52),{serverName:s,gatewayUrl:l}=o,[a,c]=O.useState(!1),[i,m]=O.useState(null),n=Ge(s);let r,d,p,g;if(e[0]!==l||e[1]!==n){const se={type:"http",url:l},oe={[n]:se};r=JSON.stringify(oe,null,2);const ae=je=>JSON.stringify({...se,headers:{"x-mesh-client":je}},null,2),pe=De(ae("Cursor"));d=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(n)}&config=${encodeURIComponent(pe)}`;const ge=ae("Claude Code");p=n;let le;e[6]===Symbol.for("react.memo_cache_sentinel")?(le=/'/g,e[6]=le):le=e[6],g=ge.replace(le,"'\\''"),e[0]=l,e[1]=n,e[2]=r,e[3]=d,e[4]=p,e[5]=g}else r=e[2],d=e[3],p=e[4],g=e[5];const C=`claude mcp add "${p}" --config '${g}'`;let u;e[7]!==r?(u=async()=>{await navigator.clipboard.writeText(r),c(!0),re.success("Configuration copied to clipboard"),setTimeout(()=>c(!1),2e3)},e[7]=r,e[8]=u):u=e[8];const x=u;let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=async(se,oe)=>{await navigator.clipboard.writeText(se),m(oe),re.success(`${oe} command copied`),setTimeout(()=>m(null),2e3)},e[9]=h):h=e[9];const J=h,L=Be;let V;e[10]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[10]=V):V=e[10];const w=a?"check":"content_copy";let P;e[11]!==w?(P=t.jsx(B,{name:w,size:14}),e[11]=w,e[12]=P):P=e[12];let F;e[13]!==x||e[14]!==P?(F=t.jsx(Q,{asChild:!0,children:t.jsx(q,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:x,children:P})}),e[13]=x,e[14]=P,e[15]=F):F=e[15];let z;e[16]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(X,{children:"Copy configuration"}),e[16]=z):z=e[16];let G;e[17]!==F?(G=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(H,{children:t.jsxs(K,{children:[F,z]})})}),e[17]=F,e[18]=G):G=e[18];let j;e[19]!==r||e[20]!==x?(j=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:x,children:r}),e[19]=r,e[20]=x,e[21]=j):j=e[21];let y;e[22]!==G||e[23]!==j?(y=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[G,j]}),e[22]=G,e[23]=j,e[24]=y):y=e[24];let _;e[25]!==d?(_=()=>L(d),e[25]=d,e[26]=_):_=e[26];let N,S;e[27]===Symbol.for("react.memo_cache_sentinel")?(N=t.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%)"}}),S=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=N,e[28]=S):(N=e[27],S=e[28]);let A;e[29]!==_?(A=t.jsx(Q,{asChild:!0,children:t.jsxs(q,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:_,children:[N,S]})}),e[29]=_,e[30]=A):A=e[30];let T;e[31]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(X,{children:"Add to Cursor"}),e[31]=T):T=e[31];let k;e[32]!==A?(k=t.jsx(H,{children:t.jsxs(K,{children:[A,T]})}),e[32]=A,e[33]=k):k=e[33];let b;e[34]!==C?(b=()=>J(C,"Claude"),e[34]=C,e[35]=b):b=e[35];let I,$;e[36]===Symbol.for("react.memo_cache_sentinel")?(I=t.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%)"}}),$=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=I,e[37]=$):(I=e[36],$=e[37]);let v;e[38]!==i?(v=i==="Claude"&&t.jsx(B,{name:"check",size:14,className:"ml-2 text-green-500"}),e[38]=i,e[39]=v):v=e[39];let E;e[40]!==b||e[41]!==v?(E=t.jsx(Q,{asChild:!0,children:t.jsxs(q,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:b,children:[I,$,v]})}),e[40]=b,e[41]=v,e[42]=E):E=e[42];let f;e[43]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(X,{children:"Add to Claude Code"}),e[43]=f):f=e[43];let D;e[44]!==E?(D=t.jsx(H,{children:t.jsxs(K,{children:[E,f]})}),e[44]=E,e[45]=D):D=e[45];let U;e[46]!==k||e[47]!==D?(U=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[k,D]}),e[46]=k,e[47]=D,e[48]=U):U=e[48];let te;return e[49]!==y||e[50]!==U?(te=t.jsxs("div",{className:"flex flex-col gap-4",children:[V,y,U]}),e[49]=y,e[50]=U,e[51]=te):te=e[51],te}function Be(o){window.open(o,"_blank")}const Ue=be({title:ie().min(1,"Name is required").max(255),description:ie().nullable(),status:ne(["active","inactive"]),tool_selection_mode:ne(["inclusion","exclusion"]),tool_selection_strategy:ne(["passthrough","smart_tool_selection","code_execution"])});function Oe(o,e){const s={};for(const l of o.connections)if(l.selected_tools===null){const a=e.get(l.connection_id)??[];a.length>0&&(s[l.connection_id]=a)}else l.selected_tools.length>0&&(s[l.connection_id]=l.selected_tools);return s}function Re(o,e){return Object.entries(o).map(([s,l])=>{const a=e.get(s)??[],c=a.length>0&&a.every(i=>l.includes(i));return{connection_id:s,selected_tools:c?null:l}})}function Je(o){const e=R.c(28),{form:s,toolSet:l,onToolSetChange:a,icon:c}=o;let i;e[0]!==s?(i=s.watch("title")||"Gateway",e[0]=s,e[1]=i):i=e[1];let m;e[2]!==c||e[3]!==i?(m=t.jsx(Te,{icon:c,name:i,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:"network_node"}),e[2]=c,e[3]=i,e[4]=m):m=e[4];let n;e[5]!==s.control?(n=t.jsx(M,{control:s.control,name:"status",render:He}),e[5]=s.control,e[6]=n):n=e[6];let r;e[7]!==m||e[8]!==n?(r=t.jsxs("div",{className:"flex items-start justify-between",children:[m,n]}),e[7]=m,e[8]=n,e[9]=r):r=e[9];let d;e[10]!==s.control?(d=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(M,{control:s.control,name:"title",render:We}),t.jsx(M,{control:s.control,name:"description",render:qe})]}),e[10]=s.control,e[11]=d):d=e[11];let p;e[12]!==r||e[13]!==d?(p=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[r,d]}),e[12]=r,e[13]=d,e[14]=p):p=e[14];let g;e[15]!==s.control?(g=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(M,{control:s.control,name:"tool_selection_mode",render:Me}),t.jsx(M,{control:s.control,name:"tool_selection_strategy",render:Le})]}),e[15]=s.control,e[16]=g):g=e[16];let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx("div",{className:"flex-1 flex items-center justify-center p-5",children:t.jsx(B,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),e[17]=C):C=e[17];let u;e[18]!==a||e[19]!==l?(u=t.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:t.jsx(ce,{children:t.jsx(O.Suspense,{fallback:C,children:t.jsx(ke,{toolSet:l,onToolSetChange:a})})})}),e[18]=a,e[19]=l,e[20]=u):u=e[20];let x;e[21]!==p||e[22]!==g||e[23]!==u?(x=t.jsxs("div",{className:"flex flex-col h-full",children:[p,g,u]}),e[21]=p,e[22]=g,e[23]=u,e[24]=x):x=e[24];let h;return e[25]!==s||e[26]!==x?(h=t.jsx(Fe,{...s,children:x}),e[25]=s,e[26]=x,e[27]=h):h=e[27],h}function Le(o){const{field:e}=o;return t.jsxs(Y,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(me,{className:"mb-0",children:"Gateway Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(H,{children:t.jsxs(K,{children:[t.jsx(Q,{asChild:!0,children:t.jsx("button",{type:"button",className:"cursor-help flex items-center",children:t.jsx(B,{name:"info",size:14,className:"text-muted-foreground"})})}),t.jsx(X,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Passthrough:"})," Pass tools through as-is (default)."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Smart Tool Selection:"})," Intelligent tool selection behavior."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Code Execution:"})," Code execution behavior."]})]})})]})}),t.jsxs(fe,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Z,{children:t.jsx(ue,{className:"w-[180px]",children:t.jsx(xe,{})})}),t.jsxs(he,{children:[t.jsx(W,{value:"passthrough",children:"Passthrough"}),t.jsx(W,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(W,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(ee,{})]})}function Me(o){const{field:e}=o;return t.jsxs(Y,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(me,{className:"mb-0",children:"Tool Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(H,{children:t.jsxs(K,{children:[t.jsx(Q,{asChild:!0,children:t.jsx("button",{type:"button",className:"cursor-help flex items-center",children:t.jsx(B,{name:"info",size:14,className:"text-muted-foreground"})})}),t.jsx(X,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected connections/tools are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All connections/tools except selected ones are exposed."]})]})})]})}),t.jsxs(fe,{value:e.value,onValueChange:e.onChange,children:[t.jsx(Z,{children:t.jsx(ue,{className:"w-[180px]",children:t.jsx(xe,{})})}),t.jsxs(he,{children:[t.jsx(W,{value:"inclusion",children:"Include Selected"}),t.jsx(W,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(ee,{})]})}function qe(o){const{field:e}=o;return t.jsxs(Y,{className:"w-full space-y-0",children:[t.jsx(Z,{children:t.jsx(de,{...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..."})}),t.jsx(ee,{})]})}function We(o){const{field:e}=o;return t.jsxs(Y,{className:"w-full space-y-0",children:[t.jsx(Z,{children:t.jsx(de,{...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"})}),t.jsx(ee,{})]})}function He(o){const{field:e}=o;return t.jsxs(Y,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:e.value==="active"?"Active":"Inactive"}),t.jsx(Z,{children:t.jsx(Ee,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(ee,{})]})}function Ke(o){const e=R.c(53),{gateway:s,gatewayId:l}=o,a=ve(),c=$e();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={},e[0]=i):i=e[0];const m=Se(i);let n;if(e[1]!==m){n=new Map;for(const f of m)f.tools&&f.tools.length>0&&n.set(f.id,f.tools.map(Qe));e[1]=m,e[2]=n}else n=e[2];let r;e[3]!==n||e[4]!==s?(r=()=>Oe(s,n),e[3]=n,e[4]=s,e[5]=r):r=e[5];const[d,p]=O.useState(r),[g,C]=O.useState(!1);let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=f=>{p(f),C(!0)},e[6]=u):u=e[6];const x=u;let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=we(Ue),e[7]=h):h=e[7];const J=s.tool_selection_mode??"inclusion",L=s.tool_selection_strategy??"passthrough";let V;e[8]!==s.description||e[9]!==s.status||e[10]!==s.title||e[11]!==J||e[12]!==L?(V={resolver:h,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:J,tool_selection_strategy:L}},e[8]=s.description,e[9]=s.status,e[10]=s.title,e[11]=J,e[12]=L,e[13]=V):V=e[13];const w=Ce(V),F=w.formState.isDirty||g;let z;e[14]!==c.update||e[15]!==n||e[16]!==w||e[17]!==l||e[18]!==d?(z=async()=>{const f=w.getValues(),D=Re(d,n);await c.update.mutateAsync({id:l,data:{title:f.title,description:f.description,status:f.status,tool_selection_mode:f.tool_selection_mode,tool_selection_strategy:f.tool_selection_strategy,connections:D}}),w.reset(f),C(!1)},e[14]=c.update,e[15]=n,e[16]=w,e[17]=l,e[18]=d,e[19]=z):z=e[19];const G=z;let j;e[20]!==a.history?(j=()=>a.history.back(),e[20]=a.history,e[21]=j):j=e[21];let y;e[22]!==c.update.isPending||e[23]!==G||e[24]!==F?(y=F&&t.jsxs(q,{onClick:G,disabled:c.update.isPending,size:"sm",className:"h-7",children:[c.update.isPending&&t.jsx(B,{name:"progress_activity",size:16,className:"mr-2 animate-spin"}),"Save Changes"]}),e[22]=c.update.isPending,e[23]=G,e[24]=F,e[25]=y):y=e[25];let _;e[26]!==y?(_=t.jsx(Ae,{children:y}),e[26]=y,e[27]=_):_=e[27];let N;e[28]!==w||e[29]!==s.icon||e[30]!==d?(N=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(Je,{form:w,toolSet:d,onToolSetChange:x,icon:s.icon})}),e[28]=w,e[29]=s.icon,e[30]=d,e[31]=N):N=e[31];let S;e[32]!==s.id||e[33]!==s.title?(S=s.title||`gateway-${s.id.slice(0,8)}`,e[32]=s.id,e[33]=s.title,e[34]=S):S=e[34];const A=`${window.location.origin}/mcp/gateway/${s.id}`;let T;e[35]!==S||e[36]!==A?(T=t.jsx("div",{className:"p-5",children:t.jsx(Pe,{serverName:S,gatewayUrl:A})}),e[35]=S,e[36]=A,e[37]=T):T=e[37];let k;e[38]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[38]=k):k=e[38];let b;e[39]!==s.updated_at?(b=s.updated_at?ze(new Date(s.updated_at),{addSuffix:!1}):"Unknown",e[39]=s.updated_at,e[40]=b):b=e[40];let I;e[41]!==b?(I=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[k,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:b})]}),e[41]=b,e[42]=I):I=e[42];let $;e[43]!==T||e[44]!==I?($=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[T,I]}),e[43]=T,e[44]=I,e[45]=$):$=e[45];let v;e[46]!==N||e[47]!==$?(v=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[N,$]}),e[46]=N,e[47]=$,e[48]=v):v=e[48];let E;return e[49]!==_||e[50]!==v||e[51]!==j?(E=t.jsxs(Ve,{onBack:j,children:[_,v]}),e[49]=_,e[50]=v,e[51]=j,e[52]=E):E=e[52],E}function Qe(o){return o.name}function Xe(){const o=R.c(8);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},o[0]=e):e=o[0];const s=ye(e);let l;o[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/gateways/$gatewayId"},o[1]=l):l=o[1];const{gatewayId:a,org:c}=_e(l),i=Ie(a);if(!i){let n;return o[2]!==s||o[3]!==c?(n=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ne,{title:"Gateway not found",description:"This gateway may have been deleted or you may not have access.",actions:t.jsx(q,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:c}}),children:"Back to gateways"})})}),o[2]=s,o[3]=c,o[4]=n):n=o[4],n}let m;return o[5]!==i||o[6]!==a?(m=t.jsx(Ke,{gateway:i,gatewayId:a}),o[5]=i,o[6]=a,o[7]=m):m=o[7],m}function Ye(){const o=R.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ce,{children:t.jsx(O.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(B,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Xe,{})})}),o[0]=e):e=o[0],e}function jt(){const o=R.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{}),o[0]=e):e=o[0],e}export{jt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Y,j as t,r as Z,a5 as te,a6 as se}from"./index-
|
|
1
|
+
import{c as Y,j as t,r as Z,a5 as te,a6 as se}from"./index-HoRNE_Oj.js";import{C as oe}from"./collection-header-B92Inaku.js";import{C as ae}from"./collection-page-BfXTrpEI.js";import{C as ne}from"./collection-search-C7G2QK3t.js";import{C as re}from"./collection-table-wrapper-DdGYlOCN.js";import{C as ie}from"./connection-card-xMF7zskf.js";import{E as q}from"./empty-state-CwiQR0XJ.js";import{E as le}from"./error-boundary-8a3_at8W.js";import{b as ce,I as de}from"./use-connection-DbdMBpCj.js";import{a as me,u as ue}from"./use-gateway-DN4bQAAB.js";import{u as ge}from"./use-list-state-DhZmck5D.js";import{u as pe}from"./tooltip-ocFCU6ZE.js";import{c as he,b as fe,d as xe,A as we,e as ye,g as je,a as Ce,f as Ne}from"./alert-dialog-Bj3sxji2.js";import{B as ee}from"./badge-Ba7oj8pn.js";import{B as J}from"./button-8a8UdvyR.js";import{b as Q,D as U,a as X,c as B}from"./dropdown-menu-BTTzlaf4.js";import{I as i}from"./icon-CzxeHWBl.js";import"./collection-display-button-CGcY64sw.js";import"./utils-oBMoklwF.js";import"./input-GtBoan0u.js";import"./card-Cyeg7tCo.js";import"./use-mobile-BnwnARpl.js";function ve(e,a){switch(a.type){case"delete":return{mode:"deleting",gateway:a.gateway};case"close":return{mode:"idle"}}}function De(){const e=Y.c(68),{org:a}=pe(),n=te();let y;e[0]!==a.slug?(y={namespace:a.slug,resource:"gateways"},e[0]=a.slug,e[1]=y):y=e[1];const s=ge(y),r=me(),w=ue(s);let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j={},e[2]=j):j=e[2];const R=ce(j);let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={mode:"idle"},e[3]=C):C=e[3];const[l,N]=Z.useReducer(ve,C);let v;e[4]!==r.create||e[5]!==R.length||e[6]!==n||e[7]!==a.slug?(v=async()=>{if(R.length===0){se.error("Create at least one MCP connection first");return}const o=await r.create.mutateAsync({title:"New Gateway",description:"Gateways let you securely expose integrated tools to the outside world.",status:"active",tool_selection_strategy:"passthrough",tool_selection_mode:"inclusion",connections:[]});n({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},e[4]=r.create,e[5]=R.length,e[6]=n,e[7]=a.slug,e[8]=v):v=e[8];const T=v;let D;e[9]!==r.delete||e[10]!==l.gateway||e[11]!==l.mode?(D=async()=>{if(l.mode!=="deleting")return;const o=l.gateway.id;N({type:"close"});try{await r.delete.mutateAsync(o)}catch{}},e[9]=r.delete,e[10]=l.gateway,e[11]=l.mode,e[12]=D):D=e[12];const O=D;let S,_,b,k,I,M;e[13]===Symbol.for("react.memo_cache_sentinel")?(_={id:"icon",header:"",render:$e,cellClassName:"w-16 shrink-0",wrap:!0},b={id:"title",header:"Name",render:Ae,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},k={id:"description",header:"Description",render:ze,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},I={id:"mode",header:"Mode",accessor:Pe,cellClassName:"w-[100px]"},M={id:"connections",header:"Connections",render:Me,cellClassName:"w-24 shrink-0"},S={id:"status",header:"Status",render:Ie,cellClassName:"w-24 shrink-0",sortable:!0},e[13]=S,e[14]=_,e[15]=b,e[16]=k,e[17]=I,e[18]=M):(S=e[13],_=e[14],b=e[15],k=e[16],I=e[17],M=e[18]);let P;e[19]!==n||e[20]!==a.slug?(P=[_,b,k,I,M,S,{id:"actions",header:"",render:o=>t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ke,children:t.jsx(i,{name:"more_vert",size:20})})}),t.jsxs(X,{align:"end",onClick:be,children:[t.jsxs(B,{onClick:c=>{c.stopPropagation(),n({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},children:[t.jsx(i,{name:"visibility",size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:c=>{c.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(i,{name:"delete",size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[19]=n,e[20]=a.slug,e[21]=P):P=e[21];const V=P,H=r.create.isPending?"Creating...":"Create MCP Gateway";let z;e[22]!==r.create.isPending||e[23]!==T||e[24]!==H?(z=t.jsx(J,{onClick:T,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:r.create.isPending,children:H}),e[22]=r.create.isPending,e[23]=T,e[24]=H,e[25]=z):z=e[25];const L=z,F=l.mode==="deleting";let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=o=>!o&&N({type:"close"}),e[26]=A):A=e[26];let $;e[27]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(he,{children:"Delete Gateway?"}),e[27]=$):$=e[27];const W=l.mode==="deleting"&&l.gateway.title;let d;e[28]!==W?(d=t.jsxs(fe,{children:[$,t.jsxs(xe,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),e[28]=W,e[29]=d):d=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(we,{children:"Cancel"}),e[30]=E):E=e[30];let m;e[31]!==O?(m=t.jsxs(ye,{children:[E,t.jsx(je,{onClick:O,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[31]=O,e[32]=m):m=e[32];let u;e[33]!==d||e[34]!==m?(u=t.jsxs(Ce,{children:[d,m]}),e[33]=d,e[34]=m,e[35]=u):u=e[35];let g;e[36]!==F||e[37]!==u?(g=t.jsx(Ne,{open:F,onOpenChange:A,children:u}),e[36]=F,e[37]=u,e[38]=g):g=e[38];let G;e[39]===Symbol.for("react.memo_cache_sentinel")?(G=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[39]=G):G=e[39];let p;e[40]!==L||e[41]!==s.handleSort||e[42]!==s.setViewMode||e[43]!==s.sortDirection||e[44]!==s.sortKey||e[45]!==s.viewMode?(p=t.jsx(oe,{title:"MCP Gateways",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:G,ctaButton:L}),e[40]=L,e[41]=s.handleSort,e[42]=s.setViewMode,e[43]=s.sortDirection,e[44]=s.sortKey,e[45]=s.viewMode,e[46]=p):p=e[46];let h;e[47]!==s?(h=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[47]=s,e[48]=h):h=e[48];let f;e[49]!==s.search||e[50]!==s.setSearch||e[51]!==h?(f=t.jsx(ne,{value:s.search,onChange:s.setSearch,placeholder:"Search for a gateway...",onKeyDown:h}),e[49]=s.search,e[50]=s.setSearch,e[51]=h,e[52]=f):f=e[52];let x;e[53]!==V||e[54]!==w||e[55]!==s.handleSort||e[56]!==s.search||e[57]!==s.sortDirection||e[58]!==s.sortKey||e[59]!==s.viewMode||e[60]!==n||e[61]!==a.slug?(x=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:w.length===0?t.jsx(q,{image:t.jsx(i,{name:"network_node",size:48,className:"text-muted-foreground"}),title:s.search?"No gateways found":"No gateways yet",description:s.search?`No gateways match "${s.search}"`:"Create a gateway to aggregate tools from multiple MCP connections."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:w.map(o=>t.jsx(ie,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:"network_node",onClick:()=>n({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}}),footer:t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]}),t.jsx("span",{children:"•"}),t.jsx("span",{children:o.tool_selection_mode==="exclusion"?"Exclude":"Include"})]}),headerActions:t.jsxs(Q,{children:[t.jsx(U,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:_e,children:t.jsx(i,{name:"more_vert",size:20})})}),t.jsxs(X,{align:"end",onClick:Se,children:[t.jsxs(B,{onClick:c=>{c.stopPropagation(),n({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},children:[t.jsx(i,{name:"visibility",size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:c=>{c.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(i,{name:"delete",size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(re,{columns:V,data:w,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>n({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(q,{image:t.jsx(i,{name:"network_node",size:48,className:"text-muted-foreground"}),title:"No gateways found",description:`No gateways match "${s.search}"`}):t.jsx(q,{image:t.jsx(i,{name:"network_node",size:48,className:"text-muted-foreground"}),title:"No gateways yet",description:"Create a gateway to aggregate tools from multiple MCP connections."})}),e[53]=V,e[54]=w,e[55]=s.handleSort,e[56]=s.search,e[57]=s.sortDirection,e[58]=s.sortKey,e[59]=s.viewMode,e[60]=n,e[61]=a.slug,e[62]=x):x=e[62];let K;return e[63]!==g||e[64]!==p||e[65]!==f||e[66]!==x?(K=t.jsxs(ae,{children:[g,p,f,x]}),e[63]=g,e[64]=p,e[65]=f,e[66]=x,e[67]=K):K=e[67],K}function Se(e){return e.stopPropagation()}function _e(e){return e.stopPropagation()}function be(e){return e.stopPropagation()}function ke(e){return e.stopPropagation()}function Ie(e){return t.jsx(ee,{variant:e.status==="active"?"default":"outline",children:e.status})}function Me(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function Pe(e){return t.jsx(ee,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function ze(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Ae(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function $e(e){return t.jsx(de,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:"network_node"})}function ot(){const e=Y.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(le,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(i,{name:"progress_activity",size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(De,{})})}),e[0]=a):a=e[0],a}export{ot as default};
|