@decocms/mesh 1.3.1 → 1.3.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.
Files changed (119) hide show
  1. package/dist/client/assets/{AlertCircle-DoPcYOmu.js → AlertCircle-BMr3-fpA.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-Cho91gJm.js → ArrowLeft-BwQg_SOY.js} +1 -1
  3. package/dist/client/assets/{ChevronDown--_znWqhO.js → ChevronDown-BjyTHawB.js} +1 -1
  4. package/dist/client/assets/{Clock-OrKCoBnu.js → Clock-BqL_Iy4b.js} +1 -1
  5. package/dist/client/assets/{Code01-COExI_48.js → Code01-DkmFiQmz.js} +1 -1
  6. package/dist/client/assets/{Copy01-CdCXGmeI.js → Copy01-D2K_Muqy.js} +1 -1
  7. package/dist/client/assets/{CpuChip02-D26L6TWX.js → CpuChip02-C_MNm5X3.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-kYh71Jmo.js → DotsVertical-D0NEibaO.js} +1 -1
  9. package/dist/client/assets/{File06-D4-QxuCL.js → File06-CXgKQ6DN.js} +1 -1
  10. package/dist/client/assets/{GitBranch01-irv8ZOt4.js → GitBranch01-BUSTYQYz.js} +1 -1
  11. package/dist/client/assets/{Inbox01-CEpI9Sk9.js → Inbox01-CBPg2mpL.js} +1 -1
  12. package/dist/client/assets/{InfoCircle-BH6ukjrt.js → InfoCircle-COZlVleH.js} +1 -1
  13. package/dist/client/assets/{Key01-BvGYoGe8.js → Key01-BperTm8i.js} +1 -1
  14. package/dist/client/assets/{LinkExternal01-C8zs3bR9.js → LinkExternal01-CYB_l3HF.js} +1 -1
  15. package/dist/client/assets/{Loading01-DcFBMaXj.js → Loading01-C4j07Rkx.js} +1 -1
  16. package/dist/client/assets/{Lock01-IqrEd301.js → Lock01-CFQ55MXh.js} +1 -1
  17. package/dist/client/assets/{Play-0EPVk_yg.js → Play-BZ988K1v.js} +1 -1
  18. package/dist/client/assets/{Plus-C--SWih9.js → Plus-mxlUVGel.js} +1 -1
  19. package/dist/client/assets/{SearchMd-DiJjEUCs.js → SearchMd-COBfbXbx.js} +1 -1
  20. package/dist/client/assets/{Terminal-Fx0j4vYu.js → Terminal-RcHlyPBU.js} +1 -1
  21. package/dist/client/assets/{Trash01-ClQp3SU7.js → Trash01-CyKI-_BM.js} +1 -1
  22. package/dist/client/assets/{Upload01-qHdORxg4.js → Upload01-Ck1Svxew.js} +1 -1
  23. package/dist/client/assets/{X-tggfklJn.js → X-BXO-lbAK.js} +1 -1
  24. package/dist/client/assets/{XClose-8ptd0_kG.js → XClose-C64sfNMR.js} +1 -1
  25. package/dist/client/assets/{alert-dialog-BTnJ6w_s.js → alert-dialog-P1n_1JT7.js} +1 -1
  26. package/dist/client/assets/assistant-DpkEh-Jl.js +1 -0
  27. package/dist/client/assets/{auth-DaJav-_Q.js → auth-DP47SEOm.js} +1 -1
  28. package/dist/client/assets/{auth-catchall-Bi1SQUCA.js → auth-catchall-CfVXVPNH.js} +1 -1
  29. package/dist/client/assets/{avatar-CuTiSc9V.js → avatar-_GsuhjwG.js} +1 -1
  30. package/dist/client/assets/{badge-pWud7F0k.js → badge-DC5bHjau.js} +1 -1
  31. package/dist/client/assets/binding-collection-view-MAfjU-3d.js +1 -0
  32. package/dist/client/assets/{button-DoEGRp1U.js → button-dzqjSoP9.js} +1 -1
  33. package/dist/client/assets/{card-CJ-1atZv.js → card-C7renjvY.js} +1 -1
  34. package/dist/client/assets/{checkbox-Bh9rcCG9.js → checkbox-DAye6Bhs.js} +1 -1
  35. package/dist/client/assets/{collection-detail-7RgcpBz4.js → collection-detail-CCxtFEtB.js} +40 -40
  36. package/dist/client/assets/{collection-display-button-B5AAU4Bw.js → collection-display-button-DuYSBdla.js} +1 -1
  37. package/dist/client/assets/{collection-header-Buxr9MZE.js → collection-header-BmMDhAGN.js} +1 -1
  38. package/dist/client/assets/{collection-page-BUbDWask.js → collection-page-Cn_-fCfu.js} +1 -1
  39. package/dist/client/assets/{collection-search-DivVKI30.js → collection-search-B8kQUh1o.js} +1 -1
  40. package/dist/client/assets/collection-tab-CuS_mYhN.js +1 -0
  41. package/dist/client/assets/{collection-table-wrapper-lGkt7E0b.js → collection-table-wrapper-BxibriYd.js} +1 -1
  42. package/dist/client/assets/{connection-card-BQhG2Xa_.js → connection-card-DJnmbeP6.js} +1 -1
  43. package/dist/client/assets/connection-detail-BEAx4Rx8.js +1 -0
  44. package/dist/client/assets/{connections-BASUKxPo.js → connections-DhcecQtM.js} +1 -1
  45. package/dist/client/assets/constants-BVChjGeA.js +1 -0
  46. package/dist/client/assets/{core-DL7Okp2L.js → core-BmgwoN2D.js} +1 -1
  47. package/dist/client/assets/{create-organization-dialog-Dds34l1N.js → create-organization-dialog-C1_fICTk.js} +1 -1
  48. package/dist/client/assets/{dialog-DzOmePFm.js → dialog-CjFuRpNq.js} +1 -1
  49. package/dist/client/assets/{dropdown-menu-B9LS1Ke-.js → dropdown-menu-6B5tpY1h.js} +1 -1
  50. package/dist/client/assets/empty-state-D7F--R-i.js +1 -0
  51. package/dist/client/assets/{env-vars-editor-D8jKdEG-.js → env-vars-editor-CA1M7xF4.js} +1 -1
  52. package/dist/client/assets/{error-boundary-BAtxRJ1Q.js → error-boundary-Kj4QesDI.js} +1 -1
  53. package/dist/client/assets/extract-connection-data-DoCNquGq.js +1 -0
  54. package/dist/client/assets/{form-9MqLiR_v.js → form-DNs0FRpn.js} +1 -1
  55. package/dist/client/assets/formatDistanceToNow-ctvTO9qt.js +1 -0
  56. package/dist/client/assets/gateway-detail-e5GW9_16.js +1 -0
  57. package/dist/client/assets/{gateways-Z3eqRHG3.js → gateways-potF35CW.js} +1 -1
  58. package/dist/client/assets/{home-CKPwY7YW.js → home-CZCW3yxr.js} +1 -1
  59. package/dist/client/assets/{index-IkrlX4J3.js → index--kROx8O6.js} +15 -15
  60. package/dist/client/assets/{index-v-MZw8Iv.js → index-C5Ye_Yv8.js} +1 -1
  61. package/dist/client/assets/index-DNNzqGj5.js +25 -0
  62. package/dist/client/assets/{index-Cu-lUDuQ.js → index-DYEBIV-t.js} +1 -1
  63. package/dist/client/assets/{input-BiKrjh13.js → input-Dos1YqM9.js} +1 -1
  64. package/dist/client/assets/json-BSW9cMnN.js +1 -0
  65. package/dist/client/assets/{json-syntax-highlighter-DKWpZiaG.js → json-syntax-highlighter-DOX4DGR6.js} +2 -2
  66. package/dist/client/assets/{layout-DnHkkkij.js → layout-C2pQBqt8.js} +1 -1
  67. package/dist/client/assets/{lazy-highlighter-B7M4_4X7.js → lazy-highlighter-BeoVpvw-.js} +1 -1
  68. package/dist/client/assets/{localstorage-keys-C9gCmhF_.js → localstorage-keys-Cl6fG_mC.js} +1 -1
  69. package/dist/client/assets/{login-CAWaGgdX.js → login-BkePM8bd.js} +1 -1
  70. package/dist/client/assets/{mcp-oauth-BeIYwRKY.js → mcp-oauth-BAFvA0-x.js} +1 -1
  71. package/dist/client/assets/{members-DuEm4VkF.js → members-DOlpKNSi.js} +1 -1
  72. package/dist/client/assets/{monitoring-m_4t86_p.js → monitoring-C60hZcZG.js} +1 -1
  73. package/dist/client/assets/{oauth-callback-CDIYayLa.js → oauth-callback-Mr11rTZP.js} +1 -1
  74. package/dist/client/assets/{page-C3RAYK9Q.js → page-BxWTpniF.js} +1 -1
  75. package/dist/client/assets/pin-to-sidebar-button-DFstuxz9.js +1 -0
  76. package/dist/client/assets/{popover-DtVun_-z.js → popover-Bflc8KYR.js} +1 -1
  77. package/dist/client/assets/prism-light-CKgeoQoL.js +1 -0
  78. package/dist/client/assets/{resizable-ADGi5uO6.js → resizable-CZ3q7UHO.js} +5 -5
  79. package/dist/client/assets/{resource-tabs-B0Wxp2Cw.js → resource-tabs-C7YApwd6.js} +1 -1
  80. package/dist/client/assets/{select-C6oJSPpc.js → select-Bd0A4qyi.js} +1 -1
  81. package/dist/client/assets/{settings-DpVdsR8r.js → settings-Bzv9x0Xx.js} +1 -1
  82. package/dist/client/assets/shell-layout-JAlTNvh1.js +19 -0
  83. package/dist/client/assets/{spinner-BI2cvb0U.js → spinner-DssEQupg.js} +1 -1
  84. package/dist/client/assets/{store-RumD0h8V.js → store-DDomUn8i.js} +1 -1
  85. package/dist/client/assets/store-app-detail-Cvn5_uEK.js +1 -0
  86. package/dist/client/assets/{switch-CICUEk-x.js → switch-jY_WtmSF.js} +1 -1
  87. package/dist/client/assets/{textarea-DYZxZLq1.js → textarea-CRl6hqQJ.js} +1 -1
  88. package/dist/client/assets/{tools-list-B1pdeGzm.js → tools-list-cySZCndz.js} +1 -1
  89. package/dist/client/assets/{tooltip-DsFBYF2A.js → tooltip-wl_T0hkj.js} +1 -1
  90. package/dist/client/assets/{types-BwKekgcj.js → types-C2--1o8t.js} +1 -1
  91. package/dist/client/assets/{use-binding-CQxg2gSi.js → use-binding-DHbkm4TE.js} +1 -1
  92. package/dist/client/assets/{use-connection-B7SaX83w.js → use-connection-DwuFVoxD.js} +1 -1
  93. package/dist/client/assets/{use-connection-resources-B6GNOl9A.js → use-connection-resources-6iOIsQA9.js} +1 -1
  94. package/dist/client/assets/{use-gateway-BlseD0Sx.js → use-gateway-C48kcbNv.js} +1 -1
  95. package/dist/client/assets/{use-list-state-BU6IyL55.js → use-list-state-DC-EnrYi.js} +1 -1
  96. package/dist/client/assets/{use-mcp-C2f_uqzY.js → use-mcp-LjTWLNoY.js} +1 -1
  97. package/dist/client/assets/{use-members-CWSu_Z-H.js → use-members-k3Q2xXPW.js} +1 -1
  98. package/dist/client/assets/{use-mobile-CdiMQ9En.js → use-mobile-Bmxp2FgH.js} +1 -1
  99. package/dist/client/assets/{use-organization-settings-Cnjs0OiP.js → use-organization-settings-0ztRQ3i7.js} +1 -1
  100. package/dist/client/assets/{use-tool-call-BpBoE-Mi.js → use-tool-call-D1etRfCY.js} +1 -1
  101. package/dist/client/assets/useQuery-5Z2U7Q-f.js +1 -0
  102. package/dist/client/assets/{useSuspenseInfiniteQuery-0wQdaodf.js → useSuspenseInfiniteQuery-Br-4aSkX.js} +1 -1
  103. package/dist/client/assets/{view-mode-toggle-Dq1mWwHt.js → view-mode-toggle-D13jhPxd.js} +1 -1
  104. package/dist/client/assets/{well-known-mcp-DX3tGGx0.js → well-known-mcp-D13f-8h2.js} +1 -1
  105. package/dist/client/assets/workflow-COhnt_Eq.js +1 -0
  106. package/dist/client/index.html +1 -1
  107. package/dist/server/cli.js +124 -124
  108. package/dist/server/server.js +4 -4
  109. package/package.json +1 -1
  110. package/dist/client/assets/connection-detail-DWS__uKs.js +0 -1
  111. package/dist/client/assets/extract-connection-data-lX5EQrvR.js +0 -1
  112. package/dist/client/assets/formatDistanceToNow-D7en5Npb.js +0 -1
  113. package/dist/client/assets/gateway-detail-CxcoEeja.js +0 -1
  114. package/dist/client/assets/index-Bp5sMtgd.js +0 -25
  115. package/dist/client/assets/json-C3gxFz3i.js +0 -1
  116. package/dist/client/assets/prism-light-BDjQ_TVh.js +0 -1
  117. package/dist/client/assets/shell-layout-UFhBDwon.js +0 -19
  118. package/dist/client/assets/store-app-detail-C0Bjj1dL.js +0 -1
  119. package/dist/client/assets/useQuery-9D_KMlJN.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/mesh",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "MCP Mesh - Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- import{r as q,c as B,j as s,K as xt,f as ye,g as Fe,a as gt,t as jt,d as bt,b as vt,as as yt}from"./index-IkrlX4J3.js";import{E as H}from"./SearchMd-DiJjEUCs.js";import{E as st}from"./error-boundary-BAtxRJ1Q.js";import{I as Ce,c as ot,b as Ne,d as Ct,e as Nt,a as St}from"./use-connection-B7SaX83w.js";import{b as wt}from"./use-binding-CQxg2gSi.js";import{E as Ze,u as _t,S as $t}from"./index-Bp5sMtgd.js";import{u as Tt,a as It}from"./use-connection-resources-B6GNOl9A.js";import{B as Se}from"./button-DoEGRp1U.js";import{i as nt}from"./Loading01-DcFBMaXj.js";import{R as Dt}from"./resource-tabs-B0Wxp2Cw.js";import{V as Be,a as At,b as Pt}from"./layout-DnHkkkij.js";import{g as Xe}from"./generate-id-Dyweu44Y.js";import{C as we}from"./collection-display-button-B5AAU4Bw.js";import{C as qe}from"./collection-search-DivVKI30.js";import{C as We}from"./card-CJ-1atZv.js";import{b as it,D as rt,a as lt,d as G}from"./dropdown-menu-B9LS1Ke-.js";import{a as at}from"./Copy01-CdCXGmeI.js";import{i as ct}from"./DotsVertical-kYh71Jmo.js";import{s as dt,u as kt}from"./use-list-state-BU6IyL55.js";import{s as mt}from"./Trash01-ClQp3SU7.js";import{C as Ge}from"./collection-table-wrapper-lGkt7E0b.js";import{n as et}from"./Inbox01-CEpI9Sk9.js";import{A as Ue}from"./avatar-CuTiSc9V.js";import{u as Et}from"./useQuery-9D_KMlJN.js";import{P as He}from"./formatDistanceToNow-D7en5Npb.js";import{B as Lt}from"./extract-connection-data-lX5EQrvR.js";import{A as Rt,g as Mt,c as zt,b as Ot,d as Vt,e as Kt,a as Ut,f as Ft}from"./alert-dialog-BTnJ6w_s.js";import{s as Bt}from"./Plus-C--SWih9.js";import{R as qt,T as Wt}from"./tools-list-B1pdeGzm.js";import"./tooltip-DsFBYF2A.js";import"./auth-DaJav-_Q.js";import"./mcp-oauth-BeIYwRKY.js";import"./env-vars-editor-D8jKdEG-.js";import"./input-BiKrjh13.js";import"./use-tool-call-BpBoE-Mi.js";import"./File06-D4-QxuCL.js";import"./Key01-BvGYoGe8.js";import"./form-9MqLiR_v.js";import"./select-C6oJSPpc.js";import"./ChevronDown--_znWqhO.js";import"./Terminal-Fx0j4vYu.js";import"./use-gateway-BlseD0Sx.js";import"./CpuChip02-D26L6TWX.js";import"./registry-utils-ulDDT0d8.js";import"./index-v-MZw8Iv.js";import"./index-Cu-lUDuQ.js";import"./badge-pWud7F0k.js";import"./ArrowLeft-Cho91gJm.js";import"./view-mode-toggle-Dq1mWwHt.js";import"./use-mobile-CdiMQ9En.js";import"./use-organization-settings-Cnjs0OiP.js";const Je=({size:t=24,color:e="currentColor",...o})=>q.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},q.createElement("path",{d:"M2.876 18.116c.046-.414.069-.62.131-.814a2 2 0 0 1 .234-.485c.111-.17.259-.317.553-.61L17 3a2.828 2.828 0 1 1 4 4L7.794 20.206c-.294.294-.442.442-.611.553a2 2 0 0 1-.485.233c-.193.063-.4.086-.814.132L2.5 21.5l.376-3.384Z"}));Je.displayName="Edit01";function Gt(t,e){const o=t.properties||{};for(const n in o){const l=o[n];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&n in e&&e[n])return e[n]}const i=["image","img","avatar","icon","logo","thumbnail","cover"];for(const n of i)if(e&&typeof e=="object"&&n in e&&typeof e[n]=="string")return e[n]}function Ht(t){const e=B.c(25),{item:o,schema:i,actions:n}=t;let l;e[0]!==o||e[1]!==i?(l=Gt(i,o),e[0]=o,e[1]=i,e[2]=l):l=e[2];const c=l,m=o&&typeof o=="object"&&"description"in o&&typeof o.description=="string"?o.description:void 0;let p;e[3]!==n?(p=n&&Object.keys(n).length>0,e[3]=n,e[4]=p):p=e[4];const r=p;let b;e[5]!==c||e[6]!==o.title?(b=s.jsx(Ce,{icon:c,name:o.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=c,e[6]=o.title,e[7]=b):b=e[7];let S;e[8]!==o.title?(S=s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:o.title}),e[8]=o.title,e[9]=S):S=e[9];const f=m||"No description";let x;e[10]!==f?(x=s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:f}),e[10]=f,e[11]=x):x=e[11];let g;e[12]!==S||e[13]!==x?(g=s.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[S,x]}),e[12]=S,e[13]=x,e[14]=g):g=e[14];let j;e[15]!==b||e[16]!==g?(j=s.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[b,g]}),e[15]=b,e[16]=g,e[17]=j):j=e[17];let d;e[18]!==n||e[19]!==r||e[20]!==o?(d=r&&s.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:Zt,onMouseDown:Yt,children:s.jsxs(it,{children:[s.jsx(rt,{asChild:!0,children:s.jsx(Se,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Qt,children:s.jsx(ct,{size:20})})}),s.jsxs(lt,{align:"end",onClick:Jt,children:[n.open&&s.jsxs(G,{onClick:a=>{a.stopPropagation(),n.open?.(o)},children:[s.jsx(dt,{size:16}),"Open"]}),n.edit&&s.jsxs(G,{onClick:a=>{a.stopPropagation(),n.edit?.(o)},children:[s.jsx(Je,{size:16}),"Edit"]}),n.duplicate&&s.jsxs(G,{onClick:a=>{a.stopPropagation(),n.duplicate?.(o)},children:[s.jsx(at,{size:16}),"Duplicate"]}),n.delete&&s.jsxs(G,{variant:"destructive",onClick:a=>{a.stopPropagation(),n.delete?.(o)},children:[s.jsx(mt,{size:16}),"Delete"]})]})]})}),e[18]=n,e[19]=r,e[20]=o,e[21]=d):d=e[21];let w;return e[22]!==j||e[23]!==d?(w=s.jsxs(We,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[j,d]}),e[22]=j,e[23]=d,e[24]=w):w=e[24],w}function Jt(t){return t.stopPropagation()}function Qt(t){return t.stopPropagation()}function Yt(t){return t.stopPropagation()}function Zt(t){return t.stopPropagation()}function Xt(t){const e=B.c(9);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=ot(),e[0]=o):o=e[0];const i=o;let n;e[1]!==t?(n=xt.user(t),e[1]=t,e[2]=n):n=e[2];let l;e[3]!==t?(l=async()=>(await i("USER_GET",{id:t})).user,e[3]=t,e[4]=l):l=e[4];const c=!!t;let m;return e[5]!==n||e[6]!==l||e[7]!==c?(m={queryKey:n,queryFn:l,staleTime:3e5,retry:1,enabled:c},e[5]=n,e[6]=l,e[7]=c,e[8]=m):m=e[8],Et(m)}function es(t){const e=B.c(33),{id:o,size:i,showEmail:n,className:l}=t,c=i===void 0?"xs":i,m=n===void 0?!1:n,{data:p,isLoading:r,isError:b}=Xt(o);if(r){const a=`flex items-center gap-2 ${l||""}`;let h;e[0]!==c?(h=s.jsx(Ue.Skeleton,{shape:"circle",size:c}),e[0]=c,e[1]=h):h=e[1];let N;e[2]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),e[2]=N):N=e[2];let u;e[3]!==m?(u=m&&s.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"}),e[3]=m,e[4]=u):u=e[4];let _;e[5]!==u?(_=s.jsxs("div",{className:"flex flex-col gap-1",children:[N,u]}),e[5]=u,e[6]=_):_=e[6];let v;return e[7]!==a||e[8]!==h||e[9]!==_?(v=s.jsxs("div",{className:a,children:[h,_]}),e[7]=a,e[8]=h,e[9]=_,e[10]=v):v=e[10],v}if(b||!p){const a=`flex items-center gap-2 ${l||""}`;let h;e[11]!==c?(h=s.jsx(Ue,{shape:"circle",size:c,fallback:"?",muted:!0}),e[11]=c,e[12]=h):h=e[12];let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("div",{className:"flex flex-col",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[13]=N):N=e[13];let u;return e[14]!==a||e[15]!==h?(u=s.jsxs("div",{className:a,children:[h,N]}),e[14]=a,e[15]=h,e[16]=u):u=e[16],u}const S=`flex items-center gap-2 ${l||""}`,f=p.image??void 0;let x;e[17]!==c||e[18]!==f||e[19]!==p.name?(x=s.jsx(Ue,{shape:"circle",size:c,url:f,fallback:p.name}),e[17]=c,e[18]=f,e[19]=p.name,e[20]=x):x=e[20];let g;e[21]!==p.name?(g=s.jsx("div",{className:"text-sm font-medium",children:p.name}),e[21]=p.name,e[22]=g):g=e[22];let j;e[23]!==m||e[24]!==p.email?(j=m&&s.jsx("div",{className:"text-xs text-muted-foreground",children:p.email}),e[23]=m,e[24]=p.email,e[25]=j):j=e[25];let d;e[26]!==g||e[27]!==j?(d=s.jsxs("div",{className:"flex flex-col",children:[g,j]}),e[26]=g,e[27]=j,e[28]=d):d=e[28];let w;return e[29]!==S||e[30]!==x||e[31]!==d?(w=s.jsxs("div",{className:S,children:[x,d]}),e[29]=S,e[30]=x,e[31]=d,e[32]=w):w=e[32],w}const ts=["icon","avatar","logo"],tt=["created_at","created_by","id"];function ss(t){return Object.keys(t).find(e=>ts.includes(e.toLowerCase()))}function ut(t,e){return Object.keys(t.properties||{}).filter(o=>["id","created_at","updated_at","created_by","updated_by"].includes(o)?!1:e?e.includes(o):!0).map(o=>({id:o,label:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," ")}))}function os(t){const e=B.c(32),{data:o,schema:i,viewMode:n,onViewModeChange:l,search:c,sortKey:m,sortDirection:p,onSort:r,actions:b,onItemClick:S,headerActions:f,emptyState:x,readOnly:g,columns:j,hideToolbar:d,sortableFields:w}=t,a=l===void 0?as:l,h=p===void 0?"asc":p,N=r===void 0?ls:r;let u;e[0]!==b?(u=b===void 0?{}:b,e[0]=b,e[1]=u):u=e[1];const _=u,v=S===void 0?rs:S,I=f===void 0?null:f,D=x===void 0?null:x,z=g===void 0?!1:g,T=j===void 0?void 0:j,y=d===void 0?!1:d,R=w===void 0?void 0:w;let L;e[2]!==T||e[3]!==i||e[4]!==R?(L=T?T.filter(is).filter(P=>!R||R.includes(P.id)).map(ns):ut(i,R),e[2]=T,e[3]=i,e[4]=R,e[5]=L):L=e[5];const O=L;let M;e[6]!==I||e[7]!==y||e[8]!==N||e[9]!==a||e[10]!==h||e[11]!==m||e[12]!==O||e[13]!==n?(M=!y&&s.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:s.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[s.jsx("div",{className:"flex items-center gap-2 flex-1",children:I}),s.jsx("div",{className:"flex items-center gap-2 shrink-0",children:s.jsx(we,{viewMode:n,onViewModeChange:a,sortKey:m,sortDirection:h,onSort:N,sortOptions:O})})]})}),e[6]=I,e[7]=y,e[8]=N,e[9]=a,e[10]=h,e[11]=m,e[12]=O,e[13]=n,e[14]=M):M=e[14];let $;e[15]!==_||e[16]!==T||e[17]!==o||e[18]!==D||e[19]!==v||e[20]!==N||e[21]!==z||e[22]!==i||e[23]!==c||e[24]!==h||e[25]!==m||e[26]!==R||e[27]!==n?($=n==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:o.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:D||s.jsx(Ze,{icon:s.jsx(et,{size:36,className:"text-muted-foreground"}),title:"No items found",description:c?"Try adjusting your search":"No items to display"})}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:o.map(P=>s.jsx("div",{onClick:()=>v?.(P),className:"cursor-pointer h-full",children:s.jsx(Ht,{item:P,schema:i,readOnly:z,actions:_})},P.id))})}):s.jsx(Ge,{columns:ms(T,i,R,_),data:o,sortKey:m,sortDirection:h,onSort:N,onRowClick:v,emptyState:D||s.jsx(Ze,{icon:s.jsx(et,{size:36,className:"text-muted-foreground"}),title:"No items found",description:c?"Try adjusting your search":"No items to display"})}),e[15]=_,e[16]=T,e[17]=o,e[18]=D,e[19]=v,e[20]=N,e[21]=z,e[22]=i,e[23]=c,e[24]=h,e[25]=m,e[26]=R,e[27]=n,e[28]=$):$=e[28];let A;return e[29]!==M||e[30]!==$?(A=s.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[M,$]}),e[29]=M,e[30]=$,e[31]=A):A=e[31],A}function ns(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function is(t){return t.sortable!==!1}function rs(){}function ls(){}function as(){}function cs(t){return{id:"actions",header:"",render:e=>s.jsxs(it,{children:[s.jsx(rt,{asChild:!0,children:s.jsx(Se,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:o=>o.stopPropagation(),children:s.jsx(ct,{size:20})})}),s.jsxs(lt,{align:"end",onClick:o=>o.stopPropagation(),children:[t.open&&s.jsxs(G,{onClick:o=>{o.stopPropagation(),t.open?.(e)},children:[s.jsx(dt,{size:16}),"Open"]}),t.edit&&s.jsxs(G,{onClick:o=>{o.stopPropagation(),t.edit?.(e)},children:[s.jsx(Je,{size:16}),"Edit"]}),t.duplicate&&s.jsxs(G,{onClick:o=>{o.stopPropagation(),t.duplicate?.(e)},children:[s.jsx(at,{size:16}),"Duplicate"]}),t.delete&&s.jsxs(G,{variant:"destructive",onClick:o=>{o.stopPropagation(),t.delete?.(e)},children:[s.jsx(mt,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function ft(t){const e=t.type;return Array.isArray(e)?e.every(o=>ft({type:o})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function ds(t,e){const o=t.properties||{},i=Object.keys(o).filter(r=>{const b=o[r];return b&&ft(b)}),n=ss(o),l=[],c=new Set;n&&i.includes(n)&&(l.push(n),c.add(n));const m=["title","description","updated_at","updated_by"];for(const r of m)i.includes(r)&&!c.has(r)&&(l.push(r),c.add(r));const p=i.filter(r=>!c.has(r)&&!tt.includes(r)).sort((r,b)=>r.localeCompare(b));for(const r of p)l.push(r),c.add(r);for(const r of tt)i.includes(r)&&!c.has(r)&&(l.push(r),c.add(r));return l.map(r=>{const b=o[r],S=e?e.includes(r):!["id"].includes(r);return r===n?{id:r,header:"",render:f=>{const x=f[r];return s.jsx(Ce,{icon:x,name:f.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:r==="description"?{id:r,header:"Description",render:f=>{const x=f[r];return x==null?"—":s.jsx("span",{className:"block truncate max-w-[50ch]",children:String(x)})},sortable:S,cellClassName:"max-w-[50ch]"}:r==="created_by"||r==="updated_by"?{id:r,header:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g," "),render:f=>{const x=f[r];return x?s.jsx(es,{id:String(x),size:"xs"}):"—"},sortable:S,cellClassName:"max-w-[250px]"}:b?.format==="date-time"||r.endsWith("_at")?{id:r,header:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g," "),render:f=>{const x=f[r];return x?s.jsx("span",{className:"block truncate max-w-full",children:new Date(x).toLocaleDateString()}):"—"},sortable:S,cellClassName:"max-w-[200px]"}:{id:r,header:r.charAt(0).toUpperCase()+r.slice(1).replace(/_/g," "),render:f=>{const x=f[r];return x==null?"—":s.jsx("span",{className:"block truncate max-w-full",children:String(x)})},sortable:S,cellClassName:"max-w-[200px]"}})}function ms(t,e,o,i){const n=t||ds(e,o);return n.some(m=>m.id==="actions")?n:Object.keys(i).length>0?[...n,cs(i)]:n}function us(t){const e=B.c(117),{connectionId:o,org:i,activeCollection:n}=t,l=n.name,c=n.schema??Lt,m=n.hasCreateTool,p=n.hasUpdateTool,r=n.hasDeleteTool,b=ye(),f=Fe().location.href,{data:x}=gt.useSession(),g=x?.user?.id||"unknown",j=Ne(o);let d;e[0]!==o?(d=ot(o),e[0]=o,e[1]=d):d=e[1];const w=d,a=Ct(o,l,w),h=`${o}-${l}`;let N;e[2]!==i||e[3]!==h?(N={namespace:i,resource:h,defaultSortKey:"updated_at"},e[2]=i,e[3]=h,e[4]=N):N=e[4];const{search:u,searchTerm:_,setSearch:v,viewMode:I,setViewMode:D,sortKey:z,sortDirection:T,handleSort:y}=kt(N);let R;e[5]!==_||e[6]!==T||e[7]!==z?(R={searchTerm:_,sortKey:z,sortDirection:T},e[5]=_,e[6]=T,e[7]=z,e[8]=R):R=e[8];const L=Nt(o,l,w,R),O=!m&&!p&&!r;let M;e[9]!==l||e[10]!==o||e[11]!==b||e[12]!==i?(M=F=>{b({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:i,connectionId:o,collectionName:l,itemId:F.id}})},e[9]=l,e[10]=o,e[11]=b,e[12]=i,e[13]=M):M=e[13];const $=M;let A;e[14]!==a.create||e[15]!==g?(A=async F=>{const ve=new Date().toISOString();await a.create.mutateAsync({...F,id:Xe("conn"),title:`${F.title} (Copy)`,created_at:ve,updated_at:ve,created_by:g,updated_by:g})},e[14]=a.create,e[15]=g,e[16]=A):A=e[16];const P=A,[C,K]=q.useState(null);let V;e[17]===Symbol.for("react.memo_cache_sentinel")?(V=F=>{K(F)},e[17]=V):V=e[17];const k=V;let E;e[18]!==$||e[19]!==p?(E=p&&{edit:$},e[18]=$,e[19]=p,e[20]=E):E=e[20];let U;e[21]!==P||e[22]!==m?(U=m&&{duplicate:P},e[21]=P,e[22]=m,e[23]=U):U=e[23];let W;e[24]!==r?(W=r&&{delete:k},e[24]=r,e[25]=W):W=e[25];let J;e[26]!==W||e[27]!==E||e[28]!==U?(J={...E,...U,...W},e[26]=W,e[27]=E,e[28]=U,e[29]=J):J=e[29];const Q=J;let fe;e[30]!==a.delete||e[31]!==C?(fe=async()=>{C&&(await a.delete.mutateAsync(C.id),K(null))},e[30]=a.delete,e[31]=C,e[32]=fe):fe=e[32];const _e=fe;let pe;e[33]!==a.create||e[34]!==l||e[35]!==o||e[36]!==m||e[37]!==b||e[38]!==i||e[39]!==g?(pe=async()=>{if(!m){jt.error("Create operation is not available for this collection");return}const F=new Date().toISOString(),ve={id:Xe("conn"),title:"New Item",description:"A brief description of the item",created_at:F,updated_at:F,created_by:g,updated_by:g};try{const Ke=await a.create.mutateAsync(ve);b({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:i,connectionId:o,collectionName:l,itemId:Ke.id}})}catch(Ke){console.error("Failed to create item:",Ke)}},e[33]=a.create,e[34]=l,e[35]=o,e[36]=m,e[37]=b,e[38]=i,e[39]=g,e[40]=pe):pe=e[40];const $e=pe;let he;e[41]!==c?(he=ut(c),e[41]=c,e[42]=he):he=e[42];const Te=he,Qe=(L?.length??0)>0,pt=m&&Qe,ht=m&&!Qe&&!u;let xe;e[43]!==a.create||e[44]!==$e||e[45]!==m?(xe=m?s.jsxs(Se,{onClick:$e,size:"sm",disabled:a.create.isPending,className:"h-7",children:[s.jsx(Bt,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[43]=a.create,e[44]=$e,e[45]=m,e[46]=xe):xe=e[46];const Ye=xe,Ie=z;let Y;e[47]!==y||e[48]!==D||e[49]!==T||e[50]!==Te||e[51]!==Ie||e[52]!==I?(Y=s.jsx(we,{viewMode:I,onViewModeChange:D,sortKey:Ie,sortDirection:T,onSort:y,sortOptions:Te}),e[47]=y,e[48]=D,e[49]=T,e[50]=Te,e[51]=Ie,e[52]=I,e[53]=Y):Y=e[53];const De=`${l}s`,Ae=j?.icon??"grid_view";let Z;e[54]!==De||e[55]!==Ae||e[56]!==f?(Z=s.jsx(He,{title:De,url:f,icon:Ae}),e[54]=De,e[55]=Ae,e[56]=f,e[57]=Z):Z=e[57];const Pe=pt&&Ye;let X;e[58]!==Y||e[59]!==Z||e[60]!==Pe?(X=s.jsxs(Be,{children:[Y,Z,Pe]}),e[58]=Y,e[59]=Z,e[60]=Pe,e[61]=X):X=e[61];const ke=`Search ${l}...`;let ee;e[62]!==v?(ee=F=>{F.key==="Escape"&&(v(""),F.target.blur())},e[62]=v,e[63]=ee):ee=e[63];let te;e[64]!==u||e[65]!==v||e[66]!==ke||e[67]!==ee?(te=s.jsx(qe,{value:u,onChange:v,placeholder:ke,onKeyDown:ee}),e[64]=u,e[65]=v,e[66]=ke,e[67]=ee,e[68]=te):te=e[68];let se;e[69]!==L?(se=L??[],e[69]=L,e[70]=se):se=e[70];const Ee=z;let oe;e[71]!==$?(oe=F=>$(F),e[71]=$,e[72]=oe):oe=e[72];const Le="No items found",Re=u?"Try adjusting your search terms":"This collection doesn't have any items yet.",Me=ht?Ye:void 0;let ne;e[73]!==Le||e[74]!==Re||e[75]!==Me?(ne=s.jsx(H,{image:null,title:Le,description:Re,actions:Me}),e[73]=Le,e[74]=Re,e[75]=Me,e[76]=ne):ne=e[76];let ie;e[77]!==y||e[78]!==O||e[79]!==Q||e[80]!==c||e[81]!==u||e[82]!==v||e[83]!==D||e[84]!==T||e[85]!==se||e[86]!==Ee||e[87]!==oe||e[88]!==ne||e[89]!==I?(ie=s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx(os,{hideToolbar:!0,data:se,schema:c,viewMode:I,onViewModeChange:D,search:u,onSearchChange:v,sortKey:Ee,sortDirection:T,onSort:y,actions:Q,onItemClick:oe,readOnly:O,emptyState:ne})}),e[77]=y,e[78]=O,e[79]=Q,e[80]=c,e[81]=u,e[82]=v,e[83]=D,e[84]=T,e[85]=se,e[86]=Ee,e[87]=oe,e[88]=ne,e[89]=I,e[90]=ie):ie=e[90];let re;e[91]!==te||e[92]!==ie?(re=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[te,ie]}),e[91]=te,e[92]=ie,e[93]=re):re=e[93];const ze=!!C;let ge;e[94]===Symbol.for("react.memo_cache_sentinel")?(ge=F=>{F||K(null)},e[94]=ge):ge=e[94];let je;e[95]===Symbol.for("react.memo_cache_sentinel")?(je=s.jsx(zt,{children:"Delete item?"}),e[95]=je):je=e[95];const Oe=C?.title;let le;e[96]!==Oe?(le=s.jsxs(Ot,{children:[je,s.jsxs(Vt,{children:['Are you sure you want to delete "',Oe,'"? This action cannot be undone.']})]}),e[96]=Oe,e[97]=le):le=e[97];let ae;e[98]!==a.delete.isPending?(ae=s.jsx(Rt,{disabled:a.delete.isPending,children:"Cancel"}),e[98]=a.delete.isPending,e[99]=ae):ae=e[99];const Ve=a.delete.isPending?"Deleting...":"Delete";let ce;e[100]!==a.delete.isPending||e[101]!==_e||e[102]!==Ve?(ce=s.jsx(Mt,{onClick:_e,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ve}),e[100]=a.delete.isPending,e[101]=_e,e[102]=Ve,e[103]=ce):ce=e[103];let de;e[104]!==ae||e[105]!==ce?(de=s.jsxs(Kt,{children:[ae,ce]}),e[104]=ae,e[105]=ce,e[106]=de):de=e[106];let me;e[107]!==le||e[108]!==de?(me=s.jsxs(Ut,{children:[le,de]}),e[107]=le,e[108]=de,e[109]=me):me=e[109];let ue;e[110]!==ze||e[111]!==me?(ue=s.jsx(Ft,{open:ze,onOpenChange:ge,children:me}),e[110]=ze,e[111]=me,e[112]=ue):ue=e[112];let be;return e[113]!==X||e[114]!==re||e[115]!==ue?(be=s.jsxs(s.Fragment,{children:[X,re,ue]}),e[113]=X,e[114]=re,e[115]=ue,e[116]=be):be=e[116],be}function fs(t){const e=B.c(42),{prompts:o,connectionId:i,org:n,connectionTitle:l,connectionIcon:c,onPromptClick:m,showToolbar:p,emptyMessage:r}=t,b=p===void 0?!0:p,S=r===void 0?"This connection doesn't have any prompts yet.":r,f=ye(),g=Fe().location.href,[j,d]=q.useState(""),[w,a]=q.useState("table"),[h,N]=q.useState("name"),[u,_]=q.useState("asc");let v;e[0]!==u||e[1]!==h?(v=k=>{h===k?(_(js),u==="desc"&&N(void 0)):(N(k),_("asc"))},e[0]=u,e[1]=h,e[2]=v):v=e[2];const I=v;let D;e[3]!==i||e[4]!==f||e[5]!==m||e[6]!==n?(D=k=>{m?m(k):i&&n&&f({to:"/$org/mcps/$connectionId/$collectionName/$itemId",params:{org:n,connectionId:i,collectionName:"prompts",itemId:encodeURIComponent(k.name)}})},e[3]=i,e[4]=f,e[5]=m,e[6]=n,e[7]=D):D=e[7];const z=D;let T;if(e[8]!==o||e[9]!==j||e[10]!==u||e[11]!==h){const k=!o||o.length===0?[]:j.trim()?(()=>{const E=j.toLowerCase();return o.filter(U=>U.name.toLowerCase().includes(E)||U.description&&U.description.toLowerCase().includes(E))})():o;T=!h||!u?k:[...k].sort((E,U)=>{const W=E[h]||"",J=U[h]||"",Q=String(W).localeCompare(String(J));return u==="asc"?Q:-Q}),e[8]=o,e[9]=j,e[10]=u,e[11]=h,e[12]=T}else T=e[12];const y=T;let R;e[13]===Symbol.for("react.memo_cache_sentinel")?(R=[{id:"name",header:"Name",render:gs,sortable:!0},{id:"description",header:"Description",render:xs,cellClassName:"flex-1",sortable:!0}],e[13]=R):R=e[13];const L=R;let O;e[14]===Symbol.for("react.memo_cache_sentinel")?(O=L.filter(hs).map(ps),e[14]=O):O=e[14];const M=O;let $;e[15]!==c||e[16]!==l||e[17]!==I||e[18]!==b||e[19]!==u||e[20]!==h||e[21]!==g||e[22]!==w?($=b&&s.jsxs(Be,{children:[s.jsx(we,{viewMode:w,onViewModeChange:a,sortKey:h,sortDirection:u,onSort:I,sortOptions:M}),s.jsx(He,{title:l?`${l}: Prompts`:"Prompts",url:g,icon:c??"description"})]}),e[15]=c,e[16]=l,e[17]=I,e[18]=b,e[19]=u,e[20]=h,e[21]=g,e[22]=w,e[23]=$):$=e[23];let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=k=>{k.key==="Escape"&&(d(""),k.target.blur())},e[24]=A):A=e[24];let P;e[25]!==j?(P=s.jsx(qe,{value:j,onChange:d,placeholder:"Search prompts...",onKeyDown:A}),e[25]=j,e[26]=P):P=e[26];let C;e[27]!==S||e[28]!==z||e[29]!==I||e[30]!==j||e[31]!==u||e[32]!==h||e[33]!==y||e[34]!==w?(C=w==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:y.length===0?s.jsx(H,{image:null,title:j?"No prompts found":"No prompts available",description:j?"Try adjusting your search terms":S}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:y.map(k=>s.jsx(We,{className:"cursor-pointer transition-colors",onClick:()=>z(k),children:s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Ce,{icon:null,name:k.name,size:"md",className:"shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex flex-col gap-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:k.name}),s.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:k.description||"No description"})]})]})},k.name))})}):s.jsx(Ge,{columns:L,data:y,isLoading:!1,sortKey:h,sortDirection:u,onSort:I,onRowClick:k=>z(k),emptyState:s.jsx(H,{image:null,title:j?"No prompts found":"No prompts available",description:j?"Try adjusting your search terms":S})}),e[27]=S,e[28]=z,e[29]=I,e[30]=j,e[31]=u,e[32]=h,e[33]=y,e[34]=w,e[35]=C):C=e[35];let K;e[36]!==P||e[37]!==C?(K=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[P,C]}),e[36]=P,e[37]=C,e[38]=K):K=e[38];let V;return e[39]!==K||e[40]!==$?(V=s.jsxs(s.Fragment,{children:[$,K]}),e[39]=K,e[40]=$,e[41]=V):V=e[41],V}function ps(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function hs(t){return t.sortable}function xs(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function gs(t){return s.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:t.name})}function js(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function bs(t){const e=B.c(6),{prompts:o,connectionId:i,org:n}=t,l=Ne(i),c=l?.title,m=l?.icon;let p;return e[0]!==i||e[1]!==n||e[2]!==o||e[3]!==c||e[4]!==m?(p=s.jsx(fs,{prompts:o,connectionId:i,org:n,connectionTitle:c,connectionIcon:m}),e[0]=i,e[1]=n,e[2]=o,e[3]=c,e[4]=m,e[5]=p):p=e[5],p}function vs(t){const e=B.c(2),{repository:o}=t;let i;return e[0]!==o?(i=s.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:s.jsx(qt,{repository:o})}),e[0]=o,e[1]=i):i=e[1],i}function ys(t){const e=B.c(39),{resources:o,connectionTitle:i,connectionIcon:n,onResourceClick:l,showToolbar:c,emptyMessage:m}=t,p=c===void 0?!0:c,r=m===void 0?"This connection doesn't have any resources yet.":m,S=Fe().location.href,[f,x]=q.useState(""),[g,j]=q.useState("table"),[d,w]=q.useState("name"),[a,h]=q.useState("asc");let N;e[0]!==a||e[1]!==d?(N=C=>{d===C?(h(Ts),a==="desc"&&w(void 0)):(w(C),h("asc"))},e[0]=a,e[1]=d,e[2]=N):N=e[2];const u=N;let _;e[3]!==l?(_=C=>{l&&l(C)},e[3]=l,e[4]=_):_=e[4];const v=_;let I;if(e[5]!==o||e[6]!==f||e[7]!==a||e[8]!==d){const C=!o||o.length===0?[]:f.trim()?(()=>{const K=f.toLowerCase();return o.filter(V=>V.uri.toLowerCase().includes(K)||V.name&&V.name.toLowerCase().includes(K)||V.description&&V.description.toLowerCase().includes(K))})():o;I=!d||!a?C:[...C].sort((K,V)=>{const k=K[d]||"",E=V[d]||"",U=String(k).localeCompare(String(E));return a==="asc"?U:-U}),e[5]=o,e[6]=f,e[7]=a,e[8]=d,e[9]=I}else I=e[9];const D=I;let z;e[10]===Symbol.for("react.memo_cache_sentinel")?(z=[{id:"name",header:"Name",render:$s,sortable:!0},{id:"uri",header:"URI",render:_s,sortable:!0},{id:"description",header:"Description",render:ws,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Ss,sortable:!0}],e[10]=z):z=e[10];const T=z;let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=T.filter(Ns).map(Cs),e[11]=y):y=e[11];const R=y;let L;e[12]!==n||e[13]!==i||e[14]!==u||e[15]!==p||e[16]!==a||e[17]!==d||e[18]!==S||e[19]!==g?(L=p&&s.jsxs(Be,{children:[s.jsx(we,{viewMode:g,onViewModeChange:j,sortKey:d,sortDirection:a,onSort:u,sortOptions:R}),s.jsx(He,{title:i?`${i}: Resources`:"Resources",url:S,icon:n??"folder"})]}),e[12]=n,e[13]=i,e[14]=u,e[15]=p,e[16]=a,e[17]=d,e[18]=S,e[19]=g,e[20]=L):L=e[20];let O;e[21]===Symbol.for("react.memo_cache_sentinel")?(O=C=>{C.key==="Escape"&&(x(""),C.target.blur())},e[21]=O):O=e[21];let M;e[22]!==f?(M=s.jsx(qe,{value:f,onChange:x,placeholder:"Search resources...",onKeyDown:O}),e[22]=f,e[23]=M):M=e[23];let $;e[24]!==r||e[25]!==v||e[26]!==u||e[27]!==f||e[28]!==a||e[29]!==d||e[30]!==D||e[31]!==g?($=g==="cards"?s.jsx("div",{className:"flex-1 overflow-auto p-5",children:D.length===0?s.jsx(H,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":r}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:D.map(C=>s.jsx(We,{className:"cursor-pointer transition-colors",onClick:()=>v(C),children:s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Ce,{icon:null,name:C.name||C.uri,size:"md",className:"shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:C.name||C.uri}),s.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:C.uri}),C.description&&s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:C.description})]})]})},C.uri))})}):s.jsx(Ge,{columns:T,data:D,isLoading:!1,sortKey:d,sortDirection:a,onSort:u,onRowClick:C=>v(C),emptyState:s.jsx(H,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":r})}),e[24]=r,e[25]=v,e[26]=u,e[27]=f,e[28]=a,e[29]=d,e[30]=D,e[31]=g,e[32]=$):$=e[32];let A;e[33]!==M||e[34]!==$?(A=s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[M,$]}),e[33]=M,e[34]=$,e[35]=A):A=e[35];let P;return e[36]!==A||e[37]!==L?(P=s.jsxs(s.Fragment,{children:[L,A]}),e[36]=A,e[37]=L,e[38]=P):P=e[38],P}function Cs(t){return{id:t.id,label:typeof t.header=="string"?t.header:t.id}}function Ns(t){return t.sortable}function Ss(t){return s.jsx("span",{className:"text-sm text-muted-foreground",children:t.mimeType||"—"})}function ws(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.description||"—"})}function _s(t){return s.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:t.uri})}function $s(t){return s.jsx("span",{className:"text-sm font-medium text-foreground",children:t.name||t.uri})}function Ts(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Is(t){const e=B.c(6),{resources:o,connectionId:i,org:n}=t,l=Ne(i),c=l?.title,m=l?.icon;let p;return e[0]!==i||e[1]!==n||e[2]!==o||e[3]!==c||e[4]!==m?(p=s.jsx(ys,{resources:o,connectionId:i,org:n,connectionTitle:c,connectionIcon:m}),e[0]=i,e[1]=n,e[2]=o,e[3]=c,e[4]=m,e[5]=p):p=e[5],p}function Ds(t){const e=B.c(4),{tools:o,connectionId:i,org:n}=t;let l;return e[0]!==i||e[1]!==n||e[2]!==o?(l=s.jsx(Wt,{tools:o,connectionId:i,org:n}),e[0]=i,e[1]=n,e[2]=o,e[3]=l):l=e[3],l}function As(t){const e=B.c(61),{connection:o,connectionId:i,org:n,requestedTabId:l,collections:c,onUpdate:m,isUpdating:p,prompts:r,resources:b}=t,S=yt();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/$org/mcps/$connectionId"},e[0]=f):f=e[0];const x=ye(f);let g;e[1]!==i?(g={connectionId:i},e[1]=i,e[2]=g):g=e[2];const j=_t(g),d=j.isAuthenticated,w=o?.metadata?.repository,a=!!w?.url,h=o?.tools?.length??0,N=r.length,u=b.length;let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_={id:"settings",label:"Settings"},e[3]=_):_=e[3];let v;e[4]!==d||e[5]!==h?(v=d&&h>0?[{id:"tools",label:"Tools",count:h}]:[],e[4]=d,e[5]=h,e[6]=v):v=e[6];let I;e[7]!==d||e[8]!==N?(I=d&&N>0?[{id:"prompts",label:"Prompts",count:N}]:[],e[7]=d,e[8]=N,e[9]=I):I=e[9];let D;e[10]!==d||e[11]!==u?(D=d&&u>0?[{id:"resources",label:"Resources",count:u}]:[],e[10]=d,e[11]=u,e[12]=D):D=e[12];let z;if(e[13]!==c||e[14]!==a||e[15]!==d||e[16]!==v||e[17]!==I||e[18]!==D){let E;e[20]!==a?(E=a?[{id:"readme",label:"README"}]:[],e[20]=a,e[21]=E):E=e[21],z=[_,...v,...I,...D,...d?(c||[]).map(Ps):[],...E],e[13]=c,e[14]=a,e[15]=d,e[16]=v,e[17]=I,e[18]=D,e[19]=z}else z=e[19];const T=z,y=T.some(E=>E.id===l)?l:"settings";let R;e[22]!==x?(R=E=>{x({search:U=>({...U,tab:E}),replace:!0})},e[22]=x,e[23]=R):R=e[23];const L=R;let O;e[24]!==c?(O=c||[],e[24]=c,e[25]=O):O=e[25];let M;if(e[26]!==y||e[27]!==O){let E;e[29]!==y?(E=U=>U.name===y,e[29]=y,e[30]=E):E=e[30],M=O.find(E),e[26]=y,e[27]=O,e[28]=M}else M=e[28];const $=M;let A;e[31]!==S.history?(A=()=>S.history.back(),e[31]=S.history,e[32]=A):A=e[32];let P;e[33]!==y||e[34]!==L||e[35]!==T?(P=s.jsx(At,{children:s.jsx(Dt,{tabs:T,activeTab:y,onTabChange:L})}),e[33]=y,e[34]=L,e[35]=T,e[36]=P):P=e[36];let C;e[37]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx(nt,{size:32,className:"animate-spin text-muted-foreground"})}),e[37]=C):C=e[37];let K;e[38]!==$||e[39]!==y||e[40]!==j.isServerError||e[41]!==j.supportsOAuth||e[42]!==o||e[43]!==i||e[44]!==L||e[45]!==a||e[46]!==d||e[47]!==p||e[48]!==m||e[49]!==n||e[50]!==r||e[51]!==w||e[52]!==b?(K=s.jsx(q.Suspense,{fallback:C,children:y==="tools"?s.jsx(Ds,{tools:o.tools??void 0,connectionId:i,org:n}):y==="prompts"?s.jsx(bs,{prompts:r,connectionId:i,org:n}):y==="resources"?s.jsx(Is,{resources:b,connectionId:i,org:n}):y==="settings"?s.jsx($t,{connection:o,onUpdate:m,isUpdating:p,isMCPAuthenticated:d,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onViewReadme:a?()=>L("readme"):void 0}):y==="readme"&&a?s.jsx(vs,{repository:w}):$&&d?s.jsx(us,{connectionId:i,org:n,activeCollection:$},y):s.jsx(H,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[38]=$,e[39]=y,e[40]=j.isServerError,e[41]=j.supportsOAuth,e[42]=o,e[43]=i,e[44]=L,e[45]=a,e[46]=d,e[47]=p,e[48]=m,e[49]=n,e[50]=r,e[51]=w,e[52]=b,e[53]=K):K=e[53];let V;e[54]!==y||e[55]!==K?(V=s.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:s.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:s.jsx(st,{children:K},y)})}),e[54]=y,e[55]=K,e[56]=V):V=e[56];let k;return e[57]!==A||e[58]!==P||e[59]!==V?(k=s.jsxs(Pt,{onBack:A,children:[P,V]}),e[57]=A,e[58]=P,e[59]=V,e[60]=k):k=e[60],k}function Ps(t){return{id:t.name,label:t.displayName}}function ks(){const t=B.c(29);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/mcps/$connectionId"},t[0]=e):e=t[0];const o=ye(e);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/mcps/$connectionId"},t[1]=i):i=t[1];const{connectionId:n,org:l}=bt(i);let c;t[2]===Symbol.for("react.memo_cache_sentinel")?(c={from:"/shell/$org/mcps/$connectionId"},t[2]=c):c=t[2];const p=vt(c).tab||"settings",r=Ne(n),b=St(),S=wt(r??void 0);let f;t[3]!==n?(f=[n],t[3]=n,t[4]=f):f=t[4];const{promptsMap:x}=Tt(f);let g;t[5]!==n?(g=[n],t[5]=n,t[6]=g):g=t[6];const{resourcesMap:j}=It(g);let d;t[7]!==n||t[8]!==x?(d=x.get(n)??[],t[7]=n,t[8]=x,t[9]=d):d=t[9];const w=d;let a;t[10]!==n||t[11]!==j?(a=j.get(n)??[],t[10]=n,t[11]=j,t[12]=a):a=t[12];const h=a;let N;t[13]!==b.update||t[14]!==n?(N=async v=>{await b.update.mutateAsync({id:n,data:v})},t[13]=b.update,t[14]=n,t[15]=N):N=t[15];const u=N;if(!r){let v;return t[16]!==o||t[17]!==l?(v=s.jsx("div",{className:"flex h-full w-full bg-background",children:s.jsx(H,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:s.jsx(Se,{variant:"outline",onClick:()=>o({to:"/$org/mcps",params:{org:l}}),children:"Back to connections"})})}),t[16]=o,t[17]=l,t[18]=v):v=t[18],v}let _;return t[19]!==b.update.isPending||t[20]!==S||t[21]!==r||t[22]!==n||t[23]!==u||t[24]!==l||t[25]!==w||t[26]!==p||t[27]!==h?(_=s.jsx(As,{org:l,connection:r,connectionId:n,requestedTabId:p,collections:S,onUpdate:u,isUpdating:b.update.isPending,prompts:w,resources:h}),t[19]=b.update.isPending,t[20]=S,t[21]=r,t[22]=n,t[23]=u,t[24]=l,t[25]=w,t[26]=p,t[27]=h,t[28]=_):_=t[28],_}function Es(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(st,{children:s.jsx(q.Suspense,{fallback:s.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:s.jsx(nt,{size:32,className:"animate-spin text-muted-foreground"})}),children:s.jsx(ks,{})})}),t[0]=e):e=t[0],e}function Eo(){const t=B.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Es,{}),t[0]=e):e=t[0],e}export{Eo as default};
@@ -1 +0,0 @@
1
- import{B as v}from"./use-binding-CQxg2gSi.js";import{aG as C}from"./index-IkrlX4J3.js";import{b,g as E}from"./registry-utils-ulDDT0d8.js";import{g as N}from"./generate-id-Dyweu44Y.js";const p="mcp.mesh",u="mcp.mesh/publisher-provided",A=C(v,{target:"draft-07"});function R(e,i,s){const t=e.server,o=e._meta?.[p]??t?._meta?.[p],r=e._meta?.[u]??t?._meta?.[u],a=r?.metadata,c=t?.remotes?.[0],d=b(c?.type)||"HTTP",l=new Date().toISOString(),m=r?.friendlyName||e.title||t?.title||t?.name||"Unnamed App",f=t?.description||null,_=t?.icons?.[0]?.src||E(t?.repository)||null,n=a?.oauth_config,g=n&&typeof n.authorizationEndpoint=="string"&&typeof n.tokenEndpoint=="string"&&typeof n.clientId=="string"&&Array.isArray(n.scopes)&&(n.grantType==="authorization_code"||n.grantType==="client_credentials")?n:null,y=a?.configuration_state,h=a?.configuration_scopes,S=t?.repository?{url:t.repository.url,source:t.repository.source,subfolder:t.repository.subfolder}:null;return{id:N("conn"),title:m,description:f,icon:_,app_name:o?.appName||t?.name||null,app_id:o?.id||e.id||null,connection_type:d,connection_url:c?.url||"",connection_token:null,connection_headers:null,oauth_config:g,configuration_state:y??null,configuration_scopes:h??null,metadata:{...a,source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:r?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:S},created_at:l,updated_at:l,created_by:s,organization_id:i,tools:null,bindings:null,status:"inactive"}}function P(e,i){if(!i?.startsWith("@"))return;const[s,t]=i.replace("@","").split("/");if(!(!s||!t))return e.find(o=>{const r=o._meta?.["mcp.mesh"],a=o.server.name;return r?.scopeName===s&&r?.appName===t||a===`${s}/${t}`})}export{A as B,u as M,R as e,P as f};
@@ -1 +0,0 @@
1
- import{br as q,bs as k,bt as L,bu as I,am as _,e as N,bv as Y,bw as H,r as M,bx as B,by as V,bz as J,bA as U,bB as E,bC as T,bD as $,bE as K,c as Z,j as v}from"./index-IkrlX4J3.js";import{B as G}from"./button-DoEGRp1U.js";import{u as tt,b as et,T as nt,a as rt,c as st}from"./tooltip-DsFBYF2A.js";import{u as at,a as ot}from"./use-organization-settings-Cnjs0OiP.js";function F(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function it(e,t,n){const r=e.slice(0);return r[t]=n,r}var ut=class extends q{#r;#t;#s;#a;#e;#n;#o;#i;#u=[];constructor(e,t,n){super(),this.#r=e,this.#a=n,this.#s=[],this.#e=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(e=>{e.subscribe(t=>{this.#d(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(e=>{e.destroy()})}setQueries(e,t){this.#s=e,this.#a=t,k.batch(()=>{const n=this.#e,r=this.#h(this.#s);r.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions));const s=r.map(u=>u.observer),i=s.map(u=>u.getCurrentResult()),o=n.length!==s.length,a=s.some((u,f)=>u!==n[f]),c=o||a,l=c?!0:i.some((u,f)=>{const h=this.#t[f];return!h||!L(u,h)});!c&&!l||(c&&(this.#u=r,this.#e=s),this.#t=i,this.hasListeners()&&(c&&(F(n,s).forEach(u=>{u.destroy()}),F(s,n).forEach(u=>{u.subscribe(f=>{this.#d(u,f)})})),this.#f()))})}getCurrentResult(){return this.#t}getQueries(){return this.#e.map(e=>e.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(e,t){const n=this.#h(e),r=n.map(s=>s.observer.getOptimisticResult(s.defaultedQueryOptions));return[r,s=>this.#l(s??r,t),()=>this.#c(r,n)]}#c(e,t){return t.map((n,r)=>{const s=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?s:n.observer.trackResult(s,i=>{t.forEach(o=>{o.observer.trackProp(i)})})})}#l(e,t){return t?((!this.#n||this.#t!==this.#i||t!==this.#o)&&(this.#o=t,this.#i=this.#t,this.#n=I(this.#n,t(e))),this.#n):e}#h(e){const t=new Map;this.#e.forEach(r=>{const s=r.options.queryHash;if(!s)return;const i=t.get(s);i?i.push(r):t.set(s,[r])});const n=[];return e.forEach(r=>{const s=this.#r.defaultQueryOptions(r),o=t.get(s.queryHash)?.shift()??new _(this.#r,s);n.push({defaultedQueryOptions:s,observer:o})}),n}#d(e,t){const n=this.#e.indexOf(e);n!==-1&&(this.#t=it(this.#t,n,t),this.#f())}#f(){if(this.hasListeners()){const e=this.#n,t=this.#c(this.#t,this.#u),n=this.#l(t,this.#a?.combine);e!==n&&k.batch(()=>{this.listeners.forEach(r=>{r(this.#t)})})}}};function se({queries:e,...t},n){const r=N(n),s=Y(),i=H(),o=M.useMemo(()=>e.map(d=>{const b=r.defaultQueryOptions(d);return b._optimisticResults=s?"isRestoring":"optimistic",b}),[e,r,s]);o.forEach(d=>{B(d);const b=r.getQueryCache().get(d.queryHash);V(d,i,b)}),J(i);const[a]=M.useState(()=>new ut(r,o,t)),[c,l,u]=a.getOptimisticResult(o,t.combine),f=!s&&t.subscribed!==!1;M.useSyncExternalStore(M.useCallback(d=>f?a.subscribe(k.batchCalls(d)):U,[a,f]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),M.useEffect(()=>{a.setQueries(o,t)},[o,t,a]);const y=c.some((d,b)=>E(o[b],d))?c.flatMap((d,b)=>{const g=o[b];if(g){const w=new _(r,g);if(E(g,d))return T(g,w,i);$(d,s)&&T(g,w,i)}return[]}):[];if(y.length>0)throw Promise.all(y);const m=c.find((d,b)=>{const g=o[b];return g&&K({result:d,errorResetBoundary:i,throwOnError:g.throwOnError,query:r.getQueryCache().get(g.queryHash),suspense:g.suspense})});if(m?.error)throw m.error;return l(u())}const z=({size:e=24,color:t="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M12 15v7M8 7.308v2.13c0 .209 0 .313-.02.412a1.001 1.001 0 0 1-.09.254c-.045.09-.11.172-.24.334L6.08 12.4c-.666.833-.999 1.249-.999 1.599a1 1 0 0 0 .376.782C5.731 15 6.264 15 7.33 15h9.342c1.066 0 1.599 0 1.873-.219A1 1 0 0 0 18.92 14c0-.35-.333-.766-1-1.599l-1.569-1.962c-.13-.162-.195-.243-.241-.334a1.004 1.004 0 0 1-.09-.254C16 9.75 16 9.647 16 9.44V7.31c0-.116 0-.174.007-.23.006-.05.015-.1.029-.15a2.02 2.02 0 0 1 .079-.215l1.008-2.52c.294-.735.44-1.102.38-1.397a1 1 0 0 0-.427-.63C16.825 2 16.429 2 15.637 2H8.364c-.792 0-1.188 0-1.44.167a1 1 0 0 0-.426.63c-.06.295.086.662.38 1.397l1.008 2.52c.043.107.064.16.08.215a1 1 0 0 1 .028.15c.006.056.006.114.006.23Z"}));z.displayName="Pin01";function ae(e){const t=Z.c(19),{title:n,url:r,icon:s}=e,{org:i}=tt(),o=at(i.id),a=ot(i.id);let c;t[0]!==o?.sidebar_items||t[1]!==r?(c=o?.sidebar_items?.some(w=>w.url===r),t[0]=o?.sidebar_items,t[1]=r,t[2]=c):c=t[2];const l=!!c;let u;t[3]!==a.update||t[4]!==s||t[5]!==l||t[6]!==o?.sidebar_items||t[7]!==n||t[8]!==r?(u=async()=>{const w=o?.sidebar_items||[];let C;l?C=w.filter(X=>X.url!==r):C=[...w,{title:n,url:r,icon:s}],await a.update.mutateAsync({sidebar_items:C})},t[3]=a.update,t[4]=s,t[5]=l,t[6]=o?.sidebar_items,t[7]=n,t[8]=r,t[9]=u):u=t[9];const f=u,h=l?"secondary":"outline";let y;t[10]===Symbol.for("react.memo_cache_sentinel")?(y=v.jsx(z,{size:16}),t[10]=y):y=t[10];let m;t[11]!==f||t[12]!==h?(m=v.jsx(et,{asChild:!0,children:v.jsx(G,{onClick:f,size:"icon",variant:h,className:"size-7 border border-input",children:y})}),t[11]=f,t[12]=h,t[13]=m):m=t[13];const d=l?"Pinned":"Pin to sidebar";let b;t[14]!==d?(b=v.jsx(nt,{children:d}),t[14]=d,t[15]=b):b=t[15];let g;return t[16]!==m||t[17]!==b?(g=v.jsx(rt,{children:v.jsxs(st,{children:[m,b]})}),t[16]=m,t[17]=b,t[18]=g):g=t[18],g}const S=43200,j=1440,A=Symbol.for("constructDateFrom");function W(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&A in e?e[A](t):e instanceof Date?new e.constructor(t):new Date(t)}function p(e,t){return W(e,e)}let ct={};function lt(){return ct}function Q(e){const t=p(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function R(e,...t){const n=W.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function O(e,t){const n=+p(e)-+p(t);return n<0?-1:n>0?1:n}function ht(e){return W(e,Date.now())}function dt(e,t,n){const[r,s]=R(n?.in,e,t),i=r.getFullYear()-s.getFullYear(),o=r.getMonth()-s.getMonth();return i*12+o}function ft(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function mt(e,t){return+p(e)-+p(t)}function bt(e,t){const n=p(e);return n.setHours(23,59,59,999),n}function gt(e,t){const n=p(e),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function yt(e,t){const n=p(e);return+bt(n)==+gt(n)}function pt(e,t,n){const[r,s,i]=R(n?.in,e,e,t),o=O(s,i),a=Math.abs(dt(s,i));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*a);let c=O(s,i)===-o;yt(r)&&a===1&&O(r,i)===1&&(c=!1);const l=o*(a-+c);return l===0?0:l}function wt(e,t,n){const r=mt(e,t)/1e3;return ft(n?.roundingMethod)(r)}const Mt={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"}},vt=(e,t,n)=>{let r;const s=Mt[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function x(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Pt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Dt={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},St={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ot={date:x({formats:Pt,defaultWidth:"full"}),time:x({formats:Dt,defaultWidth:"full"}),dateTime:x({formats:St,defaultWidth:"full"})},Ct={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},xt=(e,t,n,r)=>Ct[e];function P(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n?.width?String(n.width):o;s=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n?.width?String(n.width):e.defaultWidth;s=e.values[a]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return s[i]}}const kt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Wt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Rt={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"]},Et={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"]},Tt={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"}},Ft={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"}},jt=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},At={ordinalNumber:jt,era:P({values:kt,defaultWidth:"wide"}),quarter:P({values:Wt,defaultWidth:"wide",argumentCallback:e=>e-1}),month:P({values:Rt,defaultWidth:"wide"}),day:P({values:Et,defaultWidth:"wide"}),dayPeriod:P({values:Tt,defaultWidth:"wide",formattingValues:Ft,defaultFormattingWidth:"wide"})};function D(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;const o=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(a)?_t(a,f=>f.test(o)):Qt(a,f=>f.test(o));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(o.length);return{value:l,rest:u}}}function Qt(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function _t(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function zt(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const Xt=/^(\d+)(th|st|nd|rd)?/i,qt=/\d+/i,Lt={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},It={any:[/^b/i,/^(a|c)/i]},Nt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Yt={any:[/1/i,/2/i,/3/i,/4/i]},Ht={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},Bt={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]},Vt={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},Jt={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]},Ut={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},$t={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}},Kt={ordinalNumber:zt({matchPattern:Xt,parsePattern:qt,valueCallback:e=>parseInt(e,10)}),era:D({matchPatterns:Lt,defaultMatchWidth:"wide",parsePatterns:It,defaultParseWidth:"any"}),quarter:D({matchPatterns:Nt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any",valueCallback:e=>e+1}),month:D({matchPatterns:Ht,defaultMatchWidth:"wide",parsePatterns:Bt,defaultParseWidth:"any"}),day:D({matchPatterns:Vt,defaultMatchWidth:"wide",parsePatterns:Jt,defaultParseWidth:"any"}),dayPeriod:D({matchPatterns:Ut,defaultMatchWidth:"any",parsePatterns:$t,defaultParseWidth:"any"})},Zt={code:"en-US",formatDistance:vt,formatLong:Ot,formatRelative:xt,localize:At,match:Kt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Gt(e,t,n){const r=lt(),s=n?.locale??r.locale??Zt,i=2520,o=O(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:o}),[c,l]=R(n?.in,...o>0?[t,e]:[e,t]),u=wt(l,c),f=(Q(l)-Q(c))/1e3,h=Math.round((u-f)/60);let y;if(h<2)return n?.includeSeconds?u<5?s.formatDistance("lessThanXSeconds",5,a):u<10?s.formatDistance("lessThanXSeconds",10,a):u<20?s.formatDistance("lessThanXSeconds",20,a):u<40?s.formatDistance("halfAMinute",0,a):u<60?s.formatDistance("lessThanXMinutes",1,a):s.formatDistance("xMinutes",1,a):h===0?s.formatDistance("lessThanXMinutes",1,a):s.formatDistance("xMinutes",h,a);if(h<45)return s.formatDistance("xMinutes",h,a);if(h<90)return s.formatDistance("aboutXHours",1,a);if(h<j){const m=Math.round(h/60);return s.formatDistance("aboutXHours",m,a)}else{if(h<i)return s.formatDistance("xDays",1,a);if(h<S){const m=Math.round(h/j);return s.formatDistance("xDays",m,a)}else if(h<S*2)return y=Math.round(h/S),s.formatDistance("aboutXMonths",y,a)}if(y=pt(l,c),y<12){const m=Math.round(h/S);return s.formatDistance("xMonths",m,a)}else{const m=y%12,d=Math.trunc(y/12);return m<3?s.formatDistance("aboutXYears",d,a):m<9?s.formatDistance("overXYears",d,a):s.formatDistance("almostXYears",d+1,a)}}function oe(e,t){return Gt(e,ht(e),t)}export{ae as P,oe as f,se as u};
@@ -1 +0,0 @@
1
- import{r as T,c as U,j as t,f as ke,d as Me,b as Oe,v as Ue,_ as Se,w as Ne,g as Be,as as Le,x as Je,y as qe,t as Ie}from"./index-IkrlX4J3.js";import{E as Qe}from"./SearchMd-DiJjEUCs.js";import{E as $e}from"./error-boundary-BAtxRJ1Q.js";import{I as _e,u as Pe}from"./use-connection-B7SaX83w.js";import{T as Ke,S as We}from"./switch-CICUEk-x.js";import{C as Re}from"./checkbox-Bh9rcCG9.js";import{c as K,B as J}from"./button-DoEGRp1U.js";import{i as He}from"./ArrowLeft-Cho91gJm.js";import{C as Xe}from"./collection-search-DivVKI30.js";import{I as we}from"./input-BiKrjh13.js";import{s as Ye}from"./Plus-C--SWih9.js";import{i as Ze}from"./X-tggfklJn.js";import{b as et,a as tt}from"./use-gateway-BlseD0Sx.js";import{u as st,a as nt}from"./use-connection-resources-B6GNOl9A.js";import{a as ce,c as ae,b as de,T as me,i as Te}from"./tooltip-DsFBYF2A.js";import{a as ot}from"./Copy01-CdCXGmeI.js";import{i as lt}from"./CpuChip02-D26L6TWX.js";import{i as ze}from"./InfoCircle-BH6ukjrt.js";import{i as Ce}from"./Loading01-DcFBMaXj.js";import{F as ie,a as rt,b as fe,d as xe,f as he,c as Ae}from"./form-9MqLiR_v.js";import{S as Ee,a as De,b as Fe,c as Ve,d as ue}from"./select-C6oJSPpc.js";import{R as it}from"./resource-tabs-B0Wxp2Cw.js";import{s as ct}from"./slugify-CEUa2lfQ.js";import{P as at,f as dt}from"./formatDistanceToNow-D7en5Npb.js";import{a as mt,V as ut,b as ft}from"./layout-DnHkkkij.js";import"./ChevronDown--_znWqhO.js";import"./badge-pWud7F0k.js";import"./use-organization-settings-Cnjs0OiP.js";const xt=T.memo(function(e){const s=U.c(20),{connection:o,isSelected:d,hasItemsEnabled:l,activeItemsCount:f,totalItemsCount:x,onSelect:a,onToggle:r}=e,i=d?"bg-accent/50":"hover:bg-muted/50";let m;s[0]!==i?(m=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",i),s[0]=i,s[1]=m):m=s[1];let c;s[2]!==o.icon||s[3]!==o.title?(c=t.jsx(_e,{icon:o.icon,name:o.title,size:"xs"}),s[2]=o.icon,s[3]=o.title,s[4]=c):c=s[4];let j;s[5]!==o.title?(j=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.title})}),s[5]=o.title,s[6]=j):j=s[6];let h;s[7]!==a||s[8]!==c||s[9]!==j?(h=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:a,children:[c,j]}),s[7]=a,s[8]=c,s[9]=j,s[10]=h):h=s[10];let p;s[11]!==f||s[12]!==l||s[13]!==r||s[14]!==x?(p=x>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[f,"/",x]}),t.jsx(Re,{checked:l,onCheckedChange:r,onClick:pt})]}),s[11]=f,s[12]=l,s[13]=r,s[14]=x,s[15]=p):p=s[15];let b;return s[16]!==m||s[17]!==h||s[18]!==p?(b=t.jsxs("div",{className:m,children:[h,p]}),s[16]=m,s[17]=h,s[18]=p,s[19]=b):b=s[19],b}),ht=T.memo(function(e){const s=U.c(18),{connectionId:o,item:d,isSelected:l,onToggle:f}=e,x=`item-${o}-${d.id}`,a=l?"text-foreground":"text-muted-foreground";let r;s[0]!==a?(r=K("text-sm font-medium",a),s[0]=a,s[1]=r):r=s[1];let i;s[2]!==d.name||s[3]!==r?(i=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:r,children:d.name})}),s[2]=d.name,s[3]=r,s[4]=i):i=s[4];let m;s[5]!==d.description?(m=d.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:d.description}),s[5]=d.description,s[6]=m):m=s[6];let c;s[7]!==i||s[8]!==m?(c=t.jsxs("div",{className:"flex-1 min-w-0",children:[i,m]}),s[7]=i,s[8]=m,s[9]=c):c=s[9];const j=`item-${o}-${d.id}`;let h;s[10]!==l||s[11]!==f||s[12]!==j?(h=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Re,{id:j,checked:l,onCheckedChange:f,onClick:gt})}),s[10]=l,s[11]=f,s[12]=j,s[13]=h):h=s[13];let p;return s[14]!==x||s[15]!==c||s[16]!==h?(p=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:x,children:[c,h]}),s[14]=x,s[15]=c,s[16]=h,s[17]=p):p=s[17],p});function Ge({itemSet:n,onItemSetChange:e,getItems:s,itemLabel:o,emptyItemsMessage:d,extraContent:l}){const[f,x]=T.useState(""),a=T.useDeferredValue(f),[r,i]=T.useState("all"),[m,c]=T.useState(!1),j=T.useRef(new Set(Object.keys(n))),h=Pe({searchTerm:a.trim()||void 0}),p=j.current,b=[...p.values()].map(u=>h.find(C=>C.id===u)).filter(u=>u!==void 0),S=h.filter(u=>!p.has(u.id)),w=[...b,...S],g=u=>{const C=n[u];return C!==void 0&&C.length>0},y=w.filter(u=>{if(r==="all")return!0;const C=g(u.id);return r==="selected"?C:r==="unselected"?!C:!0}),[v,_]=T.useState(w[0]?.id??null),N=v?w.find(u=>u.id===v)??null:null,D=N?s(N):[],A=(u,C)=>n[u]?.includes(C)??!1,B=(u,C)=>{const k=n[u]??[],P=k.includes(C),F={...n};if(P){const R=k.filter(z=>z!==C);R.length===0?delete F[u]:F[u]=R}else F[u]=[...k,C];e(F)},q=u=>{const C=w.find(V=>V.id===u);if(!C)return;const k=s(C);if(k.length===0)return;const P=n[u]??[],F=k.map(V=>V.id),R=P.length>0&&F.every(V=>P.includes(V)),z={...n};R?delete z[u]:(z[u]=F,_(u)),e(z)},M=u=>{_(u),c(!0)},G=()=>{c(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:K("w-full md:w-80 border-r border-border flex flex-col",m&&"hidden md:flex"),children:[t.jsx(Xe,{value:f,onChange:x,placeholder:"Search MCP Servers..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>i("all"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>i("selected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>i("unselected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:y.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:f?"No connections found":r==="selected"?"No servers selected":r==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:y.map(u=>{const k=s(u).length,P=n[u.id]?.length??0;return t.jsx(xt,{connection:u,isSelected:v===u.id,hasItemsEnabled:g(u.id),activeItemsCount:P,totalItemsCount:k,onSelect:()=>M(u.id),onToggle:()=>q(u.id)},u.id)})})})]}),t.jsx("div",{className:K("flex-1 flex-col",m?"flex":"hidden md:flex"),children:N?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[t.jsx(J,{variant:"ghost",size:"sm",onClick:G,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(He,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(_e,{icon:N.icon,name:N.title,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:N.title}),N.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:N.description})]})]})]}),l,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:D.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:d||`This connection has no ${o} available`}):t.jsx("div",{className:"space-y-2",children:D.map(u=>t.jsx(ht,{connectionId:N.id,item:u,isSelected:A(N.id,u.id),onToggle:()=>B(N.id,u.id)},u.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",o]})})})]})}function pt(n){return n.stopPropagation()}function gt(n){return n.stopPropagation()}function jt(n){const e=U.c(6),{promptSet:s,onPromptSetChange:o,connectionPrompts:d}=n;let l;e[0]!==d?(l=a=>(d.get(a.id)??[]).map(bt),e[0]=d,e[1]=l):l=e[1];const f=l;let x;return e[2]!==f||e[3]!==o||e[4]!==s?(x=t.jsx(Ge,{itemSet:s,onItemSetChange:o,getItems:f,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=f,e[3]=o,e[4]=s,e[5]=x):x=e[5],x}function bt(n){return{id:n.name,name:n.name,description:n.description}}function yt(n){return n.includes("*")}function vt(n){const e=U.c(27),{patterns:s,onAddPattern:o,onRemovePattern:d}=n,[l,f]=T.useState("");let x;e[0]!==l||e[1]!==o||e[2]!==s?(x=()=>{const c=l.trim();c&&!s.includes(c)&&(o(c),f(""))},e[0]=l,e[1]=o,e[2]=s,e[3]=x):x=e[3];const a=x;let r;e[4]!==a?(r=c=>{c.key==="Enter"&&(c.preventDefault(),a())},e[4]=a,e[5]=r):r=e[5];const i=r;let m;if(e[6]!==a||e[7]!==i||e[8]!==l||e[9]!==d||e[10]!==s){const c=s.filter(yt);let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("code",{children:"*"}),e[12]=j):j=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",j," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=h):h=e[13];let p;e[14]===Symbol.for("react.memo_cache_sentinel")?(p=_=>f(_.target.value),e[14]=p):p=e[14];let b;e[15]!==i||e[16]!==l?(b=t.jsx(we,{value:l,onChange:p,onKeyDown:i,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=i,e[16]=l,e[17]=b):b=e[17];let S;e[18]!==l?(S=l.trim(),e[18]=l,e[19]=S):S=e[19];const w=!S;let g;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ye,{size:16}),e[20]=g):g=e[20];let y;e[21]!==a||e[22]!==w?(y=t.jsx(J,{type:"button",variant:"outline",size:"sm",onClick:a,disabled:w,children:g}),e[21]=a,e[22]=w,e[23]=y):y=e[23];let v;e[24]!==y||e[25]!==b?(v=t.jsxs("div",{className:"flex gap-2",children:[b,y]}),e[24]=y,e[25]=b,e[26]=v):v=e[26],m=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[h,v,c.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:c.map(_=>t.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[t.jsx("code",{className:"text-foreground",children:_}),t.jsx("button",{type:"button",onClick:()=>d(_),className:"text-muted-foreground hover:text-foreground",children:t.jsx(Ze,{size:12})})]},_))})]}),e[6]=a,e[7]=i,e[8]=l,e[9]=d,e[10]=s,e[11]=m}else m=e[11];return m}function St(n){const e=U.c(23),{resourceSet:s,onResourceSetChange:o,connectionResources:d}=n,[l]=T.useState(null);let f;e[0]!==d?(f=g=>(d.get(g.id)??[]).map(Ct),e[0]=d,e[1]=f):f=e[1];const x=f;let a;e[2]!==o||e[3]!==s?(a=(g,y)=>{const v=s[g]??[];v.includes(y)||o({...s,[g]:[...v,y]})},e[2]=o,e[3]=s,e[4]=a):a=e[4];const r=a;let i;e[5]!==o||e[6]!==s?(i=(g,y)=>{const _=(s[g]??[]).filter(N=>N!==y);if(_.length===0){const N={...s};delete N[g],o(N)}else o({...s,[g]:_})},e[5]=o,e[6]=s,e[7]=i):i=e[7];const m=i;let c;e[8]!==o?(c=g=>{o(g)},e[8]=o,e[9]=c):c=e[9];const j=c;let h;e[10]!==s||e[11]!==l?(h=l?s[l]??[]:[],e[10]=s,e[11]=l,e[12]=h):h=e[12];const p=h;let b;e[13]!==r||e[14]!==m||e[15]!==l||e[16]!==p?(b=l?t.jsx(vt,{patterns:p,onAddPattern:g=>r(l,g),onRemovePattern:g=>m(l,g)}):null,e[13]=r,e[14]=m,e[15]=l,e[16]=p,e[17]=b):b=e[17];const S=b;let w;return e[18]!==S||e[19]!==x||e[20]!==j||e[21]!==s?(w=t.jsx("div",{className:"h-full",children:t.jsx(Ge,{itemSet:s,onItemSetChange:j,getItems:x,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:S})}),e[18]=S,e[19]=x,e[20]=j,e[21]=s,e[22]=w):w=e[22],w}function Ct(n){return{id:n.uri,name:n.name||n.uri,description:n.description||n.uri}}function _t(n){const s=new TextEncoder().encode(n),o=Array.from(s,d=>String.fromCharCode(d)).join("");return btoa(o)}function wt(n){const e=U.c(52),{serverName:s,gatewayUrl:o}=n,[d,l]=T.useState(!1),[f,x]=T.useState(null),a=ct(s);let r,i,m,c;if(e[0]!==o||e[1]!==a){const Q={type:"http",url:o},L={[a]:Q};r=JSON.stringify(L,null,2);const W=X=>JSON.stringify({...Q,headers:{"x-mesh-client":X}},null,2),H=_t(W("Cursor"));i=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(a)}&config=${encodeURIComponent(H)}`;const pe=W("Claude Code");m=a;let $;e[6]===Symbol.for("react.memo_cache_sentinel")?($=/'/g,e[6]=$):$=e[6],c=pe.replace($,"'\\''"),e[0]=o,e[1]=a,e[2]=r,e[3]=i,e[4]=m,e[5]=c}else r=e[2],i=e[3],m=e[4],c=e[5];const j=`claude mcp add "${m}" --config '${c}'`;let h;e[7]!==r?(h=async()=>{await navigator.clipboard.writeText(r),l(!0),Ie.success("Configuration copied to clipboard"),setTimeout(()=>l(!1),2e3)},e[7]=r,e[8]=h):h=e[8];const p=h;let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=async(Q,L)=>{await navigator.clipboard.writeText(Q),x(L),Ie.success(`${L} command copied`),setTimeout(()=>x(null),2e3)},e[9]=b):b=e[9];const S=b,w=Nt;let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[10]=g):g=e[10];let y;e[11]!==d?(y=d?t.jsx(Te,{size:14}):t.jsx(ot,{size:14}),e[11]=d,e[12]=y):y=e[12];let v;e[13]!==p||e[14]!==y?(v=t.jsx(de,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:p,children:y})}),e[13]=p,e[14]=y,e[15]=v):v=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(me,{children:"Copy configuration"}),e[16]=_):_=e[16];let N;e[17]!==v?(N=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(ce,{children:t.jsxs(ae,{children:[v,_]})})}),e[17]=v,e[18]=N):N=e[18];let D;e[19]!==r||e[20]!==p?(D=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:p,children:r}),e[19]=r,e[20]=p,e[21]=D):D=e[21];let A;e[22]!==D||e[23]!==N?(A=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[N,D]}),e[22]=D,e[23]=N,e[24]=A):A=e[24];let B;e[25]!==i?(B=()=>w(i),e[25]=i,e[26]=B):B=e[26];let q,M;e[27]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),M=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=q,e[28]=M):(q=e[27],M=e[28]);let G;e[29]!==B?(G=t.jsx(de,{asChild:!0,children:t.jsxs(J,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:B,children:[q,M]})}),e[29]=B,e[30]=G):G=e[30];let u;e[31]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(me,{children:"Add to Cursor"}),e[31]=u):u=e[31];let C;e[32]!==G?(C=t.jsx(ce,{children:t.jsxs(ae,{children:[G,u]})}),e[32]=G,e[33]=C):C=e[33];let k;e[34]!==j?(k=()=>S(j,"Claude"),e[34]=j,e[35]=k):k=e[35];let P,F;e[36]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),F=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=P,e[37]=F):(P=e[36],F=e[37]);let R;e[38]!==f?(R=f==="Claude"&&t.jsx(Te,{size:14,className:"ml-2 text-green-500"}),e[38]=f,e[39]=R):R=e[39];let z;e[40]!==k||e[41]!==R?(z=t.jsx(de,{asChild:!0,children:t.jsxs(J,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:k,children:[P,F,R]})}),e[40]=k,e[41]=R,e[42]=z):z=e[42];let V;e[43]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(me,{children:"Add to Claude Code"}),e[43]=V):V=e[43];let O;e[44]!==z?(O=t.jsx(ce,{children:t.jsxs(ae,{children:[z,V]})}),e[44]=z,e[45]=O):O=e[45];let E;e[46]!==C||e[47]!==O?(E=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[C,O]}),e[46]=C,e[47]=O,e[48]=E):E=e[48];let re;return e[49]!==A||e[50]!==E?(re=t.jsxs("div",{className:"flex flex-col gap-4",children:[g,A,E]}),e[49]=A,e[50]=E,e[51]=re):re=e[51],re}function Nt(n){window.open(n,"_blank")}const It=Ue({title:Ne().min(1,"Name is required").max(255),description:Ne().nullable(),status:Se(["active","inactive"]),tool_selection_mode:Se(["inclusion","exclusion"]),tool_selection_strategy:Se(["passthrough","smart_tool_selection","code_execution"])});function Tt(n,e){const s={};for(const o of n.connections)if(o.selected_tools===null){const d=e.get(o.connection_id)??[];d.length>0&&(s[o.connection_id]=d)}else o.selected_tools.length>0&&(s[o.connection_id]=o.selected_tools);return s}function kt(n){const e={};for(const s of n.connections)s.selected_resources!==null&&s.selected_resources!==void 0&&s.selected_resources.length>0&&(e[s.connection_id]=s.selected_resources);return e}function $t(n){const e={};for(const s of n.connections)s.selected_prompts!==null&&s.selected_prompts!==void 0&&s.selected_prompts.length>0&&(e[s.connection_id]=s.selected_prompts);return e}function Pt(n,e,s,o){const d=new Set([...Object.keys(n),...Object.keys(e),...Object.keys(s)]);return Array.from(d).map(l=>{const f=n[l]??[],x=o.get(l)??[],a=x.length>0&&x.every(r=>f.includes(r));return{connection_id:l,selected_tools:f.length===0||a?null:f,selected_resources:e[l]??null,selected_prompts:s[l]??null}})}function Rt(n){const e=U.c(41),{form:s,gateway:o,icon:d}=n;let l;e[0]!==s?(l=s.watch("title")||"Gateway",e[0]=s,e[1]=l):l=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(lt,{}),e[2]=f):f=e[2];let x;e[3]!==d||e[4]!==l?(x=t.jsx(_e,{icon:d,name:l,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=d,e[4]=l,e[5]=x):x=e[5];let a;e[6]!==s.control?(a=t.jsx(ie,{control:s.control,name:"status",render:Ft}),e[6]=s.control,e[7]=a):a=e[7];let r;e[8]!==x||e[9]!==a?(r=t.jsxs("div",{className:"flex items-start justify-between",children:[x,a]}),e[8]=x,e[9]=a,e[10]=r):r=e[10];let i;e[11]!==s.control?(i=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(ie,{control:s.control,name:"title",render:Dt}),t.jsx(ie,{control:s.control,name:"description",render:Et})]}),e[11]=s.control,e[12]=i):i=e[12];let m;e[13]!==r||e[14]!==i?(m=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[r,i]}),e[13]=r,e[14]=i,e[15]=m):m=e[15];let c;e[16]!==s.control?(c=t.jsxs("div",{className:"flex flex-col gap-4 p-5",children:[t.jsx(ie,{control:s.control,name:"tool_selection_mode",render:At}),t.jsx(ie,{control:s.control,name:"tool_selection_strategy",render:zt})]}),e[16]=s.control,e[17]=c):c=e[17];let j;e[18]!==m||e[19]!==c?(j=t.jsxs("div",{className:"flex flex-col",children:[m,c]}),e[18]=m,e[19]=c,e[20]=j):j=e[20];let h;e[21]!==s||e[22]!==j?(h=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(rt,{...s,children:j})}),e[21]=s,e[22]=j,e[23]=h):h=e[23];let p;e[24]!==o.id||e[25]!==o.title?(p=o.title||`gateway-${o.id.slice(0,8)}`,e[24]=o.id,e[25]=o.title,e[26]=p):p=e[26];const b=`${window.location.origin}/mcp/gateway/${o.id}`;let S;e[27]!==p||e[28]!==b?(S=t.jsx("div",{className:"p-5",children:t.jsx(wt,{serverName:p,gatewayUrl:b})}),e[27]=p,e[28]=b,e[29]=S):S=e[29];let w;e[30]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[30]=w):w=e[30];let g;e[31]!==o.updated_at?(g=o.updated_at?dt(new Date(o.updated_at),{addSuffix:!1}):"Unknown",e[31]=o.updated_at,e[32]=g):g=e[32];let y;e[33]!==g?(y=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[w,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:g})]}),e[33]=g,e[34]=y):y=e[34];let v;e[35]!==S||e[36]!==y?(v=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[S,y]}),e[35]=S,e[36]=y,e[37]=v):v=e[37];let _;return e[38]!==h||e[39]!==v?(_=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[h,v]}),e[38]=h,e[39]=v,e[40]=_):_=e[40],_}function zt(n){const{field:e}=n;return t.jsxs(fe,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Ae,{className:"mb-0",children:"Gateway Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ce,{children:t.jsxs(ae,{children:[t.jsx(de,{asChild:!0,children:t.jsx(J,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Gateway strategy help",children:t.jsx(ze,{size:14,className:"text-muted-foreground"})})}),t.jsx(me,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Passthrough:"})," Pass tools through as-is (default)."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Smart Tool Selection:"})," ","Intelligent tool selection behavior."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Code Execution:"})," Code execution behavior."]})]})})]})}),t.jsxs(Ee,{value:e.value,onValueChange:e.onChange,children:[t.jsx(xe,{children:t.jsx(De,{className:"w-[180px]",children:t.jsx(Fe,{})})}),t.jsxs(Ve,{children:[t.jsx(ue,{value:"passthrough",children:"Passthrough"}),t.jsx(ue,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(ue,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(he,{})]})}function At(n){const{field:e}=n;return t.jsxs(fe,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Ae,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ce,{children:t.jsxs(ae,{children:[t.jsx(de,{asChild:!0,children:t.jsx(J,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(ze,{size:14,className:"text-muted-foreground"})})}),t.jsx(me,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected items are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All items except selected ones are exposed."]})]})})]})}),t.jsxs(Ee,{value:e.value,onValueChange:e.onChange,children:[t.jsx(xe,{children:t.jsx(De,{className:"w-[180px]",children:t.jsx(Fe,{})})}),t.jsxs(Ve,{children:[t.jsx(ue,{value:"inclusion",children:"Include Selected"}),t.jsx(ue,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(he,{})]})}function Et(n){const{field:e}=n;return t.jsxs(fe,{className:"w-full space-y-0",children:[t.jsx(xe,{children:t.jsx(we,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(he,{})]})}function Dt(n){const{field:e}=n;return t.jsxs(fe,{className:"w-full space-y-0",children:[t.jsx(xe,{children:t.jsx(we,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Gateway Name"})}),t.jsx(he,{})]})}function Ft(n){const{field:e}=n;return t.jsxs(fe,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:e.value==="active"?"Active":"Inactive"}),t.jsx(xe,{children:t.jsx(We,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(he,{})]})}function Vt(n){const e=U.c(70),{gateway:s,gatewayId:o,requestedTabId:d}=n,f=Be().location.href,x=Le();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/$org/gateways/$gatewayId"},e[0]=a):a=e[0];const r=ke(a),i=tt();let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m={},e[1]=m):m=e[1];const c=Pe(m);let j;e[2]!==c?(j=c.map(Mt),e[2]=c,e[3]=j):j=e[3];const h=j,{promptsMap:p}=st(h),{resourcesMap:b}=nt(h);let S;if(e[4]!==c){S=new Map;for(const I of c)I.tools&&I.tools.length>0&&S.set(I.id,I.tools.map(Gt));e[4]=c,e[5]=S}else S=e[5];let w;e[6]!==S||e[7]!==s?(w=()=>Tt(s,S),e[6]=S,e[7]=s,e[8]=w):w=e[8];const[g,y]=T.useState(w);let v;e[9]!==s?(v=()=>kt(s),e[9]=s,e[10]=v):v=e[10];const[_,N]=T.useState(v);let D;e[11]!==s?(D=()=>$t(s),e[11]=s,e[12]=D):D=e[12];const[A,B]=T.useState(D),[q,M]=T.useState(!1);let G;e[13]===Symbol.for("react.memo_cache_sentinel")?(G=I=>{y(I),M(!0)},e[13]=G):G=e[13];const u=G;let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=I=>{N(I),M(!0)},e[14]=C):C=e[14];const k=C;let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=I=>{B(I),M(!0)},e[15]=P):P=e[15];const F=P;let R;e[16]===Symbol.for("react.memo_cache_sentinel")?(R=Je(It),e[16]=R):R=e[16];const z=s.tool_selection_mode??"inclusion",V=s.tool_selection_strategy??"passthrough";let O;e[17]!==s.description||e[18]!==s.status||e[19]!==s.title||e[20]!==z||e[21]!==V?(O={resolver:R,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:z,tool_selection_strategy:V}},e[17]=s.description,e[18]=s.status,e[19]=s.title,e[20]=z,e[21]=V,e[22]=O):O=e[22];const E=qe(O),Q=E.formState.isDirty||q;let L;e[23]!==i.update||e[24]!==S||e[25]!==E||e[26]!==o||e[27]!==A||e[28]!==_||e[29]!==g?(L=async()=>{const I=E.getValues(),ve=Pt(g,_,A,S);await i.update.mutateAsync({id:o,data:{title:I.title,description:I.description,status:I.status,tool_selection_mode:I.tool_selection_mode,tool_selection_strategy:I.tool_selection_strategy,connections:ve}}),E.reset(I),M(!1)},e[23]=i.update,e[24]=S,e[25]=E,e[26]=o,e[27]=A,e[28]=_,e[29]=g,e[30]=L):L=e[30];const W=L;let H;e[31]===Symbol.for("react.memo_cache_sentinel")?(H=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[31]=H):H=e[31];const pe=H,$=pe.some(I=>I.id===d)?d:"settings";let X;e[32]!==r?(X=I=>{r({search:ve=>({...ve,tab:I}),replace:!0})},e[32]=r,e[33]=X):X=e[33];const be=X;let Y;e[34]!==x.history?(Y=()=>x.history.back(),e[34]=x.history,e[35]=Y):Y=e[35];let Z;e[36]!==$||e[37]!==be?(Z=t.jsx(mt,{children:t.jsx(it,{tabs:pe,activeTab:$,onTabChange:be})}),e[36]=$,e[37]=be,e[38]=Z):Z=e[38];const ye=s.icon??"cpu_chip";let ee;e[39]!==s.title||e[40]!==ye||e[41]!==f?(ee=t.jsx(at,{title:s.title,url:f,icon:ye}),e[39]=s.title,e[40]=ye,e[41]=f,e[42]=ee):ee=e[42];let te;e[43]!==i.update.isPending||e[44]!==W||e[45]!==Q?(te=Q&&t.jsxs(J,{onClick:W,disabled:i.update.isPending,size:"sm",className:"h-7",children:[i.update.isPending&&t.jsx(Ce,{size:16,className:"mr-2 animate-spin"}),"Save Changes"]}),e[43]=i.update.isPending,e[44]=W,e[45]=Q,e[46]=te):te=e[46];let se;e[47]!==ee||e[48]!==te?(se=t.jsxs(ut,{children:[ee,te]}),e[47]=ee,e[48]=te,e[49]=se):se=e[49];let ge;e[50]===Symbol.for("react.memo_cache_sentinel")?(ge=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Ce,{size:32,className:"animate-spin text-muted-foreground"})}),e[50]=ge):ge=e[50];let ne;e[51]!==$||e[52]!==p||e[53]!==b||e[54]!==E||e[55]!==s||e[56]!==A||e[57]!==_||e[58]!==g?(ne=$==="settings"?t.jsx(Rt,{form:E,gateway:s,icon:s.icon}):$==="tools"?t.jsx(Ke,{toolSet:g,onToolSetChange:u}):$==="resources"?t.jsx(St,{resourceSet:_,onResourceSetChange:k,connectionResources:b}):$==="prompts"?t.jsx(jt,{promptSet:A,onPromptSetChange:F,connectionPrompts:p}):null,e[51]=$,e[52]=p,e[53]=b,e[54]=E,e[55]=s,e[56]=A,e[57]=_,e[58]=g,e[59]=ne):ne=e[59];let oe;e[60]!==ne?(oe=t.jsx(T.Suspense,{fallback:ge,children:ne}),e[60]=ne,e[61]=oe):oe=e[61];let le;e[62]!==$||e[63]!==oe?(le=t.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:t.jsx($e,{children:oe},$)})}),e[62]=$,e[63]=oe,e[64]=le):le=e[64];let je;return e[65]!==Y||e[66]!==Z||e[67]!==se||e[68]!==le?(je=t.jsxs(ft,{onBack:Y,children:[Z,se,le]}),e[65]=Y,e[66]=Z,e[67]=se,e[68]=le,e[69]=je):je=e[69],je}function Gt(n){return n.name}function Mt(n){return n.id}function Ot(){const n=U.c(10);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},n[0]=e):e=n[0];const s=ke(e);let o;n[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/gateways/$gatewayId"},n[1]=o):o=n[1];const{gatewayId:d,org:l}=Me(o);let f;n[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/gateways/$gatewayId"},n[2]=f):f=n[2];const a=Oe(f).tab||"settings",r=et(d);if(!r){let m;return n[3]!==s||n[4]!==l?(m=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Qe,{title:"Gateway not found",description:"This gateway may have been deleted or you may not have access.",actions:t.jsx(J,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:l}}),children:"Back to gateways"})})}),n[3]=s,n[4]=l,n[5]=m):m=n[5],m}let i;return n[6]!==r||n[7]!==d||n[8]!==a?(i=t.jsx(Vt,{gateway:r,gatewayId:d,requestedTabId:a}),n[6]=r,n[7]=d,n[8]=a,n[9]=i):i=n[9],i}function Ut(){const n=U.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx($e,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ot,{})})}),n[0]=e):e=n[0],e}function gs(){const n=U.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ut,{}),n[0]=e):e=n[0],e}export{gs as default};