@decocms/mesh 2.64.0 → 2.64.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-B7sqll3Z.js → AlertCircle-CyK0Qw5h.js} +1 -1
- package/dist/client/assets/{ArrowUp-D8YYlj5b.js → ArrowUp-BzVEz2lB.js} +1 -1
- package/dist/client/assets/{Calendar-Cn4v8JwE.js → Calendar-DtGnvM8B.js} +1 -1
- package/dist/client/assets/{Check-lN7sUZo8.js → Check-Dzm8t_lx.js} +1 -1
- package/dist/client/assets/CheckCircle-Dq1sA0pv.js +1 -0
- package/dist/client/assets/{ChevronDown-En_P43wp.js → ChevronDown-Z3Dyyuvx.js} +1 -1
- package/dist/client/assets/{ChevronRight-BB2YL4K4.js → ChevronRight-DDdY_PC7.js} +1 -1
- package/dist/client/assets/{Code01-Dgx2dgXr.js → Code01-BWP8EmsE.js} +1 -1
- package/dist/client/assets/{Copy01-daHVbD8K.js → Copy01-C6IJYSqu.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-DT2O2EOj.js → DotsHorizontal-lop24UEO.js} +1 -1
- package/dist/client/assets/{DotsVertical-D1ZY49Um.js → DotsVertical-BpzYqYSl.js} +1 -1
- package/dist/client/assets/{Download01-oP6u6TmF.js → Download01-DkL2eEzP.js} +1 -1
- package/dist/client/assets/{Edit01-C_JM_ANM.js → Edit01-BObRJWWQ.js} +1 -1
- package/dist/client/assets/{File02-DlRIy2xF.js → File02-D8LncylE.js} +1 -1
- package/dist/client/assets/{File06-2dtWfDa_.js → File06-Bwnj0Jvb.js} +1 -1
- package/dist/client/assets/{FilterLines-BCtAjuvO.js → FilterLines-Tzhosng2.js} +1 -1
- package/dist/client/assets/Globe02-DudYvjwY.js +1 -0
- package/dist/client/assets/{Grid01-DHptyetH.js → Grid01-DB4psHwp.js} +1 -1
- package/dist/client/assets/{Home02-CwpXJj-n.js → Home02-C9yoONyT.js} +1 -1
- package/dist/client/assets/{Image01-CILGPgam.js → Image01-BIunU3ME.js} +1 -1
- package/dist/client/assets/{Inbox01-BTvTBHN2.js → Inbox01-Dn_ZLwmj.js} +1 -1
- package/dist/client/assets/{InfoCircle-COTflZ7n.js → InfoCircle-p3x1ZyEw.js} +1 -1
- package/dist/client/assets/{Key01-DFKkR5uc.js → Key01-Bycaiiyx.js} +1 -1
- package/dist/client/assets/{LinkExternal01-WHnCc-Ds.js → LinkExternal01-DQ9drSdh.js} +1 -1
- package/dist/client/assets/{List-Dl-Bi1Os.js → List-BeVMnZSE.js} +1 -1
- package/dist/client/assets/{Loading01-D8raUT2q.js → Loading01-DCWQbhnz.js} +1 -1
- package/dist/client/assets/{Lock01-0pDC11sR.js → Lock01-Cnn8kQG1.js} +1 -1
- package/dist/client/assets/{Pin01-C3nTzsY2.js → Pin01-WkOPKnTb.js} +1 -1
- package/dist/client/assets/{Play-B3d026b0.js → Play-D6BmScpI.js} +1 -1
- package/dist/client/assets/{Plus-BcqTpnxy.js → Plus-CG8dB40n.js} +1 -1
- package/dist/client/assets/{SearchMd-DVuLBPJW.js → SearchMd-BWXZ4bVC.js} +1 -1
- package/dist/client/assets/{Share07-DW8M4mUv.js → Share07-DSoplUP9.js} +1 -1
- package/dist/client/assets/{Terminal-BOgtpg9n.js → Terminal-CdMAejVo.js} +1 -1
- package/dist/client/assets/{Tool01-D95FDZLP.js → Tool01-BDUyIGto.js} +1 -1
- package/dist/client/assets/{Trash01-CR6s5yrj.js → Trash01-C_hJOK44.js} +1 -1
- package/dist/client/assets/{Upload01-CkSc1CyA.js → Upload01-CnMM-V_T.js} +1 -1
- package/dist/client/assets/{Users03-CCWN1VQn.js → Users03-DkIVbHWT.js} +1 -1
- package/dist/client/assets/{X-BsLffR19.js → X-8UbCzOSY.js} +1 -1
- package/dist/client/assets/{XClose-D9VL7Fhs.js → XClose-BDdig6o8.js} +1 -1
- package/dist/client/assets/agent-connections-preview-CC_R-LrZ.js +1 -0
- package/dist/client/assets/agent-detail-yfEWcbsQ.js +1 -0
- package/dist/client/assets/agents-BLmykWZD.js +1 -0
- package/dist/client/assets/alert-dialog-CHAGlLFb.js +7 -0
- package/dist/client/assets/{auth-catchall-B3lc_CZ9.js → auth-catchall-B-Mu7VlE.js} +1 -1
- package/dist/client/assets/badge-BMiZ-mom.js +1 -0
- package/dist/client/assets/{binder-CwgOa4SG.js → binder-DC5jbVcK.js} +1 -1
- package/dist/client/assets/{breadcrumb-BuFIEIOz.js → breadcrumb-BjHn0dWR.js} +1 -1
- package/dist/client/assets/{button-BNRw8VbO.js → button-nyR0JH2l.js} +1 -1
- package/dist/client/assets/{card-B2_21gZH.js → card-DVnhjUGd.js} +1 -1
- package/dist/client/assets/{checkbox-D0Zw7dGS.js → checkbox-TpL0D3NW.js} +1 -1
- package/dist/client/assets/{circle-alert-DepalnIB.js → circle-alert-D0fEJodr.js} +1 -1
- package/dist/client/assets/{collapsible-Dg-5RnYq.js → collapsible-DJK4gRv1.js} +7 -7
- package/dist/client/assets/{collection-detail-DFH_vpkO.js → collection-detail-GbUt_XKS.js} +3 -3
- package/dist/client/assets/{collection-search-D5gi0-bL.js → collection-search-DgJbkAZh.js} +1 -1
- package/dist/client/assets/collection-tab-BTzm3KZ6.js +1 -0
- package/dist/client/assets/collection-table-wrapper-Ad_-F1tG.js +1 -0
- package/dist/client/assets/collection-tabs-UYd1fkoS.js +1 -0
- package/dist/client/assets/connect-BCgu89pq.js +1 -0
- package/dist/client/assets/connection-card-ByjFlujM.js +1 -0
- package/dist/client/assets/connection-detail-CuLe29i_.js +1 -0
- package/dist/client/assets/connections-BKV3JOBI.js +1 -0
- package/dist/client/assets/{constants-Cpe-c81c.js → constants-CJQnv32m.js} +1 -1
- package/dist/client/assets/constants-DpsR0LZe.js +1 -0
- package/dist/client/assets/{create-organization-dialog-7bdcAksX.js → create-organization-dialog-WB_1M15V.js} +1 -1
- package/dist/client/assets/{dialog-Csoqe4hG.js → dialog-DobMZv-a.js} +1 -1
- package/dist/client/assets/differenceInSeconds-NQ4PDo0z.js +1 -0
- package/dist/client/assets/dropdown-menu-BUrC7H_I.js +1 -0
- package/dist/client/assets/dynamic-plugin-layout-yJKJv0tx.js +1 -0
- package/dist/client/assets/{empty-state-Cn1CRUZO.js → empty-state-C0f9rz3s.js} +1 -1
- package/dist/client/assets/{empty-state-CpRLw49r.js → empty-state-Z8nGys2S.js} +1 -1
- package/dist/client/assets/{env-vars-editor-0JsZHlg0.js → env-vars-editor-CGiYkoF6.js} +1 -1
- package/dist/client/assets/{error-boundary-DQ5uRgdY.js → error-boundary-_n4elsYx.js} +1 -1
- package/dist/client/assets/extract-connection-data-DS_2GbRy.js +1 -0
- package/dist/client/assets/file-browser-BQ5LNDAg.js +2 -0
- package/dist/client/assets/{form-DAoJifFq.js → form-8XJyhmpO.js} +1 -1
- package/dist/client/assets/grid-view-D_Aa-emn.js +1 -0
- package/dist/client/assets/home-uc024wOV.js +1 -0
- package/dist/client/assets/index--OStx8iM.js +1 -0
- package/dist/client/assets/{index-yjsBu7QA.js → index-BAZLm9w0.js} +2 -2
- package/dist/client/assets/index-BQzGssjd.js +25 -0
- package/dist/client/assets/index-Bj5Q4dXx.css +1 -0
- package/dist/client/assets/{index-DJLvIq1X.js → index-Diri8Ct6.js} +1 -1
- package/dist/client/assets/index-Dl8GoNj7.js +1 -0
- package/dist/client/assets/{index-P_cUV9l9.js → index-LE1qlbhg.js} +1 -1
- package/dist/client/assets/{index-Bos_CuhY.js → index-ZeDSkwHv.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-D_8FFQdU.js → infiniteQueryObserver-yv2IwJ75.js} +1 -1
- package/dist/client/assets/{input-C-GM7dsu.js → input-DHWQboe4.js} +1 -1
- package/dist/client/assets/layout-DsaX6gcJ.js +1 -0
- package/dist/client/assets/localstorage-keys-Ciabbhpd.js +1 -0
- package/dist/client/assets/login-BoFTpuW0.js +1 -0
- package/dist/client/assets/{mcp-oauth-l77m3IWF.js → mcp-oauth-Cik_32Ma.js} +1 -1
- package/dist/client/assets/mcp-server-card-C9lXz3j7.js +1 -0
- package/dist/client/assets/mcp-server-detail-CKjLUZ8-.js +2 -0
- package/dist/client/assets/members-B7KaOevg.js +3 -0
- package/dist/client/assets/{monaco-editor-p_EFt-aT.js → monaco-editor-CyfxpBLo.js} +1 -1
- package/dist/client/assets/{monitoring-CFkcXam_.js → monitoring-71UNkDku.js} +5 -5
- package/dist/client/assets/{oauth-callback-DN_uk9hh.js → oauth-callback-B66O8BPw.js} +1 -1
- package/dist/client/assets/page-BTGK2JIy.js +1 -0
- package/dist/client/assets/page-CJ03HOIm.js +1 -0
- package/dist/client/assets/{plugin-empty-state-CuuSx5zh.js → plugin-empty-state-Dn9tQuRR.js} +1 -1
- package/dist/client/assets/{plugin-header-BpBy7iT0.js → plugin-header-CNqlEglT.js} +1 -1
- package/dist/client/assets/{plugins-CEFWqcJY.js → plugins-Vjr6K9Js.js} +1 -1
- package/dist/client/assets/{popover-u_i609j_.js → popover-CZsr9YrL.js} +1 -1
- package/dist/client/assets/registry-utils-DGqTJkDv.js +1 -0
- package/dist/client/assets/{resizable-Bac7VXSC.js → resizable-kmnSMXLy.js} +1 -1
- package/dist/client/assets/select-CrjtUXd1.js +1 -0
- package/dist/client/assets/settings-BupAfFFs.js +1 -0
- package/dist/client/assets/shell-layout-Ckg9pQSt.js +12 -0
- package/dist/client/assets/{spinner-Duo6KesX.js → spinner-CQdhmUjg.js} +1 -1
- package/dist/client/assets/{store-invite-CyZGTGUz.js → store-invite-C-ESgBdT.js} +1 -1
- package/dist/client/assets/{switch-DBMrpKuB.js → switch-DT-s9pj3.js} +1 -1
- package/dist/client/assets/table-oiEqEhps.js +1 -0
- package/dist/client/assets/{textarea-ByvgxbRE.js → textarea-wjx2NJJH.js} +1 -1
- package/dist/client/assets/tools-list-BIhDDkg5.js +1 -0
- package/dist/client/assets/{typewriter-title-CZvcEhZW.js → typewriter-title-BfWKHlUW.js} +2 -2
- package/dist/client/assets/use-binding-C5bwm3GP.js +23 -0
- package/dist/client/assets/use-connection-k5RUrkjP.js +1 -0
- package/dist/client/assets/use-create-virtual-mcp-BfrhVnN1.js +1 -0
- package/dist/client/assets/{use-deco-chat-open-C4y7eW_U.js → use-deco-chat-open-BwQGL7z_.js} +1 -1
- package/dist/client/assets/use-list-state-CCCWL8bD.js +1 -0
- package/dist/client/assets/{use-mcp-prompts-SKr2e7l0.js → use-mcp-prompts-DeryV1GR.js} +1 -1
- package/dist/client/assets/{use-members-C8R91dOK.js → use-members-Brv-Zo51.js} +1 -1
- package/dist/client/assets/{use-mobile-CS2zVR4m.js → use-mobile-MoR_lOMO.js} +1 -1
- package/dist/client/assets/use-organization-settings-DtbIWln6.js +1 -0
- package/dist/client/assets/use-virtual-mcp-DfnzITXx.js +1 -0
- package/dist/client/assets/useInfiniteQuery-5yIodymH.js +1 -0
- package/dist/client/assets/useMutation-ffySYpQB.js +1 -0
- package/dist/client/assets/useQuery-Da0DsMDg.js +1 -0
- package/dist/client/assets/{view-mode-toggle-zGyN0eoT.js → view-mode-toggle-DsKf8ZTT.js} +1 -1
- package/dist/client/assets/workflow-BxPDjOre.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +149 -149
- package/dist/server/migrate.js +128 -128
- package/dist/server/node_modules/kysely/dist/cjs/kysely.js +4 -1
- package/dist/server/node_modules/kysely/dist/cjs/query-compiler/default-query-compiler.js +4 -4
- package/dist/server/node_modules/kysely/dist/esm/kysely.js +4 -1
- package/dist/server/node_modules/kysely/dist/esm/query-compiler/default-query-compiler.js +4 -4
- package/dist/server/node_modules/kysely/package.json +9 -9
- package/dist/server/server.js +130 -130
- package/package.json +1 -1
- package/dist/client/assets/agent-detail-DEjCff0P.js +0 -1
- package/dist/client/assets/agents-C0Oa7sFF.js +0 -1
- package/dist/client/assets/alert-dialog-BYFUia7V.js +0 -7
- package/dist/client/assets/avatar-B6WhQiHI.js +0 -1
- package/dist/client/assets/badge-D19NcG12.js +0 -1
- package/dist/client/assets/collection-tab-DxItkIfa.js +0 -1
- package/dist/client/assets/collection-table-wrapper-igJ5OqPc.js +0 -1
- package/dist/client/assets/connect-CtxQyDSW.js +0 -1
- package/dist/client/assets/connection-card-GHfjxhQ1.js +0 -1
- package/dist/client/assets/connection-detail-sqbtlWZ0.js +0 -1
- package/dist/client/assets/connections-DeNXDjso.js +0 -1
- package/dist/client/assets/constants-gYpJq1UH.js +0 -1
- package/dist/client/assets/dropdown-menu-CsYNL9oo.js +0 -1
- package/dist/client/assets/dynamic-plugin-layout-bKoth3Ne.js +0 -1
- package/dist/client/assets/extract-connection-data-B6LHMHtn.js +0 -1
- package/dist/client/assets/file-browser-xiIO0qLw.js +0 -2
- package/dist/client/assets/grid-view-Bj9WDB_-.js +0 -1
- package/dist/client/assets/home-BgLX6VJQ.js +0 -1
- package/dist/client/assets/index-BhNLW4h1.js +0 -1
- package/dist/client/assets/index-CU94_QoM.css +0 -1
- package/dist/client/assets/index-CsOz92iP.js +0 -25
- package/dist/client/assets/index-GUdoiFzV.js +0 -1
- package/dist/client/assets/layout-D8G7uVC8.js +0 -1
- package/dist/client/assets/localstorage-keys-C_mtBNzA.js +0 -1
- package/dist/client/assets/login-FPJg9vSY.js +0 -1
- package/dist/client/assets/mcp-server-card-D5sj_LDb.js +0 -1
- package/dist/client/assets/mcp-server-detail-BFJxlaGZ.js +0 -2
- package/dist/client/assets/members-D6XXyYMu.js +0 -3
- package/dist/client/assets/page-BityQMBs.js +0 -1
- package/dist/client/assets/page-D2S0EYIA.js +0 -1
- package/dist/client/assets/pin-to-sidebar-button-qPJJKT8U.js +0 -1
- package/dist/client/assets/registry-utils-BNFgymSf.js +0 -1
- package/dist/client/assets/resource-tabs-CE-63rPp.js +0 -1
- package/dist/client/assets/select-B4SPtD5h.js +0 -1
- package/dist/client/assets/settings-CoEwEtT9.js +0 -1
- package/dist/client/assets/shell-layout-BH2X3Yeb.js +0 -12
- package/dist/client/assets/table-NP0FOAI5.js +0 -1
- package/dist/client/assets/tools-list-gkMtCYZf.js +0 -1
- package/dist/client/assets/use-binding-CNR8kDE7.js +0 -23
- package/dist/client/assets/use-collections-Hp9XPnUY.js +0 -1
- package/dist/client/assets/use-connection-Dj100t8H.js +0 -1
- package/dist/client/assets/use-create-virtual-mcp-B01dvSQa.js +0 -1
- package/dist/client/assets/use-list-state-DsM4HMGd.js +0 -1
- package/dist/client/assets/use-organization-settings-ClYOYczD.js +0 -1
- package/dist/client/assets/use-virtual-mcp-XGRCLjSr.js +0 -1
- package/dist/client/assets/useInfiniteQuery-C34Ot4VI.js +0 -1
- package/dist/client/assets/useMutation-VOj1VEf8.js +0 -1
- package/dist/client/assets/useQuery-C5RIveiE.js +0 -1
- package/dist/client/assets/workflow-BRSWFGSV.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as v,j as i}from"./index-
|
|
1
|
+
import{c as v,j as i}from"./index-BAZLm9w0.js";import{i as w}from"./Loading01-DCWQbhnz.js";import{i as C}from"./SearchMd-BWXZ4bVC.js";import{I as k}from"./input-DHWQboe4.js";import{c as b}from"./button-nyR0JH2l.js";function R(j){const e=v.c(21),{value:m,onChange:d,placeholder:g,onKeyDown:f,className:p,isSearching:u,disabled:n}=j,x=g===void 0?"Search...":g;let t;e[0]!==p?(t=b("shrink-0 w-full border-b border-border h-12",p),e[0]=p,e[1]=t):t=e[1];const h=n?"cursor-not-allowed opacity-50":"cursor-text";let s;e[2]!==h?(s=b("flex items-center gap-2.5 h-12 px-4",h),e[2]=h,e[3]=s):s=e[3];let r;e[4]!==u?(r=u?i.jsx(w,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):i.jsx(C,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=u,e[5]=r):r=e[5];let o;e[6]!==d?(o=N=>d(N.target.value),e[6]=d,e[7]=o):o=e[7];let l;e[8]!==n||e[9]!==f||e[10]!==x||e[11]!==o||e[12]!==m?(l=i.jsx(k,{value:m,onChange:o,onKeyDown:f,placeholder:x,disabled:n,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[8]=n,e[9]=f,e[10]=x,e[11]=o,e[12]=m,e[13]=l):l=e[13];let a;e[14]!==s||e[15]!==r||e[16]!==l?(a=i.jsxs("label",{className:s,children:[r,l]}),e[14]=s,e[15]=r,e[16]=l,e[17]=a):a=e[17];let c;return e[18]!==t||e[19]!==a?(c=i.jsx("div",{className:t,children:a}),e[18]=t,e[19]=a,e[20]=c):c=e[20],c}export{R as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as Ae,j as t,w as Xe,g as Ye,u as Ze,r as et,t as tt}from"./index-BAZLm9w0.js";import{g as $e}from"./generate-id-Dyweu44Y.js";import{a as st,C as Me}from"./collection-table-wrapper-Ad_-F1tG.js";import{C as ot}from"./collection-search-DgJbkAZh.js";import{C as it}from"./card-DVnhjUGd.js";import{I as Fe,E as nt}from"./empty-state-Z8nGys2S.js";import{D as ke,a as Ke,b as Ue,c as k}from"./dropdown-menu-BUrC7H_I.js";import{B as Ie}from"./button-nyR0JH2l.js";import{a as Le}from"./Copy01-C6IJYSqu.js";import{i as Be}from"./DotsVertical-BpzYqYSl.js";import{i as Ve}from"./Edit01-BObRJWWQ.js";import{s as Re,U as rt,u as lt}from"./use-list-state-CCCWL8bD.js";import{s as We}from"./Trash01-C_hJOK44.js";import{E as Oe}from"./empty-state-C0f9rz3s.js";import{n as ze}from"./Inbox01-Dn_ZLwmj.js";import{B as at}from"./constants-DpsR0LZe.js";import{A as ct,g as dt,c as pt,b as mt,d as ut,e as ft,a as ht,f as xt}from"./alert-dialog-CHAGlLFb.js";import{u as gt,b as jt}from"./use-connection-k5RUrkjP.js";import{u as Ct}from"./constants-CJQnv32m.js";import{s as vt}from"./Plus-CG8dB40n.js";import{V as bt}from"./layout-DsaX6gcJ.js";function yt(n,e){const s=n.properties||{};for(const i in s){const l=s[i];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const r=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of r)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function Nt(n){const e=Ae.c(25),{item:s,schema:r,actions:i}=n;let l;e[0]!==s||e[1]!==r?(l=yt(r,s),e[0]=s,e[1]=r,e[2]=l):l=e[2];const u=l,p=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let j;e[3]!==i?(j=i&&Object.keys(i).length>0,e[3]=i,e[4]=j):j=e[4];const o=j;let m;e[5]!==u||e[6]!==s.title?(m=t.jsx(Fe,{icon:u,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=u,e[6]=s.title,e[7]=m):m=e[7];let f;e[8]!==s.title?(f=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=f):f=e[9];const d=p||"No description";let c;e[10]!==d?(c=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:d}),e[10]=d,e[11]=c):c=e[11];let C;e[12]!==f||e[13]!==c?(C=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[f,c]}),e[12]=f,e[13]=c,e[14]=C):C=e[14];let y;e[15]!==m||e[16]!==C?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[m,C]}),e[15]=m,e[16]=C,e[17]=y):y=e[17];let a;e[18]!==i||e[19]!==o||e[20]!==s?(a=o&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:_t,onMouseDown:Dt,children:t.jsxs(ke,{children:[t.jsx(Ke,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:St,children:t.jsx(Be,{size:20})})}),t.jsxs(Ue,{align:"end",onClick:wt,children:[i.open&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.open?.(s)},children:[t.jsx(Re,{size:16}),"Open"]}),i.edit&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.edit?.(s)},children:[t.jsx(Ve,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.duplicate?.(s)},children:[t.jsx(Le,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(k,{variant:"destructive",onClick:h=>{h.stopPropagation(),i.delete?.(s)},children:[t.jsx(We,{size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=o,e[20]=s,e[21]=a):a=e[21];let S;return e[22]!==y||e[23]!==a?(S=t.jsxs(it,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,a]}),e[22]=y,e[23]=a,e[24]=S):S=e[24],S}function wt(n){return n.stopPropagation()}function St(n){return n.stopPropagation()}function Dt(n){return n.stopPropagation()}function _t(n){return n.stopPropagation()}const At=["icon","avatar","logo"],Ee=["created_at","created_by","id"];function It(n){return Object.keys(n).find(e=>At.includes(e.toLowerCase()))}function Ge(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Pt(n){const e=Ae.c(32),{data:s,schema:r,viewMode:i,onViewModeChange:l,search:u,sortKey:p,sortDirection:j,onSort:o,actions:m,onItemClick:f,headerActions:d,emptyState:c,readOnly:C,columns:y,hideToolbar:a,sortableFields:S}=n,h=l===void 0?Et:l,x=j===void 0?"asc":j,P=o===void 0?zt:o;let v;e[0]!==m?(v=m===void 0?{}:m,e[0]=m,e[1]=v):v=e[1];const D=v,_=f===void 0?Ot:f,z=d===void 0?null:d,b=c===void 0?null:c,T=C===void 0?!1:C,N=y===void 0?void 0:y,F=a===void 0?!1:a,w=S===void 0?void 0:S;let E;e[2]!==N||e[3]!==r||e[4]!==w?(E=N?N.filter($t).filter(M=>!w||w.includes(M.id)).map(Tt):Ge(r,w),e[2]=N,e[3]=r,e[4]=w,e[5]=E):E=e[5];const $=E;let A;e[6]!==z||e[7]!==F||e[8]!==P||e[9]!==h||e[10]!==x||e[11]!==p||e[12]!==$||e[13]!==i?(A=!F&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:z}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Me,{viewMode:i,onViewModeChange:h,sortKey:p,sortDirection:x,onSort:P,sortOptions:$})})]})}),e[6]=z,e[7]=F,e[8]=P,e[9]=h,e[10]=x,e[11]=p,e[12]=$,e[13]=i,e[14]=A):A=e[14];let O;e[15]!==D||e[16]!==N||e[17]!==s||e[18]!==b||e[19]!==_||e[20]!==P||e[21]!==T||e[22]!==r||e[23]!==u||e[24]!==x||e[25]!==p||e[26]!==w||e[27]!==i?(O=i==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:b||t.jsx(Oe,{icon:t.jsx(ze,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(M=>t.jsx("div",{onClick:()=>_?.(M),className:"cursor-pointer h-full",children:t.jsx(Nt,{item:M,schema:r,readOnly:T,actions:D})},M.id))})}):t.jsx(st,{columns:kt(N,r,w,D),data:s,sortKey:p,sortDirection:x,onSort:P,onRowClick:_,emptyState:b||t.jsx(Oe,{icon:t.jsx(ze,{size:36,className:"text-muted-foreground"}),title:"No items found",description:u?"Try adjusting your search":"No items to display"})}),e[15]=D,e[16]=N,e[17]=s,e[18]=b,e[19]=_,e[20]=P,e[21]=T,e[22]=r,e[23]=u,e[24]=x,e[25]=p,e[26]=w,e[27]=i,e[28]=O):O=e[28];let I;return e[29]!==A||e[30]!==O?(I=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[A,O]}),e[29]=A,e[30]=O,e[31]=I):I=e[31],I}function Tt(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function $t(n){return n.sortable!==!1}function Ot(){}function zt(){}function Et(){}function Mt(n){return{id:"actions",header:"",render:e=>t.jsxs(ke,{children:[t.jsx(Ke,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Be,{size:20})})}),t.jsxs(Ue,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Re,{size:16}),"Open"]}),n.edit&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Ve,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Le,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(k,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(We,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function He(n){const e=n.type;return Array.isArray(e)?e.every(s=>He({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function Ft(n,e){const s=n.properties||{},r=Object.keys(s).filter(o=>{const m=s[o];return m&&He(m)}),i=It(s),l=[],u=new Set;i&&r.includes(i)&&(l.push(i),u.add(i));const p=["title","description","updated_at","updated_by"];for(const o of p)r.includes(o)&&!u.has(o)&&(l.push(o),u.add(o));const j=r.filter(o=>!u.has(o)&&!Ee.includes(o)).sort((o,m)=>o.localeCompare(m));for(const o of j)l.push(o),u.add(o);for(const o of Ee)r.includes(o)&&!u.has(o)&&(l.push(o),u.add(o));return l.map(o=>{const m=s[o],f=e?e.includes(o):!["id"].includes(o);return o===i?{id:o,header:"",render:d=>{const c=d[o];return t.jsx(Fe,{icon:c,name:d.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(c)})},sortable:f,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx(rt,{id:String(c),size:"xs"}):"—"},sortable:f,cellClassName:"max-w-[250px]"}:m?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx("span",{className:"block truncate max-w-full",children:new Date(c).toLocaleDateString()}):"—"},sortable:f,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(c)})},sortable:f,cellClassName:"max-w-[200px]"}})}function kt(n,e,s,r){const i=n||Ft(e,s);return i.some(p=>p.id==="actions")?i:Object.keys(r).length>0?[...i,Mt(r)]:i}function ls(n){const e=Ae.c(113),{connectionId:s,org:r,activeCollection:i}=n,l=i.name,u=i.schema??at,p=i.hasCreateTool,j=i.hasUpdateTool,o=i.hasDeleteTool,m=Xe(),{data:f}=Ye.useSession(),d=f?.user?.id||"unknown",{org:c}=Ze();let C;e[0]!==s||e[1]!==c.id?(C={connectionId:s,orgId:c.id},e[0]=s,e[1]=c.id,e[2]=C):C=e[2];const y=Ct(C),a=gt(s,l,y),S=`${s}-${l}`;let h;e[3]!==r||e[4]!==S?(h={namespace:r,resource:S,defaultSortKey:"updated_at"},e[3]=r,e[4]=S,e[5]=h):h=e[5];const{search:x,searchTerm:P,setSearch:v,viewMode:D,setViewMode:_,sortKey:z,sortDirection:b,handleSort:T}=lt(h);let N;e[6]!==P||e[7]!==b||e[8]!==z?(N={searchTerm:P,sortKey:z,sortDirection:b},e[6]=P,e[7]=b,e[8]=z,e[9]=N):N=e[9];const F=jt(s,l,y,N),w=!p&&!j&&!o;let E;e[10]!==l||e[11]!==s||e[12]!==m||e[13]!==r?(E=g=>{m({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:r,connectionId:s,collectionName:l,itemId:g.id}})},e[10]=l,e[11]=s,e[12]=m,e[13]=r,e[14]=E):E=e[14];const $=E;let A;e[15]!==a.create||e[16]!==d?(A=async g=>{const me=new Date().toISOString();await a.create.mutateAsync({...g,id:$e("conn"),title:`${g.title} (Copy)`,created_at:me,updated_at:me,created_by:d,updated_by:d})},e[15]=a.create,e[16]=d,e[17]=A):A=e[17];const O=A,[I,M]=et.useState(null);let oe;e[18]===Symbol.for("react.memo_cache_sentinel")?(oe=g=>{M(g)},e[18]=oe):oe=e[18];const Je=oe;let K;e[19]!==$||e[20]!==j?(K=j&&{edit:$},e[19]=$,e[20]=j,e[21]=K):K=e[21];let U;e[22]!==O||e[23]!==p?(U=p&&{duplicate:O},e[22]=O,e[23]=p,e[24]=U):U=e[24];let L;e[25]!==o?(L=o&&{delete:Je},e[25]=o,e[26]=L):L=e[26];let ie;e[27]!==L||e[28]!==K||e[29]!==U?(ie={...K,...U,...L},e[27]=L,e[28]=K,e[29]=U,e[30]=ie):ie=e[30];const ue=ie;let ne;e[31]!==a.delete||e[32]!==I?(ne=async()=>{I&&(await a.delete.mutateAsync(I.id),M(null))},e[31]=a.delete,e[32]=I,e[33]=ne):ne=e[33];const fe=ne;let re;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==p||e[38]!==m||e[39]!==r||e[40]!==d?(re=async()=>{if(!p){tt.error("Create operation is not available for this collection");return}const g=new Date().toISOString(),me={id:$e("conn"),title:"New Item",description:"A brief description of the item",created_at:g,updated_at:g,created_by:d,updated_by:d};try{const _e=await a.create.mutateAsync(me);m({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:r,connectionId:s,collectionName:l,itemId:_e.id}})}catch(_e){console.error("Failed to create item:",_e)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=p,e[38]=m,e[39]=r,e[40]=d,e[41]=re):re=e[41];const he=re;let le;e[42]!==u?(le=Ge(u),e[42]=u,e[43]=le):le=e[43];const xe=le,Pe=(F?.length??0)>0,qe=p&&Pe,Qe=p&&!Pe&&!x;let ae;e[44]!==a.create||e[45]!==he||e[46]!==p?(ae=p?t.jsxs(Ie,{onClick:he,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(vt,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=he,e[46]=p,e[47]=ae):ae=e[47];const Te=ae,ge=z;let B;e[48]!==T||e[49]!==_||e[50]!==b||e[51]!==xe||e[52]!==ge||e[53]!==D?(B=t.jsx(Me,{viewMode:D,onViewModeChange:_,sortKey:ge,sortDirection:b,onSort:T,sortOptions:xe}),e[48]=T,e[49]=_,e[50]=b,e[51]=xe,e[52]=ge,e[53]=D,e[54]=B):B=e[54];const je=qe&&Te;let V;e[55]!==B||e[56]!==je?(V=t.jsxs(bt,{children:[B,je]}),e[55]=B,e[56]=je,e[57]=V):V=e[57];const Ce=`Search ${l}...`;let R;e[58]!==v?(R=g=>{g.key==="Escape"&&(v(""),g.target.blur())},e[58]=v,e[59]=R):R=e[59];let W;e[60]!==x||e[61]!==v||e[62]!==Ce||e[63]!==R?(W=t.jsx(ot,{value:x,onChange:v,placeholder:Ce,onKeyDown:R}),e[60]=x,e[61]=v,e[62]=Ce,e[63]=R,e[64]=W):W=e[64];let G;e[65]!==F?(G=F??[],e[65]=F,e[66]=G):G=e[66];const ve=z;let H;e[67]!==$?(H=g=>$(g),e[67]=$,e[68]=H):H=e[68];const be="No items found",ye=x?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ne=Qe?Te:void 0;let J;e[69]!==be||e[70]!==ye||e[71]!==Ne?(J=t.jsx(nt,{image:null,title:be,description:ye,actions:Ne}),e[69]=be,e[70]=ye,e[71]=Ne,e[72]=J):J=e[72];let q;e[73]!==T||e[74]!==w||e[75]!==ue||e[76]!==u||e[77]!==x||e[78]!==v||e[79]!==_||e[80]!==b||e[81]!==G||e[82]!==ve||e[83]!==H||e[84]!==J||e[85]!==D?(q=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Pt,{hideToolbar:!0,data:G,schema:u,viewMode:D,onViewModeChange:_,search:x,onSearchChange:v,sortKey:ve,sortDirection:b,onSort:T,actions:ue,onItemClick:H,readOnly:w,emptyState:J})}),e[73]=T,e[74]=w,e[75]=ue,e[76]=u,e[77]=x,e[78]=v,e[79]=_,e[80]=b,e[81]=G,e[82]=ve,e[83]=H,e[84]=J,e[85]=D,e[86]=q):q=e[86];let Q;e[87]!==W||e[88]!==q?(Q=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[W,q]}),e[87]=W,e[88]=q,e[89]=Q):Q=e[89];const we=!!I;let ce;e[90]===Symbol.for("react.memo_cache_sentinel")?(ce=g=>{g||M(null)},e[90]=ce):ce=e[90];let de;e[91]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx(pt,{children:"Delete item?"}),e[91]=de):de=e[91];const Se=I?.title;let X;e[92]!==Se?(X=t.jsxs(mt,{children:[de,t.jsxs(ut,{children:['Are you sure you want to delete "',Se,'"? This action cannot be undone.']})]}),e[92]=Se,e[93]=X):X=e[93];let Y;e[94]!==a.delete.isPending?(Y=t.jsx(ct,{disabled:a.delete.isPending,children:"Cancel"}),e[94]=a.delete.isPending,e[95]=Y):Y=e[95];const De=a.delete.isPending?"Deleting...":"Delete";let Z;e[96]!==a.delete.isPending||e[97]!==fe||e[98]!==De?(Z=t.jsx(dt,{onClick:fe,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:De}),e[96]=a.delete.isPending,e[97]=fe,e[98]=De,e[99]=Z):Z=e[99];let ee;e[100]!==Y||e[101]!==Z?(ee=t.jsxs(ft,{children:[Y,Z]}),e[100]=Y,e[101]=Z,e[102]=ee):ee=e[102];let te;e[103]!==X||e[104]!==ee?(te=t.jsxs(ht,{children:[X,ee]}),e[103]=X,e[104]=ee,e[105]=te):te=e[105];let se;e[106]!==we||e[107]!==te?(se=t.jsx(xt,{open:we,onOpenChange:ce,children:te}),e[106]=we,e[107]=te,e[108]=se):se=e[108];let pe;return e[109]!==V||e[110]!==Q||e[111]!==se?(pe=t.jsxs(t.Fragment,{children:[V,Q,se]}),e[109]=V,e[110]=Q,e[111]=se,e[112]=pe):pe=e[112],pe}export{ls as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as k,c as T,j as t}from"./index-BAZLm9w0.js";import{c as y,B as L}from"./button-nyR0JH2l.js";import{c as E,a as V,D as B,b as $}from"./dropdown-menu-BUrC7H_I.js";import{i as D}from"./ArrowUp-BzVEz2lB.js";import{i as R}from"./Check-Dzm8t_lx.js";import{c as H}from"./Grid01-DB4psHwp.js";import{i as W}from"./List-BeVMnZSE.js";import{c as I,b as K,T as _,a as A}from"./empty-state-Z8nGys2S.js";import{V as O}from"./view-mode-toggle-DsKf8ZTT.js";import{T as P,a as q,b as z,c as F,d as G,e as J}from"./table-oiEqEhps.js";const S=({size:p=24,color:e="currentColor",...s})=>k.createElement("svg",{viewBox:"0 0 24 24",width:p,height:p,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},k.createElement("path",{d:"M12 5v14m0 0 7-7m-7 7-7-7"}));S.displayName="ArrowDown";const M=({size:p=24,color:e="currentColor",...s})=>k.createElement("svg",{viewBox:"0 0 24 24",width:p,height:p,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},k.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));M.displayName="Sliders01";function ie(p){const e=T.c(16),{viewMode:s,onViewModeChange:x,sortKey:u,sortDirection:d,onSort:a,sortOptions:i}=p;let l;e[0]!==i?(l=i===void 0?[]:i,e[0]=i,e[1]=l):l=e[1];const m=l;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(I,{children:t.jsxs(K,{children:[t.jsx(_,{asChild:!0,children:t.jsx(V,{asChild:!0,children:t.jsx(L,{variant:"outline",size:"icon",className:"size-7 border border-input",children:t.jsx(M,{size:16})})})}),t.jsx(A,{children:"Search filters"})]})}),e[2]=h):h=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c={value:"table",icon:t.jsx(W,{})},e[3]=c):c=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=[c,{value:"cards",icon:t.jsx(H,{})}],e[4]=r):r=e[4];let o;e[5]!==x||e[6]!==s?(o=t.jsx("div",{className:"p-2 border-b border-border",children:t.jsx(O,{value:s,onValueChange:x,fullWidth:!0,options:r})}),e[5]=x,e[6]=s,e[7]=o):o=e[7];let f;e[8]!==a||e[9]!==d||e[10]!==u||e[11]!==m?(f=m.length>0&&a&&t.jsxs("div",{className:"p-1 flex flex-col gap-0.5",children:[t.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),m.map(j=>{const w=u===j.id;return t.jsx(E,{onClick:()=>a(j.id),className:y("h-8 px-2 py-0 cursor-pointer",w&&"bg-accent"),children:t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[w&&t.jsx(R,{size:16,className:"text-foreground shrink-0"}),!w&&t.jsx("div",{className:"w-4 shrink-0"}),t.jsx("span",{className:"text-sm text-foreground flex-1",children:j.label}),w&&d&&(d==="asc"?t.jsx(D,{size:16,className:"text-foreground shrink-0"}):t.jsx(S,{size:16,className:"text-foreground shrink-0"}))]})},j.id)})]}),e[8]=a,e[9]=d,e[10]=u,e[11]=m,e[12]=f):f=e[12];let g;return e[13]!==o||e[14]!==f?(g=t.jsxs(B,{children:[h,t.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[o,f]})]}),e[13]=o,e[14]=f,e[15]=g):g=e[15],g}function Q(p){const e=T.c(29),{columns:s,data:x,sortKey:u,sortDirection:d,onSort:a,onRowClick:i,rowClassName:l}=p;let m;e[0]!==d?(m=function(n,N){return t.jsx("div",{className:"w-4 flex items-center justify-center",children:N&&d&&(d==="asc"?t.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}):t.jsx(S,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=d,e[1]=m):m=e[1];const h=m;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=function(n,N){let C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return n===N-1&&(C="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),C},e[2]=c):c=e[2];const r=c;let o;if(e[3]!==s||e[4]!==a||e[5]!==h||e[6]!==u){let b;e[8]!==s.length||e[9]!==a||e[10]!==h||e[11]!==u?(b=(n,N)=>{const C=u===n.id;return t.jsx(P,{className:y(r(N,s.length),"group transition-colors select-none",n.sortable&&"hover:bg-accent cursor-pointer",n.rowClassName,n.cellClassName),onClick:n.sortable&&a?()=>a(n.id):void 0,children:t.jsxs("span",{className:"flex items-center gap-1",children:[n.header,n.sortable&&h(n.id,C)]})},n.id)},e[8]=s.length,e[9]=a,e[10]=h,e[11]=u,e[12]=b):b=e[12],o=s.map(b),e[3]=s,e[4]=a,e[5]=h,e[6]=u,e[7]=o}else o=e[7];let f;e[13]!==o?(f=t.jsx(q,{className:"border-b-0",children:t.jsx(z,{className:"h-9 hover:bg-transparent border-b border-border",children:o})}),e[13]=o,e[14]=f):f=e[14];let g;if(e[15]!==s||e[16]!==x||e[17]!==i||e[18]!==l){let b;e[20]!==s||e[21]!==i||e[22]!==l?(b=(n,N)=>{const C=l?.(n);return t.jsx(z,{"data-row-index":N,className:y("group/data-row transition-colors border-b-0 hover:bg-accent/50",i?"cursor-pointer":"",C),onClick:i?()=>i(n):void 0,children:s.map(v=>t.jsx(F,{className:y("px-5 py-4 h-16 align-middle text-sm text-foreground",v.cellClassName,v.wrap?"whitespace-normal wrap-break-word":""),children:t.jsx("div",{className:y(v.wrap?"w-full":"min-w-0 w-full",!v.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:v.render?v.render(n):v.accessor?v.accessor(n):null})},v.id))},N)},e[20]=s,e[21]=i,e[22]=l,e[23]=b):b=e[23],g=x.map(b),e[15]=s,e[16]=x,e[17]=i,e[18]=l,e[19]=g}else g=e[19];let j;e[24]!==g?(j=t.jsx(G,{children:g}),e[24]=g,e[25]=j):j=e[25];let w;return e[26]!==f||e[27]!==j?(w=t.jsxs(J,{className:"w-full border-collapse",children:[f,j]}),e[26]=f,e[27]=j,e[28]=w):w=e[28],w}function ae(p){const e=T.c(12),{columns:s,data:x,isLoading:u,sortKey:d,sortDirection:a,onSort:i,onRowClick:l,emptyState:m}=p;if(u===void 0?!1:u){let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"flex items-center justify-center h-full",children:t.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=r):r=e[0],r}if(x.length===0){let r;e[1]!==m?(r=m||t.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=m,e[2]=r):r=e[2];let o;return e[3]!==r?(o=t.jsx("div",{className:"flex items-center justify-center h-full",children:r}),e[3]=r,e[4]=o):o=e[4],o}let c;return e[5]!==s||e[6]!==x||e[7]!==l||e[8]!==i||e[9]!==a||e[10]!==d?(c=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Q,{columns:s,data:x,sortKey:d,sortDirection:a,onSort:i,onRowClick:l})}),e[5]=s,e[6]=x,e[7]=l,e[8]=i,e[9]=a,e[10]=d,e[11]=c):c=e[11],c}export{ie as C,ae as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as x,j as u}from"./index-BAZLm9w0.js";import{c as m}from"./button-nyR0JH2l.js";import{B as g}from"./badge-BMiZ-mom.js";function v(f){const e=x.c(12),{tabs:l,activeTab:n,onTabChange:s,className:a}=f;let t;e[0]!==a?(t=m("flex items-center gap-2 overflow-x-auto no-scrollbar",a),e[0]=a,e[1]=t):t=e[1];let r;if(e[2]!==n||e[3]!==s||e[4]!==l){let c;e[6]!==n||e[7]!==s?(c=o=>{const d=n===o.id;return u.jsxs("button",{type:"button",onClick:()=>s(o.id),className:m("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex gap-1.5 items-center",d&&"bg-accent border-border text-foreground",!d&&"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:[o.label,o.count!==void 0&&u.jsx(g,{variant:"secondary",className:m("h-5 min-w-5 px-1 rounded-full text-[10px] font-mono inline-flex items-center justify-center",d?"bg-background text-foreground":"bg-muted-foreground/10 text-muted-foreground"),children:o.count})]},o.id)},e[6]=n,e[7]=s,e[8]=c):c=e[8],r=l.map(c),e[2]=n,e[3]=s,e[4]=l,e[5]=r}else r=e[5];let i;return e[9]!==t||e[10]!==r?(i=u.jsx("div",{className:t,children:r}),e[9]=t,e[10]=r,e[11]=i):i=e[11],i}export{v as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as T,bm as M,j as e,bn as P,F as q,r as R,t as h,a as O}from"./index-BAZLm9w0.js";import{u as A}from"./useQuery-Da0DsMDg.js";import{u as _}from"./useMutation-ffySYpQB.js";import{B as y}from"./button-nyR0JH2l.js";import{C as N,a as v}from"./card-DVnhjUGd.js";import{i as L,a as U}from"./mcp-oauth-Cik_32Ma.js";import{c as C,C as K,a as k}from"./circle-alert-D0fEJodr.js";const Q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],D=C("external-link",Q);const H=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],w=C("loader-circle",H);const J=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],B=C("refresh-cw",J),Y=t=>{const n=T.c(6);let i;n[0]!==t?({...i}=t,n[0]=t,n[1]=i):i=n[1];const{theme:a}=M(),d=a===void 0?"system":a;let r;n[2]===Symbol.for("react.memo_cache_sentinel")?(r={"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},n[2]=r):r=n[2];let m;return n[3]!==i||n[4]!==d?(m=e.jsx(P,{theme:d,className:"toaster group",style:r,...i}),n[3]=i,n[4]=d,n[5]=m):m=n[5],m},b={session:t=>["user-sandbox-session",t]};function V({sessionId:t,onComplete:n,onError:i}){const a=q(),[p,d]=R.useState(null),{data:r,isLoading:m,error:j}=A({queryKey:b.session(t),queryFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}`);if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to load session")}return s.json()}}),F=_({mutationFn:async({appName:s,connectionId:o})=>{const l=await fetch(`/api/user-sandbox/sessions/${t}/configure`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s,connection_id:o})});if(!l.ok){const u=await l.json();throw new Error(u.error||"Configuration failed")}return l.json()},onSuccess:()=>{a.invalidateQueries({queryKey:b.session(t)})}}),x=_({mutationFn:async()=>{const s=await fetch(`/api/user-sandbox/sessions/${t}/complete`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!s.ok){const o=await s.json();throw new Error(o.error||"Failed to complete")}return s.json()},onSuccess:s=>{s.redirectUrl?window.location.href=s.redirectUrl:(h.success("Setup complete!"),a.invalidateQueries({queryKey:b.session(t)}),n?.({agentId:s.agentId,redirectUrl:s.redirectUrl}))},onError:s=>{const o=s instanceof Error?s:new Error("Failed to complete");h.error(o.message),i?.(o)}}),S=async s=>{d(s.app_name);try{const o=await fetch(`/api/user-sandbox/sessions/${t}/provision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:s.app_name})});if(!o.ok){const g=await o.json();throw new Error(g.error||"Failed to provision connection")}const u=(await o.json()).connection_id;if(s.connection_type==="HTTP"||s.connection_type==="SSE"||s.connection_type==="Websocket"){const g=`/mcp/${u}`,z=await L({url:g,token:null});if(!z.isAuthenticated&&z.supportsOAuth){h.info("Opening authentication window...");const c=await U({connectionId:u,clientName:s.title,timeout:3e5});if(c.error)throw new Error(c.error);if(c.tokenInfo){const E=await fetch(`/api/connections/${u}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:c.tokenInfo.accessToken,refreshToken:c.tokenInfo.refreshToken,expiresIn:c.tokenInfo.expiresIn,scope:c.tokenInfo.scope,clientId:c.tokenInfo.clientId,clientSecret:c.tokenInfo.clientSecret,tokenEndpoint:c.tokenInfo.tokenEndpoint})});if(!E.ok){const $=await E.json().catch(()=>({}));throw new Error($.error||"Failed to save authentication tokens. Please try again.")}}}}await F.mutateAsync({appName:s.app_name,connectionId:u}),h.success(`${s.title} connected successfully`)}catch(o){console.error("Connection error:",o);const l=o instanceof Error?o:new Error("Failed to connect");h.error(l.message),i?.(l)}finally{d(null)}},I=r?.apps.every(s=>s.status.configured),f=r?.session.status==="completed";return m?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(w,{className:"size-8 animate-spin text-muted-foreground"})}):j?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsx(N,{className:"max-w-md w-full",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("div",{className:"size-12 rounded-full bg-destructive/10 flex items-center justify-center",children:e.jsx(K,{className:"size-6 text-destructive"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Session Error"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:j instanceof Error?j.message:"Failed to load"})]})]})})})}):r?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Y,{}),e.jsxs("div",{className:"max-w-lg mx-auto px-4 py-12",children:[e.jsxs("div",{className:"text-center mb-8",children:[r.template.icon&&e.jsx("div",{className:"size-16 mx-auto mb-4 rounded-xl bg-muted flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:r.template.icon,alt:"",className:"size-10 object-contain"})}),e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:r.template.title}),r.template.description&&e.jsx("p",{className:"text-muted-foreground mt-2",children:r.template.description})]}),f&&e.jsx(N,{className:"mb-6 border-green-500/20 bg-green-500/5",children:e.jsx(v,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"size-10 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-5 text-green-500"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Setup Complete"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your integrations are ready to use."})]})]})})}),e.jsx("div",{className:"space-y-3",children:r.apps.map(s=>e.jsx(N,{children:e.jsx(v,{className:"py-4",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"size-10 rounded-lg bg-muted flex items-center justify-center shrink-0 overflow-hidden",children:s.icon?e.jsx("img",{src:s.icon,alt:"",className:"size-6 object-contain"}):e.jsx("span",{className:"text-lg",children:"📦"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.status.configured?e.jsxs("span",{className:"text-green-600 dark:text-green-400 flex items-center gap-1",children:[e.jsx(k,{className:"size-3"})," Connected"]}):s.requires_oauth?"Requires authentication":"Ready to connect"})]}),!s.status.configured&&!f&&e.jsx(y,{size:"sm",onClick:()=>S(s),disabled:p!==null||x.isPending,children:p===s.app_name?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Connecting..."]}):e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"size-4 mr-2"}),"Connect"]})}),s.status.configured&&!f&&e.jsxs(y,{size:"sm",variant:"outline",onClick:()=>S(s),disabled:p!==null||x.isPending,children:[e.jsx(B,{className:"size-4 mr-2"}),"Reconnect"]}),f&&e.jsx("div",{className:"size-8 rounded-full bg-green-500/10 flex items-center justify-center",children:e.jsx(k,{className:"size-4 text-green-500"})})]})})},s.app_name))}),I&&!f&&e.jsx("div",{className:"mt-6",children:e.jsx(y,{className:"w-full",size:"lg",onClick:()=>x.mutate(),disabled:x.isPending,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"size-4 mr-2 animate-spin"}),"Completing..."]}):"Complete Setup"})}),e.jsx("div",{className:"mt-8 pt-6 border-t text-center",children:e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Session expires:"," ",new Date(r.session.expires_at).toLocaleString()]})})]})]}):null}function oe(){const t=T.c(3);let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/connect/$sessionId"},t[0]=n):n=t[0];const{sessionId:i}=O(n);let a;return t[1]!==i?(a=e.jsx(V,{sessionId:i}),t[1]=i,t[2]=a):a=t[2],a}export{oe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as $,j as t}from"./index-BAZLm9w0.js";import{C as q}from"./card-DVnhjUGd.js";import{c as N}from"./button-nyR0JH2l.js";import{I as B}from"./empty-state-Z8nGys2S.js";function L(g){const e=$.c(46),{connection:s,onClick:C,headerActions:b,body:k,footer:y,className:I,size:A,fallbackIcon:w}=g,E=A===void 0?"md":A,i=E==="sm"?"p-4":"p-6",P=E==="sm"?"text-sm":"text-base",R=E==="sm"?"text-xs":"text-sm",S=C&&"hover:bg-muted/50";let l;e[0]!==I||e[1]!==S?(l=N("cursor-pointer transition-colors group overflow-hidden flex flex-col",S,I),e[0]=I,e[1]=S,e[2]=l):l=e[2];let o;e[3]!==i?(o=N("flex flex-col gap-4",i),e[3]=i,e[4]=o):o=e[4];let n;e[5]!==s.icon||e[6]!==s.title||e[7]!==w?(n=t.jsx(B,{icon:s.icon,name:s.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:w}),e[5]=s.icon,e[6]=s.title,e[7]=w,e[8]=n):n=e[8];let c;e[9]!==b?(c=b&&t.jsx("div",{className:N("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:F,children:b}),e[9]=b,e[10]=c):c=e[10];let r;e[11]!==c?(r=t.jsx("div",{className:"relative",children:c}),e[11]=c,e[12]=r):r=e[12];let a;e[13]!==n||e[14]!==r?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[n,r]}),e[13]=n,e[14]=r,e[15]=a):a=e[15];let d;e[16]!==P?(d=N("font-medium text-foreground truncate",P),e[16]=P,e[17]=d):d=e[17];let m;e[18]!==s.title||e[19]!==d?(m=t.jsx("h3",{className:d,children:s.title}),e[18]=s.title,e[19]=d,e[20]=m):m=e[20];let f;e[21]!==R?(f=N("text-muted-foreground line-clamp-2",R),e[21]=R,e[22]=f):f=e[22];const _=s.description||"No description";let x;e[23]!==f||e[24]!==_?(x=t.jsx("p",{className:f,children:_}),e[23]=f,e[24]=_,e[25]=x):x=e[25];let p;e[26]!==m||e[27]!==x?(p=t.jsxs("div",{className:"flex flex-col gap-0",children:[m,x]}),e[26]=m,e[27]=x,e[28]=p):p=e[28];let h;e[29]!==k?(h=k&&t.jsx("div",{children:k}),e[29]=k,e[30]=h):h=e[30];let u;e[31]!==p||e[32]!==h||e[33]!==o||e[34]!==a?(u=t.jsxs("div",{className:o,children:[a,p,h]}),e[31]=p,e[32]=h,e[33]=o,e[34]=a,e[35]=u):u=e[35];let j;e[36]!==y||e[37]!==i?(j=y&&t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:N("h-14 flex items-center",i),onClick:D,children:y})}),e[36]=y,e[37]=i,e[38]=j):j=e[38];let v;e[39]!==u||e[40]!==j?(v=t.jsxs("div",{className:"flex flex-col flex-1",children:[u,j]}),e[39]=u,e[40]=j,e[41]=v):v=e[41];let z;return e[42]!==C||e[43]!==v||e[44]!==l?(z=t.jsx(q,{className:l,onClick:C,children:v}),e[42]=C,e[43]=v,e[44]=l,e[45]=z):z=e[45],z}function D(g){return g.stopPropagation()}function F(g){return g.stopPropagation()}export{L as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as Y,c as U,j as n,w as Re,l as ht,u as pt,bA as tt,ac as Tt,p as Mt,bs as Ye,o as xt,b7 as Dt,bf as It,s as q,ad as nt,ae as At,a as Vt,f as $t,F as Ot,h as Ft,k as Wt,i as Et,t as _e,K as st}from"./index-BAZLm9w0.js";import{I as He,n as Lt,E as ve}from"./empty-state-Z8nGys2S.js";import{E as gt}from"./error-boundary-_n4elsYx.js";import{E as Rt,r as zt,e as bt}from"./env-vars-editor-CGiYkoF6.js";import{P as Ke,S as Xt}from"./index-Dl8GoNj7.js";import{b as Ut,a as Bt}from"./use-binding-C5bwm3GP.js";import{u as qt,S as Yt}from"./index-BQzGssjd.js";import{c as Qe,d as jt,j as Ht}from"./use-connection-k5RUrkjP.js";import{u as Kt}from"./constants-CJQnv32m.js";import{b as Qt,d as Jt}from"./use-mcp-prompts-DeryV1GR.js";import{a as Gt}from"./mcp-oauth-Cik_32Ma.js";import{b as ot,e as Zt,c as en,d as tn,B as nn,a as sn}from"./breadcrumb-BjHn0dWR.js";import{B as Be}from"./button-nyR0JH2l.js";import{C as on}from"./collection-tabs-UYd1fkoS.js";import{i as Le}from"./Loading01-DCWQbhnz.js";import{V as Je,a as rn}from"./layout-DsaX6gcJ.js";import{C as an}from"./collection-tab-BTzm3KZ6.js";import{B as qe}from"./badge-BMiZ-mom.js";import{D as cn,a as ln,b as dn,c as rt}from"./dropdown-menu-BUrC7H_I.js";import{F as J,a as un,b as G,d as K,f as Z,c as ne,e as mn}from"./form-8XJyhmpO.js";import{I as ee}from"./input-DHWQboe4.js";import{S as at,a as it,b as ct,c as lt,d as Q}from"./select-CrjtUXd1.js";import{i as yt}from"./CheckCircle-Dq1sA0pv.js";import{t as fn}from"./ChevronDown-Z3Dyyuvx.js";import{s as Fe}from"./Globe02-DudYvjwY.js";import{i as hn}from"./Terminal-CdMAejVo.js";import{s as pn}from"./Trash01-C_hJOK44.js";import{t as Ge}from"./Users03-DkIVbHWT.js";import{s as xn}from"./XClose-BDdig6o8.js";import{U as gn}from"./use-list-state-CCCWL8bD.js";import{b as bn,a as jn}from"./use-virtual-mcp-DfnzITXx.js";import{i as yn}from"./ChevronRight-DDdY_PC7.js";import{s as vn}from"./Plus-CG8dB40n.js";import{t as Ne,c as vt,d as Nn,m as dt,a as We}from"./differenceInSeconds-NQ4PDo0z.js";import{a as Nt,C as wt}from"./collection-table-wrapper-Ad_-F1tG.js";import{C as St}from"./collection-search-DgJbkAZh.js";import{C as _t}from"./card-DVnhjUGd.js";import{R as wn,T as Sn}from"./tools-list-BIhDDkg5.js";import"./Pin01-WkOPKnTb.js";import"./use-organization-settings-DtbIWln6.js";import"./useMutation-ffySYpQB.js";import"./binder-DC5jbVcK.js";import"./File06-Bwnj0Jvb.js";import"./Key01-Bycaiiyx.js";import"./constants-DpsR0LZe.js";import"./registry-utils-DGqTJkDv.js";import"./extract-connection-data-DS_2GbRy.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./index-Diri8Ct6.js";import"./circle-alert-D0fEJodr.js";import"./index-ZeDSkwHv.js";import"./X-8UbCzOSY.js";import"./collapsible-DJK4gRv1.js";import"./Code01-BWP8EmsE.js";import"./infiniteQueryObserver-yv2IwJ75.js";import"./localstorage-keys-Ciabbhpd.js";import"./useQuery-Da0DsMDg.js";import"./popover-CZsr9YrL.js";import"./Grid01-DB4psHwp.js";import"./Image01-BIunU3ME.js";import"./SearchMd-BWXZ4bVC.js";import"./spinner-CQdhmUjg.js";import"./dialog-DobMZv-a.js";import"./AlertCircle-CyK0Qw5h.js";import"./ArrowUp-BzVEz2lB.js";import"./Edit01-BObRJWWQ.js";import"./Check-Dzm8t_lx.js";import"./Copy01-C6IJYSqu.js";import"./monaco-editor-CyfxpBLo.js";import"./use-create-virtual-mcp-BfrhVnN1.js";import"./index-LE1qlbhg.js";import"./DotsVertical-BpzYqYSl.js";import"./empty-state-C0f9rz3s.js";import"./Inbox01-Dn_ZLwmj.js";import"./alert-dialog-CHAGlLFb.js";import"./use-mobile-MoR_lOMO.js";import"./List-BeVMnZSE.js";import"./view-mode-toggle-DsKf8ZTT.js";import"./table-oiEqEhps.js";const Ct=({size:t=24,color:e="currentColor",...s})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},Y.createElement("path",{d:"M2 10s2.005-2.732 3.634-4.362A9 9 0 1 1 12 21a9.004 9.004 0 0 1-8.648-6.5M2 10V4m0 6h6"}));Ct.displayName="RefreshCcw01";let _n={};function Cn(){return _n}function ut(t){const e=Ne(t),s=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return s.setUTCFullYear(e.getFullYear()),+t-+s}function Ze(t,...e){const s=vt.bind(null,t||e.find(o=>typeof o=="object"));return e.map(s)}function Ee(t,e){const s=+Ne(t)-+Ne(e);return s<0?-1:s>0?1:s}function Pn(t){return vt(t,Date.now())}function kn(t,e,s){const[o,r]=Ze(s?.in,t,e),c=o.getFullYear()-r.getFullYear(),i=o.getMonth()-r.getMonth();return c*12+i}function Tn(t,e){const s=Ne(t);return s.setHours(23,59,59,999),s}function Mn(t,e){const s=Ne(t),o=s.getMonth();return s.setFullYear(s.getFullYear(),o+1,0),s.setHours(23,59,59,999),s}function Dn(t,e){const s=Ne(t);return+Tn(s)==+Mn(s)}function In(t,e,s){const[o,r,c]=Ze(s?.in,t,t,e),i=Ee(r,c),l=Math.abs(kn(r,c));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*l);let m=Ee(r,c)===-i;Dn(o)&&l===1&&Ee(o,c)===1&&(m=!1);const d=i*(l-+m);return d===0?0:d}const An={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Vn=(t,e,s)=>{let o;const r=An[t];return typeof r=="string"?o=r:e===1?o=r.one:o=r.other.replace("{{count}}",e.toString()),s?.addSuffix?s.comparison&&s.comparison>0?"in "+o:o+" ago":o};function Ue(t){return(e={})=>{const s=e.width?String(e.width):t.defaultWidth;return t.formats[s]||t.formats[t.defaultWidth]}}const $n={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},On={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Fn={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Wn={date:Ue({formats:$n,defaultWidth:"full"}),time:Ue({formats:On,defaultWidth:"full"}),dateTime:Ue({formats:Fn,defaultWidth:"full"})},En={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ln=(t,e,s,o)=>En[t];function Ce(t){return(e,s)=>{const o=s?.context?String(s.context):"standalone";let r;if(o==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,l=s?.width?String(s.width):i;r=t.formattingValues[l]||t.formattingValues[i]}else{const i=t.defaultWidth,l=s?.width?String(s.width):t.defaultWidth;r=t.values[l]||t.values[i]}const c=t.argumentCallback?t.argumentCallback(e):e;return r[c]}}const Rn={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},zn={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Xn={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Un={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Bn={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},qn={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Yn=(t,e)=>{const s=Number(t),o=s%100;if(o>20||o<10)switch(o%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},Hn={ordinalNumber:Yn,era:Ce({values:Rn,defaultWidth:"wide"}),quarter:Ce({values:zn,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Ce({values:Xn,defaultWidth:"wide"}),day:Ce({values:Un,defaultWidth:"wide"}),dayPeriod:Ce({values:Bn,defaultWidth:"wide",formattingValues:qn,defaultFormattingWidth:"wide"})};function Pe(t){return(e,s={})=>{const o=s.width,r=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],c=e.match(r);if(!c)return null;const i=c[0],l=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],m=Array.isArray(l)?Qn(l,p=>p.test(i)):Kn(l,p=>p.test(i));let d;d=t.valueCallback?t.valueCallback(m):m,d=s.valueCallback?s.valueCallback(d):d;const x=e.slice(i.length);return{value:d,rest:x}}}function Kn(t,e){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&e(t[s]))return s}function Qn(t,e){for(let s=0;s<t.length;s++)if(e(t[s]))return s}function Jn(t){return(e,s={})=>{const o=e.match(t.matchPattern);if(!o)return null;const r=o[0],c=e.match(t.parsePattern);if(!c)return null;let i=t.valueCallback?t.valueCallback(c[0]):c[0];i=s.valueCallback?s.valueCallback(i):i;const l=e.slice(r.length);return{value:i,rest:l}}}const Gn=/^(\d+)(th|st|nd|rd)?/i,Zn=/\d+/i,es={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ts={any:[/^b/i,/^(a|c)/i]},ns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ss={any:[/1/i,/2/i,/3/i,/4/i]},os={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},rs={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},as={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},is={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},cs={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ls={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ds={ordinalNumber:Jn({matchPattern:Gn,parsePattern:Zn,valueCallback:t=>parseInt(t,10)}),era:Pe({matchPatterns:es,defaultMatchWidth:"wide",parsePatterns:ts,defaultParseWidth:"any"}),quarter:Pe({matchPatterns:ns,defaultMatchWidth:"wide",parsePatterns:ss,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Pe({matchPatterns:os,defaultMatchWidth:"wide",parsePatterns:rs,defaultParseWidth:"any"}),day:Pe({matchPatterns:as,defaultMatchWidth:"wide",parsePatterns:is,defaultParseWidth:"any"}),dayPeriod:Pe({matchPatterns:cs,defaultMatchWidth:"any",parsePatterns:ls,defaultParseWidth:"any"})},us={code:"en-US",formatDistance:Vn,formatLong:Wn,formatRelative:Ln,localize:Hn,match:ds,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ms(t,e,s){const o=Cn(),r=s?.locale??o.locale??us,c=2520,i=Ee(t,e);if(isNaN(i))throw new RangeError("Invalid time value");const l=Object.assign({},s,{addSuffix:s?.addSuffix,comparison:i}),[m,d]=Ze(s?.in,...i>0?[e,t]:[t,e]),x=Nn(d,m),p=(ut(d)-ut(m))/1e3,a=Math.round((x-p)/60);let g;if(a<2)return s?.includeSeconds?x<5?r.formatDistance("lessThanXSeconds",5,l):x<10?r.formatDistance("lessThanXSeconds",10,l):x<20?r.formatDistance("lessThanXSeconds",20,l):x<40?r.formatDistance("halfAMinute",0,l):x<60?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",1,l):a===0?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",a,l);if(a<45)return r.formatDistance("xMinutes",a,l);if(a<90)return r.formatDistance("aboutXHours",1,l);if(a<dt){const u=Math.round(a/60);return r.formatDistance("aboutXHours",u,l)}else{if(a<c)return r.formatDistance("xDays",1,l);if(a<We){const u=Math.round(a/dt);return r.formatDistance("xDays",u,l)}else if(a<We*2)return g=Math.round(a/We),r.formatDistance("aboutXMonths",g,l)}if(g=In(d,m),g<12){const u=Math.round(a/We);return r.formatDistance("xMonths",u,l)}else{const u=g%12,h=Math.trunc(g/12);return u<3?r.formatDistance("aboutXYears",h,l):u<9?r.formatDistance("overXYears",h,l):r.formatDistance("almostXYears",h+1,l)}}function fs(t,e){return ms(t,Pn(t),e)}function hs(t){const e=U.c(13),{virtualMcp:s,org:o}=t;let r;e[0]!==o||e[1]!==s.id?(r={org:o,agentId:s.id},e[0]=o,e[1]=s.id,e[2]=r):r=e[2];let c;e[3]!==s.icon||e[4]!==s.title?(c=s.icon?n.jsx("img",{src:s.icon,alt:s.title,className:"w-5 h-5 rounded-md object-cover shrink-0"}):n.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center shrink-0",children:n.jsx(Ge,{size:16,className:"text-primary"})}),e[3]=s.icon,e[4]=s.title,e[5]=c):c=e[5];let i;e[6]!==s.title?(i=n.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:s.title}),e[6]=s.title,e[7]=i):i=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(yn,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[8]=l):l=e[8];let m;return e[9]!==r||e[10]!==c||e[11]!==i?(m=n.jsxs(ht,{to:"/$org/agents/$agentId",params:r,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[c,i,l]}),e[9]=r,e[10]=c,e[11]=i,e[12]=m):m=e[12],m}function mt(t){const e=U.c(20),{connectionId:s,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:i,hasExistingVirtualMcps:l}=t,m=Re(),d=jn();let x;e[0]!==d.create||e[1]!==r||e[2]!==c||e[3]!==s||e[4]!==o||e[5]!==m||e[6]!==i?(x=async()=>{const u=await d.create.mutateAsync({title:`${o} Agent`,description:r??null,icon:c??null,status:"active",connections:[{connection_id:s,selected_tools:null,selected_resources:null,selected_prompts:null}]});m({to:"/$org/agents/$agentId",params:{org:i,agentId:u.id}})},e[0]=d.create,e[1]=r,e[2]=c,e[3]=s,e[4]=o,e[5]=m,e[6]=i,e[7]=x):x=e[7];const p=x;if(l){let u;e[8]!==d.create.isPending?(u=d.create.isPending?n.jsx(Le,{size:16,className:"animate-spin"}):n.jsx(vn,{size:16}),e[8]=d.create.isPending,e[9]=u):u=e[9];let h;return e[10]!==d.create.isPending||e[11]!==p||e[12]!==u?(h=n.jsx(Be,{variant:"ghost",className:"size-6 p-0",onClick:p,disabled:d.create.isPending,children:u}),e[10]=d.create.isPending,e[11]=p,e[12]=u,e[13]=h):h=e[13],h}let a;e[14]!==d.create.isPending?(a=d.create.isPending?n.jsx(Le,{className:"animate-spin text-muted-foreground"}):n.jsx(Ge,{className:"size-3 text-muted-foreground"}),e[14]=d.create.isPending,e[15]=a):a=e[15];let g;return e[16]!==d.create.isPending||e[17]!==p||e[18]!==a?(g=n.jsxs(Be,{variant:"outline",size:"sm",onClick:p,disabled:d.create.isPending,children:[a,"Create an agent"]}),e[16]=d.create.isPending,e[17]=p,e[18]=a,e[19]=g):g=e[19],g}function ps(t){const e=U.c(26),{connectionId:s,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:i}=t;let l;e[0]!==s?(l={filters:[{column:"connection_id",value:s}]},e[0]=s,e[1]=l):l=e[1];const m=bn(l);if(!(m.length>0)){let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=h):h=e[2];let b;return e[3]!==r||e[4]!==c||e[5]!==s||e[6]!==o||e[7]!==i?(b=n.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[h,n.jsx(mt,{connectionId:s,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:i,hasExistingVirtualMcps:!1})]}),e[3]=r,e[4]=c,e[5]=s,e[6]=o,e[7]=i,e[8]=b):b=e[8],b}let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Agents"}),e[9]=x):x=e[9];let p;e[10]!==r||e[11]!==c||e[12]!==s||e[13]!==o||e[14]!==i?(p=n.jsx("div",{className:"flex flex-col gap-1",children:n.jsxs("div",{className:"flex items-center justify-between",children:[x,n.jsx(mt,{connectionId:s,connectionTitle:o,connectionDescription:r,connectionIcon:c,org:i,hasExistingVirtualMcps:!0})]})}),e[10]=r,e[11]=c,e[12]=s,e[13]=o,e[14]=i,e[15]=p):p=e[15];let a;if(e[16]!==i||e[17]!==m){let h;e[19]!==i?(h=b=>n.jsx(hs,{virtualMcp:b,org:i},b.id),e[19]=i,e[20]=h):h=e[20],a=m.map(h),e[16]=i,e[17]=m,e[18]=a}else a=e[18];let g;e[21]!==a?(g=n.jsx("div",{className:"flex flex-col gap-2",children:a}),e[21]=a,e[22]=g):g=e[22];let u;return e[23]!==p||e[24]!==g?(u=n.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[p,g]}),e[23]=p,e[24]=g,e[25]=u):u=e[25],u}function xs({form:t,connection:e,hasOAuthToken:s,onReauthenticate:o,onRemoveOAuth:r}){const c=tt({control:t.control,name:"ui_type"}),i=tt({control:t.control,name:"connection_url"}),{stdioEnabled:l}=Tt(),m=(()=>{if(typeof i!="string"||!i)return!1;try{const a=new URL(i);return a.hostname==="api.githubcopilot.com"&&a.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),d=l||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Mt(e.connection_url):null;return x?n.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),n.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[n.jsx(Ge,{className:"w-4 h-4 text-muted-foreground"}),n.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),n.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:n.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):n.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[n.jsx(J,{control:t.control,name:"ui_type",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(ne,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),c!=="NPX"&&c!=="STDIO"?n.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[n.jsxs(at,{value:a.value,onValueChange:a.onChange,children:[n.jsx(K,{children:n.jsxs(it,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[n.jsx(Fe,{className:"w-4 h-4 text-muted-foreground shrink-0"}),n.jsx(ct,{})]})}),n.jsxs(lt,{children:[n.jsx(Q,{value:"HTTP",children:"HTTP"}),n.jsx(Q,{value:"SSE",children:"SSE"}),n.jsx(Q,{value:"Websocket",children:"Websocket"}),d&&n.jsxs(n.Fragment,{children:[n.jsx(Q,{value:"NPX",children:"NPX Package"}),n.jsx(Q,{value:"STDIO",children:"Custom Command"})]})]})]}),n.jsx("div",{className:"w-px bg-border"}),n.jsx(J,{control:t.control,name:"connection_url",render:({field:g})=>n.jsx(G,{className:"flex-1 min-w-0",children:n.jsx(K,{children:n.jsx(ee,{placeholder:"https://example.com/mcp",...g,value:g.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):n.jsxs(at,{value:a.value,onValueChange:a.onChange,children:[n.jsx(K,{children:n.jsx(it,{className:"h-10",children:n.jsx(ct,{})})}),n.jsxs(lt,{children:[n.jsx(Q,{value:"HTTP",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Fe,{className:"w-4 h-4"}),"HTTP"]})}),n.jsx(Q,{value:"SSE",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Fe,{className:"w-4 h-4"}),"SSE"]})}),n.jsx(Q,{value:"Websocket",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Fe,{className:"w-4 h-4"}),"Websocket"]})}),d&&n.jsxs(n.Fragment,{children:[n.jsx(Q,{value:"NPX",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(Lt,{className:"w-4 h-4"}),"NPX Package"]})}),n.jsx(Q,{value:"STDIO",children:n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(hn,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),n.jsx(Z,{})]})}),c==="NPX"&&n.jsx(J,{control:t.control,name:"npx_package",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(ne,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),n.jsx(K,{children:n.jsx(ee,{placeholder:"@perplexity-ai/mcp-server",...a,value:a.value||"",className:"h-10 rounded-lg"})}),n.jsx(Z,{})]})}),c==="STDIO"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsx(J,{control:t.control,name:"stdio_command",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(ne,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),n.jsx(K,{children:n.jsx(ee,{placeholder:"node, bun, python...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),n.jsx(Z,{})]})}),n.jsx(J,{control:t.control,name:"stdio_args",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(ne,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),n.jsx(K,{children:n.jsx(ee,{placeholder:"arg1 arg2 --flag value",...a,value:a.value||"",className:"h-10 rounded-lg"})}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),n.jsx(Z,{})]})})]}),n.jsx(J,{control:t.control,name:"stdio_cwd",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(ne,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),n.jsx(K,{children:n.jsx(ee,{placeholder:"/path/to/project (optional)",...a,value:a.value||"",className:"h-10 rounded-lg"})}),n.jsx(Z,{})]})})]}),(c==="NPX"||c==="STDIO")&&n.jsx(J,{control:t.control,name:"env_vars",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(ne,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),n.jsx(K,{children:n.jsx(Rt,{value:a.value??[],onChange:a.onChange})}),n.jsx(Z,{})]})}),c!=="NPX"&&c!=="STDIO"&&n.jsx(J,{control:t.control,name:"connection_token",render:({field:a})=>n.jsxs(G,{className:"flex flex-col gap-3",children:[n.jsx(ne,{className:"text-xs text-muted-foreground font-medium",children:m?"GitHub Personal Access Token":"Token"}),s?n.jsx("div",{className:"flex items-center gap-2",children:n.jsxs(cn,{children:[n.jsx(ln,{asChild:!0,children:n.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:n.jsxs(qe,{variant:"success",className:"gap-1.5",children:[n.jsx(yt,{size:12}),"Authenticated via OAuth",n.jsx(fn,{size:12})]})})}),n.jsxs(dn,{align:"start",children:[n.jsxs(rt,{onClick:o,children:[n.jsx(Ct,{size:16}),"Re-authenticate"]}),n.jsxs(rt,{variant:"destructive",onClick:r,children:[n.jsx(pn,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&a.value===null?n.jsxs("div",{className:"relative group",children:[n.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),n.jsx("button",{type:"button",onClick:()=>a.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:n.jsx(xn,{size:14,className:"text-muted-foreground"})})]}):n.jsxs(n.Fragment,{children:[n.jsx(K,{children:n.jsx(ee,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...a,value:a.value||"",className:"h-10 rounded-lg"})}),m&&n.jsxs(mn,{children:["Create a PAT at"," ",n.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),n.jsx(Z,{})]})})]})}function gs(t){const e=U.c(43),{form:s,connection:o,isMCPAuthenticated:r,hasOAuthToken:c,onReauthenticate:i,onRemoveOAuth:l}=t,{org:m}=pt();let d;e[0]!==o.icon||e[1]!==o.title?(d=n.jsx(He,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}),e[0]=o.icon,e[1]=o.title,e[2]=d):d=e[2];let x;e[3]!==s.control?(x=n.jsxs("div",{className:"flex flex-col",children:[n.jsx(J,{control:s.control,name:"title",render:js}),n.jsx(J,{control:s.control,name:"description",render:bs})]}),e[3]=s.control,e[4]=x):x=e[4];let p;e[5]!==d||e[6]!==x?(p=n.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[d,x]}),e[5]=d,e[6]=x,e[7]=p):p=e[7];let a;e[8]!==o||e[9]!==s||e[10]!==c||e[11]!==i||e[12]!==l?(a=n.jsx(xs,{form:s,connection:o,hasOAuthToken:c,onReauthenticate:i,onRemoveOAuth:l}),e[8]=o,e[9]=s,e[10]=c,e[11]=i,e[12]=l,e[13]=a):a=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[14]=g):g=e[14];let u;e[15]!==r?(u=n.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[g,r?n.jsxs(qe,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[n.jsx(yt,{size:12}),"Connected"]}):n.jsx(qe,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[15]=r,e[16]=u):u=e[16];let h;e[17]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[17]=h):h=e[17];let b;e[18]!==o.created_by?(b=n.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[h,n.jsx(gn,{id:o.created_by,size:"2xs"})]}),e[18]=o.created_by,e[19]=b):b=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=n.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[20]=C):C=e[20];let v;e[21]!==o.updated_at?(v=o.updated_at?fs(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[21]=o.updated_at,e[22]=v):v=e[22];let j;e[23]!==v?(j=n.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[C,n.jsx("span",{className:"text-sm text-foreground",children:v})]}),e[23]=v,e[24]=j):j=e[24];let w;e[25]!==j||e[26]!==u||e[27]!==b?(w=n.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[u,b,j]}),e[25]=j,e[26]=u,e[27]=b,e[28]=w):w=e[28];let f;e[29]!==o.description||e[30]!==o.icon||e[31]!==o.id||e[32]!==o.title||e[33]!==m.slug?(f=n.jsx(ps,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:m.slug}),e[29]=o.description,e[30]=o.icon,e[31]=o.id,e[32]=o.title,e[33]=m.slug,e[34]=f):f=e[34];let P;e[35]!==w||e[36]!==f||e[37]!==p||e[38]!==a?(P=n.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[p,a,w,f]}),e[35]=w,e[36]=f,e[37]=p,e[38]=a,e[39]=P):P=e[39];let $;return e[40]!==s||e[41]!==P?($=n.jsx(un,{...s,children:P}),e[40]=s,e[41]=P,e[42]=$):$=e[42],$}function bs(t){const{field:e}=t;return n.jsxs(G,{className:"w-full space-y-0",children:[n.jsx(K,{children:n.jsx(ee,{...e,value:e.value||"",className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),n.jsx(Z,{})]})}function js(t){const{field:e}=t;return n.jsxs(G,{className:"flex-1 space-y-0",children:[n.jsx(K,{children:n.jsx(ee,{...e,className:"h-auto py-0.5 text-lg! font-medium leading-7 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})}),n.jsx(Z,{})]})}function ys(t){const e=U.c(42),{prompts:s,connectionId:o,org:r,connectionTitle:c,connectionIcon:i,onPromptClick:l,showToolbar:m,emptyMessage:d}=t,x=m===void 0?!0:m,p=d===void 0?"This connection doesn't have any prompts yet.":d,a=Re(),u=Ye().location.href,[h,b]=Y.useState(""),[C,v]=Y.useState("table"),[j,w]=Y.useState("name"),[f,P]=Y.useState("asc");let $;e[0]!==f||e[1]!==j?($=S=>{j===S?(P(_s),f==="desc"&&w(void 0)):(w(S),P("asc"))},e[0]=f,e[1]=j,e[2]=$):$=e[2];const T=$;let V;e[3]!==o||e[4]!==a||e[5]!==l||e[6]!==r?(V=S=>{l?l(S):o&&r&&a({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:r,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(S.name)}})},e[3]=o,e[4]=a,e[5]=l,e[6]=r,e[7]=V):V=e[7];const k=V;let O;if(e[8]!==s||e[9]!==h||e[10]!==f||e[11]!==j){const S=!s||s.length===0?[]:h.trim()?(()=>{const H=h.toLowerCase();return s.filter(B=>B.name.toLowerCase().includes(H)||B.description&&B.description.toLowerCase().includes(H))})():s;O=!j||!f?S:[...S].sort((H,B)=>{const se=H[j]||"",we=B[j]||"",te=String(se).localeCompare(String(we));return f==="asc"?te:-te}),e[8]=s,e[9]=h,e[10]=f,e[11]=j,e[12]=O}else O=e[12];const M=O;let X;e[13]===Symbol.for("react.memo_cache_sentinel")?(X=[{id:"name",header:"Name",render:Ss,sortable:!0},{id:"description",header:"Description",render:ws,cellClassName:"flex-1",sortable:!0}],e[13]=X):X=e[13];const N=X;let R;e[14]===Symbol.for("react.memo_cache_sentinel")?(R=N.filter(Ns).map(vs),e[14]=R):R=e[14];const E=R;let I;e[15]!==i||e[16]!==c||e[17]!==T||e[18]!==x||e[19]!==f||e[20]!==j||e[21]!==u||e[22]!==C?(I=x&&n.jsxs(Je,{children:[n.jsx(wt,{viewMode:C,onViewModeChange:v,sortKey:j,sortDirection:f,onSort:T,sortOptions:E}),n.jsx(Ke,{title:c?`${c}: Prompts`:"Prompts",url:u,icon:i??"description"})]}),e[15]=i,e[16]=c,e[17]=T,e[18]=x,e[19]=f,e[20]=j,e[21]=u,e[22]=C,e[23]=I):I=e[23];let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=S=>{S.key==="Escape"&&(b(""),S.target.blur())},e[24]=A):A=e[24];let D;e[25]!==h?(D=n.jsx(St,{value:h,onChange:b,placeholder:"Search prompts...",onKeyDown:A}),e[25]=h,e[26]=D):D=e[26];let y;e[27]!==p||e[28]!==k||e[29]!==T||e[30]!==h||e[31]!==f||e[32]!==j||e[33]!==M||e[34]!==C?(y=C==="cards"?n.jsx("div",{className:"flex-1 overflow-auto p-5",children:M.length===0?n.jsx(ve,{image:null,title:h?"No prompts found":"No prompts available",description:h?"Try adjusting your search terms":p}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:M.map(S=>n.jsx(_t,{className:"cursor-pointer transition-colors",onClick:()=>k(S),children:n.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[n.jsx(He,{icon:null,name:S.name,size:"md",className:"shrink-0 shadow-sm"}),n.jsxs("div",{className:"flex flex-col gap-0",children:[n.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:S.name}),n.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:S.description||"No description"})]})]})},S.name))})}):n.jsx(Nt,{columns:N,data:M,isLoading:!1,sortKey:j,sortDirection:f,onSort:T,onRowClick:S=>k(S),emptyState:n.jsx(ve,{image:null,title:h?"No prompts found":"No prompts available",description:h?"Try adjusting your search terms":p})}),e[27]=p,e[28]=k,e[29]=T,e[30]=h,e[31]=f,e[32]=j,e[33]=M,e[34]=C,e[35]=y):y=e[35];let F;e[36]!==D||e[37]!==y?(F=n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[D,y]}),e[36]=D,e[37]=y,e[38]=F):F=e[38];let z;return e[39]!==F||e[40]!==I?(z=n.jsxs(n.Fragment,{children:[I,F]}),e[39]=F,e[40]=I,e[41]=z):z=e[41],z}function vs(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ns(t){return t.sortable}function ws(t){return n.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function Ss(t){return n.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function _s(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Cs(t){const e=U.c(6),{prompts:s,connectionId:o,org:r}=t,c=Qe(o),i=c?.title,l=c?.icon;let m;return e[0]!==o||e[1]!==r||e[2]!==s||e[3]!==i||e[4]!==l?(m=n.jsx(ys,{prompts:s,connectionId:o,org:r,connectionTitle:i,connectionIcon:l}),e[0]=o,e[1]=r,e[2]=s,e[3]=i,e[4]=l,e[5]=m):m=e[5],m}function Ps(t){const e=U.c(2),{repository:s}=t;let o;return e[0]!==s?(o=n.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:n.jsx(wn,{repository:s})}),e[0]=s,e[1]=o):o=e[1],o}function ks(t){const e=U.c(39),{resources:s,connectionTitle:o,connectionIcon:r,onResourceClick:c,showToolbar:i,emptyMessage:l}=t,m=i===void 0?!0:i,d=l===void 0?"This connection doesn't have any resources yet.":l,p=Ye().location.href,[a,g]=Y.useState(""),[u,h]=Y.useState("table"),[b,C]=Y.useState("name"),[v,j]=Y.useState("asc");let w;e[0]!==v||e[1]!==b?(w=y=>{b===y?(j($s),v==="desc"&&C(void 0)):(C(y),j("asc"))},e[0]=v,e[1]=b,e[2]=w):w=e[2];const f=w;let P;e[3]!==c?(P=y=>{c&&c(y)},e[3]=c,e[4]=P):P=e[4];const $=P;let T;if(e[5]!==s||e[6]!==a||e[7]!==v||e[8]!==b){const y=!s||s.length===0?[]:a.trim()?(()=>{const F=a.toLowerCase();return s.filter(z=>z.uri.toLowerCase().includes(F)||z.name&&z.name.toLowerCase().includes(F)||z.description&&z.description.toLowerCase().includes(F))})():s;T=!b||!v?y:[...y].sort((F,z)=>{const S=F[b]||"",H=z[b]||"",B=String(S).localeCompare(String(H));return v==="asc"?B:-B}),e[5]=s,e[6]=a,e[7]=v,e[8]=b,e[9]=T}else T=e[9];const V=T;let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=[{id:"name",header:"Name",render:Vs,sortable:!0},{id:"uri",header:"URI",render:As,sortable:!0},{id:"description",header:"Description",render:Is,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Ds,sortable:!0}],e[10]=k):k=e[10];const O=k;let M;e[11]===Symbol.for("react.memo_cache_sentinel")?(M=O.filter(Ms).map(Ts),e[11]=M):M=e[11];const X=M;let N;e[12]!==r||e[13]!==o||e[14]!==f||e[15]!==m||e[16]!==v||e[17]!==b||e[18]!==p||e[19]!==u?(N=m&&n.jsxs(Je,{children:[n.jsx(wt,{viewMode:u,onViewModeChange:h,sortKey:b,sortDirection:v,onSort:f,sortOptions:X}),n.jsx(Ke,{title:o?`${o}: Resources`:"Resources",url:p,icon:r??"folder"})]}),e[12]=r,e[13]=o,e[14]=f,e[15]=m,e[16]=v,e[17]=b,e[18]=p,e[19]=u,e[20]=N):N=e[20];let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=y=>{y.key==="Escape"&&(g(""),y.target.blur())},e[21]=R):R=e[21];let E;e[22]!==a?(E=n.jsx(St,{value:a,onChange:g,placeholder:"Search resources...",onKeyDown:R}),e[22]=a,e[23]=E):E=e[23];let I;e[24]!==d||e[25]!==$||e[26]!==f||e[27]!==a||e[28]!==v||e[29]!==b||e[30]!==V||e[31]!==u?(I=u==="cards"?n.jsx("div",{className:"flex-1 overflow-auto p-5",children:V.length===0?n.jsx(ve,{image:null,title:a?"No resources found":"No resources available",description:a?"Try adjusting your search terms":d}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:V.map(y=>n.jsx(_t,{className:"cursor-pointer transition-colors",onClick:()=>$(y),children:n.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[n.jsx(He,{icon:null,name:y.name||y.uri,size:"md",className:"shrink-0 shadow-sm"}),n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:y.name||y.uri}),n.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:y.uri}),y.description&&n.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:y.description})]})]})},y.uri))})}):n.jsx(Nt,{columns:O,data:V,isLoading:!1,sortKey:b,sortDirection:v,onSort:f,onRowClick:y=>$(y),emptyState:n.jsx(ve,{image:null,title:a?"No resources found":"No resources available",description:a?"Try adjusting your search terms":d})}),e[24]=d,e[25]=$,e[26]=f,e[27]=a,e[28]=v,e[29]=b,e[30]=V,e[31]=u,e[32]=I):I=e[32];let A;e[33]!==E||e[34]!==I?(A=n.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[E,I]}),e[33]=E,e[34]=I,e[35]=A):A=e[35];let D;return e[36]!==A||e[37]!==N?(D=n.jsxs(n.Fragment,{children:[N,A]}),e[36]=A,e[37]=N,e[38]=D):D=e[38],D}function Ts(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ms(t){return t.sortable}function Ds(t){return n.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function Is(t){return n.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function As(t){return n.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function Vs(t){return n.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function $s(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Os(t){const e=U.c(6),{resources:s,connectionId:o,org:r}=t,c=Qe(o),i=c?.title,l=c?.icon;let m;return e[0]!==o||e[1]!==r||e[2]!==s||e[3]!==i||e[4]!==l?(m=n.jsx(ks,{resources:s,connectionId:o,org:r,connectionTitle:i,connectionIcon:l}),e[0]=o,e[1]=r,e[2]=s,e[3]=i,e[4]=l,e[5]=m):m=e[5],m}const Fs=xt({key:q().min(1,"Key is required"),value:q()}),Ws=xt({title:q().min(1,"Name is required"),description:q().nullable().optional(),ui_type:At(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:q().optional(),connection_token:q().nullable().optional(),npx_package:q().optional(),stdio_command:q().optional(),stdio_args:q().optional(),stdio_cwd:q().optional(),env_vars:nt(Fs).optional(),configuration_scopes:nt(q()).nullable().optional(),configuration_state:Dt(q(),It()).nullable().optional()}).refine(t=>t.ui_type==="NPX"?!!t.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(t=>t.ui_type==="STDIO"?!!t.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(t=>t.ui_type==="HTTP"||t.ui_type==="SSE"||t.ui_type==="Websocket"?!!t.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Es(t){const e=U.c(5),{tools:s,connectionId:o,org:r,isLoading:c}=t;let i;return e[0]!==o||e[1]!==c||e[2]!==r||e[3]!==s?(i=n.jsx(Sn,{tools:s,connectionId:o,org:r,isLoading:c}),e[0]=o,e[1]=c,e[2]=r,e[3]=s,e[4]=i):i=e[4],i}function Ls(t){return t.command==="npx"}function Rs(t){return t.args?.find(e=>!e.startsWith("-"))??""}function zs(t){return{command:t.command,args:t.args?.join(" ")??"",cwd:t.cwd??""}}function Xs(t,e){const s={command:"npx",args:["-y",t]},o=bt(e);return Object.keys(o).length>0&&(s.envVars=o),s}function Us(t,e,s,o){const r={command:t};e.trim()&&(r.args=e.trim().split(/\s+/)),s?.trim()&&(r.cwd=s.trim());const c=bt(o);return Object.keys(c).length>0&&(r.envVars=c),r}function ft(t,e){const s={title:t.title,description:t.description??"",configuration_state:t.configuration_state??{},configuration_scopes:t.configuration_scopes||[]};if(t.connection_type==="STDIO"&&Et(t.connection_headers)){const o=t.connection_headers,r=zt(o.envVars);if(Ls(o)){const i=Rs(o);return{...s,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:i,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const c=zs(o);return{...s,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:r}}return{...s,ui_type:t.connection_type,connection_url:t.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Bs(t){let e,s=null,o=null,r=null;return t.ui_type==="NPX"?(e="STDIO",s="",r=Xs(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(e="STDIO",s="",r=Us(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(e=t.ui_type,s=t.connection_url||"",o=t.connection_token||null),{title:t.title,description:t.description||null,connection_type:e,connection_url:s,...o&&{connection_token:o},...r&&{connection_headers:r},configuration_state:t.configuration_state??null,configuration_scopes:t.configuration_scopes??null}}function qs(t){const e=U.c(117),{connection:s,connectionId:o,org:r,requestedTabId:c,collections:i,onUpdate:l,isUpdating:m,prompts:d,resources:x,tools:p,isLoadingTools:a}=t;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={from:"/$org/mcps/$connectionId"},e[0]=g):g=e[0];const u=Re(g),h=Ot(),C=Ye().location.href,v=jt();let j;e[1]!==o?(j={connectionId:o},e[1]=o,e[2]=j):j=e[2];const w=qt(j),f=w.isAuthenticated;let P;e[3]!==s?(P={connections:[s],binding:"MCP"},e[3]=s,e[4]=P):P=e[4];const T=Bt(P).length>0,V=s?.metadata?.repository,k=!!V?.url;let O;e[5]===Symbol.for("react.memo_cache_sentinel")?(O=Ft(Ws),e[5]=O):O=e[5];let M;e[6]!==s?(M=ft(s),e[6]=s,e[7]=M):M=e[7];let X;e[8]!==M?(X={resolver:O,values:M},e[8]=M,e[9]=X):X=e[9];const N=Wt(X),R=N.formState.isDirty;let E;e[10]!==N||e[11]!==l?(E=async()=>{if(!await N.trigger())return;const L=N.getValues(),ye=Bs(L);await l(ye),N.reset(L)},e[10]=N,e[11]=l,e[12]=E):E=e[12];const I=E;let A;e[13]!==s||e[14]!==N?(A=()=>{N.reset(ft(s))},e[13]=s,e[14]=N,e[15]=A):A=e[15];const D=A;let y;e[16]!==s.id||e[17]!==v||e[18]!==h?(y=async()=>{const{token:_,tokenInfo:L,error:ye}=await Gt({connectionId:s.id});if(ye||!_){_e.error(`Authentication failed: ${ye}`);return}if(L)try{const Oe=await fetch(`/api/connections/${s.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:L.accessToken,refreshToken:L.refreshToken,expiresIn:L.expiresIn,scope:L.scope,clientId:L.clientId,clientSecret:L.clientSecret,tokenEndpoint:L.tokenEndpoint})});if(!Oe.ok)console.error("Failed to save OAuth token:",await Oe.text()),await v.update.mutateAsync({id:s.id,data:{connection_token:_}});else try{await v.update.mutateAsync({id:s.id,data:{}})}catch(et){console.warn("Failed to refresh connection tools after OAuth:",et)}}catch(Oe){console.error("Error saving OAuth token:",Oe),await v.update.mutateAsync({id:s.id,data:{connection_token:_}})}else await v.update.mutateAsync({id:s.id,data:{connection_token:_}});const kt=new URL(`/mcp/${s.id}`,window.location.origin);await h.invalidateQueries({queryKey:st.isMCPAuthenticated(kt.href,null)}),_e.success("Authentication successful")},e[16]=s.id,e[17]=v,e[18]=h,e[19]=y):y=e[19];const F=y;let z;e[20]!==s.id||e[21]!==h?(z=async()=>{try{const _=await fetch(`/api/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!_.ok){const ye=await _.text();_e.error(`Failed to remove OAuth: ${ye}`);return}const L=new URL(`/mcp/${s.id}`,window.location.origin);await h.invalidateQueries({queryKey:st.isMCPAuthenticated(L.href,null)}),_e.success("OAuth removed. You can now re-authenticate with a different account.")}catch(_){console.error("Error removing OAuth token:",_),_e.error("Failed to remove OAuth")}},e[20]=s.id,e[21]=h,e[22]=z):z=e[22];const S=z,H=p.length,B=d.length,se=x.length,we=H>0||a;let te;e[23]===Symbol.for("react.memo_cache_sentinel")?(te={id:"settings",label:"Settings"},e[23]=te):te=e[23];let oe;e[24]!==a||e[25]!==f||e[26]!==we||e[27]!==H?(oe=f&&we?[{id:"tools",label:"Tools",count:a?void 0:H}]:[],e[24]=a,e[25]=f,e[26]=we,e[27]=H,e[28]=oe):oe=e[28];let re;e[29]!==f||e[30]!==B?(re=f&&B>0?[{id:"prompts",label:"Prompts",count:B}]:[],e[29]=f,e[30]=B,e[31]=re):re=e[31];let ae;e[32]!==f||e[33]!==se?(ae=f&&se>0?[{id:"resources",label:"Resources",count:se}]:[],e[32]=f,e[33]=se,e[34]=ae):ae=e[34];let ke;if(e[35]!==i||e[36]!==k||e[37]!==f||e[38]!==oe||e[39]!==re||e[40]!==ae){let _;e[42]!==k?(_=k?[{id:"readme",label:"README"}]:[],e[42]=k,e[43]=_):_=e[43],ke=[te,...oe,...re,...ae,...f?(i||[]).map(Hs):[],..._],e[35]=i,e[36]=k,e[37]=f,e[38]=oe,e[39]=re,e[40]=ae,e[41]=ke}else ke=e[41];const Se=ke,Pt=f&&Se.some(Ys)?"tools":"settings",W=Se.some(_=>_.id===c)?c:Pt;let Te;e[44]!==u?(Te=_=>{u({search:L=>({...L,tab:_}),replace:!0})},e[44]=u,e[45]=Te):Te=e[45];const ie=Te;let ce;e[46]!==i?(ce=i||[],e[46]=i,e[47]=ce):ce=e[47];let Me;if(e[48]!==W||e[49]!==ce){let _;e[51]!==W?(_=L=>L.name===W,e[51]=W,e[52]=_):_=e[52],Me=ce.find(_),e[48]=W,e[49]=ce,e[50]=Me}else Me=e[50];const De=Me;let le;e[53]!==r?(le=n.jsx(ot,{children:n.jsx(en,{asChild:!0,children:n.jsx(ht,{to:"/$org/mcps",params:{org:r},children:"Connections"})})}),e[53]=r,e[54]=le):le=e[54];let Ie;e[55]===Symbol.for("react.memo_cache_sentinel")?(Ie=n.jsx(tn,{}),e[55]=Ie):Ie=e[55];let de;e[56]!==s.title?(de=n.jsx(ot,{children:n.jsx(Zt,{children:s.title})}),e[56]=s.title,e[57]=de):de=e[57];let Ae;e[58]!==le||e[59]!==de?(Ae=n.jsx(nn,{children:n.jsxs(sn,{children:[le,Ie,de]})}),e[58]=le,e[59]=de,e[60]=Ae):Ae=e[60];const ze=Ae;let ue;e[61]!==I||e[62]!==D||e[63]!==R||e[64]!==m?(ue=n.jsx(Xt,{onSave:I,onUndo:D,isDirty:R,isSaving:m}),e[61]=I,e[62]=D,e[63]=R,e[64]=m,e[65]=ue):ue=e[65];const Xe=s.icon??"settings";let me;e[66]!==s.title||e[67]!==Xe||e[68]!==C?(me=n.jsx(Ke,{title:s.title,url:C,icon:Xe}),e[66]=s.title,e[67]=Xe,e[68]=C,e[69]=me):me=e[69];let fe;e[70]!==ue||e[71]!==me?(fe=n.jsxs(Je,{children:[ue,me]}),e[70]=ue,e[71]=me,e[72]=fe):fe=e[72];let he;e[73]!==w.hasOAuthToken||e[74]!==s||e[75]!==N||e[76]!==F||e[77]!==S||e[78]!==f?(he=n.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:n.jsx(gs,{form:N,connection:s,isMCPAuthenticated:f,hasOAuthToken:w.hasOAuthToken,onReauthenticate:F,onRemoveOAuth:S})}),e[73]=w.hasOAuthToken,e[74]=s,e[75]=N,e[76]=F,e[77]=S,e[78]=f,e[79]=he):he=e[79];let pe;e[80]!==W||e[81]!==ie||e[82]!==Se?(pe=n.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:n.jsx(on,{tabs:Se,activeTab:W,onTabChange:ie,className:"flex-1"})}),e[80]=W,e[81]=ie,e[82]=Se,e[83]=pe):pe=e[83];let Ve;e[84]===Symbol.for("react.memo_cache_sentinel")?(Ve=n.jsx("div",{className:"flex h-full items-center justify-center",children:n.jsx(Le,{size:32,className:"animate-spin text-muted-foreground"})}),e[84]=Ve):Ve=e[84];let xe;e[85]!==De||e[86]!==W||e[87]!==w.isServerError||e[88]!==w.supportsOAuth||e[89]!==s||e[90]!==o||e[91]!==N||e[92]!==F||e[93]!==ie||e[94]!==T||e[95]!==k||e[96]!==a||e[97]!==f||e[98]!==r||e[99]!==d||e[100]!==V||e[101]!==x||e[102]!==p?(xe=n.jsx(Y.Suspense,{fallback:Ve,children:W==="tools"?n.jsx(Es,{tools:p,connectionId:o,org:r,isLoading:a}):W==="prompts"?n.jsx(Cs,{prompts:d,connectionId:o,org:r}):W==="resources"?n.jsx(Os,{resources:x,connectionId:o,org:r}):W==="settings"?n.jsx(Yt,{connection:s,form:N,hasMcpBinding:T,isMCPAuthenticated:f,supportsOAuth:w.supportsOAuth,isServerError:w.isServerError,onAuthenticate:F,onViewReadme:k?()=>ie("readme"):void 0}):W==="readme"&&k?n.jsx(Ps,{repository:V}):De&&f?n.jsx(an,{connectionId:o,org:r,activeCollection:De},W):n.jsx(ve,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[85]=De,e[86]=W,e[87]=w.isServerError,e[88]=w.supportsOAuth,e[89]=s,e[90]=o,e[91]=N,e[92]=F,e[93]=ie,e[94]=T,e[95]=k,e[96]=a,e[97]=f,e[98]=r,e[99]=d,e[100]=V,e[101]=x,e[102]=p,e[103]=xe):xe=e[103];let ge;e[104]!==W||e[105]!==xe?(ge=n.jsx("div",{className:"flex-1 overflow-auto",children:n.jsx(gt,{children:xe},W)}),e[104]=W,e[105]=xe,e[106]=ge):ge=e[106];let be;e[107]!==pe||e[108]!==ge?(be=n.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[pe,ge]}),e[107]=pe,e[108]=ge,e[109]=be):be=e[109];let je;e[110]!==he||e[111]!==be?(je=n.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[he,be]}),e[110]=he,e[111]=be,e[112]=je):je=e[112];let $e;return e[113]!==ze||e[114]!==fe||e[115]!==je?($e=n.jsxs(rn,{breadcrumb:ze,children:[fe,je]}),e[113]=ze,e[114]=fe,e[115]=je,e[116]=$e):$e=e[116],$e}function Ys(t){return t.id==="tools"}function Hs(t){return{id:t.name,label:t.displayName}}function Ks(){const t=U.c(43);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const s=Re(e);let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/mcps/$connectionId"},t[1]=o):o=t[1];const{connectionId:r,org:c}=Vt(o),{org:i}=pt();let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/mcps/$connectionId"},t[2]=l):l=t[2];const d=$t(l).tab??"",x=Qe(r),p=jt(),a=Ut(x??void 0);let g;t[3]!==r||t[4]!==i.id?(g={connectionId:r,orgId:i.id},t[3]=r,t[4]=i.id,t[5]=g):g=t[5];const u=Kt(g);let h;t[6]!==u?(h={client:u},t[6]=u,t[7]=h):h=t[7];const{data:b}=Qt(h);let C;t[8]!==u?(C={client:u},t[8]=u,t[9]=C):C=t[9];const{data:v}=Jt(C),j=x?.tools&&x.tools.length>0,w=!j;let f;t[10]!==u||t[11]!==w?(f={client:u,enabled:w},t[10]=u,t[11]=w,t[12]=f):f=t[12];const{data:P,isLoading:$}=Ht(f);let T;t[13]!==b?.prompts?(T=b?.prompts??[],t[13]=b?.prompts,t[14]=T):T=t[14];let V;t[15]!==T?(V=T.map(Gs),t[15]=T,t[16]=V):V=t[16];const k=V;let O;t[17]!==v?.resources?(O=v?.resources??[],t[17]=v?.resources,t[18]=O):O=t[18];let M;t[19]!==O?(M=O.map(Js),t[19]=O,t[20]=M):M=t[20];const X=M;let N;t[21]!==x||t[22]!==j||t[23]!==P?.tools?(N=j?x.tools??[]:(P?.tools??[]).map(Qs),t[21]=x,t[22]=j,t[23]=P?.tools,t[24]=N):N=t[24];const R=N;let E;t[25]!==p.update||t[26]!==r?(E=async D=>{await p.update.mutateAsync({id:r,data:D})},t[25]=p.update,t[26]=r,t[27]=E):E=t[27];const I=E;if(!x){let D;return t[28]!==s||t[29]!==c?(D=n.jsx("div",{className:"flex h-full w-full bg-background",children:n.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:n.jsx(Be,{variant:"outline",onClick:()=>s({to:"/$org/mcps",params:{org:c}}),children:"Back to connections"})})}),t[28]=s,t[29]=c,t[30]=D):D=t[30],D}let A;return t[31]!==p.update.isPending||t[32]!==a||t[33]!==x||t[34]!==r||t[35]!==I||t[36]!==$||t[37]!==c||t[38]!==k||t[39]!==d||t[40]!==X||t[41]!==R?(A=n.jsx(qs,{org:c,connection:x,connectionId:r,requestedTabId:d,collections:a,onUpdate:I,isUpdating:p.update.isPending,prompts:k,resources:X,tools:R,isLoadingTools:$}),t[31]=p.update.isPending,t[32]=a,t[33]=x,t[34]=r,t[35]=I,t[36]=$,t[37]=c,t[38]=k,t[39]=d,t[40]=X,t[41]=R,t[42]=A):A=t[42],A}function Qs(t){return{name:t.name,description:t.description,inputSchema:t.inputSchema}}function Js(t){return{uri:t.uri,name:t.name,description:t.description}}function Gs(t){return{name:t.name,description:t.description}}function Zs(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(gt,{children:n.jsx(Y.Suspense,{fallback:n.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:n.jsx(Le,{size:32,className:"animate-spin text-muted-foreground"})}),children:n.jsx(Ks,{})})}),t[0]=e):e=t[0],e}function kr(){const t=U.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Zs,{}),t[0]=e):e=t[0],e}export{kr as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as le,j as e,r as U,u as _e,w as Ce,f as be,g as ke,ac as we,k as Ne,h as Se,i as De,o as de,ad as Pe,s as y,ae as Te}from"./index-BAZLm9w0.js";import{g as Ie}from"./generate-id-Dyweu44Y.js";import{C as $e,a as Ve}from"./collection-table-wrapper-Ad_-F1tG.js";import{C as Ae}from"./collection-search-DgJbkAZh.js";import{C as Ee}from"./connection-card-ByjFlujM.js";import{B as F}from"./badge-BMiZ-mom.js";import{i as Me}from"./AlertCircle-CyK0Qw5h.js";import{i as Be}from"./CheckCircle-Dq1sA0pv.js";import{n as H,E as O,I as Fe}from"./empty-state-Z8nGys2S.js";import{E as He}from"./error-boundary-_n4elsYx.js";import{P as T}from"./index-LE1qlbhg.js";import{u as Oe,U as Z,s as ee}from"./use-list-state-CCCWL8bD.js";import{u as ze}from"./use-binding-C5bwm3GP.js";import{f as Ue,e as Re}from"./registry-utils-DGqTJkDv.js";import{f as Xe,a as Le,b as We,c as Ke,d as Ge,e as qe,A as Ye,g as Qe}from"./alert-dialog-CHAGlLFb.js";import{B as Je,a as Ze,b as et,e as tt}from"./breadcrumb-BjHn0dWR.js";import{B as _}from"./button-nyR0JH2l.js";import{D as nt,a as st,b as ot,c as rt,d as it,e as at}from"./dialog-DobMZv-a.js";import{D as te,a as ne,b as se,c as A}from"./dropdown-menu-BUrC7H_I.js";import{a as ct,F as h,b as x,c as g,d as f,f as j}from"./form-8XJyhmpO.js";import{I as b}from"./input-DHWQboe4.js";import{S as lt,a as dt,b as mt,c as ut,d as I}from"./select-CrjtUXd1.js";import{T as pt}from"./textarea-wjx2NJJH.js";import{d as ht,e as xt,h as gt}from"./use-connection-k5RUrkjP.js";import{u as ft}from"./constants-CJQnv32m.js";import{i as oe}from"./DotsVertical-BpzYqYSl.js";import{s as z}from"./Globe02-DudYvjwY.js";import{i as jt}from"./Loading01-DCWQbhnz.js";import{i as yt}from"./Terminal-CdMAejVo.js";import{s as re}from"./Trash01-C_hJOK44.js";import{r as vt,E as _t,e as me}from"./env-vars-editor-CGiYkoF6.js";import{d as Ct}from"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowUp-BzVEz2lB.js";import"./Check-Dzm8t_lx.js";import"./Grid01-DB4psHwp.js";import"./List-BeVMnZSE.js";import"./view-mode-toggle-DsKf8ZTT.js";import"./table-oiEqEhps.js";import"./SearchMd-BWXZ4bVC.js";import"./card-DVnhjUGd.js";import"./useQuery-Da0DsMDg.js";import"./use-mobile-MoR_lOMO.js";import"./binder-DC5jbVcK.js";import"./ChevronRight-DDdY_PC7.js";import"./X-8UbCzOSY.js";import"./ChevronDown-Z3Dyyuvx.js";import"./useMutation-ffySYpQB.js";import"./Plus-CG8dB40n.js";function ie(s){const n=le.c(3),{status:i}=s;if(i==="active"){let c;return n[0]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(F,{variant:"success",className:"gap-1.5 text-success border-success/40 bg-background",children:[e.jsx(Be,{size:12}),"Active"]}),n[0]=c):c=n[0],c}if(i==="error"){let c;return n[1]===Symbol.for("react.memo_cache_sentinel")?(c=e.jsxs(F,{variant:"outline",className:"gap-1.5 text-destructive border-destructive/40 bg-background",children:[e.jsx(Me,{size:12}),"Error"]}),n[1]=c):c=n[1],c}let d;return n[2]===Symbol.for("react.memo_cache_sentinel")?(d=e.jsx(F,{variant:"outline",className:"text-muted-foreground",children:"Inactive"}),n[2]=d):d=n[2],d}function ae(s){const n=Ct(new Date,s);return n<60?"<1m":n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:n<604800?`${Math.floor(n/86400)}d ago`:n<2592e3?`${Math.floor(n/604800)}w ago`:n<31536e3?`${Math.floor(n/2592e3)}mo ago`:`${Math.floor(n/31536e3)}y ago`}const bt=de({key:y(),value:y()}),kt=de({title:y().min(1,"Name is required"),description:y().nullable().optional(),ui_type:Te(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:y().optional(),connection_token:y().nullable().optional(),npx_package:y().optional(),stdio_command:y().optional(),stdio_args:y().optional(),stdio_cwd:y().optional(),env_vars:Pe(bt).optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function M(s){const n=s.trim();if(!n)return"";try{const i=new URL(n),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return n.replace(/\/+$/,"")}}function wt(s){const n=s.trim().split(/\s+/).filter(Boolean);if(n.length<2)return null;const i=n[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const c=n.slice(1).find(a=>!a.startsWith("-"));return c?{packageName:c}:null}function E(s){const{uiType:n}=s,i=M(s.connectionUrl??"");if((n==="HTTP"||n==="SSE"||n==="Websocket")&&i===M("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(s.npxPackage??"").trim();return n==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function ce(s){if(s.registryItems.length===0||s.uiType!=="HTTP"&&s.uiType!=="SSE"&&s.uiType!=="Websocket")return null;const n=M(s.connectionUrl??"");if(!n)return null;const i=s.registryItems.find(a=>(a.server?.remotes??[]).some(k=>M(k.url??"")===n));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",c=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:c}:null}function Nt(s,n){const i={command:"npx",args:["-y",s]},d=me(n);return Object.keys(d).length>0&&(i.envVars=d),i}function St(s,n,i,d){const c={command:s};n.trim()&&(c.args=n.trim().split(/\s+/)),i?.trim()&&(c.cwd=i.trim());const a=me(d);return Object.keys(a).length>0&&(c.envVars=a),c}function Dt(s){return s.command==="npx"}function Pt(s){return s.args?.find(n=>!n.startsWith("-"))??""}function Tt(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function It(s,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 $t(){const{org:s}=_e(),n=Ce(),i=be({strict:!1}),{data:d}=ke.useSession(),{stdioEnabled:c}=we(),a=Oe({namespace:s.slug,resource:"connections"}),$=ht(),k=xt(a),[v,w]=U.useReducer(It,{mode:"idle"}),R=ze(k)[0],X=R?.id??"",L=Ue(R?.tools),ue=ft({connectionId:X||null,orgId:s.id}),{data:pe}=gt({client:ue,toolName:L,toolArguments:{limit:200},enabled:!!(X&&L),staleTime:3600*1e3,select:t=>t.structuredContent??t}),W=Re(pe??[]),K=i.action==="create",he=()=>{n({to:"/$org/mcps",params:{org:s.slug},search:{action:"create"}})},G=()=>{n({to:"/$org/mcps",params:{org:s.slug},search:{}})},r=Ne({resolver:Se(kt),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),u=r.watch("ui_type"),q=r.watch("connection_url"),xe=r.watch("npx_package"),D=E({uiType:u,connectionUrl:q??"",npxPackage:xe??""})??ce({uiType:u,connectionUrl:q??"",registryItems:W}),m=v.mode==="editing"?v.connection:null;U.useEffect(()=>{if(m){const t=De(m.connection_headers)?m.connection_headers:null;if(t&&m.connection_type==="STDIO"){const o=vt(t.envVars);if(Dt(t)){const l=Pt(t);r.reset({title:m.title,description:m.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o})}else{const l=Tt(t);r.reset({title:m.title,description:m.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:l.command,stdio_args:l.args,stdio_cwd:l.cwd,env_vars:o})}}else r.reset({title:m.title,description:m.description,ui_type:m.connection_type,connection_url:m.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else r.reset({title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[m,r]);const ge=async()=>{if(v.mode!=="deleting")return;const t=v.connection.id;w({type:"close"});try{await $.delete.mutateAsync(t)}catch{}},fe=async t=>{let o,l=null,N=null,C=null;if(t.ui_type==="NPX"?(o="STDIO",l="",C=Nt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(o="STDIO",l="",C=St(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(o=t.ui_type,l=t.connection_url||"",N=t.connection_token||null),m){await $.update.mutateAsync({id:m.id,data:{title:t.title,description:t.description||null,connection_type:o,connection_url:l,...N&&{connection_token:N},...C&&{connection_headers:C}}}),w({type:"close"}),r.reset();return}const S=Ie("conn");await $.create.mutateAsync({id:S,title:t.title,description:t.description||null,connection_type:o,connection_url:l,connection_token:N,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:s.id,icon:null,app_name:null,app_id:null,connection_headers:C,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),G(),r.reset(),n({to:"/$org/mcps/$connectionId",params:{org:s.slug,connectionId:S}})},Y=t=>{t||(K?G():w({type:"close"}),r.reset())},V=t=>{const o=t.trim();if(!o)return;const l=!!r.formState.dirtyFields.title,N=!!r.formState.dirtyFields.description,C=!!r.formState.dirtyFields.env_vars,S=p=>{if(p&&(!l&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!N&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!C&&p.envVarKeys?.length)){const Q=r.getValues("env_vars")??[],ve=new Set(Q.map(P=>P.key)),J=p.envVarKeys.filter(P=>!ve.has(P));J.length>0&&r.setValue("env_vars",[...Q,...J.map(P=>({key:P,value:""}))],{shouldDirty:!0})}},B=wt(o);if(B&&c){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",B.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),S(E({uiType:"NPX",npxPackage:B.packageName}));return}if(o.startsWith("http://")||o.startsWith("https://")){const p=u==="HTTP"||u==="SSE"||u==="Websocket"?u:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",o,{shouldDirty:!0}),S(E({uiType:p,connectionUrl:o})??ce({uiType:p,connectionUrl:o,registryItems:W}));return}u==="NPX"&&S(E({uiType:"NPX",npxPackage:o}))},je=[{id:"title",header:"Name",render:t=>e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(Fe,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(H,{})}),e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title})]}),cellClassName:"w-32 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-muted-foreground truncate block",title:t.description||"",children:t.description||"—"}),cellClassName:"flex-1 min-w-0 max-w-0",wrap:!1,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-xs font-medium",children:t.connection_type}),cellClassName:"w-16 shrink-0",sortable:!0},{id:"status",header:"Status",render:t=>e.jsx(ie,{status:t.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:t=>e.jsx(Z,{id:t.updated_by??t.created_by,size:"3xs"}),cellClassName:"w-32 shrink-0",sortable:!0},{id:"updated_at",header:"Updated",render:t=>e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:t.updated_at?ae(new Date(t.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(te,{children:[e.jsx(ne,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(oe,{size:20})})}),e.jsxs(se,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(A,{onClick:o=>{o.stopPropagation(),n({to:"/$org/mcps/$connectionId",params:{org:s.slug,connectionId:t.id}})},children:[e.jsx(ee,{size:16}),"Open"]}),e.jsxs(A,{variant:"destructive",onClick:o=>{o.stopPropagation(),w({type:"delete",connection:t})},children:[e.jsx(re,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],ye=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",onClick:()=>n({to:"/$org/store",params:{org:s.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(_,{onClick:he,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(T,{children:[e.jsx(nt,{open:K||v.mode==="editing",onOpenChange:Y,children:e.jsxs(st,{className:"sm:max-w-[525px]",children:[e.jsxs(ot,{children:[e.jsx(rt,{children:m?"Edit Connection":"Create Connection"}),e.jsx(it,{children:m?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(ct,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(fe),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(h,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Type *"}),e.jsxs(lt,{value:t.value,onValueChange:t.onChange,children:[e.jsx(f,{children:e.jsx(dt,{children:e.jsx(mt,{})})}),e.jsxs(ut,{children:[e.jsx(I,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(I,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(I,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"Websocket"]})}),c&&e.jsxs(e.Fragment,{children:[e.jsx(I,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(H,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(I,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(yt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(j,{})]})}),u==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(h,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"NPM Package *"}),e.jsx(f,{children:e.jsx(b,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:o=>{const l=o.clipboardData.getData("text");l&&(o.preventDefault(),r.setValue("npx_package",l.trim(),{shouldDirty:!0}),V(l))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx(j,{})]})})}),u==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(h,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Command *"}),e.jsx(f,{children:e.jsx(b,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(j,{})]})}),e.jsx(h,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Arguments"}),e.jsx(f,{children:e.jsx(b,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(j,{})]})})]}),e.jsx(h,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Working Directory"}),e.jsx(f,{children:e.jsx(b,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(j,{})]})})]}),(u==="NPX"||u==="STDIO")&&e.jsx(h,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Environment Variables"}),e.jsx(f,{children:e.jsx(_t,{value:t.value??[],onChange:t.onChange})}),e.jsx(j,{})]})}),u!=="NPX"&&u!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"URL *"}),e.jsx(f,{children:e.jsx(b,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:o=>{const l=o.clipboardData.getData("text");l&&(o.preventDefault(),r.setValue("connection_url",l.trim(),{shouldDirty:!0}),V(l))},onBlur:o=>{V(o.target.value),t.onBlur()}})}),e.jsx(j,{})]})}),e.jsx(h,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:D?.token?.label??"Token (optional)"}),e.jsx(f,{children:e.jsx(b,{type:"password",placeholder:D?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),D?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[D.token.helperText,D.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(j,{})]})})]}),e.jsx(h,{control:r.control,name:"title",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Name *"}),e.jsx(f,{children:e.jsx(b,{placeholder:"My Connection",...t})}),e.jsx(j,{})]})}),e.jsx(h,{control:r.control,name:"description",render:({field:t})=>e.jsxs(x,{children:[e.jsx(g,{children:"Description"}),e.jsx(f,{children:e.jsx(pt,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(j,{})]})})]}),e.jsxs(at,{children:[e.jsx(_,{type:"button",variant:"outline",onClick:()=>Y(!1),children:"Cancel"}),e.jsx(_,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":m?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(Xe,{open:v.mode==="deleting",onOpenChange:t=>!t&&w({type:"close"}),children:e.jsxs(Le,{children:[e.jsxs(We,{children:[e.jsx(Ke,{children:"Delete Connection?"}),e.jsxs(Ge,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:v.mode==="deleting"&&v.connection.title}),"."]})]}),e.jsxs(qe,{children:[e.jsx(Ye,{children:"Cancel"}),e.jsx(Qe,{onClick:ge,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsxs(T.Header,{children:[e.jsx(T.Header.Left,{children:e.jsx(Je,{children:e.jsx(Ze,{children:e.jsx(et,{children:e.jsx(tt,{children:"Connections"})})})})}),e.jsxs(T.Header.Right,{children:[e.jsx($e,{viewMode:a.viewMode,onViewModeChange:a.setViewMode,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}]}),ye]})]}),e.jsx(Ae,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),e.jsx(T.Content,{children:a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:k.length===0?e.jsx(O,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(a.search,"No Connections found"),description:a.search?`No Connections match "${a.search}"`:"Create a connection to get started.",actions:!a.search&&e.jsx(_,{variant:"outline",onClick:()=>n({to:"/$org/store",params:{org:s.slug}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:k.map(t=>e.jsx(Ee,{connection:t,fallbackIcon:e.jsx(H,{}),onClick:()=>n({to:"/$org/mcps/$connectionId",params:{org:s.slug,connectionId:t.id}}),headerActions:e.jsxs(te,{children:[e.jsx(ne,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:e.jsx(oe,{size:20})})}),e.jsxs(se,{align:"end",onClick:o=>o.stopPropagation(),children:[e.jsxs(A,{onClick:o=>{o.stopPropagation(),n({to:"/$org/mcps/$connectionId",params:{org:s.slug,connectionId:t.id}})},children:[e.jsx(ee,{size:16}),"Open"]}),e.jsxs(A,{variant:"destructive",onClick:o=>{o.stopPropagation(),w({type:"delete",connection:t})},children:[e.jsx(re,{size:16}),"Delete"]})]})]}),body:e.jsx(ie,{status:t.status}),footer:e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(Z,{id:t.updated_by??t.created_by,size:"3xs"})}),e.jsx("span",{className:"shrink-0 ml-2",children:t.updated_at?ae(new Date(t.updated_at)):"—"})]})},t.id))})}):e.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:e.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:e.jsx("div",{className:"min-w-[1000px]",children:e.jsx(Ve,{columns:je,data:k,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>n({to:"/$org/mcps/$connectionId",params:{org:s.slug,connectionId:t.id}}),emptyState:a.search?e.jsx(O,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${a.search}"`}):e.jsx(O,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(_,{variant:"outline",onClick:()=>n({to:"/$org/store",params:{org:s.slug}}),children:"Browse Store"})})})})})})})]})}function Dn(){const s=le.c(1);let n;return s[0]===Symbol.for("react.memo_cache_sentinel")?(n=e.jsx(He,{children:e.jsx(U.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(jt,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx($t,{})})}),s[0]=n):n=s[0],n}export{Dn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b1 as d,c as g,q as f,b2 as h}from"./index-BAZLm9w0.js";const u={authConfig:()=>["authConfig"],threads:t=>["threads",t],virtualMcpThreads:(t,e)=>["threads",t,"virtual-mcp",e],thread:(t,e)=>["thread",t,e],threadMessages:(t,e)=>["thread-messages",t,e],messages:t=>["messages",t],organizations:()=>["organizations"],members:t=>[t,"members"],invitations:t=>[t,"invitations"],organizationRoles:t=>[t,"organization-roles"],connections:t=>[t,"connections"],connectionsByBinding:(t,e)=>[t,"connections",`binding:${e}`],connection:(t,e)=>[t,"connection",e],isMCPAuthenticated:(t,e)=>["is-mcp-authenticated",t,e],mcpTools:(t,e)=>["mcp","tools",t,e],mcpClient:(t,e,n,o)=>["mcp","client",t,e,n,o],mcpToolsList:t=>["mcp","client",t,"tools"],mcpResourcesList:t=>["mcp","client",t,"resources"],mcpPromptsList:t=>["mcp","client",t,"prompts"],mcpReadResource:(t,e)=>["mcp","client",t,"resource",e],mcpGetPrompt:(t,e,n)=>["mcp","client",t,"prompt",e,n],mcpToolCall:(t,e,n)=>["mcp","client",t,"tool-call",e,n],organizationSettings:t=>["organization-settings",t],activeOrganization:t=>["activeOrganization",t],modelsList:t=>["models-list",t],connectionCollections:t=>[t,"collections","discovery"],toolCall:(t,e,n)=>["tool-call",t,e,n],collectionItems:(t,e)=>["collection",t,e],collection:(t,e,n)=>[t,e,"collection",n],collectionItem:(t,e,n,o,i)=>[t,e,n,"collection",o,i],collectionList:(t,e,n,o,i)=>[t,e,n,"collection",o,"list",i],collectionListInfinite:(t,e,n,o,i)=>[t,e,n,"collection",o,"list-infinite",i],githubReadme:(t,e)=>["github-readme",t,e],monitoringStats:()=>["monitoring","stats"],monitoringLogs:t=>["monitoring","logs",t],monitoringLogsInfinite:(t,e)=>["monitoring","logs-infinite",t,e],virtualMcpPrompts:t=>["virtual-mcp",t,"prompts"],connectionPrompts:t=>["connection",t,"prompts"],connectionResources:t=>["connection",t,"resources"],user:t=>["user",t]};class _ extends d{constructor(e,n){super(e,n)}send(e,n){const o=y(e);return o?.type==="emit"?(this.onmessage?.(o.message),Promise.resolve()):o?.type==="suppress"?Promise.resolve():super.send(e,n)}}function y(t){const e=t;if(!e||typeof e!="object"||!("method"in e))return null;switch(e.method){case"initialize":{const n=e?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{},resources:{},prompts:{},tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}},serverInfo:{name:"mesh-virtual-mcp",version:"1.0.0"}},jsonrpc:e.jsonrpc??"2.0",id:e.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}const b={name:"mesh-sdk",version:"1.0.0"};function C(t,e){const n=e??(typeof window<"u"?window.location.origin:void 0);if(!n)throw new Error("MCP client requires either meshUrl option or a browser environment.");const o=t?`/mcp/${t}`:"/mcp";return new URL(o,n).href}async function T({connectionId:t,orgId:e,token:n,meshUrl:o}){const i=C(t,o),c=new h(b,{capabilities:{tasks:{list:{},cancel:{},requests:{tool:{call:{}}}}}}),s=new _(new URL(i),{requestInit:{headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream","x-org-id":e,...n?{Authorization:`Bearer ${n}`}:{}}}});await c.connect(s);const r=u.mcpClient(e,t??"self",n??"",o??"");return c.toJSON=()=>`mcp-client:${r.join(":")}`,c}function S(t){const e=g.c(13),{connectionId:n,orgId:o,token:i,meshUrl:c}=t;let s;e[0]!==n||e[1]!==c||e[2]!==o||e[3]!==i?(s=u.mcpClient(o,n??"",i??"",c??""),e[0]=n,e[1]=c,e[2]=o,e[3]=i,e[4]=s):s=e[4];const r=s;let a;e[5]!==n||e[6]!==c||e[7]!==o||e[8]!==i?(a=()=>T({connectionId:n,orgId:o,token:i,meshUrl:c}),e[5]=n,e[6]=c,e[7]=o,e[8]=i,e[9]=a):a=e[9];let l;e[10]!==r||e[11]!==a?(l={queryKey:r,queryFn:a,staleTime:1/0,gcTime:0},e[10]=r,e[11]=a,e[12]=l):l=e[12];const{data:m}=f(l);return m}const P={SELF:t=>`${t}_self`,REGISTRY:t=>`${t}_registry`,COMMUNITY_REGISTRY:t=>`${t}_community-registry`,DEV_ASSETS:t=>`${t}_dev-assets`},M="self";function R(t){return{id:P.REGISTRY(t),title:"Deco Store",description:"Official deco MCP registry with curated integrations",connection_type:"HTTP",connection_url:"https://api.decocms.com/mcp/registry",icon:"https://assets.decocache.com/decocms/00ccf6c3-9e13-4517-83b0-75ab84554bb9/596364c63320075ca58483660156b6d9de9b526e.png",app_name:"deco-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function I(){return{id:"community-registry",title:"MCP Registry",description:"Community MCP registry with thousands of handy MCPs",connection_type:"HTTP",connection_url:"https://sites-registry.decocache.com/mcp",icon:"https://assets.decocache.com/decocms/cd7ca472-0f72-463a-b0de-6e44bdd0f9b4/mcp.png",app_name:"mcp-registry",app_id:null,connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!0,type:"registry"}}}function L(t={}){return{id:t.id,title:"OpenRouter",description:"Access hundreds of LLM models from a single API",icon:"https://openrouter.ai/favicon.ico",app_name:"openrouter",app_id:"openrouter",connection_type:"HTTP",connection_url:"https://sites-openrouter.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{source:"chat",verified:!1,scopeName:"deco",toolsCount:0,publishedAt:null,repository:null}}}function D(){return{title:"MCP Studio",description:"An app that allows you to create and manage MCPs",icon:"https://assets.decocache.com/mcp/09e44283-f47d-4046-955f-816d227c626f/app.png",app_name:"mcp-studio",app_id:"65a1b407-b6af-41e2-a89f-ce9450c05bbc",connection_type:"HTTP",connection_url:"https://sites-vibemcp.decocache.com/mcp",connection_token:null,connection_headers:null,oauth_config:null,configuration_state:null,configuration_scopes:null,metadata:{isDefault:!1,type:"mcp-studio"}}}function E(t){return{id:v(t),organization_id:t,title:"Decopilot",description:"Default agent that aggregates all organization connections",icon:"https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",status:"active",created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:"system",updated_by:void 0,metadata:{instructions:null},connections:[]}}const p="decopilot_";function A(t){return!t||!t.startsWith(p)?null:t.slice(p.length)||null}function v(t){return`${p}${t}`}export{u as K,_ as S,P as W,M as a,I as b,T as c,E as d,D as e,L as f,v as g,R as h,A as i,S as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{H as t,I as a}from"./index-BAZLm9w0.js";const e=t(a,{target:"draft-7"});export{e as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as A,s as D,c as O,h as v,k as E,j as r,g as N}from"./index-
|
|
1
|
+
import{o as A,s as D,c as O,h as v,k as E,j as r,g as N}from"./index-BAZLm9w0.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as k}from"./alert-dialog-CHAGlLFb.js";import{B}from"./button-nyR0JH2l.js";import{F as V,a as q,b as H,c as U,d as G,e as J,f as K}from"./form-8XJyhmpO.js";import{I as P}from"./input-DHWQboe4.js";import{S as Q}from"./spinner-CQdhmUjg.js";import{u as W}from"./useMutation-ffySYpQB.js";function _(o){return o.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function ne(o){const e=O.c(41),{open:a,onOpenChange:s}=o;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:v(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=W(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let x;e[6]!==i?(x=b=>i.mutateAsync(b),e[6]=i,e[7]=x):x=e[7],n=t.handleSubmit(x),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=x=>{const{field:b}=x;return r.jsxs(H,{children:[r.jsx(U,{children:"Organization Name"}),r.jsx(G,{children:r.jsx(P,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(J,{children:"The name of your company or organization"}),b.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:"","/",_(b.value)]})]}),r.jsx(K,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(V,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Q,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(B,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let h;e[26]!==d||e[27]!==g?(h=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=h):h=e[28];let S;e[29]!==h||e[30]!==n||e[31]!==m||e[32]!==c?(S=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,h]}),e[29]=h,e[30]=n,e[31]=m,e[32]=c,e[33]=S):S=e[33];let p;e[34]!==t||e[35]!==S?(p=r.jsxs(M,{children:[F,r.jsx(q,{...t,children:S})]}),e[34]=t,e[35]=S,e[36]=p):p=e[36];let C;return e[37]!==s||e[38]!==a||e[39]!==p?(C=r.jsx(k,{open:a,onOpenChange:s,children:p}),e[37]=s,e[38]=a,e[39]=p,e[40]=C):C=e[40],C}function Y(o){const{orgSlug:e}=o;window.location.href=`/${e}`}async function Z(o){const e=_(o.name);if(!e)throw new Error("Organization slug is invalid");const a=await N.organization.create({name:o.name,slug:e});if(a?.error)throw new Error(a.error.message||"Failed to create organization");const s=a?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{ne as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,j as i,R as u,
|
|
1
|
+
import{c as n,j as i,R as u,x as m,T as x,D as j,y as N,z as D,B as b,E as g}from"./index-BAZLm9w0.js";import{i as h}from"./X-8UbCzOSY.js";import{c}from"./button-nyR0JH2l.js";function k(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",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(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-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(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(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}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(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(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(D,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(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(h,{}),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(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function R(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(y,{}),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($,{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(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"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 B(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 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-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 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("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 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-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{k as D,R as a,B as b,O as c,P as d,E as e,w as f,T as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const f=43200,m=1440,c=Symbol.for("constructDateFrom");function u(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&c in n?n[c](t):n instanceof Date?new n.constructor(t):new Date(t)}function e(n,t){return u(n,n)}function s(n){return t=>{const o=(n?Math[n]:Math.trunc)(t);return o===0?0:o}}function i(n,t){return+e(n)-+e(t)}function M(n,t,r){const o=i(n,t)/1e3;return s(r?.roundingMethod)(o)}export{f as a,u as c,M as d,m,e as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c,j as i,J as p,M as f,Q as m,U as g,W as x,X as v,Y as b,Z as w,_ as h}from"./index-BAZLm9w0.js";import{i as j}from"./ChevronRight-DDdY_PC7.js";import{c as u}from"./button-nyR0JH2l.js";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(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function S(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 $(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-lg 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 _(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-lg 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 y(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 C(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(v,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function T(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-lg 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(j,{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(b,{"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 R(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{M as D,S as a,$ as b,_ as c,C as d,T as e,R as f,y as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as E,a as S,g as N,j as n,aG as j,r as f,aH as b,c as L,m as P}from"./index-BAZLm9w0.js";import{i as x}from"./Loading01-DCWQbhnz.js";import{c as I}from"./binder-DC5jbVcK.js";import{u as H,L as w}from"./localstorage-keys-Ciabbhpd.js";import{e as k}from"./use-connection-k5RUrkjP.js";import{u as z}from"./constants-CJQnv32m.js";import"./useQuery-Da0DsMDg.js";import"./useMutation-ffySYpQB.js";function B(e,r){return e?e.filter(a=>I(a,r)):[]}function y(e){return{id:e.id,title:e.title,icon:e.icon,description:e.description,app_name:e.app_name,app_id:e.app_id,tools:e.tools,metadata:e.metadata}}function O({binding:e,renderHeader:r,renderEmptyState:a}){const{org:i}=E(),{pluginId:t}=S({strict:!1}),d=k(),{data:o}=N.useSession(),l=B(d,e),[s,m]=H(w.pluginConnection(i.slug,t),c=>c??""),u=l.find(c=>c.id===s)??l[0]??null,p=o?.user?{user:{id:o.user.id,name:o.user.name,email:o.user.email,image:o.user.image}}:null,g={id:i.id,slug:i.slug,name:i.name};if(l.length===0||!u){const c={connectionId:null,connection:null,toolCaller:null,org:g,session:p};return n.jsx(j,{value:c,children:n.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:a()})})}const h=z({connectionId:u.id,orgId:i.id}),v={connectionId:u.id,connection:y(u),toolCaller:((c,_)=>h?h.callTool({name:c,arguments:_}).then(C=>C.structuredContent??C):Promise.reject(new Error("MCP client is not available"))),org:g,session:p};return n.jsx(j,{value:v,children:n.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[r({connections:l.map(y),selectedConnectionId:u.id,onConnectionChange:m}),n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(f.Suspense,{fallback:n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(x,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),children:n.jsx(b,{})})})]})})}function q(){const e=L.c(12);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const{pluginId:a}=S(r);let i;e[1]!==a?(i=P.find(s=>s.id===a),e[1]=a,e[2]=i):i=e[2];const t=i;if(t?.renderHeader&&t?.renderEmptyState){let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(x,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[3]=s):s=e[3];let m;return e[4]!==t.binding||e[5]!==t.renderEmptyState||e[6]!==t.renderHeader?(m=n.jsx(f.Suspense,{fallback:s,children:n.jsx(O,{binding:t.binding,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState})}),e[4]=t.binding,e[5]=t.renderEmptyState,e[6]=t.renderHeader,e[7]=m):m=e[7],m}const d=t?.LayoutComponent;if(!d){let s;return e[8]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(b,{}),e[8]=s):s=e[8],s}let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(x,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),e[9]=o):o=e[9];let l;return e[10]!==d?(l=n.jsx(f.Suspense,{fallback:o,children:n.jsx(d,{})}),e[10]=d,e[11]=l):l=e[11],l}export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as p,j as t}from"./index-
|
|
1
|
+
import{c as p,j as t}from"./index-BAZLm9w0.js";import{B as j,c as b}from"./button-nyR0JH2l.js";function v(u){const e=p.c(18),{icon:a,title:m,description:x,buttonProps:n,buttonComponent:f}=u;let s;e[0]!==a?(s=t.jsx("div",{className:"flex items-center justify-center",children:t.jsx("div",{className:"p-6 rounded-full border border-muted",children:t.jsx("div",{className:"p-4 rounded-full border border-border",children:t.jsx("div",{className:"p-3.5 rounded-full border border-border",children:t.jsx("div",{className:"p-3 rounded-full border border-border",children:t.jsx("div",{className:"w-20 h-20 rounded-full bg-muted flex items-center justify-center p-4",children:a})})})})})}),e[0]=a,e[1]=s):s=e[1];let l;e[2]!==m?(l=t.jsx("h3",{className:"text-2xl font-semibold text-foreground text-center",children:m}),e[2]=m,e[3]=l):l=e[3];let r;e[4]!==x?(r=t.jsx("div",{className:"text-sm text-muted-foreground text-center flex flex-col gap-1",children:x}),e[4]=x,e[5]=r):r=e[5];let d;e[6]!==l||e[7]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-md",children:[l,r]}),e[6]=l,e[7]=r,e[8]=d):d=e[8];let i;e[9]!==f||e[10]!==n?(i=f??(n&&t.jsx(j,{variant:"outline",size:"default",className:b("gap-2",n?.className),...n})),e[9]=f,e[10]=n,e[11]=i):i=e[11];let c;e[12]!==i?(c=t.jsx("div",{className:"mt-6",children:i}),e[12]=i,e[13]=c):c=e[13];let o;return e[14]!==s||e[15]!==d||e[16]!==c?(o=t.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[s,d,c]}),e[14]=s,e[15]=d,e[16]=c,e[17]=o):o=e[17],o}export{v as E};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as c,ak as $,av as z,aw as ee,at as te,am as oe,as as ne,al as G,au as re,an as _,aD as se,aE as ae,ax as V,aq as le,aL as ie,aF as ce,c as P}from"./index-yjsBu7QA.js";import{c as R}from"./button-BNRw8VbO.js";var ue=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),de="VisuallyHidden",F=i.forwardRef((o,e)=>c.jsx($.span,{...o,ref:e,style:{...ue,...o.style}}));F.displayName=de;var fe=F,[k]=le("Tooltip",[V]),D=V(),B="TooltipProvider",pe=700,O="tooltip.open",[me,M]=k(B),Y=o=>{const{__scopeTooltip:e,delayDuration:t=pe,skipDelayDuration:n=300,disableHoverableContent:r=!1,children:s}=o,l=i.useRef(!0),d=i.useRef(!1),a=i.useRef(0);return i.useEffect(()=>{const u=a.current;return()=>window.clearTimeout(u)},[]),c.jsx(me,{scope:e,isOpenDelayedRef:l,delayDuration:t,onOpen:i.useCallback(()=>{window.clearTimeout(a.current),l.current=!1},[]),onClose:i.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(()=>l.current=!0,n)},[n]),isPointerInTransitRef:d,onPointerInTransitChange:i.useCallback(u=>{d.current=u},[]),disableHoverableContent:r,children:s})};Y.displayName=B;var L="Tooltip",[xe,S]=k(L),q=o=>{const{__scopeTooltip:e,children:t,open:n,defaultOpen:r,onOpenChange:s,disableHoverableContent:l,delayDuration:d}=o,a=M(L,o.__scopeTooltip),u=D(e),[f,m]=i.useState(null),x=te(),p=i.useRef(0),v=l??a.disableHoverableContent,g=d??a.delayDuration,h=i.useRef(!1),[y,T]=oe({prop:n,defaultProp:r??!1,onChange:j=>{j?(a.onOpen(),document.dispatchEvent(new CustomEvent(O))):a.onClose(),s?.(j)},caller:L}),C=i.useMemo(()=>y?h.current?"delayed-open":"instant-open":"closed",[y]),b=i.useCallback(()=>{window.clearTimeout(p.current),p.current=0,h.current=!1,T(!0)},[T]),w=i.useCallback(()=>{window.clearTimeout(p.current),p.current=0,T(!1)},[T]),E=i.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{h.current=!0,T(!0),p.current=0},g)},[g,T]);return i.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),c.jsx(ne,{...u,children:c.jsx(xe,{scope:e,contentId:x,open:y,stateAttribute:C,trigger:f,onTriggerChange:m,onTriggerEnter:i.useCallback(()=>{a.isOpenDelayedRef.current?E():b()},[a.isOpenDelayedRef,E,b]),onTriggerLeave:i.useCallback(()=>{v?w():(window.clearTimeout(p.current),p.current=0)},[w,v]),onOpen:b,onClose:w,disableHoverableContent:v,children:t})})};q.displayName=L;var A="TooltipTrigger",U=i.forwardRef((o,e)=>{const{__scopeTooltip:t,...n}=o,r=S(A,t),s=M(A,t),l=D(t),d=i.useRef(null),a=G(e,d,r.onTriggerChange),u=i.useRef(!1),f=i.useRef(!1),m=i.useCallback(()=>u.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),c.jsx(re,{asChild:!0,...l,children:c.jsx($.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...n,ref:a,onPointerMove:_(o.onPointerMove,x=>{x.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:_(o.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:_(o.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:_(o.onFocus,()=>{u.current||r.onOpen()}),onBlur:_(o.onBlur,r.onClose),onClick:_(o.onClick,r.onClose)})})});U.displayName=A;var H="TooltipPortal",[he,ve]=k(H,{forceMount:void 0}),W=o=>{const{__scopeTooltip:e,forceMount:t,children:n,container:r}=o,s=S(H,e);return c.jsx(he,{scope:e,forceMount:t,children:c.jsx(z,{present:t||s.open,children:c.jsx(ee,{asChild:!0,container:r,children:n})})})};W.displayName=H;var N="TooltipContent",Z=i.forwardRef((o,e)=>{const t=ve(N,o.__scopeTooltip),{forceMount:n=t.forceMount,side:r="top",...s}=o,l=S(N,o.__scopeTooltip);return c.jsx(z,{present:n||l.open,children:l.disableHoverableContent?c.jsx(X,{side:r,...s,ref:e}):c.jsx(ge,{side:r,...s,ref:e})})}),ge=i.forwardRef((o,e)=>{const t=S(N,o.__scopeTooltip),n=M(N,o.__scopeTooltip),r=i.useRef(null),s=G(e,r),[l,d]=i.useState(null),{trigger:a,onClose:u}=t,f=r.current,{onPointerInTransitChange:m}=n,x=i.useCallback(()=>{d(null),m(!1)},[m]),p=i.useCallback((v,g)=>{const h=v.currentTarget,y={x:v.clientX,y:v.clientY},T=we(y,h.getBoundingClientRect()),C=be(y,T),b=Ee(g.getBoundingClientRect()),w=Pe([...C,...b]);d(w),m(!0)},[m]);return i.useEffect(()=>()=>x(),[x]),i.useEffect(()=>{if(a&&f){const v=h=>p(h,f),g=h=>p(h,a);return a.addEventListener("pointerleave",v),f.addEventListener("pointerleave",g),()=>{a.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",g)}}},[a,f,p,x]),i.useEffect(()=>{if(l){const v=g=>{const h=g.target,y={x:g.clientX,y:g.clientY},T=a?.contains(h)||f?.contains(h),C=!je(y,l);T?x():C&&(x(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[a,f,l,u,x]),c.jsx(X,{...o,ref:s})}),[ye,Te]=k(L,{isInside:!1}),Ce=ie("TooltipContent"),X=i.forwardRef((o,e)=>{const{__scopeTooltip:t,children:n,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:l,...d}=o,a=S(N,t),u=D(t),{onClose:f}=a;return i.useEffect(()=>(document.addEventListener(O,f),()=>document.removeEventListener(O,f)),[f]),i.useEffect(()=>{if(a.trigger){const m=x=>{x.target?.contains(a.trigger)&&f()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[a.trigger,f]),c.jsx(se,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:f,children:c.jsxs(ae,{"data-state":a.stateAttribute,...u,...d,ref:e,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(Ce,{children:n}),c.jsx(ye,{scope:t,isInside:!0,children:c.jsx(fe,{id:a.contentId,role:"tooltip",children:r||n})})]})})});Z.displayName=N;var K="TooltipArrow",J=i.forwardRef((o,e)=>{const{__scopeTooltip:t,...n}=o,r=D(t);return Te(K,t).isInside?null:c.jsx(ce,{...r,...n,ref:e})});J.displayName=K;function we(o,e){const t=Math.abs(e.top-o.y),n=Math.abs(e.bottom-o.y),r=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,n,r,s)){case s:return"left";case r:return"right";case t:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function be(o,e,t=5){const n=[];switch(e){case"top":n.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":n.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":n.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":n.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return n}function Ee(o){const{top:e,right:t,bottom:n,left:r}=o;return[{x:r,y:e},{x:t,y:e},{x:t,y:n},{x:r,y:n}]}function je(o,e){const{x:t,y:n}=o;let r=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const d=e[s],a=e[l],u=d.x,f=d.y,m=a.x,x=a.y;f>n!=x>n&&t<(m-u)*(n-f)/(x-f)+u&&(r=!r)}return r}function Pe(o){const e=o.slice();return e.sort((t,n)=>t.x<n.x?-1:t.x>n.x?1:t.y<n.y?-1:t.y>n.y?1:0),Re(e)}function Re(o){if(o.length<=1)return o.slice();const e=[];for(let n=0;n<o.length;n++){const r=o[n];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(r.y-l.y)>=(s.y-l.y)*(r.x-l.x))e.pop();else break}e.push(r)}e.pop();const t=[];for(let n=o.length-1;n>=0;n--){const r=o[n];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(r.y-l.y)>=(s.y-l.y)*(r.x-l.x))t.pop();else break}t.push(r)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var _e=Y,Ne=q,Le=U,Se=W,Ie=Z,ke=J;const Q=({size:o=24,color:e="currentColor",...t})=>i.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},i.createElement("path",{d:"M20.5 7.278 12 12m0 0L3.5 7.278M12 12v9.5m9-5.441V7.942c0-.343 0-.514-.05-.667a1 1 0 0 0-.215-.364c-.109-.119-.258-.202-.558-.368l-7.4-4.111c-.284-.158-.425-.237-.575-.267a1 1 0 0 0-.403 0c-.15.03-.292.11-.576.267l-7.4 4.11c-.3.167-.45.25-.558.369a1 1 0 0 0-.215.364C3 7.428 3 7.599 3 7.942v8.117c0 .342 0 .514.05.666a1 1 0 0 0 .215.364c.109.119.258.202.558.368l7.4 4.111c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l7.4-4.11c.3-.167.45-.25.558-.369a.999.999 0 0 0 .215-.364c.05-.152.05-.324.05-.666Z"}));Q.displayName="Container";function De(o){const e=P.c(6);let t,n;e[0]!==o?({delayDuration:n,...t}=o,e[0]=o,e[1]=t,e[2]=n):(t=e[1],n=e[2]);const r=n===void 0?0:n;let s;return e[3]!==r||e[4]!==t?(s=c.jsx(_e,{"data-slot":"tooltip-provider",delayDuration:r,...t}),e[3]=r,e[4]=t,e[5]=s):s=e[5],s}function Ve(o){const e=P.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let n;return e[2]!==t?(n=c.jsx(De,{children:c.jsx(Ne,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=n):n=e[3],n}function Fe(o){const e=P.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let n;return e[2]!==t?(n=c.jsx(Le,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=n):n=e[3],n}function Be(o){const e=P.c(13);let t,n,r,s;e[0]!==o?({className:n,sideOffset:s,children:t,...r}=o,e[0]=o,e[1]=t,e[2]=n,e[3]=r,e[4]=s):(t=e[1],n=e[2],r=e[3],s=e[4]);const l=s===void 0?0:s;let d;e[5]!==n?(d=R("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",n),e[5]=n,e[6]=d):d=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(ke,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==l||e[11]!==d?(u=c.jsx(Se,{children:c.jsxs(Ie,{"data-slot":"tooltip-content",sideOffset:l,className:d,...r,children:[t,a]})}),e[8]=t,e[9]=r,e[10]=l,e[11]=d,e[12]=u):u=e[12],u}const Oe={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16"},Ae={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-8",md:"min-w-12",lg:"min-w-16"},Me={"2xs":8,xs:12,sm:16,md:24,lg:32};function Ye(o){const e=P.c(7),{icon:t,name:n,size:r,className:s,fallbackIcon:l}=o,d=r===void 0?"md":r,a=t??"no-icon";let u;return e[0]!==s||e[1]!==l||e[2]!==t||e[3]!==n||e[4]!==d||e[5]!==a?(u=c.jsx(He,{icon:t,name:n,size:d,className:s,fallbackIcon:l},a),e[0]=s,e[1]=l,e[2]=t,e[3]=n,e[4]=d,e[5]=a,e[6]=u):u=e[6],u}function He(o){const e=P.c(24),{icon:t,name:n,size:r,className:s,fallbackIcon:l}=o,d=r===void 0?"md":r,[a,u]=i.useState(!1),f=!!t&&a,m=Oe[d],x=Ae[d];let p;e[0]!==s||e[1]!==m||e[2]!==x?(p=R("rounded-lg border border-border shrink-0 overflow-hidden aspect-square",m,x,s),e[0]=s,e[1]=m,e[2]=x,e[3]=p):p=e[3];const v=t||void 0,g=!f&&"hidden";let h;e[4]!==g?(h=R("h-full w-full object-cover",g),e[4]=g,e[5]=h):h=e[5];let y,T;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>u(!1),T=()=>u(!0),e[6]=y,e[7]=T):(y=e[6],T=e[7]);let C;e[8]!==n||e[9]!==v||e[10]!==h?(C=c.jsx("img",{src:v,alt:n,className:h,onError:y,onLoad:T}),e[8]=n,e[9]=v,e[10]=h,e[11]=C):C=e[11];const b=f&&"hidden";let w;e[12]!==b?(w=R("h-full w-full flex items-center justify-center bg-muted/20",b),e[12]=b,e[13]=w):w=e[13];let E;e[14]!==l||e[15]!==d?(E=l??c.jsx(Q,{size:Me[d],className:"text-muted-foreground"}),e[14]=l,e[15]=d,e[16]=E):E=e[16];let j;e[17]!==w||e[18]!==E?(j=c.jsx("div",{className:w,children:E}),e[17]=w,e[18]=E,e[19]=j):j=e[19];let I;return e[20]!==C||e[21]!==j||e[22]!==p?(I=c.jsxs("div",{className:p,children:[C,j]}),e[20]=C,e[21]=j,e[22]=p,e[23]=I):I=e[23],I}function $e(){const o=P.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),o[0]=e):e=o[0],e}function qe(o){const e=P.c(24),{image:t,title:n,description:r,actions:s,className:l,descriptionClassName:d,actionsClassName:a}=o;let u;e[0]!==l?(u=R("flex flex-1 flex-col items-center justify-center gap-8 p-4",l),e[0]=l,e[1]=u):u=e[1];let f;e[2]!==t?(f=t!==null&&c.jsx("div",{className:"flex items-center justify-center",children:t??c.jsx($e,{})}),e[2]=t,e[3]=f):f=e[3];let m;e[4]!==n?(m=c.jsx("h3",{className:"text-lg font-medium text-foreground",children:n}),e[4]=n,e[5]=m):m=e[5];let x;e[6]!==d?(x=R("text-sm text-muted-foreground text-center max-w-[300px]",d),e[6]=d,e[7]=x):x=e[7];let p;e[8]!==r||e[9]!==x?(p=c.jsx("div",{className:x,children:r}),e[8]=r,e[9]=x,e[10]=p):p=e[10];let v;e[11]!==m||e[12]!==p?(v=c.jsxs("div",{className:"flex flex-col items-center gap-2",children:[m,p]}),e[11]=m,e[12]=p,e[13]=v):v=e[13];let g;e[14]!==s||e[15]!==a?(g=s&&c.jsx("div",{className:R("flex items-center gap-2",a),children:s}),e[14]=s,e[15]=a,e[16]=g):g=e[16];let h;e[17]!==v||e[18]!==g?(h=c.jsxs("div",{className:"flex flex-col items-center gap-4",children:[v,g]}),e[17]=v,e[18]=g,e[19]=h):h=e[19];let y;return e[20]!==u||e[21]!==f||e[22]!==h?(y=c.jsxs("div",{className:u,children:[f,h]}),e[20]=u,e[21]=f,e[22]=h,e[23]=y):y=e[23],y}export{qe as E,Ye as I,Fe as T,ue as V,Be as a,De as b,Ve as c,Q as n};
|
|
1
|
+
import{r as i,j as c,ak as $,av as z,aw as ee,at as te,am as oe,as as ne,al as G,au as re,an as _,aD as se,aE as ae,ax as V,aq as le,b0 as ie,aF as ce,c as P}from"./index-BAZLm9w0.js";import{c as R}from"./button-nyR0JH2l.js";var ue=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),de="VisuallyHidden",F=i.forwardRef((o,e)=>c.jsx($.span,{...o,ref:e,style:{...ue,...o.style}}));F.displayName=de;var fe=F,[k]=le("Tooltip",[V]),D=V(),B="TooltipProvider",pe=700,O="tooltip.open",[me,M]=k(B),Y=o=>{const{__scopeTooltip:e,delayDuration:t=pe,skipDelayDuration:n=300,disableHoverableContent:r=!1,children:s}=o,l=i.useRef(!0),d=i.useRef(!1),a=i.useRef(0);return i.useEffect(()=>{const u=a.current;return()=>window.clearTimeout(u)},[]),c.jsx(me,{scope:e,isOpenDelayedRef:l,delayDuration:t,onOpen:i.useCallback(()=>{window.clearTimeout(a.current),l.current=!1},[]),onClose:i.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(()=>l.current=!0,n)},[n]),isPointerInTransitRef:d,onPointerInTransitChange:i.useCallback(u=>{d.current=u},[]),disableHoverableContent:r,children:s})};Y.displayName=B;var L="Tooltip",[xe,S]=k(L),q=o=>{const{__scopeTooltip:e,children:t,open:n,defaultOpen:r,onOpenChange:s,disableHoverableContent:l,delayDuration:d}=o,a=M(L,o.__scopeTooltip),u=D(e),[f,m]=i.useState(null),x=te(),p=i.useRef(0),v=l??a.disableHoverableContent,g=d??a.delayDuration,h=i.useRef(!1),[y,T]=oe({prop:n,defaultProp:r??!1,onChange:j=>{j?(a.onOpen(),document.dispatchEvent(new CustomEvent(O))):a.onClose(),s?.(j)},caller:L}),C=i.useMemo(()=>y?h.current?"delayed-open":"instant-open":"closed",[y]),b=i.useCallback(()=>{window.clearTimeout(p.current),p.current=0,h.current=!1,T(!0)},[T]),w=i.useCallback(()=>{window.clearTimeout(p.current),p.current=0,T(!1)},[T]),E=i.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{h.current=!0,T(!0),p.current=0},g)},[g,T]);return i.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),c.jsx(ne,{...u,children:c.jsx(xe,{scope:e,contentId:x,open:y,stateAttribute:C,trigger:f,onTriggerChange:m,onTriggerEnter:i.useCallback(()=>{a.isOpenDelayedRef.current?E():b()},[a.isOpenDelayedRef,E,b]),onTriggerLeave:i.useCallback(()=>{v?w():(window.clearTimeout(p.current),p.current=0)},[w,v]),onOpen:b,onClose:w,disableHoverableContent:v,children:t})})};q.displayName=L;var A="TooltipTrigger",U=i.forwardRef((o,e)=>{const{__scopeTooltip:t,...n}=o,r=S(A,t),s=M(A,t),l=D(t),d=i.useRef(null),a=G(e,d,r.onTriggerChange),u=i.useRef(!1),f=i.useRef(!1),m=i.useCallback(()=>u.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),c.jsx(re,{asChild:!0,...l,children:c.jsx($.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...n,ref:a,onPointerMove:_(o.onPointerMove,x=>{x.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:_(o.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:_(o.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:_(o.onFocus,()=>{u.current||r.onOpen()}),onBlur:_(o.onBlur,r.onClose),onClick:_(o.onClick,r.onClose)})})});U.displayName=A;var H="TooltipPortal",[he,ve]=k(H,{forceMount:void 0}),W=o=>{const{__scopeTooltip:e,forceMount:t,children:n,container:r}=o,s=S(H,e);return c.jsx(he,{scope:e,forceMount:t,children:c.jsx(z,{present:t||s.open,children:c.jsx(ee,{asChild:!0,container:r,children:n})})})};W.displayName=H;var N="TooltipContent",Z=i.forwardRef((o,e)=>{const t=ve(N,o.__scopeTooltip),{forceMount:n=t.forceMount,side:r="top",...s}=o,l=S(N,o.__scopeTooltip);return c.jsx(z,{present:n||l.open,children:l.disableHoverableContent?c.jsx(X,{side:r,...s,ref:e}):c.jsx(ge,{side:r,...s,ref:e})})}),ge=i.forwardRef((o,e)=>{const t=S(N,o.__scopeTooltip),n=M(N,o.__scopeTooltip),r=i.useRef(null),s=G(e,r),[l,d]=i.useState(null),{trigger:a,onClose:u}=t,f=r.current,{onPointerInTransitChange:m}=n,x=i.useCallback(()=>{d(null),m(!1)},[m]),p=i.useCallback((v,g)=>{const h=v.currentTarget,y={x:v.clientX,y:v.clientY},T=we(y,h.getBoundingClientRect()),C=be(y,T),b=Ee(g.getBoundingClientRect()),w=Pe([...C,...b]);d(w),m(!0)},[m]);return i.useEffect(()=>()=>x(),[x]),i.useEffect(()=>{if(a&&f){const v=h=>p(h,f),g=h=>p(h,a);return a.addEventListener("pointerleave",v),f.addEventListener("pointerleave",g),()=>{a.removeEventListener("pointerleave",v),f.removeEventListener("pointerleave",g)}}},[a,f,p,x]),i.useEffect(()=>{if(l){const v=g=>{const h=g.target,y={x:g.clientX,y:g.clientY},T=a?.contains(h)||f?.contains(h),C=!je(y,l);T?x():C&&(x(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[a,f,l,u,x]),c.jsx(X,{...o,ref:s})}),[ye,Te]=k(L,{isInside:!1}),Ce=ie("TooltipContent"),X=i.forwardRef((o,e)=>{const{__scopeTooltip:t,children:n,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:l,...d}=o,a=S(N,t),u=D(t),{onClose:f}=a;return i.useEffect(()=>(document.addEventListener(O,f),()=>document.removeEventListener(O,f)),[f]),i.useEffect(()=>{if(a.trigger){const m=x=>{x.target?.contains(a.trigger)&&f()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[a.trigger,f]),c.jsx(se,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:f,children:c.jsxs(ae,{"data-state":a.stateAttribute,...u,...d,ref:e,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(Ce,{children:n}),c.jsx(ye,{scope:t,isInside:!0,children:c.jsx(fe,{id:a.contentId,role:"tooltip",children:r||n})})]})})});Z.displayName=N;var K="TooltipArrow",J=i.forwardRef((o,e)=>{const{__scopeTooltip:t,...n}=o,r=D(t);return Te(K,t).isInside?null:c.jsx(ce,{...r,...n,ref:e})});J.displayName=K;function we(o,e){const t=Math.abs(e.top-o.y),n=Math.abs(e.bottom-o.y),r=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,n,r,s)){case s:return"left";case r:return"right";case t:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function be(o,e,t=5){const n=[];switch(e){case"top":n.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":n.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":n.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":n.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return n}function Ee(o){const{top:e,right:t,bottom:n,left:r}=o;return[{x:r,y:e},{x:t,y:e},{x:t,y:n},{x:r,y:n}]}function je(o,e){const{x:t,y:n}=o;let r=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const d=e[s],a=e[l],u=d.x,f=d.y,m=a.x,x=a.y;f>n!=x>n&&t<(m-u)*(n-f)/(x-f)+u&&(r=!r)}return r}function Pe(o){const e=o.slice();return e.sort((t,n)=>t.x<n.x?-1:t.x>n.x?1:t.y<n.y?-1:t.y>n.y?1:0),Re(e)}function Re(o){if(o.length<=1)return o.slice();const e=[];for(let n=0;n<o.length;n++){const r=o[n];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(r.y-l.y)>=(s.y-l.y)*(r.x-l.x))e.pop();else break}e.push(r)}e.pop();const t=[];for(let n=o.length-1;n>=0;n--){const r=o[n];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(r.y-l.y)>=(s.y-l.y)*(r.x-l.x))t.pop();else break}t.push(r)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var _e=Y,Ne=q,Le=U,Se=W,Ie=Z,ke=J;const Q=({size:o=24,color:e="currentColor",...t})=>i.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},i.createElement("path",{d:"M20.5 7.278 12 12m0 0L3.5 7.278M12 12v9.5m9-5.441V7.942c0-.343 0-.514-.05-.667a1 1 0 0 0-.215-.364c-.109-.119-.258-.202-.558-.368l-7.4-4.111c-.284-.158-.425-.237-.575-.267a1 1 0 0 0-.403 0c-.15.03-.292.11-.576.267l-7.4 4.11c-.3.167-.45.25-.558.369a1 1 0 0 0-.215.364C3 7.428 3 7.599 3 7.942v8.117c0 .342 0 .514.05.666a1 1 0 0 0 .215.364c.109.119.258.202.558.368l7.4 4.111c.284.158.425.237.576.268.133.027.27.027.402 0 .15-.031.292-.11.576-.268l7.4-4.11c.3-.167.45-.25.558-.369a.999.999 0 0 0 .215-.364c.05-.152.05-.324.05-.666Z"}));Q.displayName="Container";function De(o){const e=P.c(6);let t,n;e[0]!==o?({delayDuration:n,...t}=o,e[0]=o,e[1]=t,e[2]=n):(t=e[1],n=e[2]);const r=n===void 0?0:n;let s;return e[3]!==r||e[4]!==t?(s=c.jsx(_e,{"data-slot":"tooltip-provider",delayDuration:r,...t}),e[3]=r,e[4]=t,e[5]=s):s=e[5],s}function Ve(o){const e=P.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let n;return e[2]!==t?(n=c.jsx(De,{children:c.jsx(Ne,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=n):n=e[3],n}function Fe(o){const e=P.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let n;return e[2]!==t?(n=c.jsx(Le,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=n):n=e[3],n}function Be(o){const e=P.c(13);let t,n,r,s;e[0]!==o?({className:n,sideOffset:s,children:t,...r}=o,e[0]=o,e[1]=t,e[2]=n,e[3]=r,e[4]=s):(t=e[1],n=e[2],r=e[3],s=e[4]);const l=s===void 0?0:s;let d;e[5]!==n?(d=R("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",n),e[5]=n,e[6]=d):d=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(ke,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==l||e[11]!==d?(u=c.jsx(Se,{children:c.jsxs(Ie,{"data-slot":"tooltip-content",sideOffset:l,className:d,...r,children:[t,a]})}),e[8]=t,e[9]=r,e[10]=l,e[11]=d,e[12]=u):u=e[12],u}const Oe={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16"},Ae={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-8",md:"min-w-12",lg:"min-w-16"},Me={"2xs":8,xs:12,sm:16,md:24,lg:32};function Ye(o){const e=P.c(7),{icon:t,name:n,size:r,className:s,fallbackIcon:l}=o,d=r===void 0?"md":r,a=t??"no-icon";let u;return e[0]!==s||e[1]!==l||e[2]!==t||e[3]!==n||e[4]!==d||e[5]!==a?(u=c.jsx(He,{icon:t,name:n,size:d,className:s,fallbackIcon:l},a),e[0]=s,e[1]=l,e[2]=t,e[3]=n,e[4]=d,e[5]=a,e[6]=u):u=e[6],u}function He(o){const e=P.c(24),{icon:t,name:n,size:r,className:s,fallbackIcon:l}=o,d=r===void 0?"md":r,[a,u]=i.useState(!1),f=!!t&&a,m=Oe[d],x=Ae[d];let p;e[0]!==s||e[1]!==m||e[2]!==x?(p=R("rounded-lg border border-border shrink-0 overflow-hidden aspect-square",m,x,s),e[0]=s,e[1]=m,e[2]=x,e[3]=p):p=e[3];const v=t||void 0,g=!f&&"hidden";let h;e[4]!==g?(h=R("h-full w-full object-cover",g),e[4]=g,e[5]=h):h=e[5];let y,T;e[6]===Symbol.for("react.memo_cache_sentinel")?(y=()=>u(!1),T=()=>u(!0),e[6]=y,e[7]=T):(y=e[6],T=e[7]);let C;e[8]!==n||e[9]!==v||e[10]!==h?(C=c.jsx("img",{src:v,alt:n,className:h,onError:y,onLoad:T}),e[8]=n,e[9]=v,e[10]=h,e[11]=C):C=e[11];const b=f&&"hidden";let w;e[12]!==b?(w=R("h-full w-full flex items-center justify-center bg-muted/20",b),e[12]=b,e[13]=w):w=e[13];let E;e[14]!==l||e[15]!==d?(E=l??c.jsx(Q,{size:Me[d],className:"text-muted-foreground"}),e[14]=l,e[15]=d,e[16]=E):E=e[16];let j;e[17]!==w||e[18]!==E?(j=c.jsx("div",{className:w,children:E}),e[17]=w,e[18]=E,e[19]=j):j=e[19];let I;return e[20]!==C||e[21]!==j||e[22]!==p?(I=c.jsxs("div",{className:p,children:[C,j]}),e[20]=C,e[21]=j,e[22]=p,e[23]=I):I=e[23],I}function $e(){const o=P.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),o[0]=e):e=o[0],e}function qe(o){const e=P.c(24),{image:t,title:n,description:r,actions:s,className:l,descriptionClassName:d,actionsClassName:a}=o;let u;e[0]!==l?(u=R("flex flex-1 flex-col items-center justify-center gap-8 p-4",l),e[0]=l,e[1]=u):u=e[1];let f;e[2]!==t?(f=t!==null&&c.jsx("div",{className:"flex items-center justify-center",children:t??c.jsx($e,{})}),e[2]=t,e[3]=f):f=e[3];let m;e[4]!==n?(m=c.jsx("h3",{className:"text-lg font-medium text-foreground",children:n}),e[4]=n,e[5]=m):m=e[5];let x;e[6]!==d?(x=R("text-sm text-muted-foreground text-center max-w-[300px]",d),e[6]=d,e[7]=x):x=e[7];let p;e[8]!==r||e[9]!==x?(p=c.jsx("div",{className:x,children:r}),e[8]=r,e[9]=x,e[10]=p):p=e[10];let v;e[11]!==m||e[12]!==p?(v=c.jsxs("div",{className:"flex flex-col items-center gap-2",children:[m,p]}),e[11]=m,e[12]=p,e[13]=v):v=e[13];let g;e[14]!==s||e[15]!==a?(g=s&&c.jsx("div",{className:R("flex items-center gap-2",a),children:s}),e[14]=s,e[15]=a,e[16]=g):g=e[16];let h;e[17]!==v||e[18]!==g?(h=c.jsxs("div",{className:"flex flex-col items-center gap-4",children:[v,g]}),e[17]=v,e[18]=g,e[19]=h):h=e[19];let y;return e[20]!==u||e[21]!==f||e[22]!==h?(y=c.jsxs("div",{className:u,children:[f,h]}),e[20]=u,e[21]=f,e[22]=h,e[23]=y):y=e[23],y}export{qe as E,Ye as I,Fe as T,ue as V,Be as a,Ve as b,De as c,Q as n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as V,j as o}from"./index-
|
|
1
|
+
import{c as V,j as o}from"./index-BAZLm9w0.js";import{B as C}from"./button-nyR0JH2l.js";import{I as P}from"./input-DHWQboe4.js";import{s as A}from"./Plus-CG8dB40n.js";import{s as R}from"./Trash01-C_hJOK44.js";function z(i){const e=i.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(l=>e.includes(l))||["sk_","rk_","whsec_","pk_live","sk_live"].some(l=>e.startsWith(l))||["_key","_secret","_token","_password","_auth","_pat"].some(l=>e.endsWith(l)))}function T(i){const e=V.c(34),{value:t,onChange:s,keyPlaceholder:j,valuePlaceholder:l,className:E}=i,p=j===void 0?"VARIABLE_NAME":j,h=l===void 0?"value...":l;let k;e[0]!==s||e[1]!==t?(k=()=>{s([...t,{key:"",value:""}])},e[0]=s,e[1]=t,e[2]=k):k=e[2];const N=k;let y;e[3]!==s||e[4]!==t?(y=n=>{s(t.filter((c,r)=>r!==n))},e[3]=s,e[4]=t,e[5]=y):y=e[5];const m=y;let g;e[6]!==s||e[7]!==t?(g=(n,c)=>{const r=[...t],a=r[n];a&&(r[n]={key:c,value:a.value},s(r))},e[6]=s,e[7]=t,e[8]=g):g=e[8];const _=g;let x;e[9]!==s||e[10]!==t?(x=(n,c)=>{const r=[...t],a=r[n];a&&(r[n]={key:a.key,value:c},s(r))},e[9]=s,e[10]=t,e[11]=x):x=e[11];const v=x;let u;if(e[12]!==_||e[13]!==m||e[14]!==v||e[15]!==p||e[16]!==t||e[17]!==h){let n;e[19]!==_||e[20]!==m||e[21]!==v||e[22]!==p||e[23]!==h?(n=(c,r)=>o.jsxs("div",{className:"flex gap-2 items-center",children:[o.jsx(P,{placeholder:p,value:c.key,onChange:a=>_(r,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),o.jsx(P,{type:z(c.key)?"password":"text",placeholder:h,value:c.value,onChange:a=>v(r,a.target.value),className:"h-10 rounded-lg flex-1"}),o.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>m(r),children:o.jsx(R,{size:16})})]},r),e[19]=_,e[20]=m,e[21]=v,e[22]=p,e[23]=h,e[24]=n):n=e[24],u=t.map(n),e[12]=_,e[13]=m,e[14]=v,e[15]=p,e[16]=t,e[17]=h,e[18]=u}else u=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(A,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let f;e[26]!==N?(f=o.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:N,children:[w,"Add Environment Variable"]}),e[26]=N,e[27]=f):f=e[27];let d;e[28]!==u||e[29]!==f?(d=o.jsxs("div",{className:"flex flex-col gap-2",children:[u,f]}),e[28]=u,e[29]=f,e[30]=d):d=e[30];let b;return e[31]!==E||e[32]!==d?(b=o.jsx("div",{className:E,children:d}),e[31]=E,e[32]=d,e[33]=b):b=e[33],b}function W(i){const e={};for(const{key:t,value:s}of i)t.trim()&&(e[t.trim()]=s);return e}function $(i){return i?Object.entries(i).map(([e,t])=>({key:e,value:t})):[]}export{T as E,W as e,$ as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,j as e}from"./index-
|
|
1
|
+
import{r as o,j as e}from"./index-BAZLm9w0.js";import{B as n}from"./button-nyR0JH2l.js";const a=({size:t=24,color:r="currentColor",...s})=>o.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},o.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));a.displayName="AlertTriangle";class l extends o.Component{state={hasError:!1,error:null};static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,s){console.error("Uncaught error:",r,s)}resetError=()=>{this.setState({hasError:!1,error:null})};render(){if(this.state.hasError){const{fallback:r}=this.props;return typeof r=="function"?r({error:this.state.error,resetError:this.resetError}):r!==void 0?r: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(a,{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(n,{variant:"outline",onClick:this.resetError,children:"Try again"})]})}return this.props.children}}export{l as E,a as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./constants-DpsR0LZe.js";import{g as A}from"./github-icon-Dp3wHhYE.js";import{g as D}from"./registry-utils-DGqTJkDv.js";import{g as H}from"./generate-id-Dyweu44Y.js";const E="mcp.mesh";function O(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function R(e){const r=e?.identifier||e?.name;return r?r.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):"Unknown"}function j(e,r,d,i){const n=e.server,t=e._meta?.[E],f=new Date().toISOString(),b=t?.friendlyName||t?.friendly_name||e.title||n?.title||n?.name||"Unnamed MCP Server",v=n?.description||null,x=n?.icons?.[0]?.src||A(n?.repository)||null,o=t?.oauth_config,I=o&&typeof o.authorizationEndpoint=="string"&&typeof o.tokenEndpoint=="string"&&typeof o.clientId=="string"&&Array.isArray(o.scopes)&&(o.grantType==="authorization_code"||o.grantType==="client_credentials")?o:null,N=t?.configuration_state,P=t?.configuration_scopes,T=n?.repository?{url:n.repository.url,source:n.repository.source,subfolder:n.repository.subfolder}:null,u=n?.packages??[],m=n?.remotes??[],C=i?.packageIndex??0,S=i?.remoteIndex??0,y=u.length>0&&i?.packageIndex!==void 0,a=y?u[C]:null,s=y?null:m[S];let c,l,_=null;if(a){const h=a.identifier||a.name;c="STDIO",l="";const g={};if(a.environmentVariables)for(const k of a.environmentVariables)k.name&&(g[k.name]="");_={command:"npx",args:h?["-y",h]:[],...Object.keys(g).length>0&&{envVars:g}}}else s?(c=D(s.type)||"HTTP",l=s.url||""):(c="HTTP",l="");const w=m.length>1,M=u.length>1;let p="";a&&M?p=` (${R(a)})`:s&&w&&(p=` (${O(s)})`);const U=b+p;return{id:H("conn"),title:U,description:v,icon:x,app_name:t?.appName||n?.name||null,app_id:t?.id||e.id||null,connection_type:c,connection_url:l,connection_token:null,connection_headers:_,oauth_config:I,configuration_state:N??null,configuration_scopes:P??null,metadata:{source:"store",registry_item_id:e.id,verified:t?.verified??!1,scopeName:t?.scopeName??null,toolsCount:t?.tools?.length??0,publishedAt:t?.publishedAt??null,repository:T},created_at:f,updated_at:f,created_by:d,organization_id:r,tools:null,bindings:null,status:"inactive"}}export{E as M,j as e};
|