@decocms/mesh 2.4.0 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/client/assets/{AlertCircle-BZ4bvRfi.js → AlertCircle-CZPV4eTQ.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-CoE0Hi8I.js → ArrowLeft-DQOG1GuJ.js} +1 -1
  3. package/dist/client/assets/{ChevronDown-Bd6n8txO.js → ChevronDown-Cdy__m-8.js} +1 -1
  4. package/dist/client/assets/{ChevronRight-Bc43l_p6.js → ChevronRight-SzPzGSNO.js} +1 -1
  5. package/dist/client/assets/{Copy01-BTTTCefb.js → Copy01-DS49wIzW.js} +1 -1
  6. package/dist/client/assets/{DotsHorizontal-Dh410BM1.js → DotsHorizontal-BSoB0mo2.js} +1 -1
  7. package/dist/client/assets/{DotsVertical-C-Nfqo18.js → DotsVertical-eZBspOrA.js} +1 -1
  8. package/dist/client/assets/{File06-td5gmARz.js → File06-CUqAuIUq.js} +1 -1
  9. package/dist/client/assets/{FilterLines-nczF4lnr.js → FilterLines-BTBF9JAn.js} +1 -1
  10. package/dist/client/assets/{FlipBackward-BLl0wh4k.js → FlipBackward-BRcPqCms.js} +1 -1
  11. package/dist/client/assets/{GitBranch01-38L6KUpt.js → GitBranch01-DovnqKJf.js} +1 -1
  12. package/dist/client/assets/{Grid01-Dl_1kAd5.js → Grid01-R-k411L-.js} +1 -1
  13. package/dist/client/assets/{Inbox01-CDma1les.js → Inbox01-bvdCozgs.js} +1 -1
  14. package/dist/client/assets/{InfoCircle-D8z5_ZlN.js → InfoCircle-r2yyYHHv.js} +1 -1
  15. package/dist/client/assets/{Key01-Cn9byqjY.js → Key01-BWe_1dg2.js} +1 -1
  16. package/dist/client/assets/{LinkExternal01-BP_6WzCI.js → LinkExternal01-BklnopGx.js} +1 -1
  17. package/dist/client/assets/{Loading01-5lHx4rM1.js → Loading01-C0_l8AxO.js} +1 -1
  18. package/dist/client/assets/{Lock01-S5DjMaRE.js → Lock01-C7_8eECJ.js} +1 -1
  19. package/dist/client/assets/{Play-DIUg73qU.js → Play-CWJY4nY_.js} +1 -1
  20. package/dist/client/assets/{Plus-wptRVGuY.js → Plus-KTlOMNSY.js} +1 -1
  21. package/dist/client/assets/{Terminal-BC7AwEkQ.js → Terminal-DDfP4x2i.js} +1 -1
  22. package/dist/client/assets/{Trash01-DMq1QD3Y.js → Trash01-BMJLKtdF.js} +1 -1
  23. package/dist/client/assets/{X-C6XvUpZP.js → X-BFdZnqth.js} +1 -1
  24. package/dist/client/assets/{XClose-Cb-zeLTZ.js → XClose-DTyQuBBY.js} +1 -1
  25. package/dist/client/assets/{alert-dialog-BJHrUd_j.js → alert-dialog-Dz8Vs8_m.js} +1 -1
  26. package/dist/client/assets/{auth-BIu7r9Ac.js → auth-CJNQiaii.js} +1 -1
  27. package/dist/client/assets/{auth-catchall-DC241-OB.js → auth-catchall-qU76xBKm.js} +1 -1
  28. package/dist/client/assets/{avatar-CLQivMfK.js → avatar-D4SXwEgs.js} +1 -1
  29. package/dist/client/assets/{badge-DQeqBGBY.js → badge-99kEJDtp.js} +1 -1
  30. package/dist/client/assets/{card-DCkJD1G_.js → card-DZuxbKf1.js} +1 -1
  31. package/dist/client/assets/{checkbox-BPcJKnx2.js → checkbox-Bp9oZUjM.js} +1 -1
  32. package/dist/client/assets/{collection-detail-BUFgqbfO.js → collection-detail-BB7cjHq1.js} +1 -1
  33. package/dist/client/assets/{collection-display-button-BT-sOTV4.js → collection-display-button-CqzsQ6A1.js} +1 -1
  34. package/dist/client/assets/{collection-header-Bf2EdT32.js → collection-header-BQqQNO9q.js} +1 -1
  35. package/dist/client/assets/{collection-page-C8XZ4WVW.js → collection-page-DlOERJnr.js} +1 -1
  36. package/dist/client/assets/{collection-search-UsqkgDWW.js → collection-search-CIs95Rnw.js} +1 -1
  37. package/dist/client/assets/{collection-tab-BOGtz91v.js → collection-tab-BPPicFWO.js} +1 -1
  38. package/dist/client/assets/{collection-table-wrapper-DXxcxGiG.js → collection-table-wrapper-D1OlmFUL.js} +1 -1
  39. package/dist/client/assets/{connection-card-uFFVVLla.js → connection-card-Dm43-Wul.js} +1 -1
  40. package/dist/client/assets/{connection-detail-C1_qwCFU.js → connection-detail-DXNZMYLL.js} +1 -1
  41. package/dist/client/assets/{connections-DK3N1G3E.js → connections-BB4IEP_5.js} +1 -1
  42. package/dist/client/assets/constants-BSLIcG1u.js +1 -0
  43. package/dist/client/assets/{create-organization-dialog-D5-XNsnx.js → create-organization-dialog-miyo8zQR.js} +1 -1
  44. package/dist/client/assets/{dialog-Ib7U8pHy.js → dialog-DK6VaggX.js} +1 -1
  45. package/dist/client/assets/{dropdown-menu-BiS4AW--.js → dropdown-menu-DTGJCwi0.js} +1 -1
  46. package/dist/client/assets/{empty-state-DClJbSUV.js → empty-state-DVGQ1BWZ.js} +1 -1
  47. package/dist/client/assets/{env-vars-editor-BoJcH29X.js → env-vars-editor-BG99RDNZ.js} +1 -1
  48. package/dist/client/assets/error-boundary-9rVpFVah.js +1 -0
  49. package/dist/client/assets/{extract-connection-data-jQgimjIZ.js → extract-connection-data-E0zDRO9-.js} +1 -1
  50. package/dist/client/assets/{form-BuxbGg5N.js → form-BGufVhpJ.js} +1 -1
  51. package/dist/client/assets/{gateway-detail-Dc2FefpC.js → gateway-detail-IUdVxLB4.js} +1 -1
  52. package/dist/client/assets/{gateway-selector-D3Qx1Iib.js → gateway-selector-CuwGVcxw.js} +1 -1
  53. package/dist/client/assets/{gateways-DpUjszQm.js → gateways-BA7lpBES.js} +1 -1
  54. package/dist/client/assets/{home-DNXIjorG.js → home-B5o9i0BD.js} +1 -1
  55. package/dist/client/assets/{index-B8j3yBaa.js → index-CaBiIG-r.js} +1 -1
  56. package/dist/client/assets/{index-DZBFXaT_.js → index-DHr9tFb0.js} +26 -26
  57. package/dist/client/assets/{index-Ci11bImk.js → index-Rcp5vvtf.js} +1 -1
  58. package/dist/client/assets/{input-KWjuSjzn.js → input-C4WvdKkR.js} +1 -1
  59. package/dist/client/assets/{layout-B02TxUA9.js → layout-9R3rtCy3.js} +1 -1
  60. package/dist/client/assets/{lazy-highlighter-BVbwM6hf.js → lazy-highlighter-rNRrmjMV.js} +1 -1
  61. package/dist/client/assets/{localstorage-keys-ziXXhpvN.js → localstorage-keys-DrIZl-Oa.js} +1 -1
  62. package/dist/client/assets/{login-B5NkbJv_.js → login-CaUUYoaL.js} +1 -1
  63. package/dist/client/assets/{mcp-oauth-C-LpRTvB.js → mcp-oauth-BPterAhB.js} +1 -1
  64. package/dist/client/assets/{mcp-server-detail-CFf8gW0D.js → mcp-server-detail-BmtUegeN.js} +1 -1
  65. package/dist/client/assets/{members-ZCeYH7ZZ.js → members-Dha-TTi3.js} +1 -1
  66. package/dist/client/assets/{monaco-editor-BmgaGs_i.js → monaco-editor-fWj67pSD.js} +1 -1
  67. package/dist/client/assets/{monitoring-Ct3-0i82.js → monitoring-BHqKCRpc.js} +1 -1
  68. package/dist/client/assets/{oauth-callback-BvCvOyK1.js → oauth-callback-C8SrcUYM.js} +1 -1
  69. package/dist/client/assets/page-CB2Kbqif.js +35 -0
  70. package/dist/client/assets/{page-CLwNDLuV.js → page-D_pWRusE.js} +1 -1
  71. package/dist/client/assets/{pin-to-sidebar-button-CeunWdra.js → pin-to-sidebar-button-Bau5uIKK.js} +1 -1
  72. package/dist/client/assets/{popover-CYHZWxlr.js → popover-B1hj_ypq.js} +1 -1
  73. package/dist/client/assets/{project-context-provider-6vMfUBpq.js → project-context-provider-SYQQWwHt.js} +1 -1
  74. package/dist/client/assets/{resizable-DSb7rXgM.js → resizable-oOXY1Kb2.js} +1 -1
  75. package/dist/client/assets/{resource-tabs-ChCUbmUR.js → resource-tabs-DXcOsIua.js} +1 -1
  76. package/dist/client/assets/{select-bHRpmvzh.js → select-58kzPmSH.js} +1 -1
  77. package/dist/client/assets/{settings-Czh6I7v0.js → settings-C8uZUL9P.js} +1 -1
  78. package/dist/client/assets/{shell-layout-DYtHZc0q.js → shell-layout-BXan9A9l.js} +1 -1
  79. package/dist/client/assets/{spinner-A1jsF1CN.js → spinner-BmiYLJkt.js} +1 -1
  80. package/dist/client/assets/{switch-RYFLASzA.js → switch-D3qS-cJT.js} +1 -1
  81. package/dist/client/assets/{textarea-_Mx18lUV.js → textarea-KpHZNzGY.js} +1 -1
  82. package/dist/client/assets/{thread-history-popover-CbjIrBTu.js → thread-history-popover-DrZ24omE.js} +4 -4
  83. package/dist/client/assets/{tools-list-DqY4kR2l.js → tools-list-BQ6I_zS0.js} +1 -1
  84. package/dist/client/assets/{use-binding-Dh7eSguQ.js → use-binding-DxCldqD_.js} +9 -9
  85. package/dist/client/assets/{use-connection-BVMsW9fR.js → use-connection-gZqQ1FAI.js} +1 -1
  86. package/dist/client/assets/{use-connection-resources-Cp6HGagD.js → use-connection-resources-CBnleHDw.js} +1 -1
  87. package/dist/client/assets/{use-gateway-DJ2wz6GD.js → use-gateway-BAeublLm.js} +1 -1
  88. package/dist/client/assets/{use-gateway-system-prompt-FrFSJufL.js → use-gateway-system-prompt-DcPNvMKK.js} +1 -1
  89. package/dist/client/assets/{use-list-state-2Noltein.js → use-list-state-_DXZxdCV.js} +1 -1
  90. package/dist/client/assets/{use-mcp-DbxIdwzm.js → use-mcp-DVQixgJB.js} +1 -1
  91. package/dist/client/assets/{use-members-CvEmo-Qp.js → use-members-Ba-WS8jO.js} +1 -1
  92. package/dist/client/assets/{use-mobile-Cj5IONVM.js → use-mobile-CXfyAVoY.js} +1 -1
  93. package/dist/client/assets/{use-organization-settings-Bz3g4Zpi.js → use-organization-settings-g1OUF8Uc.js} +1 -1
  94. package/dist/client/assets/{use-tool-call-VY44CqK6.js → use-tool-call-DYbV_cs9.js} +1 -1
  95. package/dist/client/assets/{useQueries-BiKtsYpJ.js → useQueries-DAJGlQiv.js} +1 -1
  96. package/dist/client/assets/useQuery--jXLy0yb.js +1 -0
  97. package/dist/client/assets/{value-BXXW8rnd.js → value-DqDh9HyF.js} +1 -1
  98. package/dist/client/assets/{view-mode-toggle-CYuFxr7p.js → view-mode-toggle-DAKbBF5Z.js} +1 -1
  99. package/dist/client/assets/{workflow-RTyKsxRT.js → workflow-BO9cHs1L.js} +1 -1
  100. package/dist/client/index.html +1 -1
  101. package/dist/server/cli.js +122 -122
  102. package/dist/server/migrate.js +2 -2
  103. package/dist/server/server.js +126 -126
  104. package/package.json +1 -1
  105. package/dist/client/assets/constants-Bx_FLkPa.js +0 -1
  106. package/dist/client/assets/error-boundary-C3biDnWK.js +0 -1
  107. package/dist/client/assets/page-C9ZDngiM.js +0 -35
  108. package/dist/client/assets/useQuery-DW8RlKsd.js +0 -1
@@ -1 +1 @@
1
- import{c as ge,j as e,r as M,h as xe,b as je,a as fe,u as ye,x as ve,w as _e,s as oe,W as Ce,v as y,a0 as ke}from"./index-DZBFXaT_.js";import{C as Ne}from"./collection-header-Bf2EdT32.js";import{C as Se}from"./collection-page-C8XZ4WVW.js";import{C as we}from"./collection-search-UsqkgDWW.js";import{C as Te}from"./collection-table-wrapper-DXxcxGiG.js";import{C as be}from"./connection-card-uFFVVLla.js";import{b as De,u as Pe,n as O,E as B,c as Ie,I as Ve}from"./use-connection-BVMsW9fR.js";import{E as $e}from"./error-boundary-C3biDnWK.js";import{a as Ee}from"./use-binding-Dh7eSguQ.js";import{u as Ae,s as Q}from"./use-list-state-2Noltein.js";import{u as Fe}from"./project-context-provider-6vMfUBpq.js";import{f as He,a as Oe,b as Be,c as ze,d as Me,e as Re,A as Ue,g as Xe}from"./alert-dialog-BJHrUd_j.js";import{B as We}from"./badge-DQeqBGBY.js";import{I as k,B as _}from"./input-KWjuSjzn.js";import{d as Le,c as Ke,D as Ge,a as qe,b as Ye,f as Qe}from"./dialog-Ib7U8pHy.js";import{b as J,D as Z,a as ee,c as $}from"./dropdown-menu-BiS4AW--.js";import{a as Je,F as h,b as g,c as x,d as j,f}from"./form-BuxbGg5N.js";import{i as te}from"./DotsVertical-C-Nfqo18.js";import{i as Ze,r as et,s as z,E as tt,e as re}from"./env-vars-editor-BoJcH29X.js";import{i as nt}from"./Loading01-5lHx4rM1.js";import{i as st}from"./Terminal-BC7AwEkQ.js";import{s as ne}from"./Trash01-DMq1QD3Y.js";import{S as ot,a as rt,b as it,c as at,d as P}from"./select-bHRpmvzh.js";import{T as ct}from"./textarea-_Mx18lUV.js";import{g as lt}from"./generate-id-Dyweu44Y.js";import{a as dt}from"./use-tool-call-VY44CqK6.js";import{f as ut,e as mt}from"./registry-utils-B7t_ZBUi.js";import"./collection-display-button-BT-sOTV4.js";import"./Grid01-Dl_1kAd5.js";import"./view-mode-toggle-CYuFxr7p.js";import"./card-DCkJD1G_.js";import"./auth-BIu7r9Ac.js";import"./use-mobile-Cj5IONVM.js";import"./X-C6XvUpZP.js";import"./ChevronRight-Bc43l_p6.js";import"./Plus-wptRVGuY.js";import"./ChevronDown-Bd6n8txO.js";import"./useQuery-DW8RlKsd.js";const pt=oe({key:y(),value:y()}),ht=oe({title:y().min(1,"Name is required"),description:y().nullable().optional(),ui_type:ke(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:y().optional(),connection_token:y().nullable().optional(),npx_package:y().optional(),stdio_command:y().optional(),stdio_args:y().optional(),stdio_cwd:y().optional(),env_vars:Ce(pt).optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function A(n){const o=n.trim();if(!o)return"";try{const i=new URL(o),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return o.replace(/\/+$/,"")}}function gt(n){const o=n.trim().split(/\s+/).filter(Boolean);if(o.length<2)return null;const i=o[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const m=o.slice(1).find(a=>!a.startsWith("-"));return m?{packageName:m}:null}function E(n){const{uiType:o}=n,i=A(n.connectionUrl??"");if((o==="HTTP"||o==="SSE"||o==="Websocket")&&i===A("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(n.npxPackage??"").trim();return o==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function se(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const o=A(n.connectionUrl??"");if(!o)return null;const i=n.registryItems.find(a=>(a.server?.remotes??[]).some(N=>A(N.url??"")===o));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",m=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:m}:null}function xt(n,o){const i={command:"npx",args:["-y",n]},d=re(o);return Object.keys(d).length>0&&(i.envVars=d),i}function jt(n,o,i,d){const m={command:n};o.trim()&&(m.args=o.trim().split(/\s+/)),i?.trim()&&(m.cwd=i.trim());const a=re(d);return Object.keys(a).length>0&&(m.envVars=a),m}function ft(n){return n.command==="npx"}function yt(n){return n.args?.find(o=>!o.startsWith("-"))??""}function vt(n){return{command:n.command,args:n.args?.join(" ")??"",cwd:n.cwd??""}}function _t(n,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 Ct(){const{org:n}=Fe(),o=xe(),i=je({strict:!1}),{data:d}=fe.useSession(),{stdioEnabled:m}=ye(),a=Ae({namespace:n.slug,resource:"connections"}),I=De(),N=Pe(a),[v,S]=M.useReducer(_t,{mode:"idle"}),R=Ee(N)[0],F=R?.id??"",U=ut(R?.tools),ie=Ie(F||void 0),{data:ae}=dt({toolCaller:ie,toolName:U,toolInputParams:{limit:200},scope:F,enabled:!!(F&&U),staleTime:3600*1e3}),X=mt(ae??[]),W=i.action==="create",ce=()=>{o({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},L=()=>{o({to:"/$org/mcps",params:{org:n.slug},search:{}})},r=ve({resolver:_e(ht),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),u=r.watch("ui_type"),K=r.watch("connection_url"),le=r.watch("npx_package"),b=E({uiType:u,connectionUrl:K??"",npxPackage:le??""})??se({uiType:u,connectionUrl:K??"",registryItems:X}),l=v.mode==="editing"?v.connection:null;M.useEffect(()=>{if(l){const t=Ze(l.connection_headers)?l.connection_headers:null;if(t&&l.connection_type==="STDIO"){const s=et(t.envVars);if(ft(t)){const c=yt(t);r.reset({title:l.title,description:l.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:s})}else{const c=vt(t);r.reset({title:l.title,description:l.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:l.title,description:l.description,ui_type:l.connection_type,connection_url:l.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:[]})},[l,r]);const de=async()=>{if(v.mode!=="deleting")return;const t=v.connection.id;S({type:"close"});try{await I.delete.mutateAsync(t)}catch{}},ue=async t=>{let s,c=null,w=null,C=null;if(t.ui_type==="NPX"?(s="STDIO",c="",C=xt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(s="STDIO",c="",C=jt(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(s=t.ui_type,c=t.connection_url||"",w=t.connection_token||null),l){await I.update.mutateAsync({id:l.id,data:{title:t.title,description:t.description||null,connection_type:s,connection_url:c,...w&&{connection_token:w},...C&&{connection_headers:C}}}),S({type:"close"}),r.reset();return}const T=lt("conn");await I.create.mutateAsync({id:T,title:t.title,description:t.description||null,connection_type:s,connection_url:c,connection_token:w,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:C,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),L(),r.reset(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:T}})},G=t=>{t||(W?L():S({type:"close"}),r.reset())},V=t=>{const s=t.trim();if(!s)return;const c=!!r.formState.dirtyFields.title,w=!!r.formState.dirtyFields.description,C=!!r.formState.dirtyFields.env_vars,T=p=>{if(p&&(!c&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!w&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!C&&p.envVarKeys?.length)){const q=r.getValues("env_vars")??[],he=new Set(q.map(D=>D.key)),Y=p.envVarKeys.filter(D=>!he.has(D));Y.length>0&&r.setValue("env_vars",[...q,...Y.map(D=>({key:D,value:""}))],{shouldDirty:!0})}},H=gt(s);if(H&&m){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",H.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),T(E({uiType:"NPX",npxPackage:H.packageName}));return}if(s.startsWith("http://")||s.startsWith("https://")){const p=u==="HTTP"||u==="SSE"||u==="Websocket"?u:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",s,{shouldDirty:!0}),T(E({uiType:p,connectionUrl:s})??se({uiType:p,connectionUrl:s,registryItems:X}));return}u==="NPX"&&T(E({uiType:"NPX",npxPackage:s}))},me=[{id:"icon",header:"",render:t=>e.jsx(Ve,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(O,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:t=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title}),cellClassName:"w-48 max-w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:t.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-sm font-medium",children:t.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:t=>{const s=t.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:t=>e.jsx(We,{variant:t.status==="active"?"success":"outline",children:t.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs($,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Inspect"]}),e.jsxs($,{variant:"destructive",onClick:s=>{s.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],pe=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(_,{onClick:ce,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(Se,{children:[e.jsx(Le,{open:W||v.mode==="editing",onOpenChange:G,children:e.jsxs(Ke,{className:"sm:max-w-[525px]",children:[e.jsxs(Ge,{children:[e.jsx(qe,{children:l?"Edit Connection":"Create Connection"}),e.jsx(Ye,{children:l?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(Je,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(ue),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(h,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Type *"}),e.jsxs(ot,{value:t.value,onValueChange:t.onChange,children:[e.jsx(j,{children:e.jsx(rt,{children:e.jsx(it,{})})}),e.jsxs(at,{children:[e.jsx(P,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(P,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(P,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"Websocket"]})}),m&&e.jsxs(e.Fragment,{children:[e.jsx(P,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(P,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(st,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(f,{})]})}),u==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(h,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"NPM Package *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:s=>{const c=s.clipboardData.getData("text");c&&(s.preventDefault(),r.setValue("npx_package",c.trim(),{shouldDirty:!0}),V(c))},onBlur:s=>{V(s.target.value),t.onBlur()}})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(f,{})]})})}),u==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(h,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Command *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Arguments"}),e.jsx(j,{children:e.jsx(k,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Working Directory"}),e.jsx(j,{children:e.jsx(k,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(f,{})]})})]}),(u==="NPX"||u==="STDIO")&&e.jsx(h,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Environment Variables"}),e.jsx(j,{children:e.jsx(tt,{value:t.value??[],onChange:t.onChange})}),e.jsx(f,{})]})}),u!=="NPX"&&u!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"URL *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:s=>{const c=s.clipboardData.getData("text");c&&(s.preventDefault(),r.setValue("connection_url",c.trim(),{shouldDirty:!0}),V(c))},onBlur:s=>{V(s.target.value),t.onBlur()}})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:b?.token?.label??"Token (optional)"}),e.jsx(j,{children:e.jsx(k,{type:"password",placeholder:b?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),b?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[b.token.helperText,b.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"title",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Name *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"My Connection",...t})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"description",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Description"}),e.jsx(j,{children:e.jsx(ct,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsxs(Qe,{children:[e.jsx(_,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),e.jsx(_,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(He,{open:v.mode==="deleting",onOpenChange:t=>!t&&S({type:"close"}),children:e.jsxs(Oe,{children:[e.jsxs(Be,{children:[e.jsx(ze,{children:"Delete Connection?"}),e.jsxs(Me,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:v.mode==="deleting"&&v.connection.title}),"."]})]}),e.jsxs(Re,{children:[e.jsx(Ue,{children:"Cancel"}),e.jsx(Xe,{onClick:de,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(Ne,{title:"Connections",viewMode:a.viewMode,onViewModeChange:a.setViewMode,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],ctaButton:pe}),e.jsx(we,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?e.jsx(B,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(a.search,"No Connections found"),description:a.search?`No Connections match "${a.search}"`:"Create a connection to get started.",actions:!a.search&&e.jsx(_,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(t=>e.jsx(be,{connection:t,fallbackIcon:e.jsx(O,{}),onClick:()=>o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),headerActions:e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs($,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Inspect"]}),e.jsxs($,{variant:"destructive",onClick:s=>{s.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]})},t.id))})}):e.jsx(Te,{columns:me,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),emptyState:a.search?e.jsx(B,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${a.search}"`}):e.jsx(B,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(_,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})})})]})}function cn(){const n=ge.c(1);let o;return n[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx($e,{children:e.jsx(M.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(nt,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ct,{})})}),n[0]=o):o=n[0],o}export{cn as default};
1
+ import{c as ge,j as e,r as M,h as xe,b as je,a as fe,u as ye,x as ve,w as _e,s as oe,W as Ce,v as y,a0 as ke}from"./index-DHr9tFb0.js";import{C as Ne}from"./collection-header-BQqQNO9q.js";import{C as Se}from"./collection-page-DlOERJnr.js";import{C as we}from"./collection-search-CIs95Rnw.js";import{C as Te}from"./collection-table-wrapper-D1OlmFUL.js";import{C as be}from"./connection-card-Dm43-Wul.js";import{b as De,u as Pe,n as O,E as B,c as Ie,I as Ve}from"./use-connection-gZqQ1FAI.js";import{E as $e}from"./error-boundary-9rVpFVah.js";import{a as Ee}from"./use-binding-DxCldqD_.js";import{u as Ae,s as Q}from"./use-list-state-_DXZxdCV.js";import{u as Fe}from"./project-context-provider-SYQQWwHt.js";import{f as He,a as Oe,b as Be,c as ze,d as Me,e as Re,A as Ue,g as Xe}from"./alert-dialog-Dz8Vs8_m.js";import{B as We}from"./badge-99kEJDtp.js";import{I as k,B as _}from"./input-C4WvdKkR.js";import{d as Le,c as Ke,D as Ge,a as qe,b as Ye,f as Qe}from"./dialog-DK6VaggX.js";import{b as J,D as Z,a as ee,c as $}from"./dropdown-menu-DTGJCwi0.js";import{a as Je,F as h,b as g,c as x,d as j,f}from"./form-BGufVhpJ.js";import{i as te}from"./DotsVertical-eZBspOrA.js";import{i as Ze,r as et,s as z,E as tt,e as re}from"./env-vars-editor-BG99RDNZ.js";import{i as nt}from"./Loading01-C0_l8AxO.js";import{i as st}from"./Terminal-DDfP4x2i.js";import{s as ne}from"./Trash01-BMJLKtdF.js";import{S as ot,a as rt,b as it,c as at,d as P}from"./select-58kzPmSH.js";import{T as ct}from"./textarea-KpHZNzGY.js";import{g as lt}from"./generate-id-Dyweu44Y.js";import{a as dt}from"./use-tool-call-DYbV_cs9.js";import{f as ut,e as mt}from"./registry-utils-B7t_ZBUi.js";import"./collection-display-button-CqzsQ6A1.js";import"./Grid01-R-k411L-.js";import"./view-mode-toggle-DAKbBF5Z.js";import"./card-DZuxbKf1.js";import"./auth-CJNQiaii.js";import"./use-mobile-CXfyAVoY.js";import"./X-BFdZnqth.js";import"./ChevronRight-SzPzGSNO.js";import"./Plus-KTlOMNSY.js";import"./ChevronDown-Cdy__m-8.js";import"./useQuery--jXLy0yb.js";const pt=oe({key:y(),value:y()}),ht=oe({title:y().min(1,"Name is required"),description:y().nullable().optional(),ui_type:ke(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:y().optional(),connection_token:y().nullable().optional(),npx_package:y().optional(),stdio_command:y().optional(),stdio_args:y().optional(),stdio_cwd:y().optional(),env_vars:Ce(pt).optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function A(n){const o=n.trim();if(!o)return"";try{const i=new URL(o),d=i.pathname.length>1?i.pathname.replace(/\/+$/,""):i.pathname;return`${i.origin}${d}`}catch{return o.replace(/\/+$/,"")}}function gt(n){const o=n.trim().split(/\s+/).filter(Boolean);if(o.length<2)return null;const i=o[0]?.toLowerCase();if(i!=="npx"&&i!=="bunx")return null;const m=o.slice(1).find(a=>!a.startsWith("-"));return m?{packageName:m}:null}function E(n){const{uiType:o}=n,i=A(n.connectionUrl??"");if((o==="HTTP"||o==="SSE"||o==="Websocket")&&i===A("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const d=(n.npxPackage??"").trim();return o==="NPX"&&d==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function se(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const o=A(n.connectionUrl??"");if(!o)return null;const i=n.registryItems.find(a=>(a.server?.remotes??[]).some(N=>A(N.url??"")===o));if(!i)return null;const d=i.title||i.name||i.server?.title||i.server?.name||"",m=i.server?.description||i.description||i.summary||null;return d?{id:"registry",title:d,description:m}:null}function xt(n,o){const i={command:"npx",args:["-y",n]},d=re(o);return Object.keys(d).length>0&&(i.envVars=d),i}function jt(n,o,i,d){const m={command:n};o.trim()&&(m.args=o.trim().split(/\s+/)),i?.trim()&&(m.cwd=i.trim());const a=re(d);return Object.keys(a).length>0&&(m.envVars=a),m}function ft(n){return n.command==="npx"}function yt(n){return n.args?.find(o=>!o.startsWith("-"))??""}function vt(n){return{command:n.command,args:n.args?.join(" ")??"",cwd:n.cwd??""}}function _t(n,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 Ct(){const{org:n}=Fe(),o=xe(),i=je({strict:!1}),{data:d}=fe.useSession(),{stdioEnabled:m}=ye(),a=Ae({namespace:n.slug,resource:"connections"}),I=De(),N=Pe(a),[v,S]=M.useReducer(_t,{mode:"idle"}),R=Ee(N)[0],F=R?.id??"",U=ut(R?.tools),ie=Ie(F||void 0),{data:ae}=dt({toolCaller:ie,toolName:U,toolInputParams:{limit:200},scope:F,enabled:!!(F&&U),staleTime:3600*1e3}),X=mt(ae??[]),W=i.action==="create",ce=()=>{o({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},L=()=>{o({to:"/$org/mcps",params:{org:n.slug},search:{}})},r=ve({resolver:_e(ht),defaultValues:{title:"",description:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),u=r.watch("ui_type"),K=r.watch("connection_url"),le=r.watch("npx_package"),b=E({uiType:u,connectionUrl:K??"",npxPackage:le??""})??se({uiType:u,connectionUrl:K??"",registryItems:X}),l=v.mode==="editing"?v.connection:null;M.useEffect(()=>{if(l){const t=Ze(l.connection_headers)?l.connection_headers:null;if(t&&l.connection_type==="STDIO"){const s=et(t.envVars);if(ft(t)){const c=yt(t);r.reset({title:l.title,description:l.description,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:c,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:s})}else{const c=vt(t);r.reset({title:l.title,description:l.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:l.title,description:l.description,ui_type:l.connection_type,connection_url:l.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:[]})},[l,r]);const de=async()=>{if(v.mode!=="deleting")return;const t=v.connection.id;S({type:"close"});try{await I.delete.mutateAsync(t)}catch{}},ue=async t=>{let s,c=null,w=null,C=null;if(t.ui_type==="NPX"?(s="STDIO",c="",C=xt(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(s="STDIO",c="",C=jt(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(s=t.ui_type,c=t.connection_url||"",w=t.connection_token||null),l){await I.update.mutateAsync({id:l.id,data:{title:t.title,description:t.description||null,connection_type:s,connection_url:c,...w&&{connection_token:w},...C&&{connection_headers:C}}}),S({type:"close"}),r.reset();return}const T=lt("conn");await I.create.mutateAsync({id:T,title:t.title,description:t.description||null,connection_type:s,connection_url:c,connection_token:w,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:d?.user?.id||"system",organization_id:n.id,icon:null,app_name:null,app_id:null,connection_headers:C,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),L(),r.reset(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:T}})},G=t=>{t||(W?L():S({type:"close"}),r.reset())},V=t=>{const s=t.trim();if(!s)return;const c=!!r.formState.dirtyFields.title,w=!!r.formState.dirtyFields.description,C=!!r.formState.dirtyFields.env_vars,T=p=>{if(p&&(!c&&!r.getValues("title").trim()&&p.title&&r.setValue("title",p.title,{shouldDirty:!1}),!w&&!(r.getValues("description")??"").trim()&&p.description&&r.setValue("description",p.description,{shouldDirty:!1}),!C&&p.envVarKeys?.length)){const q=r.getValues("env_vars")??[],he=new Set(q.map(D=>D.key)),Y=p.envVarKeys.filter(D=>!he.has(D));Y.length>0&&r.setValue("env_vars",[...q,...Y.map(D=>({key:D,value:""}))],{shouldDirty:!0})}},H=gt(s);if(H&&m){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",H.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),T(E({uiType:"NPX",npxPackage:H.packageName}));return}if(s.startsWith("http://")||s.startsWith("https://")){const p=u==="HTTP"||u==="SSE"||u==="Websocket"?u:"HTTP";r.setValue("ui_type",p,{shouldDirty:!0}),r.setValue("connection_url",s,{shouldDirty:!0}),T(E({uiType:p,connectionUrl:s})??se({uiType:p,connectionUrl:s,registryItems:X}));return}u==="NPX"&&T(E({uiType:"NPX",npxPackage:s}))},me=[{id:"icon",header:"",render:t=>e.jsx(Ve,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:e.jsx(O,{})}),cellClassName:"w-16 shrink-0",wrap:!0},{id:"title",header:"Name",render:t=>e.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:t.title,children:t.title}),cellClassName:"w-48 max-w-48 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:t=>e.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:t.description||"—"}),cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},{id:"connection_type",header:"Type",accessor:t=>e.jsx("span",{className:"text-sm font-medium",children:t.connection_type}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"connection_url",header:"URL",render:t=>{const s=t.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:t=>e.jsx(We,{variant:t.status==="active"?"success":"outline",children:t.status}),cellClassName:"w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:t=>e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs($,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Inspect"]}),e.jsxs($,{variant:"destructive",onClick:s=>{s.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],pe=e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:n.slug}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),e.jsx(_,{onClick:ce,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]});return e.jsxs(Se,{children:[e.jsx(Le,{open:W||v.mode==="editing",onOpenChange:G,children:e.jsxs(Ke,{className:"sm:max-w-[525px]",children:[e.jsxs(Ge,{children:[e.jsx(qe,{children:l?"Edit Connection":"Create Connection"}),e.jsx(Ye,{children:l?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),e.jsx(Je,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(ue),children:[e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsx(h,{control:r.control,name:"ui_type",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Type *"}),e.jsxs(ot,{value:t.value,onValueChange:t.onChange,children:[e.jsx(j,{children:e.jsx(rt,{children:e.jsx(it,{})})}),e.jsxs(at,{children:[e.jsx(P,{value:"HTTP",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"HTTP"]})}),e.jsx(P,{value:"SSE",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"SSE"]})}),e.jsx(P,{value:"Websocket",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"Websocket"]})}),m&&e.jsxs(e.Fragment,{children:[e.jsx(P,{value:"NPX",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"w-4 h-4"}),"NPX Package"]})}),e.jsx(P,{value:"STDIO",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(st,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),e.jsx(f,{})]})}),u==="NPX"&&e.jsx(e.Fragment,{children:e.jsx(h,{control:r.control,name:"npx_package",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"NPM Package *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"@perplexity-ai/mcp-server",...t,value:t.value??"",onPaste:s=>{const c=s.clipboardData.getData("text");c&&(s.preventDefault(),r.setValue("npx_package",c.trim(),{shouldDirty:!0}),V(c))},onBlur:s=>{V(s.target.value),t.onBlur()}})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),e.jsx(f,{})]})})}),u==="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[e.jsx(h,{control:r.control,name:"stdio_command",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Command *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"node, bun, python...",...t,value:t.value??""})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"stdio_args",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Arguments"}),e.jsx(j,{children:e.jsx(k,{placeholder:"arg1 arg2 --flag value",...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"stdio_cwd",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Working Directory"}),e.jsx(j,{children:e.jsx(k,{placeholder:"/path/to/project (optional)",...t,value:t.value??""})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),e.jsx(f,{})]})})]}),(u==="NPX"||u==="STDIO")&&e.jsx(h,{control:r.control,name:"env_vars",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Environment Variables"}),e.jsx(j,{children:e.jsx(tt,{value:t.value??[],onChange:t.onChange})}),e.jsx(f,{})]})}),u!=="NPX"&&u!=="STDIO"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{control:r.control,name:"connection_url",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"URL *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"https://example.com/mcp",...t,value:t.value??"",onPaste:s=>{const c=s.clipboardData.getData("text");c&&(s.preventDefault(),r.setValue("connection_url",c.trim(),{shouldDirty:!0}),V(c))},onBlur:s=>{V(s.target.value),t.onBlur()}})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"connection_token",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:b?.token?.label??"Token (optional)"}),e.jsx(j,{children:e.jsx(k,{type:"password",placeholder:b?.token?.placeholder??"Bearer token or API key",...t,value:t.value??""})}),b?.token?.helperText&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[b.token.helperText,b.id==="github"&&e.jsxs(e.Fragment,{children:[" ","·"," ",e.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),e.jsx(f,{})]})})]}),e.jsx(h,{control:r.control,name:"title",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Name *"}),e.jsx(j,{children:e.jsx(k,{placeholder:"My Connection",...t})}),e.jsx(f,{})]})}),e.jsx(h,{control:r.control,name:"description",render:({field:t})=>e.jsxs(g,{children:[e.jsx(x,{children:"Description"}),e.jsx(j,{children:e.jsx(ct,{placeholder:"A brief description of this connection",rows:3,...t,value:t.value??""})}),e.jsx(f,{})]})})]}),e.jsxs(Qe,{children:[e.jsx(_,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),e.jsx(_,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:r.formState.isSubmitting?"Saving...":l?"Update Connection":"Create Connection"})]})]})})]})}),e.jsx(He,{open:v.mode==="deleting",onOpenChange:t=>!t&&S({type:"close"}),children:e.jsxs(Oe,{children:[e.jsxs(Be,{children:[e.jsx(ze,{children:"Delete Connection?"}),e.jsxs(Me,{children:["This action cannot be undone. This will permanently delete"," ",e.jsx("span",{className:"font-medium text-foreground",children:v.mode==="deleting"&&v.connection.title}),"."]})]}),e.jsxs(Re,{children:[e.jsx(Ue,{children:"Cancel"}),e.jsx(Xe,{onClick:de,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),e.jsx(Ne,{title:"Connections",viewMode:a.viewMode,onViewModeChange:a.setViewMode,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"status",label:"Status"}],ctaButton:pe}),e.jsx(we,{value:a.search,onChange:a.setSearch,placeholder:"Search for a Connection...",onKeyDown:t=>{t.key==="Escape"&&(a.setSearch(""),t.target.blur())}}),a.viewMode==="cards"?e.jsx("div",{className:"flex-1 overflow-auto p-5",children:N.length===0?e.jsx(B,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:(a.search,"No Connections found"),description:a.search?`No Connections match "${a.search}"`:"Create a connection to get started.",actions:!a.search&&e.jsx(_,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:N.map(t=>e.jsx(be,{connection:t,fallbackIcon:e.jsx(O,{}),onClick:()=>o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),headerActions:e.jsxs(J,{children:[e.jsx(Z,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:e.jsx(te,{size:20})})}),e.jsxs(ee,{align:"end",onClick:s=>s.stopPropagation(),children:[e.jsxs($,{onClick:s=>{s.stopPropagation(),o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}})},children:[e.jsx(Q,{size:16}),"Inspect"]}),e.jsxs($,{variant:"destructive",onClick:s=>{s.stopPropagation(),S({type:"delete",connection:t})},children:[e.jsx(ne,{size:16}),"Delete"]})]})]})},t.id))})}):e.jsx(Te,{columns:me,data:N,isLoading:!1,sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,onRowClick:t=>o({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:t.id}}),emptyState:a.search?e.jsx(B,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${a.search}"`}):e.jsx(B,{image:e.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:e.jsx(_,{variant:"outline",onClick:()=>o({to:"/$org/store",params:{org:n.slug}}),children:"Browse Store"})})})]})}function cn(){const n=ge.c(1);let o;return n[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx($e,{children:e.jsx(M.Suspense,{fallback:e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx(nt,{size:32,className:"animate-spin text-muted-foreground"})}),children:e.jsx(Ct,{})})}),n[0]=o):o=n[0],o}export{cn as default};
@@ -0,0 +1 @@
1
+ import{B as o}from"./use-binding-DxCldqD_.js";import{F as t}from"./index-DHr9tFb0.js";const s="mcp.mesh",m=t(o,{target:"draft-7"});export{m as B,s as M};
@@ -1 +1 @@
1
- import{s as A,v as D,c as v,w as O,x as E,j as r,a as N}from"./index-DZBFXaT_.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as B}from"./alert-dialog-BJHrUd_j.js";import{u as V,I as k,B as q}from"./input-KWjuSjzn.js";import{F as H,a as U,b as G,c as J,d as K,e as P,f as Q}from"./form-BuxbGg5N.js";import{S as W}from"./spinner-A1jsF1CN.js";function _(a){return a.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function oe(a){const e=v.c(41),{open:o,onOpenChange:s}=a;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:O(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=V(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let p;e[6]!==i?(p=b=>i.mutateAsync(b),e[6]=i,e[7]=p):p=e[7],n=t.handleSubmit(p),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=p=>{const{field:b}=p;return r.jsxs(G,{children:[r.jsx(J,{children:"Organization Name"}),r.jsx(K,{children:r.jsx(k,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(P,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(Q,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(H,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(W,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(q,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let x;e[34]!==t||e[35]!==h?(x=r.jsxs(M,{children:[F,r.jsx(U,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=x):x=e[36];let C;return e[37]!==s||e[38]!==o||e[39]!==x?(C=r.jsx(B,{open:o,onOpenChange:s,children:x}),e[37]=s,e[38]=o,e[39]=x,e[40]=C):C=e[40],C}function Y(a){const{orgSlug:e}=a;window.location.href=`/${e}`}async function Z(a){const e=_(a.name);if(!e)throw new Error("Organization slug is invalid");const o=await N.organization.create({name:a.name,slug:e});if(o?.error)throw new Error(o.error.message||"Failed to create organization");const s=o?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{oe as C};
1
+ import{s as A,v as D,c as v,w as O,x as E,j as r,a as N}from"./index-DHr9tFb0.js";import{A as I,a as M,b as L,c as R,d as T,e as $,f as B}from"./alert-dialog-Dz8Vs8_m.js";import{u as V,I as k,B as q}from"./input-C4WvdKkR.js";import{F as H,a as U,b as G,c as J,d as K,e as P,f as Q}from"./form-BGufVhpJ.js";import{S as W}from"./spinner-BmiYLJkt.js";function _(a){return a.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const X=A({name:D().min(2,"Organization name is required")});function oe(a){const e=v.c(41),{open:o,onOpenChange:s}=a;let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:O(X),defaultValues:{name:""}},e[0]=j):j=e[0];const t=E(j);let w;e[1]===Symbol.for("react.memo_cache_sentinel")?(w={mutationFn:Z,onSuccess:Y},e[1]=w):w=e[1];const i=V(w),z=i.error instanceof Error?i.error.message:i.error?"Failed to create organization.":null;let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=r.jsxs(L,{children:[r.jsx(R,{children:"Create a new organization"}),r.jsx(T,{children:"Set up a new organization to collaborate with others."})]}),e[2]=F):F=e[2];let n;if(e[3]!==i||e[4]!==t){let p;e[6]!==i?(p=b=>i.mutateAsync(b),e[6]=i,e[7]=p):p=e[7],n=t.handleSubmit(p),e[3]=i,e[4]=t,e[5]=n}else n=e[5];let l;e[8]!==t.formState.isSubmitting?(l=p=>{const{field:b}=p;return r.jsxs(G,{children:[r.jsx(J,{children:"Organization Name"}),r.jsx(K,{children:r.jsx(k,{...b,placeholder:"Acme Inc.",disabled:t.formState.isSubmitting})}),r.jsx(P,{children:"The name of your company or organization"}),b.value&&r.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Organization URL:"," ",r.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",_(b.value)]})]}),r.jsx(Q,{})]})},e[8]=t.formState.isSubmitting,e[9]=l):l=e[9];let m;e[10]!==t.control||e[11]!==l?(m=r.jsx(H,{control:t.control,name:"name",render:l}),e[10]=t.control,e[11]=l,e[12]=m):m=e[12];let c;e[13]!==z?(c=z&&r.jsx("div",{className:"text-destructive text-sm mt-2",children:z}),e[13]=z,e[14]=c):c=e[14];let f;e[15]!==i||e[16]!==t?(f=()=>{i.reset(),t.reset()},e[15]=i,e[16]=t,e[17]=f):f=e[17];let g;e[18]!==t.formState.isSubmitting||e[19]!==f?(g=r.jsx(I,{disabled:t.formState.isSubmitting,onClick:f,children:"Cancel"}),e[18]=t.formState.isSubmitting,e[19]=f,e[20]=g):g=e[20];const y=!t.formState.isValid||t.formState.isSubmitting;let u;e[21]!==t.formState.isSubmitting?(u=t.formState.isSubmitting?r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(W,{size:"xs"})," Creating..."]}):"Create Organization",e[21]=t.formState.isSubmitting,e[22]=u):u=e[22];let d;e[23]!==y||e[24]!==u?(d=r.jsx(q,{type:"submit",variant:"default",disabled:y,children:u}),e[23]=y,e[24]=u,e[25]=d):d=e[25];let S;e[26]!==d||e[27]!==g?(S=r.jsxs($,{children:[g,d]}),e[26]=d,e[27]=g,e[28]=S):S=e[28];let h;e[29]!==S||e[30]!==n||e[31]!==m||e[32]!==c?(h=r.jsxs("form",{className:"space-y-6",onSubmit:n,autoComplete:"off",children:[m,c,S]}),e[29]=S,e[30]=n,e[31]=m,e[32]=c,e[33]=h):h=e[33];let x;e[34]!==t||e[35]!==h?(x=r.jsxs(M,{children:[F,r.jsx(U,{...t,children:h})]}),e[34]=t,e[35]=h,e[36]=x):x=e[36];let C;return e[37]!==s||e[38]!==o||e[39]!==x?(C=r.jsx(B,{open:o,onOpenChange:s,children:x}),e[37]=s,e[38]=o,e[39]=x,e[40]=C):C=e[40],C}function Y(a){const{orgSlug:e}=a;window.location.href=`/${e}`}async function Z(a){const e=_(a.name);if(!e)throw new Error("Organization slug is invalid");const o=await N.organization.create({name:a.name,slug:e});if(o?.error)throw new Error(o.error.message||"Failed to create organization");const s=o?.data?.slug??e;if(!s)throw new Error("Failed to create organization");return{orgSlug:s}}export{oe as C};
@@ -1 +1 @@
1
- import{c as n,j as i,R as g,C as m,T as u,D as x,P as j,O as N,aZ as b,e as D}from"./index-DZBFXaT_.js";import{i as h}from"./X-C6XvUpZP.js";import{c}from"./input-KWjuSjzn.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"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(N,{"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(D,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(u,{"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{R as D,P as a,B as b,T as c,k as d,w as e,O as f};
1
+ import{c as n,j as i,R as g,C as m,T as u,D as x,P as j,O as N,aZ as b,e as D}from"./index-DHr9tFb0.js";import{i as h}from"./X-BFdZnqth.js";import{c}from"./input-C4WvdKkR.js";function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"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(N,{"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(D,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(u,{"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{R as D,P as a,B as b,T as c,k as d,w as e,O as f};
@@ -1 +1 @@
1
- import{c,j as i,bA as p,bB as f,bC as m,bD as g,bE as b,bF as x,bG as v,bH as w,bI as h}from"./index-DZBFXaT_.js";import{i as j}from"./ChevronRight-Bc43l_p6.js";import{c as u}from"./input-KWjuSjzn.js";function S(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function M(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function $(s){const e=c.c(10);let t,o,a;e[0]!==s?({className:t,sideOffset:a,...o}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a):(t=e[1],o=e[2],a=e[3]);const n=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==o||e[7]!==n||e[8]!==r?(d=i.jsx(m,{children:i.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function y(s){const e=c.c(12);let t,o,a,n;e[0]!==s?({className:t,inset:o,variant:n,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==d||e[10]!==r?(l=i.jsx(b,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:d,...a}),e[7]=o,e[8]=a,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function _(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}function C(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(x,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function T(s){const e=c.c(13);let t,o,a,n;e[0]!==s?({className:o,inset:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(j,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==n||e[11]!==r?(l=i.jsxs(v,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...n,children:[t,d]}),e[8]=t,e[9]=a,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function E(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}export{M as D,$ as a,S as b,y as c,_ as d,C as e,T as f,E as g};
1
+ import{c,j as i,bz as p,bA as f,bB as m,bC as g,bD as b,bE as x,bF as v,bG as w,bH as h}from"./index-DHr9tFb0.js";import{i as j}from"./ChevronRight-SzPzGSNO.js";import{c as u}from"./input-C4WvdKkR.js";function S(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(p,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=o):o=e[3],o}function M(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(f,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=o):o=e[3],o}function $(s){const e=c.c(10);let t,o,a;e[0]!==s?({className:t,sideOffset:a,...o}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a):(t=e[1],o=e[2],a=e[3]);const n=a===void 0?4:a;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==o||e[7]!==n||e[8]!==r?(d=i.jsx(m,{children:i.jsx(g,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...o})}),e[6]=o,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function y(s){const e=c.c(12);let t,o,a,n;e[0]!==s?({className:t,inset:o,variant:n,...a}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==d||e[10]!==r?(l=i.jsx(b,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:d,...a}),e[7]=o,e[8]=a,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function _(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(h,{"data-slot":"dropdown-menu-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}function C(s){const e=c.c(4);let t;e[0]!==s?({...t}=s,e[0]=s,e[1]=t):t=e[1];let o;return e[2]!==t?(o=i.jsx(x,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=o):o=e[3],o}function T(s){const e=c.c(13);let t,o,a,n;e[0]!==s?({className:o,inset:a,children:t,...n}=s,e[0]=s,e[1]=t,e[2]=o,e[3]=a,e[4]=n):(t=e[1],o=e[2],a=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(j,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==a||e[10]!==n||e[11]!==r?(l=i.jsxs(v,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:r,...n,children:[t,d]}),e[8]=t,e[9]=a,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function E(s){const e=c.c(8);let t,o;e[0]!==s?({className:t,...o}=s,e[0]=s,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let a;e[3]!==t?(a=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=a):a=e[4];let n;return e[5]!==o||e[6]!==a?(n=i.jsx(w,{"data-slot":"dropdown-menu-sub-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=n):n=e[7],n}export{M as D,$ as a,S as b,y as c,_ as d,C as e,T as f,E as g};
@@ -1 +1 @@
1
- import{c as p,j as t}from"./index-DZBFXaT_.js";import{B as j,c as b}from"./input-KWjuSjzn.js";function v(u){const e=p.c(18),{icon:a,title:m,description:x,buttonProps:n,buttonComponent:f}=u;let s;e[0]!==a?(s=t.jsx("div",{className:"flex items-center justify-center",children:t.jsx("div",{className:"p-6 rounded-full border border-muted",children:t.jsx("div",{className:"p-4 rounded-full border border-border",children:t.jsx("div",{className:"p-3.5 rounded-full border border-border",children:t.jsx("div",{className:"p-3 rounded-full border border-border",children:t.jsx("div",{className:"w-20 h-20 rounded-full bg-muted flex items-center justify-center p-4",children:a})})})})})}),e[0]=a,e[1]=s):s=e[1];let l;e[2]!==m?(l=t.jsx("h3",{className:"text-2xl font-semibold text-foreground text-center",children:m}),e[2]=m,e[3]=l):l=e[3];let r;e[4]!==x?(r=t.jsx("div",{className:"text-sm text-muted-foreground text-center flex flex-col gap-1",children:x}),e[4]=x,e[5]=r):r=e[5];let d;e[6]!==l||e[7]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-md",children:[l,r]}),e[6]=l,e[7]=r,e[8]=d):d=e[8];let i;e[9]!==f||e[10]!==n?(i=f??(n&&t.jsx(j,{variant:"outline",size:"default",className:b("gap-2",n?.className),...n})),e[9]=f,e[10]=n,e[11]=i):i=e[11];let c;e[12]!==i?(c=t.jsx("div",{className:"mt-6",children:i}),e[12]=i,e[13]=c):c=e[13];let o;return e[14]!==s||e[15]!==d||e[16]!==c?(o=t.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[s,d,c]}),e[14]=s,e[15]=d,e[16]=c,e[17]=o):o=e[17],o}export{v as E};
1
+ import{c as p,j as t}from"./index-DHr9tFb0.js";import{B as j,c as b}from"./input-C4WvdKkR.js";function v(u){const e=p.c(18),{icon:a,title:m,description:x,buttonProps:n,buttonComponent:f}=u;let s;e[0]!==a?(s=t.jsx("div",{className:"flex items-center justify-center",children:t.jsx("div",{className:"p-6 rounded-full border border-muted",children:t.jsx("div",{className:"p-4 rounded-full border border-border",children:t.jsx("div",{className:"p-3.5 rounded-full border border-border",children:t.jsx("div",{className:"p-3 rounded-full border border-border",children:t.jsx("div",{className:"w-20 h-20 rounded-full bg-muted flex items-center justify-center p-4",children:a})})})})})}),e[0]=a,e[1]=s):s=e[1];let l;e[2]!==m?(l=t.jsx("h3",{className:"text-2xl font-semibold text-foreground text-center",children:m}),e[2]=m,e[3]=l):l=e[3];let r;e[4]!==x?(r=t.jsx("div",{className:"text-sm text-muted-foreground text-center flex flex-col gap-1",children:x}),e[4]=x,e[5]=r):r=e[5];let d;e[6]!==l||e[7]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-md",children:[l,r]}),e[6]=l,e[7]=r,e[8]=d):d=e[8];let i;e[9]!==f||e[10]!==n?(i=f??(n&&t.jsx(j,{variant:"outline",size:"default",className:b("gap-2",n?.className),...n})),e[9]=f,e[10]=n,e[11]=i):i=e[11];let c;e[12]!==i?(c=t.jsx("div",{className:"mt-6",children:i}),e[12]=i,e[13]=c):c=e[13];let o;return e[14]!==s||e[15]!==d||e[16]!==c?(o=t.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[s,d,c]}),e[14]=s,e[15]=d,e[16]=c,e[17]=o):o=e[17],o}export{v as E};
@@ -1 +1 @@
1
- import{r as N,s as y,a0 as D,W as k,v as t,V as m,Y as T,H,c as O,j as c}from"./index-DZBFXaT_.js";import{I as z,B as V}from"./input-KWjuSjzn.js";import{s as R}from"./Plus-wptRVGuY.js";import{s as L}from"./Trash01-DMq1QD3Y.js";const U=({size:o=24,color:e="currentColor",...n})=>N.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,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:k(t()),grantType:D(["authorization_code","client_credentials"])}),M=y({name:t(),description:t().optional(),inputSchema:m(t(),T()),outputSchema:m(t(),T()).optional()}),K=y({headers:m(t(),t()).optional()}),$=y({command:t().describe("Command to run (e.g., 'npx', 'node')"),args:k(t()).optional().describe("Command arguments"),cwd:t().optional().describe("Working directory"),envVars:m(t(),t()).optional().describe("Environment variables (encrypted in storage)")}),W=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:D(["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([$,K]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:B.nullable().describe("OAuth configuration"),configuration_state:m(t(),T()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:k(t()).nullable().optional().describe("Configuration scopes"),metadata:m(t(),T()).nullable().describe("Additional metadata (includes repository info)"),tools:k(M).nullable().describe("Discovered tools from MCP"),bindings:k(t()).nullable().describe("Detected bindings"),status:D(["active","inactive","error"]).describe("Current status")});W.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});W.partial();function Q(o){return o!=null&&"command"in o}function q(o){const e=o.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(l=>e.includes(l))||["sk_","rk_","whsec_","pk_live","sk_live"].some(l=>e.startsWith(l))||["_key","_secret","_token","_password","_auth","_pat"].some(l=>e.endsWith(l)))}function X(o){const e=O.c(34),{value:n,onChange:r,keyPlaceholder:j,valuePlaceholder:l,className:I}=o,f=j===void 0?"VARIABLE_NAME":j,_=l===void 0?"value...":l;let x;e[0]!==r||e[1]!==n?(x=()=>{r([...n,{key:"",value:""}])},e[0]=r,e[1]=n,e[2]=x):x=e[2];const A=x;let w;e[3]!==r||e[4]!==n?(w=i=>{r(n.filter((d,s)=>s!==i))},e[3]=r,e[4]=n,e[5]=w):w=e[5];const b=w;let S;e[6]!==r||e[7]!==n?(S=(i,d)=>{const s=[...n],a=s[i];a&&(s[i]={key:d,value:a.value},r(s))},e[6]=r,e[7]=n,e[8]=S):S=e[8];const g=S;let C;e[9]!==r||e[10]!==n?(C=(i,d)=>{const s=[...n],a=s[i];a&&(s[i]={key:a.key,value:d},r(s))},e[9]=r,e[10]=n,e[11]=C):C=e[11];const v=C;let u;if(e[12]!==g||e[13]!==b||e[14]!==v||e[15]!==f||e[16]!==n||e[17]!==_){let i;e[19]!==g||e[20]!==b||e[21]!==v||e[22]!==f||e[23]!==_?(i=(d,s)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(z,{placeholder:f,value:d.key,onChange:a=>g(s,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),c.jsx(z,{type:q(d.key)?"password":"text",placeholder:_,value:d.value,onChange:a=>v(s,a.target.value),className:"h-10 rounded-lg flex-1"}),c.jsx(V,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>b(s),children:c.jsx(L,{size:16})})]},s),e[19]=g,e[20]=b,e[21]=v,e[22]=f,e[23]=_,e[24]=i):i=e[24],u=n.map(i),e[12]=g,e[13]=b,e[14]=v,e[15]=f,e[16]=n,e[17]=_,e[18]=u}else u=e[18];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(R,{size:16,className:"mr-1"}),e[25]=E):E=e[25];let p;e[26]!==A?(p=c.jsxs(V,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:A,children:[E,"Add Environment Variable"]}),e[26]=A,e[27]=p):p=e[27];let h;e[28]!==u||e[29]!==p?(h=c.jsxs("div",{className:"flex flex-col gap-2",children:[u,p]}),e[28]=u,e[29]=p,e[30]=h):h=e[30];let P;return e[31]!==I||e[32]!==h?(P=c.jsx("div",{className:I,children:h}),e[31]=I,e[32]=h,e[33]=P):P=e[33],P}function Z(o){const e={};for(const{key:n,value:r}of o)n.trim()&&(e[n.trim()]=r);return e}function ee(o){return o?Object.entries(o).map(([e,n])=>({key:e,value:n})):[]}export{X as E,Z as e,Q as i,ee as r,U as s};
1
+ import{r as N,s as y,a0 as D,W as k,v as t,V as m,Y as T,H,c as O,j as c}from"./index-DHr9tFb0.js";import{I as z,B as V}from"./input-C4WvdKkR.js";import{s as R}from"./Plus-KTlOMNSY.js";import{s as L}from"./Trash01-BMJLKtdF.js";const U=({size:o=24,color:e="currentColor",...n})=>N.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,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:k(t()),grantType:D(["authorization_code","client_credentials"])}),M=y({name:t(),description:t().optional(),inputSchema:m(t(),T()),outputSchema:m(t(),T()).optional()}),K=y({headers:m(t(),t()).optional()}),$=y({command:t().describe("Command to run (e.g., 'npx', 'node')"),args:k(t()).optional().describe("Command arguments"),cwd:t().optional().describe("Working directory"),envVars:m(t(),t()).optional().describe("Environment variables (encrypted in storage)")}),W=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:D(["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([$,K]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:B.nullable().describe("OAuth configuration"),configuration_state:m(t(),T()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:k(t()).nullable().optional().describe("Configuration scopes"),metadata:m(t(),T()).nullable().describe("Additional metadata (includes repository info)"),tools:k(M).nullable().describe("Discovered tools from MCP"),bindings:k(t()).nullable().describe("Detected bindings"),status:D(["active","inactive","error"]).describe("Current status")});W.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});W.partial();function Q(o){return o!=null&&"command"in o}function q(o){const e=o.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(l=>e.includes(l))||["sk_","rk_","whsec_","pk_live","sk_live"].some(l=>e.startsWith(l))||["_key","_secret","_token","_password","_auth","_pat"].some(l=>e.endsWith(l)))}function X(o){const e=O.c(34),{value:n,onChange:r,keyPlaceholder:j,valuePlaceholder:l,className:I}=o,f=j===void 0?"VARIABLE_NAME":j,_=l===void 0?"value...":l;let x;e[0]!==r||e[1]!==n?(x=()=>{r([...n,{key:"",value:""}])},e[0]=r,e[1]=n,e[2]=x):x=e[2];const A=x;let w;e[3]!==r||e[4]!==n?(w=i=>{r(n.filter((d,s)=>s!==i))},e[3]=r,e[4]=n,e[5]=w):w=e[5];const b=w;let S;e[6]!==r||e[7]!==n?(S=(i,d)=>{const s=[...n],a=s[i];a&&(s[i]={key:d,value:a.value},r(s))},e[6]=r,e[7]=n,e[8]=S):S=e[8];const g=S;let C;e[9]!==r||e[10]!==n?(C=(i,d)=>{const s=[...n],a=s[i];a&&(s[i]={key:a.key,value:d},r(s))},e[9]=r,e[10]=n,e[11]=C):C=e[11];const v=C;let u;if(e[12]!==g||e[13]!==b||e[14]!==v||e[15]!==f||e[16]!==n||e[17]!==_){let i;e[19]!==g||e[20]!==b||e[21]!==v||e[22]!==f||e[23]!==_?(i=(d,s)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(z,{placeholder:f,value:d.key,onChange:a=>g(s,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),c.jsx(z,{type:q(d.key)?"password":"text",placeholder:_,value:d.value,onChange:a=>v(s,a.target.value),className:"h-10 rounded-lg flex-1"}),c.jsx(V,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>b(s),children:c.jsx(L,{size:16})})]},s),e[19]=g,e[20]=b,e[21]=v,e[22]=f,e[23]=_,e[24]=i):i=e[24],u=n.map(i),e[12]=g,e[13]=b,e[14]=v,e[15]=f,e[16]=n,e[17]=_,e[18]=u}else u=e[18];let E;e[25]===Symbol.for("react.memo_cache_sentinel")?(E=c.jsx(R,{size:16,className:"mr-1"}),e[25]=E):E=e[25];let p;e[26]!==A?(p=c.jsxs(V,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:A,children:[E,"Add Environment Variable"]}),e[26]=A,e[27]=p):p=e[27];let h;e[28]!==u||e[29]!==p?(h=c.jsxs("div",{className:"flex flex-col gap-2",children:[u,p]}),e[28]=u,e[29]=p,e[30]=h):h=e[30];let P;return e[31]!==I||e[32]!==h?(P=c.jsx("div",{className:I,children:h}),e[31]=I,e[32]=h,e[33]=P):P=e[33],P}function Z(o){const e={};for(const{key:n,value:r}of o)n.trim()&&(e[n.trim()]=r);return e}function ee(o){return o?Object.entries(o).map(([e,n])=>({key:e,value:n})):[]}export{X as E,Z as e,Q as i,ee as r,U as s};
@@ -0,0 +1 @@
1
+ import{r as o,j as e}from"./index-DHr9tFb0.js";import{B as n}from"./input-C4WvdKkR.js";const a=({size:t=24,color:r="currentColor",...s})=>o.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:r,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},o.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));a.displayName="AlertTriangle";class l extends o.Component{state={hasError:!1,error:null};static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,s){console.error("Uncaught error:",r,s)}resetError=()=>{this.setState({hasError:!1,error:null})};render(){if(this.state.hasError){const{fallback:r}=this.props;return typeof r=="function"?r({error:this.state.error,resetError:this.resetError}):r!==void 0?r:e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[e.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:e.jsx(a,{className:"h-6 w-6 text-destructive"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-lg font-medium",children:"Something went wrong"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:this.state.error?.message||"An unexpected error occurred"})]}),e.jsx(n,{variant:"outline",onClick:this.resetError,children:"Try again"})]})}return this.props.children}}export{l as E,a as i};
@@ -1 +1 @@
1
- import{M as y}from"./constants-Bx_FLkPa.js";import{g as m}from"./github-icon-Dp3wHhYE.js";import{g as h}from"./registry-utils-B7t_ZBUi.js";import{g as C}from"./generate-id-Dyweu44Y.js";function A(e,s,a){const o=e.server,t=e._meta?.[y],r=o?.remotes?.[0],c=h(r?.type)||"HTTP",i=new Date().toISOString(),l=t?.friendlyName||t?.friendly_name||e.title||o?.title||o?.name||"Unnamed MCP Server",u=o?.description||null,p=o?.icons?.[0]?.src||m(o?.repository)||null,n=t?.oauth_config,d=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,f=t?.configuration_state,g=t?.configuration_scopes,_=o?.repository?{url:o.repository.url,source:o.repository.source,subfolder:o.repository.subfolder}:null;return{id:C("conn"),title:l,description:u,icon:p,app_name:t?.appName||o?.name||null,app_id:t?.id||e.id||null,connection_type:c,connection_url:r?.url||"",connection_token:null,connection_headers:null,oauth_config:d,configuration_state:f??null,configuration_scopes:g??null,metadata:{source:"store",registry_item_id:e.id,verified:t?.verified??!1,scopeName:t?.scopeName??null,toolsCount:t?.tools?.length??0,publishedAt:t?.publishedAt??null,repository:_},created_at:i,updated_at:i,created_by:a,organization_id:s,tools:null,bindings:null,status:"inactive"}}export{A as e};
1
+ import{M as y}from"./constants-BSLIcG1u.js";import{g as m}from"./github-icon-Dp3wHhYE.js";import{g as h}from"./registry-utils-B7t_ZBUi.js";import{g as C}from"./generate-id-Dyweu44Y.js";function A(e,s,a){const o=e.server,t=e._meta?.[y],r=o?.remotes?.[0],c=h(r?.type)||"HTTP",i=new Date().toISOString(),l=t?.friendlyName||t?.friendly_name||e.title||o?.title||o?.name||"Unnamed MCP Server",u=o?.description||null,p=o?.icons?.[0]?.src||m(o?.repository)||null,n=t?.oauth_config,d=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,f=t?.configuration_state,g=t?.configuration_scopes,_=o?.repository?{url:o.repository.url,source:o.repository.source,subfolder:o.repository.subfolder}:null;return{id:C("conn"),title:l,description:u,icon:p,app_name:t?.appName||o?.name||null,app_id:t?.id||e.id||null,connection_type:c,connection_url:r?.url||"",connection_token:null,connection_headers:null,oauth_config:d,configuration_state:f??null,configuration_scopes:g??null,metadata:{source:"store",registry_item_id:e.id,verified:t?.verified??!1,scopeName:t?.scopeName??null,toolsCount:t?.tools?.length??0,publishedAt:t?.publishedAt??null,repository:_},created_at:i,updated_at:i,created_by:a,organization_id:s,tools:null,bindings:null,status:"inactive"}}export{A as e};
@@ -1 +1 @@
1
- import{c as d,j as m,aU as $,bc as j,bd as C,r as f,g as v,be as N,bf as h}from"./index-DZBFXaT_.js";import{c as u}from"./input-KWjuSjzn.js";function S(t){const e=d.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let l;e[3]!==s?(l=u("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r=m.jsx($,{"data-slot":"label",className:l,...o}),e[5]=o,e[6]=l,e[7]=r):r=e[7],r}const D=j,b=f.createContext({}),E=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let l;e[4]!==s?(l=m.jsx(C,{...s}),e[4]=s,e[5]=l):l=e[5];let r;return e[6]!==o||e[7]!==l?(r=m.jsx(b.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(b),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`,g=`${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]!==g?(p={id:i,name:e.name,formItemId:c,formDescriptionId:F,formMessageId:g,...n},t[6]=e.name,t[7]=n,t[8]=i,t[9]=c,t[10]=F,t[11]=g,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 U(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formMessageId:r}=x(),a=l?String(l?.message??""):o.children;if(!a)return null;let n;e[3]!==s?(n=u("text-destructive text-sm",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==n?(i=m.jsx("p",{"data-slot":"form-message",id:r,className:n,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=n,e[9]=i):i=e[9],i}export{E as F,D as a,M as b,P as c,R as d,L as e,U as f};
1
+ import{c as d,j as m,aU as $,bc as j,bd as C,r as f,g as v,be as N,bf as h}from"./index-DHr9tFb0.js";import{c as u}from"./input-C4WvdKkR.js";function S(t){const e=d.c(8);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);let l;e[3]!==s?(l=u("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r=m.jsx($,{"data-slot":"label",className:l,...o}),e[5]=o,e[6]=l,e[7]=r):r=e[7],r}const D=j,b=f.createContext({}),E=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let l;e[4]!==s?(l=m.jsx(C,{...s}),e[4]=s,e[5]=l):l=e[5];let r;return e[6]!==o||e[7]!==l?(r=m.jsx(b.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(b),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`,g=`${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]!==g?(p={id:i,name:e.name,formItemId:c,formDescriptionId:F,formMessageId:g,...n},t[6]=e.name,t[7]=n,t[8]=i,t[9]=c,t[10]=F,t[11]=g,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 U(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:l,formMessageId:r}=x(),a=l?String(l?.message??""):o.children;if(!a)return null;let n;e[3]!==s?(n=u("text-destructive text-sm",s),e[3]=s,e[4]=n):n=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==n?(i=m.jsx("p",{"data-slot":"form-message",id:r,className:n,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=n,e[9]=i):i=e[9],i}export{E as F,D as a,M as b,P as c,R as d,L as e,U as f};
@@ -1 +1 @@
1
- import{r as I,a0 as ye,s as fe,W as F,v as S,Q as Ue,c as W,j as t,h as Be,d as nt,b as it,i as rt,aG as at,w as ct,x as dt,t as Ae}from"./index-DZBFXaT_.js";import{I as Me,u as qe,E as mt}from"./use-connection-BVMsW9fR.js";import{E as He}from"./error-boundary-C3biDnWK.js";import{C as Je}from"./checkbox-BPcJKnx2.js";import{c as te,B as L,I as $e}from"./input-KWjuSjzn.js";import{i as ut}from"./ArrowLeft-CoE0Hi8I.js";import{C as ft}from"./collection-search-UsqkgDWW.js";import{s as ht}from"./Plus-wptRVGuY.js";import{i as xt}from"./X-C6XvUpZP.js";import{P as pt}from"./pin-to-sidebar-button-CeunWdra.js";import{T as gt,S as bt}from"./switch-RYFLASzA.js";import{b as jt,a as yt,i as vt}from"./use-gateway-DJ2wz6GD.js";import{u as _t,a as St}from"./use-connection-resources-Cp6HGagD.js";import{u as Ct}from"./use-gateway-system-prompt-FrFSJufL.js";import{s as wt}from"./slugify-CEUa2lfQ.js";import{D as Nt,a as It,c as kt,d as Tt}from"./dialog-Ib7U8pHy.js";import{F as be,a as $t,b as ve,d as _e,f as Se,c as Qe}from"./form-BuxbGg5N.js";import{R as zt}from"./resource-tabs-ChCUbmUR.js";import{S as Ze,a as Ke,b as Xe,c as Ye,d as je}from"./select-bHRpmvzh.js";import{T as Pt}from"./textarea-_Mx18lUV.js";import{a as K,c as X,b as Y,T as ee,i as De}from"./project-context-provider-6vMfUBpq.js";import{a as et}from"./Copy01-BTTTCefb.js";import{i as Rt}from"./FlipBackward-BLl0wh4k.js";import{i as tt}from"./InfoCircle-D8z5_ZlN.js";import{i as Ee}from"./Loading01-5lHx4rM1.js";import{a as At,V as Dt,b as Et}from"./layout-B02TxUA9.js";import"./use-organization-settings-Bz3g4Zpi.js";import"./useQueries-BiKtsYpJ.js";import"./localstorage-keys-ziXXhpvN.js";import"./useQuery-DW8RlKsd.js";import"./badge-DQeqBGBY.js";import"./ChevronDown-Bd6n8txO.js";const st=({size:o=24,color:e="currentColor",...s})=>I.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},I.createElement("path",{d:"M7 3v3.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C7.76 8 8.04 8 8.6 8h6.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C17 7.24 17 6.96 17 6.4V4m0 17v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));st.displayName="Save01";const ot=({size:o=24,color:e="currentColor",...s})=>I.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},I.createElement("path",{d:"m8.59 13.51 6.83 3.98m-.01-10.98-6.82 3.98M21 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm12 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));ot.displayName="Share07";const Oe=ye(["inclusion","exclusion"]).describe("Tool selection mode: 'inclusion' = include selected (default), 'exclusion' = exclude selected"),Ve=ye(["passthrough","smart_tool_selection","code_execution"]).describe("Gateway tool selection strategy: 'passthrough' (default), 'smart_tool_selection', or 'code_execution'"),Ut=fe({connection_id:S().describe("Connection ID"),selected_tools:F(S()).nullable().describe("Selected tool names. With 'inclusion' mode: null = all tools included. With 'exclusion' mode: null = entire connection excluded"),selected_resources:F(S()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. With 'inclusion' mode: null = all resources included."),selected_prompts:F(S()).nullable().describe("Selected prompt names. With 'inclusion' mode: null = all prompts included. With 'exclusion' mode: null = entire connection excluded.")}),Mt=fe({id:S().describe("Unique identifier for the gateway"),title:S().describe("Human-readable name for the gateway"),description:S().nullable().describe("Description of the gateway"),icon:S().nullable().optional().describe("Icon URL for the gateway"),created_at:S().describe("When the gateway was created"),updated_at:S().describe("When the gateway was last updated"),created_by:S().describe("User ID who created the gateway"),updated_by:S().optional().describe("User ID who last updated the gateway"),organization_id:S().describe("Organization ID this gateway belongs to"),tool_selection_strategy:Ve.describe("Gateway behavior strategy (metadata for now): 'passthrough', 'smart_tool_selection', or 'code_execution'"),tool_selection_mode:Oe.describe("Tool selection mode: 'inclusion' = include selected, 'exclusion' = exclude selected"),status:ye(["active","inactive"]).describe("Current status"),is_default:Ue().describe("Whether this is the Organization Agent for the organization"),connections:F(Ut).describe("Connections with their selected tools (behavior depends on tool_selection_mode)")});fe({title:S().min(1).max(255).describe("Name for the gateway"),description:S().nullable().optional().describe("Optional description"),tool_selection_strategy:Ve.optional().default("passthrough").describe("Gateway behavior strategy (defaults to 'passthrough')"),tool_selection_mode:Oe.optional().default("inclusion").describe("Tool selection mode (defaults to 'inclusion')"),icon:S().nullable().optional().describe("Optional icon URL"),status:ye(["active","inactive"]).optional().default("active").describe("Initial status"),is_default:Ue().optional().default(!1).describe("Whether this is the Organization Agent for the organization"),connections:F(fe({connection_id:S().describe("Connection ID"),selected_tools:F(S()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:F(S()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:F(S()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).describe("Connections to include/exclude (can be empty for exclusion mode)")});fe({title:S().min(1).max(255).optional().describe("New name"),description:S().nullable().optional().describe("New description (null to clear)"),tool_selection_strategy:Ve.optional().describe("New gateway behavior strategy"),tool_selection_mode:Oe.optional().describe("New tool selection mode"),icon:S().nullable().optional().describe("New icon URL (null to clear)"),status:ye(["active","inactive"]).optional().describe("New status"),is_default:Ue().optional().describe("Set as Organization Agent for the organization"),connections:F(fe({connection_id:S().describe("Connection ID"),selected_tools:F(S()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:F(S()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:F(S()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).optional().describe("New connections (replaces existing)")});const Ot=I.memo(function(e){const s=W.c(20),{connection:l,isSelected:a,hasItemsEnabled:i,activeItemsCount:x,totalItemsCount:d,onSelect:m,onToggle:n}=e,c=a?"bg-accent/50":"hover:bg-muted/50";let u;s[0]!==c?(u=te("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",c),s[0]=c,s[1]=u):u=s[1];let r;s[2]!==l.icon||s[3]!==l.title?(r=t.jsx(Me,{icon:l.icon,name:l.title,size:"xs"}),s[2]=l.icon,s[3]=l.title,s[4]=r):r=s[4];let g;s[5]!==l.title?(g=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),s[5]=l.title,s[6]=g):g=s[6];let f;s[7]!==m||s[8]!==r||s[9]!==g?(f=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:m,children:[r,g]}),s[7]=m,s[8]=r,s[9]=g,s[10]=f):f=s[10];let p;s[11]!==x||s[12]!==i||s[13]!==n||s[14]!==d?(p=d>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[x,"/",d]}),t.jsx(Je,{checked:i,onCheckedChange:n,onClick:Gt})]}),s[11]=x,s[12]=i,s[13]=n,s[14]=d,s[15]=p):p=s[15];let j;return s[16]!==u||s[17]!==f||s[18]!==p?(j=t.jsxs("div",{className:u,children:[f,p]}),s[16]=u,s[17]=f,s[18]=p,s[19]=j):j=s[19],j}),Vt=I.memo(function(e){const s=W.c(18),{connectionId:l,item:a,isSelected:i,onToggle:x}=e,d=`item-${l}-${a.id}`,m=i?"text-foreground":"text-muted-foreground";let n;s[0]!==m?(n=te("text-sm font-medium",m),s[0]=m,s[1]=n):n=s[1];let c;s[2]!==a.name||s[3]!==n?(c=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:n,children:a.name})}),s[2]=a.name,s[3]=n,s[4]=c):c=s[4];let u;s[5]!==a.description?(u=a.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:a.description}),s[5]=a.description,s[6]=u):u=s[6];let r;s[7]!==c||s[8]!==u?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,u]}),s[7]=c,s[8]=u,s[9]=r):r=s[9];const g=`item-${l}-${a.id}`;let f;s[10]!==i||s[11]!==x||s[12]!==g?(f=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Je,{id:g,checked:i,onCheckedChange:x,onClick:Ft})}),s[10]=i,s[11]=x,s[12]=g,s[13]=f):f=s[13];let p;return s[14]!==d||s[15]!==r||s[16]!==f?(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:d,children:[r,f]}),s[14]=d,s[15]=r,s[16]=f,s[17]=p):p=s[17],p});function lt({itemSet:o,onItemSetChange:e,getItems:s,itemLabel:l,emptyItemsMessage:a,extraContent:i}){const[x,d]=I.useState(""),m=I.useDeferredValue(x),[n,c]=I.useState("all"),[u,r]=I.useState(!1),g=I.useRef(new Set(Object.keys(o))),f=qe({searchTerm:m.trim()||void 0}),p=g.current,j=[...p.values()].map(h=>f.find(_=>_.id===h)).filter(h=>h!==void 0),y=f.filter(h=>!p.has(h.id)),v=[...j,...y],b=h=>{const _=o[h];return _!==void 0&&_.length>0},C=v.filter(h=>{if(n==="all")return!0;const _=b(h.id);return n==="selected"?_:n==="unselected"?!_:!0}),[N,k]=I.useState(v[0]?.id??null),w=N?v.find(h=>h.id===N)??null:null,E=w?s(w):[],A=(h,_)=>o[h]?.includes(_)??!1,B=(h,_)=>{const $=o[h]??[],z=$.includes(_),U={...o};if(z){const P=$.filter(M=>M!==_);P.length===0?delete U[h]:U[h]=P}else U[h]=[...$,_];e(U)},Z=h=>{const _=v.find(D=>D.id===h);if(!_)return;const $=s(_);if($.length===0)return;const z=o[h]??[],U=$.map(D=>D.id),P=z.length>0&&U.every(D=>z.includes(D)),M={...o};P?delete M[h]:(M[h]=U,k(h)),e(M)},O=h=>{k(h),r(!0)},V=()=>{r(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:te("w-full md:w-80 border-r border-border flex flex-col",u&&"hidden md:flex"),children:[t.jsx(ft,{value:x,onChange:d,placeholder:"Search Connections..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>c("all"),className:te("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",n==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>c("selected"),className:te("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",n==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>c("unselected"),className:te("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",n==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:C.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:x?"No connections found":n==="selected"?"No servers selected":n==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:C.map(h=>{const $=s(h).length,z=o[h.id]?.length??0;return t.jsx(Ot,{connection:h,isSelected:N===h.id,hasItemsEnabled:b(h.id),activeItemsCount:z,totalItemsCount:$,onSelect:()=>O(h.id),onToggle:()=>Z(h.id)},h.id)})})})]}),t.jsx("div",{className:te("flex-1 flex-col",u?"flex":"hidden md:flex"),children:w?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(L,{variant:"ghost",size:"sm",onClick:V,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(ut,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(Me,{icon:w.icon,name:w.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:w.title}),w.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:w.description})]})]})]}),i,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:E.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:a||`This connection has no ${l} available`}):t.jsx("div",{className:"space-y-2",children:E.map(h=>t.jsx(Vt,{connectionId:w.id,item:h,isSelected:A(w.id,h.id),onToggle:()=>B(w.id,h.id)},h.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",l]})})})]})}function Gt(o){return o.stopPropagation()}function Ft(o){return o.stopPropagation()}function Lt(o){const e=W.c(6),{promptSet:s,onPromptSetChange:l,connectionPrompts:a}=o;let i;e[0]!==a?(i=m=>(a.get(m.id)??[]).map(Wt),e[0]=a,e[1]=i):i=e[1];const x=i;let d;return e[2]!==x||e[3]!==l||e[4]!==s?(d=t.jsx(lt,{itemSet:s,onItemSetChange:l,getItems:x,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=x,e[3]=l,e[4]=s,e[5]=d):d=e[5],d}function Wt(o){return{id:o.name,name:o.name,description:o.description}}function Bt(o){return o.includes("*")}function qt(o){const e=W.c(27),{patterns:s,onAddPattern:l,onRemovePattern:a}=o,[i,x]=I.useState("");let d;e[0]!==i||e[1]!==l||e[2]!==s?(d=()=>{const r=i.trim();r&&!s.includes(r)&&(l(r),x(""))},e[0]=i,e[1]=l,e[2]=s,e[3]=d):d=e[3];const m=d;let n;e[4]!==m?(n=r=>{r.key==="Enter"&&(r.preventDefault(),m())},e[4]=m,e[5]=n):n=e[5];const c=n;let u;if(e[6]!==m||e[7]!==c||e[8]!==i||e[9]!==a||e[10]!==s){const r=s.filter(Bt);let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("code",{children:"*"}),e[12]=g):g=e[12];let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",g," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=f):f=e[13];let p;e[14]===Symbol.for("react.memo_cache_sentinel")?(p=k=>x(k.target.value),e[14]=p):p=e[14];let j;e[15]!==c||e[16]!==i?(j=t.jsx($e,{value:i,onChange:p,onKeyDown:c,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=c,e[16]=i,e[17]=j):j=e[17];let y;e[18]!==i?(y=i.trim(),e[18]=i,e[19]=y):y=e[19];const v=!y;let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(ht,{size:16}),e[20]=b):b=e[20];let C;e[21]!==m||e[22]!==v?(C=t.jsx(L,{type:"button",variant:"outline",size:"sm",onClick:m,disabled:v,children:b}),e[21]=m,e[22]=v,e[23]=C):C=e[23];let N;e[24]!==C||e[25]!==j?(N=t.jsxs("div",{className:"flex gap-2",children:[j,C]}),e[24]=C,e[25]=j,e[26]=N):N=e[26],u=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[f,N,r.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:r.map(k=>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:k}),t.jsx("button",{type:"button",onClick:()=>a(k),className:"text-muted-foreground hover:text-foreground",children:t.jsx(xt,{size:12})})]},k))})]}),e[6]=m,e[7]=c,e[8]=i,e[9]=a,e[10]=s,e[11]=u}else u=e[11];return u}function Ht(o){const e=W.c(23),{resourceSet:s,onResourceSetChange:l,connectionResources:a}=o,[i]=I.useState(null);let x;e[0]!==a?(x=b=>(a.get(b.id)??[]).map(Jt),e[0]=a,e[1]=x):x=e[1];const d=x;let m;e[2]!==l||e[3]!==s?(m=(b,C)=>{const N=s[b]??[];N.includes(C)||l({...s,[b]:[...N,C]})},e[2]=l,e[3]=s,e[4]=m):m=e[4];const n=m;let c;e[5]!==l||e[6]!==s?(c=(b,C)=>{const k=(s[b]??[]).filter(w=>w!==C);if(k.length===0){const w={...s};delete w[b],l(w)}else l({...s,[b]:k})},e[5]=l,e[6]=s,e[7]=c):c=e[7];const u=c;let r;e[8]!==l?(r=b=>{l(b)},e[8]=l,e[9]=r):r=e[9];const g=r;let f;e[10]!==s||e[11]!==i?(f=i?s[i]??[]:[],e[10]=s,e[11]=i,e[12]=f):f=e[12];const p=f;let j;e[13]!==n||e[14]!==u||e[15]!==i||e[16]!==p?(j=i?t.jsx(qt,{patterns:p,onAddPattern:b=>n(i,b),onRemovePattern:b=>u(i,b)}):null,e[13]=n,e[14]=u,e[15]=i,e[16]=p,e[17]=j):j=e[17];const y=j;let v;return e[18]!==y||e[19]!==d||e[20]!==g||e[21]!==s?(v=t.jsx("div",{className:"h-full",children:t.jsx(lt,{itemSet:s,onItemSetChange:g,getItems:d,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:y})}),e[18]=y,e[19]=d,e[20]=g,e[21]=s,e[22]=v):v=e[22],v}function Jt(o){return{id:o.uri,name:o.name||o.uri,description:o.description||o.uri}}function Qt(o){const s=new TextEncoder().encode(o),l=Array.from(s,a=>String.fromCharCode(a)).join("");return btoa(l)}function Zt(o){const e=W.c(52),{serverName:s,gatewayUrl:l}=o,[a,i]=I.useState(!1),[x,d]=I.useState(null),m=wt(s);let n,c,u,r;if(e[0]!==l||e[1]!==m){const R={type:"http",url:l},he={[m]:R};n=JSON.stringify(he,null,2);const se=pe=>JSON.stringify({...R,headers:{"x-mesh-client":pe}},null,2),oe=Qt(se("Cursor"));c=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(m)}&config=${encodeURIComponent(oe)}`;const xe=se("Claude Code");u=m;let Q;e[6]===Symbol.for("react.memo_cache_sentinel")?(Q=/'/g,e[6]=Q):Q=e[6],r=xe.replace(Q,"'\\''"),e[0]=l,e[1]=m,e[2]=n,e[3]=c,e[4]=u,e[5]=r}else n=e[2],c=e[3],u=e[4],r=e[5];const g=`claude mcp add "${u}" --config '${r}'`;let f;e[7]!==n?(f=async()=>{await navigator.clipboard.writeText(n),i(!0),Ae.success("Configuration copied to clipboard"),setTimeout(()=>i(!1),2e3)},e[7]=n,e[8]=f):f=e[8];const p=f;let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=async(R,he)=>{await navigator.clipboard.writeText(R),d(he),Ae.success(`${he} command copied`),setTimeout(()=>d(null),2e3)},e[9]=j):j=e[9];const y=j,v=Kt;let b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[10]=b):b=e[10];let C;e[11]!==a?(C=a?t.jsx(De,{size:14}):t.jsx(et,{size:14}),e[11]=a,e[12]=C):C=e[12];let N;e[13]!==p||e[14]!==C?(N=t.jsx(Y,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:p,children:C})}),e[13]=p,e[14]=C,e[15]=N):N=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ee,{children:"Copy configuration"}),e[16]=k):k=e[16];let w;e[17]!==N?(w=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(K,{children:t.jsxs(X,{children:[N,k]})})}),e[17]=N,e[18]=w):w=e[18];let E;e[19]!==n||e[20]!==p?(E=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:n}),e[19]=n,e[20]=p,e[21]=E):E=e[21];let A;e[22]!==E||e[23]!==w?(A=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[w,E]}),e[22]=E,e[23]=w,e[24]=A):A=e[24];let B;e[25]!==c?(B=()=>v(c),e[25]=c,e[26]=B):B=e[26];let Z,O;e[27]===Symbol.for("react.memo_cache_sentinel")?(Z=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%)"}}),O=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=Z,e[28]=O):(Z=e[27],O=e[28]);let V;e[29]!==B?(V=t.jsx(Y,{asChild:!0,children:t.jsxs(L,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:B,children:[Z,O]})}),e[29]=B,e[30]=V):V=e[30];let h;e[31]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(ee,{children:"Add to Cursor"}),e[31]=h):h=e[31];let _;e[32]!==V?(_=t.jsx(K,{children:t.jsxs(X,{children:[V,h]})}),e[32]=V,e[33]=_):_=e[33];let $;e[34]!==g?($=()=>y(g,"Claude"),e[34]=g,e[35]=$):$=e[35];let z,U;e[36]===Symbol.for("react.memo_cache_sentinel")?(z=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%)"}}),U=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=z,e[37]=U):(z=e[36],U=e[37]);let P;e[38]!==x?(P=x==="Claude"&&t.jsx(De,{size:14,className:"ml-2 text-green-500"}),e[38]=x,e[39]=P):P=e[39];let M;e[40]!==$||e[41]!==P?(M=t.jsx(Y,{asChild:!0,children:t.jsxs(L,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:$,children:[z,U,P]})}),e[40]=$,e[41]=P,e[42]=M):M=e[42];let D;e[43]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(ee,{children:"Add to Claude Code"}),e[43]=D):D=e[43];let q;e[44]!==M?(q=t.jsx(K,{children:t.jsxs(X,{children:[M,D]})}),e[44]=M,e[45]=q):q=e[45];let H;e[46]!==_||e[47]!==q?(H=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[_,q]}),e[46]=_,e[47]=q,e[48]=H):H=e[48];let J;return e[49]!==A||e[50]!==H?(J=t.jsxs("div",{className:"flex flex-col gap-4",children:[b,A,H]}),e[49]=A,e[50]=H,e[51]=J):J=e[51],J}function Kt(o){window.open(o,"_blank")}const Xt=Mt.pick({title:!0,description:!0,status:!0,tool_selection_mode:!0,tool_selection_strategy:!0}).extend({title:S().min(1,"Name is required").max(255)});function Fe(o,e){const s={};for(const l of o.connections)if(l.selected_tools===null){const a=e.get(l.connection_id)??[];a.length>0&&(s[l.connection_id]=a)}else l.selected_tools.length>0&&(s[l.connection_id]=l.selected_tools);return s}function Le(o){const e={};for(const s of o.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 We(o){const e={};for(const s of o.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 Yt(o,e,s,l){const a=new Set([...Object.keys(o),...Object.keys(e),...Object.keys(s)]);return Array.from(a).map(i=>{const x=o[i]??[],d=l.get(i)??[],m=d.length>0&&d.every(n=>x.includes(n));return{connection_id:i,selected_tools:x.length===0||m?null:x,selected_resources:e[i]??null,selected_prompts:s[i]??null}})}function es(o){const e=W.c(27),{open:s,onOpenChange:l,gateway:a}=o,[i,x]=I.useState(!1),d=`${window.location.origin}/mcp/gateway/${a.id}`;let m;e[0]!==d?(m=async()=>{await navigator.clipboard.writeText(d),x(!0),Ae.success("Agent URL copied to clipboard"),setTimeout(()=>x(!1),2e3)},e[0]=d,e[1]=m):m=e[1];const n=m;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Nt,{children:t.jsx(It,{children:"Share Agent"})}),e[2]=c):c=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Agent URL"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Share this URL to connect to the agent"})]}),e[3]=u):u=e[3];let r;e[4]!==d?(r=t.jsx($e,{value:d,readOnly:!0,className:"font-mono text-xs"}),e[4]=d,e[5]=r):r=e[5];let g;e[6]!==i?(g=i?t.jsx(De,{size:16}):t.jsx(et,{size:16}),e[6]=i,e[7]=g):g=e[7];let f;e[8]!==n||e[9]!==g?(f=t.jsx(L,{type:"button",variant:"outline",size:"icon",onClick:n,className:"shrink-0",children:g}),e[8]=n,e[9]=g,e[10]=f):f=e[10];let p;e[11]!==r||e[12]!==f?(p=t.jsxs("div",{className:"flex flex-col gap-3",children:[u,t.jsxs("div",{className:"flex gap-2",children:[r,f]})]}),e[11]=r,e[12]=f,e[13]=p):p=e[13];let j;e[14]!==a.id||e[15]!==a.title?(j=a.title||`agent-${a.id.slice(0,8)}`,e[14]=a.id,e[15]=a.title,e[16]=j):j=e[16];let y;e[17]!==d||e[18]!==j?(y=t.jsx("div",{className:"border-t border-border pt-6",children:t.jsx(Zt,{serverName:j,gatewayUrl:d})}),e[17]=d,e[18]=j,e[19]=y):y=e[19];let v;e[20]!==p||e[21]!==y?(v=t.jsxs(kt,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[c,t.jsxs("div",{className:"flex flex-col gap-6",children:[p,y]})]}),e[20]=p,e[21]=y,e[22]=v):v=e[22];let b;return e[23]!==l||e[24]!==s||e[25]!==v?(b=t.jsx(Tt,{open:s,onOpenChange:l,children:v}),e[23]=l,e[24]=s,e[25]=v,e[26]=b):b=e[26],b}function ts(o){const e=W.c(31),{form:s,icon:l,gatewayId:a}=o,[i,x]=Ct(a);let d;e[0]!==s?(d=s.watch("title")||"Agent",e[0]=s,e[1]=d):d=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(vt,{}),e[2]=m):m=e[2];let n;e[3]!==l||e[4]!==d?(n=t.jsx(Me,{icon:l,name:d,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:m}),e[3]=l,e[4]=d,e[5]=n):n=e[5];let c;e[6]!==s.control?(c=t.jsx(be,{control:s.control,name:"status",render:is}),e[6]=s.control,e[7]=c):c=e[7];let u;e[8]!==n||e[9]!==c?(u=t.jsxs("div",{className:"flex items-start justify-between",children:[n,c]}),e[8]=n,e[9]=c,e[10]=u):u=e[10];let r;e[11]!==s.control?(r=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(be,{control:s.control,name:"title",render:ns}),t.jsx(be,{control:s.control,name:"description",render:ls})]}),e[11]=s.control,e[12]=r):r=e[12];let g;e[13]!==u||e[14]!==r?(g=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[u,r]}),e[13]=u,e[14]=r,e[15]=g):g=e[15];let f;e[16]!==s.control?(f=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(be,{control:s.control,name:"tool_selection_mode",render:os}),t.jsx(be,{control:s.control,name:"tool_selection_strategy",render:ss})]}),e[16]=s.control,e[17]=f):f=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"System Prompt"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Stored locally for now"})]}),e[18]=p):p=e[18];let j;e[19]!==x?(j=C=>x(C.target.value),e[19]=x,e[20]=j):j=e[20];let y;e[21]!==i||e[22]!==j?(y=t.jsxs("div",{className:"flex flex-col gap-3 p-5",children:[p,t.jsx(Pt,{value:i,onChange:j,placeholder:"Enter system prompt instructions...",className:"min-h-[240px] resize-none text-sm leading-relaxed"})]}),e[21]=i,e[22]=j,e[23]=y):y=e[23];let v;e[24]!==y||e[25]!==g||e[26]!==f?(v=t.jsxs("div",{className:"flex flex-col",children:[g,f,y]}),e[24]=y,e[25]=g,e[26]=f,e[27]=v):v=e[27];let b;return e[28]!==s||e[29]!==v?(b=t.jsx("div",{className:"flex flex-col h-full overflow-auto",children:t.jsx($t,{...s,children:v})}),e[28]=s,e[29]=v,e[30]=b):b=e[30],b}function ss(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Qe,{className:"mb-0",children:"Agent Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(K,{children:t.jsxs(X,{children:[t.jsx(Y,{asChild:!0,children:t.jsx(L,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Agent strategy help",children:t.jsx(tt,{size:14,className:"text-muted-foreground"})})}),t.jsx(ee,{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(Ze,{value:e.value,onValueChange:e.onChange,children:[t.jsx(_e,{children:t.jsx(Ke,{className:"w-[180px]",children:t.jsx(Xe,{})})}),t.jsxs(Ye,{children:[t.jsx(je,{value:"passthrough",children:"Passthrough"}),t.jsx(je,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(je,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(Se,{})]})}function os(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Qe,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(K,{children:t.jsxs(X,{children:[t.jsx(Y,{asChild:!0,children:t.jsx(L,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(tt,{size:14,className:"text-muted-foreground"})})}),t.jsx(ee,{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(Ze,{value:e.value,onValueChange:e.onChange,children:[t.jsx(_e,{children:t.jsx(Ke,{className:"w-[180px]",children:t.jsx(Xe,{})})}),t.jsxs(Ye,{children:[t.jsx(je,{value:"inclusion",children:"Include Selected"}),t.jsx(je,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(Se,{})]})}function ls(o){const{field:e}=o;return t.jsxs(ve,{className:"w-full space-y-0",children:[t.jsx(_e,{children:t.jsx($e,{...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(Se,{})]})}function ns(o){const{field:e}=o;return t.jsxs(ve,{className:"w-full space-y-0",children:[t.jsx(_e,{children:t.jsx($e,{...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:"Agent Name"})}),t.jsx(Se,{})]})}function is(o){const{field:e}=o;return t.jsxs(ve,{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(_e,{children:t.jsx(bt,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(Se,{})]})}function rs(o){const e=W.c(82),{gateway:s,gatewayId:l,requestedTabId:a}=o,x=rt().location.href,d=at();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/$org/gateways/$gatewayId"},e[0]=m):m=e[0];const n=Be(m),c=yt();let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u={},e[1]=u):u=e[1];const r=qe(u);let g;e[2]!==r?(g=r.map(cs),e[2]=r,e[3]=g):g=e[3];const f=g,{promptsMap:p}=_t(f),{resourcesMap:j}=St(f);let y;if(e[4]!==r){y=new Map;for(const T of r)T.tools&&T.tools.length>0&&y.set(T.id,T.tools.map(as));e[4]=r,e[5]=y}else y=e[5];let v;e[6]!==y||e[7]!==s?(v=()=>Fe(s,y),e[6]=y,e[7]=s,e[8]=v):v=e[8];const[b,C]=I.useState(v);let N;e[9]!==s?(N=()=>Le(s),e[9]=s,e[10]=N):N=e[10];const[k,w]=I.useState(N);let E;e[11]!==s?(E=()=>We(s),e[11]=s,e[12]=E):E=e[12];const[A,B]=I.useState(E),[Z,O]=I.useState(!1),[V,h]=I.useState(!1);let _;e[13]===Symbol.for("react.memo_cache_sentinel")?(_=T=>{C(T),O(!0)},e[13]=_):_=e[13];const $=_;let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=T=>{w(T),O(!0)},e[14]=z):z=e[14];const U=z;let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=T=>{B(T),O(!0)},e[15]=P):P=e[15];const M=P;let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=ct(Xt),e[16]=D):D=e[16];const q=s.tool_selection_mode??"inclusion",H=s.tool_selection_strategy??"passthrough";let J;e[17]!==s.description||e[18]!==s.status||e[19]!==s.title||e[20]!==q||e[21]!==H?(J={resolver:D,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:q,tool_selection_strategy:H}},e[17]=s.description,e[18]=s.status,e[19]=s.title,e[20]=q,e[21]=H,e[22]=J):J=e[22];const R=dt(J),se=R.formState.isDirty||Z;let oe;e[23]!==c.update||e[24]!==y||e[25]!==R||e[26]!==l||e[27]!==A||e[28]!==k||e[29]!==b?(oe=async()=>{const T=R.getValues(),Re=Yt(b,k,A,y);await c.update.mutateAsync({id:l,data:{title:T.title,description:T.description,status:T.status,tool_selection_mode:T.tool_selection_mode,tool_selection_strategy:T.tool_selection_strategy,connections:Re}}),R.reset(T),O(!1)},e[23]=c.update,e[24]=y,e[25]=R,e[26]=l,e[27]=A,e[28]=k,e[29]=b,e[30]=oe):oe=e[30];const xe=oe;let Q;e[31]!==y||e[32]!==R||e[33]!==s?(Q=()=>{R.reset({title:s.title,description:s.description,status:s.status,tool_selection_mode:s.tool_selection_mode??"inclusion",tool_selection_strategy:s.tool_selection_strategy??"passthrough"}),C(Fe(s,y)),w(Le(s)),B(We(s)),O(!1)},e[31]=y,e[32]=R,e[33]=s,e[34]=Q):Q=e[34];const pe=Q;let Ce;e[35]===Symbol.for("react.memo_cache_sentinel")?(Ce=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[35]=Ce):Ce=e[35];const Ge=Ce,G=Ge.some(T=>T.id===a)?a:"settings";let we;e[36]!==n?(we=T=>{n({search:Re=>({...Re,tab:T}),replace:!0})},e[36]=n,e[37]=we):we=e[37];const ze=we,ge=c.update.isPending;let le;e[38]!==d.history?(le=()=>d.history.back(),e[38]=d.history,e[39]=le):le=e[39];let ne;e[40]!==G||e[41]!==ze?(ne=t.jsx(At,{children:t.jsx(zt,{tabs:Ge,activeTab:G,onTabChange:ze})}),e[40]=G,e[41]=ze,e[42]=ne):ne=e[42];let ie;e[43]!==pe||e[44]!==xe||e[45]!==se||e[46]!==ge?(ie=se&&t.jsxs(t.Fragment,{children:[t.jsx(K,{children:t.jsxs(X,{delayDuration:0,children:[t.jsx(Y,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(L,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ge,onClick:pe,"aria-label":"Cancel",children:t.jsx(Rt,{size:14})})})}),t.jsx(ee,{side:"bottom",children:"Cancel"})]})}),t.jsx(K,{children:t.jsxs(X,{delayDuration:0,children:[t.jsx(Y,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(L,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ge,onClick:xe,"aria-label":"Save",children:ge?t.jsx(Ee,{size:14,className:"animate-spin"}):t.jsx(st,{size:14})})})}),t.jsx(ee,{side:"bottom",children:"Save"})]})})]}),e[43]=pe,e[44]=xe,e[45]=se,e[46]=ge,e[47]=ie):ie=e[47];let Ne;e[48]===Symbol.for("react.memo_cache_sentinel")?(Ne=()=>h(!0),e[48]=Ne):Ne=e[48];let Ie;e[49]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsx(K,{children:t.jsxs(X,{delayDuration:0,children:[t.jsx(Y,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(L,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:Ne,"aria-label":"Share",children:t.jsx(ot,{size:14})})})}),t.jsx(ee,{side:"bottom",children:"Share"})]})}),e[49]=Ie):Ie=e[49];const Pe=s.icon??"cpu_chip";let re;e[50]!==s.title||e[51]!==Pe||e[52]!==x?(re=t.jsx(pt,{title:s.title,url:x,icon:Pe}),e[50]=s.title,e[51]=Pe,e[52]=x,e[53]=re):re=e[53];let ae;e[54]!==ie||e[55]!==re?(ae=t.jsxs(Dt,{children:[ie,Ie,re]}),e[54]=ie,e[55]=re,e[56]=ae):ae=e[56];let ke;e[57]===Symbol.for("react.memo_cache_sentinel")?(ke=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Ee,{size:32,className:"animate-spin text-muted-foreground"})}),e[57]=ke):ke=e[57];let ce;e[58]!==G||e[59]!==p||e[60]!==j||e[61]!==R||e[62]!==s.icon||e[63]!==l||e[64]!==A||e[65]!==k||e[66]!==b?(ce=G==="settings"?t.jsx(ts,{form:R,icon:s.icon,gatewayId:l}):G==="tools"?t.jsx(gt,{toolSet:b,onToolSetChange:$}):G==="resources"?t.jsx(Ht,{resourceSet:k,onResourceSetChange:U,connectionResources:j}):G==="prompts"?t.jsx(Lt,{promptSet:A,onPromptSetChange:M,connectionPrompts:p}):null,e[58]=G,e[59]=p,e[60]=j,e[61]=R,e[62]=s.icon,e[63]=l,e[64]=A,e[65]=k,e[66]=b,e[67]=ce):ce=e[67];let de;e[68]!==ce?(de=t.jsx(I.Suspense,{fallback:ke,children:ce}),e[68]=ce,e[69]=de):de=e[69];let me;e[70]!==G||e[71]!==de?(me=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-hidden",children:t.jsx("div",{className:"h-full overflow-auto",children:t.jsx(He,{children:de},G)})})}),e[70]=G,e[71]=de,e[72]=me):me=e[72];let ue;e[73]!==s||e[74]!==V?(ue=t.jsx(es,{open:V,onOpenChange:h,gateway:s}),e[73]=s,e[74]=V,e[75]=ue):ue=e[75];let Te;return e[76]!==le||e[77]!==ne||e[78]!==ae||e[79]!==me||e[80]!==ue?(Te=t.jsxs(Et,{onBack:le,children:[ne,ae,me,ue]}),e[76]=le,e[77]=ne,e[78]=ae,e[79]=me,e[80]=ue,e[81]=Te):Te=e[81],Te}function as(o){return o.name}function cs(o){return o.id}function ds(){const o=W.c(10);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},o[0]=e):e=o[0];const s=Be(e);let l;o[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/gateways/$gatewayId"},o[1]=l):l=o[1];const{gatewayId:a,org:i}=nt(l);let x;o[2]===Symbol.for("react.memo_cache_sentinel")?(x={from:"/shell/$org/gateways/$gatewayId"},o[2]=x):x=o[2];const m=it(x).tab||"settings",n=jt(a);if(!n){let u;return o[3]!==s||o[4]!==i?(u=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(mt,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(L,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:i}}),children:"Back to agents"})})}),o[3]=s,o[4]=i,o[5]=u):u=o[5],u}let c;return o[6]!==n||o[7]!==a||o[8]!==m?(c=t.jsx(rs,{gateway:n,gatewayId:a,requestedTabId:m}),o[6]=n,o[7]=a,o[8]=m,o[9]=c):c=o[9],c}function ms(){const o=W.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(He,{children:t.jsx(I.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ee,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ds,{})})}),o[0]=e):e=o[0],e}function Ws(){const o=W.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ms,{}),o[0]=e):e=o[0],e}export{Ws as default};
1
+ import{r as I,a0 as ye,s as fe,W as F,v as S,Q as Ue,c as W,j as t,h as Be,d as nt,b as it,i as rt,aG as at,w as ct,x as dt,t as Ae}from"./index-DHr9tFb0.js";import{I as Me,u as qe,E as mt}from"./use-connection-gZqQ1FAI.js";import{E as He}from"./error-boundary-9rVpFVah.js";import{C as Je}from"./checkbox-Bp9oZUjM.js";import{c as te,B as L,I as $e}from"./input-C4WvdKkR.js";import{i as ut}from"./ArrowLeft-DQOG1GuJ.js";import{C as ft}from"./collection-search-CIs95Rnw.js";import{s as ht}from"./Plus-KTlOMNSY.js";import{i as xt}from"./X-BFdZnqth.js";import{P as pt}from"./pin-to-sidebar-button-Bau5uIKK.js";import{T as gt,S as bt}from"./switch-D3qS-cJT.js";import{b as jt,a as yt,i as vt}from"./use-gateway-BAeublLm.js";import{u as _t,a as St}from"./use-connection-resources-CBnleHDw.js";import{u as Ct}from"./use-gateway-system-prompt-DcPNvMKK.js";import{s as wt}from"./slugify-CEUa2lfQ.js";import{D as Nt,a as It,c as kt,d as Tt}from"./dialog-DK6VaggX.js";import{F as be,a as $t,b as ve,d as _e,f as Se,c as Qe}from"./form-BGufVhpJ.js";import{R as zt}from"./resource-tabs-DXcOsIua.js";import{S as Ze,a as Ke,b as Xe,c as Ye,d as je}from"./select-58kzPmSH.js";import{T as Pt}from"./textarea-KpHZNzGY.js";import{a as K,c as X,b as Y,T as ee,i as De}from"./project-context-provider-SYQQWwHt.js";import{a as et}from"./Copy01-DS49wIzW.js";import{i as Rt}from"./FlipBackward-BRcPqCms.js";import{i as tt}from"./InfoCircle-r2yyYHHv.js";import{i as Ee}from"./Loading01-C0_l8AxO.js";import{a as At,V as Dt,b as Et}from"./layout-9R3rtCy3.js";import"./use-organization-settings-g1OUF8Uc.js";import"./useQueries-DAJGlQiv.js";import"./localstorage-keys-DrIZl-Oa.js";import"./useQuery--jXLy0yb.js";import"./badge-99kEJDtp.js";import"./ChevronDown-Cdy__m-8.js";const st=({size:o=24,color:e="currentColor",...s})=>I.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},I.createElement("path",{d:"M7 3v3.4c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C7.76 8 8.04 8 8.6 8h6.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C17 7.24 17 6.96 17 6.4V4m0 17v-6.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C16.24 13 15.96 13 15.4 13H8.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C7 13.76 7 14.04 7 14.6V21M21 9.325V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h6.875c.489 0 .733 0 .963.055.204.05.4.13.579.24.201.123.374.296.72.642l3.126 3.126c.346.346.519.519.642.72.11.18.19.374.24.579.055.23.055.474.055.963Z"}));st.displayName="Save01";const ot=({size:o=24,color:e="currentColor",...s})=>I.createElement("svg",{viewBox:"0 0 24 24",width:o,height:o,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},I.createElement("path",{d:"m8.59 13.51 6.83 3.98m-.01-10.98-6.82 3.98M21 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm12 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));ot.displayName="Share07";const Oe=ye(["inclusion","exclusion"]).describe("Tool selection mode: 'inclusion' = include selected (default), 'exclusion' = exclude selected"),Ve=ye(["passthrough","smart_tool_selection","code_execution"]).describe("Gateway tool selection strategy: 'passthrough' (default), 'smart_tool_selection', or 'code_execution'"),Ut=fe({connection_id:S().describe("Connection ID"),selected_tools:F(S()).nullable().describe("Selected tool names. With 'inclusion' mode: null = all tools included. With 'exclusion' mode: null = entire connection excluded"),selected_resources:F(S()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. With 'inclusion' mode: null = all resources included."),selected_prompts:F(S()).nullable().describe("Selected prompt names. With 'inclusion' mode: null = all prompts included. With 'exclusion' mode: null = entire connection excluded.")}),Mt=fe({id:S().describe("Unique identifier for the gateway"),title:S().describe("Human-readable name for the gateway"),description:S().nullable().describe("Description of the gateway"),icon:S().nullable().optional().describe("Icon URL for the gateway"),created_at:S().describe("When the gateway was created"),updated_at:S().describe("When the gateway was last updated"),created_by:S().describe("User ID who created the gateway"),updated_by:S().optional().describe("User ID who last updated the gateway"),organization_id:S().describe("Organization ID this gateway belongs to"),tool_selection_strategy:Ve.describe("Gateway behavior strategy (metadata for now): 'passthrough', 'smart_tool_selection', or 'code_execution'"),tool_selection_mode:Oe.describe("Tool selection mode: 'inclusion' = include selected, 'exclusion' = exclude selected"),status:ye(["active","inactive"]).describe("Current status"),is_default:Ue().describe("Whether this is the Organization Agent for the organization"),connections:F(Ut).describe("Connections with their selected tools (behavior depends on tool_selection_mode)")});fe({title:S().min(1).max(255).describe("Name for the gateway"),description:S().nullable().optional().describe("Optional description"),tool_selection_strategy:Ve.optional().default("passthrough").describe("Gateway behavior strategy (defaults to 'passthrough')"),tool_selection_mode:Oe.optional().default("inclusion").describe("Tool selection mode (defaults to 'inclusion')"),icon:S().nullable().optional().describe("Optional icon URL"),status:ye(["active","inactive"]).optional().default("active").describe("Initial status"),is_default:Ue().optional().default(!1).describe("Whether this is the Organization Agent for the organization"),connections:F(fe({connection_id:S().describe("Connection ID"),selected_tools:F(S()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:F(S()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:F(S()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).describe("Connections to include/exclude (can be empty for exclusion mode)")});fe({title:S().min(1).max(255).optional().describe("New name"),description:S().nullable().optional().describe("New description (null to clear)"),tool_selection_strategy:Ve.optional().describe("New gateway behavior strategy"),tool_selection_mode:Oe.optional().describe("New tool selection mode"),icon:S().nullable().optional().describe("New icon URL (null to clear)"),status:ye(["active","inactive"]).optional().describe("New status"),is_default:Ue().optional().describe("Set as Organization Agent for the organization"),connections:F(fe({connection_id:S().describe("Connection ID"),selected_tools:F(S()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:F(S()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:F(S()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).optional().describe("New connections (replaces existing)")});const Ot=I.memo(function(e){const s=W.c(20),{connection:l,isSelected:a,hasItemsEnabled:i,activeItemsCount:x,totalItemsCount:d,onSelect:m,onToggle:n}=e,c=a?"bg-accent/50":"hover:bg-muted/50";let u;s[0]!==c?(u=te("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",c),s[0]=c,s[1]=u):u=s[1];let r;s[2]!==l.icon||s[3]!==l.title?(r=t.jsx(Me,{icon:l.icon,name:l.title,size:"xs"}),s[2]=l.icon,s[3]=l.title,s[4]=r):r=s[4];let g;s[5]!==l.title?(g=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),s[5]=l.title,s[6]=g):g=s[6];let f;s[7]!==m||s[8]!==r||s[9]!==g?(f=t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:m,children:[r,g]}),s[7]=m,s[8]=r,s[9]=g,s[10]=f):f=s[10];let p;s[11]!==x||s[12]!==i||s[13]!==n||s[14]!==d?(p=d>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[x,"/",d]}),t.jsx(Je,{checked:i,onCheckedChange:n,onClick:Gt})]}),s[11]=x,s[12]=i,s[13]=n,s[14]=d,s[15]=p):p=s[15];let j;return s[16]!==u||s[17]!==f||s[18]!==p?(j=t.jsxs("div",{className:u,children:[f,p]}),s[16]=u,s[17]=f,s[18]=p,s[19]=j):j=s[19],j}),Vt=I.memo(function(e){const s=W.c(18),{connectionId:l,item:a,isSelected:i,onToggle:x}=e,d=`item-${l}-${a.id}`,m=i?"text-foreground":"text-muted-foreground";let n;s[0]!==m?(n=te("text-sm font-medium",m),s[0]=m,s[1]=n):n=s[1];let c;s[2]!==a.name||s[3]!==n?(c=t.jsx("div",{className:"flex items-center gap-2 mb-1",children:t.jsx("span",{className:n,children:a.name})}),s[2]=a.name,s[3]=n,s[4]=c):c=s[4];let u;s[5]!==a.description?(u=a.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:a.description}),s[5]=a.description,s[6]=u):u=s[6];let r;s[7]!==c||s[8]!==u?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[c,u]}),s[7]=c,s[8]=u,s[9]=r):r=s[9];const g=`item-${l}-${a.id}`;let f;s[10]!==i||s[11]!==x||s[12]!==g?(f=t.jsx("div",{className:"flex items-center shrink-0",children:t.jsx(Je,{id:g,checked:i,onCheckedChange:x,onClick:Ft})}),s[10]=i,s[11]=x,s[12]=g,s[13]=f):f=s[13];let p;return s[14]!==d||s[15]!==r||s[16]!==f?(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:d,children:[r,f]}),s[14]=d,s[15]=r,s[16]=f,s[17]=p):p=s[17],p});function lt({itemSet:o,onItemSetChange:e,getItems:s,itemLabel:l,emptyItemsMessage:a,extraContent:i}){const[x,d]=I.useState(""),m=I.useDeferredValue(x),[n,c]=I.useState("all"),[u,r]=I.useState(!1),g=I.useRef(new Set(Object.keys(o))),f=qe({searchTerm:m.trim()||void 0}),p=g.current,j=[...p.values()].map(h=>f.find(_=>_.id===h)).filter(h=>h!==void 0),y=f.filter(h=>!p.has(h.id)),v=[...j,...y],b=h=>{const _=o[h];return _!==void 0&&_.length>0},C=v.filter(h=>{if(n==="all")return!0;const _=b(h.id);return n==="selected"?_:n==="unselected"?!_:!0}),[N,k]=I.useState(v[0]?.id??null),w=N?v.find(h=>h.id===N)??null:null,E=w?s(w):[],A=(h,_)=>o[h]?.includes(_)??!1,B=(h,_)=>{const $=o[h]??[],z=$.includes(_),U={...o};if(z){const P=$.filter(M=>M!==_);P.length===0?delete U[h]:U[h]=P}else U[h]=[...$,_];e(U)},Z=h=>{const _=v.find(D=>D.id===h);if(!_)return;const $=s(_);if($.length===0)return;const z=o[h]??[],U=$.map(D=>D.id),P=z.length>0&&U.every(D=>z.includes(D)),M={...o};P?delete M[h]:(M[h]=U,k(h)),e(M)},O=h=>{k(h),r(!0)},V=()=>{r(!1)};return t.jsxs("div",{className:"flex h-full",children:[t.jsxs("div",{className:te("w-full md:w-80 border-r border-border flex flex-col",u&&"hidden md:flex"),children:[t.jsx(ft,{value:x,onChange:d,placeholder:"Search Connections..."}),t.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[t.jsx("button",{onClick:()=>c("all"),className:te("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",n==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"All"}),t.jsx("button",{onClick:()=>c("selected"),className:te("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",n==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Selected"}),t.jsx("button",{onClick:()=>c("unselected"),className:te("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",n==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:"Unselected"})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:C.length===0?t.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:x?"No connections found":n==="selected"?"No servers selected":n==="unselected"?"No unselected servers":"No connections available"}):t.jsx("div",{className:"p-2 space-y-1",children:C.map(h=>{const $=s(h).length,z=o[h.id]?.length??0;return t.jsx(Ot,{connection:h,isSelected:N===h.id,hasItemsEnabled:b(h.id),activeItemsCount:z,totalItemsCount:$,onSelect:()=>O(h.id),onToggle:()=>Z(h.id)},h.id)})})})]}),t.jsx("div",{className:te("flex-1 flex-col",u?"flex":"hidden md:flex"),children:w?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(L,{variant:"ghost",size:"sm",onClick:V,className:"h-8 w-8 p-0 shrink-0",children:t.jsx(ut,{size:20})}),t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[t.jsx(Me,{icon:w.icon,name:w.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:w.title}),w.description&&t.jsx("p",{className:"text-sm text-muted-foreground truncate",children:w.description})]})]})]}),i,t.jsx("div",{className:"flex-1 overflow-auto p-4",children:E.length===0?t.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:a||`This connection has no ${l} available`}):t.jsx("div",{className:"space-y-2",children:E.map(h=>t.jsx(Vt,{connectionId:w.id,item:h,isSelected:A(w.id,h.id),onToggle:()=>B(w.id,h.id)},h.id))})})]}):t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Select a connection to view its ",l]})})})]})}function Gt(o){return o.stopPropagation()}function Ft(o){return o.stopPropagation()}function Lt(o){const e=W.c(6),{promptSet:s,onPromptSetChange:l,connectionPrompts:a}=o;let i;e[0]!==a?(i=m=>(a.get(m.id)??[]).map(Wt),e[0]=a,e[1]=i):i=e[1];const x=i;let d;return e[2]!==x||e[3]!==l||e[4]!==s?(d=t.jsx(lt,{itemSet:s,onItemSetChange:l,getItems:x,itemLabel:"prompts",emptyItemsMessage:"This connection has no prompts available"}),e[2]=x,e[3]=l,e[4]=s,e[5]=d):d=e[5],d}function Wt(o){return{id:o.name,name:o.name,description:o.description}}function Bt(o){return o.includes("*")}function qt(o){const e=W.c(27),{patterns:s,onAddPattern:l,onRemovePattern:a}=o,[i,x]=I.useState("");let d;e[0]!==i||e[1]!==l||e[2]!==s?(d=()=>{const r=i.trim();r&&!s.includes(r)&&(l(r),x(""))},e[0]=i,e[1]=l,e[2]=s,e[3]=d):d=e[3];const m=d;let n;e[4]!==m?(n=r=>{r.key==="Enter"&&(r.preventDefault(),m())},e[4]=m,e[5]=n):n=e[5];const c=n;let u;if(e[6]!==m||e[7]!==c||e[8]!==i||e[9]!==a||e[10]!==s){const r=s.filter(Bt);let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("code",{children:"*"}),e[12]=g):g=e[12];let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Add URI patterns to match multiple resources. Use ",g," for single segment and ",t.jsx("code",{children:"**"})," for multiple segments."]}),e[13]=f):f=e[13];let p;e[14]===Symbol.for("react.memo_cache_sentinel")?(p=k=>x(k.target.value),e[14]=p):p=e[14];let j;e[15]!==c||e[16]!==i?(j=t.jsx($e,{value:i,onChange:p,onKeyDown:c,placeholder:"e.g., file:///**/*.ts or db://users/*",className:"flex-1 text-sm"}),e[15]=c,e[16]=i,e[17]=j):j=e[17];let y;e[18]!==i?(y=i.trim(),e[18]=i,e[19]=y):y=e[19];const v=!y;let b;e[20]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(ht,{size:16}),e[20]=b):b=e[20];let C;e[21]!==m||e[22]!==v?(C=t.jsx(L,{type:"button",variant:"outline",size:"sm",onClick:m,disabled:v,children:b}),e[21]=m,e[22]=v,e[23]=C):C=e[23];let N;e[24]!==C||e[25]!==j?(N=t.jsxs("div",{className:"flex gap-2",children:[j,C]}),e[24]=C,e[25]=j,e[26]=N):N=e[26],u=t.jsxs("div",{className:"border-b border-border p-4 space-y-3",children:[f,N,r.length>0&&t.jsx("div",{className:"flex flex-wrap gap-2",children:r.map(k=>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:k}),t.jsx("button",{type:"button",onClick:()=>a(k),className:"text-muted-foreground hover:text-foreground",children:t.jsx(xt,{size:12})})]},k))})]}),e[6]=m,e[7]=c,e[8]=i,e[9]=a,e[10]=s,e[11]=u}else u=e[11];return u}function Ht(o){const e=W.c(23),{resourceSet:s,onResourceSetChange:l,connectionResources:a}=o,[i]=I.useState(null);let x;e[0]!==a?(x=b=>(a.get(b.id)??[]).map(Jt),e[0]=a,e[1]=x):x=e[1];const d=x;let m;e[2]!==l||e[3]!==s?(m=(b,C)=>{const N=s[b]??[];N.includes(C)||l({...s,[b]:[...N,C]})},e[2]=l,e[3]=s,e[4]=m):m=e[4];const n=m;let c;e[5]!==l||e[6]!==s?(c=(b,C)=>{const k=(s[b]??[]).filter(w=>w!==C);if(k.length===0){const w={...s};delete w[b],l(w)}else l({...s,[b]:k})},e[5]=l,e[6]=s,e[7]=c):c=e[7];const u=c;let r;e[8]!==l?(r=b=>{l(b)},e[8]=l,e[9]=r):r=e[9];const g=r;let f;e[10]!==s||e[11]!==i?(f=i?s[i]??[]:[],e[10]=s,e[11]=i,e[12]=f):f=e[12];const p=f;let j;e[13]!==n||e[14]!==u||e[15]!==i||e[16]!==p?(j=i?t.jsx(qt,{patterns:p,onAddPattern:b=>n(i,b),onRemovePattern:b=>u(i,b)}):null,e[13]=n,e[14]=u,e[15]=i,e[16]=p,e[17]=j):j=e[17];const y=j;let v;return e[18]!==y||e[19]!==d||e[20]!==g||e[21]!==s?(v=t.jsx("div",{className:"h-full",children:t.jsx(lt,{itemSet:s,onItemSetChange:g,getItems:d,itemLabel:"resources",emptyItemsMessage:"This connection has no resources available",extraContent:y})}),e[18]=y,e[19]=d,e[20]=g,e[21]=s,e[22]=v):v=e[22],v}function Jt(o){return{id:o.uri,name:o.name||o.uri,description:o.description||o.uri}}function Qt(o){const s=new TextEncoder().encode(o),l=Array.from(s,a=>String.fromCharCode(a)).join("");return btoa(l)}function Zt(o){const e=W.c(52),{serverName:s,gatewayUrl:l}=o,[a,i]=I.useState(!1),[x,d]=I.useState(null),m=wt(s);let n,c,u,r;if(e[0]!==l||e[1]!==m){const R={type:"http",url:l},he={[m]:R};n=JSON.stringify(he,null,2);const se=pe=>JSON.stringify({...R,headers:{"x-mesh-client":pe}},null,2),oe=Qt(se("Cursor"));c=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(m)}&config=${encodeURIComponent(oe)}`;const xe=se("Claude Code");u=m;let Q;e[6]===Symbol.for("react.memo_cache_sentinel")?(Q=/'/g,e[6]=Q):Q=e[6],r=xe.replace(Q,"'\\''"),e[0]=l,e[1]=m,e[2]=n,e[3]=c,e[4]=u,e[5]=r}else n=e[2],c=e[3],u=e[4],r=e[5];const g=`claude mcp add "${u}" --config '${r}'`;let f;e[7]!==n?(f=async()=>{await navigator.clipboard.writeText(n),i(!0),Ae.success("Configuration copied to clipboard"),setTimeout(()=>i(!1),2e3)},e[7]=n,e[8]=f):f=e[8];const p=f;let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=async(R,he)=>{await navigator.clipboard.writeText(R),d(he),Ae.success(`${he} command copied`),setTimeout(()=>d(null),2e3)},e[9]=j):j=e[9];const y=j,v=Kt;let b;e[10]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{children:t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Install in your IDE"})}),e[10]=b):b=e[10];let C;e[11]!==a?(C=a?t.jsx(De,{size:14}):t.jsx(et,{size:14}),e[11]=a,e[12]=C):C=e[12];let N;e[13]!==p||e[14]!==C?(N=t.jsx(Y,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 shrink-0",onClick:p,children:C})}),e[13]=p,e[14]=C,e[15]=N):N=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ee,{children:"Copy configuration"}),e[16]=k):k=e[16];let w;e[17]!==N?(w=t.jsx("div",{className:"absolute top-2 right-2",children:t.jsx(K,{children:t.jsxs(X,{children:[N,k]})})}),e[17]=N,e[18]=w):w=e[18];let E;e[19]!==n||e[20]!==p?(E=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:n}),e[19]=n,e[20]=p,e[21]=E):E=e[21];let A;e[22]!==E||e[23]!==w?(A=t.jsxs("div",{className:"relative flex flex-col gap-2 p-3 bg-muted/50 rounded-lg",children:[w,E]}),e[22]=E,e[23]=w,e[24]=A):A=e[24];let B;e[25]!==c?(B=()=>v(c),e[25]=c,e[26]=B):B=e[26];let Z,O;e[27]===Symbol.for("react.memo_cache_sentinel")?(Z=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%)"}}),O=t.jsx("span",{className:"text-sm font-medium",children:"Cursor"}),e[27]=Z,e[28]=O):(Z=e[27],O=e[28]);let V;e[29]!==B?(V=t.jsx(Y,{asChild:!0,children:t.jsxs(L,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:B,children:[Z,O]})}),e[29]=B,e[30]=V):V=e[30];let h;e[31]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(ee,{children:"Add to Cursor"}),e[31]=h):h=e[31];let _;e[32]!==V?(_=t.jsx(K,{children:t.jsxs(X,{children:[V,h]})}),e[32]=V,e[33]=_):_=e[33];let $;e[34]!==g?($=()=>y(g,"Claude"),e[34]=g,e[35]=$):$=e[35];let z,U;e[36]===Symbol.for("react.memo_cache_sentinel")?(z=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%)"}}),U=t.jsx("span",{className:"text-sm font-medium",children:"Claude Code"}),e[36]=z,e[37]=U):(z=e[36],U=e[37]);let P;e[38]!==x?(P=x==="Claude"&&t.jsx(De,{size:14,className:"ml-2 text-green-500"}),e[38]=x,e[39]=P):P=e[39];let M;e[40]!==$||e[41]!==P?(M=t.jsx(Y,{asChild:!0,children:t.jsxs(L,{variant:"outline",className:"h-auto py-3 px-4 justify-center gap-2 flex-1 min-w-fit",onClick:$,children:[z,U,P]})}),e[40]=$,e[41]=P,e[42]=M):M=e[42];let D;e[43]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(ee,{children:"Add to Claude Code"}),e[43]=D):D=e[43];let q;e[44]!==M?(q=t.jsx(K,{children:t.jsxs(X,{children:[M,D]})}),e[44]=M,e[45]=q):q=e[45];let H;e[46]!==_||e[47]!==q?(H=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[_,q]}),e[46]=_,e[47]=q,e[48]=H):H=e[48];let J;return e[49]!==A||e[50]!==H?(J=t.jsxs("div",{className:"flex flex-col gap-4",children:[b,A,H]}),e[49]=A,e[50]=H,e[51]=J):J=e[51],J}function Kt(o){window.open(o,"_blank")}const Xt=Mt.pick({title:!0,description:!0,status:!0,tool_selection_mode:!0,tool_selection_strategy:!0}).extend({title:S().min(1,"Name is required").max(255)});function Fe(o,e){const s={};for(const l of o.connections)if(l.selected_tools===null){const a=e.get(l.connection_id)??[];a.length>0&&(s[l.connection_id]=a)}else l.selected_tools.length>0&&(s[l.connection_id]=l.selected_tools);return s}function Le(o){const e={};for(const s of o.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 We(o){const e={};for(const s of o.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 Yt(o,e,s,l){const a=new Set([...Object.keys(o),...Object.keys(e),...Object.keys(s)]);return Array.from(a).map(i=>{const x=o[i]??[],d=l.get(i)??[],m=d.length>0&&d.every(n=>x.includes(n));return{connection_id:i,selected_tools:x.length===0||m?null:x,selected_resources:e[i]??null,selected_prompts:s[i]??null}})}function es(o){const e=W.c(27),{open:s,onOpenChange:l,gateway:a}=o,[i,x]=I.useState(!1),d=`${window.location.origin}/mcp/gateway/${a.id}`;let m;e[0]!==d?(m=async()=>{await navigator.clipboard.writeText(d),x(!0),Ae.success("Agent URL copied to clipboard"),setTimeout(()=>x(!1),2e3)},e[0]=d,e[1]=m):m=e[1];const n=m;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Nt,{children:t.jsx(It,{children:"Share Agent"})}),e[2]=c):c=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"Agent URL"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Share this URL to connect to the agent"})]}),e[3]=u):u=e[3];let r;e[4]!==d?(r=t.jsx($e,{value:d,readOnly:!0,className:"font-mono text-xs"}),e[4]=d,e[5]=r):r=e[5];let g;e[6]!==i?(g=i?t.jsx(De,{size:16}):t.jsx(et,{size:16}),e[6]=i,e[7]=g):g=e[7];let f;e[8]!==n||e[9]!==g?(f=t.jsx(L,{type:"button",variant:"outline",size:"icon",onClick:n,className:"shrink-0",children:g}),e[8]=n,e[9]=g,e[10]=f):f=e[10];let p;e[11]!==r||e[12]!==f?(p=t.jsxs("div",{className:"flex flex-col gap-3",children:[u,t.jsxs("div",{className:"flex gap-2",children:[r,f]})]}),e[11]=r,e[12]=f,e[13]=p):p=e[13];let j;e[14]!==a.id||e[15]!==a.title?(j=a.title||`agent-${a.id.slice(0,8)}`,e[14]=a.id,e[15]=a.title,e[16]=j):j=e[16];let y;e[17]!==d||e[18]!==j?(y=t.jsx("div",{className:"border-t border-border pt-6",children:t.jsx(Zt,{serverName:j,gatewayUrl:d})}),e[17]=d,e[18]=j,e[19]=y):y=e[19];let v;e[20]!==p||e[21]!==y?(v=t.jsxs(kt,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[c,t.jsxs("div",{className:"flex flex-col gap-6",children:[p,y]})]}),e[20]=p,e[21]=y,e[22]=v):v=e[22];let b;return e[23]!==l||e[24]!==s||e[25]!==v?(b=t.jsx(Tt,{open:s,onOpenChange:l,children:v}),e[23]=l,e[24]=s,e[25]=v,e[26]=b):b=e[26],b}function ts(o){const e=W.c(31),{form:s,icon:l,gatewayId:a}=o,[i,x]=Ct(a);let d;e[0]!==s?(d=s.watch("title")||"Agent",e[0]=s,e[1]=d):d=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(vt,{}),e[2]=m):m=e[2];let n;e[3]!==l||e[4]!==d?(n=t.jsx(Me,{icon:l,name:d,size:"lg",className:"shrink-0 shadow-sm",fallbackIcon:m}),e[3]=l,e[4]=d,e[5]=n):n=e[5];let c;e[6]!==s.control?(c=t.jsx(be,{control:s.control,name:"status",render:is}),e[6]=s.control,e[7]=c):c=e[7];let u;e[8]!==n||e[9]!==c?(u=t.jsxs("div",{className:"flex items-start justify-between",children:[n,c]}),e[8]=n,e[9]=c,e[10]=u):u=e[10];let r;e[11]!==s.control?(r=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(be,{control:s.control,name:"title",render:ns}),t.jsx(be,{control:s.control,name:"description",render:ls})]}),e[11]=s.control,e[12]=r):r=e[12];let g;e[13]!==u||e[14]!==r?(g=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[u,r]}),e[13]=u,e[14]=r,e[15]=g):g=e[15];let f;e[16]!==s.control?(f=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(be,{control:s.control,name:"tool_selection_mode",render:os}),t.jsx(be,{control:s.control,name:"tool_selection_strategy",render:ss})]}),e[16]=s.control,e[17]=f):f=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-medium text-foreground mb-1",children:"System Prompt"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Stored locally for now"})]}),e[18]=p):p=e[18];let j;e[19]!==x?(j=C=>x(C.target.value),e[19]=x,e[20]=j):j=e[20];let y;e[21]!==i||e[22]!==j?(y=t.jsxs("div",{className:"flex flex-col gap-3 p-5",children:[p,t.jsx(Pt,{value:i,onChange:j,placeholder:"Enter system prompt instructions...",className:"min-h-[240px] resize-none text-sm leading-relaxed"})]}),e[21]=i,e[22]=j,e[23]=y):y=e[23];let v;e[24]!==y||e[25]!==g||e[26]!==f?(v=t.jsxs("div",{className:"flex flex-col",children:[g,f,y]}),e[24]=y,e[25]=g,e[26]=f,e[27]=v):v=e[27];let b;return e[28]!==s||e[29]!==v?(b=t.jsx("div",{className:"flex flex-col h-full overflow-auto",children:t.jsx($t,{...s,children:v})}),e[28]=s,e[29]=v,e[30]=b):b=e[30],b}function ss(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Qe,{className:"mb-0",children:"Agent Strategy"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(K,{children:t.jsxs(X,{children:[t.jsx(Y,{asChild:!0,children:t.jsx(L,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Agent strategy help",children:t.jsx(tt,{size:14,className:"text-muted-foreground"})})}),t.jsx(ee,{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(Ze,{value:e.value,onValueChange:e.onChange,children:[t.jsx(_e,{children:t.jsx(Ke,{className:"w-[180px]",children:t.jsx(Xe,{})})}),t.jsxs(Ye,{children:[t.jsx(je,{value:"passthrough",children:"Passthrough"}),t.jsx(je,{value:"smart_tool_selection",children:"Smart Tool Selection"}),t.jsx(je,{value:"code_execution",children:"Code Execution"})]})]})]})]}),t.jsx(Se,{})]})}function os(o){const{field:e}=o;return t.jsxs(ve,{children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx(Qe,{className:"mb-0",children:"Selection Mode"}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(K,{children:t.jsxs(X,{children:[t.jsx(Y,{asChild:!0,children:t.jsx(L,{type:"button",variant:"ghost",size:"icon",className:"size-7","aria-label":"Selection mode help",children:t.jsx(tt,{size:14,className:"text-muted-foreground"})})}),t.jsx(ee,{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(Ze,{value:e.value,onValueChange:e.onChange,children:[t.jsx(_e,{children:t.jsx(Ke,{className:"w-[180px]",children:t.jsx(Xe,{})})}),t.jsxs(Ye,{children:[t.jsx(je,{value:"inclusion",children:"Include Selected"}),t.jsx(je,{value:"exclusion",children:"Exclude Selected"})]})]})]})]}),t.jsx(Se,{})]})}function ls(o){const{field:e}=o;return t.jsxs(ve,{className:"w-full space-y-0",children:[t.jsx(_e,{children:t.jsx($e,{...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(Se,{})]})}function ns(o){const{field:e}=o;return t.jsxs(ve,{className:"w-full space-y-0",children:[t.jsx(_e,{children:t.jsx($e,{...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:"Agent Name"})}),t.jsx(Se,{})]})}function is(o){const{field:e}=o;return t.jsxs(ve,{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(_e,{children:t.jsx(bt,{checked:e.value==="active",onCheckedChange:s=>e.onChange(s?"active":"inactive")})})]}),t.jsx(Se,{})]})}function rs(o){const e=W.c(82),{gateway:s,gatewayId:l,requestedTabId:a}=o,x=rt().location.href,d=at();let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m={from:"/$org/gateways/$gatewayId"},e[0]=m):m=e[0];const n=Be(m),c=yt();let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u={},e[1]=u):u=e[1];const r=qe(u);let g;e[2]!==r?(g=r.map(cs),e[2]=r,e[3]=g):g=e[3];const f=g,{promptsMap:p}=_t(f),{resourcesMap:j}=St(f);let y;if(e[4]!==r){y=new Map;for(const T of r)T.tools&&T.tools.length>0&&y.set(T.id,T.tools.map(as));e[4]=r,e[5]=y}else y=e[5];let v;e[6]!==y||e[7]!==s?(v=()=>Fe(s,y),e[6]=y,e[7]=s,e[8]=v):v=e[8];const[b,C]=I.useState(v);let N;e[9]!==s?(N=()=>Le(s),e[9]=s,e[10]=N):N=e[10];const[k,w]=I.useState(N);let E;e[11]!==s?(E=()=>We(s),e[11]=s,e[12]=E):E=e[12];const[A,B]=I.useState(E),[Z,O]=I.useState(!1),[V,h]=I.useState(!1);let _;e[13]===Symbol.for("react.memo_cache_sentinel")?(_=T=>{C(T),O(!0)},e[13]=_):_=e[13];const $=_;let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=T=>{w(T),O(!0)},e[14]=z):z=e[14];const U=z;let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=T=>{B(T),O(!0)},e[15]=P):P=e[15];const M=P;let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=ct(Xt),e[16]=D):D=e[16];const q=s.tool_selection_mode??"inclusion",H=s.tool_selection_strategy??"passthrough";let J;e[17]!==s.description||e[18]!==s.status||e[19]!==s.title||e[20]!==q||e[21]!==H?(J={resolver:D,defaultValues:{title:s.title,description:s.description,status:s.status,tool_selection_mode:q,tool_selection_strategy:H}},e[17]=s.description,e[18]=s.status,e[19]=s.title,e[20]=q,e[21]=H,e[22]=J):J=e[22];const R=dt(J),se=R.formState.isDirty||Z;let oe;e[23]!==c.update||e[24]!==y||e[25]!==R||e[26]!==l||e[27]!==A||e[28]!==k||e[29]!==b?(oe=async()=>{const T=R.getValues(),Re=Yt(b,k,A,y);await c.update.mutateAsync({id:l,data:{title:T.title,description:T.description,status:T.status,tool_selection_mode:T.tool_selection_mode,tool_selection_strategy:T.tool_selection_strategy,connections:Re}}),R.reset(T),O(!1)},e[23]=c.update,e[24]=y,e[25]=R,e[26]=l,e[27]=A,e[28]=k,e[29]=b,e[30]=oe):oe=e[30];const xe=oe;let Q;e[31]!==y||e[32]!==R||e[33]!==s?(Q=()=>{R.reset({title:s.title,description:s.description,status:s.status,tool_selection_mode:s.tool_selection_mode??"inclusion",tool_selection_strategy:s.tool_selection_strategy??"passthrough"}),C(Fe(s,y)),w(Le(s)),B(We(s)),O(!1)},e[31]=y,e[32]=R,e[33]=s,e[34]=Q):Q=e[34];const pe=Q;let Ce;e[35]===Symbol.for("react.memo_cache_sentinel")?(Ce=[{id:"settings",label:"Settings"},{id:"tools",label:"Tools"},{id:"resources",label:"Resources"},{id:"prompts",label:"Prompts"}],e[35]=Ce):Ce=e[35];const Ge=Ce,G=Ge.some(T=>T.id===a)?a:"settings";let we;e[36]!==n?(we=T=>{n({search:Re=>({...Re,tab:T}),replace:!0})},e[36]=n,e[37]=we):we=e[37];const ze=we,ge=c.update.isPending;let le;e[38]!==d.history?(le=()=>d.history.back(),e[38]=d.history,e[39]=le):le=e[39];let ne;e[40]!==G||e[41]!==ze?(ne=t.jsx(At,{children:t.jsx(zt,{tabs:Ge,activeTab:G,onTabChange:ze})}),e[40]=G,e[41]=ze,e[42]=ne):ne=e[42];let ie;e[43]!==pe||e[44]!==xe||e[45]!==se||e[46]!==ge?(ie=se&&t.jsxs(t.Fragment,{children:[t.jsx(K,{children:t.jsxs(X,{delayDuration:0,children:[t.jsx(Y,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(L,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ge,onClick:pe,"aria-label":"Cancel",children:t.jsx(Rt,{size:14})})})}),t.jsx(ee,{side:"bottom",children:"Cancel"})]})}),t.jsx(K,{children:t.jsxs(X,{delayDuration:0,children:[t.jsx(Y,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(L,{variant:"outline",size:"icon",className:"size-7 border border-input",disabled:ge,onClick:xe,"aria-label":"Save",children:ge?t.jsx(Ee,{size:14,className:"animate-spin"}):t.jsx(st,{size:14})})})}),t.jsx(ee,{side:"bottom",children:"Save"})]})})]}),e[43]=pe,e[44]=xe,e[45]=se,e[46]=ge,e[47]=ie):ie=e[47];let Ne;e[48]===Symbol.for("react.memo_cache_sentinel")?(Ne=()=>h(!0),e[48]=Ne):Ne=e[48];let Ie;e[49]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsx(K,{children:t.jsxs(X,{delayDuration:0,children:[t.jsx(Y,{asChild:!0,children:t.jsx("span",{className:"inline-block",children:t.jsx(L,{variant:"outline",size:"icon",className:"size-7 border border-input",onClick:Ne,"aria-label":"Share",children:t.jsx(ot,{size:14})})})}),t.jsx(ee,{side:"bottom",children:"Share"})]})}),e[49]=Ie):Ie=e[49];const Pe=s.icon??"cpu_chip";let re;e[50]!==s.title||e[51]!==Pe||e[52]!==x?(re=t.jsx(pt,{title:s.title,url:x,icon:Pe}),e[50]=s.title,e[51]=Pe,e[52]=x,e[53]=re):re=e[53];let ae;e[54]!==ie||e[55]!==re?(ae=t.jsxs(Dt,{children:[ie,Ie,re]}),e[54]=ie,e[55]=re,e[56]=ae):ae=e[56];let ke;e[57]===Symbol.for("react.memo_cache_sentinel")?(ke=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Ee,{size:32,className:"animate-spin text-muted-foreground"})}),e[57]=ke):ke=e[57];let ce;e[58]!==G||e[59]!==p||e[60]!==j||e[61]!==R||e[62]!==s.icon||e[63]!==l||e[64]!==A||e[65]!==k||e[66]!==b?(ce=G==="settings"?t.jsx(ts,{form:R,icon:s.icon,gatewayId:l}):G==="tools"?t.jsx(gt,{toolSet:b,onToolSetChange:$}):G==="resources"?t.jsx(Ht,{resourceSet:k,onResourceSetChange:U,connectionResources:j}):G==="prompts"?t.jsx(Lt,{promptSet:A,onPromptSetChange:M,connectionPrompts:p}):null,e[58]=G,e[59]=p,e[60]=j,e[61]=R,e[62]=s.icon,e[63]=l,e[64]=A,e[65]=k,e[66]=b,e[67]=ce):ce=e[67];let de;e[68]!==ce?(de=t.jsx(I.Suspense,{fallback:ke,children:ce}),e[68]=ce,e[69]=de):de=e[69];let me;e[70]!==G||e[71]!==de?(me=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-hidden",children:t.jsx("div",{className:"h-full overflow-auto",children:t.jsx(He,{children:de},G)})})}),e[70]=G,e[71]=de,e[72]=me):me=e[72];let ue;e[73]!==s||e[74]!==V?(ue=t.jsx(es,{open:V,onOpenChange:h,gateway:s}),e[73]=s,e[74]=V,e[75]=ue):ue=e[75];let Te;return e[76]!==le||e[77]!==ne||e[78]!==ae||e[79]!==me||e[80]!==ue?(Te=t.jsxs(Et,{onBack:le,children:[ne,ae,me,ue]}),e[76]=le,e[77]=ne,e[78]=ae,e[79]=me,e[80]=ue,e[81]=Te):Te=e[81],Te}function as(o){return o.name}function cs(o){return o.id}function ds(){const o=W.c(10);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/gateways/$gatewayId"},o[0]=e):e=o[0];const s=Be(e);let l;o[1]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/gateways/$gatewayId"},o[1]=l):l=o[1];const{gatewayId:a,org:i}=nt(l);let x;o[2]===Symbol.for("react.memo_cache_sentinel")?(x={from:"/shell/$org/gateways/$gatewayId"},o[2]=x):x=o[2];const m=it(x).tab||"settings",n=jt(a);if(!n){let u;return o[3]!==s||o[4]!==i?(u=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(mt,{title:"Agent not found",description:"This Agent may have been deleted or you may not have access.",actions:t.jsx(L,{variant:"outline",onClick:()=>s({to:"/$org/gateways",params:{org:i}}),children:"Back to agents"})})}),o[3]=s,o[4]=i,o[5]=u):u=o[5],u}let c;return o[6]!==n||o[7]!==a||o[8]!==m?(c=t.jsx(rs,{gateway:n,gatewayId:a,requestedTabId:m}),o[6]=n,o[7]=a,o[8]=m,o[9]=c):c=o[9],c}function ms(){const o=W.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(He,{children:t.jsx(I.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ee,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(ds,{})})}),o[0]=e):e=o[0],e}function Ws(){const o=W.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ms,{}),o[0]=e):e=o[0],e}export{Ws as default};
@@ -1 +1 @@
1
- import{r as v,ai as K,c as w,j as n,aO as E}from"./index-DZBFXaT_.js";import{i as Y}from"./project-context-provider-6vMfUBpq.js";import{u as ee,i as Z}from"./use-gateway-DJ2wz6GD.js";import{I as Q,i as te}from"./use-connection-BVMsW9fR.js";import{b as se,a as le,c as ae,S as re}from"./select-bHRpmvzh.js";import{c as I,B as ne,I as oe}from"./input-KWjuSjzn.js";import{u as ie}from"./use-mobile-Cj5IONVM.js";const ce=({size:l=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));ce.displayName="Stop";function J({prop:l,defaultProp:e,onChange:t=()=>{}}){const[s,a]=de({defaultProp:e,onChange:t}),r=l!==void 0,o=r?l:s,i=K(t),c=v.useCallback(d=>{if(r){const f=typeof d=="function"?d(l):d;f!==l&&i(f)}else a(d)},[r,l,a,i]);return[o,c]}function de({defaultProp:l,onChange:e}){const t=v.useState(l),[s]=t,a=v.useRef(s),r=K(e);return v.useEffect(()=>{a.current!==s&&(r(s),a.current=s)},[s,a,r]),t}function fe(l){const e=w.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=n.jsx(E.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=s):s=e[3],s}function ue(l){const e=w.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=n.jsx(E.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function me(l){const e=w.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=n.jsx(E.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function pe(l){const e=w.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=I("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-black/50",t),e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r=n.jsx(E.Overlay,{"data-slot":"drawer-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=r):r=e[7],r}function xe(l){const e=w.c(12);let t,s,a;e[0]!==l?({className:s,children:t,...a}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(pe,{}),e[4]=r):r=e[4];let o;e[5]!==s?(o=I("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",s),e[5]=s,e[6]=o):o=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=i):i=e[7];let c;return e[8]!==t||e[9]!==a||e[10]!==o?(c=n.jsxs(me,{"data-slot":"drawer-portal",children:[r,n.jsxs(E.Content,{"data-slot":"drawer-content",className:o,...a,children:[i,t]})]}),e[8]=t,e[9]=a,e[10]=o,e[11]=c):c=e[11],c}function he(l){const e=w.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=I("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r=n.jsx("div",{"data-slot":"drawer-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=r):r=e[7],r}function we(l){const e=w.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=I("text-foreground font-semibold",t),e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r=n.jsx(E.Title,{"data-slot":"drawer-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=r):r=e[7],r}const X=v.createContext({isMobile:!1,setValue:()=>{}}),q=()=>v.useContext(X),ge=l=>{const e=w.c(37);let t,s,a,r,o,i,c,d;e[0]!==l?({children:t,defaultOpen:s,open:i,onOpenChange:r,defaultValue:a,value:d,onValueChange:o,...c}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=r,e[5]=o,e[6]=i,e[7]=c,e[8]=d):(t=e[1],s=e[2],a=e[3],r=e[4],o=e[5],i=e[6],c=e[7],d=e[8]);const p=ie(),f=s??!1;let m;e[9]!==r||e[10]!==i||e[11]!==f?(m={prop:i,defaultProp:f,onChange:r},e[9]=r,e[10]=i,e[11]=f,e[12]=m):m=e[12];const[x,h]=J(m);let C;e[13]!==a||e[14]!==o||e[15]!==d?(C={prop:d,defaultProp:a,onChange:o},e[13]=a,e[14]=o,e[15]=d,e[16]=C):C=e[16];const[S,k]=J(C);let $;e[17]!==k?($=M=>{M&&k(M)},e[17]=k,e[18]=$):$=e[18];const y=$;let b;e[19]!==p||e[20]!==y?(b={isMobile:p,setValue:y},e[19]=p,e[20]=y,e[21]=b):b=e[21];let j;e[22]!==t||e[23]!==x||e[24]!==c||e[25]!==h?(j=n.jsx(fe,{open:x,onOpenChange:h,...c,children:t}),e[22]=t,e[23]=x,e[24]=c,e[25]=h,e[26]=j):j=e[26];let g;e[27]!==x||e[28]!==c||e[29]!==h||e[30]!==y||e[31]!==j||e[32]!==S?(g=n.jsx(re,{open:x,onOpenChange:h,value:S,onValueChange:y,...c,children:j}),e[27]=x,e[28]=c,e[29]=h,e[30]=y,e[31]=j,e[32]=S,e[33]=g):g=e[33];let N;return e[34]!==b||e[35]!==g?(N=n.jsx(X.Provider,{value:b,children:g}),e[34]=b,e[35]=g,e[36]=N):N=e[36],N},ve=l=>{const{children:e,title:t,headerActions:s,...a}=l,{isMobile:r}=q(),{className:o,...i}=a;return r?n.jsxs(xe,{...i,children:[n.jsxs(he,{className:I(s?"flex flex-row items-center justify-between":"hidden"),children:[n.jsx(we,{children:t}),s]}),n.jsx("div",{className:I("flex flex-col gap-2 p-2 py-4",o),children:e})]}):n.jsx(ae,{...a,children:e})},be=l=>{const e=w.c(7);let t,s;e[0]!==l?({children:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);const{isMobile:a}=q();let r;return e[3]!==t||e[4]!==a||e[5]!==s?(r=a?n.jsx(ue,{asChild:!0,children:n.jsx(ne,{variant:"outline",...s,children:t})}):n.jsx(le,{...s,children:t}),e[3]=t,e[4]=a,e[5]=s,e[6]=r):r=e[6],r},je=l=>{const e=w.c(7);let t,s;e[0]!==l?({children:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);const{isMobile:a}=q();let r;return e[3]!==t||e[4]!==a||e[5]!==s?(r=a?n.jsx("span",{...s,children:t}):n.jsx(se,{...s,children:t}),e[3]=t,e[4]=a,e[5]=s,e[6]=r):r=e[6],r};function ye(){const l=w.c(4),e=ee();let t;l[0]!==e?(t=e??[],l[0]=e,l[1]=t):t=l[1];let s;return l[2]!==t?(s=t.map(Ce),l[2]=t,l[3]=s):s=l[3],s}function Ce(l){return{id:l.id,title:l.title,description:l.description??null,icon:l.icon??null,fallbackIcon:n.jsx(Z,{})}}function Ne(l){const e=w.c(24),{gateway:t,isSelected:s}=l,a=s&&"bg-accent";let r;e[0]!==a?(r=I("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-lg",a),e[0]=a,e[1]=r):r=e[1];let o;e[2]!==t.fallbackIcon?(o=t.fallbackIcon??n.jsx(Z,{}),e[2]=t.fallbackIcon,e[3]=o):o=e[3];let i;e[4]!==t.icon||e[5]!==t.title||e[6]!==o?(i=n.jsx(Q,{icon:t.icon,name:t.title,size:"sm",fallbackIcon:o,className:"size-10"}),e[4]=t.icon,e[5]=t.title,e[6]=o,e[7]=i):i=e[7];let c;e[8]!==t.title?(c=n.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[8]=t.title,e[9]=c):c=e[9];let d;e[10]!==s?(d=s&&n.jsx(Y,{size:16,className:"text-foreground shrink-0"}),e[10]=s,e[11]=d):d=e[11];let p;e[12]!==c||e[13]!==d?(p=n.jsxs("div",{className:"flex items-center justify-between",children:[c,d]}),e[12]=c,e[13]=d,e[14]=p):p=e[14];let f;e[15]!==t.description?(f=t.description&&n.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:t.description}),e[15]=t.description,e[16]=f):f=e[16];let m;e[17]!==p||e[18]!==f?(m=n.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[p,f]}),e[17]=p,e[18]=f,e[19]=m):m=e[19];let x;return e[20]!==r||e[21]!==i||e[22]!==m?(x=n.jsxs("div",{className:r,children:[i,m]}),e[20]=r,e[21]=i,e[22]=m,e[23]=x):x=e[23],x}function Se(l){const e=w.c(12),{gateway:t}=l;if(!t){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("span",{className:"text-sm text-muted-foreground",children:"Select agent"}),e[0]=i):i=e[0],i}let s;e[1]!==t.fallbackIcon?(s=t.fallbackIcon??n.jsx(Z,{}),e[1]=t.fallbackIcon,e[2]=s):s=e[2];let a;e[3]!==t.icon||e[4]!==t.title||e[5]!==s?(a=n.jsx(Q,{icon:t.icon,name:t.title,size:"xs",fallbackIcon:s,className:"w-5! h-5! min-w-5! shrink-0 rounded-sm"}),e[3]=t.icon,e[4]=t.title,e[5]=s,e[6]=a):a=e[6];let r;e[7]!==t.title?(r=n.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors truncate min-w-0 max-w-[200px] hidden sm:inline-block",children:t.title}),e[7]=t.title,e[8]=r):r=e[8];let o;return e[9]!==a||e[10]!==r?(o=n.jsxs("div",{className:"flex items-center gap-2 min-w-0 max-w-full",children:[a,r]}),e[9]=a,e[10]=r,e[11]=o):o=e[11],o}function ze(l){const e=w.c(47),{selectedGatewayId:t,onGatewayChange:s,variant:a,className:r,placeholder:o}=l,i=a===void 0?"bordered":a,c=o===void 0?"Select Agent":o,[d,p]=v.useState(!1),[f,m]=v.useState(""),x=v.useRef(null),h=ye();let C,S;e[0]!==d?(C=()=>{d&&setTimeout(()=>{x.current?.focus()},0)},S=[d],e[0]=d,e[1]=C,e[2]=S):(C=e[1],S=e[2]),v.useEffect(C,S);let k;if(e[3]!==h||e[4]!==t){let u;e[6]!==t?(u=H=>H.id===t,e[6]=t,e[7]=u):u=e[7],k=h.find(u),e[3]=h,e[4]=t,e[5]=k}else k=e[5];const $=k;let y;e:{if(!f.trim()){y=h;break e}let u;if(e[8]!==h||e[9]!==f){const H=f.toLowerCase();u=h.filter(F=>F.title.toLowerCase().includes(H)||F.description?.toLowerCase().includes(H)),e[8]=h,e[9]=f,e[10]=u}else u=e[10];y=u}const b=y;let j;e[11]!==s?(j=u=>{s(u),m(""),p(!1)},e[11]=s,e[12]=j):j=e[12];const g=j;let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=u=>{p(u),u||m("")},e[13]=N):N=e[13];const M=N,U=t||"",W=i==="borderless"&&"border-0 md:border-none";let R;e[14]!==r||e[15]!==W?(R=I("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 max-w-full",W,r),e[14]=r,e[15]=W,e[16]=R):R=e[16];let D;e[17]!==$?(D=n.jsx(Se,{gateway:$}),e[17]=$,e[18]=D):D=e[18];let G;e[19]!==c||e[20]!==D?(G=n.jsx(je,{placeholder:c,className:"min-w-0 max-w-full",children:D}),e[19]=c,e[20]=D,e[21]=G):G=e[21];let _;e[22]!==R||e[23]!==G?(_=n.jsx(be,{size:"sm",className:R,children:G}),e[22]=R,e[23]=G,e[24]=_):_=e[24];let L;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(te,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[25]=L):L=e[25];let B;e[26]===Symbol.for("react.memo_cache_sentinel")?(B=u=>m(u.target.value),e[26]=B):B=e[26];let z;e[27]!==f?(z=n.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:n.jsxs("div",{className:"relative",children:[L,n.jsx(oe,{ref:x,type:"text",placeholder:"Search for an agent...",value:f,onChange:B,className:"pl-9 h-9 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none"})]})}),e[27]=f,e[28]=z):z=e[28];let O;e[29]!==b||e[30]!==g||e[31]!==t?(O=b.length>0?b.map(u=>n.jsx("div",{onClick:()=>g(u.id),className:"outline-none",children:n.jsx(Ne,{gateway:u,isSelected:u.id===t})},u.id)):n.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No agents found"}),e[29]=b,e[30]=g,e[31]=t,e[32]=O):O=e[32];let P;e[33]!==O?(P=n.jsx("div",{className:"overflow-y-auto p-2 flex flex-col gap-1",children:O}),e[33]=O,e[34]=P):P=e[34];let T;e[35]!==z||e[36]!==P?(T=n.jsxs("div",{className:"flex flex-col max-h-[300px]",children:[z,P]}),e[35]=z,e[36]=P,e[37]=T):T=e[37];let V;e[38]!==c||e[39]!==T?(V=n.jsx(ve,{title:c,className:"w-full md:w-[400px] p-0",side:"bottom",children:T}),e[38]=c,e[39]=T,e[40]=V):V=e[40];let A;return e[41]!==g||e[42]!==d||e[43]!==_||e[44]!==V||e[45]!==U?(A=n.jsxs(ge,{open:d,onOpenChange:M,value:U,onValueChange:g,children:[_,V]}),e[41]=g,e[42]=d,e[43]=_,e[44]=V,e[45]=U,e[46]=A):A=e[46],A}export{ue as D,ze as G,je as R,xe as a,he as b,we as c,fe as d,ye as e,be as f,ve as g,ge as h,ce as i,J as u};
1
+ import{r as v,ai as K,c as w,j as n,aO as E}from"./index-DHr9tFb0.js";import{i as Y}from"./project-context-provider-SYQQWwHt.js";import{u as ee,i as Z}from"./use-gateway-BAeublLm.js";import{I as Q,i as te}from"./use-connection-gZqQ1FAI.js";import{b as se,a as le,c as ae,S as re}from"./select-58kzPmSH.js";import{c as I,B as ne,I as oe}from"./input-C4WvdKkR.js";import{u as ie}from"./use-mobile-CXfyAVoY.js";const ce=({size:l=24,color:e="currentColor",...t})=>v.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t},v.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));ce.displayName="Stop";function J({prop:l,defaultProp:e,onChange:t=()=>{}}){const[s,a]=de({defaultProp:e,onChange:t}),r=l!==void 0,o=r?l:s,i=K(t),c=v.useCallback(d=>{if(r){const f=typeof d=="function"?d(l):d;f!==l&&i(f)}else a(d)},[r,l,a,i]);return[o,c]}function de({defaultProp:l,onChange:e}){const t=v.useState(l),[s]=t,a=v.useRef(s),r=K(e);return v.useEffect(()=>{a.current!==s&&(r(s),a.current=s)},[s,a,r]),t}function fe(l){const e=w.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=n.jsx(E.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=s):s=e[3],s}function ue(l){const e=w.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=n.jsx(E.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function me(l){const e=w.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=n.jsx(E.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function pe(l){const e=w.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=I("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-black/50",t),e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r=n.jsx(E.Overlay,{"data-slot":"drawer-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=r):r=e[7],r}function xe(l){const e=w.c(12);let t,s,a;e[0]!==l?({className:s,children:t,...a}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a):(t=e[1],s=e[2],a=e[3]);let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(pe,{}),e[4]=r):r=e[4];let o;e[5]!==s?(o=I("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",s),e[5]=s,e[6]=o):o=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=i):i=e[7];let c;return e[8]!==t||e[9]!==a||e[10]!==o?(c=n.jsxs(me,{"data-slot":"drawer-portal",children:[r,n.jsxs(E.Content,{"data-slot":"drawer-content",className:o,...a,children:[i,t]})]}),e[8]=t,e[9]=a,e[10]=o,e[11]=c):c=e[11],c}function he(l){const e=w.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=I("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r=n.jsx("div",{"data-slot":"drawer-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=r):r=e[7],r}function we(l){const e=w.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=I("text-foreground font-semibold",t),e[3]=t,e[4]=a):a=e[4];let r;return e[5]!==s||e[6]!==a?(r=n.jsx(E.Title,{"data-slot":"drawer-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=r):r=e[7],r}const X=v.createContext({isMobile:!1,setValue:()=>{}}),q=()=>v.useContext(X),ge=l=>{const e=w.c(37);let t,s,a,r,o,i,c,d;e[0]!==l?({children:t,defaultOpen:s,open:i,onOpenChange:r,defaultValue:a,value:d,onValueChange:o,...c}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=r,e[5]=o,e[6]=i,e[7]=c,e[8]=d):(t=e[1],s=e[2],a=e[3],r=e[4],o=e[5],i=e[6],c=e[7],d=e[8]);const p=ie(),f=s??!1;let m;e[9]!==r||e[10]!==i||e[11]!==f?(m={prop:i,defaultProp:f,onChange:r},e[9]=r,e[10]=i,e[11]=f,e[12]=m):m=e[12];const[x,h]=J(m);let C;e[13]!==a||e[14]!==o||e[15]!==d?(C={prop:d,defaultProp:a,onChange:o},e[13]=a,e[14]=o,e[15]=d,e[16]=C):C=e[16];const[S,k]=J(C);let $;e[17]!==k?($=M=>{M&&k(M)},e[17]=k,e[18]=$):$=e[18];const y=$;let b;e[19]!==p||e[20]!==y?(b={isMobile:p,setValue:y},e[19]=p,e[20]=y,e[21]=b):b=e[21];let j;e[22]!==t||e[23]!==x||e[24]!==c||e[25]!==h?(j=n.jsx(fe,{open:x,onOpenChange:h,...c,children:t}),e[22]=t,e[23]=x,e[24]=c,e[25]=h,e[26]=j):j=e[26];let g;e[27]!==x||e[28]!==c||e[29]!==h||e[30]!==y||e[31]!==j||e[32]!==S?(g=n.jsx(re,{open:x,onOpenChange:h,value:S,onValueChange:y,...c,children:j}),e[27]=x,e[28]=c,e[29]=h,e[30]=y,e[31]=j,e[32]=S,e[33]=g):g=e[33];let N;return e[34]!==b||e[35]!==g?(N=n.jsx(X.Provider,{value:b,children:g}),e[34]=b,e[35]=g,e[36]=N):N=e[36],N},ve=l=>{const{children:e,title:t,headerActions:s,...a}=l,{isMobile:r}=q(),{className:o,...i}=a;return r?n.jsxs(xe,{...i,children:[n.jsxs(he,{className:I(s?"flex flex-row items-center justify-between":"hidden"),children:[n.jsx(we,{children:t}),s]}),n.jsx("div",{className:I("flex flex-col gap-2 p-2 py-4",o),children:e})]}):n.jsx(ae,{...a,children:e})},be=l=>{const e=w.c(7);let t,s;e[0]!==l?({children:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);const{isMobile:a}=q();let r;return e[3]!==t||e[4]!==a||e[5]!==s?(r=a?n.jsx(ue,{asChild:!0,children:n.jsx(ne,{variant:"outline",...s,children:t})}):n.jsx(le,{...s,children:t}),e[3]=t,e[4]=a,e[5]=s,e[6]=r):r=e[6],r},je=l=>{const e=w.c(7);let t,s;e[0]!==l?({children:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);const{isMobile:a}=q();let r;return e[3]!==t||e[4]!==a||e[5]!==s?(r=a?n.jsx("span",{...s,children:t}):n.jsx(se,{...s,children:t}),e[3]=t,e[4]=a,e[5]=s,e[6]=r):r=e[6],r};function ye(){const l=w.c(4),e=ee();let t;l[0]!==e?(t=e??[],l[0]=e,l[1]=t):t=l[1];let s;return l[2]!==t?(s=t.map(Ce),l[2]=t,l[3]=s):s=l[3],s}function Ce(l){return{id:l.id,title:l.title,description:l.description??null,icon:l.icon??null,fallbackIcon:n.jsx(Z,{})}}function Ne(l){const e=w.c(24),{gateway:t,isSelected:s}=l,a=s&&"bg-accent";let r;e[0]!==a?(r=I("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-lg",a),e[0]=a,e[1]=r):r=e[1];let o;e[2]!==t.fallbackIcon?(o=t.fallbackIcon??n.jsx(Z,{}),e[2]=t.fallbackIcon,e[3]=o):o=e[3];let i;e[4]!==t.icon||e[5]!==t.title||e[6]!==o?(i=n.jsx(Q,{icon:t.icon,name:t.title,size:"sm",fallbackIcon:o,className:"size-10"}),e[4]=t.icon,e[5]=t.title,e[6]=o,e[7]=i):i=e[7];let c;e[8]!==t.title?(c=n.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[8]=t.title,e[9]=c):c=e[9];let d;e[10]!==s?(d=s&&n.jsx(Y,{size:16,className:"text-foreground shrink-0"}),e[10]=s,e[11]=d):d=e[11];let p;e[12]!==c||e[13]!==d?(p=n.jsxs("div",{className:"flex items-center justify-between",children:[c,d]}),e[12]=c,e[13]=d,e[14]=p):p=e[14];let f;e[15]!==t.description?(f=t.description&&n.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:t.description}),e[15]=t.description,e[16]=f):f=e[16];let m;e[17]!==p||e[18]!==f?(m=n.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[p,f]}),e[17]=p,e[18]=f,e[19]=m):m=e[19];let x;return e[20]!==r||e[21]!==i||e[22]!==m?(x=n.jsxs("div",{className:r,children:[i,m]}),e[20]=r,e[21]=i,e[22]=m,e[23]=x):x=e[23],x}function Se(l){const e=w.c(12),{gateway:t}=l;if(!t){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("span",{className:"text-sm text-muted-foreground",children:"Select agent"}),e[0]=i):i=e[0],i}let s;e[1]!==t.fallbackIcon?(s=t.fallbackIcon??n.jsx(Z,{}),e[1]=t.fallbackIcon,e[2]=s):s=e[2];let a;e[3]!==t.icon||e[4]!==t.title||e[5]!==s?(a=n.jsx(Q,{icon:t.icon,name:t.title,size:"xs",fallbackIcon:s,className:"w-5! h-5! min-w-5! shrink-0 rounded-sm"}),e[3]=t.icon,e[4]=t.title,e[5]=s,e[6]=a):a=e[6];let r;e[7]!==t.title?(r=n.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors truncate min-w-0 max-w-[200px] hidden sm:inline-block",children:t.title}),e[7]=t.title,e[8]=r):r=e[8];let o;return e[9]!==a||e[10]!==r?(o=n.jsxs("div",{className:"flex items-center gap-2 min-w-0 max-w-full",children:[a,r]}),e[9]=a,e[10]=r,e[11]=o):o=e[11],o}function ze(l){const e=w.c(47),{selectedGatewayId:t,onGatewayChange:s,variant:a,className:r,placeholder:o}=l,i=a===void 0?"bordered":a,c=o===void 0?"Select Agent":o,[d,p]=v.useState(!1),[f,m]=v.useState(""),x=v.useRef(null),h=ye();let C,S;e[0]!==d?(C=()=>{d&&setTimeout(()=>{x.current?.focus()},0)},S=[d],e[0]=d,e[1]=C,e[2]=S):(C=e[1],S=e[2]),v.useEffect(C,S);let k;if(e[3]!==h||e[4]!==t){let u;e[6]!==t?(u=H=>H.id===t,e[6]=t,e[7]=u):u=e[7],k=h.find(u),e[3]=h,e[4]=t,e[5]=k}else k=e[5];const $=k;let y;e:{if(!f.trim()){y=h;break e}let u;if(e[8]!==h||e[9]!==f){const H=f.toLowerCase();u=h.filter(F=>F.title.toLowerCase().includes(H)||F.description?.toLowerCase().includes(H)),e[8]=h,e[9]=f,e[10]=u}else u=e[10];y=u}const b=y;let j;e[11]!==s?(j=u=>{s(u),m(""),p(!1)},e[11]=s,e[12]=j):j=e[12];const g=j;let N;e[13]===Symbol.for("react.memo_cache_sentinel")?(N=u=>{p(u),u||m("")},e[13]=N):N=e[13];const M=N,U=t||"",W=i==="borderless"&&"border-0 md:border-none";let R;e[14]!==r||e[15]!==W?(R=I("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 max-w-full",W,r),e[14]=r,e[15]=W,e[16]=R):R=e[16];let D;e[17]!==$?(D=n.jsx(Se,{gateway:$}),e[17]=$,e[18]=D):D=e[18];let G;e[19]!==c||e[20]!==D?(G=n.jsx(je,{placeholder:c,className:"min-w-0 max-w-full",children:D}),e[19]=c,e[20]=D,e[21]=G):G=e[21];let _;e[22]!==R||e[23]!==G?(_=n.jsx(be,{size:"sm",className:R,children:G}),e[22]=R,e[23]=G,e[24]=_):_=e[24];let L;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(te,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[25]=L):L=e[25];let B;e[26]===Symbol.for("react.memo_cache_sentinel")?(B=u=>m(u.target.value),e[26]=B):B=e[26];let z;e[27]!==f?(z=n.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:n.jsxs("div",{className:"relative",children:[L,n.jsx(oe,{ref:x,type:"text",placeholder:"Search for an agent...",value:f,onChange:B,className:"pl-9 h-9 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none"})]})}),e[27]=f,e[28]=z):z=e[28];let O;e[29]!==b||e[30]!==g||e[31]!==t?(O=b.length>0?b.map(u=>n.jsx("div",{onClick:()=>g(u.id),className:"outline-none",children:n.jsx(Ne,{gateway:u,isSelected:u.id===t})},u.id)):n.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No agents found"}),e[29]=b,e[30]=g,e[31]=t,e[32]=O):O=e[32];let P;e[33]!==O?(P=n.jsx("div",{className:"overflow-y-auto p-2 flex flex-col gap-1",children:O}),e[33]=O,e[34]=P):P=e[34];let T;e[35]!==z||e[36]!==P?(T=n.jsxs("div",{className:"flex flex-col max-h-[300px]",children:[z,P]}),e[35]=z,e[36]=P,e[37]=T):T=e[37];let V;e[38]!==c||e[39]!==T?(V=n.jsx(ve,{title:c,className:"w-full md:w-[400px] p-0",side:"bottom",children:T}),e[38]=c,e[39]=T,e[40]=V):V=e[40];let A;return e[41]!==g||e[42]!==d||e[43]!==_||e[44]!==V||e[45]!==U?(A=n.jsxs(ge,{open:d,onOpenChange:M,value:U,onValueChange:g,children:[_,V]}),e[41]=g,e[42]=d,e[43]=_,e[44]=V,e[45]=U,e[46]=A):A=e[46],A}export{ue as D,ze as G,je as R,xe as a,he as b,we as c,fe as d,ye as e,be as f,ve as g,ge as h,ce as i,J as u};