@decocms/mesh 1.0.18 → 1.0.19

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 (102) hide show
  1. package/dist/client/assets/{AlertCircle-CAH7G7Fc.js → AlertCircle-aBSXd6aa.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-DYJU0sRd.js → ArrowLeft-DdU5giJb.js} +1 -1
  3. package/dist/client/assets/{Calendar-Ba37VUfB.js → Calendar-DuXiXR2a.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-BtaAznAf.js → ChevronDown-AknLh-p8.js} +1 -1
  5. package/dist/client/assets/{Clock-BYv8XFdU.js → Clock-CPJzDIg8.js} +1 -1
  6. package/dist/client/assets/{Copy01-DZzyV7nE.js → Copy01-sTNxtLGb.js} +1 -1
  7. package/dist/client/assets/{CpuChip02-SXr5nJdo.js → CpuChip02-CBET7vYo.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-BJS2t7Tg.js → DotsVertical-D-H9eVyi.js} +1 -1
  9. package/dist/client/assets/{File06-NpiRHtR-.js → File06-CPdRfDtS.js} +1 -1
  10. package/dist/client/assets/{GitBranch01-iTqlzLTs.js → GitBranch01-DtyS0uyA.js} +1 -1
  11. package/dist/client/assets/{Inbox01-BHWd6y2Z.js → Inbox01-yIExAUuo.js} +1 -1
  12. package/dist/client/assets/{InfoCircle-D6Oa5jFj.js → InfoCircle-CoaQA7Cj.js} +1 -1
  13. package/dist/client/assets/{Key01-BYLHyZyj.js → Key01-BeFhxcJb.js} +1 -1
  14. package/dist/client/assets/{LinkExternal01-CQv3krcN.js → LinkExternal01-DFqmYIBB.js} +1 -1
  15. package/dist/client/assets/{Loading01-DdJTgVpp.js → Loading01-BBk1Ji8d.js} +1 -1
  16. package/dist/client/assets/{Lock01-CVeVWkZB.js → Lock01-B_owaR4J.js} +1 -1
  17. package/dist/client/assets/{Plus-DF_8yoMD.js → Plus-DVuQJsYB.js} +1 -1
  18. package/dist/client/assets/{SearchMd-DDy8E2Sf.js → SearchMd-BvUmPv0S.js} +1 -1
  19. package/dist/client/assets/{Terminal-CyVXhceX.js → Terminal-Dauj-6BI.js} +1 -1
  20. package/dist/client/assets/{Trash01-3l-2SGXg.js → Trash01-C_70aI9y.js} +1 -1
  21. package/dist/client/assets/{Upload01-BY1Megy0.js → Upload01-B9UxI9R2.js} +1 -1
  22. package/dist/client/assets/{X-EkD3fVWA.js → X-aQ5bBp1-.js} +1 -1
  23. package/dist/client/assets/{XClose-BQyXK7EC.js → XClose-CM9DJg2M.js} +1 -1
  24. package/dist/client/assets/{alert-dialog-TgVzKfkb.js → alert-dialog-BPjTE-Bx.js} +1 -1
  25. package/dist/client/assets/{auth-catchall-LOKV6UAh.js → auth-catchall-BmDJc3ht.js} +1 -1
  26. package/dist/client/assets/{auth-CPnNaHvV.js → auth-p1E7za2T.js} +1 -1
  27. package/dist/client/assets/{avatar-DSEJrCNe.js → avatar-CKQ5fZxV.js} +1 -1
  28. package/dist/client/assets/{badge-B1dobCRY.js → badge-CoAJQK-a.js} +1 -1
  29. package/dist/client/assets/{button-Cu7Gpj_2.js → button-BZJKEz_E.js} +1 -1
  30. package/dist/client/assets/{card-BMKHMTDj.js → card-BVLf-CP1.js} +1 -1
  31. package/dist/client/assets/{checkbox-DbkRP74v.js → checkbox-D-4OB0RT.js} +1 -1
  32. package/dist/client/assets/{collection-detail-ngjte1c4.js → collection-detail-CMMwsDfE.js} +1 -1
  33. package/dist/client/assets/{collection-display-button-CfJOFOy4.js → collection-display-button-BBYMkU7y.js} +1 -1
  34. package/dist/client/assets/{collection-header-6vROlIaL.js → collection-header-B7mQA9l0.js} +1 -1
  35. package/dist/client/assets/{collection-page-DPG4FVyY.js → collection-page-DwiC5WsX.js} +1 -1
  36. package/dist/client/assets/{collection-search-Dt3csPYy.js → collection-search-DVqYXnGc.js} +1 -1
  37. package/dist/client/assets/{collection-table-wrapper-B3zYvq_F.js → collection-table-wrapper-Eq4A7toO.js} +1 -1
  38. package/dist/client/assets/{connection-card-CjOjxUED.js → connection-card-Qd0gf8pk.js} +1 -1
  39. package/dist/client/assets/{connection-detail-BTYUiiKA.js → connection-detail-BMCVZ8mI.js} +1 -1
  40. package/dist/client/assets/{connections-C46XykEA.js → connections-B4g6c5pN.js} +1 -1
  41. package/dist/client/assets/{core-BFzlzP8F.js → core-Dk3KlTQQ.js} +1 -1
  42. package/dist/client/assets/{create-organization-dialog-CdptfMRb.js → create-organization-dialog-SPu73xqb.js} +1 -1
  43. package/dist/client/assets/{dialog-CC7Romxu.js → dialog-7UR2hpU4.js} +1 -1
  44. package/dist/client/assets/{dropdown-menu-De2MFXzP.js → dropdown-menu-B5-Z4RLQ.js} +1 -1
  45. package/dist/client/assets/{env-vars-editor-DKJqlIK-.js → env-vars-editor-Cd1b325v.js} +1 -1
  46. package/dist/client/assets/{error-boundary-BlfwOQWs.js → error-boundary-NZgBt0kx.js} +1 -1
  47. package/dist/client/assets/{extract-connection-data-D7ePP-S9.js → extract-connection-data-C0cohnD0.js} +1 -1
  48. package/dist/client/assets/{form-C9aG8a9_.js → form-M-gmJwwS.js} +1 -1
  49. package/dist/client/assets/{formatDistanceToNow-7bwQqEEJ.js → formatDistanceToNow-gygpSZnD.js} +1 -1
  50. package/dist/client/assets/{gateway-detail-D1TGQ1-a.js → gateway-detail-CmiryUNV.js} +1 -1
  51. package/dist/client/assets/{gateways-CicECNcG.js → gateways-CWmvP6Ml.js} +1 -1
  52. package/dist/client/assets/{home-6S0sFGwA.js → home-DycBDegi.js} +1 -1
  53. package/dist/client/assets/{index-BEpExDaW.js → index-0t4iQJMq.js} +1 -1
  54. package/dist/client/assets/{index-CqA7I8ME.js → index-BdKUt3kP.js} +3 -3
  55. package/dist/client/assets/{index-BC4DFDP4.js → index-DCwxWpOb.js} +1 -1
  56. package/dist/client/assets/{index-rXoeRhPD.js → index-DSVuuzx7.js} +1 -1
  57. package/dist/client/assets/{input-DHGUS5vj.js → input-D4UDXDKp.js} +1 -1
  58. package/dist/client/assets/json-ZJ767_7P.js +1 -0
  59. package/dist/client/assets/{json-syntax-highlighter-Dykx_AFd.js → json-syntax-highlighter-BUSqZgZm.js} +2 -2
  60. package/dist/client/assets/{layout-zE8Dp2X0.js → layout-CPKZZ5C4.js} +1 -1
  61. package/dist/client/assets/{lazy-highlighter-CioqVtm3.js → lazy-highlighter-BK73Fdw9.js} +1 -1
  62. package/dist/client/assets/{localstorage-keys-DECG1iSi.js → localstorage-keys-Cv4N1fxe.js} +1 -1
  63. package/dist/client/assets/{login-Cx3k8N36.js → login-Wj9TYCcD.js} +1 -1
  64. package/dist/client/assets/{mcp-oauth-tlLalwei.js → mcp-oauth-DdVFrouT.js} +1 -1
  65. package/dist/client/assets/{members-Bng4JPo_.js → members-Cu5c-T_O.js} +1 -1
  66. package/dist/client/assets/monitoring-DGEbRmqR.js +1 -0
  67. package/dist/client/assets/{oauth-callback-DWHntj-c.js → oauth-callback-CFog2MKh.js} +1 -1
  68. package/dist/client/assets/{page-BNqzvH_D.js → page-AO7blRyq.js} +1 -1
  69. package/dist/client/assets/{popover-DqxbH01z.js → popover-B29wtK47.js} +1 -1
  70. package/dist/client/assets/prism-light-CIytl0p8.js +1 -0
  71. package/dist/client/assets/{resizable-1LBVjTrf.js → resizable-mvE7xDjh.js} +3 -3
  72. package/dist/client/assets/{resource-tabs-CeU00pMP.js → resource-tabs-BKx8NMIk.js} +1 -1
  73. package/dist/client/assets/{select-Dg5JPxAc.js → select-X9N3ceFh.js} +1 -1
  74. package/dist/client/assets/{settings-Bpm9SXP6.js → settings-DShsUgSK.js} +1 -1
  75. package/dist/client/assets/{shell-layout-hhV4DGMT.js → shell-layout-DfVY6zuO.js} +1 -1
  76. package/dist/client/assets/{spinner-CyJuCfoJ.js → spinner-2MCW2Npg.js} +1 -1
  77. package/dist/client/assets/store-V5lfintA.js +1 -0
  78. package/dist/client/assets/{store-app-detail-CFp562AP.js → store-app-detail-CHUr2OX8.js} +1 -1
  79. package/dist/client/assets/{switch-C28m6eWV.js → switch-E6khGxvt.js} +1 -1
  80. package/dist/client/assets/{tools-list-NuJ6i7mN.js → tools-list-74BgWpCR.js} +1 -1
  81. package/dist/client/assets/{tooltip-BGO9FrAb.js → tooltip-DGJnwA8J.js} +1 -1
  82. package/dist/client/assets/{types-B38t86fr.js → types-Dory1ylt.js} +1 -1
  83. package/dist/client/assets/{use-binding-BSrLFa69.js → use-binding-4rPyk1Up.js} +1 -1
  84. package/dist/client/assets/{use-connection-CRNsw_EM.js → use-connection-CAS-EnWk.js} +1 -1
  85. package/dist/client/assets/{use-connection-resources-CuRCIUIA.js → use-connection-resources-DQhL2t6i.js} +1 -1
  86. package/dist/client/assets/{use-gateway-BDLgsIti.js → use-gateway-Bz5mevBK.js} +1 -1
  87. package/dist/client/assets/{use-list-state-Bu3fDY_D.js → use-list-state-BTzZJhNB.js} +1 -1
  88. package/dist/client/assets/{use-mcp-C6M7GJsU.js → use-mcp-BdNK7xZK.js} +1 -1
  89. package/dist/client/assets/{use-members-BjVwiFSf.js → use-members-BR16XPN5.js} +1 -1
  90. package/dist/client/assets/{use-mobile-DWX_zGvO.js → use-mobile-BXJxBPSi.js} +1 -1
  91. package/dist/client/assets/{use-organization-settings-BjHeWH30.js → use-organization-settings-DhEg0GmX.js} +1 -1
  92. package/dist/client/assets/{use-tool-call-hxvro7CP.js → use-tool-call-B9sW_GaR.js} +1 -1
  93. package/dist/client/assets/useQuery-BLl_PdQV.js +1 -0
  94. package/dist/client/assets/useSuspenseInfiniteQuery-BpzOu5TP.js +1 -0
  95. package/dist/client/assets/{view-mode-toggle-CwRfmI4H.js → view-mode-toggle-WwhzQMGF.js} +1 -1
  96. package/dist/client/index.html +1 -1
  97. package/package.json +1 -1
  98. package/dist/client/assets/json-DY5VamDr.js +0 -1
  99. package/dist/client/assets/monitoring-gTR9Celr.js +0 -1
  100. package/dist/client/assets/prism-light-YTNk6MZn.js +0 -1
  101. package/dist/client/assets/store-DrnwLSGT.js +0 -1
  102. package/dist/client/assets/useQuery-DYX0Erl2.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,y as ne,x as te,v as X,W as se,w as x,a0 as oe}from"./index-CqA7I8ME.js";import{C as re}from"./collection-header-6vROlIaL.js";import{C as ie}from"./collection-page-DPG4FVyY.js";import{C as ae}from"./collection-search-Dt3csPYy.js";import{C as ce}from"./collection-table-wrapper-B3zYvq_F.js";import{C as le}from"./connection-card-CjOjxUED.js";import{E as P}from"./SearchMd-DDy8E2Sf.js";import{E as de}from"./error-boundary-BlfwOQWs.js";import{a as me,u as pe,n as T,I as ue}from"./use-connection-CRNsw_EM.js";import{u as xe,s as F}from"./use-list-state-Bu3fDY_D.js";import{u as he}from"./tooltip-BGO9FrAb.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-TgVzKfkb.js";import{B as we}from"./badge-B1dobCRY.js";import{B as g}from"./button-Cu7Gpj_2.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-CC7Romxu.js";import{b as z,D as V,a as R,d as k}from"./dropdown-menu-De2MFXzP.js";import{a as Me,F as l,b as d,c as m,d as p,f as u}from"./form-C9aG8a9_.js";import{i as B}from"./DotsVertical-BJS2t7Tg.js";import{i as $e,r as Ae,s as I,E as Ee,e as W}from"./env-vars-editor-DKJqlIK-.js";import{i as Oe}from"./Loading01-DdJTgVpp.js";import{i as Fe}from"./Terminal-CyVXhceX.js";import{s as H}from"./Trash01-3l-2SGXg.js";import{I as f}from"./input-DHGUS5vj.js";import{S as ze,a as Ve,b as Re,c as Be,d as w}from"./select-Dg5JPxAc.js";import{g as He}from"./generate-id-Dyweu44Y.js";import"./collection-display-button-CfJOFOy4.js";import"./view-mode-toggle-CwRfmI4H.js";import"./card-BMKHMTDj.js";import"./use-mobile-DWX_zGvO.js";import"./X-EkD3fVWA.js";import"./Plus-DF_8yoMD.js";import"./ChevronDown-BtaAznAf.js";const Xe=X({key:x(),value:x()}),We=X({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(Xe).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 j={command:"npx",args:["-y",t]},v=W(o);return Object.keys(v).length>0&&(j.envVars=v),j}function Ue(t,o,j,v){const _={command:t};o.trim()&&(_.args=o.trim().split(/\s+/)),j?.trim()&&(_.cwd=j.trim());const i=W(v);return Object.keys(i).length>0&&(_.envVars=i),_}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(),j=Y({strict:!1}),{data:v}=Z.useSession(),{stdioEnabled:_}=ee(),i=xe({namespace:t.slug,resource:"connections"}),D=me(),b=pe(i),[h,C]=M.useReducer(Je,{mode:"idle"}),$=j.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:[]}}),y=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;C({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}}}),C({type:"close"}),r.reset();return}const O=He("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:v?.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():C({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(z,{children:[e.jsx(V,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(B,{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(),C({type:"delete",connection:n})},children:[e.jsx(H,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],G=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{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(g,{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(f,{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(ze,{value:n.value,onValueChange:n.onChange,children:[e.jsx(p,{children:e.jsx(Ve,{children:e.jsx(Re,{})})}),e.jsxs(Be,{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"]})}),_&&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,{})]})}),y==="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(f,{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,{})]})})}),y==="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(f,{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(f,{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(f,{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,{})]})})]}),(y==="NPX"||y==="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,{})]})}),y!=="NPX"&&y!=="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(f,{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(f,{type:"password",placeholder:"Bearer token or API key",...n,value:n.value??""})}),e.jsx(u,{})]})})]})]}),e.jsxs(Ie,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>E(!1),children:"Cancel"}),e.jsx(g,{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&&C({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:336,height:320,"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.",actions:!i.search&&e.jsx(g,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:t.slug}}),children:"Browse Store"})}):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(z,{children:[e.jsx(V,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(B,{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(),C({type:"delete",connection:n})},children:[e.jsx(H,{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:400,height:178,"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:400,height:178,"aria-hidden":"true"}),title:"No MCP Servers found",description:"Create a connection to get started.",actions:e.jsx(g,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:t.slug}}),children:"Browse Store"})})})]})}function In(){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{In 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,y as ne,x as te,v as X,W as se,w as x,a0 as oe}from"./index-BdKUt3kP.js";import{C as re}from"./collection-header-B7mQA9l0.js";import{C as ie}from"./collection-page-DwiC5WsX.js";import{C as ae}from"./collection-search-DVqYXnGc.js";import{C as ce}from"./collection-table-wrapper-Eq4A7toO.js";import{C as le}from"./connection-card-Qd0gf8pk.js";import{E as P}from"./SearchMd-BvUmPv0S.js";import{E as de}from"./error-boundary-NZgBt0kx.js";import{a as me,u as pe,n as T,I as ue}from"./use-connection-CAS-EnWk.js";import{u as xe,s as F}from"./use-list-state-BTzZJhNB.js";import{u as he}from"./tooltip-DGJnwA8J.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-BPjTE-Bx.js";import{B as we}from"./badge-CoAJQK-a.js";import{B as g}from"./button-BZJKEz_E.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-7UR2hpU4.js";import{b as z,D as V,a as R,d as k}from"./dropdown-menu-B5-Z4RLQ.js";import{a as Me,F as l,b as d,c as m,d as p,f as u}from"./form-M-gmJwwS.js";import{i as B}from"./DotsVertical-D-H9eVyi.js";import{i as $e,r as Ae,s as I,E as Ee,e as W}from"./env-vars-editor-Cd1b325v.js";import{i as Oe}from"./Loading01-BBk1Ji8d.js";import{i as Fe}from"./Terminal-Dauj-6BI.js";import{s as H}from"./Trash01-C_70aI9y.js";import{I as f}from"./input-D4UDXDKp.js";import{S as ze,a as Ve,b as Re,c as Be,d as w}from"./select-X9N3ceFh.js";import{g as He}from"./generate-id-Dyweu44Y.js";import"./collection-display-button-BBYMkU7y.js";import"./view-mode-toggle-WwhzQMGF.js";import"./card-BVLf-CP1.js";import"./use-mobile-BXJxBPSi.js";import"./X-aQ5bBp1-.js";import"./Plus-DVuQJsYB.js";import"./ChevronDown-AknLh-p8.js";const Xe=X({key:x(),value:x()}),We=X({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(Xe).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 j={command:"npx",args:["-y",t]},v=W(o);return Object.keys(v).length>0&&(j.envVars=v),j}function Ue(t,o,j,v){const _={command:t};o.trim()&&(_.args=o.trim().split(/\s+/)),j?.trim()&&(_.cwd=j.trim());const i=W(v);return Object.keys(i).length>0&&(_.envVars=i),_}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(),j=Y({strict:!1}),{data:v}=Z.useSession(),{stdioEnabled:_}=ee(),i=xe({namespace:t.slug,resource:"connections"}),D=me(),b=pe(i),[h,C]=M.useReducer(Je,{mode:"idle"}),$=j.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:[]}}),y=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;C({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}}}),C({type:"close"}),r.reset();return}const O=He("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:v?.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():C({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(z,{children:[e.jsx(V,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(B,{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(),C({type:"delete",connection:n})},children:[e.jsx(H,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],G=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{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(g,{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(f,{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(ze,{value:n.value,onValueChange:n.onChange,children:[e.jsx(p,{children:e.jsx(Ve,{children:e.jsx(Re,{})})}),e.jsxs(Be,{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"]})}),_&&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,{})]})}),y==="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(f,{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,{})]})})}),y==="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(f,{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(f,{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(f,{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,{})]})})]}),(y==="NPX"||y==="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,{})]})}),y!=="NPX"&&y!=="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(f,{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(f,{type:"password",placeholder:"Bearer token or API key",...n,value:n.value??""})}),e.jsx(u,{})]})})]})]}),e.jsxs(Ie,{children:[e.jsx(g,{type:"button",variant:"outline",onClick:()=>E(!1),children:"Cancel"}),e.jsx(g,{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&&C({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:336,height:320,"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.",actions:!i.search&&e.jsx(g,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:t.slug}}),children:"Browse Store"})}):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(z,{children:[e.jsx(V,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(B,{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(),C({type:"delete",connection:n})},children:[e.jsx(H,{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:400,height:178,"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:400,height:178,"aria-hidden":"true"}),title:"No MCP Servers found",description:"Create a connection to get started.",actions:e.jsx(g,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:t.slug}}),children:"Browse Store"})})})]})}function In(){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{In as default};
@@ -1,4 +1,4 @@
1
- import{F as te,ai as Ae}from"./index-CqA7I8ME.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{F as te,ai as Ae}from"./index-BdKUt3kP.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{v as D,w as O,c as _,f as N,x as E,y as I,j as r,a as M}from"./index-CqA7I8ME.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-TgVzKfkb.js";import{u as q,B as H}from"./button-Cu7Gpj_2.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-C9aG8a9_.js";import{I as X}from"./input-DHGUS5vj.js";import{S as Y}from"./spinner-CyJuCfoJ.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
+ import{v as D,w as O,c as _,f as N,x as E,y as I,j as r,a as M}from"./index-BdKUt3kP.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-BPjTE-Bx.js";import{u as q,B as H}from"./button-BZJKEz_E.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-M-gmJwwS.js";import{I as X}from"./input-D4UDXDKp.js";import{S as Y}from"./spinner-2MCW2Npg.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,aS as j,h as N}from"./index-CqA7I8ME.js";import{c}from"./button-Cu7Gpj_2.js";import{i as h}from"./X-EkD3fVWA.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
+ 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,h as N}from"./index-BdKUt3kP.js";import{c}from"./button-BZJKEz_E.js";import{i as h}from"./X-aQ5bBp1-.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,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-CqA7I8ME.js";import{c as p}from"./button-Cu7Gpj_2.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-BdKUt3kP.js";import{c as p}from"./button-BZJKEz_E.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 +1 @@
1
- import{r as N,v as y,a0 as P,W as _,w as t,X as p,aO as w,aH as H,c as R,j as c}from"./index-CqA7I8ME.js";import{B as z}from"./button-Cu7Gpj_2.js";import{I as V}from"./input-DHGUS5vj.js";import{s as W}from"./Plus-DF_8yoMD.js";import{s as L}from"./Trash01-3l-2SGXg.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(),w()),outputSchema:p(t(),w()).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:H([q,$]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:B.nullable().describe("OAuth configuration"),configuration_state:p(t(),w()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:_(t()).nullable().optional().describe("Configuration scopes"),metadata:p(t(),w()).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 Q(i){return i!=null&&"command"in i}function Y(i){const e=R.c(34),{value:n,onChange:o,keyPlaceholder:A,valuePlaceholder:D,className:j}=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(W,{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]!==j||e[32]!==m?(T=c.jsx("div",{className:j,children:m}),e[31]=j,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,Q as i,ee as r,U as s};
1
+ import{r as N,v as y,a0 as P,W as _,w as t,X as p,aO as w,aH as H,c as R,j as c}from"./index-BdKUt3kP.js";import{B as z}from"./button-BZJKEz_E.js";import{I as V}from"./input-D4UDXDKp.js";import{s as W}from"./Plus-DVuQJsYB.js";import{s as L}from"./Trash01-C_70aI9y.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(),w()),outputSchema:p(t(),w()).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:H([q,$]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:B.nullable().describe("OAuth configuration"),configuration_state:p(t(),w()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:_(t()).nullable().optional().describe("Configuration scopes"),metadata:p(t(),w()).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 Q(i){return i!=null&&"command"in i}function Y(i){const e=R.c(34),{value:n,onChange:o,keyPlaceholder:A,valuePlaceholder:D,className:j}=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(W,{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]!==j||e[32]!==m?(T=c.jsx("div",{className:j,children:m}),e[31]=j,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,Q as i,ee as r,U as s};
@@ -1 +1 @@
1
- import{r as a,j as e}from"./index-CqA7I8ME.js";import{B as n}from"./button-Cu7Gpj_2.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-BdKUt3kP.js";import{B as n}from"./button-BZJKEz_E.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 +1 @@
1
- import{B as v}from"./use-binding-BSrLFa69.js";import{aG as C}from"./index-CqA7I8ME.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
+ import{B as v}from"./use-binding-4rPyk1Up.js";import{aG as C}from"./index-BdKUt3kP.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,aY as $,bE as j,bF as C,r as f,k as v,bG as N,bH as h}from"./index-CqA7I8ME.js";import{c as u}from"./button-Cu7Gpj_2.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 k(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formMessageId:r}=x(),a=l?String(l?.message??""):o.children;if(!a)return null;let n;e[3]!==s?(n=u("text-destructive text-sm",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==n?(i=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,k as f};
1
+ import{c as d,j as m,aY as $,bE as j,bF as C,r as f,k as v,bG as N,bH as h}from"./index-BdKUt3kP.js";import{c as u}from"./button-BZJKEz_E.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 k(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formMessageId:r}=x(),a=l?String(l?.message??""):o.children;if(!a)return null;let n;e[3]!==s?(n=u("text-destructive text-sm",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==n?(i=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,k as f};
@@ -1 +1 @@
1
- import{bq as q,br as k,bs as L,bt as I,ap as _,e as N,bu as Y,bv as H,r as M,bw as B,bx as V,by as J,bz as U,bA as T,bB as E,bC as $,bD as K,c as Z,j as v}from"./index-CqA7I8ME.js";import{B as G}from"./button-Cu7Gpj_2.js";import{u as tt,b as et,T as nt,a as rt,c as st}from"./tooltip-BGO9FrAb.js";import{u as at,a as ot}from"./use-organization-settings-BjHeWH30.js";function F(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function it(e,t,n){const r=e.slice(0);return r[t]=n,r}var ut=class extends q{#r;#t;#s;#a;#e;#n;#o;#i;#u=[];constructor(e,t,n){super(),this.#r=e,this.#a=n,this.#s=[],this.#e=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(e=>{e.subscribe(t=>{this.#d(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(e=>{e.destroy()})}setQueries(e,t){this.#s=e,this.#a=t,k.batch(()=>{const n=this.#e,r=this.#h(this.#s);r.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions));const s=r.map(u=>u.observer),i=s.map(u=>u.getCurrentResult()),o=n.length!==s.length,a=s.some((u,f)=>u!==n[f]),c=o||a,l=c?!0:i.some((u,f)=>{const h=this.#t[f];return!h||!L(u,h)});!c&&!l||(c&&(this.#u=r,this.#e=s),this.#t=i,this.hasListeners()&&(c&&(F(n,s).forEach(u=>{u.destroy()}),F(s,n).forEach(u=>{u.subscribe(f=>{this.#d(u,f)})})),this.#f()))})}getCurrentResult(){return this.#t}getQueries(){return this.#e.map(e=>e.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(e,t){const n=this.#h(e),r=n.map(s=>s.observer.getOptimisticResult(s.defaultedQueryOptions));return[r,s=>this.#l(s??r,t),()=>this.#c(r,n)]}#c(e,t){return t.map((n,r)=>{const s=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?s:n.observer.trackResult(s,i=>{t.forEach(o=>{o.observer.trackProp(i)})})})}#l(e,t){return t?((!this.#n||this.#t!==this.#i||t!==this.#o)&&(this.#o=t,this.#i=this.#t,this.#n=I(this.#n,t(e))),this.#n):e}#h(e){const t=new Map;this.#e.forEach(r=>{const s=r.options.queryHash;if(!s)return;const i=t.get(s);i?i.push(r):t.set(s,[r])});const n=[];return e.forEach(r=>{const s=this.#r.defaultQueryOptions(r),o=t.get(s.queryHash)?.shift()??new _(this.#r,s);n.push({defaultedQueryOptions:s,observer:o})}),n}#d(e,t){const n=this.#e.indexOf(e);n!==-1&&(this.#t=it(this.#t,n,t),this.#f())}#f(){if(this.hasListeners()){const e=this.#n,t=this.#c(this.#t,this.#u),n=this.#l(t,this.#a?.combine);e!==n&&k.batch(()=>{this.listeners.forEach(r=>{r(this.#t)})})}}};function se({queries:e,...t},n){const r=N(n),s=Y(),i=H(),o=M.useMemo(()=>e.map(d=>{const b=r.defaultQueryOptions(d);return b._optimisticResults=s?"isRestoring":"optimistic",b}),[e,r,s]);o.forEach(d=>{B(d);const b=r.getQueryCache().get(d.queryHash);V(d,i,b)}),J(i);const[a]=M.useState(()=>new ut(r,o,t)),[c,l,u]=a.getOptimisticResult(o,t.combine),f=!s&&t.subscribed!==!1;M.useSyncExternalStore(M.useCallback(d=>f?a.subscribe(k.batchCalls(d)):U,[a,f]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),M.useEffect(()=>{a.setQueries(o,t)},[o,t,a]);const y=c.some((d,b)=>T(o[b],d))?c.flatMap((d,b)=>{const g=o[b];if(g){const w=new _(r,g);if(T(g,d))return E(g,w,i);$(d,s)&&E(g,w,i)}return[]}):[];if(y.length>0)throw Promise.all(y);const m=c.find((d,b)=>{const g=o[b];return g&&K({result:d,errorResetBoundary:i,throwOnError:g.throwOnError,query:r.getQueryCache().get(g.queryHash),suspense:g.suspense})});if(m?.error)throw m.error;return l(u())}const z=({size:e=24,color:t="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M12 15v7M8 7.308v2.13c0 .209 0 .313-.02.412a1.001 1.001 0 0 1-.09.254c-.045.09-.11.172-.24.334L6.08 12.4c-.666.833-.999 1.249-.999 1.599a1 1 0 0 0 .376.782C5.731 15 6.264 15 7.33 15h9.342c1.066 0 1.599 0 1.873-.219A1 1 0 0 0 18.92 14c0-.35-.333-.766-1-1.599l-1.569-1.962c-.13-.162-.195-.243-.241-.334a1.004 1.004 0 0 1-.09-.254C16 9.75 16 9.647 16 9.44V7.31c0-.116 0-.174.007-.23.006-.05.015-.1.029-.15a2.02 2.02 0 0 1 .079-.215l1.008-2.52c.294-.735.44-1.102.38-1.397a1 1 0 0 0-.427-.63C16.825 2 16.429 2 15.637 2H8.364c-.792 0-1.188 0-1.44.167a1 1 0 0 0-.426.63c-.06.295.086.662.38 1.397l1.008 2.52c.043.107.064.16.08.215a1 1 0 0 1 .028.15c.006.056.006.114.006.23Z"}));z.displayName="Pin01";function ae(e){const t=Z.c(19),{title:n,url:r,icon:s}=e,{org:i}=tt(),o=at(i.id),a=ot(i.id);let c;t[0]!==o?.sidebar_items||t[1]!==r?(c=o?.sidebar_items?.some(w=>w.url===r),t[0]=o?.sidebar_items,t[1]=r,t[2]=c):c=t[2];const l=!!c;let u;t[3]!==a.update||t[4]!==s||t[5]!==l||t[6]!==o?.sidebar_items||t[7]!==n||t[8]!==r?(u=async()=>{const w=o?.sidebar_items||[];let C;l?C=w.filter(X=>X.url!==r):C=[...w,{title:n,url:r,icon:s}],await a.update.mutateAsync({sidebar_items:C})},t[3]=a.update,t[4]=s,t[5]=l,t[6]=o?.sidebar_items,t[7]=n,t[8]=r,t[9]=u):u=t[9];const f=u,h=l?"secondary":"outline";let y;t[10]===Symbol.for("react.memo_cache_sentinel")?(y=v.jsx(z,{size:16}),t[10]=y):y=t[10];let m;t[11]!==f||t[12]!==h?(m=v.jsx(et,{asChild:!0,children:v.jsx(G,{onClick:f,size:"icon",variant:h,className:"size-7 border border-input",children:y})}),t[11]=f,t[12]=h,t[13]=m):m=t[13];const d=l?"Pinned":"Pin to sidebar";let b;t[14]!==d?(b=v.jsx(nt,{children:d}),t[14]=d,t[15]=b):b=t[15];let g;return t[16]!==m||t[17]!==b?(g=v.jsx(rt,{children:v.jsxs(st,{children:[m,b]})}),t[16]=m,t[17]=b,t[18]=g):g=t[18],g}const S=43200,j=1440,A=Symbol.for("constructDateFrom");function W(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&A in e?e[A](t):e instanceof Date?new e.constructor(t):new Date(t)}function p(e,t){return W(e,e)}let ct={};function lt(){return ct}function Q(e){const t=p(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function R(e,...t){const n=W.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function O(e,t){const n=+p(e)-+p(t);return n<0?-1:n>0?1:n}function ht(e){return W(e,Date.now())}function dt(e,t,n){const[r,s]=R(n?.in,e,t),i=r.getFullYear()-s.getFullYear(),o=r.getMonth()-s.getMonth();return i*12+o}function ft(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function mt(e,t){return+p(e)-+p(t)}function bt(e,t){const n=p(e);return n.setHours(23,59,59,999),n}function gt(e,t){const n=p(e),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function yt(e,t){const n=p(e);return+bt(n)==+gt(n)}function pt(e,t,n){const[r,s,i]=R(n?.in,e,e,t),o=O(s,i),a=Math.abs(dt(s,i));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*a);let c=O(s,i)===-o;yt(r)&&a===1&&O(r,i)===1&&(c=!1);const l=o*(a-+c);return l===0?0:l}function wt(e,t,n){const r=mt(e,t)/1e3;return ft(n?.roundingMethod)(r)}const Mt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},vt=(e,t,n)=>{let r;const s=Mt[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function x(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Pt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Dt={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},St={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ot={date:x({formats:Pt,defaultWidth:"full"}),time:x({formats:Dt,defaultWidth:"full"}),dateTime:x({formats:St,defaultWidth:"full"})},Ct={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},xt=(e,t,n,r)=>Ct[e];function P(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n?.width?String(n.width):o;s=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n?.width?String(n.width):e.defaultWidth;s=e.values[a]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return s[i]}}const kt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Wt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Rt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Tt={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"]},Et={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ft={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},jt=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},At={ordinalNumber:jt,era:P({values:kt,defaultWidth:"wide"}),quarter:P({values:Wt,defaultWidth:"wide",argumentCallback:e=>e-1}),month:P({values:Rt,defaultWidth:"wide"}),day:P({values:Tt,defaultWidth:"wide"}),dayPeriod:P({values:Et,defaultWidth:"wide",formattingValues:Ft,defaultFormattingWidth:"wide"})};function D(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;const o=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(a)?_t(a,f=>f.test(o)):Qt(a,f=>f.test(o));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(o.length);return{value:l,rest:u}}}function Qt(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function _t(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function zt(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const Xt=/^(\d+)(th|st|nd|rd)?/i,qt=/\d+/i,Lt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},It={any:[/^b/i,/^(a|c)/i]},Nt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Yt={any:[/1/i,/2/i,/3/i,/4/i]},Ht={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Bt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Vt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Jt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ut={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},$t={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Kt={ordinalNumber:zt({matchPattern:Xt,parsePattern:qt,valueCallback:e=>parseInt(e,10)}),era:D({matchPatterns:Lt,defaultMatchWidth:"wide",parsePatterns:It,defaultParseWidth:"any"}),quarter:D({matchPatterns:Nt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any",valueCallback:e=>e+1}),month:D({matchPatterns:Ht,defaultMatchWidth:"wide",parsePatterns:Bt,defaultParseWidth:"any"}),day:D({matchPatterns:Vt,defaultMatchWidth:"wide",parsePatterns:Jt,defaultParseWidth:"any"}),dayPeriod:D({matchPatterns:Ut,defaultMatchWidth:"any",parsePatterns:$t,defaultParseWidth:"any"})},Zt={code:"en-US",formatDistance:vt,formatLong:Ot,formatRelative:xt,localize:At,match:Kt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Gt(e,t,n){const r=lt(),s=n?.locale??r.locale??Zt,i=2520,o=O(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:o}),[c,l]=R(n?.in,...o>0?[t,e]:[e,t]),u=wt(l,c),f=(Q(l)-Q(c))/1e3,h=Math.round((u-f)/60);let y;if(h<2)return n?.includeSeconds?u<5?s.formatDistance("lessThanXSeconds",5,a):u<10?s.formatDistance("lessThanXSeconds",10,a):u<20?s.formatDistance("lessThanXSeconds",20,a):u<40?s.formatDistance("halfAMinute",0,a):u<60?s.formatDistance("lessThanXMinutes",1,a):s.formatDistance("xMinutes",1,a):h===0?s.formatDistance("lessThanXMinutes",1,a):s.formatDistance("xMinutes",h,a);if(h<45)return s.formatDistance("xMinutes",h,a);if(h<90)return s.formatDistance("aboutXHours",1,a);if(h<j){const m=Math.round(h/60);return s.formatDistance("aboutXHours",m,a)}else{if(h<i)return s.formatDistance("xDays",1,a);if(h<S){const m=Math.round(h/j);return s.formatDistance("xDays",m,a)}else if(h<S*2)return y=Math.round(h/S),s.formatDistance("aboutXMonths",y,a)}if(y=pt(l,c),y<12){const m=Math.round(h/S);return s.formatDistance("xMonths",m,a)}else{const m=y%12,d=Math.trunc(y/12);return m<3?s.formatDistance("aboutXYears",d,a):m<9?s.formatDistance("overXYears",d,a):s.formatDistance("almostXYears",d+1,a)}}function oe(e,t){return Gt(e,ht(e),t)}export{ae as P,oe as f,se as u};
1
+ import{bq as q,br as k,bs as L,bt as I,ap as _,e as N,bu as Y,bv as H,r as M,bw as B,bx as V,by as J,bz as U,bA as T,bB as E,bC as $,bD as K,c as Z,j as v}from"./index-BdKUt3kP.js";import{B as G}from"./button-BZJKEz_E.js";import{u as tt,b as et,T as nt,a as rt,c as st}from"./tooltip-DGJnwA8J.js";import{u as at,a as ot}from"./use-organization-settings-DhEg0GmX.js";function F(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function it(e,t,n){const r=e.slice(0);return r[t]=n,r}var ut=class extends q{#r;#t;#s;#a;#e;#n;#o;#i;#u=[];constructor(e,t,n){super(),this.#r=e,this.#a=n,this.#s=[],this.#e=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#e.forEach(e=>{e.subscribe(t=>{this.#d(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#e.forEach(e=>{e.destroy()})}setQueries(e,t){this.#s=e,this.#a=t,k.batch(()=>{const n=this.#e,r=this.#h(this.#s);r.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions));const s=r.map(u=>u.observer),i=s.map(u=>u.getCurrentResult()),o=n.length!==s.length,a=s.some((u,f)=>u!==n[f]),c=o||a,l=c?!0:i.some((u,f)=>{const h=this.#t[f];return!h||!L(u,h)});!c&&!l||(c&&(this.#u=r,this.#e=s),this.#t=i,this.hasListeners()&&(c&&(F(n,s).forEach(u=>{u.destroy()}),F(s,n).forEach(u=>{u.subscribe(f=>{this.#d(u,f)})})),this.#f()))})}getCurrentResult(){return this.#t}getQueries(){return this.#e.map(e=>e.getCurrentQuery())}getObservers(){return this.#e}getOptimisticResult(e,t){const n=this.#h(e),r=n.map(s=>s.observer.getOptimisticResult(s.defaultedQueryOptions));return[r,s=>this.#l(s??r,t),()=>this.#c(r,n)]}#c(e,t){return t.map((n,r)=>{const s=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?s:n.observer.trackResult(s,i=>{t.forEach(o=>{o.observer.trackProp(i)})})})}#l(e,t){return t?((!this.#n||this.#t!==this.#i||t!==this.#o)&&(this.#o=t,this.#i=this.#t,this.#n=I(this.#n,t(e))),this.#n):e}#h(e){const t=new Map;this.#e.forEach(r=>{const s=r.options.queryHash;if(!s)return;const i=t.get(s);i?i.push(r):t.set(s,[r])});const n=[];return e.forEach(r=>{const s=this.#r.defaultQueryOptions(r),o=t.get(s.queryHash)?.shift()??new _(this.#r,s);n.push({defaultedQueryOptions:s,observer:o})}),n}#d(e,t){const n=this.#e.indexOf(e);n!==-1&&(this.#t=it(this.#t,n,t),this.#f())}#f(){if(this.hasListeners()){const e=this.#n,t=this.#c(this.#t,this.#u),n=this.#l(t,this.#a?.combine);e!==n&&k.batch(()=>{this.listeners.forEach(r=>{r(this.#t)})})}}};function se({queries:e,...t},n){const r=N(n),s=Y(),i=H(),o=M.useMemo(()=>e.map(d=>{const b=r.defaultQueryOptions(d);return b._optimisticResults=s?"isRestoring":"optimistic",b}),[e,r,s]);o.forEach(d=>{B(d);const b=r.getQueryCache().get(d.queryHash);V(d,i,b)}),J(i);const[a]=M.useState(()=>new ut(r,o,t)),[c,l,u]=a.getOptimisticResult(o,t.combine),f=!s&&t.subscribed!==!1;M.useSyncExternalStore(M.useCallback(d=>f?a.subscribe(k.batchCalls(d)):U,[a,f]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),M.useEffect(()=>{a.setQueries(o,t)},[o,t,a]);const y=c.some((d,b)=>T(o[b],d))?c.flatMap((d,b)=>{const g=o[b];if(g){const w=new _(r,g);if(T(g,d))return E(g,w,i);$(d,s)&&E(g,w,i)}return[]}):[];if(y.length>0)throw Promise.all(y);const m=c.find((d,b)=>{const g=o[b];return g&&K({result:d,errorResetBoundary:i,throwOnError:g.throwOnError,query:r.getQueryCache().get(g.queryHash),suspense:g.suspense})});if(m?.error)throw m.error;return l(u())}const z=({size:e=24,color:t="currentColor",...n})=>M.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},M.createElement("path",{d:"M12 15v7M8 7.308v2.13c0 .209 0 .313-.02.412a1.001 1.001 0 0 1-.09.254c-.045.09-.11.172-.24.334L6.08 12.4c-.666.833-.999 1.249-.999 1.599a1 1 0 0 0 .376.782C5.731 15 6.264 15 7.33 15h9.342c1.066 0 1.599 0 1.873-.219A1 1 0 0 0 18.92 14c0-.35-.333-.766-1-1.599l-1.569-1.962c-.13-.162-.195-.243-.241-.334a1.004 1.004 0 0 1-.09-.254C16 9.75 16 9.647 16 9.44V7.31c0-.116 0-.174.007-.23.006-.05.015-.1.029-.15a2.02 2.02 0 0 1 .079-.215l1.008-2.52c.294-.735.44-1.102.38-1.397a1 1 0 0 0-.427-.63C16.825 2 16.429 2 15.637 2H8.364c-.792 0-1.188 0-1.44.167a1 1 0 0 0-.426.63c-.06.295.086.662.38 1.397l1.008 2.52c.043.107.064.16.08.215a1 1 0 0 1 .028.15c.006.056.006.114.006.23Z"}));z.displayName="Pin01";function ae(e){const t=Z.c(19),{title:n,url:r,icon:s}=e,{org:i}=tt(),o=at(i.id),a=ot(i.id);let c;t[0]!==o?.sidebar_items||t[1]!==r?(c=o?.sidebar_items?.some(w=>w.url===r),t[0]=o?.sidebar_items,t[1]=r,t[2]=c):c=t[2];const l=!!c;let u;t[3]!==a.update||t[4]!==s||t[5]!==l||t[6]!==o?.sidebar_items||t[7]!==n||t[8]!==r?(u=async()=>{const w=o?.sidebar_items||[];let C;l?C=w.filter(X=>X.url!==r):C=[...w,{title:n,url:r,icon:s}],await a.update.mutateAsync({sidebar_items:C})},t[3]=a.update,t[4]=s,t[5]=l,t[6]=o?.sidebar_items,t[7]=n,t[8]=r,t[9]=u):u=t[9];const f=u,h=l?"secondary":"outline";let y;t[10]===Symbol.for("react.memo_cache_sentinel")?(y=v.jsx(z,{size:16}),t[10]=y):y=t[10];let m;t[11]!==f||t[12]!==h?(m=v.jsx(et,{asChild:!0,children:v.jsx(G,{onClick:f,size:"icon",variant:h,className:"size-7 border border-input",children:y})}),t[11]=f,t[12]=h,t[13]=m):m=t[13];const d=l?"Pinned":"Pin to sidebar";let b;t[14]!==d?(b=v.jsx(nt,{children:d}),t[14]=d,t[15]=b):b=t[15];let g;return t[16]!==m||t[17]!==b?(g=v.jsx(rt,{children:v.jsxs(st,{children:[m,b]})}),t[16]=m,t[17]=b,t[18]=g):g=t[18],g}const S=43200,j=1440,A=Symbol.for("constructDateFrom");function W(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&A in e?e[A](t):e instanceof Date?new e.constructor(t):new Date(t)}function p(e,t){return W(e,e)}let ct={};function lt(){return ct}function Q(e){const t=p(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function R(e,...t){const n=W.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function O(e,t){const n=+p(e)-+p(t);return n<0?-1:n>0?1:n}function ht(e){return W(e,Date.now())}function dt(e,t,n){const[r,s]=R(n?.in,e,t),i=r.getFullYear()-s.getFullYear(),o=r.getMonth()-s.getMonth();return i*12+o}function ft(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function mt(e,t){return+p(e)-+p(t)}function bt(e,t){const n=p(e);return n.setHours(23,59,59,999),n}function gt(e,t){const n=p(e),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function yt(e,t){const n=p(e);return+bt(n)==+gt(n)}function pt(e,t,n){const[r,s,i]=R(n?.in,e,e,t),o=O(s,i),a=Math.abs(dt(s,i));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*a);let c=O(s,i)===-o;yt(r)&&a===1&&O(r,i)===1&&(c=!1);const l=o*(a-+c);return l===0?0:l}function wt(e,t,n){const r=mt(e,t)/1e3;return ft(n?.roundingMethod)(r)}const Mt={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},vt=(e,t,n)=>{let r;const s=Mt[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function x(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Pt={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Dt={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},St={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ot={date:x({formats:Pt,defaultWidth:"full"}),time:x({formats:Dt,defaultWidth:"full"}),dateTime:x({formats:St,defaultWidth:"full"})},Ct={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},xt=(e,t,n,r)=>Ct[e];function P(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n?.width?String(n.width):o;s=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n?.width?String(n.width):e.defaultWidth;s=e.values[a]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return s[i]}}const kt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Wt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Rt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Tt={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"]},Et={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ft={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},jt=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},At={ordinalNumber:jt,era:P({values:kt,defaultWidth:"wide"}),quarter:P({values:Wt,defaultWidth:"wide",argumentCallback:e=>e-1}),month:P({values:Rt,defaultWidth:"wide"}),day:P({values:Tt,defaultWidth:"wide"}),dayPeriod:P({values:Et,defaultWidth:"wide",formattingValues:Ft,defaultFormattingWidth:"wide"})};function D(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;const o=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(a)?_t(a,f=>f.test(o)):Qt(a,f=>f.test(o));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(o.length);return{value:l,rest:u}}}function Qt(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function _t(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function zt(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const Xt=/^(\d+)(th|st|nd|rd)?/i,qt=/\d+/i,Lt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},It={any:[/^b/i,/^(a|c)/i]},Nt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Yt={any:[/1/i,/2/i,/3/i,/4/i]},Ht={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Bt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Vt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Jt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ut={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},$t={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Kt={ordinalNumber:zt({matchPattern:Xt,parsePattern:qt,valueCallback:e=>parseInt(e,10)}),era:D({matchPatterns:Lt,defaultMatchWidth:"wide",parsePatterns:It,defaultParseWidth:"any"}),quarter:D({matchPatterns:Nt,defaultMatchWidth:"wide",parsePatterns:Yt,defaultParseWidth:"any",valueCallback:e=>e+1}),month:D({matchPatterns:Ht,defaultMatchWidth:"wide",parsePatterns:Bt,defaultParseWidth:"any"}),day:D({matchPatterns:Vt,defaultMatchWidth:"wide",parsePatterns:Jt,defaultParseWidth:"any"}),dayPeriod:D({matchPatterns:Ut,defaultMatchWidth:"any",parsePatterns:$t,defaultParseWidth:"any"})},Zt={code:"en-US",formatDistance:vt,formatLong:Ot,formatRelative:xt,localize:At,match:Kt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Gt(e,t,n){const r=lt(),s=n?.locale??r.locale??Zt,i=2520,o=O(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:o}),[c,l]=R(n?.in,...o>0?[t,e]:[e,t]),u=wt(l,c),f=(Q(l)-Q(c))/1e3,h=Math.round((u-f)/60);let y;if(h<2)return n?.includeSeconds?u<5?s.formatDistance("lessThanXSeconds",5,a):u<10?s.formatDistance("lessThanXSeconds",10,a):u<20?s.formatDistance("lessThanXSeconds",20,a):u<40?s.formatDistance("halfAMinute",0,a):u<60?s.formatDistance("lessThanXMinutes",1,a):s.formatDistance("xMinutes",1,a):h===0?s.formatDistance("lessThanXMinutes",1,a):s.formatDistance("xMinutes",h,a);if(h<45)return s.formatDistance("xMinutes",h,a);if(h<90)return s.formatDistance("aboutXHours",1,a);if(h<j){const m=Math.round(h/60);return s.formatDistance("aboutXHours",m,a)}else{if(h<i)return s.formatDistance("xDays",1,a);if(h<S){const m=Math.round(h/j);return s.formatDistance("xDays",m,a)}else if(h<S*2)return y=Math.round(h/S),s.formatDistance("aboutXMonths",y,a)}if(y=pt(l,c),y<12){const m=Math.round(h/S);return s.formatDistance("xMonths",m,a)}else{const m=y%12,d=Math.trunc(y/12);return m<3?s.formatDistance("aboutXYears",d,a):m<9?s.formatDistance("overXYears",d,a):s.formatDistance("almostXYears",d+1,a)}}function oe(e,t){return Gt(e,ht(e),t)}export{ae as P,oe as f,se as u};
@@ -1 +1 @@
1
- import{r as T,c as U,j as t,f as ke,d as Me,b as Oe,v as Ue,a0 as Se,w as Ne,g as Be,av as Le,x as Je,y as qe,t as Ie}from"./index-CqA7I8ME.js";import{E as Qe}from"./SearchMd-DDy8E2Sf.js";import{E as $e}from"./error-boundary-BlfwOQWs.js";import{I as _e,u as Pe}from"./use-connection-CRNsw_EM.js";import{T as Ke,S as We}from"./switch-C28m6eWV.js";import{C as Re}from"./checkbox-DbkRP74v.js";import{c as K,B as J}from"./button-Cu7Gpj_2.js";import{i as He}from"./ArrowLeft-DYJU0sRd.js";import{C as Xe}from"./collection-search-Dt3csPYy.js";import{I as we}from"./input-DHGUS5vj.js";import{s as Ye}from"./Plus-DF_8yoMD.js";import{i as Ze}from"./X-EkD3fVWA.js";import{b as et,a as tt}from"./use-gateway-BDLgsIti.js";import{u as st,a as nt}from"./use-connection-resources-CuRCIUIA.js";import{a as ce,c as ae,b as de,T as me,i as Te}from"./tooltip-BGO9FrAb.js";import{a as ot}from"./Copy01-DZzyV7nE.js";import{i as lt}from"./CpuChip02-SXr5nJdo.js";import{i as ze}from"./InfoCircle-D6Oa5jFj.js";import{i as Ce}from"./Loading01-DdJTgVpp.js";import{F as ie,a as rt,b as fe,d as xe,f as he,c as Ae}from"./form-C9aG8a9_.js";import{S as Ee,a as De,b as Fe,c as Ve,d as ue}from"./select-Dg5JPxAc.js";import{R as it}from"./resource-tabs-CeU00pMP.js";import{s as ct}from"./slugify-CEUa2lfQ.js";import{P as at,f as dt}from"./formatDistanceToNow-7bwQqEEJ.js";import{a as mt,V as ut,b as ft}from"./layout-zE8Dp2X0.js";import"./ChevronDown-BtaAznAf.js";import"./badge-B1dobCRY.js";import"./use-organization-settings-BjHeWH30.js";const xt=T.memo(function(e){const s=U.c(20),{connection:o,isSelected:d,hasItemsEnabled:l,activeItemsCount:f,totalItemsCount:x,onSelect:a,onToggle:r}=e,i=d?"bg-accent/50":"hover:bg-muted/50";let m;s[0]!==i?(m=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",i),s[0]=i,s[1]=m):m=s[1];let c;s[2]!==o.icon||s[3]!==o.title?(c=t.jsx(_e,{icon:o.icon,name:o.title,size:"xs"}),s[2]=o.icon,s[3]=o.title,s[4]=c):c=s[4];let j;s[5]!==o.title?(j=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.title})}),s[5]=o.title,s[6]=j):j=s[6];let h;s[7]!==a||s[8]!==c||s[9]!==j?(h=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:a,children:[c,j]}),s[7]=a,s[8]=c,s[9]=j,s[10]=h):h=s[10];let p;s[11]!==f||s[12]!==l||s[13]!==r||s[14]!==x?(p=x>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[f,"/",x]}),t.jsx(Re,{checked:l,onCheckedChange:r,onClick:pt})]}),s[11]=f,s[12]=l,s[13]=r,s[14]=x,s[15]=p):p=s[15];let b;return s[16]!==m||s[17]!==h||s[18]!==p?(b=t.jsxs("div",{className:m,children:[h,p]}),s[16]=m,s[17]=h,s[18]=p,s[19]=b):b=s[19],b}),ht=T.memo(function(e){const s=U.c(18),{connectionId:o,item:d,isSelected:l,onToggle:f}=e,x=`item-${o}-${d.id}`,a=l?"text-foreground":"text-muted-foreground";let r;s[0]!==a?(r=K("text-sm font-medium",a),s[0]=a,s[1]=r):r=s[1];let i;s[2]!==d.name||s[3]!==r?(i=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:r,children:d.name})}),s[2]=d.name,s[3]=r,s[4]=i):i=s[4];let m;s[5]!==d.description?(m=d.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:d.description}),s[5]=d.description,s[6]=m):m=s[6];let c;s[7]!==i||s[8]!==m?(c=t.jsxs("div",{className:"flex-1 min-w-0",children:[i,m]}),s[7]=i,s[8]=m,s[9]=c):c=s[9];const j=`item-${o}-${d.id}`;let h;s[10]!==l||s[11]!==f||s[12]!==j?(h=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Re,{id:j,checked:l,onCheckedChange:f,onClick:gt})}),s[10]=l,s[11]=f,s[12]=j,s[13]=h):h=s[13];let p;return s[14]!==x||s[15]!==c||s[16]!==h?(p=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:x,children:[c,h]}),s[14]=x,s[15]=c,s[16]=h,s[17]=p):p=s[17],p});function Ge({itemSet:n,onItemSetChange:e,getItems:s,itemLabel:o,emptyItemsMessage:d,extraContent:l}){const[f,x]=T.useState(""),a=T.useDeferredValue(f),[r,i]=T.useState("all"),[m,c]=T.useState(!1),j=T.useRef(new Set(Object.keys(n))),h=Pe({searchTerm:a.trim()||void 0}),p=j.current,b=[...p.values()].map(u=>h.find(C=>C.id===u)).filter(u=>u!==void 0),S=h.filter(u=>!p.has(u.id)),w=[...b,...S],g=u=>{const C=n[u];return C!==void 0&&C.length>0},y=w.filter(u=>{if(r==="all")return!0;const C=g(u.id);return r==="selected"?C:r==="unselected"?!C:!0}),[v,_]=T.useState(w[0]?.id??null),N=v?w.find(u=>u.id===v)??null:null,D=N?s(N):[],A=(u,C)=>n[u]?.includes(C)??!1,B=(u,C)=>{const k=n[u]??[],P=k.includes(C),F={...n};if(P){const R=k.filter(z=>z!==C);R.length===0?delete F[u]:F[u]=R}else F[u]=[...k,C];e(F)},q=u=>{const C=w.find(V=>V.id===u);if(!C)return;const k=s(C);if(k.length===0)return;const P=n[u]??[],F=k.map(V=>V.id),R=P.length>0&&F.every(V=>P.includes(V)),z={...n};R?delete z[u]:(z[u]=F,_(u)),e(z)},M=u=>{_(u),c(!0)},G=()=>{c(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:K("w-full md:w-80 border-r border-border flex flex-col",m&&"hidden md:flex"),children:[t.jsx(Xe,{value:f,onChange:x,placeholder:"Search MCP Servers..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>i("all"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>i("selected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>i("unselected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:y.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:f?"No connections found":r==="selected"?"No servers selected":r==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:y.map(u=>{const k=s(u).length,P=n[u.id]?.length??0;return t.jsx(xt,{connection:u,isSelected:v===u.id,hasItemsEnabled:g(u.id),activeItemsCount:P,totalItemsCount:k,onSelect:()=>M(u.id),onToggle:()=>q(u.id)},u.id)})})})]}),t.jsx("div",{className:K("flex-1 flex-col",m?"flex":"hidden md:flex"),children:N?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[t.jsx(J,{variant:"ghost",size:"sm",onClick:G,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(He,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(_e,{icon:N.icon,name:N.title,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:N.title}),N.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:N.description})]})]})]}),l,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:D.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:d||`This connection has no ${o} available`}):t.jsx("div",{className:"space-y-2",children:D.map(u=>t.jsx(ht,{connectionId:N.id,item:u,isSelected:A(N.id,u.id),onToggle:()=>B(N.id,u.id)},u.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",o]})})})]})}function pt(n){return n.stopPropagation()}function gt(n){return n.stopPropagation()}function jt(n){const e=U.c(6),{promptSet:s,onPromptSetChange:o,connectionPrompts:d}=n;let l;e[0]!==d?(l=a=>(d.get(a.id)??[]).map(bt),e[0]=d,e[1]=l):l=e[1];const f=l;let x;return e[2]!==f||e[3]!==o||e[4]!==s?(x=t.jsx(Ge,{itemSet:s,onItemSetChange:o,getItems:f,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=f,e[3]=o,e[4]=s,e[5]=x):x=e[5],x}function bt(n){return{id:n.name,name:n.name,description:n.description}}function yt(n){return n.includes("*")}function vt(n){const e=U.c(27),{patterns:s,onAddPattern:o,onRemovePattern:d}=n,[l,f]=T.useState("");let x;e[0]!==l||e[1]!==o||e[2]!==s?(x=()=>{const c=l.trim();c&&!s.includes(c)&&(o(c),f(""))},e[0]=l,e[1]=o,e[2]=s,e[3]=x):x=e[3];const a=x;let r;e[4]!==a?(r=c=>{c.key==="Enter"&&(c.preventDefault(),a())},e[4]=a,e[5]=r):r=e[5];const i=r;let m;if(e[6]!==a||e[7]!==i||e[8]!==l||e[9]!==d||e[10]!==s){const c=s.filter(yt);let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("code",{children:"*"}),e[12]=j):j=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",j," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=h):h=e[13];let p;e[14]===Symbol.for("react.memo_cache_sentinel")?(p=_=>f(_.target.value),e[14]=p):p=e[14];let b;e[15]!==i||e[16]!==l?(b=t.jsx(we,{value:l,onChange:p,onKeyDown:i,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=i,e[16]=l,e[17]=b):b=e[17];let S;e[18]!==l?(S=l.trim(),e[18]=l,e[19]=S):S=e[19];const w=!S;let g;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ye,{size:16}),e[20]=g):g=e[20];let y;e[21]!==a||e[22]!==w?(y=t.jsx(J,{type:"button",variant:"outline",size:"sm",onClick:a,disabled:w,children:g}),e[21]=a,e[22]=w,e[23]=y):y=e[23];let v;e[24]!==y||e[25]!==b?(v=t.jsxs("div",{className:"flex gap-2",children:[b,y]}),e[24]=y,e[25]=b,e[26]=v):v=e[26],m=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[h,v,c.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:c.map(_=>t.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[t.jsx("code",{className:"text-foreground",children:_}),t.jsx("button",{type:"button",onClick:()=>d(_),className:"text-muted-foreground hover:text-foreground",children:t.jsx(Ze,{size:12})})]},_))})]}),e[6]=a,e[7]=i,e[8]=l,e[9]=d,e[10]=s,e[11]=m}else m=e[11];return m}function St(n){const e=U.c(23),{resourceSet:s,onResourceSetChange:o,connectionResources:d}=n,[l]=T.useState(null);let f;e[0]!==d?(f=g=>(d.get(g.id)??[]).map(Ct),e[0]=d,e[1]=f):f=e[1];const x=f;let a;e[2]!==o||e[3]!==s?(a=(g,y)=>{const v=s[g]??[];v.includes(y)||o({...s,[g]:[...v,y]})},e[2]=o,e[3]=s,e[4]=a):a=e[4];const r=a;let i;e[5]!==o||e[6]!==s?(i=(g,y)=>{const _=(s[g]??[]).filter(N=>N!==y);if(_.length===0){const N={...s};delete N[g],o(N)}else o({...s,[g]:_})},e[5]=o,e[6]=s,e[7]=i):i=e[7];const m=i;let c;e[8]!==o?(c=g=>{o(g)},e[8]=o,e[9]=c):c=e[9];const j=c;let h;e[10]!==s||e[11]!==l?(h=l?s[l]??[]:[],e[10]=s,e[11]=l,e[12]=h):h=e[12];const p=h;let b;e[13]!==r||e[14]!==m||e[15]!==l||e[16]!==p?(b=l?t.jsx(vt,{patterns:p,onAddPattern:g=>r(l,g),onRemovePattern:g=>m(l,g)}):null,e[13]=r,e[14]=m,e[15]=l,e[16]=p,e[17]=b):b=e[17];const S=b;let w;return e[18]!==S||e[19]!==x||e[20]!==j||e[21]!==s?(w=t.jsx("div",{className:"h-full",children:t.jsx(Ge,{itemSet:s,onItemSetChange:j,getItems:x,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:S})}),e[18]=S,e[19]=x,e[20]=j,e[21]=s,e[22]=w):w=e[22],w}function Ct(n){return{id:n.uri,name:n.name||n.uri,description:n.description||n.uri}}function _t(n){const s=new TextEncoder().encode(n),o=Array.from(s,d=>String.fromCharCode(d)).join("");return btoa(o)}function wt(n){const e=U.c(52),{serverName:s,gatewayUrl:o}=n,[d,l]=T.useState(!1),[f,x]=T.useState(null),a=ct(s);let r,i,m,c;if(e[0]!==o||e[1]!==a){const Q={type:"http",url:o},L={[a]:Q};r=JSON.stringify(L,null,2);const W=X=>JSON.stringify({...Q,headers:{"x-mesh-client":X}},null,2),H=_t(W("Cursor"));i=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(a)}&config=${encodeURIComponent(H)}`;const pe=W("Claude Code");m=a;let $;e[6]===Symbol.for("react.memo_cache_sentinel")?($=/'/g,e[6]=$):$=e[6],c=pe.replace($,"'\\''"),e[0]=o,e[1]=a,e[2]=r,e[3]=i,e[4]=m,e[5]=c}else r=e[2],i=e[3],m=e[4],c=e[5];const j=`claude mcp add "${m}" --config '${c}'`;let h;e[7]!==r?(h=async()=>{await navigator.clipboard.writeText(r),l(!0),Ie.success("Configuration copied to clipboard"),setTimeout(()=>l(!1),2e3)},e[7]=r,e[8]=h):h=e[8];const p=h;let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=async(Q,L)=>{await navigator.clipboard.writeText(Q),x(L),Ie.success(`${L} command copied`),setTimeout(()=>x(null),2e3)},e[9]=b):b=e[9];const S=b,w=Nt;let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[10]=g):g=e[10];let y;e[11]!==d?(y=d?t.jsx(Te,{size:14}):t.jsx(ot,{size:14}),e[11]=d,e[12]=y):y=e[12];let v;e[13]!==p||e[14]!==y?(v=t.jsx(de,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:p,children:y})}),e[13]=p,e[14]=y,e[15]=v):v=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(me,{children:"Copy configuration"}),e[16]=_):_=e[16];let N;e[17]!==v?(N=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(ce,{children:t.jsxs(ae,{children:[v,_]})})}),e[17]=v,e[18]=N):N=e[18];let D;e[19]!==r||e[20]!==p?(D=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:p,children:r}),e[19]=r,e[20]=p,e[21]=D):D=e[21];let A;e[22]!==D||e[23]!==N?(A=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[N,D]}),e[22]=D,e[23]=N,e[24]=A):A=e[24];let B;e[25]!==i?(B=()=>w(i),e[25]=i,e[26]=B):B=e[26];let q,M;e[27]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),M=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=q,e[28]=M):(q=e[27],M=e[28]);let G;e[29]!==B?(G=t.jsx(de,{asChild:!0,children:t.jsxs(J,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:B,children:[q,M]})}),e[29]=B,e[30]=G):G=e[30];let u;e[31]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(me,{children:"Add to Cursor"}),e[31]=u):u=e[31];let C;e[32]!==G?(C=t.jsx(ce,{children:t.jsxs(ae,{children:[G,u]})}),e[32]=G,e[33]=C):C=e[33];let k;e[34]!==j?(k=()=>S(j,"Claude"),e[34]=j,e[35]=k):k=e[35];let P,F;e[36]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),F=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=P,e[37]=F):(P=e[36],F=e[37]);let R;e[38]!==f?(R=f==="Claude"&&t.jsx(Te,{size:14,className:"ml-2 text-green-500"}),e[38]=f,e[39]=R):R=e[39];let z;e[40]!==k||e[41]!==R?(z=t.jsx(de,{asChild:!0,children:t.jsxs(J,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:k,children:[P,F,R]})}),e[40]=k,e[41]=R,e[42]=z):z=e[42];let V;e[43]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(me,{children:"Add to Claude Code"}),e[43]=V):V=e[43];let O;e[44]!==z?(O=t.jsx(ce,{children:t.jsxs(ae,{children:[z,V]})}),e[44]=z,e[45]=O):O=e[45];let E;e[46]!==C||e[47]!==O?(E=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[C,O]}),e[46]=C,e[47]=O,e[48]=E):E=e[48];let re;return e[49]!==A||e[50]!==E?(re=t.jsxs("div",{className:"flex flex-col gap-4",children:[g,A,E]}),e[49]=A,e[50]=E,e[51]=re):re=e[51],re}function Nt(n){window.open(n,"_blank")}const It=Ue({title:Ne().min(1,"Name is required").max(255),description:Ne().nullable(),status:Se(["active","inactive"]),tool_selection_mode:Se(["inclusion","exclusion"]),tool_selection_strategy:Se(["passthrough","smart_tool_selection","code_execution"])});function Tt(n,e){const s={};for(const o of n.connections)if(o.selected_tools===null){const d=e.get(o.connection_id)??[];d.length>0&&(s[o.connection_id]=d)}else o.selected_tools.length>0&&(s[o.connection_id]=o.selected_tools);return s}function kt(n){const e={};for(const s of n.connections)s.selected_resources!==null&&s.selected_resources!==void 0&&s.selected_resources.length>0&&(e[s.connection_id]=s.selected_resources);return e}function $t(n){const e={};for(const s of n.connections)s.selected_prompts!==null&&s.selected_prompts!==void 0&&s.selected_prompts.length>0&&(e[s.connection_id]=s.selected_prompts);return e}function Pt(n,e,s,o){const d=new Set([...Object.keys(n),...Object.keys(e),...Object.keys(s)]);return Array.from(d).map(l=>{const f=n[l]??[],x=o.get(l)??[],a=x.length>0&&x.every(r=>f.includes(r));return{connection_id:l,selected_tools:f.length===0||a?null:f,selected_resources:e[l]??null,selected_prompts:s[l]??null}})}function Rt(n){const e=U.c(41),{form:s,gateway:o,icon:d}=n;let l;e[0]!==s?(l=s.watch("title")||"Gateway",e[0]=s,e[1]=l):l=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(lt,{}),e[2]=f):f=e[2];let x;e[3]!==d||e[4]!==l?(x=t.jsx(_e,{icon:d,name:l,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=d,e[4]=l,e[5]=x):x=e[5];let a;e[6]!==s.control?(a=t.jsx(ie,{control:s.control,name:"status",render:Ft}),e[6]=s.control,e[7]=a):a=e[7];let r;e[8]!==x||e[9]!==a?(r=t.jsxs("div",{className:"flex items-start justify-between",children:[x,a]}),e[8]=x,e[9]=a,e[10]=r):r=e[10];let i;e[11]!==s.control?(i=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(ie,{control:s.control,name:"title",render:Dt}),t.jsx(ie,{control:s.control,name:"description",render:Et})]}),e[11]=s.control,e[12]=i):i=e[12];let m;e[13]!==r||e[14]!==i?(m=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[r,i]}),e[13]=r,e[14]=i,e[15]=m):m=e[15];let c;e[16]!==s.control?(c=t.jsxs("div",{className:"flex flex-col gap-4 p-5",children:[t.jsx(ie,{control:s.control,name:"tool_selection_mode",render:At}),t.jsx(ie,{control:s.control,name:"tool_selection_strategy",render:zt})]}),e[16]=s.control,e[17]=c):c=e[17];let j;e[18]!==m||e[19]!==c?(j=t.jsxs("div",{className:"flex flex-col",children:[m,c]}),e[18]=m,e[19]=c,e[20]=j):j=e[20];let h;e[21]!==s||e[22]!==j?(h=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(rt,{...s,children:j})}),e[21]=s,e[22]=j,e[23]=h):h=e[23];let p;e[24]!==o.id||e[25]!==o.title?(p=o.title||`gateway-${o.id.slice(0,8)}`,e[24]=o.id,e[25]=o.title,e[26]=p):p=e[26];const b=`${window.location.origin}/mcp/gateway/${o.id}`;let S;e[27]!==p||e[28]!==b?(S=t.jsx("div",{className:"p-5",children:t.jsx(wt,{serverName:p,gatewayUrl:b})}),e[27]=p,e[28]=b,e[29]=S):S=e[29];let w;e[30]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[30]=w):w=e[30];let g;e[31]!==o.updated_at?(g=o.updated_at?dt(new Date(o.updated_at),{addSuffix:!1}):"Unknown",e[31]=o.updated_at,e[32]=g):g=e[32];let y;e[33]!==g?(y=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[w,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:g})]}),e[33]=g,e[34]=y):y=e[34];let v;e[35]!==S||e[36]!==y?(v=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[S,y]}),e[35]=S,e[36]=y,e[37]=v):v=e[37];let _;return e[38]!==h||e[39]!==v?(_=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[h,v]}),e[38]=h,e[39]=v,e[40]=_):_=e[40],_}function zt(n){const{field:e}=n;return t.jsxs(fe,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Ae,{className:"mb-0",children:"Gateway Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ce,{children:t.jsxs(ae,{children:[t.jsx(de,{asChild:!0,children:t.jsx(J,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Gateway strategy help",children:t.jsx(ze,{size:14,className:"text-muted-foreground"})})}),t.jsx(me,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Passthrough:"})," Pass tools through as-is (default)."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Smart Tool Selection:"})," ","Intelligent tool selection behavior."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Code Execution:"})," Code execution behavior."]})]})})]})}),t.jsxs(Ee,{value:e.value,onValueChange:e.onChange,children:[t.jsx(xe,{children:t.jsx(De,{className:"w-[180px]",children:t.jsx(Fe,{})})}),t.jsxs(Ve,{children:[t.jsx(ue,{value:"passthrough",children:"Passthrough"}),t.jsx(ue,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(ue,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(he,{})]})}function At(n){const{field:e}=n;return t.jsxs(fe,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Ae,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ce,{children:t.jsxs(ae,{children:[t.jsx(de,{asChild:!0,children:t.jsx(J,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(ze,{size:14,className:"text-muted-foreground"})})}),t.jsx(me,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected items are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All items except selected ones are exposed."]})]})})]})}),t.jsxs(Ee,{value:e.value,onValueChange:e.onChange,children:[t.jsx(xe,{children:t.jsx(De,{className:"w-[180px]",children:t.jsx(Fe,{})})}),t.jsxs(Ve,{children:[t.jsx(ue,{value:"inclusion",children:"Include Selected"}),t.jsx(ue,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(he,{})]})}function Et(n){const{field:e}=n;return t.jsxs(fe,{className:"w-full space-y-0",children:[t.jsx(xe,{children:t.jsx(we,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(he,{})]})}function Dt(n){const{field:e}=n;return t.jsxs(fe,{className:"w-full space-y-0",children:[t.jsx(xe,{children:t.jsx(we,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Gateway Name"})}),t.jsx(he,{})]})}function Ft(n){const{field:e}=n;return t.jsxs(fe,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:e.value==="active"?"Active":"Inactive"}),t.jsx(xe,{children:t.jsx(We,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(he,{})]})}function Vt(n){const e=U.c(70),{gateway:s,gatewayId:o,requestedTabId:d}=n,f=Be().location.href,x=Le();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/$org/gateways/$gatewayId"},e[0]=a):a=e[0];const r=ke(a),i=tt();let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m={},e[1]=m):m=e[1];const c=Pe(m);let j;e[2]!==c?(j=c.map(Mt),e[2]=c,e[3]=j):j=e[3];const h=j,{promptsMap:p}=st(h),{resourcesMap:b}=nt(h);let S;if(e[4]!==c){S=new Map;for(const I of c)I.tools&&I.tools.length>0&&S.set(I.id,I.tools.map(Gt));e[4]=c,e[5]=S}else S=e[5];let w;e[6]!==S||e[7]!==s?(w=()=>Tt(s,S),e[6]=S,e[7]=s,e[8]=w):w=e[8];const[g,y]=T.useState(w);let v;e[9]!==s?(v=()=>kt(s),e[9]=s,e[10]=v):v=e[10];const[_,N]=T.useState(v);let D;e[11]!==s?(D=()=>$t(s),e[11]=s,e[12]=D):D=e[12];const[A,B]=T.useState(D),[q,M]=T.useState(!1);let G;e[13]===Symbol.for("react.memo_cache_sentinel")?(G=I=>{y(I),M(!0)},e[13]=G):G=e[13];const u=G;let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=I=>{N(I),M(!0)},e[14]=C):C=e[14];const k=C;let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=I=>{B(I),M(!0)},e[15]=P):P=e[15];const F=P;let R;e[16]===Symbol.for("react.memo_cache_sentinel")?(R=Je(It),e[16]=R):R=e[16];const z=s.tool_selection_mode??"inclusion",V=s.tool_selection_strategy??"passthrough";let O;e[17]!==s.description||e[18]!==s.status||e[19]!==s.title||e[20]!==z||e[21]!==V?(O={resolver:R,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:z,tool_selection_strategy:V}},e[17]=s.description,e[18]=s.status,e[19]=s.title,e[20]=z,e[21]=V,e[22]=O):O=e[22];const E=qe(O),Q=E.formState.isDirty||q;let L;e[23]!==i.update||e[24]!==S||e[25]!==E||e[26]!==o||e[27]!==A||e[28]!==_||e[29]!==g?(L=async()=>{const I=E.getValues(),ve=Pt(g,_,A,S);await i.update.mutateAsync({id:o,data:{title:I.title,description:I.description,status:I.status,tool_selection_mode:I.tool_selection_mode,tool_selection_strategy:I.tool_selection_strategy,connections:ve}}),E.reset(I),M(!1)},e[23]=i.update,e[24]=S,e[25]=E,e[26]=o,e[27]=A,e[28]=_,e[29]=g,e[30]=L):L=e[30];const W=L;let H;e[31]===Symbol.for("react.memo_cache_sentinel")?(H=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[31]=H):H=e[31];const pe=H,$=pe.some(I=>I.id===d)?d:"settings";let X;e[32]!==r?(X=I=>{r({search:ve=>({...ve,tab:I}),replace:!0})},e[32]=r,e[33]=X):X=e[33];const be=X;let Y;e[34]!==x.history?(Y=()=>x.history.back(),e[34]=x.history,e[35]=Y):Y=e[35];let Z;e[36]!==$||e[37]!==be?(Z=t.jsx(mt,{children:t.jsx(it,{tabs:pe,activeTab:$,onTabChange:be})}),e[36]=$,e[37]=be,e[38]=Z):Z=e[38];const ye=s.icon??"cpu_chip";let ee;e[39]!==s.title||e[40]!==ye||e[41]!==f?(ee=t.jsx(at,{title:s.title,url:f,icon:ye}),e[39]=s.title,e[40]=ye,e[41]=f,e[42]=ee):ee=e[42];let te;e[43]!==i.update.isPending||e[44]!==W||e[45]!==Q?(te=Q&&t.jsxs(J,{onClick:W,disabled:i.update.isPending,size:"sm",className:"h-7",children:[i.update.isPending&&t.jsx(Ce,{size:16,className:"mr-2 animate-spin"}),"Save Changes"]}),e[43]=i.update.isPending,e[44]=W,e[45]=Q,e[46]=te):te=e[46];let se;e[47]!==ee||e[48]!==te?(se=t.jsxs(ut,{children:[ee,te]}),e[47]=ee,e[48]=te,e[49]=se):se=e[49];let ge;e[50]===Symbol.for("react.memo_cache_sentinel")?(ge=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Ce,{size:32,className:"animate-spin text-muted-foreground"})}),e[50]=ge):ge=e[50];let ne;e[51]!==$||e[52]!==p||e[53]!==b||e[54]!==E||e[55]!==s||e[56]!==A||e[57]!==_||e[58]!==g?(ne=$==="settings"?t.jsx(Rt,{form:E,gateway:s,icon:s.icon}):$==="tools"?t.jsx(Ke,{toolSet:g,onToolSetChange:u}):$==="resources"?t.jsx(St,{resourceSet:_,onResourceSetChange:k,connectionResources:b}):$==="prompts"?t.jsx(jt,{promptSet:A,onPromptSetChange:F,connectionPrompts:p}):null,e[51]=$,e[52]=p,e[53]=b,e[54]=E,e[55]=s,e[56]=A,e[57]=_,e[58]=g,e[59]=ne):ne=e[59];let oe;e[60]!==ne?(oe=t.jsx(T.Suspense,{fallback:ge,children:ne}),e[60]=ne,e[61]=oe):oe=e[61];let le;e[62]!==$||e[63]!==oe?(le=t.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:t.jsx($e,{children:oe},$)})}),e[62]=$,e[63]=oe,e[64]=le):le=e[64];let je;return e[65]!==Y||e[66]!==Z||e[67]!==se||e[68]!==le?(je=t.jsxs(ft,{onBack:Y,children:[Z,se,le]}),e[65]=Y,e[66]=Z,e[67]=se,e[68]=le,e[69]=je):je=e[69],je}function Gt(n){return n.name}function Mt(n){return n.id}function Ot(){const n=U.c(10);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},n[0]=e):e=n[0];const s=ke(e);let o;n[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/gateways/$gatewayId"},n[1]=o):o=n[1];const{gatewayId:d,org:l}=Me(o);let f;n[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/gateways/$gatewayId"},n[2]=f):f=n[2];const a=Oe(f).tab||"settings",r=et(d);if(!r){let m;return n[3]!==s||n[4]!==l?(m=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Qe,{title:"Gateway not found",description:"This gateway may have been deleted or you may not have access.",actions:t.jsx(J,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:l}}),children:"Back to gateways"})})}),n[3]=s,n[4]=l,n[5]=m):m=n[5],m}let i;return n[6]!==r||n[7]!==d||n[8]!==a?(i=t.jsx(Vt,{gateway:r,gatewayId:d,requestedTabId:a}),n[6]=r,n[7]=d,n[8]=a,n[9]=i):i=n[9],i}function Ut(){const n=U.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx($e,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ot,{})})}),n[0]=e):e=n[0],e}function gs(){const n=U.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ut,{}),n[0]=e):e=n[0],e}export{gs as default};
1
+ import{r as T,c as U,j as t,f as ke,d as Me,b as Oe,v as Ue,a0 as Se,w as Ne,g as Be,av as Le,x as Je,y as qe,t as Ie}from"./index-BdKUt3kP.js";import{E as Qe}from"./SearchMd-BvUmPv0S.js";import{E as $e}from"./error-boundary-NZgBt0kx.js";import{I as _e,u as Pe}from"./use-connection-CAS-EnWk.js";import{T as Ke,S as We}from"./switch-E6khGxvt.js";import{C as Re}from"./checkbox-D-4OB0RT.js";import{c as K,B as J}from"./button-BZJKEz_E.js";import{i as He}from"./ArrowLeft-DdU5giJb.js";import{C as Xe}from"./collection-search-DVqYXnGc.js";import{I as we}from"./input-D4UDXDKp.js";import{s as Ye}from"./Plus-DVuQJsYB.js";import{i as Ze}from"./X-aQ5bBp1-.js";import{b as et,a as tt}from"./use-gateway-Bz5mevBK.js";import{u as st,a as nt}from"./use-connection-resources-DQhL2t6i.js";import{a as ce,c as ae,b as de,T as me,i as Te}from"./tooltip-DGJnwA8J.js";import{a as ot}from"./Copy01-sTNxtLGb.js";import{i as lt}from"./CpuChip02-CBET7vYo.js";import{i as ze}from"./InfoCircle-CoaQA7Cj.js";import{i as Ce}from"./Loading01-BBk1Ji8d.js";import{F as ie,a as rt,b as fe,d as xe,f as he,c as Ae}from"./form-M-gmJwwS.js";import{S as Ee,a as De,b as Fe,c as Ve,d as ue}from"./select-X9N3ceFh.js";import{R as it}from"./resource-tabs-BKx8NMIk.js";import{s as ct}from"./slugify-CEUa2lfQ.js";import{P as at,f as dt}from"./formatDistanceToNow-gygpSZnD.js";import{a as mt,V as ut,b as ft}from"./layout-CPKZZ5C4.js";import"./ChevronDown-AknLh-p8.js";import"./badge-CoAJQK-a.js";import"./use-organization-settings-DhEg0GmX.js";const xt=T.memo(function(e){const s=U.c(20),{connection:o,isSelected:d,hasItemsEnabled:l,activeItemsCount:f,totalItemsCount:x,onSelect:a,onToggle:r}=e,i=d?"bg-accent/50":"hover:bg-muted/50";let m;s[0]!==i?(m=K("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",i),s[0]=i,s[1]=m):m=s[1];let c;s[2]!==o.icon||s[3]!==o.title?(c=t.jsx(_e,{icon:o.icon,name:o.title,size:"xs"}),s[2]=o.icon,s[3]=o.title,s[4]=c):c=s[4];let j;s[5]!==o.title?(j=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.title})}),s[5]=o.title,s[6]=j):j=s[6];let h;s[7]!==a||s[8]!==c||s[9]!==j?(h=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:a,children:[c,j]}),s[7]=a,s[8]=c,s[9]=j,s[10]=h):h=s[10];let p;s[11]!==f||s[12]!==l||s[13]!==r||s[14]!==x?(p=x>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[f,"/",x]}),t.jsx(Re,{checked:l,onCheckedChange:r,onClick:pt})]}),s[11]=f,s[12]=l,s[13]=r,s[14]=x,s[15]=p):p=s[15];let b;return s[16]!==m||s[17]!==h||s[18]!==p?(b=t.jsxs("div",{className:m,children:[h,p]}),s[16]=m,s[17]=h,s[18]=p,s[19]=b):b=s[19],b}),ht=T.memo(function(e){const s=U.c(18),{connectionId:o,item:d,isSelected:l,onToggle:f}=e,x=`item-${o}-${d.id}`,a=l?"text-foreground":"text-muted-foreground";let r;s[0]!==a?(r=K("text-sm font-medium",a),s[0]=a,s[1]=r):r=s[1];let i;s[2]!==d.name||s[3]!==r?(i=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:r,children:d.name})}),s[2]=d.name,s[3]=r,s[4]=i):i=s[4];let m;s[5]!==d.description?(m=d.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:d.description}),s[5]=d.description,s[6]=m):m=s[6];let c;s[7]!==i||s[8]!==m?(c=t.jsxs("div",{className:"flex-1 min-w-0",children:[i,m]}),s[7]=i,s[8]=m,s[9]=c):c=s[9];const j=`item-${o}-${d.id}`;let h;s[10]!==l||s[11]!==f||s[12]!==j?(h=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Re,{id:j,checked:l,onCheckedChange:f,onClick:gt})}),s[10]=l,s[11]=f,s[12]=j,s[13]=h):h=s[13];let p;return s[14]!==x||s[15]!==c||s[16]!==h?(p=t.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:x,children:[c,h]}),s[14]=x,s[15]=c,s[16]=h,s[17]=p):p=s[17],p});function Ge({itemSet:n,onItemSetChange:e,getItems:s,itemLabel:o,emptyItemsMessage:d,extraContent:l}){const[f,x]=T.useState(""),a=T.useDeferredValue(f),[r,i]=T.useState("all"),[m,c]=T.useState(!1),j=T.useRef(new Set(Object.keys(n))),h=Pe({searchTerm:a.trim()||void 0}),p=j.current,b=[...p.values()].map(u=>h.find(C=>C.id===u)).filter(u=>u!==void 0),S=h.filter(u=>!p.has(u.id)),w=[...b,...S],g=u=>{const C=n[u];return C!==void 0&&C.length>0},y=w.filter(u=>{if(r==="all")return!0;const C=g(u.id);return r==="selected"?C:r==="unselected"?!C:!0}),[v,_]=T.useState(w[0]?.id??null),N=v?w.find(u=>u.id===v)??null:null,D=N?s(N):[],A=(u,C)=>n[u]?.includes(C)??!1,B=(u,C)=>{const k=n[u]??[],P=k.includes(C),F={...n};if(P){const R=k.filter(z=>z!==C);R.length===0?delete F[u]:F[u]=R}else F[u]=[...k,C];e(F)},q=u=>{const C=w.find(V=>V.id===u);if(!C)return;const k=s(C);if(k.length===0)return;const P=n[u]??[],F=k.map(V=>V.id),R=P.length>0&&F.every(V=>P.includes(V)),z={...n};R?delete z[u]:(z[u]=F,_(u)),e(z)},M=u=>{_(u),c(!0)},G=()=>{c(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:K("w-full md:w-80 border-r border-border flex flex-col",m&&"hidden md:flex"),children:[t.jsx(Xe,{value:f,onChange:x,placeholder:"Search MCP Servers..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>i("all"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>i("selected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>i("unselected"),className:K("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",r==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:y.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:f?"No connections found":r==="selected"?"No servers selected":r==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:y.map(u=>{const k=s(u).length,P=n[u.id]?.length??0;return t.jsx(xt,{connection:u,isSelected:v===u.id,hasItemsEnabled:g(u.id),activeItemsCount:P,totalItemsCount:k,onSelect:()=>M(u.id),onToggle:()=>q(u.id)},u.id)})})})]}),t.jsx("div",{className:K("flex-1 flex-col",m?"flex":"hidden md:flex"),children:N?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[t.jsx(J,{variant:"ghost",size:"sm",onClick:G,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(He,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(_e,{icon:N.icon,name:N.title,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:N.title}),N.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:N.description})]})]})]}),l,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:D.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:d||`This connection has no ${o} available`}):t.jsx("div",{className:"space-y-2",children:D.map(u=>t.jsx(ht,{connectionId:N.id,item:u,isSelected:A(N.id,u.id),onToggle:()=>B(N.id,u.id)},u.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",o]})})})]})}function pt(n){return n.stopPropagation()}function gt(n){return n.stopPropagation()}function jt(n){const e=U.c(6),{promptSet:s,onPromptSetChange:o,connectionPrompts:d}=n;let l;e[0]!==d?(l=a=>(d.get(a.id)??[]).map(bt),e[0]=d,e[1]=l):l=e[1];const f=l;let x;return e[2]!==f||e[3]!==o||e[4]!==s?(x=t.jsx(Ge,{itemSet:s,onItemSetChange:o,getItems:f,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=f,e[3]=o,e[4]=s,e[5]=x):x=e[5],x}function bt(n){return{id:n.name,name:n.name,description:n.description}}function yt(n){return n.includes("*")}function vt(n){const e=U.c(27),{patterns:s,onAddPattern:o,onRemovePattern:d}=n,[l,f]=T.useState("");let x;e[0]!==l||e[1]!==o||e[2]!==s?(x=()=>{const c=l.trim();c&&!s.includes(c)&&(o(c),f(""))},e[0]=l,e[1]=o,e[2]=s,e[3]=x):x=e[3];const a=x;let r;e[4]!==a?(r=c=>{c.key==="Enter"&&(c.preventDefault(),a())},e[4]=a,e[5]=r):r=e[5];const i=r;let m;if(e[6]!==a||e[7]!==i||e[8]!==l||e[9]!==d||e[10]!==s){const c=s.filter(yt);let j;e[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("code",{children:"*"}),e[12]=j):j=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",j," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=h):h=e[13];let p;e[14]===Symbol.for("react.memo_cache_sentinel")?(p=_=>f(_.target.value),e[14]=p):p=e[14];let b;e[15]!==i||e[16]!==l?(b=t.jsx(we,{value:l,onChange:p,onKeyDown:i,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=i,e[16]=l,e[17]=b):b=e[17];let S;e[18]!==l?(S=l.trim(),e[18]=l,e[19]=S):S=e[19];const w=!S;let g;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ye,{size:16}),e[20]=g):g=e[20];let y;e[21]!==a||e[22]!==w?(y=t.jsx(J,{type:"button",variant:"outline",size:"sm",onClick:a,disabled:w,children:g}),e[21]=a,e[22]=w,e[23]=y):y=e[23];let v;e[24]!==y||e[25]!==b?(v=t.jsxs("div",{className:"flex gap-2",children:[b,y]}),e[24]=y,e[25]=b,e[26]=v):v=e[26],m=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[h,v,c.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:c.map(_=>t.jsxs("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted rounded-md text-xs",children:[t.jsx("code",{className:"text-foreground",children:_}),t.jsx("button",{type:"button",onClick:()=>d(_),className:"text-muted-foreground hover:text-foreground",children:t.jsx(Ze,{size:12})})]},_))})]}),e[6]=a,e[7]=i,e[8]=l,e[9]=d,e[10]=s,e[11]=m}else m=e[11];return m}function St(n){const e=U.c(23),{resourceSet:s,onResourceSetChange:o,connectionResources:d}=n,[l]=T.useState(null);let f;e[0]!==d?(f=g=>(d.get(g.id)??[]).map(Ct),e[0]=d,e[1]=f):f=e[1];const x=f;let a;e[2]!==o||e[3]!==s?(a=(g,y)=>{const v=s[g]??[];v.includes(y)||o({...s,[g]:[...v,y]})},e[2]=o,e[3]=s,e[4]=a):a=e[4];const r=a;let i;e[5]!==o||e[6]!==s?(i=(g,y)=>{const _=(s[g]??[]).filter(N=>N!==y);if(_.length===0){const N={...s};delete N[g],o(N)}else o({...s,[g]:_})},e[5]=o,e[6]=s,e[7]=i):i=e[7];const m=i;let c;e[8]!==o?(c=g=>{o(g)},e[8]=o,e[9]=c):c=e[9];const j=c;let h;e[10]!==s||e[11]!==l?(h=l?s[l]??[]:[],e[10]=s,e[11]=l,e[12]=h):h=e[12];const p=h;let b;e[13]!==r||e[14]!==m||e[15]!==l||e[16]!==p?(b=l?t.jsx(vt,{patterns:p,onAddPattern:g=>r(l,g),onRemovePattern:g=>m(l,g)}):null,e[13]=r,e[14]=m,e[15]=l,e[16]=p,e[17]=b):b=e[17];const S=b;let w;return e[18]!==S||e[19]!==x||e[20]!==j||e[21]!==s?(w=t.jsx("div",{className:"h-full",children:t.jsx(Ge,{itemSet:s,onItemSetChange:j,getItems:x,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:S})}),e[18]=S,e[19]=x,e[20]=j,e[21]=s,e[22]=w):w=e[22],w}function Ct(n){return{id:n.uri,name:n.name||n.uri,description:n.description||n.uri}}function _t(n){const s=new TextEncoder().encode(n),o=Array.from(s,d=>String.fromCharCode(d)).join("");return btoa(o)}function wt(n){const e=U.c(52),{serverName:s,gatewayUrl:o}=n,[d,l]=T.useState(!1),[f,x]=T.useState(null),a=ct(s);let r,i,m,c;if(e[0]!==o||e[1]!==a){const Q={type:"http",url:o},L={[a]:Q};r=JSON.stringify(L,null,2);const W=X=>JSON.stringify({...Q,headers:{"x-mesh-client":X}},null,2),H=_t(W("Cursor"));i=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(a)}&config=${encodeURIComponent(H)}`;const pe=W("Claude Code");m=a;let $;e[6]===Symbol.for("react.memo_cache_sentinel")?($=/'/g,e[6]=$):$=e[6],c=pe.replace($,"'\\''"),e[0]=o,e[1]=a,e[2]=r,e[3]=i,e[4]=m,e[5]=c}else r=e[2],i=e[3],m=e[4],c=e[5];const j=`claude mcp add "${m}" --config '${c}'`;let h;e[7]!==r?(h=async()=>{await navigator.clipboard.writeText(r),l(!0),Ie.success("Configuration copied to clipboard"),setTimeout(()=>l(!1),2e3)},e[7]=r,e[8]=h):h=e[8];const p=h;let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=async(Q,L)=>{await navigator.clipboard.writeText(Q),x(L),Ie.success(`${L} command copied`),setTimeout(()=>x(null),2e3)},e[9]=b):b=e[9];const S=b,w=Nt;let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[10]=g):g=e[10];let y;e[11]!==d?(y=d?t.jsx(Te,{size:14}):t.jsx(ot,{size:14}),e[11]=d,e[12]=y):y=e[12];let v;e[13]!==p||e[14]!==y?(v=t.jsx(de,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:p,children:y})}),e[13]=p,e[14]=y,e[15]=v):v=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(me,{children:"Copy configuration"}),e[16]=_):_=e[16];let N;e[17]!==v?(N=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(ce,{children:t.jsxs(ae,{children:[v,_]})})}),e[17]=v,e[18]=N):N=e[18];let D;e[19]!==r||e[20]!==p?(D=t.jsx("pre",{className:"text-xs font-mono text-foreground overflow-auto max-h-40 whitespace-pre-wrap wrap-break-word cursor-pointer",onClick:p,children:r}),e[19]=r,e[20]=p,e[21]=D):D=e[21];let A;e[22]!==D||e[23]!==N?(A=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[N,D]}),e[22]=D,e[23]=N,e[24]=A):A=e[24];let B;e[25]!==i?(B=()=>w(i),e[25]=i,e[26]=B):B=e[26];let q,M;e[27]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),M=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=q,e[28]=M):(q=e[27],M=e[28]);let G;e[29]!==B?(G=t.jsx(de,{asChild:!0,children:t.jsxs(J,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:B,children:[q,M]})}),e[29]=B,e[30]=G):G=e[30];let u;e[31]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(me,{children:"Add to Cursor"}),e[31]=u):u=e[31];let C;e[32]!==G?(C=t.jsx(ce,{children:t.jsxs(ae,{children:[G,u]})}),e[32]=G,e[33]=C):C=e[33];let k;e[34]!==j?(k=()=>S(j,"Claude"),e[34]=j,e[35]=k):k=e[35];let P,F;e[36]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-6 w-6",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),F=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=P,e[37]=F):(P=e[36],F=e[37]);let R;e[38]!==f?(R=f==="Claude"&&t.jsx(Te,{size:14,className:"ml-2 text-green-500"}),e[38]=f,e[39]=R):R=e[39];let z;e[40]!==k||e[41]!==R?(z=t.jsx(de,{asChild:!0,children:t.jsxs(J,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:k,children:[P,F,R]})}),e[40]=k,e[41]=R,e[42]=z):z=e[42];let V;e[43]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(me,{children:"Add to Claude Code"}),e[43]=V):V=e[43];let O;e[44]!==z?(O=t.jsx(ce,{children:t.jsxs(ae,{children:[z,V]})}),e[44]=z,e[45]=O):O=e[45];let E;e[46]!==C||e[47]!==O?(E=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[C,O]}),e[46]=C,e[47]=O,e[48]=E):E=e[48];let re;return e[49]!==A||e[50]!==E?(re=t.jsxs("div",{className:"flex flex-col gap-4",children:[g,A,E]}),e[49]=A,e[50]=E,e[51]=re):re=e[51],re}function Nt(n){window.open(n,"_blank")}const It=Ue({title:Ne().min(1,"Name is required").max(255),description:Ne().nullable(),status:Se(["active","inactive"]),tool_selection_mode:Se(["inclusion","exclusion"]),tool_selection_strategy:Se(["passthrough","smart_tool_selection","code_execution"])});function Tt(n,e){const s={};for(const o of n.connections)if(o.selected_tools===null){const d=e.get(o.connection_id)??[];d.length>0&&(s[o.connection_id]=d)}else o.selected_tools.length>0&&(s[o.connection_id]=o.selected_tools);return s}function kt(n){const e={};for(const s of n.connections)s.selected_resources!==null&&s.selected_resources!==void 0&&s.selected_resources.length>0&&(e[s.connection_id]=s.selected_resources);return e}function $t(n){const e={};for(const s of n.connections)s.selected_prompts!==null&&s.selected_prompts!==void 0&&s.selected_prompts.length>0&&(e[s.connection_id]=s.selected_prompts);return e}function Pt(n,e,s,o){const d=new Set([...Object.keys(n),...Object.keys(e),...Object.keys(s)]);return Array.from(d).map(l=>{const f=n[l]??[],x=o.get(l)??[],a=x.length>0&&x.every(r=>f.includes(r));return{connection_id:l,selected_tools:f.length===0||a?null:f,selected_resources:e[l]??null,selected_prompts:s[l]??null}})}function Rt(n){const e=U.c(41),{form:s,gateway:o,icon:d}=n;let l;e[0]!==s?(l=s.watch("title")||"Gateway",e[0]=s,e[1]=l):l=e[1];let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(lt,{}),e[2]=f):f=e[2];let x;e[3]!==d||e[4]!==l?(x=t.jsx(_e,{icon:d,name:l,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=d,e[4]=l,e[5]=x):x=e[5];let a;e[6]!==s.control?(a=t.jsx(ie,{control:s.control,name:"status",render:Ft}),e[6]=s.control,e[7]=a):a=e[7];let r;e[8]!==x||e[9]!==a?(r=t.jsxs("div",{className:"flex items-start justify-between",children:[x,a]}),e[8]=x,e[9]=a,e[10]=r):r=e[10];let i;e[11]!==s.control?(i=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(ie,{control:s.control,name:"title",render:Dt}),t.jsx(ie,{control:s.control,name:"description",render:Et})]}),e[11]=s.control,e[12]=i):i=e[12];let m;e[13]!==r||e[14]!==i?(m=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[r,i]}),e[13]=r,e[14]=i,e[15]=m):m=e[15];let c;e[16]!==s.control?(c=t.jsxs("div",{className:"flex flex-col gap-4 p-5",children:[t.jsx(ie,{control:s.control,name:"tool_selection_mode",render:At}),t.jsx(ie,{control:s.control,name:"tool_selection_strategy",render:zt})]}),e[16]=s.control,e[17]=c):c=e[17];let j;e[18]!==m||e[19]!==c?(j=t.jsxs("div",{className:"flex flex-col",children:[m,c]}),e[18]=m,e[19]=c,e[20]=j):j=e[20];let h;e[21]!==s||e[22]!==j?(h=t.jsx("div",{className:"lg:border-r border-b lg:border-b-0 border-border overflow-auto",children:t.jsx(rt,{...s,children:j})}),e[21]=s,e[22]=j,e[23]=h):h=e[23];let p;e[24]!==o.id||e[25]!==o.title?(p=o.title||`gateway-${o.id.slice(0,8)}`,e[24]=o.id,e[25]=o.title,e[26]=p):p=e[26];const b=`${window.location.origin}/mcp/gateway/${o.id}`;let S;e[27]!==p||e[28]!==b?(S=t.jsx("div",{className:"p-5",children:t.jsx(wt,{serverName:p,gatewayUrl:b})}),e[27]=p,e[28]=b,e[29]=S):S=e[29];let w;e[30]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[30]=w):w=e[30];let g;e[31]!==o.updated_at?(g=o.updated_at?dt(new Date(o.updated_at),{addSuffix:!1}):"Unknown",e[31]=o.updated_at,e[32]=g):g=e[32];let y;e[33]!==g?(y=t.jsxs("div",{className:"flex items-center gap-4 p-5 border-t border-border",children:[w,t.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:g})]}),e[33]=g,e[34]=y):y=e[34];let v;e[35]!==S||e[36]!==y?(v=t.jsxs("div",{className:"flex flex-col overflow-auto",children:[S,y]}),e[35]=S,e[36]=y,e[37]=v):v=e[37];let _;return e[38]!==h||e[39]!==v?(_=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[2fr_1fr] h-full",children:[h,v]}),e[38]=h,e[39]=v,e[40]=_):_=e[40],_}function zt(n){const{field:e}=n;return t.jsxs(fe,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Ae,{className:"mb-0",children:"Gateway Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ce,{children:t.jsxs(ae,{children:[t.jsx(de,{asChild:!0,children:t.jsx(J,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Gateway strategy help",children:t.jsx(ze,{size:14,className:"text-muted-foreground"})})}),t.jsx(me,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Passthrough:"})," Pass tools through as-is (default)."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Smart Tool Selection:"})," ","Intelligent tool selection behavior."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Code Execution:"})," Code execution behavior."]})]})})]})}),t.jsxs(Ee,{value:e.value,onValueChange:e.onChange,children:[t.jsx(xe,{children:t.jsx(De,{className:"w-[180px]",children:t.jsx(Fe,{})})}),t.jsxs(Ve,{children:[t.jsx(ue,{value:"passthrough",children:"Passthrough"}),t.jsx(ue,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(ue,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(he,{})]})}function At(n){const{field:e}=n;return t.jsxs(fe,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Ae,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ce,{children:t.jsxs(ae,{children:[t.jsx(de,{asChild:!0,children:t.jsx(J,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(ze,{size:14,className:"text-muted-foreground"})})}),t.jsx(me,{side:"left",className:"max-w-sm",children:t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{children:[t.jsx("strong",{children:"Include:"})," Only selected items are exposed."]}),t.jsxs("div",{children:[t.jsx("strong",{children:"Exclude:"})," All items except selected ones are exposed."]})]})})]})}),t.jsxs(Ee,{value:e.value,onValueChange:e.onChange,children:[t.jsx(xe,{children:t.jsx(De,{className:"w-[180px]",children:t.jsx(Fe,{})})}),t.jsxs(Ve,{children:[t.jsx(ue,{value:"inclusion",children:"Include Selected"}),t.jsx(ue,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(he,{})]})}function Et(n){const{field:e}=n;return t.jsxs(fe,{className:"w-full space-y-0",children:[t.jsx(xe,{children:t.jsx(we,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(he,{})]})}function Dt(n){const{field:e}=n;return t.jsxs(fe,{className:"w-full space-y-0",children:[t.jsx(xe,{children:t.jsx(we,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Gateway Name"})}),t.jsx(he,{})]})}function Ft(n){const{field:e}=n;return t.jsxs(fe,{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:e.value==="active"?"Active":"Inactive"}),t.jsx(xe,{children:t.jsx(We,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(he,{})]})}function Vt(n){const e=U.c(70),{gateway:s,gatewayId:o,requestedTabId:d}=n,f=Be().location.href,x=Le();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/$org/gateways/$gatewayId"},e[0]=a):a=e[0];const r=ke(a),i=tt();let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m={},e[1]=m):m=e[1];const c=Pe(m);let j;e[2]!==c?(j=c.map(Mt),e[2]=c,e[3]=j):j=e[3];const h=j,{promptsMap:p}=st(h),{resourcesMap:b}=nt(h);let S;if(e[4]!==c){S=new Map;for(const I of c)I.tools&&I.tools.length>0&&S.set(I.id,I.tools.map(Gt));e[4]=c,e[5]=S}else S=e[5];let w;e[6]!==S||e[7]!==s?(w=()=>Tt(s,S),e[6]=S,e[7]=s,e[8]=w):w=e[8];const[g,y]=T.useState(w);let v;e[9]!==s?(v=()=>kt(s),e[9]=s,e[10]=v):v=e[10];const[_,N]=T.useState(v);let D;e[11]!==s?(D=()=>$t(s),e[11]=s,e[12]=D):D=e[12];const[A,B]=T.useState(D),[q,M]=T.useState(!1);let G;e[13]===Symbol.for("react.memo_cache_sentinel")?(G=I=>{y(I),M(!0)},e[13]=G):G=e[13];const u=G;let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=I=>{N(I),M(!0)},e[14]=C):C=e[14];const k=C;let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=I=>{B(I),M(!0)},e[15]=P):P=e[15];const F=P;let R;e[16]===Symbol.for("react.memo_cache_sentinel")?(R=Je(It),e[16]=R):R=e[16];const z=s.tool_selection_mode??"inclusion",V=s.tool_selection_strategy??"passthrough";let O;e[17]!==s.description||e[18]!==s.status||e[19]!==s.title||e[20]!==z||e[21]!==V?(O={resolver:R,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:z,tool_selection_strategy:V}},e[17]=s.description,e[18]=s.status,e[19]=s.title,e[20]=z,e[21]=V,e[22]=O):O=e[22];const E=qe(O),Q=E.formState.isDirty||q;let L;e[23]!==i.update||e[24]!==S||e[25]!==E||e[26]!==o||e[27]!==A||e[28]!==_||e[29]!==g?(L=async()=>{const I=E.getValues(),ve=Pt(g,_,A,S);await i.update.mutateAsync({id:o,data:{title:I.title,description:I.description,status:I.status,tool_selection_mode:I.tool_selection_mode,tool_selection_strategy:I.tool_selection_strategy,connections:ve}}),E.reset(I),M(!1)},e[23]=i.update,e[24]=S,e[25]=E,e[26]=o,e[27]=A,e[28]=_,e[29]=g,e[30]=L):L=e[30];const W=L;let H;e[31]===Symbol.for("react.memo_cache_sentinel")?(H=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[31]=H):H=e[31];const pe=H,$=pe.some(I=>I.id===d)?d:"settings";let X;e[32]!==r?(X=I=>{r({search:ve=>({...ve,tab:I}),replace:!0})},e[32]=r,e[33]=X):X=e[33];const be=X;let Y;e[34]!==x.history?(Y=()=>x.history.back(),e[34]=x.history,e[35]=Y):Y=e[35];let Z;e[36]!==$||e[37]!==be?(Z=t.jsx(mt,{children:t.jsx(it,{tabs:pe,activeTab:$,onTabChange:be})}),e[36]=$,e[37]=be,e[38]=Z):Z=e[38];const ye=s.icon??"cpu_chip";let ee;e[39]!==s.title||e[40]!==ye||e[41]!==f?(ee=t.jsx(at,{title:s.title,url:f,icon:ye}),e[39]=s.title,e[40]=ye,e[41]=f,e[42]=ee):ee=e[42];let te;e[43]!==i.update.isPending||e[44]!==W||e[45]!==Q?(te=Q&&t.jsxs(J,{onClick:W,disabled:i.update.isPending,size:"sm",className:"h-7",children:[i.update.isPending&&t.jsx(Ce,{size:16,className:"mr-2 animate-spin"}),"Save Changes"]}),e[43]=i.update.isPending,e[44]=W,e[45]=Q,e[46]=te):te=e[46];let se;e[47]!==ee||e[48]!==te?(se=t.jsxs(ut,{children:[ee,te]}),e[47]=ee,e[48]=te,e[49]=se):se=e[49];let ge;e[50]===Symbol.for("react.memo_cache_sentinel")?(ge=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Ce,{size:32,className:"animate-spin text-muted-foreground"})}),e[50]=ge):ge=e[50];let ne;e[51]!==$||e[52]!==p||e[53]!==b||e[54]!==E||e[55]!==s||e[56]!==A||e[57]!==_||e[58]!==g?(ne=$==="settings"?t.jsx(Rt,{form:E,gateway:s,icon:s.icon}):$==="tools"?t.jsx(Ke,{toolSet:g,onToolSetChange:u}):$==="resources"?t.jsx(St,{resourceSet:_,onResourceSetChange:k,connectionResources:b}):$==="prompts"?t.jsx(jt,{promptSet:A,onPromptSetChange:F,connectionPrompts:p}):null,e[51]=$,e[52]=p,e[53]=b,e[54]=E,e[55]=s,e[56]=A,e[57]=_,e[58]=g,e[59]=ne):ne=e[59];let oe;e[60]!==ne?(oe=t.jsx(T.Suspense,{fallback:ge,children:ne}),e[60]=ne,e[61]=oe):oe=e[61];let le;e[62]!==$||e[63]!==oe?(le=t.jsx("div",{className:"flex h-full w-full bg-background overflow-hidden",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-auto",children:t.jsx($e,{children:oe},$)})}),e[62]=$,e[63]=oe,e[64]=le):le=e[64];let je;return e[65]!==Y||e[66]!==Z||e[67]!==se||e[68]!==le?(je=t.jsxs(ft,{onBack:Y,children:[Z,se,le]}),e[65]=Y,e[66]=Z,e[67]=se,e[68]=le,e[69]=je):je=e[69],je}function Gt(n){return n.name}function Mt(n){return n.id}function Ot(){const n=U.c(10);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},n[0]=e):e=n[0];const s=ke(e);let o;n[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/gateways/$gatewayId"},n[1]=o):o=n[1];const{gatewayId:d,org:l}=Me(o);let f;n[2]===Symbol.for("react.memo_cache_sentinel")?(f={from:"/shell/$org/gateways/$gatewayId"},n[2]=f):f=n[2];const a=Oe(f).tab||"settings",r=et(d);if(!r){let m;return n[3]!==s||n[4]!==l?(m=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Qe,{title:"Gateway not found",description:"This gateway may have been deleted or you may not have access.",actions:t.jsx(J,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:l}}),children:"Back to gateways"})})}),n[3]=s,n[4]=l,n[5]=m):m=n[5],m}let i;return n[6]!==r||n[7]!==d||n[8]!==a?(i=t.jsx(Vt,{gateway:r,gatewayId:d,requestedTabId:a}),n[6]=r,n[7]=d,n[8]=a,n[9]=i):i=n[9],i}function Ut(){const n=U.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx($e,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ot,{})})}),n[0]=e):e=n[0],e}function gs(){const n=U.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ut,{}),n[0]=e):e=n[0],e}export{gs as default};