@decocms/mesh 1.0.9 → 1.0.11

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 (111) hide show
  1. package/dist/client/assets/{AlertCircle-100C6qle.js → AlertCircle-zCOLtXNG.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-CwqPFuY_.js → ArrowLeft-b0UM4Vui.js} +1 -1
  3. package/dist/client/assets/{Calendar-DJbHipjT.js → Calendar-Cxw5FKll.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-Bcv0yv7v.js → CheckCircle-U8-nit8x.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CQZ630QJ.js → ChevronDown-BFYjmmoG.js} +1 -1
  6. package/dist/client/assets/{Clock-DZbPsJyA.js → Clock-qZko4uak.js} +1 -1
  7. package/dist/client/assets/{Copy01-C3tbrRU5.js → Copy01-XN5V21c6.js} +1 -1
  8. package/dist/client/assets/{CpuChip02-eOcghqj5.js → CpuChip02-Nhk4zHXl.js} +1 -1
  9. package/dist/client/assets/{DotsVertical-CZAuxCS9.js → DotsVertical-CcNQsTaW.js} +1 -1
  10. package/dist/client/assets/{File06-DVtVQX2W.js → File06-DB55FK-Z.js} +1 -1
  11. package/dist/client/assets/{GitBranch01-B4cjyr__.js → GitBranch01-CM-ab6hS.js} +1 -1
  12. package/dist/client/assets/{Inbox01-azY3GERO.js → Inbox01-CIzt2AdR.js} +1 -1
  13. package/dist/client/assets/{InfoCircle-82xtHE2K.js → InfoCircle-ChxTTkMX.js} +1 -1
  14. package/dist/client/assets/{Key01-Bpa2nEg3.js → Key01-DYiMWoz_.js} +1 -1
  15. package/dist/client/assets/{LinkExternal01-C_0a4o__.js → LinkExternal01-CBZhTXC0.js} +1 -1
  16. package/dist/client/assets/{Loading01-CpOGYhvb.js → Loading01-Dtm2TLlA.js} +1 -1
  17. package/dist/client/assets/{Plus-DFHWilTh.js → Plus-DF_I5mml.js} +1 -1
  18. package/dist/client/assets/{SearchMd-CuszgCqb.js → SearchMd-C_ak4ze3.js} +1 -1
  19. package/dist/client/assets/{Terminal-BuJufC24.js → Terminal-4DdepWh9.js} +1 -1
  20. package/dist/client/assets/{Trash01-avMTxTy7.js → Trash01-FYPMjpVf.js} +1 -1
  21. package/dist/client/assets/{Upload01-CvIAU3H3.js → Upload01-BYeEw9Vy.js} +1 -1
  22. package/dist/client/assets/{X-BScAvcL1.js → X-BTsWwO_U.js} +1 -1
  23. package/dist/client/assets/{XClose-gnBfeV0u.js → XClose-CY6vd_0A.js} +1 -1
  24. package/dist/client/assets/{alert-dialog-otNJ1cnE.js → alert-dialog-DhxQ40TA.js} +2 -2
  25. package/dist/client/assets/auth-CfgXQhXI.js +1 -0
  26. package/dist/client/assets/{auth-catchall-BlTDjkLY.js → auth-catchall-CohlC3Pb.js} +1 -1
  27. package/dist/client/assets/{avatar-Bv-3L9Zn.js → avatar-CcUZFpwU.js} +1 -1
  28. package/dist/client/assets/{badge-DXjKunmL.js → badge-CgUwfcKq.js} +1 -1
  29. package/dist/client/assets/{button-DP3Fjd19.js → button-DuitHSR8.js} +1 -1
  30. package/dist/client/assets/{card-DKgSSyjo.js → card-DkEpNms8.js} +1 -1
  31. package/dist/client/assets/{checkbox-Bq-RnKQ1.js → checkbox-DTaSeum9.js} +1 -1
  32. package/dist/client/assets/{collection-detail-BnGYzoyo.js → collection-detail-Dvc6iyHF.js} +1 -1
  33. package/dist/client/assets/{collection-display-button-CM6lJjaN.js → collection-display-button-DgDdVSTg.js} +1 -1
  34. package/dist/client/assets/{collection-header-D42ZoG-6.js → collection-header-D-wXFMG4.js} +1 -1
  35. package/dist/client/assets/{collection-page-DYsl4ZS6.js → collection-page-AFIAghtr.js} +1 -1
  36. package/dist/client/assets/{collection-search-BQ-WB0Rj.js → collection-search-OoKPetka.js} +1 -1
  37. package/dist/client/assets/{collection-table-wrapper-Cbxid7c7.js → collection-table-wrapper-DEVlTpj8.js} +1 -1
  38. package/dist/client/assets/{connection-card-c58EGX4x.js → connection-card-CVX6Dj6b.js} +1 -1
  39. package/dist/client/assets/{connection-detail-DC_zKkGB.js → connection-detail-C_uPOJ6z.js} +1 -1
  40. package/dist/client/assets/{connections-DmpFPSpw.js → connections-DoAE9QhX.js} +1 -1
  41. package/dist/client/assets/{core-Bv5-AwrC.js → core-BMfBj0bw.js} +1 -1
  42. package/dist/client/assets/{create-organization-dialog-Cn0ZXv5F.js → create-organization-dialog-C_xVF_Jl.js} +1 -1
  43. package/dist/client/assets/{dialog-D5C6QiJE.js → dialog-Dl9CupEb.js} +1 -1
  44. package/dist/client/assets/{dropdown-menu-CjKpHxz2.js → dropdown-menu-CPQpNQmn.js} +1 -1
  45. package/dist/client/assets/env-vars-editor-BcyBU5xA.js +1 -0
  46. package/dist/client/assets/{error-boundary-DjqBPLyv.js → error-boundary-DMJQCmxn.js} +1 -1
  47. package/dist/client/assets/extract-connection-data-Bt1_1dQ8.js +1 -0
  48. package/dist/client/assets/{form-Dv8d8uAG.js → form-BfiwCHdz.js} +1 -1
  49. package/dist/client/assets/{formatDistanceToNow-QA-1KB4j.js → formatDistanceToNow-BmkU67cZ.js} +1 -1
  50. package/dist/client/assets/{gateway-detail-CEHicKUV.js → gateway-detail-ZknLelfM.js} +1 -1
  51. package/dist/client/assets/{gateways-DoXPnx0h.js → gateways-BAQA-e5y.js} +1 -1
  52. package/dist/client/assets/{home-pjEjaP5o.js → home-BzOK0WeX.js} +1 -1
  53. package/dist/client/assets/index-CCNaUj2A.js +156 -0
  54. package/dist/client/assets/{index-BDa_PRJi.js → index-DR-B7Y1Z.js} +1 -1
  55. package/dist/client/assets/{index-BVs1FX4U.js → index-T7OaHK12.js} +1 -1
  56. package/dist/client/assets/{index-qYBN_4Xo.js → index-be58e1VX.js} +3 -3
  57. package/dist/client/assets/{input-v6ODzgkG.js → input-YU6lpVgW.js} +1 -1
  58. package/dist/client/assets/json-BnmF_c7J.js +1 -0
  59. package/dist/client/assets/{json-syntax-highlighter-broWV870.js → json-syntax-highlighter-Dve1WRV4.js} +2 -2
  60. package/dist/client/assets/{layout-DARzNM_G.js → layout-n40g10Oh.js} +1 -1
  61. package/dist/client/assets/{lazy-highlighter-K2PzkRQc.js → lazy-highlighter-BY_mRZdt.js} +1 -1
  62. package/dist/client/assets/{localstorage-keys-ZIwm4Lc6.js → localstorage-keys-BphvZ-YX.js} +1 -1
  63. package/dist/client/assets/{login-BP1nMiPU.js → login-CJi6KFGq.js} +1 -1
  64. package/dist/client/assets/mcp-oauth-CvO1Z13d.js +1 -0
  65. package/dist/client/assets/{members-CMW2_o9N.js → members-UHyk3Nn4.js} +1 -1
  66. package/dist/client/assets/{monitoring-BcSjVFrb.js → monitoring-65mgE8O0.js} +1 -1
  67. package/dist/client/assets/{oauth-callback-DLDcCDZ7.js → oauth-callback-KqixmXKf.js} +1 -1
  68. package/dist/client/assets/{page-C1ZOKmwf.js → page-DmmG4y1n.js} +1 -1
  69. package/dist/client/assets/{popover-semXA6yo.js → popover-PTQF8Dbg.js} +1 -1
  70. package/dist/client/assets/prism-light-0RxCg8xt.js +1 -0
  71. package/dist/client/assets/{resizable-YWlggRLW.js → resizable-BF9gWgPg.js} +45 -47
  72. package/dist/client/assets/{resource-tabs-ChQvNf5W.js → resource-tabs-Dx5v9tHv.js} +1 -1
  73. package/dist/client/assets/{select-KWMArkl_.js → select-C4QWjnSz.js} +1 -1
  74. package/dist/client/assets/{settings-9DHfPDgm.js → settings-UndPSfwX.js} +1 -1
  75. package/dist/client/assets/{shell-layout-BY64qJt8.js → shell-layout-BLjMALRt.js} +1 -1
  76. package/dist/client/assets/{spinner-C2yBMiMG.js → spinner-CNb2mD_9.js} +1 -1
  77. package/dist/client/assets/{store-BwXm_Abw.js → store-CGyOcqhE.js} +1 -1
  78. package/dist/client/assets/{store-app-detail-DJ15hlvl.js → store-app-detail-BQ4UUaoG.js} +1 -1
  79. package/dist/client/assets/{switch-B-fBwCox.js → switch-BmVnuO_C.js} +1 -1
  80. package/dist/client/assets/{tools-list-DCXlrPCh.js → tools-list-BV-qlQqF.js} +1 -1
  81. package/dist/client/assets/{tooltip-DQ1jCLZj.js → tooltip-CqCXb38Z.js} +1 -1
  82. package/dist/client/assets/{types-bhDznoEx.js → types-Bm46njUN.js} +1 -1
  83. package/dist/client/assets/use-binding-DdwsXkNS.js +34 -0
  84. package/dist/client/assets/{use-connection-DQ204Coq.js → use-connection-BbvAiBvg.js} +1 -1
  85. package/dist/client/assets/{use-connection-resources-DR9t53Nb.js → use-connection-resources-D-1-SK-8.js} +1 -1
  86. package/dist/client/assets/{use-gateway-B2ZAQHo8.js → use-gateway-L1UQyU7-.js} +1 -1
  87. package/dist/client/assets/{use-list-state-DDpMfXlk.js → use-list-state-DVYCFUpb.js} +1 -1
  88. package/dist/client/assets/{use-mcp-fwyaX6l-.js → use-mcp-CWOlOW9q.js} +1 -1
  89. package/dist/client/assets/{use-members-DLmZgkLm.js → use-members-Dyh_-7GU.js} +1 -1
  90. package/dist/client/assets/{use-mobile-DLMOdcji.js → use-mobile-B0xRFGhT.js} +1 -1
  91. package/dist/client/assets/{use-organization-settings-C703l8NH.js → use-organization-settings-fWTyw7VB.js} +1 -1
  92. package/dist/client/assets/{use-tool-call-yMB7Rz-9.js → use-tool-call-CVPTtLoG.js} +1 -1
  93. package/dist/client/assets/useQuery-C4GPpw7d.js +1 -0
  94. package/dist/client/assets/utils-o1atviYh.js +1 -0
  95. package/dist/client/assets/{view-mode-toggle-D84JG7fQ.js → view-mode-toggle-DOtHoBLN.js} +1 -1
  96. package/dist/client/assets/{well-known-mcp-EWW8l3ev.js → well-known-mcp-d1wcdFCF.js} +1 -1
  97. package/dist/client/index.html +1 -1
  98. package/dist/server/cli.js +188 -216
  99. package/dist/server/migrate.js +141 -168
  100. package/dist/server/server.js +185 -213
  101. package/package.json +3 -4
  102. package/dist/client/assets/auth-Bt50jbKj.js +0 -26
  103. package/dist/client/assets/env-vars-editor-UiPLX9CZ.js +0 -1
  104. package/dist/client/assets/extract-connection-data-DTb8mOyN.js +0 -1
  105. package/dist/client/assets/index-BlDToaIG.js +0 -118
  106. package/dist/client/assets/json-CQDWLCNA.js +0 -1
  107. package/dist/client/assets/mcp-oauth-C6-fAUQ-.js +0 -1
  108. package/dist/client/assets/prism-light-BXZet5oM.js +0 -1
  109. package/dist/client/assets/use-binding-C5ZbAAxe.js +0 -38
  110. package/dist/client/assets/useQuery-CvfuVd3B.js +0 -1
  111. package/dist/client/assets/utils-3t85Hz8W.js +0 -1
@@ -1 +1 @@
1
- import{c as J,j as e,r as M,f as Q,b as Y,a as Z,u as ee,x as ne,w as te,s as B,V as se,v as x,a0 as oe}from"./index-BlDToaIG.js";import{C as re}from"./collection-header-D42ZoG-6.js";import{C as ie}from"./collection-page-DYsl4ZS6.js";import{C as ae}from"./collection-search-BQ-WB0Rj.js";import{C as ce}from"./collection-table-wrapper-Cbxid7c7.js";import{C as le}from"./connection-card-c58EGX4x.js";import{E as T}from"./SearchMd-CuszgCqb.js";import{E as de}from"./error-boundary-DjqBPLyv.js";import{a as me,u as pe,n as P,I as ue}from"./use-connection-DQ204Coq.js";import{u as xe,s as F}from"./use-list-state-DDpMfXlk.js";import{u as he}from"./tooltip-DQ1jCLZj.js";import{f as ge,a as je,b as fe,c as ve,d as _e,e as Ce,A as ye,g as Se}from"./alert-dialog-otNJ1cnE.js";import{B as we}from"./badge-DXjKunmL.js";import{B as y}from"./button-DP3Fjd19.js";import{d as Ne,c as ke,D as De,a as be,b as Te,T as Pe,f as Ie}from"./dialog-D5C6QiJE.js";import{b as V,D as z,a as R,d as k}from"./dropdown-menu-CjKpHxz2.js";import{a as Me,F as l,b as d,c as m,d as p,f as u}from"./form-Dv8d8uAG.js";import{i as H}from"./DotsVertical-CZAuxCS9.js";import{i as $e,r as Ae,s as I,E as Ee,e as W}from"./env-vars-editor-UiPLX9CZ.js";import{i as Oe}from"./Loading01-CpOGYhvb.js";import{i as Fe}from"./Terminal-BuJufC24.js";import{s as X}from"./Trash01-avMTxTy7.js";import{I as j}from"./input-v6ODzgkG.js";import{S as Ve,a as ze,b as Re,c as He,d as w}from"./select-KWMArkl_.js";import{g as Xe}from"./generate-id-Dyweu44Y.js";import"./collection-display-button-CM6lJjaN.js";import"./view-mode-toggle-D84JG7fQ.js";import"./utils-3t85Hz8W.js";import"./card-DKgSSyjo.js";import"./use-mobile-DLMOdcji.js";import"./X-BScAvcL1.js";import"./Plus-DFHWilTh.js";import"./ChevronDown-CQZ630QJ.js";const Be=B({key:x(),value:x()}),We=B({title:x().min(1,"Name is required"),description:x().nullable().optional(),ui_type:oe(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:x().optional(),connection_token:x().nullable().optional(),npx_package:x().optional(),stdio_command:x().optional(),stdio_args:x().optional(),stdio_cwd:x().optional(),env_vars:se(Be).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 Le(t,o){const g={command:"npx",args:["-y",t]},f=W(o);return Object.keys(f).length>0&&(g.envVars=f),g}function Ue(t,o,g,f){const v={command:t};o.trim()&&(v.args=o.trim().split(/\s+/)),g?.trim()&&(v.cwd=g.trim());const i=W(f);return Object.keys(i).length>0&&(v.envVars=i),v}function Ke(t){return t.command==="npx"}function qe(t){return t.args?.find(o=>!o.startsWith("-"))??""}function Ge(t){return{command:t.command,args:t.args?.join(" ")??"",cwd:t.cwd??""}}function Je(t,o){switch(o.type){case"edit":return{mode:"editing",connection:o.connection};case"delete":return{mode:"deleting",connection:o.connection};case"close":return{mode:"idle"}}}function Qe(){const{org:t}=he(),o=Q(),g=Y({strict:!1}),{data:f}=Z.useSession(),{stdioEnabled:v}=ee(),i=xe({namespace:t.slug,resource:"connections"}),D=me(),b=pe(i),[h,_]=M.useReducer(Je,{mode:"idle"}),$=g.action==="create",L=()=>{o({to:"/$org/mcps",params:{org:t.slug},search:{action:"create"}})},A=()=>{o({to:"/$org/mcps",params:{org:t.slug},search:{}})},r=ne({resolver:te(We),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),C=r.watch("ui_type"),a=h.mode==="editing"?h.connection:null;M.useEffect(()=>{if(a){const n=$e(a.connection_headers)?a.connection_headers:null;if(n&&a.connection_type==="STDIO"){const s=Ae(n.envVars);if(Ke(n)){const c=qe(n);r.reset({title:a.title,description:a.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:s})}else{const c=Ge(n);r.reset({title:a.title,description:a.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:s})}}else r.reset({title:a.title,description:a.description,ui_type:a.connection_type,connection_url:a.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:[]})},[a,r]);const U=async()=>{if(h.mode!=="deleting")return;const n=h.connection.id;_({type:"close"});try{await D.delete.mutateAsync(n)}catch{}},K=async n=>{let s,c=null,N=null,S=null;if(n.ui_type==="NPX"?(s="STDIO",c="",S=Le(n.npx_package||"",n.env_vars||[])):n.ui_type==="STDIO"?(s="STDIO",c="",S=Ue(n.stdio_command||"",n.stdio_args||"",n.stdio_cwd,n.env_vars||[])):(s=n.ui_type,c=n.connection_url||"",N=n.connection_token||null),a){await D.update.mutateAsync({id:a.id,data:{title:n.title,description:n.description||null,connection_type:s,connection_url:c,...N&&{connection_token:N},...S&&{connection_headers:S}}}),_({type:"close"}),r.reset();return}const O=Xe("conn");await D.create.mutateAsync({id:O,title:n.title,description:n.description||null,connection_type:s,connection_url:c,connection_token:N,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:f?.user?.id||"system",organization_id:t.id,icon:null,app_name:null,app_id:null,connection_headers:S,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),A(),r.reset(),o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:O}})},E=n=>{n||($?A():_({type:"close"}),r.reset())},q=[{id:"icon",header:"",render:n=>e.jsx(ue,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(P,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:n=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:n=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:n.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:n=>e.jsx("span",{className:"text-sm font-medium",children:n.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:n=>{const s=n.connection_url??"",c=s.length>40?`${s.slice(0,40)}...`:s;return e.jsx("span",{className:"text-sm text-muted-foreground",children:c})},cellClassName:"w-48 min-w-0 shrink-0"},{id:"status",header:"Status",render:n=>e.jsx(we,{variant:n.status==="active"?"success":"outline",children:n.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:n=>e.jsxs(V,{children:[e.jsx(z,{asChild:!0,children:e.jsx(y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(H,{size:20})})}),e.jsxs(R,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs(k,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}})},children:[e.jsx(F,{size:16}),"Inspect"]}),e.jsxs(k,{variant:"destructive",onClick:s=>{s.stopPropagation(),_({type:"delete",connection:n})},children:[e.jsx(X,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],G=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:t.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(y,{onClick:L,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Connect MCP Server"})]});return e.jsxs(ie,{children:[e.jsx(Ne,{open:$||h.mode==="editing",onOpenChange:E,children:e.jsxs(ke,{className:"sm:max-w-[525px]",children:[e.jsxs(De,{children:[e.jsx(be,{children:a?"Edit Connection":"Create New Connection"}),e.jsx(Te,{children:a?"Update the connection details below.":"Add a new connection to your organization. Fill in the details below."})]}),e.jsx(Me,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(K),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(l,{control:r.control,name:"title",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Name *"}),e.jsx(p,{children:e.jsx(j,{placeholder:"My Connection",...n})}),e.jsx(u,{})]})}),e.jsx(l,{control:r.control,name:"description",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Description"}),e.jsx(p,{children:e.jsx(Pe,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),e.jsx(u,{})]})}),e.jsx(l,{control:r.control,name:"ui_type",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Type *"}),e.jsxs(Ve,{value:n.value,onValueChange:n.onChange,children:[e.jsx(p,{children:e.jsx(ze,{children:e.jsx(Re,{})})}),e.jsxs(He,{children:[e.jsx(w,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(w,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(w,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"w-4 h-4"}),"Websocket"]})}),v&&e.jsxs(e.Fragment,{children:[e.jsx(w,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(P,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(w,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Fe,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(u,{})]})}),C==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(l,{control:r.control,name:"npx_package",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"NPM Package *"}),e.jsx(p,{children:e.jsx(j,{placeholder:"@perplexity-ai/mcp-server",...n,value:n.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(u,{})]})})}),C==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(l,{control:r.control,name:"stdio_command",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Command *"}),e.jsx(p,{children:e.jsx(j,{placeholder:"node, bun, python...",...n,value:n.value??""})}),e.jsx(u,{})]})}),e.jsx(l,{control:r.control,name:"stdio_args",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Arguments"}),e.jsx(p,{children:e.jsx(j,{placeholder:"arg1 arg2 --flag value",...n,value:n.value??""})}),e.jsx(u,{})]})})]}),e.jsx(l,{control:r.control,name:"stdio_cwd",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Working Directory"}),e.jsx(p,{children:e.jsx(j,{placeholder:"/path/to/project (optional)",...n,value:n.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(u,{})]})})]}),(C==="NPX"||C==="STDIO")&&e.jsx(l,{control:r.control,name:"env_vars",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Environment Variables"}),e.jsx(p,{children:e.jsx(Ee,{value:n.value??[],onChange:n.onChange})}),e.jsx(u,{})]})}),C!=="NPX"&&C!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(l,{control:r.control,name:"connection_url",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"URL *"}),e.jsx(p,{children:e.jsx(j,{placeholder:"https://example.com/mcp",...n,value:n.value??""})}),e.jsx(u,{})]})}),e.jsx(l,{control:r.control,name:"connection_token",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Token (optional)"}),e.jsx(p,{children:e.jsx(j,{type:"password",placeholder:"Bearer token or API key",...n,value:n.value??""})}),e.jsx(u,{})]})})]})]}),e.jsxs(Ie,{children:[e.jsx(y,{type:"button",variant:"outline",onClick:()=>E(!1),children:"Cancel"}),e.jsx(y,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":a?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(ge,{open:h.mode==="deleting",onOpenChange:n=>!n&&_({type:"close"}),children:e.jsxs(je,{children:[e.jsxs(fe,{children:[e.jsx(ve,{children:"Delete Connection?"}),e.jsxs(_e,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:h.mode==="deleting"&&h.connection.title}),"."]})]}),e.jsxs(Ce,{children:[e.jsx(ye,{children:"Cancel"}),e.jsx(Se,{onClick:U,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(re,{title:"MCP Servers",viewMode:i.viewMode,onViewModeChange:i.setViewMode,sortKey:i.sortKey,sortDirection:i.sortDirection,onSort:i.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],ctaButton:G}),e.jsx(ae,{value:i.search,onChange:i.setSearch,placeholder:"Search for an MCP Server...",onKeyDown:n=>{n.key==="Escape"&&(i.setSearch(""),n.target.blur())}}),i.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:b.length===0?e.jsx(T,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:(i.search,"No MCP Servers found"),description:i.search?`No MCP Servers match "${i.search}"`:"Create a connection to get started."}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:b.map(n=>e.jsx(le,{connection:n,fallbackIcon:e.jsx(P,{}),onClick:()=>o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}}),headerActions:e.jsxs(V,{children:[e.jsx(z,{asChild:!0,children:e.jsx(y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(H,{size:20})})}),e.jsxs(R,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs(k,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}})},children:[e.jsx(F,{size:16}),"Inspect"]}),e.jsxs(k,{variant:"destructive",onClick:s=>{s.stopPropagation(),_({type:"delete",connection:n})},children:[e.jsx(X,{size:16}),"Delete"]})]})]})},n.id))})}):e.jsx(ce,{columns:q,data:b,isLoading:!1,sortKey:i.sortKey,sortDirection:i.sortDirection,onSort:i.handleSort,onRowClick:n=>o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}}),emptyState:i.search?e.jsx(T,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:`No MCP Servers match "${i.search}"`}):e.jsx(T,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:"Create a connection to get started."})})]})}function Mn(){const t=J.c(1);let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(de,{children:e.jsx(M.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Qe,{})})}),t[0]=o):o=t[0],o}export{Mn as default};
1
+ import{c as J,j as e,r as M,f as Q,b as Y,a as Z,u as ee,x as ne,w as te,s as B,V as se,v as x,a0 as oe}from"./index-CCNaUj2A.js";import{C as re}from"./collection-header-D-wXFMG4.js";import{C as ie}from"./collection-page-AFIAghtr.js";import{C as ae}from"./collection-search-OoKPetka.js";import{C as ce}from"./collection-table-wrapper-DEVlTpj8.js";import{C as le}from"./connection-card-CVX6Dj6b.js";import{E as P}from"./SearchMd-C_ak4ze3.js";import{E as de}from"./error-boundary-DMJQCmxn.js";import{a as me,u as pe,n as T,I as ue}from"./use-connection-BbvAiBvg.js";import{u as xe,s as F}from"./use-list-state-DVYCFUpb.js";import{u as he}from"./tooltip-CqCXb38Z.js";import{f as ge,a as je,b as fe,c as ve,d as _e,e as Ce,A as ye,g as Se}from"./alert-dialog-DhxQ40TA.js";import{B as we}from"./badge-CgUwfcKq.js";import{B as y}from"./button-DuitHSR8.js";import{d as Ne,c as ke,D as De,a as be,b as Pe,T as Te,f as Ie}from"./dialog-Dl9CupEb.js";import{b as V,D as z,a as R,d as k}from"./dropdown-menu-CPQpNQmn.js";import{a as Me,F as l,b as d,c as m,d as p,f as u}from"./form-BfiwCHdz.js";import{i as H}from"./DotsVertical-CcNQsTaW.js";import{i as $e,r as Ae,s as I,E as Ee,e as W}from"./env-vars-editor-BcyBU5xA.js";import{i as Oe}from"./Loading01-Dtm2TLlA.js";import{i as Fe}from"./Terminal-4DdepWh9.js";import{s as X}from"./Trash01-FYPMjpVf.js";import{I as j}from"./input-YU6lpVgW.js";import{S as Ve,a as ze,b as Re,c as He,d as w}from"./select-C4QWjnSz.js";import{g as Xe}from"./generate-id-Dyweu44Y.js";import"./collection-display-button-DgDdVSTg.js";import"./view-mode-toggle-DOtHoBLN.js";import"./utils-o1atviYh.js";import"./card-DkEpNms8.js";import"./use-mobile-B0xRFGhT.js";import"./X-BTsWwO_U.js";import"./Plus-DF_I5mml.js";import"./ChevronDown-BFYjmmoG.js";const Be=B({key:x(),value:x()}),We=B({title:x().min(1,"Name is required"),description:x().nullable().optional(),ui_type:oe(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:x().optional(),connection_token:x().nullable().optional(),npx_package:x().optional(),stdio_command:x().optional(),stdio_args:x().optional(),stdio_cwd:x().optional(),env_vars:se(Be).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 Le(t,o){const g={command:"npx",args:["-y",t]},f=W(o);return Object.keys(f).length>0&&(g.envVars=f),g}function Ue(t,o,g,f){const v={command:t};o.trim()&&(v.args=o.trim().split(/\s+/)),g?.trim()&&(v.cwd=g.trim());const i=W(f);return Object.keys(i).length>0&&(v.envVars=i),v}function Ke(t){return t.command==="npx"}function qe(t){return t.args?.find(o=>!o.startsWith("-"))??""}function Ge(t){return{command:t.command,args:t.args?.join(" ")??"",cwd:t.cwd??""}}function Je(t,o){switch(o.type){case"edit":return{mode:"editing",connection:o.connection};case"delete":return{mode:"deleting",connection:o.connection};case"close":return{mode:"idle"}}}function Qe(){const{org:t}=he(),o=Q(),g=Y({strict:!1}),{data:f}=Z.useSession(),{stdioEnabled:v}=ee(),i=xe({namespace:t.slug,resource:"connections"}),D=me(),b=pe(i),[h,_]=M.useReducer(Je,{mode:"idle"}),$=g.action==="create",L=()=>{o({to:"/$org/mcps",params:{org:t.slug},search:{action:"create"}})},A=()=>{o({to:"/$org/mcps",params:{org:t.slug},search:{}})},r=ne({resolver:te(We),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),C=r.watch("ui_type"),a=h.mode==="editing"?h.connection:null;M.useEffect(()=>{if(a){const n=$e(a.connection_headers)?a.connection_headers:null;if(n&&a.connection_type==="STDIO"){const s=Ae(n.envVars);if(Ke(n)){const c=qe(n);r.reset({title:a.title,description:a.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:s})}else{const c=Ge(n);r.reset({title:a.title,description:a.description,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:c.command,stdio_args:c.args,stdio_cwd:c.cwd,env_vars:s})}}else r.reset({title:a.title,description:a.description,ui_type:a.connection_type,connection_url:a.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:[]})},[a,r]);const U=async()=>{if(h.mode!=="deleting")return;const n=h.connection.id;_({type:"close"});try{await D.delete.mutateAsync(n)}catch{}},K=async n=>{let s,c=null,N=null,S=null;if(n.ui_type==="NPX"?(s="STDIO",c="",S=Le(n.npx_package||"",n.env_vars||[])):n.ui_type==="STDIO"?(s="STDIO",c="",S=Ue(n.stdio_command||"",n.stdio_args||"",n.stdio_cwd,n.env_vars||[])):(s=n.ui_type,c=n.connection_url||"",N=n.connection_token||null),a){await D.update.mutateAsync({id:a.id,data:{title:n.title,description:n.description||null,connection_type:s,connection_url:c,...N&&{connection_token:N},...S&&{connection_headers:S}}}),_({type:"close"}),r.reset();return}const O=Xe("conn");await D.create.mutateAsync({id:O,title:n.title,description:n.description||null,connection_type:s,connection_url:c,connection_token:N,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:f?.user?.id||"system",organization_id:t.id,icon:null,app_name:null,app_id:null,connection_headers:S,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),A(),r.reset(),o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:O}})},E=n=>{n||($?A():_({type:"close"}),r.reset())},q=[{id:"icon",header:"",render:n=>e.jsx(ue,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(T,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:n=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:n=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:n.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:n=>e.jsx("span",{className:"text-sm font-medium",children:n.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:n=>{const s=n.connection_url??"",c=s.length>40?`${s.slice(0,40)}...`:s;return e.jsx("span",{className:"text-sm text-muted-foreground",children:c})},cellClassName:"w-48 min-w-0 shrink-0"},{id:"status",header:"Status",render:n=>e.jsx(we,{variant:n.status==="active"?"success":"outline",children:n.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:n=>e.jsxs(V,{children:[e.jsx(z,{asChild:!0,children:e.jsx(y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(H,{size:20})})}),e.jsxs(R,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs(k,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}})},children:[e.jsx(F,{size:16}),"Inspect"]}),e.jsxs(k,{variant:"destructive",onClick:s=>{s.stopPropagation(),_({type:"delete",connection:n})},children:[e.jsx(X,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],G=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:t.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(y,{onClick:L,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Connect MCP Server"})]});return e.jsxs(ie,{children:[e.jsx(Ne,{open:$||h.mode==="editing",onOpenChange:E,children:e.jsxs(ke,{className:"sm:max-w-[525px]",children:[e.jsxs(De,{children:[e.jsx(be,{children:a?"Edit Connection":"Create New Connection"}),e.jsx(Pe,{children:a?"Update the connection details below.":"Add a new connection to your organization. Fill in the details below."})]}),e.jsx(Me,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(K),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(l,{control:r.control,name:"title",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Name *"}),e.jsx(p,{children:e.jsx(j,{placeholder:"My Connection",...n})}),e.jsx(u,{})]})}),e.jsx(l,{control:r.control,name:"description",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Description"}),e.jsx(p,{children:e.jsx(Te,{placeholder:"A brief description of this connection",rows:3,...n,value:n.value??""})}),e.jsx(u,{})]})}),e.jsx(l,{control:r.control,name:"ui_type",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Type *"}),e.jsxs(Ve,{value:n.value,onValueChange:n.onChange,children:[e.jsx(p,{children:e.jsx(ze,{children:e.jsx(Re,{})})}),e.jsxs(He,{children:[e.jsx(w,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(w,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(w,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"w-4 h-4"}),"Websocket"]})}),v&&e.jsxs(e.Fragment,{children:[e.jsx(w,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(T,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(w,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(Fe,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(u,{})]})}),C==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(l,{control:r.control,name:"npx_package",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"NPM Package *"}),e.jsx(p,{children:e.jsx(j,{placeholder:"@perplexity-ai/mcp-server",...n,value:n.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(u,{})]})})}),C==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(l,{control:r.control,name:"stdio_command",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Command *"}),e.jsx(p,{children:e.jsx(j,{placeholder:"node, bun, python...",...n,value:n.value??""})}),e.jsx(u,{})]})}),e.jsx(l,{control:r.control,name:"stdio_args",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Arguments"}),e.jsx(p,{children:e.jsx(j,{placeholder:"arg1 arg2 --flag value",...n,value:n.value??""})}),e.jsx(u,{})]})})]}),e.jsx(l,{control:r.control,name:"stdio_cwd",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Working Directory"}),e.jsx(p,{children:e.jsx(j,{placeholder:"/path/to/project (optional)",...n,value:n.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(u,{})]})})]}),(C==="NPX"||C==="STDIO")&&e.jsx(l,{control:r.control,name:"env_vars",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Environment Variables"}),e.jsx(p,{children:e.jsx(Ee,{value:n.value??[],onChange:n.onChange})}),e.jsx(u,{})]})}),C!=="NPX"&&C!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(l,{control:r.control,name:"connection_url",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"URL *"}),e.jsx(p,{children:e.jsx(j,{placeholder:"https://example.com/mcp",...n,value:n.value??""})}),e.jsx(u,{})]})}),e.jsx(l,{control:r.control,name:"connection_token",render:({field:n})=>e.jsxs(d,{children:[e.jsx(m,{children:"Token (optional)"}),e.jsx(p,{children:e.jsx(j,{type:"password",placeholder:"Bearer token or API key",...n,value:n.value??""})}),e.jsx(u,{})]})})]})]}),e.jsxs(Ie,{children:[e.jsx(y,{type:"button",variant:"outline",onClick:()=>E(!1),children:"Cancel"}),e.jsx(y,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":a?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(ge,{open:h.mode==="deleting",onOpenChange:n=>!n&&_({type:"close"}),children:e.jsxs(je,{children:[e.jsxs(fe,{children:[e.jsx(ve,{children:"Delete Connection?"}),e.jsxs(_e,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:h.mode==="deleting"&&h.connection.title}),"."]})]}),e.jsxs(Ce,{children:[e.jsx(ye,{children:"Cancel"}),e.jsx(Se,{onClick:U,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(re,{title:"MCP Servers",viewMode:i.viewMode,onViewModeChange:i.setViewMode,sortKey:i.sortKey,sortDirection:i.sortDirection,onSort:i.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],ctaButton:G}),e.jsx(ae,{value:i.search,onChange:i.setSearch,placeholder:"Search for an MCP Server...",onKeyDown:n=>{n.key==="Escape"&&(i.setSearch(""),n.target.blur())}}),i.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:b.length===0?e.jsx(P,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:(i.search,"No MCP Servers found"),description:i.search?`No MCP Servers match "${i.search}"`:"Create a connection to get started."}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:b.map(n=>e.jsx(le,{connection:n,fallbackIcon:e.jsx(T,{}),onClick:()=>o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}}),headerActions:e.jsxs(V,{children:[e.jsx(z,{asChild:!0,children:e.jsx(y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(H,{size:20})})}),e.jsxs(R,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs(k,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}})},children:[e.jsx(F,{size:16}),"Inspect"]}),e.jsxs(k,{variant:"destructive",onClick:s=>{s.stopPropagation(),_({type:"delete",connection:n})},children:[e.jsx(X,{size:16}),"Delete"]})]})]})},n.id))})}):e.jsx(ce,{columns:q,data:b,isLoading:!1,sortKey:i.sortKey,sortDirection:i.sortDirection,onSort:i.handleSort,onRowClick:n=>o({to:"/$org/mcps/$connectionId",params:{org:t.slug,connectionId:n.id}}),emptyState:i.search?e.jsx(P,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:`No MCP Servers match "${i.search}"`}):e.jsx(P,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:500,height:223,"aria-hidden":"true"}),title:"No MCP Servers found",description:"Create a connection to get started."})})]})}function Mn(){const t=J.c(1);let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(de,{children:e.jsx(M.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Qe,{})})}),t[0]=o):o=t[0],o}export{Mn as default};
@@ -1,4 +1,4 @@
1
- import{E as te,ai as Ae}from"./index-BlDToaIG.js";function fn(){return fn=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},fn.apply(null,arguments)}function bt(e,n){if(e==null)return{};var a={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(n.indexOf(t)!==-1)continue;a[t]=e[t]}return a}function wt(e,n){if(e==null)return{};var a,t,c=bt(e,n);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(e);for(t=0;t<d.length;t++)a=d[t],n.indexOf(a)===-1&&{}.propertyIsEnumerable.call(e,a)&&(c[a]=e[a])}return c}function dn(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,t=Array(n);a<n;a++)t[a]=e[a];return t}function xt(e){if(Array.isArray(e))return dn(e)}function St(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kt(e,n){if(e){if(typeof e=="string")return dn(e,n);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?dn(e,n):void 0}}function At(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ import{E as te,ai as Ae}from"./index-CCNaUj2A.js";function fn(){return fn=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},fn.apply(null,arguments)}function bt(e,n){if(e==null)return{};var a={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(n.indexOf(t)!==-1)continue;a[t]=e[t]}return a}function wt(e,n){if(e==null)return{};var a,t,c=bt(e,n);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(e);for(t=0;t<d.length;t++)a=d[t],n.indexOf(a)===-1&&{}.propertyIsEnumerable.call(e,a)&&(c[a]=e[a])}return c}function dn(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,t=Array(n);a<n;a++)t[a]=e[a];return t}function xt(e){if(Array.isArray(e))return dn(e)}function St(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kt(e,n){if(e){if(typeof e=="string")return dn(e,n);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?dn(e,n):void 0}}function At(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pn(e){return xt(e)||St(e)||kt(e)||At()}function me(e){"@babel/helpers - typeof";return me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},me(e)}function Ct(e,n){if(me(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var t=a.call(e,n);if(me(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Ft(e){var n=Ct(e,"string");return me(n)=="symbol"?n:n+""}function it(e,n,a){return(n=Ft(n))in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function Sn(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),a.push.apply(a,t)}return a}function pe(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?Sn(Object(a),!0).forEach(function(t){it(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Sn(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function Lt(e){var n=e.length;if(n===0||n===1)return e;if(n===2)return[e[0],e[1],"".concat(e[0],".").concat(e[1]),"".concat(e[1],".").concat(e[0])];if(n===3)return[e[0],e[1],e[2],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0])];if(n>=4)return[e[0],e[1],e[2],e[3],"".concat(e[0],".").concat(e[1]),"".concat(e[0],".").concat(e[2]),"".concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[0]),"".concat(e[1],".").concat(e[2]),"".concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[1]),"".concat(e[2],".").concat(e[3]),"".concat(e[3],".").concat(e[0]),"".concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[0]),"".concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[0],".").concat(e[1],".").concat(e[2],".").concat(e[3]),"".concat(e[0],".").concat(e[1],".").concat(e[3],".").concat(e[2]),"".concat(e[0],".").concat(e[2],".").concat(e[1],".").concat(e[3]),"".concat(e[0],".").concat(e[2],".").concat(e[3],".").concat(e[1]),"".concat(e[0],".").concat(e[3],".").concat(e[1],".").concat(e[2]),"".concat(e[0],".").concat(e[3],".").concat(e[2],".").concat(e[1]),"".concat(e[1],".").concat(e[0],".").concat(e[2],".").concat(e[3]),"".concat(e[1],".").concat(e[0],".").concat(e[3],".").concat(e[2]),"".concat(e[1],".").concat(e[2],".").concat(e[0],".").concat(e[3]),"".concat(e[1],".").concat(e[2],".").concat(e[3],".").concat(e[0]),"".concat(e[1],".").concat(e[3],".").concat(e[0],".").concat(e[2]),"".concat(e[1],".").concat(e[3],".").concat(e[2],".").concat(e[0]),"".concat(e[2],".").concat(e[0],".").concat(e[1],".").concat(e[3]),"".concat(e[2],".").concat(e[0],".").concat(e[3],".").concat(e[1]),"".concat(e[2],".").concat(e[1],".").concat(e[0],".").concat(e[3]),"".concat(e[2],".").concat(e[1],".").concat(e[3],".").concat(e[0]),"".concat(e[2],".").concat(e[3],".").concat(e[0],".").concat(e[1]),"".concat(e[2],".").concat(e[3],".").concat(e[1],".").concat(e[0]),"".concat(e[3],".").concat(e[0],".").concat(e[1],".").concat(e[2]),"".concat(e[3],".").concat(e[0],".").concat(e[2],".").concat(e[1]),"".concat(e[3],".").concat(e[1],".").concat(e[0],".").concat(e[2]),"".concat(e[3],".").concat(e[1],".").concat(e[2],".").concat(e[0]),"".concat(e[3],".").concat(e[2],".").concat(e[0],".").concat(e[1]),"".concat(e[3],".").concat(e[2],".").concat(e[1],".").concat(e[0])]}var Ee={};function Nt(e){if(e.length===0||e.length===1)return e;var n=e.join(".");return Ee[n]||(Ee[n]=Lt(e)),Ee[n]}function Ot(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0,t=e.filter(function(d){return d!=="token"}),c=Nt(t);return c.reduce(function(d,g){return pe(pe({},d),a[g])},n)}function kn(e){return e.join(" ")}function Tt(e,n){var a=0;return function(t){return a+=1,t.map(function(c,d){return lt({node:c,stylesheet:e,useInlineStyles:n,key:"code-segment-".concat(a,"-").concat(d)})})}}function lt(e){var n=e.node,a=e.stylesheet,t=e.style,c=t===void 0?{}:t,d=e.useInlineStyles,g=e.key,o=n.properties,h=n.type,k=n.tagName,A=n.value;if(h==="text")return A;if(k){var m=Tt(a,d),b;if(!d)b=pe(pe({},o),{},{className:kn(o.className)});else{var y=Object.keys(a).reduce(function(F,l){return l.split(".").forEach(function(i){F.includes(i)||F.push(i)}),F},[]),w=o.className&&o.className.includes("token")?["token"]:[],x=o.className&&w.concat(o.className.filter(function(F){return!y.includes(F)}));b=pe(pe({},o),{},{className:kn(x)||void 0,style:Ot(o.className,Object.assign({},o.style,c),a)})}var S=m(n.children);return te.createElement(k,fn({key:g},b),S)}}const Et=(function(e,n){var a=e.listLanguages();return a.indexOf(n)!==-1});var qt=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function An(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),a.push.apply(a,t)}return a}function ae(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?An(Object(a),!0).forEach(function(t){it(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):An(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}var jt=/\n/g;function $t(e){return e.match(jt)}function It(e){var n=e.lines,a=e.startingLineNumber,t=e.style;return n.map(function(c,d){var g=d+a;return te.createElement("span",{key:"line-".concat(d),className:"react-syntax-highlighter-line-number",style:typeof t=="function"?t(g):t},"".concat(g,`
3
3
  `))})}function Pt(e){var n=e.codeString,a=e.codeStyle,t=e.containerStyle,c=t===void 0?{float:"left",paddingRight:"10px"}:t,d=e.numberStyle,g=d===void 0?{}:d,o=e.startingLineNumber;return te.createElement("code",{style:Object.assign({},a,c)},It({lines:n.replace(/\n$/,"").split(`
4
4
  `),style:g,startingLineNumber:o}))}function Rt(e){return"".concat(e.toString().length,".25em")}function ct(e,n){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:n},children:[{type:"text",value:e}]}}function st(e,n,a){var t={display:"inline-block",minWidth:Rt(a),paddingRight:"1em",textAlign:"right",userSelect:"none"},c=typeof e=="function"?e(n):e,d=ae(ae({},t),c);return d}function ke(e){var n=e.children,a=e.lineNumber,t=e.lineNumberStyle,c=e.largestLineNumber,d=e.showInlineLineNumbers,g=e.lineProps,o=g===void 0?{}:g,h=e.className,k=h===void 0?[]:h,A=e.showLineNumbers,m=e.wrapLongLines,b=e.wrapLines,y=b===void 0?!1:b,w=y?ae({},typeof o=="function"?o(a):o):{};if(w.className=w.className?[].concat(pn(w.className.trim().split(/\s+/)),pn(k)):k,a&&d){var x=st(t,a,c);n.unshift(ct(a,x))}return m&A&&(w.style=ae({display:"flex"},w.style)),{type:"element",tagName:"span",properties:w,children:n}}function ut(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],t=0;t<e.length;t++){var c=e[t];if(c.type==="text")a.push(ke({children:[c],className:pn(new Set(n))}));else if(c.children){var d=n.concat(c.properties.className);ut(c.children,d).forEach(function(g){return a.push(g)})}}return a}function Dt(e,n,a,t,c,d,g,o,h){var k,A=ut(e.value),m=[],b=-1,y=0;function w(u,r){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return ke({children:u,lineNumber:r,lineNumberStyle:o,largestLineNumber:g,showInlineLineNumbers:c,lineProps:a,className:s,showLineNumbers:t,wrapLongLines:h,wrapLines:n})}function x(u,r){if(t&&r&&c){var s=st(o,r,g);u.unshift(ct(r,s))}return u}function S(u,r){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return n||s.length>0?w(u,r,s):x(u,r)}for(var F=function(){var r=A[y],s=r.children[0].value,v=$t(s);if(v){var f=s.split(`
@@ -1 +1 @@
1
- import{s as D,v as O,c as _,f as N,w as E,x as T,j as r,a as I}from"./index-BlDToaIG.js";import{A as M,a as L,b as R,c as $,d as B,e as V,f as k}from"./alert-dialog-otNJ1cnE.js";import{u as q,B as H}from"./button-DP3Fjd19.js";import{F as U,a as G,b as J,c as K,d as P,e as Q,f as W}from"./form-Dv8d8uAG.js";import{I as X}from"./input-v6ODzgkG.js";import{S as Y}from"./spinner-C2yBMiMG.js";function A(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Z=D({name:O().min(2,"Organization name is required")});function ne(n){const e=_.c(42),{open:o,onOpenChange:l}=n,y=N();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={resolver:E(Z),defaultValues:{name:""}},e[0]=b):b=e[0];const t=T(b);let z;e[1]!==y?(z={mutationFn:ee,onSuccess:i=>{const{orgSlug:s}=i;y({to:"/$org",params:{org:s}})}},e[1]=y,e[2]=z):z=e[2];const a=q(z),F=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let w;e[3]===Symbol.for("react.memo_cache_sentinel")?(w=r.jsxs(R,{children:[r.jsx($,{children:"Create a new organization"}),r.jsx(B,{children:"Set up a new organization to collaborate with others."})]}),e[3]=w):w=e[3];let m;if(e[4]!==a||e[5]!==t){let i;e[7]!==a?(i=s=>a.mutateAsync(s),e[7]=a,e[8]=i):i=e[8],m=t.handleSubmit(i),e[4]=a,e[5]=t,e[6]=m}else m=e[6];let c;e[9]!==t.formState.isSubmitting?(c=i=>{const{field:s}=i;return r.jsxs(J,{children:[r.jsx(K,{children:"Organization Name"}),r.jsx(P,{children:r.jsx(X,{...s,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(Q,{children:"The name of your company or organization"}),s.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",A(s.value)]})]}),r.jsx(W,{})]})},e[9]=t.formState.isSubmitting,e[10]=c):c=e[10];let g;e[11]!==t.control||e[12]!==c?(g=r.jsx(U,{control:t.control,name:"name",render:c}),e[11]=t.control,e[12]=c,e[13]=g):g=e[13];let f;e[14]!==F?(f=F&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:F}),e[14]=F,e[15]=f):f=e[15];let u;e[16]!==a||e[17]!==t?(u=()=>{a.reset(),t.reset()},e[16]=a,e[17]=t,e[18]=u):u=e[18];let d;e[19]!==t.formState.isSubmitting||e[20]!==u?(d=r.jsx(M,{disabled:t.formState.isSubmitting,onClick:u,children:"Cancel"}),e[19]=t.formState.isSubmitting,e[20]=u,e[21]=d):d=e[21];const v=!t.formState.isValid||t.formState.isSubmitting;let p;e[22]!==t.formState.isSubmitting?(p=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Y,{size:"xs"})," Creating..."]}):"Create Organization",e[22]=t.formState.isSubmitting,e[23]=p):p=e[23];let x;e[24]!==v||e[25]!==p?(x=r.jsx(H,{type:"submit",variant:"default",disabled:v,children:p}),e[24]=v,e[25]=p,e[26]=x):x=e[26];let S;e[27]!==x||e[28]!==d?(S=r.jsxs(V,{children:[d,x]}),e[27]=x,e[28]=d,e[29]=S):S=e[29];let h;e[30]!==S||e[31]!==m||e[32]!==g||e[33]!==f?(h=r.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[g,f,S]}),e[30]=S,e[31]=m,e[32]=g,e[33]=f,e[34]=h):h=e[34];let j;e[35]!==t||e[36]!==h?(j=r.jsxs(L,{children:[w,r.jsx(G,{...t,children:h})]}),e[35]=t,e[36]=h,e[37]=j):j=e[37];let C;return e[38]!==l||e[39]!==o||e[40]!==j?(C=r.jsx(k,{open:o,onOpenChange:l,children:j}),e[38]=l,e[39]=o,e[40]=j,e[41]=C):C=e[41],C}async function ee(n){const e=A(n.name);if(!e)throw new Error("Organization slug is invalid");const o=await I.organization.create({name:n.name,slug:e});if(o?.error)throw new Error(o.error.message||"Failed to create organization");const l=o?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}export{ne as C};
1
+ import{s as D,v as O,c as _,f as N,w as E,x as I,j as r,a as M}from"./index-CCNaUj2A.js";import{A as L,a as R,b as T,c as $,d as B,e as V,f as k}from"./alert-dialog-DhxQ40TA.js";import{u as q,B as H}from"./button-DuitHSR8.js";import{F as U,a as G,b as J,c as K,d as P,e as Q,f as W}from"./form-BfiwCHdz.js";import{I as X}from"./input-YU6lpVgW.js";import{S as Y}from"./spinner-CNb2mD_9.js";function A(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Z=D({name:O().min(2,"Organization name is required")});function ne(n){const e=_.c(42),{open:o,onOpenChange:l}=n,v=N();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={resolver:E(Z),defaultValues:{name:""}},e[0]=b):b=e[0];const t=I(b);let z;e[1]!==v?(z={mutationFn:ee,onSuccess:i=>{const{orgSlug:s}=i;v({to:"/$org",params:{org:s}})}},e[1]=v,e[2]=z):z=e[2];const a=q(z),F=a.error instanceof Error?a.error.message:a.error?"Failed to create organization.":null;let w;e[3]===Symbol.for("react.memo_cache_sentinel")?(w=r.jsxs(T,{children:[r.jsx($,{children:"Create a new organization"}),r.jsx(B,{children:"Set up a new organization to collaborate with others."})]}),e[3]=w):w=e[3];let m;if(e[4]!==a||e[5]!==t){let i;e[7]!==a?(i=s=>a.mutateAsync(s),e[7]=a,e[8]=i):i=e[8],m=t.handleSubmit(i),e[4]=a,e[5]=t,e[6]=m}else m=e[6];let c;e[9]!==t.formState.isSubmitting?(c=i=>{const{field:s}=i;return r.jsxs(J,{children:[r.jsx(K,{children:"Organization Name"}),r.jsx(P,{children:r.jsx(X,{...s,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(Q,{children:"The name of your company or organization"}),s.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",A(s.value)]})]}),r.jsx(W,{})]})},e[9]=t.formState.isSubmitting,e[10]=c):c=e[10];let g;e[11]!==t.control||e[12]!==c?(g=r.jsx(U,{control:t.control,name:"name",render:c}),e[11]=t.control,e[12]=c,e[13]=g):g=e[13];let f;e[14]!==F?(f=F&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:F}),e[14]=F,e[15]=f):f=e[15];let u;e[16]!==a||e[17]!==t?(u=()=>{a.reset(),t.reset()},e[16]=a,e[17]=t,e[18]=u):u=e[18];let d;e[19]!==t.formState.isSubmitting||e[20]!==u?(d=r.jsx(L,{disabled:t.formState.isSubmitting,onClick:u,children:"Cancel"}),e[19]=t.formState.isSubmitting,e[20]=u,e[21]=d):d=e[21];const y=!t.formState.isValid||t.formState.isSubmitting;let x;e[22]!==t.formState.isSubmitting?(x=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Y,{size:"xs"})," Creating..."]}):"Create Organization",e[22]=t.formState.isSubmitting,e[23]=x):x=e[23];let S;e[24]!==y||e[25]!==x?(S=r.jsx(H,{type:"submit",variant:"default",disabled:y,children:x}),e[24]=y,e[25]=x,e[26]=S):S=e[26];let h;e[27]!==S||e[28]!==d?(h=r.jsxs(V,{children:[d,S]}),e[27]=S,e[28]=d,e[29]=h):h=e[29];let p;e[30]!==h||e[31]!==m||e[32]!==g||e[33]!==f?(p=r.jsxs("form",{className:"space-y-6",onSubmit:m,autoComplete:"off",children:[g,f,h]}),e[30]=h,e[31]=m,e[32]=g,e[33]=f,e[34]=p):p=e[34];let j;e[35]!==t||e[36]!==p?(j=r.jsxs(R,{children:[w,r.jsx(G,{...t,children:p})]}),e[35]=t,e[36]=p,e[37]=j):j=e[37];let C;return e[38]!==l||e[39]!==o||e[40]!==j?(C=r.jsx(k,{open:o,onOpenChange:l,children:j}),e[38]=l,e[39]=o,e[40]=j,e[41]=C):C=e[41],C}async function ee(n){const e=A(n.name);if(!e)throw new Error("Organization slug is invalid");const o=await M.organization.create({name:n.name,slug:e});if(o?.error)throw new Error(o.error.message||"Failed to create organization");const l=o?.data?.slug??e;if(!l)throw new Error("Failed to create organization");return{orgSlug:l}}export{ne as C};
@@ -1 +1 @@
1
- import{c as n,j as i,R as p,C as g,T as m,D as x,P as b,O as v,aI as j,g as N}from"./index-BlDToaIG.js";import{c}from"./utils-3t85Hz8W.js";import{i as h}from"./X-BScAvcL1.js";function C(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("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-xl border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("textarea",{"data-slot":"textarea",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}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(p,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function _(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function D(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function 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(v,{"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(N,{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 u;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(u=i.jsxs(D,{"data-slot":"dialog-portal",children:[r,i.jsxs(g,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=u):u=e[14],u}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col 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 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("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 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("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(m,{"data-slot":"dialog-title",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("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(x,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{O as D,C as T,B as a,E as b,R as c,T as d,_ as e,P as f};
1
+ import{c as n,j as i,R as p,C as g,T as m,D as x,P as b,O as v,aS as j,g as N}from"./index-CCNaUj2A.js";import{c}from"./utils-o1atviYh.js";import{i as h}from"./X-BTsWwO_U.js";function C(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("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-xl border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("textarea",{"data-slot":"textarea",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}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(p,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function _(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function D(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function 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(v,{"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(N,{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 u;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(u=i.jsxs(D,{"data-slot":"dialog-portal",children:[r,i.jsxs(g,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=u):u=e[14],u}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col 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 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("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 S(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-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(m,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}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("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(x,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{O as D,C as T,S as a,B as b,R as c,T as d,_ as e,P as f};
@@ -1 +1 @@
1
- import{r as u,c,j as d,b7 as f,b8 as g,b9 as v,ba as h,bb as x,bc as b,bd as w,be as C,bf as j}from"./index-BlDToaIG.js";import{c as p}from"./utils-3t85Hz8W.js";const k=({size:a=24,color:e="currentColor",...t})=>u.createElement("svg",{viewBox:"0 0 24 24",width:a,height:a,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},u.createElement("path",{d:"M12 19V5m0 0-7 7m7-7 7 7"}));k.displayName="ArrowUp";const m=({size:a=24,color:e="currentColor",...t})=>u.createElement("svg",{viewBox:"0 0 24 24",width:a,height:a,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},u.createElement("path",{d:"m9 18 6-6-6-6"}));m.displayName="ChevronRight";const N=({size:a=24,color:e="currentColor",...t})=>u.createElement("svg",{viewBox:"0 0 24 24",width:a,height:a,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},u.createElement("path",{d:"M8.4 3H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 3.76 3 4.04 3 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 10 4.04 10 4.6 10h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 9.24 10 8.96 10 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 3 8.96 3 8.4 3Zm11 0h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 3.76 14 4.04 14 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 10 15.04 10 15.6 10h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 9.24 21 8.96 21 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 3 19.96 3 19.4 3Zm0 11h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 14.76 14 15.04 14 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 21 15.04 21 15.6 21h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 20.24 21 19.96 21 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 14 19.96 14 19.4 14Zm-11 0H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 14.76 3 15.04 3 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 20.24 10 19.96 10 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 14 8.96 14 8.4 14Z"}));N.displayName="Grid01";function y(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function D(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(g,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function E(a){const e=c.c(10);let t,o,s;e[0]!==a?({className:t,sideOffset:s,...o}=a,e[0]=a,e[1]=t,e[2]=o,e[3]=s):(t=e[1],o=e[2],s=e[3]);const n=s===void 0?4:s;let r;e[4]!==t?(r=p("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==o||e[7]!==n||e[8]!==r?(i=d.jsx(v,{children:d.jsx(h,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=i):i=e[9],i}function S(a){const e=c.c(12);let t,o,s,n;e[0]!==a?({className:t,inset:o,variant:n,...s}=a,e[0]=a,e[1]=t,e[2]=o,e[3]=s,e[4]=n):(t=e[1],o=e[2],s=e[3],n=e[4]);const r=n===void 0?"default":n;let i;e[5]!==t?(i=p("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==o||e[8]!==s||e[9]!==i||e[10]!==r?(l=d.jsx(x,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:i,...s}),e[7]=o,e[8]=s,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function $(a){const e=c.c(8);let t,o;e[0]!==a?({className:t,...o}=a,e[0]=a,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let s;e[3]!==t?(s=p("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=s):s=e[4];let n;return e[5]!==o||e[6]!==s?(n=d.jsx(j,{"data-slot":"dropdown-menu-separator",className:s,...o}),e[5]=o,e[6]=s,e[7]=n):n=e[7],n}function L(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(b,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function _(a){const e=c.c(13);let t,o,s,n;e[0]!==a?({className:o,inset:s,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=o,e[3]=s,e[4]=n):(t=e[1],o=e[2],s=e[3],n=e[4]);let r;e[5]!==o?(r=p("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-xl px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",o),e[5]=o,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(m,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=d.jsxs(w,{"data-slot":"dropdown-menu-sub-trigger","data-inset":s,className:r,...n,children:[t,i]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function R(a){const e=c.c(8);let t,o;e[0]!==a?({className:t,...o}=a,e[0]=a,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let s;e[3]!==t?(s=p("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]=s):s=e[4];let n;return e[5]!==o||e[6]!==s?(n=d.jsx(C,{"data-slot":"dropdown-menu-sub-content",className:s,...o}),e[5]=o,e[6]=s,e[7]=n):n=e[7],n}export{D,E as a,y as b,N as c,S as d,$ as e,L as f,_ as g,R as h,m as i,k as j};
1
+ import{r as u,c,j as d,bh as f,bi as g,bj as v,bk as h,bl as x,bm as b,bn as w,bo as C,bp as j}from"./index-CCNaUj2A.js";import{c as p}from"./utils-o1atviYh.js";const k=({size:a=24,color:e="currentColor",...t})=>u.createElement("svg",{viewBox:"0 0 24 24",width:a,height:a,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},u.createElement("path",{d:"M12 19V5m0 0-7 7m7-7 7 7"}));k.displayName="ArrowUp";const m=({size:a=24,color:e="currentColor",...t})=>u.createElement("svg",{viewBox:"0 0 24 24",width:a,height:a,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},u.createElement("path",{d:"m9 18 6-6-6-6"}));m.displayName="ChevronRight";const N=({size:a=24,color:e="currentColor",...t})=>u.createElement("svg",{viewBox:"0 0 24 24",width:a,height:a,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},u.createElement("path",{d:"M8.4 3H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 3.76 3 4.04 3 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 10 4.04 10 4.6 10h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 9.24 10 8.96 10 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 3 8.96 3 8.4 3Zm11 0h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 3.76 14 4.04 14 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 10 15.04 10 15.6 10h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 9.24 21 8.96 21 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 3 19.96 3 19.4 3Zm0 11h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 14.76 14 15.04 14 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 21 15.04 21 15.6 21h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 20.24 21 19.96 21 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 14 19.96 14 19.4 14Zm-11 0H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 14.76 3 15.04 3 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 20.24 10 19.96 10 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 14 8.96 14 8.4 14Z"}));N.displayName="Grid01";function y(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function D(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(g,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function E(a){const e=c.c(10);let t,o,s;e[0]!==a?({className:t,sideOffset:s,...o}=a,e[0]=a,e[1]=t,e[2]=o,e[3]=s):(t=e[1],o=e[2],s=e[3]);const n=s===void 0?4:s;let r;e[4]!==t?(r=p("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==o||e[7]!==n||e[8]!==r?(i=d.jsx(v,{children:d.jsx(h,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=i):i=e[9],i}function S(a){const e=c.c(12);let t,o,s,n;e[0]!==a?({className:t,inset:o,variant:n,...s}=a,e[0]=a,e[1]=t,e[2]=o,e[3]=s,e[4]=n):(t=e[1],o=e[2],s=e[3],n=e[4]);const r=n===void 0?"default":n;let i;e[5]!==t?(i=p("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-xl px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==o||e[8]!==s||e[9]!==i||e[10]!==r?(l=d.jsx(x,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:i,...s}),e[7]=o,e[8]=s,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function $(a){const e=c.c(8);let t,o;e[0]!==a?({className:t,...o}=a,e[0]=a,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let s;e[3]!==t?(s=p("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=s):s=e[4];let n;return e[5]!==o||e[6]!==s?(n=d.jsx(j,{"data-slot":"dropdown-menu-separator",className:s,...o}),e[5]=o,e[6]=s,e[7]=n):n=e[7],n}function L(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(b,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function _(a){const e=c.c(13);let t,o,s,n;e[0]!==a?({className:o,inset:s,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=o,e[3]=s,e[4]=n):(t=e[1],o=e[2],s=e[3],n=e[4]);let r;e[5]!==o?(r=p("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-xl px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",o),e[5]=o,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(m,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=d.jsxs(w,{"data-slot":"dropdown-menu-sub-trigger","data-inset":s,className:r,...n,children:[t,i]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function R(a){const e=c.c(8);let t,o;e[0]!==a?({className:t,...o}=a,e[0]=a,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let s;e[3]!==t?(s=p("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]=s):s=e[4];let n;return e[5]!==o||e[6]!==s?(n=d.jsx(C,{"data-slot":"dropdown-menu-sub-content",className:s,...o}),e[5]=o,e[6]=s,e[7]=n):n=e[7],n}export{D,E as a,y as b,N as c,S as d,$ as e,L as f,_ as g,R as h,m as i,k as j};
@@ -0,0 +1 @@
1
+ import{r as N,s as y,a0 as P,V as _,v as t,W as p,aP as j,aI as R,c as W,j as c}from"./index-CCNaUj2A.js";import{B as z}from"./button-DuitHSR8.js";import{I as V}from"./input-YU6lpVgW.js";import{s as H}from"./Plus-DF_I5mml.js";import{s as L}from"./Trash01-FYPMjpVf.js";const U=({size:i=24,color:e="currentColor",...n})=>N.createElement("svg",{viewBox:"0 0 24 24",width:i,height:i,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},N.createElement("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10m0-20C6.477 2 2 6.477 2 12s4.477 10 10 10m0-20c5.523 0 10 4.477 10 10s-4.477 10-10 10M2.5 9h19m-19 6h19"}));U.displayName="Globe02";const B=y({authorizationEndpoint:t().url(),tokenEndpoint:t().url(),introspectionEndpoint:t().url().optional(),clientId:t(),clientSecret:t().optional(),scopes:_(t()),grantType:P(["authorization_code","client_credentials"])}),M=y({name:t(),description:t().optional(),inputSchema:p(t(),j()),outputSchema:p(t(),j()).optional()}),$=y({headers:p(t(),t()).optional()}),q=y({command:t().describe("Command to run (e.g., 'npx', 'node')"),args:_(t()).optional().describe("Command arguments"),cwd:t().optional().describe("Working directory"),envVars:p(t(),t()).optional().describe("Environment variables (encrypted in storage)")}),O=y({id:t().describe("Unique identifier for the connection"),title:t().describe("Human-readable name for the connection"),created_at:t().describe("When the connection was created"),updated_at:t().describe("When the connection was last updated"),created_by:t().describe("User ID who created the connection"),updated_by:t().optional().describe("User ID who last updated the connection"),organization_id:t().describe("Organization ID this connection belongs to"),description:t().nullable().describe("Description of the connection"),icon:t().nullable().describe("Icon URL for the connection"),app_name:t().nullable().describe("Associated app name"),app_id:t().nullable().describe("Associated app ID"),connection_type:P(["HTTP","SSE","Websocket","STDIO"]).describe("Type of connection"),connection_url:t().nullable().describe("URL for HTTP/SSE/WebSocket connections. Null for STDIO."),connection_token:t().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:R([q,$]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:B.nullable().describe("OAuth configuration"),configuration_state:p(t(),j()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:_(t()).nullable().optional().describe("Configuration scopes"),metadata:p(t(),j()).nullable().describe("Additional metadata (includes repository info)"),tools:_(M).nullable().describe("Discovered tools from MCP"),bindings:_(t()).nullable().describe("Detected bindings"),status:P(["active","inactive","error"]).describe("Current status")});O.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});O.partial();function X(i){return i!=null&&"command"in i}function Y(i){const e=W.c(34),{value:n,onChange:o,keyPlaceholder:A,valuePlaceholder:D,className:w}=i,h=A===void 0?"VARIABLE_NAME":A,f=D===void 0?"value...":D;let k;e[0]!==o||e[1]!==n?(k=()=>{o([...n,{key:"",value:""}])},e[0]=o,e[1]=n,e[2]=k):k=e[2];const I=k;let E;e[3]!==o||e[4]!==n?(E=r=>{o(n.filter((l,a)=>a!==r))},e[3]=o,e[4]=n,e[5]=E):E=e[5];const b=E;let x;e[6]!==o||e[7]!==n?(x=(r,l)=>{const a=[...n],s=a[r];s&&(a[r]={key:l,value:s.value},o(a))},e[6]=o,e[7]=n,e[8]=x):x=e[8];const g=x;let C;e[9]!==o||e[10]!==n?(C=(r,l)=>{const a=[...n],s=a[r];s&&(a[r]={key:s.key,value:l},o(a))},e[9]=o,e[10]=n,e[11]=C):C=e[11];const v=C;let d;if(e[12]!==g||e[13]!==b||e[14]!==v||e[15]!==h||e[16]!==n||e[17]!==f){let r;e[19]!==g||e[20]!==b||e[21]!==v||e[22]!==h||e[23]!==f?(r=(l,a)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(V,{placeholder:h,value:l.key,onChange:s=>g(a,s.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),c.jsx(V,{type:"password",placeholder:f,value:l.value,onChange:s=>v(a,s.target.value),className:"h-10 rounded-lg flex-1"}),c.jsx(z,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>b(a),children:c.jsx(L,{size:16})})]},a),e[19]=g,e[20]=b,e[21]=v,e[22]=h,e[23]=f,e[24]=r):r=e[24],d=n.map(r),e[12]=g,e[13]=b,e[14]=v,e[15]=h,e[16]=n,e[17]=f,e[18]=d}else d=e[18];let S;e[25]===Symbol.for("react.memo_cache_sentinel")?(S=c.jsx(H,{size:16,className:"mr-1"}),e[25]=S):S=e[25];let u;e[26]!==I?(u=c.jsxs(z,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:I,children:[S,"Add Environment Variable"]}),e[26]=I,e[27]=u):u=e[27];let m;e[28]!==d||e[29]!==u?(m=c.jsxs("div",{className:"flex flex-col gap-2",children:[d,u]}),e[28]=d,e[29]=u,e[30]=m):m=e[30];let T;return e[31]!==w||e[32]!==m?(T=c.jsx("div",{className:w,children:m}),e[31]=w,e[32]=m,e[33]=T):T=e[33],T}function Z(i){const e={};for(const{key:n,value:o}of i)n.trim()&&(e[n.trim()]=o);return e}function ee(i){return i?Object.entries(i).map(([e,n])=>({key:e,value:n})):[]}export{Y as E,Z as e,X as i,ee as r,U as s};
@@ -1 +1 @@
1
- import{r as a,j as e}from"./index-BlDToaIG.js";import{B as n}from"./button-DP3Fjd19.js";const o=({size:t=24,color:r="currentColor",...s})=>a.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},a.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"}));o.displayName="AlertTriangle";class l extends a.Component{state={hasError:!1,error:null};static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,s){console.error("Uncaught error:",r,s)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[e.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:e.jsx(o,{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.setState({hasError:!1,error:null}),children:"Try again"})]}):this.props.children}}export{l as E};
1
+ import{r as a,j as e}from"./index-CCNaUj2A.js";import{B as n}from"./button-DuitHSR8.js";const o=({size:t=24,color:r="currentColor",...s})=>a.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},a.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"}));o.displayName="AlertTriangle";class l extends a.Component{state={hasError:!1,error:null};static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,s){console.error("Uncaught error:",r,s)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[e.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:e.jsx(o,{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.setState({hasError:!1,error:null}),children:"Try again"})]}):this.props.children}}export{l as E};
@@ -0,0 +1 @@
1
+ import{B as v}from"./use-binding-DdwsXkNS.js";import{aH as C}from"./index-CCNaUj2A.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 +1 @@
1
- import{c as d,j as m,aO as $,bu as j,bv as v,r as f,i as C,bw as N,bx as h}from"./index-BlDToaIG.js";import{c as u}from"./utils-3t85Hz8W.js";function S(t){const e=d.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let l;e[3]!==s?(l=u("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r=m.jsx($,{"data-slot":"label",className:l,...o}),e[5]=o,e[6]=l,e[7]=r):r=e[7],r}const D=j,g=f.createContext({}),E=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let l;e[4]!==s?(l=m.jsx(v,{...s}),e[4]=s,e[5]=l):l=e[5];let r;return e[6]!==o||e[7]!==l?(r=m.jsx(g.Provider,{value:o,children:l}),e[6]=o,e[7]=l,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(g),s=f.useContext(I),{getFieldState:o}=N();let l;t[0]!==e.name?(l={name:e.name},t[0]=e.name,t[1]=l):l=t[1];const r=h(l);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const n=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,c=`${i}-form-item`,F=`${i}-form-item-description`,b=`${i}-form-item-message`;let p;return t[6]!==e.name||t[7]!==n||t[8]!==i||t[9]!==c||t[10]!==F||t[11]!==b?(p={id:i,name:e.name,formItemId:c,formDescriptionId:F,formMessageId:b,...n},t[6]=e.name,t[7]=n,t[8]=i,t[9]=c,t[10]=F,t[11]=b,t[12]=p):p=t[12],p},I=f.createContext({});function M(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const l=f.useId();let r;e[3]!==l?(r={id:l},e[3]=l,e[4]=r):r=e[4];let a;e[5]!==s?(a=u("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let n;e[7]!==o||e[8]!==a?(n=m.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=n):n=e[9];let i;return e[10]!==r||e[11]!==n?(i=m.jsx(I.Provider,{value:r,children:n}),e[10]=r,e[11]=n,e[12]=i):i=e[12],i}function P(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formItemId:r}=x(),a=!!l;let n;e[3]!==s?(n=u("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==n?(i=m.jsx(S,{"data-slot":"form-label","data-error":a,className:n,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=n,e[9]=i):i=e[9],i}function R(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:l,formDescriptionId:r,formMessageId:a}=x(),n=o?`${r} ${a}`:`${r}`,i=!!o;let c;return e[2]!==l||e[3]!==s||e[4]!==n||e[5]!==i?(c=m.jsx(C,{"data-slot":"form-control",id:l,"aria-describedby":n,"aria-invalid":i,...s}),e[2]=l,e[3]=s,e[4]=n,e[5]=i,e[6]=c):c=e[6],c}function L(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:l}=x();let r;e[3]!==s?(r=u("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==o||e[7]!==r?(a=m.jsx("p",{"data-slot":"form-description",id:l,className:r,...o}),e[5]=l,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function O(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formMessageId:r}=x(),a=l?String(l?.message??""):o.children;if(!a)return null;let n;e[3]!==s?(n=u("text-destructive text-sm",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==n?(i=m.jsx("p",{"data-slot":"form-message",id:r,className:n,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=n,e[9]=i):i=e[9],i}export{E as F,D as a,M as b,P as c,R as d,L as e,O as f};
1
+ import{c as d,j as m,aY as $,bE as j,bF as C,r as f,i as v,bG as N,bH as h}from"./index-CCNaUj2A.js";import{c as u}from"./utils-o1atviYh.js";function S(t){const e=d.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let l;e[3]!==s?(l=u("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r=m.jsx($,{"data-slot":"label",className:l,...o}),e[5]=o,e[6]=l,e[7]=r):r=e[7],r}const y=j,g=f.createContext({}),D=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let l;e[4]!==s?(l=m.jsx(C,{...s}),e[4]=s,e[5]=l):l=e[5];let r;return e[6]!==o||e[7]!==l?(r=m.jsx(g.Provider,{value:o,children:l}),e[6]=o,e[7]=l,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(g),s=f.useContext(I),{getFieldState:o}=N();let l;t[0]!==e.name?(l={name:e.name},t[0]=e.name,t[1]=l):l=t[1];const r=h(l);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const n=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,c=`${i}-form-item`,F=`${i}-form-item-description`,b=`${i}-form-item-message`;let p;return t[6]!==e.name||t[7]!==n||t[8]!==i||t[9]!==c||t[10]!==F||t[11]!==b?(p={id:i,name:e.name,formItemId:c,formDescriptionId:F,formMessageId:b,...n},t[6]=e.name,t[7]=n,t[8]=i,t[9]=c,t[10]=F,t[11]=b,t[12]=p):p=t[12],p},I=f.createContext({});function M(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const l=f.useId();let r;e[3]!==l?(r={id:l},e[3]=l,e[4]=r):r=e[4];let a;e[5]!==s?(a=u("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let n;e[7]!==o||e[8]!==a?(n=m.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=n):n=e[9];let i;return e[10]!==r||e[11]!==n?(i=m.jsx(I.Provider,{value:r,children:n}),e[10]=r,e[11]=n,e[12]=i):i=e[12],i}function P(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formItemId:r}=x(),a=!!l;let n;e[3]!==s?(n=u("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==n?(i=m.jsx(S,{"data-slot":"form-label","data-error":a,className:n,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=n,e[9]=i):i=e[9],i}function R(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:l,formDescriptionId:r,formMessageId:a}=x(),n=o?`${r} ${a}`:`${r}`,i=!!o;let c;return e[2]!==l||e[3]!==s||e[4]!==n||e[5]!==i?(c=m.jsx(v,{"data-slot":"form-control",id:l,"aria-describedby":n,"aria-invalid":i,...s}),e[2]=l,e[3]=s,e[4]=n,e[5]=i,e[6]=c):c=e[6],c}function L(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:l}=x();let r;e[3]!==s?(r=u("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==l||e[6]!==o||e[7]!==r?(a=m.jsx("p",{"data-slot":"form-description",id:l,className:r,...o}),e[5]=l,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function G(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formMessageId:r}=x(),a=l?String(l?.message??""):o.children;if(!a)return null;let n;e[3]!==s?(n=u("text-destructive text-sm",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==n?(i=m.jsx("p",{"data-slot":"form-message",id:r,className:n,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=n,e[9]=i):i=e[9],i}export{D as F,y as a,M as b,P as c,R as d,L as e,G as f};
@@ -1 +1 @@
1
- import{bg as X,bh as O,bi as q,bj as j,ap as A,Y,bk as _,bl as z,r as w,bm as I,bn as L,bo as N,bp as H,bq as k,br as x,bs as V,bt as J}from"./index-BlDToaIG.js";function F(t,n){const e=new Set(n);return t.filter(s=>!e.has(s))}function B(t,n,e){const s=t.slice(0);return s[n]=e,s}var U=class extends X{#r;#t;#s;#a;#e;#n;#o;#i;#u=[];constructor(t,n,e){super(),this.#r=t,this.#a=e,this.#s=[],this.#e=[],this.#t=[],this.setQueries(n)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(t=>{t.subscribe(n=>{this.#d(t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(t=>{t.destroy()})}setQueries(t,n){this.#s=t,this.#a=n,O.batch(()=>{const e=this.#e,s=this.#l(this.#s);s.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions));const r=s.map(u=>u.observer),i=r.map(u=>u.getCurrentResult()),o=e.length!==r.length,a=r.some((u,f)=>u!==e[f]),c=o||a,d=c?!0:i.some((u,f)=>{const h=this.#t[f];return!h||!q(u,h)});!c&&!d||(c&&(this.#u=s,this.#e=r),this.#t=i,this.hasListeners()&&(c&&(F(e,r).forEach(u=>{u.destroy()}),F(r,e).forEach(u=>{u.subscribe(f=>{this.#d(u,f)})})),this.#f()))})}getCurrentResult(){return this.#t}getQueries(){return this.#e.map(t=>t.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(t,n){const e=this.#l(t),s=e.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions));return[s,r=>this.#h(r??s,n),()=>this.#c(s,e)]}#c(t,n){return n.map((e,s)=>{const r=t[s];return e.defaultedQueryOptions.notifyOnChangeProps?r:e.observer.trackResult(r,i=>{n.forEach(o=>{o.observer.trackProp(i)})})})}#h(t,n){return n?((!this.#n||this.#t!==this.#i||n!==this.#o)&&(this.#o=n,this.#i=this.#t,this.#n=j(this.#n,n(t))),this.#n):t}#l(t){const n=new Map;this.#e.forEach(s=>{const r=s.options.queryHash;if(!r)return;const i=n.get(r);i?i.push(s):n.set(r,[s])});const e=[];return t.forEach(s=>{const r=this.#r.defaultQueryOptions(s),o=n.get(r.queryHash)?.shift()??new A(this.#r,r);e.push({defaultedQueryOptions:r,observer:o})}),e}#d(t,n){const e=this.#e.indexOf(t);e!==-1&&(this.#t=B(this.#t,e,n),this.#f())}#f(){if(this.hasListeners()){const t=this.#n,n=this.#c(this.#t,this.#u),e=this.#h(n,this.#a?.combine);t!==e&&O.batch(()=>{this.listeners.forEach(s=>{s(this.#t)})})}}};function It({queries:t,...n},e){const s=Y(e),r=_(),i=z(),o=w.useMemo(()=>t.map(l=>{const b=s.defaultQueryOptions(l);return b._optimisticResults=r?"isRestoring":"optimistic",b}),[t,s,r]);o.forEach(l=>{I(l);const b=s.getQueryCache().get(l.queryHash);L(l,i,b)}),N(i);const[a]=w.useState(()=>new U(s,o,n)),[c,d,u]=a.getOptimisticResult(o,n.combine),f=!r&&n.subscribed!==!1;w.useSyncExternalStore(w.useCallback(l=>f?a.subscribe(O.batchCalls(l)):H,[a,f]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),w.useEffect(()=>{a.setQueries(o,n)},[o,n,a]);const g=c.some((l,b)=>k(o[b],l))?c.flatMap((l,b)=>{const y=o[b];if(y){const R=new A(s,y);if(k(y,l))return x(y,R,i);V(l,r)&&x(y,R,i)}return[]}):[];if(g.length>0)throw Promise.all(g);const m=c.find((l,b)=>{const y=o[b];return y&&J({result:l,errorResetBoundary:i,throwOnError:y.throwOnError,query:s.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(m?.error)throw m.error;return d(u())}const D=43200,E=1440,Q=Symbol.for("constructDateFrom");function W(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&Q in t?t[Q](n):t instanceof Date?new t.constructor(n):new Date(n)}function p(t,n){return W(t,t)}let K={};function $(){return K}function T(t){const n=p(t),e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return e.setUTCFullYear(n.getFullYear()),+t-+e}function C(t,...n){const e=W.bind(null,t||n.find(s=>typeof s=="object"));return n.map(e)}function P(t,n){const e=+p(t)-+p(n);return e<0?-1:e>0?1:e}function G(t){return W(t,Date.now())}function Z(t,n,e){const[s,r]=C(e?.in,t,n),i=s.getFullYear()-r.getFullYear(),o=s.getMonth()-r.getMonth();return i*12+o}function tt(t){return n=>{const s=(t?Math[t]:Math.trunc)(n);return s===0?0:s}}function et(t,n){return+p(t)-+p(n)}function nt(t,n){const e=p(t);return e.setHours(23,59,59,999),e}function rt(t,n){const e=p(t),s=e.getMonth();return e.setFullYear(e.getFullYear(),s+1,0),e.setHours(23,59,59,999),e}function st(t,n){const e=p(t);return+nt(e)==+rt(e)}function at(t,n,e){const[s,r,i]=C(e?.in,t,t,n),o=P(r,i),a=Math.abs(Z(r,i));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-o*a);let c=P(r,i)===-o;st(s)&&a===1&&P(s,i)===1&&(c=!1);const d=o*(a-+c);return d===0?0:d}function ot(t,n,e){const s=et(t,n)/1e3;return tt(e?.roundingMethod)(s)}const it={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ut=(t,n,e)=>{let s;const r=it[t];return typeof r=="string"?s=r:n===1?s=r.one:s=r.other.replace("{{count}}",n.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+s:s+" ago":s};function S(t){return(n={})=>{const e=n.width?String(n.width):t.defaultWidth;return t.formats[e]||t.formats[t.defaultWidth]}}const ct={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ht={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},lt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dt={date:S({formats:ct,defaultWidth:"full"}),time:S({formats:ht,defaultWidth:"full"}),dateTime:S({formats:lt,defaultWidth:"full"})},ft={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mt=(t,n,e,s)=>ft[t];function M(t){return(n,e)=>{const s=e?.context?String(e.context):"standalone";let r;if(s==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=e?.width?String(e.width):o;r=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=e?.width?String(e.width):t.defaultWidth;r=t.values[a]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(n):n;return r[i]}}const bt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},pt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},wt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vt=(t,n)=>{const e=Number(t),s=e%100;if(s>20||s<10)switch(s%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Dt={ordinalNumber:vt,era:M({values:bt,defaultWidth:"wide"}),quarter:M({values:yt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:M({values:gt,defaultWidth:"wide"}),day:M({values:pt,defaultWidth:"wide"}),dayPeriod:M({values:wt,defaultWidth:"wide",formattingValues:Mt,defaultFormattingWidth:"wide"})};function v(t){return(n,e={})=>{const s=e.width,r=s&&t.matchPatterns[s]||t.matchPatterns[t.defaultMatchWidth],i=n.match(r);if(!i)return null;const o=i[0],a=s&&t.parsePatterns[s]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(a)?St(a,f=>f.test(o)):Pt(a,f=>f.test(o));let d;d=t.valueCallback?t.valueCallback(c):c,d=e.valueCallback?e.valueCallback(d):d;const u=n.slice(o.length);return{value:d,rest:u}}}function Pt(t,n){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&n(t[e]))return e}function St(t,n){for(let e=0;e<t.length;e++)if(n(t[e]))return e}function Ot(t){return(n,e={})=>{const s=n.match(t.matchPattern);if(!s)return null;const r=s[0],i=n.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=e.valueCallback?e.valueCallback(o):o;const a=n.slice(r.length);return{value:o,rest:a}}}const Wt=/^(\d+)(th|st|nd|rd)?/i,Ct=/\d+/i,Rt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},kt={any:[/^b/i,/^(a|c)/i]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ft={any:[/1/i,/2/i,/3/i,/4/i]},Et={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Qt={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]},Tt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},At={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Xt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},qt={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}},jt={ordinalNumber:Ot({matchPattern:Wt,parsePattern:Ct,valueCallback:t=>parseInt(t,10)}),era:v({matchPatterns:Rt,defaultMatchWidth:"wide",parsePatterns:kt,defaultParseWidth:"any"}),quarter:v({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:Ft,defaultParseWidth:"any",valueCallback:t=>t+1}),month:v({matchPatterns:Et,defaultMatchWidth:"wide",parsePatterns:Qt,defaultParseWidth:"any"}),day:v({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:At,defaultParseWidth:"any"}),dayPeriod:v({matchPatterns:Xt,defaultMatchWidth:"any",parsePatterns:qt,defaultParseWidth:"any"})},Yt={code:"en-US",formatDistance:ut,formatLong:dt,formatRelative:mt,localize:Dt,match:jt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function _t(t,n,e){const s=$(),r=e?.locale??s.locale??Yt,i=2520,o=P(t,n);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},e,{addSuffix:e?.addSuffix,comparison:o}),[c,d]=C(e?.in,...o>0?[n,t]:[t,n]),u=ot(d,c),f=(T(d)-T(c))/1e3,h=Math.round((u-f)/60);let g;if(h<2)return e?.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,a):u<10?r.formatDistance("lessThanXSeconds",10,a):u<20?r.formatDistance("lessThanXSeconds",20,a):u<40?r.formatDistance("halfAMinute",0,a):u<60?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",1,a):h===0?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",h,a);if(h<45)return r.formatDistance("xMinutes",h,a);if(h<90)return r.formatDistance("aboutXHours",1,a);if(h<E){const m=Math.round(h/60);return r.formatDistance("aboutXHours",m,a)}else{if(h<i)return r.formatDistance("xDays",1,a);if(h<D){const m=Math.round(h/E);return r.formatDistance("xDays",m,a)}else if(h<D*2)return g=Math.round(h/D),r.formatDistance("aboutXMonths",g,a)}if(g=at(d,c),g<12){const m=Math.round(h/D);return r.formatDistance("xMonths",m,a)}else{const m=g%12,l=Math.trunc(g/12);return m<3?r.formatDistance("aboutXYears",l,a):m<9?r.formatDistance("overXYears",l,a):r.formatDistance("almostXYears",l+1,a)}}function Lt(t,n){return _t(t,G(t),n)}export{Lt as f,It as u};
1
+ import{bq as X,br as O,bs as q,bt as j,ap as A,Y,bu as z,bv as _,r as w,bw as I,bx as L,by as N,bz as H,bA as k,bB as x,bC as V,bD as J}from"./index-CCNaUj2A.js";function F(t,n){const e=new Set(n);return t.filter(s=>!e.has(s))}function B(t,n,e){const s=t.slice(0);return s[n]=e,s}var U=class extends X{#r;#t;#s;#a;#e;#n;#o;#i;#u=[];constructor(t,n,e){super(),this.#r=t,this.#a=e,this.#s=[],this.#e=[],this.#t=[],this.setQueries(n)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(t=>{t.subscribe(n=>{this.#d(t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(t=>{t.destroy()})}setQueries(t,n){this.#s=t,this.#a=n,O.batch(()=>{const e=this.#e,s=this.#l(this.#s);s.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions));const r=s.map(u=>u.observer),i=r.map(u=>u.getCurrentResult()),o=e.length!==r.length,a=r.some((u,f)=>u!==e[f]),c=o||a,d=c?!0:i.some((u,f)=>{const h=this.#t[f];return!h||!q(u,h)});!c&&!d||(c&&(this.#u=s,this.#e=r),this.#t=i,this.hasListeners()&&(c&&(F(e,r).forEach(u=>{u.destroy()}),F(r,e).forEach(u=>{u.subscribe(f=>{this.#d(u,f)})})),this.#f()))})}getCurrentResult(){return this.#t}getQueries(){return this.#e.map(t=>t.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(t,n){const e=this.#l(t),s=e.map(r=>r.observer.getOptimisticResult(r.defaultedQueryOptions));return[s,r=>this.#h(r??s,n),()=>this.#c(s,e)]}#c(t,n){return n.map((e,s)=>{const r=t[s];return e.defaultedQueryOptions.notifyOnChangeProps?r:e.observer.trackResult(r,i=>{n.forEach(o=>{o.observer.trackProp(i)})})})}#h(t,n){return n?((!this.#n||this.#t!==this.#i||n!==this.#o)&&(this.#o=n,this.#i=this.#t,this.#n=j(this.#n,n(t))),this.#n):t}#l(t){const n=new Map;this.#e.forEach(s=>{const r=s.options.queryHash;if(!r)return;const i=n.get(r);i?i.push(s):n.set(r,[s])});const e=[];return t.forEach(s=>{const r=this.#r.defaultQueryOptions(s),o=n.get(r.queryHash)?.shift()??new A(this.#r,r);e.push({defaultedQueryOptions:r,observer:o})}),e}#d(t,n){const e=this.#e.indexOf(t);e!==-1&&(this.#t=B(this.#t,e,n),this.#f())}#f(){if(this.hasListeners()){const t=this.#n,n=this.#c(this.#t,this.#u),e=this.#h(n,this.#a?.combine);t!==e&&O.batch(()=>{this.listeners.forEach(s=>{s(this.#t)})})}}};function It({queries:t,...n},e){const s=Y(e),r=z(),i=_(),o=w.useMemo(()=>t.map(l=>{const b=s.defaultQueryOptions(l);return b._optimisticResults=r?"isRestoring":"optimistic",b}),[t,s,r]);o.forEach(l=>{I(l);const b=s.getQueryCache().get(l.queryHash);L(l,i,b)}),N(i);const[a]=w.useState(()=>new U(s,o,n)),[c,d,u]=a.getOptimisticResult(o,n.combine),f=!r&&n.subscribed!==!1;w.useSyncExternalStore(w.useCallback(l=>f?a.subscribe(O.batchCalls(l)):H,[a,f]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),w.useEffect(()=>{a.setQueries(o,n)},[o,n,a]);const g=c.some((l,b)=>k(o[b],l))?c.flatMap((l,b)=>{const y=o[b];if(y){const R=new A(s,y);if(k(y,l))return x(y,R,i);V(l,r)&&x(y,R,i)}return[]}):[];if(g.length>0)throw Promise.all(g);const m=c.find((l,b)=>{const y=o[b];return y&&J({result:l,errorResetBoundary:i,throwOnError:y.throwOnError,query:s.getQueryCache().get(y.queryHash),suspense:y.suspense})});if(m?.error)throw m.error;return d(u())}const D=43200,E=1440,Q=Symbol.for("constructDateFrom");function W(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&Q in t?t[Q](n):t instanceof Date?new t.constructor(n):new Date(n)}function p(t,n){return W(t,t)}let K={};function $(){return K}function T(t){const n=p(t),e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return e.setUTCFullYear(n.getFullYear()),+t-+e}function C(t,...n){const e=W.bind(null,t||n.find(s=>typeof s=="object"));return n.map(e)}function P(t,n){const e=+p(t)-+p(n);return e<0?-1:e>0?1:e}function G(t){return W(t,Date.now())}function Z(t,n,e){const[s,r]=C(e?.in,t,n),i=s.getFullYear()-r.getFullYear(),o=s.getMonth()-r.getMonth();return i*12+o}function tt(t){return n=>{const s=(t?Math[t]:Math.trunc)(n);return s===0?0:s}}function et(t,n){return+p(t)-+p(n)}function nt(t,n){const e=p(t);return e.setHours(23,59,59,999),e}function rt(t,n){const e=p(t),s=e.getMonth();return e.setFullYear(e.getFullYear(),s+1,0),e.setHours(23,59,59,999),e}function st(t,n){const e=p(t);return+nt(e)==+rt(e)}function at(t,n,e){const[s,r,i]=C(e?.in,t,t,n),o=P(r,i),a=Math.abs(Z(r,i));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-o*a);let c=P(r,i)===-o;st(s)&&a===1&&P(s,i)===1&&(c=!1);const d=o*(a-+c);return d===0?0:d}function ot(t,n,e){const s=et(t,n)/1e3;return tt(e?.roundingMethod)(s)}const it={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ut=(t,n,e)=>{let s;const r=it[t];return typeof r=="string"?s=r:n===1?s=r.one:s=r.other.replace("{{count}}",n.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+s:s+" ago":s};function S(t){return(n={})=>{const e=n.width?String(n.width):t.defaultWidth;return t.formats[e]||t.formats[t.defaultWidth]}}const ct={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ht={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},lt={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dt={date:S({formats:ct,defaultWidth:"full"}),time:S({formats:ht,defaultWidth:"full"}),dateTime:S({formats:lt,defaultWidth:"full"})},ft={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mt=(t,n,e,s)=>ft[t];function M(t){return(n,e)=>{const s=e?.context?String(e.context):"standalone";let r;if(s==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=e?.width?String(e.width):o;r=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=e?.width?String(e.width):t.defaultWidth;r=t.values[a]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(n):n;return r[i]}}const bt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},gt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},pt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},wt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Mt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vt=(t,n)=>{const e=Number(t),s=e%100;if(s>20||s<10)switch(s%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Dt={ordinalNumber:vt,era:M({values:bt,defaultWidth:"wide"}),quarter:M({values:yt,defaultWidth:"wide",argumentCallback:t=>t-1}),month:M({values:gt,defaultWidth:"wide"}),day:M({values:pt,defaultWidth:"wide"}),dayPeriod:M({values:wt,defaultWidth:"wide",formattingValues:Mt,defaultFormattingWidth:"wide"})};function v(t){return(n,e={})=>{const s=e.width,r=s&&t.matchPatterns[s]||t.matchPatterns[t.defaultMatchWidth],i=n.match(r);if(!i)return null;const o=i[0],a=s&&t.parsePatterns[s]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(a)?St(a,f=>f.test(o)):Pt(a,f=>f.test(o));let d;d=t.valueCallback?t.valueCallback(c):c,d=e.valueCallback?e.valueCallback(d):d;const u=n.slice(o.length);return{value:d,rest:u}}}function Pt(t,n){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&n(t[e]))return e}function St(t,n){for(let e=0;e<t.length;e++)if(n(t[e]))return e}function Ot(t){return(n,e={})=>{const s=n.match(t.matchPattern);if(!s)return null;const r=s[0],i=n.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=e.valueCallback?e.valueCallback(o):o;const a=n.slice(r.length);return{value:o,rest:a}}}const Wt=/^(\d+)(th|st|nd|rd)?/i,Ct=/\d+/i,Rt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},kt={any:[/^b/i,/^(a|c)/i]},xt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ft={any:[/1/i,/2/i,/3/i,/4/i]},Et={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Qt={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]},Tt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},At={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Xt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},qt={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}},jt={ordinalNumber:Ot({matchPattern:Wt,parsePattern:Ct,valueCallback:t=>parseInt(t,10)}),era:v({matchPatterns:Rt,defaultMatchWidth:"wide",parsePatterns:kt,defaultParseWidth:"any"}),quarter:v({matchPatterns:xt,defaultMatchWidth:"wide",parsePatterns:Ft,defaultParseWidth:"any",valueCallback:t=>t+1}),month:v({matchPatterns:Et,defaultMatchWidth:"wide",parsePatterns:Qt,defaultParseWidth:"any"}),day:v({matchPatterns:Tt,defaultMatchWidth:"wide",parsePatterns:At,defaultParseWidth:"any"}),dayPeriod:v({matchPatterns:Xt,defaultMatchWidth:"any",parsePatterns:qt,defaultParseWidth:"any"})},Yt={code:"en-US",formatDistance:ut,formatLong:dt,formatRelative:mt,localize:Dt,match:jt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function zt(t,n,e){const s=$(),r=e?.locale??s.locale??Yt,i=2520,o=P(t,n);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},e,{addSuffix:e?.addSuffix,comparison:o}),[c,d]=C(e?.in,...o>0?[n,t]:[t,n]),u=ot(d,c),f=(T(d)-T(c))/1e3,h=Math.round((u-f)/60);let g;if(h<2)return e?.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,a):u<10?r.formatDistance("lessThanXSeconds",10,a):u<20?r.formatDistance("lessThanXSeconds",20,a):u<40?r.formatDistance("halfAMinute",0,a):u<60?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",1,a):h===0?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",h,a);if(h<45)return r.formatDistance("xMinutes",h,a);if(h<90)return r.formatDistance("aboutXHours",1,a);if(h<E){const m=Math.round(h/60);return r.formatDistance("aboutXHours",m,a)}else{if(h<i)return r.formatDistance("xDays",1,a);if(h<D){const m=Math.round(h/E);return r.formatDistance("xDays",m,a)}else if(h<D*2)return g=Math.round(h/D),r.formatDistance("aboutXMonths",g,a)}if(g=at(d,c),g<12){const m=Math.round(h/D);return r.formatDistance("xMonths",m,a)}else{const m=g%12,l=Math.trunc(g/12);return m<3?r.formatDistance("aboutXYears",l,a):m<9?r.formatDistance("overXYears",l,a):r.formatDistance("almostXYears",l+1,a)}}function Lt(t,n){return zt(t,G(t),n)}export{Lt as f,It as u};
@@ -1 +1 @@
1
- import{r as k,c as G,j as t,f as we,d as De,b as Fe,s as Ve,a0 as je,v as Se,av as Me,w as Ge,x as Oe,t as Ce}from"./index-BlDToaIG.js";import{E as Ue}from"./SearchMd-CuszgCqb.js";import{E as Ne}from"./error-boundary-DjqBPLyv.js";import{I as ye,u as Ie}from"./use-connection-DQ204Coq.js";import{T as Be,S as Le}from"./switch-B-fBwCox.js";import{C as Te}from"./checkbox-Bq-RnKQ1.js";import{B as X}from"./button-DP3Fjd19.js";import{i as Je}from"./ArrowLeft-CwqPFuY_.js";import{c as H}from"./utils-3t85Hz8W.js";import{C as qe}from"./collection-search-BQ-WB0Rj.js";import{I as ve}from"./input-v6ODzgkG.js";import{s as Qe}from"./Plus-DFHWilTh.js";import{i as Ke}from"./X-BScAvcL1.js";import{b as We,a as He}from"./use-gateway-B2ZAQHo8.js";import{u as Xe,a as Ye}from"./use-connection-resources-DR9t53Nb.js";import{a as ie,c as ce,b as ae,T as de,i as _e}from"./tooltip-DQ1jCLZj.js";import{a as Ze}from"./Copy01-C3tbrRU5.js";import{i as et}from"./CpuChip02-eOcghqj5.js";import{i as ke}from"./InfoCircle-82xtHE2K.js";import{i as be}from"./Loading01-CpOGYhvb.js";import{F as re,a as tt,b as ue,d as fe,f as xe,c as $e}from"./form-Dv8d8uAG.js";import{S as Pe,a as Re,b as ze,c as Ae,d as me}from"./select-KWMArkl_.js";import{R as st}from"./resource-tabs-ChQvNf5W.js";import{s as nt}from"./slugify-CEUa2lfQ.js";import{a as lt,V as ot,b as rt}from"./layout-DARzNM_G.js";import{f as it}from"./formatDistanceToNow-QA-1KB4j.js";import"./ChevronDown-CQZ630QJ.js";import"./badge-DXjKunmL.js";const ct=k.memo(function(e){const s=G.c(20),{connection:l,isSelected:a,hasItemsEnabled:o,activeItemsCount:f,totalItemsCount:h,onSelect:i,onToggle:r}=e,c=a?"bg-accent/50":"hover:bg-muted/50";let m;s[0]!==c?(m=H("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",c),s[0]=c,s[1]=m):m=s[1];let x;s[2]!==l.icon||s[3]!==l.title?(x=t.jsx(ye,{icon:l.icon,name:l.title,size:"xs"}),s[2]=l.icon,s[3]=l.title,s[4]=x):x=s[4];let j;s[5]!==l.title?(j=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),s[5]=l.title,s[6]=j):j=s[6];let p;s[7]!==i||s[8]!==x||s[9]!==j?(p=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:i,children:[x,j]}),s[7]=i,s[8]=x,s[9]=j,s[10]=p):p=s[10];let d;s[11]!==f||s[12]!==o||s[13]!==r||s[14]!==h?(d=h>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[f,"/",h]}),t.jsx(Te,{checked:o,onCheckedChange:r,onClick:dt})]}),s[11]=f,s[12]=o,s[13]=r,s[14]=h,s[15]=d):d=s[15];let y;return s[16]!==m||s[17]!==p||s[18]!==d?(y=t.jsxs("div",{className:m,children:[p,d]}),s[16]=m,s[17]=p,s[18]=d,s[19]=y):y=s[19],y}),at=k.memo(function(e){const s=G.c(18),{connectionId:l,item:a,isSelected:o,onToggle:f}=e,h=`item-${l}-${a.id}`,i=o?"text-foreground":"text-muted-foreground";let r;s[0]!==i?(r=H("text-sm font-medium",i),s[0]=i,s[1]=r):r=s[1];let c;s[2]!==a.name||s[3]!==r?(c=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:r,children:a.name})}),s[2]=a.name,s[3]=r,s[4]=c):c=s[4];let m;s[5]!==a.description?(m=a.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:a.description}),s[5]=a.description,s[6]=m):m=s[6];let x;s[7]!==c||s[8]!==m?(x=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,m]}),s[7]=c,s[8]=m,s[9]=x):x=s[9];const j=`item-${l}-${a.id}`;let p;s[10]!==o||s[11]!==f||s[12]!==j?(p=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Te,{id:j,checked:o,onCheckedChange:f,onClick:mt})}),s[10]=o,s[11]=f,s[12]=j,s[13]=p):p=s[13];let d;return s[14]!==h||s[15]!==x||s[16]!==p?(d=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:h,children:[x,p]}),s[14]=h,s[15]=x,s[16]=p,s[17]=d):d=s[17],d});function Ee({itemSet:n,onItemSetChange:e,getItems:s,itemLabel:l,emptyItemsMessage:a,extraContent:o}){const[f,h]=k.useState(""),i=k.useDeferredValue(f),[r,c]=k.useState("all"),[m,x]=k.useState(!1),j=k.useRef(new Set(Object.keys(n))),p=Ie({searchTerm:i.trim()||void 0}),d=j.current,y=[...d.values()].map(u=>p.find(S=>S.id===u)).filter(u=>u!==void 0),_=p.filter(u=>!d.has(u.id)),N=[...y,..._],g=u=>{const S=n[u];return S!==void 0&&S.length>0},b=N.filter(u=>{if(r==="all")return!0;const S=g(u.id);return r==="selected"?S:r==="unselected"?!S:!0}),[C,w]=k.useState(N[0]?.id??null),v=C?N.find(u=>u.id===C)??null:null,V=v?s(v):[],O=(u,S)=>n[u]?.includes(S)??!1,D=(u,S)=>{const $=n[u]??[],R=$.includes(S),z={...n};if(R){const A=$.filter(P=>P!==S);A.length===0?delete z[u]:z[u]=A}else z[u]=[...$,S];e(z)},M=u=>{const S=N.find(T=>T.id===u);if(!S)return;const $=s(S);if($.length===0)return;const R=n[u]??[],z=$.map(T=>T.id),A=R.length>0&&z.every(T=>R.includes(T)),P={...n};A?delete P[u]:(P[u]=z,w(u)),e(P)},J=u=>{w(u),x(!0)},F=()=>{x(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:H("w-full md:w-80 border-r border-border flex flex-col",m&&"hidden md:flex"),children:[t.jsx(qe,{value:f,onChange:h,placeholder:"Search MCP Servers..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>c("all"),className:H("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:()=>c("selected"),className:H("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:()=>c("unselected"),className:H("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:b.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:b.map(u=>{const $=s(u).length,R=n[u.id]?.length??0;return t.jsx(ct,{connection:u,isSelected:C===u.id,hasItemsEnabled:g(u.id),activeItemsCount:R,totalItemsCount:$,onSelect:()=>J(u.id),onToggle:()=>M(u.id)},u.id)})})})]}),t.jsx("div",{className:H("flex-1 flex-col",m?"flex":"hidden md:flex"),children:v?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(X,{variant:"ghost",size:"sm",onClick:F,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(Je,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(ye,{icon:v.icon,name:v.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:v.title}),v.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:v.description})]})]})]}),o,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:V.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:a||`This connection has no ${l} available`}):t.jsx("div",{className:"space-y-2",children:V.map(u=>t.jsx(at,{connectionId:v.id,item:u,isSelected:O(v.id,u.id),onToggle:()=>D(v.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 ",l]})})})]})}function dt(n){return n.stopPropagation()}function mt(n){return n.stopPropagation()}function ut(n){const e=G.c(6),{promptSet:s,onPromptSetChange:l,connectionPrompts:a}=n;let o;e[0]!==a?(o=i=>(a.get(i.id)??[]).map(ft),e[0]=a,e[1]=o):o=e[1];const f=o;let h;return e[2]!==f||e[3]!==l||e[4]!==s?(h=t.jsx(Ee,{itemSet:s,onItemSetChange:l,getItems:f,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=f,e[3]=l,e[4]=s,e[5]=h):h=e[5],h}function ft(n){return{id:n.name,name:n.name,description:n.description}}function xt(n){return n.includes("*")}function ht(n){const e=G.c(27),{patterns:s,onAddPattern:l,onRemovePattern:a}=n,[o,f]=k.useState("");let h;e[0]!==o||e[1]!==l||e[2]!==s?(h=()=>{const x=o.trim();x&&!s.includes(x)&&(l(x),f(""))},e[0]=o,e[1]=l,e[2]=s,e[3]=h):h=e[3];const i=h;let r;e[4]!==i?(r=x=>{x.key==="Enter"&&(x.preventDefault(),i())},e[4]=i,e[5]=r):r=e[5];const c=r;let m;if(e[6]!==i||e[7]!==c||e[8]!==o||e[9]!==a||e[10]!==s){const x=s.filter(xt);let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("code",{children:"*"}),e[12]=j):j=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=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]=p):p=e[13];let d;e[14]===Symbol.for("react.memo_cache_sentinel")?(d=w=>f(w.target.value),e[14]=d):d=e[14];let y;e[15]!==c||e[16]!==o?(y=t.jsx(ve,{value:o,onChange:d,onKeyDown:c,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=c,e[16]=o,e[17]=y):y=e[17];let _;e[18]!==o?(_=o.trim(),e[18]=o,e[19]=_):_=e[19];const N=!_;let g;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Qe,{size:16}),e[20]=g):g=e[20];let b;e[21]!==i||e[22]!==N?(b=t.jsx(X,{type:"button",variant:"outline",size:"sm",onClick:i,disabled:N,children:g}),e[21]=i,e[22]=N,e[23]=b):b=e[23];let C;e[24]!==b||e[25]!==y?(C=t.jsxs("div",{className:"flex gap-2",children:[y,b]}),e[24]=b,e[25]=y,e[26]=C):C=e[26],m=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[p,C,x.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:x.map(w=>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:w}),t.jsx("button",{type:"button",onClick:()=>a(w),className:"text-muted-foreground hover:text-foreground",children:t.jsx(Ke,{size:12})})]},w))})]}),e[6]=i,e[7]=c,e[8]=o,e[9]=a,e[10]=s,e[11]=m}else m=e[11];return m}function pt(n){const e=G.c(23),{resourceSet:s,onResourceSetChange:l,connectionResources:a}=n,[o]=k.useState(null);let f;e[0]!==a?(f=g=>(a.get(g.id)??[]).map(gt),e[0]=a,e[1]=f):f=e[1];const h=f;let i;e[2]!==l||e[3]!==s?(i=(g,b)=>{const C=s[g]??[];C.includes(b)||l({...s,[g]:[...C,b]})},e[2]=l,e[3]=s,e[4]=i):i=e[4];const r=i;let c;e[5]!==l||e[6]!==s?(c=(g,b)=>{const w=(s[g]??[]).filter(v=>v!==b);if(w.length===0){const v={...s};delete v[g],l(v)}else l({...s,[g]:w})},e[5]=l,e[6]=s,e[7]=c):c=e[7];const m=c;let x;e[8]!==l?(x=g=>{l(g)},e[8]=l,e[9]=x):x=e[9];const j=x;let p;e[10]!==s||e[11]!==o?(p=o?s[o]??[]:[],e[10]=s,e[11]=o,e[12]=p):p=e[12];const d=p;let y;e[13]!==r||e[14]!==m||e[15]!==o||e[16]!==d?(y=o?t.jsx(ht,{patterns:d,onAddPattern:g=>r(o,g),onRemovePattern:g=>m(o,g)}):null,e[13]=r,e[14]=m,e[15]=o,e[16]=d,e[17]=y):y=e[17];const _=y;let N;return e[18]!==_||e[19]!==h||e[20]!==j||e[21]!==s?(N=t.jsx("div",{className:"h-full",children:t.jsx(Ee,{itemSet:s,onItemSetChange:j,getItems:h,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:_})}),e[18]=_,e[19]=h,e[20]=j,e[21]=s,e[22]=N):N=e[22],N}function gt(n){return{id:n.uri,name:n.name||n.uri,description:n.description||n.uri}}function jt(n){const s=new TextEncoder().encode(n),l=Array.from(s,a=>String.fromCharCode(a)).join("");return btoa(l)}function bt(n){const e=G.c(52),{serverName:s,gatewayUrl:l}=n,[a,o]=k.useState(!1),[f,h]=k.useState(null),i=nt(s);let r,c,m,x;if(e[0]!==l||e[1]!==i){const q={type:"http",url:l},L={[i]:q};r=JSON.stringify(L,null,2);const oe=K=>JSON.stringify({...q,headers:{"x-mesh-client":K}},null,2),E=jt(oe("Cursor"));c=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(i)}&config=${encodeURIComponent(E)}`;const Y=oe("Claude Code");m=i;let Q;e[6]===Symbol.for("react.memo_cache_sentinel")?(Q=/'/g,e[6]=Q):Q=e[6],x=Y.replace(Q,"'\\''"),e[0]=l,e[1]=i,e[2]=r,e[3]=c,e[4]=m,e[5]=x}else r=e[2],c=e[3],m=e[4],x=e[5];const j=`claude mcp add "${m}" --config '${x}'`;let p;e[7]!==r?(p=async()=>{await navigator.clipboard.writeText(r),o(!0),Ce.success("Configuration copied to clipboard"),setTimeout(()=>o(!1),2e3)},e[7]=r,e[8]=p):p=e[8];const d=p;let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=async(q,L)=>{await navigator.clipboard.writeText(q),h(L),Ce.success(`${L} command copied`),setTimeout(()=>h(null),2e3)},e[9]=y):y=e[9];const _=y,N=yt;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 b;e[11]!==a?(b=a?t.jsx(_e,{size:14}):t.jsx(Ze,{size:14}),e[11]=a,e[12]=b):b=e[12];let C;e[13]!==d||e[14]!==b?(C=t.jsx(ae,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:d,children:b})}),e[13]=d,e[14]=b,e[15]=C):C=e[15];let w;e[16]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(de,{children:"Copy configuration"}),e[16]=w):w=e[16];let v;e[17]!==C?(v=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(ie,{children:t.jsxs(ce,{children:[C,w]})})}),e[17]=C,e[18]=v):v=e[18];let V;e[19]!==r||e[20]!==d?(V=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:d,children:r}),e[19]=r,e[20]=d,e[21]=V):V=e[21];let O;e[22]!==V||e[23]!==v?(O=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[v,V]}),e[22]=V,e[23]=v,e[24]=O):O=e[24];let D;e[25]!==c?(D=()=>N(c),e[25]=c,e[26]=D):D=e[26];let M,J;e[27]===Symbol.for("react.memo_cache_sentinel")?(M=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%)"}}),J=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=M,e[28]=J):(M=e[27],J=e[28]);let F;e[29]!==D?(F=t.jsx(ae,{asChild:!0,children:t.jsxs(X,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:D,children:[M,J]})}),e[29]=D,e[30]=F):F=e[30];let u;e[31]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(de,{children:"Add to Cursor"}),e[31]=u):u=e[31];let S;e[32]!==F?(S=t.jsx(ie,{children:t.jsxs(ce,{children:[F,u]})}),e[32]=F,e[33]=S):S=e[33];let $;e[34]!==j?($=()=>_(j,"Claude"),e[34]=j,e[35]=$):$=e[35];let R,z;e[36]===Symbol.for("react.memo_cache_sentinel")?(R=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%)"}}),z=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=R,e[37]=z):(R=e[36],z=e[37]);let A;e[38]!==f?(A=f==="Claude"&&t.jsx(_e,{size:14,className:"ml-2 text-green-500"}),e[38]=f,e[39]=A):A=e[39];let P;e[40]!==$||e[41]!==A?(P=t.jsx(ae,{asChild:!0,children:t.jsxs(X,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:$,children:[R,z,A]})}),e[40]=$,e[41]=A,e[42]=P):P=e[42];let T;e[43]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(de,{children:"Add to Claude Code"}),e[43]=T):T=e[43];let W;e[44]!==P?(W=t.jsx(ie,{children:t.jsxs(ce,{children:[P,T]})}),e[44]=P,e[45]=W):W=e[45];let U;e[46]!==S||e[47]!==W?(U=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[S,W]}),e[46]=S,e[47]=W,e[48]=U):U=e[48];let B;return e[49]!==O||e[50]!==U?(B=t.jsxs("div",{className:"flex flex-col gap-4",children:[g,O,U]}),e[49]=O,e[50]=U,e[51]=B):B=e[51],B}function yt(n){window.open(n,"_blank")}const vt=Ve({title:Se().min(1,"Name is required").max(255),description:Se().nullable(),status:je(["active","inactive"]),tool_selection_mode:je(["inclusion","exclusion"]),tool_selection_strategy:je(["passthrough","smart_tool_selection","code_execution"])});function St(n,e){const s={};for(const l of n.connections)if(l.selected_tools===null){const a=e.get(l.connection_id)??[];a.length>0&&(s[l.connection_id]=a)}else l.selected_tools.length>0&&(s[l.connection_id]=l.selected_tools);return s}function Ct(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 wt(n,e,s,l){const a=new Set([...Object.keys(n),...Object.keys(e),...Object.keys(s)]);return Array.from(a).map(o=>{const f=n[o]??[],h=l.get(o)??[],i=h.length>0&&h.every(r=>f.includes(r));return{connection_id:o,selected_tools:f.length===0||i?null:f,selected_resources:e[o]??null,selected_prompts:s[o]??null}})}function Nt(n){const e=G.c(41),{form:s,gateway:l,icon:a}=n;let o;e[0]!==s?(o=s.watch("title")||"Gateway",e[0]=s,e[1]=o):o=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(et,{}),e[2]=f):f=e[2];let h;e[3]!==a||e[4]!==o?(h=t.jsx(ye,{icon:a,name:o,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=a,e[4]=o,e[5]=h):h=e[5];let i;e[6]!==s.control?(i=t.jsx(re,{control:s.control,name:"status",render:Pt}),e[6]=s.control,e[7]=i):i=e[7];let r;e[8]!==h||e[9]!==i?(r=t.jsxs("div",{className:"flex items-start justify-between",children:[h,i]}),e[8]=h,e[9]=i,e[10]=r):r=e[10];let c;e[11]!==s.control?(c=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(re,{control:s.control,name:"title",render:$t}),t.jsx(re,{control:s.control,name:"description",render:kt})]}),e[11]=s.control,e[12]=c):c=e[12];let m;e[13]!==r||e[14]!==c?(m=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[r,c]}),e[13]=r,e[14]=c,e[15]=m):m=e[15];let x;e[16]!==s.control?(x=t.jsxs("div",{className:"flex flex-col gap-4 p-5",children:[t.jsx(re,{control:s.control,name:"tool_selection_mode",render:Tt}),t.jsx(re,{control:s.control,name:"tool_selection_strategy",render:It})]}),e[16]=s.control,e[17]=x):x=e[17];let j;e[18]!==m||e[19]!==x?(j=t.jsxs("div",{className:"flex flex-col",children:[m,x]}),e[18]=m,e[19]=x,e[20]=j):j=e[20];let p;e[21]!==s||e[22]!==j?(p=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(tt,{...s,children:j})}),e[21]=s,e[22]=j,e[23]=p):p=e[23];let d;e[24]!==l.id||e[25]!==l.title?(d=l.title||`gateway-${l.id.slice(0,8)}`,e[24]=l.id,e[25]=l.title,e[26]=d):d=e[26];const y=`${window.location.origin}/mcp/gateway/${l.id}`;let _;e[27]!==d||e[28]!==y?(_=t.jsx("div",{className:"p-5",children:t.jsx(bt,{serverName:d,gatewayUrl:y})}),e[27]=d,e[28]=y,e[29]=_):_=e[29];let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[30]=N):N=e[30];let g;e[31]!==l.updated_at?(g=l.updated_at?it(new Date(l.updated_at),{addSuffix:!1}):"Unknown",e[31]=l.updated_at,e[32]=g):g=e[32];let b;e[33]!==g?(b=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[N,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:g})]}),e[33]=g,e[34]=b):b=e[34];let C;e[35]!==_||e[36]!==b?(C=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[_,b]}),e[35]=_,e[36]=b,e[37]=C):C=e[37];let w;return e[38]!==p||e[39]!==C?(w=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[p,C]}),e[38]=p,e[39]=C,e[40]=w):w=e[40],w}function It(n){const{field:e}=n;return t.jsxs(ue,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx($e,{className:"mb-0",children:"Gateway Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ie,{children:t.jsxs(ce,{children:[t.jsx(ae,{asChild:!0,children:t.jsx("button",{type:"button",className:"cursor-help flex items-center",children:t.jsx(ke,{size:14,className:"text-muted-foreground"})})}),t.jsx(de,{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(Pe,{value:e.value,onValueChange:e.onChange,children:[t.jsx(fe,{children:t.jsx(Re,{className:"w-[180px]",children:t.jsx(ze,{})})}),t.jsxs(Ae,{children:[t.jsx(me,{value:"passthrough",children:"Passthrough"}),t.jsx(me,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(me,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(xe,{})]})}function Tt(n){const{field:e}=n;return t.jsxs(ue,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx($e,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ie,{children:t.jsxs(ce,{children:[t.jsx(ae,{asChild:!0,children:t.jsx("button",{type:"button",className:"cursor-help flex items-center",children:t.jsx(ke,{size:14,className:"text-muted-foreground"})})}),t.jsx(de,{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(Pe,{value:e.value,onValueChange:e.onChange,children:[t.jsx(fe,{children:t.jsx(Re,{className:"w-[180px]",children:t.jsx(ze,{})})}),t.jsxs(Ae,{children:[t.jsx(me,{value:"inclusion",children:"Include Selected"}),t.jsx(me,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(xe,{})]})}function kt(n){const{field:e}=n;return t.jsxs(ue,{className:"w-full space-y-0",children:[t.jsx(fe,{children:t.jsx(ve,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(xe,{})]})}function $t(n){const{field:e}=n;return t.jsxs(ue,{className:"w-full space-y-0",children:[t.jsx(fe,{children:t.jsx(ve,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Gateway Name"})}),t.jsx(xe,{})]})}function Pt(n){const{field:e}=n;return t.jsxs(ue,{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(fe,{children:t.jsx(Le,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(xe,{})]})}function Rt(n){const e=G.c(65),{gateway:s,gatewayId:l,requestedTabId:a}=n,o=Me();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/$org/gateways/$gatewayId"},e[0]=f):f=e[0];const h=we(f),i=He();let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={},e[1]=r):r=e[1];const c=Ie(r);let m;e[2]!==c?(m=c.map(At),e[2]=c,e[3]=m):m=e[3];const x=m,{promptsMap:j}=Xe(x),{resourcesMap:p}=Ye(x);let d;if(e[4]!==c){d=new Map;for(const I of c)I.tools&&I.tools.length>0&&d.set(I.id,I.tools.map(zt));e[4]=c,e[5]=d}else d=e[5];let y;e[6]!==d||e[7]!==s?(y=()=>St(s,d),e[6]=d,e[7]=s,e[8]=y):y=e[8];const[_,N]=k.useState(y);let g;e[9]!==s?(g=()=>Ct(s),e[9]=s,e[10]=g):g=e[10];const[b,C]=k.useState(g);let w;e[11]!==s?(w=()=>_t(s),e[11]=s,e[12]=w):w=e[12];const[v,V]=k.useState(w),[O,D]=k.useState(!1);let M;e[13]===Symbol.for("react.memo_cache_sentinel")?(M=I=>{N(I),D(!0)},e[13]=M):M=e[13];const J=M;let F;e[14]===Symbol.for("react.memo_cache_sentinel")?(F=I=>{C(I),D(!0)},e[14]=F):F=e[14];const u=F;let S;e[15]===Symbol.for("react.memo_cache_sentinel")?(S=I=>{V(I),D(!0)},e[15]=S):S=e[15];const $=S;let R;e[16]===Symbol.for("react.memo_cache_sentinel")?(R=Ge(vt),e[16]=R):R=e[16];const z=s.tool_selection_mode??"inclusion",A=s.tool_selection_strategy??"passthrough";let P;e[17]!==s.description||e[18]!==s.status||e[19]!==s.title||e[20]!==z||e[21]!==A?(P={resolver:R,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:z,tool_selection_strategy:A}},e[17]=s.description,e[18]=s.status,e[19]=s.title,e[20]=z,e[21]=A,e[22]=P):P=e[22];const T=Oe(P),U=T.formState.isDirty||O;let B;e[23]!==i.update||e[24]!==d||e[25]!==T||e[26]!==l||e[27]!==v||e[28]!==b||e[29]!==_?(B=async()=>{const I=T.getValues(),ge=wt(_,b,v,d);await i.update.mutateAsync({id:l,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:ge}}),T.reset(I),D(!1)},e[23]=i.update,e[24]=d,e[25]=T,e[26]=l,e[27]=v,e[28]=b,e[29]=_,e[30]=B):B=e[30];const q=B;let L;e[31]===Symbol.for("react.memo_cache_sentinel")?(L=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[31]=L):L=e[31];const oe=L,E=oe.some(I=>I.id===a)?a:"settings";let Y;e[32]!==h?(Y=I=>{h({search:ge=>({...ge,tab:I}),replace:!0})},e[32]=h,e[33]=Y):Y=e[33];const Q=Y;let K;e[34]!==o.history?(K=()=>o.history.back(),e[34]=o.history,e[35]=K):K=e[35];let Z;e[36]!==E||e[37]!==Q?(Z=t.jsx(lt,{children:t.jsx(st,{tabs:oe,activeTab:E,onTabChange:Q})}),e[36]=E,e[37]=Q,e[38]=Z):Z=e[38];let ee;e[39]!==i.update.isPending||e[40]!==q||e[41]!==U?(ee=U&&t.jsxs(X,{onClick:q,disabled:i.update.isPending,size:"sm",className:"h-7",children:[i.update.isPending&&t.jsx(be,{size:16,className:"mr-2 animate-spin"}),"Save Changes"]}),e[39]=i.update.isPending,e[40]=q,e[41]=U,e[42]=ee):ee=e[42];let te;e[43]!==ee?(te=t.jsx(ot,{children:ee}),e[43]=ee,e[44]=te):te=e[44];let he;e[45]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(be,{size:32,className:"animate-spin text-muted-foreground"})}),e[45]=he):he=e[45];let se;e[46]!==E||e[47]!==j||e[48]!==p||e[49]!==T||e[50]!==s||e[51]!==v||e[52]!==b||e[53]!==_?(se=E==="settings"?t.jsx(Nt,{form:T,gateway:s,icon:s.icon}):E==="tools"?t.jsx(Be,{toolSet:_,onToolSetChange:J}):E==="resources"?t.jsx(pt,{resourceSet:b,onResourceSetChange:u,connectionResources:p}):E==="prompts"?t.jsx(ut,{promptSet:v,onPromptSetChange:$,connectionPrompts:j}):null,e[46]=E,e[47]=j,e[48]=p,e[49]=T,e[50]=s,e[51]=v,e[52]=b,e[53]=_,e[54]=se):se=e[54];let ne;e[55]!==se?(ne=t.jsx(k.Suspense,{fallback:he,children:se}),e[55]=se,e[56]=ne):ne=e[56];let le;e[57]!==E||e[58]!==ne?(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(Ne,{children:ne},E)})}),e[57]=E,e[58]=ne,e[59]=le):le=e[59];let pe;return e[60]!==K||e[61]!==Z||e[62]!==te||e[63]!==le?(pe=t.jsxs(rt,{onBack:K,children:[Z,te,le]}),e[60]=K,e[61]=Z,e[62]=te,e[63]=le,e[64]=pe):pe=e[64],pe}function zt(n){return n.name}function At(n){return n.id}function Et(){const n=G.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=we(e);let l;n[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/gateways/$gatewayId"},n[1]=l):l=n[1];const{gatewayId:a,org:o}=De(l);let f;n[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/gateways/$gatewayId"},n[2]=f):f=n[2];const i=Fe(f).tab||"settings",r=We(a);if(!r){let m;return n[3]!==s||n[4]!==o?(m=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ue,{title:"Gateway not found",description:"This gateway may have been deleted or you may not have access.",actions:t.jsx(X,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:o}}),children:"Back to gateways"})})}),n[3]=s,n[4]=o,n[5]=m):m=n[5],m}let c;return n[6]!==r||n[7]!==a||n[8]!==i?(c=t.jsx(Rt,{gateway:r,gatewayId:a,requestedTabId:i}),n[6]=r,n[7]=a,n[8]=i,n[9]=c):c=n[9],c}function Dt(){const n=G.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ne,{children:t.jsx(k.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(be,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Et,{})})}),n[0]=e):e=n[0],e}function ms(){const n=G.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Dt,{}),n[0]=e):e=n[0],e}export{ms as default};
1
+ import{r as k,c as G,j as t,f as we,d as De,b as Fe,s as Ve,a0 as je,v as Se,av as Me,w as Ge,x as Oe,t as Ce}from"./index-CCNaUj2A.js";import{E as Ue}from"./SearchMd-C_ak4ze3.js";import{E as Ne}from"./error-boundary-DMJQCmxn.js";import{I as ve,u as Ie}from"./use-connection-BbvAiBvg.js";import{T as Be,S as Le}from"./switch-BmVnuO_C.js";import{C as Te}from"./checkbox-DTaSeum9.js";import{B as X}from"./button-DuitHSR8.js";import{i as Je}from"./ArrowLeft-b0UM4Vui.js";import{c as H}from"./utils-o1atviYh.js";import{C as qe}from"./collection-search-OoKPetka.js";import{I as ye}from"./input-YU6lpVgW.js";import{s as Qe}from"./Plus-DF_I5mml.js";import{i as Ke}from"./X-BTsWwO_U.js";import{b as We,a as He}from"./use-gateway-L1UQyU7-.js";import{u as Xe,a as Ye}from"./use-connection-resources-D-1-SK-8.js";import{a as ie,c as ce,b as ae,T as de,i as _e}from"./tooltip-CqCXb38Z.js";import{a as Ze}from"./Copy01-XN5V21c6.js";import{i as et}from"./CpuChip02-Nhk4zHXl.js";import{i as ke}from"./InfoCircle-ChxTTkMX.js";import{i as be}from"./Loading01-Dtm2TLlA.js";import{F as re,a as tt,b as ue,d as fe,f as xe,c as $e}from"./form-BfiwCHdz.js";import{S as Pe,a as Re,b as ze,c as Ae,d as me}from"./select-C4QWjnSz.js";import{R as st}from"./resource-tabs-Dx5v9tHv.js";import{s as nt}from"./slugify-CEUa2lfQ.js";import{a as lt,V as ot,b as rt}from"./layout-n40g10Oh.js";import{f as it}from"./formatDistanceToNow-BmkU67cZ.js";import"./ChevronDown-BFYjmmoG.js";import"./badge-CgUwfcKq.js";const ct=k.memo(function(e){const s=G.c(20),{connection:l,isSelected:a,hasItemsEnabled:o,activeItemsCount:f,totalItemsCount:h,onSelect:i,onToggle:r}=e,c=a?"bg-accent/50":"hover:bg-muted/50";let m;s[0]!==c?(m=H("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",c),s[0]=c,s[1]=m):m=s[1];let x;s[2]!==l.icon||s[3]!==l.title?(x=t.jsx(ve,{icon:l.icon,name:l.title,size:"xs"}),s[2]=l.icon,s[3]=l.title,s[4]=x):x=s[4];let j;s[5]!==l.title?(j=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),s[5]=l.title,s[6]=j):j=s[6];let p;s[7]!==i||s[8]!==x||s[9]!==j?(p=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:i,children:[x,j]}),s[7]=i,s[8]=x,s[9]=j,s[10]=p):p=s[10];let d;s[11]!==f||s[12]!==o||s[13]!==r||s[14]!==h?(d=h>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[f,"/",h]}),t.jsx(Te,{checked:o,onCheckedChange:r,onClick:dt})]}),s[11]=f,s[12]=o,s[13]=r,s[14]=h,s[15]=d):d=s[15];let v;return s[16]!==m||s[17]!==p||s[18]!==d?(v=t.jsxs("div",{className:m,children:[p,d]}),s[16]=m,s[17]=p,s[18]=d,s[19]=v):v=s[19],v}),at=k.memo(function(e){const s=G.c(18),{connectionId:l,item:a,isSelected:o,onToggle:f}=e,h=`item-${l}-${a.id}`,i=o?"text-foreground":"text-muted-foreground";let r;s[0]!==i?(r=H("text-sm font-medium",i),s[0]=i,s[1]=r):r=s[1];let c;s[2]!==a.name||s[3]!==r?(c=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:r,children:a.name})}),s[2]=a.name,s[3]=r,s[4]=c):c=s[4];let m;s[5]!==a.description?(m=a.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:a.description}),s[5]=a.description,s[6]=m):m=s[6];let x;s[7]!==c||s[8]!==m?(x=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,m]}),s[7]=c,s[8]=m,s[9]=x):x=s[9];const j=`item-${l}-${a.id}`;let p;s[10]!==o||s[11]!==f||s[12]!==j?(p=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Te,{id:j,checked:o,onCheckedChange:f,onClick:mt})}),s[10]=o,s[11]=f,s[12]=j,s[13]=p):p=s[13];let d;return s[14]!==h||s[15]!==x||s[16]!==p?(d=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:h,children:[x,p]}),s[14]=h,s[15]=x,s[16]=p,s[17]=d):d=s[17],d});function Ee({itemSet:n,onItemSetChange:e,getItems:s,itemLabel:l,emptyItemsMessage:a,extraContent:o}){const[f,h]=k.useState(""),i=k.useDeferredValue(f),[r,c]=k.useState("all"),[m,x]=k.useState(!1),j=k.useRef(new Set(Object.keys(n))),p=Ie({searchTerm:i.trim()||void 0}),d=j.current,v=[...d.values()].map(u=>p.find(S=>S.id===u)).filter(u=>u!==void 0),_=p.filter(u=>!d.has(u.id)),N=[...v,..._],g=u=>{const S=n[u];return S!==void 0&&S.length>0},b=N.filter(u=>{if(r==="all")return!0;const S=g(u.id);return r==="selected"?S:r==="unselected"?!S:!0}),[C,w]=k.useState(N[0]?.id??null),y=C?N.find(u=>u.id===C)??null:null,V=y?s(y):[],O=(u,S)=>n[u]?.includes(S)??!1,D=(u,S)=>{const $=n[u]??[],R=$.includes(S),z={...n};if(R){const A=$.filter(P=>P!==S);A.length===0?delete z[u]:z[u]=A}else z[u]=[...$,S];e(z)},M=u=>{const S=N.find(T=>T.id===u);if(!S)return;const $=s(S);if($.length===0)return;const R=n[u]??[],z=$.map(T=>T.id),A=R.length>0&&z.every(T=>R.includes(T)),P={...n};A?delete P[u]:(P[u]=z,w(u)),e(P)},J=u=>{w(u),x(!0)},F=()=>{x(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:H("w-full md:w-80 border-r border-border flex flex-col",m&&"hidden md:flex"),children:[t.jsx(qe,{value:f,onChange:h,placeholder:"Search MCP Servers..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>c("all"),className:H("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:()=>c("selected"),className:H("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:()=>c("unselected"),className:H("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:b.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:b.map(u=>{const $=s(u).length,R=n[u.id]?.length??0;return t.jsx(ct,{connection:u,isSelected:C===u.id,hasItemsEnabled:g(u.id),activeItemsCount:R,totalItemsCount:$,onSelect:()=>J(u.id),onToggle:()=>M(u.id)},u.id)})})})]}),t.jsx("div",{className:H("flex-1 flex-col",m?"flex":"hidden md:flex"),children:y?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(X,{variant:"ghost",size:"sm",onClick:F,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(Je,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(ve,{icon:y.icon,name:y.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:y.title}),y.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:y.description})]})]})]}),o,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:V.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:a||`This connection has no ${l} available`}):t.jsx("div",{className:"space-y-2",children:V.map(u=>t.jsx(at,{connectionId:y.id,item:u,isSelected:O(y.id,u.id),onToggle:()=>D(y.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 ",l]})})})]})}function dt(n){return n.stopPropagation()}function mt(n){return n.stopPropagation()}function ut(n){const e=G.c(6),{promptSet:s,onPromptSetChange:l,connectionPrompts:a}=n;let o;e[0]!==a?(o=i=>(a.get(i.id)??[]).map(ft),e[0]=a,e[1]=o):o=e[1];const f=o;let h;return e[2]!==f||e[3]!==l||e[4]!==s?(h=t.jsx(Ee,{itemSet:s,onItemSetChange:l,getItems:f,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=f,e[3]=l,e[4]=s,e[5]=h):h=e[5],h}function ft(n){return{id:n.name,name:n.name,description:n.description}}function xt(n){return n.includes("*")}function ht(n){const e=G.c(27),{patterns:s,onAddPattern:l,onRemovePattern:a}=n,[o,f]=k.useState("");let h;e[0]!==o||e[1]!==l||e[2]!==s?(h=()=>{const x=o.trim();x&&!s.includes(x)&&(l(x),f(""))},e[0]=o,e[1]=l,e[2]=s,e[3]=h):h=e[3];const i=h;let r;e[4]!==i?(r=x=>{x.key==="Enter"&&(x.preventDefault(),i())},e[4]=i,e[5]=r):r=e[5];const c=r;let m;if(e[6]!==i||e[7]!==c||e[8]!==o||e[9]!==a||e[10]!==s){const x=s.filter(xt);let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("code",{children:"*"}),e[12]=j):j=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=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]=p):p=e[13];let d;e[14]===Symbol.for("react.memo_cache_sentinel")?(d=w=>f(w.target.value),e[14]=d):d=e[14];let v;e[15]!==c||e[16]!==o?(v=t.jsx(ye,{value:o,onChange:d,onKeyDown:c,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=c,e[16]=o,e[17]=v):v=e[17];let _;e[18]!==o?(_=o.trim(),e[18]=o,e[19]=_):_=e[19];const N=!_;let g;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Qe,{size:16}),e[20]=g):g=e[20];let b;e[21]!==i||e[22]!==N?(b=t.jsx(X,{type:"button",variant:"outline",size:"sm",onClick:i,disabled:N,children:g}),e[21]=i,e[22]=N,e[23]=b):b=e[23];let C;e[24]!==b||e[25]!==v?(C=t.jsxs("div",{className:"flex gap-2",children:[v,b]}),e[24]=b,e[25]=v,e[26]=C):C=e[26],m=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[p,C,x.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:x.map(w=>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:w}),t.jsx("button",{type:"button",onClick:()=>a(w),className:"text-muted-foreground hover:text-foreground",children:t.jsx(Ke,{size:12})})]},w))})]}),e[6]=i,e[7]=c,e[8]=o,e[9]=a,e[10]=s,e[11]=m}else m=e[11];return m}function pt(n){const e=G.c(23),{resourceSet:s,onResourceSetChange:l,connectionResources:a}=n,[o]=k.useState(null);let f;e[0]!==a?(f=g=>(a.get(g.id)??[]).map(gt),e[0]=a,e[1]=f):f=e[1];const h=f;let i;e[2]!==l||e[3]!==s?(i=(g,b)=>{const C=s[g]??[];C.includes(b)||l({...s,[g]:[...C,b]})},e[2]=l,e[3]=s,e[4]=i):i=e[4];const r=i;let c;e[5]!==l||e[6]!==s?(c=(g,b)=>{const w=(s[g]??[]).filter(y=>y!==b);if(w.length===0){const y={...s};delete y[g],l(y)}else l({...s,[g]:w})},e[5]=l,e[6]=s,e[7]=c):c=e[7];const m=c;let x;e[8]!==l?(x=g=>{l(g)},e[8]=l,e[9]=x):x=e[9];const j=x;let p;e[10]!==s||e[11]!==o?(p=o?s[o]??[]:[],e[10]=s,e[11]=o,e[12]=p):p=e[12];const d=p;let v;e[13]!==r||e[14]!==m||e[15]!==o||e[16]!==d?(v=o?t.jsx(ht,{patterns:d,onAddPattern:g=>r(o,g),onRemovePattern:g=>m(o,g)}):null,e[13]=r,e[14]=m,e[15]=o,e[16]=d,e[17]=v):v=e[17];const _=v;let N;return e[18]!==_||e[19]!==h||e[20]!==j||e[21]!==s?(N=t.jsx("div",{className:"h-full",children:t.jsx(Ee,{itemSet:s,onItemSetChange:j,getItems:h,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:_})}),e[18]=_,e[19]=h,e[20]=j,e[21]=s,e[22]=N):N=e[22],N}function gt(n){return{id:n.uri,name:n.name||n.uri,description:n.description||n.uri}}function jt(n){const s=new TextEncoder().encode(n),l=Array.from(s,a=>String.fromCharCode(a)).join("");return btoa(l)}function bt(n){const e=G.c(52),{serverName:s,gatewayUrl:l}=n,[a,o]=k.useState(!1),[f,h]=k.useState(null),i=nt(s);let r,c,m,x;if(e[0]!==l||e[1]!==i){const q={type:"http",url:l},L={[i]:q};r=JSON.stringify(L,null,2);const oe=K=>JSON.stringify({...q,headers:{"x-mesh-client":K}},null,2),E=jt(oe("Cursor"));c=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(i)}&config=${encodeURIComponent(E)}`;const Y=oe("Claude Code");m=i;let Q;e[6]===Symbol.for("react.memo_cache_sentinel")?(Q=/'/g,e[6]=Q):Q=e[6],x=Y.replace(Q,"'\\''"),e[0]=l,e[1]=i,e[2]=r,e[3]=c,e[4]=m,e[5]=x}else r=e[2],c=e[3],m=e[4],x=e[5];const j=`claude mcp add "${m}" --config '${x}'`;let p;e[7]!==r?(p=async()=>{await navigator.clipboard.writeText(r),o(!0),Ce.success("Configuration copied to clipboard"),setTimeout(()=>o(!1),2e3)},e[7]=r,e[8]=p):p=e[8];const d=p;let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=async(q,L)=>{await navigator.clipboard.writeText(q),h(L),Ce.success(`${L} command copied`),setTimeout(()=>h(null),2e3)},e[9]=v):v=e[9];const _=v,N=vt;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 b;e[11]!==a?(b=a?t.jsx(_e,{size:14}):t.jsx(Ze,{size:14}),e[11]=a,e[12]=b):b=e[12];let C;e[13]!==d||e[14]!==b?(C=t.jsx(ae,{asChild:!0,children:t.jsx(X,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:d,children:b})}),e[13]=d,e[14]=b,e[15]=C):C=e[15];let w;e[16]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(de,{children:"Copy configuration"}),e[16]=w):w=e[16];let y;e[17]!==C?(y=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(ie,{children:t.jsxs(ce,{children:[C,w]})})}),e[17]=C,e[18]=y):y=e[18];let V;e[19]!==r||e[20]!==d?(V=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:d,children:r}),e[19]=r,e[20]=d,e[21]=V):V=e[21];let O;e[22]!==V||e[23]!==y?(O=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[y,V]}),e[22]=V,e[23]=y,e[24]=O):O=e[24];let D;e[25]!==c?(D=()=>N(c),e[25]=c,e[26]=D):D=e[26];let M,J;e[27]===Symbol.for("react.memo_cache_sentinel")?(M=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%)"}}),J=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=M,e[28]=J):(M=e[27],J=e[28]);let F;e[29]!==D?(F=t.jsx(ae,{asChild:!0,children:t.jsxs(X,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:D,children:[M,J]})}),e[29]=D,e[30]=F):F=e[30];let u;e[31]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(de,{children:"Add to Cursor"}),e[31]=u):u=e[31];let S;e[32]!==F?(S=t.jsx(ie,{children:t.jsxs(ce,{children:[F,u]})}),e[32]=F,e[33]=S):S=e[33];let $;e[34]!==j?($=()=>_(j,"Claude"),e[34]=j,e[35]=$):$=e[35];let R,z;e[36]===Symbol.for("react.memo_cache_sentinel")?(R=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%)"}}),z=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=R,e[37]=z):(R=e[36],z=e[37]);let A;e[38]!==f?(A=f==="Claude"&&t.jsx(_e,{size:14,className:"ml-2 text-green-500"}),e[38]=f,e[39]=A):A=e[39];let P;e[40]!==$||e[41]!==A?(P=t.jsx(ae,{asChild:!0,children:t.jsxs(X,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:$,children:[R,z,A]})}),e[40]=$,e[41]=A,e[42]=P):P=e[42];let T;e[43]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(de,{children:"Add to Claude Code"}),e[43]=T):T=e[43];let W;e[44]!==P?(W=t.jsx(ie,{children:t.jsxs(ce,{children:[P,T]})}),e[44]=P,e[45]=W):W=e[45];let U;e[46]!==S||e[47]!==W?(U=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[S,W]}),e[46]=S,e[47]=W,e[48]=U):U=e[48];let B;return e[49]!==O||e[50]!==U?(B=t.jsxs("div",{className:"flex flex-col gap-4",children:[g,O,U]}),e[49]=O,e[50]=U,e[51]=B):B=e[51],B}function vt(n){window.open(n,"_blank")}const yt=Ve({title:Se().min(1,"Name is required").max(255),description:Se().nullable(),status:je(["active","inactive"]),tool_selection_mode:je(["inclusion","exclusion"]),tool_selection_strategy:je(["passthrough","smart_tool_selection","code_execution"])});function St(n,e){const s={};for(const l of n.connections)if(l.selected_tools===null){const a=e.get(l.connection_id)??[];a.length>0&&(s[l.connection_id]=a)}else l.selected_tools.length>0&&(s[l.connection_id]=l.selected_tools);return s}function Ct(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 wt(n,e,s,l){const a=new Set([...Object.keys(n),...Object.keys(e),...Object.keys(s)]);return Array.from(a).map(o=>{const f=n[o]??[],h=l.get(o)??[],i=h.length>0&&h.every(r=>f.includes(r));return{connection_id:o,selected_tools:f.length===0||i?null:f,selected_resources:e[o]??null,selected_prompts:s[o]??null}})}function Nt(n){const e=G.c(41),{form:s,gateway:l,icon:a}=n;let o;e[0]!==s?(o=s.watch("title")||"Gateway",e[0]=s,e[1]=o):o=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(et,{}),e[2]=f):f=e[2];let h;e[3]!==a||e[4]!==o?(h=t.jsx(ve,{icon:a,name:o,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=a,e[4]=o,e[5]=h):h=e[5];let i;e[6]!==s.control?(i=t.jsx(re,{control:s.control,name:"status",render:Pt}),e[6]=s.control,e[7]=i):i=e[7];let r;e[8]!==h||e[9]!==i?(r=t.jsxs("div",{className:"flex items-start justify-between",children:[h,i]}),e[8]=h,e[9]=i,e[10]=r):r=e[10];let c;e[11]!==s.control?(c=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(re,{control:s.control,name:"title",render:$t}),t.jsx(re,{control:s.control,name:"description",render:kt})]}),e[11]=s.control,e[12]=c):c=e[12];let m;e[13]!==r||e[14]!==c?(m=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[r,c]}),e[13]=r,e[14]=c,e[15]=m):m=e[15];let x;e[16]!==s.control?(x=t.jsxs("div",{className:"flex flex-col gap-4 p-5",children:[t.jsx(re,{control:s.control,name:"tool_selection_mode",render:Tt}),t.jsx(re,{control:s.control,name:"tool_selection_strategy",render:It})]}),e[16]=s.control,e[17]=x):x=e[17];let j;e[18]!==m||e[19]!==x?(j=t.jsxs("div",{className:"flex flex-col",children:[m,x]}),e[18]=m,e[19]=x,e[20]=j):j=e[20];let p;e[21]!==s||e[22]!==j?(p=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(tt,{...s,children:j})}),e[21]=s,e[22]=j,e[23]=p):p=e[23];let d;e[24]!==l.id||e[25]!==l.title?(d=l.title||`gateway-${l.id.slice(0,8)}`,e[24]=l.id,e[25]=l.title,e[26]=d):d=e[26];const v=`${window.location.origin}/mcp/gateway/${l.id}`;let _;e[27]!==d||e[28]!==v?(_=t.jsx("div",{className:"p-5",children:t.jsx(bt,{serverName:d,gatewayUrl:v})}),e[27]=d,e[28]=v,e[29]=_):_=e[29];let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[30]=N):N=e[30];let g;e[31]!==l.updated_at?(g=l.updated_at?it(new Date(l.updated_at),{addSuffix:!1}):"Unknown",e[31]=l.updated_at,e[32]=g):g=e[32];let b;e[33]!==g?(b=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[N,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:g})]}),e[33]=g,e[34]=b):b=e[34];let C;e[35]!==_||e[36]!==b?(C=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[_,b]}),e[35]=_,e[36]=b,e[37]=C):C=e[37];let w;return e[38]!==p||e[39]!==C?(w=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[p,C]}),e[38]=p,e[39]=C,e[40]=w):w=e[40],w}function It(n){const{field:e}=n;return t.jsxs(ue,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx($e,{className:"mb-0",children:"Gateway Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ie,{children:t.jsxs(ce,{children:[t.jsx(ae,{asChild:!0,children:t.jsx("button",{type:"button",className:"cursor-help flex items-center",children:t.jsx(ke,{size:14,className:"text-muted-foreground"})})}),t.jsx(de,{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(Pe,{value:e.value,onValueChange:e.onChange,children:[t.jsx(fe,{children:t.jsx(Re,{className:"w-[180px]",children:t.jsx(ze,{})})}),t.jsxs(Ae,{children:[t.jsx(me,{value:"passthrough",children:"Passthrough"}),t.jsx(me,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(me,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(xe,{})]})}function Tt(n){const{field:e}=n;return t.jsxs(ue,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx($e,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ie,{children:t.jsxs(ce,{children:[t.jsx(ae,{asChild:!0,children:t.jsx("button",{type:"button",className:"cursor-help flex items-center",children:t.jsx(ke,{size:14,className:"text-muted-foreground"})})}),t.jsx(de,{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(Pe,{value:e.value,onValueChange:e.onChange,children:[t.jsx(fe,{children:t.jsx(Re,{className:"w-[180px]",children:t.jsx(ze,{})})}),t.jsxs(Ae,{children:[t.jsx(me,{value:"inclusion",children:"Include Selected"}),t.jsx(me,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(xe,{})]})}function kt(n){const{field:e}=n;return t.jsxs(ue,{className:"w-full space-y-0",children:[t.jsx(fe,{children:t.jsx(ye,{...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(xe,{})]})}function $t(n){const{field:e}=n;return t.jsxs(ue,{className:"w-full space-y-0",children:[t.jsx(fe,{children:t.jsx(ye,{...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(xe,{})]})}function Pt(n){const{field:e}=n;return t.jsxs(ue,{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(fe,{children:t.jsx(Le,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(xe,{})]})}function Rt(n){const e=G.c(65),{gateway:s,gatewayId:l,requestedTabId:a}=n,o=Me();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/$org/gateways/$gatewayId"},e[0]=f):f=e[0];const h=we(f),i=He();let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={},e[1]=r):r=e[1];const c=Ie(r);let m;e[2]!==c?(m=c.map(At),e[2]=c,e[3]=m):m=e[3];const x=m,{promptsMap:j}=Xe(x),{resourcesMap:p}=Ye(x);let d;if(e[4]!==c){d=new Map;for(const I of c)I.tools&&I.tools.length>0&&d.set(I.id,I.tools.map(zt));e[4]=c,e[5]=d}else d=e[5];let v;e[6]!==d||e[7]!==s?(v=()=>St(s,d),e[6]=d,e[7]=s,e[8]=v):v=e[8];const[_,N]=k.useState(v);let g;e[9]!==s?(g=()=>Ct(s),e[9]=s,e[10]=g):g=e[10];const[b,C]=k.useState(g);let w;e[11]!==s?(w=()=>_t(s),e[11]=s,e[12]=w):w=e[12];const[y,V]=k.useState(w),[O,D]=k.useState(!1);let M;e[13]===Symbol.for("react.memo_cache_sentinel")?(M=I=>{N(I),D(!0)},e[13]=M):M=e[13];const J=M;let F;e[14]===Symbol.for("react.memo_cache_sentinel")?(F=I=>{C(I),D(!0)},e[14]=F):F=e[14];const u=F;let S;e[15]===Symbol.for("react.memo_cache_sentinel")?(S=I=>{V(I),D(!0)},e[15]=S):S=e[15];const $=S;let R;e[16]===Symbol.for("react.memo_cache_sentinel")?(R=Ge(yt),e[16]=R):R=e[16];const z=s.tool_selection_mode??"inclusion",A=s.tool_selection_strategy??"passthrough";let P;e[17]!==s.description||e[18]!==s.status||e[19]!==s.title||e[20]!==z||e[21]!==A?(P={resolver:R,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:z,tool_selection_strategy:A}},e[17]=s.description,e[18]=s.status,e[19]=s.title,e[20]=z,e[21]=A,e[22]=P):P=e[22];const T=Oe(P),U=T.formState.isDirty||O;let B;e[23]!==i.update||e[24]!==d||e[25]!==T||e[26]!==l||e[27]!==y||e[28]!==b||e[29]!==_?(B=async()=>{const I=T.getValues(),ge=wt(_,b,y,d);await i.update.mutateAsync({id:l,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:ge}}),T.reset(I),D(!1)},e[23]=i.update,e[24]=d,e[25]=T,e[26]=l,e[27]=y,e[28]=b,e[29]=_,e[30]=B):B=e[30];const q=B;let L;e[31]===Symbol.for("react.memo_cache_sentinel")?(L=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[31]=L):L=e[31];const oe=L,E=oe.some(I=>I.id===a)?a:"settings";let Y;e[32]!==h?(Y=I=>{h({search:ge=>({...ge,tab:I}),replace:!0})},e[32]=h,e[33]=Y):Y=e[33];const Q=Y;let K;e[34]!==o.history?(K=()=>o.history.back(),e[34]=o.history,e[35]=K):K=e[35];let Z;e[36]!==E||e[37]!==Q?(Z=t.jsx(lt,{children:t.jsx(st,{tabs:oe,activeTab:E,onTabChange:Q})}),e[36]=E,e[37]=Q,e[38]=Z):Z=e[38];let ee;e[39]!==i.update.isPending||e[40]!==q||e[41]!==U?(ee=U&&t.jsxs(X,{onClick:q,disabled:i.update.isPending,size:"sm",className:"h-7",children:[i.update.isPending&&t.jsx(be,{size:16,className:"mr-2 animate-spin"}),"Save Changes"]}),e[39]=i.update.isPending,e[40]=q,e[41]=U,e[42]=ee):ee=e[42];let te;e[43]!==ee?(te=t.jsx(ot,{children:ee}),e[43]=ee,e[44]=te):te=e[44];let he;e[45]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(be,{size:32,className:"animate-spin text-muted-foreground"})}),e[45]=he):he=e[45];let se;e[46]!==E||e[47]!==j||e[48]!==p||e[49]!==T||e[50]!==s||e[51]!==y||e[52]!==b||e[53]!==_?(se=E==="settings"?t.jsx(Nt,{form:T,gateway:s,icon:s.icon}):E==="tools"?t.jsx(Be,{toolSet:_,onToolSetChange:J}):E==="resources"?t.jsx(pt,{resourceSet:b,onResourceSetChange:u,connectionResources:p}):E==="prompts"?t.jsx(ut,{promptSet:y,onPromptSetChange:$,connectionPrompts:j}):null,e[46]=E,e[47]=j,e[48]=p,e[49]=T,e[50]=s,e[51]=y,e[52]=b,e[53]=_,e[54]=se):se=e[54];let ne;e[55]!==se?(ne=t.jsx(k.Suspense,{fallback:he,children:se}),e[55]=se,e[56]=ne):ne=e[56];let le;e[57]!==E||e[58]!==ne?(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(Ne,{children:ne},E)})}),e[57]=E,e[58]=ne,e[59]=le):le=e[59];let pe;return e[60]!==K||e[61]!==Z||e[62]!==te||e[63]!==le?(pe=t.jsxs(rt,{onBack:K,children:[Z,te,le]}),e[60]=K,e[61]=Z,e[62]=te,e[63]=le,e[64]=pe):pe=e[64],pe}function zt(n){return n.name}function At(n){return n.id}function Et(){const n=G.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=we(e);let l;n[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/gateways/$gatewayId"},n[1]=l):l=n[1];const{gatewayId:a,org:o}=De(l);let f;n[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/gateways/$gatewayId"},n[2]=f):f=n[2];const i=Fe(f).tab||"settings",r=We(a);if(!r){let m;return n[3]!==s||n[4]!==o?(m=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ue,{title:"Gateway not found",description:"This gateway may have been deleted or you may not have access.",actions:t.jsx(X,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:o}}),children:"Back to gateways"})})}),n[3]=s,n[4]=o,n[5]=m):m=n[5],m}let c;return n[6]!==r||n[7]!==a||n[8]!==i?(c=t.jsx(Rt,{gateway:r,gatewayId:a,requestedTabId:i}),n[6]=r,n[7]=a,n[8]=i,n[9]=c):c=n[9],c}function Dt(){const n=G.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ne,{children:t.jsx(k.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(be,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Et,{})})}),n[0]=e):e=n[0],e}function ms(){const n=G.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Dt,{}),n[0]=e):e=n[0],e}export{ms as default};
@@ -1 +1 @@
1
- import{c as te,j as t,r as se,f as ae,t as re}from"./index-BlDToaIG.js";import{C as ie}from"./collection-header-D42ZoG-6.js";import{C as ne}from"./collection-page-DYsl4ZS6.js";import{C as le}from"./collection-search-BQ-WB0Rj.js";import{C as ce}from"./collection-table-wrapper-Cbxid7c7.js";import{C as de}from"./connection-card-c58EGX4x.js";import{E as q}from"./SearchMd-CuszgCqb.js";import{E as me}from"./error-boundary-DjqBPLyv.js";import{u as ue,I as ge}from"./use-connection-DQ204Coq.js";import{a as pe,u as he}from"./use-gateway-B2ZAQHo8.js";import{u as fe,s as Q}from"./use-list-state-DDpMfXlk.js";import{u as xe}from"./tooltip-DQ1jCLZj.js";import{c as ye,b as we,d as je,A as Ce,e as Ne,g as De,a as Se,f as ve}from"./alert-dialog-otNJ1cnE.js";import{B as oe}from"./badge-DXjKunmL.js";import{B as J}from"./button-DP3Fjd19.js";import{b as U,D as X,a as Y,d as B}from"./dropdown-menu-CjKpHxz2.js";import{i as y}from"./CpuChip02-eOcghqj5.js";import{i as Z}from"./DotsVertical-CZAuxCS9.js";import{i as be}from"./Loading01-CpOGYhvb.js";import{s as ee}from"./Trash01-avMTxTy7.js";import"./collection-display-button-CM6lJjaN.js";import"./view-mode-toggle-D84JG7fQ.js";import"./utils-3t85Hz8W.js";import"./input-v6ODzgkG.js";import"./card-DKgSSyjo.js";import"./use-mobile-DLMOdcji.js";function ke(e,a){switch(a.type){case"delete":return{mode:"deleting",gateway:a.gateway};case"close":return{mode:"idle"}}}function _e(){const e=te.c(68),{org:a}=xe(),r=ae();let w;e[0]!==a.slug?(w={namespace:a.slug,resource:"gateways"},e[0]=a.slug,e[1]=w):w=e[1];const s=fe(w),i=pe(),x=he(s);let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j={},e[2]=j):j=e[2];const R=ue(j);let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={mode:"idle"},e[3]=C):C=e[3];const[n,N]=se.useReducer(ke,C);let D;e[4]!==i.create||e[5]!==R.length||e[6]!==r||e[7]!==a.slug?(D=async()=>{if(R.length===0){re.error("Create at least one MCP connection first");return}const o=await i.create.mutateAsync({title:"New Gateway",description:"Gateways let you securely expose integrated tools to the outside world.",status:"active",tool_selection_strategy:"passthrough",tool_selection_mode:"inclusion",connections:[]});r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},e[4]=i.create,e[5]=R.length,e[6]=r,e[7]=a.slug,e[8]=D):D=e[8];const T=D;let S;e[9]!==i.delete||e[10]!==n.gateway||e[11]!==n.mode?(S=async()=>{if(n.mode!=="deleting")return;const o=n.gateway.id;N({type:"close"});try{await i.delete.mutateAsync(o)}catch{}},e[9]=i.delete,e[10]=n.gateway,e[11]=n.mode,e[12]=S):S=e[12];const O=S;let v,b,k,_,M,I;e[13]===Symbol.for("react.memo_cache_sentinel")?(b={id:"icon",header:"",render:Be,cellClassName:"w-16 shrink-0",wrap:!0},k={id:"title",header:"Name",render:Ke,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},_={id:"description",header:"Description",render:Ge,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},M={id:"mode",header:"Mode",accessor:Ee,cellClassName:"w-[100px]"},I={id:"connections",header:"Connections",render:Ae,cellClassName:"w-24 shrink-0"},v={id:"status",header:"Status",render:ze,cellClassName:"w-24 shrink-0",sortable:!0},e[13]=v,e[14]=b,e[15]=k,e[16]=_,e[17]=M,e[18]=I):(v=e[13],b=e[14],k=e[15],_=e[16],M=e[17],I=e[18]);let P;e[19]!==r||e[20]!==a.slug?(P=[b,k,_,M,I,v,{id:"actions",header:"",render:o=>t.jsxs(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:$e,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Pe,children:[t.jsxs(B,{onClick:l=>{l.stopPropagation(),r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:l=>{l.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[19]=r,e[20]=a.slug,e[21]=P):P=e[21];const V=P,H=i.create.isPending?"Creating...":"Create MCP Gateway";let $;e[22]!==i.create.isPending||e[23]!==T||e[24]!==H?($=t.jsx(J,{onClick:T,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i.create.isPending,children:H}),e[22]=i.create.isPending,e[23]=T,e[24]=H,e[25]=$):$=e[25];const L=$,F=n.mode==="deleting";let z;e[26]===Symbol.for("react.memo_cache_sentinel")?(z=o=>!o&&N({type:"close"}),e[26]=z):z=e[26];let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ye,{children:"Delete Gateway?"}),e[27]=A):A=e[27];const W=n.mode==="deleting"&&n.gateway.title;let c;e[28]!==W?(c=t.jsxs(we,{children:[A,t.jsxs(je,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),e[28]=W,e[29]=c):c=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Ce,{children:"Cancel"}),e[30]=E):E=e[30];let d;e[31]!==O?(d=t.jsxs(Ne,{children:[E,t.jsx(De,{onClick:O,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[31]=O,e[32]=d):d=e[32];let m;e[33]!==c||e[34]!==d?(m=t.jsxs(Se,{children:[c,d]}),e[33]=c,e[34]=d,e[35]=m):m=e[35];let u;e[36]!==F||e[37]!==m?(u=t.jsx(ve,{open:F,onOpenChange:z,children:m}),e[36]=F,e[37]=m,e[38]=u):u=e[38];let G;e[39]===Symbol.for("react.memo_cache_sentinel")?(G=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[39]=G):G=e[39];let g;e[40]!==L||e[41]!==s.handleSort||e[42]!==s.setViewMode||e[43]!==s.sortDirection||e[44]!==s.sortKey||e[45]!==s.viewMode?(g=t.jsx(ie,{title:"MCP Gateways",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:G,ctaButton:L}),e[40]=L,e[41]=s.handleSort,e[42]=s.setViewMode,e[43]=s.sortDirection,e[44]=s.sortKey,e[45]=s.viewMode,e[46]=g):g=e[46];let p;e[47]!==s?(p=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[47]=s,e[48]=p):p=e[48];let h;e[49]!==s.search||e[50]!==s.setSearch||e[51]!==p?(h=t.jsx(le,{value:s.search,onChange:s.setSearch,placeholder:"Search for a gateway...",onKeyDown:p}),e[49]=s.search,e[50]=s.setSearch,e[51]=p,e[52]=h):h=e[52];let f;e[53]!==V||e[54]!==x||e[55]!==s.handleSort||e[56]!==s.search||e[57]!==s.sortDirection||e[58]!==s.sortKey||e[59]!==s.viewMode||e[60]!==r||e[61]!==a.slug?(f=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:x.length===0?t.jsx(q,{image:t.jsx(y,{size:36,className:"text-muted-foreground"}),title:s.search?"No gateways found":"No gateways yet",description:s.search?`No gateways match "${s.search}"`:"Create a gateway to aggregate tools from multiple MCP connections."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:x.map(o=>t.jsx(de,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(y,{}),onClick:()=>r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}}),footer:t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]}),t.jsx("span",{children:"•"}),t.jsx("span",{children:o.tool_selection_mode==="exclusion"?"Exclude":"Include"})]}),headerActions:t.jsxs(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ie,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Me,children:[t.jsxs(B,{onClick:l=>{l.stopPropagation(),r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:l=>{l.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(ce,{columns:V,data:x,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(q,{image:t.jsx(y,{size:36,className:"text-muted-foreground"}),title:"No gateways found",description:`No gateways match "${s.search}"`}):t.jsx(q,{image:t.jsx(y,{size:36,className:"text-muted-foreground"}),title:"No gateways yet",description:"Create a gateway to aggregate tools from multiple MCP connections."})}),e[53]=V,e[54]=x,e[55]=s.handleSort,e[56]=s.search,e[57]=s.sortDirection,e[58]=s.sortKey,e[59]=s.viewMode,e[60]=r,e[61]=a.slug,e[62]=f):f=e[62];let K;return e[63]!==u||e[64]!==g||e[65]!==h||e[66]!==f?(K=t.jsxs(ne,{children:[u,g,h,f]}),e[63]=u,e[64]=g,e[65]=h,e[66]=f,e[67]=K):K=e[67],K}function Me(e){return e.stopPropagation()}function Ie(e){return e.stopPropagation()}function Pe(e){return e.stopPropagation()}function $e(e){return e.stopPropagation()}function ze(e){return t.jsx(oe,{variant:e.status==="active"?"default":"outline",children:e.status})}function Ae(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function Ee(e){return t.jsx(oe,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function Ge(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Ke(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Be(e){return t.jsx(ge,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(y,{size:16})})}function mt(){const e=te.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(me,{children:t.jsx(se.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(be,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(_e,{})})}),e[0]=a):a=e[0],a}export{mt as default};
1
+ import{c as te,j as t,r as se,f as ae,t as re}from"./index-CCNaUj2A.js";import{C as ie}from"./collection-header-D-wXFMG4.js";import{C as ne}from"./collection-page-AFIAghtr.js";import{C as le}from"./collection-search-OoKPetka.js";import{C as ce}from"./collection-table-wrapper-DEVlTpj8.js";import{C as de}from"./connection-card-CVX6Dj6b.js";import{E as q}from"./SearchMd-C_ak4ze3.js";import{E as me}from"./error-boundary-DMJQCmxn.js";import{u as ue,I as ge}from"./use-connection-BbvAiBvg.js";import{a as pe,u as he}from"./use-gateway-L1UQyU7-.js";import{u as fe,s as Q}from"./use-list-state-DVYCFUpb.js";import{u as xe}from"./tooltip-CqCXb38Z.js";import{c as ye,b as we,d as je,A as Ce,e as Ne,g as De,a as Se,f as ve}from"./alert-dialog-DhxQ40TA.js";import{B as oe}from"./badge-CgUwfcKq.js";import{B as J}from"./button-DuitHSR8.js";import{b as U,D as X,a as Y,d as B}from"./dropdown-menu-CPQpNQmn.js";import{i as y}from"./CpuChip02-Nhk4zHXl.js";import{i as Z}from"./DotsVertical-CcNQsTaW.js";import{i as be}from"./Loading01-Dtm2TLlA.js";import{s as ee}from"./Trash01-FYPMjpVf.js";import"./collection-display-button-DgDdVSTg.js";import"./view-mode-toggle-DOtHoBLN.js";import"./utils-o1atviYh.js";import"./input-YU6lpVgW.js";import"./card-DkEpNms8.js";import"./use-mobile-B0xRFGhT.js";function ke(e,a){switch(a.type){case"delete":return{mode:"deleting",gateway:a.gateway};case"close":return{mode:"idle"}}}function _e(){const e=te.c(68),{org:a}=xe(),r=ae();let w;e[0]!==a.slug?(w={namespace:a.slug,resource:"gateways"},e[0]=a.slug,e[1]=w):w=e[1];const s=fe(w),i=pe(),x=he(s);let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j={},e[2]=j):j=e[2];const R=ue(j);let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={mode:"idle"},e[3]=C):C=e[3];const[n,N]=se.useReducer(ke,C);let D;e[4]!==i.create||e[5]!==R.length||e[6]!==r||e[7]!==a.slug?(D=async()=>{if(R.length===0){re.error("Create at least one MCP connection first");return}const o=await i.create.mutateAsync({title:"New Gateway",description:"Gateways let you securely expose integrated tools to the outside world.",status:"active",tool_selection_strategy:"passthrough",tool_selection_mode:"inclusion",connections:[]});r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},e[4]=i.create,e[5]=R.length,e[6]=r,e[7]=a.slug,e[8]=D):D=e[8];const T=D;let S;e[9]!==i.delete||e[10]!==n.gateway||e[11]!==n.mode?(S=async()=>{if(n.mode!=="deleting")return;const o=n.gateway.id;N({type:"close"});try{await i.delete.mutateAsync(o)}catch{}},e[9]=i.delete,e[10]=n.gateway,e[11]=n.mode,e[12]=S):S=e[12];const O=S;let v,b,k,_,M,I;e[13]===Symbol.for("react.memo_cache_sentinel")?(b={id:"icon",header:"",render:Be,cellClassName:"w-16 shrink-0",wrap:!0},k={id:"title",header:"Name",render:Ke,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},_={id:"description",header:"Description",render:Ge,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},M={id:"mode",header:"Mode",accessor:Ee,cellClassName:"w-[100px]"},I={id:"connections",header:"Connections",render:Ae,cellClassName:"w-24 shrink-0"},v={id:"status",header:"Status",render:ze,cellClassName:"w-24 shrink-0",sortable:!0},e[13]=v,e[14]=b,e[15]=k,e[16]=_,e[17]=M,e[18]=I):(v=e[13],b=e[14],k=e[15],_=e[16],M=e[17],I=e[18]);let P;e[19]!==r||e[20]!==a.slug?(P=[b,k,_,M,I,v,{id:"actions",header:"",render:o=>t.jsxs(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:$e,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Pe,children:[t.jsxs(B,{onClick:l=>{l.stopPropagation(),r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:l=>{l.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[19]=r,e[20]=a.slug,e[21]=P):P=e[21];const V=P,H=i.create.isPending?"Creating...":"Create MCP Gateway";let $;e[22]!==i.create.isPending||e[23]!==T||e[24]!==H?($=t.jsx(J,{onClick:T,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i.create.isPending,children:H}),e[22]=i.create.isPending,e[23]=T,e[24]=H,e[25]=$):$=e[25];const L=$,F=n.mode==="deleting";let z;e[26]===Symbol.for("react.memo_cache_sentinel")?(z=o=>!o&&N({type:"close"}),e[26]=z):z=e[26];let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ye,{children:"Delete Gateway?"}),e[27]=A):A=e[27];const W=n.mode==="deleting"&&n.gateway.title;let c;e[28]!==W?(c=t.jsxs(we,{children:[A,t.jsxs(je,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),e[28]=W,e[29]=c):c=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Ce,{children:"Cancel"}),e[30]=E):E=e[30];let d;e[31]!==O?(d=t.jsxs(Ne,{children:[E,t.jsx(De,{onClick:O,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[31]=O,e[32]=d):d=e[32];let m;e[33]!==c||e[34]!==d?(m=t.jsxs(Se,{children:[c,d]}),e[33]=c,e[34]=d,e[35]=m):m=e[35];let u;e[36]!==F||e[37]!==m?(u=t.jsx(ve,{open:F,onOpenChange:z,children:m}),e[36]=F,e[37]=m,e[38]=u):u=e[38];let G;e[39]===Symbol.for("react.memo_cache_sentinel")?(G=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[39]=G):G=e[39];let g;e[40]!==L||e[41]!==s.handleSort||e[42]!==s.setViewMode||e[43]!==s.sortDirection||e[44]!==s.sortKey||e[45]!==s.viewMode?(g=t.jsx(ie,{title:"MCP Gateways",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:G,ctaButton:L}),e[40]=L,e[41]=s.handleSort,e[42]=s.setViewMode,e[43]=s.sortDirection,e[44]=s.sortKey,e[45]=s.viewMode,e[46]=g):g=e[46];let p;e[47]!==s?(p=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[47]=s,e[48]=p):p=e[48];let h;e[49]!==s.search||e[50]!==s.setSearch||e[51]!==p?(h=t.jsx(le,{value:s.search,onChange:s.setSearch,placeholder:"Search for a gateway...",onKeyDown:p}),e[49]=s.search,e[50]=s.setSearch,e[51]=p,e[52]=h):h=e[52];let f;e[53]!==V||e[54]!==x||e[55]!==s.handleSort||e[56]!==s.search||e[57]!==s.sortDirection||e[58]!==s.sortKey||e[59]!==s.viewMode||e[60]!==r||e[61]!==a.slug?(f=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:x.length===0?t.jsx(q,{image:t.jsx(y,{size:36,className:"text-muted-foreground"}),title:s.search?"No gateways found":"No gateways yet",description:s.search?`No gateways match "${s.search}"`:"Create a gateway to aggregate tools from multiple MCP connections."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:x.map(o=>t.jsx(de,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(y,{}),onClick:()=>r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}}),footer:t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]}),t.jsx("span",{children:"•"}),t.jsx("span",{children:o.tool_selection_mode==="exclusion"?"Exclude":"Include"})]}),headerActions:t.jsxs(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ie,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Me,children:[t.jsxs(B,{onClick:l=>{l.stopPropagation(),r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:l=>{l.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(ce,{columns:V,data:x,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(q,{image:t.jsx(y,{size:36,className:"text-muted-foreground"}),title:"No gateways found",description:`No gateways match "${s.search}"`}):t.jsx(q,{image:t.jsx(y,{size:36,className:"text-muted-foreground"}),title:"No gateways yet",description:"Create a gateway to aggregate tools from multiple MCP connections."})}),e[53]=V,e[54]=x,e[55]=s.handleSort,e[56]=s.search,e[57]=s.sortDirection,e[58]=s.sortKey,e[59]=s.viewMode,e[60]=r,e[61]=a.slug,e[62]=f):f=e[62];let K;return e[63]!==u||e[64]!==g||e[65]!==h||e[66]!==f?(K=t.jsxs(ne,{children:[u,g,h,f]}),e[63]=u,e[64]=g,e[65]=h,e[66]=f,e[67]=K):K=e[67],K}function Me(e){return e.stopPropagation()}function Ie(e){return e.stopPropagation()}function Pe(e){return e.stopPropagation()}function $e(e){return e.stopPropagation()}function ze(e){return t.jsx(oe,{variant:e.status==="active"?"default":"outline",children:e.status})}function Ae(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function Ee(e){return t.jsx(oe,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function Ge(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Ke(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Be(e){return t.jsx(ge,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(y,{size:16})})}function mt(){const e=te.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(me,{children:t.jsx(se.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(be,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(_e,{})})}),e[0]=a):a=e[0],a}export{mt as default};